atlas-react-kit 1.2.0 → 1.2.2
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/COMPONENTS.md +40 -40
- package/DESIGN_RULES.md +14 -40
- package/README.md +7 -6
- package/dist/alert.js +7 -6
- package/dist/calendar.js +5 -4
- package/dist/card.js +2 -1
- package/dist/combobox.d.ts +4 -3
- package/dist/combobox.js +8 -17
- package/dist/date-time-picker.js +2 -1
- package/dist/dialog.js +2 -1
- package/dist/dropdown-menu.js +7 -5
- package/dist/field.d.ts +6 -3
- package/dist/field.js +3 -2
- package/dist/form/checkbox-field.d.ts +3 -5
- package/dist/form/checkbox-field.js +13 -19
- package/dist/form/combobox-field.d.ts +2 -2
- package/dist/form/combobox-field.js +5 -6
- package/dist/form/control-field.d.ts +5 -5
- package/dist/form/control-field.js +6 -9
- package/dist/form/date-picker-field.d.ts +1 -1
- package/dist/form/date-picker-field.js +3 -7
- package/dist/form/date-time-picker-field.d.ts +1 -1
- package/dist/form/date-time-picker-field.js +3 -7
- package/dist/form/field-error.d.ts +13 -4
- package/dist/form/field-shell.d.ts +63 -47
- package/dist/form/field-shell.js +67 -35
- package/dist/form/focus-first-invalid.d.ts +7 -4
- package/dist/form/focus-first-invalid.js +10 -6
- package/dist/form/markdown-field.d.ts +1 -1
- package/dist/form/markdown-field.js +8 -4
- package/dist/form/select-field.d.ts +2 -8
- package/dist/form/select-field.js +5 -7
- package/dist/form/text-field.d.ts +2 -8
- package/dist/form/text-field.js +9 -6
- package/dist/form/toggle-group-field.d.ts +2 -2
- package/dist/form/toggle-group-field.js +5 -6
- package/dist/info-tip.d.ts +7 -4
- package/dist/info-tip.js +12 -4
- package/dist/internal/active-link.d.ts +7 -0
- package/dist/internal/active-link.js +9 -0
- package/dist/internal/calendar-size.d.ts +5 -0
- package/dist/internal/calendar-size.js +5 -0
- package/dist/internal/form-control.d.ts +7 -1
- package/dist/internal/form-control.js +8 -1
- package/dist/internal/kanban-layout.js +2 -1
- package/dist/internal/listbox-navigation.d.ts +8 -8
- package/dist/internal/listbox-navigation.js +23 -23
- package/dist/internal/listbox-option.d.ts +16 -3
- package/dist/internal/listbox-option.js +22 -5
- package/dist/internal/overlay-styles.d.ts +15 -5
- package/dist/internal/overlay-styles.js +15 -5
- package/dist/internal/search.d.ts +4 -0
- package/dist/internal/search.js +6 -0
- package/dist/internal/styles.d.ts +21 -0
- package/dist/internal/styles.js +21 -0
- package/dist/kanban.js +3 -2
- package/dist/label.js +2 -1
- package/dist/lazy-calendar.js +3 -2
- package/dist/nav-link.js +2 -1
- package/dist/picker-shell.d.ts +3 -1
- package/dist/picker-shell.js +3 -3
- package/dist/popover.js +6 -5
- package/dist/search-picker.js +8 -16
- package/dist/select.js +5 -5
- package/dist/skip-link.js +2 -1
- package/dist/tabs.js +3 -2
- package/dist/toast.js +11 -10
- package/dist/toggle-group.d.ts +1 -1
- package/dist/toggle-group.js +36 -2
- package/dist/tooltip.js +2 -2
- package/package.json +1 -1
- package/skills/atlas-react-kit/SKILL.md +46 -42
package/dist/tabs.js
CHANGED
|
@@ -3,6 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import {} from "class-variance-authority";
|
|
5
5
|
import { Slot, Tabs as TabsPrimitive } from "radix-ui";
|
|
6
|
+
import { activeLinkAttributes, activeLinkSelector, } from "./internal/active-link.js";
|
|
6
7
|
import { focusRing } from "./internal/styles.js";
|
|
7
8
|
import { tabsListVariants, tabsScrollerVariants, tabsTriggerVariants, } from "./internal/tabs-styles.js";
|
|
8
9
|
import { useDragScroll } from "./internal/use-drag-scroll.js";
|
|
@@ -37,7 +38,7 @@ function TabsScroller({ variant = "default", orientation = "horizontal", classNa
|
|
|
37
38
|
const scroller = ref.current;
|
|
38
39
|
if (!scroller)
|
|
39
40
|
return;
|
|
40
|
-
const active = scroller.querySelector(
|
|
41
|
+
const active = scroller.querySelector(activeLinkSelector);
|
|
41
42
|
if (!active || active === revealed.current)
|
|
42
43
|
return;
|
|
43
44
|
revealed.current = active;
|
|
@@ -74,7 +75,7 @@ function TabsContent({ className, ...props }) {
|
|
|
74
75
|
*/
|
|
75
76
|
function TabsNavLink({ asChild, active, className, ...props }) {
|
|
76
77
|
const Comp = asChild ? Slot.Root : "a";
|
|
77
|
-
return (_jsx(Comp, { "data-slot": "tabs-nav-link",
|
|
78
|
+
return (_jsx(Comp, { "data-slot": "tabs-nav-link", ...activeLinkAttributes(active), className: cn(tabsTriggerVariants(), className), ...props }));
|
|
78
79
|
}
|
|
79
80
|
/**
|
|
80
81
|
* Tab-styled links for a view switcher that changes the URL. Use this, not
|
package/dist/toast.js
CHANGED
|
@@ -5,6 +5,7 @@ import { CircleAlertIcon, CircleCheckIcon, InfoIcon, LoaderCircleIcon, XIcon, }
|
|
|
5
5
|
import { useTheme } from "next-themes";
|
|
6
6
|
import { Toaster as Sonner, toast as sonnerToast, } from "sonner";
|
|
7
7
|
import { buttonVariants } from "./button.js";
|
|
8
|
+
import { statusTone } from "./internal/styles.js";
|
|
8
9
|
import { cn } from "./utils.js";
|
|
9
10
|
/**
|
|
10
11
|
* Copies only the kit's options, so plain JavaScript callers cannot hand the
|
|
@@ -42,7 +43,7 @@ const toast = Object.assign(show(sonnerToast), {
|
|
|
42
43
|
*
|
|
43
44
|
* Icon policy: a plain `toast()` has no icon. `success`, `info`, `warning`,
|
|
44
45
|
* `error`, and `loading` each show a status icon. Tone colors the icon, title,
|
|
45
|
-
* and border (
|
|
46
|
+
* and border (`statusTone`, shared with Alert), not the body text.
|
|
46
47
|
*
|
|
47
48
|
* Close button: a circular badge centred on the top-right corner (`-top-2
|
|
48
49
|
* -right-2`, half outside the border). Ghost / icon-xs still supplies the
|
|
@@ -70,22 +71,22 @@ const classNames = {
|
|
|
70
71
|
// falls back to the title's width, so a one-word toast stays compact.
|
|
71
72
|
// 1.625rem = 16px icon + 10px gap-x-2.5.
|
|
72
73
|
content: "flex min-w-0 flex-1 basis-full flex-col gap-1 [[data-icon]+&]:basis-[calc(100%-1.625rem)]",
|
|
73
|
-
title: "font-medium leading-5",
|
|
74
|
+
title: "font-medium leading-5 text-(--status-tone)",
|
|
74
75
|
description: "leading-5 text-muted-foreground",
|
|
75
76
|
icon: "flex size-4 shrink-0 items-center justify-center [&_svg]:size-4",
|
|
76
77
|
actionButton: cn(buttonVariants({ size: "xs" }), "shrink-0"),
|
|
77
78
|
cancelButton: cn(buttonVariants({ variant: "outline", size: "xs" }), "shrink-0"),
|
|
78
79
|
closeButton: cn(buttonVariants({ variant: "ghost", size: "icon-xs" }), "!absolute !-top-2 !-right-2 !left-auto !z-10 !size-6 !rounded-full !border !border-border !bg-popover !p-0 !text-muted-foreground !shadow-xs !translate-x-0 !translate-y-0 hover:!border-border hover:!bg-popover hover:!text-foreground focus-visible:!text-foreground active:!translate-y-0 [&_svg]:!size-3"),
|
|
79
|
-
success:
|
|
80
|
-
info:
|
|
81
|
-
warning:
|
|
82
|
-
error:
|
|
80
|
+
success: statusTone.success,
|
|
81
|
+
info: statusTone.neutral,
|
|
82
|
+
warning: statusTone.warning,
|
|
83
|
+
error: statusTone.destructive,
|
|
83
84
|
};
|
|
84
85
|
const icons = {
|
|
85
|
-
success: _jsx(CircleCheckIcon, { "aria-hidden": true, className: "text-
|
|
86
|
-
info: _jsx(InfoIcon, { "aria-hidden": true, className: "text-
|
|
87
|
-
warning: _jsx(CircleAlertIcon, { "aria-hidden": true, className: "text-
|
|
88
|
-
error: _jsx(CircleAlertIcon, { "aria-hidden": true, className: "text-
|
|
86
|
+
success: _jsx(CircleCheckIcon, { "aria-hidden": true, className: "text-(--status-tone)" }),
|
|
87
|
+
info: _jsx(InfoIcon, { "aria-hidden": true, className: "text-(--status-tone)" }),
|
|
88
|
+
warning: _jsx(CircleAlertIcon, { "aria-hidden": true, className: "text-(--status-tone)" }),
|
|
89
|
+
error: _jsx(CircleAlertIcon, { "aria-hidden": true, className: "text-(--status-tone)" }),
|
|
89
90
|
loading: (_jsx(LoaderCircleIcon, { "aria-hidden": true, className: "animate-spin text-muted-foreground" })),
|
|
90
91
|
close: _jsx(XIcon, { "aria-hidden": true, className: "size-3" }),
|
|
91
92
|
};
|
package/dist/toggle-group.d.ts
CHANGED
|
@@ -12,6 +12,6 @@ type ToggleGroupLayoutProps = {
|
|
|
12
12
|
/** Lay items out in a row or a column. Default `horizontal`. */
|
|
13
13
|
orientation?: "horizontal" | "vertical";
|
|
14
14
|
};
|
|
15
|
-
declare function ToggleGroup({ className, variant, size, spacing, orientation, children, ...props }: React.ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants> & ToggleGroupLayoutProps): React.JSX.Element;
|
|
15
|
+
declare function ToggleGroup({ className, variant, size, spacing, orientation, children, onKeyDown, onPointerDown, onFocus, ...props }: React.ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants> & ToggleGroupLayoutProps): React.JSX.Element;
|
|
16
16
|
declare function ToggleGroupItem({ className, children, variant, size, ...props }: React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>): React.JSX.Element;
|
|
17
17
|
export { ToggleGroup, ToggleGroupItem };
|
package/dist/toggle-group.js
CHANGED
|
@@ -5,15 +5,49 @@ import {} from "class-variance-authority";
|
|
|
5
5
|
import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui";
|
|
6
6
|
import { cn } from "./utils.js";
|
|
7
7
|
import { toggleVariants } from "./toggle.js";
|
|
8
|
+
/** The keys Radix's roving focus moves between items with. */
|
|
9
|
+
const arrowKeys = new Set(["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"]);
|
|
10
|
+
function isItem(target) {
|
|
11
|
+
return (target instanceof HTMLElement && target.dataset.slot === "toggle-group-item");
|
|
12
|
+
}
|
|
8
13
|
const ToggleGroupContext = React.createContext({
|
|
9
14
|
size: "default",
|
|
10
15
|
variant: "default",
|
|
11
16
|
spacing: 2,
|
|
12
17
|
orientation: "horizontal",
|
|
13
18
|
});
|
|
14
|
-
function ToggleGroup({ className, variant, size, spacing = 2, orientation = "horizontal", children, ...props }) {
|
|
19
|
+
function ToggleGroup({ className, variant, size, spacing = 2, orientation = "horizontal", children, onKeyDown, onPointerDown, onFocus, ...props }) {
|
|
20
|
+
// The item an arrow key was pressed on, until focus lands on the next one.
|
|
21
|
+
// A single group's items are radios, and focus that arrives by arrow key
|
|
22
|
+
// selects, as in any radio group; Tab and clicks do not.
|
|
23
|
+
const arrowFrom = React.useRef(null);
|
|
24
|
+
const selectsOnArrow = props.type === "single" && props.rovingFocus !== false;
|
|
15
25
|
const context = React.useMemo(() => ({ variant, size, spacing, orientation }), [variant, size, spacing, orientation]);
|
|
16
|
-
return (_jsx(ToggleGroupPrimitive.Root, { "data-slot": "toggle-group", "data-variant": variant, "data-size": size, "data-spacing": spacing, "data-orientation": orientation,
|
|
26
|
+
return (_jsx(ToggleGroupPrimitive.Root, { "data-slot": "toggle-group", "data-variant": variant, "data-size": size, "data-spacing": spacing, "data-orientation": orientation, onKeyDown: (event) => {
|
|
27
|
+
onKeyDown?.(event);
|
|
28
|
+
// Radix moves focus to the next item once the key has bubbled up.
|
|
29
|
+
if (selectsOnArrow &&
|
|
30
|
+
arrowKeys.has(event.key) &&
|
|
31
|
+
isItem(event.target) &&
|
|
32
|
+
!(event.metaKey || event.ctrlKey || event.altKey || event.shiftKey)) {
|
|
33
|
+
arrowFrom.current = event.target;
|
|
34
|
+
}
|
|
35
|
+
}, onPointerDown: (event) => {
|
|
36
|
+
onPointerDown?.(event);
|
|
37
|
+
arrowFrom.current = null;
|
|
38
|
+
}, onFocus: (event) => {
|
|
39
|
+
onFocus?.(event);
|
|
40
|
+
const from = arrowFrom.current;
|
|
41
|
+
arrowFrom.current = null;
|
|
42
|
+
const item = event.target;
|
|
43
|
+
// Clicking runs the selection Radix already owns, onValueChange included.
|
|
44
|
+
if (from &&
|
|
45
|
+
from !== item &&
|
|
46
|
+
isItem(item) &&
|
|
47
|
+
item.getAttribute("aria-checked") !== "true") {
|
|
48
|
+
item.click();
|
|
49
|
+
}
|
|
50
|
+
}, style: { "--gap": spacing }, className: cn("group/toggle-group flex w-fit max-w-full flex-row flex-wrap items-center gap-[--spacing(var(--gap))] data-[spacing=0]:data-[variant=outline]:rounded-none data-vertical:flex-col data-vertical:flex-nowrap data-vertical:items-stretch", className), ...props, children: _jsx(ToggleGroupContext.Provider, { value: context, children: children }) }));
|
|
17
51
|
}
|
|
18
52
|
function ToggleGroupItem({ className, children, variant = "default", size = "default", ...props }) {
|
|
19
53
|
const context = React.useContext(ToggleGroupContext);
|
package/dist/tooltip.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
5
|
-
import { overlaySideSlide } from "./internal/overlay-styles.js";
|
|
5
|
+
import { OVERLAY_SIDE_OFFSET, overlaySideSlide, } from "./internal/overlay-styles.js";
|
|
6
6
|
import { cn } from "./utils.js";
|
|
7
7
|
/** True inside a TooltipProvider, so `Tooltip` does not add its own. */
|
|
8
8
|
const HasTooltipProvider = React.createContext(false);
|
|
@@ -28,7 +28,7 @@ function Tooltip({ ...props }) {
|
|
|
28
28
|
function TooltipTrigger({ ...props }) {
|
|
29
29
|
return _jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
30
30
|
}
|
|
31
|
-
function TooltipContent({ className, arrowClassName, sideOffset =
|
|
31
|
+
function TooltipContent({ className, arrowClassName, sideOffset = OVERLAY_SIDE_OFFSET, children, ...props }) {
|
|
32
32
|
return (_jsx(TooltipPrimitive.Portal, { children: _jsxs(TooltipPrimitive.Content, { "data-slot": "tooltip-content", sideOffset: sideOffset, className: cn(overlaySideSlide,
|
|
33
33
|
// Radix tooltips open as "delayed-open" or "instant-open", which
|
|
34
34
|
// the shared data-open fade does not match.
|
package/package.json
CHANGED
|
@@ -28,23 +28,21 @@ than guessing.
|
|
|
28
28
|
|
|
29
29
|
## 2. Check the project setup once
|
|
30
30
|
|
|
31
|
-
Components render unstyled unless the app's global stylesheet imports the
|
|
32
|
-
and tells Tailwind to scan the kit's compiled files
|
|
31
|
+
Components render unstyled unless the app's global stylesheet imports the
|
|
32
|
+
theme and tells Tailwind to scan the kit's compiled files. Compare the app
|
|
33
|
+
with the setup in the package's README (the stylesheet lines and dark mode):
|
|
33
34
|
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
@import "atlas-react-kit/theme.css";
|
|
37
|
-
@source "../node_modules/atlas-react-kit/dist"; /* relative to this CSS file */
|
|
35
|
+
```sh
|
|
36
|
+
cat "$KIT/README.md"
|
|
38
37
|
```
|
|
39
38
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Fix missing setup rather than working around unstyled components.
|
|
39
|
+
Toasts need one `<Toaster />` from `atlas-react-kit/toast`; show them with
|
|
40
|
+
`toast()` from the same module, using only the options it declares. Never
|
|
41
|
+
import a toast library such as `sonner` directly: the kit owns the toast API,
|
|
42
|
+
and a second copy never reaches its toaster. Some entry points need optional
|
|
43
|
+
peers; install the extras from the "Optional peer dependencies" table in
|
|
44
|
+
`COMPONENTS.md` when you import them. Fix missing setup rather than working
|
|
45
|
+
around unstyled components.
|
|
48
46
|
|
|
49
47
|
## 3. Pick the kit component for the job
|
|
50
48
|
|
|
@@ -54,48 +52,54 @@ Import each component from its subpath, e.g.
|
|
|
54
52
|
|
|
55
53
|
| Need | Use |
|
|
56
54
|
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
|
57
|
-
| Short fixed list (a handful of options) | `Select`
|
|
58
|
-
| Long or searchable list (timezones, currencies) | `Combobox` from `combobox`
|
|
55
|
+
| Short fixed list (a handful of options) | `Select` from `select` |
|
|
56
|
+
| Long or searchable list (timezones, currencies) | `Combobox` from `combobox` |
|
|
59
57
|
| Always-visible searchable list (places) | `SearchPicker` from `search-picker` |
|
|
60
|
-
| One date, or a from/to range | `DatePickerButton` from `date-picker`
|
|
58
|
+
| One date, or a from/to range | `DatePickerButton` from `date-picker` |
|
|
61
59
|
| Date and time (not `datetime-local`) | `DateTimePickerButton` from `date-time-picker` |
|
|
62
60
|
| Labelled field with error text | `FormTextField`, `FormSelectField`, `FormDatePickerField`, `FormDateTimePickerField`, `FormMarkdownField` from `form/*` |
|
|
63
61
|
| Checkbox, checkbox group, toggle group, combobox in a form | `FormCheckboxField`, `FormCheckboxGroupField`, `FormToggleGroupField`, `FormComboboxField` from `form/*` |
|
|
64
62
|
| Custom control the kit has no form field for | `FormControlField` from `form/control-field` |
|
|
65
63
|
| Form-level error (save failed) | `FormFeedbackField` from `form/feedback-field` |
|
|
66
|
-
|
|
|
67
|
-
|
|
|
68
|
-
|
|
|
69
|
-
|
|
|
64
|
+
| Focus the first invalid field when a submit fails | `focusFirstInvalid` from `form/focus-first-invalid`; fields without a `field` prop take `fieldName={field.name}` |
|
|
65
|
+
| Content panels on one page | `Tabs` from `tabs` |
|
|
66
|
+
| View switch that changes the URL | `TabsNav` and `TabsNavLink` from `tabs`; in Next, `next/tabs-nav-link` |
|
|
67
|
+
| App shell nav (Calendar, Tasks, Settings) | `NavLink` from `nav-link`; in Next, `next/nav-link` |
|
|
70
68
|
| Skip-to-content link | `SkipLink` from `skip-link` |
|
|
71
69
|
| Page title row with actions | `PageHeader` from `page-header` |
|
|
72
|
-
| Previous / today / next period | `PeriodStepper` from `period-stepper`; `next/period-stepper`
|
|
73
|
-
| Cards in columns that drag | `KanbanBoard` from `kanban
|
|
74
|
-
| SVG chart axes, grid, tooltip, legend | `
|
|
75
|
-
| Status chip (paid, pending, failed) | `Badge
|
|
76
|
-
| Data table | `Table`
|
|
70
|
+
| Previous / today / next period | `PeriodStepper` from `period-stepper`; for URL periods in Next, `next/period-stepper` |
|
|
71
|
+
| Cards in columns that drag | `KanbanBoard` from `kanban` |
|
|
72
|
+
| SVG chart axes, grid, tooltip, legend | `chartFrame` and the other helpers from `chart` |
|
|
73
|
+
| Status chip (paid, pending, failed) | `Badge` from `badge` |
|
|
74
|
+
| Data table | `Table` from `table` |
|
|
75
|
+
| Sortable column header | `SortableTableHead` from `sortable-table-head` |
|
|
76
|
+
| Table body while loading | `TableBodySkeleton` from `table-body-skeleton` |
|
|
77
77
|
| Nothing to show yet | `EmptyPanel` from `empty-panel` |
|
|
78
|
-
| Grouped content | `Card`
|
|
79
|
-
| Modal | `Dialog`
|
|
80
|
-
| Label for an icon button, or a short hint | `Tooltip` from `tooltip
|
|
81
|
-
| Longer help from a glyph | `InfoTip`
|
|
78
|
+
| Grouped content | `Card` from `card` |
|
|
79
|
+
| Modal | `Dialog` from `dialog` |
|
|
80
|
+
| Label for an icon button, or a short hint | `Tooltip` from `tooltip` |
|
|
81
|
+
| Longer help from a glyph | `InfoTip` from `info-tip` |
|
|
82
82
|
| Color scale key | `ColorLegend` from `color-legend` |
|
|
83
|
-
| GitHub-flavoured Markdown | `Markdown` from `markdown
|
|
84
|
-
| Summary figure in a strip | `StatTile` from `stat-tile`
|
|
85
|
-
| Value against a scale, optional ticks | `Meter` from `meter`
|
|
83
|
+
| GitHub-flavoured Markdown | `Markdown` from `markdown` |
|
|
84
|
+
| Summary figure in a strip | `StatTile` from `stat-tile` |
|
|
85
|
+
| Value against a scale, optional ticks | `Meter` from `meter` |
|
|
86
86
|
| Number on a continuous scale | `Slider` from `slider` |
|
|
87
|
-
| Row actions or an overflow menu of commands | `DropdownMenu`
|
|
88
|
-
| Setting that applies immediately | `Switch` from `switch
|
|
89
|
-
|
|
|
90
|
-
|
|
|
91
|
-
|
|
|
92
|
-
|
|
|
93
|
-
|
|
|
94
|
-
|
|
|
95
|
-
|
|
|
87
|
+
| Row actions or an overflow menu of commands | `DropdownMenu` from `dropdown-menu` |
|
|
88
|
+
| Setting that applies immediately | `Switch` from `switch` |
|
|
89
|
+
| On/off choice submitted with a form | `Checkbox` from `checkbox` |
|
|
90
|
+
| One choice from a few visible options | `RadioGroup` from `radio-group` |
|
|
91
|
+
| Inline message about a page or section | `Alert` from `alert` |
|
|
92
|
+
| Person or workspace image | `Avatar` from `avatar` |
|
|
93
|
+
| Sections that expand in place | `Accordion` from `accordion` |
|
|
94
|
+
| Pages of a long list | `Pagination` from `pagination` |
|
|
95
|
+
| Where the page sits in a hierarchy | `Breadcrumb` from `breadcrumb` |
|
|
96
|
+
| Job with a known percentage | `Progress` from `progress` |
|
|
97
|
+
| Wait of unknown length | `Spinner` from `spinner` |
|
|
96
98
|
| Crash recovery around a section | `ErrorBoundary` from `error-boundary` |
|
|
97
99
|
| Conditional classes | `cn` from `utils` |
|
|
98
100
|
|
|
101
|
+
The parts, props, and options of each are in its `COMPONENTS.md` row.
|
|
102
|
+
|
|
99
103
|
If nothing fits, build the piece in the app from kit primitives and semantic
|
|
100
104
|
tokens. Do not copy kit source into the app; a missing shared component belongs
|
|
101
105
|
in the atlas-design-system repository.
|