@navikt/ds-react 6.0.0-alpha.2 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/chat/Bubble.d.ts +0 -5
- package/cjs/chat/Bubble.js +2 -2
- package/cjs/chat/Bubble.js.map +1 -1
- package/cjs/chat/Chat.d.ts +0 -10
- package/cjs/chat/Chat.js +3 -3
- package/cjs/chat/Chat.js.map +1 -1
- package/cjs/date/context/useSharedMonthContext.js +2 -6
- package/cjs/date/context/useSharedMonthContext.js.map +1 -1
- package/cjs/date/datepicker/DatePicker.js +3 -5
- package/cjs/date/datepicker/DatePicker.js.map +1 -1
- package/cjs/date/datepicker/DatePickerStandalone.js +3 -5
- package/cjs/date/datepicker/DatePickerStandalone.js.map +1 -1
- package/cjs/date/datepicker/parts/DayButton.js +2 -5
- package/cjs/date/datepicker/parts/DayButton.js.map +1 -1
- package/cjs/date/datepicker/parts/DropdownCaption.js +3 -6
- package/cjs/date/datepicker/parts/DropdownCaption.js.map +1 -1
- package/cjs/date/datepicker/parts/Row.js +2 -1
- package/cjs/date/datepicker/parts/Row.js.map +1 -1
- package/cjs/date/hooks/useDatepicker.d.ts +1 -6
- package/cjs/date/hooks/useDatepicker.js +7 -11
- package/cjs/date/hooks/useDatepicker.js.map +1 -1
- package/cjs/date/hooks/useMonthPicker.d.ts +1 -6
- package/cjs/date/hooks/useMonthPicker.js.map +1 -1
- package/cjs/date/hooks/useRangeDatepicker.js +20 -25
- package/cjs/date/hooks/useRangeDatepicker.js.map +1 -1
- package/cjs/date/monthpicker/MonthButton.js +11 -15
- package/cjs/date/monthpicker/MonthButton.js.map +1 -1
- package/cjs/date/monthpicker/MonthCaption.js +4 -7
- package/cjs/date/monthpicker/MonthCaption.js.map +1 -1
- package/cjs/date/monthpicker/MonthPicker.js +7 -1
- package/cjs/date/monthpicker/MonthPicker.js.map +1 -1
- package/cjs/date/monthpicker/MonthPickerStandalone.js +7 -1
- package/cjs/date/monthpicker/MonthPickerStandalone.js.map +1 -1
- package/cjs/date/monthpicker/MonthSelector.js +8 -11
- package/cjs/date/monthpicker/MonthSelector.js.map +1 -1
- package/cjs/date/parts/DateInput.d.ts +1 -1
- package/cjs/date/parts/DateWrapper.js +2 -2
- package/cjs/date/parts/DateWrapper.js.map +1 -1
- package/cjs/date/utils/check-dates.js +2 -6
- package/cjs/date/utils/check-dates.js.map +1 -1
- package/cjs/date/utils/dates-disabled.js +3 -6
- package/cjs/date/utils/dates-disabled.js.map +1 -1
- package/cjs/date/utils/format-date.d.ts +1 -0
- package/cjs/date/utils/format-date.js +2 -5
- package/cjs/date/utils/format-date.js.map +1 -1
- package/cjs/date/utils/get-dates.js +14 -21
- package/cjs/date/utils/get-dates.js.map +1 -1
- package/cjs/date/utils/get-initial-year.js +2 -5
- package/cjs/date/utils/get-initial-year.js.map +1 -1
- package/cjs/date/utils/is-match.js +14 -20
- package/cjs/date/utils/is-match.js.map +1 -1
- package/cjs/date/utils/labels.d.ts +1 -0
- package/cjs/date/utils/labels.js.map +1 -1
- package/cjs/date/utils/locale.d.ts +1 -1
- package/cjs/date/utils/locale.js +4 -9
- package/cjs/date/utils/locale.js.map +1 -1
- package/cjs/date/utils/navigation.js +21 -24
- package/cjs/date/utils/navigation.js.map +1 -1
- package/cjs/date/utils/parse-date.d.ts +1 -0
- package/cjs/date/utils/parse-date.js +8 -13
- package/cjs/date/utils/parse-date.js.map +1 -1
- package/cjs/form/Textarea.js +8 -8
- package/cjs/form/Textarea.js.map +1 -1
- package/cjs/form/combobox/Combobox.js +1 -1
- package/cjs/form/combobox/Combobox.js.map +1 -1
- package/cjs/form/combobox/ComboboxProvider.js +2 -1
- package/cjs/form/combobox/ComboboxProvider.js.map +1 -1
- package/cjs/form/combobox/ComboboxWrapper.js +1 -1
- package/cjs/form/combobox/ComboboxWrapper.js.map +1 -1
- package/cjs/form/combobox/FilteredOptions/FilteredOptions.js +59 -41
- package/cjs/form/combobox/FilteredOptions/FilteredOptions.js.map +1 -1
- package/cjs/form/combobox/FilteredOptions/filtered-options-util.d.ts +2 -1
- package/cjs/form/combobox/FilteredOptions/filtered-options-util.js +3 -1
- package/cjs/form/combobox/FilteredOptions/filtered-options-util.js.map +1 -1
- package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.js +15 -3
- package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.js.map +1 -1
- package/cjs/form/combobox/FilteredOptions/useVirtualFocus.d.ts +2 -4
- package/cjs/form/combobox/FilteredOptions/useVirtualFocus.js +52 -32
- package/cjs/form/combobox/FilteredOptions/useVirtualFocus.js.map +1 -1
- package/cjs/form/combobox/Input/Input.js +3 -1
- package/cjs/form/combobox/Input/Input.js.map +1 -1
- package/cjs/form/combobox/SelectedOptions/selectedOptionsContext.d.ts +5 -2
- package/cjs/form/combobox/SelectedOptions/selectedOptionsContext.js +3 -1
- package/cjs/form/combobox/SelectedOptions/selectedOptionsContext.js.map +1 -1
- package/cjs/form/combobox/types.d.ts +14 -0
- package/cjs/form/search/Search.d.ts +2 -1
- package/cjs/form/search/Search.js +2 -2
- package/cjs/form/search/Search.js.map +1 -1
- package/cjs/index.d.ts +1 -2
- package/cjs/index.js +2 -3
- package/cjs/index.js.map +1 -1
- package/cjs/layout/bleed/Bleed.d.ts +2 -2
- package/cjs/layout/utilities/css.js +4 -0
- package/cjs/layout/utilities/css.js.map +1 -1
- package/cjs/layout/utilities/types.d.ts +1 -1
- package/cjs/modal/Modal.context.d.ts +9 -0
- package/cjs/modal/Modal.context.js +10 -0
- package/cjs/modal/Modal.context.js.map +1 -0
- package/cjs/modal/Modal.js +3 -6
- package/cjs/modal/Modal.js.map +1 -1
- package/cjs/modal/ModalHeader.js +2 -6
- package/cjs/modal/ModalHeader.js.map +1 -1
- package/cjs/modal/types.d.ts +24 -3
- package/cjs/overlays/index.d.ts +2 -0
- package/cjs/overlays/index.js +6 -0
- package/cjs/overlays/index.js.map +1 -0
- package/cjs/overlays/portal/Portal.d.ts +11 -0
- package/cjs/{grid/Grid.js → overlays/portal/Portal.js} +15 -11
- package/cjs/overlays/portal/Portal.js.map +1 -0
- package/cjs/panel/Panel.d.ts +9 -16
- package/cjs/panel/Panel.js +6 -16
- package/cjs/panel/Panel.js.map +1 -1
- package/cjs/popover/Popover.js +2 -2
- package/cjs/popover/Popover.js.map +1 -1
- package/cjs/table/types.d.ts +1 -1
- package/cjs/tabs/TabList.js +2 -2
- package/cjs/tabs/TabList.js.map +1 -1
- package/cjs/tabs/TabPanel.js +2 -2
- package/cjs/tabs/TabPanel.js.map +1 -1
- package/cjs/timeline/AxisLabels.js +4 -4
- package/cjs/timeline/AxisLabels.js.map +1 -1
- package/cjs/tooltip/Tooltip.js +5 -9
- package/cjs/tooltip/Tooltip.js.map +1 -1
- package/cjs/util/Slot.js +5 -2
- package/cjs/util/Slot.js.map +1 -1
- package/cjs/util/TextareaAutoSize.js +14 -24
- package/cjs/util/TextareaAutoSize.js.map +1 -1
- package/cjs/util/create-context.d.ts +2 -5
- package/cjs/util/create-context.js +9 -5
- package/cjs/util/create-context.js.map +1 -1
- package/cjs/util/types/AsChildProps.d.ts +36 -0
- package/cjs/util/types/AsChildProps.js +3 -0
- package/cjs/util/types/AsChildProps.js.map +1 -0
- package/cjs/util/types/OverridableComponent.d.ts +1 -1
- package/cjs/util/types/index.d.ts +1 -0
- package/esm/accordion/Accordion.d.ts +3 -3
- package/esm/accordion/Accordion.js +4 -4
- package/esm/accordion/AccordionContent.js +2 -2
- package/esm/accordion/AccordionHeader.js +4 -4
- package/esm/accordion/AccordionItem.js +3 -3
- package/esm/accordion/index.d.ts +1 -1
- package/esm/accordion/index.js +1 -1
- package/esm/alert/Alert.js +2 -2
- package/esm/alert/index.d.ts +2 -2
- package/esm/alert/index.js +1 -1
- package/esm/button/Button.d.ts +1 -1
- package/esm/button/Button.js +6 -6
- package/esm/button/index.d.ts +2 -2
- package/esm/button/index.js +1 -1
- package/esm/chat/Bubble.d.ts +0 -5
- package/esm/chat/Bubble.js +3 -3
- package/esm/chat/Bubble.js.map +1 -1
- package/esm/chat/Chat.d.ts +1 -11
- package/esm/chat/Chat.js +5 -5
- package/esm/chat/Chat.js.map +1 -1
- package/esm/chat/index.d.ts +1 -1
- package/esm/chat/index.js +1 -1
- package/esm/chips/Chips.d.ts +3 -3
- package/esm/chips/Chips.js +2 -2
- package/esm/chips/Removable.js +1 -1
- package/esm/chips/Toggle.d.ts +1 -1
- package/esm/chips/index.d.ts +1 -1
- package/esm/chips/index.js +1 -1
- package/esm/copybutton/CopyButton.js +3 -3
- package/esm/copybutton/index.d.ts +1 -1
- package/esm/copybutton/index.js +1 -1
- package/esm/date/context/index.d.ts +2 -2
- package/esm/date/context/index.js +2 -2
- package/esm/date/context/useSharedMonthContext.d.ts +1 -1
- package/esm/date/context/useSharedMonthContext.js +2 -3
- package/esm/date/context/useSharedMonthContext.js.map +1 -1
- package/esm/date/datepicker/DatePicker.d.ts +3 -3
- package/esm/date/datepicker/DatePicker.js +15 -17
- package/esm/date/datepicker/DatePicker.js.map +1 -1
- package/esm/date/datepicker/DatePickerStandalone.d.ts +1 -1
- package/esm/date/datepicker/DatePickerStandalone.js +9 -11
- package/esm/date/datepicker/DatePickerStandalone.js.map +1 -1
- package/esm/date/datepicker/parts/Caption.js +3 -3
- package/esm/date/datepicker/parts/DayButton.js +1 -1
- package/esm/date/datepicker/parts/DayButton.js.map +1 -1
- package/esm/date/datepicker/parts/DropdownCaption.js +6 -9
- package/esm/date/datepicker/parts/DropdownCaption.js.map +1 -1
- package/esm/date/datepicker/parts/HeadRow.js +1 -1
- package/esm/date/datepicker/parts/Row.js +5 -4
- package/esm/date/datepicker/parts/Row.js.map +1 -1
- package/esm/date/datepicker/parts/WeekNumber.js +1 -1
- package/esm/date/datepicker/parts/WeekRow.js +6 -6
- package/esm/date/hooks/index.d.ts +6 -6
- package/esm/date/hooks/index.js +3 -3
- package/esm/date/hooks/useDatepicker.d.ts +3 -8
- package/esm/date/hooks/useDatepicker.js +2 -3
- package/esm/date/hooks/useDatepicker.js.map +1 -1
- package/esm/date/hooks/useMonthPicker.d.ts +3 -8
- package/esm/date/hooks/useMonthPicker.js +1 -1
- package/esm/date/hooks/useMonthPicker.js.map +1 -1
- package/esm/date/hooks/useRangeDatepicker.d.ts +3 -3
- package/esm/date/hooks/useRangeDatepicker.js +2 -4
- package/esm/date/hooks/useRangeDatepicker.js.map +1 -1
- package/esm/date/index.d.ts +7 -7
- package/esm/date/index.js +3 -3
- package/esm/date/monthpicker/MonthButton.js +3 -7
- package/esm/date/monthpicker/MonthButton.js.map +1 -1
- package/esm/date/monthpicker/MonthCaption.js +5 -8
- package/esm/date/monthpicker/MonthCaption.js.map +1 -1
- package/esm/date/monthpicker/MonthPicker.d.ts +3 -3
- package/esm/date/monthpicker/MonthPicker.js +17 -11
- package/esm/date/monthpicker/MonthPicker.js.map +1 -1
- package/esm/date/monthpicker/MonthPickerStandalone.d.ts +1 -1
- package/esm/date/monthpicker/MonthPickerStandalone.js +12 -6
- package/esm/date/monthpicker/MonthPickerStandalone.js.map +1 -1
- package/esm/date/monthpicker/MonthSelector.js +5 -8
- package/esm/date/monthpicker/MonthSelector.js.map +1 -1
- package/esm/date/monthpicker/types.d.ts +1 -1
- package/esm/date/parts/DateInput.d.ts +2 -2
- package/esm/date/parts/DateInput.js +5 -5
- package/esm/date/parts/DateWrapper.js +8 -8
- package/esm/date/parts/DateWrapper.js.map +1 -1
- package/esm/date/utils/check-dates.js +1 -2
- package/esm/date/utils/check-dates.js.map +1 -1
- package/esm/date/utils/dates-disabled.js +1 -1
- package/esm/date/utils/dates-disabled.js.map +1 -1
- package/esm/date/utils/format-date.d.ts +1 -0
- package/esm/date/utils/format-date.js +2 -2
- package/esm/date/utils/format-date.js.map +1 -1
- package/esm/date/utils/get-dates.js +1 -5
- package/esm/date/utils/get-dates.js.map +1 -1
- package/esm/date/utils/get-initial-year.js +1 -1
- package/esm/date/utils/get-initial-year.js.map +1 -1
- package/esm/date/utils/index.d.ts +10 -10
- package/esm/date/utils/index.js +10 -10
- package/esm/date/utils/is-match.js +1 -4
- package/esm/date/utils/is-match.js.map +1 -1
- package/esm/date/utils/labels.d.ts +1 -0
- package/esm/date/utils/labels.js.map +1 -1
- package/esm/date/utils/locale.d.ts +1 -1
- package/esm/date/utils/locale.js +1 -3
- package/esm/date/utils/locale.js.map +1 -1
- package/esm/date/utils/navigation.d.ts +1 -1
- package/esm/date/utils/navigation.js +2 -2
- package/esm/date/utils/navigation.js.map +1 -1
- package/esm/date/utils/parse-date.d.ts +1 -0
- package/esm/date/utils/parse-date.js +2 -4
- package/esm/date/utils/parse-date.js.map +1 -1
- package/esm/dropdown/Dropdown.d.ts +2 -2
- package/esm/dropdown/Dropdown.js +4 -4
- package/esm/dropdown/Menu/GroupedList/GroupedItem.d.ts +1 -1
- package/esm/dropdown/Menu/GroupedList/GroupedItem.js +2 -2
- package/esm/dropdown/Menu/GroupedList/index.d.ts +3 -3
- package/esm/dropdown/Menu/GroupedList/index.js +2 -2
- package/esm/dropdown/Menu/List/Item.d.ts +1 -1
- package/esm/dropdown/Menu/List/Item.js +2 -2
- package/esm/dropdown/Menu/List/index.d.ts +2 -2
- package/esm/dropdown/Menu/List/index.js +1 -1
- package/esm/dropdown/Menu/index.d.ts +2 -2
- package/esm/dropdown/Menu/index.js +5 -5
- package/esm/dropdown/Toggle.js +2 -2
- package/esm/dropdown/index.d.ts +1 -1
- package/esm/dropdown/index.js +1 -1
- package/esm/expansion-card/ExpansionCard.d.ts +5 -5
- package/esm/expansion-card/ExpansionCard.js +5 -5
- package/esm/expansion-card/ExpansionCardContent.js +2 -2
- package/esm/expansion-card/ExpansionCardDescription.js +2 -2
- package/esm/expansion-card/ExpansionCardHeader.js +1 -1
- package/esm/expansion-card/ExpansionCardTitle.d.ts +1 -1
- package/esm/expansion-card/index.d.ts +1 -1
- package/esm/expansion-card/index.js +1 -1
- package/esm/form/ConfirmationPanel.d.ts +1 -1
- package/esm/form/ConfirmationPanel.js +4 -4
- package/esm/form/Fieldset/Fieldset.d.ts +1 -1
- package/esm/form/Fieldset/Fieldset.js +5 -5
- package/esm/form/Fieldset/index.d.ts +2 -2
- package/esm/form/Fieldset/index.js +2 -2
- package/esm/form/Fieldset/useFieldset.js +1 -1
- package/esm/form/Select.d.ts +1 -1
- package/esm/form/Select.js +4 -4
- package/esm/form/Switch.d.ts +1 -1
- package/esm/form/Switch.js +5 -5
- package/esm/form/TextField.d.ts +1 -1
- package/esm/form/TextField.js +4 -4
- package/esm/form/Textarea.d.ts +1 -1
- package/esm/form/Textarea.js +15 -15
- package/esm/form/Textarea.js.map +1 -1
- package/esm/form/TextareaCounter.d.ts +1 -1
- package/esm/form/TextareaCounter.js +2 -2
- package/esm/form/checkbox/Checkbox.d.ts +1 -1
- package/esm/form/checkbox/Checkbox.js +5 -5
- package/esm/form/checkbox/CheckboxGroup.d.ts +1 -1
- package/esm/form/checkbox/CheckboxGroup.js +1 -1
- package/esm/form/checkbox/index.d.ts +3 -3
- package/esm/form/checkbox/index.js +2 -2
- package/esm/form/checkbox/types.d.ts +1 -1
- package/esm/form/checkbox/useCheckbox.d.ts +1 -1
- package/esm/form/checkbox/useCheckbox.js +3 -3
- package/esm/form/combobox/Combobox.d.ts +1 -1
- package/esm/form/combobox/Combobox.js +12 -12
- package/esm/form/combobox/Combobox.js.map +1 -1
- package/esm/form/combobox/ComboboxProvider.d.ts +1 -1
- package/esm/form/combobox/ComboboxProvider.js +7 -6
- package/esm/form/combobox/ComboboxProvider.js.map +1 -1
- package/esm/form/combobox/ComboboxWrapper.js +1 -1
- package/esm/form/combobox/ComboboxWrapper.js.map +1 -1
- package/esm/form/combobox/FilteredOptions/FilteredOptions.js +65 -47
- package/esm/form/combobox/FilteredOptions/FilteredOptions.js.map +1 -1
- package/esm/form/combobox/FilteredOptions/filtered-options-util.d.ts +2 -1
- package/esm/form/combobox/FilteredOptions/filtered-options-util.js +3 -1
- package/esm/form/combobox/FilteredOptions/filtered-options-util.js.map +1 -1
- package/esm/form/combobox/FilteredOptions/filteredOptionsContext.d.ts +2 -2
- package/esm/form/combobox/FilteredOptions/filteredOptionsContext.js +20 -8
- package/esm/form/combobox/FilteredOptions/filteredOptionsContext.js.map +1 -1
- package/esm/form/combobox/FilteredOptions/useVirtualFocus.d.ts +2 -4
- package/esm/form/combobox/FilteredOptions/useVirtualFocus.js +52 -32
- package/esm/form/combobox/FilteredOptions/useVirtualFocus.js.map +1 -1
- package/esm/form/combobox/Input/Input.js +8 -6
- package/esm/form/combobox/Input/Input.js.map +1 -1
- package/esm/form/combobox/Input/inputContext.d.ts +1 -1
- package/esm/form/combobox/Input/inputContext.js +2 -2
- package/esm/form/combobox/SelectedOptions/SelectedOptions.js +3 -3
- package/esm/form/combobox/SelectedOptions/selectedOptionsContext.d.ts +5 -2
- package/esm/form/combobox/SelectedOptions/selectedOptionsContext.js +6 -4
- package/esm/form/combobox/SelectedOptions/selectedOptionsContext.js.map +1 -1
- package/esm/form/combobox/ToggleListButton.js +1 -1
- package/esm/form/combobox/customOptionsContext.js +1 -1
- package/esm/form/combobox/index.d.ts +2 -2
- package/esm/form/combobox/index.js +1 -1
- package/esm/form/combobox/types.d.ts +15 -1
- package/esm/form/error-summary/ErrorSummary.d.ts +1 -1
- package/esm/form/error-summary/ErrorSummary.js +3 -3
- package/esm/form/error-summary/ErrorSummaryItem.d.ts +1 -1
- package/esm/form/error-summary/index.d.ts +2 -2
- package/esm/form/error-summary/index.js +1 -1
- package/esm/form/index.d.ts +11 -11
- package/esm/form/index.js +11 -11
- package/esm/form/radio/Radio.d.ts +1 -1
- package/esm/form/radio/Radio.js +4 -4
- package/esm/form/radio/RadioGroup.d.ts +1 -1
- package/esm/form/radio/RadioGroup.js +2 -2
- package/esm/form/radio/index.d.ts +3 -3
- package/esm/form/radio/index.js +2 -2
- package/esm/form/radio/types.d.ts +1 -1
- package/esm/form/radio/useRadio.d.ts +1 -1
- package/esm/form/radio/useRadio.js +3 -3
- package/esm/form/search/Search.d.ts +4 -3
- package/esm/form/search/Search.js +8 -8
- package/esm/form/search/Search.js.map +1 -1
- package/esm/form/search/SearchButton.d.ts +1 -1
- package/esm/form/search/SearchButton.js +3 -3
- package/esm/form/search/index.d.ts +1 -1
- package/esm/form/search/index.js +1 -1
- package/esm/form/useFormField.js +2 -2
- package/esm/guide-panel/GuidePanel.js +1 -1
- package/esm/guide-panel/Illustration.js +1 -1
- package/esm/guide-panel/index.d.ts +2 -2
- package/esm/guide-panel/index.js +2 -2
- package/esm/help-text/HelpText.d.ts +1 -1
- package/esm/help-text/HelpText.js +4 -4
- package/esm/help-text/HelpTextIcon.js +1 -1
- package/esm/help-text/index.d.ts +2 -2
- package/esm/help-text/index.js +1 -1
- package/esm/index.d.ts +40 -41
- package/esm/index.js +40 -41
- package/esm/index.js.map +1 -1
- package/esm/internal-header/InternalHeader.d.ts +5 -5
- package/esm/internal-header/InternalHeader.js +4 -4
- package/esm/internal-header/InternalHeaderButton.d.ts +1 -1
- package/esm/internal-header/InternalHeaderTitle.d.ts +1 -1
- package/esm/internal-header/InternalHeaderUser.js +1 -1
- package/esm/internal-header/InternalHeaderUserButton.d.ts +1 -1
- package/esm/internal-header/InternalHeaderUserButton.js +2 -2
- package/esm/internal-header/index.d.ts +5 -5
- package/esm/internal-header/index.js +1 -1
- package/esm/layout/bleed/Bleed.d.ts +3 -3
- package/esm/layout/bleed/Bleed.js +2 -2
- package/esm/layout/bleed/index.d.ts +1 -1
- package/esm/layout/bleed/index.js +1 -1
- package/esm/layout/box/Box.d.ts +2 -2
- package/esm/layout/box/Box.js +1 -1
- package/esm/layout/box/index.d.ts +1 -1
- package/esm/layout/box/index.js +1 -1
- package/esm/layout/grid/HGrid.d.ts +1 -1
- package/esm/layout/grid/HGrid.js +1 -1
- package/esm/layout/grid/index.d.ts +1 -1
- package/esm/layout/grid/index.js +1 -1
- package/esm/layout/page/Page.d.ts +2 -2
- package/esm/layout/page/Page.js +1 -1
- package/esm/layout/page/index.d.ts +2 -2
- package/esm/layout/page/index.js +1 -1
- package/esm/layout/page/parts/PageBlock.d.ts +1 -1
- package/esm/layout/responsive/Responsive.d.ts +1 -1
- package/esm/layout/responsive/Responsive.js +1 -1
- package/esm/layout/responsive/index.d.ts +1 -1
- package/esm/layout/responsive/index.js +1 -1
- package/esm/layout/sidemal-test/AvatarPanel.js +2 -2
- package/esm/layout/sidemal-test/Content.js +9 -9
- package/esm/layout/sidemal-test/Filter.js +4 -4
- package/esm/layout/sidemal-test/Header.js +5 -5
- package/esm/layout/sidemal-test/Intro.js +4 -4
- package/esm/layout/sidemal-test/Sidebar.js +4 -4
- package/esm/layout/sidemal-test/content-box/ContentBox.d.ts +1 -1
- package/esm/layout/sidemal-test/content-box/index.d.ts +1 -1
- package/esm/layout/sidemal-test/content-box/index.js +1 -1
- package/esm/layout/stack/HStack.d.ts +2 -2
- package/esm/layout/stack/HStack.js +1 -1
- package/esm/layout/stack/Stack.d.ts +2 -2
- package/esm/layout/stack/Stack.js +1 -1
- package/esm/layout/stack/VStack.d.ts +2 -2
- package/esm/layout/stack/VStack.js +1 -1
- package/esm/layout/stack/index.d.ts +4 -4
- package/esm/layout/stack/index.js +4 -4
- package/esm/layout/utilities/css.d.ts +1 -1
- package/esm/layout/utilities/css.js +4 -0
- package/esm/layout/utilities/css.js.map +1 -1
- package/esm/layout/utilities/types.d.ts +1 -1
- package/esm/link/Link.d.ts +1 -1
- package/esm/link/index.d.ts +2 -2
- package/esm/link/index.js +1 -1
- package/esm/link-panel/LinkPanel.d.ts +3 -3
- package/esm/link-panel/LinkPanel.js +3 -3
- package/esm/link-panel/LinkPanelDescription.js +1 -1
- package/esm/link-panel/LinkPanelTitle.d.ts +1 -1
- package/esm/link-panel/index.d.ts +2 -2
- package/esm/link-panel/index.js +1 -1
- package/esm/list/List.d.ts +2 -2
- package/esm/list/List.js +4 -4
- package/esm/list/ListItem.js +2 -2
- package/esm/list/context.d.ts +1 -1
- package/esm/list/index.d.ts +2 -2
- package/esm/list/index.js +1 -1
- package/esm/loader/Loader.js +2 -2
- package/esm/loader/index.d.ts +2 -2
- package/esm/loader/index.js +1 -1
- package/esm/modal/Modal.context.d.ts +9 -0
- package/esm/modal/Modal.context.js +6 -0
- package/esm/modal/Modal.context.js.map +1 -0
- package/esm/modal/Modal.d.ts +4 -4
- package/esm/modal/Modal.js +14 -17
- package/esm/modal/Modal.js.map +1 -1
- package/esm/modal/ModalHeader.js +4 -8
- package/esm/modal/ModalHeader.js.map +1 -1
- package/esm/modal/ModalUtils.d.ts +1 -1
- package/esm/modal/index.d.ts +5 -5
- package/esm/modal/index.js +1 -1
- package/esm/modal/types.d.ts +24 -3
- package/esm/overlays/index.d.ts +2 -0
- package/esm/overlays/index.js +2 -0
- package/esm/overlays/index.js.map +1 -0
- package/esm/overlays/portal/Portal.d.ts +11 -0
- package/esm/overlays/portal/Portal.js +27 -0
- package/esm/overlays/portal/Portal.js.map +1 -0
- package/esm/package.json +1 -1
- package/esm/pagination/Pagination.d.ts +1 -1
- package/esm/pagination/Pagination.js +2 -2
- package/esm/pagination/PaginationItem.d.ts +2 -2
- package/esm/pagination/PaginationItem.js +1 -1
- package/esm/pagination/index.d.ts +1 -1
- package/esm/pagination/index.js +1 -1
- package/esm/panel/Panel.d.ts +10 -17
- package/esm/panel/Panel.js +6 -16
- package/esm/panel/Panel.js.map +1 -1
- package/esm/panel/index.d.ts +2 -2
- package/esm/panel/index.js +1 -1
- package/esm/popover/Popover.d.ts +1 -1
- package/esm/popover/Popover.js +6 -6
- package/esm/popover/Popover.js.map +1 -1
- package/esm/popover/index.d.ts +2 -2
- package/esm/popover/index.js +1 -1
- package/esm/provider/index.d.ts +1 -1
- package/esm/provider/index.js +1 -1
- package/esm/read-more/ReadMore.js +3 -3
- package/esm/read-more/index.d.ts +2 -2
- package/esm/read-more/index.js +1 -1
- package/esm/skeleton/index.d.ts +2 -2
- package/esm/skeleton/index.js +1 -1
- package/esm/stepper/Step.d.ts +1 -1
- package/esm/stepper/Step.js +3 -3
- package/esm/stepper/Stepper.d.ts +1 -1
- package/esm/stepper/Stepper.js +2 -2
- package/esm/stepper/index.d.ts +1 -1
- package/esm/stepper/index.js +1 -1
- package/esm/table/ColumnHeader.d.ts +1 -1
- package/esm/table/ColumnHeader.js +2 -2
- package/esm/table/DataCell.js +1 -1
- package/esm/table/ExpandableRow.d.ts +1 -1
- package/esm/table/ExpandableRow.js +6 -6
- package/esm/table/Table.d.ts +8 -8
- package/esm/table/Table.js +8 -8
- package/esm/table/context.d.ts +1 -1
- package/esm/table/index.d.ts +9 -9
- package/esm/table/index.js +1 -1
- package/esm/table/types.d.ts +1 -1
- package/esm/tabs/Tab.d.ts +1 -1
- package/esm/tabs/Tab.js +2 -2
- package/esm/tabs/TabList.js +5 -5
- package/esm/tabs/TabList.js.map +1 -1
- package/esm/tabs/TabPanel.js +2 -2
- package/esm/tabs/TabPanel.js.map +1 -1
- package/esm/tabs/Tabs.d.ts +4 -4
- package/esm/tabs/Tabs.js +4 -4
- package/esm/tabs/index.d.ts +4 -4
- package/esm/tabs/index.js +1 -1
- package/esm/tag/Tag.js +1 -1
- package/esm/tag/index.d.ts +1 -1
- package/esm/tag/index.js +1 -1
- package/esm/timeline/AxisLabels.d.ts +1 -1
- package/esm/timeline/AxisLabels.js +5 -5
- package/esm/timeline/AxisLabels.js.map +1 -1
- package/esm/timeline/Pin.d.ts +1 -1
- package/esm/timeline/Pin.js +3 -3
- package/esm/timeline/Timeline.d.ts +5 -5
- package/esm/timeline/Timeline.js +9 -9
- package/esm/timeline/TimelineRow.d.ts +1 -1
- package/esm/timeline/TimelineRow.js +5 -5
- package/esm/timeline/hooks/useRowContext.d.ts +1 -1
- package/esm/timeline/hooks/useTimelineRows.d.ts +1 -1
- package/esm/timeline/hooks/useTimelineRows.js +3 -3
- package/esm/timeline/index.d.ts +6 -6
- package/esm/timeline/index.js +1 -1
- package/esm/timeline/period/ClickablePeriod.d.ts +1 -1
- package/esm/timeline/period/ClickablePeriod.js +5 -5
- package/esm/timeline/period/NonClickablePeriod.d.ts +1 -1
- package/esm/timeline/period/NonClickablePeriod.js +1 -1
- package/esm/timeline/period/index.d.ts +1 -1
- package/esm/timeline/period/index.js +4 -4
- package/esm/timeline/utils/filter.d.ts +1 -1
- package/esm/timeline/utils/index.d.ts +1 -1
- package/esm/timeline/utils/index.js +1 -1
- package/esm/timeline/utils/sort.d.ts +1 -1
- package/esm/timeline/utils/timeline.d.ts +1 -1
- package/esm/timeline/utils/timeline.js +1 -1
- package/esm/timeline/zoom/ZoomButton.js +2 -2
- package/esm/timeline/zoom/index.d.ts +1 -1
- package/esm/timeline/zoom/index.js +1 -1
- package/esm/toggle-group/ToggleGroup.d.ts +1 -1
- package/esm/toggle-group/ToggleGroup.js +4 -4
- package/esm/toggle-group/ToggleItem.js +2 -2
- package/esm/toggle-group/index.d.ts +2 -2
- package/esm/toggle-group/index.js +1 -1
- package/esm/tooltip/Tooltip.js +11 -15
- package/esm/tooltip/Tooltip.js.map +1 -1
- package/esm/tooltip/index.d.ts +1 -1
- package/esm/tooltip/index.js +1 -1
- package/esm/typography/BodyLong.d.ts +2 -2
- package/esm/typography/BodyLong.js +1 -1
- package/esm/typography/BodyShort.d.ts +2 -2
- package/esm/typography/BodyShort.js +1 -1
- package/esm/typography/Detail.d.ts +2 -2
- package/esm/typography/Detail.js +1 -1
- package/esm/typography/ErrorMessage.d.ts +2 -2
- package/esm/typography/ErrorMessage.js +1 -1
- package/esm/typography/Heading.d.ts +2 -2
- package/esm/typography/Heading.js +1 -1
- package/esm/typography/Ingress.d.ts +1 -1
- package/esm/typography/Label.d.ts +2 -2
- package/esm/typography/Label.js +1 -1
- package/esm/typography/index.d.ts +7 -7
- package/esm/typography/index.js +7 -7
- package/esm/typography/util.d.ts +1 -1
- package/esm/util/Slot.js +6 -3
- package/esm/util/Slot.js.map +1 -1
- package/esm/util/TextareaAutoSize.js +17 -27
- package/esm/util/TextareaAutoSize.js.map +1 -1
- package/esm/util/create-context.d.ts +2 -5
- package/esm/util/create-context.js +10 -6
- package/esm/util/create-context.js.map +1 -1
- package/esm/util/hooks/descendants/descendant.js +1 -1
- package/esm/util/hooks/descendants/useDescendant.d.ts +1 -1
- package/esm/util/hooks/descendants/useDescendant.js +5 -5
- package/esm/util/hooks/index.d.ts +8 -8
- package/esm/util/hooks/index.js +8 -8
- package/esm/util/hooks/useControllableState.js +1 -1
- package/esm/util/index.d.ts +6 -6
- package/esm/util/index.js +5 -5
- package/esm/util/types/AsChildProps.d.ts +36 -0
- package/esm/util/types/AsChildProps.js +2 -0
- package/esm/util/types/AsChildProps.js.map +1 -0
- package/esm/util/types/OverridableComponent.d.ts +1 -1
- package/esm/util/types/index.d.ts +2 -1
- package/package.json +11 -10
- package/src/accordion/accordion.stories.tsx +121 -135
- package/src/alert/alert.stories.tsx +202 -113
- package/src/button/button.stories.tsx +88 -185
- package/src/chat/Bubble.tsx +2 -23
- package/src/chat/Chat.tsx +1 -18
- package/src/chat/chat.stories.tsx +284 -216
- package/src/date/context/useSharedMonthContext.tsx +1 -2
- package/src/date/datepicker/DatePicker.tsx +1 -3
- package/src/date/datepicker/DatePickerStandalone.tsx +1 -3
- package/src/date/datepicker/datepicker.stories.tsx +11 -7
- package/src/date/datepicker/parts/DayButton.tsx +1 -1
- package/src/date/datepicker/parts/DropdownCaption.tsx +1 -4
- package/src/date/datepicker/parts/Row.tsx +3 -2
- package/src/date/hooks/useDatepicker.tsx +2 -8
- package/src/date/hooks/useMonthPicker.tsx +1 -6
- package/src/date/hooks/useRangeDatepicker.tsx +5 -3
- package/src/date/monthpicker/MonthButton.tsx +7 -5
- package/src/date/monthpicker/MonthCaption.tsx +7 -4
- package/src/date/monthpicker/MonthPicker.tsx +10 -8
- package/src/date/monthpicker/MonthPickerStandalone.tsx +10 -8
- package/src/date/monthpicker/MonthSelector.tsx +1 -4
- package/src/date/monthpicker/monthpicker.stories.tsx +5 -3
- package/src/date/parts/DateInput.tsx +1 -1
- package/src/date/parts/DateWrapper.tsx +3 -3
- package/src/date/utils/__tests__/format-dates.test.ts +1 -1
- package/src/date/utils/__tests__/get-initial-year.test.ts +1 -1
- package/src/date/utils/__tests__/parse-dates.test.ts +2 -2
- package/src/date/utils/check-dates.ts +1 -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 +7 -5
- package/src/date/utils/get-initial-year.ts +1 -1
- package/src/date/utils/is-match.ts +6 -4
- package/src/date/utils/labels.ts +1 -0
- package/src/date/utils/locale.ts +1 -3
- package/src/date/utils/navigation.ts +1 -1
- package/src/date/utils/parse-date.ts +1 -3
- package/src/dropdown/dropdown.stories.tsx +1 -1
- package/src/form/Textarea.tsx +34 -34
- package/src/form/combobox/Combobox.tsx +1 -1
- package/src/form/combobox/ComboboxProvider.tsx +2 -0
- package/src/form/combobox/ComboboxWrapper.tsx +0 -1
- package/src/form/combobox/FilteredOptions/FilteredOptions.tsx +131 -92
- package/src/form/combobox/FilteredOptions/filtered-options-util.ts +9 -2
- package/src/form/combobox/FilteredOptions/filteredOptionsContext.tsx +22 -3
- package/src/form/combobox/FilteredOptions/useVirtualFocus.ts +63 -45
- package/src/form/combobox/Input/Input.tsx +3 -1
- package/src/form/combobox/SelectedOptions/selectedOptionsContext.tsx +11 -1
- package/src/form/combobox/combobox.stories.tsx +36 -1
- package/src/form/combobox/combobox.test.tsx +1 -3
- package/src/form/combobox/types.ts +15 -0
- package/src/form/error-summary/error-summary.stories.tsx +1 -1
- package/src/form/search/Search.tsx +7 -2
- package/src/form/stories/confirmation-panel.stories.tsx +1 -1
- package/src/form/stories/textarea.stories.tsx +37 -0
- package/src/help-text/help-text.stories.tsx +2 -1
- package/src/index.ts +2 -2
- package/src/internal-header/header.stories.tsx +2 -1
- package/src/layout/bleed/Bleed.stories.tsx +15 -1
- package/src/layout/bleed/Bleed.tsx +2 -2
- package/src/layout/box/Box.stories.tsx +3 -2
- package/src/layout/sidemal-test/navno-sidemal.stories.tsx +5 -1
- package/src/layout/utilities/css.ts +3 -0
- package/src/layout/utilities/types.ts +1 -1
- package/src/link/stories/link.stories.tsx +20 -22
- package/src/link-panel/link-panel.stories.tsx +1 -1
- package/src/list/list.stories.tsx +2 -1
- package/src/loader/loader.stories.tsx +1 -1
- package/src/modal/Modal.context.ts +13 -0
- package/src/modal/Modal.test.tsx +2 -2
- package/src/modal/Modal.tsx +6 -8
- package/src/modal/ModalHeader.tsx +3 -7
- package/src/modal/modal.stories.tsx +33 -6
- package/src/modal/types.ts +21 -4
- package/src/overlays/index.ts +2 -0
- package/src/overlays/portal/Portal.stories.tsx +99 -0
- package/src/overlays/portal/Portal.tsx +32 -0
- package/src/panel/Panel.tsx +9 -16
- package/src/popover/Popover.tsx +2 -2
- package/src/stepper/stepper.stories.tsx +1 -1
- package/src/table/stories/{table.stories.tsx → table-1.stories.tsx} +118 -92
- package/src/table/stories/{table-expandable.stories.tsx → table-2-expandable.stories.tsx} +10 -34
- package/src/table/stories/{table-async.stories.tsx → table-3-async.stories.tsx} +5 -3
- package/src/table/stories/tests/table.stories.tsx +4 -1
- package/src/table/types.ts +1 -1
- package/src/tabs/TabList.tsx +2 -2
- package/src/tabs/TabPanel.tsx +2 -2
- package/src/tabs/Tabs.test.tsx +109 -0
- package/src/timeline/AxisLabels.tsx +1 -1
- package/src/toggle-group/ToggleGroup.test.tsx +54 -0
- package/src/tooltip/Tooltip.tsx +7 -17
- package/src/tooltip/tooltip.stories.tsx +4 -1
- package/src/typography/stories/bodylong.stories.tsx +49 -3
- package/src/typography/stories/bodyshort.stories.tsx +50 -4
- package/src/typography/stories/detail.stories.tsx +32 -3
- package/src/typography/stories/error-message.stories.tsx +34 -3
- package/src/typography/stories/heading.stories.tsx +32 -3
- package/src/typography/stories/label.stories.tsx +38 -3
- package/src/util/Slot.tsx +4 -2
- package/src/util/TextareaAutoSize.tsx +16 -31
- package/src/util/create-context.tsx +26 -15
- package/src/util/types/AsChildProps.ts +37 -0
- package/src/util/types/OverridableComponent.ts +1 -1
- package/src/util/types/index.ts +1 -0
- package/_docs.json +0 -19787
- package/cjs/grid/Cell.d.ts +0 -30
- package/cjs/grid/Cell.js +0 -52
- package/cjs/grid/Cell.js.map +0 -1
- package/cjs/grid/Grid.d.ts +0 -13
- package/cjs/grid/Grid.js.map +0 -1
- package/cjs/grid/index.d.ts +0 -2
- package/cjs/grid/index.js +0 -11
- package/cjs/grid/index.js.map +0 -1
- package/cjs/layout/content-container/ContentContainer.d.ts +0 -9
- package/cjs/layout/content-container/ContentContainer.js +0 -48
- package/cjs/layout/content-container/ContentContainer.js.map +0 -1
- package/cjs/layout/content-container/index.d.ts +0 -1
- package/cjs/layout/content-container/index.js +0 -9
- package/cjs/layout/content-container/index.js.map +0 -1
- package/cjs/modal/ModalContext.d.ts +0 -7
- package/cjs/modal/ModalContext.js +0 -9
- package/cjs/modal/ModalContext.js.map +0 -1
- package/esm/grid/Cell.d.ts +0 -30
- package/esm/grid/Cell.js +0 -23
- package/esm/grid/Cell.js.map +0 -1
- package/esm/grid/Grid.d.ts +0 -13
- package/esm/grid/Grid.js +0 -23
- package/esm/grid/Grid.js.map +0 -1
- package/esm/grid/index.d.ts +0 -2
- package/esm/grid/index.js +0 -3
- package/esm/grid/index.js.map +0 -1
- package/esm/layout/content-container/ContentContainer.d.ts +0 -9
- package/esm/layout/content-container/ContentContainer.js +0 -19
- package/esm/layout/content-container/ContentContainer.js.map +0 -1
- package/esm/layout/content-container/index.d.ts +0 -1
- package/esm/layout/content-container/index.js +0 -2
- package/esm/layout/content-container/index.js.map +0 -1
- package/esm/modal/ModalContext.d.ts +0 -7
- package/esm/modal/ModalContext.js +0 -3
- package/esm/modal/ModalContext.js.map +0 -1
- package/src/grid/Cell.tsx +0 -53
- package/src/grid/Grid.tsx +0 -23
- package/src/grid/grid.stories.tsx +0 -67
- package/src/grid/index.ts +0 -2
- package/src/layout/content-container/ContentContainer.tsx +0 -22
- package/src/layout/content-container/index.ts +0 -4
- package/src/layout/sidemal-test/navno-sidemal.stories.mdx +0 -29
- package/src/modal/ModalContext.ts +0 -7
- package/src/panel/panel.stories.tsx +0 -63
- package/src/typography/stories/ingress.stories.tsx +0 -50
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import differenceInCalendarDays from "date-fns
|
|
2
|
-
import isWeekend from "date-fns/isWeekend";
|
|
1
|
+
import { differenceInCalendarDays, isWeekend } from "date-fns";
|
|
3
2
|
import React, { useCallback, useState } from "react";
|
|
4
3
|
import { DayClickEventHandler, isMatch } from "react-day-picker";
|
|
5
4
|
import { DatePickerProps } from "../datepicker/DatePicker";
|
|
@@ -53,14 +52,9 @@ export interface UseDatepickerOptions
|
|
|
53
52
|
* Allows input of with 'yy' year format.
|
|
54
53
|
* @default true
|
|
55
54
|
* @Note Decision between 20th and 21st century is based on before(todays year - 80) ? 21st : 20th.
|
|
56
|
-
* In
|
|
55
|
+
* In 2024 this equals to 1944 - 2043
|
|
57
56
|
*/
|
|
58
57
|
allowTwoDigitYear?: boolean;
|
|
59
|
-
/**
|
|
60
|
-
* Will be removed in a future major-version
|
|
61
|
-
* @deprecated
|
|
62
|
-
*/
|
|
63
|
-
openOnFocus?: false;
|
|
64
58
|
}
|
|
65
59
|
|
|
66
60
|
interface UseDatepickerValue {
|
|
@@ -39,14 +39,9 @@ export interface UseMonthPickerOptions
|
|
|
39
39
|
* Allows input of with 'yy' year format.
|
|
40
40
|
* @default true
|
|
41
41
|
* @Note Decision between 20th and 21st century is based on before(todays year - 80) ? 21st : 20th.
|
|
42
|
-
* In
|
|
42
|
+
* In 2024 this equals to 1944 - 2043
|
|
43
43
|
*/
|
|
44
44
|
allowTwoDigitYear?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Will be removed in a future major-version
|
|
47
|
-
* @deprecated
|
|
48
|
-
*/
|
|
49
|
-
openOnFocus?: boolean;
|
|
50
45
|
}
|
|
51
46
|
|
|
52
47
|
interface UseMonthPickerValue {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
isBefore as checkIsBefore,
|
|
3
|
+
differenceInCalendarDays,
|
|
4
|
+
isWeekend,
|
|
5
|
+
} from "date-fns";
|
|
4
6
|
import React, { useState } from "react";
|
|
5
7
|
import { DateRange, isMatch } from "react-day-picker";
|
|
6
8
|
import { DatePickerProps } from "../datepicker/DatePicker";
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import {
|
|
3
|
+
compareAsc,
|
|
4
|
+
compareDesc,
|
|
5
|
+
format,
|
|
6
|
+
isSameMonth,
|
|
7
|
+
setYear,
|
|
8
|
+
} from "date-fns";
|
|
7
9
|
import React, { useEffect, useRef } from "react";
|
|
8
10
|
import { useDayPicker } from "react-day-picker";
|
|
9
11
|
import { useSharedMonthContext } from "../context";
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import {
|
|
2
|
+
isAfter,
|
|
3
|
+
isBefore,
|
|
4
|
+
setYear,
|
|
5
|
+
startOfMonth,
|
|
6
|
+
startOfYear,
|
|
7
|
+
} from "date-fns";
|
|
5
8
|
import React from "react";
|
|
6
9
|
import { useDayPicker } from "react-day-picker";
|
|
7
10
|
import { ArrowLeftIcon, ArrowRightIcon } from "@navikt/aksel-icons";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
2
|
import React, { forwardRef, useRef, useState } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { DayPickerProvider } from "react-day-picker";
|
|
4
4
|
import { useId } from "../../util/hooks";
|
|
5
5
|
import { useMergeRefs } from "../../util/hooks/useMergeRefs";
|
|
6
6
|
import { DateContext, SharedMonthProvider } from "../context";
|
|
@@ -127,12 +127,14 @@ export const MonthPicker = forwardRef<HTMLDivElement, MonthPickerProps>(
|
|
|
127
127
|
strategy,
|
|
128
128
|
}}
|
|
129
129
|
>
|
|
130
|
-
<
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
130
|
+
<DayPickerProvider
|
|
131
|
+
initialProps={{
|
|
132
|
+
locale: getLocaleFromString(locale),
|
|
133
|
+
selected: selected ?? selectedMonth,
|
|
134
|
+
toDate,
|
|
135
|
+
fromDate,
|
|
136
|
+
month: selected ?? selectedMonth,
|
|
137
|
+
}}
|
|
136
138
|
>
|
|
137
139
|
<div className={cl("rdp-month", className)}>
|
|
138
140
|
<SharedMonthProvider
|
|
@@ -147,7 +149,7 @@ export const MonthPicker = forwardRef<HTMLDivElement, MonthPickerProps>(
|
|
|
147
149
|
<MonthSelector />
|
|
148
150
|
</SharedMonthProvider>
|
|
149
151
|
</div>
|
|
150
|
-
</
|
|
152
|
+
</DayPickerProvider>
|
|
151
153
|
</DateWrapper>
|
|
152
154
|
</div>
|
|
153
155
|
</DateContext.Provider>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
2
|
import React, { forwardRef, useState } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { DayPickerProvider } from "react-day-picker";
|
|
4
4
|
import { SharedMonthProvider } from "../context";
|
|
5
5
|
import { getLocaleFromString } from "../utils";
|
|
6
6
|
import MonthCaption from "./MonthCaption";
|
|
@@ -58,12 +58,14 @@ export const MonthPickerStandalone = forwardRef<
|
|
|
58
58
|
|
|
59
59
|
return (
|
|
60
60
|
<div ref={ref} className={cl("navds-date__wrapper", className)}>
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
<DayPickerProvider
|
|
62
|
+
initialProps={{
|
|
63
|
+
locale: getLocaleFromString(locale),
|
|
64
|
+
selected: selected ?? selectedMonth,
|
|
65
|
+
toDate,
|
|
66
|
+
fromDate,
|
|
67
|
+
month: selected ?? selectedMonth,
|
|
68
|
+
}}
|
|
67
69
|
>
|
|
68
70
|
<div className="navds-date rdp-month">
|
|
69
71
|
<SharedMonthProvider
|
|
@@ -78,7 +80,7 @@ export const MonthPickerStandalone = forwardRef<
|
|
|
78
80
|
<MonthSelector />
|
|
79
81
|
</SharedMonthProvider>
|
|
80
82
|
</div>
|
|
81
|
-
</
|
|
83
|
+
</DayPickerProvider>
|
|
82
84
|
</div>
|
|
83
85
|
);
|
|
84
86
|
},
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import isSameMonth from "date-fns
|
|
2
|
-
import setMonth from "date-fns/setMonth";
|
|
3
|
-
import setYear from "date-fns/setYear";
|
|
4
|
-
import startOfMonth from "date-fns/startOfMonth";
|
|
1
|
+
import { isSameMonth, setMonth, setYear, startOfMonth } from "date-fns";
|
|
5
2
|
import React, { useState } from "react";
|
|
6
3
|
import { BodyShort } from "../../typography";
|
|
7
4
|
import { useSharedMonthContext } from "../context";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Meta, StoryFn } from "@storybook/react";
|
|
2
|
-
import setYear from "date-fns
|
|
2
|
+
import { setYear } from "date-fns";
|
|
3
3
|
import React, { useId, useState } from "react";
|
|
4
|
-
import { Button
|
|
4
|
+
import { Button } from "../../button";
|
|
5
5
|
import { useMonthpicker } from "../hooks";
|
|
6
|
+
import { DateInputProps } from "../parts/DateInput";
|
|
6
7
|
import MonthPicker from "./MonthPicker";
|
|
7
8
|
import { MonthPickerProps } from "./types";
|
|
8
9
|
|
|
@@ -22,7 +23,7 @@ export const Default: StoryFn<{
|
|
|
22
23
|
|
|
23
24
|
return (
|
|
24
25
|
<div style={{ height: "20rem" }}>
|
|
25
|
-
<MonthPicker {...monthpickerProps}>
|
|
26
|
+
<MonthPicker {...monthpickerProps} onMonthSelect={console.log}>
|
|
26
27
|
<MonthPicker.Input
|
|
27
28
|
label="Velg måned"
|
|
28
29
|
variant="monthpicker"
|
|
@@ -47,6 +48,7 @@ Default.argTypes = {
|
|
|
47
48
|
export const DropdownCaption = () => {
|
|
48
49
|
return (
|
|
49
50
|
<MonthPicker.Standalone
|
|
51
|
+
onMonthSelect={console.log}
|
|
50
52
|
dropdownCaption
|
|
51
53
|
fromDate={new Date("Feb 10 2019")}
|
|
52
54
|
toDate={new Date("Sep 27 2032")}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { useRef } from "react";
|
|
3
3
|
import { Button } from "../../button";
|
|
4
4
|
import { Modal } from "../../modal";
|
|
5
|
-
import {
|
|
5
|
+
import { useModalContext } from "../../modal/Modal.context";
|
|
6
6
|
import { Popover } from "../../popover";
|
|
7
7
|
import { useMedia } from "../../util/hooks";
|
|
8
8
|
import { modalCloseButtonLabel, modalLabel } from "../utils/labels";
|
|
@@ -30,7 +30,7 @@ export const DateWrapper = ({
|
|
|
30
30
|
popoverProps,
|
|
31
31
|
}: DateWrapperProps) => {
|
|
32
32
|
const modalRef = useRef<HTMLDialogElement>(null);
|
|
33
|
-
const isInModal =
|
|
33
|
+
const isInModal = useModalContext(false) !== undefined;
|
|
34
34
|
const hideModal =
|
|
35
35
|
useMedia("screen and (min-width: 768px)", true) && !isInModal;
|
|
36
36
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable jest/expect-expect */
|
|
2
|
-
import getMonth from "date-fns
|
|
3
|
-
import nb from "date-fns/locale
|
|
2
|
+
import { getMonth } from "date-fns";
|
|
3
|
+
import { nb } from "date-fns/locale";
|
|
4
4
|
import { isValidDate, parseDate } from "..";
|
|
5
5
|
|
|
6
6
|
const check = (inp: string) =>
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import {
|
|
2
|
+
isSameYear,
|
|
3
|
+
setMonth,
|
|
4
|
+
setYear,
|
|
5
|
+
startOfMonth,
|
|
6
|
+
startOfYear,
|
|
7
|
+
} from "date-fns";
|
|
6
8
|
|
|
7
9
|
export const getMonths = (start: Date, end: Date, current: Date): Date[] => {
|
|
8
10
|
const dropdownMonths: Date[] = [];
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import {
|
|
2
|
+
differenceInCalendarDays,
|
|
3
|
+
isDate,
|
|
4
|
+
isSameDay,
|
|
5
|
+
isSameMonth,
|
|
6
|
+
} from "date-fns";
|
|
5
7
|
import {
|
|
6
8
|
DateAfter,
|
|
7
9
|
DateBefore,
|
package/src/date/utils/labels.ts
CHANGED
package/src/date/utils/locale.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import isBefore from "date-fns
|
|
2
|
-
import parse from "date-fns/parse";
|
|
3
|
-
import sub from "date-fns/sub";
|
|
1
|
+
import { Locale, isBefore, parse, sub } from "date-fns";
|
|
4
2
|
import { isValidDate } from "./check-dates";
|
|
5
3
|
|
|
6
4
|
export const INPUT_DATE_STRING_FORMAT_DATE = "dd.MM.yyyy";
|
package/src/form/Textarea.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import React, { forwardRef, useState } from "react";
|
|
|
3
3
|
import { BodyShort, ErrorMessage, Label } from "../typography";
|
|
4
4
|
import { omit } from "../util";
|
|
5
5
|
import TextareaAutosize from "../util/TextareaAutoSize";
|
|
6
|
+
import { composeEventHandlers } from "../util/composeEventHandlers";
|
|
6
7
|
import { useId } from "../util/hooks";
|
|
7
8
|
import { ReadOnlyIcon } from "./ReadOnlyIcon";
|
|
8
9
|
import Counter from "./TextareaCounter";
|
|
@@ -102,7 +103,7 @@ export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
|
102
103
|
const maxLengthId = useId();
|
|
103
104
|
const hasMaxLength = maxLength !== undefined && maxLength > 0;
|
|
104
105
|
|
|
105
|
-
const [
|
|
106
|
+
const [uncontrolledValue, setUncontrolledValue] = useState(
|
|
106
107
|
props?.defaultValue ?? "",
|
|
107
108
|
);
|
|
108
109
|
|
|
@@ -157,40 +158,39 @@ export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
|
157
158
|
{description}
|
|
158
159
|
</BodyShort>
|
|
159
160
|
)}
|
|
160
|
-
<
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
onChange
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
minRows={getMinRows()}
|
|
170
|
-
autoScrollbar={UNSAFE_autoScrollbar}
|
|
171
|
-
ref={ref}
|
|
172
|
-
readOnly={readOnly}
|
|
173
|
-
className={cl(
|
|
174
|
-
"navds-textarea__input",
|
|
175
|
-
"navds-body-short",
|
|
176
|
-
`navds-body-short--${size ?? "medium"}`,
|
|
177
|
-
)}
|
|
178
|
-
{...(describedBy ? { "aria-describedby": describedBy } : {})}
|
|
179
|
-
/>
|
|
180
|
-
{hasMaxLength && !readOnly && !inputProps.disabled && (
|
|
181
|
-
<>
|
|
182
|
-
<span id={maxLengthId} className="navds-sr-only">
|
|
183
|
-
{`Tekstområde med plass til ${maxLength} tegn.`}
|
|
184
|
-
</span>
|
|
185
|
-
<Counter
|
|
186
|
-
maxLength={maxLength}
|
|
187
|
-
currentLength={props.value?.length ?? controlledValue?.length}
|
|
188
|
-
size={size}
|
|
189
|
-
i18n={i18n}
|
|
190
|
-
/>
|
|
191
|
-
</>
|
|
161
|
+
<TextareaAutosize
|
|
162
|
+
{...omit(rest, ["error", "errorId", "size"])}
|
|
163
|
+
{...inputProps}
|
|
164
|
+
onChange={composeEventHandlers(
|
|
165
|
+
props.onChange,
|
|
166
|
+
props.value === undefined
|
|
167
|
+
? (e) => setUncontrolledValue(e.target.value)
|
|
168
|
+
: undefined,
|
|
192
169
|
)}
|
|
193
|
-
|
|
170
|
+
minRows={getMinRows()}
|
|
171
|
+
autoScrollbar={UNSAFE_autoScrollbar}
|
|
172
|
+
ref={ref}
|
|
173
|
+
readOnly={readOnly}
|
|
174
|
+
className={cl(
|
|
175
|
+
"navds-textarea__input",
|
|
176
|
+
"navds-body-short",
|
|
177
|
+
`navds-body-short--${size ?? "medium"}`,
|
|
178
|
+
)}
|
|
179
|
+
{...(describedBy ? { "aria-describedby": describedBy } : {})}
|
|
180
|
+
/>
|
|
181
|
+
{hasMaxLength && !readOnly && !inputProps.disabled && (
|
|
182
|
+
<>
|
|
183
|
+
<span id={maxLengthId} className="navds-sr-only">
|
|
184
|
+
{`Tekstområde med plass til ${maxLength} tegn.`}
|
|
185
|
+
</span>
|
|
186
|
+
<Counter
|
|
187
|
+
maxLength={maxLength}
|
|
188
|
+
currentLength={props.value?.length ?? uncontrolledValue.length}
|
|
189
|
+
size={size}
|
|
190
|
+
i18n={i18n}
|
|
191
|
+
/>
|
|
192
|
+
</>
|
|
193
|
+
)}
|
|
194
194
|
<div
|
|
195
195
|
className="navds-form-field__error"
|
|
196
196
|
id={errorId}
|
|
@@ -89,7 +89,7 @@ export const Combobox = forwardRef<
|
|
|
89
89
|
"navds-combobox__wrapper-inner navds-text-field__input",
|
|
90
90
|
{
|
|
91
91
|
"navds-combobox__wrapper-inner--virtually-unfocused":
|
|
92
|
-
activeDecendantId !==
|
|
92
|
+
activeDecendantId !== undefined,
|
|
93
93
|
},
|
|
94
94
|
)}
|
|
95
95
|
onClick={focusInput}
|
|
@@ -43,6 +43,7 @@ const ComboboxProvider = forwardRef<HTMLInputElement, ComboboxProps>(
|
|
|
43
43
|
isMultiSelect,
|
|
44
44
|
onToggleSelected,
|
|
45
45
|
selectedOptions,
|
|
46
|
+
maxSelected,
|
|
46
47
|
options,
|
|
47
48
|
value,
|
|
48
49
|
onChange,
|
|
@@ -71,6 +72,7 @@ const ComboboxProvider = forwardRef<HTMLInputElement, ComboboxProps>(
|
|
|
71
72
|
allowNewValues,
|
|
72
73
|
isMultiSelect,
|
|
73
74
|
selectedOptions,
|
|
75
|
+
maxSelected,
|
|
74
76
|
onToggleSelected,
|
|
75
77
|
options,
|
|
76
78
|
}}
|