vueless 0.0.589 → 0.0.591

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/constants.js CHANGED
@@ -72,8 +72,8 @@ export const SYSTEM_CONFIG_KEY = {
72
72
  ...CVA_CONFIG_KEY,
73
73
  };
74
74
 
75
- /* Vueless system non-props defaults */
76
- export const SYSTEM_NON_PROPS_DEFAULTS = ["library", "style", "weight"];
75
+ /* UIcon non-props defaults */
76
+ export const ICON_NON_PROPS_DEFAULTS = ["library", "path", "style", "weight"];
77
77
 
78
78
  /* Component to folder mapping. */
79
79
  export const COMPONENTS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.589",
3
+ "version": "0.0.591",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -186,6 +186,11 @@ const { buttonAttrs, loaderAttrs, leftIconAttrs, rightIconAttrs, centerIconAttrs
186
186
  </template>
187
187
 
188
188
  <!-- This is needed to prevent changing button height -->
189
- <div v-if="!label || loading" tabindex="-1" class="invisible w-0" v-text="'invisible'" />
189
+ <div
190
+ v-if="(!label && !hasSlotContent(slots['default'])) || loading"
191
+ tabindex="-1"
192
+ class="invisible w-0"
193
+ v-text="'invisible'"
194
+ />
190
195
  </component>
191
196
  </template>
@@ -49,6 +49,7 @@ const dynamicComponent = computed(() => {
49
49
  const userLibrary = config.value.defaults.library as IconLibraries;
50
50
 
51
51
  const library = props.internal && isInternalIcon ? VUELESS_LIBRARY : userLibrary;
52
+ const customLibraryPath = config.value.defaults.path;
52
53
  const weight = config.value.defaults.weight;
53
54
  const style = config.value.defaults.style;
54
55
  const isFill = props.name?.endsWith(FILL_SUFFIX);
@@ -109,6 +110,13 @@ const dynamicComponent = computed(() => {
109
110
  ? import(/* @vite-ignore */ `node_modules/${library}/24/${fillType}/${name}.svg?component`)
110
111
  : import(/* @vite-ignore */ `/node_modules/${library}/24/${fillType}/${name}.svg?component`);
111
112
  },
113
+ "custom-icons": async () => {
114
+ return import.meta.env.PROD
115
+ ? await getIcon([library, name])
116
+ : isSSR
117
+ ? import(/* @vite-ignore */ `${customLibraryPath}/${name}.svg?component`)
118
+ : import(/* @vite-ignore */ `/${customLibraryPath}/${name}.svg?component`);
119
+ },
112
120
  };
113
121
  /* eslint-enable prettier/prettier */
114
122
 
@@ -38,6 +38,7 @@ export default /*tw*/ {
38
38
  interactive: false,
39
39
  /* icon library */
40
40
  library: "@material-symbols",
41
+ path: "", // set for `custom-icons` library only.
41
42
  style: "outlined",
42
43
  weight: 500,
43
44
  },
@@ -7,7 +7,12 @@ import type { Props as TippyProps } from "tippy.js";
7
7
 
8
8
  export type Config = typeof defaultConfig;
9
9
 
10
- export type IconLibraries = "vueless" | "@material-symbols" | "bootstrap-icons" | "heroicons";
10
+ export type IconLibraries =
11
+ | "vueless"
12
+ | "@material-symbols"
13
+ | "bootstrap-icons"
14
+ | "heroicons"
15
+ | "custom-icons";
11
16
 
12
17
  export interface Props {
13
18
  /**
@@ -24,6 +24,7 @@ export default /*tw*/ {
24
24
  xl: "text-xl",
25
25
  "2xl": "text-2xl",
26
26
  "3xl": "text-3xl",
27
+ "4xl": "text-4xl",
27
28
  },
28
29
  planned: {
29
30
  true: "opacity-75 before:content-['('] after:content-[')']",
@@ -43,6 +44,7 @@ export default /*tw*/ {
43
44
  xl: "text-lg",
44
45
  "2xl": "text-xl",
45
46
  "3xl": "text-2xl",
47
+ "4xl": "text-3xl",
46
48
  },
47
49
  },
48
50
  },
@@ -261,6 +261,7 @@ function copyIcon(name, defaults) {
261
261
  * @returns {source: string, destination: string}
262
262
  */
263
263
  function getIconLibraryPaths(name, defaults) {
264
+ const customLibraryPath = defaults.path;
264
265
  const library = defaults.library;
265
266
  const weight = defaults.weight;
266
267
  const style = defaults.style;
@@ -283,7 +284,11 @@ function getIconLibraryPaths(name, defaults) {
283
284
  "heroicons": {
284
285
  source: `${cwd}/node_modules/${library}/24/${name.endsWith("-fill") ? "solid" : "outline"}/${name}.svg`,
285
286
  destination: `${cacheIconsPath}/${library}/24/${style}/${name.endsWith("-fill") ? "solid" : "outline"}/${name}.svg`
286
- }
287
+ },
288
+ "custom-icons": {
289
+ source: `${cwd}/${customLibraryPath}/${name}.svg`,
290
+ destination: `${cacheIconsPath}/${library}/${name}.svg`
291
+ },
287
292
  };
288
293
  /* eslint-enable prettier/prettier, vue/max-len */
289
294
 
package/utils/ui.ts CHANGED
@@ -3,12 +3,13 @@ import { defineConfig } from "cva";
3
3
  import { extendTailwindMerge } from "tailwind-merge";
4
4
  import { cloneDeep, isCSR, isSSR } from "./helper.ts";
5
5
  import { createGetMergedConfig } from "./node/mergeConfigs.js";
6
+ import { UIcon } from "../ui.image-icon/constants.ts";
6
7
  import {
7
8
  BRAND_COLOR,
8
9
  GRAYSCALE_COLOR,
9
10
  DEFAULT_BRAND_COLOR,
11
+ ICON_NON_PROPS_DEFAULTS,
10
12
  TAILWIND_MERGE_EXTENSION,
11
- SYSTEM_NON_PROPS_DEFAULTS,
12
13
  NESTED_COMPONENT_PATTERN_REG_EXP,
13
14
  } from "../constants.js";
14
15
 
@@ -110,8 +111,9 @@ export function getDefaults<Props, Config>(defaultConfig: Config, name: Componen
110
111
  /* Remove non a props defaults. */
111
112
  for (const key in defaults) {
112
113
  const isNonPropIcon = /Icon/.test(key) && !/(leftIcon|rightIcon)/.test(key);
114
+ const isNonPropIconDefaults = ICON_NON_PROPS_DEFAULTS.includes(key) && name === UIcon;
113
115
 
114
- if (SYSTEM_NON_PROPS_DEFAULTS.includes(key) || isNonPropIcon) {
116
+ if (isNonPropIcon || isNonPropIconDefaults) {
115
117
  delete defaults[key];
116
118
  }
117
119
  }
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.589",
4
+ "version": "0.0.591",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",