@cck-ui/core 0.18.4 → 0.19.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.
Files changed (37) hide show
  1. package/cjs/components/action-icon/action-icon.cjs +1 -1
  2. package/cjs/components/action-icon/action-icon.cjs.map +1 -1
  3. package/cjs/components/group/group.cjs +6 -4
  4. package/cjs/components/group/group.cjs.map +1 -1
  5. package/cjs/components/image/image.cjs +429 -0
  6. package/cjs/components/image/image.cjs.map +1 -0
  7. package/cjs/components/image/image.module.cjs +7 -0
  8. package/cjs/components/image/image.module.cjs.map +1 -0
  9. package/cjs/components/image/image.utils.cjs +11 -0
  10. package/cjs/components/image/image.utils.cjs.map +1 -0
  11. package/cjs/components/image/index.cjs +14 -0
  12. package/cjs/components/image/index.cjs.map +1 -0
  13. package/cjs/index.cjs +29 -26
  14. package/cjs/index.cjs.map +1 -1
  15. package/esm/components/action-icon/action-icon.mjs +1 -1
  16. package/esm/components/action-icon/action-icon.mjs.map +1 -1
  17. package/esm/components/group/group.mjs +7 -5
  18. package/esm/components/group/group.mjs.map +1 -1
  19. package/esm/components/image/image.mjs +429 -0
  20. package/esm/components/image/image.mjs.map +1 -0
  21. package/esm/components/image/image.module.mjs +7 -0
  22. package/esm/components/image/image.module.mjs.map +1 -0
  23. package/esm/components/image/image.utils.mjs +12 -0
  24. package/esm/components/image/image.utils.mjs.map +1 -0
  25. package/esm/components/image/index.mjs +11 -0
  26. package/esm/components/image/index.mjs.map +1 -0
  27. package/esm/index.mjs +3 -1
  28. package/esm/index.mjs.map +1 -1
  29. package/lib/components/image/image.types.d.ts +33 -0
  30. package/lib/components/image/image.utils.d.ts +7 -0
  31. package/lib/components/image/index.d.ts +6 -0
  32. package/lib/components/index.d.ts +1 -0
  33. package/package.json +1 -1
  34. package/styles/image.css +6 -0
  35. package/styles/image.layer.css +7 -0
  36. package/styles.css +7 -0
  37. package/styles.layer.css +7 -0
