@digdir/designsystemet-react 1.0.0-rc.0 → 1.0.0-rc.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/dist/cjs/components/ErrorSummary/ErrorSummaryHeading.js +1 -1
- package/dist/cjs/components/SkipLink/SkipLink.js +1 -1
- package/dist/cjs/components/Spinner/Spinner.js +3 -1
- package/dist/cjs/components/Tooltip/Tooltip.js +2 -2
- package/dist/esm/components/ErrorSummary/ErrorSummaryHeading.js +1 -1
- package/dist/esm/components/SkipLink/SkipLink.js +1 -1
- package/dist/esm/components/Spinner/Spinner.js +3 -1
- package/dist/esm/components/Tooltip/Tooltip.js +2 -2
- package/dist/types/components/ErrorSummary/ErrorSummaryHeading.d.ts.map +1 -1
- package/dist/types/components/Spinner/Spinner.d.ts +5 -1
- package/dist/types/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/types/components/Tooltip/Tooltip.d.ts +8 -2
- package/dist/types/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -13,7 +13,7 @@ const ErrorSummaryHeading = ({ id, ...rest }) => {
|
|
|
13
13
|
setHeadingId(id);
|
|
14
14
|
}
|
|
15
15
|
}, [headingId, id, setHeadingId]);
|
|
16
|
-
return (jsxRuntime.jsx(index.List.Heading, { ...rest, id: headingId }));
|
|
16
|
+
return (jsxRuntime.jsx(index.List.Heading, { ...rest, id: headingId, className: 'fds-error-summary__heading' }));
|
|
17
17
|
};
|
|
18
18
|
ErrorSummaryHeading.displayName = 'ErrorSummaryHeading';
|
|
19
19
|
|
|
@@ -5,7 +5,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
5
5
|
var lite = require('../../node_modules/clsx/dist/lite.js');
|
|
6
6
|
|
|
7
7
|
const SkipLink = ({ href, children, className, ...rest }) => {
|
|
8
|
-
return (jsxRuntime.jsx("a", { href: href, className: lite.clsx(`fds-sr-only`, 'fds-skiplink', className), ...rest, children: children }));
|
|
8
|
+
return (jsxRuntime.jsx("a", { href: href, className: lite.clsx(`fds-sr-only`, 'fds-skiplink', className), ...rest, children: jsxRuntime.jsx("p", { className: 'fds-skiplink__content', children: children }) }));
|
|
9
9
|
};
|
|
10
10
|
SkipLink.displayName = 'SkipLink';
|
|
11
11
|
|
|
@@ -19,7 +19,9 @@ const Spinner = ({ title, variant = 'default', className, style, ...rest }) => {
|
|
|
19
19
|
const size = getSize.getSize(rest.size || 'md');
|
|
20
20
|
const svgRef = useSynchronizedAnimation.useSynchronizedAnimation('fds-spinner-rotate-animation');
|
|
21
21
|
const strokeRef = useSynchronizedAnimation.useSynchronizedAnimation('fds-spinner-stroke-animation');
|
|
22
|
-
return (jsxRuntime.jsxs("svg", { className: lite.clsx('fds-spinner',
|
|
22
|
+
return (jsxRuntime.jsxs("svg", { className: lite.clsx('fds-spinner', variant !== 'inverted'
|
|
23
|
+
? `fds-spinner--${variant}`
|
|
24
|
+
: 'fds-spinner--default', className), "data-ds-theme": variant === 'inverted' ? 'dark' : undefined, style: { width: sizeMap[size], height: sizeMap[size], ...style }, viewBox: '0 0 50 50', ref: svgRef, ...rest, children: [jsxRuntime.jsx("title", { children: title }), jsxRuntime.jsx("circle", { className: lite.clsx('fds-spinner__background', variant === 'inverted' && 'fds-spinner__background--inverted'), cx: '25', cy: '25', r: '20', fill: 'none', strokeWidth: '5' }), jsxRuntime.jsx("circle", { className: lite.clsx(`fds-spinner__circle`), cx: '25', cy: '25', r: '20', fill: 'none', strokeWidth: '5', ref: strokeRef })] }));
|
|
23
25
|
};
|
|
24
26
|
Spinner.displayName = 'Spinner';
|
|
25
27
|
|
|
@@ -77,8 +77,8 @@ const Tooltip = React.forwardRef(({ children, content, placement = 'top', delay
|
|
|
77
77
|
}
|
|
78
78
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [React.cloneElement(children, getReferenceProps({
|
|
79
79
|
ref: childMergedRef,
|
|
80
|
-
})), internalOpen && (jsxRuntime.jsx(Container, { children: jsxRuntime.jsxs("div", { ref: refs.setFloating, style: { ...floatingStyles, ...animationStyles, ...style }, role: 'tooltip', "data-ds-theme": 'dark', ...getFloatingProps({
|
|
81
|
-
className: lite.clsx('fds-tooltip',
|
|
80
|
+
})), internalOpen && (jsxRuntime.jsx(Container, { children: jsxRuntime.jsxs("div", { ref: refs.setFloating, style: { ...floatingStyles, ...animationStyles, ...style }, role: 'tooltip', "data-ds-theme": inverted ? 'light' : 'dark', ...getFloatingProps({
|
|
81
|
+
className: lite.clsx('fds-tooltip', className),
|
|
82
82
|
ref: mergedRef,
|
|
83
83
|
...rest,
|
|
84
84
|
}), children: [content, jsxRuntime.jsx(floatingUi_react.FloatingArrow, { ref: arrowRef, context: context, className: 'fds-tooltip__arrow', height: ARROW_HEIGHT })] }) }))] }));
|
|
@@ -11,7 +11,7 @@ const ErrorSummaryHeading = ({ id, ...rest }) => {
|
|
|
11
11
|
setHeadingId(id);
|
|
12
12
|
}
|
|
13
13
|
}, [headingId, id, setHeadingId]);
|
|
14
|
-
return (jsx(List.Heading, { ...rest, id: headingId }));
|
|
14
|
+
return (jsx(List.Heading, { ...rest, id: headingId, className: 'fds-error-summary__heading' }));
|
|
15
15
|
};
|
|
16
16
|
ErrorSummaryHeading.displayName = 'ErrorSummaryHeading';
|
|
17
17
|
|
|
@@ -3,7 +3,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { clsx } from '../../node_modules/clsx/dist/lite.js';
|
|
4
4
|
|
|
5
5
|
const SkipLink = ({ href, children, className, ...rest }) => {
|
|
6
|
-
return (jsx("a", { href: href, className: clsx(`fds-sr-only`, 'fds-skiplink', className), ...rest, children: children }));
|
|
6
|
+
return (jsx("a", { href: href, className: clsx(`fds-sr-only`, 'fds-skiplink', className), ...rest, children: jsx("p", { className: 'fds-skiplink__content', children: children }) }));
|
|
7
7
|
};
|
|
8
8
|
SkipLink.displayName = 'SkipLink';
|
|
9
9
|
|
|
@@ -17,7 +17,9 @@ const Spinner = ({ title, variant = 'default', className, style, ...rest }) => {
|
|
|
17
17
|
const size = getSize(rest.size || 'md');
|
|
18
18
|
const svgRef = useSynchronizedAnimation('fds-spinner-rotate-animation');
|
|
19
19
|
const strokeRef = useSynchronizedAnimation('fds-spinner-stroke-animation');
|
|
20
|
-
return (jsxs("svg", { className: clsx('fds-spinner',
|
|
20
|
+
return (jsxs("svg", { className: clsx('fds-spinner', variant !== 'inverted'
|
|
21
|
+
? `fds-spinner--${variant}`
|
|
22
|
+
: 'fds-spinner--default', className), "data-ds-theme": variant === 'inverted' ? 'dark' : undefined, style: { width: sizeMap[size], height: sizeMap[size], ...style }, viewBox: '0 0 50 50', ref: svgRef, ...rest, children: [jsx("title", { children: title }), jsx("circle", { className: clsx('fds-spinner__background', variant === 'inverted' && 'fds-spinner__background--inverted'), cx: '25', cy: '25', r: '20', fill: 'none', strokeWidth: '5' }), jsx("circle", { className: clsx(`fds-spinner__circle`), cx: '25', cy: '25', r: '20', fill: 'none', strokeWidth: '5', ref: strokeRef })] }));
|
|
21
23
|
};
|
|
22
24
|
Spinner.displayName = 'Spinner';
|
|
23
25
|
|
|
@@ -57,8 +57,8 @@ const Tooltip = forwardRef(({ children, content, placement = 'top', delay = 150,
|
|
|
57
57
|
}
|
|
58
58
|
return (jsxs(Fragment, { children: [cloneElement(children, getReferenceProps({
|
|
59
59
|
ref: childMergedRef,
|
|
60
|
-
})), internalOpen && (jsx(Container, { children: jsxs("div", { ref: refs.setFloating, style: { ...floatingStyles, ...animationStyles, ...style }, role: 'tooltip', "data-ds-theme": 'dark', ...getFloatingProps({
|
|
61
|
-
className: clsx('fds-tooltip',
|
|
60
|
+
})), internalOpen && (jsx(Container, { children: jsxs("div", { ref: refs.setFloating, style: { ...floatingStyles, ...animationStyles, ...style }, role: 'tooltip', "data-ds-theme": inverted ? 'light' : 'dark', ...getFloatingProps({
|
|
61
|
+
className: clsx('fds-tooltip', className),
|
|
62
62
|
ref: mergedRef,
|
|
63
63
|
...rest,
|
|
64
64
|
}), children: [content, jsx(FloatingArrow, { ref: arrowRef, context: context, className: 'fds-tooltip__arrow', height: ARROW_HEIGHT })] }) }))] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorSummaryHeading.d.ts","sourceRoot":"","sources":["../../../../src/components/ErrorSummary/ErrorSummaryHeading.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAKhD,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,CAAC;AAExD,eAAO,MAAM,mBAAmB;sBAG7B,wBAAwB;;
|
|
1
|
+
{"version":3,"file":"ErrorSummaryHeading.d.ts","sourceRoot":"","sources":["../../../../src/components/ErrorSummary/ErrorSummaryHeading.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAKhD,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,CAAC;AAExD,eAAO,MAAM,mBAAmB;sBAG7B,wBAAwB;;CAgB1B,CAAC"}
|
|
@@ -10,7 +10,11 @@ export type SpinnerProps = {
|
|
|
10
10
|
* @note `xxsmall`, `xsmall`, `small`, `medium`, `large`, `xlarge` is deprecated
|
|
11
11
|
*/
|
|
12
12
|
size?: '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | OldSpinnerSizes;
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Spinner appearance
|
|
15
|
+
* @default default
|
|
16
|
+
* @note `inverted` is deprecated
|
|
17
|
+
*/
|
|
14
18
|
variant?: 'default' | 'interaction' | 'inverted';
|
|
15
19
|
} & React.ComponentPropsWithoutRef<'svg'>;
|
|
16
20
|
/** Spinner component used for indicating busy or indeterminate loading */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../../../src/components/Spinner/Spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAMpC,KAAK,eAAe,GAChB,SAAS,GACT,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,OAAO,GACP,QAAQ,CAAC;AAab,MAAM,MAAM,YAAY,GAAG;IACzB,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,eAAe,CAAC;IAClE
|
|
1
|
+
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../../../src/components/Spinner/Spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAMpC,KAAK,eAAe,GAChB,SAAS,GACT,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,OAAO,GACP,QAAQ,CAAC;AAab,MAAM,MAAM,YAAY,GAAG;IACzB,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,eAAe,CAAC;IAClE;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC;CAClD,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;AAE1C,2EAA2E;AAC3E,eAAO,MAAM,OAAO;oDAMjB,YAAY,GAAG,WAAW;;CAuD5B,CAAC"}
|
|
@@ -23,7 +23,10 @@ export type TooltipProps = {
|
|
|
23
23
|
open?: boolean;
|
|
24
24
|
/** Whether the tooltip is open by default or not. */
|
|
25
25
|
defaultOpen?: boolean;
|
|
26
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Inverts the color of the tooltip. Use this on dark backgrounds.
|
|
28
|
+
* @deprecated Use the `data-ds-theme` attribute instead.
|
|
29
|
+
*/
|
|
27
30
|
inverted?: boolean;
|
|
28
31
|
/**
|
|
29
32
|
* Portals the floating element outside of the app root and into the body.
|
|
@@ -55,7 +58,10 @@ export declare const Tooltip: React.ForwardRefExoticComponent<{
|
|
|
55
58
|
open?: boolean | undefined;
|
|
56
59
|
/** Whether the tooltip is open by default or not. */
|
|
57
60
|
defaultOpen?: boolean | undefined;
|
|
58
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* Inverts the color of the tooltip. Use this on dark backgrounds.
|
|
63
|
+
* @deprecated Use the `data-ds-theme` attribute instead.
|
|
64
|
+
*/
|
|
59
65
|
inverted?: boolean | undefined;
|
|
60
66
|
/**
|
|
61
67
|
* Portals the floating element outside of the app root and into the body.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAuB/B,MAAM,MAAM,YAAY,GAAG;IACzB;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAChE,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAChD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,qDAAqD;IACrD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAuB/B,MAAM,MAAM,YAAY,GAAG;IACzB;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAChE,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAChD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,qDAAqD;IACrD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO;IAnClB;;;OAGG;cACO,MAAM,YAAY,GAAG,MAAM,aAAa,CAAC,WAAW,CAAC;IAC/D,6BAA6B;aACpB,MAAM;IACf;;;OAGG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH,qDAAqD;;IAErD;;;OAGG;;IAEH;;;;OAIG;;yEAgHJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digdir/designsystemet-react",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.1",
|
|
4
4
|
"description": "React components for Designsystemet",
|
|
5
5
|
"author": "Designsystemet team",
|
|
6
6
|
"repository": "https://github.com/digdir/designsystemet",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"rollup": "^4.12.1",
|
|
40
40
|
"typescript": "^5.4.2"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "8840f56d037879099652b2c7275ce08e93584f74"
|
|
43
43
|
}
|