vueless 0.0.612 → 0.0.614

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 (126) hide show
  1. package/composables/useUI.ts +2 -2
  2. package/package.json +1 -1
  3. package/ui.button-link/ULink.vue +2 -2
  4. package/ui.button-link/constants.ts +1 -1
  5. package/ui.button-toggle/UToggle.vue +4 -5
  6. package/ui.button-toggle/config.ts +11 -12
  7. package/ui.button-toggle/constants.ts +1 -1
  8. package/ui.button-toggle/storybook/stories.ts +7 -14
  9. package/ui.button-toggle/types.ts +3 -7
  10. package/ui.button-toggle-item/UToggleItem.vue +20 -22
  11. package/ui.button-toggle-item/config.ts +9 -26
  12. package/ui.button-toggle-item/constants.ts +1 -1
  13. package/ui.container-accordion/UAccordion.vue +2 -2
  14. package/ui.container-accordion/constants.ts +1 -1
  15. package/ui.container-card/UCard.vue +2 -2
  16. package/ui.container-card/constants.ts +1 -1
  17. package/ui.container-col/UCol.vue +2 -2
  18. package/ui.container-col/constants.ts +1 -1
  19. package/ui.container-divider/UDivider.vue +2 -2
  20. package/ui.container-divider/constants.ts +1 -1
  21. package/ui.container-group/UGroup.vue +2 -2
  22. package/ui.container-group/constants.ts +1 -1
  23. package/ui.container-groups/UGroups.vue +2 -2
  24. package/ui.container-groups/constants.ts +1 -1
  25. package/ui.container-modal/UModal.vue +2 -2
  26. package/ui.container-modal/constants.ts +1 -1
  27. package/ui.container-modal-confirm/UModalConfirm.vue +3 -3
  28. package/ui.container-modal-confirm/constants.ts +1 -1
  29. package/ui.container-page/UPage.vue +2 -2
  30. package/ui.container-page/constants.ts +1 -1
  31. package/ui.container-row/URow.vue +2 -2
  32. package/ui.container-row/constants.ts +1 -1
  33. package/ui.data-list/UDataList.vue +3 -3
  34. package/ui.data-list/constants.ts +1 -1
  35. package/ui.data-table/UTable.vue +3 -3
  36. package/ui.data-table/constants.ts +1 -1
  37. package/ui.dropdown-badge/UDropdownBadge.vue +2 -2
  38. package/ui.dropdown-badge/constants.ts +1 -1
  39. package/ui.dropdown-button/UDropdownButton.vue +2 -2
  40. package/ui.dropdown-button/constants.ts +1 -1
  41. package/ui.dropdown-link/UDropdownLink.vue +2 -2
  42. package/ui.dropdown-link/constants.ts +1 -1
  43. package/ui.dropdown-list/UDropdownList.vue +3 -3
  44. package/ui.dropdown-list/constants.ts +1 -1
  45. package/ui.form-calendar/UCalendar.vue +3 -3
  46. package/ui.form-calendar/constants.ts +1 -1
  47. package/ui.form-calendar/storybook/stories.ts +4 -4
  48. package/ui.form-checkbox/UCheckbox.vue +2 -2
  49. package/ui.form-checkbox/constants.ts +1 -1
  50. package/ui.form-checkbox-group/UCheckboxGroup.vue +2 -2
  51. package/ui.form-checkbox-group/constants.ts +1 -1
  52. package/ui.form-checkbox-multi-state/UCheckboxMultiState.vue +2 -2
  53. package/ui.form-checkbox-multi-state/constants.ts +1 -1
  54. package/ui.form-color-picker/UColorPicker.vue +3 -3
  55. package/ui.form-color-picker/constants.ts +1 -1
  56. package/ui.form-date-picker/UDatePicker.vue +3 -3
  57. package/ui.form-date-picker/constants.ts +1 -1
  58. package/ui.form-date-picker/storybook/stories.ts +4 -4
  59. package/ui.form-date-picker-range/UDatePickerRange.vue +2 -2
  60. package/ui.form-date-picker-range/constants.ts +1 -1
  61. package/ui.form-date-picker-range/storybook/stories.ts +4 -4
  62. package/ui.form-date-picker-range/useLocale.ts +2 -2
  63. package/ui.form-input/UInput.vue +2 -2
  64. package/ui.form-input/constants.ts +1 -1
  65. package/ui.form-input-file/UInputFile.vue +3 -3
  66. package/ui.form-input-file/constants.ts +1 -1
  67. package/ui.form-input-money/UInputMoney.vue +2 -2
  68. package/ui.form-input-money/constants.ts +1 -1
  69. package/ui.form-input-number/UInputNumber.vue +2 -2
  70. package/ui.form-input-number/constants.ts +1 -1
  71. package/ui.form-input-rating/UInputRating.vue +2 -2
  72. package/ui.form-input-rating/constants.ts +1 -1
  73. package/ui.form-input-search/UInputSearch.vue +2 -2
  74. package/ui.form-input-search/constants.ts +1 -1
  75. package/ui.form-label/ULabel.vue +2 -2
  76. package/ui.form-label/constants.ts +1 -1
  77. package/ui.form-radio/URadio.vue +2 -2
  78. package/ui.form-radio/constants.ts +1 -1
  79. package/ui.form-radio-group/URadioGroup.vue +2 -2
  80. package/ui.form-radio-group/constants.ts +1 -1
  81. package/ui.form-select/USelect.vue +3 -3
  82. package/ui.form-select/constants.ts +1 -1
  83. package/ui.form-switch/USwitch.vue +3 -3
  84. package/ui.form-switch/constants.ts +1 -1
  85. package/ui.form-textarea/UTextarea.vue +2 -2
  86. package/ui.form-textarea/constants.ts +1 -1
  87. package/ui.image-avatar/UAvatar.vue +2 -2
  88. package/ui.image-avatar/constants.ts +1 -1
  89. package/ui.image-icon/UIcon.vue +2 -2
  90. package/ui.image-icon/constants.ts +1 -1
  91. package/ui.loader/ULoader.vue +2 -2
  92. package/ui.loader/constants.ts +1 -1
  93. package/ui.loader-overlay/ULoaderOverlay.vue +2 -2
  94. package/ui.loader-overlay/constants.ts +1 -1
  95. package/ui.loader-progress/ULoaderProgress.vue +2 -2
  96. package/ui.loader-progress/constants.ts +1 -1
  97. package/ui.navigation-pagination/UPagination.vue +2 -2
  98. package/ui.navigation-pagination/constants.ts +1 -1
  99. package/ui.navigation-progress/UProgress.vue +2 -2
  100. package/ui.navigation-progress/constants.ts +1 -1
  101. package/ui.navigation-tab/UTab.vue +3 -3
  102. package/ui.navigation-tab/constants.ts +1 -1
  103. package/ui.navigation-tabs/UTabs.vue +2 -2
  104. package/ui.navigation-tabs/constants.ts +1 -1
  105. package/ui.other-dot/UDot.vue +2 -2
  106. package/ui.other-dot/constants.ts +1 -1
  107. package/ui.text-alert/UAlert.vue +2 -2
  108. package/ui.text-alert/constants.ts +1 -1
  109. package/ui.text-badge/UBadge.vue +2 -2
  110. package/ui.text-badge/constants.ts +1 -1
  111. package/ui.text-block/UText.vue +2 -2
  112. package/ui.text-block/constants.ts +1 -1
  113. package/ui.text-empty/UEmpty.vue +2 -2
  114. package/ui.text-empty/constants.ts +1 -1
  115. package/ui.text-file/UFile.vue +2 -2
  116. package/ui.text-file/constants.ts +1 -1
  117. package/ui.text-files/UFiles.vue +2 -2
  118. package/ui.text-files/constants.ts +1 -1
  119. package/ui.text-header/UHeader.vue +2 -2
  120. package/ui.text-header/constants.ts +1 -1
  121. package/ui.text-money/UMoney.vue +2 -2
  122. package/ui.text-money/constants.ts +1 -1
  123. package/ui.text-notify/UNotify.vue +3 -3
  124. package/ui.text-notify/constants.ts +1 -1
  125. package/utils/ui.ts +2 -2
  126. package/web-types.json +3 -18
