@cck-ui/core 0.37.0 → 0.39.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 (43) hide show
  1. package/cjs/components/indicator/indicator.cjs +1 -1
  2. package/cjs/components/indicator/indicator.cjs.map +1 -1
  3. package/cjs/components/kbd/index.cjs +14 -0
  4. package/cjs/components/kbd/index.cjs.map +1 -0
  5. package/cjs/components/kbd/kbd.cjs +396 -0
  6. package/cjs/components/kbd/kbd.cjs.map +1 -0
  7. package/cjs/components/kbd/kbd.module.cjs +7 -0
  8. package/cjs/components/kbd/kbd.module.cjs.map +1 -0
  9. package/cjs/components/kbd/kbd.utils.cjs +8 -0
  10. package/cjs/components/kbd/kbd.utils.cjs.map +1 -0
  11. package/cjs/components/number-formatter/index.cjs +12 -0
  12. package/cjs/components/number-formatter/index.cjs.map +1 -0
  13. package/cjs/components/number-formatter/number-formatter.cjs +120 -0
  14. package/cjs/components/number-formatter/number-formatter.cjs.map +1 -0
  15. package/cjs/index.cjs +35 -29
  16. package/cjs/index.cjs.map +1 -1
  17. package/esm/components/indicator/indicator.mjs +1 -1
  18. package/esm/components/indicator/indicator.mjs.map +1 -1
  19. package/esm/components/kbd/index.mjs +11 -0
  20. package/esm/components/kbd/index.mjs.map +1 -0
  21. package/esm/components/kbd/kbd.mjs +396 -0
  22. package/esm/components/kbd/kbd.mjs.map +1 -0
  23. package/esm/components/kbd/kbd.module.mjs +7 -0
  24. package/esm/components/kbd/kbd.module.mjs.map +1 -0
  25. package/esm/components/kbd/kbd.utils.mjs +9 -0
  26. package/esm/components/kbd/kbd.utils.mjs.map +1 -0
  27. package/esm/components/number-formatter/index.mjs +9 -0
  28. package/esm/components/number-formatter/index.mjs.map +1 -0
  29. package/esm/components/number-formatter/number-formatter.mjs +120 -0
  30. package/esm/components/number-formatter/number-formatter.mjs.map +1 -0
  31. package/esm/index.mjs +5 -1
  32. package/esm/index.mjs.map +1 -1
  33. package/lib/components/index.d.ts +2 -0
  34. package/lib/components/kbd/index.d.ts +6 -0
  35. package/lib/components/kbd/kbd.types.d.ts +18 -0
  36. package/lib/components/kbd/kbd.utils.d.ts +6 -0
  37. package/lib/components/number-formatter/index.d.ts +5 -0
  38. package/lib/components/number-formatter/number-formatter.types.d.ts +36 -0
  39. package/package.json +1 -1
  40. package/styles/kbd.css +31 -0
  41. package/styles/kbd.layer.css +32 -0
  42. package/styles.css +32 -0
  43. package/styles.layer.css +32 -0
