ionbase-ui 0.81.1 → 0.86.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.
Files changed (59) hide show
  1. package/dist/components/Checkbox.d.ts +39 -0
  2. package/dist/components/Checkbox.d.ts.map +1 -1
  3. package/dist/components/Checkbox.js +77 -4
  4. package/dist/components/Checkbox.js.map +1 -1
  5. package/dist/components/Fieldset.d.ts +62 -0
  6. package/dist/components/Fieldset.d.ts.map +1 -0
  7. package/dist/components/Fieldset.js +58 -0
  8. package/dist/components/Fieldset.js.map +1 -0
  9. package/dist/components/Menu.d.ts +87 -24
  10. package/dist/components/Menu.d.ts.map +1 -1
  11. package/dist/components/Menu.js +245 -28
  12. package/dist/components/Menu.js.map +1 -1
  13. package/dist/components/PageHeader.d.ts +59 -0
  14. package/dist/components/PageHeader.d.ts.map +1 -0
  15. package/dist/components/PageHeader.js +29 -0
  16. package/dist/components/PageHeader.js.map +1 -0
  17. package/dist/components/Radio.d.ts +14 -0
  18. package/dist/components/Radio.d.ts.map +1 -1
  19. package/dist/components/Radio.js +15 -4
  20. package/dist/components/Radio.js.map +1 -1
  21. package/dist/components/SearchField.d.ts +36 -0
  22. package/dist/components/SearchField.d.ts.map +1 -0
  23. package/dist/components/SearchField.js +76 -0
  24. package/dist/components/SearchField.js.map +1 -0
  25. package/dist/components/index.d.ts +10 -4
  26. package/dist/components/index.d.ts.map +1 -1
  27. package/dist/components/index.js +5 -2
  28. package/dist/components/index.js.map +1 -1
  29. package/dist/figma-descriptions.json +96 -76
  30. package/dist/figma-map.json +272 -39
  31. package/dist/meta/Checkbox.json +8 -6
  32. package/dist/meta/CheckboxGroup.json +268 -0
  33. package/dist/meta/Divider.json +2 -2
  34. package/dist/meta/Fieldset.json +162 -0
  35. package/dist/meta/Menu.json +201 -27
  36. package/dist/meta/MenuItem.json +137 -17
  37. package/dist/meta/MenuSection.json +90 -0
  38. package/dist/meta/MenuTrigger.json +177 -0
  39. package/dist/meta/PageHeader.json +169 -0
  40. package/dist/meta/Radio.json +0 -1
  41. package/dist/meta/RadioGroup.json +59 -7
  42. package/dist/meta/SearchField.json +487 -0
  43. package/dist/meta/Stepper.json +2 -2
  44. package/dist/meta/Tabs.json +3 -3
  45. package/dist/meta/components.json +1917 -217
  46. package/dist/meta/contrast.json +594 -90
  47. package/dist/meta/index.json +89 -10
  48. package/dist/meta/patterns/DataTable.json +14 -6
  49. package/dist/meta/patterns/Form.json +27 -2
  50. package/dist/meta/patterns/PageShell.json +18 -5
  51. package/dist/meta/patterns/index.json +5 -2
  52. package/dist/styles/fieldset.css +65 -0
  53. package/dist/styles/index.css +3 -0
  54. package/dist/styles/menu.css +153 -32
  55. package/dist/styles/page-header.css +94 -0
  56. package/dist/styles/radio.css +0 -20
  57. package/dist/styles/search-field.css +70 -0
  58. package/llms.txt +2 -2
  59. package/package.json +1 -1
