@toife/vue 2.2.0 → 3.0.1

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 (364) hide show
  1. package/README.md +224 -0
  2. package/package.json +39 -10
  3. package/src/components/action/action.composable.ts +32 -0
  4. package/src/components/action/action.html +25 -0
  5. package/src/components/action/action.md +115 -0
  6. package/src/components/action/action.scss +105 -0
  7. package/src/components/action/action.type.ts +35 -0
  8. package/src/components/action/action.vue +70 -0
  9. package/src/components/action/index.ts +9 -0
  10. package/src/components/app/app.constants.ts +1 -0
  11. package/src/components/app/app.html +24 -0
  12. package/src/components/app/app.md +77 -0
  13. package/src/components/app/app.scss +27 -0
  14. package/src/components/app/app.type.ts +21 -0
  15. package/src/components/app/app.vue +45 -0
  16. package/src/components/app/index.ts +3 -0
  17. package/src/components/avatar/avatar.html +3 -0
  18. package/src/components/avatar/avatar.md +64 -0
  19. package/src/components/avatar/avatar.scss +35 -0
  20. package/src/components/avatar/avatar.type.ts +6 -0
  21. package/src/components/avatar/avatar.vue +45 -0
  22. package/src/components/avatar/index.ts +2 -0
  23. package/src/components/button/button.html +6 -0
  24. package/src/components/button/button.md +66 -0
  25. package/src/components/button/button.scss +113 -0
  26. package/src/components/button/button.type.ts +14 -0
  27. package/src/components/button/button.vue +61 -0
  28. package/src/components/button/index.ts +2 -0
  29. package/src/components/cable/cable.constants.ts +1 -0
  30. package/src/components/cable/cable.html +3 -0
  31. package/src/components/cable/cable.md +57 -0
  32. package/src/components/cable/cable.scss +37 -0
  33. package/src/components/cable/cable.type.ts +11 -0
  34. package/src/components/cable/cable.vue +33 -0
  35. package/src/components/cable/index.ts +3 -0
  36. package/src/components/card/card/card.constants.ts +1 -0
  37. package/src/components/card/card/card.html +3 -0
  38. package/src/components/card/card/card.md +57 -0
  39. package/src/components/card/card/card.scss +34 -0
  40. package/src/components/card/card/card.type.ts +14 -0
  41. package/src/components/card/card/card.vue +62 -0
  42. package/src/components/card/card/index.ts +3 -0
  43. package/src/components/card/card-body/card-body.html +3 -0
  44. package/src/components/card/card-body/card-body.md +34 -0
  45. package/src/components/card/card-body/card-body.scss +23 -0
  46. package/src/components/card/card-body/card-body.vue +9 -0
  47. package/src/components/card/card-body/index.ts +1 -0
  48. package/src/components/card/card-footer/card-footer.html +3 -0
  49. package/src/components/card/card-footer/card-footer.md +42 -0
  50. package/src/components/card/card-footer/card-footer.scss +31 -0
  51. package/src/components/card/card-footer/card-footer.vue +25 -0
  52. package/src/components/card/card-footer/index.ts +1 -0
  53. package/src/components/card/card-header/card-header.html +3 -0
  54. package/src/components/card/card-header/card-header.md +44 -0
  55. package/src/components/card/card-header/card-header.scss +31 -0
  56. package/src/components/card/card-header/card-header.vue +25 -0
  57. package/src/components/card/card-header/index.ts +1 -0
  58. package/src/components/card/index.ts +4 -0
  59. package/src/components/checkbox/checkbox.html +13 -0
  60. package/src/components/checkbox/checkbox.md +60 -0
  61. package/src/components/checkbox/checkbox.scss +138 -0
  62. package/src/components/checkbox/checkbox.type.ts +17 -0
  63. package/src/components/checkbox/checkbox.vue +78 -0
  64. package/src/components/checkbox/index.ts +2 -0
  65. package/src/components/collapse/collapse.html +16 -0
  66. package/src/components/collapse/collapse.md +59 -0
  67. package/src/components/collapse/collapse.scss +59 -0
  68. package/src/components/collapse/collapse.type.ts +11 -0
  69. package/src/components/collapse/collapse.vue +131 -0
  70. package/src/components/collapse/index.ts +2 -0
  71. package/src/components/container/container.html +1 -0
  72. package/src/components/container/container.md +38 -0
  73. package/src/components/container/container.scss +10 -0
  74. package/src/components/container/container.vue +9 -0
  75. package/src/components/container/index.ts +1 -0
  76. package/src/components/decision-modal/decision-modal.composable.ts +32 -0
  77. package/src/components/decision-modal/decision-modal.html +29 -0
  78. package/src/components/decision-modal/decision-modal.md +79 -0
  79. package/src/components/decision-modal/decision-modal.scss +136 -0
  80. package/src/components/decision-modal/decision-modal.type.ts +35 -0
  81. package/src/components/decision-modal/decision-modal.vue +98 -0
  82. package/src/components/decision-modal/index.ts +9 -0
  83. package/src/components/divider/divider.html +1 -0
  84. package/src/components/divider/divider.md +42 -0
  85. package/src/components/divider/divider.scss +29 -0
  86. package/src/components/divider/divider.type.ts +6 -0
  87. package/src/components/divider/divider.vue +31 -0
  88. package/src/components/divider/index.ts +2 -0
  89. package/src/components/field/field.html +1 -0
  90. package/src/components/field/field.md +68 -0
  91. package/src/components/field/field.type.ts +43 -0
  92. package/src/components/field/field.vue +85 -0
  93. package/src/components/field/index.ts +2 -0
  94. package/src/components/field/outline/index.ts +1 -0
  95. package/src/components/field/outline/outline-field.md +44 -0
  96. package/src/components/field/outline/outline.html +32 -0
  97. package/src/components/field/outline/outline.scss +224 -0
  98. package/src/components/field/outline/outline.vue +243 -0
  99. package/src/components/form-group/form-group.html +3 -0
  100. package/src/components/form-group/form-group.md +41 -0
  101. package/src/components/form-group/form-group.scss +91 -0
  102. package/src/components/form-group/form-group.type.ts +5 -0
  103. package/src/components/form-group/form-group.vue +21 -0
  104. package/src/components/form-group/index.ts +2 -0
  105. package/src/components/gesture-indicator/gesture-indicator.html +1 -0
  106. package/src/components/gesture-indicator/gesture-indicator.md +42 -0
  107. package/src/components/gesture-indicator/gesture-indicator.scss +45 -0
  108. package/{dist/components/gesture-indicator/gesture-indicator.type.d.ts → src/components/gesture-indicator/gesture-indicator.type.ts} +2 -1
  109. package/src/components/gesture-indicator/gesture-indicator.vue +29 -0
  110. package/src/components/gesture-indicator/index.ts +1 -0
  111. package/src/components/image/image.html +1 -0
  112. package/src/components/image/image.md +41 -0
  113. package/src/components/image/image.scss +1 -0
  114. package/src/components/image/image.type.ts +5 -0
  115. package/src/components/image/image.vue +25 -0
  116. package/src/components/image/index.ts +2 -0
  117. package/src/components/index.ts +27 -0
  118. package/src/components/modal/index.ts +2 -0
  119. package/src/components/modal/modal.html +20 -0
  120. package/src/components/modal/modal.md +65 -0
  121. package/src/components/modal/modal.scss +78 -0
  122. package/src/components/modal/modal.type.ts +21 -0
  123. package/src/components/modal/modal.vue +186 -0
  124. package/src/components/page/index.ts +1 -0
  125. package/src/components/page/page.html +3 -0
  126. package/src/components/page/page.md +39 -0
  127. package/src/components/page/page.scss +17 -0
  128. package/src/components/page/page.vue +9 -0
  129. package/src/components/present/index.ts +3 -0
  130. package/src/components/present/present.composable.ts +21 -0
  131. package/src/components/present/present.html +9 -0
  132. package/src/components/present/present.md +60 -0
  133. package/src/components/present/present.scss +81 -0
  134. package/src/components/present/present.type.ts +26 -0
  135. package/src/components/present/present.vue +198 -0
  136. package/src/components/radio/index.ts +2 -0
  137. package/src/components/radio/radio/index.ts +2 -0
  138. package/src/components/radio/radio/radio.html +11 -0
  139. package/src/components/radio/radio/radio.md +53 -0
  140. package/src/components/radio/radio/radio.scss +125 -0
  141. package/src/components/radio/radio/radio.type.ts +11 -0
  142. package/src/components/radio/radio/radio.vue +99 -0
  143. package/src/components/radio/radio-group/index.ts +7 -0
  144. package/src/components/radio/radio-group/radio-group.constants.ts +1 -0
  145. package/src/components/radio/radio-group/radio-group.html +3 -0
  146. package/src/components/radio/radio-group/radio-group.md +62 -0
  147. package/src/components/radio/radio-group/radio-group.scss +16 -0
  148. package/src/components/radio/radio-group/radio-group.type.ts +28 -0
  149. package/src/components/radio/radio-group/radio-group.vue +57 -0
  150. package/src/components/refresher/index.ts +2 -0
  151. package/src/components/refresher/refresher.html +6 -0
  152. package/src/components/refresher/refresher.md +53 -0
  153. package/src/components/refresher/refresher.scss +36 -0
  154. package/src/components/refresher/refresher.type.ts +16 -0
  155. package/src/components/refresher/refresher.vue +137 -0
  156. package/src/components/route/index.ts +5 -0
  157. package/src/components/route/route-navigator/index.ts +2 -0
  158. package/src/components/route/route-navigator/route-navigator.html +19 -0
  159. package/src/components/route/route-navigator/route-navigator.md +50 -0
  160. package/src/components/route/route-navigator/route-navigator.scss +127 -0
  161. package/src/components/route/route-navigator/route-navigator.type.ts +12 -0
  162. package/src/components/route/route-navigator/route-navigator.vue +255 -0
  163. package/src/components/route/route-outlet/index.ts +1 -0
  164. package/src/components/route/route-outlet/route-outlet.html +1 -0
  165. package/src/components/route/route-outlet/route-outlet.md +30 -0
  166. package/src/components/route/route-outlet/route-outlet.vue +30 -0
  167. package/src/components/route/route-provider/index.ts +3 -0
  168. package/src/components/route/route-provider/route-provider.constant.ts +1 -0
  169. package/src/components/route/route-provider/route-provider.html +1 -0
  170. package/src/components/route/route-provider/route-provider.md +46 -0
  171. package/src/components/route/route-provider/route-provider.type.ts +10 -0
  172. package/src/components/route/route-provider/route-provider.vue +20 -0
  173. package/src/components/route/route-wrapper/index.ts +3 -0
  174. package/src/components/route/route-wrapper/route-wrapper.composable.ts +58 -0
  175. package/src/components/route/route-wrapper/route-wrapper.html +3 -0
  176. package/src/components/route/route-wrapper/route-wrapper.md +45 -0
  177. package/src/components/route/route-wrapper/route-wrapper.type.ts +7 -0
  178. package/src/components/route/route-wrapper/route-wrapper.vue +51 -0
  179. package/src/components/route/route.type.ts +8 -0
  180. package/src/components/route/route.util.ts +8 -0
  181. package/src/components/segmented-field/index.ts +7 -0
  182. package/src/components/segmented-field/segmented-field.html +17 -0
  183. package/src/components/segmented-field/segmented-field.md +58 -0
  184. package/src/components/segmented-field/segmented-field.scss +52 -0
  185. package/src/components/segmented-field/segmented-field.type.ts +29 -0
  186. package/src/components/segmented-field/segmented-field.vue +145 -0
  187. package/src/components/skeleton/index.ts +2 -0
  188. package/src/components/skeleton/skeleton.html +1 -0
  189. package/src/components/skeleton/skeleton.md +47 -0
  190. package/src/components/skeleton/skeleton.scss +45 -0
  191. package/src/components/skeleton/skeleton.type.ts +7 -0
  192. package/src/components/skeleton/skeleton.vue +38 -0
  193. package/src/components/switch/index.ts +2 -0
  194. package/src/components/switch/switch.html +15 -0
  195. package/src/components/switch/switch.md +57 -0
  196. package/src/components/switch/switch.scss +134 -0
  197. package/src/components/switch/switch.type.ts +13 -0
  198. package/src/components/switch/switch.vue +81 -0
  199. package/src/components/tabs/index.ts +2 -0
  200. package/src/components/tabs/tab/index.ts +2 -0
  201. package/src/components/tabs/tab/tab.html +5 -0
  202. package/src/components/tabs/tab/tab.md +52 -0
  203. package/src/components/tabs/tab/tab.type.ts +5 -0
  204. package/src/components/tabs/tab/tab.vue +38 -0
  205. package/src/components/tabs/tabs/index.ts +9 -0
  206. package/src/components/tabs/tabs/tabs.constants.ts +1 -0
  207. package/src/components/tabs/tabs/tabs.html +3 -0
  208. package/src/components/tabs/tabs/tabs.md +59 -0
  209. package/src/components/tabs/tabs/tabs.scss +270 -0
  210. package/src/components/tabs/tabs/tabs.type.ts +36 -0
  211. package/src/components/tabs/tabs/tabs.vue +157 -0
  212. package/src/components/toast/index.ts +4 -0
  213. package/src/components/toast/toast/index.ts +1 -0
  214. package/src/components/toast/toast/toast.html +9 -0
  215. package/src/components/toast/toast/toast.md +56 -0
  216. package/src/components/toast/toast/toast.scss +61 -0
  217. package/src/components/toast/toast/toast.vue +34 -0
  218. package/src/components/toast/toast-content/index.ts +1 -0
  219. package/src/components/toast/toast-content/toast-content.html +1 -0
  220. package/src/components/toast/toast-content/toast-content.md +41 -0
  221. package/src/components/toast/toast-content/toast-content.scss +41 -0
  222. package/src/components/toast/toast-content/toast-content.vue +53 -0
  223. package/src/components/toast/toast.composable.ts +22 -0
  224. package/src/components/toast/toast.type.ts +25 -0
  225. package/src/components/toolbar/index.ts +2 -0
  226. package/src/components/toolbar/toolbar.html +5 -0
  227. package/src/components/toolbar/toolbar.md +57 -0
  228. package/src/components/toolbar/toolbar.scss +79 -0
  229. package/src/components/toolbar/toolbar.type.ts +7 -0
  230. package/src/components/toolbar/toolbar.vue +41 -0
  231. package/src/env.d.ts +7 -0
  232. package/src/factory.ts +83 -0
  233. package/src/index.ts +4 -0
  234. package/{dist/type.d.ts → src/type.ts} +1 -1
  235. package/src/utils/element.md +33 -0
  236. package/src/utils/element.ts +16 -0
  237. package/src/utils/events.md +29 -0
  238. package/src/utils/events.ts +12 -0
  239. package/src/utils/index.ts +3 -0
  240. package/src/utils/style/index.ts +42 -0
  241. package/src/utils/style.md +49 -0
  242. package/dist/components/action/action.type.d.ts +0 -17
  243. package/dist/components/action/action.vue.d.ts +0 -14
  244. package/dist/components/action/factory.d.ts +0 -3
  245. package/dist/components/action/index.d.ts +0 -2
  246. package/dist/components/alert/alert.type.d.ts +0 -16
  247. package/dist/components/alert/alert.vue.d.ts +0 -14
  248. package/dist/components/alert/factory.d.ts +0 -3
  249. package/dist/components/alert/index.d.ts +0 -2
  250. package/dist/components/app/app.type.d.ts +0 -1
  251. package/dist/components/app/app.vue.d.ts +0 -3
  252. package/dist/components/app/index.d.ts +0 -1
  253. package/dist/components/avatar/avatar.type.d.ts +0 -4
  254. package/dist/components/avatar/avatar.vue.d.ts +0 -6
  255. package/dist/components/avatar/index.d.ts +0 -1
  256. package/dist/components/back-button/back-button.type.d.ts +0 -4
  257. package/dist/components/back-button/back-button.vue.d.ts +0 -3
  258. package/dist/components/back-button/index.d.ts +0 -1
  259. package/dist/components/button/button.type.d.ts +0 -10
  260. package/dist/components/button/button.vue.d.ts +0 -12
  261. package/dist/components/button/index.d.ts +0 -1
  262. package/dist/components/cable/cable.type.d.ts +0 -4
  263. package/dist/components/cable/cable.vue.d.ts +0 -6
  264. package/dist/components/cable/index.d.ts +0 -1
  265. package/dist/components/card/card.type.d.ts +0 -3
  266. package/dist/components/card/card.vue.d.ts +0 -5
  267. package/dist/components/card/index.d.ts +0 -1
  268. package/dist/components/checkbox/checkbox.type.d.ts +0 -12
  269. package/dist/components/checkbox/checkbox.vue.d.ts +0 -14
  270. package/dist/components/checkbox/index.d.ts +0 -1
  271. package/dist/components/collapse/collapse.type.d.ts +0 -6
  272. package/dist/components/collapse/collapse.vue.d.ts +0 -7
  273. package/dist/components/collapse/index.d.ts +0 -1
  274. package/dist/components/content/content.type.d.ts +0 -1
  275. package/dist/components/content/content.vue.d.ts +0 -3
  276. package/dist/components/content/index.d.ts +0 -1
  277. package/dist/components/divider/divider.type.d.ts +0 -3
  278. package/dist/components/divider/divider.vue.d.ts +0 -5
  279. package/dist/components/divider/index.d.ts +0 -1
  280. package/dist/components/flex/flex.type.d.ts +0 -4
  281. package/dist/components/flex/flex.vue.d.ts +0 -6
  282. package/dist/components/flex/index.d.ts +0 -1
  283. package/dist/components/gesture-indicator/gesture-indicator.vue.d.ts +0 -5
  284. package/dist/components/gesture-indicator/index.d.ts +0 -1
  285. package/dist/components/grid/grid.type.d.ts +0 -4
  286. package/dist/components/grid/grid.vue.d.ts +0 -6
  287. package/dist/components/grid/index.d.ts +0 -1
  288. package/dist/components/icon-spinner/icon-spinner.type.d.ts +0 -4
  289. package/dist/components/icon-spinner/icon-spinner.vue.d.ts +0 -6
  290. package/dist/components/icon-spinner/index.d.ts +0 -1
  291. package/dist/components/image/image.type.d.ts +0 -4
  292. package/dist/components/image/image.vue.d.ts +0 -3
  293. package/dist/components/image/index.d.ts +0 -1
  294. package/dist/components/index.d.ts +0 -36
  295. package/dist/components/input/index.d.ts +0 -1
  296. package/dist/components/input/input.type.d.ts +0 -15
  297. package/dist/components/input/input.vue.d.ts +0 -16
  298. package/dist/components/keyboard-space/factory.d.ts +0 -3
  299. package/dist/components/keyboard-space/index.d.ts +0 -2
  300. package/dist/components/keyboard-space/keyboard-space.type.d.ts +0 -1
  301. package/dist/components/keyboard-space/keyboard-space.vue.d.ts +0 -3
  302. package/dist/components/loading/factory.d.ts +0 -4
  303. package/dist/components/loading/index.d.ts +0 -2
  304. package/dist/components/loading/loading.type.d.ts +0 -6
  305. package/dist/components/loading/loading.vue.d.ts +0 -12
  306. package/dist/components/present/factory.d.ts +0 -1
  307. package/dist/components/present/index.d.ts +0 -2
  308. package/dist/components/present/present.type.d.ts +0 -13
  309. package/dist/components/present/present.vue.d.ts +0 -17
  310. package/dist/components/refresher/index.d.ts +0 -1
  311. package/dist/components/refresher/refresher.type.d.ts +0 -11
  312. package/dist/components/refresher/refresher.vue.d.ts +0 -17
  313. package/dist/components/richtext/index.d.ts +0 -1
  314. package/dist/components/richtext/richtext.type.d.ts +0 -1
  315. package/dist/components/richtext/richtext.vue.d.ts +0 -3
  316. package/dist/components/ripple/index.d.ts +0 -1
  317. package/dist/components/ripple/ripple.type.d.ts +0 -3
  318. package/dist/components/ripple/ripple.vue.d.ts +0 -5
  319. package/dist/components/screen/index.d.ts +0 -1
  320. package/dist/components/screen/screen.type.d.ts +0 -1
  321. package/dist/components/screen/screen.vue.d.ts +0 -3
  322. package/dist/components/screen-router/factory.d.ts +0 -19
  323. package/dist/components/screen-router/index.d.ts +0 -2
  324. package/dist/components/screen-router/screen-router.type.d.ts +0 -8
  325. package/dist/components/screen-router/screen-router.vue.d.ts +0 -9
  326. package/dist/components/sheet/index.d.ts +0 -1
  327. package/dist/components/sheet/sheet.type.d.ts +0 -18
  328. package/dist/components/sheet/sheet.vue.d.ts +0 -18
  329. package/dist/components/skeleton/index.d.ts +0 -1
  330. package/dist/components/skeleton/skeleton.type.d.ts +0 -6
  331. package/dist/components/skeleton/skeleton.vue.d.ts +0 -8
  332. package/dist/components/switch/index.d.ts +0 -1
  333. package/dist/components/switch/switch.type.d.ts +0 -7
  334. package/dist/components/switch/switch.vue.d.ts +0 -9
  335. package/dist/components/tab/index.d.ts +0 -1
  336. package/dist/components/tab/tab.type.d.ts +0 -4
  337. package/dist/components/tab/tab.vue.d.ts +0 -5
  338. package/dist/components/tabs/index.d.ts +0 -1
  339. package/dist/components/tabs/tabs.type.d.ts +0 -13
  340. package/dist/components/tabs/tabs.vue.d.ts +0 -15
  341. package/dist/components/text/index.d.ts +0 -1
  342. package/dist/components/text/text.type.d.ts +0 -4
  343. package/dist/components/text/text.vue.d.ts +0 -6
  344. package/dist/components/textarea/index.d.ts +0 -1
  345. package/dist/components/textarea/textarea.type.d.ts +0 -1
  346. package/dist/components/textarea/textarea.vue.d.ts +0 -3
  347. package/dist/components/toast/factory.d.ts +0 -3
  348. package/dist/components/toast/index.d.ts +0 -2
  349. package/dist/components/toast/toast.type.d.ts +0 -11
  350. package/dist/components/toast/toast.vue.d.ts +0 -16
  351. package/dist/components/toggle-password/index.d.ts +0 -1
  352. package/dist/components/toggle-password/toggle-password.type.d.ts +0 -6
  353. package/dist/components/toggle-password/toggle-password.vue.d.ts +0 -9
  354. package/dist/components/toolbar/index.d.ts +0 -1
  355. package/dist/components/toolbar/toolbar.type.d.ts +0 -5
  356. package/dist/components/toolbar/toolbar.vue.d.ts +0 -7
  357. package/dist/factory.d.ts +0 -4
  358. package/dist/index.css +0 -1
  359. package/dist/index.d.ts +0 -4
  360. package/dist/index.es.js +0 -1836
  361. package/dist/index.umd.js +0 -1
  362. package/dist/utils/element.d.ts +0 -2
  363. package/dist/utils/events.d.ts +0 -1
  364. package/dist/utils/index.d.ts +0 -2
