common_component_library_vue 0.1.0
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/DESIGN.md +487 -0
- package/README.md +100 -0
- package/dist-lib/common-component-library-vue.css +2 -0
- package/dist-lib/common-component-library-vue.mjs +818 -0
- package/dist-lib/common-component-library-vue.umd.js +1 -0
- package/dist-lib/favicon.svg +1 -0
- package/dist-lib/icons.svg +24 -0
- package/dist-lib/types/components/Alert/CcAlert.vue.d.ts +24 -0
- package/dist-lib/types/components/Badge/CcBadge.vue.d.ts +17 -0
- package/dist-lib/types/components/Button/CcButton.vue.d.ts +43 -0
- package/dist-lib/types/components/Card/CcCard.vue.d.ts +39 -0
- package/dist-lib/types/components/Checkbox/CcCheckbox.vue.d.ts +31 -0
- package/dist-lib/types/components/Divider/CcDivider.vue.d.ts +26 -0
- package/dist-lib/types/components/Input/CcInput.vue.d.ts +47 -0
- package/dist-lib/types/components/Modal/CcModal.vue.d.ts +42 -0
- package/dist-lib/types/components/Radio/CcRadio.vue.d.ts +34 -0
- package/dist-lib/types/components/Select/CcSelect.vue.d.ts +33 -0
- package/dist-lib/types/components/Spinner/CcSpinner.vue.d.ts +16 -0
- package/dist-lib/types/components/Switch/CcSwitch.vue.d.ts +24 -0
- package/dist-lib/types/components/Tag/CcTag.vue.d.ts +37 -0
- package/dist-lib/types/components/Textarea/CcTextarea.vue.d.ts +34 -0
- package/dist-lib/types/components/Tooltip/CcTooltip.vue.d.ts +25 -0
- package/dist-lib/types/index.d.ts +725 -0
- package/package.json +73 -0
- package/src/styles/base.css +79 -0
- package/src/styles/tokens.css +104 -0
|
@@ -0,0 +1,818 @@
|
|
|
1
|
+
import { Fragment as e, Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, mergeModels as d, nextTick as ee, normalizeClass as f, normalizeStyle as p, onBeforeUnmount as m, onMounted as te, openBlock as h, ref as g, renderList as _, renderSlot as v, resolveDynamicComponent as y, toDisplayString as b, useCssVars as ne, useModel as x, vModelCheckbox as re, vModelRadio as ie, watch as S, withCtx as C, withDirectives as w, withModifiers as T } from "vue";
|
|
2
|
+
//#region src/components/Spinner/CcSpinner.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var ae = ["width", "height"], oe = /*@__PURE__*/ u({
|
|
4
|
+
__name: "CcSpinner",
|
|
5
|
+
props: {
|
|
6
|
+
size: { default: 20 },
|
|
7
|
+
color: { default: "var(--cc-primary)" }
|
|
8
|
+
},
|
|
9
|
+
setup(e) {
|
|
10
|
+
return ne((e) => ({ f2187a8a: e.color })), (t, n) => (h(), o("svg", {
|
|
11
|
+
class: "cc-spinner",
|
|
12
|
+
width: e.size,
|
|
13
|
+
height: e.size,
|
|
14
|
+
viewBox: "0 0 24 24",
|
|
15
|
+
fill: "none",
|
|
16
|
+
role: "status",
|
|
17
|
+
"aria-label": "loading"
|
|
18
|
+
}, [...n[0] ||= [s("circle", {
|
|
19
|
+
class: "cc-spinner__track",
|
|
20
|
+
cx: "12",
|
|
21
|
+
cy: "12",
|
|
22
|
+
r: "10",
|
|
23
|
+
stroke: "currentColor",
|
|
24
|
+
"stroke-opacity": "0.15",
|
|
25
|
+
"stroke-width": "3"
|
|
26
|
+
}, null, -1), s("path", {
|
|
27
|
+
class: "cc-spinner__arc",
|
|
28
|
+
d: "M12 2a10 10 0 0 1 10 10",
|
|
29
|
+
stroke: "currentColor",
|
|
30
|
+
"stroke-width": "3",
|
|
31
|
+
"stroke-linecap": "round"
|
|
32
|
+
}, null, -1)]], 8, ae));
|
|
33
|
+
}
|
|
34
|
+
}), E = (e, t) => {
|
|
35
|
+
let n = e.__vccOpts || e;
|
|
36
|
+
for (let [e, r] of t) n[e] = r;
|
|
37
|
+
return n;
|
|
38
|
+
}, D = /*#__PURE__*/ E(oe, [["__scopeId", "data-v-00c109fa"]]), se = {
|
|
39
|
+
key: 0,
|
|
40
|
+
class: "cc-btn__spinner"
|
|
41
|
+
}, ce = { class: "cc-btn__content" }, O = /*#__PURE__*/ E(/* @__PURE__ */ u({
|
|
42
|
+
__name: "CcButton",
|
|
43
|
+
props: {
|
|
44
|
+
variant: { default: "primary" },
|
|
45
|
+
size: { default: "md" },
|
|
46
|
+
disabled: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: !1
|
|
49
|
+
},
|
|
50
|
+
loading: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: !1
|
|
53
|
+
},
|
|
54
|
+
href: { default: void 0 },
|
|
55
|
+
target: { default: void 0 },
|
|
56
|
+
block: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: !1
|
|
59
|
+
},
|
|
60
|
+
type: { default: "button" },
|
|
61
|
+
ariaLabel: { default: void 0 }
|
|
62
|
+
},
|
|
63
|
+
emits: ["click"],
|
|
64
|
+
setup(e, { emit: t }) {
|
|
65
|
+
let n = e, c = t, u = r(() => n.variant === "primary" || n.variant === "on-dark" ? "var(--cc-on-primary)" : "var(--cc-primary)");
|
|
66
|
+
function d(e) {
|
|
67
|
+
if (n.disabled || n.loading) {
|
|
68
|
+
e.preventDefault();
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
c("click", e);
|
|
72
|
+
}
|
|
73
|
+
return (t, n) => (h(), i(y(e.href ? "a" : "button"), {
|
|
74
|
+
class: f(["cc-btn", [
|
|
75
|
+
`cc-btn--${e.variant}`,
|
|
76
|
+
`cc-btn--${e.size}`,
|
|
77
|
+
{
|
|
78
|
+
"cc-btn--block": e.block,
|
|
79
|
+
"cc-btn--loading": e.loading
|
|
80
|
+
}
|
|
81
|
+
]]),
|
|
82
|
+
href: e.href || void 0,
|
|
83
|
+
target: e.href ? e.target : void 0,
|
|
84
|
+
type: e.href ? void 0 : e.type,
|
|
85
|
+
disabled: e.href ? void 0 : e.disabled || e.loading,
|
|
86
|
+
"aria-label": e.ariaLabel,
|
|
87
|
+
"aria-busy": e.loading,
|
|
88
|
+
onClick: d
|
|
89
|
+
}, {
|
|
90
|
+
default: C(() => [e.loading ? (h(), o("span", se, [l(D, {
|
|
91
|
+
size: e.size === "sm" ? 14 : 16,
|
|
92
|
+
color: u.value
|
|
93
|
+
}, null, 8, ["size", "color"])])) : a("", !0), s("span", ce, [v(t.$slots, "default", {}, void 0, !0)])]),
|
|
94
|
+
_: 3
|
|
95
|
+
}, 8, [
|
|
96
|
+
"class",
|
|
97
|
+
"href",
|
|
98
|
+
"target",
|
|
99
|
+
"type",
|
|
100
|
+
"disabled",
|
|
101
|
+
"aria-label",
|
|
102
|
+
"aria-busy"
|
|
103
|
+
]));
|
|
104
|
+
}
|
|
105
|
+
}), [["__scopeId", "data-v-deb42261"]]), le = ["for"], ue = {
|
|
106
|
+
key: 0,
|
|
107
|
+
class: "cc-input__prefix tnum"
|
|
108
|
+
}, de = [
|
|
109
|
+
"id",
|
|
110
|
+
"type",
|
|
111
|
+
"value",
|
|
112
|
+
"name",
|
|
113
|
+
"placeholder",
|
|
114
|
+
"disabled",
|
|
115
|
+
"readonly",
|
|
116
|
+
"autocomplete",
|
|
117
|
+
"inputmode",
|
|
118
|
+
"min",
|
|
119
|
+
"max",
|
|
120
|
+
"step",
|
|
121
|
+
"aria-invalid"
|
|
122
|
+
], fe = {
|
|
123
|
+
key: 1,
|
|
124
|
+
class: "cc-input__message cc-input__message--error"
|
|
125
|
+
}, pe = {
|
|
126
|
+
key: 2,
|
|
127
|
+
class: "cc-input__message"
|
|
128
|
+
}, k = /*#__PURE__*/ E(/* @__PURE__ */ u({
|
|
129
|
+
__name: "CcInput",
|
|
130
|
+
props: {
|
|
131
|
+
modelValue: { default: "" },
|
|
132
|
+
label: { default: void 0 },
|
|
133
|
+
placeholder: { default: void 0 },
|
|
134
|
+
type: { default: "text" },
|
|
135
|
+
name: { default: void 0 },
|
|
136
|
+
disabled: {
|
|
137
|
+
type: Boolean,
|
|
138
|
+
default: !1
|
|
139
|
+
},
|
|
140
|
+
readonly: {
|
|
141
|
+
type: Boolean,
|
|
142
|
+
default: !1
|
|
143
|
+
},
|
|
144
|
+
error: { default: void 0 },
|
|
145
|
+
hint: { default: void 0 },
|
|
146
|
+
prefix: { default: void 0 },
|
|
147
|
+
autocomplete: { default: void 0 },
|
|
148
|
+
inputmode: { default: void 0 },
|
|
149
|
+
min: { default: void 0 },
|
|
150
|
+
max: { default: void 0 },
|
|
151
|
+
step: { default: void 0 }
|
|
152
|
+
},
|
|
153
|
+
emits: [
|
|
154
|
+
"update:modelValue",
|
|
155
|
+
"focus",
|
|
156
|
+
"blur",
|
|
157
|
+
"change"
|
|
158
|
+
],
|
|
159
|
+
setup(e, { emit: t }) {
|
|
160
|
+
let n = e, i = t, c = r(() => !!n.error);
|
|
161
|
+
function l(e) {
|
|
162
|
+
i("update:modelValue", e.target.value);
|
|
163
|
+
}
|
|
164
|
+
return (t, n) => (h(), o("div", { class: f(["cc-input", {
|
|
165
|
+
"cc-input--error": c.value,
|
|
166
|
+
"cc-input--disabled": e.disabled
|
|
167
|
+
}]) }, [
|
|
168
|
+
e.label ? (h(), o("label", {
|
|
169
|
+
key: 0,
|
|
170
|
+
class: "cc-input__label",
|
|
171
|
+
for: e.name
|
|
172
|
+
}, b(e.label), 9, le)) : a("", !0),
|
|
173
|
+
s("div", { class: f(["cc-input__field", { "cc-input__field--prefix": e.prefix }]) }, [e.prefix ? (h(), o("span", ue, b(e.prefix), 1)) : a("", !0), s("input", {
|
|
174
|
+
id: e.name,
|
|
175
|
+
class: "cc-input__control tnum",
|
|
176
|
+
type: e.type,
|
|
177
|
+
value: e.modelValue,
|
|
178
|
+
name: e.name,
|
|
179
|
+
placeholder: e.placeholder,
|
|
180
|
+
disabled: e.disabled,
|
|
181
|
+
readonly: e.readonly,
|
|
182
|
+
autocomplete: e.autocomplete,
|
|
183
|
+
inputmode: e.inputmode,
|
|
184
|
+
min: e.min,
|
|
185
|
+
max: e.max,
|
|
186
|
+
step: e.step,
|
|
187
|
+
"aria-invalid": c.value || void 0,
|
|
188
|
+
onInput: l,
|
|
189
|
+
onFocus: n[0] ||= (e) => i("focus", e),
|
|
190
|
+
onBlur: n[1] ||= (e) => i("blur", e),
|
|
191
|
+
onChange: n[2] ||= (e) => i("change", e)
|
|
192
|
+
}, null, 40, de)], 2),
|
|
193
|
+
e.error ? (h(), o("p", fe, b(e.error), 1)) : e.hint ? (h(), o("p", pe, b(e.hint), 1)) : a("", !0)
|
|
194
|
+
], 2));
|
|
195
|
+
}
|
|
196
|
+
}), [["__scopeId", "data-v-4b6c01de"]]), A = ["for"], j = [
|
|
197
|
+
"id",
|
|
198
|
+
"value",
|
|
199
|
+
"name",
|
|
200
|
+
"rows",
|
|
201
|
+
"placeholder",
|
|
202
|
+
"disabled",
|
|
203
|
+
"readonly",
|
|
204
|
+
"autocomplete",
|
|
205
|
+
"aria-invalid"
|
|
206
|
+
], M = {
|
|
207
|
+
key: 1,
|
|
208
|
+
class: "cc-textarea__message cc-textarea__message--error"
|
|
209
|
+
}, N = {
|
|
210
|
+
key: 2,
|
|
211
|
+
class: "cc-textarea__message"
|
|
212
|
+
}, P = /*#__PURE__*/ E(/* @__PURE__ */ u({
|
|
213
|
+
__name: "CcTextarea",
|
|
214
|
+
props: {
|
|
215
|
+
modelValue: { default: "" },
|
|
216
|
+
label: { default: void 0 },
|
|
217
|
+
placeholder: { default: void 0 },
|
|
218
|
+
name: { default: void 0 },
|
|
219
|
+
rows: { default: 4 },
|
|
220
|
+
disabled: {
|
|
221
|
+
type: Boolean,
|
|
222
|
+
default: !1
|
|
223
|
+
},
|
|
224
|
+
readonly: {
|
|
225
|
+
type: Boolean,
|
|
226
|
+
default: !1
|
|
227
|
+
},
|
|
228
|
+
error: { default: void 0 },
|
|
229
|
+
hint: { default: void 0 },
|
|
230
|
+
autocomplete: { default: void 0 }
|
|
231
|
+
},
|
|
232
|
+
emits: [
|
|
233
|
+
"update:modelValue",
|
|
234
|
+
"focus",
|
|
235
|
+
"blur"
|
|
236
|
+
],
|
|
237
|
+
setup(e, { emit: t }) {
|
|
238
|
+
let n = e, i = t, c = r(() => !!n.error);
|
|
239
|
+
function l(e) {
|
|
240
|
+
i("update:modelValue", e.target.value);
|
|
241
|
+
}
|
|
242
|
+
return (t, n) => (h(), o("div", { class: f(["cc-textarea", {
|
|
243
|
+
"cc-textarea--error": c.value,
|
|
244
|
+
"cc-textarea--disabled": e.disabled
|
|
245
|
+
}]) }, [
|
|
246
|
+
e.label ? (h(), o("label", {
|
|
247
|
+
key: 0,
|
|
248
|
+
class: "cc-textarea__label",
|
|
249
|
+
for: e.name
|
|
250
|
+
}, b(e.label), 9, A)) : a("", !0),
|
|
251
|
+
s("textarea", {
|
|
252
|
+
id: e.name,
|
|
253
|
+
class: "cc-textarea__control",
|
|
254
|
+
value: e.modelValue,
|
|
255
|
+
name: e.name,
|
|
256
|
+
rows: e.rows,
|
|
257
|
+
placeholder: e.placeholder,
|
|
258
|
+
disabled: e.disabled,
|
|
259
|
+
readonly: e.readonly,
|
|
260
|
+
autocomplete: e.autocomplete,
|
|
261
|
+
"aria-invalid": c.value || void 0,
|
|
262
|
+
onInput: l,
|
|
263
|
+
onFocus: n[0] ||= (e) => i("focus", e),
|
|
264
|
+
onBlur: n[1] ||= (e) => i("blur", e)
|
|
265
|
+
}, null, 40, j),
|
|
266
|
+
e.error ? (h(), o("p", M, b(e.error), 1)) : e.hint ? (h(), o("p", N, b(e.hint), 1)) : a("", !0)
|
|
267
|
+
], 2));
|
|
268
|
+
}
|
|
269
|
+
}), [["__scopeId", "data-v-9840d15e"]]), F = ["for"], I = { class: "cc-select__wrap" }, L = [
|
|
270
|
+
"id",
|
|
271
|
+
"value",
|
|
272
|
+
"name",
|
|
273
|
+
"disabled",
|
|
274
|
+
"aria-invalid"
|
|
275
|
+
], R = {
|
|
276
|
+
key: 0,
|
|
277
|
+
value: "",
|
|
278
|
+
disabled: "",
|
|
279
|
+
selected: ""
|
|
280
|
+
}, z = ["value", "disabled"], B = {
|
|
281
|
+
key: 1,
|
|
282
|
+
class: "cc-select__message cc-select__message--error"
|
|
283
|
+
}, me = {
|
|
284
|
+
key: 2,
|
|
285
|
+
class: "cc-select__message"
|
|
286
|
+
}, V = /*#__PURE__*/ E(/* @__PURE__ */ u({
|
|
287
|
+
__name: "CcSelect",
|
|
288
|
+
props: {
|
|
289
|
+
modelValue: { default: "" },
|
|
290
|
+
options: { default: () => [] },
|
|
291
|
+
label: { default: void 0 },
|
|
292
|
+
placeholder: { default: void 0 },
|
|
293
|
+
name: { default: void 0 },
|
|
294
|
+
disabled: {
|
|
295
|
+
type: Boolean,
|
|
296
|
+
default: !1
|
|
297
|
+
},
|
|
298
|
+
error: { default: void 0 },
|
|
299
|
+
hint: { default: void 0 }
|
|
300
|
+
},
|
|
301
|
+
emits: ["update:modelValue", "change"],
|
|
302
|
+
setup(t, { emit: n }) {
|
|
303
|
+
let i = t, c = n, l = r(() => !!i.error);
|
|
304
|
+
function u(e) {
|
|
305
|
+
let t = e.target;
|
|
306
|
+
c("update:modelValue", t.value), c("change", e);
|
|
307
|
+
}
|
|
308
|
+
return (n, r) => (h(), o("div", { class: f(["cc-select", {
|
|
309
|
+
"cc-select--error": l.value,
|
|
310
|
+
"cc-select--disabled": t.disabled
|
|
311
|
+
}]) }, [
|
|
312
|
+
t.label ? (h(), o("label", {
|
|
313
|
+
key: 0,
|
|
314
|
+
class: "cc-select__label",
|
|
315
|
+
for: t.name
|
|
316
|
+
}, b(t.label), 9, F)) : a("", !0),
|
|
317
|
+
s("div", I, [s("select", {
|
|
318
|
+
id: t.name,
|
|
319
|
+
class: "cc-select__control",
|
|
320
|
+
value: t.modelValue,
|
|
321
|
+
name: t.name,
|
|
322
|
+
disabled: t.disabled,
|
|
323
|
+
"aria-invalid": l.value || void 0,
|
|
324
|
+
onChange: u
|
|
325
|
+
}, [t.placeholder ? (h(), o("option", R, b(t.placeholder), 1)) : a("", !0), (h(!0), o(e, null, _(t.options, (e) => (h(), o("option", {
|
|
326
|
+
key: String(e.value),
|
|
327
|
+
value: e.value,
|
|
328
|
+
disabled: e.disabled
|
|
329
|
+
}, b(e.label), 9, z))), 128))], 40, L), r[0] ||= s("svg", {
|
|
330
|
+
class: "cc-select__chevron",
|
|
331
|
+
width: "16",
|
|
332
|
+
height: "16",
|
|
333
|
+
viewBox: "0 0 16 16",
|
|
334
|
+
fill: "none",
|
|
335
|
+
"aria-hidden": "true"
|
|
336
|
+
}, [s("path", {
|
|
337
|
+
d: "M4 6l4 4 4-4",
|
|
338
|
+
stroke: "currentColor",
|
|
339
|
+
"stroke-width": "1.5",
|
|
340
|
+
"stroke-linecap": "round",
|
|
341
|
+
"stroke-linejoin": "round"
|
|
342
|
+
})], -1)]),
|
|
343
|
+
t.error ? (h(), o("p", B, b(t.error), 1)) : t.hint ? (h(), o("p", me, b(t.hint), 1)) : a("", !0)
|
|
344
|
+
], 2));
|
|
345
|
+
}
|
|
346
|
+
}), [["__scopeId", "data-v-0e1871e6"]]), he = [
|
|
347
|
+
"aria-checked",
|
|
348
|
+
"aria-label",
|
|
349
|
+
"disabled"
|
|
350
|
+
], ge = {
|
|
351
|
+
key: 0,
|
|
352
|
+
class: "cc-switch__label"
|
|
353
|
+
}, H = /*#__PURE__*/ E(/* @__PURE__ */ u({
|
|
354
|
+
__name: "CcSwitch",
|
|
355
|
+
props: /*@__PURE__*/ d({
|
|
356
|
+
label: { default: void 0 },
|
|
357
|
+
disabled: {
|
|
358
|
+
type: Boolean,
|
|
359
|
+
default: !1
|
|
360
|
+
},
|
|
361
|
+
size: { default: "md" }
|
|
362
|
+
}, {
|
|
363
|
+
modelValue: {
|
|
364
|
+
type: Boolean,
|
|
365
|
+
default: !1
|
|
366
|
+
},
|
|
367
|
+
modelModifiers: {}
|
|
368
|
+
}),
|
|
369
|
+
emits: ["update:modelValue"],
|
|
370
|
+
setup(e) {
|
|
371
|
+
let t = x(e, "modelValue"), n = e;
|
|
372
|
+
function r() {
|
|
373
|
+
n.disabled || (t.value = !t.value);
|
|
374
|
+
}
|
|
375
|
+
return (n, i) => (h(), o("button", {
|
|
376
|
+
type: "button",
|
|
377
|
+
class: f(["cc-switch", [`cc-switch--${e.size}`, {
|
|
378
|
+
"cc-switch--checked": t.value,
|
|
379
|
+
"cc-switch--disabled": e.disabled
|
|
380
|
+
}]]),
|
|
381
|
+
role: "switch",
|
|
382
|
+
"aria-checked": t.value,
|
|
383
|
+
"aria-label": e.label || "switch",
|
|
384
|
+
disabled: e.disabled,
|
|
385
|
+
onClick: r
|
|
386
|
+
}, [i[0] ||= s("span", { class: "cc-switch__track" }, [s("span", { class: "cc-switch__knob" })], -1), e.label ? (h(), o("span", ge, b(e.label), 1)) : a("", !0)], 10, he));
|
|
387
|
+
}
|
|
388
|
+
}), [["__scopeId", "data-v-cb8ad6ea"]]), _e = ["disabled"], ve = {
|
|
389
|
+
key: 0,
|
|
390
|
+
class: "cc-checkbox__label"
|
|
391
|
+
}, U = /*#__PURE__*/ E(/* @__PURE__ */ u({
|
|
392
|
+
__name: "CcCheckbox",
|
|
393
|
+
props: /*@__PURE__*/ d({
|
|
394
|
+
label: { default: void 0 },
|
|
395
|
+
disabled: {
|
|
396
|
+
type: Boolean,
|
|
397
|
+
default: !1
|
|
398
|
+
}
|
|
399
|
+
}, {
|
|
400
|
+
modelValue: {
|
|
401
|
+
type: Boolean,
|
|
402
|
+
default: !1
|
|
403
|
+
},
|
|
404
|
+
modelModifiers: {}
|
|
405
|
+
}),
|
|
406
|
+
emits: ["update:modelValue"],
|
|
407
|
+
setup(e) {
|
|
408
|
+
let t = x(e, "modelValue");
|
|
409
|
+
return (n, r) => (h(), o("label", { class: f(["cc-checkbox", { "cc-checkbox--disabled": e.disabled }]) }, [
|
|
410
|
+
w(s("input", {
|
|
411
|
+
"onUpdate:modelValue": r[0] ||= (e) => t.value = e,
|
|
412
|
+
type: "checkbox",
|
|
413
|
+
class: "cc-checkbox__native",
|
|
414
|
+
disabled: e.disabled
|
|
415
|
+
}, null, 8, _e), [[re, t.value]]),
|
|
416
|
+
r[1] ||= s("span", {
|
|
417
|
+
class: "cc-checkbox__box",
|
|
418
|
+
"aria-hidden": "true"
|
|
419
|
+
}, [s("svg", {
|
|
420
|
+
class: "cc-checkbox__check",
|
|
421
|
+
width: "12",
|
|
422
|
+
height: "12",
|
|
423
|
+
viewBox: "0 0 12 12",
|
|
424
|
+
fill: "none"
|
|
425
|
+
}, [s("path", {
|
|
426
|
+
d: "M2.5 6.2l2.4 2.4 4.6-5",
|
|
427
|
+
stroke: "currentColor",
|
|
428
|
+
"stroke-width": "1.8",
|
|
429
|
+
"stroke-linecap": "round",
|
|
430
|
+
"stroke-linejoin": "round"
|
|
431
|
+
})])], -1),
|
|
432
|
+
e.label ? (h(), o("span", ve, b(e.label), 1)) : a("", !0),
|
|
433
|
+
v(n.$slots, "default", {}, void 0, !0)
|
|
434
|
+
], 2));
|
|
435
|
+
}
|
|
436
|
+
}), [["__scopeId", "data-v-bf838053"]]), ye = ["value", "disabled"], be = {
|
|
437
|
+
key: 0,
|
|
438
|
+
class: "cc-radio__label"
|
|
439
|
+
}, W = /*#__PURE__*/ E(/* @__PURE__ */ u({
|
|
440
|
+
__name: "CcRadio",
|
|
441
|
+
props: /*@__PURE__*/ d({
|
|
442
|
+
value: {},
|
|
443
|
+
label: { default: void 0 },
|
|
444
|
+
disabled: {
|
|
445
|
+
type: Boolean,
|
|
446
|
+
default: !1
|
|
447
|
+
}
|
|
448
|
+
}, {
|
|
449
|
+
modelValue: { default: "" },
|
|
450
|
+
modelModifiers: {}
|
|
451
|
+
}),
|
|
452
|
+
emits: ["update:modelValue"],
|
|
453
|
+
setup(e) {
|
|
454
|
+
let t = x(e, "modelValue");
|
|
455
|
+
return (n, r) => (h(), o("label", { class: f(["cc-radio", { "cc-radio--disabled": e.disabled }]) }, [
|
|
456
|
+
w(s("input", {
|
|
457
|
+
"onUpdate:modelValue": r[0] ||= (e) => t.value = e,
|
|
458
|
+
type: "radio",
|
|
459
|
+
class: "cc-radio__native",
|
|
460
|
+
value: e.value,
|
|
461
|
+
disabled: e.disabled
|
|
462
|
+
}, null, 8, ye), [[ie, t.value]]),
|
|
463
|
+
r[1] ||= s("span", {
|
|
464
|
+
class: "cc-radio__dot",
|
|
465
|
+
"aria-hidden": "true"
|
|
466
|
+
}, null, -1),
|
|
467
|
+
e.label ? (h(), o("span", be, b(e.label), 1)) : a("", !0),
|
|
468
|
+
v(n.$slots, "default", {}, void 0, !0)
|
|
469
|
+
], 2));
|
|
470
|
+
}
|
|
471
|
+
}), [["__scopeId", "data-v-0a6c4d47"]]), xe = {
|
|
472
|
+
key: 0,
|
|
473
|
+
class: "cc-card__header"
|
|
474
|
+
}, Se = {
|
|
475
|
+
key: 0,
|
|
476
|
+
class: "cc-card__title"
|
|
477
|
+
}, Ce = {
|
|
478
|
+
key: 1,
|
|
479
|
+
class: "cc-card__desc"
|
|
480
|
+
}, we = { class: "cc-card__body" }, Te = {
|
|
481
|
+
key: 0,
|
|
482
|
+
class: "cc-card__footer"
|
|
483
|
+
}, G = /*#__PURE__*/ E(/* @__PURE__ */ u({
|
|
484
|
+
__name: "CcCard",
|
|
485
|
+
props: {
|
|
486
|
+
variant: { default: "feature" },
|
|
487
|
+
title: { default: void 0 },
|
|
488
|
+
description: { default: void 0 },
|
|
489
|
+
flush: {
|
|
490
|
+
type: Boolean,
|
|
491
|
+
default: !1
|
|
492
|
+
}
|
|
493
|
+
},
|
|
494
|
+
setup(e) {
|
|
495
|
+
return (t, n) => (h(), o("article", { class: f(["cc-card", [`cc-card--${e.variant}`, { "cc-card--flush": e.flush }]]) }, [
|
|
496
|
+
v(t.$slots, "header", {}, () => [e.title || e.description ? (h(), o("header", xe, [e.title ? (h(), o("h3", Se, b(e.title), 1)) : a("", !0), e.description ? (h(), o("p", Ce, b(e.description), 1)) : a("", !0)])) : a("", !0)], !0),
|
|
497
|
+
s("div", we, [v(t.$slots, "default", {}, void 0, !0)]),
|
|
498
|
+
t.$slots.footer ? (h(), o("footer", Te, [v(t.$slots, "footer", {}, void 0, !0)])) : a("", !0)
|
|
499
|
+
], 2));
|
|
500
|
+
}
|
|
501
|
+
}), [["__scopeId", "data-v-7f39ac3e"]]), Ee = {
|
|
502
|
+
key: 0,
|
|
503
|
+
class: "cc-tag__dot"
|
|
504
|
+
}, K = /*#__PURE__*/ E(/* @__PURE__ */ u({
|
|
505
|
+
__name: "CcTag",
|
|
506
|
+
props: {
|
|
507
|
+
variant: { default: "soft" },
|
|
508
|
+
size: { default: "md" },
|
|
509
|
+
dot: {
|
|
510
|
+
type: Boolean,
|
|
511
|
+
default: !1
|
|
512
|
+
},
|
|
513
|
+
closable: {
|
|
514
|
+
type: Boolean,
|
|
515
|
+
default: !1
|
|
516
|
+
}
|
|
517
|
+
},
|
|
518
|
+
emits: ["close"],
|
|
519
|
+
setup(e, { emit: t }) {
|
|
520
|
+
let n = t;
|
|
521
|
+
return (t, r) => (h(), o("span", { class: f(["cc-tag", [`cc-tag--${e.variant}`, `cc-tag--${e.size}`]]) }, [
|
|
522
|
+
e.dot ? (h(), o("span", Ee)) : a("", !0),
|
|
523
|
+
v(t.$slots, "default", {}, void 0, !0),
|
|
524
|
+
e.closable ? (h(), o("button", {
|
|
525
|
+
key: 1,
|
|
526
|
+
type: "button",
|
|
527
|
+
class: "cc-tag__close",
|
|
528
|
+
"aria-label": "close tag",
|
|
529
|
+
onClick: r[0] ||= T((e) => n("close", e), ["stop"])
|
|
530
|
+
}, [...r[1] ||= [s("svg", {
|
|
531
|
+
width: "10",
|
|
532
|
+
height: "10",
|
|
533
|
+
viewBox: "0 0 10 10",
|
|
534
|
+
fill: "none",
|
|
535
|
+
"aria-hidden": "true"
|
|
536
|
+
}, [s("path", {
|
|
537
|
+
d: "M1 1l8 8M9 1l-8 8",
|
|
538
|
+
stroke: "currentColor",
|
|
539
|
+
"stroke-width": "1.4",
|
|
540
|
+
"stroke-linecap": "round"
|
|
541
|
+
})], -1)]])) : a("", !0)
|
|
542
|
+
], 2));
|
|
543
|
+
}
|
|
544
|
+
}), [["__scopeId", "data-v-858b2086"]]), De = { class: "cc-badge__text tnum" }, q = /*#__PURE__*/ E(/* @__PURE__ */ u({
|
|
545
|
+
__name: "CcBadge",
|
|
546
|
+
props: {
|
|
547
|
+
count: { default: 0 },
|
|
548
|
+
max: { default: 99 },
|
|
549
|
+
variant: { default: "soft" },
|
|
550
|
+
dot: {
|
|
551
|
+
type: Boolean,
|
|
552
|
+
default: !1
|
|
553
|
+
}
|
|
554
|
+
},
|
|
555
|
+
setup(e) {
|
|
556
|
+
let t = e, n = r(() => {
|
|
557
|
+
if (t.dot) return "";
|
|
558
|
+
let e = Number(t.count);
|
|
559
|
+
return Number.isNaN(e) ? String(t.count) : e > t.max ? `${t.max}+` : String(e);
|
|
560
|
+
});
|
|
561
|
+
return (t, r) => (h(), o("span", { class: f(["cc-badge", [`cc-badge--${e.variant}`, { "cc-badge--dot-only": e.dot }]]) }, [s("span", De, b(n.value), 1)], 2));
|
|
562
|
+
}
|
|
563
|
+
}), [["__scopeId", "data-v-466a4bd0"]]), Oe = { class: "cc-alert__content" }, ke = {
|
|
564
|
+
key: 0,
|
|
565
|
+
class: "cc-alert__title"
|
|
566
|
+
}, Ae = {
|
|
567
|
+
key: 1,
|
|
568
|
+
class: "cc-alert__desc"
|
|
569
|
+
}, J = /*#__PURE__*/ E(/* @__PURE__ */ u({
|
|
570
|
+
__name: "CcAlert",
|
|
571
|
+
props: {
|
|
572
|
+
variant: { default: "info" },
|
|
573
|
+
title: { default: void 0 },
|
|
574
|
+
description: { default: void 0 },
|
|
575
|
+
closable: {
|
|
576
|
+
type: Boolean,
|
|
577
|
+
default: !1
|
|
578
|
+
}
|
|
579
|
+
},
|
|
580
|
+
setup(e) {
|
|
581
|
+
let t = e, n = g(!0), i = r(() => {
|
|
582
|
+
switch (t.variant) {
|
|
583
|
+
case "success": return "var(--cc-success)";
|
|
584
|
+
case "warning": return "var(--cc-warning)";
|
|
585
|
+
case "error": return "var(--cc-error)";
|
|
586
|
+
default: return "var(--cc-primary)";
|
|
587
|
+
}
|
|
588
|
+
});
|
|
589
|
+
return (t, r) => n.value ? (h(), o("div", {
|
|
590
|
+
key: 0,
|
|
591
|
+
class: f(["cc-alert", `cc-alert--${e.variant}`]),
|
|
592
|
+
role: "alert"
|
|
593
|
+
}, [
|
|
594
|
+
s("span", {
|
|
595
|
+
class: "cc-alert__icon",
|
|
596
|
+
style: p({ color: i.value }),
|
|
597
|
+
"aria-hidden": "true"
|
|
598
|
+
}, [...r[1] ||= [s("svg", {
|
|
599
|
+
width: "16",
|
|
600
|
+
height: "16",
|
|
601
|
+
viewBox: "0 0 16 16",
|
|
602
|
+
fill: "none"
|
|
603
|
+
}, [
|
|
604
|
+
s("path", {
|
|
605
|
+
d: "M8 1.5l6.5 11.25H1.5L8 1.5z",
|
|
606
|
+
stroke: "currentColor",
|
|
607
|
+
"stroke-width": "1.4",
|
|
608
|
+
"stroke-linejoin": "round"
|
|
609
|
+
}),
|
|
610
|
+
s("path", {
|
|
611
|
+
d: "M8 6v3.2",
|
|
612
|
+
stroke: "currentColor",
|
|
613
|
+
"stroke-width": "1.4",
|
|
614
|
+
"stroke-linecap": "round"
|
|
615
|
+
}),
|
|
616
|
+
s("circle", {
|
|
617
|
+
cx: "8",
|
|
618
|
+
cy: "11.2",
|
|
619
|
+
r: "0.9",
|
|
620
|
+
fill: "currentColor"
|
|
621
|
+
})
|
|
622
|
+
], -1)]], 4),
|
|
623
|
+
s("div", Oe, [e.title ? (h(), o("p", ke, b(e.title), 1)) : a("", !0), e.description || t.$slots.default ? (h(), o("p", Ae, [v(t.$slots, "default", {}, () => [c(b(e.description), 1)], !0)])) : a("", !0)]),
|
|
624
|
+
e.closable ? (h(), o("button", {
|
|
625
|
+
key: 0,
|
|
626
|
+
type: "button",
|
|
627
|
+
class: "cc-alert__close",
|
|
628
|
+
"aria-label": "dismiss",
|
|
629
|
+
onClick: r[0] ||= (e) => n.value = !1
|
|
630
|
+
}, [...r[2] ||= [s("svg", {
|
|
631
|
+
width: "12",
|
|
632
|
+
height: "12",
|
|
633
|
+
viewBox: "0 0 10 10",
|
|
634
|
+
fill: "none",
|
|
635
|
+
"aria-hidden": "true"
|
|
636
|
+
}, [s("path", {
|
|
637
|
+
d: "M1 1l8 8M9 1l-8 8",
|
|
638
|
+
stroke: "currentColor",
|
|
639
|
+
"stroke-width": "1.4",
|
|
640
|
+
"stroke-linecap": "round"
|
|
641
|
+
})], -1)]])) : a("", !0)
|
|
642
|
+
], 2)) : a("", !0);
|
|
643
|
+
}
|
|
644
|
+
}), [["__scopeId", "data-v-8671adaf"]]), je = ["aria-label"], Y = { class: "cc-modal__header" }, Me = {
|
|
645
|
+
key: 0,
|
|
646
|
+
class: "cc-modal__title"
|
|
647
|
+
}, Ne = { class: "cc-modal__body" }, Pe = {
|
|
648
|
+
key: 0,
|
|
649
|
+
class: "cc-modal__footer"
|
|
650
|
+
}, X = /*#__PURE__*/ E(/* @__PURE__ */ u({
|
|
651
|
+
__name: "CcModal",
|
|
652
|
+
props: {
|
|
653
|
+
visible: {
|
|
654
|
+
type: Boolean,
|
|
655
|
+
default: !1
|
|
656
|
+
},
|
|
657
|
+
title: { default: void 0 },
|
|
658
|
+
width: { default: "480px" },
|
|
659
|
+
closable: {
|
|
660
|
+
type: Boolean,
|
|
661
|
+
default: !0
|
|
662
|
+
},
|
|
663
|
+
maskClosable: {
|
|
664
|
+
type: Boolean,
|
|
665
|
+
default: !0
|
|
666
|
+
},
|
|
667
|
+
footer: {
|
|
668
|
+
type: Boolean,
|
|
669
|
+
default: !0
|
|
670
|
+
}
|
|
671
|
+
},
|
|
672
|
+
emits: [
|
|
673
|
+
"update:visible",
|
|
674
|
+
"open",
|
|
675
|
+
"close"
|
|
676
|
+
],
|
|
677
|
+
setup(e, { emit: r }) {
|
|
678
|
+
let c = e, u = r, d = g(null);
|
|
679
|
+
function f() {
|
|
680
|
+
u("update:visible", !1), u("close");
|
|
681
|
+
}
|
|
682
|
+
function _(e) {
|
|
683
|
+
e.key === "Escape" && c.visible && c.closable && f();
|
|
684
|
+
}
|
|
685
|
+
function y(e) {
|
|
686
|
+
c.maskClosable && e.target === e.currentTarget && f();
|
|
687
|
+
}
|
|
688
|
+
return S(() => c.visible, async (e) => {
|
|
689
|
+
e ? (u("open"), await ee(), d.value?.focus(), document.body.style.overflow = "hidden") : document.body.style.overflow = "";
|
|
690
|
+
}), te(() => {
|
|
691
|
+
document.addEventListener("keydown", _);
|
|
692
|
+
}), m(() => {
|
|
693
|
+
document.removeEventListener("keydown", _), document.body.style.overflow = "";
|
|
694
|
+
}), (r, c) => (h(), i(t, { to: "body" }, [l(n, { name: "cc-modal" }, {
|
|
695
|
+
default: C(() => [e.visible ? (h(), o("div", {
|
|
696
|
+
key: 0,
|
|
697
|
+
class: "cc-modal",
|
|
698
|
+
onClick: T(y, ["self"])
|
|
699
|
+
}, [s("div", {
|
|
700
|
+
ref_key: "panel",
|
|
701
|
+
ref: d,
|
|
702
|
+
class: "cc-modal__panel",
|
|
703
|
+
style: p({ maxWidth: e.width }),
|
|
704
|
+
role: "dialog",
|
|
705
|
+
"aria-modal": "true",
|
|
706
|
+
"aria-label": e.title || "dialog",
|
|
707
|
+
tabindex: "-1"
|
|
708
|
+
}, [
|
|
709
|
+
s("header", Y, [e.title ? (h(), o("h3", Me, b(e.title), 1)) : a("", !0), e.closable ? (h(), o("button", {
|
|
710
|
+
key: 1,
|
|
711
|
+
type: "button",
|
|
712
|
+
class: "cc-modal__close",
|
|
713
|
+
"aria-label": "close",
|
|
714
|
+
onClick: f
|
|
715
|
+
}, [...c[0] ||= [s("svg", {
|
|
716
|
+
width: "14",
|
|
717
|
+
height: "14",
|
|
718
|
+
viewBox: "0 0 10 10",
|
|
719
|
+
fill: "none",
|
|
720
|
+
"aria-hidden": "true"
|
|
721
|
+
}, [s("path", {
|
|
722
|
+
d: "M1 1l8 8M9 1l-8 8",
|
|
723
|
+
stroke: "currentColor",
|
|
724
|
+
"stroke-width": "1.4",
|
|
725
|
+
"stroke-linecap": "round"
|
|
726
|
+
})], -1)]])) : a("", !0)]),
|
|
727
|
+
s("div", Ne, [v(r.$slots, "default", {}, void 0, !0)]),
|
|
728
|
+
r.$slots.footer ? (h(), o("footer", Pe, [v(r.$slots, "footer", {}, void 0, !0)])) : a("", !0)
|
|
729
|
+
], 12, je)])) : a("", !0)]),
|
|
730
|
+
_: 3
|
|
731
|
+
})]));
|
|
732
|
+
}
|
|
733
|
+
}), [["__scopeId", "data-v-d2a6d4fd"]]), Z = /*#__PURE__*/ E(/* @__PURE__ */ u({
|
|
734
|
+
__name: "CcTooltip",
|
|
735
|
+
props: {
|
|
736
|
+
content: { default: void 0 },
|
|
737
|
+
placement: { default: "top" },
|
|
738
|
+
delay: { default: 0 }
|
|
739
|
+
},
|
|
740
|
+
setup(e) {
|
|
741
|
+
let t = e, n = g(!1), i = null, s = r(() => n.value);
|
|
742
|
+
function l() {
|
|
743
|
+
t.delay > 0 ? i = setTimeout(() => n.value = !0, t.delay) : n.value = !0;
|
|
744
|
+
}
|
|
745
|
+
function u() {
|
|
746
|
+
i && clearTimeout(i), n.value = !1;
|
|
747
|
+
}
|
|
748
|
+
return (t, n) => (h(), o("span", {
|
|
749
|
+
class: "cc-tooltip",
|
|
750
|
+
onMouseenter: l,
|
|
751
|
+
onMouseleave: u,
|
|
752
|
+
onFocusin: l,
|
|
753
|
+
onFocusout: u
|
|
754
|
+
}, [v(t.$slots, "default", {}, void 0, !0), s.value && (e.content || t.$slots.tip) ? (h(), o("span", {
|
|
755
|
+
key: 0,
|
|
756
|
+
class: f(["cc-tooltip__bubble", `cc-tooltip--${e.placement}`]),
|
|
757
|
+
role: "tooltip"
|
|
758
|
+
}, [v(t.$slots, "tip", {}, () => [c(b(e.content), 1)], !0)], 2)) : a("", !0)], 32));
|
|
759
|
+
}
|
|
760
|
+
}), [["__scopeId", "data-v-2befb04b"]]), Fe = {
|
|
761
|
+
key: 0,
|
|
762
|
+
class: "cc-divider__label"
|
|
763
|
+
}, Q = /*#__PURE__*/ E(/* @__PURE__ */ u({
|
|
764
|
+
__name: "CcDivider",
|
|
765
|
+
props: {
|
|
766
|
+
orientation: { default: "horizontal" },
|
|
767
|
+
height: { default: "1em" }
|
|
768
|
+
},
|
|
769
|
+
setup(e) {
|
|
770
|
+
return (t, n) => (h(), o("div", {
|
|
771
|
+
class: f(["cc-divider", [`cc-divider--${e.orientation}`]]),
|
|
772
|
+
role: "separator",
|
|
773
|
+
style: p(e.orientation === "vertical" ? { height: e.height } : void 0)
|
|
774
|
+
}, [t.$slots.default ? (h(), o("span", Fe, [v(t.$slots, "default", {}, void 0, !0)])) : a("", !0)], 6));
|
|
775
|
+
}
|
|
776
|
+
}), [["__scopeId", "data-v-c42961cd"]]);
|
|
777
|
+
//#endregion
|
|
778
|
+
//#region src/index.ts
|
|
779
|
+
function $(e) {
|
|
780
|
+
let t = [
|
|
781
|
+
["CcButton", O],
|
|
782
|
+
["CcInput", k],
|
|
783
|
+
["CcTextarea", P],
|
|
784
|
+
["CcSelect", V],
|
|
785
|
+
["CcSwitch", H],
|
|
786
|
+
["CcCheckbox", U],
|
|
787
|
+
["CcRadio", W],
|
|
788
|
+
["CcCard", G],
|
|
789
|
+
["CcTag", K],
|
|
790
|
+
["CcBadge", q],
|
|
791
|
+
["CcAlert", J],
|
|
792
|
+
["CcModal", X],
|
|
793
|
+
["CcTooltip", Z],
|
|
794
|
+
["CcSpinner", D],
|
|
795
|
+
["CcDivider", Q]
|
|
796
|
+
];
|
|
797
|
+
for (let [n, r] of t) e.component(n, r);
|
|
798
|
+
}
|
|
799
|
+
var Ie = {
|
|
800
|
+
install: $,
|
|
801
|
+
CcButton: O,
|
|
802
|
+
CcInput: k,
|
|
803
|
+
CcTextarea: P,
|
|
804
|
+
CcSelect: V,
|
|
805
|
+
CcSwitch: H,
|
|
806
|
+
CcCheckbox: U,
|
|
807
|
+
CcRadio: W,
|
|
808
|
+
CcCard: G,
|
|
809
|
+
CcTag: K,
|
|
810
|
+
CcBadge: q,
|
|
811
|
+
CcAlert: J,
|
|
812
|
+
CcModal: X,
|
|
813
|
+
CcTooltip: Z,
|
|
814
|
+
CcSpinner: D,
|
|
815
|
+
CcDivider: Q
|
|
816
|
+
};
|
|
817
|
+
//#endregion
|
|
818
|
+
export { J as CcAlert, q as CcBadge, O as CcButton, G as CcCard, U as CcCheckbox, Q as CcDivider, k as CcInput, X as CcModal, W as CcRadio, V as CcSelect, D as CcSpinner, H as CcSwitch, K as CcTag, P as CcTextarea, Z as CcTooltip, Ie as default, $ as install };
|