@cck-ui/core 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/cjs/components/button/button-group/button-group.cjs +61 -35
  2. package/cjs/components/button/button-group/button-group.cjs.map +1 -1
  3. package/cjs/components/button/button-group/button-group.utils.cjs +8 -0
  4. package/cjs/components/button/button-group/button-group.utils.cjs.map +1 -0
  5. package/cjs/components/button/button-group-section/button-group-section.cjs +55 -50
  6. package/cjs/components/button/button-group-section/button-group-section.cjs.map +1 -1
  7. package/cjs/components/button/button-group-section/button-group-section.utils.cjs +25 -0
  8. package/cjs/components/button/button-group-section/button-group-section.utils.cjs.map +1 -0
  9. package/cjs/components/button/index.cjs +8 -4
  10. package/cjs/components/button/index.cjs.map +1 -1
  11. package/cjs/components/group/group.cjs +78 -62
  12. package/cjs/components/group/group.cjs.map +1 -1
  13. package/cjs/components/group/group.utils.cjs +14 -0
  14. package/cjs/components/group/group.utils.cjs.map +1 -0
  15. package/cjs/components/group/index.cjs +5 -1
  16. package/cjs/components/group/index.cjs.map +1 -1
  17. package/cjs/components/loader/index.cjs +5 -1
  18. package/cjs/components/loader/index.cjs.map +1 -1
  19. package/cjs/components/loader/loader.cjs +50 -41
  20. package/cjs/components/loader/loader.cjs.map +1 -1
  21. package/cjs/components/loader/loader.utils.cjs +12 -0
  22. package/cjs/components/loader/loader.utils.cjs.map +1 -0
  23. package/cjs/components/simple-grid/index.cjs +4 -1
  24. package/cjs/components/simple-grid/index.cjs.map +1 -1
  25. package/cjs/components/simple-grid/simple-grid.cjs +46 -21
  26. package/cjs/components/simple-grid/simple-grid.cjs.map +1 -1
  27. package/cjs/components/stack/index.cjs +14 -0
  28. package/cjs/components/stack/index.cjs.map +1 -0
  29. package/cjs/components/stack/stack.cjs +406 -0
  30. package/cjs/components/stack/stack.cjs.map +1 -0
  31. package/cjs/components/stack/stack.module.cjs +7 -0
  32. package/cjs/components/stack/stack.module.cjs.map +1 -0
  33. package/cjs/components/stack/stack.utils.cjs +12 -0
  34. package/cjs/components/stack/stack.utils.cjs.map +1 -0
  35. package/cjs/components/text/index.cjs +5 -1
  36. package/cjs/components/text/index.cjs.map +1 -1
  37. package/cjs/components/text/text.cjs +46 -39
  38. package/cjs/components/text/text.cjs.map +1 -1
  39. package/cjs/components/text/text.utils.cjs +15 -0
  40. package/cjs/components/text/text.utils.cjs.map +1 -0
  41. package/cjs/components/unstyled-button/index.cjs +4 -1
  42. package/cjs/components/unstyled-button/index.cjs.map +1 -1
  43. package/cjs/components/unstyled-button/unstyled-button.cjs +6 -1
  44. package/cjs/components/unstyled-button/unstyled-button.cjs.map +1 -1
  45. package/cjs/index.cjs +6 -3
  46. package/cjs/index.cjs.map +1 -1
  47. package/esm/components/button/button-group/button-group.mjs +61 -35
  48. package/esm/components/button/button-group/button-group.mjs.map +1 -1
  49. package/esm/components/button/button-group/button-group.utils.mjs +9 -0
  50. package/esm/components/button/button-group/button-group.utils.mjs.map +1 -0
  51. package/esm/components/button/button-group-section/button-group-section.mjs +55 -50
  52. package/esm/components/button/button-group-section/button-group-section.mjs.map +1 -1
  53. package/esm/components/button/button-group-section/button-group-section.utils.mjs +26 -0
  54. package/esm/components/button/button-group-section/button-group-section.utils.mjs.map +1 -0
  55. package/esm/components/button/index.mjs +8 -4
  56. package/esm/components/button/index.mjs.map +1 -1
  57. package/esm/components/group/group.mjs +78 -62
  58. package/esm/components/group/group.mjs.map +1 -1
  59. package/esm/components/group/group.utils.mjs +15 -0
  60. package/esm/components/group/group.utils.mjs.map +1 -0
  61. package/esm/components/group/index.mjs +4 -2
  62. package/esm/components/group/index.mjs.map +1 -1
  63. package/esm/components/loader/index.mjs +4 -1
  64. package/esm/components/loader/index.mjs.map +1 -1
  65. package/esm/components/loader/loader.mjs +50 -41
  66. package/esm/components/loader/loader.mjs.map +1 -1
  67. package/esm/components/loader/loader.utils.mjs +13 -0
  68. package/esm/components/loader/loader.utils.mjs.map +1 -0
  69. package/esm/components/simple-grid/index.mjs +3 -2
  70. package/esm/components/simple-grid/index.mjs.map +1 -1
  71. package/esm/components/simple-grid/simple-grid.mjs +47 -22
  72. package/esm/components/simple-grid/simple-grid.mjs.map +1 -1
  73. package/esm/components/stack/index.mjs +11 -0
  74. package/esm/components/stack/index.mjs.map +1 -0
  75. package/esm/components/stack/stack.mjs +406 -0
  76. package/esm/components/stack/stack.mjs.map +1 -0
  77. package/esm/components/stack/stack.module.mjs +7 -0
  78. package/esm/components/stack/stack.module.mjs.map +1 -0
  79. package/esm/components/stack/stack.utils.mjs +13 -0
  80. package/esm/components/stack/stack.utils.mjs.map +1 -0
  81. package/esm/components/text/index.mjs +4 -2
  82. package/esm/components/text/index.mjs.map +1 -1
  83. package/esm/components/text/text.mjs +46 -39
  84. package/esm/components/text/text.mjs.map +1 -1
  85. package/esm/components/text/text.utils.mjs +16 -0
  86. package/esm/components/text/text.utils.mjs.map +1 -0
  87. package/esm/components/unstyled-button/index.mjs +3 -2
  88. package/esm/components/unstyled-button/index.mjs.map +1 -1
  89. package/esm/components/unstyled-button/unstyled-button.mjs +7 -2
  90. package/esm/components/unstyled-button/unstyled-button.mjs.map +1 -1
  91. package/esm/index.mjs +3 -1
  92. package/esm/index.mjs.map +1 -1
  93. package/lib/components/button/button-group/button-group.utils.d.ts +6 -0
  94. package/lib/components/button/button-group-section/button-group-section.utils.d.ts +7 -0
  95. package/lib/components/button/index.d.ts +5 -5
  96. package/lib/components/group/group.utils.d.ts +7 -0
  97. package/lib/components/group/index.d.ts +3 -2
  98. package/lib/components/index.d.ts +1 -0
  99. package/lib/components/loader/index.d.ts +3 -2
  100. package/lib/components/loader/loader.utils.d.ts +9 -0
  101. package/lib/components/simple-grid/index.d.ts +3 -2
  102. package/lib/components/stack/index.d.ts +6 -0
  103. package/lib/components/stack/stack.types.d.ts +29 -0
  104. package/lib/components/stack/stack.utils.d.ts +6 -0
  105. package/lib/components/text/index.d.ts +3 -2
  106. package/lib/components/text/text.utils.d.ts +8 -0
  107. package/lib/components/unstyled-button/index.d.ts +3 -2
  108. package/package.json +1 -1
  109. package/styles/stack.css +7 -0
  110. package/styles/stack.layer.css +8 -0
  111. package/styles.css +8 -0
  112. package/styles.layer.css +8 -0
  113. package/cjs/components/loader/use-loader.cjs +0 -10
  114. package/cjs/components/loader/use-loader.cjs.map +0 -1
  115. package/esm/components/loader/use-loader.mjs +0 -10
  116. package/esm/components/loader/use-loader.mjs.map +0 -1
