@code-coaching/vuetiful 0.25.0 → 0.27.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 (257) hide show
  1. package/README.md +47 -55
  2. package/dist/css/animations.css +2 -0
  3. package/{src → dist}/css/overrides/quasar.css +73 -58
  4. package/{src/styles → dist/css}/transitions/slide.css +6 -0
  5. package/dist/favicon.ico +0 -0
  6. package/dist/types/components/atoms/VAvatar.vue.d.ts +39 -90
  7. package/dist/types/components/atoms/VBadge.vue.d.ts +34 -21
  8. package/dist/types/components/atoms/VButton.vue.d.ts +42 -48
  9. package/dist/types/components/atoms/VChip.vue.d.ts +33 -21
  10. package/dist/types/components/atoms/VLightSwitch.vue.d.ts +5 -5
  11. package/dist/types/components/atoms/VRadio/VRadioDescription.vue.d.ts +7 -12
  12. package/dist/types/components/atoms/VRadio/VRadioGroup.vue.d.ts +53 -83
  13. package/dist/types/components/atoms/VRadio/VRadioItem.vue.d.ts +46 -12
  14. package/dist/types/components/atoms/VRadio/VRadioLabel.vue.d.ts +7 -12
  15. package/dist/types/components/atoms/VSwitch/VSwitch.vue.d.ts +51 -72
  16. package/dist/types/components/atoms/VSwitch/VSwitchDescription.vue.d.ts +32 -11
  17. package/dist/types/components/atoms/VSwitch/VSwitchGroup.vue.d.ts +32 -11
  18. package/dist/types/components/atoms/VSwitch/VSwitchLabel.vue.d.ts +33 -20
  19. package/dist/types/components/molecules/VAccordion/VAccordion.vue.d.ts +39 -28
  20. package/dist/types/components/molecules/VAccordion/VAccordionItem.vue.d.ts +35 -19
  21. package/dist/types/components/molecules/VAlert.vue.d.ts +50 -73
  22. package/dist/types/components/molecules/VCard/VCard.vue.d.ts +37 -48
  23. package/dist/types/components/molecules/VCard/VCardBody.vue.d.ts +33 -12
  24. package/dist/types/components/molecules/VCard/VCardFooter.vue.d.ts +36 -20
  25. package/dist/types/components/molecules/VCard/VCardHeader.vue.d.ts +36 -20
  26. package/dist/types/components/molecules/VCodeBlock.vue.d.ts +15 -16
  27. package/dist/types/components/molecules/VDrawer.vue.d.ts +13 -7
  28. package/dist/types/components/molecules/VListbox/VListbox.vue.d.ts +54 -132
  29. package/dist/types/components/molecules/VListbox/VListboxButton.vue.d.ts +22 -21
  30. package/dist/types/components/molecules/VListbox/VListboxItem.vue.d.ts +22 -19
  31. package/dist/types/components/molecules/VListbox/VListboxItems.vue.d.ts +19 -30
  32. package/dist/types/components/molecules/VListbox/VListboxLabel.vue.d.ts +7 -12
  33. package/dist/types/components/molecules/VPreview.vue.d.ts +57 -74
  34. package/dist/types/components/molecules/VRail/VRail.vue.d.ts +28 -13
  35. package/dist/types/components/molecules/VRail/VRailTile.vue.d.ts +49 -16
  36. package/dist/types/components/molecules/VShell.vue.d.ts +76 -44
  37. package/dist/types/components/molecules/VShellConfigurator.vue.d.ts +99 -0
  38. package/dist/types/components/molecules/VTabs/VTab.vue.d.ts +52 -20
  39. package/dist/types/components/molecules/VTabs/VTabPanel.vue.d.ts +8 -1
  40. package/dist/types/components/molecules/VTabs/VTabs.vue.d.ts +43 -101
  41. package/dist/types/components/molecules/Vuetiful.vue.d.ts +22 -0
  42. package/dist/types/components/molecules/index.d.ts +3 -4
  43. package/dist/types/directives/click-outside-group.d.ts +9 -0
  44. package/dist/types/directives/click-outside.d.ts +9 -0
  45. package/dist/types/directives/clipboard.d.ts +1 -1
  46. package/dist/types/directives/index.d.ts +3 -1
  47. package/dist/types/index.d.ts +1 -8
  48. package/dist/types/props/props.d.ts +1 -14
  49. package/dist/types/services/dark-mode.service.d.ts +1 -1
  50. package/dist/types/services/drawer.service.d.ts +3 -3
  51. package/dist/types/services/index.d.ts +2 -2
  52. package/dist/types/utils/id-generator.d.ts +1 -0
  53. package/dist/types/utils/index.d.ts +3 -4
  54. package/dist/types/utils/tailwind-merge.d.ts +1 -0
  55. package/dist/types/utils/theme/rocket.theme.d.ts +223 -0
  56. package/dist/types/utils/theme/theme-switcher.vue.d.ts +14 -5
  57. package/dist/types/utils/theme/theme.service.d.ts +6 -9
  58. package/dist/types/utils/theme/themes.d.ts +3 -39
  59. package/dist/types/utils/theme/vuetiful.theme.d.ts +224 -0
  60. package/dist/vuetiful.es.mjs +54837 -49494
  61. package/dist/vuetiful.umd.cjs +189 -0
  62. package/package.json +53 -37
  63. package/dist/style.css +0 -10
  64. package/dist/types/components/VBootstrap.vue.d.ts +0 -15
  65. package/dist/types/components/atoms/VAvatar.test.d.ts +0 -1
  66. package/dist/types/components/atoms/VBadge.test.d.ts +0 -1
  67. package/dist/types/components/atoms/VButton.test.d.ts +0 -1
  68. package/dist/types/components/atoms/VChip.test.d.ts +0 -1
  69. package/dist/types/components/atoms/VLightSwitch.test.d.ts +0 -1
  70. package/dist/types/components/atoms/VRadio/VRadioDescription.test.d.ts +0 -1
  71. package/dist/types/components/atoms/VRadio/VRadioGroup.test.d.ts +0 -1
  72. package/dist/types/components/atoms/VRadio/VRadioItem.test.d.ts +0 -1
  73. package/dist/types/components/atoms/VRadio/VRadioLabel.test.d.ts +0 -1
  74. package/dist/types/components/atoms/VSwitch/VSwitch.test.d.ts +0 -1
  75. package/dist/types/components/atoms/VSwitch/VSwitchDescription.test.d.ts +0 -1
  76. package/dist/types/components/atoms/VSwitch/VSwitchGroup.test.d.ts +0 -1
  77. package/dist/types/components/atoms/VSwitch/VSwitchLabel.test.d.ts +0 -1
  78. package/dist/types/components/molecules/VAccordion/VAccordion.test.d.ts +0 -1
  79. package/dist/types/components/molecules/VAccordion/VAccordionItem.test.d.ts +0 -1
  80. package/dist/types/components/molecules/VAlert.test.d.ts +0 -1
  81. package/dist/types/components/molecules/VCard/VCard.test.d.ts +0 -1
  82. package/dist/types/components/molecules/VCard/VCardBody.test.d.ts +0 -1
  83. package/dist/types/components/molecules/VCard/VCardFooter.test.d.ts +0 -1
  84. package/dist/types/components/molecules/VCard/VCardHeader.test.d.ts +0 -1
  85. package/dist/types/components/molecules/VCodeBlock.test.d.ts +0 -1
  86. package/dist/types/components/molecules/VDrawer.test.d.ts +0 -1
  87. package/dist/types/components/molecules/VListbox/VListbox.test.d.ts +0 -1
  88. package/dist/types/components/molecules/VListbox/VListboxButton.test.d.ts +0 -1
  89. package/dist/types/components/molecules/VListbox/VListboxItem.test.d.ts +0 -1
  90. package/dist/types/components/molecules/VListbox/VListboxItems.test.d.ts +0 -1
  91. package/dist/types/components/molecules/VListbox/VListboxLabel.test.d.ts +0 -1
  92. package/dist/types/components/molecules/VPreview.test.d.ts +0 -1
  93. package/dist/types/components/molecules/VRail/VRail.test.d.ts +0 -1
  94. package/dist/types/components/molecules/VRail/VRailTile.test.d.ts +0 -1
  95. package/dist/types/components/molecules/VShell.test.d.ts +0 -1
  96. package/dist/types/components/molecules/VTabs/VTab.test.d.ts +0 -1
  97. package/dist/types/components/molecules/VTabs/VTabPanel.test.d.ts +0 -1
  98. package/dist/types/components/molecules/VTabs/VTabs.test.d.ts +0 -1
  99. package/dist/types/directives/clipboard.test.d.ts +0 -1
  100. package/dist/types/services/dark-mode.service.test.d.ts +0 -1
  101. package/dist/types/services/drawer.service.test.d.ts +0 -1
  102. package/dist/types/services/highlight.service.test.d.ts +0 -1
  103. package/dist/types/services/rail.service.test.d.ts +0 -1
  104. package/dist/types/services/settings.service.test.d.ts +0 -1
  105. package/dist/types/types/index.d.ts +0 -54
  106. package/dist/types/types/tailwind.d.ts +0 -4
  107. package/dist/types/utils/colors/colors.service.d.ts +0 -69
  108. package/dist/types/utils/platform/platform.service.test.d.ts +0 -1
  109. package/dist/types/utils/theme/callback.test.d.ts +0 -1
  110. package/dist/types/utils/theme/remove.test.d.ts +0 -1
  111. package/dist/types/utils/theme/theme.service.test.d.ts +0 -1
  112. package/dist/vuetiful.umd.js +0 -99
  113. package/src/assets/fonts/myfont.woff +0 -0
  114. package/src/assets/main.css +0 -17
  115. package/src/components/VBootstrap.vue +0 -62
  116. package/src/components/atoms/VAvatar.test.ts +0 -175
  117. package/src/components/atoms/VAvatar.vue +0 -89
  118. package/src/components/atoms/VBadge.test.ts +0 -28
  119. package/src/components/atoms/VBadge.vue +0 -17
  120. package/src/components/atoms/VButton.test.ts +0 -180
  121. package/src/components/atoms/VButton.vue +0 -76
  122. package/src/components/atoms/VChip.test.ts +0 -33
  123. package/src/components/atoms/VChip.vue +0 -17
  124. package/src/components/atoms/VLightSwitch.test.ts +0 -69
  125. package/src/components/atoms/VLightSwitch.vue +0 -121
  126. package/src/components/atoms/VRadio/VRadioDescription.test.ts +0 -55
  127. package/src/components/atoms/VRadio/VRadioDescription.vue +0 -14
  128. package/src/components/atoms/VRadio/VRadioGroup.test.ts +0 -81
  129. package/src/components/atoms/VRadio/VRadioGroup.vue +0 -88
  130. package/src/components/atoms/VRadio/VRadioItem.test.ts +0 -183
  131. package/src/components/atoms/VRadio/VRadioItem.vue +0 -36
  132. package/src/components/atoms/VRadio/VRadioLabel.test.ts +0 -55
  133. package/src/components/atoms/VRadio/VRadioLabel.vue +0 -16
  134. package/src/components/atoms/VSwitch/VSwitch.test.ts +0 -100
  135. package/src/components/atoms/VSwitch/VSwitch.vue +0 -106
  136. package/src/components/atoms/VSwitch/VSwitchDescription.test.ts +0 -55
  137. package/src/components/atoms/VSwitch/VSwitchDescription.vue +0 -16
  138. package/src/components/atoms/VSwitch/VSwitchGroup.test.ts +0 -26
  139. package/src/components/atoms/VSwitch/VSwitchGroup.vue +0 -16
  140. package/src/components/atoms/VSwitch/VSwitchLabel.test.ts +0 -89
  141. package/src/components/atoms/VSwitch/VSwitchLabel.vue +0 -20
  142. package/src/components/atoms/index.ts +0 -31
  143. package/src/components/index.ts +0 -2
  144. package/src/components/molecules/VAccordion/VAccordion.test.ts +0 -27
  145. package/src/components/molecules/VAccordion/VAccordion.vue +0 -32
  146. package/src/components/molecules/VAccordion/VAccordionItem.test.ts +0 -134
  147. package/src/components/molecules/VAccordion/VAccordionItem.vue +0 -68
  148. package/src/components/molecules/VAlert.test.ts +0 -100
  149. package/src/components/molecules/VAlert.vue +0 -137
  150. package/src/components/molecules/VCard/VCard.test.ts +0 -47
  151. package/src/components/molecules/VCard/VCard.vue +0 -74
  152. package/src/components/molecules/VCard/VCardBody.test.ts +0 -39
  153. package/src/components/molecules/VCard/VCardBody.vue +0 -16
  154. package/src/components/molecules/VCard/VCardFooter.test.ts +0 -63
  155. package/src/components/molecules/VCard/VCardFooter.vue +0 -31
  156. package/src/components/molecules/VCard/VCardHeader.test.ts +0 -86
  157. package/src/components/molecules/VCard/VCardHeader.vue +0 -53
  158. package/src/components/molecules/VCodeBlock.test.ts +0 -133
  159. package/src/components/molecules/VCodeBlock.vue +0 -113
  160. package/src/components/molecules/VDrawer.test.ts +0 -14
  161. package/src/components/molecules/VDrawer.vue +0 -87
  162. package/src/components/molecules/VListbox/VListbox.test.ts +0 -146
  163. package/src/components/molecules/VListbox/VListbox.vue +0 -149
  164. package/src/components/molecules/VListbox/VListboxButton.test.ts +0 -66
  165. package/src/components/molecules/VListbox/VListboxButton.vue +0 -57
  166. package/src/components/molecules/VListbox/VListboxItem.test.ts +0 -51
  167. package/src/components/molecules/VListbox/VListboxItem.vue +0 -39
  168. package/src/components/molecules/VListbox/VListboxItems.test.ts +0 -44
  169. package/src/components/molecules/VListbox/VListboxItems.vue +0 -42
  170. package/src/components/molecules/VListbox/VListboxLabel.test.ts +0 -30
  171. package/src/components/molecules/VListbox/VListboxLabel.vue +0 -14
  172. package/src/components/molecules/VPreview.test.ts +0 -73
  173. package/src/components/molecules/VPreview.vue +0 -230
  174. package/src/components/molecules/VRail/VRail.test.ts +0 -14
  175. package/src/components/molecules/VRail/VRail.vue +0 -33
  176. package/src/components/molecules/VRail/VRailTile.test.ts +0 -97
  177. package/src/components/molecules/VRail/VRailTile.vue +0 -49
  178. package/src/components/molecules/VShell.test.ts +0 -14
  179. package/src/components/molecules/VShell.vue +0 -63
  180. package/src/components/molecules/VTabs/VTab.test.ts +0 -143
  181. package/src/components/molecules/VTabs/VTab.vue +0 -50
  182. package/src/components/molecules/VTabs/VTabPanel.test.ts +0 -24
  183. package/src/components/molecules/VTabs/VTabPanel.vue +0 -9
  184. package/src/components/molecules/VTabs/VTabs.test.ts +0 -92
  185. package/src/components/molecules/VTabs/VTabs.vue +0 -104
  186. package/src/components/molecules/index.ts +0 -51
  187. package/src/directives/clipboard.test.ts +0 -26
  188. package/src/directives/clipboard.ts +0 -9
  189. package/src/directives/index.ts +0 -3
  190. package/src/env.d.ts +0 -8
  191. package/src/index.ts +0 -21
  192. package/src/props/index.ts +0 -1
  193. package/src/props/props.ts +0 -62
  194. package/src/services/dark-mode.service.test.ts +0 -104
  195. package/src/services/dark-mode.service.ts +0 -75
  196. package/src/services/drawer.service.test.ts +0 -45
  197. package/src/services/drawer.service.ts +0 -46
  198. package/src/services/highlight.service.test.ts +0 -24
  199. package/src/services/highlight.service.ts +0 -19
  200. package/src/services/index.ts +0 -8
  201. package/src/services/rail.service.test.ts +0 -13
  202. package/src/services/rail.service.ts +0 -11
  203. package/src/services/settings.service.test.ts +0 -17
  204. package/src/services/settings.service.ts +0 -136
  205. package/src/styles/all.css +0 -24
  206. package/src/styles/core.css +0 -66
  207. package/src/styles/elements/alerts.css +0 -17
  208. package/src/styles/elements/badges.css +0 -31
  209. package/src/styles/elements/breadcrumbs.css +0 -26
  210. package/src/styles/elements/buttons.css +0 -103
  211. package/src/styles/elements/cards.css +0 -32
  212. package/src/styles/elements/chips.css +0 -22
  213. package/src/styles/elements/forms.css +0 -269
  214. package/src/styles/elements/lists.css +0 -48
  215. package/src/styles/elements/logo-clouds.css +0 -29
  216. package/src/styles/elements/modals.css +0 -15
  217. package/src/styles/elements/placeholders.css +0 -17
  218. package/src/styles/elements/popups.css +0 -16
  219. package/src/styles/elements/tables.css +0 -102
  220. package/src/styles/elements.css +0 -19
  221. package/src/styles/highlight-js.css +0 -116
  222. package/src/styles/tailwind.css +0 -16
  223. package/src/styles/transitions.css +0 -2
  224. package/src/styles/typography.css +0 -101
  225. package/src/styles/variants.css +0 -156
  226. package/src/tailwind/core.cjs +0 -37
  227. package/src/tailwind/generated/intellisense-classes.cjs +0 -558
  228. package/src/tailwind/intellisense.cjs +0 -21
  229. package/src/tailwind/settings.cjs +0 -20
  230. package/src/tailwind/theme/colors.cjs +0 -20
  231. package/src/tailwind/tokens/backgrounds.cjs +0 -48
  232. package/src/tailwind/tokens/border-radius.cjs +0 -21
  233. package/src/tailwind/tokens/borders.cjs +0 -24
  234. package/src/tailwind/tokens/fills.cjs +0 -20
  235. package/src/tailwind/tokens/rings.cjs +0 -50
  236. package/src/tailwind/tokens/text.cjs +0 -35
  237. package/src/tailwind/vuetiful.cjs +0 -19
  238. package/src/themes/theme-rocket.css +0 -119
  239. package/src/themes/theme-sahara.css +0 -128
  240. package/src/themes/theme-seafoam.css +0 -120
  241. package/src/themes/theme-seasonal.css +0 -115
  242. package/src/themes/theme-skeleton.css +0 -115
  243. package/src/themes/theme-vintage.css +0 -125
  244. package/src/themes/theme-vuetiful.css +0 -136
  245. package/src/types/index.ts +0 -59
  246. package/src/types/tailwind.ts +0 -7
  247. package/src/utils/colors/colors.service.ts +0 -293
  248. package/src/utils/index.ts +0 -8
  249. package/src/utils/platform/platform.service.test.ts +0 -19
  250. package/src/utils/platform/platform.service.ts +0 -8
  251. package/src/utils/theme/callback.test.ts +0 -28
  252. package/src/utils/theme/remove.test.ts +0 -27
  253. package/src/utils/theme/theme-switcher.vue +0 -74
  254. package/src/utils/theme/theme.service.test.ts +0 -269
  255. package/src/utils/theme/theme.service.ts +0 -173
  256. package/src/utils/theme/themes.ts +0 -282
  257. /package/{src/styles → dist/css}/transitions/fade.css +0 -0
