@clubmed/trident-ui 1.3.0-beta.8 → 1.3.0-rc.1

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 (184) hide show
  1. package/CHANGELOG.md +133 -0
  2. package/README.md +8 -0
  3. package/assets/icons/ResortFill/PHUC_Fill.svg +287 -10
  4. package/assets/icons/ResortFill/TOMC_Fill.svg +199 -14
  5. package/assets/icons/ResortFill-EC/KIPC_EC_Fill.svg +499 -0
  6. package/assets/icons/ResortOutline/PHUC_Outline.svg +156 -6
  7. package/assets/icons/ResortOutline/TOMC_Outline.svg +99 -6
  8. package/assets/icons/ResortOutline-EC/KIPC_EC_Outline.svg +380 -0
  9. package/assets/icons/Transports/Taxi.svg +5 -0
  10. package/assets/icons/Utilities/Doorhanger.svg +5 -0
  11. package/assets/{style.css → trident-ui.css} +1 -1
  12. package/atoms/Clickable/Clickable.d.ts +5 -0
  13. package/atoms/Clickable/Clickable.js +25 -0
  14. package/atoms/Clickable/Clickable.js.map +1 -0
  15. package/atoms/Heading/Heading.d.ts +6 -0
  16. package/atoms/Heading/Heading.js +14 -0
  17. package/atoms/Heading/Heading.js.map +1 -0
  18. package/atoms/Heading/HeadingGroup.d.ts +7 -0
  19. package/atoms/Heading/HeadingGroup.js +15 -0
  20. package/atoms/Heading/HeadingGroup.js.map +1 -0
  21. package/atoms/Icons/Iconics.d.ts +1 -1
  22. package/atoms/Icons/IconsResolver.d.ts +1 -1
  23. package/atoms/Icons/contexts/IconsContext.d.ts +1 -1
  24. package/atoms/Icons/svg/SvgIcon.d.ts +1 -1
  25. package/atoms/Icons/svg-use/SvgUseIcon.d.ts +1 -1
  26. package/atoms/Image/Image.d.ts +7 -0
  27. package/atoms/Image/Image.js +18 -0
  28. package/atoms/Image/Image.js.map +1 -0
  29. package/atoms/Prose/Prose.d.ts +5 -0
  30. package/atoms/Prose/Prose.js +18 -0
  31. package/atoms/Prose/Prose.js.map +1 -0
  32. package/chunks/ResizeObserver.js +287 -0
  33. package/chunks/ResizeObserver.js.map +1 -0
  34. package/chunks/_commonjsHelpers.js +19 -14
  35. package/chunks/_commonjsHelpers.js.map +1 -1
  36. package/chunks/index.js +36 -33
  37. package/chunks/index.js.map +1 -1
  38. package/chunks/plugin.js +57 -46
  39. package/chunks/plugin.js.map +1 -1
  40. package/contexts/Devices/Device.d.ts +3 -3
  41. package/contexts/Devices/hooks/useQueries.d.ts +2 -2
  42. package/contexts/Devices/reducers/reducer.d.ts +2 -2
  43. package/contexts/TridentUIConfig.d.ts +1 -1
  44. package/contexts/TridentUIConfig.js +1265 -653
  45. package/contexts/TridentUIConfig.js.map +1 -1
  46. package/helpers/colors/colors.d.ts +108 -0
  47. package/helpers/colors/colors.js +132 -0
  48. package/helpers/colors/colors.js.map +1 -0
  49. package/hooks/useKeyboardControls.d.ts +1 -1
  50. package/hooks/useResizeObserver.d.ts +2 -0
  51. package/hooks/useResizeObserver.js +84 -0
  52. package/hooks/useResizeObserver.js.map +1 -0
  53. package/hooks/useSafeBoop.d.ts +2 -2
  54. package/molecules/Arrows/Arrows.d.ts +2 -2
  55. package/molecules/Avatar.d.ts +1 -1
  56. package/molecules/Avatar.js +24 -24
  57. package/molecules/Avatar.js.map +1 -1
  58. package/molecules/Backdrop.d.ts +1 -1
  59. package/molecules/Breadcrumb.d.ts +7 -11
  60. package/molecules/Breadcrumb.js +44 -36
  61. package/molecules/Breadcrumb.js.map +1 -1
  62. package/molecules/Breadcrumb.themes.d.ts +8 -0
  63. package/molecules/Breadcrumb.themes.js +15 -0
  64. package/molecules/Breadcrumb.themes.js.map +1 -0
  65. package/molecules/Buttons/ArrowButton.d.ts +1 -1
  66. package/molecules/Buttons/Button.d.ts +7 -3
  67. package/molecules/Buttons/Button.js +12 -10
  68. package/molecules/Buttons/Button.js.map +1 -1
  69. package/molecules/Buttons/ButtonAnchor.d.ts +7 -2
  70. package/molecules/Buttons/ButtonAnchor.js +13 -10
  71. package/molecules/Buttons/ButtonAnchor.js.map +1 -1
  72. package/molecules/Buttons/ButtonContent.d.ts +2 -2
  73. package/molecules/Buttons/FakeButton.d.ts +7 -7
  74. package/molecules/Buttons/FakeButton.js +5 -24
  75. package/molecules/Buttons/FakeButton.js.map +1 -1
  76. package/molecules/Buttons/InertButton.d.ts +3 -3
  77. package/molecules/Buttons/InertButton.js +9 -8
  78. package/molecules/Buttons/InertButton.js.map +1 -1
  79. package/molecules/Buttons/v2/Button.d.ts +2286 -8
  80. package/molecules/Buttons/v2/Button.js +51 -26
  81. package/molecules/Buttons/v2/Button.js.map +1 -1
  82. package/molecules/Buttons/v2/Button.type.d.ts +5 -2
  83. package/molecules/Buttons/v2/Button.type.js +8 -5
  84. package/molecules/Buttons/v2/Button.type.js.map +1 -1
  85. package/molecules/Card.d.ts +1 -11
  86. package/molecules/Card.js +2 -34
  87. package/molecules/Card.js.map +1 -1
  88. package/molecules/Cards/Card.d.ts +13 -0
  89. package/molecules/Cards/Card.js +22 -0
  90. package/molecules/Cards/Card.js.map +1 -0
  91. package/molecules/Cards/CardAspectRatios.d.ts +6 -0
  92. package/molecules/Cards/CardAspectRatios.js +10 -0
  93. package/molecules/Cards/CardAspectRatios.js.map +1 -0
  94. package/molecules/Cards/CardBackground.d.ts +4 -0
  95. package/molecules/Cards/CardBackground.js +30 -0
  96. package/molecules/Cards/CardBackground.js.map +1 -0
  97. package/molecules/Cards/CardBackgroundContext.d.ts +6 -0
  98. package/molecules/Cards/CardBackgroundContext.js +10 -0
  99. package/molecules/Cards/CardBackgroundContext.js.map +1 -0
  100. package/molecules/Cards/CardClickable.d.ts +6 -0
  101. package/molecules/Cards/CardClickable.js +37 -0
  102. package/molecules/Cards/CardClickable.js.map +1 -0
  103. package/molecules/Cards/ExpandableCard.d.ts +14 -0
  104. package/molecules/Cards/ExpandableCard.js +80 -0
  105. package/molecules/Cards/ExpandableCard.js.map +1 -0
  106. package/molecules/Cards/v2/Card.d.ts +15 -0
  107. package/molecules/Cards/v2/Card.js +34 -0
  108. package/molecules/Cards/v2/Card.js.map +1 -0
  109. package/molecules/Chip.d.ts +9 -0
  110. package/molecules/Chip.js +31 -0
  111. package/molecules/Chip.js.map +1 -0
  112. package/molecules/Chip.themes.d.ts +12 -0
  113. package/molecules/Chip.themes.js +24 -0
  114. package/molecules/Chip.themes.js.map +1 -0
  115. package/molecules/ElasticHeight.d.ts +6 -27
  116. package/molecules/ElasticHeight.js +27 -33
  117. package/molecules/ElasticHeight.js.map +1 -1
  118. package/molecules/Forms/Checkboxes/Checkbox.d.ts +1 -1
  119. package/molecules/Forms/Checkboxes/Checkbox.js +43 -43
  120. package/molecules/Forms/Checkboxes/Checkbox.js.map +1 -1
  121. package/molecules/Forms/Checkboxes/Checkboxes.d.ts +2 -2
  122. package/molecules/Forms/DateField.d.ts +2 -2
  123. package/molecules/Forms/DateField.js +60 -61
  124. package/molecules/Forms/DateField.js.map +1 -1
  125. package/molecules/Forms/Filter.d.ts +1 -2
  126. package/molecules/Forms/Filter.js +29 -29
  127. package/molecules/Forms/Filter.js.map +1 -1
  128. package/molecules/Forms/FormControl.d.ts +4 -4
  129. package/molecules/Forms/FormLabel.d.ts +1 -1
  130. package/molecules/Forms/NumberField.d.ts +280 -280
  131. package/molecules/Forms/Password/Password.d.ts +1 -1
  132. package/molecules/Forms/Password/ValidationMessage.d.ts +1 -1
  133. package/molecules/Forms/Radios/Radio.d.ts +4 -2
  134. package/molecules/Forms/Radios/Radio.js +29 -28
  135. package/molecules/Forms/Radios/Radio.js.map +1 -1
  136. package/molecules/Forms/Radios/RadioGroup.d.ts +2 -2
  137. package/molecules/Forms/Radios/RadioGroup.js +70 -33
  138. package/molecules/Forms/Radios/RadioGroup.js.map +1 -1
  139. package/molecules/Forms/Range.d.ts +1 -2
  140. package/molecules/Forms/Range.js +144 -421
  141. package/molecules/Forms/Range.js.map +1 -1
  142. package/molecules/Forms/Select.d.ts +3 -3
  143. package/molecules/Forms/Switch.d.ts +1 -1
  144. package/molecules/Forms/TextField.d.ts +3 -3
  145. package/molecules/HamburgerIcon.d.ts +1 -1
  146. package/molecules/Link.d.ts +2 -2
  147. package/molecules/Loader.d.ts +1 -1
  148. package/molecules/Pagination.d.ts +2 -2
  149. package/molecules/Popin.d.ts +1 -1
  150. package/molecules/Spinner.d.ts +1 -1
  151. package/molecules/Tabs/Tab.d.ts +2 -3
  152. package/molecules/Tabs/Tab.js +41 -42
  153. package/molecules/Tabs/Tab.js.map +1 -1
  154. package/molecules/Tabs/TabList.d.ts +1 -1
  155. package/molecules/Tabs/TabList.js +21 -21
  156. package/molecules/Tabs/TabList.js.map +1 -1
  157. package/molecules/Tabs/TabPanel.d.ts +1 -1
  158. package/molecules/Tabs/TabPanel.js +13 -13
  159. package/molecules/Tabs/TabPanel.js.map +1 -1
  160. package/molecules/Tabs/Tabs.d.ts +1 -1
  161. package/molecules/Tabs/TabsBody.d.ts +1 -1
  162. package/molecules/Tabs/context/TabControl.d.ts +2 -2
  163. package/molecules/Tabs/hooks/tabControl.d.ts +5 -5
  164. package/molecules/Tag.d.ts +43 -0
  165. package/molecules/Tag.js +73 -0
  166. package/molecules/Tag.js.map +1 -0
  167. package/package.json +48 -45
  168. package/styles/index.css +1 -1
  169. package/tailwind/plugins/animationDelay.d.ts +2 -2
  170. package/tailwind/plugins/hocus.d.ts +2 -2
  171. package/tailwind/plugins/lineClampFix.d.ts +2 -2
  172. package/tailwind/plugins/popover.d.ts +2 -2
  173. package/tailwind/plugins/startingStyle.d.ts +2 -2
  174. package/tailwind/plugins/transitionBehavior.d.ts +2 -2
  175. package/tailwind/tailwind.preset.d.ts +50 -50
  176. package/types/LiteralUnion.d.js +2 -0
  177. package/types/LiteralUnion.d.js.map +1 -0
  178. package/types/Theme.d.js +2 -0
  179. package/types/Theme.d.js.map +1 -0
  180. package/assets/icons/ResortFill/KIPC_Fill.svg +0 -12
  181. package/assets/icons/ResortOutline/KIPC_Outline.svg +0 -7
  182. package/molecules/Buttons/v2/ButtonAnchor.d.ts +0 -12
  183. package/molecules/Buttons/v2/ButtonAnchor.js +0 -32
  184. package/molecules/Buttons/v2/ButtonAnchor.js.map +0 -1
