@indielayer/ui 1.3.0 → 1.4.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 (419) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +4 -4
  3. package/docs/App.vue +25 -0
  4. package/docs/assets/css/hljs.css +302 -0
  5. package/docs/assets/css/tailwind.css +46 -0
  6. package/docs/assets/images/error.svg +1 -0
  7. package/docs/assets/images/logo.png +0 -0
  8. package/docs/assets/images/logo_mini.svg +10 -0
  9. package/docs/assets/images/logo_white.png +0 -0
  10. package/docs/assets/images/logo_word.svg +12 -0
  11. package/docs/assets/images/logo_word_dark.svg +12 -0
  12. package/docs/assets/images/photo1.jpeg +0 -0
  13. package/docs/assets/images/photo2.jpeg +0 -0
  14. package/docs/components/Cookies.vue +42 -0
  15. package/docs/components/common/CodePreview.vue +80 -0
  16. package/docs/components/common/CodeSnippet.vue +49 -0
  17. package/docs/components/common/CopyButton.vue +50 -0
  18. package/docs/components/common/DocumentPage.vue +289 -0
  19. package/docs/components/common/Indielayer-theme.json +702 -0
  20. package/docs/components/common/MultiSnippet.vue +26 -0
  21. package/docs/components/menu/DocsMenu.vue +143 -0
  22. package/docs/components/toolbar/PreToolbar.vue +18 -0
  23. package/docs/components/toolbar/Toolbar.vue +63 -0
  24. package/docs/components/toolbar/ToolbarColorToggle.vue +49 -0
  25. package/docs/icons.ts +61 -0
  26. package/docs/layouts/default.vue +29 -0
  27. package/docs/layouts/simple.vue +3 -0
  28. package/docs/main.ts +33 -0
  29. package/docs/pages/colors.vue +125 -0
  30. package/docs/pages/component/accordion/index.vue +29 -0
  31. package/docs/pages/component/accordion/usage.vue +30 -0
  32. package/docs/pages/component/alert/index.vue +29 -0
  33. package/docs/pages/component/alert/usage.vue +18 -0
  34. package/docs/pages/component/avatar/index.vue +43 -0
  35. package/docs/pages/component/avatar/size.vue +9 -0
  36. package/docs/pages/component/avatar/usage.vue +9 -0
  37. package/docs/pages/component/avatar/variants.vue +8 -0
  38. package/docs/pages/component/badge/index.vue +29 -0
  39. package/docs/pages/component/badge/usage.vue +50 -0
  40. package/docs/pages/component/breadcrumbs/index.vue +29 -0
  41. package/docs/pages/component/breadcrumbs/usage.vue +19 -0
  42. package/docs/pages/component/button/button-group.vue +18 -0
  43. package/docs/pages/component/button/icons.vue +9 -0
  44. package/docs/pages/component/button/index.vue +64 -0
  45. package/docs/pages/component/button/size.vue +9 -0
  46. package/docs/pages/component/button/states.vue +6 -0
  47. package/docs/pages/component/button/usage.vue +12 -0
  48. package/docs/pages/component/button/variants.vue +7 -0
  49. package/docs/pages/component/card/index.vue +29 -0
  50. package/docs/pages/component/card/usage.vue +6 -0
  51. package/docs/pages/component/carousel/index.vue +29 -0
  52. package/docs/pages/component/carousel/usage.vue +10 -0
  53. package/docs/pages/component/checkbox/index.vue +50 -0
  54. package/docs/pages/component/checkbox/size.vue +9 -0
  55. package/docs/pages/component/checkbox/states.vue +9 -0
  56. package/docs/pages/component/checkbox/usage.vue +15 -0
  57. package/docs/pages/component/checkbox/variants.vue +8 -0
  58. package/docs/pages/component/container/index.vue +29 -0
  59. package/docs/pages/component/container/usage.vue +3 -0
  60. package/docs/pages/component/divider/index.vue +43 -0
  61. package/docs/pages/component/divider/label.vue +12 -0
  62. package/docs/pages/component/divider/usage.vue +7 -0
  63. package/docs/pages/component/divider/vertical.vue +7 -0
  64. package/docs/pages/component/drawer/index.vue +29 -0
  65. package/docs/pages/component/drawer/usage.vue +56 -0
  66. package/docs/pages/component/form/index.vue +29 -0
  67. package/docs/pages/component/form/usage.vue +96 -0
  68. package/docs/pages/component/formGroup/index.vue +29 -0
  69. package/docs/pages/component/formGroup/usage.vue +46 -0
  70. package/docs/pages/component/icon/index.vue +36 -0
  71. package/docs/pages/component/icon/usage.vue +6 -0
  72. package/docs/pages/component/icon/variants.vue +14 -0
  73. package/docs/pages/component/image/index.vue +29 -0
  74. package/docs/pages/component/image/usage.vue +8 -0
  75. package/docs/pages/component/input/index.vue +50 -0
  76. package/docs/pages/component/input/size.vue +13 -0
  77. package/docs/pages/component/input/states.vue +12 -0
  78. package/docs/pages/component/input/usage.vue +15 -0
  79. package/docs/pages/component/input/variants.vue +18 -0
  80. package/docs/pages/component/link/index.vue +29 -0
  81. package/docs/pages/component/link/usage.vue +12 -0
  82. package/docs/pages/component/loader/index.vue +29 -0
  83. package/docs/pages/component/loader/usage.vue +7 -0
  84. package/docs/pages/component/menu/index.vue +29 -0
  85. package/docs/pages/component/menu/usage.vue +69 -0
  86. package/docs/pages/component/modal/composed.vue +70 -0
  87. package/docs/pages/component/modal/index.vue +36 -0
  88. package/docs/pages/component/modal/usage.vue +61 -0
  89. package/docs/pages/component/notifications/index.vue +29 -0
  90. package/docs/pages/component/notifications/usage.vue +56 -0
  91. package/docs/pages/component/pagination/index.vue +29 -0
  92. package/docs/pages/component/pagination/usage.vue +17 -0
  93. package/docs/pages/component/popover/index.vue +29 -0
  94. package/docs/pages/component/popover/usage.vue +21 -0
  95. package/docs/pages/component/progress/index.vue +36 -0
  96. package/docs/pages/component/progress/usage.vue +7 -0
  97. package/docs/pages/component/progress/variants.vue +18 -0
  98. package/docs/pages/component/radio/index.vue +50 -0
  99. package/docs/pages/component/radio/size.vue +15 -0
  100. package/docs/pages/component/radio/states.vue +13 -0
  101. package/docs/pages/component/radio/usage.vue +14 -0
  102. package/docs/pages/component/radio/variants.vue +39 -0
  103. package/docs/pages/component/scroll/horizontal.vue +14 -0
  104. package/docs/pages/component/scroll/index.vue +36 -0
  105. package/docs/pages/component/scroll/usage.vue +5 -0
  106. package/docs/pages/component/select/index.vue +43 -0
  107. package/docs/pages/component/select/states.vue +22 -0
  108. package/docs/pages/component/select/usage.vue +45 -0
  109. package/docs/pages/component/select/variants.vue +23 -0
  110. package/docs/pages/component/skeleton/index.vue +29 -0
  111. package/docs/pages/component/skeleton/usage.vue +10 -0
  112. package/docs/pages/component/slider/index.vue +29 -0
  113. package/docs/pages/component/slider/usage.vue +15 -0
  114. package/docs/pages/component/spacer/index.vue +29 -0
  115. package/docs/pages/component/spacer/usage.vue +8 -0
  116. package/docs/pages/component/spinner/index.vue +36 -0
  117. package/docs/pages/component/spinner/usage.vue +3 -0
  118. package/docs/pages/component/spinner/variants.vue +9 -0
  119. package/docs/pages/component/stepper/index.vue +29 -0
  120. package/docs/pages/component/stepper/usage.vue +21 -0
  121. package/docs/pages/component/table/index.vue +36 -0
  122. package/docs/pages/component/table/states.vue +28 -0
  123. package/docs/pages/component/table/usage.vue +107 -0
  124. package/docs/pages/component/tabs/index.vue +29 -0
  125. package/docs/pages/component/tabs/usage.vue +137 -0
  126. package/docs/pages/component/tag/index.vue +29 -0
  127. package/docs/pages/component/tag/usage.vue +27 -0
  128. package/docs/pages/component/textarea/index.vue +43 -0
  129. package/docs/pages/component/textarea/states.vue +13 -0
  130. package/docs/pages/component/textarea/usage.vue +22 -0
  131. package/docs/pages/component/textarea/variants.vue +15 -0
  132. package/docs/pages/component/toggle/index.vue +43 -0
  133. package/docs/pages/component/toggle/states.vue +13 -0
  134. package/docs/pages/component/toggle/usage.vue +14 -0
  135. package/docs/pages/component/toggle/variants.vue +15 -0
  136. package/docs/pages/component/tooltip/index.vue +29 -0
  137. package/docs/pages/component/tooltip/usage.vue +16 -0
  138. package/docs/pages/error.vue +6 -0
  139. package/docs/pages/icons.vue +105 -0
  140. package/docs/pages/index.vue +157 -0
  141. package/docs/pages/play.vue +19 -0
  142. package/docs/pages/typography.vue +95 -0
  143. package/docs/router/index.ts +75 -0
  144. package/exports/tailwind.preset.js +1 -0
  145. package/lib/common/icons.d.ts +4 -1
  146. package/lib/common/icons.js +14 -11
  147. package/lib/components/accordion/Accordion.vue.d.ts +63 -0
  148. package/lib/components/accordion/Accordion.vue.js +40 -0
  149. package/lib/components/accordion/Accordion.vue2.js +4 -0
  150. package/lib/components/{collapse/Collapse.vue.d.ts → accordion/AccordionItem.vue.d.ts} +33 -18
  151. package/lib/components/accordion/AccordionItem.vue.js +140 -0
  152. package/lib/components/accordion/AccordionItem.vue2.js +4 -0
  153. package/lib/components/accordion/index.d.ts +4 -0
  154. package/lib/components/accordion/theme/Accordion.base.theme.d.ts +3 -0
  155. package/lib/components/accordion/theme/Accordion.base.theme.js +8 -0
  156. package/lib/components/accordion/theme/Accordion.carbon.theme.d.ts +3 -0
  157. package/lib/components/accordion/theme/Accordion.carbon.theme.js +5 -0
  158. package/lib/components/accordion/theme/AccordionItem.base.theme.d.ts +3 -0
  159. package/lib/components/accordion/theme/AccordionItem.base.theme.js +16 -0
  160. package/lib/components/accordion/theme/AccordionItem.carbon.theme.d.ts +3 -0
  161. package/lib/components/accordion/theme/AccordionItem.carbon.theme.js +5 -0
  162. package/lib/components/alert/theme/Alert.carbon.theme.js +39 -3
  163. package/lib/components/avatar/Avatar.vue.d.ts +2 -2
  164. package/lib/components/badge/Badge.vue.d.ts +2 -2
  165. package/lib/components/button/Button.vue.d.ts +3 -3
  166. package/lib/components/button/ButtonGroup.vue.d.ts +3 -3
  167. package/lib/components/button/theme/Button.carbon.theme.js +1 -1
  168. package/lib/components/carousel/CarouselSlide.vue.d.ts +19 -8
  169. package/lib/components/carousel/CarouselSlide.vue.js +2 -2
  170. package/lib/components/carousel/CarouselSlide.vue2.js +25 -18
  171. package/lib/components/checkbox/Checkbox.vue.d.ts +22 -10
  172. package/lib/components/checkbox/Checkbox.vue2.js +106 -72
  173. package/lib/components/checkbox/theme/Checkbox.base.theme.js +38 -31
  174. package/lib/components/checkbox/theme/Checkbox.carbon.theme.js +38 -31
  175. package/lib/components/container/Container.vue.d.ts +13 -0
  176. package/lib/components/container/Container.vue.js +15 -11
  177. package/lib/components/container/theme/Container.base.theme.js +7 -4
  178. package/lib/components/drawer/Drawer.vue.d.ts +4 -4
  179. package/lib/components/form/Form.vue.d.ts +25 -2
  180. package/lib/components/form/Form.vue.js +67 -36
  181. package/lib/components/form/theme/Form.base.theme.js +8 -4
  182. package/lib/components/form/theme/Form.carbon.theme.js +10 -3
  183. package/lib/components/formGroup/FormGroup.vue.d.ts +132 -0
  184. package/lib/components/formGroup/FormGroup.vue.js +82 -0
  185. package/lib/components/formGroup/FormGroup.vue2.js +4 -0
  186. package/lib/components/formGroup/__tests__/FormGroup.spec.d.ts +1 -0
  187. package/lib/components/formGroup/index.d.ts +2 -0
  188. package/lib/components/formGroup/theme/FormGroup.base.theme.d.ts +3 -0
  189. package/lib/components/formGroup/theme/FormGroup.base.theme.js +11 -0
  190. package/lib/components/formGroup/theme/FormGroup.carbon.theme.d.ts +3 -0
  191. package/lib/components/formGroup/theme/FormGroup.carbon.theme.js +11 -0
  192. package/lib/components/icon/theme/Icon.base.theme.js +1 -1
  193. package/lib/components/icon/theme/Icon.carbon.theme.js +4 -4
  194. package/lib/components/index.d.ts +3 -1
  195. package/lib/components/index.js +106 -100
  196. package/lib/components/input/Input.vue.d.ts +12 -9
  197. package/lib/components/input/Input.vue.js +39 -39
  198. package/lib/components/input/theme/Input.carbon.theme.js +1 -1
  199. package/lib/components/inputFooter/theme/InputFooter.base.theme.js +1 -1
  200. package/lib/components/inputFooter/theme/InputFooter.carbon.theme.js +1 -1
  201. package/lib/components/label/Label.vue.d.ts +3 -3
  202. package/lib/components/label/theme/Label.carbon.theme.js +7 -6
  203. package/lib/components/link/Link.vue.d.ts +1 -1
  204. package/lib/components/link/Link.vue.js +2 -2
  205. package/lib/components/link/Link.vue2.js +1 -1
  206. package/lib/components/link/theme/Link.base.theme.js +4 -4
  207. package/lib/components/link/theme/Link.carbon.theme.js +23 -3
  208. package/lib/components/loader/theme/Loader.carbon.theme.js +1 -1
  209. package/lib/components/menu/Menu.vue.d.ts +6 -5
  210. package/lib/components/menu/Menu.vue.js +43 -40
  211. package/lib/components/menu/MenuItem.vue.d.ts +4 -4
  212. package/lib/components/menu/MenuItem.vue.js +2 -2
  213. package/lib/components/menu/MenuItem.vue2.js +1 -1
  214. package/lib/components/menu/theme/MenuItem.base.theme.js +3 -3
  215. package/lib/components/modal/Modal.vue.d.ts +98 -3
  216. package/lib/components/modal/Modal.vue.js +153 -100
  217. package/lib/components/modal/theme/Modal.base.theme.js +15 -9
  218. package/lib/components/modal/theme/Modal.carbon.theme.js +27 -3
  219. package/lib/components/notifications/Notifications.vue.js +56 -53
  220. package/lib/components/notifications/theme/Notifications.base.theme.js +1 -1
  221. package/lib/components/notifications/theme/Notifications.carbon.theme.js +8 -3
  222. package/lib/components/popover/Popover.vue.d.ts +3 -3
  223. package/lib/components/radio/Radio.vue.d.ts +17 -12
  224. package/lib/components/radio/Radio.vue2.js +81 -66
  225. package/lib/components/radio/theme/Radio.base.theme.js +19 -16
  226. package/lib/components/radio/theme/Radio.carbon.theme.js +32 -29
  227. package/lib/components/select/Select.vue.d.ts +13 -10
  228. package/lib/components/select/Select.vue.js +115 -116
  229. package/lib/components/select/theme/Select.base.theme.js +10 -10
  230. package/lib/components/select/theme/Select.carbon.theme.js +5 -5
  231. package/lib/components/skeleton/Skeleton.vue.d.ts +19 -1
  232. package/lib/components/skeleton/Skeleton.vue.js +25 -15
  233. package/lib/components/skeleton/theme/Skeleton.base.theme.js +7 -4
  234. package/lib/components/slider/Slider.vue.d.ts +12 -6
  235. package/lib/components/slider/Slider.vue.js +3 -4
  236. package/lib/components/slider/theme/Slider.carbon.theme.js +4 -4
  237. package/lib/components/spinner/Spinner.vue.d.ts +1 -1
  238. package/lib/components/spinner/Spinner.vue.js +16 -17
  239. package/lib/components/stepper/Stepper.vue.d.ts +137 -0
  240. package/lib/components/stepper/Stepper.vue.js +128 -0
  241. package/lib/components/stepper/Stepper.vue2.js +4 -0
  242. package/lib/components/stepper/__tests__/Stepper.spec.d.ts +1 -0
  243. package/lib/components/stepper/index.d.ts +2 -0
  244. package/lib/components/stepper/theme/Stepper.base.theme.d.ts +3 -0
  245. package/lib/components/stepper/theme/Stepper.base.theme.js +20 -0
  246. package/lib/components/stepper/theme/Stepper.carbon.theme.d.ts +3 -0
  247. package/lib/components/{collapse/theme/Collapse.carbon.theme.js → stepper/theme/Stepper.carbon.theme.js} +1 -1
  248. package/lib/components/tab/Tab.vue.d.ts +11 -5
  249. package/lib/components/tab/Tab.vue.js +65 -50
  250. package/lib/components/tab/TabGroup.vue.d.ts +1 -1
  251. package/lib/components/tab/TabGroup.vue.js +5 -5
  252. package/lib/components/tab/theme/Tab.base.theme.js +2 -1
  253. package/lib/components/tab/theme/Tab.carbon.theme.js +6 -5
  254. package/lib/components/tab/theme/TabGroup.carbon.theme.js +28 -2
  255. package/lib/components/table/Table.vue.d.ts +115 -9
  256. package/lib/components/table/Table.vue.js +209 -98
  257. package/lib/components/table/TableCell.vue.d.ts +4 -5
  258. package/lib/components/table/TableCell.vue.js +21 -22
  259. package/lib/components/table/TableHead.vue.d.ts +16 -0
  260. package/lib/components/table/TableHead.vue.js +21 -0
  261. package/lib/components/table/TableHead.vue2.js +4 -0
  262. package/lib/components/table/TableHeader.vue.d.ts +4 -0
  263. package/lib/components/table/TableHeader.vue.js +45 -54
  264. package/lib/components/table/TableRow.vue.d.ts +15 -1
  265. package/lib/components/table/TableRow.vue.js +21 -25
  266. package/lib/components/table/index.d.ts +4 -2
  267. package/lib/components/table/theme/Table.base.theme.js +7 -6
  268. package/lib/components/table/theme/Table.carbon.theme.js +11 -3
  269. package/lib/components/table/theme/TableCell.base.theme.js +3 -3
  270. package/lib/components/table/theme/TableCell.carbon.theme.js +9 -3
  271. package/lib/components/table/theme/TableHead.base.theme.d.ts +3 -0
  272. package/lib/components/table/theme/TableHead.base.theme.js +9 -0
  273. package/lib/components/table/theme/TableHead.carbon.theme.d.ts +3 -0
  274. package/lib/components/table/theme/TableHead.carbon.theme.js +9 -0
  275. package/lib/components/table/theme/TableHeader.base.theme.d.ts +3 -0
  276. package/lib/components/table/theme/TableHeader.base.theme.js +12 -0
  277. package/lib/components/table/theme/TableHeader.carbon.theme.d.ts +3 -0
  278. package/lib/components/table/theme/TableHeader.carbon.theme.js +12 -0
  279. package/lib/components/table/theme/TableRow.base.theme.d.ts +3 -0
  280. package/lib/components/table/theme/TableRow.base.theme.js +11 -0
  281. package/lib/components/table/theme/TableRow.carbon.theme.d.ts +3 -0
  282. package/lib/components/table/theme/TableRow.carbon.theme.js +11 -0
  283. package/lib/components/tag/Tag.vue.d.ts +3 -3
  284. package/lib/components/tag/Tag.vue.js +17 -17
  285. package/lib/components/tag/theme/Tag.base.theme.js +14 -13
  286. package/lib/components/tag/theme/Tag.carbon.theme.js +14 -14
  287. package/lib/components/textarea/Textarea.vue.d.ts +11 -8
  288. package/lib/components/textarea/Textarea.vue.js +34 -34
  289. package/lib/components/textarea/theme/Textarea.carbon.theme.js +1 -1
  290. package/lib/components/toggle/Toggle.vue.d.ts +12 -12
  291. package/lib/components/toggle/Toggle.vue.js +37 -39
  292. package/lib/composables/keys.d.ts +5 -1
  293. package/lib/composables/keys.js +8 -6
  294. package/lib/composables/useFocusTrap.d.ts +6 -0
  295. package/lib/composables/useFocusTrap.js +45 -0
  296. package/lib/composables/useInputtable.d.ts +6 -0
  297. package/lib/composables/useInputtable.js +59 -42
  298. package/lib/index.js +137 -129
  299. package/lib/index.umd.js +3 -3
  300. package/lib/nuxt.mjs +33 -0
  301. package/lib/nuxt.plugin.js +8 -0
  302. package/lib/tailwind.preset.js +41 -0
  303. package/lib/theme.d.ts +8 -2
  304. package/lib/themes/base/components.d.ts +7 -1
  305. package/lib/themes/base/components.js +98 -86
  306. package/lib/themes/carbon/components.d.ts +7 -1
  307. package/lib/themes/carbon/components.js +98 -86
  308. package/lib/version.d.ts +1 -1
  309. package/lib/version.js +1 -1
  310. package/package.json +7 -2
  311. package/src/common/icons.ts +4 -1
  312. package/src/components/accordion/Accordion.vue +55 -0
  313. package/src/components/{collapse/Collapse.vue → accordion/AccordionItem.vue} +51 -32
  314. package/src/components/accordion/__tests__/Accordion.spec.ts +11 -0
  315. package/src/components/accordion/index.ts +4 -0
  316. package/src/components/accordion/theme/Accordion.base.theme.ts +9 -0
  317. package/src/components/accordion/theme/Accordion.carbon.theme.ts +7 -0
  318. package/src/components/accordion/theme/AccordionItem.base.theme.ts +38 -0
  319. package/src/components/accordion/theme/AccordionItem.carbon.theme.ts +7 -0
  320. package/src/components/alert/theme/Alert.carbon.theme.ts +54 -2
  321. package/src/components/button/theme/Button.carbon.theme.ts +1 -1
  322. package/src/components/carousel/CarouselSlide.vue +9 -4
  323. package/src/components/checkbox/Checkbox.vue +69 -20
  324. package/src/components/checkbox/theme/Checkbox.base.theme.ts +15 -1
  325. package/src/components/checkbox/theme/Checkbox.carbon.theme.ts +17 -3
  326. package/src/components/container/Container.vue +4 -0
  327. package/src/components/container/theme/Container.base.theme.ts +7 -1
  328. package/src/components/form/Form.vue +26 -5
  329. package/src/components/form/theme/Form.base.theme.ts +9 -1
  330. package/src/components/form/theme/Form.carbon.theme.ts +12 -2
  331. package/src/components/formGroup/FormGroup.vue +116 -0
  332. package/src/components/formGroup/__tests__/FormGroup.spec.ts +11 -0
  333. package/src/components/formGroup/index.ts +2 -0
  334. package/src/components/formGroup/theme/FormGroup.base.theme.ts +16 -0
  335. package/src/components/formGroup/theme/FormGroup.carbon.theme.ts +16 -0
  336. package/src/components/icon/theme/Icon.base.theme.ts +1 -1
  337. package/src/components/icon/theme/Icon.carbon.theme.ts +3 -4
  338. package/src/components/index.ts +3 -1
  339. package/src/components/input/Input.vue +3 -3
  340. package/src/components/input/theme/Input.carbon.theme.ts +1 -1
  341. package/src/components/inputFooter/theme/InputFooter.base.theme.ts +1 -1
  342. package/src/components/inputFooter/theme/InputFooter.carbon.theme.ts +1 -1
  343. package/src/components/label/theme/Label.carbon.theme.ts +8 -3
  344. package/src/components/link/Link.vue +1 -1
  345. package/src/components/link/theme/Link.carbon.theme.ts +23 -2
  346. package/src/components/loader/theme/Loader.carbon.theme.ts +1 -1
  347. package/src/components/menu/Menu.vue +8 -5
  348. package/src/components/menu/MenuItem.vue +1 -1
  349. package/src/components/menu/theme/MenuItem.base.theme.ts +3 -3
  350. package/src/components/modal/Modal.vue +110 -50
  351. package/src/components/modal/theme/Modal.base.theme.ts +28 -12
  352. package/src/components/modal/theme/Modal.carbon.theme.ts +55 -2
  353. package/src/components/notifications/Notifications.vue +5 -5
  354. package/src/components/notifications/theme/Notifications.base.theme.ts +1 -1
  355. package/src/components/notifications/theme/Notifications.carbon.theme.ts +12 -2
  356. package/src/components/radio/Radio.vue +39 -15
  357. package/src/components/radio/theme/Radio.base.theme.ts +7 -1
  358. package/src/components/radio/theme/Radio.carbon.theme.ts +13 -7
  359. package/src/components/select/Select.vue +10 -11
  360. package/src/components/select/theme/Select.base.theme.ts +1 -1
  361. package/src/components/select/theme/Select.carbon.theme.ts +2 -2
  362. package/src/components/skeleton/Skeleton.vue +18 -2
  363. package/src/components/skeleton/theme/Skeleton.base.theme.ts +8 -1
  364. package/src/components/slider/Slider.vue +1 -2
  365. package/src/components/slider/theme/Slider.carbon.theme.ts +1 -1
  366. package/src/components/spinner/Spinner.vue +2 -2
  367. package/src/components/stepper/Stepper.vue +153 -0
  368. package/src/components/{collapse/__tests__/Collapse.spec.ts → stepper/__tests__/Stepper.spec.ts} +3 -3
  369. package/src/components/stepper/index.ts +6 -0
  370. package/src/components/stepper/theme/Stepper.base.theme.ts +45 -0
  371. package/src/components/stepper/theme/Stepper.carbon.theme.ts +7 -0
  372. package/src/components/tab/Tab.vue +20 -6
  373. package/src/components/tab/TabGroup.vue +2 -2
  374. package/src/components/tab/theme/Tab.base.theme.ts +2 -0
  375. package/src/components/tab/theme/Tab.carbon.theme.ts +4 -2
  376. package/src/components/tab/theme/TabGroup.carbon.theme.ts +50 -2
  377. package/src/components/table/Table.vue +123 -27
  378. package/src/components/table/TableCell.vue +5 -6
  379. package/src/components/table/TableHead.vue +25 -0
  380. package/src/components/table/TableHeader.vue +35 -56
  381. package/src/components/table/TableRow.vue +19 -17
  382. package/src/components/table/index.ts +4 -2
  383. package/src/components/table/theme/Table.base.theme.ts +9 -7
  384. package/src/components/table/theme/Table.carbon.theme.ts +18 -2
  385. package/src/components/table/theme/TableCell.base.theme.ts +1 -1
  386. package/src/components/table/theme/TableCell.carbon.theme.ts +24 -2
  387. package/src/components/table/theme/TableHead.base.theme.ts +10 -0
  388. package/src/components/table/theme/TableHead.carbon.theme.ts +10 -0
  389. package/src/components/table/theme/TableHeader.base.theme.ts +28 -0
  390. package/src/components/table/theme/TableHeader.carbon.theme.ts +28 -0
  391. package/src/components/table/theme/TableRow.base.theme.ts +21 -0
  392. package/src/components/table/theme/TableRow.carbon.theme.ts +21 -0
  393. package/src/components/tag/Tag.vue +4 -4
  394. package/src/components/tag/theme/Tag.base.theme.ts +4 -4
  395. package/src/components/tag/theme/Tag.carbon.theme.ts +5 -6
  396. package/src/components/textarea/Textarea.vue +3 -3
  397. package/src/components/textarea/theme/Textarea.carbon.theme.ts +1 -1
  398. package/src/components/toggle/Toggle.vue +2 -4
  399. package/src/composables/keys.ts +5 -1
  400. package/src/composables/useFocusTrap.ts +106 -0
  401. package/src/composables/useInputtable.ts +31 -3
  402. package/src/theme.ts +14 -2
  403. package/src/themes/base/components.ts +7 -1
  404. package/src/themes/carbon/components.ts +7 -1
  405. package/src/version.ts +1 -1
  406. package/volar.d.ts +5 -1
  407. package/lib/components/collapse/Collapse.vue.js +0 -131
  408. package/lib/components/collapse/Collapse.vue2.js +0 -4
  409. package/lib/components/collapse/index.d.ts +0 -2
  410. package/lib/components/collapse/theme/Collapse.base.theme.d.ts +0 -3
  411. package/lib/components/collapse/theme/Collapse.base.theme.js +0 -10
  412. package/lib/components/collapse/theme/Collapse.carbon.theme.d.ts +0 -3
  413. package/lib/components/table/TableHead.d.ts +0 -2
  414. package/lib/components/table/TableHead.js +0 -19
  415. package/src/components/collapse/index.ts +0 -2
  416. package/src/components/collapse/theme/Collapse.base.theme.ts +0 -13
  417. package/src/components/collapse/theme/Collapse.carbon.theme.ts +0 -7
  418. package/src/components/table/TableHead.tsx +0 -14
  419. /package/lib/components/{collapse/__tests__/Collapse.spec.d.ts → accordion/__tests__/Accordion.spec.d.ts} +0 -0