@@ -158,10 +158,10 @@ export default function useUI<T>(
158
158
  vuelessAttrs.value = {
159
159
  ...commonAttrs,
160
160
  class: cx([...extendsClasses, toValue(classes)]),
161
- config: merge({}, configAttr, extendsConfigAttr),
161
+ config: merge({}, extendsConfigAttr, configAttr),
162
162
  ...getDefaults({
163
- ...(configAttr.defaults || {}),
164
163
  ...(extendsConfigAttr.defaults || {}),
164
+ ...(configAttr.defaults || {}),
165
165
  }),
166
166
  };
167
167
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.612",
3
+ "version": "0.0.614",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -7,14 +7,14 @@ import { hasSlotContent } from "../utils/helper.ts";
7
7
  import { getDefaults } from "../utils/ui.ts";
8
8
 
9
9
  import defaultConfig from "./config.ts";
10
- import { ULink } from "./constants.ts";
10
+ import { COMPONENT_NAME } from "./constants.ts";
11
11
 
12
12
  import type { Props, Config } from "./types.ts";
13
13
 
14
14
  defineOptions({ inheritAttrs: false });
15
15
 
16
16
  const props = withDefaults(defineProps<Props>(), {
17
- ...getDefaults<Props, Config>(defaultConfig, ULink),
17
+ ...getDefaults<Props, Config>(defaultConfig, COMPONENT_NAME),
18
18
  label: "",
19
19
  to: undefined,
20
20
  });
@@ -2,4 +2,4 @@
2
2
  This const is needed to prevent the issue in script setup:
3
3
  `defineProps` is referencing locally declared variables. (vue/valid-define-props)
4
4
  */
5
- export const ULink = "ULink";
5
+ export const COMPONENT_NAME = "ULink";
@@ -8,14 +8,14 @@ import useUI from "../composables/useUI.ts";
8
8
  import { getDefaults } from "../utils/ui.ts";
9
9
 
10
10
  import defaultConfig from "./config.ts";
11
- import { UToggle, TYPE_RADIO, TYPE_CHECKBOX } from "./constants.ts";
11
+ import { COMPONENT_NAME, TYPE_RADIO, TYPE_CHECKBOX } from "./constants.ts";
12
12
 
13
13
  import type { Props, LabelSize, Config } from "./types.ts";
14
14
 
15
15
  defineOptions({ inheritAttrs: false });
16
16
 
17
17
  const props = withDefaults(defineProps<Props>(), {
18
- ...getDefaults<Props, Config>(defaultConfig, UToggle),
18
+ ...getDefaults<Props, Config>(defaultConfig, COMPONENT_NAME),
19
19
  options: () => [],
20
20
  modelValue: "",
21
21
  label: "",
@@ -73,9 +73,8 @@ provide("getToggleSize", () => props.size);
73
73
  provide("getToggleRound", () => props.round);
74
74
  provide("getToggleBlock", () => props.block);
75
75
  provide("getToggleSquare", () => props.square);
76
- provide("getToggleVariant", () => props.variant);
77
76
  provide("getToggleDisabled", () => props.disabled);
78
- provide("getToggleSeparated", () => props.separated);
77
+ provide("getToggleSplit", () => props.split);
79
78
 
80
79
  provide("toggleSelectedValue", {
81
80
  selectedValue: readonly(selectedValue),
@@ -109,7 +108,7 @@ const { toggleLabelAttrs, itemsAttrs, itemAttrs } = useUI<Config>(defaultConfig)
109
108
  :name="name"
110
109
  :model-value="item.value"
111
110
  :value="item.value"
112
- :disabled="disabled"
111
+ :disabled="disabled || item.disabled"
113
112
  :label="item.label"
114
113
  v-bind="itemAttrs"
115
114
  :data-test="`${dataTest}-item-${index}`"
@@ -18,36 +18,35 @@ export default /*tw*/ {
18
18
  lg: "gap-3",
19
19
  xl: "gap-3",
20
20
  },
21
- separated: {
21
+ split: {
22
22
  true: "flex flex-wrap",
23
23
  false: `
24
- flex flex-nowrap -space-x-px gap-0 rounded-dynamic transition w-fit
25
- [&>:first-child]:rounded-dynamic [&>:first-child]:rounded-r-none
26
- [&>:last-child]:rounded-dynamic [&>:last-child]:rounded-l-none
27
- [&>:first-child>*>*]:rounded-dynamic [&>:first-child>*>*]:rounded-r-none
28
- [&>:last-child>*>*]:rounded-dynamic [&>:last-child>*>*]:rounded-l-none
24
+ p-1 gap-1 flex flex-nowrap w-fit transition
25
+ border border-gray-300 rounded-dynamic
26
+ hover:border-gray-400 hover:focus-within:border-brand-500 focus-within:border-brand-500
29
27
  focus-within:ring-dynamic focus-within:ring-offset-dynamic focus-within:ring-brand-700/15
30
28
  `,
31
29
  },
30
+ disabled: {
31
+ true: "pointer-events-none",
32
+ },
32
33
  block: {
33
34
  true: "w-full flex-nowrap",
34
35
  },
36
+ round: {
37
+ true: "rounded-full",
38
+ },
35
39
  },
36
- compoundVariants: [
37
- { separated: false, variant: "thirdary", class: "space-x-px" },
38
- { separated: false, multiple: true, class: "space-x-px" },
39
- ],
40
40
  },
41
41
  item: "{UToggleItem}",
42
42
  defaults: {
43
- variant: "primary",
44
43
  labelAlign: "top",
45
44
  size: "md",
45
+ split: false,
46
46
  block: false,
47
47
  round: false,
48
48
  square: false,
49
49
  disabled: false,
50
50
  multiple: false,
51
- separated: false,
52
51
  },
53
52
  };
@@ -2,6 +2,6 @@
2
2
  This const is needed to prevent the issue in script setup:
3
3
  `defineProps` is referencing locally declared variables. (vue/valid-define-props)
4
4
  */
5
- export const UToggle = "UToggle";
5
+ export const COMPONENT_NAME = "UToggle";
6
6
  export const TYPE_RADIO = "radio";
7
7
  export const TYPE_CHECKBOX = "checkbox";
@@ -16,7 +16,7 @@ import type { Props } from "../types.ts";
16
16
 
17
17
  interface UToggleArgs extends Props {
18
18
  slotTemplate?: string;
19
- enum: "variant" | "size";
19
+ enum: "size";
20
20
  }
21
21
 
22
22
  export default {
@@ -109,41 +109,34 @@ Sizes.args = {
109
109
  enum: "size",
110
110
  };
111
111
 
112
- export const Variants = EnumVariantTemplate.bind({});
113
- Variants.args = {
114
- name: "sizeTemplate",
115
- enum: "variant",
116
- };
117
-
118
112
  export const Multiple = DefaultTemplate.bind({});
119
113
  Multiple.args = { name: "multipleTemplate", multiple: true };
120
114
 
121
115
  export const Block = DefaultTemplate.bind({});
122
116
  Block.args = { name: "block", block: true };
123
117
 
124
- export const Separated = DefaultTemplate.bind({});
125
- Separated.args = { name: "separated", separated: true };
118
+ export const Split = DefaultTemplate.bind({});
119
+ Split.args = { name: "split", split: true };
126
120
 
127
121
  export const Round = DefaultTemplate.bind({});
128
- Round.args = { name: "round", round: true, separated: true };
122
+ Round.args = { name: "round", round: true, split: true };
129
123
 
130
124
  export const Square = DefaultTemplate.bind({});
131
125
  Square.args = {
132
126
  name: "square",
133
- variant: "secondary",
134
127
  square: true,
135
128
  slotTemplate: `
136
129
  <template #default>
137
130
  <UToggleItem value="1">
138
- <UIcon name="star" />
131
+ <UIcon name="star" color="inherit" />
139
132
  </UToggleItem>
140
133
 
141
134
  <UToggleItem value="2" >
142
- <UIcon name="add" />
135
+ <UIcon name="add" color="inherit" />
143
136
  </UToggleItem>
144
137
 
145
138
  <UToggleItem value="3">
146
- <UIcon name="timer" />
139
+ <UIcon name="timer" color="inherit" />
147
140
  </UToggleItem>
148
141
  </template>
149
142
  `,
@@ -9,6 +9,7 @@ export type LabelSize = "sm" | "md" | "lg";
9
9
  export interface UToggleOption {
10
10
  value: string | number;
11
11
  label: string;
12
+ disabled?: boolean;
12
13
  }
13
14
 
14
15
  export interface Props {
@@ -22,11 +23,6 @@ export interface Props {
22
23
  */
23
24
  options?: UToggleOption[];
24
25
 
25
- /**
26
- * Toggle variant.
27
- */
28
- variant?: "primary" | "secondary" | "thirdary";
29
-
30
26
  /**
31
27
  * Toggle size.
32
28
  */
@@ -58,9 +54,9 @@ export interface Props {
58
54
  multiple?: boolean;
59
55
 
60
56
  /**
61
- * Separate toggle items.
57
+ * Show items without a grouping border.
62
58
  */
63
- separated?: boolean;
59
+ split?: boolean;
64
60
 
65
61
  /**
66
62
  * Make toggle disabled.
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { computed, inject, onMounted, ref, useId, toValue } from "vue";
2
+ import { computed, inject, onMounted, ref, useId } from "vue";
3
3
 
4
4
  import UButton from "../ui.button/UButton.vue";
5
5
 
@@ -9,7 +9,7 @@ import { getDefaults } from "../utils/ui.ts";
9
9
  import { TYPE_RADIO } from "../ui.button-toggle/constants.ts";
10
10
 
11
11
  import defaultConfig from "./config.ts";
12
- import { UToggleItem } from "./constants.ts";
12
+ import { COMPONENT_NAME } from "./constants.ts";
13
13
 
14
14
  import type { Props, ToggleInjectValues, ToggleContextType, Config } from "./types.ts";
15
15
 
@@ -18,7 +18,7 @@ type ButtonSize = "2xs" | "xs" | "sm" | "md" | "lg" | "xl";
18
18
  defineOptions({ inheritAttrs: false });
19
19
 
20
20
  const props = withDefaults(defineProps<Props>(), {
21
- ...getDefaults<Props, Config>(defaultConfig, UToggleItem),
21
+ ...getDefaults<Props, Config>(defaultConfig, COMPONENT_NAME),
22
22
  modelValue: "",
23
23
  label: "",
24
24
  });
@@ -34,26 +34,23 @@ const emit = defineEmits([
34
34
  /* eslint-disable prettier/prettier */
35
35
  const getToggleName = inject<() => string>("getToggleName", () => "toggle");
36
36
  const getToggleType = inject<() => string>("getToggleType", () =>
37
- getDefaults<ToggleInjectValues, Config>(defaultConfig, UToggleItem).type || TYPE_RADIO
37
+ getDefaults<ToggleInjectValues, Config>(defaultConfig, COMPONENT_NAME).type || TYPE_RADIO
38
38
  );
39
39
  const getToggleSize = inject<() => ButtonSize>("getToggleSize", () =>
40
- (getDefaults<ToggleInjectValues, Config>(defaultConfig, UToggleItem).size || "md") as ButtonSize
40
+ (getDefaults<ToggleInjectValues, Config>(defaultConfig, COMPONENT_NAME).size || "md") as ButtonSize
41
41
  );
42
42
  const getToggleRound = inject<() => boolean>("getToggleRound", () =>
43
- getDefaults<ToggleInjectValues, Config>(defaultConfig, UToggleItem).round || false
43
+ getDefaults<ToggleInjectValues, Config>(defaultConfig, COMPONENT_NAME).round || false
44
44
  );
45
45
  const getToggleBlock = inject<() => boolean>("getToggleBlock", () =>
46
- getDefaults<ToggleInjectValues, Config>(defaultConfig, UToggleItem).block || false
46
+ getDefaults<ToggleInjectValues, Config>(defaultConfig, COMPONENT_NAME).block || false
47
47
  );
48
48
  const getToggleSquare = inject<() => boolean>("getToggleSquare", () =>
49
- getDefaults<ToggleInjectValues, Config>(defaultConfig, UToggleItem).square || false
49
+ getDefaults<ToggleInjectValues, Config>(defaultConfig, COMPONENT_NAME).square || false
50
50
  );
51
- const getToggleVariant = inject<string>("getToggleVariant",
52
- getDefaults<ToggleInjectValues, Config>(defaultConfig, UToggleItem).variant || "secondary"
53
- );
54
- const getToggleSeparated = inject<boolean>("getToggleSeparated", true);
51
+ const getToggleSplit = inject<() => boolean>("getToggleSplit", () => true);
55
52
  const getToggleDisabled = inject<() => boolean>("getToggleDisabled", () =>
56
- props.disabled || getDefaults<ToggleInjectValues, Config>(defaultConfig, UToggleItem).disabled || false
53
+ props.disabled || getDefaults<ToggleInjectValues, Config>(defaultConfig, COMPONENT_NAME).disabled || false
57
54
  );
58
55
  /* eslint-enable prettier/prettier */
59
56
 
@@ -99,29 +96,30 @@ function onClickSetValue() {
99
96
  * Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
100
97
  */
101
98
  const mutatedProps = computed(() => ({
102
- variant: toValue(getToggleVariant),
103
- separated: toValue(getToggleSeparated),
104
99
  /* component state, not a props */
105
100
  selected: isSelected.value,
106
101
  }));
107
102
 
108
- const { toggleButtonAttrs, toggleInputAttrs } = useUI<Config>(defaultConfig, mutatedProps);
103
+ const { toggleButtonAttrs, toggleButtonActiveAttrs, toggleInputAttrs } = useUI<Config>(
104
+ defaultConfig,
105
+ mutatedProps,
106
+ );
109
107
  </script>
110
108
 
111
109
  <template>
112
110
  <UButton
111
+ :label="label"
113
112
  tabindex="0"
113
+ color="brand"
114
114
  :for="elementId"
115
- :no-ring="!getToggleSeparated"
116
- color="grayscale"
117
- variant="secondary"
118
- :label="label"
115
+ :filled="getToggleSplit()"
116
+ :no-ring="!getToggleSplit()"
119
117
  :size="getToggleSize()"
120
118
  :round="getToggleRound()"
121
119
  :block="getToggleBlock()"
122
120
  :square="getToggleSquare()"
123
- :disabled="getToggleDisabled()"
124
- v-bind="toggleButtonAttrs"
121
+ :disabled="getToggleDisabled() || disabled"
122
+ v-bind="isSelected ? toggleButtonActiveAttrs : toggleButtonAttrs"
125
123
  @click="onClickSetValue"
126
124
  >
127
125
  <template #left>
@@ -1,32 +1,15 @@
1
1
  export default /*tw*/ {
2
2
  toggleButton: {
3
- base: `
4
- {UButton}
5
- border-gray-300 font-normal
6
- hover:text-brand-600 hover:border-brand-600 hover:relative hover:z-10
7
- focus:text-brand-600 focus:border-brand-600 focus:relative focus:z-10 focus:ring-brand-700/15
8
- focus-within:ring-brand-700/15 active:text-brand-700 active:border-brand-700 active:relative
9
- active:z-10 disabled:z-0
10
- `,
11
- variants: {
12
- separated: {
13
- false: "rounded-none focus:ring-0",
14
- },
15
- selected: {
16
- false: "relative disabled:z-10",
17
- },
18
- variant: {
19
- thirdary: `
20
- !text-gray-900 !border-transparent bg-brand-600/10
21
- hover:bg-brand-600/15 focus:bg-brand-600/15 active:bg-brand-600/20
22
- `,
23
- },
3
+ base: "{UButton} font-normal",
4
+ defaults: {
5
+ variant: "thirdary",
6
+ },
7
+ },
8
+ toggleButtonActive: {
9
+ base: "{UButton} {>toggleButton}",
10
+ defaults: {
11
+ variant: "primary",
24
12
  },
25
- compoundVariants: [
26
- { selected: true, variant: "primary", class: "!text-white bg-brand-600 !border-brand-600" },
27
- { selected: true, variant: "secondary", class: "text-brand-600 border-brand-600 bg-brand-600/10" },
28
- { selected: true, variant: "thirdary", class: "!bg-brand-600/20" },
29
- ],
30
13
  },
31
14
  toggleInput: "p-0 m-0 size-0 invisible absolute",
32
15
  defaults: {
@@ -2,4 +2,4 @@
2
2
  This const is needed to prevent the issue in script setup:
3
3
  `defineProps` is referencing locally declared variables. (vue/valid-define-props)
4
4
  */
5
- export const UToggleItem = "UToggleItem";
5
+ export const COMPONENT_NAME = "UToggleItem";
@@ -7,7 +7,7 @@ import { getDefaults } from "../utils/ui.ts";
7
7
  import UIcon from "../ui.image-icon/UIcon.vue";
8
8
  import UDivider from "../ui.container-divider/UDivider.vue";
9
9
 
10
- import { UAccordion } from "./constants.ts";
10
+ import { COMPONENT_NAME } from "./constants.ts";
11
11
  import defaultConfig from "./config.ts";
12
12
 
13
13
  import type { Props, DividerSize, Config } from "./types.ts";
@@ -15,7 +15,7 @@ import type { Props, DividerSize, Config } from "./types.ts";
15
15
  defineOptions({ inheritAttrs: false });
16
16
 
17
17
  const props = withDefaults(defineProps<Props>(), {
18
- ...getDefaults<Props, Config>(defaultConfig, UAccordion),
18
+ ...getDefaults<Props, Config>(defaultConfig, COMPONENT_NAME),
19
19
  });
20
20
 
21
21
  const emit = defineEmits([
@@ -2,4 +2,4 @@
2
2
  This const is needed to prevent the issue in script setup:
3
3
  `defineProps` is referencing locally declared variables. (vue/valid-define-props)
4
4
  */
5
- export const UAccordion = "UAccordion";
5
+ export const COMPONENT_NAME = "UAccordion";
@@ -9,14 +9,14 @@ import UHeader from "../ui.text-header/UHeader.vue";
9
9
  import UDivider from "../ui.container-divider/UDivider.vue";
10
10
 
11
11
  import defaultConfig from "./config.ts";
12
- import { UCard } from "./constants.ts";
12
+ import { COMPONENT_NAME } from "./constants.ts";
13
13
 
14
14
  import type { Props, Config } from "./types.ts";
15
15
 
16
16
  defineOptions({ inheritAttrs: false });
17
17
 
18
18
  const props = withDefaults(defineProps<Props>(), {
19
- ...getDefaults<Props, Config>(defaultConfig, UCard),
19
+ ...getDefaults<Props, Config>(defaultConfig, COMPONENT_NAME),
20
20
  });
21
21
 
22
22
  const slots = useSlots();
@@ -2,4 +2,4 @@
2
2
  This const is needed to prevent the issue in script setup:
3
3
  `defineProps` is referencing locally declared variables. (vue/valid-define-props)
4
4
  */
5
- export const UCard = "UCard";
5
+ export const COMPONENT_NAME = "UCard";
@@ -2,7 +2,7 @@
2
2
  import useUI from "../composables/useUI.ts";
3
3
  import { getDefaults } from "../utils/ui.ts";
4
4
 
5
- import { UCol } from "./constants.ts";
5
+ import { COMPONENT_NAME } from "./constants.ts";
6
6
  import defaultConfig from "./config.ts";
7
7
 
8
8
  import type { Props, Config } from "./types.ts";
@@ -10,7 +10,7 @@ import type { Props, Config } from "./types.ts";
10
10
  defineOptions({ inheritAttrs: false });
11
11
 
12
12
  withDefaults(defineProps<Props>(), {
13
- ...getDefaults<Props, Config>(defaultConfig, UCol),
13
+ ...getDefaults<Props, Config>(defaultConfig, COMPONENT_NAME),
14
14
  });
15
15
 
16
16
  /**
@@ -2,4 +2,4 @@
2
2
  This const is needed to prevent the issue in script setup:
3
3
  `defineProps` is referencing locally declared variables. (vue/valid-define-props)
4
4
  */
5
- export const UCol = "UCol";
5
+ export const COMPONENT_NAME = "UCol";
@@ -4,7 +4,7 @@ import { computed } from "vue";
4
4
  import useUI from "../composables/useUI.ts";
5
5
  import { getDefaults } from "../utils/ui.ts";
6
6
 
7
- import { UDivider } from "./constants.ts";
7
+ import { COMPONENT_NAME } from "./constants.ts";
8
8
  import defaultConfig from "./config.ts";
9
9
 
10
10
  import type { Props, Config } from "./types.ts";
@@ -12,7 +12,7 @@ import type { Props, Config } from "./types.ts";
12
12
  defineOptions({ inheritAttrs: false });
13
13
 
14
14
  const props = withDefaults(defineProps<Props>(), {
15
- ...getDefaults<Props, Config>(defaultConfig, UDivider),
15
+ ...getDefaults<Props, Config>(defaultConfig, COMPONENT_NAME),
16
16
  label: "",
17
17
  });
18
18
 
@@ -2,4 +2,4 @@
2
2
  This const is needed to prevent the issue in script setup:
3
3
  `defineProps` is referencing locally declared variables. (vue/valid-define-props)
4
4
  */
5
- export const UDivider = "UDivider";
5
+ export const COMPONENT_NAME = "UDivider";
@@ -4,7 +4,7 @@ import { getDefaults } from "../utils/ui.ts";
4
4
  import UDivider from "../ui.container-divider/UDivider.vue";
5
5
  import UHeader from "../ui.text-header/UHeader.vue";
6
6
 
7
- import { UGroup } from "./constants.ts";
7
+ import { COMPONENT_NAME } from "./constants.ts";
8
8
  import defaultConfig from "./config.ts";
9
9
 
10
10
  import type { Props, Config } from "./types.ts";
@@ -12,7 +12,7 @@ import type { Props, Config } from "./types.ts";
12
12
  defineOptions({ inheritAttrs: false });
13
13
 
14
14
  withDefaults(defineProps<Props>(), {
15
- ...getDefaults<Props, Config>(defaultConfig, UGroup),
15
+ ...getDefaults<Props, Config>(defaultConfig, COMPONENT_NAME),
16
16
  });
17
17
 
18
18
  /**
@@ -2,4 +2,4 @@
2
2
  This const is needed to prevent the issue in script setup:
3
3
  `defineProps` is referencing locally declared variables. (vue/valid-define-props)
4
4
  */
5
- export const UGroup = "UGroup";
5
+ export const COMPONENT_NAME = "UGroup";
@@ -2,7 +2,7 @@
2
2
  import useUI from "../composables/useUI.ts";
3
3
  import { getDefaults } from "../utils/ui.ts";
4
4
 
5
- import { UGroups } from "./constants.ts";
5
+ import { COMPONENT_NAME } from "./constants.ts";
6
6
  import defaultConfig from "./config.ts";
7
7
 
8
8
  import type { Props, Config } from "./types.ts";
@@ -10,7 +10,7 @@ import type { Props, Config } from "./types.ts";
10
10
  defineOptions({ inheritAttrs: false });
11
11
 
12
12
  withDefaults(defineProps<Props>(), {
13
- ...getDefaults<Props, Config>(defaultConfig, UGroups),
13
+ ...getDefaults<Props, Config>(defaultConfig, COMPONENT_NAME),
14
14
  });
15
15
 
16
16
  /**
@@ -2,4 +2,4 @@
2
2
  This const is needed to prevent the issue in script setup:
3
3
  `defineProps` is referencing locally declared variables. (vue/valid-define-props)
4
4
  */
5
- export const UGroups = "UGroup";
5
+ export const COMPONENT_NAME = "UGroup";
@@ -11,14 +11,14 @@ import UHeader from "../ui.text-header/UHeader.vue";
11
11
  import UDivider from "../ui.container-divider/UDivider.vue";
12
12
 
13
13
  import defaultConfig from "./config.ts";
14
- import { UModal } from "./constants.ts";
14
+ import { COMPONENT_NAME } from "./constants.ts";
15
15
 
16
16
  import type { Props, Config } from "./types.ts";
17
17
 
18
18
  defineOptions({ inheritAttrs: false });
19
19
 
20
20
  const props = withDefaults(defineProps<Props>(), {
21
- ...getDefaults<Props, Config>(defaultConfig, UModal),
21
+ ...getDefaults<Props, Config>(defaultConfig, COMPONENT_NAME),
22
22
  modelValue: false,
23
23
  backTo: "",
24
24
  backLabel: "",
@@ -2,4 +2,4 @@
2
2
  This const is needed to prevent the issue in script setup:
3
3
  `defineProps` is referencing locally declared variables. (vue/valid-define-props)
4
4
  */
5
- export const UModal = "UModal";
5
+ export const COMPONENT_NAME = "UModal";
@@ -10,7 +10,7 @@ import UButton from "../ui.button/UButton.vue";
10
10
  import UModal from "../ui.container-modal/UModal.vue";
11
11
 
12
12
  import defaultConfig from "./config.ts";
13
- import { UModalConfirm } from "./constants.ts";
13
+ import { COMPONENT_NAME } from "./constants.ts";
14
14
  import { useLocale } from "../composables/useLocale.ts";
15
15
 
16
16
  import type { Props, Config } from "./types.ts";
@@ -18,7 +18,7 @@ import type { Props, Config } from "./types.ts";
18
18
  defineOptions({ inheritAttrs: false });
19
19
 
20
20
  const props = withDefaults(defineProps<Props>(), {
21
- ...getDefaults<Props, Config>(defaultConfig, UModalConfirm),
21
+ ...getDefaults<Props, Config>(defaultConfig, COMPONENT_NAME),
22
22
  modelValue: false,
23
23
  confirmLabel: "",
24
24
  });
@@ -48,7 +48,7 @@ const isShownModal = computed({
48
48
  set: (value) => emit("update:modelValue", value),
49
49
  });
50
50
 
51
- const i18nGlobal = tm(UModalConfirm);
51
+ const i18nGlobal = tm(COMPONENT_NAME);
52
52
  const currentLocale = computed(() =>
53
53
  merge({}, defaultConfig.i18n, i18nGlobal, props?.config?.i18n),
54
54
  );
@@ -2,4 +2,4 @@
2
2
  This const is needed to prevent the issue in script setup:
3
3
  `defineProps` is referencing locally declared variables. (vue/valid-define-props)
4
4
  */
5
- export const UModalConfirm = "UModalConfirm";
5
+ export const COMPONENT_NAME = "UModalConfirm";
@@ -11,7 +11,7 @@ import UIcon from "../ui.image-icon/UIcon.vue";
11
11
  import UHeader from "../ui.text-header/UHeader.vue";
12
12
 
13
13
  import defaultConfig from "./config.ts";
14
- import { UPage } from "./constants.ts";
14
+ import { COMPONENT_NAME } from "./constants.ts";
15
15
 
16
16
  import type { Props, Config } from "./types.ts";
17
17
 
@@ -20,7 +20,7 @@ const slots = useSlots();
20
20
  defineOptions({ inheritAttrs: false });
21
21
 
22
22
  const props = withDefaults(defineProps<Props>(), {
23
- ...getDefaults<Props, Config>(defaultConfig, UPage),
23
+ ...getDefaults<Props, Config>(defaultConfig, COMPONENT_NAME),
24
24
  backTo: "",
25
25
  backLabel: "",
26
26
  });
@@ -2,4 +2,4 @@
2
2
  This const is needed to prevent the issue in script setup:
3
3
  `defineProps` is referencing locally declared variables. (vue/valid-define-props)
4
4
  */
5
- export const UPage = "UPage";
5
+ export const COMPONENT_NAME = "UPage";
@@ -2,7 +2,7 @@
2
2
  import useUI from "../composables/useUI.ts";
3
3
  import { getDefaults } from "../utils/ui.ts";
4
4
 
5
- import { URow } from "./constants.ts";
5
+ import { COMPONENT_NAME } from "./constants.ts";
6
6
  import defaultConfig from "./config.ts";
7
7
 
8
8
  import type { Props, Config } from "./types.ts";
@@ -10,7 +10,7 @@ import type { Props, Config } from "./types.ts";
10
10
  defineOptions({ inheritAttrs: false });
11
11
 
12
12
  withDefaults(defineProps<Props>(), {
13
- ...getDefaults<Props, Config>(defaultConfig, URow),
13
+ ...getDefaults<Props, Config>(defaultConfig, COMPONENT_NAME),
14
14
  });
15
15
 
16
16
  /**
@@ -2,4 +2,4 @@
2
2
  This const is needed to prevent the issue in script setup:
3
3
  `defineProps` is referencing locally declared variables. (vue/valid-define-props)
4
4
  */
5
- export const URow = "URow";
5
+ export const COMPONENT_NAME = "URow";