@cregis/ui 0.0.3 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js DELETED
@@ -1,137 +0,0 @@
1
- import { defineComponent as c, openBlock as a, createElementBlock as u, createStaticVNode as C, computed as l, normalizeClass as b, normalizeStyle as h, withModifiers as L, createBlock as y, renderSlot as v } from "vue";
2
- const w = (e, t) => {
3
- if (e.install = (n) => {
4
- for (const s of [e, ...Object.values(t != null ? t : {})])
5
- n.component(s.name, s);
6
- }, t)
7
- for (const [n, s] of Object.entries(t))
8
- e[n] = s;
9
- return e;
10
- }, k = ["width", "height"], B = /* @__PURE__ */ c({
11
- __name: "ButtonLoading",
12
- props: {
13
- size: { default: "20px" }
14
- },
15
- setup(e) {
16
- return (t, n) => (a(), u("svg", {
17
- class: "shrink-0 loading",
18
- width: t.size,
19
- height: t.size,
20
- viewBox: "0 0 20 20",
21
- version: "1.1",
22
- xmlns: "http://www.w3.org/2000/svg",
23
- "xmlns:xlink": "http://www.w3.org/1999/xlink"
24
- }, n[0] || (n[0] = [
25
- C('<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)
26
- ]), 8, k));
27
- }
28
- });
29
- const f = (e, t) => {
30
- const n = e.__vccOpts || e;
31
- for (const [s, i] of t)
32
- n[s] = i;
33
- return n;
34
- }, z = /* @__PURE__ */ f(B, [["__scopeId", "data-v-93822f14"]]), M = ["disabled"], x = /* @__PURE__ */ c({
35
- name: "CgButton",
36
- __name: "Button",
37
- props: {
38
- loading: { type: Boolean, default: !1 },
39
- disabled: { type: Boolean, default: !1 },
40
- width: {},
41
- size: { default: "small" },
42
- type: { default: "primary" },
43
- fit: { type: Boolean, default: !1 }
44
- },
45
- emits: ["click"],
46
- setup(e) {
47
- const t = e, n = {
48
- minimum: {
49
- height: "1.25rem"
50
- },
51
- small: {
52
- height: "1.5rem"
53
- },
54
- middle: {
55
- height: "1.75rem"
56
- },
57
- large: {
58
- height: "2.5rem"
59
- }
60
- }, s = {
61
- minimum: {
62
- paddingLeft: "8px",
63
- paddingRight: "8px"
64
- },
65
- small: {
66
- paddingLeft: "1rem",
67
- paddingRight: "1rem"
68
- },
69
- middle: {
70
- paddingLeft: "1rem",
71
- paddingRight: "1rem"
72
- },
73
- large: {
74
- paddingLeft: "2rem",
75
- paddingRight: "2rem"
76
- }
77
- }, i = {
78
- primary: "cgbtn_primary-disabled",
79
- cancel: "cgbtn_cancel-disabled",
80
- failure: "cgbtn_failure-disabled",
81
- success: "cgbtn_success-disabled",
82
- text: "cgbtn_text-disabled",
83
- hollow: "cgbtn_hollow-disabled",
84
- tint: "cgbtn_tint-disabled"
85
- }, g = l(
86
- () => t.disabled ? i[t.type] : ""
87
- ), p = l(() => t.fit ? "cgbtn_fit" : "cgbtn_full"), _ = l(
88
- () => Object.assign({}, n[t.size], {
89
- ...t.width ? { width: t.width } : {},
90
- ...t.fit ? s[t.size] : {}
91
- })
92
- ), m = l(() => {
93
- switch (t.type) {
94
- case "primary":
95
- return "cgbtn_primary";
96
- case "cancel":
97
- return "cgbtn_cancel";
98
- case "failure":
99
- return "cgbtn_failure";
100
- case "success":
101
- return "cgbtn_success";
102
- case "text":
103
- return "cgbtn_text";
104
- case "hollow":
105
- return "cgbtn_hollow";
106
- case "tint":
107
- return "cgbtn_tint";
108
- default:
109
- return "cgbtn_primary";
110
- }
111
- });
112
- return (o, r) => (a(), u("button", {
113
- class: b(["flex shrink-0 justify-center items-center rounded-full font-13", [m.value, p.value, g.value]]),
114
- style: h(_.value),
115
- disabled: o.disabled,
116
- onClick: r[0] || (r[0] = L((S) => !o.loading && o.$emit("click"), ["stop"]))
117
- }, [
118
- o.loading ? (a(), y(z, {
119
- key: 0,
120
- size: "1rem"
121
- })) : v(o.$slots, "default", { key: 1 }, void 0, !0)
122
- ], 14, M));
123
- }
124
- });
125
- const Z = /* @__PURE__ */ f(x, [["__scopeId", "data-v-46f714f8"]]), j = w(Z), d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
126
- __proto__: null,
127
- CgButton: j
128
- }, Symbol.toStringTag, { value: "Module" })), O = (e) => {
129
- for (const t of Object.keys(d))
130
- e.component(t, d[t]);
131
- }, I = {
132
- install: O
133
- };
134
- export {
135
- I as default,
136
- O as install
137
- };
package/dist/index.umd.js DELETED
@@ -1 +0,0 @@
1
- (function(o,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(o=typeof globalThis<"u"?globalThis:o||self,t(o.CregisUI={},o.Vue))})(this,function(o,t){"use strict";const B="",u=(n,e)=>{if(n.install=s=>{for(const i of[n,...Object.values(e!=null?e:{})])s.component(i.name,i)},e)for(const[s,i]of Object.entries(e))n[s]=i;return n},p=["width","height"],g=t.defineComponent({__name:"ButtonLoading",props:{size:{default:"20px"}},setup(n){return(e,s)=>(t.openBlock(),t.createElementBlock("svg",{class:"shrink-0 loading",width:e.size,height:e.size,viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},s[0]||(s[0]=[t.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,p))}}),v="",d=(n,e)=>{const s=n.__vccOpts||n;for(const[i,a]of e)s[i]=a;return s},m=d(g,[["__scopeId","data-v-93822f14"]]),_=["disabled"],C=t.defineComponent({name:"CgButton",__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(n){const e=n,s={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"},y=t.computed(()=>e.disabled?a[e.type]:""),L=t.computed(()=>e.fit?"cgbtn_fit":"cgbtn_full"),w=t.computed(()=>Object.assign({},s[e.size],{...e.width?{width:e.width}:{},...e.fit?i[e.size]:{}})),k=t.computed(()=>{switch(e.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,f)=>(t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(["flex shrink-0 justify-center items-center rounded-full font-13",[k.value,L.value,y.value]]),style:t.normalizeStyle(w.value),disabled:l.disabled,onClick:f[0]||(f[0]=t.withModifiers(j=>!l.loading&&l.$emit("click"),["stop"]))},[l.loading?(t.openBlock(),t.createBlock(m,{key:0,size:"1rem"})):t.renderSlot(l.$slots,"default",{key:1},void 0,!0)],14,_))}}),z="",b=u(d(C,[["__scopeId","data-v-46f714f8"]])),c=Object.freeze(Object.defineProperty({__proto__:null,CgButton:b},Symbol.toStringTag,{value:"Module"})),r=n=>{for(const e of Object.keys(c))n.component(e,c[e])},h={install:r};o.default=h,o.install=r,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});