@cosxai/ui 0.4.9 → 0.4.11
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
CHANGED
package/src/dialogs/Modal.tsx
CHANGED
|
@@ -97,8 +97,15 @@ export function Modal({
|
|
|
97
97
|
maxHeight: "calc(100vh - 32px)",
|
|
98
98
|
background: "var(--ck-bg-surface)",
|
|
99
99
|
border: "1px solid var(--ck-border-subtle)",
|
|
100
|
-
|
|
101
|
-
|
|
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)",
|
|
102
109
|
display: "flex",
|
|
103
110
|
flexDirection: "column",
|
|
104
111
|
overflow: "hidden",
|
|
@@ -129,7 +136,11 @@ export function ModalHeader({ title, subtitle, onClose, titleId }: ModalHeaderPr
|
|
|
129
136
|
return (
|
|
130
137
|
<header
|
|
131
138
|
style={{
|
|
132
|
-
|
|
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",
|
|
133
144
|
borderBottom: "1px solid var(--ck-border-subtle)",
|
|
134
145
|
display: "flex",
|
|
135
146
|
alignItems: "flex-start",
|
|
@@ -196,7 +207,7 @@ export function ModalHeader({ title, subtitle, onClose, titleId }: ModalHeaderPr
|
|
|
196
207
|
|
|
197
208
|
export function ModalBody({ children }: { children: ReactNode }) {
|
|
198
209
|
return (
|
|
199
|
-
<div style={{ flex: 1, minHeight: 0, overflowY: "auto", padding: "20px" }}>
|
|
210
|
+
<div style={{ flex: 1, minHeight: 0, overflowY: "auto", padding: "20px 24px 24px" }}>
|
|
200
211
|
{children}
|
|
201
212
|
</div>
|
|
202
213
|
);
|
|
@@ -206,7 +217,7 @@ export function ModalFooter({ children }: { children: ReactNode }) {
|
|
|
206
217
|
return (
|
|
207
218
|
<footer
|
|
208
219
|
style={{
|
|
209
|
-
padding: "
|
|
220
|
+
padding: "16px 24px",
|
|
210
221
|
borderTop: "1px solid var(--ck-border-subtle)",
|
|
211
222
|
display: "flex",
|
|
212
223
|
justifyContent: "flex-end",
|
package/src/styles/index.css
CHANGED
|
@@ -229,10 +229,13 @@ html[data-ck-chrome="seamless"] .ck-card__foot {
|
|
|
229
229
|
transform: translateY(-1px);
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
/* Hide labels below 768 px (the standard
|
|
233
|
-
Icons + tooltips remain — the bar's still
|
|
232
|
+
/* Hide labels + keyboard-shortcut hints below 768 px (the standard
|
|
233
|
+
md breakpoint). Icons + tooltips remain — the bar's still
|
|
234
|
+
informative on phones, and there's no physical keyboard so the
|
|
235
|
+
shortcut badge has nothing to advertise. */
|
|
234
236
|
@media (max-width: 767px) {
|
|
235
|
-
.ck-actionbar-label
|
|
237
|
+
.ck-actionbar-label,
|
|
238
|
+
.ck-actionbar-hint {
|
|
236
239
|
display: none;
|
|
237
240
|
}
|
|
238
241
|
}
|
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
|