@cck-ui/core 0.27.0 → 0.29.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 (61) hide show
  1. package/cjs/components/affix/affix.cjs +461 -0
  2. package/cjs/components/affix/affix.cjs.map +1 -0
  3. package/cjs/components/affix/affix.module.cjs +7 -0
  4. package/cjs/components/affix/affix.module.cjs.map +1 -0
  5. package/cjs/components/affix/affix.utils.cjs +14 -0
  6. package/cjs/components/affix/affix.utils.cjs.map +1 -0
  7. package/cjs/components/affix/index.cjs +14 -0
  8. package/cjs/components/affix/index.cjs.map +1 -0
  9. package/cjs/components/burger/burger.cjs +435 -0
  10. package/cjs/components/burger/burger.cjs.map +1 -0
  11. package/cjs/components/burger/burger.module.cjs +10 -0
  12. package/cjs/components/burger/burger.module.cjs.map +1 -0
  13. package/cjs/components/burger/burger.utils.cjs +16 -0
  14. package/cjs/components/burger/burger.utils.cjs.map +1 -0
  15. package/cjs/components/burger/index.cjs +14 -0
  16. package/cjs/components/burger/index.cjs.map +1 -0
  17. package/cjs/components/portal/portal.cjs +10 -3
  18. package/cjs/components/portal/portal.cjs.map +1 -1
  19. package/cjs/core/utils/get-default-z-index/get-default-z-index.cjs +16 -0
  20. package/cjs/core/utils/get-default-z-index/get-default-z-index.cjs.map +1 -0
  21. package/cjs/index.cjs +108 -100
  22. package/cjs/index.cjs.map +1 -1
  23. package/esm/components/affix/affix.mjs +459 -0
  24. package/esm/components/affix/affix.mjs.map +1 -0
  25. package/esm/components/affix/affix.module.mjs +7 -0
  26. package/esm/components/affix/affix.module.mjs.map +1 -0
  27. package/esm/components/affix/affix.utils.mjs +15 -0
  28. package/esm/components/affix/affix.utils.mjs.map +1 -0
  29. package/esm/components/affix/index.mjs +11 -0
  30. package/esm/components/affix/index.mjs.map +1 -0
  31. package/esm/components/burger/burger.mjs +435 -0
  32. package/esm/components/burger/burger.mjs.map +1 -0
  33. package/esm/components/burger/burger.module.mjs +10 -0
  34. package/esm/components/burger/burger.module.mjs.map +1 -0
  35. package/esm/components/burger/burger.utils.mjs +17 -0
  36. package/esm/components/burger/burger.utils.mjs.map +1 -0
  37. package/esm/components/burger/index.mjs +11 -0
  38. package/esm/components/burger/index.mjs.map +1 -0
  39. package/esm/components/portal/portal.mjs +11 -4
  40. package/esm/components/portal/portal.mjs.map +1 -1
  41. package/esm/core/utils/get-default-z-index/get-default-z-index.mjs +16 -0
  42. package/esm/core/utils/get-default-z-index/get-default-z-index.mjs.map +1 -0
  43. package/esm/index.mjs +7 -2
  44. package/esm/index.mjs.map +1 -1
  45. package/lib/components/affix/affix.types.d.ts +40 -0
  46. package/lib/components/affix/affix.utils.d.ts +6 -0
  47. package/lib/components/affix/index.d.ts +6 -0
  48. package/lib/components/burger/burger.types.d.ts +40 -0
  49. package/lib/components/burger/burger.utils.d.ts +6 -0
  50. package/lib/components/burger/index.d.ts +6 -0
  51. package/lib/components/index.d.ts +2 -0
  52. package/lib/components/portal/portal.types.d.ts +9 -0
  53. package/lib/core/utils/get-default-z-index/get-default-z-index.d.ts +9 -0
  54. package/lib/core/utils/index.d.ts +1 -0
  55. package/package.json +1 -1
  56. package/styles/affix.css +8 -0
  57. package/styles/affix.layer.css +9 -0
  58. package/styles/burger.css +68 -0
  59. package/styles/burger.layer.css +69 -0
  60. package/styles.css +78 -0
  61. package/styles.layer.css +78 -0