@@ -1,12 +1,11 @@
1
1
  "use client";
2
- import { getFontSize, getLineHeight } from "../../core/utils/get-size/get-size.mjs";
3
- import { getGradient } from "../../core/config-provider/color-functions/get-gradient/get-gradient.mjs";
4
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";
5
4
  import { CBox } from "../../core/box/index.mjs";
6
- import { createVarsResolver } from "../../core/styles-api/create-vars-resolver/create-vars-resolver.mjs";
7
5
  import { useStyles } from "../../core/styles-api/use-styles/use-styles.mjs";
8
6
  import text_module_default from "./text.module.mjs";
9
- import { computed, createBlock, defineComponent, mergeProps, openBlock, renderSlot, withCtx } from "vue";
7
+ import { varsResolver } from "./text.utils.mjs";
8
+ import { computed, createBlock, defineComponent, mergeProps, openBlock, ref, renderSlot, useAttrs, withCtx } from "vue";
10
9
  //#region packages/@cck-ui/core/src/components/text/text.vue
11
10
  const _sfc_main = /*@__PURE__*/ defineComponent({
12
11
  name: "CText",
@@ -339,8 +338,14 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
339
338
  }
340
339
  },
341
340
  setup(__props, { expose: __expose }) {
342
- __expose();
343
- const props = __props;
341
+ const _root = ref(null);
342
+ const attrs = useAttrs();
343
+ const rawProps = __props;
344
+ const props = useComponentProps({
345
+ component: "CText",
346
+ defaultProps: {},
347
+ props: rawProps
348
+ });
344
349
  function getTextTruncate(truncate) {
345
350
  if (truncate === "start") return "start";
346
351
  if (truncate === "end" || truncate) return "end";
@@ -366,48 +371,52 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
366
371
  "attributes"
367
372
  ];
368
373
  const modList = computed(() => [{
369
- "data-truncate": getTextTruncate(props.truncate),
370
- "data-line-clamp": typeof props.lineClamp === "number",
371
- "data-inline": props.inline,
372
- "data-inherit": props.inherit
373
- }, props.mod]);
374
- const varsResolver = createVarsResolver((theme, { gradient, lineClamp, size, textWrap, variant }) => ({ root: {
375
- "--text-fz": getFontSize(size),
376
- "--text-lh": getLineHeight(size),
377
- "--text-gradient": variant === "gradient" ? getGradient(gradient, theme) : void 0,
378
- "--text-line-clamp": typeof lineClamp === "number" ? lineClamp.toString() : void 0,
379
- "--text-text-wrap": textWrap
380
- } }));
374
+ "data-truncate": getTextTruncate(props.value.truncate),
375
+ "data-line-clamp": typeof props.value.lineClamp === "number",
376
+ "data-inline": props.value.inline,
377
+ "data-inherit": props.value.inherit
378
+ }]);
381
379
  const getStyles = useStyles({
382
- name: ["Text", props.__staticSelector],
383
- props,
380
+ name: ["Text", props.value.__staticSelector],
381
+ props: {
382
+ ...props.value,
383
+ ...attrs
384
+ },
384
385
  classes: text_module_default,
385
- className: props.className,
386
- style: props.style,
387
- classNames: props.classNames,
388
- styles: props.styles,
389
- unstyled: props.unstyled,
390
- attributes: props.attributes,
391
- vars: props.vars,
386
+ className: props.value.className,
387
+ style: props.value.style,
388
+ classNames: props.value.classNames,
389
+ styles: props.value.styles,
390
+ unstyled: props.value.unstyled,
391
+ attributes: props.value.attributes,
392
+ vars: props.value.vars,
392
393
  varsResolver
393
394
  });
394
395
  const rootAttrs = computed(() => getStyles("root", { focusable: true }));
396
+ const mergedAttrs = computed(() => {
397
+ const others = {};
398
+ const propsValue = props.value;
399
+ for (const key in propsValue) if (!knownProps.includes(key)) others[key] = propsValue[key];
400
+ const userMod = props.value.mod;
401
+ const mergedMod = [...Array.isArray(userMod) ? userMod : [userMod].filter(Boolean), ...modList.value || []];
402
+ return {
403
+ ...others,
404
+ mod: mergedMod,
405
+ ...rootAttrs.value
406
+ };
407
+ });
408
+ __expose({ root: computed(() => _root.value?.root ?? null) });
395
409
  const __returned__ = {
410
+ _root,
411
+ attrs,
412
+ rawProps,
396
413
  props,
397
414
  getTextTruncate,
398
415
  knownProps,
399
416
  modList,
400
- varsResolver,
401
417
  getStyles,
402
418
  rootAttrs,
403
- mergedAttrs: computed(() => {
404
- const others = {};
405
- for (const key in props) if (!knownProps.includes(key)) others[key] = props[key];
406
- return {
407
- ...others,
408
- ...rootAttrs.value
409
- };
410
- }),
419
+ mergedAttrs,
411
420
  get CBox() {
412
421
  return CBox;
413
422
  }
@@ -420,8 +429,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
420
429
  }
