@cck-ui/core 0.32.0 → 0.33.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.
@@ -0,0 +1,488 @@
1
+ "use client";
2
+ import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.mjs";
3
+ import { useComponentProps } from "../../core/config-provider/use-component-props/use-component-props.mjs";
4
+ import { CBox } from "../../core/box/index.mjs";
5
+ import { useStyles } from "../../core/styles-api/use-styles/use-styles.mjs";
6
+ import badge_module_default from "./badge.module.mjs";
7
+ import { varsResolver } from "./badge.utils.mjs";
8
+ import { computed, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, mergeProps, openBlock, ref, renderSlot, resolveDynamicComponent, useAttrs, useSlots, withCtx } from "vue";
9
+ //#region packages/@cck-ui/core/src/components/badge/badge.vue
10
+ const _sfc_main = /*@__PURE__*/ defineComponent({
11
+ name: "CBadge",
12
+ __name: "badge",
13
+ props: {
14
+ size: {
15
+ type: [String, Object],
16
+ required: false
17
+ },
18
+ circle: {
19
+ type: Boolean,
20
+ required: false
21
+ },
22
+ radius: {
23
+ type: null,
24
+ required: false
25
+ },
26
+ color: {
27
+ type: null,
28
+ required: false
29
+ },
30
+ gradient: {
31
+ type: Object,
32
+ required: false
33
+ },
34
+ leftSection: {
35
+ type: [String, Object],
36
+ required: false
37
+ },
38
+ rightSection: {
39
+ type: [String, Object],
40
+ required: false
41
+ },
42
+ fullWidth: {
43
+ type: Boolean,
44
+ required: false
45
+ },
46
+ autoContrast: {
47
+ type: Boolean,
48
+ required: false
49
+ },
50
+ className: {
51
+ type: String,
52
+ required: false
53
+ },
54
+ style: {
55
+ type: [
56
+ Object,
57
+ Function,
58
+ Array
59
+ ],
60
+ required: false,
61
+ skipCheck: true
62
+ },
63
+ __vars: {
64
+ type: null,
65
+ required: false
66
+ },
67
+ __size: {
68
+ type: String,
69
+ required: false
70
+ },
71
+ hiddenFrom: {
72
+ type: null,
73
+ required: false
74
+ },
75
+ visibleFrom: {
76
+ type: null,
77
+ required: false
78
+ },
79
+ lightHidden: {
80
+ type: Boolean,
81
+ required: false
82
+ },
83
+ darkHidden: {
84
+ type: Boolean,
85
+ required: false
86
+ },
87
+ mod: {
88
+ type: [
89
+ Object,
90
+ String,
91
+ Array
92
+ ],
93
+ required: false
94
+ },
95
+ m: {
96
+ type: null,
97
+ required: false
98
+ },
99
+ my: {
100
+ type: null,
101
+ required: false
102
+ },
103
+ mx: {
104
+ type: null,
105
+ required: false
106
+ },
107
+ mt: {
108
+ type: null,
109
+ required: false
110
+ },
111
+ mb: {
112
+ type: null,
113
+ required: false
114
+ },
115
+ ms: {
116
+ type: null,
117
+ required: false
118
+ },
119
+ me: {
120
+ type: null,
121
+ required: false
122
+ },
123
+ mis: {
124
+ type: null,
125
+ required: false
126
+ },
127
+ mie: {
128
+ type: null,
129
+ required: false
130
+ },
131
+ ml: {
132
+ type: null,
133
+ required: false
134
+ },
135
+ mr: {
136
+ type: null,
137
+ required: false
138
+ },
139
+ p: {
140
+ type: null,
141
+ required: false
142
+ },
143
+ py: {
144
+ type: null,
145
+ required: false
146
+ },
147
+ px: {
148
+ type: null,
149
+ required: false
150
+ },
151
+ pt: {
152
+ type: null,
153
+ required: false
154
+ },
155
+ pb: {
156
+ type: null,
157
+ required: false
158
+ },
159
+ ps: {
160
+ type: null,
161
+ required: false
162
+ },
163
+ pe: {
164
+ type: null,
165
+ required: false
166
+ },
167
+ pis: {
168
+ type: null,
169
+ required: false
170
+ },
171
+ pie: {
172
+ type: null,
173
+ required: false
174
+ },
175
+ pl: {
176
+ type: null,
177
+ required: false
178
+ },
179
+ pr: {
180
+ type: null,
181
+ required: false
182
+ },
183
+ bd: {
184
+ type: null,
185
+ required: false
186
+ },
187
+ bdrs: {
188
+ type: null,
189
+ required: false
190
+ },
191
+ bg: {
192
+ type: null,
193
+ required: false
194
+ },
195
+ c: {
196
+ type: null,
197
+ required: false
198
+ },
199
+ opacity: {
200
+ type: [
201
+ String,
202
+ Object,
203
+ Number
204
+ ],
205
+ required: false
206
+ },
207
+ ff: {
208
+ type: [String, Object],
209
+ required: false
210
+ },
211
+ fz: {
212
+ type: null,
213
+ required: false
214
+ },
215
+ fw: {
216
+ type: null,
217
+ required: false
218
+ },
219
+ lts: {
220
+ type: null,
221
+ required: false
222
+ },
223
+ ta: {
224
+ type: [String, Object],
225
+ required: false
226
+ },
227
+ lh: {
228
+ type: null,
229
+ required: false
230
+ },
231
+ fs: {
232
+ type: null,
233
+ required: false
234
+ },
235
+ tt: {
236
+ type: [String, Object],
237
+ required: false
238
+ },
239
+ td: {
240
+ type: null,
241
+ required: false
242
+ },
243
+ w: {
244
+ type: null,
245
+ required: false
246
+ },
247
+ miw: {
248
+ type: null,
249
+ required: false
250
+ },
251
+ maw: {
252
+ type: null,
253
+ required: false
254
+ },
255
+ h: {
256
+ type: null,
257
+ required: false
258
+ },
259
+ mih: {
260
+ type: null,
261
+ required: false
262
+ },
263
+ mah: {
264
+ type: null,
265
+ required: false
266
+ },
267
+ bgsz: {
268
+ type: null,
269
+ required: false
270
+ },
271
+ bgp: {
272
+ type: null,
273
+ required: false
274
+ },
275
+ bgr: {
276
+ type: null,
277
+ required: false
278
+ },
279
+ bga: {
280
+ type: null,
281
+ required: false
282
+ },
283
+ pos: {
284
+ type: [String, Object],
285
+ required: false
286
+ },
287
+ top: {
288
+ type: null,
289
+ required: false
290
+ },
291
+ left: {
292
+ type: null,
293
+ required: false
294
+ },
295
+ bottom: {
296
+ type: null,
297
+ required: false
298
+ },
299
+ right: {
300
+ type: null,
301
+ required: false
302
+ },
303
+ inset: {
304
+ type: null,
305
+ required: false
306
+ },
307
+ display: {
308
+ type: null,
309
+ required: false
310
+ },
311
+ flex: {
312
+ type: null,
313
+ required: false
314
+ },
315
+ unstyled: {
316
+ type: Boolean,
317
+ required: false
318
+ },
319
+ variant: {
320
+ type: null,
321
+ required: false
322
+ },
323
+ classNames: {
324
+ type: null,
325
+ required: false
326
+ },
327
+ styles: {
328
+ type: null,
329
+ required: false
330
+ },
331
+ vars: {
332
+ type: Function,
333
+ required: false
334
+ },
335
+ attributes: {
336
+ type: null,
337
+ required: false
338
+ }
339
+ },
340
+ setup(__props, { expose: __expose }) {
341
+ const _root = ref(null);
342
+ const _leftSection = ref(null);
343
+ const _rightSection = ref(null);
344
+ const _label = ref(null);
345
+ const attrs = useAttrs();
346
+ const slots = useSlots();
347
+ const withLeftSection = computed(() => !!slots["left-section"] || !!props.value.leftSection);
348
+ const withRightSection = computed(() => !!slots["right-section"] || !!props.value.rightSection);
349
+ const rawProps = __props;
350
+ const props = useComponentProps({
351
+ component: "CBadge",
352
+ defaultProps: {},
353
+ props: rawProps
354
+ });
355
+ const knownProps = [
356
+ "classNames",
357
+ "className",
358
+ "style",
359
+ "styles",
360
+ "unstyled",
361
+ "vars",
362
+ "radius",
363
+ "color",
364
+ "gradient",
365
+ "leftSection",
366
+ "rightSection",
367
+ "variant",
368
+ "fullWidth",
369
+ "autoContrast",
370
+ "circle",
371
+ "mod",
372
+ "attributes"
373
+ ];
374
+ const styleProps = computed(() => ({
375
+ ...props.value,
376
+ ...attrs,
377
+ style: attrs.style ?? props.value.style
378
+ }));
379
+ const getStyles = useStyles({
380
+ name: "Badge",
381
+ props: styleProps,
382
+ classes: badge_module_default,
383
+ className: () => props.value.className,
384
+ style: () => props.value.style,
385
+ classNames: props.value.classNames,
386
+ styles: props.value.styles,
387
+ unstyled: props.value.unstyled,
388
+ attributes: props.value.attributes,
389
+ vars: props.value.vars,
390
+ varsResolver
391
+ });
392
+ const modList = computed(() => [
393
+ { block: props.value.fullWidth },
394
+ { circle: props.value.circle },
395
+ { "with-left-section": withLeftSection.value },
396
+ { "with-right-section": withRightSection.value }
397
+ ]);
398
+ const rootAttrs = computed(() => getStyles("root", { variant: props.value.variant }));
399
+ const mergedRootAttrs = computed(() => {
400
+ const others = {};
401
+ const propsValue = props.value;
402
+ Object.keys(propsValue).forEach((key) => {
403
+ if (!knownProps.includes(key)) others[key] = propsValue[key];
404
+ });
405
+ const userMod = props.value.mod;
406
+ const mergedMod = [...Array.isArray(userMod) ? userMod : [userMod].filter(Boolean), ...modList.value || []];
407
+ return {
408
+ ...others,
409
+ mod: mergedMod,
410
+ ...rootAttrs.value
411
+ };
412
+ });
413
+ const sectionAttrs = computed(() => getStyles("section"));
414
+ const labelAttrs = computed(() => getStyles("label"));
415
+ __expose({
416
+ root: computed(() => _root.value?.root ?? null),
417
+ leftSection: computed(() => _leftSection.value?.root ?? null),
418
+ rightSection: computed(() => _rightSection.value?.root ?? null),
419
+ label: computed(() => _label.value?.root ?? null)
420
+ });
421
+ const __returned__ = {
422
+ _root,
423
+ _leftSection,
424
+ _rightSection,
425
+ _label,
426
+ attrs,
427
+ slots,
428
+ withLeftSection,
429
+ withRightSection,
430
+ rawProps,
431
+ props,
432
+ knownProps,
433
+ styleProps,
434
+ getStyles,
435
+ modList,
436
+ rootAttrs,
437
+ mergedRootAttrs,
438
+ sectionAttrs,
439
+ labelAttrs,
440
+ get CBox() {
441
+ return CBox;
442
+ }
443
+ };
444
+ Object.defineProperty(__returned__, "__isScriptSetup", {
445
+ enumerable: false,
446
+ value: true
447
+ });
448
+ return __returned__;
449
+ }
450
+ });
451
+ const _hoisted_1 = ["innerHTML"];
452
+ const _hoisted_2 = ["innerHTML"];
453
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
454
+ return openBlock(), createBlock($setup["CBox"], mergeProps({ ref: "_root" }, $setup.mergedRootAttrs, { variant: $setup.props.variant }), {
455
+ default: withCtx(() => [
456
+ $setup.withLeftSection ? (openBlock(), createBlock($setup["CBox"], mergeProps({ key: 0 }, $setup.sectionAttrs, {
457
+ tag: "span",
458
+ mod: { position: "left" }
459
+ }), {
460
+ default: withCtx(() => [renderSlot(_ctx.$slots, "left-section", {}, () => [typeof $props.leftSection === "string" ? (openBlock(), createElementBlock("span", {
461
+ key: 0,
462
+ innerHTML: $props.leftSection
463
+ }, null, 8, _hoisted_1)) : (openBlock(), createBlock(resolveDynamicComponent($props.leftSection), { key: 1 }))])]),
464
+ _: 3
465
+ }, 16)) : createCommentVNode("v-if", true),
466
+ createVNode($setup["CBox"], mergeProps({ ref: "_label" }, $setup.labelAttrs, { tag: "span" }), {
467
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
468
+ _: 3
469
+ }, 16),
470
+ $setup.withRightSection ? (openBlock(), createBlock($setup["CBox"], mergeProps({ key: 1 }, $setup.sectionAttrs, {
471
+ tag: "span",
472
+ mod: { position: "right" }
473
+ }), {
474
+ default: withCtx(() => [renderSlot(_ctx.$slots, "right-section", {}, () => [typeof $props.rightSection === "string" ? (openBlock(), createElementBlock("span", {
475
+ key: 0,
476
+ innerHTML: $props.rightSection
477
+ }, null, 8, _hoisted_2)) : (openBlock(), createBlock(resolveDynamicComponent($props.rightSection), { key: 1 }))])]),
478
+ _: 3
479
+ }, 16)) : createCommentVNode("v-if", true)
480
+ ]),
481
+ _: 3
482
+ }, 16, ["variant"]);
483
+ }
484
+ var badge_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/cck-ui/cck-ui/packages/@cck-ui/core/src/components/badge/badge.vue"]]);
485
+ //#endregion
486
+ export { badge_default as default };
487
+
488
+ //# sourceMappingURL=badge.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badge.mjs","names":[],"sources":["../../../src/components/badge/badge.vue"],"sourcesContent":["<template>\n <c-box ref=\"_root\" v-bind=\"mergedRootAttrs\" :variant=\"props.variant\">\n <c-box v-if=\"withLeftSection\" v-bind=\"sectionAttrs\" tag=\"span\" :mod=\"{ position: 'left' }\">\n <slot name=\"left-section\">\n <span v-html=\"leftSection\" v-if=\"typeof leftSection === 'string'\"></span>\n <component v-else :is=\"leftSection\" />\n </slot>\n </c-box>\n <c-box ref=\"_label\" v-bind=\"labelAttrs\" tag=\"span\">\n <slot />\n </c-box>\n <c-box v-if=\"withRightSection\" v-bind=\"sectionAttrs\" tag=\"span\" :mod=\"{ position: 'right' }\">\n <slot name=\"right-section\">\n <span v-html=\"rightSection\" v-if=\"typeof rightSection === 'string'\"></span>\n <component v-else :is=\"rightSection\" />\n </slot>\n </c-box>\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs, useSlots } from 'vue'\nimport { CBox, CStyleProp, useComponentProps, useStyles } from '../../core'\nimport classes from './badge.module.css'\nimport { BadgeFactory, BadgeProps } from './badge.types'\nimport { varsResolver } from './badge.utils'\n\ndefineOptions({\n name: 'CBadge',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\nconst _leftSection = ref<InstanceType<typeof CBox> | null>(null)\nconst _rightSection = ref<InstanceType<typeof CBox> | null>(null)\nconst _label = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\nconst slots = useSlots()\n\nconst withLeftSection = computed(() => !!slots['left-section'] || !!props.value.leftSection)\nconst withRightSection = computed(() => !!slots['right-section'] || !!props.value.rightSection)\n\nconst rawProps = defineProps<BadgeProps>()\n\nconst props = useComponentProps({\n component: 'CBadge',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'radius',\n 'color',\n 'gradient',\n 'leftSection',\n 'rightSection',\n 'variant',\n 'fullWidth',\n 'autoContrast',\n 'circle',\n 'mod',\n 'attributes',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<BadgeFactory>({\n name: 'Badge',\n props: styleProps,\n classes,\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\nconst modList = computed(() => [\n { block: props.value.fullWidth },\n { circle: props.value.circle },\n { 'with-left-section': withLeftSection.value },\n { 'with-right-section': withRightSection.value },\n])\n\nconst rootAttrs = computed(() => getStyles('root', { variant: props.value.variant }))\n\nconst mergedRootAttrs = 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 = [\n ...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)),\n ...(modList.value || []),\n ]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\nconst sectionAttrs = computed(() => getStyles('section'))\nconst labelAttrs = computed(() => getStyles('label'))\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n leftSection: computed(() => _leftSection.value?.root ?? null),\n rightSection: computed(() => _rightSection.value?.root ?? null),\n label: computed(() => _label.value?.root ?? null),\n})\n</script>\n"],"mappings":"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"}
@@ -0,0 +1,12 @@
1
+ "use client";
2
+ //#region packages/@cck-ui/core/src/components/badge/badge.module.css
3
+ var badge_module_default = {
4
+ "root": "m_bdabd4cc",
5
+ "root--dot": "m_3745665d",
6
+ "label": "m_f773a84a",
7
+ "section": "m_625eaabb"
8
+ };
9
+ //#endregion
10
+ export { badge_module_default as default };
11
+
12
+ //# sourceMappingURL=badge.module.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badge.module.mjs","names":[],"sources":["../../../src/components/badge/badge.module.css"],"sourcesContent":[".root {\n --badge-height-xs: 16px;\n --badge-height-sm: 18px;\n --badge-height-md: 20px;\n --badge-height-lg: 26px;\n --badge-height-xl: 32px;\n\n --badge-fz-xs: 9px;\n --badge-fz-sm: 10px;\n --badge-fz-md: 11px;\n --badge-fz-lg: 13px;\n --badge-fz-xl: 16px;\n\n --badge-padding-x-xs: 6px;\n --badge-padding-x-sm: 8px;\n --badge-padding-x-md: 10px;\n --badge-padding-x-lg: 12px;\n --badge-padding-x-xl: 16px;\n\n --badge-height: var(--badge-height-md);\n --badge-fz: var(--badge-fz-md);\n --badge-padding-x: var(--badge-padding-x-md);\n --badge-radius: 1000px;\n --badge-lh: calc(var(--badge-height) - rem(2px));\n --badge-border-width: rem(1px);\n\n -webkit-tap-highlight-color: transparent;\n font-size: var(--badge-fz);\n border-radius: var(--badge-radius);\n height: var(--badge-height);\n line-height: var(--badge-lh);\n text-decoration: none;\n padding: 0 var(--badge-padding-x);\n display: inline-grid;\n align-items: center;\n justify-content: center;\n width: fit-content;\n text-transform: uppercase;\n font-weight: var(--c-font-weight-bold);\n letter-spacing: 0.25px;\n cursor: default;\n text-overflow: ellipsis;\n overflow: hidden;\n color: var(--badge-color, var(--c-color-default-color));\n background: var(--badge-bg, var(--c-color-default));\n border: var(--badge-bd, var(--badge-border-width) solid var(--c-color-default-border));\n\n &:where([data-with-left-section], [data-variant='dot']) {\n grid-template-columns: auto 1fr;\n }\n\n &:where([data-with-right-section]) {\n grid-template-columns: 1fr auto;\n }\n\n &:where(\n [data-with-left-section][data-with-right-section],\n [data-variant='dot'][data-with-right-section]\n ) {\n grid-template-columns: auto 1fr auto;\n }\n\n &:where([data-block]) {\n display: flex;\n width: 100%;\n }\n\n &:where([data-circle]) {\n padding-inline: 2px;\n display: flex;\n width: var(--badge-height);\n }\n}\n\n.root--dot {\n --badge-dot-size: calc(var(--badge-height) / 3.4);\n\n @mixin where-light {\n background-color: var(--c-color-white);\n border-color: var(--c-color-gray-4);\n color: var(--c-color-black);\n }\n\n @mixin where-dark {\n background-color: var(--c-color-dark-5);\n border-color: var(--c-color-dark-5);\n color: var(--c-color-white);\n }\n\n &::before {\n content: '';\n display: block;\n width: var(--badge-dot-size);\n height: var(--badge-dot-size);\n border-radius: var(--badge-dot-size);\n background-color: var(--badge-dot-color);\n margin-inline-end: var(--badge-dot-size);\n }\n}\n\n.label {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n text-align: center;\n cursor: inherit;\n}\n\n.section {\n --badge-section-margin: calc(var(--c-spacing-xs) / 2);\n\n display: inline-flex;\n justify-content: center;\n align-items: center;\n max-height: calc(var(--badge-height) - var(--badge-border-width) * 2);\n\n &:where([data-position='left']) {\n margin-inline-end: var(--badge-section-margin);\n }\n\n &:where([data-position='right']) {\n margin-inline-start: var(--badge-section-margin);\n }\n}\n"],"mappings":";;AAAA,IAAA,uBAAe;CAAC,QAAO;CAAa,aAAY;CAAa,SAAQ;CAAa,WAAU;AAAY"}
@@ -0,0 +1,28 @@
1
+ "use client";
2
+ import { getRadius, getSize } from "../../core/utils/get-size/get-size.mjs";
3
+ import { getThemeColor } from "../../core/config-provider/color-functions/get-theme-color/get-theme-color.mjs";
4
+ import { createVarsResolver } from "../../core/styles-api/create-vars-resolver/create-vars-resolver.mjs";
5
+ //#region packages/@cck-ui/core/src/components/badge/badge.utils.ts
6
+ const varsResolver = createVarsResolver((theme, { radius, color, gradient, variant, size, autoContrast, circle }) => {
7
+ const colors = theme.variantColorResolver({
8
+ color: color || theme.primaryColor,
9
+ theme,
10
+ gradient,
11
+ variant: variant || "default",
12
+ autoContrast
13
+ });
14
+ return { root: {
15
+ "--badge-bd": color || variant ? colors.border : void 0,
16
+ "--badge-bg": color || variant ? colors.background : void 0,
17
+ "--badge-color": color || variant ? colors.color : void 0,
18
+ "--badge-dot-color": variant === "dot" ? getThemeColor(color, theme) : void 0,
19
+ "--badge-fz": getSize(size, "badge-fz"),
20
+ "--badge-height": getSize(size, "badge-height"),
21
+ "--badge-padding-x": getSize(size, "badge-padding-x"),
22
+ "--badge-radius": circle || radius === void 0 ? void 0 : getRadius(radius)
23
+ } };
24
+ });
25
+ //#endregion
26
+ export { varsResolver };
27
+
28
+ //# sourceMappingURL=badge.utils.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badge.utils.mjs","names":[],"sources":["../../../src/components/badge/badge.utils.ts"],"sourcesContent":["import { createVarsResolver, getRadius, getSize, getThemeColor } from '../../core'\nimport { BadgeFactory } from './badge.types'\n\nexport const varsResolver = createVarsResolver<BadgeFactory>(\n (theme, { radius, color, gradient, variant, size, autoContrast, circle }) => {\n const colors = theme.variantColorResolver({\n color: color || theme.primaryColor,\n theme,\n gradient,\n variant: variant || 'default',\n autoContrast,\n })\n return {\n root: {\n '--badge-bd': color || variant ? colors.border : undefined,\n '--badge-bg': color || variant ? colors.background : undefined,\n '--badge-color': color || variant ? colors.color : undefined,\n '--badge-dot-color': variant === 'dot' ? getThemeColor(color, theme) : undefined,\n '--badge-fz': getSize(size, 'badge-fz'),\n '--badge-height': getSize(size, 'badge-height'),\n '--badge-padding-x': getSize(size, 'badge-padding-x'),\n '--badge-radius': circle || radius === undefined ? undefined : getRadius(radius),\n },\n }\n }\n)\n"],"mappings":";;;;;AAGA,MAAa,eAAe,oBACzB,OAAO,EAAE,QAAQ,OAAO,UAAU,SAAS,MAAM,cAAc,aAAa;CAC3E,MAAM,SAAS,MAAM,qBAAqB;EACxC,OAAO,SAAS,MAAM;EACtB;EACA;EACA,SAAS,WAAW;EACpB;CACF,CAAC;CACD,OAAO,EACL,MAAM;EACJ,cAAc,SAAS,UAAU,OAAO,SAAS,KAAA;EACjD,cAAc,SAAS,UAAU,OAAO,aAAa,KAAA;EACrD,iBAAiB,SAAS,UAAU,OAAO,QAAQ,KAAA;EACnD,qBAAqB,YAAY,QAAQ,cAAc,OAAO,KAAK,IAAI,KAAA;EACvE,cAAc,QAAQ,MAAM,UAAU;EACtC,kBAAkB,QAAQ,MAAM,cAAc;EAC9C,qBAAqB,QAAQ,MAAM,iBAAiB;EACpD,kBAAkB,UAAU,WAAW,KAAA,IAAY,KAAA,IAAY,UAAU,MAAM;CACjF,EACF;AACF,CACF"}
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ import { withInstall } from "../../core/utils/vue/install.mjs";
3
+ import { withClasses, withExtend, withPropsFactory, withVarsResolver } from "../../core/utils/vue/statics.mjs";
4
+ import badge_module_default from "./badge.module.mjs";
5
+ import { varsResolver } from "./badge.utils.mjs";
6
+ import badge_default from "./badge.mjs";
7
+ const CBadge = withInstall(withPropsFactory(withExtend(withVarsResolver(withClasses(badge_default, badge_module_default), varsResolver))));
8
+ //#endregion
9
+ export { CBadge, CBadge as default };
10
+
11
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["Badge","classes"],"sources":["../../../src/components/badge/index.ts"],"sourcesContent":["import {\n SFCWithInstallAndClasses,\n withClasses,\n withExtend,\n withInstall,\n withPropsFactory,\n withVarsResolver,\n} from '../../core'\nimport classes from './badge.module.css'\nimport { varsResolver } from './badge.utils'\nimport Badge from './badge.vue'\n\nconst BadgeWithStatic = withPropsFactory(\n withExtend(withVarsResolver(withClasses(Badge, classes), varsResolver))\n)\n\nexport const CBadge: SFCWithInstallAndClasses<typeof Badge, typeof classes> =\n withInstall(BadgeWithStatic)\n\nexport default CBadge\n\nexport * from './badge.types'\n"],"mappings":";;;;;;AAgBA,MAAa,SACX,YALsB,iBACtB,WAAW,iBAAiB,YAAYA,eAAOC,oBAAO,GAAG,YAAY,CAAC,CAI1D,CAAe"}
package/esm/index.mjs CHANGED
@@ -66,6 +66,7 @@ import { CAnchor } from "./components/anchor/index.mjs";
66
66
  import { CAspectRatio } from "./components/aspect-ratio/index.mjs";
