@digdir/designsystemet-react 1.0.0-rc.1 → 1.0.0-rc.3

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.
@@ -8,7 +8,7 @@ var index = require('../../node_modules/@radix-ui/react-slot/dist/index.js');
8
8
 
9
9
  const Link = React.forwardRef(({ asChild, children, className, inverted = false, ...rest }, ref) => {
10
10
  const Component = asChild ? index.Slot : 'a';
11
- return (jsxRuntime.jsx(Component, { className: lite.clsx('fds-link', className), ref: ref, "data-ds-theme": inverted ? 'dark' : undefined, ...rest, children: children }));
11
+ return (jsxRuntime.jsx(Component, { className: lite.clsx('fds-link', className), ref: ref, "data-ds-color-mode": inverted ? 'dark' : undefined, ...rest, children: children }));
12
12
  });
13
13
  Link.displayName = 'Link';
14
14
 
@@ -21,7 +21,7 @@ const Spinner = ({ title, variant = 'default', className, style, ...rest }) => {
21
21
  const strokeRef = useSynchronizedAnimation.useSynchronizedAnimation('fds-spinner-stroke-animation');
22
22
  return (jsxRuntime.jsxs("svg", { className: lite.clsx('fds-spinner', variant !== 'inverted'
23
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 })] }));
24
+ : 'fds-spinner--default', className), "data-ds-color-mode": 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 })] }));
25
25
  };
26
26
  Spinner.displayName = 'Spinner';
27
27
 
@@ -77,7 +77,7 @@ 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": inverted ? 'light' : 'dark', ...getFloatingProps({
80
+ })), internalOpen && (jsxRuntime.jsx(Container, { children: jsxRuntime.jsxs("div", { ref: refs.setFloating, style: { ...floatingStyles, ...animationStyles, ...style }, role: 'tooltip', "data-ds-color-mode": inverted ? 'light' : 'dark', ...getFloatingProps({
81
81
  className: lite.clsx('fds-tooltip', className),
82
82
  ref: mergedRef,
83
83
  ...rest,
@@ -14,7 +14,7 @@ var Paragraph = require('../../Typography/Paragraph/Paragraph.js');
14
14
  const NativeSelect = React.forwardRef((props, ref) => {
15
15
  const { children, disabled = false, label, description, hideLabel = false, error, className, htmlSize = 0, ...rest } = props;
16
16
  const { selectProps, descriptionId, errorId, readOnly = false, size = 'md', } = useNativeSelect.useNativeSelect(props);
17
- return (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, children: jsxRuntime.jsxs("div", { className: lite.clsx('fds-native-select--container', disabled && 'fds-native-select--disabled', readOnly && 'fds-native-select--readonly', error && 'fds-native-select--error'), children: [label && (jsxRuntime.jsxs(Label.Label, { weight: 'medium', size: size, htmlFor: selectProps.id, className: lite.clsx('fds-native-select__label', hideLabel && 'fds-sr-only'), children: [readOnly && (jsxRuntime.jsx(akselIcons.PadlockLockedFillIcon, { "aria-hidden": true, className: 'fds-native-select__readonly__icon' })), label] })), description && (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, children: jsxRuntime.jsx("div", { id: descriptionId, className: lite.clsx(`fds-native-select__description`, hideLabel && `fds-sr-only`), children: description }) })), jsxRuntime.jsx("select", { disabled: disabled || readOnly, ref: ref, size: htmlSize, className: lite.clsx('fds-native-select', `fds-native-select--${size}`, `fds-focus`, props.multiple && 'fds-native-select--multiple', className), ...objectUtils.omit(['size', 'error', 'errorId'], rest), ...objectUtils.omit(['readOnly', 'disabled'], selectProps), children: children }), error && (jsxRuntime.jsx("div", { id: errorId, className: 'fds-native-select__error-message', "aria-live": 'polite', "aria-relevant": 'additions removals', children: jsxRuntime.jsx(ErrorMessage.ErrorMessage, { size: size, children: error }) }))] }) }));
17
+ return (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, children: jsxRuntime.jsxs("div", { className: lite.clsx('fds-native-select--container', disabled && 'fds-native-select--disabled', readOnly && 'fds-native-select--readonly', error && 'fds-native-select--error'), children: [label && (jsxRuntime.jsxs(Label.Label, { weight: 'medium', size: size, htmlFor: selectProps.id, className: lite.clsx('fds-native-select__label', hideLabel && 'fds-sr-only'), children: [readOnly && (jsxRuntime.jsx(akselIcons.PadlockLockedFillIcon, { "aria-hidden": true, className: 'fds-native-select__readonly__icon' })), label] })), description && (jsxRuntime.jsx(Paragraph.Paragraph, { asChild: true, size: size, children: jsxRuntime.jsx("div", { id: descriptionId, className: lite.clsx(`fds-native-select__description`, hideLabel && `fds-sr-only`), children: description }) })), jsxRuntime.jsx("div", { className: 'fds-native-select__wrapper', children: jsxRuntime.jsx("select", { disabled: disabled || readOnly, ref: ref, size: htmlSize, className: lite.clsx('fds-native-select', `fds-native-select--${size}`, `fds-focus`, props.multiple && 'fds-native-select--multiple', className), ...objectUtils.omit(['size', 'error', 'errorId'], rest), ...objectUtils.omit(['readOnly', 'disabled'], selectProps), children: children }) }), error && (jsxRuntime.jsx("div", { id: errorId, className: 'fds-native-select__error-message', "aria-live": 'polite', "aria-relevant": 'additions removals', children: jsxRuntime.jsx(ErrorMessage.ErrorMessage, { size: size, children: error }) }))] }) }));
18
18
  });
19
19
  NativeSelect.displayName = 'NativeSelect';
20
20
 
@@ -6,7 +6,7 @@ import { Slot as $5e63c961fc1ce211$export$8c6ed5c666ac1360 } from '../../node_mo
6
6
 
7
7
  const Link = forwardRef(({ asChild, children, className, inverted = false, ...rest }, ref) => {
8
8
  const Component = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : 'a';
9
- return (jsx(Component, { className: clsx('fds-link', className), ref: ref, "data-ds-theme": inverted ? 'dark' : undefined, ...rest, children: children }));
9
+ return (jsx(Component, { className: clsx('fds-link', className), ref: ref, "data-ds-color-mode": inverted ? 'dark' : undefined, ...rest, children: children }));
10
10
  });
11
11
  Link.displayName = 'Link';
12
12
 
@@ -19,7 +19,7 @@ const Spinner = ({ title, variant = 'default', className, style, ...rest }) => {
19
19
  const strokeRef = useSynchronizedAnimation('fds-spinner-stroke-animation');
20
20
  return (jsxs("svg", { className: clsx('fds-spinner', variant !== 'inverted'
21
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 })] }));
22
+ : 'fds-spinner--default', className), "data-ds-color-mode": 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 })] }));
23
23
  };