@@ -1,230 +0,0 @@
1
- <script setup lang="ts">
2
- import { VButton, VRadioGroup, VRadioItem } from '@/index';
3
- import { ref } from 'vue';
4
-
5
- const backgrounds: Record<string, string> = {
6
- 'bg-transparent': 'bg-transparent',
7
- 'neutral-opaque': 'bg-white/50 dark:bg-black/50',
8
- neutral: 'bg-surface-100-800-token',
9
-
10
- 'variant-filled-surface': 'variant-filled-surface',
11
- 'variant-filled-primary': 'variant-filled-primary',
12
- 'variant-filled-secondary': 'variant-filled-secondary',
13
- 'variant-filled-tertiary': 'variant-filled-tertiary',
14
- 'variant-filled-success': 'variant-filled-success',
15
- 'variant-filled-warning': 'variant-filled-warning',
16
- 'variant-filled-error': 'variant-filled-error',
17
-
18
- // TODO: implement gradient backgrounds
19
- // 'primary-to-secondary': 'bg-gradient-to-br variant-gradient-primary-secondary',
20
- // 'secondary-to-tertiary': 'bg-gradient-to-br variant-gradient-secondary-tertiary',
21
- // 'tertiary-to-primary': 'bg-gradient-to-br variant-gradient-tertiary-primary',
22
- // 'secondary-to-primary': 'bg-gradient-to-br variant-gradient-secondary-primary',
23
- // 'tertiary-to-secondary': 'bg-gradient-to-br variant-gradient-tertiary-secondary',
24
- // 'primary-to-tertiary': 'bg-gradient-to-br variant-gradient-primary-tertiary',
25
- // 'success-to-warning': 'bg-gradient-to-br variant-gradient-success-warning',
26
- // 'warning-to-error': 'bg-gradient-to-br variant-gradient-warning-error',
27
- // 'error-to-success': 'bg-gradient-to-br variant-gradient-error-success',
28
- // 'warning-to-success': 'bg-gradient-to-br variant-gradient-warning-success',
29
- // 'error-to-warning': 'bg-gradient-to-br variant-gradient-error-warning',
30
- // 'success-to-error': 'bg-gradient-to-br variant-gradient-success-error',
31
- };
32
-
33
- const props = defineProps({
34
- hideMobileToggle: {
35
- type: Boolean,
36
- default: false,
37
- },
38
- hideSwatches: {
39
- type: Boolean,
40
- default: false,
41
- },
42
- background: {
43
- type: String,
44
- default: 'neutral',
45
- },
46
-
47
- // Props (regions)
48
- regionHeader: {
49
- type: String,
50
- default: '',
51
- },
52
- regionViewport: {
53
- type: String,
54
- default: '',
55
- },
56
- regionPreview: {
57
- type: String,
58
- default: '',
59
- },
60
- regionFooter: {
61
- type: String,
62
- default: '',
63
- },
64
- regionSource: {
65
- type: String,
66
- default: '',
67
- },
68
- });
69
-
70
- const chosenBackground = ref(props.background);
71
- const tabView = ref('preview');
72
- const radioSize = ref('full');
73
- const swatches = ref(false);
74
-
75
- const toggleSwatches = () => (swatches.value = !swatches.value);
76
- </script>
77
-
78
- <template>
79
- <div
80
- class="vuetiful-previewer overflow-hidden shadow-2xl shadow-surface-500/10 rounded-container-token dark:shadow-black/10"
81
- >
82
- <header
83
- :class="`vuetiful-previewer-header flex items-center justify-between gap-4 p-4 bg-surface-200-700-token ${regionHeader}`"
84
- >
85
- <div class="flex items-center gap-2">
86
- <v-radio-group v-model="tabView">
87
- <v-radio-item data-test="radio-item-preview" value="preview" title="Preview">
88
- <slot name="preview-item">
89
- <!-- https://fontawesome.com/icons/eye?f=classic&s=solid -->
90
- <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">
91
- <path
92
- d="M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z"
93
- />
94
- </svg>
95
- </slot>
96
- </v-radio-item>
97
- <v-radio-item data-test="radio-item-code" value="code" title="Code">
98
- <slot name="code-item">
99
- <!-- https://fontawesome.com/icons/code?f=classic&s=solid -->
100
- <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">
101
- <path
102
- d="M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"
103
- />
104
- </svg>
105
- </slot>
106
- </v-radio-item>
107
- </v-radio-group>
108
- <v-radio-group
109
- class="hidden sm:!inline-flex"
110
- v-if="!hideMobileToggle && tabView === 'preview'"
111
- v-model="radioSize"
112
- >
113
- <v-radio-item data-test="radio-item-mobile" value="mobile">
114
- <slot name="mobile-item">
115
- <!-- https://fontawesome.com/icons/mobile-screen?f=classic&s=solid -->
116
- <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">
117
- <path
118
- d="M16 64C16 28.7 44.7 0 80 0H304c35.3 0 64 28.7 64 64V448c0 35.3-28.7 64-64 64H80c-35.3 0-64-28.7-64-64V64zM144 448c0 8.8 7.2 16 16 16h64c8.8 0 16-7.2 16-16s-7.2-16-16-16H160c-8.8 0-16 7.2-16 16zM304 64H80V384H304V64z"
119
- />
120
- </svg>
121
- </slot>
122
- </v-radio-item>
123
- <v-radio-item value="full">
124
- <slot name="desktop-item">
125
- <!-- https://fontawesome.com/icons/display?f=classic&s=solid -->
126
- <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">
127
- <path
128
- d="M64 0C28.7 0 0 28.7 0 64V352c0 35.3 28.7 64 64 64H240l-10.7 32H160c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H346.7L336 416H512c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H64zM512 64V352H64V64H512z"
129
- />
130
- </svg>
131
- </slot>
132
- </v-radio-item>
133
- </v-radio-group>
134
- </div>
135
- <v-button
136
- v-if="!hideSwatches"
137
- data-test="swatch-button"
138
- :variant="swatches ? 'filled' : ''"
139
- class="px-4 py-1 border-token border-surface-400-500-token"
140
- :class="
141
- swatches
142
- ? ''
143
- : 'text-center text-base rounded-token hover:variant-ghost hover:text-surface-900 dark:hover:text-surface-50'
144
- "
145
- @click="toggleSwatches"
146
- title="Backgrounds"
147
- >
148
- <slot name="swatchbook-item">
149
- <!-- https://fontawesome.com/icons/swatchbook?f=classic&s=solid -->
150
- <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
151
- <path
152
- d="M0 32C0 14.3 14.3 0 32 0H160c17.7 0 32 14.3 32 32V416c0 53-43 96-96 96s-96-43-96-96V32zM223.6 425.9c.3-3.3 .4-6.6 .4-9.9V154l75.4-75.4c12.5-12.5 32.8-12.5 45.3 0l90.5 90.5c12.5 12.5 12.5 32.8 0 45.3L223.6 425.9zM182.8 512l192-192H480c17.7 0 32 14.3 32 32V480c0 17.7-14.3 32-32 32H182.8zM128 64H64v64h64V64zM64 192v64h64V192H64zM96 440a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"
153
- />
154
- </svg>
155
- </slot>
156
- </v-button>
157
- </header>
158
-
159
- <!-- There is some odd behavior with test coverage, v-model must be the last property in this component -->
160
- <v-radio-group
161
- v-if="swatches"
162
- data-test="swatches"
163
- :class="`vuetiful-previewer-swatches variant-soft grid grid-cols-6 gap-2 !rounded-none p-4 sm:grid-cols-12`"
164
- active="bg-transparent"
165
- hover="bg-transparent"
166
- v-model="chosenBackground"
167
- >
168
- <v-radio-item
169
- v-for="([key, value], index) in Object.entries(backgrounds)"
170
- :value="key"
171
- :key="index"
172
- :class="`${value} flex aspect-square cursor-pointer items-center justify-center rounded ring-[1px] ring-surface-500/50`"
173
- :title="key"
174
- >
175
- <slot v-if="index === 0 && chosenBackground !== key" name="cancel-item">
176
- <!-- https://fontawesome.com/icons/circle-xmark?f=classic&s=solid -->
177
- <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
178
- <path
179
- d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"
180
- />
181
- </svg>
182
- </slot>
183
-
184
- <slot v-if="chosenBackground === key" name="selected-item">
185
- <!-- https://fontawesome.com/icons/circle-check?f=classic&s=solid -->
186
- <svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
187
- <path
188
- d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"
189
- />
190
- </svg>
191
- </slot>
192
- </v-radio-item>
193
- </v-radio-group>
194
-
195
- <template v-if="tabView === 'preview'">
196
- <div :class="`vuetiful-previewer-viewport p-4 md:p-10 ${backgrounds[chosenBackground]} ${regionViewport}`">
197
- <!-- <div v-if="$slots.lead" class="vuetiful-previewer-lead"><slot name="lead" /></div> -->
198
- <div
199
- data-test="previewer-preview"
200
- :class="`vuetiful-previewer-preview mx-auto flex duration-300 ${
201
- radioSize === 'mobile'
202
- ? 'mobile-screen flex h-[812px] max-w-[375px] flex-col overflow-hidden rounded-3xl border-8 border-black/50 p-2 shadow-2xl dark:border-white/50'
203
- : 'w-full items-center justify-center'
204
- } ${regionPreview}`"
205
- >
206
- <slot name="preview">(preview)</slot>
207
- </div>
208
- <!-- <div v-if="$slots.trail" class="vuetiful-previewer-trail"><slot name="trail" /></div> -->
209
- </div>
210
- <footer v-if="$slots.footer" :class="`vuetiful-previewer-footer variant-soft p-4 ${regionFooter}`">
211
- <slot name="footer" />
212
- </footer>
213
- </template>
214
-
215
- <template v-if="tabView === 'code'">
216
- <div
217
- data-test="previewer-source"
218
- :class="`vuetiful-previewer-source p-4 md:p-10 ${backgrounds['neutral']} ${regionSource}`"
219
- >
220
- <slot name="source">(source)</slot>
221
- </div>
222
- </template>
223
- </div>
224
- </template>
225
-
226
- <style scoped>
227
- .icon {
228
- @apply my-1 h-4 w-4 fill-current;
229
- }
230
- </style>
@@ -1,14 +0,0 @@
1
- import { VRail } from '@/index';
2
- import { mount } from '@vue/test-utils';
3
- import { expect, test } from 'vitest';
4
-
5
- test('VRail', () => {
6
- expect(VRail).toBeTruthy();
7
- });
8
-
9
- // TODO: add tests
10
- test('VRail using slot', () => {
11
- const wrapper = mount(VRail);
12
-
13
- expect(wrapper).toBeTruthy();
14
- });
@@ -1,33 +0,0 @@
1
- <script setup lang="ts">
2
- import type { CssClasses } from '@/index';
3
- import { VRadioGroup, useRail } from '@/index';
4
- import { provide } from 'vue';
5
-
6
- const { selectedRailTile } = useRail();
7
-
8
- const props = defineProps({
9
- active: {
10
- type: String as () => CssClasses,
11
- default: 'variant-filled',
12
- },
13
- hover: {
14
- type: String as () => CssClasses,
15
- default: 'hover:variant-ghost hover:text-surface-900 dark:hover:text-surface-50',
16
- },
17
- });
18
-
19
- provide('activeRail', props.active);
20
- provide('hoverRail', props.hover);
21
- </script>
22
-
23
- <template>
24
- <v-radio-group
25
- v-model="selectedRailTile"
26
- unstyled
27
- hover=""
28
- active=""
29
- class="flex h-full w-[70px] flex-col overflow-y-auto"
30
- >
31
- <slot />
32
- </v-radio-group>
33
- </template>
@@ -1,97 +0,0 @@
1
- import { mount } from '@vue/test-utils';
2
- import { expect, test, describe } from 'vitest';
3
- import { VRadioGroup, VRail, VRailTile, useRail } from '@/index';
4
-
5
- describe('VRailTile', () => {
6
- // TODO: add tests
7
- test('default slot', () => {
8
- const wrapper = mount({
9
- provide: {
10
- activeRail: null,
11
- hoverRail: null,
12
- },
13
- template: /*html*/ `
14
- <v-radio-group>
15
- <v-rail-tile>John Duck</v-rail-tile>
16
- </v-radio-group>
17
- `,
18
- components: {
19
- 'v-rail-tile': VRailTile,
20
- 'v-radio-group': VRadioGroup,
21
- },
22
- });
23
-
24
- expect(wrapper).toBeTruthy();
25
- });
26
-
27
- test('label prop', () => {
28
- const wrapper = mount({
29
- provide: {
30
- activeRail: null,
31
- hoverRail: null,
32
- },
33
- template: /*html*/ `
34
- <v-radio-group>
35
- <v-rail-tile label="John Duck label">
36
- John Duck
37
- </v-rail-tile>
38
- </v-radio-group>
39
- `,
40
- components: {
41
- 'v-rail-tile': VRailTile,
42
- 'v-radio-group': VRadioGroup,
43
- },
44
- });
45
-
46
- const label = wrapper.find('.vuetiful-rail-tile-label');
47
- expect(label.text()).toContain('John Duck label');
48
- });
49
-
50
- test('no default slot', () => {
51
- const wrapper = mount({
52
- provide: {
53
- activeRail: null,
54
- hoverRail: null,
55
- },
56
- template: /*html*/ `
57
- <v-radio-group>
58
- <v-rail-tile label="John Duck label">
59
- </v-rail-tile>
60
- </v-radio-group>
61
- `,
62
- components: {
63
- 'v-rail-tile': VRailTile,
64
- 'v-radio-group': VRadioGroup,
65
- },
66
- });
67
-
68
- const icon = wrapper.find('.vuetiful-rail-tile-icon');
69
- expect(icon.exists()).toBeFalsy();
70
- });
71
-
72
- test('selected rail tile', async () => {
73
- const wrapper = mount({
74
- provide: {
75
- activeRail: 'fake-active-class',
76
- hoverRail: null,
77
- },
78
- template: /*html*/ `
79
- <v-rail data-test="rail">
80
- <v-rail-tile data-test='rail-tile' label="John Duck label" value="John Duck">
81
- John Duck
82
- </v-rail-tile>
83
- </v-rail>
84
- `,
85
- components: {
86
- 'v-rail-tile': VRailTile,
87
- 'v-rail': VRail,
88
- },
89
- });
90
-
91
- const { selectedRailTile } = useRail();
92
- expect(selectedRailTile.value).toBe('');
93
- const railTile = wrapper.find('.vuetiful-rail-tile');
94
- await railTile.trigger('click');
95
- expect(selectedRailTile.value).toBe('John Duck');
96
- });
97
- });
@@ -1,49 +0,0 @@
1
- <script setup lang="ts">
2
- import type { CssClasses } from '@/index';
3
- import { VRadioItem } from '@/index';
4
- import { useRail } from '@/services';
5
- import { inject } from 'vue';
6
-
7
- defineProps({
8
- value: {
9
- type: String,
10
- default: '',
11
- },
12
- label: {
13
- type: String as () => string,
14
- default: '',
15
- },
16
-
17
- regionIcon: {
18
- type: String as () => CssClasses,
19
- default: '',
20
- },
21
- regionLabel: {
22
- type: String as () => CssClasses,
23
- default: '',
24
- },
25
- });
26
-
27
- const { selectedRailTile } = useRail();
28
- const activeRail = inject('activeRail');
29
- const hoverRail = inject('hoverRail');
30
- </script>
31
-
32
- <template>
33
- <v-radio-item
34
- unstyled
35
- :value="value"
36
- :class="`vuetiful-rail-tile grid aspect-square w-full cursor-pointer place-content-center place-items-center ${
37
- selectedRailTile === value ? `${activeRail}` : `${hoverRail}`
38
- }`"
39
- >
40
- <template v-if="$slots.default">
41
- <div :class="`vuetiful-rail-tile-icon ${regionIcon}`"><slot /></div>
42
- </template>
43
- <template v-if="label">
44
- <div :class="`vuetiful-rail-tile-label text-center text-xs font-bold ${regionLabel}`">
45
- {{ label }}
46
- </div>
47
- </template>
48
- </v-radio-item>
49
- </template>
@@ -1,14 +0,0 @@
1
- import { mount } from '@vue/test-utils';
2
- import { expect, test } from 'vitest';
3
- import { VShell } from '.';
4
-
5
- test('VShell', () => {
6
- expect(VShell).toBeTruthy();
7
- });
8
-
9
- // TODO: add tests
10
- test('VShell using slot', () => {
11
- const wrapper = mount(VShell);
12
-
13
- expect(wrapper).toBeTruthy();
14
- });
@@ -1,63 +0,0 @@
1
- <script setup lang="ts">
2
- /**
3
- * @slot fixedHeader - Insert fixed header content, such as Skeleton's App Bar component.
4
- * @slot sidebarLeft - Hidden when empty. Allows you to set fixed left sidebar content.
5
- * @slot sidebarRight - Hidden when empty. Allows you to set fixed right sidebar content.
6
- * @slot pageHeader - Insert content that resides above your page content. Great for global alerts.
7
- * @slot pageFooter - Insert content that resides below your page content. Recommended for most layouts.
8
- * @slot fixedFooter - Insert fixed footer content. Not recommended for most layouts.
9
- */
10
- export type CssClasses = string;
11
- defineProps({
12
- regionPage: { type: String as () => CssClasses, default: '' },
13
- slotFixedHeader: { type: String as () => CssClasses, default: 'z-10' },
14
- slotSidebarLeft: { type: String as () => CssClasses, default: 'w-auto' },
15
- slotSidebarRight: { type: String as () => CssClasses, default: 'w-auto' },
16
- slotPageHeader: { type: String as () => CssClasses, default: '' },
17
- slotPageContent: { type: String as () => CssClasses, default: '' },
18
- slotPageFooter: { type: String as () => CssClasses, default: '' },
19
- slotFixedFooter: { type: String as () => CssClasses, default: '' },
20
- });
21
- </script>
22
-
23
- <template>
24
- <div class="vuetiful-shell flex h-full w-full flex-col overflow-hidden">
25
- <header v-if="$slots.fixedHeader" :class="`vuetiful-fixed-header ${slotFixedHeader}`">
26
- <slot name="fixedHeader" />
27
- </header>
28
-
29
- <div class="vuetiful-shell-content flex h-full w-full flex-auto overflow-hidden">
30
- <aside
31
- v-if="$slots.sidebarLeft"
32
- :class="`vuetiful-sidebar-left overflow-y-auto overflow-x-hidden ${slotSidebarLeft}`"
33
- >
34
- <slot name="sidebarLeft" />
35
- </aside>
36
-
37
- <div tabindex="-1" :class="`vuetiful-page flex flex-1 flex-col overflow-x-hidden ${regionPage ?? ''}`">
38
- <header v-if="$slots.pageHeader" :class="`vuetiful-page-header flex-none ${slotPageHeader}`">
39
- <slot name="pageHeader" />
40
- </header>
41
-
42
- <main :class="`vuetiful-page-content flex-auto ${slotPageContent}`">
43
- <slot />
44
- </main>
45
-
46
- <footer v-if="$slots.pageFooter" :class="`vuetiful-page-footer flex-none ${slotPageFooter}`">
47
- <slot name="pageFooter" />
48
- </footer>
49
- </div>
50
-
51
- <aside
52
- v-if="$slots.sidebarRight"
53
- :class="`vuetiful-sidebar-right flex-none overflow-y-auto overflow-x-hidden ${slotSidebarRight}`"
54
- >
55
- <slot name="sidebarRight" />
56
- </aside>
57
- </div>
58
-
59
- <footer v-if="$slots.fixedFooter" :class="`vuetiful-fixed-footer ${slotFixedFooter}`">
60
- <slot name="fixedFooter" />
61
- </footer>
62
- </div>
63
- </template>
@@ -1,143 +0,0 @@
1
- import { mount } from '@vue/test-utils';
2
- import { describe, expect, test } from 'vitest';
3
- import { VTab, VTabs } from '..';
4
-
5
- describe('VTab', () => {
6
- test('defaults', async () => {
7
- const wrapper = mount({
8
- template: /*html*/ `
9
- <v-tabs>
10
- <template v-slot="tabs">
11
- <v-tab data-test="vuetiful">Vuetiful</v-tab>
12
- </template>
13
- </v-tabs>
14
- `,
15
- components: {
16
- 'v-tabs': VTabs,
17
- 'v-tab': VTab,
18
- },
19
- });
20
-
21
- const vuetiful = wrapper.find("[data-test='vuetiful']");
22
- const slotContainer = vuetiful.find("[data-test='slot-container']");
23
- expect(vuetiful.classes()).toEqual(['vuetiful-tab', 'flex', 'flex-col']);
24
- expect(slotContainer.classes()).toEqual([
25
- 'vuetiful-tab-content',
26
- 'text-base',
27
- 'rounded-token',
28
- 'w-full',
29
- 'px-4',
30
- 'py-2',
31
- ]);
32
- });
33
-
34
- test('vertical', async () => {
35
- const wrapper = mount({
36
- template: /*html*/ `
37
- <v-tabs vertical>
38
- <template v-slot="tabs">
39
- <v-tab data-test="vuetiful">Vuetiful</v-tab>
40
- </template>
41
- </v-tabs>
42
- `,
43
- components: {
44
- 'v-tabs': VTabs,
45
- 'v-tab': VTab,
46
- },
47
- });
48
-
49
- const vuetiful = wrapper.find("[data-test='vuetiful']");
50
- expect(vuetiful.classes()).toEqual(['vuetiful-tab', 'flex', 'flex-row', 'justify-between']);
51
- });
52
-
53
- test('class-tab', async () => {
54
- const wrapper = mount({
55
- template: /*html*/ `
56
- <v-tabs class-tab="my-custom-class">
57
- <template v-slot="tabs">
58
- <v-tab data-test="vuetiful">Vuetiful</v-tab>
59
- </template>
60
- </v-tabs>
61
- `,
62
- components: {
63
- 'v-tabs': VTabs,
64
- 'v-tab': VTab,
65
- },
66
- });
67
-
68
- const vuetiful = wrapper.find("[data-test='vuetiful']");
69
- const slotContainer = vuetiful.find("[data-test='slot-container']");
70
- expect(slotContainer.classes()).toEqual(['vuetiful-tab-content', 'text-base', 'rounded-token', 'my-custom-class']);
71
- });
72
-
73
- test('hover/active', async () => {
74
- const wrapper = mount({
75
- template: /*html*/ `
76
- <v-tabs active="my-custom-active-class">
77
- <template v-slot="tabs">
78
- <v-tab data-test="vuetiful">Vuetiful</v-tab>
79
- <v-tab data-test="is">Is</v-tab>
80
- <v-tab data-test="beautiful">Beautiful</v-tab>
81
- </template>
82
- </v-tabs>
83
- `,
84
- components: {
85
- 'v-tabs': VTabs,
86
- 'v-tab': VTab,
87
- },
88
- });
89
-
90
- const vuetifulSlotContainer = wrapper.find("[data-test='vuetiful']").find("[data-test='slot-container']");
91
- const isSlotContainer = wrapper.find("[data-test='is']").find("[data-test='slot-container']");
92
- const beautifulSlotContainer = wrapper.find("[data-test='beautiful']").find("[data-test='slot-container']");
93
-
94
- expect(vuetifulSlotContainer.classes()).toEqual([
95
- 'vuetiful-tab-content',
96
- 'text-base',
97
- 'rounded-token',
98
- 'my-custom-active-class',
99
- 'w-full',
100
- 'px-4',
101
- 'py-2',
102
- ]);
103
- expect(isSlotContainer.classes()).toEqual([
104
- 'vuetiful-tab-content',
105
- 'text-base',
106
- 'rounded-token',
107
- 'hover:variant-ghost',
108
- 'w-full',
109
- 'px-4',
110
- 'py-2',
111
- ]);
112
- expect(beautifulSlotContainer.classes()).toEqual([
113
- 'vuetiful-tab-content',
114
- 'text-base',
115
- 'rounded-token',
116
- 'hover:variant-ghost',
117
- 'w-full',
118
- 'px-4',
119
- 'py-2',
120
- ]);
121
- });
122
-
123
- test('unstyled', async () => {
124
- const wrapper = mount({
125
- template: /*html*/ `
126
- <v-tabs>
127
- <template v-slot="tabs">
128
- <v-tab unstyled data-test="vuetiful">Vuetiful</v-tab>
129
- </template>
130
- </v-tabs>
131
- `,
132
- components: {
133
- 'v-tabs': VTabs,
134
- 'v-tab': VTab,
135
- },
136
- });
137
-
138
- const vuetiful = wrapper.find("[data-test='vuetiful']");
139
- const slotContainer = vuetiful.find("[data-test='slot-container']");
140
- expect(vuetiful.classes()).toEqual(['vuetiful-tab', 'flex', 'flex-col']);
141
- expect(slotContainer.classes()).not.toContain('rounded-token');
142
- });
143
- });