@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,160 +0,0 @@
1
- import type { ComponentProps } from 'react'
2
- import * as RadixPopover from '@radix-ui/react-popover'
3
- import { cx } from '@xjur-ui/util'
4
- import { Typography, type TypographyProps } from './typography'
5
-
6
- export function DatePickerRoot(
7
- props: ComponentProps<typeof RadixPopover.Root>
8
- ) {
9
- return <RadixPopover.Root {...props} />
10
- }
11
-
12
- export function DatePickerTrigger({
13
- className,
14
- ...props
15
- }: ComponentProps<typeof RadixPopover.Trigger>) {
16
- return (
17
- <RadixPopover.Trigger
18
- className={cx(
19
- className,
20
- 'group h-large-4x rounded-small-1x gap-small py-small_1x-alt px-small relative flex w-full cursor-pointer items-center',
21
- 'bg-layer-2-idle border-border-layer-2 hover:border-border-layer-3 border',
22
- 'data-[state=open]:border-primary-idle',
23
- 'has-[input:not(:placeholder-shown)]:text-primary-idle',
24
- 'has-[input:not(:placeholder-shown)]:border-primary-idle'
25
- )}
26
- {...props}
27
- />
28
- )
29
- }
30
-
31
- export function DatePickerContent({
32
- className,
33
- sideOffset = 5,
34
- side = 'bottom',
35
- align = 'start',
36
- ...props
37
- }: ComponentProps<typeof RadixPopover.Content>) {
38
- return (
39
- <RadixPopover.Portal>
40
- <RadixPopover.Content
41
- align={align}
42
- className={cx(
43
- className,
44
- 'group z-10 max-h-[var(--radix-popover-content-available-height)] max-w-[var(--radix-popover-content-available-width)] min-w-[var(--radix-popover-trigger-width)]'
45
- )}
46
- side={side}
47
- sideOffset={sideOffset}
48
- {...props}
49
- />
50
- </RadixPopover.Portal>
51
- )
52
- }
53
-
54
- export function DatePickerValue({
55
- className,
56
- displayValue = '',
57
- value,
58
- ...props
59
- }: ComponentProps<'input'> & { displayValue?: string }) {
60
- return (
61
- <>
62
- {!!displayValue && (
63
- <Typography className="text-neutral-dark group-has-[div[data-slot=date-picker-left-slot]]:pl-large-1x">
64
- {displayValue}
65
- </Typography>
66
- )}
67
-
68
- <input
69
- {...props}
70
- aria-readonly={true}
71
- className={cx('pointer-events-none', className)}
72
- hidden={true}
73
- placeholder={props.placeholder ?? ' '}
74
- readOnly={true}
75
- value={value ?? ''}
76
- />
77
- </>
78
- )
79
- }
80
-
81
- export function DatePickerLabel({
82
- className,
83
- htmlFor,
84
- children,
85
- ...props
86
- }: TypographyProps & { htmlFor?: string }) {
87
- return (
88
- <Typography
89
- asChild={true}
90
- className={cx(
91
- 'inline-block max-w-full truncate text-left font-normal',
92
- 'left-small right-small pointer-events-none absolute top-1/2 -translate-y-1/2',
93
- 'ease transition-all duration-250',
94
- // Content Open
95
- 'group-data-[state=open]:text-primary-idle',
96
- 'group-data-[state=open]:-top-[3px]',
97
- 'group-data-[state=open]:text-size-label-sm-1x',
98
- 'group-data-[state=open]:font-medium',
99
- // Filled
100
- 'group-has-[input:not(:placeholder-shown)]:text-primary-idle',
101
- 'group-has-[input:not(:placeholder-shown)]:-top-[3px]',
102
- 'group-has-[input:not(:placeholder-shown)]:text-size-label-sm-1x',
103
- 'group-has-[input:not(:placeholder-shown)]:font-medium',
104
- // If has left slot
105
- 'group-has-[div[data-slot=date-picker-left-slot]]:left-large-4x',
106
- 'group-has-[div[data-slot=date-picker-left-slot]]:group-data-[state=open]:left-small',
107
- 'group-has-[div[data-slot=date-picker-left-slot]]:group-has-[input:not(:placeholder-shown)]:left-small',
108
- // If has right slot
109
- 'group-has-[div[data-slot=date-picker-right-slot]]:right-large-4x',
110
- 'group-has-[div[data-slot=date-picker-right-slot]]:group-data-[state=open]:right-small',
111
- 'group-has-[div[data-slot=date-picker-right-slot]]:group-has-[input:not(:placeholder-shown)]:right-small',
112
- // Animate
113
- 'group-data-[state=open]:animate-in',
114
- 'group-data-[state=closed]:animate-out',
115
- 'group-has-[input:not(:placeholder-shown)]:animate-out',
116
- className
117
- )}
118
- weight="medium"
119
- {...props}
120
- >
121
- <label htmlFor={htmlFor}>
122
- <span className="bg-layer-2-idle rounded-small-1x max-w-full">
123
- {children}
124
- </span>
125
- </label>
126
- </Typography>
127
- )
128
- }
129
-
130
- export function DatePickerLeftSlot({
131
- className,
132
- ...props
133
- }: ComponentProps<'div'>) {
134
- return (
135
- <div
136
- {...props}
137
- className={cx(
138
- className,
139
- 'left-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center'
140
- )}
141
- data-slot="date-picker-left-slot"
142
- />
143
- )
144
- }
145
-
146
- export function DatePickerRightSlot({
147
- className,
148
- ...props
149
- }: ComponentProps<'div'>) {
150
- return (
151
- <div
152
- {...props}
153
- className={cx(
154
- className,
155
- 'right-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center'
156
- )}
157
- data-slot="date-picker-right-slot"
158
- />
159
- )
160
- }
@@ -1,256 +0,0 @@
1
- import { cva, cx } from '@xjur-ui/util'
2
- import type { ComponentProps } from 'react'
3
- import { createContext } from 'react'
4
- import { InputMask, type MaskOptions } from '@react-input/mask'
5
- import {
6
- InputNumberFormat,
7
- type InputNumberFormatProps
8
- } from '@react-input/number-format'
9
- import { inputMask, type InputMaskType } from '../resources/input-mask'
10
-
11
- export { inputMask, type InputMaskType, type MaskOptions }
12
-
13
- export type InputProps = {
14
- variant?: 'outlined' | 'filled'
15
- }
16
-
17
- const FieldContext = createContext<InputProps>({
18
- variant: 'filled'
19
- })
20
-
21
- export function InputRoot({
22
- className,
23
- children,
24
- variant = 'filled',
25
- ...props
26
- }: ComponentProps<'div'> & InputProps) {
27
- return (
28
- <FieldContext.Provider value={{ variant }}>
29
- <div
30
- className={cx(
31
- 'group gap-small relative flex w-full flex-col',
32
- className
33
- )}
34
- {...props}
35
- >
36
- {children}
37
- </div>
38
- </FieldContext.Provider>
39
- )
40
- }
41
-
42
- export function InputContent({ className, ...props }: ComponentProps<'div'>) {
43
- const variants = cva(
44
- [
45
- 'relative h-large-4x rounded-small-1x gap-small py-small_1x-alt px-small flex items-center w-full',
46
- 'focus-within:border-primary-idle focus-within:border',
47
- 'group-has-[div[data-slot=input-right-action-slot]]:rounded-r-none',
48
- 'group-has-[div[data-slot=input-left-action-slot]]:rounded-l-none'
49
- ],
50
- {
51
- variants: {
52
- variant: {
53
- default: '',
54
- outlined:
55
- 'bg-layer-2-idle border-border-layer-2 border hover:group-has-[input:not(:focus-within)]:border-border-layer-3 has-[input:not(:placeholder-shown)]:border-primary-idle',
56
- filled:
57
- 'bg-layer-2-hover group-hover:border-border-layer-1 group-hover:border-1'
58
- }
59
- }
60
- }
61
- )
62
-
63
- return (
64
- <FieldContext.Consumer>
65
- {({ variant }) => {
66
- return (
67
- <div className={cx(className, variants({ variant }))} {...props} />
68
- )
69
- }}
70
- </FieldContext.Consumer>
71
- )
72
- }
73
-
74
- export function InputLabel({
75
- htmlFor,
76
- className,
77
- children,
78
- ...props
79
- }: ComponentProps<'label'> & { htmlFor: string }) {
80
- return (
81
- <FieldContext.Consumer>
82
- {({ variant }) => {
83
- return (
84
- <label
85
- className={cx(
86
- 'group text-size-body-md text-neutral-dark inline-block max-w-full truncate text-left',
87
- 'ease animate-in left-small right-small pointer-events-none absolute top-1/2 -translate-y-1/2 transition-all duration-250',
88
- // Filled
89
- 'group-focus-within:text-primary-idle group-focus-within:-top-[3px]',
90
- 'group-focus-within:text-size-label-sm-1x group-focus-within:font-medium',
91
- 'group-has-[input:not(:placeholder-shown)]:-top-[3px]',
92
- 'group-has-[input:not(:placeholder-shown)]:text-size-label-sm-1x',
93
- 'group-has-[input:not(:placeholder-shown)]:font-medium',
94
- 'data-[variant=outlined]:group-has-[input:not(:placeholder-shown)]:text-primary-idle',
95
- // If has left slot
96
- 'group-has-[div[data-slot=input-left-slot]]:left-large-4x',
97
- 'group-has-[div[data-slot=input-left-slot]]:group-focus-within:left-small',
98
- 'group-has-[div[data-slot=input-left-slot]]:group-has-[input:not(:placeholder-shown)]:left-small',
99
- // If has right slot
100
- 'group-has-[div[data-slot=input-right-slot]]:right-large-4x',
101
- 'group-has-[div[data-slot=input-right-slot]]:group-focus-within:right-small',
102
- 'group-has-[div[data-slot=input-right-slot]]:group-has-[input:not(:placeholder-shown)]:right-small',
103
- // Animate
104
- 'group-focus-within:animate-in',
105
- 'group-has-[input:not(:placeholder-shown)]:animate-out',
106
- className
107
- )}
108
- data-variant={variant}
109
- htmlFor={htmlFor}
110
- {...props}
111
- >
112
- <span
113
- className={cx(
114
- 'rounded-small-1x max-w-full',
115
- 'group-data-[variant=outlined]:group-focus-within:bg-layer-2-idle group-data-[variant=filled]:group-focus-within:bg-layer-2-hover',
116
- 'group-data-[variant=outlined]:bg-layer-2-idle group-data-[variant=filled]:bg-layer-2-hover'
117
- )}
118
- >
119
- {children}
120
- </span>
121
- </label>
122
- )
123
- }}
124
- </FieldContext.Consumer>
125
- )
126
- }
127
-
128
- export function InputText({
129
- className,
130
- maskOptions,
131
- maskType,
132
- ...props
133
- }: ComponentProps<'input'> & {
134
- maskOptions?: MaskOptions
135
- maskType?: InputMaskType
136
- }) {
137
- const Component = maskOptions || maskType ? InputMask : 'input'
138
-
139
- return (
140
- <Component
141
- {...props}
142
- {...(maskType
143
- ? { ...inputMask(maskType) }
144
- : maskOptions && { ...maskOptions })}
145
- className={cx(
146
- className,
147
- 'peer text-size-body-md text-neutral-dark flex-1 font-medium outline-none',
148
- 'group-has-[div[data-slot=input-left-slot]]:pl-large-1x ml-small-1x'
149
- )}
150
- placeholder={props.placeholder || ' '}
151
- {...(maskOptions && { ...maskOptions })}
152
- />
153
- )
154
- }
155
-
156
- export function InputNumber({
157
- className,
158
- locales = 'pt-BR',
159
- ...props
160
- }: InputNumberFormatProps) {
161
- return (
162
- <InputNumberFormat
163
- {...props}
164
- className={cx(
165
- className,
166
- 'peer text-size-body-md text-neutral-dark flex-1 font-medium outline-none',
167
- 'group-has-[div[data-slot=input-left-slot]]:pl-large-1x ml-small-1x'
168
- )}
169
- locales={locales}
170
- placeholder={props.placeholder || ' '}
171
- />
172
- )
173
- }
174
-
175
- export function InputLeftSlot({ className, ...props }: ComponentProps<'div'>) {
176
- return (
177
- <div
178
- {...props}
179
- className={cx(
180
- className,
181
- 'left-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center'
182
- )}
183
- data-slot="input-left-slot"
184
- />
185
- )
186
- }
187
-
188
- export function InputRightSlot({ className, ...props }: ComponentProps<'div'>) {
189
- return (
190
- <div
191
- {...props}
192
- className={cx(
193
- className,
194
- 'right-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center'
195
- )}
196
- data-slot="input-right-slot"
197
- />
198
- )
199
- }
200
-
201
- export function InputMessage({ className, ...props }: ComponentProps<'p'>) {
202
- return (
203
- <p
204
- {...props}
205
- className={cx(
206
- 'text-size-body-sm text-neutral-dark font-normal',
207
- className
208
- )}
209
- />
210
- )
211
- }
212
-
213
- export function InputContainer({ className, ...props }: ComponentProps<'div'>) {
214
- return (
215
- <div
216
- {...props}
217
- className={cx(className, 'flex items-center')}
218
- data-slot="input-content"
219
- />
220
- )
221
- }
222
-
223
- export function InputAction({
224
- className,
225
- side,
226
- ...props
227
- }: ComponentProps<'div'> & {
228
- side: 'left' | 'right'
229
- }) {
230
- return (
231
- <div
232
- {...props}
233
- className={cx(
234
- className,
235
- 'group h-large-4x flex items-center justify-center'
236
- )}
237
- data-side={side}
238
- data-slot={`input-${side}-action-slot`}
239
- />
240
- )
241
- }
242
-
243
- export function InputActionButton({
244
- className,
245
- ...props
246
- }: ComponentProps<'div'>) {
247
- return (
248
- <div
249
- {...props}
250
- className={cx(
251
- className,
252
- 'h-large-4x w-large-4x bg-layer-2-hover flex cursor-pointer items-center justify-center'
253
- )}
254
- />
255
- )
256
- }
@@ -1,240 +0,0 @@
1
- import type { ComponentProps } from 'react'
2
- import * as RadixPopover from '@radix-ui/react-popover'
3
- import { cx } from '@xjur-ui/util'
4
- import {
5
- ListContent,
6
- ListItem,
7
- ListRoot,
8
- ListHeader,
9
- ListHeaderTitle
10
- } from './list'
11
- import {
12
- SearchInputContent,
13
- SearchInputText,
14
- SearchInputRoot,
15
- SearchInputSlot
16
- } from './search-input'
17
- import { Icon } from './icon'
18
- import { Typography, type TypographyProps } from './typography'
19
-
20
- export function SelectRoot(props: ComponentProps<typeof RadixPopover.Root>) {
21
- return <RadixPopover.Root {...props} />
22
- }
23
-
24
- export function SelectTrigger({
25
- className,
26
- ...props
27
- }: ComponentProps<typeof RadixPopover.Trigger>) {
28
- return (
29
- <RadixPopover.Trigger
30
- className={cx(
31
- className,
32
- 'group h-large-4x rounded-small-1x gap-small py-small_1x-alt px-small relative flex w-full cursor-pointer items-center',
33
- 'bg-layer-2-idle border-border-layer-2 hover:border-border-layer-3 border',
34
- 'data-[state=open]:border-primary-idle',
35
- 'has-[input:not(:placeholder-shown)]:text-primary-idle',
36
- 'has-[input:not(:placeholder-shown)]:border-primary-idle'
37
- )}
38
- {...props}
39
- />
40
- )
41
- }
42
-
43
- export function SelectContent({
44
- className,
45
- children,
46
- sideOffset = 4,
47
- side = 'bottom',
48
- align = 'start',
49
- ...props
50
- }: ComponentProps<typeof RadixPopover.Content>) {
51
- return (
52
- <RadixPopover.Portal>
53
- <RadixPopover.Content
54
- align={align}
55
- className={cx(
56
- className,
57
- 'group z-10 max-h-[var(--radix-popover-content-available-height)] max-w-[var(--radix-popover-content-available-width)] min-w-[var(--radix-popover-trigger-width)]'
58
- )}
59
- side={side}
60
- sideOffset={sideOffset}
61
- {...props}
62
- >
63
- <ListRoot>{children}</ListRoot>
64
- </RadixPopover.Content>
65
- </RadixPopover.Portal>
66
- )
67
- }
68
-
69
- export function SelectValue({
70
- className,
71
- displayValue = '',
72
- ...props
73
- }: ComponentProps<'input'> & { displayValue?: string }) {
74
- return (
75
- <>
76
- {!!displayValue && (
77
- <Typography className="text-neutral-dark group-has-[div[data-slot=select-left-slot]]:pl-large-1x">
78
- {displayValue}
79
- </Typography>
80
- )}
81
-
82
- <input
83
- {...props}
84
- aria-readonly={true}
85
- className={cx(className, 'pointer-events-none')}
86
- hidden={true}
87
- placeholder={props.placeholder ?? ' '}
88
- readOnly={true}
89
- />
90
- </>
91
- )
92
- }
93
-
94
- export function SelectMultiValue({
95
- className,
96
- values,
97
- children,
98
- ...props
99
- }: ComponentProps<'div'> & { values: string[] }) {
100
- return (
101
- <div
102
- className={cx(
103
- className,
104
- 'gap-small-1x scrollbar-hide group-has-[div[data-slot=select-left-slot]]:pl-large-1x overflow-x-small flex'
105
- )}
106
- {...props}
107
- >
108
- {children}
109
-
110
- <input
111
- aria-readonly={true}
112
- className={cx(className, 'pointer-events-none')}
113
- hidden={true}
114
- placeholder={' '}
115
- readOnly={true}
116
- value={values.join(',')}
117
- />
118
- </div>
119
- )
120
- }
121
-
122
- export function SelectLabel({
123
- className,
124
- htmlFor,
125
- children,
126
- ...props
127
- }: TypographyProps & { htmlFor?: string }) {
128
- return (
129
- <Typography
130
- asChild={true}
131
- className={cx(
132
- 'inline-block max-w-full truncate text-left font-normal',
133
- 'left-small right-small pointer-events-none absolute top-1/2 -translate-y-1/2',
134
- 'ease transition-all duration-250',
135
- // Content Open
136
- 'group-data-[state=open]:text-primary-idle',
137
- 'group-data-[state=open]:-top-[3px]',
138
- 'group-data-[state=open]:text-size-label-sm-1x',
139
- 'group-data-[state=open]:font-medium',
140
- // Filled
141
- 'group-has-[input:not(:placeholder-shown)]:text-primary-idle',
142
- 'group-has-[input:not(:placeholder-shown)]:-top-[3px]',
143
- 'group-has-[input:not(:placeholder-shown)]:text-size-label-sm-1x',
144
- 'group-has-[input:not(:placeholder-shown)]:font-medium',
145
- // If has left slot
146
- 'group-has-[div[data-slot=select-left-slot]]:left-large-4x',
147
- 'group-has-[div[data-slot=select-left-slot]]:group-data-[state=open]:left-small',
148
- 'group-has-[div[data-slot=select-left-slot]]:group-has-[input:not(:placeholder-shown)]:left-small',
149
- // If has right slot
150
- 'group-has-[div[data-slot=select-right-slot]]:right-large-4x',
151
- 'group-has-[div[data-slot=select-right-slot]]:group-data-[state=open]:right-small',
152
- 'group-has-[div[data-slot=select-right-slot]]:group-has-[input:not(:placeholder-shown)]:right-small',
153
- // Animate
154
- 'group-data-[state=open]:animate-in',
155
- 'group-data-[state=closed]:animate-out',
156
- 'group-has-[input:not(:placeholder-shown)]:animate-out',
157
- className
158
- )}
159
- weight="medium"
160
- {...props}
161
- >
162
- <label htmlFor={htmlFor}>
163
- <span className="bg-layer-2-idle rounded-small-1x max-w-full">
164
- {children}
165
- </span>
166
- </label>
167
- </Typography>
168
- )
169
- }
170
-
171
- export function SelectOptions(props: ComponentProps<typeof ListContent>) {
172
- return <ListContent {...props} />
173
- }
174
-
175
- export function SelectOption({
176
- className,
177
- ...props
178
- }: ComponentProps<typeof ListItem>) {
179
- return <ListItem className={cx(className, 'cursor-pointer')} {...props} />
180
- }
181
-
182
- export function SelectOptionText(props: ComponentProps<typeof Typography>) {
183
- return <Typography {...props} />
184
- }
185
-
186
- export function SelectHeader(props: ComponentProps<typeof ListHeader>) {
187
- return <ListHeader {...props} />
188
- }
189
-
190
- export function SelectHeaderTitle(
191
- props: ComponentProps<typeof ListHeaderTitle>
192
- ) {
193
- return <ListHeaderTitle {...props} />
194
- }
195
-
196
- export function SelectDropdown(props: ComponentProps<'div'>) {
197
- return <div {...props} />
198
- }
199
-
200
- export function SelectLeftSlot({ className, ...props }: ComponentProps<'div'>) {
201
- return (
202
- <div
203
- {...props}
204
- className={cx(
205
- className,
206
- 'left-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center'
207
- )}
208
- data-slot="select-left-slot"
209
- />
210
- )
211
- }
212
-
213
- export function SelectRightSlot({
214
- className,
215
- ...props
216
- }: ComponentProps<'div'>) {
217
- return (
218
- <div
219
- {...props}
220
- className={cx(
221
- className,
222
- 'right-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center'
223
- )}
224
- data-slot="select-right-slot"
225
- />
226
- )
227
- }
228
-
229
- export function SelectSearch(props: ComponentProps<typeof SearchInputText>) {
230
- return (
231
- <SearchInputRoot variant="line">
232
- <SearchInputContent>
233
- <SearchInputSlot>
234
- <Icon className="text-icon-neutral-3" name="search" />
235
- </SearchInputSlot>
236
- <SearchInputText {...props} />
237
- </SearchInputContent>
238
- </SearchInputRoot>
239
- )
240
- }
@@ -1,3 +0,0 @@
1
- export function Test() {
2
- return <div>Test</div>
3
- }
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- import './index.css'
@@ -1,3 +0,0 @@
1
- export { Horizontal } from './horizontal'
2
- export { Vertical } from './vertical'
3
- export { Icon } from './icon'
File without changes
File without changes
File without changes