@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
|
@@ -8,36 +8,33 @@ export interface ExpansionCardContentProps
|
|
|
8
8
|
children: React.ReactNode;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const ExpansionCardContent = forwardRef<
|
|
12
|
+
HTMLDivElement,
|
|
13
|
+
ExpansionCardContentProps
|
|
14
|
+
>(({ children, className, ...rest }, ref) => {
|
|
15
|
+
const panelContext = useContext(ExpansionCardContext);
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (panelContext === null) {
|
|
20
|
-
console.error(
|
|
21
|
-
"<ExpansionCard.Content> has to be used within an <ExpansionCard>"
|
|
22
|
-
);
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<BodyLong
|
|
28
|
-
{...rest}
|
|
29
|
-
ref={ref}
|
|
30
|
-
as="div"
|
|
31
|
-
className={cl("navds-expansioncard__content", className, {
|
|
32
|
-
"navds-expansioncard__content--closed": !panelContext.open,
|
|
33
|
-
})}
|
|
34
|
-
aria-hidden={!panelContext.open}
|
|
35
|
-
size={panelContext.size}
|
|
36
|
-
>
|
|
37
|
-
<div className="navds-expansioncard__content-inner">{children}</div>
|
|
38
|
-
</BodyLong>
|
|
17
|
+
if (panelContext === null) {
|
|
18
|
+
console.error(
|
|
19
|
+
"<ExpansionCard.Content> has to be used within an <ExpansionCard>"
|
|
39
20
|
);
|
|
21
|
+
return null;
|
|
40
22
|
}
|
|
41
|
-
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<BodyLong
|
|
26
|
+
{...rest}
|
|
27
|
+
ref={ref}
|
|
28
|
+
as="div"
|
|
29
|
+
className={cl("navds-expansioncard__content", className, {
|
|
30
|
+
"navds-expansioncard__content--closed": !panelContext.open,
|
|
31
|
+
})}
|
|
32
|
+
aria-hidden={!panelContext.open}
|
|
33
|
+
size={panelContext.size}
|
|
34
|
+
>
|
|
35
|
+
<div className="navds-expansioncard__content-inner">{children}</div>
|
|
36
|
+
</BodyLong>
|
|
37
|
+
);
|
|
38
|
+
});
|
|
42
39
|
|
|
43
40
|
export default ExpansionCardContent;
|
|
@@ -3,33 +3,31 @@ import cl from "clsx";
|
|
|
3
3
|
import { BodyLong } from "../typography/BodyLong";
|
|
4
4
|
import { ExpansionCardContext } from "./ExpansionCard";
|
|
5
5
|
|
|
6
|
-
interface ExpansionCardDescriptionProps
|
|
6
|
+
export interface ExpansionCardDescriptionProps
|
|
7
7
|
extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
8
8
|
children: React.ReactNode;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
export const ExpansionCardDescription = forwardRef<
|
|
12
|
+
HTMLParagraphElement,
|
|
13
|
+
ExpansionCardDescriptionProps
|
|
14
|
+
>(({ className, ...rest }, ref) => {
|
|
15
|
+
const panelContext = useContext(ExpansionCardContext);
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (panelContext === null) {
|
|
20
|
-
console.error(
|
|
21
|
-
"<ExpansionCard.Description> has to be used within an <ExpansionCard>"
|
|
22
|
-
);
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<BodyLong
|
|
28
|
-
{...rest}
|
|
29
|
-
as="p"
|
|
30
|
-
ref={ref}
|
|
31
|
-
className={cl("navds-link-panel__description", className)}
|
|
32
|
-
size={panelContext.size}
|
|
33
|
-
/>
|
|
17
|
+
if (panelContext === null) {
|
|
18
|
+
console.error(
|
|
19
|
+
"<ExpansionCard.Description> has to be used within an <ExpansionCard>"
|
|
34
20
|
);
|
|
35
|
-
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<BodyLong
|
|
26
|
+
{...rest}
|
|
27
|
+
as="p"
|
|
28
|
+
ref={ref}
|
|
29
|
+
className={cl("navds-link-panel__description", className)}
|
|
30
|
+
size={panelContext.size}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
});
|
|
@@ -8,43 +8,40 @@ export interface ExpansionCardHeaderProps
|
|
|
8
8
|
children: React.ReactNode;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const ExpansionCardHeader = forwardRef<
|
|
12
|
+
HTMLDivElement,
|
|
13
|
+
ExpansionCardHeaderProps
|
|
14
|
+
>(({ children, className, ...rest }, ref) => {
|
|
15
|
+
const panelContext = useContext(ExpansionCardContext);
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
if (panelContext === null) {
|
|
18
|
+
console.error(
|
|
19
|
+
"<ExpansionCard.Header> has to be used within an <ExpansionCard>"
|
|
20
|
+
);
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
18
23
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
return (
|
|
25
|
+
<div
|
|
26
|
+
ref={ref}
|
|
27
|
+
{...rest}
|
|
28
|
+
className={cl("navds-expansioncard__header", className)}
|
|
29
|
+
>
|
|
30
|
+
<div className="navds-expansioncard__header-content">{children}</div>
|
|
25
31
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
<button
|
|
33
|
+
className="navds-expansioncard__header-button"
|
|
34
|
+
onClick={() => panelContext.toggleOpen()}
|
|
35
|
+
type="button"
|
|
36
|
+
aria-expanded={panelContext.open}
|
|
31
37
|
>
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<ChevronDownIcon
|
|
41
|
-
className="navds-expansioncard__header-chevron"
|
|
42
|
-
title="Vis mer"
|
|
43
|
-
/>
|
|
44
|
-
</button>
|
|
45
|
-
</div>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
);
|
|
38
|
+
<ChevronDownIcon
|
|
39
|
+
className="navds-expansioncard__header-chevron"
|
|
40
|
+
title="Vis mer"
|
|
41
|
+
/>
|
|
42
|
+
</button>
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
});
|
|
49
46
|
|
|
50
47
|
export default ExpansionCardHeader;
|
|
@@ -2,7 +2,7 @@ import React, { forwardRef } from "react";
|
|
|
2
2
|
import cl from "clsx";
|
|
3
3
|
import { OverridableComponent } from "../util/OverridableComponent";
|
|
4
4
|
|
|
5
|
-
interface ExpansionCardTitleProps
|
|
5
|
+
export interface ExpansionCardTitleProps
|
|
6
6
|
extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
/**
|
|
@@ -12,12 +12,10 @@ interface ExpansionCardTitleProps
|
|
|
12
12
|
size?: "large" | "medium" | "small";
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export
|
|
15
|
+
export const ExpansionCardTitle: OverridableComponent<
|
|
16
16
|
ExpansionCardTitleProps,
|
|
17
17
|
HTMLHeadingElement
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export const ExpansionCardTitle: ExpansionCardTitleType = forwardRef(
|
|
18
|
+
> = forwardRef(
|
|
21
19
|
({ className, as: Component = "h3", size = "medium", ...rest }, ref) => (
|
|
22
20
|
<Component
|
|
23
21
|
{...rest}
|
|
@@ -26,6 +26,24 @@ export interface ConfirmationPanelProps
|
|
|
26
26
|
errorId?: string;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* A component that displays a confirmation checkbox with a label.
|
|
31
|
+
*
|
|
32
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/confirmationpanel)
|
|
33
|
+
* @see 🏷️ {@link ConfirmationPanelProps}
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```jsx
|
|
37
|
+
<ConfirmationPanel
|
|
38
|
+
checked={state}
|
|
39
|
+
label="Ja, jeg samtykker."
|
|
40
|
+
onChange={() => setState((x) => !x)}
|
|
41
|
+
>
|
|
42
|
+
For å komme videre må du gi oss lov til å hente inn og bruke opplysninger
|
|
43
|
+
om deg.
|
|
44
|
+
</ConfirmationPanel>
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
29
47
|
export const ConfirmationPanel = forwardRef<
|
|
30
48
|
HTMLInputElement,
|
|
31
49
|
ConfirmationPanelProps
|
package/src/form/Select.tsx
CHANGED
|
@@ -30,6 +30,22 @@ export interface SelectProps
|
|
|
30
30
|
style?: React.CSSProperties;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* A component that displays a select input field.
|
|
35
|
+
*
|
|
36
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/select)
|
|
37
|
+
* @see 🏷️ {@link SelectProps}
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```jsx
|
|
41
|
+
* <Select label="Hvilket land har du bosted i.">
|
|
42
|
+
* <option value="">Velg land</option>
|
|
43
|
+
* <option value="norge">Norge</option>
|
|
44
|
+
* <option value="sverige">Sverige</option>
|
|
45
|
+
* <option value="danmark">Danmark</option>
|
|
46
|
+
* </Select>
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
33
49
|
export const Select = forwardRef<HTMLSelectElement, SelectProps>(
|
|
34
50
|
(props, ref) => {
|
|
35
51
|
const {
|
package/src/form/Switch.tsx
CHANGED
|
@@ -55,6 +55,17 @@ export interface SwitchProps
|
|
|
55
55
|
description?: string;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
/**
|
|
59
|
+
* A component that displays a switch input field.
|
|
60
|
+
*
|
|
61
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/switch)
|
|
62
|
+
* @see 🏷️ {@link SwitchProps}
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```jsx
|
|
66
|
+
* <Switch>Slå på notifikasjoner</Switch>
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
58
69
|
export const Switch = forwardRef<HTMLInputElement, SwitchProps>(
|
|
59
70
|
(props, ref) => {
|
|
60
71
|
const { inputProps, size } = useFormField(props, "switch");
|
package/src/form/TextField.tsx
CHANGED
|
@@ -33,6 +33,17 @@ export interface TextFieldProps
|
|
|
33
33
|
type?: "email" | "number" | "password" | "tel" | "text" | "url";
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* A component that displays a text input field with a label.
|
|
38
|
+
*
|
|
39
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/textfield)
|
|
40
|
+
* @see 🏷️ {@link TextFieldProps}
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```jsx
|
|
44
|
+
* <TextField label="Har du noen tilbakemeldinger?" />
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
36
47
|
export const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
|
|
37
48
|
(props, ref) => {
|
|
38
49
|
const {
|
package/src/form/Textarea.tsx
CHANGED
|
@@ -55,6 +55,17 @@ export interface TextareaProps
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
/**
|
|
59
|
+
* A component that displays a textarea input field with a label.
|
|
60
|
+
*
|
|
61
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/textarea)
|
|
62
|
+
* @see 🏷️ {@link TextareaProps}
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```jsx
|
|
66
|
+
* <Textarea label="Har du noen tilbakemeldinger?" />
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
58
69
|
export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
59
70
|
(props, ref) => {
|
|
60
71
|
const {
|
|
@@ -35,6 +35,21 @@ export interface CheckboxGroupProps
|
|
|
35
35
|
onChange?: (value: any[]) => void;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* A component that allows users to select one or more options from a list.
|
|
40
|
+
*
|
|
41
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/checkbox)
|
|
42
|
+
* @see 🏷️ {@link CheckboxProps}
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```jsx
|
|
46
|
+
* <CheckboxGroup legend="Hvor vil du sitte?">
|
|
47
|
+
* <Checkbox value="Bakerst">Bakerst</Checkbox>
|
|
48
|
+
* <Checkbox value="Midterst">Midterst</Checkbox>
|
|
49
|
+
* <Checkbox value="Fremst">Fremst</Checkbox>
|
|
50
|
+
* </CheckboxGroup>
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
38
53
|
export const CheckboxGroup = forwardRef<
|
|
39
54
|
HTMLFieldSetElement,
|
|
40
55
|
CheckboxGroupProps
|
|
@@ -32,6 +32,24 @@ interface ErrorSummaryComponent
|
|
|
32
32
|
Item: ErrorSummaryItemType;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* A component that displays a summary of errors.
|
|
37
|
+
*
|
|
38
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/errorsummary)
|
|
39
|
+
* @see 🏷️ {@link ErrorSummaryProps}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```jsx
|
|
43
|
+
* <ErrorSummary heading="Du må fikse disse feilene før du kan sende inn søknad.">
|
|
44
|
+
* <ErrorSummary.Item href="#1">
|
|
45
|
+
* Felt må fylles ut med alder
|
|
46
|
+
* </ErrorSummary.Item>
|
|
47
|
+
* <ErrorSummary.Item href="#2">
|
|
48
|
+
* Tekstfeltet må ha en godkjent e-mail
|
|
49
|
+
* </ErrorSummary.Item>
|
|
50
|
+
* </ErrorSummary>
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
35
53
|
export const ErrorSummary = forwardRef<HTMLDivElement, ErrorSummaryProps>(
|
|
36
54
|
(
|
|
37
55
|
{
|
|
@@ -45,6 +45,16 @@ export interface RadioGroupProps
|
|
|
45
45
|
required?: boolean;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Form radio group
|
|
50
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/radio)
|
|
51
|
+
* @see 🏷️ {@link RadioGroupProps}
|
|
52
|
+
* @example
|
|
53
|
+
* <RadioGroup legend="Får du AAP nå?">
|
|
54
|
+
* <Radio value="ja">Ja</Radio>
|
|
55
|
+
* <Radio value="Nei">Nei</Radio>
|
|
56
|
+
* </RadioGroup>
|
|
57
|
+
*/
|
|
48
58
|
export const RadioGroup = forwardRef<HTMLFieldSetElement, RadioGroupProps>(
|
|
49
59
|
(
|
|
50
60
|
{
|
|
@@ -91,6 +91,19 @@ export const SearchContext = React.createContext<SearchContextProps | null>(
|
|
|
91
91
|
null
|
|
92
92
|
);
|
|
93
93
|
|
|
94
|
+
/**
|
|
95
|
+
* A component that displays a search input field.
|
|
96
|
+
*
|
|
97
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/search)
|
|
98
|
+
* @see 🏷️ {@link SearchProps}
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```jsx
|
|
102
|
+
* <form>
|
|
103
|
+
* <Search label="Søk alle NAV sine sider" variant="primary" />
|
|
104
|
+
* </form>
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
94
107
|
export const Search = forwardRef<HTMLInputElement, SearchProps>(
|
|
95
108
|
(props, ref) => {
|
|
96
109
|
const {
|
|
@@ -18,6 +18,21 @@ export interface GuidePanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
18
18
|
poster?: boolean;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* A component that displays a guide panel.
|
|
23
|
+
*
|
|
24
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/guidepanel)
|
|
25
|
+
* @see 🏷️ {@link GuidePanelProps}
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```jsx
|
|
29
|
+
* <GuidePanel>
|
|
30
|
+
* Saksbehandlingstiden varierer fra kommune til kommune. Hvis det går mer
|
|
31
|
+
* enn X måneder siden du søkte, skal du få brev om at saksbehandlingstiden
|
|
32
|
+
* er forlenget.
|
|
33
|
+
* </GuidePanel>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
21
36
|
export const GuidePanel = forwardRef<HTMLDivElement, GuidePanelProps>(
|
|
22
37
|
(
|
|
23
38
|
{ children, className, illustration, poster = false, color, ...rest },
|
|
@@ -31,6 +31,19 @@ export interface HelpTextProps
|
|
|
31
31
|
| "left-end";
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* A component that displays a help text button with a popover.
|
|
36
|
+
*
|
|
37
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/helptext)
|
|
38
|
+
* @see 🏷️ {@link HelpTextProps}
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```jsx
|
|
42
|
+
* <HelpText title="Hvor kommer dette fra?">
|
|
43
|
+
* Informasjonen er hentet fra X sin statistikk fra 2021
|
|
44
|
+
* </HelpText>
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
34
47
|
export const HelpText = forwardRef<HTMLButtonElement, HelpTextProps>(
|
|
35
48
|
(
|
|
36
49
|
{
|
package/src/index.ts
CHANGED
|
@@ -5,11 +5,13 @@ export * from "./chat";
|
|
|
5
5
|
export * from "./chips";
|
|
6
6
|
export * from "./copybutton";
|
|
7
7
|
export * from "./date";
|
|
8
|
+
export * from "./dropdown";
|
|
8
9
|
export * from "./expansion-card";
|
|
9
10
|
export * from "./form";
|
|
10
11
|
export * from "./grid";
|
|
11
12
|
export * from "./guide-panel";
|
|
12
13
|
export * from "./help-text";
|
|
14
|
+
export * from "./internal-header";
|
|
13
15
|
export * from "./link";
|
|
14
16
|
export * from "./link-panel";
|
|
15
17
|
export * from "./list";
|
|
@@ -20,10 +22,12 @@ export * from "./panel";
|
|
|
20
22
|
export * from "./popover";
|
|
21
23
|
export * from "./provider";
|
|
22
24
|
export * from "./read-more";
|
|
25
|
+
export * from "./skeleton";
|
|
23
26
|
export * from "./stepper";
|
|
24
27
|
export * from "./table";
|
|
25
28
|
export * from "./tabs";
|
|
26
29
|
export * from "./tag";
|
|
30
|
+
export * from "./timeline";
|
|
27
31
|
export * from "./toggle-group";
|
|
28
32
|
export * from "./tooltip";
|
|
29
33
|
export * from "./typography";
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import cl from "clsx";
|
|
2
|
+
import React, { forwardRef, HTMLAttributes } from "react";
|
|
3
|
+
import { OverridableComponent } from "../util/OverridableComponent";
|
|
4
|
+
import InternalHeaderButton, {
|
|
5
|
+
InternalHeaderButtonProps,
|
|
6
|
+
} from "./InternalHeaderButton";
|
|
7
|
+
import InternalHeaderTitle, {
|
|
8
|
+
InternalHeaderTitleProps,
|
|
9
|
+
} from "./InternalHeaderTitle";
|
|
10
|
+
import InternalHeaderUser, {
|
|
11
|
+
InternalHeaderUserProps,
|
|
12
|
+
} from "./InternalHeaderUser";
|
|
13
|
+
import InternalHeaderUserButton, {
|
|
14
|
+
InternalHeaderUserButtonProps,
|
|
15
|
+
} from "./InternalHeaderUserButton";
|
|
16
|
+
|
|
17
|
+
export interface InternalHeaderProps extends HTMLAttributes<HTMLElement> {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface InternalHeaderComponent
|
|
22
|
+
extends React.ForwardRefExoticComponent<
|
|
23
|
+
InternalHeaderProps & React.RefAttributes<HTMLElement>
|
|
24
|
+
> {
|
|
25
|
+
/**
|
|
26
|
+
* @see 🏷️ {@link InternalHeaderTitleProps}
|
|
27
|
+
* @see [🤖 OverridableComponent](https://aksel.nav.no/grunnleggende/kode/overridablecomponent) support
|
|
28
|
+
*/
|
|
29
|
+
Title: OverridableComponent<InternalHeaderTitleProps, HTMLAnchorElement>;
|
|
30
|
+
/**
|
|
31
|
+
* @see 🏷️ {@link InternalHeaderUserProps}
|
|
32
|
+
*/
|
|
33
|
+
User: React.ForwardRefExoticComponent<
|
|
34
|
+
InternalHeaderUserProps & React.RefAttributes<HTMLDivElement>
|
|
35
|
+
>;
|
|
36
|
+
/**
|
|
37
|
+
* @see 🏷️ {@link InternalHeaderButtonProps}
|
|
38
|
+
* @see [🤖 OverridableComponent](https://aksel.nav.no/grunnleggende/kode/overridablecomponent) support
|
|
39
|
+
*/
|
|
40
|
+
Button: OverridableComponent<InternalHeaderButtonProps, HTMLButtonElement>;
|
|
41
|
+
/**
|
|
42
|
+
* @see 🏷️ {@link InternalHeaderUserButtonProps}
|
|
43
|
+
* @see [🤖 OverridableComponent](https://aksel.nav.no/grunnleggende/kode/overridablecomponent) support
|
|
44
|
+
*/
|
|
45
|
+
UserButton: OverridableComponent<
|
|
46
|
+
InternalHeaderUserButtonProps,
|
|
47
|
+
HTMLButtonElement
|
|
48
|
+
>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Simple Header for internal pages and systems.
|
|
53
|
+
*
|
|
54
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/i-header)
|
|
55
|
+
* @see 🏷️ {@link InternalHeaderProps}
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```jsx
|
|
59
|
+
* <InternalHeader>
|
|
60
|
+
* <InternalHeader.Title as="h1">Sykepenger</InternalHeader.Title>
|
|
61
|
+
* <InternalHeader.User name="Ola Normann" className="ml-auto" />
|
|
62
|
+
* </InternalHeader>
|
|
63
|
+
* ```
|
|
64
|
+
* @example
|
|
65
|
+
* ```jsx
|
|
66
|
+
* <InternalHeader >
|
|
67
|
+
* <InternalHeader.Title href="/#home">Tittel med lenke</InternalHeader.Title>
|
|
68
|
+
* <Dropdown>
|
|
69
|
+
* <InternalHeader.Button
|
|
70
|
+
* as={Dropdown.Toggle}
|
|
71
|
+
* >
|
|
72
|
+
* <MenuGridIcon title="MenuGridIconer og oppslagsverk" />
|
|
73
|
+
* </InternalHeader.Button>
|
|
74
|
+
* <Dropdown.Menu />
|
|
75
|
+
* </Dropdown>
|
|
76
|
+
* </InternalHeader>
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export const InternalHeader = forwardRef(({ className, ...rest }, ref) => (
|
|
80
|
+
<header
|
|
81
|
+
data-theme="dark"
|
|
82
|
+
{...rest}
|
|
83
|
+
ref={ref}
|
|
84
|
+
className={cl("navds-internalheader", className)}
|
|
85
|
+
/>
|
|
86
|
+
)) as InternalHeaderComponent;
|
|
87
|
+
|
|
88
|
+
InternalHeader.Title = InternalHeaderTitle;
|
|
89
|
+
InternalHeader.User = InternalHeaderUser;
|
|
90
|
+
InternalHeader.Button = InternalHeaderButton;
|
|
91
|
+
InternalHeader.UserButton = InternalHeaderUserButton;
|
|
92
|
+
|
|
93
|
+
export default InternalHeader;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import cl from "clsx";
|
|
3
|
+
import { OverridableComponent } from "../util/OverridableComponent";
|
|
4
|
+
|
|
5
|
+
export interface InternalHeaderButtonProps
|
|
6
|
+
extends React.AnchorHTMLAttributes<HTMLButtonElement> {
|
|
7
|
+
/**
|
|
8
|
+
* Application Button
|
|
9
|
+
*/
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export const InternalHeaderButton: OverridableComponent<
|
|
13
|
+
InternalHeaderButtonProps,
|
|
14
|
+
HTMLButtonElement
|
|
15
|
+
> = forwardRef(({ as: Component = "button", className, ...rest }, ref) => (
|
|
16
|
+
<Component
|
|
17
|
+
{...rest}
|
|
18
|
+
ref={ref}
|
|
19
|
+
className={cl("navds-internalheader__button", className)}
|
|
20
|
+
/>
|
|
21
|
+
));
|
|
22
|
+
|
|
23
|
+
export default InternalHeaderButton;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import cl from "clsx";
|
|
3
|
+
import { OverridableComponent } from "../util/OverridableComponent";
|
|
4
|
+
|
|
5
|
+
export interface InternalHeaderTitleProps
|
|
6
|
+
extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
7
|
+
/**
|
|
8
|
+
* Application title
|
|
9
|
+
*/
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const InternalHeaderTitle: OverridableComponent<
|
|
14
|
+
InternalHeaderTitleProps,
|
|
15
|
+
HTMLAnchorElement
|
|
16
|
+
> = forwardRef(({ as: Component = "a", children, className, ...rest }, ref) => (
|
|
17
|
+
<Component
|
|
18
|
+
{...rest}
|
|
19
|
+
ref={ref}
|
|
20
|
+
size="xsmall"
|
|
21
|
+
className={cl("navds-internalheader__title", "navds-body-short", className)}
|
|
22
|
+
>
|
|
23
|
+
<span>{children}</span>
|
|
24
|
+
</Component>
|
|
25
|
+
));
|
|
26
|
+
|
|
27
|
+
export default InternalHeaderTitle;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React, { forwardRef, HTMLAttributes } from "react";
|
|
2
|
+
import cl from "clsx";
|
|
3
|
+
import { BodyShort, Detail } from "../typography";
|
|
4
|
+
|
|
5
|
+
export interface InternalHeaderUserProps
|
|
6
|
+
extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
/**
|
|
8
|
+
* User name
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* User description
|
|
13
|
+
*/
|
|
14
|
+
description?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const InternalHeaderUser = forwardRef<
|
|
18
|
+
HTMLDivElement,
|
|
19
|
+
InternalHeaderUserProps
|
|
20
|
+
>(({ className, name, description, ...rest }, ref) => (
|
|
21
|
+
<div
|
|
22
|
+
{...rest}
|
|
23
|
+
ref={ref}
|
|
24
|
+
className={cl("navds-internalheader__user", className)}
|
|
25
|
+
>
|
|
26
|
+
<span>
|
|
27
|
+
<BodyShort size="small" as="div">
|
|
28
|
+
{name}
|
|
29
|
+
</BodyShort>
|
|
30
|
+
{description && <Detail as="div">{description}</Detail>}
|
|
31
|
+
</span>
|
|
32
|
+
</div>
|
|
33
|
+
));
|
|
34
|
+
|
|
35
|
+
export default InternalHeaderUser;
|