@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,81 +1,81 @@
1
- import { mount } from "@vue/test-utils";
2
- import { describe, expect, test } from "vitest";
3
- import VRadioGroup from "./VRadioGroup.vue";
1
+ import { mount } from '@vue/test-utils';
2
+ import { describe, expect, test } from 'vitest';
3
+ import VRadioGroup from './VRadioGroup.vue';
4
4
 
5
- test("VRadioGroup using slot", () => {
5
+ test('VRadioGroup using slot', () => {
6
6
  const wrapper = mount(VRadioGroup, {
7
7
  slots: {
8
- default: "John Duck",
8
+ default: 'John Duck',
9
9
  },
10
10
  });
11
11
 
12
- expect(wrapper.text()).toContain("John Duck");
12
+ expect(wrapper.text()).toContain('John Duck');
13
13
  });
14
14
 
15
- test("VRadioGroup default props", () => {
15
+ test('VRadioGroup default props', () => {
16
16
  const wrapper = mount(VRadioGroup);
17
- const radioGroupEl = wrapper.find("div");
17
+ const radioGroupEl = wrapper.find('div');
18
18
  expect(radioGroupEl.classes()).toEqual([
19
- "vuetiful-radio-group",
20
- "inline-flex",
21
- "gap-1",
22
- "p-1",
23
- "border-token",
24
- "border-surface-400-500-token",
25
- "rounded-container-token",
26
- "bg-surface-200-700-token",
27
- "text-surface-900",
28
- "dark:text-surface-50",
19
+ 'vuetiful-radio-group',
20
+ 'inline-flex',
21
+ 'gap-1',
22
+ 'p-1',
23
+ 'border-token',
24
+ 'border-surface-400-500-token',
25
+ 'rounded-container-token',
26
+ 'bg-surface-200-700-token',
27
+ 'text-surface-900',
28
+ 'dark:text-surface-50',
29
29
  ]);
30
30
 
31
31
  const radioGroup = wrapper.find("[data-test='radio-group']");
32
- expect(radioGroup.element.tagName).toBe("DIV");
32
+ expect(radioGroup.element.tagName).toBe('DIV');
33
33
  });
34
34
 
35
- test("VRadioGroup custom class props", () => {
35
+ test('VRadioGroup custom class props', () => {
36
36
  const wrapper = mount(VRadioGroup, {
37
37
  props: {
38
- background: "custom-background-class",
39
- text: "custom-text-class",
38
+ background: 'custom-background-class',
39
+ text: 'custom-text-class',
40
40
  },
41
41
  });
42
- const radioGroupEl = wrapper.find("div");
42
+ const radioGroupEl = wrapper.find('div');
43
43
  expect(radioGroupEl.classes()).toEqual([
44
- "vuetiful-radio-group",
45
- "inline-flex",
46
- "gap-1",
47
- "p-1",
48
- "border-token",
49
- "border-surface-400-500-token",
50
- "rounded-container-token",
51
- "custom-background-class",
52
- "custom-text-class",
44
+ 'vuetiful-radio-group',
45
+ 'inline-flex',
46
+ 'gap-1',
47
+ 'p-1',
48
+ 'border-token',
49
+ 'border-surface-400-500-token',
50
+ 'rounded-container-token',
51
+ 'custom-background-class',
52
+ 'custom-text-class',
53
53
  ]);
54
54
  });
55
55
 
56
56
  test("VRadioGroup custom 'as' prop", () => {
57
57
  const wrapper = mount(VRadioGroup, {
58
58
  props: {
59
- as: "span",
59
+ as: 'span',
60
60
  },
61
61
  });
62
62
 
63
63
  const radioGroup = wrapper.find("[data-test='radio-group']");
64
- expect(radioGroup.element.tagName).toBe("SPAN");
64
+ expect(radioGroup.element.tagName).toBe('SPAN');
65
65
  });
66
66
 
67
- describe("VRadioGroup v-model", () => {
68
- describe("given value changes", () => {
69
- test("should emit update:modelValue", async () => {
67
+ describe('VRadioGroup v-model', () => {
68
+ describe('given value changes', () => {
69
+ test('should emit update:modelValue', async () => {
70
70
  const wrapper = mount(VRadioGroup, {
71
71
  props: {
72
- modelValue: "John Duck",
72
+ modelValue: 'John Duck',
73
73
  },
74
74
  });
75
75
 
76
- wrapper.setProps({ modelValue: "Jane Duck" });
76
+ wrapper.setProps({ modelValue: 'Jane Duck' });
77
77
  await wrapper.vm.$nextTick();
78
- expect(wrapper.emitted()["update:modelValue"][0]).toEqual(["Jane Duck"]);
78
+ expect(wrapper.emitted()['update:modelValue'][0]).toEqual(['Jane Duck']);
79
79
  });
80
80
  });
81
81
  });
@@ -1,13 +1,13 @@
1
1
  <script setup lang="ts">
2
- import { useSettings } from "@/index";
3
- import { RadioGroup } from "@headlessui/vue";
4
- import { provide, ref, watch } from "vue";
2
+ import { useSettings } from '@/index';
3
+ import { RadioGroup } from '@headlessui/vue';
4
+ import { provide, ref, watch } from 'vue';
5
5
 
6
- const emit = defineEmits(["update:modelValue"]);
6
+ const emit = defineEmits(['update:modelValue']);
7
7
  const props = defineProps({
8
8
  as: {
9
9
  type: String,
10
- default: "div",
10
+ default: 'div',
11
11
  },
12
12
 
13
13
  disabled: {
@@ -18,29 +18,29 @@ const props = defineProps({
18
18
  type: [String, Function],
19
19
  },
20
20
 
21
- modelValue: RadioGroup.props["modelValue"],
21
+ modelValue: RadioGroup.props['modelValue'],
22
22
 
23
23
  active: {
24
24
  type: String,
25
- default: "variant-filled",
25
+ default: 'variant-filled',
26
26
  },
27
27
  hover: {
28
28
  type: String,
29
- default: "hover:variant-ghost hover:text-surface-900 dark:hover:text-surface-50",
29
+ default: 'hover:variant-ghost hover:text-surface-900 dark:hover:text-surface-50',
30
30
  },
31
31
 
32
32
  background: {
33
33
  type: String,
34
- default: "bg-surface-200-700-token",
34
+ default: 'bg-surface-200-700-token',
35
35
  },
36
36
  text: {
37
37
  type: String,
38
- default: "text-surface-900 dark:text-surface-50",
38
+ default: 'text-surface-900 dark:text-surface-50',
39
39
  },
40
40
 
41
41
  classItem: {
42
42
  type: String,
43
- default: "",
43
+ default: '',
44
44
  },
45
45
 
46
46
  unstyled: {
@@ -54,22 +54,21 @@ watch(
54
54
  () => props.modelValue,
55
55
  (newValue) => {
56
56
  parentModelValue.value = newValue;
57
- }
57
+ },
58
58
  );
59
59
  watch(
60
60
  () => parentModelValue.value,
61
61
  (newValue) => {
62
- emit("update:modelValue", newValue);
63
- }
62
+ emit('update:modelValue', newValue);
63
+ },
64
64
  );
65
65
 
66
- provide("active", props.active);
67
- provide("hover", props.hover);
68
- provide("classItem", props.classItem);
66
+ provide('active', props.active);
67
+ provide('hover', props.hover);
68
+ provide('classItem', props.classItem);
69
69
 
70
70
  const { settings } = useSettings();
71
- const isUnstyled =
72
- settings.global.unstyled || settings.components.radioGroup.unstyled || props.unstyled;
71
+ const isUnstyled = settings.global.unstyled || settings.components.radioGroup.unstyled || props.unstyled;
73
72
  </script>
74
73
  l
75
74
  <template>
@@ -80,9 +79,7 @@ l
80
79
  :disabled="disabled"
81
80
  :by="by"
82
81
  :class="`vuetiful-radio-group inline-flex ${
83
- isUnstyled
84
- ? ''
85
- : `gap-1 p-1 border-token border-surface-400-500-token rounded-container-token`
82
+ isUnstyled ? '' : `gap-1 p-1 border-token border-surface-400-500-token rounded-container-token`
86
83
  } ${background} ${text}`"
87
84
  v-model="parentModelValue"
88
85
  >
@@ -1,10 +1,10 @@
1
- import { mount } from "@vue/test-utils";
2
- import { describe, expect, test } from "vitest";
3
- import { ref } from "vue";
4
- import VRadioGroup from "./VRadioGroup.vue";
5
- import VRadioItem from "./VRadioItem.vue";
1
+ import { mount } from '@vue/test-utils';
2
+ import { describe, expect, test } from 'vitest';
3
+ import { ref } from 'vue';
4
+ import VRadioGroup from './VRadioGroup.vue';
5
+ import VRadioItem from './VRadioItem.vue';
6
6
 
7
- test("VRadioItem using slot", () => {
7
+ test('VRadioItem using slot', () => {
8
8
  const wrapper = mount({
9
9
  template: `
10
10
  <v-radio-group>
@@ -12,21 +12,21 @@ test("VRadioItem using slot", () => {
12
12
  </v-radio-group>
13
13
  `,
14
14
  components: {
15
- "v-radio-item": VRadioItem,
16
- "v-radio-group": VRadioGroup,
15
+ 'v-radio-item': VRadioItem,
16
+ 'v-radio-group': VRadioGroup,
17
17
  },
18
18
  });
19
19
 
20
20
  const itemEl = wrapper.find("[data-test='item']").element;
21
- expect(itemEl.textContent).toBe("John Duck");
21
+ expect(itemEl.textContent).toBe('John Duck');
22
22
  });
23
23
 
24
- describe("VRadioItem slot states", () => {
25
- describe("given no injected provide", () => {
26
- test("should have the default active class", () => {
24
+ describe('VRadioItem slot states', () => {
25
+ describe('given no injected provide', () => {
26
+ test('should have the default active class', () => {
27
27
  const wrapper = mount({
28
28
  setup() {
29
- const value = ref("John Duck");
29
+ const value = ref('John Duck');
30
30
  return { value };
31
31
  },
32
32
  template: `
@@ -35,20 +35,20 @@ describe("VRadioItem slot states", () => {
35
35
  </v-radio-group>
36
36
  `,
37
37
  components: {
38
- "v-radio-item": VRadioItem,
39
- "v-radio-group": VRadioGroup,
38
+ 'v-radio-item': VRadioItem,
39
+ 'v-radio-group': VRadioGroup,
40
40
  },
41
41
  });
42
42
 
43
- const itemEl = wrapper.find("[data-test='item']").find("div");
44
- expect(itemEl.element.classList.contains("variant-filled")).toBe(true);
45
- expect(itemEl.element.classList.contains("hover:variant-ghost")).toBe(false);
43
+ const itemEl = wrapper.find("[data-test='item']").find('div');
44
+ expect(itemEl.element.classList.contains('variant-filled')).toBe(true);
45
+ expect(itemEl.element.classList.contains('hover:variant-ghost')).toBe(false);
46
46
  });
47
47
 
48
- test("should have the default hover class", () => {
48
+ test('should have the default hover class', () => {
49
49
  const wrapper = mount({
50
50
  setup() {
51
- const value = ref("not John Duck");
51
+ const value = ref('not John Duck');
52
52
  return { value };
53
53
  },
54
54
  template: `
@@ -57,21 +57,21 @@ describe("VRadioItem slot states", () => {
57
57
  </v-radio-group>
58
58
  `,
59
59
  components: {
60
- "v-radio-item": VRadioItem,
61
- "v-radio-group": VRadioGroup,
60
+ 'v-radio-item': VRadioItem,
61
+ 'v-radio-group': VRadioGroup,
62
62
  },
63
63
  });
64
64
 
65
- const itemEl = wrapper.find("[data-test='item']").find("div");
66
- expect(itemEl.element.classList.contains("variant-filled")).toBe(false);
67
- expect(itemEl.element.classList.contains("hover:variant-ghost")).toBe(true);
65
+ const itemEl = wrapper.find("[data-test='item']").find('div');
66
+ expect(itemEl.element.classList.contains('variant-filled')).toBe(false);
67
+ expect(itemEl.element.classList.contains('hover:variant-ghost')).toBe(true);
68
68
  });
69
69
  });
70
- describe("given v-slot checked is true", () => {
71
- test("should have the active class", () => {
70
+ describe('given v-slot checked is true', () => {
71
+ test('should have the active class', () => {
72
72
  const wrapper = mount({
73
73
  setup() {
74
- const value = ref("John Duck");
74
+ const value = ref('John Duck');
75
75
  return { value };
76
76
  },
77
77
  template: `
@@ -80,26 +80,26 @@ describe("VRadioItem slot states", () => {
80
80
  </v-radio-group>
81
81
  `,
82
82
  components: {
83
- "v-radio-item": VRadioItem,
84
- "v-radio-group": VRadioGroup,
83
+ 'v-radio-item': VRadioItem,
84
+ 'v-radio-group': VRadioGroup,
85
85
  },
86
86
  provide: {
87
- active: "custom-active-class",
88
- hover: "custom-hover-class",
87
+ active: 'custom-active-class',
88
+ hover: 'custom-hover-class',
89
89
  },
90
90
  });
91
91
 
92
- const itemEl = wrapper.find("[data-test='item']").find("div");
93
- expect(itemEl.element.classList.contains("custom-active-class")).toBe(true);
94
- expect(itemEl.element.classList.contains("custom-hover-class")).toBe(false);
92
+ const itemEl = wrapper.find("[data-test='item']").find('div');
93
+ expect(itemEl.element.classList.contains('custom-active-class')).toBe(true);
94
+ expect(itemEl.element.classList.contains('custom-hover-class')).toBe(false);
95
95
  });
96
96
  });
97
97
 
98
- describe("given v-slot checked is false", () => {
99
- test("should have the hover class", () => {
98
+ describe('given v-slot checked is false', () => {
99
+ test('should have the hover class', () => {
100
100
  const wrapper = mount({
101
101
  setup() {
102
- const value = ref("not John Duck");
102
+ const value = ref('not John Duck');
103
103
  return { value };
104
104
  },
105
105
  template: `
@@ -108,26 +108,26 @@ describe("VRadioItem slot states", () => {
108
108
  </v-radio-group>
109
109
  `,
110
110
  components: {
111
- "v-radio-item": VRadioItem,
112
- "v-radio-group": VRadioGroup,
111
+ 'v-radio-item': VRadioItem,
112
+ 'v-radio-group': VRadioGroup,
113
113
  },
114
114
  provide: {
115
- active: "custom-active-class",
116
- hover: "custom-hover-class",
115
+ active: 'custom-active-class',
116
+ hover: 'custom-hover-class',
117
117
  },
118
118
  });
119
119
 
120
- const itemEl = wrapper.find("[data-test='item']").find("div");
121
- expect(itemEl.element.classList.contains("custom-active-class")).toBe(false);
122
- expect(itemEl.element.classList.contains("custom-hover-class")).toBe(true);
120
+ const itemEl = wrapper.find("[data-test='item']").find('div');
121
+ expect(itemEl.element.classList.contains('custom-active-class')).toBe(false);
122
+ expect(itemEl.element.classList.contains('custom-hover-class')).toBe(true);
123
123
  });
124
124
  });
125
125
 
126
- describe("given v-slot disabled is false", () => {
127
- test("should not have the disabled classes", () => {
126
+ describe('given v-slot disabled is false', () => {
127
+ test('should not have the disabled classes', () => {
128
128
  const wrapper = mount({
129
129
  setup() {
130
- const value = ref("John Duck");
130
+ const value = ref('John Duck');
131
131
  return { value };
132
132
  },
133
133
  template: `
@@ -136,27 +136,27 @@ describe("VRadioItem slot states", () => {
136
136
  </v-radio-group>
137
137
  `,
138
138
  components: {
139
- "v-radio-item": VRadioItem,
140
- "v-radio-group": VRadioGroup,
139
+ 'v-radio-item': VRadioItem,
140
+ 'v-radio-group': VRadioGroup,
141
141
  },
142
142
  provide: {
143
- active: "custom-active-class",
144
- hover: "custom-hover-class",
143
+ active: 'custom-active-class',
144
+ hover: 'custom-hover-class',
145
145
  },
146
146
  });
147
147
 
148
- const itemEl = wrapper.find("[data-test='item']").find("div");
149
- expect(itemEl.element.classList.contains("cursor-pointer")).toBe(true);
150
- expect(itemEl.element.classList.contains("cursor-not-allowed")).toBe(false);
151
- expect(itemEl.element.classList.contains("opacity-50")).toBe(false);
148
+ const itemEl = wrapper.find("[data-test='item']").find('div');
149
+ expect(itemEl.element.classList.contains('cursor-pointer')).toBe(true);
150
+ expect(itemEl.element.classList.contains('cursor-not-allowed')).toBe(false);
151
+ expect(itemEl.element.classList.contains('opacity-50')).toBe(false);
152
152
  });
153
153
  });
154
154
 
155
- describe("given v-slot disabled is true", () => {
156
- test("should have the disabled classes", () => {
155
+ describe('given v-slot disabled is true', () => {
156
+ test('should have the disabled classes', () => {
157
157
  const wrapper = mount({
158
158
  setup() {
159
- const value = ref("John Duck");
159
+ const value = ref('John Duck');
160
160
  return { value };
161
161
  },
162
162
  template: `
@@ -165,19 +165,19 @@ describe("VRadioItem slot states", () => {
165
165
  </v-radio-group>
166
166
  `,
167
167
  components: {
168
- "v-radio-item": VRadioItem,
169
- "v-radio-group": VRadioGroup,
168
+ 'v-radio-item': VRadioItem,
169
+ 'v-radio-group': VRadioGroup,
170
170
  },
171
171
  provide: {
172
- active: "custom-active-class",
173
- hover: "custom-hover-class",
172
+ active: 'custom-active-class',
173
+ hover: 'custom-hover-class',
174
174
  },
175
175
  });
176
176
 
177
- const itemEl = wrapper.find("[data-test='item']").find("div");
178
- expect(itemEl.element.classList.contains("cursor-pointer")).toBe(false);
179
- expect(itemEl.element.classList.contains("cursor-not-allowed")).toBe(true);
180
- expect(itemEl.element.classList.contains("opacity-50")).toBe(true);
177
+ const itemEl = wrapper.find("[data-test='item']").find('div');
178
+ expect(itemEl.element.classList.contains('cursor-pointer')).toBe(false);
179
+ expect(itemEl.element.classList.contains('cursor-not-allowed')).toBe(true);
180
+ expect(itemEl.element.classList.contains('opacity-50')).toBe(true);
181
181
  });
182
182
  });
183
183
  });
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
- import { useSettings } from "@/index";
3
- import { RadioGroupOption } from "@headlessui/vue";
4
- import { inject } from "vue";
2
+ import { useSettings } from '@/index';
3
+ import { RadioGroupOption } from '@headlessui/vue';
4
+ import { inject } from 'vue';
5
5
 
6
6
  const props = defineProps({
7
7
  value: {
@@ -14,24 +14,21 @@ const props = defineProps({
14
14
  },
15
15
  });
16
16
 
17
- const active = inject("active") as string;
18
- const hover = inject("hover") as string;
19
- const classItem = inject("classItem") as string;
17
+ const active = inject('active') as string;
18
+ const hover = inject('hover') as string;
19
+ const classItem = inject('classItem') as string;
20
20
 
21
21
  const { settings } = useSettings();
22
- const isUnstyled =
23
- settings.global.unstyled || settings.components.radioItem.unstyled || props.unstyled;
22
+ const isUnstyled = settings.global.unstyled || settings.components.radioItem.unstyled || props.unstyled;
24
23
  </script>
25
24
 
26
25
  <template>
27
26
  <RadioGroupOption v-slot="{ checked, disabled }" :value="value">
28
27
  <div
29
28
  data-test="radio-item"
30
- :class="`vuetiful-radio-item ${
31
- isUnstyled ? '' : `px-4 py-1 text-center text-base rounded-token`
32
- } ${checked ? active : hover} ${
33
- disabled ? 'cursor-not-allowed opacity-50' : 'cursor-pointer'
34
- } ${classItem}`"
29
+ :class="`vuetiful-radio-item ${isUnstyled ? '' : `px-4 py-1 text-center text-base rounded-token`} ${
30
+ checked ? active : hover
31
+ } ${disabled ? 'cursor-not-allowed opacity-50' : 'cursor-pointer'} ${classItem}`"
35
32
  >
36
33
  <slot />
37
34
  </div>
@@ -1,9 +1,9 @@
1
- import { mount } from "@vue/test-utils";
2
- import { describe, expect, test } from "vitest";
3
- import VRadioGroup from "./VRadioGroup.vue";
4
- import VRadioLabel from "./VRadioLabel.vue";
1
+ import { mount } from '@vue/test-utils';
2
+ import { describe, expect, test } from 'vitest';
3
+ import VRadioGroup from './VRadioGroup.vue';
4
+ import VRadioLabel from './VRadioLabel.vue';
5
5
 
6
- test("VRadioLabel using slot", () => {
6
+ test('VRadioLabel using slot', () => {
7
7
  const wrapper = mount({
8
8
  template: `
9
9
  <v-radio-group>
@@ -11,15 +11,15 @@ test("VRadioLabel using slot", () => {
11
11
  </v-radio-group>
12
12
  `,
13
13
  components: {
14
- "v-radio-label": VRadioLabel,
15
- "v-radio-group": VRadioGroup,
14
+ 'v-radio-label': VRadioLabel,
15
+ 'v-radio-group': VRadioGroup,
16
16
  },
17
17
  });
18
18
 
19
- expect(wrapper.text()).toContain("John Duck");
19
+ expect(wrapper.text()).toContain('John Duck');
20
20
  });
21
21
 
22
- describe("VRadioLabel props", () => {
22
+ describe('VRadioLabel props', () => {
23
23
  test("default 'as' prop", () => {
24
24
  const wrapper = mount({
25
25
  template: `
@@ -28,8 +28,8 @@ describe("VRadioLabel props", () => {
28
28
  </v-radio-group>
29
29
  `,
30
30
  components: {
31
- "v-radio-label": VRadioLabel,
32
- "v-radio-group": VRadioGroup,
31
+ 'v-radio-label': VRadioLabel,
32
+ 'v-radio-group': VRadioGroup,
33
33
  },
34
34
  });
35
35
 
@@ -44,8 +44,8 @@ describe("VRadioLabel props", () => {
44
44
  </v-radio-group>
45
45
  `,
46
46
  components: {
47
- "v-radio-label": VRadioLabel,
48
- "v-radio-group": VRadioGroup,
47
+ 'v-radio-label': VRadioLabel,
48
+ 'v-radio-group': VRadioGroup,
49
49
  },
50
50
  });
51
51
 
@@ -1,14 +1,16 @@
1
1
  <script setup lang="ts">
2
- import { RadioGroupLabel } from "@headlessui/vue";
2
+ import { RadioGroupLabel } from '@headlessui/vue';
3
3
 
4
4
  defineProps({
5
5
  as: {
6
6
  type: String,
7
- default: "p",
7
+ default: 'p',
8
8
  },
9
9
  });
10
10
  </script>
11
11
 
12
12
  <template>
13
- <RadioGroupLabel :as="as" class="vuetiful-radio-label"><slot /></RadioGroupLabel>
13
+ <RadioGroupLabel :as="as" class="vuetiful-radio-label">
14
+ <slot />
15
+ </RadioGroupLabel>
14
16
  </template>