@lerianstudio/sindarian-ui 2.0.0-beta.24 → 2.0.0-beta.26

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 (337) hide show
  1. package/dist/charts/chart.js +4 -231
  2. package/dist/charts/index.js +1 -11
  3. package/dist/components/breadcrumb/get-breadcrumb-paths.js +1 -18
  4. package/dist/components/breadcrumb/index.js +1 -37
  5. package/dist/components/card/account-card/index.js +1 -69
  6. package/dist/components/card/basic-card/index.js +1 -20
  7. package/dist/components/card/dashboard-card/index.js +1 -20
  8. package/dist/components/card/entity-card/index.js +1 -68
  9. package/dist/components/card/index.js +1 -20
  10. package/dist/components/dialog/confirmation-dialog/index.d.ts.map +1 -1
  11. package/dist/components/dialog/confirmation-dialog/index.js +1 -96
  12. package/dist/components/dialog/confirmation-dialog/use-confirm-dialog.js +1 -55
  13. package/dist/components/dialog/index.js +1 -19
  14. package/dist/components/dialog/large-dialog/index.d.ts +2 -2
  15. package/dist/components/dialog/large-dialog/index.d.ts.map +1 -1
  16. package/dist/components/dialog/large-dialog/index.js +1 -21
  17. package/dist/components/entity-box/index.js +1 -67
  18. package/dist/components/entity-data-table/index.js +1 -20
  19. package/dist/components/form/combo-box-field/index.js +1 -35
  20. package/dist/components/form/country-field/index.js +1 -11
  21. package/dist/components/form/date-picker-field/index.js +1 -83
  22. package/dist/components/form/date-range-field/index.js +1 -58
  23. package/dist/components/form/date-time-picker-field/index.js +1 -114
  24. package/dist/components/form/file-upload-field/index.js +1 -69
  25. package/dist/components/form/index.js +1 -31
  26. package/dist/components/form/input-field/index.js +1 -96
  27. package/dist/components/form/otp-field/index.js +1 -19
  28. package/dist/components/form/pagination-limit-field/index.js +1 -10
  29. package/dist/components/form/password-field/index.d.ts.map +1 -1
  30. package/dist/components/form/password-field/index.js +1 -16
  31. package/dist/components/form/radio-group-field/index.js +1 -36
  32. package/dist/components/form/renderable-label.js +1 -57
  33. package/dist/components/form/select-field/index.js +1 -68
  34. package/dist/components/form/state-field/index.js +1 -42
  35. package/dist/components/form/switch-field/index.js +1 -16
  36. package/dist/components/form/textarea-field/index.js +1 -23
  37. package/dist/components/page/index.js +1 -20
  38. package/dist/components/page-header/index.js +1 -80
  39. package/dist/components/pagination/index.js +1 -10
  40. package/dist/components/table/id-table-cell.js +1 -109
  41. package/dist/components/table/index.js +1 -19
  42. package/dist/components/table/locked-table-actions.js +1 -41
  43. package/dist/components/table/name-table-cell.js +1 -58
  44. package/dist/components/ui/accordion/index.js +1 -62
  45. package/dist/components/ui/alert/index.js +1 -45
  46. package/dist/components/ui/alert-dialog/index.js +1 -84
  47. package/dist/components/ui/autocomplete/index.js +1 -440
  48. package/dist/components/ui/autosize-textarea/index.js +1 -89
  49. package/dist/components/ui/avatar/index.js +1 -51
  50. package/dist/components/ui/badge/index.js +1 -83
  51. package/dist/components/ui/breadcrumb/index.js +1 -35
  52. package/dist/components/ui/button/index.js +1 -65
  53. package/dist/components/ui/button/styles.css +2 -1
  54. package/dist/components/ui/calendar/index.js +1 -118
  55. package/dist/components/ui/card/index.js +1 -32
  56. package/dist/components/ui/checkbox/index.js +1 -44
  57. package/dist/components/ui/collapsible/index.js +1 -50
  58. package/dist/components/ui/command/index.js +1 -95
  59. package/dist/components/ui/copy-field/index.js +1 -163
  60. package/dist/components/ui/dialog/index.d.ts +4 -1
  61. package/dist/components/ui/dialog/index.d.ts.map +1 -1
  62. package/dist/components/ui/dialog/index.js +1 -80
  63. package/dist/components/ui/dialog/styles.css +2 -1
  64. package/dist/components/ui/dropdown-menu/index.js +1 -110
  65. package/dist/components/ui/field/index.js +1 -82
  66. package/dist/components/ui/file-upload/index.js +1 -574
  67. package/dist/components/ui/form.js +1 -162
  68. package/dist/components/ui/hover-card/index.js +1 -51
  69. package/dist/components/ui/icon-button/index.js +1 -35
  70. package/dist/components/ui/input/adornment.js +1 -21
  71. package/dist/components/ui/input/index.js +1 -99
  72. package/dist/components/ui/input/styles.css +29 -12
  73. package/dist/components/ui/label/index.js +1 -45
  74. package/dist/components/ui/lerian-wordmark/index.js +1 -7
  75. package/dist/components/ui/loading-button/index.js +1 -9
  76. package/dist/components/ui/multiple-select/index.js +1 -235
  77. package/dist/components/ui/otp-input/index.js +1 -62
  78. package/dist/components/ui/paper/index.js +1 -8
  79. package/dist/components/ui/paper-collapsible/index.js +1 -24
  80. package/dist/components/ui/popover/index.js +1 -55
  81. package/dist/components/ui/progress/index.js +1 -66
  82. package/dist/components/ui/qr-code/index.js +1 -27
  83. package/dist/components/ui/radio-group/index.js +1 -48
  84. package/dist/components/ui/scroll-area/index.js +1 -49
  85. package/dist/components/ui/select/index.js +1 -119
  86. package/dist/components/ui/select/styles.css +6 -3
  87. package/dist/components/ui/separator/index.js +1 -43
  88. package/dist/components/ui/sheet/index.d.ts +7 -2
  89. package/dist/components/ui/sheet/index.d.ts.map +1 -1
  90. package/dist/components/ui/sheet/index.js +1 -136
  91. package/dist/components/ui/sidebar/index.js +1 -27
  92. package/dist/components/ui/sidebar/next-router.cjs +1 -119
  93. package/dist/components/ui/sidebar/sidebar-back-button.js +1 -8
  94. package/dist/components/ui/sidebar/sidebar-components.js +1 -23
  95. package/dist/components/ui/sidebar/sidebar-expand-button.js +1 -49
  96. package/dist/components/ui/sidebar/sidebar-item-button.js +1 -21
  97. package/dist/components/ui/sidebar/sidebar-item-collapsible.js +1 -52
  98. package/dist/components/ui/sidebar/sidebar-item-icon-button.js +1 -18
  99. package/dist/components/ui/sidebar/sidebar-item.js +1 -44
  100. package/dist/components/ui/sidebar/sidebar-provider.js +1 -201
  101. package/dist/components/ui/sidebar/sidebar-root.d.ts +3 -1
  102. package/dist/components/ui/sidebar/sidebar-root.d.ts.map +1 -1
  103. package/dist/components/ui/sidebar/sidebar-root.js +1 -130
  104. package/dist/components/ui/sidebar/sidebar-router.js +1 -126
  105. package/dist/components/ui/sidebar/sidebar-trigger.js +1 -57
  106. package/dist/components/ui/skeleton/index.js +1 -8
  107. package/dist/components/ui/stepper/index.js +1 -29
  108. package/dist/components/ui/switch/index.js +1 -43
  109. package/dist/components/ui/table/index.js +1 -56
  110. package/dist/components/ui/tabs/index.js +1 -55
  111. package/dist/components/ui/textarea/index.js +1 -8
  112. package/dist/components/ui/time-picker/index.js +1 -85
  113. package/dist/components/ui/toast/index.js +1 -3
  114. package/dist/components/ui/toast/toaster.js +1 -16
  115. package/dist/components/ui/toggle-group/index.js +1 -156
  116. package/dist/components/ui/tooltip/index.js +1 -81
  117. package/dist/domain/blotter/index.js +1 -20
  118. package/dist/domain/delinquency-aging/aging-buckets.js +1 -120
  119. package/dist/domain/delinquency-aging/index.js +1 -222
  120. package/dist/domain/figure/index.js +1 -19
  121. package/dist/domain/format.js +1 -137
  122. package/dist/domain/index.js +1 -43
  123. package/dist/domain/key-id/index.js +1 -174
  124. package/dist/domain/ledger-sheet/index.js +1 -28
  125. package/dist/domain/money-diff.js +1 -48
  126. package/dist/domain/money-math.js +1 -104
  127. package/dist/domain/money-text/index.js +1 -123
  128. package/dist/domain/section-label/index.js +1 -17
  129. package/dist/domain/status-rail/index.js +1 -76
  130. package/dist/domain/threshold-gauge/index.js +1 -161
  131. package/dist/enterprise/alert-banner/index.js +1 -24
  132. package/dist/enterprise/app-shell/index.js +1 -87
  133. package/dist/enterprise/cursor-pager/index.js +1 -26
  134. package/dist/enterprise/data-table/column-size.js +1 -103
  135. package/dist/enterprise/data-table/index.d.ts.map +1 -1
  136. package/dist/enterprise/data-table/index.js +1 -345
  137. package/dist/enterprise/date-range-picker/index.js +1 -115
  138. package/dist/enterprise/detail-panel/index.js +1 -20
  139. package/dist/enterprise/empty-state/index.d.ts +6 -1
  140. package/dist/enterprise/empty-state/index.d.ts.map +1 -1
  141. package/dist/enterprise/empty-state/index.js +1 -13
  142. package/dist/enterprise/index.js +1 -39
  143. package/dist/enterprise/number-input/index.js +1 -252
  144. package/dist/enterprise/search-input/index.js +1 -121
  145. package/dist/enterprise/stat-card/index.js +1 -75
  146. package/dist/enterprise/status-badge/index.js +1 -120
  147. package/dist/enterprise/use-is-mobile.js +1 -68
  148. package/dist/enterprise/virtualized-table/index.js +1 -141
  149. package/dist/esm/charts/chart.js +4 -190
  150. package/dist/esm/charts/index.js +1 -3
  151. package/dist/esm/components/breadcrumb/get-breadcrumb-paths.js +1 -12
  152. package/dist/esm/components/breadcrumb/index.js +1 -30
  153. package/dist/esm/components/card/account-card/index.js +1 -53
  154. package/dist/esm/components/card/basic-card/index.js +1 -14
  155. package/dist/esm/components/card/dashboard-card/index.js +1 -14
  156. package/dist/esm/components/card/entity-card/index.js +1 -52
  157. package/dist/esm/components/card/index.js +1 -4
  158. package/dist/esm/components/dialog/confirmation-dialog/index.d.ts.map +1 -1
  159. package/dist/esm/components/dialog/confirmation-dialog/index.js +1 -60
  160. package/dist/esm/components/dialog/confirmation-dialog/use-confirm-dialog.js +1 -49
  161. package/dist/esm/components/dialog/index.js +1 -3
  162. package/dist/esm/components/dialog/large-dialog/index.d.ts +2 -2
  163. package/dist/esm/components/dialog/large-dialog/index.d.ts.map +1 -1
  164. package/dist/esm/components/dialog/large-dialog/index.js +1 -16
  165. package/dist/esm/components/entity-box/index.js +1 -56
  166. package/dist/esm/components/entity-data-table/index.js +1 -17
  167. package/dist/esm/components/form/combo-box-field/index.js +1 -28
  168. package/dist/esm/components/form/country-field/index.js +1 -7
  169. package/dist/esm/components/form/date-picker-field/index.js +1 -43
  170. package/dist/esm/components/form/date-range-field/index.js +1 -18
  171. package/dist/esm/components/form/date-time-picker-field/index.js +1 -74
  172. package/dist/esm/components/form/file-upload-field/index.js +1 -65
  173. package/dist/esm/components/form/index.js +1 -15
  174. package/dist/esm/components/form/input-field/index.js +1 -92
  175. package/dist/esm/components/form/otp-field/index.js +1 -15
  176. package/dist/esm/components/form/pagination-limit-field/index.js +1 -6
  177. package/dist/esm/components/form/password-field/index.d.ts.map +1 -1
  178. package/dist/esm/components/form/password-field/index.js +1 -10
  179. package/dist/esm/components/form/radio-group-field/index.js +1 -32
  180. package/dist/esm/components/form/renderable-label.js +1 -54
  181. package/dist/esm/components/form/select-field/index.js +1 -64
  182. package/dist/esm/components/form/state-field/index.js +1 -35
  183. package/dist/esm/components/form/switch-field/index.js +1 -12
  184. package/dist/esm/components/form/textarea-field/index.js +1 -19
  185. package/dist/esm/components/page/index.js +1 -15
  186. package/dist/esm/components/page-header/index.js +1 -71
  187. package/dist/esm/components/pagination/index.js +1 -6
  188. package/dist/esm/components/table/id-table-cell.js +1 -105
  189. package/dist/esm/components/table/index.js +1 -3
  190. package/dist/esm/components/table/locked-table-actions.js +1 -37
  191. package/dist/esm/components/table/name-table-cell.js +1 -54
  192. package/dist/esm/components/ui/accordion/index.js +1 -24
  193. package/dist/esm/components/ui/alert/index.js +1 -38
  194. package/dist/esm/components/ui/alert-dialog/index.js +1 -39
  195. package/dist/esm/components/ui/autocomplete/index.js +1 -392
  196. package/dist/esm/components/ui/autosize-textarea/index.js +1 -51
  197. package/dist/esm/components/ui/avatar/index.js +1 -14
  198. package/dist/esm/components/ui/badge/index.js +1 -79
  199. package/dist/esm/components/ui/breadcrumb/index.js +1 -27
  200. package/dist/esm/components/ui/button/index.js +1 -60
  201. package/dist/esm/components/ui/calendar/index.js +1 -82
  202. package/dist/esm/components/ui/card/index.js +1 -24
  203. package/dist/esm/components/ui/checkbox/index.js +1 -9
  204. package/dist/esm/components/ui/collapsible/index.js +1 -13
  205. package/dist/esm/components/ui/command/index.js +1 -51
  206. package/dist/esm/components/ui/copy-field/index.js +1 -127
  207. package/dist/esm/components/ui/dialog/index.d.ts +4 -1
  208. package/dist/esm/components/ui/dialog/index.d.ts.map +1 -1
  209. package/dist/esm/components/ui/dialog/index.js +1 -36
  210. package/dist/esm/components/ui/dropdown-menu/index.js +1 -60
  211. package/dist/esm/components/ui/field/index.js +1 -71
  212. package/dist/esm/components/ui/file-upload/index.js +1 -536
  213. package/dist/esm/components/ui/form.js +1 -118
  214. package/dist/esm/components/ui/hover-card/index.js +1 -14
  215. package/dist/esm/components/ui/icon-button/index.js +1 -31
  216. package/dist/esm/components/ui/input/adornment.js +1 -17
  217. package/dist/esm/components/ui/input/index.js +1 -60
  218. package/dist/esm/components/ui/label/index.js +1 -10
  219. package/dist/esm/components/ui/lerian-wordmark/index.js +1 -4
  220. package/dist/esm/components/ui/loading-button/index.js +1 -7
  221. package/dist/esm/components/ui/multiple-select/index.js +1 -196
  222. package/dist/esm/components/ui/otp-input/index.js +1 -21
  223. package/dist/esm/components/ui/paper/index.js +1 -5
  224. package/dist/esm/components/ui/paper-collapsible/index.js +1 -19
  225. package/dist/esm/components/ui/popover/index.js +1 -17
  226. package/dist/esm/components/ui/progress/index.js +1 -31
  227. package/dist/esm/components/ui/qr-code/index.js +1 -24
  228. package/dist/esm/components/ui/radio-group/index.js +1 -12
  229. package/dist/esm/components/ui/scroll-area/index.js +1 -13
  230. package/dist/esm/components/ui/select/index.js +1 -74
  231. package/dist/esm/components/ui/separator/index.js +1 -8
  232. package/dist/esm/components/ui/sheet/index.d.ts +7 -2
  233. package/dist/esm/components/ui/sheet/index.d.ts.map +1 -1
  234. package/dist/esm/components/ui/sheet/index.js +1 -92
  235. package/dist/esm/components/ui/sidebar/index.js +1 -11
  236. package/dist/esm/components/ui/sidebar/next-router.cjs +1 -119
  237. package/dist/esm/components/ui/sidebar/sidebar-back-button.js +1 -5
  238. package/dist/esm/components/ui/sidebar/sidebar-components.js +1 -15
  239. package/dist/esm/components/ui/sidebar/sidebar-expand-button.js +1 -42
  240. package/dist/esm/components/ui/sidebar/sidebar-item-button.js +1 -18
  241. package/dist/esm/components/ui/sidebar/sidebar-item-collapsible.js +1 -44
  242. package/dist/esm/components/ui/sidebar/sidebar-item-icon-button.js +1 -14
  243. package/dist/esm/components/ui/sidebar/sidebar-item.js +1 -40
  244. package/dist/esm/components/ui/sidebar/sidebar-provider.js +1 -193
  245. package/dist/esm/components/ui/sidebar/sidebar-root.d.ts +3 -1
  246. package/dist/esm/components/ui/sidebar/sidebar-root.d.ts.map +1 -1
  247. package/dist/esm/components/ui/sidebar/sidebar-root.js +1 -126
  248. package/dist/esm/components/ui/sidebar/sidebar-router.js +1 -89
  249. package/dist/esm/components/ui/sidebar/sidebar-trigger.js +1 -53
  250. package/dist/esm/components/ui/skeleton/index.js +1 -6
  251. package/dist/esm/components/ui/stepper/index.js +1 -20
  252. package/dist/esm/components/ui/switch/index.js +1 -8
  253. package/dist/esm/components/ui/table/index.js +1 -44
  254. package/dist/esm/components/ui/tabs/index.js +1 -17
  255. package/dist/esm/components/ui/textarea/index.js +1 -6
  256. package/dist/esm/components/ui/time-picker/index.js +1 -49
  257. package/dist/esm/components/ui/toast/index.js +1 -2
  258. package/dist/esm/components/ui/toast/toaster.js +1 -13
  259. package/dist/esm/components/ui/toggle-group/index.js +1 -120
  260. package/dist/esm/components/ui/tooltip/index.js +1 -43
  261. package/dist/esm/domain/blotter/index.js +1 -16
  262. package/dist/esm/domain/delinquency-aging/aging-buckets.js +1 -115
  263. package/dist/esm/domain/delinquency-aging/index.js +1 -218
  264. package/dist/esm/domain/figure/index.js +1 -15
  265. package/dist/esm/domain/format.js +1 -128
  266. package/dist/esm/domain/index.js +1 -19
  267. package/dist/esm/domain/key-id/index.js +1 -169
  268. package/dist/esm/domain/ledger-sheet/index.js +1 -24
  269. package/dist/esm/domain/money-diff.js +1 -45
  270. package/dist/esm/domain/money-math.js +1 -98
  271. package/dist/esm/domain/money-text/index.js +1 -118
  272. package/dist/esm/domain/section-label/index.js +1 -14
  273. package/dist/esm/domain/status-rail/index.js +1 -71
  274. package/dist/esm/domain/threshold-gauge/index.js +1 -157
  275. package/dist/esm/enterprise/alert-banner/index.js +1 -21
  276. package/dist/esm/enterprise/app-shell/index.js +1 -51
  277. package/dist/esm/enterprise/cursor-pager/index.js +1 -23
  278. package/dist/esm/enterprise/data-table/column-size.js +1 -97
  279. package/dist/esm/enterprise/data-table/index.d.ts.map +1 -1
  280. package/dist/esm/enterprise/data-table/index.js +1 -342
  281. package/dist/esm/enterprise/date-range-picker/index.js +1 -112
  282. package/dist/esm/enterprise/detail-panel/index.js +1 -17
  283. package/dist/esm/enterprise/empty-state/index.d.ts +6 -1
  284. package/dist/esm/enterprise/empty-state/index.d.ts.map +1 -1
  285. package/dist/esm/enterprise/empty-state/index.js +1 -10
  286. package/dist/esm/enterprise/index.js +1 -22
  287. package/dist/esm/enterprise/number-input/index.js +1 -214
  288. package/dist/esm/enterprise/search-input/index.js +1 -85
  289. package/dist/esm/enterprise/stat-card/index.js +1 -72
  290. package/dist/esm/enterprise/status-badge/index.js +1 -116
  291. package/dist/esm/enterprise/use-is-mobile.js +1 -31
  292. package/dist/esm/enterprise/virtualized-table/index.js +1 -138
  293. package/dist/esm/hooks/use-click-away.js +1 -22
  294. package/dist/esm/hooks/use-pagination.js +1 -38
  295. package/dist/esm/hooks/use-stepper.js +1 -22
  296. package/dist/esm/hooks/use-time.js +1 -13
  297. package/dist/esm/hooks/use-toast.js +1 -107
  298. package/dist/esm/index.js +1 -77
  299. package/dist/esm/lib/storage/get-storage-object.js +1 -17
  300. package/dist/esm/lib/storage/get-storage.js +1 -14
  301. package/dist/esm/lib/storage/index.js +1 -2
  302. package/dist/esm/lib/typography.js +1 -31
  303. package/dist/esm/lib/utils.js +1 -41
  304. package/dist/esm/theme/get-theme-script.js +1 -41
  305. package/dist/esm/theme/index.js +1 -4
  306. package/dist/esm/theme/mode-toggle.js +1 -45
  307. package/dist/esm/theme/theme-provider.js +1 -122
  308. package/dist/esm/toast/helpers.js +1 -36
  309. package/dist/esm/toast/index.js +1 -4
  310. package/dist/esm/types/metadata-type.js +1 -1
  311. package/dist/esm/utils/countries.cjs +1 -17
  312. package/dist/esm/utils/country-utils.js +1 -18
  313. package/dist/esm/utils/currency-codes.js +1 -181
  314. package/dist/globals.css +1 -0
  315. package/dist/hooks/use-click-away.js +1 -29
  316. package/dist/hooks/use-pagination.js +1 -41
  317. package/dist/hooks/use-stepper.js +1 -26
  318. package/dist/hooks/use-time.js +1 -20
  319. package/dist/hooks/use-toast.js +1 -111
  320. package/dist/index.js +1 -96
  321. package/dist/lib/storage/get-storage-object.js +1 -23
  322. package/dist/lib/storage/get-storage.js +1 -17
  323. package/dist/lib/storage/index.js +1 -18
  324. package/dist/lib/typography.js +1 -34
  325. package/dist/lib/utils.js +1 -45
  326. package/dist/theme/get-theme-script.js +1 -44
  327. package/dist/theme/index.js +1 -11
  328. package/dist/theme/mode-toggle.js +1 -48
  329. package/dist/theme/theme-provider.js +1 -160
  330. package/dist/toast/helpers.js +1 -41
  331. package/dist/toast/index.js +1 -10
  332. package/dist/tokens.css +7 -4
  333. package/dist/types/metadata-type.js +1 -2
  334. package/dist/utils/countries.cjs +1 -17
  335. package/dist/utils/country-utils.js +1 -25
  336. package/dist/utils/currency-codes.js +1 -184
  337. package/package.json +4 -3