@@ -0,0 +1,268 @@
1
+ {
2
+ "name": "CheckboxGroup",
3
+ "source": "src/components/Checkbox.tsx",
4
+ "propsType": "CheckboxGroupProps",
5
+ "description": "A set of checkboxes that answers one question — \"notify me when…\", \"which\nregions\". Owns the selected values, the group's label, help text and error,\nand \"select at least one\".\n\nA row of loose Checkboxes can do none of that accessibly: the question is\nnot announced with the options, an error has nothing to attach to, and\n\"at least one\" has no native expression at all. See the `required` note in\nCheckbox for how that last one is done.",
6
+ "import": "import { CheckboxGroup } from 'ionbase-ui';",
7
+ "status": "stable",
8
+ "summary": "A set of checkboxes answering one question. Owns the selected values, the group's label, help and error, and \"select at least one\".",
9
+ "useWhen": [
10
+ "several options may be picked and they answer one question — \"notify me when\", \"regions\", \"columns to show\"",
11
+ "the group needs a rule of its own — at least one, or an error that belongs to the set rather than to an option"
12
+ ],
13
+ "useInstead": [
14
+ {
15
+ "when": "only one option may be picked",
16
+ "use": "RadioGroup"
17
+ },
18
+ {
19
+ "when": "the options are many, or space is tight",
20
+ "use": "Select",
21
+ "why": "past about seven options a list of boxes is longer than the form around it"
22
+ },
23
+ {
24
+ "when": "there is one on/off choice",
25
+ "use": "Checkbox",
26
+ "why": "a group of one announces a question and then its only answer"
27
+ },
28
+ {
29
+ "when": "each option takes effect immediately",
30
+ "use": "Toggle"
31
+ }
32
+ ],
33
+ "composition": {
34
+ "order": [
35
+ "CheckboxGroup",
36
+ "Checkbox"
37
+ ],
38
+ "note": "Give every Checkbox a `value`; the group's `onChange` receives the array of ticked values. Selection lives on the group — do not also set `isSelected` on the boxes.",
39
+ "example": "<CheckboxGroup label=\"Notify the team when\" isRequired value={notifyOn} onChange={setNotifyOn} isInvalid={!!error} errorMessage={error}><Checkbox value=\"failed\">A run fails</Checkbox><Checkbox value=\"approval\">A run needs approval</Checkbox></CheckboxGroup>"
40
+ },
41
+ "variants": {
42
+ "size": {
43
+ "sm": {
44
+ "use": "dense forms and filter panels"
45
+ },
46
+ "md": {
47
+ "use": "the default"
48
+ },
49
+ "lg": {
50
+ "use": "touch targets and prominent choices"
51
+ }
52
+ },
53
+ "intent": {
54
+ "brand": {
55
+ "use": "the default"
56
+ },
57
+ "neutral": {
58
+ "use": "facts rather than approvals — the columns shown, the filters applied"
59
+ },
60
+ "danger": {
61
+ "use": "a set of destructive consents"
62
+ }
63
+ },
64
+ "orientation": {
65
+ "vertical": {
66
+ "use": "the default, and always when a label runs past a few words"
67
+ },
68
+ "horizontal": {
69
+ "use": "two to four one-word options — weekdays, regions. Wraps rather than overflows"
70
+ }
71
+ }
72
+ },
73
+ "slots": {
74
+ "label": {
75
+ "accepts": "text",
76
+ "note": "renders as the <legend> — the question the options answer"
77
+ },
78
+ "description": {
79
+ "accepts": "text",
80
+ "note": "help beneath the options; replaced by `errorMessage` while `isInvalid` is set"
81
+ },
82
+ "errorMessage": {
83
+ "accepts": "text",
84
+ "note": "shown only while `isInvalid` is set"
85
+ },
86
+ "children": {
87
+ "accepts": "Checkbox"
88
+ }
89
+ },
90
+ "a11y": {
91
+ "role": "group, from <fieldset> and <legend>",
92
+ "guarantees": [
93
+ "the legend is announced as the group's name when focus enters any box",
94
+ "the description or error is on every box's `aria-describedby` as well as the fieldset's, so it is read on the box that takes focus",
95
+ "`isInvalid` sets `aria-invalid` on every box",
96
+ "`isRequired` sets native `required` on every box while none is ticked and on none once one is: the browser blocks the submit in its own language, and each box announces \"required\" exactly while the rule is unmet",
97
+ "`isDisabled` cascades to every Checkbox that has not set its own"
98
+ ],
99
+ "requires": [
100
+ "`label`, or `aria-label` when the question is already visible elsewhere",
101
+ "a `value` on every Checkbox — the group tracks the selection by it"
102
+ ]
103
+ },
104
+ "antiPatterns": [
105
+ {
106
+ "dont": "loose Checkboxes under a text label",
107
+ "why": "the question is not announced with the options, an error has nothing to attach to, and \"at least one\" cannot be expressed"
108
+ },
109
+ {
110
+ "dont": "`isSelected` or `checked` on a Checkbox inside a group",
111
+ "why": "the group owns the selection; the box's own value is ignored"
112
+ },
113
+ {
114
+ "dont": "`isRequired` on every Checkbox in the group",
115
+ "why": "that means every box must be ticked; `isRequired` on the group means at least one"
116
+ }
117
+ ],
118
+ "stylesheet": "src/styles/checkbox.css",
119
+ "tokens": [
120
+ "--border-disabled",
121
+ "--border-error-strong",
122
+ "--border-focus",
123
+ "--border-inverse",
124
+ "--border-primary-strong",
125
+ "--border-stronger",
126
+ "--border-width-default",
127
+ "--border-width-thick",
128
+ "--font-family-sans",
129
+ "--icon-disabled",
130
+ "--icon-on-color",
131
+ "--ion-checkbox-border",
132
+ "--ion-checkbox-fill",
133
+ "--ion-checkbox-font-size",
134
+ "--ion-checkbox-gap",
135
+ "--ion-checkbox-line-height",
136
+ "--ion-checkbox-mark",
137
+ "--ion-checkbox-radius",
138
+ "--ion-checkbox-raised",
139
+ "--ion-checkbox-size",
140
+ "--ion-duration-base",
141
+ "--ion-ease-out",
142
+ "--ion-shadow-raised-flush-lg",
143
+ "--ion-shadow-raised-flush-sm",
144
+ "--ion-shadow-raised-flush-xs",
145
+ "--radius-sm",
146
+ "--radius-xs",
147
+ "--spacing-12",
148
+ "--spacing-16",
149
+ "--spacing-20",
150
+ "--spacing-24",
151
+ "--spacing-4",
152
+ "--spacing-8",
153
+ "--surface-default",
154
+ "--surface-disabled",
155
+ "--surface-error",
156
+ "--surface-inverse",
157
+ "--surface-primary",
158
+ "--text-disabled",
159
+ "--text-secondary",
160
+ "--type-body",
161
+ "--type-body-line-height",
162
+ "--type-body-sm",
163
+ "--type-body-sm-line-height"
164
+ ],
165
+ "props": {
166
+ "label": {
167
+ "type": "React.ReactNode",
168
+ "required": false,
169
+ "origin": "own",
170
+ "description": "The question the options answer. Renders as the `<legend>`."
171
+ },
172
+ "description": {
173
+ "type": "React.ReactNode",
174
+ "required": false,
175
+ "origin": "own",
176
+ "description": "Help text beneath the options. Replaced by `errorMessage` while invalid."
177
+ },
178
+ "errorMessage": {
179
+ "type": "React.ReactNode",
180
+ "required": false,
181
+ "origin": "own",
182
+ "description": "Shown in the description's place while `isInvalid` is set."
183
+ },
184
+ "isInvalid": {
185
+ "type": "boolean | undefined",
186
+ "required": false,
187
+ "origin": "own",
188
+ "description": "Marks every box invalid and shows `errorMessage`."
189
+ },
190
+ "isRequired": {
191
+ "type": "boolean | undefined",
192
+ "required": false,
193
+ "origin": "own",
194
+ "description": "At least one option must be selected — enforced by native validation."
195
+ },
196
+ "value": {
197
+ "type": "readonly string[] | undefined",
198
+ "required": false,
199
+ "origin": "own",
200
+ "description": "The selected values (controlled)."
201
+ },
202
+ "defaultValue": {
203
+ "type": "readonly string[] | undefined",
204
+ "required": false,
205
+ "origin": "own",
206
+ "description": "The initially selected values (uncontrolled)."
207
+ },
208
+ "onChange": {
209
+ "type": "((value: string[]) => void) | undefined",
210
+ "required": false,
211
+ "origin": "own",
212
+ "description": "Receives the whole new selection, in the order the options were ticked."
213
+ },
214
+ "name": {
215
+ "type": "string | undefined",
216
+ "required": false,
217
+ "origin": "own",
218
+ "description": "Shared input name, so a form submits every ticked value under it."
219
+ },
220
+ "size": {
221
+ "type": "CheckboxSize | undefined",
222
+ "required": false,
223
+ "origin": "own",
224
+ "values": [
225
+ "sm",
226
+ "md",
227
+ "lg"
228
+ ]
229
+ },
230
+ "intent": {
231
+ "type": "CheckboxIntent | undefined",
232
+ "required": false,
233
+ "origin": "own",
234
+ "values": [
235
+ "neutral",
236
+ "danger",
237
+ "brand"
238
+ ]
239
+ },
240
+ "isDisabled": {
241
+ "type": "boolean | undefined",
242
+ "required": false,
243
+ "origin": "own",
244
+ "description": "Whether every checkbox in the group is disabled."
245
+ },
246
+ "orientation": {
247
+ "type": "FieldsetOrientation | undefined",
248
+ "required": false,
249
+ "origin": "own",
250
+ "values": [
251
+ "vertical",
252
+ "horizontal"
253
+ ]
254
+ },
255
+ "children": {
256
+ "type": "React.ReactNode",
257
+ "required": false,
258
+ "origin": "own",
259
+ "description": "Checkboxes, each with a `value`."
260
+ }
261
+ },
262
+ "propCounts": {
263
+ "own": 14,
264
+ "aria": 0,
265
+ "dom": 276,
266
+ "other": 0
267
+ }
268
+ }
@@ -55,8 +55,8 @@
55
55
  "origin": "own",
