@cck-ui/core 0.5.0 → 0.6.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/button/button-group/button-group.cjs +61 -35
- package/cjs/components/button/button-group/button-group.cjs.map +1 -1
- package/cjs/components/button/button-group/button-group.utils.cjs +8 -0
- package/cjs/components/button/button-group/button-group.utils.cjs.map +1 -0
- package/cjs/components/button/button-group-section/button-group-section.cjs +55 -50
- package/cjs/components/button/button-group-section/button-group-section.cjs.map +1 -1
- package/cjs/components/button/button-group-section/button-group-section.utils.cjs +25 -0
- package/cjs/components/button/button-group-section/button-group-section.utils.cjs.map +1 -0
- package/cjs/components/button/index.cjs +8 -4
- package/cjs/components/button/index.cjs.map +1 -1
- package/cjs/components/group/group.cjs +78 -62
- package/cjs/components/group/group.cjs.map +1 -1
- package/cjs/components/group/group.utils.cjs +14 -0
- package/cjs/components/group/group.utils.cjs.map +1 -0
- package/cjs/components/group/index.cjs +5 -1
- package/cjs/components/group/index.cjs.map +1 -1
- package/cjs/components/loader/index.cjs +5 -1
- package/cjs/components/loader/index.cjs.map +1 -1
- package/cjs/components/loader/loader.cjs +50 -41
- package/cjs/components/loader/loader.cjs.map +1 -1
- package/cjs/components/loader/loader.utils.cjs +12 -0
- package/cjs/components/loader/loader.utils.cjs.map +1 -0
- package/cjs/components/simple-grid/index.cjs +4 -1
- package/cjs/components/simple-grid/index.cjs.map +1 -1
- package/cjs/components/simple-grid/simple-grid.cjs +46 -21
- package/cjs/components/simple-grid/simple-grid.cjs.map +1 -1
- package/cjs/components/text/index.cjs +5 -1
- package/cjs/components/text/index.cjs.map +1 -1
- package/cjs/components/text/text.cjs +46 -39
- package/cjs/components/text/text.cjs.map +1 -1
- package/cjs/components/text/text.utils.cjs +15 -0
- package/cjs/components/text/text.utils.cjs.map +1 -0
- package/cjs/components/unstyled-button/index.cjs +4 -1
- package/cjs/components/unstyled-button/index.cjs.map +1 -1
- package/cjs/components/unstyled-button/unstyled-button.cjs +6 -1
- package/cjs/components/unstyled-button/unstyled-button.cjs.map +1 -1
- package/esm/components/button/button-group/button-group.mjs +61 -35
- package/esm/components/button/button-group/button-group.mjs.map +1 -1
- package/esm/components/button/button-group/button-group.utils.mjs +9 -0
- package/esm/components/button/button-group/button-group.utils.mjs.map +1 -0
- package/esm/components/button/button-group-section/button-group-section.mjs +55 -50
- package/esm/components/button/button-group-section/button-group-section.mjs.map +1 -1
- package/esm/components/button/button-group-section/button-group-section.utils.mjs +26 -0
- package/esm/components/button/button-group-section/button-group-section.utils.mjs.map +1 -0
- package/esm/components/button/index.mjs +8 -4
- package/esm/components/button/index.mjs.map +1 -1
- package/esm/components/group/group.mjs +78 -62
- package/esm/components/group/group.mjs.map +1 -1
- package/esm/components/group/group.utils.mjs +15 -0
- package/esm/components/group/group.utils.mjs.map +1 -0
- package/esm/components/group/index.mjs +4 -2
- package/esm/components/group/index.mjs.map +1 -1
- package/esm/components/loader/index.mjs +4 -1
- package/esm/components/loader/index.mjs.map +1 -1
- package/esm/components/loader/loader.mjs +50 -41
- package/esm/components/loader/loader.mjs.map +1 -1
- package/esm/components/loader/loader.utils.mjs +13 -0
- package/esm/components/loader/loader.utils.mjs.map +1 -0
- package/esm/components/simple-grid/index.mjs +3 -2
- package/esm/components/simple-grid/index.mjs.map +1 -1
- package/esm/components/simple-grid/simple-grid.mjs +47 -22
- package/esm/components/simple-grid/simple-grid.mjs.map +1 -1
- package/esm/components/text/index.mjs +4 -2
- package/esm/components/text/index.mjs.map +1 -1
- package/esm/components/text/text.mjs +46 -39
- package/esm/components/text/text.mjs.map +1 -1
- package/esm/components/text/text.utils.mjs +16 -0
- package/esm/components/text/text.utils.mjs.map +1 -0
- package/esm/components/unstyled-button/index.mjs +3 -2
- package/esm/components/unstyled-button/index.mjs.map +1 -1
- package/esm/components/unstyled-button/unstyled-button.mjs +7 -2
- package/esm/components/unstyled-button/unstyled-button.mjs.map +1 -1
- package/lib/components/button/button-group/button-group.utils.d.ts +6 -0
- package/lib/components/button/button-group-section/button-group-section.utils.d.ts +7 -0
- package/lib/components/button/index.d.ts +5 -5
- package/lib/components/group/group.utils.d.ts +7 -0
- package/lib/components/group/index.d.ts +3 -2
- package/lib/components/loader/index.d.ts +3 -2
- package/lib/components/loader/loader.utils.d.ts +9 -0
- package/lib/components/simple-grid/index.d.ts +3 -2
- package/lib/components/stack/index.d.ts +6 -0
- package/lib/components/stack/stack.types.d.ts +29 -0
- package/lib/components/stack/stack.utils.d.ts +6 -0
- package/lib/components/text/index.d.ts +3 -2
- package/lib/components/text/text.utils.d.ts +8 -0
- package/lib/components/unstyled-button/index.d.ts +3 -2
- package/package.json +1 -1
- package/styles/stack.css +7 -0
- package/styles/stack.layer.css +8 -0
- package/styles.css +8 -0
- package/styles.layer.css +8 -0
- package/cjs/components/loader/use-loader.cjs +0 -10
- package/cjs/components/loader/use-loader.cjs.map +0 -1
- package/esm/components/loader/use-loader.mjs +0 -10
- package/esm/components/loader/use-loader.mjs.map +0 -1
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const require_get_size = require("../../core/utils/get-size/get-size.cjs");
|
|
3
|
-
const require_get_gradient = require("../../core/config-provider/color-functions/get-gradient/get-gradient.cjs");
|
|
4
2
|
const require_export_helper = require("../../_virtual/_/plugin-vue/export-helper.cjs");
|
|
3
|
+
const require_use_component_props = require("../../core/config-provider/use-component-props/use-component-props.cjs");
|
|
5
4
|
const require_index = require("../../core/box/index.cjs");
|
|
6
|
-
const require_create_vars_resolver = require("../../core/styles-api/create-vars-resolver/create-vars-resolver.cjs");
|
|
7
5
|
const require_use_styles = require("../../core/styles-api/use-styles/use-styles.cjs");
|
|
8
6
|
const require_text_module = require("./text.module.cjs");
|
|
7
|
+
const require_text_utils = require("./text.utils.cjs");
|
|
9
8
|
let vue = require("vue");
|
|
10
9
|
//#region packages/@cck-ui/core/src/components/text/text.vue
|
|
11
10
|
const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
@@ -339,8 +338,14 @@ const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
|
339
338
|
}
|
|
340
339
|
},
|
|
341
340
|
setup(__props, { expose: __expose }) {
|
|
342
|
-
|
|
343
|
-
const
|
|
341
|
+
const _root = (0, vue.ref)(null);
|
|
342
|
+
const attrs = (0, vue.useAttrs)();
|
|
343
|
+
const rawProps = __props;
|
|
344
|
+
const props = require_use_component_props.useComponentProps({
|
|
345
|
+
component: "CText",
|
|
346
|
+
defaultProps: {},
|
|
347
|
+
props: rawProps
|
|
348
|
+
});
|
|
344
349
|
function getTextTruncate(truncate) {
|
|
345
350
|
if (truncate === "start") return "start";
|
|
346
351
|
if (truncate === "end" || truncate) return "end";
|
|
@@ -366,48 +371,52 @@ const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
|
366
371
|
"attributes"
|
|
367
372
|
];
|
|
368
373
|
const modList = (0, vue.computed)(() => [{
|
|
369
|
-
"data-truncate": getTextTruncate(props.truncate),
|
|
370
|
-
"data-line-clamp": typeof props.lineClamp === "number",
|
|
371
|
-
"data-inline": props.inline,
|
|
372
|
-
"data-inherit": props.inherit
|
|
373
|
-
}
|
|
374
|
-
const varsResolver = require_create_vars_resolver.createVarsResolver((theme, { gradient, lineClamp, size, textWrap, variant }) => ({ root: {
|
|
375
|
-
"--text-fz": require_get_size.getFontSize(size),
|
|
376
|
-
"--text-lh": require_get_size.getLineHeight(size),
|
|
377
|
-
"--text-gradient": variant === "gradient" ? require_get_gradient.getGradient(gradient, theme) : void 0,
|
|
378
|
-
"--text-line-clamp": typeof lineClamp === "number" ? lineClamp.toString() : void 0,
|
|
379
|
-
"--text-text-wrap": textWrap
|
|
380
|
-
} }));
|
|
374
|
+
"data-truncate": getTextTruncate(props.value.truncate),
|
|
375
|
+
"data-line-clamp": typeof props.value.lineClamp === "number",
|
|
376
|
+
"data-inline": props.value.inline,
|
|
377
|
+
"data-inherit": props.value.inherit
|
|
378
|
+
}]);
|
|
381
379
|
const getStyles = require_use_styles.useStyles({
|
|
382
|
-
name: ["Text", props.__staticSelector],
|
|
383
|
-
props
|
|
380
|
+
name: ["Text", props.value.__staticSelector],
|
|
381
|
+
props: {
|
|
382
|
+
...props.value,
|
|
383
|
+
...attrs
|
|
384
|
+
},
|
|
384
385
|
classes: require_text_module.default,
|
|
385
|
-
className: props.className,
|
|
386
|
-
style: props.style,
|
|
387
|
-
classNames: props.classNames,
|
|
388
|
-
styles: props.styles,
|
|
389
|
-
unstyled: props.unstyled,
|
|
390
|
-
attributes: props.attributes,
|
|
391
|
-
vars: props.vars,
|
|
392
|
-
varsResolver
|
|
386
|
+
className: props.value.className,
|
|
387
|
+
style: props.value.style,
|
|
388
|
+
classNames: props.value.classNames,
|
|
389
|
+
styles: props.value.styles,
|
|
390
|
+
unstyled: props.value.unstyled,
|
|
391
|
+
attributes: props.value.attributes,
|
|
392
|
+
vars: props.value.vars,
|
|
393
|
+
varsResolver: require_text_utils.varsResolver
|
|
393
394
|
});
|
|
394
395
|
const rootAttrs = (0, vue.computed)(() => getStyles("root", { focusable: true }));
|
|
396
|
+
const mergedAttrs = (0, vue.computed)(() => {
|
|
397
|
+
const others = {};
|
|
398
|
+
const propsValue = props.value;
|
|
399
|
+
for (const key in propsValue) if (!knownProps.includes(key)) others[key] = propsValue[key];
|
|
400
|
+
const userMod = props.value.mod;
|
|
401
|
+
const mergedMod = [...Array.isArray(userMod) ? userMod : [userMod].filter(Boolean), ...modList.value || []];
|
|
402
|
+
return {
|
|
403
|
+
...others,
|
|
404
|
+
mod: mergedMod,
|
|
405
|
+
...rootAttrs.value
|
|
406
|
+
};
|
|
407
|
+
});
|
|
408
|
+
__expose({ root: (0, vue.computed)(() => _root.value?.root ?? null) });
|
|
395
409
|
const __returned__ = {
|
|
410
|
+
_root,
|
|
411
|
+
attrs,
|
|
412
|
+
rawProps,
|
|
396
413
|
props,
|
|
397
414
|
getTextTruncate,
|
|
398
415
|
knownProps,
|
|
399
416
|
modList,
|
|
400
|
-
varsResolver,
|
|
401
417
|
getStyles,
|
|
402
418
|
rootAttrs,
|
|
403
|
-
mergedAttrs
|
|
404
|
-
const others = {};
|
|
405
|
-
for (const key in props) if (!knownProps.includes(key)) others[key] = props[key];
|
|
406
|
-
return {
|
|
407
|
-
...others,
|
|
408
|
-
...rootAttrs.value
|
|
409
|
-
};
|
|
410
|
-
}),
|
|
419
|
+
mergedAttrs,
|
|
411
420
|
get CBox() {
|
|
412
421
|
return require_index.CBox;
|
|
413
422
|
}
|
|
@@ -420,8 +429,7 @@ const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
|
420
429
|
}
|
|
421
430
|
});
|
|
422
431
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
423
|
-
return (0, vue.openBlock)(), (0, vue.createBlock)($setup["CBox"], (0, vue.mergeProps)($setup.mergedAttrs, {
|
|
424
|
-
mod: $setup.modList,
|
|
432
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)($setup["CBox"], (0, vue.mergeProps)({ ref: "_root" }, $setup.mergedAttrs, {
|
|
425
433
|
size: $setup.props.size,
|
|
426
434
|
tag: $setup.props.span ? "span" : "p",
|
|
427
435
|
variant: $setup.props.variant
|
|
@@ -429,7 +437,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
429
437
|
default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
|
|
430
438
|
_: 3
|
|
431
439
|
}, 16, [
|
|
432
|
-
"mod",
|
|
433
440
|
"size",
|
|
434
441
|
"tag",
|
|
435
442
|
"variant"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.cjs","names":[],"sources":["../../../src/components/text/text.vue"],"sourcesContent":["<template>\n <c-box\n
|
|
1
|
+
{"version":3,"file":"text.cjs","names":[],"sources":["../../../src/components/text/text.vue"],"sourcesContent":["<template>\n <c-box\n ref=\"_root\"\n v-bind=\"mergedAttrs\"\n :size=\"props.size\"\n :tag=\"props.span ? 'span' : 'p'\"\n :variant=\"props.variant\"\n >\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport type { TextFactory, TextProps, TextTruncate } from './text.types.ts'\nimport classes from './text.module.css'\nimport { useStyles, CBox, useComponentProps } from '../../core'\nimport { varsResolver } from './text.utils.js'\n\ndefineOptions({\n name: 'CText',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<TextProps>()\n\nconst props = useComponentProps({\n component: 'CText',\n defaultProps: {},\n props: rawProps,\n})\n\nfunction getTextTruncate(truncate: TextTruncate | undefined) {\n if (truncate === 'start') {\n return 'start'\n }\n\n if (truncate === 'end' || truncate) {\n return 'end'\n }\n\n return undefined\n}\n\nconst knownProps = [\n 'lineClamp',\n 'truncate',\n 'inline',\n 'inherit',\n 'gradient',\n 'span',\n 'textWrap',\n '__staticSelector',\n 'vars',\n 'className',\n 'style',\n 'classNames',\n 'styles',\n 'unstyled',\n 'variant',\n 'mod',\n 'size',\n 'attributes',\n]\n\nconst modList = computed(() => [\n {\n 'data-truncate': getTextTruncate(props.value.truncate),\n 'data-line-clamp': typeof props.value.lineClamp === 'number',\n 'data-inline': props.value.inline,\n 'data-inherit': props.value.inherit,\n },\n])\n\nconst getStyles = useStyles<TextFactory>({\n name: ['Text', props.value.__staticSelector],\n props: { ...props.value, ...attrs } as TextProps,\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 rootAttrs = computed(() => getStyles('root', { focusable: true }))\n\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\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\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBA,MAAM,SAAA,GAAA,IAAA,IAAA,CAA8C,IAAI;EAExD,MAAM,SAAA,GAAA,IAAA,SAAA,CAAiB;EAEvB,MAAM,WAAW;EAEjB,MAAM,QAAQ,4BAAA,kBAAkB;GAC9B,WAAW;GACX,cAAc,CAAC;GACf,OAAO;EACT,CAAC;EAED,SAAS,gBAAgB,UAAoC;GAC3D,IAAI,aAAa,SACf,OAAO;GAGT,IAAI,aAAa,SAAS,UACxB,OAAO;EAIX;EAEA,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,WAAA,GAAA,IAAA,SAAA,OAAyB,CAC7B;GACE,iBAAiB,gBAAgB,MAAM,MAAM,QAAQ;GACrD,mBAAmB,OAAO,MAAM,MAAM,cAAc;GACpD,eAAe,MAAM,MAAM;GAC3B,gBAAgB,MAAM,MAAM;EAC9B,CACF,CAAC;EAED,MAAM,YAAY,mBAAA,UAAuB;GACvC,MAA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/get-size.cjs");
|
|
3
|
+
const require_get_gradient = require("../../core/config-provider/color-functions/get-gradient/get-gradient.cjs");
|
|
4
|
+
//#region packages/@cck-ui/core/src/components/text/text.utils.ts
|
|
5
|
+
const varsResolver = require("../../core/styles-api/create-vars-resolver/create-vars-resolver.cjs").createVarsResolver((theme, { gradient, lineClamp, size, textWrap, variant }) => ({ root: {
|
|
6
|
+
"--text-fz": require_get_size.getFontSize(size),
|
|
7
|
+
"--text-lh": require_get_size.getLineHeight(size),
|
|
8
|
+
"--text-gradient": variant === "gradient" ? require_get_gradient.getGradient(gradient, theme) : void 0,
|
|
9
|
+
"--text-line-clamp": typeof lineClamp === "number" ? lineClamp.toString() : void 0,
|
|
10
|
+
"--text-text-wrap": textWrap
|
|
11
|
+
} }));
|
|
12
|
+
//#endregion
|
|
13
|
+
exports.varsResolver = varsResolver;
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=text.utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.utils.cjs","names":["createVarsResolver","getFontSize","getLineHeight","getGradient"],"sources":["../../../src/components/text/text.utils.ts"],"sourcesContent":["import { createVarsResolver, getFontSize, getGradient, getLineHeight } from '../../core'\nimport { TextFactory } from './text.types'\n\nexport const varsResolver = createVarsResolver<TextFactory>(\n (theme, { gradient, lineClamp, size, textWrap, variant }) => ({\n root: {\n '--text-fz': getFontSize(size),\n '--text-lh': getLineHeight(size),\n '--text-gradient': variant === 'gradient' ? getGradient(gradient, theme) : undefined,\n '--text-line-clamp': typeof lineClamp === 'number' ? lineClamp.toString() : undefined,\n '--text-text-wrap': textWrap,\n },\n })\n)\n"],"mappings":";;;;AAGA,MAAa,4FAAeA,CAAAA,CAAAA,oBACzB,OAAO,EAAE,UAAU,WAAW,MAAM,UAAU,eAAe,EAC5D,MAAM;CACJ,aAAaC,iBAAAA,YAAY,IAAI;CAC7B,aAAaC,iBAAAA,cAAc,IAAI;CAC/B,mBAAmB,YAAY,aAAaC,qBAAAA,YAAY,UAAU,KAAK,IAAI,KAAA;CAC3E,qBAAqB,OAAO,cAAc,WAAW,UAAU,SAAS,IAAI,KAAA;CAC5E,oBAAoB;AACtB,EACF,EACF"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
const require_install = require("../../core/utils/vue/install.cjs");
|
|
3
|
+
const require_statics = require("../../core/utils/vue/statics.cjs");
|
|
4
|
+
const require_unstyled_button_module = require("./unstyled-button.module.cjs");
|
|
3
5
|
const require_unstyled_button = require("./unstyled-button.cjs");
|
|
4
6
|
//#region packages/@cck-ui/core/src/components/unstyled-button/index.ts
|
|
5
|
-
const
|
|
7
|
+
const UnstyledButtonWithStatic = require_statics.withPropsFactory(require_statics.withExtend(require_statics.withClasses(require_unstyled_button.default, require_unstyled_button_module.default)));
|
|
8
|
+
const UnstyledButton = require_install.withInstall(UnstyledButtonWithStatic);
|
|
6
9
|
//#endregion
|
|
7
10
|
exports.UnstyledButton = UnstyledButton;
|
|
8
11
|
exports.default = UnstyledButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["withPropsFactory","withExtend","withClasses","_UnstyledButton","classes","withInstall"],"sources":["../../../src/components/unstyled-button/index.ts"],"sourcesContent":["import {\n SFCWithInstallAndClasses,\n withClasses,\n withExtend,\n withInstall,\n withPropsFactory,\n} from '../../core'\nimport _UnstyledButton from './unstyled-button.vue'\nimport classes from './unstyled-button.module.css'\n\nconst UnstyledButtonWithStatic = withPropsFactory(withExtend(withClasses(_UnstyledButton, classes)))\n\nexport const UnstyledButton: SFCWithInstallAndClasses<typeof _UnstyledButton, typeof classes> =\n withInstall(UnstyledButtonWithStatic)\nexport default UnstyledButton\n\nexport * from './unstyled-button.types'\n"],"mappings":";;;;;;AAUA,MAAM,2BAA2BA,gBAAAA,iBAAiBC,gBAAAA,WAAWC,gBAAAA,YAAYC,wBAAAA,SAAiBC,+BAAAA,OAAO,CAAC,CAAC;AAEnG,MAAa,iBACXC,gBAAAA,YAAY,wBAAwB"}
|
|
@@ -313,6 +313,7 @@ const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
|
313
313
|
}
|
|
314
314
|
},
|
|
315
315
|
setup(__props, { expose: __expose }) {
|
|
316
|
+
const attrs = (0, vue.useAttrs)();
|
|
316
317
|
const rawProps = __props;
|
|
317
318
|
const props = require_use_component_props.useComponentProps({
|
|
318
319
|
component: "UnstyledButton",
|
|
@@ -333,7 +334,10 @@ const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
|
333
334
|
];
|
|
334
335
|
const getStyles = require_use_styles.useStyles({
|
|
335
336
|
name: props.value.__staticSelector,
|
|
336
|
-
props:
|
|
337
|
+
props: {
|
|
338
|
+
...props.value,
|
|
339
|
+
...attrs
|
|
340
|
+
},
|
|
337
341
|
classes: require_unstyled_button_module.default,
|
|
338
342
|
className: props.value.className,
|
|
339
343
|
style: props.value.style,
|
|
@@ -354,6 +358,7 @@ const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
|
354
358
|
});
|
|
355
359
|
__expose({ root: (0, vue.computed)(() => _root.value?.root ?? null) });
|
|
356
360
|
const __returned__ = {
|
|
361
|
+
attrs,
|
|
357
362
|
rawProps,
|
|
358
363
|
props,
|
|
359
364
|
tag,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unstyled-button.cjs","names":[],"sources":["../../../src/components/unstyled-button/unstyled-button.vue"],"sourcesContent":["<template>\n <c-box\n ref=\"_root\"\n v-bind=\"mergedAttrs\"\n :tag=\"tag\"\n :type=\"tag === 'button' ? 'button' : undefined\"\n >\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from 'vue'\nimport { CBox, useComponentProps, useStyles } from '../../core'\nimport type { UnstyledButtonFactory, UnstyledButtonProps } from './unstyled-button.types'\nimport classes from './unstyled-button.module.css'\n\ndefineOptions({\n name: 'UnstyledButton',\n})\n\
|
|
1
|
+
{"version":3,"file":"unstyled-button.cjs","names":[],"sources":["../../../src/components/unstyled-button/unstyled-button.vue"],"sourcesContent":["<template>\n <c-box\n ref=\"_root\"\n v-bind=\"mergedAttrs\"\n :tag=\"tag\"\n :type=\"tag === 'button' ? 'button' : undefined\"\n >\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { CBox, useComponentProps, useStyles } from '../../core'\nimport type { UnstyledButtonFactory, UnstyledButtonProps } from './unstyled-button.types'\nimport classes from './unstyled-button.module.css'\n\ndefineOptions({\n name: 'UnstyledButton',\n})\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<UnstyledButtonProps>()\n\nconst props = useComponentProps({\n component: 'UnstyledButton',\n defaultProps: {\n __staticSelector: 'UnstyledButton',\n },\n props: rawProps,\n})\n\nconst { tag = 'button' } = props.value\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst knownProps = [\n 'className',\n 'tag',\n '__staticSelector',\n 'unstyled',\n 'classNames',\n 'styles',\n 'style',\n 'attributes',\n]\n\nconst getStyles = useStyles<UnstyledButtonFactory>({\n name: props.value.__staticSelector!,\n props: { ...props.value, ...attrs } as UnstyledButtonProps,\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})\n\nconst rootAttrs = computed(() => getStyles('root', { focusable: true }))\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n return { ...others, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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Aa,EACX,OAAA,GAAA,IAAA,SAAA,OAAqB,MAAM,OAAO,QAAQ,IAAI,EAChD,CAAC;;;;;;;;;;;;;;;;;;;;;;;mDAlES,OAAA,UAAA,GAAA,IAAA,WAAA,CAAA,EANN,KAAI,QAAO,GACH,OAAA,aAAW;EAClB,KAAK,OAAA;EACL,MAAM,OAAA,QAAG,WAAA,WAA2B,KAAA;;kCAE7B,EAAA,GAAA,IAAA,WAAA,CAAA,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { rem } from "../../../core/utils/units-converters/rem.mjs";
|
|
3
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
4
|
import { CBox } from "../../../core/box/index.mjs";
|
|
5
|
-
import { createVarsResolver } from "../../../core/styles-api/create-vars-resolver/create-vars-resolver.mjs";
|
|
6
5
|
import { useStyles } from "../../../core/styles-api/use-styles/use-styles.mjs";
|
|
7
6
|
import button_module_default from "../button.module.mjs";
|
|
8
7
|
import { useButtonGroup } from "./use-button-group.mjs";
|
|
9
|
-
import {
|
|
8
|
+
import { varsResolver } from "./button-group.utils.mjs";
|
|
9
|
+
import { Fragment, computed, createBlock, createElementBlock, defineComponent, mergeProps, openBlock, ref, renderList, resolveDynamicComponent, useAttrs, useSlots, withCtx } from "vue";
|
|
10
10
|
//#region packages/@cck-ui/core/src/components/button/button-group/button-group.vue
|
|
11
11
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
12
12
|
name: "CButtonGroup",
|
|
@@ -14,8 +14,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
14
14
|
props: {
|
|
15
15
|
orientation: {
|
|
16
16
|
type: String,
|
|
17
|
-
required: false
|
|
18
|
-
default: "horizontal"
|
|
17
|
+
required: false
|
|
19
18
|
},
|
|
20
19
|
borderWidth: {
|
|
21
20
|
type: [Number, String],
|
|
@@ -312,47 +311,71 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
312
311
|
}
|
|
313
312
|
},
|
|
314
313
|
setup(__props, { expose: __expose }) {
|
|
315
|
-
|
|
314
|
+
const _group = ref(null);
|
|
315
|
+
const attrs = useAttrs();
|
|
316
316
|
const slots = useSlots();
|
|
317
|
-
const
|
|
318
|
-
const props =
|
|
319
|
-
|
|
317
|
+
const rawProps = __props;
|
|
318
|
+
const props = useComponentProps({
|
|
319
|
+
component: "CButtonGroup",
|
|
320
|
+
defaultProps: { orientation: "horizontal" },
|
|
321
|
+
props: rawProps
|
|
322
|
+
});
|
|
323
|
+
const knownProps = [
|
|
324
|
+
"className",
|
|
325
|
+
"style",
|
|
326
|
+
"classNames",
|
|
327
|
+
"styles",
|
|
328
|
+
"unstyled",
|
|
329
|
+
"orientation",
|
|
330
|
+
"vars",
|
|
331
|
+
"borderWidth",
|
|
332
|
+
"mod",
|
|
333
|
+
"attributes"
|
|
334
|
+
];
|
|
320
335
|
const getStyles = useStyles({
|
|
321
336
|
name: "ButtonGroup",
|
|
322
|
-
props
|
|
337
|
+
props: {
|
|
338
|
+
...props.value,
|
|
339
|
+
...attrs
|
|
340
|
+
},
|
|
323
341
|
classes: button_module_default,
|
|
324
|
-
className,
|
|
325
|
-
style,
|
|
326
|
-
classNames,
|
|
327
|
-
styles,
|
|
328
|
-
unstyled,
|
|
329
|
-
attributes,
|
|
330
|
-
vars,
|
|
342
|
+
className: props.value.className,
|
|
343
|
+
style: props.value.style,
|
|
344
|
+
classNames: props.value.classNames,
|
|
345
|
+
styles: props.value.styles,
|
|
346
|
+
unstyled: props.value.unstyled,
|
|
347
|
+
attributes: props.value.attributes,
|
|
348
|
+
vars: props.value.vars,
|
|
331
349
|
varsResolver,
|
|
332
350
|
rootSelector: "group"
|
|
333
351
|
});
|
|
352
|
+
const modList = computed(() => [{ orientation: props.value.orientation }]);
|
|
334
353
|
const groupAttrs = computed(() => getStyles("group"));
|
|
335
|
-
const mergedAttrs = computed(() =>
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
354
|
+
const mergedAttrs = computed(() => {
|
|
355
|
+
const others = {};
|
|
356
|
+
const propsValue = props.value;
|
|
357
|
+
Object.keys(propsValue).forEach((key) => {
|
|
358
|
+
if (!knownProps.includes(key)) others[key] = propsValue[key];
|
|
359
|
+
});
|
|
360
|
+
const userMod = props.value.mod;
|
|
361
|
+
const mergedMod = [...Array.isArray(userMod) ? userMod : [userMod].filter(Boolean), ...modList.value || []];
|
|
362
|
+
return {
|
|
363
|
+
...others,
|
|
364
|
+
mod: mergedMod,
|
|
365
|
+
...groupAttrs.value
|
|
366
|
+
};
|
|
367
|
+
});
|
|
339
368
|
const { validChildren } = useButtonGroup(slots);
|
|
369
|
+
__expose({ group: computed(() => _group.value?.root ?? null) });
|
|
340
370
|
const __returned__ = {
|
|
371
|
+
_group,
|
|
372
|
+
attrs,
|
|
341
373
|
slots,
|
|
342
|
-
|
|
374
|
+
rawProps,
|
|
343
375
|
props,
|
|
344
|
-
|
|
345
|
-
style,
|
|
346
|
-
classNames,
|
|
347
|
-
styles,
|
|
348
|
-
unstyled,
|
|
349
|
-
orientation,
|
|
350
|
-
vars,
|
|
351
|
-
borderWidth,
|
|
352
|
-
mod,
|
|
353
|
-
attributes,
|
|
354
|
-
others,
|
|
376
|
+
knownProps,
|
|
355
377
|
getStyles,
|
|
378
|
+
modList,
|
|
356
379
|
groupAttrs,
|
|
357
380
|
mergedAttrs,
|
|
358
381
|
validChildren,
|
|
@@ -368,12 +391,15 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
368
391
|
}
|
|
369
392
|
});
|
|
370
393
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
371
|
-
return openBlock(), createBlock($setup["CBox"], mergeProps({
|
|
394
|
+
return openBlock(), createBlock($setup["CBox"], mergeProps({
|
|
395
|
+
ref: "_group",
|
|
396
|
+
role: "group"
|
|
397
|
+
}, $setup.mergedAttrs), {
|
|
372
398
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList($setup.validChildren, (child, index) => {
|
|
373
399
|
return openBlock(), createBlock(resolveDynamicComponent(child), { key: child.key ?? index });
|
|
374
400
|
}), 128))]),
|
|
375
401
|
_: 1
|
|
376
|
-
}, 16
|
|
402
|
+
}, 16);
|
|
377
403
|
}
|
|
378
404
|
var button_group_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/cck-ui/cck-ui/packages/@cck-ui/core/src/components/button/button-group/button-group.vue"]]);
|
|
379
405
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group.mjs","names":[],"sources":["../../../../src/components/button/button-group/button-group.vue"],"sourcesContent":["<template>\n <c-box
|
|
1
|
+
{"version":3,"file":"button-group.mjs","names":[],"sources":["../../../../src/components/button/button-group/button-group.vue"],"sourcesContent":["<template>\n <c-box ref=\"_group\" role=\"group\" v-bind=\"mergedAttrs\">\n <template v-for=\"(child, index) in validChildren\" :key=\"child.key ?? index\">\n <component :is=\"child\" />\n </template>\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs, useSlots } from 'vue'\nimport { CBox, useComponentProps, useStyles } from '../../../core'\nimport classes from '../button.module.css'\nimport { ButtonGroupFactory, type ButtonGroupProps } from './button-group.types'\nimport { useButtonGroup } from './use-button-group'\nimport { varsResolver } from './button-group.utils'\n\ndefineOptions({\n name: 'CButtonGroup',\n})\n\nconst _group = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\nconst slots = useSlots()\n\nconst rawProps = defineProps<ButtonGroupProps>()\n\nconst props = useComponentProps({\n component: 'CButtonGroup',\n defaultProps: {\n orientation: 'horizontal',\n },\n props: rawProps,\n})\n\nconst knownProps = [\n 'className',\n 'style',\n 'classNames',\n 'styles',\n 'unstyled',\n 'orientation',\n 'vars',\n 'borderWidth',\n 'mod',\n 'attributes',\n]\n\nconst getStyles = useStyles<ButtonGroupFactory>({\n name: 'ButtonGroup',\n props: { ...props.value, ...attrs } as ButtonGroupProps,\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 rootSelector: 'group',\n})\n\nconst modList = computed(() => [\n {\n orientation: props.value.orientation,\n },\n])\n\nconst groupAttrs = computed(() => getStyles('group'))\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 = [\n ...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)),\n ...(modList.value || []),\n ]\n return { ...others, mod: mergedMod, ...groupAttrs.value }\n})\n\nconst { validChildren } = useButtonGroup(slots)\n\ndefineExpose({\n group: computed(() => _group.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBA,MAAM,SAAS,IAAsC,IAAI;EAEzD,MAAM,QAAQ,SAAS;EACvB,MAAM,QAAQ,SAAS;EAEvB,MAAM,WAAW;EAEjB,MAAM,QAAQ,kBAAkB;GAC9B,WAAW;GACX,cAAc,EACZ,aAAa,aACf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,UAAK;uBAC5B,YAAyB,wBAAT,KAAK,GAAA,EAAA,KADiC,MAAM,OAAO,MAAA,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { rem } from "../../../core/utils/units-converters/rem.mjs";
|
|
3
|
+
import { createVarsResolver } from "../../../core/styles-api/create-vars-resolver/create-vars-resolver.mjs";
|
|
4
|
+
//#region packages/@cck-ui/core/src/components/button/button-group/button-group.utils.ts
|
|
5
|
+
const varsResolver = createVarsResolver((_, { borderWidth }) => ({ group: { "--button-border-width": rem(borderWidth) } }));
|
|
6
|
+
//#endregion
|
|
7
|
+
export { varsResolver };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=button-group.utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-group.utils.mjs","names":[],"sources":["../../../../src/components/button/button-group/button-group.utils.ts"],"sourcesContent":["import { createVarsResolver, rem } from '../../../core'\nimport { ButtonGroupFactory } from './button-group.types'\n\nexport const varsResolver = createVarsResolver<ButtonGroupFactory>((_, { borderWidth }) => ({\n group: { '--button-border-width': rem(borderWidth) },\n}))\n"],"mappings":";;;;AAGA,MAAa,eAAe,oBAAwC,GAAG,EAAE,mBAAmB,EAC1F,OAAO,EAAE,yBAAyB,IAAI,WAAW,EAAE,EACrD,EAAE"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getFontSize, getRadius, getSize } from "../../../core/utils/get-size/get-size.mjs";
|
|
3
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
4
|
import { CBox } from "../../../core/box/index.mjs";
|
|
5
|
-
import { createVarsResolver } from "../../../core/styles-api/create-vars-resolver/create-vars-resolver.mjs";
|
|
6
5
|
import { useStyles } from "../../../core/styles-api/use-styles/use-styles.mjs";
|
|
7
6
|
import button_module_default from "../button.module.mjs";
|
|
8
|
-
import {
|
|
7
|
+
import { varsResolver } from "./button-group-section.utils.mjs";
|
|
8
|
+
import { computed, createBlock, defineComponent, mergeProps, openBlock, ref, renderSlot, useAttrs, withCtx } from "vue";
|
|
9
9
|
//#region packages/@cck-ui/core/src/components/button/button-group-section/button-group-section.vue
|
|
10
10
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
11
11
|
name: "CButtonGroupSection",
|
|
@@ -298,8 +298,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
298
298
|
},
|
|
299
299
|
variant: {
|
|
300
300
|
type: null,
|
|
301
|
-
required: false
|
|
302
|
-
default: "default"
|
|
301
|
+
required: false
|
|
303
302
|
},
|
|
304
303
|
classNames: {
|
|
305
304
|
type: null,
|
|
@@ -319,62 +318,68 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
319
318
|
}
|
|
320
319
|
},
|
|
321
320
|
setup(__props, { expose: __expose }) {
|
|
322
|
-
|
|
323
|
-
const
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
autoContrast
|
|
330
|
-
});
|
|
331
|
-
return { groupSection: {
|
|
332
|
-
"--section-height": getSize(size, "section-height"),
|
|
333
|
-
"--section-padding-x": getSize(size, "section-padding-x"),
|
|
334
|
-
"--section-fz": size?.includes("compact") ? getFontSize(size.replace("compact-", "")) : getFontSize(size),
|
|
335
|
-
"--section-radius": radius === void 0 ? void 0 : getRadius(radius),
|
|
336
|
-
"--section-bg": color || variant ? colors.background : void 0,
|
|
337
|
-
"--section-color": colors.color,
|
|
338
|
-
"--section-bd": color || variant ? colors.border : void 0
|
|
339
|
-
} };
|
|
321
|
+
const _section = ref(null);
|
|
322
|
+
const attrs = useAttrs();
|
|
323
|
+
const rawProps = __props;
|
|
324
|
+
const props = useComponentProps({
|
|
325
|
+
component: "CButtonGroupSection",
|
|
326
|
+
defaultProps: { variant: "default" },
|
|
327
|
+
props: rawProps
|
|
340
328
|
});
|
|
341
|
-
const
|
|
342
|
-
|
|
329
|
+
const knownProps = [
|
|
330
|
+
"className",
|
|
331
|
+
"style",
|
|
332
|
+
"classNames",
|
|
333
|
+
"styles",
|
|
334
|
+
"unstyled",
|
|
335
|
+
"vars",
|
|
336
|
+
"gradient",
|
|
337
|
+
"radius",
|
|
338
|
+
"autoContrast",
|
|
339
|
+
"attributes"
|
|
340
|
+
];
|
|
343
341
|
const getStyles = useStyles({
|
|
344
342
|
name: "ButtonGroupSection",
|
|
345
|
-
props
|
|
343
|
+
props: {
|
|
344
|
+
...props.value,
|
|
345
|
+
...attrs
|
|
346
|
+
},
|
|
346
347
|
classes: button_module_default,
|
|
347
|
-
className,
|
|
348
|
-
style,
|
|
349
|
-
classNames,
|
|
350
|
-
styles,
|
|
351
|
-
unstyled,
|
|
352
|
-
attributes,
|
|
353
|
-
vars,
|
|
348
|
+
className: props.value.className,
|
|
349
|
+
style: props.value.style,
|
|
350
|
+
classNames: props.value.classNames,
|
|
351
|
+
styles: props.value.styles,
|
|
352
|
+
unstyled: props.value.unstyled,
|
|
353
|
+
attributes: props.value.attributes,
|
|
354
|
+
vars: props.value.vars,
|
|
354
355
|
varsResolver,
|
|
355
356
|
rootSelector: "groupSection"
|
|
356
357
|
});
|
|
357
358
|
const sectionAttrs = computed(() => getStyles("groupSection"));
|
|
359
|
+
const mergedAttrs = computed(() => {
|
|
360
|
+
const others = {};
|
|
361
|
+
const propsValue = props.value;
|
|
362
|
+
Object.keys(propsValue).forEach((key) => {
|
|
363
|
+
if (!knownProps.includes(key)) others[key] = propsValue[key];
|
|
364
|
+
});
|
|
365
|
+
const userMod = props.value.mod;
|
|
366
|
+
const mergedMod = [...Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)];
|
|
367
|
+
return {
|
|
368
|
+
...others,
|
|
369
|
+
mod: mergedMod,
|
|
370
|
+
...sectionAttrs.value
|
|
371
|
+
};
|
|
372
|
+
});
|
|
373
|
+
__expose({ section: computed(() => _section.value?.root ?? null) });
|
|
358
374
|
const __returned__ = {
|
|
359
|
-
|
|
375
|
+
_section,
|
|
376
|
+
attrs,
|
|
377
|
+
rawProps,
|
|
360
378
|
props,
|
|
361
|
-
|
|
362
|
-
style,
|
|
363
|
-
classNames,
|
|
364
|
-
styles,
|
|
365
|
-
unstyled,
|
|
366
|
-
vars,
|
|
367
|
-
gradient,
|
|
368
|
-
radius,
|
|
369
|
-
autoContrast,
|
|
370
|
-
attributes,
|
|
371
|
-
others,
|
|
379
|
+
knownProps,
|
|
372
380
|
getStyles,
|
|
373
381
|
sectionAttrs,
|
|
374
|
-
mergedAttrs
|
|
375
|
-
...others,
|
|
376
|
-
...sectionAttrs.value
|
|
377
|
-
})),
|
|
382
|
+
mergedAttrs,
|
|
378
383
|
get CBox() {
|
|
379
384
|
return CBox;
|
|
380
385
|
}
|
|
@@ -387,7 +392,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
387
392
|
}
|
|
388
393
|
});
|
|
389
394
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
390
|
-
return openBlock(), createBlock($setup["CBox"],
|
|
395
|
+
return openBlock(), createBlock($setup["CBox"], mergeProps({ ref: "_section" }, $setup.mergedAttrs), {
|
|
391
396
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
392
397
|
_: 3
|
|
393
398
|
}, 16);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group-section.mjs","names":[],"sources":["../../../../src/components/button/button-group-section/button-group-section.vue"],"sourcesContent":["<template>\n <c-box v-bind=\"mergedAttrs\">\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { CBox,
|
|
1
|
+
{"version":3,"file":"button-group-section.mjs","names":[],"sources":["../../../../src/components/button/button-group-section/button-group-section.vue"],"sourcesContent":["<template>\n <c-box ref=\"_section\" v-bind=\"mergedAttrs\">\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { CBox, useComponentProps, useStyles } from '../../../core'\nimport type {\n ButtonGroupSectionFactory,\n ButtonGroupSectionProps,\n} from './button-group-section.types'\nimport classes from '../button.module.css'\nimport { varsResolver } from './button-group-section.utils'\n\ndefineOptions({\n name: 'CButtonGroupSection',\n})\n\nconst _section = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<ButtonGroupSectionProps>()\n\nconst props = useComponentProps({\n component: 'CButtonGroupSection',\n defaultProps: {\n variant: 'default',\n },\n props: rawProps,\n})\n\nconst knownProps = [\n 'className',\n 'style',\n 'classNames',\n 'styles',\n 'unstyled',\n 'vars',\n 'gradient',\n 'radius',\n 'autoContrast',\n 'attributes',\n]\n\nconst getStyles = useStyles<ButtonGroupSectionFactory>({\n name: 'ButtonGroupSection',\n props: { ...props.value, ...attrs } as ButtonGroupSectionProps,\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 rootSelector: 'groupSection',\n})\n\nconst sectionAttrs = computed(() => getStyles('groupSection'))\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, ...sectionAttrs.value }\n})\n\ndefineExpose({\n section: computed(() => _section.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AS,eAAe,SAAS,OAAO,QAAQ,IAAI,EACtD,CAAC;;;;;;;;;;;;;;;;;;;;;;qBA7EC,YAEQ,OAAA,SAFR,WAEQ,EAFD,KAAI,WAAU,GAAS,OAAA,WAAW,GAAA;yBAC/B,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { getFontSize, getRadius, getSize } from "../../../core/utils/get-size/get-size.mjs";
|
|
3
|
+
import { createVarsResolver } from "../../../core/styles-api/create-vars-resolver/create-vars-resolver.mjs";
|
|
4
|
+
//#region packages/@cck-ui/core/src/components/button/button-group-section/button-group-section.utils.ts
|
|
5
|
+
const varsResolver = createVarsResolver((theme, { radius, color, gradient, variant, autoContrast, size }) => {
|
|
6
|
+
const colors = theme.variantColorResolver({
|
|
7
|
+
color: color || theme.primaryColor,
|
|
8
|
+
theme,
|
|
9
|
+
gradient,
|
|
10
|
+
variant: variant || "default",
|
|
11
|
+
autoContrast
|
|
12
|
+
});
|
|
13
|
+
return { groupSection: {
|
|
14
|
+
"--section-height": getSize(size, "section-height"),
|
|
15
|
+
"--section-padding-x": getSize(size, "section-padding-x"),
|
|
16
|
+
"--section-fz": size?.includes("compact") ? getFontSize(size.replace("compact-", "")) : getFontSize(size),
|
|
17
|
+
"--section-radius": radius === void 0 ? void 0 : getRadius(radius),
|
|
18
|
+
"--section-bg": color || variant ? colors.background : void 0,
|
|
19
|
+
"--section-color": colors.color,
|
|
20
|
+
"--section-bd": color || variant ? colors.border : void 0
|
|
21
|
+
} };
|
|
22
|
+
});
|
|
23
|
+
//#endregion
|
|
24
|
+
export { varsResolver };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=button-group-section.utils.mjs.map
|