@maxio-com/react-ui-components 9.16.0 → 9.16.1

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 (51) hide show
  1. package/dist/skills/maxio-react/SKILL.md +68 -0
  2. package/dist/skills/maxio-react/agents/openai.yaml +4 -0
  3. package/dist/skills/maxio-react/references/components-action-list.md +92 -0
  4. package/dist/skills/maxio-react/references/components-action-menu.md +162 -0
  5. package/dist/skills/maxio-react/references/components-avatar.md +66 -0
  6. package/dist/skills/maxio-react/references/components-breadcrumbs.md +86 -0
  7. package/dist/skills/maxio-react/references/components-buttons-button.md +170 -0
  8. package/dist/skills/maxio-react/references/components-buttons-iconbutton.md +102 -0
  9. package/dist/skills/maxio-react/references/components-card.md +175 -0
  10. package/dist/skills/maxio-react/references/components-chip.md +151 -0
  11. package/dist/skills/maxio-react/references/components-data-table.md +344 -0
  12. package/dist/skills/maxio-react/references/components-drawer.md +293 -0
  13. package/dist/skills/maxio-react/references/components-flex.md +185 -0
  14. package/dist/skills/maxio-react/references/components-forms-checkbox.md +257 -0
  15. package/dist/skills/maxio-react/references/components-forms-combobox.md +250 -0
  16. package/dist/skills/maxio-react/references/components-forms-radio-group.md +202 -0
  17. package/dist/skills/maxio-react/references/components-forms-select.md +295 -0
  18. package/dist/skills/maxio-react/references/components-forms-textfield.md +253 -0
  19. package/dist/skills/maxio-react/references/components-grid.md +140 -0
  20. package/dist/skills/maxio-react/references/components-icon.md +169 -0
  21. package/dist/skills/maxio-react/references/components-link.md +180 -0
  22. package/dist/skills/maxio-react/references/components-listbox.md +205 -0
  23. package/dist/skills/maxio-react/references/components-loading-spinner.md +123 -0
  24. package/dist/skills/maxio-react/references/components-logo.md +91 -0
  25. package/dist/skills/maxio-react/references/components-notifications-alert.md +103 -0
  26. package/dist/skills/maxio-react/references/components-notifications-banner.md +173 -0
  27. package/dist/skills/maxio-react/references/components-notifications-toast.md +155 -0
  28. package/dist/skills/maxio-react/references/components-pagination.md +115 -0
  29. package/dist/skills/maxio-react/references/components-popover.md +176 -0
  30. package/dist/skills/maxio-react/references/components-progressbar.md +98 -0
  31. package/dist/skills/maxio-react/references/components-segmentedcontrol.md +292 -0
  32. package/dist/skills/maxio-react/references/components-tabs.md +193 -0
  33. package/dist/skills/maxio-react/references/components-tag.md +117 -0
  34. package/dist/skills/maxio-react/references/components-tile.md +114 -0
  35. package/dist/skills/maxio-react/references/components-toggle.md +218 -0
  36. package/dist/skills/maxio-react/references/components-tooltip.md +178 -0
  37. package/dist/skills/maxio-react/references/components-typography-body.md +101 -0
  38. package/dist/skills/maxio-react/references/components-typography-code.md +72 -0
  39. package/dist/skills/maxio-react/references/components-typography-display.md +91 -0
  40. package/dist/skills/maxio-react/references/components-typography-heading.md +88 -0
  41. package/dist/skills/maxio-react/references/components-typography-label.md +82 -0
  42. package/dist/skills/maxio-react/references/deprecated-textinput.md +250 -0
  43. package/dist/skills/maxio-react/references/foundations-dark-mode.md +85 -0
  44. package/dist/skills/maxio-react/references/foundations-design-tokens-about.md +108 -0
  45. package/dist/skills/maxio-react/references/foundations-design-tokens-colors-primitive-colors.md +33 -0
  46. package/dist/skills/maxio-react/references/foundations-design-tokens-colors-semantic-colors.md +11 -0
  47. package/dist/skills/maxio-react/references/foundations-start-here.md +128 -0
  48. package/dist/skills/maxio-react/references/patterns-auth-layout.md +318 -0
  49. package/dist/skills/maxio-react/references/patterns-side-nav.md +182 -0
  50. package/dist/skills/maxio-react/references/patterns-top-bar.md +214 -0
  51. package/package.json +2 -2
