@xjur-ui/react 1.0.6 → 2.1.0

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 (336) hide show
  1. package/.turbo/turbo-build.log +279 -68
  2. package/CHANGELOG.md +114 -0
  3. package/README.md +146 -0
  4. package/dist/chunk-2CM3SFOY.js +2 -0
  5. package/dist/chunk-2CM3SFOY.js.map +1 -0
  6. package/dist/chunk-2CTBH6VI.js +2 -0
  7. package/dist/chunk-2CTBH6VI.js.map +1 -0
  8. package/dist/chunk-4BGTC333.js +2 -0
  9. package/dist/chunk-4BGTC333.js.map +1 -0
  10. package/dist/chunk-5WLIDYZH.js +2 -0
  11. package/dist/chunk-5WLIDYZH.js.map +1 -0
  12. package/dist/chunk-6AD6O6II.js +2 -0
  13. package/dist/chunk-6AD6O6II.js.map +1 -0
  14. package/dist/chunk-AA6V5YEC.js +2 -0
  15. package/dist/chunk-AA6V5YEC.js.map +1 -0
  16. package/dist/chunk-BK6FP63A.js +2 -0
  17. package/dist/chunk-BK6FP63A.js.map +1 -0
  18. package/dist/chunk-BZDGWC5O.js +2 -0
  19. package/dist/chunk-BZDGWC5O.js.map +1 -0
  20. package/dist/chunk-CBFC4QME.js +2 -0
  21. package/dist/chunk-CBFC4QME.js.map +1 -0
  22. package/dist/chunk-CI3ZXWEX.js +2 -0
  23. package/dist/chunk-CI3ZXWEX.js.map +1 -0
  24. package/dist/chunk-DFXHNK5D.js +2 -0
  25. package/dist/chunk-DFXHNK5D.js.map +1 -0
  26. package/dist/chunk-EIG6CBTQ.js +2 -0
  27. package/dist/chunk-EIG6CBTQ.js.map +1 -0
  28. package/dist/chunk-EXC2XOL6.js +2 -0
  29. package/dist/chunk-EXC2XOL6.js.map +1 -0
  30. package/dist/chunk-F4DYKYWJ.js +2 -0
  31. package/dist/chunk-F4DYKYWJ.js.map +1 -0
  32. package/dist/chunk-F5ZLEQGN.js +2 -0
  33. package/dist/chunk-F5ZLEQGN.js.map +1 -0
  34. package/dist/chunk-IKL6PSXU.js +2 -0
  35. package/dist/chunk-IKL6PSXU.js.map +1 -0
  36. package/dist/chunk-IRHU7PDO.js +2 -0
  37. package/dist/chunk-IRHU7PDO.js.map +1 -0
  38. package/dist/chunk-J4X5RQTR.js +2 -0
  39. package/dist/chunk-J4X5RQTR.js.map +1 -0
  40. package/dist/chunk-KIFR5VIE.js +2 -0
  41. package/dist/chunk-KIFR5VIE.js.map +1 -0
  42. package/dist/chunk-KS6WGBHQ.js +2 -0
  43. package/dist/chunk-KS6WGBHQ.js.map +1 -0
  44. package/dist/chunk-L4ET6GIZ.js +2 -0
  45. package/dist/chunk-L4ET6GIZ.js.map +1 -0
  46. package/dist/chunk-MZSV4LNY.js +2 -0
  47. package/dist/chunk-MZSV4LNY.js.map +1 -0
  48. package/dist/chunk-NELCN6E2.js +2 -0
  49. package/dist/chunk-NELCN6E2.js.map +1 -0
  50. package/dist/chunk-OS53BV63.js +3 -0
  51. package/dist/chunk-OS53BV63.js.map +1 -0
  52. package/dist/chunk-PKCW37CJ.js +2 -0
  53. package/dist/chunk-PKCW37CJ.js.map +1 -0
  54. package/dist/chunk-RWMV7APX.js +2 -0
  55. package/dist/chunk-RWMV7APX.js.map +1 -0
  56. package/dist/chunk-SLAAEXWI.js +2 -0
  57. package/dist/chunk-SLAAEXWI.js.map +1 -0
  58. package/dist/chunk-SXGSWVMZ.js +2 -0
  59. package/dist/chunk-SXGSWVMZ.js.map +1 -0
  60. package/dist/chunk-TB6KI6CL.js +2 -0
  61. package/dist/chunk-TB6KI6CL.js.map +1 -0
  62. package/dist/chunk-TSVURBUY.js +2 -0
  63. package/dist/chunk-TSVURBUY.js.map +1 -0
  64. package/dist/chunk-UXIVZWLB.js +2 -0
  65. package/dist/chunk-UXIVZWLB.js.map +1 -0
  66. package/dist/chunk-WEBAXQID.js +2 -0
  67. package/dist/chunk-WEBAXQID.js.map +1 -0
  68. package/dist/chunk-WV7QV2PU.js +2 -0
  69. package/dist/chunk-WV7QV2PU.js.map +1 -0
  70. package/dist/chunk-Z47R2CIM.js +2 -0
  71. package/dist/chunk-Z47R2CIM.js.map +1 -0
  72. package/dist/chunk-ZVVPUP7V.js +2 -0
  73. package/dist/chunk-ZVVPUP7V.js.map +1 -0
  74. package/dist/components/avatar-group.js +2 -179
  75. package/dist/components/avatar-group.js.map +1 -0
  76. package/dist/components/avatar.js +2 -59
  77. package/dist/components/avatar.js.map +1 -0
  78. package/dist/components/badge.js +2 -111
  79. package/dist/components/badge.js.map +1 -0
  80. package/dist/components/breadcrumb.d.ts +20 -0
  81. package/dist/components/breadcrumb.js +2 -0
  82. package/dist/components/breadcrumb.js.map +1 -0
  83. package/dist/components/chip.d.ts +5 -2
  84. package/dist/components/chip.js +2 -256
  85. package/dist/components/chip.js.map +1 -0
  86. package/dist/components/collapsible.js +2 -41
  87. package/dist/components/collapsible.js.map +1 -0
  88. package/dist/components/dialog.d.ts +51 -0
  89. package/dist/components/dialog.js +2 -0
  90. package/dist/components/dialog.js.map +1 -0
  91. package/dist/components/divider.js +2 -29
  92. package/dist/components/divider.js.map +1 -0
  93. package/dist/components/drag-and-drop/drag-handle.d.ts +15 -0
  94. package/dist/components/drag-and-drop/drag-handle.js +2 -0
  95. package/dist/components/drag-and-drop/drag-handle.js.map +1 -0
  96. package/dist/components/drag-and-drop/drag-list-item.d.ts +14 -0
  97. package/dist/components/drag-and-drop/drag-list-item.js +2 -0
  98. package/dist/components/drag-and-drop/drag-list-item.js.map +1 -0
  99. package/dist/components/drag-and-drop/drag-list.d.ts +14 -0
  100. package/dist/components/drag-and-drop/drag-list.js +2 -0
  101. package/dist/components/drag-and-drop/drag-list.js.map +1 -0
  102. package/dist/components/drag-and-drop/drag-root.d.ts +6 -0
  103. package/dist/components/drag-and-drop/drag-root.js +2 -0
  104. package/dist/components/drag-and-drop/drag-root.js.map +1 -0
  105. package/dist/components/drag-and-drop/index.d.ts +10 -0
  106. package/dist/components/drag-and-drop/index.js +2 -0
  107. package/dist/components/drag-and-drop/index.js.map +1 -0
  108. package/dist/components/drag-and-drop/types/drag-item.d.ts +9 -0
  109. package/dist/components/drag-and-drop/types/drag-item.js +2 -0
  110. package/dist/components/drag-and-drop/types/drag-item.js.map +1 -0
  111. package/dist/components/dropdown-menu.js +2 -295
  112. package/dist/components/dropdown-menu.js.map +1 -0
  113. package/dist/components/form/button.js +2 -0
  114. package/dist/components/form/button.js.map +1 -0
  115. package/dist/components/form/calendar.js +2 -0
  116. package/dist/components/form/calendar.js.map +1 -0
  117. package/dist/components/form/checkbox.js +2 -0
  118. package/dist/components/form/checkbox.js.map +1 -0
  119. package/dist/components/form/context/field.context.d.ts +15 -0
  120. package/dist/components/form/context/field.context.js +2 -0
  121. package/dist/components/form/context/field.context.js.map +1 -0
  122. package/dist/components/form/date-picker.d.ts +84 -0
  123. package/dist/components/form/date-picker.js +2 -0
  124. package/dist/components/form/date-picker.js.map +1 -0
  125. package/dist/components/form/floating-label.d.ts +6 -0
  126. package/dist/components/form/floating-label.js +2 -0
  127. package/dist/components/form/floating-label.js.map +1 -0
  128. package/dist/components/form/input.d.ts +95 -0
  129. package/dist/components/form/input.js +2 -0
  130. package/dist/components/form/input.js.map +1 -0
  131. package/dist/components/form/otp-input.js +2 -0
  132. package/dist/components/form/otp-input.js.map +1 -0
  133. package/dist/components/form/radio.js +2 -0
  134. package/dist/components/form/radio.js.map +1 -0
  135. package/dist/components/{rich-editor.d.ts → form/rich-editor.d.ts} +2 -1
  136. package/dist/components/form/rich-editor.js +2 -0
  137. package/dist/components/form/rich-editor.js.map +1 -0
  138. package/dist/components/form/search-input.js +2 -0
  139. package/dist/components/form/search-input.js.map +1 -0
  140. package/dist/components/form/select.d.ts +94 -0
  141. package/dist/components/form/select.js +2 -0
  142. package/dist/components/form/select.js.map +1 -0
  143. package/dist/components/form/switch.js +2 -0
  144. package/dist/components/form/switch.js.map +1 -0
  145. package/dist/components/full-calendar/calendar-add-event.d.ts +9 -0
  146. package/dist/components/full-calendar/calendar-add-event.js +2 -0
  147. package/dist/components/full-calendar/calendar-add-event.js.map +1 -0
  148. package/dist/components/full-calendar/calendar-body.d.ts +6 -0
  149. package/dist/components/full-calendar/calendar-body.js +2 -0
  150. package/dist/components/full-calendar/calendar-body.js.map +1 -0
  151. package/dist/components/full-calendar/calendar-cell.d.ts +11 -0
  152. package/dist/components/full-calendar/calendar-cell.js +2 -0
  153. package/dist/components/full-calendar/calendar-cell.js.map +1 -0
  154. package/dist/components/full-calendar/calendar-day-view.d.ts +5 -0
  155. package/dist/components/full-calendar/calendar-day-view.js +2 -0
  156. package/dist/components/full-calendar/calendar-day-view.js.map +1 -0
  157. package/dist/components/full-calendar/calendar-event.d.ts +18 -0
  158. package/dist/components/full-calendar/calendar-event.js +2 -0
  159. package/dist/components/full-calendar/calendar-event.js.map +1 -0
  160. package/dist/components/full-calendar/calendar-header.d.ts +6 -0
  161. package/dist/components/full-calendar/calendar-header.js +2 -0
  162. package/dist/components/full-calendar/calendar-header.js.map +1 -0
  163. package/dist/components/full-calendar/calendar-month-view.d.ts +5 -0
  164. package/dist/components/full-calendar/calendar-month-view.js +2 -0
  165. package/dist/components/full-calendar/calendar-month-view.js.map +1 -0
  166. package/dist/components/full-calendar/calendar-more-events-dropdown.d.ts +9 -0
  167. package/dist/components/full-calendar/calendar-more-events-dropdown.js +2 -0
  168. package/dist/components/full-calendar/calendar-more-events-dropdown.js.map +1 -0
  169. package/dist/components/full-calendar/calendar-navigator.d.ts +5 -0
  170. package/dist/components/full-calendar/calendar-navigator.js +2 -0
  171. package/dist/components/full-calendar/calendar-navigator.js.map +1 -0
  172. package/dist/components/full-calendar/calendar-root.d.ts +30 -0
  173. package/dist/components/full-calendar/calendar-root.js +2 -0
  174. package/dist/components/full-calendar/calendar-root.js.map +1 -0
  175. package/dist/components/full-calendar/calendar-today-button.d.ts +9 -0
  176. package/dist/components/full-calendar/calendar-today-button.js +2 -0
  177. package/dist/components/full-calendar/calendar-today-button.js.map +1 -0
  178. package/dist/components/full-calendar/calendar-toggle-view.d.ts +5 -0
  179. package/dist/components/full-calendar/calendar-toggle-view.js +2 -0
  180. package/dist/components/full-calendar/calendar-toggle-view.js.map +1 -0
  181. package/dist/components/full-calendar/calendar-view-renderer.d.ts +5 -0
  182. package/dist/components/full-calendar/calendar-view-renderer.js +2 -0
  183. package/dist/components/full-calendar/calendar-view-renderer.js.map +1 -0
  184. package/dist/components/full-calendar/calendar-week-day.d.ts +10 -0
  185. package/dist/components/full-calendar/calendar-week-day.js +2 -0
  186. package/dist/components/full-calendar/calendar-week-day.js.map +1 -0
  187. package/dist/components/full-calendar/calendar-week-view.d.ts +5 -0
  188. package/dist/components/full-calendar/calendar-week-view.js +2 -0
  189. package/dist/components/full-calendar/calendar-week-view.js.map +1 -0
  190. package/dist/components/full-calendar/helpers/calendar.d.ts +25 -0
  191. package/dist/components/full-calendar/helpers/calendar.js +2 -0
  192. package/dist/components/full-calendar/helpers/calendar.js.map +1 -0
  193. package/dist/components/full-calendar/index.d.ts +18 -0
  194. package/dist/components/full-calendar/index.js +2 -0
  195. package/dist/components/full-calendar/index.js.map +1 -0
  196. package/dist/components/full-calendar/types/calendar-cell.d.ts +6 -0
  197. package/dist/components/full-calendar/types/calendar-cell.js +2 -0
  198. package/dist/components/full-calendar/types/calendar-cell.js.map +1 -0
  199. package/dist/components/full-calendar/types/calendar-event.d.ts +8 -0
  200. package/dist/components/full-calendar/types/calendar-event.js +2 -0
  201. package/dist/components/full-calendar/types/calendar-event.js.map +1 -0
  202. package/dist/components/full-calendar/types/calendar-view.d.ts +3 -0
  203. package/dist/components/full-calendar/types/calendar-view.js +2 -0
  204. package/dist/components/full-calendar/types/calendar-view.js.map +1 -0
  205. package/dist/components/full-calendar/types/calendar-week-hour.d.ts +6 -0
  206. package/dist/components/full-calendar/types/calendar-week-hour.js +2 -0
  207. package/dist/components/full-calendar/types/calendar-week-hour.js.map +1 -0
  208. package/dist/components/horizontal-scroll.d.ts +11 -0
  209. package/dist/components/horizontal-scroll.js +2 -0
  210. package/dist/components/horizontal-scroll.js.map +1 -0
  211. package/dist/components/icon.d.ts +3 -4
  212. package/dist/components/icon.js +2 -177
  213. package/dist/components/icon.js.map +1 -0
  214. package/dist/components/list.js +2 -179
  215. package/dist/components/list.js.map +1 -0
  216. package/dist/components/logo.js +2 -324
  217. package/dist/components/logo.js.map +1 -0
  218. package/dist/components/selection-bar.d.ts +57 -0
  219. package/dist/components/selection-bar.js +2 -0
  220. package/dist/components/selection-bar.js.map +1 -0
  221. package/dist/components/sheet.d.ts +8 -8
  222. package/dist/components/sheet.js +2 -251
  223. package/dist/components/sheet.js.map +1 -0
  224. package/dist/components/skeleton.js +2 -16
  225. package/dist/components/skeleton.js.map +1 -0
  226. package/dist/components/status.js +2 -111
  227. package/dist/components/status.js.map +1 -0
  228. package/dist/components/table.js +2 -196
  229. package/dist/components/table.js.map +1 -0
  230. package/dist/components/tabs.d.ts +9 -6
  231. package/dist/components/tabs.js +2 -54
  232. package/dist/components/tabs.js.map +1 -0
  233. package/dist/components/tag.d.ts +5 -2
  234. package/dist/components/tag.js +2 -189
  235. package/dist/components/tag.js.map +1 -0
  236. package/dist/components/tooltip.js +2 -58
  237. package/dist/components/tooltip.js.map +1 -0
  238. package/dist/components/typography.js +2 -78
  239. package/dist/components/typography.js.map +1 -0
  240. package/dist/components/upload.d.ts +74 -0
  241. package/dist/components/upload.js +2 -0
  242. package/dist/components/upload.js.map +1 -0
  243. package/dist/hooks/index.d.ts +7 -0
  244. package/dist/hooks/index.js +2 -0
  245. package/dist/hooks/index.js.map +1 -0
  246. package/dist/icons-CmDuL0gZ.d.ts +4 -0
  247. package/dist/index.css +2 -2322
  248. package/dist/index.css.map +1 -0
  249. package/dist/logo-PQRZORCS.js +3 -0
  250. package/dist/logo-PQRZORCS.js.map +1 -0
  251. package/package.json +60 -18
  252. package/src/components/breadcrumb.tsx +119 -0
  253. package/src/components/chip.tsx +11 -3
  254. package/src/components/dialog.tsx +242 -0
  255. package/src/components/drag-and-drop/drag-handle.tsx +46 -0
  256. package/src/components/drag-and-drop/drag-list-item.tsx +91 -0
  257. package/src/components/drag-and-drop/drag-list.tsx +47 -0
  258. package/src/components/drag-and-drop/drag-root.tsx +30 -0
  259. package/src/components/drag-and-drop/index.ts +39 -0
  260. package/src/components/drag-and-drop/types/drag-item.ts +7 -0
  261. package/src/components/{calendar.tsx → form/calendar.tsx} +9 -8
  262. package/src/components/{checkbox.tsx → form/checkbox.tsx} +2 -2
  263. package/src/components/form/context/field.context.ts +27 -0
  264. package/src/components/form/date-picker.tsx +199 -0
  265. package/src/components/form/floating-label.tsx +60 -0
  266. package/src/components/form/input.tsx +235 -0
  267. package/src/components/{radio.tsx → form/radio.tsx} +1 -1
  268. package/src/components/{rich-editor.tsx → form/rich-editor.tsx} +10 -9
  269. package/src/components/{search-input.tsx → form/search-input.tsx} +2 -2
  270. package/src/components/form/select.tsx +274 -0
  271. package/src/components/full-calendar/calendar-add-event.tsx +15 -0
  272. package/src/components/full-calendar/calendar-body.tsx +12 -0
  273. package/src/components/full-calendar/calendar-cell.tsx +120 -0
  274. package/src/components/full-calendar/calendar-day-view.tsx +76 -0
  275. package/src/components/full-calendar/calendar-event.tsx +178 -0
  276. package/src/components/full-calendar/calendar-header.tsx +14 -0
  277. package/src/components/full-calendar/calendar-month-view.tsx +69 -0
  278. package/src/components/full-calendar/calendar-more-events-dropdown.tsx +39 -0
  279. package/src/components/full-calendar/calendar-navigator.tsx +86 -0
  280. package/src/components/full-calendar/calendar-root.tsx +165 -0
  281. package/src/components/full-calendar/calendar-today-button.tsx +21 -0
  282. package/src/components/full-calendar/calendar-toggle-view.tsx +61 -0
  283. package/src/components/full-calendar/calendar-view-renderer.tsx +19 -0
  284. package/src/components/full-calendar/calendar-week-day.tsx +49 -0
  285. package/src/components/full-calendar/calendar-week-view.tsx +88 -0
  286. package/src/components/full-calendar/helpers/calendar.ts +158 -0
  287. package/src/components/full-calendar/index.ts +16 -0
  288. package/src/components/full-calendar/types/calendar-cell.ts +4 -0
  289. package/src/components/full-calendar/types/calendar-event.ts +7 -0
  290. package/src/components/full-calendar/types/calendar-view.ts +1 -0
  291. package/src/components/full-calendar/types/calendar-week-hour.ts +4 -0
  292. package/src/components/horizontal-scroll.tsx +159 -0
  293. package/src/components/icon.tsx +1 -1
  294. package/src/components/logo.tsx +25 -20
  295. package/src/components/selection-bar.tsx +273 -0
  296. package/src/components/sheet.tsx +2 -2
  297. package/src/components/tabs.tsx +56 -37
  298. package/src/components/tag.tsx +11 -3
  299. package/src/components/upload.tsx +647 -0
  300. package/src/index.css +2 -2
  301. package/src/resources/icons.ts +4 -1
  302. package/src/resources/logo/index.tsx +33 -0
  303. package/tsup.config.ts +23 -5
  304. package/dist/components/button.js +0 -98
  305. package/dist/components/calendar.js +0 -751
  306. package/dist/components/checkbox.js +0 -153
  307. package/dist/components/date-picker.d.ts +0 -20
  308. package/dist/components/date-picker.js +0 -232
  309. package/dist/components/input.d.ts +0 -32
  310. package/dist/components/input.js +0 -315
  311. package/dist/components/otp-input.js +0 -47
  312. package/dist/components/radio.js +0 -156
  313. package/dist/components/rich-editor.js +0 -723
  314. package/dist/components/search-input.js +0 -274
  315. package/dist/components/select.d.ts +0 -33
  316. package/dist/components/select.js +0 -550
  317. package/dist/components/switch.js +0 -36
  318. package/dist/components/test.d.ts +0 -5
  319. package/dist/components/test.js +0 -8
  320. package/dist/index.js +0 -0
  321. package/src/components/date-picker.tsx +0 -160
  322. package/src/components/input.tsx +0 -256
  323. package/src/components/select.tsx +0 -240
  324. package/src/components/test.tsx +0 -3
  325. package/src/index.ts +0 -1
  326. package/src/resources/logo/index.ts +0 -3
  327. /package/dist/components/{button.d.ts → form/button.d.ts} +0 -0
  328. /package/dist/components/{calendar.d.ts → form/calendar.d.ts} +0 -0
  329. /package/dist/components/{checkbox.d.ts → form/checkbox.d.ts} +0 -0
  330. /package/dist/components/{otp-input.d.ts → form/otp-input.d.ts} +0 -0
  331. /package/dist/components/{radio.d.ts → form/radio.d.ts} +0 -0
  332. /package/dist/components/{search-input.d.ts → form/search-input.d.ts} +0 -0
  333. /package/dist/components/{switch.d.ts → form/switch.d.ts} +0 -0
  334. /package/src/components/{button.tsx → form/button.tsx} +0 -0
  335. /package/src/components/{otp-input.tsx → form/otp-input.tsx} +0 -0
  336. /package/src/components/{switch.tsx → form/switch.tsx} +0 -0
