dirdoc-ui 1.0.2 → 1.0.4
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.cjs.js +36 -13
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.esm.js +36 -13
- package/dist/index.esm.js.map +1 -1
- package/dist/styles.css +432 -0
- package/dist/types/components/DButton/DButton.d.ts +9 -2
- package/dist/types/index.d.ts +1 -0
- package/package.json +3 -2
package/dist/index.cjs.js
CHANGED
|
@@ -10,7 +10,7 @@ var DButton = vue.defineComponent({
|
|
|
10
10
|
required: false,
|
|
11
11
|
default: ''
|
|
12
12
|
},
|
|
13
|
-
|
|
13
|
+
uri: {
|
|
14
14
|
type: String,
|
|
15
15
|
required: false,
|
|
16
16
|
default: ''
|
|
@@ -21,7 +21,7 @@ var DButton = vue.defineComponent({
|
|
|
21
21
|
},
|
|
22
22
|
variant: {
|
|
23
23
|
type: String,
|
|
24
|
-
default: '
|
|
24
|
+
default: 'default'
|
|
25
25
|
},
|
|
26
26
|
disabled: {
|
|
27
27
|
type: Boolean,
|
|
@@ -31,41 +31,64 @@ var DButton = vue.defineComponent({
|
|
|
31
31
|
type: [String, Object, Function],
|
|
32
32
|
default: null
|
|
33
33
|
},
|
|
34
|
+
prepend: {
|
|
35
|
+
type: [String, Object, Function],
|
|
36
|
+
default: null
|
|
37
|
+
},
|
|
38
|
+
append: {
|
|
39
|
+
type: [String, Object, Function],
|
|
40
|
+
default: null,
|
|
41
|
+
},
|
|
34
42
|
},
|
|
35
43
|
emits: ['click'],
|
|
36
44
|
setup(props, ctx) {
|
|
37
45
|
const { slots, emit } = ctx;
|
|
38
|
-
const base = '
|
|
39
|
-
const icon = 'flex items-center justify-center w-10 h-10
|
|
46
|
+
const base = 'justify-center py-2 px-4 rounded-full cursor-pointer focus:outline-none';
|
|
47
|
+
const icon = 'flex items-center justify-center w-10 h-10 bg-[var(--color-surface-container)] cursor-pointer rounded-full ';
|
|
40
48
|
const variants = {
|
|
41
|
-
|
|
42
|
-
|
|
49
|
+
default: 'bg-[var(--color-surface-container)] text-[var(--color-inverse-surface)] hover:brightness-98',
|
|
50
|
+
outlined: 'bg-transparent border border-1 border-solid border-black',
|
|
43
51
|
};
|
|
44
52
|
function onClick(e) {
|
|
45
53
|
if (props.disabled)
|
|
46
54
|
return;
|
|
47
55
|
emit('click', e);
|
|
48
56
|
}
|
|
57
|
+
function renderIcon(iconProp, type) {
|
|
58
|
+
const marginClass = type === 'prepend' ? 'mr-2' : type === 'append' ? 'ml-2' : '';
|
|
59
|
+
if (!iconProp)
|
|
60
|
+
return null;
|
|
61
|
+
return typeof iconProp === 'string' ? vue.h('i', { class: `${iconProp} mdi ${marginClass}` }) : vue.h(iconProp, { class: marginClass });
|
|
62
|
+
}
|
|
49
63
|
return () => {
|
|
50
64
|
const children = slots.default ? slots.default() : props.label;
|
|
65
|
+
const prependIcon = renderIcon(props.prepend, 'prepend');
|
|
66
|
+
const appendIcon = renderIcon(props.append, 'append');
|
|
51
67
|
if (props.icon) {
|
|
52
|
-
return vue.h(props.
|
|
68
|
+
return vue.h(props.uri ? 'a' : 'button', {
|
|
53
69
|
type: props.type,
|
|
54
70
|
class: `${icon} ${variants[props.variant]} ${props.disabled ? '' : ''} focus:outline-none`,
|
|
55
71
|
disabled: props.disabled,
|
|
56
|
-
href: props.
|
|
72
|
+
href: props.uri,
|
|
57
73
|
onClick,
|
|
58
74
|
}, [
|
|
75
|
+
prependIcon,
|
|
59
76
|
typeof props.icon === 'string' ? vue.h('i', { class: props.icon + ' mdi' }) : vue.h(props.icon),
|
|
77
|
+
appendIcon,
|
|
60
78
|
children
|
|
61
|
-
]);
|
|
79
|
+
].filter(Boolean));
|
|
62
80
|
}
|
|
63
|
-
return vue.h(props.
|
|
81
|
+
return vue.h(props.uri ? 'button' : 'button', {
|
|
64
82
|
type: props.type,
|
|
65
|
-
class: `${base} ${variants[props.variant]} ${props.disabled ? '
|
|
83
|
+
class: `${base} ${variants[props.variant]} ${props.disabled ? '' : ''}`,
|
|
66
84
|
disabled: props.disabled,
|
|
85
|
+
href: props.uri,
|
|
67
86
|
onClick
|
|
68
|
-
},
|
|
87
|
+
}, [
|
|
88
|
+
prependIcon,
|
|
89
|
+
children,
|
|
90
|
+
appendIcon
|
|
91
|
+
].filter(Boolean));
|
|
69
92
|
};
|
|
70
93
|
}
|
|
71
94
|
});
|
|
@@ -84,7 +107,7 @@ var DSkeletonLoader = vue.defineComponent({
|
|
|
84
107
|
},
|
|
85
108
|
setup(props, ctx) {
|
|
86
109
|
const { slots } = ctx;
|
|
87
|
-
const base = 'bg-gray-
|
|
110
|
+
const base = 'bg-gray-50 dark:bg-gray-100';
|
|
88
111
|
const animations = {
|
|
89
112
|
pulse: 'animate-pulse',
|
|
90
113
|
wave: 'animate-wave'
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/components/DButton/DButton.tsx","../src/components/DSkeleton/DSkeletonLoader.tsx","../src/index.ts"],"sourcesContent":["import { defineComponent, h, PropType, SetupContext, VNode } from 'vue'\
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/components/DButton/DButton.tsx","../src/components/DSkeleton/DSkeletonLoader.tsx","../src/index.ts"],"sourcesContent":["import { defineComponent, h, PropType, SetupContext, VNode } from 'vue'\nimport '../styles/style.css'\nexport interface UseLink {\n navigate: () => void | null\n}\nexport default defineComponent({\n name: 'DButton',\n props: {\n label: {\n type: String as PropType<string>,\n required: false,\n default: ''\n },\n uri: {\n type: String as PropType<string>,\n required: false,\n default: ''\n },\n type: {\n type: String as PropType<'button' | 'submit' | 'reset'>,\n default: 'button'\n },\n variant: {\n type: String as PropType<'default' | 'outlined'>,\n default: 'default'\n },\n disabled: {\n type: Boolean as PropType<boolean>,\n default: false\n },\n icon: {\n type: [String, Object, Function] as PropType<string | object | (() => VNode) | VNode | null>,\n default: null\n },\n prepend: {\n type: [String, Object, Function] as PropType<string | object | (() => VNode) | VNode | null>,\n default: null\n },\n append:{\n type: [String, Object, Function] as PropType<string | object | (() => VNode) | VNode | null>,\n default: null,\n },\n },\n emits: ['click'],\n setup(props: Record<string, any>, ctx: SetupContext) {\n const { slots, emit } = ctx\n const base = 'justify-center py-2 px-4 rounded-full cursor-pointer focus:outline-none'\n const icon = 'flex items-center justify-center w-10 h-10 bg-[var(--color-surface-container)] cursor-pointer rounded-full '\n const variants: Record<string, string> = {\n default: 'bg-[var(--color-surface-container)] text-[var(--color-inverse-surface)] hover:brightness-98',\n outlined: 'bg-transparent border border-1 border-solid border-black',\n }\n\n function onClick(e: MouseEvent) {\n if (props.disabled) return\n emit('click', e)\n }\n function renderIcon(iconProp: any, type?: 'prepend' | 'append'): VNode | null {\n const marginClass = type === 'prepend' ? 'mr-2' : type === 'append' ? 'ml-2' : ''\n if (!iconProp) return null\n return typeof iconProp === 'string' ? h('i', { class: `${iconProp} mdi ${marginClass}`}) : h(iconProp, { class: marginClass })\n }\n\n return (): VNode => {\n const children = slots.default ? slots.default() : props.label\n const prependIcon = renderIcon(props.prepend, 'prepend')\n const appendIcon = renderIcon(props.append, 'append')\n if (props.icon) {\n return h(\n props.uri ? 'a' : 'button',\n {\n type: props.type,\n class: `${icon} ${variants[props.variant]} ${props.disabled ? '' : ''} focus:outline-none`,\n disabled: props.disabled,\n href: props.uri,\n onClick,\n },\n [\n prependIcon,\n typeof props.icon === 'string' ? h('i', { class: props.icon + ' mdi' }, ) : h(props.icon),\n appendIcon,\n children\n ].filter(Boolean)\n )\n }\n \n return h(\n props.uri ? 'button' : 'button',\n {\n type: props.type,\n class: `${base} ${variants[props.variant]} ${props.disabled ? '' : ''}`,\n disabled: props.disabled,\n href: props.uri,\n onClick\n },\n [\n prependIcon,\n children,\n appendIcon\n ].filter(Boolean)\n )\n }\n }\n})\n","import { defineComponent, PropType, h, SetupContext, VNode } from 'vue'\nexport default defineComponent({\n name: 'DSkeletonLoader',\n props: {\n animation: {\n type: String as PropType<'pulse' | 'wave'>, \n default: 'pulse'\n },\n type: {\n type: String as PropType<'text' | 'circle' | 'avatar'>,\n default: 'text'\n }\n },\n \n\n setup(props: Record<string, any>, ctx: SetupContext) {\n const { slots } = ctx\n\n const base = 'bg-gray-50 dark:bg-gray-100'\n const animations: Record<string, string> = {\n pulse: 'animate-pulse',\n wave: 'animate-wave'\n }\n const types: Record<string, string> = {\n text: 'rounded-full w-full p-2',\n circle: 'rounded-full',\n avatar: 'rounded-full w-10 h-10 ',\n }\n const children = slots.default ? slots.default() : props.label\n\n return (): VNode => {\n return h(\n children ? 'div' :\n 'div',\n {\n class: `${animations[props.animation]} `,\n },\n [\n h('div', { class: ` ${base} ${types[props.type]}` }),\n ],\n \n \n )\n }\n}\n\n})\n","export * from './components/DButton'\nexport * from './components/DSkeleton'\nexport interface UIOptions {\n components?: Record<string, any>\n}\n\nexport function createDirdocUI( options: UIOptions = {}) {\n const { components = {} } = options\n\n return {\n install(app: any) {\n for (const key in components) {\n app.component(key, components[key])\n }\n }\n }\n}\n\nimport './components/styles/style.css'"],"names":["defineComponent","h"],"mappings":";;;;AAKA,cAAeA,mBAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,KAAK,EAAE;AACL,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,KAAK;AACf,YAAA,OAAO,EAAE;AACV,SAAA;AACD,QAAA,GAAG,EAAE;AACH,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,KAAK;AACf,YAAA,OAAO,EAAE;AACV,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,IAAI,EAAE,MAAiD;AACvD,YAAA,OAAO,EAAE;AACV,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,IAAI,EAAE,MAA0C;AAChD,YAAA,OAAO,EAAE;AACV,SAAA;AACD,QAAA,QAAQ,EAAE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CAAG;aACzC,EACD;AACE,gBAAAA,KAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAA,CAAA,EAAI,IAAI,CAAA,CAAA,EAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA,CAAE,EAAE,CAAC;AACrD,aAAA,CAGF;AACH,QAAA,CAAC;IACL;AAEC,CAAA,CAAC;;ACxCI,SAAU,cAAc,CAAE,OAAA,GAAqB,EAAE,EAAA;AACnD,IAAA,MAAM,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,OAAO;IAEnC,OAAO;AACH,QAAA,OAAO,CAAC,GAAQ,EAAA;AACZ,YAAA,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;gBAC1B,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;YACvC;QACJ;KACH;AACL;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,13 +7,19 @@ declare const _default$1: vue.DefineComponent<{
|
|
|
7
7
|
[x: string]: /*elided*/ any;
|
|
8
8
|
}> & Readonly<{}>, {
|
|
9
9
|
label: string;
|
|
10
|
-
|
|
10
|
+
uri: string;
|
|
11
11
|
type: "button" | "submit" | "reset";
|
|
12
|
-
variant: "
|
|
12
|
+
variant: "default" | "outlined";
|
|
13
13
|
disabled: boolean;
|
|
14
14
|
icon: string | object | (() => VNode) | VNode<vue.RendererNode, vue.RendererElement, {
|
|
15
15
|
[key: string]: any;
|
|
16
16
|
}> | null;
|
|
17
|
+
prepend: string | object | VNode<vue.RendererNode, vue.RendererElement, {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}> | (() => VNode) | null;
|
|
20
|
+
append: string | object | VNode<vue.RendererNode, vue.RendererElement, {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
}> | (() => VNode) | null;
|
|
17
23
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
18
24
|
|
|
19
25
|
declare const _default: vue.DefineComponent<{
|
package/dist/index.esm.js
CHANGED
|
@@ -8,7 +8,7 @@ var DButton = defineComponent({
|
|
|
8
8
|
required: false,
|
|
9
9
|
default: ''
|
|
10
10
|
},
|
|
11
|
-
|
|
11
|
+
uri: {
|
|
12
12
|
type: String,
|
|
13
13
|
required: false,
|
|
14
14
|
default: ''
|
|
@@ -19,7 +19,7 @@ var DButton = defineComponent({
|
|
|
19
19
|
},
|
|
20
20
|
variant: {
|
|
21
21
|
type: String,
|
|
22
|
-
default: '
|
|
22
|
+
default: 'default'
|
|
23
23
|
},
|
|
24
24
|
disabled: {
|
|
25
25
|
type: Boolean,
|
|
@@ -29,41 +29,64 @@ var DButton = defineComponent({
|
|
|
29
29
|
type: [String, Object, Function],
|
|
30
30
|
default: null
|
|
31
31
|
},
|
|
32
|
+
prepend: {
|
|
33
|
+
type: [String, Object, Function],
|
|
34
|
+
default: null
|
|
35
|
+
},
|
|
36
|
+
append: {
|
|
37
|
+
type: [String, Object, Function],
|
|
38
|
+
default: null,
|
|
39
|
+
},
|
|
32
40
|
},
|
|
33
41
|
emits: ['click'],
|
|
34
42
|
setup(props, ctx) {
|
|
35
43
|
const { slots, emit } = ctx;
|
|
36
|
-
const base = '
|
|
37
|
-
const icon = 'flex items-center justify-center w-10 h-10
|
|
44
|
+
const base = 'justify-center py-2 px-4 rounded-full cursor-pointer focus:outline-none';
|
|
45
|
+
const icon = 'flex items-center justify-center w-10 h-10 bg-[var(--color-surface-container)] cursor-pointer rounded-full ';
|
|
38
46
|
const variants = {
|
|
39
|
-
|
|
40
|
-
|
|
47
|
+
default: 'bg-[var(--color-surface-container)] text-[var(--color-inverse-surface)] hover:brightness-98',
|
|
48
|
+
outlined: 'bg-transparent border border-1 border-solid border-black',
|
|
41
49
|
};
|
|
42
50
|
function onClick(e) {
|
|
43
51
|
if (props.disabled)
|
|
44
52
|
return;
|
|
45
53
|
emit('click', e);
|
|
46
54
|
}
|
|
55
|
+
function renderIcon(iconProp, type) {
|
|
56
|
+
const marginClass = type === 'prepend' ? 'mr-2' : type === 'append' ? 'ml-2' : '';
|
|
57
|
+
if (!iconProp)
|
|
58
|
+
return null;
|
|
59
|
+
return typeof iconProp === 'string' ? h('i', { class: `${iconProp} mdi ${marginClass}` }) : h(iconProp, { class: marginClass });
|
|
60
|
+
}
|
|
47
61
|
return () => {
|
|
48
62
|
const children = slots.default ? slots.default() : props.label;
|
|
63
|
+
const prependIcon = renderIcon(props.prepend, 'prepend');
|
|
64
|
+
const appendIcon = renderIcon(props.append, 'append');
|
|
49
65
|
if (props.icon) {
|
|
50
|
-
return h(props.
|
|
66
|
+
return h(props.uri ? 'a' : 'button', {
|
|
51
67
|
type: props.type,
|
|
52
68
|
class: `${icon} ${variants[props.variant]} ${props.disabled ? '' : ''} focus:outline-none`,
|
|
53
69
|
disabled: props.disabled,
|
|
54
|
-
href: props.
|
|
70
|
+
href: props.uri,
|
|
55
71
|
onClick,
|
|
56
72
|
}, [
|
|
73
|
+
prependIcon,
|
|
57
74
|
typeof props.icon === 'string' ? h('i', { class: props.icon + ' mdi' }) : h(props.icon),
|
|
75
|
+
appendIcon,
|
|
58
76
|
children
|
|
59
|
-
]);
|
|
77
|
+
].filter(Boolean));
|
|
60
78
|
}
|
|
61
|
-
return h(props.
|
|
79
|
+
return h(props.uri ? 'button' : 'button', {
|
|
62
80
|
type: props.type,
|
|
63
|
-
class: `${base} ${variants[props.variant]} ${props.disabled ? '
|
|
81
|
+
class: `${base} ${variants[props.variant]} ${props.disabled ? '' : ''}`,
|
|
64
82
|
disabled: props.disabled,
|
|
83
|
+
href: props.uri,
|
|
65
84
|
onClick
|
|
66
|
-
},
|
|
85
|
+
}, [
|
|
86
|
+
prependIcon,
|
|
87
|
+
children,
|
|
88
|
+
appendIcon
|
|
89
|
+
].filter(Boolean));
|
|
67
90
|
};
|
|
68
91
|
}
|
|
69
92
|
});
|
|
@@ -82,7 +105,7 @@ var DSkeletonLoader = defineComponent({
|
|
|
82
105
|
},
|
|
83
106
|
setup(props, ctx) {
|
|
84
107
|
const { slots } = ctx;
|
|
85
|
-
const base = 'bg-gray-
|
|
108
|
+
const base = 'bg-gray-50 dark:bg-gray-100';
|
|
86
109
|
const animations = {
|
|
87
110
|
pulse: 'animate-pulse',
|
|
88
111
|
wave: 'animate-wave'
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/components/DButton/DButton.tsx","../src/components/DSkeleton/DSkeletonLoader.tsx","../src/index.ts"],"sourcesContent":["import { defineComponent, h, PropType, SetupContext, VNode } from 'vue'\
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/components/DButton/DButton.tsx","../src/components/DSkeleton/DSkeletonLoader.tsx","../src/index.ts"],"sourcesContent":["import { defineComponent, h, PropType, SetupContext, VNode } from 'vue'\nimport '../styles/style.css'\nexport interface UseLink {\n navigate: () => void | null\n}\nexport default defineComponent({\n name: 'DButton',\n props: {\n label: {\n type: String as PropType<string>,\n required: false,\n default: ''\n },\n uri: {\n type: String as PropType<string>,\n required: false,\n default: ''\n },\n type: {\n type: String as PropType<'button' | 'submit' | 'reset'>,\n default: 'button'\n },\n variant: {\n type: String as PropType<'default' | 'outlined'>,\n default: 'default'\n },\n disabled: {\n type: Boolean as PropType<boolean>,\n default: false\n },\n icon: {\n type: [String, Object, Function] as PropType<string | object | (() => VNode) | VNode | null>,\n default: null\n },\n prepend: {\n type: [String, Object, Function] as PropType<string | object | (() => VNode) | VNode | null>,\n default: null\n },\n append:{\n type: [String, Object, Function] as PropType<string | object | (() => VNode) | VNode | null>,\n default: null,\n },\n },\n emits: ['click'],\n setup(props: Record<string, any>, ctx: SetupContext) {\n const { slots, emit } = ctx\n const base = 'justify-center py-2 px-4 rounded-full cursor-pointer focus:outline-none'\n const icon = 'flex items-center justify-center w-10 h-10 bg-[var(--color-surface-container)] cursor-pointer rounded-full '\n const variants: Record<string, string> = {\n default: 'bg-[var(--color-surface-container)] text-[var(--color-inverse-surface)] hover:brightness-98',\n outlined: 'bg-transparent border border-1 border-solid border-black',\n }\n\n function onClick(e: MouseEvent) {\n if (props.disabled) return\n emit('click', e)\n }\n function renderIcon(iconProp: any, type?: 'prepend' | 'append'): VNode | null {\n const marginClass = type === 'prepend' ? 'mr-2' : type === 'append' ? 'ml-2' : ''\n if (!iconProp) return null\n return typeof iconProp === 'string' ? h('i', { class: `${iconProp} mdi ${marginClass}`}) : h(iconProp, { class: marginClass })\n }\n\n return (): VNode => {\n const children = slots.default ? slots.default() : props.label\n const prependIcon = renderIcon(props.prepend, 'prepend')\n const appendIcon = renderIcon(props.append, 'append')\n if (props.icon) {\n return h(\n props.uri ? 'a' : 'button',\n {\n type: props.type,\n class: `${icon} ${variants[props.variant]} ${props.disabled ? '' : ''} focus:outline-none`,\n disabled: props.disabled,\n href: props.uri,\n onClick,\n },\n [\n prependIcon,\n typeof props.icon === 'string' ? h('i', { class: props.icon + ' mdi' }, ) : h(props.icon),\n appendIcon,\n children\n ].filter(Boolean)\n )\n }\n \n return h(\n props.uri ? 'button' : 'button',\n {\n type: props.type,\n class: `${base} ${variants[props.variant]} ${props.disabled ? '' : ''}`,\n disabled: props.disabled,\n href: props.uri,\n onClick\n },\n [\n prependIcon,\n children,\n appendIcon\n ].filter(Boolean)\n )\n }\n }\n})\n","import { defineComponent, PropType, h, SetupContext, VNode } from 'vue'\nexport default defineComponent({\n name: 'DSkeletonLoader',\n props: {\n animation: {\n type: String as PropType<'pulse' | 'wave'>, \n default: 'pulse'\n },\n type: {\n type: String as PropType<'text' | 'circle' | 'avatar'>,\n default: 'text'\n }\n },\n \n\n setup(props: Record<string, any>, ctx: SetupContext) {\n const { slots } = ctx\n\n const base = 'bg-gray-50 dark:bg-gray-100'\n const animations: Record<string, string> = {\n pulse: 'animate-pulse',\n wave: 'animate-wave'\n }\n const types: Record<string, string> = {\n text: 'rounded-full w-full p-2',\n circle: 'rounded-full',\n avatar: 'rounded-full w-10 h-10 ',\n }\n const children = slots.default ? slots.default() : props.label\n\n return (): VNode => {\n return h(\n children ? 'div' :\n 'div',\n {\n class: `${animations[props.animation]} `,\n },\n [\n h('div', { class: ` ${base} ${types[props.type]}` }),\n ],\n \n \n )\n }\n}\n\n})\n","export * from './components/DButton'\nexport * from './components/DSkeleton'\nexport interface UIOptions {\n components?: Record<string, any>\n}\n\nexport function createDirdocUI( options: UIOptions = {}) {\n const { components = {} } = options\n\n return {\n install(app: any) {\n for (const key in components) {\n app.component(key, components[key])\n }\n }\n }\n}\n\nimport './components/styles/style.css'"],"names":[],"mappings":";;AAKA,cAAe,eAAe,CAAC;AAC7B,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,KAAK,EAAE;AACL,QAAA,KAAK,EAAE;AACL,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,KAAK;AACf,YAAA,OAAO,EAAE;AACV,SAAA;AACD,QAAA,GAAG,EAAE;AACH,YAAA,IAAI,EAAE,MAA0B;AAChC,YAAA,QAAQ,EAAE,KAAK;AACf,YAAA,OAAO,EAAE;AACV,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,IAAI,EAAE,MAAiD;AACvD,YAAA,OAAO,EAAE;AACV,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,IAAI,EAAE,MAA0C;AAChD,YAAA,OAAO,EAAE;AACV,SAAA;AACD,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAAE,OAA4B;AAClC,YAAA,OAAO,EAAE;AACV,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAA6D;AAC5F,YAAA,OAAO,EAAE;AACV,SAAA;AACD,QAAA,OAAO,EAAE;AACL,YAAA,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAA6D;AAC9F,YAAA,OAAO,EAAE;AACV,SAAA;AACD,QAAA,MAAM,EAAC;AACH,YAAA,IAAI,EAAE,CAAC,MAAM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AAA;AACZ,YAAA,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE;gBAC1B,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;YACvC;QACJ;KACH;AACL;;;;"}
|
package/dist/styles.css
ADDED
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties;
|
|
3
|
+
@layer theme, base, components, utilities;
|
|
4
|
+
@layer theme {
|
|
5
|
+
:root, :host {
|
|
6
|
+
--font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
|
|
7
|
+
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
8
|
+
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
|
|
9
|
+
"Courier New", monospace;
|
|
10
|
+
--color-gray-50: oklch(98.5% 0.002 247.839);
|
|
11
|
+
--color-gray-100: oklch(96.7% 0.003 264.542);
|
|
12
|
+
--color-black: #000;
|
|
13
|
+
--spacing: 0.25rem;
|
|
14
|
+
--text-2xl: 1.5rem;
|
|
15
|
+
--text-2xl--line-height: calc(2 / 1.5);
|
|
16
|
+
--font-weight-bold: 700;
|
|
17
|
+
--animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
18
|
+
--default-font-family: var(--font-sans);
|
|
19
|
+
--default-mono-font-family: var(--font-mono);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
@layer base {
|
|
23
|
+
*, ::after, ::before, ::backdrop, ::file-selector-button {
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
margin: 0;
|
|
26
|
+
padding: 0;
|
|
27
|
+
border: 0 solid;
|
|
28
|
+
}
|
|
29
|
+
html, :host {
|
|
30
|
+
line-height: 1.5;
|
|
31
|
+
-webkit-text-size-adjust: 100%;
|
|
32
|
+
tab-size: 4;
|
|
33
|
+
font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
|
|
34
|
+
font-feature-settings: var(--default-font-feature-settings, normal);
|
|
35
|
+
font-variation-settings: var(--default-font-variation-settings, normal);
|
|
36
|
+
-webkit-tap-highlight-color: transparent;
|
|
37
|
+
}
|
|
38
|
+
hr {
|
|
39
|
+
height: 0;
|
|
40
|
+
color: inherit;
|
|
41
|
+
border-top-width: 1px;
|
|
42
|
+
}
|
|
43
|
+
abbr:where([title]) {
|
|
44
|
+
-webkit-text-decoration: underline dotted;
|
|
45
|
+
text-decoration: underline dotted;
|
|
46
|
+
}
|
|
47
|
+
h1, h2, h3, h4, h5, h6 {
|
|
48
|
+
font-size: inherit;
|
|
49
|
+
font-weight: inherit;
|
|
50
|
+
}
|
|
51
|
+
a {
|
|
52
|
+
color: inherit;
|
|
53
|
+
-webkit-text-decoration: inherit;
|
|
54
|
+
text-decoration: inherit;
|
|
55
|
+
}
|
|
56
|
+
b, strong {
|
|
57
|
+
font-weight: bolder;
|
|
58
|
+
}
|
|
59
|
+
code, kbd, samp, pre {
|
|
60
|
+
font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
|
|
61
|
+
font-feature-settings: var(--default-mono-font-feature-settings, normal);
|
|
62
|
+
font-variation-settings: var(--default-mono-font-variation-settings, normal);
|
|
63
|
+
font-size: 1em;
|
|
64
|
+
}
|
|
65
|
+
small {
|
|
66
|
+
font-size: 80%;
|
|
67
|
+
}
|
|
68
|
+
sub, sup {
|
|
69
|
+
font-size: 75%;
|
|
70
|
+
line-height: 0;
|
|
71
|
+
position: relative;
|
|
72
|
+
vertical-align: baseline;
|
|
73
|
+
}
|
|
74
|
+
sub {
|
|
75
|
+
bottom: -0.25em;
|
|
76
|
+
}
|
|
77
|
+
sup {
|
|
78
|
+
top: -0.5em;
|
|
79
|
+
}
|
|
80
|
+
table {
|
|
81
|
+
text-indent: 0;
|
|
82
|
+
border-color: inherit;
|
|
83
|
+
border-collapse: collapse;
|
|
84
|
+
}
|
|
85
|
+
:-moz-focusring {
|
|
86
|
+
outline: auto;
|
|
87
|
+
}
|
|
88
|
+
progress {
|
|
89
|
+
vertical-align: baseline;
|
|
90
|
+
}
|
|
91
|
+
summary {
|
|
92
|
+
display: list-item;
|
|
93
|
+
}
|
|
94
|
+
ol, ul, menu {
|
|
95
|
+
list-style: none;
|
|
96
|
+
}
|
|
97
|
+
img, svg, video, canvas, audio, iframe, embed, object {
|
|
98
|
+
display: block;
|
|
99
|
+
vertical-align: middle;
|
|
100
|
+
}
|
|
101
|
+
img, video {
|
|
102
|
+
max-width: 100%;
|
|
103
|
+
height: auto;
|
|
104
|
+
}
|
|
105
|
+
button, input, select, optgroup, textarea, ::file-selector-button {
|
|
106
|
+
font: inherit;
|
|
107
|
+
font-feature-settings: inherit;
|
|
108
|
+
font-variation-settings: inherit;
|
|
109
|
+
letter-spacing: inherit;
|
|
110
|
+
color: inherit;
|
|
111
|
+
border-radius: 0;
|
|
112
|
+
background-color: transparent;
|
|
113
|
+
opacity: 1;
|
|
114
|
+
}
|
|
115
|
+
:where(select:is([multiple], [size])) optgroup {
|
|
116
|
+
font-weight: bolder;
|
|
117
|
+
}
|
|
118
|
+
:where(select:is([multiple], [size])) optgroup option {
|
|
119
|
+
padding-inline-start: 20px;
|
|
120
|
+
}
|
|
121
|
+
::file-selector-button {
|
|
122
|
+
margin-inline-end: 4px;
|
|
123
|
+
}
|
|
124
|
+
::placeholder {
|
|
125
|
+
opacity: 1;
|
|
126
|
+
}
|
|
127
|
+
@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {
|
|
128
|
+
::placeholder {
|
|
129
|
+
color: currentcolor;
|
|
130
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
131
|
+
color: color-mix(in oklab, currentcolor 50%, transparent);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
textarea {
|
|
136
|
+
resize: vertical;
|
|
137
|
+
}
|
|
138
|
+
::-webkit-search-decoration {
|
|
139
|
+
-webkit-appearance: none;
|
|
140
|
+
}
|
|
141
|
+
::-webkit-date-and-time-value {
|
|
142
|
+
min-height: 1lh;
|
|
143
|
+
text-align: inherit;
|
|
144
|
+
}
|
|
145
|
+
::-webkit-datetime-edit {
|
|
146
|
+
display: inline-flex;
|
|
147
|
+
}
|
|
148
|
+
::-webkit-datetime-edit-fields-wrapper {
|
|
149
|
+
padding: 0;
|
|
150
|
+
}
|
|
151
|
+
::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {
|
|
152
|
+
padding-block: 0;
|
|
153
|
+
}
|
|
154
|
+
::-webkit-calendar-picker-indicator {
|
|
155
|
+
line-height: 1;
|
|
156
|
+
}
|
|
157
|
+
:-moz-ui-invalid {
|
|
158
|
+
box-shadow: none;
|
|
159
|
+
}
|
|
160
|
+
button, input:where([type="button"], [type="reset"], [type="submit"]), ::file-selector-button {
|
|
161
|
+
appearance: button;
|
|
162
|
+
}
|
|
163
|
+
::-webkit-inner-spin-button, ::-webkit-outer-spin-button {
|
|
164
|
+
height: auto;
|
|
165
|
+
}
|
|
166
|
+
[hidden]:where(:not([hidden="until-found"])) {
|
|
167
|
+
display: none !important;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
@layer utilities {
|
|
171
|
+
.mr-2 {
|
|
172
|
+
margin-right: calc(var(--spacing) * 2);
|
|
173
|
+
}
|
|
174
|
+
.ml-2 {
|
|
175
|
+
margin-left: calc(var(--spacing) * 2);
|
|
176
|
+
}
|
|
177
|
+
.flex {
|
|
178
|
+
display: flex;
|
|
179
|
+
}
|
|
180
|
+
.h-10 {
|
|
181
|
+
height: calc(var(--spacing) * 10);
|
|
182
|
+
}
|
|
183
|
+
.w-10 {
|
|
184
|
+
width: calc(var(--spacing) * 10);
|
|
185
|
+
}
|
|
186
|
+
.w-full {
|
|
187
|
+
width: 100%;
|
|
188
|
+
}
|
|
189
|
+
.animate-pulse {
|
|
190
|
+
animation: var(--animate-pulse);
|
|
191
|
+
}
|
|
192
|
+
.cursor-pointer {
|
|
193
|
+
cursor: pointer;
|
|
194
|
+
}
|
|
195
|
+
.items-center {
|
|
196
|
+
align-items: center;
|
|
197
|
+
}
|
|
198
|
+
.justify-center {
|
|
199
|
+
justify-content: center;
|
|
200
|
+
}
|
|
201
|
+
.space-y-4 {
|
|
202
|
+
:where(& > :not(:last-child)) {
|
|
203
|
+
--tw-space-y-reverse: 0;
|
|
204
|
+
margin-block-start: calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));
|
|
205
|
+
margin-block-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)));
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
.rounded-full {
|
|
209
|
+
border-radius: calc(infinity * 1px);
|
|
210
|
+
}
|
|
211
|
+
.border {
|
|
212
|
+
border-style: var(--tw-border-style);
|
|
213
|
+
border-width: 1px;
|
|
214
|
+
}
|
|
215
|
+
.border-1 {
|
|
216
|
+
border-style: var(--tw-border-style);
|
|
217
|
+
border-width: 1px;
|
|
218
|
+
}
|
|
219
|
+
.border-solid {
|
|
220
|
+
--tw-border-style: solid;
|
|
221
|
+
border-style: solid;
|
|
222
|
+
}
|
|
223
|
+
.border-black {
|
|
224
|
+
border-color: var(--color-black);
|
|
225
|
+
}
|
|
226
|
+
.bg-\[var\(--color-surface-container\)\] {
|
|
227
|
+
background-color: var(--color-surface-container);
|
|
228
|
+
}
|
|
229
|
+
.bg-gray-50 {
|
|
230
|
+
background-color: var(--color-gray-50);
|
|
231
|
+
}
|
|
232
|
+
.bg-transparent {
|
|
233
|
+
background-color: transparent;
|
|
234
|
+
}
|
|
235
|
+
.p-2 {
|
|
236
|
+
padding: calc(var(--spacing) * 2);
|
|
237
|
+
}
|
|
238
|
+
.p-8 {
|
|
239
|
+
padding: calc(var(--spacing) * 8);
|
|
240
|
+
}
|
|
241
|
+
.px-4 {
|
|
242
|
+
padding-inline: calc(var(--spacing) * 4);
|
|
243
|
+
}
|
|
244
|
+
.py-2 {
|
|
245
|
+
padding-block: calc(var(--spacing) * 2);
|
|
246
|
+
}
|
|
247
|
+
.text-2xl {
|
|
248
|
+
font-size: var(--text-2xl);
|
|
249
|
+
line-height: var(--tw-leading, var(--text-2xl--line-height));
|
|
250
|
+
}
|
|
251
|
+
.font-bold {
|
|
252
|
+
--tw-font-weight: var(--font-weight-bold);
|
|
253
|
+
font-weight: var(--font-weight-bold);
|
|
254
|
+
}
|
|
255
|
+
.text-\[var\(--color-inverse-surface\)\] {
|
|
256
|
+
color: var(--color-inverse-surface);
|
|
257
|
+
}
|
|
258
|
+
.hover\:brightness-98 {
|
|
259
|
+
&:hover {
|
|
260
|
+
@media (hover: hover) {
|
|
261
|
+
--tw-brightness: brightness(98%);
|
|
262
|
+
filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
.focus\:outline-none {
|
|
267
|
+
&:focus {
|
|
268
|
+
--tw-outline-style: none;
|
|
269
|
+
outline-style: none;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
.dark\:bg-gray-100 {
|
|
273
|
+
@media (prefers-color-scheme: dark) {
|
|
274
|
+
background-color: var(--color-gray-100);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
:root {
|
|
279
|
+
--color-primary: #294675;
|
|
280
|
+
--color-primary-dark: #223c6a;
|
|
281
|
+
--color-primary-darker: #00296b;
|
|
282
|
+
--color-yellow: #e69b0a;
|
|
283
|
+
--color-accent: #fdc500;
|
|
284
|
+
--color-accent-light: #ffd500;
|
|
285
|
+
--default-transition-duration: 50ms;
|
|
286
|
+
--color-surface: #ffffff;
|
|
287
|
+
--color-gray-light: #f1f1f1;
|
|
288
|
+
--color-gray-darker: #5c5c5c;
|
|
289
|
+
--color-surface-container-lowest: #ffffff;
|
|
290
|
+
--color-surface-container-low: #dbe1e7;
|
|
291
|
+
--color-surface-container: #e9eef6;
|
|
292
|
+
--color-surface-container-high: #e7e9e9;
|
|
293
|
+
--color-surface-container-highest: #e1e3da;
|
|
294
|
+
--color-gray: #9e9e9e;
|
|
295
|
+
--color-on-primary: rgb(255, 255, 255);
|
|
296
|
+
--color-primary-container: #d0e4ff;
|
|
297
|
+
--color-on-primary-container: #001c3a;
|
|
298
|
+
--color-secondary: #bcc8dc;
|
|
299
|
+
--color-on-secondary: #273141;
|
|
300
|
+
--color-secondary-container: #3d4858;
|
|
301
|
+
--color-on-secondary-container: #d8e4f8;
|
|
302
|
+
--color-tertiary: #d8bce0;
|
|
303
|
+
--color-on-tertiary: #9f9f50;
|
|
304
|
+
--color-tertiary-container: #53405e;
|
|
305
|
+
--color-on-tertiary-container: #f6dafe;
|
|
306
|
+
--color-error: rgb(178, 39, 34);
|
|
307
|
+
--color-on-error: rgb(255, 255, 255);
|
|
308
|
+
--color-error-container: rgb(252, 219, 215);
|
|
309
|
+
--color-on-error-container: rgb(62, 3, 4);
|
|
310
|
+
--color-shadow: rgb(0, 0, 0);
|
|
311
|
+
--color-scrim: rgb(0, 0, 0);
|
|
312
|
+
--color-primary-fixed: rgb(188, 242, 153);
|
|
313
|
+
--color-on-primary-fixed: rgb(9, 33, 1);
|
|
314
|
+
--color-primary-fixed-dim: rgb(160, 213, 127);
|
|
315
|
+
--color-on-primary-fixed-variant: rgb(37, 81, 11);
|
|
316
|
+
--color-secondary-fixed: rgb(218, 231, 204);
|
|
317
|
+
--color-on-secondary-fixed: rgb(20, 31, 13);
|
|
318
|
+
--color-secondary-fixed-dim: rgb(190, 203, 177);
|
|
319
|
+
--color-on-secondary-fixed-variant: rgb(63, 74, 53);
|
|
320
|
+
--color-tertiary-fixed: rgb(192, 234, 236);
|
|
321
|
+
--color-on-tertiary-fixed: rgb(4, 32, 32);
|
|
322
|
+
--color-tertiary-fixed-dim: rgb(165, 206, 207);
|
|
323
|
+
--color-on-tertiary-fixed-variant: rgb(37, 77, 78);
|
|
324
|
+
--color-surface-dim: rgb(217, 219, 209);
|
|
325
|
+
--color-surface-bright: rgb(248, 250, 240);
|
|
326
|
+
--color-background: #fbfcfe;
|
|
327
|
+
--color-on-background: #1a1c1e;
|
|
328
|
+
--color-surface-variant: #dee3eb;
|
|
329
|
+
--color-on-surface-variant: #42474e;
|
|
330
|
+
--color-outline: #72777f;
|
|
331
|
+
--color-outline-variant: #c1c6ce;
|
|
332
|
+
--color-inverse-primary: #9cbcff;
|
|
333
|
+
--color-inverse-surface: #454f5e;
|
|
334
|
+
--color-inverse-on-surface: #ffffff;
|
|
335
|
+
--color-scrim: #000000;
|
|
336
|
+
--color-surface-container-lowest-variant: #f8fafd;
|
|
337
|
+
--color-surface-container-low-variant: #e69b0a;
|
|
338
|
+
}
|
|
339
|
+
@property --tw-space-y-reverse {
|
|
340
|
+
syntax: "*";
|
|
341
|
+
inherits: false;
|
|
342
|
+
initial-value: 0;
|
|
343
|
+
}
|
|
344
|
+
@property --tw-border-style {
|
|
345
|
+
syntax: "*";
|
|
346
|
+
inherits: false;
|
|
347
|
+
initial-value: solid;
|
|
348
|
+
}
|
|
349
|
+
@property --tw-font-weight {
|
|
350
|
+
syntax: "*";
|
|
351
|
+
inherits: false;
|
|
352
|
+
}
|
|
353
|
+
@property --tw-blur {
|
|
354
|
+
syntax: "*";
|
|
355
|
+
inherits: false;
|
|
356
|
+
}
|
|
357
|
+
@property --tw-brightness {
|
|
358
|
+
syntax: "*";
|
|
359
|
+
inherits: false;
|
|
360
|
+
}
|
|
361
|
+
@property --tw-contrast {
|
|
362
|
+
syntax: "*";
|
|
363
|
+
inherits: false;
|
|
364
|
+
}
|
|
365
|
+
@property --tw-grayscale {
|
|
366
|
+
syntax: "*";
|
|
367
|
+
inherits: false;
|
|
368
|
+
}
|
|
369
|
+
@property --tw-hue-rotate {
|
|
370
|
+
syntax: "*";
|
|
371
|
+
inherits: false;
|
|
372
|
+
}
|
|
373
|
+
@property --tw-invert {
|
|
374
|
+
syntax: "*";
|
|
375
|
+
inherits: false;
|
|
376
|
+
}
|
|
377
|
+
@property --tw-opacity {
|
|
378
|
+
syntax: "*";
|
|
379
|
+
inherits: false;
|
|
380
|
+
}
|
|
381
|
+
@property --tw-saturate {
|
|
382
|
+
syntax: "*";
|
|
383
|
+
inherits: false;
|
|
384
|
+
}
|
|
385
|
+
@property --tw-sepia {
|
|
386
|
+
syntax: "*";
|
|
387
|
+
inherits: false;
|
|
388
|
+
}
|
|
389
|
+
@property --tw-drop-shadow {
|
|
390
|
+
syntax: "*";
|
|
391
|
+
inherits: false;
|
|
392
|
+
}
|
|
393
|
+
@property --tw-drop-shadow-color {
|
|
394
|
+
syntax: "*";
|
|
395
|
+
inherits: false;
|
|
396
|
+
}
|
|
397
|
+
@property --tw-drop-shadow-alpha {
|
|
398
|
+
syntax: "<percentage>";
|
|
399
|
+
inherits: false;
|
|
400
|
+
initial-value: 100%;
|
|
401
|
+
}
|
|
402
|
+
@property --tw-drop-shadow-size {
|
|
403
|
+
syntax: "*";
|
|
404
|
+
inherits: false;
|
|
405
|
+
}
|
|
406
|
+
@keyframes pulse {
|
|
407
|
+
50% {
|
|
408
|
+
opacity: 0.5;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
@layer properties {
|
|
412
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
413
|
+
*, ::before, ::after, ::backdrop {
|
|
414
|
+
--tw-space-y-reverse: 0;
|
|
415
|
+
--tw-border-style: solid;
|
|
416
|
+
--tw-font-weight: initial;
|
|
417
|
+
--tw-blur: initial;
|
|
418
|
+
--tw-brightness: initial;
|
|
419
|
+
--tw-contrast: initial;
|
|
420
|
+
--tw-grayscale: initial;
|
|
421
|
+
--tw-hue-rotate: initial;
|
|
422
|
+
--tw-invert: initial;
|
|
423
|
+
--tw-opacity: initial;
|
|
424
|
+
--tw-saturate: initial;
|
|
425
|
+
--tw-sepia: initial;
|
|
426
|
+
--tw-drop-shadow: initial;
|
|
427
|
+
--tw-drop-shadow-color: initial;
|
|
428
|
+
--tw-drop-shadow-alpha: 100%;
|
|
429
|
+
--tw-drop-shadow-size: initial;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
|
+
import '../styles/style.css';
|
|
2
3
|
export interface UseLink {
|
|
3
4
|
navigate: () => void | null;
|
|
4
5
|
}
|
|
@@ -8,12 +9,18 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
8
9
|
[x: string]: /*elided*/ any;
|
|
9
10
|
}> & Readonly<{}>, {
|
|
10
11
|
label: string;
|
|
11
|
-
|
|
12
|
+
uri: string;
|
|
12
13
|
type: "button" | "submit" | "reset";
|
|
13
|
-
variant: "
|
|
14
|
+
variant: "default" | "outlined";
|
|
14
15
|
disabled: boolean;
|
|
15
16
|
icon: string | object | (() => VNode) | VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
16
17
|
[key: string]: any;
|
|
17
18
|
}> | null;
|
|
19
|
+
prepend: string | object | VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
}> | (() => VNode) | null;
|
|
22
|
+
append: string | object | VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
}> | (() => VNode) | null;
|
|
18
25
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
19
26
|
export default _default;
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dirdoc-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"main": "dist/index.cjs.js",
|
|
5
5
|
"module": "dist/index.esm.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
"require": "./dist/index.cjs.js",
|
|
41
41
|
"types": "./dist/index.d.ts"
|
|
42
42
|
},
|
|
43
|
-
"./*": "./dist/*"
|
|
43
|
+
"./*": "./dist/*",
|
|
44
|
+
"./styles.css": "./dist/styles.css"
|
|
44
45
|
},
|
|
45
46
|
"peerDependencies": {
|
|
46
47
|
"typescript": "^4.9 || ^5",
|