@code-coaching/vuetiful 0.23.0 → 0.23.2

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 (144) hide show
  1. package/dist/style.css +1 -1
  2. package/dist/types/components/VBootstrap.vue.d.ts +1 -1
  3. package/dist/types/components/atoms/VAvatar.vue.d.ts +1 -1
  4. package/dist/types/components/atoms/VLightSwitch.vue.d.ts +2 -2
  5. package/dist/types/components/atoms/index.d.ts +13 -13
  6. package/dist/types/components/index.d.ts +2 -2
  7. package/dist/types/components/molecules/VAlert.vue.d.ts +1 -1
  8. package/dist/types/components/molecules/VCodeBlock.vue.d.ts +2 -2
  9. package/dist/types/components/molecules/VDrawer.vue.d.ts +1 -1
  10. package/dist/types/components/molecules/VListbox/VListbox.vue.d.ts +1 -1
  11. package/dist/types/components/molecules/VRail/VRail.vue.d.ts +1 -1
  12. package/dist/types/components/molecules/VRail/VRailTile.vue.d.ts +1 -1
  13. package/dist/types/components/molecules/index.d.ts +21 -21
  14. package/dist/types/directives/clipboard.d.ts +1 -1
  15. package/dist/types/directives/index.d.ts +1 -1
  16. package/dist/types/index.d.ts +6 -6
  17. package/dist/types/props/props.d.ts +1 -1
  18. package/dist/types/services/dark-mode.service.d.ts +1 -1
  19. package/dist/types/services/drawer.service.d.ts +1 -1
  20. package/dist/types/services/index.d.ts +5 -5
  21. package/dist/types/types/index.d.ts +1 -1
  22. package/dist/types/utils/index.d.ts +2 -2
  23. package/dist/types/utils/theme/theme-switcher.vue.d.ts +23 -63
  24. package/dist/types/utils/theme/theme.service.d.ts +1 -1
  25. package/dist/vuetiful.es.mjs +82 -150
  26. package/dist/vuetiful.umd.js +7 -15
  27. package/package.json +1 -1
  28. package/src/assets/main.css +6 -6
  29. package/src/components/VBootstrap.vue +43 -43
  30. package/src/components/atoms/VAvatar.test.ts +71 -71
  31. package/src/components/atoms/VAvatar.vue +22 -23
  32. package/src/components/atoms/VBadge.test.ts +11 -11
  33. package/src/components/atoms/VBadge.vue +2 -2
  34. package/src/components/atoms/VButton.test.ts +82 -82
  35. package/src/components/atoms/VButton.vue +20 -21
  36. package/src/components/atoms/VChip.test.ts +11 -11
  37. package/src/components/atoms/VChip.vue +3 -3
  38. package/src/components/atoms/VLightSwitch.test.ts +6 -6
  39. package/src/components/atoms/VLightSwitch.vue +26 -31
  40. package/src/components/atoms/VRadio/VRadioDescription.test.ts +13 -13
  41. package/src/components/atoms/VRadio/VRadioDescription.vue +2 -2
  42. package/src/components/atoms/VRadio/VRadioGroup.test.ts +40 -40
  43. package/src/components/atoms/VRadio/VRadioGroup.vue +19 -22
  44. package/src/components/atoms/VRadio/VRadioItem.test.ts +67 -67
  45. package/src/components/atoms/VRadio/VRadioItem.vue +10 -13
  46. package/src/components/atoms/VRadio/VRadioLabel.test.ts +13 -13
  47. package/src/components/atoms/VRadio/VRadioLabel.vue +5 -3
  48. package/src/components/atoms/VSwitch/VSwitch.test.ts +33 -33
  49. package/src/components/atoms/VSwitch/VSwitch.vue +24 -27
  50. package/src/components/atoms/VSwitch/VSwitchDescription.test.ts +13 -13
  51. package/src/components/atoms/VSwitch/VSwitchDescription.vue +2 -2
  52. package/src/components/atoms/VSwitch/VSwitchGroup.test.ts +9 -9
  53. package/src/components/atoms/VSwitch/VSwitchGroup.vue +2 -2
  54. package/src/components/atoms/VSwitch/VSwitchLabel.test.ts +19 -19
  55. package/src/components/atoms/VSwitch/VSwitchLabel.vue +2 -2
  56. package/src/components/atoms/index.ts +13 -13
  57. package/src/components/index.test.ts +3 -3
  58. package/src/components/index.ts +2 -2
  59. package/src/components/molecules/VAccordion/VAccordion.test.ts +11 -17
  60. package/src/components/molecules/VAccordion/VAccordion.vue +3 -3
  61. package/src/components/molecules/VAccordion/VAccordionItem.test.ts +55 -55
  62. package/src/components/molecules/VAccordion/VAccordionItem.vue +9 -22
  63. package/src/components/molecules/VAlert.test.ts +38 -38
  64. package/src/components/molecules/VAlert.vue +25 -47
  65. package/src/components/molecules/VCard/VCard.test.ts +25 -25
  66. package/src/components/molecules/VCard/VCard.vue +13 -15
  67. package/src/components/molecules/VCard/VCardBody.test.ts +14 -14
  68. package/src/components/molecules/VCard/VCardBody.vue +4 -8
  69. package/src/components/molecules/VCard/VCardFooter.test.ts +22 -22
  70. package/src/components/molecules/VCard/VCardFooter.vue +10 -8
  71. package/src/components/molecules/VCard/VCardHeader.test.ts +25 -25
  72. package/src/components/molecules/VCard/VCardHeader.vue +7 -8
  73. package/src/components/molecules/VCodeBlock.test.ts +63 -63
  74. package/src/components/molecules/VCodeBlock.vue +27 -34
  75. package/src/components/molecules/VDrawer.test.ts +5 -5
  76. package/src/components/molecules/VDrawer.vue +10 -10
  77. package/src/components/molecules/VListbox/VListbox.test.ts +53 -53
  78. package/src/components/molecules/VListbox/VListbox.vue +31 -32
  79. package/src/components/molecules/VListbox/VListboxButton.test.ts +13 -13
  80. package/src/components/molecules/VListbox/VListboxButton.vue +5 -5
  81. package/src/components/molecules/VListbox/VListboxItem.test.ts +25 -25
  82. package/src/components/molecules/VListbox/VListboxItem.vue +7 -8
  83. package/src/components/molecules/VListbox/VListboxItems.test.ts +14 -14
  84. package/src/components/molecules/VListbox/VListboxItems.vue +9 -11
  85. package/src/components/molecules/VListbox/VListboxLabel.test.ts +10 -10
  86. package/src/components/molecules/VListbox/VListboxLabel.vue +2 -2
  87. package/src/components/molecules/VPreview.test.ts +26 -26
  88. package/src/components/molecules/VPreview.vue +22 -27
  89. package/src/components/molecules/VRail/VRail.test.ts +5 -5
  90. package/src/components/molecules/VRail/VRail.vue +7 -7
  91. package/src/components/molecules/VRail/VRailTile.test.ts +26 -28
  92. package/src/components/molecules/VRail/VRailTile.vue +13 -11
  93. package/src/components/molecules/VShell.test.ts +5 -5
  94. package/src/components/molecules/VShell.vue +11 -20
  95. package/src/components/molecules/VTabs/VTab.test.ts +48 -52
  96. package/src/components/molecules/VTabs/VTab.vue +13 -17
  97. package/src/components/molecules/VTabs/VTabPanel.test.ts +8 -8
  98. package/src/components/molecules/VTabs/VTabPanel.vue +1 -1
  99. package/src/components/molecules/VTabs/VTabs.test.ts +36 -36
  100. package/src/components/molecules/VTabs/VTabs.vue +18 -22
  101. package/src/components/molecules/index.ts +21 -21
  102. package/src/directives/clipboard.test.ts +9 -9
  103. package/src/directives/clipboard.ts +2 -2
  104. package/src/directives/index.ts +1 -1
  105. package/src/env.d.ts +2 -2
  106. package/src/index.test.ts +6 -6
  107. package/src/index.ts +7 -7
  108. package/src/props/index.ts +1 -1
  109. package/src/props/props.ts +44 -44
  110. package/src/services/dark-mode.service.test.ts +115 -93
  111. package/src/services/dark-mode.service.ts +9 -9
  112. package/src/services/drawer.service.test.ts +21 -21
  113. package/src/services/drawer.service.ts +10 -10
  114. package/src/services/highlight.service.test.ts +12 -12
  115. package/src/services/highlight.service.ts +1 -1
  116. package/src/services/index.ts +5 -5
  117. package/src/services/rail.service.test.ts +7 -7
  118. package/src/services/rail.service.ts +2 -2
  119. package/src/services/settings.service.test.ts +5 -5
  120. package/src/services/settings.service.ts +1 -1
  121. package/src/styles/all.css +7 -7
  122. package/src/styles/elements/buttons.css +1 -1
  123. package/src/styles/elements/forms.css +7 -7
  124. package/src/styles/elements.css +13 -13
  125. package/src/styles/transitions.css +2 -2
  126. package/src/styles/typography.css +5 -5
  127. package/src/themes/theme-rocket.css +10 -10
  128. package/src/themes/theme-sahara.css +13 -13
  129. package/src/themes/theme-seafoam.css +13 -13
  130. package/src/themes/theme-seasonal.css +4 -4
  131. package/src/themes/theme-skeleton.css +7 -7
  132. package/src/themes/theme-vintage.css +12 -12
  133. package/src/themes/theme-vuetiful-0.0.1.css +13 -13
  134. package/src/types/index.ts +46 -46
  135. package/src/types/tailwind.ts +2 -21
  136. package/src/utils/index.test.ts +3 -3
  137. package/src/utils/index.ts +2 -2
  138. package/src/utils/platform/platform.service.test.ts +6 -6
  139. package/src/utils/platform/platform.service.ts +1 -1
  140. package/src/utils/theme/callback.test.ts +6 -6
  141. package/src/utils/theme/remove.test.ts +8 -8
  142. package/src/utils/theme/theme-switcher.vue +58 -131
  143. package/src/utils/theme/theme.service.test.ts +69 -61
  144. package/src/utils/theme/theme.service.ts +19 -20
