vueless 0.0.472 → 0.0.474

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
@@ -13,6 +13,8 @@ export const DEFAULT_BRAND_COLOR = GRAYSCALE_COLOR;
13
13
  export const DEFAULT_GRAY_COLOR = COOL_COLOR;
14
14
  export const DEFAULT_RING = 4; /* pixels */
15
15
  export const DEFAULT_RING_OFFSET = 0; /* pixels */
16
+ export const DEFAULT_RING_OFFSET_COLOR_LIGHT = "#ffffff"; // white
17
+ export const DEFAULT_RING_OFFSET_COLOR_DARK = "#4b5563"; // gray-600
16
18
  export const DEFAULT_ROUNDING = 8; /* pixels */
17
19
 
18
20
  /* Vueless supported colors and shades */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.472",
3
+ "version": "0.0.474",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -9,6 +9,7 @@ import {
9
9
  DEFAULT_ROUNDING,
10
10
  DEFAULT_RING,
11
11
  DEFAULT_RING_OFFSET,
12
+ DEFAULT_RING_OFFSET_COLOR_LIGHT,
12
13
  } from "./constants.js";
13
14
 
14
15
  const isStrategyOverride = process.env.VUELESS_STRATEGY === "override";
@@ -81,10 +82,9 @@ export const vuelessTailwindConfig = {
81
82
  ringOffsetWidth: {
82
83
  dynamic: "var(--vl-ring-offset)",
83
84
  },
84
- // TODO: Add this feature
85
- // ringOffsetColor: {
86
- // dynamic: "var(--vl-ring-offset-color)",
87
- // },
85
+ ringOffsetColor: {
86
+ dynamic: "var(--vl-ring-offset-color)",
87
+ },
88
88
  borderRadius: {
89
89
  dynamic: "var(--vl-rounding)",
90
90
  },
@@ -94,6 +94,7 @@ export const vuelessTailwindConfig = {
94
94
  // TODO: Set colors from vueless.config.{js|ts} if it present.
95
95
  "var(--vl-ring)": DEFAULT_RING,
96
96
  "var(--vl-ring-offset)": DEFAULT_RING_OFFSET,
97
+ "var(--vl-ring-offset-color)": DEFAULT_RING_OFFSET_COLOR_LIGHT,
97
98
  "var(--vl-rounding)": DEFAULT_ROUNDING,
98
99
  ...getReplacementColors(GRAY_COLOR, GRAY_COLOR),
99
100
  ...getReplacementColors(BRAND_COLOR, GRAY_COLOR),
@@ -1,5 +1,14 @@
1
1
  <template>
2
- <div :data-test="dataTest" v-bind="wrapperAttrs">
2
+ <ULabel
3
+ :label="label"
4
+ :description="description"
5
+ :disabled="disabled"
6
+ :error="error"
7
+ :size="size"
8
+ :align="labelAlign"
9
+ :data-test="dataTest"
10
+ v-bind="labelAttrs"
11
+ >
3
12
  <UButton
4
13
  variant="thirdary"
5
14
  size="sm"
@@ -22,7 +31,6 @@
22
31
 
23
32
  <div v-bind="numberAttrs">
24
33
  <div v-bind="valueAttrs" v-text="count" />
25
- <div v-bind="labelAttrs" v-text="label" />
26
34
  </div>
27
35
 
28
36
  <UButton
@@ -44,7 +52,7 @@
44
52
  v-bind="addIconAttrs"
45
53
  />
46
54
  </UButton>
47
- </div>
55
+ </ULabel>
48
56
  </template>
49
57
 
50
58
  <script setup>
@@ -52,6 +60,7 @@ import { computed } from "vue";
52
60
 
53
61
  import UIcon from "../ui.image-icon/UIcon.vue";
54
62
  import UButton from "../ui.button/UButton.vue";
63
+ import ULabel from "../ui.form-label/ULabel.vue";
55
64
  import { getDefault } from "../utils/utilUI.js";
56
65
 
57
66
  import defaultConfig from "./config.js";
@@ -74,7 +83,7 @@ const props = defineProps({
74
83
  */
75
84
  step: {
76
85
  type: Number,
77
- default: 1,
86
+ default: getDefault(defaultConfig, UInputNumber).step,
78
87
  },
79
88
 
80
89
  /**
@@ -82,7 +91,7 @@ const props = defineProps({
82
91
  */
83
92
  min: {
84
93
  type: Number,
85
- default: 1,
94
+ default: getDefault(defaultConfig, UInputNumber).min,
86
95
  },
87
96
 
88
97
  /**
@@ -90,7 +99,7 @@ const props = defineProps({
90
99
  */
91
100
  max: {
92
101
  type: Number,
93
- default: 999,
102
+ default: getDefault(defaultConfig, UInputNumber).max,
94
103
  },
95
104
 
96
105
  /**
@@ -176,7 +185,6 @@ const {
176
185
  removeIconAttrs,
177
186
  addButtonAttrs,
178
187
  addIconAttrs,
179
- wrapperAttrs,
180
188
  numberAttrs,
181
189
  } = useAttrs(props);
182
190
 
@@ -1,6 +1,9 @@
1
1
  export default /*tw*/ {
2
- wrapper: "flex items-center space-x-6",
3
- number: "flex items-center flex-col",
2
+ label: {
3
+ component: "{ULabel}",
4
+ content: "gap-6 items-center",
5
+ },
6
+ number: "",
4
7
  removeButton: "{UButton}",
5
8
  removeIcon: "{UIcon}",
6
9
  addButton: "{UButton}",
@@ -13,20 +16,18 @@ export default /*tw*/ {
13
16
  md: "text-base",
14
17
  lg: "text-lg",
15
18
  },
16
- },
17
- },
18
- label: {
19
- base: "pt-1 !leading-none text-gray-500",
20
- variants: {
21
- size: {
22
- sm: "text-xs",
23
- md: "text-sm",
24
- lg: "text-base",
19
+ disabled: {
20
+ true: "focus-within:ring-0 focus-within:ring-offset-0 pointer-events-none",
25
21
  },
26
22
  },
27
23
  },
28
24
  defaults: {
29
25
  size: "md",
26
+ labelAlign: "topWithDesc",
27
+ disabled: false,
28
+ step: 1,
29
+ min: 1,
30
+ max: 999,
30
31
  /* icons */
31
32
  removeIcon: "remove",
32
33
  addIcon: "add",
@@ -9,6 +9,8 @@ import {
9
9
  GRAYSCALE_COLOR,
10
10
  DEFAULT_RING,
11
11
  DEFAULT_RING_OFFSET,
12
+ DEFAULT_RING_OFFSET_COLOR_LIGHT,
13
+ DEFAULT_RING_OFFSET_COLOR_DARK,
12
14
  DEFAULT_ROUNDING,
13
15
  DEFAULT_BRAND_COLOR,
14
16
  DEFAULT_GRAY_COLOR,
@@ -33,6 +35,17 @@ export function setTheme(config = {}) {
33
35
  const isDarkMode = setDarkMode(config);
34
36
  const ring = config?.ring ?? vuelessConfig.ring ?? DEFAULT_RING;
35
37
  const ringOffset = config?.ringOffset ?? vuelessConfig.ringOffset ?? DEFAULT_RING_OFFSET;
38
+
39
+ const defaultRingOffsetColorDark =
40
+ config?.ringOffsetColorDark ??
41
+ vuelessConfig.ringOffsetColorDark ??
42
+ DEFAULT_RING_OFFSET_COLOR_DARK;
43
+
44
+ const defaultRingOffsetColorLight =
45
+ config?.ringOffsetColorLight ??
46
+ vuelessConfig.ringOffsetColorLight ??
47
+ DEFAULT_RING_OFFSET_COLOR_LIGHT;
48
+
36
49
  const rounding = config?.rounding ?? vuelessConfig.rounding ?? DEFAULT_ROUNDING;
37
50
  let brand = config?.brand ?? vuelessConfig.brand ?? DEFAULT_BRAND_COLOR;
38
51
  let gray = config?.gray ?? vuelessConfig.gray ?? DEFAULT_GRAY_COLOR;
@@ -52,6 +65,9 @@ export function setTheme(config = {}) {
52
65
 
53
66
  const defaultBrandShade = isDarkMode ? 400 : 600;
54
67
  const defaultGrayShade = isDarkMode ? 400 : 600;
68
+ const defaultRingOffsetColor = isDarkMode
69
+ ? defaultRingOffsetColorDark
70
+ : defaultRingOffsetColorLight;
55
71
 
56
72
  if (gray === COOL_COLOR) {
57
73
  gray = GRAY_COLOR;
@@ -64,6 +80,7 @@ export function setTheme(config = {}) {
64
80
  const variables = {
65
81
  "--vl-ring": `${ring}px`,
66
82
  "--vl-ring-offset": `${ringOffset}px`,
83
+ "--vl-ring-offset-color": `rgb(${convertHexInRgb(defaultRingOffsetColor)})`,
67
84
  "--vl-rounding": `${Number(rounding) / PX_IN_REM}rem`,
68
85
  "--vl-color-gray-default": convertHexInRgb(colors[gray][defaultBrandShade]),
69
86
  "--vl-color-brand-default": convertHexInRgb(colors[brand][defaultGrayShade]),
package/utils/utilUI.js CHANGED
@@ -55,6 +55,7 @@ const twMerge = extendTailwindMerge(
55
55
  classGroups: {
56
56
  "ring-w": [{ ring: ["dynamic"] }],
57
57
  "ring-offset-w": [{ "ring-offset": ["dynamic"] }],
58
+ "ring-offset-color": [{ "ring-offset": ["dynamic"] }],
58
59
  "font-size": [{ text: ["2xs"] }],
59
60
  rounded: [{ rounded: ["dynamic"] }],
60
61
  },
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.472",
4
+ "version": "0.0.474",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -5351,7 +5351,7 @@
5351
5351
  "kind": "expression",
5352
5352
  "type": "'top' | 'topWithDesc' | 'left' | 'right'"
5353
5353
  },
5354
- "default": "getDefault(defaultConfig, UInputNumber).labelAlign"
5354
+ "default": "topWithDesc"
5355
5355
  },
5356
5356
  {
5357
5357
  "name": "description",
@@ -5387,7 +5387,7 @@
5387
5387
  "kind": "expression",
5388
5388
  "type": "boolean"
5389
5389
  },
5390
- "default": "getDefault(defaultConfig, UInputNumber).disabled"
5390
+ "default": "false"
5391
5391
  },
5392
5392
  {
5393
5393
  "name": "config",