@cck-ui/core 0.24.0 → 0.25.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.
@@ -0,0 +1,12 @@
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_portal = require("./portal.cjs");
5
+ //#region packages/@cck-ui/core/src/components/portal/index.ts
6
+ const PortalWithStatic = require_statics.withPropsFactory(require_statics.withExtend(require_portal.default));
7
+ const CPortal = require_install.withInstall(PortalWithStatic);
8
+ //#endregion
9
+ exports.CPortal = CPortal;
10
+ exports.default = CPortal;
11
+
12
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":["withPropsFactory","withExtend","Portal","withInstall"],"sources":["../../../src/components/portal/index.ts"],"sourcesContent":["import { SFCWithInstall, withExtend, withInstall, withPropsFactory } from '../../core'\nimport Portal from './portal.vue'\n\nconst PortalWithStatic = withPropsFactory(withExtend(Portal))\n\nexport const CPortal: SFCWithInstall<typeof Portal> = withInstall(PortalWithStatic)\n\nexport default CPortal\n\nexport * from './portal.types'\n"],"mappings":";;;;;AAGA,MAAM,mBAAmBA,gBAAAA,iBAAiBC,gBAAAA,WAAWC,eAAAA,OAAM,CAAC;AAE5D,MAAa,UAAyCC,gBAAAA,YAAY,gBAAgB"}
@@ -0,0 +1,116 @@
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
+ let vue = require("vue");
5
+ //#region packages/@cck-ui/core/src/components/portal/portal.vue
6
+ const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
7
+ name: "CPortal",
8
+ __name: "portal",
9
+ props: {
10
+ target: {
11
+ type: null,
12
+ required: false
13
+ },
14
+ reuseTargetNode: {
15
+ type: Boolean,
16
+ required: false
17
+ }
18
+ },
19
+ setup(__props, { expose: __expose }) {
20
+ const attrs = (0, vue.useAttrs)();
21
+ const rawProps = __props;
22
+ const defaultProps = { reuseTargetNode: true };
23
+ const props = require_use_component_props.useComponentProps({
24
+ component: "CPortal",
25
+ defaultProps,
26
+ props: rawProps
27
+ });
28
+ const container = (0, vue.ref)(null);
29
+ let createdNode = null;
30
+ function createPortalNode(nodeAttrs) {
31
+ const node = document.createElement("div");
32
+ node.setAttribute("data-portal", "true");
33
+ const className = nodeAttrs.class || nodeAttrs.className;
34
+ if (className) node.classList.add(...String(className).split(" ").filter(Boolean));
35
+ if (nodeAttrs.style) Object.assign(node.style, nodeAttrs.style);
36
+ if (nodeAttrs.id) node.setAttribute("id", nodeAttrs.id);
37
+ Object.keys(nodeAttrs).forEach((key) => {
38
+ if (![
39
+ "class",
40
+ "className",
41
+ "style",
42
+ "id"
43
+ ].includes(key)) node.setAttribute(key, nodeAttrs[key]);
44
+ });
45
+ return node;
46
+ }
47
+ function getTargetNode() {
48
+ const target = props.value.target;
49
+ const reuseTargetNode = props.value.reuseTargetNode;
50
+ if (target) {
51
+ if (typeof target === "string") {
52
+ const found = document.querySelector(target);
53
+ if (found) return found;
54
+ const node = createPortalNode(attrs);
55
+ document.body.appendChild(node);
56
+ createdNode = node;
57
+ return node;
58
+ }
59
+ return target;
60
+ }
61
+ if (reuseTargetNode) {
62
+ const existing = document.querySelector("[data-cck-shared-portal]");
63
+ if (existing) return existing;
64
+ const node = createPortalNode(attrs);
65
+ node.setAttribute("data-cck-shared-portal", "true");
66
+ document.body.appendChild(node);
67
+ createdNode = node;
68
+ return node;
69
+ }
70
+ const node = createPortalNode(attrs);
71
+ document.body.appendChild(node);
72
+ createdNode = node;
73
+ return node;
74
+ }
75
+ (0, vue.onMounted)(() => {
76
+ container.value = getTargetNode();
77
+ });
78
+ (0, vue.onBeforeUnmount)(() => {
79
+ if (createdNode && !createdNode.hasAttribute("data-cck-shared-portal")) {
80
+ if (createdNode.parentNode) createdNode.parentNode.removeChild(createdNode);
81
+ }
82
+ });
83
+ __expose({ root: container });
84
+ const __returned__ = {
85
+ attrs,
86
+ rawProps,
87
+ defaultProps,
88
+ props,
89
+ container,
90
+ get createdNode() {
91
+ return createdNode;
92
+ },
93
+ set createdNode(v) {
94
+ createdNode = v;
95
+ },
96
+ createPortalNode,
97
+ getTargetNode
98
+ };
99
+ Object.defineProperty(__returned__, "__isScriptSetup", {
100
+ enumerable: false,
101
+ value: true
102
+ });
103
+ return __returned__;
104
+ }
105
+ });
106
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
107
+ return $setup.container ? ((0, vue.openBlock)(), (0, vue.createBlock)(vue.Teleport, {
108
+ key: 0,
109
+ to: $setup.container
110
+ }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 8, ["to"])) : (0, vue.createCommentVNode)("v-if", true);
111
+ }
112
+ 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
+ //#endregion
114
+ exports.default = portal_default;
115
+
116
+ //# sourceMappingURL=portal.cjs.map
@@ -0,0 +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"}
package/cjs/index.cjs CHANGED
@@ -76,15 +76,16 @@ const require_index$19 = require("./components/grid/index.cjs");
76
76
  const require_index$20 = require("./components/group/index.cjs");