67
67
  import { CAvatar, CAvatarGroup } from "./components/avatar/index.mjs";
68
68
  import { CBackgroundImage } from "./components/background-image/index.mjs";
69
+ import { CBadge } from "./components/badge/index.mjs";
69
70
  import { CBreadcrumbs } from "./components/breadcrumbs/index.mjs";
70
71
  import { CBurger } from "./components/burger/index.mjs";
71
72
  import { CButton, CButtonGroup, CButtonGroupSection } from "./components/button/index.mjs";
@@ -104,6 +105,7 @@ const components = [
104
105
  CAvatar,
105
106
  CAvatarGroup,
106
107
  CBackgroundImage,
108
+ CBadge,
107
109
  CBreadcrumbs,
108
110
  CBurger,
109
111
  CButton,
@@ -150,6 +152,6 @@ const CckUI = { install(app) {
150
152
  });
151
153
  } };
152
154
  //#endregion
153
- export { CActionIcon, CActionIconGroup, CActionIconGroupSection, CAffix, CAlert, CAnchor, CAspectRatio, CAvatar, CAvatarGroup, CBackgroundImage, CBox, CBreadcrumbs, CBurger, CButton, CButtonGroup, CButtonGroupSection, transitions as CCK_TRANSITIONS, CCenter, CCloseButton, CCol, CContainer, CCopyButton, CDefaultLoaders, CDivider, CEmptyState, CEmptyStateActions, CEmptyStateDescription, CEmptyStateIndicator, CEmptyStateTitle, CFileButton, CFlex, CFocusTrap, CGrid, CGroup, CImage, CLoader, CONFIG_KEY, CPaper, CPortal, CSemiCircleProgress, CSimpleGrid, CSkeleton, CSpace, CSplitter, CSplitterPane, CStack, CText, CTransition, CTypography, CVisuallyHidden, CckConfigProvider, CckUI, CckUI as default, DEFAULT_THEME, FOCUS_CLASS_NAMES, STYLE_PROPS_DATA, THEME_KEY, UnstyledButton, alpha, camelToKebabCase, colorsTuple, createTheme, createVarsResolver, darken, deepMerge, defaultCssVariablesResolver, defaultVariantColorsResolver, em, extractStyleProps, filterProps, getBaseValue, getBreakpointValue, getCSSColorVariables, getComponentName, getDefaultZIndex, getFontSize, getGradient, getLineHeight, getPrimaryShade, getRadius, getShadow, getSize, getSortedBreakpoints, getSpacing, getThemeColor, getTransitionProps, hashStyleProps, isLightColor, isNumber, isNumberLike, isString, isStringNumber, isUndefined, isVirtualColor, keys, luminance, mergeThemeOverrides, normalizeNumberLikeStringProp, numberLikeStringToNumber, parseStyleProps, parseThemeColor, px, rem, resolveClassNames, resolveStyles, responsiveStyleManager, rgb, rgba, stylesToString, toRgba, useCckClassNamesPrefix, useCckColorScheme, useCckCssVariablesResolver, useCckEnv, useCckIsHeadless, useCckStyleNonce, useCckStylesTransform, useCckSxTransform, useCckTheme, useCckWithStaticClasses, useComponentProps, useConfigContext, useProviderColorScheme, useRandomClassName, useStyles, virtualColor, withClasses, withExtend, withInstall, withPropsDefaultSetter, withPropsFactory, withVarsResolver };
155
+ export { CActionIcon, CActionIconGroup, CActionIconGroupSection, CAffix, CAlert, CAnchor, CAspectRatio, CAvatar, CAvatarGroup, CBackgroundImage, CBadge, CBox, CBreadcrumbs, CBurger, CButton, CButtonGroup, CButtonGroupSection, transitions as CCK_TRANSITIONS, CCenter, CCloseButton, CCol, CContainer, CCopyButton, CDefaultLoaders, CDivider, CEmptyState, CEmptyStateActions, CEmptyStateDescription, CEmptyStateIndicator, CEmptyStateTitle, CFileButton, CFlex, CFocusTrap, CGrid, CGroup, CImage, CLoader, CONFIG_KEY, CPaper, CPortal, CSemiCircleProgress, CSimpleGrid, CSkeleton, CSpace, CSplitter, CSplitterPane, CStack, CText, CTransition, CTypography, CVisuallyHidden, CckConfigProvider, CckUI, CckUI as default, DEFAULT_THEME, FOCUS_CLASS_NAMES, STYLE_PROPS_DATA, THEME_KEY, UnstyledButton, alpha, camelToKebabCase, colorsTuple, createTheme, createVarsResolver, darken, deepMerge, defaultCssVariablesResolver, defaultVariantColorsResolver, em, extractStyleProps, filterProps, getBaseValue, getBreakpointValue, getCSSColorVariables, getComponentName, getDefaultZIndex, getFontSize, getGradient, getLineHeight, getPrimaryShade, getRadius, getShadow, getSize, getSortedBreakpoints, getSpacing, getThemeColor, getTransitionProps, hashStyleProps, isLightColor, isNumber, isNumberLike, isString, isStringNumber, isUndefined, isVirtualColor, keys, luminance, mergeThemeOverrides, normalizeNumberLikeStringProp, numberLikeStringToNumber, parseStyleProps, parseThemeColor, px, rem, resolveClassNames, resolveStyles, responsiveStyleManager, rgb, rgba, stylesToString, toRgba, useCckClassNamesPrefix, useCckColorScheme, useCckCssVariablesResolver, useCckEnv, useCckIsHeadless, useCckStyleNonce, useCckStylesTransform, useCckSxTransform, useCckTheme, useCckWithStaticClasses, useComponentProps, useConfigContext, useProviderColorScheme, useRandomClassName, useStyles, virtualColor, withClasses, withExtend, withInstall, withPropsDefaultSetter, withPropsFactory, withVarsResolver };
154
156
 
