@crewlethq/ui 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 +1714 -14
- package/dist/Accordion/Accordion.d.ts +54 -0
- package/dist/Accordion/index.d.ts +4 -0
- package/dist/Accordion/index.js +6 -0
- package/dist/Accordion-ZI2WLD5C.css +87 -0
- package/dist/AddPill/AddPill.d.ts +114 -0
- package/dist/AddPill/index.d.ts +3 -0
- package/dist/AddPill/index.js +3 -0
- package/dist/AddPill-DFWXYLIQ.css +434 -0
- package/dist/Announcer/Announcer.d.ts +15 -0
- package/dist/Announcer/index.d.ts +2 -0
- package/dist/Announcer/index.js +3 -0
- package/dist/AppShell/AppShell.d.ts +193 -0
- package/dist/AppShell/index.d.ts +3 -0
- package/dist/AppShell/index.js +6 -0
- package/dist/AppShell-NVE6LHNI.css +395 -0
- package/dist/Avatar/Avatar.d.ts +104 -0
- package/dist/Avatar/index.d.ts +3 -0
- package/dist/Avatar/index.js +2 -0
- package/dist/Avatar-P2KRQM2B.css +156 -0
- package/dist/BrandLockup/BrandLockup.d.ts +41 -0
- package/dist/BrandLockup/index.d.ts +3 -0
- package/dist/BrandLockup/index.js +2 -0
- package/dist/BrandLockup-6ISDEHPJ.css +108 -0
- package/dist/Button/Button.d.ts +88 -0
- package/dist/Button/index.d.ts +3 -0
- package/dist/Button/index.js +3 -0
- package/dist/Button-D4J6B4MA.css +302 -0
- package/dist/CalendarGrid/CalendarGrid.d.ts +87 -0
- package/dist/CalendarGrid/index.d.ts +3 -0
- package/dist/CalendarGrid/index.js +2 -0
- package/dist/CalendarGrid-V6TQ5QKS.css +128 -0
- package/dist/Callout/Callout.d.ts +47 -0
- package/dist/Callout/index.d.ts +3 -0
- package/dist/Callout/index.js +2 -0
- package/dist/Callout-S7QDWHDL.css +111 -0
- package/dist/Canvas/Canvas.d.ts +234 -0
- package/dist/Canvas/geometry.d.ts +249 -0
- package/dist/Canvas/index.d.ts +5 -0
- package/dist/Canvas/index.js +8 -0
- package/dist/Canvas/layerNode.d.ts +20 -0
- package/dist/Canvas-Q6JETCWR.css +315 -0
- package/dist/Card/Card.d.ts +164 -0
- package/dist/Card/headerSlot.d.ts +65 -0
- package/dist/Card/index.d.ts +5 -0
- package/dist/Card/index.js +6 -0
- package/dist/Card-RLR254LD.css +450 -0
- package/dist/Charts/ActivityStrip.d.ts +45 -0
- package/dist/Charts/BarList.d.ts +51 -0
- package/dist/Charts/Legend.d.ts +32 -0
- package/dist/Charts/StackedBar.d.ts +38 -0
- package/dist/Charts/TimeSeries.d.ts +92 -0
- package/dist/Charts/dataColor.d.ts +20 -0
- package/dist/Charts/index.d.ts +12 -0
- package/dist/Charts/index.js +3 -0
- package/dist/Charts-D7G2BSXH.css +277 -0
- package/dist/Checkbox/Checkbox.d.ts +45 -0
- package/dist/Checkbox/index.d.ts +3 -0
- package/dist/Checkbox/index.js +2 -0
- package/dist/Checkbox-VGW26YLQ.css +111 -0
- package/dist/CodeBlock/CodeBlock.d.ts +119 -0
- package/dist/CodeBlock/index.d.ts +3 -0
- package/dist/CodeBlock/index.js +7 -0
- package/dist/CodeBlock-GYNJ2HI6.css +188 -0
- package/dist/Combobox/Combobox.d.ts +89 -0
- package/dist/Combobox/index.d.ts +3 -0
- package/dist/Combobox/index.js +8 -0
- package/dist/Combobox-4FUVYIE7.css +80 -0
- package/dist/CommandPalette/CommandPalette.d.ts +77 -0
- package/dist/CommandPalette/index.d.ts +3 -0
- package/dist/CommandPalette/index.js +11 -0
- package/dist/CommandPalette-CSJDUCQA.css +115 -0
- package/dist/Container/Container.d.ts +17 -0
- package/dist/Container/index.d.ts +3 -0
- package/dist/Container/index.js +2 -0
- package/dist/Container-3TSKMGNI.css +52 -0
- package/dist/Copyable/CopyButton.d.ts +64 -0
- package/dist/Copyable/Copyable.d.ts +42 -0
- package/dist/Copyable/index.d.ts +5 -0
- package/dist/Copyable/index.js +6 -0
- package/dist/Copyable-5PNRFOLS.css +125 -0
- package/dist/Count/Count.d.ts +24 -0
- package/dist/Count/index.d.ts +3 -0
- package/dist/Count/index.js +3 -0
- package/dist/Count-ZVCJ6VPD.css +20 -0
- package/dist/DataTable/CopyableCell.d.ts +12 -0
- package/dist/DataTable/DataTable.d.ts +615 -0
- package/dist/DataTable/RowActionsMenu.d.ts +7 -0
- package/dist/DataTable/index.d.ts +7 -0
- package/dist/DataTable/index.js +14 -0
- package/dist/DataTable-ITNACQ2X.css +2020 -0
- package/dist/DataView/DataView.d.ts +109 -0
- package/dist/DataView/DataViewToolbar.d.ts +87 -0
- package/dist/DataView/FilterAxisBar.d.ts +103 -0
- package/dist/DataView/columns.d.ts +35 -0
- package/dist/DataView/filters.d.ts +184 -0
- package/dist/DataView/index.d.ts +11 -0
- package/dist/DataView/index.js +25 -0
- package/dist/DataView-256YF32J.css +441 -0
- package/dist/DateTimePicker/DateTimePicker.d.ts +91 -0
- package/dist/DateTimePicker/index.d.ts +3 -0
- package/dist/DateTimePicker/index.js +9 -0
- package/dist/DateTimePicker-22VNXRWC.css +199 -0
- package/dist/DescriptionList/DescriptionList.d.ts +36 -0
- package/dist/DescriptionList/index.d.ts +3 -0
- package/dist/DescriptionList/index.js +2 -0
- package/dist/DescriptionList-YYY3V3O6.css +59 -0
- package/dist/DiffList/DiffList.d.ts +47 -0
- package/dist/DiffList/index.d.ts +3 -0
- package/dist/DiffList/index.js +3 -0
- package/dist/DiffList-3EX64AAE.css +94 -0
- package/dist/Disclosure/Disclosure.d.ts +56 -0
- package/dist/Disclosure/anatomy.d.ts +43 -0
- package/dist/Disclosure/index.d.ts +5 -0
- package/dist/Disclosure/index.js +6 -0
- package/dist/Disclosure-VKBJJIZ7.css +176 -0
- package/dist/EmptyState/EmptyState.d.ts +39 -0
- package/dist/EmptyState/index.d.ts +3 -0
- package/dist/EmptyState/index.js +3 -0
- package/dist/EmptyState-C6HRBGT7.css +73 -0
- package/dist/EmptyValue/EmptyValue.d.ts +31 -0
- package/dist/EmptyValue/index.d.ts +3 -0
- package/dist/EmptyValue/index.js +3 -0
- package/dist/EmptyValue-4B6ODXHT.css +12 -0
- package/dist/EntityChip/EntityChip.d.ts +40 -0
- package/dist/EntityChip/index.d.ts +3 -0
- package/dist/EntityChip/index.js +3 -0
- package/dist/EntityChip-LUCPZBBG.css +64 -0
- package/dist/ErrorBoundary/ErrorBoundary.d.ts +58 -0
- package/dist/ErrorBoundary/index.d.ts +3 -0
- package/dist/ErrorBoundary/index.js +4 -0
- package/dist/ErrorBoundary-ME36CQTA.css +59 -0
- package/dist/Eyebrow/Eyebrow.d.ts +18 -0
- package/dist/Eyebrow/index.d.ts +3 -0
- package/dist/Eyebrow/index.js +2 -0
- package/dist/Eyebrow-5NREGHQH.css +46 -0
- package/dist/FilterChip/FilterChip.d.ts +100 -0
- package/dist/FilterChip/index.d.ts +3 -0
- package/dist/FilterChip/index.js +3 -0
- package/dist/FilterChip-GTGLLOXE.css +107 -0
- package/dist/Fullscreen/index.d.ts +2 -0
- package/dist/Fullscreen/index.js +1 -0
- package/dist/Fullscreen/useFullscreen.d.ts +32 -0
- package/dist/IconButton/IconButton.d.ts +45 -0
- package/dist/IconButton/index.d.ts +3 -0
- package/dist/IconButton/index.js +3 -0
- package/dist/IconButton-VQGNMJDI.css +158 -0
- package/dist/ImageUpload/ImageUpload.d.ts +37 -0
- package/dist/ImageUpload/index.d.ts +3 -0
- package/dist/ImageUpload/index.js +3 -0
- package/dist/ImageUpload-HKFIZR6D.css +193 -0
- package/dist/InlineCode/InlineCode.d.ts +37 -0
- package/dist/InlineCode/index.d.ts +3 -0
- package/dist/InlineCode/index.js +2 -0
- package/dist/InlineCode-6WSR5COL.css +65 -0
- package/dist/Input/FormField.d.ts +61 -0
- package/dist/Input/FormRow.d.ts +6 -0
- package/dist/Input/FormSection.d.ts +28 -0
- package/dist/Input/Input.d.ts +98 -0
- package/dist/Input/Label.d.ts +31 -0
- package/dist/Input/ReadOnlyField.d.ts +30 -0
- package/dist/Input/Textarea.d.ts +16 -0
- package/dist/Input/index.d.ts +15 -0
- package/dist/Input/index.js +5 -0
- package/dist/Input-2PU5CPKK.css +616 -0
- package/dist/Kbd/Kbd.d.ts +40 -0
- package/dist/Kbd/index.d.ts +3 -0
- package/dist/Kbd/index.js +3 -0
- package/dist/Kbd-W66MXQI5.css +61 -0
- package/dist/Layer/LayerHost.d.ts +23 -0
- package/dist/Layer/index.d.ts +7 -0
- package/dist/Layer/index.js +3 -0
- package/dist/Layer/place.d.ts +63 -0
- package/dist/Layer/stack.d.ts +159 -0
- package/dist/Layer-NAFSGCFA.css +23 -0
- package/dist/Layout/Layout.d.ts +104 -0
- package/dist/Layout/index.d.ts +3 -0
- package/dist/Layout/index.js +2 -0
- package/dist/Layout-2ZCV3IGF.css +171 -0
- package/dist/Link/Link.d.ts +45 -0
- package/dist/Link/index.d.ts +3 -0
- package/dist/Link/index.js +3 -0
- package/dist/Link-6BEFNMN2.css +80 -0
- package/dist/List/List.d.ts +73 -0
- package/dist/List/index.d.ts +3 -0
- package/dist/List/index.js +3 -0
- package/dist/List-XTHESXLR.css +161 -0
- package/dist/ListInput/ListInput.d.ts +68 -0
- package/dist/ListInput/index.d.ts +3 -0
- package/dist/ListInput/index.js +10 -0
- package/dist/ListInput-O7LJKOIG.css +147 -0
- package/dist/Listbox/index.d.ts +5 -0
- package/dist/Listbox/index.js +2 -0
- package/dist/Listbox/useListbox.d.ts +97 -0
- package/dist/Listbox/useOptionKeys.d.ts +64 -0
- package/dist/Listbox-X2DOTSQA.css +110 -0
- package/dist/Menu/Menu.d.ts +118 -0
- package/dist/Menu/index.d.ts +3 -0
- package/dist/Menu/index.js +7 -0
- package/dist/Menu-6DE7I66I.css +222 -0
- package/dist/Meter/Meter.d.ts +126 -0
- package/dist/Meter/index.d.ts +3 -0
- package/dist/Meter/index.js +3 -0
- package/dist/Meter-SKOOXQBC.css +87 -0
- package/dist/Modal/ConfirmModal.d.ts +74 -0
- package/dist/Modal/Modal.d.ts +154 -0
- package/dist/Modal/index.d.ts +5 -0
- package/dist/Modal/index.js +8 -0
- package/dist/Modal-XYQJ4BL6.css +484 -0
- package/dist/NewItemsNotice/NewItemsNotice.d.ts +28 -0
- package/dist/NewItemsNotice/index.d.ts +3 -0
- package/dist/NewItemsNotice/index.js +4 -0
- package/dist/NewItemsNotice-T4DSSPVV.css +60 -0
- package/dist/OrgLabel/OrgLabel.d.ts +117 -0
- package/dist/OrgLabel/index.d.ts +3 -0
- package/dist/OrgLabel/index.js +2 -0
- package/dist/OrgLabel-D7U6QJZD.css +293 -0
- package/dist/OrgNode/OrgNode.d.ts +103 -0
- package/dist/OrgNode/index.d.ts +3 -0
- package/dist/OrgNode/index.js +3 -0
- package/dist/OrgNode-BT7T2Q2X.css +214 -0
- package/dist/OrgTable/OrgTable.d.ts +113 -0
- package/dist/OrgTable/index.d.ts +3 -0
- package/dist/OrgTable/index.js +11 -0
- package/dist/OrgTable-VWMFC3TB.css +360 -0
- package/dist/PageHeader/PageHeader.d.ts +35 -0
- package/dist/PageHeader/index.d.ts +3 -0
- package/dist/PageHeader/index.js +3 -0
- package/dist/PageHeader-6EYWQXRE.css +88 -0
- package/dist/Popover/Popover.d.ts +91 -0
- package/dist/Popover/index.d.ts +3 -0
- package/dist/Popover/index.js +4 -0
- package/dist/Popover-WJGCF3ZQ.css +185 -0
- package/dist/PricingCard/PricingCard.d.ts +56 -0
- package/dist/PricingCard/index.d.ts +3 -0
- package/dist/PricingCard/index.js +4 -0
- package/dist/PricingCard-JFI7RYXP.css +278 -0
- package/dist/Prose/Prose.d.ts +33 -0
- package/dist/Prose/index.d.ts +3 -0
- package/dist/Prose/index.js +2 -0
- package/dist/Prose-BTXNFT2Q.css +99 -0
- package/dist/RelativeTime/RelativeTime.d.ts +31 -0
- package/dist/RelativeTime/clock.d.ts +9 -0
- package/dist/RelativeTime/format.d.ts +38 -0
- package/dist/RelativeTime/index.d.ts +6 -0
- package/dist/RelativeTime/index.js +4 -0
- package/dist/RelativeTime-EBAQPGO2.css +10 -0
- package/dist/SearchTrigger/SearchTrigger.d.ts +29 -0
- package/dist/SearchTrigger/index.d.ts +3 -0
- package/dist/SearchTrigger/index.js +2 -0
- package/dist/SearchTrigger-QXOYAUUY.css +79 -0
- package/dist/Section/Section.d.ts +41 -0
- package/dist/Section/index.d.ts +3 -0
- package/dist/Section/index.js +3 -0
- package/dist/Section-QRUPRIQ2.css +127 -0
- package/dist/SegmentedControl/SegmentedControl.d.ts +101 -0
- package/dist/SegmentedControl/index.d.ts +4 -0
- package/dist/SegmentedControl/index.js +5 -0
- package/dist/SegmentedControl-X3BI3XU4.css +68 -0
- package/dist/Select/Select.d.ts +153 -0
- package/dist/Select/index.d.ts +3 -0
- package/dist/Select/index.js +5 -0
- package/dist/Select-2X77FSWR.css +350 -0
- package/dist/Shortcut/index.d.ts +2 -0
- package/dist/Shortcut/index.js +4 -0
- package/dist/Shortcut/useShortcut.d.ts +68 -0
- package/dist/SidebarNav/SidebarNav.d.ts +117 -0
- package/dist/SidebarNav/index.d.ts +3 -0
- package/dist/SidebarNav/index.js +3 -0
- package/dist/SidebarNav-QGSFKZYA.css +319 -0
- package/dist/Skeleton/Skeleton.d.ts +50 -0
- package/dist/Skeleton/index.d.ts +3 -0
- package/dist/Skeleton/index.js +3 -0
- package/dist/Skeleton-V735HRGM.css +421 -0
- package/dist/StatCard/StatCard.d.ts +56 -0
- package/dist/StatCard/index.d.ts +3 -0
- package/dist/StatCard/index.js +3 -0
- package/dist/StatCard-KYPKZUWX.css +111 -0
- package/dist/StatGroup/StatGroup.d.ts +20 -0
- package/dist/StatGroup/index.d.ts +3 -0
- package/dist/StatGroup/index.js +2 -0
- package/dist/StatGroup-TGB6AEKM.css +80 -0
- package/dist/StatusDot/StatusDot.d.ts +25 -0
- package/dist/StatusDot/index.d.ts +3 -0
- package/dist/StatusDot/index.js +2 -0
- package/dist/StatusDot-HA2L2FSX.css +84 -0
- package/dist/Switch/Switch.d.ts +38 -0
- package/dist/Switch/index.d.ts +3 -0
- package/dist/Switch/index.js +2 -0
- package/dist/Switch-U4OWK4CL.css +169 -0
- package/dist/Table/Table.d.ts +51 -0
- package/dist/Table/index.d.ts +3 -0
- package/dist/Table/index.js +3 -0
- package/dist/Table-MDOLVUAW.css +159 -0
- package/dist/Tabs/Tabs.d.ts +97 -0
- package/dist/Tabs/index.d.ts +3 -0
- package/dist/Tabs/index.js +4 -0
- package/dist/Tabs/roving.d.ts +67 -0
- package/dist/Tabs-VLICJFVB.css +275 -0
- package/dist/Tag/Tag.d.ts +107 -0
- package/dist/Tag/index.d.ts +3 -0
- package/dist/Tag/index.js +3 -0
- package/dist/Tag-VNZEYLB6.css +406 -0
- package/dist/TagGroup/TagGroup.d.ts +41 -0
- package/dist/TagGroup/index.d.ts +3 -0
- package/dist/TagGroup/index.js +4 -0
- package/dist/TagGroup-APC2EFH4.css +75 -0
- package/dist/TagsInput/TagsInput.d.ts +112 -0
- package/dist/TagsInput/index.d.ts +3 -0
- package/dist/TagsInput/index.js +10 -0
- package/dist/TagsInput-W4P36PRJ.css +168 -0
- package/dist/Text/Text.d.ts +67 -0
- package/dist/Text/index.d.ts +3 -0
- package/dist/Text/index.js +2 -0
- package/dist/Text-XIPYYZX2.css +154 -0
- package/dist/ThemeSwitcher/ThemeSwitcher.d.ts +47 -0
- package/dist/ThemeSwitcher/index.d.ts +4 -0
- package/dist/ThemeSwitcher/index.js +6 -0
- package/dist/ThemeSwitcher/preferences.d.ts +51 -0
- package/dist/TimeWindowPicker/TimeWindowPicker.d.ts +231 -0
- package/dist/TimeWindowPicker/index.d.ts +3 -0
- package/dist/TimeWindowPicker/index.js +13 -0
- package/dist/TimeWindowPicker/mask.d.ts +82 -0
- package/dist/TimeWindowPicker-7I7KWCMU.css +403 -0
- package/dist/Timeline/Timeline.d.ts +51 -0
- package/dist/Timeline/index.d.ts +3 -0
- package/dist/Timeline/index.js +3 -0
- package/dist/Timeline-27SYKOFX.css +144 -0
- package/dist/Toaster/Toaster.d.ts +108 -0
- package/dist/Toaster/index.d.ts +3 -0
- package/dist/Toaster/index.js +5 -0
- package/dist/Toaster-NVDCEIP5.css +306 -0
- package/dist/Toolbar/Toolbar.d.ts +62 -0
- package/dist/Toolbar/index.d.ts +3 -0
- package/dist/Toolbar/index.js +4 -0
- package/dist/Toolbar-IP6LXN45.css +48 -0
- package/dist/Tooltip/Tooltip.d.ts +51 -0
- package/dist/Tooltip/index.d.ts +3 -0
- package/dist/Tooltip/index.js +4 -0
- package/dist/Tooltip-LKQF7CE4.css +71 -0
- package/dist/Tree/index.d.ts +8 -0
- package/dist/Tree/index.js +1 -0
- package/dist/Tree/layout.d.ts +160 -0
- package/dist/Tree/model.d.ts +110 -0
- package/dist/Tree/useMeasuredSizes.d.ts +61 -0
- package/dist/Tree/useTreeState.d.ts +89 -0
- package/dist/TreeCanvas/TreeCanvas.d.ts +384 -0
- package/dist/TreeCanvas/index.d.ts +3 -0
- package/dist/TreeCanvas/index.js +10 -0
- package/dist/TreeCanvas/motion.d.ts +59 -0
- package/dist/TreeCanvas-WBNQPHC7.css +1098 -0
- package/dist/TreeGrid/TreeGrid.d.ts +142 -0
- package/dist/TreeGrid/index.d.ts +3 -0
- package/dist/TreeGrid/index.js +8 -0
- package/dist/TreeGrid-NSW7VMOX.css +132 -0
- package/dist/VisuallyHidden/VisuallyHidden.d.ts +23 -0
- package/dist/VisuallyHidden/index.d.ts +3 -0
- package/dist/VisuallyHidden/index.js +2 -0
- package/dist/VisuallyHidden-L552H7OA.css +21 -0
- package/dist/chunk-22O7LAW2.js +41 -0
- package/dist/chunk-23DHIMJA.js +38 -0
- package/dist/chunk-2EOKFKHX.js +263 -0
- package/dist/chunk-2HQR4U4D.js +143 -0
- package/dist/chunk-2PRH365R.js +74 -0
- package/dist/chunk-2ZQMA2WB.js +57 -0
- package/dist/chunk-34VGEDVV.js +907 -0
- package/dist/chunk-3CZ7XAVY.js +139 -0
- package/dist/chunk-3EYF6HKB.js +135 -0
- package/dist/chunk-3QRYCPXQ.js +116 -0
- package/dist/chunk-3ZP55QZE.js +40 -0
- package/dist/chunk-53DVJCVW.js +14 -0
- package/dist/chunk-5C5YMZQU.js +51 -0
- package/dist/chunk-5EKIWVOR.js +132 -0
- package/dist/chunk-5KPQ6D7N.js +54 -0
- package/dist/chunk-5SDBMKUO.js +297 -0
- package/dist/chunk-5VNUYO76.js +62 -0
- package/dist/chunk-5WS6L6FA.js +114 -0
- package/dist/chunk-6ZFVFA56.js +108 -0
- package/dist/chunk-7EM5T4ME.js +39 -0
- package/dist/chunk-7FZ53WDJ.js +163 -0
- package/dist/chunk-7HPRF5XN.js +525 -0
- package/dist/chunk-7RPGY3JE.js +43 -0
- package/dist/chunk-A2UXBCLO.js +48 -0
- package/dist/chunk-AV2DXAEL.js +27 -0
- package/dist/chunk-BHHIIK3M.js +17 -0
- package/dist/chunk-BZFWDIV6.js +9 -0
- package/dist/chunk-BZYDZBAN.js +123 -0
- package/dist/chunk-CMEE37QJ.js +628 -0
- package/dist/chunk-D35VTV2Z.js +106 -0
- package/dist/chunk-DD5BBGBE.js +162 -0
- package/dist/chunk-EN6K2IFA.js +256 -0
- package/dist/chunk-ESCO4XYW.js +144 -0
- package/dist/chunk-EUCC37WY.js +14 -0
- package/dist/chunk-EV6IMYJ6.js +62 -0
- package/dist/chunk-F27EPQ7D.js +68 -0
- package/dist/chunk-F4PJZ4ED.js +245 -0
- package/dist/chunk-F6OE5FH3.js +49 -0
- package/dist/chunk-FBZAKNSX.js +263 -0
- package/dist/chunk-FEFTGVMF.js +46 -0
- package/dist/chunk-GTOUGQQK.js +147 -0
- package/dist/chunk-GXQ3B46I.js +216 -0
- package/dist/chunk-H4FBTAYS.js +130 -0
- package/dist/chunk-HOXGBLEY.js +37 -0
- package/dist/chunk-HQNHV7D6.js +54 -0
- package/dist/chunk-HZ5XZNPS.js +98 -0
- package/dist/chunk-IAJLHVUA.js +28 -0
- package/dist/chunk-IJ7QXNIJ.js +1 -0
- package/dist/chunk-ITHXJHBB.js +280 -0
- package/dist/chunk-JCSA3XVH.js +32 -0
- package/dist/chunk-KLJCCMF3.js +97 -0
- package/dist/chunk-LWKJQTOM.js +77 -0
- package/dist/chunk-MNAXYY3R.js +215 -0
- package/dist/chunk-NDCATSW7.js +229 -0
- package/dist/chunk-NN62JQLR.js +29 -0
- package/dist/chunk-NPZY6YYL.js +251 -0
- package/dist/chunk-NTRZGNEX.js +529 -0
- package/dist/chunk-O6232G37.js +273 -0
- package/dist/chunk-O67VF5MS.js +58 -0
- package/dist/chunk-ODEQTPFM.js +6 -0
- package/dist/chunk-OFHBK7RI.js +498 -0
- package/dist/chunk-PNFASD6F.js +98 -0
- package/dist/chunk-PQADV6P6.js +19 -0
- package/dist/chunk-PZSWF74H.js +15 -0
- package/dist/chunk-Q4ZPPART.js +26 -0
- package/dist/chunk-QEUY3A5P.js +186 -0
- package/dist/chunk-QNCVHRZL.js +17 -0
- package/dist/chunk-QVE4GJAT.js +15 -0
- package/dist/chunk-QYOFACSP.js +36 -0
- package/dist/chunk-RA2ULG6H.js +29 -0
- package/dist/chunk-RDGD7Z7I.js +350 -0
- package/dist/chunk-RK4XPHVG.js +16 -0
- package/dist/chunk-RSAQOKH3.js +38 -0
- package/dist/chunk-S2XHHEW4.js +84 -0
- package/dist/chunk-S4GZWSKR.js +137 -0
- package/dist/chunk-SFZOKW2G.js +52 -0
- package/dist/chunk-UG46QBLT.js +325 -0
- package/dist/chunk-UOGSZKLT.js +134 -0
- package/dist/chunk-V2XMNLMS.js +52 -0
- package/dist/chunk-W4ENKCXJ.js +40 -0
- package/dist/chunk-W5J7R5EB.js +107 -0
- package/dist/chunk-WNI2WSJF.js +27 -0
- package/dist/chunk-WOYYD2YR.js +823 -0
- package/dist/chunk-WQX73TWF.js +1652 -0
- package/dist/chunk-XDTYBF2F.js +36 -0
- package/dist/chunk-XN4JBAN3.js +32 -0
- package/dist/chunk-XV6WRMBC.js +211 -0
- package/dist/chunk-YLYOWZ4V.js +33 -0
- package/dist/chunk-YODNNSZL.js +63 -0
- package/dist/chunk-ZCR6YGQ4.js +1 -0
- package/dist/chunk-ZFATEERP.js +144 -0
- package/dist/generated/index.d.ts +83 -0
- package/dist/generated/index.js +91 -0
- package/dist/index.d.ts +1 -1217
- package/dist/index.js +91 -4518
- package/dist/styles.css +14898 -4274
- package/dist/utils/cx.d.ts +10 -0
- package/dist/utils/headingLevel.d.ts +16 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/tone.d.ts +25 -0
- package/dist/utils/useClipboard.d.ts +82 -0
- package/package.json +18 -10
- package/scripts/bundle-css.mjs +25 -0
- package/scripts/check-css-literals.mjs +166 -0
- package/scripts/check-css-variables.mjs +184 -0
- package/scripts/check-css.mjs +27 -0
- package/scripts/css-source.mjs +67 -0
- package/scripts/write-barrel.mjs +60 -0
- package/dist/Accordion-NIMJQIOI.css +0 -88
- package/dist/AppShell-ZW3NSFBP.css +0 -51
- package/dist/Avatar-V6NG6Q45.css +0 -67
- package/dist/Button-XGCTXXYP.css +0 -174
- package/dist/Callout-LEGDIMAM.css +0 -52
- package/dist/Card-BOZGBML7.css +0 -86
- package/dist/Checkbox-OCUICIIZ.css +0 -58
- package/dist/CodeBlock-IEMBNIQC.css +0 -90
- package/dist/Container-LTKBA2FW.css +0 -21
- package/dist/Copyable-IB57OTHZ.css +0 -123
- package/dist/DataTable-3GALZUW2.css +0 -1593
- package/dist/DateTimePicker-NMSSGVPK.css +0 -312
- package/dist/Eyebrow-AVBORAS2.css +0 -30
- package/dist/IconButton-GB4PJDG2.css +0 -82
- package/dist/ImageUpload-3HQDF2KC.css +0 -158
- package/dist/Input-ZHUTN7CU.css +0 -210
- package/dist/Kbd-Q77CDZY7.css +0 -23
- package/dist/Modal-FJVG66S4.css +0 -138
- package/dist/Popover-FUFULUE2.css +0 -123
- package/dist/PricingCard-NKYV3JHA.css +0 -238
- package/dist/Section-665ZIPG6.css +0 -20
- package/dist/Select-GPRF7PRB.css +0 -294
- package/dist/Skeleton-3WEFLRDN.css +0 -378
- package/dist/StatCard-RTJIVTRB.css +0 -50
- package/dist/Table-AR3TRY2E.css +0 -89
- package/dist/Tabs-XZ4JIH3E.css +0 -153
- package/dist/Tag-R5QDJLYJ.css +0 -163
- package/dist/TimeWindowPicker-L3G5Q7UT.css +0 -629
- package/dist/Toaster-2O65VOR4.css +0 -264
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A hierarchy as rows and columns: the view a keyboard or a screen reader user
|
|
3
|
+
* works fastest in, and the one a narrow screen falls back to.
|
|
4
|
+
*
|
|
5
|
+
* A TREEGRID, NOT A TREE. Every row says its level, position and expansion
|
|
6
|
+
* like a treeitem, and its cells are navigable like a grid's. A row holds
|
|
7
|
+
* focus by default and its keys act on the node (Enter activates, Delete or
|
|
8
|
+
* Backspace removes, the ContextMenu key or Shift+F10 opens its actions);
|
|
9
|
+
* Right opens a closed row or steps into its cells, Left steps back out,
|
|
10
|
+
* closes the row or climbs to its parent, Up and Down keep the column. A cell
|
|
11
|
+
* holding a control focuses the control itself, so what the cell does is one
|
|
12
|
+
* Enter away, and the grid's one tab stop is wherever focus is: a press that
|
|
13
|
+
* opens a cell's menu moves it to that cell, and the row's chevron, which is
|
|
14
|
+
* pointer only and hidden from assistive technology, takes no focus at all.
|
|
15
|
+
*
|
|
16
|
+
* NAVIGATION KEYS ARE CAPTURED, so they reach the grid before the control that
|
|
17
|
+
* holds focus in a cell: ArrowDown on a menu button would otherwise open the
|
|
18
|
+
* menu instead of moving to the next row. An open menu keeps its keys because
|
|
19
|
+
* it is in no row: it renders in the layer over the grid, and React carries
|
|
20
|
+
* its keys up through this handler with a target no row contains.
|
|
21
|
+
*
|
|
22
|
+
* THE MENUS OPEN OVER THE GRID, NOT INSIDE IT. The grid scrolls sideways at
|
|
23
|
+
* narrow widths, and a box that scrolls on one axis clips on both, so a menu
|
|
24
|
+
* drawn under its trigger in the last rows would be cut off and would scroll
|
|
25
|
+
* the grid down instead of opening. The frame publishes a LayerHost over the
|
|
26
|
+
* scroller, and a sideways scroll tells that layer so an open surface follows
|
|
27
|
+
* its trigger or closes with it.
|
|
28
|
+
*
|
|
29
|
+
* Ported from the generic half of the engine dashboard's org builder outline.
|
|
30
|
+
*/
|
|
31
|
+
import { type KeyboardEvent, type MouseEvent, type ReactNode, type Ref } from 'react';
|
|
32
|
+
import { type TreeInput, type TreeItemAction, type TreeViewHandle } from '../Tree/index.js';
|
|
33
|
+
export interface TreeGridColumn {
|
|
34
|
+
key: string;
|
|
35
|
+
/** The column's name. */
|
|
36
|
+
header: string;
|
|
37
|
+
/**
|
|
38
|
+
* Read but not seen, for a column whose heading would be noise in the sight
|
|
39
|
+
* of it and is still the only thing a screen reader has (an actions column).
|
|
40
|
+
*/
|
|
41
|
+
headerHidden?: boolean | undefined;
|
|
42
|
+
/** This column's grid track. One flexible column by default. */
|
|
43
|
+
width?: string | undefined;
|
|
44
|
+
}
|
|
45
|
+
/** A row that holds only controls, such as an inline Add row. */
|
|
46
|
+
export interface TreeGridAddRow {
|
|
47
|
+
/** The row's accessible name, since its cells are all controls: "Add to Platform". */
|
|
48
|
+
label: string;
|
|
49
|
+
/** How many cells it has, which is what End and Right count to. */
|
|
50
|
+
cells: number;
|
|
51
|
+
}
|
|
52
|
+
/** What a cell needs from the grid it is drawn in. */
|
|
53
|
+
export interface TreeGridContext {
|
|
54
|
+
expanded(id: string): boolean;
|
|
55
|
+
expandable(id: string): boolean;
|
|
56
|
+
toggle(id: string): void;
|
|
57
|
+
/**
|
|
58
|
+
* Whether this cell holds the grid's one tab stop. A control in a cell takes
|
|
59
|
+
* `tabIndex` from it; a cell with no control takes the stop itself.
|
|
60
|
+
*/
|
|
61
|
+
tabStop(id: string, column: number): boolean;
|
|
62
|
+
/** Says a press opened a control in this cell, so the tab stop follows focus into it. */
|
|
63
|
+
opened(id: string, column: number): void;
|
|
64
|
+
/**
|
|
65
|
+
* The props that make a press anywhere in a pointer-only strip land on the
|
|
66
|
+
* row rather than on the control it hit.
|
|
67
|
+
*/
|
|
68
|
+
press(id: string): {
|
|
69
|
+
onMouseDown(event: MouseEvent<HTMLElement>): void;
|
|
70
|
+
};
|
|
71
|
+
menuOpen(id: string): boolean;
|
|
72
|
+
setMenuOpen(id: string, open: boolean): void;
|
|
73
|
+
}
|
|
74
|
+
/** Every string the grid renders on its own. */
|
|
75
|
+
export interface TreeGridLabels {
|
|
76
|
+
/** The pointer-only chevron's tooltip, given the row's own label. */
|
|
77
|
+
expand: (label: string) => string;
|
|
78
|
+
collapse: (label: string) => string;
|
|
79
|
+
}
|
|
80
|
+
export interface TreeGridProps {
|
|
81
|
+
/** The accessible name of the grid, such as "Organization outline". */
|
|
82
|
+
label: string;
|
|
83
|
+
columns: readonly TreeGridColumn[];
|
|
84
|
+
/**
|
|
85
|
+
* The hierarchy: every row, nested. An add row is one of these too.
|
|
86
|
+
*
|
|
87
|
+
* Keep it stable across renders (a `useMemo` over what it is derived from).
|
|
88
|
+
* A fresh array each render rebuilds the model, and with it the visible
|
|
89
|
+
* order, on every push a parent takes.
|
|
90
|
+
*/
|
|
91
|
+
rows: readonly TreeInput[];
|
|
92
|
+
/**
|
|
93
|
+
* Draws one cell. `column` is its one based position, which is also its
|
|
94
|
+
* `aria-colindex`, so a caller reads its own `columns` by `column - 1`. The
|
|
95
|
+
* first cell is drawn after the chevron strip, inside the same cell.
|
|
96
|
+
*/
|
|
97
|
+
renderCell: (id: string, column: number, grid: TreeGridContext) => ReactNode;
|
|
98
|
+
/**
|
|
99
|
+
* Whether a cell holds a control that takes the grid's tab stop for itself
|
|
100
|
+
* (a menu trigger, a chooser, a button). It is asked per row as well as per
|
|
101
|
+
* column, because one column often holds a control on some rows and plain
|
|
102
|
+
* text on others.
|
|
103
|
+
*/
|
|
104
|
+
cellHasControl?: ((id: string, column: number) => boolean) | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* Carries out Enter (activate) or Delete and Backspace (remove) on a row.
|
|
107
|
+
* Return false when the row has no such action, so the key travels on.
|
|
108
|
+
*
|
|
109
|
+
* Called only while the ROW itself holds focus, never from inside a cell,
|
|
110
|
+
* and never on an add row. The Menu key is not here: which menu is open is
|
|
111
|
+
* this component's state, so it opens the row's own menu itself when
|
|
112
|
+
* `hasRowMenu` says there is one.
|
|
113
|
+
*/
|
|
114
|
+
onRowKey?: ((id: string, action: Exclude<TreeItemAction, 'menu'>) => boolean) | undefined;
|
|
115
|
+
/**
|
|
116
|
+
* Any other key the caller claims on a row, such as Alt with an arrow to
|
|
117
|
+
* reorder it. Asked FIRST, while the row itself holds focus, and never on an
|
|
118
|
+
* add row; return true when it was handled, and the grid swallows the key.
|
|
119
|
+
*/
|
|
120
|
+
onRowKeyDown?: ((id: string, event: KeyboardEvent<HTMLElement>) => boolean) | undefined;
|
|
121
|
+
/** Whether a row has a menu the ContextMenu key and Shift+F10 can open. */
|
|
122
|
+
hasRowMenu?: ((id: string) => boolean) | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* Whether a row is an add row, and what it is called. An add row is a row of
|
|
125
|
+
* the grid like any other, so it counts in its siblings' position and set
|
|
126
|
+
* size; it just holds controls rather than a node's own data.
|
|
127
|
+
*/
|
|
128
|
+
addRow?: ((id: string) => TreeGridAddRow | null) | undefined;
|
|
129
|
+
/** The selected row, drawn as `aria-selected`. */
|
|
130
|
+
selectedId?: string | null | undefined;
|
|
131
|
+
/**
|
|
132
|
+
* Selection follows focus. Called with every row focus reaches except an add
|
|
133
|
+
* row, which names no node.
|
|
134
|
+
*/
|
|
135
|
+
onSelect?: ((id: string) => void) | undefined;
|
|
136
|
+
/** Sets `aria-readonly`: the rows can be read and navigated but not edited. */
|
|
137
|
+
readOnly?: boolean | undefined;
|
|
138
|
+
labels?: Partial<TreeGridLabels> | undefined;
|
|
139
|
+
ref?: Ref<TreeViewHandle> | undefined;
|
|
140
|
+
className?: string | undefined;
|
|
141
|
+
}
|
|
142
|
+
export declare function TreeGrid({ label, columns, rows: forest, renderCell, cellHasControl, onRowKey, onRowKeyDown, hasRowMenu, addRow, selectedId, onSelect, readOnly, labels, ref, className, }: TreeGridProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { TreeGrid } from '../chunk-5SDBMKUO.js';
|
|
2
|
+
import '../chunk-NTRZGNEX.js';
|
|
3
|
+
import '../chunk-53DVJCVW.js';
|
|
4
|
+
import '../chunk-7RPGY3JE.js';
|
|
5
|
+
import '../chunk-ITHXJHBB.js';
|
|
6
|
+
import '../chunk-F27EPQ7D.js';
|
|
7
|
+
import '../chunk-BZFWDIV6.js';
|
|
8
|
+
import '../chunk-ODEQTPFM.js';
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* A hierarchy as rows and columns (TreeGrid.tsx).
|
|
3
|
+
*
|
|
4
|
+
* Each row is a grid on ONE column template, so the cells of every row line up
|
|
5
|
+
* without a table: a table row cannot be a focusable treegrid row with a
|
|
6
|
+
* level. The grid keeps a minimum width and scrolls sideways in its own box
|
|
7
|
+
* below that, so a phone width screen keeps every column readable and the page
|
|
8
|
+
* itself never scrolls sideways.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
.crewlet-tree-grid {
|
|
12
|
+
position: relative;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/*
|
|
16
|
+
* THE SCROLLER IS THE CONTAINING BLOCK OF WHAT IT HOLDS. A box that scrolls
|
|
17
|
+
* clips only the descendants whose containing block is inside it, so an
|
|
18
|
+
* absolutely positioned one (the screen-reader text of the last column's
|
|
19
|
+
* header, far right in a phone width grid) would be placed against the frame
|
|
20
|
+
* instead, escape the scroller, and give the page a sideways overflow as wide
|
|
21
|
+
* as the whole grid: hidden, but scrolled by a focus or a find in page, which
|
|
22
|
+
* pushes the page sideways. Positioned, the scroller keeps all of it.
|
|
23
|
+
*
|
|
24
|
+
* The two declarations belong together, and the component's suite holds them
|
|
25
|
+
* together: one without the other is the bug, not a style.
|
|
26
|
+
*/
|
|
27
|
+
.crewlet-tree-grid__scroller {
|
|
28
|
+
position: relative;
|
|
29
|
+
overflow-x: auto;
|
|
30
|
+
overscroll-behavior-x: contain;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.crewlet-tree-grid__grid {
|
|
34
|
+
min-width: var(--crewlet-tree-grid-min-width, 45rem);
|
|
35
|
+
font-size: var(--font-size-compact);
|
|
36
|
+
/*
|
|
37
|
+
* THE PANEL'S GROUND. It painted the step above it, which is the colour a
|
|
38
|
+
* hovered row takes elsewhere in the system: an outline sitting beside a
|
|
39
|
+
* table read as a table with every row hovered at once, and on a card it was
|
|
40
|
+
* a lighter block inside a darker frame for no stated reason.
|
|
41
|
+
*/
|
|
42
|
+
background: var(--color-surface-subtle);
|
|
43
|
+
border: 1px solid var(--color-border-default);
|
|
44
|
+
border-radius: var(--radius-lg);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.crewlet-tree-grid__row {
|
|
48
|
+
display: grid;
|
|
49
|
+
grid-template-columns: var(--crewlet-tree-grid-columns, minmax(0, 1fr));
|
|
50
|
+
align-items: center;
|
|
51
|
+
min-height: var(--size-row-md);
|
|
52
|
+
border-top: 1px solid var(--color-border-default);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/*
|
|
56
|
+
* THE HEAD IS THE TABLE'S HEADER REGISTER, in full. It spelled three of the
|
|
57
|
+
* register's five declarations and left the tracking and the case off, so a
|
|
58
|
+
* treegrid and a table standing on the same screen named their columns two
|
|
59
|
+
* different ways. It is one micro-label step, declared once, wherever a column
|
|
60
|
+
* is named.
|
|
61
|
+
*/
|
|
62
|
+
.crewlet-tree-grid__head .crewlet-tree-grid__row {
|
|
63
|
+
border-top: 0;
|
|
64
|
+
font-size: var(--font-size-2xs);
|
|
65
|
+
font-weight: var(--font-weight-medium);
|
|
66
|
+
letter-spacing: var(--font-letter-spacing-wide);
|
|
67
|
+
text-transform: uppercase;
|
|
68
|
+
color: var(--color-text-tertiary);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.crewlet-tree-grid__row > [role='columnheader'],
|
|
72
|
+
.crewlet-tree-grid__cell {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
gap: var(--spacing-2);
|
|
76
|
+
min-width: 0;
|
|
77
|
+
padding: 0 var(--spacing-2);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* The indent is the row's own level, set on the row. */
|
|
81
|
+
.crewlet-tree-grid__cell:first-child {
|
|
82
|
+
padding-inline-start: calc(var(--spacing-5) * var(--crewlet-tree-grid-depth, 0));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/*
|
|
86
|
+
* The chevron's place is held on every row, expandable or not, so a name never
|
|
87
|
+
* shifts sideways as a row gains or loses children.
|
|
88
|
+
*/
|
|
89
|
+
.crewlet-tree-grid__toggle {
|
|
90
|
+
display: inline-flex;
|
|
91
|
+
flex: none;
|
|
92
|
+
width: var(--size-control-sm);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/*
|
|
96
|
+
* OPENING A ROW TURNS THE CHEVRON, it does not swap it for another drawing.
|
|
97
|
+
* Two glyphs exchanged is a cut, and a row opening is the one movement this
|
|
98
|
+
* table has: the mark a reader is pointing at is the mark that moves. The
|
|
99
|
+
* drawing turns inside its control, so the control's own box, ground and focus
|
|
100
|
+
* ring stay square.
|
|
101
|
+
*/
|
|
102
|
+
.crewlet-tree-grid__toggle svg {
|
|
103
|
+
transition: transform var(--motion-duration-fast) var(--motion-easing-default);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.crewlet-tree-grid__toggle[data-open] svg {
|
|
107
|
+
transform: rotate(90deg);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/*
|
|
111
|
+
* A READER WHO ASKED FOR LESS gets the turn without the movement: the chevron
|
|
112
|
+
* still points at the row's state, it simply arrives there. Dropping the
|
|
113
|
+
* rotation as well would leave a closed and an open row drawn identically.
|
|
114
|
+
*/
|
|
115
|
+
@media (prefers-reduced-motion: reduce) {
|
|
116
|
+
.crewlet-tree-grid__toggle svg {
|
|
117
|
+
transition: none;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.crewlet-tree-grid__row:focus-visible,
|
|
122
|
+
.crewlet-tree-grid__cell:focus-visible {
|
|
123
|
+
outline: 2px solid var(--color-focus);
|
|
124
|
+
/* Inside a box that scrolls, an outset ring is clipped by the scroller on
|
|
125
|
+
the first and last rows and painted over by the next row. */
|
|
126
|
+
outline-offset: var(--size-focus-ring-inset-offset);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* The selection is where the reader is, so it takes the accent. */
|
|
130
|
+
.crewlet-tree-grid__row[aria-selected='true'] {
|
|
131
|
+
box-shadow: inset 2px 0 0 var(--color-brand-accent);
|
|
132
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ElementType, ReactNode } from 'react';
|
|
2
|
+
export interface VisuallyHiddenProps {
|
|
3
|
+
/** The element to draw. A span by default; a `li` inside a list, and so on. */
|
|
4
|
+
as?: ElementType | undefined;
|
|
5
|
+
/** For a sentence something else points at with aria-describedby. */
|
|
6
|
+
id?: string | undefined;
|
|
7
|
+
className?: string | undefined;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Words a screen reader reads and nobody sees.
|
|
12
|
+
*
|
|
13
|
+
* NOT `display: none`, and not `hidden`: both take the text out of the
|
|
14
|
+
* accessibility tree along with the picture, which is the opposite of the
|
|
15
|
+
* point. The clip rectangle is the one technique every assistive technology
|
|
16
|
+
* still reads, and it leaves the element in the layout at a size of one pixel
|
|
17
|
+
* rather than zero, because a zero-sized element is skipped by some of them.
|
|
18
|
+
*
|
|
19
|
+
* What it is for: the sentence beside a glyph that carries the meaning, the
|
|
20
|
+
* spoken form of a shortcut whose keycaps are drawn as symbols, the name of a
|
|
21
|
+
* column whose header is an icon, and the reason a disabled control gives.
|
|
22
|
+
*/
|
|
23
|
+
export declare function VisuallyHidden({ as: Tag, id, className, children }: VisuallyHiddenProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Hidden from the eye, read by everything else.
|
|
3
|
+
*
|
|
4
|
+
* The clip rectangle rather than `display: none` or `visibility: hidden`:
|
|
5
|
+
* those two remove the text from the accessibility tree as well as from the
|
|
6
|
+
* page. One pixel rather than zero, because a zero-sized element is skipped by
|
|
7
|
+
* some screen readers. `white-space: nowrap` stops a long sentence wrapping
|
|
8
|
+
* inside that pixel and being read a word at a time.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
.crewlet-visually-hidden {
|
|
12
|
+
position: absolute;
|
|
13
|
+
width: 1px;
|
|
14
|
+
height: 1px;
|
|
15
|
+
margin: -1px;
|
|
16
|
+
padding: 0;
|
|
17
|
+
border: 0;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
clip-path: inset(50%);
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { VisuallyHidden } from './chunk-BZFWDIV6.js';
|
|
2
|
+
import { cx } from './chunk-ODEQTPFM.js';
|
|
3
|
+
import './StatCard-KYPKZUWX.css';
|
|
4
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var StatCard = ({
|
|
7
|
+
label,
|
|
8
|
+
value,
|
|
9
|
+
unit,
|
|
10
|
+
sub,
|
|
11
|
+
icon,
|
|
12
|
+
tone = "neutral",
|
|
13
|
+
loading = false,
|
|
14
|
+
loadingLabel = "Loading",
|
|
15
|
+
flush = false,
|
|
16
|
+
className,
|
|
17
|
+
...rest
|
|
18
|
+
}) => /* @__PURE__ */ jsxs(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
...rest,
|
|
22
|
+
className: cx("crewlet-statcard", `crewlet-statcard--${tone}`, flush && "crewlet-statcard--flush", className),
|
|
23
|
+
"aria-busy": loading || void 0,
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ jsxs("div", { className: "crewlet-statcard__label", children: [
|
|
26
|
+
icon ? /* @__PURE__ */ jsx("span", { className: "crewlet-statcard__icon", "aria-hidden": true, children: icon }) : null,
|
|
27
|
+
label
|
|
28
|
+
] }),
|
|
29
|
+
/* @__PURE__ */ jsx("div", { className: "crewlet-statcard__value", children: loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
30
|
+
/* @__PURE__ */ jsx("span", { className: "crewlet-statcard__placeholder", "aria-hidden": true }),
|
|
31
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { children: loadingLabel })
|
|
32
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
33
|
+
value,
|
|
34
|
+
unit ? /* @__PURE__ */ jsx("span", { className: "crewlet-statcard__unit", children: unit }) : null
|
|
35
|
+
] }) }),
|
|
36
|
+
/* @__PURE__ */ jsx("div", { className: "crewlet-statcard__sub", children: sub })
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export { StatCard };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { cx } from './chunk-ODEQTPFM.js';
|
|
2
|
+
import './Text-XIPYYZX2.css';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
function Text({
|
|
6
|
+
as: Tag = "span",
|
|
7
|
+
variant = "body",
|
|
8
|
+
tone,
|
|
9
|
+
mono = false,
|
|
10
|
+
numeric = false,
|
|
11
|
+
truncate = false,
|
|
12
|
+
clamp,
|
|
13
|
+
measure,
|
|
14
|
+
className,
|
|
15
|
+
children,
|
|
16
|
+
...rest
|
|
17
|
+
}) {
|
|
18
|
+
return /* @__PURE__ */ jsx(
|
|
19
|
+
Tag,
|
|
20
|
+
{
|
|
21
|
+
...rest,
|
|
22
|
+
className: cx(
|
|
23
|
+
"crewlet-text",
|
|
24
|
+
`crewlet-text--${variant}`,
|
|
25
|
+
tone && `crewlet-text--tone-${tone}`,
|
|
26
|
+
mono && "crewlet-text--mono",
|
|
27
|
+
numeric && "crewlet-text--numeric",
|
|
28
|
+
truncate && "crewlet-text--truncate",
|
|
29
|
+
clamp !== void 0 && `crewlet-text--clamp-${clamp}`,
|
|
30
|
+
measure && `crewlet-text--measure-${measure}`,
|
|
31
|
+
className
|
|
32
|
+
),
|
|
33
|
+
children
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { Text };
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { HeadingLevelProvider } from './chunk-PQADV6P6.js';
|
|
2
|
+
import { useLayerContainer } from './chunk-7RPGY3JE.js';
|
|
3
|
+
import { focusables, useModalLayer, useBodyScrollLock } from './chunk-ITHXJHBB.js';
|
|
4
|
+
import { IconButton } from './chunk-F27EPQ7D.js';
|
|
5
|
+
import { Button } from './chunk-BZYDZBAN.js';
|
|
6
|
+
import { cx } from './chunk-ODEQTPFM.js';
|
|
7
|
+
import './Modal-XYQJ4BL6.css';
|
|
8
|
+
import { useId, useRef, useCallback } from 'react';
|
|
9
|
+
import { createPortal } from 'react-dom';
|
|
10
|
+
import { CloseGlyph } from '@crewlethq/icons/glyphs';
|
|
11
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
12
|
+
|
|
13
|
+
function Modal({ open, ...rest }) {
|
|
14
|
+
const container = useLayerContainer();
|
|
15
|
+
return open && container ? /* @__PURE__ */ jsx(ModalFrame, { container, ...rest }, hostKey(container)) : null;
|
|
16
|
+
}
|
|
17
|
+
var hostKeys = /* @__PURE__ */ new WeakMap();
|
|
18
|
+
var hostsSeen = 0;
|
|
19
|
+
function hostKey(host) {
|
|
20
|
+
const known = hostKeys.get(host);
|
|
21
|
+
if (known !== void 0) return known;
|
|
22
|
+
hostsSeen += 1;
|
|
23
|
+
hostKeys.set(host, hostsSeen);
|
|
24
|
+
return hostsSeen;
|
|
25
|
+
}
|
|
26
|
+
function given(node) {
|
|
27
|
+
return node !== void 0 && node !== null && node !== false && node !== "";
|
|
28
|
+
}
|
|
29
|
+
function ModalFrame({
|
|
30
|
+
container,
|
|
31
|
+
onClose,
|
|
32
|
+
title,
|
|
33
|
+
subtitle,
|
|
34
|
+
icon,
|
|
35
|
+
footer,
|
|
36
|
+
footerStart,
|
|
37
|
+
headerActions,
|
|
38
|
+
children,
|
|
39
|
+
size = "sm",
|
|
40
|
+
variant = "dialog",
|
|
41
|
+
shape = "framed",
|
|
42
|
+
placement,
|
|
43
|
+
role = "dialog",
|
|
44
|
+
dismissable = true,
|
|
45
|
+
closeOnBackdrop = true,
|
|
46
|
+
showCloseButton = true,
|
|
47
|
+
stackBody = false,
|
|
48
|
+
flush = false,
|
|
49
|
+
className,
|
|
50
|
+
ariaLabel,
|
|
51
|
+
describedBy,
|
|
52
|
+
initialFocus,
|
|
53
|
+
onSubmit,
|
|
54
|
+
closeLabel = "Close",
|
|
55
|
+
closeDisabledReason = "Closing is unavailable until this finishes.",
|
|
56
|
+
...rest
|
|
57
|
+
}) {
|
|
58
|
+
const id = useId();
|
|
59
|
+
const titleId = `${id}-title`;
|
|
60
|
+
const subtitleId = `${id}-subtitle`;
|
|
61
|
+
const prompt = shape === "prompt" && variant === "dialog";
|
|
62
|
+
const banded = !prompt;
|
|
63
|
+
const sheet = variant === "sheet";
|
|
64
|
+
const place = placement ?? (prompt ? "center" : "top");
|
|
65
|
+
const frame = useRef(null);
|
|
66
|
+
const body = useRef(null);
|
|
67
|
+
const foot = useRef(null);
|
|
68
|
+
const start = useRef(initialFocus);
|
|
69
|
+
start.current = initialFocus;
|
|
70
|
+
const where = useCallback(() => {
|
|
71
|
+
const chosen = start.current?.();
|
|
72
|
+
if (chosen) return chosen;
|
|
73
|
+
const inBody = body.current ? focusables(body.current)[0] : void 0;
|
|
74
|
+
if (inBody) return inBody;
|
|
75
|
+
const inFoot = foot.current ? focusables(foot.current)[0] : void 0;
|
|
76
|
+
return inFoot ?? frame.current;
|
|
77
|
+
}, []);
|
|
78
|
+
const layer = useModalLayer({ onClose, dismissable, initialFocus: where });
|
|
79
|
+
useBodyScrollLock(true);
|
|
80
|
+
const labelledBy = given(title) ? titleId : void 0;
|
|
81
|
+
const described = describedBy ?? (given(subtitle) ? subtitleId : void 0);
|
|
82
|
+
const frameProps = {
|
|
83
|
+
...rest,
|
|
84
|
+
ref: (el) => {
|
|
85
|
+
frame.current = el;
|
|
86
|
+
layer.panelRef(el);
|
|
87
|
+
},
|
|
88
|
+
className: cx(
|
|
89
|
+
"crewlet-modal",
|
|
90
|
+
`crewlet-modal--${variant}`,
|
|
91
|
+
variant === "dialog" ? `crewlet-modal--${size}` : void 0,
|
|
92
|
+
prompt ? "crewlet-modal--prompt" : void 0,
|
|
93
|
+
className
|
|
94
|
+
),
|
|
95
|
+
role,
|
|
96
|
+
"aria-modal": true,
|
|
97
|
+
"aria-labelledby": labelledBy,
|
|
98
|
+
"aria-label": labelledBy === void 0 ? ariaLabel : void 0,
|
|
99
|
+
"aria-describedby": described,
|
|
100
|
+
tabIndex: -1
|
|
101
|
+
};
|
|
102
|
+
const closes = banded && showCloseButton;
|
|
103
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
104
|
+
banded && (given(title) || given(subtitle) || given(headerActions) || closes) ? /* @__PURE__ */ jsxs("div", { className: cx("crewlet-modal__header", sheet ? "crewlet-modal__header--sheet" : void 0), children: [
|
|
105
|
+
given(icon) ? /* @__PURE__ */ jsx("span", { className: "crewlet-modal__icon", "aria-hidden": "true", children: icon }) : null,
|
|
106
|
+
/* @__PURE__ */ jsxs("div", { className: "crewlet-modal__heading", children: [
|
|
107
|
+
given(title) ? /* @__PURE__ */ jsx(
|
|
108
|
+
"p",
|
|
109
|
+
{
|
|
110
|
+
className: cx("crewlet-modal__title", sheet ? "crewlet-modal__title--sheet" : void 0),
|
|
111
|
+
id: titleId,
|
|
112
|
+
children: title
|
|
113
|
+
}
|
|
114
|
+
) : null,
|
|
115
|
+
given(subtitle) ? /* @__PURE__ */ jsx("p", { className: "crewlet-modal__subtitle", id: subtitleId, children: subtitle }) : null
|
|
116
|
+
] }),
|
|
117
|
+
given(headerActions) ? /* @__PURE__ */ jsx("div", { className: "crewlet-modal__actions", children: headerActions }) : null,
|
|
118
|
+
closes ? /* @__PURE__ */ jsx(
|
|
119
|
+
IconButton,
|
|
120
|
+
{
|
|
121
|
+
className: "crewlet-modal__close",
|
|
122
|
+
label: closeLabel,
|
|
123
|
+
icon: /* @__PURE__ */ jsx(CloseGlyph, { size: "md" }),
|
|
124
|
+
onClick: onClose,
|
|
125
|
+
disabledReason: dismissable ? void 0 : closeDisabledReason
|
|
126
|
+
}
|
|
127
|
+
) : null
|
|
128
|
+
] }) : null,
|
|
129
|
+
given(children) || prompt && given(title) ? /* @__PURE__ */ jsxs(
|
|
130
|
+
"div",
|
|
131
|
+
{
|
|
132
|
+
ref: body,
|
|
133
|
+
className: cx(
|
|
134
|
+
"crewlet-modal__body",
|
|
135
|
+
stackBody ? "crewlet-modal__body--stacked" : void 0,
|
|
136
|
+
flush ? "crewlet-modal__body--flush" : void 0,
|
|
137
|
+
sheet ? "crewlet-modal__body--sheet" : void 0
|
|
138
|
+
),
|
|
139
|
+
children: [
|
|
140
|
+
prompt && given(title) ? /* @__PURE__ */ jsx("p", { className: "crewlet-modal__prompt-title", id: titleId, children: title }) : null,
|
|
141
|
+
/* @__PURE__ */ jsx(HeadingLevelProvider, { level: 2, children })
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
) : null,
|
|
145
|
+
given(footer) || given(footerStart) ? /* @__PURE__ */ jsxs(
|
|
146
|
+
"div",
|
|
147
|
+
{
|
|
148
|
+
ref: foot,
|
|
149
|
+
className: cx("crewlet-modal__footer", sheet ? "crewlet-modal__footer--sheet" : void 0),
|
|
150
|
+
children: [
|
|
151
|
+
given(footerStart) ? /* @__PURE__ */ jsx("div", { className: "crewlet-modal__footer-start", children: footerStart }) : null,
|
|
152
|
+
/* @__PURE__ */ jsx("div", { className: "crewlet-modal__footer-end", children: footer })
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
) : null
|
|
156
|
+
] });
|
|
157
|
+
return createPortal(
|
|
158
|
+
/* @__PURE__ */ jsx(
|
|
159
|
+
"div",
|
|
160
|
+
{
|
|
161
|
+
ref: closeOnBackdrop ? layer.veilRef : void 0,
|
|
162
|
+
className: cx(
|
|
163
|
+
"crewlet-modal-overlay",
|
|
164
|
+
`crewlet-modal-overlay--${variant}`,
|
|
165
|
+
`crewlet-modal-overlay--${place}`,
|
|
166
|
+
// Fixed against the window, absolute inside a LayerHost: a fullscreen
|
|
167
|
+
// container paints only its own subtree, so a surface drawn there
|
|
168
|
+
// covers the container rather than a viewport it cannot reach.
|
|
169
|
+
container === document.body ? "crewlet-modal-overlay--fixed" : "crewlet-modal-overlay--in-host"
|
|
170
|
+
),
|
|
171
|
+
role: "presentation",
|
|
172
|
+
style: { zIndex: layer.zIndex },
|
|
173
|
+
children: /* @__PURE__ */ jsx("div", { ...frameProps, children: onSubmit ? /* @__PURE__ */ jsx(
|
|
174
|
+
"form",
|
|
175
|
+
{
|
|
176
|
+
className: "crewlet-modal__form",
|
|
177
|
+
onSubmit: (event) => {
|
|
178
|
+
event.preventDefault();
|
|
179
|
+
onSubmit();
|
|
180
|
+
},
|
|
181
|
+
children: content
|
|
182
|
+
}
|
|
183
|
+
) : content })
|
|
184
|
+
}
|
|
185
|
+
),
|
|
186
|
+
container
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
function ConfirmModal({
|
|
190
|
+
open,
|
|
191
|
+
onClose,
|
|
192
|
+
onConfirm,
|
|
193
|
+
title,
|
|
194
|
+
message,
|
|
195
|
+
children,
|
|
196
|
+
confirmLabel = "Confirm",
|
|
197
|
+
cancelLabel = "Cancel",
|
|
198
|
+
destructive = false,
|
|
199
|
+
confirmVariant,
|
|
200
|
+
cancelVariant = "tertiary",
|
|
201
|
+
confirmDisabled = false,
|
|
202
|
+
confirmDisabledReason = "Complete the confirmation above to continue.",
|
|
203
|
+
submitting = false,
|
|
204
|
+
busyReason = "Waiting for this to finish.",
|
|
205
|
+
shape = "prompt",
|
|
206
|
+
size = "sm"
|
|
207
|
+
}) {
|
|
208
|
+
const messageId = `${useId()}-message`;
|
|
209
|
+
const resolvedConfirm = confirmVariant ?? (destructive ? "danger" : "primary");
|
|
210
|
+
const blocked = confirmDisabled || submitting;
|
|
211
|
+
const submit = useCallback(() => {
|
|
212
|
+
if (blocked) return;
|
|
213
|
+
void (async () => {
|
|
214
|
+
try {
|
|
215
|
+
await onConfirm();
|
|
216
|
+
} catch {
|
|
217
|
+
}
|
|
218
|
+
})();
|
|
219
|
+
}, [blocked, onConfirm]);
|
|
220
|
+
return /* @__PURE__ */ jsxs(
|
|
221
|
+
Modal,
|
|
222
|
+
{
|
|
223
|
+
open,
|
|
224
|
+
onClose,
|
|
225
|
+
title,
|
|
226
|
+
shape,
|
|
227
|
+
size,
|
|
228
|
+
role: destructive ? "alertdialog" : "dialog",
|
|
229
|
+
describedBy: given(message) ? messageId : void 0,
|
|
230
|
+
dismissable: !submitting,
|
|
231
|
+
closeDisabledReason: busyReason,
|
|
232
|
+
onSubmit: submit,
|
|
233
|
+
stackBody: true,
|
|
234
|
+
footer: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
235
|
+
/* @__PURE__ */ jsx(
|
|
236
|
+
Button,
|
|
237
|
+
{
|
|
238
|
+
variant: cancelVariant,
|
|
239
|
+
onClick: onClose,
|
|
240
|
+
disabledReason: submitting ? busyReason : void 0,
|
|
241
|
+
children: cancelLabel
|
|
242
|
+
}
|
|
243
|
+
),
|
|
244
|
+
/* @__PURE__ */ jsx(
|
|
245
|
+
Button,
|
|
246
|
+
{
|
|
247
|
+
type: "submit",
|
|
248
|
+
variant: resolvedConfirm,
|
|
249
|
+
loading: submitting,
|
|
250
|
+
disabledReason: confirmDisabled ? confirmDisabledReason : void 0,
|
|
251
|
+
children: confirmLabel
|
|
252
|
+
}
|
|
253
|
+
)
|
|
254
|
+
] }),
|
|
255
|
+
children: [
|
|
256
|
+
given(message) ? /* @__PURE__ */ jsx("p", { className: "crewlet-modal__message", id: messageId, children: message }) : null,
|
|
257
|
+
children
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export { ConfirmModal, Modal };
|