@maxio-com/react-ui-components 9.15.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 (55) hide show
  1. package/dist/index.esm.js +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/skills/maxio-react/SKILL.md +68 -0
  5. package/dist/skills/maxio-react/agents/openai.yaml +4 -0
  6. package/dist/skills/maxio-react/references/components-action-list.md +92 -0
  7. package/dist/skills/maxio-react/references/components-action-menu.md +162 -0
  8. package/dist/skills/maxio-react/references/components-avatar.md +66 -0
  9. package/dist/skills/maxio-react/references/components-breadcrumbs.md +86 -0
  10. package/dist/skills/maxio-react/references/components-buttons-button.md +170 -0
  11. package/dist/skills/maxio-react/references/components-buttons-iconbutton.md +102 -0
  12. package/dist/skills/maxio-react/references/components-card.md +175 -0
  13. package/dist/skills/maxio-react/references/components-chip.md +151 -0
  14. package/dist/skills/maxio-react/references/components-data-table.md +344 -0
  15. package/dist/skills/maxio-react/references/components-drawer.md +293 -0
  16. package/dist/skills/maxio-react/references/components-flex.md +185 -0
  17. package/dist/skills/maxio-react/references/components-forms-checkbox.md +257 -0
  18. package/dist/skills/maxio-react/references/components-forms-combobox.md +250 -0
  19. package/dist/skills/maxio-react/references/components-forms-radio-group.md +202 -0
  20. package/dist/skills/maxio-react/references/components-forms-select.md +295 -0
  21. package/dist/skills/maxio-react/references/components-forms-textfield.md +253 -0
  22. package/dist/skills/maxio-react/references/components-grid.md +140 -0
  23. package/dist/skills/maxio-react/references/components-icon.md +169 -0
  24. package/dist/skills/maxio-react/references/components-link.md +180 -0
  25. package/dist/skills/maxio-react/references/components-listbox.md +205 -0
  26. package/dist/skills/maxio-react/references/components-loading-spinner.md +123 -0
  27. package/dist/skills/maxio-react/references/components-logo.md +91 -0
  28. package/dist/skills/maxio-react/references/components-notifications-alert.md +103 -0
  29. package/dist/skills/maxio-react/references/components-notifications-banner.md +173 -0
  30. package/dist/skills/maxio-react/references/components-notifications-toast.md +155 -0
  31. package/dist/skills/maxio-react/references/components-pagination.md +115 -0
  32. package/dist/skills/maxio-react/references/components-popover.md +176 -0
  33. package/dist/skills/maxio-react/references/components-progressbar.md +98 -0
  34. package/dist/skills/maxio-react/references/components-segmentedcontrol.md +292 -0
  35. package/dist/skills/maxio-react/references/components-tabs.md +193 -0
  36. package/dist/skills/maxio-react/references/components-tag.md +117 -0
  37. package/dist/skills/maxio-react/references/components-tile.md +114 -0
  38. package/dist/skills/maxio-react/references/components-toggle.md +218 -0
  39. package/dist/skills/maxio-react/references/components-tooltip.md +178 -0
  40. package/dist/skills/maxio-react/references/components-typography-body.md +101 -0
  41. package/dist/skills/maxio-react/references/components-typography-code.md +72 -0
  42. package/dist/skills/maxio-react/references/components-typography-display.md +91 -0
  43. package/dist/skills/maxio-react/references/components-typography-heading.md +88 -0
  44. package/dist/skills/maxio-react/references/components-typography-label.md +82 -0
  45. package/dist/skills/maxio-react/references/deprecated-textinput.md +250 -0
  46. package/dist/skills/maxio-react/references/foundations-dark-mode.md +85 -0
  47. package/dist/skills/maxio-react/references/foundations-design-tokens-about.md +108 -0
  48. package/dist/skills/maxio-react/references/foundations-design-tokens-colors-primitive-colors.md +33 -0
  49. package/dist/skills/maxio-react/references/foundations-design-tokens-colors-semantic-colors.md +11 -0
  50. package/dist/skills/maxio-react/references/foundations-start-here.md +128 -0
  51. package/dist/skills/maxio-react/references/patterns-auth-layout.md +318 -0
  52. package/dist/skills/maxio-react/references/patterns-side-nav.md +182 -0
  53. package/dist/skills/maxio-react/references/patterns-top-bar.md +214 -0
  54. package/package.json +2 -2
  55. package/typings/index.d.ts +24 -4
