@digdir/designsystemet-react 1.13.3 → 1.15.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.
Files changed (44) hide show
  1. package/dist/cjs/components/checkbox/checkbox.js +2 -2
  2. package/dist/cjs/components/dialog/dialog.js +5 -1
  3. package/dist/cjs/components/popover/popover.js +26 -10
  4. package/dist/cjs/components/radio/radio.js +2 -2
  5. package/dist/cjs/components/suggestion/suggestion-clear.js +2 -4
  6. package/dist/cjs/components/switch/switch.js +2 -2
  7. package/dist/cjs/components/tooltip/tooltip.js +1 -1
  8. package/dist/cjs/utilities/hooks/use-checkbox-group/use-checkbox-group.js +8 -2
  9. package/dist/cjs/utilities/hooks/use-radio-group/use-radio-group.js +11 -4
  10. package/dist/esm/components/checkbox/checkbox.js +2 -2
  11. package/dist/esm/components/dialog/dialog.js +5 -1
  12. package/dist/esm/components/popover/popover.js +26 -10
  13. package/dist/esm/components/radio/radio.js +2 -2
  14. package/dist/esm/components/suggestion/suggestion-clear.js +2 -4
  15. package/dist/esm/components/switch/switch.js +2 -2
  16. package/dist/esm/components/tooltip/tooltip.js +1 -1
  17. package/dist/esm/utilities/hooks/use-checkbox-group/use-checkbox-group.js +8 -2
  18. package/dist/esm/utilities/hooks/use-radio-group/use-radio-group.js +11 -4
  19. package/dist/types/components/button/button.d.ts +1 -1
  20. package/dist/types/components/checkbox/checkbox.d.ts +4 -0
  21. package/dist/types/components/checkbox/checkbox.d.ts.map +1 -1
  22. package/dist/types/components/dialog/dialog-trigger.d.ts +1 -1
  23. package/dist/types/components/dialog/dialog.d.ts.map +1 -1
  24. package/dist/types/components/error-summary/error-summary.d.ts +3 -2
  25. package/dist/types/components/error-summary/error-summary.d.ts.map +1 -1
  26. package/dist/types/components/heading/heading.d.ts +0 -2
  27. package/dist/types/components/heading/heading.d.ts.map +1 -1
  28. package/dist/types/components/popover/popover.d.ts.map +1 -1
  29. package/dist/types/components/radio/radio.d.ts +4 -0
  30. package/dist/types/components/radio/radio.d.ts.map +1 -1
  31. package/dist/types/components/search/search-button.d.ts +1 -1
  32. package/dist/types/components/suggestion/suggestion-clear.d.ts +4 -4
  33. package/dist/types/components/suggestion/suggestion-clear.d.ts.map +1 -1
  34. package/dist/types/components/suggestion/suggestion-input.d.ts +2 -9
  35. package/dist/types/components/suggestion/suggestion-input.d.ts.map +1 -1
  36. package/dist/types/components/switch/switch.d.ts +4 -0
  37. package/dist/types/components/switch/switch.d.ts.map +1 -1
  38. package/dist/types/components/tooltip/tooltip.d.ts +4 -4
  39. package/dist/types/components/tooltip/tooltip.d.ts.map +1 -1
  40. package/dist/types/utilities/hooks/use-checkbox-group/use-checkbox-group.d.ts +4 -0
  41. package/dist/types/utilities/hooks/use-checkbox-group/use-checkbox-group.d.ts.map +1 -1
  42. package/dist/types/utilities/hooks/use-radio-group/use-radio-group.d.ts +5 -1
  43. package/dist/types/utilities/hooks/use-radio-group/use-radio-group.d.ts.map +1 -1
  44. package/package.json +14 -14
@@ -14,8 +14,8 @@ var validationMessage = require('../validation-message/validation-message.js');
14
14
  * @example
15
15
  * <Checkbox label="I agree" value="agree" />
16
16
  */
