@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.
Files changed (273) 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/button.cjs +71 -63
  10. package/cjs/components/button/button.cjs.map +1 -1
  11. package/cjs/components/button/button.utils.cjs +28 -0
  12. package/cjs/components/button/button.utils.cjs.map +1 -0
  13. package/cjs/components/button/index.cjs +13 -5
  14. package/cjs/components/button/index.cjs.map +1 -1
  15. package/cjs/components/grid/col/col.cjs +33 -16
  16. package/cjs/components/grid/col/col.cjs.map +1 -1
  17. package/cjs/components/grid/grid.cjs +63 -34
  18. package/cjs/components/grid/grid.cjs.map +1 -1
  19. package/cjs/components/grid/grid.constants.cjs.map +1 -1
  20. package/cjs/components/grid/grid.utils.cjs +11 -0
  21. package/cjs/components/grid/grid.utils.cjs.map +1 -0
  22. package/cjs/components/grid/index.cjs +7 -2
  23. package/cjs/components/grid/index.cjs.map +1 -1
  24. package/cjs/components/group/group.cjs +78 -62
  25. package/cjs/components/group/group.cjs.map +1 -1
  26. package/cjs/components/group/group.utils.cjs +14 -0
  27. package/cjs/components/group/group.utils.cjs.map +1 -0
  28. package/cjs/components/group/index.cjs +5 -1
  29. package/cjs/components/group/index.cjs.map +1 -1
  30. package/cjs/components/loader/index.cjs +5 -1
  31. package/cjs/components/loader/index.cjs.map +1 -1
  32. package/cjs/components/loader/loader.cjs +50 -41
  33. package/cjs/components/loader/loader.cjs.map +1 -1
  34. package/cjs/components/loader/loader.module.cjs.map +1 -1
  35. package/cjs/components/loader/loader.utils.cjs +12 -0
  36. package/cjs/components/loader/loader.utils.cjs.map +1 -0
  37. package/cjs/components/loader/loaders/bars.cjs +6 -3
  38. package/cjs/components/loader/loaders/bars.cjs.map +1 -1
  39. package/cjs/components/loader/loaders/dots.cjs +6 -3
  40. package/cjs/components/loader/loaders/dots.cjs.map +1 -1
  41. package/cjs/components/loader/loaders/oval.cjs +6 -3
  42. package/cjs/components/loader/loaders/oval.cjs.map +1 -1
  43. package/cjs/components/simple-grid/index.cjs +4 -1
  44. package/cjs/components/simple-grid/index.cjs.map +1 -1
  45. package/cjs/components/simple-grid/simple-grid.cjs +46 -21
  46. package/cjs/components/simple-grid/simple-grid.cjs.map +1 -1
  47. package/cjs/components/text/index.cjs +5 -1
  48. package/cjs/components/text/index.cjs.map +1 -1
  49. package/cjs/components/text/text.cjs +46 -39
  50. package/cjs/components/text/text.cjs.map +1 -1
  51. package/cjs/components/text/text.utils.cjs +15 -0
  52. package/cjs/components/text/text.utils.cjs.map +1 -0
  53. package/cjs/components/unstyled-button/index.cjs +4 -1
  54. package/cjs/components/unstyled-button/index.cjs.map +1 -1
  55. package/cjs/components/unstyled-button/unstyled-button.cjs +37 -22
  56. package/cjs/components/unstyled-button/unstyled-button.cjs.map +1 -1
  57. package/cjs/core/box/box.cjs +39 -27
  58. package/cjs/core/box/box.cjs.map +1 -1
  59. package/cjs/core/box/get-box-style/get-box-style.cjs.map +1 -1
  60. package/cjs/core/box/style-props/extract-style-props/extract-style-props.cjs.map +1 -1
  61. package/cjs/core/box/style-props/parse-style-props/sort-media-queries.cjs.map +1 -1
  62. package/cjs/core/box/style-props/resolvers/border-resolver/border-resolver.cjs.map +1 -1
  63. package/cjs/core/box/style-props/resolvers/color-resolver/color-resolver.cjs.map +1 -1
  64. package/cjs/core/box/style-props/resolvers/font-family-resolver/font-family-resolver.cjs.map +1 -1
  65. package/cjs/core/box/style-props/resolvers/index.cjs.map +1 -1
  66. package/cjs/core/box/style-props/style-props-data.cjs.map +1 -1
  67. package/cjs/core/config-provider/color-functions/get-gradient/get-gradient.cjs +3 -3
  68. package/cjs/core/config-provider/color-functions/get-gradient/get-gradient.cjs.map +1 -1
  69. package/cjs/core/config-provider/color-functions/rgba/rgba.cjs +8 -0
  70. package/cjs/core/config-provider/color-functions/rgba/rgba.cjs.map +1 -1
  71. package/cjs/core/config-provider/color-functions/to-rgba/to-rgba.cjs.map +1 -1
  72. package/cjs/core/config-provider/config-provider.cjs +33 -22
  73. package/cjs/core/config-provider/config-provider.cjs.map +1 -1
  74. package/cjs/core/config-provider/default-colors.cjs.map +1 -1
  75. package/cjs/core/config-provider/index.cjs +5 -0
  76. package/cjs/core/config-provider/index.cjs.map +1 -1
  77. package/cjs/core/config-provider/merge-cck-theme/merge-cck-theme.cjs +2 -2
  78. package/cjs/core/config-provider/merge-cck-theme/merge-cck-theme.cjs.map +1 -1
  79. package/cjs/core/config-provider/merge-theme-overrides/merge-theme-overrides.cjs +10 -0
  80. package/cjs/core/config-provider/merge-theme-overrides/merge-theme-overrides.cjs.map +1 -0
  81. package/cjs/core/config-provider/use-component-props/use-component-props.cjs +35 -0
  82. package/cjs/core/config-provider/use-component-props/use-component-props.cjs.map +1 -0
  83. package/cjs/core/responsive-style-manager/css-object-to-string/css-object-to-string.cjs.map +1 -1
  84. package/cjs/core/responsive-style-manager/normalize-number-like-string-prop/normalize-number-like-string-prop.cjs +1 -1
  85. package/cjs/core/responsive-style-manager/normalize-number-like-string-prop/normalize-number-like-string-prop.cjs.map +1 -1
  86. package/cjs/core/responsive-style-manager/responsive-style-manager.cjs.map +1 -1
  87. package/cjs/core/responsive-style-manager/styles-to-string/styles-to-string.cjs.map +1 -1
  88. package/cjs/core/styles-api/use-styles/get-class-name/get-options-class-names/get-options-class-names.cjs.map +1 -1
  89. package/cjs/core/styles-api/use-styles/get-class-name/get-resolved-class-names/get-resolved-class-names.cjs.map +1 -1
  90. package/cjs/core/styles-api/use-styles/get-class-name/get-root-class-name/get-root-class-name.cjs.map +1 -1
  91. package/cjs/core/styles-api/use-styles/get-class-name/get-selector-class-name/get-selector-class-name.cjs.map +1 -1
  92. package/cjs/core/styles-api/use-styles/get-class-name/get-static-class-names/get-static-class-names.cjs.map +1 -1
  93. package/cjs/core/styles-api/use-styles/get-class-name/get-variant-class-name/get-variant-class-name.cjs.map +1 -1
  94. package/cjs/core/utils/deep-merge/deep-merge.cjs +18 -0
  95. package/cjs/core/utils/deep-merge/deep-merge.cjs.map +1 -0
  96. package/cjs/core/utils/get-breakpoint-value/get-breakpoint-value.cjs.map +1 -1
  97. package/cjs/core/utils/get-size/get-size.cjs +2 -2
  98. package/cjs/core/utils/get-size/get-size.cjs.map +1 -1
  99. package/cjs/core/utils/get-sorted-breakpoints/get-sorted-breakpoints.cjs.map +1 -1
  100. package/cjs/core/utils/number-like-string-to-number/number-like-string-to-number.cjs.map +1 -1
  101. package/cjs/core/utils/units-converters/px.cjs.map +1 -1
  102. package/cjs/core/utils/units-converters/rem.cjs.map +1 -1
  103. package/cjs/core/utils/vue/component.cjs.map +1 -1
  104. package/cjs/core/utils/vue/install.cjs +3 -3
  105. package/cjs/core/utils/vue/install.cjs.map +1 -1
  106. package/cjs/core/utils/vue/statics.cjs +38 -0
  107. package/cjs/core/utils/vue/statics.cjs.map +1 -0
  108. package/cjs/index.cjs +12 -6
  109. package/cjs/index.cjs.map +1 -1
  110. package/esm/components/button/button-group/button-group.mjs +61 -35
  111. package/esm/components/button/button-group/button-group.mjs.map +1 -1
  112. package/esm/components/button/button-group/button-group.utils.mjs +9 -0
  113. package/esm/components/button/button-group/button-group.utils.mjs.map +1 -0
  114. package/esm/components/button/button-group-section/button-group-section.mjs +55 -50
  115. package/esm/components/button/button-group-section/button-group-section.mjs.map +1 -1
  116. package/esm/components/button/button-group-section/button-group-section.utils.mjs +26 -0
  117. package/esm/components/button/button-group-section/button-group-section.utils.mjs.map +1 -0
  118. package/esm/components/button/button.mjs +71 -63
  119. package/esm/components/button/button.mjs.map +1 -1
  120. package/esm/components/button/button.utils.mjs +29 -0
  121. package/esm/components/button/button.utils.mjs.map +1 -0
  122. package/esm/components/button/index.mjs +13 -5
  123. package/esm/components/button/index.mjs.map +1 -1
  124. package/esm/components/grid/col/col.mjs +34 -17
  125. package/esm/components/grid/col/col.mjs.map +1 -1
  126. package/esm/components/grid/grid.constants.mjs.map +1 -1
  127. package/esm/components/grid/grid.mjs +63 -34
  128. package/esm/components/grid/grid.mjs.map +1 -1
  129. package/esm/components/grid/grid.utils.mjs +12 -0
  130. package/esm/components/grid/grid.utils.mjs.map +1 -0
  131. package/esm/components/grid/index.mjs +6 -2
  132. package/esm/components/grid/index.mjs.map +1 -1
  133. package/esm/components/group/group.mjs +78 -62
  134. package/esm/components/group/group.mjs.map +1 -1
  135. package/esm/components/group/group.utils.mjs +15 -0
  136. package/esm/components/group/group.utils.mjs.map +1 -0
  137. package/esm/components/group/index.mjs +4 -2
  138. package/esm/components/group/index.mjs.map +1 -1
  139. package/esm/components/loader/index.mjs +4 -1
  140. package/esm/components/loader/index.mjs.map +1 -1
  141. package/esm/components/loader/loader.mjs +50 -41
  142. package/esm/components/loader/loader.mjs.map +1 -1
  143. package/esm/components/loader/loader.module.mjs.map +1 -1
  144. package/esm/components/loader/loader.utils.mjs +13 -0
  145. package/esm/components/loader/loader.utils.mjs.map +1 -0
  146. package/esm/components/loader/loaders/bars.mjs +7 -4
  147. package/esm/components/loader/loaders/bars.mjs.map +1 -1
  148. package/esm/components/loader/loaders/dots.mjs +7 -4
  149. package/esm/components/loader/loaders/dots.mjs.map +1 -1
  150. package/esm/components/loader/loaders/oval.mjs +7 -4
  151. package/esm/components/loader/loaders/oval.mjs.map +1 -1
  152. package/esm/components/simple-grid/index.mjs +3 -2
  153. package/esm/components/simple-grid/index.mjs.map +1 -1
  154. package/esm/components/simple-grid/simple-grid.mjs +47 -22
  155. package/esm/components/simple-grid/simple-grid.mjs.map +1 -1
  156. package/esm/components/text/index.mjs +4 -2
  157. package/esm/components/text/index.mjs.map +1 -1
  158. package/esm/components/text/text.mjs +46 -39
  159. package/esm/components/text/text.mjs.map +1 -1
  160. package/esm/components/text/text.utils.mjs +16 -0
  161. package/esm/components/text/text.utils.mjs.map +1 -0
  162. package/esm/components/unstyled-button/index.mjs +3 -2
  163. package/esm/components/unstyled-button/index.mjs.map +1 -1
  164. package/esm/components/unstyled-button/unstyled-button.mjs +38 -23
  165. package/esm/components/unstyled-button/unstyled-button.mjs.map +1 -1
  166. package/esm/core/box/box.mjs +40 -28
  167. package/esm/core/box/box.mjs.map +1 -1
  168. package/esm/core/box/get-box-style/get-box-style.mjs.map +1 -1
  169. package/esm/core/box/style-props/extract-style-props/extract-style-props.mjs.map +1 -1
  170. package/esm/core/box/style-props/parse-style-props/sort-media-queries.mjs.map +1 -1
  171. package/esm/core/box/style-props/resolvers/border-resolver/border-resolver.mjs.map +1 -1
  172. package/esm/core/box/style-props/resolvers/color-resolver/color-resolver.mjs.map +1 -1
  173. package/esm/core/box/style-props/resolvers/font-family-resolver/font-family-resolver.mjs.map +1 -1
  174. package/esm/core/box/style-props/resolvers/index.mjs.map +1 -1
  175. package/esm/core/box/style-props/style-props-data.mjs.map +1 -1
  176. package/esm/core/config-provider/color-functions/get-gradient/get-gradient.mjs +3 -3
  177. package/esm/core/config-provider/color-functions/get-gradient/get-gradient.mjs.map +1 -1
  178. package/esm/core/config-provider/color-functions/rgba/rgba.mjs +8 -1
  179. package/esm/core/config-provider/color-functions/rgba/rgba.mjs.map +1 -1
  180. package/esm/core/config-provider/color-functions/to-rgba/to-rgba.mjs.map +1 -1
  181. package/esm/core/config-provider/config-provider.mjs +33 -22
  182. package/esm/core/config-provider/config-provider.mjs.map +1 -1
  183. package/esm/core/config-provider/default-colors.mjs.map +1 -1
  184. package/esm/core/config-provider/index.mjs +4 -2
  185. package/esm/core/config-provider/index.mjs.map +1 -1
  186. package/esm/core/config-provider/merge-cck-theme/merge-cck-theme.mjs +2 -2
  187. package/esm/core/config-provider/merge-cck-theme/merge-cck-theme.mjs.map +1 -1
  188. package/esm/core/config-provider/merge-theme-overrides/merge-theme-overrides.mjs +10 -0
  189. package/esm/core/config-provider/merge-theme-overrides/merge-theme-overrides.mjs.map +1 -0
  190. package/esm/core/config-provider/use-component-props/use-component-props.mjs +35 -0
  191. package/esm/core/config-provider/use-component-props/use-component-props.mjs.map +1 -0
  192. package/esm/core/responsive-style-manager/css-object-to-string/css-object-to-string.mjs.map +1 -1
  193. package/esm/core/responsive-style-manager/normalize-number-like-string-prop/normalize-number-like-string-prop.mjs +1 -1
  194. package/esm/core/responsive-style-manager/normalize-number-like-string-prop/normalize-number-like-string-prop.mjs.map +1 -1
  195. package/esm/core/responsive-style-manager/responsive-style-manager.mjs.map +1 -1
  196. package/esm/core/responsive-style-manager/styles-to-string/styles-to-string.mjs.map +1 -1
  197. package/esm/core/styles-api/use-styles/get-class-name/get-options-class-names/get-options-class-names.mjs.map +1 -1
  198. package/esm/core/styles-api/use-styles/get-class-name/get-resolved-class-names/get-resolved-class-names.mjs.map +1 -1
  199. package/esm/core/styles-api/use-styles/get-class-name/get-root-class-name/get-root-class-name.mjs.map +1 -1
  200. package/esm/core/styles-api/use-styles/get-class-name/get-selector-class-name/get-selector-class-name.mjs.map +1 -1
  201. package/esm/core/styles-api/use-styles/get-class-name/get-static-class-names/get-static-class-names.mjs.map +1 -1
  202. package/esm/core/styles-api/use-styles/get-class-name/get-variant-class-name/get-variant-class-name.mjs.map +1 -1
  203. package/esm/core/utils/deep-merge/deep-merge.mjs +18 -0
  204. package/esm/core/utils/deep-merge/deep-merge.mjs.map +1 -0
  205. package/esm/core/utils/get-breakpoint-value/get-breakpoint-value.mjs.map +1 -1
  206. package/esm/core/utils/get-size/get-size.mjs +2 -2
  207. package/esm/core/utils/get-size/get-size.mjs.map +1 -1
  208. package/esm/core/utils/get-sorted-breakpoints/get-sorted-breakpoints.mjs.map +1 -1
  209. package/esm/core/utils/number-like-string-to-number/number-like-string-to-number.mjs.map +1 -1
  210. package/esm/core/utils/units-converters/px.mjs.map +1 -1
  211. package/esm/core/utils/units-converters/rem.mjs.map +1 -1
  212. package/esm/core/utils/vue/component.mjs.map +1 -1
  213. package/esm/core/utils/vue/install.mjs +2 -2
  214. package/esm/core/utils/vue/install.mjs.map +1 -1
  215. package/esm/core/utils/vue/statics.mjs +35 -0
  216. package/esm/core/utils/vue/statics.mjs.map +1 -0
  217. package/esm/index.mjs +6 -4
  218. package/esm/index.mjs.map +1 -1
  219. package/lib/components/button/button-group/button-group.utils.d.ts +6 -0
  220. package/lib/components/button/button-group-section/button-group-section.utils.d.ts +7 -0
  221. package/lib/components/button/button.utils.d.ts +9 -0
  222. package/lib/components/button/index.d.ts +7 -7
  223. package/lib/components/grid/grid.utils.d.ts +9 -0
  224. package/lib/components/grid/index.d.ts +6 -5
  225. package/lib/components/group/group.utils.d.ts +7 -0
  226. package/lib/components/group/index.d.ts +3 -2
  227. package/lib/components/loader/index.d.ts +3 -2
  228. package/lib/components/loader/loader.utils.d.ts +9 -0
  229. package/lib/components/simple-grid/index.d.ts +3 -2
  230. package/lib/components/stack/index.d.ts +6 -0
  231. package/lib/components/stack/stack.types.d.ts +29 -0
  232. package/lib/components/stack/stack.utils.d.ts +6 -0
  233. package/lib/components/text/index.d.ts +3 -2
  234. package/lib/components/text/text.utils.d.ts +8 -0
  235. package/lib/components/unstyled-button/index.d.ts +3 -2
  236. package/lib/core/config-provider/color-functions/index.d.ts +1 -1
  237. package/lib/core/config-provider/color-functions/rgba/rgba.d.ts +1 -0
  238. package/lib/core/config-provider/index.d.ts +2 -0
  239. package/lib/core/config-provider/merge-theme-overrides/merge-theme-overrides.d.ts +2 -0
  240. package/lib/core/config-provider/use-component-props/use-component-props.d.ts +7 -0
  241. package/lib/core/responsive-style-manager/responsive-style-manager.d.ts +1 -0
  242. package/lib/core/styles-api/index.d.ts +1 -1
  243. package/lib/core/styles-api/use-styles/get-class-name/get-options-class-names/get-options-class-names.d.ts +1 -1
  244. package/lib/core/styles-api/use-styles/get-class-name/get-resolved-class-names/get-resolved-class-names.d.ts +1 -1
  245. package/lib/core/styles-api/use-styles/get-class-name/get-static-class-names/get-static-class-names.d.ts +1 -1
  246. package/lib/core/styles-api/use-styles/get-class-name/get-variant-class-name/get-variant-class-name.d.ts +1 -1
  247. package/lib/core/utils/deep-merge/deep-merge.d.ts +1 -0
  248. package/lib/core/utils/index.d.ts +4 -5
  249. package/lib/core/utils/vue/index.d.ts +1 -0
  250. package/lib/core/utils/vue/statics.d.ts +14 -0
  251. package/lib/core/utils/vue/typescript.d.ts +8 -0
  252. package/package.json +2 -1
  253. package/styles/loader.css +1 -2
  254. package/styles/loader.layer.css +1 -2
  255. package/styles/stack.css +7 -0
  256. package/styles/stack.layer.css +8 -0
  257. package/styles.css +9 -2
  258. package/styles.layer.css +9 -2
  259. package/cjs/components/loader/use-loader.cjs +0 -10
  260. package/cjs/components/loader/use-loader.cjs.map +0 -1
  261. package/cjs/core/utils/color.cjs +0 -112
  262. package/cjs/core/utils/color.cjs.map +0 -1
  263. package/cjs/core/utils/dom/style.cjs +0 -13
  264. package/cjs/core/utils/dom/style.cjs.map +0 -1
  265. package/esm/components/loader/use-loader.mjs +0 -10
  266. package/esm/components/loader/use-loader.mjs.map +0 -1
  267. package/esm/core/utils/color.mjs +0 -110
  268. package/esm/core/utils/color.mjs.map +0 -1
  269. package/esm/core/utils/dom/style.mjs +0 -12
  270. package/esm/core/utils/dom/style.mjs.map +0 -1
  271. package/lib/core/utils/color.d.ts +0 -11
  272. package/lib/core/utils/dom/index.d.ts +0 -1
  273. package/lib/core/utils/dom/style.d.ts +0 -1
