@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
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { ButtonHTMLAttributes, forwardRef, useState } from "react";
|
|
2
2
|
import { CheckmarkIcon, FilesIcon } from "@navikt/aksel-icons";
|
|
3
|
+
import type { AkselStatusColorRole } from "@navikt/ds-tokens/types";
|
|
3
4
|
import { Button, ButtonProps } from "../button";
|
|
4
|
-
import { useRenameCSS
|
|
5
|
-
import {
|
|
5
|
+
import { useRenameCSS } from "../theme/Theme";
|
|
6
|
+
import type { AkselColor } from "../types/theme";
|
|
6
7
|
import { composeEventHandlers } from "../util/composeEventHandlers";
|
|
7
8
|
import copy from "../util/copy";
|
|
8
9
|
import { useTimeout } from "../util/hooks/useTimeout";
|
|
@@ -12,9 +13,18 @@ export interface CopyButtonProps
|
|
|
12
13
|
extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children">,
|
|
13
14
|
Pick<ButtonProps, "iconPosition" | "size"> {
|
|
14
15
|
/**
|
|
15
|
-
* @
|
|
16
|
+
* @deprecated Use `data-color` attribute instead.
|
|
16
17
|
*/
|
|
17
18
|
variant?: "action" | "neutral";
|
|
19
|
+
/**
|
|
20
|
+
* Overrides color.
|
|
21
|
+
*
|
|
22
|
+
* We recommend only using `accent` and `neutral`. We have disallowed status-colors.
|
|
23
|
+
* @default "neutral"
|
|
24
|
+
* @see 🏷️ {@link AkselColor}
|
|
25
|
+
* @see [📝 Documentation](https://aksel.nav.no/grunnleggende/styling/farger-tokens)
|
|
26
|
+
*/
|
|
27
|
+
"data-color"?: Exclude<AkselColor, AkselStatusColorRole>;
|
|
18
28
|
/**
|
|
19
29
|
* Text to copy to clipboard.
|
|
20
30
|
*/
|
|
@@ -36,7 +46,7 @@ export interface CopyButtonProps
|
|
|
36
46
|
*/
|
|
37
47
|
onActiveChange?: (state: boolean) => void;
|
|
38
48
|
/**
|
|
39
|
-
*
|
|
49
|
+
* Icon shown when button is not clicked.
|
|
40
50
|
* @default <FilesIcon />
|
|
41
51
|
*/
|
|
42
52
|
icon?: React.ReactNode;
|
|
@@ -75,7 +85,8 @@ export const CopyButton = forwardRef<HTMLButtonElement, CopyButtonProps>(
|
|
|
75
85
|
copyText,
|
|
76
86
|
text,
|
|
77
87
|
activeText,
|
|
78
|
-
variant
|
|
88
|
+
variant,
|
|
89
|
+
"data-color": dataColor = "neutral",
|
|
79
90
|
onActiveChange,
|
|
80
91
|
icon,
|
|
81
92
|
activeIcon,
|
|
@@ -94,8 +105,6 @@ export const CopyButton = forwardRef<HTMLButtonElement, CopyButtonProps>(
|
|
|
94
105
|
|
|
95
106
|
const { cn } = useRenameCSS();
|
|
96
107
|
|
|
97
|
-
const themeContext = useThemeInternal();
|
|
98
|
-
|
|
99
108
|
const handleClick = () => {
|
|
100
109
|
copy(copyText);
|
|
101
110
|
setActive(true);
|
|
@@ -109,98 +118,52 @@ export const CopyButton = forwardRef<HTMLButtonElement, CopyButtonProps>(
|
|
|
109
118
|
|
|
110
119
|
const activeString = activeText || translate("activeText");
|
|
111
120
|
|
|
112
|
-
const copyIcon = (
|
|
113
|
-
<LegacyIconWrapper useLegacy={!themeContext?.isDarkside}>
|
|
114
|
-
{active
|
|
115
|
-
? (activeIcon ?? (
|
|
116
|
-
<CheckmarkIcon
|
|
117
|
-
aria-hidden={!!text}
|
|
118
|
-
title={text ? undefined : activeString}
|
|
119
|
-
className={
|
|
120
|
-
themeContext?.isDarkside
|
|
121
|
-
? cn("navds-copybutton__icon")
|
|
122
|
-
: undefined
|
|
123
|
-
}
|
|
124
|
-
/>
|
|
125
|
-
))
|
|
126
|
-
: (icon ?? (
|
|
127
|
-
<FilesIcon
|
|
128
|
-
aria-hidden={!!text}
|
|
129
|
-
title={text ? undefined : title || translate("title")}
|
|
130
|
-
className={
|
|
131
|
-
themeContext?.isDarkside
|
|
132
|
-
? cn("navds-copybutton__icon")
|
|
133
|
-
: undefined
|
|
134
|
-
}
|
|
135
|
-
/>
|
|
136
|
-
))}
|
|
137
|
-
</LegacyIconWrapper>
|
|
138
|
-
);
|
|
139
|
-
|
|
140
|
-
if (themeContext?.isDarkside) {
|
|
141
|
-
return (
|
|
142
|
-
<Button
|
|
143
|
-
ref={ref}
|
|
144
|
-
type="button"
|
|
145
|
-
className={cn("navds-copybutton", className)}
|
|
146
|
-
{...rest}
|
|
147
|
-
variant={variant === "action" ? "tertiary" : "tertiary-neutral"}
|
|
148
|
-
onClick={composeEventHandlers(onClick, handleClick)}
|
|
149
|
-
iconPosition={iconPosition}
|
|
150
|
-
icon={copyIcon}
|
|
151
|
-
data-active={active}
|
|
152
|
-
size={size}
|
|
153
|
-
>
|
|
154
|
-
{text ? (active ? activeString : text) : null}
|
|
155
|
-
</Button>
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
121
|
return (
|
|
160
|
-
<
|
|
122
|
+
<Button
|
|
161
123
|
ref={ref}
|
|
162
124
|
type="button"
|
|
125
|
+
className={cn("navds-copybutton", className)}
|
|
163
126
|
{...rest}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
className,
|
|
167
|
-
`navds-copybutton--${size}`,
|
|
168
|
-
`navds-copybutton--${variant}`,
|
|
169
|
-
{
|
|
170
|
-
"navds-copybutton--icon-only": !text,
|
|
171
|
-
"navds-copybutton--icon-right": iconPosition === "right",
|
|
172
|
-
"navds-copybutton--active": active,
|
|
173
|
-
},
|
|
174
|
-
)}
|
|
127
|
+
variant="tertiary"
|
|
128
|
+
data-color={variantToDataColor(variant) ?? dataColor}
|
|
175
129
|
onClick={composeEventHandlers(onClick, handleClick)}
|
|
130
|
+
iconPosition={iconPosition}
|
|
131
|
+
icon={
|
|
132
|
+
active
|
|
133
|
+
? (activeIcon ?? (
|
|
134
|
+
<CheckmarkIcon
|
|
135
|
+
aria-hidden={!!text}
|
|
136
|
+
title={text ? undefined : activeString}
|
|
137
|
+
className={cn("navds-copybutton__icon")}
|
|
138
|
+
/>
|
|
139
|
+
))
|
|
140
|
+
: (icon ?? (
|
|
141
|
+
<FilesIcon
|
|
142
|
+
aria-hidden={!!text}
|
|
143
|
+
title={text ? undefined : title || translate("title")}
|
|
144
|
+
className={cn("navds-copybutton__icon")}
|
|
145
|
+
/>
|
|
146
|
+
))
|
|
147
|
+
}
|
|
148
|
+
data-active={active}
|
|
149
|
+
size={size}
|
|
176
150
|
>
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
{text && (
|
|
180
|
-
<Label as="span" size={size === "medium" ? "medium" : "small"}>
|
|
181
|
-
{active ? activeString : text}
|
|
182
|
-
</Label>
|
|
183
|
-
)}
|
|
184
|
-
{iconPosition === "right" && copyIcon}
|
|
185
|
-
</span>
|
|
186
|
-
</button>
|
|
151
|
+
{text ? (active ? activeString : text) : null}
|
|
152
|
+
</Button>
|
|
187
153
|
);
|
|
188
154
|
},
|
|
189
155
|
);
|
|
190
156
|
|
|
191
|
-
function
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
if (!useLegacy) {
|
|
201
|
-
return children;
|
|
157
|
+
function variantToDataColor(
|
|
158
|
+
variant: CopyButtonProps["variant"],
|
|
159
|
+
): Exclude<AkselColor, AkselStatusColorRole> | undefined {
|
|
160
|
+
if (variant === "action") {
|
|
161
|
+
return "accent";
|
|
162
|
+
}
|
|
163
|
+
if (variant === "neutral") {
|
|
164
|
+
return "neutral";
|
|
202
165
|
}
|
|
203
|
-
return
|
|
166
|
+
return undefined;
|
|
204
167
|
}
|
|
205
168
|
|
|
206
169
|
export default CopyButton;
|
package/src/date/Date.Dialog.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { forwardRef, useRef } from "react";
|
|
2
2
|
import { useRenameCSS } from "../theme/Theme";
|
|
3
|
+
import type { AkselColor } from "../types";
|
|
3
4
|
import { useControllableState } from "../util/hooks";
|
|
4
5
|
import { OverridableComponent } from "../util/types";
|
|
5
6
|
import ExpansionCardContent, {
|
|
@@ -68,6 +69,12 @@ interface ExpansionCardCommonProps
|
|
|
68
69
|
* @default "medium"
|
|
69
70
|
*/
|
|
70
71
|
size?: "medium" | "small";
|
|
72
|
+
/**
|
|
73
|
+
* Overrides inherited color.
|
|
74
|
+
* @see 🏷️ {@link AkselColor}
|
|
75
|
+
* @see [📝 Documentation](https://aksel.nav.no/grunnleggende/styling/farger-tokens)
|
|
76
|
+
*/
|
|
77
|
+
"data-color"?: AkselColor;
|
|
71
78
|
}
|
|
72
79
|
|
|
73
80
|
type ExpansionCardConditionalProps =
|
|
@@ -146,7 +153,6 @@ export const ExpansionCard = forwardRef<HTMLDivElement, ExpansionCardProps>(
|
|
|
146
153
|
className,
|
|
147
154
|
`navds-expansioncard--${size}`,
|
|
148
155
|
{
|
|
149
|
-
"navds-expansioncard--open": open ?? _open,
|
|
150
156
|
"navds-expansioncard--no-animation": !shouldFade.current,
|
|
151
157
|
},
|
|
152
158
|
)}
|
|
@@ -31,9 +31,7 @@ const ExpansionCardHeader = forwardRef<
|
|
|
31
31
|
className={cn("navds-expansioncard__header", className)}
|
|
32
32
|
data-open={panelContext.open}
|
|
33
33
|
>
|
|
34
|
-
<div
|
|
35
|
-
{children}
|
|
36
|
-
</div>
|
|
34
|
+
<div>{children}</div>
|
|
37
35
|
|
|
38
36
|
<button
|
|
39
37
|
className={cn("navds-expansioncard__header-button")}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
2
|
import React, { forwardRef } from "react";
|
|
3
|
-
import { useRenameCSS
|
|
3
|
+
import { useRenameCSS } from "../../theme/Theme";
|
|
4
4
|
import { BodyShort } from "../../typography";
|
|
5
5
|
import { omit, useId } from "../../util";
|
|
6
6
|
import { ReadOnlyIconWithTitle } from "../ReadOnlyIcon";
|
|
@@ -12,95 +12,6 @@ export const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(
|
|
|
12
12
|
const { cn } = useRenameCSS();
|
|
13
13
|
const { inputProps, hasError, size, readOnly, nested } = useCheckbox(props);
|
|
14
14
|
const descriptionId = useId();
|
|
15
|
-
const themeContext = useThemeInternal();
|
|
16
|
-
|
|
17
|
-
if (themeContext?.isDarkside) {
|
|
18
|
-
return (
|
|
19
|
-
<div
|
|
20
|
-
className={cn(
|
|
21
|
-
props.className,
|
|
22
|
-
"navds-checkbox",
|
|
23
|
-
`navds-checkbox--${size}`,
|
|
24
|
-
{
|
|
25
|
-
"navds-checkbox--error": hasError,
|
|
26
|
-
"navds-checkbox--disabled": inputProps.disabled,
|
|
27
|
-
"navds-checkbox--readonly": readOnly,
|
|
28
|
-
},
|
|
29
|
-
)}
|
|
30
|
-
data-color={hasError ? "danger" : props["data-color"]}
|
|
31
|
-
>
|
|
32
|
-
<div className={cn("navds-checkbox__input-wrapper")}>
|
|
33
|
-
<input
|
|
34
|
-
{...omit(props, [
|
|
35
|
-
"children",
|
|
36
|
-
"size",
|
|
37
|
-
"error",
|
|
38
|
-
"description",
|
|
39
|
-
"hideLabel",
|
|
40
|
-
"indeterminate",
|
|
41
|
-
"errorId",
|
|
42
|
-
"readOnly",
|
|
43
|
-
])}
|
|
44
|
-
{...omit(inputProps, ["aria-invalid", "aria-describedby"])}
|
|
45
|
-
aria-describedby={
|
|
46
|
-
cl(inputProps["aria-describedby"], {
|
|
47
|
-
[descriptionId]: props.description,
|
|
48
|
-
}) || undefined
|
|
49
|
-
}
|
|
50
|
-
type="checkbox"
|
|
51
|
-
className={cn("navds-checkbox__input")}
|
|
52
|
-
ref={(el) => {
|
|
53
|
-
if (el) {
|
|
54
|
-
el.indeterminate = props.indeterminate ?? false;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (typeof ref === "function") {
|
|
58
|
-
ref(el);
|
|
59
|
-
} else if (ref != null) {
|
|
60
|
-
ref.current = el;
|
|
61
|
-
}
|
|
62
|
-
}}
|
|
63
|
-
/>
|
|
64
|
-
<svg
|
|
65
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
66
|
-
viewBox="0 0 13 10"
|
|
67
|
-
fill="none"
|
|
68
|
-
focusable={false}
|
|
69
|
-
role="img"
|
|
70
|
-
aria-hidden
|
|
71
|
-
className={cn("navds-checkbox__icon")}
|
|
72
|
-
>
|
|
73
|
-
<path
|
|
74
|
-
d="M4.03524 6.41478L10.4752 0.404669C11.0792 -0.160351 12.029 -0.130672 12.5955 0.47478C13.162 1.08027 13.1296 2.03007 12.5245 2.59621L5.02111 9.59934C4.74099 9.85904 4.37559 10 4.00025 10C3.60651 10 3.22717 9.84621 2.93914 9.56111L0.439143 7.06111C-0.146381 6.47558 -0.146381 5.52542 0.439143 4.93989C1.02467 4.35437 1.97483 4.35437 2.56036 4.93989L4.03524 6.41478Z"
|
|
75
|
-
fill="currentColor"
|
|
76
|
-
/>
|
|
77
|
-
</svg>
|
|
78
|
-
</div>
|
|
79
|
-
<BodyShort
|
|
80
|
-
as="label"
|
|
81
|
-
htmlFor={inputProps.id}
|
|
82
|
-
size={size}
|
|
83
|
-
className={cn("navds-checkbox__label", {
|
|
84
|
-
"navds-sr-only": props.hideLabel,
|
|
85
|
-
})}
|
|
86
|
-
>
|
|
87
|
-
{!nested && readOnly && <ReadOnlyIconWithTitle />}
|
|
88
|
-
{props.children}
|
|
89
|
-
</BodyShort>
|
|
90
|
-
{props.description && (
|
|
91
|
-
<BodyShort
|
|
92
|
-
id={descriptionId}
|
|
93
|
-
size={size}
|
|
94
|
-
className={cn(
|
|
95
|
-
"navds-form-field__subdescription navds-checkbox__description",
|
|
96
|
-
)}
|
|
97
|
-
>
|
|
98
|
-
{props.description}
|
|
99
|
-
</BodyShort>
|
|
100
|
-
)}
|
|
101
|
-
</div>
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
15
|
|
|
105
16
|
return (
|
|
106
17
|
<div
|
|
@@ -116,75 +27,75 @@ export const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(
|
|
|
116
27
|
)}
|
|
117
28
|
data-color={hasError ? "danger" : props["data-color"]}
|
|
118
29
|
>
|
|
119
|
-
<
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
30
|
+
<div className={cn("navds-checkbox__input-wrapper")}>
|
|
31
|
+
<input
|
|
32
|
+
{...omit(props, [
|
|
33
|
+
"children",
|
|
34
|
+
"size",
|
|
35
|
+
"error",
|
|
36
|
+
"description",
|
|
37
|
+
"hideLabel",
|
|
38
|
+
"indeterminate",
|
|
39
|
+
"errorId",
|
|
40
|
+
"readOnly",
|
|
41
|
+
])}
|
|
42
|
+
{...omit(inputProps, ["aria-invalid", "aria-describedby"])}
|
|
43
|
+
aria-describedby={
|
|
44
|
+
cl(inputProps["aria-describedby"], {
|
|
45
|
+
[descriptionId]: props.description,
|
|
46
|
+
}) || undefined
|
|
136
47
|
}
|
|
48
|
+
type="checkbox"
|
|
49
|
+
className={cn("navds-checkbox__input")}
|
|
50
|
+
ref={(el) => {
|
|
51
|
+
if (el) {
|
|
52
|
+
el.indeterminate = props.indeterminate ?? false;
|
|
53
|
+
}
|
|
137
54
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
aria-hidden
|
|
154
|
-
>
|
|
155
|
-
<path
|
|
156
|
-
d="M4.03524 6.41478L10.4752 0.404669C11.0792 -0.160351 12.029 -0.130672 12.5955 0.47478C13.162 1.08027 13.1296 2.03007 12.5245 2.59621L5.02111 9.59934C4.74099 9.85904 4.37559 10 4.00025 10C3.60651 10 3.22717 9.84621 2.93914 9.56111L0.439143 7.06111C-0.146381 6.47558 -0.146381 5.52542 0.439143 4.93989C1.02467 4.35437 1.97483 4.35437 2.56036 4.93989L4.03524 6.41478Z"
|
|
157
|
-
fill="currentColor"
|
|
158
|
-
/>
|
|
159
|
-
</svg>
|
|
160
|
-
</span>
|
|
161
|
-
<span className={cn("navds-checkbox__icon-indeterminate")} />
|
|
162
|
-
<span
|
|
163
|
-
className={cn("navds-checkbox__content", {
|
|
164
|
-
"navds-sr-only": props.hideLabel,
|
|
165
|
-
})}
|
|
55
|
+
if (typeof ref === "function") {
|
|
56
|
+
ref(el);
|
|
57
|
+
} else if (ref != null) {
|
|
58
|
+
ref.current = el;
|
|
59
|
+
}
|
|
60
|
+
}}
|
|
61
|
+
/>
|
|
62
|
+
<svg
|
|
63
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
64
|
+
viewBox="0 0 13 10"
|
|
65
|
+
fill="none"
|
|
66
|
+
focusable={false}
|
|
67
|
+
role="img"
|
|
68
|
+
aria-hidden
|
|
69
|
+
className={cn("navds-checkbox__icon")}
|
|
166
70
|
>
|
|
167
|
-
<
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
71
|
+
<path
|
|
72
|
+
d="M4.03524 6.41478L10.4752 0.404669C11.0792 -0.160351 12.029 -0.130672 12.5955 0.47478C13.162 1.08027 13.1296 2.03007 12.5245 2.59621L5.02111 9.59934C4.74099 9.85904 4.37559 10 4.00025 10C3.60651 10 3.22717 9.84621 2.93914 9.56111L0.439143 7.06111C-0.146381 6.47558 -0.146381 5.52542 0.439143 4.93989C1.02467 4.35437 1.97483 4.35437 2.56036 4.93989L4.03524 6.41478Z"
|
|
73
|
+
fill="currentColor"
|
|
74
|
+
/>
|
|
75
|
+
</svg>
|
|
76
|
+
</div>
|
|
77
|
+
<BodyShort
|
|
78
|
+
as="label"
|
|
79
|
+
htmlFor={inputProps.id}
|
|
80
|
+
size={size}
|
|
81
|
+
className={cn("navds-checkbox__label", {
|
|
82
|
+
"navds-sr-only": props.hideLabel,
|
|
83
|
+
})}
|
|
84
|
+
>
|
|
85
|
+
{!nested && readOnly && <ReadOnlyIconWithTitle />}
|
|
86
|
+
{props.children}
|
|
87
|
+
</BodyShort>
|
|
88
|
+
{props.description && (
|
|
89
|
+
<BodyShort
|
|
90
|
+
id={descriptionId}
|
|
91
|
+
size={size}
|
|
92
|
+
className={cn(
|
|
93
|
+
"navds-form-field__subdescription navds-checkbox__description",
|
|
185
94
|
)}
|
|
186
|
-
|
|
187
|
-
|
|
95
|
+
>
|
|
96
|
+
{props.description}
|
|
97
|
+
</BodyShort>
|
|
98
|
+
)}
|
|
188
99
|
</div>
|
|
189
100
|
);
|
|
190
101
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useRef, useState } from "react";
|
|
2
2
|
import { DismissableLayer } from "../../../overlays/dismissablelayer/DismissableLayer";
|
|
3
3
|
import { Floating } from "../../../overlays/floating/Floating";
|
|
4
|
-
import { useRenameCSS
|
|
4
|
+
import { useRenameCSS } from "../../../theme/Theme";
|
|
5
5
|
import { useClientLayoutEffect } from "../../../util";
|
|
6
6
|
import { useInputContext } from "../Input/Input.context";
|
|
7
7
|
import { useSelectedOptionsContext } from "../SelectedOptions/selectedOptionsContext";
|
|
@@ -15,7 +15,6 @@ import { useFilteredOptionsContext } from "./filteredOptionsContext";
|
|
|
15
15
|
|
|
16
16
|
const FilteredOptions = () => {
|
|
17
17
|
const { cn } = useRenameCSS();
|
|
18
|
-
const themeContext = useThemeInternal();
|
|
19
18
|
const {
|
|
20
19
|
inputProps: { id },
|
|
21
20
|
anchorRef,
|
|
@@ -55,8 +54,6 @@ const FilteredOptions = () => {
|
|
|
55
54
|
(allowNewValues && isValueNew && !maxSelected.isLimitReached) || // Render add new option
|
|
56
55
|
filteredOptions.length > 0; // Render filtered options
|
|
57
56
|
|
|
58
|
-
const height = themeContext?.isDarkside ? "316px" : "290px";
|
|
59
|
-
|
|
60
57
|
return (
|
|
61
58
|
<DismissableLayer
|
|
62
59
|
asChild
|
|
@@ -84,8 +81,8 @@ const FilteredOptions = () => {
|
|
|
84
81
|
enabled={isListOpen}
|
|
85
82
|
style={{
|
|
86
83
|
maxHeight: localOpen
|
|
87
|
-
? `min(
|
|
88
|
-
:
|
|
84
|
+
? `min(316px, var(--__axc-floating-available-height))`
|
|
85
|
+
: `316px`,
|
|
89
86
|
}}
|
|
90
87
|
autoUpdateWhileMounted={false}
|
|
91
88
|
>
|
|
@@ -27,12 +27,7 @@ const Option = ({ option }: { option: ComboboxOption }) => {
|
|
|
27
27
|
|
|
28
28
|
if (readOnly || inputProps.disabled) {
|
|
29
29
|
return (
|
|
30
|
-
<Chips.Toggle
|
|
31
|
-
data-color="neutral"
|
|
32
|
-
variant="neutral"
|
|
33
|
-
checkmark={false}
|
|
34
|
-
as="div"
|
|
35
|
-
>
|
|
30
|
+
<Chips.Toggle data-color="neutral" checkmark={false} as="div">
|
|
36
31
|
{option.label}
|
|
37
32
|
</Chips.Toggle>
|
|
38
33
|
);
|
|
@@ -35,6 +35,7 @@ const Dropzone = forwardRef<HTMLInputElement, FileUploadDropzoneProps>(
|
|
|
35
35
|
translations,
|
|
36
36
|
onClick,
|
|
37
37
|
id: buttonId,
|
|
38
|
+
"data-color": color,
|
|
38
39
|
...rest
|
|
39
40
|
} = props;
|
|
40
41
|
|
|
@@ -112,6 +113,7 @@ const Dropzone = forwardRef<HTMLInputElement, FileUploadDropzoneProps>(
|
|
|
112
113
|
inputRef.current?.click(),
|
|
113
114
|
)}
|
|
114
115
|
data-disabled={inputProps.disabled}
|
|
116
|
+
data-color={color}
|
|
115
117
|
>
|
|
116
118
|
{!inputProps.disabled && (
|
|
117
119
|
<>
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import React, { MouseEvent, forwardRef } from "react";
|
|
2
|
-
import { Spacer } from "../../../../layout/stack";
|
|
3
2
|
import { useRenameCSS } from "../../../../theme/Theme";
|
|
4
|
-
import { BodyShort, ErrorMessage } from "../../../../typography";
|
|
3
|
+
import { BodyLong, BodyShort, ErrorMessage } from "../../../../typography";
|
|
5
4
|
import { OverridableComponent } from "../../../../util";
|
|
6
5
|
import { useI18n } from "../../../../util/i18n/i18n.hooks";
|
|
7
6
|
import { ComponentTranslation } from "../../../../util/i18n/i18n.types";
|
|
8
7
|
import { useFileUploadTranslation } from "../../FileUpload.context";
|
|
9
8
|
import { FileItem } from "./Item.types";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import ItemName from "./ItemName";
|
|
9
|
+
import { ItemActionField } from "./ItemActionField";
|
|
10
|
+
import { ItemHeader } from "./ItemHeader";
|
|
13
11
|
import { formatFileSize } from "./utils/format-file-size";
|
|
14
12
|
|
|
15
13
|
export interface FileUploadItemProps
|
|
@@ -103,9 +101,6 @@ export const Item: OverridableComponent<FileUploadItemProps, HTMLDivElement> =
|
|
|
103
101
|
return description ?? formatFileSize(file);
|
|
104
102
|
}
|
|
105
103
|
|
|
106
|
-
const renderButton = status === "idle" && button;
|
|
107
|
-
const renderCustomButton = isCustomButton(button);
|
|
108
|
-
|
|
109
104
|
return (
|
|
110
105
|
<Component
|
|
111
106
|
ref={ref}
|
|
@@ -115,13 +110,8 @@ export const Item: OverridableComponent<FileUploadItemProps, HTMLDivElement> =
|
|
|
115
110
|
})}
|
|
116
111
|
>
|
|
117
112
|
<div className={cn("navds-file-item__inner")}>
|
|
118
|
-
<
|
|
119
|
-
|
|
120
|
-
file={file}
|
|
121
|
-
showError={showError}
|
|
122
|
-
/>
|
|
123
|
-
<div className={cn("navds-file-item__file-info")}>
|
|
124
|
-
<ItemName file={file} href={href} onClick={onFileClick} />
|
|
113
|
+
<BodyLong as="div" className={cn("navds-file-item__file-info")}>
|
|
114
|
+
<ItemHeader file={file} href={href} onClick={onFileClick} />
|
|
125
115
|
<BodyShort as="div" size="small">
|
|
126
116
|
{getStatusText()}
|
|
127
117
|
</BodyShort>
|
|
@@ -136,30 +126,16 @@ export const Item: OverridableComponent<FileUploadItemProps, HTMLDivElement> =
|
|
|
136
126
|
</ErrorMessage>
|
|
137
127
|
)}
|
|
138
128
|
</div>
|
|
139
|
-
</
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
title={translate(
|
|
146
|
-
button.action === "retry"
|
|
147
|
-
? "item.retryButtonTitle"
|
|
148
|
-
: "item.deleteButtonTitle",
|
|
149
|
-
)}
|
|
150
|
-
/>
|
|
151
|
-
)}
|
|
152
|
-
{renderButton && renderCustomButton && button}
|
|
129
|
+
</BodyLong>
|
|
130
|
+
<ItemActionField
|
|
131
|
+
isLoading={status !== "idle"}
|
|
132
|
+
button={button}
|
|
133
|
+
translate={translate}
|
|
134
|
+
/>
|
|
153
135
|
</div>
|
|
154
136
|
</Component>
|
|
155
137
|
);
|
|
156
138
|
},
|
|
157
139
|
);
|
|
158
140
|
|
|
159
|
-
function isCustomButton(
|
|
160
|
-
button: FileUploadItemProps["button"],
|
|
161
|
-
): button is React.ReactNode {
|
|
162
|
-
return React.isValidElement(button);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
141
|
export default Item;
|