@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.
@@ -1,42 +1,48 @@
1
1
  import type { RouteLocationRaw } from 'vue-router';
2
- type __VLS_Props = {
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?: ButtonColor;
6
+ color?: string;
5
7
  disabled?: boolean;
6
8
  icon?: string;
7
9
  loading?: boolean;
8
10
  rounded?: boolean;
9
- size?: ButtonSize;
11
+ size?: string;
10
12
  square?: boolean;
11
13
  to?: RouteLocationRaw;
12
14
  trailingIcon?: string;
13
- type?: 'button' | 'reset' | 'submit';
14
- variant?: ButtonVariant;
15
- };
16
- type ButtonColor = 'alt' | 'danger' | 'info' | 'main' | 'plain' | 'warn' | 'win';
17
- type ButtonSize = 'lg' | 'md' | 'sm' | 'xl' | 'xs';
18
- type ButtonVariant = 'ghost' | 'glass' | 'soft' | 'solid' | 'subtle';
19
- declare var __VLS_10: {}, __VLS_22: {}, __VLS_24: {};
20
- type __VLS_Slots = {} & {
21
- leading?: (props: typeof __VLS_10) => any;
22
- } & {
23
- default?: (props: typeof __VLS_22) => any;
24
- } & {
25
- trailing?: (props: typeof __VLS_24) => any;
26
- };
27
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
28
- size: ButtonSize;
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: ButtonVariant;
36
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
37
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
38
- declare const _default: typeof __VLS_export;
39
- export default _default;
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 flex-wrap items-start gap-3 pl-13">
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://picsum.photos/1000/1000"
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-plain-600">
20
- <span>solid</span>
21
- <span>ghost</span>
22
- <span>glass</span>
23
- <span>soft</span>
24
- <span>subtle</span>
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
- class="absolute top-0 left-0 flex h-full flex-col items-center justify-around gap-3 pt-7 text-xs text-plain-600"
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>main</span>
30
- <span>plain</span>
31
- <span>alt</span>
32
- <span>danger</span>
33
- <span>info</span>
34
- <span>warn</span>
35
- <span>win</span>
36
- </div>
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-plain-100">
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-plain-700 bg-plain-900 px-3 py-2 text-sm text-plain-100 outline-none focus:border-main-400"
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-win-400"
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-main-300 hover:text-main-200"
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-main-300 hover:text-main-200"
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 base: boolean;
3
- readonly baseClass: "sm:hidden";
4
- readonly lg: boolean;
5
- readonly lgClass: "max-lg:hidden xl:hidden";
6
- readonly md: boolean;
7
- readonly mdClass: "max-md:hidden lg:hidden";
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 sm: boolean;
10
- readonly smClass: "max-sm:hidden md:hidden";
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
- base: true,
4
- lg: true,
5
- md: true,
6
- sm: true,
7
- xl: true,
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
- base: "(width < 40rem)",
12
- lg: "(64rem <= width < 80rem)",
13
- md: "(48rem <= width < 64rem)",
14
- sm: "(40rem <= width < 48rem)",
15
- xl: "(80rem <= width < 96rem)",
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 base() {
40
- return state.base;
37
+ get dk() {
38
+ return state.dk;
41
39
  },
42
- baseClass: "sm:hidden",
43
- get lg() {
44
- return state.lg;
40
+ dkClass: "dkHidden",
41
+ get lp() {
42
+ return state.lp;
45
43
  },
46
- lgClass: "max-lg:hidden xl:hidden",
47
- get md() {
48
- return state.md;
44
+ lpClass: "lpHidden",
45
+ get mb() {
46
+ return state.mb;
49
47
  },
50
- mdClass: "max-md:hidden lg:hidden",
51
- ready,
52
- get sm() {
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
- xlClass: "max-xl:hidden 2xl:hidden",
60
- get xxl() {
61
- return state.xxl;
52
+ msClass: "msHidden",
53
+ ready,
54
+ get tb() {
55
+ return state.tb;
62
56
  },
63
- xxlClass: "max-2xl:hidden"
57
+ tbClass: "tbHidden"
64
58
  };
65
59
  export function useScreen() {
66
60
  onMounted(initialize);
@@ -3,7 +3,9 @@ export {}
3
3
  declare module '#brickflow-ui-config' {
4
4
  import type { BrickflowUiConfig } from './tailwind'
5
5
 
6
- export const UI_STYLE: BrickflowUiConfig['uiStyles']
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
  }