@brickflow/ui 0.0.32 → 0.0.34
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/module.json +1 -1
- package/dist/module.mjs +291 -28
- package/dist/runtime/components/Button/index.d.vue.ts +31 -25
- package/dist/runtime/components/Button/index.vue +10 -62
- package/dist/runtime/components/Button/index.vue.d.ts +31 -25
- package/dist/runtime/components/Button/variants.demo.vue +26 -182
- package/dist/runtime/components/Icon/basic.demo.vue +3 -3
- package/dist/runtime/components/Link/basic.demo.vue +2 -2
- package/dist/runtime/composables/useScreen.d.ts +10 -12
- package/dist/runtime/composables/useScreen.js +26 -32
- package/dist/runtime/config.d.ts +24 -1
- package/dist/runtime/pages/ui.vue +77 -68
- package/dist/runtime/tailwind.d.ts +33 -5
- package/dist/runtime/tailwind.js +46 -0
- package/dist/runtime/ui.css +1 -0
- package/package.json +5 -1
- package/dist/runtime/assets/css/main.css +0 -0
|
@@ -1,42 +1,48 @@
|
|
|
1
1
|
import type { RouteLocationRaw } from 'vue-router';
|
|
2
|
-
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
4
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
3
5
|
block?: boolean;
|
|
4
|
-
color?:
|
|
6
|
+
color?: string;
|
|
5
7
|
disabled?: boolean;
|
|
6
8
|
icon?: string;
|
|
7
9
|
loading?: boolean;
|
|
8
10
|
rounded?: boolean;
|
|
9
|
-
size?:
|
|
11
|
+
size?: string;
|
|
10
12
|
square?: boolean;
|
|
11
13
|
to?: RouteLocationRaw;
|
|
12
14
|
trailingIcon?: string;
|
|
13
|
-
type?:
|
|
14
|
-
variant?:
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
type?: "button" | "reset" | "submit";
|
|
16
|
+
variant?: string;
|
|
17
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
18
|
+
block?: boolean;
|
|
19
|
+
color?: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
icon?: string;
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
rounded?: boolean;
|
|
24
|
+
size?: string;
|
|
25
|
+
square?: boolean;
|
|
26
|
+
to?: RouteLocationRaw;
|
|
27
|
+
trailingIcon?: string;
|
|
28
|
+
type?: "button" | "reset" | "submit";
|
|
29
|
+
variant?: string;
|
|
30
|
+
}> & Readonly<{}>, {
|
|
31
|
+
size: string;
|
|
29
32
|
type: "button" | "reset" | "submit";
|
|
33
|
+
color: string;
|
|
30
34
|
to: RouteLocationRaw;
|
|
31
|
-
color: ButtonColor;
|
|
32
35
|
icon: string;
|
|
33
36
|
rounded: boolean;
|
|
34
37
|
trailingIcon: string;
|
|
35
|
-
variant:
|
|
36
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
variant: string;
|
|
39
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
40
|
+
leading?: (props: {}) => any;
|
|
41
|
+
} & {
|
|
42
|
+
default?: (props: {}) => any;
|
|
43
|
+
} & {
|
|
44
|
+
trailing?: (props: {}) => any;
|
|
45
|
+
}>;
|
|
40
46
|
type __VLS_WithSlots<T, S> = T & {
|
|
41
47
|
new (): {
|
|
42
48
|
$slots: S;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
const UI_CONFIG = defineUiConfig();
|
|
2
3
|
export const uiDemo = {
|
|
3
4
|
title: "Color & Variants"
|
|
4
5
|
};
|
|
@@ -6,199 +7,42 @@ export const uiDemo = {
|
|
|
6
7
|
|
|
7
8
|
<script setup>
|
|
8
9
|
import Button from "./index.vue";
|
|
10
|
+
const colors = Object.entries(UI_CONFIG.colorClasses).map(([name, classes]) => ({
|
|
11
|
+
name,
|
|
12
|
+
variants: Object.keys(classes)
|
|
13
|
+
}));
|
|
14
|
+
const variants = colors[0]?.variants ?? [];
|
|
9
15
|
</script>
|
|
10
16
|
|
|
11
17
|
<template>
|
|
12
|
-
<div class="relative flex w-fit flex-col
|
|
18
|
+
<div class="relative flex w-fit flex-col items-start gap-3 pl-13">
|
|
13
19
|
<div class="absolute top-0 left-0 z-0 size-full object-cover pt-7 pl-13">
|
|
14
20
|
<img
|
|
15
|
-
src="https://
|
|
21
|
+
src="https://images.unsplash.com/photo-1545346315-f4c47e3e1b55?ixid=M3w4MjcwNjd8MHwxfHNlYXJjaHwyfHxzdHJvbmclMjBtYW58ZW58MHx8fHwxNzg4MjIyNTU1fDA&ixlib=rb-4.1.0&w=1000&h=1000&fit=max&q=80"
|
|
16
22
|
class="top-0 z-0 size-full rounded-xl object-cover opacity-50"
|
|
17
23
|
/>
|
|
18
24
|
</div>
|
|
19
|
-
<div class="flex w-full flex-wrap items-center justify-around gap-3 text-xs text-
|
|
20
|
-
<span
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
<div class="flex w-full flex-wrap items-center justify-around gap-3 text-xs text-slate-600">
|
|
26
|
+
<span
|
|
27
|
+
v-for="variant in variants"
|
|
28
|
+
:key="variant"
|
|
29
|
+
>
|
|
30
|
+
{{ variant }}
|
|
31
|
+
</span>
|
|
25
32
|
</div>
|
|
26
33
|
<div
|
|
27
|
-
|
|
34
|
+
v-for="color in colors"
|
|
35
|
+
:key="color.name"
|
|
36
|
+
class="relative flex w-full flex-wrap items-center gap-3 p-2"
|
|
28
37
|
>
|
|
29
|
-
<span>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
<div class="flex flex-wrap items-center gap-3 p-2">
|
|
38
|
-
<Button>Button</Button>
|
|
39
|
-
<Button variant="ghost">Button</Button>
|
|
40
|
-
<Button variant="glass">Button</Button>
|
|
41
|
-
<Button variant="soft">Button</Button>
|
|
42
|
-
<Button variant="subtle">Button</Button>
|
|
43
|
-
</div>
|
|
44
|
-
<div class="flex flex-wrap items-center gap-3 p-2">
|
|
45
|
-
<Button color="plain">Button</Button>
|
|
46
|
-
<Button
|
|
47
|
-
color="plain"
|
|
48
|
-
variant="ghost"
|
|
49
|
-
>
|
|
50
|
-
Button
|
|
51
|
-
</Button>
|
|
52
|
-
<Button
|
|
53
|
-
color="plain"
|
|
54
|
-
variant="glass"
|
|
55
|
-
>
|
|
56
|
-
Button
|
|
57
|
-
</Button>
|
|
58
|
-
<Button
|
|
59
|
-
color="plain"
|
|
60
|
-
variant="soft"
|
|
61
|
-
>
|
|
62
|
-
Button
|
|
63
|
-
</Button>
|
|
64
|
-
<Button
|
|
65
|
-
color="plain"
|
|
66
|
-
variant="subtle"
|
|
67
|
-
>
|
|
68
|
-
Button
|
|
69
|
-
</Button>
|
|
70
|
-
</div>
|
|
71
|
-
<div class="flex flex-wrap items-center gap-3 p-2">
|
|
72
|
-
<Button color="alt">Button</Button>
|
|
73
|
-
<Button
|
|
74
|
-
color="alt"
|
|
75
|
-
variant="ghost"
|
|
76
|
-
>
|
|
77
|
-
Button
|
|
78
|
-
</Button>
|
|
79
|
-
<Button
|
|
80
|
-
color="alt"
|
|
81
|
-
variant="glass"
|
|
82
|
-
>
|
|
83
|
-
Button
|
|
84
|
-
</Button>
|
|
85
|
-
<Button
|
|
86
|
-
color="alt"
|
|
87
|
-
variant="soft"
|
|
88
|
-
>
|
|
89
|
-
Button
|
|
90
|
-
</Button>
|
|
91
|
-
<Button
|
|
92
|
-
color="alt"
|
|
93
|
-
variant="subtle"
|
|
94
|
-
>
|
|
95
|
-
Button
|
|
96
|
-
</Button>
|
|
97
|
-
</div>
|
|
98
|
-
<div class="flex flex-wrap items-center gap-3 p-2">
|
|
99
|
-
<Button color="danger">Button</Button>
|
|
100
|
-
<Button
|
|
101
|
-
color="danger"
|
|
102
|
-
variant="ghost"
|
|
103
|
-
>
|
|
104
|
-
Button
|
|
105
|
-
</Button>
|
|
106
|
-
<Button
|
|
107
|
-
color="danger"
|
|
108
|
-
variant="glass"
|
|
109
|
-
>
|
|
110
|
-
Button
|
|
111
|
-
</Button>
|
|
112
|
-
<Button
|
|
113
|
-
color="danger"
|
|
114
|
-
variant="soft"
|
|
115
|
-
>
|
|
116
|
-
Button
|
|
117
|
-
</Button>
|
|
118
|
-
<Button
|
|
119
|
-
color="danger"
|
|
120
|
-
variant="subtle"
|
|
121
|
-
>
|
|
122
|
-
Button
|
|
123
|
-
</Button>
|
|
124
|
-
</div>
|
|
125
|
-
<div class="flex flex-wrap items-center gap-3 p-2">
|
|
126
|
-
<Button color="info">Button</Button>
|
|
127
|
-
<Button
|
|
128
|
-
color="info"
|
|
129
|
-
variant="ghost"
|
|
130
|
-
>
|
|
131
|
-
Button
|
|
132
|
-
</Button>
|
|
133
|
-
<Button
|
|
134
|
-
color="info"
|
|
135
|
-
variant="glass"
|
|
136
|
-
>
|
|
137
|
-
Button
|
|
138
|
-
</Button>
|
|
139
|
-
<Button
|
|
140
|
-
color="info"
|
|
141
|
-
variant="soft"
|
|
142
|
-
>
|
|
143
|
-
Button
|
|
144
|
-
</Button>
|
|
145
|
-
<Button
|
|
146
|
-
color="info"
|
|
147
|
-
variant="subtle"
|
|
148
|
-
>
|
|
149
|
-
Button
|
|
150
|
-
</Button>
|
|
151
|
-
</div>
|
|
152
|
-
<div class="flex flex-wrap items-center gap-3 p-2">
|
|
153
|
-
<Button color="warn">Button</Button>
|
|
154
|
-
<Button
|
|
155
|
-
color="warn"
|
|
156
|
-
variant="ghost"
|
|
157
|
-
>
|
|
158
|
-
Button
|
|
159
|
-
</Button>
|
|
160
|
-
<Button
|
|
161
|
-
color="warn"
|
|
162
|
-
variant="glass"
|
|
163
|
-
>
|
|
164
|
-
Button
|
|
165
|
-
</Button>
|
|
166
|
-
<Button
|
|
167
|
-
color="warn"
|
|
168
|
-
variant="soft"
|
|
169
|
-
>
|
|
170
|
-
Button
|
|
171
|
-
</Button>
|
|
172
|
-
<Button
|
|
173
|
-
color="warn"
|
|
174
|
-
variant="subtle"
|
|
175
|
-
>
|
|
176
|
-
Button
|
|
177
|
-
</Button>
|
|
178
|
-
</div>
|
|
179
|
-
<div class="flex flex-wrap items-center gap-3 p-2">
|
|
180
|
-
<Button color="win">Button</Button>
|
|
181
|
-
<Button
|
|
182
|
-
color="win"
|
|
183
|
-
variant="ghost"
|
|
184
|
-
>
|
|
185
|
-
Button
|
|
186
|
-
</Button>
|
|
187
|
-
<Button
|
|
188
|
-
color="win"
|
|
189
|
-
variant="glass"
|
|
190
|
-
>
|
|
191
|
-
Button
|
|
192
|
-
</Button>
|
|
193
|
-
<Button
|
|
194
|
-
color="win"
|
|
195
|
-
variant="soft"
|
|
196
|
-
>
|
|
197
|
-
Button
|
|
198
|
-
</Button>
|
|
199
|
-
<Button
|
|
200
|
-
color="win"
|
|
201
|
-
variant="subtle"
|
|
38
|
+
<span class="absolute top-1/2 right-full mr-3 -translate-y-1/2 text-xs text-slate-600">
|
|
39
|
+
{{ color.name }}
|
|
40
|
+
</span>
|
|
41
|
+
<Button
|
|
42
|
+
v-for="variant in color.variants"
|
|
43
|
+
:key="variant"
|
|
44
|
+
:color="color.name"
|
|
45
|
+
:variant="variant"
|
|
202
46
|
>
|
|
203
47
|
Button
|
|
204
48
|
</Button>
|
|
@@ -13,11 +13,11 @@ const iconName = ref(firstIconName);
|
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<template>
|
|
16
|
-
<div class="flex flex-col flex-wrap items-start gap-4 text-
|
|
16
|
+
<div class="flex flex-col flex-wrap items-start gap-4 text-zinc-100">
|
|
17
17
|
<input
|
|
18
18
|
v-model="iconName"
|
|
19
19
|
aria-label="Icon name"
|
|
20
|
-
class="rounded-lg border border-
|
|
20
|
+
class="rounded-lg border border-zinc-700 bg-zinc-900 px-3 py-2 text-sm text-zinc-100 outline-none focus:border-blue-400"
|
|
21
21
|
placeholder="Icon name"
|
|
22
22
|
type="text"
|
|
23
23
|
/>
|
|
@@ -33,7 +33,7 @@ const iconName = ref(firstIconName);
|
|
|
33
33
|
/>
|
|
34
34
|
<Icon
|
|
35
35
|
:name="iconName"
|
|
36
|
-
class="text-2xl text-
|
|
36
|
+
class="text-2xl text-green-400"
|
|
37
37
|
/>
|
|
38
38
|
<Icon
|
|
39
39
|
:name="iconName"
|
|
@@ -13,13 +13,13 @@ import Link from "./index.vue";
|
|
|
13
13
|
<div class="flex flex-wrap items-center gap-4">
|
|
14
14
|
<Link
|
|
15
15
|
to="/"
|
|
16
|
-
class="text-
|
|
16
|
+
class="text-blue-300 hover:text-blue-200"
|
|
17
17
|
>
|
|
18
18
|
Go to Home
|
|
19
19
|
</Link>
|
|
20
20
|
<Link
|
|
21
21
|
to="/ui?component=button"
|
|
22
|
-
class="text-
|
|
22
|
+
class="text-blue-300 hover:text-blue-200"
|
|
23
23
|
>
|
|
24
24
|
Open Button
|
|
25
25
|
</Link>
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
declare const screen: {
|
|
2
|
-
readonly
|
|
3
|
-
readonly
|
|
4
|
-
readonly
|
|
5
|
-
readonly
|
|
6
|
-
readonly
|
|
7
|
-
readonly
|
|
2
|
+
readonly dk: boolean;
|
|
3
|
+
readonly dkClass: "dkHidden";
|
|
4
|
+
readonly lp: boolean;
|
|
5
|
+
readonly lpClass: "lpHidden";
|
|
6
|
+
readonly mb: boolean;
|
|
7
|
+
readonly mbClass: "mbHidden";
|
|
8
|
+
readonly ms: boolean;
|
|
9
|
+
readonly msClass: "msHidden";
|
|
8
10
|
readonly ready: Promise<void>;
|
|
9
|
-
readonly
|
|
10
|
-
readonly
|
|
11
|
-
readonly xl: boolean;
|
|
12
|
-
readonly xlClass: "max-xl:hidden 2xl:hidden";
|
|
13
|
-
readonly xxl: boolean;
|
|
14
|
-
readonly xxlClass: "max-2xl:hidden";
|
|
11
|
+
readonly tb: boolean;
|
|
12
|
+
readonly tbClass: "tbHidden";
|
|
15
13
|
};
|
|
16
14
|
export declare function useScreen(): typeof screen;
|
|
17
15
|
export {};
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { onMounted, reactive } from "vue";
|
|
2
2
|
const state = reactive({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
xxl: true
|
|
3
|
+
dk: true,
|
|
4
|
+
lp: true,
|
|
5
|
+
mb: true,
|
|
6
|
+
ms: true,
|
|
7
|
+
tb: true
|
|
9
8
|
});
|
|
10
9
|
const queries = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
xxl: "(width >= 96rem)"
|
|
10
|
+
dk: "(width >= 1440px)",
|
|
11
|
+
lp: "(1024px <= width < 1440px)",
|
|
12
|
+
mb: "(480px <= width < 768px)",
|
|
13
|
+
ms: "(width < 480px)",
|
|
14
|
+
tb: "(768px <= width < 1024px)"
|
|
17
15
|
};
|
|
18
16
|
let initialized = false;
|
|
19
17
|
let resolveReady = () => void 0;
|
|
@@ -36,31 +34,27 @@ function initialize() {
|
|
|
36
34
|
resolveReady();
|
|
37
35
|
}
|
|
38
36
|
const screen = {
|
|
39
|
-
get
|
|
40
|
-
return state.
|
|
37
|
+
get dk() {
|
|
38
|
+
return state.dk;
|
|
41
39
|
},
|
|
42
|
-
|
|
43
|
-
get
|
|
44
|
-
return state.
|
|
40
|
+
dkClass: "dkHidden",
|
|
41
|
+
get lp() {
|
|
42
|
+
return state.lp;
|
|
45
43
|
},
|
|
46
|
-
|
|
47
|
-
get
|
|
48
|
-
return state.
|
|
44
|
+
lpClass: "lpHidden",
|
|
45
|
+
get mb() {
|
|
46
|
+
return state.mb;
|
|
49
47
|
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return state.sm;
|
|
54
|
-
},
|
|
55
|
-
smClass: "max-sm:hidden md:hidden",
|
|
56
|
-
get xl() {
|
|
57
|
-
return state.xl;
|
|
48
|
+
mbClass: "mbHidden",
|
|
49
|
+
get ms() {
|
|
50
|
+
return state.ms;
|
|
58
51
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
52
|
+
msClass: "msHidden",
|
|
53
|
+
ready,
|
|
54
|
+
get tb() {
|
|
55
|
+
return state.tb;
|
|
62
56
|
},
|
|
63
|
-
|
|
57
|
+
tbClass: "tbHidden"
|
|
64
58
|
};
|
|
65
59
|
export function useScreen() {
|
|
66
60
|
onMounted(initialize);
|
package/dist/runtime/config.d.ts
CHANGED
|
@@ -3,7 +3,9 @@ export {}
|
|
|
3
3
|
declare module '#brickflow-ui-config' {
|
|
4
4
|
import type { BrickflowUiConfig } from './tailwind'
|
|
5
5
|
|
|
6
|
-
export const
|
|
6
|
+
export const UI_CONFIG: BrickflowUiConfigType
|
|
7
|
+
export const UI_STYLE: BrickflowUiStyleType
|
|
8
|
+
export const uiConfig: BrickflowUiConfig['uiConfig']
|
|
7
9
|
export const uiStyles: BrickflowUiConfig['uiStyles']
|
|
8
10
|
|
|
9
11
|
const config: BrickflowUiConfig
|
|
@@ -12,6 +14,22 @@ declare module '#brickflow-ui-config' {
|
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
declare global {
|
|
17
|
+
type BrickflowUiConfigFor<TExpected extends BrickflowUiConfigObject> = {
|
|
18
|
+
[TKey in keyof BrickflowUiConfigLiteralPaths]: BrickflowUiConfigLiteralPaths[TKey] extends TExpected
|
|
19
|
+
? BrickflowUiConfigLiteralPaths[TKey]
|
|
20
|
+
: never
|
|
21
|
+
}[keyof BrickflowUiConfigLiteralPaths] extends infer TMatched
|
|
22
|
+
? [TMatched] extends [never]
|
|
23
|
+
? TExpected
|
|
24
|
+
: TMatched
|
|
25
|
+
: never
|
|
26
|
+
|
|
27
|
+
interface BrickflowUiConfigLiteralPaths {}
|
|
28
|
+
|
|
29
|
+
interface BrickflowUiConfigPaths {}
|
|
30
|
+
|
|
31
|
+
type BrickflowUiConfigType = BrickflowUiConfigPaths & Record<string, unknown>
|
|
32
|
+
|
|
15
33
|
interface BrickflowUiStylePaths {}
|
|
16
34
|
|
|
17
35
|
type BrickflowUiStyleType = BrickflowUiStylePaths & BrickflowUiStyleValue
|
|
@@ -21,10 +39,15 @@ declare global {
|
|
|
21
39
|
}
|
|
22
40
|
|
|
23
41
|
const UI_STYLE: BrickflowUiStyleType
|
|
42
|
+
|
|
43
|
+
const UI_CONFIG: BrickflowUiConfigType
|
|
44
|
+
|
|
45
|
+
function defineUiConfig<TConfig extends BrickflowUiConfigObject>(): BrickflowUiConfigFor<TConfig>
|
|
24
46
|
}
|
|
25
47
|
|
|
26
48
|
declare module '@vue/runtime-core' {
|
|
27
49
|
interface ComponentCustomProperties {
|
|
50
|
+
readonly UI_CONFIG: BrickflowUiConfigType
|
|
28
51
|
readonly UI_STYLE: BrickflowUiStyleType
|
|
29
52
|
}
|
|
30
53
|
}
|