@clubmed/trident-ui 1.3.0-beta.1 → 1.3.0-beta.11

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 (227) hide show
  1. package/CHANGELOG.md +963 -862
  2. package/README.md +11 -1
  3. package/assets/style.css +1 -1
  4. package/atoms/Clickable/Clickable.d.ts +5 -0
  5. package/atoms/Clickable/Clickable.js +25 -0
  6. package/atoms/Clickable/Clickable.js.map +1 -0
  7. package/atoms/Heading/Heading.d.ts +6 -0
  8. package/atoms/Heading/Heading.js +14 -0
  9. package/atoms/Heading/Heading.js.map +1 -0
  10. package/atoms/Heading/HeadingGroup.d.ts +7 -0
  11. package/atoms/Heading/HeadingGroup.js +15 -0
  12. package/atoms/Heading/HeadingGroup.js.map +1 -0
  13. package/atoms/Image/Image.d.ts +7 -0
  14. package/atoms/Image/Image.js +18 -0
  15. package/atoms/Image/Image.js.map +1 -0
  16. package/atoms/Prose/Prose.d.ts +5 -0
  17. package/atoms/Prose/Prose.js +18 -0
  18. package/atoms/Prose/Prose.js.map +1 -0
  19. package/chunks/ResizeObserver.js +287 -0
  20. package/chunks/ResizeObserver.js.map +1 -0
  21. package/chunks/_commonjsHelpers.js +24 -4
  22. package/chunks/_commonjsHelpers.js.map +1 -1
  23. package/chunks/index.js.map +1 -1
  24. package/chunks/plugin.js +53 -0
  25. package/chunks/plugin.js.map +1 -0
  26. package/contexts/Device.d.ts +2 -22
  27. package/contexts/Device.js +5 -59
  28. package/contexts/Device.js.map +1 -1
  29. package/contexts/Devices/Device.d.ts +11 -0
  30. package/contexts/Devices/Device.js +23 -0
  31. package/contexts/Devices/Device.js.map +1 -0
  32. package/contexts/Devices/hooks/useQueries.d.ts +6 -0
  33. package/contexts/Devices/hooks/useQueries.js +24 -0
  34. package/contexts/Devices/hooks/useQueries.js.map +1 -0
  35. package/contexts/Devices/reducers/reducer.d.ts +25 -0
  36. package/contexts/Devices/reducers/reducer.js +50 -0
  37. package/contexts/Devices/reducers/reducer.js.map +1 -0
  38. package/contexts/TridentUIConfig.js +228 -228
  39. package/contexts/TridentUIConfig.js.map +1 -1
  40. package/helpers/colors/colors.d.ts +108 -0
  41. package/helpers/colors/colors.js +132 -0
  42. package/helpers/colors/colors.js.map +1 -0
  43. package/hooks/keyboard.constants.js.map +1 -1
  44. package/hooks/useInternalStatus.js.map +1 -1
  45. package/hooks/useKeyboardControls.js.map +1 -1
  46. package/hooks/useResizeObserver.d.ts +2 -0
  47. package/hooks/useResizeObserver.js +84 -0
  48. package/hooks/useResizeObserver.js.map +1 -0
  49. package/hooks/useSafeBoop.js.map +1 -1
  50. package/hooks/useValue.js.map +1 -1
  51. package/molecules/Arrows/Arrows.d.ts +16 -0
  52. package/molecules/Arrows/Arrows.js +66 -0
  53. package/molecules/Arrows/Arrows.js.map +1 -0
  54. package/molecules/Arrows/ArrowsLabels.d.js +2 -0
  55. package/molecules/Arrows/ArrowsLabels.d.js.map +1 -0
  56. package/molecules/Arrows.d.ts +1 -50
  57. package/molecules/Arrows.js +2 -56
  58. package/molecules/Arrows.js.map +1 -1
  59. package/molecules/Avatar.js.map +1 -1
  60. package/molecules/Backdrop.js.map +1 -1
  61. package/molecules/Breadcrumb.js +8 -9
  62. package/molecules/Breadcrumb.js.map +1 -1
  63. package/molecules/Buttons/ArrowButton.d.ts +7 -0
  64. package/molecules/Buttons/ArrowButton.js +14 -0
  65. package/molecules/Buttons/ArrowButton.js.map +1 -0
  66. package/molecules/Buttons/Button.d.ts +15 -32
  67. package/molecules/Buttons/Button.js +52 -42
  68. package/molecules/Buttons/Button.js.map +1 -1
  69. package/molecules/Buttons/ButtonAnchor.d.ts +7 -3
  70. package/molecules/Buttons/ButtonAnchor.js +17 -36
  71. package/molecules/Buttons/ButtonAnchor.js.map +1 -1
  72. package/molecules/Buttons/ButtonContent.d.ts +12 -4
  73. package/molecules/Buttons/ButtonContent.js +14 -8
  74. package/molecules/Buttons/ButtonContent.js.map +1 -1
  75. package/molecules/Buttons/FakeButton.d.ts +8 -0
  76. package/molecules/Buttons/FakeButton.js +8 -0
  77. package/molecules/Buttons/FakeButton.js.map +1 -0
  78. package/molecules/Buttons/InertButton.d.ts +4 -0
  79. package/molecules/Buttons/InertButton.js +15 -31
  80. package/molecules/Buttons/InertButton.js.map +1 -1
  81. package/molecules/Buttons/v2/Button.d.ts +2289 -0
  82. package/molecules/Buttons/v2/Button.js +57 -0
  83. package/molecules/Buttons/v2/Button.js.map +1 -0
  84. package/molecules/Buttons/v2/Button.type.d.ts +57 -0
  85. package/molecules/Buttons/v2/Button.type.js +45 -0
  86. package/molecules/Buttons/v2/Button.type.js.map +1 -0
  87. package/molecules/Card.d.ts +1 -11
  88. package/molecules/Card.js +2 -35
  89. package/molecules/Card.js.map +1 -1
  90. package/molecules/Cards/Card.d.ts +13 -0
  91. package/molecules/Cards/Card.js +22 -0
  92. package/molecules/Cards/Card.js.map +1 -0
  93. package/molecules/Cards/CardAspectRatios.d.ts +6 -0
  94. package/molecules/Cards/CardAspectRatios.js +10 -0
  95. package/molecules/Cards/CardAspectRatios.js.map +1 -0
  96. package/molecules/Cards/CardBackground.d.ts +4 -0
  97. package/molecules/Cards/CardBackground.js +30 -0
  98. package/molecules/Cards/CardBackground.js.map +1 -0
  99. package/molecules/Cards/CardBackgroundContext.d.ts +6 -0
  100. package/molecules/Cards/CardBackgroundContext.js +10 -0
  101. package/molecules/Cards/CardBackgroundContext.js.map +1 -0
  102. package/molecules/Cards/CardClickable.d.ts +6 -0
  103. package/molecules/Cards/CardClickable.js +37 -0
  104. package/molecules/Cards/CardClickable.js.map +1 -0
  105. package/molecules/Cards/ExpandableCard.d.ts +14 -0
  106. package/molecules/Cards/ExpandableCard.js +80 -0
  107. package/molecules/Cards/ExpandableCard.js.map +1 -0
  108. package/molecules/Cards/v2/Card.d.ts +15 -0
  109. package/molecules/Cards/v2/Card.js +34 -0
  110. package/molecules/Cards/v2/Card.js.map +1 -0
  111. package/molecules/Chip.d.ts +9 -0
  112. package/molecules/Chip.js +31 -0
  113. package/molecules/Chip.js.map +1 -0
  114. package/molecules/Chip.themes.d.ts +12 -0
  115. package/molecules/Chip.themes.js +24 -0
  116. package/molecules/Chip.themes.js.map +1 -0
  117. package/molecules/ElasticHeight.d.ts +6 -27
  118. package/molecules/ElasticHeight.js +28 -33
  119. package/molecules/ElasticHeight.js.map +1 -1
  120. package/molecules/Forms/Checkboxes/Checkbox.js +12 -13
  121. package/molecules/Forms/Checkboxes/Checkbox.js.map +1 -1
  122. package/molecules/Forms/Checkboxes/Checkboxes.js.map +1 -1
  123. package/molecules/Forms/DateField.d.ts +1 -1
  124. package/molecules/Forms/DateField.js +142 -116
  125. package/molecules/Forms/DateField.js.map +1 -1
  126. package/molecules/Forms/Filter.js +12 -13
  127. package/molecules/Forms/Filter.js.map +1 -1
  128. package/molecules/Forms/FormControl.js +15 -16
  129. package/molecules/Forms/FormControl.js.map +1 -1
  130. package/molecules/Forms/FormLabel.js.map +1 -1
  131. package/molecules/Forms/NumberField.d.ts +28 -28
  132. package/molecules/Forms/NumberField.js +68 -68
  133. package/molecules/Forms/NumberField.js.map +1 -1
  134. package/molecules/Forms/Password/Password.js +10 -11
  135. package/molecules/Forms/Password/Password.js.map +1 -1
  136. package/molecules/Forms/Password/ValidationMessage.js +8 -9
  137. package/molecules/Forms/Password/ValidationMessage.js.map +1 -1
  138. package/molecules/Forms/Radios/Radio.d.ts +3 -0
  139. package/molecules/Forms/Radios/Radio.js +21 -20
  140. package/molecules/Forms/Radios/Radio.js.map +1 -1
  141. package/molecules/Forms/Radios/RadioGroup.js +72 -33
  142. package/molecules/Forms/Radios/RadioGroup.js.map +1 -1
  143. package/molecules/Forms/Range.js +124 -406
  144. package/molecules/Forms/Range.js.map +1 -1
  145. package/molecules/Forms/Select.d.ts +1 -1
  146. package/molecules/Forms/Select.js +3 -4
  147. package/molecules/Forms/Select.js.map +1 -1
  148. package/molecules/Forms/Switch.js.map +1 -1
  149. package/molecules/Forms/TextField.d.ts +1 -1
  150. package/molecules/Forms/TextField.js +7 -8
  151. package/molecules/Forms/TextField.js.map +1 -1
  152. package/molecules/HamburgerIcon.js.map +1 -1
  153. package/molecules/Link.d.ts +1 -1
  154. package/molecules/Link.js +8 -9
  155. package/molecules/Link.js.map +1 -1
  156. package/molecules/Loader.js.map +1 -1
  157. package/molecules/Pagination.d.ts +2 -1
  158. package/molecules/Pagination.helper.js.map +1 -1
  159. package/molecules/Pagination.js +67 -45
  160. package/molecules/Pagination.js.map +1 -1
  161. package/molecules/Popin.js +16 -16
  162. package/molecules/Popin.js.map +1 -1
  163. package/molecules/Spinner.js.map +1 -1
  164. package/molecules/Tabs/Tab.d.ts +1 -1
  165. package/molecules/Tabs/Tab.js +51 -49
  166. package/molecules/Tabs/Tab.js.map +1 -1
  167. package/molecules/Tabs/TabList.js.map +1 -1
  168. package/molecules/Tabs/TabPanel.js +31 -29
  169. package/molecules/Tabs/TabPanel.js.map +1 -1
  170. package/molecules/Tabs/Tabs.js +7 -9
  171. package/molecules/Tabs/Tabs.js.map +1 -1
  172. package/molecules/Tabs/TabsBody.js.map +1 -1
  173. package/molecules/Tabs/context/TabControl.d.ts +29 -27
  174. package/molecules/Tabs/context/TabControl.js +67 -66
  175. package/molecules/Tabs/context/TabControl.js.map +1 -1
  176. package/molecules/Tabs/hooks/tabControl.d.ts +25 -14
  177. package/molecules/Tabs/hooks/tabControl.js +26 -23
  178. package/molecules/Tabs/hooks/tabControl.js.map +1 -1
  179. package/molecules/Tabs/theme.js.map +1 -1
  180. package/molecules/Tag.d.ts +43 -0
  181. package/molecules/Tag.js +73 -0
  182. package/molecules/Tag.js.map +1 -0
  183. package/package.json +34 -10
  184. package/styles/globals.css +16 -15
  185. package/tailwind/colors.d.ts +38 -0
  186. package/tailwind/colors.js +44 -0
  187. package/tailwind/colors.js.map +1 -0
  188. package/tailwind/plugins/animationDelay.d.ts +4 -0
  189. package/tailwind/plugins/animationDelay.js +15 -0
  190. package/tailwind/plugins/animationDelay.js.map +1 -0
  191. package/tailwind/plugins/hocus.d.ts +4 -0
  192. package/tailwind/plugins/hocus.js +11 -0
  193. package/tailwind/plugins/hocus.js.map +1 -0
  194. package/tailwind/plugins/lineClampFix.d.ts +4 -0
  195. package/tailwind/plugins/lineClampFix.js +13 -0
  196. package/tailwind/plugins/lineClampFix.js.map +1 -0
  197. package/tailwind/plugins/popover.d.ts +4 -0
  198. package/tailwind/plugins/popover.js +8 -0
  199. package/tailwind/plugins/popover.js.map +1 -0
  200. package/tailwind/plugins/startingStyle.d.ts +4 -0
  201. package/tailwind/plugins/startingStyle.js +8 -0
  202. package/tailwind/plugins/startingStyle.js.map +1 -0
  203. package/tailwind/plugins/transitionBehavior.d.ts +4 -0
  204. package/tailwind/plugins/transitionBehavior.js +11 -0
  205. package/tailwind/plugins/transitionBehavior.js.map +1 -0
  206. package/tailwind/tailwind.preset.d.ts +730 -510
  207. package/tailwind/tailwind.preset.js +705 -631
  208. package/tailwind/tailwind.preset.js.map +1 -1
  209. package/types/Colors.d.js +2 -0
  210. package/types/Colors.d.js.map +1 -0
  211. package/types/Devices.d.ts +8 -0
  212. package/types/Devices.js +11 -0
  213. package/types/Devices.js.map +1 -0
  214. package/types/Direction.d.js +2 -0
  215. package/types/Direction.d.js.map +1 -0
  216. package/types/LiteralUnion.d.js +2 -0
  217. package/types/LiteralUnion.d.js.map +1 -0
  218. package/types/ScrollerLabels.d.js +2 -0
  219. package/types/ScrollerLabels.d.js.map +1 -0
  220. package/types/Theme.d.js +2 -0
  221. package/types/Theme.d.js.map +1 -0
  222. package/molecules/Buttons/Button.helpers.d.ts +0 -8
  223. package/molecules/Buttons/Button.helpers.js +0 -12
  224. package/molecules/Buttons/Button.helpers.js.map +0 -1
  225. package/molecules/Buttons/Button.themes.d.ts +0 -1
  226. package/molecules/Buttons/Button.themes.js +0 -25
  227. package/molecules/Buttons/Button.themes.js.map +0 -1
