@vertz/ui-primitives 0.2.41 → 0.2.42

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 (232) hide show
  1. package/dist/shared/chunk-06m8prfg.js +52 -0
  2. package/dist/shared/chunk-0n9jj8xr.js +24 -0
  3. package/dist/shared/chunk-1ben27xq.js +317 -0
  4. package/dist/shared/chunk-1j2mj0sa.js +45 -0
  5. package/dist/shared/chunk-250hj18f.js +243 -0
  6. package/dist/shared/chunk-2h4m9c71.js +38 -0
  7. package/dist/shared/chunk-2sbx20hv.js +128 -0
  8. package/dist/shared/chunk-2ye674gr.js +70 -0
  9. package/dist/shared/chunk-34d8385y.js +15 -0
  10. package/dist/shared/chunk-4d7bm8h0.js +113 -0
  11. package/dist/shared/chunk-4zjgxr7x.js +157 -0
  12. package/dist/shared/chunk-5c150wvr.js +140 -0
  13. package/dist/shared/chunk-5gycdypd.js +58 -0
  14. package/dist/shared/chunk-6mm7fhp8.js +105 -0
  15. package/dist/shared/chunk-6zmnqvh6.js +109 -0
  16. package/dist/shared/{chunk-yy3ft5mb.js → chunk-7amn5d71.js} +2 -2
  17. package/dist/shared/chunk-7pbff2hg.js +118 -0
  18. package/dist/shared/chunk-7zpjshwz.js +194 -0
  19. package/dist/shared/chunk-993ff51d.js +155 -0
  20. package/dist/shared/chunk-9pdt5aw7.js +24 -0
  21. package/dist/shared/chunk-a71m4xkv.js +106 -0
  22. package/dist/shared/chunk-aj8m39pk.js +127 -0
  23. package/dist/shared/chunk-ajawpc05.js +305 -0
  24. package/dist/shared/chunk-b7mzwqhj.js +125 -0
  25. package/dist/shared/chunk-bb887de4.js +200 -0
  26. package/dist/shared/chunk-bfsmbrxc.js +111 -0
  27. package/dist/shared/chunk-c2f63m5n.js +56 -0
  28. package/dist/shared/chunk-c5r3s5km.js +263 -0
  29. package/dist/shared/chunk-caba5bhd.js +427 -0
  30. package/dist/shared/chunk-crym07yc.js +264 -0
  31. package/dist/shared/{chunk-5964gmv0.js → chunk-csjtyvam.js} +62 -88
  32. package/dist/shared/chunk-d6rtejz3.js +128 -0
  33. package/dist/shared/chunk-dvaf0bmq.js +140 -0
  34. package/dist/shared/chunk-dwkv9ya6.js +22 -0
  35. package/dist/shared/chunk-e0ckxrjg.js +41 -0
  36. package/dist/shared/chunk-ennxcymj.js +225 -0
  37. package/dist/shared/{chunk-1jd1n0dt.js → chunk-ey38de46.js} +19 -47
  38. package/dist/shared/chunk-f0v1gs5e.js +52 -0
  39. package/dist/shared/chunk-f86rsf84.js +231 -0
  40. package/dist/shared/{chunk-3sahbk4d.js → chunk-fdse46x5.js} +6 -1
  41. package/dist/shared/chunk-gj4hrssn.js +135 -0
  42. package/dist/shared/chunk-gyvq4gk9.js +24 -0
  43. package/dist/shared/chunk-hbnps9sq.js +229 -0
  44. package/dist/shared/{chunk-fhss32ya.js → chunk-hdmpyeq9.js} +43 -132
  45. package/dist/shared/chunk-hgnkd4he.js +256 -0
  46. package/dist/shared/chunk-hpcyffm7.js +185 -0
  47. package/dist/shared/chunk-hpmvwx0h.js +99 -0
  48. package/dist/shared/chunk-hz0e504p.js +69 -0
  49. package/dist/shared/chunk-hzk4wfq9.js +43 -0
  50. package/dist/shared/chunk-j7znzkpa.js +48 -0
  51. package/dist/shared/chunk-j9kxgrnn.js +167 -0
  52. package/dist/shared/chunk-jetwnv0w.js +130 -0
  53. package/dist/shared/chunk-jjdg26c1.js +155 -0
  54. package/dist/shared/chunk-k0m4yh86.js +123 -0
  55. package/dist/shared/chunk-k43q9cjr.js +82 -0
  56. package/dist/shared/chunk-k9k8tbr5.js +119 -0
  57. package/dist/shared/chunk-meaj7br1.js +232 -0
  58. package/dist/shared/chunk-mgj0n08k.js +34 -0
  59. package/dist/shared/chunk-mjz4rp6c.js +46 -0
  60. package/dist/shared/chunk-n4rr5gme.js +239 -0
  61. package/dist/shared/chunk-nk55etpp.js +65 -0
  62. package/dist/shared/chunk-nkh1ks3k.js +264 -0
  63. package/dist/shared/chunk-pgvpvbpe.js +26 -0
  64. package/dist/shared/chunk-pma8gnv7.js +178 -0
  65. package/dist/shared/chunk-q7xv6xze.js +131 -0
  66. package/dist/shared/chunk-qey801nq.js +22 -0
  67. package/dist/shared/chunk-s6b4c3tj.js +58 -0
  68. package/dist/shared/chunk-sq27a4h0.js +36 -0
  69. package/dist/shared/chunk-taa5pj15.js +103 -0
  70. package/dist/shared/chunk-tc5rpvyx.js +127 -0
  71. package/dist/shared/chunk-tescm0b3.js +192 -0
  72. package/dist/shared/chunk-tkftdwnq.js +71 -0
  73. package/dist/shared/chunk-tqhnjcfp.js +116 -0
  74. package/dist/shared/chunk-vfknb5ht.js +183 -0
  75. package/dist/shared/chunk-vsc369w3.js +185 -0
  76. package/dist/shared/chunk-whq9s8v5.js +301 -0
  77. package/dist/shared/{chunk-hze1f32t.js → chunk-wrqddgaj.js} +1 -1
  78. package/dist/shared/chunk-yzbmkx4r.js +155 -0
  79. package/dist/shared/chunk-zaen0ajc.js +347 -0
  80. package/dist/src/accordion/accordion-composed.js +1 -1
  81. package/dist/src/accordion/accordion.js +1 -1
  82. package/dist/src/alert/alert-composed.js +1 -1
  83. package/dist/src/alert-dialog/alert-dialog-composed.js +1 -1
  84. package/dist/src/alert-dialog/alert-dialog.js +1 -1
  85. package/dist/src/avatar/avatar-composed.js +1 -1
  86. package/dist/src/badge/badge-composed.js +1 -1
  87. package/dist/src/badge/badge.js +1 -1
  88. package/dist/src/breadcrumb/breadcrumb-composed.js +1 -1
  89. package/dist/src/button/button-composed.js +1 -1
  90. package/dist/src/button/button.js +1 -1
  91. package/dist/src/calendar/calendar-composed.js +1 -1
  92. package/dist/src/calendar/calendar.js +1 -1
  93. package/dist/src/card/card-composed.js +1 -1
  94. package/dist/src/carousel/carousel-composed.js +1 -1
  95. package/dist/src/carousel/carousel.js +1 -1
  96. package/dist/src/checkbox/checkbox-composed.js +1 -1
  97. package/dist/src/checkbox/checkbox.js +1 -1
  98. package/dist/src/collapsible/collapsible-composed.js +1 -1
  99. package/dist/src/collapsible/collapsible.js +1 -1
  100. package/dist/src/combobox/combobox-composed.js +1 -1
  101. package/dist/src/combobox/combobox.js +1 -1
  102. package/dist/src/command/command-composed.js +1 -1
  103. package/dist/src/command/command.js +1 -1
  104. package/dist/src/composed/with-styles.js +1 -1
  105. package/dist/src/context-menu/context-menu-composed.js +1 -1
  106. package/dist/src/context-menu/context-menu.js +1 -1
  107. package/dist/src/date-picker/date-picker-composed.js +1 -1
  108. package/dist/src/date-picker/date-picker.js +1 -1
  109. package/dist/src/dialog/dialog-composed.js +1 -1
  110. package/dist/src/dialog/dialog-stack-parts.js +1 -1
  111. package/dist/src/dialog/dialog.js +1 -1
  112. package/dist/src/dropdown-menu/dropdown-menu-composed.js +1 -1
  113. package/dist/src/dropdown-menu/dropdown-menu.js +1 -1
  114. package/dist/src/empty-state/empty-state-composed.js +1 -1
  115. package/dist/src/form-group/form-group-composed.js +1 -1
  116. package/dist/src/hover-card/hover-card-composed.js +1 -1
  117. package/dist/src/hover-card/hover-card.js +1 -1
  118. package/dist/src/input/input-composed.js +1 -1
  119. package/dist/src/label/label-composed.js +1 -1
  120. package/dist/src/list/list-composed.js +1 -1
  121. package/dist/src/menu/menu-composed.js +1 -1
  122. package/dist/src/menu/menu.js +1 -1
  123. package/dist/src/menubar/menubar-composed.js +1 -1
  124. package/dist/src/menubar/menubar.js +1 -1
  125. package/dist/src/navigation-menu/navigation-menu-composed.js +1 -1
  126. package/dist/src/navigation-menu/navigation-menu.js +1 -1
  127. package/dist/src/pagination/pagination-composed.js +1 -1
  128. package/dist/src/popover/popover-composed.js +1 -1
  129. package/dist/src/popover/popover.js +1 -1
  130. package/dist/src/progress/progress-composed.js +1 -1
  131. package/dist/src/progress/progress.js +1 -1
  132. package/dist/src/radio/radio-composed.js +1 -1
  133. package/dist/src/radio/radio.js +1 -1
  134. package/dist/src/resizable-panel/resizable-panel-composed.js +1 -1
  135. package/dist/src/resizable-panel/resizable-panel.js +1 -1
  136. package/dist/src/scroll-area/scroll-area-composed.js +1 -1
  137. package/dist/src/scroll-area/scroll-area.js +1 -1
  138. package/dist/src/select/select-composed.js +1 -1
  139. package/dist/src/select/select.js +1 -1
  140. package/dist/src/separator/separator-composed.js +1 -1
  141. package/dist/src/sheet/sheet-composed.js +1 -1
  142. package/dist/src/sheet/sheet.js +1 -1
  143. package/dist/src/skeleton/skeleton-composed.js +1 -1
  144. package/dist/src/slider/slider-composed.js +1 -1
  145. package/dist/src/slider/slider.js +1 -1
  146. package/dist/src/switch/switch-composed.js +1 -1
  147. package/dist/src/switch/switch.js +1 -1
  148. package/dist/src/table/table-composed.js +1 -1
  149. package/dist/src/tabs/tabs-composed.js +1 -1
  150. package/dist/src/tabs/tabs.js +1 -1
  151. package/dist/src/textarea/textarea-composed.js +1 -1
  152. package/dist/src/toast/toast.js +1 -1
  153. package/dist/src/toggle/toggle-composed.js +1 -1
  154. package/dist/src/toggle/toggle.js +1 -1
  155. package/dist/src/toggle-group/toggle-group-composed.js +1 -1
  156. package/dist/src/toggle-group/toggle-group.js +1 -1
  157. package/dist/src/tooltip/tooltip-composed.js +1 -1
  158. package/dist/src/tooltip/tooltip.js +1 -1
  159. package/package.json +3 -3
  160. package/dist/shared/chunk-144kbnmx.js +0 -95
  161. package/dist/shared/chunk-1ewxfgsa.js +0 -167
  162. package/dist/shared/chunk-1hm0mbke.js +0 -258
  163. package/dist/shared/chunk-22rt6ws9.js +0 -69
  164. package/dist/shared/chunk-2ssqz188.js +0 -162
  165. package/dist/shared/chunk-33he7ay9.js +0 -218
  166. package/dist/shared/chunk-3jack97k.js +0 -509
  167. package/dist/shared/chunk-75pegjs7.js +0 -26
  168. package/dist/shared/chunk-862x7dja.js +0 -398
  169. package/dist/shared/chunk-8pk1pn5h.js +0 -215
  170. package/dist/shared/chunk-8t0nm721.js +0 -152
  171. package/dist/shared/chunk-94twh4s4.js +0 -28
  172. package/dist/shared/chunk-9yb26c0w.js +0 -232
  173. package/dist/shared/chunk-a82r2pnq.js +0 -67
  174. package/dist/shared/chunk-axpbdpgx.js +0 -177
  175. package/dist/shared/chunk-b3j6mym6.js +0 -203
  176. package/dist/shared/chunk-b4zzg457.js +0 -410
  177. package/dist/shared/chunk-b9qxfcsy.js +0 -60
  178. package/dist/shared/chunk-bc2qqkhr.js +0 -194
  179. package/dist/shared/chunk-bv12nkdm.js +0 -149
  180. package/dist/shared/chunk-bvxc1ww4.js +0 -164
  181. package/dist/shared/chunk-czv0kqj4.js +0 -107
  182. package/dist/shared/chunk-d83ag07h.js +0 -189
  183. package/dist/shared/chunk-de18ashk.js +0 -134
  184. package/dist/shared/chunk-dvk4h36t.js +0 -140
  185. package/dist/shared/chunk-dxvnerw2.js +0 -353
  186. package/dist/shared/chunk-e399pzdq.js +0 -241
  187. package/dist/shared/chunk-e4qha9as.js +0 -180
  188. package/dist/shared/chunk-eb2d9v6k.js +0 -68
  189. package/dist/shared/chunk-ect26sp5.js +0 -353
  190. package/dist/shared/chunk-ev367pq3.js +0 -102
  191. package/dist/shared/chunk-fjykbv0v.js +0 -214
  192. package/dist/shared/chunk-gdddk6nh.js +0 -96
  193. package/dist/shared/chunk-ghkw5bjq.js +0 -55
  194. package/dist/shared/chunk-hfjtkytb.js +0 -310
  195. package/dist/shared/chunk-hpvjfj0j.js +0 -31
  196. package/dist/shared/chunk-jpyjk616.js +0 -52
  197. package/dist/shared/chunk-k6d53tne.js +0 -206
  198. package/dist/shared/chunk-knzg86am.js +0 -168
  199. package/dist/shared/chunk-ktbf6xrt.js +0 -179
  200. package/dist/shared/chunk-m8y2p66x.js +0 -252
  201. package/dist/shared/chunk-metxdt5x.js +0 -28
  202. package/dist/shared/chunk-mgae1d93.js +0 -157
  203. package/dist/shared/chunk-mtx2cfbx.js +0 -175
  204. package/dist/shared/chunk-n436p5cb.js +0 -260
  205. package/dist/shared/chunk-nj420k31.js +0 -54
  206. package/dist/shared/chunk-nsmvdxgp.js +0 -213
  207. package/dist/shared/chunk-pcms04vq.js +0 -162
  208. package/dist/shared/chunk-pqskzq8t.js +0 -79
  209. package/dist/shared/chunk-pwr60kyd.js +0 -321
  210. package/dist/shared/chunk-pzknpa1y.js +0 -327
  211. package/dist/shared/chunk-q77y3rg4.js +0 -189
  212. package/dist/shared/chunk-qhnany7w.js +0 -179
  213. package/dist/shared/chunk-rdr0rtpr.js +0 -131
  214. package/dist/shared/chunk-rj52ty6r.js +0 -147
  215. package/dist/shared/chunk-rnqc7735.js +0 -125
  216. package/dist/shared/chunk-rtk30950.js +0 -202
  217. package/dist/shared/chunk-s0xgd8vg.js +0 -266
  218. package/dist/shared/chunk-s415735j.js +0 -357
  219. package/dist/shared/chunk-s62e7jf4.js +0 -30
  220. package/dist/shared/chunk-snd8e6r8.js +0 -418
  221. package/dist/shared/chunk-spng4yb9.js +0 -73
  222. package/dist/shared/chunk-t887wwjc.js +0 -168
  223. package/dist/shared/chunk-tn0m98j8.js +0 -42
  224. package/dist/shared/chunk-v0b5pkcq.js +0 -30
  225. package/dist/shared/chunk-v5tj7veh.js +0 -284
  226. package/dist/shared/chunk-vkscwzpr.js +0 -294
  227. package/dist/shared/chunk-vv187snj.js +0 -112
  228. package/dist/shared/chunk-xv4wd0kf.js +0 -293
  229. package/dist/shared/chunk-y1hpsqzy.js +0 -185
  230. package/dist/shared/chunk-yfzddvxc.js +0 -71
  231. package/dist/shared/chunk-yzgzx2dh.js +0 -311
  232. package/dist/shared/chunk-z5j7ztf2.js +0 -467
