@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.
- package/dist/skills/maxio-react/SKILL.md +68 -0
- package/dist/skills/maxio-react/agents/openai.yaml +4 -0
- package/dist/skills/maxio-react/references/components-action-list.md +92 -0
- package/dist/skills/maxio-react/references/components-action-menu.md +162 -0
- package/dist/skills/maxio-react/references/components-avatar.md +66 -0
- package/dist/skills/maxio-react/references/components-breadcrumbs.md +86 -0
- package/dist/skills/maxio-react/references/components-buttons-button.md +170 -0
- package/dist/skills/maxio-react/references/components-buttons-iconbutton.md +102 -0
- package/dist/skills/maxio-react/references/components-card.md +175 -0
- package/dist/skills/maxio-react/references/components-chip.md +151 -0
- package/dist/skills/maxio-react/references/components-data-table.md +344 -0
- package/dist/skills/maxio-react/references/components-drawer.md +293 -0
- package/dist/skills/maxio-react/references/components-flex.md +185 -0
- package/dist/skills/maxio-react/references/components-forms-checkbox.md +257 -0
- package/dist/skills/maxio-react/references/components-forms-combobox.md +250 -0
- package/dist/skills/maxio-react/references/components-forms-radio-group.md +202 -0
- package/dist/skills/maxio-react/references/components-forms-select.md +295 -0
- package/dist/skills/maxio-react/references/components-forms-textfield.md +253 -0
- package/dist/skills/maxio-react/references/components-grid.md +140 -0
- package/dist/skills/maxio-react/references/components-icon.md +169 -0
- package/dist/skills/maxio-react/references/components-link.md +180 -0
- package/dist/skills/maxio-react/references/components-listbox.md +205 -0
- package/dist/skills/maxio-react/references/components-loading-spinner.md +123 -0
- package/dist/skills/maxio-react/references/components-logo.md +91 -0
- package/dist/skills/maxio-react/references/components-notifications-alert.md +103 -0
- package/dist/skills/maxio-react/references/components-notifications-banner.md +173 -0
- package/dist/skills/maxio-react/references/components-notifications-toast.md +155 -0
- package/dist/skills/maxio-react/references/components-pagination.md +115 -0
- package/dist/skills/maxio-react/references/components-popover.md +176 -0
- package/dist/skills/maxio-react/references/components-progressbar.md +98 -0
- package/dist/skills/maxio-react/references/components-segmentedcontrol.md +292 -0
- package/dist/skills/maxio-react/references/components-tabs.md +193 -0
- package/dist/skills/maxio-react/references/components-tag.md +117 -0
- package/dist/skills/maxio-react/references/components-tile.md +114 -0
- package/dist/skills/maxio-react/references/components-toggle.md +218 -0
- package/dist/skills/maxio-react/references/components-tooltip.md +178 -0
- package/dist/skills/maxio-react/references/components-typography-body.md +101 -0
- package/dist/skills/maxio-react/references/components-typography-code.md +72 -0
- package/dist/skills/maxio-react/references/components-typography-display.md +91 -0
- package/dist/skills/maxio-react/references/components-typography-heading.md +88 -0
- package/dist/skills/maxio-react/references/components-typography-label.md +82 -0
- package/dist/skills/maxio-react/references/deprecated-textinput.md +250 -0
- package/dist/skills/maxio-react/references/foundations-dark-mode.md +85 -0
- package/dist/skills/maxio-react/references/foundations-design-tokens-about.md +108 -0
- package/dist/skills/maxio-react/references/foundations-design-tokens-colors-primitive-colors.md +33 -0
- package/dist/skills/maxio-react/references/foundations-design-tokens-colors-semantic-colors.md +11 -0
- package/dist/skills/maxio-react/references/foundations-start-here.md +128 -0
- package/dist/skills/maxio-react/references/patterns-auth-layout.md +318 -0
- package/dist/skills/maxio-react/references/patterns-side-nav.md +182 -0
- package/dist/skills/maxio-react/references/patterns-top-bar.md +214 -0
- package/package.json +2 -2
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# TooltipTrigger
|
|
2
|
+
|
|
3
|
+
## Usage Guidelines
|
|
4
|
+
|
|
5
|
+
### Overview
|
|
6
|
+
|
|
7
|
+
TooltipTrigger displays brief contextual help next to a trigger while preserving overlay positioning, keyboard, and dismissal behavior.
|
|
8
|
+
|
|
9
|
+
#### When to Use
|
|
10
|
+
|
|
11
|
+
- Use TooltipTrigger for short, supplemental context that helps explain a nearby term, icon, value, or control.
|
|
12
|
+
- Use TooltipTrigger when the information should appear on hover, focus, or click without changing page layout.
|
|
13
|
+
- Use TooltipTrigger when the tooltip content is helpful but the trigger remains understandable without it.
|
|
14
|
+
|
|
15
|
+
#### When Not to Use
|
|
16
|
+
|
|
17
|
+
- Do not use TooltipTrigger for required instructions, errors, or warnings. Put essential content directly in the interface.
|
|
18
|
+
- Do not use TooltipTrigger for rich interactive content, forms, or multi-step help. Use Popover instead.
|
|
19
|
+
- Do not use TooltipTrigger as the only label for an icon-only action. Give the trigger its own accessible name.
|
|
20
|
+
|
|
21
|
+
### Behavior
|
|
22
|
+
|
|
23
|
+
- **Mouse and touch**: hover shows the tooltip when `hover` is included. Click shows it when `click` is included.
|
|
24
|
+
- **Keyboard**: focus shows the tooltip when `focus` is included. Add `dismiss` when Escape or focus loss should close a persistent tooltip.
|
|
25
|
+
- **Focus management**: keep the trigger reachable and keep the tooltip noninteractive so focus can remain on the trigger.
|
|
26
|
+
- **Controlled state**: use `isVisible` with `onVisibilityUpdate` when application state needs to open, close, or synchronize tooltip visibility.
|
|
27
|
+
- **Dismissal or persistence**: use `autoHideMs` for short-lived click-triggered confirmations, and avoid persistent tooltips for content users must act on.
|
|
28
|
+
|
|
29
|
+
### Accessibility
|
|
30
|
+
|
|
31
|
+
- Keep tooltip content brief and descriptive. Tooltips should supplement the trigger, not replace visible labels or instructions.
|
|
32
|
+
- Ensure the trigger has an accessible name through visible text, `aria-label`, or `aria-labelledby`.
|
|
33
|
+
- Connect hand-authored tooltip markup to its trigger with `aria-describedby` and expose the floating element with `role="tooltip"`.
|
|
34
|
+
- Include focus support whenever hover reveals information that keyboard users also need.
|
|
35
|
+
- Do not place buttons, links, fields, or other interactive content inside a tooltip.
|
|
36
|
+
|
|
37
|
+
### Content
|
|
38
|
+
|
|
39
|
+
- Write tooltip copy as a short phrase or sentence that explains the trigger in context.
|
|
40
|
+
- Avoid repeating the trigger label unless the repetition clarifies a term or status.
|
|
41
|
+
- Prefer concrete product language, such as "Invoices renew monthly", over generic help text.
|
|
42
|
+
- Move long guidance, error recovery, or policy details into persistent page content.
|
|
43
|
+
|
|
44
|
+
### Related
|
|
45
|
+
|
|
46
|
+
- **[IconButton](components-buttons-iconbutton.md)**: use for icon-only actions that need their own accessible name.
|
|
47
|
+
- **[ActionMenu](components-action-menu.md)**: use when a trigger opens a list of actions rather than explanatory text.
|
|
48
|
+
- **[Popover](components-popover.md)**: use when the overlay needs richer content or interactive controls.
|
|
49
|
+
|
|
50
|
+
## React
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
import { TooltipTrigger } from '@maxio-com/react-ui-components';
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Imports
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
import { TooltipTrigger } from "@maxio-com/react-ui-components";
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Prop Types
|
|
63
|
+
|
|
64
|
+
### TooltipTrigger
|
|
65
|
+
|
|
66
|
+
| Prop | Type | Required | Default | Description | Source |
|
|
67
|
+
| --- | --- | --- | --- | --- | --- |
|
|
68
|
+
| `autoHideMs` | `number` | no | - | Milliseconds after the overlay is automatically deactivated | TypeLiteral |
|
|
69
|
+
| `children` | `ReactNode` | yes | - | React children nodes | TypeLiteral |
|
|
70
|
+
| `className` | `string` | no | - | Class name for the main container | TypeLiteral |
|
|
71
|
+
| `floatingElementOffset` | `number` | no | `5` | Floating element offset | TypeLiteral |
|
|
72
|
+
| `interactions` | `Interactions[]` | no | `['hover']` | Definition of interactions that manages displaying of overlay element | TypeLiteral |
|
|
73
|
+
| `isVisible` | `boolean` | no | - | Tooltip visibility state - use with useExternalState property | TypeLiteral |
|
|
74
|
+
| `maxWidth` | `number \| "none"` | no | `160` | Maximum tooltip container width in pixels | TypeLiteral |
|
|
75
|
+
| `onVisibilityUpdate` | `((isVisible: boolean) => void)` | no | - | Tooltip visibility state | TypeLiteral |
|
|
76
|
+
| `placement` | `"left" \| "right" \| "top" \| "bottom" \| "left-start" \| "left-end" \| "right-start" \| "right-end" \| "top-start" \| "top-end" \| "bottom-start" \| "bottom-end"` | no | `right` | Overlay element placement | TypeLiteral |
|
|
77
|
+
| `renderContent` | `() => ReactNode` | yes | - | Tooltip content renderer | TypeLiteral |
|
|
78
|
+
| `size` | `"small" \| "regular"` | no | `regular` | Tooltip component size variant | TypeLiteral |
|
|
79
|
+
| `usePortal` | `boolean` | no | - | Render floating element in portal container | TypeLiteral |
|
|
80
|
+
|
|
81
|
+
## Stories
|
|
82
|
+
|
|
83
|
+
### Default
|
|
84
|
+
|
|
85
|
+
Snippet unavailable: SyntaxError: Expected render to be an arrow function or function expression
|
|
86
|
+
|
|
87
|
+
### Click Interaction
|
|
88
|
+
|
|
89
|
+
Use click interaction when the trigger is already an explicit control and the tooltip should stay available after pointer movement.
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
const ClickInteraction = () => (
|
|
93
|
+
<TooltipTrigger
|
|
94
|
+
interactions={['click']}
|
|
95
|
+
renderContent={() => 'This report includes all active subscriptions.'}
|
|
96
|
+
>
|
|
97
|
+
<ListItem label="Show report hint" />
|
|
98
|
+
</TooltipTrigger>
|
|
99
|
+
);
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Dismiss Interaction
|
|
103
|
+
|
|
104
|
+
Add dismiss when users need an explicit way to close a tooltip after click, focus, or another persistent interaction opens it.
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
const DismissInteraction = () => (
|
|
108
|
+
<TooltipTrigger
|
|
109
|
+
interactions={['click', 'dismiss']}
|
|
110
|
+
renderContent={() =>
|
|
111
|
+
'Press Escape or move focus away to close this hint.'
|
|
112
|
+
}
|
|
113
|
+
>
|
|
114
|
+
<ListItem label="Show dismissible hint" />
|
|
115
|
+
</TooltipTrigger>
|
|
116
|
+
);
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Hover Interaction
|
|
120
|
+
|
|
121
|
+
Use hover interaction for pointer-only supporting information. Pair it with focus in product experiences when the same tooltip should be keyboard accessible.
|
|
122
|
+
|
|
123
|
+
```tsx
|
|
124
|
+
const HoverInteraction = () => (
|
|
125
|
+
<TooltipTrigger
|
|
126
|
+
interactions={['hover']}
|
|
127
|
+
renderContent={() => 'Revenue is shown before refunds and discounts.'}
|
|
128
|
+
>
|
|
129
|
+
<ListItem label="Hover for revenue hint" />
|
|
130
|
+
</TooltipTrigger>
|
|
131
|
+
);
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Focus Interaction
|
|
135
|
+
|
|
136
|
+
Use focus interaction when the tooltip explains something keyboard users can tab to. Keep the tooltip nonessential so the trigger remains understandable without it.
|
|
137
|
+
|
|
138
|
+
```tsx
|
|
139
|
+
const FocusInteraction = () => (
|
|
140
|
+
<TooltipTrigger
|
|
141
|
+
interactions={['focus']}
|
|
142
|
+
renderContent={() => 'This value is calculated from posted invoices.'}
|
|
143
|
+
>
|
|
144
|
+
<ListItem label="Focus for invoice hint" />
|
|
145
|
+
</TooltipTrigger>
|
|
146
|
+
);
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Auto Hide
|
|
150
|
+
|
|
151
|
+
Use autoHideMs when a click-triggered tooltip should clear itself after a short, predictable amount of time.
|
|
152
|
+
|
|
153
|
+
```tsx
|
|
154
|
+
const AutoHide = () => (
|
|
155
|
+
<TooltipTrigger
|
|
156
|
+
interactions={['click']}
|
|
157
|
+
autoHideMs={2000}
|
|
158
|
+
renderContent={() => 'Copied invoice link to clipboard.'}
|
|
159
|
+
>
|
|
160
|
+
<ListItem label="Copy invoice link" />
|
|
161
|
+
</TooltipTrigger>
|
|
162
|
+
);
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Max Width
|
|
166
|
+
|
|
167
|
+
Use maxWidth to keep longer tooltip copy readable. Prefer editing tooltip copy down before increasing the width.
|
|
168
|
+
|
|
169
|
+
```tsx
|
|
170
|
+
const MaxWidth = () => (
|
|
171
|
+
<TooltipTrigger
|
|
172
|
+
interactions={['hover']}
|
|
173
|
+
renderContent={() => longTooltipContent}
|
|
174
|
+
>
|
|
175
|
+
<ListItem label="Hover for plan-name hint" />
|
|
176
|
+
</TooltipTrigger>
|
|
177
|
+
);
|
|
178
|
+
```
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Body
|
|
2
|
+
|
|
3
|
+
## Usage Guidelines
|
|
4
|
+
|
|
5
|
+
### Overview
|
|
6
|
+
|
|
7
|
+
Body renders paragraph-level and supporting text with Maxio typography classes. Choose the semantic element that matches the content, then use `size` and `compact` for visual rhythm.
|
|
8
|
+
|
|
9
|
+
#### When to Use
|
|
10
|
+
|
|
11
|
+
- Use Body for readable paragraph copy, descriptions, helper text, and supporting content.
|
|
12
|
+
- Use Body when text should follow Maxio body typography without adding heading, label, link, or code semantics.
|
|
13
|
+
- Use compact Body for dense supporting copy where tighter line height improves scannability.
|
|
14
|
+
|
|
15
|
+
#### When Not to Use
|
|
16
|
+
|
|
17
|
+
- Do not use Body for page or section titles. Use Heading or Display instead.
|
|
18
|
+
- Do not use Body for form labels, captions, or compact metadata that should have label styling. Use Label instead.
|
|
19
|
+
- Do not use Body to style inline links. Use Link so the text has link semantics and states.
|
|
20
|
+
|
|
21
|
+
### Sizes
|
|
22
|
+
|
|
23
|
+
Choose the size that matches the content hierarchy and available space.
|
|
24
|
+
|
|
25
|
+
| Size | Purpose | Usage notes |
|
|
26
|
+
| :--- | :----------------------------- | :--------------------------------------------------------------- |
|
|
27
|
+
| `xs` | Small supporting text. | Use for compact details, descriptions, or secondary metadata. |
|
|
28
|
+
| `sm` | Standard supporting text. | Use for helper copy, table details, and dense interface content. |
|
|
29
|
+
| `md` | Default body copy. | Use for readable paragraphs and general page content. |
|
|
30
|
+
| `lg` | Emphasized readable body copy. | Use sparingly when body copy needs more presence than `md`. |
|
|
31
|
+
|
|
32
|
+
### Line Height
|
|
33
|
+
|
|
34
|
+
- Use the default line height for most body copy and any paragraph that wraps across multiple lines.
|
|
35
|
+
- Use `compact` for dense supporting text, table-adjacent details, and short descriptions inside constrained layouts.
|
|
36
|
+
- Avoid compact line height for long-form reading or content that needs generous scanning space.
|
|
37
|
+
|
|
38
|
+
### Accessibility
|
|
39
|
+
|
|
40
|
+
- Choose the semantic element for the content first, then apply Body typography.
|
|
41
|
+
- Use `p` for standalone paragraphs, `span` for inline text, and structural elements such as `li`, `td`, or `figcaption` when those semantics fit.
|
|
42
|
+
- Preserve the document reading order and do not use body text as a replacement for headings, labels, or links.
|
|
43
|
+
- Do not rely on size alone to communicate requiredness, hierarchy, or state.
|
|
44
|
+
- Keep text readable at the selected size, especially for customer-generated content and localized strings.
|
|
45
|
+
|
|
46
|
+
### Content
|
|
47
|
+
|
|
48
|
+
- Keep body copy direct and useful; lead with the information the user needs to act.
|
|
49
|
+
- Break long copy into short paragraphs or lists instead of forcing one dense block.
|
|
50
|
+
- Use compact body text for supporting context, not for primary instructions or warnings.
|
|
51
|
+
- Avoid all-caps body copy and decorative punctuation that makes content harder to scan.
|
|
52
|
+
|
|
53
|
+
### Related
|
|
54
|
+
|
|
55
|
+
- **[Display](components-typography-display.md)**: use for the largest marketing or page-level title treatments.
|
|
56
|
+
- **[Heading](components-typography-heading.md)**: use for semantic section headings and page structure.
|
|
57
|
+
- **[Label](components-typography-label.md)**: use for form labels, compact captions, and metadata styling.
|
|
58
|
+
- **[Link](components-link.md)**: use for inline or standalone navigation text.
|
|
59
|
+
|
|
60
|
+
## React
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
import { Body } from '@maxio-com/react-ui-components';
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Imports
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
import { Body } from "@maxio-com/react-ui-components";
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Prop Types
|
|
73
|
+
|
|
74
|
+
### Body
|
|
75
|
+
|
|
76
|
+
| Prop | Type | Required | Default | Description | Source |
|
|
77
|
+
| --- | --- | --- | --- | --- | --- |
|
|
78
|
+
| `as` | `ElementType` | no | `div` | The component to render as (e.g. `span or div`) | TypeLiteral |
|
|
79
|
+
| `children` | `ReactNode` | yes | - | The content of the label | TypeLiteral |
|
|
80
|
+
| `className` | `string` | no | - | React className prop passed to the component | TypeLiteral |
|
|
81
|
+
| `compact` | `boolean` | no | `false` | Set the body to compact mode - lower line height | TypeLiteral |
|
|
82
|
+
| `id` | `string` | no | - | - | TypeLiteral |
|
|
83
|
+
| `size` | `"sm" \| "md" \| "lg" \| "xs"` | no | `md` | Defines the size of the body text. | TypeLiteral |
|
|
84
|
+
|
|
85
|
+
## Stories
|
|
86
|
+
|
|
87
|
+
### Default
|
|
88
|
+
|
|
89
|
+
Use Body for readable page copy, descriptions, helper text, and other paragraph-level content. Prefer semantic elements such as `p` for standalone paragraphs and `span` for inline text.
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
const Default = () => <Body as="p">{SLOGAN}</Body>;
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Compact
|
|
96
|
+
|
|
97
|
+
Use compact Body when dense layouts need a tighter line height, such as helper copy, table details, or supporting text inside compact UI surfaces.
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
const Compact = () => <Body as="p" compact size="sm">Invoice details are synchronized nightly and may take a few minutes to appear in reports.</Body>;
|
|
101
|
+
```
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Code
|
|
2
|
+
|
|
3
|
+
## Usage Guidelines
|
|
4
|
+
|
|
5
|
+
### Overview
|
|
6
|
+
|
|
7
|
+
Code renders short inline code, tokens, file names, identifiers, or values in the Maxio monospace typography style.
|
|
8
|
+
|
|
9
|
+
#### When to Use
|
|
10
|
+
|
|
11
|
+
- Use Code for short inline code, identifiers, API fields, file names,
|
|
12
|
+
environment variables, or values users may need to recognize or copy.
|
|
13
|
+
- Use Code when monospace typography helps distinguish a machine-readable token
|
|
14
|
+
from surrounding prose.
|
|
15
|
+
- Use semantic `code` markup when the content represents code or a literal value.
|
|
16
|
+
|
|
17
|
+
#### When Not to Use
|
|
18
|
+
|
|
19
|
+
- Do not use Code for regular body copy, labels, headings, or decorative
|
|
20
|
+
emphasis. Use the matching Typography component instead.
|
|
21
|
+
- Do not use Code for long or multi-line examples. Use a dedicated code block
|
|
22
|
+
pattern that preserves formatting and supports scanning.
|
|
23
|
+
- Do not use Code as the only way to communicate state, severity, or validation.
|
|
24
|
+
|
|
25
|
+
### Accessibility
|
|
26
|
+
|
|
27
|
+
- Prefer rendering Code as `code` when the snippet represents code, an
|
|
28
|
+
identifier, or a literal value.
|
|
29
|
+
- Keep snippets short and readable in the surrounding sentence.
|
|
30
|
+
- Provide enough surrounding text that users understand what the token means.
|
|
31
|
+
- Do not rely on monospace styling alone to communicate meaning.
|
|
32
|
+
|
|
33
|
+
### Content
|
|
34
|
+
|
|
35
|
+
- Use exact values, field names, commands, or identifiers that match product and
|
|
36
|
+
developer-facing copy.
|
|
37
|
+
- Avoid wrapping full sentences or marketing copy in Code.
|
|
38
|
+
- Keep punctuation outside the coded value unless it is part of the value users
|
|
39
|
+
should read or copy.
|
|
40
|
+
|
|
41
|
+
## React
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
import { Code } from '@maxio-com/react-ui-components';
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Imports
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
import { Code } from "@maxio-com/react-ui-components";
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Prop Types
|
|
54
|
+
|
|
55
|
+
### Code
|
|
56
|
+
|
|
57
|
+
| Prop | Type | Required | Default | Description | Source |
|
|
58
|
+
| --- | --- | --- | --- | --- | --- |
|
|
59
|
+
| `as` | `ElementType` | no | `div` | The component to render as (e.g. `span or div`) | TypeLiteral |
|
|
60
|
+
| `children` | `ReactNode` | yes | - | The content of the label | TypeLiteral |
|
|
61
|
+
| `className` | `string` | no | - | React className prop passed to the component | TypeLiteral |
|
|
62
|
+
| `id` | `string` | no | - | - | TypeLiteral |
|
|
63
|
+
|
|
64
|
+
## Stories
|
|
65
|
+
|
|
66
|
+
### Default
|
|
67
|
+
|
|
68
|
+
Use Code for short inline snippets such as variable names, API fields, file names, keyboard-like values, or other machine-readable tokens. Render as semantic `code` when the content represents code or a value users may copy.
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
const Default = () => <Code as="code">billing_cycle_anchor</Code>;
|
|
72
|
+
```
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Display
|
|
2
|
+
|
|
3
|
+
## Usage Guidelines
|
|
4
|
+
|
|
5
|
+
### Overview
|
|
6
|
+
|
|
7
|
+
Display renders prominent brand typography for page-level headlines, hero statements, and other high-emphasis moments.
|
|
8
|
+
|
|
9
|
+
#### When to Use
|
|
10
|
+
|
|
11
|
+
- Use Display for a page hero, marketing headline, or other short headline that
|
|
12
|
+
should carry the strongest visual emphasis.
|
|
13
|
+
- Use Display when the text needs Maxio's display typography but the semantic
|
|
14
|
+
element should still come from the surrounding page structure.
|
|
15
|
+
|
|
16
|
+
#### When Not to Use
|
|
17
|
+
|
|
18
|
+
- Do not use Display for standard section headings. Use Heading instead.
|
|
19
|
+
- Do not use Display for body copy, descriptions, labels, table content, or
|
|
20
|
+
compact UI text.
|
|
21
|
+
- Do not use Display only to make arbitrary text larger when a semantic heading
|
|
22
|
+
size or layout change would be clearer.
|
|
23
|
+
|
|
24
|
+
### Variants
|
|
25
|
+
|
|
26
|
+
Choose the smallest size that still creates the intended hierarchy.
|
|
27
|
+
|
|
28
|
+
| Size | Purpose | Usage notes |
|
|
29
|
+
| :--- | :------------------------------ | :------------------------------------------------------------------------ |
|
|
30
|
+
| `sm` | Compact display headline. | Use when a high-emphasis headline appears in a constrained content area. |
|
|
31
|
+
| `md` | Standard display headline. | Use for prominent page or section introductions. |
|
|
32
|
+
| `lg` | Highest-emphasis hero headline. | Use sparingly for first-viewport page titles or major marketing messages. |
|
|
33
|
+
|
|
34
|
+
### Accessibility
|
|
35
|
+
|
|
36
|
+
- Choose `as` from the document outline, such as `h1` for the primary page title
|
|
37
|
+
or `h2` for a major section.
|
|
38
|
+
- Do not skip heading levels to achieve a visual size. Use `size` for visual scale instead.
|
|
39
|
+
- Keep Display text concise so it remains readable at large sizes and across
|
|
40
|
+
responsive layouts.
|
|
41
|
+
- Preserve enough color contrast between display text and the surrounding background.
|
|
42
|
+
|
|
43
|
+
### Content
|
|
44
|
+
|
|
45
|
+
- Write short, specific headlines that communicate the page or section purpose.
|
|
46
|
+
- Avoid long paragraphs, legal copy, or dense product details in Display.
|
|
47
|
+
- Keep nearby supporting copy in Body or Heading typography so the visual
|
|
48
|
+
hierarchy stays clear.
|
|
49
|
+
|
|
50
|
+
### Related
|
|
51
|
+
|
|
52
|
+
- **[Heading](components-typography-heading.md)**: use for
|
|
53
|
+
standard page and section headings.
|
|
54
|
+
- **[Body](components-typography-body.md)**: use for paragraphs
|
|
55
|
+
and supporting copy.
|
|
56
|
+
- **[Label](components-typography-label.md)**: use for field
|
|
57
|
+
labels, captions, and compact metadata.
|
|
58
|
+
|
|
59
|
+
## React
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
import { Display } from '@maxio-com/react-ui-components';
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Imports
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
import { Display } from "@maxio-com/react-ui-components";
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Prop Types
|
|
72
|
+
|
|
73
|
+
### Display
|
|
74
|
+
|
|
75
|
+
| Prop | Type | Required | Default | Description | Source |
|
|
76
|
+
| --- | --- | --- | --- | --- | --- |
|
|
77
|
+
| `as` | `ElementType` | no | `div` | The component to render as (e.g. `span or div`) | TypeLiteral |
|
|
78
|
+
| `children` | `ReactNode` | yes | - | The content of the label | TypeLiteral |
|
|
79
|
+
| `className` | `string` | no | - | React className prop passed to the component | TypeLiteral |
|
|
80
|
+
| `id` | `string` | no | - | - | TypeLiteral |
|
|
81
|
+
| `size` | `"sm" \| "md" \| "lg"` | no | `md` | Defines the size of the display text | TypeLiteral |
|
|
82
|
+
|
|
83
|
+
## Stories
|
|
84
|
+
|
|
85
|
+
### Display
|
|
86
|
+
|
|
87
|
+
Use Display for the most prominent headline in a page, hero, or marketing section. Keep the semantic element aligned with the document outline, and use the Display size only for visual scale.
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
const Default = () => <Display as="h1" size="lg">{SLOGAN}</Display>;
|
|
91
|
+
```
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Heading
|
|
2
|
+
|
|
3
|
+
## Usage Guidelines
|
|
4
|
+
|
|
5
|
+
### Overview
|
|
6
|
+
|
|
7
|
+
Heading is used for page and section titles.
|
|
8
|
+
|
|
9
|
+
#### When to Use
|
|
10
|
+
|
|
11
|
+
- Use Heading for page, section, and panel titles that should participate in the document outline.
|
|
12
|
+
- Use Heading when content needs Maxio heading typography and semantic heading markup.
|
|
13
|
+
|
|
14
|
+
#### When Not to Use
|
|
15
|
+
|
|
16
|
+
- Do not use Heading for body copy, captions, or helper text. Use Body instead.
|
|
17
|
+
- Do not use Heading for form labels or compact metadata. Use Label instead.
|
|
18
|
+
- Do not use Heading only to make decorative text large. Use Display for non-structural display text.
|
|
19
|
+
|
|
20
|
+
### Sizes
|
|
21
|
+
|
|
22
|
+
Heading size sets both the visual style and the rendered heading element.
|
|
23
|
+
|
|
24
|
+
| Size | Rendered element | Usage notes |
|
|
25
|
+
| :--- | :--------------- | :------------------------------------- |
|
|
26
|
+
| `lg` | `h1` | Page or view title. |
|
|
27
|
+
| `md` | `h2` | Major section title beneath a page. |
|
|
28
|
+
| `sm` | `h3` | Subsection, panel, or grouped content. |
|
|
29
|
+
|
|
30
|
+
### Accessibility
|
|
31
|
+
|
|
32
|
+
- Keep heading levels in order so the page outline is predictable.
|
|
33
|
+
- Use one `h1` for the primary page or view title when possible.
|
|
34
|
+
- Do not skip heading levels only to change visual size.
|
|
35
|
+
- Keep heading text visible, concise, and specific to the content that follows.
|
|
36
|
+
|
|
37
|
+
### Content
|
|
38
|
+
|
|
39
|
+
- Use headings to name the section, not to describe instructions in sentence form.
|
|
40
|
+
- Keep heading copy short enough to scan in dense application layouts.
|
|
41
|
+
- Avoid punctuation unless the heading is a question or includes a proper noun that requires it.
|
|
42
|
+
|
|
43
|
+
## React
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
import { Heading } from '@maxio-com/react-ui-components';
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Imports
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
import { Heading } from "@maxio-com/react-ui-components";
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Prop Types
|
|
56
|
+
|
|
57
|
+
### Heading
|
|
58
|
+
|
|
59
|
+
| Prop | Type | Required | Default | Description | Source |
|
|
60
|
+
| --- | --- | --- | --- | --- | --- |
|
|
61
|
+
| `children` | `ReactNode` | yes | - | The content of the label | TypeLiteral |
|
|
62
|
+
| `className` | `string` | no | - | React className prop passed to the component | TypeLiteral |
|
|
63
|
+
| `id` | `string` | no | - | - | TypeLiteral |
|
|
64
|
+
| `size` | `"sm" \| "md" \| "lg"` | no | `sm` | Defines the size of the heading text | TypeLiteral |
|
|
65
|
+
|
|
66
|
+
## Stories
|
|
67
|
+
|
|
68
|
+
### Default
|
|
69
|
+
|
|
70
|
+
Use Heading for page, section, and panel titles that should participate in the document outline. Choose the size that matches the heading level: `lg` renders `h1`, `md` renders `h2`, and `sm` renders `h3`.
|
|
71
|
+
|
|
72
|
+
```tsx
|
|
73
|
+
const Default = () => <Heading>{SECTION_HEADING}</Heading>;
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Heading hierarchy
|
|
77
|
+
|
|
78
|
+
Use a heading hierarchy to keep page titles, major sections, and subsections easy to scan. Keep heading levels in order so assistive technology users can navigate the page structure predictably.
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
const HeadingHierarchy = () => (
|
|
82
|
+
<>
|
|
83
|
+
<Heading size="lg">Revenue dashboard</Heading>
|
|
84
|
+
<Heading size="md">Recurring revenue</Heading>
|
|
85
|
+
<Heading size="sm">Expansion trends</Heading>
|
|
86
|
+
</>
|
|
87
|
+
);
|
|
88
|
+
```
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Label
|
|
2
|
+
|
|
3
|
+
## Usage Guidelines
|
|
4
|
+
|
|
5
|
+
### Overview
|
|
6
|
+
|
|
7
|
+
Label renders compact Maxio label typography for field labels, captions, table labels, and metadata names.
|
|
8
|
+
|
|
9
|
+
#### When to Use
|
|
10
|
+
|
|
11
|
+
- Use Label for compact text that names a nearby value, control, table column, or metadata field.
|
|
12
|
+
- Use Label when the text needs more emphasis than body copy but less hierarchy than Heading.
|
|
13
|
+
- Use Label for repeated UI labels where consistent size and weight help scanning.
|
|
14
|
+
|
|
15
|
+
#### When Not to Use
|
|
16
|
+
|
|
17
|
+
- Do not use Label for paragraphs or explanatory copy. Use Body instead.
|
|
18
|
+
- Do not use Label for page, section, or card titles. Use Heading instead.
|
|
19
|
+
- Do not use Label alone to create a complete form field in React. Use form components such as TextField when you need the label, control, helper text, and error state wired together.
|
|
20
|
+
|
|
21
|
+
### Variants
|
|
22
|
+
|
|
23
|
+
Choose the smallest size that stays readable in the surrounding layout.
|
|
24
|
+
|
|
25
|
+
| Variants | Purpose | Usage notes |
|
|
26
|
+
| :------- | :--------------------------- | :------------------------------------------------------ |
|
|
27
|
+
| `sm` | Standard compact label text. | Use for most field labels, captions, and metadata keys. |
|
|
28
|
+
| `xs` | Dense supporting label text. | Use in tables, chips, tags, and other compact surfaces. |
|
|
29
|
+
|
|
30
|
+
### Accessibility
|
|
31
|
+
|
|
32
|
+
- Choose the rendered element for the content's purpose, not only for styling.
|
|
33
|
+
- Use a native `label` element with a `for` and `id` relationship when static HTML labels a form control.
|
|
34
|
+
- In React, prefer complete form components when you need accessible label, helper text, validation, and input associations.
|
|
35
|
+
- Keep label text visible, concise, and specific so it can serve as the accessible name when it labels a control.
|
|
36
|
+
- Do not rely on typography weight or color alone to communicate requiredness, error state, or selection.
|
|
37
|
+
|
|
38
|
+
### Content
|
|
39
|
+
|
|
40
|
+
- Use short nouns or noun phrases such as "Customer", "Status", or "Billing contact".
|
|
41
|
+
- Match the label to the value or control it identifies.
|
|
42
|
+
- Avoid sentence-length copy; use Body for descriptions, helper text, and instructions.
|
|
43
|
+
|
|
44
|
+
### Related
|
|
45
|
+
|
|
46
|
+
- **[Body](components-typography-body.md)**: use for paragraphs, descriptions, helper text, and longer supporting copy.
|
|
47
|
+
- **[Heading](components-typography-heading.md)**: use for page, section, card, and grouped content titles.
|
|
48
|
+
- **[TextField](components-forms-textfield.md)**: use for React form fields with labels, helper text, and validation behavior.
|
|
49
|
+
|
|
50
|
+
## React
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
import { Label } from '@maxio-com/react-ui-components';
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Imports
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
import { Label } from "@maxio-com/react-ui-components";
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Prop Types
|
|
63
|
+
|
|
64
|
+
### Label
|
|
65
|
+
|
|
66
|
+
| Prop | Type | Required | Default | Description | Source |
|
|
67
|
+
| --- | --- | --- | --- | --- | --- |
|
|
68
|
+
| `as` | `ElementType` | no | `div` | The component to render as (e.g. `span or div`) | TypeLiteral |
|
|
69
|
+
| `children` | `ReactNode` | yes | - | The content of the label | TypeLiteral |
|
|
70
|
+
| `className` | `string` | no | - | React className prop passed to the component | TypeLiteral |
|
|
71
|
+
| `id` | `string` | no | - | - | TypeLiteral |
|
|
72
|
+
| `size` | `"sm" \| "xs"` | no | `sm` | Defines the size of the label text | TypeLiteral |
|
|
73
|
+
|
|
74
|
+
## Stories
|
|
75
|
+
|
|
76
|
+
### Label
|
|
77
|
+
|
|
78
|
+
Use Label for compact, medium-weight text that names a nearby value, field, table column, or supporting UI detail. Keep the semantic element aligned with the surrounding content; use form components for fully associated form labels.
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
const Default = () => <Label as="span" size="sm">{LABEL_TEXT}</Label>;
|
|
82
|
+
```
|