@nova-design-system/nova-webcomponents 3.31.2-beta.4 → 3.33.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 (171) hide show
  1. package/THIRD_PARTY_NOTICES.txt +89925 -90780
  2. package/dist/cjs/events.utils-CIlm7hGM.js +47 -0
  3. package/dist/cjs/index.cjs.js +1 -1
  4. package/dist/cjs/{index.esm-CG1TVKfu.js → index.esm-D5HbQDBa.js} +48 -30
  5. package/dist/cjs/nv-calendar.cjs.entry.js +2 -2
  6. package/dist/cjs/nv-dialog.cjs.entry.js +35 -14
  7. package/dist/cjs/nv-drawer.cjs.entry.js +6 -6
  8. package/dist/cjs/nv-fieldcheckbox.cjs.entry.js +1 -1
  9. package/dist/cjs/nv-fielddate.cjs.entry.js +1 -1
  10. package/dist/cjs/nv-fielddaterange.cjs.entry.js +1 -1
  11. package/dist/cjs/nv-fielddropdown.cjs.entry.js +1 -1
  12. package/dist/cjs/nv-fieldmultiselect.cjs.entry.js +1 -1
  13. package/dist/cjs/nv-fieldnumber.cjs.entry.js +1 -1
  14. package/dist/cjs/nv-fieldpassword.cjs.entry.js +1 -1
  15. package/dist/cjs/nv-fieldradio.cjs.entry.js +21 -6
  16. package/dist/cjs/nv-fieldselect.cjs.entry.js +1 -1
  17. package/dist/cjs/nv-fieldslider.cjs.entry.js +1 -1
  18. package/dist/cjs/nv-fieldtext.cjs.entry.js +1 -1
  19. package/dist/cjs/nv-fieldtextarea.cjs.entry.js +1 -1
  20. package/dist/cjs/nv-fieldtime.cjs.entry.js +1 -1
  21. package/dist/cjs/nv-icon.cjs.entry.js +1 -1
  22. package/dist/cjs/nv-notification.cjs.entry.js +1 -1
  23. package/dist/cjs/nv-popover.cjs.entry.js +182 -136
  24. package/dist/cjs/nv-toggle.cjs.entry.js +1 -1
  25. package/dist/cjs/v4-_2BfiRUa.js +52 -0
  26. package/dist/collection/components/nv-dialog/nv-dialog.css +8 -7
  27. package/dist/collection/components/nv-dialog/nv-dialog.docs.js +7 -0
  28. package/dist/collection/components/nv-dialog/nv-dialog.js +30 -9
  29. package/dist/collection/components/nv-drawer/nv-drawer.js +2 -2
  30. package/dist/collection/components/nv-fieldradio/nv-fieldradio.docs.js +10 -0
  31. package/dist/collection/components/nv-fieldradio/nv-fieldradio.js +20 -5
  32. package/dist/collection/components/nv-popover/nv-popover.js +13 -7
  33. package/dist/collection/utils/events.utils.js +28 -10
  34. package/dist/components/index.js +1 -1
  35. package/dist/components/nv-accordion-item.js +1 -1
  36. package/dist/components/nv-accordion.js +1 -1
  37. package/dist/components/nv-alert.js +1 -1
  38. package/dist/components/nv-avatar.js +1 -1
  39. package/dist/components/nv-badge.js +1 -1
  40. package/dist/components/nv-breadcrumb.js +1 -1
  41. package/dist/components/nv-calendar.js +1 -1
  42. package/dist/components/nv-datagrid.js +1 -1
  43. package/dist/components/nv-dialog.js +1 -1
  44. package/dist/components/nv-dialogfooter.js +1 -1
  45. package/dist/components/nv-drawer.js +1 -1
  46. package/dist/components/nv-drawerfooter.js +1 -1
  47. package/dist/components/nv-fieldcheckbox.js +1 -1
  48. package/dist/components/nv-fielddate.js +1 -1
  49. package/dist/components/nv-fielddaterange.js +1 -1
  50. package/dist/components/nv-fielddropdown.js +1 -1
  51. package/dist/components/nv-fielddropdownitem.js +1 -1
  52. package/dist/components/nv-fielddropdownitemcheck.js +1 -1
  53. package/dist/components/nv-fieldmultiselect.js +1 -1
  54. package/dist/components/nv-fieldnumber.js +1 -1
  55. package/dist/components/nv-fieldpassword.js +1 -1
  56. package/dist/components/nv-fieldradio.js +1 -1
  57. package/dist/components/nv-fieldselect.js +1 -1
  58. package/dist/components/nv-fieldslider.js +1 -1
  59. package/dist/components/nv-fieldtext.js +1 -1
  60. package/dist/components/nv-fieldtextarea.js +1 -1
  61. package/dist/components/nv-fieldtime.js +1 -1
  62. package/dist/components/nv-icon.js +1 -1
  63. package/dist/components/nv-iconbutton.js +1 -1
  64. package/dist/components/nv-menu.js +1 -1
  65. package/dist/components/nv-menuitem.js +1 -1
  66. package/dist/components/nv-notification.js +1 -1
  67. package/dist/components/nv-pagination-nav.js +1 -1
  68. package/dist/components/nv-paginationtable.js +1 -1
  69. package/dist/components/nv-pill.js +1 -1
  70. package/dist/components/nv-popover.js +1 -1
  71. package/dist/components/nv-sidebar.js +1 -1
  72. package/dist/components/nv-sidebarnavitem.js +1 -1
  73. package/dist/components/nv-statusindicator.js +1 -1
  74. package/dist/components/nv-tableheader.js +1 -1
  75. package/dist/components/nv-tag.js +1 -1
  76. package/dist/components/nv-toggle.js +1 -1
  77. package/dist/components/nv-tooltip.js +1 -1
  78. package/dist/components/{p-m37Anefm.js → p-8N4lU0iY.js} +1 -1
  79. package/dist/components/p-B0u4Ixsb.js +1 -0
  80. package/dist/components/{p-BWRw4xPL.js → p-B4Bj7woW.js} +1 -1
  81. package/dist/components/{p-DiZ4PH5U.js → p-BO1b1Va8.js} +1 -1
  82. package/dist/components/{p-p6cOkAo9.js → p-BRGkbQcZ.js} +1 -1
  83. package/dist/components/{p-DCP9DeqM.js → p-Bb6b1l7X.js} +1 -1
  84. package/dist/components/p-BysSxG1C.js +1 -0
  85. package/dist/components/p-C4Gisby9.js +1 -0
  86. package/dist/components/{p-CHBitkH2.js → p-C5hX9g5W.js} +1 -1
  87. package/dist/components/p-CK3_k8jD.js +1 -0
  88. package/dist/components/p-DBTxpXCn.js +5 -0
  89. package/dist/components/{p-CM4DYhll.js → p-DNND0rYo.js} +1 -1
  90. package/dist/components/{p-C0sYXnfw.js → p-DnFgexAD.js} +1 -1
  91. package/dist/components/{p-151La_Re.js → p-DtrETIc3.js} +1 -1
  92. package/dist/components/{p-BLVk95gn.js → p-DyrYhAHY.js} +1 -1
  93. package/dist/components/p-S0RrRAAC.js +1 -0
  94. package/dist/components/{p-N_OyEprf.js → p-XZ5yyea3.js} +1 -1
  95. package/dist/components/{p-MJEiA0Bq.js → p-Z4Q7ZQYs.js} +1 -1
  96. package/dist/components/{p-6T2ybMzE.js → p-iZAJ4_uI.js} +1 -1
  97. package/dist/components/{p-DQwzzl-e.js → p-vcF-XOKu.js} +1 -1
  98. package/dist/esm/events.utils-BysSxG1C.js +43 -0
  99. package/dist/esm/{index.esm-D3eWMME9.js → index.esm-DBTxpXCn.js} +48 -30
  100. package/dist/esm/index.js +1 -1
  101. package/dist/esm/nv-calendar.entry.js +2 -2
  102. package/dist/esm/nv-dialog.entry.js +35 -14
  103. package/dist/esm/nv-drawer.entry.js +6 -6
  104. package/dist/esm/nv-fieldcheckbox.entry.js +1 -1
  105. package/dist/esm/nv-fielddate.entry.js +1 -1
  106. package/dist/esm/nv-fielddaterange.entry.js +1 -1
  107. package/dist/esm/nv-fielddropdown.entry.js +1 -1
  108. package/dist/esm/nv-fieldmultiselect.entry.js +1 -1
  109. package/dist/esm/nv-fieldnumber.entry.js +1 -1
  110. package/dist/esm/nv-fieldpassword.entry.js +1 -1
  111. package/dist/esm/nv-fieldradio.entry.js +21 -6
  112. package/dist/esm/nv-fieldselect.entry.js +1 -1
  113. package/dist/esm/nv-fieldslider.entry.js +1 -1
  114. package/dist/esm/nv-fieldtext.entry.js +1 -1
  115. package/dist/esm/nv-fieldtextarea.entry.js +1 -1
  116. package/dist/esm/nv-fieldtime.entry.js +1 -1
  117. package/dist/esm/nv-icon.entry.js +1 -1
  118. package/dist/esm/nv-notification.entry.js +1 -1
  119. package/dist/esm/nv-popover.entry.js +182 -136
  120. package/dist/esm/nv-toggle.entry.js +1 -1
  121. package/dist/esm/v4-CK3_k8jD.js +50 -0
  122. package/dist/native/index.esm.js +1 -1
  123. package/dist/native/native.esm.js +1 -1
  124. package/dist/native/p-003aae89.entry.js +1 -0
  125. package/dist/native/p-0a067f5d.entry.js +1 -0
  126. package/dist/native/{p-7a2189fd.entry.js → p-0cfa2a12.entry.js} +1 -1
  127. package/dist/native/{p-29283b5d.entry.js → p-0e1f410b.entry.js} +1 -1
  128. package/dist/native/{p-f49dac2e.entry.js → p-1a77f957.entry.js} +1 -1
  129. package/dist/native/{p-fde8def2.entry.js → p-25e0f795.entry.js} +1 -1
  130. package/dist/native/p-2808c51d.entry.js +1 -0
  131. package/dist/native/{p-a14356a2.entry.js → p-3ad4b348.entry.js} +1 -1
  132. package/dist/native/{p-84069455.entry.js → p-5084e62a.entry.js} +1 -1
  133. package/dist/native/{p-f551703a.entry.js → p-59bab8ca.entry.js} +1 -1
  134. package/dist/native/p-67c4583d.entry.js +1 -0
  135. package/dist/native/{p-9ae86283.entry.js → p-6c200454.entry.js} +1 -1
  136. package/dist/native/{p-282f27a8.entry.js → p-96debbf0.entry.js} +1 -1
  137. package/dist/native/p-9d4f3fa8.entry.js +1 -0
  138. package/dist/native/p-BysSxG1C.js +1 -0
  139. package/dist/native/p-CK3_k8jD.js +1 -0
  140. package/dist/native/p-DBTxpXCn.js +5 -0
  141. package/dist/native/p-ab22c992.entry.js +1 -0
  142. package/dist/native/{p-f35cfcf7.entry.js → p-ade6d065.entry.js} +1 -1
  143. package/dist/native/{p-006b0662.entry.js → p-c0cb8fbd.entry.js} +1 -1
  144. package/dist/native/{p-35cca4d2.entry.js → p-c59cbcf7.entry.js} +1 -1
  145. package/dist/native/{p-0be43863.entry.js → p-dd636420.entry.js} +1 -1
  146. package/dist/native/{p-9cb72554.entry.js → p-fe8e022f.entry.js} +1 -1
  147. package/dist/types/components/nv-dialog/nv-dialog.d.ts +10 -0
  148. package/dist/types/components/nv-fieldradio/nv-fieldradio.d.ts +2 -0
  149. package/dist/types/utils/events.utils.d.ts +29 -8
  150. package/hydrate/index.js +358 -245
  151. package/hydrate/index.mjs +358 -245
  152. package/package.json +2 -2
  153. package/dist/cjs/events.utils-BE6R5q9C.js +0 -30
  154. package/dist/cjs/v4-C1vaJ4yP.js +0 -56
  155. package/dist/components/p-B4EbX_RC.js +0 -1
  156. package/dist/components/p-B6GgGra-.js +0 -1
  157. package/dist/components/p-BdYh22OP.js +0 -1
  158. package/dist/components/p-CtKp5aji.js +0 -1
  159. package/dist/components/p-D3eWMME9.js +0 -5
  160. package/dist/components/p-hklkrJsV.js +0 -1
  161. package/dist/esm/events.utils-B6GgGra-.js +0 -26
  162. package/dist/esm/v4-BdYh22OP.js +0 -54
  163. package/dist/native/p-11ae498c.entry.js +0 -1
  164. package/dist/native/p-193d5813.entry.js +0 -1
  165. package/dist/native/p-38b731e1.entry.js +0 -1
  166. package/dist/native/p-45191d81.entry.js +0 -1
  167. package/dist/native/p-520e5d0d.entry.js +0 -1
  168. package/dist/native/p-B6GgGra-.js +0 -1
  169. package/dist/native/p-BdYh22OP.js +0 -1
  170. package/dist/native/p-D3eWMME9.js +0 -5
  171. package/dist/native/p-ba32c793.entry.js +0 -1
