@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
package/cjs/tooltip/Tooltip.js
CHANGED
|
@@ -41,8 +41,8 @@ exports.Tooltip = void 0;
|
|
|
41
41
|
const react_1 = require("@floating-ui/react");
|
|
42
42
|
const clsx_1 = __importDefault(require("clsx"));
|
|
43
43
|
const react_2 = __importStar(require("react"));
|
|
44
|
-
const
|
|
45
|
-
const
|
|
44
|
+
const Modal_context_1 = require("../modal/Modal.context");
|
|
45
|
+
const Portal_1 = __importDefault(require("../overlays/portal/Portal"));
|
|
46
46
|
const typography_1 = require("../typography");
|
|
47
47
|
const hooks_1 = require("../util/hooks");
|
|
48
48
|
const useControllableState_1 = require("../util/hooks/useControllableState");
|
|
@@ -61,7 +61,6 @@ const useMergeRefs_1 = require("../util/hooks/useMergeRefs");
|
|
|
61
61
|
* ```
|
|
62
62
|
*/
|
|
63
63
|
exports.Tooltip = (0, react_2.forwardRef)((_a, ref) => {
|
|
64
|
-
var _b;
|
|
65
64
|
var { children, className, arrow: _arrow = true, placement: _placement = "top", open, defaultOpen = false, onOpenChange, offset: _offset, content, delay = 150, id, keys, maxChar = 80 } = _a, rest = __rest(_a, ["children", "className", "arrow", "placement", "open", "defaultOpen", "onOpenChange", "offset", "content", "delay", "id", "keys", "maxChar"]);
|
|
66
65
|
const [_open, _setOpen] = (0, useControllableState_1.useControllableState)({
|
|
67
66
|
defaultValue: defaultOpen,
|
|
@@ -69,11 +68,8 @@ exports.Tooltip = (0, react_2.forwardRef)((_a, ref) => {
|
|
|
69
68
|
onChange: onOpenChange,
|
|
70
69
|
});
|
|
71
70
|
const arrowRef = (0, react_2.useRef)(null);
|
|
72
|
-
const modalContext = (0,
|
|
73
|
-
const
|
|
74
|
-
const rootElement = modalContext
|
|
75
|
-
? modalContext.ref.current
|
|
76
|
-
: providerRootElement;
|
|
71
|
+
const modalContext = (0, Modal_context_1.useModalContext)(false);
|
|
72
|
+
const rootElement = modalContext ? modalContext.ref.current : undefined;
|
|
77
73
|
const { x, y, strategy, context, placement, middlewareData: { arrow: { x: arrowX, y: arrowY } = {}, hide: { referenceHidden } = {}, }, refs, } = (0, react_1.useFloating)({
|
|
78
74
|
placement: _placement,
|
|
79
75
|
open: _open,
|
|
@@ -114,7 +110,7 @@ exports.Tooltip = (0, react_2.forwardRef)((_a, ref) => {
|
|
|
114
110
|
(0, react_2.cloneElement)(children, getReferenceProps(Object.assign(Object.assign({}, children.props), { ref: childMergedRef, "aria-describedby": _open
|
|
115
111
|
? (0, clsx_1.default)(ariaId, children === null || children === void 0 ? void 0 : children.props["aria-describedby"])
|
|
116
112
|
: children === null || children === void 0 ? void 0 : children.props["aria-describedby"] }))),
|
|
117
|
-
react_2.default.createElement(
|
|
113
|
+
react_2.default.createElement(Portal_1.default, { rootElement: rootElement, asChild: true }, _open && (react_2.default.createElement("div", Object.assign({}, getFloatingProps(Object.assign(Object.assign({}, rest), { ref: mergedRef, style: {
|
|
118
114
|
position: strategy,
|
|
119
115
|
top: y !== null && y !== void 0 ? y : 0,
|
|
120
116
|
left: x !== null && x !== void 0 ? x : 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../src/tooltip/Tooltip.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../src/tooltip/Tooltip.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAY4B;AAC5B,gDAAsB;AACtB,+CAAgF;AAChF,0DAAyD;AACzD,uEAA+C;AAC/C,8CAAuC;AACvC,yCAAsC;AACtC,6EAA0E;AAC1E,6DAA0D;AAyD1D;;;;;;;;;;;;GAYG;AACU,QAAA,OAAO,GAAG,IAAA,kBAAU,EAC/B,CACE,EAeC,EACD,GAAG,EACH,EAA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AAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACjB,8BAAC,mBAAM,IAAC,EAAE,EAAC,KAAK,EAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAC,oBAAoB,IACtD,GAAG,CACG,CACV,CAAC,CACG,CACR;YACA,MAAM,IAAI,CACT,uCACE,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE;oBACZ,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;gBAC1B,CAAC,EACD,SAAS,EAAC,sBAAsB,EAChC,KAAK,EAAE;oBACL,IAAI,EAAE,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC,EAAE;oBACzC,GAAG,EAAE,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC,EAAE;oBACxC,KAAK,EAAE,EAAE;oBACT,MAAM,EAAE,EAAE;oBACV,CAAC;wBACC,GAAG,EAAE,QAAQ;wBACb,KAAK,EAAE,MAAM;wBACb,MAAM,EAAE,KAAK;wBACb,IAAI,EAAE,OAAO;qBACd,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ;iBACxB,GACD,CACH,CACG,CACP,CACM,CACR,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,kBAAe,eAAO,CAAC"}
|
package/cjs/util/Slot.js
CHANGED
|
@@ -39,6 +39,7 @@ exports.Slot = void 0;
|
|
|
39
39
|
const React = __importStar(require("react"));
|
|
40
40
|
const useMergeRefs_1 = require("./hooks/useMergeRefs");
|
|
41
41
|
exports.Slot = React.forwardRef((props, forwardedRef) => {
|
|
42
|
+
var _a;
|
|
42
43
|
const { children } = props, slotProps = __rest(props, ["children"]);
|
|
43
44
|
if (React.isValidElement(children)) {
|
|
44
45
|
return React.cloneElement(children, Object.assign(Object.assign({}, mergeProps(slotProps, children.props)), { ref: forwardedRef
|
|
@@ -46,8 +47,10 @@ exports.Slot = React.forwardRef((props, forwardedRef) => {
|
|
|
46
47
|
: children.ref }));
|
|
47
48
|
}
|
|
48
49
|
if (React.Children.count(children) > 1) {
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
const error = new Error("Aksel: Components using 'asChild' expects to recieve a single React element child.");
|
|
51
|
+
error.name = "SlotError";
|
|
52
|
+
(_a = Error.captureStackTrace) === null || _a === void 0 ? void 0 : _a.call(Error, error, exports.Slot);
|
|
53
|
+
throw error;
|
|
51
54
|
}
|
|
52
55
|
return null;
|
|
53
56
|
});
|
package/cjs/util/Slot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slot.js","sourceRoot":"","sources":["../../src/util/Slot.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oFAAoF;AACpF,6CAA+B;AAC/B,uDAAiD;AAMpC,QAAA,IAAI,GAAG,KAAK,CAAC,UAAU,CAClC,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE
|
|
1
|
+
{"version":3,"file":"Slot.js","sourceRoot":"","sources":["../../src/util/Slot.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oFAAoF;AACpF,6CAA+B;AAC/B,uDAAiD;AAMpC,QAAA,IAAI,GAAG,KAAK,CAAC,UAAU,CAClC,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE;;IACtB,MAAM,EAAE,QAAQ,KAAmB,KAAK,EAAnB,SAAS,UAAK,KAAK,EAAlC,YAA0B,CAAQ,CAAC;IAEzC,IAAI,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC;QACnC,OAAO,KAAK,CAAC,YAAY,CAAM,QAAQ,kCAClC,UAAU,CAAC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,KACxC,GAAG,EAAE,YAAY;gBACf,CAAC,CAAC,IAAA,wBAAS,EAAC,CAAC,YAAY,EAAG,QAAgB,CAAC,GAAG,CAAC,CAA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Aa,GAAK,cAAc,CAAE,CAAC;QACpE,CAAC;aAAM,IAAI,QAAQ,KAAK,WAAW,EAAE,CAAC;YACpC,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAa,EAAE,cAAc,CAAC;iBACtD,MAAM,CAAC,OAAO,CAAC;iBACf,IAAI,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;IACH,CAAC;IAED,uCAAY,SAAS,GAAK,aAAa,EAAG;AAC5C,CAAC"}
|
|
@@ -43,7 +43,7 @@ const react_dom_1 = __importDefault(require("react-dom"));
|
|
|
43
43
|
const hooks_1 = require("../util/hooks");
|
|
44
44
|
const debounce_1 = __importDefault(require("./debounce"));
|
|
45
45
|
const useMergeRefs_1 = require("./hooks/useMergeRefs");
|
|
46
|
-
const
|
|
46
|
+
const checkState = (prevState, newState, renders) => {
|
|
47
47
|
const { outerHeightStyle, overflow } = newState;
|
|
48
48
|
// Need a large enough difference to update the height.
|
|
49
49
|
// This prevents infinite rendering loop.
|
|
@@ -52,18 +52,10 @@ const updateState = (prevState, newState, renders) => {
|
|
|
52
52
|
Math.abs((prevState.outerHeightStyle || 0) - outerHeightStyle) > 1) ||
|
|
53
53
|
prevState.overflow !== overflow)) {
|
|
54
54
|
renders.current += 1;
|
|
55
|
-
return
|
|
56
|
-
overflow,
|
|
57
|
-
outerHeightStyle,
|
|
58
|
-
};
|
|
55
|
+
return newState;
|
|
59
56
|
}
|
|
60
|
-
if (process.env.NODE_ENV !== "production") {
|
|
61
|
-
|
|
62
|
-
console.error([
|
|
63
|
-
"Textarea: Too many re-renders. The layout is unstable.",
|
|
64
|
-
"TextareaAutosize limits the number of renders to prevent an infinite loop.",
|
|
65
|
-
].join("\n"));
|
|
66
|
-
}
|
|
57
|
+
if (process.env.NODE_ENV !== "production" && renders.current === 20) {
|
|
58
|
+
console.error("Textarea: Too many re-renders. The layout is unstable. TextareaAutosize limits the number of renders to prevent an infinite loop.");
|
|
67
59
|
}
|
|
68
60
|
return prevState;
|
|
69
61
|
};
|
|
@@ -128,13 +120,13 @@ const TextareaAutosize = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
128
120
|
const overflow = Math.abs(outerHeight - innerHeight) <= 1;
|
|
129
121
|
return { outerHeightStyle, overflow };
|
|
130
122
|
}, [maxRows, minRows, other.placeholder]);
|
|
131
|
-
const syncHeight =
|
|
123
|
+
const syncHeight = () => {
|
|
132
124
|
const newState = getUpdatedState();
|
|
133
125
|
if (isEmpty(newState)) {
|
|
134
126
|
return;
|
|
135
127
|
}
|
|
136
|
-
setState((prevState) =>
|
|
137
|
-
}
|
|
128
|
+
setState((prevState) => checkState(prevState, newState, renders));
|
|
129
|
+
};
|
|
138
130
|
(0, hooks_1.useClientLayoutEffect)(() => {
|
|
139
131
|
const syncHeightWithFlushSync = () => {
|
|
140
132
|
const newState = getUpdatedState();
|
|
@@ -143,14 +135,13 @@ const TextareaAutosize = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
143
135
|
}
|
|
144
136
|
// In React 18, state updates in a ResizeObserver's callback are happening after
|
|
145
137
|
// the paint, this leads to an infinite rendering.
|
|
146
|
-
//
|
|
147
|
-
// Using flushSync ensures that the states is updated before the next pain.
|
|
138
|
+
// Using flushSync ensures that the state is updated before the next paint.
|
|
148
139
|
// Related issue - https://github.com/facebook/react/issues/24331
|
|
149
140
|
react_dom_1.default.flushSync(() => {
|
|
150
|
-
setState((prevState) =>
|
|
141
|
+
setState((prevState) => checkState(prevState, newState, renders));
|
|
151
142
|
});
|
|
152
143
|
};
|
|
153
|
-
const handleResize = () => {
|
|
144
|
+
const handleResize = (0, debounce_1.default)(() => {
|
|
154
145
|
var _a, _b, _c;
|
|
155
146
|
renders.current = 0;
|
|
156
147
|
if (((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.style.height) || ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.style.width)) {
|
|
@@ -161,19 +152,18 @@ const TextareaAutosize = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
161
152
|
return;
|
|
162
153
|
}
|
|
163
154
|
syncHeightWithFlushSync();
|
|
164
|
-
};
|
|
165
|
-
const debounceHandleResize = (0, debounce_1.default)(handleResize);
|
|
155
|
+
});
|
|
166
156
|
const input = inputRef.current;
|
|
167
157
|
const containerWindow = ownerWindow(input);
|
|
168
|
-
containerWindow.addEventListener("resize",
|
|
158
|
+
containerWindow.addEventListener("resize", handleResize);
|
|
169
159
|
let resizeObserver;
|
|
170
160
|
if (typeof ResizeObserver !== "undefined") {
|
|
171
161
|
resizeObserver = new ResizeObserver(handleResize);
|
|
172
162
|
resizeObserver.observe(input);
|
|
173
163
|
}
|
|
174
164
|
return () => {
|
|
175
|
-
|
|
176
|
-
containerWindow.removeEventListener("resize",
|
|
165
|
+
handleResize.clear();
|
|
166
|
+
containerWindow.removeEventListener("resize", handleResize);
|
|
177
167
|
if (resizeObserver) {
|
|
178
168
|
resizeObserver.disconnect();
|
|
179
169
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextareaAutoSize.js","sourceRoot":"","sources":["../../src/util/TextareaAutoSize.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gHAAgH;AAChH,+CAAuE;AACvE,0DAAiC;AACjC,yCAAsD;AACtD,0DAAkC;AAClC,uDAAoD;AAOpD,MAAM,
|
|
1
|
+
{"version":3,"file":"TextareaAutoSize.js","sourceRoot":"","sources":["../../src/util/TextareaAutoSize.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gHAAgH;AAChH,+CAAuE;AACvE,0DAAiC;AACjC,yCAAsD;AACtD,0DAAkC;AAClC,uDAAoD;AAOpD,MAAM,UAAU,GAAG,CACjB,SAAgB,EAChB,QAAe,EACf,OAAuC,EACvC,EAAE;IACF,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC;IAChD,uDAAuD;IACvD,yCAAyC;I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|
|
21
|
-
];
|
|
22
|
-
export declare function createContext<T>(options?: CreateContextOptions<T>): CreateContextReturn<T>;
|
|
18
|
+
export declare function createContext<T>(options?: CreateContextOptions<T>): readonly [React.ForwardRefExoticComponent<React.PropsWithoutRef<ProviderProps<T>> & React.RefAttributes<unknown>>, <S extends boolean = true>(strict?: S) => Context<S, T>];
|
|
19
|
+
type Context<S, T> = S extends true ? T : T | undefined;
|
|
23
20
|
export {};
|
|
@@ -48,17 +48,21 @@ function getErrorMessage(hook, provider) {
|
|
|
48
48
|
function createContext(options = {}) {
|
|
49
49
|
const { name, hookName = "useContext", providerName = "Provider", errorMessage, defaultValue, } = options;
|
|
50
50
|
const Context = (0, react_1.createContext)(defaultValue);
|
|
51
|
-
|
|
51
|
+
/**
|
|
52
|
+
* We use forwardRef to allow `ref` to be used as a regular context value
|
|
53
|
+
* @see https://reactjs.org/docs/forwarding-refs.html#forwarding-refs-to-dom-components
|
|
54
|
+
*/
|
|
55
|
+
const Provider = (0, react_1.forwardRef)((_a, ref) => {
|
|
52
56
|
var { children } = _a, context = __rest(_a, ["children"]);
|
|
53
57
|
// Only re-memoize when prop values change
|
|
54
58
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
55
59
|
const value = react_1.default.useMemo(() => context, Object.values(context));
|
|
56
|
-
return react_1.default.createElement(Context.Provider, { value: value }, children);
|
|
57
|
-
}
|
|
58
|
-
function useContext() {
|
|
60
|
+
return (react_1.default.createElement(Context.Provider, { value: ref ? Object.assign(Object.assign({}, value), { ref }) : value }, children));
|
|
61
|
+
});
|
|
62
|
+
function useContext(strict = true) {
|
|
59
63
|
var _a;
|
|
60
64
|
const context = (0, react_1.useContext)(Context);
|
|
61
|
-
if (!context) {
|
|
65
|
+
if (!context && strict) {
|
|
62
66
|
const error = new Error(errorMessage !== null && errorMessage !== void 0 ? errorMessage : getErrorMessage(hookName, providerName));
|
|
63
67
|
error.name = "ContextError";
|
|
64
68
|
(_a = Error.captureStackTrace) === null || _a === void 0 ? void 0 : _a.call(Error, error, useContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-context.js","sourceRoot":"","sources":["../../src/util/create-context.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;GAKG;AACH,+
|
|
1
|
+
{"version":3,"file":"create-context.js","sourceRoot":"","sources":["../../src/util/create-context.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;GAKG;AACH,+CAIe;AAYf,SAAS,eAAe,CAAC,IAAY,EAAE,QAAgB;IACrD,OAAO,GAAG,IAAI,sEAAsE,QAAQ,EAAE,CAAC;AACjG,CAAC;AAED,SAAgB,aAAa,CAAI,UAAmC,EAAE;IACpE,MAAM,EACJ,IAAI,EACJ,QAAQ,GAAG,YAAY,EACvB,YAAY,GAAG,UAAU,EACzB,YAAY,EACZ,YAAY,GACb,GAAG,OAAO,CAAC;IAEZ,MAAM,OAAO,GAAG,IAAA,qBAAkB,EAAgB,YAAY,CAAC,CAAC;IAEhE;;;OAGG;IACH,MAAM,QAAQ,GAAG,IAAA,kBAAU,EACzB,CAAC,EAA0C,EAAE,GAAG,EAAE,EAAE;YAAnD,EAAE,QAAQ,OAAgC,EAA3B,OAAO,cAAtB,YAAwB,CAAF;QACrB,0CAA0C;QAC1C,uDAAuD;QACvD,MAAM,KAAK,GAAG,eAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAM,CAAC;QAExE,OAAO,CACL,8BAAC,OAAO,CAAC,QAAQ,IAAC,KAAK,EAAE,GAAG,CAAC,CAAC,iCAAM,KAAK,KAAE,GAAG,IAAG,CAAC,CAAC,KAAK,IACrD,QAAQ,CACQ,CACpB,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,SAAS,UAAU,CACjB,SAAY,IAAS;;QAErB,MAAM,OAAO,GAAG,IAAA,kBAAe,EAAC,OAAO,CAAC,CAAC;QAEzC,IAAI,CAAC,OAAO,IAAI,MAAM,EAAE,CAAC;YACvB,MAAM,KAAK,GAAG,IAAI,KAAK,CACrB,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,eAAe,CAAC,QAAQ,EAAE,YAAY,CAAC,CACxD,CAAC;YACF,KAAK,CAAC,IAAI,GAAG,cAAc,CAAC;YAC5B,MAAA,KAAK,CAAC,iBAAiB,sDAAG,KAAK,EAAE,UAAU,CAAC,CAAC;YAC7C,MAAM,KAAK,CAAC;QACd,CAAC;QAED,OAAO,OAAwB,CAAC;IAClC,CAAC;IAED,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAE3B,OAAO,CAAC,QAAQ,EAAE,UAAU,CAAU,CAAC;AACzC,CAAC;AAjDD,sCAiDC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type AsChildProps = {
|
|
3
|
+
children: React.ReactElement | false | null;
|
|
4
|
+
/**
|
|
5
|
+
* Renders the component and its child as a single element,
|
|
6
|
+
* merging the props of the component with the props of the child.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <Component asChild data-prop>
|
|
11
|
+
* <ChildComponent data-child />
|
|
12
|
+
* </Component>
|
|
13
|
+
*
|
|
14
|
+
* // Renders
|
|
15
|
+
* <MergedComponent data-prop data-child />
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
asChild: true;
|
|
19
|
+
} | {
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Renders the component and its child as a single element,
|
|
23
|
+
* merging the props of the component with the props of the child.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* <Component asChild data-prop>
|
|
28
|
+
* <ChildComponent data-child />
|
|
29
|
+
* </Component>
|
|
30
|
+
*
|
|
31
|
+
* // Renders
|
|
32
|
+
* <MergedComponent data-prop data-child />
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
asChild?: false;
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsChildProps.js","sourceRoot":"","sources":["../../../src/util/types/AsChildProps.ts"],"names":[],"mappings":""}
|
|
@@ -19,6 +19,6 @@ export interface OverridableComponent<Component, Element extends HTMLElement> {
|
|
|
19
19
|
* @returns A React functional component.
|
|
20
20
|
*/
|
|
21
21
|
<As extends React.ElementType>(props: {
|
|
22
|
-
as
|
|
22
|
+
as: As;
|
|
23
23
|
} & Component & Omit<React.ComponentPropsWithRef<As>, keyof Component | "as">): ReturnType<React.FC>;
|
|
24
24
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { AccordionContentProps } from "./AccordionContent";
|
|
3
|
-
import { AccordionHeaderProps } from "./AccordionHeader";
|
|
4
|
-
import { AccordionItemProps } from "./AccordionItem";
|
|
2
|
+
import { AccordionContentProps } from "./AccordionContent.js";
|
|
3
|
+
import { AccordionHeaderProps } from "./AccordionHeader.js";
|
|
4
|
+
import { AccordionItemProps } from "./AccordionItem.js";
|
|
5
5
|
interface AccordionComponent extends React.ForwardRefExoticComponent<AccordionProps & React.RefAttributes<HTMLDivElement>> {
|
|
6
6
|
/**
|
|
7
7
|
* @see 🏷️ {@link AccordionItemProps}
|
|
@@ -11,10 +11,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import cl from "clsx";
|
|
13
13
|
import React, { forwardRef } from "react";
|
|
14
|
-
import AccordionContent from "./AccordionContent";
|
|
15
|
-
import { AccordionContext } from "./AccordionContext";
|
|
16
|
-
import AccordionHeader from "./AccordionHeader";
|
|
17
|
-
import AccordionItem from "./AccordionItem";
|
|
14
|
+
import AccordionContent from "./AccordionContent.js";
|
|
15
|
+
import { AccordionContext } from "./AccordionContext.js";
|
|
16
|
+
import AccordionHeader from "./AccordionHeader.js";
|
|
17
|
+
import AccordionItem from "./AccordionItem.js";
|
|
18
18
|
/**
|
|
19
19
|
* A component that displays collapsible content sections.
|
|
20
20
|
*
|
|
@@ -11,8 +11,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import cl from "clsx";
|
|
13
13
|
import React, { forwardRef, useContext } from "react";
|
|
14
|
-
import { BodyLong } from "../typography";
|
|
15
|
-
import { AccordionItemContext } from "./AccordionItem";
|
|
14
|
+
import { BodyLong } from "../typography/index.js";
|
|
15
|
+
import { AccordionItemContext } from "./AccordionItem.js";
|
|
16
16
|
const AccordionContent = forwardRef((_a, ref) => {
|
|
17
17
|
var { children, className } = _a, rest = __rest(_a, ["children", "className"]);
|
|
18
18
|
const context = useContext(AccordionItemContext);
|
|
@@ -12,10 +12,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import cl from "clsx";
|
|
13
13
|
import React, { forwardRef, useContext } from "react";
|
|
14
14
|
import { ChevronDownIcon } from "@navikt/aksel-icons";
|
|
15
|
-
import { Heading } from "../typography";
|
|
16
|
-
import { composeEventHandlers } from "../util/composeEventHandlers";
|
|
17
|
-
import { AccordionContext } from "./AccordionContext";
|
|
18
|
-
import { AccordionItemContext } from "./AccordionItem";
|
|
15
|
+
import { Heading } from "../typography/index.js";
|
|
16
|
+
import { composeEventHandlers } from "../util/composeEventHandlers.js";
|
|
17
|
+
import { AccordionContext } from "./AccordionContext.js";
|
|
18
|
+
import { AccordionItemContext } from "./AccordionItem.js";
|
|
19
19
|
const AccordionHeader = forwardRef((_a, ref) => {
|
|
20
20
|
var _b;
|
|
21
21
|
var { children, className, onClick } = _a, rest = __rest(_a, ["children", "className", "onClick"]);
|
|
@@ -11,9 +11,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import cl from "clsx";
|
|
13
13
|
import React, { createContext, forwardRef, useContext, useRef } from "react";
|
|
14
|
-
import { omit } from "../util";
|
|
15
|
-
import { useControllableState } from "../util/hooks/useControllableState";
|
|
16
|
-
import { AccordionContext } from "./AccordionContext";
|
|
14
|
+
import { omit } from "../util/index.js";
|
|
15
|
+
import { useControllableState } from "../util/hooks/useControllableState.js";
|
|
16
|
+
import { AccordionContext } from "./AccordionContext.js";
|
|
17
17
|
export const AccordionItemContext = createContext(null);
|
|
18
18
|
const AccordionItem = forwardRef((_a, ref) => {
|
|
19
19
|
var { children, className, open, defaultOpen = false, onOpenChange } = _a, rest = __rest(_a, ["children", "className", "open", "defaultOpen", "onOpenChange"]);
|
package/esm/accordion/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { type AccordionProps, default as Accordion } from "./Accordion";
|
|
1
|
+
export { type AccordionProps, default as Accordion } from "./Accordion.js";
|
package/esm/accordion/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as Accordion } from "./Accordion";
|
|
1
|
+
export { default as Accordion } from "./Accordion.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/esm/alert/Alert.js
CHANGED
|
@@ -12,8 +12,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import cl from "clsx";
|
|
13
13
|
import React, { forwardRef } from "react";
|
|
14
14
|
import { CheckmarkCircleFillIcon, ExclamationmarkTriangleFillIcon, InformationSquareFillIcon, XMarkIcon, XMarkOctagonFillIcon, } from "@navikt/aksel-icons";
|
|
15
|
-
import { Button } from "../button";
|
|
16
|
-
import { BodyLong } from "../typography";
|
|
15
|
+
import { Button } from "../button/index.js";
|
|
16
|
+
import { BodyLong } from "../typography/index.js";
|
|
17
17
|
const Icon = (_a) => {
|
|
18
18
|
var { variant } = _a, props = __rest(_a, ["variant"]);
|
|
19
19
|
switch (variant) {
|
package/esm/alert/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as Alert } from "./Alert";
|
|
2
|
-
export { type AlertProps } from "./Alert";
|
|
1
|
+
export { default as Alert } from "./Alert.js";
|
|
2
|
+
export { type AlertProps } from "./Alert.js";
|
package/esm/alert/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as Alert } from "./Alert";
|
|
1
|
+
export { default as Alert } from "./Alert.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/esm/button/Button.d.ts
CHANGED
package/esm/button/Button.js
CHANGED
|
@@ -11,12 +11,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import cl from "clsx";
|
|
13
13
|
import React, { forwardRef, useRef, useState } from "react";
|
|
14
|
-
import { Loader } from "../loader";
|
|
15
|
-
import { Label } from "../typography";
|
|
16
|
-
import { omit } from "../util";
|
|
17
|
-
import { composeEventHandlers } from "../util/composeEventHandlers";
|
|
18
|
-
import { useClientLayoutEffect } from "../util/hooks";
|
|
19
|
-
import { useMergeRefs } from "../util/hooks/useMergeRefs";
|
|
14
|
+
import { Loader } from "../loader/index.js";
|
|
15
|
+
import { Label } from "../typography/index.js";
|
|
16
|
+
import { omit } from "../util/index.js";
|
|
17
|
+
import { composeEventHandlers } from "../util/composeEventHandlers.js";
|
|
18
|
+
import { useClientLayoutEffect } from "../util/hooks/index.js";
|
|
19
|
+
import { useMergeRefs } from "../util/hooks/useMergeRefs.js";
|
|
20
20
|
/**
|
|
21
21
|
* A button component
|
|
22
22
|
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/button)
|
package/esm/button/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as Button } from "./Button";
|
|
2
|
-
export { type ButtonProps } from "./Button";
|
|
1
|
+
export { default as Button } from "./Button.js";
|
|
2
|
+
export { type ButtonProps } from "./Button.js";
|
package/esm/button/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as Button } from "./Button";
|
|
1
|
+
export { default as Button } from "./Button.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/esm/chat/Bubble.d.ts
CHANGED
|
@@ -12,11 +12,6 @@ export interface BubbleProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
12
12
|
* Timestamp for sent message
|
|
13
13
|
*/
|
|
14
14
|
timestamp?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Background color on bubble
|
|
17
|
-
* @deprecated Use `variant` on Chat instead
|
|
18
|
-
*/
|
|
19
|
-
backgroundColor?: string;
|
|
20
15
|
/**
|
|
21
16
|
* Overrides hoizontal position of toptext
|
|
22
17
|
*/
|
package/esm/chat/Bubble.js
CHANGED
|
@@ -11,10 +11,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import cl from "clsx";
|
|
13
13
|
import React, { forwardRef } from "react";
|
|
14
|
-
import { Detail } from "../typography";
|
|
14
|
+
import { Detail } from "../typography/index.js";
|
|
15
15
|
const Bubble = forwardRef((_a, ref) => {
|
|
16
|
-
var { children, className, name, timestamp,
|
|
17
|
-
return (React.createElement("div", Object.assign({ ref: ref, className: cl("navds-chat__bubble", className)
|
|
16
|
+
var { children, className, name, timestamp, toptextPosition } = _a, rest = __rest(_a, ["children", "className", "name", "timestamp", "toptextPosition"]);
|
|
17
|
+
return (React.createElement("div", Object.assign({ ref: ref, className: cl("navds-chat__bubble", className) }, rest),
|
|
18
18
|
(timestamp || name) && (React.createElement("h3", { className: cl(`navds-chat__top-text`, toptextPosition && `navds-chat__top-text--${toptextPosition}`) },
|
|
19
19
|
name && React.createElement(Detail, { as: "span" }, name),
|
|
20
20
|
name && timestamp && (React.createElement(Detail, { as: "span", "aria-hidden": true }, "\u2022")),
|
package/esm/chat/Bubble.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bubble.js","sourceRoot":"","sources":["../../src/chat/Bubble.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,EAAE,EAAkB,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Bubble.js","sourceRoot":"","sources":["../../src/chat/Bubble.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,EAAE,EAAkB,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAqBvC,MAAM,MAAM,GAAG,UAAU,CACvB,CAAC,EAAkE,EAAE,GAAG,EAAE,EAAE;QAA3E,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,OAAW,EAAN,IAAI,cAAhE,iEAAkE,CAAF;IAC/D,OAAO,CACL,2CAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,oBAAoB,EAAE,SAAS,CAAC,IAAM,IAAI;QACpE,CAAC,SAAS,IAAI,IAAI,CAAC,IAAI,CACtB,4BACE,SAAS,EAAE,EAAE,CACX,sBAAsB,EACtB,eAAe,IAAI,yBAAyB,eAAe,EAAE,CAC9D;YAEA,IAAI,IAAI,oBAAC,MAAM,IAAC,EAAE,EAAC,MAAM,IAAE,IAAI,CAAU;YACzC,IAAI,IAAI,SAAS,IAAI,CACpB,oBAAC,MAAM,IAAC,EAAE,EAAC,MAAM,kCAER,CACV;YACA,SAAS,IAAI,oBAAC,MAAM,IAAC,EAAE,EAAC,MAAM,IAAE,SAAS,CAAU,CACjD,CACN;QACA,QAAQ,CACL,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/esm/chat/Chat.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from "react";
|
|
2
|
-
import Bubble from "./Bubble";
|
|
2
|
+
import Bubble from "./Bubble.js";
|
|
3
3
|
export declare const POSITIONS: readonly ["left", "right"];
|
|
4
4
|
export declare const SIZES: readonly ["medium", "small"];
|
|
5
5
|
export interface ChatProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -25,16 +25,6 @@ export interface ChatProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
25
25
|
* @default "neutral"
|
|
26
26
|
*/
|
|
27
27
|
variant?: "subtle" | "info" | "neutral";
|
|
28
|
-
/**
|
|
29
|
-
* Background color on bubbles
|
|
30
|
-
* @deprecated Use `variant` instead
|
|
31
|
-
*/
|
|
32
|
-
backgroundColor?: string;
|
|
33
|
-
/**
|
|
34
|
-
* Background color for avatar
|
|
35
|
-
* @deprecated Use `variant` instead
|
|
36
|
-
*/
|
|
37
|
-
avatarBgColor?: string;
|
|
38
28
|
/**
|
|
39
29
|
* Positions avatar and bubbles
|
|
40
30
|
* @default "left"
|
package/esm/chat/Chat.js
CHANGED
|
@@ -11,8 +11,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import cl from "clsx";
|
|
13
13
|
import React, { forwardRef } from "react";
|
|
14
|
-
import { BodyLong } from "../typography";
|
|
15
|
-
import Bubble from "./Bubble";
|
|
14
|
+
import { BodyLong } from "../typography/index.js";
|
|
15
|
+
import Bubble from "./Bubble.js";
|
|
16
16
|
export const POSITIONS = ["left", "right"];
|
|
17
17
|
export const SIZES = ["medium", "small"];
|
|
18
18
|
/**
|
|
@@ -33,12 +33,12 @@ export const SIZES = ["medium", "small"];
|
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
35
|
export const Chat = forwardRef((_a, ref) => {
|
|
36
|
-
var { children, className, name, timestamp, avatar, position = "left", variant = "neutral",
|
|
36
|
+
var { children, className, name, timestamp, avatar, position = "left", variant = "neutral", toptextPosition, size = "medium" } = _a, rest = __rest(_a, ["children", "className", "name", "timestamp", "avatar", "position", "variant", "toptextPosition", "size"]);
|
|
37
37
|
return (React.createElement("div", Object.assign({ ref: ref, className: cl("navds-chat", className, `navds-chat--${position}`, `navds-chat--top-text-${toptextPosition !== null && toptextPosition !== void 0 ? toptextPosition : position}`, `navds-chat--${size}`, `navds-chat--${variant}`) }, rest),
|
|
38
|
-
avatar && (React.createElement("div", { className: "navds-chat__avatar", "aria-hidden": true
|
|
38
|
+
avatar && (React.createElement("div", { className: "navds-chat__avatar", "aria-hidden": true }, avatar)),
|
|
39
39
|
React.createElement("ol", { className: "navds-chat__bubble-wrapper" }, React.Children.map(children, (child, i) => {
|
|
40
40
|
if (React.isValidElement(child)) {
|
|
41
|
-
return (React.createElement(BodyLong, { as: "li", size: size }, React.cloneElement(child, Object.assign({ name: name && i === 0 ? name : undefined, timestamp: timestamp && i === 0 ? timestamp : undefined
|
|
41
|
+
return (React.createElement(BodyLong, { as: "li", size: size }, React.cloneElement(child, Object.assign({ name: name && i === 0 ? name : undefined, timestamp: timestamp && i === 0 ? timestamp : undefined }, child.props))));
|
|
42
42
|
}
|
|
43
43
|
}))));
|
|
44
44
|
});
|
package/esm/chat/Chat.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chat.js","sourceRoot":"","sources":["../../src/chat/Chat.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AACtB,OAAO,KAAK,EAAE,EAAkB,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU,CAAC;AACpD,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Chat.js","sourceRoot":"","sources":["../../src/chat/Chat.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,MAAM,CAAC;AAC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AAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EACxC,SAAS,EAAE,SAAS,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,IACpD,KAAK,CAAC,KAAK,EACd,CACO,CACZ,CAAC;YACJ,CAAC;QACH,CAAC,CAAC,CACC,CACD,CACP,CAAA;CAAA,CACe,CAAC;AAEnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;AAErB,eAAe,IAAI,CAAC"}
|
package/esm/chat/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as Chat, type ChatProps } from "./Chat";
|
|
1
|
+
export { default as Chat, type ChatProps } from "./Chat.js";
|
package/esm/chat/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as Chat } from "./Chat";
|
|
1
|
+
export { default as Chat } from "./Chat.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/esm/chips/Chips.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from "react";
|
|
2
|
-
import { OverridableComponent } from "../util/types";
|
|
3
|
-
import { RemovableChipsProps } from "./Removable";
|
|
4
|
-
import { ToggleChipsProps } from "./Toggle";
|
|
2
|
+
import { OverridableComponent } from "../util/types/index.js";
|
|
3
|
+
import { RemovableChipsProps } from "./Removable.js";
|
|
4
|
+
import { ToggleChipsProps } from "./Toggle.js";
|
|
5
5
|
export interface ChipsProps extends HTMLAttributes<HTMLUListElement> {
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
/**
|