@@ -1,60 +1 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Slot, Slottable } from '@radix-ui/react-slot';
3
- import { cva } from 'class-variance-authority';
4
- import { cn } from '../../../lib/utils.js';
5
- const buttonVariants = cva('button-base button-disabled button-read-only', {
6
- variants: {
7
- variant: {
8
- plain: 'button-plain',
9
- hoverLink: 'hover:bg-accent text-foreground hover:text-accent-foreground font-normal',
10
- default: 'button-primary',
11
- primary: 'button-primary',
12
- secondary: 'button-secondary',
13
- tertiary: 'button-tertiary',
14
- outline: 'button-outline',
15
- link: 'button-link',
16
- destructive: 'button-destructive'
17
- },
18
- fullWidth: {
19
- true: 'w-full',
20
- false: 'w-fit'
21
- },
22
- size: {
23
- default: '',
24
- small: 'button-small'
25
- }
26
- },
27
- defaultVariants: {
28
- variant: 'default',
29
- size: 'default'
30
- }
31
- });
32
- const iconVariants = cva('', {
33
- variants: {
34
- position: {
35
- start: 'mr-2',
36
- end: 'ml-2',
37
- 'far-end': 'absolute right-2'
38
- },
39
- size: {
40
- default: '[&>*]:size-6',
41
- small: '[&>*]:size-4'
42
- }
43
- },
44
- defaultVariants: {
45
- position: 'start',
46
- size: 'default'
47
- }
48
- });
49
- function Button({ className, variant, size, asChild = false, icon, iconPlacement = 'start', fullWidth = false, readOnly = false, onClick, ...props }) {
50
- const Comp = asChild ? Slot : 'button';
51
- const handleClick = (e) => {
52
- if (readOnly) {
53
- e.preventDefault();
54
- return;
55
- }
56
- onClick?.(e);
57
- };
58
- return (_jsxs(Comp, { className: cn(buttonVariants({ variant, size, fullWidth }), className), "data-read-only": readOnly, "data-slot": "button", ...props, onClick: handleClick, children: [icon && iconPlacement === 'start' && (_jsx("span", { className: cn(iconVariants({ position: iconPlacement, size })), children: icon })), _jsx(Slottable, { children: props.children }), icon && iconPlacement !== 'start' && (_jsx("span", { className: cn(iconVariants({ position: iconPlacement, size })), children: icon }))] }));
59
- }
60
- export { Button, buttonVariants, iconVariants };
1
+ import{jsx as n,jsxs as y}from"react/jsx-runtime";import{Slot as x,Slottable as k}from"@radix-ui/react-slot";import{cva as u}from"class-variance-authority";import{cn as o}from"../../../lib/utils.js";const d=u("button-base button-disabled button-read-only",{variants:{variant:{plain:"button-plain",hoverLink:"hover:bg-accent text-foreground hover:text-accent-foreground font-normal",default:"button-primary",primary:"button-primary",secondary:"button-secondary",tertiary:"button-tertiary",outline:"button-outline",link:"button-link",destructive:"button-destructive"},fullWidth:{true:"w-full",false:"w-fit"},size:{default:"",small:"button-small"}},defaultVariants:{variant:"default",size:"default"}});const s=u("",{variants:{position:{start:"mr-2",end:"ml-2","far-end":"absolute right-2"},size:{default:"[&>*]:size-6",small:"[&>*]:size-4"}},defaultVariants:{position:"start",size:"default"}});function g({className:f,variant:b,size:r,asChild:m=false,icon:t,iconPlacement:a="start",fullWidth:c=false,readOnly:e=false,onClick:p,...i}){const h=m?x:"button";const v=l=>{if(e){l.preventDefault();return}p?.(l)};return y(h,{className:o(d({variant:b,size:r,fullWidth:c}),f),"data-read-only":e,"data-slot":"button",...i,onClick:v,children:[t&&a==="start"&&n("span",{className:o(s({position:a,size:r})),children:t}),n(k,{children:i.children}),t&&a!=="start"&&n("span",{className:o(s({position:a,size:r})),children:t})]})}export{g as Button,d as buttonVariants,s as iconVariants};
@@ -1,82 +1 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import * as React from 'react';
4
- import { DayPicker, defaultDateLib, getDefaultClassNames } from 'react-day-picker';
5
- import { cn } from '../../../lib/utils.js';
6
- import { Button, buttonVariants } from '../../../components/ui/button/index.js';
7
- import { ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon } from 'lucide-react';
8
- function Calendar({ className, classNames, showOutsideDays = true, captionLayout = 'label', buttonVariant = 'plain', formatters, components, ...props }) {
9
- const defaultClassNames = getDefaultClassNames();
10
- return (_jsx(DayPicker, { showOutsideDays: showOutsideDays, className: cn('bg-background group/calendar p-2 [--cell-radius:var(--radius-md)] [--cell-size:34px] [--nav-size:28px] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent', String.raw `rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw `rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className), captionLayout: captionLayout, formatters: {
11
- // react-day-picker's own default is dateLib.format(month, 'LLLL'), the
12
- // full month name in the locale it was given. Shortening it has to go
13
- // through the same dateLib: Date.toLocaleString('default') reads the
14
- // runtime locale instead, so the dropdown fell back to English while
15
- // the weekdays and the caption around it stayed in the consumer's
16
- // language. 'LLL' is the abbreviated form of the same standalone month.
17
- formatMonthDropdown: (month, dateLib = defaultDateLib) => dateLib.format(month, 'LLL'),
18
- ...formatters
19
- }, classNames: {
20
- root: cn('w-fit', defaultClassNames.root),
21
- months: cn('flex gap-4 flex-col md:flex-row relative', defaultClassNames.months),
22
- month: cn('flex flex-col w-full gap-4', defaultClassNames.month),
23
- nav: cn('flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between', defaultClassNames.nav),
24
- button_previous: cn(buttonVariants({ variant: buttonVariant }), 'size-(--nav-size) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_previous),
25
- button_next: cn(buttonVariants({ variant: buttonVariant }), 'size-(--nav-size) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_next),
26
- month_caption: cn('flex items-center justify-center h-(--nav-size) w-full px-(--nav-size)', defaultClassNames.month_caption),
27
- dropdowns: cn('w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5', defaultClassNames.dropdowns),
28
- dropdown_root: cn('relative cn-calendar-dropdown-root rounded-(--cell-radius)', defaultClassNames.dropdown_root),
29
- dropdown: cn('absolute bg-popover inset-0 opacity-0', defaultClassNames.dropdown),
30
- caption_label: cn('select-none font-bold', captionLayout === 'label'
31
- ? 'text-sm'
32
- : 'cn-calendar-caption-label rounded-(--cell-radius) flex items-center gap-1 text-sm [&>svg]:text-muted-foreground [&>svg]:size-3.5', defaultClassNames.caption_label),
33
- table: 'w-full border-collapse',
34
- weekdays: cn('flex gap-0.5', defaultClassNames.weekdays),
35
- weekday: cn('text-muted-foreground rounded-(--cell-radius) flex-1 font-normal text-[0.8rem] select-none', defaultClassNames.weekday),
36
- week: cn('flex w-full gap-0.5', defaultClassNames.week),
37
- week_number_header: cn('select-none w-(--cell-size)', defaultClassNames.week_number_header),
38
- week_number: cn('text-[0.8rem] select-none text-muted-foreground', defaultClassNames.week_number),
39
- day: cn('relative w-full rounded-(--cell-radius) h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius) group/day aspect-square select-none', props.showWeekNumber
40
- ? '[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)'
41
- : '[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)', defaultClassNames.day),
42
- range_start: cn('rounded-l-(--cell-radius) bg-accent-mute relative after:bg-accent-mute after:absolute after:inset-y-0 after:w-4 after:right-0 -z-0 isolate', defaultClassNames.range_start),
43
- range_middle: cn('rounded-none', defaultClassNames.range_middle),
44
- range_end: cn('rounded-r-(--cell-radius) bg-accent-mute relative after:bg-accent-mute after:absolute after:inset-y-0 after:w-4 after:left-0 -z-0 isolate', defaultClassNames.range_end),
45
- today: cn('text-foreground rounded-(--cell-radius)', defaultClassNames.today),
46
- outside: cn('text-muted-foreground opacity-60 aria-selected:text-muted-foreground', defaultClassNames.outside),
47
- disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),
48
- hidden: cn('invisible', defaultClassNames.hidden),
49
- ...classNames
50
- }, components: {
51
- Root: ({ className, rootRef, ...props }) => {
52
- return (_jsx("div", { "data-slot": "calendar", ref: rootRef, className: cn(className), ...props }));
53
- },
54
- Chevron: ({ className, orientation, ...props }) => {
55
- if (orientation === 'left') {
56
- return (_jsx(ChevronLeftIcon, { className: cn('size-4', className), ...props }));
57
- }
58
- if (orientation === 'right') {
59
- return (_jsx(ChevronRightIcon, { className: cn('size-4', className), ...props }));
60
- }
61
- return (_jsx(ChevronDownIcon, { className: cn('size-4', className), ...props }));
62
- },
63
- DayButton: CalendarDayButton,
64
- WeekNumber: ({ children, ...props }) => {
65
- return (_jsx("td", { ...props, children: _jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: children }) }));
66
- },
67
- ...components
68
- }, ...props }));
69
- }
70
- function CalendarDayButton({ className, day, modifiers, ...props }) {
71
- const defaultClassNames = getDefaultClassNames();
72
- const ref = React.useRef(null);
73
- React.useEffect(() => {
74
- if (modifiers.focused)
75
- ref.current?.focus();
76
- }, [modifiers.focused]);
77
- return (_jsx(Button, { ref: ref, variant: "plain", size: "small", "data-day": day.date.toLocaleDateString(), "data-selected-single": modifiers.selected &&
78
- !modifiers.range_start &&
79
- !modifiers.range_end &&
80
- !modifiers.range_middle, "data-range-start": modifiers.range_start, "data-range-end": modifiers.range_end, "data-range-middle": modifiers.range_middle, "data-today": modifiers.today && !modifiers.range_middle, "aria-current": modifiers.today ? 'date' : undefined, className: cn('data-[today=true]:bg-accent data-[today=true]:text-accent-foreground data-[selected-single=true]:bg-accent data-[selected-single=true]:text-accent-foreground data-[range-middle=true]:bg-accent-mute data-[range-middle=true]:text-foreground data-[range-start=true]:bg-accent data-[range-start=true]:text-accent-foreground data-[range-end=true]:bg-accent data-[range-end=true]:text-accent-foreground focus-visible:border-accent focus-visible:ring-accent/50 relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal focus-visible:ring-[3px] focus-visible:outline-none data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:font-bold data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:font-bold data-[selected-single=true]:font-bold data-[today=true]:font-bold [&>span]:text-xs [&>span]:opacity-70', defaultClassNames.day, className), ...props }));
81
- }
82
- export { Calendar, CalendarDayButton };
1
+ "use client";import{jsx as d}from"react/jsx-runtime";import*as g from"react";import{DayPicker as w,defaultDateLib as v,getDefaultClassNames as m}from"react-day-picker";import{cn as e}from"../../../lib/utils.js";import{Button as _,buttonVariants as b}from"../../../components/ui/button/index.js";import{ChevronLeftIcon as y,ChevronRightIcon as h,ChevronDownIcon as z}from"lucide-react";function k({className:c,classNames:i,showOutsideDays:a=true,captionLayout:l="label",buttonVariant:s="plain",formatters:u,components:x,...f}){const t=m();return d(w,{showOutsideDays:a,className:e("bg-background group/calendar p-2 [--cell-radius:var(--radius-md)] [--cell-size:34px] [--nav-size:28px] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,c),captionLayout:l,formatters:{formatMonthDropdown:(r,n=v)=>n.format(r,"LLL"),...u},classNames:{root:e("w-fit",t.root),months:e("flex gap-4 flex-col md:flex-row relative",t.months),month:e("flex flex-col w-full gap-4",t.month),nav:e("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",t.nav),button_previous:e(b({variant:s}),"size-(--nav-size) aria-disabled:opacity-50 p-0 select-none",t.button_previous),button_next:e(b({variant:s}),"size-(--nav-size) aria-disabled:opacity-50 p-0 select-none",t.button_next),month_caption:e("flex items-center justify-center h-(--nav-size) w-full px-(--nav-size)",t.month_caption),dropdowns:e("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",t.dropdowns),dropdown_root:e("relative cn-calendar-dropdown-root rounded-(--cell-radius)",t.dropdown_root),dropdown:e("absolute bg-popover inset-0 opacity-0",t.dropdown),caption_label:e("select-none font-bold",l==="label"?"text-sm":"cn-calendar-caption-label rounded-(--cell-radius) flex items-center gap-1 text-sm [&>svg]:text-muted-foreground [&>svg]:size-3.5",t.caption_label),table:"w-full border-collapse",weekdays:e("flex gap-0.5",t.weekdays),weekday:e("text-muted-foreground rounded-(--cell-radius) flex-1 font-normal text-[0.8rem] select-none",t.weekday),week:e("flex w-full gap-0.5",t.week),week_number_header:e("select-none w-(--cell-size)",t.week_number_header),week_number:e("text-[0.8rem] select-none text-muted-foreground",t.week_number),day:e("relative w-full rounded-(--cell-radius) h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius) group/day aspect-square select-none",f.showWeekNumber?"[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)":"[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)",t.day),range_start:e("rounded-l-(--cell-radius) bg-accent-mute relative after:bg-accent-mute after:absolute after:inset-y-0 after:w-4 after:right-0 -z-0 isolate",t.range_start),range_middle:e("rounded-none",t.range_middle),range_end:e("rounded-r-(--cell-radius) bg-accent-mute relative after:bg-accent-mute after:absolute after:inset-y-0 after:w-4 after:left-0 -z-0 isolate",t.range_end),today:e("text-foreground rounded-(--cell-radius)",t.today),outside:e("text-muted-foreground opacity-60 aria-selected:text-muted-foreground",t.outside),disabled:e("text-muted-foreground opacity-50",t.disabled),hidden:e("invisible",t.hidden),...i},components:{Root:({className:r,rootRef:n,...o})=>{return d("div",{"data-slot":"calendar",ref:n,className:e(r),...o})},Chevron:({className:r,orientation:n,...o})=>{if(n==="left"){return d(y,{className:e("size-4",r),...o})}if(n==="right"){return d(h,{className:e("size-4",r),...o})}return d(z,{className:e("size-4",r),...o})},DayButton:p,WeekNumber:({children:r,...n})=>{return d("td",{...n,children:d("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:r})})},...x},...f})}function p({className:c,day:i,modifiers:a,...l}){const s=m();const u=g.useRef(null);g.useEffect(()=>{if(a.focused)u.current?.focus()},[a.focused]);return d(_,{ref:u,variant:"plain",size:"small","data-day":i.date.toLocaleDateString(),"data-selected-single":a.selected&&!a.range_start&&!a.range_end&&!a.range_middle,"data-range-start":a.range_start,"data-range-end":a.range_end,"data-range-middle":a.range_middle,"data-today":a.today&&!a.range_middle,"aria-current":a.today?"date":void 0,className:e("data-[today=true]:bg-accent data-[today=true]:text-accent-foreground data-[selected-single=true]:bg-accent data-[selected-single=true]:text-accent-foreground data-[range-middle=true]:bg-accent-mute data-[range-middle=true]:text-foreground data-[range-start=true]:bg-accent data-[range-start=true]:text-accent-foreground data-[range-end=true]:bg-accent data-[range-end=true]:text-accent-foreground focus-visible:border-accent focus-visible:ring-accent/50 relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal focus-visible:ring-[3px] focus-visible:outline-none data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:font-bold data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:font-bold data-[selected-single=true]:font-bold data-[today=true]:font-bold [&>span]:text-xs [&>span]:opacity-70",s.day,c),...l})}export{k as Calendar,p as CalendarDayButton};
@@ -1,24 +1 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from '../../../lib/utils.js';
3
- function Card({ className, ...props }) {
4
- return (_jsx("div", { "data-slot": "card", className: cn('bg-card text-card-foreground flex flex-col gap-3 rounded-lg p-6 shadow-xs', className), ...props }));
5
- }
6
- function CardHeader({ className, ...props }) {
7
- return (_jsx("div", { "data-slot": "card-header", className: cn('flex flex-col space-y-1.5', className), ...props }));
8
- }
9
- function CardTitle({ className, as: Comp = 'h3', ...props }) {
10
- return (_jsx(Comp, { "data-slot": "card-title", className: cn('text-sm leading-none font-medium', className), ...props }));
11
- }
12
- function CardDescription({ className, ...props }) {
13
- return (_jsx("p", { "data-slot": "card-description", className: cn('text-muted-foreground text-sm', className), ...props }));
14
- }
15
- function CardAction({ className, ...props }) {
16
- return (_jsx("div", { "data-slot": "card-action", className: cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className), ...props }));
17
- }
18
- function CardContent({ className, ...props }) {
19
- return (_jsx("div", { "data-slot": "card-content", className: cn('pt-0', className), ...props }));
20
- }
21
- function CardFooter({ className, ...props }) {
22
- return (_jsx("div", { "data-slot": "card-footer", className: cn('flex items-center p-6 pt-0', className), ...props }));
23
- }
24
- export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
1
+ import{jsx as r}from"react/jsx-runtime";import{cn as e}from"../../../lib/utils.js";function d({className:t,...a}){return r("div",{"data-slot":"card",className:e("bg-card text-card-foreground flex flex-col gap-3 rounded-lg p-6 shadow-xs",t),...a})}function n({className:t,...a}){return r("div",{"data-slot":"card-header",className:e("flex flex-col space-y-1.5",t),...a})}function s({className:t,as:a="h3",...o}){return r(a,{"data-slot":"card-title",className:e("text-sm leading-none font-medium",t),...o})}function c({className:t,...a}){return r("p",{"data-slot":"card-description",className:e("text-muted-foreground text-sm",t),...a})}function l({className:t,...a}){return r("div",{"data-slot":"card-action",className:e("col-start-2 row-span-2 row-start-1 self-start justify-self-end",t),...a})}function i({className:t,...a}){return r("div",{"data-slot":"card-content",className:e("pt-0",t),...a})}function f({className:t,...a}){return r("div",{"data-slot":"card-footer",className:e("flex items-center p-6 pt-0",t),...a})}export{d as Card,n as CardHeader,f as CardFooter,s as CardTitle,l as CardAction,c as CardDescription,i as CardContent};
@@ -1,9 +1 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
4
- import { Check } from 'lucide-react';
5
- import { cn } from '../../../lib/utils.js';
6
- function Checkbox({ className, ...props }) {
7
- return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn('border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground peer size-4 shrink-0 rounded-sm border focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50', className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: cn('flex items-center justify-center text-current'), children: _jsx(Check, { className: "size-4" }) }) }));
8
- }
9
- export { Checkbox };
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import*as r from"@radix-ui/react-checkbox";import{Check as s}from"lucide-react";import{cn as i}from"../../../lib/utils.js";function c({className:o,...t}){return e(r.Root,{"data-slot":"checkbox",className:i("border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground peer size-4 shrink-0 rounded-sm border focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50",o),...t,children:e(r.Indicator,{"data-slot":"checkbox-indicator",className:i("flex items-center justify-center text-current"),children:e(s,{className:"size-4"})})})}export{c as Checkbox};
@@ -1,13 +1 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
4
- function Collapsible({ ...props }) {
5
- return _jsx(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ...props });
6
- }
7
- function CollapsibleTrigger({ ...props }) {
8
- return (_jsx(CollapsiblePrimitive.CollapsibleTrigger, { "data-slot": "collapsible-trigger", ...props }));
9
- }
10
- function CollapsibleContent({ ...props }) {
11
- return (_jsx(CollapsiblePrimitive.CollapsibleContent, { "data-slot": "collapsible-content", ...props }));
12
- }
13
- export { Collapsible, CollapsibleTrigger, CollapsibleContent };
1
+ "use client";import{jsx as o}from"react/jsx-runtime";import*as t from"@radix-ui/react-collapsible";function e({...l}){return o(t.Root,{"data-slot":"collapsible",...l})}function i({...l}){return o(t.CollapsibleTrigger,{"data-slot":"collapsible-trigger",...l})}function r({...l}){return o(t.CollapsibleContent,{"data-slot":"collapsible-content",...l})}export{e as Collapsible,i as CollapsibleTrigger,r as CollapsibleContent};
@@ -1,51 +1 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import * as React from 'react';
4
- import { Command as CommandPrimitive } from 'cmdk';
5
- import { Search } from 'lucide-react';
6
- import { cn } from '../../../lib/utils.js';
7
- import { Dialog, DialogContent } from '../../../components/ui/dialog/index.js';
8
- function Command({ className, ...props }) {
9
- return (_jsx(CommandPrimitive, { "data-slot": "command", className: cn('bg-card text-foreground flex h-full w-full flex-col overflow-hidden rounded-md', className), ...props }));
10
- }
11
- const CommandDialog = ({ children, ...props }) => {
12
- return (_jsx(Dialog, { ...props, children: _jsx(DialogContent, { className: "overflow-hidden p-0 shadow-lg", children: _jsx(Command, { className: "[&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: children }) }) }));
13
- };
14
- function CommandInput({ className, ...props }) {
15
- return (_jsxs("div", { "data-slot": "command-input-wrapper", className: "flex items-center border-b px-3", children: [_jsx(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }), _jsx(CommandPrimitive.Input, { "data-slot": "command-input", className: cn('placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50', className), ...props })] }));
16
- }
17
- function CommandList({ className, children, ...props }) {
18
- const listRef = React.useRef(null);
19
- React.useEffect(() => {
20
- const listElement = listRef.current;
21
- if (!listElement)
22
- return;
23
- const handleWheel = (event) => {
24
- const { scrollTop, scrollHeight, clientHeight } = listElement;
25
- const isAtTop = scrollTop === 0 && event.deltaY < 0;
26
- const isAtBottom = scrollTop + clientHeight >= scrollHeight && event.deltaY > 0;
27
- if (!isAtTop && !isAtBottom) {
28
- event.stopPropagation();
29
- }
30
- };
31
- listElement.addEventListener('wheel', handleWheel, { passive: true });
32
- return () => listElement.removeEventListener('wheel', handleWheel);
33
- }, []);
34
- return (_jsx(CommandPrimitive.List, { ref: listRef, "data-slot": "command-list", className: cn('max-h-[300px] overflow-x-hidden overflow-y-auto', className), ...props, children: children }));
35
- }
36
- function CommandEmpty(props) {
37
- return (_jsx(CommandPrimitive.Empty, { "data-slot": "command-empty", className: "py-6 text-center text-sm", ...props }));
38
- }
39
- function CommandGroup({ className, ...props }) {
40
- return (_jsx(CommandPrimitive.Group, { "data-slot": "command-group", className: cn('text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium', className), ...props }));
41
- }
42
- function CommandSeparator({ className, ...props }) {
43
- return (_jsx(CommandPrimitive.Separator, { "data-slot": "command-separator", className: cn('bg-border -mx-1 h-px', className), ...props }));
44
- }
45
- function CommandItem({ className, ...props }) {
46
- return (_jsx(CommandPrimitive.Item, { "data-slot": "command-item", className: cn("data-[selected='true']:bg-muted data-[selected=true]:text-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className), ...props }));
47
- }
48
- function CommandShortcut({ className, ...props }) {
49
- return (_jsx("span", { "data-slot": "command-shortcut", className: cn('text-muted-foreground ml-auto text-xs tracking-widest', className), ...props }));
50
- }
51
- export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator };
1
+ "use client";import{jsx as o,jsxs as x}from"react/jsx-runtime";import*as c from"react";import{Command as n}from"cmdk";import{Search as _}from"lucide-react";import{cn as r}from"../../../lib/utils.js";import{Dialog as k,DialogContent as v}from"../../../components/ui/dialog/index.js";function l({className:e,...t}){return o(n,{"data-slot":"command",className:r("bg-card text-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}const w=({children:e,...t})=>{return o(k,{...t,children:o(v,{className:"overflow-hidden p-0 shadow-lg",children:o(l,{className:"[&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})})};function y({className:e,...t}){return x("div",{"data-slot":"command-input-wrapper",className:"flex items-center border-b px-3",children:[o(_,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),o(n.Input,{"data-slot":"command-input",className:r("placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function C({className:e,children:t,...u}){const m=c.useRef(null);c.useEffect(()=>{const a=m.current;if(!a)return;const s=d=>{const{scrollTop:i,scrollHeight:p,clientHeight:g}=a;const f=i===0&&d.deltaY<0;const h=i+g>=p&&d.deltaY>0;if(!f&&!h){d.stopPropagation()}};a.addEventListener("wheel",s,{passive:true});return()=>a.removeEventListener("wheel",s)},[]);return o(n.List,{ref:m,"data-slot":"command-list",className:r("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...u,children:t})}function N(e){return o(n.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function b({className:e,...t}){return o(n.Group,{"data-slot":"command-group",className:r("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function E({className:e,...t}){return o(n.Separator,{"data-slot":"command-separator",className:r("bg-border -mx-1 h-px",e),...t})}function j({className:e,...t}){return o(n.Item,{"data-slot":"command-item",className:r("data-[selected='true']:bg-muted data-[selected=true]:text-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t})}function I({className:e,...t}){return o("span",{"data-slot":"command-shortcut",className:r("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}export{l as Command,w as CommandDialog,y as CommandInput,C as CommandList,N as CommandEmpty,b as CommandGroup,j as CommandItem,I as CommandShortcut,E as CommandSeparator};
@@ -1,127 +1 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import * as React from 'react';
4
- import { Check, Copy, Eye, EyeOff } from 'lucide-react';
5
- import { IconButton } from '../../../components/ui/icon-button/index.js';
6
- import { useToast } from '../../../hooks/use-toast.js';
7
- import { cn } from '../../../lib/utils.js';
8
- const DEFAULT_COPY_LABEL = 'Copied to clipboard!';
9
- const FALLBACK_COPY_LABEL = 'Copy not available — text selected, press Ctrl/Cmd+C';
10
- const COPIED_ICON_TIMEOUT = 1500;
11
- const isClipboardAvailable = () => typeof navigator !== 'undefined' &&
12
- typeof navigator.clipboard?.writeText === 'function';
13
- const isClipboardReadable = () => typeof navigator !== 'undefined' &&
14
- typeof navigator.clipboard?.readText === 'function';
15
- /**
16
- * Wipes the clipboard, but only if it still holds `copiedValue` — the user may
17
- * have copied something else in the meantime, and clobbering that would be
18
- * worse than leaving the secret behind. Unverifiable (no `readText`, permission
19
- * denied, unfocused document) means "leave it alone".
20
- */
21
- const clearClipboardIfUnchanged = async (copiedValue) => {
22
- if (!isClipboardReadable()) {
23
- return;
24
- }
25
- try {
26
- if ((await navigator.clipboard.readText()) !== copiedValue) {
27
- return;
28
- }
29
- await navigator.clipboard.writeText('');
30
- }
31
- catch {
32
- // Read or write refused; the clipboard stays as-is.
33
- }
34
- };
35
- export function CopyField({ value, label, masked = false, onCopyLabel, revealLabel = 'Show value', hideLabel = 'Hide value', valueLabel = 'Value to copy', copyLabel, fallbackLabel, mono = false, description, clearClipboardAfter }) {
36
- const { toast } = useToast();
37
- const generatedId = React.useId();
38
- const inputId = `${generatedId}-copy-field`;
39
- const descriptionId = `${inputId}-description`;
40
- const inputRef = React.useRef(null);
41
- const copiedTimerRef = React.useRef(null);
42
- const clearTimerRef = React.useRef(null);
43
- const [revealed, setRevealed] = React.useState(false);
44
- const [copied, setCopied] = React.useState(false);
45
- const showAsText = !masked || revealed;
46
- const copyAccessibleName = copyLabel ?? (label ? `Copy ${label}` : 'Copy value');
47
- React.useEffect(() => {
48
- return () => {
49
- if (copiedTimerRef.current) {
50
- clearTimeout(copiedTimerRef.current);
51
- }
52
- // The clipboard-clear timer is deliberately *not* cancelled here: it
53
- // touches no state (so it can't warn about an unmounted update) and the
54
- // secret must still leave the clipboard when the dialog holding this
55
- // field closes before the timeout elapses.
56
- };
57
- }, []);
58
- const selectFieldText = () => {
59
- const input = inputRef.current;
60
- if (!input) {
61
- return;
62
- }
63
- // Reveal so the user can copy the selection manually. Flip the DOM `type`
64
- // imperatively *before* select(): `setRevealed` is batched, so a plain
65
- // state update would leave the input as type="password" at select() time,
66
- // and React's subsequent type -> "text" re-render clears the selection —
67
- // the fallback would then select nothing. We still push the state update so
68
- // the re-render stays consistent with the DOM we just mutated.
69
- if (masked) {
70
- input.type = 'text';
71
- setRevealed(true);
72
- }
73
- input.focus();
74
- input.select();
75
- };
76
- const handleFallback = () => {
77
- selectFieldText();
78
- toast({
79
- variant: 'destructive',
80
- title: fallbackLabel ?? FALLBACK_COPY_LABEL
81
- });
82
- };
83
- const handleCopy = async () => {
84
- if (!isClipboardAvailable()) {
85
- handleFallback();
86
- return;
87
- }
88
- try {
89
- await navigator.clipboard.writeText(value);
90
- toast({ variant: 'success', title: onCopyLabel ?? DEFAULT_COPY_LABEL });
91
- setCopied(true);
92
- if (copiedTimerRef.current) {
93
- clearTimeout(copiedTimerRef.current);
94
- }
95
- copiedTimerRef.current = setTimeout(() => setCopied(false), COPIED_ICON_TIMEOUT);
96
- // Only a confirmed write earns a clear — the fallback path never wrote to
97
- // the clipboard, so it has nothing of ours to wipe. `value` is captured
98
- // per copy so a later prop change can't make us clear the wrong string.
99
- if (clearTimerRef.current) {
100
- clearTimeout(clearTimerRef.current);
101
- }
102
- if (clearClipboardAfter !== undefined && clearClipboardAfter > 0) {
103
- const copiedValue = value;
104
- clearTimerRef.current = setTimeout(() => {
105
- void clearClipboardIfUnchanged(copiedValue);
106
- }, clearClipboardAfter);
107
- }
108
- }
109
- catch {
110
- handleFallback();
111
- }
112
- };
113
- return (_jsxs("div", { "data-slot": "copy-field", className: "flex w-full flex-col gap-2", children: [label ? (_jsx("label", { htmlFor: inputId, className: "text-muted-foreground text-sm font-semibold", children: label })) : null, _jsxs("div", { "data-slot": "input-wrapper", className: "border-input-border focus-within:border-ring has-[input:focus]:ring-ring flex h-10 w-full cursor-text items-center gap-1 rounded-md border pr-1 pl-4 transition-[color,box-shadow] has-[input:focus]:ring-2", children: [_jsx("input", { ref: inputRef, id: inputId, "data-slot": "input", "data-testid": "copy-field-input", type: showAsText ? 'text' : 'password', value: value, readOnly: true,
114
- // This field holds secrets: TOTP manual-entry secrets, recovery
115
- // codes. While masked it renders as type="password", which invites
116
- // browsers and password managers to autofill it or offer to SAVE its
117
- // value, and spellcheck can ship the text to a remote service.
118
- autoComplete: "off", spellCheck: false, "aria-label": label ? undefined : valueLabel, "aria-describedby": description ? descriptionId : undefined,
119
- // `min-w-0` lets this flex item shrink below its content width so a
120
- // long value (e.g. a UUID recovery code) scrolls inside the field
121
- // instead of overflowing its container. Sans by default, inheriting
122
- // the app font (Inter) so the field matches every other input;
123
- // `mono` opts identifiers, tokens and recovery codes into the
124
- // monospace face, where telling 0 from O decides whether the value
125
- // read back is the value.
126
- className: cn('text-input-foreground h-full min-w-0 flex-1 cursor-text border-none bg-transparent text-sm outline-none select-text focus:ring-0 focus:ring-offset-0', mono && 'font-mono') }), masked ? (_jsx(IconButton, { type: "button", variant: "outline", size: "small", rounded: true, "aria-label": revealed ? hideLabel : revealLabel, onClick: () => setRevealed((prev) => !prev), children: revealed ? _jsx(EyeOff, {}) : _jsx(Eye, {}) })) : null, _jsx(IconButton, { type: "button", variant: "outline", size: "small", rounded: true, "aria-label": copyAccessibleName, onClick: handleCopy, children: copied ? _jsx(Check, {}) : _jsx(Copy, {}) })] }), description ? (_jsx("p", { "data-slot": "copy-field-description", id: descriptionId, className: "text-muted-foreground text-xs", children: description })) : null] }));
127
- }
1
+ "use client";import{jsx as e,jsxs as h}from"react/jsx-runtime";import*as o from"react";import{Check as j,Copy as B,Eye as k,EyeOff as P}from"lucide-react";import{IconButton as C}from"../../../components/ui/icon-button/index.js";import{useToast as S}from"../../../hooks/use-toast.js";import{cn as U}from"../../../lib/utils.js";const $="Copied to clipboard!";const z="Copy not available \u2014 text selected, press Ctrl/Cmd+C";const D=1500;const V=()=>typeof navigator!=="undefined"&&typeof navigator.clipboard?.writeText==="function";const Y=()=>typeof navigator!=="undefined"&&typeof navigator.clipboard?.readText==="function";const H=async n=>{if(!Y()){return}try{if(await navigator.clipboard.readText()!==n){return}await navigator.clipboard.writeText("")}catch{}};export function CopyField({value:n,label:r,masked:a=false,onCopyLabel:g,revealLabel:v="Show value",hideLabel:T="Hide value",valueLabel:w="Value to copy",copyLabel:I,fallbackLabel:R,mono:E=false,description:s,clearClipboardAfter:c}){const{toast:f}=S();const _=o.useId();const l=`${_}-copy-field`;const p=`${l}-description`;const m=o.useRef(null);const i=o.useRef(null);const u=o.useRef(null);const[d,x]=o.useState(false);const[L,y]=o.useState(false);const N=!a||d;const O=I??(r?`Copy ${r}`:"Copy value");o.useEffect(()=>{return()=>{if(i.current){clearTimeout(i.current)}}},[]);const A=()=>{const t=m.current;if(!t){return}if(a){t.type="text";x(true)}t.focus();t.select()};const b=()=>{A();f({variant:"destructive",title:R??z})};const F=async()=>{if(!V()){b();return}try{await navigator.clipboard.writeText(n);f({variant:"success",title:g??$});y(true);if(i.current){clearTimeout(i.current)}i.current=setTimeout(()=>y(false),D);if(u.current){clearTimeout(u.current)}if(c!==void 0&&c>0){const t=n;u.current=setTimeout(()=>{void H(t)},c)}}catch{b()}};return h("div",{"data-slot":"copy-field",className:"flex w-full flex-col gap-2",children:[r?e("label",{htmlFor:l,className:"text-muted-foreground text-sm font-semibold",children:r}):null,h("div",{"data-slot":"input-wrapper",className:"border-input-border focus-within:border-ring has-[input:focus]:ring-ring flex h-10 w-full cursor-text items-center gap-1 rounded-md border pr-1 pl-4 transition-[color,box-shadow] has-[input:focus]:ring-2",children:[e("input",{ref:m,id:l,"data-slot":"input","data-testid":"copy-field-input",type:N?"text":"password",value:n,readOnly:true,autoComplete:"off",spellCheck:false,"aria-label":r?void 0:w,"aria-describedby":s?p:void 0,className:U("text-input-foreground h-full min-w-0 flex-1 cursor-text border-none bg-transparent text-sm outline-none select-text focus:ring-0 focus:ring-offset-0",E&&"font-mono")}),a?e(C,{type:"button",variant:"outline",size:"small",rounded:true,"aria-label":d?T:v,onClick:()=>x(t=>!t),children:d?e(P,{}):e(k,{})}):null,e(C,{type:"button",variant:"outline",size:"small",rounded:true,"aria-label":O,onClick:F,children:L?e(j,{}):e(B,{})})]}),s?e("p",{"data-slot":"copy-field-description",id:p,className:"text-muted-foreground text-xs",children:s}):null]})}
@@ -5,8 +5,11 @@ declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogP
5
5
  declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
6
6
  declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element;
7
7
  declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
8
- declare function DialogContent({ className, children, showCloseButton, onInteractOutside, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
8
+ declare function DialogContent({ className, children, showCloseButton, closeLabel, onInteractOutside, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
9
+ /** Renders the built-in close button. Default true. */
9
10
  showCloseButton?: boolean;
11
+ /** Accessible name of the built-in close button. Override for localization. */
12
+ closeLabel?: string;
10
13
  }): React.JSX.Element;
11
14
  declare function DialogHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
12
15
  declare function DialogFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/dialog/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAKzD,iBAAS,MAAM,CAAC,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,qBAEnD;AAED,iBAAS,aAAa,CAAC,EACrB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAEtD;AAED,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,qBAErD;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAEpD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAQtD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,eAAsB,EACtB,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG;IACxD,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,qBAyBA;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQzE;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQzE;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAQpD;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,qBAQ1D;AAED,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,EAClB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/dialog/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAKzD,iBAAS,MAAM,CAAC,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,qBAEnD;AAED,iBAAS,aAAa,CAAC,EACrB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAEtD;AAED,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,qBAErD;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAEpD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAQtD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,eAAsB,EACtB,UAAoB,EACpB,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG;IACxD,uDAAuD;IACvD,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,qBAuBA;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQzE;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQzE;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAQpD;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,qBAQ1D;AAED,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,EAClB,CAAA"}
@@ -1,36 +1 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import * as DialogPrimitive from '@radix-ui/react-dialog';
4
- import { X } from 'lucide-react';
5
- import { cn, keepOpenOnToast } from '../../../lib/utils.js';
6
- function Dialog({ ...props }) {
7
- return _jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
8
- }
9
- function DialogTrigger({ ...props }) {
10
- return _jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
11
- }
12
- function DialogPortal({ ...props }) {
13
- return _jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
14
- }
15
- function DialogClose({ ...props }) {
16
- return _jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
17
- }
18
- function DialogOverlay({ className, ...props }) {
19
- return (_jsx(DialogPrimitive.Overlay, { "data-slot": "dialog-overlay", className: cn('dialog-overlay', className), ...props }));
20
- }
21
- function DialogContent({ className, children, showCloseButton = true, onInteractOutside, ...props }) {
22
- return (_jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { "data-slot": "dialog-content", className: cn('dialog-content', !showCloseButton && '*:data-radix-dialog-close:hidden', className), onInteractOutside: keepOpenOnToast(onInteractOutside), ...props, children: [children, _jsxs(DialogPrimitive.Close, { "data-slot": "dialog-close", className: "dialog-close", children: [_jsx(X, { className: "size-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] })] }));
23
- }
24
- function DialogHeader({ className, ...props }) {
25
- return (_jsx("div", { "data-slot": "dialog-header", className: cn('dialog-header', className), ...props }));
26
- }
27
- function DialogFooter({ className, ...props }) {
28
- return (_jsx("div", { "data-slot": "dialog-footer", className: cn('dialog-footer', className), ...props }));
29
- }
30
- function DialogTitle({ className, ...props }) {
31
- return (_jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", className: cn('dialog-title', className), ...props }));
32
- }
33
- function DialogDescription({ className, ...props }) {
34
- return (_jsx(DialogPrimitive.Description, { "data-slot": "dialog-description", className: cn('dialog-description', className), ...props }));
35
- }
36
- export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription };
1
+ "use client";import{jsx as a,jsxs as e}from"react/jsx-runtime";import*as l from"@radix-ui/react-dialog";import{X as u}from"lucide-react";import{cn as i,keepOpenOnToast as m}from"../../../lib/utils.js";function f({...o}){return a(l.Root,{"data-slot":"dialog",...o})}function p({...o}){return a(l.Trigger,{"data-slot":"dialog-trigger",...o})}function r({...o}){return a(l.Portal,{"data-slot":"dialog-portal",...o})}function D({...o}){return a(l.Close,{"data-slot":"dialog-close",...o})}function s({className:o,...t}){return a(l.Overlay,{"data-slot":"dialog-overlay",className:i("dialog-overlay",o),...t})}function N({className:o,children:t,showCloseButton:n=true,closeLabel:d="Close",onInteractOutside:g,...c}){return e(r,{"data-slot":"dialog-portal",children:[a(s,{}),e(l.Content,{"data-slot":"dialog-content",className:i("dialog-content",o),onInteractOutside:m(g),...c,children:[t,n&&e(l.Close,{"data-slot":"dialog-close",className:"dialog-close",children:[a(u,{className:"size-4"}),a("span",{className:"sr-only",children:d})]})]})]})}function v({className:o,...t}){return a("div",{"data-slot":"dialog-header",className:i("dialog-header",o),...t})}function h({className:o,...t}){return a("div",{"data-slot":"dialog-footer",className:i("dialog-footer",o),...t})}function C({className:o,...t}){return a(l.Title,{"data-slot":"dialog-title",className:i("dialog-title",o),...t})}function x({className:o,...t}){return a(l.Description,{"data-slot":"dialog-description",className:i("dialog-description",o),...t})}export{f as Dialog,r as DialogPortal,s as DialogOverlay,D as DialogClose,p as DialogTrigger,N as DialogContent,v as DialogHeader,h as DialogFooter,C as DialogTitle,x as DialogDescription};
@@ -1,60 +1 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import * as React from 'react';
4
- import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
5
- import { Check, ChevronRight, Circle } from 'lucide-react';
6
- import { cn } from '../../../lib/utils.js';
7
- function DropdownMenu({ ...props }) {
8
- return _jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
9
- }
10
- function DropdownMenuPortal({ ...props }) {
11
- return (_jsx(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props }));
12
- }
13
- function DropdownMenuTrigger({ className, ...props }) {
14
- return (_jsx(DropdownMenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", className: cn('flex items-center justify-center outline-hidden', className), ...props }));
15
- }
16
- function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
17
- return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { "data-slot": "dropdown-menu-content", sideOffset: sideOffset, className: cn('bg-popover text-popover-foreground motion-safe:data-[state=open]:animate-in motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-32 overflow-hidden rounded-lg border shadow-md', className), ...props }) }));
18
- }
19
- function DropdownMenuGroup({ ...props }) {
20
- return (_jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props }));
21
- }
22
- function DropdownMenuItem({ className, inset, variant = 'default', ...props }) {
23
- return (_jsx(DropdownMenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn('focus:bg-shadcn-100 focus:text-accent-foreground text-muted-foreground relative flex cursor-pointer items-center gap-3 px-3 py-2 text-sm font-medium outline-hidden transition-colors select-none data-disabled:pointer-events-none data-disabled:opacity-50', className), ...props }));
24
- }
25
- function DropdownMenuItemIcon({ className, children, ...props }) {
26
- return (_jsx("span", { "data-slot": "dropdown-menu-item-icon",
27
- // A meaningful glyph inside an interactive item answers to the 3:1 floor
28
- // of SC 1.4.11. base/400 reads 2.56:1 on the popover surface in light.
29
- className: cn('text-muted-foreground', className), ...props, children: React.Children.map(React.Children.toArray(children), (child) => React.isValidElement(child)
30
- ? React.cloneElement(child, { size: 16 })
31
- : child) }));
32
- }
33
- function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
34
- return (_jsxs(DropdownMenuPrimitive.CheckboxItem, { "data-slot": "dropdown-menu-checkbox-item", className: cn('focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden transition-colors select-none data-disabled:pointer-events-none data-disabled:opacity-50', className), checked: checked, ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Check, { className: "size-4" }) }) }), children] }));
35
- }
36
- function DropdownMenuRadioGroup({ ...props }) {
37
- return (_jsx(DropdownMenuPrimitive.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props }));
38
- }
39
- function DropdownMenuRadioItem({ className, children, ...props }) {
40
- return (_jsxs(DropdownMenuPrimitive.RadioItem, { "data-slot": "dropdown-menu-radio-item", className: cn('focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden transition-colors select-none data-disabled:pointer-events-none data-disabled:opacity-50', className), ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Circle, { className: "size-2 fill-current" }) }) }), children] }));
41
- }
42
- function DropdownMenuLabel({ className, inset, ...props }) {
43
- return (_jsx(DropdownMenuPrimitive.Label, { "data-slot": "dropdown-menu-label", "data-inset": inset, className: cn('hover:bg-shadcn-100 hover:text-accent-foreground text-muted-foreground flex items-center gap-3 px-3 py-2 text-sm font-bold transition-colors', className), ...props }));
44
- }
45
- function DropdownMenuSeparator({ className, ...props }) {
46
- return (_jsx(DropdownMenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", className: cn('bg-muted -mx-1 my-1 h-px', className), ...props }));
47
- }
48
- function DropdownMenuShortcut({ className, ...props }) {
49
- return (_jsx("span", { "data-slot": "dropdown-menu-shortcut", className: cn('text-muted-foreground ml-auto text-xs tracking-widest', className), ...props }));
50
- }
51
- function DropdownMenuSub({ ...props }) {
52
- return _jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
53
- }
54
- function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
55
- return (_jsxs(DropdownMenuPrimitive.SubTrigger, { "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset, className: cn('focus:bg-shadcn-100 focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground text-muted-foreground flex cursor-default items-center gap-3 px-3 py-2 text-sm font-medium outline-hidden select-none', className), ...props, children: [children, _jsx(ChevronRight, { className: "ml-auto h-4 w-4" })] }));
56
- }
57
- function DropdownMenuSubContent({ className, ...props }) {
58
- return (_jsx(DropdownMenuPrimitive.SubContent, { "data-slot": "dropdown-menu-sub-content", className: cn('bg-popover text-popover-foreground motion-safe:data-[state=open]:animate-in motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-32 overflow-hidden rounded-md border p-1 shadow-lg', className), ...props }));
59
- }
60
- export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemIcon, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup };
1
+ "use client";import{jsx as o,jsxs as i}from"react/jsx-runtime";import*as s from"react";import*as n from"@radix-ui/react-dropdown-menu";import{Check as u,ChevronRight as c,Circle as l}from"lucide-react";import{cn as r}from"../../../lib/utils.js";function m({...e}){return o(n.Root,{"data-slot":"dropdown-menu",...e})}function p({...e}){return o(n.Portal,{"data-slot":"dropdown-menu-portal",...e})}function f({className:e,...t}){return o(n.Trigger,{"data-slot":"dropdown-menu-trigger",className:r("flex items-center justify-center outline-hidden",e),...t})}function g({className:e,sideOffset:t=4,...a}){return o(n.Portal,{children:o(n.Content,{"data-slot":"dropdown-menu-content",sideOffset:t,className:r("bg-popover text-popover-foreground motion-safe:data-[state=open]:animate-in motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-32 overflow-hidden rounded-lg border shadow-md",e),...a})})}function w({...e}){return o(n.Group,{"data-slot":"dropdown-menu-group",...e})}function x({className:e,inset:t,variant:a="default",...d}){return o(n.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":a,className:r("focus:bg-shadcn-100 focus:text-accent-foreground text-muted-foreground relative flex cursor-pointer items-center gap-3 px-3 py-2 text-sm font-medium outline-hidden transition-colors select-none data-disabled:pointer-events-none data-disabled:opacity-50",e),...d})}function b({className:e,children:t,...a}){return o("span",{"data-slot":"dropdown-menu-item-icon",className:r("text-muted-foreground",e),...a,children:s.Children.map(s.Children.toArray(t),d=>s.isValidElement(d)?s.cloneElement(d,{size:16}):d)})}function h({className:e,children:t,checked:a,...d}){return i(n.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:r("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden transition-colors select-none data-disabled:pointer-events-none data-disabled:opacity-50",e),checked:a,...d,children:[o("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:o(n.ItemIndicator,{children:o(u,{className:"size-4"})})}),t]})}function v({...e}){return o(n.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...e})}function D({className:e,children:t,...a}){return i(n.RadioItem,{"data-slot":"dropdown-menu-radio-item",className:r("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden transition-colors select-none data-disabled:pointer-events-none data-disabled:opacity-50",e),...a,children:[o("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:o(n.ItemIndicator,{children:o(l,{className:"size-2 fill-current"})})}),t]})}function M({className:e,inset:t,...a}){return o(n.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:r("hover:bg-shadcn-100 hover:text-accent-foreground text-muted-foreground flex items-center gap-3 px-3 py-2 text-sm font-bold transition-colors",e),...a})}function N({className:e,...t}){return o(n.Separator,{"data-slot":"dropdown-menu-separator",className:r("bg-muted -mx-1 my-1 h-px",e),...t})}function y({className:e,...t}){return o("span",{"data-slot":"dropdown-menu-shortcut",className:r("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function I({...e}){return o(n.Sub,{"data-slot":"dropdown-menu-sub",...e})}function z({className:e,inset:t,children:a,...d}){return i(n.SubTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:r("focus:bg-shadcn-100 focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground text-muted-foreground flex cursor-default items-center gap-3 px-3 py-2 text-sm font-medium outline-hidden select-none",e),...d,children:[a,o(c,{className:"ml-auto h-4 w-4"})]})}function C({className:e,...t}){return o(n.SubContent,{"data-slot":"dropdown-menu-sub-content",className:r("bg-popover text-popover-foreground motion-safe:data-[state=open]:animate-in motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-32 overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}export{m as DropdownMenu,f as DropdownMenuTrigger,g as DropdownMenuContent,x as DropdownMenuItem,b as DropdownMenuItemIcon,h as DropdownMenuCheckboxItem,D as DropdownMenuRadioItem,M as DropdownMenuLabel,N as DropdownMenuSeparator,y as DropdownMenuShortcut,w as DropdownMenuGroup,p as DropdownMenuPortal,I as DropdownMenuSub,C as DropdownMenuSubContent,z as DropdownMenuSubTrigger,v as DropdownMenuRadioGroup};