@navikt/ds-react 6.1.1 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/accordion/Accordion.d.ts +4 -4
- package/cjs/alert/Alert.d.ts +12 -10
- package/cjs/alert/Alert.js.map +1 -1
- package/cjs/button/Button.d.ts +9 -8
- package/cjs/button/Button.js.map +1 -1
- package/cjs/chat/Chat.d.ts +6 -6
- package/cjs/chips/Chips.d.ts +2 -2
- package/cjs/copybutton/CopyButton.d.ts +14 -12
- package/cjs/copybutton/CopyButton.js.map +1 -1
- package/cjs/date/datepicker/types.d.ts +7 -6
- package/cjs/date/hooks/useDatepicker.d.ts +4 -3
- package/cjs/date/hooks/useDatepicker.js.map +1 -1
- package/cjs/date/hooks/useMonthPicker.d.ts +4 -3
- package/cjs/date/hooks/useMonthPicker.js.map +1 -1
- package/cjs/date/monthpicker/types.d.ts +2 -1
- package/cjs/date/parts/DateInput.d.ts +1 -1
- package/cjs/expansion-card/ExpansionCardTitle.d.ts +1 -1
- package/cjs/form/checkbox/CheckboxGroup.d.ts +3 -3
- package/cjs/form/checkbox/types.d.ts +4 -4
- package/cjs/form/combobox/types.d.ts +15 -15
- package/cjs/form/error-summary/ErrorSummary.d.ts +5 -5
- package/cjs/form/radio/RadioGroup.d.ts +1 -1
- package/cjs/form/search/Search.d.ts +3 -2
- package/cjs/form/search/Search.js.map +1 -1
- package/cjs/form/select/Select.d.ts +9 -9
- package/cjs/form/switch/Switch.d.ts +5 -5
- package/cjs/form/textarea/Textarea.d.ts +5 -4
- package/cjs/form/textarea/Textarea.js.map +1 -1
- package/cjs/form/useFormField.d.ts +10 -8
- package/cjs/form/useFormField.js.map +1 -1
- package/cjs/layout/bleed/Bleed.d.ts +9 -1
- package/cjs/layout/bleed/Bleed.js.map +1 -1
- package/cjs/layout/box/Box.d.ts +5 -5
- package/cjs/layout/grid/HGrid.d.ts +1 -3
- package/cjs/layout/grid/HGrid.js.map +1 -1
- package/cjs/layout/page/Page.d.ts +2 -2
- package/cjs/layout/responsive/Responsive.d.ts +2 -4
- package/cjs/layout/responsive/Responsive.js.map +1 -1
- package/cjs/layout/stack/Stack.d.ts +18 -4
- package/cjs/layout/stack/Stack.js.map +1 -1
- package/cjs/list/types.d.ts +1 -1
- package/cjs/loader/Loader.d.ts +1 -0
- package/cjs/loader/Loader.js.map +1 -1
- package/cjs/modal/Modal.js +2 -2
- package/cjs/modal/types.d.ts +8 -8
- package/cjs/pagination/Pagination.d.ts +3 -2
- package/cjs/pagination/Pagination.js.map +1 -1
- package/cjs/pagination/PaginationItem.d.ts +1 -1
- package/cjs/popover/Popover.d.ts +2 -1
- package/cjs/popover/Popover.js.map +1 -1
- package/cjs/read-more/ReadMore.d.ts +7 -7
- package/cjs/stepper/Step.d.ts +4 -4
- package/cjs/stepper/Stepper.d.ts +7 -5
- package/cjs/stepper/Stepper.js.map +1 -1
- package/cjs/table/AnimateHeight.d.ts +1 -1
- package/cjs/tabs/TabList.d.ts +1 -1
- package/cjs/tabs/Tabs.d.ts +7 -7
- package/cjs/timeline/Timeline.d.ts +6 -3
- package/cjs/timeline/Timeline.js +2 -1
- package/cjs/timeline/Timeline.js.map +1 -1
- package/cjs/timeline/period/index.d.ts +3 -2
- package/cjs/timeline/period/index.js.map +1 -1
- package/cjs/tooltip/Tooltip.d.ts +19 -12
- package/cjs/tooltip/Tooltip.js.map +1 -1
- package/esm/accordion/Accordion.d.ts +4 -4
- package/esm/alert/Alert.d.ts +12 -10
- package/esm/alert/Alert.js.map +1 -1
- package/esm/button/Button.d.ts +9 -8
- package/esm/button/Button.js.map +1 -1
- package/esm/chat/Chat.d.ts +6 -6
- package/esm/chips/Chips.d.ts +2 -2
- package/esm/copybutton/CopyButton.d.ts +14 -12
- package/esm/copybutton/CopyButton.js.map +1 -1
- package/esm/date/datepicker/types.d.ts +7 -6
- package/esm/date/hooks/useDatepicker.d.ts +4 -3
- package/esm/date/hooks/useDatepicker.js.map +1 -1
- package/esm/date/hooks/useMonthPicker.d.ts +4 -3
- package/esm/date/hooks/useMonthPicker.js.map +1 -1
- package/esm/date/monthpicker/types.d.ts +2 -1
- package/esm/date/parts/DateInput.d.ts +1 -1
- package/esm/expansion-card/ExpansionCardTitle.d.ts +1 -1
- package/esm/form/checkbox/CheckboxGroup.d.ts +3 -3
- package/esm/form/checkbox/types.d.ts +4 -4
- package/esm/form/combobox/types.d.ts +15 -15
- package/esm/form/error-summary/ErrorSummary.d.ts +5 -5
- package/esm/form/radio/RadioGroup.d.ts +1 -1
- package/esm/form/search/Search.d.ts +3 -2
- package/esm/form/search/Search.js.map +1 -1
- package/esm/form/select/Select.d.ts +9 -9
- package/esm/form/switch/Switch.d.ts +5 -5
- package/esm/form/textarea/Textarea.d.ts +5 -4
- package/esm/form/textarea/Textarea.js.map +1 -1
- package/esm/form/useFormField.d.ts +10 -8
- package/esm/form/useFormField.js.map +1 -1
- package/esm/layout/bleed/Bleed.d.ts +9 -1
- package/esm/layout/bleed/Bleed.js.map +1 -1
- package/esm/layout/box/Box.d.ts +5 -5
- package/esm/layout/grid/HGrid.d.ts +1 -3
- package/esm/layout/grid/HGrid.js.map +1 -1
- package/esm/layout/page/Page.d.ts +2 -2
- package/esm/layout/responsive/Responsive.d.ts +2 -4
- package/esm/layout/responsive/Responsive.js.map +1 -1
- package/esm/layout/stack/Stack.d.ts +18 -4
- package/esm/layout/stack/Stack.js.map +1 -1
- package/esm/list/types.d.ts +1 -1
- package/esm/loader/Loader.d.ts +1 -0
- package/esm/loader/Loader.js.map +1 -1
- package/esm/modal/Modal.js +2 -2
- package/esm/modal/types.d.ts +8 -8
- package/esm/pagination/Pagination.d.ts +3 -2
- package/esm/pagination/Pagination.js.map +1 -1
- package/esm/pagination/PaginationItem.d.ts +1 -1
- package/esm/popover/Popover.d.ts +2 -1
- package/esm/popover/Popover.js.map +1 -1
- package/esm/read-more/ReadMore.d.ts +7 -7
- package/esm/stepper/Step.d.ts +4 -4
- package/esm/stepper/Stepper.d.ts +7 -5
- package/esm/stepper/Stepper.js.map +1 -1
- package/esm/table/AnimateHeight.d.ts +1 -1
- package/esm/tabs/TabList.d.ts +1 -1
- package/esm/tabs/Tabs.d.ts +7 -7
- package/esm/timeline/Timeline.d.ts +6 -3
- package/esm/timeline/Timeline.js +2 -1
- package/esm/timeline/Timeline.js.map +1 -1
- package/esm/timeline/period/index.d.ts +3 -2
- package/esm/timeline/period/index.js.map +1 -1
- package/esm/tooltip/Tooltip.d.ts +19 -12
- package/esm/tooltip/Tooltip.js.map +1 -1
- package/package.json +3 -3
- package/src/accordion/Accordion.tsx +4 -4
- package/src/accordion/accordion.stories.tsx +0 -2
- package/src/alert/Alert.tsx +12 -10
- package/src/button/Button.tsx +9 -8
- package/src/chat/Chat.tsx +6 -6
- package/src/chips/Chips.tsx +2 -2
- package/src/copybutton/CopyButton.tsx +14 -12
- package/src/date/datepicker/datepicker.stories.tsx +0 -1
- package/src/date/datepicker/types.ts +7 -6
- package/src/date/hooks/useDatepicker.tsx +4 -3
- package/src/date/hooks/useMonthPicker.tsx +4 -3
- package/src/date/monthpicker/types.ts +2 -1
- package/src/date/parts/DateInput.tsx +1 -1
- package/src/expansion-card/ExpansionCardTitle.tsx +1 -1
- package/src/form/checkbox/CheckboxGroup.tsx +3 -3
- package/src/form/checkbox/types.ts +4 -4
- package/src/form/combobox/types.ts +15 -15
- package/src/form/error-summary/ErrorSummary.tsx +5 -5
- package/src/form/radio/RadioGroup.tsx +1 -1
- package/src/form/search/Search.tsx +3 -2
- package/src/form/select/Select.tsx +9 -9
- package/src/form/select/select.stories.tsx +32 -37
- package/src/form/switch/Switch.tsx +5 -5
- package/src/form/textarea/Textarea.tsx +5 -4
- package/src/form/useFormField.ts +10 -8
- package/src/layout/bleed/Bleed.tsx +9 -1
- package/src/layout/box/Box.tsx +5 -5
- package/src/layout/grid/HGrid.tsx +1 -3
- package/src/layout/page/Page.tsx +2 -2
- package/src/layout/responsive/Responsive.tsx +2 -4
- package/src/layout/stack/Stack.tsx +18 -4
- package/src/list/types.ts +1 -1
- package/src/loader/Loader.tsx +1 -0
- package/src/modal/Modal.tsx +2 -2
- package/src/modal/types.ts +8 -8
- package/src/pagination/Pagination.tsx +3 -2
- package/src/pagination/PaginationItem.tsx +1 -1
- package/src/popover/Popover.tsx +2 -1
- package/src/read-more/ReadMore.tsx +7 -7
- package/src/stepper/Step.tsx +4 -4
- package/src/stepper/Stepper.tsx +7 -5
- package/src/table/AnimateHeight.tsx +1 -1
- package/src/tabs/TabList.tsx +1 -1
- package/src/tabs/Tabs.tsx +7 -7
- package/src/timeline/Timeline.tsx +6 -3
- package/src/timeline/period/index.tsx +3 -2
- package/src/tooltip/Tooltip.tsx +19 -12
package/src/stepper/Stepper.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import { StepperContext } from "./context";
|
|
|
5
5
|
|
|
6
6
|
export interface StepperProps extends React.HTMLAttributes<HTMLOListElement> {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* `<Stepper.Step />` elements.
|
|
9
9
|
*/
|
|
10
10
|
children: React.ReactNode;
|
|
11
11
|
/**
|
|
@@ -15,16 +15,18 @@ export interface StepperProps extends React.HTMLAttributes<HTMLOListElement> {
|
|
|
15
15
|
orientation?: "horizontal" | "vertical";
|
|
16
16
|
/**
|
|
17
17
|
* Current active step.
|
|
18
|
-
*
|
|
18
|
+
*
|
|
19
|
+
* Stepper index starts at 1, not 0.
|
|
19
20
|
*/
|
|
20
21
|
activeStep: number;
|
|
21
22
|
/**
|
|
22
|
-
* Callback for next activeStep
|
|
23
|
-
*
|
|
23
|
+
* Callback for next `activeStep`.
|
|
24
|
+
*
|
|
25
|
+
* Stepper index starts at 1, not 0.
|
|
24
26
|
*/
|
|
25
27
|
onStepChange?: (step: number) => void;
|
|
26
28
|
/**
|
|
27
|
-
* Makes stepper non-interactive if false
|
|
29
|
+
* Makes stepper non-interactive if false.
|
|
28
30
|
* @default true
|
|
29
31
|
*/
|
|
30
32
|
interactive?: boolean;
|
package/src/tabs/TabList.tsx
CHANGED
package/src/tabs/Tabs.tsx
CHANGED
|
@@ -11,34 +11,34 @@ export interface TabsProps
|
|
|
11
11
|
extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "dir"> {
|
|
12
12
|
children: React.ReactNode;
|
|
13
13
|
/**
|
|
14
|
-
* Changes padding and font-size
|
|
14
|
+
* Changes padding and font-size.
|
|
15
15
|
* @default "medium"
|
|
16
16
|
*/
|
|
17
17
|
size?: "medium" | "small";
|
|
18
18
|
/**
|
|
19
|
-
* onChange callback for selected Tab
|
|
19
|
+
* onChange callback for selected Tab.
|
|
20
20
|
*/
|
|
21
21
|
onChange?: (value: string) => void;
|
|
22
22
|
/**
|
|
23
|
-
* Controlled selected value
|
|
23
|
+
* Controlled selected value.
|
|
24
24
|
*/
|
|
25
25
|
value?: string;
|
|
26
26
|
/**
|
|
27
|
-
* If not controlled, a default-value needs to be set
|
|
27
|
+
* If not controlled, a default-value needs to be set.
|
|
28
28
|
*/
|
|
29
29
|
defaultValue?: string;
|
|
30
30
|
/**
|
|
31
|
-
* Automatically activates tab on focus/navigation
|
|
31
|
+
* Automatically activates tab on focus/navigation.
|
|
32
32
|
* @default false
|
|
33
33
|
*/
|
|
34
34
|
selectionFollowsFocus?: boolean;
|
|
35
35
|
/**
|
|
36
|
-
* Loops back to start when navigating past last item
|
|
36
|
+
* Loops back to start when navigating past last item.
|
|
37
37
|
* @default false
|
|
38
38
|
*/
|
|
39
39
|
loop?: boolean;
|
|
40
40
|
/**
|
|
41
|
-
* Icon position in Tab
|
|
41
|
+
* Icon position in Tab.
|
|
42
42
|
* @default "left"
|
|
43
43
|
*/
|
|
44
44
|
iconPosition?: "left" | "top";
|
|
@@ -20,13 +20,15 @@ export interface TimelineProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
20
20
|
/**
|
|
21
21
|
* Decides startingpoint in timeline.
|
|
22
22
|
* Defaults to earliest date among the timeline periods.
|
|
23
|
-
*
|
|
23
|
+
*
|
|
24
|
+
* Using this disables use of ZoomButtons. You will need to control zooming yourself.
|
|
24
25
|
*/
|
|
25
26
|
startDate?: Date;
|
|
26
27
|
/**
|
|
27
28
|
* Decides end-date for timeline.
|
|
28
29
|
* Defaults to the latest date among the timeline periods.
|
|
29
|
-
*
|
|
30
|
+
*
|
|
31
|
+
* Using this disables use of ZoomButtons. You will need to control zooming yourself.
|
|
30
32
|
*/
|
|
31
33
|
endDate?: Date;
|
|
32
34
|
/**
|
|
@@ -63,7 +65,8 @@ interface TimelineComponent
|
|
|
63
65
|
|
|
64
66
|
/**
|
|
65
67
|
* A component that displays a timeline of events. Meant for Internal systems.
|
|
66
|
-
*
|
|
68
|
+
*
|
|
69
|
+
* Component is made for desktop enviroments and will start having issues on smaller screens.
|
|
67
70
|
*
|
|
68
71
|
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/timeline)
|
|
69
72
|
* @see 🏷️ {@link TimelineProps}
|
|
@@ -38,8 +38,9 @@ export interface TimelinePeriodProps
|
|
|
38
38
|
*/
|
|
39
39
|
children?: React.ReactNode;
|
|
40
40
|
/**
|
|
41
|
-
* Visual active inidcation on period
|
|
42
|
-
*
|
|
41
|
+
* Visual active inidcation on period.
|
|
42
|
+
*
|
|
43
|
+
* Make sure only one period is active at a time.
|
|
43
44
|
*/
|
|
44
45
|
isActive?: boolean;
|
|
45
46
|
}
|
package/src/tooltip/Tooltip.tsx
CHANGED
|
@@ -22,8 +22,9 @@ import { useMergeRefs } from "../util/hooks/useMergeRefs";
|
|
|
22
22
|
|
|
23
23
|
export interface TooltipProps extends HTMLAttributes<HTMLDivElement> {
|
|
24
24
|
/**
|
|
25
|
-
* Element tooltip anchors to
|
|
26
|
-
*
|
|
25
|
+
* Element tooltip anchors to.
|
|
26
|
+
*
|
|
27
|
+
* Needs to be React.ReactElement, does not support multiple children/react fragment
|
|
27
28
|
*/
|
|
28
29
|
children: React.ReactElement & React.RefAttributes<HTMLElement>;
|
|
29
30
|
/**
|
|
@@ -32,45 +33,51 @@ export interface TooltipProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
32
33
|
open?: boolean;
|
|
33
34
|
/**
|
|
34
35
|
* Tells tooltip to start in open state.
|
|
35
|
-
* Use
|
|
36
|
-
*
|
|
36
|
+
* Use _sparingly_ since hover/focus on other elements will close it.
|
|
37
|
+
*
|
|
38
|
+
* `open`-prop overwrites this.
|
|
37
39
|
*/
|
|
38
40
|
defaultOpen?: boolean;
|
|
39
41
|
/**
|
|
40
|
-
* Change handler for open
|
|
42
|
+
* Change handler for open.
|
|
41
43
|
*/
|
|
42
44
|
onOpenChange?: (open: boolean) => void;
|
|
43
45
|
/**
|
|
44
|
-
* Orientation for tooltip
|
|
46
|
+
* Orientation for tooltip.
|
|
45
47
|
* @default "top"
|
|
46
48
|
*/
|
|
47
49
|
placement?: "top" | "right" | "bottom" | "left";
|
|
48
50
|
/**
|
|
49
|
-
* Toggles rendering of arrow
|
|
51
|
+
* Toggles rendering of arrow.
|
|
50
52
|
* @default true
|
|
51
53
|
*/
|
|
52
54
|
arrow?: boolean;
|
|
53
55
|
/**
|
|
54
|
-
* Distance from anchor to tooltip
|
|
56
|
+
* Distance from anchor to tooltip.
|
|
55
57
|
* @default 10px with arrow, 2px without arrow
|
|
56
58
|
*/
|
|
57
59
|
offset?: number;
|
|
58
60
|
/**
|
|
59
|
-
* Text-content inside tooltip
|
|
61
|
+
* Text-content inside tooltip.
|
|
60
62
|
*/
|
|
61
63
|
content: string;
|
|
62
64
|
/**
|
|
63
|
-
* Sets max
|
|
65
|
+
* Sets max character length.
|
|
66
|
+
*
|
|
67
|
+
* Ideally you should keep the length of the tooltip to a minimum (80 characters).
|
|
68
|
+
* Currently this prop only emits a warning in the console, which can be squelched
|
|
69
|
+
* by setting this to a larger number. However, before doing so you should _try_
|
|
70
|
+
* to shorten the content so that it fits into 80 characters.
|
|
64
71
|
* @default 80
|
|
65
72
|
*/
|
|
66
73
|
maxChar?: number;
|
|
67
74
|
/**
|
|
68
|
-
* Adds a delay in milliseconds before opening tooltip
|
|
75
|
+
* Adds a delay in milliseconds before opening tooltip.
|
|
69
76
|
* @default 150
|
|
70
77
|
*/
|
|
71
78
|
delay?: number;
|
|
72
79
|
/**
|
|
73
|
-
* List of Keyboard-keys for shortcuts
|
|
80
|
+
* List of Keyboard-keys for shortcuts.
|
|
74
81
|
*/
|
|
75
82
|
keys?: string[];
|
|
76
83
|
}
|