@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/esm/tooltip/Tooltip.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from "react";
|
|
2
2
|
export interface TooltipProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
3
|
/**
|
|
4
|
-
* Element tooltip anchors to
|
|
5
|
-
*
|
|
4
|
+
* Element tooltip anchors to.
|
|
5
|
+
*
|
|
6
|
+
* Needs to be React.ReactElement, does not support multiple children/react fragment
|
|
6
7
|
*/
|
|
7
8
|
children: React.ReactElement & React.RefAttributes<HTMLElement>;
|
|
8
9
|
/**
|
|
@@ -11,45 +12,51 @@ export interface TooltipProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
11
12
|
open?: boolean;
|
|
12
13
|
/**
|
|
13
14
|
* Tells tooltip to start in open state.
|
|
14
|
-
* Use
|
|
15
|
-
*
|
|
15
|
+
* Use _sparingly_ since hover/focus on other elements will close it.
|
|
16
|
+
*
|
|
17
|
+
* `open`-prop overwrites this.
|
|
16
18
|
*/
|
|
17
19
|
defaultOpen?: boolean;
|
|
18
20
|
/**
|
|
19
|
-
* Change handler for open
|
|
21
|
+
* Change handler for open.
|
|
20
22
|
*/
|
|
21
23
|
onOpenChange?: (open: boolean) => void;
|
|
22
24
|
/**
|
|
23
|
-
* Orientation for tooltip
|
|
25
|
+
* Orientation for tooltip.
|
|
24
26
|
* @default "top"
|
|
25
27
|
*/
|
|
26
28
|
placement?: "top" | "right" | "bottom" | "left";
|
|
27
29
|
/**
|
|
28
|
-
* Toggles rendering of arrow
|
|
30
|
+
* Toggles rendering of arrow.
|
|
29
31
|
* @default true
|
|
30
32
|
*/
|
|
31
33
|
arrow?: boolean;
|
|
32
34
|
/**
|
|
33
|
-
* Distance from anchor to tooltip
|
|
35
|
+
* Distance from anchor to tooltip.
|
|
34
36
|
* @default 10px with arrow, 2px without arrow
|
|
35
37
|
*/
|
|
36
38
|
offset?: number;
|
|
37
39
|
/**
|
|
38
|
-
* Text-content inside tooltip
|
|
40
|
+
* Text-content inside tooltip.
|
|
39
41
|
*/
|
|
40
42
|
content: string;
|
|
41
43
|
/**
|
|
42
|
-
* Sets max
|
|
44
|
+
* Sets max character length.
|
|
45
|
+
*
|
|
46
|
+
* Ideally you should keep the length of the tooltip to a minimum (80 characters).
|
|
47
|
+
* Currently this prop only emits a warning in the console, which can be squelched
|
|
48
|
+
* by setting this to a larger number. However, before doing so you should _try_
|
|
49
|
+
* to shorten the content so that it fits into 80 characters.
|
|
43
50
|
* @default 80
|
|
44
51
|
*/
|
|
45
52
|
maxChar?: number;
|
|
46
53
|
/**
|
|
47
|
-
* Adds a delay in milliseconds before opening tooltip
|
|
54
|
+
* Adds a delay in milliseconds before opening tooltip.
|
|
48
55
|
* @default 150
|
|
49
56
|
*/
|
|
50
57
|
delay?: number;
|
|
51
58
|
/**
|
|
52
|
-
* List of Keyboard-keys for shortcuts
|
|
59
|
+
* List of Keyboard-keys for shortcuts.
|
|
53
60
|
*/
|
|
54
61
|
keys?: string[];
|
|
55
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../src/tooltip/Tooltip.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EACL,UAAU,EACV,KAAK,IAAI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AC,CAAC,GAAG,EAAE,EAAE,CAAC,CACjB,oBAAC,MAAM,IAAC,EAAE,EAAC,KAAK,EAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAC,oBAAoB,IACtD,GAAG,CACG,CACV,CAAC,CACG,CACR;YACA,MAAM,IAAI,CACT,6BACE,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE;oBACZ,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;gBAC1B,CAAC,EACD,SAAS,EAAC,sBAAsB,EAChC,KAAK,EAAE;oBACL,IAAI,EAAE,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC,EAAE;oBACzC,GAAG,EAAE,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC,EAAE;oBACxC,KAAK,EAAE,EAAE;oBACT,MAAM,EAAE,EAAE;oBACV,CAAC;wBACC,GAAG,EAAE,QAAQ;wBACb,KAAK,EAAE,MAAM;wBACb,MAAM,EAAE,KAAK;wBACb,IAAI,EAAE,OAAO;qBACd,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ;iBACxB,GACD,CACH,CACG,CACP,CACM,CACR,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@navikt/ds-react",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "React components from the Norwegian Labour and Welfare Administration.",
|
|
5
5
|
"author": "Aksel, a team part of the Norwegian Labour and Welfare Administration.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -552,8 +552,8 @@
|
|
|
552
552
|
},
|
|
553
553
|
"dependencies": {
|
|
554
554
|
"@floating-ui/react": "0.25.4",
|
|
555
|
-
"@navikt/aksel-icons": "^6.
|
|
556
|
-
"@navikt/ds-tokens": "^6.
|
|
555
|
+
"@navikt/aksel-icons": "^6.2.0",
|
|
556
|
+
"@navikt/ds-tokens": "^6.2.0",
|
|
557
557
|
"@radix-ui/react-tabs": "1.0.0",
|
|
558
558
|
"@radix-ui/react-toggle-group": "1.0.0",
|
|
559
559
|
"clsx": "^2.1.0",
|
|
@@ -31,11 +31,11 @@ interface AccordionComponent
|
|
|
31
31
|
|
|
32
32
|
export interface AccordionProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
33
33
|
/**
|
|
34
|
-
* @default
|
|
34
|
+
* @default "default"
|
|
35
35
|
*/
|
|
36
36
|
variant?: "default" | "neutral";
|
|
37
37
|
/**
|
|
38
|
-
* @default
|
|
38
|
+
* @default "small"
|
|
39
39
|
*/
|
|
40
40
|
headingSize?: "large" | "medium" | "small" | "xsmall";
|
|
41
41
|
/**
|
|
@@ -43,12 +43,12 @@ export interface AccordionProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
43
43
|
*/
|
|
44
44
|
size?: "large" | "medium" | "small";
|
|
45
45
|
/**
|
|
46
|
-
* Whether to indent content or not
|
|
46
|
+
* Whether to indent content or not.
|
|
47
47
|
* @default true
|
|
48
48
|
*/
|
|
49
49
|
indent?: boolean;
|
|
50
50
|
/**
|
|
51
|
-
* Instances of Accordion.Item
|
|
51
|
+
* Instances of `Accordion.Item`.
|
|
52
52
|
*/
|
|
53
53
|
children: React.ReactNode;
|
|
54
54
|
}
|
|
@@ -162,9 +162,7 @@ export const Variants: Story = {
|
|
|
162
162
|
|
|
163
163
|
export const ControlledState: Story = {
|
|
164
164
|
render: () => {
|
|
165
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
166
165
|
const [open, setOpen] = useState(false);
|
|
167
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
168
166
|
const [open2, setOpen2] = useState(false);
|
|
169
167
|
|
|
170
168
|
return (
|
package/src/alert/Alert.tsx
CHANGED
|
@@ -12,37 +12,39 @@ import { BodyLong } from "../typography";
|
|
|
12
12
|
|
|
13
13
|
export interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
14
14
|
/**
|
|
15
|
-
* Alert content
|
|
15
|
+
* Alert content.
|
|
16
16
|
*/
|
|
17
17
|
children: React.ReactNode;
|
|
18
18
|
/**
|
|
19
|
-
* Changes colors and icon usage when changed
|
|
19
|
+
* Changes colors and icon usage when changed.
|
|
20
20
|
*/
|
|
21
21
|
variant: "error" | "warning" | "info" | "success";
|
|
22
22
|
/**
|
|
23
|
-
* Changes padding and font-sizes
|
|
24
|
-
* @default medium
|
|
23
|
+
* Changes padding and font-sizes.
|
|
24
|
+
* @default "medium"
|
|
25
25
|
*/
|
|
26
26
|
size?: "medium" | "small";
|
|
27
27
|
/**
|
|
28
|
-
* Removes border-radius
|
|
28
|
+
* Removes `border-radius`.
|
|
29
29
|
* @default false
|
|
30
30
|
*/
|
|
31
31
|
fullWidth?: boolean;
|
|
32
32
|
/**
|
|
33
|
-
* Removes background from Alert
|
|
33
|
+
* Removes background from Alert.
|
|
34
34
|
* @default false
|
|
35
35
|
*/
|
|
36
36
|
inline?: boolean;
|
|
37
37
|
/**
|
|
38
|
-
* Removes close-button(X) when false
|
|
39
|
-
*
|
|
38
|
+
* Removes close-button(X) when false.
|
|
39
|
+
*
|
|
40
|
+
* **Requires onClose to be set**.
|
|
40
41
|
* @default true
|
|
41
42
|
*/
|
|
42
43
|
closeButton?: boolean;
|
|
43
44
|
/**
|
|
44
|
-
* Callback for alert wanting to close
|
|
45
|
-
*
|
|
45
|
+
* Callback for alert wanting to close.
|
|
46
|
+
*
|
|
47
|
+
* **Requires closeButton to be true**.
|
|
46
48
|
*/
|
|
47
49
|
onClose?: () => void;
|
|
48
50
|
}
|
package/src/button/Button.tsx
CHANGED
|
@@ -11,11 +11,11 @@ import { OverridableComponent } from "../util/types";
|
|
|
11
11
|
export interface ButtonProps
|
|
12
12
|
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
13
13
|
/**
|
|
14
|
-
* Button content
|
|
14
|
+
* Button content.
|
|
15
15
|
*/
|
|
16
16
|
children?: React.ReactNode;
|
|
17
17
|
/**
|
|
18
|
-
* Changes design and interaction-visuals
|
|
18
|
+
* Changes design and interaction-visuals.
|
|
19
19
|
* @default "primary"
|
|
20
20
|
*/
|
|
21
21
|
variant?:
|
|
@@ -27,26 +27,27 @@ export interface ButtonProps
|
|
|
27
27
|
| "tertiary-neutral"
|
|
28
28
|
| "danger";
|
|
29
29
|
/**
|
|
30
|
-
* Changes padding, height and font-size
|
|
31
|
-
* @default medium
|
|
30
|
+
* Changes padding, height, and font-size.
|
|
31
|
+
* @default "medium"
|
|
32
32
|
*/
|
|
33
33
|
size?: "medium" | "small" | "xsmall";
|
|
34
34
|
/**
|
|
35
|
+
* **Avoid using if possible for accessibility purposes**.
|
|
36
|
+
*
|
|
35
37
|
* Prevent the user from interacting with the button: it cannot be pressed or focused.
|
|
36
|
-
* @note Avoid using if possible for accessibility purposes
|
|
37
38
|
*/
|
|
38
39
|
disabled?: boolean;
|
|
39
40
|
/**
|
|
40
|
-
* Replaces button content with a Loader component, keeps width
|
|
41
|
+
* Replaces button content with a Loader component, keeps width.
|
|
41
42
|
* @default false
|
|
42
43
|
*/
|
|
43
44
|
loading?: boolean;
|
|
44
45
|
/**
|
|
45
|
-
* Button Icon
|
|
46
|
+
* Button Icon.
|
|
46
47
|
*/
|
|
47
48
|
icon?: React.ReactNode;
|
|
48
49
|
/**
|
|
49
|
-
* Icon position in Button
|
|
50
|
+
* Icon position in Button.
|
|
50
51
|
* @default "left"
|
|
51
52
|
*/
|
|
52
53
|
iconPosition?: "left" | "right";
|
package/src/chat/Chat.tsx
CHANGED
|
@@ -8,15 +8,15 @@ export const SIZES = ["medium", "small"] as const;
|
|
|
8
8
|
|
|
9
9
|
export interface ChatProps extends HTMLAttributes<HTMLDivElement> {
|
|
10
10
|
/**
|
|
11
|
-
* Children of type
|
|
11
|
+
* Children of type `<Chat.Bubble />`.
|
|
12
12
|
*/
|
|
13
13
|
children: React.ReactNode;
|
|
14
14
|
/**
|
|
15
|
-
* Chat-message name
|
|
15
|
+
* Chat-message name.
|
|
16
16
|
*/
|
|
17
17
|
name?: string;
|
|
18
18
|
/**
|
|
19
|
-
* Timestamp for sent message
|
|
19
|
+
* Timestamp for sent message.
|
|
20
20
|
*/
|
|
21
21
|
timestamp?: string;
|
|
22
22
|
/**
|
|
@@ -30,17 +30,17 @@ export interface ChatProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
30
30
|
*/
|
|
31
31
|
variant?: "subtle" | "info" | "neutral";
|
|
32
32
|
/**
|
|
33
|
-
* Positions avatar and bubbles
|
|
33
|
+
* Positions avatar and bubbles.
|
|
34
34
|
* @default "left"
|
|
35
35
|
*/
|
|
36
36
|
position?: (typeof POSITIONS)[number];
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
38
|
+
* Horizontal position of toptext.
|
|
39
39
|
* @default Same as position
|
|
40
40
|
*/
|
|
41
41
|
toptextPosition?: (typeof POSITIONS)[number];
|
|
42
42
|
/**
|
|
43
|
-
* Affects padding and font size in bubbles
|
|
43
|
+
* Affects padding and font size in bubbles.
|
|
44
44
|
* @default "medium"
|
|
45
45
|
*/
|
|
46
46
|
size?: (typeof SIZES)[number];
|
package/src/chips/Chips.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import ToggleChips, { ChipsToggleProps } from "./Toggle";
|
|
|
7
7
|
export interface ChipsProps extends HTMLAttributes<HTMLUListElement> {
|
|
8
8
|
children: React.ReactNode;
|
|
9
9
|
/**
|
|
10
|
-
* Changes padding and font-sizes
|
|
10
|
+
* Changes padding and font-sizes.
|
|
11
11
|
* @default "medium"
|
|
12
12
|
*/
|
|
13
13
|
size?: "medium" | "small";
|
|
@@ -24,7 +24,7 @@ interface ChipsComponent
|
|
|
24
24
|
*/
|
|
25
25
|
Toggle: OverridableComponent<ChipsToggleProps, HTMLButtonElement>;
|
|
26
26
|
/**
|
|
27
|
-
* Remove filter or the likes on click
|
|
27
|
+
* Remove filter or the likes on click.
|
|
28
28
|
* @see 🏷️ {@link RemovableChipsProps}
|
|
29
29
|
* @see [🤖 OverridableComponent](https://aksel.nav.no/grunnleggende/kode/overridablecomponent) support
|
|
30
30
|
*/
|
|
@@ -14,7 +14,7 @@ import copy from "../util/copy";
|
|
|
14
14
|
export interface CopyButtonProps
|
|
15
15
|
extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* `"xsmall"` should _only_ be used in tables.
|
|
18
18
|
* @default "medium"
|
|
19
19
|
*/
|
|
20
20
|
size?: "medium" | "small" | "xsmall";
|
|
@@ -23,11 +23,11 @@ export interface CopyButtonProps
|
|
|
23
23
|
*/
|
|
24
24
|
variant?: "action" | "neutral";
|
|
25
25
|
/**
|
|
26
|
-
* Text to copy to clipboard
|
|
26
|
+
* Text to copy to clipboard.
|
|
27
27
|
*/
|
|
28
28
|
copyText: string;
|
|
29
29
|
/**
|
|
30
|
-
* Optional text in button
|
|
30
|
+
* Optional text in button.
|
|
31
31
|
*/
|
|
32
32
|
text?: string;
|
|
33
33
|
/**
|
|
@@ -36,36 +36,38 @@ export interface CopyButtonProps
|
|
|
36
36
|
*/
|
|
37
37
|
activeText?: string;
|
|
38
38
|
/**
|
|
39
|
-
* Callback when
|
|
39
|
+
* Callback that is called when internal copy-state changes.
|
|
40
|
+
*
|
|
41
|
+
* @param state `true` when copy-state is activated, `false` when copy-state is deactivated.
|
|
40
42
|
*/
|
|
41
43
|
onActiveChange?: (state: boolean) => void;
|
|
42
44
|
/**
|
|
43
|
-
* Icon shown when button is not clicked
|
|
45
|
+
* Icon shown when button is not clicked.
|
|
44
46
|
* @default <FilesIcon />
|
|
45
47
|
*/
|
|
46
48
|
icon?: React.ReactNode;
|
|
47
49
|
/**
|
|
48
|
-
* Icon shown when active
|
|
50
|
+
* Icon shown when active.
|
|
49
51
|
* @default <CheckmarkIcon />
|
|
50
52
|
*/
|
|
51
53
|
activeIcon?: React.ReactNode;
|
|
52
54
|
/**
|
|
53
|
-
* Timeout duration in milliseconds
|
|
55
|
+
* Timeout duration in milliseconds.
|
|
54
56
|
* @default 2000
|
|
55
57
|
*/
|
|
56
58
|
activeDuration?: number;
|
|
57
59
|
/**
|
|
58
|
-
* Accessible label for icon (ignored if text is set)
|
|
59
|
-
* @default
|
|
60
|
+
* Accessible label for icon (ignored if text is set).
|
|
61
|
+
* @default "Kopier"
|
|
60
62
|
*/
|
|
61
63
|
title?: string;
|
|
62
64
|
/**
|
|
63
|
-
* Accessible label for icon in active-state (ignored if text is set)
|
|
64
|
-
* @default
|
|
65
|
+
* Accessible label for icon in active-state (ignored if text is set).
|
|
66
|
+
* @default "Kopiert"
|
|
65
67
|
*/
|
|
66
68
|
activeTitle?: string;
|
|
67
69
|
/**
|
|
68
|
-
* Icon position in button
|
|
70
|
+
* Icon position in button.
|
|
69
71
|
* @default "left"
|
|
70
72
|
*/
|
|
71
73
|
iconPosition?: "left" | "right";
|
|
@@ -16,7 +16,7 @@ export type MultipleMode = {
|
|
|
16
16
|
min?: number;
|
|
17
17
|
max?: number;
|
|
18
18
|
/**
|
|
19
|
-
* Allows selecting a week at a time. Only used with mode
|
|
19
|
+
* Allows selecting a week at a time. Only used with `mode` is set to "multiple".
|
|
20
20
|
*/
|
|
21
21
|
onWeekNumberClick?: DayPickerBase["onWeekNumberClick"];
|
|
22
22
|
};
|
|
@@ -83,21 +83,22 @@ export interface DatePickerDefaultProps
|
|
|
83
83
|
*/
|
|
84
84
|
showWeekNumber?: boolean;
|
|
85
85
|
/**
|
|
86
|
-
* Open state for user-controlled state. Component controlled by default
|
|
86
|
+
* Open state for user-controlled state. Component controlled by default.
|
|
87
87
|
*/
|
|
88
88
|
open?: boolean;
|
|
89
89
|
/**
|
|
90
|
-
* onClose callback for user-controlled state
|
|
90
|
+
* onClose callback for user-controlled state.
|
|
91
91
|
*/
|
|
92
92
|
onClose?: () => void;
|
|
93
93
|
/**
|
|
94
|
-
* onOpenToggle callback for user-controlled state. Only called if `<DatePicker.Input />` is used
|
|
94
|
+
* onOpenToggle callback for user-controlled state. Only called if `<DatePicker.Input />` is used.
|
|
95
95
|
*/
|
|
96
96
|
onOpenToggle?: () => void;
|
|
97
97
|
/**
|
|
98
|
-
* Avoid using if possible
|
|
98
|
+
* **Avoid using if possible!**
|
|
99
|
+
*
|
|
99
100
|
* Changes what CSS position property to use.
|
|
100
|
-
* You want to use "fixed" if parent wrapper has position relative, but you want popover to escape
|
|
101
|
+
* You want to use "fixed" if parent wrapper has position relative, but you want popover to escape.
|
|
101
102
|
* @default See Popover
|
|
102
103
|
*/
|
|
103
104
|
strategy?: "absolute" | "fixed";
|
|
@@ -49,10 +49,11 @@ export interface UseDatepickerOptions
|
|
|
49
49
|
*/
|
|
50
50
|
onValidate?: (val: DateValidationT) => void;
|
|
51
51
|
/**
|
|
52
|
-
* Allows input of with
|
|
52
|
+
* Allows input of with `yy` year format.
|
|
53
|
+
*
|
|
54
|
+
* Decision between 20th and 21st century is based on before(todays year - 80) ? 21st : 20th.
|
|
55
|
+
* e.g. In 2024 this equals to 1944 - 2043.
|
|
53
56
|
* @default true
|
|
54
|
-
* @Note Decision between 20th and 21st century is based on before(todays year - 80) ? 21st : 20th.
|
|
55
|
-
* In 2024 this equals to 1944 - 2043
|
|
56
57
|
*/
|
|
57
58
|
allowTwoDigitYear?: boolean;
|
|
58
59
|
}
|
|
@@ -36,10 +36,11 @@ export interface UseMonthPickerOptions
|
|
|
36
36
|
*/
|
|
37
37
|
defaultYear?: Date;
|
|
38
38
|
/**
|
|
39
|
-
* Allows input of with
|
|
40
|
-
*
|
|
41
|
-
*
|
|
39
|
+
* Allows input of with `yy` year format.
|
|
40
|
+
*
|
|
41
|
+
* Decision between 20th and 21st century is based on before(todays year - 80) ? 21st : 20th.
|
|
42
42
|
* In 2024 this equals to 1944 - 2043
|
|
43
|
+
* @default true
|
|
43
44
|
*/
|
|
44
45
|
allowTwoDigitYear?: boolean;
|
|
45
46
|
}
|
|
@@ -69,7 +69,8 @@ export interface MonthPickerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
69
69
|
*/
|
|
70
70
|
onYearChange?: (y?: Date) => void;
|
|
71
71
|
/**
|
|
72
|
-
* Avoid using if possible
|
|
72
|
+
* **Avoid using if possible!**
|
|
73
|
+
*
|
|
73
74
|
* Changes what CSS position property to use
|
|
74
75
|
* You want to use "fixed" if parent wrapper has position relative, but you want popover to escape
|
|
75
76
|
* @default "absolute"
|
|
@@ -19,7 +19,7 @@ export interface CheckboxGroupProps
|
|
|
19
19
|
"onChange" | "errorPropagation" | "defaultValue"
|
|
20
20
|
> {
|
|
21
21
|
/**
|
|
22
|
-
* Collection of
|
|
22
|
+
* Collection of `<Checkbox/>`.
|
|
23
23
|
*/
|
|
24
24
|
children: React.ReactNode;
|
|
25
25
|
/**
|
|
@@ -27,11 +27,11 @@ export interface CheckboxGroupProps
|
|
|
27
27
|
*/
|
|
28
28
|
value?: any[];
|
|
29
29
|
/**
|
|
30
|
-
* Default checked checkboxes on render
|
|
30
|
+
* Default checked checkboxes on render.
|
|
31
31
|
*/
|
|
32
32
|
defaultValue?: any[];
|
|
33
33
|
/**
|
|
34
|
-
* Returns current checked checkboxes in group
|
|
34
|
+
* Returns current checked checkboxes in group.
|
|
35
35
|
*/
|
|
36
36
|
onChange?: (value: any[]) => void;
|
|
37
37
|
}
|
|
@@ -5,12 +5,12 @@ export interface CheckboxProps
|
|
|
5
5
|
extends FormFieldProps,
|
|
6
6
|
Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "value"> {
|
|
7
7
|
/**
|
|
8
|
-
* Adds error indication on checkbox
|
|
8
|
+
* Adds error indication on checkbox.
|
|
9
9
|
* @default false
|
|
10
10
|
*/
|
|
11
11
|
error?: boolean;
|
|
12
12
|
/**
|
|
13
|
-
* Id for error resulting in checkbox having error
|
|
13
|
+
* Id for error resulting in checkbox having error.
|
|
14
14
|
*/
|
|
15
15
|
errorId?: string;
|
|
16
16
|
/**
|
|
@@ -26,12 +26,12 @@ export interface CheckboxProps
|
|
|
26
26
|
*/
|
|
27
27
|
value?: any;
|
|
28
28
|
/**
|
|
29
|
-
* Specify whether the Checkbox is in an indeterminate state
|
|
29
|
+
* Specify whether the Checkbox is in an indeterminate state.
|
|
30
30
|
* @default false
|
|
31
31
|
*/
|
|
32
32
|
indeterminate?: boolean;
|
|
33
33
|
/**
|
|
34
|
-
* Adds a description to extend labling of Checkbox
|
|
34
|
+
* Adds a description to extend labling of Checkbox.
|
|
35
35
|
*/
|
|
36
36
|
description?: string;
|
|
37
37
|
}
|
|
@@ -16,11 +16,11 @@ export interface ComboboxProps
|
|
|
16
16
|
extends FormFieldProps,
|
|
17
17
|
Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "onChange" | "value"> {
|
|
18
18
|
/**
|
|
19
|
-
* Combobox label
|
|
19
|
+
* Combobox label.
|
|
20
20
|
*/
|
|
21
21
|
label: React.ReactNode;
|
|
22
22
|
/**
|
|
23
|
-
* List of options to use for autocompletion
|
|
23
|
+
* List of options to use for autocompletion.
|
|
24
24
|
*/
|
|
25
25
|
options: string[];
|
|
26
26
|
/**
|
|
@@ -28,11 +28,11 @@ export interface ComboboxProps
|
|
|
28
28
|
*/
|
|
29
29
|
allowNewValues?: boolean;
|
|
30
30
|
/**
|
|
31
|
-
* If
|
|
31
|
+
* If `true` adds a button to clear the value in the input field
|
|
32
32
|
*/
|
|
33
33
|
clearButton?: boolean;
|
|
34
34
|
/**
|
|
35
|
-
* Custom name for the clear button. Requires
|
|
35
|
+
* Custom name for the clear button. Requires `clearButton` to be `true`.
|
|
36
36
|
*
|
|
37
37
|
* @default "Tøm"
|
|
38
38
|
*/
|
|
@@ -59,13 +59,13 @@ export interface ComboboxProps
|
|
|
59
59
|
*/
|
|
60
60
|
isListOpen?: boolean;
|
|
61
61
|
/**
|
|
62
|
-
* Set to
|
|
62
|
+
* Set to `true` when doing an async search and waiting for new filteredOptions.
|
|
63
63
|
*
|
|
64
64
|
* Will show a spinner in the dropdown and announce to screen readers that it is loading.
|
|
65
65
|
*/
|
|
66
66
|
isLoading?: boolean;
|
|
67
67
|
/**
|
|
68
|
-
* Set to
|
|
68
|
+
* Set to `true` to allow multiple selections.
|
|
69
69
|
*
|
|
70
70
|
* This will display selected values as a list of Chips in front of the input field, instead of a selection replacing the value of the input.
|
|
71
71
|
*
|
|
@@ -82,18 +82,18 @@ export interface ComboboxProps
|
|
|
82
82
|
value?: string,
|
|
83
83
|
) => void;
|
|
84
84
|
/**
|
|
85
|
-
* Callback function triggered whenever the input field is cleared
|
|
85
|
+
* Callback function triggered whenever the input field is cleared.
|
|
86
86
|
*
|
|
87
87
|
* @param event
|
|
88
88
|
* @returns
|
|
89
89
|
*/
|
|
90
90
|
onClear?: (event: React.PointerEvent | React.KeyboardEvent) => void;
|
|
91
91
|
/**
|
|
92
|
-
* Callback function triggered whenever an option is selected or de-selected
|
|
92
|
+
* Callback function triggered whenever an option is selected or de-selected.
|
|
93
93
|
*
|
|
94
|
-
* @param option
|
|
95
|
-
* @param isSelected
|
|
96
|
-
* @param isCustomOption
|
|
94
|
+
* @param option The selected option.
|
|
95
|
+
* @param isSelected Whether the option has been selected or unselected.
|
|
96
|
+
* @param isCustomOption Whether the option comes from user input, instead of from the list.
|
|
97
97
|
* @returns
|
|
98
98
|
*/
|
|
99
99
|
onToggleSelected?: (
|
|
@@ -113,25 +113,25 @@ export interface ComboboxProps
|
|
|
113
113
|
*/
|
|
114
114
|
maxSelected?: MaxSelected;
|
|
115
115
|
/**
|
|
116
|
-
* Set to
|
|
116
|
+
* Set to `true` to enable inline autocomplete.
|
|
117
117
|
*
|
|
118
118
|
* @default false
|
|
119
119
|
*/
|
|
120
120
|
shouldAutocomplete?: boolean;
|
|
121
121
|
/**
|
|
122
|
-
* When set to
|
|
122
|
+
* When set to `true` displays selected options as Chips before the input field
|
|
123
123
|
*
|
|
124
124
|
* @default true
|
|
125
125
|
*/
|
|
126
126
|
shouldShowSelectedOptions?: boolean;
|
|
127
127
|
/**
|
|
128
|
-
* When set to
|
|
128
|
+
* When set to `true` displays the toggle button for opening/closing the dropdown list
|
|
129
129
|
*
|
|
130
130
|
* @default true
|
|
131
131
|
*/
|
|
132
132
|
toggleListButton?: boolean;
|
|
133
133
|
/**
|
|
134
|
-
* Custom name for the toggle list-button. Requires "toggleListButton" to be
|
|
134
|
+
* Custom name for the toggle list-button. Requires "toggleListButton" to be `true`.
|
|
135
135
|
*
|
|
136
136
|
* @default "Alternativer"
|
|
137
137
|
*/
|