@cregis/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.
- package/dist/components/index.css +1 -1
- package/dist/components/index.es.js +42 -34
- package/dist/components/index.umd.js +1 -1
- package/dist/components/types/button/Button.vue.d.ts +1 -8
- package/dist/components/types/button/button.d.ts +8 -0
- package/dist/components/types/button/index.d.ts +6 -1
- package/dist/components/types/utils/install.d.ts +10 -0
- package/package.json +9 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type="button"]),input:where([type="reset"]),input:where([type="submit"]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden="until-found"])){display:none}.static{position:static}.block{display:block}.flex{display:flex}.shrink-0{flex-shrink:0}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.rounded-full{border-radius:9999px}.border{border-width:1px}.loading[data-v-93822f14]{animation:rotate 2s linear infinite}.cgbtn_fit[data-v-
|
|
1
|
+
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type="button"]),input:where([type="reset"]),input:where([type="submit"]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden="until-found"])){display:none}.static{position:static}.block{display:block}.flex{display:flex}.shrink-0{flex-shrink:0}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.rounded-full{border-radius:9999px}.border{border-width:1px}.loading[data-v-93822f14]{animation:rotate 2s linear infinite}.cgbtn_fit[data-v-b0a0dae8]{width:-moz-fit-content;width:fit-content}.cgbtn_full[data-v-b0a0dae8]{width:100%}.cgbtn_primary[data-v-b0a0dae8]{background-color:var(--cregis-bg-dark);color:var(--cregis-text-white);cursor:default}.cgbtn_primary[data-v-b0a0dae8]:active{color:var(--cregis-text-white-60)!important}.cgbtn_primary.cgbtn_primary-disabled[data-v-b0a0dae8]{cursor:not-allowed!important;color:var(--cregis-text-btn-primary-disabled)!important;background-color:var(--cregis-bg-dark-20)!important}.cgbtn_primary.cgbtn_primary-disabled[data-v-b0a0dae8]:active{color:var(--cregis-text-white)!important}.cgbtn_cancel[data-v-b0a0dae8]{background-color:var(--cregis-bg-dark-10);color:var(--cregis-text-100);cursor:default}.cgbtn_cancel[data-v-b0a0dae8]:active{color:var(--cregis-text-60)!important}.cgbtn_cancel.cgbtn_cancel-disabled[data-v-b0a0dae8]{cursor:not-allowed!important;color:var(--cregis-text-20)!important;background-color:var(--cregis-bg-dark-10)!important}.cgbtn_cancel.cgbtn_cancel-disabled[data-v-b0a0dae8]:active{color:var(--cregis-text-20)!important}.cgbtn_failure[data-v-b0a0dae8]{background-color:var(--cregis-failure);color:var(--cregis-white);cursor:default}.cgbtn_failure[data-v-b0a0dae8]:active{color:var(--cregis-white-60)!important}.cgbtn_failure.cgbtn_failure-disabled[data-v-b0a0dae8]{cursor:not-allowed!important;color:var(--cregis-white)!important;background-color:var(--cregis-failure-20)!important}.cgbtn_failure.cgbtn_failure-disabled[data-v-b0a0dae8]:active{color:var(--cregis-white)!important}.cgbtn_success[data-v-b0a0dae8]{background-color:var(--cregis-success-10);color:var(--cregis-success);cursor:default}.cgbtn_success[data-v-b0a0dae8]:hover{color:var(--cregis-white);background-color:var(--cregis-success)}.cgbtn_success[data-v-b0a0dae8]:active{color:var(--cregis-white-60);background-color:var(--cregis-success)}.cgbtn_success.cgbtn_success-disabled[data-v-b0a0dae8]{cursor:not-allowed!important;color:var(--cregis-success-40)!important;background-color:var(--cregis-success-10)!important}.cgbtn_success.cgbtn_success-disabled[data-v-b0a0dae8]:active{color:var(--cregis-success-40)!important}.cgbtn_hollow[data-v-b0a0dae8]{color:var(--cregis-text-100);cursor:default;border:.5px solid;border-color:var(--cregis-text-100)}.cgbtn_hollow[data-v-b0a0dae8]:hover{color:var(--cregis-text-white);background-color:var(--cregis-bg-dark);border-color:transparent}.cgbtn_hollow[data-v-b0a0dae8]:active{color:var(--cregis-text-white-60);background-color:var(--cregis-bg-dark);border-color:transparent}.cgbtn_hollow.cgbtn_hollow-disabled[data-v-b0a0dae8]{cursor:not-allowed!important;color:var(--cregis-text-20)!important;background-color:transparent!important;border-color:var(--cregis-text-100)!important}.cgbtn_tint[data-v-b0a0dae8]{color:var(--cregis-text-100);cursor:default;border:.5px solid;border-color:var(--cregis-text-20)}.cgbtn_tint[data-v-b0a0dae8]:hover{color:var(--cregis-text-white);background-color:var(--cregis-bg-dark);border-color:transparent}.cgbtn_tint[data-v-b0a0dae8]:active{color:var(--cregis-text-white-60);background-color:var(--cregis-bg-dark);border-color:transparent}.cgbtn_tint.cgbtn_tint-disabled[data-v-b0a0dae8]{cursor:not-allowed!important;color:var(--cregis-text-20)!important;background-color:transparent!important;border-color:var(--cregis-text-20)!important}.cgbtn_text[data-v-b0a0dae8]{background-color:transparent;color:var(--cregis-success);cursor:default}.cgbtn_text[data-v-b0a0dae8]:active{color:var(--cregis-success)!important;background-color:var(--cregis-bg-dark-10)}.cgbtn_text.cgbtn_text-disabled[data-v-b0a0dae8]{cursor:not-allowed!important;color:var(--cregis-success-40)!important;background-color:transparent!important}.cgbtn_text.cgbtn_text-disabled[data-v-b0a0dae8]:active{color:var(--cregis-success-40)!important}
|
|
@@ -1,29 +1,37 @@
|
|
|
1
|
-
import { defineComponent as r, openBlock as
|
|
2
|
-
const v =
|
|
1
|
+
import { defineComponent as r, openBlock as o, createElementBlock as c, createStaticVNode as m, computed as l, normalizeClass as C, normalizeStyle as h, withModifiers as b, createBlock as L, renderSlot as y } from "vue";
|
|
2
|
+
const v = (n, t) => {
|
|
3
|
+
if (n.install = (e) => {
|
|
4
|
+
for (const s of [n, ...Object.values(t != null ? t : {})])
|
|
5
|
+
e.component(s.name, s);
|
|
6
|
+
}, t)
|
|
7
|
+
for (const [e, s] of Object.entries(t))
|
|
8
|
+
n[e] = s;
|
|
9
|
+
return n;
|
|
10
|
+
}, w = ["width", "height"], k = /* @__PURE__ */ r({
|
|
3
11
|
__name: "ButtonLoading",
|
|
4
12
|
props: {
|
|
5
13
|
size: { default: "20px" }
|
|
6
14
|
},
|
|
7
15
|
setup(n) {
|
|
8
|
-
return (
|
|
16
|
+
return (t, e) => (o(), c("svg", {
|
|
9
17
|
class: "shrink-0 loading",
|
|
10
|
-
width:
|
|
11
|
-
height:
|
|
18
|
+
width: t.size,
|
|
19
|
+
height: t.size,
|
|
12
20
|
viewBox: "0 0 20 20",
|
|
13
21
|
version: "1.1",
|
|
14
22
|
xmlns: "http://www.w3.org/2000/svg",
|
|
15
23
|
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
16
|
-
},
|
|
24
|
+
}, e[0] || (e[0] = [
|
|
17
25
|
m('<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" data-v-93822f14><g transform="translate(-804.000000, -497.000000)" data-v-93822f14><g transform="translate(804.000000, 497.000000)" data-v-93822f14><rect x="0" y="0" width="20" height="20" data-v-93822f14></rect><path d="M10,13.7 C10.345178,13.7 10.625,13.979822 10.625,14.325 L10.625,14.325 L10.625,18.125 C10.625,18.470178 10.345178,18.75 10,18.75 C9.65482203,18.75 9.375,18.470178 9.375,18.125 L9.375,14.325 C9.375,13.979822 9.65482203,13.7 10,13.7 Z M13.5125,12.65 L16.1875,15.325 C16.3669713,15.478764 16.4443618,15.7206094 16.3875,15.95 C16.3327452,16.1789698 16.1539698,16.3577452 15.925,16.4125 C15.6956094,16.4693618 15.453764,16.3919713 15.3,16.2125 L12.625,13.5375 C12.3987859,13.2969062 12.3987859,12.9218438 12.625,12.68125 L12.625,12.68125 C12.7381332,12.5587031 12.895554,12.4864573 13.0622346,12.4805883 C13.2289152,12.4747192 13.3910276,12.5357138 13.5125,12.65 L13.5125,12.65 Z M7.34375,12.65 L7.34375,12.65 C7.56996411,12.8905938 7.56996411,13.2656562 7.34375,13.50625 L4.69375,16.1875 C4.53998596,16.3669713 4.29814063,16.4443618 4.06875,16.3875 C3.83978025,16.3327452 3.66100478,16.1539698 3.60625,15.925 C3.54938821,15.6956094 3.62677871,15.453764 3.80625,15.3 L6.48125,12.625 C6.72435097,12.3965823 7.10398479,12.3993333 7.34375,12.63125 L7.34375,12.65 Z M5.675,9.375 C6.02017797,9.375 6.3,9.65482203 6.3,10 C6.3,10.345178 6.02017797,10.625 5.675,10.625 L1.875,10.625 C1.52982203,10.625 1.25,10.345178 1.25,10 C1.25,9.65482203 1.52982203,9.375 1.875,9.375 L5.675,9.375 Z M18.125,9.375 C18.470178,9.375 18.75,9.65482203 18.75,10 C18.75,10.345178 18.470178,10.625 18.125,10.625 L14.325,10.625 C13.979822,10.625 13.7,10.345178 13.7,10 C13.7,9.65482203 13.979822,9.375 14.325,9.375 L18.125,9.375 Z M16.1875,3.8125 C16.4298272,4.05627341 16.4298272,4.44997659 16.1875,4.69375 L13.5125,7.36875 C13.2668846,7.51421102 12.9539246,7.47477298 12.7520758,7.27292421 C12.550227,7.07107544 12.510789,6.75811544 12.65625,6.5125 L15.30625,3.8125 C15.5500234,3.57017275 15.9437266,3.57017275 16.1875,3.8125 Z M4.69375,3.8125 L7.36875,6.4875 C7.5933706,6.62052723 7.711649,6.87915044 7.66536703,7.13607189 C7.61908505,7.39299335 7.41799335,7.59408505 7.16107189,7.64036703 C6.90415044,7.686649 6.64552723,7.5683706 6.5125,7.34375 L3.8125,4.69375 C3.6001395,4.44577483 3.61441733,4.07612864 3.84527299,3.84527299 C4.07612864,3.61441733 4.44577483,3.6001395 4.69375,3.8125 Z M10,1.25 C10.345178,1.25 10.625,1.52982203 10.625,1.875 L10.625,2.5 L10.625,2.5 L10.625,5.675 C10.625,6.02017797 10.345178,6.3 10,6.3 C9.65482203,6.3 9.375,6.02017797 9.375,5.675 L9.375,5.675 L9.375,5 L9.375,5 L9.375,1.875 C9.375,1.52982203 9.65482203,1.25 10,1.25 Z" fill="currentColor" fill-rule="nonzero" data-v-93822f14></path></g></g></g>', 1)
|
|
18
|
-
]), 8,
|
|
26
|
+
]), 8, w));
|
|
19
27
|
}
|
|
20
28
|
});
|
|
21
|
-
const g = (n,
|
|
22
|
-
const
|
|
23
|
-
for (const [
|
|
24
|
-
|
|
25
|
-
return
|
|
26
|
-
},
|
|
29
|
+
const g = (n, t) => {
|
|
30
|
+
const e = n.__vccOpts || n;
|
|
31
|
+
for (const [s, a] of t)
|
|
32
|
+
e[s] = a;
|
|
33
|
+
return e;
|
|
34
|
+
}, B = /* @__PURE__ */ g(k, [["__scopeId", "data-v-93822f14"]]), z = ["disabled"], M = /* @__PURE__ */ r({
|
|
27
35
|
__name: "Button",
|
|
28
36
|
props: {
|
|
29
37
|
loading: { type: Boolean, default: !1 },
|
|
@@ -35,7 +43,7 @@ const g = (n, e) => {
|
|
|
35
43
|
},
|
|
36
44
|
emits: ["click"],
|
|
37
45
|
setup(n) {
|
|
38
|
-
const
|
|
46
|
+
const t = n, e = {
|
|
39
47
|
minimum: {
|
|
40
48
|
height: "1.25rem"
|
|
41
49
|
},
|
|
@@ -48,7 +56,7 @@ const g = (n, e) => {
|
|
|
48
56
|
large: {
|
|
49
57
|
height: "2.5rem"
|
|
50
58
|
}
|
|
51
|
-
},
|
|
59
|
+
}, s = {
|
|
52
60
|
minimum: {
|
|
53
61
|
paddingLeft: "8px",
|
|
54
62
|
paddingRight: "8px"
|
|
@@ -65,7 +73,7 @@ const g = (n, e) => {
|
|
|
65
73
|
paddingLeft: "2rem",
|
|
66
74
|
paddingRight: "2rem"
|
|
67
75
|
}
|
|
68
|
-
},
|
|
76
|
+
}, a = {
|
|
69
77
|
primary: "cgbtn_primary-disabled",
|
|
70
78
|
cancel: "cgbtn_cancel-disabled",
|
|
71
79
|
failure: "cgbtn_failure-disabled",
|
|
@@ -73,15 +81,15 @@ const g = (n, e) => {
|
|
|
73
81
|
text: "cgbtn_text-disabled",
|
|
74
82
|
hollow: "cgbtn_hollow-disabled",
|
|
75
83
|
tint: "cgbtn_tint-disabled"
|
|
76
|
-
}, u =
|
|
77
|
-
() =>
|
|
78
|
-
),
|
|
79
|
-
() => Object.assign({}, t
|
|
80
|
-
...
|
|
81
|
-
...
|
|
84
|
+
}, u = l(
|
|
85
|
+
() => t.disabled ? a[t.type] : ""
|
|
86
|
+
), f = l(() => t.fit ? "cgbtn_fit" : "cgbtn_full"), p = l(
|
|
87
|
+
() => Object.assign({}, e[t.size], {
|
|
88
|
+
...t.width ? { width: t.width } : {},
|
|
89
|
+
...t.fit ? s[t.size] : {}
|
|
82
90
|
})
|
|
83
|
-
), _ =
|
|
84
|
-
switch (
|
|
91
|
+
), _ = l(() => {
|
|
92
|
+
switch (t.type) {
|
|
85
93
|
case "primary":
|
|
86
94
|
return "cgbtn_primary";
|
|
87
95
|
case "cancel":
|
|
@@ -100,20 +108,20 @@ const g = (n, e) => {
|
|
|
100
108
|
return "cgbtn_primary";
|
|
101
109
|
}
|
|
102
110
|
});
|
|
103
|
-
return (
|
|
104
|
-
class: C(["flex shrink-0 justify-center items-center rounded-full font-13", [_.value,
|
|
105
|
-
style: h(
|
|
106
|
-
disabled:
|
|
107
|
-
onClick:
|
|
111
|
+
return (i, d) => (o(), c("button", {
|
|
112
|
+
class: C(["flex shrink-0 justify-center items-center rounded-full font-13", [_.value, f.value, u.value]]),
|
|
113
|
+
style: h(p.value),
|
|
114
|
+
disabled: i.disabled,
|
|
115
|
+
onClick: d[0] || (d[0] = b((x) => !i.loading && i.$emit("click"), ["stop"]))
|
|
108
116
|
}, [
|
|
109
|
-
|
|
117
|
+
i.loading ? (o(), L(B, {
|
|
110
118
|
key: 0,
|
|
111
119
|
size: "1rem"
|
|
112
|
-
})) : y(
|
|
113
|
-
], 14,
|
|
120
|
+
})) : y(i.$slots, "default", { key: 1 }, void 0, !0)
|
|
121
|
+
], 14, z));
|
|
114
122
|
}
|
|
115
123
|
});
|
|
116
|
-
const Z = /* @__PURE__ */ g(
|
|
124
|
+
const Z = /* @__PURE__ */ g(M, [["__scopeId", "data-v-b0a0dae8"]]), $ = v(Z);
|
|
117
125
|
export {
|
|
118
|
-
|
|
126
|
+
$ as CgButton
|
|
119
127
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(o=typeof globalThis<"u"?globalThis:o||self,e(o.CregisUI={},o.Vue))})(this,function(o,e){"use strict";const y="",c=(s,t)=>{if(s.install=n=>{for(const i of[s,...Object.values(t!=null?t:{})])n.component(i.name,i)},t)for(const[n,i]of Object.entries(t))s[n]=i;return s},f=["width","height"],p=e.defineComponent({__name:"ButtonLoading",props:{size:{default:"20px"}},setup(s){return(t,n)=>(e.openBlock(),e.createElementBlock("svg",{class:"shrink-0 loading",width:t.size,height:t.size,viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},n[0]||(n[0]=[e.createStaticVNode('<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" data-v-93822f14><g transform="translate(-804.000000, -497.000000)" data-v-93822f14><g transform="translate(804.000000, 497.000000)" data-v-93822f14><rect x="0" y="0" width="20" height="20" data-v-93822f14></rect><path d="M10,13.7 C10.345178,13.7 10.625,13.979822 10.625,14.325 L10.625,14.325 L10.625,18.125 C10.625,18.470178 10.345178,18.75 10,18.75 C9.65482203,18.75 9.375,18.470178 9.375,18.125 L9.375,14.325 C9.375,13.979822 9.65482203,13.7 10,13.7 Z M13.5125,12.65 L16.1875,15.325 C16.3669713,15.478764 16.4443618,15.7206094 16.3875,15.95 C16.3327452,16.1789698 16.1539698,16.3577452 15.925,16.4125 C15.6956094,16.4693618 15.453764,16.3919713 15.3,16.2125 L12.625,13.5375 C12.3987859,13.2969062 12.3987859,12.9218438 12.625,12.68125 L12.625,12.68125 C12.7381332,12.5587031 12.895554,12.4864573 13.0622346,12.4805883 C13.2289152,12.4747192 13.3910276,12.5357138 13.5125,12.65 L13.5125,12.65 Z M7.34375,12.65 L7.34375,12.65 C7.56996411,12.8905938 7.56996411,13.2656562 7.34375,13.50625 L4.69375,16.1875 C4.53998596,16.3669713 4.29814063,16.4443618 4.06875,16.3875 C3.83978025,16.3327452 3.66100478,16.1539698 3.60625,15.925 C3.54938821,15.6956094 3.62677871,15.453764 3.80625,15.3 L6.48125,12.625 C6.72435097,12.3965823 7.10398479,12.3993333 7.34375,12.63125 L7.34375,12.65 Z M5.675,9.375 C6.02017797,9.375 6.3,9.65482203 6.3,10 C6.3,10.345178 6.02017797,10.625 5.675,10.625 L1.875,10.625 C1.52982203,10.625 1.25,10.345178 1.25,10 C1.25,9.65482203 1.52982203,9.375 1.875,9.375 L5.675,9.375 Z M18.125,9.375 C18.470178,9.375 18.75,9.65482203 18.75,10 C18.75,10.345178 18.470178,10.625 18.125,10.625 L14.325,10.625 C13.979822,10.625 13.7,10.345178 13.7,10 C13.7,9.65482203 13.979822,9.375 14.325,9.375 L18.125,9.375 Z M16.1875,3.8125 C16.4298272,4.05627341 16.4298272,4.44997659 16.1875,4.69375 L13.5125,7.36875 C13.2668846,7.51421102 12.9539246,7.47477298 12.7520758,7.27292421 C12.550227,7.07107544 12.510789,6.75811544 12.65625,6.5125 L15.30625,3.8125 C15.5500234,3.57017275 15.9437266,3.57017275 16.1875,3.8125 Z M4.69375,3.8125 L7.36875,6.4875 C7.5933706,6.62052723 7.711649,6.87915044 7.66536703,7.13607189 C7.61908505,7.39299335 7.41799335,7.59408505 7.16107189,7.64036703 C6.90415044,7.686649 6.64552723,7.5683706 6.5125,7.34375 L3.8125,4.69375 C3.6001395,4.44577483 3.61441733,4.07612864 3.84527299,3.84527299 C4.07612864,3.61441733 4.44577483,3.6001395 4.69375,3.8125 Z M10,1.25 C10.345178,1.25 10.625,1.52982203 10.625,1.875 L10.625,2.5 L10.625,2.5 L10.625,5.675 C10.625,6.02017797 10.345178,6.3 10,6.3 C9.65482203,6.3 9.375,6.02017797 9.375,5.675 L9.375,5.675 L9.375,5 L9.375,5 L9.375,1.875 C9.375,1.52982203 9.65482203,1.25 10,1.25 Z" fill="currentColor" fill-rule="nonzero" data-v-93822f14></path></g></g></g>',1)]),8,f))}}),w="",d=(s,t)=>{const n=s.__vccOpts||s;for(const[i,a]of t)n[i]=a;return n},u=d(p,[["__scopeId","data-v-93822f14"]]),g=["disabled"],m=e.defineComponent({__name:"Button",props:{loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},width:{},size:{default:"small"},type:{default:"primary"},fit:{type:Boolean,default:!1}},emits:["click"],setup(s){const t=s,n={minimum:{height:"1.25rem"},small:{height:"1.5rem"},middle:{height:"1.75rem"},large:{height:"2.5rem"}},i={minimum:{paddingLeft:"8px",paddingRight:"8px"},small:{paddingLeft:"1rem",paddingRight:"1rem"},middle:{paddingLeft:"1rem",paddingRight:"1rem"},large:{paddingLeft:"2rem",paddingRight:"2rem"}},a={primary:"cgbtn_primary-disabled",cancel:"cgbtn_cancel-disabled",failure:"cgbtn_failure-disabled",success:"cgbtn_success-disabled",text:"cgbtn_text-disabled",hollow:"cgbtn_hollow-disabled",tint:"cgbtn_tint-disabled"},C=e.computed(()=>t.disabled?a[t.type]:""),h=e.computed(()=>t.fit?"cgbtn_fit":"cgbtn_full"),b=e.computed(()=>Object.assign({},n[t.size],{...t.width?{width:t.width}:{},...t.fit?i[t.size]:{}})),L=e.computed(()=>{switch(t.type){case"primary":return"cgbtn_primary";case"cancel":return"cgbtn_cancel";case"failure":return"cgbtn_failure";case"success":return"cgbtn_success";case"text":return"cgbtn_text";case"hollow":return"cgbtn_hollow";case"tint":return"cgbtn_tint";default:return"cgbtn_primary"}});return(l,r)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["flex shrink-0 justify-center items-center rounded-full font-13",[L.value,h.value,C.value]]),style:e.normalizeStyle(b.value),disabled:l.disabled,onClick:r[0]||(r[0]=e.withModifiers(v=>!l.loading&&l.$emit("click"),["stop"]))},[l.loading?(e.openBlock(),e.createBlock(u,{key:0,size:"1rem"})):e.renderSlot(l.$slots,"default",{key:1},void 0,!0)],14,g))}}),k="",_=c(d(m,[["__scopeId","data-v-b0a0dae8"]]));o.CgButton=_,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
loading?: boolean;
|
|
3
|
-
disabled?: boolean;
|
|
4
|
-
width?: string;
|
|
5
|
-
size?: "minimum" | "small" | "middle" | "large";
|
|
6
|
-
type?: "primary" | "cancel" | "failure" | "success" | "text" | "hollow" | "tint";
|
|
7
|
-
fit?: boolean;
|
|
8
|
-
}
|
|
1
|
+
import { Props } from './button';
|
|
9
2
|
declare function __VLS_template(): {
|
|
10
3
|
attrs: Partial<{}>;
|
|
11
4
|
slots: {
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
+
import { SFCWithInstall } from '../utils/install';
|
|
1
2
|
import { default as Button } from './Button.vue';
|
|
2
|
-
|
|
3
|
+
type ButtonInstance = InstanceType<typeof Button> & unknown;
|
|
4
|
+
export * from './button';
|
|
5
|
+
export declare const CgButton: SFCWithInstall<typeof Button>;
|
|
6
|
+
export default CgButton;
|
|
7
|
+
export type { ButtonInstance };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AppContext, Directive, Plugin } from 'vue';
|
|
2
|
+
export type SFCWithInstall<T> = T & Plugin;
|
|
3
|
+
export type SFCInstallWithContext<T> = SFCWithInstall<T> & {
|
|
4
|
+
_context: AppContext | null;
|
|
5
|
+
};
|
|
6
|
+
export declare const NOOP: () => void;
|
|
7
|
+
export declare const withInstall: <T, E extends Record<string, any>>(main: T, extra?: E) => SFCWithInstall<T> & E;
|
|
8
|
+
export declare const withInstallFunction: <T>(fn: T, name: string) => SFCInstallWithContext<T>;
|
|
9
|
+
export declare const withInstallDirective: <T extends Directive>(directive: T, name: string) => SFCWithInstall<T>;
|
|
10
|
+
export declare const withNoopInstall: <T>(component: T) => SFCWithInstall<T>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cregis/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"main": "dist/components/index.js",
|
|
5
5
|
"module": "dist/components/index.es.js",
|
|
6
6
|
"types": "dist/components/types/index.d.ts",
|
|
@@ -20,11 +20,7 @@
|
|
|
20
20
|
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@cregis/color": "^0.0.3"
|
|
24
|
-
"autoprefixer": "^10.4.21",
|
|
25
|
-
"pinia": "^2.0.21",
|
|
26
|
-
"vue": "^3.2.38",
|
|
27
|
-
"vue-router": "^4.1.5"
|
|
23
|
+
"@cregis/color": "^0.0.3"
|
|
28
24
|
},
|
|
29
25
|
"devDependencies": {
|
|
30
26
|
"@rushstack/eslint-patch": "^1.1.4",
|
|
@@ -43,6 +39,12 @@
|
|
|
43
39
|
"typescript": "~5.7.2",
|
|
44
40
|
"vite": "^3.0.9",
|
|
45
41
|
"vite-plugin-dts": "^4.5.3",
|
|
46
|
-
"vue-tsc": "^2.2.4"
|
|
42
|
+
"vue-tsc": "^2.2.4",
|
|
43
|
+
"autoprefixer": "^10.4.21",
|
|
44
|
+
"pinia": "^2.0.21",
|
|
45
|
+
"vue-router": "^4.1.5"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"vue": "^3.2.0"
|
|
47
49
|
}
|
|
48
50
|
}
|