@tribepad/themis 1.0.0 → 1.0.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 (326) hide show
  1. package/dist/elements/Accordion/index.js +325 -66
  2. package/dist/elements/Accordion/index.js.map +1 -1
  3. package/dist/elements/Accordion/index.mjs +317 -3
  4. package/dist/elements/Accordion/index.mjs.map +1 -1
  5. package/dist/elements/Avatar/index.js +461 -45
  6. package/dist/elements/Avatar/index.js.map +1 -1
  7. package/dist/elements/Avatar/index.mjs +456 -3
  8. package/dist/elements/Avatar/index.mjs.map +1 -1
  9. package/dist/elements/Badge/index.js +238 -36
  10. package/dist/elements/Badge/index.js.map +1 -1
  11. package/dist/elements/Badge/index.mjs +234 -4
  12. package/dist/elements/Badge/index.mjs.map +1 -1
  13. package/dist/elements/Breadcrumbs/index.js +808 -39
  14. package/dist/elements/Breadcrumbs/index.js.map +1 -1
  15. package/dist/elements/Breadcrumbs/index.mjs +810 -7
  16. package/dist/elements/Breadcrumbs/index.mjs.map +1 -1
  17. package/dist/elements/Button/index.js +282 -19
  18. package/dist/elements/Button/index.js.map +1 -1
  19. package/dist/elements/Button/index.mjs +283 -4
  20. package/dist/elements/Button/index.mjs.map +1 -1
  21. package/dist/elements/ButtonGroup/index.js +229 -56
  22. package/dist/elements/ButtonGroup/index.js.map +1 -1
  23. package/dist/elements/ButtonGroup/index.mjs +222 -3
  24. package/dist/elements/ButtonGroup/index.mjs.map +1 -1
  25. package/dist/elements/Card/Card.d.ts.map +1 -1
  26. package/dist/elements/Card/index.js +563 -67
  27. package/dist/elements/Card/index.js.map +1 -1
  28. package/dist/elements/Card/index.mjs +560 -6
  29. package/dist/elements/Card/index.mjs.map +1 -1
  30. package/dist/elements/Carousel/index.js +782 -14
  31. package/dist/elements/Carousel/index.js.map +1 -1
  32. package/dist/elements/Carousel/index.mjs +786 -8
  33. package/dist/elements/Carousel/index.mjs.map +1 -1
  34. package/dist/elements/Chart/index.js +1833 -36
  35. package/dist/elements/Chart/index.js.map +1 -1
  36. package/dist/elements/Chart/index.mjs +1832 -4
  37. package/dist/elements/Chart/index.mjs.map +1 -1
  38. package/dist/elements/Checkbox/index.js +310 -39
  39. package/dist/elements/Checkbox/index.js.map +1 -1
  40. package/dist/elements/Checkbox/index.mjs +306 -4
  41. package/dist/elements/Checkbox/index.mjs.map +1 -1
  42. package/dist/elements/CheckboxGroup/index.js +445 -59
  43. package/dist/elements/CheckboxGroup/index.js.map +1 -1
  44. package/dist/elements/CheckboxGroup/index.mjs +439 -4
  45. package/dist/elements/CheckboxGroup/index.mjs.map +1 -1
  46. package/dist/elements/DatePicker/index.js +871 -89
  47. package/dist/elements/DatePicker/index.js.map +1 -1
  48. package/dist/elements/DatePicker/index.mjs +853 -4
  49. package/dist/elements/DatePicker/index.mjs.map +1 -1
  50. package/dist/elements/Dropdown/index.js +189 -35
  51. package/dist/elements/Dropdown/index.js.map +1 -1
  52. package/dist/elements/Dropdown/index.mjs +184 -2
  53. package/dist/elements/Dropdown/index.mjs.map +1 -1
  54. package/dist/elements/FileField/index.js +1532 -129
  55. package/dist/elements/FileField/index.js.map +1 -1
  56. package/dist/elements/FileField/index.mjs +1507 -7
  57. package/dist/elements/FileField/index.mjs.map +1 -1
  58. package/dist/elements/FormLayout/index.js +166 -11
  59. package/dist/elements/FormLayout/index.js.map +1 -1
  60. package/dist/elements/FormLayout/index.mjs +167 -2
  61. package/dist/elements/FormLayout/index.mjs.map +1 -1
  62. package/dist/elements/Modal/index.js +228 -46
  63. package/dist/elements/Modal/index.js.map +1 -1
  64. package/dist/elements/Modal/index.mjs +220 -1
  65. package/dist/elements/Modal/index.mjs.map +1 -1
  66. package/dist/elements/NumberField/index.js +659 -48
  67. package/dist/elements/NumberField/index.js.map +1 -1
  68. package/dist/elements/NumberField/index.mjs +654 -6
  69. package/dist/elements/NumberField/index.mjs.map +1 -1
  70. package/dist/elements/OTPInput/index.js +729 -6
  71. package/dist/elements/OTPInput/index.js.map +1 -1
  72. package/dist/elements/OTPInput/index.mjs +732 -2
  73. package/dist/elements/OTPInput/index.mjs.map +1 -1
  74. package/dist/elements/Panel/index.js +326 -27
  75. package/dist/elements/Panel/index.js.map +1 -1
  76. package/dist/elements/Panel/index.mjs +323 -2
  77. package/dist/elements/Panel/index.mjs.map +1 -1
  78. package/dist/elements/Progress/index.js +181 -22
  79. package/dist/elements/Progress/index.js.map +1 -1
  80. package/dist/elements/Progress/index.mjs +181 -3
  81. package/dist/elements/Progress/index.mjs.map +1 -1
  82. package/dist/elements/RadioGroup/index.js +358 -34
  83. package/dist/elements/RadioGroup/index.js.map +1 -1
  84. package/dist/elements/RadioGroup/index.mjs +359 -4
  85. package/dist/elements/RadioGroup/index.mjs.map +1 -1
  86. package/dist/elements/Resizable/components/ResizableHandle.d.ts +0 -8
  87. package/dist/elements/Resizable/components/ResizableHandle.d.ts.map +1 -1
  88. package/dist/elements/Resizable/components/ResizablePanel.d.ts +0 -8
  89. package/dist/elements/Resizable/components/ResizablePanel.d.ts.map +1 -1
  90. package/dist/elements/Resizable/components/ResizablePanelGroup.d.ts +0 -8
  91. package/dist/elements/Resizable/components/ResizablePanelGroup.d.ts.map +1 -1
  92. package/dist/elements/Resizable/components/ResizablePopover.d.ts +0 -8
  93. package/dist/elements/Resizable/components/ResizablePopover.d.ts.map +1 -1
  94. package/dist/elements/Resizable/index.js +1568 -51
  95. package/dist/elements/Resizable/index.js.map +1 -1
  96. package/dist/elements/Resizable/index.mjs +1566 -6
  97. package/dist/elements/Resizable/index.mjs.map +1 -1
  98. package/dist/elements/Select/index.js +580 -22
  99. package/dist/elements/Select/index.js.map +1 -1
  100. package/dist/elements/Select/index.mjs +582 -2
  101. package/dist/elements/Select/index.mjs.map +1 -1
  102. package/dist/elements/Skeleton/index.js +77 -15
  103. package/dist/elements/Skeleton/index.js.map +1 -1
  104. package/dist/elements/Skeleton/index.mjs +78 -3
  105. package/dist/elements/Skeleton/index.mjs.map +1 -1
  106. package/dist/elements/Switch/index.js +153 -21
  107. package/dist/elements/Switch/index.js.map +1 -1
  108. package/dist/elements/Switch/index.mjs +149 -5
  109. package/dist/elements/Switch/index.mjs.map +1 -1
  110. package/dist/elements/Table/index.js +589 -68
  111. package/dist/elements/Table/index.js.map +1 -1
  112. package/dist/elements/Table/index.mjs +578 -5
  113. package/dist/elements/Table/index.mjs.map +1 -1
  114. package/dist/elements/Tabs/index.js +328 -63
  115. package/dist/elements/Tabs/index.js.map +1 -1
  116. package/dist/elements/Tabs/index.mjs +320 -3
  117. package/dist/elements/Tabs/index.mjs.map +1 -1
  118. package/dist/elements/TextField/index.js +695 -51
  119. package/dist/elements/TextField/index.js.map +1 -1
  120. package/dist/elements/TextField/index.mjs +684 -7
  121. package/dist/elements/TextField/index.mjs.map +1 -1
  122. package/dist/elements/TimeField/index.js +244 -33
  123. package/dist/elements/TimeField/index.js.map +1 -1
  124. package/dist/elements/TimeField/index.mjs +238 -2
  125. package/dist/elements/TimeField/index.mjs.map +1 -1
  126. package/dist/elements/Toast/index.js +727 -48
  127. package/dist/elements/Toast/index.js.map +1 -1
  128. package/dist/elements/Toast/index.mjs +724 -5
  129. package/dist/elements/Toast/index.mjs.map +1 -1
  130. package/dist/elements/Tooltip/index.js +315 -49
  131. package/dist/elements/Tooltip/index.js.map +1 -1
  132. package/dist/elements/Tooltip/index.mjs +310 -4
  133. package/dist/elements/Tooltip/index.mjs.map +1 -1
  134. package/dist/elements/index.js +12417 -799
  135. package/dist/elements/index.js.map +1 -1
  136. package/dist/elements/index.mjs +12233 -40
  137. package/dist/elements/index.mjs.map +1 -1
  138. package/dist/index.js +12452 -825
  139. package/dist/index.js.map +1 -1
  140. package/dist/index.mjs +12262 -42
  141. package/dist/index.mjs.map +1 -1
  142. package/dist/schemas/index.js +47 -21
  143. package/dist/schemas/index.js.map +1 -1
  144. package/dist/schemas/index.mjs +47 -2
  145. package/dist/schemas/index.mjs.map +1 -1
  146. package/dist/styles/index.js +161 -147
  147. package/dist/styles/index.js.map +1 -1
  148. package/dist/styles/index.mjs +128 -2
  149. package/dist/styles/index.mjs.map +1 -1
  150. package/dist/utils/index.js +7 -7
  151. package/dist/utils/index.js.map +1 -1
  152. package/dist/utils/index.mjs +9 -2
  153. package/dist/utils/index.mjs.map +1 -1
  154. package/package.json +1 -1
  155. package/dist/Carousel-NTZX5TOW.js +0 -16
  156. package/dist/Carousel-NTZX5TOW.js.map +0 -1
  157. package/dist/Carousel-YH3DOQJU.mjs +0 -7
  158. package/dist/Carousel-YH3DOQJU.mjs.map +0 -1
  159. package/dist/chunk-2HIUTHMU.mjs +0 -234
  160. package/dist/chunk-2HIUTHMU.mjs.map +0 -1
  161. package/dist/chunk-34GTFTDO.js +0 -431
  162. package/dist/chunk-34GTFTDO.js.map +0 -1
  163. package/dist/chunk-3H7ASYR7.js +0 -250
  164. package/dist/chunk-3H7ASYR7.js.map +0 -1
  165. package/dist/chunk-3IEN7JOP.js +0 -316
  166. package/dist/chunk-3IEN7JOP.js.map +0 -1
  167. package/dist/chunk-3JHN4GAL.js +0 -326
  168. package/dist/chunk-3JHN4GAL.js.map +0 -1
  169. package/dist/chunk-3MJPASQU.js +0 -232
  170. package/dist/chunk-3MJPASQU.js.map +0 -1
  171. package/dist/chunk-3XD2JUL3.js +0 -572
  172. package/dist/chunk-3XD2JUL3.js.map +0 -1
  173. package/dist/chunk-3YOY2VJ6.js +0 -189
  174. package/dist/chunk-3YOY2VJ6.js.map +0 -1
  175. package/dist/chunk-4DU5JSXB.js +0 -408
  176. package/dist/chunk-4DU5JSXB.js.map +0 -1
  177. package/dist/chunk-4E4E2GSS.js +0 -352
  178. package/dist/chunk-4E4E2GSS.js.map +0 -1
  179. package/dist/chunk-4NHAP4AN.mjs +0 -3
  180. package/dist/chunk-4NHAP4AN.mjs.map +0 -1
  181. package/dist/chunk-4S33J5NY.mjs +0 -415
  182. package/dist/chunk-4S33J5NY.mjs.map +0 -1
  183. package/dist/chunk-5SMGRT3G.mjs +0 -354
  184. package/dist/chunk-5SMGRT3G.mjs.map +0 -1
  185. package/dist/chunk-5SVLJN2C.mjs +0 -22
  186. package/dist/chunk-5SVLJN2C.mjs.map +0 -1
  187. package/dist/chunk-66WTU4EB.mjs +0 -299
  188. package/dist/chunk-66WTU4EB.mjs.map +0 -1
  189. package/dist/chunk-6S25NMOT.mjs +0 -335
  190. package/dist/chunk-6S25NMOT.mjs.map +0 -1
  191. package/dist/chunk-6SP7UB3D.js +0 -4
  192. package/dist/chunk-6SP7UB3D.js.map +0 -1
  193. package/dist/chunk-6TYWWQHM.mjs +0 -565
  194. package/dist/chunk-6TYWWQHM.mjs.map +0 -1
  195. package/dist/chunk-A3YUJA6W.mjs +0 -384
  196. package/dist/chunk-A3YUJA6W.mjs.map +0 -1
  197. package/dist/chunk-A6KEDVUR.js +0 -61
  198. package/dist/chunk-A6KEDVUR.js.map +0 -1
  199. package/dist/chunk-A77RUEWL.js +0 -730
  200. package/dist/chunk-A77RUEWL.js.map +0 -1
  201. package/dist/chunk-AA4IKMPE.mjs +0 -3
  202. package/dist/chunk-AA4IKMPE.mjs.map +0 -1
  203. package/dist/chunk-AKIA6GW6.mjs +0 -163
  204. package/dist/chunk-AKIA6GW6.mjs.map +0 -1
  205. package/dist/chunk-AL6P275L.mjs +0 -435
  206. package/dist/chunk-AL6P275L.mjs.map +0 -1
  207. package/dist/chunk-AZ3RJYTB.js +0 -37
  208. package/dist/chunk-AZ3RJYTB.js.map +0 -1
  209. package/dist/chunk-B5Q4UPL6.js +0 -32
  210. package/dist/chunk-B5Q4UPL6.js.map +0 -1
  211. package/dist/chunk-B6DHPMDP.mjs +0 -335
  212. package/dist/chunk-B6DHPMDP.mjs.map +0 -1
  213. package/dist/chunk-BDXKKMBZ.mjs +0 -184
  214. package/dist/chunk-BDXKKMBZ.mjs.map +0 -1
  215. package/dist/chunk-BL6E2DLZ.mjs +0 -52
  216. package/dist/chunk-BL6E2DLZ.mjs.map +0 -1
  217. package/dist/chunk-CGFDS4XS.mjs +0 -121
  218. package/dist/chunk-CGFDS4XS.mjs.map +0 -1
  219. package/dist/chunk-CJIW5TKI.js +0 -139
  220. package/dist/chunk-CJIW5TKI.js.map +0 -1
  221. package/dist/chunk-CKNISJOQ.js +0 -314
  222. package/dist/chunk-CKNISJOQ.js.map +0 -1
  223. package/dist/chunk-D6CBOECS.mjs +0 -1757
  224. package/dist/chunk-D6CBOECS.mjs.map +0 -1
  225. package/dist/chunk-DDWEVC2S.js +0 -166
  226. package/dist/chunk-DDWEVC2S.js.map +0 -1
  227. package/dist/chunk-DZ556D2F.mjs +0 -176
  228. package/dist/chunk-DZ556D2F.mjs.map +0 -1
  229. package/dist/chunk-E2KQFV3O.mjs +0 -10
  230. package/dist/chunk-E2KQFV3O.mjs.map +0 -1
  231. package/dist/chunk-EMMLADSC.js +0 -126
  232. package/dist/chunk-EMMLADSC.js.map +0 -1
  233. package/dist/chunk-EP4WOI5D.mjs +0 -926
  234. package/dist/chunk-EP4WOI5D.mjs.map +0 -1
  235. package/dist/chunk-FJRXLJC2.mjs +0 -160
  236. package/dist/chunk-FJRXLJC2.mjs.map +0 -1
  237. package/dist/chunk-FKQI434R.js +0 -345
  238. package/dist/chunk-FKQI434R.js.map +0 -1
  239. package/dist/chunk-FPKEAJRZ.mjs +0 -100
  240. package/dist/chunk-FPKEAJRZ.mjs.map +0 -1
  241. package/dist/chunk-FWQYB22U.js +0 -183
  242. package/dist/chunk-FWQYB22U.js.map +0 -1
  243. package/dist/chunk-GD5GHTMA.js +0 -189
  244. package/dist/chunk-GD5GHTMA.js.map +0 -1
  245. package/dist/chunk-GE5XTSDZ.js +0 -447
  246. package/dist/chunk-GE5XTSDZ.js.map +0 -1
  247. package/dist/chunk-GVE47ZAX.mjs +0 -32
  248. package/dist/chunk-GVE47ZAX.mjs.map +0 -1
  249. package/dist/chunk-HK46BT5U.mjs +0 -18
  250. package/dist/chunk-HK46BT5U.mjs.map +0 -1
  251. package/dist/chunk-HQVRMR6N.js +0 -365
  252. package/dist/chunk-HQVRMR6N.js.map +0 -1
  253. package/dist/chunk-HSGBJPJO.mjs +0 -398
  254. package/dist/chunk-HSGBJPJO.mjs.map +0 -1
  255. package/dist/chunk-I3AUTOMZ.mjs +0 -125
  256. package/dist/chunk-I3AUTOMZ.mjs.map +0 -1
  257. package/dist/chunk-IEI5LD5C.mjs +0 -1161
  258. package/dist/chunk-IEI5LD5C.mjs.map +0 -1
  259. package/dist/chunk-IIPTC2X7.mjs +0 -118
  260. package/dist/chunk-IIPTC2X7.mjs.map +0 -1
  261. package/dist/chunk-J7TLHF2Q.js +0 -4
  262. package/dist/chunk-J7TLHF2Q.js.map +0 -1
  263. package/dist/chunk-JJOWXFXQ.mjs +0 -765
  264. package/dist/chunk-JJOWXFXQ.mjs.map +0 -1
  265. package/dist/chunk-JPTSS2OA.mjs +0 -3
  266. package/dist/chunk-JPTSS2OA.mjs.map +0 -1
  267. package/dist/chunk-KFXXRLTP.js +0 -396
  268. package/dist/chunk-KFXXRLTP.js.map +0 -1
  269. package/dist/chunk-KPRRBSG6.mjs +0 -272
  270. package/dist/chunk-KPRRBSG6.mjs.map +0 -1
  271. package/dist/chunk-NFSBGRDB.mjs +0 -57
  272. package/dist/chunk-NFSBGRDB.mjs.map +0 -1
  273. package/dist/chunk-NGJVCFTM.js +0 -219
  274. package/dist/chunk-NGJVCFTM.js.map +0 -1
  275. package/dist/chunk-NSQ6MZJ6.mjs +0 -728
  276. package/dist/chunk-NSQ6MZJ6.mjs.map +0 -1
  277. package/dist/chunk-NYQYHT76.mjs +0 -296
  278. package/dist/chunk-NYQYHT76.mjs.map +0 -1
  279. package/dist/chunk-OLJJGI5B.js +0 -1193
  280. package/dist/chunk-OLJJGI5B.js.map +0 -1
  281. package/dist/chunk-Q3572X2J.js +0 -292
  282. package/dist/chunk-Q3572X2J.js.map +0 -1
  283. package/dist/chunk-QH7N7D4I.mjs +0 -210
  284. package/dist/chunk-QH7N7D4I.mjs.map +0 -1
  285. package/dist/chunk-R7XUIV25.js +0 -466
  286. package/dist/chunk-R7XUIV25.js.map +0 -1
  287. package/dist/chunk-RFFO4KPM.js +0 -135
  288. package/dist/chunk-RFFO4KPM.js.map +0 -1
  289. package/dist/chunk-RFX7QKA7.mjs +0 -180
  290. package/dist/chunk-RFX7QKA7.mjs.map +0 -1
  291. package/dist/chunk-SN5LFAP3.js +0 -940
  292. package/dist/chunk-SN5LFAP3.js.map +0 -1
  293. package/dist/chunk-T4COXKQ3.js +0 -24
  294. package/dist/chunk-T4COXKQ3.js.map +0 -1
  295. package/dist/chunk-TS54QM27.js +0 -125
  296. package/dist/chunk-TS54QM27.js.map +0 -1
  297. package/dist/chunk-UE2S4PCX.mjs +0 -220
  298. package/dist/chunk-UE2S4PCX.mjs.map +0 -1
  299. package/dist/chunk-UTW3QX2A.mjs +0 -282
  300. package/dist/chunk-UTW3QX2A.mjs.map +0 -1
  301. package/dist/chunk-V74LGMAE.js +0 -1767
  302. package/dist/chunk-V74LGMAE.js.map +0 -1
  303. package/dist/chunk-VIREG536.js +0 -12
  304. package/dist/chunk-VIREG536.js.map +0 -1
  305. package/dist/chunk-VY7M7346.js +0 -4
  306. package/dist/chunk-VY7M7346.js.map +0 -1
  307. package/dist/chunk-W3TJOO7H.mjs +0 -319
  308. package/dist/chunk-W3TJOO7H.mjs.map +0 -1
  309. package/dist/chunk-WIUOB36M.js +0 -54
  310. package/dist/chunk-WIUOB36M.js.map +0 -1
  311. package/dist/chunk-WJGLM4CY.js +0 -291
  312. package/dist/chunk-WJGLM4CY.js.map +0 -1
  313. package/dist/chunk-WNURH5OO.mjs +0 -453
  314. package/dist/chunk-WNURH5OO.mjs.map +0 -1
  315. package/dist/chunk-X25TNRSD.mjs +0 -364
  316. package/dist/chunk-X25TNRSD.mjs.map +0 -1
  317. package/dist/chunk-Y3GT7ETK.js +0 -108
  318. package/dist/chunk-Y3GT7ETK.js.map +0 -1
  319. package/dist/chunk-Z4FRNOF6.mjs +0 -115
  320. package/dist/chunk-Z4FRNOF6.mjs.map +0 -1
  321. package/dist/chunk-ZMYLD3BN.js +0 -166
  322. package/dist/chunk-ZMYLD3BN.js.map +0 -1
  323. package/dist/chunk-ZP2KV6EX.js +0 -815
  324. package/dist/chunk-ZP2KV6EX.js.map +0 -1
  325. package/dist/chunk-ZVKXFELU.js +0 -366
  326. package/dist/chunk-ZVKXFELU.js.map +0 -1