@@ -1,39 +1,41 @@
1
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";
2
+ import type { CssClasses } from '@/index';
3
+ import { VRadioItem } from '@/index';
4
+ import { useRail } from '@/services';
5
+ import { inject } from 'vue';
6
6
 
7
7
  defineProps({
8
8
  value: {
9
9
  type: String,
10
- default: "",
10
+ default: '',
11
11
  },
12
12
  label: {
13
13
  type: String as () => string,
14
- default: "",
14
+ default: '',
15
15
  },
16
16
 
17
17
  regionIcon: {
18
18
  type: String as () => CssClasses,
19
- default: "",
19
+ default: '',
20
20
  },
21
21
  regionLabel: {
22
22
  type: String as () => CssClasses,
23
- default: "",
23
+ default: '',
24
24
  },
25
25
  });
26
26
 
27
27
  const { selectedRailTile } = useRail();
28
- const activeRail = inject("activeRail");
29
- const hoverRail = inject("hoverRail");
28
+ const activeRail = inject('activeRail');
29
+ const hoverRail = inject('hoverRail');
30
30
  </script>
31
31
 
32
32
  <template>
33
33
  <v-radio-item
34
34
  unstyled
35
35
  :value="value"
36
- :class="`vuetiful-rail-tile grid aspect-square w-full cursor-pointer place-content-center place-items-center ${ selectedRailTile === value ? `${activeRail}` : `${hoverRail}` }`"
36
+ :class="`vuetiful-rail-tile grid aspect-square w-full cursor-pointer place-content-center place-items-center ${
37
+ selectedRailTile === value ? `${activeRail}` : `${hoverRail}`
38
+ }`"
37
39
  >
38
40
  <template v-if="$slots.default">
39
41
  <div :class="`vuetiful-rail-tile-icon ${regionIcon}`"><slot /></div>
@@ -1,13 +1,13 @@
1
- import { mount } from "@vue/test-utils";
2
- import { expect, test } from "vitest";
3
- import { VShell } from ".";
1
+ import { mount } from '@vue/test-utils';
2
+ import { expect, test } from 'vitest';
3
+ import { VShell } from '.';
4
4
 
5
- test("VShell", () => {
5
+ test('VShell', () => {
6
6
  expect(VShell).toBeTruthy();
7
7
  });
8
8
 
9
9
  // TODO: add tests
10
- test("VShell using slot", () => {
10
+ test('VShell using slot', () => {
11
11
  const wrapper = mount(VShell);
12
12
 
13
13
  expect(wrapper).toBeTruthy();
@@ -9,14 +9,14 @@
9
9
  */
10
10
  export type CssClasses = string;
11
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: "" },
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
20
  });
21
21
  </script>
22
22
 
@@ -34,14 +34,8 @@ defineProps({
34
34
  <slot name="sidebarLeft" />
35
35
  </aside>
36
36
 
37
- <div
38
- tabindex="-1"
39
- :class="`vuetiful-page flex flex-1 flex-col overflow-x-hidden ${regionPage ?? ''}`"
40
- >
41
- <header
42
- v-if="$slots.pageHeader"
43
- :class="`vuetiful-page-header flex-none ${slotPageHeader}`"
44
- >
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}`">
45
39
  <slot name="pageHeader" />
