cck-ui 0.0.1
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.
- package/LICENSE +13 -0
- package/README.md +3 -0
- package/dist/index.css +1 -0
- package/dist/index.full.js +2957 -0
- package/dist/index.full.min.js +21 -0
- package/dist/index.full.min.js.map +1 -0
- package/dist/index.full.min.mjs +21 -0
- package/dist/index.full.min.mjs.map +1 -0
- package/dist/index.full.mjs +2945 -0
- package/es/_virtual/_rolldown/runtime.mjs +27 -0
- package/es/component.d.ts +6 -0
- package/es/component.mjs +8 -0
- package/es/component.mjs.map +1 -0
- package/es/components/base/style/css.mjs +1 -0
- package/es/components/base/style/index.mjs +1 -0
- package/es/components/button/index.d.ts +8 -0
- package/es/components/button/src/button-custom.d.ts +6 -0
- package/es/components/button/src/button.types.d.ts +77 -0
- package/es/components/button/src/button.vue.d.ts +28 -0
- package/es/components/button/src/use-button.d.ts +14 -0
- package/es/components/button/style/css.mjs +2 -0
- package/es/components/form/index.d.ts +4 -0
- package/es/components/form/src/constants.d.ts +7 -0
- package/es/components/form/src/form.types.d.ts +10 -0
- package/es/components/form/src/hooks/index.d.ts +2 -0
- package/es/components/form/src/hooks/use-form-common-props.d.ts +7 -0
- package/es/components/icon/index.d.ts +26 -0
- package/es/components/icon/src/icon.types.d.ts +13 -0
- package/es/components/icon/src/icon.vue.d.ts +17 -0
- package/es/components/icon/style/css.mjs +1 -0
- package/es/components/icon/style/index.mjs +1 -0
- package/es/components/index.d.ts +5 -0
- package/es/constants/index.d.ts +3 -0
- package/es/constants/key.d.ts +4 -0
- package/es/constants/sizes.d.ts +12 -0
- package/es/defaults.d.ts +6 -0
- package/es/defaults.mjs +9 -0
- package/es/defaults.mjs.map +1 -0
- package/es/hooks/index.d.ts +4 -0
- package/es/hooks/use-namespace/index.d.ts +27 -0
- package/es/hooks/use-prop/index.d.ts +6 -0
- package/es/hooks/use-theme/index.d.ts +5 -0
- package/es/index.d.ts +11 -0
- package/es/index.mjs +11 -0
- package/es/index.mjs.map +1 -0
- package/es/make-installer.d.ts +8 -0
- package/es/make-installer.mjs +14 -0
- package/es/make-installer.mjs.map +1 -0
- package/es/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/conversion.mjs +268 -0
- package/es/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/conversion.mjs.map +1 -0
- package/es/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/css-color-names.mjs +158 -0
- package/es/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/css-color-names.mjs.map +1 -0
- package/es/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/format-input.mjs +192 -0
- package/es/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/format-input.mjs.map +1 -0
- package/es/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/index.mjs +456 -0
- package/es/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/index.mjs.map +1 -0
- package/es/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/util.mjs +65 -0
- package/es/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/module/util.mjs.map +1 -0
- package/es/node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/predicate/isPlainObject.mjs +53 -0
- package/es/node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/predicate/isPlainObject.mjs.map +1 -0
- package/es/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.runtime.esm-bundler.mjs +22 -0
- package/es/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.runtime.esm-bundler.mjs.map +1 -0
- package/es/packages/components/button/index.mjs +8 -0
- package/es/packages/components/button/index.mjs.map +1 -0
- package/es/packages/components/button/src/button-custom.mjs +121 -0
- package/es/packages/components/button/src/button-custom.mjs.map +1 -0
- package/es/packages/components/button/src/button.mjs +7 -0
- package/es/packages/components/button/src/button.mjs.map +1 -0
- package/es/packages/components/button/src/button.types.mjs +0 -0
- package/es/packages/components/button/src/button.vue_vue_type_script_setup_true_lang.mjs +139 -0
- package/es/packages/components/button/src/button.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/es/packages/components/button/src/use-button.mjs +41 -0
- package/es/packages/components/button/src/use-button.mjs.map +1 -0
- package/es/packages/components/form/index.mjs +3 -0
- package/es/packages/components/form/src/constants.mjs +6 -0
- package/es/packages/components/form/src/constants.mjs.map +1 -0
- package/es/packages/components/form/src/form.types.mjs +0 -0
- package/es/packages/components/form/src/hooks/index.mjs +2 -0
- package/es/packages/components/form/src/hooks/use-form-common-props.mjs +16 -0
- package/es/packages/components/form/src/hooks/use-form-common-props.mjs.map +1 -0
- package/es/packages/components/icon/index.mjs +8 -0
- package/es/packages/components/icon/index.mjs.map +1 -0
- package/es/packages/components/icon/src/icon.mjs +7 -0
- package/es/packages/components/icon/src/icon.mjs.map +1 -0
- package/es/packages/components/icon/src/icon.types.mjs +0 -0
- package/es/packages/components/icon/src/icon.vue_vue_type_script_setup_true_lang.mjs +42 -0
- package/es/packages/components/icon/src/icon.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/es/packages/components/index.mjs +3 -0
- package/es/packages/constants/index.mjs +3 -0
- package/es/packages/constants/key.mjs +6 -0
- package/es/packages/constants/key.mjs.map +1 -0
- package/es/packages/constants/sizes.mjs +24 -0
- package/es/packages/constants/sizes.mjs.map +1 -0
- package/es/packages/hooks/index.mjs +4 -0
- package/es/packages/hooks/use-namespace/index.mjs +63 -0
- package/es/packages/hooks/use-namespace/index.mjs.map +1 -0
- package/es/packages/hooks/use-prop/index.mjs +10 -0
- package/es/packages/hooks/use-prop/index.mjs.map +1 -0
- package/es/packages/hooks/use-theme/index.mjs +19 -0
- package/es/packages/hooks/use-theme/index.mjs.map +1 -0
- package/es/packages/utils/colors.mjs +109 -0
- package/es/packages/utils/colors.mjs.map +1 -0
- package/es/packages/utils/dom/index.mjs +2 -0
- package/es/packages/utils/dom/style.mjs +11 -0
- package/es/packages/utils/dom/style.mjs.map +1 -0
- package/es/packages/utils/index.mjs +5 -0
- package/es/packages/utils/types.mjs +12 -0
- package/es/packages/utils/types.mjs.map +1 -0
- package/es/packages/utils/vue/index.mjs +2 -0
- package/es/packages/utils/vue/install.mjs +38 -0
- package/es/packages/utils/vue/install.mjs.map +1 -0
- package/es/packages/utils/vue/typescript.mjs +0 -0
- package/es/plugin.d.ts +6 -0
- package/es/plugin.mjs +6 -0
- package/es/plugin.mjs.map +1 -0
- package/es/utils/colors.d.ts +14 -0
- package/es/utils/dom/index.d.ts +2 -0
- package/es/utils/dom/style.d.ts +4 -0
- package/es/utils/index.d.ts +6 -0
- package/es/utils/types.d.ts +8 -0
- package/es/utils/vue/index.d.ts +3 -0
- package/es/utils/vue/install.d.ts +7 -0
- package/es/utils/vue/typescript.d.ts +19 -0
- package/global.d.ts +8 -0
- package/lib/_virtual/_rolldown/runtime.js +37 -0
- package/lib/component.d.ts +6 -0
- package/lib/component.js +12 -0
- package/lib/component.js.map +1 -0
- package/lib/components/base/style/css.js +2 -0
- package/lib/components/base/style/index.js +2 -0
- package/lib/components/button/index.d.ts +8 -0
- package/lib/components/button/src/button-custom.d.ts +6 -0
- package/lib/components/button/src/button.types.d.ts +77 -0
- package/lib/components/button/src/button.vue.d.ts +28 -0
- package/lib/components/button/src/use-button.d.ts +14 -0
- package/lib/components/button/style/css.js +3 -0
- package/lib/components/form/index.d.ts +4 -0
- package/lib/components/form/src/constants.d.ts +7 -0
- package/lib/components/form/src/form.types.d.ts +10 -0
- package/lib/components/form/src/hooks/index.d.ts +2 -0
- package/lib/components/form/src/hooks/use-form-common-props.d.ts +7 -0
- package/lib/components/icon/index.d.ts +26 -0
- package/lib/components/icon/src/icon.types.d.ts +13 -0
- package/lib/components/icon/src/icon.vue.d.ts +17 -0
- package/lib/components/icon/style/css.js +2 -0
- package/lib/components/icon/style/index.js +2 -0
- package/lib/components/index.d.ts +5 -0
- package/lib/constants/index.d.ts +3 -0
- package/lib/constants/key.d.ts +4 -0
- package/lib/constants/sizes.d.ts +12 -0
- package/lib/defaults.d.ts +6 -0
- package/lib/defaults.js +13 -0
- package/lib/defaults.js.map +1 -0
- package/lib/hooks/index.d.ts +4 -0
- package/lib/hooks/use-namespace/index.d.ts +27 -0
- package/lib/hooks/use-prop/index.d.ts +6 -0
- package/lib/hooks/use-theme/index.d.ts +5 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.js +19 -0
- package/lib/index.js.map +1 -0
- package/lib/make-installer.d.ts +8 -0
- package/lib/make-installer.js +15 -0
- package/lib/make-installer.js.map +1 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/conversion.js +309 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/conversion.js.map +1 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/css-color-names.js +168 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/css-color-names.js.map +1 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/format-input.js +209 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/format-input.js.map +1 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/from-ratio.js +43 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/from-ratio.js.map +1 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/index.js +471 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/index.js.map +1 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/interfaces.js +14 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/interfaces.js.map +1 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/public_api.js +50 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/public_api.js.map +1 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/random.js +255 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/random.js.map +1 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/readability.js +96 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/readability.js.map +1 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/to-ms-filter.js +35 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/to-ms-filter.js.map +1 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/util.js +82 -0
- package/lib/node_modules/.pnpm/@ctrl_tinycolor@4.2.0/node_modules/@ctrl/tinycolor/dist/util.js.map +1 -0
- package/lib/node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/predicate/isPlainObject.js +53 -0
- package/lib/node_modules/.pnpm/es-toolkit@1.47.0/node_modules/es-toolkit/dist/predicate/isPlainObject.js.map +1 -0
- package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.cjs.js +66 -0
- package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.cjs.js.map +1 -0
- package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.cjs.prod.js +56 -0
- package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.cjs.prod.js.map +1 -0
- package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/index.js +18 -0
- package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/index.js.map +1 -0
- package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/index2.js +14 -0
- package/lib/node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/index2.js.map +1 -0
- package/lib/packages/components/button/index.js +13 -0
- package/lib/packages/components/button/index.js.map +1 -0
- package/lib/packages/components/button/src/button-custom.js +122 -0
- package/lib/packages/components/button/src/button-custom.js.map +1 -0
- package/lib/packages/components/button/src/button.js +10 -0
- package/lib/packages/components/button/src/button.js.map +1 -0
- package/lib/packages/components/button/src/button.types.js +1 -0
- package/lib/packages/components/button/src/button.vue_vue_type_script_setup_true_lang.js +139 -0
- package/lib/packages/components/button/src/button.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/lib/packages/components/button/src/use-button.js +42 -0
- package/lib/packages/components/button/src/use-button.js.map +1 -0
- package/lib/packages/components/form/index.js +6 -0
- package/lib/packages/components/form/src/constants.js +7 -0
- package/lib/packages/components/form/src/constants.js.map +1 -0
- package/lib/packages/components/form/src/form.types.js +1 -0
- package/lib/packages/components/form/src/hooks/index.js +4 -0
- package/lib/packages/components/form/src/hooks/use-form-common-props.js +18 -0
- package/lib/packages/components/form/src/hooks/use-form-common-props.js.map +1 -0
- package/lib/packages/components/icon/index.js +13 -0
- package/lib/packages/components/icon/index.js.map +1 -0
- package/lib/packages/components/icon/src/icon.js +10 -0
- package/lib/packages/components/icon/src/icon.js.map +1 -0
- package/lib/packages/components/icon/src/icon.types.js +1 -0
- package/lib/packages/components/icon/src/icon.vue_vue_type_script_setup_true_lang.js +42 -0
- package/lib/packages/components/icon/src/icon.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/lib/packages/components/index.js +5 -0
- package/lib/packages/constants/index.js +6 -0
- package/lib/packages/constants/key.js +7 -0
- package/lib/packages/constants/key.js.map +1 -0
- package/lib/packages/constants/sizes.js +26 -0
- package/lib/packages/constants/sizes.js.map +1 -0
- package/lib/packages/hooks/index.js +10 -0
- package/lib/packages/hooks/use-namespace/index.js +67 -0
- package/lib/packages/hooks/use-namespace/index.js.map +1 -0
- package/lib/packages/hooks/use-prop/index.js +11 -0
- package/lib/packages/hooks/use-prop/index.js.map +1 -0
- package/lib/packages/hooks/use-theme/index.js +20 -0
- package/lib/packages/hooks/use-theme/index.js.map +1 -0
- package/lib/packages/utils/colors.js +112 -0
- package/lib/packages/utils/colors.js.map +1 -0
- package/lib/packages/utils/dom/index.js +3 -0
- package/lib/packages/utils/dom/style.js +13 -0
- package/lib/packages/utils/dom/style.js.map +1 -0
- package/lib/packages/utils/index.js +21 -0
- package/lib/packages/utils/types.js +21 -0
- package/lib/packages/utils/types.js.map +1 -0
- package/lib/packages/utils/vue/index.js +4 -0
- package/lib/packages/utils/vue/install.js +40 -0
- package/lib/packages/utils/vue/install.js.map +1 -0
- package/lib/packages/utils/vue/typescript.js +1 -0
- package/lib/plugin.d.ts +6 -0
- package/lib/plugin.js +10 -0
- package/lib/plugin.js.map +1 -0
- package/lib/utils/colors.d.ts +14 -0
- package/lib/utils/dom/index.d.ts +2 -0
- package/lib/utils/dom/style.d.ts +4 -0
- package/lib/utils/index.d.ts +6 -0
- package/lib/utils/types.d.ts +8 -0
- package/lib/utils/vue/index.d.ts +3 -0
- package/lib/utils/vue/install.d.ts +7 -0
- package/lib/utils/vue/typescript.d.ts +19 -0
- package/package.json +69 -0
- package/theme-slate/base.css +1 -0
- package/theme-slate/cu-button.css +1 -0
- package/theme-slate/cu-common.css +1 -0
- package/theme-slate/cu-icon.css +1 -0
- package/theme-slate/cu-var.css +1 -0
- package/theme-slate/dark/css-vars.css +0 -0
- package/theme-slate/index.css +1 -0
- package/theme-slate/src/base.scss +2 -0
- package/theme-slate/src/button.scss +317 -0
- package/theme-slate/src/common/var.scss +179 -0
- package/theme-slate/src/common.scss +9 -0
- package/theme-slate/src/dark/css-vars.scss +0 -0
- package/theme-slate/src/icon.scss +43 -0
- package/theme-slate/src/index.scss +4 -0
- package/theme-slate/src/mixins/_var.scss +9 -0
- package/theme-slate/src/mixins/config.scss +5 -0
- package/theme-slate/src/mixins/function.scss +11 -0
- package/theme-slate/src/mixins/mixins.scss +19 -0
- package/theme-slate/src/var.scss +297 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { __exportAll, __reExport } from "../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
export * from "@vue/runtime-dom";
|
|
3
|
+
//#region ../../node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.runtime.esm-bundler.js
|
|
4
|
+
/**
|
|
5
|
+
* vue v3.5.35
|
|
6
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
7
|
+
* @license MIT
|
|
8
|
+
**/
|
|
9
|
+
var vue_runtime_esm_bundler_exports = /* @__PURE__ */ __exportAll({ compile: () => compile });
|
|
10
|
+
import * as import__vue_runtime_dom from "@vue/runtime-dom";
|
|
11
|
+
__reExport(vue_runtime_esm_bundler_exports, import__vue_runtime_dom);
|
|
12
|
+
function initDev() {
|
|
13
|
+
initCustomFormatter();
|
|
14
|
+
}
|
|
15
|
+
initDev();
|
|
16
|
+
const compile = () => {
|
|
17
|
+
warn("Runtime compilation is not supported in this build of Vue. Configure your bundler to alias \"vue\" to \"vue/dist/vue.esm-bundler.js\".");
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { vue_runtime_esm_bundler_exports };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=vue.runtime.esm-bundler.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue.runtime.esm-bundler.mjs","names":[],"sources":["../../../../../../../../../node_modules/.pnpm/vue@3.5.35_typescript@6.0.3/node_modules/vue/dist/vue.runtime.esm-bundler.js"],"sourcesContent":["/**\n* vue v3.5.35\n* (c) 2018-present Yuxi (Evan) You and Vue contributors\n* @license MIT\n**/\nimport { initCustomFormatter, warn } from '@vue/runtime-dom';\nexport * from '@vue/runtime-dom';\n\nfunction initDev() {\n {\n initCustomFormatter();\n }\n}\n\nif (!!(process.env.NODE_ENV !== \"production\")) {\n initDev();\n}\nconst compile = () => {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n warn(\n `Runtime compilation is not supported in this build of Vue.` + (` Configure your bundler to alias \"vue\" to \"vue/dist/vue.esm-bundler.js\".` )\n );\n }\n};\n\nexport { compile };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;AAQA,SAAS,UAAU;CAEf,oBAAoB;AAExB;AAGE,QAAQ;AAEV,MAAM,gBAAgB;CAElB,KACE,wIACF;AAEJ"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { withInstall } from "../../utils/vue/install.mjs";
|
|
2
|
+
import button_default from "./src/button.mjs";
|
|
3
|
+
//#region ../../packages/components/button/index.ts
|
|
4
|
+
const CButton = withInstall(button_default);
|
|
5
|
+
//#endregion
|
|
6
|
+
export { CButton, CButton as default };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["Button"],"sources":["../../../../../../packages/components/button/index.ts"],"sourcesContent":["import { type SFCWithInstall, withInstall } from '@cck-ui/utils'\nimport Button from './src/button.vue'\n\nexport const CButton: SFCWithInstall<typeof Button> = withInstall(Button)\nexport default CButton\n\nexport * from './src/button.types'\n"],"mappings":";;;AAGA,MAAa,UAAyC,YAAYA,cAAM"}
|
|
@@ -0,0 +1,121 @@
|
|
|
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
|
+
import { useColorScheme } from "../../../hooks/use-theme/index.mjs";
|
|
4
|
+
//#region ../../packages/components/button/src/button-custom.ts
|
|
5
|
+
const PRESET_COLORS = [
|
|
6
|
+
"red",
|
|
7
|
+
"pink",
|
|
8
|
+
"grape",
|
|
9
|
+
"violet",
|
|
10
|
+
"indigo",
|
|
11
|
+
"blue",
|
|
12
|
+
"cyan",
|
|
13
|
+
"teal",
|
|
14
|
+
"green",
|
|
15
|
+
"lime",
|
|
16
|
+
"yellow",
|
|
17
|
+
"orange",
|
|
18
|
+
"gray",
|
|
19
|
+
"dark"
|
|
20
|
+
];
|
|
21
|
+
const getShadeIndexes = (scheme) => {
|
|
22
|
+
if (scheme === "light") return {
|
|
23
|
+
bg: 6,
|
|
24
|
+
hover: 7,
|
|
25
|
+
lightBg: 1,
|
|
26
|
+
lightHover: 2,
|
|
27
|
+
lightColor: 9,
|
|
28
|
+
outlineColor: 6,
|
|
29
|
+
outlineHoverBgAlpha: .05
|
|
30
|
+
};
|
|
31
|
+
else return {
|
|
32
|
+
bg: 8,
|
|
33
|
+
hover: 9,
|
|
34
|
+
lightBg: 1,
|
|
35
|
+
lightHover: 2,
|
|
36
|
+
lightColor: 9,
|
|
37
|
+
outlineColor: 4,
|
|
38
|
+
outlineHoverBgAlpha: .05
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
function useButtonCustomStyle(props) {
|
|
42
|
+
const colorScheme = useColorScheme();
|
|
43
|
+
return (0, vue_runtime_esm_bundler_exports.computed)(() => {
|
|
44
|
+
const styles = {};
|
|
45
|
+
const { color, gradient, justify, variant } = props;
|
|
46
|
+
const scheme = colorScheme.value;
|
|
47
|
+
const idx = getShadeIndexes(scheme);
|
|
48
|
+
if (justify) styles["--button-justify"] = justify;
|
|
49
|
+
switch (variant) {
|
|
50
|
+
case "default": break;
|
|
51
|
+
case "filled":
|
|
52
|
+
if (color) if (PRESET_COLORS.includes(color)) {
|
|
53
|
+
styles["--button-bg"] = `var(--c-color-${color}-filled)`;
|
|
54
|
+
styles["--button-hover"] = `var(--c-color-${color}-filled-hover)`;
|
|
55
|
+
} else {
|
|
56
|
+
const shades = generateColorShades(color);
|
|
57
|
+
styles["--button-bg"] = shades[idx.bg];
|
|
58
|
+
styles["--button-hover"] = shades[idx.hover];
|
|
59
|
+
}
|
|
60
|
+
break;
|
|
61
|
+
case "light":
|
|
62
|
+
if (color) if (PRESET_COLORS.includes(color)) {
|
|
63
|
+
styles["--button-bg"] = `var(--c-color-${color}-light)`;
|
|
64
|
+
styles["--button-hover"] = `var(--c-color-${color}-light-hover)`;
|
|
65
|
+
styles["--button-color"] = `var(--c-color-${color}-light-color)`;
|
|
66
|
+
} else {
|
|
67
|
+
const shades = generateColorShades(color);
|
|
68
|
+
styles["--button-bg"] = shades[idx.lightBg];
|
|
69
|
+
styles["--button-hover"] = shades[idx.lightHover];
|
|
70
|
+
styles["--button-color"] = shades[idx.lightColor];
|
|
71
|
+
}
|
|
72
|
+
break;
|
|
73
|
+
case "outline":
|
|
74
|
+
if (color) if (PRESET_COLORS.includes(color)) {
|
|
75
|
+
styles["--button-hover"] = `var(--c-color-${color}-outline-hover)`;
|
|
76
|
+
styles["--button-color"] = `var(--c-color-${color}-outline)`;
|
|
77
|
+
styles["--button-bd"] = `calc(0.0625rem * var(--c-scale)) solid var(--c-color-${color}-outline)`;
|
|
78
|
+
} else {
|
|
79
|
+
const shades = generateColorShades(color);
|
|
80
|
+
styles["--button-hover"] = setColorAlpha(shades[idx.outlineColor], idx.outlineHoverBgAlpha);
|
|
81
|
+
styles["--button-color"] = shades[idx.outlineColor];
|
|
82
|
+
styles["--button-bd"] = `calc(0.0625rem * var(--c-scale)) solid ${shades[idx.outlineColor]}`;
|
|
83
|
+
}
|
|
84
|
+
break;
|
|
85
|
+
case "subtle":
|
|
86
|
+
if (color) if (PRESET_COLORS.includes(color)) {
|
|
87
|
+
styles["--button-hover"] = `var(--c-color-${color}-outline-hover)`;
|
|
88
|
+
styles["--button-color"] = `var(--c-color-${color}-outline)`;
|
|
89
|
+
} else {
|
|
90
|
+
const shades = generateColorShades(color);
|
|
91
|
+
styles["--button-hover"] = setColorAlpha(shades[idx.outlineColor], idx.outlineHoverBgAlpha);
|
|
92
|
+
styles["--button-color"] = shades[idx.outlineColor];
|
|
93
|
+
}
|
|
94
|
+
break;
|
|
95
|
+
case "transparent":
|
|
96
|
+
if (color) if (PRESET_COLORS.includes(color)) styles["--button-color"] = `var(--c-color-${color}-light-color)`;
|
|
97
|
+
else styles["--button-color"] = generateColorShades(color)[idx.lightColor];
|
|
98
|
+
break;
|
|
99
|
+
case "white":
|
|
100
|
+
if (color) if (PRESET_COLORS.includes(color)) styles["--button-color"] = `var(--c-color-${color}-filled)`;
|
|
101
|
+
else styles["--button-color"] = generateColorShades(color)[idx.bg];
|
|
102
|
+
break;
|
|
103
|
+
case "gradient":
|
|
104
|
+
const from = gradient?.from || "blue";
|
|
105
|
+
const to = gradient?.to || "cyan";
|
|
106
|
+
const deg = gradient?.deg || "45";
|
|
107
|
+
let finalFrom = from;
|
|
108
|
+
let finalTo = to;
|
|
109
|
+
if (PRESET_COLORS.includes(from)) finalFrom = `var(--c-color-${from}-filled)`;
|
|
110
|
+
if (PRESET_COLORS.includes(to)) finalTo = `var(--c-color-${to}-filled)`;
|
|
111
|
+
styles["--button-bg"] = `linear-gradient(${deg}deg, ${finalFrom} 0%, ${finalTo} 100%)`;
|
|
112
|
+
break;
|
|
113
|
+
default: break;
|
|
114
|
+
}
|
|
115
|
+
return styles;
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
//#endregion
|
|
119
|
+
export { useButtonCustomStyle };
|
|
120
|
+
|
|
121
|
+
//# sourceMappingURL=button-custom.mjs.map
|
|
@@ -0,0 +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;GACF,KAAK;IACH,IAAI,OACF,IAAI,cAAc,SAAS,KAAK,GAAG;KACjC,OAAO,iBAAiB,iBAAiB,MAAM;KAC/C,OAAO,oBAAoB,iBAAiB,MAAM;IACpD,OAAO;KACL,MAAM,SAAS,oBAAoB,KAAK;KACxC,OAAO,iBAAiB,OAAO,IAAI;KACnC,OAAO,oBAAoB,OAAO,IAAI;IACxC;IAEF;GACF,KAAK;IACH,IAAI,OACF,IAAI,cAAc,SAAS,KAAK,GAAG;KACjC,OAAO,iBAAiB,iBAAiB,MAAM;KAC/C,OAAO,oBAAoB,iBAAiB,MAAM;KAClD,OAAO,oBAAoB,iBAAiB,MAAM;IACpD,OAAO;KACL,MAAM,SAAS,oBAAoB,KAAK;KACxC,OAAO,iBAAiB,OAAO,IAAI;KACnC,OAAO,oBAAoB,OAAO,IAAI;KACtC,OAAO,oBAAoB,OAAO,IAAI;IACxC;IAEF;GACF,KAAK;IACH,IAAI,OACF,IAAI,cAAc,SAAS,KAAK,GAAG;KACjC,OAAO,oBAAoB,iBAAiB,MAAM;KAClD,OAAO,oBAAoB,iBAAiB,MAAM;KAClD,OAAO,iBACL,wDAAwD,MAAM;IAClE,OAAO;KACL,MAAM,SAAS,oBAAoB,KAAK;KACxC,OAAO,oBAAoB,cACzB,OAAO,IAAI,eACX,IAAI,mBACN;KACA,OAAO,oBAAoB,OAAO,IAAI;KACtC,OAAO,iBACL,0CAA0C,OAAO,IAAI;IACzD;IAEF;GACF,KAAK;IACH,IAAI,OACF,IAAI,cAAc,SAAS,KAAK,GAAG;KACjC,OAAO,oBAAoB,iBAAiB,MAAM;KAClD,OAAO,oBAAoB,iBAAiB,MAAM;IACpD,OAAO;KACL,MAAM,SAAS,oBAAoB,KAAK;KACxC,OAAO,oBAAoB,cACzB,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,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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import button_vue_vue_type_script_setup_true_lang_default from "./button.vue_vue_type_script_setup_true_lang.mjs";
|
|
2
|
+
//#region ../../packages/components/button/src/button.vue
|
|
3
|
+
var button_default = button_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { button_default as default };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=button.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.mjs","names":[],"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":""}
|
|
File without changes
|
|
@@ -0,0 +1,139 @@
|
|
|
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
|
+
import { useNamespace } from "../../../hooks/use-namespace/index.mjs";
|
|
3
|
+
import { useButton } from "./use-button.mjs";
|
|
4
|
+
import { useButtonCustomStyle } from "./button-custom.mjs";
|
|
5
|
+
//#region ../../packages/components/button/src/button.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
const _hoisted_1 = {
|
|
7
|
+
key: 0,
|
|
8
|
+
"data-position": "left"
|
|
9
|
+
};
|
|
10
|
+
const _hoisted_2 = {
|
|
11
|
+
key: 1,
|
|
12
|
+
"data-position": "left"
|
|
13
|
+
};
|
|
14
|
+
const _hoisted_3 = {
|
|
15
|
+
key: 2,
|
|
16
|
+
"data-position": "right"
|
|
17
|
+
};
|
|
18
|
+
const _hoisted_4 = {
|
|
19
|
+
key: 3,
|
|
20
|
+
"data-position": "right"
|
|
21
|
+
};
|
|
22
|
+
var button_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ (0, vue_runtime_esm_bundler_exports.defineComponent)({
|
|
23
|
+
name: "CButton",
|
|
24
|
+
__name: "button",
|
|
25
|
+
props: {
|
|
26
|
+
autoContrast: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
required: false
|
|
29
|
+
},
|
|
30
|
+
color: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: false
|
|
33
|
+
},
|
|
34
|
+
disabled: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
required: false
|
|
37
|
+
},
|
|
38
|
+
fullWidth: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
required: false
|
|
41
|
+
},
|
|
42
|
+
gradient: {
|
|
43
|
+
type: Object,
|
|
44
|
+
required: false
|
|
45
|
+
},
|
|
46
|
+
justify: {
|
|
47
|
+
type: void 0,
|
|
48
|
+
required: false
|
|
49
|
+
},
|
|
50
|
+
leftSection: {
|
|
51
|
+
type: null,
|
|
52
|
+
required: false
|
|
53
|
+
},
|
|
54
|
+
loaderProps: {
|
|
55
|
+
type: Object,
|
|
56
|
+
required: false
|
|
57
|
+
},
|
|
58
|
+
loading: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
required: false
|
|
61
|
+
},
|
|
62
|
+
radius: {
|
|
63
|
+
type: String,
|
|
64
|
+
required: false,
|
|
65
|
+
default: "4px"
|
|
66
|
+
},
|
|
67
|
+
rightSection: {
|
|
68
|
+
type: null,
|
|
69
|
+
required: false
|
|
70
|
+
},
|
|
71
|
+
size: {
|
|
72
|
+
type: null,
|
|
73
|
+
required: false,
|
|
74
|
+
default: "sm"
|
|
75
|
+
},
|
|
76
|
+
tag: {
|
|
77
|
+
type: null,
|
|
78
|
+
required: false,
|
|
79
|
+
default: "button"
|
|
80
|
+
},
|
|
81
|
+
variant: {
|
|
82
|
+
type: String,
|
|
83
|
+
required: false,
|
|
84
|
+
default: "default"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
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"]);
|
|
91
|
+
const props = __props;
|
|
92
|
+
const { _disabled, _props, _ref, handleClick } = useButton(props, {
|
|
93
|
+
hasLeftSlot: hasLeftSlot.value,
|
|
94
|
+
hasRightSlot: hasRightSlot.value
|
|
95
|
+
});
|
|
96
|
+
const buttonStyle = useButtonCustomStyle(props);
|
|
97
|
+
const ns = useNamespace("button");
|
|
98
|
+
const buttonClass = (0, vue_runtime_esm_bundler_exports.computed)(() => [
|
|
99
|
+
useNamespace("focus").b("auto"),
|
|
100
|
+
!_disabled.value && useNamespace("active").b(),
|
|
101
|
+
ns.e("root"),
|
|
102
|
+
ns.is("loading", props.loading)
|
|
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")]);
|
|
106
|
+
__expose({
|
|
107
|
+
/** @description if button is disabled */
|
|
108
|
+
disabled: _disabled.value,
|
|
109
|
+
/** @description button html element */
|
|
110
|
+
ref: _ref,
|
|
111
|
+
/** @description button size */
|
|
112
|
+
size: props.size,
|
|
113
|
+
/** @description button variant */
|
|
114
|
+
variant: props.variant
|
|
115
|
+
});
|
|
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), {
|
|
118
|
+
class: buttonClass.value,
|
|
119
|
+
style: (0, vue_runtime_esm_bundler_exports.unref)(buttonStyle),
|
|
120
|
+
onClick: (0, vue_runtime_esm_bundler_exports.unref)(handleClick)
|
|
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)
|
|
126
|
+
], 2)]),
|
|
127
|
+
_: 3
|
|
128
|
+
}, 16, [
|
|
129
|
+
"class",
|
|
130
|
+
"style",
|
|
131
|
+
"onClick"
|
|
132
|
+
]);
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
//#endregion
|
|
137
|
+
export { button_vue_vue_type_script_setup_true_lang_default as default };
|
|
138
|
+
|
|
139
|
+
//# sourceMappingURL=button.vue_vue_type_script_setup_true_lang.mjs.map
|
|
@@ -0,0 +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,MAAM,cAAc,qBAAqB,KAAK;EAC9C,MAAM,KAAK,aAAa,QAAQ;EAChC,MAAM,eAAA,GAAA,gCAAA,SAAA,OAA6B;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,cAAA,GAAA,gCAAA,SAAA,OAA4B,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;EACjD,MAAM,cAAA,GAAA,gCAAA,SAAA,OAA4B,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;EAEjD,SAAa;;GAEX,UAAU,UAAU;;GAEpB,KAAK;;GAEL,MAAM,MAAM;;GAEZ,SAAS,MAAM;EACjB,CAAC;;0KC9EQ,QAAA,GAAG,IAAA,GAAA,gCAAA,WAAA,EAAA,GAAA,gCAAA,MAAA,CAqBE,MAAA,GAvBI;IACb,OAAO,YAAA;IAEP,QAAA,GAAA,gCAAA,MAAA,CAAO,WAAA;IACP,UAAA,GAAA,gCAAA,MAAA,CAAO,WAAA;;gEAkBD,EAAA,GAAA,gCAAA,mBAAA,CAAA,QAAA,EAhBA,QAAA,GAAA,gCAAA,eAAA,CAAO,WAAA,KAAU,EAAA,GAAA;KACWA,KAAAA,OAAM,oBAAA,GAAA,gCAAA,UAAA,CAAA,IAAA,GAAA,gCAAA,mBAAA,CAEhC,QAFP,YAEO,EAAA,GAAA,gCAAA,WAAA,CAD4B,KAAA,QAAA,cAAA,CAAA,CAAA,KAEG,QAAA,gBAAA,GAAA,gCAAA,UAAA,CAAA,IAAA,GAAA,gCAAA,mBAAA,CAE/B,QAFP,YAEO,GAAA,GAAA,gCAAA,UAAA,CAAA,IAAA,GAAA,gCAAA,YAAA,EAAA,GAAA,gCAAA,wBAAA,CADW,QAAA,WAAW,CAAA,EAAA,CAAA,MAAA,GAAA,gCAAA,mBAAA,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"}
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
import { useFormDisabled } from "../../form/src/hooks/use-form-common-props.mjs";
|
|
3
|
+
//#region ../../packages/components/button/src/use-button.ts
|
|
4
|
+
const useButton = (props, slots) => {
|
|
5
|
+
const _disabled = useFormDisabled();
|
|
6
|
+
const _ref = (0, vue_runtime_esm_bundler_exports.ref)();
|
|
7
|
+
const { hasLeftSlot, hasRightSlot } = slots;
|
|
8
|
+
const hasLeftSection = hasLeftSlot || !!props.leftSection;
|
|
9
|
+
const hasRightSection = hasRightSlot || !!props.rightSection;
|
|
10
|
+
const _props = (0, vue_runtime_esm_bundler_exports.computed)(() => {
|
|
11
|
+
const _attrs = {
|
|
12
|
+
"data-disabled": _disabled.value || props.loading || void 0,
|
|
13
|
+
"data-block": props.fullWidth || void 0,
|
|
14
|
+
"data-size": props.size && props.size !== "sm" ? props.size : void 0,
|
|
15
|
+
"data-with-left-section": hasLeftSection || void 0,
|
|
16
|
+
"data-with-right-section": hasRightSection || void 0,
|
|
17
|
+
"data-variant": props.variant || "default"
|
|
18
|
+
};
|
|
19
|
+
if (props.tag === "button") {
|
|
20
|
+
_attrs["aria-disabled"] = _disabled.value || props.loading || void 0;
|
|
21
|
+
_attrs["disabled"] = _disabled.value || props.loading;
|
|
22
|
+
}
|
|
23
|
+
return _attrs;
|
|
24
|
+
});
|
|
25
|
+
const handleClick = (evt) => {
|
|
26
|
+
if (_disabled.value || props.loading) {
|
|
27
|
+
evt.stopPropagation();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
return {
|
|
32
|
+
_disabled,
|
|
33
|
+
_ref,
|
|
34
|
+
_props,
|
|
35
|
+
handleClick
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { useButton };
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=use-button.mjs.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.mjs","names":[],"sources":["../../../../../../../packages/components/form/src/constants.ts"],"sourcesContent":["import { InjectionKey } from 'vue'\nimport { FormContext } from './form.types'\n\nexport const formContextKey: InjectionKey<FormContext> =\n Symbol('formContextKey')\n"],"mappings":";AAGA,MAAa,iBACX,OAAO,gBAAgB"}
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
import { useProp } from "../../../../hooks/use-prop/index.mjs";
|
|
3
|
+
import { formContextKey } from "../constants.mjs";
|
|
4
|
+
//#region ../../packages/components/form/src/hooks/use-form-common-props.ts
|
|
5
|
+
const useFormDisabled = (fallback) => {
|
|
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;
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
const useDisabled = useFormDisabled;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { useDisabled, useFormDisabled };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=use-form-common-props.mjs.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { withInstall } from "../../utils/vue/install.mjs";
|
|
2
|
+
import icon_default from "./src/icon.mjs";
|
|
3
|
+
//#region ../../packages/components/icon/index.ts
|
|
4
|
+
const CIcon = withInstall(icon_default);
|
|
5
|
+
//#endregion
|
|
6
|
+
export { CIcon, CIcon as default };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["Icon"],"sources":["../../../../../../packages/components/icon/index.ts"],"sourcesContent":["import { withInstall } from '@cck-ui/utils'\nimport Icon from './src/icon.vue'\n\nexport const CIcon = withInstall(Icon)\nexport default CIcon\nexport * from './src/icon.types'\n"],"mappings":";;;AAGA,MAAa,QAAQ,YAAYA,YAAI"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import icon_vue_vue_type_script_setup_true_lang_default from "./icon.vue_vue_type_script_setup_true_lang.mjs";
|
|
2
|
+
//#region ../../packages/components/icon/src/icon.vue
|
|
3
|
+
var icon_default = icon_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { icon_default as default };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=icon.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.mjs","names":[],"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":""}
|
|
File without changes
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { isUndefined } from "../../../utils/types.mjs";
|
|
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
|
+
import { useNamespace } from "../../../hooks/use-namespace/index.mjs";
|
|
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)({
|
|
7
|
+
name: "CIcon",
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
__name: "icon",
|
|
10
|
+
props: {
|
|
11
|
+
size: {
|
|
12
|
+
type: [Number, String],
|
|
13
|
+
required: false
|
|
14
|
+
},
|
|
15
|
+
color: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: false
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
setup(__props) {
|
|
21
|
+
const props = __props;
|
|
22
|
+
const ns = useNamespace("icon");
|
|
23
|
+
const style = (0, vue_runtime_esm_bundler_exports.computed)(() => {
|
|
24
|
+
const { size, color } = props;
|
|
25
|
+
if (!size && !color) return {};
|
|
26
|
+
return {
|
|
27
|
+
fontSize: isUndefined(size) ? void 0 : addUnit(size),
|
|
28
|
+
"--color": color
|
|
29
|
+
};
|
|
30
|
+
});
|
|
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(),
|
|
34
|
+
style: style.value
|
|
35
|
+
}, _ctx.$attrs), [(0, vue_runtime_esm_bundler_exports.renderSlot)(_ctx.$slots, "default")], 16);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
//#endregion
|
|
40
|
+
export { icon_vue_vue_type_script_setup_true_lang_default as default };
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=icon.vue_vue_type_script_setup_true_lang.mjs.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key.mjs","names":[],"sources":["../../../../../packages/constants/key.ts"],"sourcesContent":["export const INSTALLED_KEY = Symbol('INSTALLED_KEY')\n"],"mappings":";AAAA,MAAa,gBAAgB,OAAO,eAAe"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region ../../packages/constants/sizes.ts
|
|
2
|
+
const componentSizes = [
|
|
3
|
+
"xs",
|
|
4
|
+
"sm",
|
|
5
|
+
"md",
|
|
6
|
+
"lg",
|
|
7
|
+
"xl",
|
|
8
|
+
"compact-xs",
|
|
9
|
+
"compact-sm",
|
|
10
|
+
"compact-md",
|
|
11
|
+
"compact-lg",
|
|
12
|
+
"compact-xl"
|
|
13
|
+
];
|
|
14
|
+
const componentSizeMap = {
|
|
15
|
+
xl: 60,
|
|
16
|
+
lg: 50,
|
|
17
|
+
md: 42,
|
|
18
|
+
sm: 36,
|
|
19
|
+
xs: 30
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { componentSizeMap, componentSizes };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=sizes.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sizes.mjs","names":[],"sources":["../../../../../packages/constants/sizes.ts"],"sourcesContent":["export const componentSizes = [\n 'xs',\n 'sm',\n 'md',\n 'lg',\n 'xl',\n 'compact-xs',\n 'compact-sm',\n 'compact-md',\n 'compact-lg',\n 'compact-xl'\n]\n\nexport type ComponentSize = (typeof componentSizes)[number]\n\nexport const componentSizeMap = {\n xl: 60,\n lg: 50,\n md: 42,\n sm: 36,\n xs: 30\n} as const\n"],"mappings":";AAAA,MAAa,iBAAiB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAIA,MAAa,mBAAmB;CAC9B,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;AACN"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { defaultNamespace, namespaceContextKey, useGetDerivedNamespace, useNamespace } from "./use-namespace/index.mjs";
|
|
2
|
+
import { useProp } from "./use-prop/index.mjs";
|
|
3
|
+
import { useColorScheme } from "./use-theme/index.mjs";
|
|
4
|
+
export { defaultNamespace, namespaceContextKey, useColorScheme, useGetDerivedNamespace, useNamespace, useProp };
|