@navikt/ds-react 8.7.0 → 8.8.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/cjs/alert/base-alert/root/BaseAlertRoot.js +1 -2
- package/cjs/alert/base-alert/root/BaseAlertRoot.js.map +1 -1
- package/cjs/alert/info-card/index.d.ts +2 -2
- package/cjs/alert/info-card/index.js +2 -1
- package/cjs/alert/info-card/index.js.map +1 -1
- package/cjs/alert/info-card/message/InfoCardMessage.d.ts +23 -0
- package/cjs/alert/info-card/message/InfoCardMessage.js +73 -0
- package/cjs/alert/info-card/message/InfoCardMessage.js.map +1 -0
- package/cjs/alert/info-card/root/InfoCardRoot.d.ts +15 -2
- package/cjs/alert/info-card/root/InfoCardRoot.js +4 -1
- package/cjs/alert/info-card/root/InfoCardRoot.js.map +1 -1
- package/cjs/data/drag-and-drop/drag-handler/DataDragAndDropDragHandler.d.ts +21 -0
- package/cjs/data/drag-and-drop/drag-handler/DataDragAndDropDragHandler.js +24 -0
- package/cjs/data/drag-and-drop/drag-handler/DataDragAndDropDragHandler.js.map +1 -0
- package/cjs/data/drag-and-drop/item/DataDragAndDropItem.js +7 -57
- package/cjs/data/drag-and-drop/item/DataDragAndDropItem.js.map +1 -1
- package/cjs/data/drag-and-drop/root/DataDragAndDrop.context.d.ts +4 -1
- package/cjs/data/drag-and-drop/root/DataDragAndDrop.context.js +7 -3
- package/cjs/data/drag-and-drop/root/DataDragAndDrop.context.js.map +1 -1
- package/cjs/data/drag-and-drop/root/DataDragAndDropRoot.d.ts +12 -2
- package/cjs/data/drag-and-drop/root/DataDragAndDropRoot.js +14 -64
- package/cjs/data/drag-and-drop/root/DataDragAndDropRoot.js.map +1 -1
- package/cjs/data/drag-and-drop-old/drag-handler/DataDragAndDropDragHandler.d.ts +22 -0
- package/cjs/data/drag-and-drop-old/drag-handler/DataDragAndDropDragHandler.js +35 -0
- package/cjs/data/drag-and-drop-old/drag-handler/DataDragAndDropDragHandler.js.map +1 -0
- package/cjs/data/drag-and-drop-old/item/DataDragAndDropItem.d.ts +27 -0
- package/cjs/data/drag-and-drop-old/item/DataDragAndDropItem.js +86 -0
- package/cjs/data/drag-and-drop-old/item/DataDragAndDropItem.js.map +1 -0
- package/cjs/data/drag-and-drop-old/root/DataDragAndDrop.context.d.ts +5 -0
- package/cjs/data/drag-and-drop-old/root/DataDragAndDrop.context.js +6 -0
- package/cjs/data/drag-and-drop-old/root/DataDragAndDrop.context.js.map +1 -0
- package/cjs/data/drag-and-drop-old/root/DataDragAndDropRoot.d.ts +24 -0
- package/cjs/data/drag-and-drop-old/root/DataDragAndDropRoot.js +108 -0
- package/cjs/data/drag-and-drop-old/root/DataDragAndDropRoot.js.map +1 -0
- package/cjs/data/table/empty-state/DataTableEmptyState.d.ts +5 -0
- package/cjs/data/table/empty-state/DataTableEmptyState.js +57 -0
- package/cjs/data/table/empty-state/DataTableEmptyState.js.map +1 -0
- package/cjs/data/table/helpers/table-focus.js +7 -1
- package/cjs/data/table/helpers/table-focus.js.map +1 -1
- package/cjs/data/table/helpers/table-keyboard.d.ts +0 -1
- package/cjs/data/table/helpers/table-keyboard.js +2 -4
- package/cjs/data/table/helpers/table-keyboard.js.map +1 -1
- package/cjs/data/table/loading-state/DataTableLoadingState.d.ts +5 -0
- package/cjs/data/table/loading-state/DataTableLoadingState.js +57 -0
- package/cjs/data/table/loading-state/DataTableLoadingState.js.map +1 -0
- package/cjs/data/table/root/DataTable.types.d.ts +13 -0
- package/cjs/data/table/root/DataTable.types.js +3 -0
- package/cjs/data/table/root/DataTable.types.js.map +1 -0
- package/cjs/data/table/root/DataTableAuto.d.ts +60 -0
- package/cjs/data/table/root/DataTableAuto.js +99 -0
- package/cjs/data/table/root/DataTableAuto.js.map +1 -0
- package/cjs/data/table/root/DataTableRoot.context.d.ts +3 -2
- package/cjs/data/table/root/DataTableRoot.context.js.map +1 -1
- package/cjs/data/table/root/DataTableRoot.d.ts +30 -3
- package/cjs/data/table/root/DataTableRoot.js +8 -2
- package/cjs/data/table/root/DataTableRoot.js.map +1 -1
- package/cjs/data/table/root/useTableKeyboardNav.js +1 -0
- package/cjs/data/table/root/useTableKeyboardNav.js.map +1 -1
- package/cjs/data/table/root/useTableSelection.d.ts +55 -0
- package/cjs/data/table/root/useTableSelection.js +79 -0
- package/cjs/data/table/root/useTableSelection.js.map +1 -0
- package/cjs/data/table/td/DataTableTd.d.ts +10 -0
- package/cjs/data/table/td/DataTableTd.js +4 -2
- package/cjs/data/table/td/DataTableTd.js.map +1 -1
- package/cjs/data/table/th/DataTableTh.d.ts +10 -4
- package/cjs/data/table/th/DataTableTh.js +24 -22
- package/cjs/data/table/th/DataTableTh.js.map +1 -1
- package/cjs/data/table/th/useTableColumnResize.d.ts +64 -0
- package/cjs/data/table/th/useTableColumnResize.js +144 -0
- package/cjs/data/table/th/useTableColumnResize.js.map +1 -0
- package/cjs/data/table/thead/DataTableThead.context.d.ts +4 -0
- package/cjs/data/table/thead/DataTableThead.context.js +45 -0
- package/cjs/data/table/thead/DataTableThead.context.js.map +1 -0
- package/cjs/data/table/thead/DataTableThead.js +3 -1
- package/cjs/data/table/thead/DataTableThead.js.map +1 -1
- package/cjs/data/table/tr/DataTableTr.js +4 -3
- package/cjs/data/table/tr/DataTableTr.js.map +1 -1
- package/cjs/data/token-filter/AutoSuggest.js +4 -6
- package/cjs/data/token-filter/AutoSuggest.js.map +1 -1
- package/cjs/date/Date.Input.js +1 -1
- package/cjs/date/Date.Input.js.map +1 -1
- package/cjs/date/datepicker/hooks/useDatepicker.d.ts +12 -1
- package/cjs/date/datepicker/hooks/useDatepicker.js.map +1 -1
- package/cjs/date/monthpicker/hooks/useMonthPicker.d.ts +11 -1
- package/cjs/date/monthpicker/hooks/useMonthPicker.js.map +1 -1
- package/cjs/form/checkbox/CheckboxGroup.js +1 -1
- package/cjs/form/checkbox/CheckboxGroup.js.map +1 -1
- package/cjs/form/fieldset/Fieldset.d.ts +25 -5
- package/cjs/form/fieldset/Fieldset.js +19 -2
- package/cjs/form/fieldset/Fieldset.js.map +1 -1
- package/cjs/form/radio/RadioGroup.js +1 -1
- package/cjs/form/radio/RadioGroup.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/read-more/ReadMore.d.ts +10 -0
- package/cjs/read-more/ReadMore.js +4 -6
- package/cjs/read-more/ReadMore.js.map +1 -1
- package/cjs/types/index.d.ts +1 -1
- package/cjs/types/index.js +0 -15
- package/cjs/types/index.js.map +1 -1
- package/cjs/utils/components/Listbox/input-slot/ListboxInputSlot.js +1 -1
- package/cjs/utils/components/Listbox/input-slot/ListboxInputSlot.js.map +1 -1
- package/cjs/utils/components/Listbox/option/ListboxOption.d.ts +24 -0
- package/cjs/utils/components/Listbox/{item/ListboxItem.js → option/ListboxOption.js} +8 -8
- package/cjs/utils/components/Listbox/option/ListboxOption.js.map +1 -0
- package/cjs/utils/components/Listbox/options/ListboxOptions.d.ts +8 -0
- package/cjs/utils/components/Listbox/{list/ListboxList.js → options/ListboxOptions.js} +8 -8
- package/cjs/utils/components/Listbox/options/ListboxOptions.js.map +1 -0
- package/cjs/utils/components/Listbox/root/ListboxRoot.d.ts +6 -6
- package/cjs/utils/components/Listbox/root/ListboxRoot.js +28 -28
- package/cjs/utils/components/Listbox/root/ListboxRoot.js.map +1 -1
- package/cjs/utils/components/Listbox/root/domHelpers.d.ts +3 -3
- package/cjs/utils/components/Listbox/root/domHelpers.js +8 -8
- package/cjs/utils/components/Listbox/root/domHelpers.js.map +1 -1
- package/cjs/utils/components/floating/Floating.d.ts +1 -1
- package/cjs/utils/components/floating/Floating.js +1 -1
- package/cjs/utils/components/floating/Floating.js.map +1 -1
- package/cjs/utils/components/focus-boundary/FocusBoundary.d.ts +0 -1
- package/cjs/utils/components/focus-boundary/FocusBoundary.js +1 -1
- package/cjs/utils/components/focus-boundary/FocusBoundary.js.map +1 -1
- package/cjs/utils/components/link-anchor/LinkAnchor.js +10 -0
- package/cjs/utils/components/link-anchor/LinkAnchor.js.map +1 -1
- package/cjs/utils/helpers/className.js +1 -1
- package/cjs/utils/helpers/className.js.map +1 -1
- package/cjs/utils/helpers/focus.d.ts +3 -1
- package/cjs/utils/helpers/focus.js +2 -2
- package/cjs/utils/helpers/focus.js.map +1 -1
- package/cjs/utils/helpers/index.d.ts +9 -9
- package/cjs/utils/helpers/index.js +22 -23
- package/cjs/utils/helpers/index.js.map +1 -1
- package/cjs/utils/hooks/index.d.ts +13 -13
- package/cjs/utils/hooks/index.js +31 -28
- package/cjs/utils/hooks/index.js.map +1 -1
- package/cjs/utils/hooks/useScrollLock.js +41 -11
- package/cjs/utils/hooks/useScrollLock.js.map +1 -1
- package/esm/alert/base-alert/root/BaseAlertRoot.js +1 -2
- package/esm/alert/base-alert/root/BaseAlertRoot.js.map +1 -1
- package/esm/alert/info-card/index.d.ts +2 -2
- package/esm/alert/info-card/index.js +1 -1
- package/esm/alert/info-card/index.js.map +1 -1
- package/esm/alert/info-card/message/InfoCardMessage.d.ts +23 -0
- package/esm/alert/info-card/message/InfoCardMessage.js +37 -0
- package/esm/alert/info-card/message/InfoCardMessage.js.map +1 -0
- package/esm/alert/info-card/root/InfoCardRoot.d.ts +15 -2
- package/esm/alert/info-card/root/InfoCardRoot.js +3 -1
- package/esm/alert/info-card/root/InfoCardRoot.js.map +1 -1
- package/esm/data/drag-and-drop/drag-handler/DataDragAndDropDragHandler.d.ts +21 -0
- package/esm/data/drag-and-drop/drag-handler/DataDragAndDropDragHandler.js +18 -0
- package/esm/data/drag-and-drop/drag-handler/DataDragAndDropDragHandler.js.map +1 -0
- package/esm/data/drag-and-drop/item/DataDragAndDropItem.js +4 -24
- package/esm/data/drag-and-drop/item/DataDragAndDropItem.js.map +1 -1
- package/esm/data/drag-and-drop/root/DataDragAndDrop.context.d.ts +4 -1
- package/esm/data/drag-and-drop/root/DataDragAndDrop.context.js +5 -2
- package/esm/data/drag-and-drop/root/DataDragAndDrop.context.js.map +1 -1
- package/esm/data/drag-and-drop/root/DataDragAndDropRoot.d.ts +12 -2
- package/esm/data/drag-and-drop/root/DataDragAndDropRoot.js +15 -65
- package/esm/data/drag-and-drop/root/DataDragAndDropRoot.js.map +1 -1
- package/esm/data/drag-and-drop-old/drag-handler/DataDragAndDropDragHandler.d.ts +22 -0
- package/esm/data/drag-and-drop-old/drag-handler/DataDragAndDropDragHandler.js +29 -0
- package/esm/data/drag-and-drop-old/drag-handler/DataDragAndDropDragHandler.js.map +1 -0
- package/esm/data/drag-and-drop-old/item/DataDragAndDropItem.d.ts +27 -0
- package/esm/data/drag-and-drop-old/item/DataDragAndDropItem.js +50 -0
- package/esm/data/drag-and-drop-old/item/DataDragAndDropItem.js.map +1 -0
- package/esm/data/drag-and-drop-old/root/DataDragAndDrop.context.d.ts +5 -0
- package/esm/data/drag-and-drop-old/root/DataDragAndDrop.context.js +3 -0
- package/esm/data/drag-and-drop-old/root/DataDragAndDrop.context.js.map +1 -0
- package/esm/data/drag-and-drop-old/root/DataDragAndDropRoot.d.ts +24 -0
- package/esm/data/drag-and-drop-old/root/DataDragAndDropRoot.js +68 -0
- package/esm/data/drag-and-drop-old/root/DataDragAndDropRoot.js.map +1 -0
- package/esm/data/table/empty-state/DataTableEmptyState.d.ts +5 -0
- package/esm/data/table/empty-state/DataTableEmptyState.js +21 -0
- package/esm/data/table/empty-state/DataTableEmptyState.js.map +1 -0
- package/esm/data/table/helpers/table-focus.js +7 -1
- package/esm/data/table/helpers/table-focus.js.map +1 -1
- package/esm/data/table/helpers/table-keyboard.d.ts +0 -1
- package/esm/data/table/helpers/table-keyboard.js +2 -4
- package/esm/data/table/helpers/table-keyboard.js.map +1 -1
- package/esm/data/table/loading-state/DataTableLoadingState.d.ts +5 -0
- package/esm/data/table/loading-state/DataTableLoadingState.js +21 -0
- package/esm/data/table/loading-state/DataTableLoadingState.js.map +1 -0
- package/esm/data/table/root/DataTable.types.d.ts +13 -0
- package/esm/data/table/root/DataTable.types.js +2 -0
- package/esm/data/table/root/DataTable.types.js.map +1 -0
- package/esm/data/table/root/DataTableAuto.d.ts +60 -0
- package/esm/data/table/root/DataTableAuto.js +63 -0
- package/esm/data/table/root/DataTableAuto.js.map +1 -0
- package/esm/data/table/root/DataTableRoot.context.d.ts +3 -2
- package/esm/data/table/root/DataTableRoot.context.js.map +1 -1
- package/esm/data/table/root/DataTableRoot.d.ts +30 -3
- package/esm/data/table/root/DataTableRoot.js +6 -2
- package/esm/data/table/root/DataTableRoot.js.map +1 -1
- package/esm/data/table/root/useTableKeyboardNav.js +1 -0
- package/esm/data/table/root/useTableKeyboardNav.js.map +1 -1
- package/esm/data/table/root/useTableSelection.d.ts +55 -0
- package/esm/data/table/root/useTableSelection.js +77 -0
- package/esm/data/table/root/useTableSelection.js.map +1 -0
- package/esm/data/table/td/DataTableTd.d.ts +10 -0
- package/esm/data/table/td/DataTableTd.js +4 -2
- package/esm/data/table/td/DataTableTd.js.map +1 -1
- package/esm/data/table/th/DataTableTh.d.ts +10 -4
- package/esm/data/table/th/DataTableTh.js +25 -23
- package/esm/data/table/th/DataTableTh.js.map +1 -1
- package/esm/data/table/th/useTableColumnResize.d.ts +64 -0
- package/esm/data/table/th/useTableColumnResize.js +142 -0
- package/esm/data/table/th/useTableColumnResize.js.map +1 -0
- package/esm/data/table/thead/DataTableThead.context.d.ts +4 -0
- package/esm/data/table/thead/DataTableThead.context.js +8 -0
- package/esm/data/table/thead/DataTableThead.context.js.map +1 -0
- package/esm/data/table/thead/DataTableThead.js +3 -1
- package/esm/data/table/thead/DataTableThead.js.map +1 -1
- package/esm/data/table/tr/DataTableTr.js +4 -3
- package/esm/data/table/tr/DataTableTr.js.map +1 -1
- package/esm/data/token-filter/AutoSuggest.js +4 -6
- package/esm/data/token-filter/AutoSuggest.js.map +1 -1
- package/esm/date/Date.Input.js +1 -1
- package/esm/date/Date.Input.js.map +1 -1
- package/esm/date/datepicker/hooks/useDatepicker.d.ts +12 -1
- package/esm/date/datepicker/hooks/useDatepicker.js.map +1 -1
- package/esm/date/monthpicker/hooks/useMonthPicker.d.ts +11 -1
- package/esm/date/monthpicker/hooks/useMonthPicker.js.map +1 -1
- package/esm/form/checkbox/CheckboxGroup.js +1 -1
- package/esm/form/checkbox/CheckboxGroup.js.map +1 -1
- package/esm/form/fieldset/Fieldset.d.ts +25 -5
- package/esm/form/fieldset/Fieldset.js +19 -2
- package/esm/form/fieldset/Fieldset.js.map +1 -1
- package/esm/form/radio/RadioGroup.js +1 -1
- package/esm/form/radio/RadioGroup.js.map +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js.map +1 -1
- package/esm/read-more/ReadMore.d.ts +10 -0
- package/esm/read-more/ReadMore.js +4 -6
- package/esm/read-more/ReadMore.js.map +1 -1
- package/esm/types/index.d.ts +1 -1
- package/esm/types/index.js +1 -1
- package/esm/types/index.js.map +1 -1
- package/esm/utils/components/Listbox/input-slot/ListboxInputSlot.js +1 -1
- package/esm/utils/components/Listbox/input-slot/ListboxInputSlot.js.map +1 -1
- package/esm/utils/components/Listbox/option/ListboxOption.d.ts +24 -0
- package/esm/utils/components/Listbox/{item/ListboxItem.js → option/ListboxOption.js} +7 -7
- package/esm/utils/components/Listbox/option/ListboxOption.js.map +1 -0
- package/esm/utils/components/Listbox/options/ListboxOptions.d.ts +8 -0
- package/esm/utils/components/Listbox/{list/ListboxList.js → options/ListboxOptions.js} +8 -8
- package/esm/utils/components/Listbox/options/ListboxOptions.js.map +1 -0
- package/esm/utils/components/Listbox/root/ListboxRoot.d.ts +6 -6
- package/esm/utils/components/Listbox/root/ListboxRoot.js +29 -29
- package/esm/utils/components/Listbox/root/ListboxRoot.js.map +1 -1
- package/esm/utils/components/Listbox/root/domHelpers.d.ts +3 -3
- package/esm/utils/components/Listbox/root/domHelpers.js +7 -7
- package/esm/utils/components/Listbox/root/domHelpers.js.map +1 -1
- package/esm/utils/components/floating/Floating.d.ts +1 -1
- package/esm/utils/components/floating/Floating.js +1 -1
- package/esm/utils/components/floating/Floating.js.map +1 -1
- package/esm/utils/components/focus-boundary/FocusBoundary.d.ts +0 -1
- package/esm/utils/components/focus-boundary/FocusBoundary.js +1 -1
- package/esm/utils/components/focus-boundary/FocusBoundary.js.map +1 -1
- package/esm/utils/components/link-anchor/LinkAnchor.js +10 -0
- package/esm/utils/components/link-anchor/LinkAnchor.js.map +1 -1
- package/esm/utils/helpers/className.js +1 -1
- package/esm/utils/helpers/className.js.map +1 -1
- package/esm/utils/helpers/focus.d.ts +3 -1
- package/esm/utils/helpers/focus.js +2 -2
- package/esm/utils/helpers/focus.js.map +1 -1
- package/esm/utils/helpers/index.d.ts +9 -9
- package/esm/utils/helpers/index.js +9 -9
- package/esm/utils/helpers/index.js.map +1 -1
- package/esm/utils/hooks/index.d.ts +13 -13
- package/esm/utils/hooks/index.js +13 -13
- package/esm/utils/hooks/index.js.map +1 -1
- package/esm/utils/hooks/useScrollLock.js +41 -11
- package/esm/utils/hooks/useScrollLock.js.map +1 -1
- package/package.json +5 -5
- package/src/alert/base-alert/root/BaseAlertRoot.tsx +1 -1
- package/src/alert/info-card/index.ts +2 -0
- package/src/alert/info-card/message/InfoCardMessage.tsx +48 -0
- package/src/alert/info-card/root/InfoCardRoot.tsx +20 -1
- package/src/data/drag-and-drop/drag-handler/DataDragAndDropDragHandler.tsx +63 -0
- package/src/data/drag-and-drop/item/DataDragAndDropItem.tsx +6 -53
- package/src/data/drag-and-drop/root/DataDragAndDrop.context.tsx +9 -4
- package/src/data/drag-and-drop/root/DataDragAndDropRoot.tsx +19 -63
- package/src/data/drag-and-drop-old/drag-handler/DataDragAndDropDragHandler.tsx +104 -0
- package/src/data/drag-and-drop-old/item/DataDragAndDropItem.tsx +74 -0
- package/src/data/drag-and-drop-old/root/DataDragAndDrop.context.tsx +11 -0
- package/src/data/drag-and-drop-old/root/DataDragAndDropRoot.tsx +96 -0
- package/src/data/table/empty-state/DataTableEmptyState.tsx +26 -0
- package/src/data/table/helpers/table-focus.ts +10 -1
- package/src/data/table/helpers/table-keyboard.ts +2 -6
- package/src/data/table/loading-state/DataTableLoadingState.tsx +26 -0
- package/src/data/table/root/DataTable.types.ts +16 -0
- package/src/data/table/root/DataTableAuto.tsx +182 -0
- package/src/data/table/root/DataTableRoot.context.ts +3 -2
- package/src/data/table/root/DataTableRoot.tsx +45 -2
- package/src/data/table/root/useTableKeyboardNav.ts +1 -0
- package/src/data/table/root/useTableSelection.ts +126 -0
- package/src/data/table/td/DataTableTd.tsx +14 -1
- package/src/data/table/th/DataTableTh.tsx +48 -36
- package/src/data/table/th/useTableColumnResize.ts +276 -0
- package/src/data/table/thead/DataTableThead.context.ts +10 -0
- package/src/data/table/thead/DataTableThead.tsx +8 -5
- package/src/data/table/tr/DataTableTr.tsx +8 -3
- package/src/data/token-filter/AutoSuggest.tsx +11 -12
- package/src/date/Date.Input.tsx +1 -1
- package/src/date/datepicker/hooks/useDatepicker.tsx +12 -1
- package/src/date/monthpicker/hooks/useMonthPicker.tsx +11 -1
- package/src/form/checkbox/CheckboxGroup.tsx +1 -1
- package/src/form/fieldset/Fieldset.tsx +31 -7
- package/src/form/radio/RadioGroup.tsx +1 -1
- package/src/index.ts +1 -0
- package/src/read-more/ReadMore.tsx +15 -16
- package/src/types/index.ts +1 -1
- package/src/utils/components/Listbox/input-slot/ListboxInputSlot.tsx +1 -1
- package/src/utils/components/Listbox/{item/ListboxItem.tsx → option/ListboxOption.tsx} +14 -14
- package/src/utils/components/Listbox/{list/ListboxList.tsx → options/ListboxOptions.tsx} +10 -10
- package/src/utils/components/Listbox/root/ListboxRoot.tsx +31 -31
- package/src/utils/components/Listbox/root/domHelpers.ts +8 -7
- package/src/utils/components/floating/Floating.tsx +2 -2
- package/src/utils/components/focus-boundary/FocusBoundary.tsx +1 -2
- package/src/utils/components/link-anchor/LinkAnchor.tsx +11 -0
- package/src/utils/helpers/className.ts +1 -1
- package/src/utils/helpers/focus.ts +5 -2
- package/src/utils/helpers/index.ts +9 -9
- package/src/utils/hooks/index.ts +20 -13
- package/src/utils/hooks/useScrollLock.ts +57 -13
- package/cjs/utils/components/Listbox/item/ListboxItem.d.ts +0 -24
- package/cjs/utils/components/Listbox/item/ListboxItem.js.map +0 -1
- package/cjs/utils/components/Listbox/list/ListboxList.d.ts +0 -8
- package/cjs/utils/components/Listbox/list/ListboxList.js.map +0 -1
- package/esm/utils/components/Listbox/item/ListboxItem.d.ts +0 -24
- package/esm/utils/components/Listbox/item/ListboxItem.js.map +0 -1
- package/esm/utils/components/Listbox/list/ListboxList.d.ts +0 -8
- package/esm/utils/components/Listbox/list/ListboxList.js.map +0 -1
|
@@ -57,8 +57,7 @@ const BaseAlert = (0, react_1.forwardRef)((_a, forwardedRef) => {
|
|
|
57
57
|
const translate = (0, i18n_hooks_1.useI18n)("global");
|
|
58
58
|
const alertColor = status ? (0, BaseAlertRoot_utils_1.baseAlertStatusToDataColor)(status) : dataColor;
|
|
59
59
|
return (react_1.default.createElement(BaseAlertRoot_context_1.BaseAlertProvider, { size: size, status: status, color: alertColor, statusId: type === "strong" ? statusId : undefined },
|
|
60
|
-
react_1.default.createElement(Component, Object.assign({ "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : (!status || Component === "div" ? undefined : translate(status)), ref: forwardedRef }, restProps, { className: (0, helpers_1.cl)(className, "aksel-base-alert"), "data-size": size, "data-color": alertColor, "data-variant": type, "data-global": global }),
|
|
61
|
-
react_1.default.createElement("div", { role: role }, children))));
|
|
60
|
+
react_1.default.createElement(Component, Object.assign({ "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : (!status || Component === "div" ? undefined : translate(status)), ref: forwardedRef }, restProps, { className: (0, helpers_1.cl)(className, "aksel-base-alert"), "data-size": size, "data-color": alertColor, "data-variant": type, "data-global": global }), role ? react_1.default.createElement("div", { role: role }, children) : children)));
|
|
62
61
|
});
|
|
63
62
|
exports.BaseAlert = BaseAlert;
|
|
64
63
|
//# sourceMappingURL=BaseAlertRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseAlertRoot.js","sourceRoot":"","sources":["../../../../src/alert/base-alert/root/BaseAlertRoot.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,4DAAgD;AAChD,oDAA4C;AAC5C,+DAAyD;AACzD,mEAGiC;AACjC,+DAAmE;AA0CnE,MAAM,SAAS,GAAG,IAAA,kBAAU,EAC1B,CACE,EAYiB,EACjB,YAAY,EACZ,EAAE;QAdF,EACE,QAAQ,EACR,SAAS,EACT,IAAI,GAAG,QAAQ,EACf,YAAY,EAAE,SAAS,EACvB,IAAI,EACJ,MAAM,GAAG,KAAK,EACd,MAAM,EACN,EAAE,EAAE,SAAS,GAAG,SAAS,EACzB,YAAY,EAAE,SAAS,EACvB,IAAI,OAEW,EADZ,SAAS,cAXd,uGAYC,CADa;IAId,MAAM,QAAQ,GAAG,IAAA,sBAAK,GAAE,CAAC;IACzB,MAAM,SAAS,GAAG,IAAA,oBAAO,EAAC,QAAQ,CAAC,CAAC;IAEpC,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,IAAA,gDAA0B,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAE3E,OAAO,CACL,8BAAC,yCAAiB,IAChB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;QAElD,8BAAC,SAAS,gCAEN,SAAS,aAAT,SAAS,cAAT,SAAS,GACT,CAAC,CAAC,MAAM,IAAI,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAElE,GAAG,EAAE,YAAY,IACb,SAAS,IACb,SAAS,EAAE,IAAA,YAAE,EAAC,SAAS,EAAE,kBAAkB,CAAC,eACjC,IAAI,gBACH,UAAU,kBACR,IAAI,iBACL,MAAM
|
|
1
|
+
{"version":3,"file":"BaseAlertRoot.js","sourceRoot":"","sources":["../../../../src/alert/base-alert/root/BaseAlertRoot.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAE1C,4DAAgD;AAChD,oDAA4C;AAC5C,+DAAyD;AACzD,mEAGiC;AACjC,+DAAmE;AA0CnE,MAAM,SAAS,GAAG,IAAA,kBAAU,EAC1B,CACE,EAYiB,EACjB,YAAY,EACZ,EAAE;QAdF,EACE,QAAQ,EACR,SAAS,EACT,IAAI,GAAG,QAAQ,EACf,YAAY,EAAE,SAAS,EACvB,IAAI,EACJ,MAAM,GAAG,KAAK,EACd,MAAM,EACN,EAAE,EAAE,SAAS,GAAG,SAAS,EACzB,YAAY,EAAE,SAAS,EACvB,IAAI,OAEW,EADZ,SAAS,cAXd,uGAYC,CADa;IAId,MAAM,QAAQ,GAAG,IAAA,sBAAK,GAAE,CAAC;IACzB,MAAM,SAAS,GAAG,IAAA,oBAAO,EAAC,QAAQ,CAAC,CAAC;IAEpC,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,IAAA,gDAA0B,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAE3E,OAAO,CACL,8BAAC,yCAAiB,IAChB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;QAElD,8BAAC,SAAS,gCAEN,SAAS,aAAT,SAAS,cAAT,SAAS,GACT,CAAC,CAAC,MAAM,IAAI,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAElE,GAAG,EAAE,YAAY,IACb,SAAS,IACb,SAAS,EAAE,IAAA,YAAE,EAAC,SAAS,EAAE,kBAAkB,CAAC,eACjC,IAAI,gBACH,UAAU,kBACR,IAAI,iBACL,MAAM,KAElB,IAAI,CAAC,CAAC,CAAC,uCAAK,IAAI,EAAE,IAAI,IAAG,QAAQ,CAAO,CAAC,CAAC,CAAC,QAAQ,CAC1C,CACM,CACrB,CAAC;AACJ,CAAC,CACF,CAAC;AAEO,8BAAS"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { InfoCard, InfoCardHeader, InfoCardTitle, InfoCardContent, } from "./root/InfoCardRoot";
|
|
2
|
-
export type { InfoCardProps, InfoCardHeaderProps, InfoCardTitleProps, InfoCardContentProps, } from "./root/InfoCardRoot";
|
|
1
|
+
export { InfoCard, InfoCardHeader, InfoCardTitle, InfoCardContent, InfoCardMessage, } from "./root/InfoCardRoot";
|
|
2
|
+
export type { InfoCardProps, InfoCardHeaderProps, InfoCardTitleProps, InfoCardContentProps, InfoCardMessageProps, } from "./root/InfoCardRoot";
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.InfoCardContent = exports.InfoCardTitle = exports.InfoCardHeader = exports.InfoCard = void 0;
|
|
4
|
+
exports.InfoCardMessage = exports.InfoCardContent = exports.InfoCardTitle = exports.InfoCardHeader = exports.InfoCard = void 0;
|
|
5
5
|
var InfoCardRoot_1 = require("./root/InfoCardRoot");
|
|
6
6
|
Object.defineProperty(exports, "InfoCard", { enumerable: true, get: function () { return InfoCardRoot_1.InfoCard; } });
|
|
7
7
|
Object.defineProperty(exports, "InfoCardHeader", { enumerable: true, get: function () { return InfoCardRoot_1.InfoCardHeader; } });
|
|
8
8
|
Object.defineProperty(exports, "InfoCardTitle", { enumerable: true, get: function () { return InfoCardRoot_1.InfoCardTitle; } });
|
|
9
9
|
Object.defineProperty(exports, "InfoCardContent", { enumerable: true, get: function () { return InfoCardRoot_1.InfoCardContent; } });
|
|
10
|
+
Object.defineProperty(exports, "InfoCardMessage", { enumerable: true, get: function () { return InfoCardRoot_1.InfoCardMessage; } });
|
|
10
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/alert/info-card/index.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AACb,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/alert/info-card/index.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AACb,oDAM6B;AAL3B,wGAAA,QAAQ,OAAA;AACR,8GAAA,cAAc,OAAA;AACd,6GAAA,aAAa,OAAA;AACb,+GAAA,eAAe,OAAA;AACf,+GAAA,eAAe,OAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface InfoCardMessageProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Icon to display in message.
|
|
5
|
+
*/
|
|
6
|
+
icon: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A component for displaying informational messages.
|
|
10
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/infocard)
|
|
11
|
+
* @see 🏷️ {@link InfoCardMessageProps}
|
|
12
|
+
* @example
|
|
13
|
+
* ```jsx
|
|
14
|
+
* <InfoCard data-color="info">
|
|
15
|
+
* <InfoCard.Message icon={<InformationSquareIcon aria-hidden />}>
|
|
16
|
+
* Message contents
|
|
17
|
+
* </InfoCard.Message>
|
|
18
|
+
* </InfoCard>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare const InfoCardMessage: React.ForwardRefExoticComponent<InfoCardMessageProps & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
export { InfoCardMessage };
|
|
23
|
+
export type { InfoCardMessageProps };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
36
|
+
var t = {};
|
|
37
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
38
|
+
t[p] = s[p];
|
|
39
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
40
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
41
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
42
|
+
t[p[i]] = s[p[i]];
|
|
43
|
+
}
|
|
44
|
+
return t;
|
|
45
|
+
};
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
exports.InfoCardMessage = void 0;
|
|
48
|
+
const react_1 = __importStar(require("react"));
|
|
49
|
+
const typography_1 = require("../../../typography");
|
|
50
|
+
const helpers_1 = require("../../../utils/helpers");
|
|
51
|
+
const BaseAlertRoot_context_1 = require("../../base-alert/root/BaseAlertRoot.context");
|
|
52
|
+
/**
|
|
53
|
+
* A component for displaying informational messages.
|
|
54
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/infocard)
|
|
55
|
+
* @see 🏷️ {@link InfoCardMessageProps}
|
|
56
|
+
* @example
|
|
57
|
+
* ```jsx
|
|
58
|
+
* <InfoCard data-color="info">
|
|
59
|
+
* <InfoCard.Message icon={<InformationSquareIcon aria-hidden />}>
|
|
60
|
+
* Message contents
|
|
61
|
+
* </InfoCard.Message>
|
|
62
|
+
* </InfoCard>
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
const InfoCardMessage = (0, react_1.forwardRef)((_a, forwardedRef) => {
|
|
66
|
+
var { children, className, icon } = _a, restProps = __rest(_a, ["children", "className", "icon"]);
|
|
67
|
+
const context = (0, BaseAlertRoot_context_1.useBaseAlert)();
|
|
68
|
+
return (react_1.default.createElement("div", Object.assign({ ref: forwardedRef, className: (0, helpers_1.cl)(className, "aksel-base-alert__message") }, restProps),
|
|
69
|
+
react_1.default.createElement("div", { className: "aksel-base-alert__icon" }, icon),
|
|
70
|
+
react_1.default.createElement(typography_1.BodyLong, { size: context.size, as: "div", textColor: "default" }, children)));
|
|
71
|
+
});
|
|
72
|
+
exports.InfoCardMessage = InfoCardMessage;
|
|
73
|
+
//# sourceMappingURL=InfoCardMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoCardMessage.js","sourceRoot":"","sources":["../../../../src/alert/info-card/message/InfoCardMessage.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAC1C,oDAA+C;AAC/C,oDAA4C;AAC5C,uFAA2E;AAS3E;;;;;;;;;;;;GAYG;AACH,MAAM,eAAe,GAAG,IAAA,kBAAU,EAChC,CACE,EAAiE,EACjE,YAAY,EACZ,EAAE;QAFF,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,OAAsC,EAAjC,SAAS,cAAzC,iCAA2C,CAAF;IAGzC,MAAM,OAAO,GAAG,IAAA,oCAAY,GAAE,CAAC;IAC/B,OAAO,CACL,qDACE,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,IAAA,YAAE,EAAC,SAAS,EAAE,2BAA2B,CAAC,IACjD,SAAS;QAEb,uCAAK,SAAS,EAAC,wBAAwB,IAAE,IAAI,CAAO;QACpD,8BAAC,qBAAQ,IAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,EAAC,KAAK,EAAC,SAAS,EAAC,SAAS,IACvD,QAAQ,CACA,CACP,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEO,0CAAe"}
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { BaseAlert } from "../../base-alert";
|
|
3
3
|
import { InfoCardContent, type InfoCardContentProps } from "../content/InfoCardContent";
|
|
4
4
|
import { InfoCardHeader, type InfoCardHeaderProps } from "../header/InfoCardHeader";
|
|
5
|
+
import { InfoCardMessage, type InfoCardMessageProps } from "../message/InfoCardMessage";
|
|
5
6
|
import { InfoCardTitle, type InfoCardTitleProps } from "../title/InfoCardTitle";
|
|
6
7
|
type InfoCardProps = Omit<BaseAlert.RootProps, "type" | "global" | "status" | "as"> & {
|
|
7
8
|
/**
|
|
@@ -55,6 +56,18 @@ interface InfoCardComponent extends React.ForwardRefExoticComponent<InfoCardProp
|
|
|
55
56
|
* ```
|
|
56
57
|
*/
|
|
57
58
|
Content: typeof InfoCardContent;
|
|
59
|
+
/**
|
|
60
|
+
* @see 🏷️ {@link InfoCardMessageProps}
|
|
61
|
+
* @example
|
|
62
|
+
* ```jsx
|
|
63
|
+
* <InfoCard data-color="info">
|
|
64
|
+
* <InfoCard.Message icon={<InformationSquareIcon aria-hidden />}>
|
|
65
|
+
* Message contents
|
|
66
|
+
* </InfoCard.Message>
|
|
67
|
+
* </InfoCard>
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
Message: typeof InfoCardMessage;
|
|
58
71
|
}
|
|
59
72
|
/**
|
|
60
73
|
* A component for displaying informational content in a card format.
|
|
@@ -72,5 +85,5 @@ interface InfoCardComponent extends React.ForwardRefExoticComponent<InfoCardProp
|
|
|
72
85
|
*/
|
|
73
86
|
export declare const InfoCard: InfoCardComponent;
|
|
74
87
|
export default InfoCard;
|
|
75
|
-
export { InfoCardContent, InfoCardHeader, InfoCardTitle };
|
|
76
|
-
export type { InfoCardProps, InfoCardHeaderProps, InfoCardTitleProps, InfoCardContentProps, };
|
|
88
|
+
export { InfoCardContent, InfoCardHeader, InfoCardTitle, InfoCardMessage };
|
|
89
|
+
export type { InfoCardProps, InfoCardHeaderProps, InfoCardTitleProps, InfoCardContentProps, InfoCardMessageProps, };
|
|
@@ -44,13 +44,15 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
44
44
|
return t;
|
|
45
45
|
};
|
|
46
46
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
-
exports.InfoCardTitle = exports.InfoCardHeader = exports.InfoCardContent = exports.InfoCard = void 0;
|
|
47
|
+
exports.InfoCardMessage = exports.InfoCardTitle = exports.InfoCardHeader = exports.InfoCardContent = exports.InfoCard = void 0;
|
|
48
48
|
const react_1 = __importStar(require("react"));
|
|
49
49
|
const base_alert_1 = require("../../base-alert");
|
|
50
50
|
const InfoCardContent_1 = require("../content/InfoCardContent");
|
|
51
51
|
Object.defineProperty(exports, "InfoCardContent", { enumerable: true, get: function () { return InfoCardContent_1.InfoCardContent; } });
|
|
52
52
|
const InfoCardHeader_1 = require("../header/InfoCardHeader");
|
|
53
53
|
Object.defineProperty(exports, "InfoCardHeader", { enumerable: true, get: function () { return InfoCardHeader_1.InfoCardHeader; } });
|
|
54
|
+
const InfoCardMessage_1 = require("../message/InfoCardMessage");
|
|
55
|
+
Object.defineProperty(exports, "InfoCardMessage", { enumerable: true, get: function () { return InfoCardMessage_1.InfoCardMessage; } });
|
|
54
56
|
const InfoCardTitle_1 = require("../title/InfoCardTitle");
|
|
55
57
|
Object.defineProperty(exports, "InfoCardTitle", { enumerable: true, get: function () { return InfoCardTitle_1.InfoCardTitle; } });
|
|
56
58
|
/**
|
|
@@ -74,5 +76,6 @@ exports.InfoCard = (0, react_1.forwardRef)((_a, forwardedRef) => {
|
|
|
74
76
|
exports.InfoCard.Header = InfoCardHeader_1.InfoCardHeader;
|
|
75
77
|
exports.InfoCard.Title = InfoCardTitle_1.InfoCardTitle;
|
|
76
78
|
exports.InfoCard.Content = InfoCardContent_1.InfoCardContent;
|
|
79
|
+
exports.InfoCard.Message = InfoCardMessage_1.InfoCardMessage;
|
|
77
80
|
exports.default = exports.InfoCard;
|
|
78
81
|
//# sourceMappingURL=InfoCardRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoCardRoot.js","sourceRoot":"","sources":["../../../../src/alert/info-card/root/InfoCardRoot.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAC1C,iDAA6C;AAC7C,gEAGoC;
|
|
1
|
+
{"version":3,"file":"InfoCardRoot.js","sourceRoot":"","sources":["../../../../src/alert/info-card/root/InfoCardRoot.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAC1C,iDAA6C;AAC7C,gEAGoC;AAgI3B,gGAlIP,iCAAe,OAkIO;AA/HxB,6DAGkC;AA4HR,+FA9HxB,+BAAc,OA8HwB;AA3HxC,gEAGoC;AAwHqB,gGA1HvD,iCAAe,OA0HuD;AAvHxE,0DAAgF;AAuHtC,8FAvHjC,6BAAa,OAuHiC;AA1CvD;;;;;;;;;;;;;GAaG;AACU,QAAA,QAAQ,GAAG,IAAA,kBAAU,EAChC,CACE,EAIgB,EAChB,YAAY,EACZ,EAAE;QANF,EACE,YAAY,EAAE,SAAS,GAAG,MAAM,EAChC,EAAE,GAAG,KAAK,OAEI,EADX,SAAS,cAHd,oBAIC,CADa;IAId,OAAO,CACL,8BAAC,sBAAS,CAAC,IAAI,kBACb,GAAG,EAAE,YAAY,gBACL,SAAS,IACjB,SAAS,IACb,IAAI,EAAC,UAAU,EACf,MAAM,EAAE,KAAK,EACb,EAAE,EAAE,EAAE,IACN,CACH,CAAC;AACJ,CAAC,CACmB,CAAC;AAEvB,gBAAQ,CAAC,MAAM,GAAG,+BAAc,CAAC;AACjC,gBAAQ,CAAC,KAAK,GAAG,6BAAa,CAAC;AAC/B,gBAAQ,CAAC,OAAO,GAAG,iCAAe,CAAC;AACnC,gBAAQ,CAAC,OAAO,GAAG,iCAAe,CAAC;AAEnC,kBAAe,gBAAQ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface DataDragAndDropDragHandlerProps {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the drag handler is disabled
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Wether dragging is done by keyboard. Used to conditionally render drag indicators.
|
|
8
|
+
*/
|
|
9
|
+
keyboardDragging?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Handle ref is forwarded to the button element serving as drag handle.
|
|
12
|
+
*/
|
|
13
|
+
handleRef: React.Ref<HTMLDivElement>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* DataDragAndDropDragHandler
|
|
17
|
+
*
|
|
18
|
+
* A button component that serves as a drag handle for drag and drop operations.
|
|
19
|
+
* Can be used to initiate dragging of elements in a data table or list.
|
|
20
|
+
*/
|
|
21
|
+
export declare const DataDragAndDropDragHandler: React.ForwardRefExoticComponent<DataDragAndDropDragHandlerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DataDragAndDropDragHandler = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const aksel_icons_1 = require("@navikt/aksel-icons");
|
|
9
|
+
/**
|
|
10
|
+
* DataDragAndDropDragHandler
|
|
11
|
+
*
|
|
12
|
+
* A button component that serves as a drag handle for drag and drop operations.
|
|
13
|
+
* Can be used to initiate dragging of elements in a data table or list.
|
|
14
|
+
*/
|
|
15
|
+
exports.DataDragAndDropDragHandler = react_1.default.forwardRef(({ keyboardDragging, handleRef }) => {
|
|
16
|
+
return (react_1.default.createElement("div", { className: "aksel-data-drag-and-drop__drag-handler__alt" },
|
|
17
|
+
keyboardDragging && (react_1.default.createElement("span", { className: "aksel-data-drag-and-drop__drag-handler__arrow", "data-direction": "up" },
|
|
18
|
+
react_1.default.createElement(aksel_icons_1.CaretUpCircleFillIcon, { "aria-hidden": true, fontSize: "1.2rem" }))),
|
|
19
|
+
react_1.default.createElement("div", { ref: handleRef, className: "aksel-data-drag-and-drop__drag-handler__button" },
|
|
20
|
+
react_1.default.createElement(aksel_icons_1.DragVerticalIcon, { "aria-hidden": true, title: "Dra for \u00E5 flytte", fontSize: "1.5rem" })),
|
|
21
|
+
keyboardDragging && (react_1.default.createElement("span", { className: "aksel-data-drag-and-drop__drag-handler__arrow", "data-direction": "down" },
|
|
22
|
+
react_1.default.createElement(aksel_icons_1.CaretDownCircleFillIcon, { "aria-hidden": true, fontSize: "1.2rem" })))));
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=DataDragAndDropDragHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataDragAndDropDragHandler.js","sourceRoot":"","sources":["../../../../src/data/drag-and-drop/drag-handler/DataDragAndDropDragHandler.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,qDAI6B;AAiB7B;;;;;GAKG;AACU,QAAA,0BAA0B,GAAG,eAAK,CAAC,UAAU,CAGxD,CAAC,EAAE,gBAAgB,EAAE,SAAS,EAAE,EAAE,EAAE;IACpC,OAAO,CACL,uCAAK,SAAS,EAAC,6CAA6C;QACzD,gBAAgB,IAAI,CACnB,wCACE,SAAS,EAAC,+CAA+C,oBAC1C,IAAI;YAEnB,8BAAC,mCAAqB,yBAAa,QAAQ,EAAC,QAAQ,GAAG,CAClD,CACR;QACD,uCACE,GAAG,EAAE,SAAS,EACd,SAAS,EAAC,gDAAgD;YAE1D,8BAAC,8BAAgB,yBAEf,KAAK,EAAC,uBAAkB,EACxB,QAAQ,EAAC,QAAQ,GACjB,CACE;QACL,gBAAgB,IAAI,CACnB,wCACE,SAAS,EAAC,+CAA+C,oBAC1C,MAAM;YAErB,8BAAC,qCAAuB,yBAAa,QAAQ,EAAC,QAAQ,GAAG,CACpD,CACR,CACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,37 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
36
3
|
var t = {};
|
|
37
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -43,15 +10,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
43
10
|
}
|
|
44
11
|
return t;
|
|
45
12
|
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
46
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
17
|
exports.DataDragAndDropItem = void 0;
|
|
48
|
-
const
|
|
49
|
-
const react_1 = __importStar(require("react"));
|
|
50
|
-
const aksel_icons_1 = require("@navikt/aksel-icons");
|
|
18
|
+
const react_1 = __importDefault(require("react"));
|
|
51
19
|
const stack_1 = require("../../../primitives/stack");
|
|
52
20
|
const helpers_1 = require("../../../utils/helpers");
|
|
53
|
-
const hooks_1 = require("../../../utils/hooks");
|
|
54
|
-
const DataDragAndDrop_context_1 = require("../root/DataDragAndDrop.context");
|
|
55
21
|
/**
|
|
56
22
|
* TODO
|
|
57
23
|
*
|
|
@@ -64,26 +30,10 @@ const DataDragAndDrop_context_1 = require("../root/DataDragAndDrop.context");
|
|
|
64
30
|
* ```
|
|
65
31
|
*/
|
|
66
32
|
const DataDragAndDropItem = react_1.default.forwardRef((_a, forwardedRef) => {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const { ref, isDragging, isDropTarget } = (0, sortable_1.useSortable)({
|
|
70
|
-
id,
|
|
71
|
-
index,
|
|
72
|
-
handle: handleRef,
|
|
73
|
-
});
|
|
74
|
-
const mergedRef = (0, hooks_1.useMergeRefs)(ref, forwardedRef);
|
|
75
|
-
const context = react_1.default.useContext(DataDragAndDrop_context_1.DataDragAndDropContext);
|
|
76
|
-
const mouseDragging = isDragging && (context === null || context === void 0 ? void 0 : context.inputMethod) === "mouse";
|
|
77
|
-
const mouseDropTarget = isDropTarget && (context === null || context === void 0 ? void 0 : context.inputMethod) === "mouse";
|
|
78
|
-
const keyboardDragging = isDragging && (context === null || context === void 0 ? void 0 : context.inputMethod) === "keyboard";
|
|
33
|
+
// const context = useDataDragAndDropContext();
|
|
34
|
+
var { children, className } = _a, rest = __rest(_a, ["children", "className"]);
|
|
79
35
|
return (react_1.default.createElement(stack_1.HStack, { gap: "space-8", align: "center", wrap: false, asChild: true },
|
|
80
|
-
react_1.default.createElement("div", Object.assign({ ref:
|
|
81
|
-
react_1.default.createElement("div", { className: "aksel-data-table__drag-and-drop-item-drag-handler", ref: handleRef },
|
|
82
|
-
keyboardDragging && (react_1.default.createElement("span", { className: "aksel-data-table__drag-and-drop-item-keyboard-drag-icon", "data-direction": "up" },
|
|
83
|
-
react_1.default.createElement(aksel_icons_1.CaretUpCircleFillIcon, { "aria-hidden": true, fontSize: "1.2rem" }))),
|
|
84
|
-
react_1.default.createElement(aksel_icons_1.DragVerticalIcon, { "aria-hidden": true, title: "Dra for \u00E5 flytte", fontSize: "1.5rem" }),
|
|
85
|
-
keyboardDragging && (react_1.default.createElement("span", { className: "aksel-data-table__drag-and-drop-item-keyboard-drag-icon", "data-direction": "down" },
|
|
86
|
-
react_1.default.createElement(aksel_icons_1.CaretDownCircleFillIcon, { "aria-hidden": true, fontSize: "1.2rem" })))),
|
|
36
|
+
react_1.default.createElement("div", Object.assign({ ref: forwardedRef }, rest, { className: (0, helpers_1.cl)("aksel-data-table__drag-and-drop-item", className) }),
|
|
87
37
|
react_1.default.createElement("div", null, children))));
|
|
88
38
|
});
|
|
89
39
|
exports.DataDragAndDropItem = DataDragAndDropItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataDragAndDropItem.js","sourceRoot":"","sources":["../../../../src/data/drag-and-drop/item/DataDragAndDropItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataDragAndDropItem.js","sourceRoot":"","sources":["../../../../src/data/drag-and-drop/item/DataDragAndDropItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,qDAAmD;AACnD,oDAA4C;AAc5C;;;;;;;;;;GAUG;AACH,MAAM,mBAAmB,GAAG,eAAK,CAAC,UAAU,CAG1C,CAAC,EAAgC,EAAE,YAAY,EAAE,EAAE;IACnD,+CAA+C;QAD9C,EAAE,QAAQ,EAAE,SAAS,OAAW,EAAN,IAAI,cAA9B,yBAAgC,CAAF;IAG/B,OAAO,CACL,8BAAC,cAAM,IAAC,GAAG,EAAC,SAAS,EAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAE,KAAK,EAAE,OAAO;QAEvD,qDACE,GAAG,EAAE,YAAY,IACb,IAAI,IACR,SAAS,EAAE,IAAA,YAAE,EAAC,sCAAsC,EAAE,SAAS,CAAC;YAMhE,2CAAM,QAAQ,CAAO,CACjB,CACC,CACV,CAAC;AACJ,CAAC,CAAC,CAAC;AAGM,kDAAmB;AAD5B,kBAAe,mBAAmB,CAAC"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
interface DataDragAndDropContextType {
|
|
2
2
|
inputMethod: "mouse" | "keyboard" | null;
|
|
3
3
|
}
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const DataDragAndDropProvider: import("react").FC<DataDragAndDropContextType & {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
ref?: never;
|
|
7
|
+
}>, useDataDragAndDropContext: <S extends boolean = true>(strict?: S | undefined) => S extends true ? DataDragAndDropContextType | undefined : DataDragAndDropContextType | undefined;
|
|
5
8
|
export {};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
5
|
-
|
|
4
|
+
exports.useDataDragAndDropContext = exports.DataDragAndDropProvider = void 0;
|
|
5
|
+
const helpers_1 = require("../../../utils/helpers");
|
|
6
|
+
_a = (0, helpers_1.createStrictContext)({
|
|
7
|
+
errorMessage: "useDataDragAndDropContext must be used within a DataDragAndDropProvider",
|
|
8
|
+
name: "DataDragAndDropContext",
|
|
9
|
+
}), exports.DataDragAndDropProvider = _a.Provider, exports.useDataDragAndDropContext = _a.useContext;
|
|
6
10
|
//# sourceMappingURL=DataDragAndDrop.context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataDragAndDrop.context.js","sourceRoot":"","sources":["../../../../src/data/drag-and-drop/root/DataDragAndDrop.context.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataDragAndDrop.context.js","sourceRoot":"","sources":["../../../../src/data/drag-and-drop/root/DataDragAndDrop.context.tsx"],"names":[],"mappings":";;;;AAAA,oDAA6D;AAMhD,KAGT,IAAA,6BAAmB,EAAyC;IAC9D,YAAY,EACV,yEAAyE;IAC3E,IAAI,EAAE,wBAAwB;CAC/B,CAAC,EANU,+BAAuB,gBACrB,iCAAyB,iBAKpC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import DataDragAndDropItem, { DataDragAndDropItemProps } from "../item/DataDragAndDropItem";
|
|
3
|
-
interface DataDragAndDropProps extends React.HTMLAttributes<
|
|
3
|
+
interface DataDragAndDropProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
children: any[];
|
|
5
5
|
setItems: React.Dispatch<React.SetStateAction<any[]>>;
|
|
6
6
|
}
|
|
7
|
-
interface DataDragAndDropRootComponent extends React.ForwardRefExoticComponent<DataDragAndDropProps & React.RefAttributes<
|
|
7
|
+
interface DataDragAndDropRootComponent extends React.ForwardRefExoticComponent<DataDragAndDropProps & React.RefAttributes<HTMLDivElement>> {
|
|
8
8
|
/**
|
|
9
9
|
* @see 🏷️ {@link DataDragAndDropItemProps}
|
|
10
10
|
* * @example
|
|
@@ -18,6 +18,16 @@ interface DataDragAndDropRootComponent extends React.ForwardRefExoticComponent<D
|
|
|
18
18
|
*/
|
|
19
19
|
Item: typeof DataDragAndDropItem;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* TODO
|
|
23
|
+
* setItems on root
|
|
24
|
+
* state : active element
|
|
25
|
+
* pointer over listener / state, onPointerEnter, onPointerLeave
|
|
26
|
+
* Overlay - Use floating component
|
|
27
|
+
* Keyboard navigation
|
|
28
|
+
* Handle - button, arrows also button
|
|
29
|
+
* UU - announce on drag start, item moved, drag end
|
|
30
|
+
*/
|
|
21
31
|
declare const DataDragAndDrop: DataDragAndDropRootComponent;
|
|
22
32
|
export { DataDragAndDrop, DataDragAndDropItem };
|
|
23
33
|
export default DataDragAndDrop;
|
|
@@ -32,78 +32,28 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
36
|
-
var t = {};
|
|
37
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
38
|
-
t[p] = s[p];
|
|
39
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
40
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
41
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
42
|
-
t[p[i]] = s[p[i]];
|
|
43
|
-
}
|
|
44
|
-
return t;
|
|
45
|
-
};
|
|
46
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
47
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
48
37
|
};
|
|
49
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
39
|
exports.DataDragAndDropItem = exports.DataDragAndDrop = void 0;
|
|
51
|
-
const react_1 = require("
|
|
52
|
-
const sortable_1 = require("@dnd-kit/react/sortable");
|
|
53
|
-
const react_2 = __importStar(require("react"));
|
|
54
|
-
const stack_1 = require("../../../primitives/stack");
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
55
41
|
const DataDragAndDropItem_1 = __importDefault(require("../item/DataDragAndDropItem"));
|
|
56
42
|
exports.DataDragAndDropItem = DataDragAndDropItem_1.default;
|
|
57
43
|
const DataDragAndDrop_context_1 = require("./DataDragAndDrop.context");
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return (
|
|
70
|
-
|
|
71
|
-
// TODO Look into overriding default keybinds, might eliminate context need
|
|
72
|
-
, {
|
|
73
|
-
// TODO Look into overriding default keybinds, might eliminate context need
|
|
74
|
-
onBeforeDragStart: (event) => {
|
|
75
|
-
var _a;
|
|
76
|
-
return setInputMethod(((_a = event.operation.activatorEvent) === null || _a === void 0 ? void 0 : _a.type) === "pointerdown"
|
|
77
|
-
? "mouse"
|
|
78
|
-
: "keyboard");
|
|
79
|
-
}, onDragOver: (event) => {
|
|
80
|
-
var _a;
|
|
81
|
-
if (((_a = event.operation.activatorEvent) === null || _a === void 0 ? void 0 : _a.type) === "pointerdown") {
|
|
82
|
-
// Prevents items to rearrange while dragging with mouse, but allows keyboard dragging to work as intended
|
|
83
|
-
event.preventDefault();
|
|
84
|
-
}
|
|
85
|
-
}, onDragEnd: (event) => {
|
|
86
|
-
var _a;
|
|
87
|
-
if (((_a = event.operation.activatorEvent) === null || _a === void 0 ? void 0 : _a.type) === "pointerdown") {
|
|
88
|
-
const { source, target } = event.operation;
|
|
89
|
-
if (!(0, sortable_1.isSortable)(source) || !(0, sortable_1.isSortable)(target))
|
|
90
|
-
return;
|
|
91
|
-
setItemOrder(source.initialIndex, target.index);
|
|
92
|
-
}
|
|
93
|
-
} },
|
|
94
|
-
react_2.default.createElement(stack_1.VStack, { asChild: true, gap: "space-12" },
|
|
95
|
-
react_2.default.createElement("div", Object.assign({}, rest, { ref: forwardedRef }), children)),
|
|
96
|
-
react_2.default.createElement(react_1.DragOverlay, null, (source) => {
|
|
97
|
-
// Overlay not needed and causes glitching when using keyboard
|
|
98
|
-
if (inputMethod === "keyboard")
|
|
99
|
-
return null;
|
|
100
|
-
if (!(0, sortable_1.isSortable)(source))
|
|
101
|
-
return null;
|
|
102
|
-
if ((0, react_2.isValidElement)(children[source.initialIndex])) {
|
|
103
|
-
return children[source.initialIndex];
|
|
104
|
-
}
|
|
105
|
-
return null;
|
|
106
|
-
}))));
|
|
44
|
+
/**
|
|
45
|
+
* TODO
|
|
46
|
+
* setItems on root
|
|
47
|
+
* state : active element
|
|
48
|
+
* pointer over listener / state, onPointerEnter, onPointerLeave
|
|
49
|
+
* Overlay - Use floating component
|
|
50
|
+
* Keyboard navigation
|
|
51
|
+
* Handle - button, arrows also button
|
|
52
|
+
* UU - announce on drag start, item moved, drag end
|
|
53
|
+
*/
|
|
54
|
+
const DataDragAndDrop = (0, react_1.forwardRef)(({ children }, forwardedRef) => {
|
|
55
|
+
return (react_1.default.createElement(DataDragAndDrop_context_1.DataDragAndDropProvider, { inputMethod: null },
|
|
56
|
+
react_1.default.createElement("div", { ref: forwardedRef }, children)));
|
|
107
57
|
});
|
|
108
58
|
exports.DataDragAndDrop = DataDragAndDrop;
|
|
109
59
|
DataDragAndDrop.Item = DataDragAndDropItem_1.default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataDragAndDropRoot.js","sourceRoot":"","sources":["../../../../src/data/drag-and-drop/root/DataDragAndDropRoot.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataDragAndDropRoot.js","sourceRoot":"","sources":["../../../../src/data/drag-and-drop/root/DataDragAndDropRoot.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAC1C,sFAEqC;AAgDX,8BAlDnB,6BAAmB,CAkDmB;AA/C7C,uEAAoE;AAwBpE;;;;;;;;;GASG;AAEH,MAAM,eAAe,GAAG,IAAA,kBAAU,EAChC,CAAC,EAAE,QAAQ,EAAE,EAAE,YAAY,EAAE,EAAE;IAC7B,OAAO,CACL,8BAAC,iDAAuB,IAAC,WAAW,EAAE,IAAI;QACxC,uCAAK,GAAG,EAAE,YAAY,IAAG,QAAQ,CAAO,CAChB,CAC3B,CAAC;AACJ,CAAC,CAC8B,CAAC;AAIzB,0CAAe;AAFxB,eAAe,CAAC,IAAI,GAAG,6BAAmB,CAAC;AAG3C,kBAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface DataDragAndDropDragHandlerProps {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the drag handler is disabled
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Wether dragging is done by keyboard. Used to conditionally render drag indicators.
|
|
8
|
+
*/
|
|
9
|
+
keyboardDragging?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Handle ref is forwarded to the button element serving as drag handle.
|
|
12
|
+
*/
|
|
13
|
+
handleRef: React.Ref<HTMLDivElement>;
|
|
14
|
+
alt?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* DataDragAndDropDragHandler
|
|
18
|
+
*
|
|
19
|
+
* A button component that serves as a drag handle for drag and drop operations.
|
|
20
|
+
* Can be used to initiate dragging of elements in a data table or list.
|
|
21
|
+
*/
|
|
22
|
+
export declare const DataDragAndDropDragHandler: React.ForwardRefExoticComponent<DataDragAndDropDragHandlerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DataDragAndDropDragHandler = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const aksel_icons_1 = require("@navikt/aksel-icons");
|
|
9
|
+
const Floating_1 = require("../../../utils/components/floating/Floating");
|
|
10
|
+
/**
|
|
11
|
+
* DataDragAndDropDragHandler
|
|
12
|
+
*
|
|
13
|
+
* A button component that serves as a drag handle for drag and drop operations.
|
|
14
|
+
* Can be used to initiate dragging of elements in a data table or list.
|
|
15
|
+
*/
|
|
16
|
+
exports.DataDragAndDropDragHandler = react_1.default.forwardRef(({ keyboardDragging, handleRef, alt }) => {
|
|
17
|
+
if (alt) {
|
|
18
|
+
return (react_1.default.createElement("div", { className: "aksel-data-drag-and-drop__drag-handler__alt" },
|
|
19
|
+
keyboardDragging && (react_1.default.createElement("span", { className: "aksel-data-drag-and-drop__drag-handler__arrow", "data-direction": "up" },
|
|
20
|
+
react_1.default.createElement(aksel_icons_1.CaretUpCircleFillIcon, { "aria-hidden": true, fontSize: "1.2rem" }))),
|
|
21
|
+
react_1.default.createElement("div", { ref: handleRef, className: "aksel-data-drag-and-drop__drag-handler__button" },
|
|
22
|
+
react_1.default.createElement(aksel_icons_1.DragVerticalIcon, { "aria-hidden": true, title: "Dra for \u00E5 flytte", fontSize: "1.5rem" })),
|
|
23
|
+
keyboardDragging && (react_1.default.createElement("span", { className: "aksel-data-drag-and-drop__drag-handler__arrow", "data-direction": "down" },
|
|
24
|
+
react_1.default.createElement(aksel_icons_1.CaretDownCircleFillIcon, { "aria-hidden": true, fontSize: "1.2rem" })))));
|
|
25
|
+
}
|
|
26
|
+
return (react_1.default.createElement(Floating_1.Floating, null,
|
|
27
|
+
keyboardDragging && (react_1.default.createElement(Floating_1.Floating.Content, { side: "top", avoidCollisions: false, updatePositionStrategy: "always", className: "aksel-data-drag-and-drop__drag-handler__arrow" },
|
|
28
|
+
react_1.default.createElement(aksel_icons_1.CaretUpCircleFillIcon, { "aria-hidden": true, fontSize: "1.2rem" }))),
|
|
29
|
+
react_1.default.createElement(Floating_1.Floating.Anchor, { asChild: true },
|
|
30
|
+
react_1.default.createElement("div", { ref: handleRef, className: "aksel-data-drag-and-drop__drag-handler__button" },
|
|
31
|
+
react_1.default.createElement(aksel_icons_1.DragVerticalIcon, { "aria-hidden": true, title: "Dra for \u00E5 flytte", fontSize: "1.5rem" }))),
|
|
32
|
+
keyboardDragging && (react_1.default.createElement(Floating_1.Floating.Content, { avoidCollisions: false, updatePositionStrategy: "always", className: "aksel-data-drag-and-drop__drag-handler__arrow" },
|
|
33
|
+
react_1.default.createElement(aksel_icons_1.CaretDownCircleFillIcon, { "aria-hidden": true, fontSize: "1.2rem" })))));
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=DataDragAndDropDragHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataDragAndDropDragHandler.js","sourceRoot":"","sources":["../../../../src/data/drag-and-drop-old/drag-handler/DataDragAndDropDragHandler.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,qDAI6B;AAC7B,0EAAuE;AAmBvE;;;;;GAKG;AACU,QAAA,0BAA0B,GAAG,eAAK,CAAC,UAAU,CAGxD,CAAC,EAAE,gBAAgB,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,EAAE;IACzC,IAAI,GAAG,EAAE,CAAC;QACR,OAAO,CACL,uCAAK,SAAS,EAAC,6CAA6C;YACzD,gBAAgB,IAAI,CACnB,wCACE,SAAS,EAAC,+CAA+C,oBAC1C,IAAI;gBAEnB,8BAAC,mCAAqB,yBAAa,QAAQ,EAAC,QAAQ,GAAG,CAClD,CACR;YACD,uCACE,GAAG,EAAE,SAAS,EACd,SAAS,EAAC,gDAAgD;gBAE1D,8BAAC,8BAAgB,yBAEf,KAAK,EAAC,uBAAkB,EACxB,QAAQ,EAAC,QAAQ,GACjB,CACE;YACL,gBAAgB,IAAI,CACnB,wCACE,SAAS,EAAC,+CAA+C,oBAC1C,MAAM;gBAErB,8BAAC,qCAAuB,yBAAa,QAAQ,EAAC,QAAQ,GAAG,CACpD,CACR,CACG,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,8BAAC,mBAAQ;QACN,gBAAgB,IAAI,CACnB,8BAAC,mBAAQ,CAAC,OAAO,IACf,IAAI,EAAC,KAAK,EACV,eAAe,EAAE,KAAK,EACtB,sBAAsB,EAAC,QAAQ,EAC/B,SAAS,EAAC,+CAA+C;YAEzD,8BAAC,mCAAqB,yBAAa,QAAQ,EAAC,QAAQ,GAAG,CACtC,CACpB;QACD,8BAAC,mBAAQ,CAAC,MAAM,IAAC,OAAO;YACtB,uCACE,GAAG,EAAE,SAAS,EACd,SAAS,EAAC,gDAAgD;gBAE1D,8BAAC,8BAAgB,yBAEf,KAAK,EAAC,uBAAkB,EACxB,QAAQ,EAAC,QAAQ,GACjB,CACE,CACU;QACjB,gBAAgB,IAAI,CACnB,8BAAC,mBAAQ,CAAC,OAAO,IACf,eAAe,EAAE,KAAK,EACtB,sBAAsB,EAAC,QAAQ,EAC/B,SAAS,EAAC,+CAA+C;YAEzD,8BAAC,qCAAuB,yBAAa,QAAQ,EAAC,QAAQ,GAAG,CACxC,CACpB,CACQ,CACZ,CAAC;AACJ,CAAC,CAAC,CAAC"}
|