@cosxai/ui 0.4.8 → 0.4.10
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/package.json +1 -1
- package/src/dialogs/Modal.tsx +22 -6
- package/src/styles/tokens.css +26 -0
package/package.json
CHANGED
package/src/dialogs/Modal.tsx
CHANGED
|
@@ -72,7 +72,12 @@ export function Modal({
|
|
|
72
72
|
position: "fixed",
|
|
73
73
|
inset: 0,
|
|
74
74
|
background: "rgba(10, 14, 26, 0.6)",
|
|
75
|
-
|
|
75
|
+
// Pull the page surface noticeably out of focus behind the
|
|
76
|
+
// modal — agent-dataroom's `backdrop-blur-sm` (4px) reads as
|
|
77
|
+
// a hint; 8px reads as a clear "the world stopped". The card
|
|
78
|
+
// sits above the blurred layer, so the content stays crisp.
|
|
79
|
+
backdropFilter: "blur(8px)",
|
|
80
|
+
WebkitBackdropFilter: "blur(8px)",
|
|
76
81
|
display: "flex",
|
|
77
82
|
alignItems: "center",
|
|
78
83
|
justifyContent: "center",
|
|
@@ -92,8 +97,15 @@ export function Modal({
|
|
|
92
97
|
maxHeight: "calc(100vh - 32px)",
|
|
93
98
|
background: "var(--ck-bg-surface)",
|
|
94
99
|
border: "1px solid var(--ck-border-subtle)",
|
|
95
|
-
|
|
96
|
-
|
|
100
|
+
// Modal cards lift on the `-lg` radius rather than the
|
|
101
|
+
// page's default `-md` so the corners read as softer than
|
|
102
|
+
// the cards underneath them — supports the "this took
|
|
103
|
+
// over" cue alongside the deeper overlay shadow.
|
|
104
|
+
borderRadius: "var(--ck-radius-lg)",
|
|
105
|
+
// Overlay shadow > shadow-3. shadow-3 was tuned for cards
|
|
106
|
+
// sitting on a page; a modal needs to read as physically
|
|
107
|
+
// lifted off the page, not as another tier of card.
|
|
108
|
+
boxShadow: "var(--ck-shadow-overlay)",
|
|
97
109
|
display: "flex",
|
|
98
110
|
flexDirection: "column",
|
|
99
111
|
overflow: "hidden",
|
|
@@ -124,7 +136,11 @@ export function ModalHeader({ title, subtitle, onClose, titleId }: ModalHeaderPr
|
|
|
124
136
|
return (
|
|
125
137
|
<header
|
|
126
138
|
style={{
|
|
127
|
-
|
|
139
|
+
// Editorial-modal breathing room: matches the 24-px gutter
|
|
140
|
+
// ModalBody / ModalFooter ship so a Modal renders as one
|
|
141
|
+
// coherent column of 24-px insets rather than three slots
|
|
142
|
+
// with different paddings.
|
|
143
|
+
padding: "20px 24px",
|
|
128
144
|
borderBottom: "1px solid var(--ck-border-subtle)",
|
|
129
145
|
display: "flex",
|
|
130
146
|
alignItems: "flex-start",
|
|
@@ -191,7 +207,7 @@ export function ModalHeader({ title, subtitle, onClose, titleId }: ModalHeaderPr
|
|
|
191
207
|
|
|
192
208
|
export function ModalBody({ children }: { children: ReactNode }) {
|
|
193
209
|
return (
|
|
194
|
-
<div style={{ flex: 1, minHeight: 0, overflowY: "auto", padding: "20px" }}>
|
|
210
|
+
<div style={{ flex: 1, minHeight: 0, overflowY: "auto", padding: "20px 24px 24px" }}>
|
|
195
211
|
{children}
|
|
196
212
|
</div>
|
|
197
213
|
);
|
|
@@ -201,7 +217,7 @@ export function ModalFooter({ children }: { children: ReactNode }) {
|
|
|
201
217
|
return (
|
|
202
218
|
<footer
|
|
203
219
|
style={{
|
|
204
|
-
padding: "
|
|
220
|
+
padding: "16px 24px",
|
|
205
221
|
borderTop: "1px solid var(--ck-border-subtle)",
|
|
206
222
|
display: "flex",
|
|
207
223
|
justifyContent: "flex-end",
|
package/src/styles/tokens.css
CHANGED
|
@@ -104,6 +104,13 @@
|
|
|
104
104
|
--ck-shadow-1: 0 1px 2px rgba(10, 14, 26, 0.04);
|
|
105
105
|
--ck-shadow-2: 0 4px 12px rgba(10, 14, 26, 0.06), 0 1px 2px rgba(10, 14, 26, 0.04);
|
|
106
106
|
--ck-shadow-3: 0 16px 48px rgba(10, 14, 26, 0.12), 0 4px 12px rgba(10, 14, 26, 0.06);
|
|
107
|
+
/* Overlay shadow — for floating surfaces (Modal cards, command
|
|
108
|
+
palettes) that need to read as "lifted above the page" rather
|
|
109
|
+
than "card on a page". Roughly 2× the punch of shadow-3 so the
|
|
110
|
+
hierarchy is unambiguous over a blurred backdrop. */
|
|
111
|
+
--ck-shadow-overlay:
|
|
112
|
+
0 32px 80px rgba(10, 14, 26, 0.22),
|
|
113
|
+
0 8px 24px rgba(10, 14, 26, 0.12);
|
|
107
114
|
|
|
108
115
|
/* Layout vars — owned by layout primitives. Default 0 so pages
|
|
109
116
|
that don't mount the rails don't reserve space. */
|
|
@@ -141,6 +148,9 @@ html[data-ck-theme="dark"] {
|
|
|
141
148
|
--ck-shadow-1: none;
|
|
142
149
|
--ck-shadow-2: 0 8px 24px rgba(0, 0, 0, 0.4);
|
|
143
150
|
--ck-shadow-3: 0 24px 64px rgba(0, 0, 0, 0.5);
|
|
151
|
+
--ck-shadow-overlay:
|
|
152
|
+
0 32px 80px rgba(0, 0, 0, 0.65),
|
|
153
|
+
0 12px 24px rgba(0, 0, 0, 0.45);
|
|
144
154
|
--ck-glow-accent: 0 0 32px color-mix(in srgb, var(--ck-accent) 25%, transparent);
|
|
145
155
|
}
|
|
146
156
|
|
|
@@ -221,6 +231,14 @@ html[data-ck-chrome="editorial"] {
|
|
|
221
231
|
--ck-shadow-1: none;
|
|
222
232
|
--ck-shadow-2: none;
|
|
223
233
|
--ck-shadow-3: 0 2px 0 rgba(15, 15, 15, 0.04);
|
|
234
|
+
/* Overlays (Modal) are the one place editorial chrome breaks its
|
|
235
|
+
hairline rule — a modal needs to read as physically lifted off
|
|
236
|
+
the page so the user can tell it took over. Stays cool-toned
|
|
237
|
+
and a touch more diffuse than the default to fit the editorial
|
|
238
|
+
palette. */
|
|
239
|
+
--ck-shadow-overlay:
|
|
240
|
+
0 32px 80px rgba(15, 15, 15, 0.28),
|
|
241
|
+
0 8px 24px rgba(15, 15, 15, 0.14);
|
|
224
242
|
}
|
|
225
243
|
|
|
226
244
|
/* Dark editorial — coherent dark mode: charcoal canvas + lifted
|
|
@@ -255,6 +273,14 @@ html[data-ck-theme="dark"][data-ck-chrome="editorial"] {
|
|
|
255
273
|
without going neon. */
|
|
256
274
|
--ck-accent-muted: color-mix(in oklab, var(--ck-accent) 22%, transparent);
|
|
257
275
|
--ck-accent-border: color-mix(in oklab, var(--ck-accent) 44%, transparent);
|
|
276
|
+
|
|
277
|
+
/* Editorial-light's overlay is paper-coloured shadow; on charcoal
|
|
278
|
+
it disappears. Override with a darker overlay matched to the
|
|
279
|
+
dark surface palette. Same specificity as the editorial-light
|
|
280
|
+
block, so the explicit dark-editorial selector wins. */
|
|
281
|
+
--ck-shadow-overlay:
|
|
282
|
+
0 32px 80px rgba(0, 0, 0, 0.7),
|
|
283
|
+
0 12px 24px rgba(0, 0, 0, 0.5);
|
|
258
284
|
}
|
|
259
285
|
|
|
260
286
|
/* ---------- Neobrutalism chrome — thick 2 px borders, hard
|