@navikt/ds-react 7.6.0 → 7.8.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/chips/Removable.d.ts +0 -5
- package/cjs/chips/Removable.js +2 -2
- package/cjs/chips/Removable.js.map +1 -1
- package/cjs/copybutton/CopyButton.d.ts +1 -6
- package/cjs/copybutton/CopyButton.js +8 -6
- package/cjs/copybutton/CopyButton.js.map +1 -1
- package/cjs/date/context/index.d.ts +2 -1
- package/cjs/date/context/index.js +5 -2
- package/cjs/date/context/index.js.map +1 -1
- package/cjs/date/context/useDateInputContext.d.ts +3 -3
- package/cjs/date/context/useDateInputContext.js +4 -4
- package/cjs/date/context/useDateInputContext.js.map +1 -1
- package/cjs/date/context/useDateTranslationContext.d.ts +8 -0
- package/cjs/date/context/useDateTranslationContext.js +7 -0
- package/cjs/date/context/useDateTranslationContext.js.map +1 -0
- package/cjs/date/datepicker/DatePicker.js +18 -16
- package/cjs/date/datepicker/DatePicker.js.map +1 -1
- package/cjs/date/datepicker/DatePickerStandalone.js +17 -14
- package/cjs/date/datepicker/DatePickerStandalone.js.map +1 -1
- package/cjs/date/datepicker/parts/Caption.js +2 -3
- package/cjs/date/datepicker/parts/Caption.js.map +1 -1
- package/cjs/date/datepicker/parts/DropdownCaption.js +2 -2
- package/cjs/date/datepicker/parts/DropdownCaption.js.map +1 -1
- package/cjs/date/datepicker/parts/WeekNumber.js +14 -6
- package/cjs/date/datepicker/parts/WeekNumber.js.map +1 -1
- package/cjs/date/datepicker/parts/WeekRow.js +2 -3
- package/cjs/date/datepicker/parts/WeekRow.js.map +1 -1
- package/cjs/date/datepicker/types.d.ts +8 -0
- package/cjs/date/monthpicker/MonthCaption.js +1 -3
- package/cjs/date/monthpicker/MonthCaption.js.map +1 -1
- package/cjs/date/monthpicker/MonthPicker.js +30 -28
- package/cjs/date/monthpicker/MonthPicker.js.map +1 -1
- package/cjs/date/monthpicker/MonthPickerStandalone.js +16 -12
- package/cjs/date/monthpicker/MonthPickerStandalone.js.map +1 -1
- package/cjs/date/monthpicker/types.d.ts +8 -0
- package/cjs/date/parts/DateInput.js +1 -2
- package/cjs/date/parts/DateInput.js.map +1 -1
- package/cjs/date/parts/DateWrapper.d.ts +3 -1
- package/cjs/date/parts/DateWrapper.js +3 -3
- package/cjs/date/parts/DateWrapper.js.map +1 -1
- package/cjs/date/utils/index.d.ts +1 -1
- package/cjs/date/utils/index.js +2 -1
- package/cjs/date/utils/index.js.map +1 -1
- package/cjs/date/utils/locale.d.ts +12 -2
- package/cjs/date/utils/locale.js +18 -2
- package/cjs/date/utils/locale.js.map +1 -1
- package/cjs/form/combobox/Combobox.d.ts +1 -1
- package/cjs/form/combobox/ComboboxWrapper.js +6 -6
- package/cjs/form/combobox/ComboboxWrapper.js.map +1 -1
- package/cjs/form/combobox/FilteredOptions/AddNewOption.js +3 -1
- package/cjs/form/combobox/FilteredOptions/AddNewOption.js.map +1 -1
- package/cjs/form/combobox/FilteredOptions/FilteredOptions.js +4 -4
- package/cjs/form/combobox/FilteredOptions/FilteredOptions.js.map +1 -1
- package/cjs/form/combobox/FilteredOptions/FilteredOptionsItem.js +1 -1
- package/cjs/form/combobox/FilteredOptions/FilteredOptionsItem.js.map +1 -1
- package/cjs/form/combobox/FilteredOptions/LoadingMessage.js +3 -1
- package/cjs/form/combobox/FilteredOptions/LoadingMessage.js.map +1 -1
- package/cjs/form/combobox/FilteredOptions/MaxSelectedMessage.d.ts +1 -1
- package/cjs/form/combobox/FilteredOptions/MaxSelectedMessage.js +6 -5
- package/cjs/form/combobox/FilteredOptions/MaxSelectedMessage.js.map +1 -1
- package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.js +4 -4
- package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.js.map +1 -1
- package/cjs/form/combobox/Input/Input.context.d.ts +1 -1
- package/cjs/form/combobox/Input/Input.context.js.map +1 -1
- package/cjs/form/combobox/Input/Input.js +1 -1
- package/cjs/form/combobox/Input/Input.js.map +1 -1
- package/cjs/form/combobox/Input/InputController.d.ts +1 -1
- package/cjs/form/combobox/Input/InputController.js +10 -10
- package/cjs/form/combobox/Input/InputController.js.map +1 -1
- package/cjs/form/combobox/Input/ToggleListButton.d.ts +1 -4
- package/cjs/form/combobox/Input/ToggleListButton.js +3 -5
- package/cjs/form/combobox/Input/ToggleListButton.js.map +1 -1
- package/cjs/form/combobox/SelectedOptions/SelectedOptions.js +8 -6
- package/cjs/form/combobox/SelectedOptions/SelectedOptions.js.map +1 -1
- package/cjs/form/combobox/SelectedOptions/selectedOptionsContext.d.ts +2 -1
- package/cjs/form/combobox/SelectedOptions/selectedOptionsContext.js +9 -5
- package/cjs/form/combobox/SelectedOptions/selectedOptionsContext.js.map +1 -1
- package/cjs/form/combobox/types.d.ts +7 -22
- package/cjs/form/form-summary/FormSummaryEditLink.js +4 -2
- package/cjs/form/form-summary/FormSummaryEditLink.js.map +1 -1
- package/cjs/form/search/Search.d.ts +2 -1
- package/cjs/form/search/Search.js +8 -3
- package/cjs/form/search/Search.js.map +1 -1
- package/cjs/form/textarea/Textarea.d.ts +1 -0
- package/cjs/form/textarea/Textarea.js.map +1 -1
- package/cjs/guide-panel/GuidePanel.js +11 -3
- package/cjs/guide-panel/GuidePanel.js.map +1 -1
- package/cjs/guide-panel/Illustration.d.ts +2 -8
- package/cjs/guide-panel/Illustration.darkside.d.ts +2 -0
- package/cjs/guide-panel/Illustration.darkside.js +30 -0
- package/cjs/guide-panel/Illustration.darkside.js.map +1 -0
- package/cjs/guide-panel/Illustration.js +4 -18
- package/cjs/guide-panel/Illustration.js.map +1 -1
- package/cjs/guide-panel/index.d.ts +0 -1
- package/cjs/guide-panel/index.js +1 -3
- package/cjs/guide-panel/index.js.map +1 -1
- package/cjs/help-text/HelpText.d.ts +1 -1
- package/cjs/help-text/HelpText.js +6 -3
- package/cjs/help-text/HelpText.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +2 -3
- package/cjs/index.js.map +1 -1
- package/cjs/internal-header/InternalHeaderButton.d.ts +1 -1
- package/cjs/internal-header/InternalHeaderUserButton.d.ts +1 -1
- package/cjs/internal-header/InternalHeaderUserButton.js +1 -1
- package/cjs/internal-header/InternalHeaderUserButton.js.map +1 -1
- package/cjs/layout/base/BasePrimitive.js +4 -1
- package/cjs/layout/base/BasePrimitive.js.map +1 -1
- package/cjs/layout/bleed/Bleed.js +5 -2
- package/cjs/layout/bleed/Bleed.js.map +1 -1
- package/cjs/layout/box/Box.d.ts +6 -1
- package/cjs/layout/box/Box.darkside.d.ts +70 -0
- package/cjs/layout/box/Box.darkside.js +98 -0
- package/cjs/layout/box/Box.darkside.js.map +1 -0
- package/cjs/layout/box/Box.js +19 -6
- package/cjs/layout/box/Box.js.map +1 -1
- package/cjs/layout/box/index.js +2 -0
- package/cjs/layout/box/index.js.map +1 -1
- package/cjs/layout/grid/HGrid.js +4 -1
- package/cjs/layout/grid/HGrid.js.map +1 -1
- package/cjs/layout/page/Page.d.ts +1 -0
- package/cjs/layout/page/Page.js +5 -0
- package/cjs/layout/page/Page.js.map +1 -1
- package/cjs/layout/stack/Stack.js +4 -1
- package/cjs/layout/stack/Stack.js.map +1 -1
- package/cjs/layout/utilities/css.d.ts +2 -2
- package/cjs/layout/utilities/css.js +8 -9
- package/cjs/layout/utilities/css.js.map +1 -1
- package/cjs/layout/utilities/types.d.ts +10 -0
- package/cjs/modal/Modal.js +1 -1
- package/cjs/modal/Modal.js.map +1 -1
- package/cjs/modal/ModalHeader.js +1 -1
- package/cjs/modal/ModalHeader.js.map +1 -1
- package/cjs/popover/Popover.js +1 -1
- package/cjs/popover/Popover.js.map +1 -1
- package/cjs/provider/Provider.d.ts +35 -10
- package/cjs/provider/Provider.js +13 -14
- package/cjs/provider/Provider.js.map +1 -1
- package/cjs/table/ExpandableRow.js +3 -3
- package/cjs/table/ExpandableRow.js.map +1 -1
- package/cjs/tabs/Tabs.context.d.ts +1 -1
- package/cjs/timeline/Timeline.d.ts +1 -0
- package/cjs/timeline/Timeline.js.map +1 -1
- package/cjs/util/i18n/i18n.context.d.ts +1 -1
- package/cjs/util/i18n/i18n.context.js +15 -14
- package/cjs/util/i18n/i18n.context.js.map +1 -1
- package/cjs/util/i18n/locales/en.d.ts +51 -36
- package/cjs/util/i18n/locales/en.js +52 -37
- package/cjs/util/i18n/locales/en.js.map +1 -1
- package/cjs/util/i18n/locales/index.d.ts +3 -0
- package/cjs/util/i18n/locales/index.js +14 -0
- package/cjs/util/i18n/locales/index.js.map +1 -0
- package/cjs/util/i18n/locales/nb.d.ts +54 -37
- package/cjs/util/i18n/locales/nb.js +56 -39
- package/cjs/util/i18n/locales/nb.js.map +1 -1
- package/cjs/util/i18n/locales/nn.d.ts +51 -36
- package/cjs/util/i18n/locales/nn.js +52 -37
- package/cjs/util/i18n/locales/nn.js.map +1 -1
- package/esm/chips/Removable.d.ts +0 -5
- package/esm/chips/Removable.js +2 -2
- package/esm/chips/Removable.js.map +1 -1
- package/esm/copybutton/CopyButton.d.ts +1 -6
- package/esm/copybutton/CopyButton.js +8 -6
- package/esm/copybutton/CopyButton.js.map +1 -1
- package/esm/date/context/index.d.ts +2 -1
- package/esm/date/context/index.js +2 -1
- package/esm/date/context/index.js.map +1 -1
- package/esm/date/context/useDateInputContext.d.ts +3 -3
- package/esm/date/context/useDateInputContext.js +3 -3
- package/esm/date/context/useDateInputContext.js.map +1 -1
- package/esm/date/context/useDateTranslationContext.d.ts +8 -0
- package/esm/date/context/useDateTranslationContext.js +3 -0
- package/esm/date/context/useDateTranslationContext.js.map +1 -0
- package/esm/date/datepicker/DatePicker.js +21 -19
- package/esm/date/datepicker/DatePicker.js.map +1 -1
- package/esm/date/datepicker/DatePickerStandalone.js +19 -16
- package/esm/date/datepicker/DatePickerStandalone.js.map +1 -1
- package/esm/date/datepicker/parts/Caption.js +2 -3
- package/esm/date/datepicker/parts/Caption.js.map +1 -1
- package/esm/date/datepicker/parts/DropdownCaption.js +3 -3
- package/esm/date/datepicker/parts/DropdownCaption.js.map +1 -1
- package/esm/date/datepicker/parts/WeekNumber.js +15 -7
- package/esm/date/datepicker/parts/WeekNumber.js.map +1 -1
- package/esm/date/datepicker/parts/WeekRow.js +2 -3
- package/esm/date/datepicker/parts/WeekRow.js.map +1 -1
- package/esm/date/datepicker/types.d.ts +8 -0
- package/esm/date/monthpicker/MonthCaption.js +2 -4
- package/esm/date/monthpicker/MonthCaption.js.map +1 -1
- package/esm/date/monthpicker/MonthPicker.js +33 -31
- package/esm/date/monthpicker/MonthPicker.js.map +1 -1
- package/esm/date/monthpicker/MonthPickerStandalone.js +18 -14
- package/esm/date/monthpicker/MonthPickerStandalone.js.map +1 -1
- package/esm/date/monthpicker/types.d.ts +8 -0
- package/esm/date/parts/DateInput.js +2 -3
- package/esm/date/parts/DateInput.js.map +1 -1
- package/esm/date/parts/DateWrapper.d.ts +3 -1
- package/esm/date/parts/DateWrapper.js +4 -4
- package/esm/date/parts/DateWrapper.js.map +1 -1
- package/esm/date/utils/index.d.ts +1 -1
- package/esm/date/utils/index.js +1 -1
- package/esm/date/utils/index.js.map +1 -1
- package/esm/date/utils/locale.d.ts +12 -2
- package/esm/date/utils/locale.js +16 -1
- package/esm/date/utils/locale.js.map +1 -1
- package/esm/form/combobox/Combobox.d.ts +1 -1
- package/esm/form/combobox/ComboboxWrapper.js +6 -6
- package/esm/form/combobox/ComboboxWrapper.js.map +1 -1
- package/esm/form/combobox/FilteredOptions/AddNewOption.js +3 -1
- package/esm/form/combobox/FilteredOptions/AddNewOption.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/FilteredOptionsItem.js +1 -1
- package/esm/form/combobox/FilteredOptions/FilteredOptionsItem.js.map +1 -1
- package/esm/form/combobox/FilteredOptions/LoadingMessage.js +3 -1
- package/esm/form/combobox/FilteredOptions/LoadingMessage.js.map +1 -1
- package/esm/form/combobox/FilteredOptions/MaxSelectedMessage.d.ts +1 -1
- package/esm/form/combobox/FilteredOptions/MaxSelectedMessage.js +6 -5
- package/esm/form/combobox/FilteredOptions/MaxSelectedMessage.js.map +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/Input/Input.context.d.ts +1 -1
- package/esm/form/combobox/Input/Input.context.js.map +1 -1
- package/esm/form/combobox/Input/Input.js +1 -1
- package/esm/form/combobox/Input/Input.js.map +1 -1
- package/esm/form/combobox/Input/InputController.d.ts +1 -1
- package/esm/form/combobox/Input/InputController.js +10 -10
- package/esm/form/combobox/Input/InputController.js.map +1 -1
- package/esm/form/combobox/Input/ToggleListButton.d.ts +1 -4
- package/esm/form/combobox/Input/ToggleListButton.js +3 -5
- package/esm/form/combobox/Input/ToggleListButton.js.map +1 -1
- package/esm/form/combobox/SelectedOptions/SelectedOptions.js +8 -6
- package/esm/form/combobox/SelectedOptions/SelectedOptions.js.map +1 -1
- package/esm/form/combobox/SelectedOptions/selectedOptionsContext.d.ts +2 -1
- package/esm/form/combobox/SelectedOptions/selectedOptionsContext.js +9 -5
- package/esm/form/combobox/SelectedOptions/selectedOptionsContext.js.map +1 -1
- package/esm/form/combobox/types.d.ts +7 -22
- package/esm/form/form-summary/FormSummaryEditLink.js +4 -2
- package/esm/form/form-summary/FormSummaryEditLink.js.map +1 -1
- package/esm/form/search/Search.d.ts +2 -1
- package/esm/form/search/Search.js +8 -3
- package/esm/form/search/Search.js.map +1 -1
- package/esm/form/textarea/Textarea.d.ts +1 -0
- package/esm/form/textarea/Textarea.js.map +1 -1
- package/esm/guide-panel/GuidePanel.js +11 -3
- package/esm/guide-panel/GuidePanel.js.map +1 -1
- package/esm/guide-panel/Illustration.d.ts +2 -8
- package/esm/guide-panel/Illustration.darkside.d.ts +2 -0
- package/esm/guide-panel/Illustration.darkside.js +23 -0
- package/esm/guide-panel/Illustration.darkside.js.map +1 -0
- package/esm/guide-panel/Illustration.js +4 -18
- package/esm/guide-panel/Illustration.js.map +1 -1
- package/esm/guide-panel/index.d.ts +0 -1
- package/esm/guide-panel/index.js +0 -1
- package/esm/guide-panel/index.js.map +1 -1
- package/esm/help-text/HelpText.d.ts +1 -1
- package/esm/help-text/HelpText.js +6 -3
- package/esm/help-text/HelpText.js.map +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/esm/internal-header/InternalHeaderButton.d.ts +1 -1
- package/esm/internal-header/InternalHeaderUserButton.d.ts +1 -1
- package/esm/internal-header/InternalHeaderUserButton.js +1 -1
- package/esm/internal-header/InternalHeaderUserButton.js.map +1 -1
- package/esm/layout/base/BasePrimitive.js +4 -1
- package/esm/layout/base/BasePrimitive.js.map +1 -1
- package/esm/layout/bleed/Bleed.js +5 -2
- package/esm/layout/bleed/Bleed.js.map +1 -1
- package/esm/layout/box/Box.d.ts +6 -1
- package/esm/layout/box/Box.darkside.d.ts +70 -0
- package/esm/layout/box/Box.darkside.js +69 -0
- package/esm/layout/box/Box.darkside.js.map +1 -0
- package/esm/layout/box/Box.js +18 -5
- package/esm/layout/box/Box.js.map +1 -1
- package/esm/layout/grid/HGrid.js +4 -1
- package/esm/layout/grid/HGrid.js.map +1 -1
- package/esm/layout/page/Page.d.ts +1 -0
- package/esm/layout/page/Page.js +5 -0
- package/esm/layout/page/Page.js.map +1 -1
- package/esm/layout/stack/Stack.js +4 -1
- package/esm/layout/stack/Stack.js.map +1 -1
- package/esm/layout/utilities/css.d.ts +2 -2
- package/esm/layout/utilities/css.js +8 -9
- package/esm/layout/utilities/css.js.map +1 -1
- package/esm/layout/utilities/types.d.ts +10 -0
- package/esm/modal/Modal.js +2 -2
- package/esm/modal/Modal.js.map +1 -1
- package/esm/modal/ModalHeader.js +1 -1
- package/esm/modal/ModalHeader.js.map +1 -1
- package/esm/popover/Popover.js +2 -2
- package/esm/popover/Popover.js.map +1 -1
- package/esm/provider/Provider.d.ts +35 -10
- package/esm/provider/Provider.js +11 -15
- package/esm/provider/Provider.js.map +1 -1
- package/esm/table/ExpandableRow.js +3 -3
- package/esm/table/ExpandableRow.js.map +1 -1
- package/esm/tabs/Tabs.context.d.ts +1 -1
- package/esm/timeline/Timeline.d.ts +1 -0
- package/esm/timeline/Timeline.js.map +1 -1
- package/esm/util/i18n/i18n.context.d.ts +1 -1
- package/esm/util/i18n/i18n.context.js +15 -14
- package/esm/util/i18n/i18n.context.js.map +1 -1
- package/esm/util/i18n/locales/en.d.ts +51 -36
- package/esm/util/i18n/locales/en.js +52 -37
- package/esm/util/i18n/locales/en.js.map +1 -1
- package/esm/util/i18n/locales/index.d.ts +3 -0
- package/esm/util/i18n/locales/index.js +5 -0
- package/esm/util/i18n/locales/index.js.map +1 -0
- package/esm/util/i18n/locales/nb.d.ts +54 -37
- package/esm/util/i18n/locales/nb.js +56 -39
- package/esm/util/i18n/locales/nb.js.map +1 -1
- package/esm/util/i18n/locales/nn.d.ts +51 -36
- package/esm/util/i18n/locales/nn.js +52 -37
- package/esm/util/i18n/locales/nn.js.map +1 -1
- package/package.json +13 -3
- package/src/chips/Removable.tsx +1 -9
- package/src/copybutton/CopyButton.tsx +14 -30
- package/src/date/context/index.ts +5 -1
- package/src/date/context/useDateInputContext.tsx +6 -4
- package/src/date/context/useDateTranslationContext.ts +9 -0
- package/src/date/datepicker/DatePicker.tsx +41 -32
- package/src/date/datepicker/DatePickerStandalone.tsx +46 -37
- package/src/date/datepicker/parts/Caption.tsx +2 -3
- package/src/date/datepicker/parts/DropdownCaption.tsx +3 -3
- package/src/date/datepicker/parts/WeekNumber.tsx +34 -15
- package/src/date/datepicker/parts/WeekRow.tsx +2 -3
- package/src/date/datepicker/types.ts +8 -0
- package/src/date/monthpicker/MonthCaption.tsx +2 -4
- package/src/date/monthpicker/MonthPicker.tsx +67 -54
- package/src/date/monthpicker/MonthPickerStandalone.tsx +39 -26
- package/src/date/monthpicker/types.ts +8 -0
- package/src/date/parts/DateInput.tsx +2 -3
- package/src/date/parts/DateWrapper.tsx +6 -4
- package/src/date/utils/index.ts +5 -1
- package/src/date/utils/locale.ts +17 -1
- package/src/form/combobox/ComboboxWrapper.tsx +6 -6
- package/src/form/combobox/FilteredOptions/AddNewOption.tsx +3 -1
- package/src/form/combobox/FilteredOptions/FilteredOptions.tsx +4 -4
- package/src/form/combobox/FilteredOptions/FilteredOptionsItem.tsx +1 -1
- package/src/form/combobox/FilteredOptions/LoadingMessage.tsx +3 -1
- package/src/form/combobox/FilteredOptions/MaxSelectedMessage.tsx +6 -6
- package/src/form/combobox/FilteredOptions/filteredOptionsContext.tsx +4 -4
- package/src/form/combobox/Input/Input.context.tsx +3 -3
- package/src/form/combobox/Input/Input.tsx +1 -1
- package/src/form/combobox/Input/InputController.tsx +5 -27
- package/src/form/combobox/Input/ToggleListButton.tsx +8 -24
- package/src/form/combobox/SelectedOptions/SelectedOptions.tsx +17 -11
- package/src/form/combobox/SelectedOptions/selectedOptionsContext.tsx +10 -7
- package/src/form/combobox/__tests__/combobox.test.tsx +2 -1
- package/src/form/combobox/types.ts +11 -24
- package/src/form/form-summary/FormSummaryEditLink.tsx +7 -6
- package/src/form/search/Search.tsx +35 -13
- package/src/form/textarea/Textarea.tsx +1 -0
- package/src/guide-panel/GuidePanel.tsx +59 -15
- package/src/guide-panel/Illustration.darkside.tsx +96 -0
- package/src/guide-panel/Illustration.tsx +5 -22
- package/src/guide-panel/index.ts +0 -1
- package/src/help-text/HelpText.tsx +8 -6
- package/src/index.ts +1 -5
- package/src/internal-header/InternalHeaderButton.tsx +1 -1
- package/src/internal-header/InternalHeaderUserButton.tsx +2 -2
- package/src/layout/base/BasePrimitive.tsx +29 -25
- package/src/layout/bleed/Bleed.tsx +8 -0
- package/src/layout/box/Box.darkside.tsx +154 -0
- package/src/layout/box/Box.tsx +90 -61
- package/src/layout/box/index.ts +3 -0
- package/src/layout/grid/HGrid.tsx +7 -3
- package/src/layout/page/Page.tsx +10 -0
- package/src/layout/stack/Stack.tsx +8 -4
- package/src/layout/utilities/css.ts +18 -12
- package/src/layout/utilities/types.ts +24 -0
- package/src/modal/Modal.tsx +2 -2
- package/src/modal/ModalHeader.tsx +1 -1
- package/src/popover/Popover.tsx +2 -2
- package/src/provider/Provider.tsx +56 -13
- package/src/table/ExpandableRow.tsx +10 -3
- package/src/timeline/Timeline.tsx +1 -0
- package/src/util/i18n/i18n.context.test.tsx +29 -8
- package/src/util/i18n/i18n.context.ts +15 -14
- package/src/util/i18n/locales/en.ts +52 -37
- package/src/util/i18n/locales/index.ts +4 -0
- package/src/util/i18n/locales/nb.ts +56 -39
- package/src/util/i18n/locales/nn.ts +52 -37
- package/cjs/provider/i18n/LanguageProvider.d.ts +0 -26
- package/cjs/provider/i18n/LanguageProvider.js +0 -54
- package/cjs/provider/i18n/LanguageProvider.js.map +0 -1
- package/esm/provider/i18n/LanguageProvider.d.ts +0 -26
- package/esm/provider/i18n/LanguageProvider.js +0 -23
- package/esm/provider/i18n/LanguageProvider.js.map +0 -1
- package/src/provider/i18n/LanguageProvider.tsx +0 -49
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Locale } from "date-fns";
|
|
2
|
-
import {
|
|
3
|
-
import { LanguageProviderContext } from "../../provider/i18n/LanguageProvider";
|
|
2
|
+
import { useProvider } from "../../provider/Provider";
|
|
4
3
|
import { get } from "./get";
|
|
5
4
|
import {
|
|
6
5
|
Component,
|
|
@@ -28,15 +27,16 @@ export type TFunction<T extends Component> = (
|
|
|
28
27
|
|
|
29
28
|
export function useI18n<T extends Component>(
|
|
30
29
|
componentName: T,
|
|
31
|
-
...
|
|
30
|
+
...localTranslations: (ComponentTranslation<T> | undefined)[]
|
|
32
31
|
) {
|
|
33
|
-
const
|
|
34
|
-
const
|
|
32
|
+
const context = useProvider();
|
|
33
|
+
const contextTranslations = context.translations || [];
|
|
35
34
|
const i18nObjects: (PartialTranslations | undefined)[] = [
|
|
36
|
-
...
|
|
37
|
-
...(Array.isArray(
|
|
38
|
-
?
|
|
39
|
-
: [
|
|
35
|
+
...localTranslations,
|
|
36
|
+
...(Array.isArray(contextTranslations)
|
|
37
|
+
? contextTranslations.map((t) => t[componentName])
|
|
38
|
+
: [contextTranslations[componentName]]),
|
|
39
|
+
context.locale[componentName],
|
|
40
40
|
];
|
|
41
41
|
|
|
42
42
|
/**
|
|
@@ -67,11 +67,12 @@ export function useI18n<T extends Component>(
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
export function useDateLocale() {
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
const i18nObjects = Array.isArray(
|
|
73
|
-
?
|
|
74
|
-
: [
|
|
70
|
+
const context = useProvider();
|
|
71
|
+
const contextTranslations = context.translations || [];
|
|
72
|
+
const i18nObjects = Array.isArray(contextTranslations)
|
|
73
|
+
? contextTranslations.map((t) => t.global)
|
|
74
|
+
: [contextTranslations.global];
|
|
75
|
+
i18nObjects.push(context.locale.global);
|
|
75
76
|
|
|
76
77
|
for (const obj of i18nObjects) {
|
|
77
78
|
if (obj?.dateLocale) {
|
|
@@ -7,8 +7,53 @@ export default {
|
|
|
7
7
|
showMore: "Show more",
|
|
8
8
|
showLess: "Show less",
|
|
9
9
|
readOnly: "Read-only",
|
|
10
|
+
close: "Close",
|
|
10
11
|
},
|
|
11
12
|
|
|
13
|
+
Alert: {
|
|
14
|
+
closeAlert: "Close alert",
|
|
15
|
+
closeMessage: "Close message",
|
|
16
|
+
error: "Error",
|
|
17
|
+
info: "Information",
|
|
18
|
+
success: "Success",
|
|
19
|
+
warning: "Warning",
|
|
20
|
+
},
|
|
21
|
+
Chips: {
|
|
22
|
+
Removable: {
|
|
23
|
+
labelSuffix: "delete",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
Combobox: {
|
|
27
|
+
addOption: "Add",
|
|
28
|
+
loading: "Searching…",
|
|
29
|
+
maxSelected: "{selected} of max {limit} are selected.",
|
|
30
|
+
},
|
|
31
|
+
CopyButton: {
|
|
32
|
+
title: "Copy",
|
|
33
|
+
activeText: "Copied!",
|
|
34
|
+
},
|
|
35
|
+
DatePicker: {
|
|
36
|
+
chooseDate: "Choose date",
|
|
37
|
+
chooseDates: "Choose dates",
|
|
38
|
+
chooseDateRange: "Choose start and end date",
|
|
39
|
+
chooseMonth: "Choose month",
|
|
40
|
+
week: "Week",
|
|
41
|
+
weekNumber: "Week {week}",
|
|
42
|
+
selectWeekNumber: "Select week {week}",
|
|
43
|
+
month: "Month",
|
|
44
|
+
goToNextMonth: "Go to next month",
|
|
45
|
+
goToPreviousMonth: "Go to previous month",
|
|
46
|
+
year: "Year",
|
|
47
|
+
goToNextYear: "Go to next year",
|
|
48
|
+
goToPreviousYear: "Go to previous year",
|
|
49
|
+
openDatePicker: "Open date picker",
|
|
50
|
+
openMonthPicker: "Open month picker",
|
|
51
|
+
closeDatePicker: "Close date picker",
|
|
52
|
+
closeMonthPicker: "Close month picker",
|
|
53
|
+
},
|
|
54
|
+
ErrorSummary: {
|
|
55
|
+
heading: "You must correct the following errors before you can continue:",
|
|
56
|
+
},
|
|
12
57
|
FileUpload: {
|
|
13
58
|
dropzone: {
|
|
14
59
|
button: "Choose file",
|
|
@@ -32,28 +77,18 @@ export default {
|
|
|
32
77
|
showAllSteps: "Show all steps",
|
|
33
78
|
hideAllSteps: "Hide all steps",
|
|
34
79
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
closeMessage: "Close message",
|
|
38
|
-
error: "Error",
|
|
39
|
-
info: "Information",
|
|
40
|
-
success: "Success",
|
|
41
|
-
warning: "Warning",
|
|
80
|
+
FormSummary: {
|
|
81
|
+
editAnswer: "Edit answer",
|
|
42
82
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
labelSuffix: "delete",
|
|
46
|
-
},
|
|
83
|
+
GuidePanel: {
|
|
84
|
+
illustrationLabel: "Illustration of advisor",
|
|
47
85
|
},
|
|
48
|
-
|
|
49
|
-
|
|
86
|
+
HelpText: {
|
|
87
|
+
title: "More information",
|
|
50
88
|
},
|
|
51
89
|
Loader: {
|
|
52
90
|
title: "Waiting…",
|
|
53
91
|
},
|
|
54
|
-
Modal: {
|
|
55
|
-
close: "Close",
|
|
56
|
-
},
|
|
57
92
|
Pagination: {
|
|
58
93
|
previous: "Previous",
|
|
59
94
|
next: "Next",
|
|
@@ -64,7 +99,7 @@ export default {
|
|
|
64
99
|
"Progress is unknown, estimated time is {seconds} seconds.",
|
|
65
100
|
},
|
|
66
101
|
Search: {
|
|
67
|
-
clear: "Clear",
|
|
102
|
+
clear: "Clear field",
|
|
68
103
|
search: "Search",
|
|
69
104
|
},
|
|
70
105
|
Textarea: {
|
|
@@ -97,24 +132,4 @@ export default {
|
|
|
97
132
|
reset: "Reset zoom",
|
|
98
133
|
},
|
|
99
134
|
},
|
|
100
|
-
DatePicker: {
|
|
101
|
-
close: "Close",
|
|
102
|
-
chooseDate: "Choose date",
|
|
103
|
-
chooseDates: "Choose dates",
|
|
104
|
-
chooseDateRange: "Choose start and end date",
|
|
105
|
-
chooseMonth: "Choose month",
|
|
106
|
-
week: "Week",
|
|
107
|
-
weekNumber: "Week {week}",
|
|
108
|
-
selectWeekNumber: "Select week {week}",
|
|
109
|
-
month: "Month",
|
|
110
|
-
goToNextMonth: "Go to next month",
|
|
111
|
-
goToPreviousMonth: "Go to previous month",
|
|
112
|
-
year: "Year",
|
|
113
|
-
goToNextYear: "Go to next year",
|
|
114
|
-
goToPreviousYear: "Go to previous year",
|
|
115
|
-
openDatePicker: "Open date picker",
|
|
116
|
-
openMonthPicker: "Open month picker",
|
|
117
|
-
closeDatePicker: "Close date picker",
|
|
118
|
-
closeMonthPicker: "Close month picker",
|
|
119
|
-
},
|
|
120
135
|
} satisfies Translations;
|
|
@@ -10,8 +10,56 @@ export default {
|
|
|
10
10
|
showMore: "Vis mer",
|
|
11
11
|
showLess: "Vis mindre",
|
|
12
12
|
readOnly: "Skrivebeskyttet",
|
|
13
|
+
close: "Lukk",
|
|
13
14
|
},
|
|
14
15
|
|
|
16
|
+
Alert: {
|
|
17
|
+
closeAlert: "Lukk varsel",
|
|
18
|
+
closeMessage: "Lukk melding",
|
|
19
|
+
error: "Feil",
|
|
20
|
+
info: "Informasjon",
|
|
21
|
+
success: "Suksess",
|
|
22
|
+
warning: "Advarsel",
|
|
23
|
+
},
|
|
24
|
+
Chips: {
|
|
25
|
+
Removable: {
|
|
26
|
+
/** Will be appended to the accessible name for the button. */
|
|
27
|
+
labelSuffix: "slett",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
Combobox: {
|
|
31
|
+
/** The input value will be appended to the end of this text, e.g. `Legg til "input value"`. */
|
|
32
|
+
addOption: "Legg til",
|
|
33
|
+
/** Loader title */
|
|
34
|
+
loading: "Søker…",
|
|
35
|
+
maxSelected: "{selected} av maks {limit} er valgt.",
|
|
36
|
+
},
|
|
37
|
+
CopyButton: {
|
|
38
|
+
title: "Kopier",
|
|
39
|
+
activeText: "Kopiert!",
|
|
40
|
+
},
|
|
41
|
+
DatePicker: {
|
|
42
|
+
chooseDate: "Velg dato",
|
|
43
|
+
chooseDates: "Velg datoer",
|
|
44
|
+
chooseDateRange: "Velg start- og sluttdato",
|
|
45
|
+
chooseMonth: "Velg måned",
|
|
46
|
+
week: "Uke",
|
|
47
|
+
weekNumber: "Uke {week}",
|
|
48
|
+
selectWeekNumber: "Velg uke {week}",
|
|
49
|
+
month: "Måned",
|
|
50
|
+
goToNextMonth: "Gå til neste måned",
|
|
51
|
+
goToPreviousMonth: "Gå til forrige måned",
|
|
52
|
+
year: "År",
|
|
53
|
+
goToNextYear: "Gå til neste år",
|
|
54
|
+
goToPreviousYear: "Gå til forrige år",
|
|
55
|
+
openDatePicker: "Åpne datovelger",
|
|
56
|
+
openMonthPicker: "Åpne månedsvelger",
|
|
57
|
+
closeDatePicker: "Lukk datovelger",
|
|
58
|
+
closeMonthPicker: "Lukk månedsvelger",
|
|
59
|
+
},
|
|
60
|
+
ErrorSummary: {
|
|
61
|
+
heading: "Du må rette disse feilene før du kan fortsette:",
|
|
62
|
+
},
|
|
15
63
|
FileUpload: {
|
|
16
64
|
dropzone: {
|
|
17
65
|
button: "Velg fil",
|
|
@@ -35,29 +83,18 @@ export default {
|
|
|
35
83
|
showAllSteps: "Vis alle steg",
|
|
36
84
|
hideAllSteps: "Skjul alle steg",
|
|
37
85
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
closeMessage: "Lukk melding",
|
|
41
|
-
error: "Feil",
|
|
42
|
-
info: "Informasjon",
|
|
43
|
-
success: "Suksess",
|
|
44
|
-
warning: "Advarsel",
|
|
86
|
+
FormSummary: {
|
|
87
|
+
editAnswer: "Endre svar",
|
|
45
88
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
/** Will be appended to the accessible name for the button. */
|
|
49
|
-
labelSuffix: "slett",
|
|
50
|
-
},
|
|
89
|
+
GuidePanel: {
|
|
90
|
+
illustrationLabel: "Illustrasjon av veileder",
|
|
51
91
|
},
|
|
52
|
-
|
|
53
|
-
|
|
92
|
+
HelpText: {
|
|
93
|
+
title: "Mer informasjon",
|
|
54
94
|
},
|
|
55
95
|
Loader: {
|
|
56
96
|
title: "Venter…",
|
|
57
97
|
},
|
|
58
|
-
Modal: {
|
|
59
|
-
close: "Lukk",
|
|
60
|
-
},
|
|
61
98
|
Pagination: {
|
|
62
99
|
previous: "Forrige",
|
|
63
100
|
next: "Neste",
|
|
@@ -68,7 +105,7 @@ export default {
|
|
|
68
105
|
"Fremdrift kan ikke beregnes, antatt tid er {seconds} sekunder.",
|
|
69
106
|
},
|
|
70
107
|
Search: {
|
|
71
|
-
clear: "Tøm",
|
|
108
|
+
clear: "Tøm feltet",
|
|
72
109
|
search: "Søk",
|
|
73
110
|
},
|
|
74
111
|
Textarea: {
|
|
@@ -91,7 +128,7 @@ export default {
|
|
|
91
128
|
warning: "Advarsel",
|
|
92
129
|
danger: "Fare",
|
|
93
130
|
info: "Info",
|
|
94
|
-
neutral: "Nøytral",
|
|
131
|
+
neutral: "Nøytral",
|
|
95
132
|
period: "{status} fra {start} til {end}",
|
|
96
133
|
},
|
|
97
134
|
Pin: {
|
|
@@ -102,24 +139,4 @@ export default {
|
|
|
102
139
|
reset: "Tilbakestill tidsperspektiv",
|
|
103
140
|
},
|
|
104
141
|
},
|
|
105
|
-
DatePicker: {
|
|
106
|
-
close: "Lukk", // TODO: Consider making global
|
|
107
|
-
chooseDate: "Velg dato",
|
|
108
|
-
chooseDates: "Velg datoer",
|
|
109
|
-
chooseDateRange: "Velg start- og sluttdato",
|
|
110
|
-
chooseMonth: "Velg måned",
|
|
111
|
-
week: "Uke",
|
|
112
|
-
weekNumber: "Uke {week}",
|
|
113
|
-
selectWeekNumber: "Velg uke {week}",
|
|
114
|
-
month: "Måned",
|
|
115
|
-
goToNextMonth: "Gå til neste måned",
|
|
116
|
-
goToPreviousMonth: "Gå til forrige måned",
|
|
117
|
-
year: "År",
|
|
118
|
-
goToNextYear: "Gå til neste år",
|
|
119
|
-
goToPreviousYear: "Gå til forrige år",
|
|
120
|
-
openDatePicker: "Åpne datovelger",
|
|
121
|
-
openMonthPicker: "Åpne månedsvelger",
|
|
122
|
-
closeDatePicker: "Lukk datovelger",
|
|
123
|
-
closeMonthPicker: "Lukk månedsvelger",
|
|
124
|
-
},
|
|
125
142
|
} satisfies TranslationMap;
|
|
@@ -7,8 +7,53 @@ export default {
|
|
|
7
7
|
showMore: "Vis meir",
|
|
8
8
|
showLess: "Vis mindre",
|
|
9
9
|
readOnly: "Skrivebeskytta",
|
|
10
|
+
close: "Lukk",
|
|
10
11
|
},
|
|
11
12
|
|
|
13
|
+
Alert: {
|
|
14
|
+
closeAlert: "Lukk varsel",
|
|
15
|
+
closeMessage: "Lukk melding",
|
|
16
|
+
error: "Feil",
|
|
17
|
+
info: "Informasjon",
|
|
18
|
+
success: "Suksess",
|
|
19
|
+
warning: "Åtvaring",
|
|
20
|
+
},
|
|
21
|
+
Chips: {
|
|
22
|
+
Removable: {
|
|
23
|
+
labelSuffix: "slett",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
Combobox: {
|
|
27
|
+
addOption: "Legg til",
|
|
28
|
+
loading: "Søker…",
|
|
29
|
+
maxSelected: "{selected} av maks {limit} er valt.",
|
|
30
|
+
},
|
|
31
|
+
CopyButton: {
|
|
32
|
+
title: "Kopier",
|
|
33
|
+
activeText: "Kopiert!",
|
|
34
|
+
},
|
|
35
|
+
DatePicker: {
|
|
36
|
+
chooseDate: "Vel dato",
|
|
37
|
+
chooseDates: "Vel datoar",
|
|
38
|
+
chooseDateRange: "Vel start- og sluttdato",
|
|
39
|
+
chooseMonth: "Vel månad",
|
|
40
|
+
week: "Veke",
|
|
41
|
+
weekNumber: "Veke {week}",
|
|
42
|
+
selectWeekNumber: "Vel veke {week}",
|
|
43
|
+
month: "Månad",
|
|
44
|
+
goToNextMonth: "Gå til neste månad",
|
|
45
|
+
goToPreviousMonth: "Gå til førre månad",
|
|
46
|
+
year: "År",
|
|
47
|
+
goToNextYear: "Gå til neste år",
|
|
48
|
+
goToPreviousYear: "Gå til førre år",
|
|
49
|
+
openDatePicker: "Opne datoveljar",
|
|
50
|
+
openMonthPicker: "Opne månadsveljar",
|
|
51
|
+
closeDatePicker: "Lukk datoveljar",
|
|
52
|
+
closeMonthPicker: "Lukk månadsveljar",
|
|
53
|
+
},
|
|
54
|
+
ErrorSummary: {
|
|
55
|
+
heading: "Du må rette desse feila før du kan halde fram:",
|
|
56
|
+
},
|
|
12
57
|
FileUpload: {
|
|
13
58
|
dropzone: {
|
|
14
59
|
button: "Vel fil",
|
|
@@ -32,28 +77,18 @@ export default {
|
|
|
32
77
|
showAllSteps: "Vis alle steg",
|
|
33
78
|
hideAllSteps: "Skjul alle steg",
|
|
34
79
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
closeMessage: "Lukk melding",
|
|
38
|
-
error: "Feil",
|
|
39
|
-
info: "Informasjon",
|
|
40
|
-
success: "Suksess",
|
|
41
|
-
warning: "Åtvaring",
|
|
80
|
+
FormSummary: {
|
|
81
|
+
editAnswer: "Endre svar",
|
|
42
82
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
labelSuffix: "slett",
|
|
46
|
-
},
|
|
83
|
+
GuidePanel: {
|
|
84
|
+
illustrationLabel: "Illustrasjon av rettleiar",
|
|
47
85
|
},
|
|
48
|
-
|
|
49
|
-
|
|
86
|
+
HelpText: {
|
|
87
|
+
title: "Meir informasjon",
|
|
50
88
|
},
|
|
51
89
|
Loader: {
|
|
52
90
|
title: "Ventar…",
|
|
53
91
|
},
|
|
54
|
-
Modal: {
|
|
55
|
-
close: "Lukk",
|
|
56
|
-
},
|
|
57
92
|
Pagination: {
|
|
58
93
|
previous: "Førre",
|
|
59
94
|
next: "Neste",
|
|
@@ -64,7 +99,7 @@ export default {
|
|
|
64
99
|
"Framdrift kan ikkje bereknast, antatt tid er {seconds} sekund.",
|
|
65
100
|
},
|
|
66
101
|
Search: {
|
|
67
|
-
clear: "Tøm",
|
|
102
|
+
clear: "Tøm feltet",
|
|
68
103
|
search: "Søk",
|
|
69
104
|
},
|
|
70
105
|
Textarea: {
|
|
@@ -97,24 +132,4 @@ export default {
|
|
|
97
132
|
reset: "Tilbakestill tidsperspektiv",
|
|
98
133
|
},
|
|
99
134
|
},
|
|
100
|
-
DatePicker: {
|
|
101
|
-
close: "Lukk",
|
|
102
|
-
chooseDate: "Vel dato",
|
|
103
|
-
chooseDates: "Vel datoar",
|
|
104
|
-
chooseDateRange: "Vel start- og sluttdato",
|
|
105
|
-
chooseMonth: "Vel månad",
|
|
106
|
-
week: "Veke",
|
|
107
|
-
weekNumber: "Veke {week}",
|
|
108
|
-
selectWeekNumber: "Vel veke {week}",
|
|
109
|
-
month: "Månad",
|
|
110
|
-
goToNextMonth: "Gå til neste månad",
|
|
111
|
-
goToPreviousMonth: "Gå til førre månad",
|
|
112
|
-
year: "År",
|
|
113
|
-
goToNextYear: "Gå til neste år",
|
|
114
|
-
goToPreviousYear: "Gå til førre år",
|
|
115
|
-
openDatePicker: "Opne datoveljar",
|
|
116
|
-
openMonthPicker: "Opne månadsveljar",
|
|
117
|
-
closeDatePicker: "Lukk datoveljar",
|
|
118
|
-
closeMonthPicker: "Lukk månadsveljar",
|
|
119
|
-
},
|
|
120
135
|
} satisfies Translations;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { PartialTranslations } from "../../util/i18n/i18n.types";
|
|
3
|
-
export interface LanguageProviderContextType {
|
|
4
|
-
/**
|
|
5
|
-
* Merged with the default language translations object (officially provided translations).
|
|
6
|
-
*/
|
|
7
|
-
translations: PartialTranslations | PartialTranslations[];
|
|
8
|
-
}
|
|
9
|
-
export declare const LanguageProviderContext: React.Context<LanguageProviderContextType>;
|
|
10
|
-
export interface LanguageProviderProps {
|
|
11
|
-
children?: React.ReactNode;
|
|
12
|
-
translations?: PartialTranslations | PartialTranslations[];
|
|
13
|
-
}
|
|
14
|
-
export declare const useProvider: () => LanguageProviderContextType;
|
|
15
|
-
/**
|
|
16
|
-
* @private Feature is under development and should not be used in any applications.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```jsx
|
|
20
|
-
* <UNSAFE_AkselLanguageProvider translations={{...}}>
|
|
21
|
-
* {app}
|
|
22
|
-
* </UNSAFE_AkselLanguageProvider>
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
export declare const UNSAFE_AkselLanguageProvider: ({ children, translations, }: LanguageProviderProps) => React.JSX.Element;
|
|
26
|
-
export default UNSAFE_AkselLanguageProvider;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.UNSAFE_AkselLanguageProvider = exports.useProvider = exports.LanguageProviderContext = void 0;
|
|
30
|
-
const react_1 = __importStar(require("react"));
|
|
31
|
-
const nb_1 = __importDefault(require("../../util/i18n/locales/nb"));
|
|
32
|
-
exports.LanguageProviderContext = (0, react_1.createContext)({
|
|
33
|
-
translations: nb_1.default,
|
|
34
|
-
});
|
|
35
|
-
const useProvider = () => (0, react_1.useContext)(exports.LanguageProviderContext);
|
|
36
|
-
exports.useProvider = useProvider;
|
|
37
|
-
/**
|
|
38
|
-
* @private Feature is under development and should not be used in any applications.
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* ```jsx
|
|
42
|
-
* <UNSAFE_AkselLanguageProvider translations={{...}}>
|
|
43
|
-
* {app}
|
|
44
|
-
* </UNSAFE_AkselLanguageProvider>
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
const UNSAFE_AkselLanguageProvider = ({ children, translations, }) => {
|
|
48
|
-
return (react_1.default.createElement(exports.LanguageProviderContext.Provider, { value: {
|
|
49
|
-
translations: translations !== null && translations !== void 0 ? translations : nb_1.default,
|
|
50
|
-
} }, children));
|
|
51
|
-
};
|
|
52
|
-
exports.UNSAFE_AkselLanguageProvider = UNSAFE_AkselLanguageProvider;
|
|
53
|
-
exports.default = exports.UNSAFE_AkselLanguageProvider;
|
|
54
|
-
//# sourceMappingURL=LanguageProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LanguageProvider.js","sourceRoot":"","sources":["../../../src/provider/i18n/LanguageProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAyD;AAEzD,oEAA4C;AAS/B,QAAA,uBAAuB,GAClC,IAAA,qBAAa,EAA8B;IACzC,YAAY,EAAE,YAAE;CACjB,CAAC,CAAC;AAOE,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,IAAA,kBAAU,EAAC,+BAAuB,CAAC,CAAC;AAAxD,QAAA,WAAW,eAA6C;AAErE;;;;;;;;;GASG;AACI,MAAM,4BAA4B,GAAG,CAAC,EAC3C,QAAQ,EACR,YAAY,GACU,EAAE,EAAE;IAC1B,OAAO,CACL,8BAAC,+BAAuB,CAAC,QAAQ,IAC/B,KAAK,EAAE;YACL,YAAY,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,YAAE;SACjC,IAEA,QAAQ,CACwB,CACpC,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,4BAA4B,gCAavC;AAEF,kBAAe,oCAA4B,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { PartialTranslations } from "../../util/i18n/i18n.types.js";
|
|
3
|
-
export interface LanguageProviderContextType {
|
|
4
|
-
/**
|
|
5
|
-
* Merged with the default language translations object (officially provided translations).
|
|
6
|
-
*/
|
|
7
|
-
translations: PartialTranslations | PartialTranslations[];
|
|
8
|
-
}
|
|
9
|
-
export declare const LanguageProviderContext: React.Context<LanguageProviderContextType>;
|
|
10
|
-
export interface LanguageProviderProps {
|
|
11
|
-
children?: React.ReactNode;
|
|
12
|
-
translations?: PartialTranslations | PartialTranslations[];
|
|
13
|
-
}
|
|
14
|
-
export declare const useProvider: () => LanguageProviderContextType;
|
|
15
|
-
/**
|
|
16
|
-
* @private Feature is under development and should not be used in any applications.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```jsx
|
|
20
|
-
* <UNSAFE_AkselLanguageProvider translations={{...}}>
|
|
21
|
-
* {app}
|
|
22
|
-
* </UNSAFE_AkselLanguageProvider>
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
export declare const UNSAFE_AkselLanguageProvider: ({ children, translations, }: LanguageProviderProps) => React.JSX.Element;
|
|
26
|
-
export default UNSAFE_AkselLanguageProvider;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React, { createContext, useContext } from "react";
|
|
2
|
-
import nb from "../../util/i18n/locales/nb.js";
|
|
3
|
-
export const LanguageProviderContext = createContext({
|
|
4
|
-
translations: nb,
|
|
5
|
-
});
|
|
6
|
-
export const useProvider = () => useContext(LanguageProviderContext);
|
|
7
|
-
/**
|
|
8
|
-
* @private Feature is under development and should not be used in any applications.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```jsx
|
|
12
|
-
* <UNSAFE_AkselLanguageProvider translations={{...}}>
|
|
13
|
-
* {app}
|
|
14
|
-
* </UNSAFE_AkselLanguageProvider>
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export const UNSAFE_AkselLanguageProvider = ({ children, translations, }) => {
|
|
18
|
-
return (React.createElement(LanguageProviderContext.Provider, { value: {
|
|
19
|
-
translations: translations !== null && translations !== void 0 ? translations : nb,
|
|
20
|
-
} }, children));
|
|
21
|
-
};
|
|
22
|
-
export default UNSAFE_AkselLanguageProvider;
|
|
23
|
-
//# sourceMappingURL=LanguageProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LanguageProvider.js","sourceRoot":"","sources":["../../../src/provider/i18n/LanguageProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAS5C,MAAM,CAAC,MAAM,uBAAuB,GAClC,aAAa,CAA8B;IACzC,YAAY,EAAE,EAAE;CACjB,CAAC,CAAC;AAOL,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;AAErE;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,EAC3C,QAAQ,EACR,YAAY,GACU,EAAE,EAAE;IAC1B,OAAO,CACL,oBAAC,uBAAuB,CAAC,QAAQ,IAC/B,KAAK,EAAE;YACL,YAAY,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,EAAE;SACjC,IAEA,QAAQ,CACwB,CACpC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import React, { createContext, useContext } from "react";
|
|
2
|
-
import { PartialTranslations } from "../../util/i18n/i18n.types";
|
|
3
|
-
import nb from "../../util/i18n/locales/nb";
|
|
4
|
-
|
|
5
|
-
export interface LanguageProviderContextType {
|
|
6
|
-
/**
|
|
7
|
-
* Merged with the default language translations object (officially provided translations).
|
|
8
|
-
*/
|
|
9
|
-
translations: PartialTranslations | PartialTranslations[];
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const LanguageProviderContext =
|
|
13
|
-
createContext<LanguageProviderContextType>({
|
|
14
|
-
translations: nb,
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export interface LanguageProviderProps {
|
|
18
|
-
children?: React.ReactNode;
|
|
19
|
-
translations?: PartialTranslations | PartialTranslations[];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export const useProvider = () => useContext(LanguageProviderContext);
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @private Feature is under development and should not be used in any applications.
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* ```jsx
|
|
29
|
-
* <UNSAFE_AkselLanguageProvider translations={{...}}>
|
|
30
|
-
* {app}
|
|
31
|
-
* </UNSAFE_AkselLanguageProvider>
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
export const UNSAFE_AkselLanguageProvider = ({
|
|
35
|
-
children,
|
|
36
|
-
translations,
|
|
37
|
-
}: LanguageProviderProps) => {
|
|
38
|
-
return (
|
|
39
|
-
<LanguageProviderContext.Provider
|
|
40
|
-
value={{
|
|
41
|
-
translations: translations ?? nb,
|
|
42
|
-
}}
|
|
43
|
-
>
|
|
44
|
-
{children}
|
|
45
|
-
</LanguageProviderContext.Provider>
|
|
46
|
-
);
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export default UNSAFE_AkselLanguageProvider;
|