@lerianstudio/sindarian-ui 2.0.0-beta.25 → 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 (305) 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.js +1 -96
  11. package/dist/components/dialog/confirmation-dialog/use-confirm-dialog.js +1 -55
  12. package/dist/components/dialog/index.js +1 -19
  13. package/dist/components/dialog/large-dialog/index.js +1 -21
  14. package/dist/components/entity-box/index.js +1 -67
  15. package/dist/components/entity-data-table/index.js +1 -20
  16. package/dist/components/form/combo-box-field/index.js +1 -35
  17. package/dist/components/form/country-field/index.js +1 -11
  18. package/dist/components/form/date-picker-field/index.js +1 -83
  19. package/dist/components/form/date-range-field/index.js +1 -58
  20. package/dist/components/form/date-time-picker-field/index.js +1 -114
  21. package/dist/components/form/file-upload-field/index.js +1 -69
  22. package/dist/components/form/index.js +1 -31
  23. package/dist/components/form/input-field/index.js +1 -96
  24. package/dist/components/form/otp-field/index.js +1 -19
  25. package/dist/components/form/pagination-limit-field/index.js +1 -10
  26. package/dist/components/form/password-field/index.js +1 -16
  27. package/dist/components/form/radio-group-field/index.js +1 -36
  28. package/dist/components/form/renderable-label.js +1 -57
  29. package/dist/components/form/select-field/index.js +1 -68
  30. package/dist/components/form/state-field/index.js +1 -42
  31. package/dist/components/form/switch-field/index.js +1 -16
  32. package/dist/components/form/textarea-field/index.js +1 -23
  33. package/dist/components/page/index.js +1 -20
  34. package/dist/components/page-header/index.js +1 -80
  35. package/dist/components/pagination/index.js +1 -10
  36. package/dist/components/table/id-table-cell.js +1 -109
  37. package/dist/components/table/index.js +1 -19
  38. package/dist/components/table/locked-table-actions.js +1 -41
  39. package/dist/components/table/name-table-cell.js +1 -58
  40. package/dist/components/ui/accordion/index.js +1 -62
  41. package/dist/components/ui/alert/index.js +1 -45
  42. package/dist/components/ui/alert-dialog/index.js +1 -84
  43. package/dist/components/ui/autocomplete/index.js +1 -440
  44. package/dist/components/ui/autosize-textarea/index.js +1 -89
  45. package/dist/components/ui/avatar/index.js +1 -51
  46. package/dist/components/ui/badge/index.js +1 -83
  47. package/dist/components/ui/breadcrumb/index.js +1 -35
  48. package/dist/components/ui/button/index.js +1 -65
  49. package/dist/components/ui/calendar/index.js +1 -118
  50. package/dist/components/ui/card/index.js +1 -32
  51. package/dist/components/ui/checkbox/index.js +1 -44
  52. package/dist/components/ui/collapsible/index.js +1 -50
  53. package/dist/components/ui/command/index.js +1 -95
  54. package/dist/components/ui/copy-field/index.js +1 -163
  55. package/dist/components/ui/dialog/index.js +1 -80
  56. package/dist/components/ui/dropdown-menu/index.js +1 -110
  57. package/dist/components/ui/field/index.js +1 -82
  58. package/dist/components/ui/file-upload/index.js +1 -574
  59. package/dist/components/ui/form.js +1 -162
  60. package/dist/components/ui/hover-card/index.js +1 -51
  61. package/dist/components/ui/icon-button/index.js +1 -35
  62. package/dist/components/ui/input/adornment.js +1 -21
  63. package/dist/components/ui/input/index.js +1 -99
  64. package/dist/components/ui/label/index.js +1 -45
  65. package/dist/components/ui/lerian-wordmark/index.js +1 -7
  66. package/dist/components/ui/loading-button/index.js +1 -9
  67. package/dist/components/ui/multiple-select/index.js +1 -235
  68. package/dist/components/ui/otp-input/index.js +1 -62
  69. package/dist/components/ui/paper/index.js +1 -8
  70. package/dist/components/ui/paper-collapsible/index.js +1 -24
  71. package/dist/components/ui/popover/index.js +1 -55
  72. package/dist/components/ui/progress/index.js +1 -66
  73. package/dist/components/ui/qr-code/index.js +1 -27
  74. package/dist/components/ui/radio-group/index.js +1 -48
  75. package/dist/components/ui/scroll-area/index.js +1 -49
  76. package/dist/components/ui/select/index.js +1 -119
  77. package/dist/components/ui/separator/index.js +1 -43
  78. package/dist/components/ui/sheet/index.js +1 -136
  79. package/dist/components/ui/sidebar/index.js +1 -27
  80. package/dist/components/ui/sidebar/next-router.cjs +1 -119
  81. package/dist/components/ui/sidebar/sidebar-back-button.js +1 -8
  82. package/dist/components/ui/sidebar/sidebar-components.js +1 -23
  83. package/dist/components/ui/sidebar/sidebar-expand-button.js +1 -49
  84. package/dist/components/ui/sidebar/sidebar-item-button.js +1 -21
  85. package/dist/components/ui/sidebar/sidebar-item-collapsible.js +1 -52
  86. package/dist/components/ui/sidebar/sidebar-item-icon-button.js +1 -18
  87. package/dist/components/ui/sidebar/sidebar-item.js +1 -44
  88. package/dist/components/ui/sidebar/sidebar-provider.js +1 -201
  89. package/dist/components/ui/sidebar/sidebar-root.js +1 -130
  90. package/dist/components/ui/sidebar/sidebar-router.js +1 -126
  91. package/dist/components/ui/sidebar/sidebar-trigger.js +1 -57
  92. package/dist/components/ui/skeleton/index.js +1 -8
  93. package/dist/components/ui/stepper/index.js +1 -29
  94. package/dist/components/ui/switch/index.js +1 -43
  95. package/dist/components/ui/table/index.js +1 -56
  96. package/dist/components/ui/tabs/index.js +1 -55
  97. package/dist/components/ui/textarea/index.js +1 -8
  98. package/dist/components/ui/time-picker/index.js +1 -85
  99. package/dist/components/ui/toast/index.js +1 -3
  100. package/dist/components/ui/toast/toaster.js +1 -16
  101. package/dist/components/ui/toggle-group/index.js +1 -156
  102. package/dist/components/ui/tooltip/index.js +1 -81
  103. package/dist/domain/blotter/index.js +1 -20
  104. package/dist/domain/delinquency-aging/aging-buckets.js +1 -120
  105. package/dist/domain/delinquency-aging/index.js +1 -222
  106. package/dist/domain/figure/index.js +1 -19
  107. package/dist/domain/format.js +1 -137
  108. package/dist/domain/index.js +1 -43
  109. package/dist/domain/key-id/index.js +1 -174
  110. package/dist/domain/ledger-sheet/index.js +1 -28
  111. package/dist/domain/money-diff.js +1 -48
  112. package/dist/domain/money-math.js +1 -104
  113. package/dist/domain/money-text/index.js +1 -123
  114. package/dist/domain/section-label/index.js +1 -17
  115. package/dist/domain/status-rail/index.js +1 -76
  116. package/dist/domain/threshold-gauge/index.js +1 -161
  117. package/dist/enterprise/alert-banner/index.js +1 -24
  118. package/dist/enterprise/app-shell/index.js +1 -87
  119. package/dist/enterprise/cursor-pager/index.js +1 -26
  120. package/dist/enterprise/data-table/column-size.js +1 -103
  121. package/dist/enterprise/data-table/index.js +1 -345
  122. package/dist/enterprise/date-range-picker/index.js +1 -115
  123. package/dist/enterprise/detail-panel/index.js +1 -20
  124. package/dist/enterprise/empty-state/index.js +1 -14
  125. package/dist/enterprise/index.js +1 -39
  126. package/dist/enterprise/number-input/index.js +1 -252
  127. package/dist/enterprise/search-input/index.js +1 -121
  128. package/dist/enterprise/stat-card/index.js +1 -75
  129. package/dist/enterprise/status-badge/index.js +1 -120
  130. package/dist/enterprise/use-is-mobile.js +1 -68
  131. package/dist/enterprise/virtualized-table/index.js +1 -141
  132. package/dist/esm/charts/chart.js +4 -190
  133. package/dist/esm/charts/index.js +1 -3
  134. package/dist/esm/components/breadcrumb/get-breadcrumb-paths.js +1 -12
  135. package/dist/esm/components/breadcrumb/index.js +1 -30
  136. package/dist/esm/components/card/account-card/index.js +1 -53
  137. package/dist/esm/components/card/basic-card/index.js +1 -14
  138. package/dist/esm/components/card/dashboard-card/index.js +1 -14
  139. package/dist/esm/components/card/entity-card/index.js +1 -52
  140. package/dist/esm/components/card/index.js +1 -4
  141. package/dist/esm/components/dialog/confirmation-dialog/index.js +1 -60
  142. package/dist/esm/components/dialog/confirmation-dialog/use-confirm-dialog.js +1 -49
  143. package/dist/esm/components/dialog/index.js +1 -3
  144. package/dist/esm/components/dialog/large-dialog/index.js +1 -16
  145. package/dist/esm/components/entity-box/index.js +1 -56
  146. package/dist/esm/components/entity-data-table/index.js +1 -17
  147. package/dist/esm/components/form/combo-box-field/index.js +1 -28
  148. package/dist/esm/components/form/country-field/index.js +1 -7
  149. package/dist/esm/components/form/date-picker-field/index.js +1 -43
  150. package/dist/esm/components/form/date-range-field/index.js +1 -18
  151. package/dist/esm/components/form/date-time-picker-field/index.js +1 -74
  152. package/dist/esm/components/form/file-upload-field/index.js +1 -65
  153. package/dist/esm/components/form/index.js +1 -15
  154. package/dist/esm/components/form/input-field/index.js +1 -92
  155. package/dist/esm/components/form/otp-field/index.js +1 -15
  156. package/dist/esm/components/form/pagination-limit-field/index.js +1 -6
  157. package/dist/esm/components/form/password-field/index.js +1 -10
  158. package/dist/esm/components/form/radio-group-field/index.js +1 -32
  159. package/dist/esm/components/form/renderable-label.js +1 -54
  160. package/dist/esm/components/form/select-field/index.js +1 -64
  161. package/dist/esm/components/form/state-field/index.js +1 -35
  162. package/dist/esm/components/form/switch-field/index.js +1 -12
  163. package/dist/esm/components/form/textarea-field/index.js +1 -19
  164. package/dist/esm/components/page/index.js +1 -15
  165. package/dist/esm/components/page-header/index.js +1 -71
  166. package/dist/esm/components/pagination/index.js +1 -6
  167. package/dist/esm/components/table/id-table-cell.js +1 -105
  168. package/dist/esm/components/table/index.js +1 -3
  169. package/dist/esm/components/table/locked-table-actions.js +1 -37
  170. package/dist/esm/components/table/name-table-cell.js +1 -54
  171. package/dist/esm/components/ui/accordion/index.js +1 -24
  172. package/dist/esm/components/ui/alert/index.js +1 -38
  173. package/dist/esm/components/ui/alert-dialog/index.js +1 -39
  174. package/dist/esm/components/ui/autocomplete/index.js +1 -392
  175. package/dist/esm/components/ui/autosize-textarea/index.js +1 -51
  176. package/dist/esm/components/ui/avatar/index.js +1 -14
  177. package/dist/esm/components/ui/badge/index.js +1 -79
  178. package/dist/esm/components/ui/breadcrumb/index.js +1 -27
  179. package/dist/esm/components/ui/button/index.js +1 -60
  180. package/dist/esm/components/ui/calendar/index.js +1 -82
  181. package/dist/esm/components/ui/card/index.js +1 -24
  182. package/dist/esm/components/ui/checkbox/index.js +1 -9
  183. package/dist/esm/components/ui/collapsible/index.js +1 -13
  184. package/dist/esm/components/ui/command/index.js +1 -51
  185. package/dist/esm/components/ui/copy-field/index.js +1 -127
  186. package/dist/esm/components/ui/dialog/index.js +1 -36
  187. package/dist/esm/components/ui/dropdown-menu/index.js +1 -60
  188. package/dist/esm/components/ui/field/index.js +1 -71
  189. package/dist/esm/components/ui/file-upload/index.js +1 -536
  190. package/dist/esm/components/ui/form.js +1 -118
  191. package/dist/esm/components/ui/hover-card/index.js +1 -14
  192. package/dist/esm/components/ui/icon-button/index.js +1 -31
  193. package/dist/esm/components/ui/input/adornment.js +1 -17
  194. package/dist/esm/components/ui/input/index.js +1 -60
  195. package/dist/esm/components/ui/label/index.js +1 -10
  196. package/dist/esm/components/ui/lerian-wordmark/index.js +1 -4
  197. package/dist/esm/components/ui/loading-button/index.js +1 -7
  198. package/dist/esm/components/ui/multiple-select/index.js +1 -196
  199. package/dist/esm/components/ui/otp-input/index.js +1 -21
  200. package/dist/esm/components/ui/paper/index.js +1 -5
  201. package/dist/esm/components/ui/paper-collapsible/index.js +1 -19
  202. package/dist/esm/components/ui/popover/index.js +1 -17
  203. package/dist/esm/components/ui/progress/index.js +1 -31
  204. package/dist/esm/components/ui/qr-code/index.js +1 -24
  205. package/dist/esm/components/ui/radio-group/index.js +1 -12
  206. package/dist/esm/components/ui/scroll-area/index.js +1 -13
  207. package/dist/esm/components/ui/select/index.js +1 -74
  208. package/dist/esm/components/ui/separator/index.js +1 -8
  209. package/dist/esm/components/ui/sheet/index.js +1 -92
  210. package/dist/esm/components/ui/sidebar/index.js +1 -11
  211. package/dist/esm/components/ui/sidebar/next-router.cjs +1 -119
  212. package/dist/esm/components/ui/sidebar/sidebar-back-button.js +1 -5
  213. package/dist/esm/components/ui/sidebar/sidebar-components.js +1 -15
  214. package/dist/esm/components/ui/sidebar/sidebar-expand-button.js +1 -42
  215. package/dist/esm/components/ui/sidebar/sidebar-item-button.js +1 -18
  216. package/dist/esm/components/ui/sidebar/sidebar-item-collapsible.js +1 -44
  217. package/dist/esm/components/ui/sidebar/sidebar-item-icon-button.js +1 -14
  218. package/dist/esm/components/ui/sidebar/sidebar-item.js +1 -40
  219. package/dist/esm/components/ui/sidebar/sidebar-provider.js +1 -193
  220. package/dist/esm/components/ui/sidebar/sidebar-root.js +1 -126
  221. package/dist/esm/components/ui/sidebar/sidebar-router.js +1 -89
  222. package/dist/esm/components/ui/sidebar/sidebar-trigger.js +1 -53
  223. package/dist/esm/components/ui/skeleton/index.js +1 -6
  224. package/dist/esm/components/ui/stepper/index.js +1 -20
  225. package/dist/esm/components/ui/switch/index.js +1 -8
  226. package/dist/esm/components/ui/table/index.js +1 -44
  227. package/dist/esm/components/ui/tabs/index.js +1 -17
  228. package/dist/esm/components/ui/textarea/index.js +1 -6
  229. package/dist/esm/components/ui/time-picker/index.js +1 -49
  230. package/dist/esm/components/ui/toast/index.js +1 -2
  231. package/dist/esm/components/ui/toast/toaster.js +1 -13
  232. package/dist/esm/components/ui/toggle-group/index.js +1 -120
  233. package/dist/esm/components/ui/tooltip/index.js +1 -43
  234. package/dist/esm/domain/blotter/index.js +1 -16
  235. package/dist/esm/domain/delinquency-aging/aging-buckets.js +1 -115
  236. package/dist/esm/domain/delinquency-aging/index.js +1 -218
  237. package/dist/esm/domain/figure/index.js +1 -15
  238. package/dist/esm/domain/format.js +1 -128
  239. package/dist/esm/domain/index.js +1 -19
  240. package/dist/esm/domain/key-id/index.js +1 -169
  241. package/dist/esm/domain/ledger-sheet/index.js +1 -24
  242. package/dist/esm/domain/money-diff.js +1 -45
  243. package/dist/esm/domain/money-math.js +1 -98
  244. package/dist/esm/domain/money-text/index.js +1 -118
  245. package/dist/esm/domain/section-label/index.js +1 -14
  246. package/dist/esm/domain/status-rail/index.js +1 -71
  247. package/dist/esm/domain/threshold-gauge/index.js +1 -157
  248. package/dist/esm/enterprise/alert-banner/index.js +1 -21
  249. package/dist/esm/enterprise/app-shell/index.js +1 -51
  250. package/dist/esm/enterprise/cursor-pager/index.js +1 -23
  251. package/dist/esm/enterprise/data-table/column-size.js +1 -97
  252. package/dist/esm/enterprise/data-table/index.js +1 -342
  253. package/dist/esm/enterprise/date-range-picker/index.js +1 -112
  254. package/dist/esm/enterprise/detail-panel/index.js +1 -17
  255. package/dist/esm/enterprise/empty-state/index.js +1 -11
  256. package/dist/esm/enterprise/index.js +1 -22
  257. package/dist/esm/enterprise/number-input/index.js +1 -214
  258. package/dist/esm/enterprise/search-input/index.js +1 -85
  259. package/dist/esm/enterprise/stat-card/index.js +1 -72
  260. package/dist/esm/enterprise/status-badge/index.js +1 -116
  261. package/dist/esm/enterprise/use-is-mobile.js +1 -31
  262. package/dist/esm/enterprise/virtualized-table/index.js +1 -138
  263. package/dist/esm/hooks/use-click-away.js +1 -22
  264. package/dist/esm/hooks/use-pagination.js +1 -38
  265. package/dist/esm/hooks/use-stepper.js +1 -22
  266. package/dist/esm/hooks/use-time.js +1 -13
  267. package/dist/esm/hooks/use-toast.js +1 -107
  268. package/dist/esm/index.js +1 -77
  269. package/dist/esm/lib/storage/get-storage-object.js +1 -17
  270. package/dist/esm/lib/storage/get-storage.js +1 -14
  271. package/dist/esm/lib/storage/index.js +1 -2
  272. package/dist/esm/lib/typography.js +1 -31
  273. package/dist/esm/lib/utils.js +1 -41
  274. package/dist/esm/theme/get-theme-script.js +1 -41
  275. package/dist/esm/theme/index.js +1 -4
  276. package/dist/esm/theme/mode-toggle.js +1 -45
  277. package/dist/esm/theme/theme-provider.js +1 -122
  278. package/dist/esm/toast/helpers.js +1 -36
  279. package/dist/esm/toast/index.js +1 -4
  280. package/dist/esm/types/metadata-type.js +1 -1
  281. package/dist/esm/utils/countries.cjs +1 -17
  282. package/dist/esm/utils/country-utils.js +1 -18
  283. package/dist/esm/utils/currency-codes.js +1 -181
  284. package/dist/hooks/use-click-away.js +1 -29
  285. package/dist/hooks/use-pagination.js +1 -41
  286. package/dist/hooks/use-stepper.js +1 -26
  287. package/dist/hooks/use-time.js +1 -20
  288. package/dist/hooks/use-toast.js +1 -111
  289. package/dist/index.js +1 -96
  290. package/dist/lib/storage/get-storage-object.js +1 -23
  291. package/dist/lib/storage/get-storage.js +1 -17
  292. package/dist/lib/storage/index.js +1 -18
  293. package/dist/lib/typography.js +1 -34
  294. package/dist/lib/utils.js +1 -45
  295. package/dist/theme/get-theme-script.js +1 -44
  296. package/dist/theme/index.js +1 -11
  297. package/dist/theme/mode-toggle.js +1 -48
  298. package/dist/theme/theme-provider.js +1 -160
  299. package/dist/toast/helpers.js +1 -41
  300. package/dist/toast/index.js +1 -10
  301. package/dist/types/metadata-type.js +1 -2
  302. package/dist/utils/countries.cjs +1 -17
  303. package/dist/utils/country-utils.js +1 -25
  304. package/dist/utils/currency-codes.js +1 -184
  305. package/package.json +4 -3
