@cboxdk/cbox-ui 0.10.3 → 0.10.4
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/README.md +17 -2
- package/dist/index.d.ts +20 -5
- package/dist/index.js +60 -30
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/tailwind.preset.js +4 -0
- package/tokens/cbox.css +17 -0
- package/tokens/shell.css +10 -8
package/package.json
CHANGED
package/tailwind.preset.js
CHANGED
|
@@ -65,20 +65,24 @@ module.exports = {
|
|
|
65
65
|
DEFAULT: 'var(--success)',
|
|
66
66
|
foreground: 'var(--success-foreground)',
|
|
67
67
|
soft: 'var(--success-soft)',
|
|
68
|
+
text: 'var(--success-text)',
|
|
68
69
|
},
|
|
69
70
|
warning: {
|
|
70
71
|
DEFAULT: 'var(--warning)',
|
|
71
72
|
foreground: 'var(--warning-foreground)',
|
|
72
73
|
soft: 'var(--warning-soft)',
|
|
74
|
+
text: 'var(--warning-text)',
|
|
73
75
|
},
|
|
74
76
|
info: {
|
|
75
77
|
DEFAULT: 'var(--info)',
|
|
76
78
|
soft: 'var(--info-soft)',
|
|
79
|
+
text: 'var(--info-text)',
|
|
77
80
|
},
|
|
78
81
|
destructive: {
|
|
79
82
|
DEFAULT: 'var(--destructive)',
|
|
80
83
|
foreground: 'var(--destructive-foreground)',
|
|
81
84
|
soft: 'var(--destructive-soft)',
|
|
85
|
+
text: 'var(--destructive-text)',
|
|
82
86
|
},
|
|
83
87
|
border: 'var(--border)',
|
|
84
88
|
input: 'var(--input)',
|
package/tokens/cbox.css
CHANGED
|
@@ -41,6 +41,13 @@
|
|
|
41
41
|
--info: oklch(0.62 0.16 230);
|
|
42
42
|
--info-soft: oklch(0.62 0.16 230 / 0.12);
|
|
43
43
|
|
|
44
|
+
/* Tone text: words and icons in a tone on its soft tint, a card or the canvas. The fills
|
|
45
|
+
* above are too light for small text; these reach 4.5:1 (WCAG AA) on all three. */
|
|
46
|
+
--success-text: oklch(0.48 0.13 145);
|
|
47
|
+
--info-text: oklch(0.48 0.13 230);
|
|
48
|
+
--warning-text: oklch(0.48 0.11 65);
|
|
49
|
+
--destructive-text: oklch(0.50 0.19 25);
|
|
50
|
+
|
|
44
51
|
--destructive: oklch(0.58 0.21 25);
|
|
45
52
|
--destructive-foreground: oklch(0.99 0.003 247);
|
|
46
53
|
--destructive-soft: oklch(0.58 0.21 25 / 0.12);
|
|
@@ -108,6 +115,11 @@
|
|
|
108
115
|
--info: oklch(0.7 0.16 230);
|
|
109
116
|
--info-soft: oklch(0.7 0.16 230 / 0.16);
|
|
110
117
|
|
|
118
|
+
--success-text: oklch(0.74 0.16 145);
|
|
119
|
+
--info-text: oklch(0.7 0.16 230);
|
|
120
|
+
--warning-text: oklch(0.78 0.16 70);
|
|
121
|
+
--destructive-text: oklch(0.76 0.15 25);
|
|
122
|
+
|
|
111
123
|
--destructive: oklch(0.68 0.21 25);
|
|
112
124
|
--destructive-foreground: oklch(0.16 0.01 250);
|
|
113
125
|
--destructive-soft: oklch(0.68 0.21 25 / 0.16);
|
|
@@ -190,6 +202,11 @@
|
|
|
190
202
|
--color-destructive-foreground: var(--destructive-foreground);
|
|
191
203
|
--color-destructive-soft: var(--destructive-soft);
|
|
192
204
|
|
|
205
|
+
--color-success-text: var(--success-text);
|
|
206
|
+
--color-info-text: var(--info-text);
|
|
207
|
+
--color-warning-text: var(--warning-text);
|
|
208
|
+
--color-destructive-text: var(--destructive-text);
|
|
209
|
+
|
|
193
210
|
--color-border: var(--border);
|
|
194
211
|
--color-border-strong: var(--border-strong);
|
|
195
212
|
--color-input: var(--input);
|
package/tokens/shell.css
CHANGED
|
@@ -14,9 +14,11 @@
|
|
|
14
14
|
--cbx-font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
15
15
|
--cbx-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
16
16
|
--cbx-font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
|
|
17
|
+
/* The document scrolls, not a box inside the shell: Inertia resets the scroll on a new page and
|
|
18
|
+
* restores it on back and forward, and a full-page screenshot shows the whole page. The rail,
|
|
19
|
+
* the header, the subnav and docked Help stay in view with `position: sticky`. */
|
|
17
20
|
display: flex;
|
|
18
|
-
height: 100svh;
|
|
19
|
-
overflow: hidden;
|
|
21
|
+
min-height: 100svh;
|
|
20
22
|
font-family: var(--cbx-font-sans);
|
|
21
23
|
font-size: 14px;
|
|
22
24
|
line-height: 1.45;
|
|
@@ -53,7 +55,7 @@
|
|
|
53
55
|
.cbx-icon-button:hover { background: var(--secondary); color: var(--foreground); }
|
|
54
56
|
|
|
55
57
|
/* ── Rail (tier 1) ───────────────────────────────────────────────────────────── */
|
|
56
|
-
.cbx-rail-slot { position:
|
|
58
|
+
.cbx-rail-slot { position: sticky; top: 0; align-self: flex-start; height: 100svh; flex: 0 0 64px; width: 64px; z-index: 40; transition: flex-basis 300ms var(--cbx-ease), width 300ms var(--cbx-ease); }
|
|
57
59
|
.cbx-rail-slot[data-pinned='true'] { flex-basis: 222px; width: 222px; }
|
|
58
60
|
.cbx-rail { position: absolute; inset: 6px auto 6px 6px; width: 52px; display: flex; flex-direction: column; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--sidebar); color: var(--sidebar-foreground); overflow: hidden; transition: width 200ms var(--cbx-ease), box-shadow 200ms var(--cbx-ease); }
|
|
59
61
|
.cbx-rail[data-open='true'] { width: 210px; }
|
|
@@ -100,7 +102,7 @@
|
|
|
100
102
|
|
|
101
103
|
/* ── Column, header, banner ─────────────────────────────────────────────────── */
|
|
102
104
|
.cbx-shell-column { display: flex; flex: 1 1 auto; min-width: 0; flex-direction: column; }
|
|
103
|
-
.cbx-header { position:
|
|
105
|
+
.cbx-header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 56px; flex: none; padding: 0 16px 0 12px; background: var(--background); border-bottom: 1px solid var(--border); }
|
|
104
106
|
.cbx-context { display: flex; align-items: center; gap: 2px; min-width: 0; flex: 1 1 auto; }
|
|
105
107
|
.cbx-trigger { display: flex; align-items: center; gap: 8px; height: 32px; min-width: 0; max-width: 360px; padding: 0 6px 0 5px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--foreground); transition: background 150ms var(--cbx-ease); }
|
|
106
108
|
.cbx-trigger:hover, .cbx-trigger.is-open { background: var(--secondary); }
|
|
@@ -135,10 +137,10 @@
|
|
|
135
137
|
.cbx-banner-text { min-width: 0; }
|
|
136
138
|
.cbx-banner-action { margin-left: auto; font-weight: 600; text-decoration: underline; white-space: nowrap; }
|
|
137
139
|
.cbx-shell-body { display: flex; flex: 1; min-height: 0; }
|
|
138
|
-
.cbx-shell-main { flex: 1; min-width: 0;
|
|
140
|
+
.cbx-shell-main { flex: 1; min-width: 0; scroll-margin-top: 56px; }
|
|
139
141
|
|
|
140
142
|
/* ── Subnav (tier 2) ────────────────────────────────────────────────────────── */
|
|
141
|
-
.cbx-subnav { width: 210px; flex: none; overflow-y: auto; padding: 12px 8px; background: var(--background); border-right: 1px solid var(--border); overscroll-behavior: contain; }
|
|
143
|
+
.cbx-subnav { position: sticky; top: 56px; align-self: flex-start; height: calc(100svh - 56px); width: 210px; flex: none; overflow-y: auto; padding: 12px 8px; background: var(--background); border-right: 1px solid var(--border); overscroll-behavior: contain; }
|
|
142
144
|
.cbx-subnav[data-collapsed='true'] { width: 26px; padding: 0; }
|
|
143
145
|
.cbx-subnav-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 0 4px 0 12px; margin-bottom: 8px; font-size: 13px; }
|
|
144
146
|
.cbx-subnav-list { display: flex; flex-direction: column; gap: 4px; }
|
|
@@ -274,14 +276,14 @@ textarea.cbx-input { height: auto; padding: 10px 12px; resize: vertical; min-hei
|
|
|
274
276
|
.cbx-palette-foot .cbx-kbd + .cbx-kbd { margin-left: 2px; }
|
|
275
277
|
|
|
276
278
|
/* ── Help column (§7) ───────────────────────────────────────────────────────── */
|
|
277
|
-
.cbx-help { display: flex; flex-direction: column; flex: 0 0 360px; width: 360px; min-height: 0; background: var(--background); border-left: 1px solid var(--border); outline: none; }
|
|
279
|
+
.cbx-help { position: sticky; top: 0; align-self: flex-start; height: 100svh; display: flex; flex-direction: column; flex: 0 0 360px; width: 360px; min-height: 0; background: var(--background); border-left: 1px solid var(--border); outline: none; }
|
|
278
280
|
.cbx-help[hidden] { display: none; }
|
|
279
281
|
/* Help left open from an earlier visit only shows docked: below 1280px it waits for the person,
|
|
280
282
|
also on the server-rendered first paint, before the client knows the width. */
|
|
281
283
|
@media (max-width: 1279px) { .cbx-help[data-restored="true"] { display: none; } }
|
|
282
284
|
@media (min-width: 1440px) { .cbx-help { flex-basis: 400px; width: 400px; } }
|
|
283
285
|
@media (max-width: 1279px) {
|
|
284
|
-
.cbx-help { position: fixed; inset: 0; z-index: 65; width: auto; border-left: 0; animation: cbx-fade 150ms var(--cbx-ease); }
|
|
286
|
+
.cbx-help { position: fixed; inset: 0; z-index: 65; width: auto; height: auto; align-self: stretch; border-left: 0; animation: cbx-fade 150ms var(--cbx-ease); }
|
|
285
287
|
}
|
|
286
288
|
.cbx-help-head { display: flex; align-items: center; gap: 8px; height: 56px; flex: none; padding: 0 12px 0 16px; border-bottom: 1px solid var(--border); }
|
|
287
289
|
.cbx-help-mark { color: var(--primary); flex: none; }
|