ionbase-ui 0.84.0 → 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.
- package/dist/components/Checkbox.d.ts +39 -0
- package/dist/components/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox.js +77 -4
- package/dist/components/Checkbox.js.map +1 -1
- package/dist/components/Fieldset.d.ts +62 -0
- package/dist/components/Fieldset.d.ts.map +1 -0
- package/dist/components/Fieldset.js +58 -0
- package/dist/components/Fieldset.js.map +1 -0
- package/dist/components/Radio.d.ts +14 -0
- package/dist/components/Radio.d.ts.map +1 -1
- package/dist/components/Radio.js +15 -4
- package/dist/components/Radio.js.map +1 -1
- package/dist/components/SearchField.d.ts +36 -0
- package/dist/components/SearchField.d.ts.map +1 -0
- package/dist/components/SearchField.js +76 -0
- package/dist/components/SearchField.js.map +1 -0
- package/dist/components/index.d.ts +6 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +3 -1
- package/dist/components/index.js.map +1 -1
- package/dist/figma-descriptions.json +87 -77
- package/dist/figma-map.json +132 -3
- package/dist/meta/Checkbox.json +8 -6
- package/dist/meta/CheckboxGroup.json +268 -0
- package/dist/meta/Divider.json +2 -2
- package/dist/meta/Fieldset.json +162 -0
- package/dist/meta/Radio.json +0 -1
- package/dist/meta/RadioGroup.json +59 -7
- package/dist/meta/SearchField.json +487 -0
- package/dist/meta/Stepper.json +2 -2
- package/dist/meta/Tabs.json +3 -3
- package/dist/meta/components.json +1015 -45
- package/dist/meta/contrast.json +370 -74
- package/dist/meta/index.json +59 -8
- package/dist/meta/patterns/DataTable.json +14 -6
- package/dist/meta/patterns/Form.json +27 -2
- package/dist/meta/patterns/index.json +4 -2
- package/dist/styles/fieldset.css +65 -0
- package/dist/styles/index.css +2 -0
- package/dist/styles/radio.css +0 -20
- package/dist/styles/search-field.css +70 -0
- package/llms.txt +2 -2
- package/package.json +1 -1
package/dist/figma-map.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "ionbase-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.86.0",
|
|
4
4
|
"figmaFile": "gaLbGd0QNb1fUl6BjSpfBA",
|
|
5
5
|
"figmaExported": "2026-09-25",
|
|
6
6
|
"usage": "Given a Figma node id or component name, look it up here for the React component, its import, and how each Figma property maps onto a real prop. Every mapping is verified against both the Figma export and the TypeScript API on each build.",
|
|
@@ -539,6 +539,41 @@
|
|
|
539
539
|
}
|
|
540
540
|
}
|
|
541
541
|
},
|
|
542
|
+
"1501:475": {
|
|
543
|
+
"figmaComponent": "Checkbox Group",
|
|
544
|
+
"figmaNodeId": "1501:475",
|
|
545
|
+
"figmaPage": "Checkbox",
|
|
546
|
+
"component": "CheckboxGroup",
|
|
547
|
+
"import": "import { CheckboxGroup } from 'ionbase-ui';",
|
|
548
|
+
"docs": "components/checkbox-group/index.html.md",
|
|
549
|
+
"props": {
|
|
550
|
+
"Orientation": {
|
|
551
|
+
"prop": "orientation",
|
|
552
|
+
"values": {
|
|
553
|
+
"Vertical": "vertical",
|
|
554
|
+
"Horizontal": "horizontal"
|
|
555
|
+
}
|
|
556
|
+
},
|
|
557
|
+
"State": {
|
|
558
|
+
"prop": "isInvalid",
|
|
559
|
+
"when": {
|
|
560
|
+
"Error": true
|
|
561
|
+
},
|
|
562
|
+
"note": "Error recolours the helper and shows errorMessage in its place; pass the error copy as errorMessage, not description. Disabled is isDisabled on the group, which cascades to every Checkbox."
|
|
563
|
+
},
|
|
564
|
+
"Label#1501:0": {
|
|
565
|
+
"prop": "label"
|
|
566
|
+
},
|
|
567
|
+
"Helper Text#1501:7": {
|
|
568
|
+
"prop": "description",
|
|
569
|
+
"note": "the help text; while State=Error the same slot holds errorMessage"
|
|
570
|
+
},
|
|
571
|
+
"Show Helper#1501:14": {
|
|
572
|
+
"prop": "description",
|
|
573
|
+
"note": "an absent prop is the switch, so false means omit description"
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
},
|
|
542
577
|
"1167:247": {
|
|
543
578
|
"figmaComponent": "Citation",
|
|
544
579
|
"figmaNodeId": "1167:247",
|
|
@@ -1512,6 +1547,35 @@
|
|
|
1512
1547
|
}
|
|
1513
1548
|
}
|
|
1514
1549
|
},
|
|
1550
|
+
"1498:242": {
|
|
1551
|
+
"figmaComponent": "Search Field",
|
|
1552
|
+
"figmaNodeId": "1498:242",
|
|
1553
|
+
"figmaPage": "Search Field",
|
|
1554
|
+
"component": "SearchField",
|
|
1555
|
+
"import": "import { SearchField } from 'ionbase-ui';",
|
|
1556
|
+
"docs": "components/search-field/index.html.md",
|
|
1557
|
+
"props": {
|
|
1558
|
+
"Size": {
|
|
1559
|
+
"prop": "size",
|
|
1560
|
+
"values": {
|
|
1561
|
+
"Small": "sm",
|
|
1562
|
+
"Medium": "md",
|
|
1563
|
+
"Large": "lg"
|
|
1564
|
+
}
|
|
1565
|
+
},
|
|
1566
|
+
"State": {
|
|
1567
|
+
"prop": "isInvalid",
|
|
1568
|
+
"when": {
|
|
1569
|
+
"Invalid": true
|
|
1570
|
+
},
|
|
1571
|
+
"note": "Hover, Focus and Filled are CSS or content; Disabled is isDisabled and Read-only is isReadOnly — Input's split, because the box is Input's. The clear button Filled shows is not a prop: it appears whenever there is a query."
|
|
1572
|
+
},
|
|
1573
|
+
"Value#80:0": {
|
|
1574
|
+
"prop": "value",
|
|
1575
|
+
"note": "The query. Figma's text is also the placeholder until one is typed — pass that as placeholder, and name the field with aria-label, not the placeholder."
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
},
|
|
1515
1579
|
"1390:435": {
|
|
1516
1580
|
"figmaComponent": "Segmented Control",
|
|
1517
1581
|
"figmaNodeId": "1390:435",
|
|
@@ -2892,6 +2956,41 @@
|
|
|
2892
2956
|
}
|
|
2893
2957
|
}
|
|
2894
2958
|
},
|
|
2959
|
+
"Checkbox Group": {
|
|
2960
|
+
"figmaComponent": "Checkbox Group",
|
|
2961
|
+
"figmaNodeId": "1501:475",
|
|
2962
|
+
"figmaPage": "Checkbox",
|
|
2963
|
+
"component": "CheckboxGroup",
|
|
2964
|
+
"import": "import { CheckboxGroup } from 'ionbase-ui';",
|
|
2965
|
+
"docs": "components/checkbox-group/index.html.md",
|
|
2966
|
+
"props": {
|
|
2967
|
+
"Orientation": {
|
|
2968
|
+
"prop": "orientation",
|
|
2969
|
+
"values": {
|
|
2970
|
+
"Vertical": "vertical",
|
|
2971
|
+
"Horizontal": "horizontal"
|
|
2972
|
+
}
|
|
2973
|
+
},
|
|
2974
|
+
"State": {
|
|
2975
|
+
"prop": "isInvalid",
|
|
2976
|
+
"when": {
|
|
2977
|
+
"Error": true
|
|
2978
|
+
},
|
|
2979
|
+
"note": "Error recolours the helper and shows errorMessage in its place; pass the error copy as errorMessage, not description. Disabled is isDisabled on the group, which cascades to every Checkbox."
|
|
2980
|
+
},
|
|
2981
|
+
"Label#1501:0": {
|
|
2982
|
+
"prop": "label"
|
|
2983
|
+
},
|
|
2984
|
+
"Helper Text#1501:7": {
|
|
2985
|
+
"prop": "description",
|
|
2986
|
+
"note": "the help text; while State=Error the same slot holds errorMessage"
|
|
2987
|
+
},
|
|
2988
|
+
"Show Helper#1501:14": {
|
|
2989
|
+
"prop": "description",
|
|
2990
|
+
"note": "an absent prop is the switch, so false means omit description"
|
|
2991
|
+
}
|
|
2992
|
+
}
|
|
2993
|
+
},
|
|
2895
2994
|
"Citation": {
|
|
2896
2995
|
"figmaComponent": "Citation",
|
|
2897
2996
|
"figmaNodeId": "1167:247",
|
|
@@ -3865,6 +3964,35 @@
|
|
|
3865
3964
|
}
|
|
3866
3965
|
}
|
|
3867
3966
|
},
|
|
3967
|
+
"Search Field": {
|
|
3968
|
+
"figmaComponent": "Search Field",
|
|
3969
|
+
"figmaNodeId": "1498:242",
|
|
3970
|
+
"figmaPage": "Search Field",
|
|
3971
|
+
"component": "SearchField",
|
|
3972
|
+
"import": "import { SearchField } from 'ionbase-ui';",
|
|
3973
|
+
"docs": "components/search-field/index.html.md",
|
|
3974
|
+
"props": {
|
|
3975
|
+
"Size": {
|
|
3976
|
+
"prop": "size",
|
|
3977
|
+
"values": {
|
|
3978
|
+
"Small": "sm",
|
|
3979
|
+
"Medium": "md",
|
|
3980
|
+
"Large": "lg"
|
|
3981
|
+
}
|
|
3982
|
+
},
|
|
3983
|
+
"State": {
|
|
3984
|
+
"prop": "isInvalid",
|
|
3985
|
+
"when": {
|
|
3986
|
+
"Invalid": true
|
|
3987
|
+
},
|
|
3988
|
+
"note": "Hover, Focus and Filled are CSS or content; Disabled is isDisabled and Read-only is isReadOnly — Input's split, because the box is Input's. The clear button Filled shows is not a prop: it appears whenever there is a query."
|
|
3989
|
+
},
|
|
3990
|
+
"Value#80:0": {
|
|
3991
|
+
"prop": "value",
|
|
3992
|
+
"note": "The query. Figma's text is also the placeholder until one is typed — pass that as placeholder, and name the field with aria-label, not the placeholder."
|
|
3993
|
+
}
|
|
3994
|
+
}
|
|
3995
|
+
},
|
|
3868
3996
|
"Segmented Control": {
|
|
3869
3997
|
"figmaComponent": "Segmented Control",
|
|
3870
3998
|
"figmaNodeId": "1390:435",
|
|
@@ -4733,12 +4861,13 @@
|
|
|
4733
4861
|
"DateRangePicker": "Drawn, but not as a set of its own: its field is Date Picker Type=Range and its calendar is Calendar Mode=Range. A Figma set maps to exactly one code component, and splitting one field into two sets to satisfy that would draw the same box twice. Read Date Picker’s Type note for the handoff.",
|
|
4734
4862
|
"Icon": "Figma has no Icon component; icons are vector assets dropped into slots. Icon is the React wrapper that gives any of them a size rung and an accessible label, so there is nothing on the Figma side to point at.",
|
|
4735
4863
|
"LogoMark": "Logo-Ionbase maps to Logo. Figma spells the no-wordmark case as that component's Type axis rather than a separate component; LogoMark is how code spells the same thing.",
|
|
4736
|
-
"RadioGroup": "Figma draws Radio only. The group is the thing that owns the selected value, which a static frame cannot express — Figma's Radio State axis is ignored for exactly this reason.",
|
|
4864
|
+
"RadioGroup": "Figma draws Radio only. The group is the thing that owns the selected value, which a static frame cannot express — Figma's Radio State axis is ignored for exactly this reason. Its label, help, error and orientation are the shell drawn as Checkbox Group; the two groups share it in code as well.",
|
|
4737
4865
|
"ScrollProgress": "Drawn in Figma as its three parts — Line, Progress, Progress Heading — all of which the component owns internally. There is no whole-component frame to map.",
|
|
4738
4866
|
"Table": "Figma draws Table Row and Table Cell; the table itself is the caller assembling them. Density, the one property Table owns, is mapped on Table Cell.",
|
|
4739
4867
|
"TableBody": "As TableHead.",
|
|
4740
4868
|
"TableHead": "As Table — a code-side grouping element. Figma expresses a header row as a Table Row variant, not a separate component.",
|
|
4741
4869
|
"ToastProvider": "Figma draws Toast, which is mapped. The provider is placement, queueing and the live region — runtime behaviour with nothing to draw.",
|
|
4742
|
-
"MenuTrigger": "Composition, not a drawing: a Button followed by a Menu, both already drawn and mapped. What MenuTrigger adds — open state, positioning, aria-haspopup and aria-expanded, focus on open and return on close — is runtime behaviour a static frame cannot hold, the same reason RadioGroup is here."
|
|
4870
|
+
"MenuTrigger": "Composition, not a drawing: a Button followed by a Menu, both already drawn and mapped. What MenuTrigger adds — open state, positioning, aria-haspopup and aria-expanded, focus on open and return on close — is runtime behaviour a static frame cannot hold, the same reason RadioGroup is here.",
|
|
4871
|
+
"Fieldset": "Drawn as the shell of Checkbox Group: the legend, the helper and the Error recolour are Form Field's type, laid around a set of options. A Fieldset of Inputs is the caller composing Form Fields under that legend, so there is no separate frame to point at."
|
|
4743
4872
|
}
|
|
4744
4873
|
}
|
package/dist/meta/Checkbox.json
CHANGED
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
"summary": "A native checkbox with the system's styling, supporting an indeterminate state.",
|
|
9
9
|
"useWhen": [
|
|
10
10
|
"a single on/off choice inside a form that is submitted",
|
|
11
|
-
"selecting rows in a Table"
|
|
12
|
-
"several independent options where more than one may be picked"
|
|
11
|
+
"selecting rows in a Table"
|
|
13
12
|
],
|
|
14
13
|
"useInstead": [
|
|
15
14
|
{
|
|
@@ -17,6 +16,11 @@
|
|
|
17
16
|
"use": "Toggle",
|
|
18
17
|
"why": "a switch reads as a setting taking effect now; a checkbox reads as a value being collected"
|
|
19
18
|
},
|
|
19
|
+
{
|
|
20
|
+
"when": "several options answer one question",
|
|
21
|
+
"use": "CheckboxGroup",
|
|
22
|
+
"why": "it announces the question with each option, carries the group's error, and can require at least one"
|
|
23
|
+
},
|
|
20
24
|
{
|
|
21
25
|
"when": "the options are mutually exclusive",
|
|
22
26
|
"use": "RadioGroup"
|
|
@@ -148,8 +152,7 @@
|
|
|
148
152
|
"sm",
|
|
149
153
|
"md",
|
|
150
154
|
"lg"
|
|
151
|
-
]
|
|
152
|
-
"default": "md"
|
|
155
|
+
]
|
|
153
156
|
},
|
|
154
157
|
"intent": {
|
|
155
158
|
"type": "CheckboxIntent | undefined",
|
|
@@ -160,8 +163,7 @@
|
|
|
160
163
|
"neutral",
|
|
161
164
|
"danger",
|
|
162
165
|
"brand"
|
|
163
|
-
]
|
|
164
|
-
"default": "brand"
|
|
166
|
+
]
|
|
165
167
|
},
|
|
166
168
|
"isIndeterminate": {
|
|
167
169
|
"type": "boolean | undefined",
|
|
@@ -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
|
+
}
|
package/dist/meta/Divider.json
CHANGED
|
@@ -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
|
+
}
|