@namroodinc/liquid-editorial 0.1.11 → 0.2.1
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/AGENTS.md +1 -1
- package/README.md +59 -16
- package/UPGRADING.md +108 -0
- package/dist/chunks/{Board-BLhB5_xx.cjs → Board-BUJ5CinL.cjs} +2 -2
- package/dist/chunks/Board-BUJ5CinL.cjs.map +1 -0
- package/dist/chunks/{Board-BTFSzn6c.js → Board-Cyrda2qG.js} +2 -2
- package/dist/chunks/Board-Cyrda2qG.js.map +1 -0
- package/dist/chunks/FormEditor-8bz3pOdP.cjs +2 -0
- package/dist/chunks/FormEditor-8bz3pOdP.cjs.map +1 -0
- package/dist/chunks/FormEditor-DuW8x78Y.js +330 -0
- package/dist/chunks/FormEditor-DuW8x78Y.js.map +1 -0
- package/dist/chunks/Icon-ByUB0L1a.js +78 -0
- package/dist/chunks/Icon-ByUB0L1a.js.map +1 -0
- package/dist/chunks/Icon-CW6qJcDy.cjs +2 -0
- package/dist/chunks/Icon-CW6qJcDy.cjs.map +1 -0
- package/dist/chunks/RichTextEditor-BxtlbjXj.cjs.map +1 -1
- package/dist/chunks/RichTextEditor-Dnx4i7bQ.js.map +1 -1
- package/dist/chunks/dialogStack-6yv3NXFD.js +43 -0
- package/dist/chunks/dialogStack-6yv3NXFD.js.map +1 -0
- package/dist/chunks/dialogStack-C9SLVu6Q.cjs +2 -0
- package/dist/chunks/dialogStack-C9SLVu6Q.cjs.map +1 -0
- package/dist/chunks/observeElementWidth-BCJM2FAw.cjs +2 -0
- package/dist/chunks/observeElementWidth-BCJM2FAw.cjs.map +1 -0
- package/dist/chunks/observeElementWidth-BlQOlW2t.js +12 -0
- package/dist/chunks/observeElementWidth-BlQOlW2t.js.map +1 -0
- package/dist/components/AppShell/index.cjs +1 -1
- package/dist/components/AppShell/index.cjs.map +1 -1
- package/dist/components/AppShell/index.d.cts +5 -1
- package/dist/components/AppShell/index.d.cts.map +1 -1
- package/dist/components/AppShell/index.d.ts +5 -1
- package/dist/components/AppShell/index.d.ts.map +1 -1
- package/dist/components/AppShell/index.js +53 -60
- package/dist/components/AppShell/index.js.map +1 -1
- package/dist/components/AppShell/style.css +48 -6
- package/dist/components/AssetCard/index.cjs +1 -1
- package/dist/components/AssetCard/index.cjs.map +1 -1
- package/dist/components/AssetCard/index.d.cts +1 -1
- package/dist/components/AssetCard/index.d.cts.map +1 -1
- package/dist/components/AssetCard/index.d.ts +1 -1
- package/dist/components/AssetCard/index.d.ts.map +1 -1
- package/dist/components/AssetCard/index.js +1 -1
- package/dist/components/AssetCard/index.js.map +1 -1
- package/dist/components/AssetCard/style.css +20 -9
- package/dist/components/AssetGrid/index.cjs +1 -1
- package/dist/components/AssetGrid/index.cjs.map +1 -1
- package/dist/components/AssetGrid/index.d.cts +1 -1
- package/dist/components/AssetGrid/index.d.cts.map +1 -1
- package/dist/components/AssetGrid/index.d.ts +1 -1
- package/dist/components/AssetGrid/index.d.ts.map +1 -1
- package/dist/components/AssetGrid/index.js +1 -1
- package/dist/components/AssetGrid/index.js.map +1 -1
- package/dist/components/Avatar/index.cjs.map +1 -1
- package/dist/components/Avatar/index.d.cts.map +1 -1
- package/dist/components/Avatar/index.d.ts.map +1 -1
- package/dist/components/Avatar/index.js.map +1 -1
- package/dist/components/Badge/index.cjs.map +1 -1
- package/dist/components/Badge/index.d.cts.map +1 -1
- package/dist/components/Badge/index.d.ts.map +1 -1
- package/dist/components/Badge/index.js.map +1 -1
- package/dist/components/Badge/style.css +2 -1
- package/dist/components/Board/index.cjs +1 -1
- package/dist/components/Board/index.d.cts.map +1 -1
- package/dist/components/Board/index.d.ts.map +1 -1
- package/dist/components/Board/index.js +1 -1
- package/dist/components/Board/keyboard.d.cts.map +1 -1
- package/dist/components/Board/keyboard.d.ts.map +1 -1
- package/dist/components/Board/moves.d.cts.map +1 -1
- package/dist/components/Board/moves.d.ts.map +1 -1
- package/dist/components/Board/style.css +12 -7
- package/dist/components/Button/index.cjs +1 -1
- package/dist/components/Button/index.cjs.map +1 -1
- package/dist/components/Button/index.d.cts.map +1 -1
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Button/style.css +1 -1
- package/dist/components/ButtonGroup/index.cjs.map +1 -1
- package/dist/components/ButtonGroup/index.d.cts.map +1 -1
- package/dist/components/ButtonGroup/index.d.ts.map +1 -1
- package/dist/components/ButtonGroup/index.js.map +1 -1
- package/dist/components/ButtonGroup/style.css +1 -0
- package/dist/components/Choice/index.cjs.map +1 -1
- package/dist/components/Choice/index.d.cts.map +1 -1
- package/dist/components/Choice/index.d.ts.map +1 -1
- package/dist/components/Choice/index.js.map +1 -1
- package/dist/components/Choice/style.css +1 -1
- package/dist/components/Container/style.css +1 -0
- package/dist/components/DatePicker/index.cjs +1 -1
- package/dist/components/DatePicker/index.cjs.map +1 -1
- package/dist/components/DatePicker/index.d.cts.map +1 -1
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DatePicker/index.js +1 -1
- package/dist/components/DatePicker/index.js.map +1 -1
- package/dist/components/DatePicker/style.css +3 -1
- package/dist/components/Drawer/index.cjs +1 -1
- package/dist/components/Drawer/index.cjs.map +1 -1
- package/dist/components/Drawer/index.d.cts.map +1 -1
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +72 -70
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/Drawer/style.css +7 -2
- package/dist/components/EditLayout/index.cjs +2 -0
- package/dist/components/EditLayout/index.cjs.map +1 -0
- package/dist/components/EditLayout/index.d.cts +25 -0
- package/dist/components/EditLayout/index.d.cts.map +1 -0
- package/dist/components/EditLayout/index.d.ts +25 -0
- package/dist/components/EditLayout/index.d.ts.map +1 -0
- package/dist/components/EditLayout/index.js +239 -0
- package/dist/components/EditLayout/index.js.map +1 -0
- package/dist/components/EditLayout/style.css +226 -0
- package/dist/components/EntryPicker/index.cjs +1 -1
- package/dist/components/EntryPicker/index.cjs.map +1 -1
- package/dist/components/EntryPicker/index.d.cts +3 -1
- package/dist/components/EntryPicker/index.d.cts.map +1 -1
- package/dist/components/EntryPicker/index.d.ts +3 -1
- package/dist/components/EntryPicker/index.d.ts.map +1 -1
- package/dist/components/EntryPicker/index.js +46 -44
- package/dist/components/EntryPicker/index.js.map +1 -1
- package/dist/components/Field/index.cjs.map +1 -1
- package/dist/components/Field/index.d.cts.map +1 -1
- package/dist/components/Field/index.d.ts.map +1 -1
- package/dist/components/Field/index.js.map +1 -1
- package/dist/components/Field/style.css +1 -1
- package/dist/components/FieldAffix/index.cjs.map +1 -1
- package/dist/components/FieldAffix/index.d.cts.map +1 -1
- package/dist/components/FieldAffix/index.d.ts.map +1 -1
- package/dist/components/FieldAffix/index.js.map +1 -1
- package/dist/components/FormEditor/control.d.cts +15 -0
- package/dist/components/FormEditor/control.d.cts.map +1 -0
- package/dist/components/FormEditor/control.d.ts +15 -0
- package/dist/components/FormEditor/control.d.ts.map +1 -0
- package/dist/components/FormEditor/index.cjs +1 -0
- package/dist/components/FormEditor/index.d.cts +28 -0
- package/dist/components/FormEditor/index.d.cts.map +1 -0
- package/dist/components/FormEditor/index.d.ts +28 -0
- package/dist/components/FormEditor/index.d.ts.map +1 -0
- package/dist/components/FormEditor/index.js +2 -0
- package/dist/components/FormEditor/model.d.cts +86 -0
- package/dist/components/FormEditor/model.d.cts.map +1 -0
- package/dist/components/FormEditor/model.d.ts +86 -0
- package/dist/components/FormEditor/model.d.ts.map +1 -0
- package/dist/components/FormEditor/style.css +27 -0
- package/dist/components/Icon/icons.d.cts +1 -0
- package/dist/components/Icon/icons.d.cts.map +1 -1
- package/dist/components/Icon/icons.d.ts +1 -0
- package/dist/components/Icon/icons.d.ts.map +1 -1
- package/dist/components/Icon/index.cjs +1 -1
- package/dist/components/Icon/index.js +1 -1
- package/dist/components/Icon/style.css +1 -1
- package/dist/components/ImageCropper/index.cjs.map +1 -1
- package/dist/components/ImageCropper/index.d.cts +1 -1
- package/dist/components/ImageCropper/index.d.cts.map +1 -1
- package/dist/components/ImageCropper/index.d.ts +1 -1
- package/dist/components/ImageCropper/index.d.ts.map +1 -1
- package/dist/components/ImageCropper/index.js.map +1 -1
- package/dist/components/ImageCropper/style.css +28 -5
- package/dist/components/Menu/index.cjs.map +1 -1
- package/dist/components/Menu/index.d.cts.map +1 -1
- package/dist/components/Menu/index.d.ts.map +1 -1
- package/dist/components/Menu/index.js.map +1 -1
- package/dist/components/Menu/style.css +0 -1
- package/dist/components/Modal/index.cjs +1 -1
- package/dist/components/Modal/index.cjs.map +1 -1
- package/dist/components/Modal/index.d.cts.map +1 -1
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/Modal/index.js +47 -46
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Modal/style.css +2 -2
- package/dist/components/NumberField/index.cjs +1 -1
- package/dist/components/NumberField/index.cjs.map +1 -1
- package/dist/components/NumberField/index.d.cts +3 -0
- package/dist/components/NumberField/index.d.cts.map +1 -1
- package/dist/components/NumberField/index.d.ts +3 -0
- package/dist/components/NumberField/index.d.ts.map +1 -1
- package/dist/components/NumberField/index.js +20 -20
- package/dist/components/NumberField/index.js.map +1 -1
- package/dist/components/NumberField/style.css +4 -6
- package/dist/components/Pagination/index.cjs.map +1 -1
- package/dist/components/Pagination/index.d.cts.map +1 -1
- package/dist/components/Pagination/index.d.ts.map +1 -1
- package/dist/components/Pagination/index.js.map +1 -1
- package/dist/components/Popover/index.cjs.map +1 -1
- package/dist/components/Popover/index.d.cts.map +1 -1
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js.map +1 -1
- package/dist/components/RichTextEditor/document.d.cts.map +1 -1
- package/dist/components/RichTextEditor/document.d.ts.map +1 -1
- package/dist/components/RichTextEditor/index.cjs +1 -1
- package/dist/components/RichTextEditor/index.d.cts.map +1 -1
- package/dist/components/RichTextEditor/index.d.ts.map +1 -1
- package/dist/components/RichTextEditor/index.js +0 -1
- package/dist/components/RichTextEditor/style.css +2 -2
- package/dist/components/SearchField/index.cjs +1 -1
- package/dist/components/SearchField/index.cjs.map +1 -1
- package/dist/components/SearchField/index.d.cts.map +1 -1
- package/dist/components/SearchField/index.d.ts.map +1 -1
- package/dist/components/SearchField/index.js +1 -1
- package/dist/components/SearchField/index.js.map +1 -1
- package/dist/components/SearchField/style.css +0 -1
- package/dist/components/Select/index.cjs +1 -1
- package/dist/components/Select/index.cjs.map +1 -1
- package/dist/components/Select/index.d.cts.map +1 -1
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/SelectionCard/index.cjs.map +1 -1
- package/dist/components/SelectionCard/index.d.cts +1 -1
- package/dist/components/SelectionCard/index.d.cts.map +1 -1
- package/dist/components/SelectionCard/index.d.ts +1 -1
- package/dist/components/SelectionCard/index.d.ts.map +1 -1
- package/dist/components/SelectionCard/index.js.map +1 -1
- package/dist/components/SelectionCard/style.css +1 -5
- package/dist/components/SideNav/index.cjs +1 -1
- package/dist/components/SideNav/index.cjs.map +1 -1
- package/dist/components/SideNav/index.d.cts.map +1 -1
- package/dist/components/SideNav/index.d.ts.map +1 -1
- package/dist/components/SideNav/index.js +1 -1
- package/dist/components/SideNav/index.js.map +1 -1
- package/dist/components/SideNav/style.css +7 -2
- package/dist/components/Skeleton/index.cjs.map +1 -1
- package/dist/components/Skeleton/index.d.cts.map +1 -1
- package/dist/components/Skeleton/index.d.ts.map +1 -1
- package/dist/components/Skeleton/index.js.map +1 -1
- package/dist/components/Skeleton/style.css +2 -2
- package/dist/components/Slider/index.cjs.map +1 -1
- package/dist/components/Slider/index.d.cts.map +1 -1
- package/dist/components/Slider/index.d.ts.map +1 -1
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Slider/style.css +5 -16
- package/dist/components/SortableList/index.cjs +1 -1
- package/dist/components/SortableList/index.cjs.map +1 -1
- package/dist/components/SortableList/index.d.cts.map +1 -1
- package/dist/components/SortableList/index.d.ts.map +1 -1
- package/dist/components/SortableList/index.js +1 -1
- package/dist/components/SortableList/index.js.map +1 -1
- package/dist/components/SortableList/style.css +1 -1
- package/dist/components/Stepper/index.cjs +1 -1
- package/dist/components/Stepper/index.cjs.map +1 -1
- package/dist/components/Stepper/index.d.cts.map +1 -1
- package/dist/components/Stepper/index.d.ts.map +1 -1
- package/dist/components/Stepper/index.js +1 -1
- package/dist/components/Stepper/index.js.map +1 -1
- package/dist/components/Stepper/style.css +2 -2
- package/dist/components/SubNav/index.cjs +1 -1
- package/dist/components/SubNav/index.cjs.map +1 -1
- package/dist/components/SubNav/index.d.cts.map +1 -1
- package/dist/components/SubNav/index.d.ts.map +1 -1
- package/dist/components/SubNav/index.js +1 -1
- package/dist/components/SubNav/index.js.map +1 -1
- package/dist/components/Switch/index.cjs.map +1 -1
- package/dist/components/Switch/index.d.cts.map +1 -1
- package/dist/components/Switch/index.d.ts.map +1 -1
- package/dist/components/Switch/index.js.map +1 -1
- package/dist/components/Switch/style.css +2 -1
- package/dist/components/Table/index.cjs +1 -1
- package/dist/components/Table/index.cjs.map +1 -1
- package/dist/components/Table/index.d.cts.map +1 -1
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js +1 -1
- package/dist/components/Table/index.js.map +1 -1
- package/dist/components/Table/style.css +1 -0
- package/dist/components/TagsInput/index.cjs.map +1 -1
- package/dist/components/TagsInput/index.d.cts.map +1 -1
- package/dist/components/TagsInput/index.d.ts.map +1 -1
- package/dist/components/TagsInput/index.js.map +1 -1
- package/dist/components/TagsInput/style.css +2 -1
- package/dist/components/TextField/index.cjs.map +1 -1
- package/dist/components/TextField/index.d.cts.map +1 -1
- package/dist/components/TextField/index.d.ts.map +1 -1
- package/dist/components/TextField/index.js.map +1 -1
- package/dist/components/Time/index.cjs.map +1 -1
- package/dist/components/Time/index.d.cts.map +1 -1
- package/dist/components/Time/index.d.ts.map +1 -1
- package/dist/components/Time/index.js.map +1 -1
- package/dist/components/Time/style.css +1 -2
- package/dist/components/Toast/index.cjs +1 -1
- package/dist/components/Toast/index.cjs.map +1 -1
- package/dist/components/Toast/index.d.cts.map +1 -1
- package/dist/components/Toast/index.d.ts.map +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/Toast/index.js.map +1 -1
- package/dist/components/Toast/style.css +1 -1
- package/dist/components/TopNav/index.cjs +1 -1
- package/dist/components/TopNav/index.cjs.map +1 -1
- package/dist/components/TopNav/index.d.cts.map +1 -1
- package/dist/components/TopNav/index.d.ts.map +1 -1
- package/dist/components/TopNav/index.js +1 -1
- package/dist/components/TopNav/index.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +10 -8
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +10 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -21
- package/dist/internal/dialogStack.d.cts +9 -0
- package/dist/internal/dialogStack.d.cts.map +1 -0
- package/dist/internal/dialogStack.d.ts +9 -0
- package/dist/internal/dialogStack.d.ts.map +1 -0
- package/dist/internal/lockBodyScroll.d.cts +7 -0
- package/dist/internal/lockBodyScroll.d.cts.map +1 -0
- package/dist/internal/lockBodyScroll.d.ts +7 -0
- package/dist/internal/lockBodyScroll.d.ts.map +1 -0
- package/dist/internal/observeElementWidth.d.cts +3 -0
- package/dist/internal/observeElementWidth.d.cts.map +1 -0
- package/dist/internal/observeElementWidth.d.ts +3 -0
- package/dist/internal/observeElementWidth.d.ts.map +1 -0
- package/dist/reset.css +29 -4
- package/dist/styles.css +20 -16
- package/dist/test/dragEvent.d.cts.map +1 -1
- package/dist/test/dragEvent.d.ts.map +1 -1
- package/dist/tokens.css +77 -40
- package/package.json +9 -2
- package/dist/chunks/Board-BLhB5_xx.cjs.map +0 -1
- package/dist/chunks/Board-BTFSzn6c.js.map +0 -1
- package/dist/chunks/EntryEditor-CcyYtH74.js +0 -191
- package/dist/chunks/EntryEditor-CcyYtH74.js.map +0 -1
- package/dist/chunks/EntryEditor-DIpc1iPF.cjs +0 -2
- package/dist/chunks/EntryEditor-DIpc1iPF.cjs.map +0 -1
- package/dist/chunks/Icon-CGY1FNXT.js +0 -77
- package/dist/chunks/Icon-CGY1FNXT.js.map +0 -1
- package/dist/chunks/Icon-CWsA1W83.cjs +0 -2
- package/dist/chunks/Icon-CWsA1W83.cjs.map +0 -1
- package/dist/components/EntryEditor/index.cjs +0 -1
- package/dist/components/EntryEditor/index.d.cts +0 -21
- package/dist/components/EntryEditor/index.d.cts.map +0 -1
- package/dist/components/EntryEditor/index.d.ts +0 -21
- package/dist/components/EntryEditor/index.d.ts.map +0 -1
- package/dist/components/EntryEditor/index.js +0 -6
- package/dist/components/EntryEditor/model.d.cts +0 -33
- package/dist/components/EntryEditor/model.d.cts.map +0 -1
- package/dist/components/EntryEditor/model.d.ts +0 -33
- package/dist/components/EntryEditor/model.d.ts.map +0 -1
- package/dist/components/EntryEditor/style.css +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../../chunks/Icon-
|
|
1
|
+
import { t as e } from "../../chunks/Icon-ByUB0L1a.js";
|
|
2
2
|
import { Grid as t } from "../Grid/index.js";
|
|
3
3
|
import { AssetCard as n, AssetCardSkeleton as r } from "../AssetCard/index.js";
|
|
4
4
|
import { forwardRef as i } from "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Icon","cx","parts","AssetGrid","forwardRef","rest","Grid","className","isLoading","loadingCount","AssetCardSkeleton","loadingCard","i","children","AssetGridEmpty","title","description","action","AssetCard"],"sources":["../../../src/components/AssetGrid/index.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.js","names":["Icon","cx","parts","AssetGrid","forwardRef","rest","Grid","className","isLoading","loadingCount","AssetCardSkeleton","loadingCard","i","children","AssetGridEmpty","title","description","action","AssetCard"],"sources":["../../../src/components/AssetGrid/index.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport { Grid } from \"../Grid\";\nimport { Icon } from \"../Icon\";\nimport { AssetCardSkeleton, type AssetCardSkeletonProps } from \"../AssetCard\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport interface AssetGridProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Renders placeholder tiles instead of children. The grid keeps its\n * geometry, so nothing moves when the real assets arrive.\n */\n isLoading?: boolean;\n /** How many placeholder tiles to show while loading. */\n loadingCount?: number;\n /** Slots each placeholder reserves; match the cards that replace them. */\n loadingCard?: Omit<AssetCardSkeletonProps, \"index\">;\n children?: ReactNode;\n}\n\n/**\n * The media library surface: an auto-filling grid of asset tiles. Sits inside\n * a `TableFrame` when it is the page's collection, bare inside a drawer.\n */\nexport const AssetGrid = forwardRef<HTMLDivElement, AssetGridProps>(function AssetGrid(\n { isLoading = false, loadingCount = 8, loadingCard, className, children, ...rest },\n ref,\n) {\n return (\n <Grid\n ref={ref}\n columns=\"auto\"\n gap=\"md\"\n minColumnWidth=\"var(--asset-tile-min-width)\"\n className={cx(\"ds-asset-grid\", className)}\n aria-busy={isLoading || undefined}\n {...rest}\n >\n {isLoading\n ? Array.from({ length: loadingCount }, (_, i) => (\n <AssetCardSkeleton\n key={i}\n {...loadingCard}\n index={i}\n />\n ))\n : children}\n </Grid>\n );\n});\n\n// Existing entry points remain aliases to the shared card implementation.\nexport { AssetCard as AssetTile, AssetCardSkeleton as AssetTileSkeleton } from \"../AssetCard\";\nexport type {\n AssetCardProps as AssetTileProps,\n AssetCardSkeletonProps as AssetTileSkeletonProps,\n} from \"../AssetCard\";\n\nexport interface AssetGridEmptyProps {\n title: string;\n description?: ReactNode;\n action?: ReactNode;\n}\n\n/** Nothing in the library yet — one action, the one that fills it. */\nexport function AssetGridEmpty({ title, description, action }: AssetGridEmptyProps) {\n return (\n <div className=\"ds-asset-empty\">\n <Icon\n name=\"image\"\n size={24}\n />\n <span className=\"ds-asset-empty__title\">{title}</span>\n {description && <span className=\"ds-asset-empty__description\">{description}</span>}\n {action}\n </div>\n );\n}\n"],"mappings":";;;;;;AAMA,SAASC,EAAG,GAAGC,GAAuC;CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AACvC;AAmBA,IAAaC,IAAYC,EAA2C,SAClE,EAAE,eAAY,IAAO,kBAAe,GAAG,gBAAa,cAAW,aAAU,GAAGC,KAC5E,GACA;CACA,OACE,kBAACC,GAAD;EACO;EACL,SAAQ;EACR,KAAI;EACJ,gBAAe;EACf,WAAWL,EAAG,iBAAiBM,CAAS;EACxC,aAAWC,KAAa,KAAA;EACxB,GAAIH;EAEH,UAAAG,IACG,MAAM,KAAK,EAAE,QAAQC,EAAa,IAAI,GAAG,MACvC,kBAACC,GAAD;GAEE,GAAIC;GACJ,OAAOC;EACR,GAHMA,CAGN,CACF,IACDC;CACA,CAAA;AAEV,CAAC;AAgBD,SAAgBC,EAAe,EAAE,UAAO,gBAAa,aAA+B;CAClF,OACE,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACE,kBAACd,GAAD;IACE,MAAK;IACL,MAAM;GACP,CAAA;GACD,kBAAC,QAAD;IAAM,WAAU;IAAyB,UAAAe;GAAY,CAAA;GACpDC,KAAe,kBAAC,QAAD;IAAM,WAAU;IAA+B,UAAAA;GAAkB,CAAA;GAChFC;EACE;;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["forwardRef","react","react_jsx_runtime","initialsOf","words","name","Avatar","rest","size","className","src","AvatarGroup","shown","people","overflow","p","person"],"sources":["../../../src/components/Avatar/index.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from \"react\";\nimport \"./style.css\";\n\nexport type AvatarSize = 24 | 32 | 40;\n\nexport interface AvatarProps extends HTMLAttributes<HTMLSpanElement> {\n /** Required — drives the initials and the accessible name. */\n name: string;\n src?: string;\n size?: AvatarSize;\n}\n\nfunction initialsOf(name: string) {\n const words = name.trim().split(/\\s+/);\n const first = words[0]?.[0] ?? \"\";\n const last = words.length > 1 ? words[words.length - 1][0] : \"\";\n return (first + last).toUpperCase();\n}\n\n/**\n * Identifies a person at a glance in a dense surface. An identifier, not a\n * control — never colour-generated, never carrying a status dot.\n */\nexport const Avatar = forwardRef<HTMLSpanElement, AvatarProps>(function Avatar(\n { name, src, size = 24, className, ...rest },\n ref,\n) {\n return (\n <span\n ref={ref}\n role=\"img\"\n aria-label={name}\n title={name}\n data-size={size}\n className={[\"ds-avatar\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {src ? <img
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["forwardRef","react","react_jsx_runtime","initialsOf","words","name","Avatar","rest","size","className","src","AvatarGroup","shown","people","overflow","p","person"],"sources":["../../../src/components/Avatar/index.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from \"react\";\nimport \"./style.css\";\n\nexport type AvatarSize = 24 | 32 | 40;\n\nexport interface AvatarProps extends HTMLAttributes<HTMLSpanElement> {\n /** Required — drives the initials and the accessible name. */\n name: string;\n src?: string;\n size?: AvatarSize;\n}\n\nfunction initialsOf(name: string) {\n const words = name.trim().split(/\\s+/);\n const first = words[0]?.[0] ?? \"\";\n const last = words.length > 1 ? words[words.length - 1][0] : \"\";\n return (first + last).toUpperCase();\n}\n\n/**\n * Identifies a person at a glance in a dense surface. An identifier, not a\n * control — never colour-generated, never carrying a status dot.\n */\nexport const Avatar = forwardRef<HTMLSpanElement, AvatarProps>(function Avatar(\n { name, src, size = 24, className, ...rest },\n ref,\n) {\n return (\n <span\n ref={ref}\n role=\"img\"\n aria-label={name}\n title={name}\n data-size={size}\n className={[\"ds-avatar\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {src ? (\n <img\n src={src}\n alt=\"\"\n />\n ) : (\n initialsOf(name)\n )}\n </span>\n );\n});\n\nexport interface AvatarGroupProps extends HTMLAttributes<HTMLSpanElement> {\n /** Up to three render; the rest become a `+n` count. */\n people: { name: string; src?: string }[];\n size?: AvatarSize;\n}\n\n/** Overlapping stack of at most three avatars, then a `+n` chip. */\nexport const AvatarGroup = forwardRef<HTMLSpanElement, AvatarGroupProps>(function AvatarGroup(\n { people, size = 24, className, ...rest },\n ref,\n) {\n const shown = people.slice(0, 3);\n const overflow = people.length - shown.length;\n return (\n <span\n ref={ref}\n role=\"group\"\n aria-label={people.map((p) => p.name).join(\", \")}\n className={[\"ds-avatar-group\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {shown.map((person) => (\n <Avatar\n key={person.name}\n name={person.name}\n src={person.src}\n size={size}\n />\n ))}\n {overflow > 0 && <span className=\"ds-avatar-group__count\">+{overflow}</span>}\n </span>\n );\n});\n"],"mappings":"A,yHAYA,SAASG,EAAW,EAAc,CAChC,IAAMC,EAAQC,EAAK,KAAK,CAAC,CAAC,MAAM,KAAK,EAGrC,QAFcD,EAAM,EAAE,GAAG,IAAM,KAClBA,EAAM,OAAS,EAAIA,EAAMA,EAAM,OAAS,EAAE,CAAC,GAAK,IAAA,CACvC,YAAY,CACpC,CAMA,IAAaE,GAAA,EAASN,EAAAA,WAAAA,CAAyC,SAC7D,CAAE,OAAM,MAAK,OAAO,GAAI,YAAW,GAAGO,GACtC,EACA,CACA,OACE,EAAAL,EAAA,IAAA,CAAC,OAAD,CACO,MACL,KAAK,MACL,aAAYG,EACZ,MAAOA,EACP,YAAWG,EACX,UAAW,CAAC,YAAaC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAC5D,GAAIF,EAEH,SAAAG,GACC,EAAAR,EAAA,IAAA,CAAC,MAAD,CACO,MACL,IAAI,EACL,CAAA,EAEDC,EAAWE,CAAI,CAEb,CAAA,CAEV,CAAC,EASYM,GAAA,EAAcX,EAAAA,WAAAA,CAA8C,SACvE,CAAE,SAAQ,OAAO,GAAI,YAAW,GAAGO,GACnC,EACA,CACA,IAAMK,EAAQC,EAAO,MAAM,EAAG,CAAC,EACzBC,EAAWD,EAAO,OAASD,EAAM,OACvC,OACE,EAAAV,EAAA,KAAA,CAAC,OAAD,CACO,MACL,KAAK,QACL,aAAYW,EAAO,IAAK,GAAME,EAAE,IAAI,CAAC,CAAC,KAAK,IAAI,EAC/C,UAAW,CAAC,kBAAmBN,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAClE,GAAIF,EALN,SAAA,CAOGK,EAAM,IAAK,IACV,EAAAV,EAAA,IAAA,CAACI,EAAD,CAEE,KAAMU,EAAO,KACb,IAAKA,EAAO,IACN,MACP,EAJMA,EAAO,IAIb,CACF,EACAF,EAAW,IAAK,EAAAZ,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,yBAAhB,SAAA,CAAyC,IAAEY,CAAe,CACvE,CAAA,CAAA,C,EAEV,CAAC,E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Avatar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,UAAU,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEtC,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,eAAe,CAAC;IAClE,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AASD;;;GAGG;AACH,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Avatar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,UAAU,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEtC,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,eAAe,CAAC;IAClE,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AASD;;;GAGG;AACH,eAAO,MAAM,MAAM,yGAwBjB,CAAC;AAEH,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,eAAe,CAAC;IACvE,wDAAwD;IACxD,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACzC,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED,oEAAoE;AACpE,eAAO,MAAM,WAAW,8GAyBtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,UAAU,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEtC,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,eAAe,CAAC;IAClE,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AASD;;;GAGG;AACH,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,UAAU,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEtC,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,eAAe,CAAC;IAClE,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AASD;;;GAGG;AACH,eAAO,MAAM,MAAM,yGAwBjB,CAAC;AAEH,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,eAAe,CAAC;IACvE,wDAAwD;IACxD,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACzC,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED,oEAAoE;AACpE,eAAO,MAAM,WAAW,8GAyBtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["initialsOf","words","name","Avatar","forwardRef","rest","size","className","src","AvatarGroup","shown","people","overflow","p","person"],"sources":["../../../src/components/Avatar/index.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from \"react\";\nimport \"./style.css\";\n\nexport type AvatarSize = 24 | 32 | 40;\n\nexport interface AvatarProps extends HTMLAttributes<HTMLSpanElement> {\n /** Required — drives the initials and the accessible name. */\n name: string;\n src?: string;\n size?: AvatarSize;\n}\n\nfunction initialsOf(name: string) {\n const words = name.trim().split(/\\s+/);\n const first = words[0]?.[0] ?? \"\";\n const last = words.length > 1 ? words[words.length - 1][0] : \"\";\n return (first + last).toUpperCase();\n}\n\n/**\n * Identifies a person at a glance in a dense surface. An identifier, not a\n * control — never colour-generated, never carrying a status dot.\n */\nexport const Avatar = forwardRef<HTMLSpanElement, AvatarProps>(function Avatar(\n { name, src, size = 24, className, ...rest },\n ref,\n) {\n return (\n <span\n ref={ref}\n role=\"img\"\n aria-label={name}\n title={name}\n data-size={size}\n className={[\"ds-avatar\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {src ? <img
|
|
1
|
+
{"version":3,"file":"index.js","names":["initialsOf","words","name","Avatar","forwardRef","rest","size","className","src","AvatarGroup","shown","people","overflow","p","person"],"sources":["../../../src/components/Avatar/index.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from \"react\";\nimport \"./style.css\";\n\nexport type AvatarSize = 24 | 32 | 40;\n\nexport interface AvatarProps extends HTMLAttributes<HTMLSpanElement> {\n /** Required — drives the initials and the accessible name. */\n name: string;\n src?: string;\n size?: AvatarSize;\n}\n\nfunction initialsOf(name: string) {\n const words = name.trim().split(/\\s+/);\n const first = words[0]?.[0] ?? \"\";\n const last = words.length > 1 ? words[words.length - 1][0] : \"\";\n return (first + last).toUpperCase();\n}\n\n/**\n * Identifies a person at a glance in a dense surface. An identifier, not a\n * control — never colour-generated, never carrying a status dot.\n */\nexport const Avatar = forwardRef<HTMLSpanElement, AvatarProps>(function Avatar(\n { name, src, size = 24, className, ...rest },\n ref,\n) {\n return (\n <span\n ref={ref}\n role=\"img\"\n aria-label={name}\n title={name}\n data-size={size}\n className={[\"ds-avatar\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {src ? (\n <img\n src={src}\n alt=\"\"\n />\n ) : (\n initialsOf(name)\n )}\n </span>\n );\n});\n\nexport interface AvatarGroupProps extends HTMLAttributes<HTMLSpanElement> {\n /** Up to three render; the rest become a `+n` count. */\n people: { name: string; src?: string }[];\n size?: AvatarSize;\n}\n\n/** Overlapping stack of at most three avatars, then a `+n` chip. */\nexport const AvatarGroup = forwardRef<HTMLSpanElement, AvatarGroupProps>(function AvatarGroup(\n { people, size = 24, className, ...rest },\n ref,\n) {\n const shown = people.slice(0, 3);\n const overflow = people.length - shown.length;\n return (\n <span\n ref={ref}\n role=\"group\"\n aria-label={people.map((p) => p.name).join(\", \")}\n className={[\"ds-avatar-group\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {shown.map((person) => (\n <Avatar\n key={person.name}\n name={person.name}\n src={person.src}\n size={size}\n />\n ))}\n {overflow > 0 && <span className=\"ds-avatar-group__count\">+{overflow}</span>}\n </span>\n );\n});\n"],"mappings":";;;AAYA,SAASA,EAAW,GAAc;CAChC,IAAMC,IAAQC,EAAK,KAAK,CAAC,CAAC,MAAM,KAAK;CAGrC,SAFcD,EAAM,EAAE,GAAG,MAAM,OAClBA,EAAM,SAAS,IAAIA,EAAMA,EAAM,SAAS,EAAE,CAAC,KAAK,IAAA,CACvC,YAAY;AACpC;AAMA,IAAaE,IAASC,EAAyC,SAC7D,EAAE,SAAM,QAAK,UAAO,IAAI,cAAW,GAAGC,KACtC,GACA;CACA,OACE,kBAAC,QAAD;EACO;EACL,MAAK;EACL,cAAYH;EACZ,OAAOA;EACP,aAAWI;EACX,WAAW,CAAC,aAAaC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAC5D,GAAIF;EAEH,UAAAG,IACC,kBAAC,OAAD;GACO;GACL,KAAI;EACL,CAAA,IAEDR,EAAWE,CAAI;CAEb,CAAA;AAEV,CAAC,GASYO,IAAcL,EAA8C,SACvE,EAAE,WAAQ,UAAO,IAAI,cAAW,GAAGC,KACnC,GACA;CACA,IAAMK,IAAQC,EAAO,MAAM,GAAG,CAAC,GACzBC,IAAWD,EAAO,SAASD,EAAM;CACvC,OACE,kBAAC,QAAD;EACO;EACL,MAAK;EACL,cAAYC,EAAO,KAAK,MAAME,EAAE,IAAI,CAAC,CAAC,KAAK,IAAI;EAC/C,WAAW,CAAC,mBAAmBN,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAClE,GAAIF;EALN,UAAA,CAOGK,EAAM,KAAK,MACV,kBAACP,GAAD;GAEE,MAAMW,EAAO;GACb,KAAKA,EAAO;GACN;EACP,GAJMA,EAAO,IAIb,CACF,GACAF,IAAW,KAAK,kBAAC,QAAD;GAAM,WAAU;GAAhB,UAAA,CAAyC,KAAEA,CAAe;EACvE,CAAA,CAAA;;AAEV,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["forwardRef","react","react_jsx_runtime","Badge","rest","shape","value","children","appearance","tone","className"],"sources":["../../../src/components/Badge/index.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport \"./style.css\";\n\nexport type BadgeShape = \"status\" | \"tag\" | \"count\";\n\n/**\n * How much ink the badge spends.\n * - `outline` — the tone as a 2px stroke on the surface. The quiet default.\n * - `soft` — the tone's soft fill behind tone-coloured text. For dense tables.\n * - `solid` — the tone as a full fill. Reserve it for the one state a row is\n * really about; a table of solid badges reads as noise.\n */\nexport type BadgeAppearance = \"outline\" | \"soft\" | \"solid\";\n\n/** Six publication states, and no seventh without a decision record. */\nexport type StatusTone =\n
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["forwardRef","react","react_jsx_runtime","Badge","rest","shape","value","children","appearance","tone","className"],"sources":["../../../src/components/Badge/index.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport \"./style.css\";\n\nexport type BadgeShape = \"status\" | \"tag\" | \"count\";\n\n/**\n * How much ink the badge spends.\n * - `outline` — the tone as a 2px stroke on the surface. The quiet default.\n * - `soft` — the tone's soft fill behind tone-coloured text. For dense tables.\n * - `solid` — the tone as a full fill. Reserve it for the one state a row is\n * really about; a table of solid badges reads as noise.\n */\nexport type BadgeAppearance = \"outline\" | \"soft\" | \"solid\";\n\n/** Six publication states, and no seventh without a decision record. */\nexport type StatusTone =\n \"draft\" | \"scheduled\" | \"published\" | \"changed\" | \"unpublished\" | \"archived\";\n\nexport interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {\n shape?: BadgeShape;\n /** Required on `status`, forbidden on `tag` and `count`. */\n tone?: StatusTone;\n appearance?: BadgeAppearance;\n children?: ReactNode;\n}\n\n/**\n * A small, non-interactive label attached to something else. Never a button,\n * never a filter. Status tones are reserved for publication state.\n */\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n { shape = \"tag\", tone, appearance = \"outline\", className, children, ...rest },\n ref,\n) {\n if (shape === \"count\") {\n const value = Number(children);\n if (!Number.isNaN(value)) {\n if (value === 0) return null;\n children = value > 99 ? \"99+\" : String(value);\n }\n }\n\n return (\n <span\n ref={ref}\n data-shape={shape}\n data-appearance={appearance}\n data-tone={shape === \"status\" ? tone : undefined}\n className={[\"ds-badge\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {shape === \"status\" && (\n <span\n className=\"ds-badge__dot\"\n aria-hidden=\"true\"\n />\n )}\n {children}\n </span>\n );\n});\n"],"mappings":"A,yHA8BA,IAAaG,GAAA,EAAQH,EAAAA,WAAAA,CAAwC,SAC3D,CAAE,QAAQ,MAAO,OAAM,aAAa,UAAW,YAAW,WAAU,GAAGI,GACvE,EACA,CACA,GAAIC,IAAU,QAAS,CACrB,IAAMC,EAAQ,OAAOC,CAAQ,EAC7B,GAAI,CAAC,OAAO,MAAMD,CAAK,EAAG,CACxB,GAAIA,IAAU,EAAG,OAAO,KACxB,EAAWA,EAAQ,GAAK,MAAQ,OAAOA,CAAK,CAC9C,CACF,CAEA,OACE,EAAAJ,EAAA,KAAA,CAAC,OAAD,CACO,MACL,aAAYG,EACZ,kBAAiBG,EACjB,YAAWH,IAAU,SAAWI,EAAO,IAAA,GACvC,UAAW,CAAC,WAAYC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAC3D,GAAIN,EANN,SAAA,CAQGC,IAAU,WACT,EAAAH,EAAA,IAAA,CAAC,OAAD,CACE,UAAU,gBACV,cAAY,MACb,CAAA,EAEFK,CACG,C,EAEV,CAAC,E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Badge/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3D,wEAAwE;AACxE,MAAM,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Badge/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3D,wEAAwE;AACxE,MAAM,MAAM,UAAU,GACpB,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC;AAE/E,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,eAAe,CAAC;IACjE,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,KAAK,wGA8BhB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3D,wEAAwE;AACxE,MAAM,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3D,wEAAwE;AACxE,MAAM,MAAM,UAAU,GACpB,OAAO,GAAG,WAAW,GAAG,WAAW,GAAG,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC;AAE/E,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,eAAe,CAAC;IACjE,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,KAAK,wGA8BhB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Badge","forwardRef","rest","shape","value","children","appearance","tone","className"],"sources":["../../../src/components/Badge/index.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport \"./style.css\";\n\nexport type BadgeShape = \"status\" | \"tag\" | \"count\";\n\n/**\n * How much ink the badge spends.\n * - `outline` — the tone as a 2px stroke on the surface. The quiet default.\n * - `soft` — the tone's soft fill behind tone-coloured text. For dense tables.\n * - `solid` — the tone as a full fill. Reserve it for the one state a row is\n * really about; a table of solid badges reads as noise.\n */\nexport type BadgeAppearance = \"outline\" | \"soft\" | \"solid\";\n\n/** Six publication states, and no seventh without a decision record. */\nexport type StatusTone =\n
|
|
1
|
+
{"version":3,"file":"index.js","names":["Badge","forwardRef","rest","shape","value","children","appearance","tone","className"],"sources":["../../../src/components/Badge/index.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport \"./style.css\";\n\nexport type BadgeShape = \"status\" | \"tag\" | \"count\";\n\n/**\n * How much ink the badge spends.\n * - `outline` — the tone as a 2px stroke on the surface. The quiet default.\n * - `soft` — the tone's soft fill behind tone-coloured text. For dense tables.\n * - `solid` — the tone as a full fill. Reserve it for the one state a row is\n * really about; a table of solid badges reads as noise.\n */\nexport type BadgeAppearance = \"outline\" | \"soft\" | \"solid\";\n\n/** Six publication states, and no seventh without a decision record. */\nexport type StatusTone =\n \"draft\" | \"scheduled\" | \"published\" | \"changed\" | \"unpublished\" | \"archived\";\n\nexport interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {\n shape?: BadgeShape;\n /** Required on `status`, forbidden on `tag` and `count`. */\n tone?: StatusTone;\n appearance?: BadgeAppearance;\n children?: ReactNode;\n}\n\n/**\n * A small, non-interactive label attached to something else. Never a button,\n * never a filter. Status tones are reserved for publication state.\n */\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n { shape = \"tag\", tone, appearance = \"outline\", className, children, ...rest },\n ref,\n) {\n if (shape === \"count\") {\n const value = Number(children);\n if (!Number.isNaN(value)) {\n if (value === 0) return null;\n children = value > 99 ? \"99+\" : String(value);\n }\n }\n\n return (\n <span\n ref={ref}\n data-shape={shape}\n data-appearance={appearance}\n data-tone={shape === \"status\" ? tone : undefined}\n className={[\"ds-badge\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {shape === \"status\" && (\n <span\n className=\"ds-badge__dot\"\n aria-hidden=\"true\"\n />\n )}\n {children}\n </span>\n );\n});\n"],"mappings":";;;AA8BA,IAAaA,IAAQC,EAAwC,SAC3D,EAAE,WAAQ,OAAO,SAAM,gBAAa,WAAW,cAAW,aAAU,GAAGC,KACvE,GACA;CACA,IAAIC,MAAU,SAAS;EACrB,IAAMC,IAAQ,OAAOC,CAAQ;EAC7B,IAAI,CAAC,OAAO,MAAMD,CAAK,GAAG;GACxB,IAAIA,MAAU,GAAG,OAAO;GACxB,IAAWA,IAAQ,KAAK,QAAQ,OAAOA,CAAK;EAC9C;CACF;CAEA,OACE,kBAAC,QAAD;EACO;EACL,cAAYD;EACZ,mBAAiBG;EACjB,aAAWH,MAAU,WAAWI,IAAO,KAAA;EACvC,WAAW,CAAC,YAAYC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAC3D,GAAIN;EANN,UAAA,CAQGC,MAAU,YACT,kBAAC,QAAD;GACE,WAAU;GACV,eAAY;EACb,CAAA,GAEFE,CACG;;AAEV,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
--badge-soft: var(--color-surface-subtle);
|
|
5
5
|
--badge-solid: var(--color-text);
|
|
6
6
|
--badge-on-solid: var(--color-surface);
|
|
7
|
-
--badge-marker:
|
|
7
|
+
--badge-marker: currentcolor;
|
|
8
8
|
|
|
9
9
|
display: inline-flex;
|
|
10
10
|
align-items: center;
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
|
|
42
42
|
.ds-badge[data-appearance="soft"] {
|
|
43
43
|
--badge-marker: var(--badge-soft-marker, currentColor);
|
|
44
|
+
|
|
44
45
|
background: var(--badge-soft);
|
|
45
46
|
border-color: transparent;
|
|
46
47
|
color: var(--badge-ink);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Board-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Board-BUJ5CinL.cjs");exports.Board=e.t,exports.BoardCard=e.n,exports.BoardColumn=e.r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Board/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Board/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AA6Bf,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAwCD,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,WAAW,CAAC;IACnF,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACnC,wDAAwD;IACxD,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IAC/C,mEAAmE;IACnE,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,SAAS,CAAC;IAClD,qEAAqE;IACrE,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,SAAS,CAAC;IAC1D,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,KAAK,uGAoIhB,CAAC;AAEH,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACtE,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,wCAAwC;IACxC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,0GA8DtB,CAAC;AAEH,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,cAAc,CAAC;IACpE,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,2GAgCpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Board/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Board/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AA6Bf,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAwCD,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,WAAW,CAAC;IACnF,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACnC,wDAAwD;IACxD,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IAC/C,mEAAmE;IACnE,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,SAAS,CAAC;IAClD,qEAAqE;IACrE,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,SAAS,CAAC;IAC1D,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,KAAK,uGAoIhB,CAAC;AAEH,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACtE,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,wCAAwC;IACxC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,0GA8DtB,CAAC;AAEH,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,cAAc,CAAC;IACpE,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,2GAgCpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as Board, n as BoardCard, r as BoardColumn } from "../../chunks/Board-
|
|
1
|
+
export { t as Board, n as BoardCard, r as BoardColumn } from "../../chunks/Board-Cyrda2qG.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard.d.cts","sourceRoot":"","sources":["../../../src/components/Board/keyboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAG9D;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"keyboard.d.cts","sourceRoot":"","sources":["../../../src/components/Board/keyboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAG9D;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,wBAqBnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../../src/components/Board/keyboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAG9D;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../../src/components/Board/keyboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAG9D;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,wBAqBnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moves.d.cts","sourceRoot":"","sources":["../../../src/components/Board/moves.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC;AAEpD,wBAAgB,UAAU,
|
|
1
|
+
{"version":3,"file":"moves.d.cts","sourceRoot":"","sources":["../../../src/components/Board/moves.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC;AAEpD,wBAAgB,UAAU,CACxB,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,YAAY,EAC9B,SAAS,EAAE,MAAM,EAAE,GAClB,eAAe,GAAG,SAAS,CAO7B;AAED,wBAAgB,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS,CAa9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moves.d.ts","sourceRoot":"","sources":["../../../src/components/Board/moves.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC;AAEpD,wBAAgB,UAAU,
|
|
1
|
+
{"version":3,"file":"moves.d.ts","sourceRoot":"","sources":["../../../src/components/Board/moves.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC;AAEpD,wBAAgB,UAAU,CACxB,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,YAAY,EAC9B,SAAS,EAAE,MAAM,EAAE,GAClB,eAAe,GAAG,SAAS,CAO7B;AAED,wBAAgB,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS,CAa9E"}
|
|
@@ -27,9 +27,8 @@
|
|
|
27
27
|
|
|
28
28
|
/* A lane being reordered says so by travelling, not by growing an edge. */
|
|
29
29
|
|
|
30
|
-
|
|
31
30
|
.ds-board-column[data-dragging] {
|
|
32
|
-
opacity: 35
|
|
31
|
+
opacity: 0.35;
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
.ds-board-column[data-overlay] {
|
|
@@ -37,15 +36,19 @@
|
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
/* The lane grip sits on top of the head — the whole lane travels with it.
|
|
40
|
-
* Qualified so grab outranks Button's pointer
|
|
41
|
-
* stylesheet loads after this file. */
|
|
39
|
+
* Qualified so grab outranks Button's pointer. */
|
|
42
40
|
.ds-board-column__grip.ds-button,
|
|
43
41
|
.ds-board-card__handle.ds-button {
|
|
44
42
|
flex: none;
|
|
45
|
-
cursor: grab;
|
|
46
43
|
touch-action: none;
|
|
47
44
|
}
|
|
48
45
|
|
|
46
|
+
/* Disabled and pending handles keep Button's cursor. */
|
|
47
|
+
.ds-board-column__grip.ds-button:not(:disabled, [data-pending]),
|
|
48
|
+
.ds-board-card__handle.ds-button:not(:disabled, [data-pending]) {
|
|
49
|
+
cursor: grab;
|
|
50
|
+
}
|
|
51
|
+
|
|
49
52
|
/* The drag overlay's grip is a picture of the handle, not a second control. */
|
|
50
53
|
span.ds-board-card__handle {
|
|
51
54
|
display: inline-flex;
|
|
@@ -57,7 +60,9 @@
|
|
|
57
60
|
color: var(--color-text-muted);
|
|
58
61
|
}
|
|
59
62
|
|
|
60
|
-
.ds-board-column__grip {
|
|
63
|
+
.ds-board-column__grip {
|
|
64
|
+
inline-size: 100%;
|
|
65
|
+
}
|
|
61
66
|
|
|
62
67
|
.ds-board-column__head {
|
|
63
68
|
display: flex;
|
|
@@ -120,7 +125,7 @@
|
|
|
120
125
|
|
|
121
126
|
/* The card left behind stays in place as a ghost — the row never collapses. */
|
|
122
127
|
.ds-board-card[data-dragging] {
|
|
123
|
-
opacity: 35
|
|
128
|
+
opacity: 0.35;
|
|
124
129
|
}
|
|
125
130
|
|
|
126
131
|
.ds-board-card[data-overlay] {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-CW6qJcDy.cjs");let t=require("react"),n=require("react/jsx-runtime");var r=(0,t.forwardRef)(function({variant:t=`neutral`,size:r=`md`,iconStart:i,iconEnd:a,isIconOnly:o=!1,isDisabled:s=!1,isPending:c=!1,className:l,children:u,type:d=`button`,...f},p){let m=r===`lg`?20:16;return(0,n.jsxs)(`button`,{ref:p,type:d,disabled:s||c,"data-variant":t,"data-size":r,"data-icon-only":o||void 0,"data-pending":c||void 0,className:[`ds-button`,l].filter(Boolean).join(` `),...f,children:[c?(0,n.jsx)(e.t,{name:`spinner`,size:m,className:`ds-button__spinner ds-icon--spin`}):i&&(0,n.jsx)(e.t,{name:i,size:m}),(!o||!i&&!c)&&u,a&&!o&&(0,n.jsx)(e.t,{name:a,size:m})]})});exports.Button=r;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["forwardRef","Icon","require_Icon","react","react_jsx_runtime","Button","rest","glyph","size","isDisabled","isPending","variant","isIconOnly","className","iconStart","children","iconEnd"],"sources":["../../../src/components/Button/index.tsx"],"sourcesContent":["import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { Icon } from \"../Icon\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\nexport type ButtonVariant = \"primary\" | \"neutral\" | \"danger\" | \"active\" | \"simple\";\nexport type ButtonSize = \"xs\" | \"sm\" | \"md\" | \"lg\";\n\nexport interface ButtonProps
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["forwardRef","Icon","require_Icon","react","react_jsx_runtime","Button","rest","glyph","size","isDisabled","isPending","variant","isIconOnly","className","iconStart","children","iconEnd"],"sources":["../../../src/components/Button/index.tsx"],"sourcesContent":["import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { Icon } from \"../Icon\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\nexport type ButtonVariant = \"primary\" | \"neutral\" | \"danger\" | \"active\" | \"simple\";\nexport type ButtonSize = \"xs\" | \"sm\" | \"md\" | \"lg\";\n\nexport interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"disabled\"> {\n variant?: ButtonVariant;\n /** `xs` is for compact actions inside a field or chip, such as clear and remove. */\n size?: ButtonSize;\n iconStart?: IconName;\n iconEnd?: IconName;\n /** Square button. Label with aria-label/aria-labelledby. Children can supply a custom glyph. */\n isIconOnly?: boolean;\n isDisabled?: boolean;\n /** Label stays, spinner replaces `iconStart`, press is blocked. */\n isPending?: boolean;\n children?: ReactNode;\n}\n\n/**\n * Every action the user can take. One primary per view; a sixth variant is a\n * conversation, not a prop.\n */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n variant = \"neutral\",\n size = \"md\",\n iconStart,\n iconEnd,\n isIconOnly = false,\n isDisabled = false,\n isPending = false,\n className,\n children,\n type = \"button\",\n ...rest\n },\n ref,\n) {\n const glyph = size === \"lg\" ? 20 : 16;\n return (\n <button\n ref={ref}\n type={type}\n disabled={isDisabled || isPending}\n data-variant={variant}\n data-size={size}\n data-icon-only={isIconOnly || undefined}\n data-pending={isPending || undefined}\n className={[\"ds-button\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {isPending ? (\n <Icon\n name=\"spinner\"\n size={glyph}\n className=\"ds-button__spinner ds-icon--spin\"\n />\n ) : (\n iconStart && (\n <Icon\n name={iconStart}\n size={glyph}\n />\n )\n )}\n {(!isIconOnly || (!iconStart && !isPending)) && children}\n {iconEnd && !isIconOnly && (\n <Icon\n name={iconEnd}\n size={glyph}\n />\n )}\n </button>\n );\n});\n"],"mappings":"A,2KA0BA,IAAaK,GAAA,EAASL,EAAAA,WAAAA,CAA2C,SAC/D,CACE,UAAU,UACV,OAAO,KACP,YACA,UACA,aAAa,GACb,aAAa,GACb,YAAY,GACZ,YACA,WACA,OAAO,SACP,GAAGM,GAEL,EACA,CACA,IAAMC,EAAQC,IAAS,KAAO,GAAK,GACnC,OACE,EAAAJ,EAAA,KAAA,CAAC,SAAD,CACO,MACC,OACN,SAAUK,GAAcC,EACxB,eAAcC,EACd,YAAWH,EACX,iBAAgBI,GAAc,IAAA,GAC9B,eAAcF,GAAa,IAAA,GAC3B,UAAW,CAAC,YAAaG,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAC5D,GAAIP,EATN,SAAA,CAWGI,GACC,EAAAN,EAAA,IAAA,CAACH,EAAAA,EAAD,CACE,KAAK,UACL,KAAMM,EACN,UAAU,kCACX,CAAA,EAEDO,IACE,EAAAV,EAAA,IAAA,CAACH,EAAAA,EAAD,CACE,KAAMa,EACN,KAAMP,CACP,CAAA,GAGH,CAACK,GAAe,CAACE,GAAa,CAACJ,IAAeK,EAC/CC,GAAW,CAACJ,IACX,EAAAR,EAAA,IAAA,CAACH,EAAAA,EAAD,CACE,KAAMe,EACN,KAAMT,CACP,CAAA,CAEG,C,EAEZ,CAAC,E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AACnF,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnD,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AACnF,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnD,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC5F,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,oFAAoF;IACpF,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,SAAS,CAAC,EAAE,QAAQ,CAAC;IACrB,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,gGAAgG;IAChG,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mEAAmE;IACnE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,2GAoDjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AACnF,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnD,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AACnF,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnD,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC5F,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,oFAAoF;IACpF,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,SAAS,CAAC,EAAE,QAAQ,CAAC;IACrB,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,gGAAgG;IAChG,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mEAAmE;IACnE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,2GAoDjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Icon","Button","forwardRef","rest","glyph","size","isDisabled","isPending","variant","isIconOnly","className","iconStart","children","iconEnd"],"sources":["../../../src/components/Button/index.tsx"],"sourcesContent":["import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { Icon } from \"../Icon\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\nexport type ButtonVariant = \"primary\" | \"neutral\" | \"danger\" | \"active\" | \"simple\";\nexport type ButtonSize = \"xs\" | \"sm\" | \"md\" | \"lg\";\n\nexport interface ButtonProps
|
|
1
|
+
{"version":3,"file":"index.js","names":["Icon","Button","forwardRef","rest","glyph","size","isDisabled","isPending","variant","isIconOnly","className","iconStart","children","iconEnd"],"sources":["../../../src/components/Button/index.tsx"],"sourcesContent":["import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { Icon } from \"../Icon\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\nexport type ButtonVariant = \"primary\" | \"neutral\" | \"danger\" | \"active\" | \"simple\";\nexport type ButtonSize = \"xs\" | \"sm\" | \"md\" | \"lg\";\n\nexport interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"disabled\"> {\n variant?: ButtonVariant;\n /** `xs` is for compact actions inside a field or chip, such as clear and remove. */\n size?: ButtonSize;\n iconStart?: IconName;\n iconEnd?: IconName;\n /** Square button. Label with aria-label/aria-labelledby. Children can supply a custom glyph. */\n isIconOnly?: boolean;\n isDisabled?: boolean;\n /** Label stays, spinner replaces `iconStart`, press is blocked. */\n isPending?: boolean;\n children?: ReactNode;\n}\n\n/**\n * Every action the user can take. One primary per view; a sixth variant is a\n * conversation, not a prop.\n */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n variant = \"neutral\",\n size = \"md\",\n iconStart,\n iconEnd,\n isIconOnly = false,\n isDisabled = false,\n isPending = false,\n className,\n children,\n type = \"button\",\n ...rest\n },\n ref,\n) {\n const glyph = size === \"lg\" ? 20 : 16;\n return (\n <button\n ref={ref}\n type={type}\n disabled={isDisabled || isPending}\n data-variant={variant}\n data-size={size}\n data-icon-only={isIconOnly || undefined}\n data-pending={isPending || undefined}\n className={[\"ds-button\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {isPending ? (\n <Icon\n name=\"spinner\"\n size={glyph}\n className=\"ds-button__spinner ds-icon--spin\"\n />\n ) : (\n iconStart && (\n <Icon\n name={iconStart}\n size={glyph}\n />\n )\n )}\n {(!isIconOnly || (!iconStart && !isPending)) && children}\n {iconEnd && !isIconOnly && (\n <Icon\n name={iconEnd}\n size={glyph}\n />\n )}\n </button>\n );\n});\n"],"mappings":";;;;AA0BA,IAAaC,IAASC,EAA2C,SAC/D,EACE,aAAU,WACV,UAAO,MACP,cACA,YACA,gBAAa,IACb,gBAAa,IACb,eAAY,IACZ,cACA,aACA,UAAO,UACP,GAAGC,KAEL,GACA;CACA,IAAMC,IAAQC,MAAS,OAAO,KAAK;CACnC,OACE,kBAAC,UAAD;EACO;EACC;EACN,UAAUC,KAAcC;EACxB,gBAAcC;EACd,aAAWH;EACX,kBAAgBI,KAAc,KAAA;EAC9B,gBAAcF,KAAa,KAAA;EAC3B,WAAW,CAAC,aAAaG,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAC5D,GAAIP;EATN,UAAA;GAWGI,IACC,kBAACP,GAAD;IACE,MAAK;IACL,MAAMI;IACN,WAAU;GACX,CAAA,IAEDO,KACE,kBAACX,GAAD;IACE,MAAMW;IACN,MAAMP;GACP,CAAA;IAGH,CAACK,KAAe,CAACE,KAAa,CAACJ,MAAeK;GAC/CC,KAAW,CAACJ,KACX,kBAACT,GAAD;IACE,MAAMa;IACN,MAAMT;GACP,CAAA;EAEG;;AAEZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["forwardRef","react","react_jsx_runtime","ButtonGroup","rest","isAttached","orientation","className"],"sources":["../../../src/components/ButtonGroup/index.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport \"./style.css\";\n\nexport type ButtonGroupOrientation = \"horizontal\" | \"vertical\";\n\nexport interface ButtonGroupProps extends HTMLAttributes<HTMLDivElement> {\n /** Attached segments read as one control; spaced reads as related actions. */\n isAttached?: boolean;\n orientation?: ButtonGroupOrientation;\n /** Required when the group itself carries the meaning (e.g. a view switcher). */\n \"aria-label\"?: string;\n children?: ReactNode;\n}\n\n/**\n * A row of `Button`s that belong to one decision. Mark the current segment with\n * `variant=\"active\"` and `aria-pressed` — the group adds no selection state of\n * its own, so it stays a layout contract rather than a second control API.\n */\nexport const ButtonGroup = forwardRef<HTMLDivElement, ButtonGroupProps>(
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["forwardRef","react","react_jsx_runtime","ButtonGroup","rest","isAttached","orientation","className"],"sources":["../../../src/components/ButtonGroup/index.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport \"./style.css\";\n\nexport type ButtonGroupOrientation = \"horizontal\" | \"vertical\";\n\nexport interface ButtonGroupProps extends HTMLAttributes<HTMLDivElement> {\n /** Attached segments read as one control; spaced reads as related actions. */\n isAttached?: boolean;\n orientation?: ButtonGroupOrientation;\n /** Required when the group itself carries the meaning (e.g. a view switcher). */\n \"aria-label\"?: string;\n children?: ReactNode;\n}\n\n/**\n * A row of `Button`s that belong to one decision. Mark the current segment with\n * `variant=\"active\"` and `aria-pressed` — the group adds no selection state of\n * its own, so it stays a layout contract rather than a second control API.\n */\nexport const ButtonGroup = forwardRef<HTMLDivElement, ButtonGroupProps>(function ButtonGroup(\n { isAttached = true, orientation = \"horizontal\", className, children, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n role=\"group\"\n data-attached={isAttached}\n data-orientation={orientation}\n className={[\"ds-button-group\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {children}\n </div>\n );\n});\n"],"mappings":"A,yHAmBA,IAAaG,GAAA,EAAcH,EAAAA,WAAAA,CAA6C,SACtE,CAAE,aAAa,GAAM,cAAc,aAAc,YAAW,WAAU,GAAGI,GACzE,EACA,CACA,OACE,EAAAF,EAAA,IAAA,CAAC,MAAD,CACO,MACL,KAAK,QACL,gBAAeG,EACf,mBAAkBC,EAClB,UAAW,CAAC,kBAAmBC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAClE,GAAIH,EAEH,UACE,CAAA,CAET,CAAC,E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonGroup/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,sBAAsB,GAAG,YAAY,GAAG,UAAU,CAAC;AAE/D,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACtE,8EAA8E;IAC9E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,sBAAsB,CAAC;IACrC,iFAAiF;IACjF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonGroup/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,sBAAsB,GAAG,YAAY,GAAG,UAAU,CAAC;AAE/D,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACtE,8EAA8E;IAC9E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,sBAAsB,CAAC;IACrC,iFAAiF;IACjF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,6GAgBtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonGroup/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,sBAAsB,GAAG,YAAY,GAAG,UAAU,CAAC;AAE/D,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACtE,8EAA8E;IAC9E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,sBAAsB,CAAC;IACrC,iFAAiF;IACjF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ButtonGroup/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,sBAAsB,GAAG,YAAY,GAAG,UAAU,CAAC;AAE/D,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACtE,8EAA8E;IAC9E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,sBAAsB,CAAC;IACrC,iFAAiF;IACjF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,6GAgBtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ButtonGroup","forwardRef","rest","isAttached","orientation","className"],"sources":["../../../src/components/ButtonGroup/index.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport \"./style.css\";\n\nexport type ButtonGroupOrientation = \"horizontal\" | \"vertical\";\n\nexport interface ButtonGroupProps extends HTMLAttributes<HTMLDivElement> {\n /** Attached segments read as one control; spaced reads as related actions. */\n isAttached?: boolean;\n orientation?: ButtonGroupOrientation;\n /** Required when the group itself carries the meaning (e.g. a view switcher). */\n \"aria-label\"?: string;\n children?: ReactNode;\n}\n\n/**\n * A row of `Button`s that belong to one decision. Mark the current segment with\n * `variant=\"active\"` and `aria-pressed` — the group adds no selection state of\n * its own, so it stays a layout contract rather than a second control API.\n */\nexport const ButtonGroup = forwardRef<HTMLDivElement, ButtonGroupProps>(
|
|
1
|
+
{"version":3,"file":"index.js","names":["ButtonGroup","forwardRef","rest","isAttached","orientation","className"],"sources":["../../../src/components/ButtonGroup/index.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes, type ReactNode } from \"react\";\nimport \"./style.css\";\n\nexport type ButtonGroupOrientation = \"horizontal\" | \"vertical\";\n\nexport interface ButtonGroupProps extends HTMLAttributes<HTMLDivElement> {\n /** Attached segments read as one control; spaced reads as related actions. */\n isAttached?: boolean;\n orientation?: ButtonGroupOrientation;\n /** Required when the group itself carries the meaning (e.g. a view switcher). */\n \"aria-label\"?: string;\n children?: ReactNode;\n}\n\n/**\n * A row of `Button`s that belong to one decision. Mark the current segment with\n * `variant=\"active\"` and `aria-pressed` — the group adds no selection state of\n * its own, so it stays a layout contract rather than a second control API.\n */\nexport const ButtonGroup = forwardRef<HTMLDivElement, ButtonGroupProps>(function ButtonGroup(\n { isAttached = true, orientation = \"horizontal\", className, children, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n role=\"group\"\n data-attached={isAttached}\n data-orientation={orientation}\n className={[\"ds-button-group\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {children}\n </div>\n );\n});\n"],"mappings":";;;AAmBA,IAAaA,IAAcC,EAA6C,SACtE,EAAE,gBAAa,IAAM,iBAAc,cAAc,cAAW,aAAU,GAAGC,KACzE,GACA;CACA,OACE,kBAAC,OAAD;EACO;EACL,MAAK;EACL,iBAAeC;EACf,oBAAkBC;EAClB,WAAW,CAAC,mBAAmBC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAClE,GAAIH;EAEH;CACE,CAAA;AAET,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["forwardRef","useRef","Stack","Grid","require_components_Grid_index","react","react_jsx_runtime","Checkbox","rest","inner","isIndeterminate","className","node","ref","children","Radio","ChoiceGroup","label","columns"],"sources":["../../../src/components/Choice/index.tsx"],"sourcesContent":["import { forwardRef, useEffect, useRef, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { Grid, Stack } from \"../Grid\";\nimport \"./style.css\";\n\nexport interface CheckboxProps
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["forwardRef","useRef","Stack","Grid","require_components_Grid_index","react","react_jsx_runtime","Checkbox","rest","inner","isIndeterminate","className","node","ref","children","Radio","ChoiceGroup","label","columns"],"sources":["../../../src/components/Choice/index.tsx"],"sourcesContent":["import { forwardRef, useEffect, useRef, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { Grid, Stack } from \"../Grid\";\nimport \"./style.css\";\n\nexport interface CheckboxProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"size\"\n> {\n /** Display state only — clicking an indeterminate box selects all. */\n isIndeterminate?: boolean;\n children?: ReactNode;\n}\n\n/** An independent yes/no. 20px box at every size, in every context. */\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n { isIndeterminate = false, className, children, ...rest },\n ref,\n) {\n const inner = useRef<HTMLInputElement | null>(null);\n\n useEffect(() => {\n if (inner.current) inner.current.indeterminate = isIndeterminate;\n }, [isIndeterminate]);\n\n return (\n <label className={[\"ds-choice\", className].filter(Boolean).join(\" \")}>\n <input\n type=\"checkbox\"\n className=\"ds-choice__control\"\n data-kind=\"checkbox\"\n ref={(node) => {\n inner.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n {...rest}\n />\n {children && <span className=\"ds-choice__label\">{children}</span>}\n </label>\n );\n});\n\nexport interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\" | \"size\"> {\n children?: ReactNode;\n}\n\n/** One of two or more mutually exclusive choices, all of them visible. */\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(function Radio(\n { className, children, ...rest },\n ref,\n) {\n return (\n <label className={[\"ds-choice\", className].filter(Boolean).join(\" \")}>\n <input\n ref={ref}\n type=\"radio\"\n className=\"ds-choice__control\"\n data-kind=\"radio\"\n {...rest}\n />\n {children && <span className=\"ds-choice__label\">{children}</span>}\n </label>\n );\n});\n\nexport interface ChoiceGroupProps {\n label: string;\n /**\n * Run a long list in columns instead of one stack. Steps down to a single\n * column inside a narrow container.\n */\n columns?: 1 | 2 | 3;\n children: ReactNode;\n}\n\n/** A set of checkboxes or radios under one group label, spaced by Stack or Grid. */\nexport function ChoiceGroup({ label, columns = 1, children }: ChoiceGroupProps) {\n return (\n <fieldset className=\"ds-choice-group\">\n <legend className=\"ds-choice-group__label\">{label}</legend>\n {columns === 1 ? (\n <Stack gap=\"sm\">{children}</Stack>\n ) : (\n <Grid\n columns={columns}\n gap=\"sm\"\n >\n {children}\n </Grid>\n )}\n </fieldset>\n );\n}\n"],"mappings":"A,8JAcA,IAAaO,GAAA,EAAWP,EAAAA,WAAAA,CAA4C,SAClE,CAAE,kBAAkB,GAAO,YAAW,WAAU,GAAGQ,GACnD,EACA,CACA,IAAMC,GAAA,EAAQR,EAAAA,OAAAA,CAAgC,IAAI,EAMlD,OAJA,EAAAI,EAAA,UAAA,KAAgB,CACVI,EAAM,UAAS,EAAM,QAAQ,cAAgBC,EACnD,EAAG,CAACA,CAAe,CAAC,GAGlB,EAAAJ,EAAA,KAAA,CAAC,QAAD,CAAO,UAAW,CAAC,YAAaK,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAAnE,SAAA,EACE,EAAAL,EAAA,IAAA,CAAC,QAAD,CACE,KAAK,WACL,UAAU,qBACV,YAAU,WACV,IAAM,GAAS,CACb,EAAM,QAAUM,EACZ,OAAOC,GAAQ,WAAYA,EAAID,CAAI,EAC9BC,IAAK,EAAI,QAAUD,EAC9B,EACA,GAAIJ,CACL,CAAA,EACAM,IAAY,EAAAR,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,mBAAoB,UAAe,CAAA,CAC3D,C,EAEX,CAAC,EAOYS,GAAA,EAAQf,EAAAA,WAAAA,CAAyC,SAC5D,CAAE,YAAW,WAAU,GAAGQ,GAC1B,EACA,CACA,OACE,EAAAF,EAAA,KAAA,CAAC,QAAD,CAAO,UAAW,CAAC,YAAaK,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAAnE,SAAA,EACE,EAAAL,EAAA,IAAA,CAAC,QAAD,CACO,MACL,KAAK,QACL,UAAU,qBACV,YAAU,QACV,GAAIE,CACL,CAAA,EACAM,IAAY,EAAAR,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,mBAAoB,UAAe,CAAA,CAC3D,C,EAEX,CAAC,EAaD,SAAgBU,EAAY,CAAE,QAAO,UAAU,EAAG,YAA8B,CAC9E,OACE,EAAAV,EAAA,KAAA,CAAC,WAAD,CAAU,UAAU,kBAApB,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,SAAD,CAAQ,UAAU,yBAA0B,SAAAW,CAAc,CAAA,EACzDC,IAAY,GACX,EAAAZ,EAAA,IAAA,CAACJ,EAAAA,MAAD,CAAO,IAAI,KAAM,UAAgB,CAAA,GAEjC,EAAAI,EAAA,IAAA,CAACH,EAAAA,KAAD,CACW,UACT,IAAI,KAEH,UACG,CAAA,CAEA,C,EAEd,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Choice/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEhG,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Choice/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEhG,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,aAAc,SAAQ,IAAI,CACzC,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,MAAM,CAChB;IACC,sEAAsE;IACtE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,uEAAuE;AACvE,eAAO,MAAM,QAAQ,4GA0BnB,CAAC;AAEH,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9F,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,0EAA0E;AAC1E,eAAO,MAAM,KAAK,yGAgBhB,CAAC;AAEH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,oFAAoF;AACpF,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,OAAW,EAAE,QAAQ,EAAE,EAAE,gBAAgB,+BAgB7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Choice/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEhG,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Choice/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEhG,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,aAAc,SAAQ,IAAI,CACzC,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,MAAM,CAChB;IACC,sEAAsE;IACtE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,uEAAuE;AACvE,eAAO,MAAM,QAAQ,4GA0BnB,CAAC;AAEH,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9F,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,0EAA0E;AAC1E,eAAO,MAAM,KAAK,yGAgBhB,CAAC;AAEH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,oFAAoF;AACpF,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,OAAW,EAAE,QAAQ,EAAE,EAAE,gBAAgB,+BAgB7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Checkbox","forwardRef","rest","inner","useRef","useEffect","isIndeterminate","className","node","ref","children","Radio","ChoiceGroup","label","columns","Stack","Grid"],"sources":["../../../src/components/Choice/index.tsx"],"sourcesContent":["import { forwardRef, useEffect, useRef, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { Grid, Stack } from \"../Grid\";\nimport \"./style.css\";\n\nexport interface CheckboxProps
|
|
1
|
+
{"version":3,"file":"index.js","names":["Checkbox","forwardRef","rest","inner","useRef","useEffect","isIndeterminate","className","node","ref","children","Radio","ChoiceGroup","label","columns","Stack","Grid"],"sources":["../../../src/components/Choice/index.tsx"],"sourcesContent":["import { forwardRef, useEffect, useRef, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { Grid, Stack } from \"../Grid\";\nimport \"./style.css\";\n\nexport interface CheckboxProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"size\"\n> {\n /** Display state only — clicking an indeterminate box selects all. */\n isIndeterminate?: boolean;\n children?: ReactNode;\n}\n\n/** An independent yes/no. 20px box at every size, in every context. */\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n { isIndeterminate = false, className, children, ...rest },\n ref,\n) {\n const inner = useRef<HTMLInputElement | null>(null);\n\n useEffect(() => {\n if (inner.current) inner.current.indeterminate = isIndeterminate;\n }, [isIndeterminate]);\n\n return (\n <label className={[\"ds-choice\", className].filter(Boolean).join(\" \")}>\n <input\n type=\"checkbox\"\n className=\"ds-choice__control\"\n data-kind=\"checkbox\"\n ref={(node) => {\n inner.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n {...rest}\n />\n {children && <span className=\"ds-choice__label\">{children}</span>}\n </label>\n );\n});\n\nexport interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\" | \"size\"> {\n children?: ReactNode;\n}\n\n/** One of two or more mutually exclusive choices, all of them visible. */\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(function Radio(\n { className, children, ...rest },\n ref,\n) {\n return (\n <label className={[\"ds-choice\", className].filter(Boolean).join(\" \")}>\n <input\n ref={ref}\n type=\"radio\"\n className=\"ds-choice__control\"\n data-kind=\"radio\"\n {...rest}\n />\n {children && <span className=\"ds-choice__label\">{children}</span>}\n </label>\n );\n});\n\nexport interface ChoiceGroupProps {\n label: string;\n /**\n * Run a long list in columns instead of one stack. Steps down to a single\n * column inside a narrow container.\n */\n columns?: 1 | 2 | 3;\n children: ReactNode;\n}\n\n/** A set of checkboxes or radios under one group label, spaced by Stack or Grid. */\nexport function ChoiceGroup({ label, columns = 1, children }: ChoiceGroupProps) {\n return (\n <fieldset className=\"ds-choice-group\">\n <legend className=\"ds-choice-group__label\">{label}</legend>\n {columns === 1 ? (\n <Stack gap=\"sm\">{children}</Stack>\n ) : (\n <Grid\n columns={columns}\n gap=\"sm\"\n >\n {children}\n </Grid>\n )}\n </fieldset>\n );\n}\n"],"mappings":";;;;AAcA,IAAaA,IAAWC,EAA4C,SAClE,EAAE,qBAAkB,IAAO,cAAW,aAAU,GAAGC,KACnD,GACA;CACA,IAAMC,IAAQC,EAAgC,IAAI;CAMlD,OAJAC,QAAgB;EACd,AAAIF,EAAM,YAAS,EAAM,QAAQ,gBAAgBG;CACnD,GAAG,CAACA,CAAe,CAAC,GAGlB,kBAAC,SAAD;EAAO,WAAW,CAAC,aAAaC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAAnE,UAAA,CACE,kBAAC,SAAD;GACE,MAAK;GACL,WAAU;GACV,aAAU;GACV,MAAM,MAAS;IAEb,AADA,EAAM,UAAUC,GACZ,OAAOC,KAAQ,aAAYA,EAAID,CAAI,IAC9BC,MAAK,EAAI,UAAUD;GAC9B;GACA,GAAIN;EACL,CAAA,GACAQ,KAAY,kBAAC,QAAD;GAAM,WAAU;GAAoB;EAAe,CAAA,CAC3D;;AAEX,CAAC,GAOYC,IAAQV,EAAyC,SAC5D,EAAE,cAAW,aAAU,GAAGC,KAC1B,GACA;CACA,OACE,kBAAC,SAAD;EAAO,WAAW,CAAC,aAAaK,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAAnE,UAAA,CACE,kBAAC,SAAD;GACO;GACL,MAAK;GACL,WAAU;GACV,aAAU;GACV,GAAIL;EACL,CAAA,GACAQ,KAAY,kBAAC,QAAD;GAAM,WAAU;GAAoB;EAAe,CAAA,CAC3D;;AAEX,CAAC;AAaD,SAAgBE,EAAY,EAAE,UAAO,aAAU,GAAG,eAA8B;CAC9E,OACE,kBAAC,YAAD;EAAU,WAAU;EAApB,UAAA,CACE,kBAAC,UAAD;GAAQ,WAAU;GAA0B,UAAAC;EAAc,CAAA,GACzDC,MAAY,IACX,kBAACC,GAAD;GAAO,KAAI;GAAM;EAAgB,CAAA,IAEjC,kBAACC,GAAD;GACW;GACT,KAAI;GAEH;EACG,CAAA,CAEA;;AAEd"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-CW6qJcDy.cjs"),t=require("../Button/index.cjs");;/* empty css */const n=require("../Popover/index.cjs");let r=require("react"),i=require("react/jsx-runtime");function a(...e){return e.filter(Boolean).join(` `)}var o=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`];function s(e){let t=`${e.getMonth()+1}`.padStart(2,`0`),n=`${e.getDate()}`.padStart(2,`0`);return`${e.getFullYear()}-${t}-${n}`}function c(e){if(!e||!/^\d{4}-\d{2}-\d{2}$/.test(e))return null;let[t,n,r]=e.split(`-`).map(Number);if(!t||!n||!r)return null;let i=new Date(t,n-1,r);return Number.isNaN(i.getTime())||s(i)!==e?null:i}function l(e){let t=c(e);return t?t.toLocaleDateString(`en-GB`,{day:`numeric`,month:`long`,year:`numeric`}):``}function u(e){return e.toLocaleDateString(`en-GB`,{month:`long`,year:`numeric`})}function d(e){let t=new Date(e.getFullYear(),e.getMonth(),1),n=(t.getDay()+6)%7;return new Date(t.getFullYear(),t.getMonth(),1-n)}function f(e,t,n){return e?`primary`:t?`active`:n?`neutral`:`simple`}var p=(0,r.forwardRef)(function({value:e,endValue:n,onSelect:p,min:m,max:h,className:g,..._},v){let y=c(e),[b,x]=(0,r.useState)(()=>y??new Date),[S,C]=(0,r.useState)(()=>e??s(new Date)),w=(0,r.useRef)(null),T=(0,r.useRef)(!1);(0,r.useEffect)(()=>{let t=c(e);t&&(C(e),x(new Date(t.getFullYear(),t.getMonth(),1)))},[e]),(0,r.useEffect)(()=>{T.current&&(T.current=!1,w.current?.querySelector(`[data-focused]`)?.focus())},[S]);let E=Array.from({length:42},(e,t)=>{let n=d(b);return new Date(n.getFullYear(),n.getMonth(),n.getDate()+t)}),D=s(new Date),O=e=>{let t=new Date(b.getFullYear(),b.getMonth()+e,1);x(t),C(s(t))},k=e=>{let t=c(S)??new Date,n=new Date(t.getFullYear(),t.getMonth(),t.getDate()+e);T.current=!0,C(s(n)),x(new Date(n.getFullYear(),n.getMonth(),1))},A=e=>{let t={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7,PageUp:-28,PageDown:28}[e.key];t!==void 0&&(e.preventDefault(),k(t))};return(0,i.jsxs)(`div`,{ref:v,className:a(`ds-calendar`,g),..._,children:[(0,i.jsxs)(`div`,{className:`ds-calendar__head`,children:[(0,i.jsx)(t.Button,{variant:`simple`,size:`sm`,isIconOnly:!0,iconStart:`chevron-left`,"aria-label":`Previous month`,onClick:()=>O(-1)}),(0,i.jsx)(`span`,{className:`ds-calendar__month`,children:u(b)}),(0,i.jsx)(t.Button,{variant:`simple`,size:`sm`,isIconOnly:!0,iconStart:`chevron-right`,"aria-label":`Next month`,onClick:()=>O(1)})]}),(0,i.jsx)(`div`,{className:`ds-calendar__weekdays`,"aria-hidden":`true`,children:o.map(e=>(0,i.jsx)(`span`,{children:e.slice(0,2)},e))}),(0,i.jsx)(`div`,{ref:w,className:`ds-calendar__grid`,role:`grid`,onKeyDown:A,children:Array.from({length:6},(r,a)=>(0,i.jsx)(`div`,{role:`row`,className:`ds-calendar__row`,children:E.slice(a*7,a*7+7).map(r=>{let a=s(r),o=r.getMonth()!==b.getMonth(),c=m&&a<m||h&&a>h,u=!!(e&&n&&a>e&&a<n),d=a===e||a===n;return(0,i.jsx)(t.Button,{variant:f(d,u,a===D),size:`sm`,isIconOnly:!0,role:`gridcell`,"aria-label":l(a),tabIndex:a===S?0:-1,isDisabled:!!c,"aria-selected":d||void 0,"data-outside":o||void 0,"data-today":a===D||void 0,"data-in-range":u||void 0,"data-focused":a===S||void 0,className:`ds-calendar__day`,onClick:()=>{C(a),p?.(a)},children:r.getDate()},a)})},a))})]})});function m({value:o,defaultValue:s=``,onValueChange:c,size:u=`md`,placeholder:d=`Pick a date`,min:f,max:m,isDisabled:h=!1,isInvalid:g=!1,"aria-invalid":_,id:v,className:y,...b}){let[x,S]=(0,r.useState)(s),C=o??x,[w,T]=(0,r.useState)(!1),E=(0,r.useRef)(null),D=(0,r.useRef)(null),O=(0,r.useRef)(null),k=(0,r.useId)(),A=v??k;return(0,r.useEffect)(()=>{if(!w)return;let e=e=>{let t=e.target;!E.current?.contains(t)&&!O.current?.contains(t)&&T(!1)},t=e=>{e.key===`Escape`&&(e.preventDefault(),T(!1),D.current?.focus())};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[w]),(0,i.jsxs)(`div`,{className:a(`ds-datefield`,y),ref:E,children:[(0,i.jsxs)(t.Button,{...b,ref:D,id:A,size:u,"aria-haspopup":`dialog`,"aria-expanded":w,"aria-invalid":g||_||void 0,isDisabled:h,"data-placeholder":C?void 0:``,className:`ds-field-skin ds-datefield__control`,onClick:()=>T(e=>!e),children:[(0,i.jsx)(`span`,{className:`ds-datefield__value`,children:C?l(C):d}),(0,i.jsx)(e.t,{name:`calendar`,size:16,className:`ds-datefield__glyph`})]}),(0,i.jsx)(n.Popover,{anchorRef:D,anchorId:A,isOpen:w,panelRef:O,className:`ds-datefield__popover`,role:`dialog`,"aria-label":`Choose a date`,children:(0,i.jsx)(p,{value:C,min:f,max:m,onSelect:e=>{o===void 0&&S(e),c?.(e),T(!1),D.current?.focus()}})})]})}function h({value:e,defaultValue:t={start:``,end:``},onValueChange:n,size:o=`md`,min:s,max:c,isDisabled:l=!1,startLabel:u=`Start date`,endLabel:d=`End date`,className:f}){let[p,h]=(0,r.useState)(t),g=e??p,_=t=>{e===void 0&&h(t),n?.(t)};return(0,i.jsxs)(`div`,{className:a(`ds-daterange`,f),children:[(0,i.jsx)(m,{"aria-label":u,size:o,value:g.start,min:s,max:g.end||c,isDisabled:l,placeholder:u,onValueChange:e=>_({...g,start:e})}),(0,i.jsx)(`span`,{className:`ds-daterange__dash`,"aria-hidden":`true`,children:`–`}),(0,i.jsx)(m,{"aria-label":d,size:o,value:g.end,min:g.start||s,max:c,isDisabled:l,placeholder:d,onValueChange:e=>_({...g,end:e})})]})}exports.Calendar=p,exports.DateField=m,exports.DateRangeField=h,exports.formatIsoDate=l;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|