vueless 1.2.15-beta.2 → 1.2.15-beta.4

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 (111) hide show
  1. package/bin/commands/copy.js +1 -1
  2. package/composables/tests/useUI.test.ts +1 -1
  3. package/composables/useBreakpoint.ts +1 -1
  4. package/composables/useUI.ts +1 -5
  5. package/constants.d.ts +1 -1
  6. package/constants.js +1 -1
  7. package/index.d.ts +3 -3
  8. package/index.ts +3 -3
  9. package/locales/en.json +1 -1
  10. package/package.json +1 -1
  11. package/types.ts +2 -2
  12. package/ui.boilerplate/UBoilerplate.vue +1 -1
  13. package/ui.button/UButton.vue +1 -1
  14. package/ui.button-link/ULink.vue +1 -1
  15. package/ui.button-toggle/UToggle.vue +1 -1
  16. package/ui.container-accordion/UAccordion.vue +1 -1
  17. package/ui.container-accordion-item/UAccordionItem.vue +2 -6
  18. package/ui.container-accordion-item/tests/UAccordionItem.test.ts +5 -5
  19. package/ui.container-card/UCard.vue +1 -1
  20. package/ui.container-col/UCol.vue +1 -1
  21. package/ui.container-divider/UDivider.vue +1 -1
  22. package/ui.container-drawer/UDrawer.vue +1 -1
  23. package/ui.container-group/UGroup.vue +1 -1
  24. package/ui.container-groups/UGroups.vue +1 -1
  25. package/ui.container-modal/UModal.vue +1 -1
  26. package/ui.container-modal-confirm/UModalConfirm.vue +1 -1
  27. package/ui.container-page/UPage.vue +1 -1
  28. package/ui.container-page/config.ts +3 -3
  29. package/ui.container-row/URow.vue +1 -1
  30. package/ui.data-list/UDataList.vue +1 -1
  31. package/ui.data-list/config.ts +1 -1
  32. package/ui.data-table/UTable.vue +1 -1
  33. package/ui.data-table/UTableRow.vue +1 -1
  34. package/ui.data-table/config.ts +2 -0
  35. package/ui.data-table/storybook/stories.ts +3 -1
  36. package/ui.dropdown-badge/UDropdownBadge.vue +1 -1
  37. package/ui.dropdown-button/UDropdownButton.vue +1 -1
  38. package/ui.dropdown-link/UDropdownLink.vue +1 -1
  39. package/ui.form-calendar/UCalendar.vue +5 -1
  40. package/ui.form-calendar/UCalendarDayView.vue +1 -1
  41. package/ui.form-calendar/UCalendarMonthView.vue +1 -1
  42. package/ui.form-calendar/UCalendarYearView.vue +1 -1
  43. package/ui.form-calendar/config.ts +5 -0
  44. package/ui.form-checkbox/UCheckbox.vue +24 -5
  45. package/ui.form-checkbox/config.ts +4 -0
  46. package/ui.form-checkbox/tests/UCheckbox.test.ts +1 -1
  47. package/ui.form-checkbox-group/UCheckboxGroup.vue +1 -1
  48. package/ui.form-checkbox-multi-state/UCheckboxMultiState.vue +1 -1
  49. package/{ui.form-color-picker/UColorPicker.vue → ui.form-color-toggle/UColorToggle.vue} +1 -1
  50. package/{ui.form-color-picker → ui.form-color-toggle}/constants.ts +1 -1
  51. package/{ui.form-color-picker → ui.form-color-toggle}/storybook/stories.ts +14 -14
  52. package/{ui.form-color-picker/tests/UColorPicker.test.ts → ui.form-color-toggle/tests/UColorToggle.test.ts} +8 -8
  53. package/ui.form-date-picker/UDatePicker.vue +1 -1
  54. package/ui.form-date-picker/config.ts +5 -0
  55. package/ui.form-date-picker-range/UDatePickerRange.vue +1 -1
  56. package/ui.form-input/UInput.vue +10 -4
  57. package/ui.form-input-counter/UInputCounter.vue +10 -1
  58. package/ui.form-input-counter/config.ts +5 -0
  59. package/ui.form-input-file/UInputFile.vue +1 -1
  60. package/ui.form-input-number/UInputNumber.vue +1 -1
  61. package/ui.form-input-password/UInputPassword.vue +12 -13
  62. package/ui.form-input-password/tests/UInputPassword.test.ts +2 -2
  63. package/ui.form-input-rating/UInputRating.vue +1 -1
  64. package/ui.form-input-search/UInputSearch.vue +1 -1
  65. package/ui.form-label/ULabel.vue +6 -2
  66. package/ui.form-label/types.ts +5 -0
  67. package/ui.form-listbox/UListbox.vue +38 -12
  68. package/ui.form-radio/URadio.vue +1 -1
  69. package/ui.form-radio-group/URadioGroup.vue +1 -1
  70. package/ui.form-select/USelect.vue +38 -3
  71. package/ui.form-select/tests/USelect.test.ts +3 -1
  72. package/ui.form-switch/USwitch.vue +21 -8
  73. package/ui.form-switch/config.ts +2 -0
  74. package/ui.form-switch/tests/USwitch.test.ts +6 -4
  75. package/ui.form-textarea/UTextarea.vue +16 -6
  76. package/ui.form-textarea/tests/UTextarea.test.ts +1 -1
  77. package/ui.image-avatar/UAvatar.vue +1 -1
  78. package/ui.image-icon/UIcon.vue +1 -1
  79. package/ui.loader/ULoader.vue +1 -1
  80. package/ui.loader-overlay/ULoaderOverlay.vue +1 -1
  81. package/ui.loader-progress/ULoaderProgress.vue +1 -1
  82. package/ui.navigation-breadcrumbs/UBreadcrumbs.vue +1 -1
  83. package/ui.navigation-pagination/UPagination.vue +15 -1
  84. package/ui.navigation-pagination/config.ts +9 -0
  85. package/ui.navigation-progress/UProgress.vue +1 -1
  86. package/ui.navigation-progress/UStepperProgress.vue +1 -1
  87. package/ui.navigation-tab/UTab.vue +1 -1
  88. package/ui.navigation-tabs/UTabs.vue +1 -1
  89. package/ui.other-chip/UChip.vue +1 -1
  90. package/ui.other-dot/UDot.vue +1 -1
  91. package/ui.other-theme-color-toggle/UThemeColorToggle.vue +4 -4
  92. package/ui.other-theme-color-toggle/config.ts +2 -2
  93. package/ui.other-theme-color-toggle/tests/UThemeColorToggle.test.ts +10 -10
  94. package/ui.skeleton/USkeleton.vue +1 -1
  95. package/ui.skeleton-choice/USkeletonChoice.vue +1 -1
  96. package/ui.skeleton-input/USkeletonInput.vue +1 -1
  97. package/ui.skeleton-text/USkeletonText.vue +1 -1
  98. package/ui.text-alert/UAlert.vue +9 -1
  99. package/ui.text-alert/config.ts +4 -0
  100. package/ui.text-badge/UBadge.vue +1 -1
  101. package/ui.text-block/UText.vue +1 -1
  102. package/ui.text-block/config.ts +5 -4
  103. package/ui.text-empty/UEmpty.vue +1 -1
  104. package/ui.text-file/UFile.vue +1 -1
  105. package/ui.text-files/UFiles.vue +1 -1
  106. package/ui.text-header/UHeader.vue +1 -1
  107. package/ui.text-notify/UNotify.vue +1 -1
  108. package/ui.text-number/UNumber.vue +1 -1
  109. /package/{ui.form-color-picker → ui.form-color-toggle}/config.ts +0 -0
  110. /package/{ui.form-color-picker → ui.form-color-toggle}/storybook/docs.mdx +0 -0
  111. /package/{ui.form-color-picker → ui.form-color-toggle}/types.ts +0 -0
