@brickflow/ui 0.0.31 → 0.0.33

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 CHANGED
@@ -4,7 +4,7 @@
4
4
  },
5
5
  "configKey": "brickflowUi",
6
6
  "name": "@brickflow/ui",
7
- "version": "0.0.31",
7
+ "version": "0.0.33",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.3",
10
10
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -608,6 +608,9 @@ const module$1 = defineNuxtModule({
608
608
  nuxt.hook("pages:extend", (pages) => {
609
609
  pages.push({
610
610
  file: resolver.resolve("./runtime/pages/ui.vue"),
611
+ meta: {
612
+ layout: false
613
+ },
611
614
  name: "brickflow-ui",
612
615
  path: "/ui"
613
616
  });
@@ -15,7 +15,7 @@ type __VLS_Props = {
15
15
  };
16
16
  type ButtonColor = 'alt' | 'danger' | 'info' | 'main' | 'plain' | 'warn' | 'win';
17
17
  type ButtonSize = 'lg' | 'md' | 'sm' | 'xl' | 'xs';
18
- type ButtonVariant = 'ghost' | 'glass' | 'soft' | 'solid' | 'subtle';
18
+ type ButtonVariant = 'ghost' | 'mist' | 'soft' | 'solid' | 'subtle';
19
19
  declare var __VLS_10: {}, __VLS_22: {}, __VLS_24: {};
20
20
  type __VLS_Slots = {} & {
21
21
  leading?: (props: typeof __VLS_10) => any;
@@ -27,8 +27,8 @@ type __VLS_Slots = {} & {
27
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
28
  size: ButtonSize;
29
29
  type: "button" | "reset" | "submit";
30
- to: RouteLocationRaw;
31
30
  color: ButtonColor;
31
+ to: RouteLocationRaw;
32
32
  icon: string;
33
33
  rounded: boolean;
34
34
  trailingIcon: string;
@@ -33,49 +33,49 @@ const sizeIconClasses = {
33
33
  const colorClasses = {
34
34
  alt: {
35
35
  ghost: UI_STYLE.color.alt.ghost,
36
- glass: UI_STYLE.color.alt.glass,
36
+ mist: UI_STYLE.color.alt.mist,
37
37
  soft: UI_STYLE.color.alt.soft,
38
38
  solid: UI_STYLE.color.alt.solid,
39
39
  subtle: UI_STYLE.color.alt.subtle
40
40
  },
41
41
  danger: {
42
42
  ghost: UI_STYLE.color.danger.ghost,
43
- glass: UI_STYLE.color.danger.glass,
43
+ mist: UI_STYLE.color.danger.mist,
44
44
  soft: UI_STYLE.color.danger.soft,
45
45
  solid: UI_STYLE.color.danger.solid,
46
46
  subtle: UI_STYLE.color.danger.subtle
47
47
  },
48
48
  info: {
49
49
  ghost: UI_STYLE.color.info.ghost,
50
- glass: UI_STYLE.color.info.glass,
50
+ mist: UI_STYLE.color.info.mist,
51
51
  soft: UI_STYLE.color.info.soft,
52
52
  solid: UI_STYLE.color.info.solid,
53
53
  subtle: UI_STYLE.color.info.subtle
54
54
  },
55
55
  main: {
56
56
  ghost: UI_STYLE.color.main.ghost,
57
- glass: UI_STYLE.color.main.glass,
57
+ mist: UI_STYLE.color.main.mist,
58
58
  soft: UI_STYLE.color.main.soft,
59
59
  solid: UI_STYLE.color.main.solid,
60
60
  subtle: UI_STYLE.color.main.subtle
61
61
  },
62
62
  plain: {
63
63
  ghost: UI_STYLE.color.plain.ghost,
64
- glass: UI_STYLE.color.plain.glass,
64
+ mist: UI_STYLE.color.plain.mist,
65
65
  soft: UI_STYLE.color.plain.soft,
66
66
  solid: UI_STYLE.color.plain.solid,
67
67
  subtle: UI_STYLE.color.plain.subtle
68
68
  },
69
69
  warn: {
70
70
  ghost: UI_STYLE.color.warn.ghost,
71
- glass: UI_STYLE.color.warn.glass,
71
+ mist: UI_STYLE.color.warn.mist,
72
72
  soft: UI_STYLE.color.warn.soft,
73
73
  solid: UI_STYLE.color.warn.solid,
74
74
  subtle: UI_STYLE.color.warn.subtle
75
75
  },
76
76
  win: {
77
77
  ghost: UI_STYLE.color.win.ghost,
78
- glass: UI_STYLE.color.win.glass,
78
+ mist: UI_STYLE.color.win.mist,
79
79
  soft: UI_STYLE.color.win.soft,
80
80
  solid: UI_STYLE.color.win.solid,
81
81
  subtle: UI_STYLE.color.win.subtle
@@ -15,7 +15,7 @@ type __VLS_Props = {
15
15
  };
16
16
  type ButtonColor = 'alt' | 'danger' | 'info' | 'main' | 'plain' | 'warn' | 'win';
17
17
  type ButtonSize = 'lg' | 'md' | 'sm' | 'xl' | 'xs';
18
- type ButtonVariant = 'ghost' | 'glass' | 'soft' | 'solid' | 'subtle';
18
+ type ButtonVariant = 'ghost' | 'mist' | 'soft' | 'solid' | 'subtle';
19
19
  declare var __VLS_10: {}, __VLS_22: {}, __VLS_24: {};
20
20
  type __VLS_Slots = {} & {
21
21
  leading?: (props: typeof __VLS_10) => any;
@@ -27,8 +27,8 @@ type __VLS_Slots = {} & {
27
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
28
  size: ButtonSize;
29
29
  type: "button" | "reset" | "submit";
30
- to: RouteLocationRaw;
31
30
  color: ButtonColor;
31
+ to: RouteLocationRaw;
32
32
  icon: string;
33
33
  rounded: boolean;
34
34
  trailingIcon: string;
@@ -16,15 +16,15 @@ import Button from "./index.vue";
16
16
  class="top-0 z-0 size-full rounded-xl object-cover opacity-50"
17
17
  />
18
18
  </div>
19
- <div class="flex w-full flex-wrap items-center justify-around gap-3 text-xs text-plain-600">
19
+ <div class="flex w-full flex-wrap items-center justify-around gap-3 text-xs text-slate-600">
20
20
  <span>solid</span>
21
21
  <span>ghost</span>
22
- <span>glass</span>
22
+ <span>mist</span>
23
23
  <span>soft</span>
24
24
  <span>subtle</span>
25
25
  </div>
26
26
  <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"
27
+ class="absolute top-0 left-0 flex h-full flex-col items-center justify-around gap-3 pt-7 text-xs text-slate-600"
28
28
  >
29
29
  <span>main</span>
30
30
  <span>plain</span>
@@ -37,7 +37,7 @@ import Button from "./index.vue";
37
37
  <div class="flex flex-wrap items-center gap-3 p-2">
38
38
  <Button>Button</Button>
39
39
  <Button variant="ghost">Button</Button>
40
- <Button variant="glass">Button</Button>
40
+ <Button variant="mist">Button</Button>
41
41
  <Button variant="soft">Button</Button>
42
42
  <Button variant="subtle">Button</Button>
43
43
  </div>
@@ -51,7 +51,7 @@ import Button from "./index.vue";
51
51
  </Button>
52
52
  <Button
53
53
  color="plain"
54
- variant="glass"
54
+ variant="mist"
55
55
  >
56
56
  Button
57
57
  </Button>
@@ -78,7 +78,7 @@ import Button from "./index.vue";
78
78
  </Button>
79
79
  <Button
80
80
  color="alt"
81
- variant="glass"
81
+ variant="mist"
82
82
  >
83
83
  Button
84
84
  </Button>
@@ -105,7 +105,7 @@ import Button from "./index.vue";
105
105
  </Button>
106
106
  <Button
107
107
  color="danger"
108
- variant="glass"
108
+ variant="mist"
109
109
  >
110
110
  Button
111
111
  </Button>
@@ -132,7 +132,7 @@ import Button from "./index.vue";
132
132
  </Button>
133
133
  <Button
134
134
  color="info"
135
- variant="glass"
135
+ variant="mist"
136
136
  >
137
137
  Button
138
138
  </Button>
@@ -159,7 +159,7 @@ import Button from "./index.vue";
159
159
  </Button>
160
160
  <Button
161
161
  color="warn"
162
- variant="glass"
162
+ variant="mist"
163
163
  >
164
164
  Button
165
165
  </Button>
@@ -186,7 +186,7 @@ import Button from "./index.vue";
186
186
  </Button>
187
187
  <Button
188
188
  color="win"
189
- variant="glass"
189
+ variant="mist"
190
190
  >
191
191
  Button
192
192
  </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);
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
2
  import { useHead, useRoute, useRouter } from "nuxt/app";
3
- import { computed, nextTick, ref, watch } from "vue";
3
+ import { computed, nextTick, onMounted, ref, watch } from "vue";
4
4
  import { uiComponents } from "#brickflow-ui-catalog";
5
5
  import { uiThemeEnabled } from "#brickflow-ui-options";
6
6
  import { useTheme } from "../composables/useTheme";
@@ -18,6 +18,7 @@ const router = useRouter();
18
18
  const expandedDemoCode = ref(/* @__PURE__ */ new Set());
19
19
  const isNavigationOpen = ref(false);
20
20
  const mobileNavigation = ref();
21
+ const colorSwatchesReady = ref(false);
21
22
  const stylesExpanded = ref(false);
22
23
  const theme = uiThemeEnabled ? useTheme() : void 0;
23
24
  const isDark = computed(() => theme?.isDark.value ?? false);
@@ -231,17 +232,20 @@ const highlightTailwindValue = (value) => {
231
232
  return html + token("ui-code-string", escapeHtml(value.slice(lastIndex)));
232
233
  };
233
234
  const getTailwindColorSwatch = (utility) => {
234
- const themeColor = utility.match(
235
- /(?:^|-)(alt|danger|info|main|plain|warn|win)-(50|100|200|300|400|500|600|700|800|900|950)(?:\/(\d{1,3}))?(?:$|-)/
235
+ const match = utility.match(
236
+ /^(?:accent|bg|border|caret|decoration|divide|fill|from|outline|ring|shadow|stroke|text|to|via)-([a-z][a-z0-9-]*)(?:\/(\d{1,3}))?$/
236
237
  );
237
- const neutralColor = utility.match(/(?:^|-)(black|white)(?:\/(\d{1,3}))?$/);
238
- const match = themeColor ?? neutralColor;
239
- if (!match) {
238
+ if (!colorSwatchesReady.value || !match || typeof window === "undefined") {
240
239
  return "";
241
240
  }
242
- const [, name, shade, opacity] = match;
243
- const color = shade ? `var(--color-${name}-${shade})` : `var(--color-${name})`;
244
- const background = opacity ? `color-mix(in srgb, ${color} ${opacity}%, transparent)` : color;
241
+ const [, name, opacity] = match;
242
+ const colorVariable = `--color-${name}`;
243
+ const color = getComputedStyle(document.body).getPropertyValue(colorVariable).trim();
244
+ if (!color || !CSS.supports("color", color)) {
245
+ return "";
246
+ }
247
+ const opacityValue = opacity && Number(opacity) <= 100 ? Number(opacity) : void 0;
248
+ const background = opacityValue ? `color-mix(in srgb, var(${colorVariable}) ${opacityValue}%, transparent)` : `var(${colorVariable})`;
245
249
  return `<span aria-hidden="true" class="ui-color-swatch" style="--ui-color-swatch: ${background}"></span>`;
246
250
  };
247
251
  const highlightTailwindUtility = (utility) => {
@@ -302,6 +306,9 @@ const toggleDemoCode = (demoId) => {
302
306
  const closeNavigation = () => {
303
307
  isNavigationOpen.value = false;
304
308
  };
309
+ onMounted(() => {
310
+ colorSwatchesReady.value = true;
311
+ });
305
312
  watch(isNavigationOpen, async (isOpen) => {
306
313
  if (isOpen) {
307
314
  await nextTick();
@@ -339,17 +346,17 @@ watch(
339
346
  </script>
340
347
 
341
348
  <template>
342
- <main class="min-h-screen">
349
+ <main class="min-h-screen bg-zinc-950 text-zinc-100">
343
350
  <header
344
- class="sticky top-0 z-30 flex items-center justify-between gap-4 border-b border-plain-800 bg-plain-950/95 px-4 py-3 backdrop-blur md:hidden"
351
+ class="sticky top-0 z-30 flex items-center justify-between gap-4 border-b border-zinc-800 bg-zinc-950/95 px-4 py-3 backdrop-blur dk:hidden"
345
352
  >
346
353
  <div class="min-w-0">
347
- <p class="text-xs font-medium tracking-widest text-plain-500 uppercase">Components</p>
348
- <p class="truncate text-sm font-medium text-plain-100">{{ activeComponent?.name }}</p>
354
+ <p class="text-xs font-medium tracking-widest text-zinc-500 uppercase">Components</p>
355
+ <p class="truncate text-sm font-medium text-zinc-100">{{ activeComponent?.name }}</p>
349
356
  </div>
350
357
  <button
351
358
  type="button"
352
- class="flex size-10 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-plain-700 text-plain-200 transition hover:border-main-700 hover:bg-main-900 hover:text-main-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-main-400"
359
+ class="flex size-10 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-zinc-700 text-zinc-200 transition hover:border-blue-700 hover:bg-blue-900 hover:text-blue-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-400"
353
360
  aria-controls="ui-mobile-navigation"
354
361
  :aria-expanded="isNavigationOpen"
355
362
  aria-label="Open components menu"
@@ -371,7 +378,7 @@ watch(
371
378
 
372
379
  <div
373
380
  v-if="isNavigationOpen"
374
- class="fixed inset-0 z-40 md:hidden"
381
+ class="fixed inset-0 z-40 dk:hidden"
375
382
  @keydown.esc="closeNavigation"
376
383
  >
377
384
  <button
@@ -383,16 +390,16 @@ watch(
383
390
  <aside
384
391
  id="ui-mobile-navigation"
385
392
  ref="mobileNavigation"
386
- class="relative flex h-full flex-col border-r border-plain-800 bg-plain-950 p-4 shadow-2xl"
393
+ class="relative flex h-full flex-col border-r border-zinc-800 bg-zinc-950 p-4 shadow-2xl"
387
394
  :class="$style.mobileNavigation"
388
395
  aria-label="UI components"
389
396
  tabindex="-1"
390
397
  >
391
398
  <div class="flex items-center justify-between gap-4 px-2 py-1">
392
- <p class="text-xs font-medium tracking-widest text-plain-500 uppercase">Components</p>
399
+ <p class="text-xs font-medium tracking-widest text-zinc-500 uppercase">Components</p>
393
400
  <button
394
401
  type="button"
395
- class="flex size-8 cursor-pointer items-center justify-center rounded-lg text-plain-400 transition hover:bg-plain-900 hover:text-plain-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-main-400"
402
+ class="flex size-8 cursor-pointer items-center justify-center rounded-lg text-zinc-400 transition hover:bg-zinc-900 hover:text-zinc-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-400"
396
403
  aria-label="Close components menu"
397
404
  @click="closeNavigation"
398
405
  >
@@ -419,7 +426,7 @@ watch(
419
426
  :aria-current="activeComponent?.id === component.id ? 'page' : void 0"
420
427
  :class="[
421
428
  'block rounded-lg px-3 py-2.5 text-sm transition',
422
- activeComponent?.id === component.id ? 'bg-main-900 text-main-100' : 'text-plain-400 hover:bg-plain-900 hover:text-plain-100'
429
+ activeComponent?.id === component.id ? 'bg-blue-900 text-blue-100' : 'text-zinc-400 hover:bg-zinc-900 hover:text-zinc-100'
423
430
  ]"
424
431
  :to="{
425
432
  path: '/ui',
@@ -437,8 +444,8 @@ watch(
437
444
  </div>
438
445
 
439
446
  <div class="mx-auto flex min-h-screen max-w-7xl">
440
- <aside class="hidden w-64 shrink-0 border-r border-plain-800 px-4 py-6 md:block">
441
- <p class="px-3 text-xs font-medium tracking-widest text-plain-500 uppercase">Components</p>
447
+ <aside class="hidden w-64 shrink-0 border-r border-zinc-800 px-4 py-6 dk:block">
448
+ <p class="px-3 text-xs font-medium tracking-widest text-zinc-500 uppercase">Components</p>
442
449
 
443
450
  <nav
444
451
  class="sticky top-2 mt-4 space-y-1"
@@ -450,7 +457,7 @@ watch(
450
457
  :aria-current="activeComponent?.id === component.id ? 'page' : void 0"
451
458
  :class="[
452
459
  'block rounded-lg px-3 py-2 text-sm transition',
453
- activeComponent?.id === component.id ? 'bg-main-900 text-main-100' : 'text-plain-400 hover:bg-plain-900 hover:text-plain-100'
460
+ activeComponent?.id === component.id ? 'bg-blue-900 text-blue-100' : 'text-zinc-400 hover:bg-zinc-900 hover:text-zinc-100'
454
461
  ]"
455
462
  :to="{
456
463
  path: '/ui',
@@ -465,14 +472,14 @@ watch(
465
472
  </nav>
466
473
  </aside>
467
474
 
468
- <section class="min-w-0 flex-1 px-4 py-6 sm:px-6 md:px-10">
475
+ <section class="min-w-0 flex-1 px-10 py-6 lp:px-6 mb:px-4">
469
476
  <template v-if="activeComponent">
470
477
  <div class="flex items-center gap-3">
471
- <h1 class="text-2xl leading-1 font-semibold sm:text-3xl">{{ activeComponent.name }}</h1>
478
+ <h1 class="text-3xl leading-tight font-semibold mb:text-2xl">{{ activeComponent.name }}</h1>
472
479
  <button
473
480
  v-if="uiThemeEnabled"
474
481
  type="button"
475
- class="flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-plain-700 text-plain-400 transition hover:border-main-700 hover:bg-main-900 hover:text-main-200 focus-visible:outline-2 focus-visible:outline-offset-2"
482
+ class="flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-lg border border-zinc-700 text-zinc-400 transition hover:border-blue-700 hover:bg-blue-900 hover:text-blue-200 focus-visible:outline-2 focus-visible:outline-offset-2"
476
483
  :aria-label="isDark ? 'Switch to light theme' : 'Switch to dark theme'"
477
484
  :title="isDark ? 'Switch to light theme' : 'Switch to dark theme'"
478
485
  @click="toggleTheme"
@@ -515,16 +522,16 @@ watch(
515
522
  <section
516
523
  v-for="demo in activeComponent.demos"
517
524
  :key="demo.title"
518
- class="mt-6 overflow-hidden rounded-2xl border border-plain-800 bg-plain-900/50 first:mt-8"
525
+ class="mt-6 overflow-hidden rounded-2xl border border-zinc-800 bg-zinc-900/50 first:mt-8"
519
526
  >
520
527
  <header
521
- class="flex items-start justify-between gap-3 border-b border-plain-800 bg-plain-900 px-4 py-3 sm:gap-4 sm:px-8 sm:py-4"
528
+ class="flex items-start justify-between gap-4 border-b border-zinc-800 bg-zinc-900 px-8 py-4 mb:gap-3 mb:px-4 mb:py-3"
522
529
  >
523
530
  <div>
524
- <h2 class="text-base font-medium text-plain-100">{{ demo.title }}</h2>
531
+ <h2 class="text-base font-medium text-zinc-100">{{ demo.title }}</h2>
525
532
  <p
526
533
  v-if="demo.description"
527
- class="mt-1 text-sm text-plain-400"
534
+ class="mt-1 text-sm text-zinc-400"
528
535
  >
529
536
  {{ demo.description }}
530
537
  </p>
@@ -533,8 +540,8 @@ watch(
533
540
  type="button"
534
541
  :aria-label="isDemoCodeExpanded(demo.id) ? 'Hide code' : 'View code'"
535
542
  :class="[
536
- 'flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md border transition focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-main-400',
537
- isDemoCodeExpanded(demo.id) ? 'border-main-700 bg-main-900 text-main-200' : 'border-plain-700 text-plain-400 hover:border-main-700 hover:text-main-200'
543
+ 'flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md border transition focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-400',
544
+ isDemoCodeExpanded(demo.id) ? 'border-blue-700 bg-blue-900 text-blue-200' : 'border-zinc-700 text-zinc-400 hover:border-blue-700 hover:text-blue-200'
538
545
  ]"
539
546
  :title="isDemoCodeExpanded(demo.id) ? 'Hide code' : 'View code'"
540
547
  @click="toggleDemoCode(demo.id)"
@@ -555,56 +562,58 @@ watch(
555
562
  </svg>
556
563
  </button>
557
564
  </header>
558
- <div class="p-4 sm:p-8">
565
+ <div class="p-8 mb:p-4">
559
566
  <component :is="demo.component" />
560
567
  </div>
561
568
  <div
562
569
  v-if="isDemoCodeExpanded(demo.id)"
563
- class="border-t border-plain-800 bg-plain-950/80 p-4 sm:p-8"
570
+ class="border-t border-zinc-800 bg-zinc-950/80 p-8 mb:p-4"
564
571
  >
565
572
  <pre
566
- class="overflow-x-auto text-sm leading-6 text-plain-300"
573
+ class="overflow-x-auto text-sm leading-6 text-zinc-300"
567
574
  ><code v-html="highlightDemoCode(demo.code.trim())" /></pre>
568
575
  </div>
569
576
  </section>
570
577
  <p
571
578
  v-if="activeComponent.demos.length === 0"
572
- class="mt-8 text-plain-400"
579
+ class="mt-8 text-zinc-400"
573
580
  >
574
581
  Add a
575
- <code class="text-plain-200">*.demo.vue</code>
582
+ <code class="text-zinc-200">*.demo.vue</code>
576
583
  file to this component folder.
577
584
  </p>
578
- <section class="mt-8 overflow-hidden rounded-2xl border border-plain-800 bg-plain-900/50">
579
- <header class="border-b border-plain-800 bg-plain-900 px-4 py-3 sm:px-8 sm:py-4">
580
- <h2 class="text-base font-medium text-plain-100">Component API</h2>
585
+ <section class="mt-8 overflow-hidden rounded-2xl border border-zinc-800 bg-zinc-900/50">
586
+ <header class="border-b border-zinc-800 bg-zinc-900 px-8 py-4 mb:px-4 mb:py-3">
587
+ <h2 class="text-base font-medium text-zinc-100">Component API</h2>
581
588
  </header>
582
589
 
583
- <div class="grid divide-y divide-plain-800 lg:grid-cols-2 lg:divide-x lg:divide-y-0">
584
- <section class="px-4 py-5 sm:px-6">
585
- <h3 class="text-sm font-medium text-plain-200">Props</h3>
590
+ <div
591
+ class="grid grid-cols-2 divide-x divide-y-0 divide-zinc-800 tb:grid-cols-1 tb:divide-x-0 tb:divide-y"
592
+ >
593
+ <section class="px-6 py-5 mb:px-4">
594
+ <h3 class="text-sm font-medium text-zinc-200">Props</h3>
586
595
  <div class="mt-4 overflow-x-auto">
587
- <table class="w-full min-w-80 text-left text-sm sm:min-w-96">
588
- <!-- <thead class="text-xs tracking-wider text-plain-500 uppercase">
596
+ <table class="w-full min-w-96 text-left text-sm mb:min-w-80">
597
+ <!-- <thead class="text-xs tracking-wider text-zinc-500 uppercase">
589
598
  <tr>
590
599
  <th class="pb-3 font-medium">Name</th>
591
600
  <th class="pb-3 font-medium">Type</th>
592
601
  <th class="pb-3 text-right font-medium">Required</th>
593
602
  </tr>
594
603
  </thead> -->
595
- <tbody class="divide-y divide-plain-800 text-plain-300">
604
+ <tbody class="divide-y divide-zinc-800 text-zinc-300">
596
605
  <tr
597
606
  v-for="prop in activeComponent.props"
598
607
  :key="prop.name"
599
608
  >
600
- <td class="py-3 pr-4 font-mono text-plain-400">{{ prop.name }}</td>
609
+ <td class="py-3 pr-4 font-mono text-zinc-400">{{ prop.name }}</td>
601
610
  <td
602
611
  class="py-3 pr-4 font-mono text-xs break-all"
603
612
  v-html="highlightPropType(prop.type)"
604
613
  />
605
614
  <td
606
615
  class="py-3 text-right text-xs"
607
- :class="prop.required ? 'text-danger-600' : 'text-plain-500'"
616
+ :class="prop.required ? 'text-red-600' : 'text-zinc-500'"
608
617
  >
609
618
  {{ prop.required ? "*" : "-" }}
610
619
  </td>
@@ -612,7 +621,7 @@ watch(
612
621
  <tr v-if="activeComponent.props.length === 0">
613
622
  <td
614
623
  colspan="3"
615
- class="py-3 text-plain-500"
624
+ class="py-3 text-zinc-500"
616
625
  >
617
626
  No props declared.
618
627
  </td>
@@ -622,8 +631,8 @@ watch(
622
631
  </div>
623
632
  </section>
624
633
 
625
- <section class="px-4 py-5 sm:px-6">
626
- <h3 class="text-sm font-medium text-plain-200">Slots</h3>
634
+ <section class="px-6 py-5 mb:px-4">
635
+ <h3 class="text-sm font-medium text-zinc-200">Slots</h3>
627
636
  <div
628
637
  v-if="activeComponent.slots.length"
629
638
  class="mt-4 flex flex-wrap gap-2"
@@ -631,15 +640,15 @@ watch(
631
640
  <code
632
641
  v-for="slot in activeComponent.slots"
633
642
  :key="slot"
634
- class="rounded-md border border-plain-800 bg-plain-950 px-2.5 py-1.5 text-xs"
635
- :class="slot === 'default' ? 'text-plain-500' : 'text-plain-400'"
643
+ class="rounded-md border border-zinc-800 bg-zinc-950 px-2.5 py-1.5 text-xs"
644
+ :class="slot === 'default' ? 'text-zinc-500' : 'text-zinc-400'"
636
645
  >
637
646
  {{ slot }}
638
647
  </code>
639
648
  </div>
640
649
  <p
641
650
  v-else
642
- class="mt-4 text-sm text-plain-500"
651
+ class="mt-4 text-sm text-zinc-500"
643
652
  >
644
653
  No slots detected.
645
654
  </p>
@@ -649,32 +658,32 @@ watch(
649
658
 
650
659
  <section
651
660
  v-if="activeComponent.styles.length"
652
- class="mt-6 overflow-hidden rounded-2xl border border-plain-800 bg-plain-900/50"
661
+ class="mt-6 overflow-hidden rounded-2xl border border-zinc-800 bg-zinc-900/50"
653
662
  >
654
663
  <header
655
- class="flex items-center justify-between gap-3 border-b border-plain-800 bg-plain-900 px-4 py-3 sm:gap-4 sm:px-8 sm:py-4"
664
+ class="flex items-center justify-between gap-4 border-b border-zinc-800 bg-zinc-900 px-8 py-4 mb:gap-3 mb:px-4 mb:py-3"
656
665
  >
657
666
  <div class="flex items-center gap-3">
658
667
  <div>
659
- <h2 class="text-base font-medium text-plain-100">UI styles</h2>
668
+ <h2 class="text-base font-medium text-zinc-100">UI styles</h2>
660
669
  </div>
661
670
  </div>
662
- <span class="rounded-full border border-plain-700 px-2.5 py-1 text-xs text-plain-400">
671
+ <span class="rounded-full border border-zinc-700 px-2.5 py-1 text-xs text-zinc-400">
663
672
  {{ activeComponent.styles.length }} fields
664
673
  </span>
665
674
  </header>
666
675
 
667
- <div class="px-4 py-2 sm:px-8">
668
- <div class="divide-y divide-plain-800">
676
+ <div class="px-8 py-2 mb:px-4">
677
+ <div class="divide-y divide-zinc-800">
669
678
  <div
670
679
  v-for="style in visibleStyles"
671
680
  :key="style.path"
672
- class="grid gap-2 py-4 sm:gap-6"
681
+ class="grid gap-6 py-4 mb:gap-2"
673
682
  :class="$style.styleGrid"
674
683
  >
675
- <code class="font-mono text-xs text-main-300">{{ style.path }}</code>
684
+ <code class="font-mono text-xs text-blue-300">{{ style.path }}</code>
676
685
  <code
677
- class="font-mono text-xs wrap-break-word text-plain-300"
686
+ class="font-mono text-xs wrap-break-word text-zinc-300"
678
687
  :class="$style.styleValue"
679
688
  v-html="highlightStyleValue(style.value)"
680
689
  />
@@ -684,11 +693,11 @@ watch(
684
693
 
685
694
  <footer
686
695
  v-if="activeComponent.styles.length > 5"
687
- class="sticky bottom-0 z-10 border-t border-plain-800 bg-plain-900/95 px-4 py-3 backdrop-blur sm:px-8"
696
+ class="sticky bottom-0 z-10 border-t border-zinc-800 bg-zinc-900/95 px-8 py-3 backdrop-blur mb:px-4"
688
697
  >
689
698
  <button
690
699
  type="button"
691
- class="flex w-full cursor-pointer items-center justify-center text-sm font-medium text-info-500 transition hover:text-info-400 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-info-400"
700
+ class="flex w-full cursor-pointer items-center justify-center text-sm font-medium text-cyan-500 transition hover:text-cyan-400 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-cyan-400"
692
701
  @click="stylesExpanded = !stylesExpanded"
693
702
  >
694
703
  {{ stylesExpanded ? "Collapse styles" : `Show all ${activeComponent.styles.length} styles` }}
@@ -699,12 +708,12 @@ watch(
699
708
 
700
709
  <p
701
710
  v-else
702
- class="text-plain-400"
711
+ class="text-zinc-400"
703
712
  >
704
713
  Add
705
- <code class="text-plain-200">Component/index.vue</code>
714
+ <code class="text-zinc-200">Component/index.vue</code>
706
715
  and a
707
- <code class="text-plain-200">*.demo.vue</code>
716
+ <code class="text-zinc-200">*.demo.vue</code>
708
717
  file to show it here.
709
718
  </p>
710
719
  </section>
@@ -713,5 +722,5 @@ watch(
713
722
  </template>
714
723
 
715
724
  <style module>
716
- :global(.ui-code-comment){color:var(--color-plain-500)}:global(.ui-code-string){color:var(--color-win-400)}:global(.ui-code-keyword){color:var(--color-main-400)}:global(.ui-code-number){color:var(--color-warn-300)}:global(.ui-code-tag){color:var(--color-info-500)}:global(.ui-code-attribute){color:var(--color-alt-300)}:global(.ui-code-punctuation){color:var(--color-plain-400)}:global(.ui-color-swatch){background:var(--ui-color-swatch);border:1px solid hsla(0,0%,100%,.1);border-radius:.2rem;display:inline-block;height:.65rem;margin-right:.25rem;opacity:.85;vertical-align:-.1rem;width:.65rem}.mobileNavigation{width:min(18rem,calc(100vw - 3rem))}@media (width >= 40rem){.styleGrid{grid-template-columns:minmax(12rem,.8fr) minmax(0,1.8fr)}}.styleValue :global(.ui-code-keyword){color:var(--color-plain-500)}.styleValue :global(.ui-code-attribute){color:var(--color-plain-200)}.styleValue :global(.ui-code-string){color:var(--color-plain-300)}.styleValue :global(.ui-code-number){color:var(--color-plain-400)}.styleValue :global(.ui-code-punctuation){color:var(--color-plain-500)}
725
+ :global(.ui-code-comment){color:var(--color-zinc-500)}:global(.ui-code-string){color:var(--color-emerald-400)}:global(.ui-code-keyword){color:var(--color-blue-400)}:global(.ui-code-number){color:var(--color-amber-300)}:global(.ui-code-tag){color:var(--color-cyan-500)}:global(.ui-code-attribute){color:var(--color-violet-300)}:global(.ui-code-punctuation){color:var(--color-zinc-400)}:global(.ui-color-swatch){background:var(--ui-color-swatch);border:1px solid hsla(0,0%,100%,.1);border-radius:.2rem;display:inline-block;height:.65rem;margin-right:.25rem;opacity:.85;vertical-align:-.1rem;width:.65rem}.mobileNavigation{width:min(18rem,calc(100vw - 3rem))}@media (width >= 40rem){.styleGrid{grid-template-columns:minmax(12rem,.8fr) minmax(0,1.8fr)}}.styleValue :global(.ui-code-keyword){color:var(--color-zinc-500)}.styleValue :global(.ui-code-attribute){color:var(--color-zinc-200)}.styleValue :global(.ui-code-string){color:var(--color-zinc-300)}.styleValue :global(.ui-code-number){color:var(--color-zinc-400)}.styleValue :global(.ui-code-punctuation){color:var(--color-zinc-500)}
717
726
  </style>
@@ -0,0 +1 @@
1
+ @theme{--breakpoint-*:initial}@custom-variant dk (@media (width >= 1440px));@custom-variant lp (@media (width < 1440px));@custom-variant tb (@media (width < 1024px));@custom-variant mb (@media (width < 768px));@custom-variant ms (@media (width < 480px));@media (width < 1440px){.dkHidden{display:none!important}}@media (width < 1024px),(width >= 1440px){.lpHidden{display:none!important}}@media (width < 768px),(width >= 1024px){.tbHidden{display:none!important}}@media (width < 480px),(width >= 768px){.mbHidden{display:none!important}}@media (width >= 480px){.msHidden{display:none!important}}@source "./";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brickflow/ui",
3
- "version": "0.0.31",
3
+ "version": "0.0.33",
4
4
  "type": "module",
5
5
  "description": "brickflow UI Nuxt module.",
6
6
  "files": [
@@ -15,6 +15,10 @@
15
15
  "./tailwind": {
16
16
  "types": "./dist/runtime/tailwind.d.ts",
17
17
  "import": "./dist/runtime/tailwind.js"
18
+ },
19
+ "./ui.css": {
20
+ "development": "./src/runtime/ui.css",
21
+ "default": "./dist/runtime/ui.css"
18
22
  }
19
23
  },
20
24
  "scripts": {
File without changes