@@ -5,7 +5,7 @@ import { u as useFade } from './fade.animation-DcRL9lcm.js';
5
5
  import './style-value-types.es-xlgmw4x8.js';
6
6
  import { u as useSlide } from './slide.animation-CmH5d1of.js';
7
7
  import { p as parallel } from './timeline.animation-CgHCo_Ho.js';
8
- import { v as v4 } from './v4-BdYh22OP.js';
8
+ import { v as v4 } from './v4-CK3_k8jD.js';
9
9
 
10
10
  const nvNotificationCss = () => `nv-notification{display:block}nv-notification [data-scope=container]{display:flex;position:relative;max-width:512px;width:100%;padding:var(--notification-padding);align-items:flex-start;gap:var(--notification-gap-x);border-radius:var(--notification-radius);border-style:solid;box-shadow:0 var(--shadow-y-axis-lg-1, 4px) var(--shadow-blur-lg-1, 6px) var(--shadow-spread-lg-1, -2px) var(--shadow-color-opacity-1, rgba(14, 14, 14, 0.06)), 0 var(--shadow-y-axis-lg-2, 10px) var(--shadow-blur-lg-2, 15px) var(--shadow-spread-lg-2, -3px) var(--shadow-color-opacity-2, rgba(14, 14, 14, 0.1))}nv-notification [data-scope=container] [data-scope=icon]{flex-shrink:0}nv-notification [data-scope=container] [data-scope=dismiss]{padding:var(--button-sm-icon-button-padding, 8px);justify-content:center;align-items:center;gap:var(--button-sm-gap, 6px);display:flex;position:absolute;right:8px;top:8px;border-radius:var(--button-sm-border-radius, 4px);background:var(--components-button-lower-background, rgba(255, 255, 255, 0));color:var(--components-button-lower-icon)}nv-notification [data-scope=container] [data-scope=content]{display:flex;padding-right:var(--notification-padding-right);flex-direction:column;align-items:flex-start;gap:var(--notification-gap-y);flex:1 0 0}nv-notification [data-scope=container] [data-scope=content] [data-scope=heading]{display:flex;align-items:flex-start;gap:var(--notification-gap-x);align-self:stretch;color:var(--components-notification-content-title);font-size:var(--notification-title-font-size);font-style:normal;font-weight:var(--font-weight-medium-emphasis);line-height:20px;}nv-notification [data-scope=container] [data-scope=content] [data-scope=message]{display:flex;flex-direction:column;align-items:flex-start;gap:var(--notification-gap-y);align-self:stretch;color:var(--components-notification-content-description);font-variant-numeric:lining-nums tabular-nums slashed-zero;font-size:var(--font-size-sm, 14px);font-style:normal;font-weight:var(--font-weight-low-emphasis);line-height:var(--line-height-sm, 20px)}nv-notification [data-scope=container] [data-scope=content] [data-scope=actions]{display:flex;padding:var(--spacing-2, 8px) 0;padding-bottom:0px;align-items:flex-start;gap:var(--notification-gap-x);align-self:stretch;margin-left:calc(-1 * var(--button-sm-padding-x))}nv-notification[feedback=information] [data-scope=container]{background-color:var(--components-notification-information-background);border-color:var(--components-notification-information-border)}nv-notification[feedback=information] [data-scope=container] [data-scope=icon]{color:var(--components-notification-information-icon)}nv-notification[feedback=information]>[data-scope=close]:focus,nv-notification[feedback=information]>[data-scope=close]:focus-within{outline:none}nv-notification[feedback=information]>[data-scope=close]:focus-visible,nv-notification[feedback=information]>[data-scope=close]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-notification-information-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-notification[feedback=warning] [data-scope=container]{background-color:var(--components-notification-warning-background);border-color:var(--components-notification-warning-border)}nv-notification[feedback=warning] [data-scope=container] [data-scope=icon]{color:var(--components-notification-warning-icon)}nv-notification[feedback=warning]>[data-scope=close]:focus,nv-notification[feedback=warning]>[data-scope=close]:focus-within{outline:none}nv-notification[feedback=warning]>[data-scope=close]:focus-visible,nv-notification[feedback=warning]>[data-scope=close]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-notification-warning-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-notification[feedback=error] [data-scope=container]{background-color:var(--components-notification-error-background);border-color:var(--components-notification-error-border)}nv-notification[feedback=error] [data-scope=container] [data-scope=icon]{color:var(--components-notification-error-icon)}nv-notification[feedback=error]>[data-scope=close]:focus,nv-notification[feedback=error]>[data-scope=close]:focus-within{outline:none}nv-notification[feedback=error]>[data-scope=close]:focus-visible,nv-notification[feedback=error]>[data-scope=close]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-notification-error-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-notification[feedback=success] [data-scope=container]{background-color:var(--components-notification-success-background);border-color:var(--components-notification-success-border)}nv-notification[feedback=success] [data-scope=container] [data-scope=icon]{color:var(--components-notification-success-icon)}nv-notification[feedback=success]>[data-scope=close]:focus,nv-notification[feedback=success]>[data-scope=close]:focus-within{outline:none}nv-notification[feedback=success]>[data-scope=close]:focus-visible,nv-notification[feedback=success]>[data-scope=close]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-notification-success-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-notification[feedback=neutral] [data-scope=container]{background-color:var(--components-notification-neutral-background);border-color:var(--components-notification-neutral-border)}nv-notification[feedback=neutral] [data-scope=container] [data-scope=icon]{color:var(--components-notification-neutral-icon)}nv-notification[feedback=neutral]>[data-scope=close]:focus,nv-notification[feedback=neutral]>[data-scope=close]:focus-within{outline:none}nv-notification[feedback=neutral]>[data-scope=close]:focus-visible,nv-notification[feedback=neutral]>[data-scope=close]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-notification-neutral-border);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-notification[emphasis=high] [data-scope=container]{border-width:1px;border-left-width:var(--notification-border-width-high-emphasis);padding-left:calc(var(--notification-padding) - var(--notification-border-width-high-emphasis) + 1px)}nv-notification[emphasis=medium] [data-scope=container]{border-width:var(--notification-border-width-low-emphasis);border-color:var(--color-content-low-border, #E3E3E3)}`;
