@archytechtor/ui 0.0.0-stage → 0.2.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 (479) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +105 -2
  3. package/dist/components/accordion/accordion.d.ts +25 -0
  4. package/dist/components/accordion/accordion.js +88 -0
  5. package/dist/components/accordion/index.d.ts +3 -0
  6. package/dist/components/accordion/index.js +1 -0
  7. package/dist/components/accordion/types.d.ts +39 -0
  8. package/dist/components/alert/alert.d.ts +25 -0
  9. package/dist/components/alert/alert.js +59 -0
  10. package/dist/components/alert/index.d.ts +3 -0
  11. package/dist/components/alert/index.js +3 -0
  12. package/dist/components/alert/types.d.ts +32 -0
  13. package/dist/components/alert/types.js +19 -0
  14. package/dist/components/alert-dialog/alert-dialog.d.ts +73 -0
  15. package/dist/components/alert-dialog/alert-dialog.js +170 -0
  16. package/dist/components/alert-dialog/index.d.ts +3 -0
  17. package/dist/components/alert-dialog/index.js +1 -0
  18. package/dist/components/alert-dialog/types.d.ts +80 -0
  19. package/dist/components/aspect-ratio/aspect-ratio.d.ts +8 -0
  20. package/dist/components/aspect-ratio/aspect-ratio.js +20 -0
  21. package/dist/components/aspect-ratio/index.d.ts +3 -0
  22. package/dist/components/aspect-ratio/index.js +1 -0
  23. package/dist/components/aspect-ratio/types.d.ts +8 -0
  24. package/dist/components/attachment/attachment.d.ts +57 -0
  25. package/dist/components/attachment/attachment.js +139 -0
  26. package/dist/components/attachment/index.d.ts +3 -0
  27. package/dist/components/attachment/index.js +3 -0
  28. package/dist/components/attachment/types.d.ts +79 -0
  29. package/dist/components/attachment/types.js +43 -0
  30. package/dist/components/avatar/avatar.d.ts +39 -0
  31. package/dist/components/avatar/avatar.js +88 -0
  32. package/dist/components/avatar/index.d.ts +3 -0
  33. package/dist/components/avatar/index.js +3 -0
  34. package/dist/components/avatar/types.d.ts +54 -0
  35. package/dist/components/avatar/types.js +21 -0
  36. package/dist/components/badge/badge.d.ts +7 -0
  37. package/dist/components/badge/badge.js +23 -0
  38. package/dist/components/badge/index.d.ts +3 -0
  39. package/dist/components/badge/index.js +3 -0
  40. package/dist/components/badge/types.d.ts +21 -0
  41. package/dist/components/badge/types.js +26 -0
  42. package/dist/components/bottom-nav/bottom-nav.d.ts +19 -0
  43. package/dist/components/bottom-nav/bottom-nav.js +59 -0
  44. package/dist/components/bottom-nav/index.d.ts +3 -0
  45. package/dist/components/bottom-nav/index.js +3 -0
  46. package/dist/components/bottom-nav/types.d.ts +45 -0
  47. package/dist/components/bottom-nav/types.js +44 -0
  48. package/dist/components/box/box.d.ts +7 -0
  49. package/dist/components/box/box.js +26 -0
  50. package/dist/components/box/index.d.ts +3 -0
  51. package/dist/components/box/index.js +3 -0
  52. package/dist/components/box/types.d.ts +23 -0
  53. package/dist/components/box/types.js +27 -0
  54. package/dist/components/breadcrumb/breadcrumb.d.ts +43 -0
  55. package/dist/components/breadcrumb/breadcrumb.js +115 -0
  56. package/dist/components/breadcrumb/index.d.ts +3 -0
  57. package/dist/components/breadcrumb/index.js +1 -0
  58. package/dist/components/breadcrumb/types.d.ts +36 -0
  59. package/dist/components/bubble/bubble.d.ts +25 -0
  60. package/dist/components/bubble/bubble.js +69 -0
  61. package/dist/components/bubble/index.d.ts +3 -0
  62. package/dist/components/bubble/index.js +3 -0
  63. package/dist/components/bubble/types.d.ts +51 -0
  64. package/dist/components/bubble/types.js +60 -0
  65. package/dist/components/button/button.d.ts +7 -0
  66. package/dist/components/button/button.js +155 -0
  67. package/dist/components/button/index.d.ts +4 -0
  68. package/dist/components/button/index.js +4 -0
  69. package/dist/components/button/types.d.ts +80 -0
  70. package/dist/components/button/types.js +99 -0
  71. package/dist/components/button/use-hold-to-confirm.d.ts +25 -0
  72. package/dist/components/button/use-hold-to-confirm.js +161 -0
  73. package/dist/components/button-group/button-group.d.ts +20 -0
  74. package/dist/components/button-group/button-group.js +62 -0
  75. package/dist/components/button-group/index.d.ts +3 -0
  76. package/dist/components/button-group/index.js +3 -0
  77. package/dist/components/button-group/types.d.ts +30 -0
  78. package/dist/components/button-group/types.js +19 -0
  79. package/dist/components/calendar/calendar.d.ts +15 -0
  80. package/dist/components/calendar/calendar.js +157 -0
  81. package/dist/components/calendar/index.d.ts +3 -0
  82. package/dist/components/calendar/index.js +1 -0
  83. package/dist/components/calendar/types.d.ts +21 -0
  84. package/dist/components/card/card.d.ts +43 -0
  85. package/dist/components/card/card.js +97 -0
  86. package/dist/components/card/index.d.ts +3 -0
  87. package/dist/components/card/index.js +3 -0
  88. package/dist/components/card/types.d.ts +44 -0
  89. package/dist/components/card/types.js +19 -0
  90. package/dist/components/carousel/carousel.d.ts +36 -0
  91. package/dist/components/carousel/carousel.js +190 -0
  92. package/dist/components/carousel/index.d.ts +3 -0
  93. package/dist/components/carousel/index.js +1 -0
  94. package/dist/components/carousel/types.d.ts +79 -0
  95. package/dist/components/chart/chart.d.ts +35 -0
  96. package/dist/components/chart/chart.js +212 -0
  97. package/dist/components/chart/index.d.ts +3 -0
  98. package/dist/components/chart/index.js +1 -0
  99. package/dist/components/chart/types.d.ts +89 -0
  100. package/dist/components/chart/types.js +7 -0
  101. package/dist/components/checkbox/checkbox.d.ts +7 -0
  102. package/dist/components/checkbox/checkbox.js +31 -0
  103. package/dist/components/checkbox/index.d.ts +3 -0
  104. package/dist/components/checkbox/index.js +1 -0
  105. package/dist/components/checkbox/types.d.ts +25 -0
  106. package/dist/components/code-block/code-block.d.ts +49 -0
  107. package/dist/components/code-block/code-block.js +188 -0
  108. package/dist/components/code-block/highlighter.d.ts +15 -0
  109. package/dist/components/code-block/highlighter.js +123 -0
  110. package/dist/components/code-block/index.d.ts +5 -0
  111. package/dist/components/code-block/index.js +5 -0
  112. package/dist/components/code-block/types.d.ts +94 -0
  113. package/dist/components/code-block/types.js +38 -0
  114. package/dist/components/code-block/use-highlighted-code.d.ts +9 -0
  115. package/dist/components/code-block/use-highlighted-code.js +67 -0
  116. package/dist/components/collapsible/collapsible.d.ts +19 -0
  117. package/dist/components/collapsible/collapsible.js +44 -0
  118. package/dist/components/collapsible/index.d.ts +3 -0
  119. package/dist/components/collapsible/index.js +1 -0
  120. package/dist/components/collapsible/types.d.ts +26 -0
  121. package/dist/components/combobox/combobox.d.ts +104 -0
  122. package/dist/components/combobox/combobox.js +365 -0
  123. package/dist/components/combobox/index.d.ts +3 -0
  124. package/dist/components/combobox/index.js +1 -0
  125. package/dist/components/combobox/types.d.ts +229 -0
  126. package/dist/components/command/command.d.ts +55 -0
  127. package/dist/components/command/command.js +179 -0
  128. package/dist/components/command/index.d.ts +3 -0
  129. package/dist/components/command/index.js +1 -0
  130. package/dist/components/command/types.d.ts +69 -0
  131. package/dist/components/context-menu/context-menu.d.ts +92 -0
  132. package/dist/components/context-menu/context-menu.js +270 -0
  133. package/dist/components/context-menu/index.d.ts +3 -0
  134. package/dist/components/context-menu/index.js +1 -0
  135. package/dist/components/context-menu/types.d.ts +138 -0
  136. package/dist/components/data-table/data-table-features.d.ts +21 -0
  137. package/dist/components/data-table/data-table-features.js +22 -0
  138. package/dist/components/data-table/data-table.d.ts +69 -0
  139. package/dist/components/data-table/data-table.js +283 -0
  140. package/dist/components/data-table/index.d.ts +4 -0
  141. package/dist/components/data-table/index.js +3 -0
  142. package/dist/components/data-table/types.d.ts +63 -0
  143. package/dist/components/date-input/date-input.d.ts +7 -0
  144. package/dist/components/date-input/date-input.js +147 -0
  145. package/dist/components/date-input/index.d.ts +3 -0
  146. package/dist/components/date-input/index.js +1 -0
  147. package/dist/components/date-input/types.d.ts +27 -0
  148. package/dist/components/date-picker/date-picker.d.ts +7 -0
  149. package/dist/components/date-picker/date-picker.js +74 -0
  150. package/dist/components/date-picker/index.d.ts +3 -0
  151. package/dist/components/date-picker/index.js +1 -0
  152. package/dist/components/date-picker/types.d.ts +38 -0
  153. package/dist/components/date-range-picker/date-range-picker.d.ts +7 -0
  154. package/dist/components/date-range-picker/date-range-picker.js +89 -0
  155. package/dist/components/date-range-picker/index.d.ts +3 -0
  156. package/dist/components/date-range-picker/index.js +1 -0
  157. package/dist/components/date-range-picker/types.d.ts +43 -0
  158. package/dist/components/dialog/dialog.d.ts +61 -0
  159. package/dist/components/dialog/dialog.js +160 -0
  160. package/dist/components/dialog/index.d.ts +3 -0
  161. package/dist/components/dialog/index.js +1 -0
  162. package/dist/components/dialog/types.d.ts +68 -0
  163. package/dist/components/drawer/drawer.d.ts +69 -0
  164. package/dist/components/drawer/drawer.js +245 -0
  165. package/dist/components/drawer/index.d.ts +3 -0
  166. package/dist/components/drawer/index.js +1 -0
  167. package/dist/components/drawer/types.d.ts +93 -0
  168. package/dist/components/dropdown-menu/dropdown-menu.d.ts +92 -0
  169. package/dist/components/dropdown-menu/dropdown-menu.js +268 -0
  170. package/dist/components/dropdown-menu/index.d.ts +3 -0
  171. package/dist/components/dropdown-menu/index.js +1 -0
  172. package/dist/components/dropdown-menu/types.d.ts +143 -0
  173. package/dist/components/empty/empty.d.ts +37 -0
  174. package/dist/components/empty/empty.js +84 -0
  175. package/dist/components/empty/index.d.ts +3 -0
  176. package/dist/components/empty/index.js +3 -0
  177. package/dist/components/empty/types.d.ts +39 -0
  178. package/dist/components/empty/types.js +13 -0
  179. package/dist/components/expanded-card/expanded-card.d.ts +43 -0
  180. package/dist/components/expanded-card/expanded-card.js +352 -0
  181. package/dist/components/expanded-card/index.d.ts +3 -0
  182. package/dist/components/expanded-card/index.js +1 -0
  183. package/dist/components/expanded-card/types.d.ts +52 -0
  184. package/dist/components/field/field.d.ts +62 -0
  185. package/dist/components/field/field.js +173 -0
  186. package/dist/components/field/index.d.ts +3 -0
  187. package/dist/components/field/index.js +3 -0
  188. package/dist/components/field/types.d.ts +81 -0
  189. package/dist/components/field/types.js +21 -0
  190. package/dist/components/form/form.d.ts +49 -0
  191. package/dist/components/form/form.js +136 -0
  192. package/dist/components/form/index.d.ts +3 -0
  193. package/dist/components/form/index.js +1 -0
  194. package/dist/components/form/types.d.ts +59 -0
  195. package/dist/components/grid/grid.d.ts +7 -0
  196. package/dist/components/grid/grid.js +36 -0
  197. package/dist/components/grid/index.d.ts +3 -0
  198. package/dist/components/grid/index.js +3 -0
  199. package/dist/components/grid/types.d.ts +35 -0
  200. package/dist/components/grid/types.js +102 -0
  201. package/dist/components/hover-card/hover-card.d.ts +19 -0
  202. package/dist/components/hover-card/hover-card.js +63 -0
  203. package/dist/components/hover-card/index.d.ts +3 -0
  204. package/dist/components/hover-card/index.js +1 -0
  205. package/dist/components/hover-card/types.d.ts +27 -0
  206. package/dist/components/image-gallery/image-gallery.d.ts +8 -0
  207. package/dist/components/image-gallery/image-gallery.js +294 -0
  208. package/dist/components/image-gallery/index.d.ts +4 -0
  209. package/dist/components/image-gallery/index.js +3 -0
  210. package/dist/components/image-gallery/masonry.d.ts +11 -0
  211. package/dist/components/image-gallery/masonry.js +62 -0
  212. package/dist/components/image-gallery/types.d.ts +80 -0
  213. package/dist/components/input/index.d.ts +3 -0
  214. package/dist/components/input/index.js +1 -0
  215. package/dist/components/input/input.d.ts +7 -0
  216. package/dist/components/input/input.js +18 -0
  217. package/dist/components/input/types.d.ts +28 -0
  218. package/dist/components/input-group/index.d.ts +3 -0
  219. package/dist/components/input-group/index.js +3 -0
  220. package/dist/components/input-group/input-group.d.ts +37 -0
  221. package/dist/components/input-group/input-group.js +103 -0
  222. package/dist/components/input-group/types.d.ts +64 -0
  223. package/dist/components/input-group/types.js +31 -0
  224. package/dist/components/input-otp/index.d.ts +3 -0
  225. package/dist/components/input-otp/index.js +1 -0
  226. package/dist/components/input-otp/input-otp.d.ts +25 -0
  227. package/dist/components/input-otp/input-otp.js +76 -0
  228. package/dist/components/input-otp/types.d.ts +43 -0
  229. package/dist/components/item/index.d.ts +3 -0
  230. package/dist/components/item/index.js +3 -0
  231. package/dist/components/item/item.d.ts +61 -0
  232. package/dist/components/item/item.js +149 -0
  233. package/dist/components/item/types.d.ts +75 -0
  234. package/dist/components/item/types.js +48 -0
  235. package/dist/components/kbd/index.d.ts +3 -0
  236. package/dist/components/kbd/index.js +1 -0
  237. package/dist/components/kbd/kbd.d.ts +13 -0
  238. package/dist/components/kbd/kbd.js +30 -0
  239. package/dist/components/kbd/types.d.ts +9 -0
  240. package/dist/components/label/index.d.ts +3 -0
  241. package/dist/components/label/index.js +1 -0
  242. package/dist/components/label/label.d.ts +7 -0
  243. package/dist/components/label/label.js +17 -0
  244. package/dist/components/label/types.d.ts +8 -0
  245. package/dist/components/loader/index.d.ts +3 -0
  246. package/dist/components/loader/index.js +3 -0
  247. package/dist/components/loader/loader.d.ts +8 -0
  248. package/dist/components/loader/loader.js +386 -0
  249. package/dist/components/loader/types.d.ts +27 -0
  250. package/dist/components/loader/types.js +58 -0
  251. package/dist/components/marker/index.d.ts +3 -0
  252. package/dist/components/marker/index.js +3 -0
  253. package/dist/components/marker/marker.d.ts +19 -0
  254. package/dist/components/marker/marker.js +51 -0
  255. package/dist/components/marker/types.d.ts +30 -0
  256. package/dist/components/marker/types.js +16 -0
  257. package/dist/components/menubar/index.d.ts +3 -0
  258. package/dist/components/menubar/index.js +1 -0
  259. package/dist/components/menubar/menubar.d.ts +98 -0
  260. package/dist/components/menubar/menubar.js +284 -0
  261. package/dist/components/menubar/types.d.ts +146 -0
  262. package/dist/components/message/index.d.ts +3 -0
  263. package/dist/components/message/index.js +1 -0
  264. package/dist/components/message/message.d.ts +37 -0
  265. package/dist/components/message/message.js +83 -0
  266. package/dist/components/message/types.d.ts +32 -0
  267. package/dist/components/message-scroller/index.d.ts +4 -0
  268. package/dist/components/message-scroller/index.js +3 -0
  269. package/dist/components/message-scroller/message-scroller-primitive.d.ts +21 -0
  270. package/dist/components/message-scroller/message-scroller-primitive.js +1349 -0
  271. package/dist/components/message-scroller/message-scroller.d.ts +39 -0
  272. package/dist/components/message-scroller/message-scroller.js +103 -0
  273. package/dist/components/message-scroller/types.d.ts +107 -0
  274. package/dist/components/money-input/index.d.ts +3 -0
  275. package/dist/components/money-input/index.js +1 -0
  276. package/dist/components/money-input/money-input.d.ts +7 -0
  277. package/dist/components/money-input/money-input.js +143 -0
  278. package/dist/components/money-input/types.d.ts +20 -0
  279. package/dist/components/morph-image/index.d.ts +3 -0
  280. package/dist/components/morph-image/index.js +3 -0
  281. package/dist/components/morph-image/morph-image.d.ts +8 -0
  282. package/dist/components/morph-image/morph-image.js +155 -0
  283. package/dist/components/morph-image/types.d.ts +38 -0
  284. package/dist/components/morph-image/types.js +18 -0
  285. package/dist/components/native-select/index.d.ts +3 -0
  286. package/dist/components/native-select/index.js +3 -0
  287. package/dist/components/native-select/native-select.d.ts +20 -0
  288. package/dist/components/native-select/native-select.js +57 -0
  289. package/dist/components/native-select/types.d.ts +52 -0
  290. package/dist/components/native-select/types.js +23 -0
  291. package/dist/components/navigation-menu/index.d.ts +3 -0
  292. package/dist/components/navigation-menu/index.js +3 -0
  293. package/dist/components/navigation-menu/navigation-menu.d.ts +50 -0
  294. package/dist/components/navigation-menu/navigation-menu.js +145 -0
  295. package/dist/components/navigation-menu/types.d.ts +79 -0
  296. package/dist/components/navigation-menu/types.js +15 -0
  297. package/dist/components/number-stepper/index.d.ts +3 -0
  298. package/dist/components/number-stepper/index.js +3 -0
  299. package/dist/components/number-stepper/number-stepper.d.ts +9 -0
  300. package/dist/components/number-stepper/number-stepper.js +223 -0
  301. package/dist/components/number-stepper/types.d.ts +47 -0
  302. package/dist/components/number-stepper/types.js +174 -0
  303. package/dist/components/pagination/index.d.ts +3 -0
  304. package/dist/components/pagination/index.js +1 -0
  305. package/dist/components/pagination/pagination.d.ts +43 -0
  306. package/dist/components/pagination/pagination.js +121 -0
  307. package/dist/components/pagination/types.d.ts +37 -0
  308. package/dist/components/phone-input/index.d.ts +3 -0
  309. package/dist/components/phone-input/index.js +1 -0
  310. package/dist/components/phone-input/phone-input.d.ts +7 -0
  311. package/dist/components/phone-input/phone-input.js +54 -0
  312. package/dist/components/phone-input/types.d.ts +12 -0
  313. package/dist/components/popover/index.d.ts +3 -0
  314. package/dist/components/popover/index.js +1 -0
  315. package/dist/components/popover/popover.d.ts +37 -0
  316. package/dist/components/popover/popover.js +100 -0
  317. package/dist/components/popover/types.d.ts +51 -0
  318. package/dist/components/progress/index.d.ts +3 -0
  319. package/dist/components/progress/index.js +1 -0
  320. package/dist/components/progress/progress.d.ts +32 -0
  321. package/dist/components/progress/progress.js +100 -0
  322. package/dist/components/progress/types.d.ts +31 -0
  323. package/dist/components/questionnaire/index.d.ts +3 -0
  324. package/dist/components/questionnaire/index.js +1 -0
  325. package/dist/components/questionnaire/questionnaire-primitive.js +1563 -0
  326. package/dist/components/questionnaire/questionnaire.d.ts +91 -0
  327. package/dist/components/questionnaire/questionnaire.js +315 -0
  328. package/dist/components/questionnaire/types.d.ts +203 -0
  329. package/dist/components/radio-group/index.d.ts +3 -0
  330. package/dist/components/radio-group/index.js +1 -0
  331. package/dist/components/radio-group/radio-group.d.ts +13 -0
  332. package/dist/components/radio-group/radio-group.js +44 -0
  333. package/dist/components/radio-group/types.d.ts +33 -0
  334. package/dist/components/reorder-list/index.d.ts +3 -0
  335. package/dist/components/reorder-list/index.js +1 -0
  336. package/dist/components/reorder-list/reorder-list.d.ts +19 -0
  337. package/dist/components/reorder-list/reorder-list.js +279 -0
  338. package/dist/components/reorder-list/types.d.ts +65 -0
  339. package/dist/components/resizable/index.d.ts +3 -0
  340. package/dist/components/resizable/index.js +1 -0
  341. package/dist/components/resizable/resizable.d.ts +19 -0
  342. package/dist/components/resizable/resizable.js +44 -0
  343. package/dist/components/resizable/types.d.ts +89 -0
  344. package/dist/components/scroll-area/index.d.ts +3 -0
  345. package/dist/components/scroll-area/index.js +1 -0
  346. package/dist/components/scroll-area/scroll-area.d.ts +13 -0
  347. package/dist/components/scroll-area/scroll-area.js +47 -0
  348. package/dist/components/scroll-area/types.d.ts +19 -0
  349. package/dist/components/select/index.d.ts +3 -0
  350. package/dist/components/select/index.js +1 -0
  351. package/dist/components/select/select.d.ts +61 -0
  352. package/dist/components/select/select.js +183 -0
  353. package/dist/components/select/types.d.ts +100 -0
  354. package/dist/components/separator/index.d.ts +3 -0
  355. package/dist/components/separator/index.js +1 -0
  356. package/dist/components/separator/separator.d.ts +7 -0
  357. package/dist/components/separator/separator.js +20 -0
  358. package/dist/components/separator/types.d.ts +9 -0
  359. package/dist/components/sheet/index.d.ts +3 -0
  360. package/dist/components/sheet/index.js +1 -0
  361. package/dist/components/sheet/sheet.d.ts +61 -0
  362. package/dist/components/sheet/sheet.js +155 -0
  363. package/dist/components/sheet/types.d.ts +69 -0
  364. package/dist/components/sidebar/index.d.ts +3 -0
  365. package/dist/components/sidebar/index.js +3 -0
  366. package/dist/components/sidebar/sidebar.d.ts +145 -0
  367. package/dist/components/sidebar/sidebar.js +550 -0
  368. package/dist/components/sidebar/types.d.ts +186 -0
  369. package/dist/components/sidebar/types.js +42 -0
  370. package/dist/components/sidebar/use-mobile.js +21 -0
  371. package/dist/components/skeleton/index.d.ts +3 -0
  372. package/dist/components/skeleton/index.js +1 -0
  373. package/dist/components/skeleton/skeleton.d.ts +8 -0
  374. package/dist/components/skeleton/skeleton.js +18 -0
  375. package/dist/components/skeleton/types.d.ts +5 -0
  376. package/dist/components/slider/index.d.ts +3 -0
  377. package/dist/components/slider/index.js +1 -0
  378. package/dist/components/slider/slider.d.ts +7 -0
  379. package/dist/components/slider/slider.js +106 -0
  380. package/dist/components/slider/types.d.ts +39 -0
  381. package/dist/components/spinner/index.d.ts +3 -0
  382. package/dist/components/spinner/index.js +1 -0
  383. package/dist/components/spinner/spinner.d.ts +7 -0
  384. package/dist/components/spinner/spinner.js +21 -0
  385. package/dist/components/spinner/types.d.ts +8 -0
  386. package/dist/components/stack/index.d.ts +3 -0
  387. package/dist/components/stack/index.js +3 -0
  388. package/dist/components/stack/stack.d.ts +7 -0
  389. package/dist/components/stack/stack.js +29 -0
  390. package/dist/components/stack/types.d.ts +56 -0
  391. package/dist/components/stack/types.js +62 -0
  392. package/dist/components/statistics/index.d.ts +3 -0
  393. package/dist/components/statistics/index.js +3 -0
  394. package/dist/components/statistics/statistics.d.ts +31 -0
  395. package/dist/components/statistics/statistics.js +141 -0
  396. package/dist/components/statistics/types.d.ts +84 -0
  397. package/dist/components/statistics/types.js +27 -0
  398. package/dist/components/switch/index.d.ts +3 -0
  399. package/dist/components/switch/index.js +3 -0
  400. package/dist/components/switch/switch.d.ts +7 -0
  401. package/dist/components/switch/switch.js +32 -0
  402. package/dist/components/switch/types.d.ts +37 -0
  403. package/dist/components/switch/types.js +23 -0
  404. package/dist/components/table/index.d.ts +3 -0
  405. package/dist/components/table/index.js +1 -0
  406. package/dist/components/table/table.d.ts +49 -0
  407. package/dist/components/table/table.js +112 -0
  408. package/dist/components/table/types.d.ts +33 -0
  409. package/dist/components/tabs/index.d.ts +3 -0
  410. package/dist/components/tabs/index.js +3 -0
  411. package/dist/components/tabs/tabs.d.ts +25 -0
  412. package/dist/components/tabs/tabs.js +81 -0
  413. package/dist/components/tabs/types.d.ts +61 -0
  414. package/dist/components/tabs/types.js +18 -0
  415. package/dist/components/textarea/index.d.ts +3 -0
  416. package/dist/components/textarea/index.js +1 -0
  417. package/dist/components/textarea/textarea.d.ts +7 -0
  418. package/dist/components/textarea/textarea.js +17 -0
  419. package/dist/components/textarea/types.d.ts +26 -0
  420. package/dist/components/toast/index.d.ts +3 -0
  421. package/dist/components/toast/index.js +1 -0
  422. package/dist/components/toast/toast.d.ts +63 -0
  423. package/dist/components/toast/toast.js +321 -0
  424. package/dist/components/toast/types.d.ts +120 -0
  425. package/dist/components/toggle/index.d.ts +3 -0
  426. package/dist/components/toggle/index.js +3 -0
  427. package/dist/components/toggle/toggle.d.ts +7 -0
  428. package/dist/components/toggle/toggle.js +32 -0
  429. package/dist/components/toggle/types.d.ts +35 -0
  430. package/dist/components/toggle/types.js +37 -0
  431. package/dist/components/toggle-group/index.d.ts +3 -0
  432. package/dist/components/toggle-group/index.js +1 -0
  433. package/dist/components/toggle-group/toggle-group.d.ts +13 -0
  434. package/dist/components/toggle-group/toggle-group.js +88 -0
  435. package/dist/components/toggle-group/types.d.ts +52 -0
  436. package/dist/components/tooltip/index.d.ts +3 -0
  437. package/dist/components/tooltip/index.js +1 -0
  438. package/dist/components/tooltip/tooltip.d.ts +25 -0
  439. package/dist/components/tooltip/tooltip.js +79 -0
  440. package/dist/components/tooltip/types.d.ts +48 -0
  441. package/dist/components/trace/index.d.ts +3 -0
  442. package/dist/components/trace/index.js +1 -0
  443. package/dist/components/trace/trace.d.ts +52 -0
  444. package/dist/components/trace/trace.js +132 -0
  445. package/dist/components/trace/types.d.ts +54 -0
  446. package/dist/components/typography/index.d.ts +3 -0
  447. package/dist/components/typography/index.js +3 -0
  448. package/dist/components/typography/types.d.ts +29 -0
  449. package/dist/components/typography/types.js +25 -0
  450. package/dist/components/typography/typography.d.ts +7 -0
  451. package/dist/components/typography/typography.js +40 -0
  452. package/dist/components/video-player/index.d.ts +6 -0
  453. package/dist/components/video-player/index.js +5 -0
  454. package/dist/components/video-player/types.d.ts +143 -0
  455. package/dist/components/video-player/use-video-player.js +319 -0
  456. package/dist/components/video-player/video-player-context.d.ts +45 -0
  457. package/dist/components/video-player/video-player-context.js +15 -0
  458. package/dist/components/video-player/video-player-controls.d.ts +38 -0
  459. package/dist/components/video-player/video-player-controls.js +226 -0
  460. package/dist/components/video-player/video-player-overlay.d.ts +13 -0
  461. package/dist/components/video-player/video-player-overlay.js +113 -0
  462. package/dist/components/video-player/video-player.d.ts +8 -0
  463. package/dist/components/video-player/video-player.js +139 -0
  464. package/dist/index.d.ts +259 -0
  465. package/dist/index.js +124 -0
  466. package/dist/lib/floating.d.ts +44 -0
  467. package/dist/lib/focus-source.js +51 -0
  468. package/dist/lib/format.d.ts +67 -0
  469. package/dist/lib/format.js +130 -0
  470. package/dist/lib/locale.d.ts +104 -0
  471. package/dist/lib/locale.js +103 -0
  472. package/dist/lib/part-props.d.ts +15 -0
  473. package/dist/lib/use-controllable-state.js +22 -0
  474. package/dist/lib/utils.d.ts +9 -0
  475. package/dist/lib/utils.js +16 -0
  476. package/dist/styles/index.css +128 -0
  477. package/dist/styles/theme.css +84 -0
  478. package/dist/styles/utilities.css +553 -0
  479. package/package.json +89 -3
