@navikt/ds-react 6.0.0-alpha.2 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/chat/Bubble.d.ts +0 -5
- package/cjs/chat/Bubble.js +2 -2
- package/cjs/chat/Bubble.js.map +1 -1
- package/cjs/chat/Chat.d.ts +0 -10
- package/cjs/chat/Chat.js +3 -3
- package/cjs/chat/Chat.js.map +1 -1
- package/cjs/date/context/useSharedMonthContext.js +2 -6
- package/cjs/date/context/useSharedMonthContext.js.map +1 -1
- package/cjs/date/datepicker/DatePicker.js +3 -5
- package/cjs/date/datepicker/DatePicker.js.map +1 -1
- package/cjs/date/datepicker/DatePickerStandalone.js +3 -5
- package/cjs/date/datepicker/DatePickerStandalone.js.map +1 -1
- package/cjs/date/datepicker/parts/DayButton.js +2 -5
- package/cjs/date/datepicker/parts/DayButton.js.map +1 -1
- package/cjs/date/datepicker/parts/DropdownCaption.js +3 -6
- package/cjs/date/datepicker/parts/DropdownCaption.js.map +1 -1
- package/cjs/date/datepicker/parts/Row.js +2 -1
- package/cjs/date/datepicker/parts/Row.js.map +1 -1
- package/cjs/date/hooks/useDatepicker.d.ts +1 -6
- package/cjs/date/hooks/useDatepicker.js +7 -11
- package/cjs/date/hooks/useDatepicker.js.map +1 -1
- package/cjs/date/hooks/useMonthPicker.d.ts +1 -6
- package/cjs/date/hooks/useMonthPicker.js.map +1 -1
- package/cjs/date/hooks/useRangeDatepicker.js +20 -25
- package/cjs/date/hooks/useRangeDatepicker.js.map +1 -1
- package/cjs/date/monthpicker/MonthButton.js +11 -15
- package/cjs/date/monthpicker/MonthButton.js.map +1 -1
- package/cjs/date/monthpicker/MonthCaption.js +4 -7
- package/cjs/date/monthpicker/MonthCaption.js.map +1 -1
- package/cjs/date/monthpicker/MonthPicker.js +7 -1
- package/cjs/date/monthpicker/MonthPicker.js.map +1 -1
- package/cjs/date/monthpicker/MonthPickerStandalone.js +7 -1
- package/cjs/date/monthpicker/MonthPickerStandalone.js.map +1 -1
- package/cjs/date/monthpicker/MonthSelector.js +8 -11
- package/cjs/date/monthpicker/MonthSelector.js.map +1 -1
- package/cjs/date/parts/DateInput.d.ts +1 -1
- package/cjs/date/parts/DateWrapper.js +2 -2
- package/cjs/date/parts/DateWrapper.js.map +1 -1
- package/cjs/date/utils/check-dates.js +2 -6
- package/cjs/date/utils/check-dates.js.map +1 -1
- package/cjs/date/utils/dates-disabled.js +3 -6
- package/cjs/date/utils/dates-disabled.js.map +1 -1
- package/cjs/date/utils/format-date.d.ts +1 -0
- package/cjs/date/utils/format-date.js +2 -5
- package/cjs/date/utils/format-date.js.map +1 -1
- package/cjs/date/utils/get-dates.js +14 -21
- package/cjs/date/utils/get-dates.js.map +1 -1
- package/cjs/date/utils/get-initial-year.js +2 -5
- package/cjs/date/utils/get-initial-year.js.map +1 -1
- package/cjs/date/utils/is-match.js +14 -20
- package/cjs/date/utils/is-match.js.map +1 -1
- package/cjs/date/utils/labels.d.ts +1 -0
- package/cjs/date/utils/labels.js.map +1 -1
- package/cjs/date/utils/locale.d.ts +1 -1
- package/cjs/date/utils/locale.js +4 -9
- package/cjs/date/utils/locale.js.map +1 -1
- package/cjs/date/utils/navigation.js +21 -24
- package/cjs/date/utils/navigation.js.map +1 -1
- package/cjs/date/utils/parse-date.d.ts +1 -0
- package/cjs/date/utils/parse-date.js +8 -13
- package/cjs/date/utils/parse-date.js.map +1 -1
- package/cjs/form/Textarea.js +8 -8
- package/cjs/form/Textarea.js.map +1 -1
- package/cjs/form/combobox/Combobox.js +1 -1
- package/cjs/form/combobox/Combobox.js.map +1 -1
- package/cjs/form/combobox/ComboboxProvider.js +2 -1
- package/cjs/form/combobox/ComboboxProvider.js.map +1 -1
- package/cjs/form/combobox/ComboboxWrapper.js +1 -1
- package/cjs/form/combobox/ComboboxWrapper.js.map +1 -1
- package/cjs/form/combobox/FilteredOptions/FilteredOptions.js +59 -41
- package/cjs/form/combobox/FilteredOptions/FilteredOptions.js.map +1 -1
- package/cjs/form/combobox/FilteredOptions/filtered-options-util.d.ts +2 -1
- package/cjs/form/combobox/FilteredOptions/filtered-options-util.js +3 -1
- package/cjs/form/combobox/FilteredOptions/filtered-options-util.js.map +1 -1
- package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.js +15 -3
- package/cjs/form/combobox/FilteredOptions/filteredOptionsContext.js.map +1 -1
- package/cjs/form/combobox/FilteredOptions/useVirtualFocus.d.ts +2 -4
- package/cjs/form/combobox/FilteredOptions/useVirtualFocus.js +52 -32
- package/cjs/form/combobox/FilteredOptions/useVirtualFocus.js.map +1 -1
- package/cjs/form/combobox/Input/Input.js +3 -1
- package/cjs/form/combobox/Input/Input.js.map +1 -1
- package/cjs/form/combobox/SelectedOptions/selectedOptionsContext.d.ts +5 -2
- package/cjs/form/combobox/SelectedOptions/selectedOptionsContext.js +3 -1
- package/cjs/form/combobox/SelectedOptions/selectedOptionsContext.js.map +1 -1
- package/cjs/form/combobox/types.d.ts +14 -0
- package/cjs/form/search/Search.d.ts +2 -1
- package/cjs/form/search/Search.js +2 -2
- package/cjs/form/search/Search.js.map +1 -1
- package/cjs/index.d.ts +1 -2
- package/cjs/index.js +2 -3
- package/cjs/index.js.map +1 -1
- package/cjs/layout/bleed/Bleed.d.ts +2 -2
- package/cjs/layout/utilities/css.js +4 -0
- package/cjs/layout/utilities/css.js.map +1 -1
- package/cjs/layout/utilities/types.d.ts +1 -1
- package/cjs/modal/Modal.context.d.ts +9 -0
- package/cjs/modal/Modal.context.js +10 -0
- package/cjs/modal/Modal.context.js.map +1 -0
- package/cjs/modal/Modal.js +3 -6
- package/cjs/modal/Modal.js.map +1 -1
- package/cjs/modal/ModalHeader.js +2 -6
- package/cjs/modal/ModalHeader.js.map +1 -1
- package/cjs/modal/types.d.ts +24 -3
- package/cjs/overlays/index.d.ts +2 -0
- package/cjs/overlays/index.js +6 -0
- package/cjs/overlays/index.js.map +1 -0
- package/cjs/overlays/portal/Portal.d.ts +11 -0
- package/cjs/{grid/Grid.js → overlays/portal/Portal.js} +15 -11
- package/cjs/overlays/portal/Portal.js.map +1 -0
- package/cjs/panel/Panel.d.ts +9 -16
- package/cjs/panel/Panel.js +6 -16
- package/cjs/panel/Panel.js.map +1 -1
- package/cjs/popover/Popover.js +2 -2
- package/cjs/popover/Popover.js.map +1 -1
- package/cjs/table/types.d.ts +1 -1
- package/cjs/tabs/TabList.js +2 -2
- package/cjs/tabs/TabList.js.map +1 -1
- package/cjs/tabs/TabPanel.js +2 -2
- package/cjs/tabs/TabPanel.js.map +1 -1
- package/cjs/timeline/AxisLabels.js +4 -4
- package/cjs/timeline/AxisLabels.js.map +1 -1
- package/cjs/tooltip/Tooltip.js +5 -9
- package/cjs/tooltip/Tooltip.js.map +1 -1
- package/cjs/util/Slot.js +5 -2
- package/cjs/util/Slot.js.map +1 -1
- package/cjs/util/TextareaAutoSize.js +14 -24
- package/cjs/util/TextareaAutoSize.js.map +1 -1
- package/cjs/util/create-context.d.ts +2 -5
- package/cjs/util/create-context.js +9 -5
- package/cjs/util/create-context.js.map +1 -1
- package/cjs/util/types/AsChildProps.d.ts +36 -0
- package/cjs/util/types/AsChildProps.js +3 -0
- package/cjs/util/types/AsChildProps.js.map +1 -0
- package/cjs/util/types/OverridableComponent.d.ts +1 -1
- package/cjs/util/types/index.d.ts +1 -0
- package/esm/accordion/Accordion.d.ts +3 -3
- package/esm/accordion/Accordion.js +4 -4
- package/esm/accordion/AccordionContent.js +2 -2
- package/esm/accordion/AccordionHeader.js +4 -4
- package/esm/accordion/AccordionItem.js +3 -3
- package/esm/accordion/index.d.ts +1 -1
- package/esm/accordion/index.js +1 -1
- package/esm/alert/Alert.js +2 -2
- package/esm/alert/index.d.ts +2 -2
- package/esm/alert/index.js +1 -1
- package/esm/button/Button.d.ts +1 -1
- package/esm/button/Button.js +6 -6
- package/esm/button/index.d.ts +2 -2
- package/esm/button/index.js +1 -1
- package/esm/chat/Bubble.d.ts +0 -5
- package/esm/chat/Bubble.js +3 -3
- package/esm/chat/Bubble.js.map +1 -1
- package/esm/chat/Chat.d.ts +1 -11
- package/esm/chat/Chat.js +5 -5
- package/esm/chat/Chat.js.map +1 -1
- package/esm/chat/index.d.ts +1 -1
- package/esm/chat/index.js +1 -1
- package/esm/chips/Chips.d.ts +3 -3
- package/esm/chips/Chips.js +2 -2
- package/esm/chips/Removable.js +1 -1
- package/esm/chips/Toggle.d.ts +1 -1
- package/esm/chips/index.d.ts +1 -1
- package/esm/chips/index.js +1 -1
- package/esm/copybutton/CopyButton.js +3 -3
- package/esm/copybutton/index.d.ts +1 -1
- package/esm/copybutton/index.js +1 -1
- package/esm/date/context/index.d.ts +2 -2
- package/esm/date/context/index.js +2 -2
- package/esm/date/context/useSharedMonthContext.d.ts +1 -1
- package/esm/date/context/useSharedMonthContext.js +2 -3
- package/esm/date/context/useSharedMonthContext.js.map +1 -1
- package/esm/date/datepicker/DatePicker.d.ts +3 -3
- package/esm/date/datepicker/DatePicker.js +15 -17
- package/esm/date/datepicker/DatePicker.js.map +1 -1
- package/esm/date/datepicker/DatePickerStandalone.d.ts +1 -1
- package/esm/date/datepicker/DatePickerStandalone.js +9 -11
- package/esm/date/datepicker/DatePickerStandalone.js.map +1 -1
- package/esm/date/datepicker/parts/Caption.js +3 -3
- package/esm/date/datepicker/parts/DayButton.js +1 -1
- package/esm/date/datepicker/parts/DayButton.js.map +1 -1
- package/esm/date/datepicker/parts/DropdownCaption.js +6 -9
- package/esm/date/datepicker/parts/DropdownCaption.js.map +1 -1
- package/esm/date/datepicker/parts/HeadRow.js +1 -1
- package/esm/date/datepicker/parts/Row.js +5 -4
- package/esm/date/datepicker/parts/Row.js.map +1 -1
- package/esm/date/datepicker/parts/WeekNumber.js +1 -1
- package/esm/date/datepicker/parts/WeekRow.js +6 -6
- package/esm/date/hooks/index.d.ts +6 -6
- package/esm/date/hooks/index.js +3 -3
- package/esm/date/hooks/useDatepicker.d.ts +3 -8
- package/esm/date/hooks/useDatepicker.js +2 -3
- package/esm/date/hooks/useDatepicker.js.map +1 -1
- package/esm/date/hooks/useMonthPicker.d.ts +3 -8
- package/esm/date/hooks/useMonthPicker.js +1 -1
- package/esm/date/hooks/useMonthPicker.js.map +1 -1
- package/esm/date/hooks/useRangeDatepicker.d.ts +3 -3
- package/esm/date/hooks/useRangeDatepicker.js +2 -4
- package/esm/date/hooks/useRangeDatepicker.js.map +1 -1
- package/esm/date/index.d.ts +7 -7
- package/esm/date/index.js +3 -3
- package/esm/date/monthpicker/MonthButton.js +3 -7
- package/esm/date/monthpicker/MonthButton.js.map +1 -1
- package/esm/date/monthpicker/MonthCaption.js +5 -8
- package/esm/date/monthpicker/MonthCaption.js.map +1 -1
- package/esm/date/monthpicker/MonthPicker.d.ts +3 -3
- package/esm/date/monthpicker/MonthPicker.js +17 -11
- package/esm/date/monthpicker/MonthPicker.js.map +1 -1
- package/esm/date/monthpicker/MonthPickerStandalone.d.ts +1 -1
- package/esm/date/monthpicker/MonthPickerStandalone.js +12 -6
- package/esm/date/monthpicker/MonthPickerStandalone.js.map +1 -1
- package/esm/date/monthpicker/MonthSelector.js +5 -8
- package/esm/date/monthpicker/MonthSelector.js.map +1 -1
- package/esm/date/monthpicker/types.d.ts +1 -1
- package/esm/date/parts/DateInput.d.ts +2 -2
- package/esm/date/parts/DateInput.js +5 -5
- package/esm/date/parts/DateWrapper.js +8 -8
- package/esm/date/parts/DateWrapper.js.map +1 -1
- package/esm/date/utils/check-dates.js +1 -2
- package/esm/date/utils/check-dates.js.map +1 -1
- package/esm/date/utils/dates-disabled.js +1 -1
- package/esm/date/utils/dates-disabled.js.map +1 -1
- package/esm/date/utils/format-date.d.ts +1 -0
- package/esm/date/utils/format-date.js +2 -2
- package/esm/date/utils/format-date.js.map +1 -1
- package/esm/date/utils/get-dates.js +1 -5
- package/esm/date/utils/get-dates.js.map +1 -1
- package/esm/date/utils/get-initial-year.js +1 -1
- package/esm/date/utils/get-initial-year.js.map +1 -1
- package/esm/date/utils/index.d.ts +10 -10
- package/esm/date/utils/index.js +10 -10
- package/esm/date/utils/is-match.js +1 -4
- package/esm/date/utils/is-match.js.map +1 -1
- package/esm/date/utils/labels.d.ts +1 -0
- package/esm/date/utils/labels.js.map +1 -1
- package/esm/date/utils/locale.d.ts +1 -1
- package/esm/date/utils/locale.js +1 -3
- package/esm/date/utils/locale.js.map +1 -1
- package/esm/date/utils/navigation.d.ts +1 -1
- package/esm/date/utils/navigation.js +2 -2
- package/esm/date/utils/navigation.js.map +1 -1
- package/esm/date/utils/parse-date.d.ts +1 -0
- package/esm/date/utils/parse-date.js +2 -4
- package/esm/date/utils/parse-date.js.map +1 -1
- package/esm/dropdown/Dropdown.d.ts +2 -2
- package/esm/dropdown/Dropdown.js +4 -4
- package/esm/dropdown/Menu/GroupedList/GroupedItem.d.ts +1 -1
- package/esm/dropdown/Menu/GroupedList/GroupedItem.js +2 -2
- package/esm/dropdown/Menu/GroupedList/index.d.ts +3 -3
- package/esm/dropdown/Menu/GroupedList/index.js +2 -2
- package/esm/dropdown/Menu/List/Item.d.ts +1 -1
- package/esm/dropdown/Menu/List/Item.js +2 -2
- package/esm/dropdown/Menu/List/index.d.ts +2 -2
- package/esm/dropdown/Menu/List/index.js +1 -1
- package/esm/dropdown/Menu/index.d.ts +2 -2
- package/esm/dropdown/Menu/index.js +5 -5
- package/esm/dropdown/Toggle.js +2 -2
- package/esm/dropdown/index.d.ts +1 -1
- package/esm/dropdown/index.js +1 -1
- package/esm/expansion-card/ExpansionCard.d.ts +5 -5
- package/esm/expansion-card/ExpansionCard.js +5 -5
- package/esm/expansion-card/ExpansionCardContent.js +2 -2
- package/esm/expansion-card/ExpansionCardDescription.js +2 -2
- package/esm/expansion-card/ExpansionCardHeader.js +1 -1
- package/esm/expansion-card/ExpansionCardTitle.d.ts +1 -1
- package/esm/expansion-card/index.d.ts +1 -1
- package/esm/expansion-card/index.js +1 -1
- package/esm/form/ConfirmationPanel.d.ts +1 -1
- package/esm/form/ConfirmationPanel.js +4 -4
- package/esm/form/Fieldset/Fieldset.d.ts +1 -1
- package/esm/form/Fieldset/Fieldset.js +5 -5
- package/esm/form/Fieldset/index.d.ts +2 -2
- package/esm/form/Fieldset/index.js +2 -2
- package/esm/form/Fieldset/useFieldset.js +1 -1
- package/esm/form/Select.d.ts +1 -1
- package/esm/form/Select.js +4 -4
- package/esm/form/Switch.d.ts +1 -1
- package/esm/form/Switch.js +5 -5
- package/esm/form/TextField.d.ts +1 -1
- package/esm/form/TextField.js +4 -4
- package/esm/form/Textarea.d.ts +1 -1
- package/esm/form/Textarea.js +15 -15
- package/esm/form/Textarea.js.map +1 -1
- package/esm/form/TextareaCounter.d.ts +1 -1
- package/esm/form/TextareaCounter.js +2 -2
- package/esm/form/checkbox/Checkbox.d.ts +1 -1
- package/esm/form/checkbox/Checkbox.js +5 -5
- package/esm/form/checkbox/CheckboxGroup.d.ts +1 -1
- package/esm/form/checkbox/CheckboxGroup.js +1 -1
- package/esm/form/checkbox/index.d.ts +3 -3
- package/esm/form/checkbox/index.js +2 -2
- package/esm/form/checkbox/types.d.ts +1 -1
- package/esm/form/checkbox/useCheckbox.d.ts +1 -1
- package/esm/form/checkbox/useCheckbox.js +3 -3
- package/esm/form/combobox/Combobox.d.ts +1 -1
- package/esm/form/combobox/Combobox.js +12 -12
- package/esm/form/combobox/Combobox.js.map +1 -1
- package/esm/form/combobox/ComboboxProvider.d.ts +1 -1
- package/esm/form/combobox/ComboboxProvider.js +7 -6
- package/esm/form/combobox/ComboboxProvider.js.map +1 -1
- package/esm/form/combobox/ComboboxWrapper.js +1 -1
- package/esm/form/combobox/ComboboxWrapper.js.map +1 -1
- package/esm/form/combobox/FilteredOptions/FilteredOptions.js +65 -47
- package/esm/form/combobox/FilteredOptions/FilteredOptions.js.map +1 -1
- package/esm/form/combobox/FilteredOptions/filtered-options-util.d.ts +2 -1
- package/esm/form/combobox/FilteredOptions/filtered-options-util.js +3 -1
- package/esm/form/combobox/FilteredOptions/filtered-options-util.js.map +1 -1
- package/esm/form/combobox/FilteredOptions/filteredOptionsContext.d.ts +2 -2
- package/esm/form/combobox/FilteredOptions/filteredOptionsContext.js +20 -8
- package/esm/form/combobox/FilteredOptions/filteredOptionsContext.js.map +1 -1
- package/esm/form/combobox/FilteredOptions/useVirtualFocus.d.ts +2 -4
- package/esm/form/combobox/FilteredOptions/useVirtualFocus.js +52 -32
- package/esm/form/combobox/FilteredOptions/useVirtualFocus.js.map +1 -1
- package/esm/form/combobox/Input/Input.js +8 -6
- package/esm/form/combobox/Input/Input.js.map +1 -1
- package/esm/form/combobox/Input/inputContext.d.ts +1 -1
- package/esm/form/combobox/Input/inputContext.js +2 -2
- package/esm/form/combobox/SelectedOptions/SelectedOptions.js +3 -3
- package/esm/form/combobox/SelectedOptions/selectedOptionsContext.d.ts +5 -2
- package/esm/form/combobox/SelectedOptions/selectedOptionsContext.js +6 -4
- package/esm/form/combobox/SelectedOptions/selectedOptionsContext.js.map +1 -1
- package/esm/form/combobox/ToggleListButton.js +1 -1
- package/esm/form/combobox/customOptionsContext.js +1 -1
- package/esm/form/combobox/index.d.ts +2 -2
- package/esm/form/combobox/index.js +1 -1
- package/esm/form/combobox/types.d.ts +15 -1
- package/esm/form/error-summary/ErrorSummary.d.ts +1 -1
- package/esm/form/error-summary/ErrorSummary.js +3 -3
- package/esm/form/error-summary/ErrorSummaryItem.d.ts +1 -1
- package/esm/form/error-summary/index.d.ts +2 -2
- package/esm/form/error-summary/index.js +1 -1
- package/esm/form/index.d.ts +11 -11
- package/esm/form/index.js +11 -11
- package/esm/form/radio/Radio.d.ts +1 -1
- package/esm/form/radio/Radio.js +4 -4
- package/esm/form/radio/RadioGroup.d.ts +1 -1
- package/esm/form/radio/RadioGroup.js +2 -2
- package/esm/form/radio/index.d.ts +3 -3
- package/esm/form/radio/index.js +2 -2
- package/esm/form/radio/types.d.ts +1 -1
- package/esm/form/radio/useRadio.d.ts +1 -1
- package/esm/form/radio/useRadio.js +3 -3
- package/esm/form/search/Search.d.ts +4 -3
- package/esm/form/search/Search.js +8 -8
- package/esm/form/search/Search.js.map +1 -1
- package/esm/form/search/SearchButton.d.ts +1 -1
- package/esm/form/search/SearchButton.js +3 -3
- package/esm/form/search/index.d.ts +1 -1
- package/esm/form/search/index.js +1 -1
- package/esm/form/useFormField.js +2 -2
- package/esm/guide-panel/GuidePanel.js +1 -1
- package/esm/guide-panel/Illustration.js +1 -1
- package/esm/guide-panel/index.d.ts +2 -2
- package/esm/guide-panel/index.js +2 -2
- package/esm/help-text/HelpText.d.ts +1 -1
- package/esm/help-text/HelpText.js +4 -4
- package/esm/help-text/HelpTextIcon.js +1 -1
- package/esm/help-text/index.d.ts +2 -2
- package/esm/help-text/index.js +1 -1
- package/esm/index.d.ts +40 -41
- package/esm/index.js +40 -41
- package/esm/index.js.map +1 -1
- package/esm/internal-header/InternalHeader.d.ts +5 -5
- package/esm/internal-header/InternalHeader.js +4 -4
- package/esm/internal-header/InternalHeaderButton.d.ts +1 -1
- package/esm/internal-header/InternalHeaderTitle.d.ts +1 -1
- package/esm/internal-header/InternalHeaderUser.js +1 -1
- package/esm/internal-header/InternalHeaderUserButton.d.ts +1 -1
- package/esm/internal-header/InternalHeaderUserButton.js +2 -2
- package/esm/internal-header/index.d.ts +5 -5
- package/esm/internal-header/index.js +1 -1
- package/esm/layout/bleed/Bleed.d.ts +3 -3
- package/esm/layout/bleed/Bleed.js +2 -2
- package/esm/layout/bleed/index.d.ts +1 -1
- package/esm/layout/bleed/index.js +1 -1
- package/esm/layout/box/Box.d.ts +2 -2
- package/esm/layout/box/Box.js +1 -1
- package/esm/layout/box/index.d.ts +1 -1
- package/esm/layout/box/index.js +1 -1
- package/esm/layout/grid/HGrid.d.ts +1 -1
- package/esm/layout/grid/HGrid.js +1 -1
- package/esm/layout/grid/index.d.ts +1 -1
- package/esm/layout/grid/index.js +1 -1
- package/esm/layout/page/Page.d.ts +2 -2
- package/esm/layout/page/Page.js +1 -1
- package/esm/layout/page/index.d.ts +2 -2
- package/esm/layout/page/index.js +1 -1
- package/esm/layout/page/parts/PageBlock.d.ts +1 -1
- package/esm/layout/responsive/Responsive.d.ts +1 -1
- package/esm/layout/responsive/Responsive.js +1 -1
- package/esm/layout/responsive/index.d.ts +1 -1
- package/esm/layout/responsive/index.js +1 -1
- package/esm/layout/sidemal-test/AvatarPanel.js +2 -2
- package/esm/layout/sidemal-test/Content.js +9 -9
- package/esm/layout/sidemal-test/Filter.js +4 -4
- package/esm/layout/sidemal-test/Header.js +5 -5
- package/esm/layout/sidemal-test/Intro.js +4 -4
- package/esm/layout/sidemal-test/Sidebar.js +4 -4
- package/esm/layout/sidemal-test/content-box/ContentBox.d.ts +1 -1
- package/esm/layout/sidemal-test/content-box/index.d.ts +1 -1
- package/esm/layout/sidemal-test/content-box/index.js +1 -1
- package/esm/layout/stack/HStack.d.ts +2 -2
- package/esm/layout/stack/HStack.js +1 -1
- package/esm/layout/stack/Stack.d.ts +2 -2
- package/esm/layout/stack/Stack.js +1 -1
- package/esm/layout/stack/VStack.d.ts +2 -2
- package/esm/layout/stack/VStack.js +1 -1
- package/esm/layout/stack/index.d.ts +4 -4
- package/esm/layout/stack/index.js +4 -4
- package/esm/layout/utilities/css.d.ts +1 -1
- package/esm/layout/utilities/css.js +4 -0
- package/esm/layout/utilities/css.js.map +1 -1
- package/esm/layout/utilities/types.d.ts +1 -1
- package/esm/link/Link.d.ts +1 -1
- package/esm/link/index.d.ts +2 -2
- package/esm/link/index.js +1 -1
- package/esm/link-panel/LinkPanel.d.ts +3 -3
- package/esm/link-panel/LinkPanel.js +3 -3
- package/esm/link-panel/LinkPanelDescription.js +1 -1
- package/esm/link-panel/LinkPanelTitle.d.ts +1 -1
- package/esm/link-panel/index.d.ts +2 -2
- package/esm/link-panel/index.js +1 -1
- package/esm/list/List.d.ts +2 -2
- package/esm/list/List.js +4 -4
- package/esm/list/ListItem.js +2 -2
- package/esm/list/context.d.ts +1 -1
- package/esm/list/index.d.ts +2 -2
- package/esm/list/index.js +1 -1
- package/esm/loader/Loader.js +2 -2
- package/esm/loader/index.d.ts +2 -2
- package/esm/loader/index.js +1 -1
- package/esm/modal/Modal.context.d.ts +9 -0
- package/esm/modal/Modal.context.js +6 -0
- package/esm/modal/Modal.context.js.map +1 -0
- package/esm/modal/Modal.d.ts +4 -4
- package/esm/modal/Modal.js +14 -17
- package/esm/modal/Modal.js.map +1 -1
- package/esm/modal/ModalHeader.js +4 -8
- package/esm/modal/ModalHeader.js.map +1 -1
- package/esm/modal/ModalUtils.d.ts +1 -1
- package/esm/modal/index.d.ts +5 -5
- package/esm/modal/index.js +1 -1
- package/esm/modal/types.d.ts +24 -3
- package/esm/overlays/index.d.ts +2 -0
- package/esm/overlays/index.js +2 -0
- package/esm/overlays/index.js.map +1 -0
- package/esm/overlays/portal/Portal.d.ts +11 -0
- package/esm/overlays/portal/Portal.js +27 -0
- package/esm/overlays/portal/Portal.js.map +1 -0
- package/esm/package.json +1 -1
- package/esm/pagination/Pagination.d.ts +1 -1
- package/esm/pagination/Pagination.js +2 -2
- package/esm/pagination/PaginationItem.d.ts +2 -2
- package/esm/pagination/PaginationItem.js +1 -1
- package/esm/pagination/index.d.ts +1 -1
- package/esm/pagination/index.js +1 -1
- package/esm/panel/Panel.d.ts +10 -17
- package/esm/panel/Panel.js +6 -16
- package/esm/panel/Panel.js.map +1 -1
- package/esm/panel/index.d.ts +2 -2
- package/esm/panel/index.js +1 -1
- package/esm/popover/Popover.d.ts +1 -1
- package/esm/popover/Popover.js +6 -6
- package/esm/popover/Popover.js.map +1 -1
- package/esm/popover/index.d.ts +2 -2
- package/esm/popover/index.js +1 -1
- package/esm/provider/index.d.ts +1 -1
- package/esm/provider/index.js +1 -1
- package/esm/read-more/ReadMore.js +3 -3
- package/esm/read-more/index.d.ts +2 -2
- package/esm/read-more/index.js +1 -1
- package/esm/skeleton/index.d.ts +2 -2
- package/esm/skeleton/index.js +1 -1
- package/esm/stepper/Step.d.ts +1 -1
- package/esm/stepper/Step.js +3 -3
- package/esm/stepper/Stepper.d.ts +1 -1
- package/esm/stepper/Stepper.js +2 -2
- package/esm/stepper/index.d.ts +1 -1
- package/esm/stepper/index.js +1 -1
- package/esm/table/ColumnHeader.d.ts +1 -1
- package/esm/table/ColumnHeader.js +2 -2
- package/esm/table/DataCell.js +1 -1
- package/esm/table/ExpandableRow.d.ts +1 -1
- package/esm/table/ExpandableRow.js +6 -6
- package/esm/table/Table.d.ts +8 -8
- package/esm/table/Table.js +8 -8
- package/esm/table/context.d.ts +1 -1
- package/esm/table/index.d.ts +9 -9
- package/esm/table/index.js +1 -1
- package/esm/table/types.d.ts +1 -1
- package/esm/tabs/Tab.d.ts +1 -1
- package/esm/tabs/Tab.js +2 -2
- package/esm/tabs/TabList.js +5 -5
- package/esm/tabs/TabList.js.map +1 -1
- package/esm/tabs/TabPanel.js +2 -2
- package/esm/tabs/TabPanel.js.map +1 -1
- package/esm/tabs/Tabs.d.ts +4 -4
- package/esm/tabs/Tabs.js +4 -4
- package/esm/tabs/index.d.ts +4 -4
- package/esm/tabs/index.js +1 -1
- package/esm/tag/Tag.js +1 -1
- package/esm/tag/index.d.ts +1 -1
- package/esm/tag/index.js +1 -1
- package/esm/timeline/AxisLabels.d.ts +1 -1
- package/esm/timeline/AxisLabels.js +5 -5
- package/esm/timeline/AxisLabels.js.map +1 -1
- package/esm/timeline/Pin.d.ts +1 -1
- package/esm/timeline/Pin.js +3 -3
- package/esm/timeline/Timeline.d.ts +5 -5
- package/esm/timeline/Timeline.js +9 -9
- package/esm/timeline/TimelineRow.d.ts +1 -1
- package/esm/timeline/TimelineRow.js +5 -5
- package/esm/timeline/hooks/useRowContext.d.ts +1 -1
- package/esm/timeline/hooks/useTimelineRows.d.ts +1 -1
- package/esm/timeline/hooks/useTimelineRows.js +3 -3
- package/esm/timeline/index.d.ts +6 -6
- package/esm/timeline/index.js +1 -1
- package/esm/timeline/period/ClickablePeriod.d.ts +1 -1
- package/esm/timeline/period/ClickablePeriod.js +5 -5
- package/esm/timeline/period/NonClickablePeriod.d.ts +1 -1
- package/esm/timeline/period/NonClickablePeriod.js +1 -1
- package/esm/timeline/period/index.d.ts +1 -1
- package/esm/timeline/period/index.js +4 -4
- package/esm/timeline/utils/filter.d.ts +1 -1
- package/esm/timeline/utils/index.d.ts +1 -1
- package/esm/timeline/utils/index.js +1 -1
- package/esm/timeline/utils/sort.d.ts +1 -1
- package/esm/timeline/utils/timeline.d.ts +1 -1
- package/esm/timeline/utils/timeline.js +1 -1
- package/esm/timeline/zoom/ZoomButton.js +2 -2
- package/esm/timeline/zoom/index.d.ts +1 -1
- package/esm/timeline/zoom/index.js +1 -1
- package/esm/toggle-group/ToggleGroup.d.ts +1 -1
- package/esm/toggle-group/ToggleGroup.js +4 -4
- package/esm/toggle-group/ToggleItem.js +2 -2
- package/esm/toggle-group/index.d.ts +2 -2
- package/esm/toggle-group/index.js +1 -1
- package/esm/tooltip/Tooltip.js +11 -15
- package/esm/tooltip/Tooltip.js.map +1 -1
- package/esm/tooltip/index.d.ts +1 -1
- package/esm/tooltip/index.js +1 -1
- package/esm/typography/BodyLong.d.ts +2 -2
- package/esm/typography/BodyLong.js +1 -1
- package/esm/typography/BodyShort.d.ts +2 -2
- package/esm/typography/BodyShort.js +1 -1
- package/esm/typography/Detail.d.ts +2 -2
- package/esm/typography/Detail.js +1 -1
- package/esm/typography/ErrorMessage.d.ts +2 -2
- package/esm/typography/ErrorMessage.js +1 -1
- package/esm/typography/Heading.d.ts +2 -2
- package/esm/typography/Heading.js +1 -1
- package/esm/typography/Ingress.d.ts +1 -1
- package/esm/typography/Label.d.ts +2 -2
- package/esm/typography/Label.js +1 -1
- package/esm/typography/index.d.ts +7 -7
- package/esm/typography/index.js +7 -7
- package/esm/typography/util.d.ts +1 -1
- package/esm/util/Slot.js +6 -3
- package/esm/util/Slot.js.map +1 -1
- package/esm/util/TextareaAutoSize.js +17 -27
- package/esm/util/TextareaAutoSize.js.map +1 -1
- package/esm/util/create-context.d.ts +2 -5
- package/esm/util/create-context.js +10 -6
- package/esm/util/create-context.js.map +1 -1
- package/esm/util/hooks/descendants/descendant.js +1 -1
- package/esm/util/hooks/descendants/useDescendant.d.ts +1 -1
- package/esm/util/hooks/descendants/useDescendant.js +5 -5
- package/esm/util/hooks/index.d.ts +8 -8
- package/esm/util/hooks/index.js +8 -8
- package/esm/util/hooks/useControllableState.js +1 -1
- package/esm/util/index.d.ts +6 -6
- package/esm/util/index.js +5 -5
- package/esm/util/types/AsChildProps.d.ts +36 -0
- package/esm/util/types/AsChildProps.js +2 -0
- package/esm/util/types/AsChildProps.js.map +1 -0
- package/esm/util/types/OverridableComponent.d.ts +1 -1
- package/esm/util/types/index.d.ts +2 -1
- package/package.json +11 -10
- package/src/accordion/accordion.stories.tsx +121 -135
- package/src/alert/alert.stories.tsx +202 -113
- package/src/button/button.stories.tsx +88 -185
- package/src/chat/Bubble.tsx +2 -23
- package/src/chat/Chat.tsx +1 -18
- package/src/chat/chat.stories.tsx +284 -216
- package/src/date/context/useSharedMonthContext.tsx +1 -2
- package/src/date/datepicker/DatePicker.tsx +1 -3
- package/src/date/datepicker/DatePickerStandalone.tsx +1 -3
- package/src/date/datepicker/datepicker.stories.tsx +11 -7
- package/src/date/datepicker/parts/DayButton.tsx +1 -1
- package/src/date/datepicker/parts/DropdownCaption.tsx +1 -4
- package/src/date/datepicker/parts/Row.tsx +3 -2
- package/src/date/hooks/useDatepicker.tsx +2 -8
- package/src/date/hooks/useMonthPicker.tsx +1 -6
- package/src/date/hooks/useRangeDatepicker.tsx +5 -3
- package/src/date/monthpicker/MonthButton.tsx +7 -5
- package/src/date/monthpicker/MonthCaption.tsx +7 -4
- package/src/date/monthpicker/MonthPicker.tsx +10 -8
- package/src/date/monthpicker/MonthPickerStandalone.tsx +10 -8
- package/src/date/monthpicker/MonthSelector.tsx +1 -4
- package/src/date/monthpicker/monthpicker.stories.tsx +5 -3
- package/src/date/parts/DateInput.tsx +1 -1
- package/src/date/parts/DateWrapper.tsx +3 -3
- package/src/date/utils/__tests__/format-dates.test.ts +1 -1
- package/src/date/utils/__tests__/get-initial-year.test.ts +1 -1
- package/src/date/utils/__tests__/parse-dates.test.ts +2 -2
- package/src/date/utils/check-dates.ts +1 -2
- package/src/date/utils/dates-disabled.ts +1 -1
- package/src/date/utils/format-date.ts +1 -1
- package/src/date/utils/get-dates.ts +7 -5
- package/src/date/utils/get-initial-year.ts +1 -1
- package/src/date/utils/is-match.ts +6 -4
- package/src/date/utils/labels.ts +1 -0
- package/src/date/utils/locale.ts +1 -3
- package/src/date/utils/navigation.ts +1 -1
- package/src/date/utils/parse-date.ts +1 -3
- package/src/dropdown/dropdown.stories.tsx +1 -1
- package/src/form/Textarea.tsx +34 -34
- package/src/form/combobox/Combobox.tsx +1 -1
- package/src/form/combobox/ComboboxProvider.tsx +2 -0
- package/src/form/combobox/ComboboxWrapper.tsx +0 -1
- package/src/form/combobox/FilteredOptions/FilteredOptions.tsx +131 -92
- package/src/form/combobox/FilteredOptions/filtered-options-util.ts +9 -2
- package/src/form/combobox/FilteredOptions/filteredOptionsContext.tsx +22 -3
- package/src/form/combobox/FilteredOptions/useVirtualFocus.ts +63 -45
- package/src/form/combobox/Input/Input.tsx +3 -1
- package/src/form/combobox/SelectedOptions/selectedOptionsContext.tsx +11 -1
- package/src/form/combobox/combobox.stories.tsx +36 -1
- package/src/form/combobox/combobox.test.tsx +1 -3
- package/src/form/combobox/types.ts +15 -0
- package/src/form/error-summary/error-summary.stories.tsx +1 -1
- package/src/form/search/Search.tsx +7 -2
- package/src/form/stories/confirmation-panel.stories.tsx +1 -1
- package/src/form/stories/textarea.stories.tsx +37 -0
- package/src/help-text/help-text.stories.tsx +2 -1
- package/src/index.ts +2 -2
- package/src/internal-header/header.stories.tsx +2 -1
- package/src/layout/bleed/Bleed.stories.tsx +15 -1
- package/src/layout/bleed/Bleed.tsx +2 -2
- package/src/layout/box/Box.stories.tsx +3 -2
- package/src/layout/sidemal-test/navno-sidemal.stories.tsx +5 -1
- package/src/layout/utilities/css.ts +3 -0
- package/src/layout/utilities/types.ts +1 -1
- package/src/link/stories/link.stories.tsx +20 -22
- package/src/link-panel/link-panel.stories.tsx +1 -1
- package/src/list/list.stories.tsx +2 -1
- package/src/loader/loader.stories.tsx +1 -1
- package/src/modal/Modal.context.ts +13 -0
- package/src/modal/Modal.test.tsx +2 -2
- package/src/modal/Modal.tsx +6 -8
- package/src/modal/ModalHeader.tsx +3 -7
- package/src/modal/modal.stories.tsx +33 -6
- package/src/modal/types.ts +21 -4
- package/src/overlays/index.ts +2 -0
- package/src/overlays/portal/Portal.stories.tsx +99 -0
- package/src/overlays/portal/Portal.tsx +32 -0
- package/src/panel/Panel.tsx +9 -16
- package/src/popover/Popover.tsx +2 -2
- package/src/stepper/stepper.stories.tsx +1 -1
- package/src/table/stories/{table.stories.tsx → table-1.stories.tsx} +118 -92
- package/src/table/stories/{table-expandable.stories.tsx → table-2-expandable.stories.tsx} +10 -34
- package/src/table/stories/{table-async.stories.tsx → table-3-async.stories.tsx} +5 -3
- package/src/table/stories/tests/table.stories.tsx +4 -1
- package/src/table/types.ts +1 -1
- package/src/tabs/TabList.tsx +2 -2
- package/src/tabs/TabPanel.tsx +2 -2
- package/src/tabs/Tabs.test.tsx +109 -0
- package/src/timeline/AxisLabels.tsx +1 -1
- package/src/toggle-group/ToggleGroup.test.tsx +54 -0
- package/src/tooltip/Tooltip.tsx +7 -17
- package/src/tooltip/tooltip.stories.tsx +4 -1
- package/src/typography/stories/bodylong.stories.tsx +49 -3
- package/src/typography/stories/bodyshort.stories.tsx +50 -4
- package/src/typography/stories/detail.stories.tsx +32 -3
- package/src/typography/stories/error-message.stories.tsx +34 -3
- package/src/typography/stories/heading.stories.tsx +32 -3
- package/src/typography/stories/label.stories.tsx +38 -3
- package/src/util/Slot.tsx +4 -2
- package/src/util/TextareaAutoSize.tsx +16 -31
- package/src/util/create-context.tsx +26 -15
- package/src/util/types/AsChildProps.ts +37 -0
- package/src/util/types/OverridableComponent.ts +1 -1
- package/src/util/types/index.ts +1 -0
- package/_docs.json +0 -19787
- package/cjs/grid/Cell.d.ts +0 -30
- package/cjs/grid/Cell.js +0 -52
- package/cjs/grid/Cell.js.map +0 -1
- package/cjs/grid/Grid.d.ts +0 -13
- package/cjs/grid/Grid.js.map +0 -1
- package/cjs/grid/index.d.ts +0 -2
- package/cjs/grid/index.js +0 -11
- package/cjs/grid/index.js.map +0 -1
- package/cjs/layout/content-container/ContentContainer.d.ts +0 -9
- package/cjs/layout/content-container/ContentContainer.js +0 -48
- package/cjs/layout/content-container/ContentContainer.js.map +0 -1
- package/cjs/layout/content-container/index.d.ts +0 -1
- package/cjs/layout/content-container/index.js +0 -9
- package/cjs/layout/content-container/index.js.map +0 -1
- package/cjs/modal/ModalContext.d.ts +0 -7
- package/cjs/modal/ModalContext.js +0 -9
- package/cjs/modal/ModalContext.js.map +0 -1
- package/esm/grid/Cell.d.ts +0 -30
- package/esm/grid/Cell.js +0 -23
- package/esm/grid/Cell.js.map +0 -1
- package/esm/grid/Grid.d.ts +0 -13
- package/esm/grid/Grid.js +0 -23
- package/esm/grid/Grid.js.map +0 -1
- package/esm/grid/index.d.ts +0 -2
- package/esm/grid/index.js +0 -3
- package/esm/grid/index.js.map +0 -1
- package/esm/layout/content-container/ContentContainer.d.ts +0 -9
- package/esm/layout/content-container/ContentContainer.js +0 -19
- package/esm/layout/content-container/ContentContainer.js.map +0 -1
- package/esm/layout/content-container/index.d.ts +0 -1
- package/esm/layout/content-container/index.js +0 -2
- package/esm/layout/content-container/index.js.map +0 -1
- package/esm/modal/ModalContext.d.ts +0 -7
- package/esm/modal/ModalContext.js +0 -3
- package/esm/modal/ModalContext.js.map +0 -1
- package/src/grid/Cell.tsx +0 -53
- package/src/grid/Grid.tsx +0 -23
- package/src/grid/grid.stories.tsx +0 -67
- package/src/grid/index.ts +0 -2
- package/src/layout/content-container/ContentContainer.tsx +0 -22
- package/src/layout/content-container/index.ts +0 -4
- package/src/layout/sidemal-test/navno-sidemal.stories.mdx +0 -29
- package/src/modal/ModalContext.ts +0 -7
- package/src/panel/panel.stories.tsx +0 -63
- package/src/typography/stories/ingress.stories.tsx +0 -50
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
import { Meta } from "@storybook/react";
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { Chat } from "../index";
|
|
3
|
+
import { Chat, VStack } from "../index";
|
|
4
4
|
import { POSITIONS, SIZES } from "./Chat";
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: "ds-react/Chat",
|
|
8
8
|
component: Chat,
|
|
9
9
|
argTypes: {
|
|
10
|
-
backgroundColor: {
|
|
11
|
-
control: {
|
|
12
|
-
type: "text",
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
avatarBgColor: {
|
|
16
|
-
control: {
|
|
17
|
-
type: "text",
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
10
|
position: {
|
|
21
11
|
control: { type: "radio" },
|
|
22
12
|
options: POSITIONS,
|
|
@@ -30,9 +20,14 @@ export default {
|
|
|
30
20
|
options: SIZES,
|
|
31
21
|
},
|
|
32
22
|
},
|
|
23
|
+
parameters: {
|
|
24
|
+
chromatic: { disable: true },
|
|
25
|
+
},
|
|
33
26
|
} satisfies Meta<typeof Chat>;
|
|
34
27
|
|
|
35
|
-
|
|
28
|
+
type Story = StoryObj<typeof Chat>;
|
|
29
|
+
|
|
30
|
+
export const Controls: Story = {
|
|
36
31
|
render: (props) => {
|
|
37
32
|
return (
|
|
38
33
|
<Chat {...props}>
|
|
@@ -55,219 +50,292 @@ export const Default = {
|
|
|
55
50
|
},
|
|
56
51
|
};
|
|
57
52
|
|
|
58
|
-
export const
|
|
59
|
-
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
53
|
+
export const Size: Story = {
|
|
54
|
+
render: () => (
|
|
55
|
+
<VStack gap="4">
|
|
56
|
+
<h3>Medium</h3>
|
|
57
|
+
<Chat
|
|
58
|
+
avatar="ON"
|
|
59
|
+
name="Ola Normann"
|
|
60
|
+
timestamp="01.01.21 14:00"
|
|
61
|
+
size="medium"
|
|
62
|
+
>
|
|
63
|
+
<Chat.Bubble>
|
|
64
|
+
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
|
65
|
+
</Chat.Bubble>
|
|
66
|
+
<Chat.Bubble>Tempor fugiat amet eu sint in in ullamco.</Chat.Bubble>
|
|
67
|
+
<Chat.Bubble>
|
|
68
|
+
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
|
69
|
+
laboris labore nisi ut.
|
|
70
|
+
</Chat.Bubble>
|
|
71
|
+
</Chat>
|
|
72
|
+
<h3>Small</h3>
|
|
73
|
+
<Chat
|
|
74
|
+
avatar="ON"
|
|
75
|
+
name="Ola Normann"
|
|
76
|
+
timestamp="01.01.21 14:00"
|
|
77
|
+
size="small"
|
|
78
|
+
>
|
|
79
|
+
<Chat.Bubble>
|
|
80
|
+
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
|
81
|
+
</Chat.Bubble>
|
|
82
|
+
<Chat.Bubble>Tempor fugiat amet eu sint in in ullamco.</Chat.Bubble>
|
|
83
|
+
<Chat.Bubble>
|
|
84
|
+
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
|
85
|
+
laboris labore nisi ut.
|
|
86
|
+
</Chat.Bubble>
|
|
87
|
+
</Chat>
|
|
88
|
+
</VStack>
|
|
89
|
+
),
|
|
90
|
+
};
|
|
70
91
|
|
|
71
|
-
export const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
export const Variants: Story = {
|
|
93
|
+
render: () => (
|
|
94
|
+
<VStack gap="4">
|
|
95
|
+
<h3>Info</h3>
|
|
96
|
+
<Chat avatar="NAV" name="NAV" timestamp="01.01.21 14:00" variant="info">
|
|
97
|
+
<Chat.Bubble>
|
|
98
|
+
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
|
99
|
+
</Chat.Bubble>
|
|
100
|
+
</Chat>
|
|
101
|
+
<h3>Neutral</h3>
|
|
102
|
+
<Chat
|
|
103
|
+
avatar="KN"
|
|
104
|
+
name="Kari Nordmann"
|
|
105
|
+
timestamp="01.01.21 14:03"
|
|
106
|
+
variant="neutral"
|
|
107
|
+
position="right"
|
|
108
|
+
>
|
|
109
|
+
<Chat.Bubble>Tempor fugiat amet eu sint in in ullamco.</Chat.Bubble>
|
|
110
|
+
</Chat>
|
|
111
|
+
<h3>Subtle</h3>
|
|
112
|
+
<Chat
|
|
113
|
+
avatar="ON"
|
|
114
|
+
name="Ola Nordmann"
|
|
115
|
+
timestamp="01.01.21 14:07"
|
|
116
|
+
variant="subtle"
|
|
117
|
+
position="right"
|
|
118
|
+
>
|
|
119
|
+
<Chat.Bubble>
|
|
120
|
+
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
|
121
|
+
laboris labore nisi ut.
|
|
122
|
+
</Chat.Bubble>
|
|
123
|
+
</Chat>
|
|
124
|
+
</VStack>
|
|
125
|
+
),
|
|
126
|
+
};
|
|
91
127
|
|
|
92
|
-
export const
|
|
93
|
-
|
|
94
|
-
<
|
|
128
|
+
export const Position: Story = {
|
|
129
|
+
render: () => (
|
|
130
|
+
<VStack gap="4">
|
|
131
|
+
<h3>Default</h3>
|
|
132
|
+
<Chat avatar="ON" name="Ola Normann" timestamp="01.01.21 14:00">
|
|
133
|
+
<Chat.Bubble>
|
|
134
|
+
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
|
135
|
+
laboris labore nisi ut.
|
|
136
|
+
</Chat.Bubble>
|
|
137
|
+
</Chat>
|
|
138
|
+
<h3>Right</h3>
|
|
139
|
+
<Chat
|
|
140
|
+
avatar="KH"
|
|
141
|
+
name="Kari Høyli"
|
|
142
|
+
timestamp="01.01.21 14:32"
|
|
143
|
+
position="right"
|
|
144
|
+
variant="info"
|
|
145
|
+
>
|
|
146
|
+
<Chat.Bubble>
|
|
147
|
+
Reprehenderit pariatur officia exercitation laboris.
|
|
148
|
+
</Chat.Bubble>
|
|
149
|
+
<Chat.Bubble>
|
|
150
|
+
Enim velit deserunt do quis. Eu fugiat magna esse dolore ad sunt sit
|
|
151
|
+
est dolore incididunt. Occaecat cupidatat magna.
|
|
152
|
+
</Chat.Bubble>
|
|
153
|
+
</Chat>
|
|
154
|
+
<h3>Left</h3>
|
|
155
|
+
<Chat
|
|
156
|
+
position="left"
|
|
157
|
+
avatar="ON"
|
|
158
|
+
name="Ola Normann"
|
|
159
|
+
timestamp="01.01.21 15:00"
|
|
160
|
+
>
|
|
161
|
+
<Chat.Bubble>
|
|
162
|
+
Exercitation irure Lorem cupidatat culpa anim cillum esse ullamco qui
|
|
163
|
+
dolore laborum et Lorem. Labore sunt duis id Lorem voluptate commodo
|
|
164
|
+
ea esse. Dolore esse aliqua proident ea ad commodo ut dolore voluptate
|
|
165
|
+
labore sunt aute.
|
|
166
|
+
</Chat.Bubble>
|
|
167
|
+
</Chat>
|
|
168
|
+
</VStack>
|
|
169
|
+
),
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export const ToptextPosition: Story = {
|
|
173
|
+
render: () => (
|
|
174
|
+
<VStack gap="4">
|
|
175
|
+
<h3>Right</h3>
|
|
176
|
+
<Chat
|
|
177
|
+
avatar="ON"
|
|
178
|
+
name="Ola Normann"
|
|
179
|
+
timestamp="01.01.21 14:00"
|
|
180
|
+
toptextPosition="right"
|
|
181
|
+
>
|
|
182
|
+
<Chat.Bubble>
|
|
183
|
+
Adipisicing laborum est eu laborum est sit in commodo enim sint
|
|
184
|
+
laboris labore nisi ut.
|
|
185
|
+
</Chat.Bubble>
|
|
186
|
+
</Chat>
|
|
187
|
+
<h3>Left</h3>
|
|
188
|
+
<Chat avatar="ON" name="Ola Normann" timestamp="01.01.21 15:00">
|
|
189
|
+
<Chat.Bubble toptextPosition="left">
|
|
190
|
+
Exercitation irure Lorem cupidatat culpa anim cillum esse ullamco qui
|
|
191
|
+
dolore laborum et Lorem. Labore sunt duis id Lorem voluptate commodo
|
|
192
|
+
ea esse. Dolore esse aliqua proident ea ad commodo ut dolore voluptate
|
|
193
|
+
labore sunt aute.
|
|
194
|
+
</Chat.Bubble>
|
|
195
|
+
</Chat>
|
|
196
|
+
<h3>Left</h3>
|
|
197
|
+
<Chat
|
|
198
|
+
name="Kari Høyli"
|
|
199
|
+
timestamp="01.01.21 14:32"
|
|
200
|
+
position="right"
|
|
201
|
+
toptextPosition="left"
|
|
202
|
+
>
|
|
203
|
+
<Chat.Bubble>
|
|
204
|
+
Reprehenderit pariatur officia exercitation laboris.
|
|
205
|
+
</Chat.Bubble>
|
|
206
|
+
<Chat.Bubble>
|
|
207
|
+
Enim velit deserunt do quis. Eu fugiat magna esse dolore ad sunt sit
|
|
208
|
+
est dolore incididunt. Occaecat cupidatat magna.
|
|
209
|
+
</Chat.Bubble>
|
|
210
|
+
</Chat>
|
|
211
|
+
<h3>Right</h3>
|
|
212
|
+
<Chat
|
|
213
|
+
name="Kari Høyli"
|
|
214
|
+
timestamp="01.01.21 14:32"
|
|
215
|
+
position="right"
|
|
216
|
+
toptextPosition="right"
|
|
217
|
+
>
|
|
218
|
+
<Chat.Bubble>
|
|
219
|
+
Reprehenderit pariatur officia exercitation laboris.
|
|
220
|
+
</Chat.Bubble>
|
|
221
|
+
<Chat.Bubble>
|
|
222
|
+
Enim velit deserunt do quis. Eu fugiat magna esse dolore ad sunt sit
|
|
223
|
+
est dolore incididunt. Occaecat cupidatat magna.
|
|
224
|
+
</Chat.Bubble>
|
|
225
|
+
</Chat>
|
|
226
|
+
</VStack>
|
|
227
|
+
),
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
export const Avatar: Story = {
|
|
231
|
+
render: () => (
|
|
232
|
+
<Chat avatar={<Illustration />}>
|
|
95
233
|
<Chat.Bubble>
|
|
96
234
|
Aute minim nisi sunt mollit duis sunt nulla minim non proident.
|
|
97
235
|
</Chat.Bubble>
|
|
98
|
-
</Chat>
|
|
99
|
-
<Chat
|
|
100
|
-
avatar="KN"
|
|
101
|
-
name="Kari Nordmann"
|
|
102
|
-
timestamp="01.01.21 14:03"
|
|
103
|
-
variant="neutral"
|
|
104
|
-
position="right"
|
|
105
|
-
>
|
|
106
236
|
<Chat.Bubble>Tempor fugiat amet eu sint in in ullamco.</Chat.Bubble>
|
|
107
|
-
</Chat>
|
|
108
|
-
<Chat
|
|
109
|
-
avatar="ON"
|
|
110
|
-
name="Ola Nordmann"
|
|
111
|
-
timestamp="01.01.21 14:07"
|
|
112
|
-
variant="subtle"
|
|
113
|
-
position="right"
|
|
114
|
-
>
|
|
115
|
-
<Chat.Bubble>
|
|
116
|
-
Adipisicing laborum est eu laborum est sit in commodo enim sint laboris
|
|
117
|
-
labore nisi ut.
|
|
118
|
-
</Chat.Bubble>
|
|
119
|
-
</Chat>
|
|
120
|
-
</div>
|
|
121
|
-
);
|
|
122
|
-
|
|
123
|
-
export const Position = () => (
|
|
124
|
-
<div className="colgap">
|
|
125
|
-
<Chat avatar="ON" name="Ola Normann" timestamp="01.01.21 14:00">
|
|
126
237
|
<Chat.Bubble>
|
|
127
238
|
Adipisicing laborum est eu laborum est sit in commodo enim sint laboris
|
|
128
239
|
labore nisi ut.
|
|
129
240
|
</Chat.Bubble>
|
|
130
241
|
</Chat>
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
name="Kari Høyli"
|
|
134
|
-
timestamp="01.01.21 14:32"
|
|
135
|
-
position="right"
|
|
136
|
-
variant="info"
|
|
137
|
-
>
|
|
138
|
-
<Chat.Bubble>
|
|
139
|
-
Reprehenderit pariatur officia exercitation laboris.
|
|
140
|
-
</Chat.Bubble>
|
|
141
|
-
<Chat.Bubble>
|
|
142
|
-
Enim velit deserunt do quis. Eu fugiat magna esse dolore ad sunt sit est
|
|
143
|
-
dolore incididunt. Occaecat cupidatat magna.
|
|
144
|
-
</Chat.Bubble>
|
|
145
|
-
</Chat>
|
|
146
|
-
<Chat avatar="ON" name="Ola Normann" timestamp="01.01.21 15:00">
|
|
147
|
-
<Chat.Bubble>
|
|
148
|
-
Exercitation irure Lorem cupidatat culpa anim cillum esse ullamco qui
|
|
149
|
-
dolore laborum et Lorem. Labore sunt duis id Lorem voluptate commodo ea
|
|
150
|
-
esse. Dolore esse aliqua proident ea ad commodo ut dolore voluptate
|
|
151
|
-
labore sunt aute.
|
|
152
|
-
</Chat.Bubble>
|
|
153
|
-
</Chat>
|
|
154
|
-
</div>
|
|
155
|
-
);
|
|
156
|
-
|
|
157
|
-
export const ToptextPosition = () => (
|
|
158
|
-
<div className="colgap">
|
|
159
|
-
<Chat
|
|
160
|
-
avatar="ON"
|
|
161
|
-
name="Ola Normann"
|
|
162
|
-
timestamp="01.01.21 14:00"
|
|
163
|
-
toptextPosition="right"
|
|
164
|
-
>
|
|
165
|
-
<Chat.Bubble>
|
|
166
|
-
Adipisicing laborum est eu laborum est sit in commodo enim sint laboris
|
|
167
|
-
labore nisi ut.
|
|
168
|
-
</Chat.Bubble>
|
|
169
|
-
</Chat>
|
|
170
|
-
<Chat
|
|
171
|
-
name="Kari Høyli"
|
|
172
|
-
timestamp="01.01.21 14:32"
|
|
173
|
-
position="right"
|
|
174
|
-
variant="info"
|
|
175
|
-
toptextPosition="left"
|
|
176
|
-
>
|
|
177
|
-
<Chat.Bubble>
|
|
178
|
-
Reprehenderit pariatur officia exercitation laboris.
|
|
179
|
-
</Chat.Bubble>
|
|
180
|
-
<Chat.Bubble>
|
|
181
|
-
Enim velit deserunt do quis. Eu fugiat magna esse dolore ad sunt sit est
|
|
182
|
-
dolore incididunt. Occaecat cupidatat magna.
|
|
183
|
-
</Chat.Bubble>
|
|
184
|
-
</Chat>
|
|
185
|
-
<Chat avatar="ON" name="Ola Normann" timestamp="01.01.21 15:00">
|
|
186
|
-
<Chat.Bubble toptextPosition="right">
|
|
187
|
-
Exercitation irure Lorem cupidatat culpa anim cillum esse ullamco qui
|
|
188
|
-
dolore laborum et Lorem. Labore sunt duis id Lorem voluptate commodo ea
|
|
189
|
-
esse. Dolore esse aliqua proident ea ad commodo ut dolore voluptate
|
|
190
|
-
labore sunt aute.
|
|
191
|
-
</Chat.Bubble>
|
|
192
|
-
</Chat>
|
|
193
|
-
</div>
|
|
194
|
-
);
|
|
242
|
+
),
|
|
243
|
+
};
|
|
195
244
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
<
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
245
|
+
function Illustration() {
|
|
246
|
+
return (
|
|
247
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 54 93">
|
|
248
|
+
<path
|
|
249
|
+
fill="#e7e5e2"
|
|
250
|
+
d="M14 50.7C15 52.3 17.9 81 26.5 81S39 51.8 39 50.3c-13.2-7.6-25 .4-25 .4z"
|
|
251
|
+
/>
|
|
252
|
+
<path
|
|
253
|
+
fill="#5c4378"
|
|
254
|
+
d="M38.7 50.2c6 2.9 15.3 10.9 15.3 18.3V93H0V68.5c0-7.1 8.5-14.8 14.5-18-.3.2-.5.3-.5.3 1 1.7 3.8 9.2 12.4 9.2C35 60 39 51.9 39 50.4c-.1-.1-.2-.2-.3-.2z"
|
|
255
|
+
/>
|
|
256
|
+
<path
|
|
257
|
+
fill="#d2242a"
|
|
258
|
+
d="M46.7 76H31.2c-.7 0-1.3-.6-1.2-1.3v-8.5c0-.7.6-1.3 1.3-1.3h15.5c.7 0 1.3.6 1.3 1.3v8.5c-.1.7-.7 1.3-1.4 1.3"
|
|
259
|
+
/>
|
|
260
|
+
<path
|
|
261
|
+
fill="#fff"
|
|
262
|
+
d="M42.9 71c0 2.1-1.7 3.8-3.8 3.8-2.1 0-3.8-1.7-3.8-3.8s1.7-3.8 3.8-3.8c2.1 0 3.8 1.7 3.8 3.8m-8.7 1.7h-.7l.8-1.9h.7l-.8 1.9zm9.3 0H43l.8-1.9h.5l-.8 1.9zm1.2 0h-.2l.8-1.9h.2l-.8 1.9z"
|
|
263
|
+
/>
|
|
264
|
+
<path
|
|
265
|
+
fill="#c52d35"
|
|
266
|
+
d="M36.2 72.7h.6s.1 0 .1-.1v-1.8s0-.1-.1-.1h-.6s-.1 0-.1.1l-.2.6v.1h.2l.1 1.2c0-.1 0 0 0 0"
|
|
267
|
+
/>
|
|
268
|
+
<path
|
|
269
|
+
fill="#c52d35"
|
|
270
|
+
d="M37.5 72.7h.6s.1 0 .1-.1v-1.8s0-.1-.1-.1h-.9s-.1 0-.1.1l-.2.6-.1.1h.5c.1 0 .2.1.2.2v1c-.1-.1-.1 0 0 0m2.6-1.9h-.6s-.1 0-.1.1v1.8s0 .1.1.1h.6s.1 0 .1-.1l.2-.6V72h-.2l-.1-1.2"
|
|
271
|
+
/>
|
|
272
|
+
<path
|
|
273
|
+
fill="#c52d35"
|
|
274
|
+
d="M37.7 72.7h.4s.1 0 .1-.1l.2-.6v-.1h-.2c0 .1-.5.8-.5.8zm3.9-1.9h.7s.1 0 0 .1l-.7 1.8H41l.6-1.9"
|
|
275
|
+
/>
|
|
276
|
+
<path
|
|
277
|
+
fill="#c52d35"
|
|
278
|
+
d="M40.8 70.8h-1c-.1 0 .3.1.3.1l.7 1.7s0 .1.1.1h.6l-.7-1.9m-1.3.6v.4s-.1-.4-.3-.4c-.3 0-.3.2-.3.3 0 .1.1.3.2.3h.5l-.3.7H39c-.2 0-.9-.3-.9-.9 0-.6.5-1 .9-1 .2-.1.5.2.5.6 0-.1 0-.1 0 0z"
|
|
279
|
+
/>
|
|
280
|
+
<path
|
|
281
|
+
fill="#5a1f57"
|
|
282
|
+
d="M39.9 66.7h-1.6c-.1 0-.2-.1-.2-.2v-.3c0-.1.1-.2.2-.2h1.6c.1 0 .2.1.2.2v.3c0 .2-.1.2-.2.2"
|
|
283
|
+
/>
|
|
284
|
+
<path fill="#c2b5cf" d="M38.7 66.5h.9V64h-.9v2.5z" />
|
|
285
|
+
<path
|
|
286
|
+
fill="#e7e5e2"
|
|
287
|
+
d="M47.2 35.3C44.7 45.6 36.6 53.1 27 53.1S9.3 45.6 6.8 35.3c-.2.1-.5.1-.8.1-1.1 0-2-.8-2-1.7v-7c0-1 .9-1.7 2-1.7h.2C7.7 13.1 16.4 4 27 4c10.6 0 19.3 9.1 20.8 21h.2c1.1 0 2 .8 2 1.7v7c0 1-.9 1.7-2 1.7-.3 0-.5 0-.8-.1z"
|
|
288
|
+
/>
|
|
289
|
+
<path
|
|
290
|
+
fill="#635e59"
|
|
291
|
+
d="M19 27.6c-1.4.1-1.9-2-1.4-3.4.1-.3.6-1.5 1.4-1.5.8 0 1.2.7 1.3.8.6 1.4.3 4-1.3 4.1m16.2 0c1.4.1 1.9-2 1.4-3.4-.1-.3-.6-1.5-1.4-1.5-.8 0-1.2.7-1.3.8-.6 1.4-.3 4 1.3 4.1"
|
|
292
|
+
/>
|
|
293
|
+
<path
|
|
294
|
+
fill="#d1bfa3"
|
|
295
|
+
d="M26.8 34.6c-.4 0-.7-.1-1-.2-.3-.1-.4-.4-.3-.7.1-.3.4-.4.7-.3.5.2 1.5.1 2.2-.4.7-.4 1.1-1 1.2-1.5.1-.4-.1-.9-.4-1.3-.2-.2-.8-.2-1.6-.1-.3 0-.5-.1-.6-.4 0-.3.1-.5.4-.6 1.2-.2 2.1 0 2.6.6.5.7.8 1.4.6 2.1-.1.8-.7 1.6-1.7 2.2-.6.3-1.4.6-2.1.6z"
|
|
296
|
+
/>
|
|
297
|
+
<path
|
|
298
|
+
fill="#593a32"
|
|
299
|
+
d="M27.1 42.1h-.3c-5.3-.2-7.3-4.1-7.4-4.3-.1-.3 0-.6.2-.7.2-.1.6 0 .7.2.1.1 1.9 3.6 6.6 3.8 4.7.2 6.4-3.7 6.4-3.7.1-.3.4-.4.7-.3.3.1.4.4.3.7-.1 0-2.1 4.3-7.2 4.3z"
|
|
300
|
+
/>
|
|
301
|
+
<path
|
|
302
|
+
fill="#f6b873"
|
|
303
|
+
d="M6.6 30.7c.1-.1.1-.2.1-.3v-2c-.1-5.6 1.8-8.1 3.4-10.1 0 0-1 4.3-.3 3.4 3.8-5 21.4-1.6 25-8.1.5 3.6-4.1 4.6-4.1 4.6 3.7.7 6.9-.8 7.7-2.5.3 1.4-.6 2.4-1.9 3.4 4.5-.9 4.6-4 4.6-4 .6 4.1 5.3 2.5 5.3 9.3v6c0 .3.2.6.5.6h.5c.3 0 .5-.3.5-.6V26c.3-15.6-8.5-26-20.6-26C15.9 0 5 10.4 5 24.1v6.3c0 .4.2.6.5.6h.6c.2 0 .3-.1.5-.3"
|
|
304
|
+
/>
|
|
305
|
+
<path
|
|
306
|
+
fill="#f6b873"
|
|
307
|
+
d="M25.9 43.4c-4.4 0-8-1.4-8-3.2s3.6-3.2 8-3.2 8 1.4 8 3.2c0 1.8-3.6 3.2-8 3.2m.8-9.4c-2.9 0-4.7.7-8.8 2.1-12.7 4.6-11.6-14-11.6-14C3.4 46 18.6 52 26.5 52c8.1 0 24.1-8.1 21-30 0 0 .4 17.1-12.9 13.8-3.7-.9-5-1.8-7.9-1.8z"
|
|
308
|
+
/>
|
|
309
|
+
</svg>
|
|
310
|
+
);
|
|
311
|
+
}
|
|
208
312
|
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
<
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
/>
|
|
239
|
-
<path
|
|
240
|
-
fill="#c52d35"
|
|
241
|
-
d="M40.8 70.8h-1c-.1 0 .3.1.3.1l.7 1.7s0 .1.1.1h.6l-.7-1.9m-1.3.6v.4s-.1-.4-.3-.4c-.3 0-.3.2-.3.3 0 .1.1.3.2.3h.5l-.3.7H39c-.2 0-.9-.3-.9-.9 0-.6.5-1 .9-1 .2-.1.5.2.5.6 0-.1 0-.1 0 0z"
|
|
242
|
-
/>
|
|
243
|
-
<path
|
|
244
|
-
fill="#5a1f57"
|
|
245
|
-
d="M39.9 66.7h-1.6c-.1 0-.2-.1-.2-.2v-.3c0-.1.1-.2.2-.2h1.6c.1 0 .2.1.2.2v.3c0 .2-.1.2-.2.2"
|
|
246
|
-
/>
|
|
247
|
-
<path fill="#c2b5cf" d="M38.7 66.5h.9V64h-.9v2.5z" />
|
|
248
|
-
<path
|
|
249
|
-
fill="#e7e5e2"
|
|
250
|
-
d="M47.2 35.3C44.7 45.6 36.6 53.1 27 53.1S9.3 45.6 6.8 35.3c-.2.1-.5.1-.8.1-1.1 0-2-.8-2-1.7v-7c0-1 .9-1.7 2-1.7h.2C7.7 13.1 16.4 4 27 4c10.6 0 19.3 9.1 20.8 21h.2c1.1 0 2 .8 2 1.7v7c0 1-.9 1.7-2 1.7-.3 0-.5 0-.8-.1z"
|
|
251
|
-
/>
|
|
252
|
-
<path
|
|
253
|
-
fill="#635e59"
|
|
254
|
-
d="M19 27.6c-1.4.1-1.9-2-1.4-3.4.1-.3.6-1.5 1.4-1.5.8 0 1.2.7 1.3.8.6 1.4.3 4-1.3 4.1m16.2 0c1.4.1 1.9-2 1.4-3.4-.1-.3-.6-1.5-1.4-1.5-.8 0-1.2.7-1.3.8-.6 1.4-.3 4 1.3 4.1"
|
|
255
|
-
/>
|
|
256
|
-
<path
|
|
257
|
-
fill="#d1bfa3"
|
|
258
|
-
d="M26.8 34.6c-.4 0-.7-.1-1-.2-.3-.1-.4-.4-.3-.7.1-.3.4-.4.7-.3.5.2 1.5.1 2.2-.4.7-.4 1.1-1 1.2-1.5.1-.4-.1-.9-.4-1.3-.2-.2-.8-.2-1.6-.1-.3 0-.5-.1-.6-.4 0-.3.1-.5.4-.6 1.2-.2 2.1 0 2.6.6.5.7.8 1.4.6 2.1-.1.8-.7 1.6-1.7 2.2-.6.3-1.4.6-2.1.6z"
|
|
259
|
-
/>
|
|
260
|
-
<path
|
|
261
|
-
fill="#593a32"
|
|
262
|
-
d="M27.1 42.1h-.3c-5.3-.2-7.3-4.1-7.4-4.3-.1-.3 0-.6.2-.7.2-.1.6 0 .7.2.1.1 1.9 3.6 6.6 3.8 4.7.2 6.4-3.7 6.4-3.7.1-.3.4-.4.7-.3.3.1.4.4.3.7-.1 0-2.1 4.3-7.2 4.3z"
|
|
263
|
-
/>
|
|
264
|
-
<path
|
|
265
|
-
fill="#f6b873"
|
|
266
|
-
d="M6.6 30.7c.1-.1.1-.2.1-.3v-2c-.1-5.6 1.8-8.1 3.4-10.1 0 0-1 4.3-.3 3.4 3.8-5 21.4-1.6 25-8.1.5 3.6-4.1 4.6-4.1 4.6 3.7.7 6.9-.8 7.7-2.5.3 1.4-.6 2.4-1.9 3.4 4.5-.9 4.6-4 4.6-4 .6 4.1 5.3 2.5 5.3 9.3v6c0 .3.2.6.5.6h.5c.3 0 .5-.3.5-.6V26c.3-15.6-8.5-26-20.6-26C15.9 0 5 10.4 5 24.1v6.3c0 .4.2.6.5.6h.6c.2 0 .3-.1.5-.3"
|
|
267
|
-
/>
|
|
268
|
-
<path
|
|
269
|
-
fill="#f6b873"
|
|
270
|
-
d="M25.9 43.4c-4.4 0-8-1.4-8-3.2s3.6-3.2 8-3.2 8 1.4 8 3.2c0 1.8-3.6 3.2-8 3.2m.8-9.4c-2.9 0-4.7.7-8.8 2.1-12.7 4.6-11.6-14-11.6-14C3.4 46 18.6 52 26.5 52c8.1 0 24.1-8.1 21-30 0 0 .4 17.1-12.9 13.8-3.7-.9-5-1.8-7.9-1.8z"
|
|
271
|
-
/>
|
|
272
|
-
</svg>
|
|
273
|
-
);
|
|
313
|
+
export const Chromatic: Story = {
|
|
314
|
+
render: (...props) => (
|
|
315
|
+
<div>
|
|
316
|
+
<div>
|
|
317
|
+
<h2>Size</h2>
|
|
318
|
+
{Size.render?.(...props)}
|
|
319
|
+
</div>
|
|
320
|
+
<div>
|
|
321
|
+
<h2>Variants</h2>
|
|
322
|
+
{Variants.render?.(...props)}
|
|
323
|
+
</div>
|
|
324
|
+
<div>
|
|
325
|
+
<h2>Position</h2>
|
|
326
|
+
{Position.render?.(...props)}
|
|
327
|
+
</div>
|
|
328
|
+
<div>
|
|
329
|
+
<h2>Toptext</h2>
|
|
330
|
+
{ToptextPosition.render?.(...props)}
|
|
331
|
+
</div>
|
|
332
|
+
<div>
|
|
333
|
+
<h2>Avatar</h2>
|
|
334
|
+
{Avatar.render?.(...props)}
|
|
335
|
+
</div>
|
|
336
|
+
</div>
|
|
337
|
+
),
|
|
338
|
+
parameters: {
|
|
339
|
+
chromatic: { disable: false },
|
|
340
|
+
},
|
|
341
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import setYear from "date-fns
|
|
2
|
-
import startOfMonth from "date-fns/startOfMonth";
|
|
1
|
+
import { setYear, startOfMonth } from "date-fns";
|
|
3
2
|
import React, { createContext, useContext, useState } from "react";
|
|
4
3
|
import { useDayPicker } from "react-day-picker";
|
|
5
4
|
import { Matcher, getInitialYear } from "../utils";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
|
-
import isWeekend from "date-fns
|
|
2
|
+
import { isWeekend } from "date-fns";
|
|
3
3
|
import React, { forwardRef, useRef, useState } from "react";
|
|
4
4
|
import { DateRange, DayPicker, isMatch } from "react-day-picker";
|
|
5
5
|
import { omit } from "../../util";
|
|
@@ -11,7 +11,6 @@ import { DateWrapper } from "../parts/DateWrapper";
|
|
|
11
11
|
import { getLocaleFromString, labels } from "../utils";
|
|
12
12
|
import DatePickerStandalone from "./DatePickerStandalone";
|
|
13
13
|
import Caption from "./parts/Caption";
|
|
14
|
-
import DayButton from "./parts/DayButton";
|
|
15
14
|
import DropdownCaption from "./parts/DropdownCaption";
|
|
16
15
|
import { HeadRow } from "./parts/HeadRow";
|
|
17
16
|
import Row from "./parts/Row";
|
|
@@ -124,7 +123,6 @@ export const DatePicker = forwardRef<HTMLDivElement, DatePickerProps>(
|
|
|
124
123
|
HeadRow,
|
|
125
124
|
WeekNumber,
|
|
126
125
|
Row,
|
|
127
|
-
Day: DayButton,
|
|
128
126
|
}}
|
|
129
127
|
className={cl("navds-date", className)}
|
|
130
128
|
classNames={{
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import cl from "clsx";
|
|
2
|
-
import isWeekend from "date-fns
|
|
2
|
+
import { isWeekend } from "date-fns";
|
|
3
3
|
import React, { forwardRef } from "react";
|
|
4
4
|
import { DateRange, DayPicker, isMatch } from "react-day-picker";
|
|
5
5
|
import { omit } from "../../util";
|
|
6
6
|
import { getLocaleFromString, labels } from "../utils";
|
|
7
7
|
import Caption from "./parts/Caption";
|
|
8
|
-
import DayButton from "./parts/DayButton";
|
|
9
8
|
import DropdownCaption from "./parts/DropdownCaption";
|
|
10
9
|
import { HeadRow } from "./parts/HeadRow";
|
|
11
10
|
import Row from "./parts/Row";
|
|
@@ -94,7 +93,6 @@ export const DatePickerStandalone: DatePickerStandaloneType = forwardRef<
|
|
|
94
93
|
HeadRow,
|
|
95
94
|
WeekNumber,
|
|
96
95
|
Row,
|
|
97
|
-
Day: DayButton,
|
|
98
96
|
}}
|
|
99
97
|
className="navds-date"
|
|
100
98
|
classNames={{ vhidden: "navds-sr-only" }}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
2
|
import { Meta, StoryObj } from "@storybook/react";
|
|
3
|
-
import isSameDay from "date-fns
|
|
3
|
+
import { isSameDay } from "date-fns";
|
|
4
4
|
import React, { useId, useState } from "react";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { Button } from "../../button";
|
|
6
|
+
import { HGrid } from "../../layout/grid";
|
|
7
|
+
import { VStack } from "../../layout/stack";
|
|
8
|
+
import Modal from "../../modal/Modal";
|
|
9
|
+
import { BodyLong } from "../../typography";
|
|
10
|
+
import { useDatepicker, useRangeDatepicker } from "../hooks";
|
|
7
11
|
import DatePicker, { DatePickerProps } from "./DatePicker";
|
|
8
12
|
|
|
9
13
|
const disabledDays = [
|
|
@@ -27,13 +31,13 @@ export const Default: StoryObj<DefaultStoryProps> = {
|
|
|
27
31
|
const [open, setOpen] = useState(false);
|
|
28
32
|
|
|
29
33
|
const rangeCtx = useRangeDatepicker({
|
|
30
|
-
fromDate: new Date("Aug 23
|
|
31
|
-
toDate: new Date("Aug 23
|
|
34
|
+
fromDate: new Date("Aug 23 2023"),
|
|
35
|
+
toDate: new Date("Aug 23 2029"),
|
|
32
36
|
});
|
|
33
37
|
|
|
34
38
|
const singleCtx = useDatepicker({
|
|
35
39
|
fromDate: new Date("Aug 23 2020"),
|
|
36
|
-
toDate: new Date("Aug 23
|
|
40
|
+
toDate: new Date("Aug 23 2029"),
|
|
37
41
|
});
|
|
38
42
|
|
|
39
43
|
const newProps = {
|
|
@@ -42,7 +46,7 @@ export const Default: StoryObj<DefaultStoryProps> = {
|
|
|
42
46
|
open,
|
|
43
47
|
onClose: () => setOpen(false),
|
|
44
48
|
fromDate: new Date("Aug 23 2020"),
|
|
45
|
-
toDate: new Date("Aug 23
|
|
49
|
+
toDate: new Date("Aug 23 2029"),
|
|
46
50
|
}
|
|
47
51
|
: {}),
|
|
48
52
|
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { max, min } from "date-fns";
|
|
2
|
-
import setMonth from "date-fns/setMonth";
|
|
3
|
-
import setYear from "date-fns/setYear";
|
|
4
|
-
import startOfMonth from "date-fns/startOfMonth";
|
|
1
|
+
import { max, min, setMonth, setYear, startOfMonth } from "date-fns";
|
|
5
2
|
import React from "react";
|
|
6
3
|
import { CaptionProps, useDayPicker, useNavigation } from "react-day-picker";
|
|
7
4
|
import { ArrowLeftIcon, ArrowRightIcon } from "@navikt/aksel-icons";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { getUnixTime } from "date-fns";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { useDayPicker } from "react-day-picker";
|
|
4
4
|
import { Hide } from "../../../layout/responsive";
|
|
5
|
+
import DayButton from "./DayButton";
|
|
5
6
|
import WeekNumber from "./WeekNumber";
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -37,7 +38,7 @@ function Row(props: RowProps): JSX.Element {
|
|
|
37
38
|
style={styles.cell}
|
|
38
39
|
key={getUnixTime(date)}
|
|
39
40
|
>
|
|
40
|
-
<
|
|
41
|
+
<DayButton displayMonth={props.displayMonth} date={date} />
|
|
41
42
|
</td>
|
|
42
43
|
))}
|
|
43
44
|
</tr>
|