11
11
 
@@ -2,7 +2,7 @@ import { S as StencilCore, r as registerInstance, a as createEvent, h, d as Host
2
2
  import { u as useFade } from './fade.animation-DcRL9lcm.js';
3
3
  import { u as useGrow } from './grow.animation-D7ep_aVl.js';
4
4
  import './style-value-types.es-xlgmw4x8.js';
5
- import { a as addEventListeners, r as removeEventListeners } from './events.utils-B6GgGra-.js';
5
+ import { a as addEventListeners, r as removeEventListeners } from './events.utils-BysSxG1C.js';
6
6
  import { a as asElement } from './dom.utils-CuXVGECR.js';
7
7
 
8
8
  /**
@@ -23,10 +23,6 @@ const oppositeSideMap = {
23
23
  bottom: 'top',
24
24
  top: 'bottom'
25
25
  };
26
- const oppositeAlignmentMap = {
27
- start: 'end',
28
- end: 'start'
29
- };
30
26
  function clamp(start, value, end) {
31
27
  return max(start, min(value, end));
32
28
  }
@@ -46,7 +42,8 @@ function getAxisLength(axis) {
46
42
  return axis === 'y' ? 'height' : 'width';
47
43
  }
48
44
  function getSideAxis(placement) {
49
- return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
45
+ const firstChar = placement[0];
46
+ return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';
50
47
  }
51
48
  function getAlignmentAxis(placement) {
52
49
  return getOppositeAxis(getSideAxis(placement));
@@ -69,21 +66,21 @@ function getExpandedPlacements(placement) {
69
66
  return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
70
67
  }
71
68
  function getOppositeAlignmentPlacement(placement) {
72
- return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
69
+ return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');
73
70
  }
71
+ const lrPlacement = ['left', 'right'];
72
+ const rlPlacement = ['right', 'left'];
73
+ const tbPlacement = ['top', 'bottom'];
74
+ const btPlacement = ['bottom', 'top'];
74
75
  function getSideList(side, isStart, rtl) {
75
- const lr = ['left', 'right'];
76
- const rl = ['right', 'left'];
77
- const tb = ['top', 'bottom'];
78
- const bt = ['bottom', 'top'];
79
76
  switch (side) {
80
77
  case 'top':
81
78
  case 'bottom':
82
- if (rtl) return isStart ? rl : lr;
83
- return isStart ? lr : rl;
79
+ if (rtl) return isStart ? rlPlacement : lrPlacement;
80
+ return isStart ? lrPlacement : rlPlacement;
84
81
  case 'left':
85
82
  case 'right':
86
- return isStart ? tb : bt;
83
+ return isStart ? tbPlacement : btPlacement;
87
84
  default:
88
85
  return [];
89
86
  }
@@ -100,7 +97,8 @@ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
100
97
  return list;
101
98
  }
102
99
  function getOppositePlacement(placement) {
103
- return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
100
+ const side = getSide(placement);
101
+ return oppositeSideMap[side] + placement.slice(side.length);
104
102
  }
105
103
  function expandPaddingObject(padding) {
106
104
  return {
@@ -194,6 +192,74 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
194
192
  return coords;
195
193
  }
196
194
 
195
+ /**
196
+ * Resolves with an object of overflow side offsets that determine how much the
197
+ * element is overflowing a given clipping boundary on each side.
198
+ * - positive = overflowing the boundary by that number of pixels
199
+ * - negative = how many pixels left before it will overflow
200
+ * - 0 = lies flush with the boundary
201
+ * @see https://floating-ui.com/docs/detectOverflow
202
+ */
203
+ async function detectOverflow(state, options) {
204
+ var _await$platform$isEle;
205
+ if (options === void 0) {
206
+ options = {};
207
+ }
208
+ const {
209
+ x,
210
+ y,
211
+ platform,
212
+ rects,
213
+ elements,
214
+ strategy
215
+ } = state;
216
+ const {
217
+ boundary = 'clippingAncestors',
218
+ rootBoundary = 'viewport',
219
+ elementContext = 'floating',
220
+ altBoundary = false,
221
+ padding = 0
222
+ } = evaluate(options, state);
223
+ const paddingObject = getPaddingObject(padding);
224
+ const altContext = elementContext === 'floating' ? 'reference' : 'floating';
225
+ const element = elements[altBoundary ? altContext : elementContext];
226
+ const clippingClientRect = rectToClientRect(await platform.getClippingRect({
227
+ element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
228
+ boundary,
229
+ rootBoundary,
230
+ strategy
231
+ }));
232
+ const rect = elementContext === 'floating' ? {
233
+ x,
234
+ y,
235
+ width: rects.floating.width,
236
+ height: rects.floating.height
237
+ } : rects.reference;
238
+ const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
239
+ const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
240
+ x: 1,
241
+ y: 1
242
+ } : {
243
+ x: 1,
244
+ y: 1
245
+ };
246
+ const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
247
+ elements,
248
+ rect,
249
+ offsetParent,
250
+ strategy
251
+ }) : rect);
252
+ return {
253
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
254
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
255
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
256
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
257
+ };
258
+ }
259
+
260
+ // Maximum number of resets that can occur before bailing to avoid infinite reset loops.
261
+ const MAX_RESET_COUNT = 50;
262
+
197
263
  /**
198
264
  * Computes the `x` and `y` coordinates that will place the floating element
199
265
  * next to a given reference element.
@@ -208,7 +274,10 @@ const computePosition$1 = async (reference, floating, config) => {
208
274
  middleware = [],
209
275
  platform
210
276
  } = config;
211
- const validMiddleware = middleware.filter(Boolean);
277
+ const platformWithDetectOverflow = platform.detectOverflow ? platform : {
278
+ ...platform,
279
+ detectOverflow
280
+ };
212
281
  const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
213
282
  let rects = await platform.getElementRects({
214
283
  reference,
@@ -220,13 +289,17 @@ const computePosition$1 = async (reference, floating, config) => {
220
289
  y
221
290
  } = computeCoordsFromPlacement(rects, placement, rtl);
222
291
  let statefulPlacement = placement;
223
- let middlewareData = {};
224
292
  let resetCount = 0;
225
- for (let i = 0; i < validMiddleware.length; i++) {
293
+ const middlewareData = {};
294
+ for (let i = 0; i < middleware.length; i++) {
295
+ const currentMiddleware = middleware[i];
296
+ if (!currentMiddleware) {
297
+ continue;
298
+ }
226
299
  const {
227
300
  name,
228
301
  fn
229
- } = validMiddleware[i];
302
+ } = currentMiddleware;
230
303
  const {
231
304
  x: nextX,
232
305
  y: nextY,
@@ -240,7 +313,7 @@ const computePosition$1 = async (reference, floating, config) => {
240
313
  strategy,
241
314
  middlewareData,
242
315
  rects,
243
- platform,
316
+ platform: platformWithDetectOverflow,
244
317
  elements: {
245
318
  reference,
246
319
  floating
@@ -248,14 +321,11 @@ const computePosition$1 = async (reference, floating, config) => {
248
321
  });
249
322
  x = nextX != null ? nextX : x;
250
323
  y = nextY != null ? nextY : y;
251
- middlewareData = {
252
- ...middlewareData,
253
- [name]: {
254
- ...middlewareData[name],
255
- ...data
256
- }
324
+ middlewareData[name] = {
325
+ ...middlewareData[name],
326
+ ...data
257
327
  };
258
- if (reset && resetCount <= 50) {
328
+ if (reset && resetCount < MAX_RESET_COUNT) {
259
329
  resetCount++;
260
330
  if (typeof reset === 'object') {
261
331
  if (reset.placement) {
@@ -285,71 +355,6 @@ const computePosition$1 = async (reference, floating, config) => {
285
355
  };
286
356
  };
287
357
 
288
- /**
289
- * Resolves with an object of overflow side offsets that determine how much the
290
- * element is overflowing a given clipping boundary on each side.
291
- * - positive = overflowing the boundary by that number of pixels
292
- * - negative = how many pixels left before it will overflow
293
- * - 0 = lies flush with the boundary
294
- * @see https://floating-ui.com/docs/detectOverflow
295
- */
296
- async function detectOverflow(state, options) {
297
- var _await$platform$isEle;
298
- if (options === void 0) {
299
- options = {};
300
- }
301
- const {
302
- x,
303
- y,
304
- platform,
305
- rects,
306
- elements,
307
- strategy
308
- } = state;
309
- const {
310
- boundary = 'clippingAncestors',
311
- rootBoundary = 'viewport',
312
- elementContext = 'floating',
313
- altBoundary = false,
314
- padding = 0
315
- } = evaluate(options, state);
316
- const paddingObject = getPaddingObject(padding);
317
- const altContext = elementContext === 'floating' ? 'reference' : 'floating';
318
- const element = elements[altBoundary ? altContext : elementContext];
319
- const clippingClientRect = rectToClientRect(await platform.getClippingRect({
320
- element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
321
- boundary,
322
- rootBoundary,
323
- strategy
324
- }));
325
- const rect = elementContext === 'floating' ? {
326
- x,
327
- y,
328
- width: rects.floating.width,
329
- height: rects.floating.height
330
- } : rects.reference;
331
- const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
332
- const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
333
- x: 1,
334
- y: 1
335
- } : {
336
- x: 1,
337
- y: 1
338
- };
339
- const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
340
- elements,
341
- rect,
342
- offsetParent,
343
- strategy
344
- }) : rect);
345
- return {
346
- top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
347
- bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
348
- left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
349
- right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
350
- };
351
- }
352
-
353
358
  /**
354
359
  * Provides data to position an inner element of the floating element so that it
355
360
  * appears centered to the reference element.
@@ -473,14 +478,16 @@ const flip$1 = function (options) {
473
478
  return {};
474
479
  }
475
480
  const side = getSide(placement);
481
+ const initialSideAxis = getSideAxis(initialPlacement);
476
482
  const isBasePlacement = getSide(initialPlacement) === initialPlacement;
477
483
  const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
478
484
  const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
479
- if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {
485
+ const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
486
+ if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
480
487
  fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
481
488
  }
482
489
  const placements = [initialPlacement, ...fallbackPlacements];
483
- const overflow = await detectOverflow(state, detectOverflowOptions);
490
+ const overflow = await platform.detectOverflow(state, detectOverflowOptions);
484
491
  const overflows = [];
485
492
  let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
486
493
  if (checkMainAxis) {
@@ -501,16 +508,22 @@ const flip$1 = function (options) {
501
508
  const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
502
509
  const nextPlacement = placements[nextIndex];
503
510
  if (nextPlacement) {
504
- // Try next placement and re-run the lifecycle.
505
- return {
506
- data: {
507
- index: nextIndex,
508
- overflows: overflowsData
509
- },
510
- reset: {
511
- placement: nextPlacement
512
- }
513
- };
511
+ const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
512
+ if (!ignoreCrossAxisOverflow ||
513
+ // We leave the current main axis only if every placement on that axis
514
+ // overflows the main axis.
515
+ overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
516
+ // Try next placement and re-run the lifecycle.
517
+ return {
518
+ data: {
519
+ index: nextIndex,
520
+ overflows: overflowsData
521
+ },
522
+ reset: {
523
+ placement: nextPlacement
524
+ }
525
+ };
526
+ }
514
527
  }
515
528
 
516
529
  // First, find the candidates that fit on the mainAxis side of overflow,
@@ -522,8 +535,17 @@ const flip$1 = function (options) {
522
535
  switch (fallbackStrategy) {
523
536
  case 'bestFit':
524
537
  {
525
- var _overflowsData$map$so;
526
- const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
538
+ var _overflowsData$filter2;
539
+ const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
540
+ if (hasFallbackAxisSideDirection) {
541
+ const currentSideAxis = getSideAxis(d.placement);
542
+ return currentSideAxis === initialSideAxis ||
543
+ // Create a bias to the `y` side axis due to horizontal
544
+ // reading directions favoring greater width.
545
+ currentSideAxis === 'y';
546
+ }
547
+ return true;
548
+ }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
527
549
  if (placement) {
528
550
  resetPlacement = placement;
529
551
  }
@@ -547,6 +569,8 @@ const flip$1 = function (options) {
547
569
  };
548
570
  };
549
571
 
572
+ const originSides = /*#__PURE__*/new Set(['left', 'top']);
573
+
550
574
  // For type backwards-compatibility, the `OffsetOptions` type was also
