@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
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Component, type CSSProperties, type ErrorInfo, type ReactNode } from "react";
|
|
2
|
+
export interface ErrorBoundaryTokens {
|
|
3
|
+
/** Space around the default fallback, inside the area it replaces. */
|
|
4
|
+
padding: string;
|
|
5
|
+
/** Widest the default fallback's message grows. */
|
|
6
|
+
maxWidth: string;
|
|
7
|
+
}
|
|
8
|
+
declare module "../../tokens/schema.js" {
|
|
9
|
+
interface ComponentTokens {
|
|
10
|
+
errorBoundary: ErrorBoundaryTokens;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export interface ErrorBoundaryLabels {
|
|
14
|
+
/** Heading of the default fallback; it gets `label` when one is set. */
|
|
15
|
+
title: (label?: string) => string;
|
|
16
|
+
/** The default fallback's retry button. */
|
|
17
|
+
retry: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ErrorBoundaryProps {
|
|
20
|
+
/** The part of the app this boundary protects. Rendered as it is, with no wrapper element. */
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* What to show instead of `children` after they threw while rendering: gets the error (anything thrown that is not
|
|
24
|
+
* an Error is wrapped in one) and `retry`, which renders the children again. Default: a danger Notice naming the
|
|
25
|
+
* part (`label`), with the error's message and a "Try again" button.
|
|
26
|
+
*/
|
|
27
|
+
fallback?: ((error: Error, retry: () => void) => ReactNode) | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* When this value changes (compared with `Object.is`), a caught error is cleared and the children render again: pass
|
|
30
|
+
* what the content depends on (a tab or route id) so moving on recovers.
|
|
31
|
+
*/
|
|
32
|
+
resetKey?: unknown;
|
|
33
|
+
/** Called once per caught error, with React's component stack, for logging or reporting. */
|
|
34
|
+
onError?: ((error: Error, info: ErrorInfo) => void) | undefined;
|
|
35
|
+
/** Names the protected part in the default fallback's heading ("Query results could not be shown"). */
|
|
36
|
+
label?: string | undefined;
|
|
37
|
+
/** Replace the built-in English text of the default fallback: its heading and the retry button. */
|
|
38
|
+
labels?: Partial<ErrorBoundaryLabels> | undefined;
|
|
39
|
+
/** Added to the default fallback's root, for layout. */
|
|
40
|
+
className?: string;
|
|
41
|
+
/** Layout only, on the default fallback's root. Restyle through --cy-error-boundary-* tokens. */
|
|
42
|
+
style?: CSSProperties;
|
|
43
|
+
}
|
|
44
|
+
interface State {
|
|
45
|
+
error: Error | null;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Catches errors thrown while rendering its children and shows a fallback in their place, so one crashing part (a
|
|
49
|
+
* panel, a tab, a widget) does not take the rest of the app down. Retry, or a new `resetKey`, renders them again.
|
|
50
|
+
*/
|
|
51
|
+
export declare class ErrorBoundary extends Component<ErrorBoundaryProps, State> {
|
|
52
|
+
state: State;
|
|
53
|
+
static getDerivedStateFromError(thrown: unknown): State;
|
|
54
|
+
componentDidCatch(thrown: unknown, info: ErrorInfo): void;
|
|
55
|
+
componentDidUpdate(previous: ErrorBoundaryProps): void;
|
|
56
|
+
retry: () => void;
|
|
57
|
+
render(): string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
|
|
58
|
+
}
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Button as l } from "../Button/Button.js";
|
|
3
|
+
import { Notice as d } from "../Notice/Notice.js";
|
|
4
|
+
import { Component as m } from "react";
|
|
5
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
6
|
+
var p = {
|
|
7
|
+
title: (r) => r ? `${r} could not be shown` : "Something went wrong",
|
|
8
|
+
retry: "Try again"
|
|
9
|
+
}, n = (r) => r instanceof Error ? r : new Error(String(r)), g = class extends m {
|
|
10
|
+
state = { error: null };
|
|
11
|
+
static getDerivedStateFromError(r) {
|
|
12
|
+
return { error: n(r) };
|
|
13
|
+
}
|
|
14
|
+
componentDidCatch(r, t) {
|
|
15
|
+
this.props.onError?.(n(r), t);
|
|
16
|
+
}
|
|
17
|
+
componentDidUpdate(r) {
|
|
18
|
+
this.state.error && !Object.is(r.resetKey, this.props.resetKey) && this.retry();
|
|
19
|
+
}
|
|
20
|
+
retry = () => this.setState({ error: null });
|
|
21
|
+
render() {
|
|
22
|
+
const { error: r } = this.state;
|
|
23
|
+
if (!r) return this.props.children;
|
|
24
|
+
const { fallback: t, label: i, labels: a, className: o, style: c } = this.props;
|
|
25
|
+
if (t) return t(r, this.retry);
|
|
26
|
+
const s = {
|
|
27
|
+
...p,
|
|
28
|
+
...a
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ e("div", {
|
|
31
|
+
className: o ? `cy-error-boundary ${o}` : "cy-error-boundary",
|
|
32
|
+
style: c,
|
|
33
|
+
children: /* @__PURE__ */ e(d, {
|
|
34
|
+
tone: "danger",
|
|
35
|
+
title: s.title(i),
|
|
36
|
+
className: "cy-error-boundary-notice",
|
|
37
|
+
action: /* @__PURE__ */ e(l, {
|
|
38
|
+
size: "sm",
|
|
39
|
+
variant: "soft",
|
|
40
|
+
tone: "danger",
|
|
41
|
+
onClick: this.retry,
|
|
42
|
+
children: s.retry
|
|
43
|
+
}),
|
|
44
|
+
children: r.message
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
g as ErrorBoundary
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=ErrorBoundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.js","names":["Button","Notice","Component","jsx","DEFAULT_LABELS","label","toError","thrown","ErrorBoundary","info","previous","error","fallback","labels","className","style","text"],"sources":["../../../src/components/ErrorBoundary/ErrorBoundary.tsx"],"sourcesContent":["import { Component, type CSSProperties, type ErrorInfo, type ReactNode } from \"react\";\nimport { Button } from \"../Button/Button.js\";\nimport { Notice } from \"../Notice/Notice.js\";\n\nexport interface ErrorBoundaryTokens {\n /** Space around the default fallback, inside the area it replaces. */\n padding: string;\n /** Widest the default fallback's message grows. */\n maxWidth: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n errorBoundary: ErrorBoundaryTokens;\n }\n}\n\nexport interface ErrorBoundaryLabels {\n /** Heading of the default fallback; it gets `label` when one is set. */\n title: (label?: string) => string;\n /** The default fallback's retry button. */\n retry: string;\n}\n\nexport interface ErrorBoundaryProps {\n /** The part of the app this boundary protects. Rendered as it is, with no wrapper element. */\n children?: ReactNode;\n /**\n * What to show instead of `children` after they threw while rendering: gets the error (anything thrown that is not\n * an Error is wrapped in one) and `retry`, which renders the children again. Default: a danger Notice naming the\n * part (`label`), with the error's message and a \"Try again\" button.\n */\n fallback?: ((error: Error, retry: () => void) => ReactNode) | undefined;\n /**\n * When this value changes (compared with `Object.is`), a caught error is cleared and the children render again: pass\n * what the content depends on (a tab or route id) so moving on recovers.\n */\n resetKey?: unknown;\n /** Called once per caught error, with React's component stack, for logging or reporting. */\n onError?: ((error: Error, info: ErrorInfo) => void) | undefined;\n /** Names the protected part in the default fallback's heading (\"Query results could not be shown\"). */\n label?: string | undefined;\n /** Replace the built-in English text of the default fallback: its heading and the retry button. */\n labels?: Partial<ErrorBoundaryLabels> | undefined;\n /** Added to the default fallback's root, for layout. */\n className?: string;\n /** Layout only, on the default fallback's root. Restyle through --cy-error-boundary-* tokens. */\n style?: CSSProperties;\n}\n\nconst DEFAULT_LABELS: ErrorBoundaryLabels = {\n title: (label) => (label ? `${label} could not be shown` : \"Something went wrong\"),\n retry: \"Try again\",\n};\n\ninterface State {\n error: Error | null;\n}\n\n/** Anything can be thrown; the fallback and `onError` always get an Error. */\nconst toError = (thrown: unknown) => (thrown instanceof Error ? thrown : new Error(String(thrown)));\n\n/**\n * Catches errors thrown while rendering its children and shows a fallback in their place, so one crashing part (a\n * panel, a tab, a widget) does not take the rest of the app down. Retry, or a new `resetKey`, renders them again.\n */\nexport class ErrorBoundary extends Component<ErrorBoundaryProps, State> {\n override state: State = { error: null };\n\n static getDerivedStateFromError(thrown: unknown): State {\n return { error: toError(thrown) };\n }\n\n override componentDidCatch(thrown: unknown, info: ErrorInfo): void {\n this.props.onError?.(toError(thrown), info);\n }\n\n override componentDidUpdate(previous: ErrorBoundaryProps): void {\n if (this.state.error && !Object.is(previous.resetKey, this.props.resetKey)) this.retry();\n }\n\n retry = () => this.setState({ error: null });\n\n override render() {\n const { error } = this.state;\n if (!error) return this.props.children;\n const { fallback, label, labels, className, style } = this.props;\n if (fallback) return fallback(error, this.retry);\n const text = { ...DEFAULT_LABELS, ...labels };\n return (\n <div className={className ? `cy-error-boundary ${className}` : \"cy-error-boundary\"} style={style}>\n <Notice\n tone=\"danger\"\n title={text.title(label)}\n className=\"cy-error-boundary-notice\"\n action={\n <Button size=\"sm\" variant=\"soft\" tone=\"danger\" onClick={this.retry}>\n {text.retry}\n </Button>\n }\n >\n {error.message}\n </Notice>\n </div>\n );\n }\n}\n"],"mappings":";;;;;AAkDA,IAAMI,IAAsC;AAAA,EAC1C,OAAA,CAAQC,MAAWA,IAAQ,GAAGA,CAAA,wBAA6B;AAAA,EAC3D,OAAO;AACT,GAOMC,IAAA,CAAWC,MAAqBA,aAAkB,QAAQA,IAAS,IAAI,MAAM,OAAOA,CAAM,CAAC,GAMpFC,IAAb,cAAmCN,EAAqC;AAAA,EACtE,QAAwB,EAAE,OAAO,KAAK;AAAA,EAEtC,OAAO,yBAAyBK,GAAwB;AACtD,WAAO,EAAE,OAAOD,EAAQC,CAAM,EAAE;AAAA,EAClC;AAAA,EAEA,kBAA2BA,GAAiBE,GAAuB;AACjE,SAAK,MAAM,UAAUH,EAAQC,CAAM,GAAGE,CAAI;AAAA,EAC5C;AAAA,EAEA,mBAA4BC,GAAoC;AAC9D,IAAI,KAAK,MAAM,SAAS,CAAC,OAAO,GAAGA,EAAS,UAAU,KAAK,MAAM,QAAQ,KAAG,KAAK,MAAM;AAAA,EACzF;AAAA,EAEA,QAAA,MAAc,KAAK,SAAS,EAAE,OAAO,KAAK,CAAC;AAAA,EAE3C,SAAkB;AAChB,UAAM,EAAE,OAAAC,EAAA,IAAU,KAAK;AACvB,QAAI,CAACA,EAAO,QAAO,KAAK,MAAM;AAC9B,UAAM,EAAE,UAAAC,GAAU,OAAAP,GAAO,QAAAQ,GAAQ,WAAAC,GAAW,OAAAC,EAAA,IAAU,KAAK;AAC3D,QAAIH,EAAU,QAAOA,EAASD,GAAO,KAAK,KAAK;AAC/C,UAAMK,IAAO;AAAA,MAAE,GAAGZ;AAAA,MAAgB,GAAGS;AAAA,IAAO;AAC5C,WACE,gBAAAV,EAAC,OAAD;AAAA,MAAK,WAAWW,IAAY,qBAAqBA,CAAA,KAAc;AAAA,MAA4B,OAAAC;AAAA,MACzF,UAAA,gBAAAZ,EAACF,GAAD;AAAA,QACE,MAAK;AAAA,QACL,OAAOe,EAAK,MAAMX,CAAK;AAAA,QACvB,WAAU;AAAA,QACV,QACE,gBAAAF,EAACH,GAAD;AAAA,UAAQ,MAAK;AAAA,UAAK,SAAQ;AAAA,UAAO,MAAK;AAAA,UAAS,SAAS,KAAK;AAAA,UAC1D,UAAAgB,EAAK;AAAA,QACA,CAAA;AAAA,QAGT,UAAAL,EAAM;AAAA,MACD,CAAA;AAAA,IACL,CAAA;AAAA,EAET;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ErrorBoundary, type ErrorBoundaryLabels, type ErrorBoundaryProps, type ErrorBoundaryTokens, } from "./ErrorBoundary.js";
|
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from "react";
|
|
2
2
|
import { type FieldRender } from "../../foundations/field.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { DenseSize } from "../../tokens/schema.js";
|
|
4
4
|
export interface FieldTokens {
|
|
5
|
+
/** Border colour of every field's box (TextField, HotkeyField), under each control's own token. Default --cy-color-line. */
|
|
6
|
+
controlBorder: string;
|
|
7
|
+
/** Background of every field's box (TextField, HotkeyField), under each control's own token. Default --cy-color-surface. */
|
|
8
|
+
controlBg: string;
|
|
9
|
+
/** Corner radius of every field's box (TextField, HotkeyField). Default the control height times the radius factor. */
|
|
10
|
+
controlRadius: string;
|
|
11
|
+
/** Sunken fill of a box that cannot be edited: a read-only TextField, a disabled HotkeyField. Default --cy-color-soft. */
|
|
12
|
+
controlSunkenBg: string;
|
|
13
|
+
/** Narrowest the label and description get in the split layout before the control moves under them. Default 192px. */
|
|
14
|
+
splitTextMin: string;
|
|
15
|
+
/** Width of the control at `width="lg"`. Default 384px. */
|
|
16
|
+
controlWidthLg: string;
|
|
17
|
+
/** Width of the control at `width="md"`. Default 256px. */
|
|
18
|
+
controlWidthMd: string;
|
|
19
|
+
/** Width of the control at `width="sm"`. Default 160px. */
|
|
20
|
+
controlWidthSm: string;
|
|
5
21
|
gap: string;
|
|
6
22
|
labelWeight: string;
|
|
7
23
|
labelColor: string;
|
|
@@ -14,7 +30,24 @@ declare module "../../tokens/schema.js" {
|
|
|
14
30
|
field: FieldTokens;
|
|
15
31
|
}
|
|
16
32
|
}
|
|
17
|
-
|
|
33
|
+
/** Width of a Field's control: three steps from the `--cy-field-control-width-*` tokens, or the whole field. */
|
|
34
|
+
export type FieldWidth = "sm" | "md" | "lg" | "full";
|
|
35
|
+
/** How a Field lays out its label and control. Every control built on Field takes these and passes them on. */
|
|
36
|
+
export interface FieldLayoutProps {
|
|
37
|
+
/**
|
|
38
|
+
* `stack` puts the label above the control and the description and error below it. `split` puts the label and
|
|
39
|
+
* description at the start and the control at the end of one row (a settings row); when the field is too narrow for
|
|
40
|
+
* both, the control moves under the text. Default "stack".
|
|
41
|
+
*/
|
|
42
|
+
layout?: "stack" | "split" | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Width of the control, so the controls of a column of fields line up: "sm", "md" and "lg" are the
|
|
45
|
+
* `--cy-field-control-width-*` tokens (never wider than the field), "full" is the whole field. Default: the control's
|
|
46
|
+
* own width (the whole field in the stacked layout for TextField and the other fields).
|
|
47
|
+
*/
|
|
48
|
+
width?: FieldWidth | undefined;
|
|
49
|
+
}
|
|
50
|
+
export interface FieldProps extends FieldLayoutProps {
|
|
18
51
|
/** Visible label; it names the control. */
|
|
19
52
|
label: ReactNode;
|
|
20
53
|
/** Help text shown below the control and read out with it. */
|
|
@@ -23,8 +56,8 @@ export interface FieldProps {
|
|
|
23
56
|
error?: ReactNode | undefined;
|
|
24
57
|
/** Draws the required marker; pass `required` to the control too. */
|
|
25
58
|
required?: boolean | undefined;
|
|
26
|
-
/** Size of the label text. Default "md". */
|
|
27
|
-
size?:
|
|
59
|
+
/** Size of the label text, matching the control's size (an `xs` control has the `sm` label). Default "md". */
|
|
60
|
+
size?: DenseSize | undefined;
|
|
28
61
|
/** Keep the label for assistive tech but take no space (toolbars, dense rows). Prefer visible labels. */
|
|
29
62
|
labelHidden?: boolean | undefined;
|
|
30
63
|
/** Label a group of controls (radio groups) instead of one control. */
|
|
@@ -39,4 +72,4 @@ export interface FieldProps {
|
|
|
39
72
|
children: (field: FieldRender) => ReactNode;
|
|
40
73
|
}
|
|
41
74
|
/** Label, description and error wiring for any control. Controls render through `children(field)`. */
|
|
42
|
-
export declare function Field({ label, description, error, required, size, group, labelHidden, id, className, style, children, }: FieldProps): import("react").JSX.Element;
|
|
75
|
+
export declare function Field({ label, description, error, required, size, layout, width, group, labelHidden, id, className, style, children, }: FieldProps): import("react").JSX.Element;
|
|
@@ -1,55 +1,61 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useField as
|
|
3
|
-
import { Fragment as
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
id:
|
|
2
|
+
import { useField as j } from "../../foundations/field.js";
|
|
3
|
+
import { Fragment as E, jsx as l, jsxs as h } from "react/jsx-runtime";
|
|
4
|
+
function q({ label: a, description: i, error: s, required: c, size: v = "md", layout: u = "stack", width: t, group: r, labelHidden: N, id: I, className: n, style: x, children: o }) {
|
|
5
|
+
const e = j({
|
|
6
|
+
id: I,
|
|
7
7
|
description: i,
|
|
8
|
-
error:
|
|
9
|
-
}),
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
8
|
+
error: s
|
|
9
|
+
}), y = N ? "cy-field-label cy-visually-hidden" : "cy-field-label", d = u === "split", b = r ? /* @__PURE__ */ l("span", {
|
|
10
|
+
id: e.labelId,
|
|
11
|
+
className: y,
|
|
12
|
+
"data-required": c ? "" : void 0,
|
|
13
|
+
children: a
|
|
14
|
+
}) : /* @__PURE__ */ l("label", {
|
|
15
|
+
id: e.labelId,
|
|
16
|
+
htmlFor: e.id,
|
|
17
|
+
className: y,
|
|
18
|
+
"data-required": c ? "" : void 0,
|
|
19
|
+
children: a
|
|
20
|
+
}), m = i && /* @__PURE__ */ l("span", {
|
|
21
|
+
id: e.descriptionId,
|
|
22
|
+
className: "cy-field-description",
|
|
23
|
+
children: i
|
|
24
|
+
}), F = d || t ? /* @__PURE__ */ l("div", {
|
|
25
|
+
className: "cy-field-control cy-reset",
|
|
26
|
+
"data-width": t,
|
|
27
|
+
children: o(e)
|
|
28
|
+
}) : o(e), f = /* @__PURE__ */ h(E, { children: [
|
|
29
|
+
d ? /* @__PURE__ */ h("div", {
|
|
30
|
+
className: "cy-field-text cy-reset",
|
|
31
|
+
children: [b, m]
|
|
32
|
+
}) : b,
|
|
33
|
+
F,
|
|
34
|
+
!d && m,
|
|
35
|
+
e.invalid && /* @__PURE__ */ l("span", {
|
|
36
|
+
id: e.errorId,
|
|
32
37
|
className: "cy-field-error",
|
|
33
38
|
role: "alert",
|
|
34
|
-
children:
|
|
39
|
+
children: s
|
|
35
40
|
})
|
|
36
|
-
] }),
|
|
41
|
+
] }), p = {
|
|
37
42
|
className: `cy-field${n ? ` ${n}` : ""}`,
|
|
38
|
-
"data-size":
|
|
39
|
-
|
|
43
|
+
"data-size": v,
|
|
44
|
+
"data-layout": d ? "split" : void 0,
|
|
45
|
+
style: x
|
|
40
46
|
};
|
|
41
|
-
return
|
|
42
|
-
...
|
|
43
|
-
"aria-labelledby":
|
|
44
|
-
"aria-describedby":
|
|
45
|
-
children:
|
|
46
|
-
}) : /* @__PURE__ */
|
|
47
|
-
...
|
|
48
|
-
children:
|
|
47
|
+
return r ? /* @__PURE__ */ l("fieldset", {
|
|
48
|
+
...p,
|
|
49
|
+
"aria-labelledby": e.labelId,
|
|
50
|
+
"aria-describedby": e.describedBy,
|
|
51
|
+
children: f
|
|
52
|
+
}) : /* @__PURE__ */ l("div", {
|
|
53
|
+
...p,
|
|
54
|
+
children: f
|
|
49
55
|
});
|
|
50
56
|
}
|
|
51
57
|
export {
|
|
52
|
-
|
|
58
|
+
q as Field
|
|
53
59
|
};
|
|
54
60
|
|
|
55
61
|
//# sourceMappingURL=Field.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.js","names":["_Fragment","useField","Fragment","jsx","jsxs","Field","label","description","error","required","size","group","labelHidden","id","className","style","children","field","body","props"],"sources":["../../../src/components/Field/Field.tsx"],"sourcesContent":["import type { CSSProperties, ReactNode } from \"react\";\nimport { type FieldRender, useField } from \"../../foundations/field.js\";\nimport type {
|
|
1
|
+
{"version":3,"file":"Field.js","names":["_Fragment","useField","Fragment","jsx","jsxs","Field","label","description","error","required","size","layout","width","group","labelHidden","id","className","style","children","field","labelClass","split","labelEl","descriptionEl","control","body","props"],"sources":["../../../src/components/Field/Field.tsx"],"sourcesContent":["import type { CSSProperties, ReactNode } from \"react\";\nimport { type FieldRender, useField } from \"../../foundations/field.js\";\nimport type { DenseSize } from \"../../tokens/schema.js\";\n\nexport interface FieldTokens {\n /** Border colour of every field's box (TextField, HotkeyField), under each control's own token. Default --cy-color-line. */\n controlBorder: string;\n /** Background of every field's box (TextField, HotkeyField), under each control's own token. Default --cy-color-surface. */\n controlBg: string;\n /** Corner radius of every field's box (TextField, HotkeyField). Default the control height times the radius factor. */\n controlRadius: string;\n /** Sunken fill of a box that cannot be edited: a read-only TextField, a disabled HotkeyField. Default --cy-color-soft. */\n controlSunkenBg: string;\n /** Narrowest the label and description get in the split layout before the control moves under them. Default 192px. */\n splitTextMin: string;\n /** Width of the control at `width=\"lg\"`. Default 384px. */\n controlWidthLg: string;\n /** Width of the control at `width=\"md\"`. Default 256px. */\n controlWidthMd: string;\n /** Width of the control at `width=\"sm\"`. Default 160px. */\n controlWidthSm: string;\n gap: string;\n labelWeight: string;\n labelColor: string;\n descriptionColor: string;\n errorColor: string;\n requiredColor: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n field: FieldTokens;\n }\n}\n\n/** Width of a Field's control: three steps from the `--cy-field-control-width-*` tokens, or the whole field. */\nexport type FieldWidth = \"sm\" | \"md\" | \"lg\" | \"full\";\n\n/** How a Field lays out its label and control. Every control built on Field takes these and passes them on. */\nexport interface FieldLayoutProps {\n /**\n * `stack` puts the label above the control and the description and error below it. `split` puts the label and\n * description at the start and the control at the end of one row (a settings row); when the field is too narrow for\n * both, the control moves under the text. Default \"stack\".\n */\n layout?: \"stack\" | \"split\" | undefined;\n /**\n * Width of the control, so the controls of a column of fields line up: \"sm\", \"md\" and \"lg\" are the\n * `--cy-field-control-width-*` tokens (never wider than the field), \"full\" is the whole field. Default: the control's\n * own width (the whole field in the stacked layout for TextField and the other fields).\n */\n width?: FieldWidth | undefined;\n}\n\nexport interface FieldProps extends FieldLayoutProps {\n /** Visible label; it names the control. */\n label: ReactNode;\n /** Help text shown below the control and read out with it. */\n description?: ReactNode | undefined;\n /** Shown below the control, announced, and marks the control invalid. */\n error?: ReactNode | undefined;\n /** Draws the required marker; pass `required` to the control too. */\n required?: boolean | undefined;\n /** Size of the label text, matching the control's size (an `xs` control has the `sm` label). Default \"md\". */\n size?: DenseSize | undefined;\n /** Keep the label for assistive tech but take no space (toolbars, dense rows). Prefer visible labels. */\n labelHidden?: boolean | undefined;\n /** Label a group of controls (radio groups) instead of one control. */\n group?: boolean | undefined;\n /** Id for the control; the label, description and error ids are built from it. Default: a generated id. */\n id?: string | undefined;\n /** Added to the root element, for layout. */\n className?: string | undefined;\n /** Layout only. */\n style?: CSSProperties | undefined;\n /** Renders the control from the ids and state in `field`. */\n children: (field: FieldRender) => ReactNode;\n}\n\n/** Label, description and error wiring for any control. Controls render through `children(field)`. */\nexport function Field({\n label,\n description,\n error,\n required,\n size = \"md\",\n layout = \"stack\",\n width,\n group,\n labelHidden,\n id,\n className,\n style,\n children,\n}: FieldProps) {\n const field = useField({ id, description, error });\n // A hidden label stays in the accessibility tree; out of the flow, the grid gap collapses with it.\n const labelClass = labelHidden ? \"cy-field-label cy-visually-hidden\" : \"cy-field-label\";\n const split = layout === \"split\";\n const labelEl = group ? (\n <span id={field.labelId} className={labelClass} data-required={required ? \"\" : undefined}>\n {label}\n </span>\n ) : (\n <label\n id={field.labelId}\n htmlFor={field.id}\n className={labelClass}\n data-required={required ? \"\" : undefined}\n >\n {label}\n </label>\n );\n const descriptionEl = description && (\n <span id={field.descriptionId} className=\"cy-field-description\">\n {description}\n </span>\n );\n // The control is wrapped only when the layout or a width needs a box of its own; otherwise it stays a direct child.\n const control =\n split || width ? (\n <div className=\"cy-field-control cy-reset\" data-width={width}>\n {children(field)}\n </div>\n ) : (\n children(field)\n );\n const body = (\n <>\n {split ? (\n <div className=\"cy-field-text cy-reset\">\n {labelEl}\n {descriptionEl}\n </div>\n ) : (\n labelEl\n )}\n {control}\n {!split && descriptionEl}\n {field.invalid && (\n <span id={field.errorId} className=\"cy-field-error\" role=\"alert\">\n {error}\n </span>\n )}\n </>\n );\n const props = {\n className: `cy-field${className ? ` ${className}` : \"\"}`,\n \"data-size\": size,\n \"data-layout\": split ? \"split\" : undefined,\n style,\n };\n return group ? (\n <fieldset {...props} aria-labelledby={field.labelId} aria-describedby={field.describedBy}>\n {body}\n </fieldset>\n ) : (\n <div {...props}>{body}</div>\n );\n}\n"],"mappings":";;;AAgFA,SAAgBK,EAAM,EACpB,OAAAC,GACA,aAAAC,GACA,OAAAC,GACA,UAAAC,GACA,MAAAC,IAAO,MACP,QAAAC,IAAS,SACT,OAAAC,GACA,OAAAC,GACA,aAAAC,GACA,IAAAC,GACA,WAAAC,GACA,OAAAC,GACA,UAAAC,EAAA,GACa;AACb,QAAMC,IAAQlB,EAAS;AAAA,IAAE,IAAAc;AAAA,IAAI,aAAAR;AAAA,IAAa,OAAAC;AAAA,EAAM,CAAC,GAE3CY,IAAaN,IAAc,sCAAsC,kBACjEO,IAAQV,MAAW,SACnBW,IAAUT,IACd,gBAAAV,EAAC,QAAD;AAAA,IAAM,IAAIgB,EAAM;AAAA,IAAS,WAAWC;AAAA,IAAY,iBAAeX,IAAW,KAAK;AAAA,IAC5E,UAAAH;AAAA,EACG,CAAA,IAEN,gBAAAH,EAAC,SAAD;AAAA,IACE,IAAIgB,EAAM;AAAA,IACV,SAASA,EAAM;AAAA,IACf,WAAWC;AAAA,IACX,iBAAeX,IAAW,KAAK;AAAA,IAE9B,UAAAH;AAAA,EACI,CAAA,GAEHiB,IAAgBhB,KACpB,gBAAAJ,EAAC,QAAD;AAAA,IAAM,IAAIgB,EAAM;AAAA,IAAe,WAAU;AAAA,IACtC,UAAAZ;AAAA,EACG,CAAA,GAGFiB,IACJH,KAAST,IACP,gBAAAT,EAAC,OAAD;AAAA,IAAK,WAAU;AAAA,IAA4B,cAAYS;AAAA,IACpD,UAAAM,EAASC,CAAK;AAAA,EACZ,CAAA,IAELD,EAASC,CAAK,GAEZM,IACJ,gBAAArB,EAAAJ,GAAA,EAAA,UAAA;AAAA,IACGqB,IACC,gBAAAjB,EAAC,OAAD;AAAA,MAAK,WAAU;AAAA,MAAf,UAAA,CACGkB,GACAC,CACE;AAAA,IAEL,CAAA,IAAAD;AAAA,IAEDE;AAAA,IACA,CAACH,KAASE;AAAA,IACVJ,EAAM,WACL,gBAAAhB,EAAC,QAAD;AAAA,MAAM,IAAIgB,EAAM;AAAA,MAAS,WAAU;AAAA,MAAiB,MAAK;AAAA,MACtD,UAAAX;AAAA,IACG,CAAA;AAAA,EAER,EAAA,CAAA,GAEEkB,IAAQ;AAAA,IACZ,WAAW,WAAWV,IAAY,IAAIA,CAAA,KAAc,EAAA;AAAA,IACpD,aAAaN;AAAA,IACb,eAAeW,IAAQ,UAAU;AAAA,IACjC,OAAAJ;AAAA,EACF;AACA,SAAOJ,IACL,gBAAAV,EAAC,YAAD;AAAA,IAAU,GAAIuB;AAAA,IAAO,mBAAiBP,EAAM;AAAA,IAAS,oBAAkBA,EAAM;AAAA,IAC1E,UAAAM;AAAA,EACO,CAAA,IAEV,gBAAAtB,EAAC,OAAD;AAAA,IAAK,GAAIuB;AAAA,IAAQ,UAAAD;AAAA,EAAU,CAAA;AAE/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Field, type FieldProps, type FieldTokens } from "./Field.js";
|
|
1
|
+
export { Field, type FieldLayoutProps, type FieldProps, type FieldTokens, type FieldWidth } from "./Field.js";
|
|
@@ -7,6 +7,8 @@ export interface FileDropTokens {
|
|
|
7
7
|
activeBackground: string;
|
|
8
8
|
/** Behind the whole-window overlay (`target="window"`). */
|
|
9
9
|
overlayBackground: string;
|
|
10
|
+
/** Background of a chosen file's row (`value`). */
|
|
11
|
+
fileBackground: string;
|
|
10
12
|
}
|
|
11
13
|
declare module "../../tokens/schema.js" {
|
|
12
14
|
interface ComponentTokens {
|
|
@@ -29,10 +31,33 @@ export interface FileDropLabels {
|
|
|
29
31
|
added: (count: number) => string;
|
|
30
32
|
/** Why a file was turned away. */
|
|
31
33
|
rejected: (rejection: FileRejection) => string;
|
|
34
|
+
/** Name of the list of chosen files (`value`). Default: "Chosen files". */
|
|
35
|
+
files: string;
|
|
36
|
+
/** A chosen file's remove button. Default: "Remove report.pdf". */
|
|
37
|
+
remove: (name: string) => string;
|
|
38
|
+
/** Announced after a chosen file is removed. Default: "report.pdf removed". */
|
|
39
|
+
removed: (name: string) => string;
|
|
32
40
|
}
|
|
33
41
|
export interface FileDropProps {
|
|
34
42
|
/** Called with the files that passed the checks. */
|
|
35
43
|
onFiles?: (files: File[]) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Replaces the browser's file dialog with your picker (Electron's `dialog.showOpenDialog` over IPC), as PathField's
|
|
46
|
+
* `onPick`: the button calls it and is busy until it settles. It resolves with what was chosen, or null when it was
|
|
47
|
+
* cancelled; a cancel or a failure (the promise rejects) changes nothing. Chosen files are checked as dropped ones
|
|
48
|
+
* are and arrive in `onFiles`, chosen paths in `onPaths`. Dropped files still arrive in `onFiles`.
|
|
49
|
+
*/
|
|
50
|
+
onPick?: (() => Promise<readonly (File | string)[] | null>) | undefined;
|
|
51
|
+
/** Called with the paths `onPick` chose (strings, as your picker gave them); put them in `value` to list them. */
|
|
52
|
+
onPaths?: ((paths: string[]) => void) | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* The chosen files or paths, listed in the zone by name (a File's `name`, a path as given), each with a remove
|
|
55
|
+
* button when `onRemove` is set. Controlled: add to it from `onFiles` or your own picker. Display only: the native
|
|
56
|
+
* input (and so a form) holds only files picked or dropped here.
|
|
57
|
+
*/
|
|
58
|
+
value?: readonly (File | string)[] | undefined;
|
|
59
|
+
/** Called with a chosen item and its index when its remove button is pressed; take it out of `value`. */
|
|
60
|
+
onRemove?: ((item: File | string, index: number) => void) | undefined;
|
|
36
61
|
/** Called with the files that did not, and why (they are also listed in the zone). */
|
|
37
62
|
onReject?: (rejections: FileRejection[]) => void;
|
|
38
63
|
/** File types, as for `<input accept>`: ".pdf,image/*". */
|
|
@@ -73,4 +98,4 @@ export declare function acceptsFile(file: File, accept: string | undefined): boo
|
|
|
73
98
|
* A place to add files: drop them on it, or press its button to pick them. Checks type, size and count, explains
|
|
74
99
|
* what it turned away, and puts the accepted files into a native file input so forms submit them.
|
|
75
100
|
*/
|
|
76
|
-
export declare function FileDrop({ onFiles, onReject, accept, multiple, maxSize, maxFiles, hint, target, name, form, required, disabled, size, labels, className, style, }: FileDropProps): import("react").JSX.Element;
|
|
101
|
+
export declare function FileDrop({ onFiles, onPick, onPaths, value, onRemove, onReject, accept, multiple, maxSize, maxFiles, hint, target, name, form, required, disabled, size, labels, className, style, }: FileDropProps): import("react").JSX.Element;
|