@cck-ui/core 0.36.0 → 0.37.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 (34) hide show
  1. package/cjs/components/indicator/get-position-variables/get-position-variables.cjs +47 -0
  2. package/cjs/components/indicator/get-position-variables/get-position-variables.cjs.map +1 -0
  3. package/cjs/components/indicator/index.cjs +14 -0
  4. package/cjs/components/indicator/index.cjs.map +1 -0
  5. package/cjs/components/indicator/indicator.cjs +496 -0
  6. package/cjs/components/indicator/indicator.cjs.map +1 -0
  7. package/cjs/components/indicator/indicator.module.cjs +11 -0
  8. package/cjs/components/indicator/indicator.module.cjs.map +1 -0
  9. package/cjs/components/indicator/indicator.utils.cjs +27 -0
  10. package/cjs/components/indicator/indicator.utils.cjs.map +1 -0
  11. package/cjs/index.cjs +32 -29
  12. package/cjs/index.cjs.map +1 -1
  13. package/esm/components/indicator/get-position-variables/get-position-variables.mjs +47 -0
  14. package/esm/components/indicator/get-position-variables/get-position-variables.mjs.map +1 -0
  15. package/esm/components/indicator/index.mjs +11 -0
  16. package/esm/components/indicator/index.mjs.map +1 -0
  17. package/esm/components/indicator/indicator.mjs +496 -0
  18. package/esm/components/indicator/indicator.mjs.map +1 -0
  19. package/esm/components/indicator/indicator.module.mjs +11 -0
  20. package/esm/components/indicator/indicator.module.mjs.map +1 -0
  21. package/esm/components/indicator/indicator.utils.mjs +27 -0
  22. package/esm/components/indicator/indicator.utils.mjs.map +1 -0
  23. package/esm/index.mjs +3 -1
  24. package/esm/index.mjs.map +1 -1
  25. package/lib/components/index.d.ts +1 -0
  26. package/lib/components/indicator/get-position-variables/get-position-variables.d.ts +5 -0
  27. package/lib/components/indicator/index.d.ts +6 -0
  28. package/lib/components/indicator/indicator.types.d.ts +82 -0
  29. package/lib/components/indicator/indicator.utils.d.ts +6 -0
  30. package/package.json +1 -1
  31. package/styles/indicator.css +64 -0
  32. package/styles/indicator.layer.css +65 -0
  33. package/styles.css +65 -0
  34. package/styles.layer.css +65 -0
package/cjs/index.cjs CHANGED
@@ -89,15 +89,16 @@ const require_index$30 = require("./components/focus-trap/index.cjs");
89
89
  const require_index$31 = require("./components/grid/index.cjs");
90
90
  const require_index$32 = require("./components/group/index.cjs");
91
91
  const require_index$33 = require("./components/image/index.cjs");
92
- const require_index$34 = require("./components/paper/index.cjs");
93
- const require_index$35 = require("./components/semi-circle-progress/index.cjs");
94
- const require_index$36 = require("./components/simple-grid/index.cjs");
95
- const require_index$37 = require("./components/skeleton/index.cjs");
96
- const require_index$38 = require("./components/space/index.cjs");
97
- const require_index$39 = require("./components/splitter/index.cjs");
98
- const require_index$40 = require("./components/stack/index.cjs");
99
- const require_index$41 = require("./components/typography/index.cjs");
100
- const require_index$42 = require("./components/visually-hidden/index.cjs");
92
+ const require_index$34 = require("./components/indicator/index.cjs");
93
+ const require_index$35 = require("./components/paper/index.cjs");
94
+ const require_index$36 = require("./components/semi-circle-progress/index.cjs");
95
+ const require_index$37 = require("./components/simple-grid/index.cjs");
96
+ const require_index$38 = require("./components/skeleton/index.cjs");
97
+ const require_index$39 = require("./components/space/index.cjs");
98
+ const require_index$40 = require("./components/splitter/index.cjs");
99
+ const require_index$41 = require("./components/stack/index.cjs");
100
+ const require_index$42 = require("./components/typography/index.cjs");
101
+ const require_index$43 = require("./components/visually-hidden/index.cjs");
101
102
  let _vue_shared = require("@vue/shared");
