@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
package/dist/overlay/dismiss.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { deepActiveElement as D } from "../foundations/focus.js";
|
|
3
|
+
import { useEffect as L, useRef as m } from "react";
|
|
4
|
+
var i = [], f = (t) => t.inside.map((e) => e.current).filter((e) => !!e), P = (t, e) => f(t).some((n) => f(e).some((o) => n !== o && n.contains(o)));
|
|
3
5
|
function k(t = !1) {
|
|
4
6
|
const e = t ? i.filter((n) => !n.passive()) : i;
|
|
5
7
|
for (let n = e.length - 1; n >= 0; n--) {
|
|
6
8
|
const o = e[n];
|
|
7
|
-
if (!e.some((u) => u !== o &&
|
|
9
|
+
if (!e.some((u) => u !== o && P(o, u))) return o;
|
|
8
10
|
}
|
|
9
11
|
}
|
|
10
12
|
function g(t) {
|
|
@@ -12,29 +14,29 @@ function g(t) {
|
|
|
12
14
|
const e = k();
|
|
13
15
|
e && (t.preventDefault(), e.close("escape"));
|
|
14
16
|
}
|
|
15
|
-
function
|
|
17
|
+
function x({ open: t, onClose: e, inside: n, returnFocus: o, outside: u = !0 }) {
|
|
16
18
|
const p = m(e);
|
|
17
19
|
p.current = e;
|
|
18
20
|
const v = m(n);
|
|
19
21
|
v.current = n;
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
+
const d = m(u);
|
|
23
|
+
d.current = u, L(() => {
|
|
22
24
|
if (!t) return;
|
|
23
25
|
const s = {
|
|
24
26
|
inside: v.current,
|
|
25
27
|
close: (c) => p.current(c),
|
|
26
|
-
passive: () =>
|
|
28
|
+
passive: () => d.current === !1
|
|
27
29
|
};
|
|
28
30
|
i.push(s), i.length === 1 && document.addEventListener("keydown", g);
|
|
29
31
|
const y = (c) => {
|
|
30
|
-
const r =
|
|
32
|
+
const r = d.current;
|
|
31
33
|
if (typeof r == "function") {
|
|
32
34
|
r(c) && k(!0) === s && s.close("outside");
|
|
33
35
|
return;
|
|
34
36
|
}
|
|
35
37
|
if (!r) return;
|
|
36
|
-
const
|
|
37
|
-
f(s).some((l) =>
|
|
38
|
+
const a = c.composedPath();
|
|
39
|
+
f(s).some((l) => a.includes(l)) || s.close("outside");
|
|
38
40
|
};
|
|
39
41
|
document.addEventListener("pointerdown", y, !0);
|
|
40
42
|
const h = o;
|
|
@@ -42,13 +44,13 @@ function R({ open: t, onClose: e, inside: n, returnFocus: o, outside: u = !0 })
|
|
|
42
44
|
document.removeEventListener("pointerdown", y, !0);
|
|
43
45
|
const c = i.indexOf(s);
|
|
44
46
|
c >= 0 && i.splice(c, 1), i.length === 0 && document.removeEventListener("keydown", g);
|
|
45
|
-
const r =
|
|
46
|
-
(
|
|
47
|
+
const r = D(), a = !r || r === document.body, l = !!r && f(s).some((E) => E !== h?.current && E.contains(r)), w = h?.current;
|
|
48
|
+
(a || l) && w?.isConnected && w.focus();
|
|
47
49
|
};
|
|
48
50
|
}, [t, o]);
|
|
49
51
|
}
|
|
50
52
|
export {
|
|
51
|
-
|
|
53
|
+
x as useDismiss
|
|
52
54
|
};
|
|
53
55
|
|
|
54
56
|
//# sourceMappingURL=dismiss.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dismiss.js","names":["useEffect","useRef","layers","els","layer","r","holds","outer","inner","o","i","topmost","pointer","open","l","other","onKeyDown","event","top","useDismiss","onClose","inside","returnFocus","outside","close","insideRef","outsideRef","reason","onPointerDown","rule","path","el","target","at","active","lost","within","back"],"sources":["../../src/overlay/dismiss.ts"],"sourcesContent":["import { type RefObject, useEffect, useRef } from \"react\";\n\nexport type DismissReason = \"escape\" | \"outside\";\n\nexport interface DismissOptions {\n open: boolean;\n onClose: (reason: DismissReason) => void;\n /** Elements that count as inside the layer (trigger, floating panel). Pointer downs elsewhere close it. */\n inside: RefObject<HTMLElement | null>[];\n /** Where focus goes after closing, if it was inside the layer or lost (on the body). */\n returnFocus?: RefObject<HTMLElement | null>;\n /**\n * Close on a pointer down outside (default true). A function decides instead (a modal dialog passes \"the pointer went\n * down on its backdrop\"); then only the topmost layer closes, so a click on a dialog's backdrop with a Menu open inside\n * closes just the Menu.\n */\n outside?: boolean | ((event: PointerEvent) => boolean);\n}\n\ninterface Layer {\n inside: RefObject<HTMLElement | null>[];\n close: (reason: DismissReason) => void;\n /** Never closes on a pointer down (a Tooltip): it does not stand between a click and the layer under it. */\n passive: () => boolean;\n}\n\nconst layers: Layer[] = [];\n\nconst els = (layer: Layer) => layer.inside.map((r) => r.current).filter((e): e is HTMLElement => !!e);\n/** `outer` has `inner` nested in it (inner's elements live inside one of outer's elements). */\nconst holds = (outer: Layer, inner: Layer) =>\n els(outer).some((o) => els(inner).some((i) => o !== i && o.contains(i)));\n\n/**\n * The layer Escape belongs to: the most recently opened one that has no other open layer nested inside it. For pointer\n * downs, layers that ignore them (`passive`) are left out.\n */\nfunction topmost(pointer = false): Layer | undefined {\n const open = pointer ? layers.filter((l) => !l.passive()) : layers;\n for (let i = open.length - 1; i >= 0; i--) {\n const layer = open[i] as Layer;\n if (!open.some((other) => other !== layer && holds(layer, other))) return layer;\n }\n return undefined;\n}\n\nfunction onKeyDown(event: KeyboardEvent) {\n // Components that handle Escape themselves (an open Select list) prevent default; leave those alone.\n if (event.key !== \"Escape\" || event.defaultPrevented || event.isComposing) return;\n const top = topmost();\n if (!top) return;\n event.preventDefault();\n top.close(\"escape\");\n}\n\n/**\n * Shared dismissal for overlays (Popover, Menu, Dialog, Tooltip): Escape closes only the topmost open layer, a pointer\n * down outside closes the layer, and focus returns to the trigger. Works across shadow roots (composedPath).\n */\nexport function useDismiss({ open, onClose, inside, returnFocus, outside = true }: DismissOptions) {\n const close = useRef(onClose);\n close.current = onClose;\n const insideRef = useRef(inside);\n insideRef.current = inside;\n const outsideRef = useRef(outside);\n outsideRef.current = outside;\n\n useEffect(() => {\n if (!open) return;\n const layer: Layer = {\n inside: insideRef.current,\n close: (reason) => close.current(reason),\n passive: () => outsideRef.current === false,\n };\n layers.push(layer);\n if (layers.length === 1) document.addEventListener(\"keydown\", onKeyDown);\n // Registered when the layer opens, so an outer layer hears a pointer down before the layers nested in it.\n const onPointerDown = (event: PointerEvent) => {\n const rule = outsideRef.current;\n if (typeof rule === \"function\") {\n if (rule(event) && topmost(true) === layer) layer.close(\"outside\");\n return;\n }\n if (!rule) return;\n const path = event.composedPath();\n if (els(layer).some((el) => path.includes(el))) return;\n layer.close(\"outside\");\n };\n document.addEventListener(\"pointerdown\", onPointerDown, true);\n const target = returnFocus;\n return () => {\n document.removeEventListener(\"pointerdown\", onPointerDown, true);\n const at = layers.indexOf(layer);\n if (at >= 0) layers.splice(at, 1);\n if (layers.length === 0) document.removeEventListener(\"keydown\", onKeyDown);\n // Return focus only if it was inside the layer or got lost; never pull it from somewhere the user chose.\n const active =
|
|
1
|
+
{"version":3,"file":"dismiss.js","names":["deepActiveElement","useEffect","useRef","layers","els","layer","r","holds","outer","inner","o","i","topmost","pointer","open","l","other","onKeyDown","event","top","useDismiss","onClose","inside","returnFocus","outside","close","insideRef","outsideRef","reason","onPointerDown","rule","path","el","target","at","active","lost","within","back"],"sources":["../../src/overlay/dismiss.ts"],"sourcesContent":["import { type RefObject, useEffect, useRef } from \"react\";\nimport { deepActiveElement } from \"../foundations/focus.js\";\n\nexport type DismissReason = \"escape\" | \"outside\";\n\nexport interface DismissOptions {\n open: boolean;\n onClose: (reason: DismissReason) => void;\n /** Elements that count as inside the layer (trigger, floating panel). Pointer downs elsewhere close it. */\n inside: RefObject<HTMLElement | null>[];\n /** Where focus goes after closing, if it was inside the layer or lost (on the body). */\n returnFocus?: RefObject<HTMLElement | null>;\n /**\n * Close on a pointer down outside (default true). A function decides instead (a modal dialog passes \"the pointer went\n * down on its backdrop\"); then only the topmost layer closes, so a click on a dialog's backdrop with a Menu open inside\n * closes just the Menu.\n */\n outside?: boolean | ((event: PointerEvent) => boolean);\n}\n\ninterface Layer {\n inside: RefObject<HTMLElement | null>[];\n close: (reason: DismissReason) => void;\n /** Never closes on a pointer down (a Tooltip): it does not stand between a click and the layer under it. */\n passive: () => boolean;\n}\n\nconst layers: Layer[] = [];\n\nconst els = (layer: Layer) => layer.inside.map((r) => r.current).filter((e): e is HTMLElement => !!e);\n/** `outer` has `inner` nested in it (inner's elements live inside one of outer's elements). */\nconst holds = (outer: Layer, inner: Layer) =>\n els(outer).some((o) => els(inner).some((i) => o !== i && o.contains(i)));\n\n/**\n * The layer Escape belongs to: the most recently opened one that has no other open layer nested inside it. For pointer\n * downs, layers that ignore them (`passive`) are left out.\n */\nfunction topmost(pointer = false): Layer | undefined {\n const open = pointer ? layers.filter((l) => !l.passive()) : layers;\n for (let i = open.length - 1; i >= 0; i--) {\n const layer = open[i] as Layer;\n if (!open.some((other) => other !== layer && holds(layer, other))) return layer;\n }\n return undefined;\n}\n\nfunction onKeyDown(event: KeyboardEvent) {\n // Components that handle Escape themselves (an open Select list) prevent default; leave those alone.\n if (event.key !== \"Escape\" || event.defaultPrevented || event.isComposing) return;\n const top = topmost();\n if (!top) return;\n event.preventDefault();\n top.close(\"escape\");\n}\n\n/**\n * Shared dismissal for overlays (Popover, Menu, Dialog, Tooltip): Escape closes only the topmost open layer, a pointer\n * down outside closes the layer, and focus returns to the trigger. Works across shadow roots (composedPath).\n */\nexport function useDismiss({ open, onClose, inside, returnFocus, outside = true }: DismissOptions) {\n const close = useRef(onClose);\n close.current = onClose;\n const insideRef = useRef(inside);\n insideRef.current = inside;\n const outsideRef = useRef(outside);\n outsideRef.current = outside;\n\n useEffect(() => {\n if (!open) return;\n const layer: Layer = {\n inside: insideRef.current,\n close: (reason) => close.current(reason),\n passive: () => outsideRef.current === false,\n };\n layers.push(layer);\n if (layers.length === 1) document.addEventListener(\"keydown\", onKeyDown);\n // Registered when the layer opens, so an outer layer hears a pointer down before the layers nested in it.\n const onPointerDown = (event: PointerEvent) => {\n const rule = outsideRef.current;\n if (typeof rule === \"function\") {\n if (rule(event) && topmost(true) === layer) layer.close(\"outside\");\n return;\n }\n if (!rule) return;\n const path = event.composedPath();\n if (els(layer).some((el) => path.includes(el))) return;\n layer.close(\"outside\");\n };\n document.addEventListener(\"pointerdown\", onPointerDown, true);\n const target = returnFocus;\n return () => {\n document.removeEventListener(\"pointerdown\", onPointerDown, true);\n const at = layers.indexOf(layer);\n if (at >= 0) layers.splice(at, 1);\n if (layers.length === 0) document.removeEventListener(\"keydown\", onKeyDown);\n // Return focus only if it was inside the layer or got lost; never pull it from somewhere the user chose.\n const active = deepActiveElement();\n const lost = !active || active === document.body;\n const within = !!active && els(layer).some((el) => el !== target?.current && el.contains(active));\n const back = target?.current;\n if ((lost || within) && back?.isConnected) back.focus();\n };\n }, [open, returnFocus]);\n}\n"],"mappings":";;;AA2BA,IAAMG,IAAkB,CAAC,GAEnBC,IAAA,CAAOC,MAAiBA,EAAM,OAAO,IAAA,CAAKC,MAAMA,EAAE,OAAO,EAAE,OAAA,CAAQ,MAAwB,CAAC,CAAC,CAAC,GAE9FC,IAAA,CAASC,GAAcC,MAC3BL,EAAII,CAAK,EAAE,KAAA,CAAME,MAAMN,EAAIK,CAAK,EAAE,KAAA,CAAME,MAAMD,MAAMC,KAAKD,EAAE,SAASC,CAAC,CAAC,CAAC;AAMzE,SAASC,EAAQC,IAAU,IAA0B;AACnD,QAAMC,IAAOD,IAAUV,EAAO,OAAA,CAAQY,MAAM,CAACA,EAAE,QAAQ,CAAC,IAAIZ;AAC5D,WAASQ,IAAIG,EAAK,SAAS,GAAGH,KAAK,GAAGA,KAAK;AACzC,UAAMN,IAAQS,EAAKH,CAAA;AACnB,QAAI,CAACG,EAAK,KAAA,CAAME,MAAUA,MAAUX,KAASE,EAAMF,GAAOW,CAAK,CAAC,EAAG,QAAOX;AAAA,EAC5E;AAEF;AAEA,SAASY,EAAUC,GAAsB;AAEvC,MAAIA,EAAM,QAAQ,YAAYA,EAAM,oBAAoBA,EAAM,YAAa;AAC3E,QAAMC,IAAMP,EAAQ;AACpB,EAAKO,MACLD,EAAM,eAAe,GACrBC,EAAI,MAAM,QAAQ;AACpB;AAMA,SAAgBC,EAAW,EAAE,MAAAN,GAAM,SAAAO,GAAS,QAAAC,GAAQ,aAAAC,GAAa,SAAAC,IAAU,GAAA,GAAwB;AACjG,QAAMC,IAAQvB,EAAOmB,CAAO;AAC5B,EAAAI,EAAM,UAAUJ;AAChB,QAAMK,IAAYxB,EAAOoB,CAAM;AAC/B,EAAAI,EAAU,UAAUJ;AACpB,QAAMK,IAAazB,EAAOsB,CAAO;AACjC,EAAAG,EAAW,UAAUH,GAErBvB,EAAA,MAAgB;AACd,QAAI,CAACa,EAAM;AACX,UAAMT,IAAe;AAAA,MACnB,QAAQqB,EAAU;AAAA,MAClB,OAAA,CAAQE,MAAWH,EAAM,QAAQG,CAAM;AAAA,MACvC,SAAA,MAAeD,EAAW,YAAY;AAAA,IACxC;AACA,IAAAxB,EAAO,KAAKE,CAAK,GACbF,EAAO,WAAW,KAAG,SAAS,iBAAiB,WAAWc,CAAS;AAEvE,UAAMY,IAAA,CAAiBX,MAAwB;AAC7C,YAAMY,IAAOH,EAAW;AACxB,UAAI,OAAOG,KAAS,YAAY;AAC9B,QAAIA,EAAKZ,CAAK,KAAKN,EAAQ,EAAI,MAAMP,KAAOA,EAAM,MAAM,SAAS;AACjE;AAAA,MACF;AACA,UAAI,CAACyB,EAAM;AACX,YAAMC,IAAOb,EAAM,aAAa;AAChC,MAAId,EAAIC,CAAK,EAAE,KAAA,CAAM2B,MAAOD,EAAK,SAASC,CAAE,CAAC,KAC7C3B,EAAM,MAAM,SAAS;AAAA,IACvB;AACA,aAAS,iBAAiB,eAAewB,GAAe,EAAI;AAC5D,UAAMI,IAASV;AACf,WAAA,MAAa;AACX,eAAS,oBAAoB,eAAeM,GAAe,EAAI;AAC/D,YAAMK,IAAK/B,EAAO,QAAQE,CAAK;AAC/B,MAAI6B,KAAM,KAAG/B,EAAO,OAAO+B,GAAI,CAAC,GAC5B/B,EAAO,WAAW,KAAG,SAAS,oBAAoB,WAAWc,CAAS;AAE1E,YAAMkB,IAASnC,EAAkB,GAC3BoC,IAAO,CAACD,KAAUA,MAAW,SAAS,MACtCE,IAAS,CAAC,CAACF,KAAU/B,EAAIC,CAAK,EAAE,KAAA,CAAM2B,MAAOA,MAAOC,GAAQ,WAAWD,EAAG,SAASG,CAAM,CAAC,GAC1FG,IAAOL,GAAQ;AACrB,OAAKG,KAAQC,MAAWC,GAAM,eAAaA,EAAK,MAAM;AAAA,IACxD;AAAA,EACF,GAAG,CAACxB,GAAMS,CAAW,CAAC;AACxB"}
|
|
@@ -21,5 +21,10 @@ export declare function useFloatingAnchor(anchor: FloatingAnchor): {
|
|
|
21
21
|
ref: RefObject<HTMLElement | VirtualAnchor | null>;
|
|
22
22
|
present: boolean;
|
|
23
23
|
};
|
|
24
|
-
/**
|
|
25
|
-
|
|
24
|
+
/**
|
|
25
|
+
* The surface's `--_offset` in pixels. A custom property's computed value is its text (`0.5rem`, `calc(…)`), not a
|
|
26
|
+
* length, so it is resolved through a real length property set for the moment of reading.
|
|
27
|
+
*/
|
|
28
|
+
export declare function floatingOffset(el: HTMLElement, fallback?: number): number;
|
|
29
|
+
/** The gap to keep from the anchor, read from the surface's `--_offset` (a token that always resolves) when it opens. */
|
|
30
|
+
export declare function useFloatingOffset(el: RefObject<HTMLElement | null>, open: boolean): number;
|
package/dist/overlay/floating.js
CHANGED
|
@@ -1,33 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { useClientLayoutEffect as s } from "../foundations/client-layout-effect.js";
|
|
3
|
+
import { useRef as f, useState as u } from "react";
|
|
4
|
+
var i = (t) => t !== null && "current" in t;
|
|
5
|
+
function a(t, e, o) {
|
|
6
|
+
s(() => {
|
|
7
|
+
const r = t.current;
|
|
7
8
|
if (!r?.showPopover) return;
|
|
8
|
-
const
|
|
9
|
-
|
|
9
|
+
const n = r.matches(":popover-open");
|
|
10
|
+
e && !n && (r.showPopover(), o?.(r)), !e && n && r.hidePopover?.();
|
|
10
11
|
});
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
-
const
|
|
14
|
-
return
|
|
15
|
-
|
|
13
|
+
function y(t) {
|
|
14
|
+
const e = f(null), [o, r] = u(!1);
|
|
15
|
+
return s(() => {
|
|
16
|
+
e.current = i(t) ? t.current : t, r(e.current !== null);
|
|
16
17
|
}), {
|
|
17
|
-
ref:
|
|
18
|
+
ref: e,
|
|
18
19
|
present: o
|
|
19
20
|
};
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
function c(t, e = 8) {
|
|
23
|
+
const o = "scroll-margin-top", r = [t.style.getPropertyValue(o), t.style.getPropertyPriority(o)];
|
|
24
|
+
t.style.setProperty(o, "var(--_offset)");
|
|
25
|
+
const n = Number.parseFloat(getComputedStyle(t).scrollMarginTop);
|
|
26
|
+
return t.style.setProperty(o, ...r), Number.isFinite(n) ? n : e;
|
|
27
|
+
}
|
|
28
|
+
function P(t, e) {
|
|
29
|
+
const [o, r] = u(8);
|
|
30
|
+
return s(() => {
|
|
31
|
+
e && t.current && r(c(t.current));
|
|
32
|
+
}, [t, e]), o;
|
|
26
33
|
}
|
|
27
34
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
c as floatingOffset,
|
|
36
|
+
y as useFloatingAnchor,
|
|
37
|
+
P as useFloatingOffset,
|
|
38
|
+
a as usePopover
|
|
31
39
|
};
|
|
32
40
|
|
|
33
41
|
//# sourceMappingURL=floating.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floating.js","names":["useClientLayoutEffect","useRef","useState","isRef","a","usePopover","el","open","onShow","node","shown","useFloatingAnchor","anchor","ref","present","setPresent","useFloatingOffset","offset"],"sources":["../../src/overlay/floating.ts"],"sourcesContent":["import { type RefObject, useRef, useState } from \"react\";\nimport { useClientLayoutEffect } from \"../foundations/client-layout-effect.js\";\nimport type { VirtualAnchor } from \"./use-anchored-position.js\";\n\n/** An element shown with the Popover API (top layer, rendered in place: nothing is added to `<body>`). */\nexport type PopoverEl = HTMLDivElement & { showPopover?: () => void; hidePopover?: () => void };\n\n/** What a floating surface sits beside: a ref to an element, or a virtual anchor (a selection, a point). */\nexport type FloatingAnchor = RefObject<HTMLElement | VirtualAnchor | null> | VirtualAnchor | null;\n\nconst isRef = (a: FloatingAnchor): a is RefObject<HTMLElement | VirtualAnchor | null> =>\n a !== null && \"current\" in a;\n\n/**\n * Shows or hides a manual popover with the Popover API, before paint. `onShow` runs right after it is shown, still\n * before paint and before `useAnchoredPosition` measures it (size it, move focus in). Environments without the API\n * (jsdom) skip it.\n */\nexport function usePopover(\n el: RefObject<HTMLElement | null>,\n open: boolean,\n onShow?: (el: HTMLElement) => void,\n) {\n useClientLayoutEffect(() => {\n const node = el.current as PopoverEl | null;\n if (!node?.showPopover) return;\n const shown = node.matches(\":popover-open\");\n if (open && !shown) {\n node.showPopover();\n onShow?.(node);\n }\n if (!open && shown) node.hidePopover?.();\n });\n}\n\n/**\n * The anchor as a ref for `useAnchoredPosition`, and whether there is one. A ref is only attached after render, so it\n * is resolved in a layout effect (before paint).\n */\nexport function useFloatingAnchor(anchor: FloatingAnchor) {\n const ref = useRef<HTMLElement | VirtualAnchor | null>(null);\n const [present, setPresent] = useState(false);\n useClientLayoutEffect(() => {\n ref.current = isRef(anchor) ? anchor.current : anchor;\n setPresent(ref.current !== null);\n });\n return { ref, present };\n}\n\n/** The gap to keep from the anchor, read from the surface's `--_offset` (a token that always resolves). */\nexport function useFloatingOffset(el: RefObject<HTMLElement | null
|
|
1
|
+
{"version":3,"file":"floating.js","names":["useClientLayoutEffect","useRef","useState","isRef","a","usePopover","el","open","onShow","node","shown","useFloatingAnchor","anchor","ref","present","setPresent","floatingOffset","fallback","prop","before","px","useFloatingOffset","offset","setOffset"],"sources":["../../src/overlay/floating.ts"],"sourcesContent":["import { type RefObject, useRef, useState } from \"react\";\nimport { useClientLayoutEffect } from \"../foundations/client-layout-effect.js\";\nimport type { VirtualAnchor } from \"./use-anchored-position.js\";\n\n/** An element shown with the Popover API (top layer, rendered in place: nothing is added to `<body>`). */\nexport type PopoverEl = HTMLDivElement & { showPopover?: () => void; hidePopover?: () => void };\n\n/** What a floating surface sits beside: a ref to an element, or a virtual anchor (a selection, a point). */\nexport type FloatingAnchor = RefObject<HTMLElement | VirtualAnchor | null> | VirtualAnchor | null;\n\nconst isRef = (a: FloatingAnchor): a is RefObject<HTMLElement | VirtualAnchor | null> =>\n a !== null && \"current\" in a;\n\n/**\n * Shows or hides a manual popover with the Popover API, before paint. `onShow` runs right after it is shown, still\n * before paint and before `useAnchoredPosition` measures it (size it, move focus in). Environments without the API\n * (jsdom) skip it.\n */\nexport function usePopover(\n el: RefObject<HTMLElement | null>,\n open: boolean,\n onShow?: (el: HTMLElement) => void,\n) {\n useClientLayoutEffect(() => {\n const node = el.current as PopoverEl | null;\n if (!node?.showPopover) return;\n const shown = node.matches(\":popover-open\");\n if (open && !shown) {\n node.showPopover();\n onShow?.(node);\n }\n if (!open && shown) node.hidePopover?.();\n });\n}\n\n/**\n * The anchor as a ref for `useAnchoredPosition`, and whether there is one. A ref is only attached after render, so it\n * is resolved in a layout effect (before paint).\n */\nexport function useFloatingAnchor(anchor: FloatingAnchor) {\n const ref = useRef<HTMLElement | VirtualAnchor | null>(null);\n const [present, setPresent] = useState(false);\n useClientLayoutEffect(() => {\n ref.current = isRef(anchor) ? anchor.current : anchor;\n setPresent(ref.current !== null);\n });\n return { ref, present };\n}\n\n/**\n * The surface's `--_offset` in pixels. A custom property's computed value is its text (`0.5rem`, `calc(…)`), not a\n * length, so it is resolved through a real length property set for the moment of reading.\n */\nexport function floatingOffset(el: HTMLElement, fallback = 8) {\n const prop = \"scroll-margin-top\";\n const before = [el.style.getPropertyValue(prop), el.style.getPropertyPriority(prop)] as const;\n el.style.setProperty(prop, \"var(--_offset)\");\n const px = Number.parseFloat(getComputedStyle(el).scrollMarginTop);\n el.style.setProperty(prop, ...before);\n return Number.isFinite(px) ? px : fallback;\n}\n\n/** The gap to keep from the anchor, read from the surface's `--_offset` (a token that always resolves) when it opens. */\nexport function useFloatingOffset(el: RefObject<HTMLElement | null>, open: boolean) {\n const [offset, setOffset] = useState(8);\n useClientLayoutEffect(() => {\n if (open && el.current) setOffset(floatingOffset(el.current));\n }, [el, open]);\n return offset;\n}\n"],"mappings":";;;AAUA,IAAMG,IAAA,CAASC,MACbA,MAAM,QAAQ,aAAaA;AAO7B,SAAgBC,EACdC,GACAC,GACAC,GACA;AACA,EAAAR,EAAA,MAA4B;AAC1B,UAAMS,IAAOH,EAAG;AAChB,QAAI,CAACG,GAAM,YAAa;AACxB,UAAMC,IAAQD,EAAK,QAAQ,eAAe;AAC1C,IAAIF,KAAQ,CAACG,MACXD,EAAK,YAAY,GACjBD,IAASC,CAAI,IAEX,CAACF,KAAQG,KAAOD,EAAK,cAAc;AAAA,EACzC,CAAC;AACH;AAMA,SAAgBE,EAAkBC,GAAwB;AACxD,QAAMC,IAAMZ,EAA2C,IAAI,GACrD,CAACa,GAASC,CAAA,IAAcb,EAAS,EAAK;AAC5C,SAAAF,EAAA,MAA4B;AAC1B,IAAAa,EAAI,UAAUV,EAAMS,CAAM,IAAIA,EAAO,UAAUA,GAC/CG,EAAWF,EAAI,YAAY,IAAI;AAAA,EACjC,CAAC,GACM;AAAA,IAAE,KAAAA;AAAA,IAAK,SAAAC;AAAA,EAAQ;AACxB;AAMA,SAAgBE,EAAeV,GAAiBW,IAAW,GAAG;AAC5D,QAAMC,IAAO,qBACPC,IAAS,CAACb,EAAG,MAAM,iBAAiBY,CAAI,GAAGZ,EAAG,MAAM,oBAAoBY,CAAI,CAAC;AACnF,EAAAZ,EAAG,MAAM,YAAYY,GAAM,gBAAgB;AAC3C,QAAME,IAAK,OAAO,WAAW,iBAAiBd,CAAE,EAAE,eAAe;AACjE,SAAAA,EAAG,MAAM,YAAYY,GAAM,GAAGC,CAAM,GAC7B,OAAO,SAASC,CAAE,IAAIA,IAAKH;AACpC;AAGA,SAAgBI,EAAkBf,GAAmCC,GAAe;AAClF,QAAM,CAACe,GAAQC,CAAA,IAAarB,EAAS,CAAC;AACtC,SAAAF,EAAA,MAA4B;AAC1B,IAAIO,KAAQD,EAAG,WAASiB,EAAUP,EAAeV,EAAG,OAAO,CAAC;AAAA,EAC9D,GAAG,CAACA,GAAIC,CAAI,CAAC,GACNe;AACT"}
|
|
@@ -10,7 +10,8 @@ export interface ListboxLayerOptions {
|
|
|
10
10
|
capWidth?: boolean;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* The drop-down list layer of Select, Combobox and
|
|
14
|
-
* placed below it (flipping when there is no room), and closed by Escape or a press outside in
|
|
13
|
+
* The drop-down list layer of Select, Combobox, TagInput and TextArea's mentions: shown in the top layer, at least as
|
|
14
|
+
* wide as its anchor, placed below it (flipping when there is no room), and closed by Escape or a press outside in
|
|
15
|
+
* layer order.
|
|
15
16
|
*/
|
|
16
17
|
export declare function useListboxLayer({ anchor, list, open, onClose, capWidth }: ListboxLayerOptions): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listbox-layer.js","names":["useDismiss","usePopover","useAnchoredPosition","useListboxLayer","anchor","list","open","onClose","capWidth","el","width"],"sources":["../../src/overlay/listbox-layer.ts"],"sourcesContent":["import type { RefObject } from \"react\";\nimport { useDismiss } from \"./dismiss.js\";\nimport { usePopover } from \"./floating.js\";\nimport { useAnchoredPosition } from \"./use-anchored-position.js\";\n\nexport interface ListboxLayerOptions {\n /** The field or button the list drops down from. */\n anchor: RefObject<HTMLElement | null>;\n /** The list (a `popover=\"manual\"` element). */\n list: RefObject<HTMLElement | null>;\n open: boolean;\n onClose: () => void;\n /** Cap the width at max(anchor, 20rem) so long labels truncate (Select). Default: only at least the anchor's width. */\n capWidth?: boolean;\n}\n\n/**\n * The drop-down list layer of Select, Combobox and
|
|
1
|
+
{"version":3,"file":"listbox-layer.js","names":["useDismiss","usePopover","useAnchoredPosition","useListboxLayer","anchor","list","open","onClose","capWidth","el","width"],"sources":["../../src/overlay/listbox-layer.ts"],"sourcesContent":["import type { RefObject } from \"react\";\nimport { useDismiss } from \"./dismiss.js\";\nimport { usePopover } from \"./floating.js\";\nimport { useAnchoredPosition } from \"./use-anchored-position.js\";\n\nexport interface ListboxLayerOptions {\n /** The field or button the list drops down from. */\n anchor: RefObject<HTMLElement | null>;\n /** The list (a `popover=\"manual\"` element). */\n list: RefObject<HTMLElement | null>;\n open: boolean;\n onClose: () => void;\n /** Cap the width at max(anchor, 20rem) so long labels truncate (Select). Default: only at least the anchor's width. */\n capWidth?: boolean;\n}\n\n/**\n * The drop-down list layer of Select, Combobox, TagInput and TextArea's mentions: shown in the top layer, at least as\n * wide as its anchor, placed below it (flipping when there is no room), and closed by Escape or a press outside in\n * layer order.\n */\nexport function useListboxLayer({ anchor, list, open, onClose, capWidth = false }: ListboxLayerOptions) {\n usePopover(list, open, (el) => {\n const width = anchor.current?.offsetWidth ?? 0;\n el.style.minInlineSize = `${width}px`;\n if (capWidth) el.style.maxInlineSize = `max(${width}px, 20rem)`;\n });\n useAnchoredPosition(anchor, list, open, \"bottom\", 4, \"start\");\n useDismiss({ open, onClose, inside: [anchor, list] });\n}\n"],"mappings":";;;AAqBA,SAAgBG,EAAgB,EAAE,QAAAC,GAAQ,MAAAC,GAAM,MAAAC,GAAM,SAAAC,GAAS,UAAAC,IAAW,GAAA,GAA8B;AACtG,EAAAP,EAAWI,GAAMC,GAAA,CAAOG,MAAO;AAC7B,UAAMC,IAAQN,EAAO,SAAS,eAAe;AAC7C,IAAAK,EAAG,MAAM,gBAAgB,GAAGC,CAAA,MACxBF,MAAUC,EAAG,MAAM,gBAAgB,OAAOC,CAAA;AAAA,EAChD,CAAC,GACDR,EAAoBE,GAAQC,GAAMC,GAAM,UAAU,GAAG,OAAO,GAC5DN,EAAW;AAAA,IAAE,MAAAM;AAAA,IAAM,SAAAC;AAAA,IAAS,QAAQ,CAACH,GAAQC,CAAI;AAAA,EAAE,CAAC;AACtD"}
|
|
@@ -15,8 +15,11 @@ export declare function computePosition(anchor: Box, floating: {
|
|
|
15
15
|
width: number;
|
|
16
16
|
height: number;
|
|
17
17
|
}, placement: Placement, offset: number, dir: "ltr" | "rtl",
|
|
18
|
-
/**
|
|
19
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Cross-axis alignment: centred on the anchor; `start`, flush with its start edge for top/bottom (lists, menus);
|
|
20
|
+
* `flush`, that and also flush with its top edge for start/end (submenus beside their item).
|
|
21
|
+
*/
|
|
22
|
+
align?: "center" | "start" | "flush"): {
|
|
20
23
|
x: number;
|
|
21
24
|
y: number;
|
|
22
25
|
placement: Placement;
|
package/dist/overlay/position.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { clamp as
|
|
2
|
-
var
|
|
1
|
+
import { clamp as P } from "../foundations/math.js";
|
|
2
|
+
var h = 8, g = {
|
|
3
3
|
top: "bottom",
|
|
4
4
|
bottom: "top",
|
|
5
5
|
start: "end",
|
|
6
6
|
end: "start"
|
|
7
7
|
};
|
|
8
|
-
function
|
|
9
|
-
const y =
|
|
10
|
-
const r =
|
|
8
|
+
function O(t, e, i, o, d, u, x = "center") {
|
|
9
|
+
const y = x !== "center" ? u === "rtl" ? t.right - e.width : t.left : t.left + t.width / 2 - e.width / 2, m = x === "flush" ? t.top : t.top + t.height / 2 - e.height / 2, c = (s) => {
|
|
10
|
+
const r = s === "start" ? u === "rtl" ? "right" : "left" : s === "end" ? u === "rtl" ? "left" : "right" : s;
|
|
11
11
|
return r === "top" ? {
|
|
12
12
|
x: y,
|
|
13
|
-
y: t.top -
|
|
13
|
+
y: t.top - d - e.height
|
|
14
14
|
} : r === "bottom" ? {
|
|
15
15
|
x: y,
|
|
16
|
-
y: t.bottom +
|
|
16
|
+
y: t.bottom + d
|
|
17
17
|
} : r === "left" ? {
|
|
18
|
-
x: t.left -
|
|
19
|
-
y:
|
|
18
|
+
x: t.left - d - e.width,
|
|
19
|
+
y: m
|
|
20
20
|
} : {
|
|
21
|
-
x: t.right +
|
|
22
|
-
y:
|
|
21
|
+
x: t.right + d,
|
|
22
|
+
y: m
|
|
23
23
|
};
|
|
24
|
-
},
|
|
25
|
-
const { x: r, y:
|
|
26
|
-
return
|
|
27
|
-
},
|
|
24
|
+
}, b = (s) => {
|
|
25
|
+
const { x: r, y: p } = c(s);
|
|
26
|
+
return s === "top" || s === "bottom" ? p >= h && p + e.height <= i.height - h : r >= h && r + e.width <= i.width - h;
|
|
27
|
+
}, w = b(o) || !b(g[o]) ? o : g[o], { x: l, y: n } = c(w);
|
|
28
28
|
return {
|
|
29
|
-
x:
|
|
30
|
-
y:
|
|
31
|
-
placement:
|
|
29
|
+
x: P(l, h, i.width - e.width - h),
|
|
30
|
+
y: P(n, h, i.height - e.height - h),
|
|
31
|
+
placement: w
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
export {
|
|
35
|
-
|
|
35
|
+
O as computePosition
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
//# sourceMappingURL=position.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"position.js","names":["clamp","MARGIN","OPPOSITE","computePosition","anchor","floating","viewport","placement","offset","dir","align","crossX","place","p","physical","fits","x","y","chosen"],"sources":["../../src/overlay/position.ts"],"sourcesContent":["import { clamp } from \"../foundations/math.js\";\n/** Pure overlay positioning: preferred side, flip when it does not fit, shift to stay inside the viewport. */\n\nexport type Placement = \"top\" | \"bottom\" | \"start\" | \"end\";\n\ninterface Box {\n left: number;\n top: number;\n right: number;\n bottom: number;\n width: number;\n height: number;\n}\n\nconst MARGIN = 8;\nconst OPPOSITE: Record<Placement, Placement> = { top: \"bottom\", bottom: \"top\", start: \"end\", end: \"start\" };\n\nexport function computePosition(\n anchor: Box,\n floating: { width: number; height: number },\n viewport: { width: number; height: number },\n placement: Placement,\n offset: number,\n dir: \"ltr\" | \"rtl\",\n
|
|
1
|
+
{"version":3,"file":"position.js","names":["clamp","MARGIN","OPPOSITE","computePosition","anchor","floating","viewport","placement","offset","dir","align","crossX","crossY","place","p","physical","fits","x","y","chosen"],"sources":["../../src/overlay/position.ts"],"sourcesContent":["import { clamp } from \"../foundations/math.js\";\n/** Pure overlay positioning: preferred side, flip when it does not fit, shift to stay inside the viewport. */\n\nexport type Placement = \"top\" | \"bottom\" | \"start\" | \"end\";\n\ninterface Box {\n left: number;\n top: number;\n right: number;\n bottom: number;\n width: number;\n height: number;\n}\n\nconst MARGIN = 8;\nconst OPPOSITE: Record<Placement, Placement> = { top: \"bottom\", bottom: \"top\", start: \"end\", end: \"start\" };\n\nexport function computePosition(\n anchor: Box,\n floating: { width: number; height: number },\n viewport: { width: number; height: number },\n placement: Placement,\n offset: number,\n dir: \"ltr\" | \"rtl\",\n /**\n * Cross-axis alignment: centred on the anchor; `start`, flush with its start edge for top/bottom (lists, menus);\n * `flush`, that and also flush with its top edge for start/end (submenus beside their item).\n */\n align: \"center\" | \"start\" | \"flush\" = \"center\",\n): { x: number; y: number; placement: Placement } {\n const crossX =\n align !== \"center\"\n ? dir === \"rtl\"\n ? anchor.right - floating.width\n : anchor.left\n : anchor.left + anchor.width / 2 - floating.width / 2;\n const crossY = align === \"flush\" ? anchor.top : anchor.top + anchor.height / 2 - floating.height / 2;\n const place = (p: Placement) => {\n const physical =\n p === \"start\"\n ? dir === \"rtl\"\n ? \"right\"\n : \"left\"\n : p === \"end\"\n ? dir === \"rtl\"\n ? \"left\"\n : \"right\"\n : p;\n if (physical === \"top\") return { x: crossX, y: anchor.top - offset - floating.height };\n if (physical === \"bottom\") return { x: crossX, y: anchor.bottom + offset };\n if (physical === \"left\") return { x: anchor.left - offset - floating.width, y: crossY };\n return { x: anchor.right + offset, y: crossY };\n };\n const fits = (p: Placement) => {\n const { x, y } = place(p);\n return p === \"top\" || p === \"bottom\"\n ? y >= MARGIN && y + floating.height <= viewport.height - MARGIN\n : x >= MARGIN && x + floating.width <= viewport.width - MARGIN;\n };\n const chosen = fits(placement) || !fits(OPPOSITE[placement]) ? placement : OPPOSITE[placement];\n const { x, y } = place(chosen);\n return {\n x: clamp(x, MARGIN, viewport.width - floating.width - MARGIN),\n y: clamp(y, MARGIN, viewport.height - floating.height - MARGIN),\n placement: chosen,\n };\n}\n"],"mappings":";AAcA,IAAMC,IAAS,GACTC,IAAyC;AAAA,EAAE,KAAK;AAAA,EAAU,QAAQ;AAAA,EAAO,OAAO;AAAA,EAAO,KAAK;AAAQ;AAE1G,SAAgBC,EACdC,GACAC,GACAC,GACAC,GACAC,GACAC,GAKAC,IAAsC,UACU;AAChD,QAAMC,IACJD,MAAU,WACND,MAAQ,QACNL,EAAO,QAAQC,EAAS,QACxBD,EAAO,OACTA,EAAO,OAAOA,EAAO,QAAQ,IAAIC,EAAS,QAAQ,GAClDO,IAASF,MAAU,UAAUN,EAAO,MAAMA,EAAO,MAAMA,EAAO,SAAS,IAAIC,EAAS,SAAS,GAC7FQ,IAAA,CAASC,MAAiB;AAC9B,UAAMC,IACJD,MAAM,UACFL,MAAQ,QACN,UACA,SACFK,MAAM,QACJL,MAAQ,QACN,SACA,UACFK;AACR,WAAIC,MAAa,QAAc;AAAA,MAAE,GAAGJ;AAAA,MAAQ,GAAGP,EAAO,MAAMI,IAASH,EAAS;AAAA,IAAO,IACjFU,MAAa,WAAiB;AAAA,MAAE,GAAGJ;AAAA,MAAQ,GAAGP,EAAO,SAASI;AAAA,IAAO,IACrEO,MAAa,SAAe;AAAA,MAAE,GAAGX,EAAO,OAAOI,IAASH,EAAS;AAAA,MAAO,GAAGO;AAAA,IAAO,IAC/E;AAAA,MAAE,GAAGR,EAAO,QAAQI;AAAA,MAAQ,GAAGI;AAAA,IAAO;AAAA,EAC/C,GACMI,IAAA,CAAQF,MAAiB;AAC7B,UAAM,EAAE,GAAAG,GAAG,GAAAC,EAAA,IAAML,EAAMC,CAAC;AACxB,WAAOA,MAAM,SAASA,MAAM,WACxBI,KAAKjB,KAAUiB,IAAIb,EAAS,UAAUC,EAAS,SAASL,IACxDgB,KAAKhB,KAAUgB,IAAIZ,EAAS,SAASC,EAAS,QAAQL;AAAA,EAC5D,GACMkB,IAASH,EAAKT,CAAS,KAAK,CAACS,EAAKd,EAASK,CAAA,CAAU,IAAIA,IAAYL,EAASK,CAAA,GAC9E,EAAE,GAAAU,GAAG,GAAAC,EAAA,IAAML,EAAMM,CAAM;AAC7B,SAAO;AAAA,IACL,GAAGnB,EAAMiB,GAAGhB,GAAQK,EAAS,QAAQD,EAAS,QAAQJ,CAAM;AAAA,IAC5D,GAAGD,EAAMkB,GAAGjB,GAAQK,EAAS,SAASD,EAAS,SAASJ,CAAM;AAAA,IAC9D,WAAWkB;AAAA,EACb;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast-host.js","names":["createContext","ToastHostContext"],"sources":["../../src/overlay/toast-host.ts"],"sourcesContent":["import { createContext } from \"react\";\n\n/**\n * A modal Dialog makes everything outside it inert, the Toaster's region included. While a Dialog is open it lends the\n * Toaster a container inside itself (`register`), and the Toaster renders its region there: above the dialog in the\n * top layer and not inert. The latest registered container wins (nested dialogs). Kept apart from Toast so Dialog does\n * not pull Toast into its bundle.\n */\nexport interface ToastHostRegistry {\n register: (el: HTMLElement) => () => void;\n}\n\nexport const ToastHostContext = createContext<ToastHostRegistry | null>(null);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"toast-host.js","names":["createContext","ToastHostContext"],"sources":["../../src/overlay/toast-host.ts"],"sourcesContent":["import { createContext } from \"react\";\n\n/**\n * A modal Dialog makes everything outside it inert, the Toaster's region included. While a Dialog is open it lends the\n * Toaster a container inside itself (`register`), and the Toaster renders its region there: above the dialog in the\n * top layer and not inert. The latest registered container wins (nested dialogs). Kept apart from Toast so Dialog does\n * not pull Toast into its bundle.\n */\nexport interface ToastHostRegistry {\n register: (el: HTMLElement) => () => void;\n}\n\nexport const ToastHostContext = createContext<ToastHostRegistry | null>(null);\n"],"mappings":";;AAYA,IAAaC,IAAmBD,EAAwC,IAAI"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
2
|
import { type Placement } from "./position.js";
|
|
3
3
|
/** Anything with a viewport rectangle: an element, or a point such as a right-click position. */
|
|
4
4
|
export interface VirtualAnchor {
|
|
5
5
|
getBoundingClientRect(): DOMRect;
|
|
6
6
|
}
|
|
7
7
|
/** Keeps a fixed-position floating element anchored to `anchor` while `open` (follows scrolls, resizes and anchor moves). */
|
|
8
|
-
export declare function useAnchoredPosition(anchor: RefObject<HTMLElement | VirtualAnchor | null>, floating: RefObject<HTMLElement | null>, open: boolean, placement: Placement, offset?: number, align?: "center" | "start", onPlace?: (placement: Placement) => void): void;
|
|
8
|
+
export declare function useAnchoredPosition(anchor: RefObject<HTMLElement | VirtualAnchor | null>, floating: RefObject<HTMLElement | null>, open: boolean, placement: Placement, offset?: number, align?: "center" | "start" | "flush", onPlace?: (placement: Placement) => void): void;
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
if (!
|
|
7
|
-
let s = 0, c = 0,
|
|
8
|
-
const m = () => {
|
|
9
|
-
const
|
|
10
|
-
if (!
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
width:
|
|
15
|
-
height:
|
|
1
|
+
import { useClientLayoutEffect as A } from "../foundations/client-layout-effect.js";
|
|
2
|
+
import { isRtl as v } from "../foundations/dir.js";
|
|
3
|
+
import { computePosition as E } from "./position.js";
|
|
4
|
+
function L(r, o, a, d, l = 6, u = "center", f) {
|
|
5
|
+
A(() => {
|
|
6
|
+
if (!a) return;
|
|
7
|
+
let s = 0, c = 0, w = "";
|
|
8
|
+
const h = (t, e) => `${t.x},${t.y},${t.width},${t.height},${e.offsetWidth},${e.offsetHeight}`, m = () => {
|
|
9
|
+
const t = r.current, e = o.current;
|
|
10
|
+
if (!t || !e) return;
|
|
11
|
+
const $ = t.getBoundingClientRect();
|
|
12
|
+
w = h($, e);
|
|
13
|
+
const g = v(t instanceof Element ? t : e) ? "rtl" : "ltr", i = E($, {
|
|
14
|
+
width: e.offsetWidth,
|
|
15
|
+
height: e.offsetHeight
|
|
16
16
|
}, {
|
|
17
17
|
width: window.innerWidth,
|
|
18
18
|
height: window.innerHeight
|
|
19
|
-
}, l,
|
|
20
|
-
|
|
21
|
-
},
|
|
19
|
+
}, d, l, g, u);
|
|
20
|
+
e.style.left = `${i.x}px`, e.style.top = `${i.y}px`, e.dataset.placement = i.placement, f?.(i.placement);
|
|
21
|
+
}, n = () => {
|
|
22
22
|
cancelAnimationFrame(s), s = requestAnimationFrame(m);
|
|
23
23
|
}, p = () => {
|
|
24
|
-
const
|
|
25
|
-
e &&
|
|
24
|
+
const t = r.current?.getBoundingClientRect(), e = o.current;
|
|
25
|
+
t && e && h(t, e) !== w && m(), c = requestAnimationFrame(p);
|
|
26
26
|
};
|
|
27
|
-
return m(), c = requestAnimationFrame(p), window.addEventListener("scroll",
|
|
28
|
-
cancelAnimationFrame(s), cancelAnimationFrame(c), window.removeEventListener("scroll",
|
|
27
|
+
return m(), c = requestAnimationFrame(p), window.addEventListener("scroll", n, !0), window.addEventListener("resize", n), () => {
|
|
28
|
+
cancelAnimationFrame(s), cancelAnimationFrame(c), window.removeEventListener("scroll", n, !0), window.removeEventListener("resize", n);
|
|
29
29
|
};
|
|
30
30
|
}, [
|
|
31
|
+
r,
|
|
31
32
|
o,
|
|
32
33
|
a,
|
|
33
34
|
d,
|
|
34
35
|
l,
|
|
35
36
|
u,
|
|
36
|
-
|
|
37
|
-
h
|
|
37
|
+
f
|
|
38
38
|
]);
|
|
39
39
|
}
|
|
40
40
|
export {
|
|
41
|
-
|
|
41
|
+
L as useAnchoredPosition
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
//# sourceMappingURL=use-anchored-position.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-anchored-position.js","names":["
|
|
1
|
+
{"version":3,"file":"use-anchored-position.js","names":["useClientLayoutEffect","isRtl","computePosition","useAnchoredPosition","anchor","floating","open","placement","offset","align","onPlace","frame","watch","last","measure","r","f","update","a","dir","pos","schedule","follow"],"sources":["../../src/overlay/use-anchored-position.ts"],"sourcesContent":["import type { RefObject } from \"react\";\nimport { useClientLayoutEffect } from \"../foundations/client-layout-effect.js\";\nimport { isRtl } from \"../foundations/dir.js\";\nimport { computePosition, type Placement } from \"./position.js\";\n\n/** Anything with a viewport rectangle: an element, or a point such as a right-click position. */\nexport interface VirtualAnchor {\n getBoundingClientRect(): DOMRect;\n}\n\n/** Keeps a fixed-position floating element anchored to `anchor` while `open` (follows scrolls, resizes and anchor moves). */\nexport function useAnchoredPosition(\n anchor: RefObject<HTMLElement | VirtualAnchor | null>,\n floating: RefObject<HTMLElement | null>,\n open: boolean,\n placement: Placement,\n offset = 6,\n align: \"center\" | \"start\" | \"flush\" = \"center\",\n onPlace?: (placement: Placement) => void,\n) {\n useClientLayoutEffect(() => {\n if (!open) return;\n let frame = 0;\n let watch = 0;\n let last = \"\";\n // What the placement depends on besides the viewport: where the anchor is, and how big the floating element is.\n const measure = (r: DOMRect, f: HTMLElement) =>\n `${r.x},${r.y},${r.width},${r.height},${f.offsetWidth},${f.offsetHeight}`;\n const update = () => {\n const a = anchor.current;\n const f = floating.current;\n if (!a || !f) return;\n const r = a.getBoundingClientRect();\n last = measure(r, f);\n // A virtual anchor has no direction of its own: use the floating element's.\n const dir = isRtl(a instanceof Element ? a : f) ? \"rtl\" : \"ltr\";\n const pos = computePosition(\n r,\n { width: f.offsetWidth, height: f.offsetHeight },\n { width: window.innerWidth, height: window.innerHeight },\n placement,\n offset,\n dir,\n align,\n );\n f.style.left = `${pos.x}px`;\n f.style.top = `${pos.y}px`;\n f.dataset.placement = pos.placement;\n onPlace?.(pos.placement);\n };\n const schedule = () => {\n cancelAnimationFrame(frame);\n frame = requestAnimationFrame(update);\n };\n // Anchors also move without a scroll or resize (a list row reordered, content above growing), and the floating\n // element grows or shrinks with its content (a list filling in): follow both, flipping when it no longer fits.\n const follow = () => {\n const r = anchor.current?.getBoundingClientRect();\n const f = floating.current;\n if (r && f && measure(r, f) !== last) update();\n watch = requestAnimationFrame(follow);\n };\n update();\n watch = requestAnimationFrame(follow);\n window.addEventListener(\"scroll\", schedule, true);\n window.addEventListener(\"resize\", schedule);\n return () => {\n cancelAnimationFrame(frame);\n cancelAnimationFrame(watch);\n window.removeEventListener(\"scroll\", schedule, true);\n window.removeEventListener(\"resize\", schedule);\n };\n }, [anchor, floating, open, placement, offset, align, onPlace]);\n}\n"],"mappings":";;;AAWA,SAAgBG,EACdC,GACAC,GACAC,GACAC,GACAC,IAAS,GACTC,IAAsC,UACtCC,GACA;AACA,EAAAV,EAAA,MAA4B;AAC1B,QAAI,CAACM,EAAM;AACX,QAAIK,IAAQ,GACRC,IAAQ,GACRC,IAAO;AAEX,UAAMC,IAAA,CAAWC,GAAYC,MAC3B,GAAGD,EAAE,CAAA,IAAKA,EAAE,CAAA,IAAKA,EAAE,KAAA,IAASA,EAAE,MAAA,IAAUC,EAAE,WAAA,IAAeA,EAAE,YAAA,IACvDC,IAAA,MAAe;AACnB,YAAMC,IAAId,EAAO,SACXY,IAAIX,EAAS;AACnB,UAAI,CAACa,KAAK,CAACF,EAAG;AACd,YAAMD,IAAIG,EAAE,sBAAsB;AAClC,MAAAL,IAAOC,EAAQC,GAAGC,CAAC;AAEnB,YAAMG,IAAMlB,EAAMiB,aAAa,UAAUA,IAAIF,CAAC,IAAI,QAAQ,OACpDI,IAAMlB,EACVa,GACA;AAAA,QAAE,OAAOC,EAAE;AAAA,QAAa,QAAQA,EAAE;AAAA,MAAa,GAC/C;AAAA,QAAE,OAAO,OAAO;AAAA,QAAY,QAAQ,OAAO;AAAA,MAAY,GACvDT,GACAC,GACAW,GACAV,CACF;AACA,MAAAO,EAAE,MAAM,OAAO,GAAGI,EAAI,CAAA,MACtBJ,EAAE,MAAM,MAAM,GAAGI,EAAI,CAAA,MACrBJ,EAAE,QAAQ,YAAYI,EAAI,WAC1BV,IAAUU,EAAI,SAAS;AAAA,IACzB,GACMC,IAAA,MAAiB;AACrB,2BAAqBV,CAAK,GAC1BA,IAAQ,sBAAsBM,CAAM;AAAA,IACtC,GAGMK,IAAA,MAAe;AACnB,YAAMP,IAAIX,EAAO,SAAS,sBAAsB,GAC1CY,IAAIX,EAAS;AACnB,MAAIU,KAAKC,KAAKF,EAAQC,GAAGC,CAAC,MAAMH,KAAMI,EAAO,GAC7CL,IAAQ,sBAAsBU,CAAM;AAAA,IACtC;AACA,WAAAL,EAAO,GACPL,IAAQ,sBAAsBU,CAAM,GACpC,OAAO,iBAAiB,UAAUD,GAAU,EAAI,GAChD,OAAO,iBAAiB,UAAUA,CAAQ,GAC1C,MAAa;AACX,2BAAqBV,CAAK,GAC1B,qBAAqBC,CAAK,GAC1B,OAAO,oBAAoB,UAAUS,GAAU,EAAI,GACnD,OAAO,oBAAoB,UAAUA,CAAQ;AAAA,IAC/C;AAAA,EACF,GAAG;AAAA,IAACjB;AAAA,IAAQC;AAAA,IAAUC;AAAA,IAAMC;AAAA,IAAWC;AAAA,IAAQC;AAAA,IAAOC;AAAA,EAAO,CAAC;AAChE"}
|
package/dist/styles/badge.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.cy-badge.cy-badge{--_tone:var(--cy-color-ink);--_text:var(--cy-color-ink);--_on:var(--cy-color-bg);--_mix:var(--cy-badge-soft-mix,16%);align-items:center;gap:var(--cy-space-2);padding:var(--cy-space-2) var(--cy-space-3);border:var(--cy-border-width) solid transparent;border-radius:var(--cy-badge-radius,calc(var(--cy-radius-sm) * .6));background:color-mix(in oklab, var(--_tone) var(--_mix), var(--cy-color-surface));color:var(--_text);font-family:var(--cy-font-mono);font-size:var(--cy-font-eyebrow-size);font-weight:var(--cy-font-weight-bold);letter-spacing:var(--cy-badge-tracking,var(--cy-font-eyebrow-tracking));text-transform:uppercase;white-space:nowrap;vertical-align:middle;margin:0;line-height:1;display:inline-flex;box-sizing:border-box!important;&[data-size=sm]{font-size:calc(var(--cy-font-eyebrow-size) * .9);padding:var(--cy-space-1) var(--cy-space-2)}&[data-size=lg]{font-size:var(--cy-font-size-sm);padding:var(--cy-space-3) var(--cy-space-4)}&[data-tone=accent]{--_tone:var(--cy-color-accent);--_text:var(--cy-color-accent-text);--_on:var(--cy-color-on-accent)}&[data-tone=danger]{--_tone:var(--cy-color-danger);--_text:var(--cy-color-danger-text);--_on:var(--cy-color-on-danger)}&[data-tone=success]{--_tone:var(--cy-color-success);--_text:var(--cy-color-success-text);--_on:var(--cy-color-on-success)}&[data-tone=warning]{--_tone:var(--cy-color-warning);--_text:var(--cy-color-warning-text);--_on:var(--cy-color-on-warning)}&[data-tone=info]{--_tone:var(--cy-color-info);--_text:var(--cy-color-info-text);--_on:var(--cy-color-on-info)}&[data-color]{--_text:color-mix(in oklab, var(--_tone) 45%, var(--cy-color-ink));--_on:var(--cy-color-bg)}&[data-variant=solid]{background:var(--_tone);color:var(--_on)}&[data-variant=outline]{background:var(--cy-color-surface);border-color:color-mix(in oklab, var(--_tone) 55%, var(--cy-color-line))}}.cy-badge-dot.cy-badge-dot{background:currentColor;border-radius:50%;flex:none;block-size:.6em;inline-size:.6em;&[data-live]{animation:cy-badge-live 1.6s var(--cy-motion-ease) infinite}}@keyframes cy-badge-live{50%{opacity:.35;scale:.8}}@media (prefers-reduced-motion:reduce){.cy-badge-dot.cy-badge-dot[data-live]{animation:none}}@media (forced-colors:active){.cy-badge-dot.cy-badge-dot{background:canvastext}}
|
|
1
|
+
.cy-badge.cy-badge{--_tone:var(--cy-color-ink);--_text:var(--cy-color-ink);--_on:var(--cy-color-bg);--_mix:var(--cy-badge-soft-mix,16%);align-items:center;gap:var(--cy-space-2);padding:var(--cy-space-2) var(--cy-space-3);border:var(--cy-border-width) solid transparent;border-radius:var(--cy-badge-radius,calc(var(--cy-radius-sm) * .6));background:color-mix(in oklab, var(--_tone) var(--_mix), var(--cy-color-surface));color:var(--_text);font-family:var(--cy-font-mono);font-size:var(--cy-font-eyebrow-size);font-weight:var(--cy-font-weight-bold);letter-spacing:var(--cy-badge-tracking,var(--cy-font-eyebrow-tracking));text-transform:uppercase;white-space:nowrap;vertical-align:middle;margin:0;line-height:1;display:inline-flex;box-sizing:border-box!important;&[data-size=sm]{font-size:calc(var(--cy-font-eyebrow-size) * .9);padding:var(--cy-space-1) var(--cy-space-2)}&[data-size=lg]{font-size:var(--cy-font-size-sm);padding:var(--cy-space-3) var(--cy-space-4)}&[data-tone=accent]{--_tone:var(--cy-color-accent);--_text:var(--cy-color-accent-text);--_on:var(--cy-color-on-accent)}&[data-tone=danger]{--_tone:var(--cy-color-danger);--_text:var(--cy-color-danger-text);--_on:var(--cy-color-on-danger)}&[data-tone=success]{--_tone:var(--cy-color-success);--_text:var(--cy-color-success-text);--_on:var(--cy-color-on-success)}&[data-tone=warning]{--_tone:var(--cy-color-warning);--_text:var(--cy-color-warning-text);--_on:var(--cy-color-on-warning)}&[data-tone=info]{--_tone:var(--cy-color-info);--_text:var(--cy-color-info-text);--_on:var(--cy-color-on-info)}&[data-color]{--_text:color-mix(in oklab, var(--_tone) 45%, var(--cy-color-ink));--_on:var(--cy-color-bg)}&[data-variant=solid]{background:var(--_tone);color:var(--_on)}&[data-variant=outline]{background:var(--cy-color-surface);border-color:color-mix(in oklab, var(--_tone) 55%, var(--cy-color-line))}&[data-dot-only]{color:var(--_tone);background:0 0;border:0;padding:0}}.cy-badge-dot.cy-badge-dot{background:currentColor;border-radius:50%;flex:none;block-size:.6em;inline-size:.6em;&[data-live]{animation:cy-badge-live 1.6s var(--cy-motion-ease) infinite}}@keyframes cy-badge-live{50%{opacity:.35;scale:.8}}@media (prefers-reduced-motion:reduce){.cy-badge-dot.cy-badge-dot[data-live]{animation:none}}@media (forced-colors:active){.cy-badge-dot.cy-badge-dot{background:canvastext}}
|
package/dist/styles/base.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:where([data-cy-mode=light]){color-scheme:light}:where([data-cy-mode=dark]){color-scheme:dark}:where([data-cy-mode=system]),:where(.cy-theme:not(.cy-theme *)):not([data-cy-mode]){color-scheme:light dark}.cy-theme{color:var(--cy-color-ink);font-family:var(--cy-font-sans);font-size:var(--cy-font-size-md);line-height:var(--cy-font-line-height);display:contents}.cy-reset,.cy-reset:before,.cy-reset:after{font:inherit;color:inherit;letter-spacing:normal;text-transform:none;margin:0;box-sizing:border-box!important}@media (prefers-reduced-motion:reduce){:where([class
|
|
1
|
+
:where([data-cy-mode=light]){color-scheme:light}:where([data-cy-mode=dark]){color-scheme:dark}:where([data-cy-mode=system]),:where(.cy-theme:not(.cy-theme *)):not([data-cy-mode]){color-scheme:light dark}.cy-theme{color:var(--cy-color-ink);font-family:var(--cy-font-sans);font-size:var(--cy-font-size-md);line-height:var(--cy-font-line-height);display:contents}.cy-reset,.cy-reset:before,.cy-reset:after{font:inherit;color:inherit;letter-spacing:normal;text-transform:none;margin:0;box-sizing:border-box!important}@media (prefers-reduced-motion:reduce){:where([class^=cy-],[class*=\ cy-]),:where([class^=cy-],[class*=\ cy-]):before,:where([class^=cy-],[class*=\ cy-]):after,.cy-reset,.cy-reset *,.cy-reset:before,.cy-reset:after{transition-duration:0s!important;animation-duration:0s!important;animation-iteration-count:1!important}}@media (width<30rem){[data-cy-hide-below=sm]{display:none!important}}@media (width<45rem){[data-cy-hide-below=md]{display:none!important}}@media (width<60rem){[data-cy-hide-below=lg]{display:none!important}}@media (width<75rem){[data-cy-hide-below=xl]{display:none!important}}@media (width>=30rem){[data-cy-hide-above=sm]{display:none!important}}@media (width>=45rem){[data-cy-hide-above=md]{display:none!important}}@media (width>=60rem){[data-cy-hide-above=lg]{display:none!important}}@media (width>=75rem){[data-cy-hide-above=xl]{display:none!important}}[data-cy-grow][data-cy-grow]{flex-grow:1}[data-cy-shrink=false][data-cy-shrink=false]{flex-shrink:0}[data-cy-fill][data-cy-fill]{block-size:100%;inline-size:100%}[data-cy-min-size="0"][data-cy-min-size="0"]{min-block-size:0;min-inline-size:0}[data-cy-overflow=hidden][data-cy-overflow=hidden]{overflow:hidden}[data-cy-overflow=auto][data-cy-overflow=auto]{overflow:auto}[data-cy-overflow=visible][data-cy-overflow=visible]{overflow:visible}.cy-visually-hidden{inline-size:var(--cy-border-width);block-size:var(--cy-border-width);margin:calc(var(--cy-border-width) * -1);clip-path:inset(50%);white-space:nowrap;border:0;padding:0;overflow:hidden;position:absolute!important}
|
package/dist/styles/button.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.cy-button-content{align-items:center;gap:var(--cy-button-gap,var(--cy-space-3));min-inline-size:0;max-inline-size:100%;display:inline-flex}.cy-button-label{text-overflow:ellipsis;white-space:nowrap;min-inline-size:0;overflow:hidden}.cy-button-label.cy-button-label{line-height:normal}.cy-button-loading.cy-button-loading.cy-button-loading{inline-size:fit-content;margin:auto;position:absolute;inset:0}.cy-button.cy-button{--_tone:var(--cy-color-ink);--_tone-text:var(--cy-color-ink);--_on:var(--cy-color-bg);--_tone-hover:color-mix(in oklab, var(--_tone) 86%, var(--cy-color-bg));--_soft:var(--cy-button-soft-mix,14%);--_outline:var(--cy-button-outline-mix,55%);--_h:var(--cy-button-height-md,var(--cy-control-height-md));--_hit:var(--cy-hit-min,24px);--_bg:var(--cy-color-surface);--_fg:var(--_tone-text);--_border:color-mix(in oklab, var(--_tone) var(--_outline), var(--cy-color-line));--_hover:color-mix(in oklab, var(--_tone) var(--_soft), var(--cy-color-surface));letter-spacing:normal;text-transform:none;block-size:var(--_h);min-block-size:var(--_h);max-inline-size:var(--cy-button-max-width,32ch);min-inline-size:0;padding:0 var(--cy-button-padding-inline,var(--cy-space-5));border:var(--cy-border-width) solid var(--_border);border-radius:var(--cy-button-radius,calc(var(--_h) * var(--cy-radius-factor)));background:var(--_bg);color:var(--_fg);font-family:var(--cy-font-sans);font-size:var(--cy-font-size-md);font-weight:var(--cy-button-font-weight,var(--cy-font-weight-medium));white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;appearance:none;transition:background-color var(--cy-motion-fast) var(--cy-motion-ease), border-color var(--cy-motion-fast) var(--cy-motion-ease), box-shadow var(--cy-motion-fast) var(--cy-motion-ease), transform var(--cy-motion-fast) var(--cy-motion-ease);background-image:none;flex:none;justify-content:center;align-items:center;margin:0;line-height:1;text-decoration:none;display:inline-flex;position:relative;box-sizing:border-box!important;&:before{content:"";inline-size:max(100%, var(--_hit));block-size:max(100%, var(--_hit));position:absolute;top:50%;left:50%;translate:-50% -50%}&[data-tone=accent]{--_tone:var(--cy-color-accent);--_tone-text:var(--cy-color-accent-text);--_on:var(--cy-color-on-accent);--_tone-hover:var(--cy-color-accent-hover)}&[data-tone=danger]{--_tone:var(--cy-color-danger);--_tone-text:var(--cy-color-danger-text);--_on:var(--cy-color-on-danger)}&[data-tone=success]{--_tone:var(--cy-color-success);--_tone-text:var(--cy-color-success-text);--_on:var(--cy-color-on-success)}&[data-tone=warning]{--_tone:var(--cy-color-warning);--_tone-text:var(--cy-color-warning-text);--_on:var(--cy-color-on-warning)}&[data-tone=info]{--_tone:var(--cy-color-info);--_tone-text:var(--cy-color-info-text);--_on:var(--cy-color-on-info)}&[data-variant=solid]{--_bg:var(--_tone);--_fg:var(--_on);--_border:transparent;--_hover:var(--_tone-hover);box-shadow:var(--cy-button-solid-shadow,var(--cy-shadow-lit))}&[data-variant=soft]{--_bg:color-mix(in oklab, var(--_tone) var(--_soft), var(--cy-color-surface));--_border:transparent;--_hover:color-mix(in oklab, var(--_tone) calc(var(--_soft) * 1.7), var(--cy-color-surface))}&[data-variant=ghost]{--_bg:transparent;--_border:transparent}&[data-color]{--_on:oklch(from var(--_tone) clamp(0, (.68 - l) * 1000, 1) 0 0);--_tone-text:light-dark(oklch(from var(--_tone) min(l, .48) c h),oklch(from var(--_tone) max(l, .8) c h));--_fg:var(--_tone-text)}&[data-color][data-variant=solid]{--_fg:var(--_on)}&[data-tone=neutral]:is([data-variant=soft],[data-variant=ghost],[data-variant=outline]){--_fg:var(--cy-color-ink)}&[data-tone=neutral][data-variant=outline]{--_border:var(--cy-color-line);--_hover:var(--cy-color-soft)}&[data-size=sm]{--_h:var(--cy-button-height-sm,var(--cy-control-height-sm));font-size:var(--cy-font-size-sm)}&[data-size=lg]{--_h:var(--cy-button-height-lg,var(--cy-control-height-lg));font-size:var(--cy-font-size-lg)}&[data-full]{inline-size:100%;max-inline-size:none}&[data-square]{inline-size:var(--_h);padding:0;& .cy-button-label{display:contents}}&:hover:not(:disabled,[aria-disabled=true]){background:var(--_hover)}&:active:not(:disabled,[aria-disabled=true]){transform:scale(var(--cy-button-press-scale,.97))}&[data-pressed]{--_bg:color-mix(in oklab, var(--_tone) var(--_soft), var(--cy-color-surface));--_border:var(--_tone)}&:focus-visible{outline:var(--cy-border-focus) solid transparent;outline-offset:0;border-color:var(--cy-color-accent);box-shadow:0 0 0 var(--cy-border-focus) var(--cy-color-ring)}&:disabled{opacity:.5;cursor:not-allowed}&[data-loading]{cursor:progress}&[data-loading] .cy-button-content{opacity:0}}@media (pointer:coarse){.cy-button.cy-button{--_hit:var(--cy-hit-coarse,44px)}}
|
|
1
|
+
.cy-button-content{align-items:center;gap:var(--cy-button-gap,var(--cy-space-3));min-inline-size:0;max-inline-size:100%;display:inline-flex}.cy-button-label{text-overflow:ellipsis;white-space:nowrap;min-inline-size:0;overflow:hidden}.cy-button-label.cy-button-label{line-height:normal}.cy-button-loading.cy-button-loading.cy-button-loading{inline-size:fit-content;margin:auto;position:absolute;inset:0}.cy-button.cy-button{--_tone:var(--cy-color-ink);--_tone-text:var(--cy-color-ink);--_on:var(--cy-color-bg);--_tone-hover:color-mix(in oklab, var(--_tone) 86%, var(--cy-color-bg));--_soft:var(--cy-button-soft-mix,14%);--_outline:var(--cy-button-outline-mix,55%);--_h:var(--cy-button-height-md,var(--cy-control-height-md));--_hit:var(--cy-hit-min,24px);--_bg:var(--cy-color-surface);--_fg:var(--_tone-text);--_border:color-mix(in oklab, var(--_tone) var(--_outline), var(--cy-color-line));--_hover:color-mix(in oklab, var(--_tone) var(--_soft), var(--cy-color-surface));letter-spacing:normal;text-transform:none;block-size:var(--_h);min-block-size:var(--_h);max-inline-size:var(--cy-button-max-width,32ch);min-inline-size:0;padding:0 var(--cy-button-padding-inline,var(--cy-space-5));border:var(--cy-border-width) solid var(--_border);border-radius:var(--cy-button-radius,calc(var(--_h) * var(--cy-radius-factor)));background:var(--_bg);color:var(--_fg);font-family:var(--cy-font-sans);font-size:var(--cy-font-size-md);font-weight:var(--cy-button-font-weight,var(--cy-font-weight-medium));white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;appearance:none;transition:background-color var(--cy-motion-fast) var(--cy-motion-ease), border-color var(--cy-motion-fast) var(--cy-motion-ease), box-shadow var(--cy-motion-fast) var(--cy-motion-ease), transform var(--cy-motion-fast) var(--cy-motion-ease);background-image:none;flex:none;justify-content:center;align-items:center;margin:0;line-height:1;text-decoration:none;display:inline-flex;position:relative;box-sizing:border-box!important;&:before{content:"";inline-size:max(100%, var(--_hit));block-size:max(100%, var(--_hit));position:absolute;top:50%;left:50%;translate:-50% -50%}&[data-tone=accent]{--_tone:var(--cy-color-accent);--_tone-text:var(--cy-color-accent-text);--_on:var(--cy-color-on-accent);--_tone-hover:var(--cy-color-accent-hover)}&[data-tone=danger]{--_tone:var(--cy-color-danger);--_tone-text:var(--cy-color-danger-text);--_on:var(--cy-color-on-danger)}&[data-tone=success]{--_tone:var(--cy-color-success);--_tone-text:var(--cy-color-success-text);--_on:var(--cy-color-on-success)}&[data-tone=warning]{--_tone:var(--cy-color-warning);--_tone-text:var(--cy-color-warning-text);--_on:var(--cy-color-on-warning)}&[data-tone=info]{--_tone:var(--cy-color-info);--_tone-text:var(--cy-color-info-text);--_on:var(--cy-color-on-info)}&[data-variant=solid]{--_bg:var(--_tone);--_fg:var(--_on);--_border:transparent;--_hover:var(--_tone-hover);box-shadow:var(--cy-button-solid-shadow,var(--cy-shadow-lit))}&[data-variant=soft]{--_bg:color-mix(in oklab, var(--_tone) var(--_soft), var(--cy-color-surface));--_border:transparent;--_hover:color-mix(in oklab, var(--_tone) calc(var(--_soft) * 1.7), var(--cy-color-surface))}&[data-variant=ghost]{--_bg:transparent;--_border:transparent}&[data-color]{--_on:oklch(from var(--_tone) clamp(0, (.68 - l) * 1000, 1) 0 0);--_tone-text:light-dark(oklch(from var(--_tone) min(l, .48) c h),oklch(from var(--_tone) max(l, .8) c h));--_fg:var(--_tone-text)}&[data-color][data-variant=solid]{--_fg:var(--_on)}&[data-tone=neutral]:is([data-variant=soft],[data-variant=ghost],[data-variant=outline]){--_fg:var(--cy-color-ink)}&[data-tone=neutral][data-variant=outline]{--_border:var(--cy-color-line);--_hover:var(--cy-color-soft)}&[data-size=sm]{--_h:var(--cy-button-height-sm,var(--cy-control-height-sm));font-size:var(--cy-font-size-sm)}&[data-size=xs]{--_h:var(--cy-button-height-xs,var(--cy-control-height-xs));padding-inline:var(--cy-button-padding-inline-xs,var(--cy-space-4));font-size:var(--cy-font-size-xs)}&[data-size=lg]{--_h:var(--cy-button-height-lg,var(--cy-control-height-lg));font-size:var(--cy-font-size-lg)}&[data-full]{inline-size:100%;max-inline-size:none}&[data-square]{inline-size:var(--cy-button-square-width,var(--_h));padding:0;& .cy-button-label{display:contents}}&:hover:not(:disabled,[aria-disabled=true]){background:var(--cy-button-hover-bg,var(--_hover));color:var(--cy-button-hover-ink,var(--_fg))}&:active:not(:disabled,[aria-disabled=true]){transform:scale(var(--cy-button-press-scale,.97))}&[data-pressed]{--_bg:color-mix(in oklab, var(--_tone) var(--_soft), var(--cy-color-surface));--_border:var(--_tone)}&:focus-visible{outline:var(--cy-border-focus) solid transparent;outline-offset:0;border-color:var(--cy-color-accent);box-shadow:0 0 0 var(--cy-border-focus) var(--cy-color-ring)}&:disabled{opacity:.5;cursor:not-allowed}&[data-loading]{cursor:progress}&[data-loading] .cy-button-content{opacity:0}}@media (pointer:coarse){.cy-button.cy-button{--_hit:var(--cy-hit-coarse,44px)}}
|
package/dist/styles/calendar.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.cy-calendar.cy-calendar{--_base:var(--cy-calendar-cell-size,var(--cy-control-height-md));--_cell:max(var(--_base), var(--_hit));--_content:var(--cy-calendar-content-size,calc(2.5 * var(--_base)));--_hit:var(--cy-hit-min,24px);gap:var(--cy-space-3);max-inline-size:100%;color:var(--cy-color-ink);font-family:var(--cy-font-sans);font-size:var(--cy-font-size-md);font-weight:var(--cy-font-weight-regular);line-height:var(--cy-font-line-height);letter-spacing:normal;text-transform:none;flex-direction:column;margin:0;display:inline-flex;box-sizing:border-box!important;&[data-size=sm]{--_base:var(--cy-calendar-cell-size,var(--cy-control-height-sm));font-size:var(--cy-font-size-sm)}&[data-size=lg]{--_base:var(--cy-calendar-cell-size,var(--cy-control-height-lg));font-size:var(--cy-font-size-lg)}&[data-days]{display:flex}}@media (pointer:coarse){.cy-calendar.cy-calendar{--_hit:var(--cy-hit-coarse,44px);--_content:var(--cy-calendar-content-size,calc(1.5 * var(--_hit)))}}.cy-calendar-head.cy-calendar-head{justify-content:space-between;align-items:center;gap:var(--cy-space-3);font-size:inherit;display:flex}.cy-calendar-title.cy-calendar-title{font-size:inherit;font-weight:var(--cy-font-weight-medium)}.cy-calendar-jump.cy-calendar-jump{min-inline-size:0}.cy-calendar-picker.cy-calendar-picker{gap:var(--cy-space-3);font-size:var(--cy-font-size-md);display:grid}.cy-calendar-months.cy-calendar-months{gap:var(--cy-space-2);font-size:inherit;grid-template-columns:repeat(3,minmax(0,1fr));display:grid}.cy-calendar-grid.cy-calendar-grid{border-collapse:collapse;border-spacing:0;table-layout:fixed;inline-size:auto;font-size:inherit;border:0;margin:0;& thead,& tbody,& tr{font-size:inherit;background:0 0;border:0}}.cy-calendar-weekday.cy-calendar-weekday{padding:0 0 var(--cy-space-2);color:var(--cy-color-muted);font-size:var(--cy-font-size-xs);font-weight:var(--cy-font-weight-medium);text-align:center;border:0}.cy-calendar-day.cy-calendar-day{box-sizing:border-box;--_tone:var(--cy-color-ink);inline-size:var(--_cell);block-size:var(--_cell);border-radius:var(--cy-radius-md);color:var(--cy-color-ink);font-size:inherit;font-variant-numeric:tabular-nums;text-align:center;vertical-align:middle;cursor:pointer;-webkit-tap-highlight-color:transparent;background:0 0;border:0;outline:none;padding:0;position:relative;&:hover:not([aria-disabled=true]){background:var(--cy-color-soft)}&:focus-visible{box-shadow:inset 0 0 0 var(--cy-border-focus) var(--cy-color-ring)}&[data-outside]{color:var(--cy-color-muted)}&[data-tone]:not([data-outside],[aria-selected=true]){--_mix:var(--cy-calendar-tone-mix,12%);background:color-mix(in oklab, var(--_tone) var(--_mix), transparent);&:hover:not([aria-disabled=true]){background:color-mix(in oklab, var(--_tone) calc(var(--_mix) * 1.7), transparent)}}&[aria-current=date]{box-shadow:inset 0 0 0 var(--cy-border-width) var(--cy-color-accent);font-weight:var(--cy-font-weight-medium)}&[aria-current=date]:focus-visible{box-shadow:inset 0 0 0 var(--cy-border-focus) var(--cy-color-ring), inset 0 0 0 calc(var(--cy-border-focus) + var(--cy-border-width)) var(--cy-color-accent)}&[aria-selected=true]{background:var(--cy-calendar-selected-background,var(--cy-color-accent));color:var(--cy-color-on-accent);&:hover{background:var(--cy-calendar-selected-background,var(--cy-color-accent))}}&[aria-disabled=true]{color:var(--cy-color-muted);cursor:not-allowed;text-decoration:line-through}}.cy-calendar-number.cy-calendar-number{font-size:inherit}.cy-calendar
|
|
1
|
+
.cy-calendar.cy-calendar{--_base:var(--cy-calendar-cell-size,var(--cy-control-height-md));--_cell:max(var(--_base), var(--_hit));--_content:var(--cy-calendar-content-size,calc(2.5 * var(--_base)));--_hit:var(--cy-hit-min,24px);gap:var(--cy-space-3);max-inline-size:100%;color:var(--cy-color-ink);font-family:var(--cy-font-sans);font-size:var(--cy-font-size-md);font-weight:var(--cy-font-weight-regular);line-height:var(--cy-font-line-height);letter-spacing:normal;text-transform:none;flex-direction:column;margin:0;display:inline-flex;box-sizing:border-box!important;&[data-size=sm]{--_base:var(--cy-calendar-cell-size,var(--cy-control-height-sm));font-size:var(--cy-font-size-sm)}&[data-size=lg]{--_base:var(--cy-calendar-cell-size,var(--cy-control-height-lg));font-size:var(--cy-font-size-lg)}&[data-days]{display:flex}}@media (pointer:coarse){.cy-calendar.cy-calendar{--_hit:var(--cy-hit-coarse,44px);--_content:var(--cy-calendar-content-size,calc(1.5 * var(--_hit)))}}.cy-calendar-head.cy-calendar-head{justify-content:space-between;align-items:center;gap:var(--cy-space-3);font-size:inherit;display:flex}.cy-calendar-title.cy-calendar-title{font-size:inherit;font-weight:var(--cy-font-weight-medium)}.cy-calendar-jump.cy-calendar-jump{min-inline-size:0}.cy-calendar-picker.cy-calendar-picker{gap:var(--cy-space-3);font-size:var(--cy-font-size-md);display:grid}.cy-calendar-months.cy-calendar-months{gap:var(--cy-space-2);font-size:inherit;grid-template-columns:repeat(3,minmax(0,1fr));display:grid}.cy-calendar-grid.cy-calendar-grid{border-collapse:collapse;border-spacing:0;table-layout:fixed;inline-size:auto;font-size:inherit;border:0;margin:0;& thead,& tbody,& tr{font-size:inherit;background:0 0;border:0}}.cy-calendar-weekday.cy-calendar-weekday{padding:0 0 var(--cy-space-2);color:var(--cy-color-muted);font-size:var(--cy-font-size-xs);font-weight:var(--cy-font-weight-medium);text-align:center;border:0}.cy-calendar-day.cy-calendar-day{box-sizing:border-box;--_tone:var(--cy-color-ink);inline-size:var(--_cell);block-size:var(--_cell);border-radius:var(--cy-radius-md);color:var(--cy-color-ink);font-size:inherit;font-variant-numeric:tabular-nums;text-align:center;vertical-align:middle;cursor:pointer;-webkit-tap-highlight-color:transparent;background:0 0;border:0;outline:none;padding:0;position:relative;&:hover:not([aria-disabled=true]){background:var(--cy-color-soft)}&:focus-visible{box-shadow:inset 0 0 0 var(--cy-border-focus) var(--cy-color-ring)}&[data-outside]{color:var(--cy-color-muted)}&[data-tone]:not([data-outside],[aria-selected=true]){--_mix:var(--cy-calendar-tone-mix,12%);background:color-mix(in oklab, var(--_tone) var(--_mix), transparent);&:hover:not([aria-disabled=true]){background:color-mix(in oklab, var(--_tone) calc(var(--_mix) * 1.7), transparent)}}&[aria-current=date]{box-shadow:inset 0 0 0 var(--cy-border-width) var(--cy-color-accent);font-weight:var(--cy-font-weight-medium)}&[aria-current=date]:focus-visible{box-shadow:inset 0 0 0 var(--cy-border-focus) var(--cy-color-ring), inset 0 0 0 calc(var(--cy-border-focus) + var(--cy-border-width)) var(--cy-color-accent)}&[aria-selected=true]{background:var(--cy-calendar-selected-background,var(--cy-color-accent));color:var(--cy-color-on-accent);&:hover{background:var(--cy-calendar-selected-background,var(--cy-color-accent))}}&[aria-disabled=true]{color:var(--cy-color-muted);cursor:not-allowed;text-decoration:line-through}}.cy-calendar-number.cy-calendar-number{font-size:inherit}.cy-calendar .cy-calendar-day{&[data-tone=accent]{--_tone:var(--cy-color-accent)}&[data-tone=danger]{--_tone:var(--cy-color-danger)}&[data-tone=success]{--_tone:var(--cy-color-success)}&[data-tone=warning]{--_tone:var(--cy-color-warning)}&[data-tone=info]{--_tone:var(--cy-color-info)}}.cy-calendar-dots.cy-calendar-dots{justify-content:center;gap:var(--cy-space-1);pointer-events:none;display:flex;position:absolute;inset-block-end:var(--cy-space-1);inset-inline:0}.cy-calendar-dot.cy-calendar-dot{inline-size:var(--cy-calendar-dot-size,var(--cy-space-2));block-size:var(--cy-calendar-dot-size,var(--cy-space-2));border-radius:var(--cy-radius-full,50%);background:var(--_tone)}.cy-calendar-day[aria-selected=true] .cy-calendar-dot{box-shadow:0 0 0 var(--cy-border-width) var(--cy-color-on-accent)}.cy-calendar.cy-calendar[data-days] .cy-calendar-grid{inline-size:100%;min-inline-size:calc(7 * var(--_hit) + 2 * var(--cy-border-width))}.cy-calendar.cy-calendar[data-days] .cy-calendar-day{inline-size:auto;block-size:max(var(--_content), var(--_hit));padding:var(--cy-space-2);border:var(--cy-border-width) solid var(--cy-color-line);text-align:start;vertical-align:top;border-radius:0}.cy-calendar.cy-calendar[data-days] .cy-calendar-dots{justify-content:flex-start;margin-block-start:var(--cy-space-1);position:static}.cy-calendar-extra.cy-calendar-extra{font-size:var(--cy-font-size-xs);margin-block-start:var(--cy-space-1);display:block;overflow:hidden}@media (forced-colors:active){.cy-calendar-day.cy-calendar-day[data-tone]:not([data-outside],[aria-selected=true]){outline:var(--cy-border-width) dashed CanvasText;outline-offset:calc(-1 * var(--cy-border-width))}.cy-calendar-dot.cy-calendar-dot{box-shadow:none;background:canvastext}.cy-calendar-day.cy-calendar-day[aria-selected=true]{outline:var(--cy-border-width) solid Highlight;outline-offset:calc(-1 * var(--cy-border-width))}}
|
package/dist/styles/card.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.cy-card.cy-card{--_tone:var(--cy-color-ink);--_pad:var(--cy-space-6);inline-size:100%;min-inline-size:0;padding:var(--_pad);border:var(--cy-border-width) solid var(--cy-card-border,color-mix(in oklab, var(--_tone) 14%, transparent));border-radius:var(--cy-card-radius,var(--cy-radius-card));background:var(--cy-card-bg,var(--cy-color-surface));box-shadow:var(--cy-card-shadow,var(--cy-shadow-sm));color:var(--cy-color-ink);font-family:var(--cy-font-sans);font-size:var(--cy-font-size-md);font-weight:var(--cy-font-weight-regular);line-height:var(--cy-font-line-height);text-align:start;margin:0;text-decoration:none;list-style:none;display:block;box-sizing:border-box!important;&[data-padding=none]{--_pad:var(--cy-space-0)}&[data-padding=sm]{--_pad:var(--cy-space-4)}&[data-padding=lg]{--_pad:var(--cy-space-8)}&[data-tone=accent]{--_tone:var(--cy-color-accent)}&[data-tone=danger]{--_tone:var(--cy-color-danger)}&[data-tone=success]{--_tone:var(--cy-color-success)}&[data-tone=warning]{--_tone:var(--cy-color-warning)}&[data-tone=info]{--_tone:var(--cy-color-info)}&:not([data-tone=neutral]){border-color:color-mix(in oklab, var(--_tone) 45%, transparent)}&[data-variant=outline]{box-shadow:none;background:0 0}&[data-variant=soft]{background:color-mix(in oklab, var(--_tone) var(--cy-card-soft-mix,10%), var(--cy-color-surface));box-shadow:none}&[data-edge][data-edge][data-edge]{border-inline-start-width:var(--cy-card-edge-width,var(--cy-space-2));border-inline-start-color:var(--_edge)}&[data-
|
|
1
|
+
.cy-card.cy-card{--_tone:var(--cy-color-ink);--_pad:var(--cy-space-6);inline-size:100%;min-inline-size:0;padding:var(--_pad);border:var(--cy-border-width) solid var(--cy-card-border,color-mix(in oklab, var(--_tone) 14%, transparent));border-radius:var(--cy-card-radius,var(--cy-radius-card));background:var(--cy-card-bg,var(--cy-color-surface));box-shadow:var(--cy-card-shadow,var(--cy-shadow-sm));color:var(--cy-color-ink);font-family:var(--cy-font-sans);font-size:var(--cy-font-size-md);font-weight:var(--cy-font-weight-regular);line-height:var(--cy-font-line-height);text-align:start;margin:0;text-decoration:none;list-style:none;display:block;box-sizing:border-box!important;&[data-padding=none]{--_pad:var(--cy-space-0)}&[data-padding=sm]{--_pad:var(--cy-space-4)}&[data-padding=lg]{--_pad:var(--cy-space-8)}&[data-tone=accent]{--_tone:var(--cy-color-accent)}&[data-tone=danger]{--_tone:var(--cy-color-danger)}&[data-tone=success]{--_tone:var(--cy-color-success)}&[data-tone=warning]{--_tone:var(--cy-color-warning)}&[data-tone=info]{--_tone:var(--cy-color-info)}&:not([data-tone=neutral]){border-color:color-mix(in oklab, var(--_tone) 45%, transparent)}&[data-variant=outline]{box-shadow:none;background:0 0}&[data-variant=soft]{background:color-mix(in oklab, var(--_tone) var(--cy-card-soft-mix,10%), var(--cy-color-surface));box-shadow:none}&[data-edge][data-edge][data-edge]{border-inline-start-width:var(--cy-card-edge-width,var(--cy-space-2));border-inline-start-color:var(--_edge)}&[data-interactive][aria-current]:not([aria-current=false]){border-color:var(--cy-card-current-border,var(--cy-color-accent))}&[data-interactive]{cursor:pointer;-webkit-tap-highlight-color:transparent;transition:transform var(--cy-motion-fast) var(--cy-motion-ease), border-color var(--cy-motion-fast) var(--cy-motion-ease), box-shadow var(--cy-motion-fast) var(--cy-motion-ease);&:hover{border-color:color-mix(in oklab, var(--_tone) 60%, transparent);box-shadow:var(--cy-shadow-md)}&:active{transform:scale(.99)}&:focus-visible{outline:var(--cy-border-focus) solid transparent;outline-offset:0;border-color:var(--cy-color-accent);box-shadow:0 0 0 var(--cy-border-focus) var(--cy-color-ring)}&:disabled{cursor:not-allowed;opacity:.55;box-shadow:none;transform:none}}}@media (prefers-reduced-motion:reduce){.cy-card.cy-card[data-interactive]{transition:none;&:active{transform:none}}}@media (forced-colors:active){.cy-card.cy-card{border-color:canvastext;&[data-edge][data-edge][data-edge]{border-inline-start-color:canvastext}}}.cy-card-frame.cy-card-frame{font-size:inherit;display:grid;position:relative}.cy-card-actions.cy-card-actions{z-index:1;gap:var(--cy-space-2);font-size:inherit;display:flex;position:absolute;inset-block-start:var(--cy-space-3);inset-inline-end:var(--cy-space-3)}.cy-card.cy-card:has(>.cy-card-actions){position:relative}.cy-card-header.cy-card-header{align-items:flex-start;gap:var(--cy-space-4);font-size:inherit;display:flex;&:not(:last-child){margin-block-end:var(--cy-space-5)}}.cy-card-heading.cy-card-heading{gap:var(--cy-space-2);min-inline-size:0;font-size:inherit;flex-direction:column;flex:1;display:flex}.cy-card-title.cy-card-title{color:var(--cy-color-ink);font-family:var(--cy-font-sans);font-size:var(--cy-card-title-size,var(--cy-font-size-lg));font-weight:var(--cy-font-weight-bold);line-height:var(--cy-font-line-height);letter-spacing:normal;text-transform:none;overflow-wrap:anywhere;margin:0}.cy-card-description.cy-card-description{color:var(--cy-color-muted);font-family:var(--cy-font-sans);font-size:var(--cy-font-size-sm);font-weight:var(--cy-font-weight-regular);line-height:var(--cy-font-line-height);letter-spacing:normal;text-transform:none;margin:0}.cy-card-body.cy-card-body{font-size:inherit;display:block}.cy-card-header>.cy-card-actions.cy-card-actions{flex:none;position:static}.cy-card-frame[data-header]{column-gap:var(--cy-space-3);grid-template-columns:minmax(0,1fr) auto;&>.cy-card.cy-card{grid-area:1/1/2/-1;grid-template-columns:subgrid;align-content:start;display:grid}&>.cy-card>.cy-card-header{grid-column:1}&>.cy-card>.cy-card-body{grid-column:1/-1}&>.cy-card-actions.cy-card-actions{grid-area:1/2;align-self:start;margin-block-start:var(--cy-space-3);margin-inline-end:var(--cy-space-3);position:static}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.cy-chat-message.cy-chat-message{--_r:var(--cy-chat-message-radius,var(--cy-radius-card));align-items:flex-start;gap:var(--cy-chat-message-gap,var(--cy-space-3));min-inline-size:0;color:var(--cy-color-ink);font-family:var(--cy-font-sans);font-size:var(--cy-font-size-md);font-weight:var(--cy-font-weight-regular);line-height:var(--cy-font-line-height);letter-spacing:normal;text-align:start;text-transform:none;margin:0;display:flex;box-sizing:border-box!important;&[data-role=user]{flex-direction:row-reverse}}.cy-chat-message-avatar{flex:none;display:flex}.cy-chat-message-body.cy-chat-message-body{align-items:flex-start;gap:var(--cy-space-1);min-inline-size:0;max-inline-size:var(--cy-chat-message-max-width,82%);flex-direction:column;display:flex;[data-role=user]>&{align-items:flex-end}[data-wide]>&{flex:1;align-items:stretch;max-inline-size:none}}.cy-chat-message-bubble.cy-chat-message-bubble{min-inline-size:0;max-inline-size:100%;padding:var(--cy-chat-message-padding,var(--cy-space-3) var(--cy-space-5));border:var(--cy-border-width) solid var(--cy-chat-message-border,var(--cy-color-line));border-radius:var(--_r);background:var(--cy-chat-message-bg,var(--cy-color-surface-raised));color:var(--cy-color-ink);font-family:var(--cy-font-sans);font-size:var(--cy-font-size-md);font-weight:var(--cy-font-weight-regular);line-height:var(--cy-font-line-height);letter-spacing:normal;text-transform:none;overflow-wrap:anywhere;border-start-start-radius:calc(var(--_r) / 4);margin:0;box-sizing:border-box!important;[data-role=user]>*>&{background:var(--cy-chat-message-user-bg,var(--cy-color-accent));color:var(--cy-chat-message-user-color,var(--cy-color-on-accent));white-space:pre-wrap;border-color:#0000;border-start-start-radius:var(--_r);border-start-end-radius:calc(var(--_r) / 4)}[data-tone=danger]>*>&{border-color:color-mix(in oklab, var(--cy-color-danger) 45%, var(--cy-color-line));background:color-mix(in oklab, var(--cy-color-danger) 12%, var(--cy-color-surface));color:var(--cy-color-danger-text)}}.cy-chat-message-caret.cy-chat-message-caret{inline-size:calc(var(--cy-border-width) * 2);block-size:1em;border-radius:var(--cy-border-width);background:var(--cy-chat-message-caret,var(--cy-color-accent));vertical-align:text-bottom;animation:cy-chat-message-blink calc(2 * var(--cy-motion-slow)) steps(2, jump-none) infinite;margin-inline-start:var(--cy-space-1);display:inline-block;[data-role=user]>*>*>&{background:currentColor}}@keyframes cy-chat-message-blink{50%{opacity:0}}@media (prefers-reduced-motion:reduce){.cy-chat-message-caret.cy-chat-message-caret{animation:none}}.cy-chat-message-actions.cy-chat-message-actions{--cy-toolbar-padding:0}
|