@code-coaching/vuetiful 0.23.1 → 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 +1 -1
  24. package/dist/types/utils/theme/theme.service.d.ts +1 -1
  25. package/dist/vuetiful.es.mjs +12 -18
  26. package/dist/vuetiful.umd.js +3 -3
  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 +10 -13
  143. package/src/utils/theme/theme.service.test.ts +69 -61
  144. package/src/utils/theme/theme.service.ts +19 -20
@@ -1,12 +1,12 @@
1
- import { mount } from "@vue/test-utils";
2
- import { describe, expect, test } from "vitest";
3
- import { ref } from "vue";
4
- import VListbox from "./VListbox.vue";
5
- import VListboxItem from "./VListboxItem.vue";
1
+ import { mount } from '@vue/test-utils';
2
+ import { describe, expect, test } from 'vitest';
3
+ import { ref } from 'vue';
4
+ import VListbox from './VListbox.vue';
5
+ import VListboxItem from './VListboxItem.vue';
6
6
 
7
- describe("VListboxItem props", () => {
8
- test("defaults", async () => {
9
- const listboxValue = ref("John");
7
+ describe('VListboxItem props', () => {
8
+ test('defaults', async () => {
9
+ const listboxValue = ref('John');
10
10
  const wrapper = mount({
11
11
  setup() {
12
12
  return { listboxValue };
@@ -18,34 +18,34 @@ describe("VListboxItem props", () => {
18
18
  </v-listbox>
19
19
  `,
20
20
  components: {
21
- "v-listbox": VListbox,
22
- "v-listbox-item": VListboxItem,
21
+ 'v-listbox': VListbox,
22
+ 'v-listbox-item': VListboxItem,
23
23
  },
24
24
  });
25
25
 
26
26
  const listbox = wrapper.find("[data-test='listbox']");
27
- await listbox.find("button").trigger("click");
27
+ await listbox.find('button').trigger('click');
28
28
 
29
29
  const listboxItems = listbox.findAll("[data-test='listbox-item']");
30
30
  const selectedItem = listboxItems[0];
31
31
  const normalItem = listboxItems[1];
32
32
  expect(selectedItem.classes()).toEqual([
33
- "vuetiful-listbox-item",
34
- "px-4",
35
- "py-1",
36
- "text-base",
37
- "rounded-token",
38
- "variant-filled",
39
- "cursor-pointer",
33
+ 'vuetiful-listbox-item',
34
+ 'px-4',
35
+ 'py-1',
36
+ 'text-base',
37
+ 'rounded-token',
38
+ 'variant-filled',
39
+ 'cursor-pointer',
40
40
  ]);
41
41
  expect(normalItem.classes()).toEqual([
42
- "vuetiful-listbox-item",
43
- "px-4",
44
- "py-1",
45
- "text-base",
46
- "rounded-token",
47
- "hover:variant-ghost",
48
- "cursor-pointer",
42
+ 'vuetiful-listbox-item',
43
+ 'px-4',
44
+ 'py-1',
45
+ 'text-base',
46
+ 'rounded-token',
47
+ 'hover:variant-ghost',
48
+ 'cursor-pointer',
49
49
  ]);
50
50
  });
51
51
  });
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
- import { useSettings } from "@/services";
3
- import { ListboxOption } from "@headlessui/vue";
4
- import { inject } from "vue";
2
+ import { useSettings } from '@/services';
3
+ import { ListboxOption } from '@headlessui/vue';
4
+ import { inject } from 'vue';
5
5
 
6
6
  const props = defineProps({
7
7
  value: {
@@ -15,13 +15,12 @@ const props = defineProps({
15
15
  },
16
16
  });
17
17
 
18
- const activeClass = inject("active") as string;
19
- const hoverClass = inject("hover") as string;
20
- const classItem = inject("classItem") as string;
18
+ const activeClass = inject('active') as string;
19
+ const hoverClass = inject('hover') as string;
20
+ const classItem = inject('classItem') as string;
21
21
 
22
22
  const { settings } = useSettings();
23
- const isUnstyled =
24
- settings.global.unstyled || settings.components.listboxItem.unstyled || props.unstyled;
23
+ const isUnstyled = settings.global.unstyled || settings.components.listboxItem.unstyled || props.unstyled;
25
24
  </script>
26
25
 
27
26
  <template>
@@ -1,9 +1,9 @@
1
- import { mount } from "@vue/test-utils";
2
- import { expect, test } from "vitest";
3
- import VListbox from "./VListbox.vue";
4
- import VListboxItem from "./VListboxItem.vue";
1
+ import { mount } from '@vue/test-utils';
2
+ import { expect, test } from 'vitest';
3
+ import VListbox from './VListbox.vue';
4
+ import VListboxItem from './VListboxItem.vue';
5
5
 
6
- test("VListboxItems defaults", async () => {
6
+ test('VListboxItems defaults', async () => {
7
7
  const wrapper = mount({
8
8
  template: /*html*/ `
9
9
  <v-listbox>
@@ -11,19 +11,19 @@ test("VListboxItems defaults", async () => {
11
11
  </v-listbox>
12
12
  `,
13
13
  components: {
14
- "v-listbox": VListbox,
15
- "v-listbox-item": VListboxItem,
14
+ 'v-listbox': VListbox,
15
+ 'v-listbox-item': VListboxItem,
16
16
  },
17
17
  });
18
18
 
19
19
  const listbox = wrapper.find("[data-test='listbox']");
20
- await listbox.find("button").trigger("click");
20
+ await listbox.find('button').trigger('click');
21
21
 
22
22
  const listboxItems = listbox.find("[data-test='listbox-items']");
23
- expect(listboxItems.classes()).toContain("flex-col");
23
+ expect(listboxItems.classes()).toContain('flex-col');
24
24
  });
25
25
 
26
- test("VListboxItems horizontal", async () => {
26
+ test('VListboxItems horizontal', async () => {
27
27
  const wrapper = mount({
28
28
  template: /*html*/ `
29
29
  <v-listbox horizontal>
@@ -31,14 +31,14 @@ test("VListboxItems horizontal", async () => {
31
31
  </v-listbox>
32
32
  `,
33
33
  components: {
34
- "v-listbox": VListbox,
35
- "v-listbox-item": VListboxItem,
34
+ 'v-listbox': VListbox,
35
+ 'v-listbox-item': VListboxItem,
36
36
  },
37
37
  });
38
38
 
39
39
  const listbox = wrapper.find("[data-test='listbox']");
40
- await listbox.find("button").trigger("click");
40
+ await listbox.find('button').trigger('click');
41
41
 
42
42
  const listboxItems = listbox.find("[data-test='listbox-items']");
43
- expect(listboxItems.classes()).not.toContain("flex-col");
43
+ expect(listboxItems.classes()).not.toContain('flex-col');
44
44
  });
@@ -1,12 +1,12 @@
1
1
  <script setup lang="ts">
2
- import { useSettings } from "@/index";
3
- import { ListboxOptions } from "@headlessui/vue";
4
- import { inject } from "vue";
2
+ import { useSettings } from '@/index';
3
+ import { ListboxOptions } from '@headlessui/vue';
4
+ import { inject } from 'vue';
5
5
 
6
6
  const props = defineProps({
7
7
  as: {
8
8
  type: String,
9
- default: "ul",
9
+ default: 'ul',
10
10
  },
11
11
  static: {
12
12
  type: Boolean,
@@ -19,10 +19,10 @@ const props = defineProps({
19
19
  },
20
20
  });
21
21
 
22
- const background = inject("background") as string;
23
- const text = inject("text") as string;
24
- const horizontal = inject("horizontal") as boolean;
25
- const classItems = inject("classItems") as string;
22
+ const background = inject('background') as string;
23
+ const text = inject('text') as string;
24
+ const horizontal = inject('horizontal') as boolean;
25
+ const classItems = inject('classItems') as string;
26
26
 
27
27
  const { settings } = useSettings();
28
28
  const isUnstyled = settings.global.unstyled || settings.components.listbox.unstyled || props.unstyled;
@@ -33,9 +33,7 @@ const isUnstyled = settings.global.unstyled || settings.components.listbox.unsty
33
33
  :as="as"
34
34
  :static="static"
35
35
  :class="`z-10 ${
36
- isUnstyled
37
- ? ''
38
- : `rounded-container-token' gap-1 p-4 border-token border-surface-400-500-token`
36
+ isUnstyled ? '' : `rounded-container-token' gap-1 p-4 border-token border-surface-400-500-token`
39
37
  } ${background} ${text} ${horizontal ? 'flex' : 'flex-col'} ${classItems}`"
40
38
  data-test="listbox-items"
41
39
  >
@@ -1,30 +1,30 @@
1
- import { mount } from "@vue/test-utils";
2
- import { expect, test } from "vitest";
3
- import VListbox from "./VListbox.vue";
1
+ import { mount } from '@vue/test-utils';
2
+ import { expect, test } from 'vitest';
3
+ import VListbox from './VListbox.vue';
4
4
 
5
- test("VListboxLabel using slot", () => {
5
+ test('VListboxLabel using slot', () => {
6
6
  const wrapper = mount({
7
7
  template: `
8
8
  <v-listbox></v-listbox>
9
9
  `,
10
10
  components: {
11
- "v-listbox": VListbox,
11
+ 'v-listbox': VListbox,
12
12
  },
13
13
  });
14
14
 
15
- expect(wrapper.text()).toBe("Select an option");
15
+ expect(wrapper.text()).toBe('Select an option');
16
16
  });
17
17
 
18
- test("VListboxLabel custom label", () => {
18
+ test('VListboxLabel custom label', () => {
19
19
  const wrapper = mount({
20
20
  template: `
21
21
  <v-listbox text-label="John Duck"></v-listbox>
22
22
  `,
23
23
  components: {
24
- "v-listbox": VListbox,
24
+ 'v-listbox': VListbox,
25
25
  },
26
26
  });
27
27
 
28
- const label = wrapper.find("label");
29
- expect(label.text()).toBe("John Duck");
28
+ const label = wrapper.find('label');
29
+ expect(label.text()).toBe('John Duck');
30
30
  });
@@ -1,10 +1,10 @@
1
1
  <script setup lang="ts">
2
- import { ListboxLabel } from "@headlessui/vue";
2
+ import { ListboxLabel } from '@headlessui/vue';
3
3
 
4
4
  defineProps({
5
5
  as: {
6
6
  type: String,
7
- default: "label",
7
+ default: 'label',
8
8
  },
9
9
  });
10
10
  </script>
@@ -1,32 +1,32 @@
1
- import { mount } from "@vue/test-utils";
2
- import { describe, expect, test } from "vitest";
3
- import { VPreview } from ".";
1
+ import { mount } from '@vue/test-utils';
2
+ import { describe, expect, test } from 'vitest';
3
+ import { VPreview } from '.';
4
4
 
5
- test("VPreview", () => {
5
+ test('VPreview', () => {
6
6
  expect(VPreview).toBeTruthy();
7
7
  });
8
8
 
9
- describe("VPreview", () => {
10
- test("defaults", () => {
9
+ describe('VPreview', () => {
10
+ test('defaults', () => {
11
11
  const wrapper = mount(VPreview);
12
12
 
13
13
  expect(wrapper.props()).toEqual({
14
- background: "neutral",
14
+ background: 'neutral',
15
15
  hideSwatches: false,
16
- regionFooter: "",
17
- regionHeader: "",
18
- regionPreview: "",
19
- regionSource: "",
20
- regionViewport: "",
16
+ regionFooter: '',
17
+ regionHeader: '',
18
+ regionPreview: '',
19
+ regionSource: '',
20
+ regionViewport: '',
21
21
  hideMobileToggle: false,
22
22
  });
23
23
  });
24
24
 
25
- describe("given code radio item is selected", () => {
26
- test("renders source code", async () => {
25
+ describe('given code radio item is selected', () => {
26
+ test('renders source code', async () => {
27
27
  const wrapper = mount(VPreview, {
28
28
  props: {
29
- regionSource: "source",
29
+ regionSource: 'source',
30
30
  },
31
31
  });
32
32
 
@@ -34,40 +34,40 @@ describe("VPreview", () => {
34
34
  expect(wrapper.find("[data-test='previewer-preview']").exists()).toBe(true);
35
35
 
36
36
  const radioItemCode = wrapper.find("[data-test='radio-item-code']");
37
- await radioItemCode.trigger("click");
37
+ await radioItemCode.trigger('click');
38
38
 
39
39
  expect(wrapper.find("[data-test='previewer-source']").exists()).toBe(true);
40
40
  expect(wrapper.find("[data-test='previewer-preview']").exists()).toBe(false);
41
41
  });
42
42
  });
43
43
 
44
- describe("given the swatch button is clicked", () => {
45
- test("renders swatches", async () => {
44
+ describe('given the swatch button is clicked', () => {
45
+ test('renders swatches', async () => {
46
46
  const wrapper = mount(VPreview);
47
47
 
48
48
  expect(wrapper.find("[data-test='swatches']").exists()).toBe(false);
49
49
 
50
50
  const swatchButton = wrapper.find("[data-test='swatch-button']");
51
- await swatchButton.trigger("click");
51
+ await swatchButton.trigger('click');
52
52
 
53
53
  expect(wrapper.find("[data-test='swatches']").exists()).toBe(true);
54
54
  });
55
55
  });
56
56
 
57
- describe("given the mobile toggle button is clicked", () => {
58
- test("renders mobile preview", async () => {
57
+ describe('given the mobile toggle button is clicked', () => {
58
+ test('renders mobile preview', async () => {
59
59
  const wrapper = mount(VPreview);
60
60
 
61
61
  const before = wrapper.find("[data-test='previewer-preview']");
62
- expect(before.classes()).not.toContain("mobile-screen");
63
- expect(before.classes()).toContain("w-full");
62
+ expect(before.classes()).not.toContain('mobile-screen');
63
+ expect(before.classes()).toContain('w-full');
64
64
 
65
65
  const radioItemMobile = wrapper.find("[data-test='radio-item-mobile']");
66
- await radioItemMobile.trigger("click");
66
+ await radioItemMobile.trigger('click');
67
67
 
68
68
  const after = wrapper.find("[data-test='previewer-preview']");
69
- expect(after.classes()).toContain("mobile-screen");
70
- expect(after.classes()).not.toContain("w-full");
69
+ expect(after.classes()).toContain('mobile-screen');
70
+ expect(after.classes()).not.toContain('w-full');
71
71
  });
72
72
  });
73
73
  });
@@ -1,19 +1,19 @@
1
1
  <script setup lang="ts">
2
- import { VButton, VRadioGroup, VRadioItem } from "@/index";
3
- import { ref } from "vue";
2
+ import { VButton, VRadioGroup, VRadioItem } from '@/index';
3
+ import { ref } from 'vue';
4
4
 
5
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",
6
+ 'bg-transparent': 'bg-transparent',
7
+ 'neutral-opaque': 'bg-white/50 dark:bg-black/50',
8
+ neutral: 'bg-surface-100-800-token',
9
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",
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
17
 
18
18
  // TODO: implement gradient backgrounds
19
19
  // 'primary-to-secondary': 'bg-gradient-to-br variant-gradient-primary-secondary',
@@ -41,35 +41,35 @@ const props = defineProps({
41
41
  },
42
42
  background: {
43
43
  type: String,
44
- default: "neutral",
44
+ default: 'neutral',
45
45
  },
46
46
 
47
47
  // Props (regions)
48
48
  regionHeader: {
49
49
  type: String,
50
- default: "",
50
+ default: '',
51
51
  },
52
52
  regionViewport: {
53
53
  type: String,
54
- default: "",
54
+ default: '',
55
55
  },
56
56
  regionPreview: {
57
57
  type: String,
58
- default: "",
58
+ default: '',
59
59
  },
60
60
  regionFooter: {
61
61
  type: String,
62
- default: "",
62
+ default: '',
63
63
  },
64
64
  regionSource: {
65
65
  type: String,
66
- default: "",
66
+ default: '',
67
67
  },
68
68
  });
69
69
 
70
70
  const chosenBackground = ref(props.background);
71
- const tabView = ref("preview");
72
- const radioSize = ref("full");
71
+ const tabView = ref('preview');
72
+ const radioSize = ref('full');
73
73
  const swatches = ref(false);
74
74
 
75
75
  const toggleSwatches = () => (swatches.value = !swatches.value);
@@ -193,9 +193,7 @@ const toggleSwatches = () => (swatches.value = !swatches.value);
193
193
  </v-radio-group>
194
194
 
195
195
  <template v-if="tabView === 'preview'">
196
- <div
197
- :class="`vuetiful-previewer-viewport p-4 md:p-10 ${backgrounds[chosenBackground]} ${regionViewport}`"
198
- >
196
+ <div :class="`vuetiful-previewer-viewport p-4 md:p-10 ${backgrounds[chosenBackground]} ${regionViewport}`">
199
197
  <!-- <div v-if="$slots.lead" class="vuetiful-previewer-lead"><slot name="lead" /></div> -->
200
198
  <div
201
199
  data-test="previewer-preview"
@@ -209,10 +207,7 @@ const toggleSwatches = () => (swatches.value = !swatches.value);
209
207
  </div>
210
208
  <!-- <div v-if="$slots.trail" class="vuetiful-previewer-trail"><slot name="trail" /></div> -->
211
209
  </div>
212
- <footer
213
- v-if="$slots.footer"
214
- :class="`vuetiful-previewer-footer variant-soft p-4 ${regionFooter}`"
215
- >
210
+ <footer v-if="$slots.footer" :class="`vuetiful-previewer-footer variant-soft p-4 ${regionFooter}`">
216
211
  <slot name="footer" />
217
212
  </footer>
218
213
  </template>
@@ -1,13 +1,13 @@
1
- import { VRail } from "@/index";
2
- import { mount } from "@vue/test-utils";
3
- import { expect, test } from "vitest";
1
+ import { VRail } from '@/index';
2
+ import { mount } from '@vue/test-utils';
3
+ import { expect, test } from 'vitest';
4
4
 
5
- test("VRail", () => {
5
+ test('VRail', () => {
6
6
  expect(VRail).toBeTruthy();
7
7
  });
8
8
 
9
9
  // TODO: add tests
10
- test("VRail using slot", () => {
10
+ test('VRail using slot', () => {
11
11
  const wrapper = mount(VRail);
12
12
 
13
13
  expect(wrapper).toBeTruthy();
@@ -1,23 +1,23 @@
1
1
  <script setup lang="ts">
2
- import type { CssClasses } from "@/index";
3
- import { VRadioGroup, useRail } from "@/index";
4
- import { provide } from "vue";
2
+ import type { CssClasses } from '@/index';
3
+ import { VRadioGroup, useRail } from '@/index';
4
+ import { provide } from 'vue';
5
5
 
6
6
  const { selectedRailTile } = useRail();
7
7
 
8
8
  const props = defineProps({
9
9
  active: {
10
10
  type: String as () => CssClasses,
11
- default: "variant-filled",
11
+ default: 'variant-filled',
12
12
  },
13
13
  hover: {
14
14
  type: String as () => CssClasses,
15
- default: "hover:variant-ghost hover:text-surface-900 dark:hover:text-surface-50",
15
+ default: 'hover:variant-ghost hover:text-surface-900 dark:hover:text-surface-50',
16
16
  },
17
17
  });
18
18
 
19
- provide("activeRail", props.active);
20
- provide("hoverRail", props.hover);
19
+ provide('activeRail', props.active);
20
+ provide('hoverRail', props.hover);
21
21
  </script>
22
22
 
23
23
  <template>
@@ -1,37 +1,36 @@
1
- import { mount } from "@vue/test-utils";
2
- import { expect, test, describe } from "vitest";
3
- import { VRadioGroup, VRail, VRailTile, useRail } from "@/index";
1
+ import { mount } from '@vue/test-utils';
2
+ import { expect, test, describe } from 'vitest';
3
+ import { VRadioGroup, VRail, VRailTile, useRail } from '@/index';
4
4
 
5
-
6
- describe("VRailTile", () => {
5
+ describe('VRailTile', () => {
7
6
  // TODO: add tests
8
- test("default slot", () => {
7
+ test('default slot', () => {
9
8
  const wrapper = mount({
10
9
  provide: {
11
10
  activeRail: null,
12
11
  hoverRail: null,
13
12
  },
14
- template: /*html*/`
13
+ template: /*html*/ `
15
14
  <v-radio-group>
16
15
  <v-rail-tile>John Duck</v-rail-tile>
17
16
  </v-radio-group>
18
17
  `,
19
18
  components: {
20
- "v-rail-tile": VRailTile,
21
- "v-radio-group": VRadioGroup,
19
+ 'v-rail-tile': VRailTile,
20
+ 'v-radio-group': VRadioGroup,
22
21
  },
23
22
  });
24
-
23
+
25
24
  expect(wrapper).toBeTruthy();
26
25
  });
27
26
 
28
- test("label prop", () => {
27
+ test('label prop', () => {
29
28
  const wrapper = mount({
30
29
  provide: {
31
30
  activeRail: null,
32
31
  hoverRail: null,
33
32
  },
34
- template: /*html*/`
33
+ template: /*html*/ `
35
34
  <v-radio-group>
36
35
  <v-rail-tile label="John Duck label">
37
36
  John Duck
@@ -39,44 +38,44 @@ describe("VRailTile", () => {
39
38
  </v-radio-group>
40
39
  `,
41
40
  components: {
42
- "v-rail-tile": VRailTile,
43
- "v-radio-group": VRadioGroup,
41
+ 'v-rail-tile': VRailTile,
42
+ 'v-radio-group': VRadioGroup,
44
43
  },
45
44
  });
46
45
 
47
46
  const label = wrapper.find('.vuetiful-rail-tile-label');
48
47
  expect(label.text()).toContain('John Duck label');
49
- })
48
+ });
50
49
 
51
- test("no default slot", () => {
50
+ test('no default slot', () => {
52
51
  const wrapper = mount({
53
52
  provide: {
54
53
  activeRail: null,
55
54
  hoverRail: null,
56
55
  },
57
- template: /*html*/`
56
+ template: /*html*/ `
58
57
  <v-radio-group>
59
58
  <v-rail-tile label="John Duck label">
60
59
  </v-rail-tile>
61
60
  </v-radio-group>
62
61
  `,
63
62
  components: {
64
- "v-rail-tile": VRailTile,
65
- "v-radio-group": VRadioGroup,
63
+ 'v-rail-tile': VRailTile,
64
+ 'v-radio-group': VRadioGroup,
66
65
  },
67
66
  });
68
67
 
69
68
  const icon = wrapper.find('.vuetiful-rail-tile-icon');
70
69
  expect(icon.exists()).toBeFalsy();
71
- })
70
+ });
72
71
 
73
- test("selected rail tile", async () => {
72
+ test('selected rail tile', async () => {
74
73
  const wrapper = mount({
75
74
  provide: {
76
75
  activeRail: 'fake-active-class',
77
76
  hoverRail: null,
78
77
  },
79
- template: /*html*/`
78
+ template: /*html*/ `
80
79
  <v-rail data-test="rail">
81
80
  <v-rail-tile data-test='rail-tile' label="John Duck label" value="John Duck">
82
81
  John Duck
@@ -84,16 +83,15 @@ describe("VRailTile", () => {
84
83
  </v-rail>
85
84
  `,
86
85
  components: {
87
- "v-rail-tile": VRailTile,
88
- "v-rail": VRail,
86
+ 'v-rail-tile': VRailTile,
87
+ 'v-rail': VRail,
89
88
  },
90
89
  });
91
90
 
92
91
  const { selectedRailTile } = useRail();
93
- expect(selectedRailTile.value).toBe("");
92
+ expect(selectedRailTile.value).toBe('');
94
93
  const railTile = wrapper.find('.vuetiful-rail-tile');
95
94
  await railTile.trigger('click');
96
95
  expect(selectedRailTile.value).toBe('John Duck');
97
- })
98
- })
99
-
96
+ });
97
+ });