@@ -1,9 +1,812 @@
1
- export { BreadcrumbItemDataSchema, Breadcrumbs, BreadcrumbsPropsSchema, SeparatorTypeSchema, breadcrumbItemVariants, breadcrumbLinkVariants, breadcrumbListVariants, breadcrumbsVariants, ellipsisButtonVariants, separatorVariants } from '../../chunk-5SMGRT3G.mjs';
2
- import '../../chunk-RFX7QKA7.mjs';
3
- import '../../chunk-BDXKKMBZ.mjs';
4
- import '../../chunk-FPKEAJRZ.mjs';
5
- import '../../chunk-HK46BT5U.mjs';
6
- import '../../chunk-E2KQFV3O.mjs';
7
- import '../../chunk-5SVLJN2C.mjs';
1
+ "use client";
2
+ import { z } from 'zod';
3
+ import { forwardRef, Children, isValidElement, cloneElement, memo, createContext, useId, Fragment as Fragment$1, useContext } from 'react';
4
+ import { cva } from 'class-variance-authority';
5
+ import { ChevronRight, Loader2, Zap, MoreHorizontal } from 'lucide-react';
6
+ import { clsx } from 'clsx';
7
+ import { twMerge } from 'tailwind-merge';
8
+ import { MenuTrigger, Button as Button$1, Popover, Menu, SubmenuTrigger, MenuItem, Separator, Header } from 'react-aria-components';
9
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
10
+
11
+ // src/elements/Breadcrumbs/Breadcrumbs.types.ts
12
+ var BaseComponentPropsSchema = z.object({
13
+ // Styling
14
+ className: z.string().optional(),
15
+ // React
16
+ children: z.any().optional(),
17
+ // ReactNode not directly supported by Zod
18
+ id: z.string().optional(),
19
+ // Accessibility (WCAG 2.2 AA requirements)
20
+ "aria-label": z.string().optional(),
21
+ "aria-labelledby": z.string().optional(),
22
+ "aria-describedby": z.string().optional(),
23
+ "aria-live": z.enum(["off", "polite", "assertive"]).optional(),
24
+ "aria-hidden": z.boolean().optional(),
25
+ // Testing & Development
26
+ "data-testid": z.string().optional()
27
+ });
28
+
29
+ // src/elements/Breadcrumbs/Breadcrumbs.types.ts
30
+ var BreadcrumbItemDataSchema = z.object({
31
+ /** Unique identifier for the breadcrumb item */
32
+ id: z.union([z.string(), z.number()]),
33
+ /** Display text for the breadcrumb (required - no icon-only items) */
34
+ label: z.string(),
35
+ /** Link URL - omit for non-navigable items */
36
+ href: z.string().optional(),
37
+ /** Optional leading icon (ReactNode) */
38
+ icon: z.custom().optional(),
39
+ /** Disable this specific breadcrumb link */
40
+ isDisabled: z.boolean().optional().default(false)
41
+ });
42
+ var SeparatorTypeSchema = z.union([
43
+ z.literal("chevron"),
44
+ z.literal("slash"),
45
+ z.custom()
46
+ ]);
47
+ var BreadcrumbsPropsSchema = BaseComponentPropsSchema.extend({
48
+ /**
49
+ * Array of breadcrumb items to render
50
+ * @see FR-001 (Render Breadcrumbs from Items Array)
51
+ */
52
+ items: z.array(BreadcrumbItemDataSchema),
53
+ /**
54
+ * Separator style between items
55
+ * @default 'chevron'
56
+ * @see FR-003 (Configurable Separators)
57
+ */
58
+ separator: SeparatorTypeSchema.optional().default("chevron"),
59
+ /**
60
+ * Maximum items to show before collapsing
61
+ * @default 4
62
+ * @see FR-004 (Ellipsis Collapse for Overflow)
63
+ */
64
+ maxItems: z.number().int().positive().optional().default(4),
65
+ /**
66
+ * Number of items to show before ellipsis
67
+ * @default 1
68
+ * @see FR-004 (Ellipsis Collapse for Overflow)
69
+ */
70
+ itemsBeforeCollapse: z.number().int().nonnegative().optional().default(1),
71
+ /**
72
+ * Number of items to show after ellipsis
73
+ * @default 2
74
+ * @see FR-004 (Ellipsis Collapse for Overflow)
75
+ */
76
+ itemsAfterCollapse: z.number().int().positive().optional().default(2),
77
+ /**
78
+ * Custom link component for framework integration (Next.js Link, React Router Link, etc.)
79
+ * @default 'a'
80
+ * @see FR-005 (Polymorphic Link Component)
81
+ */
82
+ linkComponent: z.custom().optional(),
83
+ /**
84
+ * Disable all breadcrumb links
85
+ * @default false
86
+ * @see FR-006 (Disabled States)
87
+ */
88
+ isDisabled: z.boolean().optional().default(false)
89
+ });
90
+ function cn(...inputs) {
91
+ return twMerge(clsx(inputs));
92
+ }
93
+ var menuVariants = cva(
94
+ // Base styles - semantic tokens with fallbacks
95
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border border-[var(--menu-border)] bg-[var(--menu-background)] text-[var(--menu-foreground)] shadow-md data-[entering]:animate-in data-[exiting]:animate-out data-[entering]:fade-in-0 data-[exiting]:fade-out-0 data-[entering]:zoom-in-95 data-[exiting]:zoom-out-95 p-1",
96
+ {
97
+ variants: {
98
+ variant: {
99
+ default: ""
100
+ }
101
+ },
102
+ defaultVariants: {
103
+ variant: "default"
104
+ }
105
+ }
106
+ );
107
+ var menuItemVariants = cva(
108
+ // Base styles - FR-014: 44x44px minimum touch targets
109
+ "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 min-h-[44px] data-[focused]:bg-[var(--menu-accent)] data-[focused]:text-[var(--menu-accent-foreground)] data-[pressed]:bg-[var(--menu-accent)] [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
110
+ {
111
+ variants: {
112
+ variant: {
113
+ default: ""
114
+ }
115
+ },
116
+ defaultVariants: {
117
+ variant: "default"
118
+ }
119
+ }
120
+ );
121
+ var DropdownRoot = forwardRef(
122
+ ({ defaultOpen = false, isOpen, onOpenChange, children }, _ref) => {
123
+ const childArray = Children.toArray(children);
124
+ const hasTrigger = childArray.some(
125
+ (child) => isValidElement(child) && (child.type === DropdownTrigger || child.type.displayName === "DropdownTrigger")
126
+ );
127
+ const hasMenu = childArray.some(
128
+ (child) => isValidElement(child) && (child.type === DropdownMenu || child.type.displayName === "DropdownMenu")
129
+ );
130
+ if (!hasTrigger || !hasMenu) {
131
+ throw new Error(
132
+ "Dropdown requires exactly one Dropdown.Trigger and one Dropdown.Menu as children"
133
+ );
134
+ }
135
+ return /* @__PURE__ */ jsx(MenuTrigger, { defaultOpen, isOpen, onOpenChange, children });
136
+ }
137
+ );
138
+ DropdownRoot.displayName = "Dropdown";
139
+ var DropdownTrigger = forwardRef(
140
+ ({ children, ...props }, ref) => {
141
+ if (isValidElement(children)) {
142
+ return cloneElement(children, {
143
+ ...props,
144
+ slot: "trigger"
145
+ });
146
+ }
147
+ return /* @__PURE__ */ jsx(Button$1, { ref, ...props, children });
148
+ }
149
+ );
150
+ DropdownTrigger.displayName = "DropdownTrigger";
151
+ var DropdownMenu = forwardRef(
152
+ ({ align = "start", side = "bottom", className, children, ...props }, _ref) => {
153
+ const placement = `${side} ${align}`;
154
+ return /* @__PURE__ */ jsx(Popover, { placement, className: "entering:animate-in exiting:animate-out", children: /* @__PURE__ */ jsx(
155
+ Menu,
156
+ {
157
+ className: cn(menuVariants({ variant: "default" }), className),
158
+ ...props,
159
+ children
160
+ }
161
+ ) });
162
+ }
163
+ );
164
+ DropdownMenu.displayName = "DropdownMenu";
165
+ var DropdownItem = forwardRef(
166
+ ({
167
+ children,
168
+ onAction,
169
+ isDisabled = false,
170
+ shortcut,
171
+ icon,
172
+ iconRight,
173
+ className,
174
+ "aria-label": ariaLabel,
175
+ ...props
176
+ }, _ref) => {
177
+ const childArray = Children.toArray(children);
178
+ const hasSubmenu = childArray.some(
179
+ (child) => isValidElement(child) && (child.type === DropdownMenu || child.type.displayName === "DropdownMenu")
180
+ );
181
+ const contentChildren = childArray.filter(
182
+ (child) => !isValidElement(child) || child.type !== DropdownMenu && child.type.displayName !== "DropdownMenu"
183
+ );
184
+ const submenu = childArray.find(
185
+ (child) => isValidElement(child) && (child.type === DropdownMenu || child.type.displayName === "DropdownMenu")
186
+ );
187
+ if (hasSubmenu && submenu) {
188
+ return /* @__PURE__ */ jsxs(SubmenuTrigger, { children: [
189
+ /* @__PURE__ */ jsxs(
190
+ MenuItem,
191
+ {
192
+ "aria-label": ariaLabel,
193
+ className: cn(menuItemVariants({ variant: "default" }), className),
194
+ ...props,
195
+ children: [
196
+ icon && /* @__PURE__ */ jsx("span", { className: "mr-2", children: icon }),
197
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children: contentChildren }),
198
+ /* @__PURE__ */ jsx(ChevronRight, { className: "ml-auto h-4 w-4", "aria-hidden": "true" })
199
+ ]
200
+ }
201
+ ),
202
+ submenu
203
+ ] });
204
+ }
205
+ return /* @__PURE__ */ jsxs(
206
+ MenuItem,
207
+ {
208
+ onAction,
209
+ isDisabled,
210
+ "aria-label": ariaLabel,
211
+ className: cn(menuItemVariants({ variant: "default" }), className),
212
+ ...props,
213
+ children: [
214
+ icon && /* @__PURE__ */ jsx("span", { className: "mr-2", children: icon }),
215
+ /* @__PURE__ */ jsx("span", { className: "flex-1", children }),
216
+ iconRight && /* @__PURE__ */ jsx("span", { className: "ml-auto", children: iconRight }),
217
+ shortcut && /* @__PURE__ */ jsx("kbd", { className: "ml-auto pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border border-[var(--border)] bg-[var(--accent-background)] px-1.5 font-mono text-[10px] font-medium text-[var(--menu-muted)] opacity-100", children: shortcut })
218
+ ]
219
+ }
220
+ );
221
+ }
222
+ );
223
+ DropdownItem.displayName = "DropdownItem";
224
+ var DropdownSeparator = memo(forwardRef(
225
+ ({ className, ...props }, _ref) => {
226
+ return /* @__PURE__ */ jsx(
227
+ Separator,
228
+ {
229
+ className: cn(
230
+ "-mx-1 my-1 h-px bg-[var(--accent-background)]",
231
+ className
232
+ ),
233
+ ...props
234
+ }
235
+ );
236
+ }
237
+ ));
238
+ DropdownSeparator.displayName = "DropdownSeparator";
239
+ var DropdownLabel = memo(forwardRef(
240
+ ({ children, className, ...props }, _ref) => {
241
+ return /* @__PURE__ */ jsx(
242
+ Header,
243
+ {
244
+ className: cn(
245
+ "px-2 py-1.5 text-sm font-semibold text-[var(--menu-muted)]",
246
+ className
247
+ ),
248
+ ...props,
249
+ children
250
+ }
251
+ );
252
+ }
253
+ ));
254
+ DropdownLabel.displayName = "DropdownLabel";
255
+ var Dropdown = Object.assign(DropdownRoot, {
256
+ Trigger: DropdownTrigger,
257
+ Menu: DropdownMenu,
258
+ Item: DropdownItem,
259
+ Separator: DropdownSeparator,
260
+ Label: DropdownLabel
261
+ });
262
+ var PRESSED_STYLES = "data-[pressed]:scale-[0.97]";
263
+ var HOVER_STYLES = "data-[hovered]:shadow-md";
264
+ var HIGH_CONTRAST_HOVER = "hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground";
265
+ var HIGH_CONTRAST_PRESSED = "hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground";
266
+ var ButtonGroupContext = createContext(null);
267
+ ButtonGroupContext.displayName = "ButtonGroupContext";
268
+ function useButtonGroupContext() {
269
+ return useContext(ButtonGroupContext);
270
+ }
271
+ var ButtonGroupItemContext = createContext(null);
272
+ ButtonGroupItemContext.displayName = "ButtonGroupItemContext";
273
+ function useButtonGroupItemContext() {
274
+ return useContext(ButtonGroupItemContext);
275
+ }
276
+ cva("inline-flex items-center gap-0", {
277
+ variants: {
278
+ orientation: {
279
+ horizontal: "flex-row",
280
+ vertical: "flex-col w-full"
281
+ }
282
+ },
283
+ defaultVariants: {
284
+ orientation: "horizontal"
285
+ }
286
+ });
287
+ var buttonGroupItemVariants = cva("", {
288
+ variants: {
289
+ orientation: {
290
+ // min-w-[44px] ensures visual layer fills touch target width (for icon buttons)
291
+ horizontal: "min-w-[44px]",
292
+ // flex (overrides inline-flex) + min-h-[44px] makes visual layer fill touch target,
293
+ // eliminating gaps between stacked buttons in vertical orientation
294
+ vertical: "flex min-h-[44px]"
295
+ },
296
+ position: {
297
+ first: "",
298
+ middle: "",
299
+ last: "",
300
+ only: ""
301
+ // Single button - no modifications needed
302
+ }
303
+ },
304
+ compoundVariants: [
305
+ // ==========================================================================
306
+ // Horizontal Orientation
307
+ // ==========================================================================
308
+ {
309
+ orientation: "horizontal",
310
+ position: "first",
311
+ className: "rounded-r-none border-r-0"
312
+ },
313
+ {
314
+ orientation: "horizontal",
315
+ position: "middle",
316
+ className: "rounded-none border-r-0"
317
+ },
318
+ {
319
+ orientation: "horizontal",
320
+ position: "last",
321
+ className: "rounded-l-none"
322
+ },
323
+ // ==========================================================================
324
+ // Vertical Orientation
325
+ // Note: w-full is handled by Button's effectiveFullWidth for both layers
326
+ // ==========================================================================
327
+ {
328
+ orientation: "vertical",
329
+ position: "first",
330
+ className: "rounded-b-none border-b-0"
331
+ },
332
+ {
333
+ orientation: "vertical",
334
+ position: "middle",
335
+ className: "rounded-none border-b-0"
336
+ },
337
+ {
338
+ orientation: "vertical",
339
+ position: "last",
340
+ className: "rounded-t-none"
341
+ }
342
+ ],
343
+ defaultVariants: {
344
+ orientation: "horizontal",
345
+ position: "only"
346
+ }
347
+ });
348
+ cva("bg-[var(--border)]", {
349
+ variants: {
350
+ orientation: {
351
+ horizontal: "w-px h-6 mx-1",
352
+ vertical: "h-px w-full my-1"
353
+ }
354
+ },
355
+ defaultVariants: {
356
+ orientation: "horizontal"
357
+ }
358
+ });
359
+ var buttonOuterVariants = cva(
360
+ "inline-flex justify-center min-h-[44px] min-w-[44px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50",
361
+ {
362
+ variants: {
363
+ fullWidth: {
364
+ true: "w-full",
365
+ false: ""
366
+ },
367
+ inVerticalGroup: {
368
+ true: "items-stretch",
369
+ false: "items-center"
370
+ }
371
+ },
372
+ defaultVariants: {
373
+ fullWidth: false,
374
+ inVerticalGroup: false
375
+ }
376
+ }
377
+ );
378
+ var buttonVisualVariants = cva(
379
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 relative cursor-pointer",
380
+ {
381
+ variants: {
382
+ variant: {
383
+ default: "bg-[var(--primary-action)] text-[var(--primary-action-foreground)] shadow-md hover:bg-[var(--primary-action-hover)] data-[pressed]:bg-[var(--primary-action)]/80",
384
+ destructive: "bg-[var(--destructive-background)] text-[var(--destructive-foreground)] shadow-md hover:bg-[var(--destructive-background)]/90 data-[pressed]:bg-[var(--destructive-background)]/80",
385
+ outline: "border border-[var(--input-border)] bg-[var(--page-background)] hover:bg-[var(--input-border)] data-[pressed]:bg-[var(--input-border)]",
386
+ secondary: "bg-[var(--secondary)] text-[var(--secondary-foreground)] shadow-md hover:bg-[var(--secondary)]/80 data-[pressed]:bg-[var(--secondary)]/70",
387
+ ghost: "hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)] data-[pressed]:bg-[var(--accent)]",
388
+ link: "text-[var(--text-link)] underline-offset-4 hover:underline data-[pressed]:text-[var(--text-link-hover)]"
389
+ },
390
+ fullWidth: {
391
+ true: "w-full",
392
+ false: ""
393
+ },
394
+ visualSize: {
395
+ default: "h-10 px-4 py-2",
396
+ sm: "h-9 rounded-md px-3 text-xs",
397
+ lg: "h-11 rounded-md px-8",
398
+ icon: "h-10 w-10",
399
+ dot: "h-5 w-5 rounded-full p-0 min-h-0 min-w-0"
400
+ },
401
+ paywall: {
402
+ true: "!bg-[var(--paywall)] !text-[var(--paywall-foreground)] !shadow-md hover:!bg-[var(--paywall)]/90 !cursor-not-allowed !border-transparent",
403
+ false: ""
404
+ }
405
+ },
406
+ defaultVariants: {
407
+ variant: "default",
408
+ visualSize: "default",
409
+ paywall: false
410
+ }
411
+ }
412
+ );
413
+ var Button = memo(forwardRef(
414
+ ({
415
+ className,
416
+ buttonVisualClassName,
417
+ variant,
418
+ size,
419
+ visualSize,
420
+ fullWidth,
421
+ loading = false,
422
+ loadingText = "Loading...",
423
+ shortcut,
424
+ children,
425
+ isDisabled,
426
+ paywall = false,
427
+ paywallRedirect,
428
+ paywallDescription,
429
+ onPress,
430
+ ...props
431
+ }, ref) => {
432
+ const paywallDescriptionId = useId();
433
+ const groupContext = useButtonGroupContext();
434
+ const itemContext = useButtonGroupItemContext();
435
+ const effectiveVariant = variant ?? groupContext?.variant ?? "default";
436
+ const effectiveSize = size ?? groupContext?.size;
437
+ const effectiveIsDisabled = isDisabled ?? groupContext?.isDisabled ?? false;
438
+ const isInVerticalGroup = groupContext?.orientation === "vertical";
439
+ const effectiveFullWidth = fullWidth || isInVerticalGroup;
440
+ const positionClassName = itemContext ? buttonGroupItemVariants({
441
+ orientation: groupContext?.orientation ?? "horizontal",
442
+ position: itemContext.position
443
+ }) : "";
444
+ const effectiveVisualSize = visualSize ?? effectiveSize ?? "default";
445
+ if (process.env.NODE_ENV !== "production") {
446
+ if ((effectiveVisualSize === "dot" || effectiveVisualSize === "icon") && !props["aria-label"] && !children) {
447
+ console.warn(
448
+ '[Button] visualSize="dot" or "icon" requires aria-label when no visible text is provided (WCAG 1.1.1)'
449
+ );
450
+ }
451
+ }
452
+ const handlePress = (e) => {
453
+ if (paywall) {
454
+ if (paywallRedirect) {
455
+ window.open(paywallRedirect, "_blank", "noopener,noreferrer");
456
+ }
457
+ return;
458
+ }
459
+ onPress?.(e);
460
+ };
461
+ const computedIsDisabled = effectiveIsDisabled || loading || void 0;
462
+ return /* @__PURE__ */ jsx(
463
+ Button$1,
464
+ {
465
+ ref,
466
+ isDisabled: computedIsDisabled,
467
+ "aria-disabled": paywall ? true : void 0,
468
+ "aria-describedby": paywall ? paywallDescriptionId : void 0,
469
+ onPress: handlePress,
470
+ className: cn(buttonOuterVariants({ fullWidth: effectiveFullWidth, inVerticalGroup: isInVerticalGroup }), className),
471
+ ...props,
472
+ children: (renderProps) => (
473
+ /* Layer 2: Visual Button */
474
+ /* @__PURE__ */ jsxs(
475
+ "span",
476
+ {
477
+ className: cn(
478
+ buttonVisualVariants({
479
+ variant: effectiveVariant,
480
+ visualSize: effectiveVisualSize,
481
+ paywall,
482
+ fullWidth: effectiveFullWidth
483
+ }),
484
+ // Position styling from ButtonGroup context (border-radius adjustments)
485
+ positionClassName,
486
+ buttonVisualClassName,
487
+ // Layer 2 interaction styles (no focus - focus ring is on Layer 1)
488
+ PRESSED_STYLES,
489
+ HOVER_STYLES,
490
+ HIGH_CONTRAST_HOVER,
491
+ HIGH_CONTRAST_PRESSED
492
+ ),
493
+ "data-pressed": renderProps.isPressed || void 0,
494
+ children: [
495
+ loading && /* @__PURE__ */ jsxs(Fragment, { children: [
496
+ /* @__PURE__ */ jsx(Loader2, { className: "motion-safe:animate-spin", "aria-hidden": "true" }),
497
+ /* @__PURE__ */ jsx("span", { className: "sr-only", "aria-live": "polite", children: loadingText })
498
+ ] }),
499
+ !loading && children,
500
+ paywall && /* @__PURE__ */ jsx(
501
+ Zap,
502
+ {
503
+ "data-testid": "zap-icon",
504
+ "aria-hidden": "true",
505
+ className: "ml-1"
506
+ }
507
+ ),
508
+ paywall && /* @__PURE__ */ jsxs("span", { id: paywallDescriptionId, className: "sr-only", children: [
509
+ "Premium feature: ",
510
+ paywallDescription || "Upgrade required to access this feature"
511
+ ] }),
512
+ renderProps.isFocusVisible && shortcut && /* @__PURE__ */ jsx("kbd", { className: "ml-auto hidden text-xs opacity-60 lg:inline", children: shortcut }),
513
+ renderProps.isPressed && /* @__PURE__ */ jsx(
514
+ "span",
515
+ {
516
+ className: "absolute inset-0 rounded-[inherit] bg-current opacity-10 motion-safe:animate-in motion-safe:zoom-in-95",
517
+ "aria-hidden": "true"
518
+ }
519
+ )
520
+ ]
521
+ }
522
+ )
523
+ )
524
+ }
525
+ );
526
+ }
527
+ ));
528
+ Button.displayName = "Button";
529
+ var breadcrumbsVariants = cva("flex items-center flex-wrap", {
530
+ variants: {},
531
+ defaultVariants: {}
532
+ });
533
+ var breadcrumbListVariants = cva(
534
+ "flex flex-wrap items-center gap-1 break-words text-sm text-[var(--menu-muted)]",
535
+ {
536
+ variants: {},
537
+ defaultVariants: {}
538
+ }
539
+ );
540
+ var breadcrumbItemVariants = cva("inline-flex items-center gap-1", {
541
+ variants: {},
542
+ defaultVariants: {}
543
+ });
544
+ var breadcrumbLinkVariants = cva(
545
+ "inline-flex items-center gap-2 min-h-[44px] px-2 rounded-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2",
546
+ {
547
+ variants: {
548
+ state: {
549
+ default: [
550
+ "text-[var(--menu-muted)]",
551
+ "hover:text-[var(--content-foreground)]",
552
+ "hover:underline underline-offset-4"
553
+ ].join(" "),
554
+ current: "text-[var(--content-foreground)] font-medium pointer-events-none",
555
+ disabled: "text-[var(--menu-muted)] opacity-50 cursor-not-allowed pointer-events-none"
556
+ }
557
+ },
558
+ defaultVariants: {
559
+ state: "default"
560
+ }
561
+ }
562
+ );
563
+ var separatorVariants = cva("text-[var(--menu-muted)]", {
564
+ variants: {
565
+ type: {
566
+ chevron: "[&>svg]:h-4 [&>svg]:w-4",
567
+ slash: "mx-2",
568
+ custom: ""
569
+ }
570
+ },
571
+ defaultVariants: {
572
+ type: "chevron"
573
+ }
574
+ });
575
+ var ellipsisButtonVariants = cva(
576
+ "inline-flex items-center justify-center min-h-[44px] min-w-[44px] rounded-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2 hover:bg-[var(--accent)]",
577
+ {
578
+ variants: {},
579
+ defaultVariants: {}
580
+ }
581
+ );
582
+ function isCurrentPage(index, total) {
583
+ return index === total - 1;
584
+ }
585
+ function getCollapsedItems(items, maxItems, itemsBeforeCollapse, itemsAfterCollapse) {
586
+ if (items.length <= maxItems) {
587
+ return null;
588
+ }
589
+ if (itemsBeforeCollapse + itemsAfterCollapse >= items.length) {
590
+ return null;
591
+ }
592
+ const before = items.slice(0, itemsBeforeCollapse);
593
+ const after = items.slice(-itemsAfterCollapse);
594
+ const collapsed = items.slice(itemsBeforeCollapse, items.length - itemsAfterCollapse);
595
+ return { before, collapsed, after };
596
+ }
597
+ function BreadcrumbSeparator({ separator }) {
598
+ if (separator === "chevron") {
599
+ return /* @__PURE__ */ jsx(
600
+ "li",
601
+ {
602
+ role: "presentation",
603
+ "aria-hidden": "true",
604
+ className: separatorVariants({ type: "chevron" }),
605
+ children: /* @__PURE__ */ jsx(ChevronRight, {})
606
+ }
607
+ );
608
+ }
609
+ if (separator === "slash") {
610
+ return /* @__PURE__ */ jsx(
611
+ "li",
612
+ {
613
+ role: "presentation",
614
+ "aria-hidden": "true",
615
+ className: separatorVariants({ type: "slash" }),
616
+ children: "/"
617
+ }
618
+ );
619
+ }
620
+ return /* @__PURE__ */ jsx(
621
+ "li",
622
+ {
623
+ role: "presentation",
624
+ "aria-hidden": "true",
625
+ className: separatorVariants({ type: "custom" }),
626
+ children: separator
627
+ }
628
+ );
629
+ }
630
+ function BreadcrumbLink({
631
+ item,
632
+ isCurrent,
633
+ linkComponent: LinkComponent = "a",
634
+ isGroupDisabled
635
+ }) {
636
+ const isDisabled = isGroupDisabled || item.isDisabled;
637
+ const state = isCurrent ? "current" : isDisabled ? "disabled" : "default";
638
+ if (isCurrent) {
639
+ return /* @__PURE__ */ jsxs(
640
+ "span",
641
+ {
642
+ className: breadcrumbLinkVariants({ state: "current" }),
643
+ "aria-current": "page",
644
+ children: [
645
+ item.icon && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: item.icon }),
646
+ item.label
647
+ ]
648
+ }
649
+ );
650
+ }
651
+ if (!item.href) {
652
+ return /* @__PURE__ */ jsxs(
653
+ "span",
654
+ {
655
+ className: breadcrumbLinkVariants({ state: isDisabled ? "disabled" : "default" }),
656
+ "aria-disabled": isDisabled || void 0,
657
+ children: [
658
+ item.icon && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: item.icon }),
659
+ item.label
660
+ ]
661
+ }
662
+ );
663
+ }
664
+ return /* @__PURE__ */ jsxs(
665
+ LinkComponent,
666
+ {
667
+ href: item.href,
668
+ className: breadcrumbLinkVariants({ state }),
669
+ "aria-disabled": isDisabled || void 0,
670
+ children: [
671
+ item.icon && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: item.icon }),
672
+ item.label
673
+ ]
674
+ }
675
+ );
676
+ }
677
+ function BreadcrumbEllipsis({
678
+ items,
679
+ linkComponent: LinkComponent = "a",
680
+ isGroupDisabled
681
+ }) {
682
+ return /* @__PURE__ */ jsxs(Dropdown, { defaultOpen: false, children: [
683
+ /* @__PURE__ */ jsx(Dropdown.Trigger, { children: /* @__PURE__ */ jsx(
684
+ Button,
685
+ {
686
+ variant: "ghost",
687
+ size: "icon",
688
+ className: ellipsisButtonVariants(),
689
+ "aria-label": "More breadcrumbs",
690
+ children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" })
691
+ }
692
+ ) }),
693
+ /* @__PURE__ */ jsx(Dropdown.Menu, { align: "start", side: "bottom", children: items.map((item) => /* @__PURE__ */ jsx(
694
+ Dropdown.Item,
695
+ {
696
+ isDisabled: isGroupDisabled || item.isDisabled,
697
+ children: /* @__PURE__ */ jsxs(
698
+ LinkComponent,
699
+ {
700
+ href: item.href,
701
+ className: "flex flex-1 items-center gap-2",
702
+ children: [
703
+ item.icon && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: item.icon }),
704
+ item.label
705
+ ]
706
+ }
707
+ )
708
+ },
709
+ item.id
710
+ )) })
711
+ ] });
712
+ }
713
+ var Breadcrumbs = forwardRef(
714
+ ({
715
+ items,
716
+ separator = "chevron",
717
+ maxItems = 4,
718
+ itemsBeforeCollapse = 1,
719
+ itemsAfterCollapse = 2,
720
+ linkComponent,
721
+ isDisabled,
722
+ className,
723
+ "aria-label": ariaLabel = "Breadcrumb",
724
+ ...props
725
+ }, ref) => {
726
+ if (!items || items.length === 0) {
727
+ return null;
728
+ }
729
+ const collapsedData = getCollapsedItems(
730
+ items,
731
+ maxItems,
732
+ itemsBeforeCollapse,
733
+ itemsAfterCollapse
734
+ );
735
+ if (!collapsedData) {
736
+ return /* @__PURE__ */ jsx(
737
+ "nav",
738
+ {
739
+ ref,
740
+ "aria-label": ariaLabel,
741
+ className: cn(breadcrumbsVariants(), className),
742
+ ...props,
743
+ children: /* @__PURE__ */ jsx("ol", { className: breadcrumbListVariants(), children: items.map((item, index) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
744
+ /* @__PURE__ */ jsx("li", { className: breadcrumbItemVariants(), children: /* @__PURE__ */ jsx(
745
+ BreadcrumbLink,
746
+ {
747
+ item,
748
+ isCurrent: isCurrentPage(index, items.length),
749
+ linkComponent,
750
+ isGroupDisabled: isDisabled
751
+ }
752
+ ) }),
753
+ index < items.length - 1 && /* @__PURE__ */ jsx(BreadcrumbSeparator, { separator })
754
+ ] }, item.id)) })
755
+ }
756
+ );
757
+ }
758
+ return /* @__PURE__ */ jsx(
759
+ "nav",
760
+ {
761
+ ref,
762
+ "aria-label": ariaLabel,
763
+ className: cn(breadcrumbsVariants(), className),
764
+ ...props,
765
+ children: /* @__PURE__ */ jsxs("ol", { className: breadcrumbListVariants(), children: [
766
+ collapsedData.before.map((item) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
767
+ /* @__PURE__ */ jsx("li", { className: breadcrumbItemVariants(), children: /* @__PURE__ */ jsx(
768
+ BreadcrumbLink,
769
+ {
770
+ item,
771
+ isCurrent: false,
772
+ linkComponent,
773
+ isGroupDisabled: isDisabled
774
+ }
775
+ ) }),
776
+ /* @__PURE__ */ jsx(BreadcrumbSeparator, { separator })
777
+ ] }, item.id)),
778
+ /* @__PURE__ */ jsx("li", { className: breadcrumbItemVariants(), children: /* @__PURE__ */ jsx(
779
+ BreadcrumbEllipsis,
780
+ {
781
+ items: collapsedData.collapsed,
782
+ linkComponent,
783
+ isGroupDisabled: isDisabled
784
+ }
785
+ ) }),
786
+ /* @__PURE__ */ jsx(BreadcrumbSeparator, { separator }),
787
+ collapsedData.after.map((item, index) => {
788
+ const isLast = index === collapsedData.after.length - 1;
789
+ const globalIndex = items.length - collapsedData.after.length + index;
790
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
791
+ /* @__PURE__ */ jsx("li", { className: breadcrumbItemVariants(), children: /* @__PURE__ */ jsx(
792
+ BreadcrumbLink,
793
+ {
794
+ item,
795
+ isCurrent: isCurrentPage(globalIndex, items.length),
796
+ linkComponent,
797
+ isGroupDisabled: isDisabled
798
+ }
799
+ ) }),
800
+ !isLast && /* @__PURE__ */ jsx(BreadcrumbSeparator, { separator })
801
+ ] }, item.id);
802
+ })
803
+ ] })
804
+ }
805
+ );
806
+ }
807
+ );
808
+ Breadcrumbs.displayName = "Breadcrumbs";
809
+
810
+ export { BreadcrumbItemDataSchema, Breadcrumbs, BreadcrumbsPropsSchema, SeparatorTypeSchema, breadcrumbItemVariants, breadcrumbLinkVariants, breadcrumbListVariants, breadcrumbsVariants, ellipsisButtonVariants, separatorVariants };
8
811
  //# sourceMappingURL=index.mjs.map
9
812
  //# sourceMappingURL=index.mjs.map