@arshad-shah/cynosure 0.4.0 → 0.5.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 +6 -6
- package/dist/_virtual/_rolldown/runtime.js +12 -0
- package/dist/adapters/astro/index.d.ts +2 -1
- package/dist/adapters/astro/index.js.map +1 -1
- package/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Accordion/Accordion.js +26 -26
- package/dist/components/Accordion/Accordion.js.map +1 -1
- package/dist/components/Announcer/Announcer.d.ts +2 -1
- package/dist/components/Announcer/Announcer.js +31 -33
- package/dist/components/Announcer/Announcer.js.map +1 -1
- package/dist/components/AppShell/AppShell.js +44 -41
- package/dist/components/AppShell/AppShell.js.map +1 -1
- package/dist/components/Badge/Badge.d.ts +19 -5
- package/dist/components/Badge/Badge.js +19 -13
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/Button/Button.d.ts +13 -3
- package/dist/components/Button/Button.js +34 -33
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Calendar/Calendar.js +155 -158
- package/dist/components/Calendar/Calendar.js.map +1 -1
- package/dist/components/Calendar/dates.js +42 -38
- package/dist/components/Calendar/dates.js.map +1 -1
- package/dist/components/Card/Card.d.ts +14 -1
- package/dist/components/Card/Card.js +60 -52
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/ChatMessage/ChatMessage.d.ts +55 -0
- package/dist/components/ChatMessage/ChatMessage.js +50 -0
- package/dist/components/ChatMessage/ChatMessage.js.map +1 -0
- package/dist/components/ChatMessage/index.d.ts +1 -0
- package/dist/components/CodeBlock/CodeBlock.d.ts +6 -1
- package/dist/components/CodeBlock/CodeBlock.js +40 -37
- package/dist/components/CodeBlock/CodeBlock.js.map +1 -1
- package/dist/components/ColorField/ColorField.d.ts +3 -2
- package/dist/components/ColorField/ColorField.js +138 -139
- package/dist/components/ColorField/ColorField.js.map +1 -1
- package/dist/components/ColorField/read-color.js +5 -6
- package/dist/components/ColorField/read-color.js.map +1 -1
- package/dist/components/ColorSwatches/ColorSwatches.js +42 -33
- package/dist/components/ColorSwatches/ColorSwatches.js.map +1 -1
- package/dist/components/Combobox/Combobox.d.ts +13 -2
- package/dist/components/Combobox/Combobox.js +113 -95
- package/dist/components/Combobox/Combobox.js.map +1 -1
- package/dist/components/CommandPalette/CommandPalette.d.ts +14 -1
- package/dist/components/CommandPalette/CommandPalette.js +153 -109
- package/dist/components/CommandPalette/CommandPalette.js.map +1 -1
- package/dist/components/CommandPalette/index.d.ts +1 -1
- package/dist/components/CompareSlider/CompareSlider.js +14 -14
- package/dist/components/CompareSlider/CompareSlider.js.map +1 -1
- package/dist/components/Container/Container.d.ts +1 -1
- package/dist/components/Container/Container.js +1 -1
- package/dist/components/Container/Container.js.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.d.ts +27 -13
- package/dist/components/ContextMenu/ContextMenu.js +64 -46
- package/dist/components/ContextMenu/ContextMenu.js.map +1 -1
- package/dist/components/CopyButton/CopyButton.js +38 -39
- package/dist/components/CopyButton/CopyButton.js.map +1 -1
- package/dist/components/DataGrid/DataGrid.d.ts +135 -0
- package/dist/components/DataGrid/DataGrid.js +385 -0
- package/dist/components/DataGrid/DataGrid.js.map +1 -0
- package/dist/components/DataGrid/index.d.ts +1 -0
- package/dist/components/DateField/DateField.d.ts +4 -3
- package/dist/components/DateField/DateField.js +70 -59
- package/dist/components/DateField/DateField.js.map +1 -1
- package/dist/components/Dialog/Dialog.js +76 -80
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Disclosure/Disclosure.d.ts +15 -1
- package/dist/components/Disclosure/Disclosure.js +37 -30
- package/dist/components/Disclosure/Disclosure.js.map +1 -1
- package/dist/components/DocumentViewport/DocumentViewport.js +54 -57
- package/dist/components/DocumentViewport/DocumentViewport.js.map +1 -1
- package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +59 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.js +53 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.js.map +1 -0
- package/dist/components/ErrorBoundary/index.d.ts +1 -0
- package/dist/components/Field/Field.d.ts +38 -5
- package/dist/components/Field/Field.js +47 -39
- package/dist/components/Field/Field.js.map +1 -1
- package/dist/components/Field/index.d.ts +1 -1
- package/dist/components/FileDrop/FileDrop.d.ts +26 -1
- package/dist/components/FileDrop/FileDrop.js +149 -98
- package/dist/components/FileDrop/FileDrop.js.map +1 -1
- package/dist/components/FloatingToolbar/FloatingToolbar.js +83 -81
- package/dist/components/FloatingToolbar/FloatingToolbar.js.map +1 -1
- package/dist/components/Grid/Grid.d.ts +3 -3
- package/dist/components/Grid/Grid.js +55 -47
- package/dist/components/Grid/Grid.js.map +1 -1
- package/dist/components/HighlightedText/HighlightedText.d.ts +40 -0
- package/dist/components/HighlightedText/HighlightedText.js +36 -0
- package/dist/components/HighlightedText/HighlightedText.js.map +1 -0
- package/dist/components/HighlightedText/index.d.ts +2 -0
- package/dist/components/HotkeyField/HotkeyField.d.ts +84 -0
- package/dist/components/HotkeyField/HotkeyField.js +161 -0
- package/dist/components/HotkeyField/HotkeyField.js.map +1 -0
- package/dist/components/HotkeyField/index.d.ts +1 -0
- package/dist/components/HoverCard/HoverCard.js +6 -6
- package/dist/components/HoverCard/HoverCard.js.map +1 -1
- package/dist/components/IconButton/IconButton.js +16 -15
- package/dist/components/IconButton/IconButton.js.map +1 -1
- package/dist/components/Inline/Inline.d.ts +2 -2
- package/dist/components/Inline/Inline.js.map +1 -1
- package/dist/components/Kbd/Kbd.d.ts +0 -2
- package/dist/components/Kbd/Kbd.js +16 -22
- package/dist/components/Kbd/Kbd.js.map +1 -1
- package/dist/components/KeyValueEditor/bulk.js +3 -4
- package/dist/components/KeyValueEditor/bulk.js.map +1 -1
- package/dist/components/ListRow/ListRow.d.ts +105 -0
- package/dist/components/ListRow/ListRow.js +164 -0
- package/dist/components/ListRow/ListRow.js.map +1 -0
- package/dist/components/ListRow/index.d.ts +1 -0
- package/dist/components/LoadingDots/LoadingDots.d.ts +7 -2
- package/dist/components/LoadingDots/LoadingDots.js +28 -18
- package/dist/components/LoadingDots/LoadingDots.js.map +1 -1
- package/dist/components/Menu/Menu.d.ts +29 -11
- package/dist/components/Menu/Menu.js +204 -111
- package/dist/components/Menu/Menu.js.map +1 -1
- package/dist/components/Menubar/Menubar.d.ts +40 -0
- package/dist/components/Menubar/Menubar.js +82 -0
- package/dist/components/Menubar/Menubar.js.map +1 -0
- package/dist/components/Menubar/index.d.ts +1 -0
- package/dist/components/Notice/Notice.d.ts +11 -2
- package/dist/components/Notice/Notice.js +31 -28
- package/dist/components/Notice/Notice.js.map +1 -1
- package/dist/components/NumberField/NumberField.d.ts +8 -3
- package/dist/components/NumberField/NumberField.js +151 -100
- package/dist/components/NumberField/NumberField.js.map +1 -1
- package/dist/components/OptionList/OptionList.d.ts +36 -3
- package/dist/components/OptionList/OptionList.js +65 -42
- package/dist/components/OptionList/OptionList.js.map +1 -1
- package/dist/components/OptionList/index.d.ts +1 -1
- package/dist/components/OverlayFrame/OverlayFrame.d.ts +33 -0
- package/dist/components/OverlayFrame/OverlayFrame.js +20 -0
- package/dist/components/OverlayFrame/OverlayFrame.js.map +1 -0
- package/dist/components/OverlayFrame/index.d.ts +1 -0
- package/dist/components/PanZoomCanvas/PanZoomCanvas.d.ts +71 -4
- package/dist/components/PanZoomCanvas/PanZoomCanvas.js +197 -141
- package/dist/components/PanZoomCanvas/PanZoomCanvas.js.map +1 -1
- package/dist/components/PanZoomCanvas/index.d.ts +1 -1
- package/dist/components/PathField/PathField.d.ts +68 -0
- package/dist/components/PathField/PathField.js +67 -0
- package/dist/components/PathField/PathField.js.map +1 -0
- package/dist/components/PathField/index.d.ts +1 -0
- package/dist/components/Popover/Popover.d.ts +16 -3
- package/dist/components/Popover/Popover.js +51 -42
- package/dist/components/Popover/Popover.js.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.d.ts +4 -3
- package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/components/RowActions/RowActions.d.ts +35 -0
- package/dist/components/RowActions/RowActions.js +38 -0
- package/dist/components/RowActions/RowActions.js.map +1 -0
- package/dist/components/RowActions/index.d.ts +1 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts +55 -0
- package/dist/components/ScrollArea/ScrollArea.js +55 -0
- package/dist/components/ScrollArea/ScrollArea.js.map +1 -0
- package/dist/components/ScrollArea/index.d.ts +1 -0
- package/dist/components/SearchField/SearchField.d.ts +17 -0
- package/dist/components/SearchField/SearchField.js +31 -17
- package/dist/components/SearchField/SearchField.js.map +1 -1
- package/dist/components/SearchField/index.d.ts +1 -1
- package/dist/components/Section/Section.d.ts +1 -1
- package/dist/components/Section/Section.js +1 -1
- package/dist/components/Section/Section.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +6 -3
- package/dist/components/SegmentedControl/SegmentedControl.js +23 -19
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/components/Select/Select.d.ts +22 -6
- package/dist/components/Select/Select.js +155 -129
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/SelectionFrame/frame-math.js +19 -20
- package/dist/components/SelectionFrame/frame-math.js.map +1 -1
- package/dist/components/SideNav/SideNav.d.ts +13 -1
- package/dist/components/SideNav/SideNav.js +98 -91
- package/dist/components/SideNav/SideNav.js.map +1 -1
- package/dist/components/SignaturePad/SignaturePad.js +63 -62
- package/dist/components/SignaturePad/SignaturePad.js.map +1 -1
- package/dist/components/SignaturePad/ink.js +0 -1
- package/dist/components/SignaturePad/ink.js.map +1 -1
- package/dist/components/Slider/Slider.js +88 -91
- package/dist/components/Slider/Slider.js.map +1 -1
- package/dist/components/SortButton/SortButton.d.ts +36 -0
- package/dist/components/SortButton/SortButton.js +35 -0
- package/dist/components/SortButton/SortButton.js.map +1 -0
- package/dist/components/SortButton/index.d.ts +1 -0
- package/dist/components/SortableList/SortableList.js +145 -119
- package/dist/components/SortableList/SortableList.js.map +1 -1
- package/dist/components/SplitPane/SplitPane.d.ts +32 -12
- package/dist/components/SplitPane/SplitPane.js +105 -59
- package/dist/components/SplitPane/SplitPane.js.map +1 -1
- package/dist/components/Stack/Stack.d.ts +2 -2
- package/dist/components/Stack/Stack.js +24 -17
- package/dist/components/Stack/Stack.js.map +1 -1
- package/dist/components/Stack/index.d.ts +1 -1
- package/dist/components/Stat/Stat.js +6 -6
- package/dist/components/Stat/Stat.js.map +1 -1
- package/dist/components/StatusBar/StatusBar.d.ts +95 -0
- package/dist/components/StatusBar/StatusBar.js +110 -0
- package/dist/components/StatusBar/StatusBar.js.map +1 -0
- package/dist/components/StatusBar/index.d.ts +1 -0
- package/dist/components/Table/Table.d.ts +6 -6
- package/dist/components/Table/Table.js +71 -99
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +51 -5
- package/dist/components/Tabs/Tabs.js +289 -171
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/TagInput/TagInput.d.ts +10 -2
- package/dist/components/TagInput/TagInput.js +121 -111
- package/dist/components/TagInput/TagInput.js.map +1 -1
- package/dist/components/Text/Text.d.ts +6 -0
- package/dist/components/Text/Text.js +18 -17
- package/dist/components/Text/Text.js.map +1 -1
- package/dist/components/TextArea/TextArea.d.ts +37 -6
- package/dist/components/TextArea/TextArea.js +200 -72
- package/dist/components/TextArea/TextArea.js.map +1 -1
- package/dist/components/TextArea/index.d.ts +1 -1
- package/dist/components/TextField/TextField.d.ts +18 -6
- package/dist/components/TextField/TextField.js +59 -54
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/TimeField/TimeField.d.ts +4 -3
- package/dist/components/TimeField/TimeField.js +197 -183
- package/dist/components/TimeField/TimeField.js.map +1 -1
- package/dist/components/TitleBar/TitleBar.d.ts +91 -0
- package/dist/components/TitleBar/TitleBar.js +80 -0
- package/dist/components/TitleBar/TitleBar.js.map +1 -0
- package/dist/components/TitleBar/index.d.ts +1 -0
- package/dist/components/Toast/Toast.d.ts +17 -2
- package/dist/components/Toast/Toast.js +162 -145
- package/dist/components/Toast/Toast.js.map +1 -1
- package/dist/components/Toast/index.d.ts +1 -1
- package/dist/components/Toolbar/Toolbar.js +11 -12
- package/dist/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +18 -1
- package/dist/components/Tooltip/Tooltip.js +50 -31
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/Tree/Tree.d.ts +92 -11
- package/dist/components/Tree/Tree.js +332 -164
- package/dist/components/Tree/Tree.js.map +1 -1
- package/dist/components/VirtualList/VirtualList.d.ts +27 -4
- package/dist/components/VirtualList/VirtualList.js +179 -145
- package/dist/components/VirtualList/VirtualList.js.map +1 -1
- package/dist/components/VirtualList/index.d.ts +1 -1
- package/dist/components/ZoomControls/ZoomControls.d.ts +6 -2
- package/dist/components/ZoomControls/ZoomControls.js +37 -37
- package/dist/components/ZoomControls/ZoomControls.js.map +1 -1
- package/dist/entries/tokens.js +22 -16
- package/dist/foundations/ChoiceBase/ChoiceBase.js +15 -13
- package/dist/foundations/ChoiceBase/ChoiceBase.js.map +1 -1
- package/dist/foundations/LiveRegion/LiveRegion.d.ts +33 -0
- package/dist/foundations/LiveRegion/LiveRegion.js +29 -0
- package/dist/foundations/LiveRegion/LiveRegion.js.map +1 -0
- package/dist/foundations/LiveRegion/index.d.ts +1 -0
- package/dist/foundations/canvas-size.d.ts +14 -0
- package/dist/foundations/canvas-size.js +32 -0
- package/dist/foundations/canvas-size.js.map +1 -0
- package/dist/foundations/dir.js +0 -1
- package/dist/foundations/dir.js.map +1 -1
- package/dist/foundations/draft.d.ts +14 -0
- package/dist/foundations/draft.js +22 -0
- package/dist/foundations/draft.js.map +1 -0
- package/dist/foundations/edge.d.ts +20 -0
- package/dist/foundations/edge.js +26 -0
- package/dist/foundations/edge.js.map +1 -0
- package/dist/foundations/focus.d.ts +5 -0
- package/dist/foundations/focus.js +10 -0
- package/dist/foundations/focus.js.map +1 -0
- package/dist/foundations/hotkey.d.ts +23 -1
- package/dist/foundations/hotkey.js +48 -26
- package/dist/foundations/hotkey.js.map +1 -1
- package/dist/foundations/icon-size.d.ts +7 -0
- package/dist/foundations/icon-size.js +6 -0
- package/dist/foundations/icon-size.js.map +1 -0
- package/dist/foundations/keys.js +12 -13
- package/dist/foundations/keys.js.map +1 -1
- package/dist/{components/Stack/space.d.ts → foundations/layout.d.ts} +34 -0
- package/dist/foundations/layout.js +29 -0
- package/dist/foundations/layout.js.map +1 -0
- package/dist/foundations/listbox.d.ts +47 -2
- package/dist/foundations/listbox.js +56 -25
- package/dist/foundations/listbox.js.map +1 -1
- package/dist/foundations/math.d.ts +25 -0
- package/dist/foundations/math.js +14 -3
- package/dist/foundations/math.js.map +1 -1
- package/dist/foundations/media-query.d.ts +5 -0
- package/dist/foundations/media-query.js +14 -0
- package/dist/foundations/media-query.js.map +1 -0
- package/dist/foundations/motion.d.ts +12 -0
- package/dist/foundations/motion.js +21 -0
- package/dist/foundations/motion.js.map +1 -0
- package/dist/foundations/option-icon.d.ts +3 -1
- package/dist/foundations/option-icon.js +6 -6
- package/dist/foundations/option-icon.js.map +1 -1
- package/dist/foundations/qr.js +0 -1
- package/dist/foundations/qr.js.map +1 -1
- package/dist/foundations/refs.d.ts +8 -0
- package/dist/foundations/refs.js +14 -0
- package/dist/foundations/refs.js.map +1 -0
- package/dist/foundations/reorder.js +5 -6
- package/dist/foundations/reorder.js.map +1 -1
- package/dist/foundations/roving-focus.d.ts +10 -0
- package/dist/foundations/roving-focus.js +34 -31
- package/dist/foundations/roving-focus.js.map +1 -1
- package/dist/foundations/scroll-align.d.ts +11 -0
- package/dist/foundations/scroll-align.js +8 -0
- package/dist/foundations/scroll-align.js.map +1 -0
- package/dist/foundations/sort.d.ts +13 -0
- package/dist/foundations/sort.js +26 -0
- package/dist/foundations/sort.js.map +1 -0
- package/dist/foundations/text-match.d.ts +11 -0
- package/dist/foundations/text-match.js +20 -0
- package/dist/foundations/text-match.js.map +1 -0
- package/dist/foundations/tone-icons.js +4 -5
- package/dist/foundations/tone-icons.js.map +1 -1
- package/dist/foundations/use-follow.d.ts +29 -0
- package/dist/foundations/use-follow.js +51 -0
- package/dist/foundations/use-follow.js.map +1 -0
- package/dist/foundations/virtual-window.d.ts +22 -5
- package/dist/foundations/virtual-window.js +58 -54
- package/dist/foundations/virtual-window.js.map +1 -1
- package/dist/foundations/zoom-gestures.d.ts +23 -1
- package/dist/foundations/zoom-gestures.js +123 -84
- package/dist/foundations/zoom-gestures.js.map +1 -1
- package/dist/foundations/zoom.d.ts +10 -4
- package/dist/foundations/zoom.js +16 -17
- package/dist/foundations/zoom.js.map +1 -1
- package/dist/icons/boxes.d.ts +2 -0
- package/dist/icons/boxes.js +34 -0
- package/dist/icons/boxes.js.map +1 -0
- package/dist/icons/by-name.d.ts +11 -0
- package/dist/icons/by-name.js +11 -0
- package/dist/icons/by-name.js.map +1 -0
- package/dist/icons/cable.d.ts +2 -0
- package/dist/icons/cable.js +14 -0
- package/dist/icons/cable.js.map +1 -0
- package/dist/icons/check-check.d.ts +2 -0
- package/dist/icons/check-check.js +17 -0
- package/dist/icons/check-check.js.map +1 -0
- package/dist/icons/clipboard-paste.d.ts +2 -0
- package/dist/icons/clipboard-paste.js +30 -0
- package/dist/icons/clipboard-paste.js.map +1 -0
- package/dist/icons/facet.d.ts +274 -0
- package/dist/icons/facet.js +830 -0
- package/dist/icons/facet.js.map +1 -0
- package/dist/icons/file-plus.d.ts +2 -0
- package/dist/icons/file-plus.js +14 -0
- package/dist/icons/file-plus.js.map +1 -0
- package/dist/icons/file-question.d.ts +2 -0
- package/dist/icons/file-question.js +14 -0
- package/dist/icons/file-question.js.map +1 -0
- package/dist/icons/file-search.d.ts +2 -0
- package/dist/icons/file-search.js +24 -0
- package/dist/icons/file-search.js.map +1 -0
- package/dist/icons/function.d.ts +2 -0
- package/dist/icons/function.js +20 -0
- package/dist/icons/function.js.map +1 -0
- package/dist/icons/gauge.d.ts +2 -0
- package/dist/icons/gauge.js +14 -0
- package/dist/icons/gauge.js.map +1 -0
- package/dist/icons/hourglass.d.ts +2 -0
- package/dist/icons/hourglass.js +14 -0
- package/dist/icons/hourglass.js.map +1 -0
- package/dist/icons/index.d.ts +1 -250
- package/dist/icons/index.js +548 -500
- package/dist/icons/keywords.d.ts +24 -0
- package/dist/icons/keywords.js +185 -0
- package/dist/icons/keywords.js.map +1 -1
- package/dist/icons/languages.d.ts +2 -0
- package/dist/icons/languages.js +14 -0
- package/dist/icons/languages.js.map +1 -0
- package/dist/icons/loader.d.ts +2 -0
- package/dist/icons/loader.js +14 -0
- package/dist/icons/loader.js.map +1 -0
- package/dist/icons/monitor-down.d.ts +2 -0
- package/dist/icons/monitor-down.js +24 -0
- package/dist/icons/monitor-down.js.map +1 -0
- package/dist/icons/panel-right.d.ts +2 -0
- package/dist/icons/panel-right.js +20 -0
- package/dist/icons/panel-right.js.map +1 -0
- package/dist/icons/party-popper.d.ts +2 -0
- package/dist/icons/party-popper.js +14 -0
- package/dist/icons/party-popper.js.map +1 -0
- package/dist/icons/power-off.d.ts +2 -0
- package/dist/icons/power-off.js +14 -0
- package/dist/icons/power-off.js.map +1 -0
- package/dist/icons/rocket.d.ts +2 -0
- package/dist/icons/rocket.js +21 -0
- package/dist/icons/rocket.js.map +1 -0
- package/dist/icons/rows.d.ts +2 -0
- package/dist/icons/rows.js +20 -0
- package/dist/icons/rows.js.map +1 -0
- package/dist/icons/scissors.d.ts +2 -0
- package/dist/icons/scissors.js +26 -0
- package/dist/icons/scissors.js.map +1 -0
- package/dist/icons/shield-question.d.ts +2 -0
- package/dist/icons/shield-question.js +14 -0
- package/dist/icons/shield-question.js.map +1 -0
- package/dist/icons/square-plus.d.ts +2 -0
- package/dist/icons/square-plus.js +20 -0
- package/dist/icons/square-plus.js.map +1 -0
- package/dist/icons/text-select.d.ts +2 -0
- package/dist/icons/text-select.js +14 -0
- package/dist/icons/text-select.js.map +1 -0
- package/dist/icons/window-maximize.d.ts +2 -0
- package/dist/icons/window-maximize.js +14 -0
- package/dist/icons/window-maximize.js.map +1 -0
- package/dist/icons/window-restore.d.ts +2 -0
- package/dist/icons/window-restore.js +20 -0
- package/dist/icons/window-restore.js.map +1 -0
- package/dist/index.d.ts +24 -9
- package/dist/index.js +326 -282
- package/dist/overlay/dismiss.js +15 -13
- package/dist/overlay/dismiss.js.map +1 -1
- package/dist/overlay/floating.d.ts +7 -2
- package/dist/overlay/floating.js +29 -21
- package/dist/overlay/floating.js.map +1 -1
- package/dist/overlay/listbox-layer.d.ts +3 -2
- package/dist/overlay/listbox-layer.js.map +1 -1
- package/dist/overlay/position.d.ts +5 -2
- package/dist/overlay/position.js +19 -19
- package/dist/overlay/position.js.map +1 -1
- package/dist/overlay/toast-host.js +3 -2
- package/dist/overlay/toast-host.js.map +1 -1
- package/dist/overlay/use-anchored-position.d.ts +2 -2
- package/dist/overlay/use-anchored-position.js +25 -25
- package/dist/overlay/use-anchored-position.js.map +1 -1
- package/dist/styles/badge.css +1 -1
- package/dist/styles/base.css +1 -1
- package/dist/styles/button.css +1 -1
- package/dist/styles/calendar.css +1 -1
- package/dist/styles/card.css +1 -1
- package/dist/styles/chat-message.css +1 -0
- package/dist/styles/code-block.css +1 -1
- package/dist/styles/command-palette.css +1 -1
- package/dist/styles/data-grid.css +1 -0
- package/dist/styles/disclosure.css +1 -1
- package/dist/styles/error-boundary.css +1 -0
- package/dist/styles/field.css +1 -1
- package/dist/styles/file-drop.css +1 -1
- package/dist/styles/generated-css.d.ts +1 -1
- package/dist/styles/generated-css.js +3 -3
- package/dist/styles/generated-css.js.map +1 -1
- package/dist/styles/highlighted-text.css +1 -0
- package/dist/styles/hotkey-field.css +1 -0
- package/dist/styles/list-row.css +1 -0
- package/dist/styles/loading-dots.css +1 -1
- package/dist/styles/manifest.json +149 -12
- package/dist/styles/menu.css +1 -1
- package/dist/styles/menubar.css +1 -0
- package/dist/styles/notice.css +1 -1
- package/dist/styles/option-list.css +1 -1
- package/dist/styles/overlay-frame.css +1 -0
- package/dist/styles/pan-zoom-canvas.css +1 -1
- package/dist/styles/path-field.css +1 -0
- package/dist/styles/popover.css +1 -1
- package/dist/styles/progress-bar.css +1 -1
- package/dist/styles/row-actions.css +1 -0
- package/dist/styles/scroll-area.css +1 -0
- package/dist/styles/search-field.css +1 -0
- package/dist/styles/segmented-control.css +1 -1
- package/dist/styles/select.css +1 -1
- package/dist/styles/side-nav.css +1 -1
- package/dist/styles/sort-button.css +1 -0
- package/dist/styles/split-pane.css +1 -1
- package/dist/styles/status-bar.css +1 -0
- package/dist/styles/table.css +1 -1
- package/dist/styles/tabs.css +1 -1
- package/dist/styles/text-area.css +1 -1
- package/dist/styles/text-field.css +1 -1
- package/dist/styles/text.css +1 -1
- package/dist/styles/title-bar.css +1 -0
- package/dist/styles/toast.css +1 -1
- package/dist/styles/tokens.css +3 -3
- package/dist/styles/tree.css +1 -1
- package/dist/styles/virtual-list.css +1 -1
- package/dist/styles.css +3 -3
- package/dist/theme/CynosureTheme.d.ts +7 -3
- package/dist/theme/CynosureTheme.js +47 -31
- package/dist/theme/CynosureTheme.js.map +1 -1
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/theme-context.d.ts +9 -0
- package/dist/theme/theme-context.js +8 -0
- package/dist/theme/theme-context.js.map +1 -0
- package/dist/theme/theme-init-script.js +0 -1
- package/dist/theme/theme-init-script.js.map +1 -1
- package/dist/theme/use-color-mode.d.ts +3 -2
- package/dist/theme/use-color-mode.js +35 -38
- package/dist/theme/use-color-mode.js.map +1 -1
- package/dist/theme/use-cynosure-theme.d.ts +18 -0
- package/dist/theme/use-cynosure-theme.js +23 -0
- package/dist/theme/use-cynosure-theme.js.map +1 -0
- package/dist/tokens/chart-themes.d.ts +38 -0
- package/dist/tokens/chart-themes.js +35 -0
- package/dist/tokens/chart-themes.js.map +1 -0
- package/dist/tokens/create-theme.d.ts +11 -1
- package/dist/tokens/create-theme.js +161 -121
- package/dist/tokens/create-theme.js.map +1 -1
- package/dist/tokens/defaults.d.ts +3 -3
- package/dist/tokens/defaults.js +1 -0
- package/dist/tokens/defaults.js.map +1 -1
- package/dist/tokens/editor-themes.d.ts +9 -2
- package/dist/tokens/editor-themes.js +43 -42
- package/dist/tokens/editor-themes.js.map +1 -1
- package/dist/tokens/index.d.ts +3 -1
- package/dist/tokens/named-themes.d.ts +41 -0
- package/dist/tokens/named-themes.js +118 -0
- package/dist/tokens/named-themes.js.map +1 -0
- package/dist/tokens/schema.d.ts +24 -1
- package/dist/tokens/schema.js +13 -0
- package/dist/tokens/schema.js.map +1 -0
- package/dist/tokens/to-css.js +34 -31
- package/dist/tokens/to-css.js.map +1 -1
- package/package.json +10 -6
- package/dist/components/Stack/space.js +0 -23
- package/dist/components/Stack/space.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchField.js","names":["isComposing","TextField","search","forwardRef","useRef","jsx","SearchField","onSubmit","clearable","onKeyDown","rest","forwarded","local","
|
|
1
|
+
{"version":3,"file":"SearchField.js","names":["_Fragment","LiveRegion","useClientLayoutEffect","mergeRefs","isComposing","TextField","search","forwardRef","useRef","useState","Fragment$1","jsx","jsxs","SearchField","onSubmit","clearable","onKeyDown","trailing","addonEnd","rest","forwarded","local","shown","said","setSaid","text","input"],"sources":["../../../src/components/SearchField/SearchField.tsx"],"sourcesContent":["import { forwardRef, type ReactNode, useRef, useState } from \"react\";\nimport { useClientLayoutEffect } from \"../../foundations/client-layout-effect.js\";\nimport { isComposing } from \"../../foundations/keys.js\";\nimport { LiveRegion } from \"../../foundations/LiveRegion/LiveRegion.js\";\nimport { mergeRefs } from \"../../foundations/refs.js\";\nimport { search } from \"../../icons/search.js\";\nimport { TextField, type TextFieldProps } from \"../TextField/TextField.js\";\n\nexport interface SearchFieldTokens {\n /** Colour of the trailing status text. */\n trailingColor: string;\n /** Font size of the trailing status text (a match count). */\n trailingFontSize: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n searchField: SearchFieldTokens;\n }\n}\n\nexport interface SearchFieldProps extends Omit<TextFieldProps, \"type\" | \"iconStart\"> {\n /** Called with the current value on Enter (never while an IME composition is active). */\n onSubmit?: (value: string) => void;\n /**\n * Status text inside the field, at its end: a match count such as \"3 of 12\". When its text changes it is announced\n * politely. Text only: put controls in `addonEnd`.\n */\n trailing?: ReactNode;\n}\n\n/** TextField preset for search: search icon, clearable, Enter submits, Escape clears then blurs. */\nexport const SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(function SearchField(\n { onSubmit, clearable = true, onKeyDown, trailing, addonEnd, ...rest },\n forwarded,\n) {\n const local = useRef<HTMLInputElement | null>(null);\n // The visible text is hidden from assistive technology; a live region always in the page reads it once per change.\n const shown = useRef<HTMLSpanElement>(null);\n const [said, setSaid] = useState(\"\");\n useClientLayoutEffect(() => {\n const text = shown.current?.textContent ?? \"\";\n if (text !== said) setSaid(text);\n });\n return (\n <TextField\n {...rest}\n ref={mergeRefs(local, forwarded)}\n type=\"search\"\n iconStart={search}\n clearable={clearable}\n addonEnd={\n <>\n {(Boolean(trailing) || trailing === 0) && (\n <span ref={shown} className=\"cy-search-field-trailing\" aria-hidden=\"true\">\n {trailing}\n </span>\n )}\n <LiveRegion>{said}</LiveRegion>\n {addonEnd}\n </>\n }\n onKeyDown={(e) => {\n onKeyDown?.(e);\n const input = e.currentTarget;\n if (e.key === \"Enter\" && !isComposing(e)) {\n e.preventDefault();\n onSubmit?.(input.value);\n }\n // Escape while an IME composes belongs to the IME (it cancels the composition), not to the field.\n if (e.key === \"Escape\" && !isComposing(e)) {\n e.preventDefault();\n if (input.value) {\n Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, \"value\")?.set?.call(input, \"\");\n input.dispatchEvent(new Event(\"input\", { bubbles: true }));\n } else input.blur();\n }\n }}\n />\n );\n});\n"],"mappings":";;;;;;;;;AAgCA,IAAaa,IAAcN,EAA+C,SACxE,EAAE,UAAAO,GAAU,WAAAC,IAAY,IAAM,WAAAC,GAAW,UAAAC,GAAU,UAAAC,GAAU,GAAGC,EAAA,GAChEC,GACA;AACA,QAAMC,IAAQb,EAAgC,IAAI,GAE5Cc,IAAQd,EAAwB,IAAI,GACpC,CAACe,GAAMC,CAAA,IAAWf,EAAS,EAAE;AACnC,SAAAP,EAAA,MAA4B;AAC1B,UAAMuB,IAAOH,EAAM,SAAS,eAAe;AAC3C,IAAIG,MAASF,KAAMC,EAAQC,CAAI;AAAA,EACjC,CAAC,GAEC,gBAAAd,EAACN,GAAD;AAAA,IACE,GAAIc;AAAA,IACJ,KAAKhB,EAAUkB,GAAOD,CAAS;AAAA,IAC/B,MAAK;AAAA,IACL,WAAWd;AAAA,IACA,WAAAS;AAAA,IACX,UACE,gBAAAH,EAAAZ,GAAA,EAAA,UAAA;AAAA,OACI,EAAQiB,KAAaA,MAAa,MAClC,gBAAAN,EAAC,QAAD;AAAA,QAAM,KAAKW;AAAA,QAAO,WAAU;AAAA,QAA2B,eAAY;AAAA,QAChE,UAAAL;AAAA,MACG,CAAA;AAAA,MAER,gBAAAN,EAACV,GAAD,EAAA,UAAasB,EAAiB,CAAA;AAAA,MAC7BL;AAAA,IACD,EAAA,CAAA;AAAA,IAEJ,WAAA,CAAY,MAAM;AAChB,MAAAF,IAAY,CAAC;AACb,YAAMU,IAAQ,EAAE;AAChB,MAAI,EAAE,QAAQ,WAAW,CAACtB,EAAY,CAAC,MACrC,EAAE,eAAe,GACjBU,IAAWY,EAAM,KAAK,IAGpB,EAAE,QAAQ,YAAY,CAACtB,EAAY,CAAC,MACtC,EAAE,eAAe,GACbsB,EAAM,SACR,OAAO,yBAAyB,iBAAiB,WAAW,OAAO,GAAG,KAAK,KAAKA,GAAO,EAAE,GACzFA,EAAM,cAAc,IAAI,MAAM,SAAS,EAAE,SAAS,GAAK,CAAC,CAAC,KACpDA,EAAM,KAAK;AAAA,IAEtB;AAAA,EACD,CAAA;AAEL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { SearchField, type SearchFieldProps } from "./SearchField.js";
|
|
1
|
+
export { SearchField, type SearchFieldProps, type SearchFieldTokens } from "./SearchField.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AriaRole, type CSSProperties, type ReactNode } from "react";
|
|
2
|
+
import { type Space } from "../../foundations/layout.js";
|
|
2
3
|
import { type ContainerProps } from "../Container/Container.js";
|
|
3
|
-
import { type Space } from "../Stack/space.js";
|
|
4
4
|
export interface SectionTokens {
|
|
5
5
|
/** Space above and below the content when the `paddingBlock` prop is not set. */
|
|
6
6
|
paddingBlock: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { space as u } from "
|
|
2
|
+
import { space as u } from "../../foundations/layout.js";
|
|
3
3
|
import { Container as v } from "../Container/Container.js";
|
|
4
4
|
import { forwardRef as x } from "react";
|
|
5
5
|
import { jsx as e } from "react/jsx-runtime";
|
|
@@ -1 +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 {
|
|
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 { type Space, space } from \"../../foundations/layout.js\";\nimport { Container, type ContainerProps } from \"../Container/Container.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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CSSProperties } from "react";
|
|
2
2
|
import type { IconData } from "../../icons/types.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { DenseSize, Tone } from "../../tokens/schema.js";
|
|
4
4
|
export interface SegmentedControlTokens {
|
|
5
5
|
radius: string;
|
|
6
6
|
trackBg: string;
|
|
@@ -38,8 +38,11 @@ export interface SegmentedControlProps {
|
|
|
38
38
|
fullWidth?: boolean;
|
|
39
39
|
/** Disables every segment; the value is not submitted. */
|
|
40
40
|
disabled?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Height and text size of the segments. Default "md". `xs` (about 20px) is for dense desktop chrome: each segment is
|
|
43
|
+
* still 24px to press (44px on coarse pointers).
|
|
44
|
+
*/
|
|
45
|
+
size?: DenseSize;
|
|
43
46
|
/** Colour of the active segment's content. */
|
|
44
47
|
tone?: Tone;
|
|
45
48
|
/** Added to the root element, for layout. */
|
|
@@ -1,44 +1,48 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useControllableState as x } from "../../foundations/controllable.js";
|
|
3
3
|
import { Icon as N } from "../../foundations/Icon/Icon.js";
|
|
4
|
+
import { iconSizeFor as S } from "../../foundations/icon-size.js";
|
|
4
5
|
import { ChoiceBase as j } from "../../foundations/ChoiceBase/ChoiceBase.js";
|
|
5
6
|
import { HiddenValue as k } from "../../foundations/HiddenValue/HiddenValue.js";
|
|
6
|
-
import { useId as
|
|
7
|
+
import { useId as p } from "react";
|
|
7
8
|
import { jsx as a, jsxs as m } from "react/jsx-runtime";
|
|
8
|
-
function
|
|
9
|
-
const
|
|
9
|
+
function q({ label: n, options: i, name: u, value: v, defaultValue: t, onChange: f, iconOnly: c = !1, fullWidth: b = !1, disabled: r, size: o = "md", tone: g = "neutral", className: s, style: h }) {
|
|
10
|
+
const l = `cy-seg-${p()}`, [d, $, y] = x(v, t, f);
|
|
10
11
|
return /* @__PURE__ */ m("div", {
|
|
11
12
|
role: "radiogroup",
|
|
12
|
-
"aria-label":
|
|
13
|
-
className: `cy-segmented-control${
|
|
14
|
-
"data-size":
|
|
13
|
+
"aria-label": n,
|
|
14
|
+
className: `cy-segmented-control${s ? ` ${s}` : ""}`,
|
|
15
|
+
"data-size": o,
|
|
15
16
|
"data-tone": g,
|
|
16
17
|
"data-full": b ? "" : void 0,
|
|
17
|
-
"data-icon-only":
|
|
18
|
+
"data-icon-only": c ? "" : void 0,
|
|
18
19
|
style: h,
|
|
19
20
|
children: [/* @__PURE__ */ a(k, {
|
|
20
|
-
name:
|
|
21
|
+
name: u,
|
|
21
22
|
value: d ?? "",
|
|
22
|
-
disabled:
|
|
23
|
-
onReset: () => y(
|
|
24
|
-
}),
|
|
25
|
-
htmlFor: `${
|
|
23
|
+
disabled: r || d === void 0,
|
|
24
|
+
onReset: () => y(t)
|
|
25
|
+
}), i.map((e) => /* @__PURE__ */ m("label", {
|
|
26
|
+
htmlFor: `${l}-${e.value}`,
|
|
26
27
|
className: "cy-segmented-control-segment",
|
|
27
|
-
"data-disabled":
|
|
28
|
+
"data-disabled": r || e.disabled ? "" : void 0,
|
|
28
29
|
children: [
|
|
29
30
|
/* @__PURE__ */ a(j, {
|
|
30
|
-
id: `${
|
|
31
|
+
id: `${l}-${e.value}`,
|
|
31
32
|
type: "radio",
|
|
32
|
-
name:
|
|
33
|
+
name: l,
|
|
33
34
|
form: "",
|
|
34
35
|
value: e.value,
|
|
35
|
-
disabled:
|
|
36
|
+
disabled: r || e.disabled,
|
|
36
37
|
"aria-label": e.label,
|
|
37
38
|
checked: d === e.value,
|
|
38
39
|
onChange: (C) => C.currentTarget.checked && $(e.value)
|
|
39
40
|
}),
|
|
40
|
-
e.icon && /* @__PURE__ */ a(N, {
|
|
41
|
-
|
|
41
|
+
e.icon && /* @__PURE__ */ a(N, {
|
|
42
|
+
icon: e.icon,
|
|
43
|
+
size: S(o)
|
|
44
|
+
}),
|
|
45
|
+
!c && /* @__PURE__ */ a("span", {
|
|
42
46
|
className: "cy-segmented-control-label",
|
|
43
47
|
children: e.label
|
|
44
48
|
})
|
|
@@ -47,7 +51,7 @@ function R({ label: o, options: n, name: i, value: u, defaultValue: s, onChange:
|
|
|
47
51
|
});
|
|
48
52
|
}
|
|
49
53
|
export {
|
|
50
|
-
|
|
54
|
+
q as SegmentedControl
|
|
51
55
|
};
|
|
52
56
|
|
|
53
57
|
//# sourceMappingURL=SegmentedControl.js.map
|
|
@@ -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 {
|
|
1
|
+
{"version":3,"file":"SegmentedControl.js","names":["useControllableState","Icon","iconSizeFor","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 { iconSizeFor } from \"../../foundations/icon-size.js\";\nimport type { IconData } from \"../../icons/types.js\";\nimport type { DenseSize, 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 /**\n * Height and text size of the segments. Default \"md\". `xs` (about 20px) is for dense desktop chrome: each segment is\n * still 24px to press (44px on coarse pointers).\n */\n size?: DenseSize;\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} size={iconSizeFor(size)} />}\n {!iconOnly && <span className=\"cy-segmented-control-label\">{option.label}</span>}\n </label>\n ))}\n </div>\n );\n}\n"],"mappings":";;;;;;;;AA+DA,SAAgBQ,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,IAASzB,EACnCY,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,EAACL,GAAD;AAAA,UAAM,MAAMyB,EAAO;AAAA,UAAM,MAAMxB,EAAYgB,CAAI;AAAA,QAAI,CAAA;AAAA,QAClE,CAACH,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,7 +1,9 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactNode } from "react";
|
|
2
2
|
import { type OptionIconColor } from "../../foundations/option-icon.js";
|
|
3
3
|
import type { IconData } from "../../icons/types.js";
|
|
4
|
-
import type {
|
|
4
|
+
import type { DenseSize } from "../../tokens/schema.js";
|
|
5
|
+
import { type FieldLayoutProps } from "../Field/Field.js";
|
|
6
|
+
import { type OptionListAction } from "../OptionList/OptionList.js";
|
|
5
7
|
export interface SelectTokens {
|
|
6
8
|
radius: string;
|
|
7
9
|
bg: string;
|
|
@@ -23,10 +25,14 @@ export interface SelectOption extends OptionIconColor {
|
|
|
23
25
|
/** Icon before the label, in the list and in the trigger when chosen. Colour it with `iconTone` or `iconColor`. */
|
|
24
26
|
icon?: IconData;
|
|
25
27
|
disabled?: boolean;
|
|
28
|
+
/** Drawn muted in the list but still choosable: an option that is there but not in use. */
|
|
29
|
+
dimmed?: boolean;
|
|
30
|
+
/** At the end of the option's row in the list, smaller and muted: a shortcut, a count. */
|
|
31
|
+
trailing?: ReactNode;
|
|
26
32
|
/** Options next to each other with the same `group` are listed under that heading. */
|
|
27
33
|
group?: string;
|
|
28
34
|
}
|
|
29
|
-
export interface SelectProps {
|
|
35
|
+
export interface SelectProps extends FieldLayoutProps {
|
|
30
36
|
/** Names the control, shown above it. */
|
|
31
37
|
label: ReactNode;
|
|
32
38
|
/** Visually hide the label (it still names the control). Prefer visible labels. */
|
|
@@ -35,8 +41,15 @@ export interface SelectProps {
|
|
|
35
41
|
description?: ReactNode;
|
|
36
42
|
/** Your own error; it replaces the built-in required message. */
|
|
37
43
|
error?: ReactNode;
|
|
38
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* The choices: `{ value, label, description?, icon?, iconTone?, iconColor?, disabled?, dimmed?, trailing?, group? }`.
|
|
46
|
+
*/
|
|
39
47
|
options: SelectOption[];
|
|
48
|
+
/**
|
|
49
|
+
* An action pinned under the options ("Manage connections…"): the arrow keys' last stop, run with Enter, Space or a
|
|
50
|
+
* press. The list closes, focus returns to the trigger, and the value does not change.
|
|
51
|
+
*/
|
|
52
|
+
footer?: OptionListAction | undefined;
|
|
40
53
|
/** Controlled selected value. */
|
|
41
54
|
value?: string;
|
|
42
55
|
/** Selected value at first, when uncontrolled. */
|
|
@@ -51,8 +64,11 @@ export interface SelectProps {
|
|
|
51
64
|
required?: boolean;
|
|
52
65
|
/** Cannot be opened or changed, and is not submitted. */
|
|
53
66
|
disabled?: boolean;
|
|
54
|
-
/**
|
|
55
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Height and text size of the control. Default "md". `xs` (about 20px) is for dense desktop chrome: the trigger is
|
|
69
|
+
* still 24px to press (44px on coarse pointers); its label is set as for `sm`.
|
|
70
|
+
*/
|
|
71
|
+
size?: DenseSize;
|
|
56
72
|
/** `outline`, or `soft` (tinted, no border). Default "outline". */
|
|
57
73
|
variant?: "outline" | "soft";
|
|
58
74
|
/** Replace the built-in English text: the placeholder, the empty list and the required message. */
|
|
@@ -66,4 +82,4 @@ export interface SelectProps {
|
|
|
66
82
|
/** Layout only. */
|
|
67
83
|
style?: CSSProperties;
|
|
68
84
|
}
|
|
69
|
-
export declare function Select({ label, labelHidden, description, error, options, value, defaultValue, onChange, placeholder, name, required, disabled, size, variant, labels, className, style, }: SelectProps): import("react").JSX.Element;
|
|
85
|
+
export declare function Select({ label, labelHidden, description, layout, width, error, options, footer, value, defaultValue, onChange, placeholder, name, required, disabled, size, variant, labels, className, style, }: SelectProps): import("react").JSX.Element;
|
|
@@ -1,171 +1,197 @@
|
|
|
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 {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
2
|
+
import { useControllableState as ie } from "../../foundations/controllable.js";
|
|
3
|
+
import { ButtonBase as ue } from "../../foundations/ButtonBase/ButtonBase.js";
|
|
4
|
+
import { Icon as de } from "../../foundations/Icon/Icon.js";
|
|
5
|
+
import { chevronDown as me } from "../../icons/chevron-down.js";
|
|
6
|
+
import { iconSizeFor as pe } from "../../foundations/icon-size.js";
|
|
7
|
+
import { clamp as fe } from "../../foundations/math.js";
|
|
8
|
+
import { isTypeaheadKey as H, seekEnabled as K, useActiveOption as ve, useTypeahead as he } from "../../foundations/listbox.js";
|
|
9
|
+
import { OptionIcon as W } from "../../foundations/option-icon.js";
|
|
10
|
+
import { isComposing as ge } from "../../foundations/keys.js";
|
|
11
|
+
import { Field as be } from "../Field/Field.js";
|
|
12
|
+
import { HiddenValue as ye } from "../../foundations/HiddenValue/HiddenValue.js";
|
|
13
|
+
import { useListboxLayer as we } from "../../overlay/listbox-layer.js";
|
|
14
|
+
import { OptionList as Ie, OptionListGroup as De, OptionListItem as Ne, OptionListNote as Ae } from "../OptionList/OptionList.js";
|
|
15
|
+
import { Fragment as Ce, useCallback as Oe, useId as Ee, useRef as J, useState as Q } from "react";
|
|
16
|
+
import { jsx as o, jsxs as F } from "react/jsx-runtime";
|
|
17
|
+
var Le = 10;
|
|
18
|
+
function Se(N) {
|
|
19
|
+
const u = [];
|
|
20
|
+
return N.forEach((d, h) => {
|
|
21
|
+
const g = u[u.length - 1];
|
|
22
|
+
g && g.group === d.group ? g.items.push({
|
|
23
|
+
option: d,
|
|
24
|
+
index: h
|
|
25
|
+
}) : u.push({
|
|
26
|
+
group: d.group,
|
|
27
|
+
start: h,
|
|
26
28
|
items: [{
|
|
27
|
-
option:
|
|
28
|
-
index:
|
|
29
|
+
option: d,
|
|
30
|
+
index: h
|
|
29
31
|
}]
|
|
30
32
|
});
|
|
31
|
-
}),
|
|
33
|
+
}), u;
|
|
32
34
|
}
|
|
33
|
-
function
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
function Ke({ label: N, labelHidden: u, description: d, layout: h, width: g, error: V, options: s, footer: m, value: X, defaultValue: T = "", onChange: Y, placeholder: Z, name: _, required: A, disabled: C, size: O = "md", variant: ee = "outline", labels: y, className: te, style: re }) {
|
|
36
|
+
const $ = pe(O), w = `cy-select-${Ee().replace(/:/g, "")}`, I = J(null), E = J(null), [n, U, se] = ie(X, T, Y), [p, z] = Q(!1), ae = he(), [oe, L] = Q(!1), b = m ? s.length : NaN, S = s.length + (m ? 1 : 0), f = (e) => e === b || e >= 0 && e < s.length && !s[e]?.disabled, { active: c, activeId: ce, optionId: B, setActive: l, first: M, last: R, move: j } = ve({
|
|
37
|
+
id: w,
|
|
38
|
+
list: E,
|
|
39
|
+
open: p,
|
|
40
|
+
count: s.length,
|
|
41
|
+
footer: !!m,
|
|
42
|
+
usable: (e) => !s[e]?.disabled
|
|
43
|
+
}), q = (e) => {
|
|
44
|
+
const t = fe(c + e * Le, 0, S - 1), a = K(S, t - e, e, f);
|
|
45
|
+
if (a >= 0 && a !== t - e) return a;
|
|
46
|
+
const r = K(S, t, -e, f);
|
|
47
|
+
return r >= 0 ? r : c;
|
|
48
|
+
}, P = Oe((e) => {
|
|
49
|
+
const t = s[e];
|
|
50
|
+
!t || t.disabled || (L(!1), t.value !== n && U(t.value));
|
|
37
51
|
}, [
|
|
38
|
-
|
|
52
|
+
s,
|
|
39
53
|
n,
|
|
40
|
-
|
|
41
|
-
]),
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
|
|
54
|
+
U
|
|
55
|
+
]), i = (e = !0) => {
|
|
56
|
+
z(!1), e && I.current?.focus();
|
|
57
|
+
}, x = () => {
|
|
58
|
+
i(), m.onSelect();
|
|
59
|
+
}, k = (e) => {
|
|
60
|
+
const t = s.findIndex((a) => a.value === n);
|
|
61
|
+
l(e ?? (f(t) ? t : M())), z(!0);
|
|
46
62
|
};
|
|
47
|
-
|
|
48
|
-
anchor:
|
|
49
|
-
list:
|
|
50
|
-
open:
|
|
51
|
-
onClose: () =>
|
|
63
|
+
we({
|
|
64
|
+
anchor: I,
|
|
65
|
+
list: E,
|
|
66
|
+
open: p,
|
|
67
|
+
onClose: () => i(!1),
|
|
52
68
|
capWidth: !0
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
if (
|
|
61
|
-
const { key: e } = t;
|
|
62
|
-
if (!c) {
|
|
69
|
+
});
|
|
70
|
+
const G = (e) => {
|
|
71
|
+
const t = ae(e, s.map((a, r) => f(r) ? a.label : null), c);
|
|
72
|
+
t >= 0 && (p ? l(t) : k(t));
|
|
73
|
+
}, le = (e) => {
|
|
74
|
+
if (ge(e)) return;
|
|
75
|
+
const { key: t } = e;
|
|
76
|
+
if (!p) {
|
|
63
77
|
[
|
|
64
78
|
"ArrowDown",
|
|
65
79
|
"ArrowUp",
|
|
66
80
|
"Enter",
|
|
67
81
|
" "
|
|
68
|
-
].includes(
|
|
82
|
+
].includes(t) ? (e.preventDefault(), k(t === "ArrowUp" ? R() : void 0)) : H(e) && G(t);
|
|
69
83
|
return;
|
|
70
84
|
}
|
|
71
|
-
const
|
|
72
|
-
ArrowDown: () =>
|
|
73
|
-
ArrowUp: () =>
|
|
74
|
-
Home:
|
|
75
|
-
End:
|
|
76
|
-
PageDown: () =>
|
|
77
|
-
PageUp: () =>
|
|
85
|
+
const a = {
|
|
86
|
+
ArrowDown: () => j(1),
|
|
87
|
+
ArrowUp: () => j(-1),
|
|
88
|
+
Home: () => l(M()),
|
|
89
|
+
End: () => l(R()),
|
|
90
|
+
PageDown: () => l(q(1)),
|
|
91
|
+
PageUp: () => l(q(-1))
|
|
78
92
|
};
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
return /* @__PURE__ */
|
|
82
|
-
label:
|
|
83
|
-
labelHidden:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
93
|
+
a[t] ? (e.preventDefault(), a[t]()) : t === "Enter" || t === " " ? (e.preventDefault(), c === b ? x() : (P(c), i())) : t === "Escape" ? (e.preventDefault(), i()) : t === "Tab" ? (P(c), i(!1)) : H(e) && G(t);
|
|
94
|
+
}, D = s.find((e) => e.value === n), ne = Z ?? y?.placeholder ?? "Select…";
|
|
95
|
+
return /* @__PURE__ */ o(be, {
|
|
96
|
+
label: N,
|
|
97
|
+
labelHidden: u,
|
|
98
|
+
layout: h,
|
|
99
|
+
width: g,
|
|
100
|
+
description: d,
|
|
101
|
+
error: V ?? (oe && !n ? y?.required ?? "Please choose a value." : void 0),
|
|
102
|
+
required: A,
|
|
103
|
+
size: O,
|
|
104
|
+
className: te,
|
|
105
|
+
style: re,
|
|
106
|
+
children: (e) => /* @__PURE__ */ F("div", {
|
|
91
107
|
className: "cy-select",
|
|
92
|
-
"data-size":
|
|
93
|
-
"data-variant":
|
|
108
|
+
"data-size": O,
|
|
109
|
+
"data-variant": ee,
|
|
94
110
|
children: [
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
ref:
|
|
97
|
-
id:
|
|
111
|
+
/* @__PURE__ */ F(ue, {
|
|
112
|
+
ref: I,
|
|
113
|
+
id: e.id,
|
|
98
114
|
role: "combobox",
|
|
99
115
|
className: "cy-select-trigger",
|
|
100
|
-
"aria-labelledby":
|
|
101
|
-
"aria-describedby":
|
|
102
|
-
"aria-invalid":
|
|
103
|
-
"aria-required":
|
|
116
|
+
"aria-labelledby": e.labelId,
|
|
117
|
+
"aria-describedby": e.describedBy,
|
|
118
|
+
"aria-invalid": e.invalid || void 0,
|
|
119
|
+
"aria-required": A || void 0,
|
|
104
120
|
"aria-haspopup": "listbox",
|
|
105
|
-
"aria-expanded":
|
|
106
|
-
"aria-controls":
|
|
107
|
-
"aria-activedescendant":
|
|
108
|
-
disabled:
|
|
109
|
-
onClick: () =>
|
|
110
|
-
onKeyDown:
|
|
121
|
+
"aria-expanded": p,
|
|
122
|
+
"aria-controls": w,
|
|
123
|
+
"aria-activedescendant": ce,
|
|
124
|
+
disabled: C,
|
|
125
|
+
onClick: () => p ? i() : k(),
|
|
126
|
+
onKeyDown: le,
|
|
111
127
|
children: [
|
|
112
|
-
|
|
113
|
-
option:
|
|
114
|
-
plain:
|
|
128
|
+
D && /* @__PURE__ */ o(W, {
|
|
129
|
+
option: D,
|
|
130
|
+
plain: C,
|
|
131
|
+
size: $,
|
|
115
132
|
className: "cy-select-icon"
|
|
116
133
|
}),
|
|
117
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ o("span", {
|
|
118
135
|
className: "cy-select-value",
|
|
119
|
-
"data-placeholder":
|
|
120
|
-
children:
|
|
136
|
+
"data-placeholder": D ? void 0 : "",
|
|
137
|
+
children: D?.label ?? ne
|
|
121
138
|
}),
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
icon:
|
|
139
|
+
/* @__PURE__ */ o(de, {
|
|
140
|
+
icon: me,
|
|
141
|
+
size: $,
|
|
124
142
|
className: "cy-select-chevron"
|
|
125
143
|
})
|
|
126
144
|
]
|
|
127
145
|
}),
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
ref:
|
|
130
|
-
id:
|
|
131
|
-
"aria-labelledby":
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
146
|
+
/* @__PURE__ */ F(Ie, {
|
|
147
|
+
ref: E,
|
|
148
|
+
id: w,
|
|
149
|
+
"aria-labelledby": e.labelId,
|
|
150
|
+
footer: m && {
|
|
151
|
+
action: m,
|
|
152
|
+
id: B(b),
|
|
153
|
+
active: c === b,
|
|
154
|
+
onActive: () => l(b),
|
|
155
|
+
onRun: x
|
|
156
|
+
},
|
|
157
|
+
children: [s.length === 0 && /* @__PURE__ */ o(Ae, { children: y?.empty ?? "No options" }), Se(s).map((t) => {
|
|
158
|
+
const a = t.items.map(({ option: r, index: v }) => /* @__PURE__ */ o(Ne, {
|
|
159
|
+
id: B(v),
|
|
160
|
+
label: r.label,
|
|
161
|
+
description: r.description,
|
|
162
|
+
icon: /* @__PURE__ */ o(W, {
|
|
163
|
+
option: r,
|
|
164
|
+
plain: r.disabled,
|
|
141
165
|
className: "cy-select-icon"
|
|
142
166
|
}),
|
|
143
|
-
selected:
|
|
144
|
-
disabled:
|
|
145
|
-
|
|
146
|
-
|
|
167
|
+
selected: r.value === n,
|
|
168
|
+
disabled: r.disabled,
|
|
169
|
+
dimmed: r.dimmed,
|
|
170
|
+
trailing: r.trailing,
|
|
171
|
+
active: v === c,
|
|
172
|
+
onPointerMove: () => f(v) && l(v),
|
|
147
173
|
onClick: () => {
|
|
148
|
-
|
|
174
|
+
f(v) && (P(v), i());
|
|
149
175
|
}
|
|
150
|
-
},
|
|
151
|
-
return
|
|
152
|
-
id: `${
|
|
153
|
-
label:
|
|
154
|
-
children:
|
|
155
|
-
}, `group-${
|
|
176
|
+
}, r.value));
|
|
177
|
+
return t.group === void 0 ? /* @__PURE__ */ o(Ce, { children: a }, `run-${t.start}`) : /* @__PURE__ */ o(De, {
|
|
178
|
+
id: `${w}-g${t.start}`,
|
|
179
|
+
label: t.group,
|
|
180
|
+
children: a
|
|
181
|
+
}, `group-${t.start}`);
|
|
156
182
|
})]
|
|
157
183
|
}),
|
|
158
|
-
/* @__PURE__ */
|
|
159
|
-
name:
|
|
184
|
+
/* @__PURE__ */ o(ye, {
|
|
185
|
+
name: _,
|
|
160
186
|
value: n,
|
|
161
|
-
required:
|
|
162
|
-
disabled:
|
|
163
|
-
requiredMessage:
|
|
187
|
+
required: A,
|
|
188
|
+
disabled: C,
|
|
189
|
+
requiredMessage: y?.required ?? "Please choose a value.",
|
|
164
190
|
onReset: () => {
|
|
165
|
-
|
|
191
|
+
se(T), L(!1);
|
|
166
192
|
},
|
|
167
|
-
onInvalid: (
|
|
168
|
-
|
|
193
|
+
onInvalid: (t) => {
|
|
194
|
+
t.preventDefault(), L(!0), I.current?.focus();
|
|
169
195
|
}
|
|
170
196
|
})
|
|
171
197
|
]
|
|
@@ -173,7 +199,7 @@ function Pe({ label: D, labelHidden: d, description: u, error: m, options: r, va
|
|
|
173
199
|
});
|
|
174
200
|
}
|
|
175
201
|
export {
|
|
176
|
-
|
|
202
|
+
Ke as Select
|
|
177
203
|
};
|
|
178
204
|
|
|
179
205
|
//# sourceMappingURL=Select.js.map
|