46
40
  </header>
47
41
 
@@ -49,10 +43,7 @@ defineProps({
49
43
  <slot />
50
44
  </main>
51
45
 
52
- <footer
53
- v-if="$slots.pageFooter"
54
- :class="`vuetiful-page-footer flex-none ${slotPageFooter}`"
55
- >
46
+ <footer v-if="$slots.pageFooter" :class="`vuetiful-page-footer flex-none ${slotPageFooter}`">
56
47
  <slot name="pageFooter" />
57
48
  </footer>
58
49
  </div>
@@ -1,9 +1,9 @@
1
- import { mount } from "@vue/test-utils";
2
- import { describe, expect, test } from "vitest";
3
- import { VTab, VTabs } from "..";
1
+ import { mount } from '@vue/test-utils';
2
+ import { describe, expect, test } from 'vitest';
3
+ import { VTab, VTabs } from '..';
4
4
 
5
- describe("VTab", () => {
6
- test("defaults", async () => {
5
+ describe('VTab', () => {
6
+ test('defaults', async () => {
7
7
  const wrapper = mount({
8
8
  template: /*html*/ `
9
9
  <v-tabs>
@@ -13,25 +13,25 @@ describe("VTab", () => {
13
13
  </v-tabs>
14
14
  `,
15
15
  components: {
16
- "v-tabs": VTabs,
17
- "v-tab": VTab,
16
+ 'v-tabs': VTabs,
17
+ 'v-tab': VTab,
18
18
  },
19
19
  });
20
20
 
21
21
  const vuetiful = wrapper.find("[data-test='vuetiful']");
22
22
  const slotContainer = vuetiful.find("[data-test='slot-container']");
23
- expect(vuetiful.classes()).toEqual(["vuetiful-tab", "flex", "flex-col"]);
23
+ expect(vuetiful.classes()).toEqual(['vuetiful-tab', 'flex', 'flex-col']);
24
24
  expect(slotContainer.classes()).toEqual([
25
- "vuetiful-tab-content",
26
- "text-base",
27
- "rounded-token",
28
- "w-full",
29
- "px-4",
30
- "py-2",
25
+ 'vuetiful-tab-content',
26
+ 'text-base',
27
+ 'rounded-token',
28
+ 'w-full',
29
+ 'px-4',
30
+ 'py-2',
31
31
  ]);
32
32
  });
33
33
 
34
- test("vertical", async () => {
34
+ test('vertical', async () => {
35
35
  const wrapper = mount({
36
36
  template: /*html*/ `
37
37
  <v-tabs vertical>
@@ -41,16 +41,16 @@ describe("VTab", () => {
41
41
  </v-tabs>
42
42
  `,
43
43
  components: {
44
- "v-tabs": VTabs,
45
- "v-tab": VTab,
44
+ 'v-tabs': VTabs,
45
+ 'v-tab': VTab,
46
46
  },
47
47
  });
48
48
 
49
49
  const vuetiful = wrapper.find("[data-test='vuetiful']");
50
- expect(vuetiful.classes()).toEqual(["vuetiful-tab", "flex", "flex-row", "justify-between"]);
50
+ expect(vuetiful.classes()).toEqual(['vuetiful-tab', 'flex', 'flex-row', 'justify-between']);
51
51
  });
52
52
 
53
- test("class-tab", async () => {
53
+ test('class-tab', async () => {
54
54
  const wrapper = mount({
55
55
  template: /*html*/ `
56
56
  <v-tabs class-tab="my-custom-class">
@@ -60,17 +60,17 @@ describe("VTab", () => {
60
60
  </v-tabs>
61
61
  `,
62
62
  components: {
63
- "v-tabs": VTabs,
64
- "v-tab": VTab,
63
+ 'v-tabs': VTabs,
64
+ 'v-tab': VTab,
65
65
  },
66
66
  });
67
67
 
68
68
  const vuetiful = wrapper.find("[data-test='vuetiful']");
69
69
  const slotContainer = vuetiful.find("[data-test='slot-container']");
70
- expect(slotContainer.classes()).toEqual(["vuetiful-tab-content", "text-base", "rounded-token", "my-custom-class"]);
70
+ expect(slotContainer.classes()).toEqual(['vuetiful-tab-content', 'text-base', 'rounded-token', 'my-custom-class']);
71
71
  });
72
72
 
73
- test("hover/active", async () => {
73
+ test('hover/active', async () => {
74
74
  const wrapper = mount({
75
75
  template: /*html*/ `
76
76
  <v-tabs active="my-custom-active-class">
@@ -82,45 +82,41 @@ describe("VTab", () => {
82
82
  </v-tabs>
83
83
  `,
84
84
  components: {
85
- "v-tabs": VTabs,
86
- "v-tab": VTab,
85
+ 'v-tabs': VTabs,
86
+ 'v-tab': VTab,
87
87
  },
88
88
  });
89
89
 
90
- const vuetifulSlotContainer = wrapper
91
- .find("[data-test='vuetiful']")
92
- .find("[data-test='slot-container']");
90
+ const vuetifulSlotContainer = wrapper.find("[data-test='vuetiful']").find("[data-test='slot-container']");
93
91
  const isSlotContainer = wrapper.find("[data-test='is']").find("[data-test='slot-container']");
94
- const beautifulSlotContainer = wrapper
95
- .find("[data-test='beautiful']")
96
- .find("[data-test='slot-container']");
92
+ const beautifulSlotContainer = wrapper.find("[data-test='beautiful']").find("[data-test='slot-container']");
97
93
 
98
94
  expect(vuetifulSlotContainer.classes()).toEqual([
99
- "vuetiful-tab-content",
100
- "text-base",
101
- "rounded-token",
102
- "my-custom-active-class",
103
- "w-full",
104
- "px-4",
105
- "py-2",
95
+ 'vuetiful-tab-content',
96
+ 'text-base',
97
+ 'rounded-token',
98
+ 'my-custom-active-class',
99
+ 'w-full',
100
+ 'px-4',
101
+ 'py-2',
106
102
  ]);
107
103
  expect(isSlotContainer.classes()).toEqual([
108
- "vuetiful-tab-content",
109
- "text-base",
110
- "rounded-token",
111
- "hover:variant-ghost",
112
- "w-full",
113
- "px-4",
114
- "py-2",
104
+ 'vuetiful-tab-content',
105
+ 'text-base',
106
+ 'rounded-token',
107
+ 'hover:variant-ghost',
108
+ 'w-full',
109
+ 'px-4',
110
+ 'py-2',
115
111
  ]);
116
112
  expect(beautifulSlotContainer.classes()).toEqual([
117
- "vuetiful-tab-content",
118
- "text-base",
119
- "rounded-token",
120
- "hover:variant-ghost",
121
- "w-full",
122
- "px-4",
123
- "py-2",
113
+ 'vuetiful-tab-content',
114
+ 'text-base',
115
+ 'rounded-token',
116
+ 'hover:variant-ghost',
117
+ 'w-full',
118
+ 'px-4',
119
+ 'py-2',
124
120
  ]);
125
121
  });
126
122
  });
@@ -1,8 +1,8 @@
1
1
  <script setup lang="ts">
2
- import { unstyledProp } from "@/props";
3
- import { useSettings } from "@/services";
4
- import { Tab } from "@headlessui/vue";
5
- import { computed, inject } from "vue";
2
+ import { unstyledProp } from '@/props';
3
+ import { useSettings } from '@/services';
4
+ import { Tab } from '@headlessui/vue';
5
+ import { computed, inject } from 'vue';
6
6
 
7
7
  const props = defineProps({
8
8
  disabled: {
@@ -12,15 +12,15 @@ const props = defineProps({
12
12
  unstyled: unstyledProp,
13
13
  });
14
14
 
15
- const activeClass = inject("active") as string;
16
- const hoverClass = inject("hover") as string;
17
- const vertical = inject("vertical") as boolean;
18
- const classTab = inject("classTab") as string;
19
- const hideSeparator = inject("hideSeparator") as boolean;
20
- const classTabSeparator = inject("classTabSeparator") as string;
15
+ const activeClass = inject('active') as string;
16
+ const hoverClass = inject('hover') as string;
17
+ const vertical = inject('vertical') as boolean;
18
+ const classTab = inject('classTab') as string;
19
+ const hideSeparator = inject('hideSeparator') as boolean;
20
+ const classTabSeparator = inject('classTabSeparator') as string;
21
21
 
22
22
  const tabClass = computed(() => {
23
- return classTab ? classTab : "w-full px-4 py-2";
23
+ return classTab ? classTab : 'w-full px-4 py-2';
24
24
  });
25
25
 
26
26
  const { settings } = useSettings();
@@ -37,18 +37,14 @@ const isUnstyled = settings.global.unstyled || settings.components.tab.unstyled
37
37
  <div
38
38
  data-test="slot-container"
39
39
  class="vuetiful-tab-content"
40
- :class="`text-base ${isUnstyled ? '' : 'rounded-token'} ${
41
- selected ? activeClass : hoverClass
42
- } ${tabClass}`"
40
+ :class="`text-base ${isUnstyled ? '' : 'rounded-token'} ${selected ? activeClass : hoverClass} ${tabClass}`"
43
41
  >
44
42
  <slot />
45
43
  </div>
46
44
  <div
47
45
  v-show="selected && !hideSeparator"
48
46
  class="vuetiful-tab-separator"
49
- :class="`z-10 ${
50
- vertical ? 'mr-[-2px] h-full border-r-2' : 'mb-[-2px] w-full border-b-2'
51
- } ${classTabSeparator}`"
47
+ :class="`z-10 ${vertical ? 'mr-[-2px] h-full border-r-2' : 'mb-[-2px] w-full border-b-2'} ${classTabSeparator}`"
52
48
  ></div>
53
49
  </Tab>
54
50
  </template>
@@ -1,10 +1,10 @@
1
- import { TabGroup } from "@headlessui/vue";
2
- import { mount } from "@vue/test-utils";
3
- import { describe, expect, test } from "vitest";
4
- import { VTabPanel } from "..";
1
+ import { TabGroup } from '@headlessui/vue';
2
+ import { mount } from '@vue/test-utils';
3
+ import { describe, expect, test } from 'vitest';
4
+ import { VTabPanel } from '..';
5
5
 
6
- describe("VTabs", () => {
7
- test("default props", () => {
6
+ describe('VTabs', () => {
7
+ test('default props', () => {
8
8
  const wrapper = mount({
9
9
  template: /*html*/ `
10
10
  <TabGroup>
@@ -13,11 +13,11 @@ describe("VTabs", () => {
13
13
  `,
14
14
  components: {
15
15
  TabGroup: TabGroup,
16
- "v-tab-panel": VTabPanel,
16
+ 'v-tab-panel': VTabPanel,
17
17
  },
18
18
  });
19
19
 
20
20
  const tabPanel = wrapper.find("[data-test='tab-panel']");
21
- expect(tabPanel.text()).toEqual("John Duck");
21
+ expect(tabPanel.text()).toEqual('John Duck');
22
22
  });
23
23
  });
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { TabPanel } from "@headlessui/vue";
2
+ import { TabPanel } from '@headlessui/vue';
3
3
  </script>
4
4
 
5
5
  <template>
@@ -1,15 +1,15 @@
1
- import { mount } from "@vue/test-utils";
2
- import { describe, expect, test } from "vitest";
3
- import { VTab, VTabPanel, VTabs } from "..";
1
+ import { mount } from '@vue/test-utils';
2
+ import { describe, expect, test } from 'vitest';
3
+ import { VTab, VTabPanel, VTabs } from '..';
4
4
 
5
- describe("VTabs", () => {
6
- test("hide separator", () => {
5
+ describe('VTabs', () => {
6
+ test('hide separator', () => {
7
7
  const wrapper = mount({
8
8
  template: /*html*/ `
9
9
  <v-tabs hide-separator></v-tabs>
10
10
  `,
11
11
  components: {
12
- "v-tabs": VTabs,
12
+ 'v-tabs': VTabs,
13
13
  },
14
14
  });
15
15
 
@@ -17,7 +17,7 @@ describe("VTabs", () => {
17
17
  expect(separator.exists()).toBeFalsy();
18
18
  });
19
19
 
20
- test("default props", () => {
20
+ test('default props', () => {
21
21
  const wrapper = mount({
22
22
  template: /*html*/ `
23
23
  <v-tabs>
@@ -28,33 +28,33 @@ describe("VTabs", () => {
28
28
  </v-tabs>
29
29
  `,
30
30
  components: {
31
- "v-tabs": VTabs,
32
- "v-tab": VTab,
33
- "v-tab-panel": VTabPanel,
31
+ 'v-tabs': VTabs,
32
+ 'v-tab': VTab,
33
+ 'v-tab-panel': VTabPanel,
34
34
  },
35
35
  });
36
36
 
37
37
  const tabList = wrapper.find("[data-test='vuetiful-tab-list']");
38
38
  expect(tabList.classes()).toEqual([
39
- "vuetiful-tab-list",
40
- "flex",
41
- "!rounded-bl-none",
42
- "!rounded-br-none",
43
- "rounded-container-token",
39
+ 'vuetiful-tab-list',
40
+ 'flex',
41
+ '!rounded-bl-none',
42
+ '!rounded-br-none',
43
+ 'rounded-container-token',
44
44
  ]);
45
- expect(tabList.classes()).not.toContain("flex-col");
45
+ expect(tabList.classes()).not.toContain('flex-col');
46
46
 
47
47
  const tabPanels = wrapper.find("[data-test='vuetiful-tab-panels']");
48
48
  expect(tabPanels.classes()).toEqual([
49
- "vuetiful-tab-panels",
50
- "p-4",
51
- "!rounded-tl-none",
52
- "!rounded-tr-none",
53
- "rounded-container-token",
49
+ 'vuetiful-tab-panels',
50
+ 'p-4',
51
+ '!rounded-tl-none',
52
+ '!rounded-tr-none',
53
+ 'rounded-container-token',
54
54
  ]);
55
55
  });
56
56
 
57
- test("vertical", () => {
57
+ test('vertical', () => {
58
58
  const wrapper = mount({
59
59
  template: /*html*/ `
60
60
  <v-tabs vertical>
@@ -65,28 +65,28 @@ describe("VTabs", () => {
65
65
  </v-tabs>
66
66
  `,
67
67
  components: {
68
- "v-tabs": VTabs,
69
- "v-tab": VTab,
70
- "v-tab-panel": VTabPanel,
68
+ 'v-tabs': VTabs,
69
+ 'v-tab': VTab,
70
+ 'v-tab-panel': VTabPanel,
71
71
  },
72
72
  });
73
73
  const tabList = wrapper.find("[data-test='vuetiful-tab-list']");
74
74
  expect(tabList.classes()).toEqual([
75
- "vuetiful-tab-list",
76
- "flex",
77
- "flex-col",
78
- "!rounded-br-none",
79
- "!rounded-tr-none",
80
- "rounded-container-token",
75
+ 'vuetiful-tab-list',
76
+ 'flex',
77
+ 'flex-col',
78
+ '!rounded-br-none',
79
+ '!rounded-tr-none',
80
+ 'rounded-container-token',
81
81
  ]);
82
82
 
83
83
  const tabPanels = wrapper.find("[data-test='vuetiful-tab-panels']");
84
84
  expect(tabPanels.classes()).toEqual([
85
- "vuetiful-tab-panels",
86
- "p-4",
87
- "!rounded-bl-none",
88
- "!rounded-tl-none",
89
- "rounded-container-token",
85
+ 'vuetiful-tab-panels',
86
+ 'p-4',
87
+ '!rounded-bl-none',
88
+ '!rounded-tl-none',
89
+ 'rounded-container-token',
90
90
  ]);
91
91
  });
92
92
  });
@@ -1,8 +1,8 @@
1
1
  <script setup lang="ts">
2
- import { unstyledProp } from "@/props";
3
- import { useSettings } from "@/services";
4
- import { TabGroup, TabList, TabPanels } from "@headlessui/vue";
5
- import { provide } from "vue";
2
+ import { unstyledProp } from '@/props';
3
+ import { useSettings } from '@/services';
4
+ import { TabGroup, TabList, TabPanels } from '@headlessui/vue';
5
+ import { provide } from 'vue';
6
6
 
7
7
  const props = defineProps({
8
8
  hideSeparator: {
@@ -17,32 +17,32 @@ const props = defineProps({
17
17
 
18
18
  active: {
19
19
  type: String,
20
- default: "",
20
+ default: '',
21
21
  },
22
22
  hover: {
23
23
  type: String,
24
- default: "hover:variant-ghost",
24
+ default: 'hover:variant-ghost',
25
25
  },
26
26
 
27
27
  classPanels: {
28
28
  type: String,
29
- default: "",
29
+ default: '',
30
30
  },
31
31
  classTabs: {
32
32
  type: String,
33
- default: "",
33
+ default: '',
34
34
  },
35
35
  classTab: {
36
36
  type: String,
37
- default: "",
37
+ default: '',
38
38
  },
39
39
  classSeparator: {
40
40
  type: String,
41
- default: "border-surface-400-500-token",
41
+ default: 'border-surface-400-500-token',
42
42
  },
43
43
  classTabSeparator: {
44
44
  type: String,
45
- default: "border-surface-900-50-token",
45
+ default: 'border-surface-900-50-token',
46
46
  },
47
47
 
48
48
  defaultIndex: {
@@ -53,12 +53,12 @@ const props = defineProps({
53
53
  unstyled: unstyledProp,
54
54
  });
55
55
 
56
- provide("active", props.active);
57
- provide("hover", props.hover);
58
- provide("vertical", props.vertical);
59
- provide("classTab", props.classTab);
60
- provide("hideSeparator", props.hideSeparator);
61
- provide("classTabSeparator", props.classTabSeparator);
56
+ provide('active', props.active);
57
+ provide('hover', props.hover);
58
+ provide('vertical', props.vertical);
59
+ provide('classTab', props.classTab);
60
+ provide('hideSeparator', props.hideSeparator);
61
+ provide('classTabSeparator', props.classTabSeparator);
62
62
 
63
63
  const { settings } = useSettings();
64
64
  const isUnstyled = settings.global.unstyled || settings.components.tabs.unstyled || props.unstyled;
@@ -86,11 +86,7 @@ const isUnstyled = settings.global.unstyled || settings.components.tabs.unstyled
86
86
  >
87
87
  <slot name="tabs" />
88
88
  </TabList>
89
- <div
90
- data-test="vuetiful-tab-separator"
91
- v-if="!hideSeparator"
92
- :class="`border ${classSeparator}`"
93
- ></div>
89
+ <div data-test="vuetiful-tab-separator" v-if="!hideSeparator" :class="`border ${classSeparator}`"></div>
94
90
  <TabPanels
95
91
  data-test="vuetiful-tab-panels"
96
92
  :class="`vuetiful-tab-panels
@@ -1,30 +1,30 @@
1
- import VDrawer from "./VDrawer.vue";
2
- import VPreview from "./VPreview.vue";
3
- import VRail from "./VRail/VRail.vue";
4
- import VRailTile from "./VRail/VRailTile.vue";
5
- import VShell from "./VShell.vue";
1
+ import VDrawer from './VDrawer.vue';
2
+ import VPreview from './VPreview.vue';
3
+ import VRail from './VRail/VRail.vue';
4
+ import VRailTile from './VRail/VRailTile.vue';
5
+ import VShell from './VShell.vue';
6
6
 
7
- import VListbox from "./VListbox/VListbox.vue";
8
- import VListboxButton from "./VListbox/VListboxButton.vue";
9
- import VListboxItem from "./VListbox/VListboxItem.vue";
10
- import VListboxItems from "./VListbox/VListboxItems.vue";
11
- import VListboxLabel from "./VListbox/VListboxLabel.vue";
7
+ import VListbox from './VListbox/VListbox.vue';
8
+ import VListboxButton from './VListbox/VListboxButton.vue';
9
+ import VListboxItem from './VListbox/VListboxItem.vue';
10
+ import VListboxItems from './VListbox/VListboxItems.vue';
11
+ import VListboxLabel from './VListbox/VListboxLabel.vue';
12
12
 
13
- import VTab from "./VTabs/VTab.vue";
14
- import VTabPanel from "./VTabs/VTabPanel.vue";
15
- import VTabs from "./VTabs/VTabs.vue";
13
+ import VTab from './VTabs/VTab.vue';
14
+ import VTabPanel from './VTabs/VTabPanel.vue';
15
+ import VTabs from './VTabs/VTabs.vue';
16
16
 
17
- import VAccordion from "./VAccordion/VAccordion.vue";
18
- import VAccordionItem from "./VAccordion/VAccordionItem.vue";
17
+ import VAccordion from './VAccordion/VAccordion.vue';
18
+ import VAccordionItem from './VAccordion/VAccordionItem.vue';
19
19
 
20
- import VAlert from "./VAlert.vue";
20
+ import VAlert from './VAlert.vue';
21
21
 
22
- import VCard from "./VCard/VCard.vue";
23
- import VCardBody from "./VCard/VCardBody.vue";
24
- import VCardFooter from "./VCard/VCardFooter.vue";
25
- import VCardHeader from "./VCard/VCardHeader.vue";
22
+ import VCard from './VCard/VCard.vue';
23
+ import VCardBody from './VCard/VCardBody.vue';
24
+ import VCardFooter from './VCard/VCardFooter.vue';
25
+ import VCardHeader from './VCard/VCardHeader.vue';
26
26
 
27
- import VCodeBlock from "./VCodeBlock.vue";
27
+ import VCodeBlock from './VCodeBlock.vue';
28
28
 
29
29
  export {
30
30
  VAccordion,