@namroodinc/liquid-editorial 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -10
- package/UPGRADING.md +514 -0
- package/dist/chunks/{Avatar-DdFEOumt.js → Avatar-BK8IdL5W.js} +2 -2
- package/dist/chunks/{Avatar-DdFEOumt.js.map → Avatar-BK8IdL5W.js.map} +1 -1
- package/dist/chunks/{Avatar-B_2lI7fS.cjs → Avatar-DPnrvkwd.cjs} +2 -2
- package/dist/chunks/{Avatar-B_2lI7fS.cjs.map → Avatar-DPnrvkwd.cjs.map} +1 -1
- package/dist/chunks/CollectionView-BNYx29b1.cjs +2 -0
- package/dist/chunks/CollectionView-BNYx29b1.cjs.map +1 -0
- package/dist/chunks/{CollectionView-Cr12UFWa.js → CollectionView-Vj84E26b.js} +28 -29
- package/dist/chunks/CollectionView-Vj84E26b.js.map +1 -0
- package/dist/chunks/ColourField-C1qjpIfB.cjs +2 -0
- package/dist/chunks/ColourField-C1qjpIfB.cjs.map +1 -0
- package/dist/chunks/{ColourField-B-tjjBfA.js → ColourField-Ce2oaVcd.js} +122 -122
- package/dist/chunks/ColourField-Ce2oaVcd.js.map +1 -0
- package/dist/chunks/DatePicker-BCnzFJFF.cjs +2 -0
- package/dist/chunks/DatePicker-BCnzFJFF.cjs.map +1 -0
- package/dist/chunks/DatePicker-CnVmsCwO.js +298 -0
- package/dist/chunks/DatePicker-CnVmsCwO.js.map +1 -0
- package/dist/chunks/Drawer-BDX9_qHA.cjs +2 -0
- package/dist/chunks/Drawer-BDX9_qHA.cjs.map +1 -0
- package/dist/chunks/Drawer-DTtgAZO2.js +172 -0
- package/dist/chunks/Drawer-DTtgAZO2.js.map +1 -0
- package/dist/chunks/EntryPicker-Baqn0SQM.cjs +2 -0
- package/dist/chunks/EntryPicker-Baqn0SQM.cjs.map +1 -0
- package/dist/chunks/EntryPicker-DIYjKmBf.js +803 -0
- package/dist/chunks/EntryPicker-DIYjKmBf.js.map +1 -0
- package/dist/chunks/FormEditor-B7Pm_ZzT.cjs +2 -0
- package/dist/chunks/FormEditor-B7Pm_ZzT.cjs.map +1 -0
- package/dist/chunks/{FormEditor-ucTbDyQt.js → FormEditor-HqqFmu7s.js} +223 -200
- package/dist/chunks/FormEditor-HqqFmu7s.js.map +1 -0
- package/dist/chunks/{LoadState-B7GTDlWv.js → LoadState-B056EPu7.js} +20 -19
- package/dist/chunks/LoadState-B056EPu7.js.map +1 -0
- package/dist/chunks/LoadState-BXLG-SkQ.cjs +2 -0
- package/dist/chunks/LoadState-BXLG-SkQ.cjs.map +1 -0
- package/dist/chunks/NumberField-CVsK4l9P.js +178 -0
- package/dist/chunks/NumberField-CVsK4l9P.js.map +1 -0
- package/dist/chunks/NumberField-Ccjpa_1d.cjs +2 -0
- package/dist/chunks/NumberField-Ccjpa_1d.cjs.map +1 -0
- package/dist/chunks/{RichTextEditor-CNkwWist.js → RichTextEditor-CuZnjiy2.js} +93 -93
- package/dist/chunks/RichTextEditor-CuZnjiy2.js.map +1 -0
- package/dist/chunks/RichTextEditor-DcbLho2Q.cjs +2 -0
- package/dist/chunks/RichTextEditor-DcbLho2Q.cjs.map +1 -0
- package/dist/chunks/dialogLabel-2HRYMHbF.cjs +2 -0
- package/dist/chunks/dialogLabel-2HRYMHbF.cjs.map +1 -0
- package/dist/chunks/dialogLabel-D18maX-p.js +176 -0
- package/dist/chunks/dialogLabel-D18maX-p.js.map +1 -0
- package/dist/chunks/frame-CzadNYgy.js +164 -0
- package/dist/chunks/frame-CzadNYgy.js.map +1 -0
- package/dist/chunks/frame-Mh99nmhR.cjs +2 -0
- package/dist/chunks/frame-Mh99nmhR.cjs.map +1 -0
- package/dist/chunks/group-CJA3-3s5.js +35 -0
- package/dist/chunks/group-CJA3-3s5.js.map +1 -0
- package/dist/chunks/group-DRSLOsXu.cjs +2 -0
- package/dist/chunks/group-DRSLOsXu.cjs.map +1 -0
- package/dist/chunks/limit-BNo4dlRj.cjs +2 -0
- package/dist/chunks/limit-BNo4dlRj.cjs.map +1 -0
- package/dist/chunks/limit-s9zfxIMC.js +16 -0
- package/dist/chunks/limit-s9zfxIMC.js.map +1 -0
- package/dist/chunks/overlayLayer-IuoPVwTO.js +158 -0
- package/dist/chunks/overlayLayer-IuoPVwTO.js.map +1 -0
- package/dist/chunks/overlayLayer-seJG-EFn.cjs +2 -0
- package/dist/chunks/overlayLayer-seJG-EFn.cjs.map +1 -0
- package/dist/chunks/useIsomorphicLayoutEffect-Bc9hxFMc.js +7 -0
- package/dist/chunks/useIsomorphicLayoutEffect-Bc9hxFMc.js.map +1 -0
- package/dist/chunks/useIsomorphicLayoutEffect-XM4Ot6x5.cjs +2 -0
- package/dist/chunks/useIsomorphicLayoutEffect-XM4Ot6x5.cjs.map +1 -0
- package/dist/chunks/{useLimit-DXe_VmYl.cjs → useLimit-CCv6sAUS.cjs} +2 -2
- package/dist/chunks/useLimit-CCv6sAUS.cjs.map +1 -0
- package/dist/chunks/{useLimit-BOmHKdJE.js → useLimit-DZOKm4S_.js} +2 -2
- package/dist/chunks/useLimit-DZOKm4S_.js.map +1 -0
- package/dist/chunks/useTooltip-BXAvQwt4.cjs +2 -0
- package/dist/chunks/useTooltip-BXAvQwt4.cjs.map +1 -0
- package/dist/chunks/useTooltip-BrC7FdeH.js +75 -0
- package/dist/chunks/useTooltip-BrC7FdeH.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.js +4 -4
- package/dist/components/AppShell/index.js.map +1 -1
- package/dist/components/Avatar/index.cjs +1 -1
- package/dist/components/Avatar/index.js +1 -1
- package/dist/components/Badge/index.cjs +1 -1
- package/dist/components/Badge/index.cjs.map +1 -1
- package/dist/components/Badge/index.d.cts +3 -0
- package/dist/components/Badge/index.d.cts.map +1 -1
- package/dist/components/Badge/index.d.ts +3 -0
- package/dist/components/Badge/index.d.ts.map +1 -1
- package/dist/components/Badge/index.js +11 -10
- package/dist/components/Badge/index.js.map +1 -1
- package/dist/components/Badge/style.css +25 -2
- package/dist/components/Button/index.cjs.map +1 -1
- package/dist/components/Button/index.d.cts +4 -2
- package/dist/components/Button/index.d.cts.map +1 -1
- package/dist/components/Button/index.d.ts +4 -2
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Choice/index.cjs +1 -1
- package/dist/components/Choice/index.cjs.map +1 -1
- package/dist/components/Choice/index.d.cts +13 -2
- package/dist/components/Choice/index.d.cts.map +1 -1
- package/dist/components/Choice/index.d.ts +13 -2
- package/dist/components/Choice/index.d.ts.map +1 -1
- package/dist/components/Choice/index.js +55 -35
- package/dist/components/Choice/index.js.map +1 -1
- package/dist/components/Choice/style.css +7 -2
- package/dist/components/CollectionView/filters.d.cts.map +1 -1
- package/dist/components/CollectionView/filters.d.ts.map +1 -1
- package/dist/components/CollectionView/index.cjs +1 -1
- package/dist/components/CollectionView/index.js +1 -1
- package/dist/components/ColourField/index.cjs +1 -1
- package/dist/components/ColourField/index.d.cts.map +1 -1
- package/dist/components/ColourField/index.d.ts.map +1 -1
- package/dist/components/ColourField/index.js +1 -1
- package/dist/components/DatePicker/index.cjs +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/Drawer/content.d.cts +27 -0
- package/dist/components/Drawer/content.d.cts.map +1 -0
- package/dist/components/Drawer/content.d.ts +27 -0
- package/dist/components/Drawer/content.d.ts.map +1 -0
- package/dist/components/Drawer/head.d.cts +10 -0
- package/dist/components/Drawer/head.d.cts.map +1 -0
- package/dist/components/Drawer/head.d.ts +10 -0
- package/dist/components/Drawer/head.d.ts.map +1 -0
- package/dist/components/Drawer/index.cjs +1 -2
- package/dist/components/Drawer/index.d.cts +24 -0
- package/dist/components/Drawer/index.d.cts.map +1 -1
- package/dist/components/Drawer/index.d.ts +24 -0
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +1 -102
- package/dist/components/Drawer/style.css +70 -0
- package/dist/components/EditLayout/index.cjs +1 -1
- package/dist/components/EditLayout/index.cjs.map +1 -1
- package/dist/components/EditLayout/index.d.cts.map +1 -1
- package/dist/components/EditLayout/index.d.ts.map +1 -1
- package/dist/components/EditLayout/index.js +65 -64
- package/dist/components/EditLayout/index.js.map +1 -1
- package/dist/components/EditLayout/style.css +12 -5
- package/dist/components/EntryPicker/blocked.d.cts +21 -0
- package/dist/components/EntryPicker/blocked.d.cts.map +1 -0
- package/dist/components/EntryPicker/blocked.d.ts +21 -0
- package/dist/components/EntryPicker/blocked.d.ts.map +1 -0
- package/dist/components/EntryPicker/chosen.d.cts +16 -0
- package/dist/components/EntryPicker/chosen.d.cts.map +1 -0
- package/dist/components/EntryPicker/chosen.d.ts +16 -0
- package/dist/components/EntryPicker/chosen.d.ts.map +1 -0
- package/dist/components/EntryPicker/dialog.d.cts +26 -0
- package/dist/components/EntryPicker/dialog.d.cts.map +1 -0
- package/dist/components/EntryPicker/dialog.d.ts +26 -0
- package/dist/components/EntryPicker/dialog.d.ts.map +1 -0
- package/dist/components/EntryPicker/feedback.d.cts +20 -0
- package/dist/components/EntryPicker/feedback.d.cts.map +1 -0
- package/dist/components/EntryPicker/feedback.d.ts +20 -0
- package/dist/components/EntryPicker/feedback.d.ts.map +1 -0
- package/dist/components/EntryPicker/index.cjs +1 -1
- package/dist/components/EntryPicker/index.d.cts +4 -38
- package/dist/components/EntryPicker/index.d.cts.map +1 -1
- package/dist/components/EntryPicker/index.d.ts +4 -38
- package/dist/components/EntryPicker/index.d.ts.map +1 -1
- package/dist/components/EntryPicker/index.js +1 -1
- package/dist/components/EntryPicker/item.d.cts +34 -0
- package/dist/components/EntryPicker/item.d.cts.map +1 -0
- package/dist/components/EntryPicker/item.d.ts +34 -0
- package/dist/components/EntryPicker/item.d.ts.map +1 -0
- package/dist/components/EntryPicker/limit.d.cts +25 -2
- package/dist/components/EntryPicker/limit.d.cts.map +1 -1
- package/dist/components/EntryPicker/limit.d.ts +25 -2
- package/dist/components/EntryPicker/limit.d.ts.map +1 -1
- package/dist/components/EntryPicker/results.d.cts +10 -0
- package/dist/components/EntryPicker/results.d.cts.map +1 -0
- package/dist/components/EntryPicker/results.d.ts +10 -0
- package/dist/components/EntryPicker/results.d.ts.map +1 -0
- package/dist/components/EntryPicker/selected-items.d.cts +11 -0
- package/dist/components/EntryPicker/selected-items.d.cts.map +1 -0
- package/dist/components/EntryPicker/selected-items.d.ts +11 -0
- package/dist/components/EntryPicker/selected-items.d.ts.map +1 -0
- package/dist/components/EntryPicker/style.css +203 -21
- package/dist/components/EntryPicker/types.d.cts +69 -0
- package/dist/components/EntryPicker/types.d.cts.map +1 -0
- package/dist/components/EntryPicker/types.d.ts +69 -0
- package/dist/components/EntryPicker/types.d.ts.map +1 -0
- package/dist/components/EntryPicker/use-picker-data.d.cts +40 -0
- package/dist/components/EntryPicker/use-picker-data.d.cts.map +1 -0
- package/dist/components/EntryPicker/use-picker-data.d.ts +40 -0
- package/dist/components/EntryPicker/use-picker-data.d.ts.map +1 -0
- package/dist/components/EntryPicker/use-picker-scroll.d.cts +14 -0
- package/dist/components/EntryPicker/use-picker-scroll.d.cts.map +1 -0
- package/dist/components/EntryPicker/use-picker-scroll.d.ts +14 -0
- package/dist/components/EntryPicker/use-picker-scroll.d.ts.map +1 -0
- package/dist/components/EntryPicker/use-selected-items.d.cts +21 -0
- package/dist/components/EntryPicker/use-selected-items.d.cts.map +1 -0
- package/dist/components/EntryPicker/use-selected-items.d.ts +21 -0
- package/dist/components/EntryPicker/use-selected-items.d.ts.map +1 -0
- package/dist/components/Field/frame.d.cts.map +1 -1
- package/dist/components/Field/frame.d.ts.map +1 -1
- package/dist/components/Field/group.d.cts +1 -1
- package/dist/components/Field/group.d.cts.map +1 -1
- package/dist/components/Field/group.d.ts +1 -1
- package/dist/components/Field/group.d.ts.map +1 -1
- package/dist/components/Field/index.cjs +1 -1
- package/dist/components/Field/index.js +1 -1
- package/dist/components/Field/{limit-reading.d.cts → limit-announcer.d.cts} +1 -4
- package/dist/components/Field/limit-announcer.d.cts.map +1 -0
- package/dist/components/Field/{limit-reading.d.ts → limit-announcer.d.ts} +1 -4
- package/dist/components/Field/limit-announcer.d.ts.map +1 -0
- package/dist/components/Field/limit.d.cts +1 -5
- package/dist/components/Field/limit.d.cts.map +1 -1
- package/dist/components/Field/limit.d.ts +1 -5
- package/dist/components/Field/limit.d.ts.map +1 -1
- package/dist/components/Field/style.css +0 -39
- package/dist/components/Field/types.d.cts +9 -3
- package/dist/components/Field/types.d.cts.map +1 -1
- package/dist/components/Field/types.d.ts +9 -3
- package/dist/components/Field/types.d.ts.map +1 -1
- package/dist/components/Field/useLimit.d.cts +1 -1
- package/dist/components/Field/useLimit.d.cts.map +1 -1
- package/dist/components/Field/useLimit.d.ts +1 -1
- package/dist/components/Field/useLimit.d.ts.map +1 -1
- package/dist/components/FieldAffix/index.cjs +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 +2 -1
- package/dist/components/FieldAffix/index.js.map +1 -1
- package/dist/components/FormEditor/README.md +128 -14
- package/dist/components/FormEditor/control.d.cts +3 -2
- package/dist/components/FormEditor/control.d.cts.map +1 -1
- package/dist/components/FormEditor/control.d.ts +3 -2
- package/dist/components/FormEditor/control.d.ts.map +1 -1
- package/dist/components/FormEditor/index.cjs +1 -1
- package/dist/components/FormEditor/index.d.cts +3 -2
- package/dist/components/FormEditor/index.d.cts.map +1 -1
- package/dist/components/FormEditor/index.d.ts +3 -2
- package/dist/components/FormEditor/index.d.ts.map +1 -1
- package/dist/components/FormEditor/index.js +1 -1
- package/dist/components/FormEditor/model.d.cts +20 -5
- package/dist/components/FormEditor/model.d.cts.map +1 -1
- package/dist/components/FormEditor/model.d.ts +20 -5
- package/dist/components/FormEditor/model.d.ts.map +1 -1
- package/dist/components/ImageCropper/index.cjs +1 -1
- package/dist/components/ImageCropper/index.cjs.map +1 -1
- package/dist/components/ImageCropper/index.d.cts.map +1 -1
- package/dist/components/ImageCropper/index.d.ts.map +1 -1
- package/dist/components/ImageCropper/index.js +27 -26
- package/dist/components/ImageCropper/index.js.map +1 -1
- package/dist/components/LimitReading/index.cjs +2 -0
- package/dist/components/LimitReading/index.cjs.map +1 -0
- package/dist/components/LimitReading/index.d.cts +5 -0
- package/dist/components/LimitReading/index.d.cts.map +1 -0
- package/dist/components/LimitReading/index.d.ts +5 -0
- package/dist/components/LimitReading/index.d.ts.map +1 -0
- package/dist/components/LimitReading/index.js +71 -0
- package/dist/components/LimitReading/index.js.map +1 -0
- package/dist/components/LimitReading/limit.d.cts +9 -0
- package/dist/components/LimitReading/limit.d.cts.map +1 -0
- package/dist/components/LimitReading/limit.d.ts +9 -0
- package/dist/components/LimitReading/limit.d.ts.map +1 -0
- package/dist/components/LimitReading/style.css +69 -0
- package/dist/components/LimitReading/types.d.cts +22 -0
- package/dist/components/LimitReading/types.d.cts.map +1 -0
- package/dist/components/LimitReading/types.d.ts +22 -0
- package/dist/components/LimitReading/types.d.ts.map +1 -0
- package/dist/components/LoadState/error.d.cts +3 -1
- package/dist/components/LoadState/error.d.cts.map +1 -1
- package/dist/components/LoadState/error.d.ts +3 -1
- package/dist/components/LoadState/error.d.ts.map +1 -1
- package/dist/components/LoadState/index.cjs +1 -1
- package/dist/components/LoadState/index.d.cts +3 -1
- package/dist/components/LoadState/index.d.cts.map +1 -1
- package/dist/components/LoadState/index.d.ts +3 -1
- package/dist/components/LoadState/index.d.ts.map +1 -1
- package/dist/components/LoadState/index.js +1 -1
- package/dist/components/Menu/index.cjs +1 -1
- 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 +50 -49
- package/dist/components/Menu/index.js.map +1 -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 +12 -0
- package/dist/components/Modal/index.d.cts.map +1 -1
- package/dist/components/Modal/index.d.ts +12 -0
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/Modal/index.js +73 -64
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Modal/style.css +19 -0
- package/dist/components/NumberField/index.cjs +1 -1
- package/dist/components/NumberField/index.d.cts +1 -1
- package/dist/components/NumberField/index.d.cts.map +1 -1
- package/dist/components/NumberField/index.d.ts +1 -1
- package/dist/components/NumberField/index.d.ts.map +1 -1
- package/dist/components/NumberField/index.js +1 -1
- package/dist/components/NumberField/style.css +1 -1
- package/dist/components/Popover/index.cjs +1 -1
- package/dist/components/Popover/index.cjs.map +1 -1
- package/dist/components/Popover/index.d.cts +1 -1
- package/dist/components/Popover/index.d.cts.map +1 -1
- package/dist/components/Popover/index.d.ts +1 -1
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js +57 -55
- package/dist/components/Popover/index.js.map +1 -1
- package/dist/components/Popover/style.css +6 -0
- package/dist/components/Popover/useTooltip.d.cts +2 -1
- package/dist/components/Popover/useTooltip.d.cts.map +1 -1
- package/dist/components/Popover/useTooltip.d.ts +2 -1
- package/dist/components/Popover/useTooltip.d.ts.map +1 -1
- package/dist/components/RichTextEditor/expansion.d.cts.map +1 -1
- package/dist/components/RichTextEditor/expansion.d.ts.map +1 -1
- package/dist/components/RichTextEditor/index.cjs +1 -1
- package/dist/components/RichTextEditor/index.js +1 -1
- package/dist/components/SearchField/index.cjs +1 -1
- package/dist/components/SearchField/index.cjs.map +1 -1
- package/dist/components/SearchField/index.d.cts +6 -1
- package/dist/components/SearchField/index.d.cts.map +1 -1
- package/dist/components/SearchField/index.d.ts +6 -1
- package/dist/components/SearchField/index.d.ts.map +1 -1
- package/dist/components/SearchField/index.js +32 -26
- package/dist/components/SearchField/index.js.map +1 -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 +73 -72
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/SelectionCard/index.cjs +1 -1
- package/dist/components/SelectionCard/index.js +1 -1
- package/dist/components/SortableList/index.cjs +1 -1
- package/dist/components/SortableList/index.cjs.map +1 -1
- package/dist/components/SortableList/index.d.cts +2 -0
- package/dist/components/SortableList/index.d.cts.map +1 -1
- package/dist/components/SortableList/index.d.ts +2 -0
- package/dist/components/SortableList/index.d.ts.map +1 -1
- package/dist/components/SortableList/index.js +14 -13
- package/dist/components/SortableList/index.js.map +1 -1
- 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 +40 -31
- package/dist/components/SubNav/index.js.map +1 -1
- package/dist/components/SubNav/style.css +0 -14
- package/dist/components/Table/style.css +6 -1
- package/dist/components/TagsInput/index.cjs +1 -1
- package/dist/components/TagsInput/index.js +1 -1
- package/dist/components/TextField/index.cjs +1 -1
- package/dist/components/TextField/index.js +1 -1
- package/dist/components/Time/index.cjs +1 -1
- package/dist/components/Time/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +5 -3
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +50 -48
- package/dist/internal/dialogFocus.d.cts +2 -0
- package/dist/internal/dialogFocus.d.cts.map +1 -1
- package/dist/internal/dialogFocus.d.ts +2 -0
- package/dist/internal/dialogFocus.d.ts.map +1 -1
- package/dist/internal/dialogLabel.d.cts +10 -0
- package/dist/internal/dialogLabel.d.cts.map +1 -0
- package/dist/internal/dialogLabel.d.ts +10 -0
- package/dist/internal/dialogLabel.d.ts.map +1 -0
- package/dist/internal/dialogStack.d.cts +11 -3
- package/dist/internal/dialogStack.d.cts.map +1 -1
- package/dist/internal/dialogStack.d.ts +11 -3
- package/dist/internal/dialogStack.d.ts.map +1 -1
- package/dist/internal/movableHost.d.cts +9 -5
- package/dist/internal/movableHost.d.cts.map +1 -1
- package/dist/internal/movableHost.d.ts +9 -5
- package/dist/internal/movableHost.d.ts.map +1 -1
- package/dist/internal/overlayLayer.d.cts +33 -0
- package/dist/internal/overlayLayer.d.cts.map +1 -0
- package/dist/internal/overlayLayer.d.ts +33 -0
- package/dist/internal/overlayLayer.d.ts.map +1 -0
- package/dist/internal/portalScope.d.cts.map +1 -1
- package/dist/internal/portalScope.d.ts.map +1 -1
- package/dist/internal/useDialogPortal.d.cts +9 -0
- package/dist/internal/useDialogPortal.d.cts.map +1 -0
- package/dist/internal/useDialogPortal.d.ts +9 -0
- package/dist/internal/useDialogPortal.d.ts.map +1 -0
- package/dist/internal/useIsomorphicLayoutEffect.d.cts +7 -0
- package/dist/internal/useIsomorphicLayoutEffect.d.cts.map +1 -0
- package/dist/internal/useIsomorphicLayoutEffect.d.ts +7 -0
- package/dist/internal/useIsomorphicLayoutEffect.d.ts.map +1 -0
- package/dist/internal/useLatest.d.cts +7 -0
- package/dist/internal/useLatest.d.cts.map +1 -0
- package/dist/internal/useLatest.d.ts +7 -0
- package/dist/internal/useLatest.d.ts.map +1 -0
- package/dist/internal/useModalDialog.d.cts +5 -1
- package/dist/internal/useModalDialog.d.cts.map +1 -1
- package/dist/internal/useModalDialog.d.ts +5 -1
- package/dist/internal/useModalDialog.d.ts.map +1 -1
- package/dist/styles.css +1 -0
- package/dist/tokens.css +2 -2
- package/package.json +1 -1
- package/dist/chunks/CollectionView-BIuOL917.cjs +0 -2
- package/dist/chunks/CollectionView-BIuOL917.cjs.map +0 -1
- package/dist/chunks/CollectionView-Cr12UFWa.js.map +0 -1
- package/dist/chunks/ColourField-B-tjjBfA.js.map +0 -1
- package/dist/chunks/ColourField-ynUP1pfN.cjs +0 -2
- package/dist/chunks/ColourField-ynUP1pfN.cjs.map +0 -1
- package/dist/chunks/DatePicker-01sor8iD.cjs +0 -2
- package/dist/chunks/DatePicker-01sor8iD.cjs.map +0 -1
- package/dist/chunks/DatePicker-DJAqXUDJ.js +0 -297
- package/dist/chunks/DatePicker-DJAqXUDJ.js.map +0 -1
- package/dist/chunks/EntryPicker-B88N69zH.js +0 -180
- package/dist/chunks/EntryPicker-B88N69zH.js.map +0 -1
- package/dist/chunks/EntryPicker-daSkD4aR.cjs +0 -2
- package/dist/chunks/EntryPicker-daSkD4aR.cjs.map +0 -1
- package/dist/chunks/FormEditor-C_4JbAnS.cjs +0 -2
- package/dist/chunks/FormEditor-C_4JbAnS.cjs.map +0 -1
- package/dist/chunks/FormEditor-ucTbDyQt.js.map +0 -1
- package/dist/chunks/LoadState-B7GTDlWv.js.map +0 -1
- package/dist/chunks/LoadState-C7tQ6fIP.cjs +0 -2
- package/dist/chunks/LoadState-C7tQ6fIP.cjs.map +0 -1
- package/dist/chunks/NumberField-1EYJdwDY.cjs +0 -2
- package/dist/chunks/NumberField-1EYJdwDY.cjs.map +0 -1
- package/dist/chunks/NumberField-DizR4NJv.js +0 -178
- package/dist/chunks/NumberField-DizR4NJv.js.map +0 -1
- package/dist/chunks/RichTextEditor-CNkwWist.js.map +0 -1
- package/dist/chunks/RichTextEditor-DAnjElUO.cjs +0 -2
- package/dist/chunks/RichTextEditor-DAnjElUO.cjs.map +0 -1
- package/dist/chunks/frame-C8TwdWBC.cjs +0 -2
- package/dist/chunks/frame-C8TwdWBC.cjs.map +0 -1
- package/dist/chunks/frame-DaC03_n-.js +0 -203
- package/dist/chunks/frame-DaC03_n-.js.map +0 -1
- package/dist/chunks/group-C6EOgTgM.js +0 -34
- package/dist/chunks/group-C6EOgTgM.js.map +0 -1
- package/dist/chunks/group-QSnlx4jX.cjs +0 -2
- package/dist/chunks/group-QSnlx4jX.cjs.map +0 -1
- package/dist/chunks/limit-BX6-o1a2.cjs +0 -2
- package/dist/chunks/limit-BX6-o1a2.cjs.map +0 -1
- package/dist/chunks/limit-ChteDN4T.js +0 -18
- package/dist/chunks/limit-ChteDN4T.js.map +0 -1
- package/dist/chunks/movableHost-CajG9_5Z.cjs +0 -2
- package/dist/chunks/movableHost-CajG9_5Z.cjs.map +0 -1
- package/dist/chunks/movableHost-NJj_FsAu.js +0 -23
- package/dist/chunks/movableHost-NJj_FsAu.js.map +0 -1
- package/dist/chunks/portalScope-AzzPM54i.js +0 -105
- package/dist/chunks/portalScope-AzzPM54i.js.map +0 -1
- package/dist/chunks/portalScope-BVA1-Ypu.cjs +0 -2
- package/dist/chunks/portalScope-BVA1-Ypu.cjs.map +0 -1
- package/dist/chunks/useLimit-BOmHKdJE.js.map +0 -1
- package/dist/chunks/useLimit-DXe_VmYl.cjs.map +0 -1
- package/dist/chunks/useModalDialog-Cgus9408.cjs +0 -2
- package/dist/chunks/useModalDialog-Cgus9408.cjs.map +0 -1
- package/dist/chunks/useModalDialog-Dh-_6A0j.js +0 -85
- package/dist/chunks/useModalDialog-Dh-_6A0j.js.map +0 -1
- package/dist/chunks/useTooltip-C5gvEoYk.js +0 -74
- package/dist/chunks/useTooltip-C5gvEoYk.js.map +0 -1
- package/dist/chunks/useTooltip-bTE_a2Xn.cjs +0 -2
- package/dist/chunks/useTooltip-bTE_a2Xn.cjs.map +0 -1
- package/dist/components/Drawer/index.cjs.map +0 -1
- package/dist/components/Drawer/index.js.map +0 -1
- package/dist/components/Field/limit-reading.d.cts.map +0 -1
- package/dist/components/Field/limit-reading.d.ts.map +0 -1
package/UPGRADING.md
CHANGED
|
@@ -2,6 +2,520 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.9.0
|
|
6
|
+
|
|
7
|
+
### Breaking changes
|
|
8
|
+
|
|
9
|
+
- EntryPicker results refused by an item's `isDisabled` or by a full selection
|
|
10
|
+
now render a focusable checkbox marked `aria-disabled="true"`. In 0.8.0 it
|
|
11
|
+
was natively `disabled`. Clicks and Space still change nothing and reach no
|
|
12
|
+
click or change handler. Their rows keep `data-blocked="true"`. Tests that
|
|
13
|
+
assert these checkboxes with `toBeDisabled()` must assert
|
|
14
|
+
`toHaveAttribute("aria-disabled", "true")` instead. Checkboxes stay natively
|
|
15
|
+
disabled while the whole picker is disabled or a new search loads.
|
|
16
|
+
- EditLayout no longer declares `--edit-sticky-top` on `.ds-edit-layout`; each
|
|
17
|
+
use reads `var(--edit-sticky-top, var(--topnav-height))`. Overrides keep
|
|
18
|
+
working, and now also work from an ancestor or on the bar or rail alone.
|
|
19
|
+
Consumer CSS inside the layout that read `var(--edit-sticky-top)` without
|
|
20
|
+
setting it must add the `var(--topnav-height)` fallback.
|
|
21
|
+
- A picker that holds one item (single mode, `max={1}`, or a FormEditor single
|
|
22
|
+
`asset`/`reference` field in either runtime mode) now shows a neutral
|
|
23
|
+
one-item reading, `0/1` or `1/1` with a ring, beside its label in place of the
|
|
24
|
+
count badge. In 0.8.0 single pickers showed only the badge, and a multiple
|
|
25
|
+
picker capped at one turned danger at `1/1`. Its group's accessible
|
|
26
|
+
description now ends with `0 of 1 used` or `1 of 1 used`, after any hint or
|
|
27
|
+
error, and its legend no longer contains the count. Update exact
|
|
28
|
+
description, legend-text and `.ds-field__count` assertions for these pickers.
|
|
29
|
+
|
|
30
|
+
### Picker states and scrolling
|
|
31
|
+
|
|
32
|
+
EntryItem adds optional `tone: "draft" | "removed"`, `removedLabel`, and
|
|
33
|
+
`disabledReason: { label, description }`. Tones style selected rows only:
|
|
34
|
+
draft rows keep their full presentation with a warning border, and removed rows
|
|
35
|
+
show their title and metadata (or monospace ID) with a Removed on save tag. They
|
|
36
|
+
keep removal and ordering, but have no thumbnail or pencil. Dialog results
|
|
37
|
+
ignore tone and render in full, pencil included. A `disabledReason` renders
|
|
38
|
+
only when `isDisabled` is set, on its own line below the item's metadata in
|
|
39
|
+
results and in already selected rows. In selected rows it also describes the
|
|
40
|
+
row's Move and Remove controls; compact removed rows omit it. Supply it once
|
|
41
|
+
through `disabledReason` and keep the metadata for the record's own details.
|
|
42
|
+
Applications confirm missing records and own save-time cleanup. Loading
|
|
43
|
+
failures must not be called removed.
|
|
44
|
+
|
|
45
|
+
Refused results are described for assistive technology: by the item's
|
|
46
|
+
`disabledReason`, or, when the selection is full, by a note saying so. Load
|
|
47
|
+
more moves focus to the first new row even when it is refused. A non-finite
|
|
48
|
+
`max` (`Infinity`, `NaN`) means no limit, and the dialog description says so.
|
|
49
|
+
In FormEditor, a non-finite runtime-source `max` leaves the schema's
|
|
50
|
+
`picker.max` in place instead of lifting it.
|
|
51
|
+
|
|
52
|
+
A Modal or Drawer hidden by `isHidden`, or suspended by an ancestor overlay,
|
|
53
|
+
now stays laid out but invisible (`visibility: hidden` on its fixed scrim),
|
|
54
|
+
inert and hidden from assistive technology. In 0.8.0 it was `display: none`,
|
|
55
|
+
which reset every scroll area inside. Scroll positions, horizontal included,
|
|
56
|
+
and layout measurements now survive suspension with no bookkeeping. The
|
|
57
|
+
picker's results keep their position this way. Opening and each new search
|
|
58
|
+
start at the top, other renders never write to the scroll pane, and scrolling
|
|
59
|
+
rerenders only when the pane reaches or leaves the top. The scroll pane uses symmetric logical
|
|
60
|
+
inline padding. The search row and refresh banner reserve the same scrollbar
|
|
61
|
+
gutter, so they line up with the rows in RTL and with classic or overlay
|
|
62
|
+
scrollbars.
|
|
63
|
+
|
|
64
|
+
Picker fields keep their unframed layout. Selected items keep their own
|
|
65
|
+
borders, fills, padding and draft/removed styling, in single and sortable modes.
|
|
66
|
+
The surrounding Field and list add no surface or padding. Search and scroll
|
|
67
|
+
padding belong to the dialog. The capped footer LimitReading stays.
|
|
68
|
+
|
|
69
|
+
### Focusable disabled choices
|
|
70
|
+
|
|
71
|
+
Checkbox and Radio accept `isFocusableWhenDisabled`. With `disabled`, the
|
|
72
|
+
control is marked `aria-disabled` instead of native `disabled`, keeps the
|
|
73
|
+
disabled look and stays focusable. As with native `disabled`, presses change
|
|
74
|
+
nothing (checked and indeterminate states included) and run no click or change
|
|
75
|
+
handler, its own or an ancestor's, and the control is left out of form
|
|
76
|
+
submission and validation: it renders without `name` and `required`, so a
|
|
77
|
+
radio also leaves its group's arrow-key order. Setting `aria-disabled`
|
|
78
|
+
directly only sets the attribute, as in 0.8.0. Native `disabled` is unchanged.
|
|
79
|
+
|
|
80
|
+
### Smaller fixes
|
|
81
|
+
|
|
82
|
+
- LimitReading accepts `tone: "usage" | "neutral"` (type `LimitReadingTone`),
|
|
83
|
+
and a Field `limit` accepts the same `tone`. `neutral` is for a slot to fill:
|
|
84
|
+
muted text, a success-coloured ring, no warning or danger tone, and no Field
|
|
85
|
+
announcements. One-item pickers use it; the existing `limitDisplay`,
|
|
86
|
+
`limitVisibility` and `showLimitRing` options still apply.
|
|
87
|
+
- SortableListItem accepts `handleDescribedBy`, element IDs that describe its
|
|
88
|
+
handle after the drag instructions.
|
|
89
|
+
- SubNavItem and SubNavButton counts now use a small, soft count Badge instead
|
|
90
|
+
of custom count styling. The Badge keeps the `.ds-subnav__count` class, so
|
|
91
|
+
selectors still match; the class no longer carries styles of its own. Zero
|
|
92
|
+
and numbers above 99 still render in full.
|
|
93
|
+
- Standalone FieldGroup-based controls (ChoiceGroup, SelectionCardGroup,
|
|
94
|
+
EntryPicker) now render `labelHint`, which they previously dropped.
|
|
95
|
+
- A new `--badge-sm-pad-block` token (1px) drives small Badge padding, with a
|
|
96
|
+
1px fallback for token sheets that lack it. Picker metadata lines take their
|
|
97
|
+
minimum height from it, and plain-text metadata keeps its normal line height.
|
|
98
|
+
- EditLayout reads `--edit-viewport-height` (default `100dvh`) and
|
|
99
|
+
`--edit-sticky-top` from itself or any ancestor, so an embedding drawer can
|
|
100
|
+
set both on its scroll host.
|
|
101
|
+
- Layout effects in every component use an isomorphic helper, so server
|
|
102
|
+
rendering under React 18 no longer warns that `useLayoutEffect` does nothing.
|
|
103
|
+
|
|
104
|
+
Adoption:
|
|
105
|
+
|
|
106
|
+
- One-item pickers need no schema or prop changes. Remove any custom one-item
|
|
107
|
+
usage indicator, and update assertions as listed under Breaking changes.
|
|
108
|
+
- SubNav count props need no changes. Review overrides of the former
|
|
109
|
+
`.ds-subnav__count` styling, which now apply on top of Badge; prefer shared
|
|
110
|
+
Badge tokens.
|
|
111
|
+
- Remove a restricted item's reason from its `metadata` where it duplicated
|
|
112
|
+
`disabledReason`; selected rows now show the reason themselves.
|
|
113
|
+
- Update tests for refused picker results and EditLayout CSS as listed under
|
|
114
|
+
Breaking changes.
|
|
115
|
+
- Compose CMS metadata from small Badge and Time. Supply tones, removed labels
|
|
116
|
+
and disabled reasons from authorized application data, setting `isDisabled`
|
|
117
|
+
with each reason, and remove equivalent consumer CSS.
|
|
118
|
+
- Replace hand-rolled `aria-disabled` checkbox guards with
|
|
119
|
+
`isFocusableWhenDisabled`.
|
|
120
|
+
- Remove any workaround that showed a standalone group's `labelHint` itself,
|
|
121
|
+
and any consumer code that restored dialog scroll after suspension.
|
|
122
|
+
- For embedded editors, set `--edit-viewport-height` and `--edit-sticky-top` on
|
|
123
|
+
the scroll host, on EditLayout, or on the bar or rail alone.
|
|
124
|
+
|
|
125
|
+
Compatibility: no dependency or stored-value changes. Native `disabled` choices
|
|
126
|
+
and picker checkboxes during loading or a disabled picker behave as before.
|
|
127
|
+
Suspended dialogs keep their `hidden` attribute and are inert, but are no longer
|
|
128
|
+
`display: none`. Content inside keeps its size, so resize observers no longer
|
|
129
|
+
see it collapse. `checkVisibility()` without options reports it visible. Code
|
|
130
|
+
that detected suspension through layout should read the `hidden` or `inert`
|
|
131
|
+
state instead.
|
|
132
|
+
|
|
133
|
+
Verification: run the consuming project's lint, typecheck, tests and build
|
|
134
|
+
against a packed build. Check one-item picker readings and rings on empty,
|
|
135
|
+
selected and cleared fields, standalone and in FormEditor, including runtime
|
|
136
|
+
checkbox mode and existing limit presentation options: `1/1` stays muted, with
|
|
137
|
+
no count badge and no live announcement. Check that an already selected
|
|
138
|
+
restricted item shows its reason once, and that its Move and Remove controls are
|
|
139
|
+
described by it. Review SubNav counts in active, inactive and disabled items
|
|
140
|
+
across themes, including zero and counts above 99. Review keyboard Tab and
|
|
141
|
+
screen reader output on refused results (restricted and full), focus after Load
|
|
142
|
+
more at the cap, missing and draft selections, narrow, dark and RTL layouts,
|
|
143
|
+
scrolling during refresh, selection and paging, and scroll positions (vertical
|
|
144
|
+
and horizontal) after a nested editor suspends a picker, Modal or Drawer.
|
|
145
|
+
Server-render a form under React 18 and confirm no layout-effect warnings.
|
|
146
|
+
|
|
147
|
+
## 0.8.0
|
|
148
|
+
|
|
149
|
+
### Attached number steppers and collection view buttons
|
|
150
|
+
|
|
151
|
+
NumberField places its − / + actions in one attached ButtonGroup after the
|
|
152
|
+
input, at the inline end (right in LTR). NumberRangeField and FormEditor number
|
|
153
|
+
fields inherit this layout. All field sizes keep matching button heights.
|
|
154
|
+
CollectionView's grid/table switch also uses attached ButtonGroup segments.
|
|
155
|
+
|
|
156
|
+
Adoption: no prop or stored-value changes are required. Update custom styles or
|
|
157
|
+
tests that assumed number buttons were direct children of `.ds-number` or that
|
|
158
|
+
Decrease preceded the input; `.ds-number__step` remains on each button, inside
|
|
159
|
+
the new `.ds-number__steppers` group. Review collection toolbar snapshots for
|
|
160
|
+
the joined view-switch borders.
|
|
161
|
+
|
|
162
|
+
Compatibility: stepper labels, min/max/step behaviour, disabled states, tab order
|
|
163
|
+
and focus preservation are unchanged. View-switch names, `aria-pressed` and
|
|
164
|
+
callbacks retain their contracts. `hasSteppers={false}` still omits the actions.
|
|
165
|
+
No dependencies or manual version increments are required.
|
|
166
|
+
|
|
167
|
+
Verification: run consuming lint/typechecks/tests/build and check all number
|
|
168
|
+
sizes, affixes, ranges, boundaries, typing-only fields, ArrowUp/ArrowDown and
|
|
169
|
+
pointer focus. Review attached view-switch selection/focus borders, narrow
|
|
170
|
+
toolbars and RTL layouts.
|
|
171
|
+
|
|
172
|
+
### Generated Fallow reports stay local
|
|
173
|
+
|
|
174
|
+
Generated `reports/fallow-report.*` files are ignored and no longer tracked.
|
|
175
|
+
`npm run fallow:report` still writes local Markdown/JSON outputs; the original
|
|
176
|
+
`reports/fallow-baseline.json` remains tracked because the generator reads it.
|
|
177
|
+
|
|
178
|
+
Adoption: contributors can regenerate reports without adding them to commits.
|
|
179
|
+
Consuming projects need no changes; public APIs, checks and package versions
|
|
180
|
+
are unchanged.
|
|
181
|
+
|
|
182
|
+
Verification: run `npm run fallow:report`, then confirm `git check-ignore` matches
|
|
183
|
+
the generated outputs and `git ls-files reports` still includes the baseline.
|
|
184
|
+
|
|
185
|
+
### Standalone LimitReading and larger picker footer counts
|
|
186
|
+
|
|
187
|
+
Adds `LimitReading` and its `LimitReadingProps`, `LimitReadingSize` and
|
|
188
|
+
`LimitReadingDisplay` types at the root and `components/LimitReading` subpath.
|
|
189
|
+
Pass `count` and `max`. Sizes are `sm` (default: existing 12px text/16px ring),
|
|
190
|
+
`md` (14px/20px) and `lg` (16px/24px). `limitDisplay` defaults to `used` and
|
|
191
|
+
`showLimitRing` to true. `descriptionId` identifies the hidden descriptive text
|
|
192
|
+
for an owning control; regular span attributes and refs apply to the outer span.
|
|
193
|
+
Invalid limits render nothing. Loaded over-limit values and negative remaining
|
|
194
|
+
counts remain visible; the ring clamps at full without a closing seam.
|
|
195
|
+
|
|
196
|
+
Field composes the small reading while retaining reporting, visibility and its
|
|
197
|
+
threshold-only announcer. EntryPicker's live footer uses a large reading for
|
|
198
|
+
multiple mode with a finite positive maximum. Uncapped and single-mode footers
|
|
199
|
+
keep their selected-count text. Picker labels and FormEditor values/schema
|
|
200
|
+
options keep their existing contracts.
|
|
201
|
+
|
|
202
|
+
Plain footer counts such as `0 selected` use the same 16px text and muted colour
|
|
203
|
+
as the large reading's normal state, keeping capped and uncapped pickers aligned.
|
|
204
|
+
|
|
205
|
+
Adoption: use `<LimitReading count={4} max={5} size="lg" />` wherever a standalone
|
|
206
|
+
reading is needed. Its owner supplies enforcement, visibility and live-region
|
|
207
|
+
semantics. Import the aggregate stylesheet as usual. Update affected CSS hooks
|
|
208
|
+
and picker text queries listed under Breaking changes.
|
|
209
|
+
|
|
210
|
+
Compatibility: this adds no dependency or manual version change. Existing Field
|
|
211
|
+
readings keep the current small metrics, colours, descriptions and announcements.
|
|
212
|
+
The picker footer uses its own default `used`/ring presentation; Field options
|
|
213
|
+
continue to configure the small label reading.
|
|
214
|
+
|
|
215
|
+
Verification: run consuming lint/typechecks/tests/build against a packed or
|
|
216
|
+
released build. Check all sizes and themes, empty/near/full/over-limit readings,
|
|
217
|
+
remaining text, hidden rings, Field descriptions/threshold announcements, and
|
|
218
|
+
capped picker selection/deselection, uncapped and single-mode footers at narrow
|
|
219
|
+
widths. Confirm plain and capped footer counts have matching text size and colour
|
|
220
|
+
below the warning threshold. Confirm root and subpath imports and aggregate CSS
|
|
221
|
+
include LimitReading.
|
|
222
|
+
|
|
223
|
+
### Inactive drawer activation
|
|
224
|
+
|
|
225
|
+
Drawer adds optional `onInactivePress?: () => void` and `inactivePressLabel?: string`.
|
|
226
|
+
An open, visible drawer with `isActive={false}` and a callback presents a shared
|
|
227
|
+
Button over its panel, outside the inert editor contents. Pressing it requests
|
|
228
|
+
activation once; the application owns navigation, discard confirmation and pending
|
|
229
|
+
write guards. It neither calls onClose nor activates the panel itself. Pointer
|
|
230
|
+
presses preserve the active editor's focus until the app accepts navigation.
|
|
231
|
+
|
|
232
|
+
The action defaults to `Return to {title}` for a string title or `Activate drawer`
|
|
233
|
+
for other title nodes. Supply an explicit localized label as needed. It is not an
|
|
234
|
+
extra Tab stop: the active modal retains its focus trap and keyboard navigation.
|
|
235
|
+
Closed, hidden and exiting panels expose no activation action. Omitting the
|
|
236
|
+
callback preserves the existing fully inert inactive panel and scrim.
|
|
237
|
+
|
|
238
|
+
Adoption: replace application geometry/hit-testing with the callback. In a stack,
|
|
239
|
+
use `hasScrim={false}` on the panels with an application-owned shared scrim so
|
|
240
|
+
the top drawer does not intercept presses on exposed panels below it. Drawer
|
|
241
|
+
content now has a stable `.ds-drawer__content` flex wrapper around its header,
|
|
242
|
+
body and footer, preserving mounted state when activity changes. Update custom
|
|
243
|
+
selectors that assumed those elements were direct children of the panel.
|
|
244
|
+
No dependencies or manual version increments are required.
|
|
245
|
+
|
|
246
|
+
Verification: press exposed background panels with mouse and touch; confirm only
|
|
247
|
+
the callback fires, editor controls remain inert, focus stays in the active editor
|
|
248
|
+
when navigation is refused, and hidden/closing panels cannot activate. Check all
|
|
249
|
+
sides, RTL, contained navigation, nested popups and normal active scrolling/layout.
|
|
250
|
+
|
|
251
|
+
### Picker creation and live refresh
|
|
252
|
+
|
|
253
|
+
`EntryPickerSource` adds optional `refreshKey?: string | number` and
|
|
254
|
+
`isCreating?: boolean`, also accepted through FormEditor's `pickerSources`.
|
|
255
|
+
Change `refreshKey` after an external edit; keep it stable during unrelated
|
|
256
|
+
renders. Inline callbacks remain supported.
|
|
257
|
+
|
|
258
|
+
- An open picker reads its loaded rows again in the background, requesting the
|
|
259
|
+
full pages together and reading on one page at a time after a short page. The
|
|
260
|
+
rows, query, scroll and focus stay, and the rows remain usable meanwhile. A
|
|
261
|
+
Load more in flight joins the refreshed rows. A new search after a refresh
|
|
262
|
+
loads one page.
|
|
263
|
+
- A failed refresh keeps the rows and shows a "Couldn't refresh {itemsLabel}"
|
|
264
|
+
banner whose Try again reads the same rows again. Until a refresh succeeds,
|
|
265
|
+
Load more stays disabled but focusable, so no page is read at an old offset.
|
|
266
|
+
A failed Load more is hidden while a refresh re-reads its rows. If its Try
|
|
267
|
+
again had focus, focus moves to Load more.
|
|
268
|
+
- Selected rows keep their previous copy, title and pencil while `resolveItem`
|
|
269
|
+
describes them again. Without `resolveItem`, the copies stay until a loaded
|
|
270
|
+
page replaces them. A row picked from rows read before the latest refresh
|
|
271
|
+
keeps its copy in the same way and is described again. A failed lookup keeps
|
|
272
|
+
the copy and shows the existing retry banner. Only a null resolution means
|
|
273
|
+
gone, and it takes precedence over an older page copy.
|
|
274
|
+
|
|
275
|
+
`isCreating` shows the New action's spinner and blocks repeated creation. New
|
|
276
|
+
stays focusable while blocked, so focus survives creation that ends at the
|
|
277
|
+
selection cap. New is now primary, alongside the primary Done. This is the one
|
|
278
|
+
recorded exception to Button's "one primary per view" rule. Below 480px the
|
|
279
|
+
search takes a full row above New. Applications still own creation, uploads,
|
|
280
|
+
eligibility, persistence and item metadata.
|
|
281
|
+
|
|
282
|
+
Obsolete paging replies no longer update selected-item caches. Removing and
|
|
283
|
+
restoring an ID during its pending lookup starts a fresh lookup. Rows from a
|
|
284
|
+
previous search are disabled for keyboard as well as pointer interaction while
|
|
285
|
+
the new search loads. Load more never stays pending after a search is undone or
|
|
286
|
+
replaced.
|
|
287
|
+
|
|
288
|
+
Dialog portal hosts follow opening order, so same-commit paint order agrees with
|
|
289
|
+
focus and Escape. Modal and Drawer frames now sit in a `div.ds-dialog-host`
|
|
290
|
+
portal host with `display: contents`; custom selectors that require the scrim
|
|
291
|
+
to be a direct child of `body` (or a contained drawer's container) must allow
|
|
292
|
+
that wrapper. A host moves only when its order is wrong, keeping focus, so a
|
|
293
|
+
drawer reopened during its exit keeps its scroll and focus. Hosts stay attached
|
|
294
|
+
under React Strict Mode. Frame classes, explicit layers and contained navigation
|
|
295
|
+
layers are unchanged; explicit overlay layer overrides should place children
|
|
296
|
+
above parents and below toasts.
|
|
297
|
+
|
|
298
|
+
Modal and Drawer return focus to the control focused last in the current
|
|
299
|
+
opening in two cases: when the dialog resumes from `isHidden`, and when a
|
|
300
|
+
drawer becomes active again. Before, focus went to `initialFocus` or the first
|
|
301
|
+
control. The control is scrolled into view within the panel's own scroll
|
|
302
|
+
areas, and the page does not scroll. If that control was removed or can no
|
|
303
|
+
longer take focus, focus goes to `initialFocus`, then the first control. A new
|
|
304
|
+
opening still starts from its initial focus.
|
|
305
|
+
|
|
306
|
+
Adoption: pass a stable `refreshKey` that changes after external data changes,
|
|
307
|
+
and `isCreating` while creation is pending. Update any selector that expects a
|
|
308
|
+
dialog scrim directly under `body`. Don't refocus a control after resuming or
|
|
309
|
+
reactivating a dialog; the dialog does that itself. No stored schema/value
|
|
310
|
+
change, dependency or manual version increment is required.
|
|
311
|
+
|
|
312
|
+
Compatibility: `isHidden`, `isActive` and `onCreate` are new in this release,
|
|
313
|
+
so no released behaviour changes. `initialFocus` now applies only when a dialog
|
|
314
|
+
opens, or when its last control can no longer take focus. For example, a
|
|
315
|
+
navigation drawer whose `initialFocus` is Close returns to the control that was
|
|
316
|
+
used last, both after resuming and after its stack makes it active again. To
|
|
317
|
+
send focus somewhere else, focus that control explicitly after the change.
|
|
318
|
+
|
|
319
|
+
Verification: in the consuming project, cover these cases:
|
|
320
|
+
|
|
321
|
+
- A refresh with several loaded pages: rows stay usable, scroll and focus are
|
|
322
|
+
kept.
|
|
323
|
+
- A failed refresh and its retry. Load more stays disabled until the retry
|
|
324
|
+
succeeds.
|
|
325
|
+
- A failed Load more with focus on Try again when a refresh starts. Focus
|
|
326
|
+
should move to Load more.
|
|
327
|
+
- A refresh while a selected item resolves: title and pencil stay.
|
|
328
|
+
- A row picked during a pending refresh. It keeps its title and pencil until
|
|
329
|
+
`resolveItem` answers, and shows as unavailable if that returns null.
|
|
330
|
+
- A loadPage-only picker's selected titles across a refresh.
|
|
331
|
+
- Remove/restore during resolution.
|
|
332
|
+
- Load more across an undone search.
|
|
333
|
+
- A pending New action that ends at the cap. New shows the primary colour.
|
|
334
|
+
- A long Modal or Drawer form resumed with a lower field focused. That field
|
|
335
|
+
should hold focus and be scrolled into view.
|
|
336
|
+
- Nested dialogs opened together, including under Strict Mode.
|
|
337
|
+
|
|
338
|
+
Run consuming checks against the packed build and restart Vite before browser
|
|
339
|
+
QA.
|
|
340
|
+
|
|
341
|
+
### Breaking changes
|
|
342
|
+
|
|
343
|
+
- Limit indicators move from `.ds-field__limit`, `.ds-field__limit-ring`,
|
|
344
|
+
`.ds-field__limit-progress` and `.ds-field__limit-description` to
|
|
345
|
+
`.ds-limit-reading`, `.ds-limit-reading__ring`, `.ds-limit-reading__progress`
|
|
346
|
+
and `.ds-limit-reading__description`. Update custom selectors. Field's private
|
|
347
|
+
`.ds-field__limit-announcement` remains its live-announcement hook.
|
|
348
|
+
- Capped multiple-picker footers now display `4/5` and a large progress ring
|
|
349
|
+
instead of `4 of 5 selected`. Their accessible reading is `4 of 5 used`.
|
|
350
|
+
Update consuming text queries; the footer's status region is retained.
|
|
351
|
+
- `EntryItem.subtitle` and `EntryItem.status` are replaced by
|
|
352
|
+
`metadata?: ReactNode`. Compose the entire line beneath the title in that
|
|
353
|
+
slot, including badges, type labels, separators and `Time` components.
|
|
354
|
+
- Static EntryPicker search now matches `title` and `keywords` only. Move any
|
|
355
|
+
searchable subtitle text into `keywords`; metadata nodes are never stringified.
|
|
356
|
+
- The `.ds-entry__subtitle` CSS hook is removed. Use `.ds-entry__meta` for the
|
|
357
|
+
shared metadata frame, or application classes for individual metadata pieces.
|
|
358
|
+
- The `--entry-list-max-height` token is removed. Picker results now scroll in a
|
|
359
|
+
dialog sized by `--entry-picker-height` (default 47.5rem, capped by the
|
|
360
|
+
viewport); set that on `.ds-entry-picker__dialog` instead.
|
|
361
|
+
|
|
362
|
+
### Composable picker metadata
|
|
363
|
+
|
|
364
|
+
The application owns all content beneath an EntryPicker item title through
|
|
365
|
+
`metadata`. The library supplies a wrapping inline flex row with muted small
|
|
366
|
+
text; it adds no badge, type name, separator or date formatting. This works in
|
|
367
|
+
results, selected rows, drag overlays, and FormEditor's `pickerItems` and
|
|
368
|
+
`pickerSources`. Links, controls and focusable metadata such as `Time` handle
|
|
369
|
+
their own clicks without toggling the row's checkbox.
|
|
370
|
+
|
|
371
|
+
Adoption: replace `{ subtitle, status }` with a `metadata` string or fragment.
|
|
372
|
+
Use `<Badge shape="status" size="sm" …>` for condensed state labels and
|
|
373
|
+
`<Time value={publishedAt} />` for dates. Supply the type/status text in `keywords`
|
|
374
|
+
when static choices should be searchable by those labels.
|
|
375
|
+
|
|
376
|
+
Compatibility: item IDs, selected values, paging and FormEditor link storage
|
|
377
|
+
are unchanged. `metadata` is runtime UI, not JSON data for persisted schemas.
|
|
378
|
+
No dependency or manual version change is needed.
|
|
379
|
+
|
|
380
|
+
Verification: typecheck every `EntryItem` producer, including resolved/missing
|
|
381
|
+
items and static default choices. Check composed metadata in results and
|
|
382
|
+
selections, narrow wrapping, `Time` tooltips by hover/focus, clicking metadata
|
|
383
|
+
controls without selection, and static searches by title/keywords. Run consuming
|
|
384
|
+
lint/typechecks/tests/build against the released or packed package.
|
|
385
|
+
|
|
386
|
+
### Badge sizes
|
|
387
|
+
|
|
388
|
+
Badge adds `size="sm" | "md" | "lg"` and exports `BadgeSize` from the package
|
|
389
|
+
root and Badge subpath. The default `md` retains the existing metrics and tokens.
|
|
390
|
+
Standard heights are 20px, 24px and 28px across status, tag and count shapes and
|
|
391
|
+
all appearances. Small badges tighten padding, marker size and spacing; large
|
|
392
|
+
badges also enlarge type. Borders, corners, tones and count formatting keep their
|
|
393
|
+
existing behavior.
|
|
394
|
+
|
|
395
|
+
Adoption: use `<Badge size="sm">…</Badge>` in dense rows, or `size="lg"` for a
|
|
396
|
+
larger label. No changes are required for existing badges.
|
|
397
|
+
|
|
398
|
+
Compatibility: this is an optional prop; existing markup gains `data-size="md"`
|
|
399
|
+
without changing its appearance. Existing badge tokens still govern `md`.
|
|
400
|
+
No dependency or manual version change.
|
|
401
|
+
|
|
402
|
+
Verification: run consuming lint/typechecks/tests/build, then review Badge's
|
|
403
|
+
Sizes story and badges in dense rows in each theme at desktop and narrow widths.
|
|
404
|
+
Confirm omitted size matches explicit `md`, small counts stay legible, and zero,
|
|
405
|
+
`99+` and `isCountExact` formatting are unchanged.
|
|
406
|
+
|
|
407
|
+
### Paged pickers and composable resource drawers
|
|
408
|
+
|
|
409
|
+
EntryPicker accepts optional `loadPage({ offset, limit }, { query })`, `pageSize`
|
|
410
|
+
(default 10), `resolveItem(id)`, `onEditItem(item)` and `onCreate()` callbacks.
|
|
411
|
+
Pages return `{ items, total }`; item resolution may return a value or Promise,
|
|
412
|
+
and null means unavailable. Requests are debounced by 250ms, stale replies are
|
|
413
|
+
ignored, and Load more preserves existing selections. Callbacks are read when
|
|
414
|
+
called, so inline sources are fine: each opening, search, page size change and
|
|
415
|
+
retry requests the first page, and closing discards the pages. Load failures
|
|
416
|
+
use the shared LoadError banner with Try again; a failed search clears the
|
|
417
|
+
previous rows. `EntryItem.metadata` is a ReactNode slot. Static `items` remain
|
|
418
|
+
supported. No network calls occur before opening except resolving selected IDs
|
|
419
|
+
that no static item describes.
|
|
420
|
+
|
|
421
|
+
Selected IDs show the latest copy of their item from static items, a loaded page
|
|
422
|
+
or a pick, so an edited item appears once a page includes it. `resolveItem`
|
|
423
|
+
resolves each undescribed ID once, and Try again re-resolves only the failed
|
|
424
|
+
ones. Removing an ID forgets it, so an ID an undo or form reset restores is
|
|
425
|
+
resolved afresh. Without `resolveItem`, an ID nothing describes shows as the ID
|
|
426
|
+
itself rather than as unavailable. Static search trims the query, as server
|
|
427
|
+
searches do.
|
|
428
|
+
|
|
429
|
+
When Load more held focus and the final page or a failure removes it, focus moves
|
|
430
|
+
to the first new row or to Try again; a reply from an earlier opening is ignored.
|
|
431
|
+
A new opening starts at the top of the list.
|
|
432
|
+
|
|
433
|
+
Result rows now expose shared checkboxes named `Select {title}`, rather than
|
|
434
|
+
full-row buttons. Update role queries in consuming tests. Single mode retains
|
|
435
|
+
its immediate-close behaviour. For a scalar FormEditor field with checkbox
|
|
436
|
+
interaction and explicit Done, set `pickerSources[fieldId]` to
|
|
437
|
+
`{ mode: "multiple", loadPage, resolveItem }`: the picker caps it at one and
|
|
438
|
+
asks to "Choose one {itemLabel}" without a usage counter, and the schema's
|
|
439
|
+
`multiple` flag still determines its object/array storage and validation. A
|
|
440
|
+
runtime `max` can lower the schema's `picker.max` but never lift it, and the
|
|
441
|
+
field's counter shows the lower cap; an undefined runtime option never replaces
|
|
442
|
+
a schema value. Field's `limit` accepts `null` to show no counter, even one a
|
|
443
|
+
bound control reports.
|
|
444
|
+
`pickerItems` continues to supply static choices. All source props are
|
|
445
|
+
optional. The library adds no default maximum to multiple fields.
|
|
446
|
+
|
|
447
|
+
`dialogTitle`, `dialogDescription` and `isDialogHidden` customize/suspend a picker
|
|
448
|
+
while retaining its query, loaded pages and scroll. Returning false from
|
|
449
|
+
`onEditItem` dismisses it, useful when jumping to its owning editor. Edit actions
|
|
450
|
+
do not select rows, and remain available when only the selection cap is reached.
|
|
451
|
+
`onCreate` adds a `New {itemLabel}` action, disabled at capacity.
|
|
452
|
+
|
|
453
|
+
LoadError accepts `title` and LoadState accepts `errorTitle` to name what failed
|
|
454
|
+
to load; both default to "Couldn't load this".
|
|
455
|
+
|
|
456
|
+
SearchField `isBusy` shows the shared spinner beside its clear action and sets
|
|
457
|
+
`aria-busy`. Escape clears a nonempty controlled query before closing a
|
|
458
|
+
surrounding dialog; an empty one leaves Escape to the dialog. Uncontrolled
|
|
459
|
+
fields still call `onClear` on every Escape. An Escape that ends an IME
|
|
460
|
+
composition belongs to the input method.
|
|
461
|
+
|
|
462
|
+
Drawer adds `hasHeader` (true), `isActive` (true), `hasScrim` (true) and
|
|
463
|
+
`overlayLayer`. An inactive open panel stays visible and mounted but is inert
|
|
464
|
+
and hidden from assistive technology: it takes no focus, pointer input or scrim
|
|
465
|
+
presses, its menus and pickers pause, and its tooltips close. Give people an external control to
|
|
466
|
+
return to it. A headerless navigation drawer focuses its first control.
|
|
467
|
+
`hasScrim: false` passes background pointer events through and keeps slide motion.
|
|
468
|
+
Set `--drawer-width`/`--drawer-width-wide` on a drawer to override its width.
|
|
469
|
+
|
|
470
|
+
Modal and Drawer also accept `isHidden` (false): suspend an open dialog without
|
|
471
|
+
unmounting its form or picker nodes. Focus/Escape and nested popover/menu
|
|
472
|
+
controllers pause while suspended and resume on return, in place rather than
|
|
473
|
+
replaying their entry motion; a menu that resumes keeps focus. Tooltips close
|
|
474
|
+
rather than pause. Prefer suspension over closing a Properties drawer
|
|
475
|
+
when opening a related editor.
|
|
476
|
+
|
|
477
|
+
Drawer and Modal pass their layer (an explicit `overlayLayer`, else an enclosing
|
|
478
|
+
`OverlayLayer`) to the dialogs and popovers opened inside them, so a nested
|
|
479
|
+
picker, Select, Menu, DateField or ColourField paints above a raised drawer.
|
|
480
|
+
Keep layers below 80 so toasts stay on top. Omitting layers keeps CSS defaults,
|
|
481
|
+
including contained navigation drawer layering. Focus and Escape go to the
|
|
482
|
+
dialog on the highest layer; on one layer, to the one opened last, which paints
|
|
483
|
+
last. A dialog that resumes keeps its place, so it never moves above a dialog
|
|
484
|
+
opened while it was suspended, and a dialog opened together with the dialogs
|
|
485
|
+
nested in it stays below them. Headerless dialogs retain
|
|
486
|
+
accessible names. The app owns stack state, a shared scrim, draft guards,
|
|
487
|
+
resource loading, permissions and persistence.
|
|
488
|
+
|
|
489
|
+
Table draws its header rule on the first body row after a `thead`, so the rule
|
|
490
|
+
spans every column, including a spanning empty state. Tables without a head get
|
|
491
|
+
no rule above their first row. Styles that targeted the header rule through
|
|
492
|
+
`.ds-table th` should target `.ds-table thead + tbody > tr:first-child` instead.
|
|
493
|
+
|
|
494
|
+
Compatibility: selected rows now read the theme's `--entry-thumb-size` (3rem by
|
|
495
|
+
default), as result rows already did, rather than a fixed 3rem; a theme that
|
|
496
|
+
overrides the token now sizes both. Selected result rows gain their intended
|
|
497
|
+
`--color-accent-soft` fill.
|
|
498
|
+
|
|
499
|
+
Adoption: pass runtime sources inline or memoized, as convenient. Pass busy
|
|
500
|
+
search feedback only for an active request. Coordinate inactive editor
|
|
501
|
+
shortcuts and protect all affected drafts before stack navigation. Keep
|
|
502
|
+
application schemas authoritative for limits and stored values. Choose overlay
|
|
503
|
+
layers below 80. Replace any `--entry-list-max-height` override with
|
|
504
|
+
`--entry-picker-height` on `.ds-entry-picker__dialog`. No new peers,
|
|
505
|
+
dependencies or manual version increment.
|
|
506
|
+
|
|
507
|
+
Verification: run `npm run validate`, then consuming lint/typechecks/tests/build
|
|
508
|
+
against a packed package. Check loading/search/paging retries (including a failed
|
|
509
|
+
search), off-page and missing selections, an edited selected item, a removed
|
|
510
|
+
and restored selection, capacity and the FormEditor counter, removal and
|
|
511
|
+
reordering, pencil isolation, creation, Escape in a picker search with and
|
|
512
|
+
without a query, keyboard focus through the final Load more and its failure,
|
|
513
|
+
reopening a scrolled picker, popovers inside raised drawers, inactive background
|
|
514
|
+
panels, nested dialogs, suspension and resume (with an open menu or tooltip, and
|
|
515
|
+
with a dialog opened meanwhile), header-less tables, and reduced motion in every
|
|
516
|
+
theme at desktop and narrow widths. Search consuming stylesheets for
|
|
517
|
+
`--entry-list-max-height`.
|
|
518
|
+
|
|
5
519
|
## 0.7.0
|
|
6
520
|
|
|
7
521
|
### Breaking changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Button as e } from "../components/Button/index.js";
|
|
2
2
|
import { t } from "./mergeRefs-C6_5pADN.js";
|
|
3
3
|
import { i as n } from "./colour-CYEF4Q_n.js";
|
|
4
|
-
import { t as r } from "./useTooltip-
|
|
4
|
+
import { t as r } from "./useTooltip-BrC7FdeH.js";
|
|
5
5
|
import { forwardRef as i, useMemo as a } from "react";
|
|
6
6
|
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
7
|
import { extend as l } from "colord";
|
|
@@ -146,4 +146,4 @@ var b = i(function({ people: e, size: t = 24, className: n, ...r }, i) {
|
|
|
146
146
|
//#endregion
|
|
147
147
|
export { b as n, v as t };
|
|
148
148
|
|
|
149
|
-
//# sourceMappingURL=Avatar-
|
|
149
|
+
//# sourceMappingURL=Avatar-BK8IdL5W.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar-DdFEOumt.js","names":["_Fragment","parseColour","useTooltip","Fragment$1","a11yPlugin","extend","avatarColours","background","value","buttonSizes","initialsOf","words","name","splitAria","aria","other","key","props","defaultTabIndex","isActionable","isHidden","hasTooltip","AvatarContent","src","AvatarControl","href","semantics","hasCallback","Button","size","Avatar","forwardRef","label","describedBy","hidden","onClick","tooltip","spanRef","useMemo","mergeRefs","anchorRef","ref","colours","colour","description","tabIndex","className","style","triggerProps","panel","OverflowCount","names","count","AvatarGroup","rest","people","p","index","person"],"sources":["../../src/components/Avatar/colour.ts","../../src/components/Avatar/index.tsx"],"sourcesContent":["import { extend } from \"colord\";\nimport a11yPlugin from \"colord/plugins/a11y\";\nimport { parseColour } from \"../ColourField/colour\";\n\nextend([a11yPlugin]);\n\n/** Opaque colours only: transparency would make contrast depend on the surface below. */\nexport function avatarColours(value?: string) {\n // Share ColourField's parser so both components accept and classify colours identically.\n const background = value ? parseColour(value) : null;\n if (!background || background.alpha() !== 1) {\n return undefined;\n }\n return {\n \"--avatar-background\": background.toHex(),\n \"--avatar-foreground\":\n background.contrast(\"#000\") >= background.contrast(\"#fff\") ? \"#000000\" : \"#ffffff\",\n };\n}\n","import {\n forwardRef,\n useMemo,\n type AnchorHTMLAttributes,\n type AriaAttributes,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { mergeRefs } from \"../../internal/mergeRefs\";\nimport { Button, type ButtonSize } from \"../Button\";\nimport { useTooltip } from \"../Popover/useTooltip\";\nimport { avatarColours } from \"./colour\";\nimport \"./style.css\";\n\nexport type AvatarSize = 24 | 32 | 40;\n\n/** Each avatar size is one of Button's square sizes, so callback avatars use Button unchanged. */\nconst buttonSizes: Record<AvatarSize, ButtonSize> = { 24: \"xs\", 32: \"sm\", 40: \"md\" };\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 /** Solid hex, RGB, HSL or named background; initials automatically use contrasting black/white. */\n colour?: string;\n /** Defaults to name; false disables the hover/focus tooltip. */\n tooltip?: string | false;\n href?: string;\n target?: AnchorHTMLAttributes<HTMLAnchorElement>[\"target\"];\n rel?: string;\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/** Separate ARIA attributes so they can follow the element that carries the role. */\nfunction splitAria<T extends object>(props: T) {\n const aria: Record<string, unknown> = {};\n const other: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(props)) {\n (key.startsWith(\"aria-\") ? aria : other)[key] = value;\n }\n return { aria: aria as AriaAttributes, other: other as Omit<T, keyof AriaAttributes> };\n}\n\n/**\n * Links and Buttons are natively focusable, and hidden ones leave the tab order.\n * A passive avatar is focusable only for a visible tooltip.\n */\nfunction defaultTabIndex(isActionable: boolean, isHidden: boolean, hasTooltip: boolean) {\n if (isActionable) {\n return isHidden ? -1 : undefined;\n }\n return !isHidden && hasTooltip ? 0 : undefined;\n}\n\nfunction AvatarContent({ name, src }: Pick<AvatarProps, \"name\" | \"src\">) {\n return (\n <span className=\"ds-avatar__content\">\n {src ? (\n <img\n src={src}\n alt=\"\"\n />\n ) : (\n initialsOf(name)\n )}\n </span>\n );\n}\n\ninterface AvatarControlProps extends Pick<AvatarProps, \"href\" | \"target\" | \"rel\"> {\n hasCallback: boolean;\n size: AvatarSize;\n /** Naming, description, id, ARIA state and tab order for the control. */\n semantics: HTMLAttributes<HTMLElement>;\n children: ReactNode;\n}\n\n/** The inner link or shared Button of an actionable avatar; passive content otherwise. */\nfunction AvatarControl({\n href,\n target,\n rel,\n hasCallback,\n size,\n semantics,\n children,\n}: AvatarControlProps) {\n if (href) {\n return (\n <a\n className=\"ds-avatar__control\"\n href={href}\n target={target}\n rel={rel}\n {...semantics}\n >\n {children}\n </a>\n );\n }\n if (hasCallback) {\n return (\n <Button\n variant=\"simple\"\n size={buttonSizes[size]}\n isIconOnly\n className=\"ds-avatar__control\"\n {...semantics}\n >\n {children}\n </Button>\n );\n }\n return <>{children}</>;\n}\n\n/**\n * A circular person identifier, optionally linked or actionable. The ref stays on\n * the outer span; `id` and ARIA attributes go to the image span, or to the inner\n * link or Button when the avatar is actionable.\n */\nexport const Avatar = forwardRef<HTMLSpanElement, AvatarProps>(function Avatar(\n {\n name,\n src,\n colour,\n style,\n size = 24,\n tooltip = name,\n href,\n target,\n rel,\n className,\n onClick,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n id,\n tabIndex,\n \"aria-label\": label = name,\n \"aria-describedby\": describedBy,\n \"aria-hidden\": hidden,\n ...props\n },\n ref,\n) {\n const isHidden = hidden === true || hidden === \"true\";\n const isActionable = !!href || !!onClick;\n const { anchorRef, description, triggerProps, panel } = useTooltip<HTMLSpanElement>(\n isHidden ? false : tooltip,\n { placement: \"top\", className: \"ds-avatar-tooltip\" },\n );\n // Stable across renders, so tooltip state changes never detach a caller's callback ref.\n const spanRef = useMemo(() => mergeRefs(anchorRef, ref), [anchorRef, ref]);\n const colours = useMemo(() => avatarColours(colour), [colour]);\n const { aria, other } = splitAria(props);\n const semantics = {\n ...aria,\n id,\n \"aria-label\": label,\n \"aria-describedby\": [describedBy, description].filter(Boolean).join(\" \") || undefined,\n tabIndex: tabIndex ?? defaultTabIndex(isActionable, isHidden, !!tooltip),\n };\n return (\n <>\n <span\n ref={spanRef}\n role={isActionable ? undefined : \"img\"}\n aria-hidden={hidden}\n {...(isActionable ? {} : semantics)}\n data-size={size}\n className={[\"ds-avatar\", className].filter(Boolean).join(\" \")}\n {...other}\n style={{ ...style, ...colours }}\n onClick={onClick}\n {...triggerProps({ onMouseEnter, onMouseLeave, onFocus, onBlur })}\n >\n <AvatarControl\n href={href}\n target={target}\n rel={rel}\n hasCallback={!!onClick}\n size={size}\n semantics={semantics}\n >\n <AvatarContent\n name={name}\n src={src}\n />\n </AvatarControl>\n </span>\n {panel}\n </>\n );\n});\n\ntype AvatarPerson = Pick<\n AvatarProps,\n \"name\" | \"src\" | \"colour\" | \"tooltip\" | \"href\" | \"target\" | \"rel\" | \"onClick\"\n>;\n\nexport interface AvatarGroupProps extends HTMLAttributes<HTMLSpanElement> {\n /** Up to three render; the rest become a +n count with a hidden-name tooltip. */\n people: AvatarPerson[];\n size?: AvatarSize;\n}\n\nfunction OverflowCount({ names }: { names: string[] }) {\n const { anchorRef, description, triggerProps, panel } = useTooltip<HTMLSpanElement>(\n names.join(\", \"),\n { placement: \"top\", className: \"ds-avatar-tooltip\" },\n );\n const count = names.length;\n return (\n <>\n <span\n ref={anchorRef}\n role=\"img\"\n className=\"ds-avatar-group__count\"\n tabIndex={0}\n aria-label={`${count} more ${count === 1 ? \"person\" : \"people\"}`}\n aria-describedby={description}\n {...triggerProps()}\n >\n +{count}\n </span>\n {panel}\n </>\n );\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 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 {/* Only documented person fields reach Avatar; extra application data stays off the DOM. */}\n {people\n .slice(0, 3)\n .map(({ name, src, colour, tooltip, href, target, rel, onClick }, index) => (\n <Avatar\n key={`${name}-${index}`}\n name={name}\n src={src}\n colour={colour}\n tooltip={tooltip}\n href={href}\n target={target}\n rel={rel}\n onClick={onClick}\n size={size}\n />\n ))}\n {people.length > 3 && <OverflowCount names={people.slice(3).map((person) => person.name)} />}\n </span>\n );\n});\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"Avatar-BK8IdL5W.js","names":["_Fragment","parseColour","useTooltip","Fragment$1","a11yPlugin","extend","avatarColours","background","value","buttonSizes","initialsOf","words","name","splitAria","aria","other","key","props","defaultTabIndex","isActionable","isHidden","hasTooltip","AvatarContent","src","AvatarControl","href","semantics","hasCallback","Button","size","Avatar","forwardRef","label","describedBy","hidden","onClick","tooltip","spanRef","useMemo","mergeRefs","anchorRef","ref","colours","colour","description","tabIndex","className","style","triggerProps","panel","OverflowCount","names","count","AvatarGroup","rest","people","p","index","person"],"sources":["../../src/components/Avatar/colour.ts","../../src/components/Avatar/index.tsx"],"sourcesContent":["import { extend } from \"colord\";\nimport a11yPlugin from \"colord/plugins/a11y\";\nimport { parseColour } from \"../ColourField/colour\";\n\nextend([a11yPlugin]);\n\n/** Opaque colours only: transparency would make contrast depend on the surface below. */\nexport function avatarColours(value?: string) {\n // Share ColourField's parser so both components accept and classify colours identically.\n const background = value ? parseColour(value) : null;\n if (!background || background.alpha() !== 1) {\n return undefined;\n }\n return {\n \"--avatar-background\": background.toHex(),\n \"--avatar-foreground\":\n background.contrast(\"#000\") >= background.contrast(\"#fff\") ? \"#000000\" : \"#ffffff\",\n };\n}\n","import {\n forwardRef,\n useMemo,\n type AnchorHTMLAttributes,\n type AriaAttributes,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { mergeRefs } from \"../../internal/mergeRefs\";\nimport { Button, type ButtonSize } from \"../Button\";\nimport { useTooltip } from \"../Popover/useTooltip\";\nimport { avatarColours } from \"./colour\";\nimport \"./style.css\";\n\nexport type AvatarSize = 24 | 32 | 40;\n\n/** Each avatar size is one of Button's square sizes, so callback avatars use Button unchanged. */\nconst buttonSizes: Record<AvatarSize, ButtonSize> = { 24: \"xs\", 32: \"sm\", 40: \"md\" };\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 /** Solid hex, RGB, HSL or named background; initials automatically use contrasting black/white. */\n colour?: string;\n /** Defaults to name; false disables the hover/focus tooltip. */\n tooltip?: string | false;\n href?: string;\n target?: AnchorHTMLAttributes<HTMLAnchorElement>[\"target\"];\n rel?: string;\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/** Separate ARIA attributes so they can follow the element that carries the role. */\nfunction splitAria<T extends object>(props: T) {\n const aria: Record<string, unknown> = {};\n const other: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(props)) {\n (key.startsWith(\"aria-\") ? aria : other)[key] = value;\n }\n return { aria: aria as AriaAttributes, other: other as Omit<T, keyof AriaAttributes> };\n}\n\n/**\n * Links and Buttons are natively focusable, and hidden ones leave the tab order.\n * A passive avatar is focusable only for a visible tooltip.\n */\nfunction defaultTabIndex(isActionable: boolean, isHidden: boolean, hasTooltip: boolean) {\n if (isActionable) {\n return isHidden ? -1 : undefined;\n }\n return !isHidden && hasTooltip ? 0 : undefined;\n}\n\nfunction AvatarContent({ name, src }: Pick<AvatarProps, \"name\" | \"src\">) {\n return (\n <span className=\"ds-avatar__content\">\n {src ? (\n <img\n src={src}\n alt=\"\"\n />\n ) : (\n initialsOf(name)\n )}\n </span>\n );\n}\n\ninterface AvatarControlProps extends Pick<AvatarProps, \"href\" | \"target\" | \"rel\"> {\n hasCallback: boolean;\n size: AvatarSize;\n /** Naming, description, id, ARIA state and tab order for the control. */\n semantics: HTMLAttributes<HTMLElement>;\n children: ReactNode;\n}\n\n/** The inner link or shared Button of an actionable avatar; passive content otherwise. */\nfunction AvatarControl({\n href,\n target,\n rel,\n hasCallback,\n size,\n semantics,\n children,\n}: AvatarControlProps) {\n if (href) {\n return (\n <a\n className=\"ds-avatar__control\"\n href={href}\n target={target}\n rel={rel}\n {...semantics}\n >\n {children}\n </a>\n );\n }\n if (hasCallback) {\n return (\n <Button\n variant=\"simple\"\n size={buttonSizes[size]}\n isIconOnly\n className=\"ds-avatar__control\"\n {...semantics}\n >\n {children}\n </Button>\n );\n }\n return <>{children}</>;\n}\n\n/**\n * A circular person identifier, optionally linked or actionable. The ref stays on\n * the outer span; `id` and ARIA attributes go to the image span, or to the inner\n * link or Button when the avatar is actionable.\n */\nexport const Avatar = forwardRef<HTMLSpanElement, AvatarProps>(function Avatar(\n {\n name,\n src,\n colour,\n style,\n size = 24,\n tooltip = name,\n href,\n target,\n rel,\n className,\n onClick,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n id,\n tabIndex,\n \"aria-label\": label = name,\n \"aria-describedby\": describedBy,\n \"aria-hidden\": hidden,\n ...props\n },\n ref,\n) {\n const isHidden = hidden === true || hidden === \"true\";\n const isActionable = !!href || !!onClick;\n const { anchorRef, description, triggerProps, panel } = useTooltip<HTMLSpanElement>(\n isHidden ? false : tooltip,\n { placement: \"top\", className: \"ds-avatar-tooltip\" },\n );\n // Stable across renders, so tooltip state changes never detach a caller's callback ref.\n const spanRef = useMemo(() => mergeRefs(anchorRef, ref), [anchorRef, ref]);\n const colours = useMemo(() => avatarColours(colour), [colour]);\n const { aria, other } = splitAria(props);\n const semantics = {\n ...aria,\n id,\n \"aria-label\": label,\n \"aria-describedby\": [describedBy, description].filter(Boolean).join(\" \") || undefined,\n tabIndex: tabIndex ?? defaultTabIndex(isActionable, isHidden, !!tooltip),\n };\n return (\n <>\n <span\n ref={spanRef}\n role={isActionable ? undefined : \"img\"}\n aria-hidden={hidden}\n {...(isActionable ? {} : semantics)}\n data-size={size}\n className={[\"ds-avatar\", className].filter(Boolean).join(\" \")}\n {...other}\n style={{ ...style, ...colours }}\n onClick={onClick}\n {...triggerProps({ onMouseEnter, onMouseLeave, onFocus, onBlur })}\n >\n <AvatarControl\n href={href}\n target={target}\n rel={rel}\n hasCallback={!!onClick}\n size={size}\n semantics={semantics}\n >\n <AvatarContent\n name={name}\n src={src}\n />\n </AvatarControl>\n </span>\n {panel}\n </>\n );\n});\n\ntype AvatarPerson = Pick<\n AvatarProps,\n \"name\" | \"src\" | \"colour\" | \"tooltip\" | \"href\" | \"target\" | \"rel\" | \"onClick\"\n>;\n\nexport interface AvatarGroupProps extends HTMLAttributes<HTMLSpanElement> {\n /** Up to three render; the rest become a +n count with a hidden-name tooltip. */\n people: AvatarPerson[];\n size?: AvatarSize;\n}\n\nfunction OverflowCount({ names }: { names: string[] }) {\n const { anchorRef, description, triggerProps, panel } = useTooltip<HTMLSpanElement>(\n names.join(\", \"),\n { placement: \"top\", className: \"ds-avatar-tooltip\" },\n );\n const count = names.length;\n return (\n <>\n <span\n ref={anchorRef}\n role=\"img\"\n className=\"ds-avatar-group__count\"\n tabIndex={0}\n aria-label={`${count} more ${count === 1 ? \"person\" : \"people\"}`}\n aria-describedby={description}\n {...triggerProps()}\n >\n +{count}\n </span>\n {panel}\n </>\n );\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 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 {/* Only documented person fields reach Avatar; extra application data stays off the DOM. */}\n {people\n .slice(0, 3)\n .map(({ name, src, colour, tooltip, href, target, rel, onClick }, index) => (\n <Avatar\n key={`${name}-${index}`}\n name={name}\n src={src}\n colour={colour}\n tooltip={tooltip}\n href={href}\n target={target}\n rel={rel}\n onClick={onClick}\n size={size}\n />\n ))}\n {people.length > 3 && <OverflowCount names={people.slice(3).map((person) => person.name)} />}\n </span>\n );\n});\n"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("./colour-BmtxDlWF.cjs"),t=require("../components/Button/index.cjs"),n=require("./mergeRefs-CZ-SArlE.cjs"),r=require("./useTooltip-
|
|
2
|
-
//# sourceMappingURL=Avatar-
|
|
1
|
+
const e=require("./colour-BmtxDlWF.cjs"),t=require("../components/Button/index.cjs"),n=require("./mergeRefs-CZ-SArlE.cjs"),r=require("./useTooltip-BXAvQwt4.cjs");let i=require("react"),a=require("react/jsx-runtime"),o=require("colord"),s=require("colord/plugins/a11y");s=e.a(s,1),(0,o.extend)([s.default]);function c(t){let n=t?e.i(t):null;if(n&&n.alpha()===1)return{"--avatar-background":n.toHex(),"--avatar-foreground":n.contrast(`#000`)>=n.contrast(`#fff`)?`#000000`:`#ffffff`}}var l={24:`xs`,32:`sm`,40:`md`};function u(e){let t=e.trim().split(/\s+/);return((t[0]?.[0]??``)+(t.length>1?t[t.length-1][0]:``)).toUpperCase()}function d(e){let t={},n={};for(let[r,i]of Object.entries(e))(r.startsWith(`aria-`)?t:n)[r]=i;return{aria:t,other:n}}function f(e,t,n){return e?t?-1:void 0:!t&&n?0:void 0}function p({name:e,src:t}){return(0,a.jsx)(`span`,{className:`ds-avatar__content`,children:t?(0,a.jsx)(`img`,{src:t,alt:``}):u(e)})}function m({href:e,target:n,rel:r,hasCallback:i,size:o,semantics:s,children:c}){return e?(0,a.jsx)(`a`,{className:`ds-avatar__control`,href:e,target:n,rel:r,...s,children:c}):i?(0,a.jsx)(t.Button,{variant:`simple`,size:l[o],isIconOnly:!0,className:`ds-avatar__control`,...s,children:c}):(0,a.jsx)(a.Fragment,{children:c})}var h=(0,i.forwardRef)(function({name:e,src:t,colour:o,style:s,size:l=24,tooltip:u=e,href:h,target:g,rel:_,className:v,onClick:y,onMouseEnter:b,onMouseLeave:x,onFocus:S,onBlur:C,id:w,tabIndex:T,"aria-label":E=e,"aria-describedby":D,"aria-hidden":O,...k},A){let j=O===!0||O===`true`,M=!!h||!!y,{anchorRef:N,description:P,triggerProps:F,panel:I}=r.t(!j&&u,{placement:`top`,className:`ds-avatar-tooltip`}),L=(0,i.useMemo)(()=>n.t(N,A),[N,A]),R=(0,i.useMemo)(()=>c(o),[o]),{aria:z,other:B}=d(k),V={...z,id:w,"aria-label":E,"aria-describedby":[D,P].filter(Boolean).join(` `)||void 0,tabIndex:T??f(M,j,!!u)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`span`,{ref:L,role:M?void 0:`img`,"aria-hidden":O,...M?{}:V,"data-size":l,className:[`ds-avatar`,v].filter(Boolean).join(` `),...B,style:{...s,...R},onClick:y,...F({onMouseEnter:b,onMouseLeave:x,onFocus:S,onBlur:C}),children:(0,a.jsx)(m,{href:h,target:g,rel:_,hasCallback:!!y,size:l,semantics:V,children:(0,a.jsx)(p,{name:e,src:t})})}),I]})});function g({names:e}){let{anchorRef:t,description:n,triggerProps:i,panel:o}=r.t(e.join(`, `),{placement:`top`,className:`ds-avatar-tooltip`}),s=e.length;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(`span`,{ref:t,role:`img`,className:`ds-avatar-group__count`,tabIndex:0,"aria-label":`${s} more ${s===1?`person`:`people`}`,"aria-describedby":n,...i(),children:[`+`,s]}),o]})}var _=(0,i.forwardRef)(function({people:e,size:t=24,className:n,...r},i){return(0,a.jsxs)(`span`,{ref:i,role:`group`,"aria-label":e.map(e=>e.name).join(`, `),className:[`ds-avatar-group`,n].filter(Boolean).join(` `),...r,children:[e.slice(0,3).map(({name:e,src:n,colour:r,tooltip:i,href:o,target:s,rel:c,onClick:l},u)=>(0,a.jsx)(h,{name:e,src:n,colour:r,tooltip:i,href:o,target:s,rel:c,onClick:l,size:t},`${e}-${u}`)),e.length>3&&(0,a.jsx)(g,{names:e.slice(3).map(e=>e.name)})]})});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
|
|
2
|
+
//# sourceMappingURL=Avatar-DPnrvkwd.cjs.map
|