@spear-ai/spectral 1.6.17 → 1.8.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 (149) hide show
  1. package/dist/.js +201 -200
  2. package/dist/Accordion.d.ts +13 -15
  3. package/dist/Accordion.js +184 -179
  4. package/dist/Alert/AlertBase.d.ts +7 -7
  5. package/dist/Alert/AlertBase.js +21 -21
  6. package/dist/Alert.d.ts +2 -2
  7. package/dist/Alert.js +31 -31
  8. package/dist/Avatar.d.ts +2 -2
  9. package/dist/Avatar.js +30 -22
  10. package/dist/Badge.d.ts +1 -1
  11. package/dist/Badge.js +3 -2
  12. package/dist/Button.d.ts +3 -3
  13. package/dist/Button.js +108 -46
  14. package/dist/ButtonGroup/ButtonGroupButton.d.ts +1 -1
  15. package/dist/ButtonGroup/ButtonGroupButton.js +5 -5
  16. package/dist/ButtonGroup.d.ts +5 -5
  17. package/dist/ButtonGroup.js +21 -21
  18. package/dist/ButtonIcon.d.ts +2 -2
  19. package/dist/ButtonIcon.js +30 -31
  20. package/dist/Checkbox/CheckboxBase.d.ts +2 -2
  21. package/dist/Checkbox/CheckboxBase.js +50 -57
  22. package/dist/Checkbox.js +15 -19
  23. package/dist/DataCard/Card.d.ts +1 -1
  24. package/dist/DataCard/Card.js +1 -1
  25. package/dist/DataCard.js +1 -1
  26. package/dist/DateTimePicker/Calendar.d.ts +4 -4
  27. package/dist/DateTimePicker/Calendar.js +3 -3
  28. package/dist/DateTimePicker/DateTimeDisplayInput.js +126 -136
  29. package/dist/DateTimePicker/DateTimeInput.js +4 -4
  30. package/dist/DateTimePicker/DateTimeUtils.d.ts +31 -31
  31. package/dist/DateTimePicker/DateTimeUtils.js +139 -197
  32. package/dist/DateTimePicker/TimePicker.d.ts +4 -4
  33. package/dist/DateTimePicker/TimePicker.js +3 -3
  34. package/dist/DateTimePicker.d.ts +5 -5
  35. package/dist/DateTimePicker.js +90 -70
  36. package/dist/Dialog.d.ts +13 -13
  37. package/dist/Dialog.js +57 -84
  38. package/dist/Drawer.d.ts +2 -2
  39. package/dist/Drawer.js +8 -8
  40. package/dist/HoverCard.d.ts +6 -5
  41. package/dist/HoverCard.js +64 -64
  42. package/dist/Icons/PolygonIcon.d.ts +5 -0
  43. package/dist/Icons/PolygonIcon.js +40 -0
  44. package/dist/Icons/index.d.ts +1 -1
  45. package/dist/Icons.js +34 -34
  46. package/dist/IconsAnimated/PanelLeftCloseIcon.js +2 -2
  47. package/dist/IconsAnimated/PanelLeftOpenIcon.js +2 -2
  48. package/dist/Input/InputUtils.d.ts +2 -2
  49. package/dist/Input/InputUtils.js +4 -4
  50. package/dist/Input.d.ts +1 -1
  51. package/dist/Input.js +19 -19
  52. package/dist/InputOTP.d.ts +10 -10
  53. package/dist/InputOTP.js +114 -114
  54. package/dist/Kbd.d.ts +8 -5
  55. package/dist/Kbd.js +85 -20
  56. package/dist/Label.d.ts +4 -2
  57. package/dist/Label.js +3 -3
  58. package/dist/MultiSelect/MultiSelectBase.d.ts +1 -1
  59. package/dist/MultiSelect/MultiSelectBase.js +278 -202
  60. package/dist/MultiSelect.d.ts +6 -6
  61. package/dist/MultiSelect.js +9 -9
  62. package/dist/Popover.js +22 -237
  63. package/dist/RadioButtonGroup/RadioButtonGroupBase.d.ts +11 -11
  64. package/dist/RadioButtonGroup/RadioButtonGroupBase.js +28 -28
  65. package/dist/RadioButtonGroup.d.ts +1 -1
  66. package/dist/RadioGroup.d.ts +15 -15
  67. package/dist/RadioGroup.js +253 -236
  68. package/dist/Select.d.ts +3 -1
  69. package/dist/Select.js +91 -88
  70. package/dist/Separator.js +4 -4
  71. package/dist/Skeleton.d.ts +1 -2
  72. package/dist/Skeleton.js +2 -4
  73. package/dist/Slider.d.ts +6 -6
  74. package/dist/Slider.js +78 -78
  75. package/dist/Switch/SwitchBase.d.ts +4 -4
  76. package/dist/Switch/SwitchBase.js +75 -111
  77. package/dist/Switch.d.ts +4 -4
  78. package/dist/Switch.js +122 -33
  79. package/dist/Tabs/TabsBase.js +39 -38
  80. package/dist/Tabs/tabsUtils.js +7 -7
  81. package/dist/Tabs.d.ts +0 -4
  82. package/dist/Tabs.js +62 -66
  83. package/dist/Textarea/TextareaUtils.d.ts +7 -7
  84. package/dist/Textarea/TextareaUtils.js +13 -13
  85. package/dist/Textarea.js +28 -18
  86. package/dist/Toast.d.ts +43 -0
  87. package/dist/Toast.js +883 -0
  88. package/dist/Toggle/ToggleBase.d.ts +4 -4
  89. package/dist/Toggle/ToggleBase.js +32 -33
  90. package/dist/Toggle.d.ts +1 -1
  91. package/dist/Toggle.js +7 -12
  92. package/dist/ToggleGroup/ToggleGroupBase.d.ts +5 -5
  93. package/dist/ToggleGroup/ToggleGroupBase.js +30 -30
  94. package/dist/ToggleGroup.d.ts +1 -1
  95. package/dist/ToggleGroup.js +27 -30
  96. package/dist/Tooltip.d.ts +1 -1
  97. package/dist/Tooltip.js +97 -97
  98. package/dist/Tray.d.ts +9 -9
  99. package/dist/Tray.js +71 -70
  100. package/dist/hooks/useAccordionAutoScroll.d.ts.map +1 -1
  101. package/dist/hooks/useAccordionAutoScroll.js +42 -39
  102. package/dist/hooks/useControllableState.d.ts +2 -2
  103. package/dist/hooks/useControllableState.d.ts.map +1 -1
  104. package/dist/hooks/useControllableState.js +2 -2
  105. package/dist/index-C12FUuIW.js +13 -0
  106. package/dist/{index-yU8jOTzS.js → index-CpovUAO-.js} +1 -1
  107. package/dist/{index-BdS7Ix8W.js → index-CqbPiOid.js} +1 -1
  108. package/dist/{index-B3UpsZ2x.js → index-CrjD9cAD.js} +1 -1
  109. package/dist/index-DEYs15GP.js +66 -0
  110. package/dist/index-DdFoGvON.js +146 -0
  111. package/dist/index-Q3N6lgwg.js +225 -0
  112. package/dist/index.d.ts +3 -3
  113. package/dist/index.d.ts.map +1 -1
  114. package/dist/primitives/button.d.ts +1 -1
  115. package/dist/primitives/button.js +4 -4
  116. package/dist/primitives/input.d.ts.map +1 -1
  117. package/dist/primitives/input.js +8 -5
  118. package/dist/primitives/select.d.ts +12 -13
  119. package/dist/primitives/select.d.ts.map +1 -1
  120. package/dist/primitives/select.js +59 -88
  121. package/dist/primitives/slot.d.ts +5 -5
  122. package/dist/primitives/slot.d.ts.map +1 -1
  123. package/dist/primitives/slot.js +24 -33
  124. package/dist/primitives/textarea.d.ts.map +1 -1
  125. package/dist/primitives/textarea.js +4 -3
  126. package/dist/{proxy-Cukf-VVj.js → proxy-CgaCj1WQ.js} +7 -3
  127. package/dist/styles/base-colors.css +30 -30
  128. package/dist/styles/horizon/base-colors.css +30 -30
  129. package/dist/styles/horizon/colors.css +43 -13
  130. package/dist/styles/horizon/utilities.css +26 -3
  131. package/dist/styles/main.css +1 -1
  132. package/dist/styles/spectral.css +2 -2
  133. package/dist/styles/theme.css +99 -46
  134. package/dist/{use-animation-zNd5Nq85.js → use-animation-CR-SdV2l.js} +1 -1
  135. package/dist/utils/formFieldUtils.d.ts +2 -2
  136. package/dist/utils/formFieldUtils.d.ts.map +1 -1
  137. package/dist/utils/formFieldUtils.js +14 -11
  138. package/dist/utils/sharedUtils.d.ts +3 -3
  139. package/dist/utils/sharedUtils.d.ts.map +1 -1
  140. package/dist/utils/sharedUtils.js +1 -4
  141. package/dist/utils/twUtils.d.ts +1 -1
  142. package/dist/utils/twUtils.d.ts.map +1 -1
  143. package/dist/utils/twUtils.js +1 -4
  144. package/package.json +6 -1
  145. package/dist/Icons/LineToolIcon2.d.ts +0 -5
  146. package/dist/Icons/LineToolIcon2.js +0 -49
  147. package/dist/createLucideIcon-D4r5Phnh.js +0 -70
  148. package/dist/index-CeP1E2kK.js +0 -209
  149. package/dist/index-Dy-Hzr7y.js +0 -13
