@krelborn/stylesui 0.0.0-stage → 0.8.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/LICENSE +74 -0
- package/README.md +129 -2
- package/dist/accessibility/RequiredAccessibleName.d.ts +26 -0
- package/dist/accessibility/idSegment.d.ts +7 -0
- package/dist/accessibility/idSegment.js +6 -0
- package/dist/accessibility/index.d.ts +2 -0
- package/dist/collections/index.d.ts +4 -0
- package/dist/collections/targetIndexForKey.d.ts +45 -0
- package/dist/collections/targetIndexForKey.js +17 -0
- package/dist/collections/typeAhead.d.ts +43 -0
- package/dist/collections/typeAhead.js +19 -0
- package/dist/components/Alert/Alert.css +1 -0
- package/dist/components/Alert/Alert.d.ts +47 -0
- package/dist/components/Alert/Alert.js +28 -0
- package/dist/components/Alert/Alert.module.js +9 -0
- package/dist/components/Alert/AlertIcon.d.ts +14 -0
- package/dist/components/Alert/AlertIcon.js +43 -0
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/Avatar/Avatar.css +1 -0
- package/dist/components/Avatar/Avatar.d.ts +33 -0
- package/dist/components/Avatar/Avatar.js +27 -0
- package/dist/components/Avatar/Avatar.module.js +7 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Avatar/initialsOf.d.ts +9 -0
- package/dist/components/Avatar/initialsOf.js +10 -0
- package/dist/components/AvatarGroup/AvatarGroup.css +1 -0
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +30 -0
- package/dist/components/AvatarGroup/AvatarGroup.js +34 -0
- package/dist/components/AvatarGroup/AvatarGroup.module.js +7 -0
- package/dist/components/AvatarGroup/index.d.ts +2 -0
- package/dist/components/Badge/Badge.css +1 -0
- package/dist/components/Badge/Badge.d.ts +36 -0
- package/dist/components/Badge/Badge.js +16 -0
- package/dist/components/Badge/Badge.module.js +4 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Box/Box.css +1 -0
- package/dist/components/Box/Box.d.ts +31 -0
- package/dist/components/Box/Box.js +18 -0
- package/dist/components/Box/Box.module.js +4 -0
- package/dist/components/Box/index.d.ts +2 -0
- package/dist/components/Button/Button.css +1 -0
- package/dist/components/Button/Button.d.ts +42 -0
- package/dist/components/Button/Button.js +29 -0
- package/dist/components/Button/Button.module.js +7 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Card/Card.css +1 -0
- package/dist/components/Card/Card.d.ts +24 -0
- package/dist/components/Card/Card.js +15 -0
- package/dist/components/Card/Card.module.js +4 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Center/Center.css +1 -0
- package/dist/components/Center/Center.d.ts +34 -0
- package/dist/components/Center/Center.js +20 -0
- package/dist/components/Center/Center.module.js +4 -0
- package/dist/components/Center/index.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +23 -0
- package/dist/components/Checkbox/Checkbox.js +13 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/ChoiceControl/ChoiceControl.css +1 -0
- package/dist/components/ChoiceControl/ChoiceControl.d.ts +21 -0
- package/dist/components/ChoiceControl/ChoiceControl.js +40 -0
- package/dist/components/ChoiceControl/ChoiceControl.module.js +9 -0
- package/dist/components/ChoiceControl/index.d.ts +1 -0
- package/dist/components/Cluster/Cluster.d.ts +29 -0
- package/dist/components/Cluster/Cluster.js +14 -0
- package/dist/components/Cluster/index.d.ts +2 -0
- package/dist/components/Code/Code.css +1 -0
- package/dist/components/Code/Code.d.ts +13 -0
- package/dist/components/Code/Code.js +20 -0
- package/dist/components/Code/Code.module.js +4 -0
- package/dist/components/Code/index.d.ts +2 -0
- package/dist/components/Counter/Counter.css +1 -0
- package/dist/components/Counter/Counter.d.ts +39 -0
- package/dist/components/Counter/Counter.js +19 -0
- package/dist/components/Counter/Counter.module.js +4 -0
- package/dist/components/Counter/index.d.ts +2 -0
- package/dist/components/Cover/Cover.css +1 -0
- package/dist/components/Cover/Cover.d.ts +40 -0
- package/dist/components/Cover/Cover.js +30 -0
- package/dist/components/Cover/Cover.module.js +7 -0
- package/dist/components/Cover/index.d.ts +2 -0
- package/dist/components/Divider/Divider.css +1 -0
- package/dist/components/Divider/Divider.d.ts +25 -0
- package/dist/components/Divider/Divider.js +16 -0
- package/dist/components/Divider/Divider.module.js +4 -0
- package/dist/components/Divider/index.d.ts +2 -0
- package/dist/components/Field/Field.css +1 -0
- package/dist/components/Field/Field.d.ts +49 -0
- package/dist/components/Field/Field.js +48 -0
- package/dist/components/Field/Field.module.js +9 -0
- package/dist/components/Field/index.d.ts +2 -0
- package/dist/components/Fieldset/Fieldset.css +1 -0
- package/dist/components/Fieldset/Fieldset.d.ts +35 -0
- package/dist/components/Fieldset/Fieldset.js +65 -0
- package/dist/components/Fieldset/Fieldset.module.js +9 -0
- package/dist/components/Fieldset/index.d.ts +2 -0
- package/dist/components/Frame/Frame.css +1 -0
- package/dist/components/Frame/Frame.d.ts +23 -0
- package/dist/components/Frame/Frame.js +17 -0
- package/dist/components/Frame/Frame.module.js +4 -0
- package/dist/components/Frame/index.d.ts +2 -0
- package/dist/components/Grid/Grid.css +1 -0
- package/dist/components/Grid/Grid.d.ts +25 -0
- package/dist/components/Grid/Grid.js +23 -0
- package/dist/components/Grid/Grid.module.js +4 -0
- package/dist/components/Grid/index.d.ts +2 -0
- package/dist/components/Heading/Heading.css +1 -0
- package/dist/components/Heading/Heading.d.ts +39 -0
- package/dist/components/Heading/Heading.js +24 -0
- package/dist/components/Heading/Heading.module.js +4 -0
- package/dist/components/Heading/index.d.ts +2 -0
- package/dist/components/HorizontalFlow/HorizontalFlow.css +1 -0
- package/dist/components/HorizontalFlow/HorizontalFlow.d.ts +30 -0
- package/dist/components/HorizontalFlow/HorizontalFlow.js +31 -0
- package/dist/components/HorizontalFlow/HorizontalFlow.module.js +4 -0
- package/dist/components/HorizontalFlow/index.d.ts +2 -0
- package/dist/components/Icon/AddIcon.d.ts +11 -0
- package/dist/components/Icon/AddIcon.js +22 -0
- package/dist/components/Icon/ChevronDownIcon.d.ts +11 -0
- package/dist/components/Icon/ChevronDownIcon.js +19 -0
- package/dist/components/Icon/CloseIcon.d.ts +12 -0
- package/dist/components/Icon/CloseIcon.js +22 -0
- package/dist/components/Icon/ColorModeIcon.d.ts +12 -0
- package/dist/components/Icon/ColorModeIcon.js +37 -0
- package/dist/components/Icon/DeleteIcon.d.ts +11 -0
- package/dist/components/Icon/DeleteIcon.js +37 -0
- package/dist/components/Icon/Icon.css +1 -0
- package/dist/components/Icon/Icon.d.ts +40 -0
- package/dist/components/Icon/Icon.js +28 -0
- package/dist/components/Icon/Icon.module.js +7 -0
- package/dist/components/Icon/InfoIcon.d.ts +11 -0
- package/dist/components/Icon/InfoIcon.js +31 -0
- package/dist/components/Icon/MoreHorizontalIcon.d.ts +11 -0
- package/dist/components/Icon/MoreHorizontalIcon.js +35 -0
- package/dist/components/Icon/MoreVerticalIcon.d.ts +11 -0
- package/dist/components/Icon/MoreVerticalIcon.js +35 -0
- package/dist/components/Icon/PaletteIcon.d.ts +12 -0
- package/dist/components/Icon/PaletteIcon.js +49 -0
- package/dist/components/Icon/RefreshIcon.d.ts +13 -0
- package/dist/components/Icon/RefreshIcon.js +33 -0
- package/dist/components/Icon/RemoveIcon.d.ts +11 -0
- package/dist/components/Icon/RemoveIcon.js +19 -0
- package/dist/components/Icon/SendIcon.d.ts +11 -0
- package/dist/components/Icon/SendIcon.js +23 -0
- package/dist/components/Icon/index.d.ts +13 -0
- package/dist/components/IconButton/IconButton.css +1 -0
- package/dist/components/IconButton/IconButton.d.ts +45 -0
- package/dist/components/IconButton/IconButton.js +41 -0
- package/dist/components/IconButton/IconButton.module.js +8 -0
- package/dist/components/IconButton/index.d.ts +2 -0
- package/dist/components/Kbd/Kbd.css +1 -0
- package/dist/components/Kbd/Kbd.d.ts +13 -0
- package/dist/components/Kbd/Kbd.js +20 -0
- package/dist/components/Kbd/Kbd.module.js +4 -0
- package/dist/components/Kbd/index.d.ts +2 -0
- package/dist/components/Link/Link.css +1 -0
- package/dist/components/Link/Link.d.ts +52 -0
- package/dist/components/Link/Link.js +27 -0
- package/dist/components/Link/Link.module.js +4 -0
- package/dist/components/Link/index.d.ts +2 -0
- package/dist/components/Listbox/Listbox.css +1 -0
- package/dist/components/Listbox/Listbox.d.ts +46 -0
- package/dist/components/Listbox/Listbox.js +56 -0
- package/dist/components/Listbox/Listbox.module.js +7 -0
- package/dist/components/Listbox/ListboxContext.d.ts +38 -0
- package/dist/components/Listbox/ListboxContext.js +5 -0
- package/dist/components/Listbox/ListboxOption.d.ts +31 -0
- package/dist/components/Listbox/ListboxOption.js +43 -0
- package/dist/components/Listbox/index.d.ts +4 -0
- package/dist/components/Listbox/optionId.d.ts +8 -0
- package/dist/components/Listbox/optionId.js +7 -0
- package/dist/components/Listbox/renderedOptions.d.ts +30 -0
- package/dist/components/Listbox/renderedOptions.js +15 -0
- package/dist/components/Listbox/useListbox.d.ts +54 -0
- package/dist/components/Listbox/useListbox.js +104 -0
- package/dist/components/Listbox/useListboxContext.d.ts +9 -0
- package/dist/components/Listbox/useListboxContext.js +11 -0
- package/dist/components/NavList/NavList.css +1 -0
- package/dist/components/NavList/NavList.d.ts +20 -0
- package/dist/components/NavList/NavList.js +28 -0
- package/dist/components/NavList/NavList.module.js +12 -0
- package/dist/components/NavList/NavListGroup.d.ts +25 -0
- package/dist/components/NavList/NavListGroup.js +40 -0
- package/dist/components/NavList/NavListItem.d.ts +53 -0
- package/dist/components/NavList/NavListItem.js +57 -0
- package/dist/components/NavList/index.d.ts +6 -0
- package/dist/components/Overlay/Overlay.css +1 -0
- package/dist/components/Overlay/Overlay.d.ts +33 -0
- package/dist/components/Overlay/Overlay.js +36 -0
- package/dist/components/Overlay/Overlay.module.js +4 -0
- package/dist/components/Overlay/index.d.ts +1 -0
- package/dist/components/PageLayout/PageLayout.css +1 -0
- package/dist/components/PageLayout/PageLayout.d.ts +26 -0
- package/dist/components/PageLayout/PageLayout.js +18 -0
- package/dist/components/PageLayout/PageLayout.module.js +4 -0
- package/dist/components/PageLayout/index.d.ts +2 -0
- package/dist/components/Popover/Popover.css +1 -0
- package/dist/components/Popover/Popover.d.ts +52 -0
- package/dist/components/Popover/Popover.js +21 -0
- package/dist/components/Popover/Popover.module.js +4 -0
- package/dist/components/Popover/index.d.ts +4 -0
- package/dist/components/Popover/usePopover.d.ts +96 -0
- package/dist/components/Popover/usePopover.js +66 -0
- package/dist/components/Prose/Prose.css +1 -0
- package/dist/components/Prose/Prose.d.ts +50 -0
- package/dist/components/Prose/Prose.js +16 -0
- package/dist/components/Prose/Prose.module.js +4 -0
- package/dist/components/Prose/index.d.ts +2 -0
- package/dist/components/Radio/Radio.d.ts +29 -0
- package/dist/components/Radio/Radio.js +24 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/RadioGroup/RadioGroup.css +1 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +58 -0
- package/dist/components/RadioGroup/RadioGroup.js +37 -0
- package/dist/components/RadioGroup/RadioGroup.module.js +4 -0
- package/dist/components/RadioGroup/index.d.ts +2 -0
- package/dist/components/RequiredIndicator/RequiredIndicator.css +1 -0
- package/dist/components/RequiredIndicator/RequiredIndicator.d.ts +6 -0
- package/dist/components/RequiredIndicator/RequiredIndicator.js +16 -0
- package/dist/components/RequiredIndicator/RequiredIndicator.module.js +4 -0
- package/dist/components/RequiredIndicator/index.d.ts +1 -0
- package/dist/components/Row/Row.d.ts +29 -0
- package/dist/components/Row/Row.js +14 -0
- package/dist/components/Row/index.d.ts +2 -0
- package/dist/components/SegmentedControl/Segment.d.ts +24 -0
- package/dist/components/SegmentedControl/Segment.js +42 -0
- package/dist/components/SegmentedControl/SegmentedControl.css +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +25 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +20 -0
- package/dist/components/SegmentedControl/SegmentedControl.module.js +10 -0
- package/dist/components/SegmentedControl/index.d.ts +4 -0
- package/dist/components/Select/Select.d.ts +27 -0
- package/dist/components/Select/Select.js +12 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Sidebar/Sidebar.css +1 -0
- package/dist/components/Sidebar/Sidebar.d.ts +42 -0
- package/dist/components/Sidebar/Sidebar.js +24 -0
- package/dist/components/Sidebar/Sidebar.module.js +4 -0
- package/dist/components/Sidebar/index.d.ts +2 -0
- package/dist/components/SkipLink/SkipLink.css +1 -0
- package/dist/components/SkipLink/SkipLink.d.ts +20 -0
- package/dist/components/SkipLink/SkipLink.js +21 -0
- package/dist/components/SkipLink/SkipLink.module.js +4 -0
- package/dist/components/SkipLink/index.d.ts +2 -0
- package/dist/components/Spinner/Spinner.css +1 -0
- package/dist/components/Spinner/Spinner.d.ts +13 -0
- package/dist/components/Spinner/Spinner.js +33 -0
- package/dist/components/Spinner/Spinner.module.js +8 -0
- package/dist/components/Spinner/index.d.ts +1 -0
- package/dist/components/Stack/Stack.css +1 -0
- package/dist/components/Stack/Stack.d.ts +25 -0
- package/dist/components/Stack/Stack.js +21 -0
- package/dist/components/Stack/Stack.module.js +4 -0
- package/dist/components/Stack/index.d.ts +2 -0
- package/dist/components/StatusDot/StatusDot.css +1 -0
- package/dist/components/StatusDot/StatusDot.d.ts +57 -0
- package/dist/components/StatusDot/StatusDot.js +21 -0
- package/dist/components/StatusDot/StatusDot.module.js +4 -0
- package/dist/components/StatusDot/index.d.ts +2 -0
- package/dist/components/Switch/Switch.d.ts +24 -0
- package/dist/components/Switch/Switch.js +13 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Switcher/Switcher.css +1 -0
- package/dist/components/Switcher/Switcher.d.ts +27 -0
- package/dist/components/Switcher/Switcher.js +23 -0
- package/dist/components/Switcher/Switcher.module.js +4 -0
- package/dist/components/Switcher/index.d.ts +2 -0
- package/dist/components/Tabs/Tab.d.ts +26 -0
- package/dist/components/Tabs/Tab.js +61 -0
- package/dist/components/Tabs/TabList.d.ts +16 -0
- package/dist/components/Tabs/TabList.js +23 -0
- package/dist/components/Tabs/TabPanel.d.ts +24 -0
- package/dist/components/Tabs/TabPanel.js +22 -0
- package/dist/components/Tabs/Tabs.css +1 -0
- package/dist/components/Tabs/Tabs.d.ts +81 -0
- package/dist/components/Tabs/Tabs.js +31 -0
- package/dist/components/Tabs/Tabs.module.js +9 -0
- package/dist/components/Tabs/TabsContext.d.ts +39 -0
- package/dist/components/Tabs/TabsContext.js +5 -0
- package/dist/components/Tabs/index.d.ts +8 -0
- package/dist/components/Tabs/tabIds.d.ts +16 -0
- package/dist/components/Tabs/tabIds.js +10 -0
- package/dist/components/Tabs/useTabsContext.d.ts +9 -0
- package/dist/components/Tabs/useTabsContext.js +11 -0
- package/dist/components/Text/Text.css +1 -0
- package/dist/components/Text/Text.d.ts +40 -0
- package/dist/components/Text/Text.js +17 -0
- package/dist/components/Text/Text.module.js +4 -0
- package/dist/components/Text/index.d.ts +2 -0
- package/dist/components/TextControl/TextControl.css +1 -0
- package/dist/components/TextControl/TextControl.d.ts +22 -0
- package/dist/components/TextControl/TextControl.js +23 -0
- package/dist/components/TextControl/TextControl.module.js +4 -0
- package/dist/components/TextControl/index.d.ts +1 -0
- package/dist/components/TextInput/TextInput.d.ts +31 -0
- package/dist/components/TextInput/TextInput.js +13 -0
- package/dist/components/TextInput/index.d.ts +2 -0
- package/dist/components/Textarea/Textarea.d.ts +24 -0
- package/dist/components/Textarea/Textarea.js +12 -0
- package/dist/components/Textarea/index.d.ts +2 -0
- package/dist/components/Theme/Theme.d.ts +46 -0
- package/dist/components/Theme/Theme.js +18 -0
- package/dist/components/Theme/index.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.css +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +49 -0
- package/dist/components/Tooltip/Tooltip.js +22 -0
- package/dist/components/Tooltip/Tooltip.module.js +4 -0
- package/dist/components/Tooltip/index.d.ts +4 -0
- package/dist/components/Tooltip/tooltipCoordinator.d.ts +14 -0
- package/dist/components/Tooltip/tooltipCoordinator.js +17 -0
- package/dist/components/Tooltip/useTooltip.d.ts +119 -0
- package/dist/components/Tooltip/useTooltip.js +74 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.css +1 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +14 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.js +20 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.module.js +4 -0
- package/dist/components/VisuallyHidden/index.d.ts +2 -0
- package/dist/errors/MissingContextError.d.ts +11 -0
- package/dist/errors/MissingContextError.js +9 -0
- package/dist/errors/PopoverRefusedError.d.ts +12 -0
- package/dist/errors/PopoverRefusedError.js +9 -0
- package/dist/errors/index.d.ts +2 -0
- package/dist/forms/ControlSize.d.ts +4 -0
- package/dist/forms/FieldContext.d.ts +29 -0
- package/dist/forms/FieldContext.js +5 -0
- package/dist/forms/RadioGroupContext.d.ts +34 -0
- package/dist/forms/RadioGroupContext.js +5 -0
- package/dist/forms/hasContent.d.ts +10 -0
- package/dist/forms/hasContent.js +7 -0
- package/dist/forms/index.d.ts +8 -0
- package/dist/forms/useFieldControl.d.ts +36 -0
- package/dist/forms/useFieldControl.js +29 -0
- package/dist/forms/useRadioGroupItem.d.ts +50 -0
- package/dist/forms/useRadioGroupItem.js +27 -0
- package/dist/index.d.ts +95 -0
- package/dist/index.js +67 -0
- package/dist/layout/Space.d.ts +4 -0
- package/dist/layout/alignment.d.ts +8 -0
- package/dist/layout/index.d.ts +5 -0
- package/dist/layout/listRole.d.ts +11 -0
- package/dist/layout/listRole.js +6 -0
- package/dist/layout/spaceValue.d.ts +8 -0
- package/dist/layout/spaceValue.js +6 -0
- package/dist/layout/withCustomProperties.d.ts +9 -0
- package/dist/layout/withCustomProperties.js +9 -0
- package/dist/overlays/OverlayDelay.d.ts +13 -0
- package/dist/overlays/OverlayPlacement.d.ts +6 -0
- package/dist/overlays/anchorNameFor.d.ts +7 -0
- package/dist/overlays/anchorNameFor.js +6 -0
- package/dist/overlays/index.d.ts +6 -0
- package/dist/overlays/mergeProps.d.ts +13 -0
- package/dist/overlays/mergeProps.js +30 -0
- package/dist/overlays/syncPopover.d.ts +11 -0
- package/dist/overlays/syncPopover.js +25 -0
- package/dist/overlays/useOverlay.d.ts +71 -0
- package/dist/overlays/useOverlay.js +56 -0
- package/dist/styles.css +1 -0
- package/fonts/playful.css +3 -0
- package/package.json +103 -3
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { useRadioGroupItem as e } from "../../forms/useRadioGroupItem.js";
|
|
2
|
+
import { Box as t } from "../Box/Box.js";
|
|
3
|
+
import n from "./SegmentedControl.module.js";
|
|
4
|
+
import { clsx as r } from "clsx";
|
|
5
|
+
import { c as i } from "react/compiler-runtime";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/SegmentedControl/Segment.tsx
|
|
8
|
+
function s(s) {
|
|
9
|
+
let c = i(23), l, u, d, f, p, m;
|
|
10
|
+
c[0] === s ? (l = c[1], u = c[2], d = c[3], f = c[4], p = c[5], m = c[6]) : ({children: l, className: u, onChange: d, style: p, value: m, ...f} = s, c[0] = s, c[1] = l, c[2] = u, c[3] = d, c[4] = f, c[5] = p, c[6] = m);
|
|
11
|
+
let h;
|
|
12
|
+
c[7] !== d || c[8] !== m ? (h = {
|
|
13
|
+
onChange: d,
|
|
14
|
+
value: m
|
|
15
|
+
}, c[7] = d, c[8] = m, c[9] = h) : h = c[9];
|
|
16
|
+
let g = e(h), _;
|
|
17
|
+
c[10] === u ? _ = c[11] : (_ = r(n.segment, u), c[10] = u, c[11] = _);
|
|
18
|
+
let v;
|
|
19
|
+
c[12] !== g || c[13] !== f || c[14] !== m ? (v = /* @__PURE__ */ a(t, {
|
|
20
|
+
...f,
|
|
21
|
+
...g,
|
|
22
|
+
as: "input",
|
|
23
|
+
className: n.input,
|
|
24
|
+
type: "radio",
|
|
25
|
+
value: m
|
|
26
|
+
}), c[12] = g, c[13] = f, c[14] = m, c[15] = v) : v = c[15];
|
|
27
|
+
let y;
|
|
28
|
+
c[16] === l ? y = c[17] : (y = /* @__PURE__ */ a(t, {
|
|
29
|
+
as: "span",
|
|
30
|
+
className: n.text,
|
|
31
|
+
children: l
|
|
32
|
+
}), c[16] = l, c[17] = y);
|
|
33
|
+
let b;
|
|
34
|
+
return c[18] !== p || c[19] !== _ || c[20] !== v || c[21] !== y ? (b = /* @__PURE__ */ o(t, {
|
|
35
|
+
as: "label",
|
|
36
|
+
className: _,
|
|
37
|
+
style: p,
|
|
38
|
+
children: [v, y]
|
|
39
|
+
}), c[18] = p, c[19] = _, c[20] = v, c[21] = y, c[22] = b) : b = c[22], b;
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { s as Segment };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.sui-track-wz5iS{--sui-segmented-control-inset:2px;--sui-segmented-control-depth:var(--sui-control-depth,0px);--sui-segment-padding-x:var(--sui-space-4,1rem);--sui-segment-padding-y:var(--sui-space-2,.5rem);--sui-segment-font-size:var(--sui-font-size-md,1rem);gap:var(--sui-segmented-control-inset);padding:var(--sui-segmented-control-inset);border:var(--sui-border-width,1px) solid var(--sui-color-input-border,#6b7280);border-radius:var(--sui-radius-control,4px);padding-block-end:calc(var(--sui-segmented-control-inset) + var(--sui-segmented-control-depth));display:inline-flex}.sui-track-wz5iS[data-size=sm]{--sui-segment-padding-x:var(--sui-space-3,.75rem);--sui-segment-padding-y:var(--sui-space-1,.25rem);--sui-segment-font-size:var(--sui-font-size-sm,.875rem)}.sui-track-wz5iS[data-size=lg]{--sui-segment-padding-x:var(--sui-space-6,1.5rem);--sui-segment-padding-y:var(--sui-space-3,.75rem);--sui-segment-font-size:var(--sui-font-size-lg,1.125rem)}.sui-segmentedControl-ocGwO[aria-invalid=true] .sui-track-wz5iS{border-color:var(--sui-color-danger-text,#b91c1c)}.sui-segment-cu-EL{padding:calc(var(--sui-segment-padding-y,var(--sui-space-2,.5rem)) - var(--sui-segmented-control-inset,2px)) calc(var(--sui-segment-padding-x,var(--sui-space-4,1rem)) - var(--sui-segmented-control-inset,2px));color:var(--sui-color-text,#111827);font-family:var(--sui-font-body,system-ui, sans-serif);font-size:var(--sui-segment-font-size,var(--sui-font-size-md,1rem));font-weight:var(--sui-font-weight-control,500);line-height:var(--sui-line-height-tight,1.25);place-items:center;display:inline-grid;position:relative}.sui-input-IEP3u{border:var(--sui-border-width,1px) solid transparent;border-radius:calc(var(--sui-radius-control,4px) - var(--sui-segmented-control-inset,2px));cursor:pointer;appearance:none;background-color:#0000;margin:0;transition:background-color .12s,border-color .12s,box-shadow .12s ease-out;position:absolute;inset:0}.sui-text-5WlQL{pointer-events:none;transition:color .12s;position:relative}.sui-input-IEP3u:hover:not(:checked,:disabled){background-color:var(--sui-color-secondary-subtle,#f3f4f6)}.sui-input-IEP3u:checked{border-color:var(--sui-color-control-border,transparent);background-color:var(--sui-color-primary,#2563eb);box-shadow:0 var(--sui-segmented-control-depth,var(--sui-control-depth,0px)) 0 var(--sui-color-shadow,transparent);transition:background-color .12s ease, border-color .12s ease, box-shadow var(--sui-motion-spring,.12s ease-out)}.sui-input-IEP3u:checked+.sui-text-5WlQL{color:var(--sui-color-on-primary,#fff)}.sui-input-IEP3u:focus-visible{outline:var(--sui-focus-ring-width,2px) solid var(--sui-color-focus-ring,#3b82f6);outline-offset:2px}.sui-input-IEP3u:disabled,.sui-input-IEP3u:disabled+.sui-text-5WlQL{cursor:not-allowed;opacity:.5}@media (prefers-reduced-motion:reduce){.sui-input-IEP3u,.sui-input-IEP3u:checked{transition:background-color .12s,border-color .12s}}@media (forced-colors:active){.sui-input-IEP3u:checked{background-color:highlight;border-color:highlight}.sui-input-IEP3u:checked+.sui-text-5WlQL{color:highlighttext;forced-color-adjust:none}}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import type { ControlSize } from "../../forms";
|
|
3
|
+
import type { RadioGroupProps } from "../RadioGroup";
|
|
4
|
+
/**
|
|
5
|
+
* Props for `SegmentedControl`: `RadioGroup`'s props except `orientation`, plus `size`
|
|
6
|
+
*/
|
|
7
|
+
export interface SegmentedControlProps extends Omit<RadioGroupProps, "orientation"> {
|
|
8
|
+
/**
|
|
9
|
+
* Height of the control, matching the `Button` sizes. Defaults to `md`.
|
|
10
|
+
*/
|
|
11
|
+
size?: ControlSize;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Chooses one value from a few, drawn as a row of joined `Segment`s. It is a `RadioGroup`, so it takes the same
|
|
15
|
+
* label, description, error and value props, and works with the keyboard and in a form as native radios do. To switch
|
|
16
|
+
* between views rather than choose a value, use pill `Tabs`.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* <SegmentedControl defaultValue="system" label="Appearance" onValueChange={setAppearance}>
|
|
20
|
+
* <Segment value="light">Light</Segment>
|
|
21
|
+
* <Segment value="dark">Dark</Segment>
|
|
22
|
+
* <Segment value="system">System</Segment>
|
|
23
|
+
* </SegmentedControl>
|
|
24
|
+
*/
|
|
25
|
+
export declare function SegmentedControl({ children, className, size, ...rest }: SegmentedControlProps): JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Box as e } from "../Box/Box.js";
|
|
2
|
+
import { RadioGroup as t } from "../RadioGroup/RadioGroup.js";
|
|
3
|
+
import n from "./SegmentedControl.module.js";
|
|
4
|
+
import { clsx as r } from "clsx";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/SegmentedControl/SegmentedControl.tsx
|
|
7
|
+
function a({ children: a, className: o, size: s = "md", ...c }) {
|
|
8
|
+
return /* @__PURE__ */ i(t, {
|
|
9
|
+
...c,
|
|
10
|
+
className: r(n.segmentedControl, o),
|
|
11
|
+
orientation: "horizontal",
|
|
12
|
+
children: /* @__PURE__ */ i(e, {
|
|
13
|
+
className: n.track,
|
|
14
|
+
"data-size": s,
|
|
15
|
+
children: a
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { a as SegmentedControl };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import './SegmentedControl.css';//#region src/components/SegmentedControl/SegmentedControl.module.css
|
|
2
|
+
var e = "sui-track-wz5iS", t = "sui-segmentedControl-ocGwO", n = "sui-segment-cu-EL", r = "sui-input-IEP3u", i = "sui-text-5WlQL", a = {
|
|
3
|
+
track: e,
|
|
4
|
+
segmentedControl: t,
|
|
5
|
+
segment: n,
|
|
6
|
+
input: r,
|
|
7
|
+
text: i
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { a as default, r as input, n as segment, t as segmentedControl, i as text, e as track };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import type { ControlSize } from "../../forms";
|
|
3
|
+
import type { BoxProps } from "../Box";
|
|
4
|
+
/**
|
|
5
|
+
* Props for `Select`: its own props plus every native select prop
|
|
6
|
+
*/
|
|
7
|
+
export interface SelectProps extends Omit<BoxProps<"select">, "as" | "multiple" | "size"> {
|
|
8
|
+
/**
|
|
9
|
+
* Height of the select, matching the `Button` sizes. Takes the place of the native `size` attribute. Defaults
|
|
10
|
+
* to `md`. The `sm` text is under 16px, which makes iOS Safari zoom the page when the select takes focus.
|
|
11
|
+
*/
|
|
12
|
+
size?: ControlSize;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Themed native select that chooses one option from a list. Its children are native `option` and `optgroup`
|
|
16
|
+
* elements. Inside a `Field` it takes its label, description, error, and required and disabled state from the
|
|
17
|
+
* field. Outside one, give it an accessible name, for example with `aria-label`.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* <Field label="Country">
|
|
21
|
+
* <Select defaultValue="fr">
|
|
22
|
+
* <option value="fr">France</option>
|
|
23
|
+
* <option value="jp">Japan</option>
|
|
24
|
+
* </Select>
|
|
25
|
+
* </Field>
|
|
26
|
+
*/
|
|
27
|
+
export declare function Select({ size, ...rest }: SelectProps): JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TextControl as e } from "../TextControl/TextControl.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/Select/Select.tsx
|
|
4
|
+
function n({ size: n = "md", ...r }) {
|
|
5
|
+
return /* @__PURE__ */ t(e, {
|
|
6
|
+
...r,
|
|
7
|
+
as: "select",
|
|
8
|
+
size: n
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as Select };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.sui-sidebar-UB1qz{gap:var(--sui-sidebar-gap);flex-wrap:wrap;display:flex}.sui-sidebar-UB1qz[data-align=start]{align-items:start}.sui-sidebar-UB1qz[data-side=end]>:first-child,.sui-sidebar-UB1qz[data-side=start]>:last-child{min-inline-size:var(--sui-sidebar-content-minimum-width);flex-grow:999;flex-basis:0}.sui-sidebar-UB1qz[data-side=end]>:last-child,.sui-sidebar-UB1qz[data-side=start]>:first-child{flex-basis:var(--sui-sidebar-side-width);flex-grow:1}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import type { Space } from "../../layout";
|
|
3
|
+
import type { BoxElement, BoxProps } from "../Box";
|
|
4
|
+
interface SidebarOwnProps {
|
|
5
|
+
/**
|
|
6
|
+
* Cross-axis placement of the panes; `start` lets a sticky sidebar work. Defaults to `stretch`.
|
|
7
|
+
*/
|
|
8
|
+
align?: "start" | "stretch";
|
|
9
|
+
/**
|
|
10
|
+
* Minimum width of the main pane before the panes stack, as a CSS length. Defaults to `50%`.
|
|
11
|
+
*/
|
|
12
|
+
contentMinimumWidth?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Space between the panes. Defaults to `4`.
|
|
15
|
+
*/
|
|
16
|
+
gap?: Space;
|
|
17
|
+
/**
|
|
18
|
+
* Which child is the sidebar: the first (`start`) or last (`end`). Defaults to `end`.
|
|
19
|
+
*/
|
|
20
|
+
side?: "start" | "end";
|
|
21
|
+
/**
|
|
22
|
+
* Ideal width of the sidebar, as a CSS length. Defaults to the sidebar's content width.
|
|
23
|
+
*/
|
|
24
|
+
sideWidth?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Props for `Sidebar`: its own props plus every prop supported by the element given in `as`
|
|
28
|
+
*/
|
|
29
|
+
export type SidebarProps<E extends BoxElement = "div"> = SidebarOwnProps & Omit<BoxProps<E>, keyof SidebarOwnProps>;
|
|
30
|
+
/**
|
|
31
|
+
* Main pane and side pane that sit side by side when there is room and stack when there is not.
|
|
32
|
+
* Expects exactly two children. Wrap a nested Sidebar in an element, because a Sidebar that is itself a
|
|
33
|
+
* pane shadows this one's custom properties.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* <Sidebar sideWidth="18rem">
|
|
37
|
+
* <article>...</article>
|
|
38
|
+
* <aside>...</aside>
|
|
39
|
+
* </Sidebar>
|
|
40
|
+
*/
|
|
41
|
+
export declare function Sidebar<E extends BoxElement = "div">({ align, as, className, contentMinimumWidth, gap, side, sideWidth, ...rest }: SidebarProps<E>): JSX.Element;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Box as e } from "../Box/Box.js";
|
|
2
|
+
import { spaceValue as t } from "../../layout/spaceValue.js";
|
|
3
|
+
import { withCustomProperties as n } from "../../layout/withCustomProperties.js";
|
|
4
|
+
import r from "./Sidebar.module.js";
|
|
5
|
+
import { clsx as i } from "clsx";
|
|
6
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/Sidebar/Sidebar.tsx
|
|
8
|
+
function o({ align: o = "stretch", as: s, className: c, contentMinimumWidth: l = "50%", gap: u = 4, side: d = "end", sideWidth: f, ...p }) {
|
|
9
|
+
let { style: m, ...h } = p;
|
|
10
|
+
return /* @__PURE__ */ a(e, {
|
|
11
|
+
...h,
|
|
12
|
+
as: s,
|
|
13
|
+
className: i(r.sidebar, c),
|
|
14
|
+
style: n({
|
|
15
|
+
"--sui-sidebar-content-minimum-width": l,
|
|
16
|
+
"--sui-sidebar-gap": t(u),
|
|
17
|
+
"--sui-sidebar-side-width": f ?? "auto"
|
|
18
|
+
}, m),
|
|
19
|
+
"data-align": o,
|
|
20
|
+
"data-side": d
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { o as Sidebar };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.sui-skipLink-lRGho{--sui-skip-link-bg:var(--sui-color-primary,#2563eb);--sui-skip-link-fg:var(--sui-color-on-primary,#fff);--sui-skip-link-z-index:1000;clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.sui-skipLink-lRGho:focus-visible{z-index:var(--sui-skip-link-z-index);width:auto;height:auto;max-inline-size:calc(100% - 2 * var(--sui-space-2,.5rem));padding:var(--sui-space-2,.5rem) var(--sui-space-4,1rem);clip-path:none;border-radius:var(--sui-radius-control,4px);background-color:var(--sui-skip-link-bg);color:var(--sui-skip-link-fg);font-family:var(--sui-font-body,system-ui, sans-serif);font-size:var(--sui-font-size-md,1rem);font-weight:var(--sui-font-weight-control,500);line-height:var(--sui-line-height-tight,1.25);white-space:normal;outline:var(--sui-focus-ring-width,2px) solid var(--sui-color-focus-ring,#3b82f6);outline-offset:2px;margin:0;text-decoration:none;position:fixed;inset-block-start:var(--sui-space-2,.5rem);inset-inline-start:var(--sui-space-2,.5rem);overflow:visible}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import type { BoxProps } from "../Box";
|
|
3
|
+
/**
|
|
4
|
+
* Props for `SkipLink`: its own props plus every native anchor prop
|
|
5
|
+
*/
|
|
6
|
+
export interface SkipLinkProps extends Omit<BoxProps<"a">, "as" | "href"> {
|
|
7
|
+
/**
|
|
8
|
+
* Fragment naming the element to skip to, such as `#main`. That element needs the matching `id`.
|
|
9
|
+
*/
|
|
10
|
+
href: `#${string}`;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Link that skips past repeated content to the page's main content. It stays out of sight until it
|
|
14
|
+
* receives keyboard focus, then shows pinned to the top-left of the page. Render it first in the
|
|
15
|
+
* page so it is the first Tab stop.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* <SkipLink href="#main">Skip to main content</SkipLink>
|
|
19
|
+
*/
|
|
20
|
+
export declare function SkipLink({ children, className, ...rest }: SkipLinkProps): JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Box as e } from "../Box/Box.js";
|
|
2
|
+
import t from "./SkipLink.module.js";
|
|
3
|
+
import { clsx as n } from "clsx";
|
|
4
|
+
import { c as r } from "react/compiler-runtime";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/SkipLink/SkipLink.tsx
|
|
7
|
+
function a(a) {
|
|
8
|
+
let o = r(10), s, c, l;
|
|
9
|
+
o[0] === a ? (s = o[1], c = o[2], l = o[3]) : ({children: s, className: c, ...l} = a, o[0] = a, o[1] = s, o[2] = c, o[3] = l);
|
|
10
|
+
let u;
|
|
11
|
+
o[4] === c ? u = o[5] : (u = n(t.skipLink, c), o[4] = c, o[5] = u);
|
|
12
|
+
let d;
|
|
13
|
+
return o[6] !== s || o[7] !== l || o[8] !== u ? (d = /* @__PURE__ */ i(e, {
|
|
14
|
+
...l,
|
|
15
|
+
as: "a",
|
|
16
|
+
className: u,
|
|
17
|
+
children: s
|
|
18
|
+
}), o[6] = s, o[7] = l, o[8] = u, o[9] = d) : d = o[9], d;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { a as SkipLink };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.sui-spinner-GpFZS{block-size:1em;inline-size:1em;animation:.8s linear infinite sui-rotate-RRVpi}@keyframes sui-rotate-RRVpi{to{transform:rotate(1turn)}}@keyframes sui-pulse-ZOhFR{50%{opacity:.4}}@media (prefers-reduced-motion:reduce){.sui-spinner-GpFZS{animation:1.6s ease-in-out infinite sui-pulse-ZOhFR}}@media (forced-colors:active){.sui-spinner-GpFZS{color:buttontext}}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
interface SpinnerProps {
|
|
3
|
+
/**
|
|
4
|
+
* Class names merged with the spinner's own, for positioning it
|
|
5
|
+
*/
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A rotating arc in `currentColor`, 1em square, hidden from assistive technology. Whatever shows it must also tell
|
|
10
|
+
* screen readers that something is happening, for example with a status message.
|
|
11
|
+
*/
|
|
12
|
+
export declare function Spinner({ className }: SpinnerProps): JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Box as e } from "../Box/Box.js";
|
|
2
|
+
import t from "./Spinner.module.js";
|
|
3
|
+
import { clsx as n } from "clsx";
|
|
4
|
+
import { c as r } from "react/compiler-runtime";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/Spinner/Spinner.tsx
|
|
7
|
+
function a(a) {
|
|
8
|
+
let o = r(5), { className: s } = a, c;
|
|
9
|
+
o[0] === s ? c = o[1] : (c = n(t.spinner, s), o[0] = s, o[1] = c);
|
|
10
|
+
let l;
|
|
11
|
+
o[2] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ i(e, {
|
|
12
|
+
as: "circle",
|
|
13
|
+
cx: 8,
|
|
14
|
+
cy: 8,
|
|
15
|
+
r: 6,
|
|
16
|
+
stroke: "currentColor",
|
|
17
|
+
strokeDasharray: "28 10",
|
|
18
|
+
strokeLinecap: "round",
|
|
19
|
+
strokeWidth: 2
|
|
20
|
+
}), o[2] = l) : l = o[2];
|
|
21
|
+
let u;
|
|
22
|
+
return o[3] === c ? u = o[4] : (u = /* @__PURE__ */ i(e, {
|
|
23
|
+
as: "svg",
|
|
24
|
+
className: c,
|
|
25
|
+
fill: "none",
|
|
26
|
+
focusable: "false",
|
|
27
|
+
viewBox: "0 0 16 16",
|
|
28
|
+
"aria-hidden": !0,
|
|
29
|
+
children: l
|
|
30
|
+
}), o[3] = c, o[4] = u), u;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { a as Spinner };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import './Spinner.css';//#region src/components/Spinner/Spinner.module.css
|
|
2
|
+
var e = "sui-spinner-GpFZS", t = "sui-rotate-RRVpi", n = "sui-pulse-ZOhFR", r = {
|
|
3
|
+
spinner: e,
|
|
4
|
+
rotate: t,
|
|
5
|
+
pulse: n
|
|
6
|
+
};
|
|
7
|
+
//#endregion
|
|
8
|
+
export { r as default, n as pulse, t as rotate, e as spinner };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Spinner } from "./Spinner";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.sui-stack-yUU-B{gap:var(--sui-stack-gap);flex-direction:column;display:flex}.sui-stack-yUU-B:where(ul,ol){margin:0;padding:0;list-style:none}.sui-stack-yUU-B[data-align=start]{align-items:start}.sui-stack-yUU-B[data-align=center]{align-items:center}.sui-stack-yUU-B[data-align=end]{align-items:end}.sui-stack-yUU-B[data-align=stretch]{align-items:stretch}.sui-stack-yUU-B[data-align=baseline]{align-items:baseline}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import type { Alignment, Space } from "../../layout";
|
|
3
|
+
import type { BoxElement, BoxProps } from "../Box";
|
|
4
|
+
interface StackOwnProps {
|
|
5
|
+
/**
|
|
6
|
+
* Cross-axis placement of children. Defaults to `stretch`.
|
|
7
|
+
*/
|
|
8
|
+
align?: Alignment;
|
|
9
|
+
/**
|
|
10
|
+
* Space between children. Defaults to `4`.
|
|
11
|
+
*/
|
|
12
|
+
gap?: Space;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Props for `Stack`: its own props plus every prop supported by the element given in `as`
|
|
16
|
+
*/
|
|
17
|
+
export type StackProps<E extends BoxElement = "div"> = StackOwnProps & Omit<BoxProps<E>, keyof StackOwnProps>;
|
|
18
|
+
/**
|
|
19
|
+
* Vertical flow with a consistent gap between children
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* <Stack as="article" gap={6}>...</Stack>
|
|
23
|
+
*/
|
|
24
|
+
export declare function Stack<E extends BoxElement = "div">({ align, as, className, gap, ...rest }: StackProps<E>): JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Box as e } from "../Box/Box.js";
|
|
2
|
+
import { listRole as t } from "../../layout/listRole.js";
|
|
3
|
+
import { spaceValue as n } from "../../layout/spaceValue.js";
|
|
4
|
+
import { withCustomProperties as r } from "../../layout/withCustomProperties.js";
|
|
5
|
+
import i from "./Stack.module.js";
|
|
6
|
+
import { clsx as a } from "clsx";
|
|
7
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/Stack/Stack.tsx
|
|
9
|
+
function s({ align: s = "stretch", as: c, className: l, gap: u = 4, ...d }) {
|
|
10
|
+
let { role: f, style: p, ...m } = d, h = c ?? "div";
|
|
11
|
+
return /* @__PURE__ */ o(e, {
|
|
12
|
+
...m,
|
|
13
|
+
as: h,
|
|
14
|
+
className: a(i.stack, l),
|
|
15
|
+
role: t(h, f),
|
|
16
|
+
style: r({ "--sui-stack-gap": n(u) }, p),
|
|
17
|
+
"data-align": s
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { s as Stack };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.sui-statusDot-xTHkw{--sui-status-dot-size:.5rem;--sui-status-dot-tone-color:var(--sui-color-input-border,#6b7280);inline-size:var(--sui-status-dot-size);block-size:var(--sui-status-dot-size);border:calc(var(--sui-status-dot-size) / 4) solid currentColor;color:var(--sui-status-dot-color,var(--sui-status-dot-tone-color));vertical-align:middle;border-radius:50%;flex:none;display:inline-block}.sui-statusDot-xTHkw[data-size=sm]{--sui-status-dot-size:.375rem}.sui-statusDot-xTHkw[data-variant=solid]{background-color:currentColor}.sui-statusDot-xTHkw[data-tone=danger]{--sui-status-dot-tone-color:var(--sui-color-danger-text,#b91c1c)}.sui-statusDot-xTHkw[data-tone=info]{--sui-status-dot-tone-color:var(--sui-color-info-text,#4338ca)}.sui-statusDot-xTHkw[data-tone=primary]{--sui-status-dot-tone-color:var(--sui-color-primary,#2563eb)}.sui-statusDot-xTHkw[data-tone=success]{--sui-status-dot-tone-color:var(--sui-color-success-text,#166534)}.sui-statusDot-xTHkw[data-tone=warning]{--sui-status-dot-tone-color:var(--sui-color-warning-text,#854d0e)}@media (forced-colors:active){.sui-statusDot-xTHkw{color:inherit}.sui-statusDot-xTHkw[data-variant=solid]{border-width:calc(var(--sui-status-dot-size) / 2)}}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import type { BadgeTone } from "../Badge";
|
|
3
|
+
import type { BoxProps } from "../Box";
|
|
4
|
+
/**
|
|
5
|
+
* Dot sizes: `sm` is 0.375rem across and `md` is 0.5rem
|
|
6
|
+
*/
|
|
7
|
+
export type StatusDotSize = "md" | "sm";
|
|
8
|
+
/**
|
|
9
|
+
* Dot styles: a filled circle, or a ring that gives a second cue beside the colour
|
|
10
|
+
*/
|
|
11
|
+
export type StatusDotVariant = "ring" | "solid";
|
|
12
|
+
/**
|
|
13
|
+
* Props for `StatusDot`: its own props plus every `span` prop except `children`, `role` and the ARIA props that name or
|
|
14
|
+
* hide it, which `label` decides
|
|
15
|
+
*/
|
|
16
|
+
export interface StatusDotProps extends Omit<BoxProps<"span">, "aria-hidden" | "aria-label" | "aria-labelledby" | "as" | "children" | "dangerouslySetInnerHTML" | "role"> {
|
|
17
|
+
/**
|
|
18
|
+
* Not accepted: the dot is hidden from assistive technology exactly when it has no `label`
|
|
19
|
+
*/
|
|
20
|
+
"aria-hidden"?: never;
|
|
21
|
+
/**
|
|
22
|
+
* Not accepted: the `label` names the dot
|
|
23
|
+
*/
|
|
24
|
+
"aria-label"?: never;
|
|
25
|
+
/**
|
|
26
|
+
* Not accepted: the `label` names the dot
|
|
27
|
+
*/
|
|
28
|
+
"aria-labelledby"?: never;
|
|
29
|
+
/**
|
|
30
|
+
* What the dot means, read by screen readers. Without it, or with an empty one, the dot is hidden from them, so give
|
|
31
|
+
* it a label, or put text beside it, whenever it carries meaning.
|
|
32
|
+
*/
|
|
33
|
+
label?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Dot size. Defaults to `md`.
|
|
36
|
+
*/
|
|
37
|
+
size?: StatusDotSize;
|
|
38
|
+
/**
|
|
39
|
+
* Colour. Each tone keeps 3:1 against the page and a surface. Defaults to `neutral`.
|
|
40
|
+
*/
|
|
41
|
+
tone?: BadgeTone;
|
|
42
|
+
/**
|
|
43
|
+
* Filled or ring. Defaults to `solid`.
|
|
44
|
+
*/
|
|
45
|
+
variant?: StatusDotVariant;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A small coloured dot for a status, such as the result of a check. Colour alone must not tell two states apart, so
|
|
49
|
+
* pair states with different variants or with text.
|
|
50
|
+
*
|
|
51
|
+
* A container sets `--sui-status-dot-color` (for example to `currentColor`) to recolour every dot inside it, such as on
|
|
52
|
+
* a selected row filled with the primary colour.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* <StatusDot label="Checks running" tone="warning" variant="ring" />
|
|
56
|
+
*/
|
|
57
|
+
export declare function StatusDot({ className, label, size, tone, variant, ...rest }: StatusDotProps): JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Box as e } from "../Box/Box.js";
|
|
2
|
+
import t from "./StatusDot.module.js";
|
|
3
|
+
import { clsx as n } from "clsx";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/StatusDot/StatusDot.tsx
|
|
6
|
+
function i({ className: i, label: a, size: o = "md", tone: s = "neutral", variant: c = "solid", ...l }) {
|
|
7
|
+
let u = !a;
|
|
8
|
+
return /* @__PURE__ */ r(e, {
|
|
9
|
+
...l,
|
|
10
|
+
as: "span",
|
|
11
|
+
className: n(t.statusDot, i),
|
|
12
|
+
role: u ? void 0 : "img",
|
|
13
|
+
"aria-hidden": u ? !0 : void 0,
|
|
14
|
+
"aria-label": u ? void 0 : a,
|
|
15
|
+
"data-size": o,
|
|
16
|
+
"data-tone": s,
|
|
17
|
+
"data-variant": c
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { i as StatusDot };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { JSX, ReactNode } from "react";
|
|
2
|
+
import type { BoxProps } from "../Box";
|
|
3
|
+
/**
|
|
4
|
+
* Props for `Switch`: its own props plus every native input prop. `className` and `style` go to the wrapping
|
|
5
|
+
* label; `ref` and every other prop go to the input.
|
|
6
|
+
*/
|
|
7
|
+
export interface SwitchProps extends Omit<BoxProps<"input">, "as" | "children" | "dangerouslySetInnerHTML" | "role" | "type"> {
|
|
8
|
+
/**
|
|
9
|
+
* Label shown beside the track, which names the switch. Without it, give the switch an accessible name, for
|
|
10
|
+
* example with `aria-label` or the `label` of the `Field` around it. It is inline content, as a `label` holds: a child
|
|
11
|
+
* laid out as a block drops below the track.
|
|
12
|
+
*/
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Themed on/off switch: a native checkbox with the `switch` role, inside the label that names it. Use it for a
|
|
17
|
+
* setting that takes effect at once, and `Checkbox` for a choice submitted with a form. When it is required it
|
|
18
|
+
* shows an asterisk after its label. Inside a `Field` it takes its description, error, and required and disabled
|
|
19
|
+
* state from the field; give it either children or the field's `label`, not both.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* <Switch defaultChecked={true} name="notifications">Email notifications</Switch>
|
|
23
|
+
*/
|
|
24
|
+
export declare function Switch(props: SwitchProps): JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ChoiceControl as e } from "../ChoiceControl/ChoiceControl.js";
|
|
2
|
+
import { c as t } from "react/compiler-runtime";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/Switch/Switch.tsx
|
|
5
|
+
function r(r) {
|
|
6
|
+
let i = t(2), a;
|
|
7
|
+
return i[0] === r ? a = i[1] : (a = /* @__PURE__ */ n(e, {
|
|
8
|
+
...r,
|
|
9
|
+
kind: "switch"
|
|
10
|
+
}), i[0] = r, i[1] = a), a;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { r as Switch };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.sui-switcher-zWFpy{gap:var(--sui-switcher-gap);flex-wrap:wrap;display:flex}.sui-switcher-zWFpy:where(ul,ol){margin:0;padding:0;list-style:none}.sui-switcher-zWFpy>*{flex-grow:1;flex-basis:calc((var(--sui-switcher-threshold) - 100%) * 999)}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import type { Space } from "../../layout";
|
|
3
|
+
import type { BoxElement, BoxProps } from "../Box";
|
|
4
|
+
interface SwitcherOwnProps {
|
|
5
|
+
/**
|
|
6
|
+
* Space between items. Defaults to `4`.
|
|
7
|
+
*/
|
|
8
|
+
gap?: Space;
|
|
9
|
+
/**
|
|
10
|
+
* Container width below which the items stack, as a CSS length. Defaults to `30rem`.
|
|
11
|
+
*/
|
|
12
|
+
threshold?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Props for `Switcher`: its own props plus every prop supported by the element given in `as`
|
|
16
|
+
*/
|
|
17
|
+
export type SwitcherProps<E extends BoxElement = "div"> = SwitcherOwnProps & Omit<BoxProps<E>, keyof SwitcherOwnProps>;
|
|
18
|
+
/**
|
|
19
|
+
* Equal-width items in a row that all stack at once when the container is narrower than the
|
|
20
|
+
* threshold. Wrap a nested Switcher in an element, because a Switcher that is itself an item shadows this
|
|
21
|
+
* one's custom properties.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* <Switcher as="nav" threshold="36rem" aria-label="More posts">...</Switcher>
|
|
25
|
+
*/
|
|
26
|
+
export declare function Switcher<E extends BoxElement = "div">({ as, className, gap, threshold, ...rest }: SwitcherProps<E>): JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Box as e } from "../Box/Box.js";
|
|
2
|
+
import { listRole as t } from "../../layout/listRole.js";
|
|
3
|
+
import { spaceValue as n } from "../../layout/spaceValue.js";
|
|
4
|
+
import { withCustomProperties as r } from "../../layout/withCustomProperties.js";
|
|
5
|
+
import i from "./Switcher.module.js";
|
|
6
|
+
import { clsx as a } from "clsx";
|
|
7
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/Switcher/Switcher.tsx
|
|
9
|
+
function s({ as: s, className: c, gap: l = 4, threshold: u = "30rem", ...d }) {
|
|
10
|
+
let { role: f, style: p, ...m } = d, h = s ?? "div";
|
|
11
|
+
return /* @__PURE__ */ o(e, {
|
|
12
|
+
...m,
|
|
13
|
+
as: h,
|
|
14
|
+
className: a(i.switcher, c),
|
|
15
|
+
role: t(h, f),
|
|
16
|
+
style: r({
|
|
17
|
+
"--sui-switcher-gap": n(l),
|
|
18
|
+
"--sui-switcher-threshold": u
|
|
19
|
+
}, p)
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { s as Switcher };
|