77
77
  const require_index$21 = require("./components/image/index.cjs");
78
78
  const require_index$22 = require("./components/paper/index.cjs");
79
- const require_index$23 = require("./components/semi-circle-progress/index.cjs");
80
- const require_index$24 = require("./components/simple-grid/index.cjs");
81
- const require_index$25 = require("./components/skeleton/index.cjs");
82
- const require_index$26 = require("./components/space/index.cjs");
83
- const require_index$27 = require("./components/splitter/index.cjs");
84
- const require_index$28 = require("./components/stack/index.cjs");
85
- const require_index$29 = require("./components/text/index.cjs");
86
- const require_index$30 = require("./components/typography/index.cjs");
87
- const require_index$31 = require("./components/visually-hidden/index.cjs");
79
+ const require_index$23 = require("./components/portal/index.cjs");
80
+ const require_index$24 = require("./components/semi-circle-progress/index.cjs");
81
+ const require_index$25 = require("./components/simple-grid/index.cjs");
82
+ const require_index$26 = require("./components/skeleton/index.cjs");
83
+ const require_index$27 = require("./components/space/index.cjs");
84
+ const require_index$28 = require("./components/splitter/index.cjs");
85
+ const require_index$29 = require("./components/stack/index.cjs");
86
+ const require_index$30 = require("./components/text/index.cjs");
87
+ const require_index$31 = require("./components/typography/index.cjs");
88
+ const require_index$32 = require("./components/visually-hidden/index.cjs");
88
89
  let _vue_shared = require("@vue/shared");
89
90
  //#region packages/@cck-ui/core/src/index.ts
90
91
  const INSTALLED_KEY = Symbol("INSTALLED_KEY");
@@ -118,17 +119,18 @@ const components = [
118
119
  require_index$21.CImage,
119
120
  require_index$4.CLoader,
120
121
  require_index$22.CPaper,
121
- require_index$23.CSemiCircleProgress,
122
- require_index$24.CSimpleGrid,
123
- require_index$25.CSkeleton,
124
- require_index$26.CSpace,
125
- require_index$27.CSplitter,
126
- require_index$27.CSplitterPane,
127
- require_index$28.CStack,
128
- require_index$29.CText,
122
+ require_index$23.CPortal,
123
+ require_index$24.CSemiCircleProgress,
124
+ require_index$25.CSimpleGrid,
125
+ require_index$26.CSkeleton,
126
+ require_index$27.CSpace,
127
+ require_index$28.CSplitter,
128
+ require_index$28.CSplitterPane,
129
+ require_index$29.CStack,
130
+ require_index$30.CText,
129
131
  require_index$5.CTransition,
130
- require_index$30.CTypography,
131
- require_index$31.CVisuallyHidden,
132
+ require_index$31.CTypography,
133
+ require_index$32.CVisuallyHidden,
132
134
  require_index$3.UnstyledButton
133
135
  ];