@@ -1,327 +1,50 @@
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
- });
1
+ import { jsxs as D, jsx as E } from "react/jsx-runtime";
2
+ import { R as M } from "../../chunks/ResizeObserver.js";
3
+ import { c as q } from "../../chunks/index.js";
4
+ import { useState as B, useRef as T, useEffect as w, useMemo as A, useId as F } from "react";
5
+ import { g as H } from "../../chunks/_commonjsHelpers.js";
6
+ var L, W;
7
+ function V() {
8
+ if (W) return L;
9
+ W = 1;
10
+ function r(t, n, d) {
11
+ var o, s, u, m, e;
12
+ n == null && (n = 100);
13
+ function i() {
14
+ var a = Date.now() - m;
15
+ a < n && a >= 0 ? o = setTimeout(i, n - a) : (o = null, d || (e = t.apply(u, s), u = s = null));
200
16
  }
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);
17
+ var c = function() {
18
+ u = this, s = arguments, m = Date.now();
19
+ var a = d && !o;
20
+ return o || (o = setTimeout(i, n)), a && (e = t.apply(u, s), u = s = null), e;
206
21
  };
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;
22
+ return c.clear = function() {
23
+ o && (clearTimeout(o), o = null);
24
+ }, c.flush = function() {
25
+ o && (e = t.apply(u, s), u = s = null, clearTimeout(o), o = null);
26
+ }, c;
237
27
  }
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;
290
- 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));
294
- }
295
- 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;
299
- };
300
- return u.clear = function() {
301
- n && (clearTimeout(n), n = null);
302
- }, u.flush = function() {
303
- n && (l = e.apply(s, i), s = i = null, clearTimeout(n), n = null);
304
- }, u;
28
+ return r.debounce = r, L = r, L;
305
29
  }
