vueless 0.0.629 → 0.0.630

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
@@ -21,7 +21,9 @@ export const DEFAULT_RING = 4; /* pixels */
21
21
  export const DEFAULT_RING_OFFSET = 0; /* pixels */
22
22
  export const DEFAULT_RING_OFFSET_COLOR_LIGHT = "#ffffff"; // white
23
23
  export const DEFAULT_RING_OFFSET_COLOR_DARK = "#111827"; // gray-900
24
+ export const DEFAULT_ROUNDING_SM = 4; /* pixels */
24
25
  export const DEFAULT_ROUNDING = 8; /* pixels */
26
+ export const DEFAULT_ROUNDING_LG = 16; /* pixels */
25
27
 
26
28
  /* Vueless supported colors and shades */
27
29
  export const COLOR_SHADES = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
@@ -171,21 +173,21 @@ export const TAILWIND_MERGE_EXTENSION = {
171
173
  "ring-offset-w": [{ "ring-offset": ["dynamic"] }],
172
174
  "ring-offset-color": [{ "ring-offset": ["color-dynamic"] }],
173
175
  "font-size": [{ text: ["2xs"] }],
174
- rounded: [{ rounded: ["dynamic", "inherit"] }],
175
- "rounded-s": [{ "rounded-s": ["dynamic", "inherit"] }],
176
- "rounded-e": [{ "rounded-e": ["dynamic", "inherit"] }],
177
- "rounded-t": [{ "rounded-t": ["dynamic", "inherit"] }],
178
- "rounded-r": [{ "rounded-r": ["dynamic", "inherit"] }],
179
- "rounded-b": [{ "rounded-b": ["dynamic", "inherit"] }],
180
- "rounded-l": [{ "rounded-l": ["dynamic", "inherit"] }],
181
- "rounded-ss": [{ "rounded-ss": ["dynamic", "inherit"] }],
182
- "rounded-se": [{ "rounded-se": ["dynamic", "inherit"] }],
183
- "rounded-ee": [{ "rounded-ee": ["dynamic", "inherit"] }],
184
- "rounded-es": [{ "rounded-es": ["dynamic", "inherit"] }],
185
- "rounded-tl": [{ "rounded-tl": ["dynamic", "inherit"] }],
186
- "rounded-tr": [{ "rounded-tr": ["dynamic", "inherit"] }],
187
- "rounded-br": [{ "rounded-br": ["dynamic", "inherit"] }],
188
- "rounded-bl": [{ "rounded-bl": ["dynamic", "inherit"] }],
176
+ rounded: [{ rounded: ["dynamic", "dynamic-sm", "dynamic-lg", "inherit"] }],
177
+ "rounded-s": [{ "rounded-s": ["dynamic", "dynamic-sm", "dynamic-lg", "inherit"] }],
178
+ "rounded-e": [{ "rounded-e": ["dynamic", "dynamic-sm", "dynamic-lg", "inherit"] }],
179
+ "rounded-t": [{ "rounded-t": ["dynamic", "dynamic-sm", "dynamic-lg", "inherit"] }],
180
+ "rounded-r": [{ "rounded-r": ["dynamic", "dynamic-sm", "dynamic-lg", "inherit"] }],
181
+ "rounded-b": [{ "rounded-b": ["dynamic", "dynamic-sm", "dynamic-lg", "inherit"] }],
182
+ "rounded-l": [{ "rounded-l": ["dynamic", "dynamic-sm", "dynamic-lg", "inherit"] }],
183
+ "rounded-ss": [{ "rounded-ss": ["dynamic", "dynamic-sm", "dynamic-lg", "inherit"] }],
184
+ "rounded-se": [{ "rounded-se": ["dynamic", "dynamic-sm", "dynamic-lg", "inherit"] }],
185
+ "rounded-ee": [{ "rounded-ee": ["dynamic", "dynamic-sm", "dynamic-lg", "inherit"] }],
186
+ "rounded-es": [{ "rounded-es": ["dynamic", "dynamic-sm", "dynamic-lg", "inherit"] }],
187
+ "rounded-tl": [{ "rounded-tl": ["dynamic", "dynamic-sm", "dynamic-lg", "inherit"] }],
188
+ "rounded-tr": [{ "rounded-tr": ["dynamic", "dynamic-sm", "dynamic-lg", "inherit"] }],
189
+ "rounded-br": [{ "rounded-br": ["dynamic", "dynamic-sm", "dynamic-lg", "inherit"] }],
190
+ "rounded-bl": [{ "rounded-bl": ["dynamic", "dynamic-sm", "dynamic-lg", "inherit"] }],
189
191
  },
