vueless 0.0.702 → 0.0.704

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 (76) hide show
  1. package/bin/constants.js +2 -2
  2. package/constants.js +2 -2
  3. package/package.json +1 -1
  4. package/ui.button/config.ts +8 -26
  5. package/ui.button/storybook/stories.ts +0 -3
  6. package/ui.button/types.ts +0 -5
  7. package/ui.button-link/config.ts +3 -9
  8. package/ui.button-link/storybook/stories.ts +0 -3
  9. package/ui.button-link/types.ts +0 -5
  10. package/ui.button-toggle/UToggle.vue +0 -1
  11. package/ui.button-toggle/config.ts +1 -6
  12. package/ui.button-toggle/types.ts +0 -5
  13. package/ui.button-toggle-item/UToggleItem.vue +0 -2
  14. package/ui.button-toggle-item/config.ts +1 -1
  15. package/ui.container-modal/UModal.vue +0 -1
  16. package/ui.container-page/UPage.vue +0 -1
  17. package/ui.dropdown-badge/config.ts +4 -5
  18. package/ui.dropdown-badge/storybook/stories.ts +0 -1
  19. package/ui.dropdown-button/config.ts +4 -5
  20. package/ui.dropdown-button/storybook/stories.ts +0 -1
  21. package/ui.dropdown-link/UDropdownLink.vue +0 -1
  22. package/ui.dropdown-link/config.ts +3 -7
  23. package/ui.dropdown-link/storybook/stories.ts +0 -3
  24. package/ui.dropdown-link/types.ts +0 -5
  25. package/ui.dropdown-list/config.ts +7 -3
  26. package/ui.dropdown-list/storybook/stories.ts +1 -0
  27. package/ui.form-calendar/UCalendar.vue +0 -4
  28. package/ui.form-calendar/UCalendarDayView.vue +0 -13
  29. package/ui.form-calendar/UCalendarMonthView.vue +0 -12
  30. package/ui.form-calendar/UCalendarYearView.vue +0 -12
  31. package/ui.form-checkbox/config.ts +9 -6
  32. package/ui.form-color-picker/UColorPicker.vue +0 -1
  33. package/ui.form-date-picker-range/UDatePickerRange.vue +0 -3
  34. package/ui.form-date-picker-range/UDatePickerRangePeriodMenu.vue +0 -12
  35. package/ui.form-date-picker-range/config.ts +7 -20
  36. package/ui.form-input/UInput.vue +2 -8
  37. package/ui.form-input/config.ts +6 -16
  38. package/ui.form-input/storybook/stories.ts +36 -22
  39. package/ui.form-input/types.ts +1 -1
  40. package/ui.form-input-file/UInputFile.vue +1 -2
  41. package/ui.form-input-file/config.ts +4 -7
  42. package/ui.form-input-money/UInputMoney.vue +5 -4
  43. package/ui.form-input-money/storybook/stories.ts +126 -49
  44. package/ui.form-input-number/storybook/stories.ts +43 -21
  45. package/ui.form-input-rating/UInputRating.vue +1 -0
  46. package/ui.form-input-rating/config.ts +5 -0
  47. package/ui.form-input-rating/storybook/stories.ts +62 -19
  48. package/ui.form-input-rating/types.ts +12 -7
  49. package/ui.form-input-search/UInputSearch.vue +1 -1
  50. package/ui.form-input-search/config.ts +8 -11
  51. package/ui.form-input-search/storybook/stories.ts +110 -31
  52. package/ui.form-input-search/types.ts +6 -6
  53. package/ui.form-label/config.ts +3 -3
  54. package/ui.form-radio/URadio.vue +5 -2
  55. package/ui.form-radio/config.ts +12 -6
  56. package/ui.form-radio-group/URadioGroup.vue +1 -0
  57. package/ui.form-select/config.ts +4 -7
  58. package/ui.form-switch/USwitch.vue +8 -2
  59. package/ui.form-switch/config.ts +11 -8
  60. package/ui.form-switch/types.ts +0 -1
  61. package/ui.form-textarea/config.ts +8 -14
  62. package/ui.navigation-breadcrumbs/UBreadcrumbs.vue +0 -1
  63. package/ui.navigation-breadcrumbs/types.ts +1 -1
  64. package/ui.navigation-pagination/UPagination.vue +22 -10
  65. package/ui.navigation-pagination/config.ts +15 -17
  66. package/ui.navigation-tab/UTab.vue +58 -20
  67. package/ui.navigation-tab/config.ts +14 -14
  68. package/ui.navigation-tab/storybook/stories.ts +1 -1
  69. package/ui.navigation-tab/types.ts +15 -4
  70. package/ui.navigation-tabs/UTabs.vue +6 -4
  71. package/ui.navigation-tabs/config.ts +4 -15
  72. package/ui.navigation-tabs/storybook/stories.ts +0 -3
  73. package/ui.navigation-tabs/types.ts +8 -3
  74. package/ui.text-alert/UAlert.vue +0 -1
  75. package/ui.text-badge/config.ts +3 -6
  76. package/ui.text-file/UFile.vue +2 -9
