vueless 1.2.8-beta.15 → 1.2.8-beta.16

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "1.2.8-beta.15",
3
+ "version": "1.2.8-beta.16",
4
4
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
5
5
  "author": "Johnny Grid <hello@vueless.com> (https://vueless.com)",
6
6
  "homepage": "https://vueless.com",
@@ -158,6 +158,7 @@ function onClickBadge() {
158
158
 
159
159
  function hideOptions() {
160
160
  isShownOptions.value = false;
161
+ dropdownSearch.value = "";
161
162
 
162
163
  emit("close");
163
164
  }
@@ -178,6 +178,7 @@ function onClickButton() {
178
178
 
179
179
  function hideOptions() {
180
180
  isShownOptions.value = false;
181
+ dropdownSearch.value = "";
181
182
 
182
183
  emit("close");
183
184
  }
@@ -160,6 +160,7 @@ function onClickLink() {
160
160
 
161
161
  function hideOptions() {
162
162
  isShownOptions.value = false;
163
+ dropdownSearch.value = "";
163
164
 
164
165
  emit("close");
165
166
  }
@@ -103,11 +103,7 @@ const selectedValue = computed({
103
103
 
104
104
  return props.modelValue;
105
105
  },
106
- set: (value) => {
107
- if (searchModel.value) searchModel.value = "";
108
-
109
- emit("update:modelValue", value);
110
- },
106
+ set: (value) => emit("update:modelValue", value),
111
107
  });
112
108
 
113
109
  const addOptionKeyCombination = computed(() => {
@@ -266,6 +266,7 @@ function deactivate() {
266
266
  wrapperRef.value?.blur();
267
267
 
268
268
  isOpen.value = false;
269
+ dropdownSearch.value = "";
269
270
 
270
271
  nextTick(() => emit("close", localValue.value, elementId));
271
272
  }
package/utils/theme.ts CHANGED
@@ -51,18 +51,6 @@ import type {
51
51
  } from "../types";
52
52
  import { ColorMode } from "../types";
53
53
 
54
- declare interface RootCSSVariableOptions {
55
- primary: PrimaryColors | string;
56
- neutral: NeutralColors | string;
57
- text: ThemeConfigText;
58
- rounding: ThemeConfigRounding;
59
- outline: ThemeConfigOutline;
60
- letterSpacing: number;
61
- disabledOpacity: number;
62
- lightTheme: Partial<VuelessCssVariables>;
63
- darkTheme: Partial<VuelessCssVariables>;
64
- }
65
-
66
54
  declare interface SetColorMode {
67
55
  colorMode: `${ColorMode}`;
68
56
  isColorModeAuto: boolean;
@@ -696,20 +684,20 @@ function getDarkTheme(darkTheme?: Partial<VuelessCssVariables>) {
696
684
  * Generate and apply Vueless CSS variables.
697
685
  * @return string - Vueless CSS variables string.
698
686
  */
699
- export function setRootCSSVariables(vars: RootCSSVariableOptions) {
687
+ export function setRootCSSVariables(vars: MergedThemeConfig) {
700
688
  let darkVariables: Partial<VuelessCssVariables> = {};
701
689
 
702
690
  let variables: Partial<VuelessCssVariables> = {
703
- "--vl-text-xs": `${vars.text.xs / PX_IN_REM}rem`,
704
- "--vl-text-sm": `${vars.text.sm / PX_IN_REM}rem`,
705
- "--vl-text-md": `${vars.text.md / PX_IN_REM}rem`,
706
- "--vl-text-lg": `${vars.text.lg / PX_IN_REM}rem`,
691
+ "--vl-text-xs": `${Number(vars.text?.xs ?? 0) / PX_IN_REM}rem`,
692
+ "--vl-text-sm": `${Number(vars.text?.sm ?? 0) / PX_IN_REM}rem`,
693
+ "--vl-text-md": `${Number(vars.text?.md ?? 0) / PX_IN_REM}rem`,
694
+ "--vl-text-lg": `${Number(vars.text?.lg ?? 0) / PX_IN_REM}rem`,
707
695
  "--vl-outline-sm": `${vars.outline.sm}px`,
708
696
  "--vl-outline-md": `${vars.outline.md}px`,
709
697
  "--vl-outline-lg": `${vars.outline.lg}px`,
710
- "--vl-rounding-sm": `${vars.rounding.sm / PX_IN_REM}rem`,
711
- "--vl-rounding-md": `${vars.rounding.md / PX_IN_REM}rem`,
712
- "--vl-rounding-lg": `${vars.rounding.lg / PX_IN_REM}rem`,
698
+ "--vl-rounding-sm": `${Number(vars.rounding.sm ?? 0) / PX_IN_REM}rem`,
699
+ "--vl-rounding-md": `${Number(vars.rounding.md ?? 0) / PX_IN_REM}rem`,
700
+ "--vl-rounding-lg": `${Number(vars.rounding.lg ?? 0) / PX_IN_REM}rem`,
713
701
  "--vl-letter-spacing": `${vars.letterSpacing}em`,
714
702
  "--vl-disabled-opacity": `${vars.disabledOpacity}%`,
715
703
  };
@@ -724,7 +712,7 @@ export function setRootCSSVariables(vars: RootCSSVariableOptions) {
724
712
  `var(--color-${vars.neutral}-${shade})`;
725
713
  }
726
714
 
727
- const [light, dark] = generateCSSColorVariables(vars.lightTheme, vars.darkTheme);
715
+ const [light, dark] = generateCSSColorVariables(vars.lightTheme ?? {}, vars.darkTheme ?? {});
728
716
 
729
717
  variables = { ...variables, ...light };
730
718
  darkVariables = { ...darkVariables, ...dark };