17
- const Checkbox = react.forwardRef(function Checkbox({ 'data-size': size, className, style, children, label: label$1, description, error, ...rest }, ref) {
18
- return (jsxRuntime.jsxs(index.Field, { "data-size": size, className: className, style: style, children: [jsxRuntime.jsx(input.Input, { type: 'checkbox', ref: ref, ...rest }), !!label$1 && jsxRuntime.jsx(label.Label, { weight: 'regular', children: label$1 }), !!description && jsxRuntime.jsx("div", { "data-field": 'description', children: description }), !!error && jsxRuntime.jsx(validationMessage.ValidationMessage, { children: error })] }));
17
+ const Checkbox = react.forwardRef(function Checkbox({ 'data-size': size, className, style, children, label: label$1, description, error, variant, ...rest }, ref) {
18
+ return (jsxRuntime.jsxs(index.Field, { "data-size": size, "data-variant": variant, className: className, style: style, children: [jsxRuntime.jsx(input.Input, { type: 'checkbox', ref: ref, ...rest }), !!label$1 && jsxRuntime.jsx(label.Label, { weight: 'regular', children: label$1 }), !!description && jsxRuntime.jsx("div", { "data-field": 'description', children: description }), !!error && jsxRuntime.jsx(validationMessage.ValidationMessage, { children: error })] }));
19
19
  });
20
20
 
21
21
  exports.Checkbox = Checkbox;
@@ -43,7 +43,11 @@ const Dialog = react.forwardRef(function Dialog({ asChild, children, className,
43
43
  const usedId = id ?? autoId;
44
44
  // Toggle open based on prop
45
45
  react.useEffect(() => dialogRef.current?.[open ? showProp : 'close'](), [open]);
46
- return (jsxRuntime.jsxs(Component, { className: cl('ds-dialog', className), "data-placement": placement, "data-modal": modal, id: usedId, onClose: (event) => onClose?.(event.nativeEvent), onClick: (event) => {
46
+ return (jsxRuntime.jsxs(Component, { className: cl('ds-dialog', className), "data-placement": placement, "data-modal": modal, id: usedId, onClose: (event) => {
47
+ if (event.target !== event.currentTarget)
48
+ return; // Ignore close events from nested dialogs
49
+ onClose?.(event.nativeEvent); // Backward compatibility: expose native event
50
+ }, onClick: (event) => {
47
51
  onClick?.(event);
48
52
  const { currentTarget: dialog, target: el, defaultPrevented } = event;
49
53
  const isClose = el?.closest?.('[data-command="close"]');
@@ -53,16 +53,12 @@ const Popover = react.forwardRef(function Popover({ id, className, onClose, onOp
53
53
  }
54
54
  };
55
55
  const handleKeydown = (event) => {
56
- if (event.key !== 'Escape' || !controlledOpen)
57
- return;
58
- const isOpen = popoverRef.current?.matches(':popover-open') ||
59
- popoverRef.current?.classList.contains(':popover-open'); // Polyfill support
60
- if (!isOpen)
61
- return;
62
- event.preventDefault(); // Prevent closing fullscreen in Safari
63
- document.querySelector(trigger)?.focus?.(); // Move focus back to trigger since `popoover="manual"` doesn't do this
64
- setInternalOpen(false);
65
- onClose?.();
56
+ if (event.key === 'Escape' && controlledOpen && isTopLayer(popover)) {
57
+ event.preventDefault(); // Prevent closing fullscreen in Safari
58
+ document.querySelector(trigger)?.focus?.(); // Move focus back to trigger since `popover="manual"` doesn't do this
59
+ setInternalOpen(false);
60
+ onClose?.();
61
+ }
66
62
  };
67
63
  popover?.togglePopover?.(controlledOpen);
68
64
  if (controlledOpen) {
@@ -84,5 +80,25 @@ const Popover = react.forwardRef(function Popover({ id, className, onClose, onOp
84
80
  return (jsxRuntime.jsx(Component, { className: cl('ds-popover', className), id: id || popoverId, popover: 'manual', "data-placement": placement, "data-variant": variant, ref: mergedRefs, suppressHydrationWarning // Since _ds-floating adds attributes
85
81
  : true, ...rest }));
86
82
  });
83
+ // NOTE: This is not able to check if the popover is the most recently added #topLayer,
84
+ // so we need another method in time, or remove the controlled popover="manual" in a v2
85
+ const isTopLayer = (checkElement) => {
86
+ if (!checkElement)
87
+ return false;
88
+ const { x, y, width, height } = checkElement.getBoundingClientRect();
89
+ const topElement = document.elementFromPoint(x + width / 2, y + height / 2);
90
+ // If the element on top is on browser #top-layer but not same as provided element, then provided element is not on top
91
+ for (let el = topElement; el; el = el.parentElement) {
92
+ if (checkElement === el)
93
+ return true; // If the topElement is same as provided element, it's on top
94
+ if (el instanceof HTMLDialogElement && el.open)
95
+ return false; // Check for open dialog
96
+ if (el.classList.contains(':popover-open'))
97
+ return false; // Polyfill support
98
+ if (el.matches(':popover-open'))
99
+ return false; // Native support
100
+ }
101
+ return false;
102
+ };
87
103
 
88
104
  exports.Popover = Popover;
@@ -14,8 +14,8 @@ var validationMessage = require('../validation-message/validation-message.js');
14
14
  * @example
15
15
  * <Radio label="I agree" value="agree" />
16
16
  */
17
- const Radio = react.forwardRef(function Radio({ 'data-size': size, className, style, children, label: label$1, description, error, ...rest }, ref) {
18
- return (jsxRuntime.jsxs(index.Field, { "data-size": size, className: className, style: style, children: [jsxRuntime.jsx(input.Input, { type: 'radio', ref: ref, ...rest }), !!label$1 && jsxRuntime.jsx(label.Label, { weight: 'regular', children: label$1 }), !!description && jsxRuntime.jsx("div", { "data-field": 'description', children: description }), !!error && jsxRuntime.jsx(validationMessage.ValidationMessage, { children: error })] }));
17
+ const Radio = react.forwardRef(function Radio({ 'data-size': size, className, style, children, label: label$1, description, error, variant, ...rest }, ref) {
18
+ return (jsxRuntime.jsxs(index.Field, { "data-size": size, "data-variant": variant, className: className, style: style, children: [jsxRuntime.jsx(input.Input, { type: 'radio', ref: ref, ...rest }), !!label$1 && jsxRuntime.jsx(label.Label, { weight: 'regular', children: label$1 }), !!description && jsxRuntime.jsx("div", { "data-field": 'description', children: description }), !!error && jsxRuntime.jsx(validationMessage.ValidationMessage, { children: error })] }));
19
19
  });
20
20
 
21
21
  exports.Radio = Radio;
@@ -17,10 +17,8 @@ var react = require('react');
17
17
  * </Suggestion>
18
18
  */
19
19
  const SuggestionClear = react.forwardRef(function SuggestionClear({ 'aria-label': label = 'Tøm', ...rest }, ref) {
20
- return (
21
- //biome-ignore lint/a11y/useAriaPropsSupportedByRole: <del> needs aria-label when u-combobox makes it the clear button
22
- jsxRuntime.jsx("del", { "aria-label": label, hidden: true, ref: ref, suppressHydrationWarning // Since <ds-suggestion> adds attributes
23
- : true, ...rest }));
20
+ return (jsxRuntime.jsx("button", { "aria-label": label, hidden: true, ref: ref, suppressHydrationWarning // Since <ds-suggestion> adds attributes
21
+ : true, type: 'reset', ...rest }));
24
22
  });
25
23
 
26
24
  exports.SuggestionClear = SuggestionClear;
@@ -13,8 +13,8 @@ var label = require('../label/label.js');
13
13
  * @example
14
14
  * <Switch label="I agree" value="agree" />
15
15
  */
16
- const Switch = react.forwardRef(function Switch({ 'data-size': size, children, className, description, label: label$1, position, style, ...rest }, ref) {
17
- return (jsxRuntime.jsxs(index.Field, { className: className, "data-position": position, "data-size": size, style: style, children: [jsxRuntime.jsx(input.Input, { type: 'checkbox', role: 'switch', ref: ref, ...rest }), !!label$1 && jsxRuntime.jsx(label.Label, { weight: 'regular', children: label$1 }), !!description && jsxRuntime.jsx("div", { "data-field": 'description', children: description })] }));
16
+ const Switch = react.forwardRef(function Switch({ 'data-size': size, children, className, description, label: label$1, position, style, variant, ...rest }, ref) {
17
+ return (jsxRuntime.jsxs(index.Field, { className: className, "data-position": position, "data-size": size, "data-variant": variant, style: style, children: [jsxRuntime.jsx(input.Input, { type: 'checkbox', role: 'switch', ref: ref, ...rest }), !!label$1 && jsxRuntime.jsx(label.Label, { weight: 'regular', children: label$1 }), !!description && jsxRuntime.jsx("div", { "data-field": 'description', children: description })] }));
18
18
  });
19
19
 
20
20
  exports.Switch = Switch;
@@ -22,7 +22,7 @@ var react = require('react');
22
22
  const Tooltip = react.forwardRef(function Tooltip({ content, placement = 'top', autoPlacement = true, ...rest }, ref) {
23
23
  /* check if children is a string */
24
24
  const isString = typeof rest.children === 'string';
25
- return (jsxRuntime.jsx(reactSlot.Slot, { "aria-label": content || undefined, "data-tooltip": content, "data-placement": placement, "data-autoplacement": autoPlacement, suppressHydrationWarning // Since data-tooltip adds aria-label/aria-description
25
+ return (jsxRuntime.jsx(reactSlot.Slot, { "data-tooltip": content, "data-placement": placement, "data-autoplacement": autoPlacement, suppressHydrationWarning // Since data-tooltip adds aria-label/aria-description
26
26
  : true, ref: ref, ...rest, children: isString ? jsxRuntime.jsx("span", { tabIndex: 0, children: rest.children }) : rest.children }));
27
27
  });
28
28
 
@@ -47,10 +47,15 @@ function useCheckboxGroup(props) {
47
47
  * <Checkbox {...getCheckboxProps({ value: 'all', allowIndeterminate: true })} />
48
48
  */
49
49
  getCheckboxProps: (propsOrValue) => {
50
- const props = typeof propsOrValue === 'string'
50
+ let groupProps;
51
+ if (props) {
52
+ const { onChange, error, ...rest } = props;
53
+ groupProps = rest;
54
+ }
55
+ const checkboxProps = typeof propsOrValue === 'string'
51
56
  ? { value: propsOrValue }
52
57
  : propsOrValue || {};
53
- const { allowIndeterminate = false, ref: forwardedRef = undefined, value = '', ...rest } = props;
58
+ const { allowIndeterminate = false, ref: forwardedRef = undefined, value = '', ...rest } = checkboxProps;
54
59
  const handleRef = (element) => {
55
60
  if (element) {
56
61
  const refs = allowIndeterminate ? indeterminateRefs : checkboxRefs;
@@ -92,6 +97,7 @@ function useCheckboxGroup(props) {
92
97
  }
93
98
  };
94
99
  return {
100
+ ...groupProps,
95
101
  ...rest,
96
102
  'aria-describedby': `${error ? errorId : ''} ${rest['aria-describedby'] || ''}`.trim() ||
97
103
  undefined,
@@ -16,8 +16,9 @@ var react = require('react');
16
16
  * value: '',
17
17
  * });
18
18
  */
19
- function useRadioGroup({ error, readOnly, required, disabled, name, onChange, value: initalValue = '', } = {}) {
20
- const [groupValue, setGroupValue] = react.useState(initalValue);
19
+ function useRadioGroup(props) {
20
+ const { error, readOnly, required, disabled, name, onChange, value: initialValue = '', } = props || {};
21
+ const [groupValue, setGroupValue] = react.useState(initialValue);
21
22
  const errorId = react.useId();
22
23
  const namedId = react.useId();
23
24
  const radioGroupName = name || namedId;
@@ -39,10 +40,15 @@ function useRadioGroup({ error, readOnly, required, disabled, name, onChange, va
39
40
  * <Radio label="Option 1" {...getRadioProps('option-1')} />
40
41
  */
41
42
  getRadioProps: (propsOrValue) => {
42
- const props = typeof propsOrValue === 'string'
43
+ let groupProps;
44
+ if (props) {
45
+ const { onChange, error, ...rest } = props;
46
+ groupProps = rest;
47
+ }
48
+ const radioProps = typeof propsOrValue === 'string'
43
49
  ? { value: propsOrValue }
44
50
  : propsOrValue;
45
- const { ref: forwardedRef = undefined, value = '', ...rest } = props;
51
+ const { ref: forwardedRef = undefined, value = '', ...rest } = radioProps;
46
52
  const handleRef = (element) => {
47
53
  if (element) {
48
54
  // Set initial checked state
@@ -67,6 +73,7 @@ function useRadioGroup({ error, readOnly, required, disabled, name, onChange, va
67
73
  }
68
74
  };
69
75
  return {
76
+ ...groupProps,
70
77
  ...rest,
71
78
  name: radioGroupName,
72
79
  'aria-describedby': `${error ? errorId : ''} ${rest['aria-describedby'] || ''}`.trim() ||
@@ -12,8 +12,8 @@ import { ValidationMessage } from '../validation-message/validation-message.js';
12
12
  * @example
13
13
  * <Checkbox label="I agree" value="agree" />
14
14
  */
15
- const Checkbox = forwardRef(function Checkbox({ 'data-size': size, className, style, children, label, description, error, ...rest }, ref) {
16
- return (jsxs(FieldComponent, { "data-size": size, className: className, style: style, children: [jsx(Input, { type: 'checkbox', ref: ref, ...rest }), !!label && jsx(Label, { weight: 'regular', children: label }), !!description && jsx("div", { "data-field": 'description', children: description }), !!error && jsx(ValidationMessage, { children: error })] }));
15
+ const Checkbox = forwardRef(function Checkbox({ 'data-size': size, className, style, children, label, description, error, variant, ...rest }, ref) {
16
+ return (jsxs(FieldComponent, { "data-size": size, "data-variant": variant, className: className, style: style, children: [jsx(Input, { type: 'checkbox', ref: ref, ...rest }), !!label && jsx(Label, { weight: 'regular', children: label }), !!description && jsx("div", { "data-field": 'description', children: description }), !!error && jsx(ValidationMessage, { children: error })] }));
17
17
  });
18
18
 
19
19
  export { Checkbox };
@@ -41,7 +41,11 @@ const Dialog = forwardRef(function Dialog({ asChild, children, className, closeB
41
41
  const usedId = id ?? autoId;
42
42
  // Toggle open based on prop
43
43
  useEffect(() => dialogRef.current?.[open ? showProp : 'close'](), [open]);
44
- return (jsxs(Component, { className: cl('ds-dialog', className), "data-placement": placement, "data-modal": modal, id: usedId, onClose: (event) => onClose?.(event.nativeEvent), onClick: (event) => {
44
+ return (jsxs(Component, { className: cl('ds-dialog', className), "data-placement": placement, "data-modal": modal, id: usedId, onClose: (event) => {
45
+ if (event.target !== event.currentTarget)
46
+ return; // Ignore close events from nested dialogs
47
+ onClose?.(event.nativeEvent); // Backward compatibility: expose native event
48
+ }, onClick: (event) => {
45
49
  onClick?.(event);
46
50
  const { currentTarget: dialog, target: el, defaultPrevented } = event;
47
51
  const isClose = el?.closest?.('[data-command="close"]');
@@ -51,16 +51,12 @@ const Popover = forwardRef(function Popover({ id, className, onClose, onOpen, op
51
51
  }
52
52
  };
53
53
  const handleKeydown = (event) => {
54
- if (event.key !== 'Escape' || !controlledOpen)
55
- return;
56
- const isOpen = popoverRef.current?.matches(':popover-open') ||
57
- popoverRef.current?.classList.contains(':popover-open'); // Polyfill support
58
- if (!isOpen)
59
- return;
60
- event.preventDefault(); // Prevent closing fullscreen in Safari
61
- document.querySelector(trigger)?.focus?.(); // Move focus back to trigger since `popoover="manual"` doesn't do this
62
- setInternalOpen(false);
63
- onClose?.();
54
+ if (event.key === 'Escape' && controlledOpen && isTopLayer(popover)) {
55
+ event.preventDefault(); // Prevent closing fullscreen in Safari
56
+ document.querySelector(trigger)?.focus?.(); // Move focus back to trigger since `popover="manual"` doesn't do this
57
+ setInternalOpen(false);
58
+ onClose?.();
59
+ }
64
60
  };
65
61
  popover?.togglePopover?.(controlledOpen);
66
62
  if (controlledOpen) {
@@ -82,5 +78,25 @@ const Popover = forwardRef(function Popover({ id, className, onClose, onOpen, op
82
78
  return (jsx(Component, { className: cl('ds-popover', className), id: id || popoverId, popover: 'manual', "data-placement": placement, "data-variant": variant, ref: mergedRefs, suppressHydrationWarning // Since _ds-floating adds attributes
83
79
  : true, ...rest }));
84
80
  });
81
+ // NOTE: This is not able to check if the popover is the most recently added #topLayer,
82
+ // so we need another method in time, or remove the controlled popover="manual" in a v2
83
+ const isTopLayer = (checkElement) => {
84
+ if (!checkElement)
85
+ return false;
86
+ const { x, y, width, height } = checkElement.getBoundingClientRect();
87
+ const topElement = document.elementFromPoint(x + width / 2, y + height / 2);
88
+ // If the element on top is on browser #top-layer but not same as provided element, then provided element is not on top
89
+ for (let el = topElement; el; el = el.parentElement) {
90
+ if (checkElement === el)
91
+ return true; // If the topElement is same as provided element, it's on top
92
+ if (el instanceof HTMLDialogElement && el.open)
93
+ return false; // Check for open dialog
94
+ if (el.classList.contains(':popover-open'))
95
+ return false; // Polyfill support
96
+ if (el.matches(':popover-open'))
97
+ return false; // Native support
98
+ }
99
+ return false;
100
+ };
85
101
 
86
102
  export { Popover };
@@ -12,8 +12,8 @@ import { ValidationMessage } from '../validation-message/validation-message.js';
12
12
  * @example
13
13
  * <Radio label="I agree" value="agree" />
14
14
  */
15
- const Radio = forwardRef(function Radio({ 'data-size': size, className, style, children, label, description, error, ...rest }, ref) {
16
- return (jsxs(FieldComponent, { "data-size": size, className: className, style: style, children: [jsx(Input, { type: 'radio', ref: ref, ...rest }), !!label && jsx(Label, { weight: 'regular', children: label }), !!description && jsx("div", { "data-field": 'description', children: description }), !!error && jsx(ValidationMessage, { children: error })] }));
15
+ const Radio = forwardRef(function Radio({ 'data-size': size, className, style, children, label, description, error, variant, ...rest }, ref) {
16
+ return (jsxs(FieldComponent, { "data-size": size, "data-variant": variant, className: className, style: style, children: [jsx(Input, { type: 'radio', ref: ref, ...rest }), !!label && jsx(Label, { weight: 'regular', children: label }), !!description && jsx("div", { "data-field": 'description', children: description }), !!error && jsx(ValidationMessage, { children: error })] }));
17
17
  });
18
18
 
19
19
  export { Radio };
@@ -15,10 +15,8 @@ import { forwardRef } from 'react';
15
15
  * </Suggestion>
16
16
  */
17
17
  const SuggestionClear = forwardRef(function SuggestionClear({ 'aria-label': label = 'Tøm', ...rest }, ref) {
18
- return (
19
- //biome-ignore lint/a11y/useAriaPropsSupportedByRole: <del> needs aria-label when u-combobox makes it the clear button
20
- jsx("del", { "aria-label": label, hidden: true, ref: ref, suppressHydrationWarning // Since <ds-suggestion> adds attributes
21
- : true, ...rest }));
18
+ return (jsx("button", { "aria-label": label, hidden: true, ref: ref, suppressHydrationWarning // Since <ds-suggestion> adds attributes
19
+ : true, type: 'reset', ...rest }));
22
20
  });
23
21
 
24
22
  export { SuggestionClear };
@@ -11,8 +11,8 @@ import { Label } from '../label/label.js';
11
11
  * @example
12
12
  * <Switch label="I agree" value="agree" />
13
13
  */
14
- const Switch = forwardRef(function Switch({ 'data-size': size, children, className, description, label, position, style, ...rest }, ref) {
15
- return (jsxs(FieldComponent, { className: className, "data-position": position, "data-size": size, style: style, children: [jsx(Input, { type: 'checkbox', role: 'switch', ref: ref, ...rest }), !!label && jsx(Label, { weight: 'regular', children: label }), !!description && jsx("div", { "data-field": 'description', children: description })] }));
14
+ const Switch = forwardRef(function Switch({ 'data-size': size, children, className, description, label, position, style, variant, ...rest }, ref) {
15
+ return (jsxs(FieldComponent, { className: className, "data-position": position, "data-size": size, "data-variant": variant, style: style, children: [jsx(Input, { type: 'checkbox', role: 'switch', ref: ref, ...rest }), !!label && jsx(Label, { weight: 'regular', children: label }), !!description && jsx("div", { "data-field": 'description', children: description })] }));
16
16
  });
17
17
 
18
18
  export { Switch };
@@ -20,7 +20,7 @@ import { forwardRef } from 'react';
20
20
  const Tooltip = forwardRef(function Tooltip({ content, placement = 'top', autoPlacement = true, ...rest }, ref) {
21
21
  /* check if children is a string */
22
22
  const isString = typeof rest.children === 'string';
23
- return (jsx(Slot, { "aria-label": content || undefined, "data-tooltip": content, "data-placement": placement, "data-autoplacement": autoPlacement, suppressHydrationWarning // Since data-tooltip adds aria-label/aria-description
23
+ return (jsx(Slot, { "data-tooltip": content, "data-placement": placement, "data-autoplacement": autoPlacement, suppressHydrationWarning // Since data-tooltip adds aria-label/aria-description
24
24
  : true, ref: ref, ...rest, children: isString ? jsx("span", { tabIndex: 0, children: rest.children }) : rest.children }));
25
25
  });
26
26
 
@@ -45,10 +45,15 @@ function useCheckboxGroup(props) {
45
45
  * <Checkbox {...getCheckboxProps({ value: 'all', allowIndeterminate: true })} />
46
46
  */
47
47
  getCheckboxProps: (propsOrValue) => {
48
- const props = typeof propsOrValue === 'string'
48
+ let groupProps;
49
+ if (props) {
50
+ const { onChange, error, ...rest } = props;
51
+ groupProps = rest;
52
+ }
53
+ const checkboxProps = typeof propsOrValue === 'string'
49
54
  ? { value: propsOrValue }
50
55
  : propsOrValue || {};
51
- const { allowIndeterminate = false, ref: forwardedRef = undefined, value = '', ...rest } = props;
56
+ const { allowIndeterminate = false, ref: forwardedRef = undefined, value = '', ...rest } = checkboxProps;
52
57
  const handleRef = (element) => {
53
58
  if (element) {
54
59
  const refs = allowIndeterminate ? indeterminateRefs : checkboxRefs;
@@ -90,6 +95,7 @@ function useCheckboxGroup(props) {
90
95
  }
91
96
  };
92
97
  return {
98
+ ...groupProps,
93
99
  ...rest,
94
100
  'aria-describedby': `${error ? errorId : ''} ${rest['aria-describedby'] || ''}`.trim() ||
95
101
  undefined,
@@ -14,8 +14,9 @@ import { useState, useId } from 'react';
14
14
  * value: '',
15
15
  * });
16
16
  */
17
- function useRadioGroup({ error, readOnly, required, disabled, name, onChange, value: initalValue = '', } = {}) {
18
- const [groupValue, setGroupValue] = useState(initalValue);
17
+ function useRadioGroup(props) {
18
+ const { error, readOnly, required, disabled, name, onChange, value: initialValue = '', } = props || {};
19
+ const [groupValue, setGroupValue] = useState(initialValue);
19
20
  const errorId = useId();
20
21
  const namedId = useId();
21
22
  const radioGroupName = name || namedId;
@@ -37,10 +38,15 @@ function useRadioGroup({ error, readOnly, required, disabled, name, onChange, va
37
38
  * <Radio label="Option 1" {...getRadioProps('option-1')} />
38
39
  */
39
40
  getRadioProps: (propsOrValue) => {
40
- const props = typeof propsOrValue === 'string'
41
+ let groupProps;
42
+ if (props) {
43
+ const { onChange, error, ...rest } = props;
44
+ groupProps = rest;
45
+ }
46
+ const radioProps = typeof propsOrValue === 'string'
41
47
  ? { value: propsOrValue }
42
48
  : propsOrValue;
43
- const { ref: forwardedRef = undefined, value = '', ...rest } = props;
49
+ const { ref: forwardedRef = undefined, value = '', ...rest } = radioProps;
44
50
  const handleRef = (element) => {
45
51
  if (element) {
46
52
  // Set initial checked state
@@ -65,6 +71,7 @@ function useRadioGroup({ error, readOnly, required, disabled, name, onChange, va
65
71
  }
66
72
  };
67
73
  return {
74
+ ...groupProps,
68
75
  ...rest,
69
76
  name: radioGroupName,
70
77
  'aria-describedby': `${error ? errorId : ''} ${rest['aria-describedby'] || ''}`.trim() ||
@@ -53,7 +53,7 @@ export type ButtonProps = MergeRight<DefaultProps & Omit<ButtonHTMLAttributes<HT
53
53
  * @example
54
54
  * <Button>Click me</Button>
55
55
  */
56
- export declare const Button: import("react").ForwardRefExoticComponent<Omit<DefaultProps & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "command" | "commandfor" | "commandFor">, "type" | "data-color" | "command" | "commandfor" | "commandFor" | "variant" | "icon" | "loading" | "asChild"> & {
56
+ export declare const Button: import("react").ForwardRefExoticComponent<Omit<DefaultProps & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "command" | "commandfor" | "commandFor">, "type" | "data-color" | "variant" | "command" | "commandfor" | "commandFor" | "icon" | "loading" | "asChild"> & {
57
57
  /**
58
58
  * Specify which variant to use
59
59
  * @default 'primary'
@@ -23,6 +23,10 @@ export type CheckboxProps = MergeRight<DefaultProps & Omit<InputProps, 'type' |
23
23
  * Error message for field
24
24
  */
25
25
  error?: ReactNode;
26
+ /**
27
+ * If outline, the checkbox will have a border.
28
+ */
29
+ variant?: 'outline';
26
30
  } & LabelRequired>;
27
31
  /**
28
32
  * Checkbox used to select multiple options.
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIxD,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,MAAM,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,GAAG,aAAa,CAClB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,4GAuBpB,CAAC"}
1
+ {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIxD,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,MAAM,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,GAAG,aAAa,CAClB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,4GA6BpB,CAAC"}
@@ -12,7 +12,7 @@ export type DialogTriggerProps = ComponentPropsWithRef<typeof Button>;
12
12
  * </Dialog>
13
13
  * </Dialog.TriggerContext>
14
14
  */
15
- export declare const DialogTrigger: import("react").ForwardRefExoticComponent<Omit<Omit<import("../../types").DefaultProps & Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement>, "command" | "commandfor" | "commandFor">, "type" | "data-color" | "command" | "commandfor" | "commandFor" | "variant" | "icon" | "loading" | "asChild"> & {
15
+ export declare const DialogTrigger: import("react").ForwardRefExoticComponent<Omit<Omit<import("../../types").DefaultProps & Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement>, "command" | "commandfor" | "commandFor">, "type" | "data-color" | "variant" | "command" | "commandfor" | "commandFor" | "icon" | "loading" | "asChild"> & {
16
16
  variant?: "primary" | "secondary" | "tertiary";
17
17
  'data-color'?: import("packages/types/dist/types").Color | Extract<import("packages/types/dist/types").SeverityColors, "danger">;
18
18
  icon?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAkB,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAKlD,MAAM,MAAM,WAAW,GAAG,UAAU,CAClC,YAAY,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,EACtD;IACE;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC7B;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,cAAc,GAAG,KAAK,CAAC;IAC3C;;;;OAIG;IACH,SAAS,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC3D;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,MAAM;IApEf;;;OAGG;kBACW,MAAM,GAAG,KAAK;IAC5B;;;;;;OAMG;eACQ,MAAM,GAAG,cAAc,GAAG,KAAK;IAC1C;;;;OAIG;gBACS,QAAQ,GAAG,MAAM,GAAG,OAA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AG,QAAQ;IAC1D;;;;;;OAMG;YACK,OAAO;IACf;;OAEG;WACI,OAAO;IACd;;OAEG;cACO,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI;IAChC;;;;;OAKG;cACO,OAAO;qDAsGpB,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { DSErrorSummaryElement } from '@digdir/designsystemet-web';
1
2
  import type { HTMLAttributes, ReactNode } from 'react';
2
3
  import type { DefaultProps } from '../../types';
3
4
  export type ErrorSummaryProps = {
@@ -5,7 +6,7 @@ export type ErrorSummaryProps = {
5
6
  * @deprecated This is not supported anymore, as the element needs to be `ds-error-summary`
6
7
  */
7
8
  asChild?: ReactNode;
8
- } & Omit<HTMLAttributes<HTMLDivElement> & DefaultProps, 'data-color'>;
9
+ } & Omit<HTMLAttributes<DSErrorSummaryElement> & DefaultProps, 'data-color'>;
9
10
  /**
10
11
  * ErrorSummary component, used to display a list of errors.
11
12
  *
@@ -27,5 +28,5 @@ export declare const ErrorSummary: import("react").ForwardRefExoticComponent<{
27
28
  * @deprecated This is not supported anymore, as the element needs to be `ds-error-summary`
28
29
  */
29
30
  asChild?: ReactNode;
30
- } & Omit<HTMLAttributes<HTMLDivElement> & DefaultProps, "data-color"> & import("react").RefAttributes<HTMLDivElement>>;
31
+ } & Omit<HTMLAttributes<DSErrorSummaryElement> & DefaultProps, "data-color"> & import("react").RefAttributes<DSErrorSummaryElement>>;
31
32
  //# sourceMappingURL=error-summary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-summary.d.ts","sourceRoot":"","sources":["../../../src/components/error-summary/error-summary.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,YAAY,EAAE,YAAY,CAAC,CAAC;AAEtE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,YAAY;IAtBvB;;OAEG;cACO,SAAS;sHAkCpB,CAAC"}
1
+ {"version":3,"file":"error-summary.d.ts","sourceRoot":"","sources":["../../../src/components/error-summary/error-summary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGxE,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,GAAG,IAAI,CAAC,cAAc,CAAC,qBAAqB,CAAC,GAAG,YAAY,EAAE,YAAY,CAAC,CAAC;AAE7E;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,YAAY;IAtBvB;;OAEG;cACO,SAAS;oIAmCnB,CAAC"}
@@ -7,7 +7,6 @@ export type HeadingProps = {
7
7
  level?: 1 | 2 | 3 | 4 | 5 | 6;
8
8
  /**
9
9
  * Changes text sizing
10
- * @default 'md'
11
10
  */
12
11
  'data-size'?: '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
13
12
  /**
@@ -30,7 +29,6 @@ export declare const Heading: import("react").ForwardRefExoticComponent<{
30
29
  level?: 1 | 2 | 3 | 4 | 5 | 6;
31
30
  /**
32
31
  * Changes text sizing
33
- * @default 'md'
34
32
  */
35
33
  'data-size'?: "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
36
34
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../../src/components/heading/heading.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,OAAO,CAA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I,OAAO;IACd;;;;OAIG;cACO,SAAS,GAAG,QAAQ;IAC9B;;OAEG;mBACY,KAAK,GAAG,cAAc;IACrC;;OAEG;aACM,MAAM,IAAI;IACnB;;OAEG;cACO,MAAM,IAAI;IACpB;;;OAGG;oBACa,OAAO;IACvB;;;OAGG;cACO,OAAO;kDA6GpB,CAAC"}
1
+ {"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/components/popover/popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAIlD,MAAM,MAAM,YAAY,GAAG,UAAU,CACnC,YAAY,GAAG,cAAc,CAAC,cAAc,CAAC,EAC7C;IACE;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC/B;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,GAAG,cAAc,CAAC;IACtC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CACF,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,OAAO;IA9DhB;;OAEG;SACE,MAAM;IACX;;;OAGG;gBACS,SAAS;IACrB;;;OAGG;WACI,OAAO;IACd;;;;OAIG;cACO,SAAS,GAAG,QAAQ;IAC9B;;OAEG;mBACY,KAAK,GAAG,cAAc;IACrC;;OAEG;aACM,MAAM,IAAI;IACnB;;OAEG;cACO,MAAM,IAAI;IACpB;;;OAGG;oBACa,OAAO;IACvB;;;OAGG;cACO,OAAO;kDAwGpB,CAAC"}
@@ -23,6 +23,10 @@ export type RadioProps = MergeRight<DefaultProps & Omit<InputProps, 'type' | 'ro
23
23
  * Error message for field
24
24
  */
25
25
  error?: ReactNode;
26
+ /**
27
+ * If outline, the radio will have a border.
28
+ */
29
+ variant?: 'outline';
26
30
  } & LabelRequired>;
27
31
  /**
28
32
  * Radio used to select multiple options.
@@ -1 +1 @@
1
- {"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../../src/components/radio/radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIxD,MAAM,MAAM,UAAU,GAAG,UAAU,CACjC,YAAY,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,EACzD;IACE;;QAEI;IACJ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,GAAG,aAAa,CAClB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,KAAK,yGAqBhB,CAAC"}
1
+ {"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../../src/components/radio/radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIxD,MAAM,MAAM,UAAU,GAAG,UAAU,CACjC,YAAY,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,EACzD;IACE;;QAEI;IACJ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,GAAG,aAAa,CAClB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,KAAK,yGA2BhB,CAAC"}
@@ -22,7 +22,7 @@ export type SearchButtonProps = MergeRight<ButtonProps, {
22
22
  * <SearchButton>Søk</SearchButton>
23
23
  * </Search>
24
24
  */
25
- export declare const SearchButton: import("react").ForwardRefExoticComponent<Omit<import("../../types").DefaultProps & Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement>, "command" | "commandfor" | "commandFor">, "type" | "data-color" | "command" | "commandfor" | "commandFor" | "variant" | "icon" | "loading" | "asChild"> & {
25
+ export declare const SearchButton: import("react").ForwardRefExoticComponent<Omit<import("../../types").DefaultProps & Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement>, "command" | "commandfor" | "commandFor">, "type" | "data-color" | "variant" | "command" | "commandfor" | "commandFor" | "icon" | "loading" | "asChild"> & {
26
26
  variant?: "primary" | "secondary" | "tertiary";
27
27
  'data-color'?: import("packages/types/dist/types").Color | Extract<import("packages/types/dist/types").SeverityColors, "danger">;
28
28
  icon?: boolean;
@@ -1,7 +1,7 @@
1
- import { type DelHTMLAttributes } from 'react';
1
+ import { type ButtonHTMLAttributes } from 'react';
2
2
  import type { DefaultProps } from '../../types';
3
3
  import type { MergeRight } from '../../utilities';
4
- export type SuggestionClearProps = MergeRight<DefaultProps & DelHTMLAttributes<HTMLModElement>, {
4
+ export type SuggestionClearProps = MergeRight<DefaultProps & ButtonHTMLAttributes<HTMLButtonElement>, {
5
5
  /**
6
6
  * Aria label for the clear button
7
7
  * @default 'Tøm'
@@ -20,11 +20,11 @@ export type SuggestionClearProps = MergeRight<DefaultProps & DelHTMLAttributes<H
20
20
  * <Suggestion.List />
21
21
  * </Suggestion>
22
22
  */
23
- export declare const SuggestionClear: import("react").ForwardRefExoticComponent<Omit<DefaultProps & DelHTMLAttributes<HTMLModElement>, "aria-label"> & {
23
+ export declare const SuggestionClear: import("react").ForwardRefExoticComponent<Omit<DefaultProps & ButtonHTMLAttributes<HTMLButtonElement>, "aria-label"> & {
24
24
  /**
25
25
  * Aria label for the clear button
26
26
  * @default 'Tøm'
27
27
  */
28
28
  'aria-label'?: string;
29
- } & import("react").RefAttributes<HTMLModElement>>;
29
+ } & import("react").RefAttributes<HTMLButtonElement>>;
30
30
  //# sourceMappingURL=suggestion-clear.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"suggestion-clear.d.ts","sourceRoot":"","sources":["../../../src/components/suggestion/suggestion-clear.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAc,MAAM,OAAO,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAC3C,YAAY,GAAG,iBAAiB,CAAC,cAAc,CAAC,EAChD;IACE;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CACF,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe;IApBxB;;;OAGG;mBACY,MAAM;kDA6BxB,CAAC"}
1
+ {"version":3,"file":"suggestion-clear.d.ts","sourceRoot":"","sources":["../../../src/components/suggestion/suggestion-clear.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,oBAAoB,EAAc,MAAM,OAAO,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAC3C,YAAY,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,EACtD;IACE;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CACF,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe;IApBxB;;;OAGG;mBACY,MAAM;qDA8BvB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { type InputProps } from '../input/input';
2
- export type SuggestionInputProps = InputProps;
2
+ export type SuggestionInputProps = Omit<InputProps, 'role' | 'data-indeterminate'>;
3
3
  declare global {
4
4
  namespace React.JSX {
5
5
  interface IntrinsicAttributes {
@@ -23,12 +23,5 @@ declare global {
23
23
  * <Suggestion.List />
24
24
  * </Suggestion>
25
25
  */
26
- export declare const SuggestionInput: import("react").ForwardRefExoticComponent<Omit<import("../../types").DefaultProps & Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "prefix" | "type">, "type" | "disabled" | "readOnly" | "size" | "role" | "data-indeterminate"> & {
27
- type?: "checkbox" | "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "month" | "number" | "password" | "radio" | "search" | "tel" | "text" | "time" | "url" | "week";
28
- size?: number;
29
- disabled?: boolean;
30
- readOnly?: boolean;
31
- role?: import("react").AriaRole | undefined;
32
- 'data-indeterminate'?: boolean;
33
- } & import("react").RefAttributes<HTMLInputElement>>;
26
+ export declare const SuggestionInput: import("react").ForwardRefExoticComponent<SuggestionInputProps & import("react").RefAttributes<HTMLInputElement>>;
34
27
  //# sourceMappingURL=suggestion-input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"suggestion-input.d.ts","sourceRoot":"","sources":["../../../src/components/suggestion/suggestion-input.tsx"],"names":[],"mappings":"AACA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGxD,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC;AAI9C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC,GAAG,CAAC;QAClB,UAAU,mBAAmB;YAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;SACxB;KACF;IACD,UAAU,KAAK,CAAC;QACd,UAAU,cAAc,CAAC,CAAC;YACxB,aAAa,CAAC,EAAE,MAAM,CAAC;SACxB;KACF;CACF;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe;;;;;;;oDA4B1B,CAAC"}
1
+ {"version":3,"file":"suggestion-input.d.ts","sourceRoot":"","sources":["../../../src/components/suggestion/suggestion-input.tsx"],"names":[],"mappings":"AACA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGxD,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,UAAU,EACV,MAAM,GAAG,oBAAoB,CAC9B,CAAC;AAIF,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC,GAAG,CAAC;QAClB,UAAU,mBAAmB;YAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;SACxB;KACF;IACD,UAAU,KAAK,CAAC;QACd,UAAU,cAAc,CAAC,CAAC;YACxB,aAAa,CAAC,EAAE,MAAM,CAAC;SACxB;KACF;CACF;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,mHA4B1B,CAAC"}
@@ -25,6 +25,10 @@ export type SwitchProps = MergeRight<DefaultProps & Omit<InputHTMLAttributes<HTM
25
25
  * @default start
26
26
  */
27
27
  position?: FieldProps['position'];
28
+ /**
29
+ * If outline, the switch will have a border.
30
+ */
31
+ variant?: 'outline';
28
32
  } & LabelRequired>;
29
33
  /**
30
34
  * Switch used to toggle options.
@@ -1 +1 @@
1
- {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/components/switch/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5D,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGxD,MAAM,MAAM,WAAW,GAAG,UAAU,CAClC,YAAY,GAAG,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,EAC3E;IACE;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;CACnC,GAAG,aAAa,CAClB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,MAAM,0GAyBjB,CAAC"}
1
+ {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/components/switch/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5D,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGxD,MAAM,MAAM,WAAW,GAAG,UAAU,CAClC,YAAY,GAAG,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,EAC3E;IACE;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IAClC;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,GAAG,aAAa,CAClB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,MAAM,0GA2BjB,CAAC"}
@@ -33,8 +33,8 @@ export type TooltipProps = MergeRight<Omit<DefaultProps, 'data-color'> & HTMLAtt
33
33
  */
34
34
  open?: boolean;
35
35
  /**
36
- * Override if `aria-describedby` or `aria-labelledby` is used.
37
- * By default, if the trigger element has no inner text, `aria-labelledby` is used.
36
+ * @deprecated This prop has no effect. The tooltip will be set as `aria-description`
37
+ * if the component already contains accessible text, and `aria-label` otherwise.
38
38
  */
39
39
  type?: 'describedby' | 'labelledby';
40
40
  }>;
@@ -82,8 +82,8 @@ export declare const Tooltip: import("react").ForwardRefExoticComponent<Omit<Omi
82
82
  */
83
83
  open?: boolean;
84
84
  /**
85
- * Override if `aria-describedby` or `aria-labelledby` is used.
86
- * By default, if the trigger element has no inner text, `aria-labelledby` is used.
85
+ * @deprecated This prop has no effect. The tooltip will be set as `aria-description`
86
+ * if the component already contains accessible text, and `aria-label` otherwise.
87
87
  */
88
88
  type?: "describedby" | "labelledby";
89
89
  } & RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,YAAY,GAAG,UAAU,CACnC,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,GAAG,cAAc,CAAC,cAAc,CAAC,EACjE;IACE;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,YAAY,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC,GAAG,MAAM,CAAC;IAC/D;;QAEI;IACJ,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,aAAa,GAAG,YAAY,CAAC;CACrC,CACF,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,OAAO;IAlDhB;;;;;OAKG;cACO,CAAC,YAAY,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC,GAAG,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G,YAAY;kCAsCtC,CAAC"}
@@ -37,6 +37,10 @@ export type UseCheckboxGroupProps = {
37
37
  * @returns void
38
38
  */
39
39
  onChange?: (nextValue: string[], currentValue: string[]) => void;
40
+ /**
41
+ * If outline, all checkboxes in the group will have a border
42
+ */
43
+ variant?: CheckboxProps['variant'];
40
44
  };
41
45
  /**
42
46
  * Get anything that is set on a checkbox, but
@@ -1 +1 @@
1
- {"version":3,"file":"use-checkbox-group.d.ts","sourceRoot":"","sources":["../../../../src/utilities/hooks/use-checkbox-group/use-checkbox-group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,cAAc,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAClE,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,aAAa,EACX,QAAQ,GACR,MAAM,GACN,MAAM,GACN,MAAM,GACN,YAAY,GACZ,iBAAiB,GACjB,OAAO,GACP,SAAS,GACT,OAAO,CACV,GAAG;IACF,6EAA6E;IAC7E,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,GAAG,CAAC,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAgBF,KAAK,sBAAsB,GAAG;IAC5B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC7C,gBAAgB,EAAE,CAChB,YAAY,CAAC,EAAE,MAAM,GAAG,gBAAgB,KACrC,gBAAgB,CAAC;IACtB,sBAAsB,EAAE;QACtB,QAAQ,EAAE,SAAS,CAAC;QACpB,MAAM,EAAE,OAAO,CAAC;QAChB,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;CACH,CAAC;AAEF,wBAAgB,gBAAgB,CAC9B,KAAK,CAAC,EAAE,qBAAqB,GAC5B,sBAAsB,CA8IxB"}
1
+ {"version":3,"file":"use-checkbox-group.d.ts","sourceRoot":"","sources":["../../../../src/utilities/hooks/use-checkbox-group/use-checkbox-group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,cAAc,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACjE;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;CACpC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,aAAa,EACX,QAAQ,GACR,MAAM,GACN,MAAM,GACN,MAAM,GACN,YAAY,GACZ,iBAAiB,GACjB,OAAO,GACP,SAAS,GACT,OAAO,CACV,GAAG;IACF,6EAA6E;IAC7E,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,GAAG,CAAC,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAgBF,KAAK,sBAAsB,GAAG;IAC5B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC7C,gBAAgB,EAAE,CAChB,YAAY,CAAC,EAAE,MAAM,GAAG,gBAAgB,KACrC,gBAAgB,CAAC;IACtB,sBAAsB,EAAE;QACtB,QAAQ,EAAE,SAAS,CAAC;QACpB,MAAM,EAAE,OAAO,CAAC;QAChB,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;CACH,CAAC;AAEF,wBAAgB,gBAAgB,CAC9B,KAAK,CAAC,EAAE,qBAAqB,GAC5B,sBAAsB,CAsJxB"}
@@ -19,6 +19,10 @@ export type UseRadioGroupProps = {
19
19
  value?: string;
20
20
  /** Callback when selected radios changes */
21
21
  onChange?: (nextValue: string, prevValue: string) => void;
22
+ /**
23
+ * If outline, all radios in the group will have a border
24
+ */
25
+ variant?: RadioProps['variant'];
22
26
  };
23
27
  /**
24
28
  * Get anything that is set on a radio, but
@@ -51,6 +55,6 @@ type useRadioGroupReturn = {
51
55
  * value: '',
52
56
  * });
53
57
  */
54
- export declare function useRadioGroup({ error, readOnly, required, disabled, name, onChange, value: initalValue, }?: UseRadioGroupProps): useRadioGroupReturn;
58
+ export declare function useRadioGroup(props?: UseRadioGroupProps): useRadioGroupReturn;
55
59
  export {};
56
60
  //# sourceMappingURL=use-radio-group.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-radio-group.d.ts","sourceRoot":"","sources":["../../../../src/utilities/hooks/use-radio-group/use-radio-group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,cAAc,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3D,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,UAAU,EACR,QAAQ,GACR,MAAM,GACN,MAAM,GACN,MAAM,GACN,YAAY,GACZ,iBAAiB,GACjB,OAAO,GACP,MAAM,GACN,SAAS,GACT,OAAO,CACV,GAAG;IACF,GAAG,CAAC,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3C,aAAa,EAAE,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,KAAK,aAAa,CAAC;IACvE,sBAAsB,EAAE;QACtB,QAAQ,EAAE,SAAS,CAAC;QACpB,MAAM,EAAE,OAAO,CAAC;QAChB,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;CACH,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,KAAK,EAAE,WAAgB,GACxB,GAAE,kBAAuB,GAAG,mBAAmB,CAsF/C"}
1
+ {"version":3,"file":"use-radio-group.d.ts","sourceRoot":"","sources":["../../../../src/utilities/hooks/use-radio-group/use-radio-group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,cAAc,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D;;OAEG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;CACjC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,UAAU,EACR,QAAQ,GACR,MAAM,GACN,MAAM,GACN,MAAM,GACN,YAAY,GACZ,iBAAiB,GACjB,OAAO,GACP,MAAM,GACN,SAAS,GACT,OAAO,CACV,GAAG;IACF,GAAG,CAAC,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3C,aAAa,EAAE,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,KAAK,aAAa,CAAC;IACvE,sBAAsB,EAAE;QACtB,QAAQ,EAAE,SAAS,CAAC;QACpB,MAAM,EAAE,OAAO,CAAC;QAChB,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;CACH,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,KAAK,CAAC,EAAE,kBAAkB,GAAG,mBAAmB,CAuG7E"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@digdir/designsystemet-react",
3
3
  "type": "module",
4
- "version": "1.13.3",
4
+ "version": "1.15.0",
5
5
  "description": "React components for Designsystemet",
6
6
  "author": "Designsystemet team",
7
7
  "repository": {
@@ -37,33 +37,33 @@
37
37
  "dependencies": {
38
38
  "@floating-ui/dom": "^1.7.6",
39
39
  "@floating-ui/react": "0.26.23",
40
- "@navikt/aksel-icons": "^8.9.0",
40
+ "@navikt/aksel-icons": "^8.10.5",
41
41
  "@radix-ui/react-slot": "^1.2.4",
42
- "@tanstack/react-virtual": "^3.13.23",
42
+ "@tanstack/react-virtual": "^3.13.24",
43
43
  "clsx": "^2.1.1",
44
- "@digdir/designsystemet-types": "1.13.3",
45
- "@digdir/designsystemet-web": "1.13.3"
44
+ "@digdir/designsystemet-types": "1.15.0",
45
+ "@digdir/designsystemet-web": "1.15.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@rollup/plugin-commonjs": "29.0.2",
49
49
  "@rollup/plugin-node-resolve": "16.0.3",
50
- "@storybook/addon-docs": "10.3.4",
51
- "@storybook/addon-vitest": "10.3.4",
52
- "@storybook/react-vite": "10.3.4",
50
+ "@storybook/addon-docs": "10.4.0",
51
+ "@storybook/addon-vitest": "10.4.0",
52
+ "@storybook/react-vite": "10.4.0",
53
53
  "@testing-library/jest-dom": "6.9.1",
54
54
  "@testing-library/react": "16.3.2",
55
55
  "@testing-library/user-event": "14.6.1",
56
56
  "@types/react": "19.2.14",
57
57
  "@types/react-dom": "19.2.3",
58
- "react": "19.2.4",
59
- "react-dom": "19.2.4",
58
+ "react": "19.2.6",
59
+ "react-dom": "19.2.6",
60
60
  "rimraf": "6.1.3",
61
- "rollup": "4.60.1",
61
+ "rollup": "4.60.4",
62
62
  "rollup-plugin-copy": "3.5.0",
63
- "storybook": "10.3.4",
64
- "tsx": "4.21.0",
63
+ "storybook": "10.4.0",
64
+ "tsx": "4.22.1",
65
65
  "typescript": "5.9.3",
66
- "@digdir/designsystemet-css": "^1.13.3"
66
+ "@digdir/designsystemet-css": "^1.15.0"
67
67
  },
68
68
  "scripts": {
69
69
  "build": "pnpm run clean && tsc -b tsconfig.lib.json --emitDeclarationOnly false && rollup -c --bundleConfigAsCjs",