@@ -1,54 +1,2 @@
1
- // src/components/tabs.tsx
2
- import * as TabsPrimitive from "@radix-ui/react-tabs";
3
- import { cva, cx } from "@xjur-ui/util";
4
- import { jsx } from "react/jsx-runtime";
5
- function TabsRoot({
6
- ...props
7
- }) {
8
- return /* @__PURE__ */ jsx(TabsPrimitive.Tabs, { ...props });
9
- }
10
- function TabsList2({
11
- ...props
12
- }) {
13
- return /* @__PURE__ */ jsx(TabsPrimitive.TabsList, { ...props });
14
- }
15
- function TabsTrigger2({
16
- variant,
17
- className,
18
- ...props
19
- }) {
20
- const variants = cva(
21
- [
22
- "rounded-small-1x h-large-4x cursor-pointer text-size-label-md text-neutral-dark"
23
- ],
24
- {
25
- variants: {
26
- variant: {
27
- line: "py-small_1x-alt px-small data-[state=active]:border-b-[3px] data-[state=active]:border-b-primary-active data-[state=active]:rounded-none hover:bg-layer-2-hover",
28
- button: "rounded-br-none rounded-bl-none py-small_1x-alt px-large bg-primary-idle text-neutral-label hover:bg-primary-hover data-[state=active]:bg-layer-2-idle data-[state=active]:text-primary-label-active"
29
- }
30
- },
31
- defaultVariants: {
32
- variant: "button"
33
- }
34
- }
35
- );
36
- return /* @__PURE__ */ jsx(
37
- TabsPrimitive.TabsTrigger,
38
- {
39
- className: cx(className, variants({ variant })),
40
- ...props
41
- }
42
- );
43
- }
44
- function TabsContent2({
45
- ...props
46
- }) {
47
- return /* @__PURE__ */ jsx(TabsPrimitive.TabsContent, { ...props });
48
- }
49
- export {
50
- TabsContent2 as TabsContent,
51
- TabsList2 as TabsList,
52
- TabsRoot,
53
- TabsTrigger2 as TabsTrigger
54
- };
1
+ import'react';import*as t from'@radix-ui/react-tabs';import {tv}from'@xjur-ui/util';import {jsx}from'react/jsx-runtime';var s=tv({slots:{list:"flex items-center gap-0",trigger:"inline-flex items-center justify-center gap-small px-small py-small_1x-alt h-large-4x font-medium cursor-pointer transition-colors !text-size-label-md disabled:opacity-38 disabled:pointer-events-none",content:""},variants:{variant:{line:{trigger:"rounded-small-1x text-neutral-dark border-b-[3px] border-b-transparent hover:bg-layer-2-hover data-[state=active]:text-primary-active data-[state=active]:border-b-primary-active data-[state=active]:rounded-none data-[state=active]:bg-transparent"},button:{trigger:"rounded-tl-small-1x rounded-tr-small-1x rounded-bl-none rounded-br-none px-large bg-primary-idle text-neutral-label hover:bg-primary-hover data-[state=active]:bg-layer-2-idle data-[state=active]:text-primary-active"}}},defaultVariants:{variant:"button"}});function p(e){return jsx(t.Tabs,{...e})}function m({className:e,...a}){let{list:i}=s({});return jsx(t.TabsList,{className:i({className:e}),...a})}function c({variant:e,className:a,...i}){let{trigger:n}=s({variant:e});return jsx(t.TabsTrigger,{className:n({className:a}),...i})}function d(e){let{content:a}=s();return jsx(t.TabsContent,{className:a(),...e})}export{d as TabsContent,m as TabsList,p as TabsRoot,c as TabsTrigger};//# sourceMappingURL=tabs.js.map
2
+ //# sourceMappingURL=tabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/tabs.tsx"],"names":["tabsStyles","tv","TabsRoot","props","jsx","TabsList","className","list","TabsTrigger","variant","trigger","TabsContent","content"],"mappings":"wHAIA,IAAMA,CAAAA,CAAaC,EAAAA,CAAG,CACpB,KAAA,CAAO,CACL,IAAA,CAAM,yBAAA,CACN,OAAA,CACE,yMAAA,CAGF,OAAA,CAAS,EACX,EACA,QAAA,CAAU,CACR,OAAA,CAAS,CACP,KAAM,CACJ,OAAA,CACE,uPAKJ,CAAA,CACA,OAAQ,CACN,OAAA,CACE,wNAIJ,CACF,CACF,CAAA,CACA,eAAA,CAAiB,CACf,QAAS,QACX,CACF,CAAC,CAAA,CAEM,SAASC,CAAAA,CACdC,CAAAA,CACA,CACA,OAAOC,IAAe,CAAA,CAAA,IAAA,CAAd,CAAoB,GAAGD,CAAAA,CAAO,CACxC,CAIO,SAASE,CAAAA,CAAS,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGH,CAAM,EAAkB,CAC/D,GAAM,CAAE,IAAA,CAAAI,CAAK,CAAA,CAAIP,CAAAA,CAAW,EAAE,CAAA,CAC9B,OAAOI,GAAAA,CAAe,CAAA,CAAA,QAAA,CAAd,CAAuB,SAAA,CAAWG,CAAAA,CAAK,CAAE,SAAA,CAAAD,CAAU,CAAC,CAAA,CAAI,GAAGH,CAAAA,CAAO,CAC5E,CAOO,SAASK,CAAAA,CAAY,CAC1B,OAAA,CAAAC,CAAAA,CACA,SAAA,CAAAH,CAAAA,CACA,GAAGH,CACL,CAAA,CAAqB,CACnB,GAAM,CAAE,OAAA,CAAAO,CAAQ,CAAA,CAAIV,CAAAA,CAAW,CAAE,OAAA,CAAAS,CAAQ,CAAC,CAAA,CAC1C,OACEL,GAAAA,CAAe,CAAA,CAAA,WAAA,CAAd,CAA0B,UAAWM,CAAAA,CAAQ,CAAE,SAAA,CAAAJ,CAAU,CAAC,CAAA,CAAI,GAAGH,CAAAA,CAAO,CAE7E,CAEO,SAASQ,CAAAA,CACdR,CAAAA,CACA,CACA,GAAM,CAAE,OAAA,CAAAS,CAAQ,CAAA,CAAIZ,GAAW,CAC/B,OAAOI,GAAAA,CAAe,CAAA,CAAA,WAAA,CAAd,CAA0B,SAAA,CAAWQ,CAAAA,EAAQ,CAAI,GAAGT,EAAO,CACrE","file":"tabs.js","sourcesContent":["import * as React from 'react'\nimport * as TabsPrimitive from '@radix-ui/react-tabs'\nimport { tv } from '@xjur-ui/util'\n\nconst tabsStyles = tv({\n slots: {\n list: 'flex items-center gap-0',\n trigger:\n 'inline-flex items-center justify-center gap-small px-small py-small_1x-alt h-large-4x ' +\n 'font-medium cursor-pointer transition-colors !text-size-label-md ' +\n 'disabled:opacity-38 disabled:pointer-events-none',\n content: ''\n },\n variants: {\n variant: {\n line: {\n trigger:\n 'rounded-small-1x text-neutral-dark border-b-[3px] border-b-transparent ' +\n 'hover:bg-layer-2-hover ' +\n 'data-[state=active]:text-primary-active ' +\n 'data-[state=active]:border-b-primary-active ' +\n 'data-[state=active]:rounded-none data-[state=active]:bg-transparent'\n },\n button: {\n trigger:\n 'rounded-tl-small-1x rounded-tr-small-1x rounded-bl-none rounded-br-none px-large ' +\n 'bg-primary-idle text-neutral-label ' +\n 'hover:bg-primary-hover ' +\n 'data-[state=active]:bg-layer-2-idle data-[state=active]:text-primary-active'\n }\n }\n },\n defaultVariants: {\n variant: 'button'\n }\n})\n\nexport function TabsRoot(\n props: React.ComponentProps<typeof TabsPrimitive.Tabs>\n) {\n return <TabsPrimitive.Tabs {...props} />\n}\n\nexport type TabsListProps = React.ComponentProps<typeof TabsPrimitive.TabsList>\n\nexport function TabsList({ className, ...props }: TabsListProps) {\n const { list } = tabsStyles({})\n return <TabsPrimitive.TabsList className={list({ className })} {...props} />\n}\n\nexport interface TabsTriggerProps\n extends React.ComponentProps<typeof TabsPrimitive.TabsTrigger> {\n variant?: 'line' | 'button'\n}\n\nexport function TabsTrigger({\n variant,\n className,\n ...props\n}: TabsTriggerProps) {\n const { trigger } = tabsStyles({ variant })\n return (\n <TabsPrimitive.TabsTrigger className={trigger({ className })} {...props} />\n )\n}\n\nexport function TabsContent(\n props: React.ComponentProps<typeof TabsPrimitive.TabsContent>\n) {\n const { content } = tabsStyles()\n return <TabsPrimitive.TabsContent className={content()} {...props} />\n}\n"]}
@@ -3,12 +3,15 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
3
3
  import { ClassVariantProps } from '@xjur-ui/util';
