@designa8/vibedesign-v6 1.12.17 → 1.15.1

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.
@@ -0,0 +1,127 @@
1
+ import React from "react";
2
+ import { Typography } from "../Typography";
3
+ import { Button } from "../Button";
4
+ import { Icon } from "../Icon";
5
+
6
+ export type StatusBarTone = "info" | "success" | "warning" | "error";
7
+
8
+ export interface StatusBarProps extends React.HTMLAttributes<HTMLDivElement> {
9
+ /** Drives the accent color, background tint, and pulsing ring */
10
+ tone?: StatusBarTone;
11
+ /** Bold lead text, e.g. "External agent is building a new component" */
12
+ message: string;
13
+ /** Secondary clickable detail text, e.g. "Building or updating PreviewToolbar" */
14
+ detail?: string;
15
+ onDetailClick?: () => void;
16
+ /** Whether the status dot pulses (use for in-progress states) */
17
+ pulsing?: boolean;
18
+ /** Shows a dismiss (×) button on the right when provided */
19
+ onDismiss?: () => void;
20
+ className?: string;
21
+ }
22
+
23
+ const toneBgClass: Record<StatusBarTone, string> = {
24
+ info: "bg-semantic-info-soft",
25
+ success: "bg-semantic-success-soft",
26
+ warning: "bg-semantic-warning-soft",
27
+ error: "bg-semantic-error-soft",
28
+ };
29
+
30
+ const toneBorderClass: Record<StatusBarTone, string> = {
31
+ info: "border-primary",
32
+ success: "border-semantic-success",
33
+ warning: "border-semantic-warning",
34
+ error: "border-semantic-error",
35
+ };
36
+
37
+ const toneDotClass: Record<StatusBarTone, string> = {
38
+ info: "bg-primary",
39
+ success: "bg-semantic-success",
40
+ warning: "bg-semantic-warning",
41
+ error: "bg-semantic-error",
42
+ };
43
+
44
+ const toneTextClass: Record<StatusBarTone, string> = {
45
+ info: "text-primary",
46
+ success: "text-semantic-success",
47
+ warning: "text-semantic-warning",
48
+ error: "text-semantic-error",
49
+ };
50
+
51
+ export const StatusBar = React.forwardRef<HTMLDivElement, StatusBarProps>(
52
+ (
53
+ {
54
+ tone = "info",
55
+ message,
56
+ detail,
57
+ onDetailClick,
58
+ pulsing = true,
59
+ onDismiss,
60
+ className = "",
61
+ ...rest
62
+ },
63
+ ref,
64
+ ) => {
65
+ return (
66
+ <div
67
+ ref={ref}
68
+ role="status"
69
+ className={[
70
+ "w-full flex items-center gap-sm px-lg py-sm",
71
+ "border-b-2",
72
+ toneBgClass[tone],
73
+ toneBorderClass[tone],
74
+ className,
75
+ ].filter(Boolean).join(" ")}
76
+ {...rest}
77
+ >
78
+ {/* Status dot with optional pulsing ring */}
79
+ <span className="relative inline-flex items-center justify-center w-4 h-4 shrink-0" aria-hidden="true">
80
+ {pulsing && (
81
+ <span
82
+ className={["absolute inline-flex h-full w-full rounded-full opacity-75 animate-ping", toneDotClass[tone]].join(" ")}
83
+ />
84
+ )}
85
+ <span className={["relative inline-flex w-2.5 h-2.5 rounded-full", toneDotClass[tone]].join(" ")} />
86
+ </span>
87
+
88
+ <div className="flex flex-1 min-w-0 flex-wrap items-baseline gap-x-sm gap-y-xxs">
89
+ <Typography role="body-sm" className={["font-weight-heading-sm truncate", toneTextClass[tone]].join(" ")}>
90
+ {message}
91
+ </Typography>
92
+
93
+ {detail && (
94
+ onDetailClick ? (
95
+ <Button
96
+ variant="ghost"
97
+ size="sm"
98
+ onClick={onDetailClick}
99
+ className={["!h-auto !p-0 rounded-xs text-body-sm font-weight-body-sm underline hover:no-underline hover:bg-transparent active:bg-transparent truncate", toneTextClass[tone]].join(" ")}
100
+ >
101
+ {detail}
102
+ </Button>
103
+ ) : (
104
+ <Typography role="body-sm" color="body" className="truncate">
105
+ {detail}
106
+ </Typography>
107
+ )
108
+ )}
109
+ </div>
110
+
111
+ {onDismiss && (
112
+ <Button
113
+ variant="ghost"
114
+ size="sm"
115
+ aria-label="Dismiss status"
116
+ onClick={onDismiss}
117
+ className={["!w-6 !h-6 !p-0 rounded-sm shrink-0 hover:bg-transparent active:bg-transparent", toneTextClass[tone]].join(" ")}
118
+ >
119
+ <Icon name="close" size={14} />
120
+ </Button>
121
+ )}
122
+ </div>
123
+ );
124
+ },
125
+ );
126
+
127
+ StatusBar.displayName = "StatusBar";
@@ -0,0 +1,2 @@
1
+ export { StatusBar } from "./StatusBar";
2
+ export type { StatusBarProps, StatusBarTone } from "./StatusBar";
@@ -0,0 +1,52 @@
1
+ import React, { useState } from "react";
2
+ import { StatusBar } from "./StatusBar";
3
+
4
+ export default function StatusBarPreview() {
5
+ const [dismissed, setDismissed] = useState(false);
6
+
7
+ return (
8
+ <div className="w-full max-w-3xl mx-auto p-lg space-y-lg">
9
+ <div className="space-y-xs">
10
+ <p className="text-caption text-muted">In progress (info, pulsing, dismissible)</p>
11
+ {!dismissed && (
12
+ <StatusBar
13
+ tone="info"
14
+ message="External agent is building a new component"
15
+ detail="Building or updating PreviewToolbar"
16
+ onDetailClick={() => {}}
17
+ onDismiss={() => setDismissed(true)}
18
+ />
19
+ )}
20
+ {dismissed && (
21
+ <div className="text-body-sm text-muted px-lg py-xs border-b border-hairline">Dismissed — refresh to reset</div>
22
+ )}
23
+ </div>
24
+
25
+ <div className="space-y-xs">
26
+ <p className="text-caption text-muted">Success (static dot)</p>
27
+ <StatusBar
28
+ tone="success"
29
+ message="Design tokens published"
30
+ detail="View changelog"
31
+ onDetailClick={() => {}}
32
+ pulsing={false}
33
+ />
34
+ </div>
35
+
36
+ <div className="space-y-xs">
37
+ <p className="text-caption text-muted">Warning</p>
38
+ <StatusBar
39
+ tone="warning"
40
+ message="Component preview is out of date"
41
+ detail="Rebuild now"
42
+ onDetailClick={() => {}}
43
+ />
44
+ </div>
45
+
46
+ <div className="space-y-xs">
47
+ <p className="text-caption text-muted">Error, no detail link</p>
48
+ <StatusBar tone="error" message="Build failed — check the console for details" pulsing={false} />
49
+ </div>
50
+ </div>
51
+ );
52
+ }
package/src/index.ts CHANGED
@@ -7,16 +7,19 @@ export * from "./atoms/AuthScreen";
7
7
  export * from "./atoms/Button";
