anentrypoint-design 1.0.14 → 1.0.15
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/dist/247420.css +8 -0
- package/dist/247420.js +23 -23
- package/package.json +1 -1
- package/src/components/shell/app-shell.js +12 -10
- package/src/css/app-shell/topbar.css +8 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anentrypoint-design",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "247420 design system SDK — webjsx + modified ripple-ui, single-file ESM bundle for reproducible use of the AnEntrypoint design.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/247420.js",
|
|
@@ -15,9 +15,18 @@ const h = webjsx.createElement;
|
|
|
15
15
|
// call site having to remember to wire ThemeToggle() in by hand. Pass
|
|
16
16
|
// `themeToggle: false` to opt a shell out (e.g. a kit that renders its own).
|
|
17
17
|
export function Topbar({ brand = '247420', leaf = '', items = [], active = '', onNav, search, themeToggle = true } = {}) {
|
|
18
|
+
// `search` is either a plain placeholder string (Topbar renders the
|
|
19
|
+
// default uncontrolled input itself, and owns the icon below) or a
|
|
20
|
+
// caller-built VElement (has .type/.props — e.g. SearchInput(), a
|
|
21
|
+
// component that already renders its own icon + input + clear button).
|
|
22
|
+
// A VElement renders as-is with NO extra wrapper: SearchInput's own
|
|
23
|
+
// markup already covers the icon and the field, so wrapping it in
|
|
24
|
+
// Topbar's own '.app-search' icon+label previously doubled the search
|
|
25
|
+
// glyph (one from Topbar, one from inside SearchInput).
|
|
26
|
+
const isElement = search && typeof search === 'object' && 'type' in search;
|
|
18
27
|
return h('header', { class: 'app-topbar', role: 'banner' },
|
|
19
28
|
Brand({ name: brand, leaf }),
|
|
20
|
-
search ? h('label', { class: 'app-search' },
|
|
29
|
+
isElement ? search : (search ? h('label', { class: 'app-search' },
|
|
21
30
|
// Line-icon, not the literal word "search" as a pseudo-glyph: the
|
|
22
31
|
// text stand-in inherited .app-search .icon's 0.6 opacity, which
|
|
23
32
|
// dropped --fg-3 to 3.74:1 on --bg-2 and failed AA as real text.
|
|
@@ -25,15 +34,8 @@ export function Topbar({ brand = '247420', leaf = '', items = [], active = '', o
|
|
|
25
34
|
// contrast rule no longer applies to it and the affordance stops
|
|
26
35
|
// depending on a colour value at all.
|
|
27
36
|
h('span', { class: 'icon', 'aria-hidden': 'true' }, Icon('search', { size: 15 })),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
// .type/.props — e.g. a controlled <input> wired to app state)
|
|
31
|
-
// rendered as-is. Stringifying a VElement into placeholder/
|
|
32
|
-
// aria-label previously produced literal "[object Object]" text.
|
|
33
|
-
(search && typeof search === 'object' && 'type' in search)
|
|
34
|
-
? search
|
|
35
|
-
: h('input', { type: 'search', name: 'q', placeholder: search, 'aria-label': `search ${search}` })
|
|
36
|
-
) : null,
|
|
37
|
+
h('input', { type: 'search', name: 'q', placeholder: search, 'aria-label': `search ${search}` })
|
|
38
|
+
) : null),
|
|
37
39
|
h('nav', { 'aria-label': 'main navigation' }, ...items.map(([label, href]) => {
|
|
38
40
|
const cleanLabel = String(label).replace(' ->', '');
|
|
39
41
|
return h('a', {
|
|
@@ -79,6 +79,14 @@ body.canvas-host { background: transparent !important; }
|
|
|
79
79
|
.app-chrome > .app-crumb > .crumb-right { margin-left: auto; }
|
|
80
80
|
.app-topbar > .brand { flex: 0 0 auto; }
|
|
81
81
|
.app-topbar > .app-search { flex: 1 1 auto; }
|
|
82
|
+
/* SearchInput() passed directly as Topbar's search prop renders with no
|
|
83
|
+
Topbar-owned wrapper (see Topbar's isElement branch). Its own outer span
|
|
84
|
+
(.ds-search-input-wrap) is display:contents, so .ds-search-field becomes
|
|
85
|
+
the actual direct .app-topbar flex-item child — an inline-flex box that
|
|
86
|
+
otherwise shrinks to its content and starves the input's own width:100%
|
|
87
|
+
of anything to grow into, truncating the placeholder. Matches
|
|
88
|
+
.app-search's flex-basis above so both search-slot shapes size the same. */
|
|
89
|
+
.app-topbar > .ds-search-field { flex: 1 1 auto; max-width: 360px; min-width: 0; }
|
|
82
90
|
.app-topbar > nav { margin-left: auto; }
|
|
83
91
|
/* Utility cluster grouping: the theme toggle sits after the repo-info nav
|
|
84
92
|
links with no visual separation between the two groups, so the row read
|