@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.
@@ -0,0 +1,266 @@
1
+ import { App } from 'vue';
2
+ import { Component } from 'vue';
3
+ import { ComponentOptionsMixin } from 'vue';
4
+ import { ComponentProvideOptions } from 'vue';
5
+ import { CSSProperties } from 'vue';
6
+ import { DefineComponent } from 'vue';
7
+ import { PublicProps } from 'vue';
8
+
9
+ declare const __VLS_component: DefineComponent<InputProps, {
10
+ focus: () => Promise<void>;
11
+ updateTextWidth: () => void;
12
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
13
+ "update:modelValue": (value: string | number) => any;
14
+ input: (value: string | number) => any;
15
+ change: (value: string | number) => any;
16
+ focus: (value: FocusEvent) => any;
17
+ blur: (value: FocusEvent) => any;
18
+ clear: () => any;
19
+ }, string, PublicProps, Readonly<InputProps> & Readonly<{
20
+ "onUpdate:modelValue"?: (value: string | number) => any;
21
+ onInput?: (value: string | number) => any;
22
+ onChange?: (value: string | number) => any;
23
+ onFocus?: (value: FocusEvent) => any;
24
+ onBlur?: (value: FocusEvent) => any;
25
+ onClear?: () => any;
26
+ }>, {
27
+ type: "text" | "number" | "textarea";
28
+ size: "small" | "medium" | "large";
29
+ width: string;
30
+ placeholder: string;
31
+ rows: number;
32
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
33
+ inputRef: HTMLTextAreaElement;
34
+ }, any>;
35
+
36
+ declare const __VLS_component_2: DefineComponent<ButtonProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ButtonProps> & Readonly<{}>, {
37
+ type: ButtonType;
38
+ size: ButtonSize;
39
+ iconType: IconButtonType;
40
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {
41
+ buttonRef: HTMLButtonElement;
42
+ }, any>;
43
+
44
+ declare const __VLS_component_3: DefineComponent<CheckboxProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
45
+ "update:modelValue": (value: number | boolean) => any;
46
+ change: (value: number | boolean) => any;
47
+ }, string, PublicProps, Readonly<CheckboxProps> & Readonly<{
48
+ "onUpdate:modelValue"?: (value: number | boolean) => any;
49
+ onChange?: (value: number | boolean) => any;
50
+ }>, {
51
+ disabled: boolean;
52
+ modelValue: boolean | number;
53
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
54
+
55
+ declare const __VLS_component_4: DefineComponent<RadioProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
56
+ "update:modelValue": (value: RadioValue) => any;
57
+ change: (value: RadioValue) => any;
58
+ }, string, PublicProps, Readonly<RadioProps> & Readonly<{
59
+ "onUpdate:modelValue"?: (value: RadioValue) => any;
60
+ onChange?: (value: RadioValue) => any;
61
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
62
+
63
+ declare const __VLS_component_5: DefineComponent<TabsProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
64
+ "update:modelValue": (name: string | number) => any;
65
+ }, string, PublicProps, Readonly<TabsProps> & Readonly<{
66
+ "onUpdate:modelValue"?: (name: string | number) => any;
67
+ }>, {
68
+ type: "default" | "card";
69
+ size: TabSize;
70
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
71
+
72
+ declare function __VLS_template(): {
73
+ attrs: Partial<{}>;
74
+ slots: {
75
+ prefix?(_: {}): any;
76
+ suffix?(_: {}): any;
77
+ };
78
+ refs: {
79
+ inputRef: HTMLTextAreaElement;
80
+ };
81
+ rootEl: any;
82
+ };
83
+
84
+ declare function __VLS_template_2(): {
85
+ attrs: Partial<{}>;
86
+ slots: {
87
+ icon?(_: {}): any;
88
+ default?(_: {}): any;
89
+ default?(_: {}): any;
90
+ };
91
+ refs: {
92
+ buttonRef: HTMLButtonElement;
93
+ };
94
+ rootEl: any;
95
+ };
96
+
97
+ declare function __VLS_template_3(): {
98
+ attrs: Partial<{}>;
99
+ slots: {
100
+ default?(_: {}): any;
101
+ };
102
+ refs: {};
103
+ rootEl: HTMLDivElement;
104
+ };
105
+
106
+ declare function __VLS_template_4(): {
107
+ attrs: Partial<{}>;
108
+ slots: {
109
+ default?(_: {}): any;
110
+ };
111
+ refs: {};
112
+ rootEl: HTMLDivElement;
113
+ };
114
+
115
+ declare function __VLS_template_5(): {
116
+ attrs: Partial<{}>;
117
+ slots: {
118
+ default?(_: {}): any;
119
+ };
120
+ refs: {};
121
+ rootEl: HTMLDivElement;
122
+ };
123
+
124
+ declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
125
+
126
+ declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
127
+
128
+ declare type __VLS_TemplateResult_3 = ReturnType<typeof __VLS_template_3>;
129
+
130
+ declare type __VLS_TemplateResult_4 = ReturnType<typeof __VLS_template_4>;
131
+
132
+ declare type __VLS_TemplateResult_5 = ReturnType<typeof __VLS_template_5>;
133
+
134
+ declare type __VLS_WithTemplateSlots<T, S> = T & {
135
+ new (): {
136
+ $slots: S;
137
+ };
138
+ };
139
+
140
+ declare type __VLS_WithTemplateSlots_2<T, S> = T & {
141
+ new (): {
142
+ $slots: S;
143
+ };
144
+ };
145
+
146
+ declare type __VLS_WithTemplateSlots_3<T, S> = T & {
147
+ new (): {
148
+ $slots: S;
149
+ };
150
+ };
151
+
152
+ declare type __VLS_WithTemplateSlots_4<T, S> = T & {
153
+ new (): {
154
+ $slots: S;
155
+ };
156
+ };
157
+
158
+ declare type __VLS_WithTemplateSlots_5<T, S> = T & {
159
+ new (): {
160
+ $slots: S;
161
+ };
162
+ };
163
+
164
+ export declare const Button: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
165
+
166
+ declare interface ButtonProps {
167
+ type?: ButtonType;
168
+ size?: ButtonSize;
169
+ plain?: boolean;
170
+ text?: boolean;
171
+ disabled?: boolean;
172
+ loading?: boolean;
173
+ block?: boolean;
174
+ link?: boolean;
175
+ icon?: Component;
176
+ iconType?: IconButtonType;
177
+ iconText?: string;
178
+ affix?: boolean;
179
+ }
180
+
181
+ declare type ButtonSize = 'extraSmall' | 'small' | 'medium' | 'large';
182
+
183
+ declare type ButtonType = 'primary' | 'secondary' | 'danger' | 'foreground' | 'sameWhite';
184
+
185
+ export declare const Checkbox: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
186
+
187
+ declare interface CheckboxProps {
188
+ modelValue: boolean | number;
189
+ label?: string;
190
+ disabled?: boolean;
191
+ circle?: boolean;
192
+ indeterminate?: boolean;
193
+ }
194
+
195
+ declare const _default: {
196
+ install: (app: App) => void;
197
+ };
198
+ export default _default;
199
+
200
+ export declare const Divider: DefineComponent<DividerProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<DividerProps> & Readonly<{}>, {
201
+ color: string;
202
+ direction: "horizontal" | "vertical";
203
+ borderStyle: "solid" | "dashed" | "dotted";
204
+ lineThickness: string;
205
+ margin: string | [string, string];
206
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
207
+
208
+ declare interface DividerProps {
209
+ direction?: 'horizontal' | 'vertical';
210
+ borderStyle?: 'solid' | 'dashed' | 'dotted';
211
+ lineThickness?: string;
212
+ color?: string;
213
+ margin?: string | [string, string];
214
+ length?: string;
215
+ }
216
+
217
+ declare type IconButtonType = 'rectangle' | 'square' | 'circle' | 'professional';
218
+
219
+ export declare const Input: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
220
+
221
+ declare interface InputProps {
222
+ type?: 'text' | 'number' | 'textarea';
223
+ modelValue: StringOrNumber;
224
+ size?: 'small' | 'medium' | 'large';
225
+ width?: string;
226
+ placeholder?: string;
227
+ disabled?: boolean;
228
+ clearable?: boolean;
229
+ inputStyle?: CSSProperties;
230
+ unit?: string;
231
+ rows?: number;
232
+ }
233
+
234
+ export declare const install: (app: App) => void;
235
+
236
+ export declare const Radio: __VLS_WithTemplateSlots_4<typeof __VLS_component_4, __VLS_TemplateResult_4["slots"]>;
237
+
238
+ declare interface RadioProps {
239
+ modelValue: RadioValue;
240
+ value: RadioValue;
241
+ label?: string;
242
+ disabled?: boolean;
243
+ }
244
+
245
+ declare type RadioValue = boolean | string | number;
246
+
247
+ declare type StringOrNumber = string | number;
248
+
249
+ export declare const TabPane: DefineComponent<TabPaneProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<TabPaneProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
250
+
251
+ declare interface TabPaneProps {
252
+ label: string;
253
+ name: string | number;
254
+ }
255
+
256
+ export declare const Tabs: __VLS_WithTemplateSlots_5<typeof __VLS_component_5, __VLS_TemplateResult_5["slots"]>;
257
+
258
+ declare type TabSize = 'small' | 'medium' | 'large';
259
+
260
+ declare interface TabsProps {
261
+ modelValue: string | number;
262
+ type?: 'default' | 'card';
263
+ size?: TabSize;
264
+ }
265
+
266
+ export { }
@@ -0,0 +1 @@
1
+ (function(c,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@cregis/icon")):typeof define=="function"&&define.amd?define(["exports","vue","@cregis/icon"],e):(c=typeof globalThis<"u"?globalThis:c||self,e(c.CregisUI={},c.Vue,c.CregisIcon))})(this,(function(c,e,$){"use strict";const I={key:0,class:"cregis-button__icon-wrapper"},D=["disabled"],P=["disabled"],L=["disabled"],f=e.defineComponent({name:"Button",inheritAttrs:!1,__name:"Button",props:{type:{default:"primary"},size:{default:"medium"},plain:{type:Boolean},text:{type:Boolean},disabled:{type:Boolean},loading:{type:Boolean},block:{type:Boolean},link:{type:Boolean},icon:{},iconType:{default:"rectangle"},iconText:{},affix:{type:Boolean}},setup(t){const n=t,a=e.computed(()=>n.size==="large"?"20px":n.size==="medium"?"16px":"12px"),r=e.computed(()=>n.size==="large"||n.size==="medium"?"16px":"12px"),i=e.computed(()=>{if(n.plain||n.text)switch(n.type){case"primary":return"var(--material-vibrant-brand-primary)";case"secondary":return"var(--material-foreground-base-secondary)";case"danger":return"var(--material-vibrant-error-primary)";case"foreground":return"var(--material-foreground-base-primary)";case"sameWhite":return"var(--material-same-black)"}else return n.type==="secondary"?"var(--material-foreground-base-secondary)":n.type==="foreground"?"var(--text-face-primary)":n.type==="sameWhite"?"var(--text-same-black)":"var(--material-same-white)"});return(l,s)=>t.icon||l.$slots.icon?(e.openBlock(),e.createElementBlock("div",I,[e.createElementVNode("button",e.mergeProps(l.$attrs,{class:["cregis-button__icon",{[`cregis-button__icon--${t.iconType}`]:t.iconType,[`cregis-button__icon--${t.size}`]:t.size,"is-disabled":t.disabled}],disabled:t.disabled||t.loading}),[t.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.icon),{key:0,size:a.value,"stroke-width":3},null,8,["size"])):e.renderSlot(l.$slots,"icon",{key:1})],16,D),t.iconText?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["cregis-button__icon-text",{"is-disabled":t.disabled}])},e.toDisplayString(t.iconText),3)):e.createCommentVNode("",!0)])):t.link?(e.openBlock(),e.createElementBlock("button",e.mergeProps({key:1},l.$attrs,{class:["cregis-button__link",{[`cregis-button__link--${t.type}`]:t.type,[`cregis-button__link--${t.size}`]:t.size,"is-disabled":t.disabled}],disabled:t.disabled||t.loading}),[e.renderSlot(l.$slots,"default")],16,P)):(e.openBlock(),e.createElementBlock("button",e.mergeProps({key:2,ref:"buttonRef"},l.$attrs,{class:["cregis-button",{[`cregis-button--${t.type}`]:t.type,[`cregis-button--${t.size}`]:t.size,"is-plain":t.plain,"is-text":t.text,"is-disabled":t.disabled,"is-loading":t.loading,"is-block":t.block,"is-affix":t.affix}],disabled:t.disabled||t.loading}),[t.loading?(e.openBlock(),e.createBlock(e.unref($.EdsLoad),{key:0,class:"loading",size:r.value,color:i.value,"stroke-width":3},null,8,["size","color"])):e.renderSlot(l.$slots,"default",{key:1})],16,L))}}),A={key:0,class:"cregis-input__prefix"},F=["type","placeholder","disabled"],M={key:2,class:"cregis-input__suffix"},W=["disabled","placeholder","rows"],U={key:0,class:"cregis-textarea__buttons"},g=e.defineComponent({name:"Input",inheritAttrs:!1,__name:"Input",props:{type:{default:"text"},modelValue:{},size:{default:"medium"},width:{default:"300px"},placeholder:{default:"please input"},disabled:{type:Boolean},clearable:{type:Boolean},inputStyle:{},unit:{},rows:{default:3}},emits:["update:modelValue","input","change","focus","blur","clear"],setup(t,{expose:n,emit:a}){const r=t,i=a,l=e.ref(r.modelValue);e.watch(()=>r.modelValue,o=>{l.value=o});const s=e.ref(),d=e.ref(0),b=e.ref(!1);let B=null;const _=async()=>{await e.nextTick(),s.value?.focus()},z=async()=>{i("update:modelValue",l.value),i("input",l.value),await e.nextTick(),R()},V=()=>{i("change",l.value)},S=o=>{b.value=!0,i("focus",o)},T=o=>{b.value=!1,i("blur",o)},E=e.computed(()=>r.clearable&&!r.disabled&&!!l.value&&b.value),N=()=>{l.value="",i("update:modelValue",""),i("clear"),i("input",""),i("change","")},R=()=>{B&&cancelAnimationFrame(B),B=requestAnimationFrame(()=>{if(!s.value||s.value.tagName!=="INPUT")return;const o=s.value,u=o.value,m=document.createElement("span");m.style.position="absolute",m.style.visibility="hidden",m.style.whiteSpace="pre",m.style.font=window.getComputedStyle(o).font,m.style.letterSpacing=window.getComputedStyle(o).letterSpacing,m.textContent=u||" ",document.body.appendChild(m),d.value=m.getBoundingClientRect().width,document.body.removeChild(m)})},v=e.computed(()=>{const o={};return d.value>0&&(o.position="absolute",o.left=`${d.value+16}px`),o}),ee=async()=>{try{l.value=await navigator.clipboard.readText()}catch(o){console.error("paste error:",o)}};return n({focus:_,updateTextWidth:R}),(o,u)=>t.type!=="textarea"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["cregis-input",{[`cregis-input--${t.size}`]:t.size,"is-disabled":t.disabled,"is-prefix":o.$slots.prefix,"is-suffix":o.$slots.suffix}]),style:e.normalizeStyle([{width:t.width},t.inputStyle])},[e.createElementVNode("div",{class:e.normalizeClass(["cregis-input__wrapper",{"is-focus":b.value}])},[o.$slots.prefix?(e.openBlock(),e.createElementBlock("span",A,[e.renderSlot(o.$slots,"prefix")])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",e.mergeProps({class:"cregis-input__inner","onUpdate:modelValue":u[0]||(u[0]=m=>l.value=m),ref_key:"inputRef",ref:s,type:t.type,placeholder:t.placeholder},o.$attrs,{disabled:t.disabled,onInput:z,onChange:V,onFocus:S,onBlur:T}),null,16,F),[[e.vModelDynamic,l.value]]),t.unit&&l.value?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(v.value),class:"cregis-input__unit"},e.toDisplayString(t.unit),5)):e.createCommentVNode("",!0),o.$slots.suffix||E.value?(e.openBlock(),e.createElementBlock("span",M,[e.renderSlot(o.$slots,"suffix"),E.value?(e.openBlock(),e.createBlock(f,{key:0,class:"cregis-input__clear-button",icon:e.unref($.EdsCloseCircleFill),"icon-type":"square",onClick:N,onMousedown:u[1]||(u[1]=e.withModifiers(()=>{},["prevent"]))},null,8,["icon"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2)],6)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["cregis-textarea",{"is-disabled":t.disabled}]),style:e.normalizeStyle([{width:t.width},t.inputStyle])},[e.withDirectives(e.createElementVNode("textarea",e.mergeProps({class:"cregis-textarea__wrapper"},o.$attrs,{ref_key:"inputRef",ref:s,disabled:t.disabled,placeholder:t.placeholder,rows:t.rows,"onUpdate:modelValue":u[2]||(u[2]=m=>l.value=m),onInput:z,onChange:V,onFocus:S,onBlur:T}),null,16,W),[[e.vModelText,l.value]]),t.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(f,{class:"cregis-textarea__button",link:"",size:"small",onClick:ee},{default:e.withCtx(()=>[...u[3]||(u[3]=[e.createTextVNode(" Paste ",-1)])]),_:1}),e.createVNode(f,{class:"cregis-textarea__button",link:"",size:"small",disabled:!l.value,onClick:N},{default:e.withCtx(()=>[...u[4]||(u[4]=[e.createTextVNode(" Clear ",-1)])]),_:1},8,["disabled"])]))],6))}});g.install=t=>{t.component(g.name,g)},f.install=t=>{t.component(f.name,f)};const q=["width","height"],j={stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},O={transform:"translate(-394.000000, -457.000000)"},K={transform:"translate(394.000000, 457.000000)"},Y=["width","height"],Z=e.defineComponent({__name:"checked-basis",props:{size:{default:"16px"}},setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock("svg",{width:t.size,height:t.size,viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[e.createElementVNode("g",j,[e.createElementVNode("g",O,[e.createElementVNode("g",K,[e.createElementVNode("rect",{x:"0",y:"0",width:t.size,height:t.size},null,8,Y),a[0]||(a[0]=e.createElementVNode("path",{d:"M6.67713976,13.5709642 C7.12567714,13.5709642 7.468039,13.3943662 7.70422535,13.0411701 L13.7562297,3.77789816 C13.8407367,3.65005417 13.9024919,3.52546046 13.9414951,3.40411701 C13.9804984,3.28277356 14,3.16468039 14,3.04983749 C14,2.74647887 13.8976165,2.49566631 13.6928494,2.29739978 C13.4880823,2.09913326 13.2307692,2 12.9209101,2 C12.7063922,2 12.5265439,2.04225352 12.3813651,2.12676056 C12.2361863,2.21126761 12.0975081,2.35536295 11.9653304,2.55904659 L6.65113759,10.9512459 L3.95016251,7.60346696 C3.71830986,7.32177681 3.43011918,7.18093174 3.08559047,7.18093174 C2.77139762,7.18093174 2.51191766,7.28169014 2.3071506,7.48320693 C2.10238353,7.68472373 2,7.93824485 2,8.24377031 C2,8.38028169 2.02329361,8.51083424 2.06988082,8.63542795 C2.11646804,8.76002167 2.19826652,8.88949079 2.31527627,9.02383532 L5.67280607,13.0899242 C5.94149512,13.4106176 6.27627302,13.5709642 6.67713976,13.5709642 Z",fill:"currentColor","fill-rule":"nonzero"},null,-1))])])])],8,q))}}),G={key:0,class:"cregis-checkbox--indeterminate"},y=e.defineComponent({name:"Checkbox",__name:"Checkbox",props:{modelValue:{type:[Boolean,Number],default:!1},label:{},disabled:{type:Boolean,default:!1},circle:{type:Boolean},indeterminate:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:n}){const a=t,r=n,i=e.computed(()=>a.modelValue),l=()=>{a.disabled||r("update:modelValue",!i.value)};return e.watch(()=>i.value,()=>{r("change",i.value)}),(s,d)=>(e.openBlock(),e.createElementBlock("div",{class:"cregis-checkbox__wrapper",onClick:l},[e.createElementVNode("div",{class:e.normalizeClass(["cregis-checkbox",{"is-disabled":t.disabled,"is-checked":i.value,"is-circle":t.circle,"is-indeterminate":t.indeterminate}])},[t.indeterminate?(e.openBlock(),e.createElementBlock("div",G)):(e.openBlock(),e.createBlock(Z,{key:1,size:"10px"}))],2),s.$slots.default||t.label?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["cregis-checkbox__label",{"is-disabled":t.disabled}])},[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)])],2)):e.createCommentVNode("",!0)]))}});y.install=t=>{t.component(y.name,y)};const h=e.defineComponent({name:"Radio",__name:"Radio",props:{modelValue:{type:[Boolean,String,Number]},value:{type:[Boolean,String,Number]},label:{},disabled:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:n}){const a=t,r=n,i=e.computed(()=>a.modelValue===a.value),l=()=>{a.disabled||(r("update:modelValue",a.value),r("change",a.value))};return(s,d)=>(e.openBlock(),e.createElementBlock("div",{class:"cregis-radio__wrapper",onClick:l},[e.createElementVNode("div",{class:e.normalizeClass(["cregis-radio",{"is-disabled":t.disabled,"is-checked":i.value}])},[...d[0]||(d[0]=[e.createElementVNode("div",{class:"cregis-radio__inner"},null,-1)])],2),s.$slots.default||t.label?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["cregis-radio__label",{"is-disabled":t.disabled}])},[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)])],2)):e.createCommentVNode("",!0)]))}});h.install=t=>{t.component(h.name,h)};const k=e.defineComponent({name:"Divider",__name:"Divider",props:{direction:{default:"horizontal"},borderStyle:{default:"solid"},lineThickness:{default:"1px"},color:{default:"var(--line-module)"},margin:{default:"8px"},length:{}},setup(t){const n=t,a=e.computed(()=>{if(Array.isArray(n.margin)){const[i,l]=n.margin;return n.direction==="horizontal"?`${i} 0 ${l} 0`:`0 ${l} 0 ${i}`}else return n.direction==="horizontal"?`${n.margin} 0`:`0 ${n.margin}`}),r=e.computed(()=>n.direction==="horizontal"?{width:n.length||"100%",borderTopWidth:n.lineThickness,borderTopStyle:n.borderStyle,borderTopColor:n.color,margin:a.value}:{height:n.length||"1rem",borderLeftWidth:n.lineThickness,borderLeftStyle:n.borderStyle,borderLeftColor:n.color,margin:a.value});return(i,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cregis-divider",{[`cregis-divider--${t.direction}`]:t.direction}]),style:e.normalizeStyle(r.value)},null,6))}});k.install=t=>{t.component(k.name,k)};const x=Symbol("TABS_KEY"),H=["onClick"],J={style:{display:"none"}},p=e.defineComponent({name:"Tabs",__name:"Tabs",props:{modelValue:{},type:{default:"default"},size:{default:"medium"}},emits:["update:modelValue"],setup(t){const n=t,a=e.reactive([]),r=s=>{a.some(d=>d.name===s.name)||a.push(s)},i=s=>{const d=a.findIndex(b=>b.name===s);d!==-1&&a.splice(d,1)},l=e.computed(()=>n.type==="card"?n.size==="large"?{borderRadius:"13px"}:n.size==="medium"?{borderRadius:"11px"}:{borderRadius:"9px"}:{borderRadius:0});return e.provide(x,{activeName:e.toRef(n,"modelValue"),registerTab:r,unregisterTab:i}),(s,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cregis-tabs",{[`cregis-tabs--${t.type}`]:t.type,[`cregis-tabs--${t.size}`]:t.size}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,b=>(e.openBlock(),e.createElementBlock("div",{key:b.name,class:e.normalizeClass(["cregis-tabs__item",{"is-active":t.modelValue===b.name}]),style:e.normalizeStyle(l.value),onClick:B=>s.$emit("update:modelValue",b.name)},[e.createElementVNode("span",null,e.toDisplayString(b.label),1)],14,H))),128)),e.createElementVNode("div",J,[e.renderSlot(s.$slots,"default")])],2))}}),C=e.defineComponent({name:"TabPane",__name:"TabPane",props:{label:{},name:{}},setup(t){const n=t,a=e.inject(x);if(!a)throw new Error("TabPane must be used within Tabs");return e.onMounted(()=>{a.registerTab({label:n.label,name:n.name})}),e.watch(()=>n.label,r=>{a.unregisterTab(n.name),a.registerTab({label:r,name:n.name})}),e.onUnmounted(()=>{a.unregisterTab(n.name)}),()=>{}}});p.install=t=>{t.component(p.name,p)},C.install=t=>{t.component(C.name,C)};const Q=[g,f,y,h,k,p,C],w=t=>{Q.forEach(n=>{t.component(n.name,n)})},X={install:w};c.Button=f,c.Checkbox=y,c.Divider=k,c.Input=g,c.Radio=h,c.TabPane=C,c.Tabs=p,c.default=X,c.install=w,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
@@ -0,0 +1 @@
1
+ :root{--system-brand: display-p3 .1216 .7647 .3529;--system-error: display-p3 .8431 .2745 .1765;--system-decor: display-p3 .0078 .1765 .051;--same-black: 2 3 4;--same-white: 255 255 255;--foreground-face: 255 255 255;--foreground-base: 2 3 4;--module-line: 235 236 237;--page: 255 255 255}.dark{--system-brand: display-p3 .1216 .7647 .3529;--system-error: display-p3 .8431 .2745 .1765;--system-decor: display-p3 1 1 1;--same-black: 2 3 4;--same-white: 255 255 255;--foreground-face: 2 3 4;--foreground-base: 255 255 255;--module-line: 0 0 0;--page: 30 33 35}/*! minireset.css v0.0.6 | MIT License | github.com/jgthms/minireset.css */html,body,p,ol,ul,li,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr,h1,h2,h3,h4,h5,h6{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400}ul{list-style:none}button,input,select{margin:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}iframe{border:0}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}:root{--material-vibrant-brand-primary: color(var(--system-brand) / 1);--material-opaque-card-moderate: rgb(var(--foreground-base) / .05);--material-foreground-face-primary: rgb(var(--foreground-face) / 1);--material-foreground-face-quaternary: rgb(var(--foreground-face) / .2);--material-foreground-base-primary: rgb(var(--foreground-base) / 1);--material-foreground-base-secondary: rgb(var(--foreground-base) / .6);--material-foreground-base-quaternary: rgb(var(--foreground-base) / .2);--material-vibrant-error-primary: color(var(--system-error) / 1);--material-decor-primary: color(var(--system-decor) / 1);--material-same-white: rgb(var(--same-white) / 1);--material-opaque-hide: rgb(var(--foreground-base) / 0);--text-base-primary: rgb(var(--foreground-base) / 1);--text-base-secondary: rgb(var(--foreground-base) / .6);--text-base-tertiary: rgb(var(--foreground-base) / .4);--text-base-quaternary: rgb(var(--foreground-base) / .2);--text-face-primary: rgb(var(--foreground-face) / 1);--text-face-secondary: rgb(var(--foreground-face) / .6);--text-same-white: rgb(var(--same-white) / 1);--text-same-white-tap: rgb(var(--same-white) / .6);--text-same-black: rgb(var(--same-black) / 1);--text-same-black-tap: rgb(var(--same-black) / .6);--text-brand-tap: color(var(--system-brand) / .6);--text-brand-40: color(var(--system-brand) / .4);--text-brand-disabled: color(var(--system-brand) / .2);--text-error-tap: color(var(--system-error) / .6);--line-border-deep: rgb(var(--foreground-base) / .18);--line-module: rgb(var(--module-line) / 1);--event-hover-secondary: rgb(var(--foreground-base) / .05);--event-hover-tertiary: rgb(var(--page) / 1);--event-focus-secondary: rgb(var(--foreground-base) / .07)}.dark{--material-opaque-card-moderate: rgb(var(--foreground-base) / .07);--event-hover-secondary: rgb(var(--foreground-base) / .07);--event-focus-secondary: rgb(var(--foreground-base) / .1)}.cregis-input{width:100%;position:relative;display:inline-flex;font-size:15px;line-height:22px;box-sizing:border-box;vertical-align:middle;caret-color:var(--text-base-primary)}.cregis-input.is-disabled{cursor:not-allowed}.cregis-input.is-disabled .cregis-input__inner{color:var(--text-base-quaternary);cursor:not-allowed}.cregis-input__wrapper{position:relative;display:inline-flex;flex-grow:1;align-items:center;justify-content:center;padding:0 12px;background-color:var(--material-opaque-card-moderate);border-radius:6px;border:2px solid transparent}.cregis-input__wrapper.is-focus{border:2px solid var(--material-vibrant-brand-primary);border-radius:6px;background-color:var(--material-foreground-face-quaternary)}.cregis-input__wrapper.is-focus .cregis-input__inner::placeholder{color:var(--text-base-quaternary)}.cregis-input__inner{width:100%;min-width:20px;-webkit-appearance:none;font-size:inherit;padding:0;outline:none;border:none;background:none;box-sizing:border-box;color:var(--text-base-primary)}.cregis-input__inner::placeholder{color:var(--text-base-tertiary)}.cregis-input__inner::-webkit-outer-spin-button,.cregis-input__inner::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.cregis-input--small{height:32px}.cregis-input--medium{height:40px}.cregis-input--large{height:48px}.cregis-input__unit{color:var(--text-base-primary)}.cregis-input__prefix,.cregis-input__suffix{display:inline-flex;white-space:nowrap;flex-shrink:0;flex-wrap:nowrap;height:100%;text-align:center;align-items:center}.cregis-input__prefix>:first-child{margin-left:0!important}.cregis-input__prefix>:last-child{margin-right:8px!important}.cregis-input__suffix>:first-child{margin-left:8px!important}.cregis-input__suffix>:last-child{margin-right:0!important}.cregis-input__clear-button svg g path{fill:var(--material-foreground-base-secondary)}.cregis-input__clear-button:hover svg g path{fill:var(--material-foreground-base-primary)}.cregis-input__clear-button:active svg g path{fill:var(--material-foreground-base-secondary)}.cregis-textarea{position:relative}.cregis-textarea.is-disabled .cregis-textarea__wrapper{color:var(--text-base-quaternary);cursor:not-allowed}.cregis-textarea__wrapper{resize:none;position:relative;display:block;padding:12px;background-color:var(--material-opaque-card-moderate);border-radius:6px;border:2px solid transparent;box-sizing:border-box;width:100%;font-size:inherit;font-family:inherit;background-image:none;-webkit-appearance:none;caret-color:var(--text-base-primary);color:var(--text-base-primary)}.cregis-textarea__wrapper:focus{outline:none;border:2px solid var(--material-vibrant-brand-primary)}.cregis-textarea__wrapper:focus::placeholder{color:var(--text-base-quaternary)}.cregis-textarea__wrapper::placeholder{color:var(--text-base-tertiary)}.cregis-textarea__buttons{position:absolute;bottom:10px;left:12px;display:flex;gap:16px}.cregis-textarea__button{font-size:12px;font-weight:500;cursor:default;color:var(--material-vibrant-brand-primary)}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.cregis-button{display:inline-flex;justify-content:center;align-items:center;white-space:nowrap;text-align:center;box-sizing:border-box;outline:none;transition:.1s;font-weight:500;-webkit-user-select:none;user-select:none;vertical-align:middle;-webkit-appearance:none;color:var(--text-same-white);background-color:var(--material-vibrant-brand-primary);border:1px solid var(--material-vibrant-brand-primary);font-size:13px;border-radius:30px}.cregis-button:active{color:var(--text-same-white-tap)}.cregis-button.is-plain{color:var(--material-vibrant-brand-primary);background-color:var(--material-opaque-hide)}.cregis-button.is-plain:hover{color:var(--text-same-white);background-color:var(--material-vibrant-brand-primary)}.cregis-button.is-plain:active{color:var(--text-same-white-tap)}.cregis-button.is-text{color:var(--material-vibrant-brand-primary);background-color:var(--material-opaque-hide);border-color:transparent}.cregis-button.is-text:hover{background-color:var(--event-hover-secondary)}.cregis-button.is-text:active{color:var(--text-brand-tap)}.cregis-button.is-block{width:100%}:is(.cregis-button.is-plain.is-loading,.cregis-button.is-text.is-loading):hover{background-color:var(--material-opaque-hide)}.cregis-button .loading{animation:rotate 2s linear infinite}.cregis-button.is-affix{gap:4px}.cregis-button.is-affix svg g path{stroke:var(--text-same-white)}.cregis-button.is-affix span{color:var(--text-same-white)}.cregis-button.is-affix:active svg g path{stroke:var(--text-same-white-tap)}.cregis-button.is-affix:active span{color:var(--text-same-white-tap)}.cregis-button.is-affix.is-disabled span{color:var(--text-base-quaternary)}.cregis-button--secondary{background-color:var(--material-opaque-card-moderate);border-color:transparent;color:var(--text-base-primary)}.cregis-button--secondary:active{color:var(--text-base-secondary)}.cregis-button--secondary.is-plain{border:.5px solid var(--line-border-deep);color:var(--text-base-primary)}.cregis-button--secondary.is-plain:hover{border:.5px solid transparent;color:var(--text-base-primary);background-color:var(--material-opaque-card-moderate)}.cregis-button--secondary.is-plain.is-plain.is-loading{border:.5px solid var(--line-border-deep)}.cregis-button--secondary.is-plain:active{color:var(--text-base-secondary)}.cregis-button--secondary.is-text{color:var(--text-base-primary)}.cregis-button--secondary.is-text:active{color:var(--text-base-secondary)}.cregis-button--danger{background-color:var(--material-vibrant-error-primary);border-color:var(--material-vibrant-error-primary)}.cregis-button--danger.is-plain{color:var(--material-vibrant-error-primary)}.cregis-button--danger.is-plain:hover{background-color:var(--material-vibrant-error-primary)}.cregis-button--danger.is-text{color:var(--material-vibrant-error-primary)}.cregis-button--danger.is-text:active{color:var(--text-error-tap)}.cregis-button--foreground{background-color:var(--material-decor-primary);border-color:var(--material-decor-primary);color:var(--text-face-primary)}.cregis-button--foreground:active{color:var(--text-face-secondary)}.cregis-button--foreground.is-plain{color:var(--material-decor-primary)}.cregis-button--foreground.is-plain:hover{color:var(--text-face-primary);background-color:var(--material-decor-primary)}.cregis-button--foreground.is-plain:active{color:var(--text-face-secondary)}.cregis-button--sameWhite{background-color:var(--material-same-white);border-color:transparent;color:var(--text-same-black)}.cregis-button--sameWhite:active{color:var(--text-same-black-tap)}.cregis-button--large{padding:0 20px;height:40px;font-size:15px;line-height:22px}.cregis-button--medium{padding:0 16px;height:32px;font-size:13px;line-height:18px}.cregis-button--small{padding:0 12px;height:24px;font-size:13px;line-height:18px}.cregis-button--extraSmall{padding:0 12px;height:20px;font-size:12px;line-height:16px}:is(.cregis-button,.cregis-button--secondary,.cregis-button--danger,.cregis-button--foreground,.cregis-button--sameWhite).is-disabled{color:var(--text-base-quaternary);background-color:var(--material-opaque-card-moderate);border-color:transparent;cursor:not-allowed}:is(.cregis-button,.cregis-button--secondary,.cregis-button--danger,.cregis-button--foreground,.cregis-button--sameWhite).is-disabled svg g path{stroke:var(--material-foreground-base-quaternary)}:is(.cregis-button,.cregis-button--secondary,.cregis-button--danger,.cregis-button--foreground,.cregis-button--sameWhite).is-disabled:active svg g path{stroke:var(--material-foreground-base-quaternary)}:is(.cregis-button,.cregis-button--secondary,.cregis-button--danger,.cregis-button--foreground,.cregis-button--sameWhite).is-plain.is-disabled{border:.5px solid var(--line-border-deep);background-color:var(--material-opaque-hide)}:is(.cregis-button,.cregis-button--secondary,.cregis-button--danger,.cregis-button--foreground,.cregis-button--sameWhite).is-plain.is-disabled:hover{color:var(--text-base-quaternary)}:is(.cregis-button,.cregis-button--secondary,.cregis-button--danger,.cregis-button--foreground,.cregis-button--sameWhite).is-text.is-disabled{background-color:var(--material-opaque-hide);border-color:transparent}:is(.cregis-button,.cregis-button--secondary,.cregis-button--danger,.cregis-button--foreground,.cregis-button--sameWhite).is-text.is-disabled:active{color:var(--text-base-quaternary)}.cregis-button__link{border:none;border-bottom:1px dashed var(--material-opaque-hide);background-color:var(--material-opaque-hide);color:var(--material-vibrant-brand-primary);font-weight:500;padding:0}.cregis-button__link:hover{border-bottom:1px dashed var(--text-brand-40)}.cregis-button__link:active{border-bottom:1px dashed var(--text-brand-disabled);color:var(--text-brand-tap)}.cregis-button__link.is-disabled{color:var(--text-base-quaternary);border-color:transparent;cursor:not-allowed}.cregis-button__link--foreground{color:var(--text-base-primary)}.cregis-button__link--foreground:hover{border-bottom:1px dashed var(--text-base-tertiary)}.cregis-button__link--foreground:active{border-bottom:1px dashed var(--text-base-quaternary);color:var(--text-base-secondary)}.cregis-button__link--foreground.is-disabled{color:var(--text-base-quaternary);border-color:transparent}.cregis-button__link--large{font-size:15px}.cregis-button__link--medium{font-size:13px}.cregis-button__link--small,.cregis-button__link--extraSmall{font-size:12px}.cregis-button__icon-wrapper{display:flex;flex-direction:column;align-items:center}.cregis-button__icon{display:flex;justify-content:center;align-items:center;border-color:transparent;background-color:var(--material-opaque-hide);padding:0;border-radius:6px}.cregis-button__icon svg g path{stroke:var(--material-foreground-base-secondary)}.cregis-button__icon:hover{background-color:var(--event-hover-secondary)}.cregis-button__icon:hover svg g path{stroke:var(--material-foreground-base-primary)}.cregis-button__icon:active{background-color:var(--event-focus-secondary)}.cregis-button__icon:active svg g path{stroke:var(--material-foreground-base-secondary)}.cregis-button__icon.is-disabled{cursor:not-allowed}.cregis-button__icon.is-disabled svg g path{stroke:var(--material-foreground-base-quaternary)}.cregis-button__icon.is-disabled:hover{background-color:var(--material-opaque-hide)}.cregis-button__icon--rectangle.cregis-button__icon--large{width:36px;height:28px}.cregis-button__icon--rectangle.cregis-button__icon--medium{width:32px;height:24px}.cregis-button__icon--rectangle.cregis-button__icon--small,.cregis-button__icon--rectangle.cregis-button__icon--extraSmall{width:26px;height:20px}:is(.cregis-button__icon--square,.cregis-button__icon--circle).cregis-button__icon--large{width:28px;height:28px}:is(.cregis-button__icon--square,.cregis-button__icon--circle).cregis-button__icon--medium{width:24px;height:24px}:is(.cregis-button__icon--square,.cregis-button__icon--circle).cregis-button__icon--small,:is(.cregis-button__icon--square,.cregis-button__icon--circle).cregis-button__icon--extraSmall{width:20px;height:20px}.cregis-button__icon--circle{border-radius:50%}.cregis-button__icon--professional{width:32px;height:24px}.cregis-button__icon-text{font-size:11px;line-height:14px;font-weight:500;color:var(--text-base-secondary)}.cregis-button__icon-text.is-disabled{cursor:not-allowed;color:var(--text-base-quaternary)}.cregis-checkbox__wrapper{width:fit-content;display:flex;align-items:center;gap:8px;cursor:default;-webkit-user-select:none;user-select:none}.cregis-checkbox{width:16px;height:16px;border:1px solid var(--line-border-deep);border-radius:4px;display:flex;align-items:center;justify-content:center}.cregis-checkbox svg{visibility:hidden}.cregis-checkbox:hover svg{color:var(--line-border-deep);visibility:visible}.cregis-checkbox.is-checked,.cregis-checkbox.is-indeterminate{border:1px solid var(--material-vibrant-brand-primary)!important;background-color:var(--material-vibrant-brand-primary)!important}:is(.cregis-checkbox.is-checked,.cregis-checkbox.is-indeterminate) svg{visibility:visible!important;color:var(--material-same-white)}.cregis-checkbox.is-circle{border-radius:50%}.cregis-checkbox.is-disabled{cursor:not-allowed;background-color:var(--material-opaque-card-moderate)}.cregis-checkbox.is-disabled:hover svg{visibility:hidden}.cregis-checkbox.is-checked.is-disabled{opacity:.6}.cregis-checkbox__label{font-size:15px;font-weight:500;color:var(--text-base-secondary)}.cregis-checkbox__label.is-disabled{cursor:not-allowed}.cregis-checkbox--indeterminate{width:8px;height:1.5px;border-radius:1px;background-color:var(--material-same-white)}.cregis-radio__wrapper{width:fit-content;display:flex;align-items:center;gap:8px;cursor:default;-webkit-user-select:none;user-select:none}.cregis-radio{width:16px;height:16px;border:1px solid var(--line-border-deep);border-radius:50%;display:flex;align-items:center;justify-content:center}.cregis-radio:hover .cregis-radio__inner{visibility:visible}.cregis-radio.is-checked{border:1px solid var(--material-vibrant-brand-primary)!important;background-color:var(--material-vibrant-brand-primary)!important}.cregis-radio.is-checked .cregis-radio__inner{visibility:visible!important;background-color:var(--text-same-white)}.cregis-radio.is-disabled{cursor:not-allowed;background-color:var(--material-opaque-card-moderate)}.cregis-radio.is-disabled:hover .cregis-radio__inner{visibility:hidden}.cregis-radio.is-checked.is-disabled{opacity:.6}.cregis-radio__inner{width:6px;height:6px;border-radius:50%;background-color:var(--material-foreground-base-quaternary);visibility:hidden}.cregis-radio__label{font-size:15px;font-weight:500;color:var(--text-base-secondary)}.cregis-radio__label.is-disabled{cursor:not-allowed}.cregis-divider{display:flex;align-items:center}.cregis-divider--horizontal{flex-direction:row}.cregis-divider--vertical{flex-direction:column}.cregis-tabs{display:flex;gap:16px;width:fit-content;height:29px;font-size:13px;font-weight:500;color:var(--text-base-primary);cursor:default}.cregis-tabs__item{border-bottom:2px solid var(--material-opaque-hide);transition:color .2s ease,border-color .2s ease}.cregis-tabs__item.is-active{color:var(--material-vibrant-brand-primary);border-bottom:2px solid var(--material-vibrant-brand-primary)}.cregis-tabs--large{height:33px;font-size:15px}.cregis-tabs--small{height:28px;font-size:12px}.cregis-tabs--card{height:28px;background-color:var(--material-opaque-card-moderate);border-radius:14px;padding:3px;font-size:12px;gap:6px}.cregis-tabs--card.cregis-tabs--large{height:32px;border-radius:16px}.cregis-tabs--card.cregis-tabs--small{height:24px;border-radius:12px}.cregis-tabs--card .cregis-tabs__item{display:flex;align-items:center;justify-content:center;border:none;padding:0 6px}.cregis-tabs--card .cregis-tabs__item.is-active{color:var(--text-base-primary);background-color:var(--event-hover-tertiary)}
Binary file
package/package.json CHANGED
@@ -1,56 +1,79 @@
1
- {
2
- "name": "@cregis/ui",
3
- "version": "0.0.3",
4
- "main": "dist/index.umd.js",
5
- "module": "dist/index.es.js",
6
- "exports": {
7
- ".": {
8
- "import": "./dist/index.es.js",
9
- "require": "./dist/index.umd.js"
10
- }
11
- },
12
- "types": "dist/types/index.d.ts",
13
- "files": [
14
- "dist"
15
- ],
16
- "publishConfig": {
17
- "access": "public"
18
- },
19
- "scripts": {
20
- "dev": "vite",
21
- "build": "run-p type-check build-only",
22
- "preview": "vite preview --port 4173",
23
- "build-only": "vite build",
24
- "build:components": "vue-tsc -b && vite build --config vite.components.config.ts",
25
- "type-check": "vue-tsc --noEmit",
26
- "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
27
- },
28
- "dependencies": {
29
- "@cregis/color": "^0.0.3"
30
- },
31
- "devDependencies": {
32
- "@rushstack/eslint-patch": "^1.1.4",
33
- "@types/node": "^16.11.56",
34
- "@vitejs/plugin-vue": "^3.0.3",
35
- "@vitejs/plugin-vue-jsx": "^2.0.1",
36
- "@vue/eslint-config-prettier": "^7.0.0",
37
- "@vue/eslint-config-typescript": "^11.0.0",
38
- "@vue/tsconfig": "^0.1.3",
39
- "eslint": "^8.22.0",
40
- "eslint-plugin-vue": "^9.3.0",
41
- "less": "^4.2.2",
42
- "npm-run-all": "^4.1.5",
43
- "prettier": "^2.7.1",
44
- "tailwindcss": "3",
45
- "typescript": "~5.7.2",
46
- "vite": "^3.0.9",
47
- "vite-plugin-dts": "^4.5.3",
48
- "vue-tsc": "^2.2.4",
49
- "autoprefixer": "^10.4.21",
50
- "pinia": "^2.0.21",
51
- "vue-router": "^4.1.5"
52
- },
53
- "peerDependencies": {
54
- "vue": "^3.2.0"
55
- }
56
- }
1
+ {
2
+ "name": "@cregis/ui",
3
+ "private": false,
4
+ "version": "0.1.0",
5
+ "type": "module",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "sideEffects": [
10
+ "dist/index.css"
11
+ ],
12
+ "main": "./dist/umd/cregis-ui.umd.cjs",
13
+ "module": "./dist/es/cregis-ui.js",
14
+ "types": "./dist/types/index.d.ts",
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/types/index.d.ts",
18
+ "import": "./dist/es/cregis-ui.js",
19
+ "require": "./dist/umd/cregis-ui.umd.cjs"
20
+ },
21
+ "./dist/": {
22
+ "import": "./dist/",
23
+ "require": "./dist/"
24
+ }
25
+ },
26
+ "scripts": {
27
+ "dev": "vite --host",
28
+ "build": "npm run build-only && npm run move-style",
29
+ "build-only": "run-p build-es build-umd",
30
+ "build-umd": "vite build --config vite.umd.config.ts",
31
+ "build-es": "vite build --config vite.es.config.ts",
32
+ "move-style": "move-file dist/es/index.css dist/index.css",
33
+ "preview": "vite preview",
34
+ "prepare": "husky install"
35
+ },
36
+ "peerDependencies": {
37
+ "@cregis/icon": "^0.1.10",
38
+ "vue": "^3.5.0"
39
+ },
40
+ "devDependencies": {
41
+ "@commitlint/cli": "^20.1.0",
42
+ "@commitlint/config-conventional": "^20.0.0",
43
+ "@cregis/icon": "^0.1.14",
44
+ "@rushstack/eslint-patch": "^1.14.1",
45
+ "@types/node": "^24.6.0",
46
+ "@vitejs/plugin-vue": "^6.0.1",
47
+ "@vue/eslint-config-typescript": "^14.6.0",
48
+ "@vue/tsconfig": "^0.8.1",
49
+ "husky": "^9.1.7",
50
+ "lint-staged": "^16.2.6",
51
+ "move-file-cli": "^3.0.0",
52
+ "npm-run-all": "^4.1.5",
53
+ "prettier": "^3.6.2",
54
+ "stylelint": "^16.25.0",
55
+ "stylelint-config-standard": "^39.0.1",
56
+ "typescript": "~5.9.3",
57
+ "vite": "^7.1.7",
58
+ "vite-plugin-dts": "^4.5.4",
59
+ "vue": "^3.5.24",
60
+ "vue-tsc": "^3.1.0"
61
+ },
62
+ "husky": {
63
+ "hooks": {
64
+ "pre-commit": "lint-staged",
65
+ "commit-msg": "commitlint --config .commitlintrc.cjs -E HUSKY_GIT_PARAMS"
66
+ }
67
+ },
68
+ "lint-staged": {
69
+ "*.{ts,tsx,js,jsx}": [
70
+ "eslint --config .eslintrc.cjs"
71
+ ],
72
+ "*.{css,less,scss}": [
73
+ "stylelint --config .stylelintrc.cjs"
74
+ ],
75
+ "*.{ts,tsx,js,json,html,yml,css,less,scss,md}": [
76
+ "prettier --write"
77
+ ]
78
+ }
79
+ }
@@ -1,28 +0,0 @@
1
- import { Props } from './button';
2
- declare function __VLS_template(): {
3
- attrs: Partial<{}>;
4
- slots: {
5
- default?(_: {}): any;
6
- };
7
- refs: {};
8
- rootEl: HTMLButtonElement;
9
- };
10
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
- declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
12
- click: (...args: any[]) => void;
13
- }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
14
- onClick?: ((...args: any[]) => any) | undefined;
15
- }>, {
16
- size: "minimum" | "small" | "middle" | "large";
17
- type: "primary" | "cancel" | "failure" | "success" | "text" | "hollow" | "tint";
18
- loading: boolean;
19
- disabled: boolean;
20
- fit: boolean;
21
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
22
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
23
- export default _default;
24
- type __VLS_WithTemplateSlots<T, S> = T & {
25
- new (): {
26
- $slots: S;
27
- };
28
- };
@@ -1,8 +0,0 @@
1
- export interface Props {
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,7 +0,0 @@
1
- import { SFCWithInstall } from '../utils/install';
2
- import { default as Button } from './Button.vue';
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 };
@@ -1,2 +0,0 @@
1
- export * from './button';
2
- export * from './icon';
@@ -1 +0,0 @@
1
- export * from './static';
@@ -1,2 +0,0 @@
1
- import { default as ButtonLoading } from './ButtonLoading.vue';
2
- export { ButtonLoading };
@@ -1,7 +0,0 @@
1
- interface Props {
2
- size?: string;
3
- }
4
- declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
5
- size: string;
6
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, SVGSVGElement>;
7
- export default _default;
@@ -1 +0,0 @@
1
- export * from './ButtonLoading.vue';
@@ -1,6 +0,0 @@
1
- import { App } from 'vue';
2
- export declare const install: (app: App) => void;
3
- declare const _default: {
4
- install: (app: App) => void;
5
- };
6
- export default _default;
@@ -1,10 +0,0 @@
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>;