@slashsuite/ui-react 0.12.1 → 0.13.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/MIGRATING.md +386 -8
- package/README.md +89 -44
- package/agent-docs/components/app-shell.md +9 -6
- package/agent-docs/components/article-layout.md +140 -0
- package/agent-docs/components/audio.md +42 -0
- package/agent-docs/components/badge.md +2 -1
- package/agent-docs/components/body-text.md +26 -15
- package/agent-docs/components/bottom-sheet.md +27 -17
- package/agent-docs/components/breadcrumbs.md +10 -6
- package/agent-docs/components/button.md +2 -2
- package/agent-docs/components/call-to-action.md +59 -0
- package/agent-docs/components/callout.md +4 -3
- package/agent-docs/components/card-grid.md +15 -7
- package/agent-docs/components/card.md +33 -18
- package/agent-docs/components/cart-button.md +63 -0
- package/agent-docs/components/chat-composer.md +4 -3
- package/agent-docs/components/checkbox.md +11 -5
- package/agent-docs/components/cluster.md +10 -8
- package/agent-docs/components/code-example.md +2 -2
- package/agent-docs/components/code.md +7 -5
- package/agent-docs/components/colour-scheme-toggle.md +12 -6
- package/agent-docs/components/colour-swatch.md +41 -0
- package/agent-docs/components/combobox.md +88 -0
- package/agent-docs/components/confirm-dialog.md +98 -0
- package/agent-docs/components/container.md +2 -1
- package/agent-docs/components/copy-button.md +7 -5
- package/agent-docs/components/copy-line.md +6 -5
- package/agent-docs/components/date-field.md +14 -11
- package/agent-docs/components/date-range-picker.md +16 -9
- package/agent-docs/components/date-time-field.md +73 -0
- package/agent-docs/components/dialog.md +22 -68
- package/agent-docs/components/disclosure.md +4 -0
- package/agent-docs/components/docs-layout.md +10 -6
- package/agent-docs/components/drawer.md +13 -4
- package/agent-docs/components/embed-frame.md +48 -0
- package/agent-docs/components/empty-state.md +4 -1
- package/agent-docs/components/field-dialog.md +6 -5
- package/agent-docs/components/field.md +10 -7
- package/agent-docs/components/fieldset.md +4 -4
- package/agent-docs/components/flow-diagram.md +87 -0
- package/agent-docs/components/form-layout.md +4 -1
- package/agent-docs/components/form-row.md +7 -7
- package/agent-docs/components/full-bleed-layout.md +0 -2
- package/agent-docs/components/headings.md +13 -7
- package/agent-docs/components/hero.md +11 -2
- package/agent-docs/components/icon-button.md +1 -3
- package/agent-docs/components/icon.md +6 -13
- package/agent-docs/components/image.md +24 -14
- package/agent-docs/components/input.md +8 -7
- package/agent-docs/components/key-value-list.md +4 -1
- package/agent-docs/components/lightbox.md +1 -1
- package/agent-docs/components/list-layout.md +5 -7
- package/agent-docs/components/list-row.md +37 -34
- package/agent-docs/components/loading.md +2 -2
- package/agent-docs/components/markdown.md +13 -13
- package/agent-docs/components/media-tile.md +8 -4
- package/agent-docs/components/menu.md +19 -12
- package/agent-docs/components/meta-list.md +2 -2
- package/agent-docs/components/morph.md +11 -5
- package/agent-docs/components/navigation-progress.md +2 -2
- package/agent-docs/components/number-field.md +75 -0
- package/agent-docs/components/outline-region.md +19 -8
- package/agent-docs/components/page-fade.md +2 -1
- package/agent-docs/components/pill.md +7 -6
- package/agent-docs/components/popover.md +63 -0
- package/agent-docs/components/price.md +49 -0
- package/agent-docs/components/product-tile.md +78 -0
- package/agent-docs/components/promo-banner.md +46 -0
- package/agent-docs/components/prose-layout.md +1 -1
- package/agent-docs/components/radio-group.md +9 -6
- package/agent-docs/components/scroll-strip.md +3 -3
- package/agent-docs/components/segmented-control.md +4 -2
- package/agent-docs/components/select.md +8 -3
- package/agent-docs/components/show.md +2 -2
- package/agent-docs/components/side-column.md +13 -9
- package/agent-docs/components/sidebar-layout.md +1 -1
- package/agent-docs/components/site-footer.md +4 -4
- package/agent-docs/components/site-search.md +21 -9
- package/agent-docs/components/slider.md +59 -0
- package/agent-docs/components/sortable-list.md +15 -10
- package/agent-docs/components/stack.md +3 -3
- package/agent-docs/components/stacked-bar.md +7 -4
- package/agent-docs/components/state-machine.md +95 -0
- package/agent-docs/components/status-pages.md +13 -6
- package/agent-docs/components/stepper.md +54 -0
- package/agent-docs/components/switch.md +4 -4
- package/agent-docs/components/table-of-contents.md +78 -0
- package/agent-docs/components/table.md +35 -24
- package/agent-docs/components/tabs.md +24 -26
- package/agent-docs/components/text-link.md +12 -7
- package/agent-docs/components/textarea.md +4 -2
- package/agent-docs/components/toast.md +19 -14
- package/agent-docs/components/video.md +7 -2
- package/agent-docs/llms.txt +22 -3
- package/dist/AppShell.d.ts +25 -9
- package/dist/AppShell.js +67 -33
- package/dist/AppShellMenu.d.ts +31 -18
- package/dist/AppShellMenu.js +72 -45
- package/dist/ArticleLayout.d.ts +36 -0
- package/dist/ArticleLayout.js +27 -0
- package/dist/Audio.d.ts +16 -0
- package/dist/Audio.js +11 -0
- package/dist/Badge.d.ts +2 -1
- package/dist/Badge.js +3 -2
- package/dist/BottomSheet.d.ts +17 -6
- package/dist/BottomSheet.js +62 -11
- package/dist/Breadcrumbs.d.ts +8 -6
- package/dist/Breadcrumbs.js +17 -7
- package/dist/Button.d.ts +4 -2
- package/dist/Button.js +9 -87
- package/dist/CallToAction.d.ts +25 -0
- package/dist/CallToAction.js +17 -0
- package/dist/Callout.d.ts +2 -2
- package/dist/Callout.js +2 -2
- package/dist/Card.d.ts +88 -31
- package/dist/Card.js +55 -92
- package/dist/CardBody.d.ts +2 -0
- package/dist/CardBody.js +33 -3
- package/dist/CardGrid.d.ts +32 -4
- package/dist/CardGrid.js +42 -8
- package/dist/CardParts.d.ts +7 -1
- package/dist/CardParts.js +7 -2
- package/dist/CartButton.d.ts +33 -0
- package/dist/CartButton.js +18 -0
- package/dist/ChatComposer.d.ts +10 -4
- package/dist/ChatComposer.js +35 -13
- package/dist/Checkbox.d.ts +21 -3
- package/dist/Checkbox.js +66 -20
- package/dist/Chevron.js +1 -1
- package/dist/Cluster.d.ts +28 -15
- package/dist/Cluster.js +21 -4
- package/dist/Code.d.ts +15 -3
- package/dist/Code.js +23 -3
- package/dist/CodeBlock.d.ts +4 -4
- package/dist/CodeBlock.js +2 -2
- package/dist/CodeBody.d.ts +1 -1
- package/dist/CodeBody.js +4 -10
- package/dist/CodeExample.d.ts +1 -1
- package/dist/CodeExample.js +3 -2
- package/dist/ColourSchemeToggle.d.ts +21 -5
- package/dist/ColourSchemeToggle.js +15 -9
- package/dist/ColourSwatch.d.ts +15 -0
- package/dist/ColourSwatch.js +14 -0
- package/dist/Combobox.d.ts +42 -0
- package/dist/Combobox.js +43 -0
- package/dist/ConfirmDialog.d.ts +40 -0
- package/dist/ConfirmDialog.js +36 -0
- package/dist/Container.d.ts +3 -3
- package/dist/Container.js +1 -1
- package/dist/CopyButton.d.ts +8 -2
- package/dist/CopyButton.js +38 -28
- package/dist/CopyLine.d.ts +4 -2
- package/dist/CopyLine.js +4 -4
- package/dist/DateCalendar.d.ts +2 -0
- package/dist/DateCalendar.js +11 -9
- package/dist/DateField.d.ts +52 -21
- package/dist/DateField.js +73 -37
- package/dist/DateFieldCalendar.d.ts +12 -8
- package/dist/DateFieldCalendar.js +37 -18
- package/dist/DateRangePicker.d.ts +23 -3
- package/dist/DateRangePicker.js +10 -8
- package/dist/DateTimeField.d.ts +31 -0
- package/dist/DateTimeField.js +19 -0
- package/dist/Dialog.d.ts +42 -6
- package/dist/Dialog.js +50 -12
- package/dist/Disclosure.js +9 -1
- package/dist/DocsLayout.d.ts +13 -5
- package/dist/DocsLayout.js +11 -9
- package/dist/Drawer.d.ts +22 -7
- package/dist/Drawer.js +89 -8
- package/dist/EmbedFrame.d.ts +36 -0
- package/dist/EmbedFrame.js +18 -0
- package/dist/Field.d.ts +41 -4
- package/dist/Field.js +61 -25
- package/dist/FieldDialog.d.ts +8 -3
- package/dist/FieldDialog.js +19 -9
- package/dist/Fieldset.d.ts +3 -3
- package/dist/Fieldset.js +7 -9
- package/dist/FileDrop.js +2 -1
- package/dist/FlowDiagram.d.ts +92 -0
- package/dist/FlowDiagram.js +100 -0
- package/dist/FormRow.d.ts +6 -4
- package/dist/FormRow.js +11 -9
- package/dist/Hero.d.ts +30 -7
- package/dist/Hero.js +23 -9
- package/dist/Icon.d.ts +1 -1
- package/dist/Icon.js +1 -1
- package/dist/IconButton.js +1 -1
- package/dist/Image.d.ts +33 -9
- package/dist/Image.js +61 -16
- package/dist/Input.d.ts +1 -1
- package/dist/Input.js +4 -4
- package/dist/InputShell.d.ts +7 -0
- package/dist/InputShell.js +18 -3
- package/dist/KeyValueList.d.ts +2 -2
- package/dist/Lightbox.js +5 -3
- package/dist/ListRow.d.ts +4 -5
- package/dist/ListRow.js +36 -26
- package/dist/Mark.d.ts +10 -0
- package/dist/Mark.js +9 -0
- package/dist/Markdown.d.ts +18 -4
- package/dist/Markdown.js +176 -37
- package/dist/MediaTile.d.ts +9 -3
- package/dist/MediaTile.js +8 -4
- package/dist/Menu.d.ts +19 -8
- package/dist/Menu.js +13 -11
- package/dist/MetaList.d.ts +4 -3
- package/dist/MetaList.js +12 -4
- package/dist/Morph.d.ts +15 -1
- package/dist/Morph.js +70 -22
- package/dist/NavigationProgress.d.ts +2 -2
- package/dist/NavigationProgress.js +7 -5
- package/dist/NumberField.d.ts +66 -0
- package/dist/NumberField.js +68 -0
- package/dist/OutlineRegion.d.ts +41 -10
- package/dist/OutlineRegion.js +31 -6
- package/dist/PageFade.d.ts +9 -5
- package/dist/PageFade.js +39 -8
- package/dist/PageLayouts.d.ts +15 -5
- package/dist/PageLayouts.js +3 -3
- package/dist/Pill.d.ts +9 -4
- package/dist/Pill.js +15 -6
- package/dist/Popover.d.ts +31 -0
- package/dist/Popover.js +43 -0
- package/dist/Price.d.ts +21 -0
- package/dist/Price.js +34 -0
- package/dist/ProductTile.d.ts +36 -0
- package/dist/ProductTile.js +31 -0
- package/dist/ProgressBar.js +4 -2
- package/dist/PromoBanner.d.ts +25 -0
- package/dist/PromoBanner.js +16 -0
- package/dist/RadioGroup.d.ts +18 -8
- package/dist/RadioGroup.js +42 -18
- package/dist/ScrollStrip.d.ts +1 -1
- package/dist/ScrollStrip.js +1 -1
- package/dist/SearchInput.d.ts +17 -2
- package/dist/SearchInput.js +72 -13
- package/dist/SegmentedField.d.ts +15 -0
- package/dist/SegmentedField.js +15 -0
- package/dist/Select.js +5 -4
- package/dist/Show.d.ts +1 -1
- package/dist/Show.js +1 -1
- package/dist/SideColumn.d.ts +42 -15
- package/dist/SideColumn.js +45 -19
- package/dist/SiteFooter.d.ts +3 -3
- package/dist/SiteFooter.js +4 -3
- package/dist/SiteSearch.d.ts +57 -27
- package/dist/SiteSearch.js +13 -93
- package/dist/Slider.d.ts +27 -0
- package/dist/Slider.js +58 -0
- package/dist/SortableList.d.ts +19 -35
- package/dist/SortableList.js +36 -88
- package/dist/Stack.d.ts +4 -4
- package/dist/StackedBar.d.ts +13 -4
- package/dist/StackedBar.js +12 -7
- package/dist/StateMachine.d.ts +65 -0
- package/dist/StateMachine.js +116 -0
- package/dist/StatusPages.d.ts +28 -10
- package/dist/StatusPages.js +10 -10
- package/dist/Stepper.d.ts +21 -0
- package/dist/Stepper.js +33 -0
- package/dist/Steps.js +4 -3
- package/dist/Switch.d.ts +3 -3
- package/dist/Switch.js +18 -14
- package/dist/Table.d.ts +32 -9
- package/dist/Table.js +50 -20
- package/dist/TableCells.d.ts +24 -21
- package/dist/TableCells.js +68 -27
- package/dist/TableEditCell.d.ts +1 -1
- package/dist/TableOfContents.d.ts +34 -0
- package/dist/TableOfContents.js +23 -0
- package/dist/Tabs.d.ts +31 -16
- package/dist/Tabs.js +97 -22
- package/dist/TextLink.d.ts +18 -5
- package/dist/TextLink.js +19 -6
- package/dist/Textarea.d.ts +12 -1
- package/dist/Textarea.js +15 -2
- package/dist/ToastRegion.d.ts +17 -9
- package/dist/ToastRegion.js +70 -13
- package/dist/Tooltip.d.ts +10 -2
- package/dist/Tooltip.js +32 -11
- package/dist/Video.d.ts +19 -4
- package/dist/Video.js +15 -5
- package/dist/cardContext.d.ts +7 -0
- package/dist/cardContext.js +14 -0
- package/dist/cardControl.d.ts +15 -0
- package/dist/cardControl.js +32 -0
- package/dist/cardForm.d.ts +39 -0
- package/dist/cardForm.js +81 -0
- package/dist/cardWait.js +2 -1
- package/dist/colourScheme.d.ts +12 -2
- package/dist/colourScheme.js +32 -6
- package/dist/control.d.ts +30 -8
- package/dist/control.js +74 -7
- package/dist/copyScript.d.ts +7 -8
- package/dist/copyScript.js +8 -9
- package/dist/core/button.d.ts +33 -0
- package/dist/core/button.js +89 -0
- package/dist/core/control.d.ts +15 -0
- package/dist/core/control.js +14 -0
- package/dist/core/fixtures/button.d.ts +26 -0
- package/dist/core/fixtures/button.js +52 -0
- package/dist/core/fixtures/types.d.ts +13 -0
- package/dist/core/fixtures/types.js +10 -0
- package/dist/core/focus.d.ts +7 -0
- package/dist/core/focus.js +7 -0
- package/dist/core/index.d.ts +12 -0
- package/dist/core/index.js +12 -0
- package/dist/core/parity.d.ts +22 -0
- package/dist/core/parity.js +53 -0
- package/dist/core/themeNative.d.ts +62 -0
- package/dist/core/themeNative.js +290 -0
- package/dist/cx.d.ts +17 -5
- package/dist/cx.js +18 -5
- package/dist/dateLocale.d.ts +17 -0
- package/dist/dateLocale.js +30 -0
- package/dist/density.d.ts +17 -3
- package/dist/density.js +30 -19
- package/dist/emptySlot.d.ts +1 -0
- package/dist/fieldAnnounce.d.ts +11 -0
- package/dist/fieldAnnounce.js +36 -0
- package/dist/fieldControl.d.ts +7 -2
- package/dist/fieldControl.js +6 -2
- package/dist/fieldWait.d.ts +3 -3
- package/dist/fieldWait.js +3 -4
- package/dist/flowLayout.d.ts +68 -0
- package/dist/flowLayout.js +105 -0
- package/dist/focus.d.ts +2 -0
- package/dist/focus.js +9 -0
- package/dist/fromXState.d.ts +73 -0
- package/dist/fromXState.js +110 -0
- package/dist/icons.d.ts +1 -1
- package/dist/icons.js +15 -0
- package/dist/index.d.ts +37 -11
- package/dist/index.js +24 -2
- package/dist/isoDate.d.ts +8 -1
- package/dist/isoDate.js +20 -1
- package/dist/labelWords.d.ts +16 -7
- package/dist/labelWords.js +14 -12
- package/dist/listRowProps.d.ts +17 -15
- package/dist/modal.d.ts +5 -0
- package/dist/modal.js +21 -1
- package/dist/navFold.js +6 -3
- package/dist/optionCard.d.ts +18 -0
- package/dist/optionCard.js +16 -0
- package/dist/scrollBody.d.ts +16 -0
- package/dist/scrollBody.js +15 -0
- package/dist/scrollEdges.d.ts +7 -0
- package/dist/scrollEdges.js +39 -5
- package/dist/scrollStop.d.ts +6 -2
- package/dist/scrollStop.js +24 -8
- package/dist/shownDate.d.ts +28 -10
- package/dist/shownDate.js +41 -22
- package/dist/siteSearchBody.d.ts +34 -0
- package/dist/siteSearchBody.js +117 -0
- package/dist/size.d.ts +7 -1
- package/dist/sortableDrop.d.ts +44 -0
- package/dist/sortableDrop.js +78 -0
- package/dist/sortableSlide.d.ts +9 -0
- package/dist/sortableSlide.js +70 -0
- package/dist/sortableTitle.d.ts +10 -0
- package/dist/sortableTitle.js +48 -0
- package/dist/stateMachineDots.d.ts +77 -0
- package/dist/stateMachineDots.js +188 -0
- package/dist/stickyColumn.d.ts +2 -2
- package/dist/stickyColumn.js +2 -2
- package/dist/switcher.d.ts +10 -5
- package/dist/switcher.js +7 -5
- package/dist/tableColumns.d.ts +17 -0
- package/dist/tableColumns.js +30 -2
- package/dist/tableEmpty.js +5 -5
- package/dist/tableRow.d.ts +26 -2
- package/dist/tableRow.js +23 -1
- package/dist/tableSort.d.ts +10 -5
- package/dist/tableSort.js +15 -4
- package/dist/target.d.ts +12 -0
- package/dist/target.js +12 -0
- package/dist/textBox.js +1 -1
- package/dist/truncated.d.ts +31 -0
- package/dist/truncated.js +51 -0
- package/dist/typography.d.ts +19 -11
- package/dist/typography.js +11 -13
- package/dist/useFlowLayout.d.ts +38 -0
- package/dist/useFlowLayout.js +122 -0
- package/package.json +5 -3
package/dist/fieldWait.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cx } from "./cx.js";
|
|
3
|
-
import {
|
|
3
|
+
import { controlHeight } from "./control.js";
|
|
4
|
+
import { useResponsiveDensity } from "./density.js";
|
|
4
5
|
import { Bone, BusyLabel, busy, passthroughOf, useLoading } from "./skeleton.js";
|
|
5
6
|
/* The bones of a form part waiting for its value: the label is drawn, the control is a bone. */
|
|
6
|
-
/** A text control's height by `size`: its padding, line height and border, as `controlClass` draws it. */
|
|
7
|
-
const CONTROL_HEIGHT = { sm: "h-6.5", md: "h-9.5", lg: "h-11.5" };
|
|
8
7
|
/** A bone the height of a text control at `size`, else the density around it (a `sm` table or card). */
|
|
9
8
|
export function ControlBone({ size }) {
|
|
10
|
-
return _jsx(Bone, { shape: cx("block w-full rounded-lg",
|
|
9
|
+
return _jsx(Bone, { shape: cx("block w-full rounded-lg", controlHeight(useResponsiveDensity(size))) });
|
|
11
10
|
}
|
|
12
11
|
/**
|
|
13
12
|
* A choice (a checkbox, a switch, a radio) waiting for its value: the mark a bone of its shape, the
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/** A point in the diagram's own space, in CSS pixels from its top left corner. */
|
|
2
|
+
export type FlowPoint = {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
};
|
|
6
|
+
/** Where a node or a group sits, its top left corner and its size, in CSS pixels. */
|
|
7
|
+
export type FlowBox = {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* A node as laid out: its `id` and its box. A group's box (`group`) is the frame round its nodes.
|
|
15
|
+
*/
|
|
16
|
+
export type FlowNodeBox = FlowBox & {
|
|
17
|
+
id: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* An arrow as laid out: the `from` and `to` ids, its place in `edges` (`index`), the points dagre
|
|
21
|
+
* routed it through, the SVG path drawn through them (it ends on the target's edge, at the
|
|
22
|
+
* arrowhead's tip) and its label's centre when it has one.
|
|
23
|
+
*/
|
|
24
|
+
export type FlowEdgePath = {
|
|
25
|
+
from: string;
|
|
26
|
+
to: string;
|
|
27
|
+
index: number;
|
|
28
|
+
points: readonly FlowPoint[];
|
|
29
|
+
path: string;
|
|
30
|
+
labelAt: FlowPoint | null;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The whole diagram as laid out, in one coordinate space: `width` and `height`, a box per node and
|
|
34
|
+
* per group, and a path per arrow. `FlowDiagram` hands it to `overlay`.
|
|
35
|
+
*/
|
|
36
|
+
export type FlowLayout = {
|
|
37
|
+
width: number;
|
|
38
|
+
height: number;
|
|
39
|
+
nodes: readonly FlowNodeBox[];
|
|
40
|
+
groups: readonly (FlowBox & {
|
|
41
|
+
name: string;
|
|
42
|
+
})[];
|
|
43
|
+
edges: readonly FlowEdgePath[];
|
|
44
|
+
};
|
|
45
|
+
/** What the layout needs from a node: its id, its size and the group it sits in. */
|
|
46
|
+
export type LayoutNode = {
|
|
47
|
+
id: string;
|
|
48
|
+
width: number;
|
|
49
|
+
height: number;
|
|
50
|
+
group?: string | undefined;
|
|
51
|
+
};
|
|
52
|
+
/** What the layout needs from an arrow: its ends, and its label's size when it has one. */
|
|
53
|
+
export type LayoutEdge = {
|
|
54
|
+
from: string;
|
|
55
|
+
to: string;
|
|
56
|
+
label?: {
|
|
57
|
+
width: number;
|
|
58
|
+
height: number;
|
|
59
|
+
} | undefined;
|
|
60
|
+
};
|
|
61
|
+
/** `down` reads from the top, `right` from the start edge. */
|
|
62
|
+
export type FlowDirection = "down" | "right";
|
|
63
|
+
/**
|
|
64
|
+
* Lays the nodes and arrows out with dagre. An arrow whose end is not a node is left out, so a
|
|
65
|
+
* typo draws no stray box. Pure: the same input gives the same layout.
|
|
66
|
+
*/
|
|
67
|
+
export declare function layoutFlow(nodes: readonly LayoutNode[], edges: readonly LayoutEdge[], direction: FlowDirection): FlowLayout;
|
|
68
|
+
export declare function stepPath(points: readonly FlowPoint[], direction: FlowDirection, lane?: number): string;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The layout behind `FlowDiagram`: dagre places the boxes and routes the arrows, then this file
|
|
3
|
+
* turns its output into what the component draws. Internal: only the geometry types are exported
|
|
4
|
+
* from the package, for `FlowDiagram`'s `overlay`.
|
|
5
|
+
*/
|
|
6
|
+
import { Graph, layout } from "@dagrejs/dagre";
|
|
7
|
+
/** Space round the drawing, between boxes in a rank, and between ranks. */
|
|
8
|
+
const MARGIN = 16;
|
|
9
|
+
const NODE_GAP = 32;
|
|
10
|
+
const RANK_GAP = 48;
|
|
11
|
+
const EDGE_GAP = 16;
|
|
12
|
+
/** A group's dagre id, kept apart from every node id. */
|
|
13
|
+
const groupKey = (name) => `\u0000group:${name}`;
|
|
14
|
+
const round = (n) => Math.round(n * 10) / 10;
|
|
15
|
+
/**
|
|
16
|
+
* Lays the nodes and arrows out with dagre. An arrow whose end is not a node is left out, so a
|
|
17
|
+
* typo draws no stray box. Pure: the same input gives the same layout.
|
|
18
|
+
*/
|
|
19
|
+
export function layoutFlow(nodes, edges, direction) {
|
|
20
|
+
const groups = [...new Set(nodes.flatMap((n) => (n.group ? [n.group] : [])))];
|
|
21
|
+
const g = new Graph({
|
|
22
|
+
multigraph: true,
|
|
23
|
+
compound: groups.length > 0,
|
|
24
|
+
});
|
|
25
|
+
g.setGraph({
|
|
26
|
+
rankdir: direction === "right" ? "LR" : "TB",
|
|
27
|
+
nodesep: NODE_GAP,
|
|
28
|
+
ranksep: RANK_GAP,
|
|
29
|
+
edgesep: EDGE_GAP,
|
|
30
|
+
marginx: MARGIN,
|
|
31
|
+
marginy: MARGIN,
|
|
32
|
+
});
|
|
33
|
+
g.setDefaultEdgeLabel(() => ({}));
|
|
34
|
+
for (const name of groups)
|
|
35
|
+
g.setNode(groupKey(name), {});
|
|
36
|
+
const ids = new Set();
|
|
37
|
+
for (const n of nodes) {
|
|
38
|
+
ids.add(n.id);
|
|
39
|
+
g.setNode(n.id, { width: n.width, height: n.height });
|
|
40
|
+
if (n.group)
|
|
41
|
+
g.setParent(n.id, groupKey(n.group));
|
|
42
|
+
}
|
|
43
|
+
const kept = edges.flatMap((e, index) => ids.has(e.from) && ids.has(e.to) ? [{ e, index }] : []);
|
|
44
|
+
for (const { e, index } of kept) {
|
|
45
|
+
g.setEdge(e.from, e.to, e.label ? { width: e.label.width, height: e.label.height, labelpos: "c" } : {}, String(index));
|
|
46
|
+
}
|
|
47
|
+
layout(g);
|
|
48
|
+
const box = (key) => {
|
|
49
|
+
const { x = 0, y = 0, width = 0, height = 0 } = g.node(key);
|
|
50
|
+
return {
|
|
51
|
+
x: round(x - width / 2),
|
|
52
|
+
y: round(y - height / 2),
|
|
53
|
+
width: round(width),
|
|
54
|
+
height: round(height),
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
const graph = g.graph();
|
|
58
|
+
return {
|
|
59
|
+
width: Math.ceil(graph.width ?? 0),
|
|
60
|
+
height: Math.ceil(graph.height ?? 0),
|
|
61
|
+
nodes: [...ids].map((id) => ({ id, ...box(id) })),
|
|
62
|
+
groups: groups.map((name) => ({ name, ...box(groupKey(name)) })),
|
|
63
|
+
edges: kept.map(({ e, index }) => {
|
|
64
|
+
const routed = g.edge(e.from, e.to, String(index));
|
|
65
|
+
const points = (routed.points ?? []).map((p) => ({ x: round(p.x), y: round(p.y) }));
|
|
66
|
+
return {
|
|
67
|
+
from: e.from,
|
|
68
|
+
to: e.to,
|
|
69
|
+
index,
|
|
70
|
+
points,
|
|
71
|
+
path: stepPath(points, direction, LANES[index % LANES.length]),
|
|
72
|
+
labelAt: e.label && routed.x !== undefined && routed.y !== undefined
|
|
73
|
+
? { x: round(routed.x), y: round(routed.y) }
|
|
74
|
+
: null,
|
|
75
|
+
};
|
|
76
|
+
}),
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* A square path through dagre's route points: each step leaves along the rank `direction`, turns
|
|
81
|
+
* once at `lane` of the way across (0.5 is halfway), and arrives along it again, so every arrow is
|
|
82
|
+
* made of straight runs at right angles and ends exactly on the last point, where its arrowhead
|
|
83
|
+
* sits. Arrows between the same two ranks take different lanes, so their cross runs do not overlap.
|
|
84
|
+
*/
|
|
85
|
+
/** Where each arrow turns between two ranks, by its index: spread so parallel runs stay apart. */
|
|
86
|
+
const LANES = [0.5, 0.3, 0.7, 0.4, 0.6];
|
|
87
|
+
export function stepPath(points, direction, lane = 0.5) {
|
|
88
|
+
const [first, ...rest] = points;
|
|
89
|
+
if (!first)
|
|
90
|
+
return "";
|
|
91
|
+
let d = `M${first.x},${first.y}`;
|
|
92
|
+
let from = first;
|
|
93
|
+
for (const to of rest) {
|
|
94
|
+
if (direction === "right") {
|
|
95
|
+
const mid = round(from.x + (to.x - from.x) * lane);
|
|
96
|
+
d += `H${mid}V${to.y}H${to.x}`;
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
const mid = round(from.y + (to.y - from.y) * lane);
|
|
100
|
+
d += `V${mid}H${to.x}V${to.y}`;
|
|
101
|
+
}
|
|
102
|
+
from = to;
|
|
103
|
+
}
|
|
104
|
+
return d;
|
|
105
|
+
}
|
package/dist/focus.d.ts
ADDED
package/dist/focus.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The keyboard focus ring every interactive control shares, and the same ring drawn inside the
|
|
3
|
+
* control, for one that fills a box which clips anything outside it (a table's sortable title, a
|
|
4
|
+
* scroller). `focusRing` with `-outline-offset-2` added would not do, since `outline-offset-2` comes
|
|
5
|
+
* later in the CSS and wins. Both are core's, so the native controls draw the same ring.
|
|
6
|
+
*/
|
|
7
|
+
import { FOCUS_RING, FOCUS_RING_INSET } from "./core/index.js";
|
|
8
|
+
export const focusRing = FOCUS_RING;
|
|
9
|
+
export const insetFocusRing = FOCUS_RING_INSET;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { StateMachineDefinition, StateMachineState } from "./StateMachine.js";
|
|
2
|
+
/** One transition: a target, or `{ target, meta }`, or a list of them (the first that passes its guard). */
|
|
3
|
+
export type XStateTransitionConfig = string | undefined | {
|
|
4
|
+
target?: string | readonly (string | undefined)[] | undefined;
|
|
5
|
+
meta?: Record<string, unknown> | undefined;
|
|
6
|
+
};
|
|
7
|
+
type XStateTransitions = XStateTransitionConfig | readonly XStateTransitionConfig[];
|
|
8
|
+
/** One `invoke`: where it goes when the invoked actor is done, and when it fails. */
|
|
9
|
+
export type XStateInvokeConfig = {
|
|
10
|
+
onDone?: XStateTransitions;
|
|
11
|
+
onError?: XStateTransitions;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The part of an xstate v5 state node `fromXState` reads: its `id`, `type` and `meta`, and the
|
|
15
|
+
* ways it moves on (`on`, `always`, `after`, and each `invoke`'s `onDone` and `onError`). Typed by
|
|
16
|
+
* shape, so the package does not depend on xstate.
|
|
17
|
+
*/
|
|
18
|
+
export type XStateNodeConfig = {
|
|
19
|
+
id?: string | undefined;
|
|
20
|
+
type?: string | undefined;
|
|
21
|
+
meta?: Record<string, unknown> | undefined;
|
|
22
|
+
on?: Record<string, XStateTransitions> | undefined;
|
|
23
|
+
always?: XStateTransitions;
|
|
24
|
+
after?: Record<string, XStateTransitions> | undefined;
|
|
25
|
+
invoke?: XStateInvokeConfig | readonly XStateInvokeConfig[] | undefined;
|
|
26
|
+
/** Its child states: only their `id`s are read, so a target `#id` lands on this state. */
|
|
27
|
+
states?: Record<string, XStateNodeConfig> | undefined;
|
|
28
|
+
};
|
|
29
|
+
/** Where a machine starts: a state's key, or `{ target }`. */
|
|
30
|
+
export type XStateInitial = string | {
|
|
31
|
+
target: string;
|
|
32
|
+
} | undefined;
|
|
33
|
+
/** A machine's config, or what `setup(…).createMachine(config)` returns (it keeps it as `config`). */
|
|
34
|
+
export type XStateMachineLike = {
|
|
35
|
+
id?: string | undefined;
|
|
36
|
+
initial?: XStateInitial;
|
|
37
|
+
states?: Record<string, XStateNodeConfig> | undefined;
|
|
38
|
+
} | {
|
|
39
|
+
config: {
|
|
40
|
+
id?: string | undefined;
|
|
41
|
+
initial?: XStateInitial;
|
|
42
|
+
states?: Record<string, XStateNodeConfig> | undefined;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
/** What `fromXState` makes of one state node before `state` adjusts it. */
|
|
46
|
+
export type XStateStateInput = {
|
|
47
|
+
id: string;
|
|
48
|
+
/** The node's own config: its `type`, `meta` and `on`. */
|
|
49
|
+
node: XStateNodeConfig;
|
|
50
|
+
/** The state as read by the default rules. */
|
|
51
|
+
state: StateMachineState;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Turns an xstate v5 machine (the machine, or its config) into a `StateMachine` definition: one
|
|
55
|
+
* state per top-level state node, one transition per target in each node's `on`.
|
|
56
|
+
*
|
|
57
|
+
* - A state's `label` is its `meta.label`, else its key; its `owner` is `meta.owner`; its `kind`
|
|
58
|
+
* is `meta.kind` when that is one of the five, else `terminal` for a `type: "final"` node,
|
|
59
|
+
* `initial` for the machine's `initial`, and `normal` for the rest.
|
|
60
|
+
* - Each `on` event, `always`, each `after` delay and each `invoke`'s `onDone` and `onError` is a
|
|
61
|
+
* transition. Its `event` is its `meta.label`, else the event's name (`always`, `after 500`,
|
|
62
|
+
* `done`, `error`). A transition with no target
|
|
63
|
+
* (it stays where it is), one that stays inside its own state, or one whose target is not a
|
|
64
|
+
* top-level state is left out.
|
|
65
|
+
* - `state` adjusts each state, for a machine whose meta says it another way: return the state to
|
|
66
|
+
* draw, given its key, its config and the state the rules above made of it.
|
|
67
|
+
*
|
|
68
|
+
* Only the top level is read: a nested state is drawn as its parent.
|
|
69
|
+
*/
|
|
70
|
+
export declare function fromXState(machine: XStateMachineLike, options?: {
|
|
71
|
+
state?: ((input: XStateStateInput) => StateMachineState) | undefined;
|
|
72
|
+
}): StateMachineDefinition;
|
|
73
|
+
export {};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
const text = (value) => typeof value === "string" && value !== "" ? value : undefined;
|
|
2
|
+
const KINDS = ["initial", "normal", "human", "terminal", "failed"];
|
|
3
|
+
const isKind = (value) => KINDS.some((kind) => kind === value);
|
|
4
|
+
const listOf = (value) => {
|
|
5
|
+
if (value === undefined)
|
|
6
|
+
return [];
|
|
7
|
+
return isList(value) ? value : [value];
|
|
8
|
+
};
|
|
9
|
+
function isList(value) {
|
|
10
|
+
return Array.isArray(value);
|
|
11
|
+
}
|
|
12
|
+
/** Every way a node moves on, each with the event name it is drawn with. */
|
|
13
|
+
function movesOf(node) {
|
|
14
|
+
const after = Object.entries(node.after ?? {}).map(([ms, t]) => [`after ${ms}`, t]);
|
|
15
|
+
const invoked = listOf(node.invoke).flatMap((i) => [
|
|
16
|
+
["done", i.onDone],
|
|
17
|
+
["error", i.onError],
|
|
18
|
+
]);
|
|
19
|
+
return [...Object.entries(node.on ?? {}), ["always", node.always], ...after, ...invoked];
|
|
20
|
+
}
|
|
21
|
+
/** A node's kind: its `meta.kind`, else what its `type` and the machine's `initial` say. */
|
|
22
|
+
function kindOf(id, node, initial) {
|
|
23
|
+
const meta = node.meta?.["kind"];
|
|
24
|
+
if (isKind(meta))
|
|
25
|
+
return meta;
|
|
26
|
+
if (node.type === "final")
|
|
27
|
+
return "terminal";
|
|
28
|
+
const start = typeof initial === "object" ? initial.target : initial;
|
|
29
|
+
return id === start ? "initial" : "normal";
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The top-level state a target names: `#machine.review`, `review.waiting` and `#rev` (the `id` of
|
|
33
|
+
* `review` or of a state inside it) are all `review`, and `.waiting` (a child of the state it
|
|
34
|
+
* leaves) is that state. Only the machine's top level is drawn, so a nested target lands on its
|
|
35
|
+
* parent.
|
|
36
|
+
*/
|
|
37
|
+
function targetState(target, from, ids) {
|
|
38
|
+
if (target.startsWith("."))
|
|
39
|
+
return from;
|
|
40
|
+
if (!target.startsWith("#"))
|
|
41
|
+
return target.split(".")[0] ?? target;
|
|
42
|
+
const [id = "", next] = target.slice(1).split(".");
|
|
43
|
+
if (id === ids.machine)
|
|
44
|
+
return next ?? "";
|
|
45
|
+
return ids.nodes.get(id) ?? id;
|
|
46
|
+
}
|
|
47
|
+
/** Each node `id` in `node` and below it, mapped to `top`, the top-level state it is in. */
|
|
48
|
+
function nodeIds(top, node, into) {
|
|
49
|
+
if (node.id !== undefined)
|
|
50
|
+
into.set(node.id, top);
|
|
51
|
+
for (const child of Object.values(node.states ?? {}))
|
|
52
|
+
nodeIds(top, child, into);
|
|
53
|
+
}
|
|
54
|
+
function targets(config) {
|
|
55
|
+
if (config === undefined)
|
|
56
|
+
return { to: [], meta: undefined };
|
|
57
|
+
if (typeof config === "string")
|
|
58
|
+
return { to: [config], meta: undefined };
|
|
59
|
+
const target = config.target ?? [];
|
|
60
|
+
const to = typeof target === "string" ? [target] : target.filter((t) => t !== undefined);
|
|
61
|
+
return { to, meta: config.meta };
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Turns an xstate v5 machine (the machine, or its config) into a `StateMachine` definition: one
|
|
65
|
+
* state per top-level state node, one transition per target in each node's `on`.
|
|
66
|
+
*
|
|
67
|
+
* - A state's `label` is its `meta.label`, else its key; its `owner` is `meta.owner`; its `kind`
|
|
68
|
+
* is `meta.kind` when that is one of the five, else `terminal` for a `type: "final"` node,
|
|
69
|
+
* `initial` for the machine's `initial`, and `normal` for the rest.
|
|
70
|
+
* - Each `on` event, `always`, each `after` delay and each `invoke`'s `onDone` and `onError` is a
|
|
71
|
+
* transition. Its `event` is its `meta.label`, else the event's name (`always`, `after 500`,
|
|
72
|
+
* `done`, `error`). A transition with no target
|
|
73
|
+
* (it stays where it is), one that stays inside its own state, or one whose target is not a
|
|
74
|
+
* top-level state is left out.
|
|
75
|
+
* - `state` adjusts each state, for a machine whose meta says it another way: return the state to
|
|
76
|
+
* draw, given its key, its config and the state the rules above made of it.
|
|
77
|
+
*
|
|
78
|
+
* Only the top level is read: a nested state is drawn as its parent.
|
|
79
|
+
*/
|
|
80
|
+
export function fromXState(machine, options = {}) {
|
|
81
|
+
const config = "config" in machine ? machine.config : machine;
|
|
82
|
+
const nodes = Object.entries(config.states ?? {});
|
|
83
|
+
const keys = new Set(nodes.map(([id]) => id));
|
|
84
|
+
const found = new Map();
|
|
85
|
+
for (const [id, node] of nodes)
|
|
86
|
+
nodeIds(id, node, found);
|
|
87
|
+
// xstate names a machine with no `id` "(machine)".
|
|
88
|
+
const ids = { machine: config.id ?? "(machine)", nodes: found };
|
|
89
|
+
const states = nodes.map(([id, node]) => {
|
|
90
|
+
const meta = node.meta ?? {};
|
|
91
|
+
const kind = kindOf(id, node, config.initial);
|
|
92
|
+
const owner = text(meta["owner"]);
|
|
93
|
+
const state = {
|
|
94
|
+
id,
|
|
95
|
+
label: text(meta["label"]) ?? id,
|
|
96
|
+
kind,
|
|
97
|
+
...(owner === undefined ? {} : { owner }),
|
|
98
|
+
};
|
|
99
|
+
return options.state ? options.state({ id, node, state }) : state;
|
|
100
|
+
});
|
|
101
|
+
const transitions = nodes.flatMap(([from, node]) => movesOf(node).flatMap(([event, on]) => listOf(on).flatMap((one) => {
|
|
102
|
+
const { to, meta } = targets(one);
|
|
103
|
+
const name = text(meta?.["label"]) ?? event;
|
|
104
|
+
return to
|
|
105
|
+
.map((t) => targetState(t, from, ids))
|
|
106
|
+
.filter((t) => t !== from && keys.has(t))
|
|
107
|
+
.map((t) => ({ from, to: t, event: name }));
|
|
108
|
+
})));
|
|
109
|
+
return { states, transitions };
|
|
110
|
+
}
|
package/dist/icons.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { ReactElement } from "react";
|
|
|
6
6
|
* icon's own shapes carry no `fill`, `stroke` or `stroke-width` (`Icon.test.tsx` holds them to
|
|
7
7
|
* that). A name is the idea or action the icon stands for, not a product.
|
|
8
8
|
*/
|
|
9
|
-
declare const NAMES: readonly ["diff", "baseline", "review", "ci", "self-host", "privacy", "capture", "branch", "theme", "speed", "search", "chevron-right", "chevron-down", "close", "external-link", "settings", "bell", "check", "plus", "more", "grid", "window", "type", "card", "pointer", "field", "table", "compass", "page", "briefcase"];
|
|
9
|
+
declare const NAMES: readonly ["diff", "baseline", "review", "ci", "self-host", "privacy", "capture", "branch", "theme", "speed", "search", "chevron-right", "chevron-down", "close", "external-link", "settings", "bell", "check", "alert", "plus", "minus", "more", "grid", "window", "type", "card", "pointer", "field", "table", "compass", "page", "briefcase", "cart", "pause", "play"];
|
|
10
10
|
/** The names of the icon set: feature ideas, then UI glyphs, then the ideas the docs sections stand for. */
|
|
11
11
|
export type IconName = (typeof NAMES)[number];
|
|
12
12
|
/** The icon `name` as an `<svg>`: the set's one grid, stroke, caps and joins, drawn in `currentColor`. */
|
package/dist/icons.js
CHANGED
|
@@ -25,7 +25,9 @@ const NAMES = [
|
|
|
25
25
|
"settings",
|
|
26
26
|
"bell",
|
|
27
27
|
"check",
|
|
28
|
+
"alert",
|
|
28
29
|
"plus",
|
|
30
|
+
"minus",
|
|
29
31
|
"more",
|
|
30
32
|
"grid",
|
|
31
33
|
"window",
|
|
@@ -37,6 +39,9 @@ const NAMES = [
|
|
|
37
39
|
"compass",
|
|
38
40
|
"page",
|
|
39
41
|
"briefcase",
|
|
42
|
+
"cart",
|
|
43
|
+
"pause",
|
|
44
|
+
"play",
|
|
40
45
|
];
|
|
41
46
|
const GLYPHS = {
|
|
42
47
|
/** Before and after, side by side: a minus on the left, a plus on the right. */
|
|
@@ -75,8 +80,12 @@ const GLYPHS = {
|
|
|
75
80
|
bell: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M6 9.5a6 6 0 0 1 12 0c0 5 2 6.5 2 6.5H4s2-1.5 2-6.5Z" }), _jsx("path", { d: "M10 19.5a2.2 2.2 0 0 0 4 0" })] })),
|
|
76
81
|
/** Done or selected: a single tick. */
|
|
77
82
|
check: _jsx("path", { d: "m4.5 12.5 5 5L19.5 7" }),
|
|
83
|
+
/** Something is wrong: an exclamation mark in a ring. */
|
|
84
|
+
alert: (_jsxs(_Fragment, { children: [_jsx("circle", { cx: "12", cy: "12", r: "9" }), _jsx("path", { d: "M12 7.5v5.5M12 16.5v.01" })] })),
|
|
78
85
|
/** Add or create: two strokes crossing, upright. */
|
|
79
86
|
plus: _jsx("path", { d: "M12 5v14M5 12h14" }),
|
|
87
|
+
/** Less: one bar, the plus without its upright (a stepper's decrement). */
|
|
88
|
+
minus: _jsx("path", { d: "M5 12h14" }),
|
|
80
89
|
/** More actions behind a menu: three dots in a row. */
|
|
81
90
|
more: (_jsxs(_Fragment, { children: [_jsx("circle", { cx: "5.5", cy: "12", r: "1" }), _jsx("circle", { cx: "12", cy: "12", r: "1" }), _jsx("circle", { cx: "18.5", cy: "12", r: "1" })] })),
|
|
82
91
|
/** Things laid out in a grid: four tiles. */
|
|
@@ -99,6 +108,12 @@ const GLYPHS = {
|
|
|
99
108
|
page: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M7.5 3H14l5 5v10.5a2.5 2.5 0 0 1-2.5 2.5h-9A2.5 2.5 0 0 1 5 18.5v-13A2.5 2.5 0 0 1 7.5 3Z" }), _jsx("path", { d: "M14 3v3.5A1.5 1.5 0 0 0 15.5 8H19M9 13h6M9 16.5h6" })] })),
|
|
100
109
|
/** Work for hire: a briefcase with its handle and clasp. */
|
|
101
110
|
briefcase: (_jsxs(_Fragment, { children: [_jsx("rect", { x: "3", y: "7.5", width: "18", height: "12", rx: "2.5" }), _jsx("path", { d: "M8.5 7.5V6a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v1.5M3 13h18M12 12v2.5" })] })),
|
|
111
|
+
/** A shopping bag: what a visitor has picked to buy (the cart). */
|
|
112
|
+
cart: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M5.5 8h13l-1 11.5a1.5 1.5 0 0 1-1.5 1.5H8a1.5 1.5 0 0 1-1.5-1.5Z" }), _jsx("path", { d: "M9 10.5V7a3 3 0 0 1 6 0v3.5" })] })),
|
|
113
|
+
/** Stop a moving thing for now: two upright bars. */
|
|
114
|
+
pause: _jsx("path", { d: "M9 6v12M15 6v12" }),
|
|
115
|
+
/** Start a moving thing: a triangle pointing forward. */
|
|
116
|
+
play: _jsx("path", { d: "M8 5.5v13l10-6.5Z" }),
|
|
102
117
|
};
|
|
103
118
|
/** The icon `name` as an `<svg>`: the set's one grid, stroke, caps and joins, drawn in `currentColor`. */
|
|
104
119
|
export function iconGlyph(name) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
export { Card } from "./Card.js";
|
|
1
|
+
export { Card, type CardHue } from "./Card.js";
|
|
2
|
+
export { CardGridRow } from "./CardGrid.js";
|
|
2
3
|
export { Pill, type PillTone } from "./Pill.js";
|
|
3
4
|
export { Badge } from "./Badge.js";
|
|
4
5
|
export { StatTile, type StatTileTone } from "./StatTile.js";
|
|
5
6
|
export { ProgressBar, type BarSize, type BarTone } from "./ProgressBar.js";
|
|
6
7
|
export { SplitBar } from "./SplitBar.js";
|
|
7
|
-
export { Legend, StackedBar, type LegendItem, type StackedSegment, type VizTone, } from "./StackedBar.js";
|
|
8
|
+
export { Legend, StackedBar, type LegendItem, type SegmentTone, type StackedSegment, type VizTone, type CategoryTone, } from "./StackedBar.js";
|
|
8
9
|
export { TrendChart, type TrendSeries } from "./TrendChart.js";
|
|
10
|
+
export { FlowDiagram, type FlowEdge, type FlowNode } from "./FlowDiagram.js";
|
|
11
|
+
export type { FlowBox, FlowDirection, FlowEdgePath, FlowLayout, FlowNodeBox, FlowPoint, } from "./flowLayout.js";
|
|
12
|
+
export { StateMachine, type StateMachineDefinition, type StateMachineItem, type StateMachineKind, type StateMachineState, type StateMachineTransition, } from "./StateMachine.js";
|
|
13
|
+
export { fromXState, type XStateMachineLike, type XStateNodeConfig, type XStateStateInput, type XStateTransitionConfig, } from "./fromXState.js";
|
|
9
14
|
export { Markdown } from "./Markdown.js";
|
|
10
15
|
export { AppShell, AppShellBrand, type AppShellDensity, appShellRootClassFor } from "./AppShell.js";
|
|
11
16
|
export { SiteFooter, type SiteFooterLink } from "./SiteFooter.js";
|
|
@@ -13,13 +18,15 @@ export { Container } from "./Container.js";
|
|
|
13
18
|
export { PageHeader } from "./PageHeader.js";
|
|
14
19
|
export { Hero } from "./Hero.js";
|
|
15
20
|
export { CardGrid, CenteredLayout, DetailLayout, FormLayout, FullBleedLayout, ListLayout, ProseLayout, } from "./PageLayouts.js";
|
|
21
|
+
export { ArticleLayout } from "./ArticleLayout.js";
|
|
16
22
|
export { SidebarLayout } from "./SidebarLayout.js";
|
|
17
23
|
export { DocsLayout, type DocsHeading, type DocsNavGroup, type DocsNeighbour, } from "./DocsLayout.js";
|
|
18
|
-
export { SideColumn, type SideColumnWidth } from "./SideColumn.js";
|
|
24
|
+
export { SideColumn, type SideColumnSide, type SideColumnWidth } from "./SideColumn.js";
|
|
19
25
|
export { StickyBar } from "./StickyBar.js";
|
|
20
26
|
export { ErrorPage, Forbidden, Maintenance, NotFound, Offline } from "./StatusPages.js";
|
|
21
27
|
export { Cluster, ClusterGrow, type ClusterAlign, type ClusterGrowMinWidth, type ClusterGap, type ClusterJustify, } from "./Cluster.js";
|
|
22
28
|
export { Section, type SectionSize } from "./Section.js";
|
|
29
|
+
export type { HeadingLevel } from "./headingLevel.js";
|
|
23
30
|
export { Stack, type StackAlign, type StackGap, type StackRowFrom, type StackWidth, } from "./Stack.js";
|
|
24
31
|
export { Show, type Breakpoint } from "./Show.js";
|
|
25
32
|
export { Button, type ButtonSize, type ButtonTone, type ButtonVariant } from "./Button.js";
|
|
@@ -28,18 +35,20 @@ export { type LinkAdapter, type LinkAdapterProps, LinkProvider } from "./link.js
|
|
|
28
35
|
export { Avatar, type AvatarShape, type AvatarSize } from "./Avatar.js";
|
|
29
36
|
export { AvatarStack, type AvatarStackPerson } from "./AvatarStack.js";
|
|
30
37
|
export { Breadcrumbs, type Crumb } from "./Breadcrumbs.js";
|
|
38
|
+
export { Stepper } from "./Stepper.js";
|
|
31
39
|
export { Pagination } from "./Pagination.js";
|
|
32
40
|
export { BulletItem, BulletList } from "./BulletList.js";
|
|
33
41
|
export { Callout } from "./Callout.js";
|
|
34
42
|
export { ToastRegion, type Toast } from "./ToastRegion.js";
|
|
35
43
|
export { ListRow } from "./ListRow.js";
|
|
36
44
|
export { SortableItem, SortableList, type SortableMove, SortableSection } from "./SortableList.js";
|
|
37
|
-
export { OutlineRegion, RegionFrame, type RegionRect } from "./OutlineRegion.js";
|
|
45
|
+
export { OutlineRegion, type OutlineRegionTone, RegionFrame, type RegionRect, } from "./OutlineRegion.js";
|
|
38
46
|
export { type CellTone, Table, TableBody, TableCell, TableFoot, TableGroupRow, TableHead, TableExpandCell, TableHeaderCell, TableRow, type TableSort, } from "./Table.js";
|
|
39
|
-
export type { RowTone } from "./tableRow.js";
|
|
47
|
+
export type { CellAlign, RowTone } from "./tableRow.js";
|
|
40
48
|
export { InlineEdit } from "./InlineEdit.js";
|
|
41
49
|
export { TableEditCell } from "./TableEditCell.js";
|
|
42
50
|
export { EmptyState } from "./EmptyState.js";
|
|
51
|
+
export type { EmptySize } from "./emptySlot.js";
|
|
43
52
|
export { Step, Steps, type StepsSize } from "./Steps.js";
|
|
44
53
|
export { Timeline, TimelineItem } from "./Timeline.js";
|
|
45
54
|
export { ChatComposer } from "./ChatComposer.js";
|
|
@@ -63,10 +72,12 @@ export { Icon } from "./Icon.js";
|
|
|
63
72
|
export type { IconName } from "./icons.js";
|
|
64
73
|
export { IconButton, type IconButtonTone, type IconButtonVariant } from "./IconButton.js";
|
|
65
74
|
export { Menu, type MenuAction } from "./Menu.js";
|
|
75
|
+
export { Popover } from "./Popover.js";
|
|
66
76
|
export { ColourSchemeToggle } from "./ColourSchemeToggle.js";
|
|
67
77
|
export { applyColourScheme, schemeClass, type ColourSchemeClasses, colourSchemeScript, readColourScheme, storeColourScheme, type ColourScheme, } from "./colourScheme.js";
|
|
68
|
-
export { Tabs, type Tab } from "./Tabs.js";
|
|
78
|
+
export { Tabs, type Tab, type TabButton } from "./Tabs.js";
|
|
69
79
|
export { SegmentedControl, type Segment } from "./SegmentedControl.js";
|
|
80
|
+
export type { SwitchButton, SwitchLink } from "./switcher.js";
|
|
70
81
|
export { Fieldset } from "./Fieldset.js";
|
|
71
82
|
export { Checkbox } from "./Checkbox.js";
|
|
72
83
|
export { Switch } from "./Switch.js";
|
|
@@ -78,22 +89,37 @@ export { CopyLine } from "./CopyLine.js";
|
|
|
78
89
|
export { Field } from "./Field.js";
|
|
79
90
|
export { FormGrid, FormRow, FormRowField, type FormRowSpan } from "./FormRow.js";
|
|
80
91
|
export { FieldDialog } from "./FieldDialog.js";
|
|
92
|
+
export { ConfirmDialog } from "./ConfirmDialog.js";
|
|
81
93
|
export { Input } from "./Input.js";
|
|
82
94
|
export type { ControlSize, ControlWidth } from "./control.js";
|
|
83
95
|
export type { ResponsiveSize, Size } from "./size.js";
|
|
84
96
|
export type { Tone } from "./tone.js";
|
|
85
97
|
export { MetaList, type MetaListSeparator } from "./MetaList.js";
|
|
86
98
|
export { Kbd } from "./Kbd.js";
|
|
87
|
-
export { KeyValue, KeyValueList } from "./KeyValueList.js";
|
|
88
|
-
export { Select } from "./Select.js";
|
|
99
|
+
export { KeyValue, KeyValueList, type KeyValueAlign } from "./KeyValueList.js";
|
|
100
|
+
export { Select, type SelectItem } from "./Select.js";
|
|
101
|
+
export { Combobox } from "./Combobox.js";
|
|
102
|
+
export { NumberField } from "./NumberField.js";
|
|
103
|
+
export { Slider } from "./Slider.js";
|
|
89
104
|
export { Textarea } from "./Textarea.js";
|
|
90
105
|
export { Video } from "./Video.js";
|
|
106
|
+
export { Audio } from "./Audio.js";
|
|
107
|
+
export { EmbedFrame } from "./EmbedFrame.js";
|
|
108
|
+
export { ColourSwatch } from "./ColourSwatch.js";
|
|
91
109
|
export { Image, type ImageAspect, type ImageWidth } from "./Image.js";
|
|
92
110
|
export { MediaTile } from "./MediaTile.js";
|
|
111
|
+
export { Price } from "./Price.js";
|
|
112
|
+
export { ProductTile, type ProductTileStatus } from "./ProductTile.js";
|
|
113
|
+
export { CartButton } from "./CartButton.js";
|
|
114
|
+
export { PromoBanner } from "./PromoBanner.js";
|
|
115
|
+
export { CallToAction } from "./CallToAction.js";
|
|
93
116
|
export { ScrollStrip } from "./ScrollStrip.js";
|
|
94
|
-
export { TextLink, type TextLinkSize } from "./TextLink.js";
|
|
117
|
+
export { TextLink, type TextLinkSize, type TextLinkTone } from "./TextLink.js";
|
|
118
|
+
export { TableOfContents, type TableOfContentsItem } from "./TableOfContents.js";
|
|
95
119
|
export { Caption, Display, Lead, Overline, PageHeading, Prose, SectionHeading, SubsectionHeading, type SubsectionHeadingSize, Text, type TextAlign, type TextLines, type TextMinWidth, type TextTone, } from "./typography.js";
|
|
120
|
+
export { Mark } from "./Mark.js";
|
|
96
121
|
export { DateField } from "./DateField.js";
|
|
97
122
|
export { DateRangePicker, type DateRange, type DateRangePreset } from "./DateRangePicker.js";
|
|
98
|
-
export {
|
|
99
|
-
export
|
|
123
|
+
export { DateTimeField } from "./DateTimeField.js";
|
|
124
|
+
export { fromISODate, fromISODateTime, toISODate, toISODateTime } from "./isoDate.js";
|
|
125
|
+
export type { CalendarDate, CalendarDateTime } from "@internationalized/date";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { Card } from "./Card.js";
|
|
2
|
+
export { CardGridRow } from "./CardGrid.js";
|
|
2
3
|
export { Pill } from "./Pill.js";
|
|
3
4
|
export { Badge } from "./Badge.js";
|
|
4
5
|
export { StatTile } from "./StatTile.js";
|
|
@@ -6,6 +7,9 @@ export { ProgressBar } from "./ProgressBar.js";
|
|
|
6
7
|
export { SplitBar } from "./SplitBar.js";
|
|
7
8
|
export { Legend, StackedBar, } from "./StackedBar.js";
|
|
8
9
|
export { TrendChart } from "./TrendChart.js";
|
|
10
|
+
export { FlowDiagram } from "./FlowDiagram.js";
|
|
11
|
+
export { StateMachine, } from "./StateMachine.js";
|
|
12
|
+
export { fromXState, } from "./fromXState.js";
|
|
9
13
|
export { Markdown } from "./Markdown.js";
|
|
10
14
|
export { AppShell, AppShellBrand, appShellRootClassFor } from "./AppShell.js";
|
|
11
15
|
export { SiteFooter } from "./SiteFooter.js";
|
|
@@ -13,6 +17,7 @@ export { Container } from "./Container.js";
|
|
|
13
17
|
export { PageHeader } from "./PageHeader.js";
|
|
14
18
|
export { Hero } from "./Hero.js";
|
|
15
19
|
export { CardGrid, CenteredLayout, DetailLayout, FormLayout, FullBleedLayout, ListLayout, ProseLayout, } from "./PageLayouts.js";
|
|
20
|
+
export { ArticleLayout } from "./ArticleLayout.js";
|
|
16
21
|
export { SidebarLayout } from "./SidebarLayout.js";
|
|
17
22
|
export { DocsLayout, } from "./DocsLayout.js";
|
|
18
23
|
export { SideColumn } from "./SideColumn.js";
|
|
@@ -28,13 +33,14 @@ export { LinkProvider } from "./link.js";
|
|
|
28
33
|
export { Avatar } from "./Avatar.js";
|
|
29
34
|
export { AvatarStack } from "./AvatarStack.js";
|
|
30
35
|
export { Breadcrumbs } from "./Breadcrumbs.js";
|
|
36
|
+
export { Stepper } from "./Stepper.js";
|
|
31
37
|
export { Pagination } from "./Pagination.js";
|
|
32
38
|
export { BulletItem, BulletList } from "./BulletList.js";
|
|
33
39
|
export { Callout } from "./Callout.js";
|
|
34
40
|
export { ToastRegion } from "./ToastRegion.js";
|
|
35
41
|
export { ListRow } from "./ListRow.js";
|
|
36
42
|
export { SortableItem, SortableList, SortableSection } from "./SortableList.js";
|
|
37
|
-
export { OutlineRegion, RegionFrame } from "./OutlineRegion.js";
|
|
43
|
+
export { OutlineRegion, RegionFrame, } from "./OutlineRegion.js";
|
|
38
44
|
export { Table, TableBody, TableCell, TableFoot, TableGroupRow, TableHead, TableExpandCell, TableHeaderCell, TableRow, } from "./Table.js";
|
|
39
45
|
export { InlineEdit } from "./InlineEdit.js";
|
|
40
46
|
export { TableEditCell } from "./TableEditCell.js";
|
|
@@ -60,6 +66,7 @@ export { Lightbox } from "./Lightbox.js";
|
|
|
60
66
|
export { Icon } from "./Icon.js";
|
|
61
67
|
export { IconButton } from "./IconButton.js";
|
|
62
68
|
export { Menu } from "./Menu.js";
|
|
69
|
+
export { Popover } from "./Popover.js";
|
|
63
70
|
export { ColourSchemeToggle } from "./ColourSchemeToggle.js";
|
|
64
71
|
export { applyColourScheme, schemeClass, colourSchemeScript, readColourScheme, storeColourScheme, } from "./colourScheme.js";
|
|
65
72
|
export { Tabs } from "./Tabs.js";
|
|
@@ -75,18 +82,33 @@ export { CopyLine } from "./CopyLine.js";
|
|
|
75
82
|
export { Field } from "./Field.js";
|
|
76
83
|
export { FormGrid, FormRow, FormRowField } from "./FormRow.js";
|
|
77
84
|
export { FieldDialog } from "./FieldDialog.js";
|
|
85
|
+
export { ConfirmDialog } from "./ConfirmDialog.js";
|
|
78
86
|
export { Input } from "./Input.js";
|
|
79
87
|
export { MetaList } from "./MetaList.js";
|
|
80
88
|
export { Kbd } from "./Kbd.js";
|
|
81
89
|
export { KeyValue, KeyValueList } from "./KeyValueList.js";
|
|
82
90
|
export { Select } from "./Select.js";
|
|
91
|
+
export { Combobox } from "./Combobox.js";
|
|
92
|
+
export { NumberField } from "./NumberField.js";
|
|
93
|
+
export { Slider } from "./Slider.js";
|
|
83
94
|
export { Textarea } from "./Textarea.js";
|
|
84
95
|
export { Video } from "./Video.js";
|
|
96
|
+
export { Audio } from "./Audio.js";
|
|
97
|
+
export { EmbedFrame } from "./EmbedFrame.js";
|
|
98
|
+
export { ColourSwatch } from "./ColourSwatch.js";
|
|
85
99
|
export { Image } from "./Image.js";
|
|
86
100
|
export { MediaTile } from "./MediaTile.js";
|
|
101
|
+
export { Price } from "./Price.js";
|
|
102
|
+
export { ProductTile } from "./ProductTile.js";
|
|
103
|
+
export { CartButton } from "./CartButton.js";
|
|
104
|
+
export { PromoBanner } from "./PromoBanner.js";
|
|
105
|
+
export { CallToAction } from "./CallToAction.js";
|
|
87
106
|
export { ScrollStrip } from "./ScrollStrip.js";
|
|
88
107
|
export { TextLink } from "./TextLink.js";
|
|
108
|
+
export { TableOfContents } from "./TableOfContents.js";
|
|
89
109
|
export { Caption, Display, Lead, Overline, PageHeading, Prose, SectionHeading, SubsectionHeading, Text, } from "./typography.js";
|
|
110
|
+
export { Mark } from "./Mark.js";
|
|
90
111
|
export { DateField } from "./DateField.js";
|
|
91
112
|
export { DateRangePicker } from "./DateRangePicker.js";
|
|
92
|
-
export {
|
|
113
|
+
export { DateTimeField } from "./DateTimeField.js";
|
|
114
|
+
export { fromISODate, fromISODateTime, toISODate, toISODateTime } from "./isoDate.js";
|