@@ -1,327 +1,45 @@
1
- import { jsxs as J, jsx as W } from "react/jsx-runtime";
2
- import { c as fe } from "../../chunks/index.js";
3
- import { useState as V, useRef as U, useEffect as N, useMemo as de, useId as he } from "react";
4
- import { g as pe } from "../../chunks/_commonjsHelpers.js";
5
- var O = [], be = function() {
6
- return O.some(function(e) {
7
- return e.activeTargets.length > 0;
8
- });
9
- }, ge = function() {
10
- return O.some(function(e) {
11
- return e.skippedTargets.length > 0;
12
- });
13
- }, Y = "ResizeObserver loop completed with undelivered notifications.", me = function() {
14
- var e;
15
- typeof ErrorEvent == "function" ? e = new ErrorEvent("error", {
16
- message: Y
17
- }) : (e = document.createEvent("Event"), e.initEvent("error", !1, !1), e.message = Y), window.dispatchEvent(e);
18
- }, k;
19
- (function(e) {
20
- e.BORDER_BOX = "border-box", e.CONTENT_BOX = "content-box", e.DEVICE_PIXEL_CONTENT_BOX = "device-pixel-content-box";
21
- })(k || (k = {}));
22
- var R = function(e) {
23
- return Object.freeze(e);
24
- }, we = /* @__PURE__ */ function() {
25
- function e(t, r) {
26
- this.inlineSize = t, this.blockSize = r, R(this);
27
- }
28
- return e;
29
- }(), oe = function() {
30
- function e(t, r, n, i) {
31
- return this.x = t, this.y = r, this.width = n, this.height = i, this.top = this.y, this.left = this.x, this.bottom = this.top + this.height, this.right = this.left + this.width, R(this);
32
- }
33
- return e.prototype.toJSON = function() {
34
- var t = this, r = t.x, n = t.y, i = t.top, s = t.right, a = t.bottom, l = t.left, o = t.width, u = t.height;
35
- return { x: r, y: n, top: i, right: s, bottom: a, left: l, width: o, height: u };
36
- }, e.fromRect = function(t) {
37
- return new e(t.x, t.y, t.width, t.height);
38
- }, e;
39
- }(), $ = function(e) {
40
- return e instanceof SVGElement && "getBBox" in e;
41
- }, se = function(e) {
42
- if ($(e)) {
43
- var t = e.getBBox(), r = t.width, n = t.height;
44
- return !r && !n;
45
- }
46
- var i = e, s = i.offsetWidth, a = i.offsetHeight;
47
- return !(s || a || e.getClientRects().length);
48
- }, j = function(e) {
49
- var t;
50
- if (e instanceof Element)
51
- return !0;
52
- var r = (t = e == null ? void 0 : e.ownerDocument) === null || t === void 0 ? void 0 : t.defaultView;
53
- return !!(r && e instanceof r.Element);
54
- }, ze = function(e) {
55
- switch (e.tagName) {
56
- case "INPUT":
57
- if (e.type !== "image")
58
- break;
59
- case "VIDEO":
60
- case "AUDIO":
61
- case "EMBED":
62
- case "OBJECT":
63
- case "CANVAS":
64
- case "IFRAME":
65
- case "IMG":
66
- return !0;
67
- }
68
- return !1;
69
- }, L = typeof window < "u" ? window : {}, I = /* @__PURE__ */ new WeakMap(), K = /auto|scroll/, xe = /^tb|vertical/, ye = /msie|trident/i.test(L.navigator && L.navigator.userAgent), b = function(e) {
70
- return parseFloat(e || "0");
71
- }, D = function(e, t, r) {
72
- return e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = !1), new we((r ? t : e) || 0, (r ? e : t) || 0);
73
- }, Q = R({
74
- devicePixelContentBoxSize: D(),
75
- borderBoxSize: D(),
76
- contentBoxSize: D(),
77
- contentRect: new oe(0, 0, 0, 0)
78
- }), ae = function(e, t) {
79
- if (t === void 0 && (t = !1), I.has(e) && !t)
80
- return I.get(e);
81
- if (se(e))
82
- return I.set(e, Q), Q;
83
- var r = getComputedStyle(e), n = $(e) && e.ownerSVGElement && e.getBBox(), i = !ye && r.boxSizing === "border-box", s = xe.test(r.writingMode || ""), a = !n && K.test(r.overflowY || ""), l = !n && K.test(r.overflowX || ""), o = n ? 0 : b(r.paddingTop), u = n ? 0 : b(r.paddingRight), v = n ? 0 : b(r.paddingBottom), f = n ? 0 : b(r.paddingLeft), T = n ? 0 : b(r.borderTopWidth), m = n ? 0 : b(r.borderRightWidth), h = n ? 0 : b(r.borderBottomWidth), d = n ? 0 : b(r.borderLeftWidth), w = f + u, p = o + v, c = d + m, z = T + h, B = l ? e.offsetHeight - z - e.clientHeight : 0, x = a ? e.offsetWidth - c - e.clientWidth : 0, g = i ? w + c : 0, S = i ? p + z : 0, y = n ? n.width : b(r.width) - g - x, C = n ? n.height : b(r.height) - S - B, _ = y + w + x + c, E = C + p + B + z, G = R({
84
- devicePixelContentBoxSize: D(Math.round(y * devicePixelRatio), Math.round(C * devicePixelRatio), s),
85
- borderBoxSize: D(_, E, s),
86
- contentBoxSize: D(y, C, s),
87
- contentRect: new oe(f, o, y, C)
88
- });
89
- return I.set(e, G), G;
90
- }, ue = function(e, t, r) {
91
- var n = ae(e, r), i = n.borderBoxSize, s = n.contentBoxSize, a = n.devicePixelContentBoxSize;
92
- switch (t) {
93
- case k.DEVICE_PIXEL_CONTENT_BOX:
94
- return a;
95
- case k.BORDER_BOX:
96
- return i;
97
- default:
98
- return s;
99
- }
100
- }, Ee = /* @__PURE__ */ function() {
101
- function e(t) {
102
- var r = ae(t);
103
- this.target = t, this.contentRect = r.contentRect, this.borderBoxSize = R([r.borderBoxSize]), this.contentBoxSize = R([r.contentBoxSize]), this.devicePixelContentBoxSize = R([r.devicePixelContentBoxSize]);
104
- }
105
- return e;
106
- }(), ce = function(e) {
107
- if (se(e))
108
- return 1 / 0;
109
- for (var t = 0, r = e.parentNode; r; )
110
- t += 1, r = r.parentNode;
111
- return t;
112
- }, Oe = function() {
113
- var e = 1 / 0, t = [];
114
- O.forEach(function(a) {
115
- if (a.activeTargets.length !== 0) {
116
- var l = [];
117
- a.activeTargets.forEach(function(u) {
118
- var v = new Ee(u.target), f = ce(u.target);
119
- l.push(v), u.lastReportedSize = ue(u.target, u.observedBox), f < e && (e = f);
120
- }), t.push(function() {
121
- a.callback.call(a.observer, l, a.observer);
122
- }), a.activeTargets.splice(0, a.activeTargets.length);
123
- }
124
- });
125
- for (var r = 0, n = t; r < n.length; r++) {
126
- var i = n[r];
127
- i();
128
- }
129
- return e;
130
- }, Z = function(e) {
131
- O.forEach(function(r) {
132
- r.activeTargets.splice(0, r.activeTargets.length), r.skippedTargets.splice(0, r.skippedTargets.length), r.observationTargets.forEach(function(i) {
133
- i.isActive() && (ce(i.target) > e ? r.activeTargets.push(i) : r.skippedTargets.push(i));
134
- });
135
- });
136
- }, Re = function() {
137
- var e = 0;
138
- for (Z(e); be(); )
139
- e = Oe(), Z(e);
140
- return ge() && me(), e > 0;
141
- }, F, le = [], Te = function() {
142
- return le.splice(0).forEach(function(e) {
143
- return e();
144
- });
145
- }, Be = function(e) {
146
- if (!F) {
147
- var t = 0, r = document.createTextNode(""), n = { characterData: !0 };
148
- new MutationObserver(function() {
149
- return Te();
150
- }).observe(r, n), F = function() {
151
- r.textContent = "".concat(t ? t-- : t++);
152
- };
153
- }
154
- le.push(e), F();
155
- }, Se = function(e) {
156
- Be(function() {
157
- requestAnimationFrame(e);
158
- });
159
- }, P = 0, Ce = function() {
160
- return !!P;
161
- }, De = 250, Ne = { attributes: !0, characterData: !0, childList: !0, subtree: !0 }, ee = [
162
- "resize",
163
- "load",
164
- "transitionend",
165
- "animationend",
166
- "animationstart",
167
- "animationiteration",
168
- "keyup",
169
- "keydown",
170
- "mouseup",
171
- "mousedown",
172
- "mouseover",
173
- "mouseout",
174
- "blur",
175
- "focus"
176
- ], te = function(e) {
177
- return e === void 0 && (e = 0), Date.now() + e;
178
- }, H = !1, Le = function() {
179
- function e() {
180
- var t = this;
181
- this.stopped = !0, this.listener = function() {
182
- return t.schedule();
183
- };
184
- }
185
- return e.prototype.run = function(t) {
186
- var r = this;
187
- if (t === void 0 && (t = De), !H) {
188
- H = !0;
189
- var n = te(t);
190
- Se(function() {
191
- var i = !1;
192
- try {
193
- i = Re();
194
- } finally {
195
- if (H = !1, t = n - te(), !Ce())
196
- return;
197
- i ? r.run(1e3) : t > 0 ? r.run(t) : r.start();
198
- }
199
- });
200
- }
201
- }, e.prototype.schedule = function() {
202
- this.stop(), this.run();
203
- }, e.prototype.observe = function() {
204
- var t = this, r = function() {
205
- return t.observer && t.observer.observe(document.body, Ne);
206
- };
207
- document.body ? r() : L.addEventListener("DOMContentLoaded", r);
208
- }, e.prototype.start = function() {
209
- var t = this;
210
- this.stopped && (this.stopped = !1, this.observer = new MutationObserver(this.listener), this.observe(), ee.forEach(function(r) {
211
- return L.addEventListener(r, t.listener, !0);
212
- }));
213
- }, e.prototype.stop = function() {
214
- var t = this;
215
- this.stopped || (this.observer && this.observer.disconnect(), ee.forEach(function(r) {
216
- return L.removeEventListener(r, t.listener, !0);
217
- }), this.stopped = !0);
218
- }, e;
219
- }(), X = new Le(), re = function(e) {
220
- !P && e > 0 && X.start(), P += e, !P && X.stop();
221
- }, ke = function(e) {
222
- return !$(e) && !ze(e) && getComputedStyle(e).display === "inline";
223
- }, We = function() {
224
- function e(t, r) {
225
- this.target = t, this.observedBox = r || k.CONTENT_BOX, this.lastReportedSize = {
226
- inlineSize: 0,
227
- blockSize: 0
228
- };
229
- }
230
- return e.prototype.isActive = function() {
231
- var t = ue(this.target, this.observedBox, !0);
232
- return ke(this.target) && (this.lastReportedSize = t), this.lastReportedSize.inlineSize !== t.inlineSize || this.lastReportedSize.blockSize !== t.blockSize;
233
- }, e;
234
- }(), Ie = /* @__PURE__ */ function() {
235
- function e(t, r) {
236
- this.activeTargets = [], this.skippedTargets = [], this.observationTargets = [], this.observer = t, this.callback = r;
237
- }
238
- return e;
239
- }(), M = /* @__PURE__ */ new WeakMap(), ne = function(e, t) {
240
- for (var r = 0; r < e.length; r += 1)
241
- if (e[r].target === t)
242
- return r;
243
- return -1;
244
- }, A = function() {
245
- function e() {
246
- }
247
- return e.connect = function(t, r) {
248
- var n = new Ie(t, r);
249
- M.set(t, n);
250
- }, e.observe = function(t, r, n) {
251
- var i = M.get(t), s = i.observationTargets.length === 0;
252
- ne(i.observationTargets, r) < 0 && (s && O.push(i), i.observationTargets.push(new We(r, n && n.box)), re(1), X.schedule());
253
- }, e.unobserve = function(t, r) {
254
- var n = M.get(t), i = ne(n.observationTargets, r), s = n.observationTargets.length === 1;
255
- i >= 0 && (s && O.splice(O.indexOf(n), 1), n.observationTargets.splice(i, 1), re(-1));
256
- }, e.disconnect = function(t) {
257
- var r = this, n = M.get(t);
258
- n.observationTargets.slice().forEach(function(i) {
259
- return r.unobserve(t, i.target);
260
- }), n.activeTargets.splice(0, n.activeTargets.length);
261
- }, e;
262
- }(), Me = function() {
263
- function e(t) {
264
- if (arguments.length === 0)
265
- throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
266
- if (typeof t != "function")
267
- throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");
268
- A.connect(this, t);
269
- }
270
- return e.prototype.observe = function(t, r) {
271
- if (arguments.length === 0)
272
- throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");
273
- if (!j(t))
274
- throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");
275
- A.observe(this, t, r);
276
- }, e.prototype.unobserve = function(t) {
277
- if (arguments.length === 0)
278
- throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");
279
- if (!j(t))
280
- throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");
281
- A.unobserve(this, t);
282
- }, e.prototype.disconnect = function() {
283
- A.disconnect(this);
284
- }, e.toString = function() {
285
- return "function ResizeObserver () { [polyfill code] }";
286
- }, e;
287
- }();
288
- function q(e, t, r) {
289
- var n, i, s, a, l;
1
+ import { jsxs as T, jsx as O } from "react/jsx-runtime";
2
+ import { R as j } from "../../chunks/ResizeObserver.js";
3
+ import { c as M } from "../../chunks/index.js";
4
+ import { useState as L, useRef as W, useEffect as w, useMemo as A, useId as F } from "react";
5
+ import { g as H } from "../../chunks/_commonjsHelpers.js";
6
+ function B(r, t, s) {
7
+ var o, i, n, f, c;
290
8
  t == null && (t = 100);
291
- function o() {
292
- var v = Date.now() - a;
293
- v < t && v >= 0 ? n = setTimeout(o, t - v) : (n = null, r || (l = e.apply(s, i), s = i = null));
9
+ function e() {
10
+ var a = Date.now() - f;
11
+ a < t && a >= 0 ? o = setTimeout(e, t - a) : (o = null, s || (c = r.apply(n, i), n = i = null));
294
12
  }
295
13
  var u = function() {
296
- s = this, i = arguments, a = Date.now();
297
- var v = r && !n;
298
- return n || (n = setTimeout(o, t)), v && (l = e.apply(s, i), s = i = null), l;
14
+ n = this, i = arguments, f = Date.now();
15
+ var a = s && !o;
16
+ return o || (o = setTimeout(e, t)), a && (c = r.apply(n, i), n = i = null), c;
299
17
  };
300
18
  return u.clear = function() {
301
- n && (clearTimeout(n), n = null);
19
+ o && (clearTimeout(o), o = null);
302
20
  }, u.flush = function() {
303
- n && (l = e.apply(s, i), s = i = null, clearTimeout(n), n = null);
21
+ o && (c = r.apply(n, i), n = i = null, clearTimeout(o), o = null);
304
22
  }, u;
305
23
  }
306
- q.debounce = q;
307
- var Ae = q;
308
- const ie = /* @__PURE__ */ pe(Ae);
309
- function Pe(e) {
24
+ B.debounce = B;
25
+ var V = B;
26
+ const D = /* @__PURE__ */ H(V);
27
+ function k(r) {
310
28
  let {
311
29
  debounce: t,
312
- scroll: r,
313
- polyfill: n,
30
+ scroll: s,
31
+ polyfill: o,
314
32
  offsetSize: i
315
- } = e === void 0 ? {
33
+ } = r === void 0 ? {
316
34
  debounce: 0,
317
35
  scroll: !1,
318
36
  offsetSize: !1
319
- } : e;
320
- const s = n || (typeof window > "u" ? class {
37
+ } : r;
38
+ const n = o || (typeof window > "u" ? class {
321
39
  } : window.ResizeObserver);
322
- if (!s)
40
+ if (!n)
323
41
  throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");
324
- const [a, l] = V({
42
+ const [f, c] = L({
325
43
  left: 0,
326
44
  top: 0,
327
45
  width: 0,
@@ -330,171 +48,171 @@ function Pe(e) {
330
48
  right: 0,
331
49
  x: 0,
332
50
  y: 0
333
- }), o = U({
51
+ }), e = W({
334
52
  element: null,
335
53
  scrollContainers: null,
336
54
  resizeObserver: null,
337
- lastBounds: a
338
- }), u = t ? typeof t == "number" ? t : t.scroll : null, v = t ? typeof t == "number" ? t : t.resize : null, f = U(!1);
339
- N(() => (f.current = !0, () => void (f.current = !1)));
340
- const [T, m, h] = de(() => {
341
- const c = () => {
342
- if (!o.current.element) return;
55
+ lastBounds: f
56
+ }), u = t ? typeof t == "number" ? t : t.scroll : null, a = t ? typeof t == "number" ? t : t.resize : null, v = W(!1);
57
+ w(() => (v.current = !0, () => void (v.current = !1)));
58
+ const [y, b, m] = A(() => {
59
+ const l = () => {
60
+ if (!e.current.element) return;
343
61
  const {
344
- left: z,
345
- top: B,
346
- width: x,
347
- height: g,
348
- bottom: S,
349
- right: y,
350
- x: C,
351
- y: _
352
- } = o.current.element.getBoundingClientRect(), E = {
353
- left: z,
354
- top: B,
355
- width: x,
356
- height: g,
357
- bottom: S,
358
- right: y,
359
- x: C,
360
- y: _
62
+ left: E,
63
+ top: R,
64
+ width: C,
65
+ height: h,
66
+ bottom: x,
67
+ right: N,
68
+ x: I,
69
+ y: $
70
+ } = e.current.element.getBoundingClientRect(), g = {
71
+ left: E,
72
+ top: R,
73
+ width: C,
74
+ height: h,
75
+ bottom: x,
76
+ right: N,
77
+ x: I,
78
+ y: $
361
79
  };
362
- o.current.element instanceof HTMLElement && i && (E.height = o.current.element.offsetHeight, E.width = o.current.element.offsetWidth), Object.freeze(E), f.current && !Ve(o.current.lastBounds, E) && l(o.current.lastBounds = E);
80
+ e.current.element instanceof HTMLElement && i && (g.height = e.current.element.offsetHeight, g.width = e.current.element.offsetWidth), Object.freeze(g), v.current && !G(e.current.lastBounds, g) && c(e.current.lastBounds = g);
363
81
  };
364
- return [c, v ? ie(c, v) : c, u ? ie(c, u) : c];
365
- }, [l, i, u, v]);
82
+ return [l, a ? D(l, a) : l, u ? D(l, u) : l];
83
+ }, [c, i, u, a]);
366
84
  function d() {
367
- o.current.scrollContainers && (o.current.scrollContainers.forEach((c) => c.removeEventListener("scroll", h, !0)), o.current.scrollContainers = null), o.current.resizeObserver && (o.current.resizeObserver.disconnect(), o.current.resizeObserver = null);
85
+ e.current.scrollContainers && (e.current.scrollContainers.forEach((l) => l.removeEventListener("scroll", m, !0)), e.current.scrollContainers = null), e.current.resizeObserver && (e.current.resizeObserver.disconnect(), e.current.resizeObserver = null);
368
86
  }
369
- function w() {
370
- o.current.element && (o.current.resizeObserver = new s(h), o.current.resizeObserver.observe(o.current.element), r && o.current.scrollContainers && o.current.scrollContainers.forEach((c) => c.addEventListener("scroll", h, {
87
+ function z() {
88
+ e.current.element && (e.current.resizeObserver = new n(m), e.current.resizeObserver.observe(e.current.element), s && e.current.scrollContainers && e.current.scrollContainers.forEach((l) => l.addEventListener("scroll", m, {
371
89
  capture: !0,
372
90
  passive: !0
373
91
  })));
374
92
  }
375
- const p = (c) => {
376
- !c || c === o.current.element || (d(), o.current.element = c, o.current.scrollContainers = ve(c), w());
93
+ const p = (l) => {
94
+ !l || l === e.current.element || (d(), e.current.element = l, e.current.scrollContainers = S(l), z());
377
95
  };
378
- return Fe(h, !!r), _e(m), N(() => {
379
- d(), w();
380
- }, [r, h, m]), N(() => d, []), [p, a, T];
96
+ return X(m, !!s), q(b), w(() => {
97
+ d(), z();
98
+ }, [s, m, b]), w(() => d, []), [p, f, y];
381
99
  }
382
- function _e(e) {
383
- N(() => {
384
- const t = e;
100
+ function q(r) {
101
+ w(() => {
102
+ const t = r;
385
103
  return window.addEventListener("resize", t), () => void window.removeEventListener("resize", t);
386
- }, [e]);
104
+ }, [r]);
387
105
  }
388
- function Fe(e, t) {
389
- N(() => {
106
+ function X(r, t) {
107
+ w(() => {
390
108
  if (t) {
391
- const r = e;
392
- return window.addEventListener("scroll", r, {
109
+ const s = r;
110
+ return window.addEventListener("scroll", s, {
393
111
  capture: !0,
394
112
  passive: !0
395
- }), () => void window.removeEventListener("scroll", r, !0);
113
+ }), () => void window.removeEventListener("scroll", s, !0);
396
114
  }
397
- }, [e, t]);
115
+ }, [r, t]);
398
116
  }
399
- function ve(e) {
117
+ function S(r) {
400
118
  const t = [];
401
- if (!e || e === document.body) return t;
119
+ if (!r || r === document.body) return t;
402
120
  const {
403
- overflow: r,
404
- overflowX: n,
121
+ overflow: s,
122
+ overflowX: o,
405
123
  overflowY: i
406
- } = window.getComputedStyle(e);
407
- return [r, n, i].some((s) => s === "auto" || s === "scroll") && t.push(e), [...t, ...ve(e.parentElement)];
124
+ } = window.getComputedStyle(r);
125
+ return [s, o, i].some((n) => n === "auto" || n === "scroll") && t.push(r), [...t, ...S(r.parentElement)];
408
126
  }
409
- const He = ["x", "y", "top", "bottom", "left", "right", "width", "height"], Ve = (e, t) => He.every((r) => e[r] === t[r]), Ue = (e) => {
410
- const t = he(), {
411
- ariaLabel: r,
412
- className: n,
127
+ const Y = ["x", "y", "top", "bottom", "left", "right", "width", "height"], G = (r, t) => Y.every((s) => r[s] === t[s]), _ = (r) => {
128
+ const t = F(), {
129
+ ariaLabel: s,
130
+ className: o,
413
131
  dataTestId: i = "range",
414
- id: s = t,
415
- name: a = s,
416
- singleCursorMode: l = !1,
417
- min: o = 0,
132
+ id: n = t,
133
+ name: f = n,
134
+ singleCursorMode: c = !1,
135
+ min: e = 0,
418
136
  options: u = [],
419
- step: v = 1,
420
- readOnly: f,
421
- disabled: T,
422
- onChange: m,
423
- ...h
424
- } = e, [d, w] = V(u.length - 1), [p, c] = V(o), [z, { width: B }] = Pe({ polyfill: Me }), x = (g) => {
425
- if (!f) {
426
- g.persist();
427
- const S = Number(g.target.value);
428
- g.target.id[g.target.id.length - 1] === "a" ? w(S) : c(S), m && m(a, [d, p]);
137
+ step: a = 1,
138
+ readOnly: v,
139
+ disabled: y,
140
+ onChange: b,
141
+ ...m
142
+ } = r, [d, z] = L(u.length - 1), [p, l] = L(e), [E, { width: R }] = k({ polyfill: j }), C = (h) => {
143
+ if (!v) {
144
+ h.persist();
145
+ const x = Number(h.target.value);
146
+ h.target.id[h.target.id.length - 1] === "a" ? z(x) : l(x), b && b(f, [d, p]);
429
147
  }
430
148
  };
431
- return /* @__PURE__ */ J(
149
+ return /* @__PURE__ */ T(
432
150
  "div",
433
151
  {
434
152
  style: {
435
- "--min": o,
153
+ "--min": e,
436
154
  "--max": u.length - 1,
437
- "--inputWidth": `${B}px`,
155
+ "--inputWidth": `${R}px`,
438
156
  "--inputHeight": "4px",
439
157
  "--thumbWidth": "32px",
440
158
  "--usefulWidth": "calc(var(--inputWidth) - var(--thumbWidth))",
441
159
  "--valueA": d,
442
160
  "--valueB": p
443
161
  },
444
- className: fe("relative w-full", n),
162
+ className: M("relative w-full", o),
445
163
  "data-testid": i,
446
164
  "data-name": "Range",
447
- ref: z,
165
+ ref: E,
448
166
  children: [
449
- /* @__PURE__ */ J("div", { className: "input-range-container", children: [
450
- /* @__PURE__ */ W(
167
+ /* @__PURE__ */ T("div", { className: "input-range-container", children: [
168
+ /* @__PURE__ */ O(
451
169
  "input",
452
170
  {
453
- ...h,
454
- "aria-label": r,
171
+ ...m,
172
+ "aria-label": s,
455
173
  className: "input-range",
456
- id: `${s}-a`,
174
+ id: `${n}-a`,
457
175
  max: u.length - 1,
458
- min: o,
459
- name: a,
460
- onChange: x,
461
- disabled: T,
462
- step: v,
176
+ min: e,
177
+ name: f,
178
+ onChange: C,
179
+ disabled: y,
180
+ step: a,
463
181
  type: "range",
464
182
  value: d
465
183
  }
466
184
  ),
467
- !l && /* @__PURE__ */ W(
185
+ !c && /* @__PURE__ */ O(
468
186
  "input",
469
187
  {
470
- ...h,
471
- "aria-label": r,
188
+ ...m,
189
+ "aria-label": s,
472
190
  className: "input-range",
473
- disabled: T,
474
- id: `${s}-b`,
191
+ disabled: y,
192
+ id: `${n}-b`,
475
193
  max: u.length - 1,
476
- min: o,
477
- name: a,
478
- onChange: x,
479
- step: v,
194
+ min: e,
195
+ name: f,
196
+ onChange: C,
197
+ step: a,
480
198
  type: "range",
481
199
  value: p
482
200
  }
483
201
  )
484
202
  ] }),
485
- /* @__PURE__ */ W(
203
+ /* @__PURE__ */ O(
486
204
  "output",
487
205
  {
488
- htmlFor: `${s}-a`,
206
+ htmlFor: `${n}-a`,
489
207
  style: { "--value": d },
490
208
  className: "input-range-output",
491
209
  children: u[d].label
492
210
  }
493
211
  ),
494
- !l && /* @__PURE__ */ W(
212
+ !c && /* @__PURE__ */ O(
495
213
  "output",
496
214
  {
497
- htmlFor: `${s}-b`,
215
+ htmlFor: `${n}-b`,
498
216
  style: { "--value": p },
499
217
  className: "input-range-output",
500
218
  children: u[p].label
@@ -505,6 +223,6 @@ const He = ["x", "y", "top", "bottom", "left", "right", "width", "height"], Ve =
505
223
  );
506
224
  };
507
225
  export {
508
- Ue as Range
226
+ _ as Range
509
227
  };
510
228
  //# sourceMappingURL=Range.js.map