551
575
  // Derivable.
552
576
 
@@ -560,7 +584,7 @@ async function convertValueToCoords(state, options) {
560
584
  const side = getSide(placement);
561
585
  const alignment = getAlignment(placement);
562
586
  const isVertical = getSideAxis(placement) === 'y';
563
- const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
587
+ const mainAxisMulti = originSides.has(side) ? -1 : 1;
564
588
  const crossAxisMulti = rtl && isVertical ? -1 : 1;
565
589
  const rawValue = evaluate(options, state);
566
590
 
@@ -574,10 +598,9 @@ async function convertValueToCoords(state, options) {
574
598
  crossAxis: 0,
575
599
  alignmentAxis: null
576
600
  } : {
577
- mainAxis: 0,
578
- crossAxis: 0,
579
- alignmentAxis: null,
580
- ...rawValue
601
+ mainAxis: rawValue.mainAxis || 0,
602
+ crossAxis: rawValue.crossAxis || 0,
603
+ alignmentAxis: rawValue.alignmentAxis
581
604
  };
582
605
  if (alignment && typeof alignmentAxis === 'number') {
583
606
  crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
@@ -648,7 +671,8 @@ const shift$1 = function (options) {
648
671
  const {
649
672
  x,
650
673
  y,
651
- placement
674
+ placement,
675
+ platform
652
676
  } = state;
653
677
  const {
654
678
  mainAxis: checkMainAxis = true,
@@ -671,7 +695,7 @@ const shift$1 = function (options) {
671
695
  x,
672
696
  y
673
697
  };
674
- const overflow = await detectOverflow(state, detectOverflowOptions);
698
+ const overflow = await platform.detectOverflow(state, detectOverflowOptions);
675
699
  const crossAxis = getSideAxis(getSide(placement));
676
700
  const mainAxis = getOppositeAxis(crossAxis);
677
701
  let mainAxisCoord = coords[mainAxis];
@@ -699,7 +723,11 @@ const shift$1 = function (options) {
699
723
  ...limitedCoords,
700
724
  data: {
701
725
  x: limitedCoords.x - x,
702
- y: limitedCoords.y - y
726
+ y: limitedCoords.y - y,
727
+ enabled: {
728
+ [mainAxis]: checkMainAxis,
729
+ [crossAxis]: checkCrossAxis
730
+ }
703
731
  }
704
732
  };
705
733
  }
@@ -757,26 +785,35 @@ function isOverflowElement(element) {
757
785
  overflowY,
758
786
  display
759
787
  } = getComputedStyle(element);
760
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
788
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';
761
789
  }
762
790
  function isTableElement(element) {
763
- return ['table', 'td', 'th'].includes(getNodeName(element));
791
+ return /^(table|td|th)$/.test(getNodeName(element));
764
792
  }
765
793
  function isTopLayer(element) {
766
- return [':popover-open', ':modal'].some(selector => {
767
- try {
768
- return element.matches(selector);
769
- } catch (e) {
770
- return false;
794
+ try {
795
+ if (element.matches(':popover-open')) {
796
+ return true;
771
797
  }
772
- });
798
+ } catch (_e) {
799
+ // no-op
800
+ }
801
+ try {
802
+ return element.matches(':modal');
803
+ } catch (_e) {
804
+ return false;
805
+ }
773
806
  }
807
+ const willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
808
+ const containRe = /paint|layout|strict|content/;
809
+ const isNotNone = value => !!value && value !== 'none';
810
+ let isWebKitValue;
774
811
  function isContainingBlock(elementOrCss) {
775
- const webkit = isWebKit();
776
812
  const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
777
813
 
778
814
  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
779
- return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
815
+ // https://drafts.csswg.org/css-transforms-2/#individual-transforms
816
+ return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');
780
817
  }
781
818
  function getContainingBlock(element) {
782
819
  let currentNode = getParentNode(element);
@@ -791,11 +828,13 @@ function getContainingBlock(element) {
791
828
  return null;
792
829
  }
793
830
  function isWebKit() {
794
- if (typeof CSS === 'undefined' || !CSS.supports) return false;
795
- return CSS.supports('-webkit-backdrop-filter', 'none');
831
+ if (isWebKitValue == null) {
832
+ isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');
833
+ }
834
+ return isWebKitValue;
796
835
  }
797
836
  function isLastTraversableNode(node) {
798
- return ['html', 'body', '#document'].includes(getNodeName(node));
837
+ return /^(html|body|#document)$/.test(getNodeName(node));
799
838
  }
800
839
  function getComputedStyle(element) {
801
840
  return getWindow(element).getComputedStyle(element);
@@ -847,8 +886,9 @@ function getOverflowAncestors(node, list, traverseIframes) {
847
886
  const win = getWindow(scrollableAncestor);
848
887
  if (isBody) {
849
888
  return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], []);
889
+ } else {
890
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, []));
850
891
  }
851
- return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, []));
852
892
  }
