@navikt/ds-react 3.4.2 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_docs.json +5912 -3911
- package/cjs/accordion/Accordion.js +22 -2
- package/cjs/alert/Alert.js +9 -0
- package/cjs/button/Button.js +10 -0
- package/cjs/chat/Chat.js +16 -0
- package/cjs/chips/Chips.js +27 -0
- package/cjs/chips/Toggle.js +4 -6
- package/cjs/copybutton/CopyButton.js +11 -0
- package/cjs/date/DateInput.js +1 -1
- package/cjs/date/datepicker/DatePicker.js +22 -0
- package/cjs/date/hooks/index.js +4 -4
- package/cjs/date/hooks/useDatepicker.js +13 -0
- package/cjs/date/hooks/useMonthPicker.js +13 -0
- package/cjs/date/hooks/useRangeDatepicker.js +12 -0
- package/cjs/date/index.js +6 -6
- package/cjs/date/monthpicker/MonthPicker.js +22 -0
- package/cjs/dropdown/Dropdown.js +88 -0
- package/cjs/dropdown/Menu/Divider.js +47 -0
- package/cjs/dropdown/Menu/GroupedList/Heading.js +47 -0
- package/cjs/dropdown/Menu/GroupedList/Item.js +54 -0
- package/cjs/dropdown/Menu/GroupedList/index.js +51 -0
- package/cjs/dropdown/Menu/GroupedList/package.json +6 -0
- package/cjs/dropdown/Menu/List/Item.js +54 -0
- package/cjs/dropdown/Menu/List/index.js +49 -0
- package/cjs/dropdown/Menu/List/package.json +6 -0
- package/cjs/dropdown/Menu/index.js +64 -0
- package/cjs/dropdown/Menu/package.json +6 -0
- package/cjs/dropdown/Toggle.js +66 -0
- package/cjs/dropdown/index.js +23 -0
- package/cjs/dropdown/package.json +6 -0
- package/cjs/expansion-card/ExpansionCard.js +18 -0
- package/cjs/form/ConfirmationPanel.js +18 -0
- package/cjs/form/Select.js +16 -0
- package/cjs/form/Switch.js +11 -0
- package/cjs/form/TextField.js +11 -0
- package/cjs/form/Textarea.js +11 -0
- package/cjs/form/checkbox/CheckboxGroup.js +15 -0
- package/cjs/form/error-summary/ErrorSummary.js +18 -0
- package/cjs/form/radio/RadioGroup.js +10 -0
- package/cjs/form/search/Search.js +13 -0
- package/cjs/guide-panel/GuidePanel.js +15 -0
- package/cjs/help-text/HelpText.js +13 -0
- package/cjs/index.js +4 -0
- package/cjs/internal-header/InternalHeader.js +83 -0
- package/cjs/internal-header/InternalHeaderButton.js +47 -0
- package/cjs/internal-header/InternalHeaderTitle.js +48 -0
- package/cjs/internal-header/InternalHeaderUser.js +51 -0
- package/cjs/internal-header/InternalHeaderUserButton.js +54 -0
- package/cjs/internal-header/index.js +8 -0
- package/cjs/internal-header/package.json +6 -0
- package/cjs/link/Link.js +13 -0
- package/cjs/link-panel/LinkPanel.js +17 -0
- package/cjs/loader/Loader.js +11 -0
- package/cjs/modal/Modal.js +27 -0
- package/cjs/pagination/Pagination.js +17 -0
- package/cjs/panel/Panel.js +19 -0
- package/cjs/popover/Popover.js +20 -0
- package/cjs/provider/Provider.js +13 -0
- package/cjs/read-more/ReadMore.js +17 -0
- package/cjs/skeleton/Skeleton.js +51 -0
- package/cjs/skeleton/index.js +8 -0
- package/cjs/skeleton/package.json +6 -0
- package/cjs/stepper/Step.js +3 -4
- package/cjs/stepper/Stepper.js +24 -0
- package/cjs/table/Table.js +32 -0
- package/cjs/tabs/Tabs.js +27 -1
- package/cjs/tag/Tag.js +11 -0
- package/cjs/timeline/AxisLabels.js +90 -0
- package/cjs/timeline/Pin.js +106 -0
- package/cjs/timeline/Timeline.js +180 -0
- package/cjs/timeline/TimelineRow.js +86 -0
- package/cjs/timeline/hooks/usePeriodContext.js +16 -0
- package/cjs/timeline/hooks/useRowContext.js +18 -0
- package/cjs/timeline/hooks/useTimelineContext.js +23 -0
- package/cjs/timeline/hooks/useTimelineRows.js +79 -0
- package/cjs/timeline/index.js +8 -0
- package/cjs/timeline/package.json +6 -0
- package/cjs/timeline/period/ClickablePeriod.js +120 -0
- package/cjs/timeline/period/NonClickablePeriod.js +18 -0
- package/cjs/timeline/period/index.js +46 -0
- package/cjs/timeline/period/package.json +6 -0
- package/cjs/timeline/utils/calc.js +19 -0
- package/cjs/timeline/utils/filter.js +18 -0
- package/cjs/timeline/utils/index.js +7 -0
- package/cjs/timeline/utils/package.json +6 -0
- package/cjs/timeline/utils/period.js +40 -0
- package/cjs/timeline/utils/sort.js +10 -0
- package/cjs/timeline/utils/timeline.js +79 -0
- package/cjs/timeline/utils/types.external.js +2 -0
- package/cjs/timeline/utils/types.internal.js +2 -0
- package/cjs/timeline/zoom/ZoomButton.js +68 -0
- package/cjs/timeline/zoom/index.js +50 -0
- package/cjs/timeline/zoom/package.json +6 -0
- package/cjs/toggle-group/ToggleGroup.js +17 -2
- package/cjs/tooltip/Tooltip.js +13 -0
- package/cjs/typography/BodyLong.js +14 -0
- package/cjs/typography/BodyShort.js +14 -0
- package/cjs/typography/Detail.js +14 -0
- package/cjs/typography/ErrorMessage.js +14 -0
- package/cjs/typography/Heading.js +14 -0
- package/cjs/typography/Ingress.js +14 -0
- package/cjs/typography/Label.js +14 -0
- package/esm/accordion/Accordion.d.ts +40 -6
- package/esm/accordion/Accordion.js +22 -2
- package/esm/accordion/Accordion.js.map +1 -1
- package/esm/accordion/AccordionContent.d.ts +1 -2
- package/esm/accordion/AccordionContent.js.map +1 -1
- package/esm/accordion/AccordionHeader.d.ts +1 -2
- package/esm/accordion/AccordionHeader.js.map +1 -1
- package/esm/accordion/AccordionItem.d.ts +1 -2
- package/esm/accordion/AccordionItem.js.map +1 -1
- package/esm/alert/Alert.d.ts +9 -0
- package/esm/alert/Alert.js +9 -0
- package/esm/alert/Alert.js.map +1 -1
- package/esm/button/Button.d.ts +10 -0
- package/esm/button/Button.js +10 -0
- package/esm/button/Button.js.map +1 -1
- package/esm/chat/Bubble.d.ts +1 -2
- package/esm/chat/Bubble.js.map +1 -1
- package/esm/chat/Chat.d.ts +21 -2
- package/esm/chat/Chat.js +16 -0
- package/esm/chat/Chat.js.map +1 -1
- package/esm/chips/Chips.d.ts +42 -4
- package/esm/chips/Chips.js +27 -0
- package/esm/chips/Chips.js.map +1 -1
- package/esm/chips/Removable.d.ts +0 -2
- package/esm/chips/Removable.js.map +1 -1
- package/esm/chips/Toggle.d.ts +11 -3
- package/esm/chips/Toggle.js +4 -6
- package/esm/chips/Toggle.js.map +1 -1
- package/esm/copybutton/CopyButton.d.ts +11 -0
- package/esm/copybutton/CopyButton.js +11 -0
- package/esm/copybutton/CopyButton.js.map +1 -1
- package/esm/date/DateInput.d.ts +2 -3
- package/esm/date/DateInput.js +1 -1
- package/esm/date/DateInput.js.map +1 -1
- package/esm/date/datepicker/DatePicker.d.ts +38 -2
- package/esm/date/datepicker/DatePicker.js +22 -0
- package/esm/date/datepicker/DatePicker.js.map +1 -1
- package/esm/date/hooks/index.d.ts +3 -3
- package/esm/date/hooks/index.js +3 -3
- package/esm/date/hooks/index.js.map +1 -1
- package/esm/date/hooks/useDatepicker.d.ts +13 -0
- package/esm/date/hooks/useDatepicker.js +13 -0
- package/esm/date/hooks/useDatepicker.js.map +1 -1
- package/esm/date/hooks/useMonthPicker.d.ts +13 -0
- package/esm/date/hooks/useMonthPicker.js +13 -0
- package/esm/date/hooks/useMonthPicker.js.map +1 -1
- package/esm/date/hooks/useRangeDatepicker.d.ts +12 -0
- package/esm/date/hooks/useRangeDatepicker.js +12 -0
- package/esm/date/hooks/useRangeDatepicker.js.map +1 -1
- package/esm/date/index.d.ts +3 -3
- package/esm/date/index.js +3 -3
- package/esm/date/index.js.map +1 -1
- package/esm/date/monthpicker/MonthPicker.d.ts +34 -4
- package/esm/date/monthpicker/MonthPicker.js +22 -0
- package/esm/date/monthpicker/MonthPicker.js.map +1 -1
- package/esm/dropdown/Dropdown.d.ts +74 -0
- package/esm/dropdown/Dropdown.js +60 -0
- package/esm/dropdown/Dropdown.js.map +1 -0
- package/esm/dropdown/Menu/Divider.d.ts +3 -0
- package/esm/dropdown/Menu/Divider.js +19 -0
- package/esm/dropdown/Menu/Divider.js.map +1 -0
- package/esm/dropdown/Menu/GroupedList/Heading.d.ts +9 -0
- package/esm/dropdown/Menu/GroupedList/Heading.js +19 -0
- package/esm/dropdown/Menu/GroupedList/Heading.js.map +1 -0
- package/esm/dropdown/Menu/GroupedList/Item.d.ts +10 -0
- package/esm/dropdown/Menu/GroupedList/Item.js +26 -0
- package/esm/dropdown/Menu/GroupedList/Item.js.map +1 -0
- package/esm/dropdown/Menu/GroupedList/index.d.ts +23 -0
- package/esm/dropdown/Menu/GroupedList/index.js +23 -0
- package/esm/dropdown/Menu/GroupedList/index.js.map +1 -0
- package/esm/dropdown/Menu/List/Item.d.ts +10 -0
- package/esm/dropdown/Menu/List/Item.js +26 -0
- package/esm/dropdown/Menu/List/Item.js.map +1 -0
- package/esm/dropdown/Menu/List/index.d.ts +18 -0
- package/esm/dropdown/Menu/List/index.js +21 -0
- package/esm/dropdown/Menu/List/index.js.map +1 -0
- package/esm/dropdown/Menu/index.d.ts +35 -0
- package/esm/dropdown/Menu/index.js +36 -0
- package/esm/dropdown/Menu/index.js.map +1 -0
- package/esm/dropdown/Toggle.d.ts +9 -0
- package/esm/dropdown/Toggle.js +38 -0
- package/esm/dropdown/Toggle.js.map +1 -0
- package/esm/dropdown/index.d.ts +2 -0
- package/esm/dropdown/index.js +3 -0
- package/esm/dropdown/index.js.map +1 -0
- package/esm/expansion-card/ExpansionCard.d.ts +40 -8
- package/esm/expansion-card/ExpansionCard.js +18 -0
- package/esm/expansion-card/ExpansionCard.js.map +1 -1
- package/esm/expansion-card/ExpansionCardContent.d.ts +1 -2
- package/esm/expansion-card/ExpansionCardContent.js.map +1 -1
- package/esm/expansion-card/ExpansionCardDescription.d.ts +2 -4
- package/esm/expansion-card/ExpansionCardDescription.js.map +1 -1
- package/esm/expansion-card/ExpansionCardHeader.d.ts +1 -2
- package/esm/expansion-card/ExpansionCardHeader.js.map +1 -1
- package/esm/expansion-card/ExpansionCardTitle.d.ts +2 -4
- package/esm/expansion-card/ExpansionCardTitle.js.map +1 -1
- package/esm/form/ConfirmationPanel.d.ts +18 -0
- package/esm/form/ConfirmationPanel.js +18 -0
- package/esm/form/ConfirmationPanel.js.map +1 -1
- package/esm/form/Select.d.ts +16 -0
- package/esm/form/Select.js +16 -0
- package/esm/form/Select.js.map +1 -1
- package/esm/form/Switch.d.ts +11 -0
- package/esm/form/Switch.js +11 -0
- package/esm/form/Switch.js.map +1 -1
- package/esm/form/TextField.d.ts +11 -0
- package/esm/form/TextField.js +11 -0
- package/esm/form/TextField.js.map +1 -1
- package/esm/form/Textarea.d.ts +11 -0
- package/esm/form/Textarea.js +11 -0
- package/esm/form/Textarea.js.map +1 -1
- package/esm/form/checkbox/CheckboxGroup.d.ts +15 -0
- package/esm/form/checkbox/CheckboxGroup.js +15 -0
- package/esm/form/checkbox/CheckboxGroup.js.map +1 -1
- package/esm/form/error-summary/ErrorSummary.d.ts +18 -0
- package/esm/form/error-summary/ErrorSummary.js +18 -0
- package/esm/form/error-summary/ErrorSummary.js.map +1 -1
- package/esm/form/radio/RadioGroup.d.ts +10 -0
- package/esm/form/radio/RadioGroup.js +10 -0
- package/esm/form/radio/RadioGroup.js.map +1 -1
- package/esm/form/search/Search.d.ts +13 -0
- package/esm/form/search/Search.js +13 -0
- package/esm/form/search/Search.js.map +1 -1
- package/esm/guide-panel/GuidePanel.d.ts +15 -0
- package/esm/guide-panel/GuidePanel.js +15 -0
- package/esm/guide-panel/GuidePanel.js.map +1 -1
- package/esm/help-text/HelpText.d.ts +13 -0
- package/esm/help-text/HelpText.js +13 -0
- package/esm/help-text/HelpText.js.map +1 -1
- package/esm/index.d.ts +4 -0
- package/esm/index.js +4 -0
- package/esm/index.js.map +1 -1
- package/esm/internal-header/InternalHeader.d.ts +60 -0
- package/esm/internal-header/InternalHeader.js +55 -0
- package/esm/internal-header/InternalHeader.js.map +1 -0
- package/esm/internal-header/InternalHeaderButton.d.ts +10 -0
- package/esm/internal-header/InternalHeaderButton.js +19 -0
- package/esm/internal-header/InternalHeaderButton.js.map +1 -0
- package/esm/internal-header/InternalHeaderTitle.d.ts +10 -0
- package/esm/internal-header/InternalHeaderTitle.js +20 -0
- package/esm/internal-header/InternalHeaderTitle.js.map +1 -0
- package/esm/internal-header/InternalHeaderUser.d.ts +13 -0
- package/esm/internal-header/InternalHeaderUser.js +23 -0
- package/esm/internal-header/InternalHeaderUser.js.map +1 -0
- package/esm/internal-header/InternalHeaderUserButton.d.ts +14 -0
- package/esm/internal-header/InternalHeaderUserButton.js +26 -0
- package/esm/internal-header/InternalHeaderUserButton.js.map +1 -0
- package/esm/internal-header/index.d.ts +5 -0
- package/esm/internal-header/index.js +2 -0
- package/esm/internal-header/index.js.map +1 -0
- package/esm/link/Link.d.ts +13 -0
- package/esm/link/Link.js +13 -0
- package/esm/link/Link.js.map +1 -1
- package/esm/link-panel/LinkPanel.d.ts +28 -4
- package/esm/link-panel/LinkPanel.js +17 -0
- package/esm/link-panel/LinkPanel.js.map +1 -1
- package/esm/link-panel/LinkPanelDescription.d.ts +2 -4
- package/esm/link-panel/LinkPanelDescription.js.map +1 -1
- package/esm/link-panel/LinkPanelTitle.d.ts +2 -4
- package/esm/link-panel/LinkPanelTitle.js.map +1 -1
- package/esm/list/List.d.ts +5 -2
- package/esm/list/List.js.map +1 -1
- package/esm/list/ListItem.d.ts +1 -3
- package/esm/list/ListItem.js.map +1 -1
- package/esm/loader/Loader.d.ts +11 -0
- package/esm/loader/Loader.js +11 -0
- package/esm/loader/Loader.js.map +1 -1
- package/esm/modal/Modal.d.ts +27 -0
- package/esm/modal/Modal.js +27 -0
- package/esm/modal/Modal.js.map +1 -1
- package/esm/pagination/Pagination.d.ts +17 -0
- package/esm/pagination/Pagination.js +17 -0
- package/esm/pagination/Pagination.js.map +1 -1
- package/esm/panel/Panel.d.ts +19 -0
- package/esm/panel/Panel.js +19 -0
- package/esm/panel/Panel.js.map +1 -1
- package/esm/popover/Popover.d.ts +20 -0
- package/esm/popover/Popover.js +20 -0
- package/esm/popover/Popover.js.map +1 -1
- package/esm/provider/Provider.d.ts +13 -0
- package/esm/provider/Provider.js +13 -0
- package/esm/provider/Provider.js.map +1 -1
- package/esm/read-more/ReadMore.d.ts +17 -0
- package/esm/read-more/ReadMore.js +17 -0
- package/esm/read-more/ReadMore.js.map +1 -1
- package/esm/skeleton/Skeleton.d.ts +18 -0
- package/esm/skeleton/Skeleton.js +23 -0
- package/esm/skeleton/Skeleton.js.map +1 -0
- package/esm/skeleton/index.d.ts +2 -0
- package/esm/skeleton/index.js +2 -0
- package/esm/skeleton/index.js.map +1 -0
- package/esm/stepper/Step.d.ts +1 -4
- package/esm/stepper/Step.js +1 -2
- package/esm/stepper/Step.js.map +1 -1
- package/esm/stepper/Stepper.d.ts +31 -2
- package/esm/stepper/Stepper.js +24 -0
- package/esm/stepper/Stepper.js.map +1 -1
- package/esm/table/Table.d.ts +32 -0
- package/esm/table/Table.js +32 -0
- package/esm/table/Table.js.map +1 -1
- package/esm/tabs/Tab.d.ts +1 -2
- package/esm/tabs/Tab.js.map +1 -1
- package/esm/tabs/TabList.d.ts +1 -2
- package/esm/tabs/TabList.js.map +1 -1
- package/esm/tabs/TabPanel.d.ts +1 -2
- package/esm/tabs/TabPanel.js.map +1 -1
- package/esm/tabs/Tabs.d.ts +43 -6
- package/esm/tabs/Tabs.js +27 -1
- package/esm/tabs/Tabs.js.map +1 -1
- package/esm/tag/Tag.d.ts +11 -0
- package/esm/tag/Tag.js +11 -0
- package/esm/tag/Tag.js.map +1 -1
- package/esm/timeline/AxisLabels.d.ts +6 -0
- package/esm/timeline/AxisLabels.js +81 -0
- package/esm/timeline/AxisLabels.js.map +1 -0
- package/esm/timeline/Pin.d.ts +17 -0
- package/esm/timeline/Pin.js +81 -0
- package/esm/timeline/Pin.js.map +1 -0
- package/esm/timeline/Timeline.d.ts +63 -0
- package/esm/timeline/Timeline.js +152 -0
- package/esm/timeline/Timeline.js.map +1 -0
- package/esm/timeline/TimelineRow.d.ts +22 -0
- package/esm/timeline/TimelineRow.js +58 -0
- package/esm/timeline/TimelineRow.js.map +1 -0
- package/esm/timeline/hooks/usePeriodContext.d.ts +9 -0
- package/esm/timeline/hooks/usePeriodContext.js +13 -0
- package/esm/timeline/hooks/usePeriodContext.js.map +1 -0
- package/esm/timeline/hooks/useRowContext.d.ts +11 -0
- package/esm/timeline/hooks/useRowContext.js +15 -0
- package/esm/timeline/hooks/useRowContext.js.map +1 -0
- package/esm/timeline/hooks/useTimelineContext.d.ts +15 -0
- package/esm/timeline/hooks/useTimelineContext.js +20 -0
- package/esm/timeline/hooks/useTimelineContext.js.map +1 -0
- package/esm/timeline/hooks/useTimelineRows.d.ts +4 -0
- package/esm/timeline/hooks/useTimelineRows.js +74 -0
- package/esm/timeline/hooks/useTimelineRows.js.map +1 -0
- package/esm/timeline/index.d.ts +6 -0
- package/esm/timeline/index.js +2 -0
- package/esm/timeline/index.js.map +1 -0
- package/esm/timeline/period/ClickablePeriod.d.ts +9 -0
- package/esm/timeline/period/ClickablePeriod.js +93 -0
- package/esm/timeline/period/ClickablePeriod.js.map +1 -0
- package/esm/timeline/period/NonClickablePeriod.d.ts +7 -0
- package/esm/timeline/period/NonClickablePeriod.js +14 -0
- package/esm/timeline/period/NonClickablePeriod.js.map +1 -0
- package/esm/timeline/period/index.d.ts +57 -0
- package/esm/timeline/period/index.js +18 -0
- package/esm/timeline/period/index.js.map +1 -0
- package/esm/timeline/utils/calc.d.ts +5 -0
- package/esm/timeline/utils/calc.js +15 -0
- package/esm/timeline/utils/calc.js.map +1 -0
- package/esm/timeline/utils/filter.d.ts +10 -0
- package/esm/timeline/utils/filter.js +11 -0
- package/esm/timeline/utils/filter.js.map +1 -0
- package/esm/timeline/utils/index.d.ts +1 -0
- package/esm/timeline/utils/index.js +2 -0
- package/esm/timeline/utils/index.js.map +1 -0
- package/esm/timeline/utils/period.d.ts +2 -0
- package/esm/timeline/utils/period.js +33 -0
- package/esm/timeline/utils/period.js.map +1 -0
- package/esm/timeline/utils/sort.d.ts +4 -0
- package/esm/timeline/utils/sort.js +5 -0
- package/esm/timeline/utils/sort.js.map +1 -0
- package/esm/timeline/utils/timeline.d.ts +12 -0
- package/esm/timeline/utils/timeline.js +73 -0
- package/esm/timeline/utils/timeline.js.map +1 -0
- package/esm/timeline/utils/types.external.d.ts +53 -0
- package/esm/timeline/utils/types.external.js +2 -0
- package/esm/timeline/utils/types.external.js.map +1 -0
- package/esm/timeline/utils/types.internal.d.ts +61 -0
- package/esm/timeline/utils/types.internal.js +2 -0
- package/esm/timeline/utils/types.internal.js.map +1 -0
- package/esm/timeline/zoom/ZoomButton.d.ts +19 -0
- package/esm/timeline/zoom/ZoomButton.js +43 -0
- package/esm/timeline/zoom/ZoomButton.js.map +1 -0
- package/esm/timeline/zoom/index.d.ts +11 -0
- package/esm/timeline/zoom/index.js +22 -0
- package/esm/timeline/zoom/index.js.map +1 -0
- package/esm/toggle-group/ToggleGroup.d.ts +20 -2
- package/esm/toggle-group/ToggleGroup.js +17 -2
- package/esm/toggle-group/ToggleGroup.js.map +1 -1
- package/esm/toggle-group/ToggleItem.d.ts +1 -2
- package/esm/toggle-group/ToggleItem.js.map +1 -1
- package/esm/tooltip/Tooltip.d.ts +13 -0
- package/esm/tooltip/Tooltip.js +13 -0
- package/esm/tooltip/Tooltip.js.map +1 -1
- package/esm/typography/BodyLong.d.ts +14 -0
- package/esm/typography/BodyLong.js +14 -0
- package/esm/typography/BodyLong.js.map +1 -1
- package/esm/typography/BodyShort.d.ts +14 -0
- package/esm/typography/BodyShort.js +14 -0
- package/esm/typography/BodyShort.js.map +1 -1
- package/esm/typography/Detail.d.ts +14 -0
- package/esm/typography/Detail.js +14 -0
- package/esm/typography/Detail.js.map +1 -1
- package/esm/typography/ErrorMessage.d.ts +14 -0
- package/esm/typography/ErrorMessage.js +14 -0
- package/esm/typography/ErrorMessage.js.map +1 -1
- package/esm/typography/Heading.d.ts +14 -0
- package/esm/typography/Heading.js +14 -0
- package/esm/typography/Heading.js.map +1 -1
- package/esm/typography/Ingress.d.ts +14 -0
- package/esm/typography/Ingress.js +14 -0
- package/esm/typography/Ingress.js.map +1 -1
- package/esm/typography/Label.d.ts +14 -0
- package/esm/typography/Label.js +14 -0
- package/esm/typography/Label.js.map +1 -1
- package/package.json +2 -2
- package/src/accordion/Accordion.tsx +49 -7
- package/src/accordion/AccordionContent.tsx +1 -5
- package/src/accordion/AccordionHeader.tsx +1 -5
- package/src/accordion/AccordionItem.tsx +1 -5
- package/src/accordion/accordion.stories.tsx +4 -2
- package/src/alert/Alert.tsx +9 -0
- package/src/button/Button.tsx +10 -0
- package/src/chat/Bubble.tsx +1 -5
- package/src/chat/Chat.tsx +23 -2
- package/src/chips/Chips.tsx +42 -4
- package/src/chips/Removable.tsx +1 -4
- package/src/chips/Toggle.tsx +47 -11
- package/src/chips/chips.stories.tsx +73 -20
- package/src/copybutton/CopyButton.tsx +11 -0
- package/src/date/DateInput.tsx +105 -115
- package/src/date/datepicker/DatePicker.tsx +40 -2
- package/src/date/datepicker/datepicker.stories.tsx +19 -21
- package/src/date/datepicker/datepicker.test.tsx +5 -5
- package/src/date/hooks/index.ts +3 -3
- package/src/date/hooks/useDatepicker.tsx +13 -0
- package/src/date/hooks/useMonthPicker.tsx +13 -0
- package/src/date/hooks/useRangeDatepicker.test.tsx +6 -6
- package/src/date/hooks/useRangeDatepicker.tsx +13 -1
- package/src/date/index.ts +5 -5
- package/src/date/monthpicker/MonthPicker.tsx +36 -4
- package/src/date/monthpicker/monthpicker.stories.tsx +5 -5
- package/src/date/utils/__tests__/get-dates.test.ts +0 -1
- package/src/dropdown/Dropdown.tsx +119 -0
- package/src/dropdown/Menu/Divider.tsx +15 -0
- package/src/dropdown/Menu/GroupedList/Heading.tsx +28 -0
- package/src/dropdown/Menu/GroupedList/Item.tsx +41 -0
- package/src/dropdown/Menu/GroupedList/index.tsx +43 -0
- package/src/dropdown/Menu/List/Item.tsx +38 -0
- package/src/dropdown/Menu/List/index.tsx +32 -0
- package/src/dropdown/Menu/index.tsx +96 -0
- package/src/dropdown/Toggle.tsx +48 -0
- package/src/dropdown/dropdown.stories.tsx +91 -0
- package/src/dropdown/index.ts +2 -0
- package/src/expansion-card/ExpansionCard.tsx +46 -8
- package/src/expansion-card/ExpansionCardContent.tsx +25 -28
- package/src/expansion-card/ExpansionCardDescription.tsx +22 -24
- package/src/expansion-card/ExpansionCardHeader.tsx +31 -34
- package/src/expansion-card/ExpansionCardTitle.tsx +3 -5
- package/src/form/ConfirmationPanel.tsx +18 -0
- package/src/form/Select.tsx +16 -0
- package/src/form/Switch.tsx +11 -0
- package/src/form/TextField.tsx +11 -0
- package/src/form/Textarea.tsx +11 -0
- package/src/form/checkbox/CheckboxGroup.tsx +15 -0
- package/src/form/error-summary/ErrorSummary.tsx +18 -0
- package/src/form/radio/RadioGroup.tsx +10 -0
- package/src/form/search/Search.tsx +13 -0
- package/src/guide-panel/GuidePanel.tsx +15 -0
- package/src/help-text/HelpText.tsx +13 -0
- package/src/index.ts +4 -0
- package/src/internal-header/InternalHeader.tsx +93 -0
- package/src/internal-header/InternalHeaderButton.tsx +23 -0
- package/src/internal-header/InternalHeaderTitle.tsx +27 -0
- package/src/internal-header/InternalHeaderUser.tsx +35 -0
- package/src/internal-header/InternalHeaderUserButton.tsx +40 -0
- package/src/internal-header/header.stories.tsx +225 -0
- package/src/internal-header/index.ts +8 -0
- package/src/link/Link.tsx +13 -0
- package/src/link-panel/LinkPanel.tsx +30 -4
- package/src/link-panel/LinkPanelDescription.tsx +12 -15
- package/src/link-panel/LinkPanelTitle.tsx +15 -18
- package/src/list/List.tsx +7 -2
- package/src/list/ListItem.tsx +1 -6
- package/src/loader/Loader.tsx +11 -0
- package/src/modal/Modal.tsx +27 -0
- package/src/pagination/Pagination.tsx +17 -0
- package/src/panel/Panel.tsx +19 -0
- package/src/popover/Popover.tsx +20 -0
- package/src/provider/Provider.tsx +13 -0
- package/src/read-more/ReadMore.tsx +17 -0
- package/src/skeleton/Skeleton.tsx +48 -0
- package/src/skeleton/index.ts +2 -0
- package/src/skeleton/skeleton.stories.tsx +118 -0
- package/src/stepper/Step.tsx +57 -60
- package/src/stepper/Stepper.tsx +31 -2
- package/src/table/Table.tsx +32 -0
- package/src/tabs/Tab.tsx +38 -39
- package/src/tabs/TabList.tsx +1 -5
- package/src/tabs/TabPanel.tsx +1 -5
- package/src/tabs/Tabs.tsx +48 -7
- package/src/tag/Tag.tsx +11 -0
- package/src/timeline/AxisLabels.tsx +143 -0
- package/src/timeline/Pin.tsx +169 -0
- package/src/timeline/Timeline.tsx +237 -0
- package/src/timeline/TimelineRow.tsx +122 -0
- package/src/timeline/hooks/usePeriodContext.tsx +22 -0
- package/src/timeline/hooks/useRowContext.tsx +26 -0
- package/src/timeline/hooks/useTimelineContext.tsx +37 -0
- package/src/timeline/hooks/useTimelineRows.ts +161 -0
- package/src/timeline/index.ts +6 -0
- package/src/timeline/period/ClickablePeriod.tsx +193 -0
- package/src/timeline/period/NonClickablePeriod.tsx +46 -0
- package/src/timeline/period/index.tsx +130 -0
- package/src/timeline/timeline.stories.tsx +444 -0
- package/src/timeline/utils/calc.ts +26 -0
- package/src/timeline/utils/filter.ts +32 -0
- package/src/timeline/utils/index.ts +6 -0
- package/src/timeline/utils/period.ts +48 -0
- package/src/timeline/utils/sort.ts +11 -0
- package/src/timeline/utils/timeline.ts +83 -0
- package/src/timeline/utils/types.external.ts +67 -0
- package/src/timeline/utils/types.internal.ts +76 -0
- package/src/timeline/zoom/ZoomButton.tsx +83 -0
- package/src/timeline/zoom/index.tsx +30 -0
- package/src/toggle-group/ToggleGroup.tsx +23 -3
- package/src/toggle-group/ToggleItem.tsx +1 -5
- package/src/tooltip/Tooltip.tsx +13 -0
- package/src/typography/BodyLong.tsx +14 -0
- package/src/typography/BodyShort.tsx +14 -0
- package/src/typography/Detail.tsx +14 -0
- package/src/typography/ErrorMessage.tsx +14 -0
- package/src/typography/Heading.tsx +14 -0
- package/src/typography/Ingress.tsx +14 -0
- package/src/typography/Label.tsx +14 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useLatestDate = exports.useEarliestDate = exports.useTimelineRows = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const date_fns_1 = require("date-fns");
|
|
6
|
+
const sort_1 = require("../utils/sort");
|
|
7
|
+
const calc_1 = require("../utils/calc");
|
|
8
|
+
const filter_1 = require("../utils/filter");
|
|
9
|
+
const spatialPeriod = (period, timelineStart, timelineEndInclusive, direction = "left", i, periods, rowIndex) => {
|
|
10
|
+
const start = period.start;
|
|
11
|
+
const endInclusive = period.end;
|
|
12
|
+
const rightOverlap = i < periods.length - 1 && !(0, date_fns_1.isAfter)(periods[i + 1].start, endInclusive);
|
|
13
|
+
const { horizontalPosition, width } = (0, calc_1.horizontalPositionAndWidth)((0, date_fns_1.startOfDay)(start), (0, date_fns_1.endOfDay)(rightOverlap ? (0, date_fns_1.startOfDay)((0, date_fns_1.subDays)(periods[i + 1].start, 1)) : endInclusive), timelineStart, timelineEndInclusive);
|
|
14
|
+
return {
|
|
15
|
+
id: `r-${rowIndex}-p-${i}`,
|
|
16
|
+
start: start,
|
|
17
|
+
endInclusive: endInclusive,
|
|
18
|
+
horizontalPosition: horizontalPosition,
|
|
19
|
+
direction: direction,
|
|
20
|
+
width: width,
|
|
21
|
+
end: endInclusive,
|
|
22
|
+
status: period.status,
|
|
23
|
+
onSelectPeriod: period.onSelectPeriod,
|
|
24
|
+
icon: period.icon,
|
|
25
|
+
children: period.children,
|
|
26
|
+
isActive: period.isActive,
|
|
27
|
+
statusLabel: period.statusLabel,
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
const adjustedEdges = (period, i, allPeriods) => {
|
|
31
|
+
const left = i > 0 && (0, filter_1.withinADay)(period.start, allPeriods[i - 1].endInclusive);
|
|
32
|
+
const right = i < allPeriods.length - 1 &&
|
|
33
|
+
(0, filter_1.withinADay)(allPeriods[i + 1].start, period.endInclusive);
|
|
34
|
+
return left && right
|
|
35
|
+
? Object.assign(Object.assign({}, period), { cropped: "both" }) : left
|
|
36
|
+
? Object.assign(Object.assign({}, period), { cropped: "left" }) : right
|
|
37
|
+
? Object.assign(Object.assign({}, period), { cropped: "right" }) : period;
|
|
38
|
+
};
|
|
39
|
+
const trimmedPeriods = (period) => {
|
|
40
|
+
let { horizontalPosition, width, cropped } = period;
|
|
41
|
+
if (horizontalPosition + width > 100) {
|
|
42
|
+
width = 100 - horizontalPosition;
|
|
43
|
+
cropped = cropped === "left" || cropped === "both" ? "both" : "right";
|
|
44
|
+
}
|
|
45
|
+
if (horizontalPosition < 0 && horizontalPosition + width > 0) {
|
|
46
|
+
width = horizontalPosition + width;
|
|
47
|
+
horizontalPosition = 0;
|
|
48
|
+
cropped = cropped === "right" || cropped === "both" ? "both" : "left";
|
|
49
|
+
}
|
|
50
|
+
return Object.assign(Object.assign({}, period), { width: width, horizontalPosition: horizontalPosition, cropped: cropped });
|
|
51
|
+
};
|
|
52
|
+
const useTimelineRows = (rows, startDate, endDate, direction) => (0, react_1.useMemo)(() => rows.map((periods, i) => {
|
|
53
|
+
const rowIndex = i;
|
|
54
|
+
const timelinePeriods = periods.periods
|
|
55
|
+
.sort((a, b) => a.start.valueOf() - b.start.valueOf())
|
|
56
|
+
.map((period, i) => (Object.assign(Object.assign({}, spatialPeriod(period, startDate, endDate, direction, i, periods.periods, rowIndex)), { restProps: period === null || period === void 0 ? void 0 : period.restProps, ref: period === null || period === void 0 ? void 0 : period.ref })))
|
|
57
|
+
.sort(sort_1.lastPeriod)
|
|
58
|
+
.map(adjustedEdges)
|
|
59
|
+
.map(trimmedPeriods)
|
|
60
|
+
.filter(filter_1.invisiblePeriods);
|
|
61
|
+
return {
|
|
62
|
+
id: `tl-row-${rowIndex}`,
|
|
63
|
+
label: periods.label,
|
|
64
|
+
headingTag: periods.headingTag || "h3",
|
|
65
|
+
icon: periods.icon,
|
|
66
|
+
periods: direction === "left" ? timelinePeriods : timelinePeriods.reverse(),
|
|
67
|
+
restProps: periods === null || periods === void 0 ? void 0 : periods.restProps,
|
|
68
|
+
ref: periods === null || periods === void 0 ? void 0 : periods.ref,
|
|
69
|
+
};
|
|
70
|
+
}), [rows, startDate, endDate, direction]);
|
|
71
|
+
exports.useTimelineRows = useTimelineRows;
|
|
72
|
+
const earliestDate = (earliest, period) => period.start < earliest ? period.start : earliest;
|
|
73
|
+
const earliestFomDate = (rader) => rader.flat().reduce(earliestDate, new Date());
|
|
74
|
+
const useEarliestDate = ({ startDate, rows }) => (0, react_1.useMemo)(() => (startDate ? startDate : earliestFomDate(rows)), [startDate, rows]);
|
|
75
|
+
exports.useEarliestDate = useEarliestDate;
|
|
76
|
+
const latestDate = (latest, period) => period.end > latest ? period.end : latest;
|
|
77
|
+
const latestTomDate = (rows) => rows.flat().reduce(latestDate, new Date(0));
|
|
78
|
+
const useLatestDate = ({ endDate, rows }) => (0, react_1.useMemo)(() => (endDate ? endDate : (0, date_fns_1.addDays)(latestTomDate(rows), 1)), [endDate, rows]);
|
|
79
|
+
exports.useLatestDate = useLatestDate;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Timeline = void 0;
|
|
7
|
+
var Timeline_1 = require("./Timeline");
|
|
8
|
+
Object.defineProperty(exports, "Timeline", { enumerable: true, get: function () { return __importDefault(Timeline_1).default; } });
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const react_1 = require("@floating-ui/react");
|
|
30
|
+
const util_1 = require("../../util");
|
|
31
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
32
|
+
const react_2 = __importStar(require("react"));
|
|
33
|
+
const usePeriodContext_1 = require("../hooks/usePeriodContext");
|
|
34
|
+
const useRowContext_1 = require("../hooks/useRowContext");
|
|
35
|
+
const useTimelineContext_1 = require("../hooks/useTimelineContext");
|
|
36
|
+
const period_1 = require("../utils/period");
|
|
37
|
+
const ClickablePeriod = react_2.default.memo(({ onSelectPeriod, start, end, status, cropped, direction, left, width, icon, children, isActive, statusLabel, restProps, periodRef, }) => {
|
|
38
|
+
const [open, setOpen] = (0, react_2.useState)(false);
|
|
39
|
+
const { index } = (0, useRowContext_1.useRowContext)();
|
|
40
|
+
const { firstFocus } = (0, usePeriodContext_1.usePeriodContext)();
|
|
41
|
+
const { initiate, addFocusable } = (0, useTimelineContext_1.useTimelineContext)();
|
|
42
|
+
const arrowRef = (0, react_2.useRef)(null);
|
|
43
|
+
const { context, placement, middlewareData: { arrow: { x: arrowX, y: arrowY } = {} }, refs, floatingStyles, } = (0, react_1.useFloating)({
|
|
44
|
+
placement: "top",
|
|
45
|
+
open: open,
|
|
46
|
+
onOpenChange: setOpen,
|
|
47
|
+
middleware: [
|
|
48
|
+
(0, react_1.offset)(16),
|
|
49
|
+
(0, react_1.shift)(),
|
|
50
|
+
(0, react_1.flip)({ padding: 5, fallbackPlacements: ["bottom", "top"] }),
|
|
51
|
+
(0, react_1.arrow)({ element: arrowRef, padding: 5 }),
|
|
52
|
+
],
|
|
53
|
+
whileElementsMounted: react_1.autoUpdate,
|
|
54
|
+
});
|
|
55
|
+
const { getFloatingProps, getReferenceProps } = (0, react_1.useInteractions)([
|
|
56
|
+
(0, react_1.useHover)(context, {
|
|
57
|
+
handleClose: (0, react_1.safePolygon)(),
|
|
58
|
+
restMs: 25,
|
|
59
|
+
delay: { open: 1000 },
|
|
60
|
+
}),
|
|
61
|
+
(0, react_1.useFocus)(context),
|
|
62
|
+
(0, react_1.useDismiss)(context),
|
|
63
|
+
]);
|
|
64
|
+
const mergedRef = (0, react_2.useMemo)(() => (0, util_1.mergeRefs)([refs.setReference, periodRef]), [periodRef, refs.setReference]);
|
|
65
|
+
(0, util_1.useEventListener)("focusin", (0, react_2.useCallback)((e) => {
|
|
66
|
+
var _a;
|
|
67
|
+
if (![refs.domReference.current, (_a = refs === null || refs === void 0 ? void 0 : refs.floating) === null || _a === void 0 ? void 0 : _a.current].some((element) => element === null || element === void 0 ? void 0 : element.contains(e.target))) {
|
|
68
|
+
open && setOpen(false);
|
|
69
|
+
}
|
|
70
|
+
}, [open, refs.domReference, refs === null || refs === void 0 ? void 0 : refs.floating]));
|
|
71
|
+
const staticSide = {
|
|
72
|
+
top: "bottom",
|
|
73
|
+
right: "left",
|
|
74
|
+
bottom: "top",
|
|
75
|
+
left: "right",
|
|
76
|
+
}[placement.split("-")[0]];
|
|
77
|
+
return (react_2.default.createElement(react_2.default.Fragment, null,
|
|
78
|
+
react_2.default.createElement("button", Object.assign({}, restProps, { type: "button", ref: (r) => {
|
|
79
|
+
firstFocus && addFocusable(r, index);
|
|
80
|
+
mergedRef(r);
|
|
81
|
+
}, "aria-label": (0, period_1.ariaLabel)(start, end, status, statusLabel), className: (0, clsx_1.default)("navds-timeline__period--clickable", (0, period_1.getConditionalClasses)(cropped, direction, status), restProps === null || restProps === void 0 ? void 0 : restProps.className, {
|
|
82
|
+
"navds-timeline__period--selected": isActive,
|
|
83
|
+
}), "aria-expanded": children ? open : undefined, "aria-current": isActive || undefined }, getReferenceProps({
|
|
84
|
+
onFocus: () => {
|
|
85
|
+
initiate(index);
|
|
86
|
+
},
|
|
87
|
+
onKeyDown: (e) => {
|
|
88
|
+
var _a;
|
|
89
|
+
(_a = restProps === null || restProps === void 0 ? void 0 : restProps.onKeydown) === null || _a === void 0 ? void 0 : _a.call(restProps, e);
|
|
90
|
+
if (e.key === "Enter") {
|
|
91
|
+
setOpen((prev) => !prev);
|
|
92
|
+
}
|
|
93
|
+
if (e.key === " ") {
|
|
94
|
+
onSelectPeriod === null || onSelectPeriod === void 0 ? void 0 : onSelectPeriod(e);
|
|
95
|
+
setOpen(false);
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
style: {
|
|
99
|
+
width: `${width}%`,
|
|
100
|
+
[direction]: `${left}%`,
|
|
101
|
+
},
|
|
102
|
+
onClick: (e) => {
|
|
103
|
+
var _a;
|
|
104
|
+
(_a = restProps === null || restProps === void 0 ? void 0 : restProps.onClick) === null || _a === void 0 ? void 0 : _a.call(restProps, e);
|
|
105
|
+
if (e.detail === 0) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
onSelectPeriod === null || onSelectPeriod === void 0 ? void 0 : onSelectPeriod(e);
|
|
109
|
+
},
|
|
110
|
+
})),
|
|
111
|
+
react_2.default.createElement("span", { className: "navds-timeline__period--inner" }, icon)),
|
|
112
|
+
children && (react_2.default.createElement("div", Object.assign({ className: "navds-timeline__popover", "data-placement": placement, "aria-hidden": !open, ref: refs.setFloating }, getFloatingProps({
|
|
113
|
+
tabIndex: -1,
|
|
114
|
+
}), { style: Object.assign(Object.assign({}, floatingStyles), { display: open ? undefined : "none" }) }),
|
|
115
|
+
react_2.default.createElement("div", { className: "navds-timeline__popover-content" }, children),
|
|
116
|
+
react_2.default.createElement("div", { ref: (node) => {
|
|
117
|
+
arrowRef.current = node;
|
|
118
|
+
}, style: Object.assign(Object.assign(Object.assign({}, (arrowX != null ? { left: arrowX } : {})), (arrowY != null ? { top: arrowY } : {})), (staticSide ? { [staticSide]: "-0.5rem" } : {})), className: "navds-timeline__popover-arrow" })))));
|
|
119
|
+
});
|
|
120
|
+
exports.default = ClickablePeriod;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const period_1 = require("../utils/period");
|
|
8
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
9
|
+
const NonClickablePeriod = ({ start, end, status, cropped, direction, left, width, icon, statusLabel, restProps, periodRef, }) => {
|
|
10
|
+
return (react_1.default.createElement("div", Object.assign({ ref: periodRef }, restProps, { className: (0, clsx_1.default)((0, period_1.getConditionalClasses)(cropped, direction, status), restProps === null || restProps === void 0 ? void 0 : restProps.classname), style: {
|
|
11
|
+
width: `${width}%`,
|
|
12
|
+
[direction]: `${left}%`,
|
|
13
|
+
} }),
|
|
14
|
+
react_1.default.createElement("span", { className: "navds-timeline__period--inner" },
|
|
15
|
+
icon,
|
|
16
|
+
react_1.default.createElement("span", { className: "sr-only" }, (0, period_1.ariaLabel)(start, end, status, statusLabel)))));
|
|
17
|
+
};
|
|
18
|
+
exports.default = NonClickablePeriod;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.Period = void 0;
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const usePeriodContext_1 = require("../hooks/usePeriodContext");
|
|
32
|
+
const useRowContext_1 = require("../hooks/useRowContext");
|
|
33
|
+
const ClickablePeriod_1 = __importDefault(require("./ClickablePeriod"));
|
|
34
|
+
const NonClickablePeriod_1 = __importDefault(require("./NonClickablePeriod"));
|
|
35
|
+
exports.Period = (0, react_1.forwardRef)(({ icon }, ref) => {
|
|
36
|
+
const { periods } = (0, useRowContext_1.useRowContext)();
|
|
37
|
+
const { periodId, restProps } = (0, usePeriodContext_1.usePeriodContext)();
|
|
38
|
+
const period = periods.find((p) => p.id === periodId);
|
|
39
|
+
if (!period) {
|
|
40
|
+
return react_1.default.createElement(react_1.default.Fragment, null);
|
|
41
|
+
}
|
|
42
|
+
const { start, endInclusive, width, horizontalPosition, status = "neutral", onSelectPeriod, cropped, direction, children, isActive, statusLabel, } = period;
|
|
43
|
+
return onSelectPeriod || children ? (react_1.default.createElement(ClickablePeriod_1.default, { periodRef: ref, start: start, end: endInclusive, status: status, onSelectPeriod: onSelectPeriod, cropped: cropped || "", direction: direction, width: width, left: horizontalPosition, icon: icon, children: children, isActive: isActive, statusLabel: statusLabel, restProps: restProps })) : (react_1.default.createElement(NonClickablePeriod_1.default, { periodRef: ref, start: start, end: endInclusive, status: status, cropped: cropped || "", direction: direction, width: width, left: horizontalPosition, icon: icon, statusLabel: statusLabel, restProps: restProps }));
|
|
44
|
+
});
|
|
45
|
+
exports.Period.componentType = "period";
|
|
46
|
+
exports.default = exports.Period;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.horizontalPositionAndWidth = exports.position = void 0;
|
|
4
|
+
const date_fns_1 = require("date-fns");
|
|
5
|
+
const position = (date, start, endInclusive) => {
|
|
6
|
+
const diff = (0, date_fns_1.differenceInMilliseconds)(endInclusive, start);
|
|
7
|
+
return ((0, date_fns_1.differenceInMilliseconds)(date, start) / diff) * 100;
|
|
8
|
+
};
|
|
9
|
+
exports.position = position;
|
|
10
|
+
const horizontalPositionAndWidth = (start, endInclusive, timelineStart, timelineEndInclusive) => {
|
|
11
|
+
const horizontalPosition = (0, exports.position)(start, timelineStart, timelineEndInclusive);
|
|
12
|
+
const width = (0, exports.position)(endInclusive, timelineStart, timelineEndInclusive) -
|
|
13
|
+
horizontalPosition;
|
|
14
|
+
return {
|
|
15
|
+
horizontalPosition: horizontalPosition,
|
|
16
|
+
width: width,
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
exports.horizontalPositionAndWidth = horizontalPositionAndWidth;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.invisiblePeriods = exports.withinADay = exports.getLastDate = exports.getFirstDate = exports.isVisible = void 0;
|
|
4
|
+
const date_fns_1 = require("date-fns");
|
|
5
|
+
const isVisible = ({ horizontalPosition }) => horizontalPosition <= 98 && horizontalPosition >= 0;
|
|
6
|
+
exports.isVisible = isVisible;
|
|
7
|
+
const getFirstDate = (periods) => {
|
|
8
|
+
return periods.sort((a, b) => a.start.getTime() - b.start.getTime())[0].start;
|
|
9
|
+
};
|
|
10
|
+
exports.getFirstDate = getFirstDate;
|
|
11
|
+
const getLastDate = (periods) => {
|
|
12
|
+
return periods.sort((a, b) => a.end.getTime() - b.end.getTime())[periods.length - 1].end;
|
|
13
|
+
};
|
|
14
|
+
exports.getLastDate = getLastDate;
|
|
15
|
+
const withinADay = (date1, date2) => (0, date_fns_1.differenceInDays)(date1, date2) <= 1;
|
|
16
|
+
exports.withinADay = withinADay;
|
|
17
|
+
const invisiblePeriods = ({ horizontalPosition, width, }) => horizontalPosition >= 0 && horizontalPosition <= 100 && width > 0;
|
|
18
|
+
exports.invisiblePeriods = invisiblePeriods;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isVisible = exports.getLastDate = exports.getFirstDate = void 0;
|
|
4
|
+
var filter_1 = require("./filter");
|
|
5
|
+
Object.defineProperty(exports, "getFirstDate", { enumerable: true, get: function () { return filter_1.getFirstDate; } });
|
|
6
|
+
Object.defineProperty(exports, "getLastDate", { enumerable: true, get: function () { return filter_1.getLastDate; } });
|
|
7
|
+
Object.defineProperty(exports, "isVisible", { enumerable: true, get: function () { return filter_1.isVisible; } });
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ariaLabel = exports.getConditionalClasses = void 0;
|
|
7
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
8
|
+
const date_fns_1 = require("date-fns");
|
|
9
|
+
const getConditionalClasses = (cropped, direction, status) => {
|
|
10
|
+
return (0, clsx_1.default)(`navds-timeline__period navds-timeline__period--${status}`, {
|
|
11
|
+
"navds-timeline__period--connected-both": cropped === "both",
|
|
12
|
+
"navds-timeline__period--connected-right": (cropped === "right" && direction === "left") ||
|
|
13
|
+
(cropped === "left" && direction === "right"),
|
|
14
|
+
"navds-timeline__period--connected-left": (cropped === "left" && direction === "left") ||
|
|
15
|
+
(cropped === "right" && direction === "right"),
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
exports.getConditionalClasses = getConditionalClasses;
|
|
19
|
+
const translateStatus = (status) => {
|
|
20
|
+
switch (status) {
|
|
21
|
+
case "success":
|
|
22
|
+
return "Suksess";
|
|
23
|
+
case "warning":
|
|
24
|
+
return "Advarsel";
|
|
25
|
+
case "danger":
|
|
26
|
+
return "Fare";
|
|
27
|
+
case "info":
|
|
28
|
+
return "Info";
|
|
29
|
+
case "neutral":
|
|
30
|
+
return "Nøytral";
|
|
31
|
+
default:
|
|
32
|
+
return status;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const ariaLabel = (startDate, endDate, status, statusLabel) => {
|
|
36
|
+
const start = (0, date_fns_1.format)(startDate, "dd.MM.yyyy");
|
|
37
|
+
const end = (0, date_fns_1.format)(endDate, "dd.MM.yyyy");
|
|
38
|
+
return `${statusLabel ? statusLabel : translateStatus(status)} fra ${start} til ${end}`;
|
|
39
|
+
};
|
|
40
|
+
exports.ariaLabel = ariaLabel;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.lastSinglePeriod = exports.lastPeriod = exports.lastDate = void 0;
|
|
4
|
+
const date_fns_1 = require("date-fns");
|
|
5
|
+
const lastDate = (a, b) => (0, date_fns_1.differenceInMilliseconds)(a, b);
|
|
6
|
+
exports.lastDate = lastDate;
|
|
7
|
+
const lastPeriod = (a, b) => a.horizontalPosition - b.horizontalPosition;
|
|
8
|
+
exports.lastPeriod = lastPeriod;
|
|
9
|
+
const lastSinglePeriod = (a, b) => (0, date_fns_1.differenceInMilliseconds)(b.endInclusive, a.endInclusive);
|
|
10
|
+
exports.lastSinglePeriod = lastSinglePeriod;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.parseRows = void 0;
|
|
7
|
+
const util_1 = require("../../util");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const parseRows = (rowChildren) => {
|
|
10
|
+
let parsedChildren = [];
|
|
11
|
+
rowChildren === null || rowChildren === void 0 ? void 0 : rowChildren.forEach((r) => {
|
|
12
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
13
|
+
let periods = [];
|
|
14
|
+
if (react_1.default.isValidElement(r) && ((_a = r === null || r === void 0 ? void 0 : r.props) === null || _a === void 0 ? void 0 : _a.children)) {
|
|
15
|
+
if (Array.isArray(r.props.children)) {
|
|
16
|
+
for (let i = 0; i < r.props.children.length; i++) {
|
|
17
|
+
const p = r.props.children[i];
|
|
18
|
+
periods.push({
|
|
19
|
+
start: (_b = p === null || p === void 0 ? void 0 : p.props) === null || _b === void 0 ? void 0 : _b.start,
|
|
20
|
+
end: (_c = p === null || p === void 0 ? void 0 : p.props) === null || _c === void 0 ? void 0 : _c.end,
|
|
21
|
+
status: ((_d = p === null || p === void 0 ? void 0 : p.props) === null || _d === void 0 ? void 0 : _d.status) || "neutral",
|
|
22
|
+
onSelectPeriod: (_e = p.props) === null || _e === void 0 ? void 0 : _e.onSelectPeriod,
|
|
23
|
+
label: r.props.label,
|
|
24
|
+
icon: p.props.icon,
|
|
25
|
+
children: p.props.children,
|
|
26
|
+
isActive: p.props.isActive,
|
|
27
|
+
statusLabel: p.props.statusLabel,
|
|
28
|
+
restProps: (0, util_1.omit)(p.props, [
|
|
29
|
+
"start",
|
|
30
|
+
"end",
|
|
31
|
+
"status",
|
|
32
|
+
"onSelectPeriod",
|
|
33
|
+
"label",
|
|
34
|
+
"icon",
|
|
35
|
+
"children",
|
|
36
|
+
"isActive",
|
|
37
|
+
"statusLabel",
|
|
38
|
+
]),
|
|
39
|
+
ref: p === null || p === void 0 ? void 0 : p.ref,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
periods.push({
|
|
45
|
+
start: r.props.children.props.start,
|
|
46
|
+
end: r.props.children.props.end,
|
|
47
|
+
status: ((_f = r.props.children.props) === null || _f === void 0 ? void 0 : _f.status) || "neutral",
|
|
48
|
+
onSelectPeriod: (_g = r.props.children.props) === null || _g === void 0 ? void 0 : _g.onSelectPeriod,
|
|
49
|
+
label: r.props.label,
|
|
50
|
+
icon: (_h = r.props.children.props) === null || _h === void 0 ? void 0 : _h.icon,
|
|
51
|
+
children: (_j = r.props.children.props) === null || _j === void 0 ? void 0 : _j.children,
|
|
52
|
+
statusLabel: (_k = r.props.children.props) === null || _k === void 0 ? void 0 : _k.statusLabel,
|
|
53
|
+
restProps: (0, util_1.omit)(r.props.children.props, [
|
|
54
|
+
"start",
|
|
55
|
+
"end",
|
|
56
|
+
"status",
|
|
57
|
+
"onSelectPeriod",
|
|
58
|
+
"label",
|
|
59
|
+
"icon",
|
|
60
|
+
"children",
|
|
61
|
+
"isActive",
|
|
62
|
+
"statusLabel",
|
|
63
|
+
]),
|
|
64
|
+
ref: (_m = (_l = r.props) === null || _l === void 0 ? void 0 : _l.children) === null || _m === void 0 ? void 0 : _m.ref,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
parsedChildren.push({
|
|
68
|
+
label: r.props.label,
|
|
69
|
+
icon: r.props.icon,
|
|
70
|
+
headingTag: r.props.headingTag,
|
|
71
|
+
periods: periods,
|
|
72
|
+
restProps: (0, util_1.omit)(r.props, ["label", "icon", "headingTag"]),
|
|
73
|
+
ref: r === null || r === void 0 ? void 0 : r.ref,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
return parsedChildren;
|
|
78
|
+
};
|
|
79
|
+
exports.parseRows = parseRows;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
+
t[p] = s[p];
|
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
+
t[p[i]] = s[p[i]];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.ZoomButton = void 0;
|
|
38
|
+
const Detail_1 = require("../../typography/Detail");
|
|
39
|
+
const date_fns_1 = require("date-fns");
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
41
|
+
const useTimelineContext_1 = require("../hooks/useTimelineContext");
|
|
42
|
+
exports.ZoomButton = (0, react_1.forwardRef)((_a, ref) => {
|
|
43
|
+
var { label, interval, count } = _a, rest = __rest(_a, ["label", "interval", "count"]);
|
|
44
|
+
const { setStart, endDate, startDate, direction } = (0, useTimelineContext_1.useTimelineContext)();
|
|
45
|
+
let startOfRange;
|
|
46
|
+
if (interval === "month") {
|
|
47
|
+
startOfRange =
|
|
48
|
+
direction === "left"
|
|
49
|
+
? (0, date_fns_1.subMonths)(endDate, count)
|
|
50
|
+
: (0, date_fns_1.addMonths)(startDate, count);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
startOfRange =
|
|
54
|
+
direction === "left"
|
|
55
|
+
? (0, date_fns_1.subYears)(endDate, count)
|
|
56
|
+
: (0, date_fns_1.addYears)(startDate, count);
|
|
57
|
+
}
|
|
58
|
+
const currentZoom = direction === "left"
|
|
59
|
+
? (0, date_fns_1.isSameDay)(startDate, startOfRange)
|
|
60
|
+
: (0, date_fns_1.isSameDay)(endDate, startOfRange);
|
|
61
|
+
return (react_1.default.createElement(Detail_1.Detail, { as: "li" },
|
|
62
|
+
react_1.default.createElement("button", Object.assign({ type: "button", "aria-label": !currentZoom
|
|
63
|
+
? `Zoom tidslinjen ${(0, date_fns_1.format)(startOfRange, "dd.MM.yyyy")} til ${(0, date_fns_1.format)(endDate, "dd.MM.yyyy")}`
|
|
64
|
+
: "Tilbakestill til initiell tidsperspektiv", ref: ref }, rest, { className: "navds-timeline__zoom-button", onClick: () => {
|
|
65
|
+
setStart(startOfRange);
|
|
66
|
+
}, "aria-pressed": currentZoom }), label)));
|
|
67
|
+
});
|
|
68
|
+
exports.default = exports.ZoomButton;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
+
t[p] = s[p];
|
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
+
t[p[i]] = s[p[i]];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.Zoom = void 0;
|
|
41
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
42
|
+
const react_1 = __importStar(require("react"));
|
|
43
|
+
const ZoomButton_1 = __importDefault(require("./ZoomButton"));
|
|
44
|
+
exports.Zoom = (0, react_1.forwardRef)((_a, ref) => {
|
|
45
|
+
var { className, children } = _a, rest = __rest(_a, ["className", "children"]);
|
|
46
|
+
return (react_1.default.createElement("ul", Object.assign({ ref: ref, className: (0, clsx_1.default)(className, "navds-timeline__zoom") }, rest), children));
|
|
47
|
+
});
|
|
48
|
+
exports.Zoom.Button = ZoomButton_1.default;
|
|
49
|
+
exports.Zoom.componentType = "zoom";
|
|
50
|
+
exports.default = exports.Zoom;
|
|
@@ -38,12 +38,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.ToggleGroup = exports.ToggleGroupContext = void 0;
|
|
41
|
+
const RadixToggleGroup = __importStar(require("@radix-ui/react-toggle-group"));
|
|
41
42
|
const clsx_1 = __importDefault(require("clsx"));
|
|
42
43
|
const react_1 = __importStar(require("react"));
|
|
43
|
-
const ToggleItem_1 = __importDefault(require("./ToggleItem"));
|
|
44
|
-
const RadixToggleGroup = __importStar(require("@radix-ui/react-toggle-group"));
|
|
45
44
|
const __1 = require("..");
|
|
45
|
+
const ToggleItem_1 = __importDefault(require("./ToggleItem"));
|
|
46
46
|
exports.ToggleGroupContext = (0, react_1.createContext)(null);
|
|
47
|
+
/**
|
|
48
|
+
* A component that displays a group of toggle buttons.
|
|
49
|
+
*
|
|
50
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/toggle-group)
|
|
51
|
+
* @see 🏷️ {@link ToggleGroupProps}
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```jsx
|
|
55
|
+
* <ToggleGroup defaultValue="lest" onChange={console.log} size="small">
|
|
56
|
+
* <ToggleGroup.Item value="ulest">Ulest</ToggleGroup.Item>
|
|
57
|
+
* <ToggleGroup.Item value="lest">Leste</ToggleGroup.Item>
|
|
58
|
+
* <ToggleGroup.Item value="sendt">Sendt</ToggleGroup.Item>
|
|
59
|
+
* </ToggleGroup>
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
47
62
|
exports.ToggleGroup = (0, react_1.forwardRef)((_a, ref) => {
|
|
48
63
|
var { className, children, onChange, size = "medium", label, value, defaultValue, id, "aria-describedby": desc, variant = "action" } = _a, rest = __rest(_a, ["className", "children", "onChange", "size", "label", "value", "defaultValue", "id", "aria-describedby", "variant"]);
|
|
49
64
|
const [groupValue, setGroupValue] = (0, react_1.useState)(defaultValue);
|