@cyberpunk-vue/components 1.13.11 → 1.13.12

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/dist/index.mjs CHANGED
@@ -155,7 +155,7 @@ var ye = {
155
155
  },
156
156
  strokeWidth: {
157
157
  type: Number,
158
- default: 4
158
+ default: void 0
159
159
  },
160
160
  variant: {
161
161
  type: String,
@@ -180,20 +180,29 @@ var ye = {
180
180
  sm: 24,
181
181
  md: 40,
182
182
  lg: 56
183
- }, l = r(() => X(n.size, c, c.md)), u = r(() => n.strokeWidth * (De / l.value)), d = r(() => (De - u.value) / 2), f = r(() => n.strokeWidth * (Oe / l.value)), p = r(() => -(Oe / 2) + f.value / 2 + 2.5), m = r(() => -(Oe / 2) + f.value / 2 + Oe / 4 + 2.5), h = r(() => [
183
+ }, l = r(() => X(n.size, c, c.md)), u = r(() => n.strokeWidth ?? l.value * .1), d = r(() => u.value * (De / l.value)), f = r(() => (De - d.value) / 2), p = r(() => {
184
+ let e = 2 * Math.PI * f.value, t = Math.max(d.value * 1.25, e * .06), n = e * .8;
185
+ return {
186
+ "--cp-loading-circle-dash-min": `${t}px`,
187
+ "--cp-loading-circle-dash-max": `${n}px`,
188
+ "--cp-loading-circle-gap": `${e}px`,
189
+ "--cp-loading-circle-offset-mid": `${e * -.12}px`,
190
+ "--cp-loading-circle-offset-end": `${-(e + t)}px`
191
+ };
192
+ }), m = r(() => u.value * (Oe / l.value)), h = r(() => -(Oe / 2) + m.value / 2 + 2.5), g = r(() => -(Oe / 2) + m.value / 2 + Oe / 4 + 2.5), _ = r(() => [
184
193
  i.b(),
185
194
  i.m(n.type),
186
195
  i.m(n.variant),
187
196
  q(n.size) && i.m(n.size),
188
197
  i.is("custom-color", !!n.color),
189
198
  i.is("custom-size", !q(n.size))
190
- ]), g = r(() => {
199
+ ]), v = r(() => {
191
200
  let e = {};
192
- return n.color && (e["--cp-loading-color"] = n.color), e["--cp-loading-stroke-width"] = `${n.strokeWidth}px`, q(n.size) || (e["--cp-loading-size"] = Y(n.size, c)), e;
201
+ return n.color && (e["--cp-loading-color"] = n.color), e["--cp-loading-stroke-width"] = `${u.value}px`, q(n.size) || (e["--cp-loading-size"] = Y(n.size, c)), e;
193
202
  });
194
203
  return (t, n) => (T(), o("div", {
195
- class: b(h.value),
196
- style: S(g.value)
204
+ class: b(_.value),
205
+ style: S(v.value)
197
206
  }, [t.variant === "circular" ? (T(), o("svg", {
198
207
  key: 0,
199
208
  class: b([R(i).e("svg"), R(i).is("circular")]),
@@ -202,23 +211,24 @@ var ye = {
202
211
  class: b(R(i).e("circle")),
203
212
  cx: "44",
204
213
  cy: "44",
205
- r: d.value,
214
+ r: f.value,
206
215
  fill: "none",
207
- "stroke-width": u.value,
216
+ "stroke-width": d.value,
208
217
  stroke: "currentColor",
209
- "stroke-linecap": "round"
210
- }, null, 10, Se)], 2)) : t.variant === "spinner" ? (T(), o("svg", {
218
+ "stroke-linecap": "round",
219
+ style: S(p.value)
220
+ }, null, 14, Se)], 2)) : t.variant === "spinner" ? (T(), o("svg", {
211
221
  key: 1,
212
222
  class: b([R(i).e("svg"), R(i).is("spinner")]),
213
223
  viewBox: "0 0 50 50"
214
224
  }, [s("g", Ce, [(T(), o(e, null, A(12, (e) => s("line", {
215
225
  key: e,
216
226
  x1: "0",
217
- y1: p.value,
227
+ y1: h.value,
218
228
  x2: "0",
219
- y2: m.value,
229
+ y2: g.value,
220
230
  transform: `rotate(${(e - 1) * 30})`,
221
- "stroke-width": f.value,
231
+ "stroke-width": m.value,
222
232
  stroke: "currentColor",
223
233
  "stroke-linecap": "round",
224
234
  style: S({ opacity: e === 1 ? 1 : (e - 1) / 12 })
@@ -229,11 +239,11 @@ var ye = {
229
239
  }, [s("g", Te, [(T(), o(e, null, A(12, (e) => s("line", {
230
240
  key: e,
231
241
  x1: "0",
232
- y1: p.value,
242
+ y1: h.value,
233
243
  x2: "0",
234
- y2: m.value,
244
+ y2: g.value,
235
245
  transform: `rotate(${(e - 1) * 30})`,
236
- "stroke-width": f.value,
246
+ "stroke-width": m.value,
237
247
  stroke: "currentColor",
238
248
  "stroke-linecap": "round"
239
249
  }, null, 8, Ee)), 64))])], 2)) : a("", !0)], 6));
@@ -27,7 +27,7 @@ export declare const CpLoading: import('../utils').SFCWithInstall<import('vue').
27
27
  };
28
28
  readonly strokeWidth: {
29
29
  readonly type: NumberConstructor;
30
- readonly default: 4;
30
+ readonly default: undefined;
31
31
  };
32
32
  readonly variant: {
33
33
  readonly type: import('vue').PropType<import('.').LoadingVariant>;
@@ -48,7 +48,7 @@ export declare const CpLoading: import('../utils').SFCWithInstall<import('vue').
48
48
  };
49
49
  readonly strokeWidth: {
50
50
  readonly type: NumberConstructor;
51
- readonly default: 4;
51
+ readonly default: undefined;
52
52
  };
53
53
  readonly variant: {
54
54
  readonly type: import('vue').PropType<import('.').LoadingVariant>;
@@ -76,13 +76,13 @@ export declare const loadingProps: {
76
76
  };
77
77
  /**
78
78
  * SVG 描边宽度
79
- * 数值越大,圆环越粗
80
- * @default 4
79
+ * 未传入时按实际尺寸自动生成,约为 size 的 10%
80
+ * @default undefined
81
81
  * @example `<CpLoading :stroke-width="2" />`
82
82
  */
83
83
  readonly strokeWidth: {
84
84
  readonly type: NumberConstructor;
85
- readonly default: 4;
85
+ readonly default: undefined;
86
86
  };
87
87
  /**
88
88
  * 加载器变体
@@ -13,7 +13,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
13
13
  };
14
14
  readonly strokeWidth: {
15
15
  readonly type: NumberConstructor;
16
- readonly default: 4;
16
+ readonly default: undefined;
17
17
  };
18
18
  readonly variant: {
19
19
  readonly type: import('vue').PropType<import('./loading').LoadingVariant>;
@@ -34,7 +34,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
34
34
  };
35
35
  readonly strokeWidth: {
36
36
  readonly type: NumberConstructor;
37
- readonly default: 4;
37
+ readonly default: undefined;
38
38
  };
39
39
  readonly variant: {
40
40
  readonly type: import('vue').PropType<import('./loading').LoadingVariant>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyberpunk-vue/components",
3
- "version": "1.13.11",
3
+ "version": "1.13.12",
4
4
  "description": "Cyberpunk Vue components - A futuristic Vue 3 component library",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -25,9 +25,9 @@
25
25
  "dependencies": {
26
26
  "@floating-ui/dom": "^1.7.6",
27
27
  "dayjs": "^1.11.20",
28
- "@cyberpunk-vue/hooks": "1.13.11",
29
- "@cyberpunk-vue/constants": "1.13.11",
30
- "@cyberpunk-vue/theme-chalk": "1.13.11"
28
+ "@cyberpunk-vue/theme-chalk": "1.13.12",
29
+ "@cyberpunk-vue/hooks": "1.13.12",
30
+ "@cyberpunk-vue/constants": "1.13.12"
31
31
  },
32
32
  "author": "Juxest",
33
33
  "license": "MIT",