vueless 0.0.616 → 0.0.617

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 (65) hide show
  1. package/package.json +1 -1
  2. package/ui.button/UButton.vue +0 -3
  3. package/ui.button-toggle/UToggle.vue +1 -15
  4. package/ui.button-toggle/config.ts +10 -0
  5. package/ui.button-toggle/types.ts +0 -2
  6. package/ui.container-accordion/UAccordion.vue +3 -14
  7. package/ui.container-accordion/config.ts +10 -1
  8. package/ui.container-accordion/types.ts +0 -1
  9. package/ui.data-list/UDataList.vue +4 -35
  10. package/ui.data-list/config.ts +13 -3
  11. package/ui.data-list/types.ts +0 -2
  12. package/ui.dropdown-button/UDropdownButton.vue +1 -29
  13. package/ui.dropdown-button/config.ts +23 -1
  14. package/ui.dropdown-button/types.ts +0 -3
  15. package/ui.dropdown-link/UDropdownLink.vue +1 -12
  16. package/ui.dropdown-link/config.ts +10 -1
  17. package/ui.dropdown-link/types.ts +0 -2
  18. package/ui.form-checkbox/UCheckbox.vue +1 -12
  19. package/ui.form-checkbox/config.ts +10 -1
  20. package/ui.form-checkbox/types.ts +0 -2
  21. package/ui.form-color-picker/UColorPicker.vue +1 -14
  22. package/ui.form-color-picker/config.ts +12 -1
  23. package/ui.form-color-picker/types.ts +0 -2
  24. package/ui.form-date-picker/UDatePicker.vue +5 -7
  25. package/ui.form-date-picker/config.ts +10 -1
  26. package/ui.form-date-picker-range/UDatePickerRange.vue +3 -4
  27. package/ui.form-date-picker-range/config.ts +10 -1
  28. package/ui.form-input/UInput.vue +5 -29
  29. package/ui.form-input/config.ts +13 -3
  30. package/ui.form-input/types.ts +0 -2
  31. package/ui.form-input-file/UInputFile.vue +1 -13
  32. package/ui.form-input-file/config.ts +17 -1
  33. package/ui.form-input-file/types.ts +0 -2
  34. package/ui.form-input-rating/UInputRating.vue +1 -12
  35. package/ui.form-input-rating/config.ts +10 -1
  36. package/ui.form-input-rating/types.ts +0 -2
  37. package/ui.form-input-search/UInputSearch.vue +2 -26
  38. package/ui.form-input-search/config.ts +30 -3
  39. package/ui.form-input-search/types.ts +0 -3
  40. package/ui.form-select/USelect.vue +8 -47
  41. package/ui.form-select/config.ts +15 -5
  42. package/ui.form-select/types.ts +0 -1
  43. package/ui.form-switch/USwitch.vue +1 -12
  44. package/ui.form-switch/config.ts +10 -1
  45. package/ui.form-switch/types.ts +0 -2
  46. package/ui.image-avatar/UAvatar.vue +1 -8
  47. package/ui.navigation-pagination/UPagination.vue +4 -50
  48. package/ui.navigation-pagination/config.ts +21 -4
  49. package/ui.navigation-pagination/types.ts +0 -3
  50. package/ui.navigation-progress/UProgress.vue +3 -17
  51. package/ui.navigation-progress/config.ts +14 -0
  52. package/ui.navigation-progress/types.ts +0 -2
  53. package/ui.text-alert/UAlert.vue +9 -32
  54. package/ui.text-alert/config.ts +22 -2
  55. package/ui.text-alert/types.ts +0 -3
  56. package/ui.text-badge/UBadge.vue +6 -34
  57. package/ui.text-badge/config.ts +13 -3
  58. package/ui.text-badge/types.ts +0 -2
  59. package/ui.text-empty/UEmpty.vue +4 -32
  60. package/ui.text-empty/config.ts +20 -2
  61. package/ui.text-empty/types.ts +0 -3
  62. package/ui.text-file/UFile.vue +2 -24
  63. package/ui.text-file/config.ts +20 -2
  64. package/ui.text-file/types.ts +0 -3
  65. package/web-types.json +1 -80
