@cck-ui/core 0.6.1 → 0.8.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 (53) hide show
  1. package/cjs/components/aspect-ratio/aspect-ratio.cjs +389 -0
  2. package/cjs/components/aspect-ratio/aspect-ratio.cjs.map +1 -0
  3. package/cjs/components/aspect-ratio/aspect-ratio.module.cjs +7 -0
  4. package/cjs/components/aspect-ratio/aspect-ratio.module.cjs.map +1 -0
  5. package/cjs/components/aspect-ratio/aspect-ratio.utils.cjs +7 -0
  6. package/cjs/components/aspect-ratio/aspect-ratio.utils.cjs.map +1 -0
  7. package/cjs/components/aspect-ratio/index.cjs +14 -0
  8. package/cjs/components/aspect-ratio/index.cjs.map +1 -0
  9. package/cjs/components/center/center.cjs +390 -0
  10. package/cjs/components/center/center.cjs.map +1 -0
  11. package/cjs/components/center/center.module.cjs +7 -0
  12. package/cjs/components/center/center.module.cjs.map +1 -0
  13. package/cjs/components/center/index.cjs +13 -0
  14. package/cjs/components/center/index.cjs.map +1 -0
  15. package/cjs/components/grid/grid.cjs +1 -1
  16. package/cjs/components/grid/grid.cjs.map +1 -1
  17. package/cjs/components/simple-grid/simple-grid.cjs +1 -1
  18. package/cjs/components/simple-grid/simple-grid.cjs.map +1 -1
  19. package/cjs/index.cjs +38 -34
  20. package/cjs/index.cjs.map +1 -1
  21. package/esm/components/aspect-ratio/aspect-ratio.mjs +389 -0
  22. package/esm/components/aspect-ratio/aspect-ratio.mjs.map +1 -0
  23. package/esm/components/aspect-ratio/aspect-ratio.module.mjs +7 -0
  24. package/esm/components/aspect-ratio/aspect-ratio.module.mjs.map +1 -0
  25. package/esm/components/aspect-ratio/aspect-ratio.utils.mjs +8 -0
  26. package/esm/components/aspect-ratio/aspect-ratio.utils.mjs.map +1 -0
  27. package/esm/components/aspect-ratio/index.mjs +11 -0
  28. package/esm/components/aspect-ratio/index.mjs.map +1 -0
  29. package/esm/components/center/center.mjs +390 -0
  30. package/esm/components/center/center.mjs.map +1 -0
  31. package/esm/components/center/center.module.mjs +7 -0
  32. package/esm/components/center/center.module.mjs.map +1 -0
  33. package/esm/components/center/index.mjs +10 -0
  34. package/esm/components/center/index.mjs.map +1 -0
  35. package/esm/components/grid/grid.mjs +1 -1
  36. package/esm/components/grid/grid.mjs.map +1 -1
  37. package/esm/components/simple-grid/simple-grid.mjs +1 -1
  38. package/esm/components/simple-grid/simple-grid.mjs.map +1 -1
  39. package/esm/index.mjs +3 -1
  40. package/esm/index.mjs.map +1 -1
  41. package/lib/components/aspect-ratio/aspect-ratio.types.d.ts +18 -0
  42. package/lib/components/aspect-ratio/aspect-ratio.utils.d.ts +6 -0
  43. package/lib/components/aspect-ratio/index.d.ts +6 -0
  44. package/lib/components/center/center.types.d.ts +14 -0
  45. package/lib/components/center/index.d.ts +6 -0
  46. package/lib/components/index.d.ts +2 -0
  47. package/package.json +1 -1
  48. package/styles/aspect-ratio.css +13 -0
  49. package/styles/aspect-ratio.layer.css +14 -0
  50. package/styles/center.css +9 -0
  51. package/styles/center.layer.css +10 -0
  52. package/styles.css +24 -0
  53. package/styles.layer.css +24 -0