@@ -1,95 +0,0 @@
1
- import {
2
- uniqueId
3
- } from "./chunk-8y1jf6xr.js";
4
- import {
5
- setDataState
6
- } from "./chunk-vevfhpc9.js";
7
- import {
8
- applyAttrs
9
- } from "./chunk-2db2dnp3.js";
10
-
11
- // src/toast/toast.tsx
12
- import { __discardMountFrame, __element, __enterChildren, __exitChildren, __flushMountFrame, __insert, __pushMountFrame } from "@vertz/ui/internals";
13
- import { signal } from "@vertz/ui";
14
- function RegionElement(politeness) {
15
- const __mfDepth = __pushMountFrame();
16
- try {
17
- const __mfResult0 = (() => {
18
- const __el0 = __element("div");
19
- __el0.setAttribute("role", "status");
20
- {
21
- const __v = politeness;
22
- if (__v != null && __v !== false)
23
- __el0.setAttribute("aria-live", __v === true ? "" : __v);
24
- }
25
- __el0.setAttribute("aria-atomic", "false");
26
- __el0.setAttribute("data-state", "empty");
27
- return __el0;
28
- })();
29
- __flushMountFrame();
30
- return __mfResult0;
31
- } catch (__mfErr) {
32
- __discardMountFrame(__mfDepth);
33
- throw __mfErr;
34
- }
35
- }
36
- function MessageElement(id, content) {
37
- const __mfDepth = __pushMountFrame();
38
- try {
39
- const __mfResult0 = (() => {
40
- const __el0 = __element("div");
41
- __el0.setAttribute("role", "status");
42
- {
43
- const __v = id;
44
- if (__v != null && __v !== false)
45
- __el0.setAttribute("data-toast-id", __v === true ? "" : __v);
46
- }
47
- __el0.setAttribute("data-state", "open");
48
- __enterChildren(__el0);
49
- __insert(__el0, content);
50
- __exitChildren();
51
- return __el0;
52
- })();
53
- __flushMountFrame();
54
- return __mfResult0;
55
- } catch (__mfErr) {
56
- __discardMountFrame(__mfDepth);
57
- throw __mfErr;
58
- }
59
- }
60
- function ToastRoot(options = {}) {
61
- const { duration = 5000, politeness = "polite", ...attrs } = options;
62
- const state = { messages: signal([]) };
63
- const region = RegionElement(politeness);
64
- applyAttrs(region, attrs);
65
- function announce(content) {
66
- const id = uniqueId("toast");
67
- const el = MessageElement(id, content);
68
- const msg = { id, content, el };
69
- state.messages.value = [...state.messages.peek(), msg];
70
- region.appendChild(el);
71
- setDataState(region, "active");
72
- if (duration > 0) {
73
- setTimeout(() => dismiss(id), duration);
74
- }
75
- return msg;
76
- }
77
- function dismiss(id) {
78
- const messages = state.messages.peek().filter((m) => m.id !== id);
79
- state.messages.value = messages;
80
- const el = region.querySelector(`[data-toast-id="${id}"]`);
81
- if (el) {
82
- setDataState(el, "closed");
83
- el.remove();
84
- }
85
- if (messages.length === 0) {
86
- setDataState(region, "empty");
87
- }
88
- }
89
- return { region, state, announce, dismiss };
90
- }
91
- var Toast = {
92
- Root: ToastRoot
93
- };
94
-
95
- export { Toast };
@@ -1,167 +0,0 @@
1
- import {
2
- createFloatingPosition
3
- } from "./chunk-vef3sepw.js";
4
- import {
5
- uniqueId
6
- } from "./chunk-8y1jf6xr.js";
7
- import {
8
- Keys,
9
- isKey
10
- } from "./chunk-7867pr13.js";
11
- import {
12
- setDataState,
13
- setExpanded,
14
- setHidden,
15
- setHiddenAnimated
16
- } from "./chunk-vevfhpc9.js";
17
- import {
18
- applyAttrs
19
- } from "./chunk-2db2dnp3.js";
20
-
21
- // src/hover-card/hover-card.tsx
22
- import { __discardMountFrame, __element, __flushMountFrame, __on, __pushMountFrame, __styleStr } from "@vertz/ui/internals";
23
- import { signal } from "@vertz/ui";
24
- function HoverCardRoot(options = {}) {
25
- const __mfDepth = __pushMountFrame();
26
- try {
27
- let cancelTimers = function() {
28
- if (openTimeout) {
29
- clearTimeout(openTimeout);
30
- openTimeout = null;
31
- }
32
- if (closeTimeout) {
33
- clearTimeout(closeTimeout);
34
- closeTimeout = null;
35
- }
36
- }, cancelCloseTimer = function() {
37
- if (closeTimeout) {
38
- clearTimeout(closeTimeout);
39
- closeTimeout = null;
40
- }
41
- }, positionContent = function() {
42
- if (positioning) {
43
- floatingCleanup?.();
44
- const effectivePlacement = positioning.placement ?? "bottom";
45
- const result = createFloatingPosition(trigger, content, {
46
- ...positioning,
47
- placement: effectivePlacement
48
- });
49
- floatingCleanup = result.cleanup;
50
- }
51
- }, show = function() {
52
- cancelTimers();
53
- if (state.open.peek())
54
- return;
55
- openTimeout = setTimeout(() => {
56
- state.open.value = true;
57
- setExpanded(trigger, true);
58
- setHidden(content, false);
59
- setDataState(content, "open");
60
- positionContent();
61
- onOpenChange?.(true);
62
- openTimeout = null;
63
- }, openDelay);
64
- }, showImmediate = function() {
65
- cancelTimers();
66
- state.open.value = true;
67
- setExpanded(trigger, true);
68
- setHidden(content, false);
69
- setDataState(content, "open");
70
- positionContent();
71
- onOpenChange?.(true);
72
- }, hide = function() {
73
- cancelTimers();
74
- if (!state.open.peek())
75
- return;
76
- closeTimeout = setTimeout(() => {
77
- state.open.value = false;
78
- setExpanded(trigger, false);
79
- setDataState(content, "closed");
80
- setHiddenAnimated(content, true);
81
- floatingCleanup?.();
82
- floatingCleanup = null;
83
- onOpenChange?.(false);
84
- closeTimeout = null;
85
- }, closeDelay);
86
- }, hideImmediate = function() {
87
- cancelTimers();
88
- state.open.value = false;
89
- setExpanded(trigger, false);
90
- setDataState(content, "closed");
91
- setHiddenAnimated(content, true);
92
- floatingCleanup?.();
93
- floatingCleanup = null;
94
- onOpenChange?.(false);
95
- }, handleTriggerBlur = function(event) {
96
- const related = event.relatedTarget;
97
- if (related && (trigger.contains(related) || content.contains(related)))
98
- return;
99
- hide();
100
- }, handleTriggerKeydown = function(event) {
101
- if (isKey(event, Keys.Escape) && state.open.peek()) {
102
- hideImmediate();
103
- }
104
- }, handleContentFocusout = function(event) {
105
- const related = event.relatedTarget;
106
- if (related && (trigger.contains(related) || content.contains(related)))
107
- return;
108
- hide();
109
- }, handleContentKeydown = function(event) {
110
- if (isKey(event, Keys.Escape)) {
111
- hideImmediate();
112
- trigger.focus();
113
- }
114
- };
115
- const { openDelay = 700, closeDelay = 300, onOpenChange, positioning, ...attrs } = options;
116
- const contentId = uniqueId("hovercard");
117
- const state = { open: signal(false) };
118
- let openTimeout = null;
119
- let closeTimeout = null;
120
- let floatingCleanup = null;
121
- const trigger = (() => {
122
- const __el0 = __element("span");
123
- __el0.setAttribute("aria-haspopup", "dialog");
124
- __el0.setAttribute("aria-expanded", "false");
125
- __on(__el0, "mouseenter", show);
126
- __on(__el0, "mouseleave", hide);
127
- __on(__el0, "focus", showImmediate);
128
- __on(__el0, "blur", handleTriggerBlur);
129
- __on(__el0, "keydown", handleTriggerKeydown);
130
- return __el0;
131
- })();
132
- const content = (() => {
133
- const __el1 = __element("div");
134
- __el1.setAttribute("role", "dialog");
135
- {
136
- const __v = contentId;
137
- if (__v != null && __v !== false)
138
- __el1.setAttribute("id", __v === true ? "" : __v);
139
- }
140
- __el1.setAttribute("aria-hidden", "true");
141
- __el1.setAttribute("data-state", "closed");
142
- {
143
- const __v = { display: "none" };
144
- if (__v != null && __v !== false)
145
- __el1.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
146
- }
147
- __on(__el1, "mouseenter", cancelCloseTimer);
148
- __on(__el1, "mouseleave", hide);
149
- __on(__el1, "focusin", cancelCloseTimer);
150
- __on(__el1, "focusout", handleContentFocusout);
151
- __on(__el1, "keydown", handleContentKeydown);
152
- return __el1;
153
- })();
154
- applyAttrs(trigger, attrs);
155
- const __mfResult0 = { trigger, content, state };
156
- __flushMountFrame();
157
- return __mfResult0;
158
- } catch (__mfErr) {
159
- __discardMountFrame(__mfDepth);
160
- throw __mfErr;
161
- }
162
- }
163
- var HoverCard = {
164
- Root: HoverCardRoot
165
- };
166
-
167
- export { HoverCard };
@@ -1,258 +0,0 @@
1
- import {
2
- cn
3
- } from "./chunk-q7xbcj9q.js";
4
-
5
- // src/resizable-panel/resizable-panel-composed.tsx
6
- import { computed, signal } from "@vertz/ui";
7
- import { __append, __attr, __child, __discardMountFrame, __element, __enterChildren, __exitChildren, __flushMountFrame, __on, __pushMountFrame, __styleStr } from "@vertz/ui/internals";
8
- import { createContext, useContext } from "@vertz/ui";
9
- var _groupCounter = { value: 0 };
10
- var ResizablePanelContext = createContext(undefined, "@vertz/ui-primitives::ResizablePanelContext");
11
- function ResizablePanelPanel(__props) {
12
- const __mfDepth = __pushMountFrame();
13
- try {
14
- const ctx = useContext(ResizablePanelContext);
15
- if (!ctx) {
16
- throw new Error("<ResizablePanel.Panel> must be used inside <ResizablePanel>. " + "Ensure it is a direct or nested child of the ResizablePanel root component.");
17
- }
18
- const index = computed(() => ctx.registerPanel({ defaultSize: __props.defaultSize, minSize: __props.minSize, maxSize: __props.maxSize }));
19
- const __mfResult0 = (() => {
20
- const __el0 = __element("div");
21
- __el0.setAttribute("data-part", "panel");
22
- __attr(__el0, "data-group", () => ctx.groupId);
23
- __attr(__el0, "style", () => ({ flex: `${ctx.getSizeForPanel(index.value)} 1 0`, minWidth: 0, minHeight: 0 }));
24
- __attr(__el0, "class", () => cn(ctx.classes?.panel, __props.className ?? __props.class));
25
- __enterChildren(__el0);
26
- __append(__el0, __child(() => __props.children));
27
- __exitChildren();
28
- return __el0;
29
- })();
30
- __flushMountFrame();
31
- return __mfResult0;
32
- } catch (__mfErr) {
33
- __discardMountFrame(__mfDepth);
34
- throw __mfErr;
35
- }
36
- }
37
- function ResizablePanelHandle(__props) {
38
- const __mfDepth = __pushMountFrame();
39
- try {
40
- const ctx = useContext(ResizablePanelContext);
41
- if (!ctx) {
42
- throw new Error("<ResizablePanel.Handle> must be used inside <ResizablePanel>. " + "Ensure it is a direct or nested child of the ResizablePanel root component.");
43
- }
44
- const handleIndex = computed(() => ctx.registerHandle());
45
- const __mfResult0 = (() => {
46
- const __el0 = __element("div");
47
- __el0.setAttribute("role", "separator");
48
- __el0.setAttribute("tabindex", "0");
49
- {
50
- const __v = { flexShrink: 0 };
51
- if (__v != null && __v !== false)
52
- __el0.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
53
- }
54
- __attr(__el0, "data-group", () => ctx.groupId);
55
- __attr(__el0, "data-handle-index", () => String(handleIndex.value));
56
- __attr(__el0, "data-orientation", () => ctx.orientation);
57
- __el0.setAttribute("data-state", "idle");
58
- __attr(__el0, "aria-valuenow", () => String(ctx.getAriaForHandle(handleIndex.value).valuenow));
59
- __attr(__el0, "aria-valuemin", () => String(ctx.getAriaForHandle(handleIndex.value).valuemin));
60
- __attr(__el0, "aria-valuemax", () => String(ctx.getAriaForHandle(handleIndex.value).valuemax));
61
- __attr(__el0, "class", () => cn(ctx.classes?.handle, __props.className ?? __props.class));
62
- return __el0;
63
- })();
64
- __flushMountFrame();
65
- return __mfResult0;
66
- } catch (__mfErr) {
67
- __discardMountFrame(__mfDepth);
68
- throw __mfErr;
69
- }
70
- }
71
- function ComposedResizablePanelRoot(__props) {
72
- const __mfDepth = __pushMountFrame();
73
- try {
74
- let recomputeSizes = function() {
75
- const configs = _reg.panelConfigs;
76
- const panelCount = configs.length;
77
- if (panelCount === 0)
78
- return;
79
- const newSizes = new Array(panelCount).fill(0);
80
- const explicitIndices = new Set;
81
- for (let i = 0;i < panelCount; i++) {
82
- const config = configs[i];
83
- if (config && config.defaultSize != null) {
84
- newSizes[i] = config.defaultSize;
85
- explicitIndices.add(i);
86
- }
87
- }
88
- if (explicitIndices.size === 0) {
89
- const equal = 100 / panelCount;
90
- for (let i = 0;i < panelCount; i++)
91
- newSizes[i] = equal;
92
- } else {
93
- const used = [...explicitIndices].reduce((sum, i) => sum + (newSizes[i] ?? 0), 0);
94
- const unsetCount = panelCount - explicitIndices.size;
95
- const each = unsetCount > 0 ? (100 - used) / unsetCount : 0;
96
- for (let i = 0;i < newSizes.length; i++) {
97
- if (!explicitIndices.has(i))
98
- newSizes[i] = each;
99
- }
100
- }
101
- sizes.value = newSizes;
102
- }, registerPanel = function(opts) {
103
- const idx = _reg.nextPanelIdx++;
104
- _reg.panelConfigs.push({
105
- defaultSize: opts.defaultSize,
106
- minSize: opts.minSize ?? 0,
107
- maxSize: opts.maxSize ?? 100
108
- });
109
- recomputeSizes();
110
- return idx;
111
- }, registerHandle = function() {
112
- return _reg.nextHandleIdx++;
113
- }, getSizeForPanel = function(index) {
114
- return sizes.value[index] ?? 0;
115
- }, getAriaForHandle = function(handleIndex) {
116
- const config = _reg.panelConfigs[handleIndex];
117
- return {
118
- valuenow: Math.round(sizes.value[handleIndex] ?? 0),
119
- valuemin: Math.round(config?.minSize ?? 0),
120
- valuemax: Math.round(config?.maxSize ?? 100)
121
- };
122
- }, updateSizes = function(newSizes) {
123
- sizes.value = [...newSizes];
124
- __props.onResize?.(newSizes);
125
- }, handleKeydown = function(e) {
126
- const ke = e;
127
- const target = ke.target;
128
- if (target.getAttribute("role") !== "separator")
129
- return;
130
- if (target.dataset.group !== groupId)
131
- return;
132
- const handleIndex = Number(target.dataset.handleIndex ?? -1);
133
- if (handleIndex < 0)
134
- return;
135
- const leftIdx = handleIndex;
136
- const rightIdx = handleIndex + 1;
137
- const leftConfig = _reg.panelConfigs[leftIdx];
138
- const rightConfig = _reg.panelConfigs[rightIdx];
139
- if (!leftConfig || !rightConfig)
140
- return;
141
- const leftStart = sizes.value[leftIdx] ?? 0;
142
- const rightStart = sizes.value[rightIdx] ?? 0;
143
- const STEP = 5;
144
- const growKey = (__props.orientation ?? "horizontal") === "horizontal" ? "ArrowRight" : "ArrowDown";
145
- const shrinkKey = (__props.orientation ?? "horizontal") === "horizontal" ? "ArrowLeft" : "ArrowUp";
146
- let newLeft = leftStart;
147
- let newRight = rightStart;
148
- if (ke.key === growKey) {
149
- ke.preventDefault();
150
- const delta = Math.min(STEP, rightStart - rightConfig.minSize, leftConfig.maxSize - leftStart);
151
- newLeft += delta;
152
- newRight -= delta;
153
- } else if (ke.key === shrinkKey) {
154
- ke.preventDefault();
155
- const delta = Math.min(STEP, leftStart - leftConfig.minSize, rightConfig.maxSize - rightStart);
156
- newLeft -= delta;
157
- newRight += delta;
158
- } else if (ke.key === "Home") {
159
- ke.preventDefault();
160
- const delta = leftStart - leftConfig.minSize;
161
- newLeft -= delta;
162
- newRight += delta;
163
- } else if (ke.key === "End") {
164
- ke.preventDefault();
165
- const delta = rightStart - rightConfig.minSize;
166
- newLeft += delta;
167
- newRight -= delta;
168
- } else {
169
- return;
170
- }
171
- const newSizes = sizes.value.slice();
172
- newSizes[leftIdx] = newLeft;
173
- newSizes[rightIdx] = newRight;
174
- updateSizes(newSizes);
175
- }, handlePointerdown = function(e) {
176
- const pe = e;
177
- const target = pe.target;
178
- if (target.getAttribute("role") !== "separator")
179
- return;
180
- if (target.dataset.group !== groupId)
181
- return;
182
- pe.preventDefault();
183
- target.setPointerCapture(pe.pointerId);
184
- target.setAttribute("data-state", "dragging");
185
- const handleIndex = Number(target.dataset.handleIndex ?? -1);
186
- const rootEl = pe.currentTarget;
187
- const startPos = (__props.orientation ?? "horizontal") === "horizontal" ? pe.clientX : pe.clientY;
188
- const rootSize = (__props.orientation ?? "horizontal") === "horizontal" ? rootEl.offsetWidth : rootEl.offsetHeight;
189
- const startSizes = sizes.value.slice();
190
- function onMove(ev) {
191
- const currentPos = (__props.orientation ?? "horizontal") === "horizontal" ? ev.clientX : ev.clientY;
192
- const delta = (currentPos - startPos) / rootSize * 100;
193
- const moveSizes = startSizes.slice();
194
- const leftIdx = handleIndex;
195
- const rightIdx = handleIndex + 1;
196
- const leftConfig = _reg.panelConfigs[leftIdx];
197
- const rightConfig = _reg.panelConfigs[rightIdx];
198
- if (!leftConfig || !rightConfig)
199
- return;
200
- const rawLeft = Math.max(leftConfig.minSize, Math.min(leftConfig.maxSize, (startSizes[leftIdx] ?? 0) + delta));
201
- const rawRight = Math.max(rightConfig.minSize, Math.min(rightConfig.maxSize, (startSizes[rightIdx] ?? 0) - delta));
202
- moveSizes[leftIdx] = rawLeft;
203
- moveSizes[rightIdx] = rawRight;
204
- updateSizes(moveSizes);
205
- }
206
- function onUp(ev) {
207
- target.releasePointerCapture(ev.pointerId);
208
- target.setAttribute("data-state", "idle");
209
- target.removeEventListener("pointermove", onMove);
210
- target.removeEventListener("pointerup", onUp);
211
- }
212
- target.addEventListener("pointermove", onMove);
213
- target.addEventListener("pointerup", onUp);
214
- };
215
- const groupId = String(_groupCounter.value++);
216
- const _reg = {
217
- nextPanelIdx: 0,
218
- nextHandleIdx: 0,
219
- panelConfigs: []
220
- };
221
- const sizes = signal([], "sizes");
222
- const ctx = {
223
- groupId,
224
- orientation: __props.orientation ?? "horizontal",
225
- classes: __props.classes,
226
- registerPanel,
227
- registerHandle,
228
- getSizeForPanel,
229
- getAriaForHandle
230
- };
231
- const __mfResult0 = ResizablePanelContext.Provider({ get value() {
232
- return ctx;
233
- }, children: () => (() => {
234
- const __el0 = __element("div");
235
- __attr(__el0, "style", () => ({ display: "flex", flexDirection: (__props.orientation ?? "horizontal") === "horizontal" ? "row" : "column" }));
236
- __attr(__el0, "data-orientation", () => __props.orientation ?? "horizontal");
237
- __attr(__el0, "data-panel-count", () => sizes.value.length);
238
- __attr(__el0, "class", () => __props.classes?.root);
239
- __on(__el0, "keydown", handleKeydown);
240
- __on(__el0, "pointerdown", handlePointerdown);
241
- __enterChildren(__el0);
242
- __append(__el0, __child(() => __props.children));
243
- __exitChildren();
244
- return __el0;
245
- })() });
246
- __flushMountFrame();
247
- return __mfResult0;
248
- } catch (__mfErr) {
249
- __discardMountFrame(__mfDepth);
250
- throw __mfErr;
251
- }
252
- }
253
- var ComposedResizablePanel = Object.assign(ComposedResizablePanelRoot, {
254
- Panel: ResizablePanelPanel,
255
- Handle: ResizablePanelHandle
256
- });
257
-
258
- export { ComposedResizablePanel };
@@ -1,69 +0,0 @@
1
- import {
2
- uniqueId
3
- } from "./chunk-8y1jf6xr.js";
4
- import {
5
- Keys,
6
- isKey
7
- } from "./chunk-7867pr13.js";
8
- import {
9
- applyAttrs
10
- } from "./chunk-2db2dnp3.js";
11
-
12
- // src/switch/switch.tsx
13
- import { computed, signal } from "@vertz/ui";
14
- import { __attr, __discardMountFrame, __element, __flushMountFrame, __on, __pushMountFrame } from "@vertz/ui/internals";
15
- function SwitchRoot(options = {}) {
16
- const __mfDepth = __pushMountFrame();
17
- try {
18
- let toggle = function() {
19
- if (disabled)
20
- return;
21
- checked.value = !checked.value;
22
- onCheckedChange?.(checked.value);
23
- };
24
- const { defaultChecked = false, disabled = false, onCheckedChange, ...attrs } = options;
25
- const checked = signal(defaultChecked, "checked");
26
- const el = computed(() => (() => {
27
- const __el0 = __element("button");
28
- __el0.setAttribute("type", "button");
29
- __el0.setAttribute("role", "switch");
30
- {
31
- const __v = uniqueId("switch");
32
- if (__v != null && __v !== false)
33
- __el0.setAttribute("id", __v === true ? "" : __v);
34
- }
35
- __attr(__el0, "aria-checked", () => checked.value ? "true" : "false");
36
- __attr(__el0, "data-state", () => checked.value ? "checked" : "unchecked");
37
- {
38
- const __v = disabled;
39
- if (__v != null && __v !== false)
40
- __el0.setAttribute("disabled", __v === true ? "" : __v);
41
- }
42
- {
43
- const __v = disabled ? "true" : undefined;
44
- if (__v != null && __v !== false)
45
- __el0.setAttribute("aria-disabled", __v === true ? "" : __v);
46
- }
47
- __on(__el0, "click", toggle);
48
- __on(__el0, "keydown", (e) => {
49
- if (isKey(e, Keys.Space)) {
50
- e.preventDefault();
51
- toggle();
52
- }
53
- });
54
- return __el0;
55
- })());
56
- applyAttrs(el.value, attrs);
57
- const __mfResult0 = el.value;
58
- __flushMountFrame();
59
- return __mfResult0;
60
- } catch (__mfErr) {
61
- __discardMountFrame(__mfDepth);
62
- throw __mfErr;
63
- }
64
- }
65
- var Switch = {
66
- Root: SwitchRoot
67
- };
68
-
69
- export { Switch };