@arshad-shah/cynosure 0.3.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 +53 -0
- package/dist/adapters/astro/index.js +27 -0
- package/dist/adapters/astro/index.js.map +1 -0
- package/dist/adapters/vite/index.d.ts +11 -0
- package/dist/adapters/vite/index.js +33 -12
- package/dist/adapters/vite/index.js.map +1 -1
- package/dist/brands/googleplay.d.ts +2 -0
- package/dist/brands/googleplay.js +17 -0
- package/dist/brands/googleplay.js.map +1 -0
- package/dist/brands/index.d.ts +1 -0
- package/dist/brands/index.js +132 -130
- package/dist/components/Accordion/Accordion.d.ts +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 +32 -34
- package/dist/components/Announcer/Announcer.js.map +1 -1
- package/dist/components/AppShell/AppShell.js +41 -41
- package/dist/components/AppShell/AppShell.js.map +1 -1
- package/dist/components/Avatar/Avatar.js +20 -20
- package/dist/components/Avatar/Avatar.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 +30 -6
- package/dist/components/Button/Button.js +50 -42
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Calendar/Calendar.js +158 -161
- 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 +22 -2
- 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/Checkbox/Checkbox.d.ts +4 -4
- package/dist/components/Checkbox/Checkbox.js +33 -8
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Checklist/Checklist.js +21 -21
- package/dist/components/Checklist/Checklist.js.map +1 -1
- package/dist/components/Choice/Choice.d.ts +73 -0
- package/dist/components/Choice/Choice.js +41 -0
- package/dist/components/Choice/Choice.js.map +1 -0
- package/dist/components/Choice/index.d.ts +1 -0
- package/dist/components/CodeBlock/CodeBlock.d.ts +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 +202 -212
- 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 +118 -129
- 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 +2 -2
- package/dist/components/Container/Container.js +17 -13
- 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 +41 -41
- 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/DeviceFrame/DeviceFrame.d.ts +63 -0
- package/dist/components/DeviceFrame/DeviceFrame.js +54 -0
- package/dist/components/DeviceFrame/DeviceFrame.js.map +1 -0
- package/dist/components/DeviceFrame/index.d.ts +1 -0
- package/dist/components/Dialog/Dialog.d.ts +10 -1
- package/dist/components/Dialog/Dialog.js +82 -81
- 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/EmptyState/EmptyState.d.ts +5 -2
- package/dist/components/EmptyState/EmptyState.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 +48 -42
- 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 +150 -99
- package/dist/components/FileDrop/FileDrop.js.map +1 -1
- package/dist/components/FloatingToolbar/FloatingToolbar.js +80 -77
- package/dist/components/FloatingToolbar/FloatingToolbar.js.map +1 -1
- package/dist/components/Grid/Grid.d.ts +32 -11
- package/dist/components/Grid/Grid.js +78 -48
- package/dist/components/Grid/Grid.js.map +1 -1
- package/dist/components/Grid/index.d.ts +1 -1
- package/dist/components/Heading/Heading.d.ts +4 -2
- package/dist/components/Heading/Heading.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.d.ts +16 -1
- package/dist/components/IconButton/IconButton.js +20 -15
- package/dist/components/IconButton/IconButton.js.map +1 -1
- package/dist/components/IconTile/IconTile.d.ts +45 -0
- package/dist/components/IconTile/IconTile.js +25 -0
- package/dist/components/IconTile/IconTile.js.map +1 -0
- package/dist/components/IconTile/index.d.ts +1 -0
- package/dist/components/Image/Image.js.map +1 -1
- package/dist/components/Inline/Inline.d.ts +3 -3
- package/dist/components/Inline/Inline.js +12 -22
- 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/KeyValueEditor.js +37 -36
- package/dist/components/KeyValueEditor/KeyValueEditor.js.map +1 -1
- package/dist/components/KeyValueEditor/bulk.js +3 -4
- package/dist/components/KeyValueEditor/bulk.js.map +1 -1
- package/dist/components/Link/Link.d.ts +9 -1
- package/dist/components/Link/Link.js +20 -18
- package/dist/components/Link/Link.js.map +1 -1
- package/dist/components/List/List.d.ts +73 -0
- package/dist/components/List/List.js +64 -0
- package/dist/components/List/List.js.map +1 -0
- package/dist/components/List/index.d.ts +1 -0
- package/dist/components/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 -27
- 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 +102 -0
- package/dist/components/OptionList/OptionList.js +98 -0
- package/dist/components/OptionList/OptionList.js.map +1 -0
- package/dist/components/OptionList/index.d.ts +1 -0
- 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/PageHeader/PageHeader.d.ts +6 -0
- package/dist/components/PageHeader/PageHeader.js +27 -27
- package/dist/components/PageHeader/PageHeader.js.map +1 -1
- package/dist/components/Pagination/Pagination.js +31 -30
- package/dist/components/Pagination/Pagination.js.map +1 -1
- 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/QRCode/QRCode.d.ts +56 -0
- package/dist/components/QRCode/QRCode.js +48 -0
- package/dist/components/QRCode/QRCode.js.map +1 -0
- package/dist/components/QRCode/index.d.ts +1 -0
- package/dist/components/RadioGroup/RadioGroup.js +32 -24
- package/dist/components/RadioGroup/RadioGroup.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 +57 -0
- package/dist/components/Section/Section.js +27 -0
- package/dist/components/Section/Section.js.map +1 -0
- package/dist/components/Section/index.d.ts +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +6 -3
- package/dist/components/SegmentedControl/SegmentedControl.js +24 -20
- 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 -156
- 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/Sheet/Sheet.js +12 -7
- package/dist/components/Sheet/Sheet.js.map +1 -1
- package/dist/components/SideNav/SideNav.d.ts +13 -1
- package/dist/components/SideNav/SideNav.js +100 -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/SiteFooter/SiteFooter.d.ts +66 -0
- package/dist/components/SiteFooter/SiteFooter.js +80 -0
- package/dist/components/SiteFooter/SiteFooter.js.map +1 -0
- package/dist/components/SiteFooter/index.d.ts +1 -0
- package/dist/components/SiteHeader/SiteHeader.d.ts +78 -0
- package/dist/components/SiteHeader/SiteHeader.js +114 -0
- package/dist/components/SiteHeader/SiteHeader.js.map +1 -0
- package/dist/components/SiteHeader/index.d.ts +1 -0
- package/dist/components/SkipLink/SkipLink.d.ts +42 -0
- package/dist/components/SkipLink/SkipLink.js +43 -0
- package/dist/components/SkipLink/SkipLink.js.map +1 -0
- package/dist/components/SkipLink/index.d.ts +1 -0
- package/dist/components/Slider/Slider.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 +146 -120
- 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 +16 -7
- package/dist/components/Stack/Stack.js +32 -18
- package/dist/components/Stack/Stack.js.map +1 -1
- package/dist/components/Stack/index.d.ts +1 -1
- package/dist/components/Stat/Stat.d.ts +88 -0
- package/dist/components/Stat/Stat.js +105 -0
- package/dist/components/Stat/Stat.js.map +1 -0
- package/dist/components/Stat/index.d.ts +1 -0
- package/dist/components/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/Steps/Steps.d.ts +10 -4
- package/dist/components/Steps/Steps.js +31 -30
- package/dist/components/Steps/Steps.js.map +1 -1
- package/dist/components/Switch/Switch.d.ts +4 -4
- package/dist/components/Switch/Switch.js +18 -7
- package/dist/components/Switch/Switch.js.map +1 -1
- package/dist/components/Table/Table.d.ts +6 -6
- package/dist/components/Table/Table.js +73 -102
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +55 -6
- package/dist/components/Tabs/Tabs.js +288 -169
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/TagInput/TagInput.d.ts +10 -2
- package/dist/components/TagInput/TagInput.js +137 -148
- 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 +22 -6
- package/dist/components/TextField/TextField.js +59 -53
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/ThemeToggle/ThemeToggle.d.ts +7 -1
- package/dist/components/ThemeToggle/ThemeToggle.js +33 -30
- package/dist/components/ThemeToggle/ThemeToggle.js.map +1 -1
- package/dist/components/TimeField/TimeField.d.ts +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 +166 -147
- 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 +23 -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/VisuallyHidden/VisuallyHidden.d.ts +24 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.js +17 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.js.map +1 -0
- package/dist/components/VisuallyHidden/index.d.ts +1 -0
- package/dist/components/ZoomControls/ZoomControls.d.ts +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/HiddenValue/HiddenValue.js +5 -5
- package/dist/foundations/HiddenValue/HiddenValue.js.map +1 -1
- package/dist/foundations/Icon/Icon.d.ts +6 -1
- package/dist/foundations/Icon/Icon.js +15 -14
- package/dist/foundations/Icon/Icon.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/image-outcome.d.ts +8 -3
- package/dist/foundations/image-outcome.js +12 -8
- package/dist/foundations/image-outcome.js.map +1 -1
- package/dist/foundations/keys.js +12 -13
- package/dist/foundations/keys.js.map +1 -1
- package/dist/foundations/layout.d.ts +81 -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/printing.d.ts +6 -0
- package/dist/foundations/printing.js +17 -0
- package/dist/foundations/printing.js.map +1 -0
- package/dist/foundations/qr.d.ts +42 -0
- package/dist/foundations/qr.js +245 -0
- package/dist/foundations/qr.js.map +1 -0
- 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/book-marked.d.ts +2 -0
- package/dist/icons/book-marked.js +14 -0
- package/dist/icons/book-marked.js.map +1 -0
- package/dist/icons/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/calendar-days.d.ts +2 -0
- package/dist/icons/calendar-days.js +24 -0
- package/dist/icons/calendar-days.js.map +1 -0
- package/dist/icons/check-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/check-square.d.ts +2 -0
- package/dist/icons/check-square.js +14 -0
- package/dist/icons/check-square.js.map +1 -0
- package/dist/icons/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/crescent.d.ts +2 -0
- package/dist/icons/crescent.js +14 -0
- package/dist/icons/crescent.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 -240
- package/dist/icons/index.js +546 -478
- package/dist/icons/kaaba.d.ts +2 -0
- package/dist/icons/kaaba.js +14 -0
- package/dist/icons/kaaba.js.map +1 -0
- package/dist/icons/keywords.d.ts +35 -1
- package/dist/icons/keywords.js +274 -1
- 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/list-tree.d.ts +2 -0
- package/dist/icons/list-tree.js +14 -0
- package/dist/icons/list-tree.js.map +1 -0
- package/dist/icons/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/mosque.d.ts +2 -0
- package/dist/icons/mosque.js +14 -0
- package/dist/icons/mosque.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/prayer-beads.d.ts +2 -0
- package/dist/icons/prayer-beads.js +67 -0
- package/dist/icons/prayer-beads.js.map +1 -0
- package/dist/icons/qr-code.d.ts +2 -0
- package/dist/icons/qr-code.js +38 -0
- package/dist/icons/qr-code.js.map +1 -0
- package/dist/icons/refresh-cw.d.ts +2 -0
- package/dist/icons/refresh-cw.js +14 -0
- package/dist/icons/refresh-cw.js.map +1 -0
- package/dist/icons/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/types.d.ts +1 -1
- package/dist/icons/types.js +2 -1
- package/dist/icons/types.js.map +1 -1
- 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 +38 -9
- package/dist/index.js +326 -249
- 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/announcer.css +1 -1
- package/dist/styles/app-shell.css +1 -1
- package/dist/styles/avatar.css +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/checkbox.css +1 -1
- package/dist/styles/choice-base.css +1 -0
- package/dist/styles/choice.css +1 -1
- package/dist/styles/code-block.css +1 -1
- package/dist/styles/color-field.css +1 -1
- package/dist/styles/combobox.css +1 -1
- package/dist/styles/command-palette.css +1 -1
- package/dist/styles/copy-button.css +1 -1
- package/dist/styles/data-grid.css +1 -0
- package/dist/styles/date-field.css +1 -1
- package/dist/styles/device-frame.css +1 -0
- package/dist/styles/dialog.css +1 -1
- package/dist/styles/disclosure.css +1 -1
- package/dist/styles/error-boundary.css +1 -0
- package/dist/styles/field.css +1 -1
- package/dist/styles/file-drop.css +1 -1
- package/dist/styles/floating-toolbar.css +1 -1
- package/dist/styles/generated-css.d.ts +1 -1
- package/dist/styles/generated-css.js +3 -3
- package/dist/styles/generated-css.js.map +1 -1
- package/dist/styles/grid.css +1 -1
- package/dist/styles/heading.css +1 -1
- package/dist/styles/highlighted-text.css +1 -0
- package/dist/styles/hotkey-field.css +1 -0
- package/dist/styles/icon-tile.css +1 -0
- package/dist/styles/icon.css +1 -1
- package/dist/styles/inline.css +1 -0
- package/dist/styles/key-value-editor.css +1 -1
- package/dist/styles/link.css +1 -1
- package/dist/styles/list-row.css +1 -0
- package/dist/styles/list.css +1 -0
- package/dist/styles/loading-dots.css +1 -1
- package/dist/styles/manifest.json +852 -0
- package/dist/styles/menu.css +1 -1
- package/dist/styles/menubar.css +1 -0
- package/dist/styles/notice.css +1 -1
- package/dist/styles/number-field.css +1 -1
- package/dist/styles/option-list.css +1 -0
- package/dist/styles/overlay-frame.css +1 -0
- package/dist/styles/pagination.css +1 -1
- 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/qr-code.css +1 -0
- package/dist/styles/radio-group.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 -1
- package/dist/styles/section.css +1 -0
- package/dist/styles/segmented-control.css +1 -1
- package/dist/styles/select.css +1 -1
- package/dist/styles/sheet.css +1 -1
- package/dist/styles/side-nav.css +1 -1
- package/dist/styles/site-footer.css +1 -0
- package/dist/styles/site-header.css +1 -0
- package/dist/styles/skip-link.css +1 -0
- package/dist/styles/sort-button.css +1 -0
- package/dist/styles/sortable-list.css +1 -1
- package/dist/styles/split-pane.css +1 -1
- package/dist/styles/stack.css +1 -1
- package/dist/styles/stat.css +1 -0
- package/dist/styles/status-bar.css +1 -0
- package/dist/styles/steps.css +1 -1
- package/dist/styles/switch.css +1 -0
- package/dist/styles/table.css +1 -1
- package/dist/styles/tabs.css +1 -1
- package/dist/styles/tag-input.css +1 -1
- package/dist/styles/text-area.css +1 -1
- package/dist/styles/text-field.css +1 -1
- package/dist/styles/text.css +1 -1
- package/dist/styles/time-field.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/visually-hidden.css +1 -0
- 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 +194 -125
- 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 +15 -6
- package/dist/components/Checkbox/ChoiceRow.d.ts +0 -39
- package/dist/components/Checkbox/ChoiceRow.js +0 -58
- package/dist/components/Checkbox/ChoiceRow.js.map +0 -1
- package/dist/components/Stack/space.d.ts +0 -18
- package/dist/components/Stack/space.js +0 -12
- package/dist/components/Stack/space.js.map +0 -1
- package/dist/styles/hidden-value.css +0 -1
- package/dist/styles/iconbutton.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeField.js","names":["_Fragment","useControllableState","useClientLayoutEffect","Button","clamp","IconButton","isTypeaheadKey","seekEnabled","useTypeahead","Popover","TextField","HiddenValue","Slider","SegmentedControl","clock","Fragment","useEffect","useId","useRef","useState","Fragment$1","jsx","jsxs","DAY","pad","n","parseTime","text","m","h","min","sec","half","formatTime","total","seconds","t","hm","HALF","formatTime12","usesAmPm","locale","SPAN","TimeField","label","labelHidden","description","error","value","defaultValue","onChange","max","step","hourCycle","picker","dayTrack","name","form","required","disabled","readOnly","size","labels","className","style","own","setOwn","h12","pattern","id","current","setCurrent","draft","setDraft","problem","setProblem","open","setOpen","nowAllowed","setNowAllowed","settled","setSettled","input","lists","byHand","timers","justOpened","seek","caretTo","lo","hi","first","last","inRange","fit","every","currentTime","shown","take","next","commit","onKeyDown","event","from","caret","colons","inHalf","unit","at","whole","base","parts","allowed","to","column","columnName","values","part","rest","v","time","range","count","by","_","i","columns","choose","setHalf","pm","nowTime","d","toggle","close","rests","c","instant","list","row","onScroll","middle","near","gap","k","onListKey","col","usable","go","scrolledByHand","percent","hasPicker","ownValue","props","el","option","minutes"],"sources":["../../../src/components/TimeField/TimeField.tsx"],"sourcesContent":["import {\n type CSSProperties,\n Fragment,\n type KeyboardEvent,\n type ReactNode,\n useEffect,\n useId,\n useRef,\n useState,\n} from \"react\";\nimport { useClientLayoutEffect } from \"../../foundations/client-layout-effect.js\";\nimport { useControllableState } from \"../../foundations/controllable.js\";\nimport { HiddenValue } from \"../../foundations/HiddenValue/HiddenValue.js\";\nimport { isTypeaheadKey, seekEnabled, useTypeahead } from \"../../foundations/listbox.js\";\nimport { clamp } from \"../../foundations/math.js\";\nimport { clock } from \"../../icons/clock.js\";\nimport type { Size } from \"../../tokens/schema.js\";\nimport { Button } from \"../Button/Button.js\";\nimport { IconButton } from \"../IconButton/IconButton.js\";\nimport { Popover } from \"../Popover/Popover.js\";\nimport { SegmentedControl } from \"../SegmentedControl/SegmentedControl.js\";\nimport { Slider } from \"../Slider/Slider.js\";\nimport { TextField } from \"../TextField/TextField.js\";\n\nexport interface TimeFieldTokens {\n rowHeight: string;\n columnWidth: string;\n lensBackground: string;\n night: string;\n day: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n timeField: TimeFieldTokens;\n }\n}\n\nexport interface TimeFieldLabels {\n /** Shown when the text is not a time. Default \"Enter a time as HH:MM\" (the field's own placeholder). */\n invalid: string;\n /** Shown when the time is outside `min` and `max`. Default \"This time is not available\". */\n unavailable: string;\n /** The button that opens the picker, and the picker's name. Default \"Choose a time\". */\n open: string;\n /** The picker's columns. Defaults \"Hours\", \"Minutes\" and \"Seconds\". */\n hours: string;\n minutes: string;\n seconds: string;\n /** The two halves of the day with `hourCycle={12}`, and the name of their switch. Defaults \"AM\", \"PM\", \"AM or PM\". */\n am: string;\n pm: string;\n period: string;\n /** The strip of the whole day under the columns. Default \"Time of day\". */\n dayTrack: string;\n /** The button that sets the current time. Default \"Now\". */\n now: string;\n}\n\nexport interface TimeFieldProps {\n /** The field's visible label, and its accessible name. */\n label: ReactNode;\n /** Hide the label visually; it still names the field. */\n labelHidden?: boolean;\n /** Help text under the field, read with it by screen readers. */\n description?: ReactNode;\n /** Your own error; it replaces the field's own messages. */\n error?: ReactNode;\n /** `HH:MM` (or `HH:MM:SS` with `seconds`), 24-hour whatever `hourCycle` shows, or null when empty. */\n value?: string | null;\n /** The starting time when `value` is not given, in the same form. */\n defaultValue?: string | null;\n /** A valid time (or null when cleared), when typing is finished, the arrows step it or the picker chooses it. */\n onChange?: (time: string | null) => void;\n /** The earliest time allowed, in the same form. Earlier times are explained and not reported. */\n min?: string | undefined;\n /** The latest time allowed, in the same form. Later times are explained and not reported. */\n max?: string | undefined;\n /** Minutes between the picker's minutes, and what the arrows move the minutes by. Default 1 (Shift: ten steps). */\n step?: number;\n /** Include seconds. */\n seconds?: boolean;\n /**\n * How the time is shown: `24` as `21:30`, `12` as `9:30 PM` (with an AM/PM switch in the picker), or `\"auto\"` to\n * follow the person's own language and region. The value is 24-hour either way. Default \"auto\".\n */\n hourCycle?: 12 | 24 | \"auto\";\n /** The language and region `hourCycle=\"auto\"` follows, such as `en-GB`. Default: the browser's. */\n locale?: string | undefined;\n /**\n * Add a clock button that opens a picker: columns for hours and minutes that roll under one lens. Without it the\n * field is only typed in.\n */\n picker?: boolean;\n /** With `picker`: the strip of the whole day under the columns, to click or drag to a time. Default `true`. */\n dayTrack?: boolean;\n /** Form field name. The form receives the 24-hour `HH:MM`, however the time is shown. */\n name?: string | undefined;\n /** The `id` of a form elsewhere on the page that the field belongs to. */\n form?: string | undefined;\n /** The form cannot be submitted while the field is empty. */\n required?: boolean | undefined;\n /** Cannot be focused, changed or submitted. */\n disabled?: boolean | undefined;\n /** Shown and submitted but not changed: no typing, no arrows and no picker button. */\n readOnly?: boolean | undefined;\n /** Height and text size of the field. Default \"md\". */\n size?: Size;\n /** Replace the built-in English text: the two messages and the picker's names. */\n labels?: Partial<TimeFieldLabels>;\n /** Added to the root element, for layout. */\n className?: string;\n /** Layout only. */\n style?: CSSProperties;\n}\n\nconst DAY = 24 * 3600;\nconst pad = (n: number) => String(n).padStart(2, \"0\");\n\n/**\n * Seconds since midnight from what was typed: `9`, `930`, `0930`, `9:30`, `21:15:30`, `9:30 pm`, `12am`. Null when it\n * is not a time of day.\n */\nexport function parseTime(text: string): number | null {\n const m = /^\\s*(\\d{1,2})(?::?(\\d{2}))?(?::?(\\d{2}))?\\s*([ap]\\.?m\\.?)?\\s*$/i.exec(text);\n if (!m) return null;\n let h = Number(m[1]);\n const min = Number(m[2] ?? 0);\n const sec = Number(m[3] ?? 0);\n const half = m[4]?.[0]?.toLowerCase();\n if (half) {\n if (h < 1 || h > 12) return null;\n h = (h % 12) + (half === \"p\" ? 12 : 0);\n }\n if (h > 23 || min > 59 || sec > 59) return null;\n return h * 3600 + min * 60 + sec;\n}\n\n/** `HH:MM` (or `HH:MM:SS`) from seconds since midnight. */\nexport const formatTime = (total: number, seconds = false) => {\n const t = ((total % DAY) + DAY) % DAY;\n const hm = `${pad(Math.floor(t / 3600))}:${pad(Math.floor(t / 60) % 60)}`;\n return seconds ? `${hm}:${pad(t % 60)}` : hm;\n};\n\nconst HALF = 12 * 3600;\n/** `9:30 PM` (or `9:30:15 PM`) from seconds since midnight. */\nconst formatTime12 = (t: number, seconds: boolean) => {\n const h = Math.floor(t / 3600);\n return `${h % 12 || 12}:${pad(Math.floor(t / 60) % 60)}${seconds ? `:${pad(t % 60)}` : \"\"} ${h < 12 ? \"AM\" : \"PM\"}`;\n};\n\n/** Whether a language and region write the time of day with AM and PM. */\nconst usesAmPm = (locale: string | undefined) =>\n new Intl.DateTimeFormat(locale, { hour: \"numeric\" }).resolvedOptions().hour12 === true;\n\ntype Unit = \"h\" | \"m\" | \"s\";\ninterface Row {\n /** What the row shows. */\n text: string;\n /** The number typed to reach it. */\n typed: string;\n /** The time choosing it gives (before the limits are applied). */\n time: number;\n disabled: boolean;\n selected: boolean;\n}\ninterface Column {\n unit: Unit;\n name: string;\n rows: Row[];\n /** The row the column rests on: the chosen one, or the nearest when the time is between rows. */\n rest: number;\n}\nconst SPAN: Record<Unit, number> = { h: 3600, m: 60, s: 1 };\n\n/**\n * A time of day in a form: type it, step it with the arrows, or pick it from columns that roll under a lens, with a\n * strip of the whole day to jump along. Forgiving as it reads (`930`, `9:30 pm`), strict in what it reports: always\n * 24-hour `HH:MM`, however it is shown.\n */\nexport function TimeField({\n label,\n labelHidden,\n description,\n error,\n value,\n defaultValue = null,\n onChange,\n min,\n max,\n step = 1,\n seconds = false,\n hourCycle = \"auto\",\n locale,\n picker = false,\n dayTrack = true,\n name,\n form,\n required,\n disabled = false,\n readOnly = false,\n size = \"md\",\n labels,\n className,\n style,\n}: TimeFieldProps) {\n // The person's own convention is only known in their browser: 24-hour until then, settled before the first paint.\n const [own, setOwn] = useState<12 | 24>(24);\n useClientLayoutEffect(() => {\n if (hourCycle === \"auto\") setOwn(usesAmPm(locale) ? 12 : 24);\n }, [hourCycle, locale]);\n const h12 = (hourCycle === \"auto\" ? own : hourCycle) === 12;\n const pattern = `${h12 ? \"H:MM\" : \"HH:MM\"}${seconds ? \":SS\" : \"\"}${h12 ? \" AM\" : \"\"}`;\n const text: TimeFieldLabels = {\n invalid: `Enter a time as ${pattern}`,\n unavailable: \"This time is not available\",\n open: \"Choose a time\",\n hours: \"Hours\",\n minutes: \"Minutes\",\n seconds: \"Seconds\",\n am: \"AM\",\n pm: \"PM\",\n period: \"AM or PM\",\n dayTrack: \"Time of day\",\n now: \"Now\",\n ...labels,\n };\n const id = useId();\n const [current, setCurrent] = useControllableState<string | null>(value, defaultValue, onChange);\n const [draft, setDraft] = useState<string | null>(null);\n const [problem, setProblem] = useState<string | null>(null);\n const [open, setOpen] = useState(false);\n /** Whether the current time of day is inside the limits, read when the picker opens. */\n const [nowAllowed, setNowAllowed] = useState(false);\n /** Raised when a column has been scrolled by hand, so it is put back on its row even if the time did not change. */\n const [settled, setSettled] = useState(0);\n const input = useRef<HTMLInputElement>(null);\n const lists = useRef<(HTMLDivElement | null)[]>([]);\n /** A column only chooses by scrolling when a person scrolled it (wheel, finger, drag), never when it was rolled. */\n const byHand = useRef<boolean[]>([]);\n const timers = useRef<(ReturnType<typeof setTimeout> | undefined)[]>([]);\n const justOpened = useRef(false);\n const seek = useTypeahead();\n /** Where the caret goes once a stepped value is rendered, so the next press steps the same part. */\n const caretTo = useRef<number | null>(null);\n useClientLayoutEffect(() => {\n if (caretTo.current === null) return;\n input.current?.setSelectionRange(caretTo.current, caretTo.current);\n caretTo.current = null;\n });\n useEffect(() => () => timers.current.forEach(clearTimeout), []);\n const lo = min === undefined ? null : parseTime(min);\n const hi = max === undefined ? null : parseTime(max);\n const first = lo ?? 0;\n const last = hi ?? DAY - 1;\n const inRange = (t: number) => t >= first && t <= last;\n const fit = (t: number) => clamp(t, first, last);\n const every = Math.max(1, Math.round(step));\n\n const currentTime = current === null ? null : parseTime(current);\n const shown = draft ?? (h12 && currentTime !== null ? formatTime12(currentTime, seconds) : (current ?? \"\"));\n\n const take = (t: number) => {\n const next = formatTime(t, seconds);\n setDraft(null);\n setProblem(null);\n if (next !== current) setCurrent(next);\n };\n const commit = () => {\n if (draft === null) return;\n if (draft.trim() === \"\") {\n setDraft(null);\n setProblem(null);\n if (current !== null) setCurrent(null);\n return;\n }\n const t = parseTime(draft);\n if (t === null) return setProblem(text.invalid);\n if (!inRange(t)) return setProblem(text.unavailable);\n take(t);\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"Enter\") commit();\n if ((event.key !== \"ArrowUp\" && event.key !== \"ArrowDown\") || readOnly) return;\n const from = parseTime(shown);\n if (from === null) return;\n event.preventDefault();\n // The part the caret is in: before the first colon the hours, then the minutes, then the seconds; in AM or PM,\n // the half of the day.\n const caret = event.currentTarget.selectionStart ?? shown.length;\n const colons = shown.slice(0, caret).split(\":\").length - 1;\n const half = shown.search(/[ap]/i);\n const inHalf = half >= 0 && caret > half;\n const unit = inHalf ? HALF : colons === 0 ? 3600 : colons === 1 ? 60 * step : 1;\n const by = (event.key === \"ArrowUp\" ? 1 : -1) * unit * (event.shiftKey && !inHalf ? 10 : 1);\n let next = (((from + by) % DAY) + DAY) % DAY;\n if (lo !== null && next < lo) next = lo;\n if (hi !== null && next > hi) next = hi;\n caretTo.current = caret;\n take(next);\n };\n\n // The picker shows what is typed once it reads as a time, else the value; when there is neither, it rests on the\n // earliest allowed time with nothing chosen.\n const at = draft !== null ? parseTime(draft) : currentTime;\n const whole = fit(at ?? first);\n const base = seconds ? whole : whole - (whole % 60);\n const parts = { h: Math.floor(base / 3600), m: Math.floor(base / 60) % 60, s: base % 60 };\n const allowed = (from: number, to: number) => to >= first && from <= last;\n const column = (unit: Unit, columnName: string, values: number[]): Column => {\n const part = unit === \"h\" && h12 ? parts.h % 12 || 12 : parts[unit];\n let rest = 0;\n const rows = values.map((v, i) => {\n const hour = unit !== \"h\" ? parts.h : h12 ? (v % 12) + (parts.h >= 12 ? 12 : 0) : v;\n const time = hour * 3600 + (unit === \"m\" ? v : parts.m) * 60 + (unit === \"s\" ? v : parts.s);\n const from = time - (time % SPAN[unit]);\n // Without seconds a minute is one moment (09:30), not the sixty seconds after it.\n const to = from + (unit === \"m\" && !seconds ? 0 : SPAN[unit] - 1);\n if (Math.abs(v - part) < Math.abs((values[rest] as number) - part)) rest = i;\n return {\n text: unit === \"h\" && h12 ? String(v) : pad(v),\n typed: String(v),\n time,\n disabled: !allowed(from, to),\n selected: at !== null && v === part,\n };\n });\n return { unit, name: columnName, rows, rest };\n };\n const range = (count: number, by = 1) => Array.from({ length: Math.ceil(count / by) }, (_, i) => i * by);\n const columns = [\n column(\"h\", text.hours, h12 ? [12, ...range(12).slice(1)] : range(24)),\n column(\"m\", text.minutes, range(60, every)),\n ...(seconds ? [column(\"s\", text.seconds, range(60))] : []),\n ];\n\n const choose = (t: number) => {\n byHand.current = [];\n take(fit(t));\n };\n const setHalf = (pm: boolean) => {\n if (parts.h >= 12 !== pm) choose(base + (pm ? HALF : -HALF));\n };\n const nowTime = () => {\n const d = new Date();\n return ((Math.round((d.getHours() * 60 + d.getMinutes()) / every) * every) % 1440) * 60;\n };\n const toggle = (next: boolean) => {\n if (next) {\n justOpened.current = true;\n setNowAllowed(inRange(nowTime()));\n }\n setOpen(next);\n };\n const close = () => {\n setOpen(false);\n input.current?.focus();\n };\n\n // Each column rolls so that its row sits in the lens: at once when the picker opens, gliding after that (the\n // stylesheet decides, and reduced motion turns it off). Runs after the Popover has shown the panel, and again\n // (`settled`) after a column was scrolled by hand.\n const rests = columns.map((c) => c.rest).join();\n useEffect(() => {\n if (!open) return;\n const instant = justOpened.current;\n justOpened.current = false;\n rests.split(\",\").forEach((rest, i) => {\n const list = lists.current[i];\n const row = list?.children[Number(rest)] as HTMLElement | undefined;\n if (!list || !row) return;\n list.scrollTo({\n top: row.offsetTop - (list.clientHeight - row.offsetHeight) / 2,\n behavior: instant ? \"instant\" : \"auto\",\n });\n });\n }, [open, rests, settled]);\n\n // Scrolled by hand, a column chooses the row it comes to rest on (the nearest allowed time when that row is not).\n const onScroll = (i: number) => () => {\n clearTimeout(timers.current[i]);\n timers.current[i] = setTimeout(() => {\n const list = lists.current[i];\n if (!byHand.current[i] || !list) return;\n const middle = list.scrollTop + list.clientHeight / 2;\n let near = 0;\n let gap = Number.POSITIVE_INFINITY;\n ([...list.children] as HTMLElement[]).forEach((row, k) => {\n const d = Math.abs(row.offsetTop + row.offsetHeight / 2 - middle);\n if (d < gap) [near, gap] = [k, d];\n });\n const row = columns[i]?.rows[near];\n if (row) choose(row.time);\n setSettled((n) => n + 1);\n }, 120);\n };\n const onListKey = (i: number) => (event: KeyboardEvent<HTMLDivElement>) => {\n const col = columns[i] as Column;\n const count = col.rows.length;\n const usable = (k: number) => !col.rows[k]?.disabled;\n const go = (k: number) => {\n event.preventDefault();\n const row = col.rows[k];\n if (row) choose(row.time);\n };\n if (event.key === \"ArrowDown\") return go(seekEnabled(count, col.rest, 1, usable));\n if (event.key === \"ArrowUp\") return go(seekEnabled(count, col.rest, -1, usable));\n if (event.key === \"Home\") return go(seekEnabled(count, -1, 1, usable));\n if (event.key === \"End\") return go(seekEnabled(count, count, -1, usable));\n if (event.key === \"ArrowLeft\" || event.key === \"ArrowRight\") {\n event.preventDefault();\n lists.current[i + (event.key === \"ArrowRight\" ? 1 : -1)]?.focus();\n } else if (event.key === \"Enter\") {\n event.preventDefault();\n close();\n } else if (h12 && isTypeaheadKey(event) && /^[ap]$/i.test(event.key)) {\n setHalf(event.key.toLowerCase() === \"p\");\n } else if (isTypeaheadKey(event)) {\n const to = seek(\n event.key,\n col.rows.map((row) => (row.disabled ? null : row.typed)),\n col.rest,\n );\n if (to >= 0) go(to);\n }\n };\n const scrolledByHand = (i: number) => () => {\n byHand.current[i] = true;\n };\n const percent = (t: number) => `${(t / DAY) * 100}%`;\n\n const hasPicker = picker && !readOnly;\n // Shown as 9:30 PM, a form still receives 21:30.\n const ownValue = h12 && name !== undefined;\n return (\n <>\n <TextField\n ref={input}\n label={label}\n {...(labelHidden ? { labelHidden } : {})}\n {...(description !== undefined ? { description } : {})}\n {...((error ?? problem) != null ? { error: error ?? problem } : {})}\n value={shown}\n onChange={setDraft}\n onBlur={commit}\n onKeyDown={onKeyDown}\n placeholder={pattern}\n inputMode={h12 ? \"text\" : \"numeric\"}\n autoComplete=\"off\"\n {...(hasPicker ? {} : { iconStart: clock })}\n name={ownValue ? undefined : name}\n form={form}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n size={size}\n className={className ? `cy-time-field ${className}` : \"cy-time-field\"}\n {...(style ? { style } : {})}\n addonEnd={\n hasPicker && (\n <Popover\n label={text.open}\n open={open}\n onOpenChange={toggle}\n placement=\"bottom\"\n trigger={(props) => (\n <IconButton\n {...props}\n icon={clock}\n label={text.open}\n variant=\"ghost\"\n size=\"sm\"\n disabled={disabled}\n className=\"cy-time-field-open\"\n />\n )}\n >\n <div className=\"cy-time-field-picker\">\n <div className=\"cy-time-field-wheel cy-reset\">\n <div className=\"cy-time-field-drum cy-reset\" dir=\"ltr\">\n <div className=\"cy-time-field-lens cy-reset\" />\n {columns.map((col, i) => (\n <Fragment key={col.unit}>\n {i > 0 && (\n <span className=\"cy-time-field-colon cy-reset\" aria-hidden=\"true\">\n :\n </span>\n )}\n <div\n ref={(el) => {\n lists.current[i] = el;\n }}\n role=\"listbox\"\n tabIndex={0}\n aria-label={col.name}\n aria-activedescendant={\n col.rows.some((row) => row.selected) ? `${id}-${col.unit}-${col.rest}` : undefined\n }\n className=\"cy-time-field-column cy-reset\"\n onKeyDown={onListKey(i)}\n onClick={(event) => {\n const option = (event.target as HTMLElement).closest<HTMLElement>(\"[data-index]\");\n const row = col.rows[Number(option?.dataset.index ?? -1)];\n if (row && !row.disabled) choose(row.time);\n }}\n onScroll={onScroll(i)}\n onWheel={scrolledByHand(i)}\n onTouchStart={scrolledByHand(i)}\n onPointerDown={scrolledByHand(i)}\n >\n {col.rows.map((row, k) => (\n <div\n key={row.typed}\n id={`${id}-${col.unit}-${k}`}\n role=\"option\"\n aria-selected={row.selected}\n aria-disabled={row.disabled || undefined}\n tabIndex={-1}\n data-index={k}\n className=\"cy-time-field-option cy-reset\"\n >\n {row.text}\n </div>\n ))}\n </div>\n </Fragment>\n ))}\n </div>\n {h12 && (\n <SegmentedControl\n label={text.period}\n size=\"sm\"\n value={parts.h >= 12 ? \"pm\" : \"am\"}\n onChange={(half) => setHalf(half === \"pm\")}\n options={[\n { value: \"am\", label: text.am, disabled: !allowed(0, HALF - 1) },\n { value: \"pm\", label: text.pm, disabled: !allowed(HALF, DAY - 1) },\n ]}\n />\n )}\n </div>\n {dayTrack && (\n <Slider\n label={text.dayTrack}\n labelHidden\n min={0}\n max={1440}\n step={every}\n largeStep={60}\n size=\"sm\"\n value={Math.floor(base / 60)}\n onChange={(minutes) => choose(Math.min(minutes as number, 1440 - every) * 60)}\n marks={[0, 6, 12, 18, 24].map((h) => ({\n value: h * 60,\n ...(h % 24 === 0\n ? {}\n : { label: h12 ? `${h % 12 || 12} ${h < 12 ? text.am : text.pm}` : pad(h) }),\n }))}\n labels={{\n value: (minutes) => {\n const t = Math.min(minutes, 1439) * 60;\n return h12 ? formatTime12(t, false) : formatTime(t);\n },\n }}\n className=\"cy-time-field-track\"\n trackContent={\n <div\n className=\"cy-time-field-day cy-reset\"\n style={\n { \"--_open-from\": percent(first), \"--_open-to\": percent(last) } as CSSProperties\n }\n />\n }\n />\n )}\n {nowAllowed && (\n <div className=\"cy-time-field-foot cy-reset\">\n <Button variant=\"ghost\" size=\"sm\" onClick={() => choose(nowTime())}>\n {text.now}\n </Button>\n </div>\n )}\n </div>\n </Popover>\n )\n }\n />\n {ownValue && <HiddenValue name={name} form={form} value={current ?? \"\"} disabled={disabled} />}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoHA,IAAMuB,IAAM,OACNC,IAAA,CAAOC,MAAc,OAAOA,CAAC,EAAE,SAAS,GAAG,GAAG;AAMpD,SAAgBC,EAAUC,GAA6B;AACrD,QAAMC,IAAI,kEAAkE,KAAKD,CAAI;AACrF,MAAI,CAACC,EAAG,QAAO;AACf,MAAIC,IAAI,OAAOD,EAAE,CAAA,CAAE;AACnB,QAAME,IAAM,OAAOF,EAAE,CAAA,KAAM,CAAC,GACtBG,IAAM,OAAOH,EAAE,CAAA,KAAM,CAAC,GACtBI,IAAOJ,EAAE,CAAA,IAAK,CAAA,GAAI,YAAY;AACpC,MAAII,GAAM;AACR,QAAIH,IAAI,KAAKA,IAAI,GAAI,QAAO;AAC5B,IAAAA,IAAKA,IAAI,MAAOG,MAAS,MAAM,KAAK;AAAA,EACtC;AACA,SAAIH,IAAI,MAAMC,IAAM,MAAMC,IAAM,KAAW,OACpCF,IAAI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AA;AAAA,UAEJ,CAAA;AAAA,UAEFd,MACC,gBAAAzD,EAAC,OAAD;AAAA,YAAK,WAAU;AAAA,YACb,UAAA,gBAAAA,EAAClB,IAAD;AAAA,cAAQ,SAAQ;AAAA,cAAQ,MAAK;AAAA,cAAK,SAAA,MAAe4H,EAAOG,GAAQ,CAAC;AAAA,cAC9D,UAAAvG,EAAK;AAAA,YACA,CAAA;AAAA,UACL,CAAA;AAAA,QAEJ;AAAA,M;A,IACE,CAAA;AAAA,EAGd,CAAA,GACA4H,MAAY,gBAAAlI,EAACV,IAAD;AAAA,IAAmB,MAAA6C;AAAA,IAAY,MAAAC;AAAA,IAAM,OAAOa,KAAW;AAAA,IAAc,UAAAX;AAAA,EAAW,CAAA,CAC7F,EAAA,CAAA;AAEN"}
|
|
1
|
+
{"version":3,"file":"TimeField.js","names":["_Fragment","useControllableState","useClientLayoutEffect","Button","clamp","IconButton","isTypeaheadKey","seekEnabled","useTypeahead","Popover","TextField","HiddenValue","Slider","alignedScroll","useDraft","SegmentedControl","clock","Fragment","useEffect","useId","useRef","useState","Fragment$1","jsx","jsxs","DAY","pad","n","parseTime","text","m","h","min","sec","half","formatTime","total","seconds","t","hm","HALF","formatTime12","usesAmPm","locale","SPAN","TimeField","label","labelHidden","layout","width","description","error","value","defaultValue","onChange","max","step","hourCycle","picker","dayTrack","name","form","required","disabled","readOnly","size","labels","className","style","own","setOwn","h12","pattern","id","current","setCurrent","resetCurrent","open","setOpen","nowAllowed","setNowAllowed","settled","setSettled","input","lists","byHand","timers","justOpened","seek","caretTo","lo","hi","first","last","inRange","fit","every","check","typed","draft","setDraft","problem","setProblem","settle","currentTime","shown","take","next","commit","wrong","onKeyDown","event","from","caret","colons","inHalf","up","times","by","off","snap","at","whole","base","parts","allowed","to","column","unit","columnName","values","part","rest","v","i","time","range","count","_","columns","choose","setHalf","pm","nowTime","d","toggle","close","rests","c","instant","list","row","onScroll","middle","near","gap","k","onListKey","col","usable","go","scrolledByHand","percent","hasPicker","props","el","option","minutes"],"sources":["../../../src/components/TimeField/TimeField.tsx"],"sourcesContent":["import {\n type CSSProperties,\n Fragment,\n type KeyboardEvent,\n type ReactNode,\n useEffect,\n useId,\n useRef,\n useState,\n} from \"react\";\nimport { useClientLayoutEffect } from \"../../foundations/client-layout-effect.js\";\nimport { useControllableState } from \"../../foundations/controllable.js\";\nimport { useDraft } from \"../../foundations/draft.js\";\nimport { HiddenValue } from \"../../foundations/HiddenValue/HiddenValue.js\";\nimport { isTypeaheadKey, seekEnabled, useTypeahead } from \"../../foundations/listbox.js\";\nimport { clamp } from \"../../foundations/math.js\";\nimport { alignedScroll } from \"../../foundations/scroll-align.js\";\nimport { clock } from \"../../icons/clock.js\";\nimport type { Size } from \"../../tokens/schema.js\";\nimport { Button } from \"../Button/Button.js\";\nimport type { FieldLayoutProps } from \"../Field/Field.js\";\nimport { IconButton } from \"../IconButton/IconButton.js\";\nimport { Popover } from \"../Popover/Popover.js\";\nimport { SegmentedControl } from \"../SegmentedControl/SegmentedControl.js\";\nimport { Slider } from \"../Slider/Slider.js\";\nimport { TextField } from \"../TextField/TextField.js\";\n\nexport interface TimeFieldTokens {\n rowHeight: string;\n columnWidth: string;\n lensBackground: string;\n night: string;\n day: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n timeField: TimeFieldTokens;\n }\n}\n\nexport interface TimeFieldLabels {\n /** Shown when the text is not a time. Default \"Enter a time as HH:MM\" (the field's own placeholder). */\n invalid: string;\n /** Shown when the time is outside `min` and `max`. Default \"This time is not available\". */\n unavailable: string;\n /** The button that opens the picker, and the picker's name. Default \"Choose a time\". */\n open: string;\n /** The picker's columns. Defaults \"Hours\", \"Minutes\" and \"Seconds\". */\n hours: string;\n minutes: string;\n seconds: string;\n /** The two halves of the day with `hourCycle={12}`, and the name of their switch. Defaults \"AM\", \"PM\", \"AM or PM\". */\n am: string;\n pm: string;\n period: string;\n /** The strip of the whole day under the columns. Default \"Time of day\". */\n dayTrack: string;\n /** The button that sets the current time. Default \"Now\". */\n now: string;\n}\n\nexport interface TimeFieldProps extends FieldLayoutProps {\n /** The field's visible label, and its accessible name. */\n label: ReactNode;\n /** Hide the label visually; it still names the field. */\n labelHidden?: boolean;\n /** Help text under the field, read with it by screen readers. */\n description?: ReactNode;\n /** Your own error; it replaces the field's own messages. */\n error?: ReactNode;\n /** `HH:MM` (or `HH:MM:SS` with `seconds`), 24-hour whatever `hourCycle` shows, or null when empty. */\n value?: string | null;\n /** The starting time when `value` is not given, in the same form. */\n defaultValue?: string | null;\n /** A valid time (or null when cleared), when typing is finished, the arrows step it or the picker chooses it. */\n onChange?: (time: string | null) => void;\n /** The earliest time allowed, in the same form. Earlier times are explained and not reported. */\n min?: string | undefined;\n /** The latest time allowed, in the same form. Later times are explained and not reported. */\n max?: string | undefined;\n /** Minutes between the picker's minutes, and what the arrows move the minutes by. Default 1 (Shift: ten steps). */\n step?: number;\n /** Include seconds. */\n seconds?: boolean;\n /**\n * How the time is shown: `24` as `21:30`, `12` as `9:30 PM` (with an AM/PM switch in the picker), or `\"auto\"` to\n * follow the person's own language and region. The value is 24-hour either way. Default \"auto\".\n */\n hourCycle?: 12 | 24 | \"auto\";\n /** The language and region `hourCycle=\"auto\"` follows, such as `en-GB`. Default: the browser's. */\n locale?: string | undefined;\n /**\n * Add a clock button that opens a picker: columns for hours and minutes that roll under one lens. Without it the\n * field is only typed in.\n */\n picker?: boolean;\n /** With `picker`: the strip of the whole day under the columns, to click or drag to a time. Default `true`. */\n dayTrack?: boolean;\n /** Form field name. The form receives the 24-hour `HH:MM` value (never the text being typed), however it is shown. */\n name?: string | undefined;\n /** The `id` of a form elsewhere on the page that the field belongs to. */\n form?: string | undefined;\n /** The form cannot be submitted while the field is empty. */\n required?: boolean | undefined;\n /** Cannot be focused, changed or submitted. */\n disabled?: boolean | undefined;\n /** Shown and submitted but not changed: no typing, no arrows and no picker button. */\n readOnly?: boolean | undefined;\n /** Height and text size of the field. Default \"md\". */\n size?: Size;\n /** Replace the built-in English text: the two messages and the picker's names. */\n labels?: Partial<TimeFieldLabels>;\n /** Added to the root element, for layout. */\n className?: string;\n /** Layout only. */\n style?: CSSProperties;\n}\n\nconst DAY = 24 * 3600;\nconst pad = (n: number) => String(n).padStart(2, \"0\");\n\n/**\n * Seconds since midnight from what was typed: `9`, `930`, `0930`, `9:30`, `21:15:30`, `9:30 pm`, `12am`. Null when it\n * is not a time of day.\n */\nexport function parseTime(text: string): number | null {\n const m = /^\\s*(\\d{1,2})(?::?(\\d{2}))?(?::?(\\d{2}))?\\s*([ap]\\.?m\\.?)?\\s*$/i.exec(text);\n if (!m) return null;\n let h = Number(m[1]);\n const min = Number(m[2] ?? 0);\n const sec = Number(m[3] ?? 0);\n const half = m[4]?.[0]?.toLowerCase();\n if (half) {\n if (h < 1 || h > 12) return null;\n h = (h % 12) + (half === \"p\" ? 12 : 0);\n }\n if (h > 23 || min > 59 || sec > 59) return null;\n return h * 3600 + min * 60 + sec;\n}\n\n/** `HH:MM` (or `HH:MM:SS`) from seconds since midnight. */\nexport const formatTime = (total: number, seconds = false) => {\n const t = ((total % DAY) + DAY) % DAY;\n const hm = `${pad(Math.floor(t / 3600))}:${pad(Math.floor(t / 60) % 60)}`;\n return seconds ? `${hm}:${pad(t % 60)}` : hm;\n};\n\nconst HALF = 12 * 3600;\n/** `9:30 PM` (or `9:30:15 PM`) from seconds since midnight. */\nconst formatTime12 = (t: number, seconds: boolean) => {\n const h = Math.floor(t / 3600);\n return `${h % 12 || 12}:${pad(Math.floor(t / 60) % 60)}${seconds ? `:${pad(t % 60)}` : \"\"} ${h < 12 ? \"AM\" : \"PM\"}`;\n};\n\n/** Whether a language and region write the time of day with AM and PM. */\nconst usesAmPm = (locale: string | undefined) =>\n new Intl.DateTimeFormat(locale, { hour: \"numeric\" }).resolvedOptions().hour12 === true;\n\ntype Unit = \"h\" | \"m\" | \"s\";\ninterface Row {\n /** What the row shows. */\n text: string;\n /** The number typed to reach it. */\n typed: string;\n /** The time choosing it gives (before the limits are applied). */\n time: number;\n disabled: boolean;\n selected: boolean;\n}\ninterface Column {\n unit: Unit;\n name: string;\n rows: Row[];\n /** The row the column rests on: the chosen one, or the nearest when the time is between rows. */\n rest: number;\n}\nconst SPAN: Record<Unit, number> = { h: 3600, m: 60, s: 1 };\n\n/**\n * A time of day in a form: type it, step it with the arrows, or pick it from columns that roll under a lens, with a\n * strip of the whole day to jump along. Forgiving as it reads (`930`, `9:30 pm`), strict in what it reports: always\n * 24-hour `HH:MM`, however it is shown.\n */\nexport function TimeField({\n label,\n labelHidden,\n layout,\n width,\n description,\n error,\n value,\n defaultValue = null,\n onChange,\n min,\n max,\n step = 1,\n seconds = false,\n hourCycle = \"auto\",\n locale,\n picker = false,\n dayTrack = true,\n name,\n form,\n required,\n disabled = false,\n readOnly = false,\n size = \"md\",\n labels,\n className,\n style,\n}: TimeFieldProps) {\n // The person's own convention is only known in their browser: 24-hour until then, settled before the first paint.\n const [own, setOwn] = useState<12 | 24>(24);\n useClientLayoutEffect(() => {\n if (hourCycle === \"auto\") setOwn(usesAmPm(locale) ? 12 : 24);\n }, [hourCycle, locale]);\n const h12 = (hourCycle === \"auto\" ? own : hourCycle) === 12;\n const pattern = `${h12 ? \"H:MM\" : \"HH:MM\"}${seconds ? \":SS\" : \"\"}${h12 ? \" AM\" : \"\"}`;\n const text: TimeFieldLabels = {\n invalid: `Enter a time as ${pattern}`,\n unavailable: \"This time is not available\",\n open: \"Choose a time\",\n hours: \"Hours\",\n minutes: \"Minutes\",\n seconds: \"Seconds\",\n am: \"AM\",\n pm: \"PM\",\n period: \"AM or PM\",\n dayTrack: \"Time of day\",\n now: \"Now\",\n ...labels,\n };\n const id = useId();\n const [current, setCurrent, resetCurrent] = useControllableState<string | null>(\n value,\n defaultValue,\n onChange,\n );\n const [open, setOpen] = useState(false);\n /** Whether the current time of day is inside the limits, read when the picker opens. */\n const [nowAllowed, setNowAllowed] = useState(false);\n /** Raised when a column has been scrolled by hand, so it is put back on its row even if the time did not change. */\n const [settled, setSettled] = useState(0);\n const input = useRef<HTMLInputElement>(null);\n const lists = useRef<(HTMLDivElement | null)[]>([]);\n /** A column only chooses by scrolling when a person scrolled it (wheel, finger, drag), never when it was rolled. */\n const byHand = useRef<boolean[]>([]);\n const timers = useRef<(ReturnType<typeof setTimeout> | undefined)[]>([]);\n const justOpened = useRef(false);\n const seek = useTypeahead();\n /** Where the caret goes once a stepped value is rendered, so the next press steps the same part. */\n const caretTo = useRef<number | null>(null);\n useClientLayoutEffect(() => {\n if (caretTo.current === null) return;\n input.current?.setSelectionRange(caretTo.current, caretTo.current);\n caretTo.current = null;\n });\n useEffect(() => () => timers.current.forEach(clearTimeout), []);\n const lo = min === undefined ? null : parseTime(min);\n const hi = max === undefined ? null : parseTime(max);\n const first = lo ?? 0;\n const last = hi ?? DAY - 1;\n const inRange = (t: number) => t >= first && t <= last;\n const fit = (t: number) => clamp(t, first, last);\n const every = Math.max(1, Math.round(step));\n /** What is wrong with typed text, or null when it is empty or an allowed time. */\n const check = (typed: string) => {\n if (typed.trim() === \"\") return null;\n const t = parseTime(typed);\n return t === null ? text.invalid : inRange(t) ? null : text.unavailable;\n };\n // A form will not submit while the text is not a time it can take (the value it would submit is the last good one).\n const { draft, setDraft, problem, setProblem, settle } = useDraft(input, check);\n\n const currentTime = current === null ? null : parseTime(current);\n const shown = draft ?? (h12 && currentTime !== null ? formatTime12(currentTime, seconds) : (current ?? \"\"));\n\n const take = (t: number) => {\n const next = formatTime(t, seconds);\n settle();\n if (next !== current) setCurrent(next);\n };\n const commit = () => {\n if (draft === null) return;\n if (draft.trim() === \"\") {\n settle();\n if (current !== null) setCurrent(null);\n return;\n }\n const wrong = check(draft);\n if (wrong) return setProblem(wrong);\n take(parseTime(draft) as number);\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"Enter\") commit();\n if ((event.key !== \"ArrowUp\" && event.key !== \"ArrowDown\") || readOnly) return;\n const from = parseTime(shown);\n if (from === null) return;\n event.preventDefault();\n // The part the caret is in: before the first colon the hours, then the minutes, then the seconds; in AM or PM,\n // the half of the day.\n const caret = event.currentTarget.selectionStart ?? shown.length;\n const colons = shown.slice(0, caret).split(\":\").length - 1;\n const half = shown.search(/[ap]/i);\n const inHalf = half >= 0 && caret > half;\n const up = event.key === \"ArrowUp\";\n const times = event.shiftKey && !inHalf ? 10 : 1;\n let by: number;\n if (!inHalf && colons === 1) {\n // Minutes move along the step's grid, the picker's rows (:00, :15, :30, :45): off it, the first step lands on it.\n const m = Math.floor(from / 60) % 60;\n const off = m % every;\n const snap = off === 0 ? 0 : up ? Math.min(m - off + every, 60) - m : -off;\n by = (snap + (up ? 1 : -1) * (times - (snap === 0 ? 0 : 1)) * every) * 60;\n } else {\n by = (up ? 1 : -1) * (inHalf ? HALF : colons === 0 ? 3600 : 1) * times;\n }\n let next = (((from + by) % DAY) + DAY) % DAY;\n if (lo !== null && next < lo) next = lo;\n if (hi !== null && next > hi) next = hi;\n caretTo.current = caret;\n take(next);\n };\n\n // The picker shows what is typed once it reads as a time, else the value; when there is neither, it rests on the\n // earliest allowed time with nothing chosen.\n const at = draft !== null ? parseTime(draft) : currentTime;\n const whole = fit(at ?? first);\n const base = seconds ? whole : whole - (whole % 60);\n const parts = { h: Math.floor(base / 3600), m: Math.floor(base / 60) % 60, s: base % 60 };\n const allowed = (from: number, to: number) => to >= first && from <= last;\n const column = (unit: Unit, columnName: string, values: number[]): Column => {\n const part = unit === \"h\" && h12 ? parts.h % 12 || 12 : parts[unit];\n let rest = 0;\n const rows = values.map((v, i) => {\n const hour = unit !== \"h\" ? parts.h : h12 ? (v % 12) + (parts.h >= 12 ? 12 : 0) : v;\n const time = hour * 3600 + (unit === \"m\" ? v : parts.m) * 60 + (unit === \"s\" ? v : parts.s);\n const from = time - (time % SPAN[unit]);\n // Without seconds a minute is one moment (09:30), not the sixty seconds after it.\n const to = from + (unit === \"m\" && !seconds ? 0 : SPAN[unit] - 1);\n if (Math.abs(v - part) < Math.abs((values[rest] as number) - part)) rest = i;\n return {\n text: unit === \"h\" && h12 ? String(v) : pad(v),\n typed: String(v),\n time,\n disabled: !allowed(from, to),\n selected: at !== null && v === part,\n };\n });\n return { unit, name: columnName, rows, rest };\n };\n const range = (count: number, by = 1) => Array.from({ length: Math.ceil(count / by) }, (_, i) => i * by);\n const columns = [\n column(\"h\", text.hours, h12 ? [12, ...range(12).slice(1)] : range(24)),\n column(\"m\", text.minutes, range(60, every)),\n ...(seconds ? [column(\"s\", text.seconds, range(60))] : []),\n ];\n\n const choose = (t: number) => {\n byHand.current = [];\n take(fit(t));\n };\n const setHalf = (pm: boolean) => {\n if (parts.h >= 12 !== pm) choose(base + (pm ? HALF : -HALF));\n };\n const nowTime = () => {\n const d = new Date();\n return ((Math.round((d.getHours() * 60 + d.getMinutes()) / every) * every) % 1440) * 60;\n };\n const toggle = (next: boolean) => {\n if (next) {\n justOpened.current = true;\n setNowAllowed(inRange(nowTime()));\n }\n setOpen(next);\n };\n const close = () => {\n setOpen(false);\n input.current?.focus();\n };\n\n // Each column rolls so that its row sits in the lens: at once when the picker opens, gliding after that (the\n // stylesheet decides, and reduced motion turns it off). Runs after the Popover has shown the panel, and again\n // (`settled`) after a column was scrolled by hand.\n const rests = columns.map((c) => c.rest).join();\n useEffect(() => {\n if (!open) return;\n const instant = justOpened.current;\n justOpened.current = false;\n rests.split(\",\").forEach((rest, i) => {\n const list = lists.current[i];\n const row = list?.children[Number(rest)] as HTMLElement | undefined;\n if (!list || !row) return;\n list.scrollTo({\n top: alignedScroll(0, list.clientHeight, row.offsetTop, row.offsetHeight, \"center\"),\n behavior: instant ? \"instant\" : \"auto\",\n });\n });\n }, [open, rests, settled]);\n\n // Scrolled by hand, a column chooses the row it comes to rest on (the nearest allowed time when that row is not).\n const onScroll = (i: number) => () => {\n clearTimeout(timers.current[i]);\n timers.current[i] = setTimeout(() => {\n const list = lists.current[i];\n if (!byHand.current[i] || !list) return;\n const middle = list.scrollTop + list.clientHeight / 2;\n let near = 0;\n let gap = Number.POSITIVE_INFINITY;\n ([...list.children] as HTMLElement[]).forEach((row, k) => {\n const d = Math.abs(row.offsetTop + row.offsetHeight / 2 - middle);\n if (d < gap) [near, gap] = [k, d];\n });\n const row = columns[i]?.rows[near];\n if (row) choose(row.time);\n setSettled((n) => n + 1);\n }, 120);\n };\n const onListKey = (i: number) => (event: KeyboardEvent<HTMLDivElement>) => {\n const col = columns[i] as Column;\n const count = col.rows.length;\n const usable = (k: number) => !col.rows[k]?.disabled;\n const go = (k: number) => {\n event.preventDefault();\n const row = col.rows[k];\n if (row) choose(row.time);\n };\n if (event.key === \"ArrowDown\") return go(seekEnabled(count, col.rest, 1, usable));\n if (event.key === \"ArrowUp\") return go(seekEnabled(count, col.rest, -1, usable));\n if (event.key === \"Home\") return go(seekEnabled(count, -1, 1, usable));\n if (event.key === \"End\") return go(seekEnabled(count, count, -1, usable));\n if (event.key === \"ArrowLeft\" || event.key === \"ArrowRight\") {\n event.preventDefault();\n lists.current[i + (event.key === \"ArrowRight\" ? 1 : -1)]?.focus();\n } else if (event.key === \"Enter\") {\n event.preventDefault();\n close();\n } else if (h12 && isTypeaheadKey(event) && /^[ap]$/i.test(event.key)) {\n setHalf(event.key.toLowerCase() === \"p\");\n } else if (isTypeaheadKey(event)) {\n const to = seek(\n event.key,\n col.rows.map((row) => (row.disabled ? null : row.typed)),\n col.rest,\n );\n if (to >= 0) go(to);\n }\n };\n const scrolledByHand = (i: number) => () => {\n byHand.current[i] = true;\n };\n const percent = (t: number) => `${(t / DAY) * 100}%`;\n\n const hasPicker = picker && !readOnly;\n return (\n <>\n <TextField\n ref={input}\n label={label}\n {...(labelHidden ? { labelHidden } : {})}\n layout={layout}\n width={width}\n {...(description !== undefined ? { description } : {})}\n {...((error ?? problem) != null ? { error: error ?? problem } : {})}\n value={shown}\n onChange={setDraft}\n onBlur={commit}\n onKeyDown={onKeyDown}\n placeholder={pattern}\n inputMode={h12 ? \"text\" : \"numeric\"}\n autoComplete=\"off\"\n {...(hasPicker ? {} : { iconStart: clock })}\n form={form}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n size={size}\n className={className ? `cy-time-field ${className}` : \"cy-time-field\"}\n {...(style ? { style } : {})}\n addonEnd={\n hasPicker && (\n <Popover\n label={text.open}\n open={open}\n onOpenChange={toggle}\n placement=\"bottom\"\n trigger={(props) => (\n <IconButton\n {...props}\n icon={clock}\n label={text.open}\n variant=\"ghost\"\n size=\"sm\"\n disabled={disabled}\n className=\"cy-time-field-open\"\n />\n )}\n >\n <div className=\"cy-time-field-picker\">\n <div className=\"cy-time-field-wheel cy-reset\">\n <div className=\"cy-time-field-drum cy-reset\" dir=\"ltr\">\n <div className=\"cy-time-field-lens cy-reset\" />\n {columns.map((col, i) => (\n <Fragment key={col.unit}>\n {i > 0 && (\n <span className=\"cy-time-field-colon cy-reset\" aria-hidden=\"true\">\n :\n </span>\n )}\n <div\n ref={(el) => {\n lists.current[i] = el;\n }}\n role=\"listbox\"\n tabIndex={0}\n aria-label={col.name}\n aria-activedescendant={\n col.rows.some((row) => row.selected) ? `${id}-${col.unit}-${col.rest}` : undefined\n }\n className=\"cy-time-field-column cy-reset\"\n onKeyDown={onListKey(i)}\n onClick={(event) => {\n const option = (event.target as HTMLElement).closest<HTMLElement>(\"[data-index]\");\n const row = col.rows[Number(option?.dataset.index ?? -1)];\n if (row && !row.disabled) choose(row.time);\n }}\n onScroll={onScroll(i)}\n onWheel={scrolledByHand(i)}\n onTouchStart={scrolledByHand(i)}\n onPointerDown={scrolledByHand(i)}\n >\n {col.rows.map((row, k) => (\n <div\n key={row.typed}\n id={`${id}-${col.unit}-${k}`}\n role=\"option\"\n aria-selected={row.selected}\n aria-disabled={row.disabled || undefined}\n tabIndex={-1}\n data-index={k}\n className=\"cy-time-field-option cy-reset\"\n >\n {row.text}\n </div>\n ))}\n </div>\n </Fragment>\n ))}\n </div>\n {h12 && (\n <SegmentedControl\n label={text.period}\n size=\"sm\"\n value={parts.h >= 12 ? \"pm\" : \"am\"}\n onChange={(half) => setHalf(half === \"pm\")}\n options={[\n { value: \"am\", label: text.am, disabled: !allowed(0, HALF - 1) },\n { value: \"pm\", label: text.pm, disabled: !allowed(HALF, DAY - 1) },\n ]}\n />\n )}\n </div>\n {dayTrack && (\n <Slider\n label={text.dayTrack}\n labelHidden\n min={0}\n max={1440}\n step={every}\n largeStep={60}\n size=\"sm\"\n value={Math.floor(base / 60)}\n onChange={(minutes) => choose(Math.min(minutes as number, 1440 - every) * 60)}\n marks={[0, 6, 12, 18, 24].map((h) => ({\n value: h * 60,\n ...(h % 24 === 0\n ? {}\n : { label: h12 ? `${h % 12 || 12} ${h < 12 ? text.am : text.pm}` : pad(h) }),\n }))}\n labels={{\n value: (minutes) => {\n const t = Math.min(minutes, 1439) * 60;\n return h12 ? formatTime12(t, false) : formatTime(t);\n },\n }}\n className=\"cy-time-field-track\"\n trackContent={\n <div\n className=\"cy-time-field-day cy-reset\"\n style={\n { \"--_open-from\": percent(first), \"--_open-to\": percent(last) } as CSSProperties\n }\n />\n }\n />\n )}\n {nowAllowed && (\n <div className=\"cy-time-field-foot cy-reset\">\n <Button variant=\"ghost\" size=\"sm\" onClick={() => choose(nowTime())}>\n {text.now}\n </Button>\n </div>\n )}\n </div>\n </Popover>\n )\n }\n />\n {/* The form receives the value, never the text being typed: 21:30 even when it is shown as 9:30 PM. */}\n <HiddenValue\n name={name}\n form={form}\n value={current ?? \"\"}\n disabled={disabled}\n onReset={() => {\n settle();\n resetCurrent(defaultValue);\n }}\n />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAuHA,IAAMyB,IAAM,OACNC,IAAA,CAAOC,MAAc,OAAOA,CAAC,EAAE,SAAS,GAAG,GAAG;AAMpD,SAAgBC,EAAUC,GAA6B;AACrD,QAAMC,IAAI,kEAAkE,KAAKD,CAAI;AACrF,MAAI,CAACC,EAAG,QAAO;AACf,MAAIC,IAAI,OAAOD,EAAE,CAAA,CAAE;AACnB,QAAME,IAA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AA,MAAe;AACb,MAAAwC,EAAO,GACP3B,GAAavB,EAAY;AAAA,IAC3B;AAAA,EACD,CAAA,CACD,EAAA,CAAA;AAEN"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from "react";
|
|
2
|
+
export interface TitleBarTokens {
|
|
3
|
+
/** Bar height. In overlay mode the window's `titlebar-area-height` wins when the browser gives one. */
|
|
4
|
+
height: string;
|
|
5
|
+
/** Bar background. */
|
|
6
|
+
bg: string;
|
|
7
|
+
/** Text colour of the bar and its title. */
|
|
8
|
+
ink: string;
|
|
9
|
+
/** Colour of the line under the bar. */
|
|
10
|
+
border: string;
|
|
11
|
+
/** Space at the bar's ends, after `leadingInset` (none beside the window controls). */
|
|
12
|
+
paddingInline: string;
|
|
13
|
+
/** Space between the leading, title and trailing content. */
|
|
14
|
+
gap: string;
|
|
15
|
+
/** Font size of the centre title. */
|
|
16
|
+
titleFontSize: string;
|
|
17
|
+
/** Width of each window control (they are as tall as the bar). */
|
|
18
|
+
controlWidth: string;
|
|
19
|
+
/** Fill of the close control on hover. */
|
|
20
|
+
closeHoverBg: string;
|
|
21
|
+
/** Icon colour of the close control on hover. */
|
|
22
|
+
closeHoverInk: string;
|
|
23
|
+
/** Stacking order in overlay mode, where the bar is fixed to the top of the window. */
|
|
24
|
+
z: string;
|
|
25
|
+
}
|
|
26
|
+
declare module "../../tokens/schema.js" {
|
|
27
|
+
interface ComponentTokens {
|
|
28
|
+
titleBar: TitleBarTokens;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/** The window controls TitleBar draws at its inline end; each button shows only when its callback is given. */
|
|
32
|
+
export interface TitleBarControls {
|
|
33
|
+
/** Minimizes the window. Shows the Minimize button. */
|
|
34
|
+
minimize?: (() => void) | undefined;
|
|
35
|
+
/** Maximizes the window, or restores it when `maximized`. Shows the Maximize/Restore button. */
|
|
36
|
+
toggleMaximize?: (() => void) | undefined;
|
|
37
|
+
/** Closes the window. Shows the Close button. */
|
|
38
|
+
close?: (() => void) | undefined;
|
|
39
|
+
/** The window is maximized: the middle button shows the restore icon and is named Restore. */
|
|
40
|
+
maximized?: boolean | undefined;
|
|
41
|
+
}
|
|
42
|
+
/** Built-in strings, overridable. */
|
|
43
|
+
export interface TitleBarLabels {
|
|
44
|
+
minimize: string;
|
|
45
|
+
maximize: string;
|
|
46
|
+
restore: string;
|
|
47
|
+
close: string;
|
|
48
|
+
}
|
|
49
|
+
export interface TitleBarProps {
|
|
50
|
+
/** The title, centred on the bar (it ends in an ellipsis when there is no room). Any content: text, a SearchField. */
|
|
51
|
+
children?: ReactNode;
|
|
52
|
+
/** Content at the inline start, such as a Menubar or the app's mark. */
|
|
53
|
+
leading?: ReactNode;
|
|
54
|
+
/** Content at the inline end, before the window controls, such as IconButtons. */
|
|
55
|
+
trailing?: ReactNode;
|
|
56
|
+
/**
|
|
57
|
+
* Pixels kept clear at the inline start for window buttons the system draws over the bar (macOS traffic lights:
|
|
58
|
+
* about 80). A fixed number, since the system draws them at a fixed size whatever the theme's scale. Default 0.
|
|
59
|
+
*/
|
|
60
|
+
leadingInset?: number;
|
|
61
|
+
/**
|
|
62
|
+
* Window Controls Overlay (installed web apps, Electron's `titleBarOverlay`): the bar is fixed to the window's title
|
|
63
|
+
* bar area, `env(titlebar-area-x/y/width/height)`, so it never runs under the controls the system draws. Without
|
|
64
|
+
* those values it falls back to the top of the window, full width and the `height` token. Offset the page's content
|
|
65
|
+
* with `onHeightChange`. Default false.
|
|
66
|
+
*/
|
|
67
|
+
overlay?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Window controls drawn by the app (Linux, frameless windows): minimize, maximize or restore, and close, as tall as
|
|
70
|
+
* the bar at its inline end. Leave out where the system draws them (macOS, Window Controls Overlay).
|
|
71
|
+
*/
|
|
72
|
+
controls?: TitleBarControls | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Called with the bar's height (border box, in pixels) on mount and whenever it changes, to offset content under
|
|
75
|
+
* an overlay bar or to place the system's own window buttons (Electron's traffic-light position).
|
|
76
|
+
*/
|
|
77
|
+
onHeightChange?: ((height: number) => void) | undefined;
|
|
78
|
+
/** Accessible name of the bar (a group). Default "Title bar". */
|
|
79
|
+
label?: string;
|
|
80
|
+
/** Names of the window controls, for other languages. */
|
|
81
|
+
labels?: Partial<TitleBarLabels>;
|
|
82
|
+
/** Layout only. */
|
|
83
|
+
className?: string;
|
|
84
|
+
/** Layout only. Restyle through --cy-title-bar-* tokens. */
|
|
85
|
+
style?: CSSProperties;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The title bar of an installed app that draws its own (a frameless Electron window, a web app with Window Controls
|
|
89
|
+
* Overlay). The whole bar drags the window; every control inside opts out, so it stays clickable.
|
|
90
|
+
*/
|
|
91
|
+
export declare const TitleBar: import("react").ForwardRefExoticComponent<TitleBarProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { IconButton as B } from "../IconButton/IconButton.js";
|
|
3
|
+
import { close as $ } from "../../icons/close.js";
|
|
4
|
+
import { mergeRefs as T } from "../../foundations/refs.js";
|
|
5
|
+
import { minus as j } from "../../icons/minus.js";
|
|
6
|
+
import { windowMaximize as C } from "../../icons/window-maximize.js";
|
|
7
|
+
import { windowRestore as E } from "../../icons/window-restore.js";
|
|
8
|
+
import { forwardRef as L, useEffect as A, useRef as x } from "react";
|
|
9
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
10
|
+
var O = {
|
|
11
|
+
minimize: "Minimize",
|
|
12
|
+
maximize: "Maximize",
|
|
13
|
+
restore: "Restore",
|
|
14
|
+
close: "Close"
|
|
15
|
+
}, K = L(function({ children: v, leading: g, trailing: y, leadingInset: n = 0, overlay: w = !1, controls: e, onHeightChange: o, label: h = "Title bar", labels: R, className: f, style: d }, M) {
|
|
16
|
+
const z = x(null), u = x(o);
|
|
17
|
+
u.current = o;
|
|
18
|
+
const b = o !== void 0;
|
|
19
|
+
A(() => {
|
|
20
|
+
const i = z.current;
|
|
21
|
+
if (!i || !b) return;
|
|
22
|
+
let r = -1;
|
|
23
|
+
const m = () => {
|
|
24
|
+
const l = i.getBoundingClientRect().height;
|
|
25
|
+
l !== r && (r = l, u.current?.(l));
|
|
26
|
+
};
|
|
27
|
+
m();
|
|
28
|
+
const p = new ResizeObserver(m);
|
|
29
|
+
return p.observe(i), () => p.disconnect();
|
|
30
|
+
}, [b]);
|
|
31
|
+
const t = {
|
|
32
|
+
...O,
|
|
33
|
+
...R
|
|
34
|
+
}, N = !!(e && (e.minimize || e.toggleMaximize || e.close)), a = (i, r, m) => /* @__PURE__ */ s(B, {
|
|
35
|
+
icon: i === "minimize" ? j : i === "close" ? $ : e?.maximized ? E : C,
|
|
36
|
+
label: r,
|
|
37
|
+
variant: "ghost",
|
|
38
|
+
tooltipPlacement: "bottom",
|
|
39
|
+
onClick: m,
|
|
40
|
+
className: `cy-title-bar-control${i === "close" ? " cy-title-bar-close" : ""}`,
|
|
41
|
+
wrapperClassName: "cy-title-bar-control-anchor"
|
|
42
|
+
}, i);
|
|
43
|
+
return /* @__PURE__ */ c("div", {
|
|
44
|
+
ref: T(z, M),
|
|
45
|
+
role: "group",
|
|
46
|
+
"aria-label": h,
|
|
47
|
+
className: `cy-title-bar${f ? ` ${f}` : ""}`,
|
|
48
|
+
"data-overlay": w ? "" : void 0,
|
|
49
|
+
style: n ? {
|
|
50
|
+
...d,
|
|
51
|
+
"--_inset": `${n}px`
|
|
52
|
+
} : d,
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ s("div", {
|
|
55
|
+
className: "cy-title-bar-leading cy-reset",
|
|
56
|
+
children: g
|
|
57
|
+
}),
|
|
58
|
+
/* @__PURE__ */ s("div", {
|
|
59
|
+
className: "cy-title-bar-title cy-reset",
|
|
60
|
+
children: v
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ c("div", {
|
|
63
|
+
className: "cy-title-bar-trailing cy-reset",
|
|
64
|
+
children: [y, N && e ? /* @__PURE__ */ c("div", {
|
|
65
|
+
className: "cy-title-bar-controls cy-reset",
|
|
66
|
+
children: [
|
|
67
|
+
e.minimize && a("minimize", t.minimize, e.minimize),
|
|
68
|
+
e.toggleMaximize && a("maximize", e.maximized ? t.restore : t.maximize, e.toggleMaximize),
|
|
69
|
+
e.close && a("close", t.close, e.close)
|
|
70
|
+
]
|
|
71
|
+
}) : null]
|
|
72
|
+
})
|
|
73
|
+
]
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
export {
|
|
77
|
+
K as TitleBar
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=TitleBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TitleBar.js","names":["closeIcon","IconButton","close","mergeRefs","minus","windowMaximize","windowRestore","forwardRef","useEffect","useRef","jsx","jsxs","LABELS","TitleBar","children","leading","trailing","leadingInset","overlay","controls","onHeightChange","label","labels","className","style","forwarded","own","notify","watching","el","last","report","height","observer","text","hasControls","control","key","name","onClick"],"sources":["../../../src/components/TitleBar/TitleBar.tsx"],"sourcesContent":["import { type CSSProperties, forwardRef, type ReactNode, useEffect, useRef } from \"react\";\nimport { mergeRefs } from \"../../foundations/refs.js\";\nimport { close as closeIcon, minus, windowMaximize, windowRestore } from \"../../icons/index.js\";\nimport { IconButton } from \"../IconButton/IconButton.js\";\n\nexport interface TitleBarTokens {\n /** Bar height. In overlay mode the window's `titlebar-area-height` wins when the browser gives one. */\n height: string;\n /** Bar background. */\n bg: string;\n /** Text colour of the bar and its title. */\n ink: string;\n /** Colour of the line under the bar. */\n border: string;\n /** Space at the bar's ends, after `leadingInset` (none beside the window controls). */\n paddingInline: string;\n /** Space between the leading, title and trailing content. */\n gap: string;\n /** Font size of the centre title. */\n titleFontSize: string;\n /** Width of each window control (they are as tall as the bar). */\n controlWidth: string;\n /** Fill of the close control on hover. */\n closeHoverBg: string;\n /** Icon colour of the close control on hover. */\n closeHoverInk: string;\n /** Stacking order in overlay mode, where the bar is fixed to the top of the window. */\n z: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n titleBar: TitleBarTokens;\n }\n}\n\n/** The window controls TitleBar draws at its inline end; each button shows only when its callback is given. */\nexport interface TitleBarControls {\n /** Minimizes the window. Shows the Minimize button. */\n minimize?: (() => void) | undefined;\n /** Maximizes the window, or restores it when `maximized`. Shows the Maximize/Restore button. */\n toggleMaximize?: (() => void) | undefined;\n /** Closes the window. Shows the Close button. */\n close?: (() => void) | undefined;\n /** The window is maximized: the middle button shows the restore icon and is named Restore. */\n maximized?: boolean | undefined;\n}\n\n/** Built-in strings, overridable. */\nexport interface TitleBarLabels {\n minimize: string;\n maximize: string;\n restore: string;\n close: string;\n}\n\nconst LABELS: TitleBarLabels = {\n minimize: \"Minimize\",\n maximize: \"Maximize\",\n restore: \"Restore\",\n close: \"Close\",\n};\n\nexport interface TitleBarProps {\n /** The title, centred on the bar (it ends in an ellipsis when there is no room). Any content: text, a SearchField. */\n children?: ReactNode;\n /** Content at the inline start, such as a Menubar or the app's mark. */\n leading?: ReactNode;\n /** Content at the inline end, before the window controls, such as IconButtons. */\n trailing?: ReactNode;\n /**\n * Pixels kept clear at the inline start for window buttons the system draws over the bar (macOS traffic lights:\n * about 80). A fixed number, since the system draws them at a fixed size whatever the theme's scale. Default 0.\n */\n leadingInset?: number;\n /**\n * Window Controls Overlay (installed web apps, Electron's `titleBarOverlay`): the bar is fixed to the window's title\n * bar area, `env(titlebar-area-x/y/width/height)`, so it never runs under the controls the system draws. Without\n * those values it falls back to the top of the window, full width and the `height` token. Offset the page's content\n * with `onHeightChange`. Default false.\n */\n overlay?: boolean;\n /**\n * Window controls drawn by the app (Linux, frameless windows): minimize, maximize or restore, and close, as tall as\n * the bar at its inline end. Leave out where the system draws them (macOS, Window Controls Overlay).\n */\n controls?: TitleBarControls | undefined;\n /**\n * Called with the bar's height (border box, in pixels) on mount and whenever it changes, to offset content under\n * an overlay bar or to place the system's own window buttons (Electron's traffic-light position).\n */\n onHeightChange?: ((height: number) => void) | undefined;\n /** Accessible name of the bar (a group). Default \"Title bar\". */\n label?: string;\n /** Names of the window controls, for other languages. */\n labels?: Partial<TitleBarLabels>;\n /** Layout only. */\n className?: string;\n /** Layout only. Restyle through --cy-title-bar-* tokens. */\n style?: CSSProperties;\n}\n\n/**\n * The title bar of an installed app that draws its own (a frameless Electron window, a web app with Window Controls\n * Overlay). The whole bar drags the window; every control inside opts out, so it stays clickable.\n */\nexport const TitleBar = forwardRef<HTMLDivElement, TitleBarProps>(function TitleBar(\n {\n children,\n leading,\n trailing,\n leadingInset = 0,\n overlay = false,\n controls,\n onHeightChange,\n label = \"Title bar\",\n labels,\n className,\n style,\n },\n forwarded,\n) {\n const own = useRef<HTMLDivElement | null>(null);\n\n // Report the border-box height (a ResizeObserver entry's content box would leave out the bottom border), once per\n // change, with the latest callback.\n const notify = useRef(onHeightChange);\n notify.current = onHeightChange;\n const watching = onHeightChange !== undefined;\n useEffect(() => {\n const el = own.current;\n if (!el || !watching) return;\n let last = -1;\n const report = () => {\n const height = el.getBoundingClientRect().height;\n if (height === last) return;\n last = height;\n notify.current?.(height);\n };\n report();\n const observer = new ResizeObserver(report);\n observer.observe(el);\n return () => observer.disconnect();\n }, [watching]);\n\n const text = { ...LABELS, ...labels };\n const hasControls = !!(controls && (controls.minimize || controls.toggleMaximize || controls.close));\n const control = (key: \"minimize\" | \"maximize\" | \"close\", name: string, onClick: () => void) => (\n <IconButton\n key={key}\n icon={\n key === \"minimize\"\n ? minus\n : key === \"close\"\n ? closeIcon\n : controls?.maximized\n ? windowRestore\n : windowMaximize\n }\n label={name}\n variant=\"ghost\"\n tooltipPlacement=\"bottom\"\n onClick={onClick}\n className={`cy-title-bar-control${key === \"close\" ? \" cy-title-bar-close\" : \"\"}`}\n wrapperClassName=\"cy-title-bar-control-anchor\"\n />\n );\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: a fieldset is a form part; the bar is a named group of chrome.\n <div\n ref={mergeRefs(own, forwarded)}\n role=\"group\"\n aria-label={label}\n className={`cy-title-bar${className ? ` ${className}` : \"\"}`}\n data-overlay={overlay ? \"\" : undefined}\n style={leadingInset ? ({ ...style, \"--_inset\": `${leadingInset}px` } as CSSProperties) : style}\n >\n <div className=\"cy-title-bar-leading cy-reset\">{leading}</div>\n <div className=\"cy-title-bar-title cy-reset\">{children}</div>\n <div className=\"cy-title-bar-trailing cy-reset\">\n {trailing}\n {hasControls && controls ? (\n <div className=\"cy-title-bar-controls cy-reset\">\n {controls.minimize && control(\"minimize\", text.minimize, controls.minimize)}\n {controls.toggleMaximize &&\n control(\"maximize\", controls.maximized ? text.restore : text.maximize, controls.toggleMaximize)}\n {controls.close && control(\"close\", text.close, controls.close)}\n </div>\n ) : null}\n </div>\n </div>\n );\n});\n"],"mappings":";;;;;;;;;AAwDA,IAAMY,IAAyB;AAAA,EAC7B,UAAU;AAAA,EACV,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AACT,GA6CaC,IAAWN,EAA0C,SAChE,EACE,UAAAO,GACA,SAAAC,GACA,UAAAC,GACA,cAAAC,IAAe,GACf,SAAAC,IAAU,IACV,UAAAC,GACA,gBAAAC,GACA,OAAAC,IAAQ,aACR,QAAAC,GACA,WAAAC,GACA,OAAAC,EAAA,GAEFC,GACA;AACA,QAAMC,IAAMjB,EAA8B,IAAI,GAIxCkB,IAASlB,EAAOW,CAAc;AACpC,EAAAO,EAAO,UAAUP;AACjB,QAAMQ,IAAWR,MAAmB;AACpC,EAAAZ,EAAA,MAAgB;AACd,UAAMqB,IAAKH,EAAI;AACf,QAAI,CAACG,KAAM,CAACD,EAAU;AACtB,QAAIE,IAAO;AACX,UAAMC,IAAA,MAAe;AACnB,YAAMC,IAASH,EAAG,sBAAsB,EAAE;AAC1C,MAAIG,MAAWF,MACfA,IAAOE,GACPL,EAAO,UAAUK,CAAM;AAAA,IACzB;AACA,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AAA,UAAK,WAAU;AAAA,UAAf,UAAA;AAAA,YACGQ,EAAS,YAAYiB,EAAQ,YAAYF,EAAK,UAAUf,EAAS,QAAQ;AAAA,YACzEA,EAAS,kBACRiB,EAAQ,YAAYjB,EAAS,YAAYe,EAAK,UAAUA,EAAK,UAAUf,EAAS,cAAc;AAAA,YAC/FA,EAAS,SAASiB,EAAQ,SAASF,EAAK,OAAOf,EAAS,KAAK;AAAA,UAC3D;AAAA,QACH,CAAA,IAAA,IACD;AAAA,M;A,IACF;AAAA,E;AAET,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TitleBar, type TitleBarControls, type TitleBarLabels, type TitleBarProps, type TitleBarTokens, } from "./TitleBar.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactNode } from "react";
|
|
2
|
+
import { type Space } from "../../foundations/layout.js";
|
|
2
3
|
import type { Tone } from "../../tokens/schema.js";
|
|
3
|
-
import { type Space } from "../Stack/space.js";
|
|
4
4
|
export interface ToastTokens {
|
|
5
5
|
width: string;
|
|
6
6
|
radius: string;
|
|
@@ -17,7 +17,15 @@ declare module "../../tokens/schema.js" {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
export type ToastTone = Extract<Tone, "neutral" | "success" | "danger" | "warning" | "info">;
|
|
20
|
+
/** Why a toast closed: its timer ran out, the user closed it (close button or swipe), or `dismiss()` was called. */
|
|
21
|
+
export type ToastDismissReason = "timeout" | "user" | "programmatic";
|
|
20
22
|
export interface ToastOptions {
|
|
23
|
+
/**
|
|
24
|
+
* Names the toast. Calling `toast()` again with the id of a toast that is still showing updates that toast in place
|
|
25
|
+
* (a loading toast becoming done) instead of adding another; its timer starts again with the new `duration`.
|
|
26
|
+
* Default: a new id for every call.
|
|
27
|
+
*/
|
|
28
|
+
id?: string;
|
|
21
29
|
title: string;
|
|
22
30
|
description?: string;
|
|
23
31
|
/** Colour and icon. `danger` is announced assertively (`role="alert"`); the others politely. */
|
|
@@ -29,9 +37,16 @@ export interface ToastOptions {
|
|
|
29
37
|
};
|
|
30
38
|
/** Milliseconds before it closes itself (default 5000). `Infinity` keeps it until dismissed. */
|
|
31
39
|
duration?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Work in progress: a spinner in place of the tone's icon, and no timer until the toast is updated (`toast()` with
|
|
42
|
+
* the same `id`) or dismissed.
|
|
43
|
+
*/
|
|
44
|
+
loading?: boolean;
|
|
45
|
+
/** Called once when the toast starts to close, with its id and why it closed. */
|
|
46
|
+
onDismiss?: (id: string, reason: ToastDismissReason) => void;
|
|
32
47
|
}
|
|
33
48
|
export interface ToastApi {
|
|
34
|
-
/** Shows a toast and returns its id. */
|
|
49
|
+
/** Shows a toast and returns its id; with the `id` of a toast that is showing, updates that toast instead. */
|
|
35
50
|
toast: (options: ToastOptions) => string;
|
|
36
51
|
/** Closes one toast, or all of them without an id. */
|
|
37
52
|
dismiss: (id?: string) => void;
|