@@ -12,7 +12,16 @@ export default /*tw*/ {
12
12
  },
13
13
  },
14
14
  },
15
- rightIcon: "{UIcon}",
15
+ rightIcon: {
16
+ base: "{UIcon}",
17
+ defaults: {
18
+ size: {
19
+ sm: "xs",
20
+ md: "sm",
21
+ lg: "md",
22
+ },
23
+ },
24
+ },
16
25
  buttonWrapper: {
17
26
  base: `
18
27
  flex rounded-dynamic max-md:justify-between
@@ -12,7 +12,7 @@ import ULabel from "../ui.form-label/ULabel.vue";
12
12
  import defaultConfig from "./config.ts";
13
13
  import { COMPONENT_NAME } from "./constants.ts";
14
14
 
15
- import type { Props, IconSize, Config } from "./types.ts";
15
+ import type { Props, Config } from "./types.ts";
16
16
 
17
17
  defineOptions({ inheritAttrs: false });
18
18
 
@@ -102,16 +102,6 @@ const applyPasswordClasses = computed(() => {
102
102
 
103
103
  const elementId = props.id || useId();
104
104
 
105
- const iconSize = computed(() => {
106
- const sizes = {
107
- sm: "xs",
108
- md: "sm",
109
- lg: "md",
110
- };
111
-
112
- return sizes[props.size] as IconSize;
113
- });
114
-
115
105
  const inputType = computed(() => {
116
106
  return isShownPassword.value || props.noAutocomplete ? "text" : props.type;
117
107
  });
@@ -290,16 +280,9 @@ const {
290
280
  <!--
291
281
  @slot Use it to add icon before the text.
292
282
  @binding {string} icon-name
293
- @binding {string} icon-size
294
283
  -->
295
- <slot name="left-icon" :icon-name="leftIcon" :icon-size="iconSize">
296
- <UIcon
297
- v-if="leftIcon"
298
- :name="leftIcon"
299
- :size="iconSize"
300
- internal
301
- v-bind="leftIconAttrs"
302
- />
284
+ <slot name="left-icon" :icon-name="leftIcon">
285
+ <UIcon v-if="leftIcon" :name="leftIcon" internal v-bind="leftIconAttrs" />
303
286
  </slot>
304
287
  </span>
305
288
 
@@ -342,16 +325,9 @@ const {
342
325
  <!--
343
326
  @slot Use it to add icon after the text.
344
327
  @binding {string} icon-name
345
- @binding {string} icon-size
346
328
  -->
347
- <slot name="right-icon" :icon-name="rightIcon" :icon-size="iconSize">
348
- <UIcon
349
- v-if="rightIcon"
350
- :name="rightIcon"
351
- :size="iconSize"
352
- internal
353
- v-bind="rightIconAttrs"
354
- />
329
+ <slot name="right-icon" :icon-name="rightIcon">
330
+ <UIcon v-if="rightIcon" :name="rightIcon" internal v-bind="rightIconAttrs" />
355
331
  </slot>
356
332
  </span>
357
333
 
@@ -24,9 +24,19 @@ export default /*tw*/ {
24
24
  },
25
25
  rightIconWrapper: "flex items-center justify-end whitespace-nowrap pr-2.5 gap-1 rounded-inherit rounded-l-none",
26
26
  leftIconWrapper: "flex items-center justify-end whitespace-nowrap pl-2.5 gap-1 rounded-inherit rounded-r-none",
27
- leftIcon: "{UIcon}",
28
- rightIcon: "{UIcon}",
29
- passwordIcon: "{UIcon}",
27
+ inputIcon: {
28
+ base: "{UIcon}",
29
+ defaults: {
30
+ size: {
31
+ sm: "xs",
32
+ md: "sm",
33
+ lg: "md",
34
+ },
35
+ },
36
+ },
37
+ leftIcon: "{UIcon} {>inputIcon}",
38
+ rightIcon: "{UIcon} {>inputIcon}",
39
+ passwordIcon: "{UIcon} {>inputIcon}",
30
40
  input: {
31
41
  base: `
32
42
  block w-full py-2 px-3 font-normal !leading-none text-gray-900 bg-transparent
@@ -4,8 +4,6 @@ import type { ComponentConfig } from "../types.ts";
4
4
 
5
5
  export type Config = typeof defaultConfig;
6
6
 
7
- export type IconSize = "xs" | "sm" | "md";
8
-
9
7
  export interface Props {
10
8
  /**
11
9
  * Input value.
@@ -17,7 +17,7 @@ import { useLocale } from "../composables/useLocale.ts";
17
17
  import { COMPONENT_NAME } from "./constants.ts";
18
18
  import defaultConfig from "./config.ts";
19
19
 
20
- import type { Props, ButtonSize, Config } from "./types.ts";
20
+ import type { Props, Config } from "./types.ts";
21
21
 
22
22
  defineOptions({ inheritAttrs: false });
23
23
 
@@ -90,16 +90,6 @@ const fileList = computed(() => {
90
90
  return currentFiles.value ? [currentFiles.value] : [];
91
91
  });
92
92
 
93
- const buttonSize = computed(() => {
94
- const sizes = {
95
- sm: "xs",
96
- md: "sm",
97
- lg: "md",
98
- };
99
-
100
- return sizes[props.size] as ButtonSize;
101
- });
102
-
103
93
  onMounted(() => {
104
94
  if (dropZoneRef.value) {
105
95
  dropZoneRef.value.addEventListener("dragover", onDragOver);
@@ -316,7 +306,6 @@ const {
316
306
  :for="elementId"
317
307
  tag="label"
318
308
  variant="thirdary"
319
- :size="buttonSize"
320
309
  :right-icon="config.defaults.chooseFileIcon"
321
310
  :label="currentLocale.uploadFile"
322
311
  :disabled="disabled"
@@ -343,7 +332,6 @@ const {
343
332
  filled
344
333
  no-ring
345
334
  variant="thirdary"
346
- :size="buttonSize"
347
335
  :disabled="disabled"
348
336
  :left-icon="config.defaults.clearIcon"
349
337
  v-bind="clearButtonAttrs"
@@ -58,8 +58,24 @@ export default /*tw*/ {
58
58
  true: "opacity-75",
59
59
  },
60
60
  },
61
+ defaults: {
62
+ size: {
63
+ sm: "xs",
64
+ md: "sm",
65
+ lg: "md",
66
+ },
67
+ },
68
+ },
69
+ clearButton: {
70
+ base: "{UButton}",
71
+ defaults: {
72
+ size: {
73
+ sm: "xs",
74
+ md: "sm",
75
+ lg: "md",
76
+ },
77
+ },
61
78
  },
