@cck-ui/core 0.5.0 → 0.6.1
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/stack/index.cjs +14 -0
- package/cjs/components/stack/index.cjs.map +1 -0
- package/cjs/components/stack/stack.cjs +406 -0
- package/cjs/components/stack/stack.cjs.map +1 -0
- package/cjs/components/stack/stack.module.cjs +7 -0
- package/cjs/components/stack/stack.module.cjs.map +1 -0
- package/cjs/components/stack/stack.utils.cjs +12 -0
- package/cjs/components/stack/stack.utils.cjs.map +1 -0
- 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/cjs/index.cjs +6 -3
- package/cjs/index.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/stack/index.mjs +11 -0
- package/esm/components/stack/index.mjs.map +1 -0
- package/esm/components/stack/stack.mjs +406 -0
- package/esm/components/stack/stack.mjs.map +1 -0
- package/esm/components/stack/stack.module.mjs +7 -0
- package/esm/components/stack/stack.module.mjs.map +1 -0
- package/esm/components/stack/stack.utils.mjs +13 -0
- package/esm/components/stack/stack.utils.mjs.map +1 -0
- 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/esm/index.mjs +3 -1
- package/esm/index.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/index.d.ts +1 -0
- 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
|
@@ -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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqBA,MAAM,SAAA,GAAA,IAAA,SAAA,CAAiB;EAEvB,MAAM,WAAW;EAEjB,MAAM,QAAQ,4BAAA,kBAAkB;GAC9B,WAAW;GACX,cAAc,EACZ,kBAAkB,iBACpB;GACA,OAAO;EACT,CAAC;EAED,MAAM,EAAE,MAAM,aAAa,MAAM;EAEjC,MAAM,SAAA,GAAA,IAAA,IAAA,CAA8C,IAAI;EAExD,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,YAAY,mBAAA,UAAiC;GACjD,MAAM,MAAM,MAAM;GAClB,OAAO;IAAE,GAAG,MAAM;IAAO,GAAG;GAAM;GAClC,SAAA,+BAAA;GACA,WAAW,MAAM,MAAM;GACvB,OAAO,MAAM,MAAM;GACnB,YAAY,MAAM,MAAM;GACxB,QAAQ,MAAM,MAAM;GACpB,UAAU,MAAM,MAAM;GACtB,YAAY,MAAM,MAAM;EAC1B,CAAC;EAED,MAAM,aAAA,GAAA,IAAA,SAAA,OAA2B,UAAU,QAAQ,EAAE,WAAW,KAAK,CAAC,CAAC;EACvE,MAAM,eAAA,GAAA,IAAA,SAAA,OAA6B;GACjC,MAAM,SAA8B,CAAC;GACrC,MAAM,aAAa,MAAM;GACzB,KAAK,MAAM,OAAO,YAChB,IAAI,CAAC,WAAW,SAAS,GAAG,GAC1B,OAAO,OAAO,WAAW;GAG7B,OAAO;IAAE,GAAG;IAAQ,GAAG,UAAU;GAAM;EACzC,CAAC;EAED,SAAa,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"}
|
package/cjs/index.cjs
CHANGED
|
@@ -63,7 +63,8 @@ const require_index$6 = require("./components/button/index.cjs");
|
|
|
63
63
|
const require_index$7 = require("./components/grid/index.cjs");
|
|
64
64
|
const require_index$8 = require("./components/group/index.cjs");
|
|
65
65
|
const require_index$9 = require("./components/simple-grid/index.cjs");
|
|
66
|
-
const require_index$10 = require("./components/
|
|
66
|
+
const require_index$10 = require("./components/stack/index.cjs");
|
|
67
|
+
const require_index$11 = require("./components/text/index.cjs");
|
|
67
68
|
let _vue_shared = require("@vue/shared");
|
|
68
69
|
//#region packages/@cck-ui/core/src/index.ts
|
|
69
70
|
const INSTALLED_KEY = Symbol("INSTALLED_KEY");
|
|
@@ -78,7 +79,8 @@ const components = [
|
|
|
78
79
|
require_index$8.CGroup,
|
|
79
80
|
require_index$4.CLoader,
|
|
80
81
|
require_index$9.CSimpleGrid,
|
|
81
|
-
require_index$10.
|
|
82
|
+
require_index$10.CStack,
|
|
83
|
+
require_index$11.CText,
|
|
82
84
|
require_index$5.CTransition,
|
|
83
85
|
require_index$3.UnstyledButton
|
|
84
86
|
];
|
|
@@ -102,7 +104,8 @@ exports.CGroup = require_index$8.CGroup;
|
|
|
102
104
|
exports.CLoader = require_index$4.CLoader;
|
|
103
105
|
exports.CONFIG_KEY = require_config_provider_types.CONFIG_KEY;
|
|
104
106
|
exports.CSimpleGrid = require_index$9.CSimpleGrid;
|
|
105
|
-
exports.
|
|
107
|
+
exports.CStack = require_index$10.CStack;
|
|
108
|
+
exports.CText = require_index$11.CText;
|
|
106
109
|
exports.CTransition = require_index$5.CTransition;
|
|
107
110
|
exports.CckConfigProvider = require_index$1.CckConfigProvider;
|
|
108
111
|
exports.CckUI = CckUI;
|
package/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["CckConfigProvider","CBox","CButton","CButtonGroup","CButtonGroupSection","CGrid","CCol","CGroup","CLoader","CSimpleGrid","CText","CTransition","UnstyledButton"],"sources":["../src/index.ts"],"sourcesContent":["import type { App, Plugin } from 'vue'\nimport {\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCol,\n CGrid,\n CGroup,\n CLoader,\n CSimpleGrid,\n CText,\n CTransition,\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 CButton,\n CButtonGroup,\n CButtonGroupSection,\n CGrid,\n CCol,\n CGroup,\n CLoader,\n CSimpleGrid,\n CText,\n CTransition,\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":"
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["CckConfigProvider","CBox","CButton","CButtonGroup","CButtonGroupSection","CGrid","CCol","CGroup","CLoader","CSimpleGrid","CStack","CText","CTransition","UnstyledButton"],"sources":["../src/index.ts"],"sourcesContent":["import type { App, Plugin } from 'vue'\nimport {\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCol,\n CGrid,\n CGroup,\n CLoader,\n CSimpleGrid,\n CStack,\n CText,\n CTransition,\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 CButton,\n CButtonGroup,\n CButtonGroupSection,\n CGrid,\n CCol,\n CGroup,\n CLoader,\n CSimpleGrid,\n CStack,\n CText,\n CTransition,\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAM,gBAAgB,OAAO,eAAe;AAE5C,MAAM,aAAa;CACjBA,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;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,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;GACA,OAAO;EACT,CAAC;EAED,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,YAAY,UAA8B;GAC9C,MAAM;GACN,OAAO;IAAE,GAAG,MAAM;IAAO,GAAG;GAAM;GAClC,SAAA;GACA,WAAW,MAAM,MAAM;GACvB,OAAO,MAAM,MAAM;GACnB,YAAY,MAAM,MAAM;GACxB,QAAQ,MAAM,MAAM;GACpB,UAAU,MAAM,MAAM;GACtB,YAAY,MAAM,MAAM;GACxB,MAAM,MAAM,MAAM;GAClB;GACA,cAAc;EAChB,CAAC;EAED,MAAM,UAAU,eAAe,CAC7B,EACE,aAAa,MAAM,MAAM,YAC3B,CACF,CAAC;EAED,MAAM,aAAa,eAAe,UAAU,OAAO,CAAC;EACpD,MAAM,cAAc,eAAe;GACjC,MAAM,SAA8B,CAAC;GACrC,MAAM,aAAa,MAAM;GACzB,OAAO,KAAK,UAAU,CAAC,CAAC,SAAS,QAAQ;IACvC,IAAI,CAAC,WAAW,SAAS,GAAG,GAC1B,OAAO,OAAO,WAAW;GAE7B,CAAC;GACD,MAAM,UAAU,MAAM,MAAM;GAC5B,MAAM,YAAY,CAChB,GAAI,MAAM,QAAQ,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,OAAO,GAC/D,GAAI,QAAQ,SAAS,CAAC,CACxB;GACA,OAAO;IAAE,GAAG;IAAQ,KAAK;IAAW,GAAG,WAAW;GAAM;EAC1D,CAAC;EAED,MAAM,EAAE,kBAAkB,eAAe,KAAK;EAE9C,SAAa,EACX,OAAO,eAAe,OAAO,OAAO,QAAQ,IAAI,EAClD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;qBAzFC,YAIQ,OAAA,SAJR,WAIQ;EAJD,KAAI;EAAS,MAAK;IAAgB,OAAA,WAAW,GAAA;yBACD,EAAA,UAAA,IAAA,GAAjD,mBAEW,UAAA,MAAA,WAFwB,OAAA,gBAAjB,OAAO,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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBA,MAAM,WAAW,IAAsC,IAAI;EAE3D,MAAM,QAAQ,SAAS;EAEvB,MAAM,WAAW;EAEjB,MAAM,QAAQ,kBAAkB;GAC9B,WAAW;GACX,cAAc,EACZ,SAAS,UACX;GACA,OAAO;EACT,CAAC;EAED,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,YAAY,UAAqC;GACrD,MAAM;GACN,OAAO;IAAE,GAAG,MAAM;IAAO,GAAG;GAAM;GAClC,SAAA;GACA,WAAW,MAAM,MAAM;GACvB,OAAO,MAAM,MAAM;GACnB,YAAY,MAAM,MAAM;GACxB,QAAQ,MAAM,MAAM;GACpB,UAAU,MAAM,MAAM;GACtB,YAAY,MAAM,MAAM;GACxB,MAAM,MAAM,MAAM;GAClB;GACA,cAAc;EAChB,CAAC;EAED,MAAM,eAAe,eAAe,UAAU,cAAc,CAAC;EAC7D,MAAM,cAAc,eAAe;GACjC,MAAM,SAA8B,CAAC;GACrC,MAAM,aAAa,MAAM;GACzB,OAAO,KAAK,UAAU,CAAC,CAAC,SAAS,QAAQ;IACvC,IAAI,CAAC,WAAW,SAAS,GAAG,GAC1B,OAAO,OAAO,WAAW;GAE7B,CAAC;GACD,MAAM,UAAU,MAAM,MAAM;GAC5B,MAAM,YAAY,CAAC,GAAI,MAAM,QAAQ,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,OAAO,CAAE;GACpF,OAAO;IAAE,GAAG;IAAQ,KAAK;IAAW,GAAG,aAAa;GAAM;EAC5D,CAAC;EAED,SAAa,EACX,SAAS,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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-group-section.utils.mjs","names":[],"sources":["../../../../src/components/button/button-group-section/button-group-section.utils.ts"],"sourcesContent":["import { createVarsResolver, getFontSize, getRadius, getSize } from '../../../core'\nimport { ButtonGroupSectionFactory } from './button-group-section.types'\n\nexport const varsResolver = createVarsResolver<ButtonGroupSectionFactory>(\n (theme, { radius, color, gradient, variant, autoContrast, size }) => {\n const colors = theme.variantColorResolver({\n color: color || theme.primaryColor,\n theme,\n gradient,\n variant: variant || 'default',\n autoContrast,\n })\n\n return {\n groupSection: {\n '--section-height': getSize(size, 'section-height'),\n '--section-padding-x': getSize(size, 'section-padding-x'),\n '--section-fz': size?.includes('compact')\n ? getFontSize(size.replace('compact-', ''))\n : getFontSize(size),\n '--section-radius': radius === undefined ? undefined : getRadius(radius),\n '--section-bg': color || variant ? colors.background : undefined,\n '--section-color': colors.color,\n '--section-bd': color || variant ? colors.border : undefined,\n },\n }\n }\n)\n"],"mappings":";;;;AAGA,MAAa,eAAe,oBACzB,OAAO,EAAE,QAAQ,OAAO,UAAU,SAAS,cAAc,WAAW;CACnE,MAAM,SAAS,MAAM,qBAAqB;EACxC,OAAO,SAAS,MAAM;EACtB;EACA;EACA,SAAS,WAAW;EACpB;CACF,CAAC;CAED,OAAO,EACL,cAAc;EACZ,oBAAoB,QAAQ,MAAM,gBAAgB;EAClD,uBAAuB,QAAQ,MAAM,mBAAmB;EACxD,gBAAgB,MAAM,SAAS,SAAS,IACpC,YAAY,KAAK,QAAQ,YAAY,EAAE,CAAC,IACxC,YAAY,IAAI;EACpB,oBAAoB,WAAW,KAAA,IAAY,KAAA,IAAY,UAAU,MAAM;EACvE,gBAAgB,SAAS,UAAU,OAAO,aAAa,KAAA;EACvD,mBAAmB,OAAO;EAC1B,gBAAgB,SAAS,UAAU,OAAO,SAAS,KAAA;CACrD,EACF;AACF,CACF"}
|
|
@@ -4,15 +4,19 @@ import { withClasses, withExtend, withPropsFactory, withVarsResolver } from "../
|
|
|
4
4
|
import button_module_default from "./button.module.mjs";
|
|
5
5
|
import { varsResolver } from "./button.utils.mjs";
|
|
6
6
|
import button_default from "./button.mjs";
|
|
7
|
+
import { varsResolver as varsResolver$1 } from "./button-group-section/button-group-section.utils.mjs";
|
|
7
8
|
import button_group_section_default from "./button-group-section/button-group-section.mjs";
|
|
9
|
+
import { varsResolver as varsResolver$2 } from "./button-group/button-group.utils.mjs";
|
|
8
10
|
import button_group_default from "./button-group/button-group.mjs";
|
|
9
11
|
//#region packages/@cck-ui/core/src/components/button/index.ts
|
|
12
|
+
const ButtonGroupSectionWithStatic = withPropsFactory(withExtend(withVarsResolver(withClasses(button_group_section_default, button_module_default), varsResolver$1)));
|
|
13
|
+
const ButtonGroupWithStatic = withPropsFactory(withExtend(withVarsResolver(withClasses(button_group_default, button_module_default), varsResolver$2)));
|
|
10
14
|
const ButtonWithStatic = withPropsFactory(withExtend(withVarsResolver(withClasses(button_default, button_module_default), varsResolver)));
|
|
11
|
-
const CButtonGroup = withInstall(
|
|
12
|
-
const CButtonGroupSection = withInstall(
|
|
15
|
+
const CButtonGroup = withInstall(ButtonGroupWithStatic);
|
|
16
|
+
const CButtonGroupSection = withInstall(ButtonGroupSectionWithStatic);
|
|
13
17
|
const CButton = withInstall(ButtonWithStatic, {
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
CButtonGroup,
|
|
19
|
+
CButtonGroupSection
|
|
16
20
|
});
|
|
17
21
|
//#endregion
|
|
18
22
|
export { CButton, CButton as default, CButtonGroup, CButtonGroupSection };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["ButtonGroupSection","classes","sectionVarsResolver","ButtonGroup","groupVarsResolver","Button"],"sources":["../../../src/components/button/index.ts"],"sourcesContent":["import {\n type SFCWithInstallAndClasses,\n withClasses,\n withExtend,\n withInstall,\n withPropsFactory,\n withVarsResolver,\n} from '../../core'\nimport ButtonGroup from './button-group/button-group.vue'\nimport ButtonGroupSection from './button-group-section/button-group-section.vue'\nimport Button from './button.vue'\nimport classes from './button.module.css'\n\nimport { varsResolver as sectionVarsResolver } from './button-group-section/button-group-section.utils'\nimport { varsResolver as groupVarsResolver } from './button-group/button-group.utils'\nimport { varsResolver } from './button.utils'\n\nconst ButtonGroupSectionWithStatic = withPropsFactory(\n withExtend(withVarsResolver(withClasses(ButtonGroupSection, classes), sectionVarsResolver))\n)\nconst ButtonGroupWithStatic = withPropsFactory(\n withExtend(withVarsResolver(withClasses(ButtonGroup, classes), groupVarsResolver))\n)\nconst ButtonWithStatic = withPropsFactory(\n withExtend(withVarsResolver(withClasses(Button, classes), varsResolver))\n)\n\nexport const CButtonGroup: SFCWithInstallAndClasses<typeof ButtonGroup, typeof classes> =\n withInstall(ButtonGroupWithStatic)\nexport const CButtonGroupSection: SFCWithInstallAndClasses<\n typeof ButtonGroupSection,\n typeof classes\n> = withInstall(ButtonGroupSectionWithStatic)\nexport const CButton: SFCWithInstallAndClasses<typeof Button, typeof classes> & {\n CButtonGroup: typeof CButtonGroup\n CButtonGroupSection: typeof CButtonGroupSection\n} = withInstall(ButtonWithStatic, {\n CButtonGroup,\n CButtonGroupSection,\n})\n\nexport default CButton\n\nexport * from './button-group-section/button-group-section.types'\nexport * from './button-group/button-group.types'\nexport * from './button.types'\n"],"mappings":";;;;;;;;;;;AAiBA,MAAM,+BAA+B,iBACnC,WAAW,iBAAiB,YAAYA,8BAAoBC,qBAAO,GAAGC,cAAmB,CAAC,CAC5F;AACA,MAAM,wBAAwB,iBAC5B,WAAW,iBAAiB,YAAYC,sBAAaF,qBAAO,GAAGG,cAAiB,CAAC,CACnF;AACA,MAAM,mBAAmB,iBACvB,WAAW,iBAAiB,YAAYC,gBAAQJ,qBAAO,GAAG,YAAY,CAAC,CACzE;AAEA,MAAa,eACX,YAAY,qBAAqB;AACnC,MAAa,sBAGT,YAAY,4BAA4B;AAC5C,MAAa,UAGT,YAAY,kBAAkB;CAChC;CACA;AACF,CAAC"}
|