cck-ui 0.0.1 → 0.0.2

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 (51) hide show
  1. package/dist/index.full.js +39 -1448
  2. package/dist/index.full.min.js +3 -15
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +3 -15
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +7 -1414
  7. package/es/packages/components/button/src/button-custom.mjs +2 -2
  8. package/es/packages/components/button/src/button-custom.mjs.map +1 -1
  9. package/es/packages/components/button/src/button.vue_vue_type_script_setup_true_lang.mjs +15 -15
  10. package/es/packages/components/button/src/button.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  11. package/es/packages/components/button/src/use-button.mjs +3 -3
  12. package/es/packages/components/button/src/use-button.mjs.map +1 -1
  13. package/es/packages/components/form/src/hooks/use-form-common-props.mjs +4 -4
  14. package/es/packages/components/form/src/hooks/use-form-common-props.mjs.map +1 -1
  15. package/es/packages/components/icon/src/icon.vue_vue_type_script_setup_true_lang.mjs +6 -6
  16. package/es/packages/components/icon/src/icon.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
  17. package/es/packages/hooks/use-namespace/index.mjs +4 -4
  18. package/es/packages/hooks/use-namespace/index.mjs.map +1 -1
  19. package/es/packages/hooks/use-prop/index.mjs +3 -3
  20. package/es/packages/hooks/use-prop/index.mjs.map +1 -1
  21. package/es/packages/hooks/use-theme/index.mjs +3 -3
  22. package/es/packages/hooks/use-theme/index.mjs.map +1 -1
  23. package/lib/_virtual/_rolldown/runtime.js +0 -33
  24. package/lib/packages/components/button/src/button-custom.js +4 -4
  25. package/lib/packages/components/button/src/button-custom.js.map +1 -1
  26. package/lib/packages/components/button/src/button.vue_vue_type_script_setup_true_lang.js +19 -19
  27. package/lib/packages/components/button/src/button.vue_vue_type_script_setup_true_lang.js.map +1 -1
  28. package/lib/packages/components/button/src/use-button.js +3 -3
  29. package/lib/packages/components/button/src/use-button.js.map +1 -1
  30. package/lib/packages/components/form/src/hooks/use-form-common-props.js +6 -6
  31. package/lib/packages/components/form/src/hooks/use-form-common-props.js.map +1 -1
  32. package/lib/packages/components/icon/src/icon.vue_vue_type_script_setup_true_lang.js +8 -8
  33. package/lib/packages/components/icon/src/icon.vue_vue_type_script_setup_true_lang.js.map +1 -1
  34. package/lib/packages/hooks/use-namespace/index.js +4 -4
  35. package/lib/packages/hooks/use-namespace/index.js.map +1 -1
  36. package/lib/packages/hooks/use-prop/index.js +3 -3
  37. package/lib/packages/hooks/use-prop/index.js.map +1 -1
  38. package/lib/packages/hooks/use-theme/index.js +3 -3
  39. package/lib/packages/hooks/use-theme/index.js.map +1 -1
  40. package/package.json +14 -6
  41. package/es/_virtual/_rolldown/runtime.mjs +0 -27
  42. package/es/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.runtime.esm-bundler.mjs +0 -22
  43. package/es/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.runtime.esm-bundler.mjs.map +0 -1
  44. package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.cjs.js +0 -66
  45. package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.cjs.js.map +0 -1
  46. package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.cjs.prod.js +0 -56
  47. package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.cjs.prod.js.map +0 -1
  48. package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/index.js +0 -18
  49. package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/index.js.map +0 -1
  50. package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/index2.js +0 -14
  51. package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/index2.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { generateColorShades, setColorAlpha } from "../../../utils/colors.mjs";
2
- import { vue_runtime_esm_bundler_exports } from "../../../../node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
3
2
  import { useColorScheme } from "../../../hooks/use-theme/index.mjs";
3
+ import { computed } from "vue";
4
4
  //#region ../../packages/components/button/src/button-custom.ts