@@ -0,0 +1,435 @@
1
+ "use client";
2
+ const require_export_helper = require("../../_virtual/_/plugin-vue/export-helper.cjs");
3
+ const require_use_component_props = require("../../core/config-provider/use-component-props/use-component-props.cjs");
4
+ const require_index = require("../../core/box/index.cjs");
5
+ const require_use_styles = require("../../core/styles-api/use-styles/use-styles.cjs");
6
+ const require_index$1 = require("../unstyled-button/index.cjs");
7
+ const require_burger_module = require("./burger.module.cjs");
8
+ const require_burger_utils = require("./burger.utils.cjs");
9
+ let vue = require("vue");
10
+ //#region packages/@cck-ui/core/src/components/burger/burger.vue
11
+ const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
12
+ name: "CBurger",
13
+ __name: "burger",
14
+ props: {
15
+ size: {
16
+ type: [
17
+ String,
18
+ Object,
19
+ Number
20
+ ],
21
+ required: false
22
+ },
23
+ lineSize: {
24
+ type: [String, Number],
25
+ required: false
26
+ },
27
+ color: {
28
+ type: null,
29
+ required: false
30
+ },
31
+ opened: {
32
+ type: Boolean,
33
+ required: false
34
+ },
35
+ transitionDuration: {
36
+ type: Number,
37
+ required: false
38
+ },
39
+ transitionTimingFunction: {
40
+ type: String,
41
+ required: false
42
+ },
43
+ className: {
44
+ type: String,
45
+ required: false
46
+ },
47
+ style: {
48
+ type: [
49
+ Object,
50
+ Function,
51
+ Array
52
+ ],
53
+ required: false,
54
+ skipCheck: true
55
+ },
56
+ __vars: {
57
+ type: null,
58
+ required: false
59
+ },
60
+ __size: {
61
+ type: String,
62
+ required: false
63
+ },
64
+ hiddenFrom: {
65
+ type: null,
66
+ required: false
67
+ },
68
+ visibleFrom: {
69
+ type: null,
70
+ required: false
71
+ },
72
+ lightHidden: {
73
+ type: Boolean,
74
+ required: false
75
+ },
76
+ darkHidden: {
77
+ type: Boolean,
78
+ required: false
79
+ },
80
+ mod: {
81
+ type: [
82
+ Object,
83
+ String,
84
+ Array
85
+ ],
86
+ required: false
87
+ },
88
+ m: {
89
+ type: null,
90
+ required: false
91
+ },
92
+ my: {
93
+ type: null,
94
+ required: false
95
+ },
96
+ mx: {
97
+ type: null,
98
+ required: false
99
+ },
100
+ mt: {
101
+ type: null,
102
+ required: false
103
+ },
104
+ mb: {
105
+ type: null,
106
+ required: false
107
+ },
108
+ ms: {
109
+ type: null,
110
+ required: false
111
+ },
112
+ me: {
113
+ type: null,
114
+ required: false
115
+ },
116
+ mis: {
117
+ type: null,
118
+ required: false
119
+ },
120
+ mie: {
121
+ type: null,
122
+ required: false
123
+ },
124
+ ml: {
125
+ type: null,
126
+ required: false
127
+ },
128
+ mr: {
129
+ type: null,
130
+ required: false
131
+ },
132
+ p: {
133
+ type: null,
134
+ required: false
135
+ },
136
+ py: {
137
+ type: null,
138
+ required: false
139
+ },
140
+ px: {
141
+ type: null,
142
+ required: false
143
+ },
144
+ pt: {
145
+ type: null,
146
+ required: false
147
+ },
148
+ pb: {
149
+ type: null,
150
+ required: false
151
+ },
152
+ ps: {
153
+ type: null,
154
+ required: false
155
+ },
156
+ pe: {
157
+ type: null,
158
+ required: false
159
+ },
160
+ pis: {
161
+ type: null,
162
+ required: false
163
+ },
164
+ pie: {
165
+ type: null,
166
+ required: false
167
+ },
168
+ pl: {
169
+ type: null,
170
+ required: false
171
+ },
172
+ pr: {
173
+ type: null,
174
+ required: false
175
+ },
176
+ bd: {
177
+ type: null,
178
+ required: false
179
+ },
180
+ bdrs: {
181
+ type: null,
182
+ required: false
183
+ },
184
+ bg: {
185
+ type: null,
186
+ required: false
187
+ },
188
+ c: {
189
+ type: null,
190
+ required: false
191
+ },
192
+ opacity: {
193
+ type: [
194
+ String,
195
+ Object,
196
+ Number
197
+ ],
198
+ required: false
199
+ },
200
+ ff: {
201
+ type: [String, Object],
202
+ required: false
203
+ },
204
+ fz: {
205
+ type: null,
206
+ required: false
207
+ },
208
+ fw: {
209
+ type: null,
210
+ required: false
211
+ },
212
+ lts: {
213
+ type: null,
214
+ required: false
215
+ },
216
+ ta: {
217
+ type: [String, Object],
218
+ required: false
219
+ },
220
+ lh: {
221
+ type: null,
222
+ required: false
223
+ },
224
+ fs: {
225
+ type: null,
226
+ required: false
227
+ },
228
+ tt: {
229
+ type: [String, Object],
230
+ required: false
231
+ },
232
+ td: {
233
+ type: null,
234
+ required: false
235
+ },
236
+ w: {
237
+ type: null,
238
+ required: false
239
+ },
240
+ miw: {
241
+ type: null,
242
+ required: false
243
+ },
244
+ maw: {
245
+ type: null,
246
+ required: false
247
+ },
248
+ h: {
249
+ type: null,
250
+ required: false
251
+ },
252
+ mih: {
253
+ type: null,
254
+ required: false
255
+ },
256
+ mah: {
257
+ type: null,
258
+ required: false
259
+ },
260
+ bgsz: {
261
+ type: null,
262
+ required: false
263
+ },
264
+ bgp: {
265
+ type: null,
266
+ required: false
267
+ },
268
+ bgr: {
269
+ type: null,
270
+ required: false
271
+ },
272
+ bga: {
273
+ type: null,
274
+ required: false
275
+ },
276
+ pos: {
277
+ type: [String, Object],
278
+ required: false
279
+ },
280
+ top: {
281
+ type: null,
282
+ required: false
283
+ },
284
+ left: {
285
+ type: null,
286
+ required: false
287
+ },
288
+ bottom: {
289
+ type: null,
290
+ required: false
291
+ },
292
+ right: {
293
+ type: null,
294
+ required: false
295
+ },
296
+ inset: {
297
+ type: null,
298
+ required: false
299
+ },
300
+ display: {
301
+ type: null,
302
+ required: false
303
+ },
304
+ flex: {
305
+ type: null,
306
+ required: false
307
+ },
308
+ unstyled: {
309
+ type: Boolean,
310
+ required: false
311
+ },
312
+ variant: {
313
+ type: null,
314
+ required: false
315
+ },
316
+ classNames: {
317
+ type: null,
318
+ required: false
319
+ },
320
+ styles: {
321
+ type: null,
322
+ required: false
323
+ },
324
+ vars: {
325
+ type: Function,
326
+ required: false
327
+ },
328
+ attributes: {
329
+ type: null,
330
+ required: false
331
+ }
332
+ },
333
+ setup(__props, { expose: __expose }) {
334
+ const _root = (0, vue.ref)(null);
335
+ const attrs = (0, vue.useAttrs)();
336
+ const rawProps = __props;
337
+ const props = require_use_component_props.useComponentProps({
338
+ component: "CBurger",
339
+ defaultProps: {},
340
+ props: rawProps
341
+ });
342
+ const knownProps = [
343
+ "classNames",
344
+ "className",
345
+ "style",
346
+ "styles",
347
+ "unstyled",
348
+ "vars",
349
+ "opened",
350
+ "transitionDuration",
351
+ "transitionTimingFunction",
352
+ "lineSize",
353
+ "attributes"
354
+ ];
355
+ const burgerModList = (0, vue.computed)(() => ["reduce-motion", { opened: props.value.opened }]);
356
+ const styleProps = (0, vue.computed)(() => ({
357
+ ...props.value,
358
+ ...attrs,
359
+ style: attrs.style ?? props.value.style
360
+ }));
361
+ const getStyles = require_use_styles.useStyles({
362
+ name: "Burger",
363
+ classes: require_burger_module.default,
364
+ props: styleProps,
365
+ className: () => props.value.className,
366
+ style: () => props.value.style,
367
+ classNames: props.value.classNames,
368
+ styles: props.value.styles,
369
+ unstyled: props.value.unstyled,
370
+ attributes: props.value.attributes,
371
+ vars: props.value.vars,
372
+ varsResolver: require_burger_utils.varsResolver
373
+ });
374
+ const rootAttrs = (0, vue.computed)(() => getStyles("root"));
375
+ const burgerAttrs = (0, vue.computed)(() => getStyles("burger"));
376
+ const mergedRootAttrs = (0, vue.computed)(() => {
377
+ const others = {};
378
+ const propsValue = props.value;
379
+ Object.keys(propsValue).forEach((key) => {
380
+ if (!knownProps.includes(key)) others[key] = propsValue[key];
381
+ });
382
+ const userMod = props.value.mod;
383
+ const mergedMod = [...Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)];
384
+ return {
385
+ ...others,
386
+ mod: mergedMod,
387
+ ...rootAttrs.value
388
+ };
389
+ });
390
+ const mergedBurgerAttrs = (0, vue.computed)(() => ({
391
+ mod: burgerModList.value,
392
+ ...burgerAttrs.value
393
+ }));
394
+ __expose({ root: (0, vue.computed)(() => _root.value?.root ?? null) });
395
+ const __returned__ = {
396
+ _root,
397
+ attrs,
398
+ rawProps,
399
+ props,
400
+ knownProps,
401
+ burgerModList,
402
+ styleProps,
403
+ getStyles,
404
+ rootAttrs,
405
+ burgerAttrs,
406
+ mergedRootAttrs,
407
+ mergedBurgerAttrs,
408
+ get CBox() {
409
+ return require_index.CBox;
410
+ },
411
+ get UnstyledButton() {
412
+ return require_index$1.UnstyledButton;
413
+ }
414
+ };
415
+ Object.defineProperty(__returned__, "__isScriptSetup", {
416
+ enumerable: false,
417
+ value: true
418
+ });
419
+ return __returned__;
420
+ }
421
+ });
422
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
423
+ return (0, vue.openBlock)(), (0, vue.createBlock)($setup["UnstyledButton"], (0, vue.mergeProps)({ ref: "_root" }, $setup.mergedRootAttrs), {
424
+ default: (0, vue.withCtx)(() => [(0, vue.createVNode)($setup["CBox"], (0, vue.normalizeProps)((0, vue.guardReactiveProps)($setup.mergedBurgerAttrs)), {
425
+ default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
426
+ _: 3
427
+ }, 16)]),
428
+ _: 3
429
+ }, 16);
430
+ }
431
+ var burger_default = /*#__PURE__*/ require_export_helper.default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/cck-ui/cck-ui/packages/@cck-ui/core/src/components/burger/burger.vue"]]);
432
+ //#endregion
433
+ exports.default = burger_default;
434
+
435
+ //# sourceMappingURL=burger.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"burger.cjs","names":[],"sources":["../../../src/components/burger/burger.vue"],"sourcesContent":["<template>\n <unstyled-button ref=\"_root\" v-bind=\"mergedRootAttrs\">\n <c-box v-bind=\"mergedBurgerAttrs\">\n <slot />\n </c-box>\n </unstyled-button>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { CBox, CStyleProp, useComponentProps, useStyles } from '../../core'\nimport { UnstyledButton } from '../unstyled-button'\nimport { BurgerFactory, BurgerProps } from './burger.types'\nimport { varsResolver } from './burger.utils'\nimport classes from './burger.module.css'\n\ndefineOptions({\n name: 'CBurger',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<BurgerProps>()\n\nconst props = useComponentProps({\n component: 'CBurger',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'opened',\n 'transitionDuration',\n 'transitionTimingFunction',\n 'lineSize',\n 'attributes',\n]\n\nconst burgerModList = computed(() => ['reduce-motion', { opened: props.value.opened }])\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<BurgerFactory>({\n name: 'Burger',\n classes,\n props: styleProps,\n className: () => props.value.className,\n style: () => props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n})\n\nconst rootAttrs = computed(() => getStyles('root'))\nconst burgerAttrs = computed(() => getStyles('burger'))\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 mergedBurgerAttrs = computed(() => ({\n mod: burgerModList.value,\n ...burgerAttrs.value,\n}))\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBA,MAAM,SAAA,GAAA,IAAA,IAAA,CAA8C,IAAI;EAExD,MAAM,SAAA,GAAA,IAAA,SAAA,CAAiB;EAEvB,MAAM,WAAW;EAEjB,MAAM,QAAQ,4BAAA,kBAAkB;GAC9B,WAAW;GACX,cAAc,CAAC;GACf,OAAO;EACT,CAAC;EAED,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GAC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I,EAChD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mDAtFmB,OAAA,oBAAA,GAAA,IAAA,WAAA,CAAA,EAJD,KAAI,QAAO,GAAS,OAAA,eAAe,GAAA;kCAG1C,EAAA,GAAA,IAAA,YAAA,CAAA,OAAA,UAAA,GAAA,IAAA,eAAA,EAAA,GAAA,IAAA,mBAAA,CAFO,OAAA,iBAAiB,CAAA,GAAA;mCACtB,EAAA,GAAA,IAAA,WAAA,CAAA,KAAA,QAAA,SAAA,CAAA,CAAA"}
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ //#region packages/@cck-ui/core/src/components/burger/burger.module.css
3
+ var burger_module_default = {
4
+ "root": "m_9b3d173a",
5
+ "burger": "m_a55c6ccd"
6
+ };
7
+ //#endregion
8
+ exports.default = burger_module_default;
9
+
10
+ //# sourceMappingURL=burger.module.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"burger.module.cjs","names":[],"sources":["../../../src/components/burger/burger.module.css"],"sourcesContent":[".root {\n --burger-size-xs: 12px;\n --burger-size-sm: 18px;\n --burger-size-md: 24px;\n --burger-size-lg: 34px;\n --burger-size-xl: 42px;\n\n --burger-size: var(--burger-size-md);\n --burger-line-size: calc(var(--burger-size) / 12);\n\n width: calc(var(--burger-size) + var(--c-spacing-xs));\n height: calc(var(--burger-size) + var(--c-spacing-xs));\n padding: calc(var(--c-spacing-xs) / 2);\n cursor: pointer;\n\n @mixin where-light {\n --burger-color: var(--c-color-black);\n }\n\n @mixin where-dark {\n --burger-color: var(--c-color-white);\n }\n}\n\n.burger {\n position: relative;\n user-select: none;\n\n &,\n &::before,\n &::after {\n display: block;\n width: var(--burger-size);\n height: var(--burger-line-size);\n background-color: var(--burger-color);\n outline: 1px solid transparent;\n transition-property: background-color, transform;\n transition-duration: var(--burger-transition-duration, 300ms);\n transition-timing-function: var(--burger-transition-timing-function, ease);\n }\n\n &::before,\n &::after {\n position: absolute;\n content: '';\n inset-inline-start: 0;\n }\n\n &::before {\n top: calc(var(--burger-size) / -3);\n }\n\n &::after {\n top: calc(var(--burger-size) / 3);\n }\n\n &[data-opened] {\n background-color: transparent;\n\n &::before {\n transform: translateY(calc(var(--burger-size) / 3)) rotate(45deg);\n }\n\n &::after {\n transform: translateY(calc(var(--burger-size) / -3)) rotate(-45deg);\n }\n }\n}\n"],"mappings":";;AAAA,IAAA,wBAAe;CAAC,QAAO;CAAa,UAAS;AAAY"}
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ const require_rem = require("../../core/utils/units-converters/rem.cjs");
3
+ const require_get_size = require("../../core/utils/get-size/get-size.cjs");
4
+ const require_get_theme_color = require("../../core/config-provider/color-functions/get-theme-color/get-theme-color.cjs");
5
+ //#region packages/@cck-ui/core/src/components/burger/burger.utils.ts
6
+ const varsResolver = require("../../core/styles-api/create-vars-resolver/create-vars-resolver.cjs").createVarsResolver((theme, { color, size, lineSize, transitionDuration, transitionTimingFunction }) => ({ root: {
7
+ "--burger-color": color ? require_get_theme_color.getThemeColor(color, theme) : void 0,
8
+ "--burger-line-size": lineSize ? require_rem.rem(lineSize) : void 0,
9
+ "--burger-size": require_get_size.getSize(size, "burger-size"),
10
+ "--burger-transition-duration": transitionDuration === void 0 ? void 0 : `${transitionDuration}ms`,
11
+ "--burger-transition-timing-function": transitionTimingFunction
12
+ } }));
13
+ //#endregion
14
+ exports.varsResolver = varsResolver;
15
+
16
+ //# sourceMappingURL=burger.utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"burger.utils.cjs","names":["createVarsResolver","getThemeColor","rem","getSize"],"sources":["../../../src/components/burger/burger.utils.ts"],"sourcesContent":["import { createVarsResolver, getSize, getThemeColor, rem } from '../../core'\nimport { BurgerFactory } from './burger.types'\n\nexport const varsResolver = createVarsResolver<BurgerFactory>(\n (theme, { color, size, lineSize, transitionDuration, transitionTimingFunction }) => ({\n root: {\n '--burger-color': color ? getThemeColor(color, theme) : undefined,\n '--burger-line-size': lineSize ? rem(lineSize) : undefined,\n '--burger-size': getSize(size, 'burger-size'),\n '--burger-transition-duration':\n transitionDuration === undefined ? undefined : `${transitionDuration}ms`,\n '--burger-transition-timing-function': transitionTimingFunction,\n },\n })\n)\n"],"mappings":";;;;;AAGA,MAAa,4FAAeA,CAAAA,CAAAA,oBACzB,OAAO,EAAE,OAAO,MAAM,UAAU,oBAAoB,gCAAgC,EACnF,MAAM;CACJ,kBAAkB,QAAQC,wBAAAA,cAAc,OAAO,KAAK,IAAI,KAAA;CACxD,sBAAsB,WAAWC,YAAAA,IAAI,QAAQ,IAAI,KAAA;CACjD,iBAAiBC,iBAAAA,QAAQ,MAAM,aAAa;CAC5C,gCACE,uBAAuB,KAAA,IAAY,KAAA,IAAY,GAAG,mBAAmB;CACvE,uCAAuC;AACzC,EACF,EACF"}
@@ -0,0 +1,14 @@
1
+ "use client";
2
+ const require_install = require("../../core/utils/vue/install.cjs");
3
+ const require_statics = require("../../core/utils/vue/statics.cjs");
4
+ const require_burger_module = require("./burger.module.cjs");
5
+ const require_burger_utils = require("./burger.utils.cjs");
6
+ const require_burger = require("./burger.cjs");
7
+ //#region packages/@cck-ui/core/src/components/burger/index.ts
8
+ const BurgerWithStatic = require_statics.withPropsFactory(require_statics.withExtend(require_statics.withVarsResolver(require_statics.withClasses(require_burger.default, require_burger_module.default), require_burger_utils.varsResolver)));
9
+ const CBurger = require_install.withInstall(BurgerWithStatic);
10
+ //#endregion
11
+ exports.CBurger = CBurger;
12
+ exports.default = CBurger;
13
+
14
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":["withPropsFactory","withExtend","withVarsResolver","withClasses","Burger","classes","varsResolver","withInstall"],"sources":["../../../src/components/burger/index.ts"],"sourcesContent":["import {\n SFCWithInstallAndClasses,\n withClasses,\n withExtend,\n withInstall,\n withPropsFactory,\n withVarsResolver,\n} from '../../core'\nimport classes from './burger.module.css'\nimport { varsResolver } from './burger.utils'\nimport Burger from './burger.vue'\n\nconst BurgerWithStatic = withPropsFactory(\n withExtend(withVarsResolver(withClasses(Burger, classes), varsResolver))\n)\n\nexport const CBurger: SFCWithInstallAndClasses<typeof Burger, typeof classes> =\n withInstall(BurgerWithStatic)\n\nexport default CBurger\n\nexport * from './burger.types'\n"],"mappings":";;;;;;;AAYA,MAAM,mBAAmBA,gBAAAA,iBACvBC,gBAAAA,WAAWC,gBAAAA,iBAAiBC,gBAAAA,YAAYC,eAAAA,SAAQC,sBAAAA,OAAO,GAAGC,qBAAAA,YAAY,CAAC,CACzE;AAEA,MAAa,UACXC,gBAAAA,YAAY,gBAAgB"}
@@ -11,6 +11,10 @@ const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
11
11
  type: null,