@@ -1,26 +1,24 @@
1
1
  export default /*tw*/ {
2
2
  pagination: "flex",
3
3
  paginationButton: {
4
- base: "font-normal",
4
+ base: "{UButton} font-normal",
5
5
  variants: {
6
6
  size: {
7
- lg: "!text-base",
7
+ sm: "text-xs",
8
+ md: "text-sm",
9
+ lg: "text-base",
8
10
  },
9
11
  },
10
12
  defaults: {
11
- size: {
12
- sm: "xs",
13
- md: "sm",
14
- lg: "md",
15
- },
13
+ size: "xs",
16
14
  },
17
15
  },
18
- firstButton: "{UButton} {>paginationButton}",
19
- lastButton: "{UButton} {>paginationButton}",
20
- prevButton: "{UButton} {>paginationButton}",
21
- nextButton: "{UButton} {>paginationButton}",
22
- inactiveButton: "{UButton} {>paginationButton}",
23
- activeButton: "{UButton} {>paginationButton}",
16
+ firstButton: "{>paginationButton}",
17
+ lastButton: "{>paginationButton}",
18
+ prevButton: "{>paginationButton}",
19
+ nextButton: "{>paginationButton}",
20
+ inactiveButton: "{>paginationButton}",
21
+ activeButton: "{>paginationButton}",
24
22
  paginationIcon: {
25
23
  base: "{UIcon}",
26
24
  defaults: {
@@ -31,10 +29,10 @@ export default /*tw*/ {
31
29
  },
32
30
  },
33
31
  },
34
- lastIcon: "{UIcon} {>paginationIcon}",
35
- firstIcon: "{UIcon} {>paginationIcon}",
36
- prevIcon: "{UIcon} {>paginationIcon}",
37
- nextIcon: "{UIcon} {>paginationIcon}",
32
+ lastIcon: "{>paginationIcon}",
33
+ firstIcon: "{>paginationIcon}",
34
+ prevIcon: "{>paginationIcon}",
35
+ nextIcon: "{>paginationIcon}",
38
36
  defaults: {
39
37
  variant: "primary",
40
38
  size: "md",
@@ -3,30 +3,30 @@ import { computed, inject, toValue } from "vue";
3
3
 
4
4
  import useUI from "../composables/useUI.ts";
5
5
  import { getDefaults } from "../utils/ui.ts";
6
+ import UButton from "../ui.button/UButton.vue";
6
7
 
7
8
  import { COMPONENT_NAME } from "./constants.ts";
8
9
  import defaultConfig from "./config.ts";
9
10
 
10
- import type { Props, UTabSize, Config } from "./types.ts";
11
- import type { SetUTabsSelectedItem } from "../ui.navigation-tabs/types.ts";
11
+ import type { Props, Config } from "./types.ts";
12
+ import type { Props as UTabsProps, SetUTabsSelectedItem } from "../ui.navigation-tabs/types.ts";
12
13
 
13
14
  defineOptions({ inheritAttrs: false });
14
15
 
15
- const setUTabsSelectedItem = inject<SetUTabsSelectedItem | null>("setUTabsSelectedItem", null);
16
- const getUTabsSelectedItem = inject("getUTabsSelectedItem", null);
17
- const getUTabsSize = inject("getUTabsSize", null);
16
+ const setUTabsSelectedItem = inject<SetUTabsSelectedItem>("setUTabsSelectedItem");
17
+ const getUTabsSelectedItem = inject("getUTabsSelectedItem");
18
+ const getUTabsSquare = inject<UTabsProps["square"]>("getUTabsSquare");
19
+ const getUTabsBlock = inject<UTabsProps["block"]>("getUTabsBlock");
20
+ const getUTabsSize = inject<UTabsProps["size"]>("getUTabsSize", "md");
18
21
 
19
22
  const props = withDefaults(defineProps<Props>(), {
20
23
  ...getDefaults<Props, Config>(defaultConfig, COMPONENT_NAME),
21
24
  });
22
25
 
23
- const selected = computed(() => {
24
- return toValue(getUTabsSelectedItem) === props.value && !props.disabled;
25
- });
26
-
27
- const size = computed(() => {
28
- return toValue(getUTabsSize) || getDefaults<UTabSize, Config>(defaultConfig, COMPONENT_NAME).size;
29
- });
26
+ const size = computed(() => toValue(getUTabsSize));
27
+ const block = computed(() => toValue(getUTabsBlock));
28
+ const square = computed(() => toValue(getUTabsSquare));
29
+ const isActive = computed(() => toValue(getUTabsSelectedItem) === props.value && !props.disabled);
30
30
 
31
31
  async function onClickSetValue() {
32
32
  if (!props.disabled && setUTabsSelectedItem) {
@@ -40,18 +40,56 @@ async function onClickSetValue() {
40
40
  */
41
41
  const mutatedProps = computed(() => ({
42
42
  size: size.value,
43
+ block: block.value,
44
+ square: square.value,
43
45
  /* component state, not a props */
44
- selected: selected.value,
46
+ active: isActive.value,
45
47
  }));
46
48
 
47
- const { tabAttrs } = useUI<Config>(defaultConfig, mutatedProps);
49
+ const { tabButtonAttrs, tabButtonActiveAttrs } = useUI<Config>(defaultConfig, mutatedProps);
48
50
  </script>
49
51
 
50
52
  <template>
51
- <div v-bind="tabAttrs" :data-test="dataTest" @click="onClickSetValue">
52
- <!-- @slot Use it to add something instead of the label. -->
53
- <slot>
54
- {{ label }}
55
- </slot>
56
- </div>
53
+ <UButton
54
+ variant="thirdary"
55
+ :size="size"
56
+ :label="label"
57
+ :icon="icon"
58
+ :left-icon="leftIcon"
59
+ :right-icon="rightIcon"
60
+ :block="block"
61
+ :square="square"
62
+ :disabled="disabled"
63
+ v-bind="isActive ? tabButtonActiveAttrs : tabButtonAttrs"
64
+ :data-test="dataTest"
65
+ @click="onClickSetValue"
66
+ >
67
+ <template #left="{ iconName }">
68
+ <!--
69
+ @slot Use it to add something before the label.
70
+ @binding {boolean} active
71
+ @binding {string} icon-name
72
+ -->
73
+ <slot name="left" :active="isActive" :icon-name="iconName" />
74
+ </template>
75
+
76
+ <template #default="{ iconName, label }">
77
+ <!--
78
+ @slot Use it to add something instead of the label.
79
+ @binding {string} label
80
+ @binding {boolean} active
81
+ @binding {string} icon-name
82
+ -->
83
+ <slot :label="label" :active="isActive" :icon-name="iconName" />
84
+ </template>
85
+
86
+ <template #right="{ iconName }">
87
+ <!--
88
+ @slot Use it to add something after the label.
89
+ @binding {boolean} active
90
+ @binding {string} icon-name
91
+ -->
92
+ <slot name="right" :active="isActive" :icon-name="iconName" />
93
+ </template>
94
+ </UButton>
57
95
  </template>
@@ -1,18 +1,18 @@
1
1
  export default /*tw*/ {
2
- tab: {
3
- base: "w-max text-center cursor-pointer -mb-px",
4
- variants: {
5
- size: {
6
- sm: "text-xs pb-1",
7
- md: "text-sm pb-2",
8
- lg: "text-base pb-3",
9
- },
10
- disabled: {
11
- true: "text-gray-400 cursor-not-allowed",
12
- },
13
- selected: {
14
- true: "border-b-2 text-brand-700 border-brand-700",
15
- },
2
+ tabButton: {
3
+ base: `
4
+ {UButton} -mb-px rounded-none border-transparent
5
+ hover:bg-transparent dark:hover:bg-transparent
6
+ active:bg-transparent dark:active:bg-transparent
7
+ `,
8
+ defaults: {
9
+ color: "gray",
10
+ },
11
+ },
12
+ tabButtonActive: {
13
+ base: "{>tabButton} border-b-brand-600",
14
+ defaults: {
15
+ color: "brand",
16
16
  },
17
17
  },
18
18
  defaults: {
@@ -57,7 +57,7 @@ SlotDefault.args = {
57
57
  slotTemplate: `
58
58
  <template #default>
59
59
  <div class="flex items-center">
60
- <UIcon name="star" size="sm" />
60
+ <UIcon name="star" size="sm" color="inherit" />
61
61
  </div>
62
62
  </template>
63
63
  `,
@@ -3,10 +3,6 @@ import type { ComponentConfig } from "../types.ts";
3
3
 
4
4
  export type Config = typeof defaultConfig;
5
5
 
6
- export interface UTabSize {
7
- size: string;
8
- }
9
-
10
6
  export interface Props {
11
7
  /**
12
8
  * Tab label.
@@ -18,6 +14,21 @@ export interface Props {
18
14
  */
19
15
  value?: string | number;
20
16
 
17
+ /**
18
+ * Icon name (appears instead of label).
19
+ */
20
+ icon?: string;
21
+
22
+ /**
23
+ * Left icon name.
24
+ */
25
+ leftIcon?: string;
26
+
27
+ /**
28
+ * Right icon name.
29
+ */
30
+ rightIcon?: string;
31
+
21
32
  /**
22
33
  * Make tab disabled.
23
34
  */
@@ -32,15 +32,17 @@ const selectedItem = computed({
32
32
  set: (value) => emit("update:modelValue", value),
33
33
  });
34
34
 
35
- provide("setUTabsSelectedItem", (value: string) => (selectedItem.value = value));
36
- provide("getUTabsSelectedItem", () => selectedItem.value);
37
35
  provide("getUTabsSize", () => props.size);
36
+ provide("getUTabsBlock", () => props.block);
37
+ provide("getUTabsSquare", () => props.square);
38
+ provide("getUTabsSelectedItem", () => selectedItem.value);
39
+ provide("setUTabsSelectedItem", (value: string) => (selectedItem.value = value));
38
40
 
39
41
  /**
40
42
  * Get element / nested component attributes for each config token ✨
41
43
  * Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
42
44
  */
43
- const { tabsAttrs, itemAttrs } = useUI<Config>(defaultConfig);
45
+ const { tabsAttrs, tabAttrs } = useUI<Config>(defaultConfig);
44
46
  </script>
45
47
 
46
48
  <template>
@@ -54,7 +56,7 @@ const { tabsAttrs, itemAttrs } = useUI<Config>(defaultConfig);
54
56
  :value="item.value"
55
57
  :disabled="item.disabled"
56
58
  :size="size"
57
- v-bind="itemAttrs"
59
+ v-bind="tabAttrs"
58
60
  :data-test="`${dataTest}-item-${index}`"
59
61
  />
60
62
  </slot>
@@ -1,20 +1,9 @@
1
1
  export default /*tw*/ {
2
- tabs: {
3
- base: "mb-6 flex",
4
- variants: {
5
- size: {
6
- sm: "gap-5",
7
- md: "gap-6",
8
- lg: "gap-7",
9
- },
10
- underlined: {
11
- true: "border-b border-gray-100",
12
- },
13
- },
14
- },
15
- item: "{UTab}",
2
+ tabs: "mb-6 flex border-b border-gray-200 dark:border-gray-700",
3
+ tab: "{UTab}",
16
4
  defaults: {
17
5
  size: "md",
18
- underlined: false,
6
+ block: false,
7
+ square: false,
19
8
  },
20
9
  };
@@ -78,9 +78,6 @@ Default.args = {};
78
78
  export const Sizes = EnumVariantTemplate.bind({});
79
79
  Sizes.args = { enum: "size" };
80
80
 
81
- export const BottomLine = DefaultTemplate.bind({});
82
- BottomLine.args = { underlined: true };
83
-
84
81
  export const DisabledTab = DefaultTemplate.bind({});
85
82
  DisabledTab.args = {
86
83
  options: [
@@ -28,12 +28,17 @@ export interface Props {
28
28
  /**
29
29
  * Tabs size.
30
30
  */
31
- size?: "sm" | "md" | "lg";
31
+ size?: "2xs" | "xs" | "sm" | "md" | "lg" | "xl";
32
32
 
33
33
  /**
34
- * Add the bottom line along the entire length.
34
+ * Make the Tabs fill the width with its container.
35
35
  */
36
- underlined?: boolean;
36
+ block?: boolean;
37
+
38
+ /**
39
+ * Set the same paddings for the tabs.
40
+ */
41
+ square?: boolean;
37
42
 
38
43
  /**
39
44
  * Component config object.
@@ -111,7 +111,6 @@ const {
111
111
  v-if="closable"
112
112
  square
113
113
  size="xs"
114
- :ring="false"
115
114
  :color="closeButtonColor"
116
115
  variant="thirdary"
117
116
  v-bind="closeButtonAttrs"
@@ -16,14 +16,11 @@ export default /*tw*/ {
16
16
  true: "rounded-full",
17
17
  },
18
18
  tabindex: {
19
- true: `
20
- cursor-pointer focus-within:ring-dynamic focus-within:ring-offset-dynamic focus-within:ring-{color}-700/15
21
- focus:ring-dynamic focus:ring-offset-dynamic focus:ring-{color}-700/15
22
- `,
19
+ true: "cursor-pointer focus-visible:ring-dynamic focus-visible:ring-offset-dynamic focus-visible:ring-{color}-600",
23
20
  },
24
21
  color: {
25
- grayscale: "focus:ring-gray-700/15 focus-within:ring-gray-700/15",
26
- white: "focus:ring-gray-700/15 focus-within:ring-gray-700/15",
22
+ grayscale: "focus-visible:ring-gray-900",
23
+ white: " focus-visible:ring-gray-900",
27
24
  },
28
25
  },
29
26
  compoundVariants: [
@@ -59,7 +59,7 @@ const {
59
59
  </script>
60
60
 
61
61
  <template>
62
- <ULink :href="url" :ring="false" v-bind="fileAttrs" :data-test="dataTest">
62
+ <ULink :href="url" v-bind="fileAttrs" :data-test="dataTest">
63
63
  <slot name="left" :file="{ elementId, label, url, imageUrl }" />
64
64
 
65
65
  <slot :file="{ elementId, label, url, imageUrl }">
@@ -77,14 +77,7 @@ const {
77
77
  @blur="onBlur"
78
78
  />
79
79
 
80
- <ULink
81
- :label="label"
82
- :ring="false"
83
- :size="size"
84
- color="gray"
85
- dashed
86
- v-bind="fileLabelAttrs"
87
- />
80
+ <ULink :label="label" :size="size" color="gray" dashed v-bind="fileLabelAttrs" />
88
81
  </div>
89
82
  </slot>
90
83