package/dist/Tooltip.js CHANGED
@@ -4,7 +4,7 @@ import { jsx as u, jsxs as S } from "react/jsx-runtime";
4
4
  import * as a from "react";
5
5
  import { c as J, e as Q, u as G, P as Z, b as C, g as ee } from "./index-OnYbwQjk.js";
6
6
  import { P as te, D as oe } from "./index-u1k2AYWy.js";
7
- import { u as re } from "./index-Dy-Hzr7y.js";
7
+ import { u as re } from "./index-C12FUuIW.js";
8
8
  import { c as j, R as ne, a as ae, A as se, C as ie } from "./index-B3FZpM60.js";
9
9
  import { P as V } from "./index-D6HcSXrq.js";
10
10
  import { R as le } from "./index-Cd9V_YZ4.js";
@@ -18,81 +18,81 @@ var [O] = J("Tooltip", [
18
18
  delayDuration: t = ce,
19
19
  skipDelayDuration: r = 300,
20
20
  disableHoverableContent: n = !1,
21
- children: l
22
- } = e, s = a.useRef(!0), v = a.useRef(!1), i = a.useRef(0);
21
+ children: s
22
+ } = e, i = a.useRef(!0), v = a.useRef(!1), l = a.useRef(0);
23
23
  return a.useEffect(() => {
24
- const p = i.current;
25
- return () => window.clearTimeout(p);
24
+ const d = l.current;
25
+ return () => window.clearTimeout(d);
26
26
  }, []), /* @__PURE__ */ u(
27
27
  ue,
28
28
  {
29
29
  scope: o,
30
- isOpenDelayedRef: s,
30
+ isOpenDelayedRef: i,
31
31
  delayDuration: t,
32
32
  onOpen: a.useCallback(() => {
33
- window.clearTimeout(i.current), s.current = !1;
33
+ window.clearTimeout(l.current), i.current = !1;
34
34
  }, []),
35
35
  onClose: a.useCallback(() => {
36
- window.clearTimeout(i.current), i.current = window.setTimeout(
37
- () => s.current = !0,
36
+ window.clearTimeout(l.current), l.current = window.setTimeout(
37
+ () => i.current = !0,
38
38
  r
39
39
  );
40
40
  }, [r]),
41
41
  isPointerInTransitRef: v,
42
- onPointerInTransitChange: a.useCallback((p) => {
43
- v.current = p;
42
+ onPointerInTransitChange: a.useCallback((d) => {
43
+ v.current = d;
44
44
  }, []),
45
45
  disableHoverableContent: n,
46
- children: l
46
+ children: s
47
47
  }
48
48
  );
49
49
  };
50
50
  $.displayName = z;
51
- var R = "Tooltip", [de, _] = O(R), B = (e) => {
51
+ var R = "Tooltip", [pe, _] = O(R), B = (e) => {
52
52
  const {
53
53
  __scopeTooltip: o,
54
54
  children: t,
55
55
  open: r,
56
56
  defaultOpen: n,
57
- onOpenChange: l,
58
- disableHoverableContent: s,
57
+ onOpenChange: s,
58
+ disableHoverableContent: i,
59
59
  delayDuration: v
60
- } = e, i = k(R, e.__scopeTooltip), p = A(o), [c, f] = a.useState(null), h = re(), d = a.useRef(0), m = s ?? i.disableHoverableContent, T = v ?? i.delayDuration, g = a.useRef(!1), [y, x] = Q({
60
+ } = e, l = k(R, e.__scopeTooltip), d = A(o), [c, f] = a.useState(null), m = re(), p = a.useRef(0), h = i ?? l.disableHoverableContent, T = v ?? l.delayDuration, g = a.useRef(!1), [y, x] = Q({
61
61
  prop: r,
62
62
  defaultProp: n ?? !1,
63
63
  onChange: (I) => {
64
- I ? (i.onOpen(), document.dispatchEvent(new CustomEvent(D))) : i.onClose(), l?.(I);
64
+ I ? (l.onOpen(), document.dispatchEvent(new CustomEvent(D))) : l.onClose(), s?.(I);
65
65
  },
66
66
  caller: R
67
67
  }), w = a.useMemo(() => y ? g.current ? "delayed-open" : "instant-open" : "closed", [y]), P = a.useCallback(() => {
68
- window.clearTimeout(d.current), d.current = 0, g.current = !1, x(!0);
68
+ window.clearTimeout(p.current), p.current = 0, g.current = !1, x(!0);
69
69
  }, [x]), E = a.useCallback(() => {
70
- window.clearTimeout(d.current), d.current = 0, x(!1);
70
+ window.clearTimeout(p.current), p.current = 0, x(!1);
71
71
  }, [x]), N = a.useCallback(() => {
72
- window.clearTimeout(d.current), d.current = window.setTimeout(() => {
73
- g.current = !0, x(!0), d.current = 0;
72
+ window.clearTimeout(p.current), p.current = window.setTimeout(() => {
73
+ g.current = !0, x(!0), p.current = 0;
74
74
  }, T);
75
75
  }, [T, x]);
76
76
  return a.useEffect(() => () => {
77
- d.current && (window.clearTimeout(d.current), d.current = 0);
78
- }, []), /* @__PURE__ */ u(ne, { ...p, children: /* @__PURE__ */ u(
79
- de,
77
+ p.current && (window.clearTimeout(p.current), p.current = 0);
78
+ }, []), /* @__PURE__ */ u(ne, { ...d, children: /* @__PURE__ */ u(
79
+ pe,
80
80
  {
81
81
  scope: o,
82
- contentId: h,
82
+ contentId: m,
83
83
  open: y,
84
84
  stateAttribute: w,
85
85
  trigger: c,
86
86
  onTriggerChange: f,
87
87
  onTriggerEnter: a.useCallback(() => {
88
- i.isOpenDelayedRef.current ? N() : P();
89
- }, [i.isOpenDelayedRef, N, P]),
88
+ l.isOpenDelayedRef.current ? N() : P();
89
+ }, [l.isOpenDelayedRef, N, P]),
90
90
  onTriggerLeave: a.useCallback(() => {
91
- m ? E() : (window.clearTimeout(d.current), d.current = 0);
92
- }, [E, m]),
91
+ h ? E() : (window.clearTimeout(p.current), p.current = 0);
92
+ }, [E, h]),
93
93
  onOpen: P,
94
94
  onClose: E,
95
- disableHoverableContent: m,
95
+ disableHoverableContent: h,
96
96
  children: t
97
97
  }
98
98
  ) });
@@ -100,25 +100,25 @@ var R = "Tooltip", [de, _] = O(R), B = (e) => {
100
100
  B.displayName = R;
101
101
  var L = "TooltipTrigger", U = a.forwardRef(
102
102
  (e, o) => {
103
- const { __scopeTooltip: t, ...r } = e, n = _(L, t), l = k(L, t), s = A(t), v = a.useRef(null), i = G(o, v, n.onTriggerChange), p = a.useRef(!1), c = a.useRef(!1), f = a.useCallback(() => p.current = !1, []);
104
- return a.useEffect(() => () => document.removeEventListener("pointerup", f), [f]), /* @__PURE__ */ u(se, { asChild: !0, ...s, children: /* @__PURE__ */ u(
103
+ const { __scopeTooltip: t, ...r } = e, n = _(L, t), s = k(L, t), i = A(t), v = a.useRef(null), l = G(o, v, n.onTriggerChange), d = a.useRef(!1), c = a.useRef(!1), f = a.useCallback(() => d.current = !1, []);
104
+ return a.useEffect(() => () => document.removeEventListener("pointerup", f), [f]), /* @__PURE__ */ u(se, { asChild: !0, ...i, children: /* @__PURE__ */ u(
105
105
  Z.button,
106
106
  {
107
107
  "aria-describedby": n.open ? n.contentId : void 0,
108
108
  "data-state": n.stateAttribute,
109
109
  ...r,
110
- ref: i,
111
- onPointerMove: C(e.onPointerMove, (h) => {
112
- h.pointerType !== "touch" && !c.current && !l.isPointerInTransitRef.current && (n.onTriggerEnter(), c.current = !0);
110
+ ref: l,
111
+ onPointerMove: C(e.onPointerMove, (m) => {
112
+ m.pointerType !== "touch" && !c.current && !s.isPointerInTransitRef.current && (n.onTriggerEnter(), c.current = !0);
113
113
  }),
114
114
  onPointerLeave: C(e.onPointerLeave, () => {
115
115
  n.onTriggerLeave(), c.current = !1;
116
116
  }),
117
117
  onPointerDown: C(e.onPointerDown, () => {
118
- n.open && n.onClose(), p.current = !0, document.addEventListener("pointerup", f, { once: !0 });
118
+ n.open && n.onClose(), d.current = !0, document.addEventListener("pointerup", f, { once: !0 });
119
119
  }),
120
120
  onFocus: C(e.onFocus, () => {
121
- p.current || n.onOpen();
121
+ d.current || n.onOpen();
122
122
  }),
123
123
  onBlur: C(e.onBlur, n.onClose),
124
124
  onClick: C(e.onClick, n.onClose)
@@ -127,75 +127,75 @@ var L = "TooltipTrigger", U = a.forwardRef(
127
127
  }
128
128
  );
129
129
  U.displayName = L;
130
- var M = "TooltipPortal", [pe, fe] = O(M, {
130
+ var M = "TooltipPortal", [de, fe] = O(M, {
131
131
  forceMount: void 0
132
132
  }), Y = (e) => {
133
- const { __scopeTooltip: o, forceMount: t, children: r, container: n } = e, l = _(M, o);
134
- return /* @__PURE__ */ u(pe, { scope: o, forceMount: t, children: /* @__PURE__ */ u(V, { present: t || l.open, children: /* @__PURE__ */ u(te, { asChild: !0, container: n, children: r }) }) });
133
+ const { __scopeTooltip: o, forceMount: t, children: r, container: n } = e, s = _(M, o);
134
+ return /* @__PURE__ */ u(de, { scope: o, forceMount: t, children: /* @__PURE__ */ u(V, { present: t || s.open, children: /* @__PURE__ */ u(te, { asChild: !0, container: n, children: r }) }) });
135
135
  };
136
136
  Y.displayName = M;
137
137
  var b = "TooltipContent", q = a.forwardRef(
138
138
  (e, o) => {
139
- const t = fe(b, e.__scopeTooltip), { forceMount: r = t.forceMount, side: n = "top", ...l } = e, s = _(b, e.__scopeTooltip);
140
- return /* @__PURE__ */ u(V, { present: r || s.open, children: s.disableHoverableContent ? /* @__PURE__ */ u(X, { side: n, ...l, ref: o }) : /* @__PURE__ */ u(ve, { side: n, ...l, ref: o }) });
139
+ const t = fe(b, e.__scopeTooltip), { forceMount: r = t.forceMount, side: n = "top", ...s } = e, i = _(b, e.__scopeTooltip);
140
+ return /* @__PURE__ */ u(V, { present: r || i.open, children: i.disableHoverableContent ? /* @__PURE__ */ u(X, { side: n, ...s, ref: o }) : /* @__PURE__ */ u(ve, { side: n, ...s, ref: o }) });
141
141
  }
142
142
  ), ve = a.forwardRef((e, o) => {
143
- const t = _(b, e.__scopeTooltip), r = k(b, e.__scopeTooltip), n = a.useRef(null), l = G(o, n), [s, v] = a.useState(null), { trigger: i, onClose: p } = t, c = n.current, { onPointerInTransitChange: f } = r, h = a.useCallback(() => {
143
+ const t = _(b, e.__scopeTooltip), r = k(b, e.__scopeTooltip), n = a.useRef(null), s = G(o, n), [i, v] = a.useState(null), { trigger: l, onClose: d } = t, c = n.current, { onPointerInTransitChange: f } = r, m = a.useCallback(() => {
144
144
  v(null), f(!1);
145
- }, [f]), d = a.useCallback(
146
- (m, T) => {
147
- const g = m.currentTarget, y = { x: m.clientX, y: m.clientY }, x = Te(y, g.getBoundingClientRect()), w = xe(y, x), P = ye(T.getBoundingClientRect()), E = be([...w, ...P]);
145
+ }, [f]), p = a.useCallback(
146
+ (h, T) => {
147
+ const g = h.currentTarget, y = { x: h.clientX, y: h.clientY }, x = Te(y, g.getBoundingClientRect()), w = xe(y, x), P = ye(T.getBoundingClientRect()), E = be([...w, ...P]);
148
148
  v(E), f(!0);
149
149
  },
150
150
  [f]
151
151
  );
152
- return a.useEffect(() => () => h(), [h]), a.useEffect(() => {
153
- if (i && c) {
154
- const m = (g) => d(g, c), T = (g) => d(g, i);
155
- return i.addEventListener("pointerleave", m), c.addEventListener("pointerleave", T), () => {
156
- i.removeEventListener("pointerleave", m), c.removeEventListener("pointerleave", T);
152
+ return a.useEffect(() => () => m(), [m]), a.useEffect(() => {
153
+ if (l && c) {
154
+ const h = (g) => p(g, c), T = (g) => p(g, l);
155
+ return l.addEventListener("pointerleave", h), c.addEventListener("pointerleave", T), () => {
156
+ l.removeEventListener("pointerleave", h), c.removeEventListener("pointerleave", T);
157
157
  };
158
158
  }
159
- }, [i, c, d, h]), a.useEffect(() => {
160
- if (s) {
161
- const m = (T) => {
162
- const g = T.target, y = { x: T.clientX, y: T.clientY }, x = i?.contains(g) || c?.contains(g), w = !Ce(y, s);
163
- x ? h() : w && (h(), p());
159
+ }, [l, c, p, m]), a.useEffect(() => {
160
+ if (i) {
161
+ const h = (T) => {
162
+ const g = T.target, y = { x: T.clientX, y: T.clientY }, x = l?.contains(g) || c?.contains(g), w = !Ce(y, i);
163
+ x ? m() : w && (m(), d());
164
164
  };
165
- return document.addEventListener("pointermove", m), () => document.removeEventListener("pointermove", m);
165
+ return document.addEventListener("pointermove", h), () => document.removeEventListener("pointermove", h);
166
166
  }
167
- }, [i, c, s, p, h]), /* @__PURE__ */ u(X, { ...e, ref: l });
168
- }), [he, me] = O(R, { isInside: !1 }), ge = ee("TooltipContent"), X = a.forwardRef(
167
+ }, [l, c, i, d, m]), /* @__PURE__ */ u(X, { ...e, ref: s });
168
+ }), [me, he] = O(R, { isInside: !1 }), ge = ee("TooltipContent"), X = a.forwardRef(
169
169
  (e, o) => {
170
170
  const {
171
171
  __scopeTooltip: t,
172
172
  children: r,
173
173
  "aria-label": n,
174
- onEscapeKeyDown: l,
175
- onPointerDownOutside: s,
174
+ onEscapeKeyDown: s,
175
+ onPointerDownOutside: i,
176
176
  ...v
177
- } = e, i = _(b, t), p = A(t), { onClose: c } = i;
177
+ } = e, l = _(b, t), d = A(t), { onClose: c } = l;
178
178
  return a.useEffect(() => (document.addEventListener(D, c), () => document.removeEventListener(D, c)), [c]), a.useEffect(() => {
179
- if (i.trigger) {
180
- const f = (h) => {
181
- h.target?.contains(i.trigger) && c();
179
+ if (l.trigger) {
180
+ const f = (m) => {
181
+ m.target?.contains(l.trigger) && c();
182
182
  };
183
183
  return window.addEventListener("scroll", f, { capture: !0 }), () => window.removeEventListener("scroll", f, { capture: !0 });
184
184
  }
185
- }, [i.trigger, c]), /* @__PURE__ */ u(
185
+ }, [l.trigger, c]), /* @__PURE__ */ u(
186
186
  oe,
187
187
  {
188
188
  asChild: !0,
189
189
  disableOutsidePointerEvents: !1,
190
- onEscapeKeyDown: l,
191
- onPointerDownOutside: s,
190
+ onEscapeKeyDown: s,
191
+ onPointerDownOutside: i,
192
192
  onFocusOutside: (f) => f.preventDefault(),
193
193
  onDismiss: c,
194
194
  children: /* @__PURE__ */ S(
195
195
  ie,
196
196
  {
197
- "data-state": i.stateAttribute,
198
- ...p,
197
+ "data-state": l.stateAttribute,
198
+ ...d,
199
199
  ...v,
200
200
  ref: o,
201
201
  style: {
@@ -208,7 +208,7 @@ var b = "TooltipContent", q = a.forwardRef(
208
208
  },
209
209
  children: [
210
210
  /* @__PURE__ */ u(ge, { children: r }),
211
- /* @__PURE__ */ u(he, { scope: t, isInside: !0, children: /* @__PURE__ */ u(le, { id: i.contentId, role: "tooltip", children: n || r }) })
211
+ /* @__PURE__ */ u(me, { scope: t, isInside: !0, children: /* @__PURE__ */ u(le, { id: l.contentId, role: "tooltip", children: n || r }) })
212
212
  ]
213
213
  }
214
214
  )
@@ -220,7 +220,7 @@ q.displayName = b;
220
220
  var K = "TooltipArrow", W = a.forwardRef(
221
221
  (e, o) => {
222
222
  const { __scopeTooltip: t, ...r } = e, n = A(t);
223
- return me(
223
+ return he(
224
224
  K,
225
225
  t
226
226
  ).isInside ? null : /* @__PURE__ */ u(ae, { ...n, ...r, ref: o });
@@ -228,9 +228,9 @@ var K = "TooltipArrow", W = a.forwardRef(
228
228
  );
229
229
  W.displayName = K;
230
230
  function Te(e, o) {
231
- const t = Math.abs(o.top - e.y), r = Math.abs(o.bottom - e.y), n = Math.abs(o.right - e.x), l = Math.abs(o.left - e.x);
232
- switch (Math.min(t, r, n, l)) {
233
- case l:
231
+ const t = Math.abs(o.top - e.y), r = Math.abs(o.bottom - e.y), n = Math.abs(o.right - e.x), s = Math.abs(o.left - e.x);
232
+ switch (Math.min(t, r, n, s)) {
233
+ case s:
234
234
  return "left";
235
235
  case n:
236
236
  return "right";
@@ -284,9 +284,9 @@ function ye(e) {
284
284
  function Ce(e, o) {
285
285
  const { x: t, y: r } = e;
286
286
  let n = !1;
287
- for (let l = 0, s = o.length - 1; l < o.length; s = l++) {
288
- const v = o[l], i = o[s], p = v.x, c = v.y, f = i.x, h = i.y;
289
- c > r != h > r && t < (f - p) * (r - c) / (h - c) + p && (n = !n);
287
+ for (let s = 0, i = o.length - 1; s < o.length; i = s++) {
288
+ const v = o[s], l = o[i], d = v.x, c = v.y, f = l.x, m = l.y;
289
+ c > r != m > r && t < (f - d) * (r - c) / (m - c) + d && (n = !n);
290
290
  }
291
291
  return n;
292
292
  }
@@ -300,8 +300,8 @@ function we(e) {
300
300
  for (let r = 0; r < e.length; r++) {
301
301
  const n = e[r];
302
302
  for (; o.length >= 2; ) {
303
- const l = o[o.length - 1], s = o[o.length - 2];
304
- if ((l.x - s.x) * (n.y - s.y) >= (l.y - s.y) * (n.x - s.x)) o.pop();
303
+ const s = o[o.length - 1], i = o[o.length - 2];
304
+ if ((s.x - i.x) * (n.y - i.y) >= (s.y - i.y) * (n.x - i.x)) o.pop();
305
305
  else break;
306
306
  }
307
307
  o.push(n);
@@ -311,8 +311,8 @@ function we(e) {
311
311
  for (let r = e.length - 1; r >= 0; r--) {
312
312
  const n = e[r];
313
313
  for (; t.length >= 2; ) {
314
- const l = t[t.length - 1], s = t[t.length - 2];
315
- if ((l.x - s.x) * (n.y - s.y) >= (l.y - s.y) * (n.x - s.x)) t.pop();
314
+ const s = t[t.length - 1], i = t[t.length - 2];
315
+ if ((s.x - i.x) * (n.y - i.y) >= (s.y - i.y) * (n.x - i.x)) t.pop();
316
316
  else break;
317
317
  }
318
318
  t.push(n);
@@ -320,26 +320,26 @@ function we(e) {
320
320
  return t.pop(), o.length === 1 && t.length === 1 && o[0].x === t[0].x && o[0].y === t[0].y ? o : o.concat(t);
321
321
  }
322
322
  var Pe = $, Ee = B, Re = U, _e = Y, Oe = q, Ae = W;
323
- const De = ({ delayDuration: e = 0, ...o }) => /* @__PURE__ */ u(Pe, { "data-slot": "tooltip-provider", delayDuration: e, ...o }), ze = ({ ...e }) => /* @__PURE__ */ u(De, { children: /* @__PURE__ */ u(Ee, { "data-slot": "tooltip", "data-testid": "spectral-tooltip", ...e }) }), $e = ({ asChild: e, children: o, ...t }) => /* @__PURE__ */ u(Re, { asChild: e, "data-slot": "tooltip-trigger", "data-testid": "spectral-tooltip-trigger", className: "w-fit", ...t, children: o }), Le = F(
324
- `pointer-events-auto z-50 w-fit rounded-md px-3 py-1.5 text-xs shadow-lg will-change-transform outline-none select-none data-[state=open]:animate-in data-[state=open]:fade-in-0
325
- data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2
326
- data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,
323
+ const De = ({ delayDuration: e = 0, ...o }) => /* @__PURE__ */ u(Pe, { "data-slot": "tooltip-provider", delayDuration: e, ...o }), ze = ({ ...e }) => /* @__PURE__ */ u(De, { children: /* @__PURE__ */ u(Ee, { "data-slot": "tooltip", "data-testid": "spectral-tooltip", ...e }) }), $e = ({ asChild: e, children: o, ...t }) => /* @__PURE__ */ u(Re, { asChild: e, className: "w-fit", "data-slot": "tooltip-trigger", "data-testid": "spectral-tooltip-trigger", ...t, children: o }), Le = F(
324
+ `bg-tooltip-bg text-text-primary tooltip-effects pointer-events-auto z-50 w-fit rounded-md px-3 py-1.5 text-xs will-change-transform outline-none select-none motion-safe:data-[state=open]:animate-in
325
+ motion-safe:data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95 motion-safe:data-[state=closed]:animate-out motion-safe:data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[side=bottom]:slide-in-from-top-2
326
+ motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2`,
327
327
  {
328
328
  variants: {
329
329
  variant: {
330
- default: "bg-tooltip-bg text-text-primary",
331
- outline: "bg-tooltip-bg text-text-primary border-2 border-solid border-white"
330
+ default: "",
331
+ outline: "border-2 border-tooltip-outline-border"
332
332
  }
333
333
  },
334
334
  defaultVariants: {
335
335
  variant: "default"
336
336
  }
337
337
  }
338
- ), ke = F("z-[-1] size-2.5 rotate-45 rounded-[2px]", {
338
+ ), ke = F("bg-tooltip-arrow fill-tooltip-arrow z-[-1] size-2.5 rotate-45 rounded-[2px]", {
339
339
  variants: {
340
340
  variant: {
341
- default: "bg-tooltip-arrow fill-tooltip-arrow -translate-y-[calc(50%+1px)]",
342
- outline: "bg-tooltip-arrow fill-tooltip-arrow border-2 border-solid border-white border-t-0 border-l-0 -translate-y-[calc(50%-1.5px)]"
341
+ default: "-translate-y-[calc(50%+1px)]",
342
+ outline: "border-2 border-tooltip-outline-arrow border-t-0 border-l-0 -translate-y-[calc(50%-1.5px)]"
343
343
  }
344
344
  },
345
345
  defaultVariants: {
@@ -349,13 +349,13 @@ const De = ({ delayDuration: e = 0, ...o }) => /* @__PURE__ */ u(Pe, { "data-slo
349
349
  children: e,
350
350
  className: o,
351
351
  showArrow: t = !1,
352
- sideOffset: r = 0,
353
- variant: n = "default",
354
- side: l,
355
- ...s
356
- }) => /* @__PURE__ */ u(_e, { "data-slot": "tooltip-portal", "data-testid": "spectral-tooltip-portal", children: /* @__PURE__ */ S(Oe, { className: H(Le({ variant: n }), o), "data-slot": "tooltip-content", "data-testid": "spectral-tooltip-content", sideOffset: r, side: l, ...s, children: [
352
+ side: r,
353
+ sideOffset: n = 0,
354
+ variant: s = "default",
355
+ ...i
356
+ }) => /* @__PURE__ */ u(_e, { "data-testid": "spectral-tooltip-portal", "data-slot": "tooltip-portal", children: /* @__PURE__ */ S(Oe, { className: H(Le({ variant: s }), o), "data-slot": "tooltip-content", "data-testid": "spectral-tooltip-content", side: r, sideOffset: n, ...i, children: [
357
357
  e,
358
- t && /* @__PURE__ */ u(Ae, { height: 8, className: H(ke({ variant: n })) })
358
+ t && /* @__PURE__ */ u(Ae, { className: H(ke({ variant: s })), height: 8 })
359
359
  ] }) });
360
360
  export {
361
361
  ze as Tooltip,
package/dist/Tray.d.ts CHANGED
@@ -5,21 +5,21 @@ declare const TrayContentVariants: (props?: ({
5
5
  size?: "sm" | "md" | "lg" | "full" | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
7
  export type TrayBaseProps = ComponentPropsWithoutRef<typeof TrayBase.Root> & {
8
- size?: 'sm' | 'md' | 'lg' | 'full';
9
8
  children?: ReactNode;
9
+ size?: 'sm' | 'md' | 'lg' | 'full';
10
10
  };
11
11
  export declare const Tray: {
12
- ({ size, children, ...props }: TrayBaseProps): import("react/jsx-runtime").JSX.Element;
12
+ ({ children, size, ...props }: TrayBaseProps): import("react/jsx-runtime").JSX.Element;
13
13
  displayName: string;
14
14
  };
15
15
  export declare const TrayTrigger: {
16
- ({ ref, className, ...props }: ComponentPropsWithoutRef<typeof TrayBase.Trigger> & {
16
+ ({ className, ref, ...props }: ComponentPropsWithoutRef<typeof TrayBase.Trigger> & {
17
17
  ref?: Ref<HTMLButtonElement>;
18
18
  }): import("react/jsx-runtime").JSX.Element;
19
19
  displayName: string;
20
20
  };
21
21
  export declare const TrayClose: {
22
- ({ ref, className, ...props }: ComponentPropsWithoutRef<typeof TrayBase.Close> & {
22
+ ({ className, ref, ...props }: ComponentPropsWithoutRef<typeof TrayBase.Close> & {
23
23
  ref?: Ref<HTMLButtonElement>;
24
24
  }): import("react/jsx-runtime").JSX.Element;
25
25
  displayName: string;
@@ -28,25 +28,25 @@ export type TrayContentProps = ComponentPropsWithoutRef<typeof TrayBase.Content>
28
28
  children?: ReactNode;
29
29
  };
30
30
  export declare const TrayContent: {
31
- ({ ref, className, size: sizeProp, children, ...props }: TrayContentProps & {
31
+ ({ children, className, ref, size: sizeProp, ...props }: TrayContentProps & {
32
32
  ref?: Ref<HTMLDivElement>;
33
33
  }): import("react/jsx-runtime").JSX.Element;
34
34
  displayName: string;
35
35
  };
36
36
  export declare const TrayHeader: {
37
- ({ ref, className, children, ...props }: ComponentPropsWithoutRef<"div"> & {
37
+ ({ children, className, ref, ...props }: ComponentPropsWithoutRef<"div"> & {
38
38
  ref?: Ref<HTMLDivElement>;
39
39
  }): import("react/jsx-runtime").JSX.Element;
40
40
  displayName: string;
41
41
  };
42
42
  export declare const TrayTitle: {
43
- ({ ref, className, children, ...props }: ComponentPropsWithoutRef<"h2"> & {
43
+ ({ children, className, ref, ...props }: ComponentPropsWithoutRef<"h2"> & {
44
44
  ref?: Ref<HTMLHeadingElement>;
45
45
  }): import("react/jsx-runtime").JSX.Element;
46
46
  displayName: string;
47
47
  };
48
48
  export declare const TraySubtitle: {
49
- ({ ref, className, ...props }: ComponentPropsWithoutRef<"p"> & {
49
+ ({ className, ref, ...props }: ComponentPropsWithoutRef<"p"> & {
50
50
  ref?: Ref<HTMLParagraphElement>;
51
51
  }): import("react/jsx-runtime").JSX.Element;
52
52
  displayName: string;
@@ -55,7 +55,7 @@ export type TrayBodyProps = ComponentPropsWithoutRef<'div'> & {
55
55
  animationKey?: string | number;
56
56
  };
57
57
  export declare const TrayBody: {
58
- ({ ref, className, children, animationKey: keyProp, ...props }: TrayBodyProps & {
58
+ ({ animationKey: keyProp, children, className, ref, ...props }: TrayBodyProps & {
59
59
  ref?: Ref<HTMLDivElement>;
60
60
  }): import("react/jsx-runtime").JSX.Element;
61
61
  displayName: string;