@@ -1,12 +1,12 @@
1
1
  <script setup lang="ts">
2
2
  import { ref, computed, useId, useTemplateRef } from "vue";
3
3
 
4
- import useUI from "../composables/useUI";
4
+ import { useUI } from "../composables/useUI";
5
5
  import { getDefaults } from "../utils/ui";
6
6
  import { setTheme } from "../utils/theme";
7
7
 
8
8
  import UDivider from "../ui.container-divider/UDivider.vue";
9
- import UColorPicker from "../ui.form-color-picker/UColorPicker.vue";
9
+ import UColorToggle from "../ui.form-color-toggle/UColorToggle.vue";
10
10
 
11
11
  import { COMPONENT_NAME } from "./constants";
12
12
  import defaultConfig from "./config";
@@ -86,7 +86,7 @@ const {
86
86
 
87
87
  <template>
88
88
  <div :id="elementId" ref="list" v-bind="listAttrs" :data-test="getDataTest()">
89
- <UColorPicker
89
+ <UColorToggle
90
90
  v-model="selectedPrimaryColor"
91
91
  :size="size"
92
92
  :colors="primaryColors"
@@ -100,7 +100,7 @@ const {
100
100
  v-bind="colorDividerAttrs"
101
101
  />
102
102
 
103
- <UColorPicker
103
+ <UColorToggle
104
104
  v-model="selectedNeutralColor"
105
105
  :size="size"
106
106
  :colors="neutralColors"
@@ -1,7 +1,7 @@
1
1
  export default /*tw*/ {
2
2
  list: "flex flex-wrap gap-0.5",
3
- primaryColorPicker: "{UColorPicker}",
4
- grayColorPicker: "{UColorPicker}",
3
+ primaryColorPicker: "{UColorToggle}",
4
+ grayColorPicker: "{UColorToggle}",
5
5
  colorDivider: "{UDivider} py-2",
6
6
  defaults: {
7
7
  size: "md",
@@ -2,7 +2,7 @@ import { mount } from "@vue/test-utils";
2
2
  import { describe, it, expect, vi } from "vitest";
3
3
 
4
4
  import UThemeColorToggle from "../UThemeColorToggle.vue";
5
- import UColorPicker from "../../ui.form-color-picker/UColorPicker.vue";
5
+ import UColorToggle from "../../ui.form-color-toggle/UColorToggle.vue";
6
6
  import UDivider from "../../ui.container-divider/UDivider.vue";
7
7
 
8
8
  import type { Props } from "../types";
@@ -29,7 +29,7 @@ describe("UThemeColorToggle.vue", () => {
29
29
  },
30
30
  });
31
31
 
32
- const colorPickers = component.findAllComponents(UColorPicker);
32
+ const colorPickers = component.findAllComponents(UColorToggle);
33
33
 
34
34
  expect(colorPickers.length).toBe(2);
35
35
 
@@ -50,7 +50,7 @@ describe("UThemeColorToggle.vue", () => {
50
50
  },
51
51
  });
52
52
 
53
- const primaryColorPicker = component.findAllComponents(UColorPicker)[0];
53
+ const primaryColorPicker = component.findAllComponents(UColorToggle)[0];
54
54
 
55
55
  expect(primaryColorPicker.props("modelValue")).toBe(primary);
56
56
  });