62
- clearButton: "{UButton}",
63
79
  input: "sr-only",
64
80
  i18n: {
65
81
  sizeError: "File size is too big.",
@@ -4,8 +4,6 @@ import type { ComponentConfig } from "../types.ts";
4
4
 
5
5
  export type Config = typeof defaultConfig;
6
6
 
7
- export type ButtonSize = "xs" | "sm" | "md";
8
-
9
7
  export interface Props {
10
8
  /**
11
9
  * Input value.
@@ -11,7 +11,7 @@ import ULabel from "../ui.form-label/ULabel.vue";
11
11
  import { COMPONENT_NAME } from "./constants.ts";
12
12
  import defaultConfig from "./config.ts";
13
13
 
14
- import type { Props, IconSize, Config } from "./types.ts";
14
+ import type { Props, Config } from "./types.ts";
15
15
 
16
16
  defineOptions({ inheritAttrs: false });
17
17
 
@@ -30,16 +30,6 @@ const emit = defineEmits([
30
30
 
31
31
  const hovered = ref<number | null>(null);
32
32
 
33
- const iconSize = computed(() => {
34
- const sizes = {
35
- sm: "xs",
36
- md: "sm",
37
- lg: "md",
38
- };
39
-
40
- return sizes[props.size] as IconSize;
41
- });
42
-
43
33
  const counterValue = computed(() => {
44
34
  return hovered.value || props.modelValue;
45
35
  });
@@ -102,7 +92,6 @@ const { config, inputLabelAttrs, containerAttrs, counterAttrs, totalAttrs, stars
102
92
  :key="star"
103
93
  internal
104
94
  :color="error ? 'red' : 'brand'"
105
- :size="iconSize"
106
95
  :interactive="selectable"
107
96
  :name="starIcon(star)"
108
97
  v-bind="starAttrs"
@@ -11,7 +11,16 @@ export default /*tw*/ {
11
11
  },
12
12
  },
13
13
  stars: "flex",
14
- star: "{UIcon}",
14
+ star: {
15
+ base: "{UIcon}",
16
+ defaults: {
17
+ size: {
18
+ sm: "xs",
19
+ md: "sm",
20
+ lg: "md",
21
+ },
22
+ },
23
+ },
15
24
  counter: {
16
25
  variants: {
17
26
  size: {
@@ -4,8 +4,6 @@ import type { ComponentConfig } from "../types.ts";
4
4
 
5
5
  export type Config = typeof defaultConfig;
6
6
 
7
- export type IconSize = "xs" | "sm" | "md";
8
-
9
7
  export interface Props {
10
8
  /**
11
9
  * Rating value.
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { computed, useId, ref, watchEffect } from "vue";
2
+ import { useId, ref, watchEffect } from "vue";
3
3
 
4
4
  import useUI from "../composables/useUI.ts";
5
5
  import { getDefaults } from "../utils/ui.ts";
@@ -12,7 +12,7 @@ import UButton from "../ui.button/UButton.vue";
12
12
  import { COMPONENT_NAME } from "./constants.ts";
13
13
  import defaultConfig from "./config.ts";
14
14
 
15
- import type { Props, IconSize, ButtonSize, Config } from "./types.ts";
15
+ import type { Props, Config } from "./types.ts";
16
16
 
17
17
  defineOptions({ inheritAttrs: false });
18
18
 
@@ -51,26 +51,6 @@ const inputRef = ref(null);
51
51
 
52
52
  const elementId = props.id || useId();
53
53
 
54
- const iconSize = computed(() => {
55
- const sizes = {
56
- sm: "xs",
57
- md: "sm",
58
- lg: "md",
59
- };
60
-
61
- return sizes[props.size] as IconSize;
62
- });
63
-
64
- const buttonSize = computed(() => {
65
- const sizes = {
66
- sm: "xs",
67
- md: "md",
68
- lg: "lg",
69
- };
70
-
71
- return sizes[props.size] as ButtonSize;
72
- });
73
-
74
54
  watchEffect(() => {
75
55
  updateValueWithDebounce = createDebounce((value) => {
76
56
  emit("update:modelValue", value);
@@ -166,7 +146,6 @@ const { config, searchInputAttrs, searchIconAttrs, clearIconAttrs, searchButtonA
166
146
  interactive
167
147
  color="gray"
168
148
  :name="config.defaults.clearIcon"
169
- :size="iconSize"
170
149
  v-bind="clearIconAttrs"
171
150
  :data-test="`${dataTest}-clear`"
172
151
  @click="onClickClear"
@@ -176,14 +155,12 @@ const { config, searchInputAttrs, searchIconAttrs, clearIconAttrs, searchButtonA
176
155
  <slot
177
156
  name="right-icon"
178
157
  :icon-name="config.defaults.searchIcon"
179
- :icon-size="iconSize"
180
158
  :search-button-label="searchButtonLabel"
181
159
  >
182
160
  <UIcon
183
161
  v-if="!searchButtonLabel"
184
162
  internal
185
163
  interactive
186
- :size="iconSize"
187
164
  :name="rightIcon || config.defaults.searchIcon"
188
165
  v-bind="searchIconAttrs"
189
166
  :data-test="`${dataTest}-search-icon`"
@@ -198,7 +175,6 @@ const { config, searchInputAttrs, searchIconAttrs, clearIconAttrs, searchButtonA
198
175
  <UButton
199
176
  v-if="searchButtonLabel"
200
177
  :label="searchButtonLabel"
201
- :size="buttonSize"
202
178
  no-ring
203
179
  v-bind="searchButtonAttrs"
204
180
  :data-test="`${dataTest}-search-button`"
@@ -1,8 +1,35 @@
1
1
  export default /*tw*/ {
2
2
  searchInput: "{UInput}",
3
- clearIcon: "{UIcon}",
4
- searchIcon: "{UIcon}",
5
- searchButton: "{UButton} rounded-l-none ml-1 outline outline-1 outline-gray-900",
3
+ clearIcon: {
4
+ base: "{UIcon}",
5
+ defaults: {
6
+ size: {
7
+ sm: "xs",
8
+ md: "sm",
9
+ lg: "md",
10
+ },
11
+ },
12
+ },
13
+ searchIcon: {
14
+ base: "{UIcon}",
15
+ defaults: {
16
+ size: {
17
+ sm: "xs",
18
+ md: "sm",
19
+ lg: "md",
20
+ },
21
+ },
22
+ },
23
+ searchButton: {
24
+ base: "{UButton} rounded-l-none ml-1 outline outline-1 outline-gray-900",
25
+ defaults: {
26
+ size: {
27
+ sm: "xs",
28
+ md: "md",
29
+ lg: "lg",
30
+ },
31
+ },
32
+ },
6
33
  defaults: {
7
34
  size: "md",
8
35
  labelAlign: "topInside",
@@ -4,9 +4,6 @@ import type { ComponentConfig } from "../types.ts";
4
4
 
5
5
  export type Config = typeof defaultConfig;
6
6
 
7
- export type IconSize = "xs" | "sm" | "md";
8
- export type ButtonSize = "xs" | "md" | "lg";
9
-
10
7
  export interface Props {
11
8
  /**
12
9
  * Search input value.
@@ -23,7 +23,7 @@ import { COMPONENT_NAME, DIRECTION, KEYS } from "./constants.ts";
23
23
  import { useLocale } from "../composables/useLocale.ts";
24
24
 
25
25
  import type { Option, Config as UDropdownListConfig } from "../ui.dropdown-list/types.ts";
26
- import type { Props, Config, IconSize } from "./types.ts";
26
+ import type { Props, Config } from "./types.ts";
27
27
  import type { ComponentExposed, KeyAttrsWithConfig } from "../types.ts";
28
28
 
29
29
  defineOptions({ inheritAttrs: false });
@@ -106,16 +106,6 @@ const isTop = computed(() => {
106
106
  return preferredOpenDirection.value === DIRECTION.top;
107
107
  });
108
108
 
109
- const iconSize = computed(() => {
110
- const sizes = {
111
- sm: "xs",
112
- md: "sm",
113
- lg: "md",
114
- };
115
-
116
- return sizes[props.size] as IconSize;
117
- });
118
-
119
109
  const inputPlaceholder = computed(() => {
120
110
  const message = currentLocale.value.addMore;
121
111
 
@@ -490,16 +480,9 @@ const {
490
480
  <!--
491
481
  @slot Use it to add icon right.
492
482
  @binding {string} icon-name
493
- @binding {string} icon-size
494
483
  -->
495
- <slot name="right-icon" :icon-name="rightIcon" :icon-size="iconSize">
496
- <UIcon
497
- v-if="rightIcon"
498
- :name="rightIcon"
499
- :size="iconSize"
500
- internal
501
- v-bind="rightIconAttrs"
502
- />
484
+ <slot name="right-icon" :icon-name="rightIcon">
485
+ <UIcon v-if="rightIcon" :name="rightIcon" internal v-bind="rightIconAttrs" />
503
486
  </slot>
504
487
  </div>
505
488
 
@@ -524,20 +507,13 @@ const {
524
507
  <!--
525
508
  @slot Use it to add something instead of the toggle icon.
526
509
  @binding {string} icon-name
527
- @binding {string} icon-size
528
510
  @binding {boolean} opened
529
511
  -->
530
- <slot
531
- name="toggle"
532
- :icon-name="config.defaults.dropdownIcon"
533
- :icon-size="iconSize"
534
- :opened="isOpen"
535
- >
512
+ <slot name="toggle" :icon-name="config.defaults.dropdownIcon" :opened="isOpen">
536
513
  <UIcon
537
514
  internal
538
515
  interactive
539
516
  color="gray"
540
- :size="iconSize"
541
517
  :name="config.defaults.dropdownIcon"
542
518
  v-bind="toggleIconAttrs"
543
519
  :tabindex="-1"
@@ -553,14 +529,12 @@ const {
553
529
  <!--
554
530
  @slot Use it to add something instead of the clear icon.
555
531
  @binding {string} icon-name
556
- @binding {string} icon-size
557
532
  -->
558
- <slot name="clear" :icon-name="config.defaults.clearIcon" :icon-size="iconSize">
533
+ <slot name="clear" :icon-name="config.defaults.clearIcon">
559
534
  <UIcon
560
535
  internal
561
536
  interactive
562
537
  color="gray"
563
- :size="iconSize"
564
538
  :name="config.defaults.clearIcon"
565
539
  v-bind="clearIconAttrs"
566
540
  />
@@ -587,16 +561,9 @@ const {
587
561
  <!--
588
562
  @slot Use it to add icon left.
589
563
  @binding {string} icon-name
590
- @binding {string} icon-size
591
564
  -->
592
- <slot name="left-icon" :icon-name="leftIcon" :icon-size="iconSize">
593
- <UIcon
594
- v-if="leftIcon"
595
- :name="leftIcon"
596
- :size="iconSize"
597
- internal
598
- v-bind="leftIconAttrs"
599
- />
565
+ <slot name="left-icon" :icon-name="leftIcon">
566
+ <UIcon v-if="leftIcon" :name="leftIcon" internal v-bind="leftIconAttrs" />
600
567
  </slot>
601
568
  </span>
602
569
 
@@ -640,18 +607,12 @@ const {
640
607
  <!--
641
608
  @slot Use it to add something instead of the clear icon (when multiple prop enabled).
642
609
  @binding {string} icon-name
643
- @binding {string} icon-size
644
610
  -->
645
- <slot
646
- name="clear-multiple"
647
- :icon-name="config.defaults.clearMultipleIcon"
648
- :icon-size="iconSize"
649
- >
611
+ <slot name="clear-multiple" :icon-name="config.defaults.clearMultipleIcon">
650
612
  <UIcon
651
613
  internal
652
614
  interactive
653
615
  color="gray"
654
- :size="iconSize"
655
616
  :name="config.defaults.clearMultipleIcon"
656
617
  v-bind="clearMultipleIconAttrs"
657
618
  />
@@ -65,10 +65,20 @@ export default /*tw*/ {
65
65
  { size: "lg", multiple: true, class: "text-base" },
66
66
  ],
67
67
  },
68
+ selectIcon: {
69
+ base: "{UIcon}",
70
+ defaults: {
71
+ size: {
72
+ sm: "xs",
73
+ md: "sm",
74
+ lg: "md",
75
+ },
76
+ },
77
+ },
68
78
  leftIconWrapper: "pr-1.5",
69
79
  rightIconWrapper: "{>caret} pr-3",
70
- leftIcon: "{UIcon}",
71
- rightIcon: "{UIcon}",
80
+ leftIcon: "{UIcon} {>selectIcon}",
81
+ rightIcon: "{UIcon} {>selectIcon}",
72
82
  beforeCaret: "{>caret}",
73
83
  afterCaret: "{>caret} mr-3",
74
84
  caret: {
@@ -80,11 +90,11 @@ export default /*tw*/ {
80
90
  ],
81
91
  },
82
92
  toggle: "{>caret} mr-3",
83
- toggleIcon: "{UIcon} transition duration-300 group-[]/active:rotate-180",
93
+ toggleIcon: "{UIcon} {>selectIcon}",
84
94
  clear: "{>caret}",
85
- clearIcon: "{UIcon}",
95
+ clearIcon: "{UIcon} {>selectIcon}",
86
96
  clearMultiple: "flex items-center",
87
- clearMultipleIcon: "{UIcon}",
97
+ clearMultipleIcon: "{UIcon} {>selectIcon}",
88
98
  clearMultipleText: {
89
99
  base: "cursor-pointer flex items-center text-sm font-normal text-gray-400 hover:text-gray-500 transition",
90
100
  compoundVariants: [
@@ -4,7 +4,6 @@ import type { Option } from "../ui.dropdown-list/types.ts";
4
4
  import type { ComponentConfig } from "../types.ts";
5
5
 
6
6
  export type Config = typeof defaultConfig;
7
- export type IconSize = "xs" | "sm" | "md";
8
7
 
9
8
  export interface Props {
10
9
  /**
@@ -12,7 +12,7 @@ import { COMPONENT_NAME } from "./constants.ts";
12
12
  import defaultConfig from "./config.ts";
13
13
  import { useLocale } from "../composables/useLocale.ts";
14
14
 
15
- import type { Props, IconSize, Config } from "./types.ts";
15
+ import type { Props, Config } from "./types.ts";
16
16
 
17
17
  defineOptions({ inheritAttrs: false });
18
18
 
@@ -46,16 +46,6 @@ const switchLabel = computed(() => {
46
46
  return checkedValue.value ? currentLocale.value.active : currentLocale.value.inactive;
47
47
  });
48
48
 
49
- const iconSize = computed(() => {
50
- const sizes = {
51
- sm: "2xs",
52
- md: "xs",
53
- lg: "sm",
54
- };
55
-
56
- return sizes[props.size] as IconSize;
57
- });
58
-
59
49
  const iconColor = computed(() => {
60
50
  return checkedValue.value ? props.color : "grayscale";
61
51
  });
@@ -127,7 +117,6 @@ const {
127
117
  internal
128
118
  :name="toggleIconName"
129
119
  :color="iconColor"
130
- :size="iconSize"
131
120
  v-bind="toggleIconAttrs"
132
121
  />
133
122
  </span>
@@ -41,7 +41,16 @@ export default /*tw*/ {
41
41
  { checked: true, size: "lg", class: "ml-[calc(100%-1.25rem)]" },
42
42
  ],
43
43
  },
44
- toggleIcon: "{UIcon}",
44
+ toggleIcon: {
45
+ base: "{UIcon}",
46
+ defaults: {
47
+ size: {
48
+ sm: "2xs",
49
+ md: "xs",
50
+ lg: "sm",
51
+ },
52
+ },
53
+ },
45
54
  toggleLabel: {
46
55
  base: "absolute text-center text-2xs font-medium uppercase text-white",
47
56
  compoundVariants: [
@@ -4,8 +4,6 @@ import type { ComponentConfig } from "../types.ts";
4
4
 
5
5
  export type Config = typeof defaultConfig;
6
6
 
7
- export type IconSize = "2xs" | "xs" | "sm";
8
-
9
7
  export interface Props {
10
8
  /**
11
9
  * Switch value.
@@ -72,15 +72,8 @@ const { avatarAttrs, placeholderIconAttrs } = useUI<Config>(defaultConfig);
72
72
  @slot Use it to add something instead of the avatar image placeholder.
73
73
  @binding {string} icon-name
74
74
  @binding {string} icon-color
75
- @binding {string} icon-size
76
75
  -->
77
- <slot
78
- v-else
79
- name="placeholder"
80
- :icon-name="placeholderIcon"
81
- :icon-color="componentColor"
82
- :icon-size="size"
83
- >
76
+ <slot v-else name="placeholder" :icon-name="placeholderIcon" :icon-color="componentColor">
84
77
  <UIcon
85
78
  internal
86
79
  :size="size"