@gemboss/ui 0.8.1 → 0.10.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.
- package/CHANGELOG.md +42 -0
- package/README.md +131 -1
- package/catalog/index.html +122 -2
- package/gemboss-ui.css +92 -6
- package/package.json +12 -3
- package/src/app-shell.css +76 -0
- package/src/editor.css +1096 -0
- package/src/index.ts +2 -0
- package/src/kit-plain.css +14 -4
- package/src/kit-plain.js +118 -1
- package/src/nav-dwell.ts +6 -0
- package/src/next/index.ts +4 -0
- package/src/next/nav.tsx +142 -0
- package/src/route-holding.tsx +65 -0
- package/src/shell.tsx +12 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gemboss/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "GemBoss design system for every surface in the fleet: the admin shell (topbar + rail + drawer) as React components, and the admin stylesheet exported as one CSS file.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"./shell.css": "./src/shell.css",
|
|
21
21
|
"./chat.css": "./src/chat.css",
|
|
22
22
|
"./chat-composer.css": "./src/chat-composer.css",
|
|
23
|
+
"./editor.css": "./src/editor.css",
|
|
23
24
|
"./auth.css": "./src/auth.css",
|
|
24
25
|
"./kit-plain.css": "./src/kit-plain.css",
|
|
25
26
|
"./kit-plain.js": "./src/kit-plain.js",
|
|
@@ -28,7 +29,8 @@
|
|
|
28
29
|
"./assistant.css": "./src/assistant.css",
|
|
29
30
|
"./portal.css": "./src/portal.css",
|
|
30
31
|
"./theme-dark.css": "./src/theme-dark.css",
|
|
31
|
-
"./icon.svg": "./src/icon.svg"
|
|
32
|
+
"./icon.svg": "./src/icon.svg",
|
|
33
|
+
"./next": "./src/next/index.ts"
|
|
32
34
|
},
|
|
33
35
|
"files": [
|
|
34
36
|
"src/**/*.ts",
|
|
@@ -39,7 +41,8 @@
|
|
|
39
41
|
"!src/**/*.test.*",
|
|
40
42
|
"gemboss-ui.css",
|
|
41
43
|
"catalog/index.html",
|
|
42
|
-
"README.md"
|
|
44
|
+
"README.md",
|
|
45
|
+
"CHANGELOG.md"
|
|
43
46
|
],
|
|
44
47
|
"scripts": {
|
|
45
48
|
"build:css": "node scripts/build-css.mjs",
|
|
@@ -49,8 +52,14 @@
|
|
|
49
52
|
"fleet": "node scripts/fleet.mjs"
|
|
50
53
|
},
|
|
51
54
|
"peerDependencies": {
|
|
55
|
+
"next": ">=15.3",
|
|
52
56
|
"react": ">=18"
|
|
53
57
|
},
|
|
58
|
+
"peerDependenciesMeta": {
|
|
59
|
+
"next": {
|
|
60
|
+
"optional": true
|
|
61
|
+
}
|
|
62
|
+
},
|
|
54
63
|
"publishConfig": {
|
|
55
64
|
"access": "public"
|
|
56
65
|
},
|
package/src/app-shell.css
CHANGED
|
@@ -67,6 +67,82 @@
|
|
|
67
67
|
}
|
|
68
68
|
.gnav-item.active .gnav-count { background: var(--gemboss-primary); color: var(--gemboss-on-primary); }
|
|
69
69
|
|
|
70
|
+
/* ── Navigation pending (0.10.0): a click answers on the first frame ─────────────────────────────────────────────
|
|
71
|
+
* Chris 05/10/2026: content-radar's rail (the icon turns into a spinner the moment you click, sub items too) is the
|
|
72
|
+
* standard for every surface. Measured 04/10 on content-radar with a server ~280 ms away: nothing on screen changed
|
|
73
|
+
* for 321-503 ms after a click; with this, 6-8 ms.
|
|
74
|
+
*
|
|
75
|
+
* ONE state, three ways to set it, so a React rail, a Next rail and a server-rendered rail look the same:
|
|
76
|
+
* - `aria-busy="true"` on the item: RailItem / RailSubItem `pending` (React), kit-plain.js on a followed link;
|
|
77
|
+
* - a `.gnav-pending` child: NavLink from `@gemboss/ui/next` (Next's useLinkStatus is only readable INSIDE the
|
|
78
|
+
* link, so the link cannot set its own attribute; it renders this status text and `:has()` reads it).
|
|
79
|
+
* `:is()` is forgiving: a browser without `:has()` still honours the aria-busy half of each rule.
|
|
80
|
+
* The icon keeps its box (visibility, not display), so the label never moves. Here and not in shell.css: the
|
|
81
|
+
* admin's shell sheet has <1 KB of first-load headroom, and the admin answers a click with its own holding screen.
|
|
82
|
+
*/
|
|
83
|
+
.gnav-item:is([aria-busy="true"], :has(> .gnav-pending)),
|
|
84
|
+
.gnav-subitem:is([aria-busy="true"], :has(> .gnav-pending)) { cursor: progress; }
|
|
85
|
+
.gnav-item:is([aria-busy="true"], :has(> .gnav-pending)) > .gnav-ico > * { visibility: hidden; }
|
|
86
|
+
.gnav-item:is([aria-busy="true"], :has(> .gnav-pending)) > .gnav-ico::after,
|
|
87
|
+
.gnav-subitem:is([aria-busy="true"], :has(> .gnav-pending))::after,
|
|
88
|
+
.gb-pending-mark {
|
|
89
|
+
content: ""; display: inline-block; vertical-align: middle; grid-area: 1 / 1; flex: none; box-sizing: border-box;
|
|
90
|
+
width: 20px; height: 20px; border-radius: 50%;
|
|
91
|
+
/* the item's own ink, so the spinner follows the active and hover colours */
|
|
92
|
+
border: 2px solid color-mix(in srgb, currentColor 18%, transparent); border-top-color: currentColor;
|
|
93
|
+
animation: gnav-spin 0.7s linear infinite;
|
|
94
|
+
}
|
|
95
|
+
/* A sub item has no icon box: a 12px spinner in its 44px indent, just before the label, out of the flow. At the row's end
|
|
96
|
+
* it would be a third item in a space-between row and push a trailing count to the middle (review #3777). */
|
|
97
|
+
.gnav-subitem:is([aria-busy="true"], :has(> .gnav-pending))::after {
|
|
98
|
+
position: absolute; left: 22px; top: 50%; margin-top: -6px; width: 12px; height: 12px; border-width: 1.5px;
|
|
99
|
+
}
|
|
100
|
+
@keyframes gnav-spin { to { transform: rotate(360deg); } }
|
|
101
|
+
/* Slower, never off: it is the only sign that the click was heard. */
|
|
102
|
+
@media (prefers-reduced-motion: reduce) {
|
|
103
|
+
.gnav-item:is([aria-busy="true"], :has(> .gnav-pending)) > .gnav-ico::after,
|
|
104
|
+
.gnav-subitem:is([aria-busy="true"], :has(> .gnav-pending))::after,
|
|
105
|
+
.gb-pending-mark { animation-duration: 2s; }
|
|
106
|
+
}
|
|
107
|
+
/* A link in the PAGE (a list row, a card, a tab) opts in with `data-gb-pending`: PendingLink (`@gemboss/ui/next`) or
|
|
108
|
+
* kit-plain.js put `span.gb-pending-mark` (role=status) inside it while the page loads. "inline" (default): 12px after
|
|
109
|
+
* the text. "corner": 16px in the top right corner, out of the flow, for a link that wraps a whole card (a grid card
|
|
110
|
+
* gains no column). Marked by attribute, not class: a surface that colours bare links with `a:not([class])` keeps it. */
|
|
111
|
+
a[data-gb-pending]:has(> .gb-pending-mark), a[data-gb-pending][aria-busy="true"] { cursor: progress; }
|
|
112
|
+
a[data-gb-pending] > .gb-pending-mark { display: inline-block; width: 12px; height: 12px; border-width: 1.5px; margin-left: 6px; vertical-align: -1px; }
|
|
113
|
+
a[data-gb-pending="corner"] { position: relative; }
|
|
114
|
+
a[data-gb-pending="corner"] > .gb-pending-mark { position: absolute; top: 12px; right: 12px; width: 16px; height: 16px; margin: 0; }
|
|
115
|
+
/* RouteHolding (./route-holding.tsx): a route group's loading boundary. The kit's skeleton lines in the content column,
|
|
116
|
+
* one shape for every route: a title bar, then four lines of falling length (the admin's holding screen). */
|
|
117
|
+
.gb-route-holding { padding-top: 4px; }
|
|
118
|
+
.gb-route-holding .ui-skeleton { gap: 16px; }
|
|
119
|
+
.gb-route-holding__heading { margin: 0 0 20px; font-size: 20px; font-weight: 650; line-height: 1.3; color: var(--gemboss-text); }
|
|
120
|
+
.gb-route-holding .ui-skeleton__line { height: 10px; }
|
|
121
|
+
.gb-route-holding .ui-skeleton__line.gb-route-holding__title { height: 20px; width: 34%; margin-bottom: 8px; }
|
|
122
|
+
.gb-route-holding .ui-skeleton__line:nth-last-child(4) { width: 46%; }
|
|
123
|
+
.gb-route-holding .ui-skeleton__line:nth-last-child(3) { width: 92%; }
|
|
124
|
+
.gb-route-holding .ui-skeleton__line:nth-last-child(2) { width: 78%; }
|
|
125
|
+
.gb-route-holding .ui-skeleton__line:nth-last-child(1) { width: 61%; }
|
|
126
|
+
/* RouteCover: the same frame over the content area from the click until the navigation commits. Shown only while
|
|
127
|
+
* `html[data-gb-navigating]` (set by the @gemboss/ui/next links while pending). No grace delay: the target is the new
|
|
128
|
+
* screen within 100 ms of the click, and a 40 ms grace measured 120-132 ms on content-radar's rail (05/10/2026). The
|
|
129
|
+
* 80 ms fade is what a router cache hit (20-90 ms) sees of it: a faint, partial frame, not a full flash.
|
|
130
|
+
* z 5: above the outgoing page, below the rail, the topbar (300) and the assistant (290). */
|
|
131
|
+
.gb-route-cover { display: none; }
|
|
132
|
+
html[data-gb-navigating] .gb-route-cover {
|
|
133
|
+
display: block; position: fixed; inset: 56px 0 0 240px; z-index: 5; overflow: hidden; box-sizing: border-box;
|
|
134
|
+
padding: 24px; background: var(--gemboss-app-bg); pointer-events: none;
|
|
135
|
+
animation: gb-route-cover-in 0.08s ease-out both;
|
|
136
|
+
}
|
|
137
|
+
@keyframes gb-route-cover-in { from { opacity: 0; } to { opacity: 1; } }
|
|
138
|
+
@media (max-width: 760px) { html[data-gb-navigating] .gb-route-cover { left: 0; padding: 16px; } }
|
|
139
|
+
@media (prefers-reduced-motion: reduce) { html[data-gb-navigating] .gb-route-cover { animation-duration: 0s; } }
|
|
140
|
+
/* The status text a NavLink renders inside a rail item: read, not seen. */
|
|
141
|
+
.gnav-pending {
|
|
142
|
+
position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
|
|
143
|
+
overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
|
|
144
|
+
}
|
|
145
|
+
|
|
70
146
|
/* ── BrandLockup (./brand.tsx) ─────────────────────────────────────────────────────────────────
|
|
71
147
|
* The admin's `.gemboss-brand-lockup` box (40px tall, 8px padding, hover wash) around the wordmark's
|
|
72
148
|
* own proportions. Not that class itself: its ≤460px rule swaps in a background image at an
|