@@ -442,7 +442,7 @@ const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
442
442
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
443
443
  return (0, vue.openBlock)(), (0, vue.createBlock)($setup["UnstyledButton"], (0, vue.mergeProps)({ ref: "_root" }, $setup.mergedRootAttrs, {
444
444
  "aria-busy": $setup.props.loading || void 0,
445
- disabled: $setup.props.disabled || $props.loading,
445
+ disabled: $setup.props.disabled || $setup.props.loading,
446
446
  size: $setup.props.size,
447
447
  unstyled: $setup.props.unstyled
448
448
  }), {
@@ -1 +1 @@
1
- {"version":3,"file":"action-icon.cjs","names":[],"sources":["../../../src/components/action-icon/action-icon.vue"],"sourcesContent":["<template>\n <unstyled-button\n ref=\"_root\"\n v-bind=\"mergedRootAttrs\"\n :aria-busy=\"props.loading || undefined\"\n :disabled=\"props.disabled || loading\"\n :size=\"props.size\"\n :unstyled=\"props.unstyled\"\n >\n <c-transition\n transition=\"slide-down\"\n v-if=\"typeof props.loading === 'boolean'\"\n :duration=\"150\"\n :mounted=\"props.loading\"\n >\n <template #default=\"{ styles }\">\n <c-box\n aria-hidden=\"true\"\n ref=\"_inner\"\n tag=\"span\"\n v-bind=\"getStyles('loader', { style: styles })\"\n >\n <c-loader\n color=\"var(--ai-color)\"\n size=\"calc(var(--ai-size) * 0.55)\"\n v-bind=\"props.loaderProps\"\n ></c-loader>\n </c-box>\n </template>\n </c-transition>\n\n <c-box tag=\"span\" v-bind=\"getStyles('icon')\" :mod=\"{ loading: props.loading }\">\n <slot />\n </c-box>\n </unstyled-button>\n</template>\n\n<script setup lang=\"ts\">\nimport UnstyledButton from '../unstyled-button'\nimport { CLoader } from '../loader'\nimport { CTransition } from '../transition'\nimport { computed, ref, useAttrs } from 'vue'\nimport { ActionIconFactory, ActionIconProps } from './action-icon.types'\nimport { CBox, useComponentProps, useStyles } from '../../core'\nimport classes from './action-icon.module.css'\nimport { varsResolver } from './action-icon.utils'\n\ndefineOptions({\n name: 'CActionIcon',\n})\n\nconst _root = ref<InstanceType<typeof UnstyledButton> | null>(null)\nconst _inner = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<ActionIconProps>()\n\nconst props = useComponentProps({\n component: 'CActionIcon',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'className',\n 'classNames',\n 'style',\n 'styles',\n 'unstyled',\n 'loading',\n 'loaderProps',\n 'size',\n 'color',\n 'radius',\n '__staticSelector',\n 'gradient',\n 'vars',\n 'disabled',\n 'dataDisabled',\n 'autoContrast',\n 'mod',\n 'attributes',\n]\n\nconst getStyles = useStyles<ActionIconFactory>({\n name: ['ActionIcon', props.value.__staticSelector],\n props: { ...props.value, ...attrs } as ActionIconProps,\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 { disabled: props.value.disabled || props.value.dataDisabled },\n { loading: props.value.loading },\n])\n\nconst rootAttrs = computed(() =>\n getStyles('root', {\n active: !props.value.disabled && !props.value.loading && !props.value.dataDisabled,\n })\n)\n\nconst mergedRootAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n const userMod = props.value.mod\n const mergedMod = [\n ...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)),\n ...(modList.value || []),\n ]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n inner: computed(() => _inner.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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A,IAAA,YAAA,CAAA,OAAA,aAAA,GAAA,IAAA,WAAA,CAAA;KAHV,OAAM;KACN,MAAK;OACG,OAAA,MAAM,WAAW,GAAA,MAAA,EAAA,CAAA,CAAA;;;;wFAQzB,OAAA,UAAA,GAAA,IAAA,WAAA,CAAA,EAFD,KAAI,OAAM,GAAS,OAAA,UAAS,MAAA,GAAA,EAAW,KAAG,EAAA,SAAa,OAAA,MAAM,QAAO,EAAA,CAAA,GAAA;mCACjE,EAAA,GAAA,IAAA,WAAA,CAAA,KAAA,QAAA,SAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"action-icon.cjs","names":[],"sources":["../../../src/components/action-icon/action-icon.vue"],"sourcesContent":["<template>\n <unstyled-button\n ref=\"_root\"\n v-bind=\"mergedRootAttrs\"\n :aria-busy=\"props.loading || undefined\"\n :disabled=\"props.disabled || props.loading\"\n :size=\"props.size\"\n :unstyled=\"props.unstyled\"\n >\n <c-transition\n transition=\"slide-down\"\n v-if=\"typeof props.loading === 'boolean'\"\n :duration=\"150\"\n :mounted=\"props.loading\"\n >\n <template #default=\"{ styles }\">\n <c-box\n aria-hidden=\"true\"\n ref=\"_inner\"\n tag=\"span\"\n v-bind=\"getStyles('loader', { style: styles })\"\n >\n <c-loader\n color=\"var(--ai-color)\"\n size=\"calc(var(--ai-size) * 0.55)\"\n v-bind=\"props.loaderProps\"\n ></c-loader>\n </c-box>\n </template>\n </c-transition>\n\n <c-box tag=\"span\" v-bind=\"getStyles('icon')\" :mod=\"{ loading: props.loading }\">\n <slot />\n </c-box>\n </unstyled-button>\n</template>\n\n<script setup lang=\"ts\">\nimport UnstyledButton from '../unstyled-button'\nimport { CLoader } from '../loader'\nimport { CTransition } from '../transition'\nimport { computed, ref, useAttrs } from 'vue'\nimport { ActionIconFactory, ActionIconProps } from './action-icon.types'\nimport { CBox, useComponentProps, useStyles } from '../../core'\nimport classes from './action-icon.module.css'\nimport { varsResolver } from './action-icon.utils'\n\ndefineOptions({\n name: 'CActionIcon',\n})\n\nconst _root = ref<InstanceType<typeof UnstyledButton> | null>(null)\nconst _inner = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<ActionIconProps>()\n\nconst props = useComponentProps({\n component: 'CActionIcon',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'className',\n 'classNames',\n 'style',\n 'styles',\n 'unstyled',\n 'loading',\n 'loaderProps',\n 'size',\n 'color',\n 'radius',\n '__staticSelector',\n 'gradient',\n 'vars',\n 'disabled',\n 'dataDisabled',\n 'autoContrast',\n 'mod',\n 'attributes',\n]\n\nconst getStyles = useStyles<ActionIconFactory>({\n name: ['ActionIcon', props.value.__staticSelector],\n props: { ...props.value, ...attrs } as ActionIconProps,\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 { disabled: props.value.disabled || props.value.dataDisabled },\n { loading: props.value.loading },\n])\n\nconst rootAttrs = computed(() =>\n getStyles('root', {\n active: !props.value.disabled && !props.value.loading && !props.value.dataDisabled,\n })\n)\n\nconst mergedRootAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n const userMod = props.value.mod\n const mergedMod = [\n ...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)),\n ...(modList.value || []),\n ]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n inner: computed(() => _inner.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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CAAA,GAAA;oCAM/B,EAAA,GAAA,IAAA,YAAA,CAAA,OAAA,aAAA,GAAA,IAAA,WAAA,CAAA;KAHV,OAAM;KACN,MAAK;OACG,OAAA,MAAM,WAAW,GAAA,MAAA,EAAA,CAAA,CAAA;;;;wFAQzB,OAAA,UAAA,GAAA,IAAA,WAAA,CAAA,EAFD,KAAI,OAAM,GAAS,OAAA,UAAS,MAAA,GAAA,EAAW,KAAG,EAAA,SAAa,OAAA,MAAM,QAAO,EAAA,CAAA,GAAA;mCACjE,EAAA,GAAA,IAAA,WAAA,CAAA,KAAA,QAAA,SAAA,CAAA,CAAA"}
@@ -432,10 +432,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
432
432
  size: $props.__size,
433
433
  variant: $props.variant
434
434
  }), {
435
- default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)($setup.filteredChildren, (node, index) => {
436
- return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(node), { key: node.key || index });
437
- }), 128))]),
438
- _: 1
435
+ default: (0, vue.withCtx)(() => [
436
+ (0, vue.createCommentVNode)(" TODO: filter falsy children "),
437
+ (0, vue.createCommentVNode)(" <component v-for=\"(node, index) in filteredChildren\" :key=\"node.key || index\" :is=\"node\" /> "),
438
+ (0, vue.renderSlot)(_ctx.$slots, "default")
439
+ ]),
440
+ _: 3
439
441
  }, 16, ["size", "variant"]);