@@ -66,7 +66,7 @@ describe("UThemeColorToggle.vue", () => {
66
66
  },
67
67
  });
68
68
 
69
- const neutralColorPicker = component.findAllComponents(UColorPicker)[1];
69
+ const neutralColorPicker = component.findAllComponents(UColorToggle)[1];
70
70
 
71
71
  expect(neutralColorPicker.props("modelValue")).toBe(neutral);
72
72
  });
@@ -81,7 +81,7 @@ describe("UThemeColorToggle.vue", () => {
81
81
  },
82
82
  });
83
83
 
84
- const primaryColorPicker = component.findAllComponents(UColorPicker)[0];
84
+ const primaryColorPicker = component.findAllComponents(UColorToggle)[0];
85
85
 
86
86
  expect(primaryColorPicker.props("colors")).toEqual(primaryColors);
87
87
  });
@@ -96,7 +96,7 @@ describe("UThemeColorToggle.vue", () => {
96
96
  },
97
97
  });
98
98
 
99
- const neutralColorPicker = component.findAllComponents(UColorPicker)[1];
99
+ const neutralColorPicker = component.findAllComponents(UColorToggle)[1];
100
100
 
101
101
  expect(neutralColorPicker.props("colors")).toEqual(neutralColors);
102
102
  });
