@fragments-sdk/ui 0.17.1 → 0.18.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/fragments.json +1 -1
- package/package.json +3 -3
- package/src/components/Accordion/Accordion.contract.json +169 -0
- package/src/components/Alert/Alert.contract.json +157 -0
- package/src/components/AppShell/AppShell.contract.json +155 -0
- package/src/components/Avatar/Avatar.contract.json +189 -0
- package/src/components/Badge/Badge.contract.json +187 -0
- package/src/components/BentoGrid/BentoGrid.contract.json +135 -0
- package/src/components/Box/Box.contract.json +423 -0
- package/src/components/Breadcrumbs/Breadcrumbs.contract.json +143 -0
- package/src/components/Button/Button.contract.json +205 -0
- package/src/components/ButtonGroup/ButtonGroup.contract.json +140 -0
- package/src/components/Card/Card.contract.json +185 -0
- package/src/components/Chart/Chart.contract.json +129 -0
- package/src/components/Checkbox/Checkbox.contract.json +246 -0
- package/src/components/Chip/Chip.contract.json +212 -0
- package/src/components/CodeBlock/CodeBlock.contract.json +388 -0
- package/src/components/Collapsible/Collapsible.contract.json +154 -0
- package/src/components/ColorPicker/ColorPicker.contract.json +212 -0
- package/src/components/Combobox/Combobox.contract.json +297 -0
- package/src/components/Command/Command.contract.json +165 -0
- package/src/components/ConversationList/ConversationList.contract.json +151 -0
- package/src/components/DataTable/DataTable.contract.json +302 -0
- package/src/components/DatePicker/DatePicker.contract.json +288 -0
- package/src/components/Dialog/Dialog.contract.json +159 -0
- package/src/components/Drawer/Drawer.contract.json +160 -0
- package/src/components/Editor/Editor.contract.json +263 -0
- package/src/components/EmptyState/EmptyState.contract.json +133 -0
- package/src/components/Field/Field.contract.json +157 -0
- package/src/components/Fieldset/Fieldset.contract.json +117 -0
- package/src/components/Form/Form.contract.json +145 -0
- package/src/components/Grid/Grid.contract.json +195 -0
- package/src/components/Header/Header.contract.json +194 -0
- package/src/components/Icon/Icon.contract.json +194 -0
- package/src/components/Image/Image.contract.json +209 -0
- package/src/components/Input/Input.contract.json +344 -0
- package/src/components/Link/Link.contract.json +180 -0
- package/src/components/List/List.contract.json +154 -0
- package/src/components/Listbox/Listbox.contract.json +158 -0
- package/src/components/Loading/Loading.contract.json +167 -0
- package/src/components/Markdown/Markdown.contract.json +127 -0
- package/src/components/Menu/Menu.contract.json +177 -0
- package/src/components/Message/Message.contract.json +183 -0
- package/src/components/NavigationMenu/NavigationMenu.contract.json +203 -0
- package/src/components/Pagination/Pagination.contract.json +163 -0
- package/src/components/Popover/Popover.contract.json +163 -0
- package/src/components/Progress/Progress.contract.json +176 -0
- package/src/components/Prompt/Prompt.contract.json +211 -0
- package/src/components/RadioGroup/RadioGroup.contract.json +226 -0
- package/src/components/ScrollArea/ScrollArea.contract.json +131 -0
- package/src/components/Select/Select.contract.json +269 -0
- package/src/components/Separator/Separator.contract.json +143 -0
- package/src/components/Sidebar/Sidebar.contract.json +258 -0
- package/src/components/Skeleton/Skeleton.contract.json +166 -0
- package/src/components/Slider/Slider.contract.json +248 -0
- package/src/components/Stack/Stack.contract.json +220 -0
- package/src/components/Table/Table.contract.json +171 -0
- package/src/components/TableOfContents/TableOfContents.contract.json +145 -0
- package/src/components/Tabs/Tabs.contract.json +159 -0
- package/src/components/Text/Text.contract.json +239 -0
- package/src/components/Textarea/Textarea.contract.json +308 -0
- package/src/components/Theme/Theme.contract.json +152 -0
- package/src/components/ThinkingIndicator/ThinkingIndicator.contract.json +165 -0
- package/src/components/Toast/Toast.contract.json +181 -0
- package/src/components/Toggle/Toggle.contract.json +231 -0
- package/src/components/ToggleGroup/ToggleGroup.contract.json +206 -0
- package/src/components/Tooltip/Tooltip.contract.json +214 -0
- package/src/components/VisuallyHidden/VisuallyHidden.contract.json +116 -0
- package/src/tokens/_derive.scss +4 -1
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://usefragments.com/schemas/contract.v1.json",
|
|
3
|
+
"name": "Checkbox",
|
|
4
|
+
"description": "Binary toggle for form fields. Use for options that require explicit submission, unlike Switch which takes effect immediately.",
|
|
5
|
+
"category": "forms",
|
|
6
|
+
"tags": [
|
|
7
|
+
"checkbox",
|
|
8
|
+
"form",
|
|
9
|
+
"boolean",
|
|
10
|
+
"selection",
|
|
11
|
+
"input"
|
|
12
|
+
],
|
|
13
|
+
"status": "stable",
|
|
14
|
+
"sourcePath": "src/components/Checkbox/index.tsx",
|
|
15
|
+
"exportName": "Checkbox",
|
|
16
|
+
"propsSummary": [
|
|
17
|
+
"checked: boolean",
|
|
18
|
+
"defaultChecked: boolean",
|
|
19
|
+
"onCheckedChange: function",
|
|
20
|
+
"onChange: function",
|
|
21
|
+
"indeterminate: boolean (default: false)",
|
|
22
|
+
"disabled: boolean (default: false)",
|
|
23
|
+
"required: boolean (default: false)",
|
|
24
|
+
"size: sm|md|lg (default: md)",
|
|
25
|
+
"label: string",
|
|
26
|
+
"helperText: string",
|
|
27
|
+
"description: string",
|
|
28
|
+
"name: string",
|
|
29
|
+
"value: string",
|
|
30
|
+
"id: string",
|
|
31
|
+
"controlClassName: string",
|
|
32
|
+
"contentClassName: string",
|
|
33
|
+
"aria-label: string",
|
|
34
|
+
"aria-labelledby: string",
|
|
35
|
+
"aria-describedby: string"
|
|
36
|
+
],
|
|
37
|
+
"props": {
|
|
38
|
+
"checked": {
|
|
39
|
+
"type": "boolean",
|
|
40
|
+
"description": "Controlled checked state",
|
|
41
|
+
"required": false
|
|
42
|
+
},
|
|
43
|
+
"defaultChecked": {
|
|
44
|
+
"type": "boolean",
|
|
45
|
+
"description": "Default checked state (uncontrolled)",
|
|
46
|
+
"required": false
|
|
47
|
+
},
|
|
48
|
+
"onCheckedChange": {
|
|
49
|
+
"type": "function",
|
|
50
|
+
"description": "Called when checked state changes",
|
|
51
|
+
"required": false
|
|
52
|
+
},
|
|
53
|
+
"onChange": {
|
|
54
|
+
"type": "function",
|
|
55
|
+
"description": "Alias for onCheckedChange: (checked: boolean) => void",
|
|
56
|
+
"required": false
|
|
57
|
+
},
|
|
58
|
+
"indeterminate": {
|
|
59
|
+
"type": "boolean",
|
|
60
|
+
"description": "Indeterminate state (partial selection)",
|
|
61
|
+
"default": "false",
|
|
62
|
+
"required": false
|
|
63
|
+
},
|
|
64
|
+
"disabled": {
|
|
65
|
+
"type": "boolean",
|
|
66
|
+
"description": "Disable the checkbox",
|
|
67
|
+
"default": "false",
|
|
68
|
+
"required": false
|
|
69
|
+
},
|
|
70
|
+
"required": {
|
|
71
|
+
"type": "boolean",
|
|
72
|
+
"description": "Whether the checkbox is required",
|
|
73
|
+
"default": "false",
|
|
74
|
+
"required": false
|
|
75
|
+
},
|
|
76
|
+
"size": {
|
|
77
|
+
"type": "enum",
|
|
78
|
+
"description": "Checkbox size",
|
|
79
|
+
"default": "md",
|
|
80
|
+
"required": false,
|
|
81
|
+
"values": [
|
|
82
|
+
"sm",
|
|
83
|
+
"md",
|
|
84
|
+
"lg"
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
"label": {
|
|
88
|
+
"type": "string",
|
|
89
|
+
"description": "Label text",
|
|
90
|
+
"required": false
|
|
91
|
+
},
|
|
92
|
+
"helperText": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"description": "Helper text shown below the label (preferred)",
|
|
95
|
+
"required": false
|
|
96
|
+
},
|
|
97
|
+
"description": {
|
|
98
|
+
"type": "string",
|
|
99
|
+
"description": "Deprecated alias for helperText",
|
|
100
|
+
"required": false
|
|
101
|
+
},
|
|
102
|
+
"name": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"description": "Name attribute for form submission",
|
|
105
|
+
"required": false
|
|
106
|
+
},
|
|
107
|
+
"value": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"description": "Value attribute for form submission",
|
|
110
|
+
"required": false
|
|
111
|
+
},
|
|
112
|
+
"id": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"description": "ID for the checkbox input",
|
|
115
|
+
"required": false
|
|
116
|
+
},
|
|
117
|
+
"controlClassName": {
|
|
118
|
+
"type": "string",
|
|
119
|
+
"description": "Class name for the checkbox control element (stable styling target)",
|
|
120
|
+
"required": false
|
|
121
|
+
},
|
|
122
|
+
"contentClassName": {
|
|
123
|
+
"type": "string",
|
|
124
|
+
"description": "Class name for the label/description content wrapper",
|
|
125
|
+
"required": false
|
|
126
|
+
},
|
|
127
|
+
"aria-label": {
|
|
128
|
+
"type": "string",
|
|
129
|
+
"description": "Accessible label for icon-only mode",
|
|
130
|
+
"required": false
|
|
131
|
+
},
|
|
132
|
+
"aria-labelledby": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"description": "Accessible labelled-by relationship for icon-only mode",
|
|
135
|
+
"required": false
|
|
136
|
+
},
|
|
137
|
+
"aria-describedby": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"description": "Accessible described-by relationship",
|
|
140
|
+
"required": false
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"usage": {
|
|
144
|
+
"when": [
|
|
145
|
+
"Form fields requiring explicit submission",
|
|
146
|
+
"Multi-select from a list of options",
|
|
147
|
+
"Terms and conditions acceptance",
|
|
148
|
+
"Filter or preference checklists"
|
|
149
|
+
],
|
|
150
|
+
"whenNot": [
|
|
151
|
+
"Immediate effect settings (use Switch)",
|
|
152
|
+
"Single selection from options (use RadioGroup)",
|
|
153
|
+
"Selecting from many options (use Select)"
|
|
154
|
+
],
|
|
155
|
+
"guidelines": [
|
|
156
|
+
"Always include a visible label",
|
|
157
|
+
"Use helperText for additional context when needed",
|
|
158
|
+
"Group related checkboxes visually",
|
|
159
|
+
"Use indeterminate state for parent/child relationships"
|
|
160
|
+
],
|
|
161
|
+
"accessibility": [
|
|
162
|
+
"Proper label association",
|
|
163
|
+
"Keyboard accessible (Space to toggle)",
|
|
164
|
+
"Visible focus indicator",
|
|
165
|
+
"Indeterminate state properly announced"
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
"examples": [
|
|
169
|
+
{
|
|
170
|
+
"name": "Default",
|
|
171
|
+
"description": "Basic checkbox with label",
|
|
172
|
+
"code": "<StatefulCheckbox label=\"Accept terms and conditions\" />"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"name": "With Helper Text",
|
|
176
|
+
"description": "Checkbox with helper text",
|
|
177
|
+
"code": "<StatefulCheckbox\n label=\"Email notifications\"\n helperText=\"Receive email updates about your account activity\"\n/>"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"name": "Checked",
|
|
181
|
+
"description": "Pre-checked checkbox",
|
|
182
|
+
"code": "<StatefulCheckbox defaultChecked label=\"Subscribe to newsletter\" />"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"name": "Indeterminate",
|
|
186
|
+
"description": "Partial selection state",
|
|
187
|
+
"code": "<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>\n <Checkbox indeterminate label=\"Select all\" />\n <div style={{ marginLeft: '24px', display: 'flex', flexDirection: 'column', gap: '8px' }}>\n <StatefulCheckbox defaultChecked label=\"Option 1\" />\n <StatefulCheckbox label=\"Option 2\" />\n <StatefulCheckbox defaultChecked label=\"Option 3\" />\n </div>\n</div>"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"name": "Sizes",
|
|
191
|
+
"description": "Available size options",
|
|
192
|
+
"code": "<div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>\n <StatefulCheckbox size=\"sm\" label=\"Small checkbox\" />\n <StatefulCheckbox size=\"md\" label=\"Medium checkbox\" />\n <StatefulCheckbox size=\"lg\" label=\"Large checkbox\" />\n</div>"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"name": "Disabled",
|
|
196
|
+
"description": "Non-interactive states",
|
|
197
|
+
"code": "<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>\n <Checkbox disabled label=\"Disabled unchecked\" />\n <Checkbox disabled checked label=\"Disabled checked\" />\n</div>"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"name": "Custom Styling Targets",
|
|
201
|
+
"description": "Use explicit class targets for control vs content styling",
|
|
202
|
+
"code": "<Checkbox\n label=\"Styled checkbox\"\n helperText=\"Control and content wrappers can be targeted independently\"\n controlClassName=\"demo-checkbox-control\"\n contentClassName=\"demo-checkbox-content\"\n/>"
|
|
203
|
+
}
|
|
204
|
+
],
|
|
205
|
+
"relations": [
|
|
206
|
+
{
|
|
207
|
+
"component": "Switch",
|
|
208
|
+
"relationship": "alternative",
|
|
209
|
+
"note": "Use Switch for immediate-effect settings"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"component": "Input",
|
|
213
|
+
"relationship": "sibling",
|
|
214
|
+
"note": "Checkbox handles boolean; Input handles text"
|
|
215
|
+
}
|
|
216
|
+
],
|
|
217
|
+
"contract": {
|
|
218
|
+
"propsSummary": [
|
|
219
|
+
"checked: boolean - controlled checked state",
|
|
220
|
+
"onCheckedChange: (checked) => void - change handler",
|
|
221
|
+
"onChange: (checked) => void - alias for onCheckedChange",
|
|
222
|
+
"indeterminate: boolean - partial selection state",
|
|
223
|
+
"label: string - checkbox label",
|
|
224
|
+
"helperText: string - helper text (preferred)",
|
|
225
|
+
"description: string - deprecated alias for helperText",
|
|
226
|
+
"controlClassName/contentClassName - explicit styling targets for control and content"
|
|
227
|
+
],
|
|
228
|
+
"a11yRules": [
|
|
229
|
+
"A11Y_CHECKBOX_LABEL",
|
|
230
|
+
"A11Y_CHECKBOX_FOCUS",
|
|
231
|
+
"A11Y_TARGET_SIZE_MIN"
|
|
232
|
+
]
|
|
233
|
+
},
|
|
234
|
+
"ai": {
|
|
235
|
+
"compositionPattern": "compound",
|
|
236
|
+
"subComponents": [
|
|
237
|
+
"Root"
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
"provenance": {
|
|
241
|
+
"source": "migrated",
|
|
242
|
+
"verified": false,
|
|
243
|
+
"frameworkSupport": "native",
|
|
244
|
+
"extractedAt": "2026-03-13T23:18:52.226Z"
|
|
245
|
+
}
|
|
246
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://usefragments.com/schemas/contract.v1.json",
|
|
3
|
+
"name": "Chip",
|
|
4
|
+
"description": "Interactive pill-shaped element for filtering, selecting, and tagging. Supports single and multi-select via Chip.Group.",
|
|
5
|
+
"category": "forms",
|
|
6
|
+
"tags": [
|
|
7
|
+
"chip",
|
|
8
|
+
"tag",
|
|
9
|
+
"filter",
|
|
10
|
+
"selection",
|
|
11
|
+
"multi-select",
|
|
12
|
+
"action"
|
|
13
|
+
],
|
|
14
|
+
"status": "stable",
|
|
15
|
+
"sourcePath": "src/components/Chip/index.tsx",
|
|
16
|
+
"exportName": "Chip",
|
|
17
|
+
"propsSummary": [
|
|
18
|
+
"children: node (required)",
|
|
19
|
+
"variant: filled|outlined|outline|soft (default: filled)",
|
|
20
|
+
"size: xs|sm|md|lg (default: md)",
|
|
21
|
+
"selected: boolean (default: false)",
|
|
22
|
+
"icon: node",
|
|
23
|
+
"avatar: node",
|
|
24
|
+
"onRemove: function",
|
|
25
|
+
"value: string",
|
|
26
|
+
"disabled: boolean (default: false)",
|
|
27
|
+
"onClick: function"
|
|
28
|
+
],
|
|
29
|
+
"props": {
|
|
30
|
+
"children": {
|
|
31
|
+
"type": "node",
|
|
32
|
+
"description": "Chip label text",
|
|
33
|
+
"required": true
|
|
34
|
+
},
|
|
35
|
+
"variant": {
|
|
36
|
+
"type": "enum",
|
|
37
|
+
"description": "Visual style variant",
|
|
38
|
+
"default": "filled",
|
|
39
|
+
"required": false,
|
|
40
|
+
"values": [
|
|
41
|
+
"filled",
|
|
42
|
+
"outlined",
|
|
43
|
+
"outline",
|
|
44
|
+
"soft"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
"size": {
|
|
48
|
+
"type": "enum",
|
|
49
|
+
"description": "Chip size",
|
|
50
|
+
"default": "md",
|
|
51
|
+
"required": false,
|
|
52
|
+
"values": [
|
|
53
|
+
"xs",
|
|
54
|
+
"sm",
|
|
55
|
+
"md",
|
|
56
|
+
"lg"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
"selected": {
|
|
60
|
+
"type": "boolean",
|
|
61
|
+
"description": "Whether the chip is in a selected state",
|
|
62
|
+
"default": "false",
|
|
63
|
+
"required": false
|
|
64
|
+
},
|
|
65
|
+
"icon": {
|
|
66
|
+
"type": "node",
|
|
67
|
+
"description": "Icon element rendered before the label",
|
|
68
|
+
"required": false
|
|
69
|
+
},
|
|
70
|
+
"avatar": {
|
|
71
|
+
"type": "node",
|
|
72
|
+
"description": "Avatar element rendered before the label",
|
|
73
|
+
"required": false
|
|
74
|
+
},
|
|
75
|
+
"onRemove": {
|
|
76
|
+
"type": "function",
|
|
77
|
+
"description": "Makes chip removable. Called when X is clicked.",
|
|
78
|
+
"required": false
|
|
79
|
+
},
|
|
80
|
+
"value": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"description": "Value identifier used by Chip.Group for selection tracking",
|
|
83
|
+
"required": false
|
|
84
|
+
},
|
|
85
|
+
"disabled": {
|
|
86
|
+
"type": "boolean",
|
|
87
|
+
"description": "",
|
|
88
|
+
"default": "false",
|
|
89
|
+
"required": false
|
|
90
|
+
},
|
|
91
|
+
"onClick": {
|
|
92
|
+
"type": "function",
|
|
93
|
+
"description": "",
|
|
94
|
+
"required": false
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"usage": {
|
|
98
|
+
"when": [
|
|
99
|
+
"Filtering content by categories or tags",
|
|
100
|
+
"Multi-select scenarios like choosing interests or skills",
|
|
101
|
+
"Toggling options in a compact pill-shaped control",
|
|
102
|
+
"Displaying removable user-applied filters"
|
|
103
|
+
],
|
|
104
|
+
"whenNot": [
|
|
105
|
+
"Display-only status labels (use Badge)",
|
|
106
|
+
"Navigation between views (use Tabs)",
|
|
107
|
+
"Binary on/off state (use Switch)",
|
|
108
|
+
"Primary call-to-action (use Button)"
|
|
109
|
+
],
|
|
110
|
+
"guidelines": [
|
|
111
|
+
"Keep chip labels short (1-3 words)",
|
|
112
|
+
"Use Chip.Group for multi-select sets with shared state",
|
|
113
|
+
"Use onRemove only when users should be able to dismiss the chip",
|
|
114
|
+
"Pair avatar chips with user-related selections (assignees, reviewers)",
|
|
115
|
+
"Provide an explicit value on Chip when using non-string/custom JSX children inside Chip.Group"
|
|
116
|
+
],
|
|
117
|
+
"accessibility": [
|
|
118
|
+
"Chips are buttons and use aria-pressed for selection state",
|
|
119
|
+
"Chip.Group is a grouping wrapper; add role/aria-label when needed for assistive context",
|
|
120
|
+
"Remove buttons include descriptive aria-label with chip text",
|
|
121
|
+
"Disabled chips are properly excluded from interaction"
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
"examples": [
|
|
125
|
+
{
|
|
126
|
+
"name": "Default",
|
|
127
|
+
"description": "Basic filled chip",
|
|
128
|
+
"code": "<Chip>Default</Chip>"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"name": "Outline",
|
|
132
|
+
"description": "Chip with border using the \"outline\" alias for \"outlined\"",
|
|
133
|
+
"code": "<div style={{ display: 'flex', gap: '8px' }}>\n <Chip variant=\"outline\">Outline</Chip>\n <Chip variant=\"outline\" selected>Outline Selected</Chip>\n</div>"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"name": "Selected",
|
|
137
|
+
"description": "Chip in selected state across variants",
|
|
138
|
+
"code": "<div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>\n <Chip selected>Filled</Chip>\n <Chip variant=\"outlined\" selected>Outlined</Chip>\n <Chip variant=\"soft\" selected>Soft</Chip>\n</div>"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "With Avatar",
|
|
142
|
+
"description": "Chip with a leading avatar image",
|
|
143
|
+
"code": "<Chip avatar={<img src=\"https://i.pravatar.cc/32?u=chip\" alt=\"\" />}>\n Jane Doe\n</Chip>"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "With Remove",
|
|
147
|
+
"description": "Removable chip with dismiss button",
|
|
148
|
+
"code": "<div style={{ display: 'flex', gap: '8px' }}>\n <Chip onRemove={() => {}}>React</Chip>\n <Chip onRemove={() => {}}>TypeScript</Chip>\n <Chip onRemove={() => {}}>SCSS</Chip>\n</div>"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "Chip Group",
|
|
152
|
+
"description": "Multi-select chip set with shared state",
|
|
153
|
+
"code": "<Chip.Group defaultValue={['react']}>\n <Chip value=\"react\">React</Chip>\n <Chip value=\"vue\">Vue</Chip>\n <Chip value=\"angular\">Angular</Chip>\n <Chip value=\"svelte\">Svelte</Chip>\n</Chip.Group>"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"name": "Chip Group with Custom Labels",
|
|
157
|
+
"description": "Use explicit values when chip labels are custom JSX",
|
|
158
|
+
"code": "<Chip.Group aria-label=\"Assignees\">\n <Chip value=\"jane\">\n <span>Jane Doe</span>\n </Chip>\n <Chip value=\"sam\">\n <span>Sam Lee</span>\n </Chip>\n</Chip.Group>"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"name": "Disabled",
|
|
162
|
+
"description": "Chip in disabled state",
|
|
163
|
+
"code": "<div style={{ display: 'flex', gap: '8px' }}>\n <Chip disabled>Disabled</Chip>\n <Chip disabled selected>Disabled Selected</Chip>\n</div>"
|
|
164
|
+
}
|
|
165
|
+
],
|
|
166
|
+
"relations": [
|
|
167
|
+
{
|
|
168
|
+
"component": "Badge",
|
|
169
|
+
"relationship": "sibling",
|
|
170
|
+
"note": "Badge is display-only; Chip is interactive"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"component": "ToggleGroup",
|
|
174
|
+
"relationship": "alternative",
|
|
175
|
+
"note": "Use ToggleGroup for mutually exclusive options"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"component": "Button",
|
|
179
|
+
"relationship": "alternative",
|
|
180
|
+
"note": "Use Button for primary actions, Chip for selection/filtering"
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
"contract": {
|
|
184
|
+
"propsSummary": [
|
|
185
|
+
"children: ReactNode - chip label (required)",
|
|
186
|
+
"variant: filled|outlined|outline|soft - visual style",
|
|
187
|
+
"size: sm|md - chip size",
|
|
188
|
+
"selected: boolean - selection state",
|
|
189
|
+
"icon/avatar: ReactNode - leading visual",
|
|
190
|
+
"onRemove: () => void - makes chip removable",
|
|
191
|
+
"value: string - identifier for Chip.Group",
|
|
192
|
+
"Chip.Group forwards DOM props (id, role, aria-*, data-*, handlers)",
|
|
193
|
+
"Chip.Group: non-string chip labels should set an explicit value"
|
|
194
|
+
],
|
|
195
|
+
"a11yRules": [
|
|
196
|
+
"A11Y_CHIP_SELECTION",
|
|
197
|
+
"A11Y_CHIP_DISMISS"
|
|
198
|
+
]
|
|
199
|
+
},
|
|
200
|
+
"ai": {
|
|
201
|
+
"compositionPattern": "compound",
|
|
202
|
+
"subComponents": [
|
|
203
|
+
"Group"
|
|
204
|
+
]
|
|
205
|
+
},
|
|
206
|
+
"provenance": {
|
|
207
|
+
"source": "migrated",
|
|
208
|
+
"verified": false,
|
|
209
|
+
"frameworkSupport": "native",
|
|
210
|
+
"extractedAt": "2026-03-13T23:18:54.270Z"
|
|
211
|
+
}
|
|
212
|
+
}
|