@digdir/designsystemet-react 0.58.0 → 0.59.1-alpha.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 (107) hide show
  1. package/dist/cjs/components/Alert/Alert.js +2 -2
  2. package/dist/cjs/components/Button/Button.js +1 -2
  3. package/dist/cjs/components/DropdownMenu/DropdownMenuContent.js +4 -4
  4. package/dist/cjs/components/DropdownMenu/DropdownMenuTrigger.js +1 -1
  5. package/dist/cjs/components/Modal/ModalDialog.js +1 -1
  6. package/dist/cjs/components/Popover/PopoverContent.js +6 -6
  7. package/dist/cjs/components/Popover/PopoverTrigger.js +1 -1
  8. package/dist/cjs/components/SkipLink/SkipLink.js +1 -2
  9. package/dist/cjs/components/Tooltip/Tooltip.js +6 -6
  10. package/dist/cjs/components/form/Checkbox/Checkbox.js +1 -1
  11. package/dist/cjs/components/form/Combobox/Combobox.js +60 -177
  12. package/dist/cjs/components/form/Combobox/ComboboxContext.js +8 -0
  13. package/dist/cjs/components/form/Combobox/ComboboxIdContext.js +42 -0
  14. package/dist/cjs/components/form/Combobox/Custom/Custom.js +14 -9
  15. package/dist/cjs/components/form/Combobox/Empty/Empty.js +4 -4
  16. package/dist/cjs/components/form/Combobox/Option/Option.js +15 -33
  17. package/dist/cjs/components/form/Combobox/Option/useComboboxOption.js +47 -0
  18. package/dist/cjs/components/form/Combobox/internal/ComboboxChips.js +14 -6
  19. package/dist/cjs/components/form/Combobox/internal/ComboboxClearButton.js +4 -4
  20. package/dist/cjs/components/form/Combobox/internal/ComboboxInput.js +40 -35
  21. package/dist/cjs/components/form/Combobox/internal/ComboboxNative.js +2 -2
  22. package/dist/cjs/components/form/Combobox/useCombobox.js +46 -32
  23. package/dist/cjs/components/form/Combobox/useComboboxKeyboard.js +79 -0
  24. package/dist/cjs/components/form/Combobox/useFloatingCombobox.js +78 -0
  25. package/dist/cjs/components/form/Search/Search.js +1 -1
  26. package/dist/cjs/node_modules/@floating-ui/utils/{dom/dist → dist}/floating-ui.utils.dom.js +7 -4
  27. package/dist/cjs/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +5 -0
  28. package/dist/cjs/{node_modules → packages/react/node_modules}/@floating-ui/core/dist/floating-ui.core.js +40 -16
  29. package/dist/cjs/{node_modules → packages/react/node_modules}/@floating-ui/dom/dist/floating-ui.dom.js +83 -31
  30. package/dist/cjs/{node_modules → packages/react/node_modules}/@floating-ui/react/dist/floating-ui.react.js +307 -157
  31. package/dist/cjs/{node_modules/@floating-ui/react/utils → packages/react/node_modules/@floating-ui/react}/dist/floating-ui.react.utils.js +9 -4
  32. package/dist/cjs/{node_modules → packages/react/node_modules}/@floating-ui/react-dom/dist/floating-ui.react-dom.js +22 -18
  33. package/dist/{esm → cjs/packages/react}/node_modules/tabbable/dist/index.esm.js +59 -13
  34. package/dist/cjs/react-css-modules.css +0 -315
  35. package/dist/cjs/utilities/RovingTabIndex/RovingTabindexItem.js +1 -1
  36. package/dist/cjs/utilities/RovingTabIndex/RovingTabindexRoot.js +1 -1
  37. package/dist/esm/components/Alert/Alert.js +2 -2
  38. package/dist/esm/components/Button/Button.js +1 -2
  39. package/dist/esm/components/DropdownMenu/DropdownMenuContent.js +3 -3
  40. package/dist/esm/components/DropdownMenu/DropdownMenuTrigger.js +1 -1
  41. package/dist/esm/components/Modal/ModalDialog.js +1 -1
  42. package/dist/esm/components/Popover/PopoverContent.js +4 -4
  43. package/dist/esm/components/Popover/PopoverTrigger.js +1 -1
  44. package/dist/esm/components/SkipLink/SkipLink.js +1 -2
  45. package/dist/esm/components/Tooltip/Tooltip.js +4 -4
  46. package/dist/esm/components/form/Checkbox/Checkbox.js +1 -1
  47. package/dist/esm/components/form/Combobox/Combobox.js +65 -182
  48. package/dist/esm/components/form/Combobox/ComboboxContext.js +6 -0
  49. package/dist/esm/components/form/Combobox/ComboboxIdContext.js +35 -0
  50. package/dist/esm/components/form/Combobox/Custom/Custom.js +13 -8
  51. package/dist/esm/components/form/Combobox/Empty/Empty.js +3 -3
  52. package/dist/esm/components/form/Combobox/Option/Option.js +15 -33
  53. package/dist/esm/components/form/Combobox/Option/useComboboxOption.js +45 -0
  54. package/dist/esm/components/form/Combobox/internal/ComboboxChips.js +13 -5
  55. package/dist/esm/components/form/Combobox/internal/ComboboxClearButton.js +3 -3
  56. package/dist/esm/components/form/Combobox/internal/ComboboxInput.js +39 -34
  57. package/dist/esm/components/form/Combobox/internal/ComboboxNative.js +2 -2
  58. package/dist/esm/components/form/Combobox/useCombobox.js +46 -32
  59. package/dist/esm/components/form/Combobox/useComboboxKeyboard.js +77 -0
  60. package/dist/esm/components/form/Combobox/useFloatingCombobox.js +76 -0
  61. package/dist/esm/components/form/Search/Search.js +1 -1
  62. package/dist/esm/node_modules/@floating-ui/utils/{dom/dist → dist}/floating-ui.utils.dom.js +7 -4
  63. package/dist/esm/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +5 -0
  64. package/dist/esm/{node_modules → packages/react/node_modules}/@floating-ui/core/dist/floating-ui.core.js +40 -16
  65. package/dist/esm/{node_modules → packages/react/node_modules}/@floating-ui/dom/dist/floating-ui.dom.js +82 -30
  66. package/dist/esm/{node_modules → packages/react/node_modules}/@floating-ui/react/dist/floating-ui.react.js +282 -135
  67. package/dist/esm/{node_modules/@floating-ui/react/utils → packages/react/node_modules/@floating-ui/react}/dist/floating-ui.react.utils.js +9 -5
  68. package/dist/esm/{node_modules → packages/react/node_modules}/@floating-ui/react-dom/dist/floating-ui.react-dom.js +19 -14
  69. package/dist/{cjs → esm/packages/react}/node_modules/tabbable/dist/index.esm.js +55 -15
  70. package/dist/esm/react-css-modules.css +0 -315
  71. package/dist/esm/utilities/RovingTabIndex/RovingTabindexItem.js +1 -1
  72. package/dist/esm/utilities/RovingTabIndex/RovingTabindexRoot.js +1 -1
  73. package/dist/types/components/Alert/Alert.d.ts +12 -0
  74. package/dist/types/components/Alert/Alert.d.ts.map +1 -1
  75. package/dist/types/components/Button/Button.d.ts.map +1 -1
  76. package/dist/types/components/SkipLink/SkipLink.d.ts.map +1 -1
  77. package/dist/types/components/form/Combobox/Combobox.d.ts +104 -39
  78. package/dist/types/components/form/Combobox/Combobox.d.ts.map +1 -1
  79. package/dist/types/components/form/Combobox/ComboboxContext.d.ts +48 -0
  80. package/dist/types/components/form/Combobox/ComboboxContext.d.ts.map +1 -0
  81. package/dist/types/components/form/Combobox/ComboboxIdContext.d.ts +19 -0
  82. package/dist/types/components/form/Combobox/ComboboxIdContext.d.ts.map +1 -0
  83. package/dist/types/components/form/Combobox/Custom/Custom.d.ts.map +1 -1
  84. package/dist/types/components/form/Combobox/Option/Option.d.ts +2 -2
  85. package/dist/types/components/form/Combobox/Option/Option.d.ts.map +1 -1
  86. package/dist/types/components/form/Combobox/Option/useComboboxOption.d.ts +14 -0
  87. package/dist/types/components/form/Combobox/Option/useComboboxOption.d.ts.map +1 -0
  88. package/dist/types/components/form/Combobox/internal/ComboboxChips.d.ts.map +1 -1
  89. package/dist/types/components/form/Combobox/internal/ComboboxInput.d.ts +0 -1
  90. package/dist/types/components/form/Combobox/internal/ComboboxInput.d.ts.map +1 -1
  91. package/dist/types/components/form/Combobox/internal/ComboboxNative.d.ts +3 -1
  92. package/dist/types/components/form/Combobox/internal/ComboboxNative.d.ts.map +1 -1
  93. package/dist/types/components/form/Combobox/useCombobox.d.ts +13 -5
  94. package/dist/types/components/form/Combobox/useCombobox.d.ts.map +1 -1
  95. package/dist/types/components/form/Combobox/useComboboxKeyboard.d.ts +20 -0
  96. package/dist/types/components/form/Combobox/useComboboxKeyboard.d.ts.map +1 -0
  97. package/dist/types/components/form/Combobox/useFloatingCombobox.d.ts +41 -0
  98. package/dist/types/components/form/Combobox/useFloatingCombobox.d.ts.map +1 -0
  99. package/package.json +3 -3
  100. package/dist/cjs/components/Button/Button.module.css.js +0 -6
  101. package/dist/cjs/components/SkipLink/SkipLink.module.css.js +0 -6
  102. package/dist/cjs/node_modules/@floating-ui/react/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -6
  103. package/dist/cjs/node_modules/@floating-ui/react/node_modules/@floating-ui/utils/dom/dist/floating-ui.utils.dom.js +0 -68
  104. package/dist/esm/components/Button/Button.module.css.js +0 -4
  105. package/dist/esm/components/SkipLink/SkipLink.module.css.js +0 -4
  106. package/dist/esm/node_modules/@floating-ui/react/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -4
  107. package/dist/esm/node_modules/@floating-ui/react/node_modules/@floating-ui/utils/dom/dist/floating-ui.utils.dom.js +0 -57
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  'use strict';
3
3
 
