@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-coaching/vuetiful",
3
- "version": "0.23.0",
3
+ "version": "0.23.2",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "dev": "onchange 'src/**/*.vue' 'src/**/*.ts' 'src/**/*.css' -- npm run build",
@@ -1,15 +1,15 @@
1
1
  @font-face {
2
- font-family: "myfont";
3
- src: url("fonts/myfont.woff");
2
+ font-family: 'myfont';
3
+ src: url('fonts/myfont.woff');
4
4
  }
5
5
 
6
- [class^="icon-"],
7
- [class*=" icon-"] {
8
- font-family: "myfont" !important;
6
+ [class^='icon-'],
7
+ [class*=' icon-'] {
8
+ font-family: 'myfont' !important;
9
9
  }
10
10
 
11
11
  .icon-heart:before {
12
- content: "\e9da";
12
+ content: '\e9da';
13
13
  }
14
14
 
15
15
  .global-example {
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
- import { Variant } from "@/types";
3
- import { PropType } from "vue";
2
+ import { Variant } from '@/types';
3
+ import { PropType } from 'vue';
4
4
 
5
5
  /**
6
6
  * VBoostrap is a component that should not be used directly.
@@ -14,47 +14,47 @@ defineProps({
14
14
  variant: {
15
15
  // explicit string union because TypeScript type won't throw error if invalid value is passed
16
16
  type: String as PropType<
17
- | ""
18
- | "variant-filled"
19
- | "variant-filled-primary"
20
- | "variant-filled-secondary"
21
- | "variant-filled-tertiary"
22
- | "variant-filled-success"
23
- | "variant-filled-warning"
24
- | "variant-filled-error"
25
- | "variant-filled-surface"
26
- | "variant-ringed"
27
- | "variant-ringed-primary"
28
- | "variant-ringed-secondary"
29
- | "variant-ringed-tertiary"
30
- | "variant-ringed-success"
31
- | "variant-ringed-warning"
32
- | "variant-ringed-error"
33
- | "variant-ringed-surface"
34
- | "variant-ghost"
35
- | "variant-ghost-primary"
36
- | "variant-ghost-secondary"
37
- | "variant-ghost-tertiary"
38
- | "variant-ghost-success"
39
- | "variant-ghost-warning"
40
- | "variant-ghost-error"
41
- | "variant-ghost-surface"
42
- | "variant-soft"
43
- | "variant-soft-primary"
44
- | "variant-soft-secondary"
45
- | "variant-soft-tertiary"
46
- | "variant-soft-success"
47
- | "variant-soft-warning"
48
- | "variant-soft-error"
49
- | "variant-soft-surface"
50
- | "variant-glass"
51
- | "variant-glass-primary"
52
- | "variant-glass-secondary"
53
- | "variant-glass-tertiary"
54
- | "variant-glass-success"
55
- | "variant-glass-warning"
56
- | "variant-glass-error"
57
- | "variant-glass-surface"
17
+ | ''
18
+ | 'variant-filled'
19
+ | 'variant-filled-primary'
20
+ | 'variant-filled-secondary'
21
+ | 'variant-filled-tertiary'
22
+ | 'variant-filled-success'
23
+ | 'variant-filled-warning'
24
+ | 'variant-filled-error'
25
+ | 'variant-filled-surface'
26
+ | 'variant-ringed'
27
+ | 'variant-ringed-primary'
28
+ | 'variant-ringed-secondary'
29
+ | 'variant-ringed-tertiary'
30
+ | 'variant-ringed-success'
31
+ | 'variant-ringed-warning'
32
+ | 'variant-ringed-error'
33
+ | 'variant-ringed-surface'
34
+ | 'variant-ghost'
35
+ | 'variant-ghost-primary'
36
+ | 'variant-ghost-secondary'
37
+ | 'variant-ghost-tertiary'
38
+ | 'variant-ghost-success'
39
+ | 'variant-ghost-warning'
40
+ | 'variant-ghost-error'
41
+ | 'variant-ghost-surface'
42
+ | 'variant-soft'
43
+ | 'variant-soft-primary'
44
+ | 'variant-soft-secondary'
45
+ | 'variant-soft-tertiary'
46
+ | 'variant-soft-success'
47
+ | 'variant-soft-warning'
48
+ | 'variant-soft-error'
49
+ | 'variant-soft-surface'
50
+ | 'variant-glass'
51
+ | 'variant-glass-primary'
52
+ | 'variant-glass-secondary'
53
+ | 'variant-glass-tertiary'
54
+ | 'variant-glass-success'
55
+ | 'variant-glass-warning'
56
+ | 'variant-glass-error'
57
+ | 'variant-glass-surface'
58
58
  >,
59
59
  default: Variant.Filled,
60
60
  },
@@ -1,175 +1,175 @@
1
- import { mount } from "@vue/test-utils";
2
- import { describe, expect, test } from "vitest";
3
- import { VAvatar } from ".";
1
+ import { mount } from '@vue/test-utils';
2
+ import { describe, expect, test } from 'vitest';
3
+ import { VAvatar } from '.';
4
4
 
5
- describe("VAvatar", () => {
6
- test("defaults", () => {
5
+ describe('VAvatar', () => {
6
+ test('defaults', () => {
7
7
  const wrapper = mount(VAvatar);
8
8
 
9
- expect(wrapper.classes()).toContain("vuetiful-avatar");
10
- expect(wrapper.classes()).toContain("w-16");
11
- expect(wrapper.classes()).toContain("rounded-token");
9
+ expect(wrapper.classes()).toContain('vuetiful-avatar');
10
+ expect(wrapper.classes()).toContain('w-16');
11
+ expect(wrapper.classes()).toContain('rounded-token');
12
12
 
13
- const avatarText = wrapper.find(".vuetiful-avatar-text");
13
+ const avatarText = wrapper.find('.vuetiful-avatar-text');
14
14
  expect(avatarText.exists()).toBe(true);
15
- expect(avatarText.text()).toBe("");
16
- expect(avatarText.classes()).toEqual(["vuetiful-avatar-text", "fill-white", "dark:fill-black"]);
15
+ expect(avatarText.text()).toBe('');
16
+ expect(avatarText.classes()).toEqual(['vuetiful-avatar-text', 'fill-white', 'dark:fill-black']);
17
17
  });
18
18
 
19
- test("custom variant", () => {
19
+ test('custom variant', () => {
20
20
  const wrapper = mount(VAvatar, {
21
21
  props: {
22
- variant: "ghost",
22
+ variant: 'ghost',
23
23
  },
24
24
  });
25
25
 
26
- const avatarText = wrapper.find(".vuetiful-avatar-text");
27
- expect(avatarText.classes()).toEqual(["vuetiful-avatar-text", "fill-black", "dark:fill-white"]);
26
+ const avatarText = wrapper.find('.vuetiful-avatar-text');
27
+ expect(avatarText.classes()).toEqual(['vuetiful-avatar-text', 'fill-black', 'dark:fill-white']);
28
28
  });
29
29
 
30
- test("variant with hyphen", () => {
30
+ test('variant with hyphen', () => {
31
31
  const wrapper = mount(VAvatar, {
32
32
  props: {
33
- variant: "filled-primary",
33
+ variant: 'filled-primary',
34
34
  },
35
35
  });
36
36
 
37
- expect(wrapper.classes()).toContain("variant-filled-primary");
38
- })
37
+ expect(wrapper.classes()).toContain('variant-filled-primary');
38
+ });
39
39
 
40
- test("initials", () => {
40
+ test('initials', () => {
41
41
  const wrapper = mount(VAvatar, {
42
42
  props: {
43
- initials: "JD",
44
- variant: "filled",
43
+ initials: 'JD',
44
+ variant: 'filled',
45
45
  },
46
46
  });
47
47
 
48
- expect(wrapper.classes()).toContain("vuetiful-avatar");
49
- expect(wrapper.classes()).toContain("w-16");
50
- expect(wrapper.classes()).toContain("rounded-token");
48
+ expect(wrapper.classes()).toContain('vuetiful-avatar');
49
+ expect(wrapper.classes()).toContain('w-16');
50
+ expect(wrapper.classes()).toContain('rounded-token');
51
51
 
52
- const avatarText = wrapper.find(".vuetiful-avatar-text");
52
+ const avatarText = wrapper.find('.vuetiful-avatar-text');
53
53
  expect(avatarText.exists()).toBe(true);
54
- expect(avatarText.text()).toBe("JD");
55
- expect(avatarText.classes()).toEqual(["vuetiful-avatar-text", "fill-white", "dark:fill-black"]);
54
+ expect(avatarText.text()).toBe('JD');
55
+ expect(avatarText.classes()).toEqual(['vuetiful-avatar-text', 'fill-white', 'dark:fill-black']);
56
56
 
57
- const avatarImage = wrapper.find(".vuetiful-avatar-image");
57
+ const avatarImage = wrapper.find('.vuetiful-avatar-image');
58
58
  expect(avatarImage.exists()).toBe(false);
59
59
  });
60
60
 
61
- test("initials fill", () => {
61
+ test('initials fill', () => {
62
62
  const wrapper = mount(VAvatar, {
63
63
  props: {
64
- initials: "JD",
65
- fill: "custom-fill-class",
64
+ initials: 'JD',
65
+ fill: 'custom-fill-class',
66
66
  },
67
67
  });
68
68
 
69
- expect(wrapper.classes()).toContain("vuetiful-avatar");
70
- expect(wrapper.classes()).toContain("w-16");
71
- expect(wrapper.classes()).toContain("rounded-token");
69
+ expect(wrapper.classes()).toContain('vuetiful-avatar');
70
+ expect(wrapper.classes()).toContain('w-16');
71
+ expect(wrapper.classes()).toContain('rounded-token');
72
72
 
73
- const avatarText = wrapper.find(".vuetiful-avatar-text");
73
+ const avatarText = wrapper.find('.vuetiful-avatar-text');
74
74
  expect(avatarText.exists()).toBe(true);
75
- expect(avatarText.text()).toBe("JD");
76
- expect(avatarText.classes()).toContain("custom-fill-class");
75
+ expect(avatarText.text()).toBe('JD');
76
+ expect(avatarText.classes()).toContain('custom-fill-class');
77
77
  });
78
78
 
79
- test("image", () => {
79
+ test('image', () => {
80
80
  const wrapper = mount(VAvatar, {
81
81
  props: {
82
- src: "https://via.placeholder.com/150",
82
+ src: 'https://via.placeholder.com/150',
83
83
  },
84
84
  });
85
85
 
86
- expect(wrapper.classes()).toContain("vuetiful-avatar");
87
- expect(wrapper.classes()).toContain("w-16");
88
- expect(wrapper.classes()).toContain("rounded-token");
86
+ expect(wrapper.classes()).toContain('vuetiful-avatar');
87
+ expect(wrapper.classes()).toContain('w-16');
88
+ expect(wrapper.classes()).toContain('rounded-token');
89
89
 
90
- const avatarText = wrapper.find(".vuetiful-avatar-text");
90
+ const avatarText = wrapper.find('.vuetiful-avatar-text');
91
91
  expect(avatarText.exists()).toBe(false);
92
92
 
93
- const avatarImage = wrapper.find(".vuetiful-avatar-image");
93
+ const avatarImage = wrapper.find('.vuetiful-avatar-image');
94
94
  expect(avatarImage.exists()).toBe(true);
95
- expect(avatarImage.attributes("src")).toBe("https://via.placeholder.com/150");
95
+ expect(avatarImage.attributes('src')).toBe('https://via.placeholder.com/150');
96
96
  });
97
97
 
98
- test("image fallback", async () => {
98
+ test('image fallback', async () => {
99
99
  const wrapper = mount(VAvatar, {
100
100
  props: {
101
- src: "https://via.placeholder.com/150",
102
- fallback: "/image/john-duck.png",
101
+ src: 'https://via.placeholder.com/150',
102
+ fallback: '/image/john-duck.png',
103
103
  },
104
104
  });
105
105
 
106
- expect(wrapper.classes()).toContain("vuetiful-avatar");
107
- expect(wrapper.classes()).toContain("w-16");
108
- expect(wrapper.classes()).toContain("rounded-token");
106
+ expect(wrapper.classes()).toContain('vuetiful-avatar');
107
+ expect(wrapper.classes()).toContain('w-16');
108
+ expect(wrapper.classes()).toContain('rounded-token');
109
109
 
110
- const avatarText = wrapper.find(".vuetiful-avatar-text");
110
+ const avatarText = wrapper.find('.vuetiful-avatar-text');
111
111
  expect(avatarText.exists()).toBe(false);
112
112
 
113
- const avatarImage = wrapper.find(".vuetiful-avatar-image");
114
- avatarImage.trigger("error");
113
+ const avatarImage = wrapper.find('.vuetiful-avatar-image');
114
+ avatarImage.trigger('error');
115
115
  await wrapper.vm.$nextTick();
116
116
 
117
117
  expect(avatarImage.exists()).toBe(true);
118
- expect(avatarImage.attributes("src")).toBe("/image/john-duck.png");
118
+ expect(avatarImage.attributes('src')).toBe('/image/john-duck.png');
119
119
  });
120
120
 
121
- test("size xs", () => {
121
+ test('size xs', () => {
122
122
  const wrapper = mount(VAvatar, {
123
123
  props: {
124
- size: "xs",
124
+ size: 'xs',
125
125
  },
126
126
  });
127
127
 
128
128
  const avatar = wrapper.find("[data-test='avatar']");
129
- expect(avatar.attributes("class")).toContain("w-8");
129
+ expect(avatar.attributes('class')).toContain('w-8');
130
130
  });
131
131
 
132
- test("size sm", () => {
132
+ test('size sm', () => {
133
133
  const wrapper = mount(VAvatar, {
134
134
  props: {
135
- size: "sm",
135
+ size: 'sm',
136
136
  },
137
137
  });
138
138
 
139
139
  const avatar = wrapper.find("[data-test='avatar']");
140
- expect(avatar.attributes("class")).toContain("w-12");
140
+ expect(avatar.attributes('class')).toContain('w-12');
141
141
  });
142
142
 
143
- test("size md", () => {
143
+ test('size md', () => {
144
144
  const wrapper = mount(VAvatar, {
145
145
  props: {
146
- size: "md",
146
+ size: 'md',
147
147
  },
148
148
  });
149
149
 
150
150
  const avatar = wrapper.find("[data-test='avatar']");
151
- expect(avatar.attributes("class")).toContain("w-16");
151
+ expect(avatar.attributes('class')).toContain('w-16');
152
152
  });
153
153
 
154
- test("size lg", () => {
154
+ test('size lg', () => {
155
155
  const wrapper = mount(VAvatar, {
156
156
  props: {
157
- size: "lg",
157
+ size: 'lg',
158
158
  },
159
159
  });
160
160
 
161
161
  const avatar = wrapper.find("[data-test='avatar']");
162
- expect(avatar.attributes("class")).toContain("w-20");
162
+ expect(avatar.attributes('class')).toContain('w-20');
163
163
  });
164
164
 
165
- test("size xl", () => {
165
+ test('size xl', () => {
166
166
  const wrapper = mount(VAvatar, {
167
167
  props: {
168
- size: "xl",
168
+ size: 'xl',
169
169
  },
170
170
  });
171
171
 
172
172
  const avatar = wrapper.find("[data-test='avatar']");
173
- expect(avatar.attributes("class")).toContain("w-24");
173
+ expect(avatar.attributes('class')).toContain('w-24');
174
174
  });
175
175
  });
@@ -1,20 +1,20 @@
1
1
  <script setup lang="ts">
2
- import { CssClasses, useSettings } from "@/index";
3
- import { sizeProp, unstyledProp, variantProp } from "@/props";
4
- import { Size } from "@/types";
5
- import { computed, ref } from "vue";
2
+ import { CssClasses, useSettings } from '@/index';
3
+ import { sizeProp, unstyledProp, variantProp } from '@/props';
4
+ import { Size } from '@/types';
5
+ import { computed, ref } from 'vue';
6
6
 
7
7
  const props = defineProps({
8
8
  // Initials
9
- initials: { type: String, default: "" },
10
- fill: { type: String as () => CssClasses, default: "" },
11
- classInitials: { type: String, default: "" },
9
+ initials: { type: String, default: '' },
10
+ fill: { type: String as () => CssClasses, default: '' },
11
+ classInitials: { type: String, default: '' },
12
12
 
13
13
  // Image
14
- src: { type: String, default: "" },
15
- alt: { type: String, default: "" },
16
- fallback: { type: String, default: "" },
17
- classImage: { type: String, default: "" },
14
+ src: { type: String, default: '' },
15
+ alt: { type: String, default: '' },
16
+ fallback: { type: String, default: '' },
17
+ classImage: { type: String, default: '' },
18
18
 
19
19
  size: sizeProp,
20
20
  variant: variantProp,
@@ -26,32 +26,31 @@ const fillInitials = computed(() => {
26
26
  if (props.fill) return props.fill;
27
27
 
28
28
  const variantString = props.variant as string | undefined;
29
- const type = variantString?.split("-")[1];
30
- if (variantString?.includes("filled")) {
31
- if (!type) return "fill-white dark:fill-black";
32
- return "fill-white";
29
+ const type = variantString?.split('-')[1];
30
+ if (variantString?.includes('filled')) {
31
+ if (!type) return 'fill-white dark:fill-black';
32
+ return 'fill-white';
33
33
  }
34
- return "fill-black dark:fill-white";
34
+ return 'fill-black dark:fill-white';
35
35
  });
36
36
 
37
37
  const avatarSize = computed(() => {
38
38
  switch (props.size) {
39
39
  case Size.XS:
40
- return "w-8";
40
+ return 'w-8';
41
41
  case Size.SM:
42
- return "w-12";
42
+ return 'w-12';
43
43
  case Size.MD:
44
- return "w-16";
44
+ return 'w-16';
45
45
  case Size.LG:
46
- return "w-20";
46
+ return 'w-20';
47
47
  case Size.XL:
48
- return "w-24";
48
+ return 'w-24';
49
49
  }
50
50
  });
51
51
 
52
52
  const { settings } = useSettings();
53
- const isUnstyled =
54
- settings.global.unstyled || settings.components.avatar.unstyled || props.unstyled;
53
+ const isUnstyled = settings.global.unstyled || settings.components.avatar.unstyled || props.unstyled;
55
54
  </script>
56
55
  <template>
57
56
  <figure
@@ -1,28 +1,28 @@
1
- import { mount } from "@vue/test-utils";
2
- import { expect, test } from "vitest";
3
- import { VBadge } from ".";
1
+ import { mount } from '@vue/test-utils';
2
+ import { expect, test } from 'vitest';
3
+ import { VBadge } from '.';
4
4
 
5
- test("VBadge", () => {
5
+ test('VBadge', () => {
6
6
  expect(VBadge).toBeTruthy();
7
7
  });
8
8
 
9
- test("VBadge using slot", () => {
9
+ test('VBadge using slot', () => {
10
10
  const wrapper = mount(VBadge, {
11
11
  slots: {
12
- default: "John Duck",
12
+ default: 'John Duck',
13
13
  },
14
14
  });
15
15
 
16
- expect(wrapper.text()).toContain("John Duck");
17
- expect(wrapper.classes()).toContain("badge");
16
+ expect(wrapper.text()).toContain('John Duck');
17
+ expect(wrapper.classes()).toContain('badge');
18
18
  });
19
19
 
20
- test("VBadge unstyled", () => {
20
+ test('VBadge unstyled', () => {
21
21
  const wrapper = mount(VBadge, {
22
22
  props: {
23
23
  unstyled: true,
24
24
  },
25
25
  });
26
26
 
27
- expect(wrapper.classes()).not.toContain("badge");
28
- })
27
+ expect(wrapper.classes()).not.toContain('badge');
28
+ });
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
- import { unstyledProp, variantProp } from "@/props";
3
- import { useSettings } from "@/services";
2
+ import { unstyledProp, variantProp } from '@/props';
3
+ import { useSettings } from '@/services';
4
4
 
5
5
  const props = defineProps({
6
6
  variant: variantProp,