@tribepad/themis 1.0.0 → 1.0.2

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 (482) hide show
  1. package/dist/elements/Accordion/index.js +2 -77
  2. package/dist/elements/Accordion/index.js.map +1 -1
  3. package/dist/elements/Accordion/index.mjs +2 -4
  4. package/dist/elements/Accordion/index.mjs.map +1 -1
  5. package/dist/elements/AlertDialog/AlertDialog.d.ts +43 -0
  6. package/dist/elements/AlertDialog/AlertDialog.d.ts.map +1 -0
  7. package/dist/elements/AlertDialog/AlertDialog.styles.d.ts +15 -0
  8. package/dist/elements/AlertDialog/AlertDialog.styles.d.ts.map +1 -0
  9. package/dist/elements/AlertDialog/AlertDialog.types.d.ts +72 -0
  10. package/dist/elements/AlertDialog/AlertDialog.types.d.ts.map +1 -0
  11. package/dist/elements/AlertDialog/index.d.ts +25 -0
  12. package/dist/elements/AlertDialog/index.d.ts.map +1 -0
  13. package/dist/elements/AlertDialog/index.js +3 -0
  14. package/dist/elements/AlertDialog/index.js.map +1 -0
  15. package/dist/elements/AlertDialog/index.mjs +3 -0
  16. package/dist/elements/AlertDialog/index.mjs.map +1 -0
  17. package/dist/elements/Avatar/index.js +2 -53
  18. package/dist/elements/Avatar/index.js.map +1 -1
  19. package/dist/elements/Avatar/index.mjs +2 -4
  20. package/dist/elements/Avatar/index.mjs.map +1 -1
  21. package/dist/elements/Badge/index.js +2 -42
  22. package/dist/elements/Badge/index.js.map +1 -1
  23. package/dist/elements/Badge/index.mjs +2 -5
  24. package/dist/elements/Badge/index.mjs.map +1 -1
  25. package/dist/elements/Breadcrumbs/index.js +2 -53
  26. package/dist/elements/Breadcrumbs/index.js.map +1 -1
  27. package/dist/elements/Breadcrumbs/index.mjs +2 -8
  28. package/dist/elements/Breadcrumbs/index.mjs.map +1 -1
  29. package/dist/elements/Button/Button.d.ts +26 -81
  30. package/dist/elements/Button/Button.d.ts.map +1 -1
  31. package/dist/elements/Button/Button.styles.d.ts +35 -0
  32. package/dist/elements/Button/Button.styles.d.ts.map +1 -0
  33. package/dist/elements/Button/Button.types.d.ts +20 -8
  34. package/dist/elements/Button/Button.types.d.ts.map +1 -1
  35. package/dist/elements/Button/index.js +2 -26
  36. package/dist/elements/Button/index.js.map +1 -1
  37. package/dist/elements/Button/index.mjs +2 -5
  38. package/dist/elements/Button/index.mjs.map +1 -1
  39. package/dist/elements/ButtonGroup/index.js +2 -65
  40. package/dist/elements/ButtonGroup/index.js.map +1 -1
  41. package/dist/elements/ButtonGroup/index.mjs +2 -4
  42. package/dist/elements/ButtonGroup/index.mjs.map +1 -1
  43. package/dist/elements/Card/Card.d.ts.map +1 -1
  44. package/dist/elements/Card/index.js +2 -84
  45. package/dist/elements/Card/index.js.map +1 -1
  46. package/dist/elements/Card/index.mjs +2 -7
  47. package/dist/elements/Card/index.mjs.map +1 -1
  48. package/dist/elements/Carousel/Carousel.d.ts +1 -11
  49. package/dist/elements/Carousel/Carousel.d.ts.map +1 -1
  50. package/dist/elements/Carousel/LazyCarousel.d.ts +1 -1
  51. package/dist/elements/Carousel/LazyCarousel.d.ts.map +1 -1
  52. package/dist/elements/Carousel/index.js +2 -22
  53. package/dist/elements/Carousel/index.js.map +1 -1
  54. package/dist/elements/Carousel/index.mjs +2 -9
  55. package/dist/elements/Carousel/index.mjs.map +1 -1
  56. package/dist/elements/Chart/ChartContext.d.ts.map +1 -1
  57. package/dist/elements/Chart/index.js +2 -46
  58. package/dist/elements/Chart/index.js.map +1 -1
  59. package/dist/elements/Chart/index.mjs +2 -5
  60. package/dist/elements/Chart/index.mjs.map +1 -1
  61. package/dist/elements/Checkbox/index.js +2 -46
  62. package/dist/elements/Checkbox/index.js.map +1 -1
  63. package/dist/elements/Checkbox/index.mjs +2 -5
  64. package/dist/elements/Checkbox/index.mjs.map +1 -1
  65. package/dist/elements/CheckboxGroup/index.js +2 -70
  66. package/dist/elements/CheckboxGroup/index.js.map +1 -1
  67. package/dist/elements/CheckboxGroup/index.mjs +2 -5
  68. package/dist/elements/CheckboxGroup/index.mjs.map +1 -1
  69. package/dist/elements/Combobox/Combobox.d.ts +56 -0
  70. package/dist/elements/Combobox/Combobox.d.ts.map +1 -0
  71. package/dist/elements/Combobox/Combobox.styles.d.ts +29 -0
  72. package/dist/elements/Combobox/Combobox.styles.d.ts.map +1 -0
  73. package/dist/elements/Combobox/Combobox.types.d.ts +67 -0
  74. package/dist/elements/Combobox/Combobox.types.d.ts.map +1 -0
  75. package/dist/elements/Combobox/index.d.ts +20 -0
  76. package/dist/elements/Combobox/index.d.ts.map +1 -0
  77. package/dist/elements/Combobox/index.js +3 -0
  78. package/dist/elements/Combobox/index.js.map +1 -0
  79. package/dist/elements/Combobox/index.mjs +3 -0
  80. package/dist/elements/Combobox/index.mjs.map +1 -0
  81. package/dist/elements/DatePicker/DatePicker.d.ts +1 -1
  82. package/dist/elements/DatePicker/DatePicker.d.ts.map +1 -1
  83. package/dist/elements/DatePicker/index.js +2 -122
  84. package/dist/elements/DatePicker/index.js.map +1 -1
  85. package/dist/elements/DatePicker/index.mjs +2 -5
  86. package/dist/elements/DatePicker/index.mjs.map +1 -1
  87. package/dist/elements/Dropdown/Dropdown.d.ts +7 -15
  88. package/dist/elements/Dropdown/Dropdown.d.ts.map +1 -1
  89. package/dist/elements/Dropdown/Dropdown.styles.d.ts +22 -0
  90. package/dist/elements/Dropdown/Dropdown.styles.d.ts.map +1 -0
  91. package/dist/elements/Dropdown/index.d.ts +1 -0
  92. package/dist/elements/Dropdown/index.d.ts.map +1 -1
  93. package/dist/elements/Dropdown/index.js +2 -40
  94. package/dist/elements/Dropdown/index.js.map +1 -1
  95. package/dist/elements/Dropdown/index.mjs +2 -3
  96. package/dist/elements/Dropdown/index.mjs.map +1 -1
  97. package/dist/elements/FileField/index.js +2 -137
  98. package/dist/elements/FileField/index.js.map +1 -1
  99. package/dist/elements/FileField/index.mjs +2 -8
  100. package/dist/elements/FileField/index.mjs.map +1 -1
  101. package/dist/elements/FormLayout/index.js +2 -16
  102. package/dist/elements/FormLayout/index.js.map +1 -1
  103. package/dist/elements/FormLayout/index.mjs +2 -3
  104. package/dist/elements/FormLayout/index.mjs.map +1 -1
  105. package/dist/elements/Modal/Modal.d.ts +9 -14
  106. package/dist/elements/Modal/Modal.d.ts.map +1 -1
  107. package/dist/elements/Modal/Modal.styles.d.ts +29 -0
  108. package/dist/elements/Modal/Modal.styles.d.ts.map +1 -0
  109. package/dist/elements/Modal/index.d.ts +1 -0
  110. package/dist/elements/Modal/index.d.ts.map +1 -1
  111. package/dist/elements/Modal/index.js +2 -51
  112. package/dist/elements/Modal/index.js.map +1 -1
  113. package/dist/elements/Modal/index.mjs +2 -2
  114. package/dist/elements/Modal/index.mjs.map +1 -1
  115. package/dist/elements/NumberField/index.js +2 -56
  116. package/dist/elements/NumberField/index.js.map +1 -1
  117. package/dist/elements/NumberField/index.mjs +2 -7
  118. package/dist/elements/NumberField/index.mjs.map +1 -1
  119. package/dist/elements/OTPInput/OTPInput.d.ts.map +1 -1
  120. package/dist/elements/OTPInput/index.js +2 -12
  121. package/dist/elements/OTPInput/index.js.map +1 -1
  122. package/dist/elements/OTPInput/index.mjs +2 -3
  123. package/dist/elements/OTPInput/index.mjs.map +1 -1
  124. package/dist/elements/Pagination/Pagination.d.ts +45 -0
  125. package/dist/elements/Pagination/Pagination.d.ts.map +1 -0
  126. package/dist/elements/Pagination/Pagination.styles.d.ts +10 -0
  127. package/dist/elements/Pagination/Pagination.styles.d.ts.map +1 -0
  128. package/dist/elements/Pagination/Pagination.types.d.ts +55 -0
  129. package/dist/elements/Pagination/Pagination.types.d.ts.map +1 -0
  130. package/dist/elements/Pagination/index.d.ts +21 -0
  131. package/dist/elements/Pagination/index.d.ts.map +1 -0
  132. package/dist/elements/Pagination/index.js +3 -0
  133. package/dist/elements/Pagination/index.js.map +1 -0
  134. package/dist/elements/Pagination/index.mjs +3 -0
  135. package/dist/elements/Pagination/index.mjs.map +1 -0
  136. package/dist/elements/Panel/index.js +2 -32
  137. package/dist/elements/Panel/index.js.map +1 -1
  138. package/dist/elements/Panel/index.mjs +2 -3
  139. package/dist/elements/Panel/index.mjs.map +1 -1
  140. package/dist/elements/PasswordField/PasswordField.d.ts +27 -0
  141. package/dist/elements/PasswordField/PasswordField.d.ts.map +1 -0
  142. package/dist/elements/PasswordField/PasswordField.styles.d.ts +32 -0
  143. package/dist/elements/PasswordField/PasswordField.styles.d.ts.map +1 -0
  144. package/dist/elements/PasswordField/PasswordField.types.d.ts +100 -0
  145. package/dist/elements/PasswordField/PasswordField.types.d.ts.map +1 -0
  146. package/dist/elements/PasswordField/index.css +2 -0
  147. package/dist/elements/PasswordField/index.css.map +1 -0
  148. package/dist/elements/PasswordField/index.d.ts +20 -0
  149. package/dist/elements/PasswordField/index.d.ts.map +1 -0
  150. package/dist/elements/PasswordField/index.js +3 -0
  151. package/dist/elements/PasswordField/index.js.map +1 -0
  152. package/dist/elements/PasswordField/index.mjs +3 -0
  153. package/dist/elements/PasswordField/index.mjs.map +1 -0
  154. package/dist/elements/Progress/index.js +2 -29
  155. package/dist/elements/Progress/index.js.map +1 -1
  156. package/dist/elements/Progress/index.mjs +2 -4
  157. package/dist/elements/Progress/index.mjs.map +1 -1
  158. package/dist/elements/RadioGroup/index.js +2 -46
  159. package/dist/elements/RadioGroup/index.js.map +1 -1
  160. package/dist/elements/RadioGroup/index.mjs +2 -5
  161. package/dist/elements/RadioGroup/index.mjs.map +1 -1
  162. package/dist/elements/Resizable/components/ResizableHandle.d.ts +0 -8
  163. package/dist/elements/Resizable/components/ResizableHandle.d.ts.map +1 -1
  164. package/dist/elements/Resizable/components/ResizablePanel.d.ts +0 -8
  165. package/dist/elements/Resizable/components/ResizablePanel.d.ts.map +1 -1
  166. package/dist/elements/Resizable/components/ResizablePanelGroup.d.ts +0 -8
  167. package/dist/elements/Resizable/components/ResizablePanelGroup.d.ts.map +1 -1
  168. package/dist/elements/Resizable/components/ResizablePopover.d.ts +0 -8
  169. package/dist/elements/Resizable/components/ResizablePopover.d.ts.map +1 -1
  170. package/dist/elements/Resizable/index.js +2 -64
  171. package/dist/elements/Resizable/index.js.map +1 -1
  172. package/dist/elements/Resizable/index.mjs +2 -7
  173. package/dist/elements/Resizable/index.mjs.map +1 -1
  174. package/dist/elements/SearchField/SearchField.d.ts +27 -0
  175. package/dist/elements/SearchField/SearchField.d.ts.map +1 -0
  176. package/dist/elements/SearchField/SearchField.styles.d.ts +32 -0
  177. package/dist/elements/SearchField/SearchField.styles.d.ts.map +1 -0
  178. package/dist/elements/SearchField/SearchField.types.d.ts +45 -0
  179. package/dist/elements/SearchField/SearchField.types.d.ts.map +1 -0
  180. package/dist/elements/SearchField/index.css +2 -0
  181. package/dist/elements/SearchField/index.css.map +1 -0
  182. package/dist/elements/SearchField/index.d.ts +21 -0
  183. package/dist/elements/SearchField/index.d.ts.map +1 -0
  184. package/dist/elements/SearchField/index.js +3 -0
  185. package/dist/elements/SearchField/index.js.map +1 -0
  186. package/dist/elements/SearchField/index.mjs +3 -0
  187. package/dist/elements/SearchField/index.mjs.map +1 -0
  188. package/dist/elements/Select/Select.d.ts +19 -48
  189. package/dist/elements/Select/Select.d.ts.map +1 -1
  190. package/dist/elements/Select/Select.styles.d.ts +55 -0
  191. package/dist/elements/Select/Select.styles.d.ts.map +1 -0
  192. package/dist/elements/Select/index.js +2 -32
  193. package/dist/elements/Select/index.js.map +1 -1
  194. package/dist/elements/Select/index.mjs +2 -3
  195. package/dist/elements/Select/index.mjs.map +1 -1
  196. package/dist/elements/Skeleton/index.js +2 -21
  197. package/dist/elements/Skeleton/index.js.map +1 -1
  198. package/dist/elements/Skeleton/index.mjs +2 -4
  199. package/dist/elements/Skeleton/index.mjs.map +1 -1
  200. package/dist/elements/Switch/index.js +2 -48
  201. package/dist/elements/Switch/index.js.map +1 -1
  202. package/dist/elements/Switch/index.mjs +2 -30
  203. package/dist/elements/Switch/index.mjs.map +1 -1
  204. package/dist/elements/Table/Table.d.ts +3 -24
  205. package/dist/elements/Table/Table.d.ts.map +1 -1
  206. package/dist/elements/Table/Table.styles.d.ts +24 -0
  207. package/dist/elements/Table/Table.styles.d.ts.map +1 -0
  208. package/dist/elements/Table/index.js +2 -75
  209. package/dist/elements/Table/index.js.map +1 -1
  210. package/dist/elements/Table/index.mjs +2 -6
  211. package/dist/elements/Table/index.mjs.map +1 -1
  212. package/dist/elements/Tabs/index.js +2 -73
  213. package/dist/elements/Tabs/index.js.map +1 -1
  214. package/dist/elements/Tabs/index.mjs +2 -4
  215. package/dist/elements/Tabs/index.mjs.map +1 -1
  216. package/dist/elements/TextField/TextField.d.ts +6 -42
  217. package/dist/elements/TextField/TextField.d.ts.map +1 -1
  218. package/dist/elements/TextField/TextField.hooks.d.ts +63 -0
  219. package/dist/elements/TextField/TextField.hooks.d.ts.map +1 -0
  220. package/dist/elements/TextField/TextField.icons.d.ts +19 -0
  221. package/dist/elements/TextField/TextField.icons.d.ts.map +1 -0
  222. package/dist/elements/TextField/TextField.styles.d.ts +37 -0
  223. package/dist/elements/TextField/TextField.styles.d.ts.map +1 -0
  224. package/dist/elements/TextField/TextField.types.d.ts +3 -0
  225. package/dist/elements/TextField/TextField.types.d.ts.map +1 -1
  226. package/dist/elements/TextField/index.css +1 -22
  227. package/dist/elements/TextField/index.css.map +1 -1
  228. package/dist/elements/TextField/index.js +2 -259
  229. package/dist/elements/TextField/index.js.map +1 -1
  230. package/dist/elements/TextField/index.mjs +2 -206
  231. package/dist/elements/TextField/index.mjs.map +1 -1
  232. package/dist/elements/TimeField/index.js +2 -44
  233. package/dist/elements/TimeField/index.js.map +1 -1
  234. package/dist/elements/TimeField/index.mjs +2 -3
  235. package/dist/elements/TimeField/index.mjs.map +1 -1
  236. package/dist/elements/Toast/Toast.d.ts +0 -22
  237. package/dist/elements/Toast/Toast.d.ts.map +1 -1
  238. package/dist/elements/Toast/index.js +2 -59
  239. package/dist/elements/Toast/index.js.map +1 -1
  240. package/dist/elements/Toast/index.mjs +2 -6
  241. package/dist/elements/Toast/index.mjs.map +1 -1
  242. package/dist/elements/Tooltip/index.js +2 -58
  243. package/dist/elements/Tooltip/index.js.map +1 -1
  244. package/dist/elements/Tooltip/index.mjs +2 -5
  245. package/dist/elements/Tooltip/index.mjs.map +1 -1
  246. package/dist/elements/index.css +1 -22
  247. package/dist/elements/index.css.map +1 -1
  248. package/dist/elements/index.d.ts +13 -1
  249. package/dist/elements/index.d.ts.map +1 -1
  250. package/dist/elements/index.js +2 -838
  251. package/dist/elements/index.js.map +1 -1
  252. package/dist/elements/index.mjs +2 -41
  253. package/dist/elements/index.mjs.map +1 -1
  254. package/dist/index.css +1 -22
  255. package/dist/index.css.map +1 -1
  256. package/dist/index.js +3 -864
  257. package/dist/index.js.map +1 -1
  258. package/dist/index.mjs +3 -43
  259. package/dist/index.mjs.map +1 -1
  260. package/dist/schemas/index.js +2 -28
  261. package/dist/schemas/index.js.map +1 -1
  262. package/dist/schemas/index.mjs +2 -3
  263. package/dist/schemas/index.mjs.map +1 -1
  264. package/dist/styles/defaults.css +151 -0
  265. package/dist/styles/index.js +1 -152
  266. package/dist/styles/index.js.map +1 -1
  267. package/dist/styles/index.mjs +1 -3
  268. package/dist/styles/index.mjs.map +1 -1
  269. package/dist/utils/index.js +1 -12
  270. package/dist/utils/index.js.map +1 -1
  271. package/dist/utils/index.mjs +1 -3
  272. package/dist/utils/index.mjs.map +1 -1
  273. package/package.json +9 -7
  274. package/src/elements/Accordion/Accordion.stories.tsx +1 -1
  275. package/src/elements/AlertDialog/AlertDialog.stories.tsx +124 -0
  276. package/src/elements/Avatar/Avatar.stories.tsx +1 -1
  277. package/src/elements/Badge/Badge.stories.tsx +1 -1
  278. package/src/elements/Breadcrumbs/Breadcrumbs.stories.tsx +1 -1
  279. package/src/elements/Button/Button.stories.tsx +1 -1
  280. package/src/elements/ButtonGroup/ButtonGroup.stories.tsx +1 -1
  281. package/src/elements/Card/Card.stories.tsx +1 -1
  282. package/src/elements/Carousel/Carousel.stories.tsx +1 -1
  283. package/src/elements/Chart/Chart.stories.tsx +1 -1
  284. package/src/elements/Checkbox/Checkbox.stories.tsx +1 -1
  285. package/src/elements/CheckboxGroup/CheckboxGroup.stories.tsx +1 -1
  286. package/src/elements/Combobox/Combobox.stories.tsx +133 -0
  287. package/src/elements/DatePicker/DatePicker.stories.tsx +1 -1
  288. package/src/elements/Dropdown/Dropdown.stories.tsx +1 -1
  289. package/src/elements/FileField/FileField.stories.tsx +1 -1
  290. package/src/elements/FileField/FileProgress.stories.tsx +1 -1
  291. package/src/elements/FormLayout/FormLayout.stories.tsx +1 -1
  292. package/src/elements/Modal/Modal.stories.tsx +1 -1
  293. package/src/elements/NumberField/NumberField.stories.tsx +1 -1
  294. package/src/elements/OTPInput/OTPInput.stories.tsx +1 -1
  295. package/src/elements/Pagination/Pagination.stories.tsx +203 -0
  296. package/src/elements/Panel/Panel.stories.tsx +1 -1
  297. package/src/elements/PasswordField/PasswordField.stories.tsx +167 -0
  298. package/src/elements/Progress/Progress.stories.tsx +1 -1
  299. package/src/elements/RadioGroup/RadioGroup.stories.tsx +1 -1
  300. package/src/elements/Resizable/Resizable.stories.tsx +1 -1
  301. package/src/elements/SearchField/SearchField.stories.tsx +146 -0
  302. package/src/elements/Select/Select.stories.tsx +1 -1
  303. package/src/elements/Skeleton/Skeleton.stories.tsx +1 -1
  304. package/src/elements/Switch/Switch.stories.tsx +1 -1
  305. package/src/elements/Table/Table.stories.tsx +1 -1
  306. package/src/elements/Tabs/Tabs.stories.tsx +1 -1
  307. package/src/elements/TextField/TextField.stories.tsx +1 -1
  308. package/src/elements/TimeField/TimeField.stories.tsx +1 -1
  309. package/src/elements/Toast/Toast.stories.tsx +1 -1
  310. package/src/elements/Tooltip/Tooltip.stories.tsx +1 -1
  311. package/dist/Carousel-NTZX5TOW.js +0 -16
  312. package/dist/Carousel-NTZX5TOW.js.map +0 -1
  313. package/dist/Carousel-YH3DOQJU.mjs +0 -7
  314. package/dist/Carousel-YH3DOQJU.mjs.map +0 -1
  315. package/dist/chunk-2HIUTHMU.mjs +0 -234
  316. package/dist/chunk-2HIUTHMU.mjs.map +0 -1
  317. package/dist/chunk-34GTFTDO.js +0 -431
  318. package/dist/chunk-34GTFTDO.js.map +0 -1
  319. package/dist/chunk-3H7ASYR7.js +0 -250
  320. package/dist/chunk-3H7ASYR7.js.map +0 -1
  321. package/dist/chunk-3IEN7JOP.js +0 -316
  322. package/dist/chunk-3IEN7JOP.js.map +0 -1
  323. package/dist/chunk-3JHN4GAL.js +0 -326
  324. package/dist/chunk-3JHN4GAL.js.map +0 -1
  325. package/dist/chunk-3MJPASQU.js +0 -232
  326. package/dist/chunk-3MJPASQU.js.map +0 -1
  327. package/dist/chunk-3XD2JUL3.js +0 -572
  328. package/dist/chunk-3XD2JUL3.js.map +0 -1
  329. package/dist/chunk-3YOY2VJ6.js +0 -189
  330. package/dist/chunk-3YOY2VJ6.js.map +0 -1
  331. package/dist/chunk-4DU5JSXB.js +0 -408
  332. package/dist/chunk-4DU5JSXB.js.map +0 -1
  333. package/dist/chunk-4E4E2GSS.js +0 -352
  334. package/dist/chunk-4E4E2GSS.js.map +0 -1
  335. package/dist/chunk-4NHAP4AN.mjs +0 -3
  336. package/dist/chunk-4NHAP4AN.mjs.map +0 -1
  337. package/dist/chunk-4S33J5NY.mjs +0 -415
  338. package/dist/chunk-4S33J5NY.mjs.map +0 -1
  339. package/dist/chunk-5SMGRT3G.mjs +0 -354
  340. package/dist/chunk-5SMGRT3G.mjs.map +0 -1
  341. package/dist/chunk-5SVLJN2C.mjs +0 -22
  342. package/dist/chunk-5SVLJN2C.mjs.map +0 -1
  343. package/dist/chunk-66WTU4EB.mjs +0 -299
  344. package/dist/chunk-66WTU4EB.mjs.map +0 -1
  345. package/dist/chunk-6S25NMOT.mjs +0 -335
  346. package/dist/chunk-6S25NMOT.mjs.map +0 -1
  347. package/dist/chunk-6SP7UB3D.js +0 -4
  348. package/dist/chunk-6SP7UB3D.js.map +0 -1
  349. package/dist/chunk-6TYWWQHM.mjs +0 -565
  350. package/dist/chunk-6TYWWQHM.mjs.map +0 -1
  351. package/dist/chunk-A3YUJA6W.mjs +0 -384
  352. package/dist/chunk-A3YUJA6W.mjs.map +0 -1
  353. package/dist/chunk-A6KEDVUR.js +0 -61
  354. package/dist/chunk-A6KEDVUR.js.map +0 -1
  355. package/dist/chunk-A77RUEWL.js +0 -730
  356. package/dist/chunk-A77RUEWL.js.map +0 -1
  357. package/dist/chunk-AA4IKMPE.mjs +0 -3
  358. package/dist/chunk-AA4IKMPE.mjs.map +0 -1
  359. package/dist/chunk-AKIA6GW6.mjs +0 -163
  360. package/dist/chunk-AKIA6GW6.mjs.map +0 -1
  361. package/dist/chunk-AL6P275L.mjs +0 -435
  362. package/dist/chunk-AL6P275L.mjs.map +0 -1
  363. package/dist/chunk-AZ3RJYTB.js +0 -37
  364. package/dist/chunk-AZ3RJYTB.js.map +0 -1
  365. package/dist/chunk-B5Q4UPL6.js +0 -32
  366. package/dist/chunk-B5Q4UPL6.js.map +0 -1
  367. package/dist/chunk-B6DHPMDP.mjs +0 -335
  368. package/dist/chunk-B6DHPMDP.mjs.map +0 -1
  369. package/dist/chunk-BDXKKMBZ.mjs +0 -184
  370. package/dist/chunk-BDXKKMBZ.mjs.map +0 -1
  371. package/dist/chunk-BL6E2DLZ.mjs +0 -52
  372. package/dist/chunk-BL6E2DLZ.mjs.map +0 -1
  373. package/dist/chunk-CGFDS4XS.mjs +0 -121
  374. package/dist/chunk-CGFDS4XS.mjs.map +0 -1
  375. package/dist/chunk-CJIW5TKI.js +0 -139
  376. package/dist/chunk-CJIW5TKI.js.map +0 -1
  377. package/dist/chunk-CKNISJOQ.js +0 -314
  378. package/dist/chunk-CKNISJOQ.js.map +0 -1
  379. package/dist/chunk-D6CBOECS.mjs +0 -1757
  380. package/dist/chunk-D6CBOECS.mjs.map +0 -1
  381. package/dist/chunk-DDWEVC2S.js +0 -166
  382. package/dist/chunk-DDWEVC2S.js.map +0 -1
  383. package/dist/chunk-DZ556D2F.mjs +0 -176
  384. package/dist/chunk-DZ556D2F.mjs.map +0 -1
  385. package/dist/chunk-E2KQFV3O.mjs +0 -10
  386. package/dist/chunk-E2KQFV3O.mjs.map +0 -1
  387. package/dist/chunk-EMMLADSC.js +0 -126
  388. package/dist/chunk-EMMLADSC.js.map +0 -1
  389. package/dist/chunk-EP4WOI5D.mjs +0 -926
  390. package/dist/chunk-EP4WOI5D.mjs.map +0 -1
  391. package/dist/chunk-FJRXLJC2.mjs +0 -160
  392. package/dist/chunk-FJRXLJC2.mjs.map +0 -1
  393. package/dist/chunk-FKQI434R.js +0 -345
  394. package/dist/chunk-FKQI434R.js.map +0 -1
  395. package/dist/chunk-FPKEAJRZ.mjs +0 -100
  396. package/dist/chunk-FPKEAJRZ.mjs.map +0 -1
  397. package/dist/chunk-FWQYB22U.js +0 -183
  398. package/dist/chunk-FWQYB22U.js.map +0 -1
  399. package/dist/chunk-GD5GHTMA.js +0 -189
  400. package/dist/chunk-GD5GHTMA.js.map +0 -1
  401. package/dist/chunk-GE5XTSDZ.js +0 -447
  402. package/dist/chunk-GE5XTSDZ.js.map +0 -1
  403. package/dist/chunk-GVE47ZAX.mjs +0 -32
  404. package/dist/chunk-GVE47ZAX.mjs.map +0 -1
  405. package/dist/chunk-HK46BT5U.mjs +0 -18
  406. package/dist/chunk-HK46BT5U.mjs.map +0 -1
  407. package/dist/chunk-HQVRMR6N.js +0 -365
  408. package/dist/chunk-HQVRMR6N.js.map +0 -1
  409. package/dist/chunk-HSGBJPJO.mjs +0 -398
  410. package/dist/chunk-HSGBJPJO.mjs.map +0 -1
  411. package/dist/chunk-I3AUTOMZ.mjs +0 -125
  412. package/dist/chunk-I3AUTOMZ.mjs.map +0 -1
  413. package/dist/chunk-IEI5LD5C.mjs +0 -1161
  414. package/dist/chunk-IEI5LD5C.mjs.map +0 -1
  415. package/dist/chunk-IIPTC2X7.mjs +0 -118
  416. package/dist/chunk-IIPTC2X7.mjs.map +0 -1
  417. package/dist/chunk-J7TLHF2Q.js +0 -4
  418. package/dist/chunk-J7TLHF2Q.js.map +0 -1
  419. package/dist/chunk-JJOWXFXQ.mjs +0 -765
  420. package/dist/chunk-JJOWXFXQ.mjs.map +0 -1
  421. package/dist/chunk-JPTSS2OA.mjs +0 -3
  422. package/dist/chunk-JPTSS2OA.mjs.map +0 -1
  423. package/dist/chunk-KFXXRLTP.js +0 -396
  424. package/dist/chunk-KFXXRLTP.js.map +0 -1
  425. package/dist/chunk-KPRRBSG6.mjs +0 -272
  426. package/dist/chunk-KPRRBSG6.mjs.map +0 -1
  427. package/dist/chunk-NFSBGRDB.mjs +0 -57
  428. package/dist/chunk-NFSBGRDB.mjs.map +0 -1
  429. package/dist/chunk-NGJVCFTM.js +0 -219
  430. package/dist/chunk-NGJVCFTM.js.map +0 -1
  431. package/dist/chunk-NSQ6MZJ6.mjs +0 -728
  432. package/dist/chunk-NSQ6MZJ6.mjs.map +0 -1
  433. package/dist/chunk-NYQYHT76.mjs +0 -296
  434. package/dist/chunk-NYQYHT76.mjs.map +0 -1
  435. package/dist/chunk-OLJJGI5B.js +0 -1193
  436. package/dist/chunk-OLJJGI5B.js.map +0 -1
  437. package/dist/chunk-Q3572X2J.js +0 -292
  438. package/dist/chunk-Q3572X2J.js.map +0 -1
  439. package/dist/chunk-QH7N7D4I.mjs +0 -210
  440. package/dist/chunk-QH7N7D4I.mjs.map +0 -1
  441. package/dist/chunk-R7XUIV25.js +0 -466
  442. package/dist/chunk-R7XUIV25.js.map +0 -1
  443. package/dist/chunk-RFFO4KPM.js +0 -135
  444. package/dist/chunk-RFFO4KPM.js.map +0 -1
  445. package/dist/chunk-RFX7QKA7.mjs +0 -180
  446. package/dist/chunk-RFX7QKA7.mjs.map +0 -1
  447. package/dist/chunk-SN5LFAP3.js +0 -940
  448. package/dist/chunk-SN5LFAP3.js.map +0 -1
  449. package/dist/chunk-T4COXKQ3.js +0 -24
  450. package/dist/chunk-T4COXKQ3.js.map +0 -1
  451. package/dist/chunk-TS54QM27.js +0 -125
  452. package/dist/chunk-TS54QM27.js.map +0 -1
  453. package/dist/chunk-UE2S4PCX.mjs +0 -220
  454. package/dist/chunk-UE2S4PCX.mjs.map +0 -1
  455. package/dist/chunk-UTW3QX2A.mjs +0 -282
  456. package/dist/chunk-UTW3QX2A.mjs.map +0 -1
  457. package/dist/chunk-V74LGMAE.js +0 -1767
  458. package/dist/chunk-V74LGMAE.js.map +0 -1
  459. package/dist/chunk-VIREG536.js +0 -12
  460. package/dist/chunk-VIREG536.js.map +0 -1
  461. package/dist/chunk-VY7M7346.js +0 -4
  462. package/dist/chunk-VY7M7346.js.map +0 -1
  463. package/dist/chunk-W3TJOO7H.mjs +0 -319
  464. package/dist/chunk-W3TJOO7H.mjs.map +0 -1
  465. package/dist/chunk-WIUOB36M.js +0 -54
  466. package/dist/chunk-WIUOB36M.js.map +0 -1
  467. package/dist/chunk-WJGLM4CY.js +0 -291
  468. package/dist/chunk-WJGLM4CY.js.map +0 -1
  469. package/dist/chunk-WNURH5OO.mjs +0 -453
  470. package/dist/chunk-WNURH5OO.mjs.map +0 -1
  471. package/dist/chunk-X25TNRSD.mjs +0 -364
  472. package/dist/chunk-X25TNRSD.mjs.map +0 -1
  473. package/dist/chunk-Y3GT7ETK.js +0 -108
  474. package/dist/chunk-Y3GT7ETK.js.map +0 -1
  475. package/dist/chunk-Z4FRNOF6.mjs +0 -115
  476. package/dist/chunk-Z4FRNOF6.mjs.map +0 -1
  477. package/dist/chunk-ZMYLD3BN.js +0 -166
  478. package/dist/chunk-ZMYLD3BN.js.map +0 -1
  479. package/dist/chunk-ZP2KV6EX.js +0 -815
  480. package/dist/chunk-ZP2KV6EX.js.map +0 -1
  481. package/dist/chunk-ZVKXFELU.js +0 -366
  482. package/dist/chunk-ZVKXFELU.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