8
8
  export * from "./atoms/ChatScreen";
9
9
  export * from "./atoms/Chip";
10
+ export * from "./atoms/CodeEditor";
10
11
  export * from "./atoms/ComponentCard";
11
12
  export * from "./atoms/ExportDesignMdModal";
12
13
  export * from "./atoms/FilterTabBar";
13
14
  export * from "./atoms/HomePageTemplate";
15
+ export * from "./atoms/Icon";
14
16
  export * from "./atoms/Input";
15
17
  export * from "./atoms/Modal";
16
18
  export * from "./atoms/NavItem";
17
19
  export * from "./atoms/PreviewToolbar";
18
20
  export * from "./atoms/PromptInputBar";
19
21
  export * from "./atoms/PublishModal";
22
+ export * from "./atoms/StatusBar";
20
23
  export * from "./atoms/TopNavbar";
21
24
  export * from "./atoms/Typography";
22
25
  export * from "./atoms/UpgradeCard";
package/src/tokens.css CHANGED
@@ -48,6 +48,15 @@
48
48
  --color-kind-template-bg: #FEF3C7;
49
49
  --color-kind-template-text: #B45309;
50
50
  --color-kind-template-border: #FBD98A;
51
+ --color-semantic-info-soft: #EAE8FB;
52
+ --color-syntax-keyword: #0000FF;
53
+ --color-syntax-string: #A31515;
54
+ --color-syntax-number: #098658;
55
+ --color-syntax-comment: #008000;
56
+ --color-syntax-function: #795E26;
57
+ --color-syntax-type: #267F99;
58
+ --color-syntax-tag: #800000;
59
+ --color-syntax-property: #001080;
51
60
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
52
61
  --font-heading: var(--font-body);
53
62
  --font-display-lg: var(--font-body);
@@ -174,4 +183,16 @@
174
183
  --color-hairline-soft: #242432;
175
184
  --color-hairline-strong: #3C3C50;
176
185
  --color-primary-disabled: #3D3870;
186
+ --color-semantic-success-soft: #123321;
187
+ --color-semantic-warning-soft: #3A2A0A;
188
+ --color-semantic-error-soft: #3A1414;
189
+ --color-semantic-info-soft: #28234F;
190
+ --color-syntax-keyword: #569CD6;
191
+ --color-syntax-string: #CE9178;
192
+ --color-syntax-number: #B5CEA8;
193
+ --color-syntax-comment: #6A9955;
194
+ --color-syntax-function: #DCDCAA;
195
+ --color-syntax-type: #4EC9B0;
196
+ --color-syntax-tag: #569CD6;
197
+ --color-syntax-property: #9CDCFE;
177
198
  }