@navikt/ds-react 8.6.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.d.ts +27 -0
- package/cjs/data/drag-and-drop/item/DataDragAndDropItem.js +41 -0
- package/cjs/data/drag-and-drop/item/DataDragAndDropItem.js.map +1 -0
- package/cjs/data/drag-and-drop/root/DataDragAndDrop.context.d.ts +8 -0
- package/cjs/data/drag-and-drop/root/DataDragAndDrop.context.js +10 -0
- package/cjs/data/drag-and-drop/root/DataDragAndDrop.context.js.map +1 -0
- package/cjs/data/drag-and-drop/root/DataDragAndDropRoot.d.ts +34 -0
- package/cjs/data/drag-and-drop/root/DataDragAndDropRoot.js +61 -0
- package/cjs/data/drag-and-drop/root/DataDragAndDropRoot.js.map +1 -0
- 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.js +1 -1
- 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 +9 -0
- package/cjs/data/table/root/DataTableRoot.context.js +11 -0
- package/cjs/data/table/root/DataTableRoot.context.js.map +1 -0
- package/cjs/data/table/root/DataTableRoot.d.ts +30 -3
- package/cjs/data/table/root/DataTableRoot.js +12 -4
- 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 +27 -5
- package/cjs/data/table/th/DataTableTh.js +49 -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 +10 -2
- package/cjs/data/table/tr/DataTableTr.js.map +1 -1
- package/cjs/data/token-filter/AutoSuggest.d.ts +6 -2
- package/cjs/data/token-filter/AutoSuggest.js +44 -11
- package/cjs/data/token-filter/AutoSuggest.js.map +1 -1
- package/cjs/data/token-filter/TokenFilter.d.ts +5 -5
- package/cjs/data/token-filter/TokenFilter.js +105 -42
- package/cjs/data/token-filter/TokenFilter.js.map +1 -1
- package/cjs/data/token-filter/TokenFilter.types.d.ts +51 -33
- package/cjs/data/token-filter/helpers/generate-autocomplete-options.d.ts +2 -3
- package/cjs/data/token-filter/helpers/generate-autocomplete-options.js +11 -15
- package/cjs/data/token-filter/helpers/generate-autocomplete-options.js.map +1 -1
- package/cjs/data/token-filter/helpers/operators.d.ts +6 -6
- package/cjs/data/token-filter/helpers/operators.js +3 -4
- package/cjs/data/token-filter/helpers/operators.js.map +1 -1
- package/cjs/data/token-filter/helpers/parse-query-text.d.ts +2 -20
- package/cjs/data/token-filter/helpers/parse-query-text.js +1 -1
- package/cjs/data/token-filter/helpers/parse-query-text.js.map +1 -1
- package/cjs/data/token-filter/helpers/query-builder.d.ts +2 -2
- package/cjs/data/token-filter/helpers/query-builder.js.map +1 -1
- package/cjs/date/Date.Dialog.d.ts +5 -1
- package/cjs/date/Date.Dialog.js +6 -2
- package/cjs/date/Date.Dialog.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/DatePicker.js +3 -2
- package/cjs/date/datepicker/DatePicker.js.map +1 -1
- package/cjs/date/datepicker/hooks/useDatepicker.d.ts +12 -1
- package/cjs/date/datepicker/hooks/useDatepicker.js +5 -2
- package/cjs/date/datepicker/hooks/useDatepicker.js.map +1 -1
- package/cjs/date/datepicker/hooks/useRangeDatepicker.js +3 -1
- package/cjs/date/datepicker/hooks/useRangeDatepicker.js.map +1 -1
- package/cjs/date/datepicker/parts/DatePicker.Months.d.ts +2 -1
- package/cjs/date/datepicker/parts/DatePicker.Months.js +3 -3
- package/cjs/date/datepicker/parts/DatePicker.Months.js.map +1 -1
- package/cjs/date/datepicker/parts/DatePicker.RDP.d.ts +5 -1
- package/cjs/date/datepicker/parts/DatePicker.RDP.js +2 -2
- package/cjs/date/datepicker/parts/DatePicker.RDP.js.map +1 -1
- package/cjs/date/monthpicker/MonthPicker.js +3 -2
- package/cjs/date/monthpicker/MonthPicker.js.map +1 -1
- package/cjs/date/monthpicker/hooks/useMonthPicker.d.ts +11 -1
- package/cjs/date/monthpicker/hooks/useMonthPicker.js +3 -1
- package/cjs/date/monthpicker/hooks/useMonthPicker.js.map +1 -1
- package/cjs/date/monthpicker/parts/MonthPicker.Caption.d.ts +4 -1
- package/cjs/date/monthpicker/parts/MonthPicker.Caption.js +3 -2
- package/cjs/date/monthpicker/parts/MonthPicker.Caption.js.map +1 -1
- package/cjs/dropdown/Toggle.js +5 -12
- package/cjs/dropdown/Toggle.js.map +1 -1
- package/cjs/form/checkbox/CheckboxGroup.js +1 -1
- package/cjs/form/checkbox/CheckboxGroup.js.map +1 -1
- package/cjs/form/combobox/Input/Input.js +1 -1
- package/cjs/form/combobox/Input/Input.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/inline-message/root/InlineMessage.js +2 -2
- package/cjs/inline-message/root/InlineMessage.js.map +1 -1
- package/cjs/provider/Provider.d.ts +2 -2
- 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/tooltip/Tooltip.js +1 -3
- package/cjs/tooltip/Tooltip.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/HighlightText/HighlightText.d.ts +8 -0
- package/cjs/utils/components/HighlightText/HighlightText.js +27 -0
- package/cjs/utils/components/HighlightText/HighlightText.js.map +1 -0
- package/cjs/utils/components/Listbox/group/ListboxGroup.d.ts +7 -0
- package/cjs/utils/components/Listbox/group/ListboxGroup.js +15 -0
- package/cjs/utils/components/Listbox/group/ListboxGroup.js.map +1 -0
- package/cjs/utils/components/Listbox/input-slot/ListboxInputSlot.d.ts +7 -0
- package/cjs/utils/components/Listbox/input-slot/ListboxInputSlot.js +15 -0
- package/cjs/utils/components/Listbox/input-slot/ListboxInputSlot.js.map +1 -0
- package/cjs/utils/components/Listbox/option/ListboxOption.d.ts +24 -0
- package/cjs/utils/components/Listbox/option/ListboxOption.js +33 -0
- 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/options/ListboxOptions.js +32 -0
- package/cjs/utils/components/Listbox/options/ListboxOptions.js.map +1 -0
- package/cjs/utils/components/Listbox/root/ListboxRoot.d.ts +20 -0
- package/cjs/utils/components/Listbox/root/ListboxRoot.js +84 -0
- package/cjs/utils/components/Listbox/root/ListboxRoot.js.map +1 -0
- package/cjs/utils/components/Listbox/root/domHelpers.d.ts +3 -0
- package/cjs/utils/components/Listbox/root/domHelpers.js +53 -0
- package/cjs/utils/components/Listbox/root/domHelpers.js.map +1 -0
- 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 +9 -64
- 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 +16 -0
- package/cjs/utils/helpers/focus.js +63 -0
- package/cjs/utils/helpers/focus.js.map +1 -0
- 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/useDeferredValue.d.ts +1 -0
- package/cjs/utils/hooks/useDeferredValue.js +14 -0
- package/cjs/utils/hooks/useDeferredValue.js.map +1 -0
- 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.d.ts +27 -0
- package/esm/data/drag-and-drop/item/DataDragAndDropItem.js +35 -0
- package/esm/data/drag-and-drop/item/DataDragAndDropItem.js.map +1 -0
- package/esm/data/drag-and-drop/root/DataDragAndDrop.context.d.ts +8 -0
- package/esm/data/drag-and-drop/root/DataDragAndDrop.context.js +6 -0
- package/esm/data/drag-and-drop/root/DataDragAndDrop.context.js.map +1 -0
- package/esm/data/drag-and-drop/root/DataDragAndDropRoot.d.ts +34 -0
- package/esm/data/drag-and-drop/root/DataDragAndDropRoot.js +21 -0
- package/esm/data/drag-and-drop/root/DataDragAndDropRoot.js.map +1 -0
- 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.js +1 -1
- 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 +9 -0
- package/esm/data/table/root/DataTableRoot.context.js +7 -0
- package/esm/data/table/root/DataTableRoot.context.js.map +1 -0
- package/esm/data/table/root/DataTableRoot.d.ts +30 -3
- package/esm/data/table/root/DataTableRoot.js +10 -4
- 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 +27 -5
- package/esm/data/table/th/DataTableTh.js +51 -24
- 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 +10 -2
- package/esm/data/table/tr/DataTableTr.js.map +1 -1
- package/esm/data/token-filter/AutoSuggest.d.ts +6 -2
- package/esm/data/token-filter/AutoSuggest.js +43 -13
- package/esm/data/token-filter/AutoSuggest.js.map +1 -1
- package/esm/data/token-filter/TokenFilter.d.ts +5 -5
- package/esm/data/token-filter/TokenFilter.js +105 -42
- package/esm/data/token-filter/TokenFilter.js.map +1 -1
- package/esm/data/token-filter/TokenFilter.types.d.ts +51 -33
- package/esm/data/token-filter/helpers/generate-autocomplete-options.d.ts +2 -3
- package/esm/data/token-filter/helpers/generate-autocomplete-options.js +11 -15
- package/esm/data/token-filter/helpers/generate-autocomplete-options.js.map +1 -1
- package/esm/data/token-filter/helpers/operators.d.ts +6 -6
- package/esm/data/token-filter/helpers/operators.js +3 -4
- package/esm/data/token-filter/helpers/operators.js.map +1 -1
- package/esm/data/token-filter/helpers/parse-query-text.d.ts +2 -20
- package/esm/data/token-filter/helpers/parse-query-text.js +1 -1
- package/esm/data/token-filter/helpers/parse-query-text.js.map +1 -1
- package/esm/data/token-filter/helpers/query-builder.d.ts +2 -2
- package/esm/data/token-filter/helpers/query-builder.js.map +1 -1
- package/esm/date/Date.Dialog.d.ts +5 -1
- package/esm/date/Date.Dialog.js +6 -2
- package/esm/date/Date.Dialog.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/DatePicker.js +3 -2
- package/esm/date/datepicker/DatePicker.js.map +1 -1
- package/esm/date/datepicker/hooks/useDatepicker.d.ts +12 -1
- package/esm/date/datepicker/hooks/useDatepicker.js +5 -2
- package/esm/date/datepicker/hooks/useDatepicker.js.map +1 -1
- package/esm/date/datepicker/hooks/useRangeDatepicker.js +3 -1
- package/esm/date/datepicker/hooks/useRangeDatepicker.js.map +1 -1
- package/esm/date/datepicker/parts/DatePicker.Months.d.ts +2 -1
- package/esm/date/datepicker/parts/DatePicker.Months.js +3 -3
- package/esm/date/datepicker/parts/DatePicker.Months.js.map +1 -1
- package/esm/date/datepicker/parts/DatePicker.RDP.d.ts +5 -1
- package/esm/date/datepicker/parts/DatePicker.RDP.js +2 -2
- package/esm/date/datepicker/parts/DatePicker.RDP.js.map +1 -1
- package/esm/date/monthpicker/MonthPicker.js +3 -2
- package/esm/date/monthpicker/MonthPicker.js.map +1 -1
- package/esm/date/monthpicker/hooks/useMonthPicker.d.ts +11 -1
- package/esm/date/monthpicker/hooks/useMonthPicker.js +3 -1
- package/esm/date/monthpicker/hooks/useMonthPicker.js.map +1 -1
- package/esm/date/monthpicker/parts/MonthPicker.Caption.d.ts +4 -1
- package/esm/date/monthpicker/parts/MonthPicker.Caption.js +3 -2
- package/esm/date/monthpicker/parts/MonthPicker.Caption.js.map +1 -1
- package/esm/dropdown/Toggle.js +5 -12
- package/esm/dropdown/Toggle.js.map +1 -1
- package/esm/form/checkbox/CheckboxGroup.js +1 -1
- package/esm/form/checkbox/CheckboxGroup.js.map +1 -1
- package/esm/form/combobox/Input/Input.js +1 -1
- package/esm/form/combobox/Input/Input.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/inline-message/root/InlineMessage.js +3 -3
- package/esm/inline-message/root/InlineMessage.js.map +1 -1
- package/esm/provider/Provider.d.ts +2 -2
- 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/tooltip/Tooltip.js +1 -3
- package/esm/tooltip/Tooltip.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/HighlightText/HighlightText.d.ts +8 -0
- package/esm/utils/components/HighlightText/HighlightText.js +21 -0
- package/esm/utils/components/HighlightText/HighlightText.js.map +1 -0
- package/esm/utils/components/Listbox/group/ListboxGroup.d.ts +7 -0
- package/esm/utils/components/Listbox/group/ListboxGroup.js +10 -0
- package/esm/utils/components/Listbox/group/ListboxGroup.js.map +1 -0
- package/esm/utils/components/Listbox/input-slot/ListboxInputSlot.d.ts +7 -0
- package/esm/utils/components/Listbox/input-slot/ListboxInputSlot.js +9 -0
- package/esm/utils/components/Listbox/input-slot/ListboxInputSlot.js.map +1 -0
- package/esm/utils/components/Listbox/option/ListboxOption.d.ts +24 -0
- package/esm/utils/components/Listbox/option/ListboxOption.js +27 -0
- 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/options/ListboxOptions.js +27 -0
- package/esm/utils/components/Listbox/options/ListboxOptions.js.map +1 -0
- package/esm/utils/components/Listbox/root/ListboxRoot.d.ts +20 -0
- package/esm/utils/components/Listbox/root/ListboxRoot.js +79 -0
- package/esm/utils/components/Listbox/root/ListboxRoot.js.map +1 -0
- package/esm/utils/components/Listbox/root/domHelpers.d.ts +3 -0
- package/esm/utils/components/Listbox/root/domHelpers.js +50 -0
- package/esm/utils/components/Listbox/root/domHelpers.js.map +1 -0
- 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 +9 -64
- 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 +16 -0
- package/esm/utils/helpers/focus.js +60 -0
- package/esm/utils/helpers/focus.js.map +1 -0
- 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/useDeferredValue.d.ts +1 -0
- package/esm/utils/hooks/useDeferredValue.js +7 -0
- package/esm/utils/hooks/useDeferredValue.js.map +1 -0
- package/esm/utils/hooks/useScrollLock.js +41 -11
- package/esm/utils/hooks/useScrollLock.js.map +1 -1
- package/package.json +9 -9
- 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 +54 -0
- package/src/data/drag-and-drop/root/DataDragAndDrop.context.tsx +14 -0
- package/src/data/drag-and-drop/root/DataDragAndDropRoot.tsx +54 -0
- 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 +1 -1
- 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 +14 -0
- package/src/data/table/root/DataTableRoot.tsx +60 -14
- 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 +133 -65
- 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 +18 -2
- package/src/data/token-filter/AutoSuggest.tsx +141 -29
- package/src/data/token-filter/TokenFilter.tsx +174 -79
- package/src/data/token-filter/TokenFilter.types.ts +70 -42
- package/src/data/token-filter/helpers/generate-autocomplete-options.test.ts +97 -97
- package/src/data/token-filter/helpers/generate-autocomplete-options.ts +31 -38
- package/src/data/token-filter/helpers/operators.test.ts +29 -29
- package/src/data/token-filter/helpers/operators.ts +16 -16
- package/src/data/token-filter/helpers/parse-query-text.test.ts +37 -35
- package/src/data/token-filter/helpers/parse-query-text.ts +7 -26
- package/src/data/token-filter/helpers/query-builder.ts +2 -2
- package/src/date/Date.Dialog.tsx +15 -0
- package/src/date/Date.Input.tsx +1 -1
- package/src/date/datepicker/DatePicker.tsx +3 -0
- package/src/date/datepicker/hooks/useDatepicker.tsx +19 -3
- package/src/date/datepicker/hooks/useRangeDatepicker.tsx +5 -1
- package/src/date/datepicker/parts/DatePicker.Months.tsx +9 -1
- package/src/date/datepicker/parts/DatePicker.RDP.tsx +7 -1
- package/src/date/monthpicker/MonthPicker.tsx +3 -1
- package/src/date/monthpicker/hooks/useMonthPicker.tsx +16 -2
- package/src/date/monthpicker/parts/MonthPicker.Caption.tsx +20 -2
- package/src/dropdown/Toggle.tsx +6 -12
- package/src/form/checkbox/CheckboxGroup.tsx +1 -1
- package/src/form/combobox/Input/Input.tsx +2 -2
- package/src/form/fieldset/Fieldset.tsx +31 -7
- package/src/form/radio/RadioGroup.tsx +1 -1
- package/src/index.ts +1 -0
- package/src/inline-message/root/InlineMessage.tsx +5 -5
- package/src/provider/Provider.tsx +2 -2
- package/src/read-more/ReadMore.tsx +15 -16
- package/src/tooltip/Tooltip.tsx +1 -3
- package/src/types/index.ts +1 -1
- package/src/utils/components/HighlightText/HighlightText.tsx +34 -0
- package/src/utils/components/Listbox/group/ListboxGroup.tsx +26 -0
- package/src/utils/components/Listbox/input-slot/ListboxInputSlot.tsx +22 -0
- package/src/utils/components/Listbox/option/ListboxOption.tsx +57 -0
- package/src/utils/components/Listbox/options/ListboxOptions.tsx +38 -0
- package/src/utils/components/Listbox/root/ListboxRoot.tsx +104 -0
- package/src/utils/components/Listbox/root/domHelpers.ts +60 -0
- package/src/utils/components/floating/Floating.tsx +2 -2
- package/src/utils/components/focus-boundary/FocusBoundary.tsx +9 -80
- package/src/utils/components/link-anchor/LinkAnchor.tsx +11 -0
- package/src/utils/helpers/className.ts +1 -1
- package/src/utils/helpers/focus.ts +78 -0
- package/src/utils/helpers/index.ts +9 -9
- package/src/utils/hooks/index.ts +20 -13
- package/src/utils/hooks/useDeferredValue.ts +12 -0
- package/src/utils/hooks/useScrollLock.ts +57 -13
- package/cjs/data/table/th/DataTableThSortHandle.d.ts +0 -6
- package/cjs/data/table/th/DataTableThSortHandle.js +0 -82
- package/cjs/data/table/th/DataTableThSortHandle.js.map +0 -1
- package/esm/data/table/th/DataTableThSortHandle.d.ts +0 -6
- package/esm/data/table/th/DataTableThSortHandle.js +0 -47
- package/esm/data/table/th/DataTableThSortHandle.js.map +0 -1
- package/src/data/table/th/DataTableThSortHandle.tsx +0 -67
|
@@ -7,6 +7,34 @@ const useTimeout_1 = require("./useTimeout");
|
|
|
7
7
|
let originalHtmlStyles = {};
|
|
8
8
|
let originalBodyStyles = {};
|
|
9
9
|
let originalHtmlScrollBehavior = "";
|
|
10
|
+
function supportsStableScrollbarGutter(referenceElement) {
|
|
11
|
+
const supported = typeof CSS !== "undefined" &&
|
|
12
|
+
CSS.supports &&
|
|
13
|
+
CSS.supports("scrollbar-gutter", "stable");
|
|
14
|
+
if (!supported || typeof document === "undefined") {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
/*
|
|
18
|
+
* We need to do aditional checks since the scenario:
|
|
19
|
+
* - Scrollbar is edited with `::-webkit-scrollbar`
|
|
20
|
+
* - MacOS setting: Show scroll bars -> Automatically based on mouse or tracked
|
|
21
|
+
* Causes the calculation of scrollbar width to be incorrect, and thus the scrollbar gutter to not work as intended.
|
|
22
|
+
*/
|
|
23
|
+
const doc = (0, helpers_1.ownerDocument)(referenceElement);
|
|
24
|
+
const html = doc.documentElement;
|
|
25
|
+
const body = doc.body;
|
|
26
|
+
const scrollContainer = isOverflowElement(html) ? html : body;
|
|
27
|
+
const originalScrollContainerOverflowY = scrollContainer.style.overflowY;
|
|
28
|
+
const originalHtmlStyleGutter = html.style.scrollbarGutter;
|
|
29
|
+
html.style.scrollbarGutter = "stable";
|
|
30
|
+
scrollContainer.style.overflowY = "scroll";
|
|
31
|
+
const before = scrollContainer.offsetWidth;
|
|
32
|
+
scrollContainer.style.overflowY = "hidden";
|
|
33
|
+
const after = scrollContainer.offsetWidth;
|
|
34
|
+
scrollContainer.style.overflowY = originalScrollContainerOverflowY;
|
|
35
|
+
html.style.scrollbarGutter = originalHtmlStyleGutter;
|
|
36
|
+
return before === after;
|
|
37
|
+
}
|
|
10
38
|
function hasInsetScrollbars(referenceElement) {
|
|
11
39
|
if (typeof document === "undefined") {
|
|
12
40
|
return false;
|
|
@@ -51,9 +79,11 @@ function preventScrollStandard(referenceElement) {
|
|
|
51
79
|
*/
|
|
52
80
|
function lockScroll() {
|
|
53
81
|
/* DOM reads: */
|
|
54
|
-
var _a;
|
|
55
82
|
const htmlStyles = win.getComputedStyle(html);
|
|
56
83
|
const bodyStyles = win.getComputedStyle(body);
|
|
84
|
+
const htmlScrollbarGutterValue = htmlStyles.scrollbarGutter || "";
|
|
85
|
+
const hasBothEdges = htmlScrollbarGutterValue.includes("both-edges");
|
|
86
|
+
const scrollbarGutterValue = hasBothEdges ? "stable both-edges" : "stable";
|
|
57
87
|
scrollTop = html.scrollTop;
|
|
58
88
|
scrollLeft = html.scrollLeft;
|
|
59
89
|
originalHtmlStyles = {
|
|
@@ -87,22 +117,22 @@ function preventScrollStandard(referenceElement) {
|
|
|
87
117
|
/**
|
|
88
118
|
* Check support for stable scrollbar gutter to avoid layout shift when scrollbars appear/disappear.
|
|
89
119
|
*/
|
|
90
|
-
const
|
|
91
|
-
((_a = CSS.supports) === null || _a === void 0 ? void 0 : _a.call(CSS, "scrollbar-gutter", "stable"));
|
|
120
|
+
const supportsScrollbarGutter = supportsStableScrollbarGutter(referenceElement);
|
|
92
121
|
/*
|
|
93
122
|
* DOM writes:
|
|
94
123
|
* Do not read the DOM past this point!
|
|
95
124
|
*/
|
|
125
|
+
if (supportsScrollbarGutter) {
|
|
126
|
+
const elementToLock = isOverflowElement(html) ? html : body;
|
|
127
|
+
html.style.scrollbarGutter = scrollbarGutterValue;
|
|
128
|
+
elementToLock.style.overflowY = "hidden";
|
|
129
|
+
elementToLock.style.overflowX = "hidden";
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
96
132
|
Object.assign(html.style, {
|
|
97
133
|
scrollbarGutter: "stable",
|
|
98
|
-
overflowY:
|
|
99
|
-
|
|
100
|
-
? "scroll"
|
|
101
|
-
: "hidden",
|
|
102
|
-
overflowX: !supportsStableScrollbarGutter &&
|
|
103
|
-
(isScrollableX || hasConstantOverflowX)
|
|
104
|
-
? "scroll"
|
|
105
|
-
: "hidden",
|
|
134
|
+
overflowY: isScrollableY || hasConstantOverflowY ? "scroll" : "hidden",
|
|
135
|
+
overflowX: isScrollableX || hasConstantOverflowX ? "scroll" : "hidden",
|
|
106
136
|
});
|
|
107
137
|
Object.assign(body.style, {
|
|
108
138
|
/*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScrollLock.js","sourceRoot":"","sources":["../../../src/utils/hooks/useScrollLock.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"useScrollLock.js","sourceRoot":"","sources":["../../../src/utils/hooks/useScrollLock.ts"],"names":[],"mappings":";;AAyXS,sCAAa;AAzXtB,yDAA6D;AAC7D,wCAAyE;AACzE,6CAAuC;AAEvC,IAAI,kBAAkB,GAAiC,EAAE,CAAC;AAC1D,IAAI,kBAAkB,GAAiC,EAAE,CAAC;AAC1D,IAAI,0BAA0B,GAAG,EAAE,CAAC;AAEpC,SAAS,6BAA6B,CAAC,gBAAgC;IACrE,MAAM,SAAS,GACb,OAAO,GAAG,KAAK,WAAW;QAC1B,GAAG,CAAC,QAAQ;QACZ,GAAG,CAAC,QAAQ,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;IAE7C,IAAI,CAAC,SAAS,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;QAClD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IAEH,MAAM,GAAG,GAAG,IAAA,uBAAa,EAAC,gB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AAC,GAAG,CAAC,OAAO,CAAC,CAC3C,CAAC;AACJ,CAAC"}
|
|
@@ -21,8 +21,7 @@ const BaseAlert = forwardRef((_a, forwardedRef) => {
|
|
|
21
21
|
const translate = useI18n("global");
|
|
22
22
|
const alertColor = status ? baseAlertStatusToDataColor(status) : dataColor;
|
|
23
23
|
return (React.createElement(BaseAlertProvider, { size: size, status: status, color: alertColor, statusId: type === "strong" ? statusId : undefined },
|
|
24
|
-
React.createElement(Component, Object.assign({ "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : (!status || Component === "div" ? undefined : translate(status)), ref: forwardedRef }, restProps, { className: cl(className, "aksel-base-alert"), "data-size": size, "data-color": alertColor, "data-variant": type, "data-global": global }),
|
|
25
|
-
React.createElement("div", { role: role }, children))));
|
|
24
|
+
React.createElement(Component, Object.assign({ "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : (!status || Component === "div" ? undefined : translate(status)), ref: forwardedRef }, restProps, { className: cl(className, "aksel-base-alert"), "data-size": size, "data-color": alertColor, "data-variant": type, "data-global": global }), role ? React.createElement("div", { role: role }, children) : children)));
|
|
26
25
|
});
|
|
27
26
|
export { BaseAlert };
|
|
28
27
|
//# sourceMappingURL=BaseAlertRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseAlertRoot.js","sourceRoot":"","sources":["../../../../src/alert/base-alert/root/BaseAlertRoot.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAEL,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB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L,MAAM,KAElB,IAAI,CAAC,CAAC,CAAC,6BAAK,IAAI,EAAE,IAAI,IAAG,QAAQ,CAAO,CAAC,CAAC,CAAC,QAAQ,CAC1C,CACM,CACrB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { InfoCard, InfoCardHeader, InfoCardTitle, InfoCardContent, } from "./root/InfoCardRoot.js";
|
|
2
|
-
export type { InfoCardProps, InfoCardHeaderProps, InfoCardTitleProps, InfoCardContentProps, } from "./root/InfoCardRoot.js";
|
|
1
|
+
export { InfoCard, InfoCardHeader, InfoCardTitle, InfoCardContent, InfoCardMessage, } from "./root/InfoCardRoot.js";
|
|
2
|
+
export type { InfoCardProps, InfoCardHeaderProps, InfoCardTitleProps, InfoCardContentProps, InfoCardMessageProps, } from "./root/InfoCardRoot.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/alert/info-card/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,EACL,QAAQ,EACR,cAAc,EACd,aAAa,EACb,eAAe,GAChB,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/alert/info-card/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,EACL,QAAQ,EACR,cAAc,EACd,aAAa,EACb,eAAe,EACf,eAAe,GAChB,MAAM,qBAAqB,CAAC"}
|
|
@@ -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,37 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React, { forwardRef } from "react";
|
|
13
|
+
import { BodyLong } from "../../../typography/index.js";
|
|
14
|
+
import { cl } from "../../../utils/helpers/index.js";
|
|
15
|
+
import { useBaseAlert } from "../../base-alert/root/BaseAlertRoot.context.js";
|
|
16
|
+
/**
|
|
17
|
+
* A component for displaying informational messages.
|
|
18
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/infocard)
|
|
19
|
+
* @see 🏷️ {@link InfoCardMessageProps}
|
|
20
|
+
* @example
|
|
21
|
+
* ```jsx
|
|
22
|
+
* <InfoCard data-color="info">
|
|
23
|
+
* <InfoCard.Message icon={<InformationSquareIcon aria-hidden />}>
|
|
24
|
+
* Message contents
|
|
25
|
+
* </InfoCard.Message>
|
|
26
|
+
* </InfoCard>
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
const InfoCardMessage = forwardRef((_a, forwardedRef) => {
|
|
30
|
+
var { children, className, icon } = _a, restProps = __rest(_a, ["children", "className", "icon"]);
|
|
31
|
+
const context = useBaseAlert();
|
|
32
|
+
return (React.createElement("div", Object.assign({ ref: forwardedRef, className: cl(className, "aksel-base-alert__message") }, restProps),
|
|
33
|
+
React.createElement("div", { className: "aksel-base-alert__icon" }, icon),
|
|
34
|
+
React.createElement(BodyLong, { size: context.size, as: "div", textColor: "default" }, children)));
|
|
35
|
+
});
|
|
36
|
+
export { InfoCardMessage };
|
|
37
|
+
//# 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,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAS3E;;;;;;;;;;;;GAYG;AACH,MAAM,eAAe,GAAG,UAAU,CAChC,CACE,EAAiE,EACjE,YAAY,EACZ,EAAE;QAFF,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,OAAsC,EAAjC,SAAS,cAAzC,iCAA2C,CAAF;IAGzC,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC;IAC/B,OAAO,CACL,2CACE,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,2BAA2B,CAAC,IACjD,SAAS;QAEb,6BAAK,SAAS,EAAC,wBAAwB,IAAE,IAAI,CAAO;QACpD,oBAAC,QAAQ,IAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,EAAC,KAAK,EAAC,SAAS,EAAC,SAAS,IACvD,QAAQ,CACA,CACP,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { BaseAlert } from "../../base-alert/index.js";
|
|
3
3
|
import { InfoCardContent, type InfoCardContentProps } from "../content/InfoCardContent.js";
|
|
4
4
|
import { InfoCardHeader, type InfoCardHeaderProps } from "../header/InfoCardHeader.js";
|
|
5
|
+
import { InfoCardMessage, type InfoCardMessageProps } from "../message/InfoCardMessage.js";
|
|
5
6
|
import { InfoCardTitle, type InfoCardTitleProps } from "../title/InfoCardTitle.js";
|
|
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, };
|
|
@@ -13,6 +13,7 @@ import React, { forwardRef } from "react";
|
|
|
13
13
|
import { BaseAlert } from "../../base-alert/index.js";
|
|
14
14
|
import { InfoCardContent, } from "../content/InfoCardContent.js";
|
|
15
15
|
import { InfoCardHeader, } from "../header/InfoCardHeader.js";
|
|
16
|
+
import { InfoCardMessage, } from "../message/InfoCardMessage.js";
|
|
16
17
|
import { InfoCardTitle } from "../title/InfoCardTitle.js";
|
|
17
18
|
/**
|
|
18
19
|
* A component for displaying informational content in a card format.
|
|
@@ -35,6 +36,7 @@ export const InfoCard = forwardRef((_a, forwardedRef) => {
|
|
|
35
36
|
InfoCard.Header = InfoCardHeader;
|
|
36
37
|
InfoCard.Title = InfoCardTitle;
|
|
37
38
|
InfoCard.Content = InfoCardContent;
|
|
39
|
+
InfoCard.Message = InfoCardMessage;
|
|
38
40
|
export default InfoCard;
|
|
39
|
-
export { InfoCardContent, InfoCardHeader, InfoCardTitle };
|
|
41
|
+
export { InfoCardContent, InfoCardHeader, InfoCardTitle, InfoCardMessage };
|
|
40
42
|
//# sourceMappingURL=InfoCardRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoCardRoot.js","sourceRoot":"","sources":["../../../../src/alert/info-card/root/InfoCardRoot.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C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Aa,EAAE,eAAe,EAAE,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,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CaretDownCircleFillIcon, CaretUpCircleFillIcon, DragVerticalIcon, } from "@navikt/aksel-icons";
|
|
3
|
+
/**
|
|
4
|
+
* DataDragAndDropDragHandler
|
|
5
|
+
*
|
|
6
|
+
* A button component that serves as a drag handle for drag and drop operations.
|
|
7
|
+
* Can be used to initiate dragging of elements in a data table or list.
|
|
8
|
+
*/
|
|
9
|
+
export const DataDragAndDropDragHandler = React.forwardRef(({ keyboardDragging, handleRef }) => {
|
|
10
|
+
return (React.createElement("div", { className: "aksel-data-drag-and-drop__drag-handler__alt" },
|
|
11
|
+
keyboardDragging && (React.createElement("span", { className: "aksel-data-drag-and-drop__drag-handler__arrow", "data-direction": "up" },
|
|
12
|
+
React.createElement(CaretUpCircleFillIcon, { "aria-hidden": true, fontSize: "1.2rem" }))),
|
|
13
|
+
React.createElement("div", { ref: handleRef, className: "aksel-data-drag-and-drop__drag-handler__button" },
|
|
14
|
+
React.createElement(DragVerticalIcon, { "aria-hidden": true, title: "Dra for \u00E5 flytte", fontSize: "1.5rem" })),
|
|
15
|
+
keyboardDragging && (React.createElement("span", { className: "aksel-data-drag-and-drop__drag-handler__arrow", "data-direction": "down" },
|
|
16
|
+
React.createElement(CaretDownCircleFillIcon, { "aria-hidden": true, fontSize: "1.2rem" })))));
|
|
17
|
+
});
|
|
18
|
+
//# 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,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAiB7B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,CAAC,UAAU,CAGxD,CAAC,EAAE,gBAAgB,EAAE,SAAS,EAAE,EAAE,EAAE;IACpC,OAAO,CACL,6BAAK,SAAS,EAAC,6CAA6C;QACzD,gBAAgB,IAAI,CACnB,8BACE,SAAS,EAAC,+CAA+C,oBAC1C,IAAI;YAEnB,oBAAC,qBAAqB,yBAAa,QAAQ,EAAC,QAAQ,GAAG,CAClD,CACR;QACD,6BACE,GAAG,EAAE,SAAS,EACd,SAAS,EAAC,gDAAgD;YAE1D,oBAAC,gBAAgB,yBAEf,KAAK,EAAC,uBAAkB,EACxB,QAAQ,EAAC,QAAQ,GACjB,CACE;QACL,gBAAgB,IAAI,CACnB,8BACE,SAAS,EAAC,+CAA+C,oBAC1C,MAAM;YAErB,oBAAC,uBAAuB,yBAAa,QAAQ,EAAC,QAAQ,GAAG,CACpD,CACR,CACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface DataDragAndDropItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* Unique id
|
|
6
|
+
*/
|
|
7
|
+
id: string;
|
|
8
|
+
/**
|
|
9
|
+
* Index of the item being dragged
|
|
10
|
+
*/
|
|
11
|
+
index: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* TODO
|
|
15
|
+
*
|
|
16
|
+
* @see 🏷️ {@link DataDragAndDropItemProps}
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <DragAndDrop.Item numOfSelectedRows={selectedRows.length} onClear={handleClear}>
|
|
20
|
+
* TODO
|
|
21
|
+
* </DragAndDrop.Item>
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
declare const DataDragAndDropItem: React.ForwardRefExoticComponent<DataDragAndDropItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
export default DataDragAndDropItem;
|
|
26
|
+
export { DataDragAndDropItem };
|
|
27
|
+
export type { DataDragAndDropItemProps };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React from "react";
|
|
13
|
+
import { HStack } from "../../../primitives/stack/index.js";
|
|
14
|
+
import { cl } from "../../../utils/helpers/index.js";
|
|
15
|
+
/**
|
|
16
|
+
* TODO
|
|
17
|
+
*
|
|
18
|
+
* @see 🏷️ {@link DataDragAndDropItemProps}
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <DragAndDrop.Item numOfSelectedRows={selectedRows.length} onClear={handleClear}>
|
|
22
|
+
* TODO
|
|
23
|
+
* </DragAndDrop.Item>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
const DataDragAndDropItem = React.forwardRef((_a, forwardedRef) => {
|
|
27
|
+
// const context = useDataDragAndDropContext();
|
|
28
|
+
var { children, className } = _a, rest = __rest(_a, ["children", "className"]);
|
|
29
|
+
return (React.createElement(HStack, { gap: "space-8", align: "center", wrap: false, asChild: true },
|
|
30
|
+
React.createElement("div", Object.assign({ ref: forwardedRef }, rest, { className: cl("aksel-data-table__drag-and-drop-item", className) }),
|
|
31
|
+
React.createElement("div", null, children))));
|
|
32
|
+
});
|
|
33
|
+
export default DataDragAndDropItem;
|
|
34
|
+
export { DataDragAndDropItem };
|
|
35
|
+
//# sourceMappingURL=DataDragAndDropItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataDragAndDropItem.js","sourceRoot":"","sources":["../../../../src/data/drag-and-drop/item/DataDragAndDropItem.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAc5C;;;;;;;;;;GAUG;AACH,MAAM,mBAAmB,GAAG,KAAK,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,oBAAC,MAAM,IAAC,GAAG,EAAC,SAAS,EAAC,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAE,KAAK,EAAE,OAAO;QAEvD,2CACE,GAAG,EAAE,YAAY,IACb,IAAI,IACR,SAAS,EAAE,EAAE,CAAC,sCAAsC,EAAE,SAAS,CAAC;YAMhE,iCAAM,QAAQ,CAAO,CACjB,CACC,CACV,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,mBAAmB,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface DataDragAndDropContextType {
|
|
2
|
+
inputMethod: "mouse" | "keyboard" | null;
|
|
3
|
+
}
|
|
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;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createStrictContext } from "../../../utils/helpers/index.js";
|
|
2
|
+
export const { Provider: DataDragAndDropProvider, useContext: useDataDragAndDropContext, } = createStrictContext({
|
|
3
|
+
errorMessage: "useDataDragAndDropContext must be used within a DataDragAndDropProvider",
|
|
4
|
+
name: "DataDragAndDropContext",
|
|
5
|
+
});
|
|
6
|
+
//# sourceMappingURL=DataDragAndDrop.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataDragAndDrop.context.js","sourceRoot":"","sources":["../../../../src/data/drag-and-drop/root/DataDragAndDrop.context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAM7D,MAAM,CAAC,MAAM,EACX,QAAQ,EAAE,uBAAuB,EACjC,UAAU,EAAE,yBAAyB,GACtC,GAAG,mBAAmB,CAAyC;IAC9D,YAAY,EACV,yEAAyE;IAC3E,IAAI,EAAE,wBAAwB;CAC/B,CAAC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import DataDragAndDropItem, { DataDragAndDropItemProps } from "../item/DataDragAndDropItem.js";
|
|
3
|
+
interface DataDragAndDropProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
children: any[];
|
|
5
|
+
setItems: React.Dispatch<React.SetStateAction<any[]>>;
|
|
6
|
+
}
|
|
7
|
+
interface DataDragAndDropRootComponent extends React.ForwardRefExoticComponent<DataDragAndDropProps & React.RefAttributes<HTMLDivElement>> {
|
|
8
|
+
/**
|
|
9
|
+
* @see 🏷️ {@link DataDragAndDropItemProps}
|
|
10
|
+
* * @example
|
|
11
|
+
* ```jsx
|
|
12
|
+
* <DragAndDrop>
|
|
13
|
+
* <DragAndDrop.Item id="1" index={0}>
|
|
14
|
+
* ...
|
|
15
|
+
* </DragAndDrop.Item>
|
|
16
|
+
* </DragAndDrop>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
Item: typeof DataDragAndDropItem;
|
|
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
|
+
*/
|
|
31
|
+
declare const DataDragAndDrop: DataDragAndDropRootComponent;
|
|
32
|
+
export { DataDragAndDrop, DataDragAndDropItem };
|
|
33
|
+
export default DataDragAndDrop;
|
|
34
|
+
export type { DataDragAndDropItemProps, DataDragAndDropProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import DataDragAndDropItem from "../item/DataDragAndDropItem.js";
|
|
3
|
+
import { DataDragAndDropProvider } from "./DataDragAndDrop.context.js";
|
|
4
|
+
/**
|
|
5
|
+
* TODO
|
|
6
|
+
* setItems on root
|
|
7
|
+
* state : active element
|
|
8
|
+
* pointer over listener / state, onPointerEnter, onPointerLeave
|
|
9
|
+
* Overlay - Use floating component
|
|
10
|
+
* Keyboard navigation
|
|
11
|
+
* Handle - button, arrows also button
|
|
12
|
+
* UU - announce on drag start, item moved, drag end
|
|
13
|
+
*/
|
|
14
|
+
const DataDragAndDrop = forwardRef(({ children }, forwardedRef) => {
|
|
15
|
+
return (React.createElement(DataDragAndDropProvider, { inputMethod: null },
|
|
16
|
+
React.createElement("div", { ref: forwardedRef }, children)));
|
|
17
|
+
});
|
|
18
|
+
DataDragAndDrop.Item = DataDragAndDropItem;
|
|
19
|
+
export { DataDragAndDrop, DataDragAndDropItem };
|
|
20
|
+
export default DataDragAndDrop;
|
|
21
|
+
//# sourceMappingURL=DataDragAndDropRoot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataDragAndDropRoot.js","sourceRoot":"","sources":["../../../../src/data/drag-and-drop/root/DataDragAndDropRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,mBAEN,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAwBpE;;;;;;;;;GASG;AAEH,MAAM,eAAe,GAAG,UAAU,CAChC,CAAC,EAAE,QAAQ,EAAE,EAAE,YAAY,EAAE,EAAE;IAC7B,OAAO,CACL,oBAAC,uBAAuB,IAAC,WAAW,EAAE,IAAI;QACxC,6BAAK,GAAG,EAAE,YAAY,IAAG,QAAQ,CAAO,CAChB,CAC3B,CAAC;AACJ,CAAC,CAC8B,CAAC;AAElC,eAAe,CAAC,IAAI,GAAG,mBAAmB,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,CAAC;AAChD,eAAe,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,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CaretDownCircleFillIcon, CaretUpCircleFillIcon, DragVerticalIcon, } from "@navikt/aksel-icons";
|
|
3
|
+
import { Floating } from "../../../utils/components/floating/Floating.js";
|
|
4
|
+
/**
|
|
5
|
+
* DataDragAndDropDragHandler
|
|
6
|
+
*
|
|
7
|
+
* A button component that serves as a drag handle for drag and drop operations.
|
|
8
|
+
* Can be used to initiate dragging of elements in a data table or list.
|
|
9
|
+
*/
|
|
10
|
+
export const DataDragAndDropDragHandler = React.forwardRef(({ keyboardDragging, handleRef, alt }) => {
|
|
11
|
+
if (alt) {
|
|
12
|
+
return (React.createElement("div", { className: "aksel-data-drag-and-drop__drag-handler__alt" },
|
|
13
|
+
keyboardDragging && (React.createElement("span", { className: "aksel-data-drag-and-drop__drag-handler__arrow", "data-direction": "up" },
|
|
14
|
+
React.createElement(CaretUpCircleFillIcon, { "aria-hidden": true, fontSize: "1.2rem" }))),
|
|
15
|
+
React.createElement("div", { ref: handleRef, className: "aksel-data-drag-and-drop__drag-handler__button" },
|
|
16
|
+
React.createElement(DragVerticalIcon, { "aria-hidden": true, title: "Dra for \u00E5 flytte", fontSize: "1.5rem" })),
|
|
17
|
+
keyboardDragging && (React.createElement("span", { className: "aksel-data-drag-and-drop__drag-handler__arrow", "data-direction": "down" },
|
|
18
|
+
React.createElement(CaretDownCircleFillIcon, { "aria-hidden": true, fontSize: "1.2rem" })))));
|
|
19
|
+
}
|
|
20
|
+
return (React.createElement(Floating, null,
|
|
21
|
+
keyboardDragging && (React.createElement(Floating.Content, { side: "top", avoidCollisions: false, updatePositionStrategy: "always", className: "aksel-data-drag-and-drop__drag-handler__arrow" },
|
|
22
|
+
React.createElement(CaretUpCircleFillIcon, { "aria-hidden": true, fontSize: "1.2rem" }))),
|
|
23
|
+
React.createElement(Floating.Anchor, { asChild: true },
|
|
24
|
+
React.createElement("div", { ref: handleRef, className: "aksel-data-drag-and-drop__drag-handler__button" },
|
|
25
|
+
React.createElement(DragVerticalIcon, { "aria-hidden": true, title: "Dra for \u00E5 flytte", fontSize: "1.5rem" }))),
|
|
26
|
+
keyboardDragging && (React.createElement(Floating.Content, { avoidCollisions: false, updatePositionStrategy: "always", className: "aksel-data-drag-and-drop__drag-handler__arrow" },
|
|
27
|
+
React.createElement(CaretDownCircleFillIcon, { "aria-hidden": true, fontSize: "1.2rem" })))));
|
|
28
|
+
});
|
|
29
|
+
//# 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,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,uBAA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I,CACnB,oBAAC,QAAQ,CAAC,OAAO,IACf,eAAe,EAAE,KAAK,EACtB,sBAAsB,EAAC,QAAQ,EAC/B,SAAS,EAAC,+CAA+C;YAEzD,oBAAC,uBAAuB,yBAAa,QAAQ,EAAC,QAAQ,GAAG,CACxC,CACpB,CACQ,CACZ,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface DataDragAndDropItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* Unique id
|
|
6
|
+
*/
|
|
7
|
+
id: string;
|
|
8
|
+
/**
|
|
9
|
+
* Index of the item being dragged
|
|
10
|
+
*/
|
|
11
|
+
index: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* TODO
|
|
15
|
+
*
|
|
16
|
+
* @see 🏷️ {@link DataDragAndDropItemProps}
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <DragAndDrop.Item numOfSelectedRows={selectedRows.length} onClear={handleClear}>
|
|
20
|
+
* TODO
|
|
21
|
+
* </DragAndDrop.Item>
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
declare const DataDragAndDropItem: React.ForwardRefExoticComponent<DataDragAndDropItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
export default DataDragAndDropItem;
|
|
26
|
+
export { DataDragAndDropItem };
|
|
27
|
+
export type { DataDragAndDropItemProps };
|