4
4
  import { ComponentProps } from 'react';
5
5
  import { Typography } from './typography.js';
6
- import { Icon, IconType } from './icon.js';
6
+ import { Icon } from './icon.js';
7
+ import { I as IconType } from '../icons-CmDuL0gZ.js';
7
8
 
8
9
  declare const tagVariants: (props?: ({
9
10
  variant?: "primary" | "neutral" | "danger" | null | undefined;
10
11
  } & class_variance_authority_types.ClassProp) | undefined) => string;
11
- declare function TagRoot({ className, variant, ...props }: ComponentProps<'div'> & ClassVariantProps<typeof tagVariants>): react_jsx_runtime.JSX.Element;
12
+ declare function TagRoot({ className, variant, disabled, ...props }: ComponentProps<'div'> & ClassVariantProps<typeof tagVariants> & {
13
+ disabled?: boolean;
14
+ }): react_jsx_runtime.JSX.Element;
12
15
  declare function TagText({ variant, size, weight, className, ...props }: ComponentProps<typeof Typography>): react_jsx_runtime.JSX.Element;
13
16
  declare function TagIcon({ className, ...props }: ComponentProps<typeof Icon>): react_jsx_runtime.JSX.Element;
14
17
  declare function TagClose({ className, children, ...props }: ComponentProps<'button'> & {
@@ -1,189 +1,2 @@
1
- // src/components/tag.tsx
2
- import { cva as cva2, cx as cx2 } from "@xjur-ui/util";
3
- import "react";
4
-
5
- // src/components/typography.tsx
6
- import { Slot } from "@radix-ui/react-slot";
7
- import { cva } from "@xjur-ui/util";
8
- import { memo } from "react";
9
- import { jsx } from "react/jsx-runtime";
10
- var typographyVariants = cva("", {
11
- variants: {
12
- variant: {
13
- body: "",
14
- label: "",
15
- title: "",
16
- headline: ""
17
- },
18
- size: {
19
- "sm-2x": "",
20
- "sm-1x": "",
21
- sm: "",
22
- md: "",
23
- lg: ""
24
- },
25
- weight: {
26
- thin: "font-thin",
27
- extraLight: "font-extralight",
28
- light: "font-light",
29
- normal: "font-normal",
30
- medium: "font-medium",
31
- semibold: "font-semibold",
32
- bold: "font-bold",
33
- extraBold: "font-extrabold",
34
- black: "font-black"
35
- }
36
- },
37
- compoundVariants: [
38
- { variant: "body", size: "sm-1x", class: "text-size-body-sm-1x" },
39
- { variant: "body", size: "sm", class: "text-size-body-sm" },
40
- { variant: "body", size: "md", class: "text-size-body-md" },
41
- { variant: "body", size: "lg", class: "text-size-body-lg" },
42
- { variant: "label", size: "sm-2x", class: "text-size-label-sm-2x" },
43
- { variant: "label", size: "sm-1x", class: "text-size-label-sm-1x" },
44
- { variant: "label", size: "sm", class: "text-size-label-sm" },
45
- { variant: "label", size: "md", class: "text-size-label-md" },
46
- { variant: "label", size: "lg", class: "text-size-label-lg" },
47
- { variant: "title", size: "sm", class: "text-size-title-sm" },
48
- { variant: "title", size: "md", class: "text-size-title-md" },
49
- { variant: "title", size: "lg", class: "text-size-title-lg" },
50
- { variant: "headline", size: "sm", class: "text-size-headline-sm" },
51
- { variant: "headline", size: "md", class: "text-size-headline-md" },
52
- { variant: "headline", size: "lg", class: "text-size-headline-lg" }
53
- ],
54
- defaultVariants: {
55
- variant: "body",
56
- size: "md",
57
- weight: "normal"
58
- }
59
- });
60
- var Typography = memo(
61
- ({
62
- variant,
63
- size,
64
- weight,
65
- asChild,
66
- className,
67
- ...props
68
- }) => {
69
- const Component = asChild ? Slot : "span";
70
- return /* @__PURE__ */ jsx(
71
- Component,
72
- {
73
- className: typographyVariants({ variant, size, weight, className }),
74
- ...props
75
- }
76
- );
77
- }
78
- );
79
- Typography.displayName = "Typography";
80
-
81
- // src/components/icon.tsx
82
- import { cx } from "@xjur-ui/util";
83
- import { jsx as jsx2 } from "react/jsx-runtime";
84
- function Icon({ className, filled = false, name, ...props }) {
85
- return /* @__PURE__ */ jsx2(
86
- "span",
87
- {
88
- ...props,
89
- className: cx(
90
- "material-symbols-outlined",
91
- "text-size-body-lg",
92
- className
93
- ),
94
- style: {
95
- fontVariationSettings: `'FILL' ${filled ? 1 : 0}, 'wght' 600, 'GRAD' 0, 'opsz' 20`,
96
- ...props.style
97
- },
98
- children: name
99
- }
100
- );
101
- }
102
-
103
- // src/components/tag.tsx
104
- import { jsx as jsx3 } from "react/jsx-runtime";
105
- var tagVariants = cva2(
106
- [
107
- "group/tag relative h-large-2x w-fit rounded-small-1x px-small py-none flex items-center gap-small_1x-alt",
108
- "transition-all duration-200"
109
- ],
110
- {
111
- variants: {
112
- variant: {
113
- primary: "bg-primary-alt-idle text-primary-label-idle hover:bg-primary-alt-hover",
114
- danger: "bg-danger-alt-idle text-danger-label-idle hover:bg-danger-alt-hover",
115
- neutral: "bg-layer-1-idle text-neutral-dark hover:bg-layer-1-hover"
116
- }
117
- },
118
- defaultVariants: {
119
- variant: "primary"
120
- }
121
- }
122
- );
123
- function TagRoot({
124
- className,
125
- variant = "primary",
126
- ...props
127
- }) {
128
- return /* @__PURE__ */ jsx3("div", { className: cx2(tagVariants({ variant }), className), ...props });
129
- }
130
- function TagText({
131
- variant = "label",
132
- size = "sm-1x",
133
- weight = "medium",
134
- className,
135
- ...props
136
- }) {
137
- return /* @__PURE__ */ jsx3(
138
- Typography,
139
- {
140
- className: cx2(className, "truncate"),
141
- size,
142
- variant,
143
- weight,
144
- ...props
145
- }
146
- );
147
- }
148
- function TagIcon({ className, ...props }) {
149
- return /* @__PURE__ */ jsx3(
150
- Icon,
151
- {
152
- className: (cx2(
153
- "text-size-body-md",
154
- "group-data-[variant=primary]:text-primary-label-idle",
155
- "group-data-[variant=danger]:text-danger-label-idle",
156
- "group-data-[variant=neutral]:text-icon-neutral-3"
157
- ), className),
158
- ...props
159
- }
160
- );
161
- }
162
- function TagClose({
163
- className,
164
- children = /* @__PURE__ */ jsx3(TagIcon, { name: "close" }),
165
- ...props
166
- }) {
167
- return /* @__PURE__ */ jsx3(
168
- "button",
169
- {
170
- className: cx2(
171
- className,
172
- "cursor-pointer bg-inherit",
173
- "invisible items-center justify-center group-hover/tag:visible",
174
- "absolute top-0 right-0",
175
- "h-large-2x w-large-2x rounded-circle",
176
- "transition-[visibility] duration-200"
177
- ),
178
- type: "button",
179
- ...props,
180
- children
181
- }
182
- );
183
- }
184
- export {
185
- TagClose,
186
- TagIcon,
187
- TagRoot,
188
- TagText
189
- };
1
+ import {b}from'../chunk-WV7QV2PU.js';import {a}from'../chunk-EIG6CBTQ.js';import {cva,cx}from'@xjur-ui/util';import'react';import {jsx}from'react/jsx-runtime';var d=cva(["group/tag relative h-large-2x w-fit rounded-small-1x px-small py-none flex items-center gap-small_1x-alt","transition-all duration-200"],{variants:{variant:{primary:"bg-primary-alt-idle text-primary-label-idle hover:bg-primary-alt-hover",danger:"bg-danger-alt-idle text-danger-label-idle hover:bg-danger-alt-hover",neutral:"bg-layer-1-idle text-neutral-dark hover:bg-layer-1-hover"}},defaultVariants:{variant:"primary"}});function c({className:a,variant:t="primary",disabled:e=false,...n}){return jsx("div",{className:cx(d({variant:t}),a),"data-disabled":e,...n})}function v({variant:a$1="label",size:t="sm-1x",weight:e="medium",className:n,...p}){return jsx(a,{className:cx(n,"truncate"),size:t,variant:a$1,weight:e,...p})}function m({className:a,...t}){return jsx(b,{className:(cx("text-size-body-md","group-data-[variant=primary]:text-primary-label-idle","group-data-[variant=danger]:text-danger-label-idle","group-data-[variant=neutral]:text-icon-neutral-3"),a),...t})}function x({className:a,children:t=jsx(m,{name:"close"}),...e}){return jsx("button",{className:cx(a,"cursor-pointer bg-inherit","invisible items-center justify-center group-hover/tag:data-[disabled=false]:visible","absolute top-0 right-0","h-large-2x w-large-2x rounded-circle","transition-[visibility] duration-200"),type:"button",...e,children:t})}export{x as TagClose,m as TagIcon,c as TagRoot,v as TagText};//# sourceMappingURL=tag.js.map
2
+ //# sourceMappingURL=tag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/tag.tsx"],"names":["tagVariants","cva","TagRoot","className","variant","disabled","props","jsx","cx","TagText","size","weight","Typography","TagIcon","Icon","TagClose","children"],"mappings":"+JAKA,IAAMA,CAAAA,CAAcC,GAAAA,CAClB,CACE,0GAAA,CACA,6BACF,EACA,CACE,QAAA,CAAU,CACR,OAAA,CAAS,CACP,OAAA,CACE,wEAAA,CACF,OACE,qEAAA,CACF,OAAA,CAAS,0DACX,CACF,CAAA,CACA,eAAA,CAAiB,CACf,QAAS,SACX,CACF,CACF,CAAA,CAEO,SAASC,EAAQ,CACtB,SAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,EAAU,SAAA,CACV,QAAA,CAAAC,CAAAA,CAAW,KAAA,CACX,GAAGC,CACL,CAAA,CACkE,CAChE,OACEC,IAAC,KAAA,CAAA,CACC,SAAA,CAAWC,GAAGR,CAAAA,CAAY,CAAE,QAAAI,CAAQ,CAAC,CAAA,CAAGD,CAAS,EACjD,eAAA,CAAeE,CAAAA,CACd,GAAGC,CAAAA,CACN,CAEJ,CAEO,SAASG,CAAAA,CAAQ,CACtB,OAAA,CAAAL,IAAU,OAAA,CACV,IAAA,CAAAM,EAAO,OAAA,CACP,MAAA,CAAAC,EAAS,QAAA,CACT,SAAA,CAAAR,CAAAA,CACA,GAAGG,CACL,CAAA,CAAsC,CACpC,OACEC,GAAAA,CAACK,EAAA,CACC,SAAA,CAAWJ,EAAAA,CAAGL,CAAAA,CAAW,UAAU,CAAA,CACnC,IAAA,CAAMO,EACN,OAAA,CAASN,GAAAA,CACT,OAAQO,CAAAA,CACP,GAAGL,CAAAA,CACN,CAEJ,CAEO,SAASO,CAAAA,CAAQ,CAAE,SAAA,CAAAV,CAAAA,CAAW,GAAGG,CAAM,CAAA,CAAgC,CAC5E,OACEC,IAACO,CAAAA,CAAA,CACC,WACGN,EAAAA,CACC,mBAAA,CACA,uDACA,oDAAA,CACA,kDACF,CAAA,CACAL,CAAAA,CAAAA,CAED,GAAGG,CAAAA,CACN,CAEJ,CAEO,SAASS,EAAS,CACvB,SAAA,CAAAZ,CAAAA,CACA,QAAA,CAAAa,EAAWT,GAAAA,CAACM,CAAAA,CAAA,CAAQ,IAAA,CAAK,OAAA,CAAQ,EACjC,GAAGP,CACL,CAAA,CAAmD,CACjD,OACEC,GAAAA,CAAC,QAAA,CAAA,CACC,UAAWC,EAAAA,CACTL,CAAAA,CACA,4BACA,qFAAA,CACA,wBAAA,CACA,sCAAA,CACA,sCACF,EACA,IAAA,CAAK,QAAA,CACJ,GAAGG,CAAAA,CAEH,QAAA,CAAAU,EACH,CAEJ","file":"tag.js","sourcesContent":["import { cva, cx, type ClassVariantProps } from '@xjur-ui/util'\nimport { type ComponentProps } from 'react'\nimport { Typography } from './typography'\nimport { Icon, type IconType } from './icon'\n\nconst tagVariants = cva(\n [\n 'group/tag relative h-large-2x w-fit rounded-small-1x px-small py-none flex items-center gap-small_1x-alt',\n 'transition-all duration-200'\n ],\n {\n variants: {\n variant: {\n primary:\n 'bg-primary-alt-idle text-primary-label-idle hover:bg-primary-alt-hover',\n danger:\n 'bg-danger-alt-idle text-danger-label-idle hover:bg-danger-alt-hover',\n neutral: 'bg-layer-1-idle text-neutral-dark hover:bg-layer-1-hover'\n }\n },\n defaultVariants: {\n variant: 'primary'\n }\n }\n)\n\nexport function TagRoot({\n className,\n variant = 'primary',\n disabled = false,\n ...props\n}: ComponentProps<'div'> &\n ClassVariantProps<typeof tagVariants> & { disabled?: boolean }) {\n return (\n <div\n className={cx(tagVariants({ variant }), className)}\n data-disabled={disabled}\n {...props}\n />\n )\n}\n\nexport function TagText({\n variant = 'label',\n size = 'sm-1x',\n weight = 'medium',\n className,\n ...props\n}: ComponentProps<typeof Typography>) {\n return (\n <Typography\n className={cx(className, 'truncate')}\n size={size}\n variant={variant}\n weight={weight}\n {...props}\n />\n )\n}\n\nexport function TagIcon({ className, ...props }: ComponentProps<typeof Icon>) {\n return (\n <Icon\n className={\n (cx(\n 'text-size-body-md',\n 'group-data-[variant=primary]:text-primary-label-idle',\n 'group-data-[variant=danger]:text-danger-label-idle',\n 'group-data-[variant=neutral]:text-icon-neutral-3'\n ),\n className)\n }\n {...props}\n />\n )\n}\n\nexport function TagClose({\n className,\n children = <TagIcon name=\"close\" />,\n ...props\n}: ComponentProps<'button'> & { name?: IconType }) {\n return (\n <button\n className={cx(\n className,\n 'cursor-pointer bg-inherit',\n 'invisible items-center justify-center group-hover/tag:data-[disabled=false]:visible',\n 'absolute top-0 right-0',\n 'h-large-2x w-large-2x rounded-circle',\n 'transition-[visibility] duration-200'\n )}\n type=\"button\"\n {...props}\n >\n {children}\n </button>\n )\n}\n"]}
@@ -1,58 +1,2 @@
1
- // src/components/tooltip.tsx
2
- import * as TooltipPrimitive from "@radix-ui/react-tooltip";
3
- import { cx } from "@xjur-ui/util";
4
- import { jsx } from "react/jsx-runtime";
5
- function TooltipProvider({
6
- delayDuration = 0,
7
- ...props
8
- }) {
9
- return /* @__PURE__ */ jsx(
10
- TooltipPrimitive.Provider,
11
- {
12
- "data-slot": "tooltip-provider",
13
- delayDuration,
14
- ...props
15
- }
16
- );
17
- }
18
- function Tooltip({
19
- ...props
20
- }) {
21
- return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props }) });
22
- }
23
- function TooltipTrigger({
24
- ...props
25
- }) {
26
- return /* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
27
- }
28
- function TooltipContent({
29
- className,
30
- sideOffset = 1,
31
- variant = "simple",
32
- children,
33
- ...props
34
- }) {
35
- return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx(
36
- TooltipPrimitive.Content,
37
- {
38
- className: cx(
39
- "text-size-body-sm text-balance",
40
- "data-[variant=simple]:bg-alt-2 data-[variant=simple]:text-neutral-label data-[variant=simple]:rounded-small-1x data-[variant=simple]:px-small data-[variant=simple]:py-small-1x",
41
- "data-[variant=rich]:bg-layer-2-idle data-[variant=rich]:text-neutral-dark data-[variant=rich]:rounded-small data-[variant=rich]:border-border-layer-2 data-[variant=rich]:p-large data-[variant=rich]:border",
42
- "animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 w-fit origin-(--radix-tooltip-content-transform-origin)",
43
- className
44
- ),
45
- "data-slot": "tooltip-content",
46
- "data-variant": variant,
47
- sideOffset,
48
- ...props,
49
- children
50
- }
51
- ) });
52
- }
53
- export {
54
- Tooltip,
55
- TooltipContent,
56
- TooltipProvider,
57
- TooltipTrigger
58
- };
1
+ export{b as Tooltip,d as TooltipContent,a as TooltipProvider,c as TooltipTrigger}from'../chunk-NELCN6E2.js';//# sourceMappingURL=tooltip.js.map
2
+ //# sourceMappingURL=tooltip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"tooltip.js"}
@@ -1,78 +1,2 @@
1
- // src/components/typography.tsx
2
- import { Slot } from "@radix-ui/react-slot";
3
- import { cva } from "@xjur-ui/util";
4
- import { memo } from "react";
5
- import { jsx } from "react/jsx-runtime";
6
- var typographyVariants = cva("", {
7
- variants: {
8
- variant: {
9
- body: "",
10
- label: "",
11
- title: "",
12
- headline: ""
13
- },
14
- size: {
15
- "sm-2x": "",
16
- "sm-1x": "",
17
- sm: "",
18
- md: "",
19
- lg: ""
20
- },
21
- weight: {
22
- thin: "font-thin",
23
- extraLight: "font-extralight",
24
- light: "font-light",
25
- normal: "font-normal",
26
- medium: "font-medium",
27
- semibold: "font-semibold",
28
- bold: "font-bold",
29
- extraBold: "font-extrabold",
30
- black: "font-black"
31
- }
32
- },
33
- compoundVariants: [
34
- { variant: "body", size: "sm-1x", class: "text-size-body-sm-1x" },
35
- { variant: "body", size: "sm", class: "text-size-body-sm" },
36
- { variant: "body", size: "md", class: "text-size-body-md" },
37
- { variant: "body", size: "lg", class: "text-size-body-lg" },
38
- { variant: "label", size: "sm-2x", class: "text-size-label-sm-2x" },
39
- { variant: "label", size: "sm-1x", class: "text-size-label-sm-1x" },
40
- { variant: "label", size: "sm", class: "text-size-label-sm" },
41
- { variant: "label", size: "md", class: "text-size-label-md" },
42
- { variant: "label", size: "lg", class: "text-size-label-lg" },
43
- { variant: "title", size: "sm", class: "text-size-title-sm" },
44
- { variant: "title", size: "md", class: "text-size-title-md" },
45
- { variant: "title", size: "lg", class: "text-size-title-lg" },
46
- { variant: "headline", size: "sm", class: "text-size-headline-sm" },
47
- { variant: "headline", size: "md", class: "text-size-headline-md" },
48
- { variant: "headline", size: "lg", class: "text-size-headline-lg" }
49
- ],
50
- defaultVariants: {
51
- variant: "body",
52
- size: "md",
53
- weight: "normal"
54
- }
55
- });
56
- var Typography = memo(
57
- ({
58
- variant,
59
- size,
60
- weight,
61
- asChild,
62
- className,
63
- ...props
64
- }) => {
65
- const Component = asChild ? Slot : "span";
66
- return /* @__PURE__ */ jsx(
67
- Component,
68
- {
69
- className: typographyVariants({ variant, size, weight, className }),
70
- ...props
71
- }
72
- );
73
- }
74
- );
75
- Typography.displayName = "Typography";
76
- export {
77
- Typography
78
- };
1
+ export{a as Typography}from'../chunk-EIG6CBTQ.js';//# sourceMappingURL=typography.js.map
2
+ //# sourceMappingURL=typography.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"typography.js"}
@@ -0,0 +1,74 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { ComponentProps } from 'react';
4
+ import { ClassVariantProps } from '@xjur-ui/util';
5
+
6
+ interface FileFormat {
7
+ name: string;
8
+ type: string;
9
+ fileBinary: File;
10
+ restrict?: boolean;
11
+ description?: string;
12
+ fileType?: string;
13
+ }
14
+ interface FileTypeOption {
15
+ value: string;
16
+ label: string;
17
+ }
18
+ interface UploadRootProps extends ComponentProps<'div'> {
19
+ files: FileFormat[];
20
+ onFilesChange?: (files: FileFormat[]) => void;
21
+ accept?: string;
22
+ multiple?: boolean;
23
+ disabled?: boolean;
24
+ maxFiles?: number;
25
+ maxSize?: number;
26
+ acceptedFormats?: string[];
27
+ }
28
+ declare function UploadRoot({ children, className, files, onFilesChange, accept, multiple, disabled, maxFiles, maxSize, acceptedFormats, ...props }: UploadRootProps): react_jsx_runtime.JSX.Element;
29
+ declare const uploadAreaVariants: (props?: ({
30
+ size?: "small" | "medium" | "large" | "oneLine" | null | undefined;
31
+ showButton?: boolean | null | undefined;
32
+ variant?: "default" | "transparent" | "minimal" | "oneLineWhite" | "oneLineTransparent" | null | undefined;
33
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
34
+ interface UploadAreaProps extends Omit<ComponentProps<'div'>, 'onChange'>, ClassVariantProps<typeof uploadAreaVariants> {
35
+ showAcceptedFormats?: boolean;
36
+ buttonText?: string;
37
+ description?: string;
38
+ icon?: string;
39
+ showButton?: boolean;
40
+ }
41
+ declare function UploadArea({ className, size, showButton, variant, showAcceptedFormats, buttonText, description, icon, ...props }: UploadAreaProps): react_jsx_runtime.JSX.Element;
42
+ declare function UploadTitle({ children, className, ...props }: ComponentProps<'h3'>): react_jsx_runtime.JSX.Element;
43
+ interface UploadAreaContentProps extends ComponentProps<'div'> {
44
+ description?: string;
45
+ icon?: string;
46
+ showAcceptedFormats?: boolean;
47
+ buttonText?: string;
48
+ showButton?: boolean;
49
+ onButtonClick?: () => void;
50
+ variant?: 'default' | 'transparent' | 'minimal' | 'oneLineWhite' | 'oneLineTransparent';
51
+ }
52
+ declare function UploadAreaContent({ description, icon, showAcceptedFormats, buttonText, showButton, onButtonClick, variant, className, ...props }: UploadAreaContentProps): react_jsx_runtime.JSX.Element;
53
+ interface UploadAreaTriggerProps extends ComponentProps<'div'> {
54
+ fileInputRef?: React.RefObject<HTMLInputElement | null>;
55
+ }
56
+ declare function UploadAreaTrigger({ children, fileInputRef, ...props }: UploadAreaTriggerProps): react_jsx_runtime.JSX.Element;
57
+ interface EditableFilesListProps {
58
+ fileTypeOptions?: FileTypeOption[];
59
+ onUpdateFile?: (index: number, file: Partial<FileFormat>) => void;
60
+ onDeleteFile?: (index: number) => void;
61
+ onReorderFiles?: (fromIndex: number, toIndex: number) => void;
62
+ className?: string;
63
+ }
64
+ declare function EditableFilesList({ fileTypeOptions, onUpdateFile, onDeleteFile, className, ...props }: EditableFilesListProps): react_jsx_runtime.JSX.Element | null;
65
+ declare const Upload: {
66
+ Root: typeof UploadRoot;
67
+ Area: typeof UploadArea;
68
+ Title: typeof UploadTitle;
69
+ AreaContent: typeof UploadAreaContent;
70
+ AreaTrigger: typeof UploadAreaTrigger;
71
+ EditableList: typeof EditableFilesList;
72
+ };
73
+
74
+ export { EditableFilesList, type EditableFilesListProps, type FileFormat, type FileTypeOption, Upload, UploadArea, UploadAreaContent, type UploadAreaContentProps, type UploadAreaProps, UploadAreaTrigger, type UploadAreaTriggerProps, UploadRoot, type UploadRootProps, UploadTitle, uploadAreaVariants };
@@ -0,0 +1,2 @@
1
+ import {b as b$3,c as c$1,h,l}from'../chunk-AA6V5YEC.js';import {a}from'../chunk-Z47R2CIM.js';import {b as b$2,c,g}from'../chunk-2CM3SFOY.js';import'../chunk-TSVURBUY.js';import'../chunk-IRHU7PDO.js';import'../chunk-CBFC4QME.js';import'../chunk-KIFR5VIE.js';import {b as b$1}from'../chunk-PKCW37CJ.js';import {b}from'../chunk-WV7QV2PU.js';import'../chunk-EIG6CBTQ.js';import {createContext,useState,useRef,useCallback,useContext}from'react';import {cva,cx}from'@xjur-ui/util';import {jsx,jsxs}from'react/jsx-runtime';var q=createContext(null);function T(){let l=useContext(q);if(!l)throw new Error("Upload components must be used within UploadRoot");return l}function te({children:l,className:n,files:d,onFilesChange:c,accept:m,multiple:o=false,disabled:u=false,maxFiles:b=1,maxSize:x,acceptedFormats:f=[".jpeg",".png",".webp"],...v}){return jsx(q.Provider,{value:{files:d,onFilesChange:c,accept:m,multiple:o,disabled:u,maxFiles:b,maxSize:x,acceptedFormats:f},children:jsx("div",{className:cx("flex flex-col gap-4",n),...v,children:l})})}var ae=cva(["flex flex-col items-center justify-center","relative border-2 border-dashed border-border-layer-2 rounded-lg transition-all duration-200 ease-in-out cursor-pointer","hover:border-border-layer-2 hover:bg-transparent","focus-within:border-primary-idle focus-within:ring-2 focus-within:ring-primary-idle/20","data-[drag-over=true]:border-primary-idle data-[drag-over=true]:bg-primary-alt-idle/10"],{variants:{size:{large:"p-6 min-h-[200px] ",medium:"p-6 min-h-[160px]",small:"p-6 min-h-[130px]",oneLine:"p-4 min-h-[18px]"},showButton:{true:"",false:""},variant:{default:"bg-white",transparent:"bg-transparent",minimal:"bg-white",oneLineWhite:"bg-white",oneLineTransparent:"bg-transparent"}},compoundVariants:[{size:"large",showButton:true},{size:"medium",showButton:true},{size:"small",showButton:true},{variant:"oneLineWhite",showButton:false,className:"items-center flex flex-row justify-center"},{variant:"oneLineTransparent",showButton:false,className:"items-center flex flex-row justify-center"}],defaultVariants:{size:"large",variant:"default",showButton:true}});function re({className:l,size:n="large",showButton:d=true,variant:c="default",showAcceptedFormats:m=true,buttonText:o="Selecionar arquivo",description:u="Clique ou solte os arquivos para fazer o upload",icon:b="upload",...x}){let{onFilesChange:f,accept:v,multiple:r,disabled:a,maxFiles:t,maxSize:F,acceptedFormats:E}=T(),[W,P]=useState(false),w=useRef(null),[U,D]=useState(0),N=useCallback(i=>{let s=i;return t&&t>0&&(s=s.slice(0,t)),F&&(s=s.filter(p=>p.size<=F)),v&&(s=s.filter(p=>{let Q=`.${p.name.split(".").pop()?.toLowerCase()}`;return E?.some(L=>L.startsWith(".")?L===Q:p.type.includes(L))})),s.map(p=>({name:p.name,type:p.type,fileBinary:p,restrict:false}))},[t,F,v,E]),_=useCallback(i=>{i.preventDefault(),i.stopPropagation(),D(s=>s+1),P(true);},[]),K=useCallback(i=>{i.preventDefault(),i.stopPropagation(),D(s=>s-1),U<=1&&P(false);},[U]),$=useCallback(i=>{i.preventDefault(),i.stopPropagation();},[]),G=useCallback(i=>{if(i.preventDefault(),i.stopPropagation(),P(false),D(0),a)return;let s=Array.from(i.dataTransfer.files),p=N(s);p.length>0&&f?.(p);},[a,f,N]),J=useCallback(i=>{if(a)return;let s=Array.from(i.target.files||[]),p=N(s);p.length>0&&f?.(p);},[a,f,N]);return jsxs(M,{...x,"aria-disabled":a,"aria-label":u,className:cx(ae({size:n,showButton:d,variant:c}),l),"data-drag-over":W,fileInputRef:w,onDragEnter:_,onDragLeave:K,onDragOver:$,onDrop:G,children:[jsx("input",{accept:v,className:"hidden",disabled:a,multiple:r,ref:w,type:"file",onChange:J}),jsx(H,{buttonText:o,description:u,icon:b,showAcceptedFormats:m,showButton:d,variant:c||"default",onButtonClick:()=>{!a&&w.current&&w.current.click();}})]})}function ne({children:l,className:n,...d}){return jsx("h3",{className:cx("text-neutral-dark text-lg font-semibold",n),...d,children:l})}function H({description:l="Clique ou solte os arquivos para fazer o upload",icon:n="upload",showAcceptedFormats:d=true,buttonText:c="Selecionar arquivo",showButton:m=true,onButtonClick:o,variant:u="default",className:b$2,...x}){let{acceptedFormats:f}=T(),v=()=>d?jsxs("p",{className:"text-neutral-secondary mt-2 text-sm",children:["Formatos aceitos: ",f?.join(" ")]}):null;return u==="oneLineWhite"||u==="oneLineTransparent"?jsxs("div",{...x,className:cx("flex h-full items-center justify-center gap-4 text-center",b$2),children:[jsx(b,{className:"text-neutral-secondary text-4xl",name:n}),jsx("p",{className:"text-neutral-dark text-base font-medium",children:l}),v()]}):jsxs("div",{...x,className:cx("flex h-full w-full flex-col items-center gap-4 text-center",b$2),children:[jsxs("div",{className:"flex flex-col items-center",children:[jsx(b,{className:"text-neutral-secondary mb-3 text-4xl",name:n}),jsx("p",{className:"text-neutral-dark mb-2 text-base font-medium",children:l}),v()]}),m&&jsx("div",{children:jsx(b$1,{size:"md",variant:"primary",onClick:a=>{a.stopPropagation(),o?.();},children:c})})]})}function M({children:l,fileInputRef:n,...d}){let{disabled:c}=T(),m=useCallback(()=>{!c&&n?.current&&n.current.click();},[c,n]);return jsx("div",{role:"button",tabIndex:c?-1:0,onClick:m,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),m());},...d,children:l})}function oe({fileTypeOptions:l$1=[{value:"document",label:"Documento"},{value:"image",label:"Imagem"},{value:"video",label:"V\xEDdeo"},{value:"audio",label:"\xC1udio"},{value:"other",label:"Outro"}],onUpdateFile:n,onDeleteFile:d,className:c$2,...m}){let{files:o,onFilesChange:u}=T();if(!o||o.length===0)return null;let b$4=(r,a)=>{if(n)n(r,{description:a});else {let t=[...o];t[r]={...t[r],description:a},u?.(t);}},x=(r,a)=>{if(n)n(r,{fileType:a});else {let t=[...o];t[r]={...t[r],fileType:a},u?.(t);}},f=(r,a)=>{if(n)n(r,{restrict:a});else {let t=[...o];t[r]={...t[r],restrict:a},u?.(t);}},v=r=>{if(d)d(r);else {let a=o.filter((t,F)=>F!==r);u?.(a);}};return jsx("div",{className:cx("space-y-2",c$2),...m,children:jsxs("div",{className:"border-border-layer-2 p-4",children:[jsxs("div",{className:"border-border-layer-2 mb-3 flex w-full flex-row items-center justify-between gap-4 border-b pb-2",children:[jsx("div",{className:"w-full",children:jsx("span",{className:"text-sm font-medium text-gray-300",children:"Descri\xE7\xE3o"})}),jsx("div",{className:"w-full",children:jsx("span",{className:"text-sm font-medium text-gray-300",children:"Tipo"})}),jsx("div",{className:"flex justify-end",children:jsx("span",{className:"text-sm font-medium text-gray-300",children:"Restrito"})})]}),jsx("div",{className:"space-y-3",children:o.map((r,a$1)=>jsxs("div",{className:"flex flex-row items-center gap-4 py-3",children:[jsx("div",{className:"flex justify-start",children:jsx(b,{className:"text-neutral-secondary hover:text-neutral-dark cursor-grab",name:"drag_indicator"})}),jsx("div",{className:"w-full",children:jsx(b$2,{children:jsx(c,{children:jsx(g,{placeholder:"Nome do arquivo",value:r.description||r.name,onChange:t=>b$4(a$1,t.target.value)})})})}),jsx("div",{className:"w-full",children:jsxs(b$3,{children:[jsxs(c$1,{className:"flex justify-between",children:[jsx("span",{className:"text-neutral-dark",children:l$1.find(t=>t.value===r.fileType)?.label||"Tipo"}),jsx(b,{className:"text-neutral-secondary",name:"keyboard_arrow_down"})]}),jsx(h,{children:l$1.map(t=>jsx(l,{value:t.value,onSelect:()=>x(a$1,t.value),children:t.label},t.value))})]})}),jsx("div",{className:"flex justify-end",children:jsx(a,{checked:r.restrict||false,onCheckedChange:t=>f(a$1,t)})}),jsx("div",{className:"flex justify-end",children:jsx(b$1,{appearance:"ghost",size:"sm",variant:"destructive",onClick:()=>v(a$1),children:jsx(b,{name:"delete"})})})]},a$1))})]})})}var me={Root:te,Area:re,Title:ne,AreaContent:H,AreaTrigger:M,EditableList:oe};export{oe as EditableFilesList,me as Upload,re as UploadArea,H as UploadAreaContent,M as UploadAreaTrigger,te as UploadRoot,ne as UploadTitle,ae as uploadAreaVariants};//# sourceMappingURL=upload.js.map
2
+ //# sourceMappingURL=upload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/upload.tsx"],"names":["UploadContext","createContext","useUploadContext","context","useContext","UploadRoot","children","className","files","onFilesChange","accept","multiple","disabled","maxFiles","maxSize","acceptedFormats","props","jsx","cx","uploadAreaVariants","cva","UploadArea","size","showButton","variant","showAcceptedFormats","buttonText","description","icon","isDragOver","setIsDragOver","useState","fileInputRef","useRef","dragCounter","setDragCounter","validateFiles","useCallback","validFiles","file","fileExtension","format","handleDragEnter","e","prev","handleDragLeave","handleDragOver","handleDrop","handleFileSelect","jsxs","UploadAreaTrigger","UploadAreaContent","UploadTitle","onButtonClick","formatAcceptedFormats","Icon","Button","handleClick","EditableFilesList","fileTypeOptions","onUpdateFile","onDeleteFile","handleDescriptionChange","index","updatedFiles","handleFileTypeChange","fileType","handleRestrictChange","restrict","handleDelete","_","i","InputRoot","InputContent","InputText","SelectRoot","SelectTrigger","option","SelectContent","SelectOption","Switch","checked","Upload"],"mappings":"qgBAuCA,IAAMA,CAAAA,CAAgBC,aAAAA,CAAyC,IAAI,CAAA,CAEnE,SAASC,CAAAA,EAAmB,CAC1B,IAAMC,CAAAA,CAAUC,UAAAA,CAAWJ,CAAa,CAAA,CACxC,GAAI,CAACG,CAAAA,CACH,MAAM,IAAI,MAAM,kDAAkD,CAAA,CAEpE,OAAOA,CACT,CAaA,SAASE,EAAAA,CAAW,CAClB,QAAA,CAAAC,EACA,SAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CACA,cAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,EAAW,KAAA,CAC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,CAAAA,GAAAA,CAACuC,GAAAA,CAAA,CACC,UAAA,CAAW,OAAA,CACX,IAAA,CAAK,IAAA,CACL,QAAQ,aAAA,CACR,OAAA,CAAS,IAAMa,CAAAA,CAAaN,GAAK,CAAA,CAEjC,QAAA,CAAA9C,GAAAA,CAACsC,CAAAA,CAAA,CAAK,IAAA,CAAK,QAAA,CAAS,CAAA,CACtB,CAAA,CACF,IArE0DQ,GAsE5D,CACD,CAAA,CACH,CAAA,CAAA,CACF,EACF,CAEJ,CAEO,IAAMmB,EAAAA,CAAS,CACpB,IAAA,CAAM7E,EAAAA,CACN,IAAA,CAAMgB,EAAAA,CACN,MAAO+B,EAAAA,CACP,WAAA,CAAaD,EACb,WAAA,CAAaD,CAAAA,CACb,aAAcQ,EAChB","file":"upload.js","sourcesContent":["import type { ComponentProps, DragEvent, ChangeEvent } from 'react'\nimport { useRef, useState, useCallback, createContext, useContext } from 'react'\nimport { cva, cx, type ClassVariantProps } from '@xjur-ui/util'\nimport { Icon, type IconType } from './icon'\nimport { Button } from './form/button'\nimport { Switch } from './form/switch'\nimport { InputRoot, InputContent, InputText } from './form/input'\nimport {\n SelectRoot,\n SelectTrigger,\n SelectContent,\n SelectOption\n} from './form/select'\n\nexport interface FileFormat {\n name: string\n type: string\n fileBinary: File\n restrict?: boolean\n description?: string\n fileType?: string\n}\n\nexport interface FileTypeOption {\n value: string\n label: string\n}\n\ninterface UploadContextValue {\n files: FileFormat[]\n onFilesChange?: (files: FileFormat[]) => void\n accept?: string\n multiple?: boolean\n disabled?: boolean\n maxFiles?: number\n maxSize?: number\n acceptedFormats?: string[]\n}\n\nconst UploadContext = createContext<UploadContextValue | null>(null)\n\nfunction useUploadContext() {\n const context = useContext(UploadContext)\n if (!context) {\n throw new Error('Upload components must be used within UploadRoot')\n }\n return context\n}\n\ninterface UploadRootProps extends ComponentProps<'div'> {\n files: FileFormat[]\n onFilesChange?: (files: FileFormat[]) => void\n accept?: string\n multiple?: boolean\n disabled?: boolean\n maxFiles?: number\n maxSize?: number\n acceptedFormats?: string[]\n}\n\nfunction UploadRoot({\n children,\n className,\n files,\n onFilesChange,\n accept,\n multiple = false,\n disabled = false,\n maxFiles = 1,\n maxSize,\n acceptedFormats = ['.jpeg', '.png', '.webp'],\n ...props\n}: UploadRootProps) {\n return (\n <UploadContext.Provider\n value={{\n files,\n onFilesChange,\n accept,\n multiple,\n disabled,\n maxFiles,\n maxSize,\n acceptedFormats\n }}\n >\n <div className={cx('flex flex-col gap-4', className)} {...props}>\n {children}\n </div>\n </UploadContext.Provider>\n )\n}\n\nconst uploadAreaVariants = cva(\n [\n 'flex flex-col items-center justify-center',\n 'relative border-2 border-dashed border-border-layer-2 rounded-lg transition-all duration-200 ease-in-out cursor-pointer',\n 'hover:border-border-layer-2 hover:bg-transparent',\n 'focus-within:border-primary-idle focus-within:ring-2 focus-within:ring-primary-idle/20',\n 'data-[drag-over=true]:border-primary-idle data-[drag-over=true]:bg-primary-alt-idle/10'\n ],\n {\n variants: {\n size: {\n large: 'p-6 min-h-[200px] ',\n medium: 'p-6 min-h-[160px]',\n small: 'p-6 min-h-[130px]',\n oneLine: 'p-4 min-h-[18px]'\n },\n showButton: {\n true: '',\n false: ''\n },\n variant: {\n default: 'bg-white',\n transparent: 'bg-transparent',\n minimal: 'bg-white',\n oneLineWhite: 'bg-white',\n oneLineTransparent: 'bg-transparent'\n }\n },\n compoundVariants: [\n {\n size: 'large',\n showButton: true\n },\n {\n size: 'medium',\n showButton: true\n },\n {\n size: 'small',\n showButton: true\n },\n {\n variant: 'oneLineWhite',\n showButton: false,\n className: 'items-center flex flex-row justify-center'\n },\n {\n variant: 'oneLineTransparent',\n showButton: false,\n className: 'items-center flex flex-row justify-center'\n }\n ],\n defaultVariants: {\n size: 'large',\n variant: 'default',\n showButton: true\n }\n }\n)\n\ninterface UploadAreaProps\n extends Omit<ComponentProps<'div'>, 'onChange'>,\n ClassVariantProps<typeof uploadAreaVariants> {\n showAcceptedFormats?: boolean\n buttonText?: string\n description?: string\n icon?: string\n showButton?: boolean\n}\n\nfunction UploadArea({\n className,\n size = 'large',\n showButton = true,\n variant = 'default',\n showAcceptedFormats = true,\n buttonText = 'Selecionar arquivo',\n description = 'Clique ou solte os arquivos para fazer o upload',\n icon = 'upload',\n ...props\n}: UploadAreaProps) {\n const {\n onFilesChange,\n accept,\n multiple,\n disabled,\n maxFiles,\n maxSize,\n acceptedFormats\n } = useUploadContext()\n const [isDragOver, setIsDragOver] = useState(false)\n const fileInputRef = useRef<HTMLInputElement>(null)\n const [dragCounter, setDragCounter] = useState(0)\n\n const validateFiles = useCallback(\n (files: File[]): FileFormat[] => {\n let validFiles = files\n\n if (maxFiles && maxFiles > 0) {\n validFiles = validFiles.slice(0, maxFiles)\n }\n\n if (maxSize) {\n validFiles = validFiles.filter(file => file.size <= maxSize)\n }\n\n if (accept) {\n validFiles = validFiles.filter(file => {\n const fileExtension = `.${file.name.split('.').pop()?.toLowerCase()}`\n return acceptedFormats?.some(format =>\n format.startsWith('.')\n ? format === fileExtension\n : file.type.includes(format)\n )\n })\n }\n\n return validFiles.map(file => ({\n name: file.name,\n type: file.type,\n fileBinary: file,\n restrict: false\n }))\n },\n [maxFiles, maxSize, accept, acceptedFormats]\n )\n\n const handleDragEnter = useCallback((e: DragEvent<HTMLDivElement>) => {\n e.preventDefault()\n e.stopPropagation()\n setDragCounter(prev => prev + 1)\n setIsDragOver(true)\n }, [])\n\n const handleDragLeave = useCallback(\n (e: DragEvent<HTMLDivElement>) => {\n e.preventDefault()\n e.stopPropagation()\n setDragCounter(prev => prev - 1)\n if (dragCounter <= 1) {\n setIsDragOver(false)\n }\n },\n [dragCounter]\n )\n\n const handleDragOver = useCallback((e: DragEvent<HTMLDivElement>) => {\n e.preventDefault()\n e.stopPropagation()\n }, [])\n\n const handleDrop = useCallback(\n (e: DragEvent<HTMLDivElement>) => {\n e.preventDefault()\n e.stopPropagation()\n setIsDragOver(false)\n setDragCounter(0)\n\n if (disabled) return\n\n const files = Array.from(e.dataTransfer.files)\n const validFiles = validateFiles(files)\n\n if (validFiles.length > 0) {\n onFilesChange?.(validFiles)\n }\n },\n [disabled, onFilesChange, validateFiles]\n )\n\n const handleFileSelect = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n if (disabled) return\n\n const files = Array.from(e.target.files || [])\n const validFiles = validateFiles(files)\n\n if (validFiles.length > 0) {\n onFilesChange?.(validFiles)\n }\n },\n [disabled, onFilesChange, validateFiles]\n )\n\n return (\n <UploadAreaTrigger\n {...props}\n aria-disabled={disabled}\n aria-label={description}\n className={cx(\n uploadAreaVariants({ size, showButton, variant }),\n className\n )}\n data-drag-over={isDragOver}\n fileInputRef={fileInputRef}\n onDragEnter={handleDragEnter}\n onDragLeave={handleDragLeave}\n onDragOver={handleDragOver}\n onDrop={handleDrop}\n >\n <input\n accept={accept}\n className=\"hidden\"\n disabled={disabled}\n multiple={multiple}\n ref={fileInputRef}\n type=\"file\"\n onChange={handleFileSelect}\n />\n\n <UploadAreaContent\n buttonText={buttonText}\n description={description}\n icon={icon}\n showAcceptedFormats={showAcceptedFormats}\n showButton={showButton}\n variant={variant || 'default'}\n onButtonClick={() => {\n if (!disabled && fileInputRef.current) {\n fileInputRef.current.click()\n }\n }}\n />\n </UploadAreaTrigger>\n )\n}\n\nfunction UploadTitle({ children, className, ...props }: ComponentProps<'h3'>) {\n return (\n <h3\n className={cx('text-neutral-dark text-lg font-semibold', className)}\n {...props}\n >\n {children}\n </h3>\n )\n}\n\ninterface UploadAreaContentProps extends ComponentProps<'div'> {\n description?: string\n icon?: string\n showAcceptedFormats?: boolean\n buttonText?: string\n showButton?: boolean\n onButtonClick?: () => void\n variant?:\n | 'default'\n | 'transparent'\n | 'minimal'\n | 'oneLineWhite'\n | 'oneLineTransparent'\n}\n\nfunction UploadAreaContent({\n description = 'Clique ou solte os arquivos para fazer o upload',\n icon = 'upload',\n showAcceptedFormats = true,\n buttonText = 'Selecionar arquivo',\n showButton = true,\n onButtonClick,\n variant = 'default',\n className,\n ...props\n}: UploadAreaContentProps) {\n const { acceptedFormats } = useUploadContext()\n\n const formatAcceptedFormats = () => {\n if (!showAcceptedFormats) return null\n\n return (\n <p className=\"text-neutral-secondary mt-2 text-sm\">\n Formatos aceitos: {acceptedFormats?.join(' ')}\n </p>\n )\n }\n\n const isOneLineVariant =\n variant === 'oneLineWhite' || variant === 'oneLineTransparent'\n\n if (isOneLineVariant) {\n return (\n <div\n {...props}\n className={cx(\n 'flex h-full items-center justify-center gap-4 text-center',\n className\n )}\n >\n <Icon\n className=\"text-neutral-secondary text-4xl\"\n name={icon as IconType}\n />\n <p className=\"text-neutral-dark text-base font-medium\">{description}</p>\n {formatAcceptedFormats()}\n </div>\n )\n }\n\n return (\n <div\n {...props}\n className={cx(\n 'flex h-full w-full flex-col items-center gap-4 text-center',\n className\n )}\n >\n <div className=\"flex flex-col items-center\">\n <Icon\n className=\"text-neutral-secondary mb-3 text-4xl\"\n name={icon as IconType}\n />\n\n <p className=\"text-neutral-dark mb-2 text-base font-medium\">\n {description}\n </p>\n\n {formatAcceptedFormats()}\n </div>\n\n {showButton && (\n <div>\n <Button\n size=\"md\"\n variant=\"primary\"\n onClick={e => {\n e.stopPropagation()\n onButtonClick?.()\n }}\n >\n {buttonText}\n </Button>\n </div>\n )}\n </div>\n )\n}\n\ninterface UploadAreaTriggerProps extends ComponentProps<'div'> {\n fileInputRef?: React.RefObject<HTMLInputElement | null>\n}\n\nfunction UploadAreaTrigger({\n children,\n fileInputRef,\n ...props\n}: UploadAreaTriggerProps) {\n const { disabled } = useUploadContext()\n\n const handleClick = useCallback(() => {\n if (!disabled && fileInputRef?.current) {\n fileInputRef.current.click()\n }\n }, [disabled, fileInputRef])\n\n return (\n <div\n role=\"button\"\n tabIndex={disabled ? -1 : 0}\n onClick={handleClick}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n handleClick()\n }\n }}\n {...props}\n >\n {children}\n </div>\n )\n}\n\ninterface EditableFilesListProps {\n fileTypeOptions?: FileTypeOption[]\n onUpdateFile?: (index: number, file: Partial<FileFormat>) => void\n onDeleteFile?: (index: number) => void\n onReorderFiles?: (fromIndex: number, toIndex: number) => void\n className?: string\n}\n\nfunction EditableFilesList({\n fileTypeOptions = [\n { value: 'document', label: 'Documento' },\n { value: 'image', label: 'Imagem' },\n { value: 'video', label: 'Vídeo' },\n { value: 'audio', label: 'Áudio' },\n { value: 'other', label: 'Outro' }\n ],\n onUpdateFile,\n onDeleteFile,\n className,\n ...props\n}: EditableFilesListProps) {\n const { files, onFilesChange } = useUploadContext()\n\n if (!files || files.length === 0) return null\n\n const handleDescriptionChange = (index: number, description: string) => {\n if (onUpdateFile) {\n onUpdateFile(index, { description })\n } else {\n const updatedFiles = [...files]\n updatedFiles[index] = { ...updatedFiles[index], description }\n onFilesChange?.(updatedFiles)\n }\n }\n\n const handleFileTypeChange = (index: number, fileType: string) => {\n if (onUpdateFile) {\n onUpdateFile(index, { fileType })\n } else {\n const updatedFiles = [...files]\n updatedFiles[index] = { ...updatedFiles[index], fileType }\n onFilesChange?.(updatedFiles)\n }\n }\n\n const handleRestrictChange = (index: number, restrict: boolean) => {\n if (onUpdateFile) {\n onUpdateFile(index, { restrict })\n } else {\n const updatedFiles = [...files]\n updatedFiles[index] = { ...updatedFiles[index], restrict }\n onFilesChange?.(updatedFiles)\n }\n }\n\n const handleDelete = (index: number) => {\n if (onDeleteFile) {\n onDeleteFile(index)\n } else {\n const updatedFiles = files.filter((_, i) => i !== index)\n onFilesChange?.(updatedFiles)\n }\n }\n\n return (\n <div className={cx('space-y-2', className)} {...props}>\n <div className=\"border-border-layer-2 p-4\">\n <div className=\"border-border-layer-2 mb-3 flex w-full flex-row items-center justify-between gap-4 border-b pb-2\">\n <div className=\"w-full\">\n <span className=\"text-sm font-medium text-gray-300\">Descrição</span>\n </div>\n <div className=\"w-full\">\n <span className=\"text-sm font-medium text-gray-300\">Tipo</span>\n </div>\n <div className=\"flex justify-end\">\n <span className=\"text-sm font-medium text-gray-300\">Restrito</span>\n </div>\n </div>\n\n <div className=\"space-y-3\">\n {files.map((file, index) => (\n <div className=\"flex flex-row items-center gap-4 py-3\" key={index}>\n <div className=\"flex justify-start\">\n <Icon\n className=\"text-neutral-secondary hover:text-neutral-dark cursor-grab\"\n name=\"drag_indicator\"\n />\n </div>\n\n <div className=\"w-full\">\n <InputRoot>\n <InputContent>\n <InputText\n placeholder=\"Nome do arquivo\"\n value={file.description || file.name}\n onChange={e =>\n handleDescriptionChange(index, e.target.value)\n }\n />\n </InputContent>\n </InputRoot>\n </div>\n\n <div className=\"w-full\">\n <SelectRoot>\n <SelectTrigger className=\"flex justify-between\">\n <span className=\"text-neutral-dark\">\n {fileTypeOptions.find(\n option => option.value === file.fileType\n )?.label || 'Tipo'}\n </span>\n <Icon\n className=\"text-neutral-secondary\"\n name=\"keyboard_arrow_down\"\n />\n </SelectTrigger>\n <SelectContent>\n {fileTypeOptions.map(option => (\n <SelectOption\n key={option.value}\n value={option.value}\n onSelect={() =>\n handleFileTypeChange(index, option.value)\n }\n >\n {option.label}\n </SelectOption>\n ))}\n </SelectContent>\n </SelectRoot>\n </div>\n\n <div className=\"flex justify-end\">\n <Switch\n checked={file.restrict || false}\n onCheckedChange={checked =>\n handleRestrictChange(index, checked)\n }\n />\n </div>\n\n <div className=\"flex justify-end\">\n <Button\n appearance=\"ghost\"\n size=\"sm\"\n variant=\"destructive\"\n onClick={() => handleDelete(index)}\n >\n <Icon name=\"delete\" />\n </Button>\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n )\n}\n\nexport const Upload = {\n Root: UploadRoot,\n Area: UploadArea,\n Title: UploadTitle,\n AreaContent: UploadAreaContent,\n AreaTrigger: UploadAreaTrigger,\n EditableList: EditableFilesList\n}\n\nexport { UploadRoot }\nexport { UploadArea }\nexport { UploadTitle }\nexport { UploadAreaContent }\nexport { UploadAreaTrigger }\nexport { EditableFilesList }\nexport { uploadAreaVariants }\nexport type {\n UploadRootProps,\n UploadAreaProps,\n UploadAreaContentProps,\n UploadAreaTriggerProps,\n EditableFilesListProps\n}\n"]}
@@ -0,0 +1,7 @@
1
+ type OS = 'ios' | 'macos' | 'windows' | 'android' | 'linux' | 'unknown';
2
+ declare function useOS(): {
3
+ os: OS;
4
+ shortcut: string;
5
+ };
6
+
7
+ export { useOS };
@@ -0,0 +1,2 @@
1
+ export{a as useOS}from'../chunk-KS6WGBHQ.js';//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,4 @@
1
+ declare const icons: readonly ["account_balance", "assignment", "task", "ad_units", "add_a_photo", "add", "adjust", "archive", "arrow_downward_alt", "arrow_downward", "arrow_drop_down", "arrow_drop_up", "arrow_split", "arrow_upward_alt", "arrow_upward", "attach_file", "attach_money", "autorenew", "brightness_1", "calendar_today", "call", "chat_bubble", "check_circle", "check", "chevron_left", "chevron_right", "close", "collapse_all", "contacts", "content_copy", "dangerous", "dashboard", "delete", "download", "draft", "drafts", "drag_handle", "drag_indicator", "edit_document", "edit_square", "edit", "error", "expand_all", "file_export", "filter_alt", "filter_list", "first_page", "flag_2", "folder_open", "folder", "format_bold", "format_italic", "format_italic", "format_size", "format_strikethrough", "gavel", "group", "headphones", "help", "hourglass_bottom", "imagesmode", "import_contacts", "inbox", "info", "inventory_2", "keep", "keep", "keyboard_arrow_down", "keyboard_arrow_up", "keyboard_return", "label_off", "label", "last_page", "left_panel_close", "left_panel_open", "link_off", "link", "linked_services", "list", "location_on", "lock", "logout", "mail", "menu", "mic", "more_vert", "notifications", "numbers", "person_add", "person_off", "person", "play_circle", "progress_activity", "question_mark", "radio_button_unchecked", "refresh", "remove", "reply", "right_panel_close", "right_panel_open", "schedule", "search", "sell", "send", "settings", "share", "smart_display", "star", "star", "swap_vert", "thumb_down", "thumb_up", "tune", "unarchive", "undo", "upload", "verified_user", "videocam", "view_list", "view_module", "view_object_track", "visibility_off", "visibility", "warning", "wifi_2_bar", "wifi_off", "wifi", "work", "workspaces", "article", "id_card", "badge", "home", "save", "code", "favorite", "analytics", "reports", "event", "account_circle", "history", "security", "bar_chart", "category", "format_underlined", "format_list_bulleted", "format_list_numbered", "redo", "more_horiz"];
2
+ type IconType = (typeof icons)[number];
3
+
4
+ export { type IconType as I, icons as i };