102
103
  //#region packages/@cck-ui/core/src/index.ts
103
104
  const INSTALLED_KEY = Symbol("INSTALLED_KEY");
@@ -144,20 +145,21 @@ const components = [
144
145
  require_index$31.CGrid,
145
146
  require_index$32.CGroup,
146
147
  require_index$33.CImage,
148
+ require_index$34.CIndicator,
147
149
  require_index$4.CLoader,
148
- require_index$34.CPaper,
150
+ require_index$35.CPaper,
149
151
  require_index$7.CPortal,
150
- require_index$35.CSemiCircleProgress,
151
- require_index$36.CSimpleGrid,
152
- require_index$37.CSkeleton,
153
- require_index$38.CSpace,
154
- require_index$39.CSplitter,
155
- require_index$39.CSplitterPane,
156
- require_index$40.CStack,
152
+ require_index$36.CSemiCircleProgress,
153
+ require_index$37.CSimpleGrid,
154
+ require_index$38.CSkeleton,
155
+ require_index$39.CSpace,
156
+ require_index$40.CSplitter,
157
+ require_index$40.CSplitterPane,
158
+ require_index$41.CStack,
157
159
  require_index$11.CText,
158
160
  require_index$5.CTransition,
159
- require_index$41.CTypography,
160
- require_index$42.CVisuallyHidden,
161
+ require_index$42.CTypography,
162
+ require_index$43.CVisuallyHidden,
161
163
  require_index$3.UnstyledButton
162
164
  ];