@@ -0,0 +1,202 @@
1
+ # RadioGroup
2
+
3
+ ## Usage Guidelines
4
+
5
+ ### Overview
6
+
7
+ RadioGroup presents a related set of mutually exclusive choices. Use Radio only as a child of RadioGroup so selection state, names, labels, helper text, and validation are announced consistently.
8
+
9
+ #### When to Use
10
+
11
+ - Use when users must choose exactly one option from a small, visible set.
12
+ - Use when comparing all choices before selecting is important to the task.
13
+ - Use when the selected value should submit with a native form through a shared `name`.
14
+ - Use helper text when the choice affects billing, access, or other downstream behavior.
15
+
16
+ #### When Not to Use
17
+
18
+ - Do not use when users can choose more than one option. Use CheckboxGroup instead.
19
+ - Do not use for long, dynamic, or searchable lists. Use Select for compact closed lists or ComboBox when filtering helps.
20
+ - Do not use for a single on/off setting. Use Toggle or Checkbox depending on the surrounding form pattern.
21
+ - Do not render a Radio outside RadioGroup. RadioGroup coordinates the selection state, accessible group name, and form behavior.
22
+
23
+ ### Behavior
24
+
25
+ - **Mouse and touch**: Selecting one radio clears the previously selected option in the same group.
26
+ - **Keyboard**: Users tab to the group, move between options with arrow keys, and select an option with Space.
27
+ - **Focus management**: Focus stays on the active radio option and follows native radio group behavior from React Aria.
28
+ - **Controlled state**: Use `value` and `onChange` when product logic owns the selection. Use `defaultValue` when the form can own the initial selection.
29
+ - **Validation**: Show `errorMessage` with `invalid` after submit, blur, or another clear validation moment. Helper text is hidden while the error is visible.
30
+
31
+ ### Accessibility
32
+
33
+ - Provide a visible group `label` whenever possible. Use `aria-label` or `aria-labelledby` only when a visible label is not available.
34
+ - Give every Radio a concise visible `label` that describes the option value.
35
+ - Keep helper text and error text associated with the RadioGroup, not repeated on each option.
36
+ - Keep the native radio inputs in the DOM so screen readers, keyboard users, and form submission receive the correct behavior.
37
+ - Do not rely on color alone to communicate selected, disabled, or invalid state.
38
+
39
+ ### Content
40
+
41
+ - Write option labels as short, parallel nouns or noun phrases, such as "Monthly", "Quarterly", and "Annual".
42
+ - Order options by user expectation, frequency, or business priority. Avoid alphabetical order when it makes comparison harder.
43
+ - Use helper text for consequences or constraints that apply to the whole group.
44
+ - Write error messages that name the missing or invalid choice and how to recover, such as "Choose a collection method."
45
+
46
+ ### Related
47
+
48
+ - **CheckboxGroup**: use when users may select multiple options from a visible set.
49
+ - **[Select](components-forms-select.md)**: use when only one option can be selected but the list should stay compact.
50
+ - **[ComboBox](components-forms-combobox.md)**: use when only one option can be selected and typing should filter a longer list.
51
+
52
+ ## React
53
+
54
+ ```tsx
55
+ import { RadioGroup, Radio } from '@maxio-com/react-ui-components';
56
+ ```
57
+
58
+ ## Composition
59
+
60
+ Render each Radio as a direct child of RadioGroup. RadioGroup owns the accessible group label, shared native `name`, selected value, helper text, error text, and disabled or invalid group state.
61
+
62
+ ```tsx
63
+ <RadioGroup name="billing-cycle" label="Billing cycle" defaultValue="monthly">
64
+ <Radio value="monthly" label="Monthly" />
65
+ <Radio value="quarterly" label="Quarterly" />
66
+ <Radio value="annual" label="Annual" />
67
+ </RadioGroup>
68
+ ```
69
+
70
+ ## State Management
71
+
72
+ Use controlled state when product logic needs to save, validate, transform, or share the selected value as soon as it changes.
73
+
74
+ ### Controlled
75
+
76
+ ```tsx
77
+ const [value, setValue] = React.useState('email');
78
+
79
+ <RadioGroup
80
+ name="invoice-delivery"
81
+ label="Invoice delivery"
82
+ value={value}
83
+ onChange={setValue}
84
+ >
85
+ <Radio value="email" label="Email invoice" />
86
+ <Radio value="mail" label="Mail invoice" />
87
+ <Radio value="portal" label="Customer portal only" />
88
+ </RadioGroup>;
89
+ ```
90
+
91
+ ### Uncontrolled
92
+
93
+ ```tsx
94
+ <RadioGroup name="billing-cycle" label="Billing cycle" defaultValue="monthly">
95
+ <Radio value="monthly" label="Monthly" />
96
+ <Radio value="quarterly" label="Quarterly" />
97
+ <Radio value="annual" label="Annual" />
98
+ </RadioGroup>
99
+ ```
100
+
101
+ ## Imports
102
+
103
+ ```tsx
104
+ import { Radio, RadioGroup } from "@maxio-com/react-ui-components";
105
+ ```
106
+
107
+ ## Prop Types
108
+
109
+ ### RadioGroup
110
+
111
+ | Prop | Type | Required | Default | Description | Source |
112
+ | --- | --- | --- | --- | --- | --- |
113
+ | `children` | `ReactNode` | yes | - | Children of the radio group | TypeLiteral |
114
+ | `disabled` | `boolean` | no | `false` | Disable the radio group | TypeLiteral |
115
+ | `errorMessage` | `string` | no | - | Error message for the radio group | TypeLiteral |
116
+ | `helperText` | `string` | no | - | Helper text for the radio group | TypeLiteral |
117
+ | `invalid` | `boolean` | no | `false` | Invalid state of the radio group | TypeLiteral |
118
+ | `label` | `string` | no | - | Label for the radio group | TypeLiteral |
119
+ | `name` | `string` | yes | - | Name for the radio group | TypeLiteral |
120
+
121
+ ## Stories
122
+
123
+ ### Default
124
+
125
+ Use radio groups when all choices should stay visible and users can select exactly one value. Provide a group label and stable option values for form submission.
126
+
127
+ ```tsx
128
+ const Default = () => {
129
+ return (
130
+ <RadioGroup
131
+ name="billing-cycle"
132
+ label="Billing cycle"
133
+ defaultValue="monthly"
134
+ onChange={action('onChange')}>
135
+ <Radio value="monthly" label="Monthly" />
136
+ <Radio value="quarterly" label="Quarterly" />
137
+ <Radio value="annual" label="Annual" />
138
+ </RadioGroup>
139
+ );
140
+ };
141
+ ```
142
+
143
+ ### With Helper Text
144
+
145
+ Use helper text when users need context before choosing, such as how the selected value affects billing, access, or downstream settings.
146
+
147
+ ```tsx
148
+ const WithHelperText = () => <RadioGroup
149
+ name="payment-timing"
150
+ label="Payment timing"
151
+ helperText="Changes apply to invoices created after today."
152
+ defaultValue="next-invoice">
153
+ <Radio value="next-invoice" label="Next invoice only" />
154
+ <Radio value="future-invoices" label="All future invoices" />
155
+ </RadioGroup>;
156
+ ```
157
+
158
+ ### Validation
159
+
160
+ Use validation when a required choice is missing or the selected option is no longer available. Helper text is hidden while the error message is visible.
161
+
162
+ ```tsx
163
+ const Validation = () => <RadioGroup
164
+ name="collection-method"
165
+ label="Collection method"
166
+ invalid
167
+ errorMessage="Choose a collection method.">
168
+ <Radio value="auto" label="Automatic payment" />
169
+ <Radio value="manual" label="Manual invoice" />
170
+ </RadioGroup>;
171
+ ```
172
+
173
+ ### Disabled
174
+
175
+ Use disabled groups when the choice is unavailable in the current context. Avoid disabling choices that users may need to review or copy.
176
+
177
+ ```tsx
178
+ const Disabled = () => <RadioGroup name="contract-term" label="Contract term" defaultValue="annual" disabled>
179
+ <Radio value="monthly" label="Monthly" />
180
+ <Radio value="annual" label="Annual" />
181
+ </RadioGroup>;
182
+ ```
183
+
184
+ ### Indented Option
185
+
186
+ Use indent to visually nest a radio under related content while keeping it in the same RadioGroup. Do not use indentation to create a separate group.
187
+
188
+ ```tsx
189
+ const IndentedOption = () => <RadioGroup name="tax-handling" label="Tax handling" defaultValue="standard">
190
+ <Radio value="standard" label="Use account defaults" />
191
+ <Radio value="override" label="Override account defaults" />
192
+ <Radio indent value="manual-review" label="Send to manual review" />
193
+ </RadioGroup>;
194
+ ```
195
+
196
+ ### Controlled
197
+
198
+ Use controlled state when product logic needs to save, validate, transform, or share the selected value as soon as it changes.
199
+
200
+ ```tsx
201
+ const Controlled = () => <ControlledRadioGroupExample name="invoice-delivery" label="Invoice delivery" />;
202
+ ```
@@ -0,0 +1,295 @@
1
+ # Select
2
+
3
+ ## Usage Guidelines
4
+
5
+ ### Overview
6
+
7
+ Select lets users choose one value from a short, known list of options. Use it for native single-selection form fields where filtering or custom option content is not needed.
8
+
9
+ #### When to Use
10
+
11
+ - Use when users need to choose one value from a short, known list.
12
+ - Use when native browser select behavior is enough and the option labels are simple text.
13
+ - Use in forms, filters, and table controls where preserving standard keyboard and mobile picker behavior matters.
14
+ - Use disabled options when a few choices are temporarily unavailable but the field should remain usable.
15
+
16
+ #### When Not to Use
17
+
18
+ - Do not use when users need to search or filter a long list. Use ComboBox instead.
19
+ - Do not use when users can choose multiple values. Use CheckboxGroup or a multi-select pattern instead.
20
+ - Do not use when options need rich content, icons, descriptions, or grouped actions.
21
+ - Do not use placeholder text or the first option as the only label. Provide a visible `label` whenever possible.
22
+
23
+ ### Variants
24
+
25
+ | Variants | Purpose | Usage notes |
26
+ | :---------- | :---------------------------------- | :----------------------------------------------------------- |
27
+ | `sm` | Compact field for dense interfaces. | Use in tables, filters, or compact toolbars. |
28
+ | `md` | Default select size. | Use for most forms. |
29
+ | `lg` | Larger field for prominent rows. | Use sparingly when the field needs more visual emphasis. |
30
+ | `xl` | Contained field treatment. | Use when label and helper or error text should feel grouped. |
31
+ | `inline` | Horizontal label and select layout. | Use in compact controls where the row relationship is clear. |
32
+ | `fullWidth` | Fills the available parent width. | Use in stacked forms and responsive layouts. |
33
+ | `disabled` | Unavailable select field. | Use only when users cannot change the value in this context. |
34
+
35
+ ### Behavior
36
+
37
+ - **Mouse and touch**: Users open the native select picker and choose one option. Disabled options remain visible but cannot be selected.
38
+ - **Keyboard**: Users tab to the select, open it with native browser shortcuts, move through options with arrow keys, and select using standard platform behavior.
39
+ - **Focus management**: Focus stays on the native `<select>` element.
40
+ - **Controlled state**: Use `value` and `onChange` when product state owns the selected value. Use `defaultValue` when the form can read the value on submit.
41
+ - **Validation**: Show validation after users submit, blur the field, or otherwise finish interacting. Avoid showing errors before users have a chance to choose.
42
+
43
+ ### Accessibility
44
+
45
+ - Provide a visible `label` whenever possible. Use `aria-label` or `aria-labelledby` only when a visible label is not available.
46
+ - Keep labels associated with the native select through `htmlFor` and `id`.
47
+ - Use `helperText` for guidance that helps users choose before they interact.
48
+ - Use `errorMessage` for concise validation feedback, and pass native ARIA attributes when product validation requires announced invalid state.
49
+ - Use native `disabled` on the select or individual options instead of visual-only disabled styling.
50
+ - Do not rely on color alone to communicate disabled, unavailable, or error state.
51
+
52
+ ### Content
53
+
54
+ - Write labels as short nouns, such as "Plan", "Billing cadence", or "Payment terms".
55
+ - Keep option labels concise and mutually exclusive.
56
+ - Put the most common or safest option first when there is a meaningful default.
57
+ - Avoid using a blank first option unless users must make an explicit choice.
58
+ - Write helper text that explains impact or constraints, not instructions to click the field.
59
+ - Write error messages that name the recovery step, such as "Choose payment terms before saving."
60
+
61
+ ### Related
62
+
63
+ - **[TextField](components-forms-textfield.md)**: use when users need to enter a free-form value.
64
+ - **[ComboBox](components-forms-combobox.md)**: use when users choose from a list and typing should filter options.
65
+ - **[Checkbox](components-forms-checkbox.md)**: use when users can choose multiple values from a list.
66
+
67
+ ## React
68
+
69
+ ```tsx
70
+ import { Select } from '@maxio-com/react-ui-components';
71
+ ```
72
+
73
+ ### State Management
74
+
75
+ Select accepts native `<select>` props, including `name`, `value`, `defaultValue`, `onChange`, `disabled`, and ARIA attributes.
76
+
77
+ #### Controlled
78
+
79
+ Use controlled state when product logic needs the selected value immediately, such as updating a summary, enabling an action, or saving through client state.
80
+
81
+ ```tsx
82
+ const [plan, setPlan] = React.useState('growth');
83
+
84
+ <Select
85
+ label="Plan"
86
+ value={plan}
87
+ onChange={(event) => setPlan(event.currentTarget.value)}
88
+ options={[
89
+ { value: 'starter', label: 'Starter' },
90
+ { value: 'growth', label: 'Growth' },
91
+ { value: 'enterprise', label: 'Enterprise' },
92
+ ]}
93
+ />;
94
+ ```
95
+
96
+ #### Uncontrolled
97
+
98
+ Use uncontrolled state when the value can be read from a native form submit or ref.
99
+
100
+ ```tsx
101
+ <Select
102
+ label="Plan"
103
+ name="plan"
104
+ defaultValue="growth"
105
+ options={[
106
+ { value: 'starter', label: 'Starter' },
107
+ { value: 'growth', label: 'Growth' },
108
+ { value: 'enterprise', label: 'Enterprise' },
109
+ ]}
110
+ />
111
+ ```
112
+
113
+ ## Imports
114
+
115
+ ```tsx
116
+ import { Select } from "@maxio-com/react-ui-components";
117
+ ```
118
+
119
+ ## Prop Types
120
+
121
+ ### Select
122
+
123
+ | Prop | Type | Required | Default | Description | Source |
124
+ | --- | --- | --- | --- | --- | --- |
125
+ | `disabled` | `boolean` | no | `false` | If `true`, the select will be disabled | SelectProps |
126
+ | `errorMessage` | `string` | no | - | The error message of the select | SelectProps |
127
+ | `fullWidth` | `boolean` | no | `false` | If `true`, the select will be full width | SelectProps |
128
+ | `helperText` | `string` | no | - | The helper text of the select | SelectProps |
129
+ | `inline` | `boolean` | no | `false` | If `true`, the select will be inline | SelectProps |
130
+ | `label` | `string` | no | - | The label of the select | SelectProps |
131
+ | `options` | `Option[]` | yes | - | The options of the select | SelectProps |
132
+ | `size` | `"sm" \| "md" \| "lg" \| "xl"` | no | `md` | The size of the select | SelectProps |
133
+
134
+ ## Stories
135
+
136
+ ### Default
137
+
138
+ Use Select when users choose one value from a short, known list. Provide a visible label and use controlled state when product logic needs the selected value immediately.
139
+
140
+ ```tsx
141
+ const Default = () => <Select label="Plan" options={planOptions} onChange={action('onChange')} />;
142
+ ```
143
+
144
+ ### With Helper Text
145
+
146
+ Use helper text when users need context before choosing, such as how the selection affects billing, reporting, or another workflow.
147
+
148
+ ```tsx
149
+ const WithHelperText = () => <Select
150
+ label="Billing cadence"
151
+ helperText="Changing cadence affects future invoices only."
152
+ options={[
153
+ {
154
+ value: 'monthly',
155
+ label: 'Monthly',
156
+ },
157
+ {
158
+ value: 'annual',
159
+ label: 'Annual',
160
+ },
161
+ ]}
162
+ onChange={action('onChange')} />;
163
+ ```
164
+
165
+ ### Validation
166
+
167
+ Use errorMessage after validation when a required selection is missing or the chosen value is no longer available.
168
+
169
+ ```tsx
170
+ const Validation = () => <Select
171
+ label="Payment terms"
172
+ errorMessage="Choose payment terms before saving."
173
+ options={[
174
+ {
175
+ value: '',
176
+ label: 'Select payment terms',
177
+ },
178
+ {
179
+ value: 'net-15',
180
+ label: 'Net 15',
181
+ },
182
+ {
183
+ value: 'net-30',
184
+ label: 'Net 30',
185
+ },
186
+ ]}
187
+ onChange={action('onChange')} />;
188
+ ```
189
+
190
+ ### Disabled
191
+
192
+ Use disabled Selects when the value is unavailable and users cannot change it in the current context.
193
+
194
+ ```tsx
195
+ const Disabled = () => <Select
196
+ label="Billing contact"
197
+ disabled
198
+ options={[
199
+ {
200
+ value: '',
201
+ label: 'Select an account first',
202
+ },
203
+ ]} />;
204
+ ```
205
+
206
+ ### With Disabled Options
207
+
208
+ Use disabled options when only specific choices are unavailable. Keep the select itself enabled when users can still choose another option.
209
+
210
+ ```tsx
211
+ const WithDisabledOptions = () => <Select
212
+ label="Billing region"
213
+ options={[
214
+ {
215
+ value: 'us',
216
+ label: 'United States',
217
+ },
218
+ {
219
+ value: 'ca',
220
+ label: 'Canada (coming soon)',
221
+ disabled: true,
222
+ },
223
+ {
224
+ value: 'gb',
225
+ label: 'United Kingdom',
226
+ },
227
+ ]}
228
+ onChange={action('onChange')} />;
229
+ ```
230
+
231
+ ### Sizes
232
+
233
+ Use size to match the surrounding form density. Use md for most forms, sm in compact filters, lg for prominent rows, and xl when label and helper or error text should feel integrated with the field.
234
+
235
+ ```tsx
236
+ const Sizes = (args) => (
237
+ <div style={{ display: 'grid', gap: '0.75rem', maxWidth: '18rem' }}>
238
+ {(['sm', 'md', 'lg', 'xl'] as const).map((size) => (
239
+ <Select key={size} {...args} size={size} />
240
+ ))}
241
+ </div>
242
+ );
243
+ ```
244
+
245
+ ### Inline
246
+
247
+ Use inline Selects in compact toolbar or table controls where the label and field need to stay on one row.
248
+
249
+ ```tsx
250
+ const Inline = () => <Select
251
+ label="Rows"
252
+ inline
253
+ options={[
254
+ {
255
+ value: '10',
256
+ label: '10',
257
+ },
258
+ {
259
+ value: '25',
260
+ label: '25',
261
+ },
262
+ {
263
+ value: '50',
264
+ label: '50',
265
+ },
266
+ ]}
267
+ onChange={action('onChange')} />;
268
+ ```
269
+
270
+ ### Full Width
271
+
272
+ Use fullWidth in stacked forms and responsive layouts where the field should align to the available parent width.
273
+
274
+ ```tsx
275
+ const FullWidth = () => <div style={{ maxWidth: '24rem' }}>
276
+ <Select
277
+ label="Default product"
278
+ fullWidth
279
+ options={[
280
+ {
281
+ value: 'subscriptions',
282
+ label: 'Subscriptions',
283
+ },
284
+ {
285
+ value: 'usage',
286
+ label: 'Usage',
287
+ },
288
+ {
289
+ value: 'invoices',
290
+ label: 'Invoices',
291
+ },
292
+ ]}
293
+ onChange={action('onChange')} />
294
+ </div>;
295
+ ```