@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,194 +0,0 @@
1
- import {
2
- cn
3
- } from "./chunk-q7xbcj9q.js";
4
-
5
- // src/pagination/pagination-composed.tsx
6
- import { computed } from "@vertz/ui";
7
- import { __append, __attr, __child, __discardMountFrame, __element, __enterChildren, __exitChildren, __flushMountFrame, __insert, __on, __pushMountFrame, __styleStr } from "@vertz/ui/internals";
8
- function generatePaginationRange(current, total, siblings) {
9
- const range = [];
10
- const left = Math.max(2, current - siblings);
11
- const right = Math.min(total - 1, current + siblings);
12
- range.push(1);
13
- if (left > 2) {
14
- range.push("...");
15
- }
16
- for (let idx = left;idx <= right; idx++) {
17
- if (idx !== 1 && idx !== total) {
18
- range.push(idx);
19
- }
20
- }
21
- if (right < total - 1) {
22
- range.push("...");
23
- }
24
- if (total > 1) {
25
- range.push(total);
26
- }
27
- return range;
28
- }
29
- function PageButton(__props) {
30
- const __mfDepth = __pushMountFrame();
31
- try {
32
- if (__props.page === __props.currentPage) {
33
- const __mfResult0 = (() => {
34
- const __el0 = __element("button");
35
- __el0.setAttribute("type", "button");
36
- __attr(__el0, "class", () => cn(__props.classes?.linkActive));
37
- __el0.setAttribute("aria-current", "page");
38
- __enterChildren(__el0);
39
- __append(__el0, __child(() => String(__props.page)));
40
- __exitChildren();
41
- return __el0;
42
- })();
43
- __flushMountFrame();
44
- return __mfResult0;
45
- }
46
- const __mfResult1 = (() => {
47
- const __el1 = __element("button");
48
- __el1.setAttribute("type", "button");
49
- __attr(__el1, "class", () => cn(__props.classes?.link));
50
- __on(__el1, "click", () => __props.onPageChange(__props.page));
51
- __enterChildren(__el1);
52
- __append(__el1, __child(() => String(__props.page)));
53
- __exitChildren();
54
- return __el1;
55
- })();
56
- __flushMountFrame();
57
- return __mfResult1;
58
- } catch (__mfErr) {
59
- __discardMountFrame(__mfDepth);
60
- throw __mfErr;
61
- }
62
- }
63
- function buildPageItems(range, classes, currentPage, onPageChange, ellipsisContent) {
64
- const __mfDepth = __pushMountFrame();
65
- try {
66
- const __mfResult0 = range.map((page) => page === "..." ? (() => {
67
- const __el0 = __element("li");
68
- {
69
- const __v = cn(classes?.item);
70
- if (__v != null && __v !== false)
71
- __el0.setAttribute("class", __v === true ? "" : __v);
72
- }
73
- __enterChildren(__el0);
74
- __append(__el0, (() => {
75
- const __el1 = __element("span");
76
- __el1.setAttribute("aria-hidden", "true");
77
- {
78
- const __v = cn(classes?.ellipsis);
79
- if (__v != null && __v !== false)
80
- __el1.setAttribute("class", __v === true ? "" : __v);
81
- }
82
- __enterChildren(__el1);
83
- __insert(__el1, ellipsisContent);
84
- __exitChildren();
85
- return __el1;
86
- })());
87
- __exitChildren();
88
- return __el0;
89
- })() : (() => {
90
- const __el2 = __element("li");
91
- {
92
- const __v = cn(classes?.item);
93
- if (__v != null && __v !== false)
94
- __el2.setAttribute("class", __v === true ? "" : __v);
95
- }
96
- __enterChildren(__el2);
97
- __append(__el2, PageButton({ get page() {
98
- return page;
99
- }, get currentPage() {
100
- return currentPage;
101
- }, get onPageChange() {
102
- return onPageChange;
103
- }, get classes() {
104
- return classes;
105
- } }));
106
- __exitChildren();
107
- return __el2;
108
- })());
109
- __flushMountFrame();
110
- return __mfResult0;
111
- } catch (__mfErr) {
112
- __discardMountFrame(__mfDepth);
113
- throw __mfErr;
114
- }
115
- }
116
- function ComposedPaginationRoot(__props) {
117
- const __mfDepth = __pushMountFrame();
118
- try {
119
- const range = computed(() => generatePaginationRange(__props.currentPage, __props.totalPages, __props.siblingCount ?? 1));
120
- const pageItems = () => buildPageItems(range.value, __props.classes, __props.currentPage, __props.onPageChange, __props.ellipsisContent ?? "...");
121
- const __mfResult0 = (() => {
122
- const __el0 = __element("nav");
123
- __el0.setAttribute("aria-label", "Pagination");
124
- __attr(__el0, "class", () => cn(__props.classes?.nav, __props.className ?? __props.class));
125
- __enterChildren(__el0);
126
- __append(__el0, (() => {
127
- const __el1 = __element("ul");
128
- __attr(__el1, "class", () => cn(__props.classes?.list));
129
- __enterChildren(__el1);
130
- __append(__el1, (() => {
131
- const __el2 = __element("li");
132
- __attr(__el2, "class", () => cn(__props.classes?.item));
133
- __enterChildren(__el2);
134
- __append(__el2, (() => {
135
- const __el3 = __element("button");
136
- __el3.setAttribute("type", "button");
137
- __attr(__el3, "class", () => cn(__props.classes?.navButton));
138
- {
139
- const __v = { paddingLeft: "0.375rem", paddingRight: "0.625rem" };
140
- if (__v != null && __v !== false)
141
- __el3.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
142
- }
143
- __el3.setAttribute("aria-label", "Previous page");
144
- __attr(__el3, "disabled", () => __props.currentPage <= 1);
145
- __on(__el3, "click", () => __props.onPageChange(__props.currentPage - 1));
146
- __enterChildren(__el3);
147
- __append(__el3, __child(() => __props.prevContent ?? "Previous"));
148
- __exitChildren();
149
- return __el3;
150
- })());
151
- __exitChildren();
152
- return __el2;
153
- })());
154
- __insert(__el1, pageItems);
155
- __append(__el1, (() => {
156
- const __el4 = __element("li");
157
- __attr(__el4, "class", () => cn(__props.classes?.item));
158
- __enterChildren(__el4);
159
- __append(__el4, (() => {
160
- const __el5 = __element("button");
161
- __el5.setAttribute("type", "button");
162
- __attr(__el5, "class", () => cn(__props.classes?.navButton));
163
- {
164
- const __v = { paddingLeft: "0.625rem", paddingRight: "0.375rem" };
165
- if (__v != null && __v !== false)
166
- __el5.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
167
- }
168
- __el5.setAttribute("aria-label", "Next page");
169
- __attr(__el5, "disabled", () => __props.currentPage >= __props.totalPages);
170
- __on(__el5, "click", () => __props.onPageChange(__props.currentPage + 1));
171
- __enterChildren(__el5);
172
- __append(__el5, __child(() => __props.nextContent ?? "Next"));
173
- __exitChildren();
174
- return __el5;
175
- })());
176
- __exitChildren();
177
- return __el4;
178
- })());
179
- __exitChildren();
180
- return __el1;
181
- })());
182
- __exitChildren();
183
- return __el0;
184
- })();
185
- __flushMountFrame();
186
- return __mfResult0;
187
- } catch (__mfErr) {
188
- __discardMountFrame(__mfDepth);
189
- throw __mfErr;
190
- }
191
- }
192
- var ComposedPagination = ComposedPaginationRoot;
193
-
194
- export { ComposedPagination };
@@ -1,149 +0,0 @@
1
- import {
2
- createDismiss
3
- } from "./chunk-a6wp8c32.js";
4
- import {
5
- createFloatingPosition
6
- } from "./chunk-vef3sepw.js";
7
- import {
8
- focusFirst,
9
- saveFocus
10
- } from "./chunk-e2v1c9ex.js";
11
- import {
12
- linkedIds
13
- } from "./chunk-8y1jf6xr.js";
14
- import {
15
- Keys,
16
- isKey
17
- } from "./chunk-7867pr13.js";
18
- import {
19
- setDataState,
20
- setExpanded,
21
- setHidden,
22
- setHiddenAnimated
23
- } from "./chunk-vevfhpc9.js";
24
- import {
25
- applyAttrs
26
- } from "./chunk-2db2dnp3.js";
27
-
28
- // src/popover/popover.tsx
29
- import { __discardMountFrame, __element, __flushMountFrame, __on, __pushMountFrame, __styleStr } from "@vertz/ui/internals";
30
- import { signal } from "@vertz/ui";
31
- function PopoverRoot(options = {}) {
32
- const __mfDepth = __pushMountFrame();
33
- try {
34
- let open = function() {
35
- state.open.value = true;
36
- setExpanded(trigger, true);
37
- setHidden(content, false);
38
- setDataState(trigger, "open");
39
- setDataState(content, "open");
40
- restoreFocus = saveFocus();
41
- queueMicrotask(() => focusFirst(content));
42
- if (positioning) {
43
- const result = createFloatingPosition(trigger, content, positioning);
44
- floatingCleanup = result.cleanup;
45
- dismissCleanup = createDismiss({
46
- onDismiss: close,
47
- insideElements: [trigger, content],
48
- escapeKey: false
49
- });
50
- }
51
- onOpenChange?.(true);
52
- }, close = function() {
53
- state.open.value = false;
54
- setExpanded(trigger, false);
55
- setDataState(trigger, "closed");
56
- setDataState(content, "closed");
57
- setHiddenAnimated(content, true);
58
- floatingCleanup?.();
59
- floatingCleanup = null;
60
- dismissCleanup?.();
61
- dismissCleanup = null;
62
- restoreFocus?.();
63
- restoreFocus = null;
64
- onOpenChange?.(false);
65
- };
66
- const { defaultOpen = false, onOpenChange, positioning, ...attrs } = options;
67
- const ids = linkedIds("popover");
68
- const state = { open: signal(defaultOpen) };
69
- let restoreFocus = null;
70
- let floatingCleanup = null;
71
- let dismissCleanup = null;
72
- const trigger = (() => {
73
- const __el0 = __element("button");
74
- __el0.setAttribute("type", "button");
75
- {
76
- const __v = ids.triggerId;
77
- if (__v != null && __v !== false)
78
- __el0.setAttribute("id", __v === true ? "" : __v);
79
- }
80
- {
81
- const __v = ids.contentId;
82
- if (__v != null && __v !== false)
83
- __el0.setAttribute("aria-controls", __v === true ? "" : __v);
84
- }
85
- __el0.setAttribute("aria-haspopup", "dialog");
86
- {
87
- const __v = defaultOpen ? "true" : "false";
88
- if (__v != null && __v !== false)
89
- __el0.setAttribute("aria-expanded", __v === true ? "" : __v);
90
- }
91
- {
92
- const __v = defaultOpen ? "open" : "closed";
93
- if (__v != null && __v !== false)
94
- __el0.setAttribute("data-state", __v === true ? "" : __v);
95
- }
96
- __on(__el0, "click", () => {
97
- if (state.open.peek()) {
98
- close();
99
- } else {
100
- open();
101
- }
102
- });
103
- return __el0;
104
- })();
105
- const content = (() => {
106
- const __el1 = __element("div");
107
- __el1.setAttribute("role", "dialog");
108
- {
109
- const __v = ids.contentId;
110
- if (__v != null && __v !== false)
111
- __el1.setAttribute("id", __v === true ? "" : __v);
112
- }
113
- {
114
- const __v = defaultOpen ? "false" : "true";
115
- if (__v != null && __v !== false)
116
- __el1.setAttribute("aria-hidden", __v === true ? "" : __v);
117
- }
118
- {
119
- const __v = defaultOpen ? "open" : "closed";
120
- if (__v != null && __v !== false)
121
- __el1.setAttribute("data-state", __v === true ? "" : __v);
122
- }
123
- {
124
- const __v = { display: defaultOpen ? "" : "none" };
125
- if (__v != null && __v !== false)
126
- __el1.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
127
- }
128
- __on(__el1, "keydown", (event) => {
129
- if (isKey(event, Keys.Escape)) {
130
- event.preventDefault();
131
- close();
132
- }
133
- });
134
- return __el1;
135
- })();
136
- applyAttrs(trigger, attrs);
137
- const __mfResult0 = { trigger, content, state };
138
- __flushMountFrame();
139
- return __mfResult0;
140
- } catch (__mfErr) {
141
- __discardMountFrame(__mfDepth);
142
- throw __mfErr;
143
- }
144
- }
145
- var Popover = {
146
- Root: PopoverRoot
147
- };
148
-
149
- export { Popover };
@@ -1,164 +0,0 @@
1
- import {
2
- cn
3
- } from "./chunk-q7xbcj9q.js";
4
- import {
5
- uniqueId
6
- } from "./chunk-8y1jf6xr.js";
7
- import {
8
- Keys,
9
- isKey
10
- } from "./chunk-7867pr13.js";
11
-
12
- // src/toggle-group/toggle-group-composed.tsx
13
- import { computed, signal } from "@vertz/ui";
14
- import { __append, __attr, __child, __discardMountFrame, __element, __enterChildren, __exitChildren, __flushMountFrame, __on, __pushMountFrame } from "@vertz/ui/internals";
15
- import { createContext, useContext } from "@vertz/ui";
16
- var ToggleGroupContext = createContext(undefined, "@vertz/ui-primitives::ToggleGroupContext");
17
- function useToggleGroupContext(componentName) {
18
- const ctx = useContext(ToggleGroupContext);
19
- if (!ctx) {
20
- throw new Error(`<ToggleGroup.${componentName}> must be used inside <ToggleGroup>. ` + "Ensure it is a direct or nested child of the ToggleGroup root component.");
21
- }
22
- return ctx;
23
- }
24
- function ToggleGroupItem(__props) {
25
- const __mfDepth = __pushMountFrame();
26
- try {
27
- const ctx = useToggleGroupContext("Item");
28
- const isOn = computed(() => ctx.selectedValues.includes(__props.value));
29
- const isFirst = ctx.claimFirstItem();
30
- const __mfResult0 = (() => {
31
- const __el0 = __element("button");
32
- __el0.setAttribute("type", "button");
33
- __el0.setAttribute("data-togglegroup-item", "");
34
- __attr(__el0, "data-value", () => __props.value);
35
- __attr(__el0, "aria-pressed", () => isOn.value ? "true" : "false");
36
- __attr(__el0, "data-state", () => isOn.value ? "on" : "off");
37
- {
38
- const __v = ctx.disabled;
39
- if (__v != null && __v !== false)
40
- __el0.setAttribute("disabled", __v === true ? "" : __v);
41
- }
42
- {
43
- const __v = ctx.disabled ? "true" : undefined;
44
- if (__v != null && __v !== false)
45
- __el0.setAttribute("aria-disabled", __v === true ? "" : __v);
46
- }
47
- {
48
- const __v = isFirst ? "0" : "-1";
49
- if (__v != null && __v !== false)
50
- __el0.setAttribute("tabindex", __v === true ? "" : __v);
51
- }
52
- {
53
- const __v = cn(ctx.classes?.item);
54
- if (__v != null && __v !== false)
55
- __el0.setAttribute("class", __v === true ? "" : __v);
56
- }
57
- __on(__el0, "click", () => ctx.toggle(__props.value));
58
- __enterChildren(__el0);
59
- __append(__el0, __child(() => __props.children));
60
- __exitChildren();
61
- return __el0;
62
- })();
63
- __flushMountFrame();
64
- return __mfResult0;
65
- } catch (__mfErr) {
66
- __discardMountFrame(__mfDepth);
67
- throw __mfErr;
68
- }
69
- }
70
- function ComposedToggleGroupRoot(__props) {
71
- const __mfDepth = __pushMountFrame();
72
- try {
73
- let toggle = function(itemValue) {
74
- if (__props.disabled ?? false)
75
- return;
76
- const current = [...selectedValues.value];
77
- const idx = current.indexOf(itemValue);
78
- if ((__props.type ?? "single") === "single") {
79
- if (idx >= 0) {
80
- current.length = 0;
81
- } else {
82
- current.length = 0;
83
- current.push(itemValue);
84
- }
85
- } else {
86
- if (idx >= 0) {
87
- current.splice(idx, 1);
88
- } else {
89
- current.push(itemValue);
90
- }
91
- }
92
- selectedValues.value = current;
93
- __props.onValueChange?.(current);
94
- };
95
- const selectedValues = signal([...__props.defaultValue ?? []], "selectedValues");
96
- const _state = { firstItemClaimed: false };
97
- const ctx = {
98
- selectedValues,
99
- classes: __props.classes,
100
- disabled: __props.disabled ?? false,
101
- toggle,
102
- claimFirstItem: () => {
103
- if (_state.firstItemClaimed)
104
- return false;
105
- _state.firstItemClaimed = true;
106
- return true;
107
- }
108
- };
109
- const __mfResult0 = ToggleGroupContext.Provider({ get value() {
110
- return ctx;
111
- }, children: () => (() => {
112
- const __el0 = __element("div");
113
- __el0.setAttribute("role", "group");
114
- {
115
- const __v = uniqueId("toggle-group");
116
- if (__v != null && __v !== false)
117
- __el0.setAttribute("id", __v === true ? "" : __v);
118
- }
119
- __attr(__el0, "data-orientation", () => __props.orientation ?? "horizontal");
120
- __el0.setAttribute("data-togglegroup-root", "");
121
- __attr(__el0, "class", () => cn(__props.classes?.root));
122
- __on(__el0, "keydown", (event) => {
123
- if (!isKey(event, Keys.ArrowLeft, Keys.ArrowRight, Keys.ArrowUp, Keys.ArrowDown, Keys.Home, Keys.End)) {
124
- return;
125
- }
126
- event.preventDefault();
127
- const root = event.currentTarget;
128
- const items = [...root.querySelectorAll("[data-togglegroup-item]")];
129
- const currentIdx = items.indexOf(document.activeElement);
130
- if (currentIdx < 0)
131
- return;
132
- const len = items.length;
133
- let nextIdx;
134
- if (isKey(event, Keys.ArrowRight, Keys.ArrowDown)) {
135
- nextIdx = (currentIdx + 1) % len;
136
- } else if (isKey(event, Keys.ArrowLeft, Keys.ArrowUp)) {
137
- nextIdx = (currentIdx - 1 + len) % len;
138
- } else if (isKey(event, Keys.Home)) {
139
- nextIdx = 0;
140
- } else if (isKey(event, Keys.End)) {
141
- nextIdx = len - 1;
142
- } else {
143
- return;
144
- }
145
- items.forEach((el, j) => el.setAttribute("tabindex", j === nextIdx ? "0" : "-1"));
146
- items[nextIdx]?.focus();
147
- });
148
- __enterChildren(__el0);
149
- __append(__el0, __child(() => __props.children));
150
- __exitChildren();
151
- return __el0;
152
- })() });
153
- __flushMountFrame();
154
- return __mfResult0;
155
- } catch (__mfErr) {
156
- __discardMountFrame(__mfDepth);
157
- throw __mfErr;
158
- }
159
- }
160
- var ComposedToggleGroup = Object.assign(ComposedToggleGroupRoot, {
161
- Item: ToggleGroupItem
162
- });
163
-
164
- export { ComposedToggleGroup };
@@ -1,107 +0,0 @@
1
- import {
2
- cn
3
- } from "./chunk-q7xbcj9q.js";
4
-
5
- // src/skeleton/skeleton-composed.tsx
6
- import { computed } from "@vertz/ui";
7
- import { __attr, __discardMountFrame, __element, __enterChildren, __exitChildren, __flushMountFrame, __insert, __pushMountFrame, __styleStr } from "@vertz/ui/internals";
8
- function ComposedSkeletonRoot(props = {}) {
9
- const __mfDepth = __pushMountFrame();
10
- try {
11
- const classes = computed(() => props.classes);
12
- const className = computed(() => props.className);
13
- const classProp = computed(() => props.class);
14
- const width = computed(() => props.width);
15
- const height = computed(() => props.height);
16
- const __mfResult0 = (() => {
17
- const __el0 = __element("div");
18
- __attr(__el0, "class", () => cn(classes.value?.root, className.value ?? classProp.value));
19
- __el0.setAttribute("aria-hidden", "true");
20
- __attr(__el0, "style", () => ({
21
- width: width.value || undefined,
22
- height: height.value || undefined
23
- }));
24
- return __el0;
25
- })();
26
- __flushMountFrame();
27
- return __mfResult0;
28
- } catch (__mfErr) {
29
- __discardMountFrame(__mfDepth);
30
- throw __mfErr;
31
- }
32
- }
33
- function SkeletonText(props = {}) {
34
- const __mfDepth = __pushMountFrame();
35
- try {
36
- const lineCount = computed(() => props.lines ?? 3);
37
- const lastWidth = computed(() => props.lastLineWidth ?? "75%");
38
- const lineHeight = computed(() => props.height);
39
- const lines = [];
40
- for (let i = 0;i < lineCount.value; i++) {
41
- lines.push((() => {
42
- const __el0 = __element("div");
43
- {
44
- const __v = cn(props.classes?.line);
45
- if (__v != null && __v !== false)
46
- __el0.setAttribute("class", __v === true ? "" : __v);
47
- }
48
- __attr(__el0, "style", () => ({
49
- width: i === lineCount.value - 1 ? lastWidth.value : undefined,
50
- height: lineHeight.value || undefined
51
- }));
52
- return __el0;
53
- })());
54
- }
55
- const __mfResult0 = (() => {
56
- const __el1 = __element("div");
57
- {
58
- const __v = cn(props.classes?.root, props.className ?? props.class);
59
- if (__v != null && __v !== false)
60
- __el1.setAttribute("class", __v === true ? "" : __v);
61
- }
62
- __el1.setAttribute("aria-hidden", "true");
63
- {
64
- const __v = { gap: props.gap || undefined };
65
- if (__v != null && __v !== false)
66
- __el1.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
67
- }
68
- __enterChildren(__el1);
69
- __insert(__el1, lines);
70
- __exitChildren();
71
- return __el1;
72
- })();
73
- __flushMountFrame();
74
- return __mfResult0;
75
- } catch (__mfErr) {
76
- __discardMountFrame(__mfDepth);
77
- throw __mfErr;
78
- }
79
- }
80
- function SkeletonCircle(props = {}) {
81
- const __mfDepth = __pushMountFrame();
82
- try {
83
- const size = computed(() => props.size ?? "2.5rem");
84
- const __mfResult0 = (() => {
85
- const __el0 = __element("div");
86
- {
87
- const __v = cn(props.classes?.root, props.className ?? props.class);
88
- if (__v != null && __v !== false)
89
- __el0.setAttribute("class", __v === true ? "" : __v);
90
- }
91
- __el0.setAttribute("aria-hidden", "true");
92
- __attr(__el0, "style", () => ({ width: size.value, height: size.value }));
93
- return __el0;
94
- })();
95
- __flushMountFrame();
96
- return __mfResult0;
97
- } catch (__mfErr) {
98
- __discardMountFrame(__mfDepth);
99
- throw __mfErr;
100
- }
101
- }
102
- var ComposedSkeleton = Object.assign(ComposedSkeletonRoot, {
103
- Text: SkeletonText,
104
- Circle: SkeletonCircle
105
- });
106
-
107
- export { ComposedSkeleton };