1
+ {"version":3,"sources":["../../../src/utils/cn.ts","../../../src/elements/Button/Button.styles.ts","../../../src/styles/interaction-states.ts","../../../src/elements/ButtonGroup/ButtonGroupContext.tsx","../../../src/elements/ButtonGroup/ButtonGroup.variants.ts","../../../src/elements/Button/Button.tsx"],"names":["cn","inputs","twMerge","clsx","buttonOuterVariants","cva","buttonVisualVariants","buttonVariants","PRESSED_STYLES","HOVER_STYLES","HIGH_CONTRAST_HOVER","HIGH_CONTRAST_PRESSED","ButtonGroupContext","createContext","useButtonGroupContext","useContext","ButtonGroupItemContext","useButtonGroupItemContext","buttonGroupItemVariants","Button","memo","forwardRef","className","buttonVisualClassName","variant","size","visualSize","fullWidth","loading","loadingText","shortcut","children","isDisabled","paywall","paywallRedirect","paywallDescription","onPress","props","ref","paywallDescriptionId","useId","groupContext","itemContext","effectiveVariant","effectiveSize","effectiveIsDisabled","isInVerticalGroup","effectiveFullWidth","positionClassName","effectiveVisualSize","jsx","AriaButton","e","renderProps","jsxs","Fragment","Loader2","Zap"],"mappings":"+SAcO,SAASA,CAAAA,CAAAA,GAAMC,CAAAA,CAA8B,CAClD,OAAOC,OAAAA,CAAQC,IAAAA,CAAKF,CAAM,CAAC,CAC7B,CCLO,IAAMG,CAAAA,CAAsBC,IACjC,yPAAA,CACA,CACE,QAAA,CAAU,CACR,UAAW,CACT,IAAA,CAAM,QAAA,CACN,KAAA,CAAO,EACT,CAAA,CACA,eAAA,CAAiB,CACf,IAAA,CAAM,gBACN,KAAA,CAAO,cACT,CACF,CAAA,CACA,gBAAiB,CACf,SAAA,CAAW,KAAA,CACX,eAAA,CAAiB,KACnB,CACF,CACF,CAAA,CAQaC,CAAAA,CAAuBD,IAClC,6NAAA,CACA,CACE,QAAA,CAAU,CACR,OAAA,CAAS,CACP,OAAA,CACE,kKAAA,CACF,YACE,oLAAA,CACF,OAAA,CACE,wIAAA,CACF,SAAA,CACE,4IACF,KAAA,CACE,kGAAA,CACF,IAAA,CAAM,yGACR,EACA,SAAA,CAAW,CACT,IAAA,CAAM,QAAA,CACN,MAAO,EACT,CAAA,CACA,UAAA,CAAY,CACV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utility\n * Merges Tailwind CSS classes with conflict resolution\n *\n * Combines clsx for conditional classes and tailwind-merge for deduplication\n *\n * @example\n * cn('px-2 py-1', 'px-4') // => 'py-1 px-4' (px-4 overrides px-2)\n * cn('text-red-500', condition && 'text-blue-500') // => conditional application\n */\n\nimport { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","import { cva } from 'class-variance-authority';\n\n/**\n * Layer 1: Transparent outer touch target (44x44px minimum)\n * Handles WCAG 2.2 AAA touch target requirement\n * Always transparent, centers the visual button inside\n * IMPORTANT: Focus ring stays on Layer 1 for AAA compliance (2.4.13)\n *\n * In vertical ButtonGroups, uses items-stretch so the visual layer (Layer 2)\n * can fill the full touch target height, eliminating gaps between buttons.\n */\nexport const buttonOuterVariants = cva(\n \"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\",\n {\n variants: {\n fullWidth: {\n true: \"w-full\",\n false: \"\",\n },\n inVerticalGroup: {\n true: \"items-stretch\",\n false: \"items-center\",\n },\n },\n defaultVariants: {\n fullWidth: false,\n inVerticalGroup: false,\n },\n }\n);\n\n/**\n * Layer 2: Visual button appearance (adjustable size)\n * Provides the visual appearance with configurable size\n * Can be smaller than touch target for use cases like carousel dots\n * NOTE: NO focus-visible styles here - focus ring is on Layer 1\n */\nexport const buttonVisualVariants = cva(\n \"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\",\n {\n variants: {\n variant: {\n default:\n \"bg-[var(--primary-action)] text-[var(--primary-action-foreground)] shadow-md hover:bg-[var(--primary-action-hover)] data-[pressed]:bg-[var(--primary-action)]/80\",\n destructive:\n \"bg-[var(--destructive-background)] text-[var(--destructive-foreground)] shadow-md hover:bg-[var(--destructive-background)]/90 data-[pressed]:bg-[var(--destructive-background)]/80\",\n outline:\n \"border border-[var(--input-border)] bg-[var(--page-background)] hover:bg-[var(--input-border)] data-[pressed]:bg-[var(--input-border)]\",\n secondary:\n \"bg-[var(--secondary)] text-[var(--secondary-foreground)] shadow-md hover:bg-[var(--secondary)]/80 data-[pressed]:bg-[var(--secondary)]/70\",\n ghost:\n \"hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)] data-[pressed]:bg-[var(--accent)]\",\n link: \"text-[var(--text-link)] underline-offset-4 hover:underline data-[pressed]:text-[var(--text-link-hover)]\",\n },\n fullWidth: {\n true: \"w-full\",\n false: \"\",\n },\n visualSize: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3 text-xs\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-10 w-10\",\n dot: \"h-5 w-5 rounded-full p-0 min-h-0 min-w-0\",\n },\n paywall: {\n true: \"!bg-[var(--paywall)] !text-[var(--paywall-foreground)] !shadow-md hover:!bg-[var(--paywall)]/90 !cursor-not-allowed !border-transparent\",\n false: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n visualSize: \"default\",\n paywall: false,\n },\n }\n);\n\n/**\n * @deprecated Use buttonVisualVariants instead. This alias is kept for backward compatibility.\n */\nexport const buttonVariants = buttonVisualVariants;\n","/**\n * Global Interaction State Styles\n *\n * Consistent interaction patterns across all Themis components.\n * These styles ensure WCAG 2.2 AAA compliance and predictable UX.\n *\n * @see spec.md FR-010 (Visible focus ring for keyboard navigation)\n * @see spec.md FR-031 (Pressed state feedback)\n * @see spec.md FR-012 (High contrast mode support)\n * @see constitution.md Principle IV (Accessibility First)\n */\n\n/**\n * Focus state styles (FR-010)\n * Visible focus ring for keyboard navigation - WCAG 2.2 Level AAA\n *\n * Components can override by extending these styles:\n * @example\n * cn(FOCUS_STYLES, \"ring-4\") // Increases ring width to 4px\n */\nexport const FOCUS_STYLES = \"data-[focus-visible]:ring-2 data-[focus-visible]:ring-[var(--themis-ring)] data-[focus-visible]:ring-offset-2\";\n\n/**\n * Pressed/Active state styles (FR-031)\n * Visual feedback for press interactions\n *\n * Components can override the scale amount:\n * @example\n * cn(PRESSED_STYLES_BASE, \"data-[pressed]:scale-[0.95]\") // More pronounced scale\n */\nexport const PRESSED_STYLES = \"data-[pressed]:scale-[0.97]\";\n\n/**\n * Base pressed styles without scale (for components that need different feedback)\n */\nexport const PRESSED_STYLES_BASE = \"data-[pressed]:transition-transform data-[pressed]:duration-100\";\n\n/**\n * Hover state styles\n * Elevation change on hover for better affordance\n *\n * Components can override shadow depth:\n * @example\n * cn(HOVER_STYLES_BASE, \"data-[hovered]:shadow-lg\") // Larger shadow\n */\nexport const HOVER_STYLES = \"data-[hovered]:shadow-md\";\n\n/**\n * Base hover styles without shadow (for components that use different hover effects)\n */\nexport const HOVER_STYLES_BASE = \"data-[hovered]:transition-shadow data-[hovered]:duration-200\";\n\n/**\n * High contrast mode focus (FR-012)\n * Enhanced outlines for users requiring high contrast\n *\n * Uses 'hc:' prefix for prefers-contrast: more media query\n */\nexport const HIGH_CONTRAST_FOCUS = \"hc:data-[focus-visible]:outline hc:data-[focus-visible]:outline-4 hc:data-[focus-visible]:outline-offset-2 hc:data-[focus-visible]:outline-foreground\";\n\n/**\n * High contrast mode hover (FR-012)\n * Enhanced outlines for hover in high contrast mode\n */\nexport const HIGH_CONTRAST_HOVER = \"hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground\";\n\n/**\n * High contrast mode pressed state\n * Enhanced outlines for pressed state in high contrast mode\n */\nexport const HIGH_CONTRAST_PRESSED = \"hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground\";\n\n/**\n * Combined high contrast styles\n * Use this for components that need all high contrast interaction states\n */\nexport const HIGH_CONTRAST_INTERACTIONS = `${HIGH_CONTRAST_FOCUS} ${HIGH_CONTRAST_HOVER} ${HIGH_CONTRAST_PRESSED}`;\n\n/**\n * Disabled state styles\n * Consistent disabled appearance across all components\n */\nexport const DISABLED_STYLES = \"disabled:pointer-events-none disabled:opacity-50\";\n\n/**\n * Default interaction bundle\n * Most common combination for interactive components\n *\n * Includes: focus ring, pressed scale, hover shadow, high contrast enhancements\n *\n * @example\n * <button className={cn(DEFAULT_INTERACTIONS, \"bg-primary\")}>Click</button>\n */\nexport const DEFAULT_INTERACTIONS = `${FOCUS_STYLES} ${PRESSED_STYLES} ${HOVER_STYLES} ${HIGH_CONTRAST_FOCUS} ${HIGH_CONTRAST_HOVER} ${HIGH_CONTRAST_PRESSED}`;\n\n/**\n * Subtle interaction bundle\n * For components that need less pronounced feedback\n *\n * Includes: focus ring and high contrast, but no hover shadow or pressed scale\n */\nexport const SUBTLE_INTERACTIONS = `${FOCUS_STYLES} ${HIGH_CONTRAST_FOCUS}`;\n\n/**\n * Non-interactive element styles\n * For elements that should indicate they are not interactive\n */\nexport const NON_INTERACTIVE = \"cursor-default select-none\";\n","\"use client\";\n\nimport { createContext, useContext } from 'react';\nimport type {\n ButtonGroupContextValue,\n ButtonGroupItemContextValue,\n} from './ButtonGroup.types';\n\n/**\n * ButtonGroup Context System (Two-Level)\n *\n * Provides a two-level context pattern for ButtonGroup:\n *\n * 1. ButtonGroupContext (group-level):\n * - Provides: orientation, variant, size, isDisabled\n * - Consumed by: Button (for prop inheritance), Separator (for orientation)\n *\n * 2. ButtonGroupItemContext (item-level):\n * - Provides: position ('first' | 'middle' | 'last' | 'only')\n * - Consumed by: Button (for border-radius styling)\n *\n * Both contexts return null when not in a provider, allowing Button\n * to work standalone without any group context.\n *\n * @see plan.md for architecture details\n * @see ButtonGroup.tsx for Provider implementation\n */\n\n// =============================================================================\n// Group-Level Context\n// =============================================================================\n\n/**\n * Context for group-level props (orientation, variant, size, isDisabled)\n * Default value is null to indicate \"not in a group\"\n */\nconst ButtonGroupContext = createContext<ButtonGroupContextValue | null>(null);\n\nButtonGroupContext.displayName = 'ButtonGroupContext';\n\n/**\n * Hook to access group-level context\n * @returns ButtonGroupContextValue if inside a ButtonGroup, null otherwise\n */\nexport function useButtonGroupContext(): ButtonGroupContextValue | null {\n return useContext(ButtonGroupContext);\n}\n\n// =============================================================================\n// Item-Level Context\n// =============================================================================\n\n/**\n * Context for per-button position information\n * Default value is null to indicate \"not wrapped with position context\"\n */\nconst ButtonGroupItemContext =\n createContext<ButtonGroupItemContextValue | null>(null);\n\nButtonGroupItemContext.displayName = 'ButtonGroupItemContext';\n\n/**\n * Hook to access item-level context (position)\n * @returns ButtonGroupItemContextValue if wrapped with position context, null otherwise\n */\nexport function useButtonGroupItemContext(): ButtonGroupItemContextValue | null {\n return useContext(ButtonGroupItemContext);\n}\n\n// =============================================================================\n// Exports\n// =============================================================================\n\nexport { ButtonGroupContext, ButtonGroupItemContext };\n","import { cva } from 'class-variance-authority';\n\n/**\n * ButtonGroup CVA Variants\n *\n * Defines Class Variance Authority (CVA) variants for:\n * - ButtonGroup container (orientation-based layout)\n * - ButtonGroupItem (position-based border-radius)\n * - ButtonGroupSeparator (orientation-based styling)\n *\n * @see plan.md Phase 1: Design & Contracts - CVA Variants\n * @see constitution.md Principle V (Component Quality Standards)\n */\n\n// =============================================================================\n// Container Variants\n// =============================================================================\n\n/**\n * ButtonGroup container variants\n * Controls the layout direction based on orientation\n * Uses gap-0 to ensure buttons are connected (share borders)\n */\nexport const buttonGroupVariants = cva('inline-flex items-center gap-0', {\n variants: {\n orientation: {\n horizontal: 'flex-row',\n vertical: 'flex-col w-full',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n },\n});\n\n// =============================================================================\n// Item Position Variants\n// =============================================================================\n\n/**\n * ButtonGroupItem position variants\n * Applied to Button's visual layer (Layer 2) for position-aware border-radius\n *\n * Compound variants handle both orientation and position combinations:\n * - Horizontal: left/right borders and radii\n * - Vertical: top/bottom borders and radii\n */\nexport const buttonGroupItemVariants = cva('', {\n variants: {\n orientation: {\n // min-w-[44px] ensures visual layer fills touch target width (for icon buttons)\n horizontal: 'min-w-[44px]',\n // flex (overrides inline-flex) + min-h-[44px] makes visual layer fill touch target,\n // eliminating gaps between stacked buttons in vertical orientation\n vertical: 'flex min-h-[44px]',\n },\n position: {\n first: '',\n middle: '',\n last: '',\n only: '', // Single button - no modifications needed\n },\n },\n compoundVariants: [\n // ==========================================================================\n // Horizontal Orientation\n // ==========================================================================\n {\n orientation: 'horizontal',\n position: 'first',\n className: 'rounded-r-none border-r-0',\n },\n {\n orientation: 'horizontal',\n position: 'middle',\n className: 'rounded-none border-r-0',\n },\n {\n orientation: 'horizontal',\n position: 'last',\n className: 'rounded-l-none',\n },\n // ==========================================================================\n // Vertical Orientation\n // Note: w-full is handled by Button's effectiveFullWidth for both layers\n // ==========================================================================\n {\n orientation: 'vertical',\n position: 'first',\n className: 'rounded-b-none border-b-0',\n },\n {\n orientation: 'vertical',\n position: 'middle',\n className: 'rounded-none border-b-0',\n },\n {\n orientation: 'vertical',\n position: 'last',\n className: 'rounded-t-none',\n },\n ],\n defaultVariants: {\n orientation: 'horizontal',\n position: 'only',\n },\n});\n\n// =============================================================================\n// Separator Variants\n// =============================================================================\n\n/**\n * ButtonGroupSeparator variants\n * Orientation-aware visual divider between button groups\n */\nexport const buttonGroupSeparatorVariants = cva('bg-[var(--border)]', {\n variants: {\n orientation: {\n horizontal: 'w-px h-6 mx-1',\n vertical: 'h-px w-full my-1',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n },\n});\n","\"use client\";\n\n/**\n * Button Component - 3-Layer Architecture\n * Accessible button with React Aria primitives and CVA styling\n *\n * Architecture:\n * - Layer 1: Touch Target (44x44px WCAG AAA compliant, transparent)\n * - Layer 2: Visual Button (configurable size, colors, borders)\n * - Layer 3: Content & Effects (text, icons, ripple, loading spinner)\n *\n * @see 3layer-plan.md for architecture details\n * @see spec.md FR-029 to FR-037 (Button Component Requirements)\n * @see spec.md FR-009 (WCAG 2.2 AAA - 7:1 contrast ratio)\n * @see spec.md FR-014 (44x44px minimum touch targets)\n * @see constitution.md Principle IV (Accessibility First)\n */\n\nimport { forwardRef, memo, useId } from 'react';\nimport {\n Button as AriaButton,\n type ButtonProps as AriaButtonProps,\n} from 'react-aria-components';\nimport { Loader2, Zap } from 'lucide-react';\nimport { cn } from '../../utils/cn';\nimport type { ButtonProps } from './Button.types';\nimport { buttonOuterVariants, buttonVisualVariants, buttonVariants } from './Button.styles';\nimport { PRESSED_STYLES, HOVER_STYLES, HIGH_CONTRAST_HOVER, HIGH_CONTRAST_PRESSED } from '../../styles/interaction-states';\nimport {\n useButtonGroupContext,\n useButtonGroupItemContext,\n} from '../ButtonGroup/ButtonGroupContext';\nimport { buttonGroupItemVariants } from '../ButtonGroup/ButtonGroup.variants';\n\n/**\n * Button Component - 3-Layer Architecture\n * Fully accessible button with React Aria and themed styling\n *\n * Layer 1: Touch Target (AriaButton) - 44x44px WCAG AAA compliant\n * Layer 2: Visual Button (span) - configurable appearance\n * Layer 3: Content (children) - text, icons, effects\n */\nconst Button = memo(forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n buttonVisualClassName,\n variant,\n size,\n visualSize,\n fullWidth,\n loading = false,\n loadingText = \"Loading...\",\n shortcut,\n children,\n isDisabled,\n paywall = false,\n paywallRedirect,\n paywallDescription,\n onPress,\n ...props\n },\n ref\n ) => {\n const paywallDescriptionId = useId();\n\n // ==========================================================================\n // ButtonGroup Context Integration\n // ==========================================================================\n\n // Consume group-level context (variant, size, isDisabled, orientation)\n const groupContext = useButtonGroupContext();\n\n // Consume item-level context (position for border-radius styling)\n const itemContext = useButtonGroupItemContext();\n\n // Merge context values with props (props take precedence)\n const effectiveVariant = variant ?? groupContext?.variant ?? 'default';\n const effectiveSize = size ?? groupContext?.size;\n const effectiveIsDisabled = isDisabled ?? groupContext?.isDisabled ?? false;\n\n // In vertical groups, buttons should be full width automatically\n const isInVerticalGroup = groupContext?.orientation === 'vertical';\n const effectiveFullWidth = fullWidth || isInVerticalGroup;\n\n // Position styling for ButtonGroup (only applied when in a group)\n const positionClassName = itemContext\n ? buttonGroupItemVariants({\n orientation: groupContext?.orientation ?? 'horizontal',\n position: itemContext.position,\n })\n : '';\n\n // Default visualSize to size for backward compatibility\n const effectiveVisualSize = visualSize ?? effectiveSize ?? 'default';\n\n // AAA Accessibility: Warn in dev/test if icon/dot variant lacks accessible name\n if (process.env.NODE_ENV !== 'production') {\n if (\n (effectiveVisualSize === 'dot' || effectiveVisualSize === 'icon') &&\n !props['aria-label'] &&\n !children\n ) {\n console.warn(\n '[Button] visualSize=\"dot\" or \"icon\" requires aria-label when no visible text is provided (WCAG 1.1.1)'\n );\n }\n }\n\n /**\n * Handle button press - intercepts action when paywalled\n * If paywalled with redirect URL, opens in new tab\n * Otherwise, calls the normal onPress handler\n */\n const handlePress = (e: Parameters<NonNullable<AriaButtonProps['onPress']>>[0]): void => {\n if (paywall) {\n if (paywallRedirect) {\n window.open(paywallRedirect, '_blank', 'noopener,noreferrer');\n }\n // Don't call onPress when paywalled\n return;\n }\n onPress?.(e);\n };\n\n // Only set isDisabled when we have a reason to disable\n // Otherwise, let slot system control disabled state (e.g., in NumberField)\n const computedIsDisabled = effectiveIsDisabled || loading || undefined;\n\n return (\n <AriaButton\n ref={ref}\n isDisabled={computedIsDisabled}\n aria-disabled={paywall ? true : undefined}\n aria-describedby={paywall ? paywallDescriptionId : undefined}\n onPress={handlePress}\n className={cn(buttonOuterVariants({ fullWidth: effectiveFullWidth, inVerticalGroup: isInVerticalGroup }), className)}\n {...props}\n >\n {(renderProps) => (\n /* Layer 2: Visual Button */\n <span\n className={cn(\n buttonVisualVariants({\n variant: effectiveVariant,\n visualSize: effectiveVisualSize,\n paywall,\n fullWidth: effectiveFullWidth,\n }),\n // Position styling from ButtonGroup context (border-radius adjustments)\n positionClassName,\n buttonVisualClassName,\n // Layer 2 interaction styles (no focus - focus ring is on Layer 1)\n PRESSED_STYLES,\n HOVER_STYLES,\n HIGH_CONTRAST_HOVER,\n HIGH_CONTRAST_PRESSED\n )}\n data-pressed={renderProps.isPressed || undefined}\n >\n {/* Layer 3: Content & Effects */}\n\n {/* FR-033: Loading spinner with screen reader announcement */}\n {/* Uses motion-safe: for WCAG 2.3.3 AAA (Animation from Interactions) */}\n {loading && (\n <>\n <Loader2 className=\"motion-safe:animate-spin\" aria-hidden=\"true\" />\n <span className=\"sr-only\" aria-live=\"polite\">\n {loadingText}\n </span>\n </>\n )}\n\n {/* Hide children during loading */}\n {!loading && children}\n\n {/* Paywall: Lightning bolt icon */}\n {paywall && (\n <Zap\n data-testid=\"zap-icon\"\n aria-hidden=\"true\"\n className=\"ml-1\"\n />\n )}\n\n {/* Paywall: Screen reader description */}\n {paywall && (\n <span id={paywallDescriptionId} className=\"sr-only\">\n Premium feature: {paywallDescription || \"Upgrade required to access this feature\"}\n </span>\n )}\n\n {/* FR-034: Keyboard shortcut display on focus */}\n {renderProps.isFocusVisible && shortcut && (\n <kbd className=\"ml-auto hidden text-xs opacity-60 lg:inline\">\n {shortcut}\n </kbd>\n )}\n\n {/* Touch/press ripple effect - FR-031: Pressed state feedback */}\n {/* Uses motion-safe: for WCAG 2.3.3 AAA (Animation from Interactions) */}\n {renderProps.isPressed && (\n <span\n className=\"absolute inset-0 rounded-[inherit] bg-current opacity-10 motion-safe:animate-in motion-safe:zoom-in-95\"\n aria-hidden=\"true\"\n />\n )}\n </span>\n )}\n </AriaButton>\n );\n }\n));\n\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants, buttonOuterVariants, buttonVisualVariants };\nexport type { ButtonProps } from './Button.types';\n"]}
@@ -1,66 +1,3 @@
1
- 'use strict';
2
-
3
- var chunkRFFO4KPM_js = require('../../chunk-RFFO4KPM.js');
4
- var chunkY3GT7ETK_js = require('../../chunk-Y3GT7ETK.js');
5
- require('../../chunk-VIREG536.js');
6
-
7
-
8
-
9
- Object.defineProperty(exports, "ButtonGroup", {
10
- enumerable: true,
11
- get: function () { return chunkRFFO4KPM_js.ButtonGroup; }
12
- });
13
- Object.defineProperty(exports, "ButtonGroupPropsSchema", {
14
- enumerable: true,
15
- get: function () { return chunkRFFO4KPM_js.ButtonGroupPropsSchema; }
16
- });
17
- Object.defineProperty(exports, "ButtonGroupSeparator", {
18
- enumerable: true,
19
- get: function () { return chunkRFFO4KPM_js.ButtonGroupSeparator; }
20
- });
21
- Object.defineProperty(exports, "ButtonGroupSeparatorPropsSchema", {
22
- enumerable: true,
23
- get: function () { return chunkRFFO4KPM_js.ButtonGroupSeparatorPropsSchema; }
24
- });
25
- Object.defineProperty(exports, "filterButtonChildren", {
26
- enumerable: true,
27
- get: function () { return chunkRFFO4KPM_js.filterButtonChildren; }
28
- });
29
- Object.defineProperty(exports, "getButtonIndex", {
30
- enumerable: true,
31
- get: function () { return chunkRFFO4KPM_js.getButtonIndex; }
32
- });
33
- Object.defineProperty(exports, "getPosition", {
34
- enumerable: true,
35
- get: function () { return chunkRFFO4KPM_js.getPosition; }
36
- });
37
- Object.defineProperty(exports, "isButtonElement", {
38
- enumerable: true,
39
- get: function () { return chunkRFFO4KPM_js.isButtonElement; }
40
- });
41
- Object.defineProperty(exports, "isSeparatorElement", {
42
- enumerable: true,
43
- get: function () { return chunkRFFO4KPM_js.isSeparatorElement; }
44
- });
45
- Object.defineProperty(exports, "buttonGroupItemVariants", {
46
- enumerable: true,
47
- get: function () { return chunkY3GT7ETK_js.buttonGroupItemVariants; }
48
- });
49
- Object.defineProperty(exports, "buttonGroupSeparatorVariants", {
50
- enumerable: true,
51
- get: function () { return chunkY3GT7ETK_js.buttonGroupSeparatorVariants; }
52
- });
53
- Object.defineProperty(exports, "buttonGroupVariants", {
54
- enumerable: true,
55
- get: function () { return chunkY3GT7ETK_js.buttonGroupVariants; }
56
- });
57
- Object.defineProperty(exports, "useButtonGroupContext", {
58
- enumerable: true,
59
- get: function () { return chunkY3GT7ETK_js.useButtonGroupContext; }
60
- });
61
- Object.defineProperty(exports, "useButtonGroupItemContext", {
62
- enumerable: true,
63
- get: function () { return chunkY3GT7ETK_js.useButtonGroupItemContext; }
64
- });
65
- //# sourceMappingURL=index.js.map
1
+ "use client";
2
+ 'use strict';var react=require('react'),reactAriaComponents=require('react-aria-components'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),classVarianceAuthority=require('class-variance-authority'),jsxRuntime=require('react/jsx-runtime'),zod=require('zod');function s(...t){return tailwindMerge.twMerge(clsx.clsx(t))}var a=react.createContext(null);a.displayName="ButtonGroupContext";function m(){return react.useContext(a)}var u=react.createContext(null);u.displayName="ButtonGroupItemContext";function M(){return react.useContext(u)}var d=classVarianceAuthority.cva("inline-flex items-center gap-0",{variants:{orientation:{horizontal:"flex-row",vertical:"flex-col w-full"}},defaultVariants:{orientation:"horizontal"}}),A=classVarianceAuthority.cva("",{variants:{orientation:{horizontal:"min-w-[44px]",vertical:"flex min-h-[44px]"},position:{first:"",middle:"",last:"",only:""}},compoundVariants:[{orientation:"horizontal",position:"first",className:"rounded-r-none border-r-0"},{orientation:"horizontal",position:"middle",className:"rounded-none border-r-0"},{orientation:"horizontal",position:"last",className:"rounded-l-none"},{orientation:"vertical",position:"first",className:"rounded-b-none border-b-0"},{orientation:"vertical",position:"middle",className:"rounded-none border-b-0"},{orientation:"vertical",position:"last",className:"rounded-t-none"}],defaultVariants:{orientation:"horizontal",position:"only"}}),B=classVarianceAuthority.cva("bg-[var(--border)]",{variants:{orientation:{horizontal:"w-px h-6 mx-1",vertical:"h-px w-full my-1"}},defaultVariants:{orientation:"horizontal"}});var r=t=>react.isValidElement(t)?t.type?.displayName==="Button":false,H=t=>react.isValidElement(t)?t.type?.displayName==="ButtonGroupSeparator":false,x=(t,e)=>e===1?"only":t===0?"first":t===e-1?"last":"middle",L=t=>t.filter(r),j=(t,e)=>e.indexOf(t);var P=react.forwardRef(({orientation:t="horizontal",variant:e,size:p,isDisabled:f,className:l,children:S,...G},g)=>{let y=react.Children.toArray(S),b=y.filter(r),z=b.length,I={orientation:t,variant:e,size:p,isDisabled:f},R=y.map((n,E)=>{if(r(n)){let T=b.indexOf(n),w=x(T,z);return jsxRuntime.jsx(u.Provider,{value:{position:w},children:n},E)}return n});return jsxRuntime.jsx(reactAriaComponents.Toolbar,{ref:g,orientation:t,"aria-label":G["aria-label"],"aria-labelledby":G["aria-labelledby"],className:s(d({orientation:t}),l),children:jsxRuntime.jsx(a.Provider,{value:I,children:R})})});P.displayName="ButtonGroup";var N=react.forwardRef(({className:t,...e},p)=>{let l=m()?.orientation??"horizontal";return jsxRuntime.jsx("div",{ref:p,role:"separator","aria-hidden":"true",className:s(B({orientation:l}),t),...e})});N.displayName="ButtonGroupSeparator";var F=zod.z.object({orientation:zod.z.enum(["horizontal","vertical"]).optional().default("horizontal"),variant:zod.z.enum(["default","destructive","outline","secondary","ghost"]).optional(),size:zod.z.enum(["sm","default","lg","icon"]).optional(),isDisabled:zod.z.boolean().optional(),"aria-label":zod.z.string().optional(),"aria-labelledby":zod.z.string().optional(),className:zod.z.string().optional(),children:zod.z.custom()}),J=zod.z.object({className:zod.z.string().optional(),"data-testid":zod.z.string().optional()});exports.ButtonGroup=P;exports.ButtonGroupPropsSchema=F;exports.ButtonGroupSeparator=N;exports.ButtonGroupSeparatorPropsSchema=J;exports.buttonGroupItemVariants=A;exports.buttonGroupSeparatorVariants=B;exports.buttonGroupVariants=d;exports.filterButtonChildren=L;exports.getButtonIndex=j;exports.getPosition=x;exports.isButtonElement=r;exports.isSeparatorElement=H;exports.useButtonGroupContext=m;exports.useButtonGroupItemContext=M;//# sourceMappingURL=index.js.map
66
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
1
+ {"version":3,"sources":["../../../src/utils/cn.ts","../../../src/elements/ButtonGroup/ButtonGroupContext.tsx","../../../src/elements/ButtonGroup/ButtonGroup.variants.ts","../../../src/elements/ButtonGroup/ButtonGroup.utils.ts","../../../src/elements/ButtonGroup/ButtonGroup.tsx","../../../src/elements/ButtonGroup/ButtonGroup.types.ts"],"names":["cn","inputs","twMerge","clsx","ButtonGroupContext","createContext","useButtonGroupContext","useContext","ButtonGroupItemContext","useButtonGroupItemContext","buttonGroupVariants","cva","buttonGroupItemVariants","buttonGroupSeparatorVariants","isButtonElement","child","isValidElement","isSeparatorElement","getPosition","index","total","filterButtonChildren","children","getButtonIndex","buttonChildren","ButtonGroup","forwardRef","orientation","variant","size","isDisabled","className","props","ref","childArray","Children","totalButtons","groupContextValue","wrappedChildren","buttonIndex","position","jsx","Toolbar","ButtonGroupSeparator","ButtonGroupPropsSchema","z","ButtonGroupSeparatorPropsSchema"],"mappings":"gRAcO,SAASA,CAAAA,CAAAA,GAAMC,CAAAA,CAA8B,CAClD,OAAOC,qBAAAA,CAAQC,SAAAA,CAAKF,CAAM,CAAC,CAC7B,CCoBA,IAAMG,CAAAA,CAAqBC,mBAAAA,CAA8C,IAAI,CAAA,CAE7ED,CAAAA,CAAmB,WAAA,CAAc,oBAAA,CAM1B,SAASE,CAAAA,EAAwD,CACtE,OAAOC,gBAAAA,CAAWH,CAAkB,CACtC,CAUA,IAAMI,CAAAA,CACJH,mBAAAA,CAAkD,IAAI,CAAA,CAExDG,CAAAA,CAAuB,WAAA,CAAc,wBAAA,CAM9B,SAASC,CAAAA,EAAgE,CAC9E,OAAOF,gBAAAA,CAAWC,CAAsB,CAC1C,CC5CO,IAAME,CAAAA,CAAsBC,0BAAAA,CAAI,gCAAA,CAAkC,CACvE,QAAA,CAAU,CACR,WAAA,CAAa,CACX,UAAA,CAAY,UAAA,CACZ,QAAA,CAAU,iBACZ,CACF,CAAA,CACA,eAAA,CAAiB,CACf,WAAA,CAAa,YACf,CACF,CAAC,CAAA,CAcYC,CAAAA,CAA0BD,0BAAAA,CAAI,GAAI,CAC7C,QAAA,CAAU,CACR,WAAA,CAAa,CAEX,UAAA,CAAY,cAAA,CAGZ,QAAA,CAAU,mBACZ,CAAA,CACA,QAAA,CAAU,CACR,KAAA,CAAO,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e,SAAA,CAAW,WAAA,CAAa,OAAO,CAAC,CAAA,CAChE,QAAA,EAAS,CAGZ,IAAA,CAAMA,KAAAA,CAAE,IAAA,CAAK,CAAC,IAAA,CAAM,SAAA,CAAW,IAAA,CAAM,MAAM,CAAC,CAAA,CAAE,QAAA,EAAS,CAGvD,UAAA,CAAYA,KAAAA,CAAE,OAAA,EAAQ,CAAE,QAAA,EAAS,CAGjC,YAAA,CAAcA,KAAAA,CAAE,MAAA,EAAO,CAAE,QAAA,GAGzB,iBAAA,CAAmBA,KAAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS,CAGvC,SAAA,CAAWA,KAAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS,CAG/B,QAAA,CAAUA,KAAAA,CAAE,MAAA,EACd,CAAC,CAAA,CAMYC,CAAAA,CAAkCD,KAAAA,CAAE,MAAA,CAAO,CAEtD,SAAA,CAAWA,KAAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS,CAE/B,aAAA,CAAeA,KAAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAC5B,CAAC","file":"index.js","sourcesContent":["/**\n * Class Name Utility\n * Merges Tailwind CSS classes with conflict resolution\n *\n * Combines clsx for conditional classes and tailwind-merge for deduplication\n *\n * @example\n * cn('px-2 py-1', 'px-4') // => 'py-1 px-4' (px-4 overrides px-2)\n * cn('text-red-500', condition && 'text-blue-500') // => conditional application\n */\n\nimport { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport { createContext, useContext } from 'react';\nimport type {\n ButtonGroupContextValue,\n ButtonGroupItemContextValue,\n} from './ButtonGroup.types';\n\n/**\n * ButtonGroup Context System (Two-Level)\n *\n * Provides a two-level context pattern for ButtonGroup:\n *\n * 1. ButtonGroupContext (group-level):\n * - Provides: orientation, variant, size, isDisabled\n * - Consumed by: Button (for prop inheritance), Separator (for orientation)\n *\n * 2. ButtonGroupItemContext (item-level):\n * - Provides: position ('first' | 'middle' | 'last' | 'only')\n * - Consumed by: Button (for border-radius styling)\n *\n * Both contexts return null when not in a provider, allowing Button\n * to work standalone without any group context.\n *\n * @see plan.md for architecture details\n * @see ButtonGroup.tsx for Provider implementation\n */\n\n// =============================================================================\n// Group-Level Context\n// =============================================================================\n\n/**\n * Context for group-level props (orientation, variant, size, isDisabled)\n * Default value is null to indicate \"not in a group\"\n */\nconst ButtonGroupContext = createContext<ButtonGroupContextValue | null>(null);\n\nButtonGroupContext.displayName = 'ButtonGroupContext';\n\n/**\n * Hook to access group-level context\n * @returns ButtonGroupContextValue if inside a ButtonGroup, null otherwise\n */\nexport function useButtonGroupContext(): ButtonGroupContextValue | null {\n return useContext(ButtonGroupContext);\n}\n\n// =============================================================================\n// Item-Level Context\n// =============================================================================\n\n/**\n * Context for per-button position information\n * Default value is null to indicate \"not wrapped with position context\"\n */\nconst ButtonGroupItemContext =\n createContext<ButtonGroupItemContextValue | null>(null);\n\nButtonGroupItemContext.displayName = 'ButtonGroupItemContext';\n\n/**\n * Hook to access item-level context (position)\n * @returns ButtonGroupItemContextValue if wrapped with position context, null otherwise\n */\nexport function useButtonGroupItemContext(): ButtonGroupItemContextValue | null {\n return useContext(ButtonGroupItemContext);\n}\n\n// =============================================================================\n// Exports\n// =============================================================================\n\nexport { ButtonGroupContext, ButtonGroupItemContext };\n","import { cva } from 'class-variance-authority';\n\n/**\n * ButtonGroup CVA Variants\n *\n * Defines Class Variance Authority (CVA) variants for:\n * - ButtonGroup container (orientation-based layout)\n * - ButtonGroupItem (position-based border-radius)\n * - ButtonGroupSeparator (orientation-based styling)\n *\n * @see plan.md Phase 1: Design & Contracts - CVA Variants\n * @see constitution.md Principle V (Component Quality Standards)\n */\n\n// =============================================================================\n// Container Variants\n// =============================================================================\n\n/**\n * ButtonGroup container variants\n * Controls the layout direction based on orientation\n * Uses gap-0 to ensure buttons are connected (share borders)\n */\nexport const buttonGroupVariants = cva('inline-flex items-center gap-0', {\n variants: {\n orientation: {\n horizontal: 'flex-row',\n vertical: 'flex-col w-full',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n },\n});\n\n// =============================================================================\n// Item Position Variants\n// =============================================================================\n\n/**\n * ButtonGroupItem position variants\n * Applied to Button's visual layer (Layer 2) for position-aware border-radius\n *\n * Compound variants handle both orientation and position combinations:\n * - Horizontal: left/right borders and radii\n * - Vertical: top/bottom borders and radii\n */\nexport const buttonGroupItemVariants = cva('', {\n variants: {\n orientation: {\n // min-w-[44px] ensures visual layer fills touch target width (for icon buttons)\n horizontal: 'min-w-[44px]',\n // flex (overrides inline-flex) + min-h-[44px] makes visual layer fill touch target,\n // eliminating gaps between stacked buttons in vertical orientation\n vertical: 'flex min-h-[44px]',\n },\n position: {\n first: '',\n middle: '',\n last: '',\n only: '', // Single button - no modifications needed\n },\n },\n compoundVariants: [\n // ==========================================================================\n // Horizontal Orientation\n // ==========================================================================\n {\n orientation: 'horizontal',\n position: 'first',\n className: 'rounded-r-none border-r-0',\n },\n {\n orientation: 'horizontal',\n position: 'middle',\n className: 'rounded-none border-r-0',\n },\n {\n orientation: 'horizontal',\n position: 'last',\n className: 'rounded-l-none',\n },\n // ==========================================================================\n // Vertical Orientation\n // Note: w-full is handled by Button's effectiveFullWidth for both layers\n // ==========================================================================\n {\n orientation: 'vertical',\n position: 'first',\n className: 'rounded-b-none border-b-0',\n },\n {\n orientation: 'vertical',\n position: 'middle',\n className: 'rounded-none border-b-0',\n },\n {\n orientation: 'vertical',\n position: 'last',\n className: 'rounded-t-none',\n },\n ],\n defaultVariants: {\n orientation: 'horizontal',\n position: 'only',\n },\n});\n\n// =============================================================================\n// Separator Variants\n// =============================================================================\n\n/**\n * ButtonGroupSeparator variants\n * Orientation-aware visual divider between button groups\n */\nexport const buttonGroupSeparatorVariants = cva('bg-[var(--border)]', {\n variants: {\n orientation: {\n horizontal: 'w-px h-6 mx-1',\n vertical: 'h-px w-full my-1',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n },\n});\n","import { isValidElement, type ReactNode, type ComponentType } from 'react';\nimport type { ButtonPosition } from './ButtonGroup.types';\n\n/**\n * ButtonGroup Utility Functions\n *\n * Provides helper functions for:\n * - Child element detection (Button vs Separator vs other)\n * - Position calculation for border-radius styling\n *\n * @see plan.md Decision 6: Non-Button Child Handling\n */\n\n// =============================================================================\n// Child Detection Functions\n// =============================================================================\n\n/**\n * Checks if a React child is a Themis Button component\n * Uses displayName for reliable detection across module boundaries\n *\n * @param child - React child element to check\n * @returns true if the child is a Button component\n */\nexport const isButtonElement = (child: ReactNode): boolean => {\n if (!isValidElement(child)) return false;\n\n const componentType = child.type as ComponentType;\n return componentType?.displayName === 'Button';\n};\n\n/**\n * Checks if a React child is a ButtonGroupSeparator component\n * Uses displayName for reliable detection across module boundaries\n *\n * @param child - React child element to check\n * @returns true if the child is a ButtonGroupSeparator component\n */\nexport const isSeparatorElement = (child: ReactNode): boolean => {\n if (!isValidElement(child)) return false;\n\n const componentType = child.type as ComponentType;\n return componentType?.displayName === 'ButtonGroupSeparator';\n};\n\n// =============================================================================\n// Position Calculation\n// =============================================================================\n\n/**\n * Calculates the position of a button within a group\n * Used for applying position-aware border-radius styling\n *\n * @param index - Zero-based index of the button\n * @param total - Total number of buttons in the group\n * @returns Position enum: 'only' | 'first' | 'last' | 'middle'\n *\n * @example\n * getPosition(0, 1) // 'only' - single button\n * getPosition(0, 3) // 'first'\n * getPosition(1, 3) // 'middle'\n * getPosition(2, 3) // 'last'\n */\nexport const getPosition = (index: number, total: number): ButtonPosition => {\n if (total === 1) return 'only';\n if (index === 0) return 'first';\n if (index === total - 1) return 'last';\n return 'middle';\n};\n\n/**\n * Filters an array of React children to only include Button elements\n * Non-Button children (Separators, custom elements) are excluded\n *\n * @param children - Array of React children\n * @returns Array containing only Button elements\n */\nexport const filterButtonChildren = (children: ReactNode[]): ReactNode[] => {\n return children.filter(isButtonElement);\n};\n\n/**\n * Gets the index of a button within the filtered button array\n * Used when the child array contains non-Button elements (Separators, etc.)\n *\n * @param child - The button element to find\n * @param buttonChildren - Array of only Button elements\n * @returns Index of the button, or -1 if not found\n */\nexport const getButtonIndex = (\n child: ReactNode,\n buttonChildren: ReactNode[]\n): number => {\n return buttonChildren.indexOf(child);\n};\n","\"use client\";\n\n/**\n * ButtonGroup Component\n *\n * A container that groups related Themis Button components with:\n * - Consistent styling (connected borders, position-aware radii)\n * - Accessible keyboard navigation (React Aria Toolbar)\n * - WCAG 2.2 AAA compliance\n *\n * @see plan.md for architecture details\n * @see buttongroup-prd.md for requirements\n */\n\nimport { forwardRef, Children, type ReactElement } from 'react';\nimport { Toolbar } from 'react-aria-components';\nimport { cn } from '../../utils/cn';\nimport {\n ButtonGroupContext,\n ButtonGroupItemContext,\n useButtonGroupContext,\n} from './ButtonGroupContext';\nimport { buttonGroupVariants, buttonGroupSeparatorVariants } from './ButtonGroup.variants';\nimport { isButtonElement, getPosition } from './ButtonGroup.utils';\nimport type { ButtonGroupProps, ButtonGroupSeparatorProps } from './ButtonGroup.types';\n\n// =============================================================================\n// ButtonGroup Component\n// =============================================================================\n\n/**\n * ButtonGroup - Groups related buttons with connected styling and keyboard navigation\n *\n * Uses React Aria's Toolbar for:\n * - Roving tabindex (single tab stop)\n * - Arrow key navigation\n * - Home/End key support\n * - RTL support\n *\n * @example\n * ```tsx\n * <ButtonGroup aria-label=\"Text formatting\">\n * <Button variant=\"outline\">Bold</Button>\n * <Button variant=\"outline\">Italic</Button>\n * <Button variant=\"outline\">Underline</Button>\n * </ButtonGroup>\n * ```\n */\nconst ButtonGroup = forwardRef<HTMLDivElement, ButtonGroupProps>(\n (\n {\n orientation = 'horizontal',\n variant,\n size,\n isDisabled,\n className,\n children,\n ...props\n },\n ref\n ): ReactElement => {\n // Convert children to array for enumeration\n const childArray = Children.toArray(children);\n\n // Filter to get only Button elements for position calculation\n const buttonChildren = childArray.filter(isButtonElement);\n const totalButtons = buttonChildren.length;\n\n // Create context value for group-level props\n const groupContextValue = {\n orientation,\n variant,\n size,\n isDisabled,\n };\n\n // Wrap each child with appropriate context\n const wrappedChildren = childArray.map((child, index) => {\n // If it's a Button, wrap with item context for position\n if (isButtonElement(child)) {\n const buttonIndex = buttonChildren.indexOf(child);\n const position = getPosition(buttonIndex, totalButtons);\n\n return (\n <ButtonGroupItemContext.Provider\n key={index}\n value={{ position }}\n >\n {child}\n </ButtonGroupItemContext.Provider>\n );\n }\n\n // Non-Button children (Separators, etc.) pass through without item context\n return child;\n });\n\n return (\n <Toolbar\n ref={ref}\n orientation={orientation}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n className={cn(buttonGroupVariants({ orientation }), className)}\n >\n <ButtonGroupContext.Provider value={groupContextValue}>\n {wrappedChildren}\n </ButtonGroupContext.Provider>\n </Toolbar>\n );\n }\n);\n\nButtonGroup.displayName = 'ButtonGroup';\n\n// =============================================================================\n// ButtonGroupSeparator Component\n// =============================================================================\n\n/**\n * ButtonGroupSeparator - Visual divider between button groups\n *\n * Renders a decorative separator that:\n * - Adapts to orientation (vertical line for horizontal, horizontal for vertical)\n * - Is hidden from screen readers (aria-hidden)\n * - Is excluded from keyboard navigation\n *\n * @example\n * ```tsx\n * <ButtonGroup aria-label=\"Editor actions\">\n * <Button>Undo</Button>\n * <Button>Redo</Button>\n * <ButtonGroupSeparator />\n * <Button>Cut</Button>\n * <Button>Copy</Button>\n * </ButtonGroup>\n * ```\n */\nconst ButtonGroupSeparator = forwardRef<HTMLDivElement, ButtonGroupSeparatorProps>(\n ({ className, ...props }, ref): ReactElement => {\n const groupContext = useButtonGroupContext();\n const orientation = groupContext?.orientation ?? 'horizontal';\n\n return (\n <div\n ref={ref}\n role=\"separator\"\n aria-hidden=\"true\"\n className={cn(\n buttonGroupSeparatorVariants({ orientation }),\n className\n )}\n {...props}\n />\n );\n }\n);\n\nButtonGroupSeparator.displayName = 'ButtonGroupSeparator';\n\n// =============================================================================\n// Exports\n// =============================================================================\n\nexport { ButtonGroup, ButtonGroupSeparator };\n","import { z } from 'zod';\nimport type { ReactNode } from 'react';\n\n/**\n * ButtonGroup Component Types\n *\n * Defines Zod schemas and TypeScript types for the ButtonGroup component.\n * Uses a two-level context pattern:\n * - ButtonGroupContext: Group-level props (orientation, variant, size, isDisabled)\n * - ButtonGroupItemContext: Per-button position information\n *\n * @see plan.md for architecture details\n * @see constitution.md Principle II (Type Safety First)\n */\n\n// =============================================================================\n// Core Types\n// =============================================================================\n\n/**\n * Orientation of the button group\n */\nexport type ButtonGroupOrientation = 'horizontal' | 'vertical';\n\n/**\n * Position of a button within the group\n * Used for position-aware border-radius styling\n */\nexport type ButtonPosition = 'first' | 'middle' | 'last' | 'only';\n\n/**\n * Button variants (matches Themis Button variants, excluding 'link')\n * Link variant is excluded as it doesn't make sense in a grouped context\n */\nexport type ButtonGroupVariant =\n | 'default'\n | 'destructive'\n | 'outline'\n | 'secondary'\n | 'ghost';\n\n/**\n * Button sizes (matches Themis Button sizes)\n */\nexport type ButtonGroupSize = 'sm' | 'default' | 'lg' | 'icon';\n\n// =============================================================================\n// Zod Schemas\n// =============================================================================\n\n/**\n * ButtonGroup props schema\n * Validates all props for the ButtonGroup container component\n */\nexport const ButtonGroupPropsSchema = z.object({\n /** Orientation of the button group layout */\n orientation: z\n .enum(['horizontal', 'vertical'])\n .optional()\n .default('horizontal'),\n\n /** Default variant for all child buttons (can be overridden per-button) */\n variant: z\n .enum(['default', 'destructive', 'outline', 'secondary', 'ghost'])\n .optional(),\n\n /** Default size for all child buttons (can be overridden per-button) */\n size: z.enum(['sm', 'default', 'lg', 'icon']).optional(),\n\n /** Disable all buttons in the group */\n isDisabled: z.boolean().optional(),\n\n /** Accessible label for the toolbar (recommended) */\n 'aria-label': z.string().optional(),\n\n /** ID of element that labels the toolbar */\n 'aria-labelledby': z.string().optional(),\n\n /** Additional CSS classes */\n className: z.string().optional(),\n\n /** Child elements (Buttons, Separators, etc.) */\n children: z.custom<ReactNode>(),\n});\n\n/**\n * ButtonGroupSeparator props schema\n * Validates props for the visual separator between button groups\n */\nexport const ButtonGroupSeparatorPropsSchema = z.object({\n /** Additional CSS classes */\n className: z.string().optional(),\n /** Test ID for testing */\n 'data-testid': z.string().optional(),\n});\n\n// =============================================================================\n// TypeScript Types (inferred from schemas)\n// =============================================================================\n\n/**\n * Props for the ButtonGroup container component\n */\nexport type ButtonGroupProps = z.infer<typeof ButtonGroupPropsSchema>;\n\n/**\n * Props for the ButtonGroupSeparator component\n */\nexport type ButtonGroupSeparatorProps = z.infer<\n typeof ButtonGroupSeparatorPropsSchema\n>;\n\n// =============================================================================\n// Context Types\n// =============================================================================\n\n/**\n * Group-level context value\n * Provides inherited props to all child buttons\n */\nexport interface ButtonGroupContextValue {\n /** Orientation of the group (affects keyboard navigation and styling) */\n orientation: ButtonGroupOrientation;\n /** Default variant for buttons (can be overridden) */\n variant?: ButtonGroupVariant;\n /** Default size for buttons (can be overridden) */\n size?: ButtonGroupSize;\n /** Whether all buttons in the group are disabled */\n isDisabled?: boolean;\n}\n\n/**\n * Item-level context value\n * Provides position information to each button for border-radius styling\n */\nexport interface ButtonGroupItemContextValue {\n /** Position of this button in the group */\n position: ButtonPosition;\n}\n"]}
@@ -1,5 +1,3 @@
1
- export { ButtonGroup, ButtonGroupPropsSchema, ButtonGroupSeparator, ButtonGroupSeparatorPropsSchema, filterButtonChildren, getButtonIndex, getPosition, isButtonElement, isSeparatorElement } from '../../chunk-I3AUTOMZ.mjs';
2
- export { buttonGroupItemVariants, buttonGroupSeparatorVariants, buttonGroupVariants, useButtonGroupContext, useButtonGroupItemContext } from '../../chunk-FPKEAJRZ.mjs';
3
- import '../../chunk-E2KQFV3O.mjs';
4
- //# sourceMappingURL=index.mjs.map
1
+ "use client";
2
+ import {createContext,forwardRef,Children,isValidElement,useContext}from'react';import {Toolbar}from'react-aria-components';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {cva}from'class-variance-authority';import {jsx}from'react/jsx-runtime';import {z}from'zod';function s(...t){return twMerge(clsx(t))}var a=createContext(null);a.displayName="ButtonGroupContext";function m(){return useContext(a)}var u=createContext(null);u.displayName="ButtonGroupItemContext";function M(){return useContext(u)}var d=cva("inline-flex items-center gap-0",{variants:{orientation:{horizontal:"flex-row",vertical:"flex-col w-full"}},defaultVariants:{orientation:"horizontal"}}),A=cva("",{variants:{orientation:{horizontal:"min-w-[44px]",vertical:"flex min-h-[44px]"},position:{first:"",middle:"",last:"",only:""}},compoundVariants:[{orientation:"horizontal",position:"first",className:"rounded-r-none border-r-0"},{orientation:"horizontal",position:"middle",className:"rounded-none border-r-0"},{orientation:"horizontal",position:"last",className:"rounded-l-none"},{orientation:"vertical",position:"first",className:"rounded-b-none border-b-0"},{orientation:"vertical",position:"middle",className:"rounded-none border-b-0"},{orientation:"vertical",position:"last",className:"rounded-t-none"}],defaultVariants:{orientation:"horizontal",position:"only"}}),B=cva("bg-[var(--border)]",{variants:{orientation:{horizontal:"w-px h-6 mx-1",vertical:"h-px w-full my-1"}},defaultVariants:{orientation:"horizontal"}});var r=t=>isValidElement(t)?t.type?.displayName==="Button":false,H=t=>isValidElement(t)?t.type?.displayName==="ButtonGroupSeparator":false,x=(t,e)=>e===1?"only":t===0?"first":t===e-1?"last":"middle",L=t=>t.filter(r),j=(t,e)=>e.indexOf(t);var P=forwardRef(({orientation:t="horizontal",variant:e,size:p,isDisabled:f,className:l,children:S,...G},g)=>{let y=Children.toArray(S),b=y.filter(r),z=b.length,I={orientation:t,variant:e,size:p,isDisabled:f},R=y.map((n,E)=>{if(r(n)){let T=b.indexOf(n),w=x(T,z);return jsx(u.Provider,{value:{position:w},children:n},E)}return n});return jsx(Toolbar,{ref:g,orientation:t,"aria-label":G["aria-label"],"aria-labelledby":G["aria-labelledby"],className:s(d({orientation:t}),l),children:jsx(a.Provider,{value:I,children:R})})});P.displayName="ButtonGroup";var N=forwardRef(({className:t,...e},p)=>{let l=m()?.orientation??"horizontal";return jsx("div",{ref:p,role:"separator","aria-hidden":"true",className:s(B({orientation:l}),t),...e})});N.displayName="ButtonGroupSeparator";var F=z.object({orientation:z.enum(["horizontal","vertical"]).optional().default("horizontal"),variant:z.enum(["default","destructive","outline","secondary","ghost"]).optional(),size:z.enum(["sm","default","lg","icon"]).optional(),isDisabled:z.boolean().optional(),"aria-label":z.string().optional(),"aria-labelledby":z.string().optional(),className:z.string().optional(),children:z.custom()}),J=z.object({className:z.string().optional(),"data-testid":z.string().optional()});export{P as ButtonGroup,F as ButtonGroupPropsSchema,N as ButtonGroupSeparator,J as ButtonGroupSeparatorPropsSchema,A as buttonGroupItemVariants,B as buttonGroupSeparatorVariants,d as buttonGroupVariants,L as filterButtonChildren,j as getButtonIndex,x as getPosition,r as isButtonElement,H as isSeparatorElement,m as useButtonGroupContext,M as useButtonGroupItemContext};//# sourceMappingURL=index.mjs.map
5
3
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
1
+ {"version":3,"sources":["../../../src/utils/cn.ts","../../../src/elements/ButtonGroup/ButtonGroupContext.tsx","../../../src/elements/ButtonGroup/ButtonGroup.variants.ts","../../../src/elements/ButtonGroup/ButtonGroup.utils.ts","../../../src/elements/ButtonGroup/ButtonGroup.tsx","../../../src/elements/ButtonGroup/ButtonGroup.types.ts"],"names":["cn","inputs","twMerge","clsx","ButtonGroupContext","createContext","useButtonGroupContext","useContext","ButtonGroupItemContext","useButtonGroupItemContext","buttonGroupVariants","cva","buttonGroupItemVariants","buttonGroupSeparatorVariants","isButtonElement","child","isValidElement","isSeparatorElement","getPosition","index","total","filterButtonChildren","children","getButtonIndex","buttonChildren","ButtonGroup","forwardRef","orientation","variant","size","isDisabled","className","props","ref","childArray","Children","totalButtons","groupContextValue","wrappedChildren","buttonIndex","position","jsx","Toolbar","ButtonGroupSeparator","ButtonGroupPropsSchema","z","ButtonGroupSeparatorPropsSchema"],"mappings":"4RAcO,SAASA,CAAAA,CAAAA,GAAMC,CAAAA,CAA8B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AE,MAAA,EACd,CAAC,CAAA,CAMYC,CAAAA,CAAkCD,CAAAA,CAAE,MAAA,CAAO,CAEtD,SAAA,CAAWA,CAAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS,CAE/B,aAAA,CAAeA,CAAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAC5B,CAAC","file":"index.mjs","sourcesContent":["/**\n * Class Name Utility\n * Merges Tailwind CSS classes with conflict resolution\n *\n * Combines clsx for conditional classes and tailwind-merge for deduplication\n *\n * @example\n * cn('px-2 py-1', 'px-4') // => 'py-1 px-4' (px-4 overrides px-2)\n * cn('text-red-500', condition && 'text-blue-500') // => conditional application\n */\n\nimport { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport { createContext, useContext } from 'react';\nimport type {\n ButtonGroupContextValue,\n ButtonGroupItemContextValue,\n} from './ButtonGroup.types';\n\n/**\n * ButtonGroup Context System (Two-Level)\n *\n * Provides a two-level context pattern for ButtonGroup:\n *\n * 1. ButtonGroupContext (group-level):\n * - Provides: orientation, variant, size, isDisabled\n * - Consumed by: Button (for prop inheritance), Separator (for orientation)\n *\n * 2. ButtonGroupItemContext (item-level):\n * - Provides: position ('first' | 'middle' | 'last' | 'only')\n * - Consumed by: Button (for border-radius styling)\n *\n * Both contexts return null when not in a provider, allowing Button\n * to work standalone without any group context.\n *\n * @see plan.md for architecture details\n * @see ButtonGroup.tsx for Provider implementation\n */\n\n// =============================================================================\n// Group-Level Context\n// =============================================================================\n\n/**\n * Context for group-level props (orientation, variant, size, isDisabled)\n * Default value is null to indicate \"not in a group\"\n */\nconst ButtonGroupContext = createContext<ButtonGroupContextValue | null>(null);\n\nButtonGroupContext.displayName = 'ButtonGroupContext';\n\n/**\n * Hook to access group-level context\n * @returns ButtonGroupContextValue if inside a ButtonGroup, null otherwise\n */\nexport function useButtonGroupContext(): ButtonGroupContextValue | null {\n return useContext(ButtonGroupContext);\n}\n\n// =============================================================================\n// Item-Level Context\n// =============================================================================\n\n/**\n * Context for per-button position information\n * Default value is null to indicate \"not wrapped with position context\"\n */\nconst ButtonGroupItemContext =\n createContext<ButtonGroupItemContextValue | null>(null);\n\nButtonGroupItemContext.displayName = 'ButtonGroupItemContext';\n\n/**\n * Hook to access item-level context (position)\n * @returns ButtonGroupItemContextValue if wrapped with position context, null otherwise\n */\nexport function useButtonGroupItemContext(): ButtonGroupItemContextValue | null {\n return useContext(ButtonGroupItemContext);\n}\n\n// =============================================================================\n// Exports\n// =============================================================================\n\nexport { ButtonGroupContext, ButtonGroupItemContext };\n","import { cva } from 'class-variance-authority';\n\n/**\n * ButtonGroup CVA Variants\n *\n * Defines Class Variance Authority (CVA) variants for:\n * - ButtonGroup container (orientation-based layout)\n * - ButtonGroupItem (position-based border-radius)\n * - ButtonGroupSeparator (orientation-based styling)\n *\n * @see plan.md Phase 1: Design & Contracts - CVA Variants\n * @see constitution.md Principle V (Component Quality Standards)\n */\n\n// =============================================================================\n// Container Variants\n// =============================================================================\n\n/**\n * ButtonGroup container variants\n * Controls the layout direction based on orientation\n * Uses gap-0 to ensure buttons are connected (share borders)\n */\nexport const buttonGroupVariants = cva('inline-flex items-center gap-0', {\n variants: {\n orientation: {\n horizontal: 'flex-row',\n vertical: 'flex-col w-full',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n },\n});\n\n// =============================================================================\n// Item Position Variants\n// =============================================================================\n\n/**\n * ButtonGroupItem position variants\n * Applied to Button's visual layer (Layer 2) for position-aware border-radius\n *\n * Compound variants handle both orientation and position combinations:\n * - Horizontal: left/right borders and radii\n * - Vertical: top/bottom borders and radii\n */\nexport const buttonGroupItemVariants = cva('', {\n variants: {\n orientation: {\n // min-w-[44px] ensures visual layer fills touch target width (for icon buttons)\n horizontal: 'min-w-[44px]',\n // flex (overrides inline-flex) + min-h-[44px] makes visual layer fill touch target,\n // eliminating gaps between stacked buttons in vertical orientation\n vertical: 'flex min-h-[44px]',\n },\n position: {\n first: '',\n middle: '',\n last: '',\n only: '', // Single button - no modifications needed\n },\n },\n compoundVariants: [\n // ==========================================================================\n // Horizontal Orientation\n // ==========================================================================\n {\n orientation: 'horizontal',\n position: 'first',\n className: 'rounded-r-none border-r-0',\n },\n {\n orientation: 'horizontal',\n position: 'middle',\n className: 'rounded-none border-r-0',\n },\n {\n orientation: 'horizontal',\n position: 'last',\n className: 'rounded-l-none',\n },\n // ==========================================================================\n // Vertical Orientation\n // Note: w-full is handled by Button's effectiveFullWidth for both layers\n // ==========================================================================\n {\n orientation: 'vertical',\n position: 'first',\n className: 'rounded-b-none border-b-0',\n },\n {\n orientation: 'vertical',\n position: 'middle',\n className: 'rounded-none border-b-0',\n },\n {\n orientation: 'vertical',\n position: 'last',\n className: 'rounded-t-none',\n },\n ],\n defaultVariants: {\n orientation: 'horizontal',\n position: 'only',\n },\n});\n\n// =============================================================================\n// Separator Variants\n// =============================================================================\n\n/**\n * ButtonGroupSeparator variants\n * Orientation-aware visual divider between button groups\n */\nexport const buttonGroupSeparatorVariants = cva('bg-[var(--border)]', {\n variants: {\n orientation: {\n horizontal: 'w-px h-6 mx-1',\n vertical: 'h-px w-full my-1',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n },\n});\n","import { isValidElement, type ReactNode, type ComponentType } from 'react';\nimport type { ButtonPosition } from './ButtonGroup.types';\n\n/**\n * ButtonGroup Utility Functions\n *\n * Provides helper functions for:\n * - Child element detection (Button vs Separator vs other)\n * - Position calculation for border-radius styling\n *\n * @see plan.md Decision 6: Non-Button Child Handling\n */\n\n// =============================================================================\n// Child Detection Functions\n// =============================================================================\n\n/**\n * Checks if a React child is a Themis Button component\n * Uses displayName for reliable detection across module boundaries\n *\n * @param child - React child element to check\n * @returns true if the child is a Button component\n */\nexport const isButtonElement = (child: ReactNode): boolean => {\n if (!isValidElement(child)) return false;\n\n const componentType = child.type as ComponentType;\n return componentType?.displayName === 'Button';\n};\n\n/**\n * Checks if a React child is a ButtonGroupSeparator component\n * Uses displayName for reliable detection across module boundaries\n *\n * @param child - React child element to check\n * @returns true if the child is a ButtonGroupSeparator component\n */\nexport const isSeparatorElement = (child: ReactNode): boolean => {\n if (!isValidElement(child)) return false;\n\n const componentType = child.type as ComponentType;\n return componentType?.displayName === 'ButtonGroupSeparator';\n};\n\n// =============================================================================\n// Position Calculation\n// =============================================================================\n\n/**\n * Calculates the position of a button within a group\n * Used for applying position-aware border-radius styling\n *\n * @param index - Zero-based index of the button\n * @param total - Total number of buttons in the group\n * @returns Position enum: 'only' | 'first' | 'last' | 'middle'\n *\n * @example\n * getPosition(0, 1) // 'only' - single button\n * getPosition(0, 3) // 'first'\n * getPosition(1, 3) // 'middle'\n * getPosition(2, 3) // 'last'\n */\nexport const getPosition = (index: number, total: number): ButtonPosition => {\n if (total === 1) return 'only';\n if (index === 0) return 'first';\n if (index === total - 1) return 'last';\n return 'middle';\n};\n\n/**\n * Filters an array of React children to only include Button elements\n * Non-Button children (Separators, custom elements) are excluded\n *\n * @param children - Array of React children\n * @returns Array containing only Button elements\n */\nexport const filterButtonChildren = (children: ReactNode[]): ReactNode[] => {\n return children.filter(isButtonElement);\n};\n\n/**\n * Gets the index of a button within the filtered button array\n * Used when the child array contains non-Button elements (Separators, etc.)\n *\n * @param child - The button element to find\n * @param buttonChildren - Array of only Button elements\n * @returns Index of the button, or -1 if not found\n */\nexport const getButtonIndex = (\n child: ReactNode,\n buttonChildren: ReactNode[]\n): number => {\n return buttonChildren.indexOf(child);\n};\n","\"use client\";\n\n/**\n * ButtonGroup Component\n *\n * A container that groups related Themis Button components with:\n * - Consistent styling (connected borders, position-aware radii)\n * - Accessible keyboard navigation (React Aria Toolbar)\n * - WCAG 2.2 AAA compliance\n *\n * @see plan.md for architecture details\n * @see buttongroup-prd.md for requirements\n */\n\nimport { forwardRef, Children, type ReactElement } from 'react';\nimport { Toolbar } from 'react-aria-components';\nimport { cn } from '../../utils/cn';\nimport {\n ButtonGroupContext,\n ButtonGroupItemContext,\n useButtonGroupContext,\n} from './ButtonGroupContext';\nimport { buttonGroupVariants, buttonGroupSeparatorVariants } from './ButtonGroup.variants';\nimport { isButtonElement, getPosition } from './ButtonGroup.utils';\nimport type { ButtonGroupProps, ButtonGroupSeparatorProps } from './ButtonGroup.types';\n\n// =============================================================================\n// ButtonGroup Component\n// =============================================================================\n\n/**\n * ButtonGroup - Groups related buttons with connected styling and keyboard navigation\n *\n * Uses React Aria's Toolbar for:\n * - Roving tabindex (single tab stop)\n * - Arrow key navigation\n * - Home/End key support\n * - RTL support\n *\n * @example\n * ```tsx\n * <ButtonGroup aria-label=\"Text formatting\">\n * <Button variant=\"outline\">Bold</Button>\n * <Button variant=\"outline\">Italic</Button>\n * <Button variant=\"outline\">Underline</Button>\n * </ButtonGroup>\n * ```\n */\nconst ButtonGroup = forwardRef<HTMLDivElement, ButtonGroupProps>(\n (\n {\n orientation = 'horizontal',\n variant,\n size,\n isDisabled,\n className,\n children,\n ...props\n },\n ref\n ): ReactElement => {\n // Convert children to array for enumeration\n const childArray = Children.toArray(children);\n\n // Filter to get only Button elements for position calculation\n const buttonChildren = childArray.filter(isButtonElement);\n const totalButtons = buttonChildren.length;\n\n // Create context value for group-level props\n const groupContextValue = {\n orientation,\n variant,\n size,\n isDisabled,\n };\n\n // Wrap each child with appropriate context\n const wrappedChildren = childArray.map((child, index) => {\n // If it's a Button, wrap with item context for position\n if (isButtonElement(child)) {\n const buttonIndex = buttonChildren.indexOf(child);\n const position = getPosition(buttonIndex, totalButtons);\n\n return (\n <ButtonGroupItemContext.Provider\n key={index}\n value={{ position }}\n >\n {child}\n </ButtonGroupItemContext.Provider>\n );\n }\n\n // Non-Button children (Separators, etc.) pass through without item context\n return child;\n });\n\n return (\n <Toolbar\n ref={ref}\n orientation={orientation}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n className={cn(buttonGroupVariants({ orientation }), className)}\n >\n <ButtonGroupContext.Provider value={groupContextValue}>\n {wrappedChildren}\n </ButtonGroupContext.Provider>\n </Toolbar>\n );\n }\n);\n\nButtonGroup.displayName = 'ButtonGroup';\n\n// =============================================================================\n// ButtonGroupSeparator Component\n// =============================================================================\n\n/**\n * ButtonGroupSeparator - Visual divider between button groups\n *\n * Renders a decorative separator that:\n * - Adapts to orientation (vertical line for horizontal, horizontal for vertical)\n * - Is hidden from screen readers (aria-hidden)\n * - Is excluded from keyboard navigation\n *\n * @example\n * ```tsx\n * <ButtonGroup aria-label=\"Editor actions\">\n * <Button>Undo</Button>\n * <Button>Redo</Button>\n * <ButtonGroupSeparator />\n * <Button>Cut</Button>\n * <Button>Copy</Button>\n * </ButtonGroup>\n * ```\n */\nconst ButtonGroupSeparator = forwardRef<HTMLDivElement, ButtonGroupSeparatorProps>(\n ({ className, ...props }, ref): ReactElement => {\n const groupContext = useButtonGroupContext();\n const orientation = groupContext?.orientation ?? 'horizontal';\n\n return (\n <div\n ref={ref}\n role=\"separator\"\n aria-hidden=\"true\"\n className={cn(\n buttonGroupSeparatorVariants({ orientation }),\n className\n )}\n {...props}\n />\n );\n }\n);\n\nButtonGroupSeparator.displayName = 'ButtonGroupSeparator';\n\n// =============================================================================\n// Exports\n// =============================================================================\n\nexport { ButtonGroup, ButtonGroupSeparator };\n","import { z } from 'zod';\nimport type { ReactNode } from 'react';\n\n/**\n * ButtonGroup Component Types\n *\n * Defines Zod schemas and TypeScript types for the ButtonGroup component.\n * Uses a two-level context pattern:\n * - ButtonGroupContext: Group-level props (orientation, variant, size, isDisabled)\n * - ButtonGroupItemContext: Per-button position information\n *\n * @see plan.md for architecture details\n * @see constitution.md Principle II (Type Safety First)\n */\n\n// =============================================================================\n// Core Types\n// =============================================================================\n\n/**\n * Orientation of the button group\n */\nexport type ButtonGroupOrientation = 'horizontal' | 'vertical';\n\n/**\n * Position of a button within the group\n * Used for position-aware border-radius styling\n */\nexport type ButtonPosition = 'first' | 'middle' | 'last' | 'only';\n\n/**\n * Button variants (matches Themis Button variants, excluding 'link')\n * Link variant is excluded as it doesn't make sense in a grouped context\n */\nexport type ButtonGroupVariant =\n | 'default'\n | 'destructive'\n | 'outline'\n | 'secondary'\n | 'ghost';\n\n/**\n * Button sizes (matches Themis Button sizes)\n */\nexport type ButtonGroupSize = 'sm' | 'default' | 'lg' | 'icon';\n\n// =============================================================================\n// Zod Schemas\n// =============================================================================\n\n/**\n * ButtonGroup props schema\n * Validates all props for the ButtonGroup container component\n */\nexport const ButtonGroupPropsSchema = z.object({\n /** Orientation of the button group layout */\n orientation: z\n .enum(['horizontal', 'vertical'])\n .optional()\n .default('horizontal'),\n\n /** Default variant for all child buttons (can be overridden per-button) */\n variant: z\n .enum(['default', 'destructive', 'outline', 'secondary', 'ghost'])\n .optional(),\n\n /** Default size for all child buttons (can be overridden per-button) */\n size: z.enum(['sm', 'default', 'lg', 'icon']).optional(),\n\n /** Disable all buttons in the group */\n isDisabled: z.boolean().optional(),\n\n /** Accessible label for the toolbar (recommended) */\n 'aria-label': z.string().optional(),\n\n /** ID of element that labels the toolbar */\n 'aria-labelledby': z.string().optional(),\n\n /** Additional CSS classes */\n className: z.string().optional(),\n\n /** Child elements (Buttons, Separators, etc.) */\n children: z.custom<ReactNode>(),\n});\n\n/**\n * ButtonGroupSeparator props schema\n * Validates props for the visual separator between button groups\n */\nexport const ButtonGroupSeparatorPropsSchema = z.object({\n /** Additional CSS classes */\n className: z.string().optional(),\n /** Test ID for testing */\n 'data-testid': z.string().optional(),\n});\n\n// =============================================================================\n// TypeScript Types (inferred from schemas)\n// =============================================================================\n\n/**\n * Props for the ButtonGroup container component\n */\nexport type ButtonGroupProps = z.infer<typeof ButtonGroupPropsSchema>;\n\n/**\n * Props for the ButtonGroupSeparator component\n */\nexport type ButtonGroupSeparatorProps = z.infer<\n typeof ButtonGroupSeparatorPropsSchema\n>;\n\n// =============================================================================\n// Context Types\n// =============================================================================\n\n/**\n * Group-level context value\n * Provides inherited props to all child buttons\n */\nexport interface ButtonGroupContextValue {\n /** Orientation of the group (affects keyboard navigation and styling) */\n orientation: ButtonGroupOrientation;\n /** Default variant for buttons (can be overridden) */\n variant?: ButtonGroupVariant;\n /** Default size for buttons (can be overridden) */\n size?: ButtonGroupSize;\n /** Whether all buttons in the group are disabled */\n isDisabled?: boolean;\n}\n\n/**\n * Item-level context value\n * Provides position information to each button for border-radius styling\n */\nexport interface ButtonGroupItemContextValue {\n /** Position of this button in the group */\n position: ButtonPosition;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/elements/Card/Card.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAqC,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAmB/F,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;6EAqHhB,CAAC;AAQF,eAAO,MAAM,UAAU;;;;;;;;;;6EAUtB,CAAC;AAQF,eAAO,MAAM,SAAS;;;;;;;;;;;2FAUrB,CAAC;AAQF,eAAO,MAAM,eAAe;;;;;;;;;;+FAU3B,CAAC;AAQF,eAAO,MAAM,WAAW;;;;;;;;;;mFAMvB,CAAC;AAQF,eAAO,MAAM,UAAU;;;;;;;;;;6EAUtB,CAAC;AAQF,eAAO,MAAM,UAAU;;;;;;;;;;mFAUtB,CAAC"}
1
+ {"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/elements/Card/Card.tsx"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,EAAqC,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAmB/F,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;6EAqHhB,CAAC;AAQF,eAAO,MAAM,UAAU;;;;;;;;;;6EAUtB,CAAC;AAQF,eAAO,MAAM,SAAS;;;;;;;;;;;2FAUrB,CAAC;AAQF,eAAO,MAAM,eAAe;;;;;;;;;;+FAU3B,CAAC;AAQF,eAAO,MAAM,WAAW;;;;;;;;;;mFAMvB,CAAC;AAQF,eAAO,MAAM,UAAU;;;;;;;;;;6EAUtB,CAAC;AAQF,eAAO,MAAM,UAAU;;;;;;;;;;mFAUtB,CAAC"}
@@ -1,85 +1,3 @@
1
- 'use strict';
2
-
3
- var chunkWJGLM4CY_js = require('../../chunk-WJGLM4CY.js');
4
- require('../../chunk-3YOY2VJ6.js');
5
- require('../../chunk-Y3GT7ETK.js');
6
- require('../../chunk-B5Q4UPL6.js');
7
- require('../../chunk-VIREG536.js');
8
- require('../../chunk-T4COXKQ3.js');
9
-
10
-
11
-
12
- Object.defineProperty(exports, "Card", {
13
- enumerable: true,
14
- get: function () { return chunkWJGLM4CY_js.Card; }
15
- });
16
- Object.defineProperty(exports, "CardAction", {
17
- enumerable: true,
18
- get: function () { return chunkWJGLM4CY_js.CardAction; }
19
- });
20
- Object.defineProperty(exports, "CardActionPropsSchema", {
21
- enumerable: true,
22
- get: function () { return chunkWJGLM4CY_js.CardActionPropsSchema; }
23
- });
24
- Object.defineProperty(exports, "CardContent", {
25
- enumerable: true,
26
- get: function () { return chunkWJGLM4CY_js.CardContent; }
27
- });
28
- Object.defineProperty(exports, "CardContentPropsSchema", {
29
- enumerable: true,
30
- get: function () { return chunkWJGLM4CY_js.CardContentPropsSchema; }
31
- });
32
- Object.defineProperty(exports, "CardDescription", {
33
- enumerable: true,
34
- get: function () { return chunkWJGLM4CY_js.CardDescription; }
35
- });
36
- Object.defineProperty(exports, "CardDescriptionPropsSchema", {
37
- enumerable: true,
38
- get: function () { return chunkWJGLM4CY_js.CardDescriptionPropsSchema; }
39
- });
40
- Object.defineProperty(exports, "CardFooter", {
41
- enumerable: true,
42
- get: function () { return chunkWJGLM4CY_js.CardFooter; }
43
- });
44
- Object.defineProperty(exports, "CardFooterPropsSchema", {
45
- enumerable: true,
46
- get: function () { return chunkWJGLM4CY_js.CardFooterPropsSchema; }
47
- });
48
- Object.defineProperty(exports, "CardHeader", {
49
- enumerable: true,
50
- get: function () { return chunkWJGLM4CY_js.CardHeader; }
51
- });
52
- Object.defineProperty(exports, "CardHeaderPropsSchema", {
53
- enumerable: true,
54
- get: function () { return chunkWJGLM4CY_js.CardHeaderPropsSchema; }
55
- });
56
- Object.defineProperty(exports, "CardPropsSchema", {
57
- enumerable: true,
58
- get: function () { return chunkWJGLM4CY_js.CardPropsSchema; }
59
- });
60
- Object.defineProperty(exports, "CardTitle", {
61
- enumerable: true,
62
- get: function () { return chunkWJGLM4CY_js.CardTitle; }
63
- });
64
- Object.defineProperty(exports, "CardTitlePropsSchema", {
65
- enumerable: true,
66
- get: function () { return chunkWJGLM4CY_js.CardTitlePropsSchema; }
67
- });
68
- Object.defineProperty(exports, "FlipButtonIconSchema", {
69
- enumerable: true,
70
- get: function () { return chunkWJGLM4CY_js.FlipButtonIconSchema; }
71
- });
72
- Object.defineProperty(exports, "FlipButtonLabelSchema", {
73
- enumerable: true,
74
- get: function () { return chunkWJGLM4CY_js.FlipButtonLabelSchema; }
75
- });
76
- Object.defineProperty(exports, "FlipButtonPositionSchema", {
77
- enumerable: true,
78
- get: function () { return chunkWJGLM4CY_js.FlipButtonPositionSchema; }
79
- });
80
- Object.defineProperty(exports, "flipButtonPositionVariants", {
81
- enumerable: true,
82
- get: function () { return chunkWJGLM4CY_js.flipButtonPositionVariants; }
83
- });
84
- //# sourceMappingURL=index.js.map
1
+ "use client";
2
+ 'use strict';var react=require('react'),lucideReact=require('lucide-react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),reactAriaComponents=require('react-aria-components'),classVarianceAuthority=require('class-variance-authority'),jsxRuntime=require('react/jsx-runtime'),zod=require('zod');function n(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var G=classVarianceAuthority.cva("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",{variants:{fullWidth:{true:"w-full",false:""},inVerticalGroup:{true:"items-stretch",false:"items-center"}},defaultVariants:{fullWidth:false,inVerticalGroup:false}}),_=classVarianceAuthority.cva("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",{variants:{variant:{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",destructive:"bg-[var(--destructive-background)] text-[var(--destructive-foreground)] shadow-md hover:bg-[var(--destructive-background)]/90 data-[pressed]:bg-[var(--destructive-background)]/80",outline:"border border-[var(--input-border)] bg-[var(--page-background)] hover:bg-[var(--input-border)] data-[pressed]:bg-[var(--input-border)]",secondary:"bg-[var(--secondary)] text-[var(--secondary-foreground)] shadow-md hover:bg-[var(--secondary)]/80 data-[pressed]:bg-[var(--secondary)]/70",ghost:"hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)] data-[pressed]:bg-[var(--accent)]",link:"text-[var(--text-link)] underline-offset-4 hover:underline data-[pressed]:text-[var(--text-link-hover)]"},fullWidth:{true:"w-full",false:""},visualSize:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3 text-xs",lg:"h-11 rounded-md px-8",icon:"h-10 w-10",dot:"h-5 w-5 rounded-full p-0 min-h-0 min-w-0"},paywall:{true:"!bg-[var(--paywall)] !text-[var(--paywall-foreground)] !shadow-md hover:!bg-[var(--paywall)]/90 !cursor-not-allowed !border-transparent",false:""}},defaultVariants:{variant:"default",visualSize:"default",paywall:false}});var k="data-[pressed]:scale-[0.97]";var M="data-[hovered]:shadow-md";var L="hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground",F="hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground";var K=react.createContext(null);K.displayName="ButtonGroupContext";function Q(){return react.useContext(K)}var X=react.createContext(null);X.displayName="ButtonGroupItemContext";function tt(){return react.useContext(X)}classVarianceAuthority.cva("inline-flex items-center gap-0",{variants:{orientation:{horizontal:"flex-row",vertical:"flex-col w-full"}},defaultVariants:{orientation:"horizontal"}});var et=classVarianceAuthority.cva("",{variants:{orientation:{horizontal:"min-w-[44px]",vertical:"flex min-h-[44px]"},position:{first:"",middle:"",last:"",only:""}},compoundVariants:[{orientation:"horizontal",position:"first",className:"rounded-r-none border-r-0"},{orientation:"horizontal",position:"middle",className:"rounded-none border-r-0"},{orientation:"horizontal",position:"last",className:"rounded-l-none"},{orientation:"vertical",position:"first",className:"rounded-b-none border-b-0"},{orientation:"vertical",position:"middle",className:"rounded-none border-b-0"},{orientation:"vertical",position:"last",className:"rounded-t-none"}],defaultVariants:{orientation:"horizontal",position:"only"}});classVarianceAuthority.cva("bg-[var(--border)]",{variants:{orientation:{horizontal:"w-px h-6 mx-1",vertical:"h-px w-full my-1"}},defaultVariants:{orientation:"horizontal"}});var I=react.memo(react.forwardRef(({className:e,buttonVisualClassName:o,variant:r,size:a,visualSize:h,fullWidth:w,loading:m=false,loadingText:A="Loading...",shortcut:v,children:S,isDisabled:P,paywall:s=false,paywallRedirect:N,paywallDescription:B,onPress:z,...T},x)=>{let p=react.useId(),c=Q(),H=tt(),R=r??c?.variant??"default",E=a??c?.size,D=P??c?.isDisabled??false,V=c?.orientation==="vertical",C=w||V,f=H?et({orientation:c?.orientation??"horizontal",position:H.position}):"",g=h??E??"default";return process.env.NODE_ENV!=="production"&&(g==="dot"||g==="icon")&&!T["aria-label"]&&!S&&console.warn('[Button] visualSize="dot" or "icon" requires aria-label when no visible text is provided (WCAG 1.1.1)'),jsxRuntime.jsx(reactAriaComponents.Button,{ref:x,isDisabled:D||m||void 0,"aria-disabled":s?true:void 0,"aria-describedby":s?p:void 0,onPress:y=>{if(s){N&&window.open(N,"_blank","noopener,noreferrer");return}z?.(y);},className:n(G({fullWidth:C,inVerticalGroup:V}),e),...T,children:y=>jsxRuntime.jsxs("span",{className:n(_({variant:R,visualSize:g,paywall:s,fullWidth:C}),f,o,k,M,L,F),"data-pressed":y.isPressed||void 0,children:[m&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.Loader2,{className:"motion-safe:animate-spin","aria-hidden":"true"}),jsxRuntime.jsx("span",{className:"sr-only","aria-live":"polite",children:A})]}),!m&&S,s&&jsxRuntime.jsx(lucideReact.Zap,{"data-testid":"zap-icon","aria-hidden":"true",className:"ml-1"}),s&&jsxRuntime.jsxs("span",{id:p,className:"sr-only",children:["Premium feature: ",B||"Upgrade required to access this feature"]}),y.isFocusVisible&&v&&jsxRuntime.jsx("kbd",{className:"ml-auto hidden text-xs opacity-60 lg:inline",children:v}),y.isPressed&&jsxRuntime.jsx("span",{className:"absolute inset-0 rounded-[inherit] bg-current opacity-10 motion-safe:animate-in motion-safe:zoom-in-95","aria-hidden":"true"})]})})}));I.displayName="Button";var l=zod.z.object({className:zod.z.string().optional(),children:zod.z.any().optional(),id:zod.z.string().optional(),"aria-label":zod.z.string().optional(),"aria-labelledby":zod.z.string().optional(),"aria-describedby":zod.z.string().optional(),"aria-live":zod.z.enum(["off","polite","assertive"]).optional(),"aria-hidden":zod.z.boolean().optional(),"data-testid":zod.z.string().optional()});var ot=zod.z.enum(["top-right","top-left","bottom-right","bottom-left"]),rt=zod.z.object({show:zod.z.string().optional(),hide:zod.z.string().optional()}),at=zod.z.object({front:zod.z.custom().optional(),back:zod.z.custom().optional()}),Pt=l.extend({flippable:zod.z.boolean().optional().default(false),backContent:zod.z.custom().optional(),isFlipped:zod.z.boolean().optional(),defaultFlipped:zod.z.boolean().optional().default(false),onFlipChange:zod.z.custom().optional(),flipButtonPosition:ot.optional().default("top-right"),flipButtonLabel:rt.optional(),flipButtonIcon:at.optional(),flipDuration:zod.z.number().optional().default(600)}),Nt=l.extend({children:zod.z.custom()}),Bt=l.extend({as:zod.z.enum(["h1","h2","h3","h4","h5","h6"]).optional().default("h3"),children:zod.z.custom()}),Tt=l.extend({children:zod.z.custom()}),Ht=l.extend({children:zod.z.custom()}),Et=l.extend({children:zod.z.custom()}),Vt=l.extend({children:zod.z.custom()}),W=classVarianceAuthority.cva(["absolute z-10 min-h-[44px] min-w-[44px] p-2","flex items-center justify-center","rounded-full bg-[var(--accent-background)]","text-[var(--primary-action)] hover:text-[var(--primary-action-hover)]","transition-colors duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]"],{variants:{position:{"top-right":"top-2 right-2","top-left":"top-2 left-2","bottom-right":"bottom-2 right-2","bottom-left":"bottom-2 left-2"}},defaultVariants:{position:"top-right"}});var nt=react.forwardRef((e,o)=>{let{children:r,className:a,flippable:h=false,backContent:w,isFlipped:m,defaultFlipped:A=false,onFlipChange:v,flipButtonPosition:S="top-right",flipButtonLabel:P,flipButtonIcon:s,flipDuration:N=600,...B}=e,[z,T]=react.useState(A),x=m!==void 0,p=x?m:z,c=react.useCallback(()=>{let f=!p;x||T(f),v?.(f);},[p,x,v]);if(!h)return jsxRuntime.jsx("article",{ref:o,className:n("rounded-lg border border-[var(--border)] bg-[var(--content-background)] text-[var(--content-foreground)] shadow-sm",a),...B,children:r});let H=P?.show??"Show more details",R=P?.hide??"Show less details",E=jsxRuntime.jsx(lucideReact.RotateCcw,{className:"h-5 w-5","aria-hidden":"true"}),D=s?.front??E,V=s?.back??s?.front??E,C=({label:f,icon:g})=>jsxRuntime.jsx(I,{variant:"ghost",visualSize:"icon","aria-hidden":true,excludeFromTabOrder:true,onPress:c,className:W({position:S}),"aria-label":f,children:g});return jsxRuntime.jsx("article",{ref:o,className:n("relative",a),style:{perspective:"1000px"},...B,children:jsxRuntime.jsxs("div",{className:n("relative transition-transform","motion-reduce:transition-none"),style:{transformStyle:"preserve-3d",transitionDuration:`${N}ms`,transform:p?"rotateY(180deg)":"rotateY(0deg)"},"data-flipped":p,children:[jsxRuntime.jsxs("div",{className:"relative rounded-lg border border-[var(--border)] bg-[var(--content-background)] text-[var(--content-foreground)] shadow-sm",style:{backfaceVisibility:"hidden"},"data-side":"front",children:[r,jsxRuntime.jsx(C,{label:H,icon:D})]}),jsxRuntime.jsxs("div",{className:"absolute inset-0 overflow-y-auto rounded-lg border border-[var(--border)] bg-[var(--content-background)] text-[var(--content-foreground)] shadow-sm",style:{backfaceVisibility:"hidden",transform:"rotateY(180deg)"},"data-side":"back",children:[w,jsxRuntime.jsx(C,{label:R,icon:V})]})]})})});nt.displayName="Card";var it=react.forwardRef(({className:e,children:o,...r},a)=>jsxRuntime.jsx("header",{ref:a,className:n("flex flex-col space-y-1.5 p-6",e),...r,children:o}));it.displayName="CardHeader";var st=react.forwardRef(({className:e,as:o="h3",children:r,...a},h)=>jsxRuntime.jsx(o,{ref:h,className:n("text-2xl font-semibold leading-none tracking-tight",e),...a,children:r}));st.displayName="CardTitle";var dt=react.forwardRef(({className:e,children:o,...r},a)=>jsxRuntime.jsx("p",{ref:a,className:n("text-sm text-[var(--content-foreground-muted)]",e),...r,children:o}));dt.displayName="CardDescription";var lt=react.forwardRef(({className:e,children:o,...r},a)=>jsxRuntime.jsx("div",{ref:a,className:n("p-6 pt-0",e),...r,children:o}));lt.displayName="CardContent";var pt=react.forwardRef(({className:e,children:o,...r},a)=>jsxRuntime.jsx("footer",{ref:a,className:n("flex items-center p-6 pt-0",e),...r,children:o}));pt.displayName="CardFooter";var ct=react.forwardRef(({className:e,children:o,...r},a)=>jsxRuntime.jsx("div",{ref:a,className:n("ml-auto",e),...r,children:o}));ct.displayName="CardAction";exports.Card=nt;exports.CardAction=ct;exports.CardActionPropsSchema=Vt;exports.CardContent=lt;exports.CardContentPropsSchema=Ht;exports.CardDescription=dt;exports.CardDescriptionPropsSchema=Tt;exports.CardFooter=pt;exports.CardFooterPropsSchema=Et;exports.CardHeader=it;exports.CardHeaderPropsSchema=Nt;exports.CardPropsSchema=Pt;exports.CardTitle=st;exports.CardTitlePropsSchema=Bt;exports.FlipButtonIconSchema=at;exports.FlipButtonLabelSchema=rt;exports.FlipButtonPositionSchema=ot;exports.flipButtonPositionVariants=W;//# sourceMappingURL=index.js.map
85
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
1
+ {"version":3,"sources":["../../../src/utils/cn.ts","../../../src/elements/Button/Button.styles.ts","../../../src/styles/interaction-states.ts","../../../src/elements/ButtonGroup/ButtonGroupContext.tsx","../../../src/elements/ButtonGroup/ButtonGroup.variants.ts","../../../src/elements/Button/Button.tsx","../../../src/schemas/BaseComponentProps.ts","../../../src/elements/Card/Card.types.ts","../../../src/elements/Card/Card.tsx"],"names":["cn","inputs","twMerge","clsx","buttonOuterVariants","cva","buttonVisualVariants","PRESSED_STYLES","HOVER_STYLES","HIGH_CONTRAST_HOVER","HIGH_CONTRAST_PRESSED","ButtonGroupContext","createContext","useButtonGroupContext","useContext","ButtonGroupItemContext","useButtonGroupItemContext","buttonGroupItemVariants","Button","memo","forwardRef","className","buttonVisualClassName","variant","size","visualSize","fullWidth","loading","loadingText","shortcut","children","isDisabled","paywall","paywallRedirect","paywallDescription","onPress","props","ref","paywallDescriptionId","useId","groupContext","itemContext","effectiveVariant","effectiveSize","effectiveIsDisabled","isInVerticalGroup","effectiveFullWidth","positionClassName","effectiveVisualSize","jsx","AriaButton","e","renderProps","jsxs","Fragment","Loader2","Zap","BaseComponentPropsSchema","z","FlipButtonPositionSchema","FlipButtonLabelSchema","FlipButtonIconSchema","CardPropsSchema","CardHeaderPropsSchema","CardTitlePropsSchema","CardDescriptionPropsSchema","CardContentPropsSchema","CardFooterPropsSchema","CardActionPropsSchema","flipButtonPositionVariants","Card","flippable","backContent","controlledFlipped","defaultFlipped","onFlipChange","flipButtonPosition","flipButtonLabel","flipButtonIcon","flipDuration","rest","internalFlipped","setInternalFlipped","useState","isControlled","flipped","handleFlip","useCallback","newState","showLabel","hideLabel","defaultIcon","RotateCcw","frontIcon","backIcon","FlipButton","label","icon","CardHeader","CardTitle","Comp","CardDescription","CardContent","CardFooter","CardAction"],"mappings":"oTAcO,SAASA,CAAAA,CAAAA,GAAMC,EAA8B,CAClD,OAAOC,sBAAQC,SAAAA,CAAKF,CAAM,CAAC,CAC7B,CCLO,IAAMG,EAAsBC,0BAAAA,CACjC,yPAAA,CACA,CACE,QAAA,CAAU,CACR,UAAW,CACT,IAAA,CAAM,QAAA,CACN,KAAA,CAAO,EACT,CAAA,CACA,eAAA,CAAiB,CACf,IAAA,CAAM,eAAA,CACN,MAAO,cACT,CACF,CAAA,CACA,eAAA,CAAiB,CACf,SAAA,CAAW,KAAA,CACX,gBAAiB,KACnB,CACF,CACF,CAAA,CAQaC,CAAAA,CAAuBD,0BAAAA,CAClC,6NAAA,CACA,CACE,QAAA,CAAU,CACR,OAAA,CAAS,CACP,QACE,kKAAA,CACF,WAAA,CACE,oLAAA,CACF,OAAA,CACE,yIACF,SAAA,CACE,2IAAA,CACF,MACE,kGAAA,CACF,IAAA,CAAM,yGACR,CAAA,CACA,SAAA,CAAW,CACT,IAAA,CAAM,SACN,KAAA,CAAO,EACT,EACA,UAAA,CAAY,CACV,QAAS,gBAAA,CACT,EAAA,CAAI,6BAAA,CACJ,EAAA,CAAI,uBACJ,IAAA,CAAM,WAAA,CACN,IAAK,0CACP,CAAA,CACA,QAAS,CACP,IAAA,CAAM,yIAAA,CACN,KAAA,CAAO,EACT,CACF,CAAA,CACA,eAAA,CAAiB,CACf,QAAS,SAAA,CACT,UAAA,CAAY,SAAA,CACZ,OAAA,CAAS,KACX,CACF,CACF,ECxDO,IAUME,CAAAA,CAAiB,8BAevB,IAAMC,CAAAA,CAAe,2BAarB,IAMMC,CAAAA,CAAsB,4FAAA,CAMtBC,EAAwB,+HAAA,CClCrC,IAAMC,CAAAA,CAAqBC,mBAAAA,CAA8C,IAAI,CAAA,CAE7ED,CAAAA,CAAmB,YAAc,oBAAA,CAM1B,SAASE,CAAAA,EAAwD,CACtE,OAAOC,gBAA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Ac,YAAA,KAMZC,EAAAA,CAAapF,gBAAAA,CACxB,CAAC,CAAE,SAAA,CAAAC,EAAW,QAAA,CAAAS,CAAAA,CAAU,GAAGM,CAAM,EAAGC,CAAAA,GAClCY,cAAAA,CAAC,OACC,GAAA,CAAKZ,CAAAA,CACL,UAAWrC,CAAAA,CAAG,SAAA,CAAWqB,CAAS,CAAA,CACjC,GAAGe,CAAAA,CAEH,QAAA,CAAAN,EACH,CAEJ,EAEA0E,GAAW,WAAA,CAAc,YAAA","file":"index.js","sourcesContent":["/**\n * Class Name Utility\n * Merges Tailwind CSS classes with conflict resolution\n *\n * Combines clsx for conditional classes and tailwind-merge for deduplication\n *\n * @example\n * cn('px-2 py-1', 'px-4') // => 'py-1 px-4' (px-4 overrides px-2)\n * cn('text-red-500', condition && 'text-blue-500') // => conditional application\n */\n\nimport { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","import { cva } from 'class-variance-authority';\n\n/**\n * Layer 1: Transparent outer touch target (44x44px minimum)\n * Handles WCAG 2.2 AAA touch target requirement\n * Always transparent, centers the visual button inside\n * IMPORTANT: Focus ring stays on Layer 1 for AAA compliance (2.4.13)\n *\n * In vertical ButtonGroups, uses items-stretch so the visual layer (Layer 2)\n * can fill the full touch target height, eliminating gaps between buttons.\n */\nexport const buttonOuterVariants = cva(\n \"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\",\n {\n variants: {\n fullWidth: {\n true: \"w-full\",\n false: \"\",\n },\n inVerticalGroup: {\n true: \"items-stretch\",\n false: \"items-center\",\n },\n },\n defaultVariants: {\n fullWidth: false,\n inVerticalGroup: false,\n },\n }\n);\n\n/**\n * Layer 2: Visual button appearance (adjustable size)\n * Provides the visual appearance with configurable size\n * Can be smaller than touch target for use cases like carousel dots\n * NOTE: NO focus-visible styles here - focus ring is on Layer 1\n */\nexport const buttonVisualVariants = cva(\n \"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\",\n {\n variants: {\n variant: {\n default:\n \"bg-[var(--primary-action)] text-[var(--primary-action-foreground)] shadow-md hover:bg-[var(--primary-action-hover)] data-[pressed]:bg-[var(--primary-action)]/80\",\n destructive:\n \"bg-[var(--destructive-background)] text-[var(--destructive-foreground)] shadow-md hover:bg-[var(--destructive-background)]/90 data-[pressed]:bg-[var(--destructive-background)]/80\",\n outline:\n \"border border-[var(--input-border)] bg-[var(--page-background)] hover:bg-[var(--input-border)] data-[pressed]:bg-[var(--input-border)]\",\n secondary:\n \"bg-[var(--secondary)] text-[var(--secondary-foreground)] shadow-md hover:bg-[var(--secondary)]/80 data-[pressed]:bg-[var(--secondary)]/70\",\n ghost:\n \"hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)] data-[pressed]:bg-[var(--accent)]\",\n link: \"text-[var(--text-link)] underline-offset-4 hover:underline data-[pressed]:text-[var(--text-link-hover)]\",\n },\n fullWidth: {\n true: \"w-full\",\n false: \"\",\n },\n visualSize: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3 text-xs\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-10 w-10\",\n dot: \"h-5 w-5 rounded-full p-0 min-h-0 min-w-0\",\n },\n paywall: {\n true: \"!bg-[var(--paywall)] !text-[var(--paywall-foreground)] !shadow-md hover:!bg-[var(--paywall)]/90 !cursor-not-allowed !border-transparent\",\n false: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n visualSize: \"default\",\n paywall: false,\n },\n }\n);\n\n/**\n * @deprecated Use buttonVisualVariants instead. This alias is kept for backward compatibility.\n */\nexport const buttonVariants = buttonVisualVariants;\n","/**\n * Global Interaction State Styles\n *\n * Consistent interaction patterns across all Themis components.\n * These styles ensure WCAG 2.2 AAA compliance and predictable UX.\n *\n * @see spec.md FR-010 (Visible focus ring for keyboard navigation)\n * @see spec.md FR-031 (Pressed state feedback)\n * @see spec.md FR-012 (High contrast mode support)\n * @see constitution.md Principle IV (Accessibility First)\n */\n\n/**\n * Focus state styles (FR-010)\n * Visible focus ring for keyboard navigation - WCAG 2.2 Level AAA\n *\n * Components can override by extending these styles:\n * @example\n * cn(FOCUS_STYLES, \"ring-4\") // Increases ring width to 4px\n */\nexport const FOCUS_STYLES = \"data-[focus-visible]:ring-2 data-[focus-visible]:ring-[var(--themis-ring)] data-[focus-visible]:ring-offset-2\";\n\n/**\n * Pressed/Active state styles (FR-031)\n * Visual feedback for press interactions\n *\n * Components can override the scale amount:\n * @example\n * cn(PRESSED_STYLES_BASE, \"data-[pressed]:scale-[0.95]\") // More pronounced scale\n */\nexport const PRESSED_STYLES = \"data-[pressed]:scale-[0.97]\";\n\n/**\n * Base pressed styles without scale (for components that need different feedback)\n */\nexport const PRESSED_STYLES_BASE = \"data-[pressed]:transition-transform data-[pressed]:duration-100\";\n\n/**\n * Hover state styles\n * Elevation change on hover for better affordance\n *\n * Components can override shadow depth:\n * @example\n * cn(HOVER_STYLES_BASE, \"data-[hovered]:shadow-lg\") // Larger shadow\n */\nexport const HOVER_STYLES = \"data-[hovered]:shadow-md\";\n\n/**\n * Base hover styles without shadow (for components that use different hover effects)\n */\nexport const HOVER_STYLES_BASE = \"data-[hovered]:transition-shadow data-[hovered]:duration-200\";\n\n/**\n * High contrast mode focus (FR-012)\n * Enhanced outlines for users requiring high contrast\n *\n * Uses 'hc:' prefix for prefers-contrast: more media query\n */\nexport const HIGH_CONTRAST_FOCUS = \"hc:data-[focus-visible]:outline hc:data-[focus-visible]:outline-4 hc:data-[focus-visible]:outline-offset-2 hc:data-[focus-visible]:outline-foreground\";\n\n/**\n * High contrast mode hover (FR-012)\n * Enhanced outlines for hover in high contrast mode\n */\nexport const HIGH_CONTRAST_HOVER = \"hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground\";\n\n/**\n * High contrast mode pressed state\n * Enhanced outlines for pressed state in high contrast mode\n */\nexport const HIGH_CONTRAST_PRESSED = \"hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground\";\n\n/**\n * Combined high contrast styles\n * Use this for components that need all high contrast interaction states\n */\nexport const HIGH_CONTRAST_INTERACTIONS = `${HIGH_CONTRAST_FOCUS} ${HIGH_CONTRAST_HOVER} ${HIGH_CONTRAST_PRESSED}`;\n\n/**\n * Disabled state styles\n * Consistent disabled appearance across all components\n */\nexport const DISABLED_STYLES = \"disabled:pointer-events-none disabled:opacity-50\";\n\n/**\n * Default interaction bundle\n * Most common combination for interactive components\n *\n * Includes: focus ring, pressed scale, hover shadow, high contrast enhancements\n *\n * @example\n * <button className={cn(DEFAULT_INTERACTIONS, \"bg-primary\")}>Click</button>\n */\nexport const DEFAULT_INTERACTIONS = `${FOCUS_STYLES} ${PRESSED_STYLES} ${HOVER_STYLES} ${HIGH_CONTRAST_FOCUS} ${HIGH_CONTRAST_HOVER} ${HIGH_CONTRAST_PRESSED}`;\n\n/**\n * Subtle interaction bundle\n * For components that need less pronounced feedback\n *\n * Includes: focus ring and high contrast, but no hover shadow or pressed scale\n */\nexport const SUBTLE_INTERACTIONS = `${FOCUS_STYLES} ${HIGH_CONTRAST_FOCUS}`;\n\n/**\n * Non-interactive element styles\n * For elements that should indicate they are not interactive\n */\nexport const NON_INTERACTIVE = \"cursor-default select-none\";\n","\"use client\";\n\nimport { createContext, useContext } from 'react';\nimport type {\n ButtonGroupContextValue,\n ButtonGroupItemContextValue,\n} from './ButtonGroup.types';\n\n/**\n * ButtonGroup Context System (Two-Level)\n *\n * Provides a two-level context pattern for ButtonGroup:\n *\n * 1. ButtonGroupContext (group-level):\n * - Provides: orientation, variant, size, isDisabled\n * - Consumed by: Button (for prop inheritance), Separator (for orientation)\n *\n * 2. ButtonGroupItemContext (item-level):\n * - Provides: position ('first' | 'middle' | 'last' | 'only')\n * - Consumed by: Button (for border-radius styling)\n *\n * Both contexts return null when not in a provider, allowing Button\n * to work standalone without any group context.\n *\n * @see plan.md for architecture details\n * @see ButtonGroup.tsx for Provider implementation\n */\n\n// =============================================================================\n// Group-Level Context\n// =============================================================================\n\n/**\n * Context for group-level props (orientation, variant, size, isDisabled)\n * Default value is null to indicate \"not in a group\"\n */\nconst ButtonGroupContext = createContext<ButtonGroupContextValue | null>(null);\n\nButtonGroupContext.displayName = 'ButtonGroupContext';\n\n/**\n * Hook to access group-level context\n * @returns ButtonGroupContextValue if inside a ButtonGroup, null otherwise\n */\nexport function useButtonGroupContext(): ButtonGroupContextValue | null {\n return useContext(ButtonGroupContext);\n}\n\n// =============================================================================\n// Item-Level Context\n// =============================================================================\n\n/**\n * Context for per-button position information\n * Default value is null to indicate \"not wrapped with position context\"\n */\nconst ButtonGroupItemContext =\n createContext<ButtonGroupItemContextValue | null>(null);\n\nButtonGroupItemContext.displayName = 'ButtonGroupItemContext';\n\n/**\n * Hook to access item-level context (position)\n * @returns ButtonGroupItemContextValue if wrapped with position context, null otherwise\n */\nexport function useButtonGroupItemContext(): ButtonGroupItemContextValue | null {\n return useContext(ButtonGroupItemContext);\n}\n\n// =============================================================================\n// Exports\n// =============================================================================\n\nexport { ButtonGroupContext, ButtonGroupItemContext };\n","import { cva } from 'class-variance-authority';\n\n/**\n * ButtonGroup CVA Variants\n *\n * Defines Class Variance Authority (CVA) variants for:\n * - ButtonGroup container (orientation-based layout)\n * - ButtonGroupItem (position-based border-radius)\n * - ButtonGroupSeparator (orientation-based styling)\n *\n * @see plan.md Phase 1: Design & Contracts - CVA Variants\n * @see constitution.md Principle V (Component Quality Standards)\n */\n\n// =============================================================================\n// Container Variants\n// =============================================================================\n\n/**\n * ButtonGroup container variants\n * Controls the layout direction based on orientation\n * Uses gap-0 to ensure buttons are connected (share borders)\n */\nexport const buttonGroupVariants = cva('inline-flex items-center gap-0', {\n variants: {\n orientation: {\n horizontal: 'flex-row',\n vertical: 'flex-col w-full',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n },\n});\n\n// =============================================================================\n// Item Position Variants\n// =============================================================================\n\n/**\n * ButtonGroupItem position variants\n * Applied to Button's visual layer (Layer 2) for position-aware border-radius\n *\n * Compound variants handle both orientation and position combinations:\n * - Horizontal: left/right borders and radii\n * - Vertical: top/bottom borders and radii\n */\nexport const buttonGroupItemVariants = cva('', {\n variants: {\n orientation: {\n // min-w-[44px] ensures visual layer fills touch target width (for icon buttons)\n horizontal: 'min-w-[44px]',\n // flex (overrides inline-flex) + min-h-[44px] makes visual layer fill touch target,\n // eliminating gaps between stacked buttons in vertical orientation\n vertical: 'flex min-h-[44px]',\n },\n position: {\n first: '',\n middle: '',\n last: '',\n only: '', // Single button - no modifications needed\n },\n },\n compoundVariants: [\n // ==========================================================================\n // Horizontal Orientation\n // ==========================================================================\n {\n orientation: 'horizontal',\n position: 'first',\n className: 'rounded-r-none border-r-0',\n },\n {\n orientation: 'horizontal',\n position: 'middle',\n className: 'rounded-none border-r-0',\n },\n {\n orientation: 'horizontal',\n position: 'last',\n className: 'rounded-l-none',\n },\n // ==========================================================================\n // Vertical Orientation\n // Note: w-full is handled by Button's effectiveFullWidth for both layers\n // ==========================================================================\n {\n orientation: 'vertical',\n position: 'first',\n className: 'rounded-b-none border-b-0',\n },\n {\n orientation: 'vertical',\n position: 'middle',\n className: 'rounded-none border-b-0',\n },\n {\n orientation: 'vertical',\n position: 'last',\n className: 'rounded-t-none',\n },\n ],\n defaultVariants: {\n orientation: 'horizontal',\n position: 'only',\n },\n});\n\n// =============================================================================\n// Separator Variants\n// =============================================================================\n\n/**\n * ButtonGroupSeparator variants\n * Orientation-aware visual divider between button groups\n */\nexport const buttonGroupSeparatorVariants = cva('bg-[var(--border)]', {\n variants: {\n orientation: {\n horizontal: 'w-px h-6 mx-1',\n vertical: 'h-px w-full my-1',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n },\n});\n","\"use client\";\n\n/**\n * Button Component - 3-Layer Architecture\n * Accessible button with React Aria primitives and CVA styling\n *\n * Architecture:\n * - Layer 1: Touch Target (44x44px WCAG AAA compliant, transparent)\n * - Layer 2: Visual Button (configurable size, colors, borders)\n * - Layer 3: Content & Effects (text, icons, ripple, loading spinner)\n *\n * @see 3layer-plan.md for architecture details\n * @see spec.md FR-029 to FR-037 (Button Component Requirements)\n * @see spec.md FR-009 (WCAG 2.2 AAA - 7:1 contrast ratio)\n * @see spec.md FR-014 (44x44px minimum touch targets)\n * @see constitution.md Principle IV (Accessibility First)\n */\n\nimport { forwardRef, memo, useId } from 'react';\nimport {\n Button as AriaButton,\n type ButtonProps as AriaButtonProps,\n} from 'react-aria-components';\nimport { Loader2, Zap } from 'lucide-react';\nimport { cn } from '../../utils/cn';\nimport type { ButtonProps } from './Button.types';\nimport { buttonOuterVariants, buttonVisualVariants, buttonVariants } from './Button.styles';\nimport { PRESSED_STYLES, HOVER_STYLES, HIGH_CONTRAST_HOVER, HIGH_CONTRAST_PRESSED } from '../../styles/interaction-states';\nimport {\n useButtonGroupContext,\n useButtonGroupItemContext,\n} from '../ButtonGroup/ButtonGroupContext';\nimport { buttonGroupItemVariants } from '../ButtonGroup/ButtonGroup.variants';\n\n/**\n * Button Component - 3-Layer Architecture\n * Fully accessible button with React Aria and themed styling\n *\n * Layer 1: Touch Target (AriaButton) - 44x44px WCAG AAA compliant\n * Layer 2: Visual Button (span) - configurable appearance\n * Layer 3: Content (children) - text, icons, effects\n */\nconst Button = memo(forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n buttonVisualClassName,\n variant,\n size,\n visualSize,\n fullWidth,\n loading = false,\n loadingText = \"Loading...\",\n shortcut,\n children,\n isDisabled,\n paywall = false,\n paywallRedirect,\n paywallDescription,\n onPress,\n ...props\n },\n ref\n ) => {\n const paywallDescriptionId = useId();\n\n // ==========================================================================\n // ButtonGroup Context Integration\n // ==========================================================================\n\n // Consume group-level context (variant, size, isDisabled, orientation)\n const groupContext = useButtonGroupContext();\n\n // Consume item-level context (position for border-radius styling)\n const itemContext = useButtonGroupItemContext();\n\n // Merge context values with props (props take precedence)\n const effectiveVariant = variant ?? groupContext?.variant ?? 'default';\n const effectiveSize = size ?? groupContext?.size;\n const effectiveIsDisabled = isDisabled ?? groupContext?.isDisabled ?? false;\n\n // In vertical groups, buttons should be full width automatically\n const isInVerticalGroup = groupContext?.orientation === 'vertical';\n const effectiveFullWidth = fullWidth || isInVerticalGroup;\n\n // Position styling for ButtonGroup (only applied when in a group)\n const positionClassName = itemContext\n ? buttonGroupItemVariants({\n orientation: groupContext?.orientation ?? 'horizontal',\n position: itemContext.position,\n })\n : '';\n\n // Default visualSize to size for backward compatibility\n const effectiveVisualSize = visualSize ?? effectiveSize ?? 'default';\n\n // AAA Accessibility: Warn in dev/test if icon/dot variant lacks accessible name\n if (process.env.NODE_ENV !== 'production') {\n if (\n (effectiveVisualSize === 'dot' || effectiveVisualSize === 'icon') &&\n !props['aria-label'] &&\n !children\n ) {\n console.warn(\n '[Button] visualSize=\"dot\" or \"icon\" requires aria-label when no visible text is provided (WCAG 1.1.1)'\n );\n }\n }\n\n /**\n * Handle button press - intercepts action when paywalled\n * If paywalled with redirect URL, opens in new tab\n * Otherwise, calls the normal onPress handler\n */\n const handlePress = (e: Parameters<NonNullable<AriaButtonProps['onPress']>>[0]): void => {\n if (paywall) {\n if (paywallRedirect) {\n window.open(paywallRedirect, '_blank', 'noopener,noreferrer');\n }\n // Don't call onPress when paywalled\n return;\n }\n onPress?.(e);\n };\n\n // Only set isDisabled when we have a reason to disable\n // Otherwise, let slot system control disabled state (e.g., in NumberField)\n const computedIsDisabled = effectiveIsDisabled || loading || undefined;\n\n return (\n <AriaButton\n ref={ref}\n isDisabled={computedIsDisabled}\n aria-disabled={paywall ? true : undefined}\n aria-describedby={paywall ? paywallDescriptionId : undefined}\n onPress={handlePress}\n className={cn(buttonOuterVariants({ fullWidth: effectiveFullWidth, inVerticalGroup: isInVerticalGroup }), className)}\n {...props}\n >\n {(renderProps) => (\n /* Layer 2: Visual Button */\n <span\n className={cn(\n buttonVisualVariants({\n variant: effectiveVariant,\n visualSize: effectiveVisualSize,\n paywall,\n fullWidth: effectiveFullWidth,\n }),\n // Position styling from ButtonGroup context (border-radius adjustments)\n positionClassName,\n buttonVisualClassName,\n // Layer 2 interaction styles (no focus - focus ring is on Layer 1)\n PRESSED_STYLES,\n HOVER_STYLES,\n HIGH_CONTRAST_HOVER,\n HIGH_CONTRAST_PRESSED\n )}\n data-pressed={renderProps.isPressed || undefined}\n >\n {/* Layer 3: Content & Effects */}\n\n {/* FR-033: Loading spinner with screen reader announcement */}\n {/* Uses motion-safe: for WCAG 2.3.3 AAA (Animation from Interactions) */}\n {loading && (\n <>\n <Loader2 className=\"motion-safe:animate-spin\" aria-hidden=\"true\" />\n <span className=\"sr-only\" aria-live=\"polite\">\n {loadingText}\n </span>\n </>\n )}\n\n {/* Hide children during loading */}\n {!loading && children}\n\n {/* Paywall: Lightning bolt icon */}\n {paywall && (\n <Zap\n data-testid=\"zap-icon\"\n aria-hidden=\"true\"\n className=\"ml-1\"\n />\n )}\n\n {/* Paywall: Screen reader description */}\n {paywall && (\n <span id={paywallDescriptionId} className=\"sr-only\">\n Premium feature: {paywallDescription || \"Upgrade required to access this feature\"}\n </span>\n )}\n\n {/* FR-034: Keyboard shortcut display on focus */}\n {renderProps.isFocusVisible && shortcut && (\n <kbd className=\"ml-auto hidden text-xs opacity-60 lg:inline\">\n {shortcut}\n </kbd>\n )}\n\n {/* Touch/press ripple effect - FR-031: Pressed state feedback */}\n {/* Uses motion-safe: for WCAG 2.3.3 AAA (Animation from Interactions) */}\n {renderProps.isPressed && (\n <span\n className=\"absolute inset-0 rounded-[inherit] bg-current opacity-10 motion-safe:animate-in motion-safe:zoom-in-95\"\n aria-hidden=\"true\"\n />\n )}\n </span>\n )}\n </AriaButton>\n );\n }\n));\n\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants, buttonOuterVariants, buttonVisualVariants };\nexport type { ButtonProps } from './Button.types';\n","import { z } from 'zod';\n\n/**\n * Base props schema for all Themis components\n * Ensures consistent accessibility and styling APIs across the library\n *\n * @see spec.md FR-009 to FR-014 (Accessibility Requirements)\n * @see constitution.md Principle IV (Accessibility First - WCAG 2.2 AA minimum)\n */\nexport const BaseComponentPropsSchema = z.object({\n // Styling\n className: z.string().optional(),\n\n // React\n children: z.any().optional(), // ReactNode not directly supported by Zod\n id: z.string().optional(),\n\n // Accessibility (WCAG 2.2 AA requirements)\n 'aria-label': z.string().optional(),\n 'aria-labelledby': z.string().optional(),\n 'aria-describedby': z.string().optional(),\n 'aria-live': z.enum(['off', 'polite', 'assertive']).optional(),\n 'aria-hidden': z.boolean().optional(),\n\n // Testing & Development\n 'data-testid': z.string().optional(),\n});\n\nexport type BaseComponentProps = z.infer<typeof BaseComponentPropsSchema>;\n","import { z } from 'zod';\nimport { cva } from 'class-variance-authority';\nimport { BaseComponentPropsSchema } from '../../schemas/BaseComponentProps';\nimport type { ReactNode } from 'react';\n\n/**\n * Flip button position variants\n * Controls where the flip button appears on the card\n *\n * @see card-prd.md US-5 (Flip Button Position)\n */\nexport const FlipButtonPositionSchema = z.enum([\n 'top-right',\n 'top-left',\n 'bottom-right',\n 'bottom-left',\n]);\nexport type FlipButtonPosition = z.infer<typeof FlipButtonPositionSchema>;\n\n/**\n * Flip button label configuration\n * Custom labels for the flip button title attribute\n *\n * @see card-prd.md US-6 (Custom Labels)\n */\nexport const FlipButtonLabelSchema = z.object({\n show: z.string().optional(),\n hide: z.string().optional(),\n});\nexport type FlipButtonLabel = z.infer<typeof FlipButtonLabelSchema>;\n\n/**\n * Flip button icon configuration\n * Custom icons for the front and back flip buttons\n */\nexport const FlipButtonIconSchema = z.object({\n /** Icon to show on front side button (default: RotateCcw) */\n front: z.custom<ReactNode>().optional(),\n /** Icon to show on back side button (default: same as front or RotateCcw) */\n back: z.custom<ReactNode>().optional(),\n});\nexport type FlipButtonIcon = z.infer<typeof FlipButtonIconSchema>;\n\n/**\n * Card root component props schema\n *\n * @see card-prd.md US-1 (Basic Card Container)\n * @see card-prd.md US-2 (Flippable Card)\n * @see card-prd.md US-3 (Controlled/Uncontrolled State)\n */\nexport const CardPropsSchema = BaseComponentPropsSchema.extend({\n // Flip functionality\n /** Enable flip animation feature */\n flippable: z.boolean().optional().default(false),\n\n /** Content to display on the back side of the card */\n backContent: z.custom<ReactNode>().optional(),\n\n /** Controlled mode: current flip state */\n isFlipped: z.boolean().optional(),\n\n /** Uncontrolled mode: initial flip state */\n defaultFlipped: z.boolean().optional().default(false),\n\n /** Callback fired when flip state changes */\n onFlipChange: z.custom<(isFlipped: boolean) => void>().optional(),\n\n // Flip button configuration\n /** Position of the flip button on the card */\n flipButtonPosition: FlipButtonPositionSchema.optional().default('top-right'),\n\n /** Custom labels for the flip button title attribute */\n flipButtonLabel: FlipButtonLabelSchema.optional(),\n\n /** Custom icons for the flip button (default: RotateCcw) */\n flipButtonIcon: FlipButtonIconSchema.optional(),\n\n /** Duration of flip animation in milliseconds */\n flipDuration: z.number().optional().default(600),\n});\n\nexport type CardProps = z.infer<typeof CardPropsSchema>;\n\n/**\n * CardHeader props schema\n *\n * @see card-prd.md US-1 (Basic Card Container)\n */\nexport const CardHeaderPropsSchema = BaseComponentPropsSchema.extend({\n children: z.custom<ReactNode>(),\n});\n\nexport type CardHeaderProps = z.infer<typeof CardHeaderPropsSchema>;\n\n/**\n * CardTitle props schema\n *\n * @see card-prd.md US-1 (Basic Card Container)\n */\nexport const CardTitlePropsSchema = BaseComponentPropsSchema.extend({\n /** Heading level (h1-h6) - defaults to h3 */\n as: z.enum(['h1', 'h2', 'h3', 'h4', 'h5', 'h6']).optional().default('h3'),\n\n children: z.custom<ReactNode>(),\n});\n\nexport type CardTitleProps = z.infer<typeof CardTitlePropsSchema>;\n\n/**\n * CardDescription props schema\n *\n * @see card-prd.md US-1 (Basic Card Container)\n */\nexport const CardDescriptionPropsSchema = BaseComponentPropsSchema.extend({\n children: z.custom<ReactNode>(),\n});\n\nexport type CardDescriptionProps = z.infer<typeof CardDescriptionPropsSchema>;\n\n/**\n * CardContent props schema\n *\n * @see card-prd.md US-1 (Basic Card Container)\n */\nexport const CardContentPropsSchema = BaseComponentPropsSchema.extend({\n children: z.custom<ReactNode>(),\n});\n\nexport type CardContentProps = z.infer<typeof CardContentPropsSchema>;\n\n/**\n * CardFooter props schema\n *\n * @see card-prd.md US-1 (Basic Card Container)\n */\nexport const CardFooterPropsSchema = BaseComponentPropsSchema.extend({\n children: z.custom<ReactNode>(),\n});\n\nexport type CardFooterProps = z.infer<typeof CardFooterPropsSchema>;\n\n/**\n * CardAction props schema\n *\n * @see card-prd.md US-1 (Basic Card Container)\n */\nexport const CardActionPropsSchema = BaseComponentPropsSchema.extend({\n children: z.custom<ReactNode>(),\n});\n\nexport type CardActionProps = z.infer<typeof CardActionPropsSchema>;\n\n/**\n * CVA variants for flip button positioning\n *\n * Provides consistent positioning classes for the flip button\n * based on the flipButtonPosition prop.\n *\n * Buttons are rendered INSIDE both front and back sides so they\n * flip along with the card content for a more natural feel.\n *\n * @see card-prd.md US-5 (Flip Button Position)\n */\nexport const flipButtonPositionVariants = cva(\n [\n 'absolute z-10 min-h-[44px] min-w-[44px] p-2',\n 'flex items-center justify-center',\n 'rounded-full bg-[var(--accent-background)]',\n 'text-[var(--primary-action)] hover:text-[var(--primary-action-hover)]',\n 'transition-colors duration-200',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]',\n ],\n {\n variants: {\n position: {\n 'top-right': 'top-2 right-2',\n 'top-left': 'top-2 left-2',\n 'bottom-right': 'bottom-2 right-2',\n 'bottom-left': 'bottom-2 left-2',\n },\n },\n defaultVariants: {\n position: 'top-right',\n },\n }\n);\n","'use client';\n\n/**\n * Card Component (TDD Stub)\n *\n * This is a minimal stub to allow tests to run during the RED phase.\n * Full implementation will be added in the GREEN phase.\n *\n * @see card-prd.md (Product Requirements)\n * @see plan.md (Implementation Plan)\n */\n\nimport { forwardRef, useState, useCallback, type HTMLAttributes, type ReactNode } from 'react';\nimport { RotateCcw } from 'lucide-react';\nimport { cn } from '../../utils/cn';\nimport { Button } from '../Button';\nimport {\n flipButtonPositionVariants,\n type CardProps,\n type CardHeaderProps,\n type CardTitleProps,\n type CardDescriptionProps,\n type CardContentProps,\n type CardFooterProps,\n type CardActionProps,\n} from './Card.types';\n\n// ============================================================================\n// Card (Root Component)\n// ============================================================================\n\nexport const Card = forwardRef<HTMLElement, CardProps & HTMLAttributes<HTMLElement>>(\n (props, ref) => {\n const {\n children,\n className,\n flippable = false,\n backContent,\n isFlipped: controlledFlipped,\n defaultFlipped = false,\n onFlipChange,\n flipButtonPosition = 'top-right',\n flipButtonLabel,\n flipButtonIcon,\n flipDuration = 600,\n ...rest\n } = props;\n\n // Controlled/uncontrolled state\n const [internalFlipped, setInternalFlipped] = useState(defaultFlipped);\n const isControlled = controlledFlipped !== undefined;\n const flipped = isControlled ? controlledFlipped : internalFlipped;\n\n const handleFlip = useCallback(() => {\n const newState = !flipped;\n if (!isControlled) {\n setInternalFlipped(newState);\n }\n onFlipChange?.(newState);\n }, [flipped, isControlled, onFlipChange]);\n\n // Non-flippable card\n if (!flippable) {\n return (\n <article\n ref={ref}\n className={cn(\n 'rounded-lg border border-[var(--border)] bg-[var(--content-background)] text-[var(--content-foreground)] shadow-sm',\n className\n )}\n {...rest}\n >\n {children}\n </article>\n );\n }\n\n // Flippable card\n const showLabel = flipButtonLabel?.show ?? 'Show more details';\n const hideLabel = flipButtonLabel?.hide ?? 'Show less details';\n\n // Default icon\n const defaultIcon = <RotateCcw className=\"h-5 w-5\" aria-hidden=\"true\" />;\n // Custom icons (back defaults to front if not specified)\n const frontIcon = flipButtonIcon?.front ?? defaultIcon;\n const backIcon = flipButtonIcon?.back ?? flipButtonIcon?.front ?? defaultIcon;\n\n // Flip button component - rendered on both front and back\n const FlipButton = ({ label, icon }: { label: string; icon: ReactNode }) => (\n <Button\n variant=\"ghost\"\n visualSize=\"icon\"\n aria-hidden={true}\n excludeFromTabOrder\n onPress={handleFlip}\n className={flipButtonPositionVariants({ position: flipButtonPosition })}\n aria-label={label}\n >\n {icon}\n </Button>\n );\n\n return (\n <article\n ref={ref}\n className={cn('relative', className)}\n style={{ perspective: '1000px' }}\n {...rest}\n >\n {/* Flipper container - handles 3D transform */}\n <div\n className={cn(\n 'relative transition-transform',\n 'motion-reduce:transition-none'\n )}\n style={{\n transformStyle: 'preserve-3d',\n transitionDuration: `${flipDuration}ms`,\n transform: flipped ? 'rotateY(180deg)' : 'rotateY(0deg)',\n }}\n data-flipped={flipped}\n >\n {/* Front side */}\n <div\n className=\"relative rounded-lg border border-[var(--border)] bg-[var(--content-background)] text-[var(--content-foreground)] shadow-sm\"\n style={{ backfaceVisibility: 'hidden' }}\n data-side=\"front\"\n >\n {children}\n <FlipButton label={showLabel} icon={frontIcon} />\n </div>\n\n {/* Back side - scrollable if content overflows */}\n <div\n className=\"absolute inset-0 overflow-y-auto rounded-lg border border-[var(--border)] bg-[var(--content-background)] text-[var(--content-foreground)] shadow-sm\"\n style={{\n backfaceVisibility: 'hidden',\n transform: 'rotateY(180deg)',\n }}\n data-side=\"back\"\n >\n {backContent}\n <FlipButton label={hideLabel} icon={backIcon} />\n </div>\n </div>\n </article>\n );\n }\n);\n\nCard.displayName = 'Card';\n\n// ============================================================================\n// CardHeader\n// ============================================================================\n\nexport const CardHeader = forwardRef<HTMLElement, CardHeaderProps & HTMLAttributes<HTMLElement>>(\n ({ className, children, ...props }, ref) => (\n <header\n ref={ref}\n className={cn('flex flex-col space-y-1.5 p-6', className)}\n {...props}\n >\n {children}\n </header>\n )\n);\n\nCardHeader.displayName = 'CardHeader';\n\n// ============================================================================\n// CardTitle\n// ============================================================================\n\nexport const CardTitle = forwardRef<HTMLHeadingElement, CardTitleProps & HTMLAttributes<HTMLHeadingElement>>(\n ({ className, as: Comp = 'h3', children, ...props }, ref) => (\n <Comp\n ref={ref}\n className={cn('text-2xl font-semibold leading-none tracking-tight', className)}\n {...props}\n >\n {children}\n </Comp>\n )\n);\n\nCardTitle.displayName = 'CardTitle';\n\n// ============================================================================\n// CardDescription\n// ============================================================================\n\nexport const CardDescription = forwardRef<HTMLParagraphElement, CardDescriptionProps & HTMLAttributes<HTMLParagraphElement>>(\n ({ className, children, ...props }, ref) => (\n <p\n ref={ref}\n className={cn('text-sm text-[var(--content-foreground-muted)]', className)}\n {...props}\n >\n {children}\n </p>\n )\n);\n\nCardDescription.displayName = 'CardDescription';\n\n// ============================================================================\n// CardContent\n// ============================================================================\n\nexport const CardContent = forwardRef<HTMLDivElement, CardContentProps & HTMLAttributes<HTMLDivElement>>(\n ({ className, children, ...props }, ref) => (\n <div ref={ref} className={cn('p-6 pt-0', className)} {...props}>\n {children}\n </div>\n )\n);\n\nCardContent.displayName = 'CardContent';\n\n// ============================================================================\n// CardFooter\n// ============================================================================\n\nexport const CardFooter = forwardRef<HTMLElement, CardFooterProps & HTMLAttributes<HTMLElement>>(\n ({ className, children, ...props }, ref) => (\n <footer\n ref={ref}\n className={cn('flex items-center p-6 pt-0', className)}\n {...props}\n >\n {children}\n </footer>\n )\n);\n\nCardFooter.displayName = 'CardFooter';\n\n// ============================================================================\n// CardAction\n// ============================================================================\n\nexport const CardAction = forwardRef<HTMLDivElement, CardActionProps & HTMLAttributes<HTMLDivElement>>(\n ({ className, children, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('ml-auto', className)}\n {...props}\n >\n {children}\n </div>\n )\n);\n\nCardAction.displayName = 'CardAction';\n"]}
@@ -1,8 +1,3 @@
1
- export { Card, CardAction, CardActionPropsSchema, CardContent, CardContentPropsSchema, CardDescription, CardDescriptionPropsSchema, CardFooter, CardFooterPropsSchema, CardHeader, CardHeaderPropsSchema, CardPropsSchema, CardTitle, CardTitlePropsSchema, FlipButtonIconSchema, FlipButtonLabelSchema, FlipButtonPositionSchema, flipButtonPositionVariants } from '../../chunk-KPRRBSG6.mjs';
2
- import '../../chunk-BDXKKMBZ.mjs';
3
- import '../../chunk-FPKEAJRZ.mjs';
4
- import '../../chunk-HK46BT5U.mjs';
5
- import '../../chunk-E2KQFV3O.mjs';
6
- import '../../chunk-5SVLJN2C.mjs';
7
- //# sourceMappingURL=index.mjs.map
1
+ "use client";
2
+ import {createContext,memo,forwardRef,useId,useState,useCallback,useContext}from'react';import {Loader2,Zap,RotateCcw}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {Button}from'react-aria-components';import {cva}from'class-variance-authority';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {z}from'zod';function n(...e){return twMerge(clsx(e))}var G=cva("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",{variants:{fullWidth:{true:"w-full",false:""},inVerticalGroup:{true:"items-stretch",false:"items-center"}},defaultVariants:{fullWidth:false,inVerticalGroup:false}}),_=cva("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",{variants:{variant:{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",destructive:"bg-[var(--destructive-background)] text-[var(--destructive-foreground)] shadow-md hover:bg-[var(--destructive-background)]/90 data-[pressed]:bg-[var(--destructive-background)]/80",outline:"border border-[var(--input-border)] bg-[var(--page-background)] hover:bg-[var(--input-border)] data-[pressed]:bg-[var(--input-border)]",secondary:"bg-[var(--secondary)] text-[var(--secondary-foreground)] shadow-md hover:bg-[var(--secondary)]/80 data-[pressed]:bg-[var(--secondary)]/70",ghost:"hover:bg-[var(--accent)] hover:text-[var(--accent-foreground)] data-[pressed]:bg-[var(--accent)]",link:"text-[var(--text-link)] underline-offset-4 hover:underline data-[pressed]:text-[var(--text-link-hover)]"},fullWidth:{true:"w-full",false:""},visualSize:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3 text-xs",lg:"h-11 rounded-md px-8",icon:"h-10 w-10",dot:"h-5 w-5 rounded-full p-0 min-h-0 min-w-0"},paywall:{true:"!bg-[var(--paywall)] !text-[var(--paywall-foreground)] !shadow-md hover:!bg-[var(--paywall)]/90 !cursor-not-allowed !border-transparent",false:""}},defaultVariants:{variant:"default",visualSize:"default",paywall:false}});var k="data-[pressed]:scale-[0.97]";var M="data-[hovered]:shadow-md";var L="hc:data-[hovered]:outline hc:data-[hovered]:outline-2 hc:data-[hovered]:outline-foreground",F="hc:data-[pressed]:outline hc:data-[pressed]:outline-2 hc:data-[pressed]:outline-offset-1 hc:data-[pressed]:outline-foreground";var K=createContext(null);K.displayName="ButtonGroupContext";function Q(){return useContext(K)}var X=createContext(null);X.displayName="ButtonGroupItemContext";function tt(){return useContext(X)}cva("inline-flex items-center gap-0",{variants:{orientation:{horizontal:"flex-row",vertical:"flex-col w-full"}},defaultVariants:{orientation:"horizontal"}});var et=cva("",{variants:{orientation:{horizontal:"min-w-[44px]",vertical:"flex min-h-[44px]"},position:{first:"",middle:"",last:"",only:""}},compoundVariants:[{orientation:"horizontal",position:"first",className:"rounded-r-none border-r-0"},{orientation:"horizontal",position:"middle",className:"rounded-none border-r-0"},{orientation:"horizontal",position:"last",className:"rounded-l-none"},{orientation:"vertical",position:"first",className:"rounded-b-none border-b-0"},{orientation:"vertical",position:"middle",className:"rounded-none border-b-0"},{orientation:"vertical",position:"last",className:"rounded-t-none"}],defaultVariants:{orientation:"horizontal",position:"only"}});cva("bg-[var(--border)]",{variants:{orientation:{horizontal:"w-px h-6 mx-1",vertical:"h-px w-full my-1"}},defaultVariants:{orientation:"horizontal"}});var I=memo(forwardRef(({className:e,buttonVisualClassName:o,variant:r,size:a,visualSize:h,fullWidth:w,loading:m=false,loadingText:A="Loading...",shortcut:v,children:S,isDisabled:P,paywall:s=false,paywallRedirect:N,paywallDescription:B,onPress:z,...T},x)=>{let p=useId(),c=Q(),H=tt(),R=r??c?.variant??"default",E=a??c?.size,D=P??c?.isDisabled??false,V=c?.orientation==="vertical",C=w||V,f=H?et({orientation:c?.orientation??"horizontal",position:H.position}):"",g=h??E??"default";return process.env.NODE_ENV!=="production"&&(g==="dot"||g==="icon")&&!T["aria-label"]&&!S&&console.warn('[Button] visualSize="dot" or "icon" requires aria-label when no visible text is provided (WCAG 1.1.1)'),jsx(Button,{ref:x,isDisabled:D||m||void 0,"aria-disabled":s?true:void 0,"aria-describedby":s?p:void 0,onPress:y=>{if(s){N&&window.open(N,"_blank","noopener,noreferrer");return}z?.(y);},className:n(G({fullWidth:C,inVerticalGroup:V}),e),...T,children:y=>jsxs("span",{className:n(_({variant:R,visualSize:g,paywall:s,fullWidth:C}),f,o,k,M,L,F),"data-pressed":y.isPressed||void 0,children:[m&&jsxs(Fragment,{children:[jsx(Loader2,{className:"motion-safe:animate-spin","aria-hidden":"true"}),jsx("span",{className:"sr-only","aria-live":"polite",children:A})]}),!m&&S,s&&jsx(Zap,{"data-testid":"zap-icon","aria-hidden":"true",className:"ml-1"}),s&&jsxs("span",{id:p,className:"sr-only",children:["Premium feature: ",B||"Upgrade required to access this feature"]}),y.isFocusVisible&&v&&jsx("kbd",{className:"ml-auto hidden text-xs opacity-60 lg:inline",children:v}),y.isPressed&&jsx("span",{className:"absolute inset-0 rounded-[inherit] bg-current opacity-10 motion-safe:animate-in motion-safe:zoom-in-95","aria-hidden":"true"})]})})}));I.displayName="Button";var l=z.object({className:z.string().optional(),children:z.any().optional(),id:z.string().optional(),"aria-label":z.string().optional(),"aria-labelledby":z.string().optional(),"aria-describedby":z.string().optional(),"aria-live":z.enum(["off","polite","assertive"]).optional(),"aria-hidden":z.boolean().optional(),"data-testid":z.string().optional()});var ot=z.enum(["top-right","top-left","bottom-right","bottom-left"]),rt=z.object({show:z.string().optional(),hide:z.string().optional()}),at=z.object({front:z.custom().optional(),back:z.custom().optional()}),Pt=l.extend({flippable:z.boolean().optional().default(false),backContent:z.custom().optional(),isFlipped:z.boolean().optional(),defaultFlipped:z.boolean().optional().default(false),onFlipChange:z.custom().optional(),flipButtonPosition:ot.optional().default("top-right"),flipButtonLabel:rt.optional(),flipButtonIcon:at.optional(),flipDuration:z.number().optional().default(600)}),Nt=l.extend({children:z.custom()}),Bt=l.extend({as:z.enum(["h1","h2","h3","h4","h5","h6"]).optional().default("h3"),children:z.custom()}),Tt=l.extend({children:z.custom()}),Ht=l.extend({children:z.custom()}),Et=l.extend({children:z.custom()}),Vt=l.extend({children:z.custom()}),W=cva(["absolute z-10 min-h-[44px] min-w-[44px] p-2","flex items-center justify-center","rounded-full bg-[var(--accent-background)]","text-[var(--primary-action)] hover:text-[var(--primary-action-hover)]","transition-colors duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]"],{variants:{position:{"top-right":"top-2 right-2","top-left":"top-2 left-2","bottom-right":"bottom-2 right-2","bottom-left":"bottom-2 left-2"}},defaultVariants:{position:"top-right"}});var nt=forwardRef((e,o)=>{let{children:r,className:a,flippable:h=false,backContent:w,isFlipped:m,defaultFlipped:A=false,onFlipChange:v,flipButtonPosition:S="top-right",flipButtonLabel:P,flipButtonIcon:s,flipDuration:N=600,...B}=e,[z,T]=useState(A),x=m!==void 0,p=x?m:z,c=useCallback(()=>{let f=!p;x||T(f),v?.(f);},[p,x,v]);if(!h)return jsx("article",{ref:o,className:n("rounded-lg border border-[var(--border)] bg-[var(--content-background)] text-[var(--content-foreground)] shadow-sm",a),...B,children:r});let H=P?.show??"Show more details",R=P?.hide??"Show less details",E=jsx(RotateCcw,{className:"h-5 w-5","aria-hidden":"true"}),D=s?.front??E,V=s?.back??s?.front??E,C=({label:f,icon:g})=>jsx(I,{variant:"ghost",visualSize:"icon","aria-hidden":true,excludeFromTabOrder:true,onPress:c,className:W({position:S}),"aria-label":f,children:g});return jsx("article",{ref:o,className:n("relative",a),style:{perspective:"1000px"},...B,children:jsxs("div",{className:n("relative transition-transform","motion-reduce:transition-none"),style:{transformStyle:"preserve-3d",transitionDuration:`${N}ms`,transform:p?"rotateY(180deg)":"rotateY(0deg)"},"data-flipped":p,children:[jsxs("div",{className:"relative rounded-lg border border-[var(--border)] bg-[var(--content-background)] text-[var(--content-foreground)] shadow-sm",style:{backfaceVisibility:"hidden"},"data-side":"front",children:[r,jsx(C,{label:H,icon:D})]}),jsxs("div",{className:"absolute inset-0 overflow-y-auto rounded-lg border border-[var(--border)] bg-[var(--content-background)] text-[var(--content-foreground)] shadow-sm",style:{backfaceVisibility:"hidden",transform:"rotateY(180deg)"},"data-side":"back",children:[w,jsx(C,{label:R,icon:V})]})]})})});nt.displayName="Card";var it=forwardRef(({className:e,children:o,...r},a)=>jsx("header",{ref:a,className:n("flex flex-col space-y-1.5 p-6",e),...r,children:o}));it.displayName="CardHeader";var st=forwardRef(({className:e,as:o="h3",children:r,...a},h)=>jsx(o,{ref:h,className:n("text-2xl font-semibold leading-none tracking-tight",e),...a,children:r}));st.displayName="CardTitle";var dt=forwardRef(({className:e,children:o,...r},a)=>jsx("p",{ref:a,className:n("text-sm text-[var(--content-foreground-muted)]",e),...r,children:o}));dt.displayName="CardDescription";var lt=forwardRef(({className:e,children:o,...r},a)=>jsx("div",{ref:a,className:n("p-6 pt-0",e),...r,children:o}));lt.displayName="CardContent";var pt=forwardRef(({className:e,children:o,...r},a)=>jsx("footer",{ref:a,className:n("flex items-center p-6 pt-0",e),...r,children:o}));pt.displayName="CardFooter";var ct=forwardRef(({className:e,children:o,...r},a)=>jsx("div",{ref:a,className:n("ml-auto",e),...r,children:o}));ct.displayName="CardAction";export{nt as Card,ct as CardAction,Vt as CardActionPropsSchema,lt as CardContent,Ht as CardContentPropsSchema,dt as CardDescription,Tt as CardDescriptionPropsSchema,pt as CardFooter,Et as CardFooterPropsSchema,it as CardHeader,Nt as CardHeaderPropsSchema,Pt as CardPropsSchema,st as CardTitle,Bt as CardTitlePropsSchema,at as FlipButtonIconSchema,rt as FlipButtonLabelSchema,ot as FlipButtonPositionSchema,W as flipButtonPositionVariants};//# sourceMappingURL=index.mjs.map
8
3
  //# sourceMappingURL=index.mjs.map