12
12
  required: false
13
13
  },
14
+ disabled: {
15
+ type: Boolean,
16
+ required: false
17
+ },
14
18
  reuseTargetNode: {
15
19
  type: Boolean,
16
20
  required: false
@@ -19,7 +23,10 @@ const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
19
23
  setup(__props, { expose: __expose }) {
20
24
  const attrs = (0, vue.useAttrs)();
21
25
  const rawProps = __props;
22
- const defaultProps = { reuseTargetNode: true };
26
+ const defaultProps = {
27
+ reuseTargetNode: true,
28
+ disabled: false
29
+ };
23
30
  const props = require_use_component_props.useComponentProps({
24
31
  component: "CPortal",
25
32
  defaultProps,
@@ -104,10 +111,10 @@ const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
104
111
  }
105
112
  });
106
113
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
107
- return $setup.container ? ((0, vue.openBlock)(), (0, vue.createBlock)(vue.Teleport, {
114
+ return $setup.container && !$setup.props.disabled ? ((0, vue.openBlock)(), (0, vue.createBlock)(vue.Teleport, {
108
115
  key: 0,
109
116
  to: $setup.container
110
- }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 8, ["to"])) : (0, vue.createCommentVNode)("v-if", true);
117
+ }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 8, ["to"])) : (0, vue.renderSlot)(_ctx.$slots, "default", { key: 1 });
111
118
  }
