fi-glass 1.1.0

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,74 @@
1
+ /**
2
+ * glassChatPreset — the typed mirror of the glass-chat visual preset (B3-V1).
3
+ *
4
+ * The runtime CSS lives next to this file (glass-chat.css) and emits the same
5
+ * values as `--glass-chat-*` custom properties; this object is the typed mirror
6
+ * (same phase-1 contract as `glassTheme` ↔ tokens.css): it gives programmatic
7
+ * access to the values and lets a consumer reference an accent/surface without
8
+ * hardcoding the literal.
9
+ *
10
+ * Glass-material-specific by design: a future `fi-<material>` ships its own chat
11
+ * preset. Domain styling (AURITY's clinical personas) is NOT here — only the
12
+ * reusable glassmorphism chat look.
13
+ */
14
+
15
+ /** The reusable visual slots of the glass-chat preset. */
16
+ export interface GlassChatPreset {
17
+ /** Accent gradient start (emerald). */
18
+ accentFrom: string;
19
+ /** Accent gradient end (cyan). */
20
+ accentTo: string;
21
+ /** Accent text color. */
22
+ accentText: string;
23
+ /** Shell body background (flat fallback under the layered gradient). */
24
+ body: string;
25
+ /** Page gradient edge color (B3-FIGLASS-13). */
26
+ bgFrom: string;
27
+ /** Page gradient mid color. */
28
+ bgMid: string;
29
+ /** Radial accent glow over the page gradient (consumer re-tints this). */
30
+ bgGlow: string;
31
+ /** Frosted composer/surface fill. */
32
+ surface: string;
33
+ /** Frosted surface border. */
34
+ surfaceBorder: string;
35
+ /** User bubble fill (translucent emerald wash, not solid). */
36
+ bubbleUser: string;
37
+ /** User bubble border. */
38
+ bubbleUserBorder: string;
39
+ /** Assistant bubble fill. */
40
+ bubbleAssistant: string;
41
+ /** Assistant bubble border. */
42
+ bubbleBorder: string;
43
+ /** Brand watermark opacity (image is consumer-supplied via CSS var). */
44
+ watermarkOpacity: string;
45
+ /** Primary text color. */
46
+ text: string;
47
+ /** Muted/secondary text color. */
48
+ textMuted: string;
49
+ /** Elevation shadow (≈ shadow-2xl). */
50
+ shadow: string;
51
+ /** Surface corner radius. */
52
+ radius: string;
53
+ }
54
+
55
+ export const glassChatPreset: GlassChatPreset = {
56
+ accentFrom: '#059669',
57
+ accentTo: '#0891b2',
58
+ accentText: '#6ee7b7',
59
+ body: '#020617',
60
+ bgFrom: '#020617',
61
+ bgMid: '#0f172a',
62
+ bgGlow: 'rgba(8, 145, 178, 0.07)',
63
+ surface: 'rgba(30, 41, 59, 0.6)',
64
+ surfaceBorder: 'rgba(71, 85, 105, 0.4)',
65
+ bubbleUser: 'rgba(5, 150, 105, 0.32)',
66
+ bubbleUserBorder: 'rgba(52, 211, 153, 0.25)',
67
+ bubbleAssistant: 'rgba(30, 41, 59, 0.55)',
68
+ bubbleBorder: 'rgba(71, 85, 105, 0.35)',
69
+ watermarkOpacity: '0.08',
70
+ text: '#ffffff',
71
+ textMuted: '#94a3b8',
72
+ shadow: '0 25px 50px -12px rgba(0, 0, 0, 0.5)',
73
+ radius: '14px',
74
+ };
@@ -0,0 +1,217 @@
1
+ /*
2
+ * fi-glass · glass-chat preset (B3-V1)
3
+ *
4
+ * A reusable, OPT-IN visual preset for the glassmorphism chat shell — the polished
5
+ * look observed in AURITY's chat widget (emerald→cyan accents, frosted floating
6
+ * composer, accented bubbles, gradient start-screen CTA), generalized here so any
7
+ * consumer (og118 next, future shells) inherits it WITHOUT copying AURITY code.
8
+ *
9
+ * Design:
10
+ * - Pure CSS custom properties (--glass-chat-*) + flat utility classes
11
+ * (.glass-chat, .glass-chat-*), mirroring the existing .glass / .glass-dark
12
+ * token-driven pattern. No new components, no JS required to apply it.
13
+ * - Reuses the base frosted tokens (--glass-blur / --glass-saturation) so a
14
+ * consumer that already imports `fi-glass/theme.css` gets a consistent blur.
15
+ * - Shipped as a SEPARATE import so it never touches the shared theme.css:
16
+ * import 'fi-glass/glass-chat.css';
17
+ * and is opt-in at the CLASS level — nothing changes visually until a
18
+ * consumer applies `.glass-chat*` to its chat regions (e.g. og118 in B3-V2).
19
+ *
20
+ * Values are the typed mirror of `glassChatPreset` (glass-chat-preset.ts).
21
+ * Reference (read-only): apps/aurity/config/chat.config.ts + app/styles/domains/chat.css.
22
+ * Domain pieces (persona styling, clinical colors) deliberately stay AURITY-local.
23
+ */
24
+
25
+ :root {
26
+ /* Accent gradient (emerald-600 → cyan-600). */
27
+ --glass-chat-accent-from: #059669;
28
+ --glass-chat-accent-to: #0891b2;
29
+ /* Text accent (emerald-300). */
30
+ --glass-chat-accent-text: #6ee7b7;
31
+
32
+ /* Shell surfaces. */
33
+ --glass-chat-body: #020617; /* slate-950 — flat fallback */
34
+ --glass-chat-surface: rgba(30, 41, 59, 0.6); /* slate-800/60 */
35
+ --glass-chat-surface-border: rgba(71, 85, 105, 0.4); /* slate-600/40 */
36
+
37
+ /* Page depth (B3-FIGLASS-13 — /chat-page parity, not the widget). The body
38
+ is a layered gradient: a soft radial accent glow over a diagonal navy
39
+ sweep (slate-950 → slate-900 → slate-950), instead of a flat fill. A
40
+ consumer re-tints the glow by overriding --glass-chat-bg-glow. */
41
+ --glass-chat-bg-from: #020617; /* slate-950 */
42
+ --glass-chat-bg-mid: #0f172a; /* slate-900 */
43
+ --glass-chat-bg-glow: rgba(8, 145, 178, 0.07); /* cyan accent, barely-there */
44
+
45
+ /* Message bubbles — glassy, not solid (B3-FIGLASS-13). The user bubble is
46
+ a translucent emerald wash with a soft emerald border; the assistant a
47
+ softer slate with a quieter border. The old solid emerald read as a loud
48
+ WhatsApp green against the layered page background. */
49
+ --glass-chat-bubble-user: rgba(5, 150, 105, 0.32); /* emerald-600/32 */
50
+ --glass-chat-bubble-user-border: rgba(52, 211, 153, 0.25); /* emerald-400/25 */
51
+ --glass-chat-bubble-assistant: rgba(30, 41, 59, 0.55); /* slate-800/55 */
52
+ --glass-chat-bubble-border: rgba(71, 85, 105, 0.35); /* slate-600/35 */
53
+
54
+ /* Optional brand watermark (B3-FIGLASS-13). The framework owns placement,
55
+ opacity and the soft blur; the consumer owns the brand by setting the
56
+ image: :root { --glass-chat-watermark-image: url('/my-brand.svg'); }
57
+ and rendering `<div class="glass-chat-watermark" aria-hidden />`. */
58
+ --glass-chat-watermark-image: none;
59
+ --glass-chat-watermark-opacity: 0.08;
60
+
61
+ /* Text. */
62
+ --glass-chat-text: #ffffff;
63
+ --glass-chat-text-muted: #94a3b8; /* slate-400 */
64
+
65
+ /* Elevation (≈ shadow-2xl). */
66
+ --glass-chat-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
67
+ --glass-chat-radius: 16px; /* rounded-2xl — matches AURITY's chat-input-floating-box */
68
+ }
69
+
70
+ /* Root scope: a consumer wraps its chat surface in `.glass-chat` to opt in.
71
+ Layered page depth (radial glow over diagonal navy) — the flat
72
+ --glass-chat-body remains as the underlying base color. */
73
+ .glass-chat {
74
+ background:
75
+ radial-gradient(1100px 550px at 72% 22%, var(--glass-chat-bg-glow), transparent 60%),
76
+ linear-gradient(
77
+ 135deg,
78
+ var(--glass-chat-bg-from),
79
+ var(--glass-chat-bg-mid),
80
+ var(--glass-chat-bg-from)
81
+ );
82
+ background-color: var(--glass-chat-body);
83
+ color: var(--glass-chat-text);
84
+ }
85
+
86
+ /* Optional fixed brand watermark behind the transcript. Inert (no pointer
87
+ events) and invisible until the consumer sets --glass-chat-watermark-image. */
88
+ .glass-chat-watermark {
89
+ position: fixed;
90
+ inset: 0;
91
+ background-image: var(--glass-chat-watermark-image);
92
+ background-size: contain;
93
+ background-position: center;
94
+ background-repeat: no-repeat;
95
+ opacity: var(--glass-chat-watermark-opacity);
96
+ pointer-events: none;
97
+ /* Negative z-index: paints above the page background but below ALL in-flow
98
+ content with zero consumer coordination (no z-index choreography needed). */
99
+ z-index: -1;
100
+ filter: blur(0.5px);
101
+ }
102
+
103
+ /* Header band: the signature emerald→cyan gradient. */
104
+ .glass-chat-header {
105
+ background-image: linear-gradient(
106
+ to right,
107
+ var(--glass-chat-accent-from),
108
+ var(--glass-chat-accent-to)
109
+ );
110
+ color: var(--glass-chat-text);
111
+ }
112
+
113
+ /* Floating composer box: frosted surface, reuses the base blur token. */
114
+ .glass-chat-composer {
115
+ background: var(--glass-chat-surface);
116
+ border: 1px solid var(--glass-chat-surface-border);
117
+ border-radius: var(--glass-chat-radius);
118
+ box-shadow: var(--glass-chat-shadow);
119
+ backdrop-filter: blur(var(--glass-blur, 12px)) saturate(var(--glass-saturation, 180%));
120
+ -webkit-backdrop-filter: blur(var(--glass-blur, 12px)) saturate(var(--glass-saturation, 180%));
121
+ }
122
+
123
+ /* Composer textarea: transparent inside the frosted box. */
124
+ .glass-chat-composer-input {
125
+ width: 100%;
126
+ resize: none;
127
+ background: transparent;
128
+ border: none;
129
+ outline: none;
130
+ color: var(--glass-chat-text);
131
+ }
132
+ .glass-chat-composer-input::placeholder {
133
+ color: var(--glass-chat-text-muted);
134
+ }
135
+
136
+ /* Message bubbles. The user bubble is frosted like the assistant's — the
137
+ translucent emerald wash needs the blur to read as glass over the layered
138
+ page background instead of a flat tint.
139
+
140
+ B3-FIGLASS-14 — /chat-page bubble GEOMETRY, not just tint. AURITY's /chat
141
+ renders real bubbles: capped at 85% width, user hugging the right
142
+ (margin-left auto) with a clipped bottom-right corner, assistant on the
143
+ left with a clipped bottom-left corner. The base messageStyles render
144
+ full-width Claude-style rows; these preset classes (loaded after Tailwind
145
+ utilities in the consumer) override the row geometry into bubbles. */
146
+ .glass-chat-bubble-user {
147
+ background: var(--glass-chat-bubble-user);
148
+ color: var(--glass-chat-text);
149
+ border: 1px solid var(--glass-chat-bubble-user-border);
150
+ max-width: 85%;
151
+ width: fit-content;
152
+ margin-left: auto;
153
+ margin-right: 0;
154
+ border-radius: var(--glass-chat-radius);
155
+ border-bottom-right-radius: 4px;
156
+ backdrop-filter: blur(var(--glass-blur, 12px)) saturate(var(--glass-saturation, 180%));
157
+ -webkit-backdrop-filter: blur(var(--glass-blur, 12px)) saturate(var(--glass-saturation, 180%));
158
+ }
159
+ .glass-chat-bubble-assistant {
160
+ background: var(--glass-chat-bubble-assistant);
161
+ color: var(--glass-chat-text);
162
+ border: 1px solid var(--glass-chat-bubble-border);
163
+ max-width: 85%;
164
+ margin-left: 0;
165
+ margin-right: auto;
166
+ border-radius: var(--glass-chat-radius);
167
+ border-bottom-left-radius: 4px;
168
+ backdrop-filter: blur(var(--glass-blur, 12px)) saturate(var(--glass-saturation, 180%));
169
+ -webkit-backdrop-filter: blur(var(--glass-blur, 12px)) saturate(var(--glass-saturation, 180%));
170
+ }
171
+
172
+ /* Gradient CTA (start-screen primary action). */
173
+ .glass-chat-cta {
174
+ background-image: linear-gradient(
175
+ to right,
176
+ var(--glass-chat-accent-from),
177
+ var(--glass-chat-accent-to)
178
+ );
179
+ color: var(--glass-chat-text);
180
+ border: none;
181
+ border-radius: 10px;
182
+ box-shadow: var(--glass-chat-shadow);
183
+ cursor: pointer;
184
+ }
185
+
186
+ /* Smaller blur on narrow viewports, consistent with the base material. */
187
+ @media (max-width: 768px) {
188
+ .glass-chat-composer,
189
+ .glass-chat-bubble-user,
190
+ .glass-chat-bubble-assistant {
191
+ backdrop-filter: blur(var(--glass-blur-compact, 8px));
192
+ -webkit-backdrop-filter: blur(var(--glass-blur-compact, 8px));
193
+ }
194
+ }
195
+
196
+ /* ---------------------------------------------------------------------------
197
+ Message entry fade-in (B3-FIGLASS-12 — ChatGPT parity).
198
+ Applied by MessageBubble on mount; opacity-only so native CSS scroll
199
+ anchoring is never suppressed (transform/position changes would disable it).
200
+ --------------------------------------------------------------------------- */
201
+ @keyframes fi-msg-show {
202
+ from { opacity: 0; }
203
+ to { opacity: 1; }
204
+ }
205
+ .fi-msg-appear {
206
+ animation: fi-msg-show 0.3s ease-out both;
207
+ }
208
+ @media (prefers-reduced-motion: reduce) {
209
+ .fi-msg-appear { animation: none; }
210
+ }
211
+
212
+ /* Focus ring for the floating jump-to-latest button (a11y — the default skin
213
+ is inline-styled and inline styles can't express :focus-visible). */
214
+ .fi-scroll-to-bottom:focus-visible {
215
+ outline: 2px solid rgba(255, 255, 255, 0.85);
216
+ outline-offset: 2px;
217
+ }
@@ -0,0 +1,26 @@
1
+ import type { ThemeTokens } from '@free-intelligence/core';
2
+
3
+ /**
4
+ * glassTheme — the concrete values that fill core's ThemeTokens slots for the
5
+ * `fi-glass` material.
6
+ *
7
+ * The runtime CSS lives next to this file (tokens.css / glass.css) and emits the
8
+ * same values as `--glass-*` custom properties. This object is the typed mirror:
9
+ * it gives programmatic access to the values and lets future materials
10
+ * (fi-slate, fi-paper, …) be diffed against the very same slot shape.
11
+ *
12
+ * NOTE: values are intentionally duplicated between this object and tokens.css
13
+ * during phase 1 (CSS is the runtime source of truth; this is documentation +
14
+ * typing). A later phase may generate the CSS from this object to remove the
15
+ * duplication — deliberately out of scope here.
16
+ */
17
+ export const glassTheme: ThemeTokens = {
18
+ blur: '12px',
19
+ blurCompact: '8px',
20
+ opacity: 0.8,
21
+ saturation: '180%',
22
+ surfaceLight: '255, 255, 255',
23
+ borderLight: 'rgba(255, 255, 255, 0.18)',
24
+ surfaceDark: 'rgba(15, 23, 42, 0.7)',
25
+ borderDark: 'rgba(148, 163, 184, 0.2)',
26
+ };
@@ -0,0 +1,27 @@
1
+ /*
2
+ * fi-glass · frosted-surface utility classes
3
+ * Extracted verbatim from apps/aurity/app/medical-styles.css on 2026-06-01.
4
+ * Behavior is byte-for-byte identical to the in-aurity version; the only change
5
+ * is the mobile blur, now driven by the --glass-blur-compact token (same 8px
6
+ * value) instead of a hardcoded literal.
7
+ */
8
+ .glass {
9
+ background: rgba(255, 255, 255, var(--glass-opacity));
10
+ backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
11
+ -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
12
+ border: 1px solid var(--glass-border);
13
+ }
14
+
15
+ .glass-dark {
16
+ background: rgba(15, 23, 42, 0.7);
17
+ backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
18
+ -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
19
+ border: 1px solid rgba(148, 163, 184, 0.2);
20
+ }
21
+
22
+ @media (max-width: 768px) {
23
+ .glass {
24
+ backdrop-filter: blur(var(--glass-blur-compact));
25
+ -webkit-backdrop-filter: blur(var(--glass-blur-compact));
26
+ }
27
+ }
@@ -0,0 +1,3 @@
1
+ /* fi-glass · theme entry point. Apps import this once (e.g. `import "fi-glass/theme.css"`). */
2
+ @import "./tokens.css";
3
+ @import "./glass.css";
@@ -0,0 +1,4 @@
1
+ export { glassTheme } from './glass-theme';
2
+ // glass-chat visual preset (B3-V1). Opt-in look for the chat shell; the runtime
3
+ // CSS ships separately as `fi-glass/glass-chat.css`.
4
+ export { glassChatPreset, type GlassChatPreset } from './glass-chat-preset';
@@ -0,0 +1,13 @@
1
+ /*
2
+ * fi-glass · design tokens
3
+ * Extracted verbatim from apps/aurity/app/medical-styles.css on 2026-06-01.
4
+ * These are the concrete values that fill core's ThemeTokens slots for the
5
+ * glass material. A future fi-<material> ships its own tokens file.
6
+ */
7
+ :root {
8
+ --glass-blur: 12px;
9
+ --glass-blur-compact: 8px;
10
+ --glass-opacity: 0.8;
11
+ --glass-saturation: 180%;
12
+ --glass-border: rgba(255, 255, 255, 0.18);
13
+ }