vueless 0.0.674 → 0.0.676

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 (88) hide show
  1. package/bin/commands/create.js +77 -0
  2. package/bin/commands/index.js +2 -0
  3. package/bin/commands/init.js +4 -8
  4. package/bin/constants.js +2 -5
  5. package/bin/index.js +1 -1
  6. package/bin/utils/dataUtils.js +53 -0
  7. package/bin/utils/formatUtil.js +48 -0
  8. package/composables/useUI.ts +12 -1
  9. package/constants.js +6 -0
  10. package/package.json +2 -2
  11. package/plugin-vite.js +3 -1
  12. package/types.ts +1 -1
  13. package/ui.boilerplate/storybook/stories.ts +1 -1
  14. package/ui.boilerplate/types.ts +1 -1
  15. package/ui.button/UButton.vue +9 -6
  16. package/ui.button/types.ts +1 -1
  17. package/ui.button-link/ULink.vue +37 -62
  18. package/ui.button-link/config.ts +8 -35
  19. package/ui.button-link/storybook/stories.ts +0 -22
  20. package/ui.button-link/types.ts +1 -11
  21. package/ui.button-toggle/types.ts +1 -1
  22. package/ui.button-toggle-item/types.ts +1 -1
  23. package/ui.container-accordion/types.ts +1 -1
  24. package/ui.container-card/types.ts +1 -1
  25. package/ui.container-col/types.ts +1 -1
  26. package/ui.container-divider/types.ts +1 -1
  27. package/ui.container-group/types.ts +1 -1
  28. package/ui.container-groups/types.ts +1 -1
  29. package/ui.container-modal/UModal.vue +21 -20
  30. package/ui.container-modal/config.ts +3 -2
  31. package/ui.container-modal/types.ts +1 -1
  32. package/ui.container-modal-confirm/types.ts +1 -1
  33. package/ui.container-page/UPage.vue +31 -19
  34. package/ui.container-page/config.ts +1 -0
  35. package/ui.container-page/types.ts +1 -1
  36. package/ui.container-row/types.ts +1 -1
  37. package/ui.data-list/types.ts +1 -1
  38. package/ui.data-table/types.ts +1 -1
  39. package/ui.dropdown-badge/types.ts +1 -1
  40. package/ui.dropdown-button/types.ts +1 -1
  41. package/ui.dropdown-link/UDropdownLink.vue +29 -33
  42. package/ui.dropdown-link/config.ts +3 -3
  43. package/ui.dropdown-link/types.ts +1 -1
  44. package/ui.dropdown-list/types.ts +1 -1
  45. package/ui.form-calendar/types.ts +1 -1
  46. package/ui.form-checkbox/types.ts +1 -1
  47. package/ui.form-checkbox-group/types.ts +1 -1
  48. package/ui.form-checkbox-multi-state/types.ts +1 -1
  49. package/ui.form-date-picker/types.ts +1 -1
  50. package/ui.form-date-picker-range/types.ts +1 -1
  51. package/ui.form-input/types.ts +1 -1
  52. package/ui.form-input-file/types.ts +1 -1
  53. package/ui.form-input-money/types.ts +1 -1
  54. package/ui.form-input-number/types.ts +1 -1
  55. package/ui.form-input-rating/types.ts +1 -1
  56. package/ui.form-input-search/types.ts +1 -1
  57. package/ui.form-label/types.ts +1 -1
  58. package/ui.form-radio/types.ts +1 -1
  59. package/ui.form-radio-group/types.ts +1 -1
  60. package/ui.form-select/USelect.vue +8 -6
  61. package/ui.form-select/types.ts +1 -1
  62. package/ui.form-switch/types.ts +1 -1
  63. package/ui.form-textarea/types.ts +1 -1
  64. package/ui.image-avatar/types.ts +1 -1
  65. package/ui.image-icon/UIcon.vue +2 -18
  66. package/ui.image-icon/storybook/stories.ts +0 -3
  67. package/ui.image-icon/types.ts +1 -13
  68. package/ui.loader/types.ts +1 -1
  69. package/ui.loader-overlay/types.ts +1 -1
  70. package/ui.loader-progress/types.ts +1 -1
  71. package/ui.navigation-pagination/types.ts +1 -1
  72. package/ui.navigation-progress/types.ts +2 -2
  73. package/ui.navigation-tab/types.ts +1 -1
  74. package/ui.navigation-tabs/types.ts +1 -1
  75. package/ui.other-dot/types.ts +1 -1
  76. package/ui.other-theme-color-toggle/storybook/stories.ts +1 -1
  77. package/ui.other-theme-color-toggle/types.ts +1 -1
  78. package/ui.text-alert/types.ts +1 -1
  79. package/ui.text-badge/types.ts +1 -1
  80. package/ui.text-block/types.ts +1 -1
  81. package/ui.text-empty/types.ts +1 -1
  82. package/ui.text-file/types.ts +1 -1
  83. package/ui.text-files/types.ts +1 -1
  84. package/ui.text-header/types.ts +1 -1
  85. package/ui.text-money/types.ts +1 -1
  86. package/ui.text-notify/types.ts +1 -1
  87. package/ui.text-number/types.ts +1 -1
  88. package/utils/theme.ts +5 -1