@@ -0,0 +1,45 @@
1
+ @use "@toife/sass-layer-generator" as sass;
2
+
3
+ // Classes
4
+ $skeleton: sass.fn-naming-prefix("skeleton");
5
+
6
+ // Properties - layer: skeleton
7
+ $width: sass.fn-naming-var("skeleton", "width");
8
+ $height: sass.fn-naming-var("skeleton", "height");
9
+ $border-radius: sass.fn-naming-var("border-radius");
10
+ $background-color: sass.fn-naming-var("skeleton", "background-color");
11
+ $background-color-subtle: sass.fn-naming-var("skeleton", "background-color", "subtle");
12
+ $transition-duration: sass.fn-naming-var("motion", "duration");
13
+
14
+ .#{$skeleton} {
15
+ width: #{$width};
16
+ height: #{$height};
17
+ position: relative;
18
+ overflow: hidden;
19
+ border-radius: #{$border-radius};
20
+ background-color: rgba(#{$background-color-subtle}, 0.2);
21
+ display: inline-block;
22
+ line-height: 0;
23
+ transition:
24
+ box-shadow #{$transition-duration} ease,
25
+ border-color #{$transition-duration} ease,
26
+ background-color #{$transition-duration} ease,
27
+ color #{$transition-duration} ease,
28
+ border-radius #{$transition-duration} ease;
29
+
30
+ &::after {
31
+ content: "";
32
+ position: absolute;
33
+ inset: 0;
34
+ transform: translateX(-100%);
35
+ background: linear-gradient(90deg, transparent, rgba(#{$background-color}, 1), transparent);
36
+ opacity: 0.2;
37
+ animation: shimmer 1.2s infinite;
38
+ }
39
+ }
40
+
41
+ @keyframes shimmer {
42
+ 100% {
43
+ transform: translateX(100%);
44
+ }
45
+ }
@@ -0,0 +1,7 @@
1
+ // Define
2
+ export type SkeletonProps = {
3
+ width?: string | number;
4
+ height?: string | number;
5
+ role?: string;
6
+ shape?: string;
7
+ };
@@ -0,0 +1,38 @@
1
+ <style lang="scss" src="./skeleton.scss" scoped></style>
2
+ <template src="./skeleton.html"></template>
3
+ <script lang="ts" setup>
4
+ import { computed, inject } from "vue";
5
+ import { type SkeletonProps } from "./skeleton.type";
6
+ import { property, withPrefix } from "../../utils";
7
+ import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../app";
8
+
9
+ /// Define
10
+ /// ------------------------------------------------------------
11
+ const props = withDefaults(defineProps<SkeletonProps>(), {
12
+ width: "100%",
13
+ height: "1rem",
14
+ });
15
+ const appState = inject<AppProviderState>(APP_PROVIDER_STATE_KEY);
16
+
17
+ /// Computed
18
+ /// ------------------------------------------------------------
19
+ const skeletonAttrs = computed(() => {
20
+ const shape = props.shape || appState?.shape.value || "";
21
+ const role = props.role || appState?.role.value || "";
22
+
23
+ return {
24
+ class: [
25
+ withPrefix(["layer", "skeleton"]),
26
+ withPrefix(["role", role]),
27
+ withPrefix(["shape", shape]),
28
+ withPrefix("skeleton"),
29
+ ],
30
+ style: {
31
+ [property(["skeleton", "width"])]:
32
+ props.width + (typeof props.width === "number" ? "px" : ""),
33
+ [property(["skeleton", "height"])]:
34
+ props.height + (typeof props.height === "number" ? "px" : ""),
35
+ },
36
+ };
37
+ });
38
+ </script>
@@ -0,0 +1,2 @@
1
+ export { default as Switch } from "./switch.vue";
2
+ export * from "./switch.type";
@@ -0,0 +1,15 @@
1
+ <div
2
+ v-bind="switchWrapperAttrs"
3
+ :tabindex="disabled ? -1 : 0"
4
+ role="switch"
5
+ :aria-checked="props.modelValue"
6
+ @click="onSwitch"
7
+ @focus="onFocus"
8
+ @blur="onBlur"
9
+ @keydown="onKeydown"
10
+ >
11
+ <div v-bind="switchAttrs">
12
+ <div v-bind="switchIconAttrs"></div>
13
+ </div>
14
+ <slot />
15
+ </div>
@@ -0,0 +1,57 @@
1
+ # `<t-switch>`
2
+
3
+ > Default prefix is `t-` — change via `createToife({ prefix: "..." })`.
4
+
5
+ ## Description
6
+
7
+ Boolean toggle with `v-model`, keyboard support, and basic ARIA.
8
+
9
+ ## Requirements / dependencies
10
+
11
+ | Item | Notes |
12
+ | ----- | -------------------- |
13
+ | Vue | ^3.5 |
14
+ | Other | `t-app` recommended. |
15
+
16
+ ## Basic usage
17
+
18
+ ```vue
19
+ <t-switch v-model="on">Notifications</t-switch>
20
+ ```
21
+
22
+ ## Props
23
+
24
+ | Prop | Type | Default | Description |
25
+ | ------------ | --------- | ------- | --------------------- |
26
+ | `modelValue` | `boolean` | `false` | On state. |
27
+ | `role` | `string` | — | Theme when on. |
28
+ | `shape` | `string` | — | Shape. |
29
+ | `disabled` | `boolean` | — | _(optional in types)_ |
30
+ | `readonly` | `boolean` | `false` | Read-only. |
31
+ | `shadow` | `boolean` | — | Default from app. |
32
+
33
+ **Type source:** `src/components/switch/switch.type.ts`
34
+
35
+ ## Events (emits)
36
+
37
+ | Event | Payload | Description |
38
+ | ------------------- | --------- | ------------- |
39
+ | `update:modelValue` | `boolean` | Toggle state. |
40
+
41
+ ## Slots
42
+
43
+ | Slot | Description |
44
+ | --------- | ----------------------- |
45
+ | `default` | Label beside the track. |
46
+
47
+ ## `v-model`
48
+
49
+ `modelValue` / `update:modelValue`.
50
+
51
+ ## Accessibility (a11y)
52
+
53
+ `role="switch"`, `aria-checked`, Space/Enter.
54
+
55
+ ## See also
56
+
57
+ - Source: `src/components/switch`
@@ -0,0 +1,134 @@
1
+ @use "@toife/sass-layer-generator" as sass;
2
+
3
+ // Classes
4
+ $switch: sass.fn-naming-prefix("switch");
5
+ $switch-icon: sass.fn-naming-prefix("switch-icon");
6
+ $shape-rounded: sass.fn-naming-prefix("shape-rounded");
7
+ $shape-pill: sass.fn-naming-prefix("shape-pill");
8
+ $switch-wrapper: sass.fn-naming-prefix("switch-wrapper");
9
+
10
+ // Properties - switch track (inactive), switch icon (on)
11
+ $background-color: sass.fn-naming-var("switch", "background-color");
12
+ $background-color-hover: sass.fn-naming-var("switch", "background-color", "soft");
13
+ $background-color-inactive: sass.fn-naming-var("switch", "background-color", "subtle");
14
+ $background-color-disabled: sass.fn-naming-var("switch", "background-color", "subtle");
15
+ $background-color-contrast: sass.fn-naming-var("switch", "background-color", "contrast");
16
+ $border-color: sass.fn-naming-var("switch", "border-color");
17
+ $color-hover: sass.fn-naming-var("switch", "color", "strong");
18
+ $transition-duration: sass.fn-naming-var("motion", "duration");
19
+ $border-radius: sass.fn-naming-var("border-radius");
20
+ $spacing-x: sass.fn-naming-var("spacing", "x");
21
+
22
+ .#{$switch-wrapper} {
23
+ display: inline-flex;
24
+ gap: calc(#{$spacing-x} * 2);
25
+ align-items: center;
26
+ cursor: pointer;
27
+ box-shadow: none !important;
28
+
29
+ .#{$switch} {
30
+ height: 1.5rem;
31
+ aspect-ratio: 11/6;
32
+ position: relative;
33
+ overflow: hidden;
34
+ transition:
35
+ background-color #{$transition-duration} ease,
36
+ color #{$transition-duration} ease,
37
+ border-color #{$transition-duration} ease,
38
+ border-radius #{$transition-duration} ease,
39
+ box-shadow #{$transition-duration} ease;
40
+ border-radius: #{$border-radius};
41
+
42
+ .#{$switch-icon} {
43
+ height: calc(100% - 0.3rem);
44
+ position: absolute;
45
+ top: 0;
46
+ background-color: rgb(#{$background-color-contrast});
47
+ border-radius: #{$border-radius};
48
+ aspect-ratio: 1/1;
49
+ margin: 0.15rem;
50
+ transition:
51
+ background-color #{$transition-duration} ease,
52
+ color #{$transition-duration} ease,
53
+ border-color #{$transition-duration} ease,
54
+ border-radius #{$transition-duration} ease,
55
+ transform #{$transition-duration} ease;
56
+ }
57
+
58
+ &.#{$shape-rounded} {
59
+ .#{$switch-icon} {
60
+ border-radius: calc(#{$border-radius} - 10%);
61
+ }
62
+ }
63
+
64
+ &.#{$shape-pill} {
65
+ .#{$switch-icon} {
66
+ border-radius: 50%;
67
+ }
68
+ }
69
+ }
70
+
71
+ &.disabled {
72
+ cursor: not-allowed;
73
+
74
+ .#{$switch} {
75
+ background-color: rgb(#{$background-color-disabled});
76
+ cursor: not-allowed;
77
+ opacity: 0.3;
78
+ }
79
+ }
80
+
81
+ &.readonly {
82
+ cursor: default;
83
+
84
+ .#{$switch} {
85
+ cursor: default;
86
+ }
87
+ }
88
+
89
+ &:not(.on) {
90
+ .#{$switch} {
91
+ background-color: rgb(#{$background-color-inactive});
92
+
93
+ .#{$switch-icon} {
94
+ left: 0;
95
+ }
96
+
97
+ &:not(.disabled):not(.readonly):hover {
98
+ background-color: rgb(#{$background-color-hover});
99
+ }
100
+ }
101
+ }
102
+
103
+ &.on {
104
+ .#{$switch} {
105
+ background-color: rgb(#{$background-color});
106
+
107
+ .#{$switch-icon} {
108
+ right: 0;
109
+ animation: shrink #{$transition-duration} linear;
110
+ animation-fill-mode: forwards;
111
+ }
112
+ }
113
+ }
114
+
115
+ &.focus {
116
+ &.shadow {
117
+ .#{$switch} {
118
+ box-shadow: 0 0 0 0.25rem rgb(#{$border-color}, 0.25);
119
+ }
120
+ }
121
+ }
122
+ }
123
+
124
+ @keyframes shrink {
125
+ 0% {
126
+ transform: scale(1);
127
+ }
128
+ 50% {
129
+ transform: scale(1.5);
130
+ }
131
+ 100% {
132
+ transform: scale(1);
133
+ }
134
+ }
@@ -0,0 +1,13 @@
1
+ // Define
2
+ export type SwitchProps = {
3
+ modelValue?: boolean;
4
+ role?: string;
5
+ shape?: string;
6
+ disabled?: boolean;
7
+ readonly?: boolean;
8
+ shadow?: boolean;
9
+ };
10
+
11
+ export type SwitchEmit = {
12
+ (e: "update:modelValue", value: boolean): void;
13
+ };
@@ -0,0 +1,81 @@
1
+ <style lang="scss" src="./switch.scss" scoped></style>
2
+ <template src="./switch.html"></template>
3
+ <script lang="ts" setup>
4
+ import { computed, inject, ref } from "vue";
5
+ import type { SwitchProps, SwitchEmit } from "./switch.type";
6
+ import { withPrefix } from "../../utils";
7
+ import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../app";
8
+
9
+ /// Define
10
+ /// ------------------------------------------------------------
11
+ const props = withDefaults(defineProps<SwitchProps>(), {
12
+ modelValue: false,
13
+ readonly: false,
14
+ shadow: undefined,
15
+ });
16
+ const emit = defineEmits<SwitchEmit>();
17
+ const appState = inject<AppProviderState>(APP_PROVIDER_STATE_KEY);
18
+
19
+ /// State
20
+ /// ------------------------------------------------------------
21
+ const isFocused = ref(false);
22
+
23
+ /// Computed
24
+ /// ------------------------------------------------------------
25
+ const switchWrapperAttrs = computed(() => {
26
+ const shadow = (props?.shadow !== undefined ? props.shadow : appState?.shadow.value) ?? false;
27
+ return {
28
+ class: [
29
+ withPrefix("switch-wrapper"),
30
+ {
31
+ disabled: props.disabled,
32
+ readonly: props.readonly,
33
+ shadow,
34
+ focus: isFocused.value,
35
+ on: props.modelValue,
36
+ },
37
+ ],
38
+ };
39
+ });
40
+
41
+ const switchAttrs = computed(() => {
42
+ const shape = props.shape || appState?.shape.value || "";
43
+ const baseRole = appState?.role.value || "";
44
+ const role = props.role || baseRole;
45
+ return {
46
+ class: [
47
+ withPrefix(["layer", "switch"]),
48
+ withPrefix(["role", props.modelValue && !props.disabled ? role : baseRole]),
49
+ withPrefix(["shape", shape]),
50
+ withPrefix("switch"),
51
+ ],
52
+ };
53
+ });
54
+
55
+ const switchIconAttrs = {
56
+ class: [withPrefix("switch-icon")],
57
+ } as const;
58
+
59
+ /// Methods
60
+ /// ------------------------------------------------------------
61
+ const onSwitch = () => {
62
+ if (props.disabled || props.readonly) return;
63
+ emit("update:modelValue", !props.modelValue);
64
+ };
65
+
66
+ const onFocus = () => {
67
+ if (props.disabled || props.readonly) return;
68
+ isFocused.value = true;
69
+ };
70
+
71
+ const onBlur = () => {
72
+ if (props.disabled || props.readonly) return;
73
+ isFocused.value = false;
74
+ };
75
+
76
+ const onKeydown = (e: KeyboardEvent) => {
77
+ if (e.key !== " " && e.key !== "Enter") return;
78
+ e.preventDefault();
79
+ onSwitch();
80
+ };
81
+ </script>
@@ -0,0 +1,2 @@
1
+ export * from "./tabs";
2
+ export * from "./tab";
@@ -0,0 +1,2 @@
1
+ export { default as Tab } from "./tab.vue";
2
+ export type { TabProps } from "./tab.type";
@@ -0,0 +1,5 @@
1
+ <li v-bind="tabAttrs">
2
+ <CustomButton block :role="role" :shape="shape" @click="handleClick">
3
+ <slot />
4
+ </CustomButton>
5
+ </li>
@@ -0,0 +1,52 @@
1
+ # `Tab`
2
+
3
+ > **Not** registered by `createToife()` — `import { Tab, Tabs } from "@toife/vue"` (see package README).
4
+
5
+ ## Description
6
+
7
+ One item in `t-tabs`: renders `<li>` + `t-button`; click calls the provider’s `setValue`.
8
+
9
+ ## Requirements / dependencies
10
+
11
+ | Item | Notes |
12
+ | ----- | ------------------------ |
13
+ | Vue | ^3.5 |
14
+ | Other | Must be inside `t-tabs`. |
15
+
16
+ ## Basic usage
17
+
18
+ ```vue
19
+ <script setup lang="ts">
20
+ import { Tabs, Tab } from "@toife/vue";
21
+ </script>
22
+ <template>
23
+ <Tabs v-model="active">
24
+ <Tab value="1">One</Tab>
25
+ <Tab value="2" disabled>Two</Tab>
26
+ </Tabs>
27
+ </template>
28
+ ```
29
+
30
+ ## Props
31
+
32
+ | Prop | Type | Default | Description |
33
+ | ---------- | --------- | ------- | ------------------------------------- |
34
+ | `value` | `string` | — | Tab id (matches `Tabs` `modelValue`). |
35
+ | `disabled` | `boolean` | `false` | Disables selection. |
36
+
37
+ **Type source:** `src/components/tabs/tab/tab.type.ts`
38
+
39
+ ## Events (emits)
40
+
41
+ _None._
42
+
43
+ ## Slots
44
+
45
+ | Slot | Description |
46
+ | --------- | ---------------------------- |
47
+ | `default` | Tab label (inside `Button`). |
48
+
49
+ ## See also
50
+
51
+ - Source: `src/components/tabs/tab`
52
+ - [tabs.md](../tabs/tabs.md)
@@ -0,0 +1,5 @@
1
+ // Define
2
+ export type TabProps = {
3
+ value?: string;
4
+ disabled?: boolean;
5
+ };
@@ -0,0 +1,38 @@
1
+ <template src="./tab.html"></template>
2
+ <script lang="ts" setup>
3
+ import { computed, inject } from "vue";
4
+ import { Button as CustomButton } from "../../button";
5
+ import { type TabProps } from "./tab.type";
6
+ import { withPrefix } from "../../../utils";
7
+ import { type TabsProviderState, TABS_PROVIDER_STATE_KEY } from "../tabs";
8
+
9
+ /// Define
10
+ /// ------------------------------------------------------------
11
+ const props = withDefaults(defineProps<TabProps>(), {
12
+ disabled: false,
13
+ });
14
+ const tabsState = inject<TabsProviderState>(TABS_PROVIDER_STATE_KEY);
15
+
16
+ /// Computed
17
+ /// ------------------------------------------------------------
18
+ const role = computed(() => tabsState?.role.value || "");
19
+ const shape = computed(() => tabsState?.shape.value || "");
20
+ const isActive = computed(() => tabsState?.activeValue.value === props.value);
21
+ const tabAttrs = computed(() => {
22
+ return {
23
+ class: [
24
+ withPrefix("tab"),
25
+ {
26
+ active: isActive.value,
27
+ },
28
+ ],
29
+ };
30
+ });
31
+
32
+ /// Methods
33
+ /// ------------------------------------------------------------
34
+ const handleClick = () => {
35
+ if (props.disabled) return;
36
+ tabsState?.setValue(props.value || "");
37
+ };
38
+ </script>
@@ -0,0 +1,9 @@
1
+ export { default as Tabs } from "./tabs.vue";
2
+ export type {
3
+ TabsProps,
4
+ TabsEmit,
5
+ TabsProviderState,
6
+ TabsVariant,
7
+ TabsPlacement,
8
+ } from "./tabs.type";
9
+ export { TABS_PROVIDER_STATE_KEY } from "./tabs.constants";
@@ -0,0 +1 @@
1
+ export const TABS_PROVIDER_STATE_KEY = "tabs-state";
@@ -0,0 +1,3 @@
1
+ <ul ref="container" v-bind="tabsAttrs">
2
+ <slot />
3
+ </ul>
@@ -0,0 +1,59 @@
1
+ # `<t-tabs>`
2
+
3
+ > Default prefix is `t-` — change via `createToife({ prefix: "..." })`.
4
+
5
+ ## Description
6
+
7
+ Tab bar: `modelValue` is the active `Tab`’s `value`; underline/highlight position is measured from the DOM (`getBoundingClientRect`). Provides state to child `Tab` components.
8
+
9
+ ## Requirements / dependencies
10
+
11
+ | Item | Notes |
12
+ | ----- | ---------------------------------------------------------------------- |
13
+ | Vue | ^3.5 |
14
+ | Other | Children should be `Tab` (named export) — see [tab.md](../tab/tab.md). |
15
+
16
+ ## Basic usage
17
+
18
+ ```vue
19
+ <t-tabs v-model="tab" variant="underline" placement="top-start">
20
+ <Tab value="a">Tab A</Tab>
21
+ <Tab value="b">Tab B</Tab>
22
+ </t-tabs>
23
+ ```
24
+
25
+ ## Props
26
+
27
+ | Prop | Type | Default | Description |
28
+ | ---------------- | --------------- | ------------- | ------------------------------------ |
29
+ | `modelValue` | `string` | `""` | Active tab value (`v-model`). |
30
+ | `placement` | `TabsPlacement` | `"top-start"` | Bar placement + highlight direction. |
31
+ | `variant` | `TabsVariant` | — | `fill` \| `underline` \| `text`. |
32
+ | `role` / `shape` | `string` | — | Theme. |
33
+ | `border` | `number` | `2` | Underline thickness. |
34
+ | `margin` | `number[]` | `[0, 0]` | Margin around highlight. |
35
+ | `divider` | `boolean` | — | Default from app. |
36
+ | `transition` | `boolean` | `true` | Animate highlight. |
37
+
38
+ **Type source:** `src/components/tabs/tabs/tabs.type.ts`
39
+
40
+ ## Events (emits)
41
+
42
+ | Event | Payload | Description |
43
+ | ------------------- | -------- | ----------- |
44
+ | `update:modelValue` | `string` | Tab change. |
45
+
46
+ ## Slots
47
+
48
+ | Slot | Description |
49
+ | --------- | --------------- |
50
+ | `default` | `Tab` children. |
51
+
52
+ ## Provide / inject
53
+
54
+ `TABS_PROVIDER_STATE_KEY`: `activeValue`, `role`, `shape`, `setValue`.
55
+
56
+ ## See also
57
+
58
+ - Source: `src/components/tabs/tabs`
59
+ - [tab.md](../tab/tab.md)