@@ -112,7 +112,7 @@ describe("UThemeColorToggle.vue", () => {
112
112
  },
113
113
  });
114
114
 
115
- const primaryColorPicker = component.findAllComponents(UColorPicker)[0];
115
+ const primaryColorPicker = component.findAllComponents(UColorToggle)[0];
116
116
 
117
117
  expect(primaryColorPicker.props("labels")).toEqual(primaryLabels);
118
118
  });
@@ -128,7 +128,7 @@ describe("UThemeColorToggle.vue", () => {
128
128
  },
129
129
  });
130
130
 
131
- const neutralColorPicker = component.findAllComponents(UColorPicker)[1];
131
+ const neutralColorPicker = component.findAllComponents(UColorToggle)[1];
132
132
 
133
133
  expect(neutralColorPicker.props("labels")).toEqual(neutralLabels);
134
134
  });
@@ -207,7 +207,7 @@ describe("UThemeColorToggle.vue", () => {
207
207
  },
208
208
  });
209
209
 
210
- const primaryColorPicker = component.findAllComponents(UColorPicker)[0];
210
+ const primaryColorPicker = component.findAllComponents(UColorToggle)[0];
211
211
 
212
212
  primaryColorPicker.vm.$emit("update:modelValue", newColor);
213
213
 
@@ -226,7 +226,7 @@ describe("UThemeColorToggle.vue", () => {
226
226
  },
227
227
  });
228
228
 
229
- const neutralColorPicker = component.findAllComponents(UColorPicker)[1];
229
+ const neutralColorPicker = component.findAllComponents(UColorToggle)[1];
230
230
 
231
231
  neutralColorPicker.vm.$emit("update:modelValue", newColor);
232
232
 
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from "vue";
3
- import useUI from "../composables/useUI";
3
+ import { useUI } from "../composables/useUI";
4
4
  import { getDefaults } from "../utils/ui";
5
5
 
6
6
  import defaultConfig from "./config";
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from "vue";
3
- import useUI from "../composables/useUI";
3
+ import { useUI } from "../composables/useUI";
4
4
  import { getDefaults } from "../utils/ui";
5
5
 
6
6
  import defaultConfig from "./config";
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from "vue";
3
- import useUI from "../composables/useUI";
3
+ import { useUI } from "../composables/useUI";
4
4
  import { getDefaults } from "../utils/ui";
5
5
 
6
6
  import defaultConfig from "./config";
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed } from "vue";
3
- import useUI from "../composables/useUI";
3
+ import { useUI } from "../composables/useUI";
4
4
  import { getDefaults } from "../utils/ui";
5
5
 
6
6
  import defaultConfig from "./config";
@@ -1,9 +1,10 @@
1
1
  <script setup lang="ts">
2
2
  import { onMounted, ref, computed, useTemplateRef } from "vue";
3
3
 
4
- import useUI from "../composables/useUI";
4
+ import { useUI } from "../composables/useUI";
5
5
  import { getDefaults } from "../utils/ui";
6
6
  import { hasSlotContent } from "../utils/helper";
7
+ import { useComponentLocaleMessages } from "../composables/useComponentLocaleMassages";
7
8
 
8
9
  import UIcon from "../ui.image-icon/UIcon.vue";
9
10
  import UButton from "../ui.button/UButton.vue";
@@ -27,6 +28,12 @@ const emit = defineEmits([
27
28
  "hide",
28
29
  ]);
29
30
 
31
+ const { localeMessages } = useComponentLocaleMessages<typeof defaultConfig.i18n>(
32
+ COMPONENT_NAME,
33
+ defaultConfig.i18n,
34
+ props?.config?.i18n,
35
+ );
36
+
30
37
  const wrapperRef = useTemplateRef<HTMLDivElement>("wrapper");
31
38
 
32
39
  const isShownAlert = ref(true);
