@navikt/ds-react 4.0.0 → 4.1.1
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 +171 -5
- 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/useDatepicker.js +13 -0
- package/cjs/date/hooks/useMonthPicker.js +13 -0
- package/cjs/date/hooks/useRangeDatepicker.js +12 -0
- package/cjs/date/monthpicker/MonthPicker.js +22 -0
- package/cjs/dropdown/Dropdown.js +31 -0
- package/cjs/dropdown/Menu/GroupedList/index.js +1 -1
- package/cjs/dropdown/Menu/List/index.js +1 -1
- package/cjs/dropdown/Menu/index.js +1 -1
- 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 +2 -2
- 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 +1 -0
- package/cjs/internal-header/InternalHeader.js +30 -2
- 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 +2 -2
- 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/Timeline.js +18 -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/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/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 +39 -2
- package/esm/dropdown/Dropdown.js +31 -0
- package/esm/dropdown/Dropdown.js.map +1 -1
- package/esm/dropdown/Menu/Divider.d.ts +1 -2
- package/esm/dropdown/Menu/Divider.js.map +1 -1
- package/esm/dropdown/Menu/GroupedList/Heading.d.ts +1 -2
- package/esm/dropdown/Menu/GroupedList/Heading.js.map +1 -1
- package/esm/dropdown/Menu/GroupedList/Item.d.ts +1 -2
- package/esm/dropdown/Menu/GroupedList/Item.js.map +1 -1
- package/esm/dropdown/Menu/GroupedList/index.d.ts +12 -4
- package/esm/dropdown/Menu/GroupedList/index.js +1 -1
- package/esm/dropdown/Menu/GroupedList/index.js.map +1 -1
- package/esm/dropdown/Menu/List/Item.d.ts +1 -2
- package/esm/dropdown/Menu/List/Item.js.map +1 -1
- package/esm/dropdown/Menu/List/index.d.ts +7 -2
- package/esm/dropdown/Menu/List/index.js +1 -1
- package/esm/dropdown/Menu/List/index.js.map +1 -1
- package/esm/dropdown/Menu/index.d.ts +10 -2
- package/esm/dropdown/Menu/index.js +1 -1
- package/esm/dropdown/Menu/index.js.map +1 -1
- package/esm/dropdown/Toggle.d.ts +1 -2
- package/esm/dropdown/Toggle.js.map +1 -1
- 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 +2 -2
- package/esm/form/radio/RadioGroup.js +2 -2
- 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 +1 -0
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -1
- package/esm/internal-header/InternalHeader.d.ts +52 -8
- package/esm/internal-header/InternalHeader.js +30 -2
- package/esm/internal-header/InternalHeader.js.map +1 -1
- package/esm/internal-header/InternalHeaderButton.d.ts +1 -2
- package/esm/internal-header/InternalHeaderButton.js.map +1 -1
- package/esm/internal-header/InternalHeaderTitle.d.ts +1 -2
- package/esm/internal-header/InternalHeaderTitle.js.map +1 -1
- package/esm/internal-header/InternalHeaderUser.d.ts +0 -1
- package/esm/internal-header/InternalHeaderUser.js.map +1 -1
- package/esm/internal-header/InternalHeaderUserButton.d.ts +1 -2
- package/esm/internal-header/InternalHeaderUserButton.js.map +1 -1
- 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 +2 -2
- package/esm/read-more/ReadMore.js +2 -2
- 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/Timeline.d.ts +22 -4
- package/esm/timeline/Timeline.js +18 -0
- package/esm/timeline/Timeline.js.map +1 -1
- 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/hooks/useDatepicker.tsx +13 -0
- package/src/date/hooks/useMonthPicker.tsx +13 -0
- package/src/date/hooks/useRangeDatepicker.tsx +13 -1
- package/src/date/monthpicker/MonthPicker.tsx +36 -4
- package/src/dropdown/Dropdown.tsx +41 -2
- package/src/dropdown/Menu/Divider.tsx +10 -13
- package/src/dropdown/Menu/GroupedList/Heading.tsx +15 -18
- package/src/dropdown/Menu/GroupedList/Item.tsx +23 -27
- package/src/dropdown/Menu/GroupedList/index.tsx +15 -5
- package/src/dropdown/Menu/List/Item.tsx +3 -9
- package/src/dropdown/Menu/List/index.tsx +8 -3
- package/src/dropdown/Menu/index.tsx +14 -3
- package/src/dropdown/Toggle.tsx +1 -5
- 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 +2 -2
- 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 +1 -0
- package/src/internal-header/InternalHeader.tsx +60 -11
- package/src/internal-header/InternalHeaderButton.tsx +8 -13
- package/src/internal-header/InternalHeaderTitle.tsx +11 -19
- package/src/internal-header/InternalHeaderUser.tsx +0 -4
- package/src/internal-header/InternalHeaderUserButton.tsx +17 -20
- 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 +2 -2
- 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/Timeline.tsx +22 -4
- 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
package/_docs.json
CHANGED
|
@@ -66,6 +66,27 @@
|
|
|
66
66
|
"name": "\"large\" | \"medium\" | \"small\""
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
|
+
"indent": {
|
|
70
|
+
"defaultValue": {
|
|
71
|
+
"value": "true"
|
|
72
|
+
},
|
|
73
|
+
"description": "Whether to indent content or not",
|
|
74
|
+
"name": "indent",
|
|
75
|
+
"parent": {
|
|
76
|
+
"fileName": "src/accordion/Accordion.tsx",
|
|
77
|
+
"name": "AccordionProps"
|
|
78
|
+
},
|
|
79
|
+
"declarations": [
|
|
80
|
+
{
|
|
81
|
+
"fileName": "src/accordion/Accordion.tsx",
|
|
82
|
+
"name": "AccordionProps"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"required": false,
|
|
86
|
+
"type": {
|
|
87
|
+
"name": "boolean"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
69
90
|
"children": {
|
|
70
91
|
"defaultValue": null,
|
|
71
92
|
"description": "Instances of Accordion.Item",
|
|
@@ -1094,7 +1115,7 @@
|
|
|
1094
1115
|
"props": {
|
|
1095
1116
|
"variant": {
|
|
1096
1117
|
"defaultValue": {
|
|
1097
|
-
"value": "
|
|
1118
|
+
"value": "action"
|
|
1098
1119
|
},
|
|
1099
1120
|
"description": "Chip-variants",
|
|
1100
1121
|
"name": "variant",
|
|
@@ -1115,7 +1136,7 @@
|
|
|
1115
1136
|
},
|
|
1116
1137
|
"removeLabel": {
|
|
1117
1138
|
"defaultValue": {
|
|
1118
|
-
"value": "
|
|
1139
|
+
"value": "slett"
|
|
1119
1140
|
},
|
|
1120
1141
|
"description": "Replaces label read for screen-readers",
|
|
1121
1142
|
"name": "removeLabel",
|
|
@@ -1216,6 +1237,48 @@
|
|
|
1216
1237
|
"name": "boolean"
|
|
1217
1238
|
}
|
|
1218
1239
|
},
|
|
1240
|
+
"variant": {
|
|
1241
|
+
"defaultValue": {
|
|
1242
|
+
"value": "action"
|
|
1243
|
+
},
|
|
1244
|
+
"description": "Chip-variants",
|
|
1245
|
+
"name": "variant",
|
|
1246
|
+
"parent": {
|
|
1247
|
+
"fileName": "src/chips/Toggle.tsx",
|
|
1248
|
+
"name": "ToggleChipsProps"
|
|
1249
|
+
},
|
|
1250
|
+
"declarations": [
|
|
1251
|
+
{
|
|
1252
|
+
"fileName": "src/chips/Toggle.tsx",
|
|
1253
|
+
"name": "ToggleChipsProps"
|
|
1254
|
+
}
|
|
1255
|
+
],
|
|
1256
|
+
"required": false,
|
|
1257
|
+
"type": {
|
|
1258
|
+
"name": "\"action\" | \"neutral\""
|
|
1259
|
+
}
|
|
1260
|
+
},
|
|
1261
|
+
"checkmark": {
|
|
1262
|
+
"defaultValue": {
|
|
1263
|
+
"value": "true"
|
|
1264
|
+
},
|
|
1265
|
+
"description": "Toggles display of checkmark on selected",
|
|
1266
|
+
"name": "checkmark",
|
|
1267
|
+
"parent": {
|
|
1268
|
+
"fileName": "src/chips/Toggle.tsx",
|
|
1269
|
+
"name": "ToggleChipsProps"
|
|
1270
|
+
},
|
|
1271
|
+
"declarations": [
|
|
1272
|
+
{
|
|
1273
|
+
"fileName": "src/chips/Toggle.tsx",
|
|
1274
|
+
"name": "ToggleChipsProps"
|
|
1275
|
+
}
|
|
1276
|
+
],
|
|
1277
|
+
"required": false,
|
|
1278
|
+
"type": {
|
|
1279
|
+
"name": "boolean"
|
|
1280
|
+
}
|
|
1281
|
+
},
|
|
1219
1282
|
"className": {
|
|
1220
1283
|
"defaultValue": null,
|
|
1221
1284
|
"description": "",
|
|
@@ -6656,9 +6719,112 @@
|
|
|
6656
6719
|
}
|
|
6657
6720
|
}
|
|
6658
6721
|
},
|
|
6722
|
+
{
|
|
6723
|
+
"filePath": "src/skeleton/Skeleton.tsx",
|
|
6724
|
+
"displayName": "Skeleton",
|
|
6725
|
+
"props": {
|
|
6726
|
+
"variant": {
|
|
6727
|
+
"defaultValue": {
|
|
6728
|
+
"value": "text"
|
|
6729
|
+
},
|
|
6730
|
+
"description": "",
|
|
6731
|
+
"name": "variant",
|
|
6732
|
+
"parent": {
|
|
6733
|
+
"fileName": "src/skeleton/Skeleton.tsx",
|
|
6734
|
+
"name": "SkeletonProps"
|
|
6735
|
+
},
|
|
6736
|
+
"declarations": [
|
|
6737
|
+
{
|
|
6738
|
+
"fileName": "src/skeleton/Skeleton.tsx",
|
|
6739
|
+
"name": "SkeletonProps"
|
|
6740
|
+
}
|
|
6741
|
+
],
|
|
6742
|
+
"required": false,
|
|
6743
|
+
"type": {
|
|
6744
|
+
"name": "\"circle\" | \"rectangle\" | \"rounded\" | \"text\""
|
|
6745
|
+
}
|
|
6746
|
+
},
|
|
6747
|
+
"height": {
|
|
6748
|
+
"defaultValue": null,
|
|
6749
|
+
"description": "When not inferring height from children, you must specify height",
|
|
6750
|
+
"name": "height",
|
|
6751
|
+
"parent": {
|
|
6752
|
+
"fileName": "src/skeleton/Skeleton.tsx",
|
|
6753
|
+
"name": "SkeletonProps"
|
|
6754
|
+
},
|
|
6755
|
+
"declarations": [
|
|
6756
|
+
{
|
|
6757
|
+
"fileName": "src/skeleton/Skeleton.tsx",
|
|
6758
|
+
"name": "SkeletonProps"
|
|
6759
|
+
}
|
|
6760
|
+
],
|
|
6761
|
+
"required": false,
|
|
6762
|
+
"type": {
|
|
6763
|
+
"name": "string | number"
|
|
6764
|
+
}
|
|
6765
|
+
},
|
|
6766
|
+
"width": {
|
|
6767
|
+
"defaultValue": null,
|
|
6768
|
+
"description": "When not inferring width from children, you must specify width",
|
|
6769
|
+
"name": "width",
|
|
6770
|
+
"parent": {
|
|
6771
|
+
"fileName": "src/skeleton/Skeleton.tsx",
|
|
6772
|
+
"name": "SkeletonProps"
|
|
6773
|
+
},
|
|
6774
|
+
"declarations": [
|
|
6775
|
+
{
|
|
6776
|
+
"fileName": "src/skeleton/Skeleton.tsx",
|
|
6777
|
+
"name": "SkeletonProps"
|
|
6778
|
+
}
|
|
6779
|
+
],
|
|
6780
|
+
"required": false,
|
|
6781
|
+
"type": {
|
|
6782
|
+
"name": "string | number"
|
|
6783
|
+
}
|
|
6784
|
+
},
|
|
6785
|
+
"className": {
|
|
6786
|
+
"defaultValue": null,
|
|
6787
|
+
"description": "",
|
|
6788
|
+
"name": "className",
|
|
6789
|
+
"parent": {
|
|
6790
|
+
"fileName": "aksel/node_modules/@types/react/ts5.0/index.d.ts",
|
|
6791
|
+
"name": "HTMLAttributes"
|
|
6792
|
+
},
|
|
6793
|
+
"declarations": [
|
|
6794
|
+
{
|
|
6795
|
+
"fileName": "aksel/node_modules/@types/react/ts5.0/index.d.ts",
|
|
6796
|
+
"name": "HTMLAttributes"
|
|
6797
|
+
}
|
|
6798
|
+
],
|
|
6799
|
+
"required": false,
|
|
6800
|
+
"type": {
|
|
6801
|
+
"name": "string"
|
|
6802
|
+
}
|
|
6803
|
+
},
|
|
6804
|
+
"ref": {
|
|
6805
|
+
"defaultValue": null,
|
|
6806
|
+
"description": "Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref).\n@see https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom",
|
|
6807
|
+
"name": "ref",
|
|
6808
|
+
"parent": {
|
|
6809
|
+
"fileName": "aksel/node_modules/@types/react/ts5.0/index.d.ts",
|
|
6810
|
+
"name": "RefAttributes"
|
|
6811
|
+
},
|
|
6812
|
+
"declarations": [
|
|
6813
|
+
{
|
|
6814
|
+
"fileName": "aksel/node_modules/@types/react/ts5.0/index.d.ts",
|
|
6815
|
+
"name": "RefAttributes"
|
|
6816
|
+
}
|
|
6817
|
+
],
|
|
6818
|
+
"required": false,
|
|
6819
|
+
"type": {
|
|
6820
|
+
"name": "Ref<HTMLDivElement>"
|
|
6821
|
+
}
|
|
6822
|
+
}
|
|
6823
|
+
}
|
|
6824
|
+
},
|
|
6659
6825
|
{
|
|
6660
6826
|
"filePath": "src/stepper/Step.tsx",
|
|
6661
|
-
"displayName": "
|
|
6827
|
+
"displayName": "Step",
|
|
6662
6828
|
"props": {
|
|
6663
6829
|
"children": {
|
|
6664
6830
|
"defaultValue": null,
|
|
@@ -14934,7 +15100,7 @@
|
|
|
14934
15100
|
],
|
|
14935
15101
|
"required": false,
|
|
14936
15102
|
"type": {
|
|
14937
|
-
"name": "Ref<
|
|
15103
|
+
"name": "Ref<HTMLDetailsElement>"
|
|
14938
15104
|
}
|
|
14939
15105
|
}
|
|
14940
15106
|
}
|
|
@@ -14997,7 +15163,7 @@
|
|
|
14997
15163
|
],
|
|
14998
15164
|
"required": false,
|
|
14999
15165
|
"type": {
|
|
15000
|
-
"name": "Ref<
|
|
15166
|
+
"name": "Ref<HTMLDetailsElement>"
|
|
15001
15167
|
}
|
|
15002
15168
|
}
|
|
15003
15169
|
}
|
|
@@ -44,14 +44,34 @@ const AccordionItem_1 = __importDefault(require("./AccordionItem"));
|
|
|
44
44
|
const AccordionContent_1 = __importDefault(require("./AccordionContent"));
|
|
45
45
|
const AccordionHeader_1 = __importDefault(require("./AccordionHeader"));
|
|
46
46
|
const AccordionContext_1 = require("./AccordionContext");
|
|
47
|
+
/**
|
|
48
|
+
* A component that displays collapsible content sections.
|
|
49
|
+
*
|
|
50
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/accordion)
|
|
51
|
+
* @see 🏷️ {@link AccordionProps}
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```jsx
|
|
55
|
+
* <Accordion>
|
|
56
|
+
* <Accordion.Item>
|
|
57
|
+
* <Accordion.Header>Section 1</Accordion.Header>
|
|
58
|
+
* <Accordion.Content>Content 1</Accordion.Content>
|
|
59
|
+
* </Accordion.Item>
|
|
60
|
+
* <Accordion.Item>
|
|
61
|
+
* <Accordion.Header>Section 2</Accordion.Header>
|
|
62
|
+
* <Accordion.Content>Content 2</Accordion.Content>
|
|
63
|
+
* </Accordion.Item>
|
|
64
|
+
* </Accordion>
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
47
67
|
exports.Accordion = (0, react_1.forwardRef)((_a, ref) => {
|
|
48
|
-
var { className, variant = "default", headingSize = "small", size = "medium" } = _a, rest = __rest(_a, ["className", "variant", "headingSize", "size"]);
|
|
68
|
+
var { className, variant = "default", headingSize = "small", size = "medium", indent = true } = _a, rest = __rest(_a, ["className", "variant", "headingSize", "size", "indent"]);
|
|
49
69
|
return (react_1.default.createElement(AccordionContext_1.AccordionContext.Provider, { value: {
|
|
50
70
|
variant,
|
|
51
71
|
headingSize,
|
|
52
72
|
size,
|
|
53
73
|
} },
|
|
54
|
-
react_1.default.createElement("div", Object.assign({}, rest, { className: (0, clsx_1.default)("navds-accordion", className, `navds-accordion--${size}
|
|
74
|
+
react_1.default.createElement("div", Object.assign({}, rest, { className: (0, clsx_1.default)("navds-accordion", className, `navds-accordion--${size}`, { "navds-accordion--indent": indent }), ref: ref }))));
|
|
55
75
|
});
|
|
56
76
|
exports.Accordion.Header = AccordionHeader_1.default;
|
|
57
77
|
exports.Accordion.Content = AccordionContent_1.default;
|
package/cjs/alert/Alert.js
CHANGED
|
@@ -57,6 +57,15 @@ const Icon = (_a) => {
|
|
|
57
57
|
return null;
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* A component for displaying alerts
|
|
62
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/alert)
|
|
63
|
+
* @see 🏷️ {@link AlertProps}
|
|
64
|
+
* @example
|
|
65
|
+
* ```jsx
|
|
66
|
+
* <Alert variant="error">Dette er en feilmelding</Alert>
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
60
69
|
exports.Alert = (0, react_1.forwardRef)((_a, ref) => {
|
|
61
70
|
var { children, className, variant, size = "medium", fullWidth = false, inline = false } = _a, rest = __rest(_a, ["children", "className", "variant", "size", "fullWidth", "inline"]);
|
|
62
71
|
return (react_1.default.createElement("div", Object.assign({}, rest, { ref: ref, className: (0, clsx_1.default)(className, "navds-alert", `navds-alert--${variant}`, `navds-alert--${size}`, { "navds-alert--full-width": fullWidth, "navds-alert--inline": inline }) }),
|
package/cjs/button/Button.js
CHANGED
|
@@ -42,6 +42,16 @@ const react_1 = __importStar(require("react"));
|
|
|
42
42
|
const clsx_1 = __importDefault(require("clsx"));
|
|
43
43
|
const __1 = require("../");
|
|
44
44
|
const util_1 = require("../util");
|
|
45
|
+
/**
|
|
46
|
+
* A button component
|
|
47
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/button)
|
|
48
|
+
* @see 🏷️ {@link ButtonProps}
|
|
49
|
+
* @see [🤖 OverridableComponent](https://aksel.nav.no/grunnleggende/kode/overridablecomponent) support
|
|
50
|
+
* @example
|
|
51
|
+
* ```jsx
|
|
52
|
+
* <Button>Klikk meg</Button>
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
45
55
|
exports.Button = (0, react_1.forwardRef)((_a, ref) => {
|
|
46
56
|
var { as: Component = "button", variant = "primary", className, children, size = "medium", loading = false, disabled, style, icon, iconPosition = "left" } = _a, rest = __rest(_a, ["as", "variant", "className", "children", "size", "loading", "disabled", "style", "icon", "iconPosition"]);
|
|
47
57
|
const buttonRef = (0, react_1.useRef)(null);
|
package/cjs/chat/Chat.js
CHANGED
|
@@ -42,6 +42,22 @@ const react_1 = __importStar(require("react"));
|
|
|
42
42
|
const clsx_1 = __importDefault(require("clsx"));
|
|
43
43
|
const Bubble_1 = __importDefault(require("./Bubble"));
|
|
44
44
|
const typography_1 = require("../typography");
|
|
45
|
+
/**
|
|
46
|
+
* A component for displaying chat messages.
|
|
47
|
+
*
|
|
48
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/chat)
|
|
49
|
+
* @see 🏷️ {@link ChatProps}
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```jsx
|
|
53
|
+
* <Chat>
|
|
54
|
+
* <Chat.Bubble avatar="A" name="Alice">Hello!</Chat.Bubble>
|
|
55
|
+
* </Chat>
|
|
56
|
+
* <Chat>
|
|
57
|
+
* <Chat.Bubble avatar="B" name="Bob">Hi there!</Chat.Bubble>
|
|
58
|
+
* </Chat>
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
45
61
|
exports.Chat = (0, react_1.forwardRef)((_a, ref) => {
|
|
46
62
|
var { children, className, name, timestamp, avatar, position = "left", avatarBgColor, backgroundColor, toptextPosition } = _a, rest = __rest(_a, ["children", "className", "name", "timestamp", "avatar", "position", "avatarBgColor", "backgroundColor", "toptextPosition"]);
|
|
47
63
|
return (react_1.default.createElement("div", Object.assign({ ref: ref, className: (0, clsx_1.default)("navds-chat", className, `navds-chat--${position} navds-chat--top-text-${toptextPosition !== null && toptextPosition !== void 0 ? toptextPosition : position}`) }, rest),
|
package/cjs/chips/Chips.js
CHANGED
|
@@ -42,6 +42,33 @@ const clsx_1 = __importDefault(require("clsx"));
|
|
|
42
42
|
const react_1 = __importStar(require("react"));
|
|
43
43
|
const Toggle_1 = __importDefault(require("./Toggle"));
|
|
44
44
|
const Removable_1 = __importDefault(require("./Removable"));
|
|
45
|
+
/**
|
|
46
|
+
* A component that displays a list of items as chips.
|
|
47
|
+
*
|
|
48
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/chips)
|
|
49
|
+
* @see 🏷️ {@link ChipsProps}
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```jsx
|
|
53
|
+
<Chips size="small">
|
|
54
|
+
{options.map((c) => (
|
|
55
|
+
<Chips.Toggle
|
|
56
|
+
selected={selected.includes(c)}
|
|
57
|
+
key={c}
|
|
58
|
+
onClick={() =>
|
|
59
|
+
setSelected(
|
|
60
|
+
selected.includes(c)
|
|
61
|
+
? selected.filter((x) => x !== c)
|
|
62
|
+
: [...selected, c]
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
>
|
|
66
|
+
{c}
|
|
67
|
+
</Chips.Toggle>
|
|
68
|
+
))}
|
|
69
|
+
</Chips>
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
45
72
|
exports.Chips = (0, react_1.forwardRef)((_a, ref) => {
|
|
46
73
|
var { className, size = "medium", children } = _a, rest = __rest(_a, ["className", "size", "children"]);
|
|
47
74
|
return (react_1.default.createElement("ul", Object.assign({}, rest, { ref: ref, className: (0, clsx_1.default)("navds-chips", className, `navds-chips--${size}`, {
|
package/cjs/chips/Toggle.js
CHANGED
|
@@ -38,15 +38,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.ToggleChips = void 0;
|
|
41
|
-
const aksel_icons_1 = require("@navikt/aksel-icons");
|
|
42
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
43
42
|
const react_1 = __importStar(require("react"));
|
|
44
43
|
exports.ToggleChips = (0, react_1.forwardRef)((_a, ref) => {
|
|
45
|
-
var { className, children, selected, as: Component = "button" } = _a, rest = __rest(_a, ["className", "children", "selected", "as"]);
|
|
46
|
-
return (react_1.default.createElement(Component, Object.assign({}, rest, { ref: ref, className: (0, clsx_1.default)("navds-chips__chip navds-chips__toggle", className, {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
selected && (react_1.default.createElement(aksel_icons_1.CheckmarkIcon, { "aria-hidden": true, className: "navds-chips__toggle-icon" })),
|
|
44
|
+
var { className, children, selected, variant = "action", checkmark = true, as: Component = "button" } = _a, rest = __rest(_a, ["className", "children", "selected", "variant", "checkmark", "as"]);
|
|
45
|
+
return (react_1.default.createElement(Component, Object.assign({}, rest, { ref: ref, className: (0, clsx_1.default)("navds-chips__chip navds-chips__toggle", className, `navds-chips__toggle--${variant}`), "aria-pressed": selected }),
|
|
46
|
+
selected && checkmark && (react_1.default.createElement("svg", { "aria-hidden": true, className: "navds-chips__toggle-icon", width: "10", height: "8", viewBox: "0 0 10 8", fill: "none", xmlns: "http://www.w3.org/2000/svg", focusable: false, role: "img" },
|
|
47
|
+
react_1.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9.51894 0.45851C9.81799 0.745107 9.8281 1.21987 9.5415 1.51893L3.7915 7.51893C3.51247 7.81009 3.05315 7.82848 2.75174 7.56056L0.501735 5.56056C0.192148 5.28537 0.164263 4.81132 0.439451 4.50173C0.71464 4.19214 1.18869 4.16426 1.49828 4.43944L3.20835 5.95951L8.45852 0.481072C8.74511 0.182015 9.21988 0.171913 9.51894 0.45851Z", fill: "currentColor" }))),
|
|
50
48
|
react_1.default.createElement("span", { className: "navds-chips__chip-text" }, children)));
|
|
51
49
|
});
|
|
52
50
|
exports.default = exports.ToggleChips;
|
|
@@ -43,6 +43,17 @@ const clsx_1 = __importDefault(require("clsx"));
|
|
|
43
43
|
const react_1 = __importStar(require("react"));
|
|
44
44
|
const copy_1 = __importDefault(require("../util/copy"));
|
|
45
45
|
const Label_1 = __importDefault(require("../typography/Label"));
|
|
46
|
+
/**
|
|
47
|
+
* A button component that copies text to the clipboard when clicked.
|
|
48
|
+
*
|
|
49
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/copybutton)
|
|
50
|
+
* @see 🏷️ {@link CopyButtonProps}
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```jsx
|
|
54
|
+
<CopyButton copyText="3.14" />
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
46
57
|
exports.CopyButton = (0, react_1.forwardRef)((_a, ref) => {
|
|
47
58
|
var { className, copyText, text, activeText = "Kopiert!", variant = "neutral", size = "medium", onActiveChange, icon, activeIcon, activeDuration = 2000, title = "Kopier", activeTitle = "Kopiert" } = _a, rest = __rest(_a, ["className", "copyText", "text", "activeText", "variant", "size", "onActiveChange", "icon", "activeIcon", "activeDuration", "title", "activeTitle"]);
|
|
48
59
|
const [active, setActive] = (0, react_1.useState)(false);
|
package/cjs/date/DateInput.js
CHANGED
|
@@ -74,7 +74,7 @@ const DateInput = (0, react_1.forwardRef)((props, ref) => {
|
|
|
74
74
|
react_1.default.createElement(aksel_icons_1.CalendarIcon, { pointerEvents: "none", title: open
|
|
75
75
|
? conditionalVariables.iconTitle.close
|
|
76
76
|
: conditionalVariables.iconTitle.open }))),
|
|
77
|
-
react_1.default.createElement("div", { className: "navds-form-field__error", id: errorId, "aria-relevant": "additions removals", "aria-live": "polite" }, showErrorMsg &&
|
|
77
|
+
react_1.default.createElement("div", { className: "navds-form-field__error", id: errorId, "aria-relevant": "additions removals", "aria-live": "polite" }, showErrorMsg && react_1.default.createElement(__1.ErrorMessage, { size: size }, props.error))));
|
|
78
78
|
});
|
|
79
79
|
exports.DatePickerInput = (0, react_1.forwardRef)((props, ref) => react_1.default.createElement(DateInput, Object.assign({}, props, { ref: ref })));
|
|
80
80
|
exports.MonthPickerInput = (0, react_1.forwardRef)((props, ref) => react_1.default.createElement(DateInput, Object.assign({}, props, { variant: "monthpicker", ref: ref })));
|
|
@@ -50,6 +50,28 @@ const caption_1 = require("./caption");
|
|
|
50
50
|
const DatePickerStandalone_1 = __importDefault(require("./DatePickerStandalone"));
|
|
51
51
|
const DayButton_1 = require("./DayButton");
|
|
52
52
|
const TableHead_1 = require("./TableHead");
|
|
53
|
+
/**
|
|
54
|
+
* A component that allows users to select a date from a calendar.
|
|
55
|
+
*
|
|
56
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/datepicker)
|
|
57
|
+
* @see 🏷️ {@link DatePickerProps}
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```jsx
|
|
61
|
+
* const { inputProps, datepickerProps } = useMonthpicker({
|
|
62
|
+
* onMonthChange: console.log,
|
|
63
|
+
* });
|
|
64
|
+
*
|
|
65
|
+
* return (
|
|
66
|
+
* <DatePicker {...datepickerProps} dropdownCaption>
|
|
67
|
+
* <DatePicker.Input
|
|
68
|
+
* {...inputProps}
|
|
69
|
+
* label="Velg dato"
|
|
70
|
+
* />
|
|
71
|
+
* </DatePicker>
|
|
72
|
+
* );
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
53
75
|
exports.DatePicker = (0, react_1.forwardRef)((_a, ref) => {
|
|
54
76
|
var _b;
|
|
55
77
|
var { children, locale = "nb", dropdownCaption, disabled = [], disableWeekends = false, showWeekNumber = false, selected, id, defaultSelected, className, wrapperClassName, open: _open, onClose, onOpenToggle, strategy = "absolute" } = _a, rest = __rest(_a, ["children", "locale", "dropdownCaption", "disabled", "disableWeekends", "showWeekNumber", "selected", "id", "defaultSelected", "className", "wrapperClassName", "open", "onClose", "onOpenToggle", "strategy"]);
|
|
@@ -12,6 +12,19 @@ const utils_1 = require("../utils");
|
|
|
12
12
|
const useEscape_1 = require("./useEscape");
|
|
13
13
|
const useOutsideClickHandler_1 = require("./useOutsideClickHandler");
|
|
14
14
|
const getValidationMessage = (val = {}) => (Object.assign({ isDisabled: false, isWeekend: false, isEmpty: false, isInvalid: false, isBefore: false, isAfter: false, isValidDate: true }, val));
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @see 🏷️ {@link UseDatepickerOptions}
|
|
18
|
+
* @see 🏷️ {@link UseDatepickerValue}
|
|
19
|
+
* @see 🏷️ {@link DateValidationT}
|
|
20
|
+
* @example
|
|
21
|
+
* const { datepickerProps, inputProps } = useDatepicker({
|
|
22
|
+
* fromDate: new Date("Aug 23 2019"),
|
|
23
|
+
* toDate: new Date("Feb 23 2024"),
|
|
24
|
+
* onDateChange: console.log,
|
|
25
|
+
* onValidate: console.log,
|
|
26
|
+
* });
|
|
27
|
+
*/
|
|
15
28
|
const useDatepicker = (opt = {}) => {
|
|
16
29
|
var _a, _b;
|
|
17
30
|
const { locale: _locale = "nb", required, defaultSelected: _defaultSelected, today = new Date(), fromDate, toDate, disabled, disableWeekends, onDateChange, inputFormat, onValidate, defaultMonth, allowTwoDigitYear = true, openOnFocus = true, } = opt;
|
|
@@ -16,6 +16,19 @@ const getIsAfter = (opt) => opt.toDate &&
|
|
|
16
16
|
(opt.toDate.getFullYear() < opt.date.getFullYear() ||
|
|
17
17
|
(opt.toDate.getFullYear() === opt.date.getFullYear() &&
|
|
18
18
|
opt.toDate.getMonth() < opt.date.getMonth()));
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @see 🏷️ {@link UseMonthPickerOptions}
|
|
22
|
+
* @see 🏷️ {@link UseMonthPickerValue}
|
|
23
|
+
* @see 🏷️ {@link MonthValidationT}
|
|
24
|
+
* @example
|
|
25
|
+
* const { monthpickerProps, inputProps } = useMonthpicker({
|
|
26
|
+
* fromDate: new Date("Aug 23 2019"),
|
|
27
|
+
* toDate: new Date("Feb 23 2024"),
|
|
28
|
+
* onMonthChange: console.log,
|
|
29
|
+
* onValidate: console.log,
|
|
30
|
+
* });
|
|
31
|
+
*/
|
|
19
32
|
const useMonthpicker = (opt = {}) => {
|
|
20
33
|
var _a, _b;
|
|
21
34
|
const { locale: _locale = "nb", defaultSelected: _defaultSelected, fromDate, toDate, disabled, required, onMonthChange, inputFormat, onValidate, defaultYear, allowTwoDigitYear = true, openOnFocus = true, } = opt;
|
|
@@ -80,6 +80,18 @@ const initialValidation = (range, opt) => {
|
|
|
80
80
|
: { isEmpty: true, isValidDate: false };
|
|
81
81
|
return getValidationMessage(Object.assign({}, fromVal), Object.assign({}, toVal));
|
|
82
82
|
};
|
|
83
|
+
/**
|
|
84
|
+
*
|
|
85
|
+
* @see 🏷️ {@link UseRangeDatepickerOptions}
|
|
86
|
+
* @see 🏷️ {@link UseRangeDatepickerValue}
|
|
87
|
+
* @see 🏷️ {@link RangeValidationT}
|
|
88
|
+
* @example
|
|
89
|
+
* const { datepickerProps, fromInputProps, toInputProps } = useRangeDatepicker({
|
|
90
|
+
* fromDate: new Date("Aug 23 2019"),
|
|
91
|
+
* onRangeChange: console.log,
|
|
92
|
+
* onValidate: console.log,
|
|
93
|
+
* });
|
|
94
|
+
*/
|
|
83
95
|
const useRangeDatepicker = (opt = {}) => {
|
|
84
96
|
var _a, _b;
|
|
85
97
|
const { locale: _locale = "nb", defaultSelected: _defaultSelected, today = new Date(), fromDate, toDate, disabled, disableWeekends, onRangeChange, inputFormat, onValidate, defaultMonth, allowTwoDigitYear = true, openOnFocus = true, } = opt;
|
|
@@ -37,6 +37,28 @@ const utils_1 = require("../utils");
|
|
|
37
37
|
const MonthCaption_1 = __importDefault(require("./MonthCaption"));
|
|
38
38
|
const MonthPickerStandalone_1 = __importDefault(require("./MonthPickerStandalone"));
|
|
39
39
|
const MonthSelector_1 = __importDefault(require("./MonthSelector"));
|
|
40
|
+
/**
|
|
41
|
+
* A component that displays a month picker.
|
|
42
|
+
*
|
|
43
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/monthpicker)
|
|
44
|
+
* @see 🏷️ {@link MonthPickerProps}
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```jsx
|
|
48
|
+
* const { inputProps, monthpickerProps } = useMonthpicker({
|
|
49
|
+
* onMonthChange: console.log,
|
|
50
|
+
* });
|
|
51
|
+
*
|
|
52
|
+
* return (
|
|
53
|
+
* <MonthPicker {...monthpickerProps} dropdownCaption>
|
|
54
|
+
* <MonthPicker.Input
|
|
55
|
+
* {...inputProps}
|
|
56
|
+
* label="Velg måned"
|
|
57
|
+
* />
|
|
58
|
+
* </MonthPicker>
|
|
59
|
+
* );
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
40
62
|
exports.MonthPicker = (0, react_1.forwardRef)(({ children, dropdownCaption = false, fromDate, toDate, disabled = [], selected, open: _open, id, onClose, onOpenToggle, locale = "nb", onMonthSelect, className, wrapperClassName, defaultSelected, year, onYearChange, strategy = "absolute", }, ref) => {
|
|
41
63
|
const ariaId = (0, __1.useId)(id);
|
|
42
64
|
const [open, setOpen] = (0, react_1.useState)(_open !== null && _open !== void 0 ? _open : false);
|
package/cjs/dropdown/Dropdown.js
CHANGED
|
@@ -31,6 +31,37 @@ const react_1 = __importStar(require("react"));
|
|
|
31
31
|
const Toggle_1 = __importDefault(require("./Toggle"));
|
|
32
32
|
const Menu_1 = __importDefault(require("./Menu"));
|
|
33
33
|
exports.DropdownContext = (0, react_1.createContext)(null);
|
|
34
|
+
/**
|
|
35
|
+
* A component that displays a dropdown menu when the user clicks on its toggle button.
|
|
36
|
+
*
|
|
37
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/dropdown)
|
|
38
|
+
* @see 🏷️ {@link DropdownProps}
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```jsx
|
|
42
|
+
* <Dropdown>
|
|
43
|
+
* <Button as={Dropdown.Toggle}>Toggle</Button>
|
|
44
|
+
* <Dropdown.Menu>
|
|
45
|
+
* <Dropdown.Menu.GroupedList>
|
|
46
|
+
* <Dropdown.Menu.GroupedList.Heading>
|
|
47
|
+
* Systemer og oppslagsverk
|
|
48
|
+
* </Dropdown.Menu.GroupedList.Heading>
|
|
49
|
+
* <Dropdown.Menu.GroupedList.Item>
|
|
50
|
+
* Gosys
|
|
51
|
+
* </Dropdown.Menu.GroupedList.Item>
|
|
52
|
+
* <Dropdown.Menu.GroupedList.Item>
|
|
53
|
+
* Infotrygd
|
|
54
|
+
* </Dropdown.Menu.GroupedList.Item>
|
|
55
|
+
* </Dropdown.Menu.GroupedList>
|
|
56
|
+
* <Dropdown.Menu.Divider />
|
|
57
|
+
* <Dropdown.Menu.List>
|
|
58
|
+
* <Dropdown.Menu.List.Item>Gosys</Dropdown.Menu.List.Item>
|
|
59
|
+
* <Dropdown.Menu.List.Item>Infotrygd</Dropdown.Menu.List.Item>
|
|
60
|
+
* </Dropdown.Menu.List>
|
|
61
|
+
* </Dropdown.Menu>
|
|
62
|
+
* </Dropdown>
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
34
65
|
exports.Dropdown = (({ children, onSelect, closeOnSelect = true, defaultOpen = false, open, }) => {
|
|
35
66
|
const [isOpen, setIsOpen] = (0, react_1.useState)(defaultOpen);
|
|
36
67
|
const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
|
|
@@ -38,8 +38,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.DescriptionList = void 0;
|
|
41
|
-
const react_1 = __importStar(require("react"));
|
|
42
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
42
|
+
const react_1 = __importStar(require("react"));
|
|
43
43
|
const Heading_1 = __importDefault(require("./Heading"));
|
|
44
44
|
const Item_1 = __importDefault(require("./Item"));
|
|
45
45
|
exports.DescriptionList = (0, react_1.forwardRef)((_a, ref) => {
|
|
@@ -38,8 +38,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.List = void 0;
|
|
41
|
-
const react_1 = __importStar(require("react"));
|
|
42
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
42
|
+
const react_1 = __importStar(require("react"));
|
|
43
43
|
const Item_1 = __importDefault(require("./Item"));
|
|
44
44
|
exports.List = (0, react_1.forwardRef)((_a, ref) => {
|
|
45
45
|
var { className, children } = _a, rest = __rest(_a, ["className", "children"]);
|
|
@@ -38,9 +38,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.Menu = void 0;
|
|
41
|
-
const popover_1 = require("../../popover");
|
|
42
41
|
const clsx_1 = __importDefault(require("clsx"));
|
|
43
42
|
const react_1 = __importStar(require("react"));
|
|
43
|
+
const popover_1 = require("../../popover");
|
|
44
44
|
const Dropdown_1 = require("../Dropdown");
|
|
45
45
|
const Divider_1 = __importDefault(require("./Divider"));
|
|
46
46
|
const GroupedList_1 = __importDefault(require("./GroupedList"));
|
|
@@ -49,6 +49,24 @@ exports.ExpansionCardContext = (0, react_1.createContext)({
|
|
|
49
49
|
toggleOpen: () => { },
|
|
50
50
|
size: "medium",
|
|
51
51
|
});
|
|
52
|
+
/**
|
|
53
|
+
* A component that displays an expandable card.
|
|
54
|
+
*
|
|
55
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/expansioncard)
|
|
56
|
+
* @see 🏷️ {@link ExpansionCardProps}
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```jsx
|
|
60
|
+
* <ExpansionCard aria-label="default-demo">
|
|
61
|
+
* <ExpansionCard.Header>
|
|
62
|
+
* <ExpansionCard.Title>Utbetaling av sykepenger</ExpansionCard.Title>
|
|
63
|
+
* </ExpansionCard.Header>
|
|
64
|
+
* <ExpansionCard.Content>
|
|
65
|
+
* <Innhold />
|
|
66
|
+
* </ExpansionCard.Content>
|
|
67
|
+
* </ExpansionCard>
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
52
70
|
exports.ExpansionCard = (0, react_1.forwardRef)((_a, ref) => {
|
|
53
71
|
var { className, onToggle, open, defaultOpen = false, size = "medium" } = _a, rest = __rest(_a, ["className", "onToggle", "open", "defaultOpen", "size"]);
|
|
54
72
|
const [_open, _setOpen] = (0, react_1.useState)(defaultOpen);
|
|
@@ -42,6 +42,24 @@ const react_1 = __importStar(require("react"));
|
|
|
42
42
|
const clsx_1 = __importDefault(require("clsx"));
|
|
43
43
|
const __1 = require("..");
|
|
44
44
|
const useFormField_1 = require("./useFormField");
|
|
45
|
+
/**
|
|
46
|
+
* A component that displays a confirmation checkbox with a label.
|
|
47
|
+
*
|
|
48
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/confirmationpanel)
|
|
49
|
+
* @see 🏷️ {@link ConfirmationPanelProps}
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```jsx
|
|
53
|
+
<ConfirmationPanel
|
|
54
|
+
checked={state}
|
|
55
|
+
label="Ja, jeg samtykker."
|
|
56
|
+
onChange={() => setState((x) => !x)}
|
|
57
|
+
>
|
|
58
|
+
For å komme videre må du gi oss lov til å hente inn og bruke opplysninger
|
|
59
|
+
om deg.
|
|
60
|
+
</ConfirmationPanel>
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
45
63
|
exports.ConfirmationPanel = (0, react_1.forwardRef)((_a, ref) => {
|
|
46
64
|
var { className, children, label } = _a, props = __rest(_a, ["className", "children", "label"]);
|
|
47
65
|
const { errorId, showErrorMsg, hasError, size, inputProps } = (0, useFormField_1.useFormField)(props, "confirmation-panel");
|