163
165
  const CckUI = { install(app) {
@@ -211,21 +213,22 @@ exports.CFocusTrap = require_index$30.CFocusTrap;
211
213
  exports.CGrid = require_index$31.CGrid;
212
214
  exports.CGroup = require_index$32.CGroup;
213
215
  exports.CImage = require_index$33.CImage;
216
+ exports.CIndicator = require_index$34.CIndicator;
214
217
  exports.CLoader = require_index$4.CLoader;
215
218
  exports.CONFIG_KEY = require_config_provider_types.CONFIG_KEY;
216
- exports.CPaper = require_index$34.CPaper;
219
+ exports.CPaper = require_index$35.CPaper;
217
220
  exports.CPortal = require_index$7.CPortal;
218
- exports.CSemiCircleProgress = require_index$35.CSemiCircleProgress;
219
- exports.CSimpleGrid = require_index$36.CSimpleGrid;
220
- exports.CSkeleton = require_index$37.CSkeleton;
221
- exports.CSpace = require_index$38.CSpace;
222
- exports.CSplitter = require_index$39.CSplitter;
223
- exports.CSplitterPane = require_index$39.CSplitterPane;
224
- exports.CStack = require_index$40.CStack;
221
+ exports.CSemiCircleProgress = require_index$36.CSemiCircleProgress;
222
+ exports.CSimpleGrid = require_index$37.CSimpleGrid;
223
+ exports.CSkeleton = require_index$38.CSkeleton;
224
+ exports.CSpace = require_index$39.CSpace;
225
+ exports.CSplitter = require_index$40.CSplitter;
226
+ exports.CSplitterPane = require_index$40.CSplitterPane;
227
+ exports.CStack = require_index$41.CStack;
225
228
  exports.CText = require_index$11.CText;
226
229
  exports.CTransition = require_index$5.CTransition;
227
- exports.CTypography = require_index$41.CTypography;
228
- exports.CVisuallyHidden = require_index$42.CVisuallyHidden;
230
+ exports.CTypography = require_index$42.CTypography;
231
+ exports.CVisuallyHidden = require_index$43.CVisuallyHidden;
229
232
  exports.CckConfigProvider = require_index$1.CckConfigProvider;
230
233
  exports.CckUI = CckUI;
231
234
  exports.default = CckUI;
package/cjs/index.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["CckConfigProvider","CBox","CActionIcon","CActionIconGroup","CActionIconGroupSection","CAffix","CAlert","CAnchor","CAspectRatio","CAvatar","CAvatarGroup","CBackgroundImage","CBadge","CBreadcrumbs","CBurger","CButton","CButtonGroup","CButtonGroupSection","CCard","CCardSection","CCenter","CCloseButton","CCol","CColorSwatch","CContainer","CCopyButton","CDataList","CDataListItem","CDataListItemLabel","CDataListItemValue","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 CAffix,\n CAlert,\n CAnchor,\n CAspectRatio,\n CAvatar,\n CAvatarGroup,\n CBackgroundImage,\n CBadge,\n CBreadcrumbs,\n CBurger,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCard,\n CCardSection,\n CCenter,\n CCloseButton,\n CCol,\n CColorSwatch,\n CContainer,\n CCopyButton,\n CDataList,\n CDataListItem,\n CDataListItemLabel,\n CDataListItemValue,\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 CAffix,\n CAlert,\n CAnchor,\n CAspectRatio,\n CAvatar,\n CAvatarGroup,\n CBackgroundImage,\n CBadge,\n CBreadcrumbs,\n CBurger,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCard,\n CCardSection,\n CCenter,\n CCloseButton,\n CCol,\n CColorSwatch,\n CContainer,\n CCopyButton,\n CDataList,\n CDataListItem,\n CDataListItemLabel,\n CDataListItemValue,\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,MAAM,gBAAgB,OAAO,eAAe;AAE5C,MAAM,aAAa;CACjBA,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;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,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,gBAAAA;CACAC,iBAAAA;CACAC,gBAAAA;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","CAffix","CAlert","CAnchor","CAspectRatio","CAvatar","CAvatarGroup","CBackgroundImage","CBadge","CBreadcrumbs","CBurger","CButton","CButtonGroup","CButtonGroupSection","CCard","CCardSection","CCenter","CCloseButton","CCol","CColorSwatch","CContainer","CCopyButton","CDataList","CDataListItem","CDataListItemLabel","CDataListItemValue","CDivider","CEmptyState","CEmptyStateActions","CEmptyStateDescription","CEmptyStateIndicator","CEmptyStateTitle","CFileButton","CFlex","CFocusTrap","CGrid","CGroup","CImage","CIndicator","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 CAffix,\n CAlert,\n CAnchor,\n CAspectRatio,\n CAvatar,\n CAvatarGroup,\n CBackgroundImage,\n CBadge,\n CBreadcrumbs,\n CBurger,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCard,\n CCardSection,\n CCenter,\n CCloseButton,\n CCol,\n CColorSwatch,\n CContainer,\n CCopyButton,\n CDataList,\n CDataListItem,\n CDataListItemLabel,\n CDataListItemValue,\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 CIndicator,\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 CAffix,\n CAlert,\n CAnchor,\n CAspectRatio,\n CAvatar,\n CAvatarGroup,\n CBackgroundImage,\n CBadge,\n CBreadcrumbs,\n CBurger,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCard,\n CCardSection,\n CCenter,\n CCloseButton,\n CCol,\n CColorSwatch,\n CContainer,\n CCopyButton,\n CDataList,\n CDataListItem,\n CDataListItemLabel,\n CDataListItemValue,\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 CIndicator,\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,MAAM,gBAAgB,OAAO,eAAe;AAE5C,MAAM,aAAa;CACjBA,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;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,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,gBAAAA;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,47 @@
1
+ "use client";
2
+ import { rem } from "../../../core/utils/units-converters/rem.mjs";
3
+ //#region packages/@cck-ui/core/src/components/indicator/get-position-variables/get-position-variables.ts
4
+ function getPositionVariables(_position = "top-end", offset = 0) {
5
+ const variables = {
6
+ "--indicator-top": void 0,
7
+ "--indicator-bottom": void 0,
8
+ "--indicator-left": void 0,
9
+ "--indicator-right": void 0,
10
+ "--indicator-translate-x": void 0,
11
+ "--indicator-translate-y": void 0
12
+ };
13
+ const offsetX = typeof offset === "number" ? offset : offset.x;
14
+ const offsetY = typeof offset === "number" ? offset : offset.y;
15
+ const _offsetX = rem(offsetX);
16
+ const _offsetY = rem(offsetY);
17
+ const [position, placement] = _position.split("-");
18
+ if (position === "top") {
19
+ variables["--indicator-top"] = _offsetY;
20
+ variables["--indicator-translate-y"] = "-50%";
21
+ }
22
+ if (position === "middle") {
23
+ variables["--indicator-top"] = "50%";
24
+ variables["--indicator-translate-y"] = "-50%";
25
+ }
26
+ if (position === "bottom") {
27
+ variables["--indicator-bottom"] = _offsetY;
28
+ variables["--indicator-translate-y"] = "50%";
29
+ }
30
+ if (placement === "start") {
31
+ variables["--indicator-left"] = _offsetX;
32
+ variables["--indicator-translate-x"] = "-50%";
33
+ }
34
+ if (placement === "center") {
35
+ variables["--indicator-left"] = "50%";
36
+ variables["--indicator-translate-x"] = "-50%";
37
+ }
38
+ if (placement === "end") {
39
+ variables["--indicator-right"] = _offsetX;
40
+ variables["--indicator-translate-x"] = "50%";
41
+ }
42
+ return variables;
43
+ }
44
+ //#endregion
45
+ export { getPositionVariables };
46
+
47
+ //# sourceMappingURL=get-position-variables.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-position-variables.mjs","names":[],"sources":["../../../../src/components/indicator/get-position-variables/get-position-variables.ts"],"sourcesContent":["import { rem } from '../../../core'\nimport type { IndicatorPosition, IndicatorPositionVariables } from '../indicator.types'\n\nexport function getPositionVariables(\n _position: IndicatorPosition = 'top-end',\n offset: number | { x: number; y: number } = 0\n) {\n const variables: Record<IndicatorPositionVariables, string | undefined> = {\n '--indicator-top': undefined,\n '--indicator-bottom': undefined,\n '--indicator-left': undefined,\n '--indicator-right': undefined,\n '--indicator-translate-x': undefined,\n '--indicator-translate-y': undefined,\n }\n\n const offsetX = typeof offset === 'number' ? offset : offset.x\n const offsetY = typeof offset === 'number' ? offset : offset.y\n\n const _offsetX = rem(offsetX)\n const _offsetY = rem(offsetY)\n const [position, placement] = _position.split('-')\n\n if (position === 'top') {\n variables['--indicator-top'] = _offsetY\n variables['--indicator-translate-y'] = '-50%'\n }\n\n if (position === 'middle') {\n variables['--indicator-top'] = '50%'\n variables['--indicator-translate-y'] = '-50%'\n }\n\n if (position === 'bottom') {\n variables['--indicator-bottom'] = _offsetY\n variables['--indicator-translate-y'] = '50%'\n }\n\n if (placement === 'start') {\n variables['--indicator-left'] = _offsetX\n variables['--indicator-translate-x'] = '-50%'\n }\n\n if (placement === 'center') {\n variables['--indicator-left'] = '50%'\n variables['--indicator-translate-x'] = '-50%'\n }\n\n if (placement === 'end') {\n variables['--indicator-right'] = _offsetX\n variables['--indicator-translate-x'] = '50%'\n }\n\n return variables\n}\n"],"mappings":";;;AAGA,SAAgB,qBACd,YAA+B,WAC/B,SAA4C,GAC5C;CACA,MAAM,YAAoE;EACxE,mBAAmB,KAAA;EACnB,sBAAsB,KAAA;EACtB,oBAAoB,KAAA;EACpB,qBAAqB,KAAA;EACrB,2BAA2B,KAAA;EAC3B,2BAA2B,KAAA;CAC7B;CAEA,MAAM,UAAU,OAAO,WAAW,WAAW,SAAS,OAAO;CAC7D,MAAM,UAAU,OAAO,WAAW,WAAW,SAAS,OAAO;CAE7D,MAAM,WAAW,IAAI,OAAO;CAC5B,MAAM,WAAW,IAAI,OAAO;CAC5B,MAAM,CAAC,UAAU,aAAa,UAAU,MAAM,GAAG;CAEjD,IAAI,aAAa,OAAO;EACtB,UAAU,qBAAqB;EAC/B,UAAU,6BAA6B;CACzC;CAEA,IAAI,aAAa,UAAU;EACzB,UAAU,qBAAqB;EAC/B,UAAU,6BAA6B;CACzC;CAEA,IAAI,aAAa,UAAU;EACzB,UAAU,wBAAwB;EAClC,UAAU,6BAA6B;CACzC;CAEA,IAAI,cAAc,SAAS;EACzB,UAAU,sBAAsB;EAChC,UAAU,6BAA6B;CACzC;CAEA,IAAI,cAAc,UAAU;EAC1B,UAAU,sBAAsB;EAChC,UAAU,6BAA6B;CACzC;CAEA,IAAI,cAAc,OAAO;EACvB,UAAU,uBAAuB;EACjC,UAAU,6BAA6B;CACzC;CAEA,OAAO;AACT"}
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ import { withInstall } from "../../core/utils/vue/install.mjs";
3
+ import { withClasses, withExtend, withPropsFactory, withVarsResolver } from "../../core/utils/vue/statics.mjs";
4
+ import indicator_module_default from "./indicator.module.mjs";
5
+ import { varsResolver } from "./indicator.utils.mjs";
6
+ import indicator_default from "./indicator.mjs";
7
+ const CIndicator = withInstall(withPropsFactory(withExtend(withVarsResolver(withClasses(indicator_default, indicator_module_default), varsResolver))));
8
+ //#endregion
9
+ export { CIndicator, CIndicator as default };
10
+
11
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["Indicator","classes"],"sources":["../../../src/components/indicator/index.ts"],"sourcesContent":["import {\n SFCWithInstallAndClasses,\n withClasses,\n withExtend,\n withInstall,\n withPropsFactory,\n withVarsResolver,\n} from '../../core'\nimport classes from './indicator.module.css'\nimport { varsResolver } from './indicator.utils'\nimport Indicator from './indicator.vue'\n\nconst IndicatorWithStatic = withPropsFactory(\n withExtend(withVarsResolver(withClasses(Indicator, classes), varsResolver))\n)\n\nexport const CIndicator: SFCWithInstallAndClasses<typeof Indicator, typeof classes> =\n withInstall(IndicatorWithStatic)\n\nexport default CIndicator\n\nexport * from './indicator.types'\n"],"mappings":";;;;;;AAgBA,MAAa,aACX,YAL0B,iBAC1B,WAAW,iBAAiB,YAAYA,mBAAWC,wBAAO,GAAG,YAAY,CAAC,CAI9D,CAAmB"}
@@ -0,0 +1,496 @@
1
+ "use client";
2
+ import { isNumber } from "../../core/utils/types/index.mjs";
3
+ import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.mjs";
4
+ import { useComponentProps } from "../../core/config-provider/use-component-props/use-component-props.mjs";
5
+ import { CBox } from "../../core/box/index.mjs";
6
+ import { useStyles } from "../../core/styles-api/use-styles/use-styles.mjs";
7
+ import indicator_module_default from "./indicator.module.mjs";
8
+ import { varsResolver } from "./indicator.utils.mjs";
9
+ import { computed, createBlock, createCommentVNode, createElementBlock, defineComponent, mergeProps, openBlock, ref, renderSlot, useAttrs, useSlots, withCtx } from "vue";
10
+ //#region packages/@cck-ui/core/src/components/indicator/indicator.vue
11
+ const _sfc_main = /*@__PURE__*/ defineComponent({
12
+ name: "CIndicator",
13
+ __name: "indicator",
14
+ props: {
15
+ position: {
16
+ type: null,
17
+ required: false
18
+ },
19
+ offset: {
20
+ type: [Number, Object],
21
+ required: false
22
+ },
23
+ inline: {
24
+ type: Boolean,
25
+ required: false
26
+ },
27
+ size: {
28
+ type: [Number, String],
29
+ required: false
30
+ },
31
+ label: {
32
+ type: [String, Number],
33
+ required: false
34
+ },
35
+ radius: {
36
+ type: null,
37
+ required: false
38
+ },
39
+ color: {
40
+ type: null,
41
+ required: false
42
+ },
43
+ withBorder: {
44
+ type: Boolean,
45
+ required: false
46
+ },
47
+ disabled: {
48
+ type: Boolean,
49
+ required: false
50
+ },
51
+ processing: {
52
+ type: Boolean,
53
+ required: false
54
+ },
55
+ zIndex: {
56
+ type: String,
57
+ required: false
58
+ },
59
+ autoContrast: {
60
+ type: Boolean,
61
+ required: false
62
+ },
63
+ maxValue: {
64
+ type: Number,
65
+ required: false
66
+ },
67
+ showZero: {
68
+ type: Boolean,
69
+ required: false
70
+ },
71
+ className: {
72
+ type: String,
73
+ required: false
74
+ },
75
+ style: {
76
+ type: [
77
+ Object,
78
+ Function,
79
+ Array
80
+ ],
81
+ required: false,
82
+ skipCheck: true
83
+ },
84
+ __vars: {
85
+ type: null,
86
+ required: false
87
+ },
88
+ __size: {
89
+ type: String,
90
+ required: false
91
+ },
92
+ hiddenFrom: {
93
+ type: null,
94
+ required: false
95
+ },
96
+ visibleFrom: {
97
+ type: null,
98
+ required: false
99
+ },
100
+ lightHidden: {
101
+ type: Boolean,
102
+ required: false
103
+ },
104
+ darkHidden: {
105
+ type: Boolean,
106
+ required: false
107
+ },
108
+ mod: {
109
+ type: [
110
+ Object,
111
+ String,
112
+ Array
113
+ ],
114
+ required: false
115
+ },
116
+ m: {
117
+ type: null,
118
+ required: false
119
+ },
120
+ my: {
121
+ type: null,
122
+ required: false
123
+ },
124
+ mx: {
125
+ type: null,
126
+ required: false
127
+ },
128
+ mt: {
129
+ type: null,
130
+ required: false
131
+ },
132
+ mb: {
133
+ type: null,
134
+ required: false
135
+ },
136
+ ms: {
137
+ type: null,
138
+ required: false
139
+ },
140
+ me: {
141
+ type: null,
142
+ required: false
143
+ },
144
+ mis: {
145
+ type: null,
146
+ required: false
147
+ },
148
+ mie: {
149
+ type: null,
150
+ required: false
151
+ },
152
+ ml: {
153
+ type: null,
154
+ required: false
155
+ },
156
+ mr: {
157
+ type: null,
158
+ required: false
159
+ },
160
+ p: {
161
+ type: null,
162
+ required: false
163
+ },
164
+ py: {
165
+ type: null,
166
+ required: false
167
+ },
168
+ px: {
169
+ type: null,
170
+ required: false
171
+ },
172
+ pt: {
173
+ type: null,
174
+ required: false
175
+ },
176
+ pb: {
177
+ type: null,
178
+ required: false
179
+ },
180
+ ps: {
181
+ type: null,
182
+ required: false
183
+ },
184
+ pe: {
185
+ type: null,
186
+ required: false
187
+ },
188
+ pis: {
189
+ type: null,
190
+ required: false
191
+ },
192
+ pie: {
193
+ type: null,
194
+ required: false
195
+ },
196
+ pl: {
197
+ type: null,
198
+ required: false
199
+ },
200
+ pr: {
201
+ type: null,
202
+ required: false
203
+ },
204
+ bd: {
205
+ type: null,
206
+ required: false
207
+ },
208
+ bdrs: {
209
+ type: null,
210
+ required: false
211
+ },
212
+ bg: {
213
+ type: null,
214
+ required: false
215
+ },
216
+ c: {
217
+ type: null,
218
+ required: false
219
+ },
220
+ opacity: {
221
+ type: [
222
+ String,
223
+ Object,
224
+ Number
225
+ ],
226
+ required: false
227
+ },
228
+ ff: {
229
+ type: [String, Object],
230
+ required: false
231
+ },
232
+ fz: {
233
+ type: null,
234
+ required: false
235
+ },
236
+ fw: {
237
+ type: null,
238
+ required: false
239
+ },
240
+ lts: {
241
+ type: null,
242
+ required: false
243
+ },
244
+ ta: {
245
+ type: [String, Object],
246
+ required: false
247
+ },
248
+ lh: {
249
+ type: null,
250
+ required: false
251
+ },
252
+ fs: {
253
+ type: null,
254
+ required: false
255
+ },
256
+ tt: {
257
+ type: [String, Object],
258
+ required: false
259
+ },
260
+ td: {
261
+ type: null,
262
+ required: false
263
+ },
264
+ w: {
265
+ type: null,
266
+ required: false
267
+ },
268
+ miw: {
269
+ type: null,
270
+ required: false
271
+ },
272
+ maw: {
273
+ type: null,
274
+ required: false
275
+ },
276
+ h: {
277
+ type: null,
278
+ required: false
279
+ },
280
+ mih: {
281
+ type: null,
282
+ required: false
283
+ },
284
+ mah: {
285
+ type: null,
286
+ required: false
287
+ },
288
+ bgsz: {
289
+ type: null,
290
+ required: false
291
+ },
292
+ bgp: {
293
+ type: null,
294
+ required: false
295
+ },
296
+ bgr: {
297
+ type: null,
298
+ required: false
299
+ },
300
+ bga: {
301
+ type: null,
302
+ required: false
303
+ },
304
+ pos: {
305
+ type: [String, Object],
306
+ required: false
307
+ },
308
+ top: {
309
+ type: null,
310
+ required: false
311
+ },
312
+ left: {
313
+ type: null,
314
+ required: false
315
+ },
316
+ bottom: {
317
+ type: null,
318
+ required: false
319
+ },
320
+ right: {
321
+ type: null,
322
+ required: false
323
+ },
324
+ inset: {
325
+ type: null,
326
+ required: false
327
+ },
328
+ display: {
329
+ type: null,
330
+ required: false
331
+ },
332
+ flex: {
333
+ type: null,
334
+ required: false
335
+ },
336
+ unstyled: {
337
+ type: Boolean,
338
+ required: false
339
+ },
340
+ variant: {
341
+ type: null,
342
+ required: false
343
+ },
344
+ classNames: {
345
+ type: null,
346
+ required: false
347
+ },
348
+ styles: {
349
+ type: null,
350
+ required: false
351
+ },
352
+ vars: {
353
+ type: Function,
354
+ required: false
355
+ },
356
+ attributes: {
357
+ type: null,
358
+ required: false
359
+ }
360
+ },
361
+ setup(__props, { expose: __expose }) {
362
+ const _root = ref(null);
363
+ const _indicator = ref(null);
364
+ const attrs = useAttrs();
365
+ const slots = useSlots();
366
+ const rawProps = __props;
367
+ const defaultProps = {
368
+ position: "top-end",
369
+ offset: 0,
370
+ showZero: true
371
+ };
372
+ const props = useComponentProps({
373
+ component: "CIndicator",
374
+ defaultProps,
375
+ props: rawProps
376
+ });
377
+ const styleProps = computed(() => ({
378
+ ...props.value,
379
+ ...attrs,
380
+ style: attrs.style ?? props.value.style
381
+ }));
382
+ const knownProps = [
383
+ "style",
384
+ "className",
385
+ "styles",
386
+ "classNames",
387
+ "unstyled",
388
+ "vars",
389
+ "position",
390
+ "offset",
391
+ "inline",
392
+ "label",
393
+ "radius",
394
+ "color",
395
+ "withBorder",
396
+ "disabled",
397
+ "processing",
398
+ "zIndex",
399
+ "autoContrast",
400
+ "maxValue",
401
+ "showZero",
402
+ "mod",
403
+ "attributes"
404
+ ];
405
+ const getStyles = useStyles({
406
+ name: "Indicator",
407
+ classes: indicator_module_default,
408
+ props: styleProps,
409
+ className: () => props.value.className,
410
+ style: () => props.value.style,
411
+ classNames: props.value.classNames,
412
+ styles: props.value.styles,
413
+ unstyled: props.value.unstyled,
414
+ attributes: props.value.attributes,
415
+ vars: props.value.vars,
416
+ varsResolver
417
+ });
418
+ const modList = computed(() => [{ inline: props.value.inline }]);
419
+ const rootAttrs = computed(() => getStyles("root"));
420
+ const mergedRootAttrs = computed(() => {
421
+ const others = {};
422
+ const propsValue = props.value;
423
+ for (const key in propsValue) if (!knownProps.includes(key)) others[key] = propsValue[key];
424
+ const userMod = props.value.mod;
425
+ const mergedMod = [...Array.isArray(userMod) ? userMod : [userMod], ...modList.value];
426
+ return {
427
+ ...others,
428
+ mod: mergedMod,
429
+ ...rootAttrs.value
430
+ };
431
+ });
432
+ const shouldHideZero = computed(() => !props.value.showZero && Number(props.value.label) === 0);
433
+ const formattedLabel = computed(() => props.value.maxValue !== void 0 && isNumber(props.value.label) && Number(props.value.label) > props.value.maxValue ? `${props.value.maxValue}+` : props.value.label);
434
+ const indicatorAttrs = computed(() => getStyles("indicator"));
435
+ const mergedIndicatorAttrs = computed(() => ({
436
+ mod: [
437
+ { "with-label": !!props.value.label },
438
+ { "with-border": props.value.withBorder },
439
+ { processing: props.value.processing }
440
+ ],
441
+ ...indicatorAttrs.value
442
+ }));
443
+ __expose({
444
+ root: computed(() => _root.value?.root ?? null),
445
+ indicator: computed(() => _indicator.value?.root ?? null)
446
+ });
447
+ const __returned__ = {
448
+ _root,
449
+ _indicator,
450
+ attrs,
451
+ slots,
452
+ rawProps,
453
+ defaultProps,
454
+ props,
455
+ styleProps,
456
+ knownProps,
457
+ getStyles,
458
+ modList,
459
+ rootAttrs,
460
+ mergedRootAttrs,
461
+ shouldHideZero,
462
+ formattedLabel,
463
+ indicatorAttrs,
464
+ mergedIndicatorAttrs,
465
+ get CBox() {
466
+ return CBox;
467
+ }
468
+ };
469
+ Object.defineProperty(__returned__, "__isScriptSetup", {
470
+ enumerable: false,
471
+ value: true
472
+ });
473
+ return __returned__;
474
+ }
475
+ });
476
+ const _hoisted_1 = ["innerHTML"];
477
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
478
+ return openBlock(), createBlock($setup["CBox"], mergeProps({ ref: "_root" }, $setup.mergedRootAttrs), {
479
+ default: withCtx(() => [!$setup.props.disabled && !$setup.shouldHideZero ? (openBlock(), createBlock($setup["CBox"], mergeProps({
480
+ key: 0,
481
+ ref: "_indicator"
482
+ }, $setup.mergedIndicatorAttrs), {
483
+ default: withCtx(() => [renderSlot(_ctx.$slots, "label", {}, () => [$setup.formattedLabel != null ? (openBlock(), createElementBlock("span", {
484
+ key: 0,
485
+ innerHTML: $setup.formattedLabel
486
+ }, null, 8, _hoisted_1)) : createCommentVNode("v-if", true)])]),
487
+ _: 3
488
+ }, 16)) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "default")]),
489
+ _: 3
490
+ }, 16);
491
+ }
492
+ var indicator_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/cck-ui/cck-ui/packages/@cck-ui/core/src/components/indicator/indicator.vue"]]);
493
+ //#endregion
494
+ export { indicator_default as default };
495
+
496
+ //# sourceMappingURL=indicator.mjs.map