@drjoshcsimmons/scl 0.1.0 → 0.1.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 (195) hide show
  1. package/dist/components/ui/alert/alert.d.ts +1 -1
  2. package/dist/components/ui/alert/alert.d.ts.map +1 -1
  3. package/dist/components/ui/badge/badge.d.ts +1 -1
  4. package/dist/components/ui/badge/badge.d.ts.map +1 -1
  5. package/dist/components/ui/button/button.d.ts +1 -1
  6. package/dist/components/ui/button/button.d.ts.map +1 -1
  7. package/dist/components/ui/combobox/combobox.d.ts +31 -0
  8. package/dist/components/ui/combobox/combobox.d.ts.map +1 -0
  9. package/dist/components/ui/combobox/index.d.ts +3 -0
  10. package/dist/components/ui/combobox/index.d.ts.map +1 -0
  11. package/dist/components/ui/command/command.d.ts +85 -0
  12. package/dist/components/ui/command/command.d.ts.map +1 -0
  13. package/dist/components/ui/command/index.d.ts +2 -0
  14. package/dist/components/ui/command/index.d.ts.map +1 -0
  15. package/dist/components/ui/dithered-image/dithered-image.d.ts +6 -2
  16. package/dist/components/ui/dithered-image/dithered-image.d.ts.map +1 -1
  17. package/dist/components/ui/dithered-image/index.d.ts +1 -1
  18. package/dist/components/ui/dithered-image/index.d.ts.map +1 -1
  19. package/dist/components/ui/form/form.d.ts +24 -0
  20. package/dist/components/ui/form/form.d.ts.map +1 -0
  21. package/dist/components/ui/form/index.d.ts +2 -0
  22. package/dist/components/ui/form/index.d.ts.map +1 -0
  23. package/dist/components/ui/progress/progress.d.ts +0 -6
  24. package/dist/components/ui/progress/progress.d.ts.map +1 -1
  25. package/dist/components/ui/scroll-area/scroll-area.d.ts.map +1 -1
  26. package/dist/components/ui/skeleton/skeleton.d.ts +4 -1
  27. package/dist/components/ui/skeleton/skeleton.d.ts.map +1 -1
  28. package/dist/components/ui/statusline/statusline.d.ts.map +1 -1
  29. package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts +0 -5
  30. package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts.map +1 -1
  31. package/dist/index.d.ts +3 -0
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +166 -143
  34. package/dist/index10.js +30 -30
  35. package/dist/index100.js +9 -30
  36. package/dist/index101.js +50 -15
  37. package/dist/index102.js +212 -128
  38. package/dist/index103.js +4 -50
  39. package/dist/index104.js +30 -9
  40. package/dist/index105.js +6 -4
  41. package/dist/index106.js +19 -179
  42. package/dist/index107.js +9 -650
  43. package/dist/index108.js +38 -107
  44. package/dist/index109.js +17 -90
  45. package/dist/index11.js +13 -13
  46. package/dist/index110.js +11 -66
  47. package/dist/index111.js +201 -154
  48. package/dist/index112.js +20 -395
  49. package/dist/index113.js +395 -1675
  50. package/dist/index114.js +2 -278
  51. package/dist/index115.js +49 -128
  52. package/dist/index116.js +65 -32
  53. package/dist/index117.js +2 -1611
  54. package/dist/index118.js +2 -298
  55. package/dist/index119.js +22 -632
  56. package/dist/index12.js +1 -1
  57. package/dist/index120.js +29 -144
  58. package/dist/index121.js +5 -21
  59. package/dist/index122.js +5 -9
  60. package/dist/index123.js +3 -38
  61. package/dist/index124.js +24 -18
  62. package/dist/index125.js +113 -6
  63. package/dist/index126.js +15 -11
  64. package/dist/index127.js +513 -194
  65. package/dist/index128.js +128 -22
  66. package/dist/index129.js +114 -380
  67. package/dist/index13.js +132 -93
  68. package/dist/index130.js +59 -1300
  69. package/dist/index131.js +63 -612
  70. package/dist/index132.js +9 -2
  71. package/dist/index133.js +13 -52
  72. package/dist/index134.js +64 -63
  73. package/dist/index135.js +3 -24
  74. package/dist/index136.js +23 -29
  75. package/dist/index137.js +23 -5
  76. package/dist/index138.js +13 -2
  77. package/dist/index139.js +28 -2
  78. package/dist/index14.js +106 -220
  79. package/dist/index140.js +5 -5
  80. package/dist/index15.js +79 -125
  81. package/dist/index16.js +280 -17
  82. package/dist/index17.js +139 -12
  83. package/dist/index18.js +92 -22
  84. package/dist/index19.js +18 -55
  85. package/dist/index2.js +2 -2
  86. package/dist/index20.js +14 -26
  87. package/dist/index21.js +19 -33
  88. package/dist/index22.js +38 -121
  89. package/dist/index23.js +29 -22
  90. package/dist/index24.js +31 -64
  91. package/dist/index25.js +121 -15
  92. package/dist/index26.js +19 -29
  93. package/dist/index27.js +68 -77
  94. package/dist/index28.js +20 -25
  95. package/dist/index29.js +32 -88
  96. package/dist/index3.js +11 -9
  97. package/dist/index30.js +138 -38
  98. package/dist/index31.js +20 -227
  99. package/dist/index32.js +88 -18
  100. package/dist/index33.js +37 -28
  101. package/dist/index34.js +86 -22
  102. package/dist/index35.js +17 -102
  103. package/dist/index36.js +34 -65
  104. package/dist/index37.js +23 -49
  105. package/dist/index38.js +38 -99
  106. package/dist/index39.js +65 -10
  107. package/dist/index4.js +6 -6
  108. package/dist/index40.js +49 -15
  109. package/dist/index41.js +93 -2256
  110. package/dist/index42.js +10 -32
  111. package/dist/index43.js +15 -18
  112. package/dist/index44.js +2251 -225
  113. package/dist/index45.js +33 -11
  114. package/dist/index46.js +116 -64
  115. package/dist/index47.js +207 -219
  116. package/dist/index48.js +5 -3
  117. package/dist/index49.js +54 -330
  118. package/dist/index5.js +23 -23
  119. package/dist/index50.js +244 -55
  120. package/dist/index51.js +9 -241
  121. package/dist/index52.js +60 -847
  122. package/dist/index53.js +236 -9
  123. package/dist/index54.js +11 -118
  124. package/dist/index55.js +300 -215
  125. package/dist/index56.js +4 -3
  126. package/dist/index57.js +225 -11
  127. package/dist/index58.js +11 -236
  128. package/dist/index59.js +27 -256
  129. package/dist/index6.js +12 -12
  130. package/dist/index60.js +260 -12
  131. package/dist/index61.js +12 -22
  132. package/dist/index62.js +94 -506
  133. package/dist/index63.js +12 -6155
  134. package/dist/index64.js +20 -2631
  135. package/dist/index65.js +16 -296
  136. package/dist/index66.js +232 -663
  137. package/dist/index67.js +125 -825
  138. package/dist/index68.js +159 -23
  139. package/dist/index69.js +241 -315
  140. package/dist/index7.js +22 -22
  141. package/dist/index70.js +72 -4889
  142. package/dist/index71.js +503 -802
  143. package/dist/index72.js +412 -1235
  144. package/dist/index73.js +323 -521
  145. package/dist/index74.js +839 -104
  146. package/dist/index75.js +9 -161
  147. package/dist/index76.js +67 -30
  148. package/dist/index77.js +22 -430
  149. package/dist/index78.js +6 -129
  150. package/dist/index79.js +48 -75
  151. package/dist/index8.js +17 -18
  152. package/dist/index80.js +42 -64
  153. package/dist/index81.js +50 -44
  154. package/dist/index82.js +32 -25
  155. package/dist/index83.js +10 -6
  156. package/dist/index84.js +7 -51
  157. package/dist/index85.js +5 -33
  158. package/dist/index86.js +24 -10
  159. package/dist/index87.js +68 -7
  160. package/dist/index88.js +55 -30
  161. package/dist/index89.js +10 -54
  162. package/dist/index9.js +23 -31
  163. package/dist/index90.js +4 -11
  164. package/dist/index91.js +30 -4
  165. package/dist/index92.js +1 -1
  166. package/dist/index93.js +180 -5
  167. package/dist/index94.js +14 -24
  168. package/dist/index95.js +643 -62
  169. package/dist/index96.js +5 -5
  170. package/dist/index97.js +128 -212
  171. package/dist/index98.js +2 -2
  172. package/dist/index99.js +13 -52
  173. package/dist/tokens/colors.d.ts +26 -86
  174. package/dist/tokens/colors.d.ts.map +1 -1
  175. package/dist/tokens/index.d.ts +12 -84
  176. package/dist/tokens/index.d.ts.map +1 -1
  177. package/package.json +26 -22
  178. package/dist/index141.js +0 -5
  179. package/dist/index142.js +0 -26
  180. package/dist/index143.js +0 -115
  181. package/dist/index144.js +0 -18
  182. package/dist/index145.js +0 -527
  183. package/dist/index146.js +0 -130
  184. package/dist/index147.js +0 -136
  185. package/dist/index148.js +0 -67
  186. package/dist/index149.js +0 -71
  187. package/dist/index150.js +0 -11
  188. package/dist/index151.js +0 -16
  189. package/dist/index152.js +0 -68
  190. package/dist/index153.js +0 -6
  191. package/dist/index154.js +0 -25
  192. package/dist/index155.js +0 -25
  193. package/dist/index156.js +0 -15
  194. package/dist/index157.js +0 -30
  195. package/dist/index158.js +0 -7
