@norges-domstoler/dds-components 4.3.0 → 5.2.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/cjs/components/Breadcrumbs/Breadcrumbs.d.ts +0 -1
- package/dist/cjs/components/Breadcrumbs/Breadcrumbs.stories.d.ts +0 -1
- package/dist/cjs/components/Button/Button.d.ts +1 -2
- package/dist/cjs/components/Button/Button.stories.d.ts +2 -3
- package/dist/cjs/components/Button/Button.types.d.ts +2 -3
- package/dist/cjs/components/Card/Card.stories.d.ts +0 -1
- package/dist/cjs/components/Card/CardAccordion/CardAccordion.d.ts +0 -1
- package/dist/cjs/components/Card/CardAccordion/CardAccordionBody.d.ts +0 -1
- package/dist/cjs/components/Checkbox/Checkbox.d.ts +0 -1
- package/dist/cjs/components/Checkbox/Checkbox.stories.d.ts +0 -1
- package/dist/cjs/components/Checkbox/Checkbox.styles.d.ts +0 -1
- package/dist/cjs/components/Checkbox/CheckboxGroup.d.ts +0 -1
- package/dist/cjs/components/Checkbox/CheckboxGroup.stories.d.ts +0 -1
- package/dist/cjs/components/Chip/Chip.d.ts +0 -1
- package/dist/cjs/components/Chip/Chip.stories.d.ts +0 -1
- package/dist/cjs/components/Chip/ChipGroup.stories.d.ts +0 -1
- package/dist/cjs/components/Datepicker/Datepicker.d.ts +0 -1
- package/dist/cjs/components/Datepicker/Datepicker.stories.d.ts +0 -1
- package/dist/cjs/components/DescriptionList/DescriptionList.d.ts +0 -1
- package/dist/cjs/components/DescriptionList/DescriptionList.stories.d.ts +0 -1
- package/dist/cjs/components/DescriptionList/DescriptionListDesc.d.ts +3 -5
- package/dist/cjs/components/DescriptionList/DescriptionListGroup.d.ts +0 -1
- package/dist/cjs/components/Divider/Divider.d.ts +0 -1
- package/dist/cjs/components/Divider/Divider.stories.d.ts +0 -1
- package/dist/cjs/components/Drawer/Drawer.stories.d.ts +0 -1
- package/dist/cjs/components/GlobalMessage/GlobalMessage.d.ts +0 -1
- package/dist/cjs/components/GlobalMessage/GlobalMessage.stories.d.ts +0 -1
- package/dist/cjs/components/GlobalMessage/GlobalMessage.tokens.d.ts +4 -9
- package/dist/cjs/components/Icon/Icon.d.ts +13 -0
- package/dist/cjs/components/Icon/Icon.stories.d.ts +21 -0
- package/dist/cjs/components/Icon/index.d.ts +1 -0
- package/dist/cjs/components/InputMessage/InputMessage.d.ts +0 -1
- package/dist/cjs/components/InputMessage/InputMessage.stories.d.ts +0 -1
- package/dist/cjs/components/InternalHeader/InternalHeader.d.ts +0 -1
- package/dist/cjs/components/InternalHeader/InternalHeader.stories.d.ts +0 -1
- package/dist/cjs/components/InternalHeader/InternalHeader.styles.d.ts +0 -1
- package/dist/cjs/components/InternalHeader/InternalHeader.types.d.ts +2 -3
- package/dist/cjs/components/List/List.d.ts +0 -1
- package/dist/cjs/components/List/List.stories.d.ts +0 -1
- package/dist/cjs/components/LocalMessage/LocalMessage.d.ts +0 -1
- package/dist/cjs/components/LocalMessage/LocalMessage.stories.d.ts +0 -1
- package/dist/cjs/components/LocalMessage/LocalMessage.tokens.d.ts +7 -18
- package/dist/cjs/components/Modal/Modal.stories.d.ts +0 -1
- package/dist/cjs/components/Modal/ModalBody.d.ts +0 -1
- package/dist/cjs/components/OverflowMenu/OverflowMenu.d.ts +0 -1
- package/dist/cjs/components/OverflowMenu/OverflowMenu.stories.d.ts +0 -1
- package/dist/cjs/components/OverflowMenu/OverflowMenu.types.d.ts +3 -4
- package/dist/cjs/components/OverflowMenu/OverflowMenuItem.d.ts +4 -7
- package/dist/cjs/components/Pagination/Pagination.stories.d.ts +0 -1
- package/dist/cjs/components/Popover/Popover.stories.d.ts +0 -1
- package/dist/cjs/components/RadioButton/RadioButton.d.ts +0 -1
- package/dist/cjs/components/RadioButton/RadioButton.stories.d.ts +0 -1
- package/dist/cjs/components/RadioButton/RadioButton.styles.d.ts +0 -1
- package/dist/cjs/components/RadioButton/RadioButtonGroup.stories.d.ts +0 -1
- package/dist/cjs/components/Search/Search.stories.d.ts +0 -1
- package/dist/cjs/components/Search/Search.tokens.d.ts +13 -1
- package/dist/cjs/components/Select/CustomSelect.stories.d.ts +66 -0
- package/dist/cjs/components/Select/MultiSelect.stories.d.ts +1 -2
- package/dist/cjs/components/Select/Select.d.ts +4 -2
- package/dist/cjs/components/Select/Select.stories.d.ts +1 -2
- package/dist/cjs/components/Select/Select.styles.d.ts +0 -3
- package/dist/cjs/components/SkipToContent/SkipToContent.d.ts +0 -1
- package/dist/cjs/components/SkipToContent/SkipToContent.stories.d.ts +0 -1
- package/dist/cjs/components/Spinner/Spinner.d.ts +0 -1
- package/dist/cjs/components/Spinner/Spinner.stories.d.ts +0 -1
- package/dist/cjs/components/Stepper/Step.d.ts +20 -0
- package/dist/cjs/components/Stepper/Stepper.context.d.ts +6 -0
- package/dist/cjs/components/Stepper/Stepper.d.ts +11 -0
- package/dist/cjs/components/Stepper/Stepper.stories.d.ts +25 -0
- package/dist/cjs/components/Stepper/Stepper.tokens.d.ts +39 -0
- package/dist/cjs/components/Stepper/index.d.ts +2 -0
- package/dist/cjs/components/Table/Table.stories.d.ts +0 -1
- package/dist/cjs/components/Tabs/Tab.d.ts +3 -4
- package/dist/cjs/components/Tabs/TabPanel.d.ts +0 -1
- package/dist/cjs/components/Tag/Tag.d.ts +0 -1
- package/dist/cjs/components/Tag/Tag.stories.d.ts +0 -1
- package/dist/cjs/components/TextInput/CharCounter.d.ts +0 -1
- package/dist/cjs/components/TextInput/TextInput.stories.d.ts +0 -1
- package/dist/cjs/components/TextInput/TextInput.styles.d.ts +0 -1
- package/dist/cjs/components/ToggleButton/ToggleButton.d.ts +3 -4
- package/dist/cjs/components/ToggleButton/ToggleButton.stories.d.ts +6 -2
- package/dist/cjs/components/ToggleButton/ToggleButtonGroup.d.ts +0 -1
- package/dist/cjs/components/ToggleButton/ToggleButtonGroup.stories.d.ts +0 -1
- package/dist/cjs/components/Tooltip/Tooltip.stories.d.ts +0 -1
- package/dist/cjs/components/Typography/Body.stories.d.ts +0 -1
- package/dist/cjs/components/Typography/Examples.stories.d.ts +0 -1
- package/dist/cjs/components/Typography/Typography.d.ts +1 -0
- package/dist/cjs/components/Typography/Typography.stories.d.ts +0 -1
- package/dist/cjs/components/VisuallyHidden/VisuallyHidden.d.ts +0 -1
- package/dist/cjs/components/VisuallyHidden/VisuallyHidden.stories.d.ts +0 -1
- package/dist/cjs/helpers/Chevron/AnimatedChevronUpDown.d.ts +0 -1
- package/dist/cjs/helpers/Input/Input.styles.d.ts +0 -1
- package/dist/cjs/helpers/RequiredMarker/RequiredMarker.d.ts +0 -1
- package/dist/cjs/hooks/useFloatPosition.d.ts +0 -1
- package/dist/cjs/hooks/useFocusTrap.d.ts +0 -1
- package/dist/cjs/icons/icons.stories.d.ts +5 -0
- package/dist/cjs/icons/tsx/apps.d.ts +2 -0
- package/dist/cjs/icons/tsx/archive.d.ts +2 -0
- package/dist/cjs/icons/tsx/arrowDown.d.ts +2 -0
- package/dist/cjs/icons/tsx/arrowLeft.d.ts +2 -0
- package/dist/cjs/icons/tsx/arrowRight.d.ts +2 -0
- package/dist/cjs/icons/tsx/arrowUp.d.ts +2 -0
- package/dist/cjs/icons/tsx/attachment.d.ts +2 -0
- package/dist/cjs/icons/tsx/block.d.ts +2 -0
- package/dist/cjs/icons/tsx/book.d.ts +2 -0
- package/dist/cjs/icons/tsx/build.d.ts +2 -0
- package/dist/cjs/icons/tsx/buildCircled.d.ts +2 -0
- package/dist/cjs/icons/tsx/calendar.d.ts +2 -0
- package/dist/cjs/icons/tsx/calendarMonth.d.ts +2 -0
- package/dist/cjs/icons/tsx/calendarViewDay.d.ts +2 -0
- package/dist/cjs/icons/tsx/calendarViewMonth.d.ts +2 -0
- package/dist/cjs/icons/tsx/calendarViewWeek.d.ts +2 -0
- package/dist/cjs/icons/tsx/call.d.ts +2 -0
- package/dist/cjs/icons/tsx/chat.d.ts +2 -0
- package/dist/cjs/icons/tsx/check.d.ts +2 -0
- package/dist/cjs/icons/tsx/checkCircled.d.ts +2 -0
- package/dist/cjs/icons/tsx/checklist.d.ts +2 -0
- package/dist/cjs/icons/tsx/chevronDown.d.ts +2 -0
- package/dist/cjs/icons/tsx/chevronFirst.d.ts +2 -0
- package/dist/cjs/icons/tsx/chevronLargeLeft.d.ts +2 -0
- package/dist/cjs/icons/tsx/chevronLargeRight.d.ts +2 -0
- package/dist/cjs/icons/tsx/chevronLast.d.ts +2 -0
- package/dist/cjs/icons/tsx/chevronLeft.d.ts +2 -0
- package/dist/cjs/icons/tsx/chevronRight.d.ts +2 -0
- package/dist/cjs/icons/tsx/chevronUp.d.ts +2 -0
- package/dist/cjs/icons/tsx/close.d.ts +2 -0
- package/dist/cjs/icons/tsx/closeCircled.d.ts +2 -0
- package/dist/cjs/icons/tsx/cloud.d.ts +2 -0
- package/dist/cjs/icons/tsx/collapse.d.ts +2 -0
- package/dist/cjs/icons/tsx/comment.d.ts +2 -0
- package/dist/cjs/icons/tsx/copy.d.ts +2 -0
- package/dist/cjs/icons/tsx/court.d.ts +2 -0
- package/dist/cjs/icons/tsx/dateRange.d.ts +2 -0
- package/dist/cjs/icons/tsx/deaths.d.ts +2 -0
- package/dist/cjs/icons/tsx/download.d.ts +2 -0
- package/dist/cjs/icons/tsx/downloadDone.d.ts +2 -0
- package/dist/cjs/icons/tsx/dragHandle.d.ts +2 -0
- package/dist/cjs/icons/tsx/edit.d.ts +2 -0
- package/dist/cjs/icons/tsx/error.d.ts +2 -0
- package/dist/cjs/icons/tsx/exclaim.d.ts +2 -0
- package/dist/cjs/icons/tsx/expand.d.ts +2 -0
- package/dist/cjs/icons/tsx/facebook.d.ts +2 -0
- package/dist/cjs/icons/tsx/family.d.ts +2 -0
- package/dist/cjs/icons/tsx/feedback.d.ts +2 -0
- package/dist/cjs/icons/tsx/file.d.ts +2 -0
- package/dist/cjs/icons/tsx/fileAdd.d.ts +2 -0
- package/dist/cjs/icons/tsx/fileText.d.ts +2 -0
- package/dist/cjs/icons/tsx/filter.d.ts +2 -0
- package/dist/cjs/icons/tsx/filterList.d.ts +2 -0
- package/dist/cjs/icons/tsx/filterListOff.d.ts +2 -0
- package/dist/cjs/icons/tsx/filterOff.d.ts +2 -0
- package/dist/cjs/icons/tsx/findInPage.d.ts +2 -0
- package/dist/cjs/icons/tsx/folder.d.ts +2 -0
- package/dist/cjs/icons/tsx/folderAdd.d.ts +2 -0
- package/dist/cjs/icons/tsx/fullsceenExit.d.ts +2 -0
- package/dist/cjs/icons/tsx/fullscreen.d.ts +2 -0
- package/dist/cjs/icons/tsx/gavel.d.ts +2 -0
- package/dist/cjs/icons/tsx/help.d.ts +2 -0
- package/dist/cjs/icons/tsx/helpFilled.d.ts +2 -0
- package/dist/cjs/icons/tsx/home.d.ts +2 -0
- package/dist/cjs/icons/tsx/image.d.ts +2 -0
- package/dist/cjs/icons/tsx/index.d.ts +127 -0
- package/dist/cjs/icons/tsx/info.d.ts +2 -0
- package/dist/cjs/icons/tsx/instagram.d.ts +2 -0
- package/dist/cjs/icons/tsx/jordskifterett.d.ts +2 -0
- package/dist/cjs/icons/tsx/key.d.ts +2 -0
- package/dist/cjs/icons/tsx/lagmannsrett.d.ts +2 -0
- package/dist/cjs/icons/tsx/language.d.ts +2 -0
- package/dist/cjs/icons/tsx/link.d.ts +2 -0
- package/dist/cjs/icons/tsx/linkOff.d.ts +2 -0
- package/dist/cjs/icons/tsx/linkedIn.d.ts +2 -0
- package/dist/cjs/icons/tsx/list.d.ts +2 -0
- package/dist/cjs/icons/tsx/listAlt.d.ts +2 -0
- package/dist/cjs/icons/tsx/location.d.ts +2 -0
- package/dist/cjs/icons/tsx/lock.d.ts +2 -0
- package/dist/cjs/icons/tsx/lockOpen.d.ts +2 -0
- package/dist/cjs/icons/tsx/login.d.ts +2 -0
- package/dist/cjs/icons/tsx/logout.d.ts +2 -0
- package/dist/cjs/icons/tsx/mail.d.ts +2 -0
- package/dist/cjs/icons/tsx/mailOpen.d.ts +2 -0
- package/dist/cjs/icons/tsx/menu.d.ts +2 -0
- package/dist/cjs/icons/tsx/minus.d.ts +2 -0
- package/dist/cjs/icons/tsx/minusCircled.d.ts +2 -0
- package/dist/cjs/icons/tsx/moreHorizontal.d.ts +2 -0
- package/dist/cjs/icons/tsx/moreVertical.d.ts +2 -0
- package/dist/cjs/icons/tsx/notarial.d.ts +2 -0
- package/dist/cjs/icons/tsx/notifications.d.ts +2 -0
- package/dist/cjs/icons/tsx/notificationsOff.d.ts +2 -0
- package/dist/cjs/icons/tsx/onlineMeeting.d.ts +2 -0
- package/dist/cjs/icons/tsx/openExternal.d.ts +2 -0
- package/dist/cjs/icons/tsx/pdf.d.ts +2 -0
- package/dist/cjs/icons/tsx/person.d.ts +2 -0
- package/dist/cjs/icons/tsx/personAdd.d.ts +2 -0
- package/dist/cjs/icons/tsx/pin.d.ts +2 -0
- package/dist/cjs/icons/tsx/plus.d.ts +2 -0
- package/dist/cjs/icons/tsx/plusCircled.d.ts +2 -0
- package/dist/cjs/icons/tsx/print.d.ts +2 -0
- package/dist/cjs/icons/tsx/property.d.ts +2 -0
- package/dist/cjs/icons/tsx/publish.d.ts +2 -0
- package/dist/cjs/icons/tsx/questionAnswer.d.ts +2 -0
- package/dist/cjs/icons/tsx/receipt.d.ts +2 -0
- package/dist/cjs/icons/tsx/redo.d.ts +2 -0
- package/dist/cjs/icons/tsx/refresh.d.ts +2 -0
- package/dist/cjs/icons/tsx/replay.d.ts +2 -0
- package/dist/cjs/icons/tsx/search.d.ts +2 -0
- package/dist/cjs/icons/tsx/settings.d.ts +2 -0
- package/dist/cjs/icons/tsx/sms.d.ts +2 -0
- package/dist/cjs/icons/tsx/star.d.ts +2 -0
- package/dist/cjs/icons/tsx/starFilled.d.ts +2 -0
- package/dist/cjs/icons/tsx/sync.d.ts +2 -0
- package/dist/cjs/icons/tsx/time.d.ts +2 -0
- package/dist/cjs/icons/tsx/tingrett.d.ts +2 -0
- package/dist/cjs/icons/tsx/tip.d.ts +2 -0
- package/dist/cjs/icons/tsx/trash.d.ts +2 -0
- package/dist/cjs/icons/tsx/twitter.d.ts +2 -0
- package/dist/cjs/icons/tsx/undo.d.ts +2 -0
- package/dist/cjs/icons/tsx/unfoldLess.d.ts +2 -0
- package/dist/cjs/icons/tsx/unfoldMore.d.ts +2 -0
- package/dist/cjs/icons/tsx/upload.d.ts +2 -0
- package/dist/cjs/icons/tsx/visibilityOff.d.ts +2 -0
- package/dist/cjs/icons/tsx/visibilityOn.d.ts +2 -0
- package/dist/cjs/icons/tsx/warning.d.ts +2 -0
- package/dist/cjs/icons/tsx/zoomIn.d.ts +2 -0
- package/dist/cjs/icons/tsx/zoomOut.d.ts +2 -0
- package/dist/cjs/icons/utils/StyledSvg.d.ts +1 -0
- package/dist/cjs/icons/utils/index.d.ts +2 -0
- package/dist/cjs/icons/utils/propTypes.d.ts +5 -0
- package/dist/cjs/index.d.ts +3 -1
- package/dist/cjs/index.js +3672 -749
- package/dist/cjs/types/BaseComponentProps.d.ts +1 -1
- package/dist/components/Breadcrumbs/Breadcrumb.tokens.js +8 -7
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +0 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +19 -19
- package/dist/components/Breadcrumbs/Breadcrumbs.stories.d.ts +0 -1
- package/dist/components/Button/Button.d.ts +1 -2
- package/dist/components/Button/Button.js +8 -8
- package/dist/components/Button/Button.stories.d.ts +2 -3
- package/dist/components/Button/Button.types.d.ts +2 -3
- package/dist/components/Card/Card.stories.d.ts +0 -1
- package/dist/components/Card/CardAccordion/CardAccordion.d.ts +0 -1
- package/dist/components/Card/CardAccordion/CardAccordionBody.d.ts +0 -1
- package/dist/components/Checkbox/Checkbox.d.ts +0 -1
- package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -1
- package/dist/components/Checkbox/Checkbox.styles.d.ts +0 -1
- package/dist/components/Checkbox/CheckboxGroup.d.ts +0 -1
- package/dist/components/Checkbox/CheckboxGroup.stories.d.ts +0 -1
- package/dist/components/Chip/Chip.d.ts +0 -1
- package/dist/components/Chip/Chip.js +2 -2
- package/dist/components/Chip/Chip.stories.d.ts +0 -1
- package/dist/components/Chip/ChipGroup.stories.d.ts +0 -1
- package/dist/components/Datepicker/Datepicker.d.ts +0 -1
- package/dist/components/Datepicker/Datepicker.js +1 -1
- package/dist/components/Datepicker/Datepicker.stories.d.ts +0 -1
- package/dist/components/DescriptionList/DescriptionList.d.ts +0 -1
- package/dist/components/DescriptionList/DescriptionList.stories.d.ts +0 -1
- package/dist/components/DescriptionList/DescriptionListDesc.d.ts +3 -5
- package/dist/components/DescriptionList/DescriptionListDesc.js +6 -10
- package/dist/components/DescriptionList/DescriptionListDesc.tokens.js +7 -4
- package/dist/components/DescriptionList/DescriptionListGroup.d.ts +0 -1
- package/dist/components/Divider/Divider.d.ts +0 -1
- package/dist/components/Divider/Divider.stories.d.ts +0 -1
- package/dist/components/Drawer/Drawer.js +2 -2
- package/dist/components/Drawer/Drawer.stories.d.ts +0 -1
- package/dist/components/GlobalMessage/GlobalMessage.d.ts +0 -1
- package/dist/components/GlobalMessage/GlobalMessage.js +5 -5
- package/dist/components/GlobalMessage/GlobalMessage.stories.d.ts +0 -1
- package/dist/components/GlobalMessage/GlobalMessage.tokens.d.ts +4 -9
- package/dist/components/GlobalMessage/GlobalMessage.tokens.js +8 -7
- package/dist/components/Icon/Icon.d.ts +13 -0
- package/dist/components/Icon/Icon.js +50 -0
- package/dist/components/Icon/Icon.stories.d.ts +21 -0
- package/dist/components/Icon/index.d.ts +1 -0
- package/dist/components/InputMessage/InputMessage.d.ts +0 -1
- package/dist/components/InputMessage/InputMessage.js +5 -5
- package/dist/components/InputMessage/InputMessage.stories.d.ts +0 -1
- package/dist/components/InternalHeader/InternalHeader.d.ts +0 -1
- package/dist/components/InternalHeader/InternalHeader.js +3 -3
- package/dist/components/InternalHeader/InternalHeader.stories.d.ts +0 -1
- package/dist/components/InternalHeader/InternalHeader.styles.d.ts +0 -1
- package/dist/components/InternalHeader/InternalHeader.types.d.ts +2 -3
- package/dist/components/List/List.d.ts +0 -1
- package/dist/components/List/List.stories.d.ts +0 -1
- package/dist/components/LocalMessage/LocalMessage.d.ts +0 -1
- package/dist/components/LocalMessage/LocalMessage.js +5 -5
- package/dist/components/LocalMessage/LocalMessage.stories.d.ts +0 -1
- package/dist/components/LocalMessage/LocalMessage.tokens.d.ts +7 -18
- package/dist/components/LocalMessage/LocalMessage.tokens.js +11 -11
- package/dist/components/Modal/Modal.js +2 -2
- package/dist/components/Modal/Modal.stories.d.ts +0 -1
- package/dist/components/Modal/ModalBody.d.ts +0 -1
- package/dist/components/OverflowMenu/OverflowMenu.d.ts +0 -1
- package/dist/components/OverflowMenu/OverflowMenu.js +3 -3
- package/dist/components/OverflowMenu/OverflowMenu.stories.d.ts +0 -1
- package/dist/components/OverflowMenu/OverflowMenu.types.d.ts +3 -4
- package/dist/components/OverflowMenu/OverflowMenuItem.d.ts +4 -7
- package/dist/components/OverflowMenu/OverflowMenuItem.js +10 -14
- package/dist/components/Pagination/Pagination.js +12 -12
- package/dist/components/Pagination/Pagination.stories.d.ts +0 -1
- package/dist/components/Popover/Popover.js +2 -2
- package/dist/components/Popover/Popover.stories.d.ts +0 -1
- package/dist/components/RadioButton/RadioButton.d.ts +0 -1
- package/dist/components/RadioButton/RadioButton.stories.d.ts +0 -1
- package/dist/components/RadioButton/RadioButton.styles.d.ts +0 -1
- package/dist/components/RadioButton/RadioButtonGroup.stories.d.ts +0 -1
- package/dist/components/Search/Search.js +10 -4
- package/dist/components/Search/Search.stories.d.ts +0 -1
- package/dist/components/Search/Search.tokens.d.ts +13 -1
- package/dist/components/Search/Search.tokens.js +16 -3
- package/dist/components/Select/CustomSelect.stories.d.ts +66 -0
- package/dist/components/Select/MultiSelect.stories.d.ts +1 -2
- package/dist/components/Select/Select.d.ts +4 -2
- package/dist/components/Select/Select.js +30 -9
- package/dist/components/Select/Select.stories.d.ts +1 -2
- package/dist/components/Select/Select.styles.d.ts +0 -3
- package/dist/components/Select/Select.styles.js +12 -22
- package/dist/components/Select/Select.tokens.js +3 -0
- package/dist/components/SkipToContent/SkipToContent.d.ts +0 -1
- package/dist/components/SkipToContent/SkipToContent.stories.d.ts +0 -1
- package/dist/components/Spinner/Spinner.d.ts +0 -1
- package/dist/components/Spinner/Spinner.stories.d.ts +0 -1
- package/dist/components/Stepper/Step.d.ts +20 -0
- package/dist/components/Stepper/Step.js +114 -0
- package/dist/components/Stepper/Stepper.context.d.ts +6 -0
- package/dist/components/Stepper/Stepper.context.js +10 -0
- package/dist/components/Stepper/Stepper.d.ts +11 -0
- package/dist/components/Stepper/Stepper.js +66 -0
- package/dist/components/Stepper/Stepper.stories.d.ts +25 -0
- package/dist/components/Stepper/Stepper.tokens.d.ts +39 -0
- package/dist/components/Stepper/Stepper.tokens.js +49 -0
- package/dist/components/Stepper/index.d.ts +2 -0
- package/dist/components/Table/SortCell.js +15 -15
- package/dist/components/Table/Table.stories.d.ts +0 -1
- package/dist/components/Tabs/Tab.d.ts +3 -4
- package/dist/components/Tabs/Tab.js +6 -6
- package/dist/components/Tabs/TabPanel.d.ts +0 -1
- package/dist/components/Tag/Tag.d.ts +0 -1
- package/dist/components/Tag/Tag.stories.d.ts +0 -1
- package/dist/components/TextInput/CharCounter.d.ts +0 -1
- package/dist/components/TextInput/TextInput.js +18 -2
- package/dist/components/TextInput/TextInput.stories.d.ts +0 -1
- package/dist/components/TextInput/TextInput.styles.d.ts +0 -1
- package/dist/components/ToggleButton/ToggleButton.d.ts +3 -4
- package/dist/components/ToggleButton/ToggleButton.js +6 -6
- package/dist/components/ToggleButton/ToggleButton.stories.d.ts +6 -2
- package/dist/components/ToggleButton/ToggleButtonGroup.d.ts +0 -1
- package/dist/components/ToggleButton/ToggleButtonGroup.stories.d.ts +0 -1
- package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -1
- package/dist/components/Typography/Body.stories.d.ts +0 -1
- package/dist/components/Typography/Examples.stories.d.ts +0 -1
- package/dist/components/Typography/Typography.d.ts +1 -0
- package/dist/components/Typography/Typography.js +9 -9
- package/dist/components/Typography/Typography.stories.d.ts +0 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +0 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.js +1 -1
- package/dist/components/VisuallyHidden/VisuallyHidden.stories.d.ts +0 -1
- package/dist/helpers/Chevron/AnimatedChevronUpDown.d.ts +0 -1
- package/dist/helpers/Input/Input.styles.d.ts +0 -1
- package/dist/helpers/RequiredMarker/RequiredMarker.d.ts +0 -1
- package/dist/hooks/useFloatPosition.d.ts +0 -1
- package/dist/hooks/useFocusTrap.d.ts +0 -1
- package/dist/icons/icons.stories.d.ts +5 -0
- package/dist/icons/tsx/apps.d.ts +2 -0
- package/dist/icons/tsx/apps.js +25 -0
- package/dist/icons/tsx/archive.d.ts +2 -0
- package/dist/icons/tsx/archive.js +27 -0
- package/dist/icons/tsx/arrowDown.d.ts +2 -0
- package/dist/icons/tsx/arrowDown.js +25 -0
- package/dist/icons/tsx/arrowLeft.d.ts +2 -0
- package/dist/icons/tsx/arrowLeft.js +25 -0
- package/dist/icons/tsx/arrowRight.d.ts +2 -0
- package/dist/icons/tsx/arrowRight.js +25 -0
- package/dist/icons/tsx/arrowUp.d.ts +2 -0
- package/dist/icons/tsx/arrowUp.js +25 -0
- package/dist/icons/tsx/attachment.d.ts +2 -0
- package/dist/icons/tsx/attachment.js +25 -0
- package/dist/icons/tsx/block.d.ts +2 -0
- package/dist/icons/tsx/block.js +25 -0
- package/dist/icons/tsx/book.d.ts +2 -0
- package/dist/icons/tsx/book.js +27 -0
- package/dist/icons/tsx/build.d.ts +2 -0
- package/dist/icons/tsx/build.js +25 -0
- package/dist/icons/tsx/buildCircled.d.ts +2 -0
- package/dist/icons/tsx/buildCircled.js +31 -0
- package/dist/icons/tsx/calendar.d.ts +2 -0
- package/dist/icons/tsx/calendar.js +25 -0
- package/dist/icons/tsx/calendarMonth.d.ts +2 -0
- package/dist/icons/tsx/calendarMonth.js +25 -0
- package/dist/icons/tsx/calendarViewDay.d.ts +2 -0
- package/dist/icons/tsx/calendarViewDay.js +25 -0
- package/dist/icons/tsx/calendarViewMonth.d.ts +2 -0
- package/dist/icons/tsx/calendarViewMonth.js +25 -0
- package/dist/icons/tsx/calendarViewWeek.d.ts +2 -0
- package/dist/icons/tsx/calendarViewWeek.js +25 -0
- package/dist/icons/tsx/call.d.ts +2 -0
- package/dist/icons/tsx/call.js +25 -0
- package/dist/icons/tsx/chat.d.ts +2 -0
- package/dist/icons/tsx/chat.js +25 -0
- package/dist/icons/tsx/check.d.ts +2 -0
- package/dist/icons/tsx/check.js +25 -0
- package/dist/icons/tsx/checkCircled.d.ts +2 -0
- package/dist/icons/tsx/checkCircled.js +25 -0
- package/dist/icons/tsx/checklist.d.ts +2 -0
- package/dist/icons/tsx/checklist.js +25 -0
- package/dist/icons/tsx/chevronDown.d.ts +2 -0
- package/dist/icons/tsx/chevronDown.js +25 -0
- package/dist/icons/tsx/chevronFirst.d.ts +2 -0
- package/dist/icons/tsx/chevronFirst.js +25 -0
- package/dist/icons/tsx/chevronLargeLeft.d.ts +2 -0
- package/dist/icons/tsx/chevronLargeLeft.js +25 -0
- package/dist/icons/tsx/chevronLargeRight.d.ts +2 -0
- package/dist/icons/tsx/chevronLargeRight.js +25 -0
- package/dist/icons/tsx/chevronLast.d.ts +2 -0
- package/dist/icons/tsx/chevronLast.js +25 -0
- package/dist/icons/tsx/chevronLeft.d.ts +2 -0
- package/dist/icons/tsx/chevronLeft.js +25 -0
- package/dist/icons/tsx/chevronRight.d.ts +2 -0
- package/dist/icons/tsx/chevronRight.js +25 -0
- package/dist/icons/tsx/chevronUp.d.ts +2 -0
- package/dist/icons/tsx/chevronUp.js +25 -0
- package/dist/icons/tsx/close.d.ts +2 -0
- package/dist/icons/tsx/close.js +25 -0
- package/dist/icons/tsx/closeCircled.d.ts +2 -0
- package/dist/icons/tsx/closeCircled.js +25 -0
- package/dist/icons/tsx/cloud.d.ts +2 -0
- package/dist/icons/tsx/cloud.js +25 -0
- package/dist/icons/tsx/collapse.d.ts +2 -0
- package/dist/icons/tsx/collapse.js +25 -0
- package/dist/icons/tsx/comment.d.ts +2 -0
- package/dist/icons/tsx/comment.js +25 -0
- package/dist/icons/tsx/copy.d.ts +2 -0
- package/dist/icons/tsx/copy.js +25 -0
- package/dist/icons/tsx/court.d.ts +2 -0
- package/dist/icons/tsx/court.js +25 -0
- package/dist/icons/tsx/dateRange.d.ts +2 -0
- package/dist/icons/tsx/dateRange.js +25 -0
- package/dist/icons/tsx/deaths.d.ts +2 -0
- package/dist/icons/tsx/deaths.js +25 -0
- package/dist/icons/tsx/download.d.ts +2 -0
- package/dist/icons/tsx/download.js +25 -0
- package/dist/icons/tsx/downloadDone.d.ts +2 -0
- package/dist/icons/tsx/downloadDone.js +25 -0
- package/dist/icons/tsx/dragHandle.d.ts +2 -0
- package/dist/icons/tsx/dragHandle.js +25 -0
- package/dist/icons/tsx/edit.d.ts +2 -0
- package/dist/icons/tsx/edit.js +25 -0
- package/dist/icons/tsx/error.d.ts +2 -0
- package/dist/icons/tsx/error.js +25 -0
- package/dist/icons/tsx/exclaim.d.ts +2 -0
- package/dist/icons/tsx/exclaim.js +25 -0
- package/dist/icons/tsx/expand.d.ts +2 -0
- package/dist/icons/tsx/expand.js +25 -0
- package/dist/icons/tsx/facebook.d.ts +2 -0
- package/dist/icons/tsx/facebook.js +25 -0
- package/dist/icons/tsx/family.d.ts +2 -0
- package/dist/icons/tsx/family.js +25 -0
- package/dist/icons/tsx/feedback.d.ts +2 -0
- package/dist/icons/tsx/feedback.js +25 -0
- package/dist/icons/tsx/file.d.ts +2 -0
- package/dist/icons/tsx/file.js +25 -0
- package/dist/icons/tsx/fileAdd.d.ts +2 -0
- package/dist/icons/tsx/fileAdd.js +25 -0
- package/dist/icons/tsx/fileText.d.ts +2 -0
- package/dist/icons/tsx/fileText.js +25 -0
- package/dist/icons/tsx/filter.d.ts +2 -0
- package/dist/icons/tsx/filter.js +25 -0
- package/dist/icons/tsx/filterList.d.ts +2 -0
- package/dist/icons/tsx/filterList.js +25 -0
- package/dist/icons/tsx/filterListOff.d.ts +2 -0
- package/dist/icons/tsx/filterListOff.js +25 -0
- package/dist/icons/tsx/filterOff.d.ts +2 -0
- package/dist/icons/tsx/filterOff.js +25 -0
- package/dist/icons/tsx/findInPage.d.ts +2 -0
- package/dist/icons/tsx/findInPage.js +25 -0
- package/dist/icons/tsx/folder.d.ts +2 -0
- package/dist/icons/tsx/folder.js +25 -0
- package/dist/icons/tsx/folderAdd.d.ts +2 -0
- package/dist/icons/tsx/folderAdd.js +25 -0
- package/dist/icons/tsx/fullsceenExit.d.ts +2 -0
- package/dist/icons/tsx/fullsceenExit.js +25 -0
- package/dist/icons/tsx/fullscreen.d.ts +2 -0
- package/dist/icons/tsx/fullscreen.js +25 -0
- package/dist/icons/tsx/gavel.d.ts +2 -0
- package/dist/icons/tsx/gavel.js +31 -0
- package/dist/icons/tsx/help.d.ts +2 -0
- package/dist/icons/tsx/help.js +25 -0
- package/dist/icons/tsx/helpFilled.d.ts +2 -0
- package/dist/icons/tsx/helpFilled.js +25 -0
- package/dist/icons/tsx/home.d.ts +2 -0
- package/dist/icons/tsx/home.js +25 -0
- package/dist/icons/tsx/image.d.ts +2 -0
- package/dist/icons/tsx/image.js +25 -0
- package/dist/icons/tsx/index.d.ts +127 -0
- package/dist/icons/tsx/info.d.ts +2 -0
- package/dist/icons/tsx/info.js +25 -0
- package/dist/icons/tsx/instagram.d.ts +2 -0
- package/dist/icons/tsx/instagram.js +25 -0
- package/dist/icons/tsx/jordskifterett.d.ts +2 -0
- package/dist/icons/tsx/jordskifterett.js +26 -0
- package/dist/icons/tsx/key.d.ts +2 -0
- package/dist/icons/tsx/key.js +25 -0
- package/dist/icons/tsx/lagmannsrett.d.ts +2 -0
- package/dist/icons/tsx/lagmannsrett.js +25 -0
- package/dist/icons/tsx/language.d.ts +2 -0
- package/dist/icons/tsx/language.js +23 -0
- package/dist/icons/tsx/link.d.ts +2 -0
- package/dist/icons/tsx/link.js +25 -0
- package/dist/icons/tsx/linkOff.d.ts +2 -0
- package/dist/icons/tsx/linkOff.js +25 -0
- package/dist/icons/tsx/linkedIn.d.ts +2 -0
- package/dist/icons/tsx/linkedIn.js +27 -0
- package/dist/icons/tsx/list.d.ts +2 -0
- package/dist/icons/tsx/list.js +25 -0
- package/dist/icons/tsx/listAlt.d.ts +2 -0
- package/dist/icons/tsx/listAlt.js +25 -0
- package/dist/icons/tsx/location.d.ts +2 -0
- package/dist/icons/tsx/location.js +25 -0
- package/dist/icons/tsx/lock.d.ts +2 -0
- package/dist/icons/tsx/lock.js +25 -0
- package/dist/icons/tsx/lockOpen.d.ts +2 -0
- package/dist/icons/tsx/lockOpen.js +25 -0
- package/dist/icons/tsx/login.d.ts +2 -0
- package/dist/icons/tsx/login.js +25 -0
- package/dist/icons/tsx/logout.d.ts +2 -0
- package/dist/icons/tsx/logout.js +25 -0
- package/dist/icons/tsx/mail.d.ts +2 -0
- package/dist/icons/tsx/mail.js +25 -0
- package/dist/icons/tsx/mailOpen.d.ts +2 -0
- package/dist/icons/tsx/mailOpen.js +25 -0
- package/dist/icons/tsx/menu.d.ts +2 -0
- package/dist/icons/tsx/menu.js +25 -0
- package/dist/icons/tsx/minus.d.ts +2 -0
- package/dist/icons/tsx/minus.js +25 -0
- package/dist/icons/tsx/minusCircled.d.ts +2 -0
- package/dist/icons/tsx/minusCircled.js +25 -0
- package/dist/icons/tsx/moreHorizontal.d.ts +2 -0
- package/dist/icons/tsx/moreHorizontal.js +25 -0
- package/dist/icons/tsx/moreVertical.d.ts +2 -0
- package/dist/icons/tsx/moreVertical.js +25 -0
- package/dist/icons/tsx/notarial.d.ts +2 -0
- package/dist/icons/tsx/notarial.js +25 -0
- package/dist/icons/tsx/notifications.d.ts +2 -0
- package/dist/icons/tsx/notifications.js +25 -0
- package/dist/icons/tsx/notificationsOff.d.ts +2 -0
- package/dist/icons/tsx/notificationsOff.js +25 -0
- package/dist/icons/tsx/onlineMeeting.d.ts +2 -0
- package/dist/icons/tsx/onlineMeeting.js +25 -0
- package/dist/icons/tsx/openExternal.d.ts +2 -0
- package/dist/icons/tsx/openExternal.js +25 -0
- package/dist/icons/tsx/pdf.d.ts +2 -0
- package/dist/icons/tsx/pdf.js +25 -0
- package/dist/icons/tsx/person.d.ts +2 -0
- package/dist/icons/tsx/person.js +25 -0
- package/dist/icons/tsx/personAdd.d.ts +2 -0
- package/dist/icons/tsx/personAdd.js +25 -0
- package/dist/icons/tsx/pin.d.ts +2 -0
- package/dist/icons/tsx/pin.js +25 -0
- package/dist/icons/tsx/plus.d.ts +2 -0
- package/dist/icons/tsx/plus.js +25 -0
- package/dist/icons/tsx/plusCircled.d.ts +2 -0
- package/dist/icons/tsx/plusCircled.js +25 -0
- package/dist/icons/tsx/print.d.ts +2 -0
- package/dist/icons/tsx/print.js +27 -0
- package/dist/icons/tsx/property.d.ts +2 -0
- package/dist/icons/tsx/property.js +27 -0
- package/dist/icons/tsx/publish.d.ts +2 -0
- package/dist/icons/tsx/publish.js +25 -0
- package/dist/icons/tsx/questionAnswer.d.ts +2 -0
- package/dist/icons/tsx/questionAnswer.js +25 -0
- package/dist/icons/tsx/receipt.d.ts +2 -0
- package/dist/icons/tsx/receipt.js +25 -0
- package/dist/icons/tsx/redo.d.ts +2 -0
- package/dist/icons/tsx/redo.js +25 -0
- package/dist/icons/tsx/refresh.d.ts +2 -0
- package/dist/icons/tsx/refresh.js +25 -0
- package/dist/icons/tsx/replay.d.ts +2 -0
- package/dist/icons/tsx/replay.js +25 -0
- package/dist/icons/tsx/search.d.ts +2 -0
- package/dist/icons/tsx/search.js +25 -0
- package/dist/icons/tsx/settings.d.ts +2 -0
- package/dist/icons/tsx/settings.js +25 -0
- package/dist/icons/tsx/sms.d.ts +2 -0
- package/dist/icons/tsx/sms.js +25 -0
- package/dist/icons/tsx/star.d.ts +2 -0
- package/dist/icons/tsx/star.js +25 -0
- package/dist/icons/tsx/starFilled.d.ts +2 -0
- package/dist/icons/tsx/starFilled.js +25 -0
- package/dist/icons/tsx/sync.d.ts +2 -0
- package/dist/icons/tsx/sync.js +25 -0
- package/dist/icons/tsx/time.d.ts +2 -0
- package/dist/icons/tsx/time.js +25 -0
- package/dist/icons/tsx/tingrett.d.ts +2 -0
- package/dist/icons/tsx/tingrett.js +25 -0
- package/dist/icons/tsx/tip.d.ts +2 -0
- package/dist/icons/tsx/tip.js +25 -0
- package/dist/icons/tsx/trash.d.ts +2 -0
- package/dist/icons/tsx/trash.js +25 -0
- package/dist/icons/tsx/twitter.d.ts +2 -0
- package/dist/icons/tsx/twitter.js +25 -0
- package/dist/icons/tsx/undo.d.ts +2 -0
- package/dist/icons/tsx/undo.js +25 -0
- package/dist/icons/tsx/unfoldLess.d.ts +2 -0
- package/dist/icons/tsx/unfoldLess.js +25 -0
- package/dist/icons/tsx/unfoldMore.d.ts +2 -0
- package/dist/icons/tsx/unfoldMore.js +25 -0
- package/dist/icons/tsx/upload.d.ts +2 -0
- package/dist/icons/tsx/upload.js +25 -0
- package/dist/icons/tsx/visibilityOff.d.ts +2 -0
- package/dist/icons/tsx/visibilityOff.js +25 -0
- package/dist/icons/tsx/visibilityOn.d.ts +2 -0
- package/dist/icons/tsx/visibilityOn.js +25 -0
- package/dist/icons/tsx/warning.d.ts +2 -0
- package/dist/icons/tsx/warning.js +27 -0
- package/dist/icons/tsx/zoomIn.d.ts +2 -0
- package/dist/icons/tsx/zoomIn.js +25 -0
- package/dist/icons/tsx/zoomOut.d.ts +2 -0
- package/dist/icons/tsx/zoomOut.js +25 -0
- package/dist/icons/utils/StyledSvg.d.ts +1 -0
- package/dist/icons/utils/StyledSvg.js +8 -0
- package/dist/icons/utils/index.d.ts +2 -0
- package/dist/icons/utils/propTypes.d.ts +5 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +130 -1
- package/dist/types/BaseComponentProps.d.ts +1 -1
- package/package.json +3 -5
- package/dist/cjs/components/IconWrapper/IconWrapper.d.ts +0 -19
- package/dist/cjs/components/IconWrapper/IconWrapper.stories.d.ts +0 -22
- package/dist/cjs/components/IconWrapper/index.d.ts +0 -1
- package/dist/components/IconWrapper/IconWrapper.d.ts +0 -19
- package/dist/components/IconWrapper/IconWrapper.js +0 -42
- package/dist/components/IconWrapper/IconWrapper.stories.d.ts +0 -22
- package/dist/components/IconWrapper/index.d.ts +0 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { __rest } from 'tslib';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import CloseOutlinedIcon from '@mui/icons-material/CloseOutlined';
|
|
4
3
|
import { ddsBaseTokens } from '@norges-domstoler/dds-design-tokens';
|
|
5
4
|
import { forwardRef, useEffect } from 'react';
|
|
6
5
|
import styled, { css } from 'styled-components';
|
|
@@ -11,6 +10,7 @@ import { useFloatPosition } from '../../hooks/useFloatPosition.js';
|
|
|
11
10
|
import { useCombinedRef } from '../../hooks/useCombinedRefs.js';
|
|
12
11
|
import { getBaseHTMLProps } from '../../types/BaseComponentProps.js';
|
|
13
12
|
import { Typography } from '../Typography/Typography.js';
|
|
13
|
+
import { CloseIcon } from '../../icons/tsx/close.js';
|
|
14
14
|
|
|
15
15
|
var Spacing = ddsBaseTokens.spacing;
|
|
16
16
|
var Wrapper = styled.div.withConfig({
|
|
@@ -90,7 +90,7 @@ var Popover = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
90
90
|
}, {
|
|
91
91
|
children: children
|
|
92
92
|
})), withCloseButton && jsx(StyledButton, {
|
|
93
|
-
|
|
93
|
+
icon: CloseIcon,
|
|
94
94
|
appearance: "borderless",
|
|
95
95
|
purpose: "secondary",
|
|
96
96
|
size: "small",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const RadioButton: import("react").ForwardRefExoticComponent<{
|
|
3
2
|
htmlProps?: Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "name" | "readOnly" | "checked" | "value" | "required" | "onChange" | "aria-describedby"> | undefined;
|
|
4
3
|
} & Pick<Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "name" | "readOnly" | "checked" | "value" | "required" | "onChange" | "aria-describedby">, "id" | "className"> & {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { RadioButtonProps } from './RadioButton.types';
|
|
3
2
|
export declare const CustomRadioButton: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
4
3
|
export declare const Input: import("styled-components").StyledComponent<"input", any, {
|
|
@@ -3,9 +3,10 @@ import { __rest } from 'tslib';
|
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { forwardRef, useState } from 'react';
|
|
5
5
|
import styled, { css } from 'styled-components';
|
|
6
|
-
import SearchOutlinedIcon from '@mui/icons-material/SearchOutlined';
|
|
7
6
|
import { searchTokens } from './Search.tokens.js';
|
|
8
7
|
import { Input as Input$1, OuterInputContainer, InputContainer } from '../../helpers/Input/Input.styles.js';
|
|
8
|
+
import { SearchIcon } from '../../icons/tsx/search.js';
|
|
9
|
+
import { Icon } from '../Icon/Icon.js';
|
|
9
10
|
import { derivativeIdGenerator, spaceSeparatedIdListGenerator } from '../../utils/idGenerator.js';
|
|
10
11
|
import { InputMessage } from '../InputMessage/InputMessage.js';
|
|
11
12
|
import { Button } from '../Button/Button.js';
|
|
@@ -17,10 +18,13 @@ var Input = styled(Input$1).withConfig({
|
|
|
17
18
|
var componentSize = _ref.componentSize;
|
|
18
19
|
return css(["", ""], searchTokens.input[componentSize].base);
|
|
19
20
|
});
|
|
20
|
-
var IconWrapper = styled.
|
|
21
|
+
var IconWrapper = styled(Icon).withConfig({
|
|
21
22
|
displayName: "Search__IconWrapper",
|
|
22
23
|
componentId: "sc-1ax3s9s-1"
|
|
23
|
-
})(["
|
|
24
|
+
})(["position:absolute;", " left:", ";", ""], searchTokens.iconWrapper.base, searchTokens.icon.spaceLeft, function (_ref2) {
|
|
25
|
+
var size = _ref2.size;
|
|
26
|
+
return css(["top:", ";"], searchTokens.icon[size].spaceTop);
|
|
27
|
+
});
|
|
24
28
|
var Container = styled.div.withConfig({
|
|
25
29
|
displayName: "Search__Container",
|
|
26
30
|
componentId: "sc-1ax3s9s-2"
|
|
@@ -73,7 +77,9 @@ var Search = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
73
77
|
}, {
|
|
74
78
|
children: [jsxs(InputContainer, {
|
|
75
79
|
children: [jsx(IconWrapper, {
|
|
76
|
-
|
|
80
|
+
icon: SearchIcon,
|
|
81
|
+
size: componentSize,
|
|
82
|
+
iconSize: searchTokens.icon[componentSize].size
|
|
77
83
|
}), jsx(Input, Object.assign({}, inputProps))]
|
|
78
84
|
}), hasTip && jsx(InputMessage, {
|
|
79
85
|
id: tipId,
|
|
@@ -13,8 +13,20 @@ export declare const searchTokens: {
|
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
icon: {
|
|
16
|
-
spaceTop: string;
|
|
17
16
|
spaceLeft: string;
|
|
17
|
+
small: {
|
|
18
|
+
size: string;
|
|
19
|
+
spaceTop: string;
|
|
20
|
+
};
|
|
21
|
+
medium: {
|
|
22
|
+
size: string;
|
|
23
|
+
spaceTop: string;
|
|
24
|
+
};
|
|
25
|
+
large: {
|
|
26
|
+
size: string;
|
|
27
|
+
spaceTop: string;
|
|
28
|
+
};
|
|
29
|
+
spaceTop: string;
|
|
18
30
|
};
|
|
19
31
|
iconWrapper: {
|
|
20
32
|
base: CSSObject;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ddsBaseTokens, ddsReferenceTokens } from '@norges-domstoler/dds-design-tokens';
|
|
2
2
|
|
|
3
3
|
var spacing = ddsBaseTokens.spacing,
|
|
4
|
-
fontPackages = ddsBaseTokens.fontPackages
|
|
4
|
+
fontPackages = ddsBaseTokens.fontPackages,
|
|
5
|
+
iconSizes = ddsBaseTokens.iconSizes;
|
|
5
6
|
var textDefault = ddsReferenceTokens.textDefault;
|
|
6
7
|
var inputBase = {
|
|
7
8
|
paddingRight: spacing.SizesDdsSpacingLocalX05,
|
|
@@ -41,8 +42,20 @@ var searchTokens = {
|
|
|
41
42
|
}
|
|
42
43
|
},
|
|
43
44
|
icon: {
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
spaceLeft: spacing.SizesDdsSpacingLocalX075,
|
|
46
|
+
small: {
|
|
47
|
+
size: 'small',
|
|
48
|
+
spaceTop: "calc(50% - ".concat(iconSizes.DdsIconsizeSmallNumberPx / 2, "px)")
|
|
49
|
+
},
|
|
50
|
+
medium: {
|
|
51
|
+
size: 'medium',
|
|
52
|
+
spaceTop: "calc(50% - ".concat(iconSizes.DdsIconsizeMediumNumberPx / 2, "px)")
|
|
53
|
+
},
|
|
54
|
+
large: {
|
|
55
|
+
size: 'medium',
|
|
56
|
+
spaceTop: "calc(50% - ".concat(iconSizes.DdsIconsizeMediumNumberPx / 2, "px)")
|
|
57
|
+
},
|
|
58
|
+
spaceTop: "calc(50% - ".concat(spacing.SizesDdsSpacingLocalX15NumberPx / 2, "px)")
|
|
46
59
|
},
|
|
47
60
|
iconWrapper: {
|
|
48
61
|
base: iconWrapperBase
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SelectOption, SelectProps } from '.';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: <TOption extends Record<string, unknown>, IsMulti extends boolean = false>({ id, label, errorMessage, tip, required, readOnly, options, isMulti, value, defaultValue, width, closeMenuOnSelect, className, style, isDisabled, isClearable, placeholder, customOptionElement, customSingleValueElement, ...rest }: SelectProps<TOption, IsMulti>, ref: ((instance: import("react-select").SelectInstance<TOption, IsMulti, import("react-select").GroupBase<TOption>> | null) => void) | React.MutableRefObject<import("react-select").SelectInstance<TOption, IsMulti, import("react-select").GroupBase<TOption>> | null> | null) => JSX.Element;
|
|
6
|
+
argTypes: {
|
|
7
|
+
label: {
|
|
8
|
+
control: {
|
|
9
|
+
type: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
tip: {
|
|
13
|
+
control: {
|
|
14
|
+
type: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
errorMessage: {
|
|
18
|
+
control: {
|
|
19
|
+
type: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
width: {
|
|
23
|
+
control: {
|
|
24
|
+
type: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
placeholder: {
|
|
28
|
+
control: {
|
|
29
|
+
type: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
isDisabled: {
|
|
33
|
+
control: {
|
|
34
|
+
type: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
isClearable: {
|
|
38
|
+
control: {
|
|
39
|
+
type: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
required: {
|
|
43
|
+
control: {
|
|
44
|
+
type: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
readOnly: {
|
|
48
|
+
control: {
|
|
49
|
+
type: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
isLoading: {
|
|
53
|
+
control: {
|
|
54
|
+
type: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
parameters: {
|
|
59
|
+
controls: {
|
|
60
|
+
exclude: string[];
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export default _default;
|
|
65
|
+
declare type SingleSelectProps = SelectProps<SelectOption, false>;
|
|
66
|
+
export declare const Overview: (args: SingleSelectProps) => JSX.Element;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { SelectProps } from './Select';
|
|
3
2
|
declare const _default: {
|
|
4
3
|
title: string;
|
|
5
|
-
component: <TOption extends Record<string, unknown>, IsMulti extends boolean = false>({ id, label, errorMessage, tip, required, readOnly, options, isMulti, value, defaultValue, width, closeMenuOnSelect, className, style, isDisabled, isClearable, placeholder, ...rest }: SelectProps<TOption, IsMulti>, ref: ((instance: import("react-select").SelectInstance<TOption, IsMulti, import("react-select").GroupBase<TOption>> | null) => void) | import("react").MutableRefObject<import("react-select").SelectInstance<TOption, IsMulti, import("react-select").GroupBase<TOption>> | null> | null) => JSX.Element;
|
|
4
|
+
component: <TOption extends Record<string, unknown>, IsMulti extends boolean = false>({ id, label, errorMessage, tip, required, readOnly, options, isMulti, value, defaultValue, width, closeMenuOnSelect, className, style, isDisabled, isClearable, placeholder, customOptionElement, customSingleValueElement, ...rest }: SelectProps<TOption, IsMulti>, ref: ((instance: import("react-select").SelectInstance<TOption, IsMulti, import("react-select").GroupBase<TOption>> | null) => void) | import("react").MutableRefObject<import("react-select").SelectInstance<TOption, IsMulti, import("react-select").GroupBase<TOption>> | null> | null) => JSX.Element;
|
|
6
5
|
argTypes: {
|
|
7
6
|
label: {
|
|
8
7
|
control: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Property } from 'csstype';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { GroupBase, Props as ReactSelectProps, SelectInstance } from 'react-select';
|
|
3
|
+
import { GroupBase, OptionProps, Props as ReactSelectProps, SelectInstance, SingleValueProps } from 'react-select';
|
|
4
4
|
import { WithRequiredIf } from '../../types/utils';
|
|
5
5
|
export declare type SelectOption<TValue = unknown> = {
|
|
6
6
|
label: string | number;
|
|
@@ -26,7 +26,9 @@ export declare type SelectProps<TOption extends Record<string, unknown>, IsMulti
|
|
|
26
26
|
className?: string;
|
|
27
27
|
/** Inline styling. */
|
|
28
28
|
style?: React.CSSProperties;
|
|
29
|
+
customOptionElement?: (props: OptionProps<TOption, IsMulti, GroupBase<TOption>>) => JSX.Element;
|
|
30
|
+
customSingleValueElement?: (props: SingleValueProps<TOption, IsMulti, GroupBase<TOption>>) => JSX.Element;
|
|
29
31
|
} & WrappedReactSelectProps<TOption, IsMulti, GroupBase<TOption>>;
|
|
30
32
|
declare type ForwardRefType<TOption, IsMulti extends boolean> = React.ForwardedRef<SelectInstance<TOption, IsMulti, GroupBase<TOption>>>;
|
|
31
|
-
export declare const Select: <TOption extends Record<string, unknown>, IsMulti extends boolean = false>({ id, label, errorMessage, tip, required, readOnly, options, isMulti, value, defaultValue, width, closeMenuOnSelect, className, style, isDisabled, isClearable, placeholder, ...rest }: SelectProps<TOption, IsMulti>, ref: ForwardRefType<TOption, IsMulti>) => JSX.Element;
|
|
33
|
+
export declare const Select: <TOption extends Record<string, unknown>, IsMulti extends boolean = false>({ id, label, errorMessage, tip, required, readOnly, options, isMulti, value, defaultValue, width, closeMenuOnSelect, className, style, isDisabled, isClearable, placeholder, customOptionElement, customSingleValueElement, ...rest }: SelectProps<TOption, IsMulti>, ref: ForwardRefType<TOption, IsMulti>) => JSX.Element;
|
|
32
34
|
export {};
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import { __rest } from 'tslib';
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
-
import CheckOutlinedIcon from '@mui/icons-material/CheckOutlined';
|
|
5
4
|
import React, { useState } from 'react';
|
|
6
5
|
import ReactSelect, { components } from 'react-select';
|
|
7
|
-
import { prefix, getCustomStyles, Wrapper, Container, Label
|
|
6
|
+
import { prefix, getCustomStyles, Wrapper, Container, Label } from './Select.styles.js';
|
|
8
7
|
import { selectTokens } from './Select.tokens.js';
|
|
8
|
+
import { CheckIcon } from '../../icons/tsx/check.js';
|
|
9
9
|
import { RequiredMarker } from '../../helpers/RequiredMarker/RequiredMarker.js';
|
|
10
10
|
import { InputMessage } from '../InputMessage/InputMessage.js';
|
|
11
|
+
import { Icon } from '../Icon/Icon.js';
|
|
11
12
|
import { derivativeIdGenerator, spaceSeparatedIdListGenerator } from '../../utils/idGenerator.js';
|
|
12
13
|
|
|
13
14
|
var DdsOption = components.Option,
|
|
14
15
|
NoOptionsMessage = components.NoOptionsMessage,
|
|
15
|
-
Input = components.Input
|
|
16
|
+
Input = components.Input,
|
|
17
|
+
SingleValue = components.SingleValue;
|
|
16
18
|
var createSelectOptions = function createSelectOptions() {
|
|
17
19
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
18
20
|
args[_key] = arguments[_key];
|
|
@@ -28,13 +30,25 @@ var createSelectOptions = function createSelectOptions() {
|
|
|
28
30
|
|
|
29
31
|
var IconOption = function IconOption(props) {
|
|
30
32
|
return jsxs(DdsOption, Object.assign({}, props, {
|
|
31
|
-
children: [props.isSelected && jsx(
|
|
32
|
-
|
|
33
|
-
iconSize: "
|
|
33
|
+
children: [props.isSelected && jsx(Icon, {
|
|
34
|
+
icon: CheckIcon,
|
|
35
|
+
iconSize: "inherit"
|
|
34
36
|
}), props.children]
|
|
35
37
|
}));
|
|
36
38
|
};
|
|
37
39
|
|
|
40
|
+
var CustomOption = function CustomOption(props, Element) {
|
|
41
|
+
return jsx(DdsOption, Object.assign({}, props, {
|
|
42
|
+
children: jsx(Element, Object.assign({}, props))
|
|
43
|
+
}));
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
var CustomSingleValue = function CustomSingleValue(props, Element) {
|
|
47
|
+
return jsx(SingleValue, Object.assign({}, props, {
|
|
48
|
+
children: jsx(Element, Object.assign({}, props))
|
|
49
|
+
}));
|
|
50
|
+
};
|
|
51
|
+
|
|
38
52
|
var NoOptionsMessageCustom = function NoOptionsMessageCustom(props) {
|
|
39
53
|
return jsx(NoOptionsMessage, Object.assign({}, props, {
|
|
40
54
|
children: "Ingen treff"
|
|
@@ -73,7 +87,9 @@ var SelectInner = function SelectInner(_a, ref) {
|
|
|
73
87
|
isClearable = _a$isClearable === void 0 ? true : _a$isClearable,
|
|
74
88
|
_a$placeholder = _a.placeholder,
|
|
75
89
|
placeholder = _a$placeholder === void 0 ? '-- Velg fra listen --' : _a$placeholder,
|
|
76
|
-
|
|
90
|
+
customOptionElement = _a.customOptionElement,
|
|
91
|
+
customSingleValueElement = _a.customSingleValueElement,
|
|
92
|
+
rest = __rest(_a, ["id", "label", "errorMessage", "tip", "required", "readOnly", "options", "isMulti", "value", "defaultValue", "width", "closeMenuOnSelect", "className", "style", "isDisabled", "isClearable", "placeholder", "customOptionElement", "customSingleValueElement"]);
|
|
77
93
|
|
|
78
94
|
var _useState = useState(id !== null && id !== void 0 ? id : "select-".concat(nextUniqueId++)),
|
|
79
95
|
_useState2 = _slicedToArray(_useState, 1),
|
|
@@ -120,9 +136,14 @@ var SelectInner = function SelectInner(_a, ref) {
|
|
|
120
136
|
return searchFilter(label, inputValue) || inputValue === '';
|
|
121
137
|
},
|
|
122
138
|
components: {
|
|
123
|
-
Option:
|
|
139
|
+
Option: customOptionElement ? function (props) {
|
|
140
|
+
return CustomOption(props, customOptionElement);
|
|
141
|
+
} : IconOption,
|
|
124
142
|
NoOptionsMessage: NoOptionsMessageCustom,
|
|
125
|
-
Input: CustomInput
|
|
143
|
+
Input: CustomInput,
|
|
144
|
+
SingleValue: customSingleValueElement ? function (props) {
|
|
145
|
+
return CustomSingleValue(props, customSingleValueElement);
|
|
146
|
+
} : SingleValue
|
|
126
147
|
},
|
|
127
148
|
'aria-invalid': hasErrorMessage ? true : undefined
|
|
128
149
|
}, rest);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { SelectOption, SelectProps } from '.';
|
|
3
2
|
declare const _default: {
|
|
4
3
|
title: string;
|
|
5
|
-
component: <TOption extends Record<string, unknown>, IsMulti extends boolean = false>({ id, label, errorMessage, tip, required, readOnly, options, isMulti, value, defaultValue, width, closeMenuOnSelect, className, style, isDisabled, isClearable, placeholder, ...rest }: SelectProps<TOption, IsMulti>, ref: ((instance: import("react-select").SelectInstance<TOption, IsMulti, import("react-select").GroupBase<TOption>> | null) => void) | import("react").MutableRefObject<import("react-select").SelectInstance<TOption, IsMulti, import("react-select").GroupBase<TOption>> | null> | null) => JSX.Element;
|
|
4
|
+
component: <TOption extends Record<string, unknown>, IsMulti extends boolean = false>({ id, label, errorMessage, tip, required, readOnly, options, isMulti, value, defaultValue, width, closeMenuOnSelect, className, style, isDisabled, isClearable, placeholder, customOptionElement, customSingleValueElement, ...rest }: SelectProps<TOption, IsMulti>, ref: ((instance: import("react-select").SelectInstance<TOption, IsMulti, import("react-select").GroupBase<TOption>> | null) => void) | import("react").MutableRefObject<import("react-select").SelectInstance<TOption, IsMulti, import("react-select").GroupBase<TOption>> | null> | null) => JSX.Element;
|
|
6
5
|
argTypes: {
|
|
7
6
|
label: {
|
|
8
7
|
control: {
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { GroupBase, StylesConfig } from 'react-select';
|
|
3
|
-
import { IconWrapper } from '../IconWrapper';
|
|
4
2
|
export declare const prefix = "dds-select";
|
|
5
3
|
export declare const Label: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../Typography").TypographyProps & import("react").RefAttributes<HTMLElement>>, any, {}, never>;
|
|
6
4
|
declare type StyledContainerProps = {
|
|
@@ -14,6 +12,5 @@ export declare const Container: import("styled-components").StyledComponent<"div
|
|
|
14
12
|
export declare const Wrapper: import("styled-components").StyledComponent<"div", any, {
|
|
15
13
|
width?: string | number | undefined;
|
|
16
14
|
}, never>;
|
|
17
|
-
export declare const SelectedIconWrapper: import("styled-components").StyledComponent<typeof IconWrapper, any, {}, never>;
|
|
18
15
|
export declare const getCustomStyles: <TOption>() => Partial<StylesConfig<TOption, boolean, GroupBase<TOption>>>;
|
|
19
16
|
export {};
|
|
@@ -3,7 +3,6 @@ import { typographyTokens } from '../Typography/Typography.tokens.js';
|
|
|
3
3
|
import { selectTokens } from './Select.tokens.js';
|
|
4
4
|
import { Typography } from '../Typography/Typography.js';
|
|
5
5
|
import { scrollbarStyling } from '../../helpers/styling/scrollbarStyling.js';
|
|
6
|
-
import { IconWrapper } from '../IconWrapper/IconWrapper.js';
|
|
7
6
|
|
|
8
7
|
var prefix = 'dds-select';
|
|
9
8
|
var Label = styled(Typography).withConfig({
|
|
@@ -13,34 +12,27 @@ var Label = styled(Typography).withConfig({
|
|
|
13
12
|
var Container = styled.div.withConfig({
|
|
14
13
|
displayName: "Selectstyles__Container",
|
|
15
14
|
componentId: "sc-19jkd5s-1"
|
|
16
|
-
})(["@media (prefers-reduced-motion:no-preference){transition:box-shadow 0.2s,border-color 0.2s,background-color 0.2s;}position:relative;", " ", " *::selection{", "}", "
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
}, function (_ref2) {
|
|
20
|
-
var hasLabel = _ref2.hasLabel,
|
|
21
|
-
isMulti = _ref2.isMulti;
|
|
15
|
+
})(["@media (prefers-reduced-motion:no-preference){transition:box-shadow 0.2s,border-color 0.2s,background-color 0.2s;}position:relative;", " ", " *::selection{", "}", " &:hover{", " ", "{", "}}&:focus-within{", " ", "{", "}}", " .", "__menu-list{", "}&:hover .", "__dropdown-indicator,&:focus-within .", "__dropdown-indicator{", "}", " ", ""], selectTokens.container.base, scrollbarStyling, typographyTokens.selection.base, function (_ref) {
|
|
16
|
+
var hasLabel = _ref.hasLabel,
|
|
17
|
+
isMulti = _ref.isMulti;
|
|
22
18
|
return isMulti && hasLabel ? css([".", "__value-container{", "}.", "__indicators{", "}"], prefix, selectTokens.valueContainer.isMulti.withLabel.base, prefix, selectTokens.indicatorsContainer.isMulti.withLabel.base) : isMulti && !hasLabel ? css([".", "__control{", "}.", "__value-container{", "}.", "__indicators{", "}"], prefix, selectTokens.input.isMulti.noLabel.base, prefix, selectTokens.valueContainer.isMulti.noLabel.base, prefix, selectTokens.indicatorsContainer.isMulti.noLabel.base) : hasLabel ? css([".", "__value-container{", "}.", "__indicators{", "}"], prefix, selectTokens.valueContainer.withLabel.base, prefix, selectTokens.indicatorsContainer.withLabel.base) : css([".", "__control{", "}.", "__value-container{", "}.", "__indicators{", "}"], prefix, selectTokens.input.noLabel.base, prefix, selectTokens.valueContainer.noLabel.base, prefix, selectTokens.indicatorsContainer.noLabel.base);
|
|
23
|
-
}, selectTokens.container.hover.base, Label, selectTokens.label.hover.base, selectTokens.container.focus.base, Label, selectTokens.label.focus.base, function (
|
|
24
|
-
var errorMessage =
|
|
19
|
+
}, selectTokens.container.hover.base, Label, selectTokens.label.hover.base, selectTokens.container.focus.base, Label, selectTokens.label.focus.base, function (_ref2) {
|
|
20
|
+
var errorMessage = _ref2.errorMessage;
|
|
25
21
|
return errorMessage && css(["", " &:hover{", "}&:focus-within{", "}"], selectTokens.container.danger.base, selectTokens.container.danger.hover.base, selectTokens.container.danger.focus.base);
|
|
26
|
-
}, prefix, scrollbarStyling, prefix, prefix, selectTokens.dropdownIndicator.hover.base, function (
|
|
27
|
-
var isDisabled =
|
|
22
|
+
}, prefix, scrollbarStyling, prefix, prefix, selectTokens.dropdownIndicator.hover.base, function (_ref3) {
|
|
23
|
+
var isDisabled = _ref3.isDisabled;
|
|
28
24
|
return isDisabled && css(["cursor:not-allowed;", " &:hover{box-shadow:none;", " ", "{", "}&:hover .", "__dropdown-indicator{", "}}"], selectTokens.container.disabled.base, selectTokens.container.disabled.base, Label, selectTokens.label.base, prefix, selectTokens.dropdownIndicator.base);
|
|
29
|
-
}, function (
|
|
30
|
-
var readOnly =
|
|
25
|
+
}, function (_ref4) {
|
|
26
|
+
var readOnly = _ref4.readOnly;
|
|
31
27
|
return readOnly && css(["", " &:hover{box-shadow:none;", " ", "{", "}}.", "__dropdown-indicator,&:hover .", "__dropdown-indicator{", "}"], selectTokens.container.readOnly.base, selectTokens.container.readOnly.base, Label, selectTokens.label.base, prefix, prefix, selectTokens.dropdownIndicator.readOnly.base);
|
|
32
28
|
});
|
|
33
29
|
var Wrapper = styled.div.withConfig({
|
|
34
30
|
displayName: "Selectstyles__Wrapper",
|
|
35
31
|
componentId: "sc-19jkd5s-2"
|
|
36
|
-
})(["margin:0;width:", ";"], function (
|
|
37
|
-
var width =
|
|
32
|
+
})(["margin:0;width:", ";"], function (_ref5) {
|
|
33
|
+
var width = _ref5.width;
|
|
38
34
|
return width;
|
|
39
35
|
});
|
|
40
|
-
var SelectedIconWrapper = styled(IconWrapper).withConfig({
|
|
41
|
-
displayName: "Selectstyles__SelectedIconWrapper",
|
|
42
|
-
componentId: "sc-19jkd5s-3"
|
|
43
|
-
})(["margin:", ";"], selectTokens.option.selected.icon.margin);
|
|
44
36
|
var getCustomStyles = function getCustomStyles() {
|
|
45
37
|
return {
|
|
46
38
|
control: function control() {
|
|
@@ -121,8 +113,6 @@ var getCustomStyles = function getCustomStyles() {
|
|
|
121
113
|
},
|
|
122
114
|
option: function option(provided, state) {
|
|
123
115
|
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, provided), {
|
|
124
|
-
display: 'flex',
|
|
125
|
-
alignItems: 'center',
|
|
126
116
|
'@media (prefers-reduced-motion: no-preference)': {
|
|
127
117
|
transition: 'color 0.2s, background-color 0.2s'
|
|
128
118
|
}
|
|
@@ -146,4 +136,4 @@ var getCustomStyles = function getCustomStyles() {
|
|
|
146
136
|
};
|
|
147
137
|
};
|
|
148
138
|
|
|
149
|
-
export { Container, Label,
|
|
139
|
+
export { Container, Label, Wrapper, getCustomStyles, prefix };
|
|
@@ -109,6 +109,9 @@ var menuBase = {
|
|
|
109
109
|
marginBottom: Spacing.SizesDdsSpacingLocalX025
|
|
110
110
|
};
|
|
111
111
|
var optionBase = Object.assign(Object.assign({
|
|
112
|
+
display: 'flex',
|
|
113
|
+
alignItems: 'center',
|
|
114
|
+
gap: Spacing.SizesDdsSpacingLocalX05,
|
|
112
115
|
padding: "".concat(Spacing.SizesDdsSpacingLocalX05, " ").concat(Spacing.SizesDdsSpacingLocalX1)
|
|
113
116
|
}, FontPackages.body_sans_02.base), {
|
|
114
117
|
color: textDefault.textColor
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseComponentPropsWithChildren } from '../../types';
|
|
2
|
+
declare type BaseStepProps = {
|
|
3
|
+
/** Om steget er valgt eller ikke. Settes av konsument. */
|
|
4
|
+
active?: boolean;
|
|
5
|
+
/** Om steget er ferdig eller ikke. Settes av konsument */
|
|
6
|
+
completed?: boolean;
|
|
7
|
+
/** Indeksen til steget. NB! Denne settes automatisk av <Stepper /> og skal ikke settes manuelt. */
|
|
8
|
+
index?: number;
|
|
9
|
+
};
|
|
10
|
+
declare type StepProps = ({
|
|
11
|
+
/** Click-handler som gjør det mulig for bruker å klikke på steget for å navigere. Valgfri. */
|
|
12
|
+
onClick: (stepIndex: number) => void;
|
|
13
|
+
} & BaseComponentPropsWithChildren<HTMLButtonElement, BaseStepProps>) | ({
|
|
14
|
+
onClick?: undefined;
|
|
15
|
+
} & BaseComponentPropsWithChildren<HTMLDivElement, BaseStepProps>);
|
|
16
|
+
/**
|
|
17
|
+
* @beta Denne komponenten er ikke ferdig og endringer kan gjøres utenfor semver.
|
|
18
|
+
*/
|
|
19
|
+
export declare const Step: (props: StepProps) => JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { useStepperContext } from './Stepper.context.js';
|
|
4
|
+
import { stepperTokens } from './Stepper.tokens.js';
|
|
5
|
+
import { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden.js';
|
|
6
|
+
import { focusVisibleTransitionValue, focusVisible } from '../../helpers/styling/focusVisible.js';
|
|
7
|
+
|
|
8
|
+
var toStepState = function toStepState(active, completed) {
|
|
9
|
+
return active ? completed ? 'activeCompleted' : 'activeIncomplete' : completed ? 'inactiveCompleted' : 'inactiveIncomplete';
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
var stepNumber = stepperTokens.stepNumber,
|
|
13
|
+
connector = stepperTokens.connector,
|
|
14
|
+
stepButton = stepperTokens.stepButton;
|
|
15
|
+
var stepSize = '40px';
|
|
16
|
+
var StepWrapper = styled.li.withConfig({
|
|
17
|
+
displayName: "Step__StepWrapper",
|
|
18
|
+
componentId: "sc-5n6xpp-0"
|
|
19
|
+
})(["flex:1;position:relative;display:flex;justify-content:center;:not(:last-child):after{content:'';display:block;border-top:1px solid ", ";position:absolute;width:100%;left:50%;top:calc(", " / 2);}"], connector.color, stepSize);
|
|
20
|
+
var StepContentWrapper = styled.div.withConfig({
|
|
21
|
+
displayName: "Step__StepContentWrapper",
|
|
22
|
+
componentId: "sc-5n6xpp-1"
|
|
23
|
+
})(["background:none;border:none;margin:0;padding:0;display:flex;flex-direction:column;align-items:center;transition:", ";:focus-visible{", "}", ""], focusVisibleTransitionValue, focusVisible, function (_ref) {
|
|
24
|
+
var clickable = _ref.clickable;
|
|
25
|
+
return clickable && css(["cursor:pointer;"]);
|
|
26
|
+
});
|
|
27
|
+
var StepNumber = styled.div.withConfig({
|
|
28
|
+
displayName: "Step__StepNumber",
|
|
29
|
+
componentId: "sc-5n6xpp-2"
|
|
30
|
+
})(["border-radius:50%;border:1px solid;padding:5px;width:", ";height:", ";display:flex;align-items:center;justify-content:center;z-index:2;", ""], stepSize, stepSize, function (_ref2) {
|
|
31
|
+
var state = _ref2.state;
|
|
32
|
+
|
|
33
|
+
switch (state) {
|
|
34
|
+
case 'activeIncomplete':
|
|
35
|
+
return css(["border-color:", ";color:", ";background-color:", ";"], stepNumber.active.borderColor, stepNumber.active.color, stepNumber.active.backgroundColor);
|
|
36
|
+
|
|
37
|
+
case 'activeCompleted':
|
|
38
|
+
case 'inactiveCompleted':
|
|
39
|
+
return css(["border-color:", ";color:", ";background-color:", ";"], stepNumber.completed.borderColor, stepNumber.completed.color, stepNumber.completed.backgroundColor);
|
|
40
|
+
|
|
41
|
+
case 'inactiveIncomplete':
|
|
42
|
+
return css(["border-color:", ";color:", ";background-color:", ";"], stepNumber.inactive.borderColor, stepNumber.inactive.color, stepNumber.inactive.backgroundColor);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
var StepCompletedCheck = styled.div.withConfig({
|
|
46
|
+
displayName: "Step__StepCompletedCheck",
|
|
47
|
+
componentId: "sc-5n6xpp-3"
|
|
48
|
+
})(["border:solid ", ";border-width:0 2px 2px 0;transform:rotate(45deg);width:27.5%;height:55%;margin-top:-2px;"], stepNumber.completed.color);
|
|
49
|
+
var StepText = styled.div.withConfig({
|
|
50
|
+
displayName: "Step__StepText",
|
|
51
|
+
componentId: "sc-5n6xpp-4"
|
|
52
|
+
})(["font-family:", ";font-size:", ";margin-top:", ";", ""], stepButton.fontFamily, stepButton.fontSize, stepButton.marginTop, function (_ref3) {
|
|
53
|
+
var state = _ref3.state,
|
|
54
|
+
clickable = _ref3.clickable;
|
|
55
|
+
|
|
56
|
+
switch (state) {
|
|
57
|
+
case 'activeCompleted':
|
|
58
|
+
case 'activeIncomplete':
|
|
59
|
+
return css(["color:", ";text-decoration ", ";"], stepButton.active.color, clickable ? stepButton.active.textDecoration : 'none');
|
|
60
|
+
|
|
61
|
+
case 'inactiveCompleted':
|
|
62
|
+
return css(["color:", ";text-decoration ", ";"], stepButton.completed.color, clickable ? stepButton.completed.textDecoration : 'none');
|
|
63
|
+
|
|
64
|
+
case 'inactiveIncomplete':
|
|
65
|
+
return css(["color:", ";text-decoration ", ";"], stepButton.inactive.color, clickable ? stepButton.inactive.textDecoration : 'none');
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
var getVisuallyHiddenText = function getVisuallyHiddenText(active, completed) {
|
|
70
|
+
return "".concat(active ? '' : 'Trinn, ').concat(completed ? 'Ferdig, ' : 'Ikke ferdig, ');
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* @beta Denne komponenten er ikke ferdig og endringer kan gjøres utenfor semver.
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
var Step = function Step(props) {
|
|
78
|
+
var _props$index = props.index,
|
|
79
|
+
index = _props$index === void 0 ? 0 : _props$index,
|
|
80
|
+
_props$completed = props.completed,
|
|
81
|
+
completed = _props$completed === void 0 ? false : _props$completed,
|
|
82
|
+
children = props.children;
|
|
83
|
+
|
|
84
|
+
var _useStepperContext = useStepperContext(),
|
|
85
|
+
activeStep = _useStepperContext.activeStep;
|
|
86
|
+
|
|
87
|
+
var active = activeStep === index;
|
|
88
|
+
var styleProps = {
|
|
89
|
+
state: toStepState(active, completed),
|
|
90
|
+
clickable: props.onClick !== undefined
|
|
91
|
+
};
|
|
92
|
+
return jsx(StepWrapper, Object.assign({
|
|
93
|
+
"aria-current": active ? 'step' : undefined
|
|
94
|
+
}, {
|
|
95
|
+
children: jsxs(StepContentWrapper, Object.assign({}, styleProps, {
|
|
96
|
+
as: props.onClick ? 'button' : 'div',
|
|
97
|
+
onClick: props.onClick ? function () {
|
|
98
|
+
return props.onClick(index);
|
|
99
|
+
} : undefined
|
|
100
|
+
}, {
|
|
101
|
+
children: [jsx(StepNumber, Object.assign({}, styleProps, {
|
|
102
|
+
children: completed ? jsx(StepCompletedCheck, {}) : index + 1
|
|
103
|
+
})), jsxs(StepText, Object.assign({}, styleProps, {
|
|
104
|
+
children: [jsx(VisuallyHidden, Object.assign({
|
|
105
|
+
as: "span"
|
|
106
|
+
}, {
|
|
107
|
+
children: getVisuallyHiddenText(active, completed)
|
|
108
|
+
})), children]
|
|
109
|
+
}))]
|
|
110
|
+
}))
|
|
111
|
+
}));
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export { Step };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
var StepperContext = /*#__PURE__*/createContext({
|
|
4
|
+
activeStep: 0
|
|
5
|
+
});
|
|
6
|
+
var useStepperContext = function useStepperContext() {
|
|
7
|
+
return useContext(StepperContext);
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { StepperContext, useStepperContext };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @beta Denne komponenten er ikke ferdig og endringer kan gjøres utenfor semver.
|
|
3
|
+
*/
|
|
4
|
+
export declare const Stepper: import("react").ForwardRefExoticComponent<{
|
|
5
|
+
htmlProps?: import("react").HTMLAttributes<HTMLDivElement> | undefined;
|
|
6
|
+
} & Pick<import("react").HTMLAttributes<HTMLDivElement>, "id" | "className"> & {
|
|
7
|
+
/** Indeksen til det aktive steget. */
|
|
8
|
+
activeStep?: number | undefined;
|
|
9
|
+
} & {
|
|
10
|
+
children?: import("react").ReactNode;
|
|
11
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|