@@ -0,0 +1,120 @@
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 { computed, createCommentVNode, createElementBlock, defineComponent, openBlock, toDisplayString } from "vue";
5
+ //#region packages/@cck-ui/core/src/components/number-formatter/number-formatter.vue
6
+ const _sfc_main = /*@__PURE__*/ defineComponent({
7
+ name: "CNumberFormatter",
8
+ __name: "number-formatter",
9
+ props: {
10
+ value: {
11
+ type: [Number, String],
12
+ required: false
13
+ },
14
+ allowNegative: {
15
+ type: Boolean,
16
+ required: false
17
+ },
18
+ decimalScale: {
19
+ type: Number,
20
+ required: false
21
+ },
22
+ decimalSeparator: {
23
+ type: String,
24
+ required: false
25
+ },
26
+ fixedDecimalScale: {
27
+ type: Boolean,
28
+ required: false
29
+ },
30
+ prefix: {
31
+ type: String,
32
+ required: false
33
+ },
34
+ suffix: {
35
+ type: String,
36
+ required: false
37
+ },
38
+ thousandsGroupStyle: {
39
+ type: String,
40
+ required: false
41
+ },
42
+ thousandSeparator: {
43
+ type: [String, Boolean],
44
+ required: false
45
+ }
46
+ },
47
+ setup(__props, { expose: __expose }) {
48
+ __expose();
49
+ const rawProps = __props;
50
+ const defaultProps = {
51
+ allowNegative: true,
52
+ decimalScale: Infinity,
53
+ decimalSeparator: ".",
54
+ fixedDecimalScale: false,
55
+ thousandSeparator: ",",
56
+ thousandsGroupStyle: "thousand",
57
+ prefix: "",
58
+ suffix: ""
59
+ };
60
+ const props = useComponentProps({
61
+ component: "CNumberFormatter",
62
+ defaultProps,
63
+ props: rawProps
64
+ });
65
+ const __returned__ = {
66
+ rawProps,
67
+ defaultProps,
68
+ props,
69
+ formatted: computed(() => {
70
+ const { value, allowNegative, decimalScale, decimalSeparator, fixedDecimalScale, prefix, suffix, thousandSeparator, thousandsGroupStyle } = props.value;
71
+ if (value === void 0 || value === null) return null;
72
+ let num = typeof value === "string" ? parseFloat(value) : value;
73
+ if (isNaN(num)) return String(value);
74
+ if (!allowNegative && num < 0) num = Math.abs(num);
75
+ let [intPart, decPart] = num.toString().split(".");
76
+ if (decPart === void 0) decPart = "";
77
+ if (decimalScale !== void 0 && Number.isFinite(decimalScale)) {
78
+ const factor = 10 ** decimalScale;
79
+ num = Math.round(num * factor) / factor;
80
+ const parts = num.toString().split(".");
81
+ intPart = parts[0];
82
+ decPart = parts[1] || "";
83
+ if (fixedDecimalScale) decPart = decPart.padEnd(decimalScale, "0");
84
+ else if (decimalScale === 0) decPart = "";
85
+ }
86
+ let sep = defaultProps.thousandSeparator;
87
+ if (typeof thousandSeparator === "string") sep = thousandSeparator === "" ? defaultProps.thousandSeparator : thousandSeparator;
88
+ else if (typeof thousandSeparator === "boolean") sep = thousandSeparator ? defaultProps.thousandSeparator : "";
89
+ let formattedInt = intPart;
90
+ if (sep && thousandsGroupStyle !== "none") if (thousandsGroupStyle === "thousand") formattedInt = intPart.replace(/\B(?=(\d{3})+(?!\d))/g, sep);
91
+ else if (thousandsGroupStyle === "wan") formattedInt = intPart.replace(/\B(?=(\d{4})+(?!\d))/g, sep);
92
+ else if (thousandsGroupStyle === "lakh") {
93
+ const len = intPart.length;
94
+ if (len <= 3) formattedInt = intPart;
95
+ else {
96
+ const firstGroup = len % 2 === 0 ? 2 : 1;
97
+ formattedInt = [intPart.slice(0, firstGroup), ...intPart.slice(firstGroup).match(/.{1,2}/g) || []].join(sep);
98
+ }
99
+ } else formattedInt = intPart;
100
+ let result = formattedInt;
101
+ if (decPart) result += decimalSeparator + decPart;
102
+ return prefix + result + suffix;
103
+ })
104
+ };
105
+ Object.defineProperty(__returned__, "__isScriptSetup", {
106
+ enumerable: false,
107
+ value: true
108
+ });
109
+ return __returned__;
110
+ }
111
+ });
112
+ const _hoisted_1 = { key: 0 };
113
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
114
+ return $setup.formatted !== null ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString($setup.formatted), 1)) : createCommentVNode("v-if", true);
115
+ }
116
+ var number_formatter_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/cck-ui/cck-ui/packages/@cck-ui/core/src/components/number-formatter/number-formatter.vue"]]);
117
+ //#endregion
118
+ export { number_formatter_default as default };
119
+
120
+ //# sourceMappingURL=number-formatter.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-formatter.mjs","names":[],"sources":["../../../src/components/number-formatter/number-formatter.vue"],"sourcesContent":["<template>\n <span v-if=\"formatted !== null\">{{ formatted }}</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { useComponentProps } from '../../core'\nimport { NumberFormatterProps } from './number-formatter.types'\n\ndefineOptions({\n name: 'CNumberFormatter',\n})\n\nconst rawProps = defineProps<NumberFormatterProps>()\n\nconst defaultProps: Partial<NumberFormatterProps> = {\n allowNegative: true,\n decimalScale: Infinity,\n decimalSeparator: '.',\n fixedDecimalScale: false,\n thousandSeparator: ',',\n thousandsGroupStyle: 'thousand',\n prefix: '',\n suffix: '',\n}\n\nconst props = useComponentProps({\n component: 'CNumberFormatter',\n defaultProps,\n props: rawProps,\n})\n\nconst formatted = computed(() => {\n const {\n value,\n allowNegative,\n decimalScale,\n decimalSeparator,\n fixedDecimalScale,\n prefix,\n suffix,\n thousandSeparator,\n thousandsGroupStyle,\n } = props.value\n\n if (value === undefined || value === null) {\n return null\n }\n\n let num = typeof value === 'string' ? parseFloat(value) : value\n if (isNaN(num)) {\n return String(value)\n }\n\n if (!allowNegative && num < 0) {\n num = Math.abs(num)\n }\n\n let [intPart, decPart] = num.toString().split('.')\n if (decPart === undefined) {\n decPart = ''\n }\n\n if (decimalScale !== undefined && Number.isFinite(decimalScale)) {\n const factor = 10 ** decimalScale\n num = Math.round(num * factor) / factor\n const parts = num.toString().split('.')\n intPart = parts[0]\n decPart = parts[1] || ''\n if (fixedDecimalScale) {\n decPart = decPart.padEnd(decimalScale, '0')\n } else if (decimalScale === 0) {\n decPart = ''\n }\n }\n\n let sep: string = defaultProps.thousandSeparator as string\n if (typeof thousandSeparator === 'string') {\n sep = thousandSeparator === '' ? (defaultProps.thousandSeparator as string) : thousandSeparator\n } else if (typeof thousandSeparator === 'boolean') {\n sep = thousandSeparator ? (defaultProps.thousandSeparator as string) : ''\n }\n\n let formattedInt = intPart\n if (sep && thousandsGroupStyle !== 'none') {\n if (thousandsGroupStyle === 'thousand') {\n formattedInt = intPart.replace(/\\B(?=(\\d{3})+(?!\\d))/g, sep)\n } else if (thousandsGroupStyle === 'wan') {\n formattedInt = intPart.replace(/\\B(?=(\\d{4})+(?!\\d))/g, sep)\n } else if (thousandsGroupStyle === 'lakh') {\n const len = intPart.length\n if (len <= 3) {\n formattedInt = intPart\n } else {\n const firstGroup = len % 2 === 0 ? 2 : 1\n const parts = [\n intPart.slice(0, firstGroup),\n ...(intPart.slice(firstGroup).match(/.{1,2}/g) || []),\n ]\n formattedInt = parts.join(sep)\n }\n } else {\n formattedInt = intPart\n }\n }\n\n let result = formattedInt\n if (decPart) {\n result += decimalSeparator + decPart\n }\n return prefix + result + suffix\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAaA,MAAM,WAAW;EAEjB,MAAM,eAA8C;GAClD,eAAe;GACf,cAAc;GACd,kBAAkB;GAClB,mBAAmB;GACnB,mBAAmB;GACnB,qBAAqB;GACrB,QAAQ;GACR,QAAQ;EACV;EAEA,MAAM,QAAQ,kBAAkB;GAC9B,WAAW;GACX;GACA,OAAO;EACT,CAAC;;;;;cAEiB,eAAe;IAC/B,MAAM,EACJ,OACA,eACA,cACA,kBACA,mBACA,QACA,QACA,mBACA,wBACE,MAAM;IAEV,IAAI,UAAU,KAAA,KAAa,UAAU,MACnC,OAAO;IAGT,IAAI,MAAM,OAAO,UAAU,WAAW,WAAW,KAAK,IAAI;IAC1D,IAAI,MAAM,GAAG,GACX,OAAO,OAAO,KAAK;IAGrB,IAAI,CAAC,iBAAiB,MAAM,GAC1B,MAAM,KAAK,IAAI,GAAG;IAGpB,IAAI,CAAC,SAAS,WAAW,IAAI,SAAS,CAAC,CAAC,MAAM,GAAG;IACjD,IAAI,YAAY,KAAA,GACd,UAAU;IAGZ,IAAI,iBAAiB,KAAA,KAAa,OAAO,SAAS,YAAY,GAAG;KAC/D,MAAM,SAAS,MAAM;KACrB,MAAM,KAAK,MAAM,MAAM,MAAM,IAAI;KACjC,MAAM,QAAQ,IAAI,SAAS,CAAC,CAAC,MAAM,GAAG;KACtC,UAAU,MAAM;KAChB,UAAU,MAAM,MAAM;KACtB,IAAI,mBACF,UAAU,QAAQ,OAAO,cAAc,GAAG;UACrC,IAAI,iBAAiB,GAC1B,UAAU;IAEd;IAEA,IAAI,MAAc,aAAa;IAC/B,IAAI,OAAO,sBAAsB,UAC/B,MAAM,sBAAsB,KAAM,aAAa,oBAA+B;SACzE,IAAI,OAAO,sBAAsB,WACtC,MAAM,oBAAqB,aAAa,oBAA+B;IAGzE,IAAI,eAAe;IACnB,IAAI,OAAO,wBAAwB,QACjC,IAAI,wBAAwB,YAC1B,eAAe,QAAQ,QAAQ,yBAAyB,GAAG;SACtD,IAAI,wBAAwB,OACjC,eAAe,QAAQ,QAAQ,yBAAyB,GAAG;SACtD,IAAI,wBAAwB,QAAQ;KACzC,MAAM,MAAM,QAAQ;KACpB,IAAI,OAAO,GACT,eAAe;UACV;MACL,MAAM,aAAa,MAAM,MAAM,IAAI,IAAI;MAKvC,eAAe,CAHb,QAAQ,MAAM,GAAG,UAAU,GAC3B,GAAI,QAAQ,MAAM,UAAU,CAAC,CAAC,MAAM,SAAS,KAAK,CAAC,CAEtC,CAAA,CAAM,KAAK,GAAG;KAC/B;IACF,OACE,eAAe;IAInB,IAAI,SAAS;IACb,IAAI,SACF,UAAU,mBAAmB;IAE/B,OAAO,SAAS,SAAS;GAC3B,CAAA;;;;;;;;;;;QA9Gc,OAAA,cAAS,QAAA,UAAA,GAArB,mBAAsD,QAAA,YAAA,gBAAnB,OAAA,SAAS,GAAA,CAAA,KAAA,mBAAA,QAAA,IAAA"}
package/esm/index.mjs CHANGED
@@ -86,6 +86,8 @@ import { CCol, CGrid } from "./components/grid/index.mjs";
86
86
  import { CGroup } from "./components/group/index.mjs";