190
192
  },
191
193
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.629",
3
+ "version": "0.0.630",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -27,13 +27,13 @@
27
27
  "access": "public"
28
28
  },
29
29
  "scripts": {
30
- "pre:start": "npx @vueless/web-types && node .scripts/icons",
30
+ "pre:start": "npx node .scripts/icons",
31
31
  "dev:docs": "npm run pre:start && storybook dev -p 6006 --docs --no-open",
32
32
  "dev": "npm run pre:start && STORYBOOK_FULL=1 storybook dev -p 6006 --no-open",
33
33
  "build": "npm run pre:start && storybook build --docs",
34
34
  "preview": "vite preview --host --outDir=storybook-static",
35
35
  "ts:check": "vue-tsc --build --force",
36
- "release:prepare": "npm run pre:start && rm -rf dist && mkdir -p dist && cp -r src/. package.json LICENSE README.md node_modules/.cache/vueless/web-types.json dist/ && node .scripts/package",
36
+ "release:prepare": "npm run pre:start && rm -rf dist && mkdir -p dist && cp -r src/. package.json LICENSE README.md dist/",
37
37
  "release:beta": "release-it --ci --npm.publish --preRelease=beta --increment=prerelease",
38
38
  "release:patch": "release-it patch --ci --npm.publish",
39
39
  "release:minor": "release-it minor --ci --npm.publish --git.tag --github.release",
@@ -66,8 +66,7 @@
66
66
  "@vue/eslint-config-prettier": "^10.0.0",
67
67
  "@vue/eslint-config-typescript": "^14.1.1",
68
68
  "@vue/tsconfig": "^0.5.1",
69
- "@vueless/storybook": "^0.0.53",
70
- "@vueless/web-types": "^0.0.21",
69
+ "@vueless/storybook": "^0.0.54",
71
70
  "autoprefixer": "^10.4.19",
72
71
  "cssnano": "^6.1.2",
73
72
  "eslint": "^9.12.0",
package/plugin-vite.js CHANGED
@@ -11,6 +11,7 @@ import { createTailwindSafelist, clearTailwindSafelist } from "./utils/node/tail
11
11
  import { getNuxtFiles, getVueFiles } from "./utils/node/helper.js";
12
12
  import { componentResolver, directiveResolver } from "./utils/node/vuelessResolver.js";
13
13
  import { setCustomPropTypes, removeCustomPropTypes } from "./utils/node/dynamicProps.js";
14
+ import { buildWebTypes } from "./utils/node/webTypes.js";
14
15
 
15
16
  /* Automatically importing Vueless components on demand */
16
17
  export const VuelessUnpluginComponents = (options) =>
@@ -66,6 +67,10 @@ export const Vueless = function (options = {}) {
66
67
  await createTailwindSafelist({ mode, env, debug, targetFiles });
67
68
  }
68
69
 
70
+ if ((config.command.includes("sb:") && mode === "storybook") || isVuelessEnv) {
71
+ await buildWebTypes();
72
+ }
73
+
69
74
  if (config.command === "build") {
70
75
  /* remove cached icons */
71
76
  await removeIconsCache(mirrorCacheDir, debug);
@@ -11,7 +11,9 @@ import {
11
11
  GRAY_COLOR,
12
12
  COOL_COLOR,
13
13
  DARK_MODE_SELECTOR,
14
+ DEFAULT_ROUNDING_SM,
14
15
  DEFAULT_ROUNDING,
16
+ DEFAULT_ROUNDING_LG,
15
17
  DEFAULT_RING,
16
18
  DEFAULT_RING_OFFSET,
17
19
  DEFAULT_RING_OFFSET_COLOR_LIGHT,
@@ -88,7 +90,9 @@ export const vuelessTailwindConfig = {
88
90
  },
89
91
  borderRadius: {
90
92
  inherit: "inherit",
93
+ "dynamic-sm": "var(--vl-rounding-sm)",
91
94
  dynamic: "var(--vl-rounding)",
95
+ "dynamic-lg": "var(--vl-rounding-lg)",
92
96
  },
93
97
  ringWidth: {
94
98
  dynamic: "var(--vl-ring)",
@@ -106,7 +110,9 @@ export const vuelessTailwindConfig = {
106
110
  "var(--vl-ring)": DEFAULT_RING,
107
111
  "var(--vl-ring-offset)": DEFAULT_RING_OFFSET,
108
112
  "var(--vl-ring-offset-color)": DEFAULT_RING_OFFSET_COLOR_LIGHT,
113
+ "var(--vl-rounding-sm)": DEFAULT_ROUNDING_SM,
109
114
  "var(--vl-rounding)": DEFAULT_ROUNDING,
115
+ "var(--vl-rounding-lg)": DEFAULT_ROUNDING_LG,
110
116
  ...getReplacementColors(GRAY_COLOR, grayColor),
111
117
  ...getReplacementColors(BRAND_COLOR, brandColor),
112
118
  },
package/types.ts CHANGED
@@ -77,11 +77,21 @@ export interface ThemeConfig {
77
77
  */
78
78
  gray?: GrayColors;
79
79
 
80
+ /**
81
+ * Default components "sm" size rounding (border-radius).
82
+ */
83
+ roundingSm?: number;
84
+
80
85
  /**
81
86
  * Default components rounding (border-radius).
82
87
  */
83
88
  rounding?: number;
84
89
 
90
+ /**
91
+ * Default components "lg" size rounding (border-radius).
92
+ */
93
+ roundingLg?: number;
94
+
85
95
  /**
86
96
  * Default components ring width.
87
97
  */
@@ -324,7 +334,9 @@ export interface VuelessCssVariables {
324
334
  "--vl-ring": string;
325
335
  "--vl-ring-offset": string;
326
336
  "--vl-ring-offset-color": string;
337
+ "--vl-rounding-sm": string;
327
338
  "--vl-rounding": string;
339
+ "--vl-rounding-lg": string;
328
340
  /* Gray CSS variables */
329
341
  "--vl-color-gray-50": string;
330
342
  "--vl-color-gray-100": string;
@@ -48,6 +48,12 @@ export default /*tw*/ {
48
48
  false: "no-underline",
49
49
  },
50
50
  color: {
51
+ gray: `
52
+ text-gray-500 decoration-gray-500
53
+ hover:text-gray-600 hover:decoration-gray-600
54
+ focus:text-gray-600 focus:decoration-gray-600
55
+ active:text-gray-700 active:decoration-gray-700
56
+ `,
51
57
  grayscale: `
52
58
  text-gray-900 decoration-gray-900
53
59
  hover:text-gray-800 hover:decoration-gray-800
@@ -9,6 +9,7 @@ export default /*tw*/ {
9
9
  base: "{UButton} font-normal !bg-{color}-600/15",
10
10
  defaults: {
11
11
  variant: "thirdary",
12
+ color: "brand",
12
13
  filled: true,
13
14
  },
14
15
  },
@@ -1,5 +1,5 @@
1
1
  export default /*tw*/ {
2
- wrapper: "p-4 md:p-5 border rounded-dynamic border-gray-200 bg-white space-y-4 w-full",
2
+ wrapper: "p-4 md:p-5 border rounded-dynamic-lg border-gray-200 bg-white space-y-4 w-full",
3
3
  header: "flex justify-between",
4
4
  headerLeft: "flex items-center gap-2 w-fit",
5
5
  headerLeftFallback: "flex flex-col w-fit",
@@ -2,7 +2,7 @@ export default /*tw*/ {
2
2
  checkboxLabel: "{ULabel}",
3
3
  checkbox: {
4
4
  base: `
5
- border rounded bg-white cursor-pointer transition checked:text-{color}-600
5
+ border rounded-dynamic-sm bg-white cursor-pointer transition checked:text-{color}-600
6
6
  border-gray-300 hover:border-gray-400 focus:border-{color}-500 active:border-{color}-800
7
7
  focus:ring-{color}-700/15 focus:ring-dynamic focus:ring-offset-dynamic
8
8
  disabled:border-gray-300 disabled:bg-gray-100 disabled:cursor-not-allowed
@@ -23,7 +23,7 @@ export default /*tw*/ {
23
23
  },
24
24
  iconWrapper: {
25
25
  base: `
26
- flex items-center justify-center absolute rounded cursor-pointer transition
26
+ flex items-center justify-center absolute rounded-dynamic-sm cursor-pointer transition
27
27
  bg-{color}-600 hover:bg-{color}-700 active:bg-{color}-800
28
28
  `,
29
29
  variants: {
@@ -66,7 +66,7 @@ export default /*tw*/ {
66
66
  ],
67
67
  },
68
68
  description: {
69
- base: "font-normal text-gray-500 text-left !leading-none",
69
+ base: "font-normal text-gray-500 text-left !leading-tight",
70
70
  variants: {
71
71
  size: {
72
72
  sm: "text-2xs",
@@ -74,21 +74,16 @@ export default /*tw*/ {
74
74
  lg: "text-sm",
75
75
  },
76
76
  align: {
77
- top: "pl-0 -mt-0.5",
78
- topInside: "pl-3",
79
- topWithDesc: "pt-1",
80
- left: "pt-1 pl-0",
81
- right: "pt-1 pl-0",
77
+ top: "pl-3",
78
+ topInside: "pl-3 mt-1.5",
79
+ topWithDesc: "pt-0.5",
80
+ left: "pt-0.5",
81
+ right: "pt-0.5",
82
82
  },
83
83
  error: {
84
84
  true: "text-red-500",
85
85
  },
86
86
  },
87
- compoundVariants: [
88
- { align: "topInside", size: "sm", class: "mt-1.5" },
89
- { align: "topInside", size: "md", class: "mt-2" },
90
- { align: "topInside", size: "lg", class: "mt-2.5" },
91
- ],
92
87
  },
93
88
  defaults: {
94
89
  align: "top",
@@ -90,7 +90,7 @@ export default /*tw*/ {
90
90
  ],
91
91
  },
92
92
  toggle: "{>caret} mr-3",
93
- toggleIcon: "{UIcon} {>selectIcon}",
93
+ toggleIcon: "{UIcon} {>selectIcon} transition duration-300 group-[]/active:rotate-180",
94
94
  clear: "{>caret}",
95
95
  clearIcon: "{UIcon} {>selectIcon}",
96
96
  clearMultiple: "flex items-center",
@@ -0,0 +1,12 @@
1
+ import { vuelessConfig } from "./vuelessConfig.js";
2
+
3
+ export async function buildWebTypes() {
4
+ try {
5
+ const { default: build } = await import("@vueless/storybook/webTypes");
6
+
7
+ await build(vuelessConfig);
8
+ } catch (error) {
9
+ // eslint-disable-next-line no-console
10
+ console.warn(error);
11
+ }
12
+ }
package/utils/theme.ts CHANGED
@@ -9,7 +9,9 @@ import {
9
9
  GRAYSCALE_COLOR,
10
10
  DEFAULT_RING,
11
11
  DEFAULT_RING_OFFSET,
12
+ DEFAULT_ROUNDING_SM,
12
13
  DEFAULT_ROUNDING,
14
+ DEFAULT_ROUNDING_LG,
13
15
  DEFAULT_BRAND_COLOR,
14
16
  DEFAULT_GRAY_COLOR,
15
17
  DEFAULT_RING_OFFSET_COLOR_LIGHT,
@@ -98,7 +100,9 @@ export function setColorMode(colorMode: `${ColorMode}`) {
98
100
  export function setTheme(config: Config = {}) {
99
101
  setColorMode(config?.colorMode || vuelessConfig?.colorMode || ColorMode.Auto);
100
102
 
103
+ const roundingSm = config?.roundingSm ?? vuelessConfig?.roundingSm ?? DEFAULT_ROUNDING_SM;
101
104
  const rounding = config?.rounding ?? vuelessConfig.rounding ?? DEFAULT_ROUNDING;
105
+ const roundingLg = config?.roundingLg ?? vuelessConfig?.roundingLg ?? DEFAULT_ROUNDING_LG;
102
106
  const isDarkMode = document.documentElement.classList.contains(DARK_MODE_SELECTOR);
103
107
 
104
108
  let brand: BrandColors | GrayColors | typeof GRAY_COLOR =
@@ -148,7 +152,9 @@ export function setTheme(config: Config = {}) {
148
152
  const colors: DefaultColors = merge(tailwindColors, tailwindConfig?.theme?.extend?.colors || {});
149
153
 
150
154
  const variables: Partial<VuelessCssVariables> = {
155
+ "--vl-rounding-sm": `${Number(roundingSm) / PX_IN_REM}rem`,
151
156
  "--vl-rounding": `${Number(rounding) / PX_IN_REM}rem`,
157
+ "--vl-rounding-lg": `${Number(roundingLg) / PX_IN_REM}rem`,
152
158
  "--vl-ring": `${ring}px`,
153
159
  "--vl-ring-offset": `${ringOffset}px`,
154
160
  "--vl-ring-offset-color": convertHexInRgb(defaultRingOffsetColor),