@@ -0,0 +1,253 @@
1
+ # TextField
2
+
3
+ ## Usage Guidelines
4
+
5
+ ### Overview
6
+
7
+ TextField lets users enter or edit a short, single-line text value in a form. Provide a visible label whenever possible, and pair helper or validation messaging with the field so users understand the expected value.
8
+
9
+ #### When to Use
10
+
11
+ - Use when users need to enter a short free-form value.
12
+ - Use when browser input behavior should match the expected value, such as `email`, `url`, `tel`, `search`, or `password`.
13
+ - Use with helper text when users need a format hint, example, or constraint before they type.
14
+ - Use with leading or trailing content for simple visual context, units, prefixes, suffixes, or a small field-level action.
15
+
16
+ #### When Not to Use
17
+
18
+ - Do not use for long-form or multi-line writing. Use a textarea pattern instead.
19
+ - Do not use when users must choose from a known list. Use Select for short lists or ComboBox when filtering helps.
20
+ - Do not use placeholder text as the only label. Provide a visible `label` whenever possible.
21
+ - Do not use for actions or navigation. Use Button, IconButton, or Link instead.
22
+
23
+ ### Variants
24
+
25
+ | Variants | Purpose | Usage notes |
26
+ | :------- | :-------------------------------------------- | :--------------------------------------------------------- |
27
+ | `sm` | Compact field for dense interfaces. | Use where form density is high and labels remain readable. |
28
+ | `md` | Default field size. | Use for most forms. |
29
+ | `lg` | Larger field for prominent form rows. | Use sparingly when the field needs more visual emphasis. |
30
+ | `xl` | Field with integrated label and helper/error. | Use when the field needs a stronger contained treatment. |
31
+
32
+ ### Behavior
33
+
34
+ - **Mouse and touch**: Users can place the cursor in the field, select text, and activate any nested trailing or leading action independently.
35
+ - **Keyboard**: Users tab to the input, type or edit the value, and use native text editing shortcuts.
36
+ - **Focus management**: Focus lands on the native input. Leading or trailing actions that are interactive should have their own accessible name and keyboard behavior.
37
+ - **Controlled state**: Use `value` and `onChange` when product state owns the value. Use `defaultValue` for simple uncontrolled form fields.
38
+ - **Validation**: Show validation after users submit, blur the field, or otherwise finish interacting. Avoid showing errors before users have a chance to enter a value.
39
+
40
+ ### Accessibility
41
+
42
+ - Provide a visible `label` whenever possible. Use `aria-label` or `aria-labelledby` only when a visible label is not available.
43
+ - Use `description` for helper text and `errorMessage` for validation feedback.
44
+ - Pair invalid values with `isInvalid` and an actionable `errorMessage`.
45
+ - Use native text-like `type` values so browsers can expose the right keyboard, autocomplete, and validation behavior.
46
+ - Keep disabled fields out of the editing flow only when users cannot act on them. Use read-only fields when the value should remain focusable or copyable.
47
+ - Do not rely on color alone to communicate validation, disabled, or read-only state.
48
+
49
+ ### Content
50
+
51
+ - Write labels as short nouns, such as "Customer name", "Email address", or "Invoice prefix".
52
+ - Use placeholder text for examples, not instructions that replace the label.
53
+ - Use helper text for constraints that prevent errors, such as expected format, length, or source of the value.
54
+ - Write error messages that name the problem and recovery step, such as "Enter a valid email address."
55
+ - Mark optional fields only when the form otherwise implies fields are required.
56
+
57
+ ### Related
58
+
59
+ - **[TextInput](deprecated-textinput.md)**: deprecated predecessor. Use TextField for new React usage.
60
+ - **[Select](components-forms-select.md)**: use when users choose from a shorter closed list.
61
+ - **[ComboBox](components-forms-combobox.md)**: use when users choose from a list and typing should filter options.
62
+ - **[IconButton](components-buttons-iconbutton.md)**: use for compact actions inside trailing or leading content.
63
+
64
+ ## React
65
+
66
+ ```tsx
67
+ import { TextField } from '@maxio-com/react-ui-components';
68
+ ```
69
+
70
+ ### State Management
71
+
72
+ Use controlled state when product logic needs to validate, transform, save, or share the current value.
73
+
74
+ #### Controlled
75
+
76
+ ```tsx
77
+ const [value, setValue] = React.useState('');
78
+
79
+ <TextField label="Customer name" value={value} onChange={setValue} />;
80
+ ```
81
+
82
+ #### Uncontrolled
83
+
84
+ ```tsx
85
+ <TextField label="Customer name" defaultValue="Acme Co." />
86
+ ```
87
+
88
+ ## Imports
89
+
90
+ ```tsx
91
+ import { Body, Grid, Icon, IconButton, TextField } from "@maxio-com/react-ui-components";
92
+ ```
93
+
94
+ ## Prop Types
95
+
96
+ ### TextField
97
+
98
+ | Prop | Type | Required | Default | Description | Source |
99
+ | --- | --- | --- | --- | --- | --- |
100
+ | `className` | `string` | no | - | Additional class name for the text field container | TextFieldProps |
101
+ | `description` | `string` | no | - | Description for the text field. It will not be visible if there is an error message. | TextFieldProps |
102
+ | `errorMessage` | `string` | no | - | Error message for the text field | TextFieldProps |
103
+ | `fullWidth` | `boolean` | no | - | Ensures the input spans the full width of its parent | TextFieldProps |
104
+ | `label` | `string` | no | - | Label for the text field | TextFieldProps |
105
+ | `leadingElement` | `ReactNode` | no | `null` | Leading element for the text field | TextFieldProps |
106
+ | `placeholder` | `string` | no | - | Temporary text that occupies the text field when it is empty. | TextFieldProps |
107
+ | `size` | `"sm" \| "md" \| "lg" \| "xl"` | no | `md` | Size of the text field | TextFieldProps |
108
+ | `trailingElement` | `ReactNode` | no | `null` | Trailing element for the text field | TextFieldProps |
109
+ | `type` | `"search" \| "text" \| "tel" \| "url" \| "email" \| "password"` | no | - | The type of text-like input to render. | TextFieldProps |
110
+
111
+ ## Stories
112
+
113
+ ### Default
114
+
115
+ Provide a visible label and use placeholder text only as an example of the expected value. Use controlled state when product logic needs to validate, transform, save, or share the current value; use defaultValue when the field can be read from a form submit or ref.
116
+
117
+ ```tsx
118
+ const Default = () => <TextField
119
+ label="Customer name"
120
+ placeholder="Acme Co."
121
+ onChange={action('onChange')} />;
122
+ ```
123
+
124
+ ### With Description
125
+
126
+ Use description text for helper content that users need before typing, such as expected format, length, or source of the value.
127
+
128
+ ```tsx
129
+ const WithDescription = () => <TextField
130
+ label="Invoice prefix"
131
+ placeholder="INV"
132
+ description="Use 2-5 letters that identify this invoice series."
133
+ onChange={action('onChange')} />;
134
+ ```
135
+
136
+ ### With Icon
137
+
138
+ Use an icon when the field benefits from compact visual context. Keep the icon decorative unless it is exposed through an interactive element.
139
+
140
+ ```tsx
141
+ const WithIcon = () => <TextField
142
+ label="Signature"
143
+ placeholder="John Hancock"
144
+ onChange={action('onChange')}
145
+ leadingElement={<Icon variant="signature" />} />;
146
+ ```
147
+
148
+ ### With Text
149
+
150
+ Use leading or trailing text for compact units, prefixes, suffixes, or other field-level context.
151
+
152
+ ```tsx
153
+ const WithText = () => <TextField
154
+ label="Price"
155
+ placeholder="1.00"
156
+ onChange={action('onChange')}
157
+ leadingElement={<Body size="sm">€</Body>}
158
+ trailingElement={<Body size="sm">EUR</Body>} />;
159
+ ```
160
+
161
+ ### Validation
162
+
163
+ Use errorMessage with isInvalid so assistive technology receives invalid state and users get actionable validation feedback.
164
+
165
+ ```tsx
166
+ const Validation = () => <TextField
167
+ label="Email address"
168
+ placeholder="billing@example.com"
169
+ type="email"
170
+ isInvalid
171
+ errorMessage="Enter a valid email address."
172
+ onChange={action('onChange')} />;
173
+ ```
174
+
175
+ ### Disabled
176
+
177
+ Use disabled fields when the value is unavailable and users cannot act on it in the current context.
178
+
179
+ ```tsx
180
+ const Disabled = () => <TextField label="Billing contact" placeholder="Select an account first" isDisabled />;
181
+ ```
182
+
183
+ ### Read Only
184
+
185
+ Use read-only fields when the value should remain selectable and readable but cannot be edited.
186
+
187
+ ```tsx
188
+ const ReadOnly = () => <TextField label="Account ID" value="acct_12345" isReadOnly />;
189
+ ```
190
+
191
+ ### Sizes
192
+
193
+ Use size to match the density and prominence of the surrounding form. Use md for most forms, sm in dense interfaces, lg for prominent form rows, and xl when the label and helper or error text should feel integrated with the field.
194
+
195
+ ```tsx
196
+ const Sizes = (args) => (
197
+ <Grid gap={4}>
198
+ {(['sm', 'md', 'lg', 'xl'] as const).map((size) => (
199
+ <TextField key={size} {...args} size={size} />
200
+ ))}
201
+ </Grid>
202
+ );
203
+ ```
204
+
205
+ ### Full Width
206
+
207
+ Use fullWidth in stacked forms and responsive layouts where the field should fill the available parent width.
208
+
209
+ ```tsx
210
+ const FullWidth = () => <TextField
211
+ label="Legal business name"
212
+ placeholder="Acme Corporation"
213
+ fullWidth
214
+ onChange={action('onChange')} />;
215
+ ```
216
+
217
+ ### With Leading Element
218
+
219
+ Use an interactive leading element when the field needs a compact action inside the input. Match the IconButton size to the input size.
220
+
221
+ ```tsx
222
+ const WithLeadingElement = () => <TextField
223
+ label="Date"
224
+ placeholder="mm/dd/yyyy"
225
+ onChange={action('onChange')}
226
+ leadingElement={
227
+ <IconButton
228
+ icon={<Icon variant="calendar" />}
229
+ variant="ghost"
230
+ size="sm"
231
+ aria-label="Select a date"
232
+ />
233
+ } />;
234
+ ```
235
+
236
+ ### With Trailing Element
237
+
238
+ Use an interactive trailing element when the field needs a compact action inside the input. Give the action its own accessible name.
239
+
240
+ ```tsx
241
+ const WithTrailingElement = () => <TextField
242
+ label="Password"
243
+ type="password"
244
+ onChange={action('onChange')}
245
+ trailingElement={
246
+ <IconButton
247
+ icon={<Icon variant="eye" />}
248
+ variant="ghost"
249
+ size="sm"
250
+ aria-label="Show password"
251
+ />
252
+ } />;
253
+ ```
@@ -0,0 +1,140 @@
1
+ # Grid
2
+
3
+ ## Usage Guidelines
4
+
5
+ ### Overview
6
+
7
+ Grid is a layout primitive for arranging child content across rows and columns. Use it for two-dimensional layouts, and apply placement props to child Grid items when content needs to span or start and end on specific tracks.
8
+
9
+ #### When to Use
10
+
11
+ - Use Grid for two-dimensional layouts that need explicit rows and columns.
12
+ - Use Grid when children need to span, start, or end on specific row or column tracks.
13
+ - Use Grid to apply consistent gaps and alignment across a structured content area.
14
+
15
+ #### When Not to Use
16
+
17
+ - Do not use Grid for simple one-dimensional rows or stacks. Use Flex instead.
18
+ - Do not use Grid placement props to change the meaningful reading order of content.
19
+ - Do not use Grid as a replacement for semantic structure such as lists, tables, fieldsets, or navigation landmarks.
20
+
21
+ ### Layout Properties
22
+
23
+ Choose explicit tracks for the container first, then add child placement only when an item needs to break out of the default flow.
24
+
25
+ | Property | Purpose | Usage notes |
26
+ | :----------------------------------------------- | :------------------------------------- | :------------------------------------------------------------------------------------------- |
27
+ | `templateColumns`, `templateRows` | Defines explicit grid tracks. | Use numbered tracks for predictable layouts, `none` to remove explicit tracks, or `subgrid`. |
28
+ | `gap`, `gapX`, `gapY` | Sets spacing between items. | Prefer gap utilities over child margins for consistent spacing. |
29
+ | `autoColumns`, `autoRows` | Sizes automatically created tracks. | Use when child placement creates implicit rows or columns. |
30
+ | `column`, `row` | Sets how many tracks a child spans. | Apply to child Grid items, not the parent container. |
31
+ | `columnStart`, `columnEnd`, `rowStart`, `rowEnd` | Places a child on specific grid lines. | Use start and end together when an item needs precise placement. |
32
+ | `alignItems`, `justifyContent` | Aligns items inside their grid areas. | Use for item alignment, not for changing source order or semantic grouping. |
33
+ | `inline` | Uses an inline-level grid container. | Use only when the grid should participate in surrounding inline flow. |
34
+
35
+ ### Accessibility
36
+
37
+ - Grid uses a `div` by default and does not add interactive behavior or ARIA semantics.
38
+ - Preserve meaningful DOM order even when visual placement changes the rendered order.
39
+ - Use semantic elements inside Grid when the content is a list, form group, navigation area, table-like data, or status region.
40
+ - Avoid using visual placement alone to communicate relationships that need headings, labels, text, or programmatic structure.
41
+ - Keep focus order logical when interactive children span tracks or move across responsive layouts.
42
+
43
+ ### Related
44
+
45
+ - **[Flex](components-flex.md)**: use for one-dimensional rows, stacks, wrapping groups, and proportional item sizing.
46
+
47
+ ## React
48
+
49
+ ```tsx
50
+ import { Grid } from '@maxio-com/react-ui-components';
51
+ ```
52
+
53
+ ## Imports
54
+
55
+ ```tsx
56
+ import { Grid } from "@maxio-com/react-ui-components";
57
+ ```
58
+
59
+ ## Prop Types
60
+
61
+ ### Grid
62
+
63
+ | Prop | Type | Required | Default | Description | Source |
64
+ | --- | --- | --- | --- | --- | --- |
65
+ | `alignItems` | `"center" \| "start" \| "end" \| "baseline" \| "stretch"` | no | - | Apply to child Grid components. Controls how item is positioned vertically. | TypeLiteral |
66
+ | `autoColumns` | `"auto" \| "max" \| "min" \| "fr"` | no | - | Sets the size of columns that do not have a specified size. | TypeLiteral |
67
+ | `autoRows` | `"auto" \| "max" \| "min" \| "fr"` | no | - | Sets the size of rows that do not have a specified size. | TypeLiteral |
68
+ | `column` | `"auto" \| "full" \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 \| 13` | no | - | Apply to child Grid components. Sets the number of columns the item spans. Values can be overridden by `columnStart` and `columnEnd`. | TypeLiteral |
69
+ | `columnEnd` | `"auto" \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 \| 13` | no | - | Apply to child Grid components. Sets the item's ending column. Needs `columnStart` to span multiple columns. | TypeLiteral |
70
+ | `columnStart` | `"auto" \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 \| 13` | no | - | Apply to child Grid components. Sets the item's starting column. | TypeLiteral |
71
+ | `gap` | `0 \| 1 \| "px" \| 0.5 \| 1.5 \| 2 \| 2.5 \| 3 \| 3.5 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 \| 14 \| 16 \| 20 \| 24 \| 28 \| 32 \| 36 \| 40 \| 44 \| 48 \| 52 \| 56 \| 60 \| 64 \| 72 \| 80 \| 96` | no | - | Controls the vertical and horizontal space between grid items. Can be overridden by `gapX` and `gapY`. | TypeLiteral |
72
+ | `gapX` | `0 \| 1 \| "px" \| 0.5 \| 1.5 \| 2 \| 2.5 \| 3 \| 3.5 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 \| 14 \| 16 \| 20 \| 24 \| 28 \| 32 \| 36 \| 40 \| 44 \| 48 \| 52 \| 56 \| 60 \| 64 \| 72 \| 80 \| 96` | no | - | Controls the horizontal space between grid items. | TypeLiteral |
73
+ | `gapY` | `0 \| 1 \| "px" \| 0.5 \| 1.5 \| 2 \| 2.5 \| 3 \| 3.5 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 \| 14 \| 16 \| 20 \| 24 \| 28 \| 32 \| 36 \| 40 \| 44 \| 48 \| 52 \| 56 \| 60 \| 64 \| 72 \| 80 \| 96` | no | - | Controls the vertical space between grid items. | TypeLiteral |
74
+ | `inline` | `boolean` | no | - | Changes grid from block element to inline element. | TypeLiteral |
75
+ | `justifyContent` | `"center" \| "start" \| "end" \| "stretch" \| "normal" \| "between" \| "around" \| "evenly"` | no | - | Apply to child Grid components. Controls how grid item is positioned horizontally. | TypeLiteral |
76
+ | `row` | `"auto" \| "full" \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 \| 13` | no | - | Apply to child Grid components. Sets the number of rows the item spans. Values can be overridden by `rowStart` and `rowEnd`. | TypeLiteral |
77
+ | `rowEnd` | `"auto" \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 \| 13` | no | - | Apply to child Grid components. Sets the item's ending row. Needs `rowStart` to span multiple columns. | TypeLiteral |
78
+ | `rowStart` | `"auto" \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 \| 13` | no | - | Apply to child Grid components. Sets the item's starting row. | TypeLiteral |
79
+ | `templateColumns` | `"none" \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 \| "subgrid"` | no | - | Sets number of columns in the grid. | TypeLiteral |
80
+ | `templateRows` | `"none" \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 11 \| 12 \| "subgrid"` | no | - | Sets number of rows in the grid. | TypeLiteral |
81
+
82
+ ## Stories
83
+
84
+ ### Grid
85
+
86
+ Use Grid for two-dimensional layouts that need explicit rows, columns, consistent gaps, or child item placement across tracks.
87
+
88
+ ```tsx
89
+ const Default = (props) => {
90
+ /* Disabling eslint rule to allow destructuring of props. Since these props are meant only
91
+ for controlling the span and position of child Grid components, they are destructured here to avoid
92
+ passing them to the parent Grid component in the Storybook example. */
93
+
94
+ const {
95
+ column,
96
+ columnStart,
97
+ columnEnd,
98
+ row,
99
+ rowStart,
100
+ rowEnd,
101
+ justifyContent,
102
+ alignItems,
103
+ ...restProps
104
+ } = props;
105
+
106
+ const gridItemProps = {
107
+ justifyContent,
108
+ alignItems,
109
+ style: gridItemStyles,
110
+ };
111
+
112
+ return (
113
+ <Grid {...restProps} className="maxio-body-sm">
114
+ <Grid
115
+ key="1"
116
+ style={{
117
+ ...gridItemStyles,
118
+ backgroundColor: '#0042FF',
119
+ color: 'white',
120
+ }}
121
+ justifyContent={justifyContent}
122
+ alignItems={alignItems}
123
+ column={column}
124
+ columnStart={columnStart}
125
+ columnEnd={columnEnd}
126
+ row={row}
127
+ rowStart={rowStart}
128
+ rowEnd={rowEnd}
129
+ >
130
+ 1
131
+ </Grid>
132
+ {gridItemsArray.map((_, index) => (
133
+ <Grid key={index + 2} {...gridItemProps}>
134
+ {index + 2}
135
+ </Grid>
136
+ ))}
137
+ </Grid>
138
+ );
139
+ };
140
+ ```
@@ -0,0 +1,169 @@
1
+ # Icon
2
+
3
+ ## Usage Guidelines
4
+
5
+ ### Overview
6
+
7
+ Icon renders Maxio custom icons, approved brand icons, and supported Font Awesome fallback icons. Use icons as decorative or supporting visual cues alongside text; use IconButton when the icon itself performs an action.
8
+
9
+ #### When to Use
10
+
11
+ - Use Icon to reinforce nearby labels, statuses, navigation items, or actions with a compact visual cue.
12
+ - Use Maxio kit icons before reaching for Font Awesome fallback icons.
13
+ - Use approved brand icons when a third-party product or integration needs recognizable brand treatment.
14
+ - Use Icon inside components that already provide semantics, such as Button, IconButton, Link, Tag, or TextField.
15
+
16
+ #### When Not to Use
17
+
18
+ - Do not use Icon as the only label for an action. Use IconButton for icon-only controls so the accessible name is explicit.
19
+ - Do not use Icon for illustration, empty states, logos, or larger brand marks. Use the appropriate image or logo treatment instead.
20
+ - Do not override brand or duotone brand colors.
21
+ - Do not rely on icon shape or color alone to communicate status, severity, or required action.
22
+
23
+ ### Variants
24
+
25
+ Choose the icon source before choosing size or color.
26
+
27
+ | Variants | Purpose | Usage notes |
28
+ | :--------------- | :------------------------------------------- | :------------------------------------------------------------------------------------- |
29
+ | Maxio kit | Product UI symbols maintained by Maxio. | Use first for common interface actions, statuses, and navigation. |
30
+ | Brand | Approved single-color brand icons. | Use only for the represented brand or integration. Brand colors are built in. |
31
+ | Duotone brand | Approved two-tone brand icons. | Use only for represented brands that need duotone treatment. Do not override colors. |
32
+ | Font Awesome | Supported fallback icons outside the kit. | Use only when no Maxio kit icon fits. Confirm the icon is available in the loaded kit. |
33
+ | Semantic color | Maxio icon color modifiers. | Use for status or emphasis on non-brand icons, and pair meaning with text. |
34
+ | `xs`, `md`, `lg` | Font Awesome size utilities exposed by Icon. | Match surrounding component density and avoid oversized standalone icons. |
35
+
36
+ ### Behavior
37
+
38
+ - Icon is static visual content and does not add interaction by itself.
39
+ - Pair Icon with Button, IconButton, Link, or another interactive component when the surrounding pattern is interactive.
40
+ - The `color` prop adds a Maxio semantic color modifier to Maxio kit and Font Awesome fallback icons, but not to brand icons.
41
+ - The `variant` prop determines the Font Awesome class family: kit, duotone kit, or sharp regular fallback.
42
+
43
+ ### Accessibility
44
+
45
+ - Treat icons as decorative when nearby visible text already communicates the same meaning.
46
+ - Provide visible text, a label, or surrounding semantic markup for the meaning the icon supports.
47
+ - Use IconButton instead of Icon when the icon alone triggers an action.
48
+ - Do not rely on icon color alone to communicate status or severity.
49
+ - Avoid standalone meaningful icons unless the surrounding component supplies an accessible name or description.
50
+
51
+ ### Related
52
+
53
+ - **[IconButton](components-buttons-iconbutton.md)**: use for icon-only actions.
54
+ - **[Button](components-buttons-button.md)**: use for actions with visible labels and optional leading or trailing icons.
55
+ - **[Link](components-link.md)**: use for navigation with optional supporting icons.
56
+ - **[Logo](components-logo.md)**: use for Maxio brand marks.
57
+
58
+ ## React
59
+
60
+ ```tsx
61
+ import { Icon } from '@maxio-com/react-ui-components';
62
+ ```
63
+
64
+ ### Available Icons
65
+
66
+ ### Custom Maxio Icons
67
+
68
+ Use the Maxio custom icon set first for product UI. These icons render with the Font Awesome kit family.
69
+
70
+ ```tsx
71
+ <Icon variant="address-card" />
72
+ ```
73
+
74
+ ### Brand Icons
75
+
76
+ Brand icons render with their designated brand colors. Do not pass semantic color for brand icons.
77
+
78
+ ```tsx
79
+ <Icon variant="dropbox" />
80
+ ```
81
+
82
+ ### Duotone Brand Icons
83
+
84
+ Duotone brand icons render with the `fa-kit-duotone` family and approved two-color treatment. Do not override duotone brand colors.
85
+
86
+ ```tsx
87
+ <Icon variant="avalara" />
88
+ ```
89
+
90
+ ### Font Awesome Fallback Icons
91
+
92
+ If the Maxio kit does not include an appropriate icon, use a supported Font Awesome fallback icon. Fallback icons render with `fa-sharp`, `fa-regular`, and `fa-<icon-name>` classes.
93
+
94
+ ```tsx
95
+ <Icon variant="life-ring" />
96
+ ```
97
+
98
+ ## Imports
99
+
100
+ ```tsx
101
+ import { Icon } from "@maxio-com/react-ui-components";
102
+ ```
103
+
104
+ ## Prop Types
105
+
106
+ ### Icon
107
+
108
+ | Prop | Type | Required | Default | Description | Source |
109
+ | --- | --- | --- | --- | --- | --- |
110
+ | `className` | `string` | no | - | Class name for the main container | TypeLiteral |
111
+ | `color` | `string` | no | - | The icon color | TypeLiteral |
112
+ | `size` | `"md" \| "lg" \| "xs"` | no | - | The icon size | TypeLiteral |
113
+ | `variant` | `string` | yes | - | The icon variant | TypeLiteral |
114
+
115
+ ## Stories
116
+
117
+ ### Custom Maxio Icon
118
+
119
+ Use a Maxio kit icon when a small visual cue reinforces nearby text, status, or navigation. Keep the icon decorative unless surrounding text supplies the accessible meaning.
120
+
121
+ ```tsx
122
+ const Default = () => <Icon variant="home" size="md" color="primary" />;
123
+ ```
124
+
125
+ ### Colored
126
+
127
+ Use semantic color when an icon needs to match nearby status, tone, or visual emphasis. Do not use color as the only way to communicate meaning.
128
+
129
+ ```tsx
130
+ const Colored = () => <Icon variant="info-circle-fill" size="md" color="info" />;
131
+ ```
132
+
133
+ ### Brand Icon
134
+
135
+ Use approved brand icons with their built-in brand colors. The color prop is intentionally ignored for brand icons.
136
+
137
+ ```tsx
138
+ const BrandIcon = () => <Icon variant={BRAND_ICONS[1]} size="md" />;
139
+ ```
140
+
141
+ ### Duotone Brand Icon
142
+
143
+ Use duotone brand icons only for brands that have an approved duotone asset. Keep the generated `fa-kit-duotone` class so Font Awesome renders both tones.
144
+
145
+ ```tsx
146
+ const DuotoneBrandIcon = () => <Icon variant={BRAND_ICONS_DUOTONE[0]} size="md" />;
147
+ ```
148
+
149
+ ### Font Awesome Icon
150
+
151
+ Use a supported Font Awesome fallback icon only when the Maxio kit does not include an appropriate icon.
152
+
153
+ ```tsx
154
+ const FontAwesomeIcon = () => <Icon variant={NON_KIT_ICONS_LIST[2]} size="md" color="secondary" />;
155
+ ```
156
+
157
+ ### Sizes
158
+
159
+ Use size to match the density of the surrounding UI. Most product interfaces should use the default surrounding component size rather than oversized icons.
160
+
161
+ ```tsx
162
+ const Sizes = (args) => (
163
+ <div style={{ display: 'flex', alignItems: 'center', gap: '1rem' }}>
164
+ {(['xs', 'md', 'lg'] as const).map((size) => (
165
+ <Icon key={size} {...args} size={size} />
166
+ ))}
167
+ </div>
168
+ );
169
+ ```