87
87
  import { CImage } from "./components/image/index.mjs";
88
88
  import { CIndicator } from "./components/indicator/index.mjs";
89
+ import { CKbd } from "./components/kbd/index.mjs";
90
+ import { CNumberFormatter } from "./components/number-formatter/index.mjs";
89
91
  import { CPaper } from "./components/paper/index.mjs";
90
92
  import { CSemiCircleProgress } from "./components/semi-circle-progress/index.mjs";
91
93
  import { CSimpleGrid } from "./components/simple-grid/index.mjs";
@@ -141,7 +143,9 @@ const components = [
141
143
  CGroup,
142
144
  CImage,
143
145
  CIndicator,
146
+ CKbd,
144
147
  CLoader,
148
+ CNumberFormatter,
145
149
  CPaper,
146
150
  CPortal,
147
151
  CSemiCircleProgress,
@@ -165,6 +169,6 @@ const CckUI = { install(app) {
165
169
  });
166
170
  } };
167
171
  //#endregion
168
- export { CActionIcon, CActionIconGroup, CActionIconGroupSection, CAffix, CAlert, CAnchor, CAspectRatio, CAvatar, CAvatarGroup, CBackgroundImage, CBadge, CBox, CBreadcrumbs, CBurger, CButton, CButtonGroup, CButtonGroupSection, transitions as CCK_TRANSITIONS, CCard, CCardSection, CCenter, CCloseButton, CCol, CColorSwatch, CContainer, CCopyButton, CDataList, CDataListItem, CDataListItemLabel, CDataListItemValue, CDefaultLoaders, CDivider, CEmptyState, CEmptyStateActions, CEmptyStateDescription, CEmptyStateIndicator, CEmptyStateTitle, CFileButton, CFlex, CFocusTrap, CGrid, CGroup, CImage, CIndicator, 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, filterFalsyChildren, filterProps, getBaseValue, getBreakpointValue, getCSSColorVariables, getComponentName, getDefaultZIndex, 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 };
172
+ export { CActionIcon, CActionIconGroup, CActionIconGroupSection, CAffix, CAlert, CAnchor, CAspectRatio, CAvatar, CAvatarGroup, CBackgroundImage, CBadge, CBox, CBreadcrumbs, CBurger, CButton, CButtonGroup, CButtonGroupSection, transitions as CCK_TRANSITIONS, CCard, CCardSection, CCenter, CCloseButton, CCol, CColorSwatch, CContainer, CCopyButton, CDataList, CDataListItem, CDataListItemLabel, CDataListItemValue, CDefaultLoaders, CDivider, CEmptyState, CEmptyStateActions, CEmptyStateDescription, CEmptyStateIndicator, CEmptyStateTitle, CFileButton, CFlex, CFocusTrap, CGrid, CGroup, CImage, CIndicator, CKbd, CLoader, CNumberFormatter, 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, filterFalsyChildren, filterProps, getBaseValue, getBreakpointValue, getCSSColorVariables, getComponentName, getDefaultZIndex, 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 };
169
173
 
