@navikt/ds-react 7.40.0 → 8.0.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/accordion/Accordion.d.ts +15 -7
- package/cjs/accordion/Accordion.js +4 -4
- package/cjs/accordion/Accordion.js.map +1 -1
- package/cjs/accordion/AccordionContent.js +3 -2
- package/cjs/accordion/AccordionContent.js.map +1 -1
- package/cjs/accordion/AccordionContext.d.ts +1 -2
- package/cjs/accordion/AccordionContext.js +0 -1
- package/cjs/accordion/AccordionContext.js.map +1 -1
- package/cjs/accordion/AccordionHeader.js +2 -9
- package/cjs/accordion/AccordionHeader.js.map +1 -1
- package/cjs/accordion/AccordionItem.js +0 -1
- package/cjs/accordion/AccordionItem.js.map +1 -1
- package/cjs/alert/base-alert/root/BaseAlertRoot.d.ts +3 -1
- package/cjs/alert/base-alert/root/BaseAlertRoot.js.map +1 -1
- package/cjs/alert/global-alert/root/GlobalAlertRoot.d.ts +4 -0
- package/cjs/alert/global-alert/root/GlobalAlertRoot.js.map +1 -1
- package/cjs/alert/local-alert/root/LocalAlertRoot.d.ts +4 -0
- package/cjs/alert/local-alert/root/LocalAlertRoot.js.map +1 -1
- package/cjs/button/Button.d.ts +14 -1
- package/cjs/button/Button.js +1 -1
- package/cjs/button/Button.js.map +1 -1
- package/cjs/chat/Chat.d.ts +11 -3
- package/cjs/chat/Chat.js.map +1 -1
- package/cjs/chips/Chips.d.ts +17 -17
- package/cjs/chips/Chips.js +17 -17
- package/cjs/chips/Removable.d.ts +8 -2
- package/cjs/chips/Removable.js +1 -11
- package/cjs/chips/Removable.js.map +1 -1
- package/cjs/chips/Toggle.d.ts +8 -2
- package/cjs/chips/Toggle.js +2 -11
- package/cjs/chips/Toggle.js.map +1 -1
- package/cjs/collapsible/Collapsible.d.ts +1 -1
- package/cjs/collapsible/Collapsible.js +1 -1
- package/cjs/copybutton/CopyButton.d.ts +13 -2
- package/cjs/copybutton/CopyButton.js +12 -27
- package/cjs/copybutton/CopyButton.js.map +1 -1
- package/cjs/date/Date.Dialog.js +1 -1
- package/cjs/date/Date.Dialog.js.map +1 -1
- package/cjs/dropdown/Menu/index.js +1 -1
- package/cjs/dropdown/Menu/index.js.map +1 -1
- package/cjs/expansion-card/ExpansionCard.d.ts +7 -0
- package/cjs/expansion-card/ExpansionCard.js +0 -1
- package/cjs/expansion-card/ExpansionCard.js.map +1 -1
- package/cjs/expansion-card/ExpansionCardHeader.js +1 -1
- package/cjs/expansion-card/ExpansionCardHeader.js.map +1 -1
- package/cjs/form/checkbox/Checkbox.js +32 -73
- package/cjs/form/checkbox/Checkbox.js.map +1 -1
- package/cjs/form/combobox/FilteredOptions/FilteredOptions.js +2 -4
- package/cjs/form/combobox/FilteredOptions/FilteredOptions.js.map +1 -1
- package/cjs/form/combobox/SelectedOptions/SelectedOptions.js +1 -1
- package/cjs/form/combobox/SelectedOptions/SelectedOptions.js.map +1 -1
- package/cjs/form/file-upload/parts/dropzone/Dropzone.js +2 -2
- package/cjs/form/file-upload/parts/dropzone/Dropzone.js.map +1 -1
- package/cjs/form/file-upload/parts/item/Item.js +5 -20
- package/cjs/form/file-upload/parts/item/Item.js.map +1 -1
- package/cjs/form/file-upload/parts/item/ItemActionField.d.ts +13 -0
- package/cjs/form/file-upload/parts/item/ItemActionField.js +39 -0
- package/cjs/form/file-upload/parts/item/ItemActionField.js.map +1 -0
- package/cjs/form/file-upload/parts/item/{ItemName.d.ts → ItemHeader.d.ts} +2 -2
- package/cjs/form/file-upload/parts/item/ItemHeader.js +46 -0
- package/cjs/form/file-upload/parts/item/ItemHeader.js.map +1 -0
- package/cjs/form/file-upload/parts/item/ItemIcon.d.ts +1 -3
- package/cjs/form/file-upload/parts/item/ItemIcon.js +1 -10
- package/cjs/form/file-upload/parts/item/ItemIcon.js.map +1 -1
- package/cjs/form/form-summary/FormSummaryAnswer.js +2 -1
- package/cjs/form/form-summary/FormSummaryAnswer.js.map +1 -1
- package/cjs/form/form-summary/FormSummaryAnswers.js +5 -2
- package/cjs/form/form-summary/FormSummaryAnswers.js.map +1 -1
- package/cjs/form/form-summary/FormSummaryFooter.js +1 -1
- package/cjs/form/form-summary/FormSummaryFooter.js.map +1 -1
- package/cjs/form/radio/Radio.js +5 -18
- package/cjs/form/radio/Radio.js.map +1 -1
- package/cjs/form/search/Search.d.ts +6 -0
- package/cjs/form/search/Search.js +1 -4
- package/cjs/form/search/Search.js.map +1 -1
- package/cjs/guide-panel/GuidePanel.js +5 -10
- package/cjs/guide-panel/GuidePanel.js.map +1 -1
- package/cjs/guide-panel/Illustration.d.ts +1 -1
- package/cjs/guide-panel/Illustration.js +20 -15
- package/cjs/guide-panel/Illustration.js.map +1 -1
- package/cjs/help-text/HelpText.d.ts +10 -0
- package/cjs/help-text/HelpText.js +1 -2
- package/cjs/help-text/HelpText.js.map +1 -1
- package/cjs/help-text/HelpTextIcon.js +1 -3
- package/cjs/help-text/HelpTextIcon.js.map +1 -1
- package/cjs/inline-message/root/InlineMessage.d.ts +4 -0
- package/cjs/inline-message/root/InlineMessage.js.map +1 -1
- package/cjs/internal-header/InternalHeader.js +2 -6
- package/cjs/internal-header/InternalHeader.js.map +1 -1
- package/cjs/layout/base/BasePrimitive.d.ts +11 -11
- package/cjs/layout/base/BasePrimitive.js +1 -3
- package/cjs/layout/base/BasePrimitive.js.map +1 -1
- package/cjs/layout/bleed/Bleed.d.ts +7 -7
- package/cjs/layout/bleed/Bleed.js +3 -5
- package/cjs/layout/bleed/Bleed.js.map +1 -1
- package/cjs/layout/box/Box.d.ts +22 -12
- package/cjs/layout/box/Box.darkside.d.ts +16 -14
- package/cjs/layout/box/Box.darkside.js +11 -7
- package/cjs/layout/box/Box.darkside.js.map +1 -1
- package/cjs/layout/box/Box.js +14 -32
- package/cjs/layout/box/Box.js.map +1 -1
- package/cjs/layout/grid/HGrid.d.ts +4 -4
- package/cjs/layout/grid/HGrid.js +4 -6
- package/cjs/layout/grid/HGrid.js.map +1 -1
- package/cjs/layout/page/Page.d.ts +4 -8
- package/cjs/layout/page/Page.js +3 -9
- package/cjs/layout/page/Page.js.map +1 -1
- package/cjs/layout/stack/Stack.d.ts +1 -1
- package/cjs/layout/stack/Stack.js +1 -3
- package/cjs/layout/stack/Stack.js.map +1 -1
- package/cjs/layout/utilities/css.d.ts +2 -2
- package/cjs/layout/utilities/css.js +13 -53
- package/cjs/layout/utilities/css.js.map +1 -1
- package/cjs/layout/utilities/types.d.ts +3 -7
- package/cjs/link/Link.d.ts +11 -2
- package/cjs/link/Link.js +1 -14
- package/cjs/link/Link.js.map +1 -1
- package/cjs/link-card/LinkCard.d.ts +9 -0
- package/cjs/link-card/LinkCard.js.map +1 -1
- package/cjs/list/List.js +1 -21
- package/cjs/list/List.js.map +1 -1
- package/cjs/list/List.types.d.ts +2 -14
- package/cjs/loader/Loader.d.ts +4 -1
- package/cjs/loader/Loader.js.map +1 -1
- package/cjs/modal/Modal.js +0 -5
- package/cjs/modal/Modal.js.map +1 -1
- package/cjs/modal/ModalUtils.d.ts +1 -3
- package/cjs/modal/ModalUtils.js +1 -38
- package/cjs/modal/ModalUtils.js.map +1 -1
- package/cjs/overlays/action-menu/ActionMenu.js +14 -24
- package/cjs/overlays/action-menu/ActionMenu.js.map +1 -1
- package/cjs/overlays/floating/Floating.js +5 -5
- package/cjs/overlays/floating/Floating.js.map +1 -1
- package/cjs/pagination/Pagination.d.ts +12 -5
- package/cjs/pagination/Pagination.js +3 -10
- package/cjs/pagination/Pagination.js.map +1 -1
- package/cjs/pagination/PaginationItem.js +1 -2
- package/cjs/pagination/PaginationItem.js.map +1 -1
- package/cjs/panel/Panel.d.ts +2 -2
- package/cjs/panel/Panel.js +2 -2
- package/cjs/popover/Popover.d.ts +2 -3
- package/cjs/popover/Popover.js +6 -18
- package/cjs/popover/Popover.js.map +1 -1
- package/cjs/portal/Portal.js +2 -5
- package/cjs/portal/Portal.js.map +1 -1
- package/cjs/progress-bar/ProgressBar.d.ts +7 -0
- package/cjs/progress-bar/ProgressBar.js +2 -2
- package/cjs/progress-bar/ProgressBar.js.map +1 -1
- package/cjs/read-more/ReadMore.d.ts +11 -0
- package/cjs/read-more/ReadMore.js.map +1 -1
- package/cjs/stepper/Stepper.js +2 -7
- package/cjs/stepper/Stepper.js.map +1 -1
- package/cjs/tag/Tag.d.ts +12 -1
- package/cjs/tag/Tag.js +5 -2
- package/cjs/tag/Tag.js.map +1 -1
- package/cjs/theme/Theme.d.ts +9 -9
- package/cjs/theme/Theme.js +10 -10
- package/cjs/theme/Theme.js.map +1 -1
- package/cjs/timeline/period/index.d.ts +8 -0
- package/cjs/timeline/period/index.js.map +1 -1
- package/cjs/toggle-group/ToggleGroup.js +2 -10
- package/cjs/toggle-group/ToggleGroup.js.map +1 -1
- package/cjs/toggle-group/ToggleGroup.types.d.ts +11 -2
- package/cjs/typography/BodyLong.d.ts +9 -0
- package/cjs/typography/BodyLong.js.map +1 -1
- package/cjs/typography/BodyShort.d.ts +9 -0
- package/cjs/typography/BodyShort.js.map +1 -1
- package/cjs/typography/Detail.d.ts +9 -0
- package/cjs/typography/Detail.js.map +1 -1
- package/cjs/typography/Heading.d.ts +9 -0
- package/cjs/typography/Heading.js.map +1 -1
- package/cjs/typography/Label.d.ts +9 -0
- package/cjs/typography/Label.js.map +1 -1
- package/cjs/typography/types.d.ts +1 -1
- package/cjs/util/TextareaAutoSize.js +1 -3
- package/cjs/util/TextareaAutoSize.js.map +1 -1
- package/esm/accordion/Accordion.d.ts +15 -7
- package/esm/accordion/Accordion.js +4 -4
- package/esm/accordion/Accordion.js.map +1 -1
- package/esm/accordion/AccordionContent.js +3 -2
- package/esm/accordion/AccordionContent.js.map +1 -1
- package/esm/accordion/AccordionContext.d.ts +1 -2
- package/esm/accordion/AccordionContext.js +0 -1
- package/esm/accordion/AccordionContext.js.map +1 -1
- package/esm/accordion/AccordionHeader.js +3 -10
- package/esm/accordion/AccordionHeader.js.map +1 -1
- package/esm/accordion/AccordionItem.js +0 -1
- package/esm/accordion/AccordionItem.js.map +1 -1
- package/esm/alert/base-alert/root/BaseAlertRoot.d.ts +3 -1
- package/esm/alert/base-alert/root/BaseAlertRoot.js.map +1 -1
- package/esm/alert/global-alert/root/GlobalAlertRoot.d.ts +4 -0
- package/esm/alert/global-alert/root/GlobalAlertRoot.js.map +1 -1
- package/esm/alert/local-alert/root/LocalAlertRoot.d.ts +4 -0
- package/esm/alert/local-alert/root/LocalAlertRoot.js.map +1 -1
- package/esm/button/Button.d.ts +14 -1
- package/esm/button/Button.js +1 -1
- package/esm/button/Button.js.map +1 -1
- package/esm/chat/Chat.d.ts +11 -3
- package/esm/chat/Chat.js.map +1 -1
- package/esm/chips/Chips.d.ts +17 -17
- package/esm/chips/Chips.js +17 -17
- package/esm/chips/Removable.d.ts +8 -2
- package/esm/chips/Removable.js +2 -12
- package/esm/chips/Removable.js.map +1 -1
- package/esm/chips/Toggle.d.ts +8 -2
- package/esm/chips/Toggle.js +3 -12
- package/esm/chips/Toggle.js.map +1 -1
- package/esm/collapsible/Collapsible.d.ts +1 -1
- package/esm/collapsible/Collapsible.js +1 -1
- package/esm/copybutton/CopyButton.d.ts +13 -2
- package/esm/copybutton/CopyButton.js +13 -28
- package/esm/copybutton/CopyButton.js.map +1 -1
- package/esm/date/Date.Dialog.js +1 -1
- package/esm/date/Date.Dialog.js.map +1 -1
- package/esm/dropdown/Menu/index.js +1 -1
- package/esm/dropdown/Menu/index.js.map +1 -1
- package/esm/expansion-card/ExpansionCard.d.ts +7 -0
- package/esm/expansion-card/ExpansionCard.js +0 -1
- package/esm/expansion-card/ExpansionCard.js.map +1 -1
- package/esm/expansion-card/ExpansionCardHeader.js +1 -1
- package/esm/expansion-card/ExpansionCardHeader.js.map +1 -1
- package/esm/form/checkbox/Checkbox.js +33 -74
- package/esm/form/checkbox/Checkbox.js.map +1 -1
- package/esm/form/combobox/FilteredOptions/FilteredOptions.js +3 -5
- package/esm/form/combobox/FilteredOptions/FilteredOptions.js.map +1 -1
- package/esm/form/combobox/SelectedOptions/SelectedOptions.js +1 -1
- package/esm/form/combobox/SelectedOptions/SelectedOptions.js.map +1 -1
- package/esm/form/file-upload/parts/dropzone/Dropzone.js +2 -2
- package/esm/form/file-upload/parts/dropzone/Dropzone.js.map +1 -1
- package/esm/form/file-upload/parts/item/Item.js +6 -18
- package/esm/form/file-upload/parts/item/Item.js.map +1 -1
- package/esm/form/file-upload/parts/item/ItemActionField.d.ts +13 -0
- package/esm/form/file-upload/parts/item/ItemActionField.js +34 -0
- package/esm/form/file-upload/parts/item/ItemActionField.js.map +1 -0
- package/esm/form/file-upload/parts/item/{ItemName.d.ts → ItemHeader.d.ts} +2 -2
- package/esm/form/file-upload/parts/item/ItemHeader.js +40 -0
- package/esm/form/file-upload/parts/item/ItemHeader.js.map +1 -0
- package/esm/form/file-upload/parts/item/ItemIcon.d.ts +1 -3
- package/esm/form/file-upload/parts/item/ItemIcon.js +2 -11
- package/esm/form/file-upload/parts/item/ItemIcon.js.map +1 -1
- package/esm/form/form-summary/FormSummaryAnswer.js +3 -2
- package/esm/form/form-summary/FormSummaryAnswer.js.map +1 -1
- package/esm/form/form-summary/FormSummaryAnswers.js +5 -2
- package/esm/form/form-summary/FormSummaryAnswers.js.map +1 -1
- package/esm/form/form-summary/FormSummaryFooter.js +1 -1
- package/esm/form/form-summary/FormSummaryFooter.js.map +1 -1
- package/esm/form/radio/Radio.js +6 -19
- package/esm/form/radio/Radio.js.map +1 -1
- package/esm/form/search/Search.d.ts +6 -0
- package/esm/form/search/Search.js +2 -5
- package/esm/form/search/Search.js.map +1 -1
- package/esm/guide-panel/GuidePanel.js +6 -11
- package/esm/guide-panel/GuidePanel.js.map +1 -1
- package/esm/guide-panel/Illustration.d.ts +1 -1
- package/esm/guide-panel/Illustration.js +18 -13
- package/esm/guide-panel/Illustration.js.map +1 -1
- package/esm/help-text/HelpText.d.ts +10 -0
- package/esm/help-text/HelpText.js +2 -3
- package/esm/help-text/HelpText.js.map +1 -1
- package/esm/help-text/HelpTextIcon.js +1 -3
- package/esm/help-text/HelpTextIcon.js.map +1 -1
- package/esm/inline-message/root/InlineMessage.d.ts +4 -0
- package/esm/inline-message/root/InlineMessage.js.map +1 -1
- package/esm/internal-header/InternalHeader.js +3 -7
- package/esm/internal-header/InternalHeader.js.map +1 -1
- package/esm/layout/base/BasePrimitive.d.ts +11 -11
- package/esm/layout/base/BasePrimitive.js +2 -4
- package/esm/layout/base/BasePrimitive.js.map +1 -1
- package/esm/layout/bleed/Bleed.d.ts +7 -7
- package/esm/layout/bleed/Bleed.js +4 -6
- package/esm/layout/bleed/Bleed.js.map +1 -1
- package/esm/layout/box/Box.d.ts +22 -12
- package/esm/layout/box/Box.darkside.d.ts +16 -14
- package/esm/layout/box/Box.darkside.js +11 -7
- package/esm/layout/box/Box.darkside.js.map +1 -1
- package/esm/layout/box/Box.js +15 -33
- package/esm/layout/box/Box.js.map +1 -1
- package/esm/layout/grid/HGrid.d.ts +4 -4
- package/esm/layout/grid/HGrid.js +5 -7
- package/esm/layout/grid/HGrid.js.map +1 -1
- package/esm/layout/page/Page.d.ts +4 -8
- package/esm/layout/page/Page.js +4 -10
- package/esm/layout/page/Page.js.map +1 -1
- package/esm/layout/stack/Stack.d.ts +1 -1
- package/esm/layout/stack/Stack.js +2 -4
- package/esm/layout/stack/Stack.js.map +1 -1
- package/esm/layout/utilities/css.d.ts +2 -2
- package/esm/layout/utilities/css.js +13 -53
- package/esm/layout/utilities/css.js.map +1 -1
- package/esm/layout/utilities/types.d.ts +3 -7
- package/esm/link/Link.d.ts +11 -2
- package/esm/link/Link.js +2 -15
- package/esm/link/Link.js.map +1 -1
- package/esm/link-card/LinkCard.d.ts +9 -0
- package/esm/link-card/LinkCard.js.map +1 -1
- package/esm/list/List.js +3 -23
- package/esm/list/List.js.map +1 -1
- package/esm/list/List.types.d.ts +2 -14
- package/esm/loader/Loader.d.ts +4 -1
- package/esm/loader/Loader.js.map +1 -1
- package/esm/modal/Modal.js +1 -6
- package/esm/modal/Modal.js.map +1 -1
- package/esm/modal/ModalUtils.d.ts +1 -3
- package/esm/modal/ModalUtils.js +1 -37
- package/esm/modal/ModalUtils.js.map +1 -1
- package/esm/overlays/action-menu/ActionMenu.js +15 -25
- package/esm/overlays/action-menu/ActionMenu.js.map +1 -1
- package/esm/overlays/floating/Floating.js +5 -5
- package/esm/overlays/floating/Floating.js.map +1 -1
- package/esm/pagination/Pagination.d.ts +12 -5
- package/esm/pagination/Pagination.js +3 -10
- package/esm/pagination/Pagination.js.map +1 -1
- package/esm/pagination/PaginationItem.js +2 -3
- package/esm/pagination/PaginationItem.js.map +1 -1
- package/esm/panel/Panel.d.ts +2 -2
- package/esm/panel/Panel.js +2 -2
- package/esm/popover/Popover.d.ts +2 -3
- package/esm/popover/Popover.js +9 -21
- package/esm/popover/Popover.js.map +1 -1
- package/esm/portal/Portal.js +2 -5
- package/esm/portal/Portal.js.map +1 -1
- package/esm/progress-bar/ProgressBar.d.ts +7 -0
- package/esm/progress-bar/ProgressBar.js +2 -2
- package/esm/progress-bar/ProgressBar.js.map +1 -1
- package/esm/read-more/ReadMore.d.ts +11 -0
- package/esm/read-more/ReadMore.js.map +1 -1
- package/esm/stepper/Stepper.js +2 -7
- package/esm/stepper/Stepper.js.map +1 -1
- package/esm/tag/Tag.d.ts +12 -1
- package/esm/tag/Tag.js +5 -2
- package/esm/tag/Tag.js.map +1 -1
- package/esm/theme/Theme.d.ts +9 -9
- package/esm/theme/Theme.js +9 -9
- package/esm/theme/Theme.js.map +1 -1
- package/esm/timeline/period/index.d.ts +8 -0
- package/esm/timeline/period/index.js.map +1 -1
- package/esm/toggle-group/ToggleGroup.js +3 -11
- package/esm/toggle-group/ToggleGroup.js.map +1 -1
- package/esm/toggle-group/ToggleGroup.types.d.ts +11 -2
- package/esm/types/theme.d.ts +1 -1
- package/esm/typography/BodyLong.d.ts +9 -0
- package/esm/typography/BodyLong.js.map +1 -1
- package/esm/typography/BodyShort.d.ts +9 -0
- package/esm/typography/BodyShort.js.map +1 -1
- package/esm/typography/Detail.d.ts +9 -0
- package/esm/typography/Detail.js.map +1 -1
- package/esm/typography/Heading.d.ts +9 -0
- package/esm/typography/Heading.js.map +1 -1
- package/esm/typography/Label.d.ts +9 -0
- package/esm/typography/Label.js.map +1 -1
- package/esm/typography/types.d.ts +1 -1
- package/esm/util/TextareaAutoSize.js +1 -3
- package/esm/util/TextareaAutoSize.js.map +1 -1
- package/package.json +3 -3
- package/src/accordion/Accordion.tsx +19 -18
- package/src/accordion/AccordionContent.tsx +3 -6
- package/src/accordion/AccordionContext.tsx +1 -3
- package/src/accordion/AccordionHeader.tsx +5 -11
- package/src/accordion/AccordionItem.tsx +0 -1
- package/src/alert/base-alert/root/BaseAlertRoot.tsx +3 -1
- package/src/alert/global-alert/root/GlobalAlertRoot.tsx +4 -0
- package/src/alert/local-alert/root/LocalAlertRoot.tsx +4 -0
- package/src/button/Button.tsx +23 -20
- package/src/chat/Chat.tsx +10 -3
- package/src/chips/Chips.tsx +17 -17
- package/src/chips/Removable.tsx +9 -16
- package/src/chips/Toggle.tsx +10 -14
- package/src/collapsible/Collapsible.tsx +1 -1
- package/src/copybutton/CopyButton.tsx +51 -88
- package/src/date/Date.Dialog.tsx +0 -1
- package/src/dropdown/Menu/index.tsx +0 -1
- package/src/expansion-card/ExpansionCard.tsx +7 -1
- package/src/expansion-card/ExpansionCardHeader.tsx +1 -3
- package/src/form/checkbox/Checkbox.tsx +66 -155
- package/src/form/combobox/FilteredOptions/FilteredOptions.tsx +3 -6
- package/src/form/combobox/SelectedOptions/SelectedOptions.tsx +1 -6
- package/src/form/file-upload/parts/dropzone/Dropzone.tsx +2 -0
- package/src/form/file-upload/parts/item/Item.tsx +11 -35
- package/src/form/file-upload/parts/item/ItemActionField.tsx +89 -0
- package/src/form/file-upload/parts/item/ItemHeader.tsx +81 -0
- package/src/form/file-upload/parts/item/ItemIcon.tsx +1 -22
- package/src/form/form-summary/FormSummaryAnswer.tsx +3 -1
- package/src/form/form-summary/FormSummaryAnswers.tsx +12 -16
- package/src/form/form-summary/FormSummaryFooter.tsx +0 -1
- package/src/form/radio/Radio.tsx +25 -64
- package/src/form/search/Search.tsx +8 -14
- package/src/guide-panel/GuidePanel.tsx +32 -45
- package/src/guide-panel/Illustration.tsx +75 -66
- package/src/help-text/HelpText.tsx +11 -4
- package/src/help-text/HelpTextIcon.tsx +1 -5
- package/src/inline-message/root/InlineMessage.tsx +4 -0
- package/src/internal-header/InternalHeader.tsx +8 -20
- package/src/layout/base/BasePrimitive.tsx +37 -39
- package/src/layout/bleed/Bleed.tsx +12 -22
- package/src/layout/box/Box.darkside.tsx +22 -22
- package/src/layout/box/Box.tsx +44 -60
- package/src/layout/grid/HGrid.tsx +8 -10
- package/src/layout/page/Page.tsx +7 -30
- package/src/layout/stack/Stack.tsx +6 -8
- package/src/layout/utilities/css.ts +14 -71
- package/src/layout/utilities/types.ts +2 -15
- package/src/link/Link.tsx +12 -19
- package/src/link-card/LinkCard.tsx +9 -0
- package/src/list/List.tsx +2 -57
- package/src/list/List.types.ts +2 -14
- package/src/loader/Loader.tsx +4 -1
- package/src/modal/Modal.tsx +0 -7
- package/src/modal/ModalUtils.ts +1 -47
- package/src/overlays/action-menu/ActionMenu.tsx +30 -71
- package/src/overlays/floating/Floating.tsx +5 -5
- package/src/pagination/Pagination.tsx +15 -11
- package/src/pagination/PaginationItem.tsx +3 -4
- package/src/panel/Panel.tsx +2 -2
- package/src/popover/Popover.tsx +10 -37
- package/src/portal/Portal.tsx +10 -14
- package/src/progress-bar/ProgressBar.tsx +9 -2
- package/src/react-css.d.ts +0 -3
- package/src/read-more/ReadMore.tsx +11 -0
- package/src/stepper/Stepper.tsx +3 -11
- package/src/tag/Tag.tsx +45 -41
- package/src/theme/Theme.tsx +19 -19
- package/src/timeline/period/index.tsx +8 -0
- package/src/toggle-group/ToggleGroup.tsx +2 -12
- package/src/toggle-group/ToggleGroup.types.ts +11 -2
- package/src/types/theme.d.ts +1 -1
- package/src/typography/BodyLong.tsx +9 -0
- package/src/typography/BodyShort.tsx +9 -0
- package/src/typography/Detail.tsx +9 -0
- package/src/typography/Heading.tsx +9 -0
- package/src/typography/Label.tsx +9 -0
- package/src/typography/types.ts +1 -1
- package/src/util/TextareaAutoSize.tsx +0 -3
- package/cjs/form/file-upload/parts/item/ItemName.js +0 -32
- package/cjs/form/file-upload/parts/item/ItemName.js.map +0 -1
- package/cjs/guide-panel/Illustration.darkside.d.ts +0 -2
- package/cjs/guide-panel/Illustration.darkside.js +0 -30
- package/cjs/guide-panel/Illustration.darkside.js.map +0 -1
- package/esm/form/file-upload/parts/item/ItemName.js +0 -27
- package/esm/form/file-upload/parts/item/ItemName.js.map +0 -1
- package/esm/guide-panel/Illustration.darkside.d.ts +0 -2
- package/esm/guide-panel/Illustration.darkside.js +0 -23
- package/esm/guide-panel/Illustration.darkside.js.map +0 -1
- package/src/form/file-upload/parts/item/ItemName.tsx +0 -58
- package/src/guide-panel/Illustration.darkside.tsx +0 -91
package/src/link/Link.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { forwardRef } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import type { AkselStatusColorRole } from "@navikt/ds-tokens/types";
|
|
3
|
+
import { useRenameCSS } from "../theme/Theme";
|
|
3
4
|
import { AkselColor } from "../types";
|
|
4
5
|
import { OverridableComponent } from "../util/types";
|
|
5
6
|
|
|
@@ -19,14 +20,21 @@ export interface LinkProps
|
|
|
19
20
|
*/
|
|
20
21
|
inlineText?: boolean;
|
|
21
22
|
/**
|
|
22
|
-
*
|
|
23
|
-
* @default "action"
|
|
23
|
+
* @deprecated Deprecated in v8. Use `data-color` prop instead.
|
|
24
24
|
*/
|
|
25
25
|
variant?: "action" | "neutral" | "subtle";
|
|
26
26
|
/**
|
|
27
27
|
* Link text
|
|
28
28
|
*/
|
|
29
29
|
children: React.ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Overrides inherited color.
|
|
32
|
+
*
|
|
33
|
+
* We recommend only using `accent` and `neutral`. We have disallowed status-colors.
|
|
34
|
+
* @see 🏷️ {@link AkselColor}
|
|
35
|
+
* @see [📝 Documentation](https://aksel.nav.no/grunnleggende/styling/farger-tokens)
|
|
36
|
+
*/
|
|
37
|
+
"data-color"?: Exclude<AkselColor, AkselStatusColorRole>;
|
|
30
38
|
}
|
|
31
39
|
|
|
32
40
|
/**
|
|
@@ -64,28 +72,14 @@ export const Link: OverridableComponent<LinkProps, HTMLAnchorElement> =
|
|
|
64
72
|
},
|
|
65
73
|
ref,
|
|
66
74
|
) => {
|
|
67
|
-
const themeContext = useThemeInternal();
|
|
68
75
|
const { cn } = useRenameCSS();
|
|
69
76
|
|
|
70
|
-
/*
|
|
71
|
-
* We avoid defaulting to "action" in darkside.
|
|
72
|
-
*/
|
|
73
|
-
let localVariant: LinkProps["variant"];
|
|
74
|
-
|
|
75
|
-
if (themeContext?.isDarkside) {
|
|
76
|
-
localVariant = variant;
|
|
77
|
-
} else {
|
|
78
|
-
localVariant = variant ?? "action";
|
|
79
|
-
}
|
|
80
|
-
|
|
81
77
|
return (
|
|
82
78
|
<Component
|
|
83
|
-
data-color={color ?? variantToColor(
|
|
84
|
-
data-variant={localVariant}
|
|
79
|
+
data-color={color ?? variantToColor(variant)}
|
|
85
80
|
{...rest}
|
|
86
81
|
ref={ref}
|
|
87
82
|
className={cn("navds-link", className, {
|
|
88
|
-
[`navds-link--${localVariant}`]: localVariant,
|
|
89
83
|
"navds-link--remove-underline": !underline,
|
|
90
84
|
"navds-link--inline-text": inlineText,
|
|
91
85
|
})}
|
|
@@ -101,7 +95,6 @@ function variantToColor(
|
|
|
101
95
|
case "action":
|
|
102
96
|
return "accent";
|
|
103
97
|
case "neutral":
|
|
104
|
-
return "neutral";
|
|
105
98
|
case "subtle":
|
|
106
99
|
return "neutral";
|
|
107
100
|
default:
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { HTMLAttributes, forwardRef } from "react";
|
|
2
2
|
import { useRenameCSS } from "../theme/Theme";
|
|
3
|
+
import type { AkselColor } from "../types";
|
|
3
4
|
import { BodyLong, Heading } from "../typography";
|
|
4
5
|
import { createStrictContext } from "../util/create-strict-context";
|
|
5
6
|
import {
|
|
@@ -25,6 +26,14 @@ interface LinkCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
25
26
|
* @default "medium"
|
|
26
27
|
*/
|
|
27
28
|
size?: "small" | "medium";
|
|
29
|
+
/**
|
|
30
|
+
* Overrides inherited color.
|
|
31
|
+
*
|
|
32
|
+
* We reccomend avoiding status-colors (`info`, `success`, `warning`, `danger`) in LinkCards.
|
|
33
|
+
* @see 🏷️ {@link AkselColor}
|
|
34
|
+
* @see [📝 Documentation](https://aksel.nav.no/grunnleggende/styling/farger-tokens)
|
|
35
|
+
*/
|
|
36
|
+
"data-color"?: AkselColor;
|
|
28
37
|
}
|
|
29
38
|
|
|
30
39
|
type LinkCardContextProps = {
|
package/src/list/List.tsx
CHANGED
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
import React, { forwardRef, useContext } from "react";
|
|
2
|
-
import { useRenameCSS
|
|
3
|
-
import { BodyLong
|
|
2
|
+
import { useRenameCSS } from "../theme/Theme";
|
|
3
|
+
import { BodyLong } from "../typography";
|
|
4
4
|
import { ListItem } from "./List.Item";
|
|
5
5
|
import { ListContext } from "./List.context";
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7
7
|
import type { ListItemProps, ListProps } from "./List.types";
|
|
8
8
|
|
|
9
|
-
const headingSizeMap: Record<
|
|
10
|
-
Exclude<ListProps["size"], undefined>,
|
|
11
|
-
HeadingProps["size"]
|
|
12
|
-
> = {
|
|
13
|
-
small: "xsmall",
|
|
14
|
-
medium: "small",
|
|
15
|
-
large: "medium",
|
|
16
|
-
};
|
|
17
|
-
|
|
18
9
|
export interface ListComponent
|
|
19
10
|
extends React.ForwardRefExoticComponent<
|
|
20
11
|
ListProps & React.RefAttributes<HTMLDivElement>
|
|
@@ -46,9 +37,6 @@ export const List = forwardRef<HTMLDivElement, ListProps>(
|
|
|
46
37
|
children,
|
|
47
38
|
className,
|
|
48
39
|
as: ListTag = "ul",
|
|
49
|
-
title,
|
|
50
|
-
description,
|
|
51
|
-
headingTag,
|
|
52
40
|
size,
|
|
53
41
|
"aria-label": _ariaLabel,
|
|
54
42
|
"aria-labelledby": _ariaLabelledBy,
|
|
@@ -59,46 +47,9 @@ export const List = forwardRef<HTMLDivElement, ListProps>(
|
|
|
59
47
|
const { size: contextSize } = useContext(ListContext);
|
|
60
48
|
|
|
61
49
|
const { cn } = useRenameCSS();
|
|
62
|
-
const themeContext = useThemeInternal();
|
|
63
50
|
|
|
64
51
|
const listSize = size ?? contextSize;
|
|
65
52
|
|
|
66
|
-
if (themeContext?.isDarkside) {
|
|
67
|
-
if (
|
|
68
|
-
process.env.NODE_ENV !== "production" &&
|
|
69
|
-
(title || description || headingTag)
|
|
70
|
-
) {
|
|
71
|
-
console.warn(
|
|
72
|
-
"List: title, description and headingTag are deprecated and will not work with updated theme for Aksel.",
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return (
|
|
77
|
-
<ListContext.Provider
|
|
78
|
-
value={{
|
|
79
|
-
listType: ListTag,
|
|
80
|
-
size: listSize,
|
|
81
|
-
}}
|
|
82
|
-
>
|
|
83
|
-
<BodyLong
|
|
84
|
-
as="div"
|
|
85
|
-
{...rest}
|
|
86
|
-
size={listSize}
|
|
87
|
-
ref={ref}
|
|
88
|
-
className={cn("navds-list", `navds-list--${listSize}`, className)}
|
|
89
|
-
>
|
|
90
|
-
<ListTag
|
|
91
|
-
role="list"
|
|
92
|
-
aria-label={_ariaLabel}
|
|
93
|
-
aria-labelledby={_ariaLabelledBy}
|
|
94
|
-
>
|
|
95
|
-
{children}
|
|
96
|
-
</ListTag>
|
|
97
|
-
</BodyLong>
|
|
98
|
-
</ListContext.Provider>
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
53
|
return (
|
|
103
54
|
<ListContext.Provider
|
|
104
55
|
value={{
|
|
@@ -113,12 +64,6 @@ export const List = forwardRef<HTMLDivElement, ListProps>(
|
|
|
113
64
|
ref={ref}
|
|
114
65
|
className={cn("navds-list", `navds-list--${listSize}`, className)}
|
|
115
66
|
>
|
|
116
|
-
{title && (
|
|
117
|
-
<Heading size={headingSizeMap[listSize]} as={headingTag ?? "h3"}>
|
|
118
|
-
{title}
|
|
119
|
-
</Heading>
|
|
120
|
-
)}
|
|
121
|
-
{description && <BodyShort size={listSize}>{description}</BodyShort>}
|
|
122
67
|
<ListTag
|
|
123
68
|
role="list"
|
|
124
69
|
aria-label={_ariaLabel}
|
package/src/list/List.types.ts
CHANGED
|
@@ -6,21 +6,9 @@ export interface ListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
6
6
|
*/
|
|
7
7
|
as?: "ul" | "ol";
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
* @deprecated Use a "plain" <Heading> instead of `title`, Composition of smaller components preferred over smarter components.
|
|
9
|
+
* @deprecated Use <Heading> instead of `title`.
|
|
11
10
|
*/
|
|
12
|
-
title?:
|
|
13
|
-
/**
|
|
14
|
-
* List heading description.
|
|
15
|
-
* @deprecated Use a "plain" <BodyShort> instead of `description`, Composition of smaller components preferred over smarter components.
|
|
16
|
-
*/
|
|
17
|
-
description?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Allows setting a different HTML h-tag.
|
|
20
|
-
* @default "h3"
|
|
21
|
-
* @deprecated The `title` prop gets deprecated, so this one follows suit, as it was a supplementary prop to the title.
|
|
22
|
-
*/
|
|
23
|
-
headingTag?: React.ElementType<any>;
|
|
11
|
+
title?: never;
|
|
24
12
|
/**
|
|
25
13
|
* Changes margin-block on list and font size on items.
|
|
26
14
|
* @default "medium"
|
package/src/loader/Loader.tsx
CHANGED
|
@@ -35,7 +35,10 @@ export interface LoaderProps extends Omit<SVGProps<SVGSVGElement>, "ref"> {
|
|
|
35
35
|
*/
|
|
36
36
|
variant?: "neutral" | "interaction" | "inverted";
|
|
37
37
|
/**
|
|
38
|
-
* Overrides
|
|
38
|
+
* Overrides color.
|
|
39
|
+
*
|
|
40
|
+
* @see 🏷️ {@link AkselColor}
|
|
41
|
+
* @see [📝 Documentation](https://aksel.nav.no/grunnleggende/styling/farger-tokens)
|
|
39
42
|
*/
|
|
40
43
|
"data-color"?: AkselColor;
|
|
41
44
|
}
|
package/src/modal/Modal.tsx
CHANGED
|
@@ -17,7 +17,6 @@ import {
|
|
|
17
17
|
MouseCoordinates,
|
|
18
18
|
coordsAreInside,
|
|
19
19
|
getCloseHandler,
|
|
20
|
-
useBodyScrollLock,
|
|
21
20
|
useIsModalOpen,
|
|
22
21
|
} from "./ModalUtils";
|
|
23
22
|
import dialogPolyfill, { needPolyfill } from "./dialog-polyfill";
|
|
@@ -156,12 +155,6 @@ export const Modal = forwardRef<HTMLDialogElement, ModalProps>(
|
|
|
156
155
|
referenceElement: modalRef.current,
|
|
157
156
|
});
|
|
158
157
|
|
|
159
|
-
/**
|
|
160
|
-
* TODO: Kept for legacy support.
|
|
161
|
-
* - Remove utility in v8 and deprecate body-classes in ModalUtils.ts
|
|
162
|
-
*/
|
|
163
|
-
useBodyScrollLock(modalRef, portalNode, isNested);
|
|
164
|
-
|
|
165
158
|
const isWidthPreset =
|
|
166
159
|
typeof width === "string" && ["small", "medium"].includes(width);
|
|
167
160
|
|
package/src/modal/ModalUtils.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { useEffect } from "react";
|
|
2
|
-
import { ownerDocument } from "../util/owner";
|
|
3
2
|
import type { ModalProps } from "./types";
|
|
4
3
|
|
|
5
4
|
export interface MouseCoordinates {
|
|
@@ -55,49 +54,4 @@ function useIsModalOpen(modalRef: HTMLDialogElement | null) {
|
|
|
55
54
|
return isOpen;
|
|
56
55
|
}
|
|
57
56
|
|
|
58
|
-
export
|
|
59
|
-
|
|
60
|
-
function useBodyScrollLock(
|
|
61
|
-
modalRef: React.RefObject<HTMLDialogElement | null>,
|
|
62
|
-
portalNode: HTMLElement | null,
|
|
63
|
-
isNested: boolean,
|
|
64
|
-
) {
|
|
65
|
-
React.useEffect(() => {
|
|
66
|
-
if (isNested) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// We check both to avoid running this twice when not using portal
|
|
71
|
-
if (!modalRef.current || !portalNode) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const ownerDoc = ownerDocument(modalRef.current);
|
|
76
|
-
|
|
77
|
-
// In case `open` is true initially
|
|
78
|
-
if (modalRef.current.open) {
|
|
79
|
-
ownerDoc.body.classList.add(BODY_CLASS_LEGACY);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const observer = new MutationObserver(() => {
|
|
83
|
-
if (modalRef.current?.open) {
|
|
84
|
-
ownerDoc.body.classList.add(BODY_CLASS_LEGACY);
|
|
85
|
-
} else {
|
|
86
|
-
ownerDoc.body.classList.remove(BODY_CLASS_LEGACY);
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
observer.observe(modalRef.current, {
|
|
91
|
-
attributes: true,
|
|
92
|
-
attributeFilter: ["open"],
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
return () => {
|
|
96
|
-
observer.disconnect();
|
|
97
|
-
// In case modal is unmounted before it's closed
|
|
98
|
-
ownerDoc.body.classList.remove(BODY_CLASS_LEGACY);
|
|
99
|
-
};
|
|
100
|
-
}, [modalRef, portalNode, isNested]);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export { useIsModalOpen, useBodyScrollLock };
|
|
57
|
+
export { useIsModalOpen };
|
|
@@ -2,7 +2,7 @@ import React, { forwardRef, useRef } from "react";
|
|
|
2
2
|
import { ChevronRightIcon } from "@navikt/aksel-icons";
|
|
3
3
|
import { useModalContext } from "../../modal/Modal.context";
|
|
4
4
|
import { Slot } from "../../slot/Slot";
|
|
5
|
-
import { useRenameCSS
|
|
5
|
+
import { useRenameCSS } from "../../theme/Theme";
|
|
6
6
|
import { OverridableComponent, useId } from "../../util";
|
|
7
7
|
import { composeEventHandlers } from "../../util/composeEventHandlers";
|
|
8
8
|
import { createStrictContext } from "../../util/create-strict-context";
|
|
@@ -391,10 +391,10 @@ export const ActionMenuContent = forwardRef<
|
|
|
391
391
|
style={{
|
|
392
392
|
...style,
|
|
393
393
|
...{
|
|
394
|
-
"--
|
|
395
|
-
"var(--
|
|
396
|
-
"--
|
|
397
|
-
"var(--
|
|
394
|
+
"--__axc-action-menu-content-transform-origin":
|
|
395
|
+
"var(--__axc-floating-transform-origin)",
|
|
396
|
+
"--__axc-action-menu-content-available-height":
|
|
397
|
+
"var(--__axc-floating-available-height)",
|
|
398
398
|
},
|
|
399
399
|
}}
|
|
400
400
|
>
|
|
@@ -669,7 +669,7 @@ export const ActionMenuCheckboxItem = forwardRef<
|
|
|
669
669
|
width="24"
|
|
670
670
|
height="24"
|
|
671
671
|
rx="4"
|
|
672
|
-
fill="var(--ax-border-neutral
|
|
672
|
+
fill="var(--ax-border-neutral)"
|
|
673
673
|
/>
|
|
674
674
|
<rect
|
|
675
675
|
x="1"
|
|
@@ -677,7 +677,7 @@ export const ActionMenuCheckboxItem = forwardRef<
|
|
|
677
677
|
width="22"
|
|
678
678
|
height="22"
|
|
679
679
|
rx="3"
|
|
680
|
-
fill="var(--ax-bg-default
|
|
680
|
+
fill="var(--ax-bg-default)"
|
|
681
681
|
strokeWidth="2"
|
|
682
682
|
/>
|
|
683
683
|
</g>
|
|
@@ -690,7 +690,7 @@ export const ActionMenuCheckboxItem = forwardRef<
|
|
|
690
690
|
width="24"
|
|
691
691
|
height="24"
|
|
692
692
|
rx="4"
|
|
693
|
-
fill="var(--ax-bg-strong-pressed
|
|
693
|
+
fill="var(--ax-bg-strong-pressed)"
|
|
694
694
|
/>
|
|
695
695
|
<rect
|
|
696
696
|
x="6"
|
|
@@ -698,7 +698,7 @@ export const ActionMenuCheckboxItem = forwardRef<
|
|
|
698
698
|
width="12"
|
|
699
699
|
height="4"
|
|
700
700
|
rx="1"
|
|
701
|
-
fill="var(--ax-bg-default
|
|
701
|
+
fill="var(--ax-bg-default)"
|
|
702
702
|
/>
|
|
703
703
|
</g>
|
|
704
704
|
<g className={cn("navds-action-menu__indicator-icon--checked")}>
|
|
@@ -706,11 +706,11 @@ export const ActionMenuCheckboxItem = forwardRef<
|
|
|
706
706
|
width="24"
|
|
707
707
|
height="24"
|
|
708
708
|
rx="4"
|
|
709
|
-
fill="var(--ax-bg-strong-pressed
|
|
709
|
+
fill="var(--ax-bg-strong-pressed)"
|
|
710
710
|
/>
|
|
711
711
|
<path
|
|
712
712
|
d="M10.0352 13.4148L16.4752 7.40467C17.0792 6.83965 18.029 6.86933 18.5955 7.47478C19.162 8.08027 19.1296 9.03007 18.5245 9.59621L11.0211 16.5993C10.741 16.859 10.3756 17 10.0002 17C9.60651 17 9.22717 16.8462 8.93914 16.5611L6.43914 14.0611C5.85362 13.4756 5.85362 12.5254 6.43914 11.9399C7.02467 11.3544 7.97483 11.3544 8.56036 11.9399L10.0352 13.4148Z"
|
|
713
|
-
fill="var(--ax-bg-default
|
|
713
|
+
fill="var(--ax-bg-default)"
|
|
714
714
|
/>
|
|
715
715
|
</g>
|
|
716
716
|
</svg>
|
|
@@ -776,7 +776,6 @@ export const ActionMenuRadioItem = forwardRef<
|
|
|
776
776
|
ref,
|
|
777
777
|
) => {
|
|
778
778
|
const { cn } = useRenameCSS();
|
|
779
|
-
const themeContext = useThemeInternal();
|
|
780
779
|
|
|
781
780
|
return (
|
|
782
781
|
<Menu.RadioItem
|
|
@@ -811,7 +810,7 @@ export const ActionMenuRadioItem = forwardRef<
|
|
|
811
810
|
width="24"
|
|
812
811
|
height="24"
|
|
813
812
|
rx="12"
|
|
814
|
-
fill="var(--ax-border-neutral
|
|
813
|
+
fill="var(--ax-border-neutral)"
|
|
815
814
|
/>
|
|
816
815
|
<rect
|
|
817
816
|
x="1"
|
|
@@ -820,51 +819,25 @@ export const ActionMenuRadioItem = forwardRef<
|
|
|
820
819
|
height="22"
|
|
821
820
|
rx="11"
|
|
822
821
|
strokeWidth="2"
|
|
823
|
-
fill="var(--ax-bg-default
|
|
822
|
+
fill="var(--ax-bg-default)"
|
|
823
|
+
/>
|
|
824
|
+
</g>
|
|
825
|
+
<g className={cn("navds-action-menu__indicator-icon--checked")}>
|
|
826
|
+
<rect
|
|
827
|
+
width="24"
|
|
828
|
+
height="24"
|
|
829
|
+
rx="12"
|
|
830
|
+
fill="var(--ax-bg-strong-pressed)"
|
|
831
|
+
/>
|
|
832
|
+
<rect
|
|
833
|
+
x="8"
|
|
834
|
+
y="8"
|
|
835
|
+
width="8"
|
|
836
|
+
height="8"
|
|
837
|
+
rx="4"
|
|
838
|
+
fill="var(--ax-bg-default)"
|
|
824
839
|
/>
|
|
825
840
|
</g>
|
|
826
|
-
{themeContext?.isDarkside ? (
|
|
827
|
-
<g className={cn("navds-action-menu__indicator-icon--checked")}>
|
|
828
|
-
<rect
|
|
829
|
-
width="24"
|
|
830
|
-
height="24"
|
|
831
|
-
rx="12"
|
|
832
|
-
fill="var(--ax-bg-strong-pressed)"
|
|
833
|
-
/>
|
|
834
|
-
<rect
|
|
835
|
-
x="8"
|
|
836
|
-
y="8"
|
|
837
|
-
width="8"
|
|
838
|
-
height="8"
|
|
839
|
-
rx="4"
|
|
840
|
-
fill="var(--ax-bg-default, var(--a-surface-default))"
|
|
841
|
-
/>
|
|
842
|
-
</g>
|
|
843
|
-
) : (
|
|
844
|
-
<g className={cn("navds-action-menu__indicator-icon--checked")}>
|
|
845
|
-
<rect
|
|
846
|
-
x="1"
|
|
847
|
-
y="1"
|
|
848
|
-
width="22"
|
|
849
|
-
height="22"
|
|
850
|
-
rx="11"
|
|
851
|
-
fill="var(--ax-bg-default, var(--a-surface-default))"
|
|
852
|
-
/>
|
|
853
|
-
<rect
|
|
854
|
-
x="1"
|
|
855
|
-
y="1"
|
|
856
|
-
width="22"
|
|
857
|
-
height="22"
|
|
858
|
-
rx="11"
|
|
859
|
-
stroke="var(--ax-bg-strong-pressed, var(--a-surface-action-selected))"
|
|
860
|
-
strokeWidth="2"
|
|
861
|
-
/>
|
|
862
|
-
<path
|
|
863
|
-
d="M20 12C20 16.4178 16.4178 20 12 20C7.58222 20 4 16.4178 4 12C4 7.58222 7.58222 4 12 4C16.4178 4 20 7.58222 20 12Z"
|
|
864
|
-
fill="var(--ax-bg-strong-pressed, var(--a-surface-action-selected))"
|
|
865
|
-
/>
|
|
866
|
-
</g>
|
|
867
|
-
)}
|
|
868
841
|
</svg>
|
|
869
842
|
</Menu.ItemIndicator>
|
|
870
843
|
</Marker>
|
|
@@ -988,7 +961,7 @@ interface ActionMenuSubContentProps
|
|
|
988
961
|
export const ActionMenuSubContent = forwardRef<
|
|
989
962
|
ActionMenuSubContentElement,
|
|
990
963
|
ActionMenuSubContentProps
|
|
991
|
-
>(({ children, className,
|
|
964
|
+
>(({ children, className, ...rest }: ActionMenuSubContentProps, ref) => {
|
|
992
965
|
const { cn } = useRenameCSS();
|
|
993
966
|
const context = useActionMenuContext();
|
|
994
967
|
|
|
@@ -1004,20 +977,6 @@ export const ActionMenuSubContent = forwardRef<
|
|
|
1004
977
|
"navds-action-menu__content navds-action-menu__sub-content",
|
|
1005
978
|
className,
|
|
1006
979
|
)}
|
|
1007
|
-
style={{
|
|
1008
|
-
...style,
|
|
1009
|
-
...{
|
|
1010
|
-
"--ac-action-menu-content-transform-origin":
|
|
1011
|
-
"var(--ac-floating-transform-origin)",
|
|
1012
|
-
"--ac-action-menu-content-available-width":
|
|
1013
|
-
"var(--ac-floating-available-width)",
|
|
1014
|
-
"--ac-action-menu-content-available-height":
|
|
1015
|
-
"var(--ac-floating-available-height)",
|
|
1016
|
-
"--ac-action-menu-trigger-width": "var(--ac-floating-anchor-width)",
|
|
1017
|
-
"--ac-action-menu-trigger-height":
|
|
1018
|
-
"var(--ac-floating-anchor-height)",
|
|
1019
|
-
},
|
|
1020
|
-
}}
|
|
1021
980
|
>
|
|
1022
981
|
<div className={cn("navds-action-menu__content-inner")}>{children}</div>
|
|
1023
982
|
</Menu.SubContent>
|
|
@@ -316,19 +316,19 @@ const FloatingContent = forwardRef<HTMLDivElement, FloatingContentProps>(
|
|
|
316
316
|
* Allows styling and animations based on the available space.
|
|
317
317
|
*/
|
|
318
318
|
contentStyle.setProperty(
|
|
319
|
-
"--
|
|
319
|
+
"--__axc-floating-available-width",
|
|
320
320
|
`${availableWidth}px`,
|
|
321
321
|
);
|
|
322
322
|
contentStyle.setProperty(
|
|
323
|
-
"--
|
|
323
|
+
"--__axc-floating-available-height",
|
|
324
324
|
`${availableHeight}px`,
|
|
325
325
|
);
|
|
326
326
|
contentStyle.setProperty(
|
|
327
|
-
"--
|
|
327
|
+
"--__axc-floating-anchor-width",
|
|
328
328
|
`${anchorWidth}px`,
|
|
329
329
|
);
|
|
330
330
|
contentStyle.setProperty(
|
|
331
|
-
"--
|
|
331
|
+
"--__axc-floating-anchor-height",
|
|
332
332
|
`${anchorHeight}px`,
|
|
333
333
|
);
|
|
334
334
|
},
|
|
@@ -388,7 +388,7 @@ const FloatingContent = forwardRef<HTMLDivElement, FloatingContentProps>(
|
|
|
388
388
|
: "translate(0, -200%)", // keep off the page when measuring
|
|
389
389
|
minWidth: "max-content",
|
|
390
390
|
zIndex: "9999999",
|
|
391
|
-
["--
|
|
391
|
+
["--__axc-floating-transform-origin" as any]: [
|
|
392
392
|
middlewareData.transformOrigin?.x,
|
|
393
393
|
middlewareData.transformOrigin?.y,
|
|
394
394
|
].join(" "),
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
2
|
import React, { forwardRef } from "react";
|
|
3
3
|
import { ChevronLeftIcon, ChevronRightIcon } from "@navikt/aksel-icons";
|
|
4
|
+
import type { AkselStatusColorRole } from "@navikt/ds-tokens/types";
|
|
4
5
|
import { useRenameCSS } from "../theme/Theme";
|
|
6
|
+
import { AkselColor } from "../types";
|
|
5
7
|
import { BodyShort, Heading } from "../typography";
|
|
6
8
|
import { useId } from "../util";
|
|
7
9
|
import { useI18n } from "../util/i18n/i18n.hooks";
|
|
@@ -68,6 +70,16 @@ export interface PaginationProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
68
70
|
tag: "h2" | "h3" | "h4" | "h5" | "h6";
|
|
69
71
|
text: string;
|
|
70
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* Overrides color.
|
|
75
|
+
*
|
|
76
|
+
* We have disallowed status-colors.
|
|
77
|
+
* @default "neutral"
|
|
78
|
+
* @see 🏷️ {@link AkselColor}
|
|
79
|
+
* @see [📝 Documentation](https://aksel.nav.no/grunnleggende/styling/farger-tokens)
|
|
80
|
+
* @private
|
|
81
|
+
*/
|
|
82
|
+
"data-color"?: Exclude<AkselColor, AkselStatusColorRole>;
|
|
71
83
|
}
|
|
72
84
|
|
|
73
85
|
interface PaginationType
|
|
@@ -113,12 +125,6 @@ export const getSteps = ({
|
|
|
113
125
|
];
|
|
114
126
|
};
|
|
115
127
|
|
|
116
|
-
/**
|
|
117
|
-
* TODO: These classes can be removed in darkside update
|
|
118
|
-
* - navds-pagination--prev-next--with-text
|
|
119
|
-
* - navds-pagination__prev-next
|
|
120
|
-
*/
|
|
121
|
-
|
|
122
128
|
/**
|
|
123
129
|
* A component that displays pagination controls.
|
|
124
130
|
*
|
|
@@ -150,7 +156,7 @@ export const Pagination = forwardRef<HTMLElement, PaginationProps>(
|
|
|
150
156
|
srHeading,
|
|
151
157
|
"aria-labelledby": ariaLabelledBy,
|
|
152
158
|
renderItem: Item = PaginationItem,
|
|
153
|
-
"data-color": color,
|
|
159
|
+
"data-color": color = "neutral",
|
|
154
160
|
...rest
|
|
155
161
|
},
|
|
156
162
|
ref,
|
|
@@ -204,9 +210,8 @@ export const Pagination = forwardRef<HTMLElement, PaginationProps>(
|
|
|
204
210
|
<li>
|
|
205
211
|
<Item
|
|
206
212
|
data-color={color}
|
|
207
|
-
className={cn(
|
|
213
|
+
className={cn({
|
|
208
214
|
"navds-pagination--invisible": page === 1,
|
|
209
|
-
"navds-pagination--prev-next--with-text": prevNextTexts,
|
|
210
215
|
})}
|
|
211
216
|
disabled={page === 1}
|
|
212
217
|
onClick={() => onPageChange?.(page - 1)}
|
|
@@ -257,9 +262,8 @@ export const Pagination = forwardRef<HTMLElement, PaginationProps>(
|
|
|
257
262
|
<li>
|
|
258
263
|
<Item
|
|
259
264
|
data-color={color}
|
|
260
|
-
className={cn(
|
|
265
|
+
className={cn({
|
|
261
266
|
"navds-pagination--invisible": page === count,
|
|
262
|
-
"navds-pagination--prev-next--with-text": prevNextTexts,
|
|
263
267
|
})}
|
|
264
268
|
disabled={page === count}
|
|
265
269
|
onClick={() => onPageChange?.(page + 1)}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { forwardRef } from "react";
|
|
2
2
|
import { Button, ButtonProps } from "../button";
|
|
3
|
-
import { useRenameCSS
|
|
3
|
+
import { useRenameCSS } from "../theme/Theme";
|
|
4
4
|
import { OverridableComponent } from "../util/types";
|
|
5
5
|
|
|
6
6
|
export interface PaginationItemProps extends ButtonProps {
|
|
@@ -37,16 +37,15 @@ export const Item: PaginationItemType = forwardRef(
|
|
|
37
37
|
page,
|
|
38
38
|
"data-color": color,
|
|
39
39
|
...rest
|
|
40
|
-
},
|
|
40
|
+
}: PaginationItemProps & { as?: React.ElementType },
|
|
41
41
|
ref,
|
|
42
42
|
) => {
|
|
43
|
-
const themeContext = useThemeInternal();
|
|
44
43
|
const { cn } = useRenameCSS();
|
|
45
44
|
|
|
46
45
|
return (
|
|
47
46
|
<Button
|
|
48
47
|
as={Component}
|
|
49
|
-
variant=
|
|
48
|
+
variant="tertiary"
|
|
50
49
|
data-color={color}
|
|
51
50
|
aria-current={selected}
|
|
52
51
|
data-pressed={selected}
|
package/src/panel/Panel.tsx
CHANGED
|
@@ -23,8 +23,8 @@ export type PanelType = OverridableComponent<PanelProps, HTMLElement>;
|
|
|
23
23
|
* @deprecated
|
|
24
24
|
* Use Box with padding and border instead
|
|
25
25
|
* ```
|
|
26
|
-
* <Box padding="4" borderRadius="
|
|
27
|
-
* <Box padding="4" borderWidth="1" borderRadius="
|
|
26
|
+
* <Box padding="4" borderRadius="2" />
|
|
27
|
+
* <Box padding="4" borderWidth="1" borderRadius="2" />
|
|
28
28
|
* ```
|
|
29
29
|
* Component will be removed in a future major release
|
|
30
30
|
*/
|