@@ -126,6 +133,7 @@ const {
126
133
  size="xs"
127
134
  :color="closeButtonColor"
128
135
  variant="ghost"
136
+ :aria-label="localeMessages.closeAlert"
129
137
  v-bind="closeButtonAttrs"
130
138
  :data-test="getDataTest('button')"
131
139
  @click="onClickClose"
@@ -41,6 +41,10 @@ export default /*tw*/ {
41
41
  },
42
42
  closeIcon: "{>icon}",
43
43
  alertIcon: "{>icon}",
44
+ /* These are used for a11y. */
45
+ i18n: {
46
+ closeAlert: "Close alert",
47
+ },
44
48
  defaults: {
45
49
  variant: "subtle",
46
50
  color: "primary",
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { useTemplateRef, computed, useId, useSlots } from "vue";
3
3
 
4
- import useUI from "../composables/useUI";
4
+ import { useUI } from "../composables/useUI";
5
5
  import { hasSlotContent } from "../utils/helper";
6
6
  import { getDefaults } from "../utils/ui";
7
7
 
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { useTemplateRef } from "vue";
3
3
 
4
- import useUI from "../composables/useUI";
4
+ import { useUI } from "../composables/useUI";
5
5
  import { getDefaults } from "../utils/ui";
6
6
 
7
7
  import { COMPONENT_NAME } from "./constants";
@@ -1,6 +1,7 @@
1
1
  export default /*tw*/ {
2
2
  wrapper: {
3
3
  base: `
4
+ flex flex-col
4
5
  font-normal leading-normal
5
6
  [&_b]:font-bold [&_i]:italic [&_p]:font-normal
6
7
  [&_a:not([class])]:underline [&_a:not([class])]:underline-offset-4
@@ -22,10 +23,10 @@ export default /*tw*/ {
22
23
  inherit: "text-inherit",
23
24
  },
24
25
  size: {
25
- xs: "text-tiny space-y-1",
26
- sm: "text-small space-y-2",
27
- md: "text-medium space-y-3",
28
- lg: "text-large space-y-4",
26
+ xs: "text-tiny gap-1",
27
+ sm: "text-small gap-2",
28
+ md: "text-medium gap-3",
29
+ lg: "text-large gap-4",
29
30
  },
30
31
  align: {
31
32
  left: "text-left",
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, useTemplateRef } from "vue";
3
3
 
4
- import useUI from "../composables/useUI";
4
+ import { useUI } from "../composables/useUI";
5
5
  import { getDefaults } from "../utils/ui";
6
6
 
7
7
  import UIcon from "../ui.image-icon/UIcon.vue";
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { ref, computed, useId, useTemplateRef } from "vue";
3
3
 
4
- import useUI from "../composables/useUI";
4
+ import { useUI } from "../composables/useUI";
5
5
  import { getDefaults } from "../utils/ui";
6
6
 
7
7
  import ULink from "../ui.button-link/ULink.vue";
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, useTemplateRef } from "vue";
3
3
 
4
- import useUI from "../composables/useUI";
4
+ import { useUI } from "../composables/useUI";
5
5
  import { getDefaults } from "../utils/ui";
6
6
 
7
7
  import UFile from "../ui.text-file/UFile.vue";
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { useTemplateRef } from "vue";
3
3
 
4
- import useUI from "../composables/useUI";
4
+ import { useUI } from "../composables/useUI";
5
5
  import { getDefaults } from "../utils/ui";
6
6
 
7
7
  import { COMPONENT_NAME } from "./constants";
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { onBeforeUnmount, onMounted, ref, useTemplateRef } from "vue";
3
3
 
4
- import useUI from "../composables/useUI";
4
+ import { useUI } from "../composables/useUI";
5
5
  import { getDefaults, vuelessConfig } from "../utils/ui";
6
6
  import { useComponentLocaleMessages } from "../composables/useComponentLocaleMassages";
7
7
 
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, useTemplateRef } from "vue";
3
3
 
4
- import useUI from "../composables/useUI";
4
+ import { useUI } from "../composables/useUI";
5
5
  import { getDefaults } from "../utils/ui";
6
6
 
7
7
  import { COMPONENT_NAME } from "./constants";