853
893
  function getFrameElement(win) {
854
894
  return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
@@ -1937,14 +1977,20 @@ const NvPopover = class {
1937
1977
  this.positionPopover();
1938
1978
  }
1939
1979
  disconnectedCallback() {
1940
- removeEventListeners(this.closeEvents, document, this);
1941
- if (this.triggerMode === 'click') {
1942
- removeEventListeners(this.clickEvents, this.triggerElement, this);
1943
- // Remove document listeners
1944
- removeEventListeners(this.outsideClickEvents, document, this);
1980
+ removeEventListeners(this.closeEvents, document);
1981
+ switch (this.triggerMode) {
1982
+ case 'click':
1983
+ if (this.triggerElement) {
1984
+ removeEventListeners(this.clickEvents, this.triggerElement);
1985
+ }
1986
+ removeEventListeners(this.outsideClickEvents, document);
1987
+ break;
1988
+ case 'hover':
1989
+ if (this.triggerElement) {
1990
+ removeEventListeners(this.hoverEvents, this.triggerElement);
1991
+ }
1992
+ break;
1945
1993
  }
1946
- if (this.triggerMode === 'hover')
1947
- removeEventListeners(this.hoverEvents, this.triggerElement, this);
1948
1994
  // Reset flag so events can be reattached if component is reconnected
1949
1995
  this.eventsAttached = false;
1950
1996
  // Clean up any pending timeouts
@@ -1957,7 +2003,7 @@ const NvPopover = class {
1957
2003
  /****************************************************************************/
1958
2004
  //#region RENDER
1959
2005
  render() {
1960
- return (h(Host, { key: '1a604043f59c8aa04237b6d03838125079ac5c49' }, h("slot", { key: 'c22461b3d5050f7b502635221cbe17c03ef425a9', name: "trigger" }), h("div", { key: '58a438db8308be12d854afe3deda462d4ae528fb', "data-scope": "popover", "data-strategy": this.strategy, hidden: true, ref: el => (this.popoverElement = el) }, this.hasArrow && (h("div", { key: 'af18bf4b8700484ca989a8d45da8295e8d11ea2e', "data-scope": "arrow", ref: el => (this.arrowElement = el) })), h("slot", { key: 'f3308bfc01d5a4f954a1f0b822cf378cd874f9bd', name: "content" }))));
2006
+ return (h(Host, { key: '1ed63615950c6e634f62130a0b44968b33a672fb' }, h("slot", { key: '46f7ca5bd0f86e79f847d1120d4bb37f6392fd58', name: "trigger" }), h("div", { key: 'b7324fde30b5dccb51a206ac334636bb8161760a', "data-scope": "popover", "data-strategy": this.strategy, hidden: true, ref: el => (this.popoverElement = el) }, this.hasArrow && (h("div", { key: 'ce765381a3d2708afa5cef63d8f8c156555eb903', "data-scope": "arrow", ref: el => (this.arrowElement = el) })), h("slot", { key: '7412a6e56a216bb7ea06b69d1c349f68d6bb1aa1', name: "content" }))));
1961
2007
  }
1962
2008
  get el() { return getElement(this); }
1963
2009
  static get watchers() { return {
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, a as createEvent, h, d as Host, e as getElement } from './index-Dtg-LGcy.js';
2
2
  import { c as clsx } from './clsx-ChV9xqsO.js';
3
- import { v as v4 } from './v4-BdYh22OP.js';
3
+ import { v as v4 } from './v4-CK3_k8jD.js';
4
4
 
5
5
  const nvToggleCss = () => `@charset "UTF-8";nv-toggle{display:inline-flex;align-items:flex-start;gap:var(--form-gap-x);position:relative}nv-toggle:not([disabled],[readonly]) input,nv-toggle:not([disabled],[readonly]) label{cursor:pointer}nv-toggle.label-placement-before{flex-direction:row-reverse}nv-toggle[disabled]{opacity:0.5}nv-toggle label{align-self:stretch;color:var(--components-form-text-label-default);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:var(--font-weight-medium-emphasis);line-height:var(--form-label-line-height)}nv-toggle label.visually-hidden{position:absolute;padding:0;border:0;overflow:hidden;white-space:nowrap;width:1px;height:1px;margin:-1px;clip:rect(0, 0, 0, 0)}nv-toggle .input-container{position:relative;color:var(--components-form-shape-foreground-default)}nv-toggle .input-container:has(input[type=checkbox]:disabled:not([readonly])){color:var(--components-form-shape-foreground-disabled)}nv-toggle .input-container input[type=checkbox]{appearance:none;position:relative;display:flex;width:var(--form-toggle-width);height:var(--form-toggle-height);flex-direction:column;align-items:flex-start;border-radius:var(--form-toggle-radius);border-width:var(--form-toggle-border-width);border-style:solid;border-color:var(--components-toggle-border-default);background:var(--components-toggle-background-default)}nv-toggle .input-container input[type=checkbox]::after{content:"";display:block;width:var(--form-toggle-switch-dot-default);height:var(--form-toggle-switch-dot-default);background-color:var(--components-toggle-shape-default);border-radius:var(--radius-rounded-full);position:absolute;top:50%;left:25%;transform:translate(-50%, -50%)}nv-toggle .input-container input[type=checkbox]:hover{border-color:var(--components-toggle-border-hover)}nv-toggle .input-container input[type=checkbox]:hover::after{background-color:var(--components-toggle-shape-hover)}nv-toggle .input-container input[type=checkbox]:focus{border-color:var(--components-toggle-border-default)}nv-toggle .input-container input[type=checkbox]:focus::after{background-color:var(--components-toggle-shape-default)}nv-toggle .input-container input[type=checkbox]:focus,nv-toggle .input-container input[type=checkbox]:focus-within{outline:none}nv-toggle .input-container input[type=checkbox]:focus-visible,nv-toggle .input-container input[type=checkbox]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-toggle .input-container input[type=checkbox]:checked{background:var(--components-toggle-background-default-checked);border-color:var(--components-toggle-border-default-checked)}nv-toggle .input-container input[type=checkbox]:checked::after{content:"";display:block;width:var(--form-toggle-switch-dot-default);height:var(--form-toggle-switch-dot-default);background-color:var(--components-toggle-shape-default-checked);border-radius:var(--radius-rounded-full);position:absolute;top:50%;left:75%;transform:translate(-50%, -50%)}nv-toggle .input-container input[type=checkbox]:checked:focus{background:var(--components-toggle-background-default-checked);border-color:var(--components-toggle-border-default-checked)}nv-toggle .input-container input[type=checkbox]:disabled:not([readonly]){box-shadow:unset;background:var(--components-toggle-background-disabled);border-color:var(--components-toggle-border-default)}nv-toggle .input-container input[type=checkbox]:disabled:not([readonly]):checked{background:var(--components-toggle-background-disabled-checked);border-color:var(--components-toggle-border-disabled-checked)}nv-toggle .input-container input[type=checkbox]:disabled:not([readonly]):checked::after{background-color:var(--components-toggle-shape-disabled-checked)}@media print{nv-toggle .input-container input[type=checkbox]::after{content:"●";top:calc(50% - 3.5px);width:auto;height:auto;background:none;color:var(--components-toggle-border-default);font-size:calc(var(--form-toggle-switch-dot-default) * 3);line-height:1}nv-toggle .input-container input[type=checkbox]:checked{background:transparent;border-color:var(--components-toggle-border-default-checked)}nv-toggle .input-container input[type=checkbox]:checked::after{content:"●";top:calc(50% - 3.5px);width:auto;height:auto;left:75%;background:none;color:var(--components-toggle-border-default-checked)}}nv-toggle .description{align-self:stretch;color:var(--components-form-text-description-default);font-family:var(--font-family-default), var(--font-family-fallback), sans-serif;font-size:var(--form-description-font-size);font-style:normal;font-weight:450;line-height:var(--form-description-line-height)}nv-toggle .text-container{display:flex;flex-direction:column;align-items:flex-start;flex:1 0 0}`;
6
6
 
@@ -0,0 +1,50 @@
1
+ const byteToHex = [];
2
+ for (let i = 0; i < 256; ++i) {
3
+ byteToHex.push((i + 0x100).toString(16).slice(1));
4
+ }
5
+ function unsafeStringify(arr, offset = 0) {
6
+ return (byteToHex[arr[offset + 0]] +
7
+ byteToHex[arr[offset + 1]] +
8
+ byteToHex[arr[offset + 2]] +
9
+ byteToHex[arr[offset + 3]] +
10
+ '-' +
11
+ byteToHex[arr[offset + 4]] +
12
+ byteToHex[arr[offset + 5]] +
13
+ '-' +
14
+ byteToHex[arr[offset + 6]] +
15
+ byteToHex[arr[offset + 7]] +
16
+ '-' +
17
+ byteToHex[arr[offset + 8]] +
18
+ byteToHex[arr[offset + 9]] +
19
+ '-' +
20
+ byteToHex[arr[offset + 10]] +
21
+ byteToHex[arr[offset + 11]] +
22
+ byteToHex[arr[offset + 12]] +
23
+ byteToHex[arr[offset + 13]] +
24
+ byteToHex[arr[offset + 14]] +
25
+ byteToHex[arr[offset + 15]]).toLowerCase();
26
+ }
27
+
28
+ const rnds8 = new Uint8Array(16);
29
+ function rng() {
30
+ return crypto.getRandomValues(rnds8);
31
+ }
32
+
33
+ function v4(options, buf, offset) {
34
+ if (crypto.randomUUID) {
35
+ return crypto.randomUUID();
36
+ }
37
+ return _v4(options);
38
+ }
39
+ function _v4(options, buf, offset) {
40
+ options = options || {};
41
+ const rnds = options.random ?? options.rng?.() ?? rng();
42
+ if (rnds.length < 16) {
43
+ throw new Error('Random bytes length must be >= 16');
44
+ }
45
+ rnds[6] = (rnds[6] & 0x0f) | 0x40;
46
+ rnds[8] = (rnds[8] & 0x3f) | 0x80;
47
+ return unsafeStringify(rnds);
48
+ }
49
+
50
+ export { v4 as v };