421
430
  });
422
431
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
423
- return openBlock(), createBlock($setup["CBox"], mergeProps($setup.mergedAttrs, {
424
- mod: $setup.modList,
432
+ return openBlock(), createBlock($setup["CBox"], mergeProps({ ref: "_root" }, $setup.mergedAttrs, {
425
433
  size: $setup.props.size,
426
434
  tag: $setup.props.span ? "span" : "p",
427
435
  variant: $setup.props.variant
@@ -429,7 +437,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
429
437
  default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
430
438
  _: 3
431
439
  }, 16, [
432
- "mod",
433
440
  "size",
434
441
  "tag",
435
442
  "variant"
@@ -1 +1 @@
1
- {"version":3,"file":"text.mjs","names":[],"sources":["../../../src/components/text/text.vue"],"sourcesContent":["<template>\n <c-box\n v-bind=\"mergedAttrs\"\n :mod=\"modList\"\n :size=\"props.size\"\n :tag=\"props.span ? 'span' : 'p'\"\n :variant=\"props.variant\"\n >\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport type { TextFactory, TextProps, TextTruncate } from './text.types.ts'\nimport classes from './text.module.css'\nimport {\n createVarsResolver,\n getFontSize,\n getGradient,\n getLineHeight,\n useStyles,\n CBox,\n} from '../../core'\n\ndefineOptions({\n name: 'CText',\n})\n\nconst props = defineProps<TextProps>()\n\nfunction getTextTruncate(truncate: TextTruncate | undefined) {\n if (truncate === 'start') {\n return 'start'\n }\n\n if (truncate === 'end' || truncate) {\n return 'end'\n }\n\n return undefined\n}\n\nconst knownProps = [\n 'lineClamp',\n 'truncate',\n 'inline',\n 'inherit',\n 'gradient',\n 'span',\n 'textWrap',\n '__staticSelector',\n 'vars',\n 'className',\n 'style',\n 'classNames',\n 'styles',\n 'unstyled',\n 'variant',\n 'mod',\n 'size',\n 'attributes',\n]\n\nconst modList = computed(() => [\n {\n 'data-truncate': getTextTruncate(props.truncate),\n 'data-line-clamp': typeof props.lineClamp === 'number',\n 'data-inline': props.inline,\n 'data-inherit': props.inherit,\n },\n props.mod,\n])\n\nconst varsResolver = createVarsResolver<TextFactory>(\n (theme, { gradient, lineClamp, size, textWrap, variant }) => ({\n root: {\n '--text-fz': getFontSize(size),\n '--text-lh': getLineHeight(size),\n '--text-gradient': variant === 'gradient' ? getGradient(gradient, theme) : undefined,\n '--text-line-clamp': typeof lineClamp === 'number' ? lineClamp.toString() : undefined,\n '--text-text-wrap': textWrap,\n },\n })\n)\n\nconst getStyles = useStyles<TextFactory>({\n name: ['Text', props.__staticSelector],\n props,\n classes,\n className: props.className,\n style: props.style,\n classNames: props.classNames,\n styles: props.styles,\n unstyled: props.unstyled,\n attributes: props.attributes,\n vars: props.vars,\n varsResolver,\n})\n\nconst rootAttrs = computed(() => getStyles('root', { focusable: true }))\n\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n for (const key in props) {\n if (!knownProps.includes(key)) {\n others[key] = props[key as keyof typeof props]\n }\n }\n return { ...others, ...rootAttrs.value }\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAC;;;;;;;;;gBAEnD,eAAe;IACjC,MAAM,SAA8B,CAAC;IACrC,KAAK,MAAM,OAAO,OAChB,IAAI,CAAC,WAAW,SAAS,GAAG,GAC1B,OAAO,OAAO,MAAM;IAGxB,OAAO;KAAE,GAAG;KAAQ,GAAG,UAAU;IAAM;GACzC,CAAA;;;;;;;;;;;;;qBA7GE,YAQQ,OAAA,SARR,WAQQ,OAPE,aAAW;EAClB,KAAK,OAAA;EACL,MAAM,OAAA,MAAM;EACZ,KAAK,OAAA,MAAM,OAAI,SAAA;EACf,SAAS,OAAA,MAAM;;yBAER,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"text.mjs","names":[],"sources":["../../../src/components/text/text.vue"],"sourcesContent":["<template>\n <c-box\n ref=\"_root\"\n v-bind=\"mergedAttrs\"\n :size=\"props.size\"\n :tag=\"props.span ? 'span' : 'p'\"\n :variant=\"props.variant\"\n >\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport type { TextFactory, TextProps, TextTruncate } from './text.types.ts'\nimport classes from './text.module.css'\nimport { useStyles, CBox, useComponentProps } from '../../core'\nimport { varsResolver } from './text.utils.js'\n\ndefineOptions({\n name: 'CText',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<TextProps>()\n\nconst props = useComponentProps({\n component: 'CText',\n defaultProps: {},\n props: rawProps,\n})\n\nfunction getTextTruncate(truncate: TextTruncate | undefined) {\n if (truncate === 'start') {\n return 'start'\n }\n\n if (truncate === 'end' || truncate) {\n return 'end'\n }\n\n return undefined\n}\n\nconst knownProps = [\n 'lineClamp',\n 'truncate',\n 'inline',\n 'inherit',\n 'gradient',\n 'span',\n 'textWrap',\n '__staticSelector',\n 'vars',\n 'className',\n 'style',\n 'classNames',\n 'styles',\n 'unstyled',\n 'variant',\n 'mod',\n 'size',\n 'attributes',\n]\n\nconst modList = computed(() => [\n {\n 'data-truncate': getTextTruncate(props.value.truncate),\n 'data-line-clamp': typeof props.value.lineClamp === 'number',\n 'data-inline': props.value.inline,\n 'data-inherit': props.value.inherit,\n },\n])\n\nconst getStyles = useStyles<TextFactory>({\n name: ['Text', props.value.__staticSelector],\n props: { ...props.value, ...attrs } as TextProps,\n classes,\n className: props.value.className,\n style: props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n})\n\nconst rootAttrs = computed(() => getStyles('root', { focusable: true }))\n\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n const userMod = props.value.mod\n const mergedMod = [\n ...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)),\n ...(modList.value || []),\n ]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBA,MAAM,QAAQ,IAAsC,IAAI;EAExD,MAAM,QAAQ,SAAS;EAEvB,MAAM,WAAW;EAEjB,MAAM,QAAQ,kBAAkB;GAC9B,WAAW;GACX,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e,MAAM,OAAO,QAAQ,IAAI,EAChD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;qBA9GC,YAQQ,OAAA,SARR,WAQQ,EAPN,KAAI,QAAO,GACH,OAAA,aAAW;EAClB,MAAM,OAAA,MAAM;EACZ,KAAK,OAAA,MAAM,OAAI,SAAA;EACf,SAAS,OAAA,MAAM;;yBAER,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ import { getFontSize, getLineHeight } from "../../core/utils/get-size/get-size.mjs";
3
+ import { getGradient } from "../../core/config-provider/color-functions/get-gradient/get-gradient.mjs";
4
+ import { createVarsResolver } from "../../core/styles-api/create-vars-resolver/create-vars-resolver.mjs";
5
+ //#region packages/@cck-ui/core/src/components/text/text.utils.ts
6
+ const varsResolver = createVarsResolver((theme, { gradient, lineClamp, size, textWrap, variant }) => ({ root: {
7
+ "--text-fz": getFontSize(size),
8
+ "--text-lh": getLineHeight(size),
9
+ "--text-gradient": variant === "gradient" ? getGradient(gradient, theme) : void 0,
10
+ "--text-line-clamp": typeof lineClamp === "number" ? lineClamp.toString() : void 0,
11
+ "--text-text-wrap": textWrap
12
+ } }));
13
+ //#endregion
14
+ export { varsResolver };
15
+
16
+ //# sourceMappingURL=text.utils.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.utils.mjs","names":[],"sources":["../../../src/components/text/text.utils.ts"],"sourcesContent":["import { createVarsResolver, getFontSize, getGradient, getLineHeight } from '../../core'\nimport { TextFactory } from './text.types'\n\nexport const varsResolver = createVarsResolver<TextFactory>(\n (theme, { gradient, lineClamp, size, textWrap, variant }) => ({\n root: {\n '--text-fz': getFontSize(size),\n '--text-lh': getLineHeight(size),\n '--text-gradient': variant === 'gradient' ? getGradient(gradient, theme) : undefined,\n '--text-line-clamp': typeof lineClamp === 'number' ? lineClamp.toString() : undefined,\n '--text-text-wrap': textWrap,\n },\n })\n)\n"],"mappings":";;;;;AAGA,MAAa,eAAe,oBACzB,OAAO,EAAE,UAAU,WAAW,MAAM,UAAU,eAAe,EAC5D,MAAM;CACJ,aAAa,YAAY,IAAI;CAC7B,aAAa,cAAc,IAAI;CAC/B,mBAAmB,YAAY,aAAa,YAAY,UAAU,KAAK,IAAI,KAAA;CAC3E,qBAAqB,OAAO,cAAc,WAAW,UAAU,SAAS,IAAI,KAAA;CAC5E,oBAAoB;AACtB,EACF,EACF"}
@@ -1,8 +1,9 @@
1
1
  "use client";
2
2
  import { withInstall } from "../../core/utils/vue/install.mjs";
3
+ import { withClasses, withExtend, withPropsFactory } from "../../core/utils/vue/statics.mjs";
4
+ import unstyled_button_module_default from "./unstyled-button.module.mjs";
3
5
  import unstyled_button_default from "./unstyled-button.mjs";
4
- //#region packages/@cck-ui/core/src/components/unstyled-button/index.ts
5
- const UnstyledButton = withInstall(unstyled_button_default);
6
+ const UnstyledButton = withInstall(withPropsFactory(withExtend(withClasses(unstyled_button_default, unstyled_button_module_default))));
6
7
  //#endregion
7
8
  export { UnstyledButton, UnstyledButton as default };
8
9
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["_UnstyledButton"],"sources":["../../../src/components/unstyled-button/index.ts"],"sourcesContent":["import { SFCWithInstall, withInstall } from '../../core'\nimport _UnstyledButton from './unstyled-button.vue'\n\nexport const UnstyledButton: SFCWithInstall<typeof _UnstyledButton> = withInstall(_UnstyledButton)\nexport default UnstyledButton\n\nexport * from './unstyled-button.types'\n"],"mappings":";;;;AAGA,MAAa,iBAAyD,YAAYA,uBAAe"}
1
+ {"version":3,"file":"index.mjs","names":["_UnstyledButton","classes"],"sources":["../../../src/components/unstyled-button/index.ts"],"sourcesContent":["import {\n SFCWithInstallAndClasses,\n withClasses,\n withExtend,\n withInstall,\n withPropsFactory,\n} from '../../core'\nimport _UnstyledButton from './unstyled-button.vue'\nimport classes from './unstyled-button.module.css'\n\nconst UnstyledButtonWithStatic = withPropsFactory(withExtend(withClasses(_UnstyledButton, classes)))\n\nexport const UnstyledButton: SFCWithInstallAndClasses<typeof _UnstyledButton, typeof classes> =\n withInstall(UnstyledButtonWithStatic)\nexport default UnstyledButton\n\nexport * from './unstyled-button.types'\n"],"mappings":";;;;;AAYA,MAAa,iBACX,YAH+B,iBAAiB,WAAW,YAAYA,yBAAiBC,8BAAO,CAAC,CAGpF,CAAwB"}
@@ -4,7 +4,7 @@ import { useComponentProps } from "../../core/config-provider/use-component-prop
4
4
  import { CBox } from "../../core/box/index.mjs";
5
5
  import { useStyles } from "../../core/styles-api/use-styles/use-styles.mjs";
6
6
  import unstyled_button_module_default from "./unstyled-button.module.mjs";
7
- import { computed, createBlock, defineComponent, mergeProps, openBlock, ref, renderSlot, withCtx } from "vue";
7
+ import { computed, createBlock, defineComponent, mergeProps, openBlock, ref, renderSlot, useAttrs, withCtx } from "vue";
8
8
  //#region packages/@cck-ui/core/src/components/unstyled-button/unstyled-button.vue
9
9
  const _sfc_main = /*@__PURE__*/ defineComponent({
10
10
  name: "UnstyledButton",
@@ -313,6 +313,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
313
313
  }
314
314
  },
315
315
  setup(__props, { expose: __expose }) {
316
+ const attrs = useAttrs();
316
317
  const rawProps = __props;
317
318
  const props = useComponentProps({
318
319
  component: "UnstyledButton",
@@ -333,7 +334,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
333
334
  ];
334
335
  const getStyles = useStyles({
335
336
  name: props.value.__staticSelector,
336
- props: props.value,
337
+ props: {
338
+ ...props.value,
339
+ ...attrs
340
+ },
337
341
  classes: unstyled_button_module_default,
338
342
  className: props.value.className,
339
343
  style: props.value.style,
@@ -354,6 +358,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
354
358
  });
355
359
  __expose({ root: computed(() => _root.value?.root ?? null) });
356
360
  const __returned__ = {
361
+ attrs,
357
362
  rawProps,
358
363
  props,
359
364
  tag,
@@ -1 +1 @@
1
- {"version":3,"file":"unstyled-button.mjs","names":[],"sources":["../../../src/components/unstyled-button/unstyled-button.vue"],"sourcesContent":["<template>\n <c-box\n ref=\"_root\"\n v-bind=\"mergedAttrs\"\n :tag=\"tag\"\n :type=\"tag === 'button' ? 'button' : undefined\"\n >\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from 'vue'\nimport { CBox, useComponentProps, useStyles } from '../../core'\nimport type { UnstyledButtonFactory, UnstyledButtonProps } from './unstyled-button.types'\nimport classes from './unstyled-button.module.css'\n\ndefineOptions({\n name: 'UnstyledButton',\n})\n\n// const props = withDefaults(defineProps<UnstyledButtonProps>(), {\n// __staticSelector: 'UnstyledButton',\n// })\n\nconst rawProps = defineProps<UnstyledButtonProps>()\n\nconst props = useComponentProps({\n component: 'UnstyledButton',\n defaultProps: {\n __staticSelector: 'UnstyledButton',\n },\n props: rawProps,\n})\n\nconst { tag = 'button' } = props.value\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst knownProps = [\n 'className',\n 'tag',\n '__staticSelector',\n 'unstyled',\n 'classNames',\n 'styles',\n 'style',\n 'attributes',\n]\n\nconst getStyles = useStyles<UnstyledButtonFactory>({\n name: props.value.__staticSelector!,\n props: props.value,\n classes,\n className: props.value.className,\n style: props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n})\n\nconst rootAttrs = computed(() => getStyles('root', { focusable: true }))\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n return { ...others, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"unstyled-button.mjs","names":[],"sources":["../../../src/components/unstyled-button/unstyled-button.vue"],"sourcesContent":["<template>\n <c-box\n ref=\"_root\"\n v-bind=\"mergedAttrs\"\n :tag=\"tag\"\n :type=\"tag === 'button' ? 'button' : undefined\"\n >\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { CBox, useComponentProps, useStyles } from '../../core'\nimport type { UnstyledButtonFactory, UnstyledButtonProps } from './unstyled-button.types'\nimport classes from './unstyled-button.module.css'\n\ndefineOptions({\n name: 'UnstyledButton',\n})\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<UnstyledButtonProps>()\n\nconst props = useComponentProps({\n component: 'UnstyledButton',\n defaultProps: {\n __staticSelector: 'UnstyledButton',\n },\n props: rawProps,\n})\n\nconst { tag = 'button' } = props.value\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst knownProps = [\n 'className',\n 'tag',\n '__staticSelector',\n 'unstyled',\n 'classNames',\n 'styles',\n 'style',\n 'attributes',\n]\n\nconst getStyles = useStyles<UnstyledButtonFactory>({\n name: props.value.__staticSelector!,\n props: { ...props.value, ...attrs } as UnstyledButtonProps,\n classes,\n className: props.value.className,\n style: props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n})\n\nconst rootAttrs = computed(() => getStyles('root', { focusable: true }))\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n return { ...others, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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Q,OAAA,SAPR,WAOQ,EANN,KAAI,QAAO,GACH,OAAA,aAAW;EAClB,KAAK,OAAA;EACL,MAAM,OAAA,QAAG,WAAA,WAA2B,KAAA;;yBAE7B,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
package/esm/index.mjs CHANGED
@@ -59,6 +59,7 @@ import { CButton, CButtonGroup, CButtonGroupSection } from "./components/button/
59
59
  import { CCol, CGrid } from "./components/grid/index.mjs";
60
60
  import { CGroup } from "./components/group/index.mjs";
61
61
  import { CSimpleGrid } from "./components/simple-grid/index.mjs";
62
+ import { CStack } from "./components/stack/index.mjs";
62
63
  import { CText } from "./components/text/index.mjs";
63
64
  //#region packages/@cck-ui/core/src/index.ts
64
65
  const INSTALLED_KEY = Symbol("INSTALLED_KEY");
@@ -73,6 +74,7 @@ const components = [
73
74
  CGroup,
74
75
  CLoader,
75
76
  CSimpleGrid,
77
+ CStack,
76
78
  CText,
77
79
  CTransition,
78
80
  UnstyledButton
@@ -85,6 +87,6 @@ const CckUI = { install(app) {
85
87
  });
86
88
  } };
87
89
  //#endregion
88
- export { CBox, CButton, CButtonGroup, CButtonGroupSection, transitions as CCK_TRANSITIONS, CCol, CDefaultLoaders, CGrid, CGroup, CLoader, CONFIG_KEY, CSimpleGrid, CText, CTransition, CckConfigProvider, CckUI, CckUI as default, DEFAULT_THEME, FOCUS_CLASS_NAMES, STYLE_PROPS_DATA, THEME_KEY, UnstyledButton, alpha, camelToKebabCase, colorsTuple, createTheme, createVarsResolver, darken, deepMerge, defaultCssVariablesResolver, defaultVariantColorsResolver, em, extractStyleProps, filterProps, getBaseValue, getBreakpointValue, getCSSColorVariables, getComponentName, getFontSize, getGradient, getLineHeight, getPrimaryShade, getRadius, getShadow, getSize, getSortedBreakpoints, getSpacing, getThemeColor, getTransitionProps, hashStyleProps, isLightColor, isNumber, isNumberLike, isString, isStringNumber, isUndefined, isVirtualColor, keys, luminance, mergeThemeOverrides, normalizeNumberLikeStringProp, numberLikeStringToNumber, parseStyleProps, parseThemeColor, px, rem, resolveClassNames, resolveStyles, responsiveStyleManager, rgb, rgba, stylesToString, toRgba, useCckClassNamesPrefix, useCckColorScheme, useCckCssVariablesResolver, useCckEnv, useCckIsHeadless, useCckStyleNonce, useCckStylesTransform, useCckSxTransform, useCckTheme, useCckWithStaticClasses, useComponentProps, useConfigContext, useProviderColorScheme, useRandomClassName, useStyles, virtualColor, withClasses, withExtend, withInstall, withPropsDefaultSetter, withPropsFactory, withVarsResolver };
90
+ export { CBox, CButton, CButtonGroup, CButtonGroupSection, transitions as CCK_TRANSITIONS, CCol, CDefaultLoaders, CGrid, CGroup, CLoader, CONFIG_KEY, CSimpleGrid, CStack, CText, CTransition, CckConfigProvider, CckUI, CckUI as default, DEFAULT_THEME, FOCUS_CLASS_NAMES, STYLE_PROPS_DATA, THEME_KEY, UnstyledButton, alpha, camelToKebabCase, colorsTuple, createTheme, createVarsResolver, darken, deepMerge, defaultCssVariablesResolver, defaultVariantColorsResolver, em, extractStyleProps, filterProps, getBaseValue, getBreakpointValue, getCSSColorVariables, getComponentName, getFontSize, getGradient, getLineHeight, getPrimaryShade, getRadius, getShadow, getSize, getSortedBreakpoints, getSpacing, getThemeColor, getTransitionProps, hashStyleProps, isLightColor, isNumber, isNumberLike, isString, isStringNumber, isUndefined, isVirtualColor, keys, luminance, mergeThemeOverrides, normalizeNumberLikeStringProp, numberLikeStringToNumber, parseStyleProps, parseThemeColor, px, rem, resolveClassNames, resolveStyles, responsiveStyleManager, rgb, rgba, stylesToString, toRgba, useCckClassNamesPrefix, useCckColorScheme, useCckCssVariablesResolver, useCckEnv, useCckIsHeadless, useCckStyleNonce, useCckStylesTransform, useCckSxTransform, useCckTheme, useCckWithStaticClasses, useComponentProps, useConfigContext, useProviderColorScheme, useRandomClassName, useStyles, virtualColor, withClasses, withExtend, withInstall, withPropsDefaultSetter, withPropsFactory, withVarsResolver };
89
91
 
90
92
  //# sourceMappingURL=index.mjs.map
package/esm/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { App, Plugin } from 'vue'\nimport {\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCol,\n CGrid,\n CGroup,\n CLoader,\n CSimpleGrid,\n CText,\n CTransition,\n UnstyledButton,\n} from './components'\nimport { CckConfigProvider, CBox } from './core'\n\nconst INSTALLED_KEY = Symbol('INSTALLED_KEY')\n\nconst components = [\n CckConfigProvider,\n CBox,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CGrid,\n CCol,\n CGroup,\n CLoader,\n CSimpleGrid,\n CText,\n CTransition,\n UnstyledButton,\n]\n\nconst CckUI: Plugin = {\n install(app: App) {\n if ((app as any)[INSTALLED_KEY]) {\n return\n }\n ;(app as any)[INSTALLED_KEY] = true\n components.forEach((c) => {\n if (c.name) {\n app.component(c.name, c)\n }\n })\n },\n}\n\nexport default CckUI\nexport { CckUI }\n\nexport * from './components'\nexport * from './core'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAM,gBAAgB,OAAO,eAAe;AAE5C,MAAM,aAAa;CACjB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,QAAgB,EACpB,QAAQ,KAAU;CAChB,IAAK,IAAY,gBACf;CAED,IAAa,iBAAiB;CAC/B,WAAW,SAAS,MAAM;EACxB,IAAI,EAAE,MACJ,IAAI,UAAU,EAAE,MAAM,CAAC;CAE3B,CAAC;AACH,EACF"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { App, Plugin } from 'vue'\nimport {\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCol,\n CGrid,\n CGroup,\n CLoader,\n CSimpleGrid,\n CStack,\n CText,\n CTransition,\n UnstyledButton,\n} from './components'\nimport { CckConfigProvider, CBox } from './core'\n\nconst INSTALLED_KEY = Symbol('INSTALLED_KEY')\n\nconst components = [\n CckConfigProvider,\n CBox,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CGrid,\n CCol,\n CGroup,\n CLoader,\n CSimpleGrid,\n CStack,\n CText,\n CTransition,\n UnstyledButton,\n]\n\nconst CckUI: Plugin = {\n install(app: App) {\n if ((app as any)[INSTALLED_KEY]) {\n return\n }\n ;(app as any)[INSTALLED_KEY] = true\n components.forEach((c) => {\n if (c.name) {\n app.component(c.name, c)\n }\n })\n },\n}\n\nexport default CckUI\nexport { CckUI }\n\nexport * from './components'\nexport * from './core'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAM,gBAAgB,OAAO,eAAe;AAE5C,MAAM,aAAa;CACjB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,QAAgB,EACpB,QAAQ,KAAU;CAChB,IAAK,IAAY,gBACf;CAED,IAAa,iBAAiB;CAC/B,WAAW,SAAS,MAAM;EACxB,IAAI,EAAE,MACJ,IAAI,UAAU,EAAE,MAAM,CAAC;CAE3B,CAAC;AACH,EACF"}
@@ -0,0 +1,6 @@
1
+ export declare const varsResolver: import("../../..").VarsResolver<{
2
+ props: import("./button-group.types").ButtonGroupProps;
3
+ ref: HTMLDivElement;
4
+ stylesNames: import("./button-group.types").ButtonGroupStylesNames;
5
+ vars: import("./button-group.types").ButtonGroupCssVariables;
6
+ }>;
@@ -0,0 +1,7 @@
1
+ export declare const varsResolver: import("../../..").VarsResolver<{
2
+ props: import("./button-group-section.types").ButtonGroupSectionProps;
3
+ ref: HTMLDivElement;
4
+ stylesNames: import("./button-group-section.types").ButtonGroupSectionStylesNames;
5
+ vars: import("./button-group-section.types").ButtonGroupSectionCssVariables;
6
+ variant: import("..").ButtonVariant;
7
+ }>;
@@ -1,13 +1,13 @@
1
- import { type SFCWithInstall, type SFCWithInstallAndClasses } from '../../core';
1
+ import { type SFCWithInstallAndClasses } from '../../core';
2
2
  import ButtonGroup from './button-group/button-group.vue';
3
3
  import ButtonGroupSection from './button-group-section/button-group-section.vue';
4
4
  import Button from './button.vue';
5
5
  import classes from './button.module.css';
6
- export declare const CButtonGroup: SFCWithInstall<typeof ButtonGroup>;
7
- export declare const CButtonGroupSection: SFCWithInstall<typeof ButtonGroupSection>;
6
+ export declare const CButtonGroup: SFCWithInstallAndClasses<typeof ButtonGroup, typeof classes>;
7
+ export declare const CButtonGroupSection: SFCWithInstallAndClasses<typeof ButtonGroupSection, typeof classes>;
8
8
  export declare const CButton: SFCWithInstallAndClasses<typeof Button, typeof classes> & {
9
- ButtonGroup: typeof ButtonGroup;
10
- ButtonGroupSection: typeof ButtonGroupSection;
9
+ CButtonGroup: typeof CButtonGroup;
10
+ CButtonGroupSection: typeof CButtonGroupSection;
11
11
  };
12
12
  export default CButton;
13
13
  export * from './button-group-section/button-group-section.types';
@@ -0,0 +1,7 @@
1
+ export declare const varsResolver: import("../..").VarsResolver<{
2
+ props: import("./group.types").GroupProps;
3
+ ref: HTMLDivElement;
4
+ stylesNames: import("./group.types").GroupStylesNames;
5
+ vars: import("./group.types").GroupCssVariables;
6
+ ctx: import("./group.types").GroupStylesCtx;
7
+ }>;
@@ -1,5 +1,6 @@
1
- import { SFCWithInstall } from '../../core';
1
+ import { SFCWithInstallAndClasses } from '../../core';
2
2
  import Group from './group.vue';
3
- export declare const CGroup: SFCWithInstall<typeof Group>;
3
+ import classes from './group.module.css';
4
+ export declare const CGroup: SFCWithInstallAndClasses<typeof Group, typeof classes>;
4
5
  export default CGroup;
5
6
  export * from './group.types';
@@ -3,6 +3,7 @@ export * from './grid';
3
3
  export * from './group';
4
4
  export * from './loader';
5
5
  export * from './simple-grid';
6
+ export * from './stack';
6
7
  export * from './transition';
7
8
  export * from './text';
8
9
  export * from './unstyled-button';
@@ -1,7 +1,8 @@
1
- import { SFCWithInstall } from '../../core';
1
+ import { SFCWithInstallAndClasses } from '../../core';
2
2
  import Loader from './loader.vue';
3
3
  import { CLoadersRecord } from './loader.types.js';
4
+ import classes from './loader.module.css';
4
5
  export declare const CDefaultLoaders: CLoadersRecord;
5
- export declare const CLoader: SFCWithInstall<typeof Loader>;
6
+ export declare const CLoader: SFCWithInstallAndClasses<typeof Loader, typeof classes>;
6
7
  export default CLoader;
7
8
  export * from './loader.types';
@@ -0,0 +1,9 @@
1
+ export declare const varsResolver: import("../..").VarsResolver<{
2
+ props: import("./loader.types").LoaderProps;
3
+ ref: SVGSVGElement;
4
+ stylesNames: import("./loader.types").LoaderStylesNames;
5
+ vars: import("./loader.types").LoaderCssVariables;
6
+ staticComponents: {
7
+ defaultLoaders: typeof import(".").CDefaultLoaders;
8
+ };
9
+ }>;
@@ -1,5 +1,6 @@
1
- import { SFCWithInstall } from '../../core';
1
+ import { SFCWithInstallAndClasses } from '../../core';
2
2
  import SimpleGrid from './simple-grid.vue';
3
- export declare const CSimpleGrid: SFCWithInstall<typeof SimpleGrid>;
3
+ import classes from './simple-grid.module.css';
4
+ export declare const CSimpleGrid: SFCWithInstallAndClasses<typeof SimpleGrid, typeof classes>;
4
5
  export default CSimpleGrid;
5
6
  export * from './simple-grid.types';
@@ -0,0 +1,6 @@
1
+ import Stack from './stack.vue';
2
+ import classes from './stack.module.css';
3
+ import { SFCWithInstallAndClasses } from '../../core';
4
+ export declare const CStack: SFCWithInstallAndClasses<typeof Stack, typeof classes>;
5
+ export default CStack;
6
+ export * from './stack.types';
@@ -0,0 +1,29 @@
1
+ import { Properties } from 'csstype';
2
+ import { BoxProps, CSpacing, ElementProps, Factory, StylesApiProps } from '../../core';
3
+ export type StackStylesNames = 'root';
4
+ export type StackCssVariables = {
5
+ root: '--stack-gap' | '--stack-align' | '--stack-justify';
6
+ };
7
+ export interface StackProps extends BoxProps, StylesApiProps<StackFactory>, /* @vue-ignore */ ElementProps<'div'> {
8
+ /**
9
+ * @description Key of `theme.spacing` or any valid CSS value to set `gap` property, numbers are converted to rem
10
+ * @default 'md'
11
+ */
12
+ gap?: CSpacing;
13
+ /**
14
+ * @description Controls `align-items` CSS property
15
+ * @default 'stretch'
16
+ */
17
+ align?: Properties['alignItems'];
18
+ /**
19
+ * @description Controls `justify-content` CSS property
20
+ * @default 'flex-start'
21
+ */
22
+ justify?: Properties['justifyContent'];
23
+ }
24
+ export type StackFactory = Factory<{
25
+ props: StackProps;
26
+ ref: HTMLDivElement;
27
+ stylesNames: StackStylesNames;
28
+ vars: StackCssVariables;
29
+ }>;
@@ -0,0 +1,6 @@
1
+ export declare const varsResolver: import("../..").VarsResolver<{
2
+ props: import("./stack.types").StackProps;
3
+ ref: HTMLDivElement;
4
+ stylesNames: import("./stack.types").StackStylesNames;
5
+ vars: import("./stack.types").StackCssVariables;
6
+ }>;
@@ -1,5 +1,6 @@
1
- import { SFCWithInstall } from '../../core';
1
+ import { SFCWithInstallAndClasses } from '../../core';
2
2
  import Text from './text.vue';
3
- export declare const CText: SFCWithInstall<typeof Text>;
3
+ import classes from './text.module.css';
4
+ export declare const CText: SFCWithInstallAndClasses<typeof Text, typeof classes>;
4
5
  export default CText;
5
6
  export * from './text.types';
@@ -0,0 +1,8 @@
1
+ export declare const varsResolver: import("../..").VarsResolver<{
2
+ props: import("./text.types").TextProps;
3
+ defaultComponent: "p";
4
+ defaultRef: HTMLParagraphElement;
5
+ stylesNames: import("./text.types").TextStylesNames;
6
+ vars: import("./text.types").TextCssVariables;
7
+ variant: import("./text.types").TextVariant;
8
+ }>;
@@ -1,5 +1,6 @@
1
- import { SFCWithInstall } from '../../core';
1
+ import { SFCWithInstallAndClasses } from '../../core';
2
2
  import _UnstyledButton from './unstyled-button.vue';
3
- export declare const UnstyledButton: SFCWithInstall<typeof _UnstyledButton>;
3
+ import classes from './unstyled-button.module.css';
4
+ export declare const UnstyledButton: SFCWithInstallAndClasses<typeof _UnstyledButton, typeof classes>;
4
5
  export default UnstyledButton;
5
6
  export * from './unstyled-button.types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cck-ui/core",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "description": "Vue component library focused on usability, accessibility and developer experience",
5
5
  "homepage": "https://cck-ui.jackatlas.xyz",
6
6
  "license": "ISC",
@@ -0,0 +1,7 @@
1
+ .m_f6a13507 {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: var(--stack-align, stretch);
5
+ justify-content: var(--stack-justify, flex-start);
6
+ gap: var(--stack-gap, var(--c-spacing-md));
7
+ }
@@ -0,0 +1,8 @@
1
+ @layer cck {.m_f6a13507 {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: var(--stack-align, stretch);
5
+ justify-content: var(--stack-justify, flex-start);
6
+ gap: var(--stack-gap, var(--c-spacing-md));
7
+ }
8
+ }
package/styles.css CHANGED
@@ -1068,6 +1068,14 @@ fieldset:disabled .c-active:active {
1068
1068
  grid-template-columns: repeat(auto-fit, minmax(var(--sg-min-col-width), 1fr));
1069
1069
  }
1070
1070
 
1071
+ .m_f6a13507 {
1072
+ display: flex;
1073
+ flex-direction: column;
1074
+ align-items: var(--stack-align, stretch);
1075
+ justify-content: var(--stack-justify, flex-start);
1076
+ gap: var(--stack-gap, var(--c-spacing-md));
1077
+ }
1078
+
1071
1079
  .m_3f669182 {
1072
1080
  -webkit-tap-highlight-color: transparent;
1073
1081
  text-decoration: none;
package/styles.layer.css CHANGED
@@ -1068,6 +1068,14 @@ fieldset:disabled .c-active:active {
1068
1068
  grid-template-columns: repeat(auto-fit, minmax(var(--sg-min-col-width), 1fr));
1069
1069
  }
1070
1070
 
1071
+ .m_f6a13507 {
1072
+ display: flex;
1073
+ flex-direction: column;
1074
+ align-items: var(--stack-align, stretch);
1075
+ justify-content: var(--stack-justify, flex-start);
1076
+ gap: var(--stack-gap, var(--c-spacing-md));
1077
+ }
1078
+
1071
1079
  .m_3f669182 {
1072
1080
  -webkit-tap-highlight-color: transparent;
1073
1081
  text-decoration: none;
@@ -1,10 +0,0 @@
1
- "use client";
2
- let vue = require("vue");
3
- //#region packages/@cck-ui/core/src/components/loader/use-loader.ts
4
- const useLoader = () => {
5
- return { _ref: (0, vue.ref)() };
6
- };
7
- //#endregion
8
- exports.useLoader = useLoader;
9
-
10
- //# sourceMappingURL=use-loader.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-loader.cjs","names":[],"sources":["../../../src/components/loader/use-loader.ts"],"sourcesContent":["import { ref } from 'vue'\n\nexport const useLoader = () => {\n const _ref = ref<HTMLElement | SVGElement>()\n\n return { _ref }\n}\n"],"mappings":";;;AAEA,MAAa,kBAAkB;CAG7B,OAAO,EAAE,OAAA,GAAA,IAAA,IAAA,CAAG,EAAE;AAChB"}
@@ -1,10 +0,0 @@
1
- "use client";
2
- import { ref } from "vue";
3
- //#region packages/@cck-ui/core/src/components/loader/use-loader.ts
4
- const useLoader = () => {
5
- return { _ref: ref() };
6
- };
7
- //#endregion
8
- export { useLoader };
9
-
10
- //# sourceMappingURL=use-loader.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-loader.mjs","names":[],"sources":["../../../src/components/loader/use-loader.ts"],"sourcesContent":["import { ref } from 'vue'\n\nexport const useLoader = () => {\n const _ref = ref<HTMLElement | SVGElement>()\n\n return { _ref }\n}\n"],"mappings":";;;AAEA,MAAa,kBAAkB;CAG7B,OAAO,EAAE,MAFI,IAED,EAAE;AAChB"}