56
56
  "description": "Matches Figma's `Style` variant.",
57
57
  "values": [
58
- "horizontal",
59
- "vertical"
58
+ "vertical",
59
+ "horizontal"
60
60
  ]
61
61
  }
62
62
  },
@@ -0,0 +1,162 @@
1
+ {
2
+ "name": "Fieldset",
3
+ "source": "src/components/Fieldset.tsx",
4
+ "propsType": "FieldsetProps",
5
+ "description": "Groups related fields under one label, with one description and one error —\nan address, a date range typed as two fields, a set of limits.\n\nFor checkboxes use CheckboxGroup and for radios RadioGroup: both render this\nsame shell, and add the selection state it deliberately does not own.\n\nThere is no `isDisabled`. A native `disabled` fieldset does disable every\ncontrol inside, but Input, Select and the rest draw their disabled state from\ntheir own prop, so the fields would stop working while still looking live.\nDisable the fields themselves; the choice groups can cascade because their\ncheckboxes and radios style off `:disabled`.",
6
+ "import": "import { Fieldset } from 'ionbase-ui';",
7
+ "status": "stable",
8
+ "summary": "A <fieldset>/<legend> that groups related fields under one label, one description and one error — an address, a pair of limits, a date typed as two fields.",
9
+ "useWhen": [
10
+ "several fields answer one question and a reader must hear the question with each of them — street, city and postcode under \"Billing address\"",
11
+ "one error belongs to the group rather than to a field — \"the minimum must be below the maximum\""
12
+ ],
13
+ "useInstead": [
14
+ {
15
+ "when": "the fields are checkboxes",
16
+ "use": "CheckboxGroup",
17
+ "why": "it renders this same shell and adds the selected values and \"select at least one\""
18
+ },
19
+ {
20
+ "when": "the fields are radios",
21
+ "use": "RadioGroup",
22
+ "why": "it renders this same shell and adds the shared name and the selected value"
23
+ },
24
+ {
25
+ "when": "a single field needs a label and help text",
26
+ "use": "Input",
27
+ "why": "every field already renders its own label, description and error; a fieldset around one field announces the label twice"
28
+ },
29
+ {
30
+ "when": "the grouping is visual — a titled section of a settings page",
31
+ "use": "Card",
32
+ "why": "a fieldset is a form grouping that assistive technology announces on entry; a section of unrelated settings is not one question"
33
+ }
34
+ ],
35
+ "composition": {
36
+ "order": [
37
+ "Fieldset",
38
+ "Input"
39
+ ],
40
+ "note": "Each field keeps its own label — the legend names the group, not the fields. Put a group-level error in `errorMessage` with `isInvalid`, and keep field-level errors on the fields.",
41
+ "example": "<Fieldset label=\"Run limits\" description=\"Runs stop at whichever comes first.\" orientation=\"horizontal\"><NumberInput label=\"Max steps\" /><NumberInput label=\"Max minutes\" /></Fieldset>"
42
+ },
43
+ "variants": {
44
+ "orientation": {
45
+ "vertical": {
46
+ "use": "the default — fields stacked, as a form reads"
47
+ },
48
+ "horizontal": {
49
+ "use": "two or three short fields that read as one value — a range, a size, a city and postcode. Wraps rather than overflows"
50
+ }
51
+ }
52
+ },
53
+ "slots": {
54
+ "label": {
55
+ "accepts": "text",
56
+ "note": "renders as the <legend> — the question the fields answer"
57
+ },
58
+ "description": {
59
+ "accepts": "text",
60
+ "note": "help beneath the fields; replaced by `errorMessage` while `isInvalid` is set, as Input's is"
61
+ },
62
+ "errorMessage": {
63
+ "accepts": "text",
64
+ "note": "the group's error, shown only while `isInvalid` is set"
65
+ },
66
+ "children": {
67
+ "accepts": "Input, Select, NumberInput, DatePicker and other fields"
68
+ }
69
+ },
70
+ "a11y": {
71
+ "role": "group, from <fieldset> and <legend>",
72
+ "guarantees": [
73
+ "the legend is announced as the group's name when focus enters any field inside",
74
+ "`aria-describedby` on the fieldset points at whichever of the description or the error is showing"
75
+ ],
76
+ "requires": [
77
+ "`label`, or `aria-label` when the question is already visible as a heading"
78
+ ],
79
+ "notes": [
80
+ "There is no `isDisabled`. A native disabled fieldset disables every control inside, but Input, Select and the rest draw their disabled look from their own prop — the fields would stop working while still looking live. Disable the fields themselves."
81
+ ]
82
+ },
83
+ "antiPatterns": [
84
+ {
85
+ "dont": "a Fieldset around one field",
86
+ "why": "the field's label and the legend both announce, saying the same thing twice"
87
+ },
88
+ {
89
+ "dont": "a Fieldset of Checkboxes",
90
+ "do": "<CheckboxGroup label=\"Notify me when\">…</CheckboxGroup>",
91
+ "why": "it looks the same, but nothing owns the selected values or \"select at least one\""
92
+ },
93
+ {
94
+ "dont": "<fieldset disabled> around Inputs",
95
+ "why": "the fields stop accepting input while still drawn as enabled"
96
+ }
97
+ ],
98
+ "stylesheet": "src/styles/fieldset.css",
99
+ "tokens": [
100
+ "--font-family-sans",
101
+ "--font-weight-medium",
102
+ "--font-weight-regular",
103
+ "--ion-fieldset-gap",
104
+ "--ion-fieldset-inline-gap",
105
+ "--spacing-16",
106
+ "--spacing-6",
107
+ "--spacing-8",
108
+ "--text-error",
109
+ "--text-secondary",
110
+ "--text-tertiary",
111
+ "--type-body-sm",
112
+ "--type-body-sm-line-height"
113
+ ],
114
+ "props": {
115
+ "label": {
116
+ "type": "React.ReactNode",
117
+ "required": false,
118
+ "origin": "own",
119
+ "description": "The question the fields answer. Renders as the `<legend>`."
120
+ },
121
+ "description": {
122
+ "type": "React.ReactNode",
123
+ "required": false,
124
+ "origin": "own",
125
+ "description": "Help text beneath the fields. Replaced by `errorMessage` while invalid."
126
+ },
127
+ "errorMessage": {
128
+ "type": "React.ReactNode",
129
+ "required": false,
130
+ "origin": "own",
131
+ "description": "Shown in the description's place while `isInvalid` is set."
132
+ },
133
+ "isInvalid": {
134
+ "type": "boolean | undefined",
135
+ "required": false,
136
+ "origin": "own",
137
+ "description": "Whether the group as a whole fails validation."
138
+ },
139
+ "orientation": {
140
+ "type": "FieldsetOrientation | undefined",
141
+ "required": false,
142
+ "origin": "own",
143
+ "description": "How the fields flow. Horizontal wraps rather than overflowing.",
144
+ "values": [
145
+ "vertical",
146
+ "horizontal"
147
+ ],
148
+ "default": "vertical"
149
+ },
150
+ "children": {
151
+ "type": "React.ReactNode",
152
+ "required": false,
153
+ "origin": "own"
154
+ }
155
+ },
156
+ "propCounts": {
157
+ "own": 6,
158
+ "aria": 0,
159
+ "dom": 279,
160
+ "other": 0
161
+ }
162
+ }