440
442
  }
441
443
  var group_default = /*#__PURE__*/ require_export_helper.default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/cck-ui/cck-ui/packages/@cck-ui/core/src/components/group/group.vue"]]);
@@ -1 +1 @@
1
- {"version":3,"file":"group.cjs","names":[],"sources":["../../../src/components/group/group.vue"],"sourcesContent":["<template>\n <c-box ref=\"_root\" v-bind=\"mergedAttrs\" :size=\"__size\" :variant=\"variant\">\n <component v-for=\"(node, index) in filteredChildren\" :key=\"node.key || index\" :is=\"node\" />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs, useSlots } from 'vue'\nimport type { GroupFactory, GroupProps, GroupStylesCtx } from './group.types'\nimport { filterFalsyChildren } from './filter-falsy-children/filter-falsy-children'\nimport { getSpacing, useStyles, CBox, useComponentProps } from '../../core'\nimport classes from './group.module.css'\nimport { varsResolver } from './group.utils'\n\ndefineOptions({\n name: 'CGroup',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\nconst slots = useSlots()\n\nconst rawProps = defineProps<GroupProps>()\n\nconst props = useComponentProps({\n component: 'CGroup',\n defaultProps: {\n preventGrowOverflow: true,\n gap: 'md',\n align: 'center',\n justify: 'flex-start',\n wrap: 'wrap',\n },\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'gap',\n 'align',\n 'justify',\n 'wrap',\n 'grow',\n 'preventGrowOverflow',\n 'vars',\n 'variant',\n '__size',\n 'mod',\n 'attributes',\n]\n\nconst filteredChildren = filterFalsyChildren(slots.default?.())\nconst childrenCount = filteredChildren.length\nconst resolvedGap = getSpacing(props.value.gap)\nconst childWidth = `calc(${100 / childrenCount}% - (${resolvedGap} - ${resolvedGap} / ${childrenCount}))`\n\nconst stylesCtx: GroupStylesCtx = { childWidth }\n\nconst getStyles = useStyles<GroupFactory>({\n name: 'Group',\n props: { ...props.value, ...attrs } as GroupProps,\n stylesCtx,\n className: props.value.className,\n style: props.value.style,\n classes,\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(() => [{ grow: props.value.grow }])\n\nconst rootAttrs = computed(() => getStyles('root'))\n\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n Object.keys(propsValue).forEach((key) => {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n })\n const userMod = props.value.mod\n const mergedMod = [\n ...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)),\n ...(modList.value || []),\n ]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBA,MAAM,SAAA,GAAA,IAAA,IAAA,CAA8C,IAAI;EAExD,MAAM,SAAA,GAAA,IAAA,SAAA,CAAiB;EACvB,MAAM,SAAA,GAAA,IAAA,SAAA,CAAiB;EAEvB,MAAM,WAAW;EAEjB,MAAM,QAAQ,4BAAA,kBAAkB;GAC9B,WAAW;GACX,cAAc;IACZ,qBAAqB;IACrB,KAAK;IACL,OAAO;IACP,SAAS;IACT,MAAM;GACR;GACA,OAAO;EACT,CAAC;EAED,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,mBAAmB,8BAAA,oBAAoB,MAAM,UAAU,CAAC;EAC9D,MAAM,gBAAgB,iBAAiB;EACvC,MAAM,cAAc,iBAAA,WAAW,MAAM,MAAM,GAAG;EAC9C,MAAM,aAAa,QAAQ,MAAM,cAAc,OAAO,YAAY,KAAK,YAAY,KAAK,cAAc;EAEtG,MAAM,YAA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A,mBAAA,CAAuC,IAAA,UAAA,OAAA,GAAA,IAAA,WAAA,CAAxD,OAAA,mBAAhB,MAAM,UAAK;sFAAqD,IAAI,GAAA,EAAjC,KAAK,KAAK,OAAO,MAAA,CAAA"}
1
+ {"version":3,"file":"group.cjs","names":[],"sources":["../../../src/components/group/group.vue"],"sourcesContent":["<template>\n <c-box ref=\"_root\" v-bind=\"mergedAttrs\" :size=\"__size\" :variant=\"variant\">\n <!-- TODO: filter falsy children -->\n <!-- <component v-for=\"(node, index) in filteredChildren\" :key=\"node.key || index\" :is=\"node\" /> -->\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs, useSlots } from 'vue'\nimport type { GroupFactory, GroupProps, GroupStylesCtx } from './group.types'\nimport { filterFalsyChildren } from './filter-falsy-children/filter-falsy-children'\nimport { getSpacing, useStyles, CBox, useComponentProps } from '../../core'\nimport classes from './group.module.css'\nimport { varsResolver } from './group.utils'\n\ndefineOptions({\n name: 'CGroup',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\nconst slots = useSlots()\n\nconst rawProps = defineProps<GroupProps>()\n\nconst props = useComponentProps({\n component: 'CGroup',\n defaultProps: {\n preventGrowOverflow: true,\n gap: 'md',\n align: 'center',\n justify: 'flex-start',\n wrap: 'wrap',\n },\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'gap',\n 'align',\n 'justify',\n 'wrap',\n 'grow',\n 'preventGrowOverflow',\n 'vars',\n 'variant',\n '__size',\n 'mod',\n 'attributes',\n]\n\nconst filteredChildren = filterFalsyChildren(slots.default?.())\nconst childrenCount = filteredChildren.length\nconst resolvedGap = getSpacing(props.value.gap)\nconst childWidth = `calc(${100 / childrenCount}% - (${resolvedGap} - ${resolvedGap} / ${childrenCount}))`\n\nconst stylesCtx: GroupStylesCtx = { childWidth }\n\nconst getStyles = useStyles<GroupFactory>({\n name: 'Group',\n props: { ...props.value, ...attrs } as GroupProps,\n stylesCtx,\n className: props.value.className,\n style: props.value.style,\n classes,\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(() => [{ grow: props.value.grow }])\n\nconst rootAttrs = computed(() => getStyles('root'))\n\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n Object.keys(propsValue).forEach((key) => {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n })\n const userMod = props.value.mod\n const mergedMod = [\n ...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)),\n ...(modList.value || []),\n ]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBA,MAAM,SAAA,GAAA,IAAA,IAAA,CAA8C,IAAI;EAExD,MAAM,SAAA,GAAA,IAAA,SAAA,CAAiB;EACvB,MAAM,SAAA,GAAA,IAAA,SAAA,CAAiB;EAEvB,MAAM,WAAW;EAEjB,MAAM,QAAQ,4BAAA,kBAAkB;GAC9B,WAAW;GACX,cAAc;IACZ,qBAAqB;IACrB,KAAK;IACL,OAAO;IACP,SAAS;IACT,M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;IAAE,GAAG;IAAQ,KAAK;IAAW,GAAG,UAAU;GAAM;EACzD,CAAC;EAED,SAAa,EACX,OAAA,GAAA,IAAA,SAAA,OAAqB,MAAM,OAAO,QAAQ,IAAI,EAChD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mDAjGS,OAAA,UAAA,GAAA,IAAA,WAAA,CAAA,EAJD,KAAI,QAAO,GAAS,OAAA,aAAW;EAAG,MAAM,OAAA;EAAS,SAAS,OAAA;;kCAC3B;+BAApC,+BAAA;+BACA,qGAAA;uBACQ,KAAA,QAAA,SAAA"}
@@ -0,0 +1,429 @@
1
+ "use client";
2
+ const require_export_helper = require("../../_virtual/_/plugin-vue/export-helper.cjs");
3
+ const require_use_component_props = require("../../core/config-provider/use-component-props/use-component-props.cjs");
4
+ const require_index = require("../../core/box/index.cjs");
5
+ const require_use_styles = require("../../core/styles-api/use-styles/use-styles.cjs");
6
+ const require_image_utils = require("./image.utils.cjs");
7
+ const require_image_module = require("./image.module.cjs");
8
+ let vue = require("vue");
9
+ //#region packages/@cck-ui/core/src/components/image/image.vue
10
+ const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
11
+ name: "CImage",
12
+ __name: "image",
13
+ props: {
14
+ radius: {
15
+ type: null,
16
+ required: false
17
+ },
18
+ fit: {
19
+ type: null,
20
+ required: false
21
+ },
22
+ fallbackSrc: {
23
+ type: String,
24
+ required: false
25
+ },
26
+ src: {
27
+ type: null,
28
+ required: false
29
+ },
30
+ className: {
31
+ type: String,
32
+ required: false
33
+ },
34
+ style: {
35
+ type: [
36
+ Object,
37
+ Function,
38
+ Array
39
+ ],
40
+ required: false,
41
+ skipCheck: true
42
+ },
43
+ __vars: {
44
+ type: null,
45
+ required: false
46
+ },
47
+ __size: {
48
+ type: String,
49
+ required: false
50
+ },
51
+ hiddenFrom: {
52
+ type: null,
53
+ required: false
54
+ },
55
+ visibleFrom: {
56
+ type: null,
57
+ required: false
58
+ },
59
+ lightHidden: {
60
+ type: Boolean,
61
+ required: false
62
+ },
63
+ darkHidden: {
64
+ type: Boolean,
65
+ required: false
66
+ },
67
+ mod: {
68
+ type: [
69
+ Object,
70
+ String,
71
+ Array
72
+ ],
73
+ required: false
74
+ },
75
+ m: {
76
+ type: null,
77
+ required: false
78
+ },
79
+ my: {
80
+ type: null,
81
+ required: false
82
+ },
83
+ mx: {
84
+ type: null,
85
+ required: false
86
+ },
87
+ mt: {
88
+ type: null,
89
+ required: false
90
+ },
91
+ mb: {
92
+ type: null,
93
+ required: false
94
+ },
95
+ ms: {
96
+ type: null,
97
+ required: false
98
+ },
99
+ me: {
100
+ type: null,
101
+ required: false
102
+ },
103
+ mis: {
104
+ type: null,
105
+ required: false
106
+ },
107
+ mie: {
108
+ type: null,
109
+ required: false
110
+ },
111
+ ml: {
112
+ type: null,
113
+ required: false
114
+ },
115
+ mr: {
116
+ type: null,
117
+ required: false
118
+ },
119
+ p: {
120
+ type: null,
121
+ required: false
122
+ },
123
+ py: {
124
+ type: null,
125
+ required: false
126
+ },
127
+ px: {
128
+ type: null,
129
+ required: false
130
+ },
131
+ pt: {
132
+ type: null,
133
+ required: false
134
+ },
135
+ pb: {
136
+ type: null,
137
+ required: false
138
+ },
139
+ ps: {
140
+ type: null,
141
+ required: false
142
+ },
143
+ pe: {
144
+ type: null,
145
+ required: false
146
+ },
147
+ pis: {
148
+ type: null,
149
+ required: false
150
+ },
151
+ pie: {
152
+ type: null,
153
+ required: false
154
+ },
155
+ pl: {
156
+ type: null,
157
+ required: false
158
+ },
159
+ pr: {
160
+ type: null,
161
+ required: false
162
+ },
163
+ bd: {
164
+ type: null,
165
+ required: false
166
+ },
167
+ bdrs: {
168
+ type: null,
169
+ required: false
170
+ },
171
+ bg: {
172
+ type: null,
173
+ required: false
174
+ },
175
+ c: {
176
+ type: null,
177
+ required: false
178
+ },
179
+ opacity: {
180
+ type: [
181
+ String,
182
+ Object,
183
+ Number
184
+ ],
185
+ required: false
186
+ },
187
+ ff: {
188
+ type: [String, Object],
189
+ required: false
190
+ },
191
+ fz: {
192
+ type: null,
193
+ required: false
194
+ },
195
+ fw: {
196
+ type: null,
197
+ required: false
198
+ },
199
+ lts: {
200
+ type: null,
201
+ required: false
202
+ },
203
+ ta: {
204
+ type: [String, Object],
205
+ required: false
206
+ },
207
+ lh: {
208
+ type: null,
209
+ required: false
210
+ },
211
+ fs: {
212
+ type: null,
213
+ required: false
214
+ },
215
+ tt: {
216
+ type: [String, Object],
217
+ required: false
218
+ },
219
+ td: {
220
+ type: null,
221
+ required: false
222
+ },
223
+ w: {
224
+ type: null,
225
+ required: false
226
+ },
227
+ miw: {
228
+ type: null,
229
+ required: false
230
+ },
231
+ maw: {
232
+ type: null,
233
+ required: false
234
+ },
235
+ h: {
236
+ type: null,
237
+ required: false
238
+ },
239
+ mih: {
240
+ type: null,
241
+ required: false
242
+ },
243
+ mah: {
244
+ type: null,
245
+ required: false
246
+ },
247
+ bgsz: {
248
+ type: null,
249
+ required: false
250
+ },
251
+ bgp: {
252
+ type: null,
253
+ required: false
254
+ },
255
+ bgr: {
256
+ type: null,
257
+ required: false
258
+ },
259
+ bga: {
260
+ type: null,
261
+ required: false
262
+ },
263
+ pos: {
264
+ type: [String, Object],
265
+ required: false
266
+ },
267
+ top: {
268
+ type: null,
269
+ required: false
270
+ },
271
+ left: {
272
+ type: null,
273
+ required: false
274
+ },
275
+ bottom: {
276
+ type: null,
277
+ required: false
278
+ },
279
+ right: {
280
+ type: null,
281
+ required: false
282
+ },
283
+ inset: {
284
+ type: null,
285
+ required: false
286
+ },
287
+ display: {
288
+ type: null,
289
+ required: false
290
+ },
291
+ flex: {
292
+ type: null,
293
+ required: false
294
+ },
295
+ unstyled: {
296
+ type: Boolean,
297
+ required: false
298
+ },
299
+ variant: {
300
+ type: null,
301
+ required: false
302
+ },
303
+ classNames: {
304
+ type: null,
305
+ required: false
306
+ },
307
+ styles: {
308
+ type: null,
309
+ required: false
310
+ },
311
+ vars: {
312
+ type: Function,
313
+ required: false
314
+ },
315
+ attributes: {
316
+ type: null,
317
+ required: false
318
+ }
319
+ },
320
+ emits: ["error"],
321
+ setup(__props, { expose: __expose, emit: __emit }) {
322
+ const emits = __emit;
323
+ const _root = (0, vue.ref)(null);
324
+ const attrs = (0, vue.useAttrs)();
325
+ const rawProps = __props;
326
+ const props = require_use_component_props.useComponentProps({
327
+ component: "CImage",
328
+ defaultProps: {},
329
+ props: rawProps
330
+ });
331
+ const knownProps = [
332
+ "classNames",
333
+ "className",
334
+ "style",
335
+ "styles",
336
+ "unstyled",
337
+ "vars",
338
+ "src",
339
+ "radius",
340
+ "fit",
341
+ "fallbackSrc",
342
+ "mod",
343
+ "attributes"
344
+ ];
345
+ const getStyles = require_use_styles.useStyles({
346
+ name: "Image",
347
+ classes: require_image_module.default,
348
+ props: {
349
+ ...props.value,
350
+ ...attrs
351
+ },
352
+ className: props.value.className,
353
+ classNames: props.value.classNames,
354
+ style: props.value.style,
355
+ styles: props.value.styles,
356
+ unstyled: props.value.unstyled,
357
+ attributes: props.value.attributes,
358
+ vars: props.value.vars,
359
+ varsResolver: require_image_utils.varsResolver
360
+ });
361
+ const hasError = (0, vue.ref)(!props.value.src);
362
+ (0, vue.watch)(() => props.value.src, (newSrc) => {
363
+ hasError.value = !newSrc;
364
+ });
365
+ const currentSrc = (0, vue.computed)(() => {
366
+ if (hasError.value && props.value.fallbackSrc) return props.value.fallbackSrc;
367
+ return props.value.src;
368
+ });
369
+ const handleError = (event) => {
370
+ emits("error", event);
371
+ hasError.value = true;
372
+ };
373
+ const modList = (0, vue.computed)(() => {
374
+ if (hasError.value && props.value.fallbackSrc) return ["fallback"];
375
+ return [];
376
+ });
377
+ const rootAttrs = (0, vue.computed)(() => getStyles("root"));
378
+ const mergedAttrs = (0, vue.computed)(() => {
379
+ const others = {};
380
+ const propsValue = props.value;
381
+ for (const key in propsValue) if (!knownProps.includes(key)) others[key] = propsValue[key];
382
+ const userMod = props.value.mod;
383
+ const mergedMod = [...Array.isArray(userMod) ? userMod : [userMod].filter(Boolean), ...modList.value || []];
384
+ return {
385
+ ...others,
386
+ mod: mergedMod,
387
+ ...rootAttrs.value
388
+ };
389
+ });
390
+ __expose({ root: (0, vue.computed)(() => _root.value?.root ?? null) });
391
+ const __returned__ = {
392
+ emits,
393
+ _root,
394
+ attrs,
395
+ rawProps,
396
+ props,
397
+ knownProps,
398
+ getStyles,
399
+ hasError,
400
+ currentSrc,
401
+ handleError,
402
+ modList,
403
+ rootAttrs,
404
+ mergedAttrs,
405
+ get CBox() {
406
+ return require_index.CBox;
407
+ }
408
+ };
409
+ Object.defineProperty(__returned__, "__isScriptSetup", {
410
+ enumerable: false,
411
+ value: true
412
+ });
413
+ return __returned__;
414
+ }
415
+ });
416
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
417
+ return (0, vue.openBlock)(), (0, vue.createBlock)($setup["CBox"], (0, vue.mergeProps)({
418
+ ref: "_root",
419
+ tag: "img"
420
+ }, $setup.mergedAttrs, {
421
+ src: $setup.currentSrc,
422
+ onError: $setup.handleError
423
+ }), null, 16, ["src"]);
424
+ }
425
+ var image_default = /*#__PURE__*/ require_export_helper.default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/cck-ui/cck-ui/packages/@cck-ui/core/src/components/image/image.vue"]]);
426
+ //#endregion
427
+ exports.default = image_default;
428
+
429
+ //# sourceMappingURL=image.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.cjs","names":[],"sources":["../../../src/components/image/image.vue"],"sourcesContent":["<template>\n <c-box ref=\"_root\" tag=\"img\" v-bind=\"mergedAttrs\" :src=\"currentSrc\" @error=\"handleError\"></c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs, watch } from 'vue'\nimport { CBox, useComponentProps, useStyles } from '../../core'\nimport { ImageFactory, ImageProps } from './image.types'\nimport { varsResolver } from './image.utils'\nimport classes from './image.module.css'\n\ndefineOptions({\n name: 'CImage',\n})\n\nconst emits = defineEmits<{\n error: [event: Event]\n}>()\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<ImageProps>()\n\nconst props = useComponentProps({\n component: 'CImage',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'src',\n 'radius',\n 'fit',\n 'fallbackSrc',\n 'mod',\n 'attributes',\n]\n\nconst getStyles = useStyles<ImageFactory>({\n name: 'Image',\n classes,\n props: { ...props.value, ...attrs } as ImageProps,\n className: props.value.className,\n classNames: props.value.classNames,\n style: props.value.style,\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 hasError = ref(!props.value.src)\n\nwatch(\n () => props.value.src,\n (newSrc) => {\n hasError.value = !newSrc\n }\n)\n\nconst currentSrc = computed(() => {\n if (hasError.value && props.value.fallbackSrc) {\n return props.value.fallbackSrc\n }\n return props.value.src\n})\n\nconst handleError = (event: Event) => {\n emits('error', event)\n hasError.value = true\n}\n\nconst modList = computed(() => {\n if (hasError.value && props.value.fallbackSrc) {\n return ['fallback']\n }\n return []\n})\n\nconst rootAttrs = computed(() => getStyles('root'))\n\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n const userMod = props.value.mod\n const mergedMod = [\n ...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)),\n ...(modList.value || []),\n ]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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MAAM,WAAA,GAAA,IAAA,SAAA,OAAyB;GAC7B,IAAI,SAAS,SAAS,MAAM,MAAM,aAChC,OAAO,CAAC,UAAU;GAEpB,OAAO,CAAC;EACV,CAAC;EAED,MAAM,aAAA,GAAA,IAAA,SAAA,OAA2B,UAAU,MAAM,CAAC;EAElD,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,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,UAAU;GAAM;EACzD,CAAC;EAED,SAAa,EACX,OAAA,GAAA,IAAA,SAAA,OAAqB,MAAM,OAAO,QAAQ,IAAI,EAChD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;mDA3GkG,OAAA,UAAA,GAAA,IAAA,WAAA,CAAA;EAA1F,KAAI;EAAQ,KAAI;IAAc,OAAA,aAAW;EAAG,KAAK,OAAA;EAAa,SAAO,OAAA"}
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ //#region packages/@cck-ui/core/src/components/image/image.module.css
3
+ var image_module_default = { "root": "m_273f9a14" };
4
+ //#endregion
5
+ exports.default = image_module_default;
6
+
7
+ //# sourceMappingURL=image.module.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.module.cjs","names":[],"sources":["../../../src/components/image/image.module.css"],"sourcesContent":[".root {\n display: block;\n object-fit: var(--image-object-fit, cover);\n width: 100%;\n border-radius: var(--image-radius, 0);\n}\n"],"mappings":";;AAAA,IAAA,uBAAe,EAAC,QAAO,aAAY"}
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ const require_get_size = require("../../core/utils/get-size/get-size.cjs");
3
+ //#region packages/@cck-ui/core/src/components/image/image.utils.ts
4
+ const varsResolver = require("../../core/styles-api/create-vars-resolver/create-vars-resolver.cjs").createVarsResolver((_, { radius, fit }) => ({ root: {
5
+ "--image-object-fit": fit,
6
+ "--image-radius": radius === void 0 ? void 0 : require_get_size.getRadius(radius)
7
+ } }));
8
+ //#endregion
9
+ exports.varsResolver = varsResolver;
10
+
11
+ //# sourceMappingURL=image.utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.utils.cjs","names":["createVarsResolver","getRadius"],"sources":["../../../src/components/image/image.utils.ts"],"sourcesContent":["import { createVarsResolver, getRadius } from '../../core'\nimport { ImageFactory } from './image.types'\n\nexport const varsResolver = createVarsResolver<ImageFactory>((_, { radius, fit }) => ({\n root: {\n '--image-object-fit': fit,\n '--image-radius': radius === undefined ? undefined : getRadius(radius),\n },\n}))\n"],"mappings":";;;AAGA,MAAa,4FAAeA,CAAAA,CAAAA,oBAAkC,GAAG,EAAE,QAAQ,WAAW,EACpF,MAAM;CACJ,sBAAsB;CACtB,kBAAkB,WAAW,KAAA,IAAY,KAAA,IAAYC,iBAAAA,UAAU,MAAM;AACvE,EACF,EAAE"}
@@ -0,0 +1,14 @@
1
+ "use client";
2
+ const require_install = require("../../core/utils/vue/install.cjs");
3
+ const require_statics = require("../../core/utils/vue/statics.cjs");
4
+ const require_image_utils = require("./image.utils.cjs");
5
+ const require_image_module = require("./image.module.cjs");
6
+ const require_image = require("./image.cjs");
7
+ //#region packages/@cck-ui/core/src/components/image/index.ts
8
+ const ImageWithStatic = require_statics.withPropsFactory(require_statics.withExtend(require_statics.withVarsResolver(require_statics.withClasses(require_image.default, require_image_module.default), require_image_utils.varsResolver)));
9
+ const CImage = require_install.withInstall(ImageWithStatic);
10
+ //#endregion
11
+ exports.CImage = CImage;
12
+ exports.default = CImage;
13
+
14
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":["withPropsFactory","withExtend","withVarsResolver","withClasses","Image","classes","varsResolver","withInstall"],"sources":["../../../src/components/image/index.ts"],"sourcesContent":["import {\n SFCWithInstallAndClasses,\n withClasses,\n withExtend,\n withInstall,\n withPropsFactory,\n withVarsResolver,\n} from '../../core'\nimport Image from './image.vue'\nimport classes from './image.module.css'\nimport { varsResolver } from './image.utils'\n\nconst ImageWithStatic = withPropsFactory(\n withExtend(withVarsResolver(withClasses(Image, classes), varsResolver))\n)\n\nexport const CImage: SFCWithInstallAndClasses<typeof Image, typeof classes> =\n withInstall(ImageWithStatic)\n\nexport default CImage\n\nexport * from './image.types'\n"],"mappings":";;;;;;;AAYA,MAAM,kBAAkBA,gBAAAA,iBACtBC,gBAAAA,WAAWC,gBAAAA,iBAAiBC,gBAAAA,YAAYC,cAAAA,SAAOC,qBAAAA,OAAO,GAAGC,oBAAAA,YAAY,CAAC,CACxE;AAEA,MAAa,SACXC,gBAAAA,YAAY,eAAe"}
package/cjs/index.cjs CHANGED
@@ -70,14 +70,15 @@ const require_index$13 = require("./components/empty-state/index.cjs");
70
70
  const require_index$14 = require("./components/flex/index.cjs");
