vueless 0.0.616 → 0.0.618

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 (67) 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.dropdown-list/UDropdownList.vue +9 -3
  19. package/ui.dropdown-list/config.ts +2 -2
  20. package/ui.form-checkbox/UCheckbox.vue +1 -12
  21. package/ui.form-checkbox/config.ts +10 -1
  22. package/ui.form-checkbox/types.ts +0 -2
  23. package/ui.form-color-picker/UColorPicker.vue +1 -14
  24. package/ui.form-color-picker/config.ts +12 -1
  25. package/ui.form-color-picker/types.ts +0 -2
  26. package/ui.form-date-picker/UDatePicker.vue +5 -7
  27. package/ui.form-date-picker/config.ts +10 -1
  28. package/ui.form-date-picker-range/UDatePickerRange.vue +3 -4
  29. package/ui.form-date-picker-range/config.ts +10 -1
  30. package/ui.form-input/UInput.vue +5 -29
  31. package/ui.form-input/config.ts +13 -3
  32. package/ui.form-input/types.ts +0 -2
  33. package/ui.form-input-file/UInputFile.vue +1 -13
  34. package/ui.form-input-file/config.ts +17 -1
  35. package/ui.form-input-file/types.ts +0 -2
  36. package/ui.form-input-rating/UInputRating.vue +1 -12
  37. package/ui.form-input-rating/config.ts +10 -1
  38. package/ui.form-input-rating/types.ts +0 -2
  39. package/ui.form-input-search/UInputSearch.vue +2 -26
  40. package/ui.form-input-search/config.ts +30 -3
  41. package/ui.form-input-search/types.ts +0 -3
  42. package/ui.form-select/USelect.vue +8 -47
  43. package/ui.form-select/config.ts +15 -5
  44. package/ui.form-select/types.ts +0 -1
  45. package/ui.form-switch/USwitch.vue +1 -12
  46. package/ui.form-switch/config.ts +10 -1
  47. package/ui.form-switch/types.ts +0 -2
  48. package/ui.image-avatar/UAvatar.vue +1 -8
  49. package/ui.navigation-pagination/UPagination.vue +4 -50
  50. package/ui.navigation-pagination/config.ts +21 -4
  51. package/ui.navigation-pagination/types.ts +0 -3
  52. package/ui.navigation-progress/UProgress.vue +3 -17
  53. package/ui.navigation-progress/config.ts +14 -0
  54. package/ui.navigation-progress/types.ts +0 -2
  55. package/ui.text-alert/UAlert.vue +9 -32
  56. package/ui.text-alert/config.ts +22 -2
  57. package/ui.text-alert/types.ts +0 -3
  58. package/ui.text-badge/UBadge.vue +6 -34
  59. package/ui.text-badge/config.ts +13 -3
  60. package/ui.text-badge/types.ts +0 -2
  61. package/ui.text-empty/UEmpty.vue +4 -32
  62. package/ui.text-empty/config.ts +20 -2
  63. package/ui.text-empty/types.ts +0 -3
  64. package/ui.text-file/UFile.vue +2 -24
  65. package/ui.text-file/config.ts +20 -2
  66. package/ui.text-file/types.ts +0 -3
  67. package/web-types.json +1 -80
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.616",
3
+ "version": "0.0.618",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -92,7 +92,6 @@ const { buttonAttrs, loaderAttrs, leftIconAttrs, rightIconAttrs, centerIconAttrs
92
92
  <!--
93
93
  @slot Use it to add something before the label.
94
94
  @binding {string} icon-name
95
- @binding {string} icon-size
96
95
  -->
97
96
  <slot name="left" :icon-name="leftIcon">
98
97
  <UIcon v-if="leftIcon" internal color="inherit" :name="leftIcon" v-bind="leftIconAttrs" />
@@ -102,7 +101,6 @@ const { buttonAttrs, loaderAttrs, leftIconAttrs, rightIconAttrs, centerIconAttrs
102
101
  @slot Use it to add something instead of the label.
103
102
  @binding {string} label
104
103
  @binding {string} icon-name
105
- @binding {string} icon-size
106
104
  -->
107
105
  <slot name="default" :label="label" :icon-name="icon">
108
106
  <UIcon v-if="icon" internal color="inherit" :name="icon" v-bind="centerIconAttrs" />
@@ -114,7 +112,6 @@ const { buttonAttrs, loaderAttrs, leftIconAttrs, rightIconAttrs, centerIconAttrs
114
112
  <!--
115
113
  @slot Use it to add something after the label.
116
114
  @binding {string} icon-name
117
- @binding {string} icon-size
118
115
  -->
119
116
  <slot name="right" :icon-name="rightIcon">
120
117
  <UIcon
@@ -10,7 +10,7 @@ import { getDefaults } from "../utils/ui.ts";
10
10
  import defaultConfig from "./config.ts";
11
11
  import { COMPONENT_NAME, TYPE_RADIO, TYPE_CHECKBOX } from "./constants.ts";
12
12
 
13
- import type { Props, LabelSize, Config } from "./types.ts";
13
+ import type { Props, Config } from "./types.ts";
14
14
 
15
15
  defineOptions({ inheritAttrs: false });
16
16
 
@@ -34,19 +34,6 @@ const selectedValue = computed({
34
34
  set: (value) => emit("update:modelValue", value),
35
35
  });
36
36
 
37
- const labelSize = computed(() => {
38
- const sizes = {
39
- "2xs": "sm",
40
- xs: "sm",
41
- sm: "md",
42
- md: "md",
43
- lg: "lg",
44
- xl: "lg",
45
- };
46
-
47
- return sizes[props.size] as LabelSize;
48
- });
49
-
50
37
  const type = computed(() => {
51
38
  return props.multiple ? TYPE_CHECKBOX : TYPE_RADIO;
52
39
  });
@@ -90,7 +77,6 @@ const { toggleLabelAttrs, itemsAttrs, itemAttrs } = useUI<Config>(defaultConfig)
90
77
 
91
78
  <template>
92
79
  <ULabel
93
- :size="labelSize"
94
80
  :label="label"
95
81
  :description="description"
96
82
  :align="labelAlign"
@@ -6,6 +6,16 @@ export default /*tw*/ {
6
6
  true: "w-full",
7
7
  },
8
8
  },
9
+ defaults: {
10
+ size: {
11
+ "2xs": "sm",
12
+ xs: "sm",
13
+ sm: "md",
14
+ md: "md",
15
+ lg: "lg",
16
+ xl: "lg",
17
+ },
18
+ },
9
19
  },
10
20
  items: {
11
21
  base: "",
@@ -4,8 +4,6 @@ import type { ComponentConfig } from "../types.ts";
4
4
 
5
5
  export type Config = typeof defaultConfig;
6
6
 
7
- export type LabelSize = "sm" | "md" | "lg";
8
-
9
7
  export interface UToggleOption {
10
8
  value: string | number;
11
9
  label: string;
@@ -10,7 +10,7 @@ import UDivider from "../ui.container-divider/UDivider.vue";
10
10
  import { COMPONENT_NAME } from "./constants.ts";
11
11
  import defaultConfig from "./config.ts";
12
12
 
13
- import type { Props, DividerSize, Config } from "./types.ts";
13
+ import type { Props, Config } from "./types.ts";
14
14
 
15
15
  defineOptions({ inheritAttrs: false });
16
16
 
@@ -35,16 +35,6 @@ const toggleIcon = computed(() =>
35
35
  isOpened.value ? config.value.defaults.collapseIcon : config.value.defaults.expandIcon,
36
36
  );
37
37
 
38
- const dividerSize = computed(() => {
39
- const sizes = {
40
- sm: "md",
41
- md: "lg",
42
- lg: "xl",
43
- };
44
-
45
- return sizes[props.size] as DividerSize;
46
- });
47
-
48
38
  function onClickItem() {
49
39
  isOpened.value = !isOpened.value;
50
40
 
@@ -75,10 +65,9 @@ const {
75
65
  <!--
76
66
  @slot Use it to add something instead of the toggle icon.
77
67
  @binding {string} icon-name
78
- @binding {string} icon-size
79
68
  @binding {boolean} opened
80
69
  -->
81
- <slot name="toggle" :icon-name="toggleIcon" :icon-size="size" :opened="isOpened">
70
+ <slot name="toggle" :icon-name="toggleIcon" :opened="isOpened">
82
71
  <UIcon :name="toggleIcon" :size="size" color="gray" internal v-bind="toggleIconAttrs" />
83
72
  </slot>
84
73
  </div>
@@ -86,6 +75,6 @@ const {
86
75
  <div :id="`description-${elementId}`" v-bind="descriptionAttrs" v-text="description" />
87
76
  </div>
88
77
 
89
- <UDivider :size="dividerSize" v-bind="accordionDividerAttrs" />
78
+ <UDivider v-bind="accordionDividerAttrs" />
90
79
  </div>
91
80
  </template>
@@ -25,7 +25,16 @@ export default /*tw*/ {
25
25
  },
26
26
  },
27
27
  toggleIcon: "{UIcon}",
28
- accordionDivider: "{UDivider} group-last:hidden",
28
+ accordionDivider: {
29
+ base: "{UDivider} group-last:hidden",
30
+ defaults: {
31
+ size: {
32
+ sm: "md",
33
+ md: "lg",
34
+ lg: "xl",
35
+ },
36
+ },
37
+ },
29
38
  defaults: {
30
39
  size: "md",
31
40
  /* icons */
@@ -2,7 +2,6 @@ import defaultConfig from "./config.ts";
2
2
  import type { ComponentConfig } from "../types.ts";
3
3
 
4
4
  export type Config = typeof defaultConfig;
5
- export type DividerSize = "md" | "lg" | "xl";
6
5
 
7
6
  export interface Props {
8
7
  /**
@@ -14,7 +14,7 @@ import { COMPONENT_NAME } from "./constants.ts";
14
14
  import defaultConfig from "./config.ts";
15
15
  import { useLocale } from "../composables/useLocale.ts";
16
16
 
17
- import type { Props, IconSize, DragMoveEvent, DataListItem, Config } from "./types.ts";
17
+ import type { Props, DragMoveEvent, DataListItem, Config } from "./types.ts";
18
18
 
19
19
  defineOptions({ inheritAttrs: false });
20
20
 
@@ -50,16 +50,6 @@ const { tm } = useLocale();
50
50
  const i18nGlobal = tm(COMPONENT_NAME);
51
51
  const currentLocale = computed(() => merge({}, defaultConfig.i18n, i18nGlobal, props.config.i18n));
52
52
 
53
- const iconSize = computed(() => {
54
- const sizes = {
55
- sm: "xs",
56
- md: "sm",
57
- lg: "md",
58
- };
59
-
60
- return sizes[props.size] as IconSize;
61
- });
62
-
63
53
  function isActive(element: DataListItem) {
64
54
  return element.isActive === undefined || element.isActive;
65
55
  }
@@ -172,19 +162,12 @@ const {
172
162
  @slot Use it to add something instead of the drag icon.
173
163
  @binding {object} item
174
164
  @binding {string} icon-name
175
- @binding {string} icon-size
176
165
  -->
177
- <slot
178
- name="drag"
179
- :item="element"
180
- :icon-name="config.defaults.dragIcon"
181
- :icon-size="iconSize"
182
- >
166
+ <slot name="drag" :item="element" :icon-name="config.defaults.dragIcon">
183
167
  <UIcon
184
168
  internal
185
169
  color="gray"
186
170
  variant="light"
187
- :size="iconSize"
188
171
  :name="config.defaults.dragIcon"
189
172
  v-bind="dragIconAttrs"
190
173
  />
@@ -217,20 +200,13 @@ const {
217
200
  @slot Use it to add something instead of the delete icon.
218
201
  @binding {object} item
219
202
  @binding {string} icon-name
220
- @binding {string} icon-size
221
203
  -->
222
- <slot
223
- name="delete"
224
- :item="element"
225
- :icon-name="config.defaults.deleteIcon"
226
- :icon-size="iconSize"
227
- >
204
+ <slot name="delete" :item="element" :icon-name="config.defaults.deleteIcon">
228
205
  <UIcon
229
206
  v-if="!element.isHiddenDelete"
230
207
  internal
231
208
  interactive
232
209
  color="red"
233
- :size="iconSize"
234
210
  :name="config.defaults.deleteIcon"
235
211
  :tooltip="currentLocale.delete"
236
212
  v-bind="deleteIconAttrs"
@@ -243,20 +219,13 @@ const {
243
219
  @slot Use it to add something instead of the edit icon.
244
220
  @binding {object} item
245
221
  @binding {string} icon-name
246
- @binding {string} icon-size
247
222
  -->
248
- <slot
249
- name="edit"
250
- :item="element"
251
- :icon-name="config.defaults.editIcon"
252
- :icon-size="iconSize"
253
- >
223
+ <slot name="edit" :item="element" :icon-name="config.defaults.editIcon">
254
224
  <UIcon
255
225
  v-if="!element.isHiddenEdit"
256
226
  internal
257
227
  interactive
258
228
  color="gray"
259
- :size="iconSize"
260
229
  :name="config.defaults.editIcon"
261
230
  :tooltip="currentLocale.edit"
262
231
  v-bind="editIconAttrs"
@@ -10,7 +10,17 @@ export default /*tw*/ {
10
10
  group-last/item-wrapper:border-b-0 group-[]/nested:group-last/item-wrapper:border-b
11
11
  py-4 space-x-4 flex flex-auto items-center justify-between
12
12
  `,
13
- dragIcon: "{UIcon} icon-drag cursor-move opacity-100",
13
+ dataListIcon: {
14
+ base: "{UIcon}",
15
+ defaults: {
16
+ size: {
17
+ sm: "xs",
18
+ md: "sm",
19
+ lg: "md",
20
+ },
21
+ },
22
+ },
23
+ dragIcon: "{UIcon} {>dataListIcon} icon-drag cursor-move opacity-100",
14
24
  label: {
15
25
  base: "font-normal text-gray-900 flex-auto pt-px",
16
26
  variants: {
@@ -26,8 +36,8 @@ export default /*tw*/ {
26
36
  space-x-5 opacity-50 md:flex md:items-center md:opacity-0
27
37
  group-hover/item:md:block group-hover/item:opacity-100
28
38
  `,
29
- deleteIcon: "{UIcon} hidden md:block md:opacity-0 group-hover/item:md:opacity-100",
30
- editIcon: "{UIcon} fill-gray-500 opacity-50",
39
+ deleteIcon: "{UIcon} {>dataListIcon} hidden md:block md:opacity-0 group-hover/item:md:opacity-100",
40
+ editIcon: "{UIcon} {>dataListIcon} fill-gray-500 opacity-50",
31
41
  divider: "{UDivider}",
32
42
  empty: "{UEmpty}",
33
43
  nested: "{UDataList} group/nested ml-6",
@@ -6,8 +6,6 @@ import type { ComponentConfig, UnknownType } from "../types.ts";
6
6
 
7
7
  export type Config = typeof defaultConfig;
8
8
 
9
- export type IconSize = "xs" | "sm" | "md";
10
-
11
9
  export interface DragMoveEvent extends DragEvent {
12
10
  draggedContext: typeof DraggableContext;
13
11
  relatedContext: typeof DraggableContext | null;
@@ -13,7 +13,7 @@ import { vClickOutside } from "../directives";
13
13
  import defaultConfig from "./config.ts";
14
14
  import { COMPONENT_NAME } from "./constants.ts";
15
15
 
16
- import type { Props, IconSize, DropdownSize, Config } from "./types.ts";
16
+ import type { Props, Config } from "./types.ts";
17
17
  import type { Option } from "../ui.dropdown-list/types.ts";
18
18
 
19
19
  defineOptions({ inheritAttrs: false });
@@ -41,32 +41,6 @@ const dropdownListRef = useTemplateRef<UDropdownListRef>("dropdown-list");
41
41
 
42
42
  const elementId = props.id || useId();
43
43
 
44
- const iconSize = computed(() => {
45
- const sizes = {
46
- "2xs": "xs",
47
- xs: "xs",
48
- sm: "sm",
49
- md: "sm",
50
- lg: "md",
51
- xl: "md",
52
- };
53
-
54
- return sizes[props.size] as IconSize;
55
- });
56
-
57
- const dropdownSize = computed(() => {
58
- const sizes = {
59
- "2xs": "sm",
60
- xs: "sm",
61
- sm: "sm",
62
- md: "md",
63
- lg: "lg",
64
- xl: "lg",
65
- };
66
-
67
- return sizes[props.size] as DropdownSize;
68
- });
69
-
70
44
  function onClickOption(option: Option) {
71
45
  emit("clickOption", option);
72
46
  }
@@ -143,7 +117,6 @@ const { config, dropdownButtonAttrs, dropdownListAttrs, dropdownIconAttrs, wrapp
143
117
  v-if="!noIcon"
144
118
  internal
145
119
  color="inherit"
146
- :size="iconSize"
147
120
  :name="config.defaults.dropdownIcon"
148
121
  v-bind="dropdownIconAttrs"
149
122
  :data-test="`${dataTest}-dropdown`"
@@ -155,7 +128,6 @@ const { config, dropdownButtonAttrs, dropdownListAttrs, dropdownIconAttrs, wrapp
155
128
  <UDropdownList
156
129
  v-if="isShownOptions"
157
130
  ref="dropdown-list"
158
- :size="dropdownSize"
159
131
  :options="options"
160
132
  :label-key="labelKey"
161
133
  v-bind="dropdownListAttrs"
@@ -9,7 +9,19 @@ export default /*tw*/ {
9
9
  },
10
10
  compoundVariants: [{ opened: true, color: ["grayscale", "white"], class: "ring-gray-700/15" }],
11
11
  },
12
- dropdownIcon: "{UIcon} transition duration-300 group-[]:rotate-180",
12
+ dropdownIcon: {
13
+ base: "{UIcon} transition duration-300 group-[]:rotate-180",
14
+ defaults: {
15
+ size: {
16
+ "2xs": "sm",
17
+ xs: "sm",
18
+ sm: "sm",
19
+ md: "md",
20
+ lg: "lg",
21
+ xl: "lg",
22
+ },
23
+ },
24
+ },
13
25
  dropdownList: {
14
26
  base: "{UDropdownList} w-fit",
15
27
  variants: {
@@ -22,6 +34,16 @@ export default /*tw*/ {
22
34
  right: "right-0",
23
35
  },
24
36
  },
37
+ defaults: {
38
+ size: {
39
+ "2xs": "sm",
40
+ xs: "sm",
41
+ sm: "sm",
42
+ md: "md",
43
+ lg: "lg",
44
+ xl: "lg",
45
+ },
46
+ },
25
47
  },
26
48
  defaults: {
27
49
  color: "brand",
@@ -5,9 +5,6 @@ import type { ComponentConfig } from "../types.ts";
5
5
 
6
6
  export type Config = typeof defaultConfig;
7
7
 
8
- export type IconSize = "2xs" | "xs" | "sm" | "md" | "lg" | "xl";
9
- export type DropdownSize = "sm" | "md" | "lg";
10
-
11
8
  export interface Props {
12
9
  /**
13
10
  * Button label.
@@ -13,7 +13,7 @@ import { vClickOutside } from "../directives";
13
13
  import { COMPONENT_NAME } from "./constants.ts";
14
14
  import defaultConfig from "./config.ts";
15
15
 
16
- import type { Props, IconSize, Config } from "./types.ts";
16
+ import type { Props, Config } from "./types.ts";
17
17
  import type { Option } from "../ui.dropdown-list/types.ts";
18
18
 
19
19
  defineOptions({ inheritAttrs: false });
@@ -41,16 +41,6 @@ const dropdownListRef = useTemplateRef<UDropdownListRef>("dropdown-list");
41
41
 
42
42
  const elementId = props.id || useId();
43
43
 
44
- const iconSize = computed(() => {
45
- const sizes = {
46
- sm: "2xs",
47
- md: "xs",
48
- lg: "sm",
49
- };
50
-
51
- return sizes[props.size] as IconSize;
52
- });
53
-
54
44
  function onClickLink() {
55
45
  isShownOptions.value = !isShownOptions.value;
56
46
 
@@ -129,7 +119,6 @@ const { config, wrapperAttrs, dropdownLinkAttrs, dropdownListAttrs, dropdownIcon
129
119
  internal
130
120
  interactive
131
121
  :color="color"
132
- :size="iconSize"
133
122
  :name="config.defaults.dropdownIcon"
134
123
  v-bind="dropdownIconAttrs"
135
124
  :data-test="`${dataTest}-dropdown`"
@@ -8,7 +8,16 @@ export default /*tw*/ {
8
8
  },
9
9
  },
10
10
  dropdownLink: "{ULink}",
11
- dropdownIcon: "{UIcon} block transition duration-300 group-[]:rotate-180",
11
+ dropdownIcon: {
12
+ base: "{UIcon} block transition duration-300 group-[]:rotate-180",
13
+ defaults: {
14
+ size: {
15
+ sm: "2xs",
16
+ md: "xs",
17
+ lg: "sm",
18
+ },
19
+ },
20
+ },
12
21
  dropdownList: {
13
22
  base: "{UDropdownList} w-fit",
14
23
  variants: {
@@ -5,8 +5,6 @@ import type { ComponentConfig } from "../types.ts";
5
5
 
6
6
  export type Config = typeof defaultConfig;
7
7
 
8
- export type IconSize = "sm" | "2xs" | "xs";
9
-
10
8
  export interface Props {
11
9
  /**
12
10
  * Link label.
@@ -166,8 +166,13 @@ function getMarginForSubCategory(level: number = 0) {
166
166
  function optionHighlight(index: number, option: Option) {
167
167
  const classes = [];
168
168
 
169
- if (index === pointer.value) classes.push(config.value?.optionHighlighted);
170
- if (isSelectedOption(option)) classes.push(config.value?.optionSelected);
169
+ if (isSelectedOption(option)) {
170
+ classes.push(config.value?.optionActive);
171
+ }
172
+
173
+ if (index === pointer.value && !isSelectedOption(option)) {
174
+ classes.push(config.value?.optionHighlighted);
175
+ }
171
176
 
172
177
  return classes;
173
178
  }
@@ -251,6 +256,7 @@ const {
251
256
  addOptionLabelHotkeyAttrs,
252
257
  addOptionButtonAttrs,
253
258
  addOptionIconAttrs,
259
+ optionActiveAttrs,
254
260
  optionAttrs,
255
261
  subGroupAttrs,
256
262
  groupAttrs,
@@ -281,7 +287,7 @@ const {
281
287
  <!-- option title -->
282
288
  <span
283
289
  v-if="!(option && (option.groupLabel || option.isSubGroup)) && !option.isHidden"
284
- v-bind="optionAttrs"
290
+ v-bind="isSelectedOption(option) ? optionActiveAttrs : optionAttrs"
285
291
  :class="optionHighlight(index, option)"
286
292
  @click="select(option), onClickOption(option)"
287
293
  @mouseenter.self="pointerSet(index)"
@@ -25,9 +25,9 @@ export default /*tw*/ {
25
25
  },
26
26
  },
27
27
  },
28
- optionContent: "overflow-visible text-ellipsis",
29
- optionSelected: "font-bold bg-brand-100",
28
+ optionActive: "{>option} font-bold bg-brand-100 hover:bg-brand-100",
30
29
  optionHighlighted: "bg-brand-50",
30
+ optionContent: "overflow-visible text-ellipsis",
31
31
  groupBase: {
32
32
  base: "px-2 pb-2.5 font-medium !leading-none text-gray-400 overflow-hidden text-ellipsis",
33
33
  variants: {
@@ -12,7 +12,7 @@ import defaultConfig from "./config.ts";
12
12
  import { COMPONENT_NAME } from "./constants.ts";
13
13
 
14
14
  import type { UnknownObject } from "../types.ts";
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
 
@@ -54,16 +54,6 @@ const checkboxColor = ref(props.color);
54
54
 
55
55
  const elementId = props.id || useId();
56
56
 
57
- const iconSize = computed(() => {
58
- const sizes = {
59
- sm: "2xs",
60
- md: "xs",
61
- lg: "sm",
62
- };
63
-
64
- return sizes[props.size] as IconSize;
65
- });
66
-
67
57
  const isBinary = computed(() => !Array.isArray(props.modelValue));
68
58
  const isCheckboxInGroup = computed(() => Boolean(toValue(getCheckboxGroupName)));
69
59
 
@@ -164,7 +154,6 @@ const { config, checkboxAttrs, iconWrapperAttrs, checkboxLabelAttrs, checkedIcon
164
154
  <UIcon
165
155
  internal
166
156
  :name="partial ? config.defaults.partiallyCheckedIcon : config.defaults.checkedIcon"
167
- :size="iconSize"
168
157
  color="white"
169
158
  v-bind="checkedIconAttrs"
170
159
  />
@@ -40,7 +40,16 @@ export default /*tw*/ {
40
40
  },
41
41
  },
42
42
  },
43
- checkedIcon: "{UIcon}",
43
+ checkedIcon: {
44
+ base: "{UIcon}",
45
+ defaults: {
46
+ size: {
47
+ sm: "2xs",
48
+ md: "xs",
49
+ lg: "sm",
50
+ },
51
+ },
52
+ },
44
53
  defaults: {
45
54
  color: "brand",
46
55
  size: "md",
@@ -4,8 +4,6 @@ import type { ComponentConfig, UnknownObject, UnknownArray } 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 UCheckboxOption {
10
8
  value?: string | number | boolean | UnknownObject | UnknownArray;
11
9
  falseValue?: string | number | boolean | UnknownObject | UnknownArray;
@@ -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
  import type { BrandColors } from "../types.ts";
16
16
 
17
17
  defineOptions({ inheritAttrs: false });
@@ -39,18 +39,6 @@ const selectedItem = computed({
39
39
  set: (value) => emit("update:modelValue", value),
40
40
  });
41
41
 
42
- const iconSize = computed(() => {
43
- const sizes = {
44
- xs: "3xs",
45
- sm: "2xs",
46
- md: "xs",
47
- lg: "sm",
48
- xl: "md",
49
- };
50
-
51
- return sizes[props.size] as IconSize;
52
- });
53
-
54
42
  function onUpdateValue(value: string) {
55
43
  selectedItem.value = value;
56
44
  }
@@ -98,7 +86,6 @@ const {
98
86
  <UIcon
99
87
  v-if="selectedItem === ''"
100
88
  internal
101
- :size="iconSize"
102
89
  color="gray"
103
90
  :name="config.defaults.unselectedIcon"
104
91
  v-bind="unselectedIconAttrs"
@@ -11,7 +11,18 @@ export default /*tw*/ {
11
11
  },
12
12
  },
13
13
  unselected: "relative flex",
14
- unselectedIcon: "{UIcon} absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full",
14
+ unselectedIcon: {
15
+ base: "{UIcon} absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full",
16
+ defaults: {
17
+ size: {
18
+ xs: "3xs",
19
+ sm: "2xs",
20
+ md: "xs",
21
+ lg: "sm",
22
+ xl: "md",
23
+ },
24
+ },
25
+ },
15
26
  unselectedColorPickerRadio: {
16
27
  base: "{URadio}",
17
28
  radio: "checked:text-white !border-gray-300",
@@ -4,8 +4,6 @@ import type { BrandColors, ComponentConfig } from "../types.ts";
4
4
 
5
5
  export type Config = typeof defaultConfig;
6
6
 
7
- export type IconSize = "3xs" | "2xs" | "xs" | "sm" | "md";
8
-
9
7
  export interface Props {
10
8
  /**
11
9
  * Color picker selected value.