@@ -0,0 +1,62 @@
1
+ import { cva } from "class-variance-authority";
2
+ // src/components/stack/types.ts
3
+ /**
4
+ * Отступы между элементами по шкале Tailwind: 4 → gap-4 (16px).
5
+ * Классы перечислены целиком, чтобы Tailwind потребителя их увидел.
6
+ */
7
+ const gapClasses = {
8
+ 0: "gap-0",
9
+ .5: "gap-0.5",
10
+ 1: "gap-1",
11
+ 1.5: "gap-1.5",
12
+ 2: "gap-2",
13
+ 2.5: "gap-2.5",
14
+ 3: "gap-3",
15
+ 4: "gap-4",
16
+ 5: "gap-5",
17
+ 6: "gap-6",
18
+ 8: "gap-8",
19
+ 10: "gap-10",
20
+ 12: "gap-12",
21
+ 16: "gap-16"
22
+ };
23
+ /**
24
+ * Стили стека: направление, отступ, выравнивание и перенос.
25
+ * Экспортируются, чтобы разложить стеком другой элемент: stackVariants({ direction: 'row' }).
26
+ */
27
+ const stackVariants = cva("flex", {
28
+ variants: {
29
+ direction: {
30
+ column: "flex-col",
31
+ row: "flex-row"
32
+ },
33
+ gap: gapClasses,
34
+ align: {
35
+ start: "items-start",
36
+ center: "items-center",
37
+ end: "items-end",
38
+ stretch: "items-stretch",
39
+ baseline: "items-baseline"
40
+ },
41
+ justify: {
42
+ start: "justify-start",
43
+ center: "justify-center",
44
+ end: "justify-end",
45
+ between: "justify-between",
46
+ around: "justify-around",
47
+ evenly: "justify-evenly"
48
+ },
49
+ wrap: {
50
+ true: "flex-wrap",
51
+ false: "flex-nowrap"
52
+ }
53
+ },
54
+ defaultVariants: {
55
+ direction: "column",
56
+ gap: 2,
57
+ align: "stretch",
58
+ justify: "start",
59
+ wrap: false
60
+ }
61
+ });
62
+ export { gapClasses, stackVariants };
@@ -0,0 +1,3 @@
1
+ import { StatisticsChangePropsT, StatisticsDescriptionPropsT, StatisticsFormatT, StatisticsLabelPropsT, StatisticsPropsT, StatisticsSignT, StatisticsToneT, StatisticsValuePropsT, statisticsToneVariants, statisticsVariants } from "./types.js";
2
+ import { Statistics, StatisticsChange, StatisticsDescription, StatisticsLabel, StatisticsValue } from "./statistics.js";
3
+ export { Statistics, StatisticsChange, type StatisticsChangePropsT, StatisticsDescription, type StatisticsDescriptionPropsT, type StatisticsFormatT, StatisticsLabel, type StatisticsLabelPropsT, type StatisticsPropsT, type StatisticsSignT, type StatisticsToneT, StatisticsValue, type StatisticsValuePropsT, statisticsToneVariants, statisticsVariants };
@@ -0,0 +1,3 @@
1
+ import { statisticsToneVariants, statisticsVariants } from "./types.js";
2
+ import { Statistics, StatisticsChange, StatisticsDescription, StatisticsLabel, StatisticsValue } from "./statistics.js";
3
+ export { Statistics, StatisticsChange, StatisticsDescription, StatisticsLabel, StatisticsValue, statisticsToneVariants, statisticsVariants };
@@ -0,0 +1,31 @@
1
+ import { StatisticsChangePropsT, StatisticsDescriptionPropsT, StatisticsLabelPropsT, StatisticsPropsT, StatisticsValuePropsT } from "./types.js";
2
+ /**
3
+ * Показатель: подпись, числовое значение, изменение и описание
4
+ * @param props - пропсы показателя
5
+ * @returns показатель
6
+ */
7
+ export declare function Statistics({ className, size, ...props }: StatisticsPropsT): import("react").JSX.Element;
8
+ /**
9
+ * Подпись показателя: что за число
10
+ * @param props - пропсы подписи
11
+ * @returns подпись
12
+ */
13
+ export declare function StatisticsLabel({ className, ...props }: StatisticsLabelPropsT): import("react").JSX.Element;
14
+ /**
15
+ * Значение показателя: число, деньги или проценты в русском формате
16
+ * @param props - пропсы значения
17
+ * @returns значение
18
+ */
19
+ export declare function StatisticsValue({ className, value, format, fractionDigits, currency, sign, tone, tabular, ...props }: StatisticsValuePropsT): import("react").JSX.Element;
20
+ /**
21
+ * Изменение показателя относительно прошлого периода: +12,5 % со стрелкой
22
+ * @param props - пропсы изменения
23
+ * @returns изменение
24
+ */
25
+ export declare function StatisticsChange({ className, value, format, fractionDigits, currency, sign, tone, tabular, icon, ...props }: StatisticsChangePropsT): import("react").JSX.Element;
26
+ /**
27
+ * Описание показателя: период, пояснение
28
+ * @param props - пропсы описания
29
+ * @returns описание
30
+ */
31
+ export declare function StatisticsDescription({ className, ...props }: StatisticsDescriptionPropsT): import("react").JSX.Element;
@@ -0,0 +1,141 @@
1
+ import { cn } from "../../lib/utils.js";
2
+ import { formatMoney, formatNumber } from "../../lib/format.js";
3
+ import { statisticsToneVariants, statisticsVariants } from "./types.js";
4
+ import { TrendingDownIcon, TrendingUpIcon } from "lucide-react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ // src/components/statistics/statistics.tsx
7
+ /** Минус как в типографике (U+2212), а не дефис */
8
+ const MINUS = "−";
9
+ /**
10
+ * Число без знака в нужном формате
11
+ * @param value - число без знака
12
+ * @param options - формат, знаки после запятой и валюта
13
+ * @returns строка числа
14
+ */
15
+ function formatAbsolute(value, options) {
16
+ const { format, fractionDigits, currency } = options;
17
+ if (format === "money") return formatMoney(value, {
18
+ fractionDigits,
19
+ currency
20
+ });
21
+ if (format === "percent") return formatNumber(value / 100, {
22
+ style: "percent",
23
+ minimumFractionDigits: fractionDigits ?? 0,
24
+ maximumFractionDigits: fractionDigits ?? 2
25
+ });
26
+ return formatNumber(value, {
27
+ minimumFractionDigits: fractionDigits,
28
+ maximumFractionDigits: fractionDigits
29
+ });
30
+ }
31
+ /**
32
+ * Отформатировать показатель со знаком: −1 234 ₽, +12,5 %
33
+ * @param value - число
34
+ * @param options - формат, знаки после запятой, валюта и знак
35
+ * @returns строка показателя
36
+ */
37
+ function formatStatistic(value, options) {
38
+ const text = formatAbsolute(Math.abs(value), options);
39
+ if (value < 0 && options.sign !== "never") return `${MINUS}${text}`;
40
+ if (value > 0 && options.sign === "always") return `+${text}`;
41
+ return text;
42
+ }
43
+ /**
44
+ * Тон по знаку числа для tone="auto"
45
+ * @param tone - заданный тон
46
+ * @param value - число
47
+ * @returns тон без auto
48
+ */
49
+ function resolveTone(tone, value) {
50
+ if (tone !== "auto") return tone;
51
+ if (value > 0) return "positive";
52
+ if (value < 0) return "negative";
53
+ return "muted";
54
+ }
55
+ /**
56
+ * Показатель: подпись, числовое значение, изменение и описание
57
+ * @param props - пропсы показателя
58
+ * @returns показатель
59
+ */
60
+ function Statistics({ className, size = "default", ...props }) {
61
+ const classes = cn(statisticsVariants({ size }), className);
62
+ return /* @__PURE__ */ jsx("div", {
63
+ "data-slot": "statistics",
64
+ "data-size": size,
65
+ className: classes,
66
+ ...props
67
+ });
68
+ }
69
+ /**
70
+ * Подпись показателя: что за число
71
+ * @param props - пропсы подписи
72
+ * @returns подпись
73
+ */
74
+ function StatisticsLabel({ className, ...props }) {
75
+ const classes = cn("text-sm", "text-muted-foreground", "group-data-[size=sm]/statistics:text-xs", className);
76
+ return /* @__PURE__ */ jsx("div", {
77
+ "data-slot": "statistics-label",
78
+ className: classes,
79
+ ...props
80
+ });
81
+ }
82
+ /**
83
+ * Значение показателя: число, деньги или проценты в русском формате
84
+ * @param props - пропсы значения
85
+ * @returns значение
86
+ */
87
+ function StatisticsValue({ className, value, format = "number", fractionDigits, currency, sign = "auto", tone = "neutral", tabular = true, ...props }) {
88
+ const resolvedTone = resolveTone(tone, value);
89
+ const text = formatStatistic(value, {
90
+ format,
91
+ fractionDigits,
92
+ currency,
93
+ sign
94
+ });
95
+ const classes = cn(statisticsToneVariants({ tone: resolvedTone }), "text-2xl", "leading-tight", "font-semibold", "tracking-tight", "whitespace-nowrap", "group-data-[size=sm]/statistics:text-lg", "group-data-[size=lg]/statistics:text-4xl", tabular && "tabular-nums", className);
96
+ return /* @__PURE__ */ jsx("div", {
97
+ "data-slot": "statistics-value",
98
+ "data-tone": resolvedTone,
99
+ className: classes,
100
+ ...props,
101
+ children: text
102
+ });
103
+ }
104
+ /**
105
+ * Изменение показателя относительно прошлого периода: +12,5 % со стрелкой
106
+ * @param props - пропсы изменения
107
+ * @returns изменение
108
+ */
109
+ function StatisticsChange({ className, value, format = "number", fractionDigits, currency, sign = "always", tone = "auto", tabular = true, icon = true, ...props }) {
110
+ const resolvedTone = resolveTone(tone, value);
111
+ const text = formatStatistic(value, {
112
+ format,
113
+ fractionDigits,
114
+ currency,
115
+ sign
116
+ });
117
+ const Icon = value < 0 ? TrendingDownIcon : TrendingUpIcon;
118
+ const hasIcon = icon && value !== 0;
119
+ const classes = cn(statisticsToneVariants({ tone: resolvedTone }), "inline-flex", "w-fit", "items-center", "gap-1", "text-sm", "font-medium", "whitespace-nowrap", "group-data-[size=sm]/statistics:text-xs", "[&_svg]:pointer-events-none", "[&_svg]:shrink-0", "[&_svg:not([class*=size-])]:size-4", "group-data-[size=sm]/statistics:[&_svg:not([class*=size-])]:size-3.5", tabular && "tabular-nums", className);
120
+ return /* @__PURE__ */ jsxs("div", {
121
+ "data-slot": "statistics-change",
122
+ "data-tone": resolvedTone,
123
+ className: classes,
124
+ ...props,
125
+ children: [hasIcon && /* @__PURE__ */ jsx(Icon, { "aria-hidden": true }), text]
126
+ });
127
+ }
128
+ /**
129
+ * Описание показателя: период, пояснение
130
+ * @param props - пропсы описания
131
+ * @returns описание
132
+ */
133
+ function StatisticsDescription({ className, ...props }) {
134
+ const classes = cn("text-sm", "text-muted-foreground", "group-data-[size=sm]/statistics:text-xs", className);
135
+ return /* @__PURE__ */ jsx("div", {
136
+ "data-slot": "statistics-description",
137
+ className: classes,
138
+ ...props
139
+ });
140
+ }
141
+ export { Statistics, StatisticsChange, StatisticsDescription, StatisticsLabel, StatisticsValue };
@@ -0,0 +1,84 @@
1
+ import { VariantProps } from "class-variance-authority";
2
+ import { ComponentProps } from "react";
3
+ /**
4
+ * Стили показателя: размер задаёт размер подписи, значения и изменения
5
+ */
6
+ export declare const statisticsVariants: (props?: ({
7
+ size?: "default" | "sm" | "lg" | null | undefined;
8
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
+ /**
10
+ * Стили тона: цвет значения или изменения.
11
+ * Экспортируются, чтобы покрасить в тон другой элемент: statisticsToneVariants({ tone: 'positive' }).
12
+ */
13
+ export declare const statisticsToneVariants: (props?: ({
14
+ tone?: "muted" | "neutral" | "positive" | "negative" | null | undefined;
15
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
16
+ /**
17
+ * Размеры показателя
18
+ */
19
+ export type StatisticsVariantsT = VariantProps<typeof statisticsVariants>;
20
+ /**
21
+ * Формат числа: number — 1 234,5, money — 1 234 ₽, percent — 12,5 %
22
+ */
23
+ export type StatisticsFormatT = 'number' | 'money' | 'percent';
24
+ /**
25
+ * Знак числа: auto — только минус, always — плюс и минус, never — без знака
26
+ */
27
+ export type StatisticsSignT = 'auto' | 'always' | 'never';
28
+ /**
29
+ * Тон: neutral — цвет текста, muted — приглушённый, positive — зелёный, negative — красный,
30
+ * auto — по знаку числа
31
+ */
32
+ export type StatisticsToneT = 'neutral' | 'muted' | 'positive' | 'negative' | 'auto';
33
+ /**
34
+ * Общие пропсы значения и изменения
35
+ */
36
+ type StatisticsNumberPropsT = Omit<ComponentProps<'div'>, 'children'> & {
37
+ /** Число. Для процентов — в процентах: 12.5 → 12,5 % */
38
+ value: number;
39
+ /** Формат: number — 1 234,5, money — 1 234 ₽, percent — 12,5 %. По умолчанию number */
40
+ format?: StatisticsFormatT;
41
+ /**
42
+ * Знаков после запятой. По умолчанию: у денег 0 для целых и 2 для дробных,
43
+ * у числа и процентов — сколько есть, но не больше 3 и 2
44
+ */
45
+ fractionDigits?: number;
46
+ /** Код валюты ISO 4217 для format="money", по умолчанию RUB */
47
+ currency?: string;
48
+ /** Знак: auto — только минус, always — плюс и минус, never — без знака */
49
+ sign?: StatisticsSignT;
50
+ /**
51
+ * Цвет: neutral — цвет текста, muted — приглушённый, positive — зелёный, negative — красный,
52
+ * auto — по знаку: больше нуля — зелёный, меньше — красный, ноль — приглушённый
53
+ */
54
+ tone?: StatisticsToneT;
55
+ /** Табличные цифры одной ширины: числа в столбик не скачут. По умолчанию включены */
56
+ tabular?: boolean;
57
+ };
58
+ /**
59
+ * Пропсы показателя
60
+ */
61
+ export type StatisticsPropsT = ComponentProps<'div'> & {
62
+ /** Размер: sm — компактный, default — обычный, lg — крупное значение */
63
+ size?: StatisticsVariantsT['size'];
64
+ };
65
+ /**
66
+ * Пропсы подписи показателя
67
+ */
68
+ export type StatisticsLabelPropsT = ComponentProps<'div'>;
69
+ /**
70
+ * Пропсы значения показателя. По умолчанию знак auto и тон neutral
71
+ */
72
+ export type StatisticsValuePropsT = StatisticsNumberPropsT;
73
+ /**
74
+ * Пропсы изменения показателя относительно прошлого периода. По умолчанию знак always и тон auto
75
+ */
76
+ export type StatisticsChangePropsT = StatisticsNumberPropsT & {
77
+ /** Стрелка вверх или вниз по знаку числа. По умолчанию показывается */
78
+ icon?: boolean;
79
+ };
80
+ /**
81
+ * Пропсы описания показателя
82
+ */
83
+ export type StatisticsDescriptionPropsT = ComponentProps<'div'>;
84
+ export {};
@@ -0,0 +1,27 @@
1
+ import { cva } from "class-variance-authority";
2
+ // src/components/statistics/types.ts
3
+ /**
4
+ * Стили показателя: размер задаёт размер подписи, значения и изменения
5
+ */
6
+ const statisticsVariants = cva("group/statistics flex flex-col gap-1", {
7
+ variants: { size: {
8
+ sm: "",
9
+ default: "",
10
+ lg: "gap-1.5"
11
+ } },
12
+ defaultVariants: { size: "default" }
13
+ });
14
+ /**
15
+ * Стили тона: цвет значения или изменения.
16
+ * Экспортируются, чтобы покрасить в тон другой элемент: statisticsToneVariants({ tone: 'positive' }).
17
+ */
18
+ const statisticsToneVariants = cva("", {
19
+ variants: { tone: {
20
+ neutral: "text-foreground",
21
+ muted: "text-muted-foreground",
22
+ positive: "text-success",
23
+ negative: "text-destructive"
24
+ } },
25
+ defaultVariants: { tone: "neutral" }
26
+ });
27
+ export { statisticsToneVariants, statisticsVariants };
@@ -0,0 +1,3 @@
1
+ import { SwitchPropsT, switchVariants } from "./types.js";
2
+ import { Switch } from "./switch.js";
3
+ export { Switch, type SwitchPropsT, switchVariants };
@@ -0,0 +1,3 @@
1
+ import { switchVariants } from "./types.js";
2
+ import { Switch } from "./switch.js";
3
+ export { Switch, switchVariants };
@@ -0,0 +1,7 @@
1
+ import { SwitchPropsT } from "./types.js";
2
+ /**
3
+ * Переключатель: включить или выключить настройку
4
+ * @param props - пропсы переключателя
5
+ * @returns элемент с role=switch
6
+ */
7
+ export declare function Switch({ className, size, onCheckedChange, ...props }: SwitchPropsT): import("react").JSX.Element;
@@ -0,0 +1,32 @@
1
+ "use client";
2
+ import { cn } from "../../lib/utils.js";
3
+ import { switchVariants } from "./types.js";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { Switch } from "@base-ui/react/switch";
6
+ // src/components/switch/switch.tsx
7
+ /**
8
+ * Переключатель: включить или выключить настройку
9
+ * @param props - пропсы переключателя
10
+ * @returns элемент с role=switch
11
+ */
12
+ function Switch$1({ className, size = "default", onCheckedChange, ...props }) {
13
+ const classes = cn(switchVariants({ size }), className);
14
+ const thumbClasses = cn("pointer-events-none", "block", "rounded-full", "bg-background", "ring-0", "transition-transform", "group-data-[size=default]/switch:size-4", "group-data-[size=sm]/switch:size-3", "data-checked:translate-x-[calc(100%-2px)]", "data-unchecked:translate-x-0", "dark:data-checked:bg-primary-foreground", "dark:data-unchecked:bg-foreground");
15
+ /**
16
+ * Переключатель переключили: наружу только состояние
17
+ * @param checked - включён ли
18
+ */
19
+ const handleCheckedChange = (checked) => onCheckedChange?.(checked);
20
+ return /* @__PURE__ */ jsx(Switch.Root, {
21
+ "data-slot": "switch",
22
+ "data-size": size,
23
+ className: classes,
24
+ onCheckedChange: handleCheckedChange,
25
+ ...props,
26
+ children: /* @__PURE__ */ jsx(Switch.Thumb, {
27
+ "data-slot": "switch-thumb",
28
+ className: thumbClasses
29
+ })
30
+ });
31
+ }
32
+ export { Switch$1 as Switch };
@@ -0,0 +1,37 @@
1
+ import { PartPropsT } from "../../lib/part-props.js";
2
+ import { VariantProps } from "class-variance-authority";
3
+ import { Switch } from "@base-ui/react/switch";
4
+ /**
5
+ * Стили переключателя: размер дорожки. Бегунок подстраивается под размер через data-size
6
+ */
7
+ export declare const switchVariants: (props?: ({
8
+ size?: "default" | "sm" | null | undefined;
9
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
10
+ /**
11
+ * Размеры переключателя
12
+ */
13
+ type SwitchVariantsT = VariantProps<typeof switchVariants>;
14
+ /**
15
+ * Пропсы переключателя
16
+ */
17
+ export type SwitchPropsT = PartPropsT<Omit<Switch.Root.Props, 'onCheckedChange' | 'children'>> & {
18
+ /** Размер: sm или default */
19
+ size?: SwitchVariantsT['size'];
20
+ /** Включён ли переключатель — контролируемый режим, вместе с onCheckedChange */
21
+ checked?: boolean;
22
+ /** Включён ли переключатель при первом рендере — неконтролируемый режим */
23
+ defaultChecked?: boolean;
24
+ /** Переключатель включили или выключили: новое состояние */
25
+ onCheckedChange?: (checked: boolean) => void;
26
+ /** Отключённое состояние: переключатель не переключается */
27
+ disabled?: boolean;
28
+ /** Обязательное поле: форма не отправится, пока переключатель выключен */
29
+ required?: boolean;
30
+ /** Имя поля при отправке формы */
31
+ name?: string;
32
+ /** Значение при отправке формы, по умолчанию on */
33
+ value?: string;
34
+ /** Ошибка: красная рамка и объявление скринридеру, что значение неверное */
35
+ 'aria-invalid'?: boolean;
36
+ };
37
+ export {};
@@ -0,0 +1,23 @@
1
+ import { cva } from "class-variance-authority";
2
+ // src/components/switch/types.ts
3
+ /**
4
+ * Стили переключателя: размер дорожки. Бегунок подстраивается под размер через data-size
5
+ */
6
+ const switchVariants = cva([
7
+ "peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent",
8
+ "transition-all outline-none",
9
+ "keyboard:group-has-[:focus-visible]/field-label:border-transparent keyboard:group-has-[:focus-visible]/field-label:ring-0",
10
+ "after:absolute after:-inset-x-3 after:-inset-y-2",
11
+ "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50",
12
+ "aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20",
13
+ "dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
14
+ "data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80",
15
+ "data-disabled:cursor-not-allowed data-disabled:opacity-50"
16
+ ], {
17
+ variants: { size: {
18
+ default: "h-[18.4px] w-[32px]",
19
+ sm: "h-[14px] w-[24px]"
20
+ } },
21
+ defaultVariants: { size: "default" }
22
+ });
23
+ export { switchVariants };
@@ -0,0 +1,3 @@
1
+ import { TableBodyPropsT, TableCaptionPropsT, TableCellPropsT, TableFooterPropsT, TableHeadPropsT, TableHeaderPropsT, TablePropsT, TableRowPropsT } from "./types.js";
2
+ import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from "./table.js";
3
+ export { Table, TableBody, type TableBodyPropsT, TableCaption, type TableCaptionPropsT, TableCell, type TableCellPropsT, TableFooter, type TableFooterPropsT, TableHead, type TableHeadPropsT, TableHeader, type TableHeaderPropsT, type TablePropsT, TableRow, type TableRowPropsT };
@@ -0,0 +1 @@
1
+ export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from "./table.js";
@@ -0,0 +1,49 @@
1
+ import { TableBodyPropsT, TableCaptionPropsT, TableCellPropsT, TableFooterPropsT, TableHeadPropsT, TableHeaderPropsT, TablePropsT, TableRowPropsT } from "./types.js";
2
+ /**
3
+ * Таблица: обёрнута в контейнер с горизонтальной прокруткой для узких экранов
4
+ * @param props - пропсы таблицы; className применяется к <table>
5
+ * @returns контейнер с таблицей
6
+ */
7
+ export declare function Table({ className, ...props }: TablePropsT): import("react").JSX.Element;
8
+ /**
9
+ * Шапка таблицы
10
+ * @param props - пропсы шапки
11
+ * @returns элемент <thead>
12
+ */
13
+ export declare function TableHeader({ className, ...props }: TableHeaderPropsT): import("react").JSX.Element;
14
+ /**
15
+ * Тело таблицы
16
+ * @param props - пропсы тела
17
+ * @returns элемент <tbody>
18
+ */
19
+ export declare function TableBody({ className, ...props }: TableBodyPropsT): import("react").JSX.Element;
20
+ /**
21
+ * Подвал таблицы: итоги
22
+ * @param props - пропсы подвала
23
+ * @returns элемент <tfoot>
24
+ */
25
+ export declare function TableFooter({ className, ...props }: TableFooterPropsT): import("react").JSX.Element;
26
+ /**
27
+ * Строка таблицы. Выбранная строка — data-state="selected"
28
+ * @param props - пропсы строки
29
+ * @returns элемент <tr>
30
+ */
31
+ export declare function TableRow({ className, ...props }: TableRowPropsT): import("react").JSX.Element;
32
+ /**
33
+ * Ячейка заголовка столбца
34
+ * @param props - пропсы ячейки
35
+ * @returns элемент <th>
36
+ */
37
+ export declare function TableHead({ className, ...props }: TableHeadPropsT): import("react").JSX.Element;
38
+ /**
39
+ * Ячейка таблицы
40
+ * @param props - пропсы ячейки
41
+ * @returns элемент <td>
42
+ */
43
+ export declare function TableCell({ className, ...props }: TableCellPropsT): import("react").JSX.Element;
44
+ /**
45
+ * Подпись таблицы: выводится под таблицей и объявляется скринридером как её название
46
+ * @param props - пропсы подписи
47
+ * @returns элемент <caption>
48
+ */
49
+ export declare function TableCaption({ className, ...props }: TableCaptionPropsT): import("react").JSX.Element;
@@ -0,0 +1,112 @@
1
+ import { cn } from "../../lib/utils.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ // src/components/table/table.tsx
4
+ /**
5
+ * Таблица: обёрнута в контейнер с горизонтальной прокруткой для узких экранов
6
+ * @param props - пропсы таблицы; className применяется к <table>
7
+ * @returns контейнер с таблицей
8
+ */
9
+ function Table({ className, ...props }) {
10
+ const classes = cn("w-full", "caption-bottom", "text-sm", className);
11
+ return /* @__PURE__ */ jsx("div", {
12
+ "data-slot": "table-container",
13
+ className: "relative w-full overflow-x-auto",
14
+ children: /* @__PURE__ */ jsx("table", {
15
+ "data-slot": "table",
16
+ className: classes,
17
+ ...props
18
+ })
19
+ });
20
+ }
21
+ /**
22
+ * Шапка таблицы
23
+ * @param props - пропсы шапки
24
+ * @returns элемент <thead>
25
+ */
26
+ function TableHeader({ className, ...props }) {
27
+ const classes = cn("[&_tr]:border-b", className);
28
+ return /* @__PURE__ */ jsx("thead", {
29
+ "data-slot": "table-header",
30
+ className: classes,
31
+ ...props
32
+ });
33
+ }
34
+ /**
35
+ * Тело таблицы
36
+ * @param props - пропсы тела
37
+ * @returns элемент <tbody>
38
+ */
39
+ function TableBody({ className, ...props }) {
40
+ const classes = cn("[&_tr:last-child]:border-0", className);
41
+ return /* @__PURE__ */ jsx("tbody", {
42
+ "data-slot": "table-body",
43
+ className: classes,
44
+ ...props
45
+ });
46
+ }
47
+ /**
48
+ * Подвал таблицы: итоги
49
+ * @param props - пропсы подвала
50
+ * @returns элемент <tfoot>
51
+ */
52
+ function TableFooter({ className, ...props }) {
53
+ const classes = cn("border-t", "bg-muted/50", "font-medium", "[&>tr]:last:border-b-0", className);
54
+ return /* @__PURE__ */ jsx("tfoot", {
55
+ "data-slot": "table-footer",
56
+ className: classes,
57
+ ...props
58
+ });
59
+ }
60
+ /**
61
+ * Строка таблицы. Выбранная строка — data-state="selected"
62
+ * @param props - пропсы строки
63
+ * @returns элемент <tr>
64
+ */
65
+ function TableRow({ className, ...props }) {
66
+ const classes = cn("border-b", "transition-colors", "hover:bg-muted/50", "has-aria-expanded:bg-muted/50", "data-[state=selected]:bg-muted", className);
67
+ return /* @__PURE__ */ jsx("tr", {
68
+ "data-slot": "table-row",
69
+ className: classes,
70
+ ...props
71
+ });
72
+ }
73
+ /**
74
+ * Ячейка заголовка столбца
75
+ * @param props - пропсы ячейки
76
+ * @returns элемент <th>
77
+ */
78
+ function TableHead({ className, ...props }) {
79
+ const classes = cn("h-10", "px-2", "text-left", "align-middle", "font-medium", "whitespace-nowrap", "text-foreground", "[&:has([role=checkbox])]:pr-0", className);
80
+ return /* @__PURE__ */ jsx("th", {
81
+ "data-slot": "table-head",
82
+ className: classes,
83
+ ...props
84
+ });
85
+ }
86
+ /**
87
+ * Ячейка таблицы
88
+ * @param props - пропсы ячейки
89
+ * @returns элемент <td>
90
+ */
91
+ function TableCell({ className, ...props }) {
92
+ const classes = cn("p-2", "align-middle", "whitespace-nowrap", "[&:has([role=checkbox])]:pr-0", className);
93
+ return /* @__PURE__ */ jsx("td", {
94
+ "data-slot": "table-cell",
95
+ className: classes,
96
+ ...props
97
+ });
98
+ }
99
+ /**
100
+ * Подпись таблицы: выводится под таблицей и объявляется скринридером как её название
101
+ * @param props - пропсы подписи
102
+ * @returns элемент <caption>
103
+ */
104
+ function TableCaption({ className, ...props }) {
105
+ const classes = cn("mt-4", "text-sm", "text-muted-foreground", className);
106
+ return /* @__PURE__ */ jsx("caption", {
107
+ "data-slot": "table-caption",
108
+ className: classes,
109
+ ...props
110
+ });
111
+ }
112
+ export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };