@cck-ui/core 0.4.10 → 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/button.cjs +71 -63
- package/cjs/components/button/button.cjs.map +1 -1
- package/cjs/components/button/button.utils.cjs +28 -0
- package/cjs/components/button/button.utils.cjs.map +1 -0
- package/cjs/components/button/index.cjs +13 -5
- package/cjs/components/button/index.cjs.map +1 -1
- package/cjs/components/grid/col/col.cjs +33 -16
- package/cjs/components/grid/col/col.cjs.map +1 -1
- package/cjs/components/grid/grid.cjs +63 -34
- package/cjs/components/grid/grid.cjs.map +1 -1
- package/cjs/components/grid/grid.constants.cjs.map +1 -1
- package/cjs/components/grid/grid.utils.cjs +11 -0
- package/cjs/components/grid/grid.utils.cjs.map +1 -0
- package/cjs/components/grid/index.cjs +7 -2
- package/cjs/components/grid/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.module.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/loader/loaders/bars.cjs +6 -3
- package/cjs/components/loader/loaders/bars.cjs.map +1 -1
- package/cjs/components/loader/loaders/dots.cjs +6 -3
- package/cjs/components/loader/loaders/dots.cjs.map +1 -1
- package/cjs/components/loader/loaders/oval.cjs +6 -3
- package/cjs/components/loader/loaders/oval.cjs.map +1 -1
- 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 +37 -22
- package/cjs/components/unstyled-button/unstyled-button.cjs.map +1 -1
- package/cjs/core/box/box.cjs +39 -27
- package/cjs/core/box/box.cjs.map +1 -1
- package/cjs/core/box/get-box-style/get-box-style.cjs.map +1 -1
- package/cjs/core/box/style-props/extract-style-props/extract-style-props.cjs.map +1 -1
- package/cjs/core/box/style-props/parse-style-props/sort-media-queries.cjs.map +1 -1
- package/cjs/core/box/style-props/resolvers/border-resolver/border-resolver.cjs.map +1 -1
- package/cjs/core/box/style-props/resolvers/color-resolver/color-resolver.cjs.map +1 -1
- package/cjs/core/box/style-props/resolvers/font-family-resolver/font-family-resolver.cjs.map +1 -1
- package/cjs/core/box/style-props/resolvers/index.cjs.map +1 -1
- package/cjs/core/box/style-props/style-props-data.cjs.map +1 -1
- package/cjs/core/config-provider/color-functions/get-gradient/get-gradient.cjs +3 -3
- package/cjs/core/config-provider/color-functions/get-gradient/get-gradient.cjs.map +1 -1
- package/cjs/core/config-provider/color-functions/rgba/rgba.cjs +8 -0
- package/cjs/core/config-provider/color-functions/rgba/rgba.cjs.map +1 -1
- package/cjs/core/config-provider/color-functions/to-rgba/to-rgba.cjs.map +1 -1
- package/cjs/core/config-provider/config-provider.cjs +33 -22
- package/cjs/core/config-provider/config-provider.cjs.map +1 -1
- package/cjs/core/config-provider/default-colors.cjs.map +1 -1
- package/cjs/core/config-provider/index.cjs +5 -0
- package/cjs/core/config-provider/index.cjs.map +1 -1
- package/cjs/core/config-provider/merge-cck-theme/merge-cck-theme.cjs +2 -2
- package/cjs/core/config-provider/merge-cck-theme/merge-cck-theme.cjs.map +1 -1
- package/cjs/core/config-provider/merge-theme-overrides/merge-theme-overrides.cjs +10 -0
- package/cjs/core/config-provider/merge-theme-overrides/merge-theme-overrides.cjs.map +1 -0
- package/cjs/core/config-provider/use-component-props/use-component-props.cjs +35 -0
- package/cjs/core/config-provider/use-component-props/use-component-props.cjs.map +1 -0
- package/cjs/core/responsive-style-manager/css-object-to-string/css-object-to-string.cjs.map +1 -1
- package/cjs/core/responsive-style-manager/normalize-number-like-string-prop/normalize-number-like-string-prop.cjs +1 -1
- package/cjs/core/responsive-style-manager/normalize-number-like-string-prop/normalize-number-like-string-prop.cjs.map +1 -1
- package/cjs/core/responsive-style-manager/responsive-style-manager.cjs.map +1 -1
- package/cjs/core/responsive-style-manager/styles-to-string/styles-to-string.cjs.map +1 -1
- package/cjs/core/styles-api/use-styles/get-class-name/get-options-class-names/get-options-class-names.cjs.map +1 -1
- package/cjs/core/styles-api/use-styles/get-class-name/get-resolved-class-names/get-resolved-class-names.cjs.map +1 -1
- package/cjs/core/styles-api/use-styles/get-class-name/get-root-class-name/get-root-class-name.cjs.map +1 -1
- package/cjs/core/styles-api/use-styles/get-class-name/get-selector-class-name/get-selector-class-name.cjs.map +1 -1
- package/cjs/core/styles-api/use-styles/get-class-name/get-static-class-names/get-static-class-names.cjs.map +1 -1
- package/cjs/core/styles-api/use-styles/get-class-name/get-variant-class-name/get-variant-class-name.cjs.map +1 -1
- package/cjs/core/utils/deep-merge/deep-merge.cjs +18 -0
- package/cjs/core/utils/deep-merge/deep-merge.cjs.map +1 -0
- package/cjs/core/utils/get-breakpoint-value/get-breakpoint-value.cjs.map +1 -1
- package/cjs/core/utils/get-size/get-size.cjs +2 -2
- package/cjs/core/utils/get-size/get-size.cjs.map +1 -1
- package/cjs/core/utils/get-sorted-breakpoints/get-sorted-breakpoints.cjs.map +1 -1
- package/cjs/core/utils/number-like-string-to-number/number-like-string-to-number.cjs.map +1 -1
- package/cjs/core/utils/units-converters/px.cjs.map +1 -1
- package/cjs/core/utils/units-converters/rem.cjs.map +1 -1
- package/cjs/core/utils/vue/component.cjs.map +1 -1
- package/cjs/core/utils/vue/install.cjs +3 -3
- package/cjs/core/utils/vue/install.cjs.map +1 -1
- package/cjs/core/utils/vue/statics.cjs +38 -0
- package/cjs/core/utils/vue/statics.cjs.map +1 -0
- package/cjs/index.cjs +12 -6
- 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/button.mjs +71 -63
- package/esm/components/button/button.mjs.map +1 -1
- package/esm/components/button/button.utils.mjs +29 -0
- package/esm/components/button/button.utils.mjs.map +1 -0
- package/esm/components/button/index.mjs +13 -5
- package/esm/components/button/index.mjs.map +1 -1
- package/esm/components/grid/col/col.mjs +34 -17
- package/esm/components/grid/col/col.mjs.map +1 -1
- package/esm/components/grid/grid.constants.mjs.map +1 -1
- package/esm/components/grid/grid.mjs +63 -34
- package/esm/components/grid/grid.mjs.map +1 -1
- package/esm/components/grid/grid.utils.mjs +12 -0
- package/esm/components/grid/grid.utils.mjs.map +1 -0
- package/esm/components/grid/index.mjs +6 -2
- package/esm/components/grid/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.module.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/loader/loaders/bars.mjs +7 -4
- package/esm/components/loader/loaders/bars.mjs.map +1 -1
- package/esm/components/loader/loaders/dots.mjs +7 -4
- package/esm/components/loader/loaders/dots.mjs.map +1 -1
- package/esm/components/loader/loaders/oval.mjs +7 -4
- package/esm/components/loader/loaders/oval.mjs.map +1 -1
- 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 +38 -23
- package/esm/components/unstyled-button/unstyled-button.mjs.map +1 -1
- package/esm/core/box/box.mjs +40 -28
- package/esm/core/box/box.mjs.map +1 -1
- package/esm/core/box/get-box-style/get-box-style.mjs.map +1 -1
- package/esm/core/box/style-props/extract-style-props/extract-style-props.mjs.map +1 -1
- package/esm/core/box/style-props/parse-style-props/sort-media-queries.mjs.map +1 -1
- package/esm/core/box/style-props/resolvers/border-resolver/border-resolver.mjs.map +1 -1
- package/esm/core/box/style-props/resolvers/color-resolver/color-resolver.mjs.map +1 -1
- package/esm/core/box/style-props/resolvers/font-family-resolver/font-family-resolver.mjs.map +1 -1
- package/esm/core/box/style-props/resolvers/index.mjs.map +1 -1
- package/esm/core/box/style-props/style-props-data.mjs.map +1 -1
- package/esm/core/config-provider/color-functions/get-gradient/get-gradient.mjs +3 -3
- package/esm/core/config-provider/color-functions/get-gradient/get-gradient.mjs.map +1 -1
- package/esm/core/config-provider/color-functions/rgba/rgba.mjs +8 -1
- package/esm/core/config-provider/color-functions/rgba/rgba.mjs.map +1 -1
- package/esm/core/config-provider/color-functions/to-rgba/to-rgba.mjs.map +1 -1
- package/esm/core/config-provider/config-provider.mjs +33 -22
- package/esm/core/config-provider/config-provider.mjs.map +1 -1
- package/esm/core/config-provider/default-colors.mjs.map +1 -1
- package/esm/core/config-provider/index.mjs +4 -2
- package/esm/core/config-provider/index.mjs.map +1 -1
- package/esm/core/config-provider/merge-cck-theme/merge-cck-theme.mjs +2 -2
- package/esm/core/config-provider/merge-cck-theme/merge-cck-theme.mjs.map +1 -1
- package/esm/core/config-provider/merge-theme-overrides/merge-theme-overrides.mjs +10 -0
- package/esm/core/config-provider/merge-theme-overrides/merge-theme-overrides.mjs.map +1 -0
- package/esm/core/config-provider/use-component-props/use-component-props.mjs +35 -0
- package/esm/core/config-provider/use-component-props/use-component-props.mjs.map +1 -0
- package/esm/core/responsive-style-manager/css-object-to-string/css-object-to-string.mjs.map +1 -1
- package/esm/core/responsive-style-manager/normalize-number-like-string-prop/normalize-number-like-string-prop.mjs +1 -1
- package/esm/core/responsive-style-manager/normalize-number-like-string-prop/normalize-number-like-string-prop.mjs.map +1 -1
- package/esm/core/responsive-style-manager/responsive-style-manager.mjs.map +1 -1
- package/esm/core/responsive-style-manager/styles-to-string/styles-to-string.mjs.map +1 -1
- package/esm/core/styles-api/use-styles/get-class-name/get-options-class-names/get-options-class-names.mjs.map +1 -1
- package/esm/core/styles-api/use-styles/get-class-name/get-resolved-class-names/get-resolved-class-names.mjs.map +1 -1
- package/esm/core/styles-api/use-styles/get-class-name/get-root-class-name/get-root-class-name.mjs.map +1 -1
- package/esm/core/styles-api/use-styles/get-class-name/get-selector-class-name/get-selector-class-name.mjs.map +1 -1
- package/esm/core/styles-api/use-styles/get-class-name/get-static-class-names/get-static-class-names.mjs.map +1 -1
- package/esm/core/styles-api/use-styles/get-class-name/get-variant-class-name/get-variant-class-name.mjs.map +1 -1
- package/esm/core/utils/deep-merge/deep-merge.mjs +18 -0
- package/esm/core/utils/deep-merge/deep-merge.mjs.map +1 -0
- package/esm/core/utils/get-breakpoint-value/get-breakpoint-value.mjs.map +1 -1
- package/esm/core/utils/get-size/get-size.mjs +2 -2
- package/esm/core/utils/get-size/get-size.mjs.map +1 -1
- package/esm/core/utils/get-sorted-breakpoints/get-sorted-breakpoints.mjs.map +1 -1
- package/esm/core/utils/number-like-string-to-number/number-like-string-to-number.mjs.map +1 -1
- package/esm/core/utils/units-converters/px.mjs.map +1 -1
- package/esm/core/utils/units-converters/rem.mjs.map +1 -1
- package/esm/core/utils/vue/component.mjs.map +1 -1
- package/esm/core/utils/vue/install.mjs +2 -2
- package/esm/core/utils/vue/install.mjs.map +1 -1
- package/esm/core/utils/vue/statics.mjs +35 -0
- package/esm/core/utils/vue/statics.mjs.map +1 -0
- package/esm/index.mjs +6 -4
- 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/button.utils.d.ts +9 -0
- package/lib/components/button/index.d.ts +7 -7
- package/lib/components/grid/grid.utils.d.ts +9 -0
- package/lib/components/grid/index.d.ts +6 -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/lib/core/config-provider/color-functions/index.d.ts +1 -1
- package/lib/core/config-provider/color-functions/rgba/rgba.d.ts +1 -0
- package/lib/core/config-provider/index.d.ts +2 -0
- package/lib/core/config-provider/merge-theme-overrides/merge-theme-overrides.d.ts +2 -0
- package/lib/core/config-provider/use-component-props/use-component-props.d.ts +7 -0
- package/lib/core/responsive-style-manager/responsive-style-manager.d.ts +1 -0
- package/lib/core/styles-api/index.d.ts +1 -1
- package/lib/core/styles-api/use-styles/get-class-name/get-options-class-names/get-options-class-names.d.ts +1 -1
- package/lib/core/styles-api/use-styles/get-class-name/get-resolved-class-names/get-resolved-class-names.d.ts +1 -1
- package/lib/core/styles-api/use-styles/get-class-name/get-static-class-names/get-static-class-names.d.ts +1 -1
- package/lib/core/styles-api/use-styles/get-class-name/get-variant-class-name/get-variant-class-name.d.ts +1 -1
- package/lib/core/utils/deep-merge/deep-merge.d.ts +1 -0
- package/lib/core/utils/index.d.ts +4 -5
- package/lib/core/utils/vue/index.d.ts +1 -0
- package/lib/core/utils/vue/statics.d.ts +14 -0
- package/lib/core/utils/vue/typescript.d.ts +8 -0
- package/package.json +2 -1
- package/styles/loader.css +1 -2
- package/styles/loader.layer.css +1 -2
- package/styles/stack.css +7 -0
- package/styles/stack.layer.css +8 -0
- package/styles.css +9 -2
- package/styles.layer.css +9 -2
- package/cjs/components/loader/use-loader.cjs +0 -10
- package/cjs/components/loader/use-loader.cjs.map +0 -1
- package/cjs/core/utils/color.cjs +0 -112
- package/cjs/core/utils/color.cjs.map +0 -1
- package/cjs/core/utils/dom/style.cjs +0 -13
- package/cjs/core/utils/dom/style.cjs.map +0 -1
- package/esm/components/loader/use-loader.mjs +0 -10
- package/esm/components/loader/use-loader.mjs.map +0 -1
- package/esm/core/utils/color.mjs +0 -110
- package/esm/core/utils/color.mjs.map +0 -1
- package/esm/core/utils/dom/style.mjs +0 -12
- package/esm/core/utils/dom/style.mjs.map +0 -1
- package/lib/core/utils/color.d.ts +0 -11
- package/lib/core/utils/dom/index.d.ts +0 -1
- package/lib/core/utils/dom/style.d.ts +0 -1
|
@@ -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,MAA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AAK,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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AI,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"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { rem } from "../../core/utils/units-converters/rem.mjs";
|
|
3
|
-
import { getFontSize, getRadius, getSize } from "../../core/utils/get-size/get-size.mjs";
|
|
4
3
|
import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.mjs";
|
|
4
|
+
import { useComponentProps } from "../../core/config-provider/use-component-props/use-component-props.mjs";
|
|
5
5
|
import { CBox } from "../../core/box/index.mjs";
|
|
6
|
-
import { createVarsResolver } from "../../core/styles-api/create-vars-resolver/create-vars-resolver.mjs";
|
|
7
6
|
import { useStyles } from "../../core/styles-api/use-styles/use-styles.mjs";
|
|
8
7
|
import button_module_default from "./button.module.mjs";
|
|
9
8
|
import { UnstyledButton } from "../unstyled-button/index.mjs";
|
|
9
|
+
import { varsResolver } from "./button.utils.mjs";
|
|
10
10
|
import { CLoader } from "../loader/index.mjs";
|
|
11
11
|
import { CTransition } from "../transition/index.mjs";
|
|
12
|
-
import { computed, createBlock, createCommentVNode, createVNode, defineComponent, mergeProps, openBlock, renderSlot, resolveDynamicComponent, useSlots, withCtx } from "vue";
|
|
12
|
+
import { computed, createBlock, createCommentVNode, createVNode, defineComponent, mergeProps, openBlock, ref, renderSlot, resolveDynamicComponent, useAttrs, useSlots, withCtx } from "vue";
|
|
13
13
|
//#region packages/@cck-ui/core/src/components/button/button.vue
|
|
14
14
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
15
15
|
name: "CButton",
|
|
@@ -358,7 +358,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
358
358
|
}
|
|
359
359
|
},
|
|
360
360
|
setup(__props, { expose: __expose }) {
|
|
361
|
-
|
|
361
|
+
const _root = ref(null);
|
|
362
|
+
const _inner = ref(null);
|
|
363
|
+
const _label = ref(null);
|
|
364
|
+
const attrs = useAttrs();
|
|
362
365
|
const slots = useSlots();
|
|
363
366
|
const hasLeftSlot = computed(() => !!slots["left-section"]);
|
|
364
367
|
const hasRightSlot = computed(() => !!slots["right-section"]);
|
|
@@ -374,28 +377,12 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
374
377
|
common: { transformOrigin: "center" },
|
|
375
378
|
transitionProperty: "transform, opacity"
|
|
376
379
|
};
|
|
377
|
-
const
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
variant: variant || "default",
|
|
383
|
-
autoContrast
|
|
384
|
-
});
|
|
385
|
-
return { root: {
|
|
386
|
-
"--button-justify": justify,
|
|
387
|
-
"--button-height": getSize(size, "button-height"),
|
|
388
|
-
"--button-padding-x": getSize(size, "button-padding-x"),
|
|
389
|
-
"--button-fz": size?.includes("compact") ? getFontSize(size.replace("compact-", "")) : getFontSize(size),
|
|
390
|
-
"--button-radius": radius === void 0 ? void 0 : getRadius(radius),
|
|
391
|
-
"--button-bg": color || variant ? colors.background : void 0,
|
|
392
|
-
"--button-hover": color || variant ? colors.hover : void 0,
|
|
393
|
-
"--button-color": colors.color,
|
|
394
|
-
"--button-bd": color || variant ? colors.border : void 0,
|
|
395
|
-
"--button-hover-color": color || variant ? colors.hoverColor : void 0
|
|
396
|
-
} };
|
|
380
|
+
const rawProps = __props;
|
|
381
|
+
const props = useComponentProps({
|
|
382
|
+
component: "CButton",
|
|
383
|
+
defaultProps: {},
|
|
384
|
+
props: rawProps
|
|
397
385
|
});
|
|
398
|
-
const props = __props;
|
|
399
386
|
const knownProps = [
|
|
400
387
|
"style",
|
|
401
388
|
"vars",
|
|
@@ -419,46 +406,69 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
419
406
|
];
|
|
420
407
|
const getStyles = useStyles({
|
|
421
408
|
name: "Button",
|
|
422
|
-
props
|
|
409
|
+
props: {
|
|
410
|
+
...props.value,
|
|
411
|
+
...attrs
|
|
412
|
+
},
|
|
423
413
|
classes: button_module_default,
|
|
424
|
-
className: props.className,
|
|
425
|
-
style: props.style,
|
|
426
|
-
classNames: props.classNames,
|
|
427
|
-
styles: props.styles,
|
|
428
|
-
unstyled: props.unstyled,
|
|
429
|
-
attributes: props.attributes,
|
|
430
|
-
vars: props.vars,
|
|
414
|
+
className: props.value.className,
|
|
415
|
+
style: props.value.style,
|
|
416
|
+
classNames: props.value.classNames,
|
|
417
|
+
styles: props.value.styles,
|
|
418
|
+
unstyled: props.value.unstyled,
|
|
419
|
+
attributes: props.value.attributes,
|
|
420
|
+
vars: props.value.vars,
|
|
431
421
|
varsResolver
|
|
432
422
|
});
|
|
433
|
-
const
|
|
423
|
+
const modList = computed(() => [
|
|
424
|
+
{ disabled: props.value.disabled || props.value.dataDisabled },
|
|
425
|
+
{ loading: props.value.loading },
|
|
426
|
+
{ block: props.value.fullWidth },
|
|
427
|
+
{ "with-left-section": hasLeftSlot.value || !!props.value.leftSection },
|
|
428
|
+
{ "with-right-section": hasRightSlot.value || !!props.value.rightSection }
|
|
429
|
+
]);
|
|
430
|
+
const rootAttrs = computed(() => getStyles("root", { active: !props.value.disabled && !props.value.loading && !props.value.dataDisabled }));
|
|
431
|
+
const mergedRootAttrs = computed(() => {
|
|
432
|
+
const others = {};
|
|
433
|
+
const propsValue = props.value;
|
|
434
|
+
Object.keys(propsValue).forEach((key) => {
|
|
435
|
+
if (!knownProps.includes(key)) others[key] = propsValue[key];
|
|
436
|
+
});
|
|
437
|
+
const userMod = props.value.mod;
|
|
438
|
+
const mergedMod = [...Array.isArray(userMod) ? userMod : [userMod].filter(Boolean), ...modList.value || []];
|
|
439
|
+
return {
|
|
440
|
+
...others,
|
|
441
|
+
mod: mergedMod,
|
|
442
|
+
...rootAttrs.value
|
|
443
|
+
};
|
|
444
|
+
});
|
|
445
|
+
const innerAttrs = computed(() => getStyles("inner"));
|
|
446
|
+
const sectionAttrs = computed(() => getStyles("section"));
|
|
447
|
+
const labelAttrs = computed(() => getStyles("label"));
|
|
448
|
+
__expose({
|
|
449
|
+
root: computed(() => _root.value?.root ?? null),
|
|
450
|
+
inner: _inner.value,
|
|
451
|
+
label: _label.value
|
|
452
|
+
});
|
|
434
453
|
const __returned__ = {
|
|
454
|
+
_root,
|
|
455
|
+
_inner,
|
|
456
|
+
_label,
|
|
457
|
+
attrs,
|
|
435
458
|
slots,
|
|
436
459
|
hasLeftSlot,
|
|
437
460
|
hasRightSlot,
|
|
438
461
|
loaderTransition,
|
|
439
|
-
|
|
462
|
+
rawProps,
|
|
440
463
|
props,
|
|
441
464
|
knownProps,
|
|
442
465
|
getStyles,
|
|
466
|
+
modList,
|
|
443
467
|
rootAttrs,
|
|
444
|
-
mergedRootAttrs
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
...others,
|
|
449
|
-
...rootAttrs.value
|
|
450
|
-
};
|
|
451
|
-
}),
|
|
452
|
-
innerAttrs: computed(() => getStyles("inner")),
|
|
453
|
-
sectionAttrs: computed(() => getStyles("section")),
|
|
454
|
-
labelAttrs: computed(() => getStyles("label")),
|
|
455
|
-
modList: computed(() => [{
|
|
456
|
-
disabled: props.disabled || props.dataDisabled,
|
|
457
|
-
loading: props.loading,
|
|
458
|
-
block: props.fullWidth,
|
|
459
|
-
"with-left-section": hasLeftSlot.value || !!props.leftSection,
|
|
460
|
-
"with-right-section": hasRightSlot.value || !!props.rightSection
|
|
461
|
-
}]),
|
|
468
|
+
mergedRootAttrs,
|
|
469
|
+
innerAttrs,
|
|
470
|
+
sectionAttrs,
|
|
471
|
+
labelAttrs,
|
|
462
472
|
get CBox() {
|
|
463
473
|
return CBox;
|
|
464
474
|
},
|
|
@@ -480,10 +490,9 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
480
490
|
}
|
|
481
491
|
});
|
|
482
492
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
483
|
-
return openBlock(), createBlock($setup["UnstyledButton"], mergeProps($setup.mergedRootAttrs, {
|
|
493
|
+
return openBlock(), createBlock($setup["UnstyledButton"], mergeProps({ ref: "_root" }, $setup.mergedRootAttrs, {
|
|
484
494
|
disabled: $props.disabled || $props.loading,
|
|
485
|
-
unstyled: $props.unstyled
|
|
486
|
-
mod: $setup.modList
|
|
495
|
+
unstyled: $props.unstyled
|
|
487
496
|
}), {
|
|
488
497
|
default: withCtx(() => [typeof $setup.props.loading === "boolean" ? (openBlock(), createBlock($setup["CTransition"], {
|
|
489
498
|
key: 0,
|
|
@@ -491,7 +500,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
491
500
|
transition: $setup.loaderTransition,
|
|
492
501
|
duration: 150
|
|
493
502
|
}, {
|
|
494
|
-
default: withCtx(({ styles }) => [createVNode($setup["CBox"], mergeProps({
|
|
503
|
+
default: withCtx(({ styles }) => [createVNode($setup["CBox"], mergeProps({
|
|
504
|
+
ref: "_inner",
|
|
505
|
+
tag: "span"
|
|
506
|
+
}, $setup.getStyles("loader", { style: styles }), { "aria-hidden": "true" }), {
|
|
495
507
|
default: withCtx(() => [createVNode($setup["CLoader"], mergeProps({
|
|
496
508
|
color: "var(--button-color)",
|
|
497
509
|
size: "calc(var(--button-height) / 1.8)"
|
|
@@ -514,7 +526,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
514
526
|
default: withCtx(() => [createCommentVNode(" TODO "), (openBlock(), createBlock(resolveDynamicComponent($props.leftSection)))]),
|
|
515
527
|
_: 1
|
|
516
528
|
}, 16)) : createCommentVNode("v-if", true),
|
|
517
|
-
createVNode($setup["CBox"], mergeProps($setup.labelAttrs, {
|
|
529
|
+
createVNode($setup["CBox"], mergeProps({ ref: "_label" }, $setup.labelAttrs, {
|
|
518
530
|
tag: "span",
|
|
519
531
|
mod: { loading: $props.loading }
|
|
520
532
|
}), {
|
|
@@ -538,11 +550,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
538
550
|
_: 3
|
|
539
551
|
}, 16)]),
|
|
540
552
|
_: 3
|
|
541
|
-
}, 16, [
|
|
542
|
-
"disabled",
|
|
543
|
-
"unstyled",
|
|
544
|
-
"mod"
|
|
545
|
-
]);
|
|
553
|
+
}, 16, ["disabled", "unstyled"]);
|
|
546
554
|
}
|
|
547
555
|
var button_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.vue"]]);
|
|
548
556
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.mjs","names":[],"sources":["../../../src/components/button/button.vue"],"sourcesContent":["<template>\n <unstyled-button\n v-bind=\"mergedRootAttrs\"\n :disabled=\"disabled || loading\"\n :unstyled=\"unstyled\"\n
|
|
1
|
+
{"version":3,"file":"button.mjs","names":[],"sources":["../../../src/components/button/button.vue"],"sourcesContent":["<template>\n <unstyled-button\n ref=\"_root\"\n v-bind=\"mergedRootAttrs\"\n :disabled=\"disabled || loading\"\n :unstyled=\"unstyled\"\n >\n <c-transition\n v-if=\"typeof props.loading === 'boolean'\"\n :mounted=\"props.loading\"\n :transition=\"loaderTransition\"\n :duration=\"150\"\n >\n <template #default=\"{ styles }\">\n <c-box\n ref=\"_inner\"\n tag=\"span\"\n v-bind=\"getStyles('loader', { style: styles })\"\n aria-hidden=\"true\"\n >\n <c-loader\n color=\"var(--button-color)\"\n size=\"calc(var(--button-height) / 1.8)\"\n v-bind=\"props.loaderProps\"\n ></c-loader>\n </c-box>\n </template>\n </c-transition>\n\n <c-box tag=\"span\" v-bind=\"innerAttrs\">\n <c-box\n v-if=\"$slots['left-section']\"\n v-bind=\"sectionAttrs\"\n tag=\"span\"\n :mod=\"{ position: 'left' }\"\n >\n <slot name=\"left-section\"></slot>\n </c-box>\n <c-box v-else-if=\"leftSection\" v-bind=\"sectionAttrs\" tag=\"span\" :mod=\"{ position: 'left' }\">\n <!-- TODO -->\n <component :is=\"leftSection\" />\n </c-box>\n <c-box ref=\"_label\" v-bind=\"labelAttrs\" tag=\"span\" :mod=\"{ loading }\">\n <slot />\n </c-box>\n <c-box\n v-if=\"$slots['right-section']\"\n v-bind=\"sectionAttrs\"\n tag=\"span\"\n :mod=\"{ position: 'right' }\"\n >\n <slot name=\"right-section\"></slot>\n </c-box>\n <c-box v-else-if=\"rightSection\" v-bind=\"sectionAttrs\" tag=\"span\" :mod=\"{ position: 'right' }\">\n <!-- TODO -->\n <component :is=\"rightSection\" />\n </c-box>\n </c-box>\n </unstyled-button>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs, useSlots } from 'vue'\nimport { CBox, rem, useComponentProps, useStyles } from '../../core'\nimport { UnstyledButton } from '../unstyled-button'\nimport { ButtonFactory, type ButtonProps } from './button.types'\nimport { varsResolver } from './button.utils'\nimport classes from './button.module.css'\nimport { CLoader } from '../loader'\nimport { CTransition, CckTransition } from '../transition'\n\ndefineOptions({\n name: 'CButton',\n})\n\ndefineSlots<{\n 'left-section': any\n 'right-section': any\n default: any\n}>()\n\nconst _root = ref<InstanceType<typeof UnstyledButton> | null>(null)\nconst _inner = ref<HTMLSpanElement | null>(null)\nconst _label = ref<HTMLSpanElement | null>(null)\n\nconst attrs = useAttrs()\nconst slots = useSlots()\n\nconst hasLeftSlot = computed(() => !!slots['left-section'])\nconst hasRightSlot = computed(() => !!slots['right-section'])\n\nconst loaderTransition: CckTransition = {\n in: { opacity: 1, transform: `translate(-50%, calc(-50% + ${rem(1)}))` },\n out: { opacity: 0, transform: 'translate(-50%, -200%)' },\n common: { transformOrigin: 'center' },\n transitionProperty: 'transform, opacity',\n}\n\nconst rawProps = defineProps<ButtonProps>()\n\nconst props = useComponentProps({\n component: 'CButton',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'style',\n 'vars',\n 'className',\n 'color',\n 'disabled',\n 'leftSection',\n 'rightSection',\n 'fullWidth',\n 'radius',\n 'loading',\n 'loaderProps',\n 'gradient',\n 'classNames',\n 'styles',\n 'unstyled',\n 'dataDisabled',\n 'autoContrast',\n 'mod',\n 'attributes',\n]\n\nconst getStyles = useStyles<ButtonFactory>({\n name: 'Button',\n props: { ...props.value, ...attrs } as ButtonProps,\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 {\n disabled: props.value.disabled || props.value.dataDisabled,\n },\n { loading: props.value.loading },\n { block: props.value.fullWidth },\n { 'with-left-section': hasLeftSlot.value || !!props.value.leftSection },\n { 'with-right-section': hasRightSlot.value || !!props.value.rightSection },\n])\n\nconst rootAttrs = computed(() =>\n getStyles('root', {\n active: !props.value.disabled && !props.value.loading && !props.value.dataDisabled,\n })\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 innerAttrs = computed(() => getStyles('inner'))\nconst sectionAttrs = computed(() => getStyles('section'))\nconst labelAttrs = computed(() => getStyles('label'))\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n inner: _inner.value,\n label: _label.value,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiFA,MAAM,QAAQ,IAAgD,IAAI;EAClE,MAAM,SAAS,IAA4B,IAAI;EAC/C,MAAM,SAAS,IAA4B,IAAI;EAE/C,MAAM,QAAQ,SAAS;EACvB,MAAM,QAAQ,SAAS;EAEvB,M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+
import { createVarsResolver } from "../../core/styles-api/create-vars-resolver/create-vars-resolver.mjs";
|
|
4
|
+
//#region packages/@cck-ui/core/src/components/button/button.utils.ts
|
|
5
|
+
const varsResolver = createVarsResolver((theme, { radius, color, gradient, variant, size, justify, autoContrast }) => {
|
|
6
|
+
const colors = theme.variantColorResolver({
|
|
7
|
+
color: color || theme.primaryColor,
|
|
8
|
+
theme,
|
|
9
|
+
gradient,
|
|
10
|
+
variant: variant || "default",
|
|
11
|
+
autoContrast
|
|
12
|
+
});
|
|
13
|
+
return { root: {
|
|
14
|
+
"--button-justify": justify,
|
|
15
|
+
"--button-height": getSize(size, "button-height"),
|
|
16
|
+
"--button-padding-x": getSize(size, "button-padding-x"),
|
|
17
|
+
"--button-fz": size?.includes("compact") ? getFontSize(size.replace("compact-", "")) : getFontSize(size),
|
|
18
|
+
"--button-radius": radius === void 0 ? void 0 : getRadius(radius),
|
|
19
|
+
"--button-bg": color || variant ? colors.background : void 0,
|
|
20
|
+
"--button-hover": color || variant ? colors.hover : void 0,
|
|
21
|
+
"--button-color": colors.color,
|
|
22
|
+
"--button-bd": color || variant ? colors.border : void 0,
|
|
23
|
+
"--button-hover-color": color || variant ? colors.hoverColor : void 0
|
|
24
|
+
} };
|
|
25
|
+
});
|
|
26
|
+
//#endregion
|
|
27
|
+
export { varsResolver };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=button.utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.utils.mjs","names":[],"sources":["../../../src/components/button/button.utils.ts"],"sourcesContent":["import { createVarsResolver, getFontSize, getRadius, getSize } from '../../core'\nimport { ButtonFactory } from './button.types'\n\nexport const varsResolver = createVarsResolver<ButtonFactory>(\n (theme, { radius, color, gradient, variant, size, justify, autoContrast }) => {\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 root: {\n '--button-justify': justify,\n '--button-height': getSize(size, 'button-height'),\n '--button-padding-x': getSize(size, 'button-padding-x'),\n '--button-fz': size?.includes('compact')\n ? getFontSize(size.replace('compact-', ''))\n : getFontSize(size),\n '--button-radius': radius === undefined ? undefined : getRadius(radius),\n '--button-bg': color || variant ? colors.background : undefined,\n '--button-hover': color || variant ? colors.hover : undefined,\n '--button-color': colors.color,\n '--button-bd': color || variant ? colors.border : undefined,\n '--button-hover-color': color || variant ? colors.hoverColor : undefined,\n },\n }\n }\n)\n"],"mappings":";;;;AAGA,MAAa,eAAe,oBACzB,OAAO,EAAE,QAAQ,OAAO,UAAU,SAAS,MAAM,SAAS,mBAAmB;CAC5E,MAAM,SAAS,MAAM,qBAAqB;EACxC,OAAO,SAAS,MAAM;EACtB;EACA;EACA,SAAS,WAAW;EACpB;CACF,CAAC;CAED,OAAO,EACL,MAAM;EACJ,oBAAoB;EACpB,mBAAmB,QAAQ,MAAM,eAAe;EAChD,sBAAsB,QAAQ,MAAM,kBAAkB;EACtD,eAAe,MAAM,SAAS,SAAS,IACnC,YAAY,KAAK,QAAQ,YAAY,EAAE,CAAC,IACxC,YAAY,IAAI;EACpB,mBAAmB,WAAW,KAAA,IAAY,KAAA,IAAY,UAAU,MAAM;EACtE,eAAe,SAAS,UAAU,OAAO,aAAa,KAAA;EACtD,kBAAkB,SAAS,UAAU,OAAO,QAAQ,KAAA;EACpD,kBAAkB,OAAO;EACzB,eAAe,SAAS,UAAU,OAAO,SAAS,KAAA;EAClD,wBAAwB,SAAS,UAAU,OAAO,aAAa,KAAA;CACjE,EACF;AACF,CACF"}
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { withInstall } from "../../core/utils/vue/install.mjs";
|
|
3
|
+
import { withClasses, withExtend, withPropsFactory, withVarsResolver } from "../../core/utils/vue/statics.mjs";
|
|
4
|
+
import button_module_default from "./button.module.mjs";
|
|
5
|
+
import { varsResolver } from "./button.utils.mjs";
|
|
3
6
|
import button_default from "./button.mjs";
|
|
7
|
+
import { varsResolver as varsResolver$1 } from "./button-group-section/button-group-section.utils.mjs";
|
|
4
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";
|
|
5
10
|
import button_group_default from "./button-group/button-group.mjs";
|
|
6
11
|
//#region packages/@cck-ui/core/src/components/button/index.ts
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
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)));
|
|
14
|
+
const ButtonWithStatic = withPropsFactory(withExtend(withVarsResolver(withClasses(button_default, button_module_default), varsResolver)));
|
|
15
|
+
const CButtonGroup = withInstall(ButtonGroupWithStatic);
|
|
16
|
+
const CButtonGroupSection = withInstall(ButtonGroupSectionWithStatic);
|
|
17
|
+
const CButton = withInstall(ButtonWithStatic, {
|
|
18
|
+
CButtonGroup,
|
|
19
|
+
CButtonGroupSection
|
|
12
20
|
});
|
|
13
21
|
//#endregion
|
|
14
22
|
export { CButton, CButton as default, CButtonGroup, CButtonGroupSection };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["ButtonGroup","
|
|
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"}
|