@arshad-shah/cynosure 0.2.0 → 0.4.0
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/README.md +5 -5
- package/dist/adapters/astro/index.d.ts +52 -0
- package/dist/adapters/astro/index.js +27 -0
- package/dist/adapters/astro/index.js.map +1 -0
- package/dist/adapters/vite/index.d.ts +11 -0
- package/dist/adapters/vite/index.js +33 -12
- package/dist/adapters/vite/index.js.map +1 -1
- package/dist/brands/googleplay.d.ts +2 -0
- package/dist/brands/googleplay.js +17 -0
- package/dist/brands/googleplay.js.map +1 -0
- package/dist/brands/index.d.ts +1 -0
- package/dist/brands/index.js +132 -130
- package/dist/components/Accordion/Accordion.d.ts +14 -0
- package/dist/components/Accordion/Accordion.js.map +1 -1
- package/dist/components/Announcer/Announcer.d.ts +1 -0
- package/dist/components/Announcer/Announcer.js +5 -5
- package/dist/components/Announcer/Announcer.js.map +1 -1
- package/dist/components/AppShell/AppShell.d.ts +22 -1
- package/dist/components/AppShell/AppShell.js +92 -83
- package/dist/components/AppShell/AppShell.js.map +1 -1
- package/dist/components/AppShell/index.d.ts +1 -1
- package/dist/components/AspectRatio/AspectRatio.d.ts +29 -0
- package/dist/components/AspectRatio/AspectRatio.js +21 -0
- package/dist/components/AspectRatio/AspectRatio.js.map +1 -0
- package/dist/components/AspectRatio/index.d.ts +1 -0
- package/dist/components/Avatar/Avatar.d.ts +96 -0
- package/dist/components/Avatar/Avatar.js +90 -0
- package/dist/components/Avatar/Avatar.js.map +1 -0
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Badge/Badge.d.ts +6 -0
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +55 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +85 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js.map +1 -0
- package/dist/components/Breadcrumbs/index.d.ts +1 -0
- package/dist/components/Button/Button.d.ts +27 -2
- package/dist/components/Button/Button.js +62 -53
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Calendar/Calendar.d.ts +65 -7
- package/dist/components/Calendar/Calendar.js +209 -97
- package/dist/components/Calendar/Calendar.js.map +1 -1
- package/dist/components/Calendar/dates.d.ts +4 -0
- package/dist/components/Calendar/dates.js +41 -27
- package/dist/components/Calendar/dates.js.map +1 -1
- package/dist/components/Calendar/index.d.ts +1 -1
- package/dist/components/Card/Card.d.ts +35 -1
- package/dist/components/Card/Card.js +48 -36
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Card/index.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +11 -4
- package/dist/components/Checkbox/Checkbox.js +33 -7
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Checklist/Checklist.d.ts +65 -0
- package/dist/components/Checklist/Checklist.js +163 -0
- package/dist/components/Checklist/Checklist.js.map +1 -0
- package/dist/components/Checklist/index.d.ts +1 -0
- package/dist/components/Choice/Choice.d.ts +73 -0
- package/dist/components/Choice/Choice.js +41 -0
- package/dist/components/Choice/Choice.js.map +1 -0
- package/dist/components/Choice/index.d.ts +1 -0
- package/dist/components/CodeBlock/CodeBlock.d.ts +5 -0
- package/dist/components/CodeBlock/CodeBlock.js.map +1 -1
- package/dist/components/ColorField/ColorField.d.ts +12 -0
- package/dist/components/ColorField/ColorField.js +199 -208
- package/dist/components/ColorField/ColorField.js.map +1 -1
- package/dist/components/ColorSwatches/ColorSwatches.d.ts +5 -0
- package/dist/components/ColorSwatches/ColorSwatches.js +6 -6
- package/dist/components/ColorSwatches/ColorSwatches.js.map +1 -1
- package/dist/components/Combobox/Combobox.d.ts +20 -1
- package/dist/components/Combobox/Combobox.js +86 -111
- package/dist/components/Combobox/Combobox.js.map +1 -1
- package/dist/components/CommandPalette/CommandPalette.d.ts +9 -0
- package/dist/components/CommandPalette/CommandPalette.js +10 -10
- package/dist/components/CommandPalette/CommandPalette.js.map +1 -1
- package/dist/components/CompareSlider/CompareSlider.d.ts +4 -0
- package/dist/components/CompareSlider/CompareSlider.js +4 -4
- package/dist/components/CompareSlider/CompareSlider.js.map +1 -1
- package/dist/components/Container/Container.d.ts +44 -0
- package/dist/components/Container/Container.js +28 -0
- package/dist/components/Container/Container.js.map +1 -0
- package/dist/components/Container/index.d.ts +1 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +11 -0
- package/dist/components/ContextMenu/ContextMenu.js.map +1 -1
- package/dist/components/CopyButton/CopyButton.d.ts +8 -0
- package/dist/components/CopyButton/CopyButton.js +29 -28
- package/dist/components/CopyButton/CopyButton.js.map +1 -1
- package/dist/components/DateField/DateField.d.ts +17 -0
- package/dist/components/DateField/DateField.js +6 -6
- package/dist/components/DateField/DateField.js.map +1 -1
- package/dist/components/DescriptionList/DescriptionList.d.ts +3 -0
- package/dist/components/DescriptionList/DescriptionList.js.map +1 -1
- package/dist/components/DeviceFrame/DeviceFrame.d.ts +63 -0
- package/dist/components/DeviceFrame/DeviceFrame.js +54 -0
- package/dist/components/DeviceFrame/DeviceFrame.js.map +1 -0
- package/dist/components/DeviceFrame/index.d.ts +1 -0
- package/dist/components/Dialog/Dialog.d.ts +25 -2
- package/dist/components/Dialog/Dialog.js +89 -72
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Disclosure/Disclosure.d.ts +7 -0
- package/dist/components/Disclosure/Disclosure.js.map +1 -1
- package/dist/components/Divider/Divider.d.ts +59 -0
- package/dist/components/Divider/Divider.js +32 -0
- package/dist/components/Divider/Divider.js.map +1 -0
- package/dist/components/Divider/index.d.ts +1 -0
- package/dist/components/DocumentViewport/DocumentViewport.d.ts +8 -0
- package/dist/components/DocumentViewport/DocumentViewport.js.map +1 -1
- package/dist/components/EmptyState/EmptyState.d.ts +8 -2
- package/dist/components/EmptyState/EmptyState.js.map +1 -1
- package/dist/components/Field/Field.d.ts +6 -0
- package/dist/components/Field/Field.js +31 -33
- package/dist/components/Field/Field.js.map +1 -1
- package/dist/components/FileDrop/FileDrop.d.ts +8 -0
- package/dist/components/FileDrop/FileDrop.js +14 -14
- package/dist/components/FileDrop/FileDrop.js.map +1 -1
- package/dist/components/FloatingToolbar/FloatingToolbar.d.ts +4 -0
- package/dist/components/FloatingToolbar/FloatingToolbar.js +11 -10
- package/dist/components/FloatingToolbar/FloatingToolbar.js.map +1 -1
- package/dist/components/Grid/Grid.d.ts +57 -10
- package/dist/components/Grid/Grid.js +71 -28
- package/dist/components/Grid/Grid.js.map +1 -1
- package/dist/components/Grid/index.d.ts +1 -1
- package/dist/components/Heading/Heading.d.ts +59 -0
- package/dist/components/Heading/Heading.js +33 -0
- package/dist/components/Heading/Heading.js.map +1 -0
- package/dist/components/Heading/index.d.ts +1 -0
- package/dist/components/HoverCard/HoverCard.d.ts +1 -0
- package/dist/components/HoverCard/HoverCard.js.map +1 -1
- package/dist/components/IconButton/IconButton.d.ts +17 -1
- package/dist/components/IconButton/IconButton.js +14 -10
- package/dist/components/IconButton/IconButton.js.map +1 -1
- package/dist/components/IconTile/IconTile.d.ts +45 -0
- package/dist/components/IconTile/IconTile.js +25 -0
- package/dist/components/IconTile/IconTile.js.map +1 -0
- package/dist/components/IconTile/index.d.ts +1 -0
- package/dist/components/Image/Image.d.ts +62 -0
- package/dist/components/Image/Image.js +75 -0
- package/dist/components/Image/Image.js.map +1 -0
- package/dist/components/Image/index.d.ts +1 -0
- package/dist/components/Inline/Inline.d.ts +8 -4
- package/dist/components/Inline/Inline.js +12 -16
- package/dist/components/Inline/Inline.js.map +1 -1
- package/dist/components/Kbd/Kbd.d.ts +2 -0
- package/dist/components/Kbd/Kbd.js.map +1 -1
- package/dist/components/KeyValueEditor/KeyValueEditor.d.ts +7 -0
- package/dist/components/KeyValueEditor/KeyValueEditor.js +43 -42
- package/dist/components/KeyValueEditor/KeyValueEditor.js.map +1 -1
- package/dist/components/Link/Link.d.ts +16 -1
- package/dist/components/Link/Link.js +20 -18
- package/dist/components/Link/Link.js.map +1 -1
- package/dist/components/List/List.d.ts +73 -0
- package/dist/components/List/List.js +64 -0
- package/dist/components/List/List.js.map +1 -0
- package/dist/components/List/index.d.ts +1 -0
- package/dist/components/LoadingDots/LoadingDots.d.ts +2 -0
- package/dist/components/LoadingDots/LoadingDots.js.map +1 -1
- package/dist/components/Menu/Menu.d.ts +13 -1
- package/dist/components/Menu/Menu.js +37 -35
- package/dist/components/Menu/Menu.js.map +1 -1
- package/dist/components/Notice/Notice.d.ts +5 -0
- package/dist/components/Notice/Notice.js +12 -11
- package/dist/components/Notice/Notice.js.map +1 -1
- package/dist/components/NumberField/NumberField.d.ts +17 -0
- package/dist/components/NumberField/NumberField.js +8 -8
- package/dist/components/NumberField/NumberField.js.map +1 -1
- package/dist/components/OptionList/OptionList.d.ts +69 -0
- package/dist/components/OptionList/OptionList.js +75 -0
- package/dist/components/OptionList/OptionList.js.map +1 -0
- package/dist/components/OptionList/index.d.ts +1 -0
- package/dist/components/PageHeader/PageHeader.d.ts +67 -0
- package/dist/components/PageHeader/PageHeader.js +63 -0
- package/dist/components/PageHeader/PageHeader.js.map +1 -0
- package/dist/components/PageHeader/index.d.ts +1 -0
- package/dist/components/Pagination/Pagination.d.ts +77 -0
- package/dist/components/Pagination/Pagination.js +121 -0
- package/dist/components/Pagination/Pagination.js.map +1 -0
- package/dist/components/Pagination/index.d.ts +1 -0
- package/dist/components/PanZoomCanvas/PanZoomCanvas.d.ts +4 -0
- package/dist/components/PanZoomCanvas/PanZoomCanvas.js.map +1 -1
- package/dist/components/Popover/Popover.d.ts +10 -0
- package/dist/components/Popover/Popover.js.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.d.ts +5 -0
- package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/components/ProgressOverlay/ProgressOverlay.d.ts +3 -0
- package/dist/components/ProgressOverlay/ProgressOverlay.js.map +1 -1
- package/dist/components/Prose/Prose.d.ts +1 -0
- package/dist/components/Prose/Prose.js.map +1 -1
- package/dist/components/QRCode/QRCode.d.ts +56 -0
- package/dist/components/QRCode/QRCode.js +48 -0
- package/dist/components/QRCode/QRCode.js.map +1 -0
- package/dist/components/QRCode/index.d.ts +1 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +13 -0
- package/dist/components/RadioGroup/RadioGroup.js +32 -24
- package/dist/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/Section/Section.d.ts +57 -0
- package/dist/components/Section/Section.js +27 -0
- package/dist/components/Section/Section.js.map +1 -0
- package/dist/components/Section/index.d.ts +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +9 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +12 -12
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/components/Select/Select.d.ts +18 -1
- package/dist/components/Select/Select.js +107 -125
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/index.d.ts +1 -0
- package/dist/components/SelectionFrame/SelectionFrame.d.ts +6 -0
- package/dist/components/SelectionFrame/SelectionFrame.js.map +1 -1
- package/dist/components/Sheet/Sheet.js +12 -7
- package/dist/components/Sheet/Sheet.js.map +1 -1
- package/dist/components/SideNav/SideNav.d.ts +37 -1
- package/dist/components/SideNav/SideNav.js +103 -74
- package/dist/components/SideNav/SideNav.js.map +1 -1
- package/dist/components/SideNav/index.d.ts +1 -1
- package/dist/components/SignaturePad/SignaturePad.d.ts +3 -0
- package/dist/components/SignaturePad/SignaturePad.js.map +1 -1
- package/dist/components/SiteFooter/SiteFooter.d.ts +66 -0
- package/dist/components/SiteFooter/SiteFooter.js +80 -0
- package/dist/components/SiteFooter/SiteFooter.js.map +1 -0
- package/dist/components/SiteFooter/index.d.ts +1 -0
- package/dist/components/SiteHeader/SiteHeader.d.ts +78 -0
- package/dist/components/SiteHeader/SiteHeader.js +114 -0
- package/dist/components/SiteHeader/SiteHeader.js.map +1 -0
- package/dist/components/SiteHeader/index.d.ts +1 -0
- package/dist/components/Skeleton/Skeleton.d.ts +1 -0
- package/dist/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/SkipLink/SkipLink.d.ts +42 -0
- package/dist/components/SkipLink/SkipLink.js +43 -0
- package/dist/components/SkipLink/SkipLink.js.map +1 -0
- package/dist/components/SkipLink/index.d.ts +1 -0
- package/dist/components/Slider/Slider.d.ts +11 -0
- package/dist/components/Slider/Slider.js +6 -6
- package/dist/components/Slider/Slider.js.map +1 -1
- package/dist/components/SortableList/SortableList.d.ts +6 -0
- package/dist/components/SortableList/SortableList.js +13 -13
- package/dist/components/SortableList/SortableList.js.map +1 -1
- package/dist/components/SplitPane/SplitPane.d.ts +5 -0
- package/dist/components/SplitPane/SplitPane.js +4 -4
- package/dist/components/SplitPane/SplitPane.js.map +1 -1
- package/dist/components/Stack/Stack.d.ts +19 -6
- package/dist/components/Stack/Stack.js +26 -13
- package/dist/components/Stack/Stack.js.map +1 -1
- package/dist/components/Stack/index.d.ts +1 -0
- package/dist/components/Stack/space.d.ts +47 -0
- package/dist/components/Stack/space.js +23 -0
- package/dist/components/Stack/space.js.map +1 -0
- package/dist/components/Stat/Stat.d.ts +88 -0
- package/dist/components/Stat/Stat.js +105 -0
- package/dist/components/Stat/Stat.js.map +1 -0
- package/dist/components/Stat/index.d.ts +1 -0
- package/dist/components/Steps/Steps.d.ts +14 -4
- package/dist/components/Steps/Steps.js +31 -30
- package/dist/components/Steps/Steps.js.map +1 -1
- package/dist/components/Switch/Switch.d.ts +4 -4
- package/dist/components/Switch/Switch.js +18 -7
- package/dist/components/Switch/Switch.js.map +1 -1
- package/dist/components/Table/Table.d.ts +12 -0
- package/dist/components/Table/Table.js +11 -12
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +18 -1
- package/dist/components/Tabs/Tabs.js +74 -73
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/TagInput/TagInput.d.ts +18 -0
- package/dist/components/TagInput/TagInput.js +79 -100
- package/dist/components/TagInput/TagInput.js.map +1 -1
- package/dist/components/Text/Text.d.ts +72 -0
- package/dist/components/Text/Text.js +30 -0
- package/dist/components/Text/Text.js.map +1 -0
- package/dist/components/Text/index.d.ts +1 -0
- package/dist/components/TextArea/TextArea.d.ts +10 -0
- package/dist/components/TextArea/TextArea.js +4 -4
- package/dist/components/TextArea/TextArea.js.map +1 -1
- package/dist/components/TextField/TextField.d.ts +17 -0
- package/dist/components/TextField/TextField.js +28 -27
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/ThemeToggle/ThemeToggle.d.ts +11 -1
- package/dist/components/ThemeToggle/ThemeToggle.js +33 -30
- package/dist/components/ThemeToggle/ThemeToggle.js.map +1 -1
- package/dist/components/TimeField/TimeField.d.ts +62 -8
- package/dist/components/TimeField/TimeField.js +308 -72
- package/dist/components/TimeField/TimeField.js.map +1 -1
- package/dist/components/Toast/Toast.d.ts +25 -1
- package/dist/components/Toast/Toast.js +137 -126
- package/dist/components/Toast/Toast.js.map +1 -1
- package/dist/components/Toast/index.d.ts +1 -1
- package/dist/components/Toolbar/Toolbar.d.ts +3 -0
- package/dist/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +7 -1
- package/dist/components/Tooltip/Tooltip.js +19 -19
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/Tree/Tree.d.ts +8 -0
- package/dist/components/Tree/Tree.js.map +1 -1
- package/dist/components/VirtualList/VirtualList.d.ts +8 -0
- package/dist/components/VirtualList/VirtualList.js +4 -4
- package/dist/components/VirtualList/VirtualList.js.map +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +24 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.js +17 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.js.map +1 -0
- package/dist/components/VisuallyHidden/index.d.ts +1 -0
- package/dist/components/ZoomControls/ZoomControls.d.ts +4 -0
- package/dist/components/ZoomControls/ZoomControls.js.map +1 -1
- package/dist/foundations/ChoiceBase/ChoiceBase.d.ts +1 -0
- package/dist/foundations/ChoiceBase/ChoiceBase.js +8 -8
- package/dist/foundations/ChoiceBase/ChoiceBase.js.map +1 -1
- package/dist/foundations/HiddenValue/HiddenValue.d.ts +3 -0
- package/dist/foundations/HiddenValue/HiddenValue.js +5 -5
- package/dist/foundations/HiddenValue/HiddenValue.js.map +1 -1
- package/dist/foundations/Icon/Icon.d.ts +9 -1
- package/dist/foundations/Icon/Icon.js +15 -14
- package/dist/foundations/Icon/Icon.js.map +1 -1
- package/dist/foundations/image-outcome.d.ts +20 -0
- package/dist/foundations/image-outcome.js +43 -0
- package/dist/foundations/image-outcome.js.map +1 -0
- package/dist/foundations/option-icon.d.ts +26 -0
- package/dist/foundations/option-icon.js +16 -0
- package/dist/foundations/option-icon.js.map +1 -0
- package/dist/foundations/printing.d.ts +6 -0
- package/dist/foundations/printing.js +17 -0
- package/dist/foundations/printing.js.map +1 -0
- package/dist/foundations/qr.d.ts +42 -0
- package/dist/foundations/qr.js +246 -0
- package/dist/foundations/qr.js.map +1 -0
- package/dist/icons/book-marked.d.ts +2 -0
- package/dist/icons/book-marked.js +14 -0
- package/dist/icons/book-marked.js.map +1 -0
- package/dist/icons/calendar-days.d.ts +2 -0
- package/dist/icons/calendar-days.js +24 -0
- package/dist/icons/calendar-days.js.map +1 -0
- package/dist/icons/check-square.d.ts +2 -0
- package/dist/icons/check-square.js +14 -0
- package/dist/icons/check-square.js.map +1 -0
- package/dist/icons/crescent.d.ts +2 -0
- package/dist/icons/crescent.js +14 -0
- package/dist/icons/crescent.js.map +1 -0
- package/dist/icons/index.d.ts +11 -0
- package/dist/icons/index.js +502 -480
- package/dist/icons/kaaba.d.ts +2 -0
- package/dist/icons/kaaba.js +14 -0
- package/dist/icons/kaaba.js.map +1 -0
- package/dist/icons/keywords.d.ts +259 -0
- package/dist/icons/keywords.js +1816 -0
- package/dist/icons/keywords.js.map +1 -0
- package/dist/icons/list-tree.d.ts +2 -0
- package/dist/icons/list-tree.js +14 -0
- package/dist/icons/list-tree.js.map +1 -0
- package/dist/icons/mosque.d.ts +2 -0
- package/dist/icons/mosque.js +14 -0
- package/dist/icons/mosque.js.map +1 -0
- package/dist/icons/prayer-beads.d.ts +2 -0
- package/dist/icons/prayer-beads.js +67 -0
- package/dist/icons/prayer-beads.js.map +1 -0
- package/dist/icons/qr-code.d.ts +2 -0
- package/dist/icons/qr-code.js +38 -0
- package/dist/icons/qr-code.js.map +1 -0
- package/dist/icons/refresh-cw.d.ts +2 -0
- package/dist/icons/refresh-cw.js +14 -0
- package/dist/icons/refresh-cw.js.map +1 -0
- package/dist/icons/types.d.ts +1 -1
- package/dist/icons/types.js +2 -1
- package/dist/icons/types.js.map +1 -1
- package/dist/index.d.ts +35 -10
- package/dist/index.js +280 -220
- package/dist/styles/announcer.css +1 -1
- package/dist/styles/app-shell.css +1 -1
- package/dist/styles/aspect-ratio.css +1 -0
- package/dist/styles/avatar.css +1 -0
- package/dist/styles/base.css +1 -1
- package/dist/styles/breadcrumbs.css +1 -0
- package/dist/styles/button.css +1 -1
- package/dist/styles/calendar.css +1 -1
- package/dist/styles/card.css +1 -1
- package/dist/styles/checkbox.css +1 -1
- package/dist/styles/checklist.css +1 -0
- package/dist/styles/choice-base.css +1 -0
- package/dist/styles/choice.css +1 -1
- package/dist/styles/color-field.css +1 -1
- package/dist/styles/combobox.css +1 -1
- package/dist/styles/container.css +1 -0
- package/dist/styles/copy-button.css +1 -1
- package/dist/styles/date-field.css +1 -1
- package/dist/styles/device-frame.css +1 -0
- package/dist/styles/dialog.css +1 -1
- package/dist/styles/disclosure.css +1 -1
- package/dist/styles/divider.css +1 -0
- package/dist/styles/field.css +1 -1
- package/dist/styles/file-drop.css +1 -1
- package/dist/styles/floating-toolbar.css +1 -1
- package/dist/styles/generated-css.d.ts +1 -1
- package/dist/styles/generated-css.js +1 -1
- package/dist/styles/generated-css.js.map +1 -1
- package/dist/styles/grid.css +1 -1
- package/dist/styles/heading.css +1 -0
- package/dist/styles/icon-tile.css +1 -0
- package/dist/styles/icon.css +1 -1
- package/dist/styles/image.css +1 -0
- package/dist/styles/inline.css +1 -0
- package/dist/styles/key-value-editor.css +1 -1
- package/dist/styles/link.css +1 -1
- package/dist/styles/list.css +1 -0
- package/dist/styles/manifest.json +715 -0
- package/dist/styles/menu.css +1 -1
- package/dist/styles/notice.css +1 -1
- package/dist/styles/number-field.css +1 -1
- package/dist/styles/option-list.css +1 -0
- package/dist/styles/page-header.css +1 -0
- package/dist/styles/pagination.css +1 -0
- package/dist/styles/qr-code.css +1 -0
- package/dist/styles/radio-group.css +1 -1
- package/dist/styles/section.css +1 -0
- package/dist/styles/segmented-control.css +1 -1
- package/dist/styles/select.css +1 -1
- package/dist/styles/sheet.css +1 -1
- package/dist/styles/side-nav.css +1 -1
- package/dist/styles/site-footer.css +1 -0
- package/dist/styles/site-header.css +1 -0
- package/dist/styles/skip-link.css +1 -0
- package/dist/styles/sortable-list.css +1 -1
- package/dist/styles/stack.css +1 -1
- package/dist/styles/stat.css +1 -0
- package/dist/styles/steps.css +1 -1
- package/dist/styles/switch.css +1 -0
- package/dist/styles/table.css +1 -1
- package/dist/styles/tabs.css +1 -1
- package/dist/styles/tag-input.css +1 -1
- package/dist/styles/text-field.css +1 -1
- package/dist/styles/text.css +1 -0
- package/dist/styles/time-field.css +1 -1
- package/dist/styles/toast.css +1 -1
- package/dist/styles/visually-hidden.css +1 -0
- package/dist/styles.css +1 -1
- package/dist/theme/CynosureTheme.d.ts +4 -0
- package/dist/theme/CynosureTheme.js.map +1 -1
- package/dist/tokens/create-theme.js +137 -108
- package/dist/tokens/create-theme.js.map +1 -1
- package/dist/tokens/to-css.js +12 -12
- package/dist/tokens/to-css.js.map +1 -1
- package/package.json +8 -3
- package/dist/components/Checkbox/ChoiceRow.d.ts +0 -23
- package/dist/components/Checkbox/ChoiceRow.js +0 -57
- package/dist/components/Checkbox/ChoiceRow.js.map +0 -1
- package/dist/styles/hidden-value.css +0 -1
- package/dist/styles/iconbutton.css +0 -1
- package/dist/styles/search-field.css +0 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type AriaRole, type CSSProperties, type ReactNode } from "react";
|
|
2
|
+
import { type ContainerProps } from "../Container/Container.js";
|
|
3
|
+
import { type Space } from "../Stack/space.js";
|
|
4
|
+
export interface SectionTokens {
|
|
5
|
+
/** Space above and below the content when the `paddingBlock` prop is not set. */
|
|
6
|
+
paddingBlock: string;
|
|
7
|
+
/** Background of `variant="surface"`. */
|
|
8
|
+
surface: string;
|
|
9
|
+
/** Background of `variant="soft"`. */
|
|
10
|
+
soft: string;
|
|
11
|
+
/** Background of `variant="accent"`. */
|
|
12
|
+
accent: string;
|
|
13
|
+
}
|
|
14
|
+
declare module "../../tokens/schema.js" {
|
|
15
|
+
interface ComponentTokens {
|
|
16
|
+
section: SectionTokens;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export interface SectionProps {
|
|
20
|
+
/**
|
|
21
|
+
* The band's background: `plain` (none, the page shows through), `surface`, `soft` (a quiet tint) or `accent` (a
|
|
22
|
+
* soft tint of the accent colour). Text colours stay readable on each. Default "plain".
|
|
23
|
+
*/
|
|
24
|
+
variant?: "plain" | "surface" | "soft" | "accent";
|
|
25
|
+
/** Space token for the padding above and below the content. Default: the `--cy-section-padding-block` token. */
|
|
26
|
+
paddingBlock?: Space | undefined;
|
|
27
|
+
/** Put the content in a centred Container (the page column). `false` lets it fill the band. Default true. */
|
|
28
|
+
contained?: boolean;
|
|
29
|
+
/** Widest the inner Container gets (its `size`). Ignored when `contained` is false. Default "lg". */
|
|
30
|
+
size?: ContainerProps["size"];
|
|
31
|
+
/**
|
|
32
|
+
* The element rendered. A `section` is a region landmark only when it has a name (`aria-labelledby` or
|
|
33
|
+
* `aria-label`). Default "section".
|
|
34
|
+
*/
|
|
35
|
+
as?: "section" | "div" | "header" | "footer" | "aside" | "article";
|
|
36
|
+
/** Set on the root element: the target of in-page links such as `#pricing`. */
|
|
37
|
+
id?: string | undefined;
|
|
38
|
+
/** Names the section, usually the id of its heading. */
|
|
39
|
+
"aria-labelledby"?: string | undefined;
|
|
40
|
+
/** Names the section when it has no visible heading. */
|
|
41
|
+
"aria-label"?: string | undefined;
|
|
42
|
+
/** An ARIA role for the root, when the element's own role is not the right one. */
|
|
43
|
+
role?: AriaRole | undefined;
|
|
44
|
+
/** Added to the root element, for layout. */
|
|
45
|
+
className?: string | undefined;
|
|
46
|
+
/** Layout only. Restyle through --cy-section-* tokens. */
|
|
47
|
+
style?: CSSProperties;
|
|
48
|
+
/** The section's content. */
|
|
49
|
+
children?: ReactNode;
|
|
50
|
+
/** Set on the root element, for tests. */
|
|
51
|
+
"data-testid"?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* A full-width band of a page: a background, space above and below, and the content in the page column. Stack
|
|
55
|
+
* Sections to build a landing or documentation page.
|
|
56
|
+
*/
|
|
57
|
+
export declare const Section: import("react").ForwardRefExoticComponent<SectionProps & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { space as u } from "../Stack/space.js";
|
|
3
|
+
import { Container as v } from "../Container/Container.js";
|
|
4
|
+
import { forwardRef as x } from "react";
|
|
5
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
6
|
+
var g = x(function({ variant: n = "plain", paddingBlock: t, contained: i = !0, size: a = "lg", as: c = "section", className: o, style: s, children: r, ...m }, f) {
|
|
7
|
+
const p = c, l = t ? { "--_pad-block": u(t) } : {};
|
|
8
|
+
return /* @__PURE__ */ e(p, {
|
|
9
|
+
ref: f,
|
|
10
|
+
...m,
|
|
11
|
+
className: `cy-section${o ? ` ${o}` : ""}`,
|
|
12
|
+
"data-variant": n,
|
|
13
|
+
style: {
|
|
14
|
+
...l,
|
|
15
|
+
...s
|
|
16
|
+
},
|
|
17
|
+
children: i ? /* @__PURE__ */ e(v, {
|
|
18
|
+
size: a,
|
|
19
|
+
children: r
|
|
20
|
+
}) : r
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
export {
|
|
24
|
+
g as Section
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=Section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Section.js","names":["space","Container","forwardRef","jsx","Section","variant","paddingBlock","contained","size","as","className","style","children","rest","ref","Tag","vars"],"sources":["../../../src/components/Section/Section.tsx"],"sourcesContent":["import { type AriaRole, type CSSProperties, forwardRef, type ReactNode } from \"react\";\nimport { Container, type ContainerProps } from \"../Container/Container.js\";\nimport { type Space, space } from \"../Stack/space.js\";\n\nexport interface SectionTokens {\n /** Space above and below the content when the `paddingBlock` prop is not set. */\n paddingBlock: string;\n /** Background of `variant=\"surface\"`. */\n surface: string;\n /** Background of `variant=\"soft\"`. */\n soft: string;\n /** Background of `variant=\"accent\"`. */\n accent: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n section: SectionTokens;\n }\n}\n\nexport interface SectionProps {\n /**\n * The band's background: `plain` (none, the page shows through), `surface`, `soft` (a quiet tint) or `accent` (a\n * soft tint of the accent colour). Text colours stay readable on each. Default \"plain\".\n */\n variant?: \"plain\" | \"surface\" | \"soft\" | \"accent\";\n /** Space token for the padding above and below the content. Default: the `--cy-section-padding-block` token. */\n paddingBlock?: Space | undefined;\n /** Put the content in a centred Container (the page column). `false` lets it fill the band. Default true. */\n contained?: boolean;\n /** Widest the inner Container gets (its `size`). Ignored when `contained` is false. Default \"lg\". */\n size?: ContainerProps[\"size\"];\n /**\n * The element rendered. A `section` is a region landmark only when it has a name (`aria-labelledby` or\n * `aria-label`). Default \"section\".\n */\n as?: \"section\" | \"div\" | \"header\" | \"footer\" | \"aside\" | \"article\";\n /** Set on the root element: the target of in-page links such as `#pricing`. */\n id?: string | undefined;\n /** Names the section, usually the id of its heading. */\n \"aria-labelledby\"?: string | undefined;\n /** Names the section when it has no visible heading. */\n \"aria-label\"?: string | undefined;\n /** An ARIA role for the root, when the element's own role is not the right one. */\n role?: AriaRole | undefined;\n /** Added to the root element, for layout. */\n className?: string | undefined;\n /** Layout only. Restyle through --cy-section-* tokens. */\n style?: CSSProperties;\n /** The section's content. */\n children?: ReactNode;\n /** Set on the root element, for tests. */\n \"data-testid\"?: string;\n}\n\n/**\n * A full-width band of a page: a background, space above and below, and the content in the page column. Stack\n * Sections to build a landing or documentation page.\n */\nexport const Section = forwardRef<HTMLElement, SectionProps>(function Section(\n {\n variant = \"plain\",\n paddingBlock,\n contained = true,\n size = \"lg\",\n as = \"section\",\n className,\n style,\n children,\n ...rest\n },\n ref,\n) {\n const Tag = as;\n const vars = paddingBlock ? { \"--_pad-block\": space(paddingBlock) } : {};\n return (\n <Tag\n // One component, several elements: the ref is the element's own, typed as the common HTMLElement.\n ref={ref as never}\n {...rest}\n className={`cy-section${className ? ` ${className}` : \"\"}`}\n data-variant={variant}\n style={{ ...vars, ...style } as CSSProperties}\n >\n {contained ? <Container size={size}>{children}</Container> : children}\n </Tag>\n );\n});\n"],"mappings":";;;;;AA4DA,IAAaI,IAAUF,EAAsC,SAC3D,EACE,SAAAG,IAAU,SACV,cAAAC,GACA,WAAAC,IAAY,IACZ,MAAAC,IAAO,MACP,IAAAC,IAAK,WACL,WAAAC,GACA,OAAAC,GACA,UAAAC,GACA,GAAGC,EAAA,GAELC,GACA;AACA,QAAMC,IAAMN,GACNO,IAAOV,IAAe,EAAE,gBAAgBN,EAAMM,CAAY,EAAE,IAAI,CAAC;AACvE,SACE,gBAAAH,EAACY,GAAD;AAAA,IAEO,KAAAD;AAAA,IACL,GAAID;AAAA,IACJ,WAAW,aAAaH,IAAY,IAAIA,CAAA,KAAc,EAAA;AAAA,IACtD,gBAAcL;AAAA,IACd,OAAO;AAAA,MAAE,GAAGW;AAAA,MAAM,GAAGL;AAAA,IAAM;AAAA,IAE1B,UAAAJ,IAAY,gBAAAJ,EAACF,GAAD;AAAA,MAAiB,MAAAO;AAAA,MAAO,UAAAI;AAAA,IAAoB,CAAA,IAAIA;AAAA,EAC1D,CAAA;AAET,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Section, type SectionProps, type SectionTokens } from "./Section.js";
|
|
@@ -22,18 +22,27 @@ export interface SegmentOption {
|
|
|
22
22
|
export interface SegmentedControlProps {
|
|
23
23
|
/** Accessible name of the group. */
|
|
24
24
|
label: string;
|
|
25
|
+
/** The segments: `{ value, label, icon?, disabled? }`. */
|
|
25
26
|
options: SegmentOption[];
|
|
27
|
+
/** Submits the value with its form under this name. Two controls may share a name and stay independent. */
|
|
26
28
|
name?: string;
|
|
29
|
+
/** Controlled selected value. */
|
|
27
30
|
value?: string;
|
|
31
|
+
/** Selected value at first, when uncontrolled. */
|
|
28
32
|
defaultValue?: string;
|
|
33
|
+
/** Called with the segment's value when it is chosen. */
|
|
29
34
|
onChange?: (value: string) => void;
|
|
30
35
|
/** Show icons only; labels stay as accessible names. */
|
|
31
36
|
iconOnly?: boolean;
|
|
37
|
+
/** Stretch to the full width of the container. */
|
|
32
38
|
fullWidth?: boolean;
|
|
39
|
+
/** Disables every segment; the value is not submitted. */
|
|
33
40
|
disabled?: boolean;
|
|
41
|
+
/** Height and text size of the segments. Default "md". */
|
|
34
42
|
size?: Size;
|
|
35
43
|
/** Colour of the active segment's content. */
|
|
36
44
|
tone?: Tone;
|
|
45
|
+
/** Added to the root element, for layout. */
|
|
37
46
|
className?: string | undefined;
|
|
38
47
|
/** Layout only. */
|
|
39
48
|
style?: CSSProperties | undefined;
|
|
@@ -4,26 +4,26 @@ import { Icon as N } from "../../foundations/Icon/Icon.js";
|
|
|
4
4
|
import { ChoiceBase as j } from "../../foundations/ChoiceBase/ChoiceBase.js";
|
|
5
5
|
import { HiddenValue as k } from "../../foundations/HiddenValue/HiddenValue.js";
|
|
6
6
|
import { useId as I } from "react";
|
|
7
|
-
import { jsx as a, jsxs as
|
|
8
|
-
function R({ label:
|
|
9
|
-
const r = `cy-seg-${I()}`, [d, $, y] = x(
|
|
10
|
-
return /* @__PURE__ */
|
|
7
|
+
import { jsx as a, jsxs as m } from "react/jsx-runtime";
|
|
8
|
+
function R({ label: o, options: n, name: i, value: u, defaultValue: s, onChange: v, iconOnly: t = !1, fullWidth: b = !1, disabled: l, size: f = "md", tone: g = "neutral", className: c, style: h }) {
|
|
9
|
+
const r = `cy-seg-${I()}`, [d, $, y] = x(u, s, v);
|
|
10
|
+
return /* @__PURE__ */ m("div", {
|
|
11
11
|
role: "radiogroup",
|
|
12
|
-
"aria-label":
|
|
13
|
-
className: `cy-segmented${
|
|
12
|
+
"aria-label": o,
|
|
13
|
+
className: `cy-segmented-control${c ? ` ${c}` : ""}`,
|
|
14
14
|
"data-size": f,
|
|
15
15
|
"data-tone": g,
|
|
16
16
|
"data-full": b ? "" : void 0,
|
|
17
|
-
"data-icon-only":
|
|
17
|
+
"data-icon-only": t ? "" : void 0,
|
|
18
18
|
style: h,
|
|
19
19
|
children: [/* @__PURE__ */ a(k, {
|
|
20
|
-
name:
|
|
20
|
+
name: i,
|
|
21
21
|
value: d ?? "",
|
|
22
22
|
disabled: l || d === void 0,
|
|
23
23
|
onReset: () => y(s)
|
|
24
|
-
}), n.map((e) => /* @__PURE__ */
|
|
24
|
+
}), n.map((e) => /* @__PURE__ */ m("label", {
|
|
25
25
|
htmlFor: `${r}-${e.value}`,
|
|
26
|
-
className: "cy-segment",
|
|
26
|
+
className: "cy-segmented-control-segment",
|
|
27
27
|
"data-disabled": l || e.disabled ? "" : void 0,
|
|
28
28
|
children: [
|
|
29
29
|
/* @__PURE__ */ a(j, {
|
|
@@ -38,8 +38,8 @@ function R({ label: i, options: n, name: u, value: o, defaultValue: s, onChange:
|
|
|
38
38
|
onChange: (C) => C.currentTarget.checked && $(e.value)
|
|
39
39
|
}),
|
|
40
40
|
e.icon && /* @__PURE__ */ a(N, { icon: e.icon }),
|
|
41
|
-
!
|
|
42
|
-
className: "cy-
|
|
41
|
+
!t && /* @__PURE__ */ a("span", {
|
|
42
|
+
className: "cy-segmented-control-label",
|
|
43
43
|
children: e.label
|
|
44
44
|
})
|
|
45
45
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControl.js","names":["useControllableState","Icon","ChoiceBase","HiddenValue","useId","jsx","jsxs","SegmentedControl","label","options","name","value","defaultValue","onChange","iconOnly","fullWidth","disabled","size","tone","className","style","groupName","current","setCurrent","reset","option","e"],"sources":["../../../src/components/SegmentedControl/SegmentedControl.tsx"],"sourcesContent":["import { type CSSProperties, useId } from \"react\";\nimport { ChoiceBase } from \"../../foundations/ChoiceBase/ChoiceBase.js\";\nimport { useControllableState } from \"../../foundations/controllable.js\";\nimport { HiddenValue } from \"../../foundations/HiddenValue/HiddenValue.js\";\nimport { Icon } from \"../../foundations/Icon/Icon.js\";\nimport type { IconData } from \"../../icons/types.js\";\nimport type { Size, Tone } from \"../../tokens/schema.js\";\n\nexport interface SegmentedControlTokens {\n radius: string;\n trackBg: string;\n activeBg: string;\n padding: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n segmentedControl: SegmentedControlTokens;\n }\n}\n\nexport interface SegmentOption {\n value: string;\n /** Visible text, and always the accessible name (also for icon-only segments). */\n label: string;\n icon?: IconData;\n disabled?: boolean;\n}\n\nexport interface SegmentedControlProps {\n /** Accessible name of the group. */\n label: string;\n options: SegmentOption[];\n name?: string;\n value?: string;\n defaultValue?: string;\n onChange?: (value: string) => void;\n /** Show icons only; labels stay as accessible names. */\n iconOnly?: boolean;\n fullWidth?: boolean;\n disabled?: boolean;\n size?: Size;\n /** Colour of the active segment's content. */\n tone?: Tone;\n className?: string | undefined;\n /** Layout only. */\n style?: CSSProperties | undefined;\n}\n\n/** A compact single choice (view switchers, modes) on native radios. */\nexport function SegmentedControl({\n label,\n options,\n name,\n value,\n defaultValue,\n onChange,\n iconOnly = false,\n fullWidth = false,\n disabled,\n size = \"md\",\n tone = \"neutral\",\n className,\n style,\n}: SegmentedControlProps) {\n // The radios are grouped under a name of the control's own, never the caller's: two controls given the same\n // `name` (rows of a list, two panels) would otherwise be one native radio group with clashing ids, and choosing in\n // one would clear the other. The caller's `name` submits the value through a hidden field instead.\n const groupName = `cy-seg-${useId()}`;\n const [current, setCurrent, reset] = useControllableState<string, string | undefined>(\n value,\n defaultValue,\n onChange,\n );\n return (\n <div\n role=\"radiogroup\"\n aria-label={label}\n className={`cy-segmented${className ? ` ${className}` : \"\"}`}\n data-size={size}\n data-tone={tone}\n data-full={fullWidth ? \"\" : undefined}\n data-icon-only={iconOnly ? \"\" : undefined}\n style={style}\n >\n {/* Always present, so a form's reset restores the default; it submits only when there is a name and a value. */}\n <HiddenValue\n name={name}\n value={current ?? \"\"}\n disabled={disabled || current === undefined}\n onReset={() => reset(defaultValue)}\n />\n {options.map((option) => (\n <label\n key={option.value}\n htmlFor={`${groupName}-${option.value}`}\n className=\"cy-segment\"\n data-disabled={disabled || option.disabled ? \"\" : undefined}\n >\n <ChoiceBase\n id={`${groupName}-${option.value}`}\n type=\"radio\"\n name={groupName}\n // Belongs to no form: the hidden field above submits the value under the caller's name.\n form=\"\"\n value={option.value}\n disabled={disabled || option.disabled}\n aria-label={option.label}\n checked={current === option.value}\n onChange={(e) => e.currentTarget.checked && setCurrent(option.value)}\n />\n {option.icon && <Icon icon={option.icon} />}\n {!iconOnly && <span className=\"cy-
|
|
1
|
+
{"version":3,"file":"SegmentedControl.js","names":["useControllableState","Icon","ChoiceBase","HiddenValue","useId","jsx","jsxs","SegmentedControl","label","options","name","value","defaultValue","onChange","iconOnly","fullWidth","disabled","size","tone","className","style","groupName","current","setCurrent","reset","option","e"],"sources":["../../../src/components/SegmentedControl/SegmentedControl.tsx"],"sourcesContent":["import { type CSSProperties, useId } from \"react\";\nimport { ChoiceBase } from \"../../foundations/ChoiceBase/ChoiceBase.js\";\nimport { useControllableState } from \"../../foundations/controllable.js\";\nimport { HiddenValue } from \"../../foundations/HiddenValue/HiddenValue.js\";\nimport { Icon } from \"../../foundations/Icon/Icon.js\";\nimport type { IconData } from \"../../icons/types.js\";\nimport type { Size, Tone } from \"../../tokens/schema.js\";\n\nexport interface SegmentedControlTokens {\n radius: string;\n trackBg: string;\n activeBg: string;\n padding: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n segmentedControl: SegmentedControlTokens;\n }\n}\n\nexport interface SegmentOption {\n value: string;\n /** Visible text, and always the accessible name (also for icon-only segments). */\n label: string;\n icon?: IconData;\n disabled?: boolean;\n}\n\nexport interface SegmentedControlProps {\n /** Accessible name of the group. */\n label: string;\n /** The segments: `{ value, label, icon?, disabled? }`. */\n options: SegmentOption[];\n /** Submits the value with its form under this name. Two controls may share a name and stay independent. */\n name?: string;\n /** Controlled selected value. */\n value?: string;\n /** Selected value at first, when uncontrolled. */\n defaultValue?: string;\n /** Called with the segment's value when it is chosen. */\n onChange?: (value: string) => void;\n /** Show icons only; labels stay as accessible names. */\n iconOnly?: boolean;\n /** Stretch to the full width of the container. */\n fullWidth?: boolean;\n /** Disables every segment; the value is not submitted. */\n disabled?: boolean;\n /** Height and text size of the segments. Default \"md\". */\n size?: Size;\n /** Colour of the active segment's content. */\n tone?: Tone;\n /** Added to the root element, for layout. */\n className?: string | undefined;\n /** Layout only. */\n style?: CSSProperties | undefined;\n}\n\n/** A compact single choice (view switchers, modes) on native radios. */\nexport function SegmentedControl({\n label,\n options,\n name,\n value,\n defaultValue,\n onChange,\n iconOnly = false,\n fullWidth = false,\n disabled,\n size = \"md\",\n tone = \"neutral\",\n className,\n style,\n}: SegmentedControlProps) {\n // The radios are grouped under a name of the control's own, never the caller's: two controls given the same\n // `name` (rows of a list, two panels) would otherwise be one native radio group with clashing ids, and choosing in\n // one would clear the other. The caller's `name` submits the value through a hidden field instead.\n const groupName = `cy-seg-${useId()}`;\n const [current, setCurrent, reset] = useControllableState<string, string | undefined>(\n value,\n defaultValue,\n onChange,\n );\n return (\n <div\n role=\"radiogroup\"\n aria-label={label}\n className={`cy-segmented-control${className ? ` ${className}` : \"\"}`}\n data-size={size}\n data-tone={tone}\n data-full={fullWidth ? \"\" : undefined}\n data-icon-only={iconOnly ? \"\" : undefined}\n style={style}\n >\n {/* Always present, so a form's reset restores the default; it submits only when there is a name and a value. */}\n <HiddenValue\n name={name}\n value={current ?? \"\"}\n disabled={disabled || current === undefined}\n onReset={() => reset(defaultValue)}\n />\n {options.map((option) => (\n <label\n key={option.value}\n htmlFor={`${groupName}-${option.value}`}\n className=\"cy-segmented-control-segment\"\n data-disabled={disabled || option.disabled ? \"\" : undefined}\n >\n <ChoiceBase\n id={`${groupName}-${option.value}`}\n type=\"radio\"\n name={groupName}\n // Belongs to no form: the hidden field above submits the value under the caller's name.\n form=\"\"\n value={option.value}\n disabled={disabled || option.disabled}\n aria-label={option.label}\n checked={current === option.value}\n onChange={(e) => e.currentTarget.checked && setCurrent(option.value)}\n />\n {option.icon && <Icon icon={option.icon} />}\n {!iconOnly && <span className=\"cy-segmented-control-label\">{option.label}</span>}\n </label>\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;;;AA2DA,SAAgBO,EAAiB,EAC/B,OAAAC,GACA,SAAAC,GACA,MAAAC,GACA,OAAAC,GACA,cAAAC,GACA,UAAAC,GACA,UAAAC,IAAW,IACX,WAAAC,IAAY,IACZ,UAAAC,GACA,MAAAC,IAAO,MACP,MAAAC,IAAO,WACP,WAAAC,GACA,OAAAC,EAAA,GACwB;AAIxB,QAAMC,IAAY,UAAUjB,EAAM,CAAA,IAC5B,CAACkB,GAASC,GAAYC,CAAA,IAASxB,EACnCW,GACAC,GACAC,CACF;AACA,SACE,gBAAAP,EAAC,OAAD;AAAA,IACE,MAAK;AAAA,IACL,cAAYE;AAAA,IACZ,WAAW,uBAAuBW,IAAY,IAAIA,CAAA,KAAc,EAAA;AAAA,IAChE,aAAWF;AAAA,IACX,aAAWC;AAAA,IACX,aAAWH,IAAY,KAAK;AAAA,IAC5B,kBAAgBD,IAAW,KAAK;AAAA,IACzB,OAAAM;AAAA,IART,UAAA,CAWE,gBAAAf,EAACF,GAAD;AAAA,MACQ,MAAAO;AAAA,MACN,OAAOY,KAAW;AAAA,MAClB,UAAUN,KAAYM,MAAY;AAAA,MAClC,SAAA,MAAeE,EAAMZ,CAAY;AAAA,IAClC,CAAA,GACAH,EAAQ,IAAA,CAAKgB,MACZ,gBAAAnB,EAAC,SAAD;AAAA,MAEE,SAAS,GAAGe,CAAA,IAAaI,EAAO,KAAA;AAAA,MAChC,WAAU;AAAA,MACV,iBAAeT,KAAYS,EAAO,WAAW,KAAK;AAAA,MAJpD,UAAA;AAAA,QAME,gBAAApB,EAACH,GAAD;AAAA,UACE,IAAI,GAAGmB,CAAA,IAAaI,EAAO,KAAA;AAAA,UAC3B,MAAK;AAAA,UACL,MAAMJ;AAAA,UAEN,MAAK;AAAA,UACL,OAAOI,EAAO;AAAA,UACd,UAAUT,KAAYS,EAAO;AAAA,UAC7B,cAAYA,EAAO;AAAA,UACnB,SAASH,MAAYG,EAAO;AAAA,UAC5B,UAAA,CAAWC,MAAMA,EAAE,cAAc,WAAWH,EAAWE,EAAO,KAAK;AAAA,QACpE,CAAA;AAAA,QACAA,EAAO,QAAQ,gBAAApB,EAACJ,GAAD,EAAM,MAAMwB,EAAO,KAAO,CAAA;AAAA,QACzC,CAACX,KAAY,gBAAAT,EAAC,QAAD;AAAA,UAAM,WAAU;AAAA,UAA8B,UAAAoB,EAAO;AAAA,QAAY,CAAA;AAAA,MAC1E;AAAA,IAnBA,GAAAA,EAAO,KAmBP,CACR,CACE;AAAA,E;AAET"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactNode } from "react";
|
|
2
|
+
import { type OptionIconColor } from "../../foundations/option-icon.js";
|
|
2
3
|
import type { IconData } from "../../icons/types.js";
|
|
3
4
|
import type { Size } from "../../tokens/schema.js";
|
|
4
5
|
export interface SelectTokens {
|
|
@@ -15,36 +16,52 @@ declare module "../../tokens/schema.js" {
|
|
|
15
16
|
select: SelectTokens;
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
|
-
export interface SelectOption {
|
|
19
|
+
export interface SelectOption extends OptionIconColor {
|
|
19
20
|
value: string;
|
|
20
21
|
label: string;
|
|
21
22
|
description?: string;
|
|
23
|
+
/** Icon before the label, in the list and in the trigger when chosen. Colour it with `iconTone` or `iconColor`. */
|
|
22
24
|
icon?: IconData;
|
|
23
25
|
disabled?: boolean;
|
|
24
26
|
/** Options next to each other with the same `group` are listed under that heading. */
|
|
25
27
|
group?: string;
|
|
26
28
|
}
|
|
27
29
|
export interface SelectProps {
|
|
30
|
+
/** Names the control, shown above it. */
|
|
28
31
|
label: ReactNode;
|
|
29
32
|
/** Visually hide the label (it still names the control). Prefer visible labels. */
|
|
30
33
|
labelHidden?: boolean | undefined;
|
|
34
|
+
/** Help text shown below the control. */
|
|
31
35
|
description?: ReactNode;
|
|
36
|
+
/** Your own error; it replaces the built-in required message. */
|
|
32
37
|
error?: ReactNode;
|
|
38
|
+
/** The choices: `{ value, label, description?, icon?, iconTone?, iconColor?, disabled?, group? }`. */
|
|
33
39
|
options: SelectOption[];
|
|
40
|
+
/** Controlled selected value. */
|
|
34
41
|
value?: string;
|
|
42
|
+
/** Selected value at first, when uncontrolled. */
|
|
35
43
|
defaultValue?: string;
|
|
44
|
+
/** Called with the chosen option's value when it changes. */
|
|
36
45
|
onChange?: (value: string) => void;
|
|
46
|
+
/** Shown while nothing is chosen. Default "Select…". */
|
|
37
47
|
placeholder?: string;
|
|
48
|
+
/** Submits the value with its form under this name. */
|
|
38
49
|
name?: string;
|
|
50
|
+
/** The form will not submit until a value is chosen; also draws the required marker. */
|
|
39
51
|
required?: boolean;
|
|
52
|
+
/** Cannot be opened or changed, and is not submitted. */
|
|
40
53
|
disabled?: boolean;
|
|
54
|
+
/** Height and text size of the control. Default "md". */
|
|
41
55
|
size?: Size;
|
|
56
|
+
/** `outline`, or `soft` (tinted, no border). Default "outline". */
|
|
42
57
|
variant?: "outline" | "soft";
|
|
58
|
+
/** Replace the built-in English text: the placeholder, the empty list and the required message. */
|
|
43
59
|
labels?: {
|
|
44
60
|
placeholder?: string;
|
|
45
61
|
empty?: string;
|
|
46
62
|
required?: string;
|
|
47
63
|
};
|
|
64
|
+
/** Added to the root element, for layout. */
|
|
48
65
|
className?: string;
|
|
49
66
|
/** Layout only. */
|
|
50
67
|
style?: CSSProperties;
|
|
@@ -1,61 +1,63 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useControllableState as
|
|
3
|
-
import { ButtonBase as
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { chevronDown as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
2
|
+
import { useControllableState as _ } from "../../foundations/controllable.js";
|
|
3
|
+
import { ButtonBase as ee } from "../../foundations/ButtonBase/ButtonBase.js";
|
|
4
|
+
import { Icon as te } from "../../foundations/Icon/Icon.js";
|
|
5
|
+
import { chevronDown as re } from "../../icons/chevron-down.js";
|
|
6
|
+
import { isTypeaheadKey as q, seekEnabled as ae, useTypeahead as se } from "../../foundations/listbox.js";
|
|
7
|
+
import { OptionIcon as B } from "../../foundations/option-icon.js";
|
|
8
|
+
import { isComposing as le } from "../../foundations/keys.js";
|
|
9
|
+
import { Field as oe } from "../Field/Field.js";
|
|
10
|
+
import { HiddenValue as ce } from "../../foundations/HiddenValue/HiddenValue.js";
|
|
11
|
+
import { useListboxLayer as ne } from "../../overlay/listbox-layer.js";
|
|
12
|
+
import { OptionList as ie, OptionListGroup as de, OptionListItem as ue, OptionListNote as fe } from "../OptionList/OptionList.js";
|
|
13
|
+
import { Fragment as pe, useCallback as me, useEffect as ve, useId as he, useRef as j, useState as L } from "react";
|
|
14
|
+
import { jsx as s, jsxs as O } from "react/jsx-runtime";
|
|
13
15
|
var F = 10;
|
|
14
|
-
function
|
|
16
|
+
function ge(D) {
|
|
15
17
|
const d = [];
|
|
16
|
-
return
|
|
17
|
-
const
|
|
18
|
-
|
|
18
|
+
return D.forEach((u, m) => {
|
|
19
|
+
const r = d[d.length - 1];
|
|
20
|
+
r && r.group === u.group ? r.items.push({
|
|
19
21
|
option: u,
|
|
20
|
-
index:
|
|
22
|
+
index: m
|
|
21
23
|
}) : d.push({
|
|
22
24
|
group: u.group,
|
|
23
|
-
start:
|
|
25
|
+
start: m,
|
|
24
26
|
items: [{
|
|
25
27
|
option: u,
|
|
26
|
-
index:
|
|
28
|
+
index: m
|
|
27
29
|
}]
|
|
28
30
|
});
|
|
29
31
|
}), d;
|
|
30
32
|
}
|
|
31
|
-
function
|
|
32
|
-
const
|
|
33
|
-
const e =
|
|
34
|
-
!e || e.disabled || (
|
|
33
|
+
function Pe({ label: D, labelHidden: d, description: u, error: m, options: r, value: G, defaultValue: k = "", onChange: H, placeholder: K, name: R, required: I, disabled: $, size: P = "md", variant: V = "outline", labels: g, className: W, style: z }) {
|
|
34
|
+
const v = `cy-select-${he().replace(/:/g, "")}`, b = j(null), C = j(null), [n, M, J] = _(G, k, H), [c, S] = L(!1), [a, y] = L(-1), Q = se(), [X, E] = L(!1), h = (t) => t >= 0 && t < r.length && !r[t]?.disabled, f = (t, e) => ae(r.length, t, e, h), T = () => f(-1, 1), x = () => f(r.length, -1), N = me((t) => {
|
|
35
|
+
const e = r[t];
|
|
36
|
+
!e || e.disabled || (E(!1), e.value !== n && M(e.value));
|
|
35
37
|
}, [
|
|
36
|
-
|
|
38
|
+
r,
|
|
37
39
|
n,
|
|
38
|
-
|
|
39
|
-
]),
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
const e =
|
|
43
|
-
|
|
40
|
+
M
|
|
41
|
+
]), p = (t = !0) => {
|
|
42
|
+
S(!1), t && b.current?.focus();
|
|
43
|
+
}, A = (t) => {
|
|
44
|
+
const e = r.findIndex((l) => l.value === n);
|
|
45
|
+
y(t ?? (h(e) ? e : T())), S(!0);
|
|
44
46
|
};
|
|
45
|
-
|
|
46
|
-
anchor:
|
|
47
|
-
list:
|
|
47
|
+
ne({
|
|
48
|
+
anchor: b,
|
|
49
|
+
list: C,
|
|
48
50
|
open: c,
|
|
49
|
-
onClose: () =>
|
|
51
|
+
onClose: () => p(!1),
|
|
50
52
|
capWidth: !0
|
|
51
|
-
}),
|
|
52
|
-
!c ||
|
|
53
|
-
}, [c,
|
|
54
|
-
const
|
|
55
|
-
const e = Q(t,
|
|
56
|
-
e >= 0 && (c ?
|
|
53
|
+
}), ve(() => {
|
|
54
|
+
!c || a < 0 || C.current?.querySelector(`[data-index="${a}"]`)?.scrollIntoView({ block: "nearest" });
|
|
55
|
+
}, [c, a]);
|
|
56
|
+
const U = (t) => {
|
|
57
|
+
const e = Q(t, r.map((l, o) => h(o) ? l.label : null), a);
|
|
58
|
+
e >= 0 && (c ? y(e) : A(e));
|
|
57
59
|
}, Y = (t) => {
|
|
58
|
-
if (
|
|
60
|
+
if (le(t)) return;
|
|
59
61
|
const { key: e } = t;
|
|
60
62
|
if (!c) {
|
|
61
63
|
[
|
|
@@ -63,127 +65,107 @@ function xe({ label: N, labelHidden: d, description: u, error: h, options: a, va
|
|
|
63
65
|
"ArrowUp",
|
|
64
66
|
"Enter",
|
|
65
67
|
" "
|
|
66
|
-
].includes(e) ? (t.preventDefault(),
|
|
68
|
+
].includes(e) ? (t.preventDefault(), A(e === "ArrowUp" ? x() : void 0)) : q(t) && U(e);
|
|
67
69
|
return;
|
|
68
70
|
}
|
|
69
|
-
const
|
|
70
|
-
ArrowDown: () => f(
|
|
71
|
-
ArrowUp: () => f(
|
|
72
|
-
Home:
|
|
73
|
-
End:
|
|
74
|
-
PageDown: () => f(Math.min(
|
|
75
|
-
PageUp: () => f(Math.max(
|
|
71
|
+
const l = {
|
|
72
|
+
ArrowDown: () => f(a, 1),
|
|
73
|
+
ArrowUp: () => f(a, -1),
|
|
74
|
+
Home: T,
|
|
75
|
+
End: x,
|
|
76
|
+
PageDown: () => f(Math.min(a + F - 1, r.length - 1), 1),
|
|
77
|
+
PageUp: () => f(Math.max(a - F + 1, 0), -1)
|
|
76
78
|
};
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
return /* @__PURE__ */ s(
|
|
80
|
-
label:
|
|
79
|
+
l[e] ? (t.preventDefault(), y(l[e]())) : e === "Enter" || e === " " ? (t.preventDefault(), N(a), p()) : e === "Escape" ? (t.preventDefault(), p()) : e === "Tab" ? (N(a), p(!1)) : q(t) && U(e);
|
|
80
|
+
}, w = r.find((t) => t.value === n), Z = K ?? g?.placeholder ?? "Select…";
|
|
81
|
+
return /* @__PURE__ */ s(oe, {
|
|
82
|
+
label: D,
|
|
81
83
|
labelHidden: d,
|
|
82
84
|
description: u,
|
|
83
|
-
error:
|
|
84
|
-
required:
|
|
85
|
-
size:
|
|
85
|
+
error: m ?? (X && !n ? g?.required ?? "Please choose a value." : void 0),
|
|
86
|
+
required: I,
|
|
87
|
+
size: P,
|
|
86
88
|
className: W,
|
|
87
89
|
style: z,
|
|
88
|
-
children: (t) => /* @__PURE__ */
|
|
90
|
+
children: (t) => /* @__PURE__ */ O("div", {
|
|
89
91
|
className: "cy-select",
|
|
90
|
-
"data-size":
|
|
92
|
+
"data-size": P,
|
|
91
93
|
"data-variant": V,
|
|
92
94
|
children: [
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
ref:
|
|
95
|
+
/* @__PURE__ */ O(ee, {
|
|
96
|
+
ref: b,
|
|
95
97
|
id: t.id,
|
|
96
98
|
role: "combobox",
|
|
97
99
|
className: "cy-select-trigger",
|
|
98
100
|
"aria-labelledby": t.labelId,
|
|
99
101
|
"aria-describedby": t.describedBy,
|
|
100
102
|
"aria-invalid": t.invalid || void 0,
|
|
101
|
-
"aria-required":
|
|
103
|
+
"aria-required": I || void 0,
|
|
102
104
|
"aria-haspopup": "listbox",
|
|
103
105
|
"aria-expanded": c,
|
|
104
|
-
"aria-controls":
|
|
105
|
-
"aria-activedescendant": c &&
|
|
106
|
-
disabled:
|
|
107
|
-
onClick: () => c ?
|
|
106
|
+
"aria-controls": v,
|
|
107
|
+
"aria-activedescendant": c && a >= 0 ? `${v}-${a}` : void 0,
|
|
108
|
+
disabled: $,
|
|
109
|
+
onClick: () => c ? p() : A(),
|
|
108
110
|
onKeyDown: Y,
|
|
109
111
|
children: [
|
|
110
|
-
|
|
112
|
+
w && /* @__PURE__ */ s(B, {
|
|
113
|
+
option: w,
|
|
114
|
+
plain: $,
|
|
115
|
+
className: "cy-select-icon"
|
|
116
|
+
}),
|
|
111
117
|
/* @__PURE__ */ s("span", {
|
|
112
118
|
className: "cy-select-value",
|
|
113
|
-
"data-placeholder":
|
|
114
|
-
children:
|
|
119
|
+
"data-placeholder": w ? void 0 : "",
|
|
120
|
+
children: w?.label ?? Z
|
|
115
121
|
}),
|
|
116
|
-
/* @__PURE__ */ s(
|
|
117
|
-
icon:
|
|
122
|
+
/* @__PURE__ */ s(te, {
|
|
123
|
+
icon: re,
|
|
118
124
|
className: "cy-select-chevron"
|
|
119
125
|
})
|
|
120
126
|
]
|
|
121
127
|
}),
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
ref:
|
|
124
|
-
id:
|
|
125
|
-
role: "listbox",
|
|
128
|
+
/* @__PURE__ */ O(ie, {
|
|
129
|
+
ref: C,
|
|
130
|
+
id: v,
|
|
126
131
|
"aria-labelledby": t.labelId,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
role: "option",
|
|
131
|
-
"aria-disabled": "true",
|
|
132
|
-
"aria-selected": "false",
|
|
133
|
-
tabIndex: -1,
|
|
134
|
-
className: "cy-select-empty",
|
|
135
|
-
children: b?.empty ?? "No options"
|
|
136
|
-
}), fe(a).map((e) => {
|
|
137
|
-
const o = e.items.map(({ option: l, index: i }) => /* @__PURE__ */ v("div", {
|
|
138
|
-
id: `${p}-${i}`,
|
|
139
|
-
role: "option",
|
|
132
|
+
children: [r.length === 0 && /* @__PURE__ */ s(fe, { children: g?.empty ?? "No options" }), ge(r).map((e) => {
|
|
133
|
+
const l = e.items.map(({ option: o, index: i }) => /* @__PURE__ */ s(ue, {
|
|
134
|
+
id: `${v}-${i}`,
|
|
140
135
|
"data-index": i,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
136
|
+
label: o.label,
|
|
137
|
+
description: o.description,
|
|
138
|
+
icon: /* @__PURE__ */ s(B, {
|
|
139
|
+
option: o,
|
|
140
|
+
plain: o.disabled,
|
|
141
|
+
className: "cy-select-icon"
|
|
142
|
+
}),
|
|
143
|
+
selected: o.value === n,
|
|
144
|
+
disabled: o.disabled,
|
|
145
|
+
active: i === a,
|
|
146
|
+
onPointerMove: () => h(i) && y(i),
|
|
148
147
|
onClick: () => {
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
className: "cy-select-option-label",
|
|
157
|
-
children: l.label
|
|
158
|
-
}), l.description && /* @__PURE__ */ s("span", {
|
|
159
|
-
className: "cy-select-option-description",
|
|
160
|
-
children: l.description
|
|
161
|
-
})]
|
|
162
|
-
})]
|
|
163
|
-
}, l.value));
|
|
164
|
-
return e.group === void 0 ? /* @__PURE__ */ s(ie, { children: o }, `run-${e.start}`) : /* @__PURE__ */ v("div", {
|
|
165
|
-
role: "group",
|
|
166
|
-
"aria-labelledby": `${p}-g${e.start}`,
|
|
167
|
-
children: [/* @__PURE__ */ s("div", {
|
|
168
|
-
id: `${p}-g${e.start}`,
|
|
169
|
-
className: "cy-select-group",
|
|
170
|
-
role: "presentation",
|
|
171
|
-
children: e.group
|
|
172
|
-
}), o]
|
|
148
|
+
h(i) && (N(i), p());
|
|
149
|
+
}
|
|
150
|
+
}, o.value));
|
|
151
|
+
return e.group === void 0 ? /* @__PURE__ */ s(pe, { children: l }, `run-${e.start}`) : /* @__PURE__ */ s(de, {
|
|
152
|
+
id: `${v}-g${e.start}`,
|
|
153
|
+
label: e.group,
|
|
154
|
+
children: l
|
|
173
155
|
}, `group-${e.start}`);
|
|
174
156
|
})]
|
|
175
157
|
}),
|
|
176
|
-
/* @__PURE__ */ s(
|
|
177
|
-
name:
|
|
158
|
+
/* @__PURE__ */ s(ce, {
|
|
159
|
+
name: R,
|
|
178
160
|
value: n,
|
|
179
|
-
required:
|
|
180
|
-
disabled:
|
|
181
|
-
requiredMessage:
|
|
161
|
+
required: I,
|
|
162
|
+
disabled: $,
|
|
163
|
+
requiredMessage: g?.required ?? "Please choose a value.",
|
|
182
164
|
onReset: () => {
|
|
183
|
-
J(k),
|
|
165
|
+
J(k), E(!1);
|
|
184
166
|
},
|
|
185
167
|
onInvalid: (e) => {
|
|
186
|
-
e.preventDefault(),
|
|
168
|
+
e.preventDefault(), E(!0), b.current?.focus();
|
|
187
169
|
}
|
|
188
170
|
})
|
|
189
171
|
]
|
|
@@ -191,7 +173,7 @@ function xe({ label: N, labelHidden: d, description: u, error: h, options: a, va
|
|
|
191
173
|
});
|
|
192
174
|
}
|
|
193
175
|
export {
|
|
194
|
-
|
|
176
|
+
Pe as Select
|
|
195
177
|
};
|
|
196
178
|
|
|
197
179
|
//# sourceMappingURL=Select.js.map
|