170
174
  //# 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 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;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;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 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 CKbd,\n CLoader,\n CNumberFormatter,\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 CKbd,\n CLoader,\n CNumberFormatter,\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DA,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;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"}
@@ -25,7 +25,9 @@ export * from './grid';
25
25
  export * from './group';
26
26
  export * from './image';
27
27
  export * from './indicator';
28
+ export * from './kbd';
28
29
  export * from './loader';
30
+ export * from './number-formatter';
29
31
  export * from './paper';
30
32
  export * from './portal';
31
33
  export * from './semi-circle-progress';
@@ -0,0 +1,6 @@
1
+ import { SFCWithInstallAndClasses } from '../../core';
2
+ import classes from './kbd.module.css';
3
+ import Kbd from './kbd.vue';
4
+ export declare const CKbd: SFCWithInstallAndClasses<typeof Kbd, typeof classes>;
5
+ export default CKbd;
6
+ export * from './kbd.types';
@@ -0,0 +1,18 @@
1
+ import { BoxProps, CSize, ElementProps, Factory, StylesApiProps } from '../../core';
2
+ export type KbdStylesNames = 'root';
3
+ export type KbdCssVariables = {
4
+ root: '--kbd-fz';
5
+ };
6
+ export interface KbdProps extends BoxProps, StylesApiProps<KbdFactory>, /* @vue-ignore */ ElementProps<'kbd'> {
7
+ /**
8
+ * Controls `font-size` and `padding`
9
+ * @default 'sm'
10
+ */
11
+ size?: CSize | number | (string & {});
12
+ }
13
+ export type KbdFactory = Factory<{
14
+ props: KbdProps;
15
+ ref: HTMLElement;
16
+ stylesNames: KbdStylesNames;
17
+ vars: KbdCssVariables;
18
+ }>;
@@ -0,0 +1,6 @@
1
+ export declare const varsResolver: import("../..").VarsResolver<{
2
+ props: import("./kbd.types").KbdProps;
3
+ ref: HTMLElement;
4
+ stylesNames: import("./kbd.types").KbdStylesNames;
5
+ vars: import("./kbd.types").KbdCssVariables;
6
+ }>;
@@ -0,0 +1,5 @@
1
+ import { SFCWithInstall } from '../../core';
2
+ import NumberFormatter from './number-formatter.vue';
3
+ export declare const CNumberFormatter: SFCWithInstall<typeof NumberFormatter>;
4
+ export default CNumberFormatter;
5
+ export * from './number-formatter.types';
@@ -0,0 +1,36 @@
1
+ import { ElementProps, Factory } from '../../core';
2
+ export interface NumberFormatterProps extends /* @vue-ignore */ ElementProps<'div'> {
3
+ /** Value to format */
4
+ value?: number | string;
5
+ /**
6
+ * If set, negative values are allowed
7
+ * @default true
8
+ */
9
+ allowNegative?: boolean;
10
+ /**
11
+ * Limits the number of digits that are displayed after the decimal point
12
+ * @default Infinity
13
+ */
14
+ decimalScale?: number;
15
+ /** Character used as a decimal separator, `'.'` by default */
16
+ decimalSeparator?: string;
17
+ /**
18
+ * If set, zeros are added after `decimalSeparator` to match given `decimalScale`.
19
+ * @default false
20
+ */
21
+ fixedDecimalScale?: boolean;
22
+ /** Prefix added before the value */
23
+ prefix?: string;
24
+ /** Suffix added after the value */
25
+ suffix?: string;
26
+ /** Defines the thousand grouping style */
27
+ thousandsGroupStyle?: 'thousand' | 'lakh' | 'wan' | 'none';
28
+ /** A character used to separate thousands
29
+ * @default ','
30
+ */
31
+ thousandSeparator?: string | boolean;
32
+ }
33
+ export type NumberFormatterFactory = Factory<{
34
+ props: NumberFormatterProps;
35
+ ref: HTMLDivElement;
36
+ }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cck-ui/core",
3
- "version": "0.37.0",
3
+ "version": "0.39.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",
package/styles/kbd.css ADDED
@@ -0,0 +1,31 @@
1
+ .m_d894b0c2 {
2
+ --kbd-fz-xs: calc(0.625rem * var(--c-scale));
3
+ --kbd-fz-sm: calc(0.75rem * var(--c-scale));
4
+ --kbd-fz-md: calc(0.875rem * var(--c-scale));
5
+ --kbd-fz-lg: calc(1rem * var(--c-scale));
6
+ --kbd-fz-xl: calc(1.25rem * var(--c-scale));
7
+ --kbd-fz: var(--kbd-fz-sm);
8
+
9
+ font-family: var(--c-font-family-monospace);
10
+ line-height: var(--c-line-height);
11
+ font-weight: var(--c-font-weight-bold);
12
+ font-size: var(--kbd-fz);
13
+ border-radius: var(--c-radius-sm);
14
+ border: calc(0.0625rem * var(--c-scale)) solid;
15
+ border-bottom-width: calc(0.1875rem * var(--c-scale));
16
+ unicode-bidi: embed;
17
+ text-align: center;
18
+ padding: 0.12em 0.45em;
19
+ }
20
+
21
+ :where([data-c-color-scheme='light']) .m_d894b0c2 {
22
+ border-color: var(--c-color-gray-3);
23
+ color: var(--c-color-gray-7);
24
+ background-color: var(--c-color-gray-0);
25
+ }
26
+
27
+ :where([data-c-color-scheme='dark']) .m_d894b0c2 {
28
+ border-color: var(--c-color-dark-4);
29
+ color: var(--c-color-dark-0);
30
+ background-color: var(--c-color-dark-6);
31
+ }
@@ -0,0 +1,32 @@
1
+ @layer cck {.m_d894b0c2 {
2
+ --kbd-fz-xs: calc(0.625rem * var(--c-scale));
3
+ --kbd-fz-sm: calc(0.75rem * var(--c-scale));
4
+ --kbd-fz-md: calc(0.875rem * var(--c-scale));
5
+ --kbd-fz-lg: calc(1rem * var(--c-scale));
6
+ --kbd-fz-xl: calc(1.25rem * var(--c-scale));
7
+ --kbd-fz: var(--kbd-fz-sm);
8
+
9
+ font-family: var(--c-font-family-monospace);
10
+ line-height: var(--c-line-height);
11
+ font-weight: var(--c-font-weight-bold);
12
+ font-size: var(--kbd-fz);
13
+ border-radius: var(--c-radius-sm);
14
+ border: calc(0.0625rem * var(--c-scale)) solid;
15
+ border-bottom-width: calc(0.1875rem * var(--c-scale));
16
+ unicode-bidi: embed;
17
+ text-align: center;
18
+ padding: 0.12em 0.45em;
19
+ }
20
+
21
+ :where([data-c-color-scheme='light']) .m_d894b0c2 {
22
+ border-color: var(--c-color-gray-3);
23
+ color: var(--c-color-gray-7);
24
+ background-color: var(--c-color-gray-0);
25
+ }
26
+
27
+ :where([data-c-color-scheme='dark']) .m_d894b0c2 {
28
+ border-color: var(--c-color-dark-4);
29
+ color: var(--c-color-dark-0);
30
+ background-color: var(--c-color-dark-6);
31
+ }
32
+ }
package/styles.css CHANGED
@@ -2245,6 +2245,38 @@ fieldset:disabled .c-active:active {
2245
2245
  animation: m_7c93cd91 1000ms linear infinite;
2246
2246
  }