package/dist/index73.js CHANGED
@@ -1,536 +1,338 @@
1
- import { NodeProp as q } from "./index120.js";
2
- let A = 0;
3
- class l {
4
- /**
5
- @internal
6
- */
7
- constructor(t, a, i, n) {
8
- this.name = t, this.set = a, this.base = i, this.modified = n, this.id = A++;
1
+ import * as s from "react";
2
+ import { composeEventHandlers as g } from "./index78.js";
3
+ import { useComposedRefs as N } from "./index77.js";
4
+ import { createContextScope as K } from "./index76.js";
5
+ import { DismissableLayer as W } from "./index96.js";
6
+ import { useId as $ } from "./index83.js";
7
+ import { createPopperScope as S, Root as z, Anchor as J, Content as Q, Arrow as Z } from "./index102.js";
8
+ import { Portal as ee } from "./index98.js";
9
+ import { Presence as G } from "./index87.js";
10
+ import { Primitive as te } from "./index82.js";
11
+ import { createSlottable as oe } from "./index79.js";
12
+ import { useControllableState as re } from "./index81.js";
13
+ import { Root as ne } from "./index104.js";
14
+ import { jsx as f, jsxs as se } from "react/jsx-runtime";
15
+ var [D] = K("Tooltip", [
16
+ S
17
+ ]), O = S(), j = "TooltipProvider", ie = 700, L = "tooltip.open", [ae, k] = D(j), F = (t) => {
18
+ const {
19
+ __scopeTooltip: o,
20
+ delayDuration: e = ie,
21
+ skipDelayDuration: r = 300,
22
+ disableHoverableContent: n = !1,
23
+ children: a
24
+ } = t, l = s.useRef(!0), v = s.useRef(!1), i = s.useRef(0);
25
+ return s.useEffect(() => {
26
+ const p = i.current;
27
+ return () => window.clearTimeout(p);
28
+ }, []), /* @__PURE__ */ f(
29
+ ae,
30
+ {
31
+ scope: o,
32
+ isOpenDelayedRef: l,
33
+ delayDuration: e,
34
+ onOpen: s.useCallback(() => {
35
+ window.clearTimeout(i.current), l.current = !1;
36
+ }, []),
37
+ onClose: s.useCallback(() => {
38
+ window.clearTimeout(i.current), i.current = window.setTimeout(
39
+ () => l.current = !0,
40
+ r
41
+ );
42
+ }, [r]),
43
+ isPointerInTransitRef: v,
44
+ onPointerInTransitChange: s.useCallback((p) => {
45
+ v.current = p;
46
+ }, []),
47
+ disableHoverableContent: n,
48
+ children: a
49
+ }
50
+ );
51
+ };
52
+ F.displayName = j;
53
+ var R = "Tooltip", [le, _] = D(R), B = (t) => {
54
+ const {
55
+ __scopeTooltip: o,
56
+ children: e,
57
+ open: r,
58
+ defaultOpen: n,
59
+ onOpenChange: a,
60
+ disableHoverableContent: l,
61
+ delayDuration: v
62
+ } = t, i = k(R, t.__scopeTooltip), p = O(o), [c, d] = s.useState(null), h = $(), u = s.useRef(0), m = l ?? i.disableHoverableContent, y = v ?? i.delayDuration, T = s.useRef(!1), [x, C] = re({
63
+ prop: r,
64
+ defaultProp: n ?? !1,
65
+ onChange: (H) => {
66
+ H ? (i.onOpen(), document.dispatchEvent(new CustomEvent(L))) : i.onClose(), a == null || a(H);
67
+ },
68
+ caller: R
69
+ }), w = s.useMemo(() => x ? T.current ? "delayed-open" : "instant-open" : "closed", [x]), P = s.useCallback(() => {
70
+ window.clearTimeout(u.current), u.current = 0, T.current = !1, C(!0);
71
+ }, [C]), E = s.useCallback(() => {
72
+ window.clearTimeout(u.current), u.current = 0, C(!1);
73
+ }, [C]), I = s.useCallback(() => {
74
+ window.clearTimeout(u.current), u.current = window.setTimeout(() => {
75
+ T.current = !0, C(!0), u.current = 0;
76
+ }, y);
77
+ }, [y, C]);
78
+ return s.useEffect(() => () => {
79
+ u.current && (window.clearTimeout(u.current), u.current = 0);
80
+ }, []), /* @__PURE__ */ f(z, { ...p, children: /* @__PURE__ */ f(
81
+ le,
82
+ {
83
+ scope: o,
84
+ contentId: h,
85
+ open: x,
86
+ stateAttribute: w,
87
+ trigger: c,
88
+ onTriggerChange: d,
89
+ onTriggerEnter: s.useCallback(() => {
90
+ i.isOpenDelayedRef.current ? I() : P();
91
+ }, [i.isOpenDelayedRef, I, P]),
92
+ onTriggerLeave: s.useCallback(() => {
93
+ m ? E() : (window.clearTimeout(u.current), u.current = 0);
94
+ }, [E, m]),
95
+ onOpen: P,
96
+ onClose: E,
97
+ disableHoverableContent: m,
98
+ children: e
99
+ }
100
+ ) });
101
+ };
102
+ B.displayName = R;
103
+ var A = "TooltipTrigger", U = s.forwardRef(
104
+ (t, o) => {
105
+ const { __scopeTooltip: e, ...r } = t, n = _(A, e), a = k(A, e), l = O(e), v = s.useRef(null), i = N(o, v, n.onTriggerChange), p = s.useRef(!1), c = s.useRef(!1), d = s.useCallback(() => p.current = !1, []);
106
+ return s.useEffect(() => () => document.removeEventListener("pointerup", d), [d]), /* @__PURE__ */ f(J, { asChild: !0, ...l, children: /* @__PURE__ */ f(
107
+ te.button,
108
+ {
109
+ "aria-describedby": n.open ? n.contentId : void 0,
110
+ "data-state": n.stateAttribute,
111
+ ...r,
112
+ ref: i,
113
+ onPointerMove: g(t.onPointerMove, (h) => {
114
+ h.pointerType !== "touch" && !c.current && !a.isPointerInTransitRef.current && (n.onTriggerEnter(), c.current = !0);
115
+ }),
116
+ onPointerLeave: g(t.onPointerLeave, () => {
117
+ n.onTriggerLeave(), c.current = !1;
118
+ }),
119
+ onPointerDown: g(t.onPointerDown, () => {
120
+ n.open && n.onClose(), p.current = !0, document.addEventListener("pointerup", d, { once: !0 });
121
+ }),
122
+ onFocus: g(t.onFocus, () => {
123
+ p.current || n.onOpen();
124
+ }),
125
+ onBlur: g(t.onBlur, n.onClose),
126
+ onClick: g(t.onClick, n.onClose)
127
+ }
128
+ ) });
129
+ }
130
+ );
131
+ U.displayName = A;
132
+ var M = "TooltipPortal", [ce, ue] = D(M, {
133
+ forceMount: void 0
134
+ }), V = (t) => {
135
+ const { __scopeTooltip: o, forceMount: e, children: r, container: n } = t, a = _(M, o);
136
+ return /* @__PURE__ */ f(ce, { scope: o, forceMount: e, children: /* @__PURE__ */ f(G, { present: e || a.open, children: /* @__PURE__ */ f(ee, { asChild: !0, container: n, children: r }) }) });
137
+ };
138
+ V.displayName = M;
139
+ var b = "TooltipContent", Y = s.forwardRef(
140
+ (t, o) => {
141
+ const e = ue(b, t.__scopeTooltip), { forceMount: r = e.forceMount, side: n = "top", ...a } = t, l = _(b, t.__scopeTooltip);
142
+ return /* @__PURE__ */ f(G, { present: r || l.open, children: l.disableHoverableContent ? /* @__PURE__ */ f(q, { side: n, ...a, ref: o }) : /* @__PURE__ */ f(pe, { side: n, ...a, ref: o }) });
9
143
  }
10
- toString() {
11
- let { name: t } = this;
12
- for (let a of this.modified)
13
- a.name && (t = `${a.name}(${t})`);
14
- return t;
144
+ ), pe = s.forwardRef((t, o) => {
145
+ const e = _(b, t.__scopeTooltip), r = k(b, t.__scopeTooltip), n = s.useRef(null), a = N(o, n), [l, v] = s.useState(null), { trigger: i, onClose: p } = e, c = n.current, { onPointerInTransitChange: d } = r, h = s.useCallback(() => {
146
+ v(null), d(!1);
147
+ }, [d]), u = s.useCallback(
148
+ (m, y) => {
149
+ const T = m.currentTarget, x = { x: m.clientX, y: m.clientY }, C = me(x, T.getBoundingClientRect()), w = Te(x, C), P = ye(y.getBoundingClientRect()), E = xe([...w, ...P]);
150
+ v(E), d(!0);
151
+ },
152
+ [d]
153
+ );
154
+ return s.useEffect(() => () => h(), [h]), s.useEffect(() => {
155
+ if (i && c) {
156
+ const m = (T) => u(T, c), y = (T) => u(T, i);
157
+ return i.addEventListener("pointerleave", m), c.addEventListener("pointerleave", y), () => {
158
+ i.removeEventListener("pointerleave", m), c.removeEventListener("pointerleave", y);
159
+ };
160
+ }
161
+ }, [i, c, u, h]), s.useEffect(() => {
162
+ if (l) {
163
+ const m = (y) => {
164
+ const T = y.target, x = { x: y.clientX, y: y.clientY }, C = (i == null ? void 0 : i.contains(T)) || (c == null ? void 0 : c.contains(T)), w = !Ce(x, l);
165
+ C ? h() : w && (h(), p());
166
+ };
167
+ return document.addEventListener("pointermove", m), () => document.removeEventListener("pointermove", m);
168
+ }
169
+ }, [i, c, l, p, h]), /* @__PURE__ */ f(q, { ...t, ref: a });
170
+ }), [de, fe] = D(R, { isInside: !1 }), ve = oe("TooltipContent"), q = s.forwardRef(
171
+ (t, o) => {
172
+ const {
173
+ __scopeTooltip: e,
174
+ children: r,
175
+ "aria-label": n,
176
+ onEscapeKeyDown: a,
177
+ onPointerDownOutside: l,
178
+ ...v
179
+ } = t, i = _(b, e), p = O(e), { onClose: c } = i;
180
+ return s.useEffect(() => (document.addEventListener(L, c), () => document.removeEventListener(L, c)), [c]), s.useEffect(() => {
181
+ if (i.trigger) {
182
+ const d = (h) => {
183
+ const u = h.target;
184
+ u != null && u.contains(i.trigger) && c();
185
+ };
186
+ return window.addEventListener("scroll", d, { capture: !0 }), () => window.removeEventListener("scroll", d, { capture: !0 });
187
+ }
188
+ }, [i.trigger, c]), /* @__PURE__ */ f(
189
+ W,
190
+ {
191
+ asChild: !0,
192
+ disableOutsidePointerEvents: !1,
193
+ onEscapeKeyDown: a,
194
+ onPointerDownOutside: l,
195
+ onFocusOutside: (d) => d.preventDefault(),
196
+ onDismiss: c,
197
+ children: /* @__PURE__ */ se(
198
+ Q,
199
+ {
200
+ "data-state": i.stateAttribute,
201
+ ...p,
202
+ ...v,
203
+ ref: o,
204
+ style: {
205
+ ...v.style,
206
+ "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
207
+ "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
208
+ "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
209
+ "--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
210
+ "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
211
+ },
212
+ children: [
213
+ /* @__PURE__ */ f(ve, { children: r }),
214
+ /* @__PURE__ */ f(de, { scope: e, isInside: !0, children: /* @__PURE__ */ f(ne, { id: i.contentId, role: "tooltip", children: n || r }) })
215
+ ]
216
+ }
217
+ )
218
+ }
219
+ );
15
220
  }
16
- static define(t, a) {
17
- let i = typeof t == "string" ? t : "?";
18
- if (t instanceof l && (a = t), a != null && a.base)
19
- throw new Error("Can not derive from a modified tag");
20
- let n = new l(i, [], null, []);
21
- if (n.set.push(n), a)
22
- for (let r of a.set)
23
- n.set.push(r);
24
- return n;
221
+ );
222
+ Y.displayName = b;
223
+ var X = "TooltipArrow", he = s.forwardRef(
224
+ (t, o) => {
225
+ const { __scopeTooltip: e, ...r } = t, n = O(e);
226
+ return fe(
227
+ X,
228
+ e
229
+ ).isInside ? null : /* @__PURE__ */ f(Z, { ...n, ...r, ref: o });
25
230
  }
26
- /**
27
- Define a tag _modifier_, which is a function that, given a tag,
28
- will return a tag that is a subtag of the original. Applying the
29
- same modifier to a twice tag will return the same value (`m1(t1)
30
- == m1(t1)`) and applying multiple modifiers will, regardless or
31
- order, produce the same tag (`m1(m2(t1)) == m2(m1(t1))`).
32
-
33
- When multiple modifiers are applied to a given base tag, each
34
- smaller set of modifiers is registered as a parent, so that for
35
- example `m1(m2(m3(t1)))` is a subtype of `m1(m2(t1))`,
36
- `m1(m3(t1)`, and so on.
37
- */
38
- static defineModifier(t) {
39
- let a = new x(t);
40
- return (i) => i.modified.indexOf(a) > -1 ? i : x.get(i.base || i, i.modified.concat(a).sort((n, r) => n.id - r.id));
231
+ );
232
+ he.displayName = X;
233
+ function me(t, o) {
234
+ const e = Math.abs(o.top - t.y), r = Math.abs(o.bottom - t.y), n = Math.abs(o.right - t.x), a = Math.abs(o.left - t.x);
235
+ switch (Math.min(e, r, n, a)) {
236
+ case a:
237
+ return "left";
238
+ case n:
239
+ return "right";
240
+ case e:
241
+ return "top";
242
+ case r:
243
+ return "bottom";
244
+ default:
245
+ throw new Error("unreachable");
41
246
  }
42
247
  }
43
- let I = 0;
44
- class x {
45
- constructor(t) {
46
- this.name = t, this.instances = [], this.id = I++;
47
- }
48
- static get(t, a) {
49
- if (!a.length)
50
- return t;
51
- let i = a[0].instances.find((g) => g.base == t && j(a, g.modified));
52
- if (i)
53
- return i;
54
- let n = [], r = new l(t.name, n, t, a);
55
- for (let g of a)
56
- g.instances.push(r);
57
- let f = B(a);
58
- for (let g of t.set)
59
- if (!g.modified.length)
60
- for (let w of f)
61
- n.push(x.get(g, w));
62
- return r;
248
+ function Te(t, o, e = 5) {
249
+ const r = [];
250
+ switch (o) {
251
+ case "top":
252
+ r.push(
253
+ { x: t.x - e, y: t.y + e },
254
+ { x: t.x + e, y: t.y + e }
255
+ );
256
+ break;
257
+ case "bottom":
258
+ r.push(
259
+ { x: t.x - e, y: t.y - e },
260
+ { x: t.x + e, y: t.y - e }
261
+ );
262
+ break;
263
+ case "left":
264
+ r.push(
265
+ { x: t.x + e, y: t.y - e },
266
+ { x: t.x + e, y: t.y + e }
267
+ );
268
+ break;
269
+ case "right":
270
+ r.push(
271
+ { x: t.x - e, y: t.y - e },
272
+ { x: t.x - e, y: t.y + e }
273
+ );
274
+ break;
63
275
  }
276
+ return r;
64
277
  }
65
- function j(s, t) {
66
- return s.length == t.length && s.every((a, i) => a == t[i]);
278
+ function ye(t) {
279
+ const { top: o, right: e, bottom: r, left: n } = t;
280
+ return [
281
+ { x: n, y: o },
282
+ { x: e, y: o },
283
+ { x: e, y: r },
284
+ { x: n, y: r }
285
+ ];
67
286
  }
68
- function B(s) {
69
- let t = [[]];
70
- for (let a = 0; a < s.length; a++)
71
- for (let i = 0, n = t.length; i < n; i++)
72
- t.push(t[i].concat(s[a]));
73
- return t.sort((a, i) => i.length - a.length);
287
+ function Ce(t, o) {
288
+ const { x: e, y: r } = t;
289
+ let n = !1;
290
+ for (let a = 0, l = o.length - 1; a < o.length; l = a++) {
291
+ const v = o[a], i = o[l], p = v.x, c = v.y, d = i.x, h = i.y;
292
+ c > r != h > r && e < (d - p) * (r - c) / (h - c) + p && (n = !n);
293
+ }
294
+ return n;
295
+ }
296
+ function xe(t) {
297
+ const o = t.slice();
298
+ return o.sort((e, r) => e.x < r.x ? -1 : e.x > r.x ? 1 : e.y < r.y ? -1 : e.y > r.y ? 1 : 0), ge(o);
74
299
  }
75
- new q({
76
- combine(s, t) {
77
- let a, i, n;
78
- for (; s || t; ) {
79
- if (!s || t && s.depth >= t.depth ? (n = t, t = t.next) : (n = s, s = s.next), a && a.mode == n.mode && !n.context && !a.context)
80
- continue;
81
- let r = new O(n.tags, n.mode, n.context);
82
- a ? a.next = r : i = r, a = r;
300
+ function ge(t) {
301
+ if (t.length <= 1) return t.slice();
302
+ const o = [];
303
+ for (let r = 0; r < t.length; r++) {
304
+ const n = t[r];
305
+ for (; o.length >= 2; ) {
306
+ const a = o[o.length - 1], l = o[o.length - 2];
307
+ if ((a.x - l.x) * (n.y - l.y) >= (a.y - l.y) * (n.x - l.x)) o.pop();
308
+ else break;
83
309
  }
84
- return i;
85
- }
86
- });
87
- class O {
88
- constructor(t, a, i, n) {
89
- this.tags = t, this.mode = a, this.context = i, this.next = n;
90
- }
91
- get opaque() {
92
- return this.mode == 0;
93
- }
94
- get inherit() {
95
- return this.mode == 1;
96
- }
97
- sort(t) {
98
- return !t || t.depth < this.depth ? (this.next = t, this) : (t.next = this.sort(t.next), t);
310
+ o.push(n);
99
311
  }
100
- get depth() {
101
- return this.context ? this.context.length : 0;
312
+ o.pop();
313
+ const e = [];
314
+ for (let r = t.length - 1; r >= 0; r--) {
315
+ const n = t[r];
316
+ for (; e.length >= 2; ) {
317
+ const a = e[e.length - 1], l = e[e.length - 2];
318
+ if ((a.x - l.x) * (n.y - l.y) >= (a.y - l.y) * (n.x - l.x)) e.pop();
319
+ else break;
320
+ }
321
+ e.push(n);
102
322
  }
323
+ return e.pop(), o.length === 1 && e.length === 1 && o[0].x === e[0].x && o[0].y === e[0].y ? o : o.concat(e);
103
324
  }
104
- O.empty = new O([], 2, null);
105
- function D(s, t) {
106
- let a = /* @__PURE__ */ Object.create(null);
107
- for (let r of s)
108
- if (!Array.isArray(r.tag))
109
- a[r.tag.id] = r.class;
110
- else
111
- for (let f of r.tag)
112
- a[f.id] = r.class;
113
- let { scope: i, all: n = null } = {};
114
- return {
115
- style: (r) => {
116
- let f = n;
117
- for (let g of r)
118
- for (let w of g.set) {
119
- let v = a[w.id];
120
- if (v) {
121
- f = f ? f + " " + v : v;
122
- break;
123
- }
124
- }
125
- return f;
126
- },
127
- scope: i
128
- };
129
- }
130
- const e = l.define, N = e(), p = e(), K = e(p), S = e(p), u = e(), y = e(u), M = e(u), m = e(), h = e(m), c = e(), d = e(), C = e(), k = e(C), b = e(), o = {
131
- /**
132
- A comment.
133
- */
134
- comment: N,
135
- /**
136
- A line [comment](#highlight.tags.comment).
137
- */
138
- lineComment: e(N),
139
- /**
140
- A block [comment](#highlight.tags.comment).
141
- */
142
- blockComment: e(N),
143
- /**
144
- A documentation [comment](#highlight.tags.comment).
145
- */
146
- docComment: e(N),
147
- /**
148
- Any kind of identifier.
149
- */
150
- name: p,
151
- /**
152
- The [name](#highlight.tags.name) of a variable.
153
- */
154
- variableName: e(p),
155
- /**
156
- A type [name](#highlight.tags.name).
157
- */
158
- typeName: K,
159
- /**
160
- A tag name (subtag of [`typeName`](#highlight.tags.typeName)).
161
- */
162
- tagName: e(K),
163
- /**
164
- A property or field [name](#highlight.tags.name).
165
- */
166
- propertyName: S,
167
- /**
168
- An attribute name (subtag of [`propertyName`](#highlight.tags.propertyName)).
169
- */
170
- attributeName: e(S),
171
- /**
172
- The [name](#highlight.tags.name) of a class.
173
- */
174
- className: e(p),
175
- /**
176
- A label [name](#highlight.tags.name).
177
- */
178
- labelName: e(p),
179
- /**
180
- A namespace [name](#highlight.tags.name).
181
- */
182
- namespace: e(p),
183
- /**
184
- The [name](#highlight.tags.name) of a macro.
185
- */
186
- macroName: e(p),
187
- /**
188
- A literal value.
189
- */
190
- literal: u,
191
- /**
192
- A string [literal](#highlight.tags.literal).
193
- */
194
- string: y,
195
- /**
196
- A documentation [string](#highlight.tags.string).
197
- */
198
- docString: e(y),
199
- /**
200
- A character literal (subtag of [string](#highlight.tags.string)).
201
- */
202
- character: e(y),
203
- /**
204
- An attribute value (subtag of [string](#highlight.tags.string)).
205
- */
206
- attributeValue: e(y),
207
- /**
208
- A number [literal](#highlight.tags.literal).
209
- */
210
- number: M,
211
- /**
212
- An integer [number](#highlight.tags.number) literal.
213
- */
214
- integer: e(M),
215
- /**
216
- A floating-point [number](#highlight.tags.number) literal.
217
- */
218
- float: e(M),
219
- /**
220
- A boolean [literal](#highlight.tags.literal).
221
- */
222
- bool: e(u),
223
- /**
224
- Regular expression [literal](#highlight.tags.literal).
225
- */
226
- regexp: e(u),
227
- /**
228
- An escape [literal](#highlight.tags.literal), for example a
229
- backslash escape in a string.
230
- */
231
- escape: e(u),
232
- /**
233
- A color [literal](#highlight.tags.literal).
234
- */
235
- color: e(u),
236
- /**
237
- A URL [literal](#highlight.tags.literal).
238
- */
239
- url: e(u),
240
- /**
241
- A language keyword.
242
- */
243
- keyword: c,
244
- /**
245
- The [keyword](#highlight.tags.keyword) for the self or this
246
- object.
247
- */
248
- self: e(c),
249
- /**
250
- The [keyword](#highlight.tags.keyword) for null.
251
- */
252
- null: e(c),
253
- /**
254
- A [keyword](#highlight.tags.keyword) denoting some atomic value.
255
- */
256
- atom: e(c),
257
- /**
258
- A [keyword](#highlight.tags.keyword) that represents a unit.
259
- */
260
- unit: e(c),
261
- /**
262
- A modifier [keyword](#highlight.tags.keyword).
263
- */
264
- modifier: e(c),
265
- /**
266
- A [keyword](#highlight.tags.keyword) that acts as an operator.
267
- */
268
- operatorKeyword: e(c),
269
- /**
270
- A control-flow related [keyword](#highlight.tags.keyword).
271
- */
272
- controlKeyword: e(c),
273
- /**
274
- A [keyword](#highlight.tags.keyword) that defines something.
275
- */
276
- definitionKeyword: e(c),
277
- /**
278
- A [keyword](#highlight.tags.keyword) related to defining or
279
- interfacing with modules.
280
- */
281
- moduleKeyword: e(c),
282
- /**
283
- An operator.
284
- */
285
- operator: d,
286
- /**
287
- An [operator](#highlight.tags.operator) that dereferences something.
288
- */
289
- derefOperator: e(d),
290
- /**
291
- Arithmetic-related [operator](#highlight.tags.operator).
292
- */
293
- arithmeticOperator: e(d),
294
- /**
295
- Logical [operator](#highlight.tags.operator).
296
- */
297
- logicOperator: e(d),
298
- /**
299
- Bit [operator](#highlight.tags.operator).
300
- */
301
- bitwiseOperator: e(d),
302
- /**
303
- Comparison [operator](#highlight.tags.operator).
304
- */
305
- compareOperator: e(d),
306
- /**
307
- [Operator](#highlight.tags.operator) that updates its operand.
308
- */
309
- updateOperator: e(d),
310
- /**
311
- [Operator](#highlight.tags.operator) that defines something.
312
- */
313
- definitionOperator: e(d),
314
- /**
315
- Type-related [operator](#highlight.tags.operator).
316
- */
317
- typeOperator: e(d),
318
- /**
319
- Control-flow [operator](#highlight.tags.operator).
320
- */
321
- controlOperator: e(d),
322
- /**
323
- Program or markup punctuation.
324
- */
325
- punctuation: C,
326
- /**
327
- [Punctuation](#highlight.tags.punctuation) that separates
328
- things.
329
- */
330
- separator: e(C),
331
- /**
332
- Bracket-style [punctuation](#highlight.tags.punctuation).
333
- */
334
- bracket: k,
335
- /**
336
- Angle [brackets](#highlight.tags.bracket) (usually `<` and `>`
337
- tokens).
338
- */
339
- angleBracket: e(k),
340
- /**
341
- Square [brackets](#highlight.tags.bracket) (usually `[` and `]`
342
- tokens).
343
- */
344
- squareBracket: e(k),
345
- /**
346
- Parentheses (usually `(` and `)` tokens). Subtag of
347
- [bracket](#highlight.tags.bracket).
348
- */
349
- paren: e(k),
350
- /**
351
- Braces (usually `{` and `}` tokens). Subtag of
352
- [bracket](#highlight.tags.bracket).
353
- */
354
- brace: e(k),
355
- /**
356
- Content, for example plain text in XML or markup documents.
357
- */
358
- content: m,
359
- /**
360
- [Content](#highlight.tags.content) that represents a heading.
361
- */
362
- heading: h,
363
- /**
364
- A level 1 [heading](#highlight.tags.heading).
365
- */
366
- heading1: e(h),
367
- /**
368
- A level 2 [heading](#highlight.tags.heading).
369
- */
370
- heading2: e(h),
371
- /**
372
- A level 3 [heading](#highlight.tags.heading).
373
- */
374
- heading3: e(h),
375
- /**
376
- A level 4 [heading](#highlight.tags.heading).
377
- */
378
- heading4: e(h),
379
- /**
380
- A level 5 [heading](#highlight.tags.heading).
381
- */
382
- heading5: e(h),
383
- /**
384
- A level 6 [heading](#highlight.tags.heading).
385
- */
386
- heading6: e(h),
387
- /**
388
- A prose [content](#highlight.tags.content) separator (such as a horizontal rule).
389
- */
390
- contentSeparator: e(m),
391
- /**
392
- [Content](#highlight.tags.content) that represents a list.
393
- */
394
- list: e(m),
395
- /**
396
- [Content](#highlight.tags.content) that represents a quote.
397
- */
398
- quote: e(m),
399
- /**
400
- [Content](#highlight.tags.content) that is emphasized.
401
- */
402
- emphasis: e(m),
403
- /**
404
- [Content](#highlight.tags.content) that is styled strong.
405
- */
406
- strong: e(m),
407
- /**
408
- [Content](#highlight.tags.content) that is part of a link.
409
- */
410
- link: e(m),
411
- /**
412
- [Content](#highlight.tags.content) that is styled as code or
413
- monospace.
414
- */
415
- monospace: e(m),
416
- /**
417
- [Content](#highlight.tags.content) that has a strike-through
418
- style.
419
- */
420
- strikethrough: e(m),
421
- /**
422
- Inserted text in a change-tracking format.
423
- */
424
- inserted: e(),
425
- /**
426
- Deleted text.
427
- */
428
- deleted: e(),
429
- /**
430
- Changed text.
431
- */
432
- changed: e(),
433
- /**
434
- An invalid or unsyntactic element.
435
- */
436
- invalid: e(),
437
- /**
438
- Metadata or meta-instruction.
439
- */
440
- meta: b,
441
- /**
442
- [Metadata](#highlight.tags.meta) that applies to the entire
443
- document.
444
- */
445
- documentMeta: e(b),
446
- /**
447
- [Metadata](#highlight.tags.meta) that annotates or adds
448
- attributes to a given syntactic element.
449
- */
450
- annotation: e(b),
451
- /**
452
- Processing instruction or preprocessor directive. Subtag of
453
- [meta](#highlight.tags.meta).
454
- */
455
- processingInstruction: e(b),
456
- /**
457
- [Modifier](#highlight.Tag^defineModifier) that indicates that a
458
- given element is being defined. Expected to be used with the
459
- various [name](#highlight.tags.name) tags.
460
- */
461
- definition: l.defineModifier("definition"),
462
- /**
463
- [Modifier](#highlight.Tag^defineModifier) that indicates that
464
- something is constant. Mostly expected to be used with
465
- [variable names](#highlight.tags.variableName).
466
- */
467
- constant: l.defineModifier("constant"),
468
- /**
469
- [Modifier](#highlight.Tag^defineModifier) used to indicate that
470
- a [variable](#highlight.tags.variableName) or [property
471
- name](#highlight.tags.propertyName) is being called or defined
472
- as a function.
473
- */
474
- function: l.defineModifier("function"),
475
- /**
476
- [Modifier](#highlight.Tag^defineModifier) that can be applied to
477
- [names](#highlight.tags.name) to indicate that they belong to
478
- the language's standard environment.
479
- */
480
- standard: l.defineModifier("standard"),
481
- /**
482
- [Modifier](#highlight.Tag^defineModifier) that indicates a given
483
- [names](#highlight.tags.name) is local to some scope.
484
- */
485
- local: l.defineModifier("local"),
486
- /**
487
- A generic variant [modifier](#highlight.Tag^defineModifier) that
488
- can be used to tag language-specific alternative variants of
489
- some common tag. It is recommended for themes to define special
490
- forms of at least the [string](#highlight.tags.string) and
491
- [variable name](#highlight.tags.variableName) tags, since those
492
- come up a lot.
493
- */
494
- special: l.defineModifier("special")
495
- };
496
- for (let s in o) {
497
- let t = o[s];
498
- t instanceof l && (t.name = s);
499
- }
500
- D([
501
- { tag: o.link, class: "tok-link" },
502
- { tag: o.heading, class: "tok-heading" },
503
- { tag: o.emphasis, class: "tok-emphasis" },
504
- { tag: o.strong, class: "tok-strong" },
505
- { tag: o.keyword, class: "tok-keyword" },
506
- { tag: o.atom, class: "tok-atom" },
507
- { tag: o.bool, class: "tok-bool" },
508
- { tag: o.url, class: "tok-url" },
509
- { tag: o.labelName, class: "tok-labelName" },
510
- { tag: o.inserted, class: "tok-inserted" },
511
- { tag: o.deleted, class: "tok-deleted" },
512
- { tag: o.literal, class: "tok-literal" },
513
- { tag: o.string, class: "tok-string" },
514
- { tag: o.number, class: "tok-number" },
515
- { tag: [o.regexp, o.escape, o.special(o.string)], class: "tok-string2" },
516
- { tag: o.variableName, class: "tok-variableName" },
517
- { tag: o.local(o.variableName), class: "tok-variableName tok-local" },
518
- { tag: o.definition(o.variableName), class: "tok-variableName tok-definition" },
519
- { tag: o.special(o.variableName), class: "tok-variableName2" },
520
- { tag: o.definition(o.propertyName), class: "tok-propertyName tok-definition" },
521
- { tag: o.typeName, class: "tok-typeName" },
522
- { tag: o.namespace, class: "tok-namespace" },
523
- { tag: o.className, class: "tok-className" },
524
- { tag: o.macroName, class: "tok-macroName" },
525
- { tag: o.propertyName, class: "tok-propertyName" },
526
- { tag: o.operator, class: "tok-operator" },
527
- { tag: o.comment, class: "tok-comment" },
528
- { tag: o.meta, class: "tok-meta" },
529
- { tag: o.invalid, class: "tok-invalid" },
530
- { tag: o.punctuation, class: "tok-punctuation" }
531
- ]);
325
+ var He = F, Ne = B, Se = U, Ge = V, je = Y;
532
326
  export {
533
- l as Tag,
534
- D as tagHighlighter,
535
- o as tags
327
+ je as Content,
328
+ Ge as Portal,
329
+ He as Provider,
330
+ Ne as Root,
331
+ B as Tooltip,
332
+ he as TooltipArrow,
333
+ Y as TooltipContent,
334
+ V as TooltipPortal,
335
+ F as TooltipProvider,
336
+ U as TooltipTrigger,
337
+ Se as Trigger
536
338
  };