155
157
  //# sourceMappingURL=index.mjs.map
package/esm/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { App, Plugin } from 'vue'\nimport {\n CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAffix,\n CAlert,\n CAnchor,\n CAspectRatio,\n CAvatar,\n CAvatarGroup,\n CBackgroundImage,\n CBreadcrumbs,\n CBurger,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CCopyButton,\n CDivider,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFileButton,\n CFlex,\n CFocusTrap,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CPortal,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n CTypography,\n CVisuallyHidden,\n UnstyledButton,\n} from './components'\nimport { CckConfigProvider, CBox } from './core'\n\nconst INSTALLED_KEY = Symbol('INSTALLED_KEY')\n\nconst components = [\n CckConfigProvider,\n CBox,\n CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAffix,\n CAlert,\n CAnchor,\n CAspectRatio,\n CAvatar,\n CAvatarGroup,\n CBackgroundImage,\n CBreadcrumbs,\n CBurger,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CCopyButton,\n CDivider,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFileButton,\n CFlex,\n CFocusTrap,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CPortal,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n CTypography,\n CVisuallyHidden,\n UnstyledButton,\n]\n\nconst CckUI: Plugin = {\n install(app: App) {\n if ((app as any)[INSTALLED_KEY]) {\n return\n }\n ;(app as any)[INSTALLED_KEY] = true\n components.forEach((c) => {\n if (c.name) {\n app.component(c.name, c)\n }\n })\n },\n}\n\nexport default CckUI\nexport { CckUI }\n\nexport * from './components'\nexport * from './core'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,MAAM,gBAAgB,OAAO,eAAe;AAE5C,MAAM,aAAa;CACjB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,QAAgB,EACpB,QAAQ,KAAU;CAChB,IAAK,IAAY,gBACf;CAED,IAAa,iBAAiB;CAC/B,WAAW,SAAS,MAAM;EACxB,IAAI,EAAE,MACJ,IAAI,UAAU,EAAE,MAAM,CAAC;CAE3B,CAAC;AACH,EACF"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { App, Plugin } from 'vue'\nimport {\n CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAffix,\n CAlert,\n CAnchor,\n CAspectRatio,\n CAvatar,\n CAvatarGroup,\n CBackgroundImage,\n CBadge,\n CBreadcrumbs,\n CBurger,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CCopyButton,\n CDivider,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFileButton,\n CFlex,\n CFocusTrap,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CPortal,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n CTypography,\n CVisuallyHidden,\n UnstyledButton,\n} from './components'\nimport { CckConfigProvider, CBox } from './core'\n\nconst INSTALLED_KEY = Symbol('INSTALLED_KEY')\n\nconst components = [\n CckConfigProvider,\n CBox,\n CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAffix,\n CAlert,\n CAnchor,\n CAspectRatio,\n CAvatar,\n CAvatarGroup,\n CBackgroundImage,\n CBadge,\n CBreadcrumbs,\n CBurger,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CCopyButton,\n CDivider,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFileButton,\n CFlex,\n CFocusTrap,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CPortal,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n CTypography,\n CVisuallyHidden,\n UnstyledButton,\n]\n\nconst CckUI: Plugin = {\n install(app: App) {\n if ((app as any)[INSTALLED_KEY]) {\n return\n }\n ;(app as any)[INSTALLED_KEY] = true\n components.forEach((c) => {\n if (c.name) {\n app.component(c.name, c)\n }\n })\n },\n}\n\nexport default CckUI\nexport { CckUI }\n\nexport * from './components'\nexport * from './core'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,MAAM,gBAAgB,OAAO,eAAe;AAE5C,MAAM,aAAa;CACjB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,QAAgB,EACpB,QAAQ,KAAU;CAChB,IAAK,IAAY,gBACf;CAED,IAAa,iBAAiB;CAC/B,WAAW,SAAS,MAAM;EACxB,IAAI,EAAE,MACJ,IAAI,UAAU,EAAE,MAAM,CAAC;CAE3B,CAAC;AACH,EACF"}
@@ -0,0 +1,52 @@
1
+ import { VNode } from 'vue';
2
+ import { BoxProps, CColor, CGradient, CRadius, CSize, PolymorphicFactory, StylesApiProps } from '../../core';
3
+ export type BadgeStylesNames = 'root' | 'section' | 'label';
4
+ export type BadgeVariant = 'default' | 'filled' | 'light' | 'outline' | 'dashed' | 'dot' | 'transparent' | 'white' | 'gradient';
5
+ export type BadgeCssVariables = {
6
+ root: '--badge-height' | '--badge-padding-x' | '--badge-fz' | '--badge-radius' | '--badge-bg' | '--badge-color' | '--badge-bd' | '--badge-dot-color';
7
+ };
8
+ export interface BadgeProps extends BoxProps, StylesApiProps<BadgeFactory> {
9
+ /**
10
+ * Controls `font-size`, `height` and horizontal `padding`
11
+ * @default 'md'
12
+ */
13
+ size?: CSize | (string & {});
14
+ /**
15
+ * If set, badge `min-width` becomes equal to its `height` and horizontal padding is removed
16
+ */
17
+ circle?: boolean;
18
+ /**
19
+ * Key of `theme.radius` or any valid CSS value to set `border-radius`
20
+ * @default 'xl'
21
+ */
22
+ radius?: CRadius;
23
+ /**
24
+ * Key of `theme.colors` or any valid CSS color
25
+ * @default theme.primaryColor
26
+ */
27
+ color?: CColor;
28
+ /**
29
+ * Gradient configuration used when `variant="gradient"`
30
+ * @default theme.defaultGradient
31
+ */
32
+ gradient?: CGradient;
33
+ /** Content displayed on the left side of the badge label */
34
+ leftSection?: string | VNode;
35
+ /** Content displayed on the right side of the badge label */
36
+ rightSection?: string | VNode;
37
+ /**
38
+ * Determines whether Badge should take 100% of its parent width
39
+ * @default false
40
+ */
41
+ fullWidth?: boolean;
42
+ /** If set, adjusts text color based on background color for `filled` variant */
43
+ autoContrast?: boolean;
44
+ }
45
+ export type BadgeFactory = PolymorphicFactory<{
46
+ props: BadgeProps;
47
+ defaultRef: HTMLDivElement;
48
+ defaultComponent: 'div';
49
+ stylesNames: BadgeStylesNames;
50
+ vars: BadgeCssVariables;
51
+ variant: BadgeVariant;
52
+ }>;
@@ -0,0 +1,8 @@
1
+ export declare const varsResolver: import("../..").VarsResolver<{
2
+ props: import("./badge.types").BadgeProps;
3
+ defaultRef: HTMLDivElement;
4
+ defaultComponent: "div";
5
+ stylesNames: import("./badge.types").BadgeStylesNames;
6
+ vars: import("./badge.types").BadgeCssVariables;
7
+ variant: import("./badge.types").BadgeVariant;
8
+ }>;