@@ -1,31 +1 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import * as ProgressPrimitive from '@radix-ui/react-progress';
4
- import { cn } from '../../../lib/utils.js';
5
- /**
6
- * `value` and `max` are Radix's own props, so the bar reports `aria-valuenow` /
7
- * `aria-valuemax` and flips `data-state` between `loading` and `complete`.
8
- * Omitting `value`, or passing `null`, is Radix's indeterminate state and draws
9
- * an empty track.
10
- *
11
- * Both numbers are BOUNDED BEFORE THE ROOT SEES THEM, so the drawn width and
12
- * the announced value can never disagree. Radix accepts a value only inside
13
- * `[0, max]`: hand it one outside and the root drops `aria-valuenow`, sticks
14
- * `data-state` on `indeterminate` and logs an error, while the indicator here
15
- * goes on drawing the clamped bar. Substituting 100 for a non-positive max is
16
- * Radix's own fallback, and is also what keeps a `max` of 0 from dividing by
17
- * zero.
18
- */
19
- function Progress({ className, value, max, indicatorColor = 'bg-primary', ...props }) {
20
- const scale = Number.isFinite(max) && max > 0 ? max : 100;
21
- // Bound against `scale`, not against the rejected `max`: with `max={0}` the
22
- // scale is already 100, and clamping to 0 would report a finished bar empty.
23
- // Non-finite values are indeterminate, matching Radix without producing an
24
- // invalid CSS transform.
25
- const bounded = Number.isFinite(value)
26
- ? Math.min(scale, Math.max(0, value))
27
- : null;
28
- const percent = ((bounded ?? 0) / scale) * 100;
29
- return (_jsx(ProgressPrimitive.Root, { "data-slot": "progress", value: bounded, max: scale, className: cn('bg-primary/20 relative h-4 w-full overflow-hidden rounded-full', className), ...props, children: _jsx(ProgressPrimitive.Indicator, { "data-slot": "progress-indicator", className: cn('h-full w-full flex-1 transition-all', indicatorColor), style: { transform: `translateX(-${100 - percent}%)` } }) }));
30
- }
31
- export { Progress };
1
+ "use client";import{jsx as o}from"react/jsx-runtime";import*as i from"@radix-ui/react-progress";import{cn as l}from"../../../lib/utils.js";function u({className:a,value:s,max:r,indicatorColor:n="bg-primary",...m}){const t=Number.isFinite(r)&&r>0?r:100;const e=Number.isFinite(s)?Math.min(t,Math.max(0,s)):null;const c=(e??0)/t*100;return o(i.Root,{"data-slot":"progress",value:e,max:t,className:l("bg-primary/20 relative h-4 w-full overflow-hidden rounded-full",a),...m,children:o(i.Indicator,{"data-slot":"progress-indicator",className:l("h-full w-full flex-1 transition-all",n),style:{transform:`translateX(-${100-c}%)`}})})}export{u as Progress};
@@ -1,24 +1 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { QRCodeSVG } from 'qrcode.react';
4
- const DEFAULT_SIZE = 160;
5
- const DEFAULT_ARIA_LABEL = 'QR code';
6
- /**
7
- * Center image edge as a fraction of the code size. Kept small so error
8
- * correction can recover the excavated modules.
9
- */
10
- const LOGO_SIZE_RATIO = 0.22;
11
- export function QRCode({ value, size = DEFAULT_SIZE, logoSrc, 'aria-label': ariaLabel = DEFAULT_ARIA_LABEL }) {
12
- if (!value || value.trim() === '') {
13
- return null;
14
- }
15
- const logoSize = Math.round(size * LOGO_SIZE_RATIO);
16
- return (_jsx(QRCodeSVG, { "data-slot": "qr-code", value: value, size: size, role: "img", "aria-label": ariaLabel, level: logoSrc ? 'H' : 'L', imageSettings: logoSrc
17
- ? {
18
- src: logoSrc,
19
- height: logoSize,
20
- width: logoSize,
21
- excavate: true
22
- }
23
- : undefined }));
24
- }
1
+ "use client";import{jsx as n}from"react/jsx-runtime";import{QRCodeSVG as a}from"qrcode.react";const s=160;const d="QR code";const l=.22;export function QRCode({value:e,size:i=s,logoSrc:t,"aria-label":r=d}){if(!e||e.trim()===""){return null}const o=Math.round(i*l);return n(a,{"data-slot":"qr-code",value:e,size:i,role:"img","aria-label":r,level:t?"H":"L",imageSettings:t?{src:t,height:o,width:o,excavate:true}:void 0})}
@@ -1,12 +1 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
4
- import { Circle } from 'lucide-react';
5
- import { cn } from '../../../lib/utils.js';
6
- function RadioGroup({ className, ...props }) {
7
- return (_jsx(RadioGroupPrimitive.Root, { "data-slot": "radio-group", className: cn('grid gap-3', className), ...props }));
8
- }
9
- function RadioGroupItem({ className, ...props }) {
10
- return (_jsx(RadioGroupPrimitive.Item, { "data-slot": "radio-group-item", className: cn('border-input-border text-primary focus-visible:ring-ring aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50', className), ...props, children: _jsx(RadioGroupPrimitive.Indicator, { "data-slot": "radio-group-indicator", className: "relative flex items-center justify-center", children: _jsx(Circle, { className: "fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" }) }) }));
11
- }
12
- export { RadioGroup, RadioGroupItem };
1
+ "use client";import{jsx as r}from"react/jsx-runtime";import*as e from"@radix-ui/react-radio-group";import{Circle as t}from"lucide-react";import{cn as o}from"../../../lib/utils.js";function s({className:i,...a}){return r(e.Root,{"data-slot":"radio-group",className:o("grid gap-3",i),...a})}function d({className:i,...a}){return r(e.Item,{"data-slot":"radio-group-item",className:o("border-input-border text-primary focus-visible:ring-ring aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",i),...a,children:r(e.Indicator,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:r(t,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}export{s as RadioGroup,d as RadioGroupItem};
@@ -1,13 +1 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
4
- import { cn } from '../../../lib/utils.js';
5
- function ScrollArea({ className, children, ...props }) {
6
- return (_jsxs(ScrollAreaPrimitive.Root, { "data-slot": "scroll-area", className: cn('relative', className), ...props, children: [_jsx(ScrollAreaPrimitive.Viewport, { "data-slot": "scroll-area-viewport", className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1", children: children }), _jsx(ScrollBar, {}), _jsx(ScrollAreaPrimitive.Corner, {})] }));
7
- }
8
- function ScrollBar({ className, orientation = 'vertical', ...props }) {
9
- return (_jsx(ScrollAreaPrimitive.ScrollAreaScrollbar, { "data-slot": "scroll-area-scrollbar", orientation: orientation, className: cn('flex touch-none p-px transition-colors select-none', orientation === 'vertical' &&
10
- 'h-full w-2.5 border-l border-l-transparent', orientation === 'horizontal' &&
11
- 'h-2.5 flex-col border-t border-t-transparent', className), ...props, children: _jsx(ScrollAreaPrimitive.ScrollAreaThumb, { "data-slot": "scroll-area-thumb", className: "bg-border relative flex-1 rounded-full" }) }));
12
- }
13
- export { ScrollArea, ScrollBar };
1
+ "use client";import{jsx as l,jsxs as i}from"react/jsx-runtime";import*as o from"@radix-ui/react-scroll-area";import{cn as s}from"../../../lib/utils.js";function n({className:e,children:r,...a}){return i(o.Root,{"data-slot":"scroll-area",className:s("relative",e),...a,children:[l(o.Viewport,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:r}),l(t,{}),l(o.Corner,{})]})}function t({className:e,orientation:r="vertical",...a}){return l(o.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar",orientation:r,className:s("flex touch-none p-px transition-colors select-none",r==="vertical"&&"h-full w-2.5 border-l border-l-transparent",r==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...a,children:l(o.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}export{n as ScrollArea,t as ScrollBar};
@@ -1,74 +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 SelectPrimitive from '@radix-ui/react-select';
5
- import { Check, ChevronDown, ChevronUp } from 'lucide-react';
6
- import { cn } from '../../../lib/utils.js';
7
- function Select({ ...props }) {
8
- return _jsx(SelectPrimitive.Root, { "data-slot": "select", ...props });
9
- }
10
- function SelectGroup({ ...props }) {
11
- return _jsx(SelectPrimitive.Group, { "data-slot": "select-group", ...props });
12
- }
13
- /**
14
- * Radix strips `className` and `style` off its `Select.Value` before rendering
15
- * the span, so this slot cannot be styled directly — it is styled from the
16
- * trigger instead, see VALUE_OVERFLOW_CLASS.
17
- */
18
- function SelectValue({ ...props }) {
19
- return _jsx(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
20
- }
21
- /**
22
- * Truncate the selected value instead of letting it wrap out of the trigger.
23
- *
24
- * `.select-trigger` is a fixed-height `flex w-full items-center justify-between`
25
- * box, and a flex item never shrinks below its own min-content width: a long
26
- * value broke to a second line and overflowed the box. `min-w-0` lets the value
27
- * slot shrink, `truncate` ellipsises what no longer fits — the chevron keeps its
28
- * place because the value absorbs all the shrinkage.
29
- *
30
- * Written as a descendant-scoped variant on the TRIGGER because Radix strips
31
- * `className` off `Select.Value` itself. DESCENDANT, not `>`: a trigger that
32
- * carries a leading glyph groups the glyph and the value into one flex child
33
- * (see `SelectField`'s `leadingIcon`), so the value span is no longer the
34
- * trigger's direct child and a `>` combinator stopped truncating exactly where
35
- * the trigger has the least room. The wrapper carries `min-w-0` itself, which
36
- * is what lets the shrinkage reach the value.
37
- *
38
- * Truncation hides text, so a trigger showing a long value should also carry
39
- * `title` — on the trigger, never on the value slot, which Radix renders
40
- * `pointer-events: none`.
41
- */
42
- const VALUE_OVERFLOW_CLASS = '[&_[data-slot=select-value]]:min-w-0 [&_[data-slot=select-value]]:truncate';
43
- function SelectTrigger({ className, readOnly, children, ...props }) {
44
- return (_jsxs(SelectPrimitive.Trigger, { "data-slot": "select-trigger", "data-size": "default", className: cn('select-trigger select-read-only select-disabled', VALUE_OVERFLOW_CLASS, className), "aria-readonly": readOnly, "data-read-only": readOnly ? '' : undefined, ...props, children: [children, !readOnly && (_jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDown, { className: "select-chevron" }) }))] }));
45
- }
46
- function SelectScrollUpButton({ className, ...props }) {
47
- return (_jsx(SelectPrimitive.ScrollUpButton, { "data-slot": "select-scroll-up-button", className: cn('select-scroll-button', className), ...props, children: _jsx(ChevronUp, { className: "size-4" }) }));
48
- }
49
- function SelectScrollDownButton({ className, ...props }) {
50
- return (_jsx(SelectPrimitive.ScrollDownButton, { "data-slot": "select-scroll-down-button", className: cn('select-scroll-button', className), ...props, children: _jsx(ChevronDown, { className: "size-4" }) }));
51
- }
52
- function SelectContent({ className, children, position = 'popper', ...props }) {
53
- const options = React.useMemo(() => React.Children.map(React.Children.toArray(children), (child) => {
54
- if (React.isValidElement(child) &&
55
- child.type === SelectItem) {
56
- return child.props.value;
57
- }
58
- }), [children]);
59
- return (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { "data-slot": "select-content", "data-position": position, className: cn('group/select select-content', position === 'popper' && 'select-content-popper', className), "data-empty": options.length === 0, position: position, ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { className: cn('p-1', position === 'popper' &&
60
- 'h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)'), children: children }), _jsx(SelectScrollDownButton, {})] }) }));
61
- }
62
- function SelectEmpty({ className, ...props }) {
63
- return (_jsx("div", { "data-slot": "select-empty", className: cn('select-empty', className), ...props }));
64
- }
65
- function SelectLabel({ className, ...props }) {
66
- return (_jsx(SelectPrimitive.Label, { "data-slot": "select-label", className: cn('select-label', className), ...props }));
67
- }
68
- function SelectItem({ className, children, ...props }) {
69
- return (_jsxs(SelectPrimitive.Item, { "data-slot": "select-item", className: cn('select-item', className), ...props, children: [_jsx("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(Check, { className: "size-4" }) }) }), _jsx(SelectPrimitive.ItemText, { children: children })] }));
70
- }
71
- function SelectSeparator({ className, ...props }) {
72
- return (_jsx(SelectPrimitive.Separator, { "data-slot": "select-separator", className: cn('select-separator', className), ...props }));
73
- }
74
- export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectEmpty, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton };
1
+ "use client";import{jsx as t,jsxs as i}from"react/jsx-runtime";import*as c from"react";import*as a from"@radix-ui/react-select";import{Check as h,ChevronDown as u,ChevronUp as S}from"lucide-react";import{cn as r}from"../../../lib/utils.js";function g({...e}){return t(a.Root,{"data-slot":"select",...e})}function N({...e}){return t(a.Group,{"data-slot":"select-group",...e})}function b({...e}){return t(a.Value,{"data-slot":"select-value",...e})}const w="[&_[data-slot=select-value]]:min-w-0 [&_[data-slot=select-value]]:truncate";function v({className:e,readOnly:l,children:s,...o}){return i(a.Trigger,{"data-slot":"select-trigger","data-size":"default",className:r("select-trigger select-read-only select-disabled",w,e),"aria-readonly":l,"data-read-only":l?"":void 0,...o,children:[s,!l&&t(a.Icon,{asChild:true,children:t(u,{className:"select-chevron"})})]})}function m({className:e,...l}){return t(a.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:r("select-scroll-button",e),...l,children:t(S,{className:"size-4"})})}function p({className:e,...l}){return t(a.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:r("select-scroll-button",e),...l,children:t(u,{className:"size-4"})})}function x({className:e,children:l,position:s="popper",...o}){const f=c.useMemo(()=>c.Children.map(c.Children.toArray(l),n=>{if(c.isValidElement(n)&&n.type===d){return n.props.value}}),[l]);return t(a.Portal,{children:i(a.Content,{"data-slot":"select-content","data-position":s,className:r("group/select select-content",s==="popper"&&"select-content-popper",e),"data-empty":f.length===0,position:s,...o,children:[t(m,{}),t(a.Viewport,{className:r("p-1",s==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)"),children:l}),t(p,{})]})})}function C({className:e,...l}){return t("div",{"data-slot":"select-empty",className:r("select-empty",e),...l})}function y({className:e,...l}){return t(a.Label,{"data-slot":"select-label",className:r("select-label",e),...l})}function d({className:e,children:l,...s}){return i(a.Item,{"data-slot":"select-item",className:r("select-item",e),...s,children:[t("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:t(a.ItemIndicator,{children:t(h,{className:"size-4"})})}),t(a.ItemText,{children:l})]})}function I({className:e,...l}){return t(a.Separator,{"data-slot":"select-separator",className:r("select-separator",e),...l})}export{g as Select,N as SelectGroup,b as SelectValue,v as SelectTrigger,x as SelectContent,C as SelectEmpty,y as SelectLabel,d as SelectItem,I as SelectSeparator,m as SelectScrollUpButton,p as SelectScrollDownButton};
@@ -1,8 +1 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import * as SeparatorPrimitive from '@radix-ui/react-separator';
4
- import { cn } from '../../../lib/utils.js';
5
- function Separator({ className, orientation = 'horizontal', decorative = true, ...props }) {
6
- return (_jsx(SeparatorPrimitive.Root, { "data-slot": "separator", decorative: decorative, orientation: orientation, className: cn('bg-border shrink-0', orientation === 'horizontal' ? 'h-px w-full' : 'h-full w-px', className), ...props }));
7
- }
8
- export { Separator };
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import*as i from"@radix-ui/react-separator";import{cn as s}from"../../../lib/utils.js";function l({className:o,orientation:r="horizontal",decorative:t=true,...a}){return e(i.Root,{"data-slot":"separator",decorative:t,orientation:r,className:s("bg-border shrink-0",r==="horizontal"?"h-px w-full":"h-full w-px",o),...a})}export{l as Separator};
@@ -1,92 +1 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import * as SheetPrimitive from '@radix-ui/react-dialog';
4
- import { cva } from 'class-variance-authority';
5
- import { X } from 'lucide-react';
6
- import { cn, keepOpenOnToast } from '../../../lib/utils.js';
7
- function Sheet({ ...props }) {
8
- return _jsx(SheetPrimitive.Root, { "data-slot": "sheet", ...props });
9
- }
10
- function SheetTrigger({ ...props }) {
11
- return _jsx(SheetPrimitive.Trigger, { "data-slot": "sheet-trigger", ...props });
12
- }
13
- function SheetClose({ ...props }) {
14
- return _jsx(SheetPrimitive.Close, { "data-slot": "sheet-close", ...props });
15
- }
16
- function SheetPortal({ ...props }) {
17
- return _jsx(SheetPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
18
- }
19
- function SheetOverlay({ className, ...props }) {
20
- return (_jsx(SheetPrimitive.Overlay, { "data-slot": "sheet-overlay", className: cn('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 fixed inset-0 z-50 bg-black/80', className), ...props }));
21
- }
22
- /**
23
- * ⛔ A PANEL BUILT FOR A DESKTOP HAS TO STOP BEING TWO FIFTHS ON A PHONE.
24
- *
25
- * `w-2/5` and `p-12` were unconditional. At a 390px viewport that is a 156px
26
- * panel with 59px of usable width, and a form field inside it measures 9px of
27
- * text — a sheet that cannot be read, let alone filled in. At 320px the panel
28
- * is 128px and the field has NOTHING: its own padding is wider than its box.
29
- * Thirteen product-console routes opened a sheet that looked like that, which
30
- * is why that console has carried a rule against `[data-slot='sheet-content']`
31
- * since its M10 lane; this is that rule brought home, and the console can drop
32
- * its copy.
33
- *
34
- * ⚠️ THE PHONE VALUES CARRY THE MODIFIER, THE DESKTOP ONES DO NOT, AND THAT
35
- * ASYMMETRY IS THE WHOLE MECHANISM. `cn` resolves these through tailwind-merge
36
- * before the cascade sees them, and tailwind-merge only drops a conflicting
37
- * class carrying the SAME modifiers. So a caller's `w-[594px]` replaces
38
- * `w-2/5` and leaves `max-sm:w-full` standing: the fifteen product-console
39
- * sheets that declare a pixel width of their own — and the two that declare
40
- * `w-full` — all still fill a phone, with no edit at the call site. Written
41
- * the other way round — `w-full sm:w-2/5` — the caller's bare `w-[594px]`
42
- * would have been overruled by `sm:w-2/5` at every desktop width instead,
43
- * which is the same bug pointing the other way.
44
- *
45
- * ⚠️ IT CUTS BOTH WAYS, AND THE PADDING IS WHERE THAT IS FELT. A caller's bare
46
- * `p-0` drops `p-12` and cannot reach `max-sm:px-4` either, so a panel that
47
- * asked for no padding gets 16px a side below 40rem. That is deliberate — it
48
- * is what makes the phone step reach the call sites that need it most — and it
49
- * is what product-console's own unlayered rule already did to those five
50
- * sheets, so nothing there moves. For any other consumer it is a behaviour
51
- * change from 2.0.0-beta.11, and the way out is one token.
52
- *
53
- * A call site that genuinely wants its own phone width or padding says so with
54
- * the modifier (`max-sm:w-[320px]`, `max-sm:p-0`), which is one token and
55
- * strictly more than the console's unlayered rule allowed anyone.
56
- *
57
- * 40rem rather than 768px, unlike `SidebarTrigger` next door: nothing here is
58
- * paired with a pixel media query in JavaScript. This is a reading-width
59
- * decision and it is the complement of `sm:`, so it moves with the reader's
60
- * font exactly as the rest of the package's responsive steps do. The one panel
61
- * that IS coupled to the pixel breakpoint is the navigation drawer, and
62
- * `SidebarRoot` opts it out by restating both tokens under `max-sm:`.
63
- */
64
- const sheetVariants = cva('fixed z-50 gap-4 bg-background p-12 max-sm:px-4 shadow-lg transition ease-in-out motion-safe:data-[state=open]:animate-in motion-safe:data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500', {
65
- variants: {
66
- side: {
67
- top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
68
- bottom: 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
69
- left: 'inset-y-0 left-0 h-full w-2/5 max-sm:w-full border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left',
70
- right: 'inset-y-0 right-0 h-full w-2/5 max-sm:w-full border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right'
71
- }
72
- },
73
- defaultVariants: {
74
- side: 'right'
75
- }
76
- });
77
- function SheetContent({ side = 'right', className, children, showCloseButton = true, closeLabel = 'Close', onInteractOutside, ...props }) {
78
- return (_jsxs(SheetPortal, { children: [_jsx(SheetOverlay, {}), _jsxs(SheetPrimitive.Content, { "data-slot": "sheet-content", className: cn('flex max-h-screen flex-col overflow-x-auto px-8 pb-0', sheetVariants({ side }), className), onInteractOutside: keepOpenOnToast(onInteractOutside), ...props, children: [children, showCloseButton && (_jsxs(SheetPrimitive.Close, { className: "data-[state=open]:bg-secondary ring-offset-background focus-visible:ring-ring absolute top-7 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none", children: [_jsx(X, { className: "h-6 w-6" }), _jsx("span", { className: "sr-only", children: closeLabel })] }))] })] }));
79
- }
80
- function SheetHeader({ className, ...props }) {
81
- return (_jsx("div", { "data-slot": "sheet-header", className: cn('mb-4 flex flex-col space-y-2 text-center sm:text-left', className), ...props }));
82
- }
83
- function SheetFooter({ className, ...props }) {
84
- return (_jsx("div", { "data-slot": "sheet-footer", className: cn('mt-auto flex flex-col-reverse justify-center pt-20 sm:flex-row sm:justify-end sm:space-x-2', className), ...props }));
85
- }
86
- function SheetTitle({ className, ...props }) {
87
- return (_jsx(SheetPrimitive.Title, { "data-slot": "sheet-title", className: cn('text-muted-foreground mb-2 flex text-xl font-bold', className), ...props }));
88
- }
89
- function SheetDescription({ className, ...props }) {
90
- return (_jsx(SheetPrimitive.Description, { "data-slot": "sheet-description", className: cn('text-muted-foreground text-sm font-medium', className), ...props }));
91
- }
92
- export { Sheet, SheetPortal, SheetOverlay, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription };
1
+ "use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as a from"@radix-ui/react-dialog";import{cva as u}from"class-variance-authority";import{X as h}from"lucide-react";import{cn as s,keepOpenOnToast as p}from"../../../lib/utils.js";function x({...t}){return e(a.Root,{"data-slot":"sheet",...t})}function g({...t}){return e(a.Trigger,{"data-slot":"sheet-trigger",...t})}function b({...t}){return e(a.Close,{"data-slot":"sheet-close",...t})}function i({...t}){return e(a.Portal,{"data-slot":"sheet-portal",...t})}function r({className:t,...o}){return e(a.Overlay,{"data-slot":"sheet-overlay",className:s("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 fixed inset-0 z-50 bg-black/80",t),...o})}const v=u("fixed z-50 gap-4 bg-background p-12 max-sm:px-4 shadow-lg transition ease-in-out motion-safe:data-[state=open]:animate-in motion-safe:data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-2/5 max-sm:w-full border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left",right:"inset-y-0 right-0 h-full w-2/5 max-sm:w-full border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right"}},defaultVariants:{side:"right"}});function y({side:t="right",className:o,children:l,showCloseButton:d=true,closeLabel:f="Close",onInteractOutside:c,...m}){return n(i,{children:[e(r,{}),n(a.Content,{"data-slot":"sheet-content",className:s("flex max-h-screen flex-col overflow-x-auto px-8 pb-0",v({side:t}),o),onInteractOutside:p(c),...m,children:[l,d&&n(a.Close,{className:"data-[state=open]:bg-secondary ring-offset-background focus-visible:ring-ring absolute top-7 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none",children:[e(h,{className:"h-6 w-6"}),e("span",{className:"sr-only",children:f})]})]})]})}function S({className:t,...o}){return e("div",{"data-slot":"sheet-header",className:s("mb-4 flex flex-col space-y-2 text-center sm:text-left",t),...o})}function N({className:t,...o}){return e("div",{"data-slot":"sheet-footer",className:s("mt-auto flex flex-col-reverse justify-center pt-20 sm:flex-row sm:justify-end sm:space-x-2",t),...o})}function w({className:t,...o}){return e(a.Title,{"data-slot":"sheet-title",className:s("text-muted-foreground mb-2 flex text-xl font-bold",t),...o})}function j({className:t,...o}){return e(a.Description,{"data-slot":"sheet-description",className:s("text-muted-foreground text-sm font-medium",t),...o})}export{x as Sheet,i as SheetPortal,r as SheetOverlay,g as SheetTrigger,b as SheetClose,y as SheetContent,S as SheetHeader,N as SheetFooter,w as SheetTitle,j as SheetDescription};
@@ -1,11 +1 @@
1
- export * from './sidebar-root.js';
2
- export * from './sidebar-components.js';
3
- export * from './sidebar-item-icon-button.js';
4
- export * from './sidebar-item-button.js';
5
- export * from './sidebar-item.js';
6
- export * from './sidebar-expand-button.js';
7
- export * from './sidebar-trigger.js';
8
- export * from './sidebar-back-button.js';
9
- export * from './sidebar-provider.js';
10
- export * from './sidebar-item-collapsible.js';
11
- export * from './sidebar-router.js';
1
+ export*from"./sidebar-root.js";export*from"./sidebar-components.js";export*from"./sidebar-item-icon-button.js";export*from"./sidebar-item-button.js";export*from"./sidebar-item.js";export*from"./sidebar-expand-button.js";export*from"./sidebar-trigger.js";export*from"./sidebar-back-button.js";export*from"./sidebar-provider.js";export*from"./sidebar-item-collapsible.js";export*from"./sidebar-router.js";
@@ -1,119 +1 @@
1
- 'use strict'
2
-
3
- /**
4
- * Next.js router resolution — deliberately authored as CommonJS, and shipped
5
- * byte-identical into BOTH build outputs (`dist/` and `dist/esm/`).
6
- *
7
- * `require` with a literal specifier, wrapped in try/catch, is the one form
8
- * that behaves correctly in both consumer worlds:
9
- * - Next (webpack/turbopack) statically sees the literal and bundles
10
- * next/link into the client chunk, so navigation stays client-side;
11
- * - Vite/rolldown cannot resolve it when `next` is absent, and instead of
12
- * failing the build it drops through to the catch.
13
- * A dynamic `import()` fails the Vite build outright; a computed specifier
14
- * hides it from Next too, which would silently downgrade the Console to full
15
- * page loads.
16
- *
17
- * That form has no equivalent in ES modules: a bare `require` does not exist
18
- * there, so the ESM build would always fall through to the catch and every
19
- * Next.js consumer would silently lose client-side sidebar navigation. Rather
20
- * than fork the behavior per format, the ~15 lines that need CommonJS
21
- * semantics live in a `.cjs` file — CommonJS inside `dist/` (package type
22
- * commonjs) and CommonJS inside `dist/esm/` (`.cjs` overrides type module).
23
- * Every bundler in play (webpack, rollup/Vite, esbuild) and Node itself read
24
- * it the same way from either entry point.
25
- *
26
- * Resolved once by its importer, so the returned object — and therefore
27
- * `usePathname`'s identity — is stable across renders.
28
- *
29
- * @returns {{ Link: unknown, usePathname: () => string } | null}
30
- */
31
- /**
32
- * Whether `next` itself is present in this install.
33
- *
34
- * The thrown error cannot answer this on its own. MODULE_NOT_FOUND (and the
35
- * "Cannot find module" text) is ALSO what Node reports when `next/link` is right
36
- * there but something IT requires is missing — a genuinely broken install, which
37
- * an error-shape check silences along with the intended fallback. Asking about
38
- * the top-level package separates "no Next here" from "Next here and broken".
39
- *
40
- * `next/package.json` rather than `next`: the manifest is inert, while the
41
- * package entry executes code and could throw for the very reason being
42
- * diagnosed.
43
- */
44
- function nextIsInstalled() {
45
- try {
46
- require.resolve('next/package.json')
47
- return true
48
- } catch {
49
- return false
50
- }
51
- }
52
-
53
- /**
54
- * Whether the failure says one of the two ENTRIES we require is itself absent,
55
- * rather than something missing INSIDE an installed next.
56
- *
57
- * This is the distinction the warning turns on, and `nextIsInstalled()` alone
58
- * cannot draw it: a shimmed or mocked environment can leave the real `next`
59
- * package on disk while `next/link` does not resolve, which is not a broken
60
- * install and not worth a word. Naming the two specifiers keeps the check narrow
61
- * — a missing INNER dependency reports some other module and still warns, which
62
- * is the whole point.
63
- */
64
- function isMissingNextEntry(error) {
65
- return /Cannot find module '(next\/link|next\/navigation)'/.test(
66
- String(error && error.message)
67
- )
68
- }
69
-
70
- exports.loadNextRouter = function loadNextRouter() {
71
- // Which entry is being loaded right now, so a failure can name the one that
72
- // actually failed. Both requires share one try block, and the message used to
73
- // say "next/link" unconditionally — so a broken `next/navigation` sent whoever
74
- // read the warning to inspect the wrong module.
75
- //
76
- // A variable for the MESSAGE only. Both specifiers stay literal in the
77
- // `require` calls: per the header, a computed specifier hides them from Next's
78
- // bundler and silently downgrades navigation, which is the whole reason this
79
- // file is CommonJS.
80
- let loading = 'next/link'
81
- try {
82
- const link = require('next/link')
83
- loading = 'next/navigation'
84
- const navigation = require('next/navigation')
85
-
86
- const Link = link?.default ?? link
87
- const usePathname = navigation?.usePathname
88
-
89
- if (!Link || typeof usePathname !== 'function') return null
90
- return { Link, usePathname }
91
- } catch (error) {
92
- // Two very different situations reach here. `next` simply NOT INSTALLED is
93
- // the intended fallback (every Vite consumer) and must stay silent. `next`
94
- // installed but failing to load is the silent downgrade this file's header
95
- // warns about: the Console drops to plain anchors and full page loads with
96
- // nothing anywhere saying why. Only the second one is worth a word, and only
97
- // in development.
98
- //
99
- // TWO signals, because each covers what the other misses.
100
- // `nextIsInstalled()` is the robust one: it does not depend on error text,
101
- // which varies across Node, Jest and every bundler. But on its own it warns
102
- // whenever the real package is on disk while the entry does not resolve —
103
- // a mocked or shimmed environment, not a broken install. `isMissingNextEntry`
104
- // narrows that: a missing INNER dependency names some other module, so it
105
- // still warns, which is the case actually worth reporting.
106
- if (
107
- process.env.NODE_ENV !== 'production' &&
108
- nextIsInstalled() &&
109
- !isMissingNextEntry(error)
110
- ) {
111
- console.warn(
112
- `[sindarian-ui] next is installed but ${loading} failed to load, so ` +
113
- 'sidebar navigation falls back to full page loads. Original error:',
114
- error
115
- )
116
- }
117
- return null
118
- }
119
- }
1
+ "use strict";function nextIsInstalled(){try{require.resolve("next/package.json");return true}catch{return false}}function isMissingNextEntry(t){return/Cannot find module '(next\/link|next\/navigation)'/.test(String(t&&t.message))}exports.loadNextRouter=function t(){let e="next/link";try{const n=require("next/link");e="next/navigation";const r=require("next/navigation");const i=n?.default??n;const a=r?.usePathname;if(!i||typeof a!=="function")return null;return{Link:i,usePathname:a}}catch(n){if(process.env.NODE_ENV!=="production"&&nextIsInstalled()&&!isMissingNextEntry(n)){console.warn(`[sindarian-ui] next is installed but ${e} failed to load, so sidebar navigation falls back to full page loads. Original error:`,n)}return null}};
@@ -1,5 +1 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { SidebarItem } from './sidebar-item.js';
3
- export function SidebarBackButton({ ...props }) {
4
- return (_jsx("div", { className: "flex w-full flex-col", children: _jsx(SidebarItem, { ...props }) }));
5
- }
1
+ import{jsx as r}from"react/jsx-runtime";import{SidebarItem as o}from"./sidebar-item.js";export function SidebarBackButton({...e}){return r("div",{className:"flex w-full flex-col",children:r(o,{...e})})}
@@ -1,15 +1 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from '../../../lib/utils.js';
3
- import { useSidebar } from './sidebar-provider.js';
4
- import { Separator } from '../separator/index.js';
5
- export const SidebarHeader = ({ className, collapsed, ...props }) => (_jsx("div", { "data-slot": "sidebar-header", "data-collapsed": collapsed, className: cn('bg-card flex w-full flex-col items-center p-4', collapsed && 'justify-center p-0', className), ...props }));
6
- export const SidebarContent = ({ className, ...props }) => (_jsx("div", { "data-slot": "sidebar-content", className: cn('bg-card group flex flex-1 flex-col gap-4 overflow-hidden overflow-y-auto px-4 pt-4 transition-all duration-300 ease-in-out', 'group-data-[collapsed=true]/sidebar:items-center group-data-[collapsed=true]/sidebar:px-2', className), ...props }));
7
- export const SidebarGroup = ({ className, ...props }) => (_jsx("nav", { "data-slot": "sidebar-group", className: cn('flex flex-col gap-1', 'group-data-[collapsed=true]/sidebar:items-center', className), ...props }));
8
- export const SidebarGroupTitle = ({ children }) => {
9
- const { isCollapsed } = useSidebar();
10
- if (isCollapsed) {
11
- return _jsx(Separator, {});
12
- }
13
- return (_jsx("div", { "data-slot": "sidebar-group-title", className: "my-2 px-2", children: _jsx("p", { className: "text-body-text text-xs font-semibold tracking-[1.1px] uppercase", children: children }) }));
14
- };
15
- export const SidebarFooter = ({ className, ...props }) => (_jsx("nav", { "data-slot": "sidebar-footer", className: cn('border-border bg-card flex w-full justify-center border-t p-4', className), ...props }));
1
+ import{jsx as t}from"react/jsx-runtime";import{cn as a}from"../../../lib/utils.js";import{useSidebar as s}from"./sidebar-provider.js";import{Separator as d}from"../separator/index.js";export const SidebarHeader=({className:r,collapsed:e,...o})=>t("div",{"data-slot":"sidebar-header","data-collapsed":e,className:a("bg-card flex w-full flex-col items-center p-4",e&&"justify-center p-0",r),...o});export const SidebarContent=({className:r,...e})=>t("div",{"data-slot":"sidebar-content",className:a("bg-card group flex flex-1 flex-col gap-4 overflow-hidden overflow-y-auto px-4 pt-4 transition-all duration-300 ease-in-out","group-data-[collapsed=true]/sidebar:items-center group-data-[collapsed=true]/sidebar:px-2",r),...e});export const SidebarGroup=({className:r,...e})=>t("nav",{"data-slot":"sidebar-group",className:a("flex flex-col gap-1","group-data-[collapsed=true]/sidebar:items-center",r),...e});export const SidebarGroupTitle=({children:r})=>{const{isCollapsed:e}=s();if(e){return t(d,{})}return t("div",{"data-slot":"sidebar-group-title",className:"my-2 px-2",children:t("p",{className:"text-body-text text-xs font-semibold tracking-[1.1px] uppercase",children:r})})};export const SidebarFooter=({className:r,...e})=>t("nav",{"data-slot":"sidebar-footer",className:a("border-border bg-card flex w-full justify-center border-t p-4",r),...e});
@@ -1,42 +1 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import React from 'react';
4
- import { PanelLeftClose, PanelRightClose } from 'lucide-react';
5
- import { useSidebar } from './sidebar-provider.js';
6
- import { SidebarFooter } from './sidebar-components.js';
7
- import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../../ui/tooltip/index.js';
8
- import { IconButton } from '../icon-button/index.js';
9
- export const SidebarExpandButton = ({ tooltip }) => {
10
- const { isCollapsed, isDrawer, toggleSidebar } = useSidebar();
11
- /**
12
- * Nothing to collapse in a drawer. The expanded branch below hangs its button
13
- * at `right-[-20px]`, twenty pixels outside the rail — off the canvas of an
14
- * overlay that has no page beside it — and collapsing to a 72px strip inside
15
- * a 244px sheet is not a state worth reaching. The drawer's own close control
16
- * and the backdrop are how it is dismissed.
17
- *
18
- * ⚠️ `isDrawer`, NOT `isMobile`. A consumer left on the default
19
- * `mobile="inline"` still has a real rail below 768px, and its collapse
20
- * control has to come with it.
21
- */
22
- if (isDrawer) {
23
- return null;
24
- }
25
- return (_jsxs(React.Fragment, { children: [!isCollapsed && (_jsx("div", { "data-slot": "sidebar-expand-button", className: "border-border bg-card flex w-full", children: _jsx("div", { className: "absolute right-[-20px] bottom-4", children: _jsx(IconButton, { variant: "secondary", rounded: true, onClick: toggleSidebar, "aria-label": tooltip || 'Collapse sidebar', "aria-expanded": true, children: _jsx(PanelLeftClose, { className: "text-muted-foreground" }) }) }) })), isCollapsed && (_jsx(SidebarFooter, { children: _jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger
26
- // `hover:text-accent-foreground` on the TRIGGER, not only on
27
- // the glyph below. The base ink here used to be base/400, which
28
- // no rule paired with anything; now that it is the muted token,
29
- // it is the ink anything inside this trigger inherits, and the
30
- // muted token reads 1.07:1 on sunglow in dark. The glyph
31
- // overrides it today, so this pairs the fill for whatever the
32
- // trigger holds next.
33
- , {
34
- // `hover:text-accent-foreground` on the TRIGGER, not only on
35
- // the glyph below. The base ink here used to be base/400, which
36
- // no rule paired with anything; now that it is the muted token,
37
- // it is the ink anything inside this trigger inherits, and the
38
- // muted token reads 1.07:1 on sunglow in dark. The glyph
39
- // overrides it today, so this pairs the fill for whatever the
40
- // trigger holds next.
41
- className: "group/expand-button text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-sm bg-transparent p-2", onClick: toggleSidebar, "aria-label": tooltip || 'Expand sidebar', "aria-expanded": false, children: _jsx(PanelRightClose, { className: "group-hover/expand-button:text-accent-foreground dark:text-white" }) }), _jsx(TooltipContent, { side: "right", children: tooltip || 'Expand' })] }) }) }))] }));
42
- };
1
+ "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import d from"react";import{PanelLeftClose as i,PanelRightClose as l}from"lucide-react";import{useSidebar as s}from"./sidebar-provider.js";import{SidebarFooter as c}from"./sidebar-components.js";import{Tooltip as p,TooltipContent as m,TooltipProvider as u,TooltipTrigger as x}from"../../ui/tooltip/index.js";import{IconButton as b}from"../icon-button/index.js";export const SidebarExpandButton=({tooltip:r})=>{const{isCollapsed:o,isDrawer:n,toggleSidebar:t}=s();if(n){return null}return a(d.Fragment,{children:[!o&&e("div",{"data-slot":"sidebar-expand-button",className:"border-border bg-card flex w-full",children:e("div",{className:"absolute right-[-20px] bottom-4",children:e(b,{variant:"secondary",rounded:true,onClick:t,"aria-label":r||"Collapse sidebar","aria-expanded":true,children:e(i,{className:"text-muted-foreground"})})})}),o&&e(c,{children:e(u,{children:a(p,{children:[e(x,{className:"group/expand-button text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded-sm bg-transparent p-2",onClick:t,"aria-label":r||"Expand sidebar","aria-expanded":false,children:e(l,{className:"group-hover/expand-button:text-accent-foreground dark:text-white"})}),e(m,{side:"right",children:r||"Expand"})]})})})]})};
@@ -1,18 +1 @@
1
- 'use client';
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { buttonVariants, iconVariants } from '../../ui/button/index.js';
4
- import { cn } from '../../../lib/utils.js';
5
- import { useSidebarRouter } from './sidebar-router.js';
6
- export function SidebarItemButton({ className, title, icon, href, active, inactive, disabled = false, ...props }) {
7
- const { Link } = useSidebarRouter();
8
- const sharedClassName = cn(buttonVariants({
9
- variant: active ? 'tertiary' : 'outline',
10
- fullWidth: true,
11
- size: 'small'
12
- }), 'group/link flex items-center justify-start', inactive && 'hover:border-transparent', disabled && 'cursor-default opacity-30', className);
13
- const content = (_jsxs(_Fragment, { children: [icon && (_jsx("span", { className: cn(iconVariants({ position: 'start', size: 'small' })), children: icon })), title] }));
14
- if (disabled || inactive) {
15
- return (_jsx("div", { "data-slot": "sidebar-item-button", className: sharedClassName, children: content }));
16
- }
17
- return (_jsx(Link, { "data-slot": "sidebar-item-button", href: href, className: sharedClassName, ...props, children: content }));
18
- }
1
+ "use client";import{jsx as t,Fragment as f,jsxs as p}from"react/jsx-runtime";import{buttonVariants as h,iconVariants as b}from"../../ui/button/index.js";import{cn as i}from"../../../lib/utils.js";import{useSidebarRouter as x}from"./sidebar-router.js";export function SidebarItemButton({className:o,title:l,icon:r,href:m,active:u,inactive:s,disabled:e=false,...c}){const{Link:d}=x();const a=i(h({variant:u?"tertiary":"outline",fullWidth:true,size:"small"}),"group/link flex items-center justify-start",s&&"hover:border-transparent",e&&"cursor-default opacity-30",o);const n=p(f,{children:[r&&t("span",{className:i(b({position:"start",size:"small"})),children:r}),l]});if(e||s){return t("div",{"data-slot":"sidebar-item-button",className:a,children:n})}return t(d,{"data-slot":"sidebar-item-button",href:m,className:a,...c,children:n})}
@@ -1,44 +1 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React from 'react';
3
- import { cn } from '../../../lib/utils.js';
4
- import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@radix-ui/react-collapsible';
5
- import { ChevronRight } from 'lucide-react';
6
- import { useSidebar } from './sidebar-provider.js';
7
- import { Separator } from '../separator/index.js';
8
- import { SidebarItemButton } from './sidebar-item-button.js';
9
- import { buttonVariants } from '../button/index.js';
10
- import { SidebarItemIconButton } from './sidebar-item-icon-button.js';
11
- export function SidebarItemCollapsible({ name, className, ...props }) {
12
- const { isCollapsed, getItemCollapsed, setItemCollapsed } = useSidebar();
13
- const [open, setOpen] = React.useState(name ? getItemCollapsed(name) : false);
14
- const handleOpenChange = (open) => {
15
- setOpen(open);
16
- if (name) {
17
- setItemCollapsed(name, open);
18
- }
19
- };
20
- React.useEffect(() => {
21
- if (name) {
22
- setOpen(getItemCollapsed(name));
23
- }
24
- }, [name, getItemCollapsed]);
25
- return (_jsx(Collapsible, { open: open, onOpenChange: handleOpenChange, "data-slot": "sidebar-item-collapsible", className: cn({
26
- 'rounded-md': isCollapsed
27
- }, className), ...props }));
28
- }
29
- export function SidebarItemCollapsibleTrigger({ className, icon, title, children: _children, ...props }) {
30
- const { isCollapsed } = useSidebar();
31
- return (_jsxs(CollapsibleTrigger, { "data-slot": "sidebar-item-collapsible-trigger", className: cn('flex w-full flex-row p-0', 'transition-all hover:underline [&[data-state=open]>svg]:rotate-90', buttonVariants({
32
- variant: 'outline',
33
- fullWidth: true,
34
- size: 'small'
35
- }), {
36
- 'size-10': isCollapsed
37
- }, className), ...props, children: [isCollapsed && (_jsx(SidebarItemIconButton, { title: title, icon: icon, href: "", inactive: true })), !isCollapsed && (_jsxs(_Fragment, { children: [_jsx(SidebarItemButton, { title: title, icon: icon, href: '', inactive: true }), _jsx(ChevronRight, { className: "text-foreground mr-1 size-6 shrink-0 cursor-pointer transition-transform duration-200" })] }))] }));
38
- }
39
- export function SidebarItemCollapsibleContent({ className, children, ...props }) {
40
- const { isCollapsed } = useSidebar();
41
- return (_jsx(CollapsibleContent, { "data-slot": "sidebar-item-collapsible-content", className: cn('mt-1 flex flex-col gap-1', 'motion-safe:data-[state=closed]:animate-collapsible-up motion-safe:data-[state=open]:animate-collapsible-down overflow-hidden transition-all duration-200 ease-in-out', {
42
- 'items-center': isCollapsed
43
- }, className), ...props, children: isCollapsed ? (children) : (_jsxs("div", { className: "flex items-stretch gap-3", children: [_jsx(Separator, { className: "ml-5 h-auto", orientation: "vertical" }), _jsx("div", { className: "flex w-full flex-col gap-1", children: children })] })) }));
44
- }
1
+ import{jsx as o,Fragment as b,jsxs as s}from"react/jsx-runtime";import d from"react";import{cn as n}from"../../../lib/utils.js";import{Collapsible as h,CollapsibleContent as g,CollapsibleTrigger as C}from"@radix-ui/react-collapsible";import{ChevronRight as x}from"lucide-react";import{useSidebar as m}from"./sidebar-provider.js";import{Separator as v}from"../separator/index.js";import{SidebarItemButton as I}from"./sidebar-item-button.js";import{buttonVariants as S}from"../button/index.js";import{SidebarItemIconButton as N}from"./sidebar-item-icon-button.js";export function SidebarItemCollapsible({name:e,className:t,...a}){const{isCollapsed:l,getItemCollapsed:i,setItemCollapsed:r}=m();const[f,p]=d.useState(e?i(e):false);const u=c=>{p(c);if(e){r(e,c)}};d.useEffect(()=>{if(e){p(i(e))}},[e,i]);return o(h,{open:f,onOpenChange:u,"data-slot":"sidebar-item-collapsible",className:n({"rounded-md":l},t),...a})}export function SidebarItemCollapsibleTrigger({className:e,icon:t,title:a,children:l,...i}){const{isCollapsed:r}=m();return s(C,{"data-slot":"sidebar-item-collapsible-trigger",className:n("flex w-full flex-row p-0","transition-all hover:underline [&[data-state=open]>svg]:rotate-90",S({variant:"outline",fullWidth:true,size:"small"}),{"size-10":r},e),...i,children:[r&&o(N,{title:a,icon:t,href:"",inactive:true}),!r&&s(b,{children:[o(I,{title:a,icon:t,href:"",inactive:true}),o(x,{className:"text-foreground mr-1 size-6 shrink-0 cursor-pointer transition-transform duration-200"})]})]})}export function SidebarItemCollapsibleContent({className:e,children:t,...a}){const{isCollapsed:l}=m();return o(g,{"data-slot":"sidebar-item-collapsible-content",className:n("mt-1 flex flex-col gap-1","motion-safe:data-[state=closed]:animate-collapsible-up motion-safe:data-[state=open]:animate-collapsible-down overflow-hidden transition-all duration-200 ease-in-out",{"items-center":l},e),...a,children:l?t:s("div",{className:"flex items-stretch gap-3",children:[o(v,{className:"ml-5 h-auto",orientation:"vertical"}),o("div",{className:"flex w-full flex-col gap-1",children:t})]})})}
@@ -1,14 +1 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { buttonVariants } from '../../ui/button/index.js';
4
- import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../../ui/tooltip/index.js';
5
- import { cn } from '../../../lib/utils.js';
6
- import { iconButtonVariants } from '../icon-button/index.js';
7
- import { useSidebarRouter } from './sidebar-router.js';
8
- export const SidebarItemIconButton = ({ className, title, icon, href, active, inactive, disabled, ...props }) => {
9
- const { Link } = useSidebarRouter();
10
- const sharedClassName = cn(buttonVariants({
11
- variant: active ? 'tertiary' : 'outline'
12
- }), iconButtonVariants(), inactive && 'hover:border-transparent', disabled && 'cursor-default opacity-30', className);
13
- return (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { delayDuration: 0, children: [_jsx(TooltipTrigger, { asChild: true, children: disabled || inactive ? (_jsx("div", { "data-slot": "sidebar-item-icon-button", className: sharedClassName, children: icon })) : (_jsx(Link, { "data-slot": "sidebar-item-icon-button", href: href, className: sharedClassName, ...props, children: icon })) }), _jsx(TooltipContent, { side: "right", children: title })] }) }));
14
- };
1
+ "use client";import{jsx as t,jsxs as c}from"react/jsx-runtime";import{buttonVariants as u}from"../../ui/button/index.js";import{Tooltip as p,TooltipContent as h,TooltipProvider as f,TooltipTrigger as b}from"../../ui/tooltip/index.js";import{cn as x}from"../../../lib/utils.js";import{iconButtonVariants as T}from"../icon-button/index.js";import{useSidebarRouter as j}from"./sidebar-router.js";export const SidebarItemIconButton=({className:a,title:n,icon:r,href:s,active:l,inactive:o,disabled:i,...d})=>{const{Link:m}=j();const e=x(u({variant:l?"tertiary":"outline"}),T(),o&&"hover:border-transparent",i&&"cursor-default opacity-30",a);return t(f,{children:c(p,{delayDuration:0,children:[t(b,{asChild:true,children:i||o?t("div",{"data-slot":"sidebar-item-icon-button",className:e,children:r}):t(m,{"data-slot":"sidebar-item-icon-button",href:s,className:e,...d,children:r})}),t(h,{side:"right",children:n})]})})};