@navikt/ds-react 5.12.5 → 5.13.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 +79 -3
- package/cjs/accordion/Accordion.js +2 -2
- package/cjs/accordion/AccordionHeader.js +1 -1
- package/cjs/accordion/AccordionItem.js +11 -14
- package/cjs/alert/Alert.js +2 -2
- 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 +1 -1
- package/cjs/copybutton/CopyButton.js +2 -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/monthpicker/MonthCaption.js +1 -1
- package/cjs/date/parts/DateInput.js +1 -1
- 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/expansion-card/ExpansionCardHeader.js +1 -1
- package/cjs/form/ReadOnlyIcon.js +1 -1
- package/cjs/form/Select.js +1 -1
- package/cjs/form/combobox/Combobox.js +6 -6
- package/cjs/form/combobox/ComboboxProvider.js +2 -2
- package/cjs/form/combobox/FilteredOptions/FilteredOptions.js +4 -4
- package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.js +4 -4
- package/cjs/form/combobox/SelectedOptions/SelectedOptions.js +1 -1
- package/cjs/form/error-summary/ErrorSummary.js +2 -2
- package/cjs/form/error-summary/ErrorSummaryItem.js +1 -1
- package/cjs/form/search/Search.js +1 -1
- package/cjs/form/search/SearchButton.js +1 -1
- package/cjs/grid/Cell.js +1 -1
- package/cjs/grid/Grid.js +1 -1
- package/cjs/guide-panel/GuidePanel.js +1 -1
- 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/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/PopoverContent.js +1 -1
- package/cjs/read-more/ReadMore.js +12 -10
- package/cjs/skeleton/Skeleton.js +1 -1
- package/cjs/table/Body.js +1 -1
- package/cjs/table/ColumnHeader.js +1 -1
- package/cjs/table/DataCell.js +1 -1
- package/cjs/table/ExpandableRow.js +14 -13
- package/cjs/table/Header.js +1 -1
- package/cjs/table/Row.js +1 -1
- package/cjs/tabs/TabList.js +1 -1
- package/cjs/tabs/Tabs.js +1 -1
- package/cjs/tag/Tag.js +1 -1
- package/cjs/timeline/AxisLabels.js +1 -1
- package/cjs/timeline/TimelineRow.js +2 -2
- package/cjs/timeline/hooks/useTimelineRows.js +5 -3
- package/cjs/timeline/utils/timeline.js +1 -1
- package/cjs/timeline/zoom/ZoomButton.js +1 -1
- package/cjs/toggle-group/ToggleGroup.js +1 -1
- package/cjs/tooltip/Tooltip.js +12 -7
- package/cjs/typography/BodyLong.js +1 -1
- package/cjs/typography/ErrorMessage.js +1 -1
- package/cjs/typography/Ingress.js +1 -1
- package/cjs/util/RandomIcon.js +1 -1
- package/cjs/util/hooks/useCallbackRef.js +18 -0
- package/cjs/util/hooks/useControllableState.js +25 -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 +1 -1
- 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/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 +1 -1
- package/esm/chips/Removable.js.map +1 -1
- package/esm/copybutton/CopyButton.js +2 -2
- package/esm/copybutton/CopyButton.js.map +1 -1
- package/esm/date/context/useSharedMonthContext.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/monthpicker/MonthCaption.js +1 -1
- package/esm/date/monthpicker/MonthCaption.js.map +1 -1
- package/esm/date/parts/DateInput.js +1 -1
- package/esm/date/parts/DateInput.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/expansion-card/ExpansionCardHeader.js +1 -1
- package/esm/expansion-card/ExpansionCardHeader.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/checkbox/useCheckbox.d.ts +1 -1
- package/esm/form/combobox/Combobox.d.ts +1 -1
- package/esm/form/combobox/Combobox.js +6 -6
- 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 +4 -4
- package/esm/form/combobox/FilteredOptions/filteredOptionsContext.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/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.js +1 -1
- package/esm/form/error-summary/ErrorSummaryItem.js.map +1 -1
- package/esm/form/radio/useRadio.d.ts +1 -1
- package/esm/form/search/Search.js +1 -1
- package/esm/form/search/Search.js.map +1 -1
- package/esm/form/search/SearchButton.js +1 -1
- package/esm/form/search/SearchButton.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/internal-header/InternalHeader.js.map +1 -1
- package/esm/internal-header/InternalHeaderButton.js +1 -1
- package/esm/internal-header/InternalHeaderButton.js.map +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.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 +1 -1
- 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 +6 -5
- 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.js.map +1 -1
- package/esm/layout/stack/Stack.js.map +1 -1
- package/esm/layout/stack/VStack.js.map +1 -1
- package/esm/layout/utilities/types.d.ts +2 -2
- 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.js +1 -1
- package/esm/link-panel/LinkPanelTitle.js.map +1 -1
- package/esm/loader/Loader.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/pagination/Pagination.js.map +1 -1
- package/esm/pagination/PaginationItem.js +1 -1
- package/esm/pagination/PaginationItem.js.map +1 -1
- package/esm/panel/Panel.js +1 -1
- package/esm/panel/Panel.js.map +1 -1
- 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 -11
- 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/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.js +1 -1
- package/esm/table/DataCell.js.map +1 -1
- package/esm/table/ExpandableRow.js +15 -14
- 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/Row.js +1 -1
- package/esm/table/Row.js.map +1 -1
- package/esm/tabs/TabList.js +1 -1
- package/esm/tabs/TabList.js.map +1 -1
- package/esm/tabs/Tabs.js +1 -1
- package/esm/tabs/Tabs.js.map +1 -1
- package/esm/tag/Tag.js +1 -1
- 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/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/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 +1 -1
- package/esm/toggle-group/ToggleGroup.js.map +1 -1
- package/esm/tooltip/Tooltip.d.ts +4 -0
- package/esm/tooltip/Tooltip.js +13 -8
- package/esm/tooltip/Tooltip.js.map +1 -1
- package/esm/typography/BodyLong.js +1 -1
- package/esm/typography/BodyLong.js.map +1 -1
- package/esm/typography/ErrorMessage.js +1 -1
- package/esm/typography/ErrorMessage.js.map +1 -1
- package/esm/typography/Ingress.js +1 -1
- package/esm/typography/Ingress.js.map +1 -1
- package/esm/util/RandomIcon.js +1 -1
- package/esm/util/RandomIcon.js.map +1 -1
- 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/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/mergeRefs.js.map +1 -1
- package/package.json +3 -3
- package/src/accordion/Accordion.tsx +5 -5
- package/src/accordion/AccordionContent.tsx +3 -3
- package/src/accordion/AccordionHeader.tsx +3 -3
- package/src/accordion/AccordionItem.tsx +21 -21
- package/src/accordion/accordion.stories.tsx +8 -5
- package/src/alert/Alert.tsx +8 -8
- package/src/alert/alert.stories.tsx +7 -7
- package/src/button/Button.tsx +4 -4
- 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 +4 -4
- package/src/chips/Toggle.tsx +3 -3
- package/src/chips/chips.stories.tsx +5 -5
- package/src/copybutton/CopyButton.tsx +6 -6
- package/src/copybutton/copy-button.stories.tsx +3 -3
- package/src/date/context/useSharedMonthContext.tsx +1 -1
- package/src/date/datepicker/DatePicker.tsx +2 -2
- 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/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 +3 -3
- 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/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 +1 -1
- package/src/dropdown/Menu/GroupedList/index.tsx +1 -1
- package/src/dropdown/Menu/List/Item.tsx +1 -1
- package/src/dropdown/Menu/index.tsx +1 -1
- package/src/dropdown/dropdown.stories.tsx +1 -1
- package/src/expansion-card/ExpansionCard.tsx +3 -3
- 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 +2 -2
- package/src/expansion-card/expansion-card.stories.tsx +1 -1
- package/src/form/ConfirmationPanel.test.tsx +1 -1
- package/src/form/ConfirmationPanel.tsx +2 -2
- 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 +4 -4
- package/src/form/checkbox/Checkbox.test.tsx +8 -8
- package/src/form/checkbox/Checkbox.tsx +3 -3
- package/src/form/checkbox/CheckboxGroup.tsx +4 -4
- package/src/form/checkbox/useCheckbox.ts +3 -3
- package/src/form/combobox/Combobox.tsx +8 -8
- 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 +18 -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 +6 -6
- package/src/form/combobox/SelectedOptions/SelectedOptions.tsx +1 -1
- package/src/form/combobox/SelectedOptions/selectedOptionsContext.tsx +9 -9
- package/src/form/combobox/ToggleListButton.tsx +1 -2
- package/src/form/combobox/combobox.stories.tsx +8 -8
- 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 +2 -2
- 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 +1 -1
- package/src/form/radio/RadioGroup.tsx +3 -3
- package/src/form/radio/useRadio.ts +1 -1
- package/src/form/search/Search.tsx +6 -6
- package/src/form/search/SearchButton.tsx +2 -2
- 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 +3 -3
- 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/guidepanel.stories.tsx +1 -1
- package/src/help-text/HelpText.tsx +2 -2
- package/src/internal-header/InternalHeader.tsx +1 -1
- package/src/internal-header/InternalHeaderButton.tsx +1 -1
- package/src/internal-header/InternalHeaderTitle.tsx +1 -1
- package/src/internal-header/InternalHeaderUser.tsx +1 -1
- package/src/internal-header/InternalHeaderUserButton.tsx +1 -1
- 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 +7 -7
- 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 +8 -7
- 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 +1 -1
- package/src/layout/stack/Stack.tsx +3 -3
- package/src/layout/stack/VStack.tsx +1 -1
- 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 +2 -2
- package/src/link/link.stories.tsx +1 -1
- package/src/link-panel/LinkPanel.tsx +6 -7
- package/src/link-panel/LinkPanelDescription.tsx +1 -1
- package/src/link-panel/LinkPanelTitle.tsx +2 -2
- package/src/list/List.tsx +2 -2
- package/src/list/ListItem.tsx +2 -2
- package/src/list/list.stories.tsx +2 -2
- package/src/loader/Loader.tsx +4 -4
- package/src/loader/loader.stories.tsx +1 -0
- package/src/modal/Modal.test.tsx +4 -4
- package/src/modal/Modal.tsx +2 -2
- 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/pagination/Pagination.tsx +5 -6
- package/src/pagination/PaginationItem.tsx +3 -3
- package/src/pagination/steps.test.ts +8 -8
- package/src/panel/Panel.tsx +3 -3
- package/src/panel/panel.stories.tsx +2 -1
- package/src/popover/Popover.test.tsx +7 -7
- package/src/popover/Popover.tsx +8 -8
- package/src/popover/PopoverContent.tsx +2 -2
- package/src/provider/Provider.tsx +1 -1
- package/src/read-more/ReadMore.tsx +19 -13
- package/src/read-more/readmore.stories.tsx +4 -0
- package/src/skeleton/Skeleton.tsx +4 -4
- package/src/stepper/Step.tsx +2 -2
- package/src/stepper/Stepper.tsx +3 -3
- package/src/table/Body.tsx +1 -1
- package/src/table/ColumnHeader.tsx +2 -2
- package/src/table/DataCell.tsx +2 -2
- package/src/table/ExpandableRow.tsx +19 -17
- package/src/table/Header.tsx +1 -1
- package/src/table/HeaderCell.tsx +1 -1
- 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 +1 -1
- package/src/tabs/Tab.tsx +3 -3
- package/src/tabs/TabList.tsx +4 -4
- package/src/tabs/TabPanel.tsx +1 -1
- package/src/tabs/Tabs.stories.tsx +1 -1
- package/src/tabs/Tabs.tsx +4 -4
- package/src/tag/Tag.tsx +3 -3
- package/src/tag/tag.stories.tsx +1 -1
- package/src/timeline/AxisLabels.tsx +9 -9
- package/src/timeline/Pin.tsx +2 -2
- 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 +4 -4
- 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 +5 -5
- 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 +20 -11
- package/src/tooltip/tooltip.stories.tsx +1 -1
- package/src/typography/BodyLong.tsx +4 -4
- package/src/typography/BodyShort.tsx +3 -3
- package/src/typography/Detail.tsx +3 -3
- package/src/typography/ErrorMessage.tsx +3 -3
- package/src/typography/Heading.tsx +3 -3
- package/src/typography/Ingress.tsx +1 -1
- package/src/typography/Label.tsx +3 -3
- package/src/typography/stories/heading.stories.tsx +1 -2
- package/src/util/AnimateHeight.tsx +1 -1
- package/src/util/OverridableComponent.ts +1 -1
- package/src/util/RandomIcon.tsx +1 -1
- package/src/util/Slot.tsx +3 -3
- package/src/util/TextareaAutoSize.tsx +4 -4
- package/src/util/__tests__/Slot.test.tsx +11 -11
- package/src/util/hooks/useCallbackRef.ts +20 -0
- package/src/util/hooks/useControllableState.ts +40 -0
- package/src/util/mergeRefs.tsx +2 -1
- package/src/util/omit.ts +1 -1
- package/src/util/useEventListener.ts +1 -1
- package/src/util/useMedia.ts +1 -1
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { render, screen } from "@testing-library/react";
|
|
3
3
|
import userEvent from "@testing-library/user-event";
|
|
4
4
|
import React, { useId } from "react";
|
|
5
|
-
import { UNSAFE_Combobox } from "..";
|
|
6
5
|
import { act } from "react-dom/test-utils";
|
|
6
|
+
import { UNSAFE_Combobox } from "..";
|
|
7
7
|
|
|
8
8
|
const options = [
|
|
9
9
|
"banana",
|
|
@@ -42,7 +42,9 @@ describe("Render combobox", () => {
|
|
|
42
42
|
|
|
43
43
|
await act(async () => {
|
|
44
44
|
await userEvent.click(
|
|
45
|
-
screen.getByRole("combobox", {
|
|
45
|
+
screen.getByRole("combobox", {
|
|
46
|
+
name: "Hva er dine favorittfrukter?",
|
|
47
|
+
}),
|
|
46
48
|
);
|
|
47
49
|
});
|
|
48
50
|
await act(async () => {
|
|
@@ -50,20 +52,20 @@ describe("Render combobox", () => {
|
|
|
50
52
|
screen.getByRole("combobox", {
|
|
51
53
|
name: "Hva er dine favorittfrukter?",
|
|
52
54
|
}),
|
|
53
|
-
"apple"
|
|
55
|
+
"apple",
|
|
54
56
|
);
|
|
55
57
|
});
|
|
56
58
|
await act(async () => {
|
|
57
59
|
await userEvent.click(
|
|
58
|
-
await screen.findByRole("option", { name: "apple" })
|
|
60
|
+
await screen.findByRole("option", { name: "apple" }),
|
|
59
61
|
);
|
|
60
62
|
});
|
|
61
63
|
expect(
|
|
62
|
-
await screen.findByRole("option", { name: "apple", selected: true })
|
|
64
|
+
await screen.findByRole("option", { name: "apple", selected: true }),
|
|
63
65
|
).toBeInTheDocument();
|
|
64
66
|
await act(async () => {
|
|
65
67
|
await userEvent.click(
|
|
66
|
-
await screen.findByRole("button", { name: "apple slett" })
|
|
68
|
+
await screen.findByRole("button", { name: "apple slett" }),
|
|
67
69
|
);
|
|
68
70
|
});
|
|
69
71
|
});
|
|
@@ -73,7 +75,7 @@ describe("Render combobox", () => {
|
|
|
73
75
|
render(<App options={[]} isListOpen isLoading />);
|
|
74
76
|
|
|
75
77
|
expect(
|
|
76
|
-
await screen.findByRole("option", { name: "venter..." })
|
|
78
|
+
await screen.findByRole("option", { name: "venter..." }),
|
|
77
79
|
).toBeInTheDocument();
|
|
78
80
|
});
|
|
79
81
|
});
|
|
@@ -84,13 +86,13 @@ describe("Combobox state-handling", () => {
|
|
|
84
86
|
|
|
85
87
|
await act(async () => {
|
|
86
88
|
await userEvent.click(
|
|
87
|
-
screen.getByRole("combobox", { name: "Hva er dine favorittfrukter?" })
|
|
89
|
+
screen.getByRole("combobox", { name: "Hva er dine favorittfrukter?" }),
|
|
88
90
|
);
|
|
89
91
|
});
|
|
90
92
|
await act(async () => {
|
|
91
93
|
await userEvent.type(
|
|
92
94
|
screen.getByRole("combobox", { name: "Hva er dine favorittfrukter?" }),
|
|
93
|
-
"ban"
|
|
95
|
+
"ban",
|
|
94
96
|
);
|
|
95
97
|
await userEvent.keyboard("{ArrowDown}");
|
|
96
98
|
await userEvent.keyboard("{ArrowUp}");
|
|
@@ -105,13 +107,13 @@ describe("Combobox state-handling", () => {
|
|
|
105
107
|
|
|
106
108
|
await act(async () => {
|
|
107
109
|
await userEvent.click(
|
|
108
|
-
screen.getByRole("combobox", { name: "Hva er dine favorittfrukter?" })
|
|
110
|
+
screen.getByRole("combobox", { name: "Hva er dine favorittfrukter?" }),
|
|
109
111
|
);
|
|
110
112
|
});
|
|
111
113
|
await act(async () => {
|
|
112
114
|
await userEvent.type(
|
|
113
115
|
screen.getByRole("combobox", { name: "Hva er dine favorittfrukter?" }),
|
|
114
|
-
"apple"
|
|
116
|
+
"apple",
|
|
115
117
|
);
|
|
116
118
|
await userEvent.keyboard("{ArrowDown}");
|
|
117
119
|
await userEvent.keyboard("{Escape}");
|
|
@@ -119,7 +121,7 @@ describe("Combobox state-handling", () => {
|
|
|
119
121
|
});
|
|
120
122
|
|
|
121
123
|
expect(
|
|
122
|
-
await screen.findByRole("option", { name: "banana" })
|
|
124
|
+
await screen.findByRole("option", { name: "banana" }),
|
|
123
125
|
).toBeInTheDocument();
|
|
124
126
|
});
|
|
125
127
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { createContext, useCallback, useContext, useState } from "react";
|
|
2
2
|
import { useInputContext } from "./Input/inputContext";
|
|
3
3
|
|
|
4
4
|
type CustomOptionsContextType = {
|
|
@@ -9,7 +9,7 @@ type CustomOptionsContextType = {
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
const CustomOptionsContext = createContext<CustomOptionsContextType>(
|
|
12
|
-
{} as CustomOptionsContextType
|
|
12
|
+
{} as CustomOptionsContextType,
|
|
13
13
|
);
|
|
14
14
|
|
|
15
15
|
export const CustomOptionsProvider = ({
|
|
@@ -26,11 +26,11 @@ export const CustomOptionsProvider = ({
|
|
|
26
26
|
const removeCustomOption = useCallback(
|
|
27
27
|
(option: string) => {
|
|
28
28
|
setCustomOptions((prevCustomOptions) =>
|
|
29
|
-
prevCustomOptions.filter((o) => o !== option)
|
|
29
|
+
prevCustomOptions.filter((o) => o !== option),
|
|
30
30
|
);
|
|
31
31
|
focusInput();
|
|
32
32
|
},
|
|
33
|
-
[focusInput, setCustomOptions]
|
|
33
|
+
[focusInput, setCustomOptions],
|
|
34
34
|
);
|
|
35
35
|
|
|
36
36
|
const addCustomOption = useCallback(
|
|
@@ -42,7 +42,7 @@ export const CustomOptionsProvider = ({
|
|
|
42
42
|
}
|
|
43
43
|
focusInput();
|
|
44
44
|
},
|
|
45
|
-
[focusInput, isMultiSelect, setCustomOptions]
|
|
45
|
+
[focusInput, isMultiSelect, setCustomOptions],
|
|
46
46
|
);
|
|
47
47
|
|
|
48
48
|
const customOptionsState = {
|
|
@@ -63,7 +63,7 @@ export const useCustomOptionsContext = () => {
|
|
|
63
63
|
const context = useContext(CustomOptionsContext);
|
|
64
64
|
if (!context) {
|
|
65
65
|
throw new Error(
|
|
66
|
-
"useCustomOptionsContext must be used within a CustomOptionsProvider"
|
|
66
|
+
"useCustomOptionsContext must be used within a CustomOptionsProvider",
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
69
|
return context;
|
|
@@ -68,7 +68,7 @@ export interface ComboboxProps
|
|
|
68
68
|
*/
|
|
69
69
|
onChange?: (
|
|
70
70
|
event: ChangeEvent<HTMLInputElement> | null,
|
|
71
|
-
value?: string
|
|
71
|
+
value?: string,
|
|
72
72
|
) => void;
|
|
73
73
|
/**
|
|
74
74
|
* Callback function triggered whenever the input field is cleared
|
|
@@ -88,7 +88,7 @@ export interface ComboboxProps
|
|
|
88
88
|
onToggleSelected?: (
|
|
89
89
|
option: string,
|
|
90
90
|
isSelected: boolean,
|
|
91
|
-
isCustomOption: boolean
|
|
91
|
+
isCustomOption: boolean,
|
|
92
92
|
) => void;
|
|
93
93
|
/**
|
|
94
94
|
* List of selected options.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React, { forwardRef, HTMLAttributes, isValidElement } from "react";
|
|
2
1
|
import cl from "clsx";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
2
|
+
import React, { HTMLAttributes, forwardRef, isValidElement } from "react";
|
|
3
|
+
import { BodyShort, Heading } from "../../typography";
|
|
5
4
|
import { useId } from "../../util";
|
|
5
|
+
import ErrorSummaryItem, { ErrorSummaryItemType } from "./ErrorSummaryItem";
|
|
6
6
|
|
|
7
7
|
export interface ErrorSummaryProps extends HTMLAttributes<HTMLDivElement> {
|
|
8
8
|
/**
|
|
@@ -72,7 +72,7 @@ export const ErrorSummary = forwardRef<HTMLDivElement, ErrorSummaryProps>(
|
|
|
72
72
|
heading,
|
|
73
73
|
...rest
|
|
74
74
|
},
|
|
75
|
-
ref
|
|
75
|
+
ref,
|
|
76
76
|
) => {
|
|
77
77
|
const headingId = useId();
|
|
78
78
|
|
|
@@ -83,7 +83,7 @@ export const ErrorSummary = forwardRef<HTMLDivElement, ErrorSummaryProps>(
|
|
|
83
83
|
className={cl(
|
|
84
84
|
className,
|
|
85
85
|
"navds-error-summary",
|
|
86
|
-
`navds-error-summary--${size}
|
|
86
|
+
`navds-error-summary--${size}`,
|
|
87
87
|
)}
|
|
88
88
|
tabIndex={-1}
|
|
89
89
|
aria-live="polite"
|
|
@@ -108,7 +108,7 @@ export const ErrorSummary = forwardRef<HTMLDivElement, ErrorSummaryProps>(
|
|
|
108
108
|
</BodyShort>
|
|
109
109
|
</section>
|
|
110
110
|
);
|
|
111
|
-
}
|
|
111
|
+
},
|
|
112
112
|
) as ErrorSummaryComponent;
|
|
113
113
|
|
|
114
114
|
ErrorSummary.Item = ErrorSummaryItem;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { forwardRef } from "react";
|
|
2
1
|
import cl from "clsx";
|
|
2
|
+
import React, { forwardRef } from "react";
|
|
3
3
|
import { OverridableComponent } from "../../util";
|
|
4
4
|
|
|
5
5
|
export interface ErrorSummaryItemProps
|
|
@@ -30,7 +30,7 @@ export const ErrorSummaryItem: ErrorSummaryItemType = forwardRef(
|
|
|
30
30
|
{children}
|
|
31
31
|
</Component>
|
|
32
32
|
);
|
|
33
|
-
}
|
|
33
|
+
},
|
|
34
34
|
);
|
|
35
35
|
|
|
36
36
|
export default ErrorSummaryItem;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { render, screen } from "@testing-library/react";
|
|
3
2
|
import userEvent from "@testing-library/user-event";
|
|
4
3
|
import faker from "faker";
|
|
4
|
+
import React from "react";
|
|
5
5
|
import { Radio, RadioGroup } from ".";
|
|
6
6
|
|
|
7
7
|
const value1 = faker.datatype.string();
|
package/src/form/radio/Radio.tsx
CHANGED
|
@@ -68,7 +68,7 @@ export const RadioGroup = forwardRef<HTMLFieldSetElement, RadioGroupProps>(
|
|
|
68
68
|
readOnly,
|
|
69
69
|
...rest
|
|
70
70
|
},
|
|
71
|
-
ref
|
|
71
|
+
ref,
|
|
72
72
|
) => {
|
|
73
73
|
const fieldset = useContext(FieldsetContext);
|
|
74
74
|
|
|
@@ -82,7 +82,7 @@ export const RadioGroup = forwardRef<HTMLFieldSetElement, RadioGroupProps>(
|
|
|
82
82
|
className={cl(
|
|
83
83
|
className,
|
|
84
84
|
"navds-radio-group",
|
|
85
|
-
`navds-radio-group--${rest.size ?? fieldset?.size ?? "medium"}
|
|
85
|
+
`navds-radio-group--${rest.size ?? fieldset?.size ?? "medium"}`,
|
|
86
86
|
)}
|
|
87
87
|
nativeReadOnly={false}
|
|
88
88
|
>
|
|
@@ -99,7 +99,7 @@ export const RadioGroup = forwardRef<HTMLFieldSetElement, RadioGroupProps>(
|
|
|
99
99
|
</RadioGroupContext.Provider>
|
|
100
100
|
</Fieldset>
|
|
101
101
|
);
|
|
102
|
-
}
|
|
102
|
+
},
|
|
103
103
|
);
|
|
104
104
|
|
|
105
105
|
export default RadioGroup;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { MagnifyingGlassIcon, XMarkIcon } from "@navikt/aksel-icons";
|
|
2
1
|
import cl from "clsx";
|
|
3
2
|
import React, {
|
|
4
3
|
InputHTMLAttributes,
|
|
@@ -8,6 +7,7 @@ import React, {
|
|
|
8
7
|
useRef,
|
|
9
8
|
useState,
|
|
10
9
|
} from "react";
|
|
10
|
+
import { MagnifyingGlassIcon, XMarkIcon } from "@navikt/aksel-icons";
|
|
11
11
|
import { BodyShort, ErrorMessage, Label } from "../../typography";
|
|
12
12
|
import { mergeRefs, omit } from "../../util";
|
|
13
13
|
import { FormFieldProps, useFormField } from "../useFormField";
|
|
@@ -127,7 +127,7 @@ export const Search = forwardRef<HTMLInputElement, SearchProps>(
|
|
|
127
127
|
value === undefined && setInternalValue(v);
|
|
128
128
|
onChange?.(v);
|
|
129
129
|
},
|
|
130
|
-
[onChange, value]
|
|
130
|
+
[onChange, value],
|
|
131
131
|
);
|
|
132
132
|
|
|
133
133
|
const handleClear = useCallback(
|
|
@@ -136,7 +136,7 @@ export const Search = forwardRef<HTMLInputElement, SearchProps>(
|
|
|
136
136
|
handleChange("");
|
|
137
137
|
searchRef.current && searchRef.current?.focus?.();
|
|
138
138
|
},
|
|
139
|
-
[handleChange, onClear]
|
|
139
|
+
[handleChange, onClear],
|
|
140
140
|
);
|
|
141
141
|
|
|
142
142
|
const handleClick = () => {
|
|
@@ -166,7 +166,7 @@ export const Search = forwardRef<HTMLInputElement, SearchProps>(
|
|
|
166
166
|
"navds-search--error": hasError,
|
|
167
167
|
"navds-search--disabled": !!inputProps.disabled,
|
|
168
168
|
"navds-search--with-size": !!htmlSize,
|
|
169
|
-
}
|
|
169
|
+
},
|
|
170
170
|
)}
|
|
171
171
|
>
|
|
172
172
|
<Label
|
|
@@ -212,7 +212,7 @@ export const Search = forwardRef<HTMLInputElement, SearchProps>(
|
|
|
212
212
|
`navds-search__input--${variant}`,
|
|
213
213
|
"navds-text-field__input",
|
|
214
214
|
"navds-body-short",
|
|
215
|
-
`navds-body-short--${size}
|
|
215
|
+
`navds-body-short--${size}`,
|
|
216
216
|
)}
|
|
217
217
|
{...(htmlSize ? { size: Number(htmlSize) } : {})}
|
|
218
218
|
/>
|
|
@@ -252,7 +252,7 @@ export const Search = forwardRef<HTMLInputElement, SearchProps>(
|
|
|
252
252
|
</div>
|
|
253
253
|
</div>
|
|
254
254
|
);
|
|
255
|
-
}
|
|
255
|
+
},
|
|
256
256
|
) as SearchComponent;
|
|
257
257
|
|
|
258
258
|
Search.Button = SearchButton;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MagnifyingGlassIcon } from "@navikt/aksel-icons";
|
|
2
1
|
import cl from "clsx";
|
|
3
2
|
import React, { forwardRef, useContext } from "react";
|
|
3
|
+
import { MagnifyingGlassIcon } from "@navikt/aksel-icons";
|
|
4
4
|
import { Button, ButtonProps } from "../../button";
|
|
5
5
|
import { SearchContext } from "./context";
|
|
6
6
|
|
|
@@ -49,7 +49,7 @@ const SearchButton: SearchButtonType = forwardRef(
|
|
|
49
49
|
{children}
|
|
50
50
|
</Button>
|
|
51
51
|
);
|
|
52
|
-
}
|
|
52
|
+
},
|
|
53
53
|
);
|
|
54
54
|
|
|
55
55
|
export default SearchButton;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Fieldset } from "../index";
|
|
3
1
|
import { Meta } from "@storybook/react";
|
|
2
|
+
import React from "react";
|
|
4
3
|
import { TextField } from "../../index";
|
|
4
|
+
import { Fieldset } from "../index";
|
|
5
|
+
|
|
5
6
|
export default {
|
|
6
7
|
title: "ds-react/Fieldset",
|
|
7
8
|
component: Fieldset,
|
package/src/form/useFormField.ts
CHANGED
|
@@ -55,7 +55,7 @@ export interface FormFieldType {
|
|
|
55
55
|
*/
|
|
56
56
|
export const useFormField = (
|
|
57
57
|
props: FormFieldProps,
|
|
58
|
-
prefix: string
|
|
58
|
+
prefix: string,
|
|
59
59
|
): FormFieldType => {
|
|
60
60
|
const { size, error, errorId: propErrorId } = props;
|
|
61
61
|
|
|
@@ -80,10 +80,10 @@ export const useFormField = (
|
|
|
80
80
|
|
|
81
81
|
if ((props as any)?.required && process.env.NODE_ENV !== "production") {
|
|
82
82
|
console.warn(
|
|
83
|
-
"Aksel: Use of 'required' in form-elements is heavily discuouraged. Docs about why here:"
|
|
83
|
+
"Aksel: Use of 'required' in form-elements is heavily discuouraged. Docs about why here:",
|
|
84
84
|
);
|
|
85
85
|
console.warn(
|
|
86
|
-
"https://aksel.nav.no/god-praksis/artikler/obligatoriske-og-valgfrie-skjemafelter#h3bfe00453471"
|
|
86
|
+
"https://aksel.nav.no/god-praksis/artikler/obligatoriske-og-valgfrie-skjemafelter#h3bfe00453471",
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
89
|
|
package/src/grid/Cell.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { forwardRef, HTMLAttributes } from "react";
|
|
2
1
|
import cl from "clsx";
|
|
2
|
+
import React, { HTMLAttributes, forwardRef } from "react";
|
|
3
3
|
|
|
4
4
|
type Column = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
5
5
|
export interface CellProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -41,13 +41,13 @@ export const Cell = forwardRef<HTMLDivElement, CellProps>(
|
|
|
41
41
|
sm && `navds-grid__cell--sm-${sm}`,
|
|
42
42
|
md && `navds-grid__cell--md-${md}`,
|
|
43
43
|
lg && `navds-grid__cell--lg-${lg}`,
|
|
44
|
-
className
|
|
44
|
+
className,
|
|
45
45
|
)}
|
|
46
46
|
>
|
|
47
47
|
{children}
|
|
48
48
|
</div>
|
|
49
49
|
);
|
|
50
|
-
}
|
|
50
|
+
},
|
|
51
51
|
);
|
|
52
52
|
|
|
53
53
|
export default Cell;
|
package/src/grid/Grid.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { forwardRef, HTMLAttributes } from "react";
|
|
2
1
|
import cl from "clsx";
|
|
2
|
+
import React, { HTMLAttributes, forwardRef } from "react";
|
|
3
3
|
|
|
4
4
|
export interface GridProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
5
|
/**
|
|
@@ -17,7 +17,7 @@ export const Grid = forwardRef<HTMLDivElement, GridProps>(
|
|
|
17
17
|
<div ref={ref} className={cl("navds-grid", className)} {...rest}>
|
|
18
18
|
{children}
|
|
19
19
|
</div>
|
|
20
|
-
)
|
|
20
|
+
),
|
|
21
21
|
);
|
|
22
22
|
|
|
23
23
|
export default Grid;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { forwardRef, HTMLAttributes } from "react";
|
|
2
1
|
import cl from "clsx";
|
|
2
|
+
import React, { HTMLAttributes, forwardRef } from "react";
|
|
3
3
|
import { DefaultIllustration } from "./Illustration";
|
|
4
4
|
|
|
5
5
|
export interface GuidePanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -49,7 +49,7 @@ export const GuidePanel = forwardRef<HTMLDivElement, GuidePanelProps>(
|
|
|
49
49
|
</div>
|
|
50
50
|
<div className="navds-guide-panel__content">{children}</div>
|
|
51
51
|
</div>
|
|
52
|
-
)
|
|
52
|
+
),
|
|
53
53
|
);
|
|
54
54
|
|
|
55
55
|
export default GuidePanel;
|
|
@@ -61,7 +61,7 @@ export const HelpText = forwardRef<HTMLButtonElement, HelpTextProps>(
|
|
|
61
61
|
wrapperClassName,
|
|
62
62
|
...rest
|
|
63
63
|
},
|
|
64
|
-
ref
|
|
64
|
+
ref,
|
|
65
65
|
) => {
|
|
66
66
|
const buttonRef = useRef<HTMLButtonElement | null>(null);
|
|
67
67
|
const mergedRef = useMemo(() => mergeRefs([buttonRef, ref]), [ref]);
|
|
@@ -98,7 +98,7 @@ export const HelpText = forwardRef<HTMLButtonElement, HelpTextProps>(
|
|
|
98
98
|
</Popover>
|
|
99
99
|
</div>
|
|
100
100
|
);
|
|
101
|
-
}
|
|
101
|
+
},
|
|
102
102
|
);
|
|
103
103
|
|
|
104
104
|
export default HelpText;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { HTMLAttributes, forwardRef } from "react";
|
|
3
3
|
import { OverridableComponent } from "../util/OverridableComponent";
|
|
4
4
|
import InternalHeaderButton, {
|
|
5
5
|
InternalHeaderButtonProps,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ChevronDownIcon } from "@navikt/aksel-icons";
|
|
2
1
|
import cl from "clsx";
|
|
3
2
|
import React, { forwardRef } from "react";
|
|
3
|
+
import { ChevronDownIcon } from "@navikt/aksel-icons";
|
|
4
4
|
import { BodyShort, Detail } from "../typography";
|
|
5
5
|
import { OverridableComponent } from "../util/OverridableComponent";
|
|
6
6
|
import InternalHeaderButton from "./InternalHeaderButton";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { Meta } from "@storybook/react";
|
|
2
|
+
import React from "react";
|
|
1
3
|
import {
|
|
2
4
|
ChevronDownIcon,
|
|
3
5
|
ExternalLinkIcon,
|
|
4
6
|
MenuGridIcon,
|
|
5
7
|
} from "@navikt/aksel-icons";
|
|
6
8
|
import { BodyLong, BodyShort, Detail } from "@navikt/ds-react";
|
|
7
|
-
import {
|
|
8
|
-
import React from "react";
|
|
9
|
-
import { InternalHeader, Dropdown } from "..";
|
|
9
|
+
import { Dropdown, InternalHeader } from "..";
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
12
|
title: "ds-react/InternalHeader",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
2
|
import React, { forwardRef } from "react";
|
|
3
|
+
import { Slot } from "../../util/Slot";
|
|
3
4
|
import { getResponsiveProps } from "../utilities/css";
|
|
4
5
|
import { ResponsiveProp, SpacingScale } from "../utilities/types";
|
|
5
|
-
import { Slot } from "../../util/Slot";
|
|
6
6
|
|
|
7
7
|
export type BleedSpacingInline = "0" | "full" | "px" | SpacingScale;
|
|
8
8
|
export type BleedSpacingBlock = "0" | "px" | SpacingScale;
|
|
@@ -66,7 +66,7 @@ export const Bleed = forwardRef<HTMLDivElement, BleedProps>(
|
|
|
66
66
|
asChild,
|
|
67
67
|
...rest
|
|
68
68
|
},
|
|
69
|
-
ref
|
|
69
|
+
ref,
|
|
70
70
|
) => {
|
|
71
71
|
let style: React.CSSProperties = {
|
|
72
72
|
..._style,
|
|
@@ -76,7 +76,7 @@ export const Bleed = forwardRef<HTMLDivElement, BleedProps>(
|
|
|
76
76
|
"spacing",
|
|
77
77
|
marginInline,
|
|
78
78
|
true,
|
|
79
|
-
["0", "full", "px"]
|
|
79
|
+
["0", "full", "px"],
|
|
80
80
|
),
|
|
81
81
|
|
|
82
82
|
...getResponsiveProps(
|
|
@@ -85,7 +85,7 @@ export const Bleed = forwardRef<HTMLDivElement, BleedProps>(
|
|
|
85
85
|
"spacing",
|
|
86
86
|
marginBlock,
|
|
87
87
|
true,
|
|
88
|
-
["0", "px"]
|
|
88
|
+
["0", "px"],
|
|
89
89
|
),
|
|
90
90
|
};
|
|
91
91
|
|
|
@@ -98,7 +98,7 @@ export const Bleed = forwardRef<HTMLDivElement, BleedProps>(
|
|
|
98
98
|
"spacing",
|
|
99
99
|
marginInline,
|
|
100
100
|
false,
|
|
101
|
-
["0", "full", "px"]
|
|
101
|
+
["0", "full", "px"],
|
|
102
102
|
),
|
|
103
103
|
...getResponsiveProps(
|
|
104
104
|
"bleed",
|
|
@@ -106,7 +106,7 @@ export const Bleed = forwardRef<HTMLDivElement, BleedProps>(
|
|
|
106
106
|
"spacing",
|
|
107
107
|
marginBlock,
|
|
108
108
|
false,
|
|
109
|
-
["0", "px"]
|
|
109
|
+
["0", "px"],
|
|
110
110
|
),
|
|
111
111
|
};
|
|
112
112
|
}
|
|
@@ -123,5 +123,5 @@ export const Bleed = forwardRef<HTMLDivElement, BleedProps>(
|
|
|
123
123
|
style={style}
|
|
124
124
|
/>
|
|
125
125
|
);
|
|
126
|
-
}
|
|
126
|
+
},
|
|
127
127
|
);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React, { ReactNode } from "react";
|
|
2
1
|
import type { Meta } from "@storybook/react";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import React, { ReactNode } from "react";
|
|
3
|
+
import { ChevronRightIcon } from "@navikt/aksel-icons";
|
|
5
4
|
import { HGrid, HStack, VStack } from "../..";
|
|
5
|
+
import { BodyLong, Detail, Heading } from "../../typography";
|
|
6
6
|
import { BackgroundToken, BorderRadiiToken } from "../utilities/types";
|
|
7
|
-
import {
|
|
7
|
+
import { Box } from "./Box";
|
|
8
8
|
|
|
9
9
|
const meta: Meta<typeof Box> = {
|
|
10
10
|
title: "ds-react/Primitives/Box",
|