vueless 0.0.825-beta.0 → 0.0.825-beta.2

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.
@@ -1,4 +1,4 @@
1
- import { ref, watch, watchEffect, getCurrentInstance, toValue, useAttrs, computed } from "vue";
1
+ import { ref, watch, getCurrentInstance, toValue, useAttrs, computed } from "vue";
2
2
  import { isEqual } from "lodash-es";
3
3
 
4
4
  import { cx, cva, setColor, vuelessConfig, getMergedConfig } from "../utils/ui.ts";
@@ -56,16 +56,22 @@ export default function useUI<T>(
56
56
  const firstClassKey = Object.keys(defaultConfig || {})[0];
57
57
  const config = ref({}) as Ref<ComponentConfigFull<T>>;
58
58
 
59
- watchEffect(() => {
60
- const propsConfig = props.config as ComponentConfigFull<T>;
59
+ watch(
60
+ () => props.config,
61
+ (newVal, oldVal) => {
62
+ if (isEqual(newVal, oldVal)) return;
63
+
64
+ const propsConfig = props.config as ComponentConfigFull<T>;
61
65
 
62
- config.value = getMergedConfig({
63
- defaultConfig,
64
- globalConfig,
65
- propsConfig,
66
- vuelessStrategy,
67
- }) as ComponentConfigFull<T>;
68
- });
66
+ config.value = getMergedConfig({
67
+ defaultConfig,
68
+ globalConfig,
69
+ propsConfig,
70
+ vuelessStrategy,
71
+ }) as ComponentConfigFull<T>;
72
+ },
73
+ { deep: true, immediate: true },
74
+ );
69
75
 
70
76
  /**
71
77
  * Get classes by given key (including CVA if config set).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.825-beta.0",
3
+ "version": "0.0.825-beta.2",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
package/tailwind.css CHANGED
@@ -1,23 +1,33 @@
1
+ /* ------ Tailwind plugins ------ */
2
+
1
3
  @plugin "@tailwindcss/forms" {
2
4
  strategy: base;
3
5
  }
4
6
 
7
+ /* ------ Development sources ------ */
8
+
5
9
  @source "../node_modules/.cache/vueless/safelist.txt";
6
- @source "../node_modules/vueless";
7
- @source "../vueless.config.ts";
8
- @source "../vueless.config.js";
9
- @source "../.vueless";
10
10
 
11
+ /* ------ Production sources ------ */
12
+
13
+ @source "../.cache/vueless/safelist.txt";
14
+ @source "../vueless";
15
+
16
+ /* ------ Color mode settings ------ */
11
17
 
12
18
  @variant light (&:where(.vl-light, .vl-light *));
13
19
  @variant dark (&:where(.vl-dark, .vl-dark *));
14
20
 
21
+ /* ------ Base styles ------ */
22
+
15
23
  @layer base {
16
24
  body {
17
25
  @apply antialiased text-(--vl-text) bg-(--vl-bg) scheme-light dark:scheme-dark;
18
26
  }
19
27
  }
20
28
 
29
+ /* ------ Tailwind theme settings ------ */
30
+
21
31
  @theme {
22
32
  /* Primary colors */
23
33
  --color-primary-50: var(--vl-primary-50);
@@ -89,7 +99,7 @@
89
99
  --spacing-safe-right: "env(safe-area-inset-right)";
90
100
  }
91
101
 
92
- /* Text color utilities */
102
+ /* ------ Text color utilities ------ */
93
103
 
94
104
  @utility text-default {
95
105
  color: var(--vl-text);
@@ -111,7 +121,7 @@
111
121
  color: var(--vl-text-inverted);
112
122
  }
113
123
 
114
- /* Border color utilities */
124
+ /* ------ Border color utilities ------ */
115
125
 
116
126
  @utility border-default {
117
127
  border-color: var(--vl-border);
@@ -129,7 +139,7 @@
129
139
  border-color: var(--vl-border-muted);
130
140
  }
131
141
 
132
- /* Background color utilities */
142
+ /* ------ Background color utilities ------ */
133
143
 
134
144
  @utility bg-default {
135
145
  background-color: var(--vl-bg);
@@ -151,7 +161,7 @@
151
161
  background-color: var(--vl-bg-inverted);
152
162
  }
153
163
 
154
- /* Outline width utilities */
164
+ /* ------ Outline width utilities ------ */
155
165
 
156
166
  @utility outline-small {
157
167
  outline-style: var(--tw-outline-style);
@@ -167,64 +177,3 @@
167
177
  outline-style: var(--tw-outline-style);
168
178
  outline-width: var(--vl-outline-lg);
169
179
  }
170
-
171
- /* Defined variables to prevent IDE's unused property error. */
172
- :root {
173
- --vl-primary-50: "";
174
- --vl-primary-100: "";
175
- --vl-primary-200: "";
176
- --vl-primary-300: "";
177
- --vl-primary-400: "";
178
- --vl-primary-500: "";
179
- --vl-primary-600: "";
180
- --vl-primary-700: "";
181
- --vl-primary-800: "";
182
- --vl-primary-900: "";
183
- --vl-primary-950: "";
184
- --vl-primary: "";
185
- --vl-primary-lifted: "";
186
- --vl-primary-accented: "";
187
- --vl-neutral: "";
188
- --vl-neutral-lifted: "";
189
- --vl-neutral-accented: "";
190
- --vl-info: "";
191
- --vl-info-lifted: "";
192
- --vl-info-accented: "";
193
- --vl-error: "";
194
- --vl-error-lifted: "";
195
- --vl-error-accented: "";
196
- --vl-warning: "";
197
- --vl-warning-lifted: "";
198
- --vl-warning-accented: "";
199
- --vl-success: "";
200
- --vl-success-lifted: "";
201
- --vl-success-accented: "";
202
- --vl-grayscale: "";
203
- --vl-grayscale-lifted: "";
204
- --vl-grayscale-accented: "";
205
- --vl-radius-sm: "";
206
- --vl-radius-md: "";
207
- --vl-radius-lg: "";
208
- --vl-text-xs: "";
209
- --vl-text-sm: "";
210
- --vl-text-md: "";
211
- --vl-text-lg: "";
212
- --vl-text: "";
213
- --vl-text-lifted: "";
214
- --vl-text-accented: "";
215
- --vl-text-muted: "";
216
- --vl-text-inverted: "";
217
- --vl-border: "";
218
- --vl-border-lifted: "";
219
- --vl-border-accented: "";
220
- --vl-border-muted: "";
221
- --vl-bg: "";
222
- --vl-bg-lifted: "";
223
- --vl-bg-accented: "";
224
- --vl-bg-muted: "";
225
- --vl-bg-inverted: "";
226
- --vl-outline-sm: "";
227
- --vl-outline-md: "";
228
- --vl-outline-lg: "";
229
- }
230
-
@@ -16,7 +16,7 @@ export default /*tw*/ {
16
16
  stickyHeaderCell: "{>headerCellBase} flex-none whitespace-nowrap",
17
17
  stickyHeaderCheckbox: "{UCheckbox}",
18
18
  stickyHeaderCounter: {
19
- base: "{>headerCounterBase} absolute top-4 left-11 bg-gradient-to-r from-white from-80%",
19
+ base: "{>headerCounterBase} absolute top-4 left-11 bg-gradient-to-r from-(--vl-bg) from-80%",
20
20
  variants: {
21
21
  compact: {
22
22
  true: "top-3",
@@ -170,7 +170,7 @@ export const Slots: StoryFn<DefaultUDropdownLinkArgs> = (args) => ({
170
170
 
171
171
  <UDropdownLink v-bind="args">
172
172
  <template #default>
173
- <UBadge label="Dropdown" color="success" variant="ghost" />
173
+ <UBadge label="Dropdown" color="success" variant="soft" />
174
174
  </template>
175
175
  </UDropdownLink>
176
176
  </URow>
@@ -356,7 +356,7 @@ const {
356
356
  v-else-if="getDayState(day).isAnotherMonthDayInRange"
357
357
  tabindex="-1"
358
358
  variant="ghost"
359
- color="blue"
359
+ color="info"
360
360
  size="md"
361
361
  square
362
362
  v-bind="anotherMonthDayInRangeAttrs"
@@ -69,7 +69,7 @@ export default /*tw*/ {
69
69
  hover:focus-within:border-primary focus-within:border-primary
70
70
  focus-within:outline focus-within:outline-small focus-within:outline-primary
71
71
  `,
72
- timepickerInput: "w-10 border-none px-1.5 py-1.5 text-center text-medium focus:ring-0 focus:outline-none",
72
+ timepickerInput: "w-10 border-none px-1.5 py-1.5 text-center text-medium focus:ring-0 focus:outline-none bg-default",
73
73
  timepickerInputHours: "{>timepickerInput} rounded-l-medium",
74
74
  timepickerInputMinutes: "{>timepickerInput}",
75
75
  timepickerInputSeconds: "{>timepickerInput} rounded-r-medium",
@@ -99,7 +99,7 @@ const {
99
99
  internal
100
100
  :size="size"
101
101
  :name="config.defaults.removeIcon"
102
- :color="isRemoveButtonDisabled ? 'gray' : 'grayscale'"
102
+ :color="isRemoveButtonDisabled ? 'neutral' : 'grayscale'"
103
103
  v-bind="removeIconAttrs"
104
104
  />
105
105
  </UButton>
@@ -122,7 +122,7 @@ const {
122
122
  internal
123
123
  :size="size"
124
124
  :name="config.defaults.addIcon"
125
- :color="isAddButtonDisabled ? 'gray' : 'grayscale'"
125
+ :color="isAddButtonDisabled ? 'neutral' : 'grayscale'"
126
126
  v-bind="addIconAttrs"
127
127
  />
128
128
  </UButton>
@@ -147,7 +147,7 @@ SlotLabel.args = {
147
147
  name: "SlotLabel",
148
148
  slotTemplate: `
149
149
  <template #label="{ label }">
150
- <UBadge :label="label" color="success" variant="ghost" />
150
+ <UBadge :label="label" color="success" variant="soft" />
151
151
  </template>
152
152
  `,
153
153
  };
@@ -424,7 +424,7 @@ export const SlotBeforeOption = DefaultTemplate.bind({});
424
424
  SlotBeforeOption.args = {
425
425
  slotTemplate: `
426
426
  <template #before-option="{ option, index }">
427
- <UBadge v-if="index === 3" label="Special offer!" color="blue" class="mr-1" />
427
+ <UBadge v-if="index === 3" label="Special offer!" color="info" class="mr-1" />
428
428
  </template>
429
429
  `,
430
430
  };
@@ -442,7 +442,7 @@ export const SlotAfterOption = DefaultTemplate.bind({});
442
442
  SlotAfterOption.args = {
443
443
  slotTemplate: `
444
444
  <template #after-option="{ option, index }">
445
- <UBadge v-if="index === 2" label="Special offer!" color="blue" class="ml-1" />
445
+ <UBadge v-if="index === 2" label="Special offer!" color="info" class="ml-1" />
446
446
  </template>
447
447
  `,
448
448
  };
@@ -58,7 +58,7 @@ export default /*tw*/ {
58
58
  },
59
59
  },
60
60
  toggleLabel: {
61
- base: "absolute text-center text-xsmall font-medium uppercase text-white",
61
+ base: "absolute text-center text-xsmall font-medium uppercase text-inverted",
62
62
  compoundVariants: [
63
63
  { toggleLabel: true, checked: true, class: "w-1/2 left-1" },
64
64
  { toggleLabel: true, checked: false, class: "w-1/2 right-1" },
@@ -46,7 +46,7 @@ const { getDataTest, config, overlayAttrs, nestedLoaderAttrs } = useUI<Config>(d
46
46
  <div v-if="showLoader" v-bind="overlayAttrs" :data-test="getDataTest()">
47
47
  <!-- @slot Use it to add something instead of the default loader. -->
48
48
  <slot>
49
- <ULoader :loading="showLoader" size="lg" color="inherit" v-bind="nestedLoaderAttrs" />
49
+ <ULoader :loading="showLoader" size="lg" :color="color" v-bind="nestedLoaderAttrs" />
50
50
  </slot>
51
51
  </div>
52
52
  </Transition>
@@ -5,17 +5,12 @@ export default /*tw*/ {
5
5
  },
6
6
  overlay: {
7
7
  base: `
8
- bg-{color} text-inverted
8
+ bg-default
9
9
  h-screen w-screen
10
10
  flex justify-center items-center
11
11
  fixed left-0 top-0 z-[9999]
12
12
  transition duration-300
13
13
  `,
14
- variants: {
15
- color: {
16
- grayscale: "bg-lifted text-default",
17
- },
18
- },
19
14
  },
20
15
  nestedLoader: "{ULoader}",
21
16
  defaults: {
@@ -57,7 +57,7 @@ export default /*tw*/ {
57
57
  stepperSvg: "",
58
58
  stepperGradient: "",
59
59
  stepperCircle: "stroke-{color}/10 text-{color}/10",
60
- stepperCount: "text-medium font-bold translate-y-2 transform",
60
+ stepperCount: "text-medium fill-(--vl-text) font-bold translate-y-2 transform",
61
61
  header: {
62
62
  base: "{UHeader}",
63
63
  defaults: {
@@ -62,7 +62,7 @@ const EnumVariantTemplate: StoryFn<UDotArgs> = (args: UDotArgs, { argTypes }) =>
62
62
  align="center"
63
63
  >
64
64
  <UDot v-bind="args" :[args.enum]="option"/>
65
- <UBadge :label="option" :[args.enum]="option" variant="ghost" size="md"/>
65
+ <UBadge :label="option" :[args.enum]="option" variant="subtle" size="md"/>
66
66
  </URow>
67
67
  </UCol>
68
68
  `,
@@ -154,7 +154,7 @@ export const Slots: StoryFn<UAlertArgs> = (args) => ({
154
154
  <UBadge
155
155
  label="We are trying to reconnect. Please wait a moment or check your network settings."
156
156
  color="error"
157
- variant="ghost"
157
+ variant="soft"
158
158
  />
159
159
  </template>
160
160
  </UAlert>
@@ -169,13 +169,13 @@ export const Slots: StoryFn<UAlertArgs> = (args) => ({
169
169
 
170
170
  <UAlert v-bind="args">
171
171
  <template #bottom>
172
- <UIcon name="sync" color="blue" />
172
+ <UIcon name="sync" color="info" />
173
173
  </template>
174
174
  </UAlert>
175
175
 
176
176
  <UAlert v-bind="args">
177
177
  <template #left>
178
- <UIcon name="warning" color="yellow" />
178
+ <UIcon name="warning" color="warning" />
179
179
  </template>
180
180
  </UAlert>
181
181
 
@@ -160,7 +160,6 @@ export const Slots: StoryFn<UBadgeArgs> = (args) => ({
160
160
  <UMoney
161
161
  value="20.25"
162
162
  size="sm"
163
- color="inherit"
164
163
  symbol="$"
165
164
  />
166
165
  <UIcon
@@ -86,7 +86,7 @@ SlotHeader.args = {
86
86
  <template #header>
87
87
  <UIcon
88
88
  name="person"
89
- color="blue"
89
+ color="info"
90
90
  size="2xl"
91
91
  />
92
92
  </template>