@arshad-shah/cynosure 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/adapters/astro/index.d.ts +52 -0
- package/dist/adapters/astro/index.js +27 -0
- package/dist/adapters/astro/index.js.map +1 -0
- package/dist/adapters/vite/index.d.ts +11 -0
- package/dist/adapters/vite/index.js +33 -12
- package/dist/adapters/vite/index.js.map +1 -1
- package/dist/brands/googleplay.d.ts +2 -0
- package/dist/brands/googleplay.js +17 -0
- package/dist/brands/googleplay.js.map +1 -0
- package/dist/brands/index.d.ts +1 -0
- package/dist/brands/index.js +132 -130
- package/dist/components/Accordion/Accordion.d.ts +14 -0
- package/dist/components/Accordion/Accordion.js.map +1 -1
- package/dist/components/Announcer/Announcer.d.ts +1 -0
- package/dist/components/Announcer/Announcer.js +5 -5
- package/dist/components/Announcer/Announcer.js.map +1 -1
- package/dist/components/AppShell/AppShell.d.ts +22 -1
- package/dist/components/AppShell/AppShell.js +92 -83
- package/dist/components/AppShell/AppShell.js.map +1 -1
- package/dist/components/AppShell/index.d.ts +1 -1
- package/dist/components/AspectRatio/AspectRatio.d.ts +29 -0
- package/dist/components/AspectRatio/AspectRatio.js +21 -0
- package/dist/components/AspectRatio/AspectRatio.js.map +1 -0
- package/dist/components/AspectRatio/index.d.ts +1 -0
- package/dist/components/Avatar/Avatar.d.ts +96 -0
- package/dist/components/Avatar/Avatar.js +90 -0
- package/dist/components/Avatar/Avatar.js.map +1 -0
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Badge/Badge.d.ts +6 -0
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +55 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +85 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js.map +1 -0
- package/dist/components/Breadcrumbs/index.d.ts +1 -0
- package/dist/components/Button/Button.d.ts +27 -2
- package/dist/components/Button/Button.js +62 -53
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Calendar/Calendar.d.ts +65 -7
- package/dist/components/Calendar/Calendar.js +209 -97
- package/dist/components/Calendar/Calendar.js.map +1 -1
- package/dist/components/Calendar/dates.d.ts +4 -0
- package/dist/components/Calendar/dates.js +41 -27
- package/dist/components/Calendar/dates.js.map +1 -1
- package/dist/components/Calendar/index.d.ts +1 -1
- package/dist/components/Card/Card.d.ts +35 -1
- package/dist/components/Card/Card.js +48 -36
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Card/index.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +11 -4
- package/dist/components/Checkbox/Checkbox.js +33 -7
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Checklist/Checklist.d.ts +65 -0
- package/dist/components/Checklist/Checklist.js +163 -0
- package/dist/components/Checklist/Checklist.js.map +1 -0
- package/dist/components/Checklist/index.d.ts +1 -0
- package/dist/components/Choice/Choice.d.ts +73 -0
- package/dist/components/Choice/Choice.js +41 -0
- package/dist/components/Choice/Choice.js.map +1 -0
- package/dist/components/Choice/index.d.ts +1 -0
- package/dist/components/CodeBlock/CodeBlock.d.ts +5 -0
- package/dist/components/CodeBlock/CodeBlock.js.map +1 -1
- package/dist/components/ColorField/ColorField.d.ts +12 -0
- package/dist/components/ColorField/ColorField.js +199 -208
- package/dist/components/ColorField/ColorField.js.map +1 -1
- package/dist/components/ColorSwatches/ColorSwatches.d.ts +5 -0
- package/dist/components/ColorSwatches/ColorSwatches.js +6 -6
- package/dist/components/ColorSwatches/ColorSwatches.js.map +1 -1
- package/dist/components/Combobox/Combobox.d.ts +20 -1
- package/dist/components/Combobox/Combobox.js +86 -111
- package/dist/components/Combobox/Combobox.js.map +1 -1
- package/dist/components/CommandPalette/CommandPalette.d.ts +9 -0
- package/dist/components/CommandPalette/CommandPalette.js +10 -10
- package/dist/components/CommandPalette/CommandPalette.js.map +1 -1
- package/dist/components/CompareSlider/CompareSlider.d.ts +4 -0
- package/dist/components/CompareSlider/CompareSlider.js +4 -4
- package/dist/components/CompareSlider/CompareSlider.js.map +1 -1
- package/dist/components/Container/Container.d.ts +44 -0
- package/dist/components/Container/Container.js +28 -0
- package/dist/components/Container/Container.js.map +1 -0
- package/dist/components/Container/index.d.ts +1 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +11 -0
- package/dist/components/ContextMenu/ContextMenu.js.map +1 -1
- package/dist/components/CopyButton/CopyButton.d.ts +8 -0
- package/dist/components/CopyButton/CopyButton.js +29 -28
- package/dist/components/CopyButton/CopyButton.js.map +1 -1
- package/dist/components/DateField/DateField.d.ts +17 -0
- package/dist/components/DateField/DateField.js +6 -6
- package/dist/components/DateField/DateField.js.map +1 -1
- package/dist/components/DescriptionList/DescriptionList.d.ts +3 -0
- package/dist/components/DescriptionList/DescriptionList.js.map +1 -1
- package/dist/components/DeviceFrame/DeviceFrame.d.ts +63 -0
- package/dist/components/DeviceFrame/DeviceFrame.js +54 -0
- package/dist/components/DeviceFrame/DeviceFrame.js.map +1 -0
- package/dist/components/DeviceFrame/index.d.ts +1 -0
- package/dist/components/Dialog/Dialog.d.ts +25 -2
- package/dist/components/Dialog/Dialog.js +89 -72
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Disclosure/Disclosure.d.ts +7 -0
- package/dist/components/Disclosure/Disclosure.js.map +1 -1
- package/dist/components/Divider/Divider.d.ts +59 -0
- package/dist/components/Divider/Divider.js +32 -0
- package/dist/components/Divider/Divider.js.map +1 -0
- package/dist/components/Divider/index.d.ts +1 -0
- package/dist/components/DocumentViewport/DocumentViewport.d.ts +8 -0
- package/dist/components/DocumentViewport/DocumentViewport.js.map +1 -1
- package/dist/components/EmptyState/EmptyState.d.ts +8 -2
- package/dist/components/EmptyState/EmptyState.js.map +1 -1
- package/dist/components/Field/Field.d.ts +6 -0
- package/dist/components/Field/Field.js +31 -33
- package/dist/components/Field/Field.js.map +1 -1
- package/dist/components/FileDrop/FileDrop.d.ts +8 -0
- package/dist/components/FileDrop/FileDrop.js +14 -14
- package/dist/components/FileDrop/FileDrop.js.map +1 -1
- package/dist/components/FloatingToolbar/FloatingToolbar.d.ts +4 -0
- package/dist/components/FloatingToolbar/FloatingToolbar.js +11 -10
- package/dist/components/FloatingToolbar/FloatingToolbar.js.map +1 -1
- package/dist/components/Grid/Grid.d.ts +57 -10
- package/dist/components/Grid/Grid.js +71 -28
- package/dist/components/Grid/Grid.js.map +1 -1
- package/dist/components/Grid/index.d.ts +1 -1
- package/dist/components/Heading/Heading.d.ts +59 -0
- package/dist/components/Heading/Heading.js +33 -0
- package/dist/components/Heading/Heading.js.map +1 -0
- package/dist/components/Heading/index.d.ts +1 -0
- package/dist/components/HoverCard/HoverCard.d.ts +1 -0
- package/dist/components/HoverCard/HoverCard.js.map +1 -1
- package/dist/components/IconButton/IconButton.d.ts +17 -1
- package/dist/components/IconButton/IconButton.js +14 -10
- package/dist/components/IconButton/IconButton.js.map +1 -1
- package/dist/components/IconTile/IconTile.d.ts +45 -0
- package/dist/components/IconTile/IconTile.js +25 -0
- package/dist/components/IconTile/IconTile.js.map +1 -0
- package/dist/components/IconTile/index.d.ts +1 -0
- package/dist/components/Image/Image.d.ts +62 -0
- package/dist/components/Image/Image.js +75 -0
- package/dist/components/Image/Image.js.map +1 -0
- package/dist/components/Image/index.d.ts +1 -0
- package/dist/components/Inline/Inline.d.ts +8 -4
- package/dist/components/Inline/Inline.js +12 -16
- package/dist/components/Inline/Inline.js.map +1 -1
- package/dist/components/Kbd/Kbd.d.ts +2 -0
- package/dist/components/Kbd/Kbd.js.map +1 -1
- package/dist/components/KeyValueEditor/KeyValueEditor.d.ts +7 -0
- package/dist/components/KeyValueEditor/KeyValueEditor.js +43 -42
- package/dist/components/KeyValueEditor/KeyValueEditor.js.map +1 -1
- package/dist/components/Link/Link.d.ts +16 -1
- package/dist/components/Link/Link.js +20 -18
- package/dist/components/Link/Link.js.map +1 -1
- package/dist/components/List/List.d.ts +73 -0
- package/dist/components/List/List.js +64 -0
- package/dist/components/List/List.js.map +1 -0
- package/dist/components/List/index.d.ts +1 -0
- package/dist/components/LoadingDots/LoadingDots.d.ts +2 -0
- package/dist/components/LoadingDots/LoadingDots.js.map +1 -1
- package/dist/components/Menu/Menu.d.ts +13 -1
- package/dist/components/Menu/Menu.js +37 -35
- package/dist/components/Menu/Menu.js.map +1 -1
- package/dist/components/Notice/Notice.d.ts +5 -0
- package/dist/components/Notice/Notice.js +12 -11
- package/dist/components/Notice/Notice.js.map +1 -1
- package/dist/components/NumberField/NumberField.d.ts +17 -0
- package/dist/components/NumberField/NumberField.js +8 -8
- package/dist/components/NumberField/NumberField.js.map +1 -1
- package/dist/components/OptionList/OptionList.d.ts +69 -0
- package/dist/components/OptionList/OptionList.js +75 -0
- package/dist/components/OptionList/OptionList.js.map +1 -0
- package/dist/components/OptionList/index.d.ts +1 -0
- package/dist/components/PageHeader/PageHeader.d.ts +67 -0
- package/dist/components/PageHeader/PageHeader.js +63 -0
- package/dist/components/PageHeader/PageHeader.js.map +1 -0
- package/dist/components/PageHeader/index.d.ts +1 -0
- package/dist/components/Pagination/Pagination.d.ts +77 -0
- package/dist/components/Pagination/Pagination.js +121 -0
- package/dist/components/Pagination/Pagination.js.map +1 -0
- package/dist/components/Pagination/index.d.ts +1 -0
- package/dist/components/PanZoomCanvas/PanZoomCanvas.d.ts +4 -0
- package/dist/components/PanZoomCanvas/PanZoomCanvas.js.map +1 -1
- package/dist/components/Popover/Popover.d.ts +10 -0
- package/dist/components/Popover/Popover.js.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.d.ts +5 -0
- package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/components/ProgressOverlay/ProgressOverlay.d.ts +3 -0
- package/dist/components/ProgressOverlay/ProgressOverlay.js.map +1 -1
- package/dist/components/Prose/Prose.d.ts +1 -0
- package/dist/components/Prose/Prose.js.map +1 -1
- package/dist/components/QRCode/QRCode.d.ts +56 -0
- package/dist/components/QRCode/QRCode.js +48 -0
- package/dist/components/QRCode/QRCode.js.map +1 -0
- package/dist/components/QRCode/index.d.ts +1 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +13 -0
- package/dist/components/RadioGroup/RadioGroup.js +32 -24
- package/dist/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/Section/Section.d.ts +57 -0
- package/dist/components/Section/Section.js +27 -0
- package/dist/components/Section/Section.js.map +1 -0
- package/dist/components/Section/index.d.ts +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +9 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +12 -12
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/components/Select/Select.d.ts +18 -1
- package/dist/components/Select/Select.js +107 -125
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/index.d.ts +1 -0
- package/dist/components/SelectionFrame/SelectionFrame.d.ts +6 -0
- package/dist/components/SelectionFrame/SelectionFrame.js.map +1 -1
- package/dist/components/Sheet/Sheet.js +12 -7
- package/dist/components/Sheet/Sheet.js.map +1 -1
- package/dist/components/SideNav/SideNav.d.ts +37 -1
- package/dist/components/SideNav/SideNav.js +103 -74
- package/dist/components/SideNav/SideNav.js.map +1 -1
- package/dist/components/SideNav/index.d.ts +1 -1
- package/dist/components/SignaturePad/SignaturePad.d.ts +3 -0
- package/dist/components/SignaturePad/SignaturePad.js.map +1 -1
- package/dist/components/SiteFooter/SiteFooter.d.ts +66 -0
- package/dist/components/SiteFooter/SiteFooter.js +80 -0
- package/dist/components/SiteFooter/SiteFooter.js.map +1 -0
- package/dist/components/SiteFooter/index.d.ts +1 -0
- package/dist/components/SiteHeader/SiteHeader.d.ts +78 -0
- package/dist/components/SiteHeader/SiteHeader.js +114 -0
- package/dist/components/SiteHeader/SiteHeader.js.map +1 -0
- package/dist/components/SiteHeader/index.d.ts +1 -0
- package/dist/components/Skeleton/Skeleton.d.ts +1 -0
- package/dist/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/SkipLink/SkipLink.d.ts +42 -0
- package/dist/components/SkipLink/SkipLink.js +43 -0
- package/dist/components/SkipLink/SkipLink.js.map +1 -0
- package/dist/components/SkipLink/index.d.ts +1 -0
- package/dist/components/Slider/Slider.d.ts +11 -0
- package/dist/components/Slider/Slider.js +6 -6
- package/dist/components/Slider/Slider.js.map +1 -1
- package/dist/components/SortableList/SortableList.d.ts +6 -0
- package/dist/components/SortableList/SortableList.js +13 -13
- package/dist/components/SortableList/SortableList.js.map +1 -1
- package/dist/components/SplitPane/SplitPane.d.ts +5 -0
- package/dist/components/SplitPane/SplitPane.js +4 -4
- package/dist/components/SplitPane/SplitPane.js.map +1 -1
- package/dist/components/Stack/Stack.d.ts +19 -6
- package/dist/components/Stack/Stack.js +26 -13
- package/dist/components/Stack/Stack.js.map +1 -1
- package/dist/components/Stack/index.d.ts +1 -0
- package/dist/components/Stack/space.d.ts +47 -0
- package/dist/components/Stack/space.js +23 -0
- package/dist/components/Stack/space.js.map +1 -0
- package/dist/components/Stat/Stat.d.ts +88 -0
- package/dist/components/Stat/Stat.js +105 -0
- package/dist/components/Stat/Stat.js.map +1 -0
- package/dist/components/Stat/index.d.ts +1 -0
- package/dist/components/Steps/Steps.d.ts +14 -4
- package/dist/components/Steps/Steps.js +31 -30
- package/dist/components/Steps/Steps.js.map +1 -1
- package/dist/components/Switch/Switch.d.ts +4 -4
- package/dist/components/Switch/Switch.js +18 -7
- package/dist/components/Switch/Switch.js.map +1 -1
- package/dist/components/Table/Table.d.ts +12 -0
- package/dist/components/Table/Table.js +11 -12
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +18 -1
- package/dist/components/Tabs/Tabs.js +74 -73
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/TagInput/TagInput.d.ts +18 -0
- package/dist/components/TagInput/TagInput.js +79 -100
- package/dist/components/TagInput/TagInput.js.map +1 -1
- package/dist/components/Text/Text.d.ts +72 -0
- package/dist/components/Text/Text.js +30 -0
- package/dist/components/Text/Text.js.map +1 -0
- package/dist/components/Text/index.d.ts +1 -0
- package/dist/components/TextArea/TextArea.d.ts +10 -0
- package/dist/components/TextArea/TextArea.js +4 -4
- package/dist/components/TextArea/TextArea.js.map +1 -1
- package/dist/components/TextField/TextField.d.ts +17 -0
- package/dist/components/TextField/TextField.js +28 -27
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/ThemeToggle/ThemeToggle.d.ts +11 -1
- package/dist/components/ThemeToggle/ThemeToggle.js +33 -30
- package/dist/components/ThemeToggle/ThemeToggle.js.map +1 -1
- package/dist/components/TimeField/TimeField.d.ts +62 -8
- package/dist/components/TimeField/TimeField.js +308 -72
- package/dist/components/TimeField/TimeField.js.map +1 -1
- package/dist/components/Toast/Toast.d.ts +25 -1
- package/dist/components/Toast/Toast.js +137 -126
- package/dist/components/Toast/Toast.js.map +1 -1
- package/dist/components/Toast/index.d.ts +1 -1
- package/dist/components/Toolbar/Toolbar.d.ts +3 -0
- package/dist/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +7 -1
- package/dist/components/Tooltip/Tooltip.js +19 -19
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/Tree/Tree.d.ts +8 -0
- package/dist/components/Tree/Tree.js.map +1 -1
- package/dist/components/VirtualList/VirtualList.d.ts +8 -0
- package/dist/components/VirtualList/VirtualList.js +4 -4
- package/dist/components/VirtualList/VirtualList.js.map +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +24 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.js +17 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.js.map +1 -0
- package/dist/components/VisuallyHidden/index.d.ts +1 -0
- package/dist/components/ZoomControls/ZoomControls.d.ts +4 -0
- package/dist/components/ZoomControls/ZoomControls.js.map +1 -1
- package/dist/foundations/ChoiceBase/ChoiceBase.d.ts +1 -0
- package/dist/foundations/ChoiceBase/ChoiceBase.js +8 -8
- package/dist/foundations/ChoiceBase/ChoiceBase.js.map +1 -1
- package/dist/foundations/HiddenValue/HiddenValue.d.ts +3 -0
- package/dist/foundations/HiddenValue/HiddenValue.js +5 -5
- package/dist/foundations/HiddenValue/HiddenValue.js.map +1 -1
- package/dist/foundations/Icon/Icon.d.ts +9 -1
- package/dist/foundations/Icon/Icon.js +15 -14
- package/dist/foundations/Icon/Icon.js.map +1 -1
- package/dist/foundations/image-outcome.d.ts +20 -0
- package/dist/foundations/image-outcome.js +43 -0
- package/dist/foundations/image-outcome.js.map +1 -0
- package/dist/foundations/option-icon.d.ts +26 -0
- package/dist/foundations/option-icon.js +16 -0
- package/dist/foundations/option-icon.js.map +1 -0
- package/dist/foundations/printing.d.ts +6 -0
- package/dist/foundations/printing.js +17 -0
- package/dist/foundations/printing.js.map +1 -0
- package/dist/foundations/qr.d.ts +42 -0
- package/dist/foundations/qr.js +246 -0
- package/dist/foundations/qr.js.map +1 -0
- package/dist/icons/book-marked.d.ts +2 -0
- package/dist/icons/book-marked.js +14 -0
- package/dist/icons/book-marked.js.map +1 -0
- package/dist/icons/calendar-days.d.ts +2 -0
- package/dist/icons/calendar-days.js +24 -0
- package/dist/icons/calendar-days.js.map +1 -0
- package/dist/icons/check-square.d.ts +2 -0
- package/dist/icons/check-square.js +14 -0
- package/dist/icons/check-square.js.map +1 -0
- package/dist/icons/crescent.d.ts +2 -0
- package/dist/icons/crescent.js +14 -0
- package/dist/icons/crescent.js.map +1 -0
- package/dist/icons/index.d.ts +11 -0
- package/dist/icons/index.js +502 -480
- package/dist/icons/kaaba.d.ts +2 -0
- package/dist/icons/kaaba.js +14 -0
- package/dist/icons/kaaba.js.map +1 -0
- package/dist/icons/keywords.d.ts +259 -0
- package/dist/icons/keywords.js +1816 -0
- package/dist/icons/keywords.js.map +1 -0
- package/dist/icons/list-tree.d.ts +2 -0
- package/dist/icons/list-tree.js +14 -0
- package/dist/icons/list-tree.js.map +1 -0
- package/dist/icons/mosque.d.ts +2 -0
- package/dist/icons/mosque.js +14 -0
- package/dist/icons/mosque.js.map +1 -0
- package/dist/icons/prayer-beads.d.ts +2 -0
- package/dist/icons/prayer-beads.js +67 -0
- package/dist/icons/prayer-beads.js.map +1 -0
- package/dist/icons/qr-code.d.ts +2 -0
- package/dist/icons/qr-code.js +38 -0
- package/dist/icons/qr-code.js.map +1 -0
- package/dist/icons/refresh-cw.d.ts +2 -0
- package/dist/icons/refresh-cw.js +14 -0
- package/dist/icons/refresh-cw.js.map +1 -0
- package/dist/icons/types.d.ts +1 -1
- package/dist/icons/types.js +2 -1
- package/dist/icons/types.js.map +1 -1
- package/dist/index.d.ts +35 -10
- package/dist/index.js +280 -220
- package/dist/styles/announcer.css +1 -1
- package/dist/styles/app-shell.css +1 -1
- package/dist/styles/aspect-ratio.css +1 -0
- package/dist/styles/avatar.css +1 -0
- package/dist/styles/base.css +1 -1
- package/dist/styles/breadcrumbs.css +1 -0
- package/dist/styles/button.css +1 -1
- package/dist/styles/calendar.css +1 -1
- package/dist/styles/card.css +1 -1
- package/dist/styles/checkbox.css +1 -1
- package/dist/styles/checklist.css +1 -0
- package/dist/styles/choice-base.css +1 -0
- package/dist/styles/choice.css +1 -1
- package/dist/styles/color-field.css +1 -1
- package/dist/styles/combobox.css +1 -1
- package/dist/styles/container.css +1 -0
- package/dist/styles/copy-button.css +1 -1
- package/dist/styles/date-field.css +1 -1
- package/dist/styles/device-frame.css +1 -0
- package/dist/styles/dialog.css +1 -1
- package/dist/styles/disclosure.css +1 -1
- package/dist/styles/divider.css +1 -0
- package/dist/styles/field.css +1 -1
- package/dist/styles/file-drop.css +1 -1
- package/dist/styles/floating-toolbar.css +1 -1
- package/dist/styles/generated-css.d.ts +1 -1
- package/dist/styles/generated-css.js +1 -1
- package/dist/styles/generated-css.js.map +1 -1
- package/dist/styles/grid.css +1 -1
- package/dist/styles/heading.css +1 -0
- package/dist/styles/icon-tile.css +1 -0
- package/dist/styles/icon.css +1 -1
- package/dist/styles/image.css +1 -0
- package/dist/styles/inline.css +1 -0
- package/dist/styles/key-value-editor.css +1 -1
- package/dist/styles/link.css +1 -1
- package/dist/styles/list.css +1 -0
- package/dist/styles/manifest.json +715 -0
- package/dist/styles/menu.css +1 -1
- package/dist/styles/notice.css +1 -1
- package/dist/styles/number-field.css +1 -1
- package/dist/styles/option-list.css +1 -0
- package/dist/styles/page-header.css +1 -0
- package/dist/styles/pagination.css +1 -0
- package/dist/styles/qr-code.css +1 -0
- package/dist/styles/radio-group.css +1 -1
- package/dist/styles/section.css +1 -0
- package/dist/styles/segmented-control.css +1 -1
- package/dist/styles/select.css +1 -1
- package/dist/styles/sheet.css +1 -1
- package/dist/styles/side-nav.css +1 -1
- package/dist/styles/site-footer.css +1 -0
- package/dist/styles/site-header.css +1 -0
- package/dist/styles/skip-link.css +1 -0
- package/dist/styles/sortable-list.css +1 -1
- package/dist/styles/stack.css +1 -1
- package/dist/styles/stat.css +1 -0
- package/dist/styles/steps.css +1 -1
- package/dist/styles/switch.css +1 -0
- package/dist/styles/table.css +1 -1
- package/dist/styles/tabs.css +1 -1
- package/dist/styles/tag-input.css +1 -1
- package/dist/styles/text-field.css +1 -1
- package/dist/styles/text.css +1 -0
- package/dist/styles/time-field.css +1 -1
- package/dist/styles/toast.css +1 -1
- package/dist/styles/visually-hidden.css +1 -0
- package/dist/styles.css +1 -1
- package/dist/theme/CynosureTheme.d.ts +4 -0
- package/dist/theme/CynosureTheme.js.map +1 -1
- package/dist/tokens/create-theme.js +137 -108
- package/dist/tokens/create-theme.js.map +1 -1
- package/dist/tokens/to-css.js +12 -12
- package/dist/tokens/to-css.js.map +1 -1
- package/package.json +8 -3
- package/dist/components/Checkbox/ChoiceRow.d.ts +0 -23
- package/dist/components/Checkbox/ChoiceRow.js +0 -57
- package/dist/components/Checkbox/ChoiceRow.js.map +0 -1
- package/dist/styles/hidden-value.css +0 -1
- package/dist/styles/iconbutton.css +0 -1
- package/dist/styles/search-field.css +0 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { forwardRef as x } from "react";
|
|
3
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
4
|
+
var p = [
|
|
5
|
+
"2xl",
|
|
6
|
+
"xl",
|
|
7
|
+
"lg",
|
|
8
|
+
"md",
|
|
9
|
+
"sm",
|
|
10
|
+
"xs"
|
|
11
|
+
], _ = x(function({ level: i = 2, size: t, tone: r = "neutral", weight: d = "bold", align: l, truncate: a = !1, id: s, className: n, style: o, children: f }, g) {
|
|
12
|
+
const m = `h${i}`, e = typeof a == "number" && a > 0 ? Math.floor(a) : 0;
|
|
13
|
+
return /* @__PURE__ */ h(m, {
|
|
14
|
+
ref: g,
|
|
15
|
+
id: s,
|
|
16
|
+
className: `cy-heading${n ? ` ${n}` : ""}`,
|
|
17
|
+
"data-size": t ?? p[i - 1],
|
|
18
|
+
"data-tone": r,
|
|
19
|
+
"data-weight": d,
|
|
20
|
+
"data-align": l,
|
|
21
|
+
"data-truncate": e ? "lines" : a === !0 ? "line" : void 0,
|
|
22
|
+
style: e ? {
|
|
23
|
+
"--_lines": e,
|
|
24
|
+
...o
|
|
25
|
+
} : o,
|
|
26
|
+
children: f
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
export {
|
|
30
|
+
_ as Heading
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=Heading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Heading.js","names":["forwardRef","jsx","SIZE_BY_LEVEL","Heading","level","size","tone","weight","align","truncate","id","className","style","children","ref","Tag","lines"],"sources":["../../../src/components/Heading/Heading.tsx"],"sourcesContent":["import { type CSSProperties, forwardRef, type ReactNode } from \"react\";\n\nexport interface HeadingTokens {\n /** Font size of `size=\"xs\"` (the default for level 6). */\n sizeXs: string;\n /** Font size of `size=\"sm\"` (the default for level 5). */\n sizeSm: string;\n /** Font size of `size=\"md\"` (the default for level 4). */\n sizeMd: string;\n /** Font size of `size=\"lg\"` (the default for level 3). */\n sizeLg: string;\n /** Font size of `size=\"xl\"` (the default for level 2). */\n sizeXl: string;\n /** Font size of `size=\"2xl\"` (the default for level 1). */\n \"size-2xl\": string;\n /** Font size of `size=\"3xl\"`, between 2xl and display: a section page's title, fixed at 1.4 times 2xl. */\n \"size-3xl\": string;\n /** Font size of `size=\"display\"`, a page's hero title. Grows with the viewport between 1.25 and 2 times 2xl. */\n sizeDisplay: string;\n /** Font family. Falls back to the display font. */\n fontFamily: string;\n /** Weight of bold headings (the default weight). */\n fontWeight: string;\n /** Line height, as a number. Tighter than body text. */\n lineHeight: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n heading: HeadingTokens;\n }\n}\n\nexport type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\nexport type HeadingSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\" | \"3xl\" | \"display\";\n\nexport interface HeadingProps {\n /** The element rendered (`h1` to `h6`) and so the heading's place in the page outline. Default 2. */\n level?: HeadingLevel;\n /**\n * How large it looks, whatever its level. Defaults to the level's size: 1 is \"2xl\", 2 is \"xl\", 3 is \"lg\",\n * 4 is \"md\", 5 is \"sm\" and 6 is \"xs\". \"3xl\" is 1.4 times \"2xl\" at every width; \"display\" is larger still and grows with the viewport, for a page's hero title.\n */\n size?: HeadingSize;\n /** Text colour: the ink colour, muted, the accent, or whatever the parent uses. Default \"neutral\". */\n tone?: \"inherit\" | \"neutral\" | \"muted\" | \"accent\";\n /** Font weight. Default \"bold\". */\n weight?: \"medium\" | \"bold\";\n /** Text alignment, RTL aware. Left unset, it follows the parent. */\n align?: \"start\" | \"center\" | \"end\";\n /** `true` keeps it on one line and ends it with an ellipsis; a number cuts it after that many lines. Default false. */\n truncate?: boolean | number;\n /** Set on the heading element, for `aria-labelledby` and links to the section. */\n id?: string;\n /** Added to the heading element, for layout. */\n className?: string;\n /** Layout only. Restyle through `--cy-heading-*` tokens. */\n style?: CSSProperties;\n /** The heading's text. */\n children?: ReactNode;\n}\n\nconst SIZE_BY_LEVEL = [\"2xl\", \"xl\", \"lg\", \"md\", \"sm\", \"xs\"] as const;\n\n/** A section or page heading. `level` sets the element, `size` sets the look, so the outline stays correct. */\nexport const Heading = forwardRef<HTMLHeadingElement, HeadingProps>(function Heading(\n {\n level = 2,\n size,\n tone = \"neutral\",\n weight = \"bold\",\n align,\n truncate = false,\n id,\n className,\n style,\n children,\n },\n ref,\n) {\n const Tag = `h${level}` as \"h1\";\n const lines = typeof truncate === \"number\" && truncate > 0 ? Math.floor(truncate) : 0;\n return (\n <Tag\n ref={ref}\n id={id}\n className={`cy-heading${className ? ` ${className}` : \"\"}`}\n data-size={size ?? SIZE_BY_LEVEL[level - 1]}\n data-tone={tone}\n data-weight={weight}\n data-align={align}\n data-truncate={lines ? \"lines\" : truncate === true ? \"line\" : undefined}\n style={lines ? ({ \"--_lines\": lines, ...style } as CSSProperties) : style}\n >\n {children}\n </Tag>\n );\n});\n"],"mappings":";;;AA8DA,IAAME,IAAgB;AAAA,EAAC;AAAA,EAAO;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAA,EAAM;AAAI,GAG7CC,IAAUH,EAA6C,SAClE,EACE,OAAAI,IAAQ,GACR,MAAAC,GACA,MAAAC,IAAO,WACP,QAAAC,IAAS,QACT,OAAAC,GACA,UAAAC,IAAW,IACX,IAAAC,GACA,WAAAC,GACA,OAAAC,GACA,UAAAC,EAAA,GAEFC,GACA;AACA,QAAMC,IAAM,IAAIX,CAAA,IACVY,IAAQ,OAAOP,KAAa,YAAYA,IAAW,IAAI,KAAK,MAAMA,CAAQ,IAAI;AACpF,SACE,gBAAAR,EAACc,GAAD;AAAA,IACO,KAAAD;AAAA,IACD,IAAAJ;AAAA,IACJ,WAAW,aAAaC,IAAY,IAAIA,CAAA,KAAc,EAAA;AAAA,IACtD,aAAWN,KAAQH,EAAcE,IAAQ,CAAA;AAAA,IACzC,aAAWE;AAAA,IACX,eAAaC;AAAA,IACb,cAAYC;AAAA,IACZ,iBAAeQ,IAAQ,UAAUP,MAAa,KAAO,SAAS;AAAA,IAC9D,OAAOO,IAAS;AAAA,MAAE,YAAYA;AAAA,MAAO,GAAGJ;AAAA,IAAM,IAAsBA;AAAA,IAEnE,UAAAC;AAAA,EACE,CAAA;AAET,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Heading, type HeadingLevel, type HeadingProps, type HeadingSize, type HeadingTokens, } from "./Heading.js";
|
|
@@ -25,6 +25,7 @@ export interface HoverCardProps {
|
|
|
25
25
|
placement?: Placement;
|
|
26
26
|
/** The preview (a larger thumbnail, a summary). Nothing in it can be clicked or focused. */
|
|
27
27
|
children?: ReactNode;
|
|
28
|
+
/** Added to the root element, for layout. */
|
|
28
29
|
className?: string;
|
|
29
30
|
/** Layout only. Restyle through --cy-hover-card-* tokens. */
|
|
30
31
|
style?: CSSProperties;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HoverCard.js","names":["useFloatingAnchor","useFloatingOffset","usePopover","useAnchoredPosition","useRef","jsx","HoverCard","open","anchor","placement","children","className","style","card","target","shown","offset"],"sources":["../../../src/components/HoverCard/HoverCard.tsx"],"sourcesContent":["import { type CSSProperties, type ReactNode, useRef } from \"react\";\nimport {\n type FloatingAnchor,\n type PopoverEl,\n useFloatingAnchor,\n useFloatingOffset,\n usePopover,\n} from \"../../overlay/floating.js\";\nimport type { Placement } from \"../../overlay/position.js\";\nimport { useAnchoredPosition } from \"../../overlay/use-anchored-position.js\";\n\nexport interface HoverCardTokens {\n /** Background of the card. */\n background: string;\n /** Corner radius. */\n radius: string;\n /** Inner padding. */\n padding: string;\n /** Gap between the card and its anchor. */\n offset: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n hoverCard: HoverCardTokens;\n }\n}\n\nexport interface HoverCardProps {\n /** Show it. The owner decides when: a hovered row, a focused thumbnail. */\n open: boolean;\n /** What it previews: a ref to an element, or a virtual anchor. */\n anchor: FloatingAnchor;\n /** Preferred side; it flips when there is no room and slides to stay on screen. Default `end`. */\n placement?: Placement;\n /** The preview (a larger thumbnail, a summary). Nothing in it can be clicked or focused. */\n children?: ReactNode;\n className?: string;\n /** Layout only. Restyle through --cy-hover-card-* tokens. */\n style?: CSSProperties;\n}\n\n/**\n * A passive preview beside the thing it previews, such as a large thumbnail of a page on hover. It takes no pointer\n * input or focus and is hidden from assistive technology, because it only repeats what its anchor already names; for\n * text that describes a control use Tooltip, and for anything interactive use Popover.\n */\nexport function HoverCard({ open, anchor, placement = \"end\", children, className, style }: HoverCardProps) {\n const card = useRef<PopoverEl>(null);\n const target = useFloatingAnchor(anchor);\n const shown = open && target.present;\n usePopover(card, shown);\n const offset = useFloatingOffset(card);\n useAnchoredPosition(target.ref, card, shown, placement, offset);\n return (\n <div\n ref={card}\n className={className ? `cy-hover-card ${className}` : \"cy-hover-card\"}\n aria-hidden=\"true\"\n {...{ popover: \"manual\", inert: true }}\n style={style}\n >\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"HoverCard.js","names":["useFloatingAnchor","useFloatingOffset","usePopover","useAnchoredPosition","useRef","jsx","HoverCard","open","anchor","placement","children","className","style","card","target","shown","offset"],"sources":["../../../src/components/HoverCard/HoverCard.tsx"],"sourcesContent":["import { type CSSProperties, type ReactNode, useRef } from \"react\";\nimport {\n type FloatingAnchor,\n type PopoverEl,\n useFloatingAnchor,\n useFloatingOffset,\n usePopover,\n} from \"../../overlay/floating.js\";\nimport type { Placement } from \"../../overlay/position.js\";\nimport { useAnchoredPosition } from \"../../overlay/use-anchored-position.js\";\n\nexport interface HoverCardTokens {\n /** Background of the card. */\n background: string;\n /** Corner radius. */\n radius: string;\n /** Inner padding. */\n padding: string;\n /** Gap between the card and its anchor. */\n offset: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n hoverCard: HoverCardTokens;\n }\n}\n\nexport interface HoverCardProps {\n /** Show it. The owner decides when: a hovered row, a focused thumbnail. */\n open: boolean;\n /** What it previews: a ref to an element, or a virtual anchor. */\n anchor: FloatingAnchor;\n /** Preferred side; it flips when there is no room and slides to stay on screen. Default `end`. */\n placement?: Placement;\n /** The preview (a larger thumbnail, a summary). Nothing in it can be clicked or focused. */\n children?: ReactNode;\n /** Added to the root element, for layout. */\n className?: string;\n /** Layout only. Restyle through --cy-hover-card-* tokens. */\n style?: CSSProperties;\n}\n\n/**\n * A passive preview beside the thing it previews, such as a large thumbnail of a page on hover. It takes no pointer\n * input or focus and is hidden from assistive technology, because it only repeats what its anchor already names; for\n * text that describes a control use Tooltip, and for anything interactive use Popover.\n */\nexport function HoverCard({ open, anchor, placement = \"end\", children, className, style }: HoverCardProps) {\n const card = useRef<PopoverEl>(null);\n const target = useFloatingAnchor(anchor);\n const shown = open && target.present;\n usePopover(card, shown);\n const offset = useFloatingOffset(card);\n useAnchoredPosition(target.ref, card, shown, placement, offset);\n return (\n <div\n ref={card}\n className={className ? `cy-hover-card ${className}` : \"cy-hover-card\"}\n aria-hidden=\"true\"\n {...{ popover: \"manual\", inert: true }}\n style={style}\n >\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;AAgDA,SAAgBM,EAAU,EAAE,MAAAC,GAAM,QAAAC,GAAQ,WAAAC,IAAY,OAAO,UAAAC,GAAU,WAAAC,GAAW,OAAAC,EAAA,GAAyB;AACzG,QAAMC,IAAOT,EAAkB,IAAI,GAC7BU,IAASd,EAAkBQ,CAAM,GACjCO,IAAQR,KAAQO,EAAO;AAC7B,EAAAZ,EAAWW,GAAME,CAAK;AACtB,QAAMC,IAASf,EAAkBY,CAAI;AACrC,SAAAV,EAAoBW,EAAO,KAAKD,GAAME,GAAON,GAAWO,CAAM,GAE5D,gBAAAX,EAAC,OAAD;AAAA,IACE,KAAKQ;AAAA,IACL,WAAWF,IAAY,iBAAiBA,CAAA,KAAc;AAAA,IACtD,eAAY;AAAA,IACN,SAAS;AAAA,IAAU,OAAO;AAAA,IACzB,OAAAC;AAAA,IAEN,UAAAF;AAAA,EACE,CAAA;AAET"}
|
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
import type { IconData } from "../../icons/types.js";
|
|
2
2
|
import type { Placement } from "../../overlay/position.js";
|
|
3
3
|
import { type ButtonProps } from "../Button/Button.js";
|
|
4
|
-
export interface IconButtonProps extends Omit<ButtonProps, "children" | "icon" | "iconEnd" | "fullWidth"> {
|
|
4
|
+
export interface IconButtonProps extends Omit<ButtonProps, "children" | "icon" | "iconEnd" | "fullWidth" | "square"> {
|
|
5
|
+
/** The Facet icon shown in the button. */
|
|
5
6
|
icon: IconData;
|
|
6
7
|
/** Required accessible name, also shown as the tooltip. */
|
|
7
8
|
label: string;
|
|
8
9
|
/** Where the label tooltip appears. */
|
|
9
10
|
tooltipPlacement?: Placement;
|
|
11
|
+
/**
|
|
12
|
+
* The icon points along the reading direction (previous, next, back): it is mirrored in right-to-left text, as
|
|
13
|
+
* Icon's `flipRtl`. Default false.
|
|
14
|
+
*/
|
|
15
|
+
flipRtl?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Any CSS colour for the icon, as Icon's `color` (e.g. a status the button shows for a moment). Default: the
|
|
18
|
+
* button's text colour.
|
|
19
|
+
*/
|
|
20
|
+
iconColor?: string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Added to the element around the button (the tooltip's anchor, the box the parent lays out), for layout: a grid
|
|
23
|
+
* area, `flex`, margins. `className` goes on the button itself.
|
|
24
|
+
*/
|
|
25
|
+
wrapperClassName?: string | undefined;
|
|
10
26
|
}
|
|
11
27
|
/** A square Button with only an icon. Its label is the accessible name and a Tooltip (no native title). */
|
|
12
28
|
export declare const IconButton: import("react").ForwardRefExoticComponent<IconButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,27 +1,31 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Icon as
|
|
2
|
+
import { Icon as l } from "../../foundations/Icon/Icon.js";
|
|
3
3
|
import { Button as p } from "../Button/Button.js";
|
|
4
|
-
import { Tooltip as
|
|
5
|
-
import { forwardRef as
|
|
4
|
+
import { Tooltip as u } from "../Tooltip/Tooltip.js";
|
|
5
|
+
import { forwardRef as s } from "react";
|
|
6
6
|
import { jsx as o } from "react/jsx-runtime";
|
|
7
|
-
var
|
|
8
|
-
return /* @__PURE__ */ o(
|
|
7
|
+
var z = s(function({ icon: i, label: t, className: r, tooltipPlacement: m = "top", flipRtl: c = !1, iconColor: n, wrapperClassName: a, ...e }, f) {
|
|
8
|
+
return /* @__PURE__ */ o(u, {
|
|
9
9
|
content: t,
|
|
10
10
|
placement: m,
|
|
11
|
+
className: a,
|
|
11
12
|
children: /* @__PURE__ */ o(p, {
|
|
12
|
-
ref:
|
|
13
|
-
...
|
|
13
|
+
ref: f,
|
|
14
|
+
...e,
|
|
15
|
+
square: !0,
|
|
14
16
|
"aria-label": t,
|
|
15
17
|
className: `cy-icon-button${r ? ` ${r}` : ""}`,
|
|
16
|
-
children: /* @__PURE__ */ o(
|
|
18
|
+
children: /* @__PURE__ */ o(l, {
|
|
17
19
|
icon: i,
|
|
18
|
-
size:
|
|
20
|
+
size: e.size === "lg" ? "lg" : "md",
|
|
21
|
+
flipRtl: c,
|
|
22
|
+
...n ? { color: n } : {}
|
|
19
23
|
})
|
|
20
24
|
})
|
|
21
25
|
});
|
|
22
26
|
});
|
|
23
27
|
export {
|
|
24
|
-
|
|
28
|
+
z as IconButton
|
|
25
29
|
};
|
|
26
30
|
|
|
27
31
|
//# sourceMappingURL=IconButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.js","names":["Icon","Button","Tooltip","forwardRef","jsx","IconButton","icon","label","className","tooltipPlacement","rest","ref"],"sources":["../../../src/components/IconButton/IconButton.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { Icon } from \"../../foundations/Icon/Icon.js\";\nimport type { IconData } from \"../../icons/types.js\";\nimport type { Placement } from \"../../overlay/position.js\";\nimport { Button, type ButtonProps } from \"../Button/Button.js\";\nimport { Tooltip } from \"../Tooltip/Tooltip.js\";\n\nexport interface IconButtonProps
|
|
1
|
+
{"version":3,"file":"IconButton.js","names":["Icon","Button","Tooltip","forwardRef","jsx","IconButton","icon","label","className","tooltipPlacement","flipRtl","iconColor","wrapperClassName","rest","ref"],"sources":["../../../src/components/IconButton/IconButton.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { Icon } from \"../../foundations/Icon/Icon.js\";\nimport type { IconData } from \"../../icons/types.js\";\nimport type { Placement } from \"../../overlay/position.js\";\nimport { Button, type ButtonProps } from \"../Button/Button.js\";\nimport { Tooltip } from \"../Tooltip/Tooltip.js\";\n\nexport interface IconButtonProps\n extends Omit<ButtonProps, \"children\" | \"icon\" | \"iconEnd\" | \"fullWidth\" | \"square\"> {\n /** The Facet icon shown in the button. */\n icon: IconData;\n /** Required accessible name, also shown as the tooltip. */\n label: string;\n /** Where the label tooltip appears. */\n tooltipPlacement?: Placement;\n /**\n * The icon points along the reading direction (previous, next, back): it is mirrored in right-to-left text, as\n * Icon's `flipRtl`. Default false.\n */\n flipRtl?: boolean;\n /**\n * Any CSS colour for the icon, as Icon's `color` (e.g. a status the button shows for a moment). Default: the\n * button's text colour.\n */\n iconColor?: string | undefined;\n /**\n * Added to the element around the button (the tooltip's anchor, the box the parent lays out), for layout: a grid\n * area, `flex`, margins. `className` goes on the button itself.\n */\n wrapperClassName?: string | undefined;\n}\n\n/** A square Button with only an icon. Its label is the accessible name and a Tooltip (no native title). */\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n { icon, label, className, tooltipPlacement = \"top\", flipRtl = false, iconColor, wrapperClassName, ...rest },\n ref,\n) {\n return (\n <Tooltip content={label} placement={tooltipPlacement} className={wrapperClassName}>\n <Button\n ref={ref}\n {...rest}\n square\n aria-label={label}\n className={`cy-icon-button${className ? ` ${className}` : \"\"}`}\n >\n <Icon\n icon={icon}\n size={rest.size === \"lg\" ? \"lg\" : \"md\"}\n flipRtl={flipRtl}\n {...(iconColor ? { color: iconColor } : {})}\n />\n </Button>\n </Tooltip>\n );\n});\n"],"mappings":";;;;;;AAiCA,IAAaK,IAAaF,EAA+C,SACvE,EAAE,MAAAG,GAAM,OAAAC,GAAO,WAAAC,GAAW,kBAAAC,IAAmB,OAAO,SAAAC,IAAU,IAAO,WAAAC,GAAW,kBAAAC,GAAkB,GAAGC,EAAA,GACrGC,GACA;AACA,SACE,gBAAAV,EAACF,GAAD;AAAA,IAAS,SAASK;AAAA,IAAO,WAAWE;AAAA,IAAkB,WAAWG;AAAA,IAC/D,UAAA,gBAAAR,EAACH,GAAD;AAAA,MACO,KAAAa;AAAA,MACL,GAAID;AAAA,MACJ,QAAA;AAAA,MACA,cAAYN;AAAA,MACZ,WAAW,iBAAiBC,IAAY,IAAIA,CAAA,KAAc,EAAA;AAAA,MAE1D,UAAA,gBAAAJ,EAACJ,GAAD;AAAA,QACQ,MAAAM;AAAA,QACN,MAAMO,EAAK,SAAS,OAAO,OAAO;AAAA,QACzB,SAAAH;AAAA,QACT,GAAKC,IAAY,EAAE,OAAOA,EAAU,IAAI,CAAC;AAAA,MAC1C,CAAA;AAAA,IACK,CAAA;AAAA,EACD,CAAA;AAEb,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type CSSProperties } from "react";
|
|
2
|
+
import type { IconData } from "../../icons/types.js";
|
|
3
|
+
import type { Size, Tone } from "../../tokens/schema.js";
|
|
4
|
+
export interface IconTileTokens {
|
|
5
|
+
/** Width and height at `size="sm"` (the small control height). */
|
|
6
|
+
sizeSm: string;
|
|
7
|
+
/** Width and height at `size="md"` (the medium control height). */
|
|
8
|
+
sizeMd: string;
|
|
9
|
+
/** Width and height at `size="lg"` (the large control height). */
|
|
10
|
+
sizeLg: string;
|
|
11
|
+
/** Corner radius of the square shape. Default: the tile's size times the theme's radius factor. */
|
|
12
|
+
radius: string;
|
|
13
|
+
/** Tint strength of the soft variant (percentage of the tone mixed into the surface). */
|
|
14
|
+
softMix: string;
|
|
15
|
+
/** Size of the icon as a fraction of the tile, a number. Default 0.5. */
|
|
16
|
+
iconScale: string;
|
|
17
|
+
}
|
|
18
|
+
declare module "../../tokens/schema.js" {
|
|
19
|
+
interface ComponentTokens {
|
|
20
|
+
iconTile: IconTileTokens;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export interface IconTileProps {
|
|
24
|
+
/** The Facet icon drawn on the tile. */
|
|
25
|
+
icon: IconData;
|
|
26
|
+
/**
|
|
27
|
+
* Accessible name. With it the tile is an image (`role="img"`) named by it; without it the tile is decorative and
|
|
28
|
+
* hidden from assistive technology, for when text beside it says the same thing.
|
|
29
|
+
*/
|
|
30
|
+
label?: string | undefined;
|
|
31
|
+
/** Width and height: the control heights, so they scale with the theme. Default "md". */
|
|
32
|
+
size?: Size;
|
|
33
|
+
/** Semantic colour. Default "accent". */
|
|
34
|
+
tone?: Tone;
|
|
35
|
+
/** `soft` tinted fill, `solid` full tone fill, `outline` a tinted border on the surface. Default "soft". */
|
|
36
|
+
variant?: "soft" | "solid" | "outline";
|
|
37
|
+
/** Outline: a square with rounded corners, or a circle. Default "square". */
|
|
38
|
+
shape?: "square" | "circle";
|
|
39
|
+
/** Added to the root element, for layout. */
|
|
40
|
+
className?: string;
|
|
41
|
+
/** Layout only. Restyle through --cy-icon-tile-* tokens. */
|
|
42
|
+
style?: CSSProperties;
|
|
43
|
+
}
|
|
44
|
+
/** A Facet icon on a tinted square or circle: a feature's mark, a stat's or a list item's icon. */
|
|
45
|
+
export declare const IconTile: import("react").ForwardRefExoticComponent<IconTileProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Icon as f } from "../../foundations/Icon/Icon.js";
|
|
3
|
+
import { forwardRef as s } from "react";
|
|
4
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
5
|
+
var I = s(function({ icon: t, label: a, size: i = "md", tone: o = "accent", variant: n = "soft", shape: c = "square", className: r, style: d }, m) {
|
|
6
|
+
return /* @__PURE__ */ e("span", {
|
|
7
|
+
ref: m,
|
|
8
|
+
className: `cy-icon-tile${r ? ` ${r}` : ""}`,
|
|
9
|
+
...a ? {
|
|
10
|
+
role: "img",
|
|
11
|
+
"aria-label": a
|
|
12
|
+
} : { "aria-hidden": !0 },
|
|
13
|
+
"data-size": i,
|
|
14
|
+
"data-tone": o,
|
|
15
|
+
"data-variant": n,
|
|
16
|
+
"data-shape": c,
|
|
17
|
+
style: d,
|
|
18
|
+
children: /* @__PURE__ */ e(f, { icon: t })
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
export {
|
|
22
|
+
I as IconTile
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=IconTile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconTile.js","names":["Icon","forwardRef","jsx","IconTile","icon","label","size","tone","variant","shape","className","style","ref"],"sources":["../../../src/components/IconTile/IconTile.tsx"],"sourcesContent":["import { type CSSProperties, forwardRef } from \"react\";\nimport { Icon } from \"../../foundations/Icon/Icon.js\";\nimport type { IconData } from \"../../icons/types.js\";\nimport type { Size, Tone } from \"../../tokens/schema.js\";\n\nexport interface IconTileTokens {\n /** Width and height at `size=\"sm\"` (the small control height). */\n sizeSm: string;\n /** Width and height at `size=\"md\"` (the medium control height). */\n sizeMd: string;\n /** Width and height at `size=\"lg\"` (the large control height). */\n sizeLg: string;\n /** Corner radius of the square shape. Default: the tile's size times the theme's radius factor. */\n radius: string;\n /** Tint strength of the soft variant (percentage of the tone mixed into the surface). */\n softMix: string;\n /** Size of the icon as a fraction of the tile, a number. Default 0.5. */\n iconScale: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n iconTile: IconTileTokens;\n }\n}\n\nexport interface IconTileProps {\n /** The Facet icon drawn on the tile. */\n icon: IconData;\n /**\n * Accessible name. With it the tile is an image (`role=\"img\"`) named by it; without it the tile is decorative and\n * hidden from assistive technology, for when text beside it says the same thing.\n */\n label?: string | undefined;\n /** Width and height: the control heights, so they scale with the theme. Default \"md\". */\n size?: Size;\n /** Semantic colour. Default \"accent\". */\n tone?: Tone;\n /** `soft` tinted fill, `solid` full tone fill, `outline` a tinted border on the surface. Default \"soft\". */\n variant?: \"soft\" | \"solid\" | \"outline\";\n /** Outline: a square with rounded corners, or a circle. Default \"square\". */\n shape?: \"square\" | \"circle\";\n /** Added to the root element, for layout. */\n className?: string;\n /** Layout only. Restyle through --cy-icon-tile-* tokens. */\n style?: CSSProperties;\n}\n\n/** A Facet icon on a tinted square or circle: a feature's mark, a stat's or a list item's icon. */\nexport const IconTile = forwardRef<HTMLSpanElement, IconTileProps>(function IconTile(\n { icon, label, size = \"md\", tone = \"accent\", variant = \"soft\", shape = \"square\", className, style },\n ref,\n) {\n return (\n <span\n ref={ref}\n className={`cy-icon-tile${className ? ` ${className}` : \"\"}`}\n {...(label ? { role: \"img\", \"aria-label\": label } : { \"aria-hidden\": true })}\n data-size={size}\n data-tone={tone}\n data-variant={variant}\n data-shape={shape}\n style={style}\n >\n <Icon icon={icon} />\n </span>\n );\n});\n"],"mappings":";;;;AAiDA,IAAaG,IAAWF,EAA2C,SACjE,EAAE,MAAAG,GAAM,OAAAC,GAAO,MAAAC,IAAO,MAAM,MAAAC,IAAO,UAAU,SAAAC,IAAU,QAAQ,OAAAC,IAAQ,UAAU,WAAAC,GAAW,OAAAC,EAAA,GAC5FC,GACA;AACA,SACE,gBAAAV,EAAC,QAAD;AAAA,IACO,KAAAU;AAAA,IACL,WAAW,eAAeF,IAAY,IAAIA,CAAA,KAAc,EAAA;AAAA,IACxD,GAAKL,IAAQ;AAAA,MAAE,MAAM;AAAA,MAAO,cAAcA;AAAA,IAAM,IAAI,EAAE,eAAe,GAAK;AAAA,IAC1E,aAAWC;AAAA,IACX,aAAWC;AAAA,IACX,gBAAcC;AAAA,IACd,cAAYC;AAAA,IACL,OAAAE;AAAA,IAEP,UAAA,gBAAAT,EAACF,GAAD,EAAY,MAAAI,EAAO,CAAA;AAAA,EACf,CAAA;AAEV,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { IconTile, type IconTileProps, type IconTileTokens } from "./IconTile.js";
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode, type SyntheticEvent } from "react";
|
|
2
|
+
import { type AspectRatioRadius } from "../AspectRatio/AspectRatio.js";
|
|
3
|
+
export interface ImageTokens {
|
|
4
|
+
/** Corner radius of every Image, whatever its `radius` prop says. */
|
|
5
|
+
radius: string;
|
|
6
|
+
/** Fill of the box shown when the picture fails to load. */
|
|
7
|
+
fallbackBackground: string;
|
|
8
|
+
/** Icon and text colour of that box. */
|
|
9
|
+
fallbackColor: string;
|
|
10
|
+
/** Space between the picture and its caption. */
|
|
11
|
+
captionGap: string;
|
|
12
|
+
/** Text colour of the caption. */
|
|
13
|
+
captionColor: string;
|
|
14
|
+
}
|
|
15
|
+
declare module "../../tokens/schema.js" {
|
|
16
|
+
interface ComponentTokens {
|
|
17
|
+
image: ImageTokens;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export interface ImageProps {
|
|
21
|
+
/** Address of the picture. Changing it loads the new picture, also after a failure. */
|
|
22
|
+
src: string;
|
|
23
|
+
/** What the picture shows, for people who cannot see it. `""` marks it decorative and hides it from them. */
|
|
24
|
+
alt: string;
|
|
25
|
+
/** Candidate files for different screen densities or widths, as on `<img>`. */
|
|
26
|
+
srcSet?: string | undefined;
|
|
27
|
+
/** With `srcSet`: how wide the picture is shown, as on `<img>`. */
|
|
28
|
+
sizes?: string | undefined;
|
|
29
|
+
/** Natural width in pixels. With `height` and no `ratio`, it reserves the picture's space before it loads. */
|
|
30
|
+
width?: number | undefined;
|
|
31
|
+
/** Natural height in pixels. */
|
|
32
|
+
height?: number | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Width divided by height of the box the picture fills (`16 / 9`, `"4/3"`), kept at any width with AspectRatio.
|
|
35
|
+
* Without it the picture has its natural size, no wider than its container.
|
|
36
|
+
*/
|
|
37
|
+
ratio?: number | string | undefined;
|
|
38
|
+
/** With `ratio`: `cover` fills the box and crops, `contain` shows the whole picture. Default "cover". */
|
|
39
|
+
fit?: "cover" | "contain";
|
|
40
|
+
/** With `ratio`: which part stays in view when cropped, as CSS `object-position` (`"top"`, `"20% 80%"`). */
|
|
41
|
+
position?: string | undefined;
|
|
42
|
+
/** Rounds the corners from the radius tokens. Default "none". */
|
|
43
|
+
radius?: AspectRatioRadius;
|
|
44
|
+
/** `lazy` waits until the picture is near the screen; `eager` loads it at once. Default "lazy". */
|
|
45
|
+
loading?: "lazy" | "eager";
|
|
46
|
+
/** Shown while the picture loads, in place of the Skeleton. */
|
|
47
|
+
placeholder?: ReactNode;
|
|
48
|
+
/** Shown when the picture fails, in place of the box with an icon and the `alt` text. */
|
|
49
|
+
fallback?: ReactNode;
|
|
50
|
+
/** A caption under the picture: wraps it in a `figure` named by the caption. */
|
|
51
|
+
caption?: ReactNode;
|
|
52
|
+
/** Called when the picture has loaded. */
|
|
53
|
+
onLoad?: ((event: SyntheticEvent<HTMLImageElement>) => void) | undefined;
|
|
54
|
+
/** Called when the picture fails to load. The fallback is shown as well. */
|
|
55
|
+
onError?: ((event: SyntheticEvent<HTMLImageElement>) => void) | undefined;
|
|
56
|
+
/** Added to the root element (the `figure` when there is a caption), for layout. */
|
|
57
|
+
className?: string;
|
|
58
|
+
/** Layout only (width, margin, placement), on the root element. Restyle through --cy-image-* tokens. */
|
|
59
|
+
style?: CSSProperties;
|
|
60
|
+
}
|
|
61
|
+
/** A picture that keeps its space while it loads, shows a placeholder until then and a fallback when it fails. */
|
|
62
|
+
export declare const Image: import("react").ForwardRefExoticComponent<ImageProps & import("react").RefAttributes<HTMLImageElement>>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Icon as E } from "../../foundations/Icon/Icon.js";
|
|
3
|
+
import { AspectRatio as H } from "../AspectRatio/AspectRatio.js";
|
|
4
|
+
import { useImageOutcome as L } from "../../foundations/image-outcome.js";
|
|
5
|
+
import { image as O } from "../../icons/image.js";
|
|
6
|
+
import { Skeleton as P } from "../Skeleton/Skeleton.js";
|
|
7
|
+
import { forwardRef as S, useId as q, useImperativeHandle as B, useRef as C } from "react";
|
|
8
|
+
import { Fragment as N, jsx as e, jsxs as g } from "react/jsx-runtime";
|
|
9
|
+
var V = S(function({ src: f, alt: a, srcSet: u, sizes: R, width: o, height: n, ratio: i, fit: b = "cover", position: y, radius: j = "none", loading: x = "lazy", placeholder: k, fallback: d, caption: r, onLoad: z, onError: F, className: c, style: p }, A) {
|
|
10
|
+
const v = q(), t = C(null);
|
|
11
|
+
B(A, () => t.current);
|
|
12
|
+
const h = `${f} ${u ?? ""}`, m = L(t, h), s = m.outcome, I = /* @__PURE__ */ g(N, { children: [s === "error" ? /* @__PURE__ */ e("span", {
|
|
13
|
+
className: "cy-image-fallback",
|
|
14
|
+
"data-default": d === void 0 ? "" : void 0,
|
|
15
|
+
"aria-hidden": d === void 0 && a === "" ? !0 : void 0,
|
|
16
|
+
style: i === void 0 && o && n ? {
|
|
17
|
+
inlineSize: o,
|
|
18
|
+
aspectRatio: `${o} / ${n}`
|
|
19
|
+
} : void 0,
|
|
20
|
+
children: d ?? /* @__PURE__ */ g(N, { children: [/* @__PURE__ */ e(E, { icon: O }), a && /* @__PURE__ */ e("span", {
|
|
21
|
+
className: "cy-image-alt cy-reset",
|
|
22
|
+
children: a
|
|
23
|
+
})] })
|
|
24
|
+
}) : /* @__PURE__ */ e("img", {
|
|
25
|
+
ref: t,
|
|
26
|
+
className: "cy-image-img cy-reset",
|
|
27
|
+
src: f,
|
|
28
|
+
alt: a,
|
|
29
|
+
srcSet: u,
|
|
30
|
+
sizes: R,
|
|
31
|
+
width: o,
|
|
32
|
+
height: n,
|
|
33
|
+
loading: x,
|
|
34
|
+
decoding: "async",
|
|
35
|
+
style: y === void 0 ? void 0 : { objectPosition: y },
|
|
36
|
+
onLoad: (l) => {
|
|
37
|
+
m.loaded(), z?.(l);
|
|
38
|
+
},
|
|
39
|
+
onError: (l) => {
|
|
40
|
+
m.failed(), F?.(l);
|
|
41
|
+
}
|
|
42
|
+
}, h), s === "loading" && /* @__PURE__ */ e("span", {
|
|
43
|
+
className: "cy-image-placeholder cy-reset",
|
|
44
|
+
children: k ?? /* @__PURE__ */ e(P, {
|
|
45
|
+
shape: "block",
|
|
46
|
+
height: "100%"
|
|
47
|
+
})
|
|
48
|
+
})] }), $ = /* @__PURE__ */ e(i === void 0 ? "span" : "div", {
|
|
49
|
+
className: !r && c ? `cy-image ${c}` : "cy-image",
|
|
50
|
+
"data-state": s,
|
|
51
|
+
"data-fit": b,
|
|
52
|
+
"data-radius": j,
|
|
53
|
+
"data-ratio": i === void 0 ? void 0 : "",
|
|
54
|
+
style: r ? void 0 : p,
|
|
55
|
+
children: i === void 0 ? I : /* @__PURE__ */ e(H, {
|
|
56
|
+
ratio: i,
|
|
57
|
+
children: I
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
return r ? /* @__PURE__ */ g("figure", {
|
|
61
|
+
className: c ? `cy-image-figure ${c}` : "cy-image-figure",
|
|
62
|
+
"aria-labelledby": v,
|
|
63
|
+
style: p,
|
|
64
|
+
children: [$, /* @__PURE__ */ e("figcaption", {
|
|
65
|
+
id: v,
|
|
66
|
+
className: "cy-image-caption",
|
|
67
|
+
children: r
|
|
68
|
+
})]
|
|
69
|
+
}) : $;
|
|
70
|
+
});
|
|
71
|
+
export {
|
|
72
|
+
V as Image
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
//# sourceMappingURL=Image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.js","names":["_Fragment","Icon","AspectRatio","useImageOutcome","image","Skeleton","forwardRef","useId","useImperativeHandle","useRef","Fragment$1","jsx","jsxs","Image","src","alt","srcSet","sizes","width","height","ratio","fit","position","radius","loading","placeholder","fallback","caption","onLoad","onError","className","style","ref","captionId","el","key","picture","state","content","event","frame"],"sources":["../../../src/components/Image/Image.tsx"],"sourcesContent":["import {\n type CSSProperties,\n forwardRef,\n type ReactNode,\n type SyntheticEvent,\n useId,\n useImperativeHandle,\n useRef,\n} from \"react\";\nimport { Icon } from \"../../foundations/Icon/Icon.js\";\nimport { useImageOutcome } from \"../../foundations/image-outcome.js\";\nimport { image } from \"../../icons/image.js\";\nimport { AspectRatio, type AspectRatioRadius } from \"../AspectRatio/AspectRatio.js\";\nimport { Skeleton } from \"../Skeleton/Skeleton.js\";\n\nexport interface ImageTokens {\n /** Corner radius of every Image, whatever its `radius` prop says. */\n radius: string;\n /** Fill of the box shown when the picture fails to load. */\n fallbackBackground: string;\n /** Icon and text colour of that box. */\n fallbackColor: string;\n /** Space between the picture and its caption. */\n captionGap: string;\n /** Text colour of the caption. */\n captionColor: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n image: ImageTokens;\n }\n}\n\nexport interface ImageProps {\n /** Address of the picture. Changing it loads the new picture, also after a failure. */\n src: string;\n /** What the picture shows, for people who cannot see it. `\"\"` marks it decorative and hides it from them. */\n alt: string;\n /** Candidate files for different screen densities or widths, as on `<img>`. */\n srcSet?: string | undefined;\n /** With `srcSet`: how wide the picture is shown, as on `<img>`. */\n sizes?: string | undefined;\n /** Natural width in pixels. With `height` and no `ratio`, it reserves the picture's space before it loads. */\n width?: number | undefined;\n /** Natural height in pixels. */\n height?: number | undefined;\n /**\n * Width divided by height of the box the picture fills (`16 / 9`, `\"4/3\"`), kept at any width with AspectRatio.\n * Without it the picture has its natural size, no wider than its container.\n */\n ratio?: number | string | undefined;\n /** With `ratio`: `cover` fills the box and crops, `contain` shows the whole picture. Default \"cover\". */\n fit?: \"cover\" | \"contain\";\n /** With `ratio`: which part stays in view when cropped, as CSS `object-position` (`\"top\"`, `\"20% 80%\"`). */\n position?: string | undefined;\n /** Rounds the corners from the radius tokens. Default \"none\". */\n radius?: AspectRatioRadius;\n /** `lazy` waits until the picture is near the screen; `eager` loads it at once. Default \"lazy\". */\n loading?: \"lazy\" | \"eager\";\n /** Shown while the picture loads, in place of the Skeleton. */\n placeholder?: ReactNode;\n /** Shown when the picture fails, in place of the box with an icon and the `alt` text. */\n fallback?: ReactNode;\n /** A caption under the picture: wraps it in a `figure` named by the caption. */\n caption?: ReactNode;\n /** Called when the picture has loaded. */\n onLoad?: ((event: SyntheticEvent<HTMLImageElement>) => void) | undefined;\n /** Called when the picture fails to load. The fallback is shown as well. */\n onError?: ((event: SyntheticEvent<HTMLImageElement>) => void) | undefined;\n /** Added to the root element (the `figure` when there is a caption), for layout. */\n className?: string;\n /** Layout only (width, margin, placement), on the root element. Restyle through --cy-image-* tokens. */\n style?: CSSProperties;\n}\n\n/** A picture that keeps its space while it loads, shows a placeholder until then and a fallback when it fails. */\nexport const Image = forwardRef<HTMLImageElement, ImageProps>(function Image(\n {\n src,\n alt,\n srcSet,\n sizes,\n width,\n height,\n ratio,\n fit = \"cover\",\n position,\n radius = \"none\",\n loading = \"lazy\",\n placeholder,\n fallback,\n caption,\n onLoad,\n onError,\n className,\n style,\n },\n ref,\n) {\n const captionId = useId();\n const el = useRef<HTMLImageElement>(null);\n useImperativeHandle(ref, () => el.current as HTMLImageElement);\n // One outcome per picture: a new `src` starts again from \"loading\", whatever happened to the last one. Before\n // script runs the state is \"pending\" and the picture shows as the browser has it (pages never hydrated).\n const key = `${src} ${srcSet ?? \"\"}`;\n const picture = useImageOutcome(el, key);\n const state = picture.outcome;\n\n const content = (\n <>\n {state === \"error\" ? (\n <span\n className=\"cy-image-fallback\"\n data-default={fallback === undefined ? \"\" : undefined}\n aria-hidden={fallback === undefined && alt === \"\" ? true : undefined}\n style={\n ratio === undefined && width && height\n ? { inlineSize: width, aspectRatio: `${width} / ${height}` }\n : undefined\n }\n >\n {fallback ?? (\n <>\n <Icon icon={image} />\n {alt && <span className=\"cy-image-alt cy-reset\">{alt}</span>}\n </>\n )}\n </span>\n ) : (\n <img\n // A new element for each picture, so `complete` never describes the one before.\n key={key}\n ref={el}\n className=\"cy-image-img cy-reset\"\n src={src}\n alt={alt}\n srcSet={srcSet}\n sizes={sizes}\n width={width}\n height={height}\n loading={loading}\n decoding=\"async\"\n style={position === undefined ? undefined : { objectPosition: position }}\n onLoad={(event) => {\n picture.loaded();\n onLoad?.(event);\n }}\n onError={(event) => {\n picture.failed();\n onError?.(event);\n }}\n />\n )}\n {state === \"loading\" && (\n <span className=\"cy-image-placeholder cy-reset\">\n {placeholder ?? <Skeleton shape=\"block\" height=\"100%\" />}\n </span>\n )}\n </>\n );\n\n const Frame = ratio === undefined ? \"span\" : \"div\";\n const frame = (\n <Frame\n className={!caption && className ? `cy-image ${className}` : \"cy-image\"}\n data-state={state}\n data-fit={fit}\n data-radius={radius}\n data-ratio={ratio === undefined ? undefined : \"\"}\n style={caption ? undefined : style}\n >\n {ratio === undefined ? content : <AspectRatio ratio={ratio}>{content}</AspectRatio>}\n </Frame>\n );\n if (!caption) return frame;\n return (\n <figure\n className={className ? `cy-image-figure ${className}` : \"cy-image-figure\"}\n aria-labelledby={captionId}\n style={style}\n >\n {frame}\n <figcaption id={captionId} className=\"cy-image-caption\">\n {caption}\n </figcaption>\n </figure>\n );\n});\n"],"mappings":";;;;;;;;AA6EA,IAAaa,IAAQP,EAAyC,SAC5D,EACE,KAAAQ,GACA,KAAAC,GACA,QAAAC,GACA,OAAAC,GACA,OAAAC,GACA,QAAAC,GACA,OAAAC,GACA,KAAAC,IAAM,SACN,UAAAC,GACA,QAAAC,IAAS,QACT,SAAAC,IAAU,QACV,aAAAC,GACA,UAAAC,GACA,SAAAC,GACA,QAAAC,GACA,SAAAC,GACA,WAAAC,GACA,OAAAC,EAAA,GAEFC,GACA;AACA,QAAMC,IAAY1B,EAAM,GAClB2B,IAAKzB,EAAyB,IAAI;AACxC,EAAAD,EAAoBwB,GAAA,MAAWE,EAAG,OAA2B;AAG7D,QAAMC,IAAM,GAAGrB,CAAA,IAAOE,KAAU,EAAA,IAC1BoB,IAAUjC,EAAgB+B,GAAIC,CAAG,GACjCE,IAAQD,EAAQ,SAEhBE,IACJ,gBAAA1B,EAAAZ,GAAA,EAAA,UAAA,CACGqC,MAAU,UACT,gBAAA1B,EAAC,QAAD;AAAA,IACE,WAAU;AAAA,IACV,gBAAce,MAAa,SAAY,KAAK;AAAA,IAC5C,eAAaA,MAAa,UAAaX,MAAQ,KAAK,KAAO;AAAA,IAC3D,OACEK,MAAU,UAAaF,KAASC,IAC5B;AAAA,MAAE,YAAYD;AAAA,MAAO,aAAa,GAAGA,CAAA,MAAWC,CAAA;AAAA,IAAS,IACzD;AAAA,IAGL,UAAAO,KACC,gBAAAd,EAAAZ,GAAA,EAAA,UAAA,CACE,gBAAAW,EAACV,GAAD,EAAM,MAAMG,EAAQ,CAAA,GACnBW,KAAO,gBAAAJ,EAAC,QAAD;AAAA,MAAM,WAAU;AAAA,MAAyB,UAAAI;AAAA,IAAU,CAAA,CAC3D,EAAA,CAAA;AAAA,EAEA,CAAA,IAEN,gBAAAJ,EAAC,OAAD;AAAA,IAGE,KAAKuB;AAAA,IACL,WAAU;AAAA,IACL,KAAApB;AAAA,IACA,KAAAC;AAAA,IACG,QAAAC;AAAA,IACD,OAAAC;AAAA,IACA,OAAAC;AAAA,IACC,QAAAC;AAAA,IACC,SAAAK;AAAA,IACT,UAAS;AAAA,IACT,OAAOF,MAAa,SAAY,SAAY,EAAE,gBAAgBA,EAAS;AAAA,IACvE,QAAA,CAASiB,MAAU;AACjB,MAAAH,EAAQ,OAAO,GACfR,IAASW,CAAK;AAAA,IAChB;AAAA,IACA,SAAA,CAAUA,MAAU;AAClB,MAAAH,EAAQ,OAAO,GACfP,IAAUU,CAAK;AAAA,IACjB;AAAA,EACD,GApBMJ,CAoBN,GAEFE,MAAU,aACT,gBAAA1B,EAAC,QAAD;AAAA,IAAM,WAAU;AAAA,IACb,UAAAc,KAAe,gBAAAd,EAACN,GAAD;AAAA,MAAU,OAAM;AAAA,MAAQ,QAAO;AAAA,IAAQ,CAAA;AAAA,EACnD,CAAA,CAER,EAAA,CAAA,GAIEmC,IACJ,gBAAA7B,EAFYS,MAAU,SAAY,SAAS,OAE3C;AAAA,IACE,WAAW,CAACO,KAAWG,IAAY,YAAYA,CAAA,KAAc;AAAA,IAC7D,cAAYO;AAAA,IACZ,YAAUhB;AAAA,IACV,eAAaE;AAAA,IACb,cAAYH,MAAU,SAAY,SAAY;AAAA,IAC9C,OAAOO,IAAU,SAAYI;AAAA,IAE5B,UAAAX,MAAU,SAAYkB,IAAU,gBAAA3B,EAACT,GAAD;AAAA,MAAoB,OAAAkB;AAAA,MAAQ,UAAAkB;AAAA,IAAqB,CAAA;AAAA,EAC7E,CAAA;AAET,SAAKX,IAEH,gBAAAf,EAAC,UAAD;AAAA,IACE,WAAWkB,IAAY,mBAAmBA,CAAA,KAAc;AAAA,IACxD,mBAAiBG;AAAA,IACV,OAAAF;AAAA,IAHT,UAAA,CAKGS,GACD,gBAAA7B,EAAC,cAAD;AAAA,MAAY,IAAIsB;AAAA,MAAW,WAAU;AAAA,MAClC,UAAAN;AAAA,IACS,CAAA,CACN;AAAA,E,KAXWa;AAavB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Image, type ImageProps, type ImageTokens } from "./Image.js";
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactNode } from "react";
|
|
2
|
-
type
|
|
3
|
-
export interface InlineProps {
|
|
2
|
+
import type { LayoutAttributes, PaddingProps, Space, VisibilityProps } from "../Stack/space.js";
|
|
3
|
+
export interface InlineProps extends PaddingProps, VisibilityProps, LayoutAttributes {
|
|
4
4
|
/** Space token between children. */
|
|
5
5
|
gap?: Space;
|
|
6
|
+
/** Cross-axis alignment of children. They are centred when it is not set. */
|
|
6
7
|
align?: "start" | "center" | "end" | "stretch" | "baseline";
|
|
8
|
+
/** How children are spread along the row. */
|
|
7
9
|
justify?: "start" | "center" | "end" | "between";
|
|
8
10
|
/** Wrap onto new lines when space runs out. */
|
|
9
11
|
wrap?: boolean;
|
|
10
12
|
/** Neutral layout element to render (never an interactive one). */
|
|
11
13
|
as?: "div" | "section" | "ul" | "ol" | "nav" | "aside" | "header" | "footer" | "span";
|
|
14
|
+
/** Added to the root element, for layout. */
|
|
12
15
|
className?: string;
|
|
13
16
|
/** Layout only. */
|
|
14
17
|
style?: CSSProperties;
|
|
18
|
+
/** The elements to lay out in a row. */
|
|
15
19
|
children?: ReactNode;
|
|
20
|
+
/** Set on the root element, for tests. */
|
|
16
21
|
"data-testid"?: string;
|
|
17
22
|
}
|
|
18
|
-
/** Horizontal layout with token gaps. */
|
|
23
|
+
/** Horizontal layout with token gaps: a Stack in a row, its children centred unless `align` says otherwise. */
|
|
19
24
|
export declare const Inline: import("react").ForwardRefExoticComponent<InlineProps & import("react").RefAttributes<HTMLElement>>;
|
|
20
|
-
export {};
|
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"--_gap": `var(--cy-space-${i})`,
|
|
14
|
-
...o
|
|
15
|
-
},
|
|
16
|
-
children: f
|
|
2
|
+
import { Stack as t } from "../Stack/Stack.js";
|
|
3
|
+
import { forwardRef as a } from "react";
|
|
4
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
5
|
+
var d = a(function({ gap: i = "3", wrap: o = !1, className: r, ...n }, e) {
|
|
6
|
+
return /* @__PURE__ */ f(t, {
|
|
7
|
+
ref: e,
|
|
8
|
+
...n,
|
|
9
|
+
gap: i,
|
|
10
|
+
direction: "row",
|
|
11
|
+
className: `cy-inline${r ? ` ${r}` : ""}`,
|
|
12
|
+
"data-wrap": o ? "" : void 0
|
|
17
13
|
});
|
|
18
14
|
});
|
|
19
15
|
export {
|
|
20
|
-
|
|
16
|
+
d as Inline
|
|
21
17
|
};
|
|
22
18
|
|
|
23
19
|
//# sourceMappingURL=Inline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Inline.js","names":["
|
|
1
|
+
{"version":3,"file":"Inline.js","names":["Stack","forwardRef","jsx","Inline","gap","wrap","className","rest","ref"],"sources":["../../../src/components/Inline/Inline.tsx"],"sourcesContent":["import { type CSSProperties, forwardRef, type ReactNode } from \"react\";\nimport { Stack } from \"../Stack/Stack.js\";\nimport type { LayoutAttributes, PaddingProps, Space, VisibilityProps } from \"../Stack/space.js\";\n\nexport interface InlineProps extends PaddingProps, VisibilityProps, LayoutAttributes {\n /** Space token between children. */\n gap?: Space;\n /** Cross-axis alignment of children. They are centred when it is not set. */\n align?: \"start\" | \"center\" | \"end\" | \"stretch\" | \"baseline\";\n /** How children are spread along the row. */\n justify?: \"start\" | \"center\" | \"end\" | \"between\";\n /** Wrap onto new lines when space runs out. */\n wrap?: boolean;\n /** Neutral layout element to render (never an interactive one). */\n as?: \"div\" | \"section\" | \"ul\" | \"ol\" | \"nav\" | \"aside\" | \"header\" | \"footer\" | \"span\";\n /** Added to the root element, for layout. */\n className?: string;\n /** Layout only. */\n style?: CSSProperties;\n /** The elements to lay out in a row. */\n children?: ReactNode;\n /** Set on the root element, for tests. */\n \"data-testid\"?: string;\n}\n\n/** Horizontal layout with token gaps: a Stack in a row, its children centred unless `align` says otherwise. */\nexport const Inline = forwardRef<HTMLElement, InlineProps>(function Inline(\n { gap = \"3\", wrap = false, className, ...rest },\n ref,\n) {\n return (\n <Stack\n ref={ref}\n {...rest}\n gap={gap}\n direction=\"row\"\n className={`cy-inline${className ? ` ${className}` : \"\"}`}\n data-wrap={wrap ? \"\" : undefined}\n />\n );\n});\n"],"mappings":";;;;AA0BA,IAAaG,IAASF,EAAqC,SACzD,EAAE,KAAAG,IAAM,KAAK,MAAAC,IAAO,IAAO,WAAAC,GAAW,GAAGC,EAAA,GACzCC,GACA;AACA,SACE,gBAAAN,EAACF,GAAD;AAAA,IACO,KAAAQ;AAAA,IACL,GAAID;AAAA,IACC,KAAAH;AAAA,IACL,WAAU;AAAA,IACV,WAAW,YAAYE,IAAY,IAAIA,CAAA,KAAc,EAAA;AAAA,IACrD,aAAWD,IAAO,KAAK;AAAA,EACxB,CAAA;AAEL,CAAC"}
|
|
@@ -16,9 +16,11 @@ export interface KbdProps {
|
|
|
16
16
|
* names (Cmd on Apple, Ctrl elsewhere) and hidden on touch-only screens, where a shortcut means nothing.
|
|
17
17
|
*/
|
|
18
18
|
keys: string[] | string;
|
|
19
|
+
/** Size of the key caps. Default "md". */
|
|
19
20
|
size?: Size;
|
|
20
21
|
/** Override the spoken text (default "Control plus K"). */
|
|
21
22
|
label?: string;
|
|
23
|
+
/** Added to the root element, for layout. */
|
|
22
24
|
className?: string;
|
|
23
25
|
/** Layout only. */
|
|
24
26
|
style?: CSSProperties;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Kbd.js","names":["useClientLayoutEffect","isApple","shortcutKeys","Fragment","useState","jsx","jsxs","SPOKEN","Kbd","keys","size","label","className","style","apple","useApple","caps","spoken","k","key","i","setApple"],"sources":["../../../src/components/Kbd/Kbd.tsx"],"sourcesContent":["import { type CSSProperties, Fragment, useState } from \"react\";\nimport { useClientLayoutEffect } from \"../../foundations/client-layout-effect.js\";\nimport { isApple, shortcutKeys } from \"../../foundations/hotkey.js\";\nimport type { Size } from \"../../tokens/schema.js\";\n\nexport interface KbdTokens {\n radius: string;\n bg: string;\n border: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n kbd: KbdTokens;\n }\n}\n\nconst SPOKEN: Record<string, string> = {\n ctrl: \"Control\",\n control: \"Control\",\n cmd: \"Command\",\n command: \"Command\",\n meta: \"Command\",\n win: \"Windows\",\n alt: \"Alt\",\n option: \"Option\",\n opt: \"Option\",\n shift: \"Shift\",\n enter: \"Enter\",\n return: \"Return\",\n esc: \"Escape\",\n escape: \"Escape\",\n tab: \"Tab\",\n space: \"Space\",\n backspace: \"Backspace\",\n delete: \"Delete\",\n up: \"Up arrow\",\n down: \"Down arrow\",\n left: \"Left arrow\",\n right: \"Right arrow\",\n};\n\nexport interface KbdProps {\n /**\n * Keys in order, e.g. [\"Ctrl\", \"K\"]; or a shortcut as `useHotkey` writes it (\"mod+k\"), shown with this platform's\n * names (Cmd on Apple, Ctrl elsewhere) and hidden on touch-only screens, where a shortcut means nothing.\n */\n keys: string[] | string;\n size?: Size;\n /** Override the spoken text (default \"Control plus K\"). */\n label?: string;\n className?: string;\n /** Layout only. */\n style?: CSSProperties;\n}\n\n/** Keyboard shortcut: drawn key caps for sight, a spoken combination for screen readers. */\nexport function Kbd({ keys, size = \"md\", label, className, style }: KbdProps) {\n const apple = useApple();\n const caps = typeof keys === \"string\" ? shortcutKeys(keys, apple) : keys;\n const spoken = label ?? caps.map((k) => SPOKEN[k.toLowerCase()] ?? k).join(\" plus \");\n return (\n <kbd\n className={`cy-kbd${className ? ` ${className}` : \"\"}`}\n data-size={size}\n data-shortcut={typeof keys === \"string\" || undefined}\n style={style}\n >\n <span aria-hidden=\"true\" className=\"cy-reset cy-kbd-keys\">\n {caps.map((key, i) => (\n <Fragment key={`${key}-${i}`}>\n {i > 0 && <span className=\"cy-reset cy-kbd-join\" />}\n <kbd className=\"cy-kbd-key\">{key}</kbd>\n </Fragment>\n ))}\n </span>\n <span className=\"cy-visually-hidden\">{spoken}</span>\n </kbd>\n );\n}\n\n/** Apple or not, decided after hydration so the server and the first client render agree. */\nexport function useApple() {\n const [apple, setApple] = useState(false);\n useClientLayoutEffect(() => setApple(isApple()), []);\n return apple;\n}\n"],"mappings":";;;;;AAiBA,IAAMO,IAAiC;AAAA,EACrC,MAAM;AAAA,EACN,SAAS;AAAA,EACT,KAAK;AAAA,EACL,SAAS;AAAA,EACT,MAAM;AAAA,EACN,KAAK;AAAA,EACL,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,OAAO;AAAA,EACP,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AACT;
|
|
1
|
+
{"version":3,"file":"Kbd.js","names":["useClientLayoutEffect","isApple","shortcutKeys","Fragment","useState","jsx","jsxs","SPOKEN","Kbd","keys","size","label","className","style","apple","useApple","caps","spoken","k","key","i","setApple"],"sources":["../../../src/components/Kbd/Kbd.tsx"],"sourcesContent":["import { type CSSProperties, Fragment, useState } from \"react\";\nimport { useClientLayoutEffect } from \"../../foundations/client-layout-effect.js\";\nimport { isApple, shortcutKeys } from \"../../foundations/hotkey.js\";\nimport type { Size } from \"../../tokens/schema.js\";\n\nexport interface KbdTokens {\n radius: string;\n bg: string;\n border: string;\n}\n\ndeclare module \"../../tokens/schema.js\" {\n interface ComponentTokens {\n kbd: KbdTokens;\n }\n}\n\nconst SPOKEN: Record<string, string> = {\n ctrl: \"Control\",\n control: \"Control\",\n cmd: \"Command\",\n command: \"Command\",\n meta: \"Command\",\n win: \"Windows\",\n alt: \"Alt\",\n option: \"Option\",\n opt: \"Option\",\n shift: \"Shift\",\n enter: \"Enter\",\n return: \"Return\",\n esc: \"Escape\",\n escape: \"Escape\",\n tab: \"Tab\",\n space: \"Space\",\n backspace: \"Backspace\",\n delete: \"Delete\",\n up: \"Up arrow\",\n down: \"Down arrow\",\n left: \"Left arrow\",\n right: \"Right arrow\",\n};\n\nexport interface KbdProps {\n /**\n * Keys in order, e.g. [\"Ctrl\", \"K\"]; or a shortcut as `useHotkey` writes it (\"mod+k\"), shown with this platform's\n * names (Cmd on Apple, Ctrl elsewhere) and hidden on touch-only screens, where a shortcut means nothing.\n */\n keys: string[] | string;\n /** Size of the key caps. Default \"md\". */\n size?: Size;\n /** Override the spoken text (default \"Control plus K\"). */\n label?: string;\n /** Added to the root element, for layout. */\n className?: string;\n /** Layout only. */\n style?: CSSProperties;\n}\n\n/** Keyboard shortcut: drawn key caps for sight, a spoken combination for screen readers. */\nexport function Kbd({ keys, size = \"md\", label, className, style }: KbdProps) {\n const apple = useApple();\n const caps = typeof keys === \"string\" ? shortcutKeys(keys, apple) : keys;\n const spoken = label ?? caps.map((k) => SPOKEN[k.toLowerCase()] ?? k).join(\" plus \");\n return (\n <kbd\n className={`cy-kbd${className ? ` ${className}` : \"\"}`}\n data-size={size}\n data-shortcut={typeof keys === \"string\" || undefined}\n style={style}\n >\n <span aria-hidden=\"true\" className=\"cy-reset cy-kbd-keys\">\n {caps.map((key, i) => (\n <Fragment key={`${key}-${i}`}>\n {i > 0 && <span className=\"cy-reset cy-kbd-join\" />}\n <kbd className=\"cy-kbd-key\">{key}</kbd>\n </Fragment>\n ))}\n </span>\n <span className=\"cy-visually-hidden\">{spoken}</span>\n </kbd>\n );\n}\n\n/** Apple or not, decided after hydration so the server and the first client render agree. */\nexport function useApple() {\n const [apple, setApple] = useState(false);\n useClientLayoutEffect(() => setApple(isApple()), []);\n return apple;\n}\n"],"mappings":";;;;;AAiBA,IAAMO,IAAiC;AAAA,EACrC,MAAM;AAAA,EACN,SAAS;AAAA,EACT,KAAK;AAAA,EACL,SAAS;AAAA,EACT,MAAM;AAAA,EACN,KAAK;AAAA,EACL,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,OAAO;AAAA,EACP,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AACT;AAmBA,SAAgBC,EAAI,EAAE,MAAAC,GAAM,MAAAC,IAAO,MAAM,OAAAC,GAAO,WAAAC,GAAW,OAAAC,EAAA,GAAmB;AAC5E,QAAMC,IAAQC,EAAS,GACjBC,IAAO,OAAOP,KAAS,WAAWP,EAAaO,GAAMK,CAAK,IAAIL,GAC9DQ,IAASN,KAASK,EAAK,IAAA,CAAKE,MAAMX,EAAOW,EAAE,YAAY,CAAA,KAAMA,CAAC,EAAE,KAAK,QAAQ;AACnF,SACE,gBAAAZ,EAAC,OAAD;AAAA,IACE,WAAW,SAASM,IAAY,IAAIA,CAAA,KAAc,EAAA;AAAA,IAClD,aAAWF;AAAA,IACX,iBAAe,OAAOD,KAAS,YAAY;AAAA,IACpC,OAAAI;AAAA,IAJT,UAAA,CAME,gBAAAR,EAAC,QAAD;AAAA,MAAM,eAAY;AAAA,MAAO,WAAU;AAAA,MAChC,UAAAW,EAAK,IAAA,CAAKG,GAAKC,MACd,gBAAAd,EAACH,GAAD,EAAA,UAAA,CACGiB,IAAI,KAAK,gBAAAf,EAAC,QAAD,EAAM,WAAU,uBAAwB,CAAA,GAClD,gBAAAA,EAAC,OAAD;AAAA,QAAK,WAAU;AAAA,QAAc,UAAAc;AAAA,MAAS,CAAA,CAC9B,EAAA,GAHK,GAAGA,CAAA,IAAOC,CAAA,EAGf,CACX;AAAA,IACG,CAAA,GACN,gBAAAf,EAAC,QAAD;AAAA,MAAM,WAAU;AAAA,MAAsB,UAAAY;AAAA,IAAa,CAAA,CAChD;AAAA,E;AAET;AAGA,SAAgBF,IAAW;AACzB,QAAM,CAACD,GAAOO,CAAA,IAAYjB,EAAS,EAAK;AACxC,SAAAJ,EAAA,MAA4BqB,EAASpB,EAAQ,CAAC,GAAG,CAAC,CAAC,GAC5Ca;AACT"}
|
|
@@ -36,8 +36,11 @@ export interface KeyValueEditorLabels {
|
|
|
36
36
|
export interface KeyValueEditorProps {
|
|
37
37
|
/** What the pairs are ("Headers", "Query parameters"). Names the list and the text view. */
|
|
38
38
|
label: string;
|
|
39
|
+
/** The pairs, when you control them. */
|
|
39
40
|
pairs?: KeyValuePair[] | undefined;
|
|
41
|
+
/** Starting pairs when uncontrolled. */
|
|
40
42
|
defaultPairs?: KeyValuePair[];
|
|
43
|
+
/** Called with the full list after each change: an edit, a row added, removed, moved or switched off. */
|
|
41
44
|
onChange?: ((pairs: KeyValuePair[]) => void) | undefined;
|
|
42
45
|
/** A checkbox per row to switch it off without deleting it. Default true. */
|
|
43
46
|
toggleable?: boolean;
|
|
@@ -47,9 +50,13 @@ export interface KeyValueEditorProps {
|
|
|
47
50
|
allowFiles?: boolean;
|
|
48
51
|
/** File types for `allowFiles`, as for `<input accept>`. */
|
|
49
52
|
accept?: string | undefined;
|
|
53
|
+
/** Turns off every field and button. */
|
|
50
54
|
disabled?: boolean;
|
|
55
|
+
/** Size of the fields and buttons. Default "md". */
|
|
51
56
|
size?: Size;
|
|
57
|
+
/** Replace the built-in English text. */
|
|
52
58
|
labels?: Partial<KeyValueEditorLabels>;
|
|
59
|
+
/** Added to the root element, for layout. */
|
|
53
60
|
className?: string;
|
|
54
61
|
/** Layout only. Restyle through --cy-key-value-editor-* tokens. */
|
|
55
62
|
style?: CSSProperties;
|