@brickflow/ui 0.0.40 → 0.0.41
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 +3 -0
- package/dist/runtime/components/Button/icons.demo.vue +0 -1
- package/dist/runtime/components/Button/index.d.vue.ts +2 -0
- package/dist/runtime/components/Button/index.vue +1 -7
- package/dist/runtime/components/Button/index.vue.d.ts +2 -0
- package/dist/runtime/components/Button/size.demo.vue +28 -60
- package/dist/runtime/components/Button/state.demo.vue +50 -2
- package/dist/runtime/components/Button/variants.demo.vue +10 -14
- package/dist/runtime/components/Icon/gallery.demo.d.vue.ts +8 -0
- package/dist/runtime/components/Icon/gallery.demo.vue +132 -0
- package/dist/runtime/components/Icon/gallery.demo.vue.d.ts +8 -0
- package/dist/runtime/icon-font.d.ts +1 -0
- package/dist/runtime/pages/ui.vue +1 -1
- package/package.json +5 -5
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -750,6 +750,9 @@ const module$1 = defineNuxtModule({
|
|
|
750
750
|
getContents: async () => {
|
|
751
751
|
const iconNames = iconFont ? await getIconFontNames(iconFont.inputDir) : [];
|
|
752
752
|
return [
|
|
753
|
+
"import { uiConfig } from '#brickflow-ui-config'",
|
|
754
|
+
"",
|
|
755
|
+
"export const buttonConfig = uiConfig.button",
|
|
753
756
|
`export const iconNames = ${JSON.stringify(iconNames)}`,
|
|
754
757
|
`export const firstIconName = ${JSON.stringify(iconNames[0] ?? "")}`,
|
|
755
758
|
""
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { RouteLocationRaw } from 'vue-router';
|
|
2
|
+
declare const UI_CONFIG: any;
|
|
3
|
+
export type ButtonConfig = typeof UI_CONFIG;
|
|
2
4
|
declare const _default: typeof __VLS_export;
|
|
3
5
|
export default _default;
|
|
4
6
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
@@ -22,13 +22,7 @@ const props = defineProps({
|
|
|
22
22
|
});
|
|
23
23
|
const colorClasses = UI_CONFIG.colorClasses;
|
|
24
24
|
const sizeClasses = UI_CONFIG.sizeClasses;
|
|
25
|
-
const sizeIconClasses =
|
|
26
|
-
lg: UI_STYLE.size.lgIcon,
|
|
27
|
-
md: UI_STYLE.size.mdIcon,
|
|
28
|
-
sm: UI_STYLE.size.smIcon,
|
|
29
|
-
xl: UI_STYLE.size.xlIcon,
|
|
30
|
-
xs: UI_STYLE.size.xsIcon
|
|
31
|
-
};
|
|
25
|
+
const sizeIconClasses = UI_CONFIG.sizeIconClasses;
|
|
32
26
|
const component = computed(() => props.to === void 0 ? "button" : BaseLink);
|
|
33
27
|
const disabled = computed(() => props.disabled || props.loading);
|
|
34
28
|
const isButton = computed(() => props.to === void 0);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { RouteLocationRaw } from 'vue-router';
|
|
2
|
+
declare const UI_CONFIG: any;
|
|
3
|
+
export type ButtonConfig = typeof UI_CONFIG;
|
|
2
4
|
declare const _default: typeof __VLS_export;
|
|
3
5
|
export default _default;
|
|
4
6
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
@@ -5,74 +5,42 @@ export const uiDemo = {
|
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<script setup>
|
|
8
|
-
import { firstIconName } from "#brickflow-ui-icons";
|
|
8
|
+
import { buttonConfig, firstIconName } from "#brickflow-ui-icons";
|
|
9
9
|
import Button from "./index.vue";
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<template>
|
|
13
13
|
<div class="flex flex-col gap-3">
|
|
14
14
|
<div class="flex flex-wrap items-center gap-3">
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<Button
|
|
29
|
-
:icon="firstIconName"
|
|
30
|
-
size="lg"
|
|
31
|
-
>
|
|
32
|
-
Button
|
|
33
|
-
</Button>
|
|
34
|
-
<Button
|
|
35
|
-
:icon="firstIconName"
|
|
36
|
-
size="xl"
|
|
37
|
-
>
|
|
38
|
-
Button
|
|
39
|
-
</Button>
|
|
15
|
+
<div
|
|
16
|
+
v-for="(_, size) in buttonConfig.sizeClasses"
|
|
17
|
+
:key="size"
|
|
18
|
+
class="flex flex-col items-center gap-1"
|
|
19
|
+
>
|
|
20
|
+
<span class="text-xs text-zinc-500">{{ size }}</span>
|
|
21
|
+
<Button
|
|
22
|
+
:icon="firstIconName"
|
|
23
|
+
:size="size"
|
|
24
|
+
>
|
|
25
|
+
Button
|
|
26
|
+
</Button>
|
|
27
|
+
</div>
|
|
40
28
|
</div>
|
|
41
29
|
<div class="flex flex-wrap items-center gap-3">
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
Button
|
|
55
|
-
</
|
|
56
|
-
<Button
|
|
57
|
-
:icon="firstIconName"
|
|
58
|
-
rounded
|
|
59
|
-
>
|
|
60
|
-
Button
|
|
61
|
-
</Button>
|
|
62
|
-
<Button
|
|
63
|
-
:icon="firstIconName"
|
|
64
|
-
size="lg"
|
|
65
|
-
rounded
|
|
66
|
-
>
|
|
67
|
-
Button
|
|
68
|
-
</Button>
|
|
69
|
-
<Button
|
|
70
|
-
:icon="firstIconName"
|
|
71
|
-
size="xl"
|
|
72
|
-
rounded
|
|
73
|
-
>
|
|
74
|
-
Button
|
|
75
|
-
</Button>
|
|
30
|
+
<div
|
|
31
|
+
v-for="(_, size) in buttonConfig.sizeClasses"
|
|
32
|
+
:key="size"
|
|
33
|
+
class="flex flex-col items-center gap-1"
|
|
34
|
+
>
|
|
35
|
+
<span class="text-xs text-zinc-500">{{ size }}</span>
|
|
36
|
+
<Button
|
|
37
|
+
:icon="firstIconName"
|
|
38
|
+
:size="size"
|
|
39
|
+
rounded
|
|
40
|
+
>
|
|
41
|
+
Button
|
|
42
|
+
</Button>
|
|
43
|
+
</div>
|
|
76
44
|
</div>
|
|
77
45
|
</div>
|
|
78
46
|
</template>
|
|
@@ -5,13 +5,61 @@ export const uiDemo = {
|
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<script setup>
|
|
8
|
+
import { buttonConfig } from "#brickflow-ui-icons";
|
|
8
9
|
import Button from "./index.vue";
|
|
10
|
+
const firstColorClasses = Object.values(buttonConfig.colorClasses)[0] ?? {};
|
|
9
11
|
</script>
|
|
10
12
|
|
|
11
13
|
<template>
|
|
12
14
|
<div class="flex flex-wrap items-center gap-3">
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
+
<div class="basis-full">
|
|
16
|
+
<div class="relative flex w-fit flex-col items-start gap-3 pl-13">
|
|
17
|
+
<div class="absolute top-0 left-0 z-0 size-full object-cover pt-7 pl-13">
|
|
18
|
+
<img
|
|
19
|
+
src="https://images.unsplash.com/photo-1545346315-f4c47e3e1b55?ixid=M3w4MjcwNjd8MHwxfHNlYXJjaHwyfHxzdHJvbmclMjBtYW58ZW58MHx8fHwxNzg4MjIyNTU1fDA&ixlib=rb-4.1.0&w=1000&h=1000&fit=max&q=80"
|
|
20
|
+
class="top-0 z-0 size-full rounded-xl object-cover opacity-50"
|
|
21
|
+
/>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="flex w-full items-center justify-around gap-3 text-xs text-slate-600">
|
|
24
|
+
<span
|
|
25
|
+
v-for="(_, variant) in firstColorClasses"
|
|
26
|
+
:key="variant"
|
|
27
|
+
>
|
|
28
|
+
{{ variant }}
|
|
29
|
+
</span>
|
|
30
|
+
</div>
|
|
31
|
+
<div
|
|
32
|
+
v-for="(variants, color) in buttonConfig.colorClasses"
|
|
33
|
+
:key="color"
|
|
34
|
+
class="relative flex w-full items-center gap-3 p-2"
|
|
35
|
+
>
|
|
36
|
+
<span class="absolute top-1/2 right-full mr-3 -translate-y-1/2 text-xs text-slate-600">
|
|
37
|
+
{{ color }}
|
|
38
|
+
</span>
|
|
39
|
+
<div
|
|
40
|
+
v-for="(_, variant) in variants"
|
|
41
|
+
:key="variant"
|
|
42
|
+
class="flex flex-col items-stretch gap-2"
|
|
43
|
+
>
|
|
44
|
+
<Button
|
|
45
|
+
disabled
|
|
46
|
+
:color="color"
|
|
47
|
+
:variant="variant"
|
|
48
|
+
>
|
|
49
|
+
Disabled
|
|
50
|
+
</Button>
|
|
51
|
+
<Button
|
|
52
|
+
loading
|
|
53
|
+
:color="color"
|
|
54
|
+
:variant="variant"
|
|
55
|
+
>
|
|
56
|
+
Loading
|
|
57
|
+
</Button>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
15
63
|
<Button to="/">Link</Button>
|
|
16
64
|
<Button block>Block</Button>
|
|
17
65
|
</div>
|
|
@@ -5,13 +5,9 @@ export const uiDemo = {
|
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<script setup>
|
|
8
|
+
import { buttonConfig } from "#brickflow-ui-icons";
|
|
8
9
|
import Button from "./index.vue";
|
|
9
|
-
const
|
|
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 ?? [];
|
|
10
|
+
const firstColorClasses = Object.values(buttonConfig.colorClasses)[0] ?? {};
|
|
15
11
|
</script>
|
|
16
12
|
|
|
17
13
|
<template>
|
|
@@ -22,26 +18,26 @@ const variants = colors[0]?.variants ?? [];
|
|
|
22
18
|
class="top-0 z-0 size-full rounded-xl object-cover opacity-50"
|
|
23
19
|
/>
|
|
24
20
|
</div>
|
|
25
|
-
<div class="flex w-full
|
|
21
|
+
<div class="flex w-full items-center justify-around gap-3 text-xs text-slate-600">
|
|
26
22
|
<span
|
|
27
|
-
v-for="variant in
|
|
23
|
+
v-for="(_, variant) in firstColorClasses"
|
|
28
24
|
:key="variant"
|
|
29
25
|
>
|
|
30
26
|
{{ variant }}
|
|
31
27
|
</span>
|
|
32
28
|
</div>
|
|
33
29
|
<div
|
|
34
|
-
v-for="color in
|
|
35
|
-
:key="color
|
|
36
|
-
class="relative flex w-full
|
|
30
|
+
v-for="(variants, color) in buttonConfig.colorClasses"
|
|
31
|
+
:key="color"
|
|
32
|
+
class="relative flex w-full items-center gap-3 p-2"
|
|
37
33
|
>
|
|
38
34
|
<span class="absolute top-1/2 right-full mr-3 -translate-y-1/2 text-xs text-slate-600">
|
|
39
|
-
{{ color
|
|
35
|
+
{{ color }}
|
|
40
36
|
</span>
|
|
41
37
|
<Button
|
|
42
|
-
v-for="variant in
|
|
38
|
+
v-for="(_, variant) in variants"
|
|
43
39
|
:key="variant"
|
|
44
|
-
:color="color
|
|
40
|
+
:color="color"
|
|
45
41
|
:variant="variant"
|
|
46
42
|
>
|
|
47
43
|
Button
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const uiDemo: {
|
|
2
|
+
description: string;
|
|
3
|
+
title: string;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
8
|
+
//# sourceMappingURL=gallery.demo.vue.d.ts.map
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export const uiDemo = {
|
|
3
|
+
description: "Browse every icon available in the project, filter by name, and click to copy its name.",
|
|
4
|
+
title: "Icon gallery"
|
|
5
|
+
};
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script setup>
|
|
9
|
+
import { computed, onBeforeUnmount, ref } from "vue";
|
|
10
|
+
import { iconNames } from "#brickflow-ui-icons";
|
|
11
|
+
import Icon from "./index.vue";
|
|
12
|
+
const search = ref("");
|
|
13
|
+
const copiedIconName = ref("");
|
|
14
|
+
const copyError = ref("");
|
|
15
|
+
let copiedTimeout;
|
|
16
|
+
const filteredIconNames = computed(() => {
|
|
17
|
+
const query = search.value.trim().toLocaleLowerCase();
|
|
18
|
+
return query ? iconNames.filter((name) => name.toLocaleLowerCase().includes(query)) : iconNames;
|
|
19
|
+
});
|
|
20
|
+
const copyIconName = async (name) => {
|
|
21
|
+
copyError.value = "";
|
|
22
|
+
try {
|
|
23
|
+
await navigator.clipboard.writeText(name);
|
|
24
|
+
clearTimeout(copiedTimeout);
|
|
25
|
+
copiedIconName.value = name;
|
|
26
|
+
copiedTimeout = setTimeout(() => {
|
|
27
|
+
copiedIconName.value = "";
|
|
28
|
+
}, 2e3);
|
|
29
|
+
} catch {
|
|
30
|
+
copyError.value = "Could not copy the icon name. Please try again.";
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
onBeforeUnmount(() => clearTimeout(copiedTimeout));
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<template>
|
|
37
|
+
<div class="space-y-5 text-zinc-100">
|
|
38
|
+
<div class="flex flex-wrap items-center justify-between gap-3">
|
|
39
|
+
<label class="relative block w-full max-w-md">
|
|
40
|
+
<span class="sr-only">Search icons</span>
|
|
41
|
+
<svg
|
|
42
|
+
class="pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-zinc-500"
|
|
43
|
+
aria-hidden="true"
|
|
44
|
+
fill="none"
|
|
45
|
+
stroke="currentColor"
|
|
46
|
+
stroke-linecap="round"
|
|
47
|
+
stroke-linejoin="round"
|
|
48
|
+
stroke-width="2"
|
|
49
|
+
viewBox="0 0 24 24"
|
|
50
|
+
>
|
|
51
|
+
<circle
|
|
52
|
+
cx="11"
|
|
53
|
+
cy="11"
|
|
54
|
+
r="8"
|
|
55
|
+
/>
|
|
56
|
+
<path d="m21 21-4.3-4.3" />
|
|
57
|
+
</svg>
|
|
58
|
+
<input
|
|
59
|
+
v-model="search"
|
|
60
|
+
class="w-full max-w-60 rounded-lg border border-zinc-700 bg-zinc-950 py-2 pr-3 pl-9 text-sm text-zinc-200 caret-blue-400 outline-none placeholder:text-zinc-500 focus:border-blue-400 focus:ring-2 focus:ring-blue-400/20"
|
|
61
|
+
placeholder="Search icon"
|
|
62
|
+
type="search"
|
|
63
|
+
/>
|
|
64
|
+
</label>
|
|
65
|
+
|
|
66
|
+
<p
|
|
67
|
+
class="text-sm text-zinc-400"
|
|
68
|
+
aria-live="polite"
|
|
69
|
+
>
|
|
70
|
+
{{ filteredIconNames.length }} of {{ iconNames.length }} icons
|
|
71
|
+
</p>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<p
|
|
75
|
+
class="sr-only"
|
|
76
|
+
role="status"
|
|
77
|
+
>
|
|
78
|
+
{{ copiedIconName ? `Copied ${copiedIconName}` : "" }}
|
|
79
|
+
</p>
|
|
80
|
+
<p
|
|
81
|
+
v-if="copyError"
|
|
82
|
+
class="text-sm text-red-400"
|
|
83
|
+
role="alert"
|
|
84
|
+
>
|
|
85
|
+
{{ copyError }}
|
|
86
|
+
</p>
|
|
87
|
+
|
|
88
|
+
<ul
|
|
89
|
+
v-if="filteredIconNames.length"
|
|
90
|
+
class="grid grid-cols-6 gap-3 lp:grid-cols-5 tb:grid-cols-4 mb:grid-cols-3 ms:grid-cols-2"
|
|
91
|
+
>
|
|
92
|
+
<li
|
|
93
|
+
v-for="name in filteredIconNames"
|
|
94
|
+
:key="name"
|
|
95
|
+
class="min-w-0"
|
|
96
|
+
>
|
|
97
|
+
<button
|
|
98
|
+
type="button"
|
|
99
|
+
:aria-label="`Copy ${name}`"
|
|
100
|
+
:class="[
|
|
101
|
+
'group flex w-full cursor-pointer flex-col items-center gap-3 rounded-xl border px-3 py-5 transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-400',
|
|
102
|
+
copiedIconName === name ? 'border-green-500/50 bg-green-500/10' : 'border-zinc-900 bg-zinc-950/50 hover:border-zinc-700 hover:bg-zinc-900/70'
|
|
103
|
+
]"
|
|
104
|
+
:title="`Copy ${name}`"
|
|
105
|
+
@click="copyIconName(name)"
|
|
106
|
+
>
|
|
107
|
+
<Icon
|
|
108
|
+
:name="name"
|
|
109
|
+
aria-hidden="true"
|
|
110
|
+
class="text-3xl text-zinc-100"
|
|
111
|
+
/>
|
|
112
|
+
<span
|
|
113
|
+
:class="[
|
|
114
|
+
'w-full truncate text-center font-mono text-xs transition-colors',
|
|
115
|
+
copiedIconName === name ? 'text-green-400' : 'text-zinc-400 group-hover:text-zinc-100'
|
|
116
|
+
]"
|
|
117
|
+
>
|
|
118
|
+
{{ copiedIconName === name ? "Copied" : name }}
|
|
119
|
+
</span>
|
|
120
|
+
</button>
|
|
121
|
+
</li>
|
|
122
|
+
</ul>
|
|
123
|
+
|
|
124
|
+
<div
|
|
125
|
+
v-else
|
|
126
|
+
class="rounded-xl border border-dashed border-zinc-700 px-6 py-12 text-center"
|
|
127
|
+
>
|
|
128
|
+
<p class="text-sm font-medium text-zinc-200">No icons found</p>
|
|
129
|
+
<p class="mt-1 text-sm text-zinc-500">Try another name.</p>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
</template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const uiDemo: {
|
|
2
|
+
description: string;
|
|
3
|
+
title: string;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
8
|
+
//# sourceMappingURL=gallery.demo.vue.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brickflow/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.41",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "brickflow UI Nuxt module.",
|
|
6
6
|
"files": [
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@brickflow/lint": "workspace:*",
|
|
43
43
|
"@brickflow/prettier": "workspace:*",
|
|
44
|
-
"@nuxt/kit": "4.5.
|
|
44
|
+
"@nuxt/kit": "4.5.2",
|
|
45
45
|
"@nuxt/module-builder": "1.0.3",
|
|
46
|
-
"nuxt": "4.5.
|
|
47
|
-
"vue": "3.5.
|
|
48
|
-
"vue-tsc": "3.3.
|
|
46
|
+
"nuxt": "4.5.2",
|
|
47
|
+
"vue": "3.5.42",
|
|
48
|
+
"vue-tsc": "3.3.11"
|
|
49
49
|
},
|
|
50
50
|
"author": "",
|
|
51
51
|
"license": "ISC"
|