71
71
  const require_index$15 = require("./components/grid/index.cjs");
72
72
  const require_index$16 = require("./components/group/index.cjs");
73
- const require_index$17 = require("./components/paper/index.cjs");
74
- const require_index$18 = require("./components/semi-circle-progress/index.cjs");
75
- const require_index$19 = require("./components/simple-grid/index.cjs");
76
- const require_index$20 = require("./components/skeleton/index.cjs");
77
- const require_index$21 = require("./components/space/index.cjs");
78
- const require_index$22 = require("./components/splitter/index.cjs");
79
- const require_index$23 = require("./components/stack/index.cjs");
80
- const require_index$24 = require("./components/text/index.cjs");
73
+ const require_index$17 = require("./components/image/index.cjs");
74
+ const require_index$18 = require("./components/paper/index.cjs");
75
+ const require_index$19 = require("./components/semi-circle-progress/index.cjs");
76
+ const require_index$20 = require("./components/simple-grid/index.cjs");
77
+ const require_index$21 = require("./components/skeleton/index.cjs");
78
+ const require_index$22 = require("./components/space/index.cjs");
79
+ const require_index$23 = require("./components/splitter/index.cjs");
80
+ const require_index$24 = require("./components/stack/index.cjs");
81
+ const require_index$25 = require("./components/text/index.cjs");
81
82
  let _vue_shared = require("@vue/shared");
