@namroodinc/liquid-editorial 0.2.0 → 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/README.md +38 -1
- package/UPGRADING.md +78 -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.map +1 -1
- package/dist/chunks/FormEditor-DuW8x78Y.js.map +1 -1
- 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.map +1 -1
- package/dist/components/EntryPicker/index.d.ts.map +1 -1
- package/dist/components/EntryPicker/index.js +1 -1
- 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 +1 -1
- package/dist/components/FormEditor/control.d.cts.map +1 -1
- package/dist/components/FormEditor/control.d.ts +1 -1
- package/dist/components/FormEditor/control.d.ts.map +1 -1
- package/dist/components/FormEditor/index.d.cts +1 -1
- package/dist/components/FormEditor/index.d.cts.map +1 -1
- package/dist/components/FormEditor/index.d.ts +1 -1
- package/dist/components/FormEditor/index.d.ts.map +1 -1
- package/dist/components/FormEditor/model.d.cts.map +1 -1
- package/dist/components/FormEditor/model.d.ts.map +1 -1
- package/dist/components/FormEditor/style.css +3 -1
- 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.map +1 -1
- package/dist/components/NumberField/index.d.cts.map +1 -1
- package/dist/components/NumberField/index.d.ts.map +1 -1
- 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.d.cts.map +1 -1
- package/dist/components/RichTextEditor/index.d.ts.map +1 -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 +9 -7
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +9 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- 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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/TagsInput/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,oBAAoB,CAAC;AAC5B,OAAO,aAAa,CAAC;AAMrB,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,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"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TagsInput/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,oBAAoB,CAAC;AAC5B,OAAO,aAAa,CAAC;AAMrB,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TagsInput/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,oBAAoB,CAAC;AAC5B,OAAO,aAAa,CAAC;AAMrB,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,6GA2FpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["cx","parts","TagsInput","forwardRef","rest","internal","setInternal","useState","defaultValue","current","value","draft","setDraft","inputRef","useRef","commit","next","onValueChange","add","tag","raw","max","className","size","isDisabled","isInvalid","Button","event","item","node","ref","placeholder"],"sources":["../../../src/components/TagsInput/index.tsx"],"sourcesContent":["import { forwardRef, useRef, useState, type KeyboardEvent } from \"react\";\nimport { Button } from \"../Button\";\nimport type { FieldSize } from \"../Field\";\nimport \"../Field/style.css\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport interface TagsInputProps {\n value?: string[];\n defaultValue?: string[];\n onValueChange?: (value: string[]) => void;\n placeholder?: string;\n size?: FieldSize;\n /** Stop accepting new tags past this count. */\n max?: number;\n isDisabled?: boolean;\n isInvalid?: boolean;\n id?: string;\n className?: string;\n \"aria-label\"?: string;\n \"aria-describedby\"?: string;\n}\n\n/**\n * Free-text keywords. Enter or comma commits a tag, Backspace on an empty\n * input removes the last one. Tags are plain strings — never status tones.\n */\nexport const TagsInput = forwardRef<HTMLInputElement, TagsInputProps>(function TagsInput(\n {\n value,\n defaultValue = [],\n onValueChange,\n placeholder = \"Add a tag\",\n size = \"md\",\n max,\n isDisabled = false,\n isInvalid = false,\n className,\n ...rest\n },\n ref,\n) {\n const [internal, setInternal] = useState<string[]>(defaultValue);\n const current = value ?? internal;\n const [draft, setDraft] = useState(\"\");\n const inputRef = useRef<HTMLInputElement | null>(null);\n\n const commit = (next: string[]) => {\n if (value === undefined) setInternal(next);\n onValueChange?.(next);\n };\n\n const add = (raw: string) => {\n const tag = raw.trim();\n if (!tag || current.includes(tag)) return;\n if (max !== undefined && current.length >= max) return;\n commit([...current, tag]);\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"Enter\" || event.key === \",\") {\n event.preventDefault();\n add(draft);\n setDraft(\"\");\n } else if (event.key === \"Backspace\" && draft === \"\" && current.length > 0) {\n commit(current.slice(0, -1));\n }\n };\n\n return (\n <div\n className={cx(\"ds-field-skin\", \"ds-tags\", className)}\n data-size={size}\n data-disabled={isDisabled || undefined}\n aria-invalid={isInvalid || undefined}\n onClick={() => inputRef.current?.focus()}\n >\n {current.map((tag) => (\n <span
|
|
1
|
+
{"version":3,"file":"index.js","names":["cx","parts","TagsInput","forwardRef","rest","internal","setInternal","useState","defaultValue","current","value","draft","setDraft","inputRef","useRef","commit","next","onValueChange","add","tag","raw","max","className","size","isDisabled","isInvalid","Button","event","item","node","ref","placeholder"],"sources":["../../../src/components/TagsInput/index.tsx"],"sourcesContent":["import { forwardRef, useRef, useState, type KeyboardEvent } from \"react\";\nimport { Button } from \"../Button\";\nimport type { FieldSize } from \"../Field\";\nimport \"../Field/style.css\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nexport interface TagsInputProps {\n value?: string[];\n defaultValue?: string[];\n onValueChange?: (value: string[]) => void;\n placeholder?: string;\n size?: FieldSize;\n /** Stop accepting new tags past this count. */\n max?: number;\n isDisabled?: boolean;\n isInvalid?: boolean;\n id?: string;\n className?: string;\n \"aria-label\"?: string;\n \"aria-describedby\"?: string;\n}\n\n/**\n * Free-text keywords. Enter or comma commits a tag, Backspace on an empty\n * input removes the last one. Tags are plain strings — never status tones.\n */\nexport const TagsInput = forwardRef<HTMLInputElement, TagsInputProps>(function TagsInput(\n {\n value,\n defaultValue = [],\n onValueChange,\n placeholder = \"Add a tag\",\n size = \"md\",\n max,\n isDisabled = false,\n isInvalid = false,\n className,\n ...rest\n },\n ref,\n) {\n const [internal, setInternal] = useState<string[]>(defaultValue);\n const current = value ?? internal;\n const [draft, setDraft] = useState(\"\");\n const inputRef = useRef<HTMLInputElement | null>(null);\n\n const commit = (next: string[]) => {\n if (value === undefined) setInternal(next);\n onValueChange?.(next);\n };\n\n const add = (raw: string) => {\n const tag = raw.trim();\n if (!tag || current.includes(tag)) return;\n if (max !== undefined && current.length >= max) return;\n commit([...current, tag]);\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"Enter\" || event.key === \",\") {\n event.preventDefault();\n add(draft);\n setDraft(\"\");\n } else if (event.key === \"Backspace\" && draft === \"\" && current.length > 0) {\n commit(current.slice(0, -1));\n }\n };\n\n return (\n <div\n className={cx(\"ds-field-skin\", \"ds-tags\", className)}\n data-size={size}\n data-disabled={isDisabled || undefined}\n aria-invalid={isInvalid || undefined}\n onClick={() => inputRef.current?.focus()}\n >\n {current.map((tag) => (\n <span\n key={tag}\n className=\"ds-tags__tag\"\n >\n {tag}\n <Button\n variant=\"simple\"\n size=\"xs\"\n isIconOnly\n iconStart=\"x\"\n aria-label={`Remove ${tag}`}\n isDisabled={isDisabled}\n onClick={(event) => {\n event.stopPropagation();\n commit(current.filter((item) => item !== tag));\n }}\n />\n </span>\n ))}\n <input\n ref={(node) => {\n inputRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n type=\"text\"\n className=\"ds-tags__input\"\n value={draft}\n placeholder={current.length === 0 ? placeholder : \"\"}\n disabled={isDisabled}\n onChange={(event) => setDraft(event.target.value)}\n onKeyDown={onKeyDown}\n onBlur={() => {\n add(draft);\n setDraft(\"\");\n }}\n {...rest}\n />\n </div>\n );\n});\n"],"mappings":";;;;;AAMA,SAASA,EAAG,GAAGC,GAAuC;CACpD,OAAOA,EAAM,OAAO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L,WAAU;GACV,OAAOlB;GACP,aAAaF,EAAQ,WAAW,IAAIsB,IAAc;GAClD,UAAUP;GACV,WAAW,MAAUZ,EAASe,EAAM,OAAO,KAAK;GACrC,YAlDE,MAA2C;IAC5D,AAAIA,EAAM,QAAQ,WAAWA,EAAM,QAAQ,OACzCA,EAAM,eAAe,GACrBT,EAAIP,CAAK,GACTC,EAAS,EAAE,KACFe,EAAM,QAAQ,eAAehB,MAAU,MAAMF,EAAQ,SAAS,KACvEM,EAAON,EAAQ,MAAM,GAAG,EAAE,CAAC;GAE/B;GA2CM,cAAc;IAEZ,AADAS,EAAIP,CAAK,GACTC,EAAS,EAAE;GACb;GACA,GAAIR;EACL,CAAA,CACE;;AAET,CAAC"}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.ds-tags[data-disabled] {
|
|
27
|
-
opacity: 45
|
|
27
|
+
opacity: 0.45;
|
|
28
28
|
cursor: not-allowed;
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
display: inline-flex;
|
|
33
33
|
align-items: center;
|
|
34
34
|
gap: var(--space-1);
|
|
35
|
+
|
|
35
36
|
/* The xs remove Button sets the chip height, so the md field never grows. */
|
|
36
37
|
padding: 0 var(--space-1) 0 var(--space-2);
|
|
37
38
|
border: var(--badge-border-width) solid var(--control-border-color);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["forwardRef","useCallback","react","react_jsx_runtime","TextField","rest","size","className","TextArea","autoGrow","el","event","onInput"],"sources":["../../../src/components/TextField/index.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n type FormEvent,\n type InputHTMLAttributes,\n type TextareaHTMLAttributes,\n} from \"react\";\nimport type { FieldSize } from \"../Field\";\nimport \"../Field/style.css\";\n\nexport interface TextFieldProps
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["forwardRef","useCallback","react","react_jsx_runtime","TextField","rest","size","className","TextArea","autoGrow","el","event","onInput"],"sources":["../../../src/components/TextField/index.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n type FormEvent,\n type InputHTMLAttributes,\n type TextareaHTMLAttributes,\n} from \"react\";\nimport type { FieldSize } from \"../Field\";\nimport \"../Field/style.css\";\n\nexport interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"size\"> {\n size?: FieldSize;\n}\n\n/** Single-line input wearing the shared field skin. */\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(function TextField(\n { size = \"md\", className, type = \"text\", ...rest },\n ref,\n) {\n return (\n <input\n ref={ref}\n type={type}\n data-size={size}\n className={[\"ds-field-skin\", className].filter(Boolean).join(\" \")}\n {...rest}\n />\n );\n});\n\nexport type TextAreaProps = TextareaHTMLAttributes<HTMLTextAreaElement>;\n\n/** Multi-line input. Grows to its content and never scrolls. */\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(function TextArea(\n { rows = 3, className, onInput, ...rest },\n ref,\n) {\n const autoGrow = useCallback(\n (event: FormEvent<HTMLTextAreaElement>) => {\n const el = event.currentTarget;\n el.style.height = \"auto\";\n el.style.height = `${el.scrollHeight}px`;\n onInput?.(event as Parameters<NonNullable<typeof onInput>>[0]);\n },\n [onInput],\n );\n\n return (\n <textarea\n ref={ref}\n rows={rows}\n onInput={autoGrow}\n className={[\"ds-field-skin\", className].filter(Boolean).join(\" \")}\n {...rest}\n />\n );\n});\n"],"mappings":"A,oKAeA,IAAaI,GAAA,EAAYJ,EAAAA,WAAAA,CAA6C,SACpE,CAAE,OAAO,KAAM,YAAW,OAAO,OAAQ,GAAGK,GAC5C,EACA,CACA,OACE,EAAAF,EAAA,IAAA,CAAC,QAAD,CACO,MACC,OACN,YAAWG,EACX,UAAW,CAAC,gBAAiBC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAChE,GAAIF,CACL,CAAA,CAEL,CAAC,EAKYG,GAAA,EAAWR,EAAAA,WAAAA,CAA+C,SACrE,CAAE,OAAO,EAAG,YAAW,UAAS,GAAGK,GACnC,EACA,CACA,IAAMI,GAAA,EAAWR,EAAAA,YAAAA,CACd,GAA0C,CACzC,IAAMS,EAAKC,EAAM,cACjB,EAAG,MAAM,OAAS,OAClB,EAAG,MAAM,OAAS,GAAGD,EAAG,aAAa,IACrCE,IAAUD,CAAmD,CAC/D,EACA,CAACC,CAAO,CACV,EAEA,OACE,EAAAT,EAAA,IAAA,CAAC,WAAD,CACO,MACC,OACN,QAASM,EACT,UAAW,CAAC,gBAAiBF,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAChE,GAAIF,CACL,CAAA,CAEL,CAAC,E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/TextField/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC5B,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,oBAAoB,CAAC;AAE5B,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/TextField/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC5B,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,oBAAoB,CAAC;AAE5B,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACzF,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,uDAAuD;AACvD,eAAO,MAAM,SAAS,6GAapB,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,sBAAsB,CAAC,mBAAmB,CAAC,CAAC;AAExE,gEAAgE;AAChE,eAAO,MAAM,QAAQ,+GAuBnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TextField/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC5B,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,oBAAoB,CAAC;AAE5B,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TextField/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC5B,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,oBAAoB,CAAC;AAE5B,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACzF,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,uDAAuD;AACvD,eAAO,MAAM,SAAS,6GAapB,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,sBAAsB,CAAC,mBAAmB,CAAC,CAAC;AAExE,gEAAgE;AAChE,eAAO,MAAM,QAAQ,+GAuBnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["TextField","forwardRef","rest","size","className","TextArea","autoGrow","useCallback","el","event","onInput"],"sources":["../../../src/components/TextField/index.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n type FormEvent,\n type InputHTMLAttributes,\n type TextareaHTMLAttributes,\n} from \"react\";\nimport type { FieldSize } from \"../Field\";\nimport \"../Field/style.css\";\n\nexport interface TextFieldProps
|
|
1
|
+
{"version":3,"file":"index.js","names":["TextField","forwardRef","rest","size","className","TextArea","autoGrow","useCallback","el","event","onInput"],"sources":["../../../src/components/TextField/index.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n type FormEvent,\n type InputHTMLAttributes,\n type TextareaHTMLAttributes,\n} from \"react\";\nimport type { FieldSize } from \"../Field\";\nimport \"../Field/style.css\";\n\nexport interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"size\"> {\n size?: FieldSize;\n}\n\n/** Single-line input wearing the shared field skin. */\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(function TextField(\n { size = \"md\", className, type = \"text\", ...rest },\n ref,\n) {\n return (\n <input\n ref={ref}\n type={type}\n data-size={size}\n className={[\"ds-field-skin\", className].filter(Boolean).join(\" \")}\n {...rest}\n />\n );\n});\n\nexport type TextAreaProps = TextareaHTMLAttributes<HTMLTextAreaElement>;\n\n/** Multi-line input. Grows to its content and never scrolls. */\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(function TextArea(\n { rows = 3, className, onInput, ...rest },\n ref,\n) {\n const autoGrow = useCallback(\n (event: FormEvent<HTMLTextAreaElement>) => {\n const el = event.currentTarget;\n el.style.height = \"auto\";\n el.style.height = `${el.scrollHeight}px`;\n onInput?.(event as Parameters<NonNullable<typeof onInput>>[0]);\n },\n [onInput],\n );\n\n return (\n <textarea\n ref={ref}\n rows={rows}\n onInput={autoGrow}\n className={[\"ds-field-skin\", className].filter(Boolean).join(\" \")}\n {...rest}\n />\n );\n});\n"],"mappings":";;;;AAeA,IAAaA,IAAYC,EAA6C,SACpE,EAAE,UAAO,MAAM,cAAW,UAAO,QAAQ,GAAGC,KAC5C,GACA;CACA,OACE,kBAAC,SAAD;EACO;EACC;EACN,aAAWC;EACX,WAAW,CAAC,iBAAiBC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAChE,GAAIF;CACL,CAAA;AAEL,CAAC,GAKYG,IAAWJ,EAA+C,SACrE,EAAE,UAAO,GAAG,cAAW,YAAS,GAAGC,KACnC,GACA;CACA,IAAMI,IAAWC,GACd,MAA0C;EACzC,IAAMC,IAAKC,EAAM;EAGjB,AAFA,EAAG,MAAM,SAAS,QAClB,EAAG,MAAM,SAAS,GAAGD,EAAG,aAAa,KACrCE,IAAUD,CAAmD;CAC/D,GACA,CAACC,CAAO,CACV;CAEA,OACE,kBAAC,YAAD;EACO;EACC;EACN,SAASJ;EACT,WAAW,CAAC,iBAAiBF,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAChE,GAAIF;CACL,CAAA;AAEL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["forwardRef","useRef","useState","useId","_Fragment","Popover","require_components_Popover_index","react","react_jsx_runtime","cx","parts","MONTHS","MINUTE","HOUR","DAY","WEEK","pad","value","formatAbsoluteDate","options","stem","date","hasYear","formatAbsoluteTime","stamp","hasTimeZone","zone","part","formatRelativeTime","delta","now","days","Time","describedBy","rest","anchorRef","isOpen","setIsOpen","tooltipId","setTick","format","id","t","refreshInterval","label","isTipped","hasTooltip","node","ref","className","tabIndex","title","onMouseEnter","event","onMouseLeave","onFocus","onBlur","onKeyDown"],"sources":["../../../src/components/Time/index.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["forwardRef","useRef","useState","useId","_Fragment","Popover","require_components_Popover_index","react","react_jsx_runtime","cx","parts","MONTHS","MINUTE","HOUR","DAY","WEEK","pad","value","formatAbsoluteDate","options","stem","date","hasYear","formatAbsoluteTime","stamp","hasTimeZone","zone","part","formatRelativeTime","delta","now","days","Time","describedBy","rest","anchorRef","isOpen","setIsOpen","tooltipId","setTick","format","id","t","refreshInterval","label","isTipped","hasTooltip","node","ref","className","tabIndex","title","onMouseEnter","event","onMouseLeave","onFocus","onBlur","onKeyDown"],"sources":["../../../src/components/Time/index.tsx"],"sourcesContent":["import { forwardRef, useEffect, useId, useRef, useState, type HTMLAttributes } from \"react\";\nimport { Popover } from \"../Popover\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nconst MONTHS = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n\nconst MINUTE = 60_000;\nconst HOUR = 60 * MINUTE;\nconst DAY = 24 * HOUR;\nconst WEEK = 7 * DAY;\n\nfunction pad(value: number) {\n return String(value).padStart(2, \"0\");\n}\n\n/** Day before month, one order everywhere: `12 Jun 2026`. */\nexport function formatAbsoluteDate(date: Date, options: { hasYear?: boolean } = {}) {\n const { hasYear = true } = options;\n const stem = `${date.getDate()} ${MONTHS[date.getMonth()]}`;\n return hasYear ? `${stem} ${date.getFullYear()}` : stem;\n}\n\n/** The tooltip form: `6 Aug 2026, 11:05`, with the reader's zone appended. */\nexport function formatAbsoluteTime(date: Date, options: { hasTimeZone?: boolean } = {}) {\n const { hasTimeZone = true } = options;\n const stamp = `${formatAbsoluteDate(date)}, ${pad(date.getHours())}:${pad(date.getMinutes())}`;\n if (!hasTimeZone) return stamp;\n const zone = new Intl.DateTimeFormat(undefined, { timeZoneName: \"short\" })\n .formatToParts(date)\n .find((part) => part.type === \"timeZoneName\")?.value;\n return zone ? `${stamp} ${zone}` : stamp;\n}\n\n/**\n * Relative up to a week, absolute after. Future dates are always absolute — a\n * scheduled publish reads `12 Jun`, never `in 3 days`.\n */\nexport function formatRelativeTime(date: Date, now: Date = new Date()) {\n const delta = now.getTime() - date.getTime();\n if (delta < 0) {\n return formatAbsoluteDate(date, { hasYear: date.getFullYear() !== now.getFullYear() });\n }\n if (delta < MINUTE) return \"Just now\";\n if (delta < HOUR) return `${Math.floor(delta / MINUTE)}m ago`;\n if (delta < DAY) return `${Math.floor(delta / HOUR)}h ago`;\n if (delta < WEEK) {\n const days = Math.floor(delta / DAY);\n return `${days} ${days === 1 ? \"day\" : \"days\"} ago`;\n }\n return formatAbsoluteDate(date, { hasYear: date.getFullYear() !== now.getFullYear() });\n}\n\nexport type TimeFormat = \"auto\" | \"relative\" | \"absolute\";\n\nexport interface TimeProps extends Omit<HTMLAttributes<HTMLElement>, \"children\"> {\n /** The instant to print — Date, epoch ms, or an ISO string. */\n value: Date | string | number;\n /** `auto` ages the value; `absolute` always prints the date. */\n format?: TimeFormat;\n /** Show the absolute stamp on hover and focus. */\n hasTooltip?: boolean;\n /** Append the reader's time zone to the tooltip. */\n hasTimeZone?: boolean;\n /** Pin \"now\" — useful for tests and stories. */\n now?: Date;\n /** Re-render interval in ms while the value is still relative. */\n refreshInterval?: number;\n}\n\n/**\n * A machine-readable `<time>` that ages itself. One form per cell: relative or\n * absolute, never both side by side.\n */\nexport const Time = forwardRef<HTMLTimeElement, TimeProps>(function Time(\n {\n value,\n format = \"auto\",\n hasTooltip = true,\n hasTimeZone = true,\n now,\n refreshInterval = 30_000,\n className,\n tabIndex,\n title,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n onKeyDown,\n \"aria-describedby\": describedBy,\n ...rest\n },\n ref,\n) {\n const date = value instanceof Date ? value : new Date(value);\n const anchorRef = useRef<HTMLTimeElement | null>(null);\n const [isOpen, setIsOpen] = useState(false);\n const tooltipId = useId();\n const [, setTick] = useState(0);\n\n useEffect(() => {\n if (format === \"absolute\" || now) return;\n const id = window.setInterval(() => setTick((t) => t + 1), refreshInterval);\n return () => window.clearInterval(id);\n }, [format, now, refreshInterval]);\n\n if (Number.isNaN(date.getTime())) return null;\n\n const reference = now ?? new Date();\n const label =\n format === \"absolute\" ? formatAbsoluteDate(date) : formatRelativeTime(date, reference);\n const stamp = formatAbsoluteTime(date, { hasTimeZone });\n const isTipped = hasTooltip && label !== stamp;\n\n return (\n <>\n <time\n ref={(node) => {\n anchorRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n dateTime={date.toISOString()}\n suppressHydrationWarning\n className={cx(\"ds-time\", !isTipped && \"ds-time--plain\", className)}\n tabIndex={tabIndex ?? (isTipped ? 0 : undefined)}\n aria-describedby={\n [describedBy, isTipped && isOpen && tooltipId].filter(Boolean).join(\" \") || undefined\n }\n title={title ?? (isTipped ? undefined : stamp)}\n onMouseEnter={(event) => {\n onMouseEnter?.(event);\n if (isTipped && !event.defaultPrevented) setIsOpen(true);\n }}\n onMouseLeave={(event) => {\n onMouseLeave?.(event);\n if (isTipped && !event.defaultPrevented) setIsOpen(false);\n }}\n onFocus={(event) => {\n onFocus?.(event);\n if (isTipped && !event.defaultPrevented) setIsOpen(true);\n }}\n onBlur={(event) => {\n onBlur?.(event);\n if (isTipped && !event.defaultPrevented) setIsOpen(false);\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (isTipped && !event.defaultPrevented && event.key === \"Escape\") setIsOpen(false);\n }}\n {...rest}\n >\n {label}\n </time>\n {isTipped && (\n <Popover\n anchorRef={anchorRef}\n isOpen={isOpen}\n id={tooltipId}\n role=\"tooltip\"\n className=\"ds-surface-raised ds-time-tooltip\"\n >\n {stamp}\n </Popover>\n )}\n </>\n );\n});\n"],"mappings":"A,iKAIA,SAASS,EAAG,GAAGC,EAAuC,CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,CACvC,CAEA,IAAMC,EAAS,CAAC,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,KAAK,EAE5FC,EAAS,IACTC,EAAO,GAAKD,EACZE,EAAM,GAAKD,EACXE,EAAO,EAAID,EAEjB,SAASE,EAAI,EAAe,CAC1B,OAAO,OAAOC,CAAK,CAAC,CAAC,SAAS,EAAG,GAAG,CACtC,CAGA,SAAgBC,EAAmB,EAAY,EAAiC,CAAC,EAAG,CAClF,GAAM,CAAE,UAAU,IAASC,EACrBC,EAAO,GAAGC,EAAK,QAAQ,EAAE,GAAGV,EAAOU,EAAK,SAAS,KACvD,OAAOC,EAAU,GAAGF,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AAUN,EAAW,IAAA,GAAYrB,GACxC,aAAe,GAAU,CACvB4B,IAAeC,CAAK,EAChBR,GAAY,CAACQ,EAAM,kBAAkBhB,EAAU,EAAI,CACzD,EACA,aAAe,GAAU,CACvBiB,IAAeD,CAAK,EAChBR,GAAY,CAACQ,EAAM,kBAAkBhB,EAAU,EAAK,CAC1D,EACA,QAAU,GAAU,CAClBkB,IAAUF,CAAK,EACXR,GAAY,CAACQ,EAAM,kBAAkBhB,EAAU,EAAI,CACzD,EACA,OAAS,GAAU,CACjBmB,IAASH,CAAK,EACVR,GAAY,CAACQ,EAAM,kBAAkBhB,EAAU,EAAK,CAC1D,EACA,UAAY,GAAU,CACpBoB,IAAYJ,CAAK,EACbR,GAAY,CAACQ,EAAM,kBAAoBA,EAAM,MAAQ,UAAUhB,EAAU,EAAK,CACpF,EACA,GAAIH,EAEH,SAAAU,CACG,CAAA,EACLC,IACC,EAAArC,EAAA,IAAA,CAACH,EAAAA,QAAD,CACa,YACH,SACR,GAAIiC,EACJ,KAAK,UACL,UAAU,oCAET,SAAAd,CACM,CAAA,CAEX,CAAA,CAAA,CAEN,CAAC,E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Time/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Time/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkD,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5F,OAAO,aAAa,CAAC;AAiBrB,6DAA6D;AAC7D,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,UAIjF;AAED,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,UAQrF;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,GAAE,IAAiB,UAapE;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;AAE1D,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC;IAC9E,+DAA+D;IAC/D,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IAC9B,gEAAgE;IAChE,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,kDAAkD;IAClD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oDAAoD;IACpD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gDAAgD;IAChD,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,kEAAkE;IAClE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,IAAI,uGA8Ff,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Time/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Time/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkD,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5F,OAAO,aAAa,CAAC;AAiBrB,6DAA6D;AAC7D,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,UAIjF;AAED,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,UAQrF;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,GAAE,IAAiB,UAapE;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;AAE1D,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC;IAC9E,+DAA+D;IAC/D,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IAC9B,gEAAgE;IAChE,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,kDAAkD;IAClD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oDAAoD;IACpD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gDAAgD;IAChD,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,kEAAkE;IAClE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,IAAI,uGA8Ff,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_Fragment","Fragment$1","cx","parts","MONTHS","MINUTE","HOUR","DAY","WEEK","pad","value","formatAbsoluteDate","options","stem","date","hasYear","formatAbsoluteTime","stamp","hasTimeZone","zone","part","formatRelativeTime","delta","now","days","Time","forwardRef","describedBy","rest","anchorRef","useRef","isOpen","setIsOpen","useState","tooltipId","useId","setTick","useEffect","format","id","t","refreshInterval","label","isTipped","hasTooltip","node","ref","className","tabIndex","title","onMouseEnter","event","onMouseLeave","onFocus","onBlur","onKeyDown","Popover"],"sources":["../../../src/components/Time/index.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.js","names":["_Fragment","Fragment$1","cx","parts","MONTHS","MINUTE","HOUR","DAY","WEEK","pad","value","formatAbsoluteDate","options","stem","date","hasYear","formatAbsoluteTime","stamp","hasTimeZone","zone","part","formatRelativeTime","delta","now","days","Time","forwardRef","describedBy","rest","anchorRef","useRef","isOpen","setIsOpen","useState","tooltipId","useId","setTick","useEffect","format","id","t","refreshInterval","label","isTipped","hasTooltip","node","ref","className","tabIndex","title","onMouseEnter","event","onMouseLeave","onFocus","onBlur","onKeyDown","Popover"],"sources":["../../../src/components/Time/index.tsx"],"sourcesContent":["import { forwardRef, useEffect, useId, useRef, useState, type HTMLAttributes } from \"react\";\nimport { Popover } from \"../Popover\";\nimport \"./style.css\";\n\nfunction cx(...parts: (string | undefined | false)[]) {\n return parts.filter(Boolean).join(\" \");\n}\n\nconst MONTHS = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n\nconst MINUTE = 60_000;\nconst HOUR = 60 * MINUTE;\nconst DAY = 24 * HOUR;\nconst WEEK = 7 * DAY;\n\nfunction pad(value: number) {\n return String(value).padStart(2, \"0\");\n}\n\n/** Day before month, one order everywhere: `12 Jun 2026`. */\nexport function formatAbsoluteDate(date: Date, options: { hasYear?: boolean } = {}) {\n const { hasYear = true } = options;\n const stem = `${date.getDate()} ${MONTHS[date.getMonth()]}`;\n return hasYear ? `${stem} ${date.getFullYear()}` : stem;\n}\n\n/** The tooltip form: `6 Aug 2026, 11:05`, with the reader's zone appended. */\nexport function formatAbsoluteTime(date: Date, options: { hasTimeZone?: boolean } = {}) {\n const { hasTimeZone = true } = options;\n const stamp = `${formatAbsoluteDate(date)}, ${pad(date.getHours())}:${pad(date.getMinutes())}`;\n if (!hasTimeZone) return stamp;\n const zone = new Intl.DateTimeFormat(undefined, { timeZoneName: \"short\" })\n .formatToParts(date)\n .find((part) => part.type === \"timeZoneName\")?.value;\n return zone ? `${stamp} ${zone}` : stamp;\n}\n\n/**\n * Relative up to a week, absolute after. Future dates are always absolute — a\n * scheduled publish reads `12 Jun`, never `in 3 days`.\n */\nexport function formatRelativeTime(date: Date, now: Date = new Date()) {\n const delta = now.getTime() - date.getTime();\n if (delta < 0) {\n return formatAbsoluteDate(date, { hasYear: date.getFullYear() !== now.getFullYear() });\n }\n if (delta < MINUTE) return \"Just now\";\n if (delta < HOUR) return `${Math.floor(delta / MINUTE)}m ago`;\n if (delta < DAY) return `${Math.floor(delta / HOUR)}h ago`;\n if (delta < WEEK) {\n const days = Math.floor(delta / DAY);\n return `${days} ${days === 1 ? \"day\" : \"days\"} ago`;\n }\n return formatAbsoluteDate(date, { hasYear: date.getFullYear() !== now.getFullYear() });\n}\n\nexport type TimeFormat = \"auto\" | \"relative\" | \"absolute\";\n\nexport interface TimeProps extends Omit<HTMLAttributes<HTMLElement>, \"children\"> {\n /** The instant to print — Date, epoch ms, or an ISO string. */\n value: Date | string | number;\n /** `auto` ages the value; `absolute` always prints the date. */\n format?: TimeFormat;\n /** Show the absolute stamp on hover and focus. */\n hasTooltip?: boolean;\n /** Append the reader's time zone to the tooltip. */\n hasTimeZone?: boolean;\n /** Pin \"now\" — useful for tests and stories. */\n now?: Date;\n /** Re-render interval in ms while the value is still relative. */\n refreshInterval?: number;\n}\n\n/**\n * A machine-readable `<time>` that ages itself. One form per cell: relative or\n * absolute, never both side by side.\n */\nexport const Time = forwardRef<HTMLTimeElement, TimeProps>(function Time(\n {\n value,\n format = \"auto\",\n hasTooltip = true,\n hasTimeZone = true,\n now,\n refreshInterval = 30_000,\n className,\n tabIndex,\n title,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n onKeyDown,\n \"aria-describedby\": describedBy,\n ...rest\n },\n ref,\n) {\n const date = value instanceof Date ? value : new Date(value);\n const anchorRef = useRef<HTMLTimeElement | null>(null);\n const [isOpen, setIsOpen] = useState(false);\n const tooltipId = useId();\n const [, setTick] = useState(0);\n\n useEffect(() => {\n if (format === \"absolute\" || now) return;\n const id = window.setInterval(() => setTick((t) => t + 1), refreshInterval);\n return () => window.clearInterval(id);\n }, [format, now, refreshInterval]);\n\n if (Number.isNaN(date.getTime())) return null;\n\n const reference = now ?? new Date();\n const label =\n format === \"absolute\" ? formatAbsoluteDate(date) : formatRelativeTime(date, reference);\n const stamp = formatAbsoluteTime(date, { hasTimeZone });\n const isTipped = hasTooltip && label !== stamp;\n\n return (\n <>\n <time\n ref={(node) => {\n anchorRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n dateTime={date.toISOString()}\n suppressHydrationWarning\n className={cx(\"ds-time\", !isTipped && \"ds-time--plain\", className)}\n tabIndex={tabIndex ?? (isTipped ? 0 : undefined)}\n aria-describedby={\n [describedBy, isTipped && isOpen && tooltipId].filter(Boolean).join(\" \") || undefined\n }\n title={title ?? (isTipped ? undefined : stamp)}\n onMouseEnter={(event) => {\n onMouseEnter?.(event);\n if (isTipped && !event.defaultPrevented) setIsOpen(true);\n }}\n onMouseLeave={(event) => {\n onMouseLeave?.(event);\n if (isTipped && !event.defaultPrevented) setIsOpen(false);\n }}\n onFocus={(event) => {\n onFocus?.(event);\n if (isTipped && !event.defaultPrevented) setIsOpen(true);\n }}\n onBlur={(event) => {\n onBlur?.(event);\n if (isTipped && !event.defaultPrevented) setIsOpen(false);\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (isTipped && !event.defaultPrevented && event.key === \"Escape\") setIsOpen(false);\n }}\n {...rest}\n >\n {label}\n </time>\n {isTipped && (\n <Popover\n anchorRef={anchorRef}\n isOpen={isOpen}\n id={tooltipId}\n role=\"tooltip\"\n className=\"ds-surface-raised ds-time-tooltip\"\n >\n {stamp}\n </Popover>\n )}\n </>\n );\n});\n"],"mappings":";;;;AAIA,SAASE,EAAG,GAAGC,GAAuC;CACpD,OAAOA,EAAM,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;AACvC;AAEA,IAAMC,IAAS;CAAC;CAAO;CAAO;CAAO;CAAO;CAAO;CAAO;CAAO;CAAO;CAAO;CAAO;CAAO;AAAK,GAE5FC,IAAS,KACTC,IAAO,KAAKD,GACZE,IAAM,KAAKD,GACXE,IAAO,IAAID;AAEjB,SAASE,EAAI,GAAe;CAC1B,OAAO,OAAOC,CAAK,CAAC,CAAC,SAAS,GAAG,GAA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AAG,KAAK,KAAA;EAE9E,OAAOe,MAAUN,IAAW,KAAA,IAAY1B;EACxC,eAAe,MAAU;GAEvB,AADAiC,IAAeC,CAAK,GAChBR,KAAY,CAACQ,EAAM,oBAAkBnB,EAAU,EAAI;EACzD;EACA,eAAe,MAAU;GAEvB,AADAoB,IAAeD,CAAK,GAChBR,KAAY,CAACQ,EAAM,oBAAkBnB,EAAU,EAAK;EAC1D;EACA,UAAU,MAAU;GAElB,AADAqB,IAAUF,CAAK,GACXR,KAAY,CAACQ,EAAM,oBAAkBnB,EAAU,EAAI;EACzD;EACA,SAAS,MAAU;GAEjB,AADAsB,IAASH,CAAK,GACVR,KAAY,CAACQ,EAAM,oBAAkBnB,EAAU,EAAK;EAC1D;EACA,YAAY,MAAU;GAEpB,AADAuB,IAAYJ,CAAK,GACbR,KAAY,CAACQ,EAAM,oBAAoBA,EAAM,QAAQ,YAAUnB,EAAU,EAAK;EACpF;EACA,GAAIJ;EAEH,UAAAc;CACG,CAAA,GACLC,KACC,kBAACa,GAAD;EACa;EACH;EACR,IAAItB;EACJ,MAAK;EACL,WAAU;EAET,UAAAjB;CACM,CAAA,CAEX,EAAA,CAAA;AAEN,CAAC"}
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
/* The dotted underline is the only affordance — no icon, no colour change. */
|
|
3
3
|
.ds-time {
|
|
4
4
|
font-variant-numeric: tabular-nums;
|
|
5
|
-
text-decoration: underline dotted
|
|
6
|
-
color-mix(in srgb, var(--color-text) 45%, transparent);
|
|
5
|
+
text-decoration: underline dotted color-mix(in srgb, var(--color-text) 45%, transparent);
|
|
7
6
|
text-underline-offset: 3px;
|
|
8
7
|
cursor: help;
|
|
9
8
|
}
|
|
@@ -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");let n=require("react"),r=require("react/jsx-runtime");var i={neutral:`info`,info:`info`,success:`check`,warning:`alert-triangle`,danger:`alert-triangle`},a=(0,n.forwardRef)(function({tone:n=`neutral`,title:a,description:o,onDismiss:s,className:c,...l},u){return(0,r.jsxs)(`div`,{ref:u,role:`status`,"data-tone":n===`neutral`?void 0:n,className:[`ds-toast`,c].filter(Boolean).join(` `),...l,children:[(0,r.jsx)(e.t,{name:i[n],size:20,className:`ds-toast__icon`}),(0,r.jsxs)(`div`,{className:`ds-toast__body`,children:[(0,r.jsx)(`span`,{className:`ds-toast__title`,children:a}),o&&(0,r.jsx)(`span`,{className:`ds-toast__description`,children:o})]}),s&&(0,r.jsx)(t.Button,{variant:`simple`,size:`sm`,isIconOnly:!0,iconStart:`x`,"aria-label":`Dismiss notification`,onClick:s})]})}),o=(0,n.createContext)(null);function s({children:e}){let[t,i]=(0,n.useState)([]),a=(0,n.useRef)(0),s=(0,n.useCallback)(e=>{i(t=>t.filter(t=>t.id!==e))},[]),l=(0,n.useCallback)(e=>{i(t=>[...t,{...e,id:a.current++}])},[]),u=(0,n.useMemo)(()=>({toast:l,dismiss:s}),[l,s]);return(0,r.jsxs)(o.Provider,{value:u,children:[e,(0,r.jsx)(c,{items:t,onDismiss:s})]})}function c({items:e,onDismiss:t}){return e.length===0?null:(0,r.jsx)(`div`,{className:`ds-toast-region`,role:`region`,"aria-label":`Notifications`,children:e.map(e=>(0,r.jsx)(l,{item:e,onDismiss:t},e.id))})}function l({item:e,onDismiss:t}){return(0,n.useEffect)(()=>{let n=window.setTimeout(()=>t(e.id),e.duration??5e3);return()=>window.clearTimeout(n)},[e,t]),(0,r.jsx)(a,{tone:e.tone,title:e.title,description:e.description,onDismiss:()=>t(e.id)})}function u(){let e=(0,n.useContext)(o);if(!e)throw Error(`useToast must be used inside a <ToastProvider>.`);return e}exports.Toast=a,exports.ToastProvider=s,exports.useToast=u;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["forwardRef","Icon","Button","createContext","useState","useRef","useCallback","useMemo","useContext","require_Icon","require_components_Button_index","react","react_jsx_runtime","TONE_ICON","Toast","rest","tone","className","title","description","onDismiss","ToastContext","ToastProvider","items","setItems","nextId","dismiss","current","item","id","toast","options","value","children","ToastRegion","TimedToast","timer","useToast","context"],"sources":["../../../src/components/Toast/index.tsx"],"sourcesContent":["import {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { Button } from \"../Button\";\nimport { Icon } from \"../Icon\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\nexport type ToastTone = \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\";\n\nconst TONE_ICON: Record<ToastTone, IconName> = {\n neutral: \"info\",\n info: \"info\",\n success: \"check\",\n warning: \"alert-triangle\",\n danger: \"alert-triangle\",\n};\n\nexport interface ToastProps extends HTMLAttributes<HTMLDivElement> {\n tone?: ToastTone;\n title: string;\n description?: string;\n /** Renders a dismiss button. Omit for a toast that only times out. */\n onDismiss?: () => void;\n}\n\n/** One fact about something that already happened. Never a question. */\nexport const Toast = forwardRef<HTMLDivElement, ToastProps>(function Toast(\n { tone = \"neutral\", title, description, onDismiss, className, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n role=\"status\"\n data-tone={tone === \"neutral\" ? undefined : tone}\n className={[\"ds-toast\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n <Icon
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["forwardRef","Icon","Button","createContext","useState","useRef","useCallback","useMemo","useContext","require_Icon","require_components_Button_index","react","react_jsx_runtime","TONE_ICON","Toast","rest","tone","className","title","description","onDismiss","ToastContext","ToastProvider","items","setItems","nextId","dismiss","current","item","id","toast","options","value","children","ToastRegion","TimedToast","timer","useToast","context"],"sources":["../../../src/components/Toast/index.tsx"],"sourcesContent":["import {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { Button } from \"../Button\";\nimport { Icon } from \"../Icon\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\nexport type ToastTone = \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\";\n\nconst TONE_ICON: Record<ToastTone, IconName> = {\n neutral: \"info\",\n info: \"info\",\n success: \"check\",\n warning: \"alert-triangle\",\n danger: \"alert-triangle\",\n};\n\nexport interface ToastProps extends HTMLAttributes<HTMLDivElement> {\n tone?: ToastTone;\n title: string;\n description?: string;\n /** Renders a dismiss button. Omit for a toast that only times out. */\n onDismiss?: () => void;\n}\n\n/** One fact about something that already happened. Never a question. */\nexport const Toast = forwardRef<HTMLDivElement, ToastProps>(function Toast(\n { tone = \"neutral\", title, description, onDismiss, className, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n role=\"status\"\n data-tone={tone === \"neutral\" ? undefined : tone}\n className={[\"ds-toast\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n <Icon\n name={TONE_ICON[tone]}\n size={20}\n className=\"ds-toast__icon\"\n />\n <div className=\"ds-toast__body\">\n <span className=\"ds-toast__title\">{title}</span>\n {description && <span className=\"ds-toast__description\">{description}</span>}\n </div>\n {onDismiss && (\n <Button\n variant=\"simple\"\n size=\"sm\"\n isIconOnly\n iconStart=\"x\"\n aria-label=\"Dismiss notification\"\n onClick={onDismiss}\n />\n )}\n </div>\n );\n});\n\nexport interface ToastOptions {\n tone?: ToastTone;\n title: string;\n description?: string;\n /** Milliseconds before it dismisses itself. Defaults to `--toast-duration`. */\n duration?: number;\n}\n\ninterface ToastRecord extends ToastOptions {\n id: number;\n}\n\ninterface ToastContextValue {\n toast: (options: ToastOptions) => void;\n dismiss: (id: number) => void;\n}\n\nconst ToastContext = createContext<ToastContextValue | null>(null);\n\nexport interface ToastProviderProps {\n children: ReactNode;\n}\n\n/** Mount once, near the root. Everything below it can call `useToast()`. */\nexport function ToastProvider({ children }: ToastProviderProps) {\n const [items, setItems] = useState<ToastRecord[]>([]);\n const nextId = useRef(0);\n\n const dismiss = useCallback((id: number) => {\n setItems((current) => current.filter((item) => item.id !== id));\n }, []);\n\n const toast = useCallback((options: ToastOptions) => {\n setItems((current) => [...current, { ...options, id: nextId.current++ }]);\n }, []);\n\n const value = useMemo(() => ({ toast, dismiss }), [toast, dismiss]);\n\n return (\n <ToastContext.Provider value={value}>\n {children}\n <ToastRegion\n items={items}\n onDismiss={dismiss}\n />\n </ToastContext.Provider>\n );\n}\n\nfunction ToastRegion({\n items,\n onDismiss,\n}: {\n items: ToastRecord[];\n onDismiss: (id: number) => void;\n}) {\n if (items.length === 0) return null;\n return (\n <div\n className=\"ds-toast-region\"\n role=\"region\"\n aria-label=\"Notifications\"\n >\n {items.map((item) => (\n <TimedToast\n key={item.id}\n item={item}\n onDismiss={onDismiss}\n />\n ))}\n </div>\n );\n}\n\nfunction TimedToast({ item, onDismiss }: { item: ToastRecord; onDismiss: (id: number) => void }) {\n useEffect(() => {\n const timer = window.setTimeout(() => onDismiss(item.id), item.duration ?? 5000);\n return () => window.clearTimeout(timer);\n }, [item, onDismiss]);\n\n return (\n <Toast\n tone={item.tone}\n title={item.title}\n description={item.description}\n onDismiss={() => onDismiss(item.id)}\n />\n );\n}\n\nexport function useToast(): ToastContextValue {\n const context = useContext(ToastContext);\n if (!context) throw new Error(\"useToast must be used inside a <ToastProvider>.\");\n return context;\n}\n"],"mappings":"A,4MAmBA,IAAMa,EAAyC,CAC7C,QAAS,OACT,KAAM,OACN,QAAS,QACT,QAAS,iBACT,OAAQ,gBACV,EAWaC,GAAA,EAAQd,EAAAA,WAAAA,CAAuC,SAC1D,CAAE,OAAO,UAAW,QAAO,cAAa,YAAW,YAAW,GAAGe,GACjE,EACA,CACA,OACE,EAAAH,EAAA,KAAA,CAAC,MAAD,CACO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CAAO,CAAC,EAElE,OACE,EAAAd,EAAA,KAAA,CAACS,EAAa,SAAd,CAA8B,QAA9B,SAAA,CACGY,GACD,EAAArB,EAAA,IAAA,CAACsB,EAAD,CACS,QACP,UAAWR,CACZ,CAAA,CACoB,C,EAE3B,CAEA,SAASQ,EAAY,CACnB,QACA,aAIC,CAED,OADIX,EAAM,SAAW,EAAU,MAE7B,EAAAX,EAAA,IAAA,CAAC,MAAD,CACE,UAAU,kBACV,KAAK,SACL,aAAW,gBAEV,SAAAW,EAAM,IAAK,IACV,EAAAX,EAAA,IAAA,CAACuB,EAAD,CAEQ,OACK,WACZ,EAHMP,EAAK,EAGX,CACF,CACE,CAAA,CAET,CAEA,SAASO,EAAW,CAAE,OAAM,aAAqE,CAM/F,OALA,EAAAxB,EAAA,UAAA,KAAgB,CACd,IAAMyB,EAAQ,OAAO,eAAiBhB,EAAUQ,EAAK,EAAE,EAAGA,EAAK,UAAY,GAAI,EAC/E,UAAa,OAAO,aAAaQ,CAAK,CACxC,EAAG,CAACR,EAAMR,CAAS,CAAC,GAGlB,EAAAR,EAAA,IAAA,CAACE,EAAD,CACE,KAAMc,EAAK,KACX,MAAOA,EAAK,MACZ,YAAaA,EAAK,YAClB,cAAiBR,EAAUQ,EAAK,EAAE,CACnC,CAAA,CAEL,CAEA,SAAgBS,GAA8B,CAC5C,IAAMC,GAAA,EAAU9B,EAAAA,WAAAA,CAAWa,CAAY,EACvC,GAAI,CAACiB,EAAS,MAAU,MAAM,iDAAiD,EAC/E,OAAOA,CACT,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Toast/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAA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,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,kBAAkB,+BAuB7D;AA2CD,wBAAgB,QAAQ,IAAI,iBAAiB,CAI5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Toast/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAU9E,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,cAAc,CAAC;IAChE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,wEAAwE;AACxE,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Toast/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,aAAa,CAAC;AAErB,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAU9E,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,cAAc,CAAC;IAChE,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,wEAAwE;AACxE,eAAO,MAAM,KAAK,uGAiChB,CAAC;AAEH,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAMD,UAAU,iBAAiB;IACzB,KAAK,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;IACvC,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/B;AAID,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,kBAAkB,+BAuB7D;AA2CD,wBAAgB,QAAQ,IAAI,iBAAiB,CAI5C"}
|
|
@@ -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 { Button as t } from "../Button/index.js";
|
|
3
3
|
import { createContext as n, forwardRef as r, useCallback as i, useContext as a, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
|
|
4
4
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Icon","TONE_ICON","Toast","forwardRef","rest","tone","className","title","description","onDismiss","Button","ToastContext","createContext","ToastProvider","items","setItems","useState","nextId","useRef","dismiss","useCallback","current","item","id","toast","options","value","useMemo","children","ToastRegion","TimedToast","useEffect","timer","useToast","context","useContext"],"sources":["../../../src/components/Toast/index.tsx"],"sourcesContent":["import {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { Button } from \"../Button\";\nimport { Icon } from \"../Icon\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\nexport type ToastTone = \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\";\n\nconst TONE_ICON: Record<ToastTone, IconName> = {\n neutral: \"info\",\n info: \"info\",\n success: \"check\",\n warning: \"alert-triangle\",\n danger: \"alert-triangle\",\n};\n\nexport interface ToastProps extends HTMLAttributes<HTMLDivElement> {\n tone?: ToastTone;\n title: string;\n description?: string;\n /** Renders a dismiss button. Omit for a toast that only times out. */\n onDismiss?: () => void;\n}\n\n/** One fact about something that already happened. Never a question. */\nexport const Toast = forwardRef<HTMLDivElement, ToastProps>(function Toast(\n { tone = \"neutral\", title, description, onDismiss, className, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n role=\"status\"\n data-tone={tone === \"neutral\" ? undefined : tone}\n className={[\"ds-toast\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n <Icon
|
|
1
|
+
{"version":3,"file":"index.js","names":["Icon","TONE_ICON","Toast","forwardRef","rest","tone","className","title","description","onDismiss","Button","ToastContext","createContext","ToastProvider","items","setItems","useState","nextId","useRef","dismiss","useCallback","current","item","id","toast","options","value","useMemo","children","ToastRegion","TimedToast","useEffect","timer","useToast","context","useContext"],"sources":["../../../src/components/Toast/index.tsx"],"sourcesContent":["import {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { Button } from \"../Button\";\nimport { Icon } from \"../Icon\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\nexport type ToastTone = \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\";\n\nconst TONE_ICON: Record<ToastTone, IconName> = {\n neutral: \"info\",\n info: \"info\",\n success: \"check\",\n warning: \"alert-triangle\",\n danger: \"alert-triangle\",\n};\n\nexport interface ToastProps extends HTMLAttributes<HTMLDivElement> {\n tone?: ToastTone;\n title: string;\n description?: string;\n /** Renders a dismiss button. Omit for a toast that only times out. */\n onDismiss?: () => void;\n}\n\n/** One fact about something that already happened. Never a question. */\nexport const Toast = forwardRef<HTMLDivElement, ToastProps>(function Toast(\n { tone = \"neutral\", title, description, onDismiss, className, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n role=\"status\"\n data-tone={tone === \"neutral\" ? undefined : tone}\n className={[\"ds-toast\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n <Icon\n name={TONE_ICON[tone]}\n size={20}\n className=\"ds-toast__icon\"\n />\n <div className=\"ds-toast__body\">\n <span className=\"ds-toast__title\">{title}</span>\n {description && <span className=\"ds-toast__description\">{description}</span>}\n </div>\n {onDismiss && (\n <Button\n variant=\"simple\"\n size=\"sm\"\n isIconOnly\n iconStart=\"x\"\n aria-label=\"Dismiss notification\"\n onClick={onDismiss}\n />\n )}\n </div>\n );\n});\n\nexport interface ToastOptions {\n tone?: ToastTone;\n title: string;\n description?: string;\n /** Milliseconds before it dismisses itself. Defaults to `--toast-duration`. */\n duration?: number;\n}\n\ninterface ToastRecord extends ToastOptions {\n id: number;\n}\n\ninterface ToastContextValue {\n toast: (options: ToastOptions) => void;\n dismiss: (id: number) => void;\n}\n\nconst ToastContext = createContext<ToastContextValue | null>(null);\n\nexport interface ToastProviderProps {\n children: ReactNode;\n}\n\n/** Mount once, near the root. Everything below it can call `useToast()`. */\nexport function ToastProvider({ children }: ToastProviderProps) {\n const [items, setItems] = useState<ToastRecord[]>([]);\n const nextId = useRef(0);\n\n const dismiss = useCallback((id: number) => {\n setItems((current) => current.filter((item) => item.id !== id));\n }, []);\n\n const toast = useCallback((options: ToastOptions) => {\n setItems((current) => [...current, { ...options, id: nextId.current++ }]);\n }, []);\n\n const value = useMemo(() => ({ toast, dismiss }), [toast, dismiss]);\n\n return (\n <ToastContext.Provider value={value}>\n {children}\n <ToastRegion\n items={items}\n onDismiss={dismiss}\n />\n </ToastContext.Provider>\n );\n}\n\nfunction ToastRegion({\n items,\n onDismiss,\n}: {\n items: ToastRecord[];\n onDismiss: (id: number) => void;\n}) {\n if (items.length === 0) return null;\n return (\n <div\n className=\"ds-toast-region\"\n role=\"region\"\n aria-label=\"Notifications\"\n >\n {items.map((item) => (\n <TimedToast\n key={item.id}\n item={item}\n onDismiss={onDismiss}\n />\n ))}\n </div>\n );\n}\n\nfunction TimedToast({ item, onDismiss }: { item: ToastRecord; onDismiss: (id: number) => void }) {\n useEffect(() => {\n const timer = window.setTimeout(() => onDismiss(item.id), item.duration ?? 5000);\n return () => window.clearTimeout(timer);\n }, [item, onDismiss]);\n\n return (\n <Toast\n tone={item.tone}\n title={item.title}\n description={item.description}\n onDismiss={() => onDismiss(item.id)}\n />\n );\n}\n\nexport function useToast(): ToastContextValue {\n const context = useContext(ToastContext);\n if (!context) throw new Error(\"useToast must be used inside a <ToastProvider>.\");\n return context;\n}\n"],"mappings":";;;;;AAmBA,IAAMC,IAAyC;CAC7C,SAAS;CACT,MAAM;CACN,SAAS;CACT,SAAS;CACT,QAAQ;AACV,GAWaC,IAAQC,EAAuC,SAC1D,EAAE,UAAO,WAAW,UAAO,gBAAa,cAAW,cAAW,GAAGC,KACjE,GACA;CACA,OACE,kBAAC,OAAD;EACO;EACL,MAAK;EACL,aAAWC,MAAS,YAAY,KAAA,IAAYA;EAC5C,WAAW,CAAC,YAAYC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAC3D,GAAIF;EALN,UAAA;GAOE,kBAACJ,GAAD;IACE,MAAMC,EAAUI;IAChB,MAAM;IACN,WAAU;GACX,CAAA;GACD,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAAC,QAAD;KAAM,WAAU;KAAmB,UAAAE;IAAY,CAAA,GAC9CC,KAAe,kBAAC,QAAD;KAAM,WAAU;KAAyB,UAAAA;IAAkB,CAAA,CACxE;;GACJC,KACC,kBAACC,GAAD;IACE,SAAQ;IACR,MAAK;IACL,YAAA;IACA,WAAU;IACV,cAAW;IACX,SAASD;GACV,CAAA;EAEA;;AAET,CAAC,GAmBKE,IAAeC,EAAwC,IAAI;AAOjE,SAAg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}
|
|
@@ -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({brand:e,actions:t,label:r=`Product`,className:i,children:a,...o},s){return(0,n.jsxs)(`header`,{ref:s,className:[`ds-topnav`,i].filter(Boolean).join(` `),...o,children:[e&&(0,n.jsx)(`div`,{className:`ds-topnav__brand`,children:e}),a&&(0,n.jsx)(`nav`,{className:`ds-topnav__nav`,"aria-label":r,children:(0,n.jsx)(`ul`,{className:`ds-topnav__list`,children:a})}),t&&(0,n.jsx)(`div`,{className:`ds-topnav__actions`,children:t})]})}),i=(0,t.forwardRef)(function({label:t,icon:r,isActive:i,className:a,...o},s){return(0,n.jsx)(`li`,{className:`ds-topnav__row`,children:(0,n.jsxs)(`a`,{ref:s,className:[`ds-topnav__item`,a].filter(Boolean).join(` `),"data-active":i||void 0,"aria-current":i?`page`:void 0,...o,children:[r&&(0,n.jsx)(e.t,{name:r}),t]})})});exports.TopNav=r,exports.TopNavItem=i;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["forwardRef","Icon","require_Icon","react","react_jsx_runtime","TopNav","rest","className","brand","children","label","actions","TopNavItem","isActive","icon"],"sources":["../../../src/components/TopNav/index.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["forwardRef","Icon","require_Icon","react","react_jsx_runtime","TopNav","rest","className","brand","children","label","actions","TopNavItem","isActive","icon"],"sources":["../../../src/components/TopNav/index.tsx"],"sourcesContent":["import { forwardRef, type AnchorHTMLAttributes, type HTMLAttributes, type ReactNode } from \"react\";\nimport { Icon } from \"../Icon\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\nexport interface TopNavProps extends HTMLAttributes<HTMLElement> {\n /** Brand block or product mark, first in the bar. */\n brand?: ReactNode;\n /** Controls at the end: search, notifications, the account avatar. */\n actions?: ReactNode;\n /** Accessible name for the landmark. */\n label?: string;\n children?: ReactNode;\n}\n\n/**\n * The product bar: brand at the start, destinations in the middle, account\n * work at the end, one hairline rule under the whole thing. It sits above the\n * side rail, never inside it.\n */\nexport const TopNav = forwardRef<HTMLElement, TopNavProps>(function TopNav(\n { brand, actions, label = \"Product\", className, children, ...rest },\n ref,\n) {\n return (\n <header\n ref={ref}\n className={[\"ds-topnav\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {brand && <div className=\"ds-topnav__brand\">{brand}</div>}\n {children && (\n <nav\n className=\"ds-topnav__nav\"\n aria-label={label}\n >\n <ul className=\"ds-topnav__list\">{children}</ul>\n </nav>\n )}\n {actions && <div className=\"ds-topnav__actions\">{actions}</div>}\n </header>\n );\n});\n\nexport interface TopNavItemProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n label: string;\n icon?: IconName;\n isActive?: boolean;\n}\n\n/**\n * One destination in the bar. The active item carries a solid underline —\n * the rail turned on its side, so selection reads the same as everywhere else.\n */\nexport const TopNavItem = forwardRef<HTMLAnchorElement, TopNavItemProps>(function TopNavItem(\n { label, icon, isActive, className, ...rest },\n ref,\n) {\n return (\n <li className=\"ds-topnav__row\">\n <a\n ref={ref}\n className={[\"ds-topnav__item\", className].filter(Boolean).join(\" \")}\n data-active={isActive || undefined}\n aria-current={isActive ? \"page\" : undefined}\n {...rest}\n >\n {icon && <Icon name={icon} />}\n {label}\n </a>\n </li>\n );\n});\n"],"mappings":"A,2KAoBA,IAAaK,GAAA,EAASL,EAAAA,WAAAA,CAAqC,SACzD,CAAE,QAAO,UAAS,QAAQ,UAAW,YAAW,WAAU,GAAGM,GAC7D,EACA,CACA,OACE,EAAAF,EAAA,KAAA,CAAC,SAAD,CACO,MACL,UAAW,CAAC,YAAaG,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAC5D,GAAID,EAHN,SAAA,CAKGE,IAAS,EAAAJ,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,mBAAoB,SAAAI,CAAW,CAAA,EACvDC,IACC,EAAAL,EAAA,IAAA,CAAC,MAAD,CACE,UAAU,iBACV,aAAYM,EAEZ,UAAA,EAAAN,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,kBAAmB,UAAa,CAAA,CAC3C,CAAA,EAENO,IAAW,EAAAP,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,qBAAsB,SAAAO,CAAa,CAAA,CACxD,C,EAEZ,CAAC,EAYYC,GAAA,EAAaZ,EAAAA,WAAAA,CAA+C,SACvE,CAAE,QAAO,OAAM,WAAU,YAAW,GAAGM,GACvC,EACA,CACA,OACE,EAAAF,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,iBACZ,UAAA,EAAAA,EAAA,KAAA,CAAC,IAAD,CACO,MACL,UAAW,CAAC,kBAAmBG,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAClE,cAAaM,GAAY,IAAA,GACzB,eAAcA,EAAW,OAAS,IAAA,GAClC,GAAIP,EALN,SAAA,CAOGQ,IAAQ,EAAAV,EAAA,IAAA,CAACH,EAAAA,EAAD,CAAM,KAAMa,CAAO,CAAA,EAC3BJ,CACA,C,EACD,CAAA,CAER,CAAC,E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/TopNav/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/TopNav/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,oBAAoB,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC9D,qDAAqD;IACrD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,sEAAsE;IACtE,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,MAAM,qGAsBjB,CAAC;AAEH,MAAM,WAAW,eAAgB,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC9E,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,+GAkBrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TopNav/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TopNav/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,oBAAoB,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC9D,qDAAqD;IACrD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,sEAAsE;IACtE,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,MAAM,qGAsBjB,CAAC;AAEH,MAAM,WAAW,eAAgB,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC9E,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,+GAkBrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Icon","TopNav","forwardRef","rest","className","brand","children","label","actions","TopNavItem","isActive","icon"],"sources":["../../../src/components/TopNav/index.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"index.js","names":["Icon","TopNav","forwardRef","rest","className","brand","children","label","actions","TopNavItem","isActive","icon"],"sources":["../../../src/components/TopNav/index.tsx"],"sourcesContent":["import { forwardRef, type AnchorHTMLAttributes, type HTMLAttributes, type ReactNode } from \"react\";\nimport { Icon } from \"../Icon\";\nimport type { IconName } from \"../Icon/icons\";\nimport \"./style.css\";\n\nexport interface TopNavProps extends HTMLAttributes<HTMLElement> {\n /** Brand block or product mark, first in the bar. */\n brand?: ReactNode;\n /** Controls at the end: search, notifications, the account avatar. */\n actions?: ReactNode;\n /** Accessible name for the landmark. */\n label?: string;\n children?: ReactNode;\n}\n\n/**\n * The product bar: brand at the start, destinations in the middle, account\n * work at the end, one hairline rule under the whole thing. It sits above the\n * side rail, never inside it.\n */\nexport const TopNav = forwardRef<HTMLElement, TopNavProps>(function TopNav(\n { brand, actions, label = \"Product\", className, children, ...rest },\n ref,\n) {\n return (\n <header\n ref={ref}\n className={[\"ds-topnav\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {brand && <div className=\"ds-topnav__brand\">{brand}</div>}\n {children && (\n <nav\n className=\"ds-topnav__nav\"\n aria-label={label}\n >\n <ul className=\"ds-topnav__list\">{children}</ul>\n </nav>\n )}\n {actions && <div className=\"ds-topnav__actions\">{actions}</div>}\n </header>\n );\n});\n\nexport interface TopNavItemProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n label: string;\n icon?: IconName;\n isActive?: boolean;\n}\n\n/**\n * One destination in the bar. The active item carries a solid underline —\n * the rail turned on its side, so selection reads the same as everywhere else.\n */\nexport const TopNavItem = forwardRef<HTMLAnchorElement, TopNavItemProps>(function TopNavItem(\n { label, icon, isActive, className, ...rest },\n ref,\n) {\n return (\n <li className=\"ds-topnav__row\">\n <a\n ref={ref}\n className={[\"ds-topnav__item\", className].filter(Boolean).join(\" \")}\n data-active={isActive || undefined}\n aria-current={isActive ? \"page\" : undefined}\n {...rest}\n >\n {icon && <Icon name={icon} />}\n {label}\n </a>\n </li>\n );\n});\n"],"mappings":";;;;AAoBA,IAAaC,IAASC,EAAqC,SACzD,EAAE,UAAO,YAAS,WAAQ,WAAW,cAAW,aAAU,GAAGC,KAC7D,GACA;CACA,OACE,kBAAC,UAAD;EACO;EACL,WAAW,CAAC,aAAaC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAC5D,GAAID;EAHN,UAAA;GAKGE,KAAS,kBAAC,OAAD;IAAK,WAAU;IAAoB,UAAAA;GAAW,CAAA;GACvDC,KACC,kBAAC,OAAD;IACE,WAAU;IACV,cAAYC;IAEZ,UAAA,kBAAC,MAAD;KAAI,WAAU;KAAmB;IAAa,CAAA;GAC3C,CAAA;GAENC,KAAW,kBAAC,OAAD;IAAK,WAAU;IAAsB,UAAAA;GAAa,CAAA;EACxD;;AAEZ,CAAC,GAYYC,IAAaP,EAA+C,SACvE,EAAE,UAAO,SAAM,aAAU,cAAW,GAAGC,KACvC,GACA;CACA,OACE,kBAAC,MAAD;EAAI,WAAU;EACZ,UAAA,kBAAC,KAAD;GACO;GACL,WAAW,CAAC,mBAAmBC,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;GAClE,eAAaM,KAAY,KAAA;GACzB,gBAAcA,IAAW,SAAS,KAAA;GAClC,GAAIP;GALN,UAAA,CAOGQ,KAAQ,kBAACX,GAAD,EAAM,MAAMW,EAAO,CAAA,GAC3BJ,CACA;;CACD,CAAA;AAER,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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("./components/Button/index.cjs"),n=require("./components/Drawer/index.cjs"),r=require("./components/SideNav/index.cjs"),i=require("./components/TopNav/index.cjs"),a=require("./components/AppShell/index.cjs"),o=require("./components/ButtonGroup/index.cjs"),s=require("./components/Field/index.cjs"),c=require("./components/Modal/index.cjs"),l=require("./components/TextField/index.cjs"),u=require("./chunks/RichTextEditor-BxtlbjXj.cjs"),d=require("./components/Badge/index.cjs"),f=require("./components/FieldAffix/index.cjs"),p=require("./components/SearchField/index.cjs"),m=require("./components/SortableList/index.cjs"),h=require("./components/EntryPicker/index.cjs"),g=require("./components/NumberField/index.cjs"),_=require("./components/Popover/index.cjs"),v=require("./components/Select/index.cjs"),y=require("./components/Switch/index.cjs"),b=require("./chunks/FormEditor-8bz3pOdP.cjs"),x=require("./chunks/Board-BUJ5CinL.cjs"),S=require("./components/Avatar/index.cjs"),C=require("./components/Grid/index.cjs"),w=require("./components/Choice/index.cjs"),T=require("./components/Table/index.cjs"),E=require("./components/Menu/index.cjs"),D=require("./components/Toast/index.cjs"),O=require("./components/Skeleton/index.cjs"),k=require("./components/SubNav/index.cjs"),A=require("./components/SelectionCard/index.cjs"),j=require("./components/Stepper/index.cjs"),M=require("./components/AssetCard/index.cjs"),N=require("./components/AssetGrid/index.cjs"),P=require("./components/Slider/index.cjs"),F=require("./components/ImageCropper/index.cjs"),I=require("./components/Container/index.cjs"),L=require("./components/DatePicker/index.cjs"),R=require("./components/TagsInput/index.cjs"),z=require("./components/Time/index.cjs"),B=require("./components/Pagination/index.cjs"),V=require("./components/EditLayout/index.cjs");exports.AppShell=a.AppShell,exports.AssetCard=M.AssetCard,exports.AssetTile=M.AssetCard,exports.AssetCardSkeleton=M.AssetCardSkeleton,exports.AssetTileSkeleton=M.AssetCardSkeleton,exports.AssetGrid=N.AssetGrid,exports.AssetGridEmpty=N.AssetGridEmpty,exports.Avatar=S.Avatar,exports.AvatarGroup=S.AvatarGroup,exports.Badge=d.Badge,exports.Board=x.t,exports.BoardCard=x.n,exports.BoardColumn=x.r,exports.Button=t.Button,exports.ButtonGroup=o.ButtonGroup,exports.Calendar=L.Calendar,exports.Checkbox=w.Checkbox,exports.CheckboxCard=A.CheckboxCard,exports.ChoiceGroup=w.ChoiceGroup,exports.Container=I.Container,exports.DateField=L.DateField,exports.DateRangeField=L.DateRangeField,exports.Drawer=n.Drawer,exports.EditLayout=V.EditLayout,exports.EntryPicker=h.EntryPicker,exports.Field=s.Field,exports.FieldAffix=f.FieldAffix,exports.FormEditor=b.t,exports.Grid=C.Grid,exports.GridItem=C.GridItem,exports.Icon=e.t,exports.ImageCropper=F.ImageCropper,exports.Menu=E.Menu,exports.MenuItem=E.MenuItem,exports.MenuLabel=E.MenuLabel,exports.MenuSeparator=E.MenuSeparator,exports.Modal=c.Modal,exports.NumberField=g.NumberField,exports.NumberRangeField=g.NumberRangeField,exports.Pagination=B.Pagination,exports.Popover=_.Popover,exports.Radio=w.Radio,exports.RadioCard=A.RadioCard,exports.RangeSlider=P.RangeSlider,exports.RichTextEditor=u.t,exports.SearchField=p.SearchField,exports.Select=v.Select,exports.SelectionCardGroup=A.SelectionCardGroup,exports.SideNav=r.SideNav,exports.SideNavFooter=r.SideNavFooter,exports.SideNavHeader=r.SideNavHeader,exports.SideNavItem=r.SideNavItem,exports.SideNavSection=r.SideNavSection,exports.Skeleton=O.Skeleton,exports.SkeletonText=O.SkeletonText,exports.Slider=P.Slider,exports.SortableList=m.SortableList,exports.SortableListItem=m.SortableListItem,exports.Stack=C.Stack,exports.Stepper=j.Stepper,exports.SubNav=k.SubNav,exports.SubNavButton=k.SubNavButton,exports.SubNavItem=k.SubNavItem,exports.Switch=y.Switch,exports.Table=T.Table,exports.TableBody=T.TableBody,exports.TableCell=T.TableCell,exports.TableEmpty=T.TableEmpty,exports.TableFrame=T.TableFrame,exports.TableHead=T.TableHead,exports.TableHeaderCell=T.TableHeaderCell,exports.TableRow=T.TableRow,exports.TableToolbar=T.TableToolbar,exports.TagsInput=R.TagsInput,exports.TextArea=l.TextArea,exports.TextField=l.TextField,exports.Time=z.Time,exports.Toast=D.Toast,exports.ToastProvider=D.ToastProvider,exports.TopNav=i.TopNav,exports.TopNavItem=i.TopNavItem,exports.cropToBlob=F.cropToBlob,exports.formatAbsoluteDate=z.formatAbsoluteDate,exports.formatAbsoluteTime=z.formatAbsoluteTime,exports.formatIsoDate=L.formatIsoDate,exports.formatRelativeTime=z.formatRelativeTime,exports.iconNames=e.n,exports.icons=e.r,exports.useSideNavCollapsed=r.useSideNavCollapsed,exports.useToast=D.useToast,exports.validateFormValues=b.n;
|
package/dist/index.d.cts
CHANGED
|
@@ -5,11 +5,11 @@ export type { ButtonProps, ButtonVariant, ButtonSize } from "./components/Button
|
|
|
5
5
|
export { ButtonGroup } from "./components/ButtonGroup/index.cjs";
|
|
6
6
|
export type { ButtonGroupProps, ButtonGroupOrientation } from "./components/ButtonGroup/index.cjs";
|
|
7
7
|
export { RichTextEditor } from "./components/RichTextEditor/index.cjs";
|
|
8
|
-
export type { RichTextEditorProps, RichTextEditorSize, RichTextDocument } from "./components/RichTextEditor/index.cjs";
|
|
8
|
+
export type { RichTextEditorProps, RichTextEditorSize, RichTextDocument, } from "./components/RichTextEditor/index.cjs";
|
|
9
9
|
export { FormEditor, validateFormValues } from "./components/FormEditor/index.cjs";
|
|
10
|
-
export type { FormEditorProps, FormChange, AssetValue, FormField, FormSchema, FormErrors, FormFieldValue, FormValues, ReferenceValue } from "./components/FormEditor/index.cjs";
|
|
10
|
+
export type { FormEditorProps, FormChange, AssetValue, FormField, FormSchema, FormErrors, FormFieldValue, FormValues, ReferenceValue, } from "./components/FormEditor/index.cjs";
|
|
11
11
|
export { Board, BoardColumn, BoardCard } from "./components/Board/index.cjs";
|
|
12
|
-
export type { BoardProps, BoardColumnProps, BoardCardProps, BoardMove, BoardColumnMove } from "./components/Board/index.cjs";
|
|
12
|
+
export type { BoardProps, BoardColumnProps, BoardCardProps, BoardMove, BoardColumnMove, } from "./components/Board/index.cjs";
|
|
13
13
|
export { SortableList, SortableListItem } from "./components/SortableList/index.cjs";
|
|
14
14
|
export type { SortableListProps, SortableListItemProps } from "./components/SortableList/index.cjs";
|
|
15
15
|
export { Drawer } from "./components/Drawer/index.cjs";
|
|
@@ -44,7 +44,7 @@ export { TopNav, TopNavItem } from "./components/TopNav/index.cjs";
|
|
|
44
44
|
export type { TopNavProps, TopNavItemProps } from "./components/TopNav/index.cjs";
|
|
45
45
|
export { SubNav, SubNavItem, SubNavButton } from "./components/SubNav/index.cjs";
|
|
46
46
|
export type { SubNavProps, SubNavItemProps, SubNavButtonProps } from "./components/SubNav/index.cjs";
|
|
47
|
-
export { CheckboxCard, RadioCard, SelectionCardGroup
|
|
47
|
+
export { CheckboxCard, RadioCard, SelectionCardGroup } from "./components/SelectionCard/index.cjs";
|
|
48
48
|
export type { CheckboxCardProps, RadioCardProps, SelectionCardGroupProps, } from "./components/SelectionCard/index.cjs";
|
|
49
49
|
export { Stepper } from "./components/Stepper/index.cjs";
|
|
50
50
|
export type { StepperProps, StepperSize, Step, StepStatus } from "./components/Stepper/index.cjs";
|
|
@@ -53,7 +53,7 @@ export type { AssetCardProps, AssetCardSkeletonProps } from "./components/AssetC
|
|
|
53
53
|
export { AssetGrid, AssetTile, AssetTileSkeleton, AssetGridEmpty } from "./components/AssetGrid/index.cjs";
|
|
54
54
|
export type { AssetGridProps, AssetTileProps, AssetTileSkeletonProps, AssetGridEmptyProps, } from "./components/AssetGrid/index.cjs";
|
|
55
55
|
export { ImageCropper, cropToBlob } from "./components/ImageCropper/index.cjs";
|
|
56
|
-
export type { ImageCropperProps, ImageCropperDefaultState, CropRect, CropState, CropToBlobOptions } from "./components/ImageCropper/index.cjs";
|
|
56
|
+
export type { ImageCropperProps, ImageCropperDefaultState, CropRect, CropState, CropToBlobOptions, } from "./components/ImageCropper/index.cjs";
|
|
57
57
|
export { Grid, GridItem, Stack } from "./components/Grid/index.cjs";
|
|
58
58
|
export type { GridProps, GridItemProps, StackProps, GapSize, GridColumns, GridAlign, StackDirection, } from "./components/Grid/index.cjs";
|
|
59
59
|
export { Container } from "./components/Container/index.cjs";
|
|
@@ -61,7 +61,7 @@ export type { ContainerProps, ContainerWidth } from "./components/Container/inde
|
|
|
61
61
|
export { Select } from "./components/Select/index.cjs";
|
|
62
62
|
export type { SelectProps, SelectOption } from "./components/Select/index.cjs";
|
|
63
63
|
export { NumberField, NumberRangeField } from "./components/NumberField/index.cjs";
|
|
64
|
-
export type { NumberFieldProps, NumberRangeFieldProps, NumberRangeValue } from "./components/NumberField/index.cjs";
|
|
64
|
+
export type { NumberFieldProps, NumberRangeFieldProps, NumberRangeValue, } from "./components/NumberField/index.cjs";
|
|
65
65
|
export { Slider, RangeSlider } from "./components/Slider/index.cjs";
|
|
66
66
|
export type { SliderProps, RangeSliderProps, RangeSliderValue } from "./components/Slider/index.cjs";
|
|
67
67
|
export { Switch } from "./components/Switch/index.cjs";
|
|
@@ -74,7 +74,7 @@ export { TagsInput } from "./components/TagsInput/index.cjs";
|
|
|
74
74
|
export type { TagsInputProps } from "./components/TagsInput/index.cjs";
|
|
75
75
|
export { EntryPicker } from "./components/EntryPicker/index.cjs";
|
|
76
76
|
export type { EntryPickerProps, EntryItem, EntryPickerMode } from "./components/EntryPicker/index.cjs";
|
|
77
|
-
export { Time, formatRelativeTime, formatAbsoluteDate, formatAbsoluteTime } from "./components/Time/index.cjs";
|
|
77
|
+
export { Time, formatRelativeTime, formatAbsoluteDate, formatAbsoluteTime, } from "./components/Time/index.cjs";
|
|
78
78
|
export type { TimeProps, TimeFormat } from "./components/Time/index.cjs";
|
|
79
79
|
export { Popover } from "./components/Popover/index.cjs";
|
|
80
80
|
export type { PopoverProps, PopoverAlign, PopoverPlacement } from "./components/Popover/index.cjs";
|
|
@@ -82,4 +82,6 @@ export { Pagination } from "./components/Pagination/index.cjs";
|
|
|
82
82
|
export type { PaginationProps, PaginationState, PaginationSize } from "./components/Pagination/index.cjs";
|
|
83
83
|
export { FieldAffix } from "./components/FieldAffix/index.cjs";
|
|
84
84
|
export type { FieldAffixProps } from "./components/FieldAffix/index.cjs";
|
|
85
|
+
export { EditLayout } from "./components/EditLayout/index.cjs";
|
|
86
|
+
export type { EditLayoutProps, EditSaveState } from "./components/EditLayout/index.cjs";
|
|
85
87
|
//# sourceMappingURL=index.d.cts.map
|