112
119
  var portal_default = /*#__PURE__*/ require_export_helper.default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/cck-ui/cck-ui/packages/@cck-ui/core/src/components/portal/portal.vue"]]);
113
120
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"portal.cjs","names":[],"sources":["../../../src/components/portal/portal.vue"],"sourcesContent":["<template>\n <Teleport v-if=\"container\" :to=\"container\">\n <slot />\n </Teleport>\n</template>\n\n<script setup lang=\"ts\">\nimport { onBeforeUnmount, onMounted, ref, useAttrs } from 'vue'\nimport { PortalProps } from './portal.types'\nimport { useComponentProps } from '../../core'\n\ndefineOptions({\n name: 'CPortal',\n})\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<PortalProps>()\n\nconst defaultProps = {\n reuseTargetNode: true,\n} satisfies Partial<PortalProps>\n\nconst props = useComponentProps({\n component: 'CPortal',\n defaultProps,\n props: rawProps,\n})\n\nconst container = ref<HTMLElement | null>(null)\nlet createdNode: HTMLElement | null = null\n\nfunction createPortalNode(nodeAttrs: Record<string, any>): HTMLElement {\n const node = document.createElement('div')\n node.setAttribute('data-portal', 'true')\n\n const className = nodeAttrs.class || nodeAttrs.className\n if (className) {\n node.classList.add(...String(className).split(' ').filter(Boolean))\n }\n if (nodeAttrs.style) {\n Object.assign(node.style, nodeAttrs.style)\n }\n if (nodeAttrs.id) {\n node.setAttribute('id', nodeAttrs.id)\n }\n Object.keys(nodeAttrs).forEach((key) => {\n if (!['class', 'className', 'style', 'id'].includes(key)) {\n node.setAttribute(key, nodeAttrs[key])\n }\n })\n\n return node\n}\n\nfunction getTargetNode(): HTMLElement {\n const target = props.value.target\n const reuseTargetNode = props.value.reuseTargetNode\n\n if (target) {\n if (typeof target === 'string') {\n const found = document.querySelector<HTMLElement>(target)\n if (found) {\n return found\n }\n const node = createPortalNode(attrs)\n document.body.appendChild(node)\n createdNode = node\n return node\n }\n return target\n }\n\n if (reuseTargetNode) {\n const existing = document.querySelector<HTMLElement>('[data-cck-shared-portal]')\n if (existing) {\n return existing\n }\n const node = createPortalNode(attrs)\n node.setAttribute('data-cck-shared-portal', 'true')\n document.body.appendChild(node)\n createdNode = node\n return node\n }\n\n const node = createPortalNode(attrs)\n document.body.appendChild(node)\n createdNode = node\n return node\n}\n\nonMounted(() => {\n container.value = getTargetNode()\n})\n\nonBeforeUnmount(() => {\n if (createdNode && !createdNode.hasAttribute('data-cck-shared-portal')) {\n if (createdNode.parentNode) {\n createdNode.parentNode.removeChild(createdNode)\n }\n }\n})\n\ndefineExpose({\n root: container,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAeA,MAAM,SAAA,GAAA,IAAA,SAAA,CAAiB;EAEvB,MAAM,WAAW;EAEjB,MAAM,eAAe,EACnB,iBAAiB,KACnB;EAEA,MAAM,QAAQ,4BAAA,kBAAkB;GAC9B,WAAW;GACX;GACA,OAAO;EACT,CAAC;EAED,MAAM,aAAA,GAAA,IAAA,IAAA,CAAoC,IAAI;EAC9C,IAAI,cAAkC;EAEtC,SAAS,iBAAiB,WAA6C;GACrE,MAAM,OAAO,SAAS,cAAc,KAAK;GACzC,KAAK,aAAa,eAAe,MAAM;GAEvC,MAAM,YAAY,UAAU,SAAS,UAAU;GAC/C,IAAI,WACF,KAAK,UAAU,IAAI,GAAG,OAAO,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO,CAAC;GAEpE,IAAI,UAAU,OACZ,OAAO,OAAO,KAAK,OAAO,UAAU,KAAK;GAE3C,IAAI,UAAU,IACZ,KAAK,aAAa,MAAM,UAAU,EAAE;GAEtC,OAAO,KAAK,SAAS,CAAC,CAAC,SAAS,QAAQ;IACtC,IAAI,CAAC;KAAC;KAAS;KAAa;KAAS;IAAI,CAAC,CAAC,SAAS,GAAG,GACrD,KAAK,aAAa,KAAK,UAAU,IAAI;GAEzC,CAAC;GAED,OAAO;EACT;EAEA,SAAS,gBAA6B;GACpC,MAAM,SAAS,MAAM,MAAM;GAC3B,MAAM,kBAAkB,MAAM,MAAM;GAEpC,IAAI,QAAQ;IACV,IAAI,OAAO,WAAW,UAAU;KAC9B,MAAM,QAAQ,SAAS,cAA2B,MAAM;KACxD,IAAI,OACF,OAAO;KAET,MAAM,OAAO,iBAAiB,KAAK;KACnC,SAAS,KAAK,YAAY,IAAI;KAC9B,cAAc;KACd,OAAO;IACT;IACA,OAAO;GACT;GAEA,IAAI,iBAAiB;IACnB,MAAM,WAAW,SAAS,cAA2B,0BAA0B;IAC/E,IAAI,UACF,OAAO;IAET,MAAM,OAAO,iBAAiB,KAAK;IACnC,KAAK,aAAa,0BAA0B,MAAM;IAClD,SAAS,KAAK,YAAY,IAAI;IAC9B,cAAc;IACd,OAAO;GACT;GAEA,MAAM,OAAO,iBAAiB,KAAK;GACnC,SAAS,KAAK,YAAY,IAAI;GAC9B,cAAc;GACd,OAAO;EACT;EAEA,CAAA,GAAA,IAAA,UAAA,OAAgB;GACd,UAAU,QAAQ,cAAc;EAClC,CAAC;EAED,CAAA,GAAA,IAAA,gBAAA,OAAsB;GACpB,IAAI,eAAe,CAAC,YAAY,aAAa,wBAAwB;QAC/D,YAAY,YACd,YAAY,WAAW,YAAY,WAAW;GAAA;EAGpD,CAAC;EAED,SAAa,EACX,MAAM,UACR,CAAC;;;;;;;;;;;;;;;;;;;;;;;;QAxGiB,OAAA,cAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,CAEL,IAAA,UAAA;;EAFiB,IAAI,OAAA;yBACtB,KAAA,QAAA,SAAA,CAAA,GAAA,GAAA,CAAA,IAAA,CAAA,MAAA,GAAA,IAAA,mBAAA,CAAA,QAAA,IAAA"}
1
+ {"version":3,"file":"portal.cjs","names":[],"sources":["../../../src/components/portal/portal.vue"],"sourcesContent":["<template>\n <Teleport v-if=\"container && !props.disabled\" :to=\"container\">\n <slot />\n </Teleport>\n <template v-else>\n <slot />\n </template>\n</template>\n\n<script setup lang=\"ts\">\nimport { onBeforeUnmount, onMounted, ref, useAttrs } from 'vue'\nimport { PortalProps } from './portal.types'\nimport { useComponentProps } from '../../core'\n\ndefineOptions({\n name: 'CPortal',\n})\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<PortalProps>()\n\nconst defaultProps = {\n reuseTargetNode: true,\n disabled: false,\n} satisfies Partial<PortalProps>\n\nconst props = useComponentProps({\n component: 'CPortal',\n defaultProps,\n props: rawProps,\n})\n\nconst container = ref<HTMLElement | null>(null)\nlet createdNode: HTMLElement | null = null\n\nfunction createPortalNode(nodeAttrs: Record<string, any>): HTMLElement {\n const node = document.createElement('div')\n node.setAttribute('data-portal', 'true')\n\n const className = nodeAttrs.class || nodeAttrs.className\n if (className) {\n node.classList.add(...String(className).split(' ').filter(Boolean))\n }\n if (nodeAttrs.style) {\n Object.assign(node.style, nodeAttrs.style)\n }\n if (nodeAttrs.id) {\n node.setAttribute('id', nodeAttrs.id)\n }\n Object.keys(nodeAttrs).forEach((key) => {\n if (!['class', 'className', 'style', 'id'].includes(key)) {\n node.setAttribute(key, nodeAttrs[key])\n }\n })\n\n return node\n}\n\nfunction getTargetNode(): HTMLElement {\n const target = props.value.target\n const reuseTargetNode = props.value.reuseTargetNode\n\n if (target) {\n if (typeof target === 'string') {\n const found = document.querySelector<HTMLElement>(target)\n if (found) {\n return found\n }\n const node = createPortalNode(attrs)\n document.body.appendChild(node)\n createdNode = node\n return node\n }\n return target\n }\n\n if (reuseTargetNode) {\n const existing = document.querySelector<HTMLElement>('[data-cck-shared-portal]')\n if (existing) {\n return existing\n }\n const node = createPortalNode(attrs)\n node.setAttribute('data-cck-shared-portal', 'true')\n document.body.appendChild(node)\n createdNode = node\n return node\n }\n\n const node = createPortalNode(attrs)\n document.body.appendChild(node)\n createdNode = node\n return node\n}\n\nonMounted(() => {\n container.value = getTargetNode()\n})\n\nonBeforeUnmount(() => {\n if (createdNode && !createdNode.hasAttribute('data-cck-shared-portal')) {\n if (createdN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,iBAAiB;IACnB,MAAM,WAAW,SAAS,cAA2B,0BAA0B;IAC/E,IAAI,UACF,OAAO;IAET,MAAM,OAAO,iBAAiB,KAAK;IACnC,KAAK,aAAa,0BAA0B,MAAM;IAClD,SAAS,KAAK,YAAY,IAAI;IAC9B,cAAc;IACd,OAAO;GACT;GAEA,MAAM,OAAO,iBAAiB,KAAK;GACnC,SAAS,KAAK,YAAY,IAAI;GAC9B,cAAc;GACd,OAAO;EACT;EAEA,CAAA,GAAA,IAAA,UAAA,OAAgB;GACd,UAAU,QAAQ,cAAc;EAClC,CAAC;EAED,CAAA,GAAA,IAAA,gBAAA,OAAsB;GACpB,IAAI,eAAe,CAAC,YAAY,aAAa,wBAAwB;QAC/D,YAAY,YACd,YAAY,WAAW,YAAY,WAAW;GAAA;EAGpD,CAAC;EAED,SAAa,EACX,MAAM,UACR,CAAC;;;;;;;;;;;;;;;;;;;;;;;;QA5GiB,OAAA,aAAS,CAAK,OAAA,MAAM,aAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,CAEzB,IAAA,UAAA;;EAFoC,IAAI,OAAA;yBACzC,KAAA,QAAA,SAAA,CAAA,GAAA,GAAA,CAAA,IAAA,CAAA,MAAA,GAAA,IAAA,WAAA,CAGA,KAAA,QAAA,WAAA,EAAA,KAAA,EAAA,CAAA"}
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ //#region packages/@cck-ui/core/src/core/utils/get-default-z-index/get-default-z-index.ts
3
+ const elevations = {
4
+ app: 100,
5
+ modal: 200,
6
+ popover: 300,
7
+ overlay: 400,
8
+ max: 9999
9
+ };
10
+ function getDefaultZIndex(level) {
11
+ return elevations[level];
12
+ }
13
+ //#endregion
14
+ exports.getDefaultZIndex = getDefaultZIndex;
15
+
16
+ //# sourceMappingURL=get-default-z-index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-default-z-index.cjs","names":[],"sources":["../../../../src/core/utils/get-default-z-index/get-default-z-index.ts"],"sourcesContent":["const elevations = {\n app: 100,\n modal: 200,\n popover: 300,\n overlay: 400,\n max: 9999,\n} as const\n\nexport function getDefaultZIndex(level: keyof typeof elevations) {\n return elevations[level]\n}\n"],"mappings":";;AAAA,MAAM,aAAa;CACjB,KAAK;CACL,OAAO;CACP,SAAS;CACT,SAAS;CACT,KAAK;AACP;AAEA,SAAgB,iBAAiB,OAAgC;CAC/D,OAAO,WAAW;AACpB"}