82
83
  //#region packages/@cck-ui/core/src/index.ts
83
84
  const INSTALLED_KEY = Symbol("INSTALLED_KEY");
@@ -104,16 +105,17 @@ const components = [
104
105
  require_index$14.CFlex,
105
106
  require_index$15.CGrid,
106
107
  require_index$16.CGroup,
108
+ require_index$17.CImage,
107
109
  require_index$4.CLoader,
108
- require_index$17.CPaper,
109
- require_index$18.CSemiCircleProgress,
110
- require_index$19.CSimpleGrid,
111
- require_index$20.CSkeleton,
112
- require_index$21.CSpace,
113
- require_index$22.CSplitter,
114
- require_index$22.CSplitterPane,
115
- require_index$23.CStack,
116
- require_index$24.CText,
110
+ require_index$18.CPaper,
111
+ require_index$19.CSemiCircleProgress,
112
+ require_index$20.CSimpleGrid,
113
+ require_index$21.CSkeleton,
114
+ require_index$22.CSpace,
115
+ require_index$23.CSplitter,
116
+ require_index$23.CSplitterPane,
117
+ require_index$24.CStack,
118
+ require_index$25.CText,
117
119
  require_index$5.CTransition,
118
120
  require_index$3.UnstyledButton
119
121
  ];
