ionbase-ui 0.51.0 → 0.69.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion.d.ts +54 -0
- package/dist/components/Accordion.d.ts.map +1 -0
- package/dist/components/Accordion.js +68 -0
- package/dist/components/Accordion.js.map +1 -0
- package/dist/components/AgentActivity.d.ts +2 -1
- package/dist/components/AgentActivity.d.ts.map +1 -1
- package/dist/components/AgentActivity.js +4 -17
- package/dist/components/AgentActivity.js.map +1 -1
- package/dist/components/Breadcrumb.d.ts +45 -0
- package/dist/components/Breadcrumb.d.ts.map +1 -0
- package/dist/components/Breadcrumb.js +31 -0
- package/dist/components/Breadcrumb.js.map +1 -0
- package/dist/components/Calendar.d.ts +20 -0
- package/dist/components/Calendar.d.ts.map +1 -0
- package/dist/components/Calendar.js +151 -0
- package/dist/components/Calendar.js.map +1 -0
- package/dist/components/CalendarPopover.d.ts +26 -0
- package/dist/components/CalendarPopover.d.ts.map +1 -0
- package/dist/components/CalendarPopover.js +45 -0
- package/dist/components/CalendarPopover.js.map +1 -0
- package/dist/components/Checkbox.d.ts +2 -1
- package/dist/components/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox.js +4 -2
- package/dist/components/Checkbox.js.map +1 -1
- package/dist/components/Combobox.d.ts +86 -0
- package/dist/components/Combobox.d.ts.map +1 -0
- package/dist/components/Combobox.js +261 -0
- package/dist/components/Combobox.js.map +1 -0
- package/dist/components/DateField.d.ts +15 -0
- package/dist/components/DateField.d.ts.map +1 -0
- package/dist/components/DateField.js +74 -0
- package/dist/components/DateField.js.map +1 -0
- package/dist/components/DatePicker.d.ts +81 -0
- package/dist/components/DatePicker.d.ts.map +1 -0
- package/dist/components/DatePicker.js +102 -0
- package/dist/components/DatePicker.js.map +1 -0
- package/dist/components/DateRangePicker.d.ts +117 -0
- package/dist/components/DateRangePicker.d.ts.map +1 -0
- package/dist/components/DateRangePicker.js +152 -0
- package/dist/components/DateRangePicker.js.map +1 -0
- package/dist/components/Drawer.d.ts +52 -0
- package/dist/components/Drawer.d.ts.map +1 -0
- package/dist/components/Drawer.js +66 -0
- package/dist/components/Drawer.js.map +1 -0
- package/dist/components/FileUpload.d.ts +79 -0
- package/dist/components/FileUpload.d.ts.map +1 -0
- package/dist/components/FileUpload.js +218 -0
- package/dist/components/FileUpload.js.map +1 -0
- package/dist/components/Header.d.ts +10 -0
- package/dist/components/Header.d.ts.map +1 -1
- package/dist/components/Header.js +18 -3
- package/dist/components/Header.js.map +1 -1
- package/dist/components/NumberInput.d.ts +63 -0
- package/dist/components/NumberInput.d.ts.map +1 -0
- package/dist/components/NumberInput.js +102 -0
- package/dist/components/NumberInput.js.map +1 -0
- package/dist/components/ProgressBar.d.ts +46 -0
- package/dist/components/ProgressBar.d.ts.map +1 -0
- package/dist/components/ProgressBar.js +52 -0
- package/dist/components/ProgressBar.js.map +1 -0
- package/dist/components/PromptInput.d.ts +89 -0
- package/dist/components/PromptInput.d.ts.map +1 -0
- package/dist/components/PromptInput.js +130 -0
- package/dist/components/PromptInput.js.map +1 -0
- package/dist/components/SegmentedControl.d.ts +63 -0
- package/dist/components/SegmentedControl.d.ts.map +1 -0
- package/dist/components/SegmentedControl.js +79 -0
- package/dist/components/SegmentedControl.js.map +1 -0
- package/dist/components/Select.d.ts +9 -2
- package/dist/components/Select.d.ts.map +1 -1
- package/dist/components/Select.js.map +1 -1
- package/dist/components/Sidebar.d.ts +109 -0
- package/dist/components/Sidebar.d.ts.map +1 -0
- package/dist/components/Sidebar.js +106 -0
- package/dist/components/Sidebar.js.map +1 -0
- package/dist/components/Skeleton.d.ts +39 -0
- package/dist/components/Skeleton.d.ts.map +1 -0
- package/dist/components/Skeleton.js +50 -0
- package/dist/components/Skeleton.js.map +1 -0
- package/dist/components/Spinner.d.ts +45 -0
- package/dist/components/Spinner.d.ts.map +1 -0
- package/dist/components/Spinner.js +44 -0
- package/dist/components/Spinner.js.map +1 -0
- package/dist/components/Stepper.d.ts +73 -0
- package/dist/components/Stepper.d.ts.map +1 -0
- package/dist/components/Stepper.js +82 -0
- package/dist/components/Stepper.js.map +1 -0
- package/dist/components/Toggle.d.ts +2 -1
- package/dist/components/Toggle.d.ts.map +1 -1
- package/dist/components/Toggle.js +4 -2
- package/dist/components/Toggle.js.map +1 -1
- package/dist/components/ToolCall.d.ts +66 -0
- package/dist/components/ToolCall.d.ts.map +1 -0
- package/dist/components/ToolCall.js +78 -0
- package/dist/components/ToolCall.js.map +1 -0
- package/dist/components/agent-status.d.ts +14 -0
- package/dist/components/agent-status.d.ts.map +1 -0
- package/dist/components/agent-status.js +16 -0
- package/dist/components/agent-status.js.map +1 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +16 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/iso-date.d.ts +53 -0
- package/dist/components/iso-date.d.ts.map +1 -0
- package/dist/components/iso-date.js +102 -0
- package/dist/components/iso-date.js.map +1 -0
- package/dist/components/resolve-selection.d.ts +36 -0
- package/dist/components/resolve-selection.d.ts.map +1 -0
- package/dist/components/resolve-selection.js +14 -0
- package/dist/components/resolve-selection.js.map +1 -0
- package/dist/figma-descriptions.json +255 -145
- package/dist/figma-map.json +3205 -1860
- package/dist/meta/Accordion.json +123 -0
- package/dist/meta/AccordionItem.json +90 -0
- package/dist/meta/AgentActivityStep.json +2 -2
- package/dist/meta/Breadcrumb.json +87 -0
- package/dist/meta/BreadcrumbItem.json +78 -0
- package/dist/meta/Checkbox.json +18 -1
- package/dist/meta/Combobox.json +265 -0
- package/dist/meta/DatePicker.json +270 -0
- package/dist/meta/DateRangePicker.json +284 -0
- package/dist/meta/Drawer.json +234 -0
- package/dist/meta/EmptyState.json +1 -1
- package/dist/meta/FileUpload.json +246 -0
- package/dist/meta/Header.json +32 -2
- package/dist/meta/NumberInput.json +407 -0
- package/dist/meta/PhoneInput.json +39 -39
- package/dist/meta/Popover.json +3 -3
- package/dist/meta/ProgressBar.json +166 -0
- package/dist/meta/PromptInput.json +212 -0
- package/dist/meta/SegmentedControl.json +217 -0
- package/dist/meta/SegmentedControlItem.json +122 -0
- package/dist/meta/Select.json +4 -3
- package/dist/meta/Sidebar.json +150 -0
- package/dist/meta/SidebarItem.json +184 -0
- package/dist/meta/SidebarSection.json +131 -0
- package/dist/meta/Skeleton.json +120 -0
- package/dist/meta/Spinner.json +123 -0
- package/dist/meta/Stepper.json +135 -0
- package/dist/meta/StepperStep.json +148 -0
- package/dist/meta/Tabs.json +5 -0
- package/dist/meta/Toggle.json +18 -1
- package/dist/meta/ToolCall.json +192 -0
- package/dist/meta/Tooltip.json +3 -3
- package/dist/meta/components.json +6759 -2705
- package/dist/meta/contrast.json +11075 -3098
- package/dist/meta/index.json +266 -8
- package/dist/meta/patterns/AgentRun.json +27 -0
- package/dist/meta/patterns/Form.json +9 -0
- package/dist/meta/patterns/PageShell.json +43 -3
- package/dist/meta/patterns/Wizard.json +20 -1
- package/dist/meta/patterns/index.json +10 -1
- package/dist/styles/accordion.css +102 -0
- package/dist/styles/breadcrumb.css +72 -0
- package/dist/styles/combobox.css +154 -0
- package/dist/styles/date-picker.css +420 -0
- package/dist/styles/date-range-picker.css +280 -0
- package/dist/styles/drawer.css +181 -0
- package/dist/styles/empty-state.css +16 -4
- package/dist/styles/file-upload.css +236 -0
- package/dist/styles/header.css +26 -0
- package/dist/styles/index.css +23 -0
- package/dist/styles/number-input.css +83 -0
- package/dist/styles/progress-bar.css +107 -0
- package/dist/styles/prompt-input.css +127 -0
- package/dist/styles/segmented-control.css +182 -0
- package/dist/styles/sidebar.css +307 -0
- package/dist/styles/skeleton.css +76 -0
- package/dist/styles/spinner.css +70 -0
- package/dist/styles/stepper.css +250 -0
- package/dist/styles/tool-call.css +202 -0
- package/llms.txt +2 -2
- package/package.json +2 -1
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "FileUpload",
|
|
3
|
+
"source": "src/components/FileUpload.tsx",
|
|
4
|
+
"propsType": "FileUploadProps",
|
|
5
|
+
"description": "FileUpload — a drop target wrapped around a real `<input type=\"file\">`.\n\nDrawn in Figma as `File Upload` (1367:2333) — two sizes by five states. The\nmeasurements came from `Input` and `EmptyState` rather than being invented:\nthe border, radius and disabled treatment are Input's; the centred\nicon-over-text stack is EmptyState's. Figma draws the drop zone alone, the\nsame split `Input` makes against `Form Field`.\n\nTHE INPUT IS THE CONTROL. THE DROP ZONE IS DECORATION.\n\nThe usual build of this component is a `<div>` with drag handlers and a\nclick that calls `input.click()`. That version cannot be reached by keyboard,\nhas no accessible name, does not participate in a form, and does not work in\nany environment without a pointer — which includes switch access, voice\ncontrol and most screen-reader browse modes.\n\nHere the file input is a real, focusable, labelled control that is visually\nhidden but NOT `display: none` — it keeps its place in the tab order and its\nlabel. Drag-and-drop is layered on top as an enhancement, and every path it\noffers is also reachable without it. That ordering is the whole component.\n\nVALIDATION IS ADVISORY, NOT SECURITY. `accept` and `maxSize` are checked here\nso the user finds out immediately instead of after an upload. A server that\ntrusts either one is trusting a value the client chose.",
|
|
6
|
+
"import": "import { FileUpload } from 'ionbase-ui';",
|
|
7
|
+
"status": "stable",
|
|
8
|
+
"summary": "A drop target wrapped around a real file input, with client-side accept and size checks.",
|
|
9
|
+
"useWhen": [
|
|
10
|
+
"the user attaches one or more files to a form or a message",
|
|
11
|
+
"the constraints (types, size, count) should be stated before the upload is attempted rather than after"
|
|
12
|
+
],
|
|
13
|
+
"useInstead": [
|
|
14
|
+
{
|
|
15
|
+
"when": "a single file is picked and no drop target or file list is wanted",
|
|
16
|
+
"use": "a plain <input type=\"file\">",
|
|
17
|
+
"why": "this component adds a drop zone and a removable list; without either it is a heavier way to render the same control"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"when": "upload progress needs to be shown",
|
|
21
|
+
"use": "ProgressBar",
|
|
22
|
+
"why": "FileUpload selects files; it does not transfer them, and deliberately owns no network state"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"variants": {
|
|
26
|
+
"size": {
|
|
27
|
+
"sm": {
|
|
28
|
+
"use": "inside a dense form, or beside other fields"
|
|
29
|
+
},
|
|
30
|
+
"md": {
|
|
31
|
+
"use": "the default — a standalone attachment area"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"a11y": {
|
|
36
|
+
"guarantees": [
|
|
37
|
+
"the control is a real <input type=\"file\">, focusable and in the tab order — the drop zone is an enhancement layered on top, never the only way in",
|
|
38
|
+
"the zone is a <label> for that input, so clicking anywhere opens the picker without any script",
|
|
39
|
+
"the input is clipped to 1px rather than display:none, which would remove it from the tab order and the accessibility tree",
|
|
40
|
+
"the focus ring is drawn on the zone, where the user is looking, not on the clipped input",
|
|
41
|
+
"a polite live region announces the number of files held, because a drop changes nothing near the user's focus",
|
|
42
|
+
"dragging is signalled by a solid border as well as a colour, so it is not conveyed by colour alone (WCAG 1.4.1)",
|
|
43
|
+
"each remove button is a 24px target with a name that includes the file (WCAG 2.5.8)"
|
|
44
|
+
],
|
|
45
|
+
"requires": [
|
|
46
|
+
"`label`, or an `aria-label` — an unnamed file input announces only as \"button\"",
|
|
47
|
+
"`hint` describing the accepted types and size limit, since `accept` itself is never announced"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
"antiPatterns": [
|
|
51
|
+
{
|
|
52
|
+
"dont": "treating `accept` or `maxSize` as validation",
|
|
53
|
+
"why": "both are client-side and advisory. A browser does not enforce `accept` on drop, and every platform picker offers an \"All files\" escape. The server must check again"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"dont": "rebuilding this as a div with onClick={() => inputRef.current.click()}",
|
|
57
|
+
"why": "that version has no accessible name, no tab stop, no form participation and no keyboard path — it is the usual build of this component and the usual defect"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"dont": "putting the file list inside the drop zone",
|
|
61
|
+
"why": "the zone is a label, so every row in it — including each remove button — would also open the file picker"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"dont": "using `onChange` as a delta",
|
|
65
|
+
"why": "it fires with the complete list after every add and every remove, never with what changed"
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"slots": {
|
|
69
|
+
"prompt": {
|
|
70
|
+
"expects": "the call to action inside the zone"
|
|
71
|
+
},
|
|
72
|
+
"hint": {
|
|
73
|
+
"expects": "the constraints in words — \"PNG or JPG, up to 5 MB\""
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"stylesheet": "src/styles/file-upload.css",
|
|
77
|
+
"tokens": [
|
|
78
|
+
"--border-default",
|
|
79
|
+
"--border-disabled",
|
|
80
|
+
"--border-error",
|
|
81
|
+
"--border-focus",
|
|
82
|
+
"--border-strong",
|
|
83
|
+
"--border-width-default",
|
|
84
|
+
"--border-width-thick",
|
|
85
|
+
"--font-family-sans",
|
|
86
|
+
"--font-weight-medium",
|
|
87
|
+
"--icon-default",
|
|
88
|
+
"--icon-disabled",
|
|
89
|
+
"--icon-secondary",
|
|
90
|
+
"--icon-size-lg",
|
|
91
|
+
"--icon-size-md",
|
|
92
|
+
"--icon-size-sm",
|
|
93
|
+
"--ion-duration-base",
|
|
94
|
+
"--ion-ease-out",
|
|
95
|
+
"--ion-file-upload-gap",
|
|
96
|
+
"--ion-file-upload-icon-size",
|
|
97
|
+
"--ion-file-upload-padding",
|
|
98
|
+
"--radius-md",
|
|
99
|
+
"--radius-sm",
|
|
100
|
+
"--ring-focus",
|
|
101
|
+
"--spacing-12",
|
|
102
|
+
"--spacing-20",
|
|
103
|
+
"--spacing-24",
|
|
104
|
+
"--spacing-32",
|
|
105
|
+
"--spacing-6",
|
|
106
|
+
"--spacing-8",
|
|
107
|
+
"--surface-default",
|
|
108
|
+
"--surface-disabled",
|
|
109
|
+
"--surface-hover",
|
|
110
|
+
"--surface-primary-subtle",
|
|
111
|
+
"--surface-subtle",
|
|
112
|
+
"--text-default",
|
|
113
|
+
"--text-disabled",
|
|
114
|
+
"--text-tertiary",
|
|
115
|
+
"--type-body",
|
|
116
|
+
"--type-body-line-height",
|
|
117
|
+
"--type-body-sm",
|
|
118
|
+
"--type-body-sm-line-height"
|
|
119
|
+
],
|
|
120
|
+
"props": {
|
|
121
|
+
"label": {
|
|
122
|
+
"type": "React.ReactNode",
|
|
123
|
+
"required": false,
|
|
124
|
+
"origin": "own",
|
|
125
|
+
"description": "Field label. Also the accessible name of the file input."
|
|
126
|
+
},
|
|
127
|
+
"description": {
|
|
128
|
+
"type": "React.ReactNode",
|
|
129
|
+
"required": false,
|
|
130
|
+
"origin": "own",
|
|
131
|
+
"description": "Helper text below the control."
|
|
132
|
+
},
|
|
133
|
+
"errorMessage": {
|
|
134
|
+
"type": "React.ReactNode",
|
|
135
|
+
"required": false,
|
|
136
|
+
"origin": "own",
|
|
137
|
+
"description": "Replaces the helper text when `isInvalid` is set."
|
|
138
|
+
},
|
|
139
|
+
"isInvalid": {
|
|
140
|
+
"type": "boolean | undefined",
|
|
141
|
+
"required": false,
|
|
142
|
+
"origin": "own"
|
|
143
|
+
},
|
|
144
|
+
"isDisabled": {
|
|
145
|
+
"type": "boolean | undefined",
|
|
146
|
+
"required": false,
|
|
147
|
+
"origin": "own"
|
|
148
|
+
},
|
|
149
|
+
"size": {
|
|
150
|
+
"type": "FileUploadSize | undefined",
|
|
151
|
+
"required": false,
|
|
152
|
+
"origin": "own",
|
|
153
|
+
"description": "Matches the Figma `Size` variant when drawn. Height of the drop target.",
|
|
154
|
+
"values": [
|
|
155
|
+
"sm",
|
|
156
|
+
"md"
|
|
157
|
+
]
|
|
158
|
+
},
|
|
159
|
+
"accept": {
|
|
160
|
+
"type": "string | undefined",
|
|
161
|
+
"required": false,
|
|
162
|
+
"origin": "own",
|
|
163
|
+
"description": "Native `accept` — a comma-separated list of extensions or MIME types."
|
|
164
|
+
},
|
|
165
|
+
"multiple": {
|
|
166
|
+
"type": "boolean | undefined",
|
|
167
|
+
"required": false,
|
|
168
|
+
"origin": "own",
|
|
169
|
+
"description": "Allow more than one file."
|
|
170
|
+
},
|
|
171
|
+
"maxSize": {
|
|
172
|
+
"type": "number | undefined",
|
|
173
|
+
"required": false,
|
|
174
|
+
"origin": "own",
|
|
175
|
+
"description": "Reject anything larger, in bytes."
|
|
176
|
+
},
|
|
177
|
+
"maxFiles": {
|
|
178
|
+
"type": "number | undefined",
|
|
179
|
+
"required": false,
|
|
180
|
+
"origin": "own",
|
|
181
|
+
"description": "Reject once this many files are held. Only meaningful with `multiple`."
|
|
182
|
+
},
|
|
183
|
+
"files": {
|
|
184
|
+
"type": "readonly File[] | undefined",
|
|
185
|
+
"required": false,
|
|
186
|
+
"origin": "own",
|
|
187
|
+
"description": "The files held. Pass it to control the list; omit and the component keeps\nits own. A controlled list is the usual case, because the caller is the\nonly thing that knows which uploads have since succeeded or failed."
|
|
188
|
+
},
|
|
189
|
+
"onChange": {
|
|
190
|
+
"type": "((files: File[]) => void) | undefined",
|
|
191
|
+
"required": false,
|
|
192
|
+
"origin": "own",
|
|
193
|
+
"description": "Fires with the full list after every add or remove, never with a delta."
|
|
194
|
+
},
|
|
195
|
+
"onReject": {
|
|
196
|
+
"type": "((rejected: RejectedFile[]) => void) | undefined",
|
|
197
|
+
"required": false,
|
|
198
|
+
"origin": "own",
|
|
199
|
+
"description": "Fires with anything refused by `accept`, `maxSize` or `maxFiles`."
|
|
200
|
+
},
|
|
201
|
+
"prompt": {
|
|
202
|
+
"type": "React.ReactNode",
|
|
203
|
+
"required": false,
|
|
204
|
+
"origin": "own",
|
|
205
|
+
"description": "Call-to-action inside the drop target."
|
|
206
|
+
},
|
|
207
|
+
"hint": {
|
|
208
|
+
"type": "React.ReactNode",
|
|
209
|
+
"required": false,
|
|
210
|
+
"origin": "own",
|
|
211
|
+
"description": "Second line inside the drop target — the constraints, in words."
|
|
212
|
+
},
|
|
213
|
+
"removeLabel": {
|
|
214
|
+
"type": "((name: string) => string) | undefined",
|
|
215
|
+
"required": false,
|
|
216
|
+
"origin": "own",
|
|
217
|
+
"description": "Accessible label for each file's remove button. Receives the file name."
|
|
218
|
+
},
|
|
219
|
+
"className": {
|
|
220
|
+
"type": "string | undefined",
|
|
221
|
+
"required": false,
|
|
222
|
+
"origin": "own"
|
|
223
|
+
},
|
|
224
|
+
"wrapperClassName": {
|
|
225
|
+
"type": "string | undefined",
|
|
226
|
+
"required": false,
|
|
227
|
+
"origin": "own"
|
|
228
|
+
},
|
|
229
|
+
"id": {
|
|
230
|
+
"type": "string | undefined",
|
|
231
|
+
"required": false,
|
|
232
|
+
"origin": "own"
|
|
233
|
+
},
|
|
234
|
+
"name": {
|
|
235
|
+
"type": "string | undefined",
|
|
236
|
+
"required": false,
|
|
237
|
+
"origin": "own"
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
"propCounts": {
|
|
241
|
+
"own": 20,
|
|
242
|
+
"aria": 0,
|
|
243
|
+
"dom": 0,
|
|
244
|
+
"other": 0
|
|
245
|
+
}
|
|
246
|
+
}
|
package/dist/meta/Header.json
CHANGED
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
"guarantees": [
|
|
41
41
|
"the mobile toggle carries `aria-expanded` and `aria-controls` pointing at the menu container",
|
|
42
42
|
"Escape closes the open mobile menu — and the listener sits on the header, so a header that never opens never listens",
|
|
43
|
-
"the slots are rendered once, so no nav link exists twice in the accessibility tree"
|
|
43
|
+
"the slots are rendered once, so no nav link exists twice in the accessibility tree",
|
|
44
|
+
"with `menuType=\"dialog\"` the toggle carries `aria-haspopup=\"dialog\"` instead of `aria-controls` — the Drawer it opens is not in the DOM while closed — and comes first in DOM order as well as on screen"
|
|
44
45
|
],
|
|
45
46
|
"requires": [
|
|
46
47
|
"`menuLabel` — the mobile toggle is icon-only and has no other name"
|
|
@@ -61,8 +62,27 @@
|
|
|
61
62
|
{
|
|
62
63
|
"dont": "passing `open` without `onOpenChange`",
|
|
63
64
|
"why": "controlled with no handler means the toggle can never change it"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"dont": "a second menu button in `brand` to open a navigation Drawer",
|
|
68
|
+
"do": "<Header menuType=\"dialog\" open={navOpen} onOpenChange={setNavOpen} />",
|
|
69
|
+
"why": "the built-in toggle still renders, so a phone shows two menu buttons that open different things"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"dont": "NavItems in `center` with `menuType=\"dialog\"`",
|
|
73
|
+
"why": "nothing collapses them any more — they overflow a phone, and they duplicate the Sidebar the dialog opens"
|
|
64
74
|
}
|
|
65
75
|
],
|
|
76
|
+
"variants": {
|
|
77
|
+
"menuType": {
|
|
78
|
+
"panel": {
|
|
79
|
+
"use": "the default, Figma's Mobile-Open — `center` and `end` drop into a panel below the bar"
|
|
80
|
+
},
|
|
81
|
+
"dialog": {
|
|
82
|
+
"use": "the app's navigation is a Sidebar. The toggle moves to the start of the bar and only reports `onOpenChange`; open a Drawer holding the same Sidebar with it. `center` and `end` stay in the bar at every width"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
66
86
|
"stylesheet": "src/styles/header.css",
|
|
67
87
|
"tokens": [
|
|
68
88
|
"--border-default",
|
|
@@ -135,6 +155,16 @@
|
|
|
135
155
|
"origin": "own",
|
|
136
156
|
"description": "Accessible name for the mobile menu toggle."
|
|
137
157
|
},
|
|
158
|
+
"menuType": {
|
|
159
|
+
"type": "\"dialog\" | \"panel\" | undefined",
|
|
160
|
+
"required": false,
|
|
161
|
+
"origin": "own",
|
|
162
|
+
"description": "What the mobile toggle opens.\n\n`panel` (default) is Figma's Mobile-Open: `center` and `end` drop below the\nbar. `dialog` is for an app whose navigation lives in a Sidebar: the toggle\nsits at the start of the bar and only reports `onOpenChange`, the caller\nopens a Drawer with it, and `center` and `end` stay in the bar at every\nwidth — so keep `center` empty and `end` short.",
|
|
163
|
+
"values": [
|
|
164
|
+
"dialog",
|
|
165
|
+
"panel"
|
|
166
|
+
]
|
|
167
|
+
},
|
|
138
168
|
"children": {
|
|
139
169
|
"type": "React.ReactNode",
|
|
140
170
|
"required": false,
|
|
@@ -142,7 +172,7 @@
|
|
|
142
172
|
}
|
|
143
173
|
},
|
|
144
174
|
"propCounts": {
|
|
145
|
-
"own":
|
|
175
|
+
"own": 9,
|
|
146
176
|
"aria": 0,
|
|
147
177
|
"dom": 276,
|
|
148
178
|
"other": 0
|