@@ -0,0 +1,390 @@
1
+ "use client";
2
+ import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.mjs";
3
+ import { useComponentProps } from "../../core/config-provider/use-component-props/use-component-props.mjs";
4
+ import { CBox } from "../../core/box/index.mjs";
5
+ import { useStyles } from "../../core/styles-api/use-styles/use-styles.mjs";
6
+ import center_module_default from "./center.module.mjs";
7
+ import { computed, createBlock, defineComponent, mergeProps, openBlock, ref, renderSlot, useAttrs, withCtx } from "vue";
8
+ //#region packages/@cck-ui/core/src/components/center/center.vue
9
+ const _sfc_main = /*@__PURE__*/ defineComponent({
10
+ name: "CCenter",
11
+ __name: "center",
12
+ props: {
13
+ inline: {
14
+ type: Boolean,
15
+ required: false
16
+ },
17
+ className: {
18
+ type: String,
19
+ required: false
20
+ },
21
+ style: {
22
+ type: [
23
+ Object,
24
+ Function,
25
+ Array
26
+ ],
27
+ required: false,
28
+ skipCheck: true
29
+ },
30
+ __vars: {
31
+ type: null,
32
+ required: false
33
+ },
34
+ __size: {
35
+ type: String,
36
+ required: false
37
+ },
38
+ hiddenFrom: {
39
+ type: null,
40
+ required: false
41
+ },
42
+ visibleFrom: {
43
+ type: null,
44
+ required: false
45
+ },
46
+ lightHidden: {
47
+ type: Boolean,
48
+ required: false
49
+ },
50
+ darkHidden: {
51
+ type: Boolean,
52
+ required: false
53
+ },
54
+ mod: {
55
+ type: [
56
+ Object,
57
+ String,
58
+ Array
59
+ ],
60
+ required: false
61
+ },
62
+ m: {
63
+ type: null,
64
+ required: false
65
+ },
66
+ my: {
67
+ type: null,
68
+ required: false
69
+ },
70
+ mx: {
71
+ type: null,
72
+ required: false
73
+ },
74
+ mt: {
75
+ type: null,
76
+ required: false
77
+ },
78
+ mb: {
79
+ type: null,
80
+ required: false
81
+ },
82
+ ms: {
83
+ type: null,
84
+ required: false
85
+ },
86
+ me: {
87
+ type: null,
88
+ required: false
89
+ },
90
+ mis: {
91
+ type: null,
92
+ required: false
93
+ },
94
+ mie: {
95
+ type: null,
96
+ required: false
97
+ },
98
+ ml: {
99
+ type: null,
100
+ required: false
101
+ },
102
+ mr: {
103
+ type: null,
104
+ required: false
105
+ },
106
+ p: {
107
+ type: null,
108
+ required: false
109
+ },
110
+ py: {
111
+ type: null,
112
+ required: false
113
+ },
114
+ px: {
115
+ type: null,
116
+ required: false
117
+ },
118
+ pt: {
119
+ type: null,
120
+ required: false
121
+ },
122
+ pb: {
123
+ type: null,
124
+ required: false
125
+ },
126
+ ps: {
127
+ type: null,
128
+ required: false
129
+ },
130
+ pe: {
131
+ type: null,
132
+ required: false
133
+ },
134
+ pis: {
135
+ type: null,
136
+ required: false
137
+ },
138
+ pie: {
139
+ type: null,
140
+ required: false
141
+ },
142
+ pl: {
143
+ type: null,
144
+ required: false
145
+ },
146
+ pr: {
147
+ type: null,
148
+ required: false
149
+ },
150
+ bd: {
151
+ type: null,
152
+ required: false
153
+ },
154
+ bdrs: {
155
+ type: null,
156
+ required: false
157
+ },
158
+ bg: {
159
+ type: null,
160
+ required: false
161
+ },
162
+ c: {
163
+ type: null,
164
+ required: false
165
+ },
166
+ opacity: {
167
+ type: [
168
+ String,
169
+ Object,
170
+ Number
171
+ ],
172
+ required: false
173
+ },
174
+ ff: {
175
+ type: [String, Object],
176
+ required: false
177
+ },
178
+ fz: {
179
+ type: null,
180
+ required: false
181
+ },
182
+ fw: {
183
+ type: null,
184
+ required: false
185
+ },
186
+ lts: {
187
+ type: null,
188
+ required: false
189
+ },
190
+ ta: {
191
+ type: [String, Object],
192
+ required: false
193
+ },
194
+ lh: {
195
+ type: null,
196
+ required: false
197
+ },
198
+ fs: {
199
+ type: null,
200
+ required: false
201
+ },
202
+ tt: {
203
+ type: [String, Object],
204
+ required: false
205
+ },
206
+ td: {
207
+ type: null,
208
+ required: false
209
+ },
210
+ w: {
211
+ type: null,
212
+ required: false
213
+ },
214
+ miw: {
215
+ type: null,
216
+ required: false
217
+ },
218
+ maw: {
219
+ type: null,
220
+ required: false
221
+ },
222
+ h: {
223
+ type: null,
224
+ required: false
225
+ },
226
+ mih: {
227
+ type: null,
228
+ required: false
229
+ },
230
+ mah: {
231
+ type: null,
232
+ required: false
233
+ },
234
+ bgsz: {
235
+ type: null,
236
+ required: false
237
+ },
238
+ bgp: {
239
+ type: null,
240
+ required: false
241
+ },
242
+ bgr: {
243
+ type: null,
244
+ required: false
245
+ },
246
+ bga: {
247
+ type: null,
248
+ required: false
249
+ },
250
+ pos: {
251
+ type: [String, Object],
252
+ required: false
253
+ },
254
+ top: {
255
+ type: null,
256
+ required: false
257
+ },
258
+ left: {
259
+ type: null,
260
+ required: false
261
+ },
262
+ bottom: {
263
+ type: null,
264
+ required: false
265
+ },
266
+ right: {
267
+ type: null,
268
+ required: false
269
+ },
270
+ inset: {
271
+ type: null,
272
+ required: false
273
+ },
274
+ display: {
275
+ type: null,
276
+ required: false
277
+ },
278
+ flex: {
279
+ type: null,
280
+ required: false
281
+ },
282
+ unstyled: {
283
+ type: Boolean,
284
+ required: false
285
+ },
286
+ variant: {
287
+ type: null,
288
+ required: false
289
+ },
290
+ classNames: {
291
+ type: null,
292
+ required: false
293
+ },
294
+ styles: {
295
+ type: null,
296
+ required: false
297
+ },
298
+ vars: {
299
+ type: Function,
300
+ required: false
301
+ },
302
+ attributes: {
303
+ type: null,
304
+ required: false
305
+ }
306
+ },
307
+ setup(__props, { expose: __expose }) {
308
+ const _root = ref(null);
309
+ const attrs = useAttrs();
310
+ const rawProps = __props;
311
+ const props = useComponentProps({
312
+ component: "CCenter",
313
+ defaultProps: {},
314
+ props: rawProps
315
+ });
316
+ const knownProps = [
317
+ "classNames",
318
+ "className",
319
+ "style",
320
+ "styles",
321
+ "unstyled",
322
+ "vars",
323
+ "inline",
324
+ "mod",
325
+ "attributes"
326
+ ];
327
+ const getStyles = useStyles({
328
+ name: "Center",
329
+ props: {
330
+ ...props.value,
331
+ ...attrs
332
+ },
333
+ classes: center_module_default,
334
+ className: props.value.className,
335
+ style: props.value.style,
336
+ classNames: props.value.classNames,
337
+ styles: props.value.styles,
338
+ unstyled: props.value.unstyled,
339
+ attributes: props.value.attributes,
340
+ vars: props.value.vars
341
+ });
342
+ const modList = computed(() => [{ inline: props.value.inline }]);
343
+ const rootAttrs = computed(() => getStyles("root"));
344
+ const mergedAttrs = computed(() => {
345
+ const others = {};
346
+ const propsValue = props.value;
347
+ Object.keys(propsValue).forEach((key) => {
348
+ if (!knownProps.includes(key)) others[key] = propsValue[key];
349
+ });
350
+ const userMod = props.value.mod;
351
+ const mergedMod = [...Array.isArray(userMod) ? userMod : [userMod].filter(Boolean), ...modList.value || []];
352
+ return {
353
+ ...others,
354
+ mod: mergedMod,
355
+ ...rootAttrs.value
356
+ };
357
+ });
358
+ __expose({ root: computed(() => _root.value?.root ?? null) });
359
+ const __returned__ = {
360
+ _root,
361
+ attrs,
362
+ rawProps,
363
+ props,
364
+ knownProps,
365
+ getStyles,
366
+ modList,
367
+ rootAttrs,
368
+ mergedAttrs,
369
+ get CBox() {
370
+ return CBox;
371
+ }
372
+ };
373
+ Object.defineProperty(__returned__, "__isScriptSetup", {
374
+ enumerable: false,
375
+ value: true
376
+ });
377
+ return __returned__;
378
+ }
379
+ });
380
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
381
+ return openBlock(), createBlock($setup["CBox"], mergeProps({ ref: "_root" }, $setup.mergedAttrs), {
382
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
383
+ _: 3
384
+ }, 16);
385
+ }
386
+ var center_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/cck-ui/cck-ui/packages/@cck-ui/core/src/components/center/center.vue"]]);
387
+ //#endregion
388
+ export { center_default as default };
389
+
390
+ //# sourceMappingURL=center.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"center.mjs","names":[],"sources":["../../../src/components/center/center.vue"],"sourcesContent":["<template>\n <c-box ref=\"_root\" v-bind=\"mergedAttrs\">\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { CenterFactory, CenterProps } from './center.types'\nimport { CBox, useComponentProps, useStyles } from '../../core'\nimport classes from './center.module.css'\n\ndefineOptions({\n name: 'CCenter',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<CenterProps>()\n\nconst props = useComponentProps({\n component: 'CCenter',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'inline',\n 'mod',\n 'attributes',\n]\n\nconst getStyles = useStyles<CenterFactory>({\n name: 'Center',\n props: { ...props.value, ...attrs } as CenterProps,\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})\n\nconst modList = computed(() => [{ inline: props.value.inline }])\n\nconst rootAttrs = computed(() => getStyles('root'))\n\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n Object.keys(propsValue).forEach((key) => {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n })\n const userMod = props.value.mod\n const mergedMod = [\n ...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)),\n ...(modList.value || []),\n ]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBA,MAAM,QAAQ,IAAsC,IAAI;EAExD,MAAM,QAAQ,SAAS;EAEvB,MAAM,WAAW;EAEjB,MAAM,QAAQ,kBAAkB;GAC9B,WAAW;GACX,cAAc,CAAC;GACf,OAAO;EACT,CAAC;EAED,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,YAAY,UAAyB;GACzC,MAAM;GACN,OAAO;IAAE,GAAG,MAAM;IAAO,GAAG;GAAM;GAClC,SAAA;GACA,WAAW,MAAM,MAAM;GACvB,OAAO,MAAM,MAAM;GACnB,YAAY,MAAM,MAAM;GACxB,QAAQ,MAAM,MAAM;GACpB,UAAU,MAAM,MAAM;GACtB,YAAY,MAAM,MAAM;GACxB,MAAM,MAAM,MAAM;EACpB,CAAC;EAED,MAAM,UAAU,eAAe,CAAC,EAAE,QAAQ,MAAM,MAAM,OAAO,CAAC,CAAC;EAE/D,MAAM,YAAY,eAAe,UAAU,MAAM,CAAC;EAElD,MAAM,cAAc,eAAe;GACjC,MAAM,SAA8B,CAAC;GACrC,MAAM,aAAa,MAAM;GACzB,OAAO,KAAK,UAAU,CAAC,CAAC,SAAS,QAAQ;IACvC,IAAI,CAAC,WAAW,SAAS,GAAG,GAC1B,OAAO,OAAO,WAAW;GAE7B,CAAC;GACD,MAAM,UAAU,MAAM,MAAM;GAC5B,MAAM,YAAY,CAChB,GAAI,MAAM,QAAQ,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,OAAO,GAC/D,GAAI,QAAQ,SAAS,CAAC,CACxB;GACA,OAAO;IAAE,GAAG;IAAQ,KAAK;IAAW,GAAG,UAAU;GAAM;EACzD,CAAC;EAED,SAAa,EACX,MAAM,eAAe,MAAM,OAAO,QAAQ,IAAI,EAChD,CAAC;;;;;;;;;;;;;;;;;;;;;;;qBA1EC,YAEQ,OAAA,SAFR,WAEQ,EAFD,KAAI,QAAO,GAAS,OAAA,WAAW,GAAA;yBAC5B,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ //#region packages/@cck-ui/core/src/components/center/center.module.css
3
+ var center_module_default = { "root": "m_e0e8435a" };
4
+ //#endregion
5
+ export { center_module_default as default };
6
+
7
+ //# sourceMappingURL=center.module.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"center.module.mjs","names":[],"sources":["../../../src/components/center/center.module.css"],"sourcesContent":[".root {\n display: flex;\n align-items: center;\n justify-content: center;\n\n &:where([data-inline]) {\n display: inline-flex;\n }\n}\n"],"mappings":";;AAAA,IAAA,wBAAe,EAAC,QAAO,aAAY"}
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import { withInstall } from "../../core/utils/vue/install.mjs";
3
+ import { withClasses, withExtend, withPropsFactory } from "../../core/utils/vue/statics.mjs";
4
+ import center_module_default from "./center.module.mjs";
5
+ import center_default from "./center.mjs";
6
+ const CCenter = withInstall(withPropsFactory(withExtend(withClasses(center_default, center_module_default))));
7
+ //#endregion
8
+ export { CCenter, CCenter as default };
9
+
10
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["Center","classes"],"sources":["../../../src/components/center/index.ts"],"sourcesContent":["import {\n SFCWithInstallAndClasses,\n withClasses,\n withExtend,\n withInstall,\n withPropsFactory,\n} from '../../core'\nimport Center from './center.vue'\nimport classes from './center.module.css'\n\nconst CenterWithStatic = withPropsFactory(withExtend(withClasses(Center, classes)))\n\nexport const CCenter: SFCWithInstallAndClasses<typeof Center, typeof classes> =\n withInstall(CenterWithStatic)\n\nexport default CCenter\n\nexport * from './center.types'\n"],"mappings":";;;;;AAYA,MAAa,UACX,YAHuB,iBAAiB,WAAW,YAAYA,gBAAQC,qBAAO,CAAC,CAGnE,CAAgB"}
@@ -414,7 +414,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
414
414
  const containerAttrs = computed(() => getStyles("container"));