@@ -2,7 +2,6 @@
2
2
  import { computed, defineAsyncComponent } from "vue";
3
3
 
4
4
  import useUI from "../composables/useUI.ts";
5
- import { vTooltip } from "../directives";
6
5
  import { getDefaults } from "../utils/ui.ts";
7
6
  import { isSSR } from "../utils/helper.ts";
8
7
  import { VUELESS_ICONS_CACHED_DIR, VUELESS_LIBRARY } from "../constants.js";
@@ -12,13 +11,11 @@ import defaultConfig from "./config.ts";
12
11
 
13
12
  import type { AsyncComponentLoader } from "vue";
14
13
  import type { Props, Config, IconLibraries } from "./types.ts";
15
- import type { Props as TippyProps, Instance as TippyInstance } from "tippy.js";
16
14
 
17
15
  defineOptions({ inheritAttrs: false });
18
16
 
19
17
  const props = withDefaults(defineProps<Props>(), {
20
18
  ...getDefaults<Props, Config>(defaultConfig, COMPONENT_NAME),
21
- tooltipSettings: () => ({}) as TippyProps,
22
19
  });
23
20
 
24
21
  const emit = defineEmits([
@@ -128,18 +125,6 @@ const dynamicComponent = computed(() => {
128
125
  return defineAsyncComponent(libraries[library] as AsyncComponentLoader);
129
126
  });
130
127
 
131
- const tooltipConfig = computed(() => ({
132
- ...props.tooltipSettings,
133
- content: props.tooltip,
134
- onShow: (instance: TippyInstance) => {
135
- const userOnShow = props.tooltipSettings?.onShow;
136
-
137
- userOnShow && userOnShow(instance);
138
-
139
- return !!props.tooltip;
140
- },
141
- }));
142
-
143
128
  function onClick(event: MouseEvent) {
144
129
  emit("click", event);
145
130
  }
@@ -148,16 +133,15 @@ function onClick(event: MouseEvent) {
148
133
  * Get element / nested component attributes for each config token ✨
149
134
  * Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
150
135
  */
151
- const { config, iconAttrs } = useUI<Config>(defaultConfig);
136
+ const { getDataTest, config, iconAttrs } = useUI<Config>(defaultConfig);
152
137
  </script>
153
138
 
154
139
  <template>
155
140
  <component
156
141
  :is="dynamicComponent"
157
- v-tooltip="tooltipConfig"
158
142
  tabindex="-1"
159
143
  v-bind="iconAttrs"
160
- :data-test="dataTest"
144
+ :data-test="getDataTest()"
161
145
  @click="onClick"
162
146
  />
163
147
  </template>
@@ -79,8 +79,5 @@ Sizes.args = { enum: "size" };
79
79
  export const Variants = EnumVariantTemplate.bind({});
80
80
  Variants.args = { enum: "variant", color: "red" };
81
81
 
82
- export const Tooltip = DefaultTemplate.bind({});
83
- Tooltip.args = { tooltip: "Some text" };
84
-
85
82
  export const Interactive = DefaultTemplate.bind({});
86
83
  Interactive.args = { interactive: true };
@@ -3,7 +3,6 @@ import defaultConfig from "./config.ts";
3
3
  import type { DefineComponent, SVGAttributes } from "vue";
4
4
 
5
5
  import type { ComponentConfig } from "../types.ts";
6
- import type { Props as TippyProps } from "tippy.js";
7
6
 
8
7
  export type Config = typeof defaultConfig;
9
8
 
@@ -68,17 +67,6 @@ export interface Props {
68
67
  */
69
68
  interactive?: boolean;
70
69
 
71
- /**
72
- * Add tooltip text on hover.
73
- */
74
- tooltip?: string;
75
-
76
- /**
77
- * Tooltip settings.
78
- * [See all settings here](https://kabbouchi.github.io/vue-tippy/4.0/features/placement.html).
79
- */
80
- tooltipSettings?: TippyProps;
81
-
82
70
  /**
83
71
  * Mark that Icon used inside Vueless components (used to get icons from vueless library).
84
72
  */
@@ -92,5 +80,5 @@ export interface Props {
92
80
  /**
93
81
  * Data-test attribute for automated testing.
94
82
  */
95
- dataTest?: string;
83
+ dataTest?: string | null;
96
84
  }
@@ -51,5 +51,5 @@ export interface Props {
51
51
  /**
52
52
  * Data-test attribute for automated testing.
53
53
  */
54
- dataTest?: string;
54
+ dataTest?: string | null;
55
55
  }
@@ -44,5 +44,5 @@ export interface Props {
44
44
  /**
45
45
  * Data-test attribute for automated testing.
46
46
  */
47
- dataTest?: string;
47
+ dataTest?: string | null;
48
48
  }
@@ -53,5 +53,5 @@ export interface Props {
53
53
  /**
54
54
  * Data-test attribute for automated testing.
55
55
  */
56
- dataTest?: string;
56
+ dataTest?: string | null;
57
57
  }
@@ -82,5 +82,5 @@ export interface Props {
82
82
  /**
83
83
  * Data-test attribute for automated testing.
84
84
  */
85
- dataTest?: string;
85
+ dataTest?: string | null;
86
86
  }
@@ -63,7 +63,7 @@ export interface UProgressProps {
63
63
  /**
64
64
  * Data-test attribute for automated testing.
65
65
  */
66
- dataTest?: string;
66
+ dataTest?: string | null;
67
67
  }
68
68
 
69
69
  export interface StepperProgressProps {
@@ -90,5 +90,5 @@ export interface StepperProgressProps {
90
90
  /**
91
91
  * Data-test attribute for automated testing.
92
92
  */
93
- dataTest?: string;
93
+ dataTest?: string | null;
94
94
  }
@@ -31,5 +31,5 @@ export interface Props {
31
31
  /**
32
32
  * Data-test attribute for automated testing.
33
33
  */
34
- dataTest?: string;
34
+ dataTest?: string | null;
35
35
  }
@@ -43,5 +43,5 @@ export interface Props {
43
43
  /**
44
44
  * Data-test attribute for automated testing.
45
45
  */
46
- dataTest?: string;
46
+ dataTest?: string | null;
47
47
  }
@@ -43,5 +43,5 @@ export interface Props {
43
43
  /**
44
44
  * Data-test attribute for automated testing.
45
45
  */
46
- dataTest?: string;
46
+ dataTest?: string | null;
47
47
  }
@@ -19,7 +19,7 @@ interface UThemeColorToggleArgs extends Props {
19
19
 
20
20
  export default {
21
21
  id: "100020",
22
- title: "Other / Theme Color Switcher",
22
+ title: "Other / Theme Color Toggle",
23
23
  component: UThemeColorToggle,
24
24
  args: {
25
25
  modelValue: ["", ""],
@@ -48,5 +48,5 @@ export interface Props {
48
48
  /**
49
49
  * Data-test attribute for automated testing.
50
50
  */
51
- dataTest?: string;
51
+ dataTest?: string | null;
52
52
  }
@@ -73,5 +73,5 @@ export interface Props {
73
73
  /**
74
74
  * Data-test attribute for automated testing.
75
75
  */
76
- dataTest?: string;
76
+ dataTest?: string | null;
77
77
  }
@@ -83,5 +83,5 @@ export interface Props {
83
83
  /**
84
84
  * Data-test attribute for automated testing.
85
85
  */
86
- dataTest?: string;
86
+ dataTest?: string | null;
87
87
  }
@@ -32,5 +32,5 @@ export interface Props {
32
32
  /**
33
33
  * Data-test attribute for automated testing.
34
34
  */
35
- dataTest?: string;
35
+ dataTest?: string | null;
36
36
  }
@@ -27,5 +27,5 @@ export interface Props {
27
27
  /**
28
28
  * Data-test attribute for automated testing.
29
29
  */
30
- dataTest?: string;
30
+ dataTest?: string | null;
31
31
  }
@@ -42,5 +42,5 @@ export interface Props {
42
42
  /**
43
43
  * Data-test attribute for automated testing.
44
44
  */
45
- dataTest?: string;
45
+ dataTest?: string | null;
46
46
  }
@@ -42,5 +42,5 @@ export interface Props {
42
42
  /**
43
43
  * Data-test attribute for automated testing.
44
44
  */
45
- dataTest?: string;
45
+ dataTest?: string | null;
46
46
  }
@@ -63,5 +63,5 @@ export interface Props {
63
63
  /**
64
64
  * Data-test attribute for automated testing.
65
65
  */
66
- dataTest?: string;
66
+ dataTest?: string | null;
67
67
  }
@@ -98,5 +98,5 @@ export interface Props {
98
98
  /**
99
99
  * Data-test attribute for automated testing.
100
100
  */
101
- dataTest?: string;
101
+ dataTest?: string | null;
102
102
  }
@@ -50,5 +50,5 @@ export interface Props {
50
50
  /**
51
51
  * Data-test attribute for automated testing.
52
52
  */
53
- dataTest?: string;
53
+ dataTest?: string | null;
54
54
  }
@@ -78,5 +78,5 @@ export interface Props {
78
78
  /**
79
79
  * Data-test attribute for automated testing.
80
80
  */
81
- dataTest?: string;
81
+ dataTest?: string | null;
82
82
  }
package/utils/theme.ts CHANGED
@@ -115,7 +115,7 @@ export function setTheme(config: Config = {}) {
115
115
  const roundingLg = config.roundingLg ?? vuelessConfig.roundingLg ?? rounding * 2;
116
116
  const isDarkMode = isCSR && document.documentElement.classList.contains(DARK_MODE_SELECTOR);
117
117
 
118
- const brand: BrandColors =
118
+ let brand: BrandColors =
119
119
  config.brand ?? getSelectedBrandColor() ?? vuelessConfig.brand ?? DEFAULT_BRAND_COLOR;
120
120
 
121
121
  let gray: GrayColors =
@@ -142,6 +142,10 @@ export function setTheme(config: Config = {}) {
142
142
  gray = GRAY_COLOR;
143
143
  }
144
144
 
145
+ if (brand === GRAYSCALE_COLOR) {
146
+ brand = gray;
147
+ }
148
+
145
149
  /* Remove deprecated color aliases. */
146
150
  delete (tailwindColors as Partial<DefaultColors>).lightBlue;
147
151
  delete (tailwindColors as Partial<DefaultColors>).warmGray;