5
5
  const PRESET_COLORS = [
6
6
  "red",
@@ -40,7 +40,7 @@ const getShadeIndexes = (scheme) => {
40
40
  };
41
41
  function useButtonCustomStyle(props) {
42
42
  const colorScheme = useColorScheme();
43
- return (0, vue_runtime_esm_bundler_exports.computed)(() => {
43
+ return computed(() => {
44
44
  const styles = {};
45
45
  const { color, gradient, justify, variant } = props;
46
46
  const scheme = colorScheme.value;
@@ -1 +1 @@
1
- {"version":3,"file":"button-custom.mjs","names":[],"sources":["../../../../../../../packages/components/button/src/button-custom.ts"],"sourcesContent":["import { ColorScheme, useColorScheme } from '@cck-ui/hooks'\nimport { generateColorShades, setColorAlpha } from '@cck-ui/utils'\nimport { computed } from 'vue'\nimport { ButtonProps } from './button.types'\n\nconst PRESET_COLORS = [\n 'red',\n 'pink',\n 'grape',\n 'violet',\n 'indigo',\n 'blue',\n 'cyan',\n 'teal',\n 'green',\n 'lime',\n 'yellow',\n 'orange',\n 'gray',\n 'dark'\n]\n\nconst getShadeIndexes = (scheme: ColorScheme) => {\n if (scheme === 'light') {\n return {\n bg: 6,\n hover: 7,\n lightBg: 1,\n lightHover: 2,\n lightColor: 9,\n outlineColor: 6,\n outlineHoverBgAlpha: 0.05\n }\n } else {\n return {\n bg: 8,\n hover: 9,\n lightBg: 1,\n lightHover: 2,\n lightColor: 9,\n outlineColor: 4,\n outlineHoverBgAlpha: 0.05\n }\n }\n}\n\nexport function useButtonCustomStyle(props: ButtonProps) {\n const colorScheme = useColorScheme()\n\n return computed(() => {\n const styles: Record<string, string> = {}\n\n const { color, gradient, justify, variant } = props\n const scheme = colorScheme.value\n const idx = getShadeIndexes(scheme)\n\n if (justify) {\n styles['--button-justify'] = justify\n }\n\n switch (variant) {\n case 'default':\n break\n case 'filled':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-bg'] = `var(--c-color-${color}-filled)`\n styles['--button-hover'] = `var(--c-color-${color}-filled-hover)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-bg'] = shades[idx.bg]\n styles['--button-hover'] = shades[idx.hover]\n }\n }\n break\n case 'light':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-bg'] = `var(--c-color-${color}-light)`\n styles['--button-hover'] = `var(--c-color-${color}-light-hover)`\n styles['--button-color'] = `var(--c-color-${color}-light-color)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-bg'] = shades[idx.lightBg]\n styles['--button-hover'] = shades[idx.lightHover]\n styles['--button-color'] = shades[idx.lightColor]\n }\n }\n break\n case 'outline':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-hover'] = `var(--c-color-${color}-outline-hover)`\n styles['--button-color'] = `var(--c-color-${color}-outline)`\n styles['--button-bd'] =\n `calc(0.0625rem * var(--c-scale)) solid var(--c-color-${color}-outline)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-hover'] = setColorAlpha(\n shades[idx.outlineColor],\n idx.outlineHoverBgAlpha\n )\n styles['--button-color'] = shades[idx.outlineColor]\n styles['--button-bd'] =\n `calc(0.0625rem * var(--c-scale)) solid ${shades[idx.outlineColor]}`\n }\n }\n break\n case 'subtle':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-hover'] = `var(--c-color-${color}-outline-hover)`\n styles['--button-color'] = `var(--c-color-${color}-outline)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-hover'] = setColorAlpha(\n shades[idx.outlineColor],\n idx.outlineHoverBgAlpha\n )\n styles['--button-color'] = shades[idx.outlineColor]\n }\n }\n break\n case 'transparent':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-color'] = `var(--c-color-${color}-light-color)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-color'] = shades[idx.lightColor]\n }\n }\n break\n case 'white':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-color'] = `var(--c-color-${color}-filled)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-color'] = shades[idx.bg]\n }\n }\n break\n case 'gradient':\n const from = gradient?.from || 'blue'\n const to = gradient?.to || 'cyan'\n const deg = gradient?.deg || '45'\n\n let finalFrom: string = from\n let finalTo: string = to\n if (PRESET_COLORS.includes(from)) {\n finalFrom = `var(--c-color-${from}-filled)`\n }\n if (PRESET_COLORS.includes(to)) {\n finalTo = `var(--c-color-${to}-filled)`\n }\n\n styles['--button-bg'] =\n `linear-gradient(${deg}deg, ${finalFrom} 0%, ${finalTo} 100%)`\n break\n default:\n break\n }\n\n return styles\n })\n}\n"],"mappings":";;;;AAKA,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,mBAAmB,WAAwB;CAC/C,IAAI,WAAW,SACb,OAAO;EACL,IAAI;EACJ,OAAO;EACP,SAAS;EACT,YAAY;EACZ,YAAY;EACZ,cAAc;EACd,qBAAqB;CACvB;MAEA,OAAO;EACL,IAAI;EACJ,OAAO;EACP,SAAS;EACT,YAAY;EACZ,YAAY;EACZ,cAAc;EACd,qBAAqB;CACvB;AAEJ;AAEA,SAAgB,qBAAqB,OAAoB;CACvD,MAAM,cAAc,eAAe;CAEnC,QAAA,GAAA,gCAAA,SAAA,OAAsB;EACpB,MAAM,SAAiC,CAAC;EAExC,MAAM,EAAE,OAAO,UAAU,SAAS,YAAY;EAC9C,MAAM,SAAS,YAAY;EAC3B,MAAM,MAAM,gBAAgB,MAAM;EAElC,IAAI,SACF,OAAO,sBAAsB;EAG/B,QAAQ,SAAR;GACE,KAAK,WACH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AO,oBAAoB,iBAAiB,MAAM;SAGlD,OAAO,oBADQ,oBAAoB,KACH,CAAC,CAAC,IAAI;IAG1C;GACF,KAAK;IACH,IAAI,OACF,IAAI,cAAc,SAAS,KAAK,GAC9B,OAAO,oBAAoB,iBAAiB,MAAM;SAGlD,OAAO,oBADQ,oBAAoB,KACH,CAAC,CAAC,IAAI;IAG1C;GACF,KAAK;IACH,MAAM,OAAO,UAAU,QAAQ;IAC/B,MAAM,KAAK,UAAU,MAAM;IAC3B,MAAM,MAAM,UAAU,OAAO;IAE7B,IAAI,YAAoB;IACxB,IAAI,UAAkB;IACtB,IAAI,cAAc,SAAS,IAAI,GAC7B,YAAY,iBAAiB,KAAK;IAEpC,IAAI,cAAc,SAAS,EAAE,GAC3B,UAAU,iBAAiB,GAAG;IAGhC,OAAO,iBACL,mBAAmB,IAAI,OAAO,UAAU,OAAO,QAAQ;IACzD;GACF,SACE;EACJ;EAEA,OAAO;CACT,CAAC;AACH"}
1
+ {"version":3,"file":"button-custom.mjs","names":[],"sources":["../../../../../../../packages/components/button/src/button-custom.ts"],"sourcesContent":["import { ColorScheme, useColorScheme } from '@cck-ui/hooks'\nimport { generateColorShades, setColorAlpha } from '@cck-ui/utils'\nimport { computed } from 'vue'\nimport { ButtonProps } from './button.types'\n\nconst PRESET_COLORS = [\n 'red',\n 'pink',\n 'grape',\n 'violet',\n 'indigo',\n 'blue',\n 'cyan',\n 'teal',\n 'green',\n 'lime',\n 'yellow',\n 'orange',\n 'gray',\n 'dark'\n]\n\nconst getShadeIndexes = (scheme: ColorScheme) => {\n if (scheme === 'light') {\n return {\n bg: 6,\n hover: 7,\n lightBg: 1,\n lightHover: 2,\n lightColor: 9,\n outlineColor: 6,\n outlineHoverBgAlpha: 0.05\n }\n } else {\n return {\n bg: 8,\n hover: 9,\n lightBg: 1,\n lightHover: 2,\n lightColor: 9,\n outlineColor: 4,\n outlineHoverBgAlpha: 0.05\n }\n }\n}\n\nexport function useButtonCustomStyle(props: ButtonProps) {\n const colorScheme = useColorScheme()\n\n return computed(() => {\n const styles: Record<string, string> = {}\n\n const { color, gradient, justify, variant } = props\n const scheme = colorScheme.value\n const idx = getShadeIndexes(scheme)\n\n if (justify) {\n styles['--button-justify'] = justify\n }\n\n switch (variant) {\n case 'default':\n break\n case 'filled':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-bg'] = `var(--c-color-${color}-filled)`\n styles['--button-hover'] = `var(--c-color-${color}-filled-hover)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-bg'] = shades[idx.bg]\n styles['--button-hover'] = shades[idx.hover]\n }\n }\n break\n case 'light':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-bg'] = `var(--c-color-${color}-light)`\n styles['--button-hover'] = `var(--c-color-${color}-light-hover)`\n styles['--button-color'] = `var(--c-color-${color}-light-color)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-bg'] = shades[idx.lightBg]\n styles['--button-hover'] = shades[idx.lightHover]\n styles['--button-color'] = shades[idx.lightColor]\n }\n }\n break\n case 'outline':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-hover'] = `var(--c-color-${color}-outline-hover)`\n styles['--button-color'] = `var(--c-color-${color}-outline)`\n styles['--button-bd'] =\n `calc(0.0625rem * var(--c-scale)) solid var(--c-color-${color}-outline)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-hover'] = setColorAlpha(\n shades[idx.outlineColor],\n idx.outlineHoverBgAlpha\n )\n styles['--button-color'] = shades[idx.outlineColor]\n styles['--button-bd'] =\n `calc(0.0625rem * var(--c-scale)) solid ${shades[idx.outlineColor]}`\n }\n }\n break\n case 'subtle':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-hover'] = `var(--c-color-${color}-outline-hover)`\n styles['--button-color'] = `var(--c-color-${color}-outline)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-hover'] = setColorAlpha(\n shades[idx.outlineColor],\n idx.outlineHoverBgAlpha\n )\n styles['--button-color'] = shades[idx.outlineColor]\n }\n }\n break\n case 'transparent':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-color'] = `var(--c-color-${color}-light-color)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-color'] = shades[idx.lightColor]\n }\n }\n break\n case 'white':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-color'] = `var(--c-color-${color}-filled)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-color'] = shades[idx.bg]\n }\n }\n break\n case 'gradient':\n const from = gradient?.from || 'blue'\n const to = gradient?.to || 'cyan'\n const deg = gradient?.deg || '45'\n\n let finalFrom: string = from\n let finalTo: string = to\n if (PRESET_COLORS.includes(from)) {\n finalFrom = `var(--c-color-${from}-filled)`\n }\n if (PRESET_COLORS.includes(to)) {\n finalTo = `var(--c-color-${to}-filled)`\n }\n\n styles['--button-bg'] =\n `linear-gradient(${deg}deg, ${finalFrom} 0%, ${finalTo} 100%)`\n break\n default:\n break\n }\n\n return styles\n })\n}\n"],"mappings":";;;;AAKA,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,mBAAmB,WAAwB;CAC/C,IAAI,WAAW,SACb,OAAO;EACL,IAAI;EACJ,OAAO;EACP,SAAS;EACT,YAAY;EACZ,YAAY;EACZ,cAAc;EACd,qBAAqB;CACvB;MAEA,OAAO;EACL,IAAI;EACJ,OAAO;EACP,SAAS;EACT,YAAY;EACZ,YAAY;EACZ,cAAc;EACd,qBAAqB;CACvB;AAEJ;AAEA,SAAgB,qBAAqB,OAAoB;CACvD,MAAM,cAAc,eAAe;CAEnC,OAAO,eAAe;EACpB,MAAM,SAAiC,CAAC;EAExC,MAAM,EAAE,OAAO,UAAU,SAAS,YAAY;EAC9C,MAAM,SAAS,YAAY;EAC3B,MAAM,MAAM,gBAAgB,MAAM;EAElC,IAAI,SACF,OAAO,sBAAsB;EAG/B,QAA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c,SAAS,KAAK,GAC9B,OAAO,oBAAoB,iBAAiB,MAAM;SAGlD,OAAO,oBADQ,oBAAoB,KACH,CAAC,CAAC,IAAI;IAG1C;GACF,KAAK;IACH,IAAI,OACF,IAAI,cAAc,SAAS,KAAK,GAC9B,OAAO,oBAAoB,iBAAiB,MAAM;SAGlD,OAAO,oBADQ,oBAAoB,KACH,CAAC,CAAC,IAAI;IAG1C;GACF,KAAK;IACH,MAAM,OAAO,UAAU,QAAQ;IAC/B,MAAM,KAAK,UAAU,MAAM;IAC3B,MAAM,MAAM,UAAU,OAAO;IAE7B,IAAI,YAAoB;IACxB,IAAI,UAAkB;IACtB,IAAI,cAAc,SAAS,IAAI,GAC7B,YAAY,iBAAiB,KAAK;IAEpC,IAAI,cAAc,SAAS,EAAE,GAC3B,UAAU,iBAAiB,GAAG;IAGhC,OAAO,iBACL,mBAAmB,IAAI,OAAO,UAAU,OAAO,QAAQ;IACzD;GACF,SACE;EACJ;EAEA,OAAO;CACT,CAAC;AACH"}
@@ -1,7 +1,7 @@
1
- import { vue_runtime_esm_bundler_exports } from "../../../../node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
2
1
  import { useNamespace } from "../../../hooks/use-namespace/index.mjs";
3
2
  import { useButton } from "./use-button.mjs";
4
3
  import { useButtonCustomStyle } from "./button-custom.mjs";
4
+ import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, mergeProps, normalizeClass, openBlock, renderSlot, resolveDynamicComponent, unref, useSlots, withCtx } from "vue";
5
5
  //#region ../../packages/components/button/src/button.vue?vue&type=script&setup=true&lang.ts
6
6
  const _hoisted_1 = {
7
7
  key: 0,
@@ -19,7 +19,7 @@ const _hoisted_4 = {
19
19
  key: 3,
20
20
  "data-position": "right"
21
21
  };
22
- var button_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue_runtime_esm_bundler_exports.defineComponent)({
22
+ var button_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
23
23
  name: "CButton",
24
24
  __name: "button",
25
25
  props: {
@@ -85,9 +85,9 @@ var button_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue_r
85
85
  }
86
86
  },
87
87
  setup(__props, { expose: __expose }) {
88
- const slots = (0, vue_runtime_esm_bundler_exports.useSlots)();
89
- const hasLeftSlot = (0, vue_runtime_esm_bundler_exports.computed)(() => !!slots["left-section"]);
90
- const hasRightSlot = (0, vue_runtime_esm_bundler_exports.computed)(() => !!slots["right-section"]);
88
+ const slots = useSlots();
89
+ const hasLeftSlot = computed(() => !!slots["left-section"]);
90
+ const hasRightSlot = computed(() => !!slots["right-section"]);
91
91
  const props = __props;
92
92
  const { _disabled, _props, _ref, handleClick } = useButton(props, {
93
93
  hasLeftSlot: hasLeftSlot.value,
@@ -95,14 +95,14 @@ var button_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue_r
95
95
  });
96
96
  const buttonStyle = useButtonCustomStyle(props);
97
97
  const ns = useNamespace("button");
98
- const buttonClass = (0, vue_runtime_esm_bundler_exports.computed)(() => [
98
+ const buttonClass = computed(() => [
99
99
  useNamespace("focus").b("auto"),
100
100
  !_disabled.value && useNamespace("active").b(),
101
101
  ns.e("root"),
102
102
  ns.is("loading", props.loading)
103
103
  ]);
104
- const innerClass = (0, vue_runtime_esm_bundler_exports.computed)(() => [ns.e("inner")]);
105
- const labelClass = (0, vue_runtime_esm_bundler_exports.computed)(() => [ns.e("label")]);
104
+ const innerClass = computed(() => [ns.e("inner")]);
105
+ const labelClass = computed(() => [ns.e("label")]);
106
106
  __expose({
107
107
  /** @description if button is disabled */
108
108
  disabled: _disabled.value,
@@ -114,15 +114,15 @@ var button_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue_r
114
114
  variant: props.variant
115
115
  });
116
116
  return (_ctx, _cache) => {
117
- return (0, vue_runtime_esm_bundler_exports.openBlock)(), (0, vue_runtime_esm_bundler_exports.createBlock)((0, vue_runtime_esm_bundler_exports.resolveDynamicComponent)(__props.tag), (0, vue_runtime_esm_bundler_exports.mergeProps)((0, vue_runtime_esm_bundler_exports.unref)(_props), {
117
+ return openBlock(), createBlock(resolveDynamicComponent(__props.tag), mergeProps(unref(_props), {
118
118
  class: buttonClass.value,
119
- style: (0, vue_runtime_esm_bundler_exports.unref)(buttonStyle),
120
- onClick: (0, vue_runtime_esm_bundler_exports.unref)(handleClick)
119
+ style: unref(buttonStyle),
120
+ onClick: unref(handleClick)
121
121
  }), {
122
- default: (0, vue_runtime_esm_bundler_exports.withCtx)(() => [(0, vue_runtime_esm_bundler_exports.createElementVNode)("span", { class: (0, vue_runtime_esm_bundler_exports.normalizeClass)(innerClass.value) }, [
123
- _ctx.$slots["left-section"] ? ((0, vue_runtime_esm_bundler_exports.openBlock)(), (0, vue_runtime_esm_bundler_exports.createElementBlock)("span", _hoisted_1, [(0, vue_runtime_esm_bundler_exports.renderSlot)(_ctx.$slots, "left-section")])) : __props.leftSection ? ((0, vue_runtime_esm_bundler_exports.openBlock)(), (0, vue_runtime_esm_bundler_exports.createElementBlock)("span", _hoisted_2, [((0, vue_runtime_esm_bundler_exports.openBlock)(), (0, vue_runtime_esm_bundler_exports.createBlock)((0, vue_runtime_esm_bundler_exports.resolveDynamicComponent)(__props.leftSection)))])) : (0, vue_runtime_esm_bundler_exports.createCommentVNode)("v-if", true),
124
- (0, vue_runtime_esm_bundler_exports.createElementVNode)("span", { class: (0, vue_runtime_esm_bundler_exports.normalizeClass)(labelClass.value) }, [(0, vue_runtime_esm_bundler_exports.renderSlot)(_ctx.$slots, "default")], 2),
125
- _ctx.$slots["right-section"] ? ((0, vue_runtime_esm_bundler_exports.openBlock)(), (0, vue_runtime_esm_bundler_exports.createElementBlock)("span", _hoisted_3, [(0, vue_runtime_esm_bundler_exports.renderSlot)(_ctx.$slots, "right-section")])) : __props.rightSection ? ((0, vue_runtime_esm_bundler_exports.openBlock)(), (0, vue_runtime_esm_bundler_exports.createElementBlock)("span", _hoisted_4, [((0, vue_runtime_esm_bundler_exports.openBlock)(), (0, vue_runtime_esm_bundler_exports.createBlock)((0, vue_runtime_esm_bundler_exports.resolveDynamicComponent)(__props.rightSection)))])) : (0, vue_runtime_esm_bundler_exports.createCommentVNode)("v-if", true)
122
+ default: withCtx(() => [createElementVNode("span", { class: normalizeClass(innerClass.value) }, [
123
+ _ctx.$slots["left-section"] ? (openBlock(), createElementBlock("span", _hoisted_1, [renderSlot(_ctx.$slots, "left-section")])) : __props.leftSection ? (openBlock(), createElementBlock("span", _hoisted_2, [(openBlock(), createBlock(resolveDynamicComponent(__props.leftSection)))])) : createCommentVNode("v-if", true),
124
+ createElementVNode("span", { class: normalizeClass(labelClass.value) }, [renderSlot(_ctx.$slots, "default")], 2),
125
+ _ctx.$slots["right-section"] ? (openBlock(), createElementBlock("span", _hoisted_3, [renderSlot(_ctx.$slots, "right-section")])) : __props.rightSection ? (openBlock(), createElementBlock("span", _hoisted_4, [(openBlock(), createBlock(resolveDynamicComponent(__props.rightSection)))])) : createCommentVNode("v-if", true)
126
126
  ], 2)]),
127
127
  _: 3
128
128
  }, 16, [
@@ -1 +1 @@
1
- {"version":3,"file":"button.vue_vue_type_script_setup_true_lang.mjs","names":["$slots"],"sources":["../../../../../../../packages/components/button/src/button.vue","../../../../../../../packages/components/button/src/button.vue"],"sourcesContent":["<template>\n <component\n v-bind=\"_props\"\n :class=\"buttonClass\"\n :is=\"tag\"\n :style=\"buttonStyle\"\n @click=\"handleClick\"\n >\n <span :class=\"innerClass\">\n <span data-position=\"left\" v-if=\"$slots['left-section']\">\n <slot name=\"left-section\"></slot>\n </span>\n <span data-position=\"left\" v-else-if=\"leftSection\">\n <component :is=\"leftSection\" />\n </span>\n <span :class=\"labelClass\">\n <slot />\n </span>\n <span data-position=\"right\" v-if=\"$slots['right-section']\">\n <slot name=\"right-section\"></slot>\n </span>\n <span data-position=\"right\" v-else-if=\"rightSection\">\n <component :is=\"rightSection\" />\n </span>\n </span>\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, useSlots } from 'vue'\nimport type { ButtonProps } from './button.types'\nimport { useNamespace } from '@cck-ui/hooks'\nimport { useButton } from './use-button'\nimport { useButtonCustomStyle } from './button-custom'\n\ndefineOptions({\n name: 'CButton'\n})\n\ndefineSlots<{\n 'left-section': any\n 'right-section': any\n default: any\n}>()\n\nconst slots = useSlots()\n\nconst hasLeftSlot = computed(() => !!slots['left-section'])\nconst hasRightSlot = computed(() => !!slots['right-section'])\n\nconst props = withDefaults(defineProps<ButtonProps>(), {\n radius: '4px',\n size: 'sm',\n tag: 'button',\n variant: 'default'\n})\n\nconst { _disabled, _props, _ref, handleClick } = useButton(props, {\n hasLeftSlot: hasLeftSlot.value,\n hasRightSlot: hasRightSlot.value\n})\n\nconst buttonStyle = useButtonCustomStyle(props)\nconst ns = useNamespace('button')\nconst buttonClass = computed(() => [\n useNamespace('focus').b('auto'),\n !_disabled.value && useNamespace('active').b(),\n ns.e('root'),\n ns.is('loading', props.loading)\n])\nconst innerClass = computed(() => [ns.e('inner')])\nconst labelClass = computed(() => [ns.e('label')])\n\ndefineExpose({\n /** @description if button is disabled */\n disabled: _disabled.value,\n /** @description button html element */\n ref: _ref,\n /** @description button size */\n size: props.size,\n /** @description button variant */\n variant: props.variant\n})\n</script>\n","<template>\n <component\n v-bind=\"_props\"\n :class=\"buttonClass\"\n :is=\"tag\"\n :style=\"buttonStyle\"\n @click=\"handleClick\"\n >\n <span :class=\"innerClass\">\n <span data-position=\"left\" v-if=\"$slots['left-section']\">\n <slot name=\"left-section\"></slot>\n </span>\n <span data-position=\"left\" v-else-if=\"leftSection\">\n <component :is=\"leftSection\" />\n </span>\n <span :class=\"labelClass\">\n <slot />\n </span>\n <span data-position=\"right\" v-if=\"$slots['right-section']\">\n <slot name=\"right-section\"></slot>\n </span>\n <span data-position=\"right\" v-else-if=\"rightSection\">\n <component :is=\"rightSection\" />\n </span>\n </span>\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, useSlots } from 'vue'\nimport type { ButtonProps } from './button.types'\nimport { useNamespace } from '@cck-ui/hooks'\nimport { useButton } from './use-button'\nimport { useButtonCustomStyle } from './button-custom'\n\ndefineOptions({\n name: 'CButton'\n})\n\ndefineSlots<{\n 'left-section': any\n 'right-section': any\n default: any\n}>()\n\nconst slots = useSlots()\n\nconst hasLeftSlot = computed(() => !!slots['left-section'])\nconst hasRightSlot = computed(() => !!slots['right-section'])\n\nconst props = withDefaults(defineProps<ButtonProps>(), {\n radius: '4px',\n size: 'sm',\n tag: 'button',\n variant: 'default'\n})\n\nconst { _disabled, _props, _ref, handleClick } = useButton(props, {\n hasLeftSlot: hasLeftSlot.value,\n hasRightSlot: hasRightSlot.value\n})\n\nconst buttonStyle = useButtonCustomStyle(props)\nconst ns = useNamespace('button')\nconst buttonClass = computed(() => [\n useNamespace('focus').b('auto'),\n !_disabled.value && useNamespace('active').b(),\n ns.e('root'),\n ns.is('loading', props.loading)\n])\nconst innerClass = computed(() => [ns.e('inner')])\nconst labelClass = computed(() => [ns.e('label')])\n\ndefineExpose({\n /** @description if button is disabled */\n disabled: _disabled.value,\n /** @description button html element */\n ref: _ref,\n /** @description button size */\n size: props.size,\n /** @description button variant */\n variant: props.variant\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6CA,MAAM,SAAA,GAAA,gCAAA,SAAA,CAAiB;EAEvB,MAAM,eAAA,GAAA,gCAAA,SAAA,OAA6B,CAAC,CAAC,MAAM,eAAe;EAC1D,MAAM,gBAAA,GAAA,gCAAA,SAAA,OAA8B,CAAC,CAAC,MAAM,gBAAgB;EAE5D,MAAM,QAAQ;EAOd,MAAM,EAAE,WAAW,QAAQ,MAAM,gBAAgB,UAAU,OAAO;GAChE,aAAa,YAAY;GACzB,cAAc,aAAa;EAC7B,CAAC;EAED,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A,CAAA,QAAA,IAAA;6DAItB,QAAA,EAFA,QAAA,GAAA,gCAAA,eAAA,CAAO,WAAA,KAAU,EAAA,GAAA,EAAA,GAAA,gCAAA,WAAA,CACd,KAAA,QAAA,SAAA,CAAA,GAAA,CAAA;KAEwBA,KAAAA,OAAM,qBAAA,GAAA,gCAAA,UAAA,CAAA,IAAA,GAAA,gCAAA,mBAAA,CAEjC,QAFP,YAEO,EAAA,GAAA,gCAAA,WAAA,CAD6B,KAAA,QAAA,eAAA,CAAA,CAAA,KAEG,QAAA,iBAAA,GAAA,gCAAA,UAAA,CAAA,IAAA,GAAA,gCAAA,mBAAA,CAEhC,QAFP,YAEO,GAAA,GAAA,gCAAA,UAAA,CAAA,IAAA,GAAA,gCAAA,YAAA,EAAA,GAAA,gCAAA,wBAAA,CADW,QAAA,YAAY,CAAA,EAAA,CAAA,MAAA,GAAA,gCAAA,mBAAA,CAAA,QAAA,IAAA"}
1
+ {"version":3,"file":"button.vue_vue_type_script_setup_true_lang.mjs","names":["$slots"],"sources":["../../../../../../../packages/components/button/src/button.vue"],"sourcesContent":["<template>\n <component\n v-bind=\"_props\"\n :class=\"buttonClass\"\n :is=\"tag\"\n :style=\"buttonStyle\"\n @click=\"handleClick\"\n >\n <span :class=\"innerClass\">\n <span data-position=\"left\" v-if=\"$slots['left-section']\">\n <slot name=\"left-section\"></slot>\n </span>\n <span data-position=\"left\" v-else-if=\"leftSection\">\n <component :is=\"leftSection\" />\n </span>\n <span :class=\"labelClass\">\n <slot />\n </span>\n <span data-position=\"right\" v-if=\"$slots['right-section']\">\n <slot name=\"right-section\"></slot>\n </span>\n <span data-position=\"right\" v-else-if=\"rightSection\">\n <component :is=\"rightSection\" />\n </span>\n </span>\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, useSlots } from 'vue'\nimport type { ButtonProps } from './button.types'\nimport { useNamespace } from '@cck-ui/hooks'\nimport { useButton } from './use-button'\nimport { useButtonCustomStyle } from './button-custom'\n\ndefineOptions({\n name: 'CButton'\n})\n\ndefineSlots<{\n 'left-section': any\n 'right-section': any\n default: any\n}>()\n\nconst slots = useSlots()\n\nconst hasLeftSlot = computed(() => !!slots['left-section'])\nconst hasRightSlot = computed(() => !!slots['right-section'])\n\nconst props = withDefaults(defineProps<ButtonProps>(), {\n radius: '4px',\n size: 'sm',\n tag: 'button',\n variant: 'default'\n})\n\nconst { _disabled, _props, _ref, handleClick } = useButton(props, {\n hasLeftSlot: hasLeftSlot.value,\n hasRightSlot: hasRightSlot.value\n})\n\nconst buttonStyle = useButtonCustomStyle(props)\nconst ns = useNamespace('button')\nconst buttonClass = computed(() => [\n useNamespace('focus').b('auto'),\n !_disabled.value && useNamespace('active').b(),\n ns.e('root'),\n ns.is('loading', props.loading)\n])\nconst innerClass = computed(() => [ns.e('inner')])\nconst labelClass = computed(() => [ns.e('label')])\n\ndefineExpose({\n /** @description if button is disabled */\n disabled: _disabled.value,\n /** @description button html element */\n ref: _ref,\n /** @description button size */\n size: props.size,\n /** @description button variant */\n variant: props.variant\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6CA,MAAM,QAAQ,SAAS;EAEvB,MAAM,cAAc,eAAe,CAAC,CAAC,MAAM,eAAe;EAC1D,MAAM,eAAe,eAAe,CAAC,CAAC,MAAM,gBAAgB;EAE5D,MAAM,QAAQ;EAOd,MAAM,EAAE,WAAW,QAAQ,MAAM,gBAAgB,UAAU,OAAO;GAChE,aAAa,YAAY;GACzB,cAAc,aAAa;EAC7B,CAAC;EAED,MAAM,cAAc,qBAAqB,KAAK;EAC9C,MAAM,KAAK,aAAa,QAAQ;EAChC,MAAM,cAAc,eAAe;GACjC,aAAa,OAAO,CAAC,CAAC,EAAE,MAAM;GAC9B,CAAC,UAAU,SAAS,aAAa,QAAQ,CAAC,CAAC,EAAE;GAC7C,GAAG,EAAE,MAAM;GACX,GAAG,GAAG,WAAW,MAAM,OAAO;EAChC,CAAC;EACD,MAAM,aAAa,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;EACjD,MAAM,aAAa,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;EAEjD,SAAa;;GAEX,UAAU,UAAU;;GAEpB,KAAK;;GAEL,MAAM,MAAM;;GAEZ,SAAS,MAAM;EACjB,CAAC;;uBAjFC,YAwBY,wBArBL,QAAA,GAAG,GAHV,WACU,MAuBE,MAAA,GAvBI;IACb,OAAO,YAAA;IAEP,OAAO,MAAA,WAAA;IACP,SAAO,MAAA,WAAA;;2BAkBD,CAhBP,mBAgBO,QAAA,EAhBA,OAAK,eAAE,WAAA,KAAU,EAAA,GAAA;KACWA,KAAAA,OAAM,mBAAA,UAAA,GAAvC,mBAEO,QAFP,YAEO,CADL,WAAiC,KAAA,QAAA,cAAA,CAAA,CAAA,KAEG,QAAA,eAAA,UAAA,GAAtC,mBAEO,QAFP,YAEO,EAAA,UAAA,GADL,YAA+B,wBAAf,QAAA,WAAW,CAAA,EAAA,CAAA,KAAA,mBAAA,QAAA,IAAA;KAE7B,mBAEO,QAAA,EAFA,OAAK,eAAE,WAAA,KAAU,EAAA,GAAA,CACtB,WAAQ,KAAA,QAAA,SAAA,CAAA,GAAA,CAAA;KAEwBA,KAAAA,OAAM,oBAAA,UAAA,GAAxC,mBAEO,QAFP,YAEO,CADL,WAAkC,KAAA,QAAA,eAAA,CAAA,CAAA,KAEG,QAAA,gBAAA,UAAA,GAAvC,mBAEO,QAFP,YAEO,EAAA,UAAA,GADL,YAAgC,wBAAhB,QAAA,YAAY,CAAA,EAAA,CAAA,KAAA,mBAAA,QAAA,IAAA"}
@@ -1,13 +1,13 @@
1
- import { vue_runtime_esm_bundler_exports } from "../../../../node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
2
1
  import { useFormDisabled } from "../../form/src/hooks/use-form-common-props.mjs";
2
+ import { computed, ref } from "vue";
3
3
  //#region ../../packages/components/button/src/use-button.ts
4
4
  const useButton = (props, slots) => {
5
5
  const _disabled = useFormDisabled();
6
- const _ref = (0, vue_runtime_esm_bundler_exports.ref)();
6
+ const _ref = ref();
7
7
  const { hasLeftSlot, hasRightSlot } = slots;
8
8
  const hasLeftSection = hasLeftSlot || !!props.leftSection;
9
9
  const hasRightSection = hasRightSlot || !!props.rightSection;
10
- const _props = (0, vue_runtime_esm_bundler_exports.computed)(() => {
10
+ const _props = computed(() => {
11
11
  const _attrs = {
12
12
  "data-disabled": _disabled.value || props.loading || void 0,
13
13
  "data-block": props.fullWidth || void 0,
@@ -1 +1 @@
1
- {"version":3,"file":"use-button.mjs","names":[],"sources":["../../../../../../../packages/components/button/src/use-button.ts"],"sourcesContent":["import {} from '@cck-ui/components'\nimport { computed, ref } from 'vue'\nimport { ButtonProps } from './button.types'\nimport { useFormDisabled } from '@cck-ui/components/form'\n\nexport const useButton = (\n props: ButtonProps,\n slots: {\n hasLeftSlot: boolean\n hasRightSlot: boolean\n }\n) => {\n const _disabled = useFormDisabled()\n const _ref = ref<HTMLButtonElement>()\n\n const { hasLeftSlot, hasRightSlot } = slots\n\n const hasLeftSection = hasLeftSlot || !!props.leftSection\n const hasRightSection = hasRightSlot || !!props.rightSection\n\n const _props = computed(() => {\n const _attrs: Record<string, any> = {\n 'data-disabled': _disabled.value || props.loading || undefined,\n 'data-block': props.fullWidth || undefined,\n 'data-size': props.size && props.size !== 'sm' ? props.size : undefined,\n 'data-with-left-section': hasLeftSection || undefined,\n 'data-with-right-section': hasRightSection || undefined,\n 'data-variant': props.variant || 'default'\n }\n if (props.tag === 'button') {\n _attrs['aria-disabled'] = _disabled.value || props.loading || undefined\n _attrs['disabled'] = _disabled.value || props.loading\n }\n return _attrs\n })\n\n const handleClick = (evt: MouseEvent) => {\n if (_disabled.value || props.loading) {\n evt.stopPropagation()\n return\n }\n }\n\n return {\n _disabled,\n _ref,\n _props,\n handleClick\n }\n}\n"],"mappings":";;;AAKA,MAAa,aACX,OACA,UAIG;CACH,MAAM,YAAY,gBAAgB;CAClC,MAAM,QAAA,GAAA,gCAAA,IAAA,CAA8B;CAEpC,MAAM,EAAE,aAAa,iBAAiB;CAEtC,MAAM,iBAAiB,eAAe,CAAC,CAAC,MAAM;CAC9C,MAAM,kBAAkB,gBAAgB,CAAC,CAAC,MAAM;CAEhD,MAAM,UAAA,GAAA,gCAAA,SAAA,OAAwB;EAC5B,MAAM,SAA8B;GAClC,iBAAiB,UAAU,SAAS,MAAM,WAAW,KAAA;GACrD,cAAc,MAAM,aAAa,KAAA;GACjC,aAAa,MAAM,QAAQ,MAAM,SAAS,OAAO,MAAM,OAAO,KAAA;GAC9D,0BAA0B,kBAAkB,KAAA;GAC5C,2BAA2B,mBAAmB,KAAA;GAC9C,gBAAgB,MAAM,WAAW;EACnC;EACA,IAAI,MAAM,QAAQ,UAAU;GAC1B,OAAO,mBAAmB,UAAU,SAAS,MAAM,WAAW,KAAA;GAC9D,OAAO,cAAc,UAAU,SAAS,MAAM;EAChD;EACA,OAAO;CACT,CAAC;CAED,MAAM,eAAe,QAAoB;EACvC,IAAI,UAAU,SAAS,MAAM,SAAS;GACpC,IAAI,gBAAgB;GACpB;EACF;CACF;CAEA,OAAO;EACL;EACA;EACA;EACA;CACF;AACF"}
1
+ {"version":3,"file":"use-button.mjs","names":[],"sources":["../../../../../../../packages/components/button/src/use-button.ts"],"sourcesContent":["import {} from '@cck-ui/components'\nimport { computed, ref } from 'vue'\nimport { ButtonProps } from './button.types'\nimport { useFormDisabled } from '@cck-ui/components/form'\n\nexport const useButton = (\n props: ButtonProps,\n slots: {\n hasLeftSlot: boolean\n hasRightSlot: boolean\n }\n) => {\n const _disabled = useFormDisabled()\n const _ref = ref<HTMLButtonElement>()\n\n const { hasLeftSlot, hasRightSlot } = slots\n\n const hasLeftSection = hasLeftSlot || !!props.leftSection\n const hasRightSection = hasRightSlot || !!props.rightSection\n\n const _props = computed(() => {\n const _attrs: Record<string, any> = {\n 'data-disabled': _disabled.value || props.loading || undefined,\n 'data-block': props.fullWidth || undefined,\n 'data-size': props.size && props.size !== 'sm' ? props.size : undefined,\n 'data-with-left-section': hasLeftSection || undefined,\n 'data-with-right-section': hasRightSection || undefined,\n 'data-variant': props.variant || 'default'\n }\n if (props.tag === 'button') {\n _attrs['aria-disabled'] = _disabled.value || props.loading || undefined\n _attrs['disabled'] = _disabled.value || props.loading\n }\n return _attrs\n })\n\n const handleClick = (evt: MouseEvent) => {\n if (_disabled.value || props.loading) {\n evt.stopPropagation()\n return\n }\n }\n\n return {\n _disabled,\n _ref,\n _props,\n handleClick\n }\n}\n"],"mappings":";;;AAKA,MAAa,aACX,OACA,UAIG;CACH,MAAM,YAAY,gBAAgB;CAClC,MAAM,OAAO,IAAuB;CAEpC,MAAM,EAAE,aAAa,iBAAiB;CAEtC,MAAM,iBAAiB,eAAe,CAAC,CAAC,MAAM;CAC9C,MAAM,kBAAkB,gBAAgB,CAAC,CAAC,MAAM;CAEhD,MAAM,SAAS,eAAe;EAC5B,MAAM,SAA8B;GAClC,iBAAiB,UAAU,SAAS,MAAM,WAAW,KAAA;GACrD,cAAc,MAAM,aAAa,KAAA;GACjC,aAAa,MAAM,QAAQ,MAAM,SAAS,OAAO,MAAM,OAAO,KAAA;GAC9D,0BAA0B,kBAAkB,KAAA;GAC5C,2BAA2B,mBAAmB,KAAA;GAC9C,gBAAgB,MAAM,WAAW;EACnC;EACA,IAAI,MAAM,QAAQ,UAAU;GAC1B,OAAO,mBAAmB,UAAU,SAAS,MAAM,WAAW,KAAA;GAC9D,OAAO,cAAc,UAAU,SAAS,MAAM;EAChD;EACA,OAAO;CACT,CAAC;CAED,MAAM,eAAe,QAAoB;EACvC,IAAI,UAAU,SAAS,MAAM,SAAS;GACpC,IAAI,gBAAgB;GACpB;EACF;CACF;CAEA,OAAO;EACL;EACA;EACA;EACA;CACF;AACF"}
@@ -1,12 +1,12 @@
1
- import { vue_runtime_esm_bundler_exports } from "../../../../../node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
2
1
  import { useProp } from "../../../../hooks/use-prop/index.mjs";
3
2
  import { formContextKey } from "../constants.mjs";
3
+ import { computed, inject, unref } from "vue";
4
4
  //#region ../../packages/components/form/src/hooks/use-form-common-props.ts
5
5
  const useFormDisabled = (fallback) => {
6
6
  const disabled = useProp("disabled");
7
- const form = (0, vue_runtime_esm_bundler_exports.inject)(formContextKey, void 0);
8
- return (0, vue_runtime_esm_bundler_exports.computed)(() => {
9
- return disabled.value ?? (0, vue_runtime_esm_bundler_exports.unref)(fallback) ?? form?.disabled ?? false;
7
+ const form = inject(formContextKey, void 0);
8
+ return computed(() => {
9
+ return disabled.value ?? unref(fallback) ?? form?.disabled ?? false;
10
10
  });
11
11
  };
12
12
  const useDisabled = useFormDisabled;
@@ -1 +1 @@
1
- {"version":3,"file":"use-form-common-props.mjs","names":[],"sources":["../../../../../../../../packages/components/form/src/hooks/use-form-common-props.ts"],"sourcesContent":["import { useProp } from '@cck-ui/hooks'\nimport { computed, inject, MaybeRef, unref } from 'vue'\nimport { formContextKey } from '../constants'\n\nexport const useFormDisabled = (fallback?: MaybeRef<boolean | undefined>) => {\n const disabled = useProp<boolean>('disabled')\n const form = inject(formContextKey, undefined)\n\n return computed(() => {\n return disabled.value ?? unref(fallback) ?? form?.disabled ?? false\n })\n}\n\nexport const useDisabled = useFormDisabled\n"],"mappings":";;;;AAIA,MAAa,mBAAmB,aAA6C;CAC3E,MAAM,WAAW,QAAiB,UAAU;CAC5C,MAAM,QAAA,GAAA,gCAAA,OAAA,CAAc,gBAAgB,KAAA,CAAS;CAE7C,QAAA,GAAA,gCAAA,SAAA,OAAsB;EACpB,OAAO,SAAS,UAAA,GAAA,gCAAA,MAAA,CAAe,QAAQ,KAAK,MAAM,YAAY;CAChE,CAAC;AACH;AAEA,MAAa,cAAc"}
1
+ {"version":3,"file":"use-form-common-props.mjs","names":[],"sources":["../../../../../../../../packages/components/form/src/hooks/use-form-common-props.ts"],"sourcesContent":["import { useProp } from '@cck-ui/hooks'\nimport { computed, inject, MaybeRef, unref } from 'vue'\nimport { formContextKey } from '../constants'\n\nexport const useFormDisabled = (fallback?: MaybeRef<boolean | undefined>) => {\n const disabled = useProp<boolean>('disabled')\n const form = inject(formContextKey, undefined)\n\n return computed(() => {\n return disabled.value ?? unref(fallback) ?? form?.disabled ?? false\n })\n}\n\nexport const useDisabled = useFormDisabled\n"],"mappings":";;;;AAIA,MAAa,mBAAmB,aAA6C;CAC3E,MAAM,WAAW,QAAiB,UAAU;CAC5C,MAAM,OAAO,OAAO,gBAAgB,KAAA,CAAS;CAE7C,OAAO,eAAe;EACpB,OAAO,SAAS,SAAS,MAAM,QAAQ,KAAK,MAAM,YAAY;CAChE,CAAC;AACH;AAEA,MAAa,cAAc"}
@@ -1,9 +1,9 @@
1
1
  import { isUndefined } from "../../../utils/types.mjs";
2
2
  import { addUnit } from "../../../utils/dom/style.mjs";
3
- import { vue_runtime_esm_bundler_exports } from "../../../../node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
4
3
  import { useNamespace } from "../../../hooks/use-namespace/index.mjs";
4
+ import { computed, createElementBlock, defineComponent, mergeProps, openBlock, renderSlot, unref } from "vue";
5
5
  //#region ../../packages/components/icon/src/icon.vue?vue&type=script&setup=true&lang.ts
6
- var icon_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue_runtime_esm_bundler_exports.defineComponent)({
6
+ var icon_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
7
7
  name: "CIcon",
8
8
  inheritAttrs: false,
9
9
  __name: "icon",
@@ -20,7 +20,7 @@ var icon_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue_run
20
20
  setup(__props) {
21
21
  const props = __props;
22
22
  const ns = useNamespace("icon");
23
- const style = (0, vue_runtime_esm_bundler_exports.computed)(() => {
23
+ const style = computed(() => {
24
24
  const { size, color } = props;
25
25
  if (!size && !color) return {};
26
26
  return {
@@ -29,10 +29,10 @@ var icon_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue_run
29
29
  };
30
30
  });
31
31
  return (_ctx, _cache) => {
32
- return (0, vue_runtime_esm_bundler_exports.openBlock)(), (0, vue_runtime_esm_bundler_exports.createElementBlock)("i", (0, vue_runtime_esm_bundler_exports.mergeProps)({
33
- class: (0, vue_runtime_esm_bundler_exports.unref)(ns).b(),
32
+ return openBlock(), createElementBlock("i", mergeProps({
33
+ class: unref(ns).b(),
34
34
  style: style.value
35
- }, _ctx.$attrs), [(0, vue_runtime_esm_bundler_exports.renderSlot)(_ctx.$slots, "default")], 16);
35
+ }, _ctx.$attrs), [renderSlot(_ctx.$slots, "default")], 16);
36
36
  };
37
37
  }
38
38
  });
@@ -1 +1 @@
1
- {"version":3,"file":"icon.vue_vue_type_script_setup_true_lang.mjs","names":["$attrs"],"sources":["../../../../../../../packages/components/icon/src/icon.vue","../../../../../../../packages/components/icon/src/icon.vue"],"sourcesContent":["<template>\n <i :class=\"ns.b()\" :style=\"style\" v-bind=\"$attrs\">\n <slot />\n </i>\n</template>\n\n<script setup lang=\"ts\">\nimport { type CSSProperties, computed } from 'vue'\nimport { useNamespace } from '@cck-ui/hooks'\nimport { addUnit, isUndefined } from '@cck-ui/utils'\nimport { type IconProps } from './icon.types'\n\ndefineOptions({\n name: 'CIcon',\n inheritAttrs: false\n})\nconst props = defineProps<IconProps>()\nconst ns = useNamespace('icon')\n\nconst style = computed<CSSProperties>(() => {\n const { size, color } = props\n if (!size && !color) return {}\n\n return {\n fontSize: isUndefined(size) ? undefined : addUnit(size),\n '--color': color\n }\n})\n</script>\n","<template>\n <i :class=\"ns.b()\" :style=\"style\" v-bind=\"$attrs\">\n <slot />\n </i>\n</template>\n\n<script setup lang=\"ts\">\nimport { type CSSProperties, computed } from 'vue'\nimport { useNamespace } from '@cck-ui/hooks'\nimport { addUnit, isUndefined } from '@cck-ui/utils'\nimport { type IconProps } from './icon.types'\n\ndefineOptions({\n name: 'CIcon',\n inheritAttrs: false\n})\nconst props = defineProps<IconProps>()\nconst ns = useNamespace('icon')\n\nconst style = computed<CSSProperties>(() => {\n const { size, color } = props\n if (!size && !color) return {}\n\n return {\n fontSize: isUndefined(size) ? undefined : addUnit(size),\n '--color': color\n }\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAgBA,MAAM,QAAQ;EACd,MAAM,KAAK,aAAa,MAAM;EAE9B,MAAM,SAAA,GAAA,gCAAA,SAAA,OAAsC;GAC1C,MAAM,EAAE,MAAM,UAAU;GACxB,IAAI,CAAC,QAAQ,CAAC,OAAO,OAAO,CAAC;GAE7B,OAAO;IACL,UAAU,YAAY,IAAI,IAAI,KAAA,IAAY,QAAQ,IAAI;IACtD,WAAW;GACb;EACF,CAAC;;oHCxBK,MAAA,GAAA,gCAAA,WAAA,CAAA;IAFA,QAAA,GAAA,gCAAA,MAAA,CAAO,EAAA,CAAE,CAAC,EAAC;IAAK,OAAO,MAAA;MAAeA,KAAAA,MAAM,GAAA,EAAA,GAAA,gCAAA,WAAA,CACtC,KAAA,QAAA,SAAA,CAAA,GAAA,EAAA"}
1
+ {"version":3,"file":"icon.vue_vue_type_script_setup_true_lang.mjs","names":["$attrs"],"sources":["../../../../../../../packages/components/icon/src/icon.vue"],"sourcesContent":["<template>\n <i :class=\"ns.b()\" :style=\"style\" v-bind=\"$attrs\">\n <slot />\n </i>\n</template>\n\n<script setup lang=\"ts\">\nimport { type CSSProperties, computed } from 'vue'\nimport { useNamespace } from '@cck-ui/hooks'\nimport { addUnit, isUndefined } from '@cck-ui/utils'\nimport { type IconProps } from './icon.types'\n\ndefineOptions({\n name: 'CIcon',\n inheritAttrs: false\n})\nconst props = defineProps<IconProps>()\nconst ns = useNamespace('icon')\n\nconst style = computed<CSSProperties>(() => {\n const { size, color } = props\n if (!size && !color) return {}\n\n return {\n fontSize: isUndefined(size) ? undefined : addUnit(size),\n '--color': color\n }\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAgBA,MAAM,QAAQ;EACd,MAAM,KAAK,aAAa,MAAM;EAE9B,MAAM,QAAQ,eAA8B;GAC1C,MAAM,EAAE,MAAM,UAAU;GACxB,IAAI,CAAC,QAAQ,CAAC,OAAO,OAAO,CAAC;GAE7B,OAAO;IACL,UAAU,YAAY,IAAI,IAAI,KAAA,IAAY,QAAQ,IAAI;IACtD,WAAW;GACb;EACF,CAAC;;uBA1BC,mBAEI,KAFJ,WAEI;IAFA,OAAO,MAAA,EAAA,CAAE,CAAC,EAAC;IAAK,OAAO,MAAA;MAAeA,KAAAA,MAAM,GAAA,CAC9C,WAAQ,KAAA,QAAA,SAAA,CAAA,GAAA,EAAA"}
@@ -1,4 +1,4 @@
1
- import { vue_runtime_esm_bundler_exports } from "../../../node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
1
+ import { computed, getCurrentInstance, inject, ref, unref } from "vue";
2
2
  //#region ../../packages/hooks/use-namespace/index.ts
3
3
  const defaultNamespace = "c";
4
4
  const statePrefix = "is-";
@@ -11,9 +11,9 @@ const _bem = (namespace, block, blockSuffix, element, modifier) => {
11
11
  };
12
12
  const namespaceContextKey = Symbol("namespaceContextKey");
13
13
  const useGetDerivedNamespace = (namespaceOverrides) => {
14
- const derivedNamespace = namespaceOverrides || ((0, vue_runtime_esm_bundler_exports.getCurrentInstance)() ? (0, vue_runtime_esm_bundler_exports.inject)(namespaceContextKey, (0, vue_runtime_esm_bundler_exports.ref)("c")) : (0, vue_runtime_esm_bundler_exports.ref)("c"));
15
- return (0, vue_runtime_esm_bundler_exports.computed)(() => {
16
- return (0, vue_runtime_esm_bundler_exports.unref)(derivedNamespace) || "c";
14
+ const derivedNamespace = namespaceOverrides || (getCurrentInstance() ? inject(namespaceContextKey, ref("c")) : ref("c"));
15
+ return computed(() => {
16
+ return unref(derivedNamespace) || "c";
17
17
  });
18
18
  };
19
19
  const useNamespace = (block, namespaceOverrides) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../packages/hooks/use-namespace/index.ts"],"sourcesContent":["import { computed, getCurrentInstance, inject, ref, unref } from 'vue'\n\nimport type { InjectionKey, Ref } from 'vue'\n\nexport const defaultNamespace = 'c'\nconst statePrefix = 'is-'\n\nconst _bem = (\n namespace: string,\n block: string,\n blockSuffix: string,\n element: string,\n modifier: string\n) => {\n let cls = `${namespace}-${block}`\n if (blockSuffix) {\n cls += `-${blockSuffix}`\n }\n if (element) {\n cls += `__${element}`\n }\n if (modifier) {\n cls += `--${modifier}`\n }\n return cls\n}\n\nexport const namespaceContextKey: InjectionKey<Ref<string | undefined>> =\n Symbol('namespaceContextKey')\n\nexport const useGetDerivedNamespace = (\n namespaceOverrides?: Ref<string | undefined>\n) => {\n const derivedNamespace =\n namespaceOverrides ||\n (getCurrentInstance()\n ? inject(namespaceContextKey, ref(defaultNamespace))\n : ref(defaultNamespace))\n const namespace = computed(() => {\n return unref(derivedNamespace) || defaultNamespace\n })\n return namespace\n}\n\nexport const useNamespace = (\n block: string,\n namespaceOverrides?: Ref<string | undefined>\n) => {\n const namespace = useGetDerivedNamespace(namespaceOverrides)\n const b = (blockSuffix = '') =>\n _bem(namespace.value, block, blockSuffix, '', '')\n const e = (element?: string) =>\n element ? _bem(namespace.value, block, '', element, '') : ''\n const m = (modifier?: string) =>\n modifier ? _bem(namespace.value, block, '', '', modifier) : ''\n const be = (blockSuffix?: string, element?: string) =>\n blockSuffix && element\n ? _bem(namespace.value, block, blockSuffix, element, '')\n : ''\n const em = (element?: string, modifier?: string) =>\n element && modifier\n ? _bem(namespace.value, block, '', element, modifier)\n : ''\n const bm = (blockSuffix?: string, modifier?: string) =>\n blockSuffix && modifier\n ? _bem(namespace.value, block, blockSuffix, '', modifier)\n : ''\n const bem = (blockSuffix?: string, element?: string, modifier?: string) =>\n blockSuffix && element && modifier\n ? _bem(namespace.value, block, blockSuffix, element, modifier)\n : ''\n const is: {\n (name: string, state: boolean | undefined): string\n (name: string): string\n } = (name: string, ...args: [boolean | undefined] | []) => {\n const state = args.length >= 1 ? args[0]! : true\n return name && state ? `${statePrefix}${name}` : ''\n }\n\n // for css var\n // --el-xxx: value;\n const cssVar = (object: Record<string, string>) => {\n const styles: Record<string, string> = {}\n for (const key in object) {\n if (object[key]) {\n styles[`--${namespace.value}-${key}`] = object[key]\n }\n }\n return styles\n }\n // with block\n const cssVarBlock = (object: Record<string, string>) => {\n const styles: Record<string, string> = {}\n for (const key in object) {\n if (object[key]) {\n styles[`--${namespace.value}-${block}-${key}`] = object[key]\n }\n }\n return styles\n }\n\n const cssVarName = (name: string) => `--${namespace.value}-${name}`\n const cssVarBlockName = (name: string) =>\n `--${namespace.value}-${block}-${name}`\n\n return {\n namespace,\n b,\n e,\n m,\n be,\n em,\n bm,\n bem,\n is,\n // css\n cssVar,\n cssVarName,\n cssVarBlock,\n cssVarBlockName\n }\n}\n\nexport type UseNamespaceReturn = ReturnType<typeof useNamespace>\n"],"mappings":";;AAIA,MAAa,mBAAmB;AAChC,MAAM,cAAc;AAEpB,MAAM,QACJ,WACA,OACA,aACA,SACA,aACG;CACH,IAAI,MAAM,GAAG,UAAU,GAAG;CAC1B,IAAI,aACF,OAAO,IAAI;CAEb,IAAI,SACF,OAAO,KAAK;CAEd,IAAI,UACF,OAAO,KAAK;CAEd,OAAO;AACT;AAEA,MAAa,sBACX,OAAO,qBAAqB;AAE9B,MAAa,0BACX,uBACG;CACH,MAAM,mBACJ,wBAAA,GAAA,gCAAA,mBAAA,CACoB,KAAA,GAAA,gCAAA,OAAA,CACT,sBAAA,GAAA,gCAAA,IAAA,CAAA,GAAyC,CAAC,KAAA,GAAA,gCAAA,IAAA,CAAA,GAC7B;CAI1B,QAAA,GAAA,gCAAA,SAAA,OAHiC;EAC/B,QAAA,GAAA,gCAAA,MAAA,CAAa,gB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AmB,SACvB,KAAK,UAAU,MAAM,GAAG,MAAM,GAAG;CAEnC,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;CACF;AACF"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../packages/hooks/use-namespace/index.ts"],"sourcesContent":["import { computed, getCurrentInstance, inject, ref, unref } from 'vue'\n\nimport type { InjectionKey, Ref } from 'vue'\n\nexport const defaultNamespace = 'c'\nconst statePrefix = 'is-'\n\nconst _bem = (\n namespace: string,\n block: string,\n blockSuffix: string,\n element: string,\n modifier: string\n) => {\n let cls = `${namespace}-${block}`\n if (blockSuffix) {\n cls += `-${blockSuffix}`\n }\n if (element) {\n cls += `__${element}`\n }\n if (modifier) {\n cls += `--${modifier}`\n }\n return cls\n}\n\nexport const namespaceContextKey: InjectionKey<Ref<string | undefined>> =\n Symbol('namespaceContextKey')\n\nexport const useGetDerivedNamespace = (\n namespaceOverrides?: Ref<string | undefined>\n) => {\n const derivedNamespace =\n namespaceOverrides ||\n (getCurrentInstance()\n ? inject(namespaceContextKey, ref(defaultNamespace))\n : ref(defaultNamespace))\n const namespace = computed(() => {\n return unref(derivedNamespace) || defaultNamespace\n })\n return namespace\n}\n\nexport const useNamespace = (\n block: string,\n namespaceOverrides?: Ref<string | undefined>\n) => {\n const namespace = useGetDerivedNamespace(namespaceOverrides)\n const b = (blockSuffix = '') =>\n _bem(namespace.value, block, blockSuffix, '', '')\n const e = (element?: string) =>\n element ? _bem(namespace.value, block, '', element, '') : ''\n const m = (modifier?: string) =>\n modifier ? _bem(namespace.value, block, '', '', modifier) : ''\n const be = (blockSuffix?: string, element?: string) =>\n blockSuffix && element\n ? _bem(namespace.value, block, blockSuffix, element, '')\n : ''\n const em = (element?: string, modifier?: string) =>\n element && modifier\n ? _bem(namespace.value, block, '', element, modifier)\n : ''\n const bm = (blockSuffix?: string, modifier?: string) =>\n blockSuffix && modifier\n ? _bem(namespace.value, block, blockSuffix, '', modifier)\n : ''\n const bem = (blockSuffix?: string, element?: string, modifier?: string) =>\n blockSuffix && element && modifier\n ? _bem(namespace.value, block, blockSuffix, element, modifier)\n : ''\n const is: {\n (name: string, state: boolean | undefined): string\n (name: string): string\n } = (name: string, ...args: [boolean | undefined] | []) => {\n const state = args.length >= 1 ? args[0]! : true\n return name && state ? `${statePrefix}${name}` : ''\n }\n\n // for css var\n // --el-xxx: value;\n const cssVar = (object: Record<string, string>) => {\n const styles: Record<string, string> = {}\n for (const key in object) {\n if (object[key]) {\n styles[`--${namespace.value}-${key}`] = object[key]\n }\n }\n return styles\n }\n // with block\n const cssVarBlock = (object: Record<string, string>) => {\n const styles: Record<string, string> = {}\n for (const key in object) {\n if (object[key]) {\n styles[`--${namespace.value}-${block}-${key}`] = object[key]\n }\n }\n return styles\n }\n\n const cssVarName = (name: string) => `--${namespace.value}-${name}`\n const cssVarBlockName = (name: string) =>\n `--${namespace.value}-${block}-${name}`\n\n return {\n namespace,\n b,\n e,\n m,\n be,\n em,\n bm,\n bem,\n is,\n // css\n cssVar,\n cssVarName,\n cssVarBlock,\n cssVarBlockName\n }\n}\n\nexport type UseNamespaceReturn = ReturnType<typeof useNamespace>\n"],"mappings":";;AAIA,MAAa,mBAAmB;AAChC,MAAM,cAAc;AAEpB,MAAM,QACJ,WACA,OACA,aACA,SACA,aACG;CACH,IAAI,MAAM,GAAG,UAAU,GAAG;CAC1B,IAAI,aACF,OAAO,IAAI;CAEb,IAAI,SACF,OAAO,KAAK;CAEd,IAAI,UACF,OAAO,KAAK;CAEd,OAAO;AACT;AAEA,MAAa,sBACX,OAAO,qBAAqB;AAE9B,MAAa,0BACX,uBACG;CACH,MAAM,mBACJ,uBACC,mBAAmB,IAChB,OAAO,qBAAqB,IAAA,GAAoB,CAAC,IACjD,IAAA,GAAoB;CAI1B,OAHkB,eAAe;EAC/B,OAAO,MAAM,gBAAgB,KAAA;CAC/B,CACe;AACjB;AAEA,MAAa,gBACX,OACA,uBACG;CACH,MA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ACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;CACF;AACF"}
@@ -1,8 +1,8 @@
1
- import { vue_runtime_esm_bundler_exports } from "../../../node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
1
+ import { computed, getCurrentInstance } from "vue";
2
2
  //#region ../../packages/hooks/use-prop/index.ts
3
3
  const useProp = (name) => {
4
- const vm = (0, vue_runtime_esm_bundler_exports.getCurrentInstance)();
5
- return (0, vue_runtime_esm_bundler_exports.computed)(() => (vm?.proxy?.$props)?.[name]);
4
+ const vm = getCurrentInstance();
5
+ return computed(() => (vm?.proxy?.$props)?.[name]);
6
6
  };
7
7
  //#endregion
8
8
  export { useProp };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../packages/hooks/use-prop/index.ts"],"sourcesContent":["import { computed, getCurrentInstance } from 'vue'\nimport type { ComputedRef } from 'vue'\n\nexport const useProp = <T>(name: string): ComputedRef<T | undefined> => {\n const vm = getCurrentInstance()\n return computed(() => (vm?.proxy?.$props as any)?.[name])\n}\n"],"mappings":";;AAGA,MAAa,WAAc,SAA6C;CACtE,MAAM,MAAA,GAAA,gCAAA,mBAAA,CAAwB;CAC9B,QAAA,GAAA,gCAAA,SAAA,QAAuB,IAAI,OAAO,OAAA,GAAiB,KAAK;AAC1D"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../packages/hooks/use-prop/index.ts"],"sourcesContent":["import { computed, getCurrentInstance } from 'vue'\nimport type { ComputedRef } from 'vue'\n\nexport const useProp = <T>(name: string): ComputedRef<T | undefined> => {\n const vm = getCurrentInstance()\n return computed(() => (vm?.proxy?.$props as any)?.[name])\n}\n"],"mappings":";;AAGA,MAAa,WAAc,SAA6C;CACtE,MAAM,KAAK,mBAAmB;CAC9B,OAAO,gBAAgB,IAAI,OAAO,OAAA,GAAiB,KAAK;AAC1D"}
@@ -1,10 +1,10 @@
1
- import { vue_runtime_esm_bundler_exports } from "../../../node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
1
+ import { readonly, ref } from "vue";
2
2
  //#region ../../packages/hooks/use-theme/index.ts
3
3
  const getCurrentScheme = () => {
4
4
  if (typeof document === "undefined") return "light";
5
5
  return document.documentElement.dataset.cColorScheme === "dark" ? "dark" : "light";
6
6
  };
7
- const colorScheme = (0, vue_runtime_esm_bundler_exports.ref)(getCurrentScheme());
7
+ const colorScheme = ref(getCurrentScheme());
8
8
  if (typeof window !== "undefined") new MutationObserver(() => {
9
9
  const newScheme = getCurrentScheme();
10
10
  if (newScheme !== colorScheme.value) colorScheme.value = newScheme;
@@ -12,7 +12,7 @@ if (typeof window !== "undefined") new MutationObserver(() => {
12
12
  attributes: true,
13
13
  attributeFilter: ["data-c-color-scheme"]
14
14
  });
15
- const useColorScheme = () => (0, vue_runtime_esm_bundler_exports.readonly)(colorScheme);
15
+ const useColorScheme = () => readonly(colorScheme);
16
16
  //#endregion
17
17
  export { useColorScheme };
18
18
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../packages/hooks/use-theme/index.ts"],"sourcesContent":["import { readonly, ref } from 'vue'\n\nexport type ColorScheme = 'light' | 'dark'\n\nconst getCurrentScheme = (): ColorScheme => {\n if (typeof document === 'undefined') return 'light'\n const scheme = document.documentElement.dataset.cColorScheme\n return scheme === 'dark' ? 'dark' : 'light'\n}\n\nconst colorScheme = ref<ColorScheme>(getCurrentScheme())\n\nif (typeof window !== 'undefined') {\n const observer = new MutationObserver(() => {\n const newScheme = getCurrentScheme()\n if (newScheme !== colorScheme.value) {\n colorScheme.value = newScheme\n }\n })\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['data-c-color-scheme']\n })\n}\n\nexport const useColorScheme = () => readonly(colorScheme)\n"],"mappings":";;AAIA,MAAM,yBAAsC;CAC1C,IAAI,OAAO,aAAa,aAAa,OAAO;CAE5C,OADe,SAAS,gBAAgB,QAAQ,iBAC9B,SAAS,SAAS;AACtC;AAEA,MAAM,eAAA,GAAA,gCAAA,IAAA,CAA+B,iBAAiB,CAAC;AAEvD,IAAI,OAAO,WAAW,aAOpB,IANqB,uBAAuB;CAC1C,MAAM,YAAY,iBAAiB;CACnC,IAAI,cAAc,YAAY,OAC5B,YAAY,QAAQ;AAExB,CACO,CAAC,CAAC,QAAQ,SAAS,iBAAiB;CACzC,YAAY;CACZ,iBAAiB,CAAC,qBAAqB;AACzC,CAAC;AAGH,MAAa,wBAAA,GAAA,gCAAA,SAAA,CAAgC,WAAW"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../../../packages/hooks/use-theme/index.ts"],"sourcesContent":["import { readonly, ref } from 'vue'\n\nexport type ColorScheme = 'light' | 'dark'\n\nconst getCurrentScheme = (): ColorScheme => {\n if (typeof document === 'undefined') return 'light'\n const scheme = document.documentElement.dataset.cColorScheme\n return scheme === 'dark' ? 'dark' : 'light'\n}\n\nconst colorScheme = ref<ColorScheme>(getCurrentScheme())\n\nif (typeof window !== 'undefined') {\n const observer = new MutationObserver(() => {\n const newScheme = getCurrentScheme()\n if (newScheme !== colorScheme.value) {\n colorScheme.value = newScheme\n }\n })\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['data-c-color-scheme']\n })\n}\n\nexport const useColorScheme = () => readonly(colorScheme)\n"],"mappings":";;AAIA,MAAM,yBAAsC;CAC1C,IAAI,OAAO,aAAa,aAAa,OAAO;CAE5C,OADe,SAAS,gBAAgB,QAAQ,iBAC9B,SAAS,SAAS;AACtC;AAEA,MAAM,cAAc,IAAiB,iBAAiB,CAAC;AAEvD,IAAI,OAAO,WAAW,aAOpB,IANqB,uBAAuB;CAC1C,MAAM,YAAY,iBAAiB;CACnC,IAAI,cAAc,YAAY,OAC5B,YAAY,QAAQ;AAExB,CACO,CAAC,CAAC,QAAQ,SAAS,iBAAiB;CACzC,YAAY;CACZ,iBAAiB,CAAC,qBAAqB;AACzC,CAAC;AAGH,MAAa,uBAAuB,SAAS,WAAW"}
@@ -1,37 +1,4 @@
1
1
  //#region \0rolldown/runtime.js
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
2
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
9
- var __exportAll = (all, no_symbols) => {
10
- let target = {};
11
- for (var name in all) __defProp(target, name, {
12
- get: all[name],
13
- enumerable: true
14
- });
15
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
16
- return target;
17
- };
18
- var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
20
- key = keys[i];
21
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
22
- get: ((k) => from[k]).bind(null, key),
23
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
24
- });
25
- }
26
- return to;
27
- };
28
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
29
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
30
- value: mod,
31
- enumerable: true
32
- }) : target, mod));
33
3
  //#endregion
34
4
  exports.__commonJSMin = __commonJSMin;
35
- exports.__exportAll = __exportAll;
36
- exports.__reExport = __reExport;
37
- exports.__toESM = __toESM;
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_colors = require("../../../utils/colors.js");
3
- const require_index = require("../../../../node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/index2.js");
4
- const require_index$1 = require("../../../hooks/use-theme/index.js");
3
+ const require_index = require("../../../hooks/use-theme/index.js");
4
+ let vue = require("vue");
5
5
  //#region ../../packages/components/button/src/button-custom.ts
6
6
  const PRESET_COLORS = [
7
7
  "red",
@@ -40,8 +40,8 @@ const getShadeIndexes = (scheme) => {
40
40
  };
41
41
  };
42
42
  function useButtonCustomStyle(props) {
43
- const colorScheme = require_index$1.useColorScheme();
44
- return (0, require_index.vue_exports.computed)(() => {
43
+ const colorScheme = require_index.useColorScheme();
44
+ return (0, vue.computed)(() => {
45
45
  const styles = {};
46
46
  const { color, gradient, justify, variant } = props;
47
47
  const scheme = colorScheme.value;
@@ -1 +1 @@
1
- {"version":3,"file":"button-custom.js","names":["useColorScheme","generateColorShades","setColorAlpha"],"sources":["../../../../../../../packages/components/button/src/button-custom.ts"],"sourcesContent":["import { ColorScheme, useColorScheme } from '@cck-ui/hooks'\nimport { generateColorShades, setColorAlpha } from '@cck-ui/utils'\nimport { computed } from 'vue'\nimport { ButtonProps } from './button.types'\n\nconst PRESET_COLORS = [\n 'red',\n 'pink',\n 'grape',\n 'violet',\n 'indigo',\n 'blue',\n 'cyan',\n 'teal',\n 'green',\n 'lime',\n 'yellow',\n 'orange',\n 'gray',\n 'dark'\n]\n\nconst getShadeIndexes = (scheme: ColorScheme) => {\n if (scheme === 'light') {\n return {\n bg: 6,\n hover: 7,\n lightBg: 1,\n lightHover: 2,\n lightColor: 9,\n outlineColor: 6,\n outlineHoverBgAlpha: 0.05\n }\n } else {\n return {\n bg: 8,\n hover: 9,\n lightBg: 1,\n lightHover: 2,\n lightColor: 9,\n outlineColor: 4,\n outlineHoverBgAlpha: 0.05\n }\n }\n}\n\nexport function useButtonCustomStyle(props: ButtonProps) {\n const colorScheme = useColorScheme()\n\n return computed(() => {\n const styles: Record<string, string> = {}\n\n const { color, gradient, justify, variant } = props\n const scheme = colorScheme.value\n const idx = getShadeIndexes(scheme)\n\n if (justify) {\n styles['--button-justify'] = justify\n }\n\n switch (variant) {\n case 'default':\n break\n case 'filled':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-bg'] = `var(--c-color-${color}-filled)`\n styles['--button-hover'] = `var(--c-color-${color}-filled-hover)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-bg'] = shades[idx.bg]\n styles['--button-hover'] = shades[idx.hover]\n }\n }\n break\n case 'light':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-bg'] = `var(--c-color-${color}-light)`\n styles['--button-hover'] = `var(--c-color-${color}-light-hover)`\n styles['--button-color'] = `var(--c-color-${color}-light-color)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-bg'] = shades[idx.lightBg]\n styles['--button-hover'] = shades[idx.lightHover]\n styles['--button-color'] = shades[idx.lightColor]\n }\n }\n break\n case 'outline':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-hover'] = `var(--c-color-${color}-outline-hover)`\n styles['--button-color'] = `var(--c-color-${color}-outline)`\n styles['--button-bd'] =\n `calc(0.0625rem * var(--c-scale)) solid var(--c-color-${color}-outline)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-hover'] = setColorAlpha(\n shades[idx.outlineColor],\n idx.outlineHoverBgAlpha\n )\n styles['--button-color'] = shades[idx.outlineColor]\n styles['--button-bd'] =\n `calc(0.0625rem * var(--c-scale)) solid ${shades[idx.outlineColor]}`\n }\n }\n break\n case 'subtle':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-hover'] = `var(--c-color-${color}-outline-hover)`\n styles['--button-color'] = `var(--c-color-${color}-outline)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-hover'] = setColorAlpha(\n shades[idx.outlineColor],\n idx.outlineHoverBgAlpha\n )\n styles['--button-color'] = shades[idx.outlineColor]\n }\n }\n break\n case 'transparent':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-color'] = `var(--c-color-${color}-light-color)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-color'] = shades[idx.lightColor]\n }\n }\n break\n case 'white':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-color'] = `var(--c-color-${color}-filled)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-color'] = shades[idx.bg]\n }\n }\n break\n case 'gradient':\n const from = gradient?.from || 'blue'\n const to = gradient?.to || 'cyan'\n const deg = gradient?.deg || '45'\n\n let finalFrom: string = from\n let finalTo: string = to\n if (PRESET_COLORS.includes(from)) {\n finalFrom = `var(--c-color-${from}-filled)`\n }\n if (PRESET_COLORS.includes(to)) {\n finalTo = `var(--c-color-${to}-filled)`\n }\n\n styles['--button-bg'] =\n `linear-gradient(${deg}deg, ${finalFrom} 0%, ${finalTo} 100%)`\n break\n default:\n break\n }\n\n return styles\n })\n}\n"],"mappings":";;;;;AAKA,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,mBAAmB,WAAwB;CAC/C,IAAI,WAAW,SACb,OAAO;EACL,IAAI;EACJ,OAAO;EACP,SAAS;EACT,YAAY;EACZ,YAAY;EACZ,cAAc;EACd,qBAAqB;CACvB;MAEA,OAAO;EACL,IAAI;EACJ,OAAO;EACP,SAAS;EACT,YAAY;EACZ,YAAY;EACZ,cAAc;EACd,qBAAqB;CACvB;AAEJ;AAEA,SAAgB,qBAAqB,OAAoB;CACvD,MAAM,cAAcA,gBAAAA,eAAe;CAEnC,QAAA,GAAA,cAAA,YAAA,SAAA,OAAsB;EACpB,MAAM,SAAiC,CAAC;EAExC,MAAM,EAAE,OAAO,UAAU,SAAS,YAAY;EAC9C,MAAM,SAAS,YAAY;EAC3B,MAAM,MAAM,gBAAgB,MAAM;EAElC,IAAI,SACF,OAAO,sBAAsB;EAG/B,QAAQ,SAAR;GACE,KAAK,WACH;GACF,KAAK;IACH,IAAI,OACF,IAAI,cAAc,SAAS,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AO,oBAAoB,iBAAiB,MAAM;SAGlD,OAAO,oBADQD,eAAAA,oBAAoB,KACH,CAAC,CAAC,IAAI;IAG1C;GACF,KAAK;IACH,IAAI,OACF,IAAI,cAAc,SAAS,KAAK,GAC9B,OAAO,oBAAoB,iBAAiB,MAAM;SAGlD,OAAO,oBADQA,eAAAA,oBAAoB,KACH,CAAC,CAAC,IAAI;IAG1C;GACF,KAAK;IACH,MAAM,OAAO,UAAU,QAAQ;IAC/B,MAAM,KAAK,UAAU,MAAM;IAC3B,MAAM,MAAM,UAAU,OAAO;IAE7B,IAAI,YAAoB;IACxB,IAAI,UAAkB;IACtB,IAAI,cAAc,SAAS,IAAI,GAC7B,YAAY,iBAAiB,KAAK;IAEpC,IAAI,cAAc,SAAS,EAAE,GAC3B,UAAU,iBAAiB,GAAG;IAGhC,OAAO,iBACL,mBAAmB,IAAI,OAAO,UAAU,OAAO,QAAQ;IACzD;GACF,SACE;EACJ;EAEA,OAAO;CACT,CAAC;AACH"}
1
+ {"version":3,"file":"button-custom.js","names":["useColorScheme","generateColorShades","setColorAlpha"],"sources":["../../../../../../../packages/components/button/src/button-custom.ts"],"sourcesContent":["import { ColorScheme, useColorScheme } from '@cck-ui/hooks'\nimport { generateColorShades, setColorAlpha } from '@cck-ui/utils'\nimport { computed } from 'vue'\nimport { ButtonProps } from './button.types'\n\nconst PRESET_COLORS = [\n 'red',\n 'pink',\n 'grape',\n 'violet',\n 'indigo',\n 'blue',\n 'cyan',\n 'teal',\n 'green',\n 'lime',\n 'yellow',\n 'orange',\n 'gray',\n 'dark'\n]\n\nconst getShadeIndexes = (scheme: ColorScheme) => {\n if (scheme === 'light') {\n return {\n bg: 6,\n hover: 7,\n lightBg: 1,\n lightHover: 2,\n lightColor: 9,\n outlineColor: 6,\n outlineHoverBgAlpha: 0.05\n }\n } else {\n return {\n bg: 8,\n hover: 9,\n lightBg: 1,\n lightHover: 2,\n lightColor: 9,\n outlineColor: 4,\n outlineHoverBgAlpha: 0.05\n }\n }\n}\n\nexport function useButtonCustomStyle(props: ButtonProps) {\n const colorScheme = useColorScheme()\n\n return computed(() => {\n const styles: Record<string, string> = {}\n\n const { color, gradient, justify, variant } = props\n const scheme = colorScheme.value\n const idx = getShadeIndexes(scheme)\n\n if (justify) {\n styles['--button-justify'] = justify\n }\n\n switch (variant) {\n case 'default':\n break\n case 'filled':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-bg'] = `var(--c-color-${color}-filled)`\n styles['--button-hover'] = `var(--c-color-${color}-filled-hover)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-bg'] = shades[idx.bg]\n styles['--button-hover'] = shades[idx.hover]\n }\n }\n break\n case 'light':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-bg'] = `var(--c-color-${color}-light)`\n styles['--button-hover'] = `var(--c-color-${color}-light-hover)`\n styles['--button-color'] = `var(--c-color-${color}-light-color)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-bg'] = shades[idx.lightBg]\n styles['--button-hover'] = shades[idx.lightHover]\n styles['--button-color'] = shades[idx.lightColor]\n }\n }\n break\n case 'outline':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-hover'] = `var(--c-color-${color}-outline-hover)`\n styles['--button-color'] = `var(--c-color-${color}-outline)`\n styles['--button-bd'] =\n `calc(0.0625rem * var(--c-scale)) solid var(--c-color-${color}-outline)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-hover'] = setColorAlpha(\n shades[idx.outlineColor],\n idx.outlineHoverBgAlpha\n )\n styles['--button-color'] = shades[idx.outlineColor]\n styles['--button-bd'] =\n `calc(0.0625rem * var(--c-scale)) solid ${shades[idx.outlineColor]}`\n }\n }\n break\n case 'subtle':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-hover'] = `var(--c-color-${color}-outline-hover)`\n styles['--button-color'] = `var(--c-color-${color}-outline)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-hover'] = setColorAlpha(\n shades[idx.outlineColor],\n idx.outlineHoverBgAlpha\n )\n styles['--button-color'] = shades[idx.outlineColor]\n }\n }\n break\n case 'transparent':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-color'] = `var(--c-color-${color}-light-color)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-color'] = shades[idx.lightColor]\n }\n }\n break\n case 'white':\n if (color) {\n if (PRESET_COLORS.includes(color)) {\n styles['--button-color'] = `var(--c-color-${color}-filled)`\n } else {\n const shades = generateColorShades(color)\n styles['--button-color'] = shades[idx.bg]\n }\n }\n break\n case 'gradient':\n const from = gradient?.from || 'blue'\n const to = gradient?.to || 'cyan'\n const deg = gradient?.deg || '45'\n\n let finalFrom: string = from\n let finalTo: string = to\n if (PRESET_COLORS.includes(from)) {\n finalFrom = `var(--c-color-${from}-filled)`\n }\n if (PRESET_COLORS.includes(to)) {\n finalTo = `var(--c-color-${to}-filled)`\n }\n\n styles['--button-bg'] =\n `linear-gradient(${deg}deg, ${finalFrom} 0%, ${finalTo} 100%)`\n break\n default:\n break\n }\n\n return styles\n })\n}\n"],"mappings":";;;;;AAKA,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,mBAAmB,WAAwB;CAC/C,IAAI,WAAW,SACb,OAAO;EACL,IAAI;EACJ,OAAO;EACP,SAAS;EACT,YAAY;EACZ,YAAY;EACZ,cAAc;EACd,qBAAqB;CACvB;MAEA,OAAO;EACL,IAAI;EACJ,OAAO;EACP,SAAS;EACT,YAAY;EACZ,YAAY;EACZ,cAAc;EACd,qBAAqB;CACvB;AAEJ;AAEA,SAAgB,qBAAqB,OAAoB;CACvD,MAAM,cAAcA,cAAAA,eAAe;CAEnC,QAAA,GAAA,IAAA,SAAA,OAAsB;EACpB,MAAM,SAAiC,CAAC;EAExC,MAAM,EAAE,OAAO,UAAU,SAAS,YAAY;EAC9C,MAAM,SAAS,YAAY;EAC3B,M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ACzB,OAAO,IAAI,eACX,IAAI,mBACN;KACA,OAAO,oBAAoB,OAAO,IAAI;IACxC;IAEF;GACF,KAAK;IACH,IAAI,OACF,IAAI,cAAc,SAAS,KAAK,GAC9B,OAAO,oBAAoB,iBAAiB,MAAM;SAGlD,OAAO,oBADQD,eAAAA,oBAAoB,KACH,CAAC,CAAC,IAAI;IAG1C;GACF,KAAK;IACH,IAAI,OACF,IAAI,cAAc,SAAS,KAAK,GAC9B,OAAO,oBAAoB,iBAAiB,MAAM;SAGlD,OAAO,oBADQA,eAAAA,oBAAoB,KACH,CAAC,CAAC,IAAI;IAG1C;GACF,KAAK;IACH,MAAM,OAAO,UAAU,QAAQ;IAC/B,MAAM,KAAK,UAAU,MAAM;IAC3B,MAAM,MAAM,UAAU,OAAO;IAE7B,IAAI,YAAoB;IACxB,IAAI,UAAkB;IACtB,IAAI,cAAc,SAAS,IAAI,GAC7B,YAAY,iBAAiB,KAAK;IAEpC,IAAI,cAAc,SAAS,EAAE,GAC3B,UAAU,iBAAiB,GAAG;IAGhC,OAAO,iBACL,mBAAmB,IAAI,OAAO,UAAU,OAAO,QAAQ;IACzD;GACF,SACE;EACJ;EAEA,OAAO;CACT,CAAC;AACH"}
@@ -1,7 +1,7 @@
1
- const require_index = require("../../../../node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/index2.js");
2
- const require_index$1 = require("../../../hooks/use-namespace/index.js");
1
+ const require_index = require("../../../hooks/use-namespace/index.js");
3
2
  const require_use_button = require("./use-button.js");
4
3
  const require_button_custom = require("./button-custom.js");
4
+ let vue = require("vue");
5
5
  //#region ../../packages/components/button/src/button.vue?vue&type=script&setup=true&lang.ts
6
6
  const _hoisted_1 = {
7
7
  key: 0,
@@ -19,7 +19,7 @@ const _hoisted_4 = {
19
19
  key: 3,
20
20
  "data-position": "right"
21
21
  };
22
- var button_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, require_index.vue_exports.defineComponent)({
22
+ var button_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue.defineComponent)({
23
23
  name: "CButton",
24
24
  __name: "button",
25
25
  props: {
@@ -85,24 +85,24 @@ var button_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, requi
85
85
  }
86
86
  },
87
87
  setup(__props, { expose: __expose }) {
88
- const slots = (0, require_index.vue_exports.useSlots)();
89
- const hasLeftSlot = (0, require_index.vue_exports.computed)(() => !!slots["left-section"]);
90
- const hasRightSlot = (0, require_index.vue_exports.computed)(() => !!slots["right-section"]);
88
+ const slots = (0, vue.useSlots)();
89
+ const hasLeftSlot = (0, vue.computed)(() => !!slots["left-section"]);
90
+ const hasRightSlot = (0, vue.computed)(() => !!slots["right-section"]);
91
91
  const props = __props;
92
92
  const { _disabled, _props, _ref, handleClick } = require_use_button.useButton(props, {
93
93
  hasLeftSlot: hasLeftSlot.value,
94
94
  hasRightSlot: hasRightSlot.value
95
95
  });
96
96
  const buttonStyle = require_button_custom.useButtonCustomStyle(props);
97
- const ns = require_index$1.useNamespace("button");
98
- const buttonClass = (0, require_index.vue_exports.computed)(() => [
99
- require_index$1.useNamespace("focus").b("auto"),
100
- !_disabled.value && require_index$1.useNamespace("active").b(),
97
+ const ns = require_index.useNamespace("button");
98
+ const buttonClass = (0, vue.computed)(() => [
99
+ require_index.useNamespace("focus").b("auto"),
100
+ !_disabled.value && require_index.useNamespace("active").b(),
101
101
  ns.e("root"),
102
102
  ns.is("loading", props.loading)
103
103
  ]);
104
- const innerClass = (0, require_index.vue_exports.computed)(() => [ns.e("inner")]);
105
- const labelClass = (0, require_index.vue_exports.computed)(() => [ns.e("label")]);
104
+ const innerClass = (0, vue.computed)(() => [ns.e("inner")]);
105
+ const labelClass = (0, vue.computed)(() => [ns.e("label")]);
106
106
  __expose({
107
107
  /** @description if button is disabled */
108
108
  disabled: _disabled.value,
@@ -114,15 +114,15 @@ var button_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, requi
114
114
  variant: props.variant
115
115
  });
116
116
  return (_ctx, _cache) => {
117
- return (0, require_index.vue_exports.openBlock)(), (0, require_index.vue_exports.createBlock)((0, require_index.vue_exports.resolveDynamicComponent)(__props.tag), (0, require_index.vue_exports.mergeProps)((0, require_index.vue_exports.unref)(_props), {
117
+ return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.tag), (0, vue.mergeProps)((0, vue.unref)(_props), {
118
118
  class: buttonClass.value,
119
- style: (0, require_index.vue_exports.unref)(buttonStyle),
120
- onClick: (0, require_index.vue_exports.unref)(handleClick)
119
+ style: (0, vue.unref)(buttonStyle),
120
+ onClick: (0, vue.unref)(handleClick)
121
121
  }), {
122
- default: (0, require_index.vue_exports.withCtx)(() => [(0, require_index.vue_exports.createElementVNode)("span", { class: (0, require_index.vue_exports.normalizeClass)(innerClass.value) }, [
123
- _ctx.$slots["left-section"] ? ((0, require_index.vue_exports.openBlock)(), (0, require_index.vue_exports.createElementBlock)("span", _hoisted_1, [(0, require_index.vue_exports.renderSlot)(_ctx.$slots, "left-section")])) : __props.leftSection ? ((0, require_index.vue_exports.openBlock)(), (0, require_index.vue_exports.createElementBlock)("span", _hoisted_2, [((0, require_index.vue_exports.openBlock)(), (0, require_index.vue_exports.createBlock)((0, require_index.vue_exports.resolveDynamicComponent)(__props.leftSection)))])) : (0, require_index.vue_exports.createCommentVNode)("v-if", true),
124
- (0, require_index.vue_exports.createElementVNode)("span", { class: (0, require_index.vue_exports.normalizeClass)(labelClass.value) }, [(0, require_index.vue_exports.renderSlot)(_ctx.$slots, "default")], 2),
125
- _ctx.$slots["right-section"] ? ((0, require_index.vue_exports.openBlock)(), (0, require_index.vue_exports.createElementBlock)("span", _hoisted_3, [(0, require_index.vue_exports.renderSlot)(_ctx.$slots, "right-section")])) : __props.rightSection ? ((0, require_index.vue_exports.openBlock)(), (0, require_index.vue_exports.createElementBlock)("span", _hoisted_4, [((0, require_index.vue_exports.openBlock)(), (0, require_index.vue_exports.createBlock)((0, require_index.vue_exports.resolveDynamicComponent)(__props.rightSection)))])) : (0, require_index.vue_exports.createCommentVNode)("v-if", true)
122
+ default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(innerClass.value) }, [
123
+ _ctx.$slots["left-section"] ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_1, [(0, vue.renderSlot)(_ctx.$slots, "left-section")])) : __props.leftSection ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_2, [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.leftSection)))])) : (0, vue.createCommentVNode)("v-if", true),
124
+ (0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(labelClass.value) }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 2),
125
+ _ctx.$slots["right-section"] ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_3, [(0, vue.renderSlot)(_ctx.$slots, "right-section")])) : __props.rightSection ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_4, [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.rightSection)))])) : (0, vue.createCommentVNode)("v-if", true)
126
126
  ], 2)]),
127
127
  _: 3
128
128
  }, 16, [