@@ -148,17 +150,18 @@ exports.CEmptyStateTitle = require_index$13.CEmptyStateTitle;
148
150
  exports.CFlex = require_index$14.CFlex;
149
151
  exports.CGrid = require_index$15.CGrid;
150
152
  exports.CGroup = require_index$16.CGroup;
153
+ exports.CImage = require_index$17.CImage;
151
154
  exports.CLoader = require_index$4.CLoader;
152
155
  exports.CONFIG_KEY = require_config_provider_types.CONFIG_KEY;
153
- exports.CPaper = require_index$17.CPaper;
154
- exports.CSemiCircleProgress = require_index$18.CSemiCircleProgress;
155
- exports.CSimpleGrid = require_index$19.CSimpleGrid;
156
- exports.CSkeleton = require_index$20.CSkeleton;
157
- exports.CSpace = require_index$21.CSpace;
158
- exports.CSplitter = require_index$22.CSplitter;
159
- exports.CSplitterPane = require_index$22.CSplitterPane;
160
- exports.CStack = require_index$23.CStack;
161
- exports.CText = require_index$24.CText;
156
+ exports.CPaper = require_index$18.CPaper;
157
+ exports.CSemiCircleProgress = require_index$19.CSemiCircleProgress;
158
+ exports.CSimpleGrid = require_index$20.CSimpleGrid;
159
+ exports.CSkeleton = require_index$21.CSkeleton;
160
+ exports.CSpace = require_index$22.CSpace;
161
+ exports.CSplitter = require_index$23.CSplitter;
162
+ exports.CSplitterPane = require_index$23.CSplitterPane;
163
+ exports.CStack = require_index$24.CStack;
164
+ exports.CText = require_index$25.CText;
162
165
  exports.CTransition = require_index$5.CTransition;
163
166
  exports.CckConfigProvider = require_index$1.CckConfigProvider;
164
167
  exports.CckUI = CckUI;