@@ -1,12 +1,14 @@
1
- import { defineComponent as N, openBlock as s, createElementBlock as a, createElementVNode as x, normalizeStyle as H, unref as i, normalizeClass as g, createVNode as f, withCtx as u, Fragment as d, renderList as c, createBlock as m, createTextVNode as v, toDisplayString as b, renderSlot as S, createCommentVNode as V } from "vue";
2
- import { useTheme as z } from "../../composables/useTheme.js";
3
- import X from "./TableHead.js";
4
- import E from "./TableHeader.vue.js";
5
- import h from "./TableBody.js";
6
- import D from "./TableRow.vue.js";
7
- import F from "./TableCell.vue.js";
8
- import I from "../spinner/Spinner.vue.js";
9
- const L = { class: "w-full overflow-x-auto" }, P = {
1
+ import { defineComponent as J, ref as X, watch as F, resolveComponent as O, openBlock as n, createElementBlock as i, normalizeClass as p, unref as c, renderSlot as d, createElementVNode as f, normalizeStyle as P, createVNode as m, withCtx as u, createBlock as y, createCommentVNode as b, Fragment as k, renderList as v, createTextVNode as C, toDisplayString as N } from "vue";
2
+ import { useTheme as W } from "../../composables/useTheme.js";
3
+ import q from "./TableHead.vue.js";
4
+ import S from "./TableHeader.vue.js";
5
+ import G from "./TableBody.js";
6
+ import z from "./TableRow.vue.js";
7
+ import _ from "./TableCell.vue.js";
8
+ import K from "../spinner/Spinner.vue.js";
9
+ import M from "../skeleton/Skeleton.vue.js";
10
+ import { chevronDownIcon as Q } from "../../common/icons.js";
11
+ const R = { key: 1 }, U = ["colspan"], Y = { key: 2 }, Z = ["colspan"], j = ["onClick"], x = { key: 0 }, ee = { colspan: "999" }, te = {
10
12
  headers: {
11
13
  type: Array,
12
14
  default: () => []
@@ -20,6 +22,12 @@ const L = { class: "w-full overflow-x-auto" }, P = {
20
22
  default: () => []
21
23
  },
22
24
  loading: Boolean,
25
+ loadingSkeleton: Boolean,
26
+ loadingLines: {
27
+ type: [Number, String],
28
+ default: 3
29
+ },
30
+ error: Boolean,
23
31
  dense: Boolean,
24
32
  fixed: Boolean,
25
33
  striped: Boolean,
@@ -31,116 +39,219 @@ const L = { class: "w-full overflow-x-auto" }, P = {
31
39
  stickyHeader: {
32
40
  type: Boolean,
33
41
  default: !0
34
- }
35
- }, W = { name: "XTable" }, Y = /* @__PURE__ */ N({
36
- ...W,
42
+ },
43
+ expandable: Boolean
44
+ }, ne = { name: "XTable" }, fe = /* @__PURE__ */ J({
45
+ ...ne,
37
46
  props: {
38
- ...P,
47
+ ...te,
39
48
  items: {
40
49
  type: Array,
41
50
  default: () => []
42
51
  }
43
52
  },
44
53
  emits: ["update:sort", "click-row"],
45
- setup(p, { emit: B }) {
46
- const y = p, $ = B;
47
- function _(t, r) {
48
- if (t)
49
- for (let e = 0; e < r.length; e++) {
50
- const { 0: l, 1: o } = r[e].split(",");
51
- if (t === l)
54
+ setup(h, { emit: A }) {
55
+ const $ = h;
56
+ function T(e) {
57
+ try {
58
+ return JSON.parse(JSON.stringify(e));
59
+ } catch {
60
+ return [];
61
+ }
62
+ }
63
+ const g = X([]);
64
+ F(() => $.items, (e) => {
65
+ $.expandable && (g.value = T(e));
66
+ }, { immediate: !0 });
67
+ const H = A;
68
+ function V(e, l) {
69
+ if (e)
70
+ for (let r = 0; r < l.length; r++) {
71
+ const { 0: t, 1: o } = l[r].split(",");
72
+ if (e === t)
52
73
  return parseInt(o) > 0 ? 1 : -1;
53
74
  }
54
75
  }
55
- function w(t) {
56
- const r = y.sort.slice(0);
57
- let e = !1;
58
- for (let l = 0; l < r.length; l++) {
59
- const { 0: o, 1: n } = r[l].split(",");
60
- if (o === t.value) {
61
- if (e = !0, n === "-1") {
62
- r.splice(l, 1, `${t.value},1`);
76
+ function I(e) {
77
+ const l = $.sort.slice(0);
78
+ let r = !1;
79
+ for (let t = 0; t < l.length; t++) {
80
+ const { 0: o, 1: s } = l[t].split(",");
81
+ if (o === e.value) {
82
+ if (r = !0, s === "-1") {
83
+ l.splice(t, 1, `${e.value},1`);
63
84
  break;
64
- } else if (n === "1") {
65
- r.splice(l, 1);
85
+ } else if (s === "1") {
86
+ l.splice(t, 1);
66
87
  break;
67
88
  }
68
89
  }
69
90
  }
70
- e || r.push(`${t.value},-1`), $("update:sort", r);
91
+ r || l.push(`${e.value},-1`), H("update:sort", l);
71
92
  }
72
- function C(t, r) {
73
- if (!r)
93
+ function L(e, l) {
94
+ if (!l)
74
95
  return "";
75
- const e = Array.isArray(r) ? r : r.match(/([^[.\]])+/g);
76
- return (e == null ? void 0 : e.reduce((o, n) => o && o[n], t)) ?? "";
96
+ const r = Array.isArray(l) ? l : l.match(/([^[.\]])+/g);
97
+ return (r == null ? void 0 : r.reduce((o, s) => o && o[s], e)) ?? "";
77
98
  }
78
- const { styles: T, classes: k, className: A } = z("Table", {}, y);
79
- return (t, r) => (s(), a("div", L, [
80
- x("table", {
81
- style: H(i(T)),
82
- class: g([
83
- i(A),
84
- i(k).wrapper
85
- ])
99
+ const { styles: D, classes: w, className: E } = W("Table", {}, $);
100
+ return (e, l) => {
101
+ const r = O("x-icon");
102
+ return n(), i("div", {
103
+ class: p([c(E), c(w).wrapper])
86
104
  }, [
87
- f(i(X), null, {
88
- default: u(() => [
89
- (s(!0), a(d, null, c(t.headers, (e, l) => (s(), m(E, {
90
- key: l,
91
- "sticky-header": t.stickyHeader,
92
- "text-align": e.align,
93
- sort: _(e.value, t.sort),
94
- sortable: e.sortable,
95
- width: e.width,
96
- onClick: (o) => e.sortable ? w(e) : null
97
- }, {
98
- default: u(() => [
99
- v(b(e.text), 1)
100
- ]),
101
- _: 2
102
- }, 1032, ["sticky-header", "text-align", "sort", "sortable", "width", "onClick"]))), 128))
103
- ]),
104
- _: 1
105
- }),
106
- f(i(h), null, {
107
- default: u(() => [
108
- (s(!0), a(d, null, c(p.items, (e, l) => (s(), m(D, {
109
- key: l,
110
- pointer: t.pointer,
111
- striped: t.striped,
112
- onClick: (o) => t.$emit("click-row", e)
113
- }, {
114
- default: u(() => [
115
- (s(!0), a(d, null, c(t.headers, (o, n) => (s(), m(F, {
116
- key: n,
117
- "text-align": o.align,
118
- dense: t.dense,
119
- fixed: t.fixed
120
- }, {
121
- default: u(() => [
122
- S(t.$slots, `item-${o.value}`, { item: e }, () => [
123
- v(b(C(e, o.value)), 1)
124
- ])
125
- ]),
126
- _: 2
127
- }, 1032, ["text-align", "dense", "fixed"]))), 128))
128
- ]),
129
- _: 2
130
- }, 1032, ["pointer", "striped", "onClick"]))), 128))
131
- ]),
132
- _: 3
133
- }),
134
- t.loading ? (s(), a("div", {
135
- key: 0,
136
- class: g(i(k).loadingWrapper)
105
+ d(e.$slots, "title"),
106
+ d(e.$slots, "actions"),
107
+ f("table", {
108
+ style: P(c(D)),
109
+ class: p(c(w).table)
137
110
  }, [
138
- f(I, { size: "lg" })
139
- ], 2)) : V("", !0)
140
- ], 6)
141
- ]));
111
+ m(q, null, {
112
+ default: u(() => [
113
+ e.expandable ? (n(), y(S, {
114
+ key: 0,
115
+ width: "48",
116
+ class: "!p-0",
117
+ "sticky-header": e.stickyHeader
118
+ }, null, 8, ["sticky-header"])) : b("", !0),
119
+ (n(!0), i(k, null, v(e.headers, (t, o) => (n(), y(S, {
120
+ key: o,
121
+ "sticky-header": e.stickyHeader,
122
+ "text-align": t.align,
123
+ sort: V(t.value, e.sort),
124
+ sortable: t.sortable,
125
+ width: t.width,
126
+ onClick: (s) => t.sortable ? I(t) : null
127
+ }, {
128
+ default: u(() => [
129
+ d(e.$slots, `header-${t.value}`, { header: t }, () => [
130
+ C(N(t.text), 1)
131
+ ])
132
+ ]),
133
+ _: 2
134
+ }, 1032, ["sticky-header", "text-align", "sort", "sortable", "width", "onClick"]))), 128))
135
+ ]),
136
+ _: 3
137
+ }),
138
+ m(c(G), null, {
139
+ default: u(() => [
140
+ e.loading ? (n(!0), i(k, { key: 0 }, v(Number(e.loadingLines), (t, o) => (n(), y(z, {
141
+ key: o,
142
+ striped: e.striped
143
+ }, {
144
+ default: u(() => [
145
+ (n(!0), i(k, null, v(e.headers, (s, a) => (n(), y(_, {
146
+ key: a,
147
+ "text-align": s.align,
148
+ width: s.width,
149
+ dense: e.dense,
150
+ fixed: e.fixed
151
+ }, {
152
+ default: u(() => [
153
+ d(e.$slots, `loading-${s.value}`, { item: t }, () => [
154
+ m(M, {
155
+ class: p(["max-w-[60%]", {
156
+ "mx-auto": s.align === "center",
157
+ "ml-auto": s.align === "right"
158
+ }]),
159
+ shape: s.skeletonShape || "line"
160
+ }, null, 8, ["shape", "class"])
161
+ ])
162
+ ]),
163
+ _: 2
164
+ }, 1032, ["text-align", "width", "dense", "fixed"]))), 128))
165
+ ]),
166
+ _: 2
167
+ }, 1032, ["striped"]))), 128)) : e.error ? (n(), i("tr", R, [
168
+ f("td", {
169
+ colspan: e.headers.length
170
+ }, [
171
+ d(e.$slots, "error")
172
+ ], 8, U)
173
+ ])) : !h.items || h.items.length === 0 ? (n(), i("tr", Y, [
174
+ f("td", {
175
+ colspan: e.headers.length
176
+ }, [
177
+ d(e.$slots, "empty")
178
+ ], 8, Z)
179
+ ])) : (n(!0), i(k, { key: 3 }, v(h.items, (t, o) => {
180
+ var s;
181
+ return n(), i(k, { key: o }, [
182
+ m(z, {
183
+ pointer: e.pointer,
184
+ striped: e.striped,
185
+ onClick: (a) => e.$emit("click-row", t)
186
+ }, {
187
+ default: u(() => [
188
+ e.expandable ? (n(), y(_, {
189
+ key: 0,
190
+ width: "48",
191
+ class: "!p-1"
192
+ }, {
193
+ default: u(() => {
194
+ var a;
195
+ return [
196
+ f("button", {
197
+ class: "p-4",
198
+ onClick: (B) => g.value[o].__expanded = !g.value[o].__expanded
199
+ }, [
200
+ m(r, {
201
+ icon: c(Q),
202
+ size: e.dense ? "xs" : "md",
203
+ class: p(["transition-transform", {
204
+ "rotate-180": (a = g.value[o]) == null ? void 0 : a.__expanded
205
+ }])
206
+ }, null, 8, ["icon", "size", "class"])
207
+ ], 8, j)
208
+ ];
209
+ }),
210
+ _: 2
211
+ }, 1024)) : b("", !0),
212
+ (n(!0), i(k, null, v(e.headers, (a, B) => (n(), y(_, {
213
+ key: B,
214
+ "text-align": a.align,
215
+ truncate: a.truncate,
216
+ width: a.width,
217
+ dense: e.dense,
218
+ fixed: e.fixed
219
+ }, {
220
+ default: u(() => [
221
+ d(e.$slots, `item-${a.value}`, { item: t }, () => [
222
+ C(N(L(t, a.value)), 1)
223
+ ])
224
+ ]),
225
+ _: 2
226
+ }, 1032, ["text-align", "truncate", "width", "dense", "fixed"]))), 128))
227
+ ]),
228
+ _: 2
229
+ }, 1032, ["pointer", "striped", "onClick"]),
230
+ e.expandable ? (n(), i("tr", x, [
231
+ f("td", ee, [
232
+ f("div", {
233
+ class: p(["overflow-hidden transition-opacity", [(s = g.value[o]) != null && s.__expanded ? "" : "opacity-0 max-h-0"]])
234
+ }, [
235
+ d(e.$slots, "expanded-row", { item: t })
236
+ ], 2)
237
+ ])
238
+ ])) : b("", !0)
239
+ ], 64);
240
+ }), 128))
241
+ ]),
242
+ _: 3
243
+ }),
244
+ e.loading ? (n(), i("div", {
245
+ key: 0,
246
+ class: p(c(w).loadingWrapper)
247
+ }, [
248
+ m(K, { size: "lg" })
249
+ ], 2)) : b("", !0)
250
+ ], 6)
251
+ ], 2);
252
+ };
142
253
  }
143
254
  });
144
255
  export {
145
- Y as default
256
+ fe as default
146
257
  };
@@ -1,4 +1,4 @@
1
- import type { ExtractPublicPropTypes, PropType } from 'vue';
1
+ import { type ExtractPublicPropTypes, type PropType } from 'vue';
2
2
  import { type ThemeComponent } from '../../composables/useTheme';
3
3
  declare const validators: {
4
4
  textAlign: readonly [null, "left", "center", "right", "justify"];
@@ -11,7 +11,7 @@ declare const tableCellProps: {
11
11
  };
12
12
  truncate: BooleanConstructor;
13
13
  dense: BooleanConstructor;
14
- fixed: BooleanConstructor;
14
+ width: (StringConstructor | NumberConstructor)[];
15
15
  verticalAlign: {
16
16
  type: PropType<"top" | "bottom" | "baseline" | "middle" | "text-bottom" | "text-top" | null>;
17
17
  default: string;
@@ -31,7 +31,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
31
31
  };
32
32
  truncate: BooleanConstructor;
33
33
  dense: BooleanConstructor;
34
- fixed: BooleanConstructor;
34
+ width: (StringConstructor | NumberConstructor)[];
35
35
  verticalAlign: {
36
36
  type: PropType<"top" | "bottom" | "baseline" | "middle" | "text-bottom" | "text-top" | null>;
37
37
  default: string;
@@ -44,14 +44,13 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
44
44
  };
45
45
  truncate: BooleanConstructor;
46
46
  dense: BooleanConstructor;
47
- fixed: BooleanConstructor;
47
+ width: (StringConstructor | NumberConstructor)[];
48
48
  verticalAlign: {
49
49
  type: PropType<"top" | "bottom" | "baseline" | "middle" | "text-bottom" | "text-top" | null>;
50
50
  default: string;
51
51
  validator: (value: string) => boolean;
52
52
  };
53
53
  }>>, {
54
- fixed: boolean;
55
54
  dense: boolean;
56
55
  truncate: boolean;
57
56
  verticalAlign: "top" | "bottom" | "baseline" | "middle" | "text-bottom" | "text-top" | null;
@@ -1,42 +1,41 @@
1
- import { defineComponent as i, openBlock as c, createElementBlock as p, normalizeStyle as d, unref as l, normalizeClass as u, renderSlot as m } from "vue";
2
- import { useTheme as f } from "../../composables/useTheme.js";
3
- const n = {
1
+ import { defineComponent as d, computed as c, openBlock as m, createElementBlock as u, normalizeStyle as p, unref as n, normalizeClass as f, renderSlot as h } from "vue";
2
+ import { useTheme as g } from "../../composables/useTheme.js";
3
+ const o = {
4
4
  textAlign: [null, "left", "center", "right", "justify"],
5
5
  verticalAlign: [null, "baseline", "bottom", "middle", "text-bottom", "text-top", "top"]
6
- }, g = {
6
+ }, v = {
7
7
  textAlign: {
8
8
  type: String,
9
- validator: (e) => n.textAlign.includes(e)
9
+ validator: (e) => o.textAlign.includes(e)
10
10
  },
11
11
  truncate: Boolean,
12
12
  dense: Boolean,
13
- fixed: Boolean,
13
+ width: [String, Number],
14
14
  verticalAlign: {
15
15
  type: String,
16
16
  default: "middle",
17
- validator: (e) => n.verticalAlign.includes(e)
17
+ validator: (e) => o.verticalAlign.includes(e)
18
18
  }
19
- }, x = {
19
+ }, b = {
20
20
  name: "XTableCell",
21
- validators: n
22
- }, _ = /* @__PURE__ */ i({
23
- ...x,
24
- props: g,
21
+ validators: o
22
+ }, w = /* @__PURE__ */ d({
23
+ ...b,
24
+ props: v,
25
25
  setup(e) {
26
- const t = e;
27
- t.truncate && !t.fixed && console.warn('Table must have "fixed" property set to true when using TableCell "truncate" property');
28
- const { styles: o, classes: a, className: r } = f("TableCell", {}, t);
29
- return (s, b) => (c(), p("td", {
30
- style: d(l(o)),
31
- class: u([
32
- l(r),
33
- l(a).wrapper
26
+ const t = e, l = c(() => typeof t.width == "number" ? `${t.width}px` : t.width), { styles: a, classes: i, className: r } = g("TableCell", {}, t);
27
+ return (s, x) => (m(), u("td", {
28
+ style: p([n(a), { width: l.value, minWidth: l.value, maxWidth: l.value }]),
29
+ class: f([
30
+ "relative",
31
+ n(r),
32
+ n(i).wrapper
34
33
  ])
35
34
  }, [
36
- m(s.$slots, "default")
35
+ h(s.$slots, "default")
37
36
  ], 6));
38
37
  }
39
38
  });
40
39
  export {
41
- _ as default
40
+ w as default
42
41
  };
@@ -0,0 +1,16 @@
1
+ import type { ExtractPublicPropTypes } from 'vue';
2
+ import { type ThemeComponent } from '../../composables/useTheme';
3
+ declare const tableHeadProps: {};
4
+ export type TableHeadProps = ExtractPublicPropTypes<typeof tableHeadProps>;
5
+ type InternalClasses = 'thead' | 'row';
6
+ export interface TableHeadTheme extends ThemeComponent<TableHeadProps, InternalClasses> {
7
+ }
8
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>, {
9
+ default?(_: {}): any;
10
+ }>;
11
+ export default _default;
12
+ type __VLS_WithTemplateSlots<T, S> = T & {
13
+ new (): {
14
+ $slots: S;
15
+ };
16
+ };
@@ -0,0 +1,21 @@
1
+ import { defineComponent as r, openBlock as n, createElementBlock as c, normalizeClass as s, unref as e, normalizeStyle as m, createElementVNode as d, renderSlot as _ } from "vue";
2
+ import { useTheme as f } from "../../composables/useTheme.js";
3
+ const p = { name: "XTableHead" }, T = /* @__PURE__ */ r({
4
+ ...p,
5
+ setup(u) {
6
+ const { styles: a, classes: t, className: l } = f("TableHead", {}, {});
7
+ return (o, i) => (n(), c("thead", {
8
+ class: s([e(l), e(t).thead]),
9
+ style: m(e(a))
10
+ }, [
11
+ d("tr", {
12
+ class: s(e(t).row)
13
+ }, [
14
+ _(o.$slots, "default")
15
+ ], 2)
16
+ ], 6));
17
+ }
18
+ });
19
+ export {
20
+ T as default
21
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./TableHead.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,4 +1,5 @@
1
1
  import type { ExtractPublicPropTypes, PropType } from 'vue';
2
+ import { type ThemeComponent } from '../../composables/useTheme';
2
3
  declare const validators: {
3
4
  sort: readonly [1, -1, undefined];
4
5
  textAlign: readonly ["left", "center", "right", "justify"];
@@ -19,6 +20,9 @@ declare const tableHeaderProps: {
19
20
  export type TableHeaderSort = typeof validators.sort[number];
20
21
  export type TableHeaderAlign = typeof validators.textAlign[number];
21
22
  export type TableHeaderProps = ExtractPublicPropTypes<typeof tableHeaderProps>;
23
+ type InternalClasses = 'th' | 'sortIcon';
24
+ export interface TableHeaderTheme extends ThemeComponent<TableHeaderProps, InternalClasses> {
25
+ }
22
26
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
23
27
  sort: {
24
28
  type: PropType<1 | -1 | undefined>;
@@ -1,78 +1,69 @@
1
- import { defineComponent as d, openBlock as t, createElementBlock as o, normalizeClass as u, renderSlot as i, Fragment as a, createCommentVNode as n, createElementVNode as s } from "vue";
2
- const c = {
3
- key: 0,
4
- class: "relative inline-block"
5
- }, p = {
6
- key: 0,
7
- class: "absolute stroke-2 w-3 h-3 ml-0.5 -right-3 top-0.5",
8
- width: "24",
9
- height: "24",
10
- viewBox: "0 0 24 24",
11
- stroke: "currentColor",
12
- "stroke-linejoin": "round",
13
- "stroke-linecap": "round",
14
- fill: "none",
15
- role: "presentation"
16
- }, y = /* @__PURE__ */ s("line", {
1
+ import { defineComponent as m, openBlock as o, createElementBlock as l, normalizeStyle as h, unref as s, normalizeClass as a, renderSlot as y, Fragment as d, createCommentVNode as f, createElementVNode as n } from "vue";
2
+ import { useTheme as _ } from "../../composables/useTheme.js";
3
+ const g = /* @__PURE__ */ n("line", {
17
4
  x1: "12",
18
5
  y1: "5",
19
6
  x2: "12",
20
7
  y2: "19"
21
- }, null, -1), g = /* @__PURE__ */ s("polyline", { points: "19 12 12 19 5 12" }, null, -1), h = /* @__PURE__ */ s("line", {
8
+ }, null, -1), k = /* @__PURE__ */ n("polyline", { points: "19 12 12 19 5 12" }, null, -1), v = /* @__PURE__ */ n("line", {
22
9
  x1: "12",
23
10
  y1: "19",
24
11
  x2: "12",
25
12
  y2: "5"
26
- }, null, -1), f = /* @__PURE__ */ s("polyline", { points: "5 12 12 5 19 12" }, null, -1), l = {
13
+ }, null, -1), b = /* @__PURE__ */ n("polyline", { points: "5 12 12 5 19 12" }, null, -1), B = {
14
+ key: 2,
15
+ d: "m3 9l4-4l4 4M7 5v14m14-4l-4 4l-4-4m4 4V5"
16
+ }, r = {
27
17
  sort: [1, -1, void 0],
28
18
  textAlign: ["left", "center", "right", "justify"]
29
- }, k = {
19
+ }, x = {
30
20
  sort: {
31
21
  type: Number,
32
- validator: (r) => l.sort.includes(r)
22
+ validator: (t) => r.sort.includes(t)
33
23
  },
34
24
  sortable: Boolean,
35
25
  textAlign: {
36
26
  type: String,
37
27
  default: "left",
38
- validator: (r) => l.textAlign.includes(r)
28
+ validator: (t) => r.textAlign.includes(t)
39
29
  },
40
30
  stickyHeader: Boolean
41
- }, m = { name: "XTableHeader", validators: l }, b = /* @__PURE__ */ d({
42
- ...m,
43
- props: k,
44
- setup(r) {
45
- return (e, v) => (t(), o("th", {
46
- class: u(["py-2 font-semibold tracking-widest uppercase text-xs px-3", [
47
- {
48
- // sort
49
- "cursor-pointer hover:text-gray-800 dark:hover:text-gray-300 transition-colors duration-150 ease-in-out": e.sortable,
50
- // stickyHeader
51
- "sticky top-0": e.stickyHeader,
52
- // textAlign
53
- "text-left": e.textAlign === "left",
54
- "text-right": e.textAlign === "right",
55
- "text-center": e.textAlign === "center",
56
- "text-justify": e.textAlign === "justify"
57
- }
58
- ]])
31
+ }, C = { name: "XTableHeader", validators: r }, S = /* @__PURE__ */ m({
32
+ ...C,
33
+ props: x,
34
+ setup(t) {
35
+ const c = t, { styles: u, classes: i, className: p } = _("TableHeader", {}, c);
36
+ return (e, H) => (o(), l("th", {
37
+ style: h(s(u)),
38
+ class: a([s(p), s(i).th, "group/th"])
59
39
  }, [
60
- e.sortable ? (t(), o("div", c, [
61
- i(e.$slots, "default"),
62
- e.sort && [1, -1].includes(e.sort) ? (t(), o("svg", p, [
63
- e.sort === -1 ? (t(), o(a, { key: 0 }, [
64
- y,
65
- g
66
- ], 64)) : n("", !0),
67
- e.sort === 1 ? (t(), o(a, { key: 1 }, [
68
- h,
69
- f
70
- ], 64)) : n("", !0)
71
- ])) : n("", !0)
72
- ])) : i(e.$slots, "default", { key: 1 })
73
- ], 2));
40
+ y(e.$slots, "default"),
41
+ e.sortable ? (o(), l("svg", {
42
+ key: 0,
43
+ class: a([
44
+ s(i).sortIcon,
45
+ [e.sort && [1, -1].includes(e.sort) ? "" : "invisible group-hover/th:visible"]
46
+ ]),
47
+ width: "24",
48
+ height: "24",
49
+ viewBox: "0 0 24 24",
50
+ stroke: "currentColor",
51
+ "stroke-linejoin": "round",
52
+ "stroke-linecap": "round",
53
+ fill: "none",
54
+ role: "presentation"
55
+ }, [
56
+ e.sort === -1 ? (o(), l(d, { key: 0 }, [
57
+ g,
58
+ k
59
+ ], 64)) : e.sort === 1 ? (o(), l(d, { key: 1 }, [
60
+ v,
61
+ b
62
+ ], 64)) : (o(), l("path", B))
63
+ ], 2)) : f("", !0)
64
+ ], 6));
74
65
  }
75
66
  });
76
67
  export {
77
- b as default
68
+ S as default
78
69
  };
@@ -1,4 +1,18 @@
1
- import { type PropType } from 'vue';
1
+ import { type PropType, type ExtractPublicPropTypes } from 'vue';
2
+ import { type ThemeComponent } from '../../composables/useTheme';
3
+ declare const tableRowProps: {
4
+ pointer: BooleanConstructor;
5
+ striped: BooleanConstructor;
6
+ verticalAlign: {
7
+ type: PropType<"top" | "bottom" | "baseline" | "middle" | "text-bottom" | "text-top">;
8
+ default: string;
9
+ validator: (value: string) => boolean;
10
+ };
11
+ };
12
+ export type TableRowProps = ExtractPublicPropTypes<typeof tableRowProps>;
13
+ type InternalClasses = 'row';
14
+ export interface TableRowTheme extends ThemeComponent<TableRowProps, InternalClasses> {
15
+ }
2
16
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
3
17
  pointer: BooleanConstructor;
4
18
  striped: BooleanConstructor;