24
24
  Spinner.displayName = 'Spinner';
25
25
 
@@ -57,7 +57,7 @@ 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": inverted ? 'light' : 'dark', ...getFloatingProps({
60
+ })), internalOpen && (jsx(Container, { children: jsxs("div", { ref: refs.setFloating, style: { ...floatingStyles, ...animationStyles, ...style }, role: 'tooltip', "data-ds-color-mode": inverted ? 'light' : 'dark', ...getFloatingProps({
61
61
  className: clsx('fds-tooltip', className),
62
62
  ref: mergedRef,
63
63
  ...rest,
@@ -12,7 +12,7 @@ import { Paragraph } from '../../Typography/Paragraph/Paragraph.js';
12
12
  const NativeSelect = forwardRef((props, ref) => {
13
13
  const { children, disabled = false, label, description, hideLabel = false, error, className, htmlSize = 0, ...rest } = props;
14
14
  const { selectProps, descriptionId, errorId, readOnly = false, size = 'md', } = useNativeSelect(props);
15
- return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { className: clsx('fds-native-select--container', disabled && 'fds-native-select--disabled', readOnly && 'fds-native-select--readonly', error && 'fds-native-select--error'), children: [label && (jsxs(Label, { weight: 'medium', size: size, htmlFor: selectProps.id, className: clsx('fds-native-select__label', hideLabel && 'fds-sr-only'), children: [readOnly && (jsx(PadlockLockedFillIcon, { "aria-hidden": true, className: 'fds-native-select__readonly__icon' })), label] })), description && (jsx(Paragraph, { asChild: true, size: size, children: jsx("div", { id: descriptionId, className: clsx(`fds-native-select__description`, hideLabel && `fds-sr-only`), children: description }) })), jsx("select", { disabled: disabled || readOnly, ref: ref, size: htmlSize, className: clsx('fds-native-select', `fds-native-select--${size}`, `fds-focus`, props.multiple && 'fds-native-select--multiple', className), ...omit(['size', 'error', 'errorId'], rest), ...omit(['readOnly', 'disabled'], selectProps), children: children }), error && (jsx("div", { id: errorId, className: 'fds-native-select__error-message', "aria-live": 'polite', "aria-relevant": 'additions removals', children: jsx(ErrorMessage, { size: size, children: error }) }))] }) }));
15
+ return (jsx(Paragraph, { asChild: true, size: size, children: jsxs("div", { className: clsx('fds-native-select--container', disabled && 'fds-native-select--disabled', readOnly && 'fds-native-select--readonly', error && 'fds-native-select--error'), children: [label && (jsxs(Label, { weight: 'medium', size: size, htmlFor: selectProps.id, className: clsx('fds-native-select__label', hideLabel && 'fds-sr-only'), children: [readOnly && (jsx(PadlockLockedFillIcon, { "aria-hidden": true, className: 'fds-native-select__readonly__icon' })), label] })), description && (jsx(Paragraph, { asChild: true, size: size, children: jsx("div", { id: descriptionId, className: clsx(`fds-native-select__description`, hideLabel && `fds-sr-only`), children: description }) })), jsx("div", { className: 'fds-native-select__wrapper', children: jsx("select", { disabled: disabled || readOnly, ref: ref, size: htmlSize, className: clsx('fds-native-select', `fds-native-select--${size}`, `fds-focus`, props.multiple && 'fds-native-select--multiple', className), ...omit(['size', 'error', 'errorId'], rest), ...omit(['readOnly', 'disabled'], selectProps), children: children }) }), error && (jsx("div", { id: errorId, className: 'fds-native-select__error-message', "aria-live": 'polite', "aria-relevant": 'additions removals', children: jsx(ErrorMessage, { size: size, children: error }) }))] }) }));
16
16
  });
17
17
  NativeSelect.displayName = 'NativeSelect';
18
18
 
@@ -6,7 +6,7 @@ export type LinkProps = {
6
6
  className?: string;
7
7
  /**
8
8
  * Inverts the color of the link. Use this on dark backgrounds.
9
- * @deprecated Use `data-ds-theme="dark"` instead.
9
+ * @deprecated Use `data-ds-color-mode="dark"` instead.
10
10
  */
11
11
  inverted?: boolean;
12
12
  /** The URL that the link points to. This can also be an email address (starting with `mailto:`) or a phone number (staring with `tel:`). */
@@ -24,7 +24,7 @@ export declare const Link: import("react").ForwardRefExoticComponent<{
24
24
  className?: string | undefined;
25
25
  /**
26
26
  * Inverts the color of the link. Use this on dark backgrounds.
27
- * @deprecated Use `data-ds-theme="dark"` instead.
27
+ * @deprecated Use `data-ds-color-mode="dark"` instead.
28
28
  */
29
29
  inverted?: boolean | undefined;
30
30
  /** The URL that the link points to. This can also be an email address (starting with `mailto:`) or a phone number (staring with `tel:`). */
@@ -25,7 +25,7 @@ export type TooltipProps = {
25
25
  defaultOpen?: boolean;
26
26
  /**
27
27
  * Inverts the color of the tooltip. Use this on dark backgrounds.
28
- * @deprecated Use the `data-ds-theme` attribute instead.
28
+ * @deprecated Use the `data-ds-color-mode` attribute instead.
29
29
  */
30
30
  inverted?: boolean;
31
31
  /**
@@ -60,7 +60,7 @@ export declare const Tooltip: React.ForwardRefExoticComponent<{
60
60
  defaultOpen?: boolean | undefined;
61
61
  /**
62
62
  * Inverts the color of the tooltip. Use this on dark backgrounds.
63
- * @deprecated Use the `data-ds-theme` attribute instead.
63
+ * @deprecated Use the `data-ds-color-mode` attribute instead.
64
64
  */
65
65
  inverted?: boolean | undefined;
66
66
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"NativeSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/NativeSelect/NativeSelect.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAgB,SAAS,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAS3E,KAAK,oBAAoB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzD,MAAM,MAAM,iBAAiB,GAAG;IAC9B;iDAC6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;SAGK;IACL,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,WAAW,CAAC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;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,CAAC;AAE1D,eAAO,MAAM,YAAY;IAhCvB;iDAC6C;;IAE7C;;;SAGK;;IAEL;;OAEG;kBACW,SAAS;IACvB,gDAAgD;;IAEhD;;;;QAII;;IAEJ,mCAAmC;YAC3B,SAAS;IACjB;;OAEG;;IAEH;;OAEG;;6GA2GJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digdir/designsystemet-react",
3
- "version": "1.0.0-rc.1",
3
+ "version": "1.0.0-rc.3",
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": "8840f56d037879099652b2c7275ce08e93584f74"
42
+ "gitHead": "f9920518e77e01f2f77095ef30f8d4c62deafd51"
43
43
  }