@@ -1,12 +1,13 @@
1
1
  "use client";
2
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";
3
4
  import { responsiveStyleManager } from "../../../core/responsive-style-manager/responsive-style-manager.mjs";
4
5
  import { normalizeNumberLikeStringProp } from "../../../core/responsive-style-manager/normalize-number-like-string-prop/normalize-number-like-string-prop.mjs";
5
6
  import { useRandomClassName } from "../../../core/box/use-random-classname/use-random-classname.mjs";
6
7
  import { CBox } from "../../../core/box/index.mjs";
7
8
  import { GRID_CONTEXT_KEY } from "../grid.constants.mjs";
8
9
  import { useColCustomStyle } from "./col-custom.mjs";
9
- import { computed, createBlock, defineComponent, guardReactiveProps, inject, normalizeProps, onUnmounted, openBlock, ref, renderSlot, watchEffect, withCtx } from "vue";
10
+ import { computed, createBlock, defineComponent, inject, mergeProps, onUnmounted, openBlock, ref, renderSlot, watchEffect, withCtx } from "vue";
10
11
  import cx from "clsx";
11
12
  //#region packages/@cck-ui/core/src/components/grid/col/col.vue
12
13
  const _sfc_main = /*@__PURE__*/ defineComponent({
@@ -15,8 +16,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
15
16
  props: {
16
17
  span: {
17
18
  type: null,
18
- required: false,
19
- default: 12
19
+ required: false
20
20
  },
21
21
  order: {
22
22
  type: null,
@@ -313,8 +313,13 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
313
313
  }
314
314
  },
315
315
  setup(__props, { expose: __expose }) {
316
- __expose();
317
- const props = __props;
316
+ const _col = ref(null);
317
+ const rawProps = __props;
318
+ const props = useComponentProps({
319
+ component: "CCol",
320
+ defaultProps: { span: 12 },
321
+ props: rawProps
322
+ });
318
323
  const knownProps = [
319
324
  "classNames",
320
325
  "className",
@@ -327,29 +332,38 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
327
332
  "align"
328
333
  ];
329
334
  const gridContext = inject(GRID_CONTEXT_KEY);
335
+ if (!gridContext) throw new Error("[@cck-ui/col] CCol component should be wrapped inside CGrid component.");
330
336
  const responsiveClassname = useRandomClassName();
331
- const rootAttrs = computed(() => gridContext.getStyles("col", {
332
- className: cx(props.className, responsiveClassname),
333
- style: props.style,
334
- classNames: props.classNames,
335
- styles: props.styles
336
- }));
337
+ const rootAttrs = computed(() => {
338
+ return gridContext.getStyles("col", {
339
+ className: cx(props.value.className, responsiveClassname),
340
+ style: props.value.style,
341
+ classNames: props.value.classNames,
342
+ styles: props.value.styles
343
+ });
344
+ });
337
345
  const mergedAttrs = computed(() => {
338
346
  const others = {};
339
- for (const key in props) if (!knownProps.includes(key)) others[key] = props[key];
347
+ const propsValue = props.value;
348
+ Object.keys(propsValue).forEach((key) => {
349
+ if (!knownProps.includes(key)) others[key] = propsValue[key];
350
+ });
351
+ const userMod = props.value.mod;
352
+ const mergedMod = [...Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)];
340
353
  return {
341
354
  ...others,
355
+ mod: mergedMod,
342
356
  ...rootAttrs.value
343
357
  };
344
358
  });
345
- const _offset = normalizeNumberLikeStringProp(props.offset);
346
- const _order = normalizeNumberLikeStringProp(props.order);
359
+ const _offset = normalizeNumberLikeStringProp(props.value.offset);
360
+ const _order = normalizeNumberLikeStringProp(props.value.order);
347
361
  const colStyle = useColCustomStyle({
348
362
  selector: responsiveClassname,
349
- align: props.align,
363
+ align: props.value.align,
350
364
  offset: _offset,
351
365
  order: _order,
352
- span: props.span
366
+ span: props.value.span
353
367
  }, gridContext);
354
368
  const currentStyleKey = ref(null);
355
369
  watchEffect(() => {
@@ -366,7 +380,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
366
380
  onUnmounted(() => {
367
381
  if (currentStyleKey.value) responsiveStyleManager.unregister(currentStyleKey.value);
368
382
  });
383
+ __expose({ root: computed(() => _col.value?.root ?? null) });
369
384
  const __returned__ = {
385
+ _col,
386
+ rawProps,
370
387
  props,
371
388
  knownProps,
372
389
  gridContext,
@@ -389,7 +406,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
389
406
  }
390
407
  });
391
408
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
392
- return openBlock(), createBlock($setup["CBox"], normalizeProps(guardReactiveProps($setup.mergedAttrs)), {
409
+ return openBlock(), createBlock($setup["CBox"], mergeProps({ ref: "_col" }, $setup.mergedAttrs), {
393
410
  default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
394
411
  _: 3
395
412
  }, 16);
@@ -1 +1 @@
1
- {"version":3,"file":"col.mjs","names":[],"sources":["../../../../src/components/grid/col/col.vue"],"sourcesContent":["<template>\n <c-box v-bind=\"mergedAttrs\">\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport cx from 'clsx'\nimport { computed, inject, onUnmounted, ref, watchEffect } from 'vue'\nimport {\n CBox,\n normalizeNumberLikeStringProp,\n responsiveStyleManager,\n useRandomClassName,\n} from '../../../core'\nimport type { ColProps } from './col.types'\nimport { useColCustomStyle } from './col-custom'\nimport { GridContextValue } from '../grid.context'\nimport { GRID_CONTEXT_KEY } from '../grid.constants'\n\ndefineOptions({\n name: 'CCol',\n})\n\nconst props = withDefaults(defineProps<ColProps>(), {\n span: 12,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'vars',\n 'span',\n 'order',\n 'offset',\n 'align',\n]\n\nconst gridContext = inject(GRID_CONTEXT_KEY) as GridContextValue\n\nconst responsiveClassname = useRandomClassName()\n\nconst rootAttrs = computed(() =>\n gridContext.getStyles('col', {\n className: cx(props.className, responsiveClassname),\n style: props.style,\n classNames: props.classNames,\n styles: props.styles,\n })\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\nconst _offset = normalizeNumberLikeStringProp(props.offset)\nconst _order = normalizeNumberLikeStringProp(props.order)\nconst colStyle = useColCustomStyle(\n {\n selector: responsiveClassname,\n align: props.align,\n offset: _offset,\n order: _order,\n span: props.span,\n },\n gridContext\n)\n\nconst currentStyleKey = ref<string | null>(null)\nwatchEffect(() => {\n const cssText = colStyle.value.queryStylesString\n if (cssText) {\n const newKey = responsiveStyleManager.register(cssText)\n if (currentStyleKey.value && currentStyleKey.value !== newKey) {\n responsiveStyleManager.unregister(currentStyleKey.value)\n }\n currentStyleKey.value = newKey\n } else if (currentStyleKey.value) {\n responsiveStyleManager.unregister(currentStyleKey.value)\n currentStyleKey.value = null\n }\n})\nonUnmounted(() => {\n if (currentStyleKey.value) {\n responsiveStyleManager.unregister(currentStyleKey.value)\n }\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBA,MAAM,QAAQ;EAId,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,cAAc,OAAO,gBAAgB;EAE3C,MAAM,sBAAsB,mBAAmB;EAE/C,MAAM,YAAY,eAChB,YAAY,UAAU,OAAO;GAC3B,WAAW,GAAG,MAAM,WAAW,mBAAmB;GAClD,OAAO,MAAM;GACb,YAAY,MAAM;GAClB,QAAQ,MAAM;EAChB,CAAC,CACH;EACA,MAAM,cAAc,eAAe;GACjC,MAAM,SAA8B,CAAC;GACrC,KAAK,MAAM,OAAO,OAChB,IAAI,CAAC,WAAW,SAAS,GAAG,GAC1B,OAAO,OAAO,MAAM;GAGxB,OAAO;IAAE,GAAG;IAAQ,GAAG,UAAU;GAAM;EACzC,CAAC;EAED,MAAM,UAAU,8BAA8B,MAAM,MAAM;EAC1D,MAAM,SAAS,8BAA8B,MAAM,KAAK;EACxD,MAAM,WAAW,kBACf;GACE,UAAU;GACV,OAAO,MAAM;GACb,QAAQ;GACR,OAAO;GACP,MAAM,MAAM;EACd,GACA,WACF;EAEA,MAAM,kBAAkB,IAAmB,IAAI;EAC/C,kBAAkB;GAChB,MAAM,UAAU,SAAS,MAAM;GAC/B,IAAI,SAAS;IACX,MAAM,SAAS,uBAAuB,SAAS,OAAO;IACtD,IAAI,gBAAgB,SAAS,gBAAgB,UAAU,QACrD,uBAAuB,WAAW,gBAAgB,KAAK;IAEzD,gBAAgB,QAAQ;GAC1B,OAAO,IAAI,gBAAgB,OAAO;IAChC,uBAAuB,WAAW,gBAAgB,KAAK;IACvD,gBAAgB,QAAQ;GAC1B;EACF,CAAC;EACD,kBAAkB;GAChB,IAAI,gBAAgB,OAClB,uBAAuB,WAAW,gBAAgB,KAAK;EAE3D,CAAC;;;;;;;;;;;;;;;;;;;;;;;;qBA5FC,YAEQ,OAAA,SAAA,eAAA,mBAFO,OAAA,WAAW,CAAA,GAAA;yBAChB,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"col.mjs","names":[],"sources":["../../../../src/components/grid/col/col.vue"],"sourcesContent":["<template>\n <c-box ref=\"_col\" v-bind=\"mergedAttrs\">\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport cx from 'clsx'\nimport { computed, inject, onUnmounted, ref, watchEffect } from 'vue'\nimport {\n CBox,\n normalizeNumberLikeStringProp,\n responsiveStyleManager,\n useComponentProps,\n useRandomClassName,\n} from '../../../core'\nimport type { ColProps } from './col.types'\nimport { useColCustomStyle } from './col-custom'\nimport { GRID_CONTEXT_KEY } from '../grid.constants'\n\ndefineOptions({\n name: 'CCol',\n})\n\nconst _col = ref<InstanceType<typeof CBox> | null>(null)\n\nconst rawProps = defineProps<ColProps>()\n\nconst props = useComponentProps({\n component: 'CCol',\n defaultProps: {\n span: 12,\n },\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'vars',\n 'span',\n 'order',\n 'offset',\n 'align',\n]\n\nconst gridContext = inject(GRID_CONTEXT_KEY)\n\nif (!gridContext) {\n throw new Error('[@cck-ui/col] CCol component should be wrapped inside CGrid component.')\n}\n\nconst responsiveClassname = useRandomClassName()\n\nconst rootAttrs = computed(() => {\n return gridContext.getStyles('col', {\n className: cx(props.value.className, responsiveClassname),\n style: props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n })\n})\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 = [...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean))]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\nconst _offset = normalizeNumberLikeStringProp(props.value.offset)\nconst _order = normalizeNumberLikeStringProp(props.value.order)\nconst colStyle = useColCustomStyle(\n {\n selector: responsiveClassname,\n align: props.value.align,\n offset: _offset,\n order: _order,\n span: props.value.span,\n },\n gridContext\n)\n\nconst currentStyleKey = ref<string | null>(null)\nwatchEffect(() => {\n const cssText = colStyle.value.queryStylesString\n if (cssText) {\n const newKey = responsiveStyleManager.register(cssText)\n if (currentStyleKey.value && currentStyleKey.value !== newKey) {\n responsiveStyleManager.unregister(currentStyleKey.value)\n }\n currentStyleKey.value = newKey\n } else if (currentStyleKey.value) {\n responsiveStyleManager.unregister(currentStyleKey.value)\n currentStyleKey.value = null\n }\n})\nonUnmounted(() => {\n if (currentStyleKey.value) {\n responsiveStyleManager.unregister(currentStyleKey.value)\n }\n})\n\ndefineExpose({\n root: computed(() => _col.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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B,MAAM,MAAM,KAAK;EAC9D,MAAM,WAAW,kBACf;GACE,UAAU;GACV,OAAO,MAAM,MAAM;GACnB,QAAQ;GACR,OAAO;GACP,MAAM,MAAM,MAAM;EACpB,GACA,WACF;EAEA,MAAM,kBAAkB,IAAmB,IAAI;EAC/C,kBAAkB;GAChB,MAAM,UAAU,SAAS,MAAM;GAC/B,IAAI,SAAS;IACX,MAAM,SAAS,uBAAuB,SAAS,OAAO;IACtD,IAAI,gBAAgB,SAAS,gBAAgB,UAAU,QACrD,uBAAuB,WAAW,gBAAgB,KAAK;IAEzD,gBAAgB,QAAQ;GAC1B,OAAO,IAAI,gBAAgB,OAAO;IAChC,uBAAuB,WAAW,gBAAgB,KAAK;IACvD,gBAAgB,QAAQ;GAC1B;EACF,CAAC;EACD,kBAAkB;GAChB,IAAI,gBAAgB,OAClB,uBAAuB,WAAW,gBAAgB,KAAK;EAE3D,CAAC;EAED,SAAa,EACX,MAAM,eAAe,KAAK,OAAO,QAAQ,IAAI,EAC/C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;qBAhHC,YAEQ,OAAA,SAFR,WAEQ,EAFD,KAAI,OAAM,GAAS,OAAA,WAAW,GAAA;yBAC3B,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"grid.constants.mjs","names":[],"sources":["../../../src/components/grid/grid.constants.ts"],"sourcesContent":["import { InjectionKey } from 'vue'\nimport { GridContextValue } from './grid.context'\n\nexport const GRID_CONTEXT_KEY: InjectionKey<GridContextValue> =\n Symbol('GridContext')\n\nexport const DEFAULT_COLUMNS = 12\n"],"mappings":";;AAGA,MAAa,mBACX,OAAO,aAAa"}
1
+ {"version":3,"file":"grid.constants.mjs","names":[],"sources":["../../../src/components/grid/grid.constants.ts"],"sourcesContent":["import { InjectionKey } from 'vue'\nimport { GridContextValue } from './grid.context'\n\nexport const GRID_CONTEXT_KEY: InjectionKey<GridContextValue> = Symbol('GridContext')\n\nexport const DEFAULT_COLUMNS = 12\n"],"mappings":";;AAGA,MAAa,mBAAmD,OAAO,aAAa"}
@@ -1,15 +1,16 @@
1
1
  "use client";
2
2
  import { isNumberLike } from "../../core/utils/is-number-like/is-number-like.mjs";
3
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";
4
5
  import { responsiveStyleManager } from "../../core/responsive-style-manager/responsive-style-manager.mjs";
5
6
  import { useRandomClassName } from "../../core/box/use-random-classname/use-random-classname.mjs";
6
7
  import { CBox } from "../../core/box/index.mjs";
7
- import { createVarsResolver } from "../../core/styles-api/create-vars-resolver/create-vars-resolver.mjs";
8
8
  import { useStyles } from "../../core/styles-api/use-styles/use-styles.mjs";
9
9
  import { useGridCustomStyle } from "./grid-custom.mjs";
10
10
  import { GRID_CONTEXT_KEY } from "./grid.constants.mjs";
11
11
  import grid_module_default from "./grid.module.mjs";
12
- import { computed, createBlock, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, onUnmounted, openBlock, provide, ref, renderSlot, watchEffect, withCtx } from "vue";
12
+ import { varsResolver } from "./grid.utils.mjs";
13
+ import { computed, createBlock, createVNode, defineComponent, mergeProps, onUnmounted, openBlock, provide, ref, renderSlot, useAttrs, watchEffect, withCtx } from "vue";
13
14
  //#region packages/@cck-ui/core/src/components/grid/grid.vue
14
15
  const _sfc_main = /*@__PURE__*/ defineComponent({
15
16
  name: "CGrid",
@@ -17,8 +18,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
17
18
  props: {
18
19
  gap: {
19
20
  type: null,
20
- required: false,
21
- default: "md"
21
+ required: false
22
22
  },
23
23
  rowGap: {
24
24
  type: null,
@@ -42,8 +42,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
42
42
  },
43
43
  columns: {
44
44
  type: [Number, String],
45
- required: false,
46
- default: 12
45
+ required: false
47
46
  },
48
47
  overflow: {
49
48
  type: null,
@@ -348,8 +347,19 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
348
347
  }
349
348
  },
350
349
  setup(__props, { expose: __expose }) {
351
- __expose();
352
- const props = __props;
350
+ const _container = ref(null);
351
+ const _root = ref(null);
352
+ const _inner = ref(null);
353
+ const attrs = useAttrs();
354
+ const rawProps = __props;
355
+ const props = useComponentProps({
356
+ component: "CGrid",
357
+ defaultProps: {
358
+ columns: 12,
359
+ gap: "md"
360
+ },
361
+ props: rawProps
362
+ });
353
363
  const knownProps = [
354
364
  "classNames",
355
365
  "className",
@@ -368,31 +378,35 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
368
378
  "type",
369
379
  "attributes"
370
380
  ];
371
- const varsResolver = createVarsResolver((_, { justify, align, overflow }) => ({ root: {
372
- "--grid-align": align,
373
- "--grid-justify": justify,
374
- "--grid-overflow": overflow
375
- } }));
376
381
  const getStyles = useStyles({
377
382
  name: "Grid",
378
383
  classes: grid_module_default,
379
- props,
380
- className: props.className,
381
- style: props.style,
382
- classNames: props.classNames,
383
- styles: props.styles,
384
- unstyled: props.unstyled,
385
- attributes: props.attributes,
386
- vars: props.vars,
384
+ props: {
385
+ ...props.value,
386
+ ...attrs
387
+ },
388
+ className: props.value.className,
389
+ style: props.value.style,
390
+ classNames: props.value.classNames,
391
+ styles: props.value.styles,
392
+ unstyled: props.value.unstyled,
393
+ attributes: props.value.attributes,
394
+ vars: props.value.vars,
387
395
  varsResolver
388
396
  });
389
397
  const responsiveClassname = useRandomClassName();
390
398
  const rootAttrs = computed(() => getStyles("root", { className: responsiveClassname }));
391
399
  const mergedRootAttrs = computed(() => {
392
400
  const others = {};
393
- for (const key in props) if (!knownProps.includes(key)) others[key] = props[key];
401
+ const propsValue = props.value;
402
+ Object.keys(propsValue).forEach((key) => {
403
+ if (!knownProps.includes(key)) others[key] = propsValue[key];
404
+ });
405
+ const userMod = props.value.mod;
406
+ const mergedMod = [...Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)];
394
407
  return {
395
408
  ...others,
409
+ mod: mergedMod,
396
410
  ...rootAttrs.value
397
411
  };
398
412
  });
@@ -417,16 +431,16 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
417
431
  onUnmounted(() => {
418
432
  if (currentStyleKey.value) responsiveStyleManager.unregister(currentStyleKey.value);
419
433
  });
420
- const _breakpoints = computed(() => props.breakpoints);
434
+ const _breakpoints = computed(() => props.value.breakpoints);
421
435
  const _columns = computed(() => {
422
- if (!isNumberLike(props.columns)) {
423
- console.warn(`[C-Grid] columns should be number or number-like string, got ${props.columns}. Fallback to default columns 12.`);
436
+ if (!isNumberLike(props.value.columns)) {
437
+ console.warn(`[C-Grid] columns should be number or number-like string, got ${props.value.columns}. Fallback to default columns 12.`);
424
438
  return 12;
425
439
  }
426
- return Number(props.columns);
440
+ return Number(props.value.columns);
427
441
  });
428
- const _grow = computed(() => props.grow);
429
- const _type = computed(() => props.type);
442
+ const _grow = computed(() => props.value.grow);
443
+ const _type = computed(() => props.value.type);
430
444
  const context = {
431
445
  getStyles,
432
446
  get breakpoints() {
@@ -443,10 +457,19 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
443
457
  }
444
458
  };
445
459
  provide(GRID_CONTEXT_KEY, context);
460
+ __expose({
461
+ container: computed(() => _container.value?.root ?? null),
462
+ root: computed(() => _root.value?.root ?? null),
463
+ inner: computed(() => _inner.value?.root ?? null)
464
+ });
446
465
  const __returned__ = {
466
+ _container,
467
+ _root,
468
+ _inner,
469
+ attrs,
470
+ rawProps,
447
471
  props,
448
472
  knownProps,
449
- varsResolver,
450
473
  getStyles,
451
474
  responsiveClassname,
452
475
  rootAttrs,
@@ -472,17 +495,23 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
472
495
  }
473
496
  });
474
497
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
475
- return $props.type === "container" && $props.breakpoints ? (openBlock(), createBlock($setup["CBox"], normalizeProps(mergeProps({ key: 0 }, $setup.containerAttrs)), {
476
- default: withCtx(() => [createVNode($setup["CBox"], normalizeProps(guardReactiveProps($setup.mergedRootAttrs)), {
477
- default: withCtx(() => [createVNode($setup["CBox"], normalizeProps(guardReactiveProps($setup.innerAttrs)), {
498
+ return $props.type === "container" && $props.breakpoints ? (openBlock(), createBlock($setup["CBox"], mergeProps({
499
+ key: 0,
500
+ ref: "_container"
501
+ }, $setup.containerAttrs), {
502
+ default: withCtx(() => [createVNode($setup["CBox"], mergeProps({ ref: "_root" }, $setup.mergedRootAttrs), {
503
+ default: withCtx(() => [createVNode($setup["CBox"], mergeProps({ ref: "_inner" }, $setup.innerAttrs), {
478
504
  default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
479
505
  _: 3
480
506
  }, 16)]),
481
507
  _: 3
482
508
  }, 16)]),
483
509
  _: 3
484
- }, 16)) : (openBlock(), createBlock($setup["CBox"], normalizeProps(mergeProps({ key: 1 }, $setup.mergedRootAttrs)), {
485
- default: withCtx(() => [createVNode($setup["CBox"], normalizeProps(guardReactiveProps($setup.innerAttrs)), {
510
+ }, 16)) : (openBlock(), createBlock($setup["CBox"], mergeProps({
511
+ key: 1,
512
+ ref: "_root"
513
+ }, $setup.mergedRootAttrs), {
514
+ default: withCtx(() => [createVNode($setup["CBox"], mergeProps({ ref: "_inner" }, $setup.innerAttrs), {
486
515
  default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
487
516
  _: 3
488
517
  }, 16)]),
@@ -1 +1 @@
1
- {"version":3,"file":"grid.mjs","names":[],"sources":["../../../src/components/grid/grid.vue"],"sourcesContent":["<template>\n <c-box v-if=\"type === 'container' && breakpoints\" v-bind=\"containerAttrs\">\n <c-box v-bind=\"mergedRootAttrs\">\n <c-box v-bind=\"innerAttrs\">\n <slot />\n </c-box>\n </c-box>\n </c-box>\n <template v-else>\n <c-box v-bind=\"mergedRootAttrs\">\n <c-box v-bind=\"innerAttrs\">\n <slot />\n </c-box>\n </c-box>\n </template>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, onUnmounted, provide, ref, watchEffect } from 'vue'\nimport {\n CBox,\n createVarsResolver,\n isNumberLike,\n responsiveStyleManager,\n useRandomClassName,\n useStyles,\n} from '../../core'\nimport { useGridCustomStyle } from './grid-custom'\nimport { DEFAULT_COLUMNS, GRID_CONTEXT_KEY } from './grid.constants'\nimport { GridContextValue } from './grid.context'\nimport type { GridFactory, GridProps } from './grid.types'\nimport classes from './grid.module.css'\n\ndefineOptions({\n name: 'CGrid',\n})\n\nconst props = withDefaults(defineProps<GridProps>(), {\n columns: DEFAULT_COLUMNS,\n gap: 'md',\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'grow',\n 'gap',\n 'rowGap',\n 'columnGap',\n 'columns',\n 'align',\n 'justify',\n 'breakpoints',\n 'type',\n 'attributes',\n]\n\nconst varsResolver = createVarsResolver<GridFactory>((_, { justify, align, overflow }) => ({\n root: {\n '--grid-align': align,\n '--grid-justify': justify,\n '--grid-overflow': overflow,\n },\n}))\n\nconst getStyles = useStyles<GridFactory>({\n name: 'Grid',\n classes,\n props,\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 responsiveClassname = useRandomClassName()\n\nconst rootAttrs = computed(() => getStyles('root', { className: responsiveClassname }))\nconst mergedRootAttrs = 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\nconst innerAttrs = computed(() => getStyles('inner'))\n\nconst containerAttrs = computed(() => getStyles('container'))\n\nconst gridStyle = useGridCustomStyle({\n selector: responsiveClassname,\n ...props,\n})\n\nconst currentStyleKey = ref<string | null>(null)\nwatchEffect(() => {\n const cssText = gridStyle.value.queryStylesString\n if (cssText) {\n const newKey = responsiveStyleManager.register(cssText)\n if (currentStyleKey.value && currentStyleKey.value !== newKey) {\n responsiveStyleManager.unregister(currentStyleKey.value)\n }\n currentStyleKey.value = newKey\n } else if (currentStyleKey.value) {\n responsiveStyleManager.unregister(currentStyleKey.value)\n currentStyleKey.value = null\n }\n})\nonUnmounted(() => {\n if (currentStyleKey.value) {\n responsiveStyleManager.unregister(currentStyleKey.value)\n }\n})\n\nconst _breakpoints = computed(() => props.breakpoints)\nconst _columns = computed(() => {\n if (!isNumberLike(props.columns)) {\n console.warn(\n `[C-Grid] columns should be number or number-like string, got ${props.columns}. Fallback to default columns ${DEFAULT_COLUMNS}.`\n )\n return DEFAULT_COLUMNS\n }\n\n return Number(props.columns)\n})\nconst _grow = computed(() => props.grow)\nconst _type = computed(() => props.type)\n\nconst context: GridContextValue = {\n getStyles,\n get breakpoints() {\n return _breakpoints.value\n },\n get columns() {\n return _columns.value\n },\n get grow() {\n return _grow.value\n },\n get type() {\n return _type.value\n },\n}\n\nprovide(GRID_CONTEXT_KEY, context)\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqCA,MAAM,QAAQ;EAKd,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,eAAe,oBAAiC,GAAG,EAAE,SAAS,OAAO,gBAAgB,EACzF,MAAM;GACJ,gBAAgB;GAChB,k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AM,QAAQ,kCAChF;IACA,OAAA;GACF;GAEA,OAAO,OAAO,MAAM,OAAO;EAC7B,CAAC;EACD,MAAM,QAAQ,eAAe,MAAM,IAAI;EACvC,MAAM,QAAQ,eAAe,MAAM,IAAI;EAEvC,MAAM,UAA4B;GAChC;GACA,IAAI,cAAc;IAChB,OAAO,aAAa;GACtB;GACA,IAAI,UAAU;IACZ,OAAO,SAAS;GAClB;GACA,IAAI,OAAO;IACT,OAAO,MAAM;GACf;GACA,IAAI,OAAO;IACT,OAAO,MAAM;GACf;EACF;EAEA,QAAQ,kBAAkB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA1JlB,OAAA,SAAI,eAAoB,OAAA,eAAA,UAAA,GAArC,YAMQ,OAAA,SAAA,eAAA,WAAA,EAAA,KAAA,EAAA,GANkD,OAAA,cAAc,CAAA,GAAA;yBAK9D,CAJR,YAIQ,OAAA,SAAA,eAAA,mBAJO,OAAA,eAAe,CAAA,GAAA;0BAGpB,CAFR,YAEQ,OAAA,SAAA,eAAA,mBAFO,OAAA,UAAU,CAAA,GAAA;2BACf,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA;;;;;;yBAKZ,YAIQ,OAAA,SAAA,eAAA,WAAA,EAAA,KAAA,EAAA,GAJO,OAAA,eAAe,CAAA,GAAA;yBAGpB,CAFR,YAEQ,OAAA,SAAA,eAAA,mBAFO,OAAA,UAAU,CAAA,GAAA;0BACf,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"grid.mjs","names":[],"sources":["../../../src/components/grid/grid.vue"],"sourcesContent":["<template>\n <c-box ref=\"_container\" v-if=\"type === 'container' && breakpoints\" v-bind=\"containerAttrs\">\n <c-box ref=\"_root\" v-bind=\"mergedRootAttrs\">\n <c-box ref=\"_inner\" v-bind=\"innerAttrs\">\n <slot />\n </c-box>\n </c-box>\n </c-box>\n <template v-else>\n <c-box ref=\"_root\" v-bind=\"mergedRootAttrs\">\n <c-box ref=\"_inner\" v-bind=\"innerAttrs\">\n <slot />\n </c-box>\n </c-box>\n </template>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, onUnmounted, provide, ref, useAttrs, watchEffect } from 'vue'\nimport {\n CBox,\n isNumberLike,\n responsiveStyleManager,\n useComponentProps,\n useRandomClassName,\n useStyles,\n} from '../../core'\nimport { useGridCustomStyle } from './grid-custom'\nimport { DEFAULT_COLUMNS, GRID_CONTEXT_KEY } from './grid.constants'\nimport { GridContextValue } from './grid.context'\nimport type { GridFactory, GridProps } from './grid.types'\nimport classes from './grid.module.css'\nimport { varsResolver } from './grid.utils'\n\ndefineOptions({\n name: 'CGrid',\n})\n\nconst _container = ref<InstanceType<typeof CBox> | null>(null)\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\nconst _inner = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<GridProps>()\n\nconst props = useComponentProps({\n component: 'CGrid',\n defaultProps: {\n columns: DEFAULT_COLUMNS,\n gap: 'md',\n },\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'grow',\n 'gap',\n 'rowGap',\n 'columnGap',\n 'columns',\n 'align',\n 'justify',\n 'breakpoints',\n 'type',\n 'attributes',\n]\n\nconst getStyles = useStyles<GridFactory>({\n name: 'Grid',\n classes,\n props: { ...props.value, ...attrs } as GridProps,\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 responsiveClassname = useRandomClassName()\n\nconst rootAttrs = computed(() => getStyles('root', { className: responsiveClassname }))\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 = [...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean))]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\nconst innerAttrs = computed(() => getStyles('inner'))\n\nconst containerAttrs = computed(() => getStyles('container'))\n\nconst gridStyle = useGridCustomStyle({\n selector: responsiveClassname,\n ...props,\n})\n\nconst currentStyleKey = ref<string | null>(null)\nwatchEffect(() => {\n const cssText = gridStyle.value.queryStylesString\n if (cssText) {\n const newKey = responsiveStyleManager.register(cssText)\n if (currentStyleKey.value && currentStyleKey.value !== newKey) {\n responsiveStyleManager.unregister(currentStyleKey.value)\n }\n currentStyleKey.value = newKey\n } else if (currentStyleKey.value) {\n responsiveStyleManager.unregister(currentStyleKey.value)\n currentStyleKey.value = null\n }\n})\nonUnmounted(() => {\n if (currentStyleKey.value) {\n responsiveStyleManager.unregister(currentStyleKey.value)\n }\n})\n\nconst _breakpoints = computed(() => props.value.breakpoints)\nconst _columns = computed(() => {\n if (!isNumberLike(props.value.columns)) {\n console.warn(\n `[C-Grid] columns should be number or number-like string, got ${props.value.columns}. Fallback to default columns ${DEFAULT_COLUMNS}.`\n )\n return DEFAULT_COLUMNS\n }\n\n return Number(props.value.columns)\n})\nconst _grow = computed(() => props.value.grow)\nconst _type = computed(() => props.value.type)\n\nconst context: GridContextValue = {\n getStyles,\n get breakpoints() {\n return _breakpoints.value\n },\n get columns() {\n return _columns.value\n },\n get grow() {\n return _grow.value\n },\n get type() {\n return _type.value\n },\n}\n\nprovide(GRID_CONTEXT_KEY, context)\n\ndefineExpose({\n container: computed(() => _container.value?.root ?? null),\n root: computed(() => _root.value?.root ?? null),\n inner: computed(() => _inner.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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MAAM;GACf;EACF;EAEA,QAAQ,kBAAkB,OAAO;EAEjC,SAAa;GACX,WAAW,eAAe,WAAW,OAAO,QAAQ,IAAI;GACxD,MAAM,eAAe,MAAM,OAAO,QAAQ,IAAI;GAC9C,OAAO,eAAe,OAAO,OAAO,QAAQ,IAAI;EAClD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAzK+B,OAAA,SAAI,eAAoB,OAAA,eAAA,UAAA,GAAtD,YAMQ,OAAA,SANR,WAMQ;;EAND,KAAI;IAAgE,OAAA,cAAc,GAAA;yBAK/E,CAJR,YAIQ,OAAA,SAJR,WAIQ,EAJD,KAAI,QAAO,GAAS,OAAA,eAAe,GAAA;0BAGhC,CAFR,YAEQ,OAAA,SAFR,WAEQ,EAFD,KAAI,SAAQ,GAAS,OAAA,UAAU,GAAA;2BAC5B,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA;;;;;;yBAKZ,YAIQ,OAAA,SAJR,WAIQ;;EAJD,KAAI;IAAgB,OAAA,eAAe,GAAA;yBAGhC,CAFR,YAEQ,OAAA,SAFR,WAEQ,EAFD,KAAI,SAAQ,GAAS,OAAA,UAAU,GAAA;0BAC5B,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
@@ -0,0 +1,12 @@
1
+ "use client";
2
+ import { createVarsResolver } from "../../core/styles-api/create-vars-resolver/create-vars-resolver.mjs";
3
+ //#region packages/@cck-ui/core/src/components/grid/grid.utils.ts
4
+ const varsResolver = createVarsResolver((_, { justify, align, overflow }) => ({ root: {
5
+ "--grid-align": align,
6
+ "--grid-justify": justify,
7
+ "--grid-overflow": overflow
8
+ } }));
9
+ //#endregion
10
+ export { varsResolver };
11
+
12
+ //# sourceMappingURL=grid.utils.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid.utils.mjs","names":[],"sources":["../../../src/components/grid/grid.utils.ts"],"sourcesContent":["import { createVarsResolver } from '../../core'\nimport { GridFactory } from './grid.types'\n\nexport const varsResolver = createVarsResolver<GridFactory>((_, { justify, align, overflow }) => ({\n root: {\n '--grid-align': align,\n '--grid-justify': justify,\n '--grid-overflow': overflow,\n },\n}))\n"],"mappings":";;;AAGA,MAAa,eAAe,oBAAiC,GAAG,EAAE,SAAS,OAAO,gBAAgB,EAChG,MAAM;CACJ,gBAAgB;CAChB,kBAAkB;CAClB,mBAAmB;AACrB,EACF,EAAE"}
@@ -1,10 +1,14 @@
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 { varsResolver } from "../button/button.utils.mjs";
5
+ import grid_module_default from "./grid.module.mjs";
3
6
  import grid_default from "./grid.mjs";
4
7
  import col_default from "./col/col.mjs";
5
8
  //#region packages/@cck-ui/core/src/components/grid/index.ts
6
- const CCol = withInstall(col_default);
7
- const CGrid = withInstall(grid_default, { Col: col_default });
9
+ const GridWithStatic = withPropsFactory(withExtend(withVarsResolver(withClasses(grid_default, grid_module_default), varsResolver)));
10
+ const CCol = withInstall(withPropsFactory(withExtend(withClasses(col_default, grid_module_default))));
11
+ const CGrid = withInstall(GridWithStatic, { Col: col_default });
8
12
  //#endregion
9
13
  export { CCol, CGrid, CGrid as default };
10
14
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["Col","Grid"],"sources":["../../../src/components/grid/index.ts"],"sourcesContent":["import { type SFCWithInstall, withInstall } from '../../core'\nimport Grid from './grid.vue'\nimport Col from './col/col.vue'\n\nexport const CCol: SFCWithInstall<typeof Col> = withInstall(Col)\nexport const CGrid: SFCWithInstall<typeof Grid> & { Col: typeof Col } = withInstall(Grid, { Col })\nexport default CGrid\n\nexport * from './col/col.types.js'\nexport * from './grid.types.js'\n"],"mappings":";;;;;AAIA,MAAa,OAAmC,YAAYA,WAAG;AAC/D,MAAa,QAA2D,YAAYC,cAAM,EAAE,KAAA,YAAI,CAAC"}
1
+ {"version":3,"file":"index.mjs","names":["Grid","classes","Col"],"sources":["../../../src/components/grid/index.ts"],"sourcesContent":["import {\n type SFCWithInstallAndClasses,\n withClasses,\n withExtend,\n withInstall,\n withPropsFactory,\n withVarsResolver,\n} from '../../core'\nimport Grid from './grid.vue'\nimport Col from './col/col.vue'\nimport classes from './grid.module.css'\nimport { varsResolver } from '../button/button.utils'\n\nconst GridWithStatic = withPropsFactory(\n withExtend(withVarsResolver(withClasses(Grid, classes), varsResolver))\n)\nconst ColWithStatic = withPropsFactory(withExtend(withClasses(Col, classes)))\n\nexport const CCol: SFCWithInstallAndClasses<typeof Col> = withInstall(ColWithStatic)\nexport const CGrid: SFCWithInstallAndClasses<typeof Grid, typeof classes> & { Col: typeof Col } =\n withInstall(GridWithStatic, { Col })\nexport default CGrid\n\nexport * from './col/col.types'\nexport * from './grid.types'\n"],"mappings":";;;;;;;;AAaA,MAAM,iBAAiB,iBACrB,WAAW,iBAAiB,YAAYA,cAAMC,mBAAO,GAAG,YAAY,CAAC,CACvE;AAGA,MAAa,OAA6C,YAFpC,iBAAiB,WAAW,YAAYC,aAAKD,mBAAO,CAAC,CAEL,CAAa;AACnF,MAAa,QACX,YAAY,gBAAgB,EAAE,KAAA,YAAI,CAAC"}
@@ -1,12 +1,13 @@
1
1
  "use client";
2
2
  import { getSpacing } from "../../core/utils/get-size/get-size.mjs";
3
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";
4
5
  import { CBox } from "../../core/box/index.mjs";
5
- import { createVarsResolver } from "../../core/styles-api/create-vars-resolver/create-vars-resolver.mjs";
6
6
  import { useStyles } from "../../core/styles-api/use-styles/use-styles.mjs";
7
7
  import { filterFalsyChildren } from "./filter-falsy-children/filter-falsy-children.mjs";
8
8
  import group_module_default from "./group.module.mjs";
9
- import { Fragment, computed, createBlock, createElementBlock, defineComponent, mergeProps, openBlock, renderList, resolveDynamicComponent, useSlots, withCtx } from "vue";
9
+ import { varsResolver } from "./group.utils.mjs";
10
+ import { Fragment, computed, createBlock, createElementBlock, defineComponent, mergeProps, openBlock, ref, renderList, resolveDynamicComponent, useAttrs, useSlots, withCtx } from "vue";
10
11
  //#region packages/@cck-ui/core/src/components/group/group.vue
11
12
  const _sfc_main = /*@__PURE__*/ defineComponent({
12
13
  name: "CGroup",
@@ -18,23 +19,19 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
18
19
  },
19
20
  justify: {
20
21
  type: null,
21
- required: false,
22
- default: "flex-start"
22
+ required: false
23
23
  },
24
24
  align: {
25
25
  type: null,
26
- required: false,
27
- default: "center"
26
+ required: false
28
27
  },
29
28
  wrap: {
30
29
  type: null,
31
- required: false,
32
- default: "wrap"
30
+ required: false
33
31
  },
34
32
  gap: {
35
33
  type: null,
36
- required: false,
37
- default: "md"
34
+ required: false
38
35
  },
39
36
  grow: {
40
37
  type: Boolean,
@@ -42,8 +39,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
42
39
  },
43
40
  preventGrowOverflow: {
44
41
  type: Boolean,
45
- required: false,
46
- default: true
42
+ required: false
47
43
  },
48
44
  className: {
49
45
  type: String,
@@ -332,69 +328,94 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
332
328
  }
333
329
  },
334
330
  setup(__props, { expose: __expose }) {
335
- __expose();
331
+ const _root = ref(null);
332
+ const attrs = useAttrs();
336
333
  const slots = useSlots();
337
- const props = __props;
338
- const { classNames, className, style, styles, unstyled, gap, align, justify, wrap, grow, preventGrowOverflow, vars, variant, __size, mod, attributes, ...others } = props;
334
+ const rawProps = __props;
335
+ const props = useComponentProps({
336
+ component: "CGroup",
337
+ defaultProps: {
338
+ preventGrowOverflow: true,
339
+ gap: "md",
340
+ align: "center",
341
+ justify: "flex-start",
342
+ wrap: "wrap"
343
+ },
344
+ props: rawProps
345
+ });
346
+ const knownProps = [
347
+ "classNames",
348
+ "className",
349
+ "style",
350
+ "styles",
351
+ "unstyled",
352
+ "gap",
353
+ "align",
354
+ "justify",
355
+ "wrap",
356
+ "grow",
357
+ "preventGrowOverflow",
358
+ "vars",
359
+ "variant",
360
+ "__size",
361
+ "mod",
362
+ "attributes"
363
+ ];
339
364
  const filteredChildren = filterFalsyChildren(slots.default?.());
340
365
  const childrenCount = filteredChildren.length;
341
- const resolvedGap = getSpacing(gap);
366
+ const resolvedGap = getSpacing(props.value.gap);
342
367
  const childWidth = `calc(${100 / childrenCount}% - (${resolvedGap} - ${resolvedGap} / ${childrenCount}))`;
343
368
  const stylesCtx = { childWidth };
344
- const varsResolver = createVarsResolver((_, { grow, preventGrowOverflow, gap, align, justify, wrap }, { childWidth }) => ({ root: {
345
- "--group-child-width": grow && preventGrowOverflow ? childWidth : void 0,
346
- "--group-gap": getSpacing(gap),
347
- "--group-align": align,
348
- "--group-justify": justify,
349
- "--group-wrap": wrap
350
- } }));
351
369
  const getStyles = useStyles({
352
370
  name: "Group",
353
- props,
371
+ props: {
372
+ ...props.value,
373
+ ...attrs
374
+ },
354
375
  stylesCtx,
355
- className,
356
- style,
376
+ className: props.value.className,
377
+ style: props.value.style,
357
378
  classes: group_module_default,
358
- classNames,
359
- styles,
360
- unstyled,
361
- attributes,
362
- vars,
379
+ classNames: props.value.classNames,
380
+ styles: props.value.styles,
381
+ unstyled: props.value.unstyled,
382
+ attributes: props.value.attributes,
383
+ vars: props.value.vars,
363
384
  varsResolver
364
385
  });
386
+ const modList = computed(() => [{ grow: props.value.grow }]);
365
387
  const rootAttrs = computed(() => getStyles("root"));
388
+ const mergedAttrs = computed(() => {
389
+ const others = {};
390
+ const propsValue = props.value;
391
+ Object.keys(propsValue).forEach((key) => {
392
+ if (!knownProps.includes(key)) others[key] = propsValue[key];
393
+ });
394
+ const userMod = props.value.mod;
395
+ const mergedMod = [...Array.isArray(userMod) ? userMod : [userMod].filter(Boolean), ...modList.value || []];
396
+ return {
397
+ ...others,
398
+ mod: mergedMod,
399
+ ...rootAttrs.value
400
+ };
401
+ });
402
+ __expose({ root: computed(() => _root.value?.root ?? null) });
366
403
  const __returned__ = {
404
+ _root,
405
+ attrs,
367
406
  slots,
407
+ rawProps,
368
408
  props,
369
- classNames,
370
- className,
371
- style,
372
- styles,
373
- unstyled,
374
- gap,
375
- align,
376
- justify,
377
- wrap,
378
- grow,
379
- preventGrowOverflow,
380
- vars,
381
- variant,
382
- __size,
383
- mod,
384
- attributes,
385
- others,
409
+ knownProps,
386
410
  filteredChildren,
387
411
  childrenCount,
388
412
  resolvedGap,
389
413
  childWidth,
390
414
  stylesCtx,
391
- varsResolver,
392
415
  getStyles,
416
+ modList,
393
417
  rootAttrs,
394
- mergedAttrs: computed(() => ({
395
- ...others,
396
- ...rootAttrs.value
397
- })),
418
+ mergedAttrs,
398
419
  get CBox() {
399
420
  return CBox;
400
421
  }
@@ -407,20 +428,15 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
407
428
  }
408
429
  });
409
430
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
410
- return openBlock(), createBlock($setup["CBox"], mergeProps($setup.mergedAttrs, {
411
- mod: [{ grow: $setup.grow }, $setup.mod],
412
- size: $setup.__size,
413
- variant: $setup.variant
431
+ return openBlock(), createBlock($setup["CBox"], mergeProps({ ref: "_root" }, $setup.mergedAttrs, {
432
+ size: $props.__size,
433
+ variant: $props.variant
414
434
  }), {
415
435
  default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList($setup.filteredChildren, (node, index) => {
416
436
  return openBlock(), createBlock(resolveDynamicComponent(node), { key: node.key || index });
417
437
  }), 128))]),
418
438
  _: 1
419
- }, 16, [
420
- "mod",
421
- "size",
422
- "variant"
423
- ]);
439
+ }, 16, ["size", "variant"]);
424
440
  }
425
441
  var group_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/cck-ui/cck-ui/packages/@cck-ui/core/src/components/group/group.vue"]]);
426
442
  //#endregion