Skip to content

Commit b682388

Browse files
committed
fix: update demos system
1 parent 202c12d commit b682388

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+4530
-3831
lines changed

apps/web/content/components/buttons/button.mdx

+8-8
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ links:
1616
---
1717

1818
<ComponentPreview
19-
name="button-default"
19+
name="core/button-default"
2020
preview={`<Button>button</Button>`}
2121
/>
2222

@@ -47,7 +47,7 @@ Use the `variant` prop to control the visual style of the button.<br/>
4747
The default variant is `"default"`.
4848

4949
<ComponentPreview
50-
name="demos/components/core/button/variants"
50+
name="core/button-variants"
5151
preview={`<Button variant="default">default</Button>
5252
<Button variant="primary">primary</Button>
5353
<Button variant="outline">outline</Button>
@@ -64,7 +64,7 @@ Use the `size` prop to control the size of the button.<br/>
6464
The default size is `"md"`.
6565

6666
<ComponentPreview
67-
name="demos/components/core/button/sizes"
67+
name="core/button-sizes"
6868
preview={`<Button size="sm">Button</Button>
6969
<Button size="md">Button</Button>
7070
<Button size="lg">Button</Button>`}
@@ -76,7 +76,7 @@ Use the `shape` prop to control the shape of the button. The default variant is
7676
Icon-only buttons should include an `aria-label`.
7777

7878
<ComponentPreview
79-
name="demos/components/core/button/shapes"
79+
name="core/button-shapes"
8080
preview={`<Button shape="square"><UplaodIcon /></UplaodIcon>
8181
<Button shape="circular"><UplaodIcon /></Button>`}
8282
/>
@@ -86,7 +86,7 @@ Icon-only buttons should include an `aria-label`.
8686
To add additional context for a button label, such as a search icon next to the label for a search field submit, use the `prefix` and `suffix` props. Leading visuals always appear locked to the button label, even if the button is full width.
8787

8888
<ComponentPreview
89-
name="demos/components/core/button/prefix-and-suffix"
89+
name="core/button-prefix-and-suffix"
9090
preview={`<Button prefix={<UplaodIcon />}>Upload</Button>
9191
<Button suffix={<UplaodIcon />}>Upload</Button>`}
9292
/>
@@ -96,7 +96,7 @@ To add additional context for a button label, such as a search icon next to the
9696
Use the `isLoading` prop to control the loading state of the button, if you need to wait for a button's action to be completed.
9797

9898
<ComponentPreview
99-
name="demos/components/core/button/loading"
99+
name="core/button-loading"
100100
preview={`<Button isLoading>Button</Button>`}
101101
/>
102102

@@ -105,7 +105,7 @@ Use the `isLoading` prop to control the loading state of the button, if you need
105105
Use the `isDisabled` prop to disable the button.
106106

107107
<ComponentPreview
108-
name="demos/components/core/button/disabled"
108+
name="core/button-disabled"
109109
preview={`<Button isDisabled>Button</Button>`}
110110
/>
111111

@@ -114,7 +114,7 @@ Use the `isDisabled` prop to disable the button.
114114
To use a button as a link, use the `href` prop the button will automatically render a link that visually looks like a button.
115115

116116
<ComponentPreview
117-
name="demos/components/core/button/link-button"
117+
name="core/button-link-button"
118118
preview={`<Button href="/login">Login</Button>`}
119119
/>
120120

apps/web/content/components/buttons/file-trigger.mdx

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ links:
1515
---
1616

1717
<ComponentPreview
18-
name="demos/components/core/file-trigger/default"
18+
name="core/file-trigger-default"
1919
preview={`<FileTrigger>
2020
<Button prefix={<UploadIcon />}>Upload</Button>
2121
</FileTrigger>`}
@@ -46,7 +46,7 @@ A `FileTrigger` wraps around a pressable child such as a button, and includes a
4646
By default, the file trigger will accept any file type. To support only certain file types, pass an array of the [mime type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types) of files via the `acceptedFileTypes` prop.
4747

4848
<ComponentPreview
49-
name="demos/components/core/file-trigger/file-types"
49+
name="core/file-trigger-file-types"
5050
preview={`<FileTrigger acceptedFileTypes={["image/*"]}>
5151
<Button prefix={<UploadIcon />}>Upload</Button>
5252
</FileTrigger>`}
@@ -57,7 +57,7 @@ By default, the file trigger will accept any file type. To support only certain
5757
A file trigger can accept multiple files by passsing the `allowsMultiple` prop.
5858

5959
<ComponentPreview
60-
name="demos/components/core/file-trigger/multiple-files"
60+
name="core/file-trigger-multiple-files"
6161
preview={`<FileTrigger allowMultiple>
6262
<Button prefix={<UploadIcon />}>Upload</Button>
6363
</FileTrigger>`}
@@ -69,7 +69,7 @@ To enable selecting directories instead of files, use the `acceptDirectory` prop
6969
This reflects the [webkitdirectory](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory) HTML attribute and allows users to select directories and their contents. Please note that support for this feature varies from browser to browser.
7070

7171
<ComponentPreview
72-
name="demos/components/core/file-trigger/directory-selection"
72+
name="core/file-trigger-directory-selection"
7373
preview={`<FileTrigger acceptDirectory>
7474
<Button prefix={<UploadIcon />}>Upload</Button>
7575
</FileTrigger>`}
@@ -81,7 +81,7 @@ To specify the media capture mechanism to capture media on the spot, pass user f
8181
This behavior only works on mobile devices. On desktop devices, it will open the file system like normal. [Read more about capture](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/capture).
8282

8383
<ComponentPreview
84-
name="demos/components/core/file-trigger/media-capture"
84+
name="core/file-trigger-media-capture"
8585
preview={`<FileTrigger defaultCamera="environment">
8686
<Button prefix={<UploadIcon />}>Upload</Button>
8787
</FileTrigger>`}

apps/web/content/components/buttons/index.mdx

-5
This file was deleted.

apps/web/content/components/buttons/toggle-button.mdx

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ links:
1616
---
1717

1818
<ComponentPreview
19-
name="demos/components/core/toggle-button/default"
19+
name="core/toggle-button-default"
2020
preview={`<ToggleButton><PinIcon /></ToggleButton>`}
2121
/>
2222

@@ -47,7 +47,7 @@ Use the `variant` prop to control the visual style of the toggle button.
4747
The default size is `"quiet"`.
4848

4949
<ComponentPreview
50-
name="demos/components/core/toggle-button/variants"
50+
name="core/toggle-button-variants"
5151
preview={`<ToggleButton variant="quiet"><PinIcon /></ToggleButton>
5252
<ToggleButton variant="outline"><PinIcon /></ToggleButton>
5353
<ToggleButton variant="accent"><PinIcon /></ToggleButton>`}
@@ -59,7 +59,7 @@ Use the `size` prop to control the size of the toggle button.<br/>
5959
The default size is `"md"`.
6060

6161
<ComponentPreview
62-
name="demos/components/core/toggle-button/sizes"
62+
name="core/toggle-button-sizes"
6363
preview={`<ToggleButton size="sm"><PinIcon /></ToggleButton>
6464
<ToggleButton size="md"><PinIcon /></ToggleButton>
6565
<ToggleButton size="lg"><PinIcon /></ToggleButton>`}
@@ -71,7 +71,7 @@ Use the `shape` prop to control the shape of the toggle button. The default shap
7171
Icon-only toggle buttons should include an `aria-label`.
7272

7373
<ComponentPreview
74-
name="demos/components/core/toggle-button/shapes"
74+
name="core/toggle-button-shapes"
7575
preview={`<ToggleButton shape="square"><PinIcon /></ToggleButton>
7676
<ToggleButton shape="circular"><PinIcon /></ToggleButton>
7777
<ToggleButton prefix={<PinIcon />} shape="rectangle">Pin</ToggleButton>`}
@@ -82,7 +82,7 @@ Icon-only toggle buttons should include an `aria-label`.
8282
Use the `isDisabled` prop to disable the toggle button.
8383

8484
<ComponentPreview
85-
name="demos/components/core/toggle-button/disabled"
85+
name="core/toggle-button-disabled"
8686
preview={`<ToggleButton isDisabled><PinIcon /></ToggleButton>`}
8787
/>
8888

@@ -91,7 +91,7 @@ Use the `isDisabled` prop to disable the toggle button.
9191
Use the `defaultSelected` to set the initial state of the toggle button.
9292

9393
<ComponentPreview
94-
name="demos/components/core/toggle-button/uncontrolled"
94+
name="core/toggle-button-uncontrolled"
9595
preview={`<ToggleButton defaultSelected><PinIcon /></ToggleButton>`}
9696
/>
9797

@@ -100,7 +100,7 @@ Use the `defaultSelected` to set the initial state of the toggle button.
100100
Use the `isSelected` and `onChange` props to control the state of the toggle button.
101101

102102
<ComponentPreview
103-
name="demos/components/core/toggle-button/controlled"
103+
name="core/toggle-button-controlled"
104104
preview={`const [isSelected, setSelected] = React.useState(true);
105105
return (
106106
<ToggleButton isSelected={isSelected} onChange={setSelected}>

apps/web/content/components/colors/color-area.mdx

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ links:
1616
---
1717

1818
<ComponentPreview
19-
name="demos/components/core/color-area/default"
19+
name="core/color-area-default"
2020
preview={`<ColorArea />`}
2121
/>
2222

@@ -46,7 +46,7 @@ Use `ColorArea` to allow users to adjust two channels of an RGB, HSL or HSB colo
4646
`xChannel` and `yChannel` props may be provided to specify which color channels the color area should display
4747

4848
<ComponentPreview
49-
name="demos/components/core/color-area/channels"
49+
name="core/color-area-channels"
5050
preview={`<ColorArea xChannel="red" yChannel="blue" />`}
5151
/>
5252

@@ -55,7 +55,7 @@ Use `ColorArea` to allow users to adjust two channels of an RGB, HSL or HSB colo
5555
Use the `isDisabled` prop to disable the color area.
5656

5757
<ComponentPreview
58-
name="demos/components/core/color-area/disabled"
58+
name="core/color-area-disabled"
5959
preview={`<ColorArea isDisabled />`}
6060
/>
6161

@@ -64,7 +64,7 @@ Use the `isDisabled` prop to disable the color area.
6464
An initial, uncontrolled value can be provided to the `ColorArea` using the `defaultValue` prop.
6565

6666
<ComponentPreview
67-
name="demos/components/core/color-area/uncontrolled"
67+
name="core/color-area-uncontrolled"
6868
preview={`<ColorArea defaultValue="hsl(30, 100%, 50%)" />`}
6969
/>
7070

@@ -73,7 +73,7 @@ An initial, uncontrolled value can be provided to the `ColorArea` using the `def
7373
Use the `value` and `onChange` props to control the value of the slider.
7474

7575
<ComponentPreview
76-
name="demos/components/core/color-area/controlled"
76+
name="core/color-area-controlled"
7777
preview={`const [value, setValue] = React.useState(parseColor("hsl(0, 100%, 50%)"))
7878
return <ColorArea value={value} onChange={setValue} xChannel="saturation" yChannel="lightness" />`}
7979
/>
@@ -83,7 +83,7 @@ return <ColorArea value={value} onChange={setValue} xChannel="saturation" yChann
8383
If you need to customize things further, you can drop down to the composition level.
8484

8585
<ComponentPreview
86-
name="demos/components/core/color-area/composition"
86+
name="core/color-area-composition"
8787
preview={`<ColorAreaRoot>
8888
<ColorThumb />
8989
</ColorAreaRoot>`}

apps/web/content/components/colors/color-field.mdx

+14-14
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ links:
1616
---
1717

1818
<ComponentPreview
19-
name="demos/components/core/color-field/default"
19+
name="core/color-field-default"
2020
preview={`<ColorField label="Color" />`}
2121
/>
2222

@@ -46,7 +46,7 @@ Use a `ColorField` to allow users to edit a hex color or individual color channe
4646
A visual label can be provided for the `ColorField` using the `label` prop or a hidden label using `aria-label` prop.
4747

4848
<ComponentPreview
49-
name="demos/components/core/color-field/label"
49+
name="core/color-field-label"
5050
preview={`<ColorField label="Background" placeholder="Visible label" />
5151
<ColorField aria-label="Background" placeholder="Hidden label" />`}
5252
/>
@@ -57,7 +57,7 @@ Use the `size` prop to control the size of the `ColorField`.<br/>
5757
The default variant is `"md"`.
5858

5959
<ComponentPreview
60-
name="demos/components/core/color-field/sizes"
60+
name="core/color-field-sizes"
6161
preview={`<ColorField label="small" size="sm" />
6262
<ColorField label="medium" size="md" />
6363
<ColorField label="large" size="lg" />`}
@@ -68,7 +68,7 @@ The default variant is `"md"`.
6868
To add additional context for the `ColorField`, use the `prefix` and `suffix` props.
6969

7070
<ComponentPreview
71-
name="demos/components/core/color-field/prefix-and-suffix"
71+
name="core/color-field-prefix-and-suffix"
7272
preview={`<ColorField prefix={<PaletteIcon />} />
7373
<ColorField suffix={<PaletteIcon />} />`}
7474
/>
@@ -78,7 +78,7 @@ To add additional context for the `ColorField`, use the `prefix` and `suffix` pr
7878
A description can be supplied to `ColorField` via the `description` prop. The description is always visible unless the `isInvalid` prop is `true` and an error message is provided.
7979

8080
<ComponentPreview
81-
name="demos/components/core/color-field/description"
81+
name="core/color-field-description"
8282
preview={`<ColorField label="Color" description="Enter a background color." />`}
8383
/>
8484

@@ -87,7 +87,7 @@ A description can be supplied to `ColorField` via the `description` prop. The de
8787
A ContextualHelp element may be placed next to the label to provide additional information or help about a ColorField.
8888

8989
<ComponentPreview
90-
name="demos/components/core/color-field/contextual-help"
90+
name="core/color-field-contextual-help"
9191
preview={`<ColorField label="Color" contextualHelp={<ContextualHelp />} />`}
9292
/>
9393

@@ -96,7 +96,7 @@ A ContextualHelp element may be placed next to the label to provide additional i
9696
An `errorMessage` can be supplied to `ColorField`, which will be displayed when the `isInvalid` prop is set to `true`.
9797

9898
<ComponentPreview
99-
name="demos/components/core/color-field/error-message"
99+
name="core/color-field-error-message"
100100
preview={`<ColorField label="Color" isInvalid errorMessage="Please fill out this field." />`}
101101
/>
102102

@@ -106,7 +106,7 @@ Use the `isLoading` prop to control the loading state of the ColorField.
106106
Use the `loaderPosition` prop to control the position of the loader.
107107

108108
<ComponentPreview
109-
name="demos/components/core/color-field/loading"
109+
name="core/color-field-loading"
110110
preview={`<ColorField isLoading loaderPosition="prefix" />
111111
<ColorField isLoading loaderPosition="suffix" />`}
112112
/>
@@ -116,7 +116,7 @@ Use the `loaderPosition` prop to control the position of the loader.
116116
Use the `isDisabled` prop to disable the `ColorField`.
117117

118118
<ComponentPreview
119-
name="demos/components/core/color-field/disabled"
119+
name="core/color-field-disabled"
120120
preview={`<ColorField value={parseColor("rgb(222,70,58)")} isDisabled />`}
121121
/>
122122

@@ -125,7 +125,7 @@ Use the `isDisabled` prop to disable the `ColorField`.
125125
The `isReadOnly` boolean prop makes the `ColorField`'s text content immutable. Unlike `isDisabled`, the `ColorField` remains focusable and the contents can still be copied.
126126

127127
<ComponentPreview
128-
name="demos/components/core/color-field/read-only"
128+
name="core/color-field-read-only"
129129
preview={`<ColorField label="Color" isReadOnly value="#121212" />`}
130130
/>
131131

@@ -135,7 +135,7 @@ Use the `isRequired` prop to mark the `ColorField` as required.
135135
Use the `necessityIndicator` prop to control the visual style of the required state.
136136

137137
<ComponentPreview
138-
name="demos/components/core/color-field/required"
138+
name="core/color-field-required"
139139
preview={`<ColorField label="Color" isRequired />
140140
<ColorField label="Color" isRequired necessityIndicator="icon" />
141141
<ColorField label="Color" isRequired necessityIndicator="label" />
@@ -147,7 +147,7 @@ Use the `necessityIndicator` prop to control the visual style of the required st
147147
Use the `value` and `onChange` props to control the value of the input.
148148

149149
<ComponentPreview
150-
name="demos/components/core/color-field/uncontrolled"
150+
name="core/color-field-uncontrolled"
151151
preview={`<ColorField defaultValue="#7f007f" />`}
152152
/>
153153

@@ -156,7 +156,7 @@ Use the `value` and `onChange` props to control the value of the input.
156156
Use the `value` and `onChange` props to control the value of the input.
157157

158158
<ComponentPreview
159-
name="demos/components/core/color-field/controlled"
159+
name="core/color-field-controlled"
160160
preview={`const [color, setColor] = React.useState<Color | null>(parseColor("#7f007f"));
161161
return <ColorField value={color} onChange={setColor} />`}
162162
/>
@@ -166,7 +166,7 @@ return <ColorField value={color} onChange={setColor} />`}
166166
If you need to customize things further, you can drop down to the composition level.
167167

168168
<ComponentPreview
169-
name="demos/components/core/color-field/composition"
169+
name="core/color-field-composition"
170170
preview={`<ColorFieldRoot>
171171
<Label>Background</Label>
172172
<InputRoot>

0 commit comments

Comments
 (0)