nish-ui 3.0.0 → 3.2.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/README.md +11 -8
- package/dist/chart.d.ts +8 -3
- package/dist/chart.js +4 -419
- package/dist/elements-all.js +70 -69
- package/dist/elements-charts.d.ts +8 -2
- package/dist/elements-charts.js +23 -23
- package/dist/elements-data.d.ts +7 -1
- package/dist/elements-data.js +5 -5
- package/dist/elements-forms.d.ts +7 -1
- package/dist/elements-forms.js +20 -19
- package/dist/elements.d.ts +7 -1
- package/dist/elements.js +4 -4
- package/dist/esm/chart-values.js +2 -1
- package/dist/esm/combobox-filter.js +6 -5
- package/dist/esm/command-filter.js +32 -0
- package/dist/esm/components/accordion.js +2 -1
- package/dist/esm/components/app-shell.js +1 -1
- package/dist/esm/components/avatar.js +2 -2
- package/dist/esm/components/breadcrumbs.js +1 -1
- package/dist/esm/components/calendar-base.js +1 -1
- package/dist/esm/components/canvas/legend.js +4 -4
- package/dist/esm/components/canvas/system-canvas.js +24 -1
- package/dist/esm/components/carousel.js +21 -3
- package/dist/esm/components/charts.js +21 -13
- package/dist/esm/components/combobox.js +3 -3
- package/dist/esm/components/command.js +5 -5
- package/dist/esm/components/data-classes.js +23 -8
- package/dist/esm/components/data.js +1 -5
- package/dist/esm/components/date-picker.js +1 -0
- package/dist/esm/components/date-range-picker.js +1 -0
- package/dist/esm/components/display.js +7 -7
- package/dist/esm/components/feedback.js +1 -1
- package/dist/esm/components/file-dropzone.js +44 -2
- package/dist/esm/components/filters.js +3 -1
- package/dist/esm/components/flow.js +16 -15
- package/dist/esm/components/forms-classes.js +1 -1
- package/dist/esm/components/forms.js +30 -6
- package/dist/esm/components/hooks.js +20 -17
- package/dist/esm/components/inbox.js +13 -8
- package/dist/esm/components/layout-vars.js +10 -7
- package/dist/esm/components/menu.js +11 -4
- package/dist/esm/components/multi-select.js +9 -6
- package/dist/esm/components/nav-classes.js +9 -0
- package/dist/esm/components/nav.js +2 -1
- package/dist/esm/components/overlay-core.js +31 -10
- package/dist/esm/components/overlay-dialog.js +17 -2
- package/dist/esm/components/pagination.js +4 -1
- package/dist/esm/components/popover.js +15 -9
- package/dist/esm/components/primitives-classes.js +4 -4
- package/dist/esm/components/primitives.js +2 -2
- package/dist/esm/components/progress.js +2 -0
- package/dist/esm/components/radio-group.js +1 -1
- package/dist/esm/components/resource-classes.js +41 -19
- package/dist/esm/components/resource.js +8 -6
- package/dist/esm/components/settings.js +9 -3
- package/dist/esm/components/slider.js +1 -0
- package/dist/esm/components/strings.js +9 -1
- package/dist/esm/components/tabs.js +3 -2
- package/dist/esm/components/tag-input.js +15 -7
- package/dist/esm/components/time-field-classes.js +5 -2
- package/dist/esm/components/time-field.js +15 -7
- package/dist/esm/components/toast-store.js +16 -4
- package/dist/esm/components/tooltip.js +1 -1
- package/dist/esm/components/url-state.js +3 -1
- package/dist/esm/components/virtual-table.js +8 -2
- package/dist/esm/components/virtual.js +16 -2
- package/dist/esm/format.js +41 -16
- package/dist/esm/runtime.js +9 -2
- package/dist/esm/server/inbox/client.js +1 -1
- package/dist/esm/split-layout.js +2 -1
- package/dist/esm/theme.js +66 -6
- package/dist/format.js +50 -19
- package/dist/inbox-client.d.ts +5 -1
- package/dist/inbox-client.js +1 -2
- package/dist/index.d.ts +39 -11
- package/dist/nish-components.css +52 -3
- package/dist/nish-components.min.css +1 -1
- package/dist/node/th-check.js +12 -3
- package/dist/server/hono.d.ts +2 -2
- package/dist/server/hono.js +111 -8
- package/dist/server/index.d.ts +20 -12
- package/dist/server/index.js +136 -32
- package/dist/{spa-BLlMc0eI.d.ts → spa-BfRDo38r.d.ts} +35 -6
- package/dist/split-layout.js +2 -2
- package/dist/system-canvas.d.ts +0 -4
- package/dist/theme.d.ts +20 -2
- package/dist/theme.global.js +75 -10
- package/dist/theme.js +75 -9
- package/package.json +1 -1
package/dist/esm/theme.js
CHANGED
|
@@ -648,7 +648,8 @@ function mountStuck(el, onChange) {
|
|
|
648
648
|
};
|
|
649
649
|
}
|
|
650
650
|
function mountScrollspy(nav, o = {}) {
|
|
651
|
-
|
|
651
|
+
const noop = Object.assign(() => void 0, { lock: (_id) => void 0 });
|
|
652
|
+
if (typeof document === "undefined") return noop;
|
|
652
653
|
const links = Array.from(nav.querySelectorAll('a[href^="#"]')).filter((a) => a.hash.length > 1);
|
|
653
654
|
const target = (a) => {
|
|
654
655
|
try {
|
|
@@ -659,13 +660,16 @@ function mountScrollspy(nav, o = {}) {
|
|
|
659
660
|
};
|
|
660
661
|
const unheight = o.height === false ? () => void 0 : mountHeightVar(nav, "--nish-sticky-extra");
|
|
661
662
|
let current = null;
|
|
663
|
+
let locked = null;
|
|
664
|
+
let unlockListeners = null;
|
|
662
665
|
const edges = () => {
|
|
663
666
|
const max = nav.scrollWidth - nav.clientWidth;
|
|
664
|
-
|
|
665
|
-
nav.dataset.
|
|
667
|
+
const left = getComputedStyle(nav).direction === "rtl" ? nav.scrollLeft + max : nav.scrollLeft;
|
|
668
|
+
nav.dataset.atStart = String(left <= 1);
|
|
669
|
+
nav.dataset.atEnd = String(max <= 1 || left >= max - 1);
|
|
666
670
|
};
|
|
667
671
|
const reveal = (a) => {
|
|
668
|
-
const left = a.
|
|
672
|
+
const left = a.getBoundingClientRect().left - nav.getBoundingClientRect().left + nav.scrollLeft - nav.clientLeft;
|
|
669
673
|
const view = nav.clientWidth;
|
|
670
674
|
if (left < nav.scrollLeft + 24) nav.scrollLeft = Math.max(0, left - 24);
|
|
671
675
|
else if (left + a.offsetWidth > nav.scrollLeft + view - 24) nav.scrollLeft = left + a.offsetWidth - view + 24;
|
|
@@ -691,7 +695,61 @@ function mountScrollspy(nav, o = {}) {
|
|
|
691
695
|
if (window.innerHeight + window.scrollY >= de.scrollHeight - 2) {
|
|
692
696
|
for (const a of links) if (target(a)) found = a;
|
|
693
697
|
}
|
|
694
|
-
activate(found);
|
|
698
|
+
activate(locked ?? found);
|
|
699
|
+
};
|
|
700
|
+
const unlock = () => {
|
|
701
|
+
unlockListeners?.();
|
|
702
|
+
unlockListeners = null;
|
|
703
|
+
locked = null;
|
|
704
|
+
};
|
|
705
|
+
const lock = (id) => {
|
|
706
|
+
const a = links.find((l) => {
|
|
707
|
+
try {
|
|
708
|
+
return decodeURIComponent(l.hash.slice(1)) === id;
|
|
709
|
+
} catch {
|
|
710
|
+
return false;
|
|
711
|
+
}
|
|
712
|
+
});
|
|
713
|
+
if (!a) return;
|
|
714
|
+
unlock();
|
|
715
|
+
locked = a;
|
|
716
|
+
activate(a);
|
|
717
|
+
const release = () => {
|
|
718
|
+
unlock();
|
|
719
|
+
schedule();
|
|
720
|
+
};
|
|
721
|
+
const onKey = (e) => {
|
|
722
|
+
if (["ArrowUp", "ArrowDown", "PageUp", "PageDown", "Home", "End", " "].includes(e.key)) release();
|
|
723
|
+
};
|
|
724
|
+
let settled = false;
|
|
725
|
+
const settle = () => {
|
|
726
|
+
settled = true;
|
|
727
|
+
};
|
|
728
|
+
let t = setTimeout(settle, 400);
|
|
729
|
+
const onScroll = () => {
|
|
730
|
+
if (settled) release();
|
|
731
|
+
else {
|
|
732
|
+
clearTimeout(t);
|
|
733
|
+
t = setTimeout(settle, 200);
|
|
734
|
+
}
|
|
735
|
+
};
|
|
736
|
+
const onScrollEnd = () => {
|
|
737
|
+
clearTimeout(t);
|
|
738
|
+
t = setTimeout(settle, 50);
|
|
739
|
+
};
|
|
740
|
+
window.addEventListener("wheel", release, { passive: true });
|
|
741
|
+
window.addEventListener("touchstart", release, { passive: true });
|
|
742
|
+
window.addEventListener("keydown", onKey);
|
|
743
|
+
window.addEventListener("scroll", onScroll, { passive: true });
|
|
744
|
+
window.addEventListener("scrollend", onScrollEnd);
|
|
745
|
+
unlockListeners = () => {
|
|
746
|
+
clearTimeout(t);
|
|
747
|
+
window.removeEventListener("wheel", release);
|
|
748
|
+
window.removeEventListener("touchstart", release);
|
|
749
|
+
window.removeEventListener("keydown", onKey);
|
|
750
|
+
window.removeEventListener("scroll", onScroll);
|
|
751
|
+
window.removeEventListener("scrollend", onScrollEnd);
|
|
752
|
+
};
|
|
695
753
|
};
|
|
696
754
|
let frame = 0;
|
|
697
755
|
const schedule = () => {
|
|
@@ -719,7 +777,8 @@ function mountScrollspy(nav, o = {}) {
|
|
|
719
777
|
});
|
|
720
778
|
ro.observe(nav);
|
|
721
779
|
}
|
|
722
|
-
|
|
780
|
+
const stop = () => {
|
|
781
|
+
unlock();
|
|
723
782
|
if (frame) cancelAnimationFrame(frame);
|
|
724
783
|
window.removeEventListener("scroll", schedule);
|
|
725
784
|
window.removeEventListener("resize", schedule);
|
|
@@ -731,6 +790,7 @@ function mountScrollspy(nav, o = {}) {
|
|
|
731
790
|
delete nav.dataset.atStart;
|
|
732
791
|
delete nav.dataset.atEnd;
|
|
733
792
|
};
|
|
793
|
+
return Object.assign(stop, { lock });
|
|
734
794
|
}
|
|
735
795
|
function mountChecklist(list) {
|
|
736
796
|
if (typeof document === "undefined") return () => void 0;
|
package/dist/format.js
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
// src/runtime.ts
|
|
2
|
-
var version = true ? "3.
|
|
2
|
+
var version = true ? "3.2.0" : "dev";
|
|
3
3
|
var KEY = /* @__PURE__ */ Symbol.for("nish-ui.runtime.v1");
|
|
4
4
|
function runtime() {
|
|
5
5
|
const g = globalThis;
|
|
6
6
|
return g[KEY] ??= { versions: /* @__PURE__ */ new Set(), slots: {} };
|
|
7
7
|
}
|
|
8
|
+
function isDevelopment() {
|
|
9
|
+
try {
|
|
10
|
+
return process.env.NODE_ENV !== "production";
|
|
11
|
+
} catch {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
function register(rt) {
|
|
9
16
|
rt.versions.add(version);
|
|
10
|
-
if (rt.versions.size > 1 && !rt.warned &&
|
|
17
|
+
if (rt.versions.size > 1 && !rt.warned && isDevelopment()) {
|
|
11
18
|
rt.warned = true;
|
|
12
19
|
console.warn(
|
|
13
20
|
`nish-ui: two versions are loaded on this page (${[...rt.versions].join(", ")}). Overlays, toasts and theme state are shared, but mixing versions is unsupported.`
|
|
@@ -73,7 +80,24 @@ function nf(locale, min, max) {
|
|
|
73
80
|
() => new Intl.NumberFormat(locale, { minimumFractionDigits: min, maximumFractionDigits: max })
|
|
74
81
|
);
|
|
75
82
|
}
|
|
76
|
-
|
|
83
|
+
var zoneOk = /* @__PURE__ */ new Map();
|
|
84
|
+
function safeZone(timeZone) {
|
|
85
|
+
if (!timeZone) return void 0;
|
|
86
|
+
let ok = zoneOk.get(timeZone);
|
|
87
|
+
if (ok === void 0) {
|
|
88
|
+
try {
|
|
89
|
+
new Intl.DateTimeFormat("en-US", { timeZone });
|
|
90
|
+
ok = true;
|
|
91
|
+
} catch {
|
|
92
|
+
ok = false;
|
|
93
|
+
}
|
|
94
|
+
if (zoneOk.size >= 64) zoneOk.clear();
|
|
95
|
+
zoneOk.set(timeZone, ok);
|
|
96
|
+
}
|
|
97
|
+
return ok ? timeZone : void 0;
|
|
98
|
+
}
|
|
99
|
+
function dtf(locale, key, options, zone2) {
|
|
100
|
+
const timeZone = safeZone(zone2);
|
|
77
101
|
return cached(
|
|
78
102
|
`d|${locale}|${key}|${timeZone ?? ""}`,
|
|
79
103
|
() => new Intl.DateTimeFormat(locale, timeZone ? { ...options, timeZone } : options)
|
|
@@ -106,32 +130,35 @@ function compactAbs(abs, digits, locale) {
|
|
|
106
130
|
function isZeroAfterRounding(v, digits) {
|
|
107
131
|
return Number(Math.abs(v).toFixed(digits)) === 0;
|
|
108
132
|
}
|
|
109
|
-
var
|
|
110
|
-
function
|
|
133
|
+
var currencies = /* @__PURE__ */ new Map();
|
|
134
|
+
function currencyInfo(currency, locale) {
|
|
111
135
|
const key = `${locale}|${currency}`;
|
|
112
|
-
let
|
|
113
|
-
if (
|
|
136
|
+
let info = currencies.get(key);
|
|
137
|
+
if (info === void 0) {
|
|
114
138
|
try {
|
|
115
|
-
const
|
|
139
|
+
const nf2 = new Intl.NumberFormat(locale, {
|
|
116
140
|
style: "currency",
|
|
117
141
|
currency,
|
|
118
142
|
currencyDisplay: "narrowSymbol"
|
|
119
|
-
})
|
|
120
|
-
s =
|
|
143
|
+
});
|
|
144
|
+
let s = nf2.formatToParts(0).find((p) => p.type === "currency")?.value ?? currency;
|
|
145
|
+
if (/\p{L}$/u.test(s)) s += "\xA0";
|
|
146
|
+
info = { symbol: s, digits: nf2.resolvedOptions().maximumFractionDigits ?? 2 };
|
|
121
147
|
} catch {
|
|
122
|
-
|
|
148
|
+
info = { symbol: currency + " ", digits: 2 };
|
|
123
149
|
}
|
|
124
|
-
|
|
150
|
+
currencies.set(key, info);
|
|
125
151
|
}
|
|
126
|
-
return
|
|
152
|
+
return info;
|
|
127
153
|
}
|
|
128
154
|
function moneyAbs(abs, o, locale) {
|
|
129
|
-
const symbol =
|
|
155
|
+
const { symbol, digits } = currencyInfo(o.currency ?? "USD", locale);
|
|
130
156
|
if (o.compact && abs >= 1e3) return symbol + compactAbs(abs, 1, locale);
|
|
131
157
|
const cents = o.cents ?? "auto";
|
|
132
|
-
const
|
|
133
|
-
const
|
|
134
|
-
|
|
158
|
+
const unit = 10 ** digits;
|
|
159
|
+
const hasCents = Math.round(abs * unit) % unit !== 0;
|
|
160
|
+
const showCents = digits > 0 && (cents === "always" || cents === "auto" && (abs < 1e3 || hasCents));
|
|
161
|
+
return symbol + (showCents ? fixed(abs, digits, digits, locale) : fixed(abs, 0, 0, locale));
|
|
135
162
|
}
|
|
136
163
|
function money(v, o = {}) {
|
|
137
164
|
if (!finite(v)) return DASH;
|
|
@@ -255,7 +282,12 @@ function ago(t, o = {}) {
|
|
|
255
282
|
if (abs < 45) return english ? "just now" : rtf(locale, long ? "long" : "narrow").format(0, "second");
|
|
256
283
|
let pick = AGO_UNITS[0];
|
|
257
284
|
for (const u of AGO_UNITS) if (abs >= u[0]) pick = u;
|
|
258
|
-
|
|
285
|
+
let n = Math.max(1, Math.round(abs / pick[0]));
|
|
286
|
+
const next = AGO_UNITS[AGO_UNITS.indexOf(pick) + 1];
|
|
287
|
+
if (next && (n * pick[0] >= next[0] || pick[1] === "month" && n >= 12)) {
|
|
288
|
+
pick = next;
|
|
289
|
+
n = Math.max(1, Math.round(abs / pick[0]));
|
|
290
|
+
}
|
|
259
291
|
const past = diff < 0;
|
|
260
292
|
if (!english) return rtf(locale, long ? "long" : "narrow").format(past ? -n : n, pick[1]);
|
|
261
293
|
if (long) return rtf(locale, "long").format(past ? -n : n, pick[1]);
|
|
@@ -344,4 +376,3 @@ export {
|
|
|
344
376
|
signedMoney,
|
|
345
377
|
time
|
|
346
378
|
};
|
|
347
|
-
//# sourceMappingURL=format.js.map
|
package/dist/inbox-client.d.ts
CHANGED
|
@@ -69,7 +69,11 @@ interface InboxEventInput {
|
|
|
69
69
|
resolve?: boolean;
|
|
70
70
|
/** ISO 8601 time the event happened. Defaults to now; future times are clamped to now. */
|
|
71
71
|
occurredAt?: string;
|
|
72
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* Flat extra data, JSON-encoded at most 4096 bytes. Only data.actionToken (ACTION_TOKEN_FIELD) is private
|
|
74
|
+
* (stripped before the browser and /api/v1 see the item); every other key is visible in the inbox UI and API.
|
|
75
|
+
* /ingest trusts every local caller, so action routes must verify actionToken (actionTokenMatches) on every call.
|
|
76
|
+
*/
|
|
73
77
|
data?: InboxData;
|
|
74
78
|
/** Up to 3 buttons shown on the item, ids unique. A repeat with the same dedupeKey replaces them. */
|
|
75
79
|
actions?: Array<Omit<InboxAction, 'method'> & {
|
package/dist/inbox-client.js
CHANGED
|
@@ -283,7 +283,7 @@ function createInboxClient(options) {
|
|
|
283
283
|
if (disabled) return { ok: false, error: "disabled", queued: false };
|
|
284
284
|
if (queue.length > 0) {
|
|
285
285
|
enqueue(parsed.value);
|
|
286
|
-
void flush();
|
|
286
|
+
if (timer === null) void flush();
|
|
287
287
|
return { ok: false, error: "queued behind earlier events", queued: true };
|
|
288
288
|
}
|
|
289
289
|
const result = await attempt(parsed.value);
|
|
@@ -317,4 +317,3 @@ export {
|
|
|
317
317
|
isInboxActionTarget,
|
|
318
318
|
parseInboxEvent
|
|
319
319
|
};
|
|
320
|
-
//# sourceMappingURL=inbox-client.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -11,9 +11,8 @@ declare const VERSION: string;
|
|
|
11
11
|
/** href for user-supplied links: relative URLs, #fragments, http(s), mailto and tel pass;
|
|
12
12
|
* anything else (javascript:, data:, vbscript:, file:) returns null. Trims leading and trailing
|
|
13
13
|
* C0 controls and spaces and drops tabs and newlines the way the WHATWG URL parser does, then
|
|
14
|
-
* reads the scheme from the very string that is returned.
|
|
15
|
-
* U+2028, U+3000) is
|
|
16
|
-
* not a scheme there either. */
|
|
14
|
+
* reads the scheme from the very string that is returned. A URL with leading or trailing
|
|
15
|
+
* non-C0 Unicode whitespace (NBSP, U+FEFF, U+2028, U+3000) is refused (null). */
|
|
17
16
|
declare function safeUrl(href: string | null | undefined): string | null;
|
|
18
17
|
|
|
19
18
|
type Scheme = 'dark' | 'light';
|
|
@@ -241,6 +240,20 @@ interface NishStrings {
|
|
|
241
240
|
offlineBadge: string;
|
|
242
241
|
/** FlowSteps: group label. */
|
|
243
242
|
progress: string;
|
|
243
|
+
/** AgentNode: spoken state word. */
|
|
244
|
+
agentQueued: string;
|
|
245
|
+
/** AgentNode: spoken state word. */
|
|
246
|
+
agentRunning: string;
|
|
247
|
+
/** AgentNode: spoken state word. */
|
|
248
|
+
agentDone: string;
|
|
249
|
+
/** AgentNode: spoken state word. */
|
|
250
|
+
agentFailed: string;
|
|
251
|
+
/** FlowSteps: hidden text appended to a finished step. */
|
|
252
|
+
stepDone: string;
|
|
253
|
+
/** FlowSteps: hidden text appended to a failed step. */
|
|
254
|
+
stepFailed: string;
|
|
255
|
+
/** ResponsiveTable: label of the sort-direction button, from the current direction. */
|
|
256
|
+
sortToggle: (dir: 'asc' | 'desc' | null) => string;
|
|
244
257
|
/** WorkflowBoard: group label. */
|
|
245
258
|
workflow: string;
|
|
246
259
|
/** ActivityFeed: group label. */
|
|
@@ -311,6 +324,8 @@ interface NishStrings {
|
|
|
311
324
|
breadcrumbs: string;
|
|
312
325
|
/** TagInput: remove button aria label. */
|
|
313
326
|
removeTag: (tag: string) => string;
|
|
327
|
+
/** TagInput: shown when a tag is refused because the limit is reached. */
|
|
328
|
+
maxTags: (max: number) => string;
|
|
314
329
|
/** FileDropzone: drop area text. */
|
|
315
330
|
dropzoneLabel: string;
|
|
316
331
|
/** FileDropzone: browse button. */
|
|
@@ -500,8 +515,10 @@ interface MountScrollspyOptions {
|
|
|
500
515
|
* has passed the offset, the first one at the top of the page), is scrolled into view
|
|
501
516
|
* inside the nav, and the nav gets `data-at-start` / `data-at-end` for its edge fades.
|
|
502
517
|
* Publishes the nav's height as `--nish-sticky-extra` so `.nish-scroll-target` clears it.
|
|
503
|
-
* Returns a function that removes everything. */
|
|
504
|
-
declare function mountScrollspy(nav: HTMLElement, o?: MountScrollspyOptions): () => void
|
|
518
|
+
* Returns a function that removes everything; its `lock(id)` keeps that section's link current until the user scrolls. */
|
|
519
|
+
declare function mountScrollspy(nav: HTMLElement, o?: MountScrollspyOptions): (() => void) & {
|
|
520
|
+
lock: (id: string) => void;
|
|
521
|
+
};
|
|
505
522
|
/** Persist a checklist: the `input[type=checkbox]` inside each `li[data-id]` of `list` is
|
|
506
523
|
* saved to localStorage under `list.dataset.store` (a JSON array of checked ids) and
|
|
507
524
|
* restored now. Updates the `.nish-checklist-progress` element before the list (or the
|
|
@@ -3388,7 +3405,9 @@ interface AppShellSidebar {
|
|
|
3388
3405
|
* "nish-sidebar-collapsed"; false keeps it in memory only. */
|
|
3389
3406
|
storageKey?: string | false;
|
|
3390
3407
|
/** Buttons above the nav (search, an assistant). Give them labels: collapsed, they stack as
|
|
3391
|
-
* icons. Below 1024px, where there is no sidebar, they show in the header before `actions`.
|
|
3408
|
+
* icons. Below 1024px, where there is no sidebar, they show in the header before `actions`.
|
|
3409
|
+
* Both copies stay mounted and CSS shows one, so they must not hold a global key listener, a fixed id or
|
|
3410
|
+
* open state of their own (put those in the app and pass plain buttons). */
|
|
3392
3411
|
tools?: ReactNode;
|
|
3393
3412
|
/** Next to the collapse button at the bottom. Sidebar only: put anything people need on a
|
|
3394
3413
|
* phone in `actions` or `moreItems` too. */
|
|
@@ -3423,7 +3442,8 @@ interface AppShellProps {
|
|
|
3423
3442
|
navLabel?: string;
|
|
3424
3443
|
/** id of the `main` element and target of the skip link. Default "nish-main"; give each shell on a page its own. */
|
|
3425
3444
|
mainId?: string;
|
|
3426
|
-
/** Header buttons before the theme toggle.
|
|
3445
|
+
/** Header buttons before the theme toggle. With a `brand` sidebar they are also shown in the sidebar's tools, so
|
|
3446
|
+
* the same rule applies: two copies are mounted, only one is visible. */
|
|
3427
3447
|
actions?: ReactNode;
|
|
3428
3448
|
/** Replaces the header's ThemeToggle; false hides it. */
|
|
3429
3449
|
themeToggle?: ReactNode | false;
|
|
@@ -3518,7 +3538,7 @@ interface ApiConfig {
|
|
|
3518
3538
|
* request URL; never called for a same-origin URL, which always gets them. */
|
|
3519
3539
|
headersFor?: (url: string) => boolean;
|
|
3520
3540
|
}
|
|
3521
|
-
/** Merges into the
|
|
3541
|
+
/** Merges into the page-wide config used by every apiFetch call. */
|
|
3522
3542
|
declare function configureApi(c: ApiConfig): void;
|
|
3523
3543
|
/** fetch with JSON in and out, a timeout, and a typed ApiError for every failure. */
|
|
3524
3544
|
declare function apiFetch<T = unknown>(path: string, o?: ApiFetchOptions): Promise<T>;
|
|
@@ -3623,7 +3643,11 @@ interface FilterBarProps extends Omit<ComponentPropsWithRef<'div'>, 'children'>
|
|
|
3623
3643
|
className?: string;
|
|
3624
3644
|
}
|
|
3625
3645
|
/** The search and filter row of a list page. From md up the controls sit inline; below md
|
|
3626
|
-
* they move into a bottom sheet behind a Filters button that shows how many are on.
|
|
3646
|
+
* they move into a bottom sheet behind a Filters button that shows how many are on.
|
|
3647
|
+
*
|
|
3648
|
+
* Server rendering: the media query is false on the server, so FilterBar first paints the inline
|
|
3649
|
+
* row and collapses to the Filters button after hydration. To avoid that flash on phones, render
|
|
3650
|
+
* it only on the client (behind a mounted check, or a dynamic import with ssr: false). */
|
|
3627
3651
|
declare function FilterBar({ search, children, activeCount, onClear, trailing, sticky, sheetTitle, sheetBelow, summary, className, ref, ...rest }: FilterBarProps): react.JSX.Element;
|
|
3628
3652
|
|
|
3629
3653
|
/** Where useUrlState reads and writes the query string. */
|
|
@@ -3976,7 +4000,8 @@ interface TimeFieldProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'
|
|
|
3976
4000
|
defaultValue?: string | null;
|
|
3977
4001
|
/** Called with HH:mm when both boxes hold a valid time inside min and max, or null when both are emptied. */
|
|
3978
4002
|
onValueChange?: (value: string | null) => void;
|
|
3979
|
-
/** Earliest allowed time (HH:mm). An earlier time marks the field invalid and is not reported.
|
|
4003
|
+
/** Earliest allowed time (HH:mm). An earlier time marks the field invalid and is not reported. A min after max is a
|
|
4004
|
+
* range that wraps past midnight (22:00 to 06:00), as on `<input type="time">`. */
|
|
3980
4005
|
min?: string;
|
|
3981
4006
|
/** Latest allowed time (HH:mm). */
|
|
3982
4007
|
max?: string;
|
|
@@ -4742,11 +4767,14 @@ interface AvatarProps extends Omit<ComponentPropsWithoutRef<'span'>, 'children'>
|
|
|
4742
4767
|
shape?: AvatarShape;
|
|
4743
4768
|
/** A status dot at the bottom corner. Give it text elsewhere; color is never the only signal. */
|
|
4744
4769
|
status?: StatusTone;
|
|
4770
|
+
/** What a screen reader hears for the status dot (for example "Online"). Without it the dot is hidden from
|
|
4771
|
+
* assistive tech; it is always hidden when `alt=""`. */
|
|
4772
|
+
statusLabel?: string;
|
|
4745
4773
|
/** The root element. */
|
|
4746
4774
|
ref?: Ref<HTMLSpanElement>;
|
|
4747
4775
|
}
|
|
4748
4776
|
/** A person or entity: their image, or initials on a color taken from their name. */
|
|
4749
|
-
declare function Avatar({ src, name, alt, size, shape, status, className, ref, ...rest }: AvatarProps): react.JSX.Element;
|
|
4777
|
+
declare function Avatar({ src, name, alt, size, shape, status, statusLabel, className, ref, ...rest }: AvatarProps): react.JSX.Element;
|
|
4750
4778
|
interface AvatarGroupProps extends ComponentPropsWithoutRef<'div'> {
|
|
4751
4779
|
/** Avatars shown before the "+N" overflow badge. Default: all. */
|
|
4752
4780
|
max?: number;
|
package/dist/nish-components.css
CHANGED
|
@@ -1013,7 +1013,7 @@
|
|
|
1013
1013
|
:where(.nish-stats--4) {
|
|
1014
1014
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
1015
1015
|
}
|
|
1016
|
-
@media (min-width:
|
|
1016
|
+
@media (min-width: 768px) {
|
|
1017
1017
|
:where(.nish-stats--4) {
|
|
1018
1018
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
1019
1019
|
}
|
|
@@ -1695,7 +1695,8 @@
|
|
|
1695
1695
|
<div class="nish-skeleton nish-skeleton--thumb"></div>
|
|
1696
1696
|
<div class="nish-skeleton nish-skeleton--card"></div>
|
|
1697
1697
|
</div>
|
|
1698
|
-
The group
|
|
1698
|
+
The group needs role="status" and visually hidden "Loading" text to be announced (aria-busy alone says nothing):
|
|
1699
|
+
set aria-busy="false" (or remove the group) once loaded. */
|
|
1699
1700
|
:where(.nish-skeleton) {
|
|
1700
1701
|
display: block;
|
|
1701
1702
|
border-radius: var(--nish-radius-sm);
|
|
@@ -3313,6 +3314,14 @@
|
|
|
3313
3314
|
}
|
|
3314
3315
|
:where(.nish-btn--link) {
|
|
3315
3316
|
min-height: 0;
|
|
3317
|
+
position: relative;
|
|
3318
|
+
}
|
|
3319
|
+
/* The same invisible hit area as the React link Button (LINK_HIT): a 16px line grows 14px per side to 44px without moving the layout. */
|
|
3320
|
+
:where(.nish-btn--link)::after {
|
|
3321
|
+
content: '';
|
|
3322
|
+
position: absolute;
|
|
3323
|
+
inset-inline: -0.5rem;
|
|
3324
|
+
inset-block: -0.875rem;
|
|
3316
3325
|
}
|
|
3317
3326
|
/* Grown to 44px without growing the toast (the React toast's negative margins). */
|
|
3318
3327
|
:where(.nish-toast-action) {
|
|
@@ -3462,6 +3471,10 @@
|
|
|
3462
3471
|
z-index: 10;
|
|
3463
3472
|
background: inherit;
|
|
3464
3473
|
}
|
|
3474
|
+
/* The pinned corner sits above the pinned body column it would otherwise tie with. */
|
|
3475
|
+
:where(.nish-table-wrap--sticky-first) :where(thead tr > :first-child) {
|
|
3476
|
+
z-index: 11;
|
|
3477
|
+
}
|
|
3465
3478
|
:where(.nish-table-wrap--sticky-first) :where(tr > :first-child)::after {
|
|
3466
3479
|
content: '';
|
|
3467
3480
|
position: absolute;
|
|
@@ -3474,7 +3487,8 @@
|
|
|
3474
3487
|
transition: opacity 150ms;
|
|
3475
3488
|
pointer-events: none;
|
|
3476
3489
|
}
|
|
3477
|
-
:where(.nish-table-wrap--sticky-first[data-at-start='false']) :where(tr > :first-child)::after
|
|
3490
|
+
:where(.nish-table-wrap--sticky-first[data-at-start='false']:not(:dir(rtl))) :where(tr > :first-child)::after,
|
|
3491
|
+
:where(.nish-table-wrap--sticky-first[data-at-end='false']:dir(rtl)) :where(tr > :first-child)::after {
|
|
3478
3492
|
opacity: 1;
|
|
3479
3493
|
}
|
|
3480
3494
|
:where(.nish-table--zebra) :where(tbody tr:nth-child(even)) {
|
|
@@ -4764,8 +4778,23 @@
|
|
|
4764
4778
|
}
|
|
4765
4779
|
:where(.nish-tab[aria-selected='true'], .nish-tab[aria-current]:not([aria-current='false'])) {
|
|
4766
4780
|
border-bottom-color: Highlight;
|
|
4781
|
+
}
|
|
4782
|
+
:where(.nish-tab[aria-selected='true']:not(:focus-visible), .nish-tab[aria-current]:not([aria-current='false']):not(:focus-visible)) {
|
|
4767
4783
|
outline: 0;
|
|
4768
4784
|
}
|
|
4785
|
+
:where(.nish-tab:focus-visible) {
|
|
4786
|
+
outline: 2px solid Highlight;
|
|
4787
|
+
outline-offset: -2px;
|
|
4788
|
+
}
|
|
4789
|
+
/* Focus drawn only with a shadow or a fill is dropped here: use a real outline. */
|
|
4790
|
+
:where(.nish-chart svg[role='img']:focus-visible, .nish-split-divider:focus-visible) {
|
|
4791
|
+
outline: 2px solid Highlight;
|
|
4792
|
+
outline-offset: 2px;
|
|
4793
|
+
}
|
|
4794
|
+
:where(.nish-split-divider:hover, .nish-split-divider:focus-visible, .nish-split-divider:active, .nish-split-divider[data-dragging]) {
|
|
4795
|
+
forced-color-adjust: none;
|
|
4796
|
+
background: Highlight;
|
|
4797
|
+
}
|
|
4769
4798
|
:where(.nish-tabs--pill .nish-tab[aria-selected='true'], .nish-tabs--pill .nish-tab[aria-current]:not([aria-current='false'])) {
|
|
4770
4799
|
forced-color-adjust: none;
|
|
4771
4800
|
background: Highlight;
|
|
@@ -4806,4 +4835,24 @@
|
|
|
4806
4835
|
display: none !important;
|
|
4807
4836
|
}
|
|
4808
4837
|
}
|
|
4838
|
+
|
|
4839
|
+
/* Chip rows scroll sideways on a phone instead of wrapping (UI-070). */
|
|
4840
|
+
@media (max-width: 639.98px) {
|
|
4841
|
+
:where(.nish-chips--scroll) {
|
|
4842
|
+
flex-wrap: nowrap;
|
|
4843
|
+
overflow-x: auto;
|
|
4844
|
+
padding-block: 4px;
|
|
4845
|
+
scrollbar-width: none;
|
|
4846
|
+
}
|
|
4847
|
+
:where(.nish-chips--scroll)::-webkit-scrollbar {
|
|
4848
|
+
display: none;
|
|
4849
|
+
}
|
|
4850
|
+
}
|
|
4851
|
+
|
|
4852
|
+
/* Hide the browser's own clear button on search inputs; the component has its own (UI-075). */
|
|
4853
|
+
:where(.nish-search) > :where(input)::-webkit-search-cancel-button,
|
|
4854
|
+
:where(.nish-search) > :where(input)::-webkit-search-decoration {
|
|
4855
|
+
-webkit-appearance: none;
|
|
4856
|
+
appearance: none;
|
|
4857
|
+
}
|
|
4809
4858
|
}
|