@cck-ui/core 0.32.0 → 0.34.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/cjs/components/badge/badge.cjs +488 -0
- package/cjs/components/badge/badge.cjs.map +1 -0
- package/cjs/components/badge/badge.module.cjs +12 -0
- package/cjs/components/badge/badge.module.cjs.map +1 -0
- package/cjs/components/badge/badge.utils.cjs +27 -0
- package/cjs/components/badge/badge.utils.cjs.map +1 -0
- package/cjs/components/badge/index.cjs +14 -0
- package/cjs/components/badge/index.cjs.map +1 -0
- package/cjs/components/card/card-section/card-section.cjs +376 -0
- package/cjs/components/card/card-section/card-section.cjs.map +1 -0
- package/cjs/components/card/card.cjs +441 -0
- package/cjs/components/card/card.cjs.map +1 -0
- package/cjs/components/card/card.constant.cjs +7 -0
- package/cjs/components/card/card.constant.cjs.map +1 -0
- package/cjs/components/card/card.module.cjs +10 -0
- package/cjs/components/card/card.module.cjs.map +1 -0
- package/cjs/components/card/card.utils.cjs +8 -0
- package/cjs/components/card/card.utils.cjs.map +1 -0
- package/cjs/components/card/index.cjs +18 -0
- package/cjs/components/card/index.cjs.map +1 -0
- package/cjs/components/paper/index.cjs +1 -1
- package/cjs/components/paper/paper.cjs +1 -1
- package/cjs/core/utils/filter-falsy-children/filter-falsy-children.cjs +17 -0
- package/cjs/core/utils/filter-falsy-children/filter-falsy-children.cjs.map +1 -0
- package/cjs/index.cjs +95 -85
- package/cjs/index.cjs.map +1 -1
- package/esm/components/badge/badge.mjs +488 -0
- package/esm/components/badge/badge.mjs.map +1 -0
- package/esm/components/badge/badge.module.mjs +12 -0
- package/esm/components/badge/badge.module.mjs.map +1 -0
- package/esm/components/badge/badge.utils.mjs +28 -0
- package/esm/components/badge/badge.utils.mjs.map +1 -0
- package/esm/components/badge/index.mjs +11 -0
- package/esm/components/badge/index.mjs.map +1 -0
- package/esm/components/card/card-section/card-section.mjs +376 -0
- package/esm/components/card/card-section/card-section.mjs.map +1 -0
- package/esm/components/card/card.constant.mjs +7 -0
- package/esm/components/card/card.constant.mjs.map +1 -0
- package/esm/components/card/card.mjs +441 -0
- package/esm/components/card/card.mjs.map +1 -0
- package/esm/components/card/card.module.mjs +10 -0
- package/esm/components/card/card.module.mjs.map +1 -0
- package/esm/components/card/card.utils.mjs +9 -0
- package/esm/components/card/card.utils.mjs.map +1 -0
- package/esm/components/card/index.mjs +15 -0
- package/esm/components/card/index.mjs.map +1 -0
- package/esm/components/paper/index.mjs +1 -1
- package/esm/components/paper/paper.mjs +1 -1
- package/esm/core/utils/filter-falsy-children/filter-falsy-children.mjs +17 -0
- package/esm/core/utils/filter-falsy-children/filter-falsy-children.mjs.map +1 -0
- package/esm/index.mjs +7 -1
- package/esm/index.mjs.map +1 -1
- package/lib/components/badge/badge.types.d.ts +52 -0
- package/lib/components/badge/badge.utils.d.ts +8 -0
- package/lib/components/badge/index.d.ts +6 -0
- package/lib/components/card/card-section/card-section.types.d.ts +15 -0
- package/lib/components/card/card.constant.d.ts +3 -0
- package/lib/components/card/card.context.d.ts +5 -0
- package/lib/components/card/card.types.d.ts +34 -0
- package/lib/components/card/card.utils.d.ts +8 -0
- package/lib/components/card/index.d.ts +11 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/core/styles-api/styles-api.types.d.ts +2 -1
- package/lib/core/utils/filter-falsy-children/filter-falsy-children.d.ts +2 -0
- package/lib/core/utils/index.d.ts +1 -0
- package/package.json +1 -1
- package/styles/badge.css +124 -0
- package/styles/badge.layer.css +125 -0
- package/styles/card.css +89 -0
- package/styles/card.layer.css +90 -0
- package/styles.css +215 -0
- package/styles.layer.css +215 -0
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const require_filter_falsy_children = require("../../core/utils/filter-falsy-children/filter-falsy-children.cjs");
|
|
3
|
+
const require_export_helper = require("../../_virtual/_/plugin-vue/export-helper.cjs");
|
|
4
|
+
const require_use_component_props = require("../../core/config-provider/use-component-props/use-component-props.cjs");
|
|
5
|
+
const require_use_styles = require("../../core/styles-api/use-styles/use-styles.cjs");
|
|
6
|
+
const require_card_constant = require("./card.constant.cjs");
|
|
7
|
+
const require_card_module = require("./card.module.cjs");
|
|
8
|
+
const require_card_utils = require("./card.utils.cjs");
|
|
9
|
+
const require_paper = require("../paper/paper.cjs");
|
|
10
|
+
let vue = require("vue");
|
|
11
|
+
//#region packages/@cck-ui/core/src/components/card/card.vue
|
|
12
|
+
const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
13
|
+
name: "CCard",
|
|
14
|
+
__name: "card",
|
|
15
|
+
props: {
|
|
16
|
+
shadow: {
|
|
17
|
+
type: null,
|
|
18
|
+
required: false
|
|
19
|
+
},
|
|
20
|
+
radius: {
|
|
21
|
+
type: null,
|
|
22
|
+
required: false
|
|
23
|
+
},
|
|
24
|
+
withBorder: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
required: false
|
|
27
|
+
},
|
|
28
|
+
padding: {
|
|
29
|
+
type: null,
|
|
30
|
+
required: false
|
|
31
|
+
},
|
|
32
|
+
orientation: {
|
|
33
|
+
type: String,
|
|
34
|
+
required: false
|
|
35
|
+
},
|
|
36
|
+
className: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: false
|
|
39
|
+
},
|
|
40
|
+
style: {
|
|
41
|
+
type: [
|
|
42
|
+
Object,
|
|
43
|
+
Function,
|
|
44
|
+
Array
|
|
45
|
+
],
|
|
46
|
+
required: false,
|
|
47
|
+
skipCheck: true
|
|
48
|
+
},
|
|
49
|
+
__vars: {
|
|
50
|
+
type: null,
|
|
51
|
+
required: false
|
|
52
|
+
},
|
|
53
|
+
__size: {
|
|
54
|
+
type: String,
|
|
55
|
+
required: false
|
|
56
|
+
},
|
|
57
|
+
hiddenFrom: {
|
|
58
|
+
type: null,
|
|
59
|
+
required: false
|
|
60
|
+
},
|
|
61
|
+
visibleFrom: {
|
|
62
|
+
type: null,
|
|
63
|
+
required: false
|
|
64
|
+
},
|
|
65
|
+
lightHidden: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
required: false
|
|
68
|
+
},
|
|
69
|
+
darkHidden: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
required: false
|
|
72
|
+
},
|
|
73
|
+
mod: {
|
|
74
|
+
type: [
|
|
75
|
+
Object,
|
|
76
|
+
String,
|
|
77
|
+
Array
|
|
78
|
+
],
|
|
79
|
+
required: false
|
|
80
|
+
},
|
|
81
|
+
m: {
|
|
82
|
+
type: null,
|
|
83
|
+
required: false
|
|
84
|
+
},
|
|
85
|
+
my: {
|
|
86
|
+
type: null,
|
|
87
|
+
required: false
|
|
88
|
+
},
|
|
89
|
+
mx: {
|
|
90
|
+
type: null,
|
|
91
|
+
required: false
|
|
92
|
+
},
|
|
93
|
+
mt: {
|
|
94
|
+
type: null,
|
|
95
|
+
required: false
|
|
96
|
+
},
|
|
97
|
+
mb: {
|
|
98
|
+
type: null,
|
|
99
|
+
required: false
|
|
100
|
+
},
|
|
101
|
+
ms: {
|
|
102
|
+
type: null,
|
|
103
|
+
required: false
|
|
104
|
+
},
|
|
105
|
+
me: {
|
|
106
|
+
type: null,
|
|
107
|
+
required: false
|
|
108
|
+
},
|
|
109
|
+
mis: {
|
|
110
|
+
type: null,
|
|
111
|
+
required: false
|
|
112
|
+
},
|
|
113
|
+
mie: {
|
|
114
|
+
type: null,
|
|
115
|
+
required: false
|
|
116
|
+
},
|
|
117
|
+
ml: {
|
|
118
|
+
type: null,
|
|
119
|
+
required: false
|
|
120
|
+
},
|
|
121
|
+
mr: {
|
|
122
|
+
type: null,
|
|
123
|
+
required: false
|
|
124
|
+
},
|
|
125
|
+
p: {
|
|
126
|
+
type: null,
|
|
127
|
+
required: false
|
|
128
|
+
},
|
|
129
|
+
py: {
|
|
130
|
+
type: null,
|
|
131
|
+
required: false
|
|
132
|
+
},
|
|
133
|
+
px: {
|
|
134
|
+
type: null,
|
|
135
|
+
required: false
|
|
136
|
+
},
|
|
137
|
+
pt: {
|
|
138
|
+
type: null,
|
|
139
|
+
required: false
|
|
140
|
+
},
|
|
141
|
+
pb: {
|
|
142
|
+
type: null,
|
|
143
|
+
required: false
|
|
144
|
+
},
|
|
145
|
+
ps: {
|
|
146
|
+
type: null,
|
|
147
|
+
required: false
|
|
148
|
+
},
|
|
149
|
+
pe: {
|
|
150
|
+
type: null,
|
|
151
|
+
required: false
|
|
152
|
+
},
|
|
153
|
+
pis: {
|
|
154
|
+
type: null,
|
|
155
|
+
required: false
|
|
156
|
+
},
|
|
157
|
+
pie: {
|
|
158
|
+
type: null,
|
|
159
|
+
required: false
|
|
160
|
+
},
|
|
161
|
+
pl: {
|
|
162
|
+
type: null,
|
|
163
|
+
required: false
|
|
164
|
+
},
|
|
165
|
+
pr: {
|
|
166
|
+
type: null,
|
|
167
|
+
required: false
|
|
168
|
+
},
|
|
169
|
+
bd: {
|
|
170
|
+
type: null,
|
|
171
|
+
required: false
|
|
172
|
+
},
|
|
173
|
+
bdrs: {
|
|
174
|
+
type: null,
|
|
175
|
+
required: false
|
|
176
|
+
},
|
|
177
|
+
bg: {
|
|
178
|
+
type: null,
|
|
179
|
+
required: false
|
|
180
|
+
},
|
|
181
|
+
c: {
|
|
182
|
+
type: null,
|
|
183
|
+
required: false
|
|
184
|
+
},
|
|
185
|
+
opacity: {
|
|
186
|
+
type: [
|
|
187
|
+
String,
|
|
188
|
+
Object,
|
|
189
|
+
Number
|
|
190
|
+
],
|
|
191
|
+
required: false
|
|
192
|
+
},
|
|
193
|
+
ff: {
|
|
194
|
+
type: [String, Object],
|
|
195
|
+
required: false
|
|
196
|
+
},
|
|
197
|
+
fz: {
|
|
198
|
+
type: null,
|
|
199
|
+
required: false
|
|
200
|
+
},
|
|
201
|
+
fw: {
|
|
202
|
+
type: null,
|
|
203
|
+
required: false
|
|
204
|
+
},
|
|
205
|
+
lts: {
|
|
206
|
+
type: null,
|
|
207
|
+
required: false
|
|
208
|
+
},
|
|
209
|
+
ta: {
|
|
210
|
+
type: [String, Object],
|
|
211
|
+
required: false
|
|
212
|
+
},
|
|
213
|
+
lh: {
|
|
214
|
+
type: null,
|
|
215
|
+
required: false
|
|
216
|
+
},
|
|
217
|
+
fs: {
|
|
218
|
+
type: null,
|
|
219
|
+
required: false
|
|
220
|
+
},
|
|
221
|
+
tt: {
|
|
222
|
+
type: [String, Object],
|
|
223
|
+
required: false
|
|
224
|
+
},
|
|
225
|
+
td: {
|
|
226
|
+
type: null,
|
|
227
|
+
required: false
|
|
228
|
+
},
|
|
229
|
+
w: {
|
|
230
|
+
type: null,
|
|
231
|
+
required: false
|
|
232
|
+
},
|
|
233
|
+
miw: {
|
|
234
|
+
type: null,
|
|
235
|
+
required: false
|
|
236
|
+
},
|
|
237
|
+
maw: {
|
|
238
|
+
type: null,
|
|
239
|
+
required: false
|
|
240
|
+
},
|
|
241
|
+
h: {
|
|
242
|
+
type: null,
|
|
243
|
+
required: false
|
|
244
|
+
},
|
|
245
|
+
mih: {
|
|
246
|
+
type: null,
|
|
247
|
+
required: false
|
|
248
|
+
},
|
|
249
|
+
mah: {
|
|
250
|
+
type: null,
|
|
251
|
+
required: false
|
|
252
|
+
},
|
|
253
|
+
bgsz: {
|
|
254
|
+
type: null,
|
|
255
|
+
required: false
|
|
256
|
+
},
|
|
257
|
+
bgp: {
|
|
258
|
+
type: null,
|
|
259
|
+
required: false
|
|
260
|
+
},
|
|
261
|
+
bgr: {
|
|
262
|
+
type: null,
|
|
263
|
+
required: false
|
|
264
|
+
},
|
|
265
|
+
bga: {
|
|
266
|
+
type: null,
|
|
267
|
+
required: false
|
|
268
|
+
},
|
|
269
|
+
pos: {
|
|
270
|
+
type: [String, Object],
|
|
271
|
+
required: false
|
|
272
|
+
},
|
|
273
|
+
top: {
|
|
274
|
+
type: null,
|
|
275
|
+
required: false
|
|
276
|
+
},
|
|
277
|
+
left: {
|
|
278
|
+
type: null,
|
|
279
|
+
required: false
|
|
280
|
+
},
|
|
281
|
+
bottom: {
|
|
282
|
+
type: null,
|
|
283
|
+
required: false
|
|
284
|
+
},
|
|
285
|
+
right: {
|
|
286
|
+
type: null,
|
|
287
|
+
required: false
|
|
288
|
+
},
|
|
289
|
+
inset: {
|
|
290
|
+
type: null,
|
|
291
|
+
required: false
|
|
292
|
+
},
|
|
293
|
+
display: {
|
|
294
|
+
type: null,
|
|
295
|
+
required: false
|
|
296
|
+
},
|
|
297
|
+
flex: {
|
|
298
|
+
type: null,
|
|
299
|
+
required: false
|
|
300
|
+
},
|
|
301
|
+
unstyled: {
|
|
302
|
+
type: Boolean,
|
|
303
|
+
required: false
|
|
304
|
+
},
|
|
305
|
+
variant: {
|
|
306
|
+
type: null,
|
|
307
|
+
required: false
|
|
308
|
+
},
|
|
309
|
+
classNames: {
|
|
310
|
+
type: null,
|
|
311
|
+
required: false
|
|
312
|
+
},
|
|
313
|
+
styles: {
|
|
314
|
+
type: null,
|
|
315
|
+
required: false
|
|
316
|
+
},
|
|
317
|
+
vars: {
|
|
318
|
+
type: Function,
|
|
319
|
+
required: false
|
|
320
|
+
},
|
|
321
|
+
attributes: {
|
|
322
|
+
type: null,
|
|
323
|
+
required: false
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
setup(__props, { expose: __expose }) {
|
|
327
|
+
const _root = (0, vue.ref)(null);
|
|
328
|
+
const attrs = (0, vue.useAttrs)();
|
|
329
|
+
const slots = (0, vue.useSlots)();
|
|
330
|
+
const rawProps = __props;
|
|
331
|
+
const defaultProps = { orientation: "vertical" };
|
|
332
|
+
const props = require_use_component_props.useComponentProps({
|
|
333
|
+
component: "CCard",
|
|
334
|
+
defaultProps,
|
|
335
|
+
props: rawProps
|
|
336
|
+
});
|
|
337
|
+
const knownProps = [
|
|
338
|
+
"classNames",
|
|
339
|
+
"className",
|
|
340
|
+
"style",
|
|
341
|
+
"styles",
|
|
342
|
+
"unstyled",
|
|
343
|
+
"vars",
|
|
344
|
+
"padding",
|
|
345
|
+
"attributes",
|
|
346
|
+
"orientation"
|
|
347
|
+
];
|
|
348
|
+
const styleProps = (0, vue.computed)(() => ({
|
|
349
|
+
...props.value,
|
|
350
|
+
...attrs,
|
|
351
|
+
style: attrs.style ?? props.value.style
|
|
352
|
+
}));
|
|
353
|
+
const getStyles = require_use_styles.useStyles({
|
|
354
|
+
name: "Card",
|
|
355
|
+
classes: require_card_module.default,
|
|
356
|
+
props: styleProps,
|
|
357
|
+
className: () => props.value.className,
|
|
358
|
+
style: () => props.value.style,
|
|
359
|
+
classNames: props.value.classNames,
|
|
360
|
+
styles: props.value.styles,
|
|
361
|
+
unstyled: props.value.unstyled,
|
|
362
|
+
attributes: props.value.attributes,
|
|
363
|
+
vars: props.value.vars,
|
|
364
|
+
varsResolver: require_card_utils.varsResolver
|
|
365
|
+
});
|
|
366
|
+
(0, vue.provide)(require_card_constant.CARD_CONTEXT_KEY, { getStyles });
|
|
367
|
+
const rootAttrs = (0, vue.computed)(() => getStyles("root"));
|
|
368
|
+
const mergedAttrs = (0, vue.computed)(() => {
|
|
369
|
+
const others = {};
|
|
370
|
+
const propsValue = props.value;
|
|
371
|
+
Object.keys(propsValue).forEach((key) => {
|
|
372
|
+
if (!knownProps.includes(key)) others[key] = propsValue[key];
|
|
373
|
+
});
|
|
374
|
+
const userMod = props.value.mod;
|
|
375
|
+
const mergedMod = [...Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)];
|
|
376
|
+
return {
|
|
377
|
+
...others,
|
|
378
|
+
mod: mergedMod,
|
|
379
|
+
...rootAttrs.value
|
|
380
|
+
};
|
|
381
|
+
});
|
|
382
|
+
function isCardSection(vnode) {
|
|
383
|
+
if (!vnode || !vnode.type) return false;
|
|
384
|
+
const type = vnode.type;
|
|
385
|
+
if (typeof type === "object" && "name" in type) return type.name === "CCardSection";
|
|
386
|
+
return false;
|
|
387
|
+
}
|
|
388
|
+
const processedChildren = (0, vue.computed)(() => {
|
|
389
|
+
const children = require_filter_falsy_children.filterFalsyChildren(slots.default?.());
|
|
390
|
+
const orientation = props.value.orientation;
|
|
391
|
+
const total = children.length;
|
|
392
|
+
return children.map((child, index) => {
|
|
393
|
+
if (isCardSection(child)) return (0, vue.h)(child, {
|
|
394
|
+
...child.props,
|
|
395
|
+
"data-orientation": orientation,
|
|
396
|
+
"data-first-section": index === 0 ? true : void 0,
|
|
397
|
+
"data-last-section": index === total - 1 ? true : void 0
|
|
398
|
+
});
|
|
399
|
+
return child;
|
|
400
|
+
});
|
|
401
|
+
});
|
|
402
|
+
__expose({ root: (0, vue.computed)(() => _root.value?.root ?? null) });
|
|
403
|
+
const __returned__ = {
|
|
404
|
+
_root,
|
|
405
|
+
attrs,
|
|
406
|
+
slots,
|
|
407
|
+
rawProps,
|
|
408
|
+
defaultProps,
|
|
409
|
+
props,
|
|
410
|
+
knownProps,
|
|
411
|
+
styleProps,
|
|
412
|
+
getStyles,
|
|
413
|
+
rootAttrs,
|
|
414
|
+
mergedAttrs,
|
|
415
|
+
isCardSection,
|
|
416
|
+
processedChildren,
|
|
417
|
+
CPaper: require_paper.default
|
|
418
|
+
};
|
|
419
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
420
|
+
enumerable: false,
|
|
421
|
+
value: true
|
|
422
|
+
});
|
|
423
|
+
return __returned__;
|
|
424
|
+
}
|
|
425
|
+
});
|
|
426
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
427
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)($setup["CPaper"], (0, vue.mergeProps)({ ref: "_root" }, $setup.mergedAttrs, {
|
|
428
|
+
"data-orientation": $setup.props.orientation,
|
|
429
|
+
unstyled: $setup.props.unstyled
|
|
430
|
+
}), {
|
|
431
|
+
default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)($setup.processedChildren, (item, idx) => {
|
|
432
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(item), { key: item.key ?? idx });
|
|
433
|
+
}), 128))]),
|
|
434
|
+
_: 1
|
|
435
|
+
}, 16, ["data-orientation", "unstyled"]);
|
|
436
|
+
}
|
|
437
|
+
var card_default = /*#__PURE__*/ require_export_helper.default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/cck-ui/cck-ui/packages/@cck-ui/core/src/components/card/card.vue"]]);
|
|
438
|
+
//#endregion
|
|
439
|
+
exports.default = card_default;
|
|
440
|
+
|
|
441
|
+
//# sourceMappingURL=card.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.cjs","names":[],"sources":["../../../src/components/card/card.vue"],"sourcesContent":["<template>\n <c-paper\n ref=\"_root\"\n v-bind=\"mergedAttrs\"\n :data-orientation=\"props.orientation\"\n :unstyled=\"props.unstyled\"\n >\n <template v-for=\"(item, idx) in processedChildren\" :key=\"item.key ?? idx\">\n <component :is=\"item\" />\n </template>\n </c-paper>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, h, provide, ref, useAttrs, useSlots } from 'vue'\nimport CPaper from '../paper/paper.vue'\nimport { CardFactory, CardProps } from './card.types'\nimport { CStyleProp, filterFalsyChildren, useComponentProps, useStyles } from '../../core'\nimport { varsResolver } from './card.utils'\nimport classes from './card.module.css'\nimport { CARD_CONTEXT_KEY } from './card.constant.js'\n\ndefineOptions({\n name: 'CCard',\n})\n\nconst _root = ref<InstanceType<typeof CPaper> | null>(null)\n\nconst attrs = useAttrs()\nconst slots = useSlots()\n\nconst rawProps = defineProps<CardProps>()\n\nconst defaultProps = {\n orientation: 'vertical',\n} satisfies Partial<CardProps>\n\nconst props = useComponentProps({\n component: 'CCard',\n defaultProps,\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'padding',\n 'attributes',\n 'orientation',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<CardFactory>({\n name: 'Card',\n classes,\n props: styleProps,\n className: () => props.value.className,\n style: () => props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n})\n\nprovide(CARD_CONTEXT_KEY, { getStyles })\n\nconst rootAttrs = computed(() => getStyles('root'))\n\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n Object.keys(propsValue).forEach((key) => {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n })\n const userMod = props.value.mod\n const mergedMod = [...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean))]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\nfunction isCardSection(vnode: any) {\n if (!vnode || !vnode.type) {\n return false\n }\n const type = vnode.type\n if (typeof type === 'object' && 'name' in type) {\n return type.name === 'CCardSection'\n }\n return false\n}\n\nconst processedChildren = computed(() => {\n const children = filterFalsyChildren(slots.default?.())\n const orientation = props.value.orientation\n const total = children.length\n\n return children.map((child, index) => {\n if (isCardSection(child)) {\n return h(child, {\n ...child.props,\n 'data-orientation': orientation,\n 'data-first-section': index === 0 ? true : undefined,\n 'data-last-section': index === total - 1 ? true : undefined,\n })\n }\n return child\n })\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.constant.cjs","names":[],"sources":["../../../src/components/card/card.constant.ts"],"sourcesContent":["import { InjectionKey } from 'vue'\nimport { CardContextValue } from './card.context'\n\nexport const CARD_CONTEXT_KEY: InjectionKey<CardContextValue> = Symbol('CardContext')\n"],"mappings":";;AAGA,MAAa,mBAAmD,OAAO,aAAa"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region packages/@cck-ui/core/src/components/card/card.module.css
|
|
3
|
+
var card_module_default = {
|
|
4
|
+
"root": "m_6ea3917f",
|
|
5
|
+
"section": "m_4fcecd28"
|
|
6
|
+
};
|
|
7
|
+
//#endregion
|
|
8
|
+
exports.default = card_module_default;
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=card.module.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.module.cjs","names":[],"sources":["../../../src/components/card/card.module.css"],"sourcesContent":[".root {\n --card-padding: var(--c-spacing-md);\n\n position: relative;\n overflow: hidden;\n display: flex;\n padding: var(--card-padding);\n color: var(--c-color-text);\n\n &:where([data-orientation='horizontal']) {\n flex-direction: row;\n }\n\n &:where([data-orientation='vertical']) {\n flex-direction: column;\n }\n\n @mixin where-light {\n background-color: var(--c-color-white);\n }\n\n @mixin where-dark {\n background-color: var(--c-color-dark-6);\n }\n}\n\n.section {\n display: block;\n margin-inline: calc(var(--card-padding) * -1);\n\n @mixin where-light {\n --border-color: var(--c-color-gray-3);\n }\n\n @mixin where-dark {\n --border-color: var(--c-color-dark-4);\n }\n\n &:where([data-orientation='vertical']) {\n &:first-child {\n margin-top: calc(var(--card-padding) * -1);\n border-top: none !important;\n }\n\n &:last-child {\n margin-bottom: calc(var(--card-padding) * -1);\n border-bottom: none !important;\n }\n\n &[data-inherit-padding] {\n padding-inline: var(--card-padding);\n }\n\n &[data-with-border] {\n border-top: 1px solid var(--border-color);\n border-bottom: 1px solid var(--border-color);\n }\n\n & + & {\n border-top: none !important;\n }\n }\n\n &:where([data-orientation='horizontal']) {\n margin-block: calc(var(--card-padding) * -1);\n margin-inline: 0;\n\n &:first-child {\n margin-inline-start: calc(var(--card-padding) * -1);\n border-inline-start: none !important;\n }\n\n &:last-child {\n margin-inline-end: calc(var(--card-padding) * -1);\n border-inline-end: none !important;\n }\n\n &[data-inherit-padding] {\n padding-block: var(--card-padding);\n }\n\n &[data-with-border] {\n border-inline-start: 1px solid var(--border-color);\n border-inline-end: 1px solid var(--border-color);\n }\n\n & + & {\n border-inline-start: none !important;\n }\n }\n}\n"],"mappings":";;AAAA,IAAA,sBAAe;CAAC,QAAO;CAAa,WAAU;AAAY"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const require_get_size = require("../../core/utils/get-size/get-size.cjs");
|
|
3
|
+
//#region packages/@cck-ui/core/src/components/card/card.utils.ts
|
|
4
|
+
const varsResolver = require("../../core/styles-api/create-vars-resolver/create-vars-resolver.cjs").createVarsResolver((_, { padding }) => ({ root: { "--card-padding": require_get_size.getSpacing(padding) } }));
|
|
5
|
+
//#endregion
|
|
6
|
+
exports.varsResolver = varsResolver;
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=card.utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.utils.cjs","names":["createVarsResolver","getSpacing"],"sources":["../../../src/components/card/card.utils.ts"],"sourcesContent":["import { createVarsResolver, getSpacing } from '../../core'\nimport { CardFactory } from './card.types'\n\nexport const varsResolver = createVarsResolver<CardFactory>((_, { padding }) => ({\n root: {\n '--card-padding': getSpacing(padding),\n },\n}))\n"],"mappings":";;;AAGA,MAAa,4FAAeA,CAAAA,CAAAA,oBAAiC,GAAG,EAAE,eAAe,EAC/E,MAAM,EACJ,kBAAkBC,iBAAAA,WAAW,OAAO,EACtC,EACF,EAAE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const require_install = require("../../core/utils/vue/install.cjs");
|
|
3
|
+
const require_statics = require("../../core/utils/vue/statics.cjs");
|
|
4
|
+
const require_card_section = require("./card-section/card-section.cjs");
|
|
5
|
+
const require_card_module = require("./card.module.cjs");
|
|
6
|
+
const require_card_utils = require("./card.utils.cjs");
|
|
7
|
+
const require_card = require("./card.cjs");
|
|
8
|
+
//#region packages/@cck-ui/core/src/components/card/index.ts
|
|
9
|
+
const CardWithStatic = require_statics.withPropsFactory(require_statics.withExtend(require_statics.withVarsResolver(require_statics.withClasses(require_card.default, require_card_module.default), require_card_utils.varsResolver)));
|
|
10
|
+
const CardSectionWithStatic = require_statics.withPropsFactory(require_statics.withExtend(require_statics.withClasses(require_card_section.default, require_card_module.default)));
|
|
11
|
+
const CCardSection = require_install.withInstall(CardSectionWithStatic);
|
|
12
|
+
const CCard = require_install.withInstall(CardWithStatic, { Section: require_card_section.default });
|
|
13
|
+
//#endregion
|
|
14
|
+
exports.CCard = CCard;
|
|
15
|
+
exports.default = CCard;
|
|
16
|
+
exports.CCardSection = CCardSection;
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["withPropsFactory","withExtend","withVarsResolver","withClasses","Card","classes","varsResolver","CardSection","withInstall"],"sources":["../../../src/components/card/index.ts"],"sourcesContent":["import {\n SFCWithInstallAndClasses,\n withClasses,\n withExtend,\n withInstall,\n withPropsFactory,\n withVarsResolver,\n} from '../../core'\nimport CardSection from './card-section/card-section.vue'\nimport classes from './card.module.css'\nimport { varsResolver } from './card.utils'\nimport Card from './card.vue'\n\nconst CardWithStatic = withPropsFactory(\n withExtend(withVarsResolver(withClasses(Card, classes), varsResolver))\n)\nconst CardSectionWithStatic = withPropsFactory(withExtend(withClasses(CardSection, classes)))\n\nexport const CCardSection: SFCWithInstallAndClasses<typeof CardSection> =\n withInstall(CardSectionWithStatic)\nexport const CCard: SFCWithInstallAndClasses<typeof Card, typeof classes> & {\n Section: typeof CardSection\n} = withInstall(CardWithStatic, { Section: CardSection })\n\nexport default CCard\n\nexport * from './card-section/card-section.types'\nexport * from './card.types'\n"],"mappings":";;;;;;;;AAaA,MAAM,iBAAiBA,gBAAAA,iBACrBC,gBAAAA,WAAWC,gBAAAA,iBAAiBC,gBAAAA,YAAYC,aAAAA,SAAMC,oBAAAA,OAAO,GAAGC,mBAAAA,YAAY,CAAC,CACvE;AACA,MAAM,wBAAwBN,gBAAAA,iBAAiBC,gBAAAA,WAAWE,gBAAAA,YAAYI,qBAAAA,SAAaF,oBAAAA,OAAO,CAAC,CAAC;AAE5F,MAAa,eACXG,gBAAAA,YAAY,qBAAqB;AACnC,MAAa,QAETA,gBAAAA,YAAY,gBAAgB,EAAE,SAASD,qBAAAA,QAAY,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
const require_install = require("../../core/utils/vue/install.cjs");
|
|
3
3
|
const require_statics = require("../../core/utils/vue/statics.cjs");
|
|
4
|
-
const require_paper_utils = require("./paper.utils.cjs");
|
|
5
4
|
const require_paper_module = require("./paper.module.cjs");
|
|
5
|
+
const require_paper_utils = require("./paper.utils.cjs");
|
|
6
6
|
const require_paper = require("./paper.cjs");
|
|
7
7
|
//#region packages/@cck-ui/core/src/components/paper/index.ts
|
|
8
8
|
const PaperWithStatic = require_statics.withPropsFactory(require_statics.withExtend(require_statics.withVarsResolver(require_statics.withClasses(require_paper.default, require_paper_module.default), require_paper_utils.varsResolver)));
|
|
@@ -3,8 +3,8 @@ const require_export_helper = require("../../_virtual/_/plugin-vue/export-helper
|
|
|
3
3
|
const require_use_component_props = require("../../core/config-provider/use-component-props/use-component-props.cjs");
|
|
4
4
|
const require_index = require("../../core/box/index.cjs");
|
|
5
5
|
const require_use_styles = require("../../core/styles-api/use-styles/use-styles.cjs");
|
|
6
|
-
const require_paper_utils = require("./paper.utils.cjs");
|
|
7
6
|
const require_paper_module = require("./paper.module.cjs");
|
|
7
|
+
const require_paper_utils = require("./paper.utils.cjs");
|
|
8
8
|
let vue = require("vue");
|
|
9
9
|
//#region packages/@cck-ui/core/src/components/paper/paper.vue
|
|
10
10
|
const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
let vue = require("vue");
|
|
3
|
+
//#region packages/@cck-ui/core/src/core/utils/filter-falsy-children/filter-falsy-children.ts
|
|
4
|
+
function filterFalsyChildren(children) {
|
|
5
|
+
const nodes = Array.isArray(children) ? children : children ? [children] : [];
|
|
6
|
+
function process(node) {
|
|
7
|
+
if (Array.isArray(node)) return node.flatMap((item) => process(item));
|
|
8
|
+
if (!(0, vue.isVNode)(node)) return [];
|
|
9
|
+
if (node.type === vue.Fragment) return process(Array.isArray(node.children) ? node.children : node.children ? [node.children] : []);
|
|
10
|
+
return [node];
|
|
11
|
+
}
|
|
12
|
+
return process(nodes);
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
exports.filterFalsyChildren = filterFalsyChildren;
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=filter-falsy-children.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-falsy-children.cjs","names":["Fragment"],"sources":["../../../../src/core/utils/filter-falsy-children/filter-falsy-children.ts"],"sourcesContent":["import { Fragment, isVNode, VNode } from 'vue'\n\nexport function filterFalsyChildren(children: unknown): VNode[] {\n const nodes = Array.isArray(children) ? children : children ? [children] : []\n\n function process(node: unknown): VNode[] {\n if (Array.isArray(node)) {\n return node.flatMap((item) => process(item))\n }\n\n if (!isVNode(node)) {\n return []\n }\n\n if (node.type === Fragment) {\n const childNodes = Array.isArray(node.children)\n ? node.children\n : node.children\n ? [node.children]\n : []\n return process(childNodes)\n }\n\n return [node]\n }\n\n return process(nodes)\n}\n"],"mappings":";;;AAEA,SAAgB,oBAAoB,UAA4B;CAC9D,MAAM,QAAQ,MAAM,QAAQ,QAAQ,IAAI,WAAW,WAAW,CAAC,QAAQ,IAAI,CAAC;CAE5E,SAAS,QAAQ,MAAwB;EACvC,IAAI,MAAM,QAAQ,IAAI,GACpB,OAAO,KAAK,SAAS,SAAS,QAAQ,IAAI,CAAC;EAG7C,IAAI,EAAA,GAAA,IAAA,QAAA,CAAS,IAAI,GACf,OAAO,CAAC;EAGV,IAAI,KAAK,SAASA,IAAAA,UAMhB,OAAO,QALY,MAAM,QAAQ,KAAK,QAAQ,IAC1C,KAAK,WACL,KAAK,WACH,CAAC,KAAK,QAAQ,IACd,CAAC,CACkB;EAG3B,OAAO,CAAC,IAAI;CACd;CAEA,OAAO,QAAQ,KAAK;AACtB"}
|