@navikt/ds-react 5.12.5 → 5.14.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/_docs.json +285 -138
- package/cjs/accordion/Accordion.js +2 -2
- package/cjs/accordion/AccordionHeader.js +3 -5
- package/cjs/accordion/AccordionItem.js +11 -14
- package/cjs/alert/Alert.js +2 -2
- package/cjs/button/Button.js +11 -12
- package/cjs/chat/Bubble.js +1 -1
- package/cjs/chat/Chat.js +2 -2
- package/cjs/chips/Chips.js +1 -1
- package/cjs/chips/Removable.js +4 -7
- package/cjs/copybutton/CopyButton.js +6 -7
- package/cjs/date/datepicker/DatePicker.js +4 -2
- package/cjs/date/datepicker/parts/Caption.js +2 -2
- package/cjs/date/datepicker/parts/DropdownCaption.js +1 -1
- package/cjs/date/datepicker/parts/HeadRow.js +1 -1
- package/cjs/date/datepicker/parts/Row.js +2 -2
- package/cjs/date/datepicker/parts/WeekRow.js +2 -2
- package/cjs/date/monthpicker/MonthCaption.js +1 -1
- package/cjs/date/monthpicker/MonthPicker.js +4 -3
- package/cjs/date/parts/DateInput.js +1 -1
- package/cjs/date/parts/DateWrapper.js +2 -2
- package/cjs/date/utils/check-dates.js +1 -1
- package/cjs/date/utils/is-match.js +2 -2
- package/cjs/date/utils/parse-date.js +1 -1
- package/cjs/dropdown/Dropdown.js +10 -12
- package/cjs/dropdown/Menu/Divider.js +1 -1
- package/cjs/dropdown/Menu/GroupedList/GroupedHeading.js +1 -1
- package/cjs/dropdown/Menu/GroupedList/GroupedItem.js +3 -6
- package/cjs/dropdown/Menu/List/Item.js +3 -6
- package/cjs/dropdown/Toggle.js +6 -5
- package/cjs/expansion-card/ExpansionCardHeader.js +1 -1
- package/cjs/form/ConfirmationPanel.js +2 -2
- package/cjs/form/ReadOnlyIcon.js +1 -1
- package/cjs/form/Select.js +1 -1
- package/cjs/form/Textarea.js +2 -1
- package/cjs/form/checkbox/Checkbox.js +3 -2
- package/cjs/form/combobox/Combobox.js +7 -7
- package/cjs/form/combobox/ComboboxProvider.js +2 -2
- package/cjs/form/combobox/FilteredOptions/FilteredOptions.js +4 -4
- package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.js +5 -6
- package/cjs/form/combobox/Input/inputContext.js +2 -2
- package/cjs/form/combobox/SelectedOptions/SelectedOptions.js +1 -1
- package/cjs/form/combobox/SelectedOptions/selectedOptionsContext.js +2 -5
- package/cjs/form/error-summary/ErrorSummary.js +3 -3
- package/cjs/form/error-summary/ErrorSummaryItem.js +1 -1
- package/cjs/form/radio/Radio.js +3 -2
- package/cjs/form/radio/RadioGroup.js +2 -2
- package/cjs/form/search/Search.js +3 -2
- package/cjs/form/search/SearchButton.js +3 -5
- package/cjs/form/useFormField.js +2 -2
- package/cjs/grid/Cell.js +1 -1
- package/cjs/grid/Grid.js +1 -1
- package/cjs/guide-panel/GuidePanel.js +1 -1
- package/cjs/guide-panel/Illustration.js +2 -2
- package/cjs/help-text/HelpText.js +5 -7
- package/cjs/help-text/HelpTextIcon.js +2 -2
- package/cjs/internal-header/InternalHeaderButton.js +1 -1
- package/cjs/internal-header/InternalHeaderTitle.js +1 -1
- package/cjs/internal-header/InternalHeaderUser.js +1 -1
- package/cjs/internal-header/InternalHeaderUserButton.js +1 -1
- package/cjs/layout/bleed/Bleed.js +1 -1
- package/cjs/layout/content-container/ContentContainer.js +1 -1
- package/cjs/layout/grid/HGrid.js +1 -1
- package/cjs/layout/page/parts/PageBlock.js +1 -1
- package/cjs/layout/sidemal-test/AvatarPanel.js +1 -1
- package/cjs/layout/sidemal-test/Content.js +3 -3
- package/cjs/layout/sidemal-test/Filter.js +1 -1
- package/cjs/layout/sidemal-test/Intro.js +1 -1
- package/cjs/link-panel/LinkPanel.js +3 -3
- package/cjs/link-panel/LinkPanelDescription.js +1 -1
- package/cjs/link-panel/LinkPanelTitle.js +1 -1
- package/cjs/list/List.js +2 -2
- package/cjs/loader/Loader.js +2 -1
- package/cjs/modal/Modal.js +21 -18
- package/cjs/modal/ModalBody.js +1 -1
- package/cjs/modal/ModalFooter.js +1 -1
- package/cjs/modal/ModalHeader.js +1 -1
- package/cjs/pagination/PaginationItem.js +1 -1
- package/cjs/panel/Panel.js +1 -1
- package/cjs/popover/Popover.js +6 -5
- package/cjs/popover/PopoverContent.js +1 -1
- package/cjs/read-more/ReadMore.js +12 -12
- package/cjs/skeleton/Skeleton.js +1 -1
- package/cjs/stepper/Step.js +6 -6
- package/cjs/table/Body.js +1 -1
- package/cjs/table/ColumnHeader.js +1 -1
- package/cjs/table/DataCell.js +3 -3
- package/cjs/table/ExpandableRow.js +23 -22
- package/cjs/table/Header.js +1 -1
- package/cjs/table/HeaderCell.js +2 -1
- package/cjs/table/Row.js +1 -1
- package/cjs/tabs/TabList.js +3 -2
- package/cjs/tabs/Tabs.js +1 -1
- package/cjs/tag/Tag.js +5 -3
- package/cjs/timeline/AxisLabels.js +1 -1
- package/cjs/timeline/Pin.js +2 -2
- package/cjs/timeline/TimelineRow.js +2 -2
- package/cjs/timeline/hooks/useTimelineRows.js +5 -3
- package/cjs/timeline/period/ClickablePeriod.js +2 -2
- package/cjs/timeline/utils/timeline.js +1 -1
- package/cjs/timeline/zoom/ZoomButton.js +1 -1
- package/cjs/toggle-group/ToggleGroup.js +3 -3
- package/cjs/tooltip/Tooltip.js +18 -12
- package/cjs/typography/BodyLong.js +1 -1
- package/cjs/typography/ErrorMessage.js +1 -1
- package/cjs/typography/Ingress.js +1 -1
- package/cjs/util/Slot.js +2 -5
- package/cjs/util/TextareaAutoSize.js +7 -5
- package/cjs/util/composeEventHandlers.js +17 -0
- package/cjs/util/hooks/index.js +19 -0
- package/cjs/util/hooks/package.json +6 -0
- package/cjs/util/hooks/useCallbackRef.js +18 -0
- package/cjs/util/hooks/useClientLayoutEffect.js +7 -0
- package/cjs/util/hooks/useControllableState.js +25 -0
- package/cjs/util/hooks/useMergeRefs.js +37 -0
- package/cjs/util/{usePrevious.js → hooks/usePrevious.js} +2 -1
- package/cjs/util/index.js +7 -7
- package/cjs/util/types/index.js +2 -0
- package/cjs/util/types/package.json +6 -0
- package/esm/accordion/Accordion.d.ts +1 -1
- package/esm/accordion/Accordion.js +2 -2
- package/esm/accordion/Accordion.js.map +1 -1
- package/esm/accordion/AccordionHeader.js +3 -5
- package/esm/accordion/AccordionHeader.js.map +1 -1
- package/esm/accordion/AccordionItem.d.ts +4 -0
- package/esm/accordion/AccordionItem.js +12 -15
- package/esm/accordion/AccordionItem.js.map +1 -1
- package/esm/alert/Alert.js +2 -2
- package/esm/alert/Alert.js.map +1 -1
- package/esm/button/Button.d.ts +1 -1
- package/esm/button/Button.js +12 -13
- package/esm/button/Button.js.map +1 -1
- package/esm/chat/Bubble.js +1 -1
- package/esm/chat/Bubble.js.map +1 -1
- package/esm/chat/Chat.js +2 -2
- package/esm/chat/Chat.js.map +1 -1
- package/esm/chips/Chips.d.ts +2 -2
- package/esm/chips/Chips.js +1 -1
- package/esm/chips/Chips.js.map +1 -1
- package/esm/chips/Removable.js +4 -7
- package/esm/chips/Removable.js.map +1 -1
- package/esm/chips/Toggle.d.ts +1 -1
- package/esm/copybutton/CopyButton.js +6 -7
- package/esm/copybutton/CopyButton.js.map +1 -1
- package/esm/date/context/useSharedMonthContext.js.map +1 -1
- package/esm/date/datepicker/DatePicker.js +5 -3
- package/esm/date/datepicker/DatePicker.js.map +1 -1
- package/esm/date/datepicker/parts/Caption.js +2 -2
- package/esm/date/datepicker/parts/Caption.js.map +1 -1
- package/esm/date/datepicker/parts/DropdownCaption.js +1 -1
- package/esm/date/datepicker/parts/DropdownCaption.js.map +1 -1
- package/esm/date/datepicker/parts/HeadRow.js +1 -1
- package/esm/date/datepicker/parts/HeadRow.js.map +1 -1
- package/esm/date/datepicker/parts/Row.js +3 -3
- package/esm/date/datepicker/parts/Row.js.map +1 -1
- package/esm/date/datepicker/parts/WeekRow.js +1 -1
- package/esm/date/datepicker/parts/WeekRow.js.map +1 -1
- package/esm/date/monthpicker/MonthCaption.js +1 -1
- package/esm/date/monthpicker/MonthCaption.js.map +1 -1
- package/esm/date/monthpicker/MonthPicker.js +4 -3
- package/esm/date/monthpicker/MonthPicker.js.map +1 -1
- package/esm/date/parts/DateInput.js +1 -1
- package/esm/date/parts/DateInput.js.map +1 -1
- package/esm/date/parts/DateWrapper.js +1 -1
- package/esm/date/parts/DateWrapper.js.map +1 -1
- package/esm/date/utils/check-dates.js +1 -1
- package/esm/date/utils/check-dates.js.map +1 -1
- package/esm/date/utils/get-month-weeks.js.map +1 -1
- package/esm/date/utils/is-match.js +2 -2
- package/esm/date/utils/is-match.js.map +1 -1
- package/esm/date/utils/navigation.js.map +1 -1
- package/esm/date/utils/parse-date.js +1 -1
- package/esm/date/utils/parse-date.js.map +1 -1
- package/esm/dropdown/Dropdown.d.ts +4 -0
- package/esm/dropdown/Dropdown.js +10 -12
- package/esm/dropdown/Dropdown.js.map +1 -1
- package/esm/dropdown/Menu/Divider.js +1 -1
- package/esm/dropdown/Menu/Divider.js.map +1 -1
- package/esm/dropdown/Menu/GroupedList/GroupedHeading.js +1 -1
- package/esm/dropdown/Menu/GroupedList/GroupedHeading.js.map +1 -1
- package/esm/dropdown/Menu/GroupedList/GroupedItem.d.ts +1 -1
- package/esm/dropdown/Menu/GroupedList/GroupedItem.js +3 -6
- package/esm/dropdown/Menu/GroupedList/GroupedItem.js.map +1 -1
- package/esm/dropdown/Menu/GroupedList/index.d.ts +1 -1
- package/esm/dropdown/Menu/List/Item.d.ts +1 -1
- package/esm/dropdown/Menu/List/Item.js +3 -6
- package/esm/dropdown/Menu/List/Item.js.map +1 -1
- package/esm/dropdown/Menu/List/index.d.ts +1 -1
- package/esm/dropdown/Toggle.js +6 -5
- package/esm/dropdown/Toggle.js.map +1 -1
- package/esm/expansion-card/ExpansionCard.d.ts +1 -1
- package/esm/expansion-card/ExpansionCardHeader.js +1 -1
- package/esm/expansion-card/ExpansionCardHeader.js.map +1 -1
- package/esm/expansion-card/ExpansionCardTitle.d.ts +1 -1
- package/esm/form/ConfirmationPanel.js +1 -1
- package/esm/form/ConfirmationPanel.js.map +1 -1
- package/esm/form/Fieldset/useFieldset.d.ts +1 -1
- package/esm/form/ReadOnlyIcon.js +1 -1
- package/esm/form/ReadOnlyIcon.js.map +1 -1
- package/esm/form/Select.js +1 -1
- package/esm/form/Select.js.map +1 -1
- package/esm/form/Switch.js.map +1 -1
- package/esm/form/TextField.js.map +1 -1
- package/esm/form/Textarea.js +2 -1
- package/esm/form/Textarea.js.map +1 -1
- package/esm/form/checkbox/Checkbox.js +2 -1
- package/esm/form/checkbox/Checkbox.js.map +1 -1
- package/esm/form/checkbox/useCheckbox.d.ts +1 -1
- package/esm/form/combobox/Combobox.d.ts +1 -1
- package/esm/form/combobox/Combobox.js +8 -8
- package/esm/form/combobox/Combobox.js.map +1 -1
- package/esm/form/combobox/ComboboxProvider.js +2 -2
- package/esm/form/combobox/ComboboxProvider.js.map +1 -1
- package/esm/form/combobox/FilteredOptions/FilteredOptions.js +4 -4
- package/esm/form/combobox/FilteredOptions/FilteredOptions.js.map +1 -1
- package/esm/form/combobox/FilteredOptions/filteredOptionsContext.d.ts +1 -1
- package/esm/form/combobox/FilteredOptions/filteredOptionsContext.js +3 -4
- package/esm/form/combobox/FilteredOptions/filteredOptionsContext.js.map +1 -1
- package/esm/form/combobox/Input/inputContext.js +1 -1
- package/esm/form/combobox/Input/inputContext.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/combobox/SelectedOptions/selectedOptionsContext.js +1 -1
- package/esm/form/combobox/SelectedOptions/selectedOptionsContext.js.map +1 -1
- package/esm/form/combobox/ToggleListButton.js +1 -1
- package/esm/form/combobox/ToggleListButton.js.map +1 -1
- package/esm/form/combobox/customOptionsContext.js +1 -1
- package/esm/form/combobox/customOptionsContext.js.map +1 -1
- package/esm/form/error-summary/ErrorSummary.js +3 -3
- package/esm/form/error-summary/ErrorSummary.js.map +1 -1
- package/esm/form/error-summary/ErrorSummaryItem.d.ts +1 -1
- package/esm/form/error-summary/ErrorSummaryItem.js +1 -1
- package/esm/form/error-summary/ErrorSummaryItem.js.map +1 -1
- package/esm/form/radio/Radio.js +2 -1
- package/esm/form/radio/Radio.js.map +1 -1
- package/esm/form/radio/RadioGroup.js +1 -1
- package/esm/form/radio/RadioGroup.js.map +1 -1
- package/esm/form/radio/useRadio.d.ts +1 -1
- package/esm/form/search/Search.js +5 -4
- package/esm/form/search/Search.js.map +1 -1
- package/esm/form/search/SearchButton.js +3 -5
- package/esm/form/search/SearchButton.js.map +1 -1
- package/esm/form/useFormField.js +1 -1
- package/esm/form/useFormField.js.map +1 -1
- package/esm/grid/Cell.js +1 -1
- package/esm/grid/Cell.js.map +1 -1
- package/esm/grid/Grid.js +1 -1
- package/esm/grid/Grid.js.map +1 -1
- package/esm/guide-panel/GuidePanel.js +1 -1
- package/esm/guide-panel/GuidePanel.js.map +1 -1
- package/esm/guide-panel/Illustration.js +1 -1
- package/esm/guide-panel/Illustration.js.map +1 -1
- package/esm/help-text/HelpText.d.ts +0 -5
- package/esm/help-text/HelpText.js +6 -8
- package/esm/help-text/HelpText.js.map +1 -1
- package/esm/help-text/HelpTextIcon.js +1 -1
- package/esm/internal-header/InternalHeader.d.ts +1 -1
- package/esm/internal-header/InternalHeader.js.map +1 -1
- package/esm/internal-header/InternalHeaderButton.d.ts +1 -1
- package/esm/internal-header/InternalHeaderButton.js +1 -1
- package/esm/internal-header/InternalHeaderButton.js.map +1 -1
- package/esm/internal-header/InternalHeaderTitle.d.ts +1 -1
- package/esm/internal-header/InternalHeaderTitle.js +1 -1
- package/esm/internal-header/InternalHeaderTitle.js.map +1 -1
- package/esm/internal-header/InternalHeaderUser.js +1 -1
- package/esm/internal-header/InternalHeaderUser.js.map +1 -1
- package/esm/internal-header/InternalHeaderUserButton.d.ts +1 -1
- package/esm/internal-header/InternalHeaderUserButton.js +1 -1
- package/esm/internal-header/InternalHeaderUserButton.js.map +1 -1
- package/esm/layout/bleed/Bleed.js +1 -1
- package/esm/layout/bleed/Bleed.js.map +1 -1
- package/esm/layout/box/Box.d.ts +2 -2
- package/esm/layout/content-container/ContentContainer.js +1 -1
- package/esm/layout/content-container/ContentContainer.js.map +1 -1
- package/esm/layout/grid/HGrid.js +1 -1
- package/esm/layout/grid/HGrid.js.map +1 -1
- package/esm/layout/page/Page.d.ts +2 -2
- package/esm/layout/page/Page.js.map +1 -1
- package/esm/layout/page/parts/PageBlock.d.ts +7 -6
- package/esm/layout/page/parts/PageBlock.js +1 -1
- package/esm/layout/page/parts/PageBlock.js.map +1 -1
- package/esm/layout/responsive/Responsive.js.map +1 -1
- package/esm/layout/sidemal-test/AvatarPanel.js +1 -1
- package/esm/layout/sidemal-test/AvatarPanel.js.map +1 -1
- package/esm/layout/sidemal-test/Content.js +4 -4
- package/esm/layout/sidemal-test/Content.js.map +1 -1
- package/esm/layout/sidemal-test/Filter.js +1 -1
- package/esm/layout/sidemal-test/Filter.js.map +1 -1
- package/esm/layout/sidemal-test/Header.js +1 -1
- package/esm/layout/sidemal-test/Header.js.map +1 -1
- package/esm/layout/sidemal-test/Intro.js +2 -2
- package/esm/layout/sidemal-test/Intro.js.map +1 -1
- package/esm/layout/sidemal-test/content-box/ContentBox.js.map +1 -1
- package/esm/layout/stack/HStack.d.ts +1 -1
- package/esm/layout/stack/HStack.js.map +1 -1
- package/esm/layout/stack/Stack.d.ts +1 -1
- package/esm/layout/stack/Stack.js.map +1 -1
- package/esm/layout/stack/VStack.d.ts +1 -1
- package/esm/layout/stack/VStack.js.map +1 -1
- package/esm/layout/utilities/types.d.ts +2 -2
- package/esm/link/Link.d.ts +1 -1
- package/esm/link-panel/LinkPanel.d.ts +2 -2
- package/esm/link-panel/LinkPanel.js +3 -3
- package/esm/link-panel/LinkPanel.js.map +1 -1
- package/esm/link-panel/LinkPanelDescription.js +1 -1
- package/esm/link-panel/LinkPanelDescription.js.map +1 -1
- package/esm/link-panel/LinkPanelTitle.d.ts +1 -1
- package/esm/link-panel/LinkPanelTitle.js +1 -1
- package/esm/link-panel/LinkPanelTitle.js.map +1 -1
- package/esm/list/List.js +1 -1
- package/esm/loader/Loader.js +2 -1
- package/esm/loader/Loader.js.map +1 -1
- package/esm/modal/Modal.js +21 -18
- package/esm/modal/Modal.js.map +1 -1
- package/esm/modal/ModalBody.js +1 -1
- package/esm/modal/ModalBody.js.map +1 -1
- package/esm/modal/ModalFooter.js +1 -1
- package/esm/modal/ModalFooter.js.map +1 -1
- package/esm/modal/ModalHeader.js +1 -1
- package/esm/modal/ModalHeader.js.map +1 -1
- package/esm/modal/types.d.ts +1 -1
- package/esm/pagination/Pagination.js.map +1 -1
- package/esm/pagination/PaginationItem.d.ts +1 -1
- package/esm/pagination/PaginationItem.js +1 -1
- package/esm/pagination/PaginationItem.js.map +1 -1
- package/esm/panel/Panel.d.ts +1 -1
- package/esm/panel/Panel.js +1 -1
- package/esm/panel/Panel.js.map +1 -1
- package/esm/popover/Popover.d.ts +1 -1
- package/esm/popover/Popover.js +4 -3
- package/esm/popover/Popover.js.map +1 -1
- package/esm/popover/PopoverContent.js +1 -1
- package/esm/popover/PopoverContent.js.map +1 -1
- package/esm/read-more/ReadMore.d.ts +4 -0
- package/esm/read-more/ReadMore.js +13 -13
- package/esm/read-more/ReadMore.js.map +1 -1
- package/esm/skeleton/Skeleton.js +1 -1
- package/esm/skeleton/Skeleton.js.map +1 -1
- package/esm/stepper/Step.d.ts +1 -1
- package/esm/stepper/Step.js +6 -6
- package/esm/stepper/Step.js.map +1 -1
- package/esm/table/AnimateHeight.js.map +1 -0
- package/esm/table/Body.js +1 -1
- package/esm/table/Body.js.map +1 -1
- package/esm/table/ColumnHeader.js +1 -1
- package/esm/table/ColumnHeader.js.map +1 -1
- package/esm/table/DataCell.d.ts +4 -0
- package/esm/table/DataCell.js +3 -3
- package/esm/table/DataCell.js.map +1 -1
- package/esm/table/ExpandableRow.js +23 -22
- package/esm/table/ExpandableRow.js.map +1 -1
- package/esm/table/Header.js +1 -1
- package/esm/table/Header.js.map +1 -1
- package/esm/table/HeaderCell.d.ts +4 -0
- package/esm/table/HeaderCell.js +2 -1
- package/esm/table/HeaderCell.js.map +1 -1
- package/esm/table/Row.js +1 -1
- package/esm/table/Row.js.map +1 -1
- package/esm/tabs/Tab.d.ts +1 -1
- package/esm/tabs/TabList.js +4 -3
- package/esm/tabs/TabList.js.map +1 -1
- package/esm/tabs/Tabs.d.ts +1 -1
- package/esm/tabs/Tabs.js +1 -1
- package/esm/tabs/Tabs.js.map +1 -1
- package/esm/tag/Tag.d.ts +4 -0
- package/esm/tag/Tag.js +5 -3
- package/esm/tag/Tag.js.map +1 -1
- package/esm/timeline/AxisLabels.js +1 -1
- package/esm/timeline/AxisLabels.js.map +1 -1
- package/esm/timeline/Pin.js +3 -3
- package/esm/timeline/Pin.js.map +1 -1
- package/esm/timeline/TimelineRow.js +2 -2
- package/esm/timeline/TimelineRow.js.map +1 -1
- package/esm/timeline/hooks/useTimelineRows.js +5 -3
- package/esm/timeline/hooks/useTimelineRows.js.map +1 -1
- package/esm/timeline/period/ClickablePeriod.js +3 -3
- package/esm/timeline/period/ClickablePeriod.js.map +1 -1
- package/esm/timeline/utils/timeline.js +1 -1
- package/esm/timeline/utils/timeline.js.map +1 -1
- package/esm/timeline/zoom/ZoomButton.js +1 -1
- package/esm/timeline/zoom/ZoomButton.js.map +1 -1
- package/esm/toggle-group/ToggleGroup.js +2 -2
- package/esm/toggle-group/ToggleGroup.js.map +1 -1
- package/esm/tooltip/Tooltip.d.ts +4 -0
- package/esm/tooltip/Tooltip.js +18 -12
- package/esm/tooltip/Tooltip.js.map +1 -1
- package/esm/typography/BodyLong.d.ts +1 -1
- package/esm/typography/BodyLong.js +1 -1
- package/esm/typography/BodyLong.js.map +1 -1
- package/esm/typography/BodyShort.d.ts +1 -1
- package/esm/typography/Detail.d.ts +1 -1
- package/esm/typography/ErrorMessage.d.ts +1 -1
- package/esm/typography/ErrorMessage.js +1 -1
- package/esm/typography/ErrorMessage.js.map +1 -1
- package/esm/typography/Heading.d.ts +1 -1
- package/esm/typography/Ingress.d.ts +1 -1
- package/esm/typography/Ingress.js +1 -1
- package/esm/typography/Ingress.js.map +1 -1
- package/esm/typography/Label.d.ts +1 -1
- package/esm/util/Slot.js +1 -1
- package/esm/util/Slot.js.map +1 -1
- package/esm/util/TextareaAutoSize.js +5 -3
- package/esm/util/TextareaAutoSize.js.map +1 -1
- package/esm/util/composeEventHandlers.d.ts +8 -0
- package/esm/util/composeEventHandlers.js +14 -0
- package/esm/util/composeEventHandlers.js.map +1 -0
- package/esm/util/hooks/index.d.ts +8 -0
- package/esm/util/hooks/index.js +9 -0
- package/esm/util/hooks/index.js.map +1 -0
- package/esm/util/hooks/useCallbackRef.d.ts +7 -0
- package/esm/util/hooks/useCallbackRef.js +15 -0
- package/esm/util/hooks/useCallbackRef.js.map +1 -0
- package/esm/util/hooks/useClientLayoutEffect.js +5 -0
- package/esm/util/hooks/useClientLayoutEffect.js.map +1 -0
- package/esm/util/hooks/useControllableState.d.ts +9 -0
- package/esm/util/hooks/useControllableState.js +22 -0
- package/esm/util/hooks/useControllableState.js.map +1 -0
- package/esm/util/{useEventListener.d.ts → hooks/useEventListener.d.ts} +1 -1
- package/esm/util/hooks/useEventListener.js.map +1 -0
- package/esm/util/hooks/useId.js.map +1 -0
- package/esm/util/hooks/useMedia.js.map +1 -0
- package/esm/util/hooks/useMergeRefs.d.ts +15 -0
- package/esm/util/hooks/useMergeRefs.js +30 -0
- package/esm/util/hooks/useMergeRefs.js.map +1 -0
- package/esm/util/hooks/usePrevious.d.ts +1 -0
- package/esm/util/{usePrevious.js → hooks/usePrevious.js} +1 -2
- package/esm/util/hooks/usePrevious.js.map +1 -0
- package/esm/util/index.d.ts +4 -5
- package/esm/util/index.js +3 -5
- package/esm/util/index.js.map +1 -1
- package/esm/util/types/OverridableComponent.js.map +1 -0
- package/esm/util/types/index.d.ts +1 -0
- package/esm/util/types/index.js +2 -0
- package/esm/util/types/index.js.map +1 -0
- package/package.json +3 -3
- package/src/accordion/Accordion.tsx +5 -5
- package/src/accordion/AccordionContent.tsx +3 -3
- package/src/accordion/AccordionHeader.tsx +5 -7
- package/src/accordion/AccordionItem.tsx +22 -22
- package/src/accordion/accordion.stories.tsx +8 -5
- package/src/alert/Alert.tsx +8 -8
- package/src/alert/alert.stories.tsx +6 -7
- package/src/button/Button.tsx +18 -23
- package/src/button/button.stories.tsx +1 -1
- package/src/chat/Bubble.tsx +4 -4
- package/src/chat/Chat.tsx +5 -5
- package/src/chat/chat.stories.tsx +1 -1
- package/src/chips/Chips.tsx +4 -4
- package/src/chips/Removable.tsx +7 -8
- package/src/chips/Toggle.tsx +4 -4
- package/src/chips/chips.stories.tsx +5 -5
- package/src/copybutton/CopyButton.tsx +9 -10
- package/src/copybutton/copy-button.stories.tsx +3 -3
- package/src/date/context/useSharedMonthContext.tsx +1 -1
- package/src/date/datepicker/DatePicker.tsx +7 -5
- package/src/date/datepicker/DatePickerStandalone.tsx +2 -2
- package/src/date/datepicker/datepicker.stories.tsx +2 -2
- package/src/date/datepicker/parts/Caption.tsx +2 -3
- package/src/date/datepicker/parts/DropdownCaption.tsx +2 -2
- package/src/date/datepicker/parts/HeadRow.tsx +1 -1
- package/src/date/datepicker/parts/Row.tsx +3 -3
- package/src/date/datepicker/parts/WeekRow.tsx +1 -1
- package/src/date/hooks/useDatepicker.tsx +7 -7
- package/src/date/hooks/useMonthPicker.tsx +7 -7
- package/src/date/hooks/useRangeDatepicker.test.tsx +2 -2
- package/src/date/hooks/useRangeDatepicker.tsx +28 -28
- package/src/date/monthpicker/MonthButton.tsx +1 -1
- package/src/date/monthpicker/MonthCaption.tsx +1 -1
- package/src/date/monthpicker/MonthPicker.tsx +7 -6
- package/src/date/monthpicker/MonthPickerStandalone.tsx +3 -3
- package/src/date/monthpicker/MonthSelector.tsx +1 -1
- package/src/date/parts/DateInput.tsx +6 -6
- package/src/date/parts/DateWrapper.tsx +1 -1
- package/src/date/utils/__tests__/check-dates.test.ts +3 -3
- package/src/date/utils/__tests__/format-dates.test.ts +7 -7
- package/src/date/utils/__tests__/get-initial-year.test.ts +14 -14
- package/src/date/utils/__tests__/get-month-weeks.test.ts +0 -1
- package/src/date/utils/__tests__/is-match.test.ts +4 -4
- package/src/date/utils/__tests__/parse-dates.test.ts +2 -2
- package/src/date/utils/check-dates.ts +2 -2
- package/src/date/utils/dates-disabled.ts +1 -1
- package/src/date/utils/format-date.ts +1 -1
- package/src/date/utils/get-dates.ts +1 -1
- package/src/date/utils/get-month-weeks.ts +6 -6
- package/src/date/utils/is-match.ts +2 -3
- package/src/date/utils/labels.ts +1 -1
- package/src/date/utils/navigation.ts +18 -18
- package/src/date/utils/parse-date.ts +8 -8
- package/src/dropdown/Dropdown.tsx +14 -11
- package/src/dropdown/Menu/Divider.tsx +1 -1
- package/src/dropdown/Menu/GroupedList/GroupedHeading.tsx +2 -2
- package/src/dropdown/Menu/GroupedList/GroupedItem.tsx +23 -23
- package/src/dropdown/Menu/GroupedList/index.tsx +2 -2
- package/src/dropdown/Menu/List/Item.tsx +23 -23
- package/src/dropdown/Menu/List/index.tsx +1 -1
- package/src/dropdown/Menu/index.tsx +1 -1
- package/src/dropdown/Toggle.tsx +10 -6
- package/src/dropdown/dropdown.stories.tsx +1 -1
- package/src/expansion-card/ExpansionCard.tsx +4 -4
- package/src/expansion-card/ExpansionCardContent.tsx +1 -1
- package/src/expansion-card/ExpansionCardDescription.tsx +1 -1
- package/src/expansion-card/ExpansionCardHeader.tsx +2 -2
- package/src/expansion-card/ExpansionCardTitle.tsx +3 -3
- package/src/expansion-card/expansion-card.stories.tsx +1 -1
- package/src/form/ConfirmationPanel.test.tsx +1 -1
- package/src/form/ConfirmationPanel.tsx +3 -3
- package/src/form/Fieldset/Fieldset.tsx +2 -2
- package/src/form/ReadOnlyIcon.tsx +1 -1
- package/src/form/Select.tsx +6 -6
- package/src/form/Switch.tsx +4 -4
- package/src/form/TextField.tsx +4 -4
- package/src/form/Textarea.tsx +6 -5
- package/src/form/checkbox/Checkbox.test.tsx +8 -8
- package/src/form/checkbox/Checkbox.tsx +5 -4
- package/src/form/checkbox/CheckboxGroup.tsx +4 -4
- package/src/form/checkbox/useCheckbox.ts +3 -3
- package/src/form/combobox/Combobox.tsx +9 -12
- package/src/form/combobox/ComboboxProvider.tsx +3 -3
- package/src/form/combobox/ComboboxWrapper.tsx +1 -1
- package/src/form/combobox/FilteredOptions/FilteredOptions.tsx +6 -6
- package/src/form/combobox/FilteredOptions/filteredOptionsContext.tsx +17 -18
- package/src/form/combobox/FilteredOptions/useVirtualFocus.ts +5 -5
- package/src/form/combobox/Input/Input.tsx +6 -6
- package/src/form/combobox/Input/inputContext.tsx +7 -7
- package/src/form/combobox/SelectedOptions/SelectedOptions.tsx +1 -1
- package/src/form/combobox/SelectedOptions/selectedOptionsContext.tsx +10 -10
- package/src/form/combobox/ToggleListButton.tsx +1 -2
- package/src/form/combobox/combobox.stories.tsx +17 -18
- package/src/form/combobox/combobox.test.tsx +14 -12
- package/src/form/combobox/customOptionsContext.tsx +6 -6
- package/src/form/combobox/types.ts +2 -2
- package/src/form/error-summary/ErrorSummary.tsx +6 -6
- package/src/form/error-summary/ErrorSummaryItem.tsx +3 -3
- package/src/form/error-summary/error-summary.stories.tsx +2 -1
- package/src/form/radio/Radio.test.tsx +1 -1
- package/src/form/radio/Radio.tsx +3 -2
- package/src/form/radio/RadioGroup.tsx +4 -4
- package/src/form/radio/useRadio.ts +1 -1
- package/src/form/search/Search.tsx +9 -9
- package/src/form/search/SearchButton.tsx +4 -6
- package/src/form/search/search.stories.tsx +1 -1
- package/src/form/stories/fieldset.stories.tsx +3 -2
- package/src/form/stories/select.stories.tsx +2 -1
- package/src/form/stories/text-field.stories.tsx +2 -1
- package/src/form/useFormField.ts +4 -4
- package/src/grid/Cell.tsx +3 -3
- package/src/grid/Grid.tsx +2 -2
- package/src/grid/grid.stories.tsx +1 -1
- package/src/guide-panel/GuidePanel.tsx +2 -2
- package/src/guide-panel/Illustration.tsx +1 -1
- package/src/guide-panel/guidepanel.stories.tsx +1 -1
- package/src/help-text/HelpText.tsx +9 -27
- package/src/help-text/HelpTextIcon.tsx +1 -1
- package/src/help-text/help-text.stories.tsx +58 -68
- package/src/internal-header/InternalHeader.tsx +2 -2
- package/src/internal-header/InternalHeaderButton.tsx +2 -2
- package/src/internal-header/InternalHeaderTitle.tsx +2 -2
- package/src/internal-header/InternalHeaderUser.tsx +1 -1
- package/src/internal-header/InternalHeaderUserButton.tsx +2 -2
- package/src/internal-header/header.stories.tsx +3 -3
- package/src/layout/bleed/Bleed.tsx +7 -7
- package/src/layout/box/Box.stories.tsx +4 -4
- package/src/layout/box/Box.tsx +8 -8
- package/src/layout/content-container/ContentContainer.tsx +1 -1
- package/src/layout/grid/HGrid.tsx +4 -4
- package/src/layout/page/Page.stories.tsx +1 -1
- package/src/layout/page/Page.tsx +4 -4
- package/src/layout/page/parts/PageBlock.tsx +9 -8
- package/src/layout/responsive/Responsive.tsx +6 -6
- package/src/layout/responsive/hide.stories.tsx +1 -1
- package/src/layout/responsive/show.stories.tsx +1 -1
- package/src/layout/sidemal-test/AvatarPanel.tsx +1 -1
- package/src/layout/sidemal-test/Content.tsx +4 -4
- package/src/layout/sidemal-test/Filter.tsx +1 -1
- package/src/layout/sidemal-test/Header.tsx +1 -1
- package/src/layout/sidemal-test/Intro.tsx +2 -2
- package/src/layout/sidemal-test/content-box/ContentBox.tsx +6 -6
- package/src/layout/sidemal-test/navno-sidemal.stories.tsx +1 -1
- package/src/layout/stack/HStack.tsx +2 -2
- package/src/layout/stack/Stack.tsx +4 -4
- package/src/layout/stack/VStack.tsx +2 -2
- package/src/layout/stack/stack.stories.tsx +2 -2
- package/src/layout/utilities/css.ts +6 -6
- package/src/layout/utilities/types.ts +2 -2
- package/src/link/Link.tsx +3 -3
- package/src/link/{link.stories.tsx → stories/link.stories.tsx} +3 -3
- package/src/link-panel/LinkPanel.tsx +6 -7
- package/src/link-panel/LinkPanelDescription.tsx +1 -1
- package/src/link-panel/LinkPanelTitle.tsx +3 -3
- package/src/list/List.tsx +3 -3
- package/src/list/ListItem.tsx +2 -2
- package/src/list/list.stories.tsx +2 -2
- package/src/loader/Loader.tsx +6 -5
- package/src/loader/loader.stories.tsx +1 -0
- package/src/modal/Modal.test.tsx +4 -4
- package/src/modal/Modal.tsx +32 -32
- package/src/modal/ModalBody.tsx +2 -2
- package/src/modal/ModalFooter.tsx +2 -2
- package/src/modal/ModalHeader.tsx +2 -2
- package/src/modal/ModalUtils.ts +2 -2
- package/src/modal/dialog-polyfill.ts +16 -16
- package/src/modal/types.ts +1 -1
- package/src/pagination/Pagination.tsx +5 -6
- package/src/pagination/PaginationItem.tsx +4 -4
- package/src/pagination/steps.test.ts +8 -8
- package/src/panel/Panel.tsx +4 -4
- package/src/panel/panel.stories.tsx +2 -1
- package/src/popover/Popover.test.tsx +7 -7
- package/src/popover/Popover.tsx +11 -14
- package/src/popover/PopoverContent.tsx +2 -2
- package/src/provider/Provider.tsx +1 -1
- package/src/read-more/ReadMore.tsx +20 -16
- package/src/read-more/readmore.stories.tsx +4 -0
- package/src/skeleton/Skeleton.tsx +4 -4
- package/src/stepper/Step.tsx +10 -7
- package/src/stepper/Stepper.tsx +3 -3
- package/src/{util → table}/AnimateHeight.tsx +1 -1
- package/src/table/Body.tsx +1 -1
- package/src/table/ColumnHeader.tsx +2 -2
- package/src/table/DataCell.tsx +8 -3
- package/src/table/ExpandableRow.tsx +30 -23
- package/src/table/Header.tsx +1 -1
- package/src/table/HeaderCell.tsx +7 -2
- package/src/table/Row.tsx +2 -2
- package/src/table/Table.tsx +2 -2
- package/src/table/stories/table-async.stories.tsx +4 -4
- package/src/table/stories/table.stories.tsx +44 -30
- package/src/table/stories/tests/table.stories.tsx +2 -3
- package/src/tabs/Tab.tsx +4 -4
- package/src/tabs/TabList.tsx +8 -6
- package/src/tabs/TabPanel.tsx +1 -1
- package/src/tabs/Tabs.stories.tsx +1 -1
- package/src/tabs/Tabs.tsx +5 -5
- package/src/tag/Tag.tsx +12 -5
- package/src/tag/tag.stories.tsx +28 -2
- package/src/timeline/AxisLabels.tsx +9 -9
- package/src/timeline/Pin.tsx +4 -7
- package/src/timeline/Timeline.tsx +7 -7
- package/src/timeline/TimelineRow.tsx +5 -5
- package/src/timeline/hooks/useTimelineContext.tsx +1 -1
- package/src/timeline/hooks/useTimelineRows.ts +18 -19
- package/src/timeline/period/ClickablePeriod.tsx +6 -9
- package/src/timeline/period/NonClickablePeriod.tsx +1 -1
- package/src/timeline/period/index.tsx +1 -1
- package/src/timeline/timeline.stories.tsx +2 -2
- package/src/timeline/utils/calc.ts +2 -2
- package/src/timeline/utils/filter.ts +2 -2
- package/src/timeline/utils/period.ts +2 -2
- package/src/timeline/utils/timeline.ts +1 -1
- package/src/timeline/zoom/ZoomButton.tsx +3 -3
- package/src/timeline/zoom/index.tsx +1 -1
- package/src/toggle-group/ToggleGroup.stories.tsx +2 -2
- package/src/toggle-group/ToggleGroup.tsx +6 -6
- package/src/toggle-group/ToggleItem.tsx +1 -1
- package/src/toggle-group/context.ts +1 -1
- package/src/tooltip/Tooltip.test.tsx +10 -10
- package/src/tooltip/Tooltip.tsx +31 -33
- package/src/tooltip/tooltip.stories.tsx +1 -1
- package/src/typography/BodyLong.tsx +5 -5
- package/src/typography/BodyShort.tsx +4 -4
- package/src/typography/Detail.tsx +4 -4
- package/src/typography/ErrorMessage.tsx +4 -4
- package/src/typography/Heading.tsx +4 -4
- package/src/typography/Ingress.tsx +2 -2
- package/src/typography/Label.tsx +4 -4
- package/src/typography/stories/bodylong.stories.tsx +1 -2
- package/src/typography/stories/bodyshort.stories.tsx +1 -2
- package/src/typography/stories/detail.stories.tsx +1 -2
- package/src/typography/stories/error-message.stories.tsx +1 -2
- package/src/typography/stories/heading.stories.tsx +1 -3
- package/src/typography/stories/ingress.stories.tsx +1 -2
- package/src/typography/stories/label.stories.tsx +1 -2
- package/src/util/Slot.tsx +4 -4
- package/src/util/TextareaAutoSize.tsx +11 -7
- package/src/util/__tests__/Slot.test.tsx +11 -11
- package/src/util/__tests__/useMedia.test.tsx +1 -1
- package/src/util/composeEventHandlers.ts +19 -0
- package/src/util/hooks/index.ts +8 -0
- package/src/util/hooks/useCallbackRef.ts +20 -0
- package/src/util/hooks/useClientLayoutEffect.ts +5 -0
- package/src/util/hooks/useControllableState.ts +40 -0
- package/src/util/{useEventListener.ts → hooks/useEventListener.ts} +1 -1
- package/src/util/{useMedia.ts → hooks/useMedia.ts} +1 -1
- package/src/util/hooks/useMergeRefs.ts +32 -0
- package/src/util/{usePrevious.ts → hooks/usePrevious.ts} +1 -4
- package/src/util/index.ts +4 -5
- package/src/util/omit.ts +1 -1
- package/src/util/{OverridableComponent.ts → types/OverridableComponent.ts} +1 -1
- package/src/util/types/index.ts +1 -0
- package/cjs/util/RandomIcon.js +0 -38
- package/cjs/util/mergeRefs.js +0 -16
- package/cjs/util/useClientLayoutEffect.js +0 -10
- package/esm/util/AnimateHeight.js.map +0 -1
- package/esm/util/OverridableComponent.js.map +0 -1
- package/esm/util/RandomIcon.d.ts +0 -2
- package/esm/util/RandomIcon.js +0 -9
- package/esm/util/RandomIcon.js.map +0 -1
- package/esm/util/mergeRefs.d.ts +0 -2
- package/esm/util/mergeRefs.js +0 -14
- package/esm/util/mergeRefs.js.map +0 -1
- package/esm/util/useClientLayoutEffect.js +0 -8
- package/esm/util/useClientLayoutEffect.js.map +0 -1
- package/esm/util/useEventListener.js.map +0 -1
- package/esm/util/useId.js.map +0 -1
- package/esm/util/useMedia.js.map +0 -1
- package/esm/util/usePrevious.d.ts +0 -2
- package/esm/util/usePrevious.js.map +0 -1
- package/src/util/mergeRefs.tsx +0 -15
- package/src/util/useClientLayoutEffect.ts +0 -11
- package/cjs/{util → table}/AnimateHeight.js +0 -0
- package/cjs/util/{useEventListener.js → hooks/useEventListener.js} +0 -0
- package/cjs/util/{useId.js → hooks/useId.js} +0 -0
- package/cjs/util/{useMedia.js → hooks/useMedia.js} +0 -0
- package/cjs/util/{OverridableComponent.js → types/OverridableComponent.js} +0 -0
- package/esm/{util → table}/AnimateHeight.d.ts +0 -0
- package/esm/{util → table}/AnimateHeight.js +0 -0
- package/esm/util/{useClientLayoutEffect.d.ts → hooks/useClientLayoutEffect.d.ts} +0 -0
- package/esm/util/{useEventListener.js → hooks/useEventListener.js} +0 -0
- package/esm/util/{useId.d.ts → hooks/useId.d.ts} +0 -0
- package/esm/util/{useId.js → hooks/useId.js} +0 -0
- package/esm/util/{useMedia.d.ts → hooks/useMedia.d.ts} +0 -0
- package/esm/util/{useMedia.js → hooks/useMedia.js} +0 -0
- package/esm/util/{OverridableComponent.d.ts → types/OverridableComponent.d.ts} +0 -0
- package/esm/util/{OverridableComponent.js → types/OverridableComponent.js} +0 -0
- package/src/{util → link/stories}/RandomIcon.tsx +1 -1
- /package/src/util/{useId.ts → hooks/useId.ts} +0 -0
|
@@ -40,24 +40,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
40
40
|
exports.Combobox = void 0;
|
|
41
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
42
42
|
const react_1 = __importStar(require("react"));
|
|
43
|
+
const typography_1 = require("../../typography");
|
|
44
|
+
const useMergeRefs_1 = require("../../util/hooks/useMergeRefs");
|
|
43
45
|
const ClearButton_1 = __importDefault(require("./ClearButton"));
|
|
46
|
+
const ComboboxWrapper_1 = __importDefault(require("./ComboboxWrapper"));
|
|
44
47
|
const FilteredOptions_1 = __importDefault(require("./FilteredOptions/FilteredOptions"));
|
|
45
48
|
const filteredOptionsContext_1 = require("./FilteredOptions/filteredOptionsContext");
|
|
49
|
+
const Input_1 = __importDefault(require("./Input/Input"));
|
|
50
|
+
const inputContext_1 = require("./Input/inputContext");
|
|
46
51
|
const SelectedOptions_1 = __importDefault(require("./SelectedOptions/SelectedOptions"));
|
|
47
|
-
const ToggleListButton_1 = __importDefault(require("./ToggleListButton"));
|
|
48
52
|
const selectedOptionsContext_1 = require("./SelectedOptions/selectedOptionsContext");
|
|
49
|
-
const
|
|
50
|
-
const inputContext_1 = require("./Input/inputContext");
|
|
51
|
-
const Input_1 = __importDefault(require("./Input/Input"));
|
|
52
|
-
const util_1 = require("../../util");
|
|
53
|
-
const typography_1 = require("../../typography");
|
|
53
|
+
const ToggleListButton_1 = __importDefault(require("./ToggleListButton"));
|
|
54
54
|
exports.Combobox = (0, react_1.forwardRef)((props, ref) => {
|
|
55
55
|
const { className, hideLabel = false, description, label, clearButton = true, clearButtonLabel, toggleListButton = true, toggleListButtonLabel, inputClassName, shouldShowSelectedOptions = true } = props, rest = __rest(props, ["className", "hideLabel", "description", "label", "clearButton", "clearButtonLabel", "toggleListButton", "toggleListButtonLabel", "inputClassName", "shouldShowSelectedOptions"]);
|
|
56
56
|
const toggleListButtonRef = (0, react_1.useRef)(null);
|
|
57
57
|
const { activeDecendantId, toggleIsListOpen } = (0, filteredOptionsContext_1.useFilteredOptionsContext)();
|
|
58
58
|
const { selectedOptions } = (0, selectedOptionsContext_1.useSelectedOptionsContext)();
|
|
59
59
|
const { clearInput, error, errorId, focusInput, hasError, inputDescriptionId, inputProps, inputRef, value, showErrorMsg, size = "medium", } = (0, inputContext_1.useInputContext)();
|
|
60
|
-
const mergedInputRef = (0,
|
|
60
|
+
const mergedInputRef = (0, useMergeRefs_1.useMergeRefs)(inputRef, ref);
|
|
61
61
|
return (react_1.default.createElement(ComboboxWrapper_1.default, { className: className, hasError: hasError, inputProps: inputProps, inputSize: size, toggleIsListOpen: toggleIsListOpen, toggleListButtonRef: toggleListButtonRef },
|
|
62
62
|
react_1.default.createElement(typography_1.Label, { htmlFor: inputProps.id, size: size, className: (0, clsx_1.default)("navds-form-field__label", {
|
|
63
63
|
"navds-sr-only": hideLabel,
|
|
@@ -40,9 +40,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
40
40
|
const react_1 = __importStar(require("react"));
|
|
41
41
|
const Combobox_1 = __importDefault(require("./Combobox"));
|
|
42
42
|
const filteredOptionsContext_1 = require("./FilteredOptions/filteredOptionsContext");
|
|
43
|
-
const customOptionsContext_1 = require("./customOptionsContext");
|
|
44
|
-
const selectedOptionsContext_1 = require("./SelectedOptions/selectedOptionsContext");
|
|
45
43
|
const inputContext_1 = require("./Input/inputContext");
|
|
44
|
+
const selectedOptionsContext_1 = require("./SelectedOptions/selectedOptionsContext");
|
|
45
|
+
const customOptionsContext_1 = require("./customOptionsContext");
|
|
46
46
|
/**
|
|
47
47
|
* A component that allows the user to search in a list of options
|
|
48
48
|
*
|
|
@@ -3,15 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const react_1 = __importDefault(require("react"));
|
|
7
6
|
const clsx_1 = __importDefault(require("clsx"));
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const aksel_icons_1 = require("@navikt/aksel-icons");
|
|
9
|
-
const filteredOptionsContext_1 = require("./filteredOptionsContext");
|
|
10
|
-
const selectedOptionsContext_1 = require("../SelectedOptions/selectedOptionsContext");
|
|
11
|
-
const inputContext_1 = require("../Input/inputContext");
|
|
12
9
|
const loader_1 = require("../../../loader");
|
|
13
10
|
const typography_1 = require("../../../typography");
|
|
11
|
+
const inputContext_1 = require("../Input/inputContext");
|
|
12
|
+
const selectedOptionsContext_1 = require("../SelectedOptions/selectedOptionsContext");
|
|
14
13
|
const filtered_options_util_1 = __importDefault(require("./filtered-options-util"));
|
|
14
|
+
const filteredOptionsContext_1 = require("./filteredOptionsContext");
|
|
15
15
|
const FilteredOptions = () => {
|
|
16
16
|
const { inputProps: { id }, size, value, } = (0, inputContext_1.useInputContext)();
|
|
17
17
|
const { allowNewValues, isLoading, isListOpen, filteredOptions, setFilteredOptionsRef, isMouseLastUsedInputDevice, setIsMouseLastUsedInputDevice, isValueNew, toggleIsListOpen, activeDecendantId, virtualFocus, } = (0, filteredOptionsContext_1.useFilteredOptionsContext)();
|
|
@@ -27,12 +27,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.useFilteredOptionsContext = exports.FilteredOptionsProvider = void 0;
|
|
30
|
-
const react_1 = __importStar(require("react"));
|
|
31
30
|
const clsx_1 = __importDefault(require("clsx"));
|
|
32
|
-
const
|
|
31
|
+
const react_1 = __importStar(require("react"));
|
|
32
|
+
const hooks_1 = require("../../../util/hooks");
|
|
33
33
|
const inputContext_1 = require("../Input/inputContext");
|
|
34
|
-
const
|
|
35
|
-
const util_1 = require("../../../util");
|
|
34
|
+
const customOptionsContext_1 = require("../customOptionsContext");
|
|
36
35
|
const filtered_options_util_1 = __importDefault(require("./filtered-options-util"));
|
|
37
36
|
const useVirtualFocus_1 = __importDefault(require("./useVirtualFocus"));
|
|
38
37
|
const FilteredOptionsContext = (0, react_1.createContext)({});
|
|
@@ -50,14 +49,14 @@ const FilteredOptionsProvider = ({ children, value: props, }) => {
|
|
|
50
49
|
const opts = [...customOptions, ...options];
|
|
51
50
|
return filtered_options_util_1.default.getMatchingValuesFromList(searchTerm, opts);
|
|
52
51
|
}, [customOptions, externalFilteredOptions, options, searchTerm]);
|
|
53
|
-
const previousSearchTerm = (0,
|
|
52
|
+
const previousSearchTerm = (0, hooks_1.usePrevious)(searchTerm);
|
|
54
53
|
const [isMouseLastUsedInputDevice, setIsMouseLastUsedInputDevice] = (0, react_1.useState)(false);
|
|
55
54
|
const filteredOptionsMap = (0, react_1.useMemo)(() => options.reduce((map, _option) => (Object.assign(Object.assign({}, map), { [filtered_options_util_1.default.getOptionId(id, _option)]: _option })), {
|
|
56
55
|
[filtered_options_util_1.default.getAddNewOptionId(id)]: allowNewValues
|
|
57
56
|
? value
|
|
58
57
|
: undefined,
|
|
59
58
|
}), [allowNewValues, id, options, value]);
|
|
60
|
-
(0,
|
|
59
|
+
(0, hooks_1.useClientLayoutEffect)(() => {
|
|
61
60
|
if (shouldAutocomplete &&
|
|
62
61
|
filtered_options_util_1.default.normalizeText(searchTerm) !== "" &&
|
|
63
62
|
((previousSearchTerm === null || previousSearchTerm === void 0 ? void 0 : previousSearchTerm.length) || 0) < searchTerm.length &&
|
|
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.useInputContext = exports.InputContextProvider = void 0;
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
|
-
const
|
|
28
|
+
const hooks_1 = require("../../../util/hooks");
|
|
29
29
|
const useFormField_1 = require("../../useFormField");
|
|
30
30
|
const InputContext = (0, react_1.createContext)({});
|
|
31
31
|
const InputContextProvider = ({ children, value: props }) => {
|
|
@@ -61,7 +61,7 @@ const InputContextProvider = ({ children, value: props }) => {
|
|
|
61
61
|
var _a, _b;
|
|
62
62
|
(_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
63
63
|
}, []);
|
|
64
|
-
(0,
|
|
64
|
+
(0, hooks_1.useClientLayoutEffect)(() => {
|
|
65
65
|
var _a, _b;
|
|
66
66
|
if (shouldAutocomplete && inputRef && value !== searchTerm) {
|
|
67
67
|
(_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.setSelectionRange) === null || _b === void 0 ? void 0 : _b.call(_a, searchTerm.length, value.length);
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
const chips_1 = require("../../../chips");
|
|
8
|
-
const selectedOptionsContext_1 = require("./selectedOptionsContext");
|
|
9
8
|
const inputContext_1 = require("../Input/inputContext");
|
|
9
|
+
const selectedOptionsContext_1 = require("./selectedOptionsContext");
|
|
10
10
|
const Option = ({ option }) => {
|
|
11
11
|
const { isMultiSelect, removeSelectedOption } = (0, selectedOptionsContext_1.useSelectedOptionsContext)();
|
|
12
12
|
const { focusInput } = (0, inputContext_1.useInputContext)();
|
|
@@ -22,13 +22,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
26
|
exports.useSelectedOptionsContext = exports.SelectedOptionsProvider = void 0;
|
|
30
27
|
const react_1 = __importStar(require("react"));
|
|
31
|
-
const
|
|
28
|
+
const hooks_1 = require("../../../util/hooks");
|
|
32
29
|
const inputContext_1 = require("../Input/inputContext");
|
|
33
30
|
const customOptionsContext_1 = require("../customOptionsContext");
|
|
34
31
|
const SelectedOptionsContext = (0, react_1.createContext)({});
|
|
@@ -92,7 +89,7 @@ const SelectedOptionsProvider = ({ children, value, }) => {
|
|
|
92
89
|
removeSelectedOption,
|
|
93
90
|
selectedOptions,
|
|
94
91
|
]);
|
|
95
|
-
const prevSelectedOptions = (0,
|
|
92
|
+
const prevSelectedOptions = (0, hooks_1.usePrevious)(selectedOptions);
|
|
96
93
|
const selectedOptionsState = {
|
|
97
94
|
addSelectedOption,
|
|
98
95
|
isMultiSelect,
|
|
@@ -38,11 +38,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.ErrorSummary = void 0;
|
|
41
|
-
const react_1 = __importStar(require("react"));
|
|
42
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
42
|
+
const react_1 = __importStar(require("react"));
|
|
43
43
|
const typography_1 = require("../../typography");
|
|
44
|
+
const hooks_1 = require("../../util/hooks");
|
|
44
45
|
const ErrorSummaryItem_1 = __importDefault(require("./ErrorSummaryItem"));
|
|
45
|
-
const util_1 = require("../../util");
|
|
46
46
|
/**
|
|
47
47
|
* A component that displays a summary of errors.
|
|
48
48
|
*
|
|
@@ -63,7 +63,7 @@ const util_1 = require("../../util");
|
|
|
63
63
|
*/
|
|
64
64
|
exports.ErrorSummary = (0, react_1.forwardRef)((_a, ref) => {
|
|
65
65
|
var { children, className, size = "medium", headingTag = "h2", heading } = _a, rest = __rest(_a, ["children", "className", "size", "headingTag", "heading"]);
|
|
66
|
-
const headingId = (0,
|
|
66
|
+
const headingId = (0, hooks_1.useId)();
|
|
67
67
|
return (react_1.default.createElement("section", Object.assign({ ref: ref }, rest, { className: (0, clsx_1.default)(className, "navds-error-summary", `navds-error-summary--${size}`), tabIndex: -1, "aria-live": "polite", "aria-relevant": "all", "aria-labelledby": headingId }),
|
|
68
68
|
react_1.default.createElement(typography_1.Heading, { className: "navds-error-summary__heading", as: headingTag, size: "small", id: headingId }, heading),
|
|
69
69
|
react_1.default.createElement(typography_1.BodyShort, { as: "ul", size: size, className: "navds-error-summary__list" }, react_1.default.Children.map(children, (child) => {
|
|
@@ -38,8 +38,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.ErrorSummaryItem = void 0;
|
|
41
|
-
const react_1 = __importStar(require("react"));
|
|
42
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
42
|
+
const react_1 = __importStar(require("react"));
|
|
43
43
|
exports.ErrorSummaryItem = (0, react_1.forwardRef)((_a, ref) => {
|
|
44
44
|
var { children, as: Component = "a", className } = _a, rest = __rest(_a, ["children", "as", "className"]);
|
|
45
45
|
return (react_1.default.createElement(Component, Object.assign({}, rest, { ref: ref, className: (0, clsx_1.default)(className, "navds-error-summary__item", "navds-link") }), children));
|
package/cjs/form/radio/Radio.js
CHANGED
|
@@ -31,11 +31,12 @@ const clsx_1 = __importDefault(require("clsx"));
|
|
|
31
31
|
const react_1 = __importStar(require("react"));
|
|
32
32
|
const typography_1 = require("../../typography");
|
|
33
33
|
const util_1 = require("../../util");
|
|
34
|
+
const hooks_1 = require("../../util/hooks");
|
|
34
35
|
const useRadio_1 = require("./useRadio");
|
|
35
36
|
exports.Radio = (0, react_1.forwardRef)((props, ref) => {
|
|
36
37
|
const { inputProps, size, hasError, readOnly } = (0, useRadio_1.useRadio)(props);
|
|
37
|
-
const labelId = (0,
|
|
38
|
-
const descriptionId = (0,
|
|
38
|
+
const labelId = (0, hooks_1.useId)();
|
|
39
|
+
const descriptionId = (0, hooks_1.useId)();
|
|
39
40
|
return (react_1.default.createElement("div", { className: (0, clsx_1.default)(props.className, "navds-radio", `navds-radio--${size}`, {
|
|
40
41
|
"navds-radio--error": hasError,
|
|
41
42
|
"navds-radio--disabled": inputProps.disabled,
|
|
@@ -40,7 +40,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
40
40
|
exports.RadioGroup = exports.RadioGroupContext = void 0;
|
|
41
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
42
42
|
const react_1 = __importStar(require("react"));
|
|
43
|
-
const
|
|
43
|
+
const hooks_1 = require("../../util/hooks");
|
|
44
44
|
const Fieldset_1 = require("../Fieldset");
|
|
45
45
|
exports.RadioGroupContext = react_1.default.createContext(null);
|
|
46
46
|
/**
|
|
@@ -57,7 +57,7 @@ exports.RadioGroup = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
57
57
|
var _b, _c;
|
|
58
58
|
var { children, className, name, defaultValue, value, onChange = () => { }, required, readOnly } = _a, rest = __rest(_a, ["children", "className", "name", "defaultValue", "value", "onChange", "required", "readOnly"]);
|
|
59
59
|
const fieldset = (0, react_1.useContext)(Fieldset_1.FieldsetContext);
|
|
60
|
-
const nameId = (0,
|
|
60
|
+
const nameId = (0, hooks_1.useId)();
|
|
61
61
|
return (react_1.default.createElement(Fieldset_1.Fieldset, Object.assign({}, rest, { readOnly: readOnly, ref: ref, className: (0, clsx_1.default)(className, "navds-radio-group", `navds-radio-group--${(_c = (_b = rest.size) !== null && _b !== void 0 ? _b : fieldset === null || fieldset === void 0 ? void 0 : fieldset.size) !== null && _c !== void 0 ? _c : "medium"}`), nativeReadOnly: false }),
|
|
62
62
|
react_1.default.createElement(exports.RadioGroupContext.Provider, { value: {
|
|
63
63
|
name: name !== null && name !== void 0 ? name : `radioGroupName-${nameId}`,
|
|
@@ -38,11 +38,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.Search = void 0;
|
|
41
|
-
const aksel_icons_1 = require("@navikt/aksel-icons");
|
|
42
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
43
42
|
const react_1 = __importStar(require("react"));
|
|
43
|
+
const aksel_icons_1 = require("@navikt/aksel-icons");
|
|
44
44
|
const typography_1 = require("../../typography");
|
|
45
45
|
const util_1 = require("../../util");
|
|
46
|
+
const useMergeRefs_1 = require("../../util/hooks/useMergeRefs");
|
|
46
47
|
const useFormField_1 = require("../useFormField");
|
|
47
48
|
const SearchButton_1 = __importDefault(require("./SearchButton"));
|
|
48
49
|
const context_1 = require("./context");
|
|
@@ -63,7 +64,7 @@ exports.Search = (0, react_1.forwardRef)((props, ref) => {
|
|
|
63
64
|
const { inputProps, size = "medium", inputDescriptionId, errorId, showErrorMsg, hasError, } = (0, useFormField_1.useFormField)(props, "searchfield");
|
|
64
65
|
const { className, hideLabel = true, label, description, value, clearButtonLabel, onClear, clearButton = true, children, variant = "primary", defaultValue, onChange, onSearchClick, htmlSize } = props, rest = __rest(props, ["className", "hideLabel", "label", "description", "value", "clearButtonLabel", "onClear", "clearButton", "children", "variant", "defaultValue", "onChange", "onSearchClick", "htmlSize"]);
|
|
65
66
|
const searchRef = (0, react_1.useRef)(null);
|
|
66
|
-
const mergedRef = (0,
|
|
67
|
+
const mergedRef = (0, useMergeRefs_1.useMergeRefs)(searchRef, ref);
|
|
67
68
|
const [internalValue, setInternalValue] = (0, react_1.useState)(defaultValue !== null && defaultValue !== void 0 ? defaultValue : "");
|
|
68
69
|
const handleChange = (0, react_1.useCallback)((v) => {
|
|
69
70
|
value === undefined && setInternalValue(v);
|
|
@@ -37,10 +37,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
const aksel_icons_1 = require("@navikt/aksel-icons");
|
|
41
40
|
const clsx_1 = __importDefault(require("clsx"));
|
|
42
41
|
const react_1 = __importStar(require("react"));
|
|
42
|
+
const aksel_icons_1 = require("@navikt/aksel-icons");
|
|
43
43
|
const button_1 = require("../../button");
|
|
44
|
+
const composeEventHandlers_1 = require("../../util/composeEventHandlers");
|
|
44
45
|
const context_1 = require("./context");
|
|
45
46
|
const SearchButton = (0, react_1.forwardRef)((_a, ref) => {
|
|
46
47
|
var _b;
|
|
@@ -51,9 +52,6 @@ const SearchButton = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
51
52
|
return null;
|
|
52
53
|
}
|
|
53
54
|
const { size, variant, handleClick } = context;
|
|
54
|
-
return (react_1.default.createElement(button_1.Button, Object.assign({ type: "submit" }, rest, { ref: ref, size: size, variant: variant === "secondary" ? "secondary" : "primary", className: (0, clsx_1.default)("navds-search__button-search", className), disabled: (_b = context === null || context === void 0 ? void 0 : context.disabled) !== null && _b !== void 0 ? _b : disabled, onClick: (
|
|
55
|
-
handleClick();
|
|
56
|
-
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
57
|
-
}, icon: react_1.default.createElement(aksel_icons_1.MagnifyingGlassIcon, Object.assign({}, (children ? { "aria-hidden": true } : { title: "Søk" }))) }), children));
|
|
55
|
+
return (react_1.default.createElement(button_1.Button, Object.assign({ type: "submit" }, rest, { ref: ref, size: size, variant: variant === "secondary" ? "secondary" : "primary", className: (0, clsx_1.default)("navds-search__button-search", className), disabled: (_b = context === null || context === void 0 ? void 0 : context.disabled) !== null && _b !== void 0 ? _b : disabled, onClick: (0, composeEventHandlers_1.composeEventHandlers)(onClick, handleClick), icon: react_1.default.createElement(aksel_icons_1.MagnifyingGlassIcon, Object.assign({}, (children ? { "aria-hidden": true } : { title: "Søk" }))) }), children));
|
|
58
56
|
});
|
|
59
57
|
exports.default = SearchButton;
|
package/cjs/form/useFormField.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.useFormField = void 0;
|
|
7
7
|
const clsx_1 = __importDefault(require("clsx"));
|
|
8
8
|
const react_1 = require("react");
|
|
9
|
-
const
|
|
9
|
+
const hooks_1 = require("../util/hooks");
|
|
10
10
|
const context_1 = require("./Fieldset/context");
|
|
11
11
|
/**
|
|
12
12
|
* Handles props and their state for various form-fields in context with Fieldset
|
|
@@ -15,7 +15,7 @@ const useFormField = (props, prefix) => {
|
|
|
15
15
|
var _a, _b, _c;
|
|
16
16
|
const { size, error, errorId: propErrorId } = props;
|
|
17
17
|
const fieldset = (0, react_1.useContext)(context_1.FieldsetContext);
|
|
18
|
-
const genId = (0,
|
|
18
|
+
const genId = (0, hooks_1.useId)();
|
|
19
19
|
const id = (_a = props.id) !== null && _a !== void 0 ? _a : `${prefix}-${genId}`;
|
|
20
20
|
const errorId = propErrorId !== null && propErrorId !== void 0 ? propErrorId : `${prefix}-error-${genId}`;
|
|
21
21
|
const inputDescriptionId = `${prefix}-description-${genId}`;
|
package/cjs/grid/Cell.js
CHANGED
|
@@ -38,8 +38,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.Cell = void 0;
|
|
41
|
-
const react_1 = __importStar(require("react"));
|
|
42
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
42
|
+
const react_1 = __importStar(require("react"));
|
|
43
43
|
/**
|
|
44
44
|
* @deprecated Use <HGrid /> instead. <Grid /> will be removed in the future.
|
|
45
45
|
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/hgrid)
|
package/cjs/grid/Grid.js
CHANGED
|
@@ -38,8 +38,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.Grid = void 0;
|
|
41
|
-
const react_1 = __importStar(require("react"));
|
|
42
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
42
|
+
const react_1 = __importStar(require("react"));
|
|
43
43
|
/**
|
|
44
44
|
* @deprecated Use <HGrid /> instead. <Grid /> will be removed in the future.
|
|
45
45
|
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/hgrid)
|
|
@@ -38,8 +38,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.GuidePanel = void 0;
|
|
41
|
-
const react_1 = __importStar(require("react"));
|
|
42
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
42
|
+
const react_1 = __importStar(require("react"));
|
|
43
43
|
const Illustration_1 = require("./Illustration");
|
|
44
44
|
/**
|
|
45
45
|
* A component for guiding users on the website
|
|
@@ -16,10 +16,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.DefaultIllustration = void 0;
|
|
18
18
|
const react_1 = __importDefault(require("react"));
|
|
19
|
-
const
|
|
19
|
+
const hooks_1 = require("../util/hooks");
|
|
20
20
|
const DefaultIllustration = (_a) => {
|
|
21
21
|
var { title, titleId: _titleId } = _a, props = __rest(_a, ["title", "titleId"]);
|
|
22
|
-
let titleId = (0,
|
|
22
|
+
let titleId = (0, hooks_1.useId)();
|
|
23
23
|
titleId = title ? (_titleId ? _titleId : "title-" + titleId) : undefined;
|
|
24
24
|
return (react_1.default.createElement("svg", Object.assign({ width: "56", height: "85", viewBox: "0 0 56 85", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-label": "NAV veileder illustrasjon", focusable: false, role: "img", "aria-labelledby": titleId }, props),
|
|
25
25
|
title ? react_1.default.createElement("title", { id: titleId }, title) : null,
|
|
@@ -41,7 +41,8 @@ exports.HelpText = void 0;
|
|
|
41
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
42
42
|
const react_1 = __importStar(require("react"));
|
|
43
43
|
const popover_1 = require("../popover");
|
|
44
|
-
const
|
|
44
|
+
const composeEventHandlers_1 = require("../util/composeEventHandlers");
|
|
45
|
+
const useMergeRefs_1 = require("../util/hooks/useMergeRefs");
|
|
45
46
|
const HelpTextIcon_1 = require("./HelpTextIcon");
|
|
46
47
|
/**
|
|
47
48
|
* A component that displays a help text button with a popover.
|
|
@@ -57,15 +58,12 @@ const HelpTextIcon_1 = require("./HelpTextIcon");
|
|
|
57
58
|
* ```
|
|
58
59
|
*/
|
|
59
60
|
exports.HelpText = (0, react_1.forwardRef)((_a, ref) => {
|
|
60
|
-
var { className, children, placement
|
|
61
|
+
var { className, children, placement, strategy = "absolute", title = "hjelp", onClick, wrapperClassName } = _a, rest = __rest(_a, ["className", "children", "placement", "strategy", "title", "onClick", "wrapperClassName"]);
|
|
61
62
|
const buttonRef = (0, react_1.useRef)(null);
|
|
62
|
-
const mergedRef = (0,
|
|
63
|
+
const mergedRef = (0, useMergeRefs_1.useMergeRefs)(buttonRef, ref);
|
|
63
64
|
const [open, setOpen] = (0, react_1.useState)(false);
|
|
64
65
|
return (react_1.default.createElement("div", { className: (0, clsx_1.default)("navds-help-text", wrapperClassName) },
|
|
65
|
-
react_1.default.createElement("button", Object.assign({}, rest, { ref: mergedRef, onClick: (
|
|
66
|
-
setOpen((x) => !x);
|
|
67
|
-
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
68
|
-
}, className: (0, clsx_1.default)(className, "navds-help-text__button"), type: "button", "aria-expanded": open }),
|
|
66
|
+
react_1.default.createElement("button", Object.assign({}, rest, { ref: mergedRef, onClick: (0, composeEventHandlers_1.composeEventHandlers)(onClick, () => setOpen((x) => x)), className: (0, clsx_1.default)(className, "navds-help-text__button"), type: "button", "aria-expanded": open }),
|
|
69
67
|
react_1.default.createElement(HelpTextIcon_1.HelpTextIcon, { title: title }),
|
|
70
68
|
react_1.default.createElement(HelpTextIcon_1.HelpTextIcon, { filled: true, title: title })),
|
|
71
69
|
react_1.default.createElement(popover_1.Popover, { onClose: () => setOpen(false), className: "navds-help-text__popover", open: open, anchorEl: buttonRef.current, placement: placement, strategy: strategy, offset: 12 },
|
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.HelpTextIcon = void 0;
|
|
7
7
|
const clsx_1 = __importDefault(require("clsx"));
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
|
-
const
|
|
9
|
+
const hooks_1 = require("../util/hooks");
|
|
10
10
|
const HelpTextIcon = ({ title, filled = false, }) => {
|
|
11
|
-
let titleId = (0,
|
|
11
|
+
let titleId = (0, hooks_1.useId)();
|
|
12
12
|
titleId = title ? `title-${titleId}` : undefined;
|
|
13
13
|
return (react_1.default.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", focusable: false, role: "img", "aria-labelledby": titleId, className: (0, clsx_1.default)("navds-help-text__icon", {
|
|
14
14
|
"navds-help-text__icon--filled": filled,
|
|
@@ -38,8 +38,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.InternalHeaderButton = void 0;
|
|
41
|
-
const react_1 = __importStar(require("react"));
|
|
42
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
42
|
+
const react_1 = __importStar(require("react"));
|
|
43
43
|
exports.InternalHeaderButton = (0, react_1.forwardRef)((_a, ref) => {
|
|
44
44
|
var { as: Component = "button", className } = _a, rest = __rest(_a, ["as", "className"]);
|
|
45
45
|
return (react_1.default.createElement(Component, Object.assign({}, rest, { ref: ref, className: (0, clsx_1.default)("navds-internalheader__button", className) })));
|
|
@@ -38,8 +38,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.InternalHeaderTitle = void 0;
|
|
41
|
-
const react_1 = __importStar(require("react"));
|
|
42
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
42
|
+
const react_1 = __importStar(require("react"));
|
|
43
43
|
exports.InternalHeaderTitle = (0, react_1.forwardRef)((_a, ref) => {
|
|
44
44
|
var { as: Component = "a", children, className } = _a, rest = __rest(_a, ["as", "children", "className"]);
|
|
45
45
|
return (react_1.default.createElement(Component, Object.assign({}, rest, { ref: ref, size: "xsmall", className: (0, clsx_1.default)("navds-internalheader__title", "navds-body-short", className) }),
|
|
@@ -38,8 +38,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.InternalHeaderUser = void 0;
|
|
41
|
-
const react_1 = __importStar(require("react"));
|
|
42
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
42
|
+
const react_1 = __importStar(require("react"));
|
|
43
43
|
const typography_1 = require("../typography");
|
|
44
44
|
exports.InternalHeaderUser = (0, react_1.forwardRef)((_a, ref) => {
|
|
45
45
|
var { className, name, description } = _a, rest = __rest(_a, ["className", "name", "description"]);
|
|
@@ -38,9 +38,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.InternalHeaderUserButton = void 0;
|
|
41
|
-
const aksel_icons_1 = require("@navikt/aksel-icons");
|
|
42
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
43
42
|
const react_1 = __importStar(require("react"));
|
|
43
|
+
const aksel_icons_1 = require("@navikt/aksel-icons");
|
|
44
44
|
const typography_1 = require("../typography");
|
|
45
45
|
const InternalHeaderButton_1 = __importDefault(require("./InternalHeaderButton"));
|
|
46
46
|
exports.InternalHeaderUserButton = (0, react_1.forwardRef)((_a, ref) => {
|
|
@@ -40,8 +40,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
40
40
|
exports.Bleed = void 0;
|
|
41
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
42
42
|
const react_1 = __importStar(require("react"));
|
|
43
|
-
const css_1 = require("../utilities/css");
|
|
44
43
|
const Slot_1 = require("../../util/Slot");
|
|
44
|
+
const css_1 = require("../utilities/css");
|
|
45
45
|
/**
|
|
46
46
|
* Foundational Layout-primitive for generic encapsulation & styling.
|
|
47
47
|
*
|
|
@@ -38,8 +38,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.ContentContainer = void 0;
|
|
41
|
-
const react_1 = __importStar(require("react"));
|
|
42
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
42
|
+
const react_1 = __importStar(require("react"));
|
|
43
43
|
exports.ContentContainer = (0, react_1.forwardRef)((_a, ref) => {
|
|
44
44
|
var { className } = _a, rest = __rest(_a, ["className"]);
|
|
45
45
|
return (react_1.default.createElement("div", Object.assign({ ref: ref, className: (0, clsx_1.default)("navds-content-container", className) }, rest)));
|
package/cjs/layout/grid/HGrid.js
CHANGED
|
@@ -38,8 +38,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.HGrid = void 0;
|
|
41
|
-
const react_1 = __importStar(require("react"));
|
|
42
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
42
|
+
const react_1 = __importStar(require("react"));
|
|
43
43
|
const css_1 = require("../utilities/css");
|
|
44
44
|
/**
|
|
45
45
|
* Horizontal Grid Primitive with dynamic columns and gap based on breakpoints.
|
|
@@ -40,7 +40,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
40
40
|
exports.PageBlock = exports.widths = void 0;
|
|
41
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
42
42
|
const react_1 = __importStar(require("react"));
|
|
43
|
-
exports.widths = ["md", "lg", "xl", "2xl"];
|
|
43
|
+
exports.widths = ["text", "md", "lg", "xl", "2xl"];
|
|
44
44
|
/**
|
|
45
45
|
* Acts as a top-level container for defining max-width, gutters and horizontal centering
|
|
46
46
|
*
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.AvatarPanel = void 0;
|
|
7
|
-
const aksel_icons_1 = require("@navikt/aksel-icons");
|
|
8
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const aksel_icons_1 = require("@navikt/aksel-icons");
|
|
9
9
|
const box_1 = require("../box");
|
|
10
10
|
const stack_1 = require("../stack");
|
|
11
11
|
function AvatarPanel({ children }) {
|
|
@@ -4,17 +4,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Content = void 0;
|
|
7
|
-
const aksel_icons_1 = require("@navikt/aksel-icons");
|
|
8
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const aksel_icons_1 = require("@navikt/aksel-icons");
|
|
9
9
|
const accordion_1 = require("../../accordion");
|
|
10
10
|
const copybutton_1 = require("../../copybutton");
|
|
11
|
+
const link_1 = require("../../link");
|
|
12
|
+
const list_1 = require("../../list");
|
|
11
13
|
const read_more_1 = require("../../read-more");
|
|
12
14
|
const typography_1 = require("../../typography");
|
|
13
15
|
const box_1 = require("../box");
|
|
14
16
|
const stack_1 = require("../stack");
|
|
15
17
|
const AvatarPanel_1 = require("./AvatarPanel");
|
|
16
|
-
const list_1 = require("../../list");
|
|
17
|
-
const link_1 = require("../../link");
|
|
18
18
|
function Content() {
|
|
19
19
|
return (react_1.default.createElement(AvatarPanel_1.AvatarPanel, null,
|
|
20
20
|
react_1.default.createElement(box_1.Box, { paddingBlock: "0 6" },
|
|
@@ -25,11 +25,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.FilterCard = void 0;
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
|
+
const aksel_icons_1 = require("@navikt/aksel-icons");
|
|
28
29
|
const form_1 = require("../../form");
|
|
29
30
|
const typography_1 = require("../../typography");
|
|
30
31
|
const box_1 = require("../box");
|
|
31
32
|
const stack_1 = require("../stack");
|
|
32
|
-
const aksel_icons_1 = require("@navikt/aksel-icons");
|
|
33
33
|
function FilterCard() {
|
|
34
34
|
const [filter, setFilter] = (0, react_1.useState)([]);
|
|
35
35
|
return (react_1.default.createElement(box_1.Box, { background: "bg-default", padding: { xs: "4", md: "5" }, borderWidth: "5", borderColor: "border-alt-3", borderRadius: "medium" },
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.IntroCard = void 0;
|
|
7
|
-
const aksel_icons_1 = require("@navikt/aksel-icons");
|
|
8
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const aksel_icons_1 = require("@navikt/aksel-icons");
|
|
9
9
|
const copybutton_1 = require("../../copybutton");
|
|
10
10
|
const typography_1 = require("../../typography");
|
|
11
11
|
const box_1 = require("../box");
|
|
@@ -38,12 +38,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.LinkPanelComponent = void 0;
|
|
41
|
-
const react_1 = __importStar(require("react"));
|
|
42
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
43
|
-
const
|
|
44
|
-
const LinkPanelDescription_1 = require("./LinkPanelDescription");
|
|
42
|
+
const react_1 = __importStar(require("react"));
|
|
45
43
|
const aksel_icons_1 = require("@navikt/aksel-icons");
|
|
46
44
|
const panel_1 = require("../panel");
|
|
45
|
+
const LinkPanelDescription_1 = require("./LinkPanelDescription");
|
|
46
|
+
const LinkPanelTitle_1 = require("./LinkPanelTitle");
|
|
47
47
|
/**
|
|
48
48
|
* A component that displays a link panel.
|
|
49
49
|
*
|
|
@@ -38,8 +38,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.LinkPanelDescription = void 0;
|
|
41
|
-
const react_1 = __importStar(require("react"));
|
|
42
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
42
|
+
const react_1 = __importStar(require("react"));
|
|
43
43
|
const typography_1 = require("../typography");
|
|
44
44
|
exports.LinkPanelDescription = (0, react_1.forwardRef)((_a, ref) => {
|
|
45
45
|
var { className } = _a, rest = __rest(_a, ["className"]);
|
|
@@ -38,8 +38,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.LinkPanelTitle = void 0;
|
|
41
|
-
const react_1 = __importStar(require("react"));
|
|
42
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
42
|
+
const react_1 = __importStar(require("react"));
|
|
43
43
|
exports.LinkPanelTitle = (0, react_1.forwardRef)((_a, ref) => {
|
|
44
44
|
var { className, as: Component = "div" } = _a, rest = __rest(_a, ["className", "as"]);
|
|
45
45
|
return (react_1.default.createElement(Component, Object.assign({}, rest, { ref: ref, className: (0, clsx_1.default)("navds-link-panel__title", "navds-heading", "navds-heading--medium", className) })));
|
package/cjs/list/List.js
CHANGED
|
@@ -41,13 +41,13 @@ exports.List = void 0;
|
|
|
41
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
42
42
|
const react_1 = __importStar(require("react"));
|
|
43
43
|
const typography_1 = require("../typography");
|
|
44
|
-
const
|
|
44
|
+
const hooks_1 = require("../util/hooks");
|
|
45
45
|
const ListItem_1 = require("./ListItem");
|
|
46
46
|
const context_1 = require("./context");
|
|
47
47
|
exports.List = (0, react_1.forwardRef)((_a, ref) => {
|
|
48
48
|
var _b;
|
|
49
49
|
var { children, className, as: ListTag = "ul", title, description, headingTag = "h3", size } = _a, rest = __rest(_a, ["children", "className", "as", "title", "description", "headingTag", "size"]);
|
|
50
|
-
const ariaId = (0,
|
|
50
|
+
const ariaId = (0, hooks_1.useId)();
|
|
51
51
|
const { isNested, size: _size } = (0, react_1.useContext)(context_1.ListContext);
|
|
52
52
|
const listSize = (_b = size !== null && size !== void 0 ? size : _size) !== null && _b !== void 0 ? _b : "medium";
|
|
53
53
|
return (react_1.default.createElement(context_1.ListContext.Provider, { value: {
|