@digdir/designsystemet-react 1.0.0-next.37 → 1.0.0-next.39
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/dist/types/components/form/Checkbox/Checkbox.d.ts +2 -14
- package/dist/types/components/form/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/types/components/form/Radio/Radio.d.ts +2 -14
- package/dist/types/components/form/Radio/Radio.d.ts.map +1 -1
- package/dist/types/components/form/Switch/Switch.d.ts +2 -14
- package/dist/types/components/form/Switch/Switch.d.ts.map +1 -1
- package/dist/types/components/form/Textfield/Textfield.d.ts +2 -2
- package/dist/types/components/form/Textfield/Textfield.d.ts.map +1 -1
- package/dist/types/types.d.ts +14 -0
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { Color } from '../../../colors';
|
|
3
|
-
import type { DefaultProps } from '../../../types';
|
|
3
|
+
import type { DefaultProps, LabelRequired } from '../../../types';
|
|
4
4
|
import type { MergeRight } from '../../../utilities';
|
|
5
5
|
import { type InputProps } from '../Input';
|
|
6
6
|
export type CheckboxProps = MergeRight<DefaultProps & Omit<InputProps, 'type' | 'role' | 'size'>, {
|
|
@@ -18,19 +18,7 @@ export type CheckboxProps = MergeRight<DefaultProps & Omit<InputProps, 'type' |
|
|
|
18
18
|
value?: InputProps['value'];
|
|
19
19
|
/** Validation message for field */
|
|
20
20
|
validation?: ReactNode;
|
|
21
|
-
} &
|
|
22
|
-
'aria-label': string;
|
|
23
|
-
'aria-labelledby'?: never;
|
|
24
|
-
label?: never;
|
|
25
|
-
} | {
|
|
26
|
-
'aria-label'?: never;
|
|
27
|
-
'aria-labelledby'?: never;
|
|
28
|
-
label: ReactNode;
|
|
29
|
-
} | {
|
|
30
|
-
'aria-label'?: never;
|
|
31
|
-
'aria-labelledby': string;
|
|
32
|
-
label?: never;
|
|
33
|
-
})>;
|
|
21
|
+
} & LabelRequired>;
|
|
34
22
|
/**
|
|
35
23
|
* Checkbox used to select multiple options.
|
|
36
24
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIrD,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,MAAM,aAAa,GAAG,UAAU,CACpC,YAAY,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,EACzD;IACE;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,0BAA0B;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,4BAA4B;IAC5B,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,mCAAmC;IACnC,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC5B,mCAAmC;IACnC,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB,GAAG,aAAa,CAClB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,QAAQ,wFAcpB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { Color } from '../../../colors';
|
|
3
|
-
import type { DefaultProps } from '../../../types';
|
|
3
|
+
import type { DefaultProps, LabelRequired } from '../../../types';
|
|
4
4
|
import type { MergeRight } from '../../../utilities';
|
|
5
5
|
import { type InputProps } from '../Input';
|
|
6
6
|
export type RadioProps = MergeRight<DefaultProps & Omit<InputProps, 'type' | 'role' | 'size'>, {
|
|
@@ -18,19 +18,7 @@ export type RadioProps = MergeRight<DefaultProps & Omit<InputProps, 'type' | 'ro
|
|
|
18
18
|
value?: InputProps['value'];
|
|
19
19
|
/** Validation message for field */
|
|
20
20
|
validation?: ReactNode;
|
|
21
|
-
} &
|
|
22
|
-
'aria-label': string;
|
|
23
|
-
'aria-labelledby'?: never;
|
|
24
|
-
label?: never;
|
|
25
|
-
} | {
|
|
26
|
-
'aria-label'?: never;
|
|
27
|
-
'aria-labelledby'?: never;
|
|
28
|
-
label: ReactNode;
|
|
29
|
-
} | {
|
|
30
|
-
'aria-label'?: never;
|
|
31
|
-
'aria-labelledby': string;
|
|
32
|
-
label?: never;
|
|
33
|
-
})>;
|
|
21
|
+
} & LabelRequired>;
|
|
34
22
|
/**
|
|
35
23
|
* Radio used to select multiple options.
|
|
36
24
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Radio/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Radio/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIrD,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,MAAM,UAAU,GAAG,UAAU,CACjC,YAAY,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,EACzD;IACE;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,0BAA0B;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,4BAA4B;IAC5B,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,mCAAmC;IACnC,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC5B,mCAAmC;IACnC,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB,GAAG,aAAa,CAClB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,KAAK,qFAYhB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import type { Color } from '../../../colors';
|
|
3
|
-
import type { DefaultProps } from '../../../types';
|
|
3
|
+
import type { DefaultProps, LabelRequired } from '../../../types';
|
|
4
4
|
import type { MergeRight } from '../../../utilities';
|
|
5
5
|
import { type FieldProps } from '../Field';
|
|
6
6
|
import { type InputProps } from '../Input';
|
|
@@ -26,19 +26,7 @@ export type SwitchProps = MergeRight<DefaultProps & Omit<InputHTMLAttributes<HTM
|
|
|
26
26
|
* from the nearest ancestor with data-color.
|
|
27
27
|
*/
|
|
28
28
|
'data-color'?: Color;
|
|
29
|
-
} &
|
|
30
|
-
'aria-label': string;
|
|
31
|
-
'aria-labelledby'?: never;
|
|
32
|
-
label?: never;
|
|
33
|
-
} | {
|
|
34
|
-
'aria-label'?: never;
|
|
35
|
-
'aria-labelledby'?: never;
|
|
36
|
-
label: ReactNode;
|
|
37
|
-
} | {
|
|
38
|
-
'aria-label'?: never;
|
|
39
|
-
'aria-labelledby': string;
|
|
40
|
-
label?: never;
|
|
41
|
-
})>;
|
|
29
|
+
} & LabelRequired>;
|
|
42
30
|
/**
|
|
43
31
|
* Switch used to toggle options.
|
|
44
32
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,MAAM,WAAW,GAAG,UAAU,CAClC,YAAY,GAAG,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC,EAClE;IACE,0BAA0B;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,4BAA4B;IAC5B,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,mCAAmC;IACnC,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IAClC;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;CACtB,GAAG,aAAa,CAClB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,MAAM,sFAyBjB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import type { DefaultProps } from '../../../types';
|
|
2
|
+
import type { DefaultProps, LabelRequired } from '../../../types';
|
|
3
3
|
import { type FieldCounterProps } from '../Field';
|
|
4
4
|
import { type InputProps } from '../Input';
|
|
5
5
|
import { type TextareaProps } from '../Textarea';
|
|
@@ -24,7 +24,7 @@ type SharedTextfieldProps = {
|
|
|
24
24
|
* Pass a number to set a limit, or an object to configure the counter
|
|
25
25
|
*/
|
|
26
26
|
counter?: FieldCounterProps | number;
|
|
27
|
-
} & Omit<DefaultProps, 'data-color'>;
|
|
27
|
+
} & LabelRequired & Omit<DefaultProps, 'data-color'>;
|
|
28
28
|
type TextfieldTextareaProps = {
|
|
29
29
|
/** Use to render a `Textarea` instead of `Input` for multiline support */
|
|
30
30
|
multiline: true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textfield.d.ts","sourceRoot":"","sources":["../../../../src/components/form/Textfield/Textfield.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,SAAS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G;IAC5B,2EAA2E;IAC3E,SAAS,EAAE,IAAI,CAAC;CACjB,GAAG,cAAc,CAAC;AAEnB,KAAK,mBAAmB,GAAG;IACzB,2EAA2E;IAC3E,SAAS,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;CAC3B,GAAG,WAAW,CAAC;AAEhB,MAAM,MAAM,cAAc,GAAG,oBAAoB,GAC/C,CAAC,sBAAsB,GAAG,mBAAmB,CAAC,CAAC;AAEjD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,+GAgDpB,CAAC"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
1
2
|
import type { Color } from './colors';
|
|
2
3
|
export type Size = 'sm' | 'md' | 'lg';
|
|
3
4
|
export type PortalProps = {
|
|
@@ -16,4 +17,17 @@ export type DefaultProps = {
|
|
|
16
17
|
*/
|
|
17
18
|
'data-color'?: Color;
|
|
18
19
|
};
|
|
20
|
+
export type LabelRequired = {
|
|
21
|
+
'aria-label': string;
|
|
22
|
+
'aria-labelledby'?: never;
|
|
23
|
+
label?: never;
|
|
24
|
+
} | {
|
|
25
|
+
'aria-label'?: never;
|
|
26
|
+
'aria-labelledby'?: never;
|
|
27
|
+
label: ReactNode;
|
|
28
|
+
} | {
|
|
29
|
+
'aria-label'?: never;
|
|
30
|
+
'aria-labelledby': string;
|
|
31
|
+
label?: never;
|
|
32
|
+
};
|
|
19
33
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEtC,MAAM,MAAM,WAAW,GAAG;IACxB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC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