306
- q.debounce = q;
307
- var Ae = q;
308
- const ie = /* @__PURE__ */ pe(Ae);
309
- function Pe(e) {
30
+ var k = V();
31
+ const S = /* @__PURE__ */ H(k);
32
+ function X(r) {
310
33
  let {
311
34
  debounce: t,
312
- scroll: r,
313
- polyfill: n,
314
- offsetSize: i
315
- } = e === void 0 ? {
35
+ scroll: n,
36
+ polyfill: d,
37
+ offsetSize: o
38
+ } = r === void 0 ? {
316
39
  debounce: 0,
317
40
  scroll: !1,
318
41
  offsetSize: !1
319
- } : e;
320
- const s = n || (typeof window > "u" ? class {
42
+ } : r;
43
+ const s = d || (typeof window > "u" ? class {
321
44
  } : window.ResizeObserver);
322
45
  if (!s)
323
46
  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({
47
+ const [u, m] = B({
325
48
  left: 0,
326
49
  top: 0,
327
50
  width: 0,
@@ -330,174 +53,174 @@ function Pe(e) {
330
53
  right: 0,
331
54
  x: 0,
332
55
  y: 0
333
- }), o = U({
56
+ }), e = T({
334
57
  element: null,
335
58
  scrollContainers: null,
336
59
  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;
60
+ lastBounds: u
61
+ }), i = t ? typeof t == "number" ? t : t.scroll : null, c = t ? typeof t == "number" ? t : t.resize : null, a = T(!1);
62
+ w(() => (a.current = !0, () => void (a.current = !1)));
63
+ const [y, b, p] = A(() => {
64
+ const l = () => {
65
+ if (!e.current.element) return;
343
66
  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: _
67
+ left: O,
68
+ top: R,
69
+ width: C,
70
+ height: v,
71
+ bottom: x,
72
+ right: N,
73
+ x: $,
74
+ y: j
75
+ } = e.current.element.getBoundingClientRect(), g = {
76
+ left: O,
77
+ top: R,
78
+ width: C,
79
+ height: v,
80
+ bottom: x,
81
+ right: N,
82
+ x: $,
83
+ y: j
361
84
  };
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);
85
+ e.current.element instanceof HTMLElement && o && (g.height = e.current.element.offsetHeight, g.width = e.current.element.offsetWidth), Object.freeze(g), a.current && !K(e.current.lastBounds, g) && m(e.current.lastBounds = g);
363
86
  };
364
- return [c, v ? ie(c, v) : c, u ? ie(c, u) : c];
365
- }, [l, i, u, v]);
366
- 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);
87
+ return [l, c ? S(l, c) : l, i ? S(l, i) : l];
88
+ }, [m, o, i, c]);
89
+ function f() {
90
+ e.current.scrollContainers && (e.current.scrollContainers.forEach((l) => l.removeEventListener("scroll", p, !0)), e.current.scrollContainers = null), e.current.resizeObserver && (e.current.resizeObserver.disconnect(), e.current.resizeObserver = null);
368
91
  }
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, {
92
+ function z() {
93
+ e.current.element && (e.current.resizeObserver = new s(p), e.current.resizeObserver.observe(e.current.element), n && e.current.scrollContainers && e.current.scrollContainers.forEach((l) => l.addEventListener("scroll", p, {
371
94
  capture: !0,
372
95
  passive: !0
373
96
  })));
374
97
  }
375
- const p = (c) => {
376
- !c || c === o.current.element || (d(), o.current.element = c, o.current.scrollContainers = ve(c), w());
98
+ const h = (l) => {
99
+ !l || l === e.current.element || (f(), e.current.element = l, e.current.scrollContainers = I(l), z());
377
100
  };
378
- return Fe(h, !!r), _e(m), N(() => {
379
- d(), w();
380
- }, [r, h, m]), N(() => d, []), [p, a, T];
101
+ return G(p, !!n), Y(b), w(() => {
102
+ f(), z();
103
+ }, [n, p, b]), w(() => f, []), [h, u, y];
381
104
  }
382
- function _e(e) {
383
- N(() => {
384
- const t = e;
105
+ function Y(r) {
106
+ w(() => {
107
+ const t = r;
385
108
  return window.addEventListener("resize", t), () => void window.removeEventListener("resize", t);
386
- }, [e]);
109
+ }, [r]);
387
110
  }
388
- function Fe(e, t) {
389
- N(() => {
111
+ function G(r, t) {
112
+ w(() => {
390
113
  if (t) {
391
- const r = e;
392
- return window.addEventListener("scroll", r, {
114
+ const n = r;
115
+ return window.addEventListener("scroll", n, {
393
116
  capture: !0,
394
117
  passive: !0
395
- }), () => void window.removeEventListener("scroll", r, !0);
118
+ }), () => void window.removeEventListener("scroll", n, !0);
396
119
  }
397
- }, [e, t]);
120
+ }, [r, t]);
398
121
  }
399
- function ve(e) {
122
+ function I(r) {
400
123
  const t = [];
401
- if (!e || e === document.body) return t;
124
+ if (!r || r === document.body) return t;
402
125
  const {
403
- overflow: r,
404
- overflowX: n,
405
- overflowY: i
406
- } = window.getComputedStyle(e);
407
- return [r, n, i].some((s) => s === "auto" || s === "scroll") && t.push(e), [...t, ...ve(e.parentElement)];
126
+ overflow: n,
127
+ overflowX: d,
128
+ overflowY: o
129
+ } = window.getComputedStyle(r);
130
+ return [n, d, o].some((s) => s === "auto" || s === "scroll") && t.push(r), [...t, ...I(r.parentElement)];
408
131
  }
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,
413
- dataTestId: i = "range",
132
+ const J = ["x", "y", "top", "bottom", "left", "right", "width", "height"], K = (r, t) => J.every((n) => r[n] === t[n]), te = (r) => {
133
+ const t = F(), {
134
+ ariaLabel: n,
135
+ className: d,
136
+ dataTestId: o = "range",
414
137
  id: s = t,
415
- name: a = s,
416
- singleCursorMode: l = !1,
417
- min: o = 0,
418
- 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]);
138
+ name: u = s,
139
+ singleCursorMode: m = !1,
140
+ min: e = 0,
141
+ options: i = [],
142
+ step: c = 1,
143
+ readOnly: a,
144
+ disabled: y,
145
+ onChange: b,
146
+ ...p
147
+ } = r, [f, z] = B(i.length - 1), [h, l] = B(e), [O, { width: R }] = X({ polyfill: M }), C = (v) => {
148
+ if (!a) {
149
+ v.persist();
150
+ const x = Number(v.target.value);
151
+ v.target.id[v.target.id.length - 1] === "a" ? z(x) : l(x), b && b(u, [f, h]);
429
152
  }
430
153
  };
431
- return /* @__PURE__ */ J(
154
+ return /* @__PURE__ */ D(
432
155
  "div",
433
156
  {
434
157
  style: {
435
- "--min": o,
436
- "--max": u.length - 1,
437
- "--inputWidth": `${B}px`,
158
+ "--min": e,
159
+ "--max": i.length - 1,
160
+ "--inputWidth": `${R}px`,
438
161
  "--inputHeight": "4px",
439
162
  "--thumbWidth": "32px",
440
163
  "--usefulWidth": "calc(var(--inputWidth) - var(--thumbWidth))",
441
- "--valueA": d,
442
- "--valueB": p
164
+ "--valueA": f,
165
+ "--valueB": h
443
166
  },
444
- className: fe("relative w-full", n),
445
- "data-testid": i,
167
+ className: q("relative w-full", d),
168
+ "data-testid": o,
446
169
  "data-name": "Range",
447
- ref: z,
170
+ ref: O,
448
171
  children: [
449
- /* @__PURE__ */ J("div", { className: "input-range-container", children: [
450
- /* @__PURE__ */ W(
172
+ /* @__PURE__ */ D("div", { className: "input-range-container", children: [
173
+ /* @__PURE__ */ E(
451
174
  "input",
452
175
  {
453
- ...h,
454
- "aria-label": r,
176
+ ...p,
177
+ "aria-label": n,
455
178
  className: "input-range",
456
179
  id: `${s}-a`,
457
- max: u.length - 1,
458
- min: o,
459
- name: a,
460
- onChange: x,
461
- disabled: T,
462
- step: v,
180
+ max: i.length - 1,
181
+ min: e,
182
+ name: u,
183
+ onChange: C,
184
+ disabled: y,
185
+ step: c,
463
186
  type: "range",
464
- value: d
187
+ value: f
465
188
  }
466
189
  ),
467
- !l && /* @__PURE__ */ W(
190
+ !m && /* @__PURE__ */ E(
468
191
  "input",
469
192
  {
470
- ...h,
471
- "aria-label": r,
193
+ ...p,
194
+ "aria-label": n,
472
195
  className: "input-range",
473
- disabled: T,
196
+ disabled: y,
474
197
  id: `${s}-b`,
475
- max: u.length - 1,
476
- min: o,
477
- name: a,
478
- onChange: x,
479
- step: v,
198
+ max: i.length - 1,
199
+ min: e,
200
+ name: u,
201
+ onChange: C,
202
+ step: c,
480
203
  type: "range",
481
- value: p
204
+ value: h
482
205
  }
483
206
  )
484
207
  ] }),
485
- /* @__PURE__ */ W(
208
+ /* @__PURE__ */ E(
486
209
  "output",
487
210
  {
488
211
  htmlFor: `${s}-a`,
489
- style: { "--value": d },
212
+ style: { "--value": f },
490
213
  className: "input-range-output",
491
- children: u[d].label
214
+ children: i[f].label
492
215
  }
493
216
  ),
494
- !l && /* @__PURE__ */ W(
217
+ !m && /* @__PURE__ */ E(
495
218
  "output",
496
219
  {
497
220
  htmlFor: `${s}-b`,
498
- style: { "--value": p },
221
+ style: { "--value": h },
499
222
  className: "input-range-output",
500
- children: u[p].label
223
+ children: i[h].label
501
224
  }
502
225
  )
503
226
  ]
@@ -505,6 +228,6 @@ const He = ["x", "y", "top", "bottom", "left", "right", "width", "height"], Ve =
505
228
  );
506
229
  };
507
230
  export {
508
- Ue as Range
231
+ te as Range
509
232
  };
510
233
  //# sourceMappingURL=Range.js.map