@opengeni/react 0.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,157 @@
1
+ /* ----------------------------------------------------------------------------
2
+ @opengeni/react — Tailwind v4 theme bridge + component keyframes
3
+
4
+ Consumers import this once inside their Tailwind entry CSS:
5
+
6
+ @import "tailwindcss";
7
+ @import "@opengeni/react/styles.css";
8
+ @source "../node_modules/@opengeni/react/src";
9
+
10
+ The @source directive makes Tailwind compile the utility classes used by
11
+ the components in this package. Everything themable lives in tokens.css
12
+ (plain CSS variables) — override those to rebrand; this file only maps them
13
+ into Tailwind utility names (`bg-og-surface-1`, `text-og-fg-muted`,
14
+ `rounded-og-md`, `shadow-og-glow`, `font-og-mono`, ...).
15
+ -------------------------------------------------------------------------- */
16
+
17
+ @import "./tokens.css";
18
+
19
+ @theme inline {
20
+ --font-og-sans: var(--og-font-sans);
21
+ --font-og-mono: var(--og-font-mono);
22
+
23
+ --color-og-bg: var(--og-color-bg);
24
+ --color-og-surface-1: var(--og-color-surface-1);
25
+ --color-og-surface-2: var(--og-color-surface-2);
26
+ --color-og-surface-3: var(--og-color-surface-3);
27
+ --color-og-border: var(--og-color-border);
28
+ --color-og-border-strong: var(--og-color-border-strong);
29
+ --color-og-fg: var(--og-color-fg);
30
+ --color-og-fg-muted: var(--og-color-fg-muted);
31
+ --color-og-fg-subtle: var(--og-color-fg-subtle);
32
+
33
+ --color-og-accent: var(--og-color-accent);
34
+ --color-og-accent-strong: var(--og-color-accent-strong);
35
+ --color-og-accent-fg: var(--og-color-accent-fg);
36
+ --color-og-accent-soft: var(--og-color-accent-soft);
37
+
38
+ --color-og-status-queued: var(--og-color-status-queued);
39
+ --color-og-status-running: var(--og-color-status-running);
40
+ --color-og-status-idle: var(--og-color-status-idle);
41
+ --color-og-status-waiting: var(--og-color-status-waiting);
42
+ --color-og-status-failed: var(--og-color-status-failed);
43
+ --color-og-status-cancelled: var(--og-color-status-cancelled);
44
+ --color-og-danger: var(--og-color-danger);
45
+
46
+ --radius-og-xs: var(--og-radius-xs);
47
+ --radius-og-sm: var(--og-radius-sm);
48
+ --radius-og-md: var(--og-radius-md);
49
+ --radius-og-lg: var(--og-radius-lg);
50
+ --radius-og-xl: var(--og-radius-xl);
51
+
52
+ --shadow-og-sm: var(--og-shadow-sm);
53
+ --shadow-og-md: var(--og-shadow-md);
54
+ --shadow-og-lg: var(--og-shadow-lg);
55
+ --shadow-og-glow: var(--og-shadow-glow);
56
+
57
+ --ease-og-out: var(--og-ease-out);
58
+ --ease-og-in-out: var(--og-ease-in-out);
59
+ --ease-og-spring: var(--og-ease-spring);
60
+
61
+ --animate-og-enter: og-enter var(--og-duration-base) var(--og-ease-out) both;
62
+ --animate-og-pulse: og-pulse 2s var(--og-ease-in-out) infinite;
63
+ --animate-og-blink: og-blink 1s steps(2, start) infinite;
64
+ --animate-og-shimmer: og-shimmer 2.2s linear infinite;
65
+ --animate-og-spin: og-spin 0.9s linear infinite;
66
+ }
67
+
68
+ /* Entry: messages and timeline rows slide in just enough to feel placed. */
69
+ @keyframes og-enter {
70
+ from {
71
+ opacity: 0;
72
+ transform: translateY(4px);
73
+ }
74
+ to {
75
+ opacity: 1;
76
+ transform: translateY(0);
77
+ }
78
+ }
79
+
80
+ /* Live/running indicators breathe; they do not flash. */
81
+ @keyframes og-pulse {
82
+ 0%,
83
+ 100% {
84
+ opacity: 1;
85
+ }
86
+ 50% {
87
+ opacity: 0.35;
88
+ }
89
+ }
90
+
91
+ /* Streaming caret. */
92
+ @keyframes og-blink {
93
+ 0%,
94
+ 100% {
95
+ opacity: 1;
96
+ }
97
+ 50% {
98
+ opacity: 0;
99
+ }
100
+ }
101
+
102
+ /* Text shimmer for in-flight labels ("Thinking", "Running tool…"). */
103
+ @keyframes og-shimmer {
104
+ from {
105
+ background-position: 200% center;
106
+ }
107
+ to {
108
+ background-position: -200% center;
109
+ }
110
+ }
111
+
112
+ @keyframes og-spin {
113
+ to {
114
+ transform: rotate(360deg);
115
+ }
116
+ }
117
+
118
+ /* Shimmer helper: gradient text the keyframe scrolls through. */
119
+ .og-shimmer-text {
120
+ background: linear-gradient(
121
+ 90deg,
122
+ var(--og-color-fg-subtle) 0%,
123
+ var(--og-color-fg) 50%,
124
+ var(--og-color-fg-subtle) 100%
125
+ );
126
+ background-size: 200% auto;
127
+ background-clip: text;
128
+ -webkit-background-clip: text;
129
+ color: transparent;
130
+ animation: og-shimmer 2.2s linear infinite;
131
+ }
132
+
133
+ /* Scoped base for component subtrees (applied by the components themselves). */
134
+ .og-root {
135
+ font-family: var(--og-font-sans);
136
+ font-feature-settings: var(--og-font-features);
137
+ -webkit-font-smoothing: antialiased;
138
+ text-rendering: optimizeLegibility;
139
+ color: var(--og-color-fg);
140
+ }
141
+
142
+ .og-root :where(*) {
143
+ scrollbar-width: thin;
144
+ scrollbar-color: var(--og-color-border-strong) transparent;
145
+ }
146
+
147
+ @media (prefers-reduced-motion: reduce) {
148
+ .og-root *,
149
+ .og-root *::before,
150
+ .og-root *::after,
151
+ .og-shimmer-text {
152
+ animation-duration: 0.001ms !important;
153
+ animation-iteration-count: 1 !important;
154
+ transition-duration: 0.001ms !important;
155
+ scroll-behavior: auto !important;
156
+ }
157
+ }
@@ -0,0 +1,111 @@
1
+ /* ----------------------------------------------------------------------------
2
+ @opengeni/react design tokens
3
+
4
+ Pure CSS variables — no Tailwind required to consume them. Dark is the
5
+ first-class default (`:root`); light is an explicit opt-in via
6
+ `[data-og-theme="light"]` (or the `.og-light` class) on any ancestor, so
7
+ themes can be nested and rebranded per subtree.
8
+
9
+ All colors are OKLCH for perceptual consistency. The palette is deliberately
10
+ calm: one accent, desaturated status hues, low-chroma neutral ramps on a
11
+ cool slate hue. Information density comes from typography and spacing, not
12
+ from color shouting.
13
+ -------------------------------------------------------------------------- */
14
+
15
+ :root {
16
+ /* Typography ------------------------------------------------------------- */
17
+ --og-font-sans: "Inter Variable", "Inter", ui-sans-serif, system-ui, sans-serif;
18
+ --og-font-mono: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
19
+ --og-font-features: "cv11", "ss01", "ss03";
20
+
21
+ /* Radius ----------------------------------------------------------------- */
22
+ --og-radius-xs: 4px;
23
+ --og-radius-sm: 6px;
24
+ --og-radius-md: 10px;
25
+ --og-radius-lg: 14px;
26
+ --og-radius-xl: 20px;
27
+ --og-radius-full: 9999px;
28
+
29
+ /* Motion — communicates state; never decorates ---------------------------- */
30
+ --og-duration-fast: 120ms;
31
+ --og-duration-base: 180ms;
32
+ --og-duration-slow: 320ms;
33
+ --og-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
34
+ --og-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
35
+ --og-ease-spring: cubic-bezier(0.34, 1.3, 0.64, 1);
36
+
37
+ /* Neutrals (dark) ---------------------------------------------------------- */
38
+ --og-color-bg: oklch(0.155 0.012 260);
39
+ --og-color-surface-1: oklch(0.19 0.014 260);
40
+ --og-color-surface-2: oklch(0.225 0.015 260);
41
+ --og-color-surface-3: oklch(0.265 0.016 260);
42
+ --og-color-border: oklch(0.3 0.014 260);
43
+ --og-color-border-strong: oklch(0.42 0.016 260);
44
+ --og-color-fg: oklch(0.955 0.005 260);
45
+ --og-color-fg-muted: oklch(0.73 0.012 260);
46
+ --og-color-fg-subtle: oklch(0.56 0.013 260);
47
+
48
+ /* Accent — one brand hue, used sparingly ----------------------------------- */
49
+ --og-color-accent: oklch(0.72 0.15 255);
50
+ --og-color-accent-strong: oklch(0.78 0.14 255);
51
+ --og-color-accent-fg: oklch(0.985 0.005 260);
52
+ --og-color-accent-soft: color-mix(in oklch, var(--og-color-accent) 16%, transparent);
53
+
54
+ /* Status — muted so they inform without alarming --------------------------- */
55
+ --og-color-status-queued: oklch(0.62 0.03 260);
56
+ --og-color-status-running: oklch(0.78 0.11 80);
57
+ --og-color-status-idle: oklch(0.78 0.12 155);
58
+ --og-color-status-waiting: oklch(0.74 0.12 305);
59
+ --og-color-status-failed: oklch(0.7 0.16 22);
60
+ --og-color-status-cancelled: oklch(0.6 0.035 260);
61
+ --og-color-danger: oklch(0.66 0.18 22);
62
+
63
+ /* Elevation ----------------------------------------------------------------
64
+ Dark surfaces barely cast shadows; elevation reads mostly from the
65
+ surface ramp. Shadows stay soft and tight. The glow is for the one thing
66
+ that should feel alive (focused composer, running session). */
67
+ --og-shadow-sm: 0 1px 2px oklch(0 0 0 / 0.28);
68
+ --og-shadow-md: 0 2px 8px oklch(0 0 0 / 0.32), 0 1px 2px oklch(0 0 0 / 0.24);
69
+ --og-shadow-lg: 0 8px 28px oklch(0 0 0 / 0.42), 0 2px 8px oklch(0 0 0 / 0.28);
70
+ /* One soft halo only. The composer's focus affordance already draws a crisp
71
+ brand edge via `focus-within:border-og-accent/60`; the old `0 0 0 1px`
72
+ ring sat flush against that border and read as a doubled hairline, so the
73
+ glow is now purely the diffuse outer halo. */
74
+ --og-shadow-glow: 0 0 24px color-mix(in oklch, var(--og-color-accent) 18%, transparent);
75
+
76
+ color-scheme: dark;
77
+ }
78
+
79
+ /* Light theme — explicit opt-in, themable per subtree ----------------------- */
80
+ [data-og-theme="light"],
81
+ .og-light {
82
+ --og-color-bg: oklch(0.978 0.003 260);
83
+ --og-color-surface-1: oklch(1 0 0);
84
+ --og-color-surface-2: oklch(0.962 0.004 260);
85
+ --og-color-surface-3: oklch(0.935 0.006 260);
86
+ --og-color-border: oklch(0.9 0.006 260);
87
+ --og-color-border-strong: oklch(0.8 0.01 260);
88
+ --og-color-fg: oklch(0.21 0.015 260);
89
+ --og-color-fg-muted: oklch(0.46 0.014 260);
90
+ --og-color-fg-subtle: oklch(0.6 0.012 260);
91
+
92
+ --og-color-accent: oklch(0.55 0.18 255);
93
+ --og-color-accent-strong: oklch(0.48 0.19 255);
94
+ --og-color-accent-fg: oklch(0.985 0.005 260);
95
+ --og-color-accent-soft: color-mix(in oklch, var(--og-color-accent) 11%, transparent);
96
+
97
+ --og-color-status-queued: oklch(0.55 0.03 260);
98
+ --og-color-status-running: oklch(0.6 0.13 80);
99
+ --og-color-status-idle: oklch(0.56 0.13 155);
100
+ --og-color-status-waiting: oklch(0.54 0.15 305);
101
+ --og-color-status-failed: oklch(0.55 0.19 22);
102
+ --og-color-status-cancelled: oklch(0.55 0.025 260);
103
+ --og-color-danger: oklch(0.55 0.2 22);
104
+
105
+ --og-shadow-sm: 0 1px 2px oklch(0.2 0.02 260 / 0.07);
106
+ --og-shadow-md: 0 2px 8px oklch(0.2 0.02 260 / 0.09), 0 1px 2px oklch(0.2 0.02 260 / 0.06);
107
+ --og-shadow-lg: 0 8px 28px oklch(0.2 0.02 260 / 0.13), 0 2px 8px oklch(0.2 0.02 260 / 0.07);
108
+ --og-shadow-glow: 0 0 20px color-mix(in oklch, var(--og-color-accent) 14%, transparent);
109
+
110
+ color-scheme: light;
111
+ }