415
415
  const gridStyle = useGridCustomStyle({
416
416
  selector: responsiveClassname,
417
- ...props
417
+ ...props.value
418
418
  });
419
419
  const currentStyleKey = ref(null);
420
420
  watchEffect(() => {
@@ -1 +1 @@
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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AEA,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"}
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.value,\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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,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"}
@@ -389,7 +389,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
389
389
  const containerAttrs = computed(() => getStyles("container"));
390
390
  const gridStyle = useSimpleGridStyle({
391
391
  selector: responsiveClassname,
392
- ...props
392
+ ...props.value
393
393
  });
394
394
  const currentStyleKey = ref(null);
395
395
  watchEffect(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"simple-grid.mjs","names":[],"sources":["../../../src/components/simple-grid/simple-grid.vue"],"sourcesContent":["<template>\n <c-box ref=\"_container\" v-if=\"type === 'container'\" v-bind=\"containerAttrs\">\n <c-box ref=\"_root\" v-bind=\"mergedRootAttrs\" :data-auto-cols=\"autoColsAttr\">\n <slot />\n </c-box>\n </c-box>\n <template v-else>\n <c-box ref=\"_root\" v-bind=\"mergedRootAttrs\" :data-auto-cols=\"autoColsAttr\">\n <slot />\n </c-box>\n </template>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, onUnmounted, ref, useAttrs, watchEffect } from 'vue'\nimport {\n CBox,\n responsiveStyleManager,\n useComponentProps,\n useRandomClassName,\n useStyles,\n} from '../../core'\nimport type { SimpleGridFactory, SimpleGridProps } from './simple-grid.types'\nimport classes from './simple-grid.module.css'\nimport { useSimpleGridStyle } from './simple-grid-custom'\n\ndefineOptions({\n name: 'CSimpleGrid',\n})\n\nconst _container = ref<InstanceType<typeof CBox> | null>(null)\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<SimpleGridProps>()\n\nconst props = useComponentProps({\n component: 'CSimpleGrid',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'cols',\n 'verticalSpacing',\n 'spacing',\n 'type',\n 'minColWidth',\n 'autoFlow',\n 'autoRows',\n 'attributes',\n]\n\nconst getStyles = useStyles<SimpleGridFactory>({\n name: 'SimpleGrid',\n classes,\n props: { ...props.value, ...attrs } as SimpleGridProps,\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})\n\nconst responsiveClassname = useRandomClassName()\n\nconst autoColsAttr =\n props.value.minColWidth !== undefined ? props.value.autoFlow || 'auto-fill' : undefined\n\nconst rootAttrs = computed(() => getStyles('root', { className: responsiveClassname }))\nconst mergedRootAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n const userMod = props.value.mod\n const mergedMod = [...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean))]\n return { ...others, ...rootAttrs.value }\n})\n\nconst containerAttrs = computed(() => getStyles('container'))\n\nconst gridStyle = useSimpleGridStyle({\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\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n container: computed(() => _container.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BA,MAAM,aAAa,IAAsC,IAAI;EAC7D,MAAM,QAAQ,IAAsC,IAAI;EAExD,MAAM,QAAQ,SAAS;EAEvB,MAAM,WAAW;EAEjB,MAAM,QAAQ,kBAAkB;GAC9B,WAAW;GACX,cAAc,CAAC;GACf,OAAO;EACT,CAAC;EAED,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,YAAY,UAA6B;GAC7C,MAAM;GACN,SAAA;GACA,OAAO;IAAE,GAAG,MAAM;IAAO,GAAG;GAAM;GAClC,WAAW,MAAM,MAAM;GACvB,OAAO,MAAM,MAAM;GACnB,YAAY,MAAM,MAAM;GAC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AAW,OAAO,QAAQ,IAAI;EAC1D,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAzH+B,OAAA,SAAI,eAAA,UAAA,GAAlC,YAIQ,OAAA,SAJR,WAIQ;;EAJD,KAAI;IAAiD,OAAA,cAAc,GAAA;yBAGhE,CAFR,YAEQ,OAAA,SAFR,WAEQ,EAFD,KAAI,QAAO,GAAS,OAAA,iBAAe,EAAG,kBAAgB,OAAA,aAAY,CAAA,GAAA;0BAC/D,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA;;;;yBAIV,YAEQ,OAAA,SAFR,WAEQ;;EAFD,KAAI;IAAgB,OAAA,iBAAe,EAAG,kBAAgB,OAAA,aAAY,CAAA,GAAA;yBAC/D,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"simple-grid.mjs","names":[],"sources":["../../../src/components/simple-grid/simple-grid.vue"],"sourcesContent":["<template>\n <c-box ref=\"_container\" v-if=\"type === 'container'\" v-bind=\"containerAttrs\">\n <c-box ref=\"_root\" v-bind=\"mergedRootAttrs\" :data-auto-cols=\"autoColsAttr\">\n <slot />\n </c-box>\n </c-box>\n <template v-else>\n <c-box ref=\"_root\" v-bind=\"mergedRootAttrs\" :data-auto-cols=\"autoColsAttr\">\n <slot />\n </c-box>\n </template>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, onUnmounted, ref, useAttrs, watchEffect } from 'vue'\nimport {\n CBox,\n responsiveStyleManager,\n useComponentProps,\n useRandomClassName,\n useStyles,\n} from '../../core'\nimport type { SimpleGridFactory, SimpleGridProps } from './simple-grid.types'\nimport classes from './simple-grid.module.css'\nimport { useSimpleGridStyle } from './simple-grid-custom'\n\ndefineOptions({\n name: 'CSimpleGrid',\n})\n\nconst _container = ref<InstanceType<typeof CBox> | null>(null)\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<SimpleGridProps>()\n\nconst props = useComponentProps({\n component: 'CSimpleGrid',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'cols',\n 'verticalSpacing',\n 'spacing',\n 'type',\n 'minColWidth',\n 'autoFlow',\n 'autoRows',\n 'attributes',\n]\n\nconst getStyles = useStyles<SimpleGridFactory>({\n name: 'SimpleGrid',\n classes,\n props: { ...props.value, ...attrs } as SimpleGridProps,\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})\n\nconst responsiveClassname = useRandomClassName()\n\nconst autoColsAttr =\n props.value.minColWidth !== undefined ? props.value.autoFlow || 'auto-fill' : undefined\n\nconst rootAttrs = computed(() => getStyles('root', { className: responsiveClassname }))\nconst mergedRootAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n const userMod = props.value.mod\n const mergedMod = [...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean))]\n return { ...others, ...rootAttrs.value }\n})\n\nconst containerAttrs = computed(() => getStyles('container'))\n\nconst gridStyle = useSimpleGridStyle({\n selector: responsiveClassname,\n ...props.value,\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\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n container: comput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AAA,CAAA;;;;yBAIV,YAEQ,OAAA,SAFR,WAEQ;;EAFD,KAAI;IAAgB,OAAA,iBAAe,EAAG,kBAAgB,OAAA,aAAY,CAAA,GAAA;yBAC/D,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
package/esm/index.mjs CHANGED
@@ -50,12 +50,14 @@ import { resolveClassNames } from "./core/styles-api/use-styles/get-class-name/r
50
50
  import { resolveStyles } from "./core/styles-api/use-styles/get-style/resolve-styles/resolve-styles.mjs";
51
51
  import { FOCUS_CLASS_NAMES } from "./core/styles-api/use-styles/get-class-name/get-global-class-names/get-global-class-names.mjs";
52
52
  import { useStyles } from "./core/styles-api/use-styles/use-styles.mjs";
53
+ import { CAspectRatio } from "./components/aspect-ratio/index.mjs";
53
54
  import { UnstyledButton } from "./components/unstyled-button/index.mjs";
54
55
  import { CDefaultLoaders, CLoader } from "./components/loader/index.mjs";
55
56
  import { transitions } from "./components/transition/transitions.mjs";
56
57
  import { getTransitionProps } from "./components/transition/get-transition-props/get-transition-props.mjs";
57
58
  import { CTransition } from "./components/transition/index.mjs";
58
59
  import { CButton, CButtonGroup, CButtonGroupSection } from "./components/button/index.mjs";
60
+ import { CCenter } from "./components/center/index.mjs";
59
61
  import { CCol, CGrid } from "./components/grid/index.mjs";
60
62
  import { CGroup } from "./components/group/index.mjs";
61
63
  import { CSimpleGrid } from "./components/simple-grid/index.mjs";
@@ -87,6 +89,6 @@ const CckUI = { install(app) {
87
89
  });
88
90
  } };
89
91
  //#endregion
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 };
92
+ export { CAspectRatio, CBox, CButton, CButtonGroup, CButtonGroupSection, transitions as CCK_TRANSITIONS, CCenter, 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 };
91
93
 
92
94
  //# 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 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"}
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,18 @@
1
+ import { BoxProps, ElementProps, Factory, StylesApiProps } from '../../core';
2
+ export type AspectRatioStylesNames = 'root';
3
+ export type AspectRatioCssVariables = {
4
+ root: '--ar-ratio';
5
+ };
6
+ export interface AspectRatioProps extends BoxProps, StylesApiProps<AspectRatioFactory>, /* @vue-ignore */ ElementProps<'div'> {
7
+ /**
8
+ * @description Aspect ratio, for example, `16 / 9`, `4 / 3`, `1920 / 1080`
9
+ * @default 1
10
+ */
11
+ ratio?: number;
12
+ }
13
+ export type AspectRatioFactory = Factory<{
14
+ props: AspectRatioProps;
15
+ ref: HTMLDivElement;
16
+ stylesNames: AspectRatioStylesNames;
17
+ vars: AspectRatioCssVariables;
18
+ }>;
@@ -0,0 +1,6 @@
1
+ export declare const varsResolver: import("../..").VarsResolver<{
2
+ props: import("./aspect-ratio.types").AspectRatioProps;
3
+ ref: HTMLDivElement;
4
+ stylesNames: import("./aspect-ratio.types").AspectRatioStylesNames;
5
+ vars: import("./aspect-ratio.types").AspectRatioCssVariables;
6
+ }>;
@@ -0,0 +1,6 @@
1
+ import AspectRatio from './aspect-ratio.vue';
2
+ import classes from './aspect-ratio.module.css';
3
+ import { SFCWithInstallAndClasses } from '../../core';
4
+ export declare const CAspectRatio: SFCWithInstallAndClasses<typeof AspectRatio, typeof classes>;
5
+ export default CAspectRatio;
6
+ export * from './aspect-ratio.types';
@@ -0,0 +1,14 @@
1
+ import { BoxProps, PolymorphicFactory, StylesApiProps } from '../../core';
2
+ export type CenterStylesNames = 'root';
3
+ export interface CenterProps extends BoxProps, StylesApiProps<CenterFactory> {
4
+ /**
5
+ * @description If set, `inline-flex` is used instead of `flex`
6
+ */
7
+ inline?: boolean;
8
+ }
9
+ export type CenterFactory = PolymorphicFactory<{
10
+ props: CenterProps;
11
+ defaultRef: HTMLDivElement;
12
+ defaultComponent: 'div';
13
+ stylesNames: CenterStylesNames;
14
+ }>;
@@ -0,0 +1,6 @@
1
+ import { SFCWithInstallAndClasses } from '../../core';
2
+ import Center from './center.vue';
3
+ import classes from './center.module.css';
4
+ export declare const CCenter: SFCWithInstallAndClasses<typeof Center, typeof classes>;
5
+ export default CCenter;
6
+ export * from './center.types';
@@ -1,4 +1,6 @@
1
+ export * from './aspect-ratio';
1
2
  export * from './button';
3
+ export * from './center';
2
4
  export * from './grid';
3
5
  export * from './group';
4
6
  export * from './loader';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cck-ui/core",
3
- "version": "0.6.1",
3
+ "version": "0.8.0",
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,13 @@
1
+ .m_31f351f9 {
2
+ --ar-ratio: 1;
3
+ max-width: 100%;
4
+ }
5
+
6
+ .m_31f351f9 > :where(*:not(style)) {
7
+ aspect-ratio: var(--ar-ratio);
8
+ width: 100%;
9
+ }
10
+
11
+ .m_31f351f9 > :where(img, video) {
12
+ object-fit: cover;
13
+ }
@@ -0,0 +1,14 @@
1
+ @layer cck {.m_31f351f9 {
2
+ --ar-ratio: 1;
3
+ max-width: 100%;
4
+ }
5
+
6
+ .m_31f351f9 > :where(*:not(style)) {
7
+ aspect-ratio: var(--ar-ratio);
8
+ width: 100%;
9
+ }
10
+
11
+ .m_31f351f9 > :where(img, video) {
12
+ object-fit: cover;
13
+ }
14
+ }
@@ -0,0 +1,9 @@
1
+ .m_e0e8435a {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ }
6
+
7
+ .m_e0e8435a:where([data-inline]) {
8
+ display: inline-flex;
9
+ }