2247
2247
 
2248
+ .m_d894b0c2 {
2249
+ --kbd-fz-xs: calc(0.625rem * var(--c-scale));
2250
+ --kbd-fz-sm: calc(0.75rem * var(--c-scale));
2251
+ --kbd-fz-md: calc(0.875rem * var(--c-scale));
2252
+ --kbd-fz-lg: calc(1rem * var(--c-scale));
2253
+ --kbd-fz-xl: calc(1.25rem * var(--c-scale));
2254
+ --kbd-fz: var(--kbd-fz-sm);
2255
+
2256
+ font-family: var(--c-font-family-monospace);
2257
+ line-height: var(--c-line-height);
2258
+ font-weight: var(--c-font-weight-bold);
2259
+ font-size: var(--kbd-fz);
2260
+ border-radius: var(--c-radius-sm);
2261
+ border: calc(0.0625rem * var(--c-scale)) solid;
2262
+ border-bottom-width: calc(0.1875rem * var(--c-scale));
2263
+ unicode-bidi: embed;
2264
+ text-align: center;
2265
+ padding: 0.12em 0.45em;
2266
+ }
2267
+
2268
+ :where([data-c-color-scheme='light']) .m_d894b0c2 {
2269
+ border-color: var(--c-color-gray-3);
2270
+ color: var(--c-color-gray-7);
2271
+ background-color: var(--c-color-gray-0);
2272
+ }
2273
+
2274
+ :where([data-c-color-scheme='dark']) .m_d894b0c2 {
2275
+ border-color: var(--c-color-dark-4);
2276
+ color: var(--c-color-dark-0);
2277
+ background-color: var(--c-color-dark-6);
2278
+ }
2279
+
2248
2280
  .m_a244865c {
2249
2281
  --loader-size-xs: calc(1.125rem * var(--c-scale));
2250
2282
  --loader-size-sm: calc(1.375rem * var(--c-scale));
package/styles.layer.css CHANGED
@@ -2245,6 +2245,38 @@ fieldset:disabled .c-active:active {
2245
2245
  animation: m_7c93cd91 1000ms linear infinite;
2246
2246
  }
2247
2247
 
2248
+ .m_d894b0c2 {
2249
+ --kbd-fz-xs: calc(0.625rem * var(--c-scale));
2250
+ --kbd-fz-sm: calc(0.75rem * var(--c-scale));
2251
+ --kbd-fz-md: calc(0.875rem * var(--c-scale));
2252
+ --kbd-fz-lg: calc(1rem * var(--c-scale));
2253
+ --kbd-fz-xl: calc(1.25rem * var(--c-scale));
2254
+ --kbd-fz: var(--kbd-fz-sm);
2255
+
2256
+ font-family: var(--c-font-family-monospace);
2257
+ line-height: var(--c-line-height);
2258
+ font-weight: var(--c-font-weight-bold);
2259
+ font-size: var(--kbd-fz);
2260
+ border-radius: var(--c-radius-sm);
2261
+ border: calc(0.0625rem * var(--c-scale)) solid;
2262
+ border-bottom-width: calc(0.1875rem * var(--c-scale));
2263
+ unicode-bidi: embed;
2264
+ text-align: center;
2265
+ padding: 0.12em 0.45em;
2266
+ }
2267
+
2268
+ :where([data-c-color-scheme='light']) .m_d894b0c2 {
2269
+ border-color: var(--c-color-gray-3);
2270
+ color: var(--c-color-gray-7);
2271
+ background-color: var(--c-color-gray-0);
2272
+ }
2273
+
2274
+ :where([data-c-color-scheme='dark']) .m_d894b0c2 {
2275
+ border-color: var(--c-color-dark-4);
2276
+ color: var(--c-color-dark-0);
2277
+ background-color: var(--c-color-dark-6);
2278
+ }
2279
+
2248
2280
  .m_a244865c {
2249
2281
  --loader-size-xs: calc(1.125rem * var(--c-scale));
2250
2282
  --loader-size-sm: calc(1.375rem * var(--c-scale));