4
- var floatingUi_utils_dom = require('../../node_modules/@floating-ui/utils/dom/dist/floating-ui.utils.dom.js');
4
+ var floatingUi_utils_dom = require('../../../../../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js');
5
5
 
6
6
  function activeElement(doc) {
7
7
  let activeElement = doc.activeElement;
@@ -15,7 +15,7 @@ function contains(parent, child) {
15
15
  if (!parent || !child) {
16
16
  return false;
17
17
  }
18
- const rootNode = child.getRootNode && child.getRootNode();
18
+ const rootNode = child.getRootNode == null ? void 0 : child.getRootNode();
19
19
 
20
20
  // First, attempt with faster native method
21
21
  if (parent.contains(child)) {
@@ -72,9 +72,10 @@ function isVirtualClick(event) {
72
72
  return event.detail === 0 && !event.pointerType;
73
73
  }
74
74
  function isVirtualPointerEvent(event) {
75
- return !isAndroid() && event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'mouse' ||
75
+ if (isJSDOM()) return false;
76
+ return !isAndroid() && event.width === 0 && event.height === 0 || isAndroid() && event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'mouse' ||
76
77
  // iOS VoiceOver returns 0.333• for width/height.
77
- event.width < 1 && event.height < 1 && event.pressure === 0 && event.detail === 0;
78
+ event.width < 1 && event.height < 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'touch';
78
79
  }
79
80
  function isSafari() {
80
81
  // Chrome DevTools does not complain about navigator.vendor
@@ -87,6 +88,9 @@ function isAndroid() {
87
88
  function isMac() {
88
89
  return getPlatform().toLowerCase().startsWith('mac') && !navigator.maxTouchPoints;
89
90
  }
91
+ function isJSDOM() {
92
+ return getUserAgent().includes('jsdom/');
93
+ }
90
94
  function isMouseLikePointerType(pointerType, strict) {
91
95
  // On some Linux machines with Chromium, mouse inputs return a `pointerType`
92
96
  // of "pen": https://github.com/floating-ui/floating-ui/issues/2015
@@ -148,6 +152,7 @@ exports.getTarget = getTarget;
148
152
  exports.getUserAgent = getUserAgent;
149
153
  exports.isAndroid = isAndroid;
150
154
  exports.isEventTargetWithin = isEventTargetWithin;
155
+ exports.isJSDOM = isJSDOM;
151
156
  exports.isMac = isMac;
152
157
  exports.isMouseLikePointerType = isMouseLikePointerType;
153
158
  exports.isReactEvent = isReactEvent;
@@ -4,7 +4,6 @@
4
4
  var floatingUi_dom = require('../../dom/dist/floating-ui.dom.js');
5
5
  var React = require('react');
6
6
  var ReactDOM = require('react-dom');
7
- var floatingUi_core = require('../../core/dist/floating-ui.core.js');
8
7
 
9
8
  function _interopNamespaceDefault(e) {
10
9
  var n = Object.create(null);
@@ -46,14 +45,15 @@ const arrow = options => {
46
45
  } = typeof options === 'function' ? options(state) : options;
47
46
  if (element && isRef(element)) {
48
47
  if (element.current != null) {
49
- return floatingUi_core.arrow({
48
+ return floatingUi_dom.arrow({
50
49
  element: element.current,
51
50
  padding
52
51
  }).fn(state);
53
52
  }
54
53
  return {};
55
- } else if (element) {
56
- return floatingUi_core.arrow({
54
+ }
55
+ if (element) {
56
+ return floatingUi_dom.arrow({
57
57
  element,
58
58
  padding
59
59
  }).fn(state);
@@ -77,11 +77,13 @@ function deepEqual(a, b) {
77
77
  if (typeof a === 'function' && a.toString() === b.toString()) {
78
78
  return true;
79
79
  }
80
- let length, i, keys;
81
- if (a && b && typeof a == 'object') {
80
+ let length;
81
+ let i;
82
+ let keys;
83
+ if (a && b && typeof a === 'object') {
82
84
  if (Array.isArray(a)) {
83
85
  length = a.length;
84
- if (length != b.length) return false;
86
+ if (length !== b.length) return false;
85
87
  for (i = length; i-- !== 0;) {
86
88
  if (!deepEqual(a[i], b[i])) {
87
89
  return false;
@@ -110,6 +112,8 @@ function deepEqual(a, b) {
110
112
  }
111
113
  return true;
112
114
  }
115
+
116
+ // biome-ignore lint/suspicious/noSelfCompare: in source
113
117
  return a !== a && b !== b;
114
118
  }
115
119
 
@@ -170,22 +174,23 @@ function useFloating(options) {
170
174
  const [_reference, _setReference] = React__namespace.useState(null);
171
175
  const [_floating, _setFloating] = React__namespace.useState(null);
172
176
  const setReference = React__namespace.useCallback(node => {
173
- if (node != referenceRef.current) {
177
+ if (node !== referenceRef.current) {
174
178
  referenceRef.current = node;
175
179
  _setReference(node);
176
180
  }
177
- }, [_setReference]);
181
+ }, []);
178
182
  const setFloating = React__namespace.useCallback(node => {
179
183
  if (node !== floatingRef.current) {
180
184
  floatingRef.current = node;
181
185
  _setFloating(node);
182
186
  }
183
- }, [_setFloating]);
187
+ }, []);
184
188
  const referenceEl = externalReference || _reference;
185
189
  const floatingEl = externalFloating || _floating;
186
190
  const referenceRef = React__namespace.useRef(null);
187
191
  const floatingRef = React__namespace.useRef(null);
188
192
  const dataRef = React__namespace.useRef(data);
193
+ const hasWhileElementsMounted = whileElementsMounted != null;
189
194
  const whileElementsMountedRef = useLatestRef(whileElementsMounted);
190
195
  const platformRef = useLatestRef(platform);
191
196
  const update = React__namespace.useCallback(() => {
@@ -229,17 +234,18 @@ function useFloating(options) {
229
234
  isMountedRef.current = false;
230
235
  };
231
236
  }, []);
237
+
238
+ // biome-ignore lint/correctness/useExhaustiveDependencies: `hasWhileElementsMounted` is intentionally included.
232
239
  index(() => {
233
240
  if (referenceEl) referenceRef.current = referenceEl;
234
241
  if (floatingEl) floatingRef.current = floatingEl;
235
242
  if (referenceEl && floatingEl) {
236
243
  if (whileElementsMountedRef.current) {
237
244
  return whileElementsMountedRef.current(referenceEl, floatingEl, update);
238
- } else {
239
- update();
240
245
  }
246
+ update();
241
247
  }
242
- }, [referenceEl, floatingEl, update, whileElementsMountedRef]);
248
+ }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
243
249
  const refs = React__namespace.useMemo(() => ({
244
250
  reference: referenceRef,
245
251
  floating: floatingRef,
@@ -287,11 +293,9 @@ function useFloating(options) {
287
293
 
288
294
  exports.autoUpdate = floatingUi_dom.autoUpdate;
289
295
  exports.computePosition = floatingUi_dom.computePosition;
296
+ exports.flip = floatingUi_dom.flip;
290
297
  exports.platform = floatingUi_dom.platform;
291
- exports.detectOverflow = floatingUi_core.detectOverflow;
292
- exports.flip = floatingUi_core.flip;
293
- exports.offset = floatingUi_core.offset;
294
- exports.shift = floatingUi_core.shift;
295
- exports.size = floatingUi_core.size;
298
+ exports.shift = floatingUi_dom.shift;
299
+ exports.size = floatingUi_dom.size;
296
300
  exports.arrow = arrow;
297
301
  exports.useFloating = useFloating;
@@ -1,6 +1,8 @@
1
1
  'use client';
2
+ 'use strict';
3
+
2
4
  /*!
3
- * tabbable 6.1.1
5
+ * tabbable 6.2.0
4
6
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
5
7
  */
6
8
  // NOTE: separate `:not()` selectors has broader browser support than the newer
@@ -180,7 +182,27 @@ var getCandidatesIteratively = function getCandidatesIteratively(elements, inclu
180
182
  }
181
183
  return candidates;
182
184
  };
183
- var getTabindex = function getTabindex(node, isScope) {
185
+
186
+ /**
187
+ * @private
188
+ * Determines if the node has an explicitly specified `tabindex` attribute.
189
+ * @param {HTMLElement} node
190
+ * @returns {boolean} True if so; false if not.
191
+ */
192
+ var hasTabIndex = function hasTabIndex(node) {
193
+ return !isNaN(parseInt(node.getAttribute('tabindex'), 10));
194
+ };
195
+
196
+ /**
197
+ * Determine the tab index of a given node.
198
+ * @param {HTMLElement} node
199
+ * @returns {number} Tab order (negative, 0, or positive number).
200
+ * @throws {Error} If `node` is falsy.
201
+ */
202
+ var getTabIndex = function getTabIndex(node) {
203
+ if (!node) {
204
+ throw new Error('No node provided');
205
+ }
184
206
  if (node.tabIndex < 0) {
185
207
  // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default
186
208
  // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,
@@ -189,16 +211,28 @@ var getTabindex = function getTabindex(node, isScope) {
189
211
  // order, consider their tab index to be 0.
190
212
  // Also browsers do not return `tabIndex` correctly for contentEditable nodes;
191
213
  // so if they don't have a tabindex attribute specifically set, assume it's 0.
192
- //
193
- // isScope is positive for custom element with shadow root or slot that by default
194
- // have tabIndex -1, but need to be sorted by document order in order for their
195
- // content to be inserted in the correct position
196
- if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && isNaN(parseInt(node.getAttribute('tabindex'), 10))) {
214
+ if ((/^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && !hasTabIndex(node)) {
197
215
  return 0;
198
216
  }
199
217
  }
200
218
  return node.tabIndex;
201
219
  };
220
+
221
+ /**
222
+ * Determine the tab index of a given node __for sort order purposes__.
223
+ * @param {HTMLElement} node
224
+ * @param {boolean} [isScope] True for a custom element with shadow root or slot that, by default,
225
+ * has tabIndex -1, but needs to be sorted by document order in order for its content to be
226
+ * inserted into the correct sort position.
227
+ * @returns {number} Tab order (negative, 0, or positive number).
228
+ */
229
+ var getSortOrderTabIndex = function getSortOrderTabIndex(node, isScope) {
230
+ var tabIndex = getTabIndex(node);
231
+ if (tabIndex < 0 && isScope && !hasTabIndex(node)) {
232
+ return 0;
233
+ }
234
+ return tabIndex;
235
+ };
202
236
  var sortOrderedTabbables = function sortOrderedTabbables(a, b) {
203
237
  return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
204
238
  };
@@ -441,7 +475,7 @@ var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(o
441
475
  return true;
442
476
  };
443
477
  var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {
444
- if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {
478
+ if (isNonTabbableRadio(node) || getTabIndex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {
445
479
  return false;
446
480
  }
447
481
  return true;
@@ -466,7 +500,7 @@ var sortByOrder = function sortByOrder(candidates) {
466
500
  candidates.forEach(function (item, i) {
467
501
  var isScope = !!item.scopeParent;
468
502
  var element = isScope ? item.scopeParent : item;
469
- var candidateTabindex = getTabindex(element, isScope);
503
+ var candidateTabindex = getSortOrderTabIndex(element, isScope);
470
504
  var elements = isScope ? sortByOrder(item.candidates) : element;
471
505
  if (candidateTabindex === 0) {
472
506
  isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
@@ -485,20 +519,32 @@ var sortByOrder = function sortByOrder(candidates) {
485
519
  return acc;
486
520
  }, []).concat(regularTabbables);
487
521
  };
488
- var tabbable = function tabbable(el, options) {
522
+ var tabbable = function tabbable(container, options) {
489
523
  options = options || {};
490
524
  var candidates;
491
525
  if (options.getShadowRoot) {
492
- candidates = getCandidatesIteratively([el], options.includeContainer, {
526
+ candidates = getCandidatesIteratively([container], options.includeContainer, {
493
527
  filter: isNodeMatchingSelectorTabbable.bind(null, options),
494
528
  flatten: false,
495
529
  getShadowRoot: options.getShadowRoot,
496
530
  shadowRootFilter: isValidShadowRootTabbable
497
531
  });
498
532
  } else {
499
- candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
533
+ candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
500
534
  }
501
535
  return sortByOrder(candidates);
502
536
  };
537
+ var isTabbable = function isTabbable(node, options) {
538
+ options = options || {};
539
+ if (!node) {
540
+ throw new Error('No node provided');
541
+ }
542
+ if (matches.call(node, candidateSelector) === false) {
543
+ return false;
544
+ }
545
+ return isNodeMatchingSelectorTabbable(options, node);
546
+ };
503
547
 
504
- export { tabbable };
548
+ exports.getTabIndex = getTabIndex;
549
+ exports.isTabbable = isTabbable;
550
+ exports.tabbable = tabbable;
@@ -1,297 +1,3 @@
1
- @layer fds.button {
2
- .fds-button-button-8fa00f0f {
3
- --fc-button-padding: 0 var(--fds-spacing-4);
4
- --fc-button-color: var(--fds-semantic-text-action-first-on_action);
5
-
6
- display: flex;
7
- align-items: center;
8
- border: var(--fds-border_width-default) solid transparent;
9
- color: var(--fc-button-color);
10
- fill: var(--fc-button-color);
11
- min-width: 2.5em;
12
- padding: var(--fc-button-padding);
13
- box-sizing: border-box;
14
- cursor: pointer;
15
- font-family: inherit;
16
- justify-content: center;
17
- text-align: center;
18
- text-decoration: none;
19
- position: relative;
20
- border-radius: var(--fds-border_radius-interactive);
21
- min-height: var(--fds-sizing-10);
22
- }
23
-
24
- .fds-button-button-8fa00f0f svg {
25
- overflow: visible;
26
- }
27
-
28
- .fds-button-small-8fa00f0f::before {
29
- position: absolute;
30
- top: 0;
31
- left: 0;
32
- width: auto;
33
- min-height: auto;
34
- content: '';
35
- }
36
-
37
- .fds-button-small-8fa00f0f::after {
38
- position: absolute;
39
- top: -5px;
40
- left: 0;
41
- width: 100%;
42
- height: 44px;
43
- content: '';
44
- }
45
-
46
- .fds-button-button-8fa00f0f:disabled,
47
- .fds-button-button-8fa00f0f[aria-disabled='true'] {
48
- cursor: not-allowed;
49
- opacity: var(--fds-opacity-disabled);
50
- }
51
-
52
- .fds-button-small-8fa00f0f {
53
- --fc-button-padding: 0 var(--fds-spacing-3);
54
-
55
- gap: var(--fds-sizing-1);
56
- font: var(--fds-typography-paragraph-short-small);
57
- font-family: inherit;
58
- min-height: var(--fds-sizing-10);
59
- }
60
-
61
- .fds-button-medium-8fa00f0f {
62
- --fc-button-padding: 0 var(--fds-spacing-4);
63
-
64
- gap: var(--fds-sizing-2);
65
- font: var(--fds-typography-paragraph-short-medium);
66
- font-family: inherit;
67
- min-height: var(--fds-sizing-12);
68
- }
69
-
70
- .fds-button-large-8fa00f0f {
71
- --fc-button-padding: 0 var(--fds-spacing-5);
72
-
73
- gap: var(--fds-sizing-2);
74
- font: var(--fds-typography-paragraph-short-large);
75
- font-family: inherit;
76
- min-height: var(--fds-sizing-14);
77
- }
78
-
79
- .fds-button-fullWidth-8fa00f0f {
80
- width: 100%;
81
- }
82
-
83
- .fds-button-secondary-8fa00f0f,
84
- .fds-button-tertiary-8fa00f0f {
85
- background-color: transparent;
86
- }
87
-
88
- .fds-button-onlyIcon-8fa00f0f {
89
- --fc-button-padding: 0;
90
- }
91
-
92
- /* Only use hover for non-touch devices to prevent sticky-hovering */
93
- @media (hover: hover) and (pointer: fine) {
94
- .fds-button-primary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
95
- background-color: var(--fds-semantic-surface-action-first-hover);
96
- }
97
-
98
- .fds-button-primary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
99
- background-color: var(--fds-semantic-surface-action-second-hover);
100
- }
101
-
102
- .fds-button-primary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
103
- background-color: var(--fds-semantic-surface-success-hover);
104
- }
105
-
106
- .fds-button-primary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
107
- background-color: var(--fds-semantic-surface-danger-hover);
108
- }
109
-
110
- .fds-button-secondary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
111
- --fc-button-color: var(--fds-semantic-text-action-first-hover);
112
-
113
- border-color: var(--fds-semantic-border-action-first-hover);
114
- background-color: var(--fds-semantic-surface-action-first-no_fill-hover);
115
- }
116
-
117
- .fds-button-secondary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
118
- --fc-button-color: var(--fds-semantic-text-action-second-hover);
119
-
120
- border-color: var(--fds-semantic-border-action-second-hover);
121
- background-color: var(--fds-semantic-surface-action-second-no_fill-hover);
122
- }
123
-
124
- .fds-button-secondary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
125
- --fc-button-color: var(--fds-semantic-text-success-hover);
126
-
127
- border-color: var(--fds-semantic-border-success-hover);
128
- background-color: var(--fds-semantic-surface-success-no_fill-hover);
129
- }
130
-
131
- .fds-button-secondary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
132
- --fc-button-color: var(--fds-semantic-text-danger-hover);
133
-
134
- border-color: var(--fds-semantic-border-danger-hover);
135
- background-color: var(--fds-semantic-surface-danger-no_fill-hover);
136
- }
137
-
138
- .fds-button-tertiary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
139
- --fc-button-color: var(--fds-semantic-text-action-first-hover);
140
-
141
- background-color: var(--fds-semantic-surface-action-first-no_fill-hover);
142
- }
143
-
144
- .fds-button-tertiary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
145
- --fc-button-color: var(--fds-semantic-text-action-second-hover);
146
-
147
- background-color: var(--fds-semantic-surface-action-second-no_fill-hover);
148
- }
149
-
150
- .fds-button-tertiary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
151
- --fc-button-color: var(--fds-semantic-text-success-hover);
152
-
153
- background-color: var(--fds-semantic-surface-success-no_fill-hover);
154
- }
155
-
156
- .fds-button-tertiary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):hover {
157
- --fc-button-color: var(--fds-semantic-text-danger-hover);
158
-
159
- background-color: var(--fds-semantic-surface-danger-no_fill-hover);
160
- }
161
- }
162
-
163
- /* Primary button colors */
164
- .fds-button-primary-8fa00f0f:where(.fds-button-first-8fa00f0f) {
165
- background-color: var(--fds-semantic-surface-action-first-default);
166
- }
167
-
168
- .fds-button-primary-8fa00f0f:where(.fds-button-second-8fa00f0f) {
169
- background-color: var(--fds-semantic-surface-action-second-default);
170
- }
171
-
172
- .fds-button-primary-8fa00f0f:where(.fds-button-success-8fa00f0f) {
173
- background-color: var(--fds-semantic-surface-success-default);
174
- }
175
-
176
- .fds-button-primary-8fa00f0f:where(.fds-button-danger-8fa00f0f) {
177
- background-color: var(--fds-semantic-surface-danger-default);
178
- }
179
-
180
- .fds-button-primary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):active {
181
- background-color: var(--fds-semantic-surface-action-first-active);
182
- }
183
-
184
- .fds-button-primary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):active {
185
- background-color: var(--fds-semantic-surface-action-second-active);
186
- }
187
-
188
- .fds-button-primary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):active {
189
- background-color: var(--fds-semantic-surface-success-active);
190
- }
191
-
192
- .fds-button-primary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):active {
193
- background-color: var(--fds-semantic-surface-danger-active);
194
- }
195
-
196
- /* Secondary button colors */
197
- .fds-button-secondary-8fa00f0f:where(.fds-button-first-8fa00f0f) {
198
- --fc-button-color: var(--fds-semantic-text-action-first-default);
199
-
200
- border-color: var(--fds-semantic-border-action-first-default);
201
- background-color: var(--fds-semantic-surface-action-first-no_fill);
202
- }
203
-
204
- .fds-button-secondary-8fa00f0f:where(.fds-button-second-8fa00f0f) {
205
- --fc-button-color: var(--fds-semantic-text-action-second-default);
206
-
207
- border-color: var(--fds-semantic-border-action-second-default);
208
- background-color: var(--fds-semantic-surface-action-second-no_fill);
209
- }
210
-
211
- .fds-button-secondary-8fa00f0f:where(.fds-button-success-8fa00f0f) {
212
- --fc-button-color: var(--fds-semantic-text-success-default);
213
-
214
- border-color: var(--fds-semantic-border-success-default);
215
- background-color: var(--fds-semantic-surface-success-no_fill);
216
- }
217
-
218
- .fds-button-secondary-8fa00f0f:where(.fds-button-danger-8fa00f0f) {
219
- --fc-button-color: var(--fds-semantic-text-danger-default);
220
-
221
- border-color: var(--fds-semantic-border-danger-default);
222
- background-color: var(--fds-semantic-surface-danger-no_fill);
223
- }
224
-
225
- .fds-button-secondary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):active {
226
- --fc-button-color: var(--fds-semantic-text-action-first-active);
227
-
228
- border-color: var(--fds-semantic-border-action-first-active);
229
- background-color: var(--fds-semantic-surface-action-first-no_fill-active);
230
- }
231
-
232
- .fds-button-secondary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):active {
233
- --fc-button-color: var(--fds-semantic-text-action-second-active);
234
-
235
- border-color: var(--fds-semantic-border-action-second-active);
236
- background-color: var(--fds-semantic-surface-action-second-no_fill-active);
237
- }
238
-
239
- .fds-button-secondary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):active {
240
- --fc-button-color: var(--fds-semantic-text-success-active);
241
-
242
- border-color: var(--fds-semantic-border-success-active);
243
- background-color: var(--fds-semantic-surface-success-no_fill-active);
244
- }
245
-
246
- .fds-button-secondary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):active {
247
- --fc-button-color: var(--fds-semantic-text-danger-active);
248
-
249
- border-color: var(--fds-semantic-border-danger-active);
250
- background-color: var(--fds-semantic-surface-danger-no_fill-active);
251
- }
252
-
253
- /* Tertiary button colors */
254
- .fds-button-tertiary-8fa00f0f:where(.fds-button-first-8fa00f0f) {
255
- --fc-button-color: var(--fds-semantic-text-action-first-default);
256
- }
257
-
258
- .fds-button-tertiary-8fa00f0f:where(.fds-button-second-8fa00f0f) {
259
- --fc-button-color: var(--fds-semantic-text-action-second-default);
260
- }
261
-
262
- .fds-button-tertiary-8fa00f0f:where(.fds-button-success-8fa00f0f) {
263
- --fc-button-color: var(--fds-semantic-text-success-default);
264
- }
265
-
266
- .fds-button-tertiary-8fa00f0f:where(.fds-button-danger-8fa00f0f) {
267
- --fc-button-color: var(--fds-semantic-text-danger-default);
268
- }
269
-
270
- .fds-button-tertiary-8fa00f0f:where(.fds-button-first-8fa00f0f):not([aria-disabled='true'], :disabled):active {
271
- --fc-button-color: var(--fds-semantic-text-action-first-active);
272
-
273
- background-color: var(--fds-semantic-surface-action-first-no_fill-active);
274
- }
275
-
276
- .fds-button-tertiary-8fa00f0f:where(.fds-button-second-8fa00f0f):not([aria-disabled='true'], :disabled):active {
277
- --fc-button-color: var(--fds-semantic-text-action-second-active);
278
-
279
- background-color: var(--fds-semantic-surface-action-second-no_fill-active);
280
- }
281
-
282
- .fds-button-tertiary-8fa00f0f:where(.fds-button-success-8fa00f0f):not([aria-disabled='true'], :disabled):active {
283
- --fc-button-color: var(--fds-semantic-text-success-active);
284
-
285
- background-color: var(--fds-semantic-surface-success-no_fill-active);
286
- }
287
-
288
- .fds-button-tertiary-8fa00f0f:where(.fds-button-danger-8fa00f0f):not([aria-disabled='true'], :disabled):active {
289
- --fc-button-color: var(--fds-semantic-text-danger-active);
290
-
291
- background-color: var(--fds-semantic-surface-danger-no_fill-active);
292
- }
293
- }
294
-
295
1
  @layer fds.paragraph {
296
2
  .fds-paragraph-paragraph-b69df5f3 {
297
3
  --fdsc-bottom-spacing: var(--fds-spacing-5);
@@ -1360,27 +1066,6 @@
1360
1066
  }
1361
1067
  }
1362
1068
 
1363
- @layer fds.skiplink {
1364
- .fds-skiplink-skiplink-d4abeaef:focus {
1365
- display: block;
1366
- outline: 0;
1367
- position: static;
1368
- width: auto;
1369
- height: auto;
1370
- margin: inherit;
1371
- overflow: visible;
1372
- clip: auto;
1373
- clip-path: none;
1374
- white-space: inherit;
1375
- text-decoration: underline;
1376
- text-decoration-thickness: 3px;
1377
- text-underline-offset: 0.3em;
1378
- padding: var(--fds-spacing-3) var(--fds-spacing-4) var(--fds-spacing-3) var(--fds-spacing-6);
1379
- color: var(--fds-semantic-text-neutral-default);
1380
- background: var(--fds-semantic-border-focus-outline);
1381
- }
1382
- }
1383
-
1384
1069
  @layer fds.tooltip {
1385
1070
  .fds-tooltip-wrapper-a3778147 {
1386
1071
  background: var(--fds-semantic-surface-neutral-inverted);
@@ -3,7 +3,7 @@
3
3
 
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
  var React = require('react');
6
- var floatingUi_react = require('../../node_modules/@floating-ui/react/dist/floating-ui.react.js');
6
+ var floatingUi_react = require('../../packages/react/node_modules/@floating-ui/react/dist/floating-ui.react.js');
7
7
  var index = require('../../node_modules/@radix-ui/react-slot/dist/index.js');
8
8
  var useRovingTabindex = require('./useRovingTabindex.js');
9
9
 
@@ -3,7 +3,7 @@
3
3
 
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
  var React = require('react');
6
- var floatingUi_react = require('../../node_modules/@floating-ui/react/dist/floating-ui.react.js');
6
+ var floatingUi_react = require('../../packages/react/node_modules/@floating-ui/react/dist/floating-ui.react.js');
7
7
  var index = require('../../node_modules/@radix-ui/react-slot/dist/index.js');
8
8
 
9
9
  const RovingTabindexContext = React.createContext({
@@ -17,9 +17,9 @@ const icons = {
17
17
  title: 'Feil',
18
18
  },
19
19
  };
20
- const Alert = forwardRef(({ severity = 'info', elevated, iconTitle, children, className, ...rest }, ref) => {
20
+ const Alert = forwardRef(({ severity = 'info', elevated, iconTitle, size, children, className, ...rest }, ref) => {
21
21
  const { Icon, title } = icons[severity];
22
- return (jsx("div", { ref: ref, className: clsx('fds-alert', `fds-alert--${severity}`, elevated && `fds-alert--elevated`, className), ...rest, children: jsxs(Fragment, { children: [jsx(Icon, { title: iconTitle || title, className: 'fds-alert__icon' }), jsx(Paragraph, { asChild: true, className: 'fds-alert__content', children: jsx("span", { children: children }) })] }) }));
22
+ return (jsx("div", { ref: ref, className: clsx('fds-alert', `fds-alert--${size}`, `fds-alert--${severity}`, elevated && `fds-alert--elevated`, className), ...rest, children: jsxs(Fragment, { children: [jsx(Icon, { title: iconTitle || title, className: 'fds-alert__icon' }), jsx(Paragraph, { asChild: true, size: size, className: 'fds-alert__content', children: jsx("span", { children: children }) })] }) }));
23
23
  });
24
24
  Alert.displayName = 'Alert';
25
25
 
@@ -3,14 +3,13 @@ import { jsx } from 'react/jsx-runtime';
3
3
  import { forwardRef } from 'react';
4
4
  import { clsx } from '../../node_modules/clsx/dist/clsx.js';
5
5
  import { Slot as $5e63c961fc1ce211$export$8c6ed5c666ac1360 } from '../../node_modules/@radix-ui/react-slot/dist/index.js';
6
- import classes from './Button.module.css.js';
7
6
 
8
7
  /**
9
8
  * Button used for interaction
10
9
  */
11
10
  const Button = forwardRef(({ children, color = 'first', variant = 'primary', size = 'medium', fullWidth = false, icon = false, type = 'button', className, as = 'button', asChild, ...rest }, ref) => {
12
11
  const Component = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : as;
13
- return (jsx(Component, { ref: ref, type: type, className: clsx(classes.button, `fds-focus`, classes[size], classes[variant], classes[color], { [classes.fullWidth]: fullWidth }, { [classes.onlyIcon]: icon }, className), ...rest, children: children }));
12
+ return (jsx(Component, { ref: ref, type: type, className: clsx('fds-btn', `fds-focus`, `fds-btn--${size}`, `fds-btn--${variant}`, `fds-btn--${color}`, { 'fds-btn--full-width': fullWidth }, { 'fds-btn--icon-only': icon }, className), ...rest, children: children }));
14
13
  });
15
14
  Button.displayName = 'Button';
16
15