134
136
  const CckUI = { install(app) {
@@ -170,17 +172,18 @@ exports.CImage = require_index$21.CImage;
170
172
  exports.CLoader = require_index$4.CLoader;
171
173
  exports.CONFIG_KEY = require_config_provider_types.CONFIG_KEY;
172
174
  exports.CPaper = require_index$22.CPaper;
173
- exports.CSemiCircleProgress = require_index$23.CSemiCircleProgress;
174
- exports.CSimpleGrid = require_index$24.CSimpleGrid;
175
- exports.CSkeleton = require_index$25.CSkeleton;
176
- exports.CSpace = require_index$26.CSpace;
177
- exports.CSplitter = require_index$27.CSplitter;
178
- exports.CSplitterPane = require_index$27.CSplitterPane;
179
- exports.CStack = require_index$28.CStack;
180
- exports.CText = require_index$29.CText;
175
+ exports.CPortal = require_index$23.CPortal;
176
+ exports.CSemiCircleProgress = require_index$24.CSemiCircleProgress;
177
+ exports.CSimpleGrid = require_index$25.CSimpleGrid;
178
+ exports.CSkeleton = require_index$26.CSkeleton;
179
+ exports.CSpace = require_index$27.CSpace;
180
+ exports.CSplitter = require_index$28.CSplitter;
181
+ exports.CSplitterPane = require_index$28.CSplitterPane;
182
+ exports.CStack = require_index$29.CStack;
183
+ exports.CText = require_index$30.CText;
181
184
  exports.CTransition = require_index$5.CTransition;
182
- exports.CTypography = require_index$30.CTypography;
183
- exports.CVisuallyHidden = require_index$31.CVisuallyHidden;
185
+ exports.CTypography = require_index$31.CTypography;
186
+ exports.CVisuallyHidden = require_index$32.CVisuallyHidden;
184
187
  exports.CckConfigProvider = require_index$1.CckConfigProvider;
185
188
  exports.CckUI = CckUI;
186
189
  exports.default = CckUI;
package/cjs/index.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["CckConfigProvider","CBox","CActionIcon","CActionIconGroup","CActionIconGroupSection","CAlert","CAspectRatio","CButton","CButtonGroup","CButtonGroupSection","CCenter","CCloseButton","CCol","CContainer","CCopyButton","CDivider","CEmptyState","CEmptyStateActions","CEmptyStateDescription","CEmptyStateIndicator","CEmptyStateTitle","CFileButton","CFlex","CFocusTrap","CGrid","CGroup","CImage","CLoader","CPaper","CSemiCircleProgress","CSimpleGrid","CSkeleton","CSpace","CSplitter","CSplitterPane","CStack","CText","CTransition","CTypography","CVisuallyHidden","UnstyledButton"],"sources":["../src/index.ts"],"sourcesContent":["import type { App, Plugin } from 'vue'\nimport {\n CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAlert,\n CAspectRatio,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CCopyButton,\n CDivider,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFileButton,\n CFlex,\n CFocusTrap,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n CTypography,\n CVisuallyHidden,\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 CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAlert,\n CAspectRatio,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CCopyButton,\n CDivider,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFileButton,\n CFlex,\n CFocusTrap,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n CTypography,\n CVisuallyHidden,\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAM,gBAAgB,OAAO,eAAe;AAE5C,MAAM,aAAa;CACjBA,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,gBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,gBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,gBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,gBAAAA;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.cjs","names":["CckConfigProvider","CBox","CActionIcon","CActionIconGroup","CActionIconGroupSection","CAlert","CAspectRatio","CButton","CButtonGroup","CButtonGroupSection","CCenter","CCloseButton","CCol","CContainer","CCopyButton","CDivider","CEmptyState","CEmptyStateActions","CEmptyStateDescription","CEmptyStateIndicator","CEmptyStateTitle","CFileButton","CFlex","CFocusTrap","CGrid","CGroup","CImage","CLoader","CPaper","CPortal","CSemiCircleProgress","CSimpleGrid","CSkeleton","CSpace","CSplitter","CSplitterPane","CStack","CText","CTransition","CTypography","CVisuallyHidden","UnstyledButton"],"sources":["../src/index.ts"],"sourcesContent":["import type { App, Plugin } from 'vue'\nimport {\n CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAlert,\n CAspectRatio,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CCopyButton,\n CDivider,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFileButton,\n CFlex,\n CFocusTrap,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CPortal,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n CTypography,\n CVisuallyHidden,\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 CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAlert,\n CAspectRatio,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CCopyButton,\n CDivider,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFileButton,\n CFlex,\n CFocusTrap,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CPortal,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n CTypography,\n CVisuallyHidden,\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAM,gBAAgB,OAAO,eAAe;AAE5C,MAAM,aAAa;CACjBA,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,gBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,gBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,gBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,gBAAAA;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,9 @@
1
+ "use client";
2
+ import { withInstall } from "../../core/utils/vue/install.mjs";
3
+ import { withExtend, withPropsFactory } from "../../core/utils/vue/statics.mjs";
4
+ import portal_default from "./portal.mjs";
5
+ const CPortal = withInstall(withPropsFactory(withExtend(portal_default)));
6
+ //#endregion
7
+ export { CPortal, CPortal as default };
8
+
9
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["Portal"],"sources":["../../../src/components/portal/index.ts"],"sourcesContent":["import { SFCWithInstall, withExtend, withInstall, withPropsFactory } from '../../core'\nimport Portal from './portal.vue'\n\nconst PortalWithStatic = withPropsFactory(withExtend(Portal))\n\nexport const CPortal: SFCWithInstall<typeof Portal> = withInstall(PortalWithStatic)\n\nexport default CPortal\n\nexport * from './portal.types'\n"],"mappings":";;;;AAKA,MAAa,UAAyC,YAF7B,iBAAiB,WAAWA,cAAM,CAEO,CAAgB"}
@@ -0,0 +1,116 @@
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 { Teleport, createBlock, createCommentVNode, defineComponent, onBeforeUnmount, onMounted, openBlock, ref, renderSlot, useAttrs } from "vue";
5
+ //#region packages/@cck-ui/core/src/components/portal/portal.vue
6
+ const _sfc_main = /*@__PURE__*/ defineComponent({
7
+ name: "CPortal",
8
+ __name: "portal",
9
+ props: {
10
+ target: {
11
+ type: null,
12
+ required: false
13
+ },
14
+ reuseTargetNode: {
15
+ type: Boolean,
16
+ required: false
17
+ }
18
+ },
19
+ setup(__props, { expose: __expose }) {
20
+ const attrs = useAttrs();
21
+ const rawProps = __props;
22
+ const defaultProps = { reuseTargetNode: true };
23
+ const props = useComponentProps({
24
+ component: "CPortal",
25
+ defaultProps,
26
+ props: rawProps
27
+ });
28
+ const container = ref(null);
29
+ let createdNode = null;
30
+ function createPortalNode(nodeAttrs) {
31
+ const node = document.createElement("div");
32
+ node.setAttribute("data-portal", "true");
33
+ const className = nodeAttrs.class || nodeAttrs.className;
34
+ if (className) node.classList.add(...String(className).split(" ").filter(Boolean));
35
+ if (nodeAttrs.style) Object.assign(node.style, nodeAttrs.style);
36
+ if (nodeAttrs.id) node.setAttribute("id", nodeAttrs.id);
37
+ Object.keys(nodeAttrs).forEach((key) => {
38
+ if (![
39
+ "class",
40
+ "className",
41
+ "style",
42
+ "id"
43
+ ].includes(key)) node.setAttribute(key, nodeAttrs[key]);
44
+ });
45
+ return node;
46
+ }
47
+ function getTargetNode() {
48
+ const target = props.value.target;
49
+ const reuseTargetNode = props.value.reuseTargetNode;
50
+ if (target) {
51
+ if (typeof target === "string") {
52
+ const found = document.querySelector(target);
53
+ if (found) return found;
54
+ const node = createPortalNode(attrs);
55
+ document.body.appendChild(node);
56
+ createdNode = node;
57
+ return node;
58
+ }
59
+ return target;
60
+ }
61
+ if (reuseTargetNode) {
62
+ const existing = document.querySelector("[data-cck-shared-portal]");
63
+ if (existing) return existing;
64
+ const node = createPortalNode(attrs);
65
+ node.setAttribute("data-cck-shared-portal", "true");
66
+ document.body.appendChild(node);
67
+ createdNode = node;
68
+ return node;
69
+ }
70
+ const node = createPortalNode(attrs);
71
+ document.body.appendChild(node);
72
+ createdNode = node;
73
+ return node;
74
+ }
75
+ onMounted(() => {
76
+ container.value = getTargetNode();
77
+ });
78
+ onBeforeUnmount(() => {
79
+ if (createdNode && !createdNode.hasAttribute("data-cck-shared-portal")) {
80
+ if (createdNode.parentNode) createdNode.parentNode.removeChild(createdNode);
81
+ }
82
+ });
83
+ __expose({ root: container });
84
+ const __returned__ = {
85
+ attrs,
86
+ rawProps,
87
+ defaultProps,
88
+ props,
89
+ container,
90
+ get createdNode() {
91
+ return createdNode;
92
+ },
93
+ set createdNode(v) {
94
+ createdNode = v;
95
+ },
96
+ createPortalNode,
97
+ getTargetNode
98
+ };
99
+ Object.defineProperty(__returned__, "__isScriptSetup", {
100
+ enumerable: false,
101
+ value: true
102
+ });
103
+ return __returned__;
104
+ }
105
+ });
106
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
107
+ return $setup.container ? (openBlock(), createBlock(Teleport, {
108
+ key: 0,
109
+ to: $setup.container
110
+ }, [renderSlot(_ctx.$slots, "default")], 8, ["to"])) : createCommentVNode("v-if", true);
111
+ }
112
+ var portal_default = /*#__PURE__*/ 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
+ //#endregion
114
+ export { portal_default as default };
115
+
116
+ //# sourceMappingURL=portal.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portal.mjs","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,QAAQ,SAAS;EAEvB,MAAM,WAAW;EAEjB,MAAM,eAAe,EACnB,iBAAiB,KACnB;EAEA,MAAM,QAAQ,kBAAkB;GAC9B,WAAW;GACX;GACA,OAAO;EACT,CAAC;EAED,MAAM,YAAY,IAAwB,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,gBAAgB;GACd,UAAU,QAAQ,cAAc;EAClC,CAAC;EAED,sBAAsB;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,aAAA,UAAA,GAAhB,YAEW,UAAA;;EAFiB,IAAI,OAAA;KAC9B,WAAQ,KAAA,QAAA,SAAA,CAAA,GAAA,GAAA,CAAA,IAAA,CAAA,KAAA,mBAAA,QAAA,IAAA"}
package/esm/index.mjs CHANGED
@@ -72,6 +72,7 @@ import { CCol, CGrid } from "./components/grid/index.mjs";
72
72
  import { CGroup } from "./components/group/index.mjs";
73
73
  import { CImage } from "./components/image/index.mjs";
74
74
  import { CPaper } from "./components/paper/index.mjs";
75
+ import { CPortal } from "./components/portal/index.mjs";
75
76
  import { CSemiCircleProgress } from "./components/semi-circle-progress/index.mjs";
76
77
  import { CSimpleGrid } from "./components/simple-grid/index.mjs";
77
78
  import { CSkeleton } from "./components/skeleton/index.mjs";
@@ -113,6 +114,7 @@ const components = [
113
114
  CImage,
114
115
  CLoader,
115
116
  CPaper,
117
+ CPortal,
116
118
  CSemiCircleProgress,
117
119
  CSimpleGrid,
118
120
  CSkeleton,
@@ -134,6 +136,6 @@ const CckUI = { install(app) {
134
136
  });
135
137
  } };
136
138
  //#endregion
137
- export { CActionIcon, CActionIconGroup, CActionIconGroupSection, CAlert, CAspectRatio, CBox, CButton, CButtonGroup, CButtonGroupSection, transitions as CCK_TRANSITIONS, CCenter, CCloseButton, CCol, CContainer, CCopyButton, CDefaultLoaders, CDivider, CEmptyState, CEmptyStateActions, CEmptyStateDescription, CEmptyStateIndicator, CEmptyStateTitle, CFileButton, CFlex, CFocusTrap, CGrid, CGroup, CImage, CLoader, CONFIG_KEY, CPaper, CSemiCircleProgress, CSimpleGrid, CSkeleton, CSpace, CSplitter, CSplitterPane, CStack, CText, CTransition, CTypography, CVisuallyHidden, 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 };
139
+ export { CActionIcon, CActionIconGroup, CActionIconGroupSection, CAlert, CAspectRatio, CBox, CButton, CButtonGroup, CButtonGroupSection, transitions as CCK_TRANSITIONS, CCenter, CCloseButton, CCol, CContainer, CCopyButton, CDefaultLoaders, CDivider, CEmptyState, CEmptyStateActions, CEmptyStateDescription, CEmptyStateIndicator, CEmptyStateTitle, CFileButton, CFlex, CFocusTrap, CGrid, CGroup, CImage, CLoader, CONFIG_KEY, CPaper, CPortal, CSemiCircleProgress, CSimpleGrid, CSkeleton, CSpace, CSplitter, CSplitterPane, CStack, CText, CTransition, CTypography, CVisuallyHidden, 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 };
138
140
 
139
141
  //# 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 CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAlert,\n CAspectRatio,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CCopyButton,\n CDivider,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFileButton,\n CFlex,\n CFocusTrap,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n CTypography,\n CVisuallyHidden,\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 CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAlert,\n CAspectRatio,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CCopyButton,\n CDivider,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFileButton,\n CFlex,\n CFocusTrap,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n CTypography,\n CVisuallyHidden,\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAM,gBAAgB,OAAO,eAAe;AAE5C,MAAM,aAAa;CACjB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;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 CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAlert,\n CAspectRatio,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CCopyButton,\n CDivider,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFileButton,\n CFlex,\n CFocusTrap,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CPortal,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n CTypography,\n CVisuallyHidden,\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 CActionIcon,\n CActionIconGroup,\n CActionIconGroupSection,\n CAlert,\n CAspectRatio,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCloseButton,\n CCol,\n CContainer,\n CCopyButton,\n CDivider,\n CEmptyState,\n CEmptyStateActions,\n CEmptyStateDescription,\n CEmptyStateIndicator,\n CEmptyStateTitle,\n CFileButton,\n CFlex,\n CFocusTrap,\n CGrid,\n CGroup,\n CImage,\n CLoader,\n CPaper,\n CPortal,\n CSemiCircleProgress,\n CSimpleGrid,\n CSkeleton,\n CSpace,\n CSplitter,\n CSplitterPane,\n CStack,\n CText,\n CTransition,\n CTypography,\n CVisuallyHidden,\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAM,gBAAgB,OAAO,eAAe;AAE5C,MAAM,aAAa;CACjB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;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"}
@@ -16,6 +16,7 @@ export * from './group';
16
16
  export * from './image';
17
17
  export * from './loader';
18
18
  export * from './paper';
19
+ export * from './portal';
19
20
  export * from './semi-circle-progress';
20
21
  export * from './simple-grid';
21
22
  export * from './skeleton';
@@ -0,0 +1,5 @@
1
+ import { SFCWithInstall } from '../../core';
2
+ import Portal from './portal.vue';
3
+ export declare const CPortal: SFCWithInstall<typeof Portal>;
4
+ export default CPortal;
5
+ export * from './portal.types';
@@ -0,0 +1,21 @@
1
+ export interface PortalProps {
2
+ /**
3
+ * Target element where portal should be rendered. Accepts:
4
+ * - HTMLElement: Renders portal inside this element
5
+ * - string: CSS selector - renders inside first matching element
6
+ * - undefined: Uses shared portal node or creates new on based on `reuseTargetNode`
7
+ *
8
+ * Note: If selector doesn't match any element, portal will not render
9
+ */
10
+ target?: HTMLElement | string;
11
+ /**
12
+ * When true and target is not specified, all Portal instances share a single
13
+ * container node appended to document.body. When false, each Portal creates
14
+ * its own container node.
15
+ *
16
+ * Has no effect when target is specified.
17
+ *
18
+ * @default true
19
+ */
20
+ reuseTargetNode?: boolean;
21
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cck-ui/core",
3
- "version": "0.24.0",
3
+ "version": "0.25.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",