nish-ui 3.2.0 → 3.3.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 +7 -3
- package/dist/base-tailwind.css +30 -15
- package/dist/base.css +30 -15
- package/dist/elements-all.js +78 -78
- package/dist/elements-charts.js +39 -38
- package/dist/elements-data.d.ts +10 -0
- package/dist/elements-data.js +4 -5
- package/dist/elements-forms.js +5 -5
- package/dist/elements.d.ts +1 -0
- package/dist/elements.js +4 -4
- package/dist/esm/command-filter.js +55 -4
- package/dist/esm/components/accordion.js +3 -2
- package/dist/esm/components/app-shell.js +8 -4
- package/dist/esm/components/breadcrumbs.js +7 -3
- package/dist/esm/components/calendar-base.js +32 -5
- package/dist/esm/components/calendar-classes.js +14 -2
- package/dist/esm/components/canvas/follow-caption.js +31 -21
- package/dist/esm/components/canvas/follow.js +5 -6
- package/dist/esm/components/canvas/minimap.js +3 -3
- package/dist/esm/components/canvas/system-canvas.js +3 -1
- package/dist/esm/components/canvas/view.js +0 -2
- package/dist/esm/components/carousel.js +2 -3
- package/dist/esm/components/charts.js +18 -7
- package/dist/esm/components/combobox.js +18 -7
- package/dist/esm/components/command.js +23 -61
- package/dist/esm/components/context-menu.js +2 -1
- package/dist/esm/components/data-classes.js +5 -4
- package/dist/esm/components/data.js +19 -10
- package/dist/esm/components/display.js +20 -11
- package/dist/esm/components/drawer.js +17 -4
- package/dist/esm/components/error-boundary.js +3 -3
- package/dist/esm/components/feedback.js +3 -3
- package/dist/esm/components/file-dropzone.js +16 -6
- package/dist/esm/components/filters.js +42 -1
- package/dist/esm/components/flow.js +8 -5
- package/dist/esm/components/forms-classes.js +2 -0
- package/dist/esm/components/forms.js +2 -2
- package/dist/esm/components/hooks.js +47 -13
- package/dist/esm/components/hover-card.js +2 -1
- package/dist/esm/components/inbox.js +5 -1
- package/dist/esm/components/latest.js +4 -2
- package/dist/esm/components/layout.js +7 -4
- package/dist/esm/components/menu.js +10 -1
- package/dist/esm/components/modal.js +17 -4
- package/dist/esm/components/multi-select.js +5 -5
- package/dist/esm/components/nav.js +30 -11
- package/dist/esm/components/navigate.js +1 -1
- package/dist/esm/components/overlay-dialog.js +35 -1
- package/dist/esm/components/pagination.js +1 -1
- package/dist/esm/components/primitives.js +17 -4
- package/dist/esm/components/progress.js +2 -1
- package/dist/esm/components/resource.js +14 -4
- package/dist/esm/components/segmented.js +2 -0
- package/dist/esm/components/separator.js +6 -1
- package/dist/esm/components/service-tokens.js +18 -7
- package/dist/esm/components/settings.js +16 -0
- package/dist/esm/components/slider.js +5 -1
- package/dist/esm/components/split.js +4 -2
- package/dist/esm/components/strings.js +17 -4
- package/dist/esm/components/table.js +15 -3
- package/dist/esm/components/tag-input.js +5 -1
- package/dist/esm/components/time-field.js +15 -7
- package/dist/esm/components/toast-card.js +5 -3
- package/dist/esm/components/toast.js +4 -1
- package/dist/esm/components/tooltip.js +3 -2
- package/dist/esm/components/url-state.js +3 -1
- package/dist/esm/components/virtual-table.js +2 -2
- package/dist/esm/components/virtual.js +8 -4
- package/dist/esm/format.js +3 -2
- package/dist/esm/runtime.js +1 -1
- package/dist/esm/server/inbox/client.js +4 -0
- package/dist/esm/theme.js +38 -15
- package/dist/esm/tokens.mjs +1 -1
- package/dist/format.d.ts +5 -3
- package/dist/format.js +4 -3
- package/dist/inbox-client.d.ts +1 -1
- package/dist/inbox-client.js +4 -0
- package/dist/index.d.ts +61 -29
- package/dist/nish-components.css +59 -21
- package/dist/nish-components.min.css +1 -1
- package/dist/nish.css +30 -15
- package/dist/nish.min.css +1 -1
- package/dist/node/vite.js +1 -1
- package/dist/server/hono.d.ts +9 -2
- package/dist/server/hono.js +17 -4
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +7 -2
- package/dist/service-tokens.d.ts +4 -4
- package/dist/{spa-BfRDo38r.d.ts → spa-FwS7yZ8p.d.ts} +4 -3
- package/dist/system-canvas.d.ts +11 -10
- package/dist/theme.d.ts +30 -2
- package/dist/theme.global.js +45 -18
- package/dist/theme.js +45 -18
- package/package.json +3 -2
- package/dist/tokens.js +0 -425
package/dist/index.d.ts
CHANGED
|
@@ -44,6 +44,8 @@ interface NishStrings {
|
|
|
44
44
|
back: string;
|
|
45
45
|
/** ContextMenu: the menu's accessible name when no menuLabel is given. */
|
|
46
46
|
contextMenu: string;
|
|
47
|
+
/** CommandPalette: accessible name of the external-link mark on a row that opens in a new tab. */
|
|
48
|
+
opensInNewTab: string;
|
|
47
49
|
/** VirtualTable: live-region message after the sort changes (dir null when cleared). */
|
|
48
50
|
sortAnnounce: (header: string, dir: 'asc' | 'desc' | null) => string;
|
|
49
51
|
/** Toast, Callout: dismiss button. */
|
|
@@ -54,6 +56,8 @@ interface NishStrings {
|
|
|
54
56
|
copy: string;
|
|
55
57
|
/** CopyButton: label after copying. */
|
|
56
58
|
copied: string;
|
|
59
|
+
/** CopyButton: label when copying failed. */
|
|
60
|
+
copyFailed: string;
|
|
57
61
|
/** AppHeader: hub pill title. */
|
|
58
62
|
hubTitle: string;
|
|
59
63
|
/** AppHeader: hub pill text. */
|
|
@@ -76,6 +80,8 @@ interface NishStrings {
|
|
|
76
80
|
removeNamed: (name: string) => string;
|
|
77
81
|
/** Combobox, CommandPalette: empty list. */
|
|
78
82
|
noMatches: string;
|
|
83
|
+
/** Combobox, MultiSelect, CommandPalette: polite announcement of how many results are showing. */
|
|
84
|
+
resultsCount: (count: number) => string;
|
|
79
85
|
/** Combobox, FilterBar, FilterSheet: clear button. */
|
|
80
86
|
clear: string;
|
|
81
87
|
/** Combobox: loading row. */
|
|
@@ -160,6 +166,8 @@ interface NishStrings {
|
|
|
160
166
|
actions: string;
|
|
161
167
|
/** ConnectionBanner: offline message. */
|
|
162
168
|
offline: string;
|
|
169
|
+
/** ConnectionBanner: default message when the server probe fails. */
|
|
170
|
+
serverUnreachable: string;
|
|
163
171
|
/** ResponsiveTable, AsyncPanel: empty state. */
|
|
164
172
|
nothingHere: string;
|
|
165
173
|
/** ResponsiveTable: skeleton label. */
|
|
@@ -172,6 +180,10 @@ interface NishStrings {
|
|
|
172
180
|
noData: string;
|
|
173
181
|
/** LineChart, BarChart: aria label of an empty chart. */
|
|
174
182
|
noDataNamed: (label: string) => string;
|
|
183
|
+
/** RangeBar: default accessible name, with locale-formatted numbers (current is null when not set). */
|
|
184
|
+
rangeLabel: (low: string, high: string, current: string | null, min: string, max: string) => string;
|
|
185
|
+
/** LineChart: last row of the hidden data table when it was cut short. */
|
|
186
|
+
chartTruncated: (shown: number, total: number) => string;
|
|
175
187
|
/** FilterBar, FilterSheet: title. */
|
|
176
188
|
filters: string;
|
|
177
189
|
/** FilterBar: clear all filters. */
|
|
@@ -184,6 +196,8 @@ interface NishStrings {
|
|
|
184
196
|
newCount: (value: string | number) => string;
|
|
185
197
|
/** BottomNav, NavRail, SectionNav: landmark. */
|
|
186
198
|
sections: string;
|
|
199
|
+
/** SectionNav: default landmark name. */
|
|
200
|
+
onThisPage: string;
|
|
187
201
|
/** MoreSheet: theme row. */
|
|
188
202
|
theme: string;
|
|
189
203
|
/** NavRail: sidebar landmark. */
|
|
@@ -276,6 +290,8 @@ interface NishStrings {
|
|
|
276
290
|
followActivity: string;
|
|
277
291
|
/** SystemCanvas legend: menu label. */
|
|
278
292
|
canvasLines: string;
|
|
293
|
+
/** SystemCanvas: role description of the canvas region. */
|
|
294
|
+
canvasRole: string;
|
|
279
295
|
/** ServiceTokens: title. */
|
|
280
296
|
serviceTokens: string;
|
|
281
297
|
/** ServiceTokens: intro text. */
|
|
@@ -294,6 +310,14 @@ interface NishStrings {
|
|
|
294
310
|
tokenRevokeTitle: (name: string) => string;
|
|
295
311
|
/** ServiceTokens: revoke failure with no message. */
|
|
296
312
|
tokenRevokeFailed: string;
|
|
313
|
+
/** ServiceTokens: empty-list message. */
|
|
314
|
+
tokenEmpty: string;
|
|
315
|
+
/** ServiceTokens: body of the revoke confirm dialog. */
|
|
316
|
+
tokenRevokeBody: string;
|
|
317
|
+
/** ServiceTokens: created-at text on a row. */
|
|
318
|
+
tokenCreated: (when: string) => string;
|
|
319
|
+
/** ServiceTokens: source tag for a token that comes from the SERVICE_TOKENS environment variable. */
|
|
320
|
+
tokenFromEnv: string;
|
|
297
321
|
/** Inbox: mark-handled action. */
|
|
298
322
|
inboxMarkHandled: string;
|
|
299
323
|
/** Inbox: snooze action. */
|
|
@@ -318,6 +342,8 @@ interface NishStrings {
|
|
|
318
342
|
nextPage: string;
|
|
319
343
|
/** Pagination: page button aria label. */
|
|
320
344
|
pageLabel: (n: number) => string;
|
|
345
|
+
/** Pagination: compact text, for example "Page 3 of 10". */
|
|
346
|
+
pageOfCount: (page: number, count: number) => string;
|
|
321
347
|
/** Pagination: nav landmark. */
|
|
322
348
|
paginationLabel: string;
|
|
323
349
|
/** Breadcrumbs: nav landmark. */
|
|
@@ -524,8 +550,10 @@ declare function mountScrollspy(nav: HTMLElement, o?: MountScrollspyOptions): ((
|
|
|
524
550
|
* restored now. Updates the `.nish-checklist-progress` element before the list (or the
|
|
525
551
|
* first one in its parent) to "{done} of {total}" and its `--p` meter. Without
|
|
526
552
|
* `data-store` it still counts. Storage failures are ignored. Returns a function that
|
|
527
|
-
* removes the listener. */
|
|
528
|
-
declare function mountChecklist(list: HTMLElement
|
|
553
|
+
* removes the listener. Pass `format` for another language than "{done} of {total}". */
|
|
554
|
+
declare function mountChecklist(list: HTMLElement, opts?: {
|
|
555
|
+
format?: (done: number, total: number) => string;
|
|
556
|
+
}): () => void;
|
|
529
557
|
/** For pages without a framework: apply now and start syncing. */
|
|
530
558
|
declare function initTheme(): ThemeName;
|
|
531
559
|
|
|
@@ -695,7 +723,7 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
695
723
|
size?: ButtonSize;
|
|
696
724
|
/** Link variant only: skip the 44px touch hit area, for a link inside running text. */
|
|
697
725
|
inline?: boolean;
|
|
698
|
-
/** Shows a spinner,
|
|
726
|
+
/** Shows a spinner, blocks clicks and form submit, and sets aria-busy. The button stays focusable (aria-disabled, not the native disabled attribute), so keyboard focus survives the action. */
|
|
699
727
|
loading?: boolean;
|
|
700
728
|
/** Icon before the label (16px for md and lg, 12–14px for xs and sm). Replaced by the
|
|
701
729
|
* spinner while loading. */
|
|
@@ -766,13 +794,15 @@ interface CardProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
|
766
794
|
/** Renders a CardHeader first. On an unpadded card the header is divided (its own
|
|
767
795
|
* padding and a bottom border). */
|
|
768
796
|
title?: ReactNode;
|
|
797
|
+
/** The title's heading level; only with title. Default "h2". */
|
|
798
|
+
titleAs?: 'h2' | 'h3' | 'h4';
|
|
769
799
|
/** The header's description; only with title. */
|
|
770
800
|
description?: ReactNode;
|
|
771
801
|
/** The header's end-aligned action slot; only with title. */
|
|
772
802
|
action?: ReactNode;
|
|
773
803
|
}
|
|
774
804
|
/** The surface panel every widget, table and form sits in. */
|
|
775
|
-
declare function Card({ as, padding, padded, interactive, variant, title, description, action, className, children, ref, ...rest }: CardProps): react.JSX.Element;
|
|
805
|
+
declare function Card({ as, padding, padded, interactive, variant, title, titleAs, description, action, className, children, ref, ...rest }: CardProps): react.JSX.Element;
|
|
776
806
|
interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
777
807
|
/** The badge element. */
|
|
778
808
|
ref?: Ref<HTMLSpanElement>;
|
|
@@ -1914,7 +1944,7 @@ interface CopyButtonProps extends Omit<ComponentPropsWithoutRef<'button'>, 'onCo
|
|
|
1914
1944
|
/** Shown for 1.5s after a copy and announced politely. Default: the provider's `copied` string. */
|
|
1915
1945
|
copiedLabel?: string;
|
|
1916
1946
|
/** Shown for 1.5s when neither the Clipboard API nor the textarea fallback worked, and
|
|
1917
|
-
* announced politely. Default "Copy failed". */
|
|
1947
|
+
* announced politely. Default: the provider's `copyFailed` string ("Copy failed"). */
|
|
1918
1948
|
failedLabel?: string;
|
|
1919
1949
|
/** A square IconButton instead of a labelled Button. */
|
|
1920
1950
|
iconOnly?: boolean;
|
|
@@ -2486,7 +2516,7 @@ interface VirtualTableProps<T> extends Omit<ComponentPropsWithoutRef<'div'>, 'ch
|
|
|
2486
2516
|
onRowClick?: (row: T, index: number) => void;
|
|
2487
2517
|
/** A 3px edge at the start of a row: ok, warn or loss. Say the status in a cell too. */
|
|
2488
2518
|
rowTone?: (row: T) => 'ok' | 'warn' | 'loss' | undefined;
|
|
2489
|
-
/** Shows skeleton
|
|
2519
|
+
/** Shows a skeleton block (224px tall) instead of the data. */
|
|
2490
2520
|
loading?: boolean;
|
|
2491
2521
|
/** Shown when there are no rows. Default: the "nothingHere" string. */
|
|
2492
2522
|
empty?: ReactNode;
|
|
@@ -2899,8 +2929,8 @@ interface SectionNavProps extends Omit<ComponentPropsWithoutRef<'nav'>, 'childre
|
|
|
2899
2929
|
/** Write `#id` with history.replaceState on click (default true). Pass false in apps that
|
|
2900
2930
|
* use hash routing. */
|
|
2901
2931
|
updateHash?: boolean;
|
|
2902
|
-
/** Accessible name. Default "On this page"
|
|
2903
|
-
* the two landmarks differ).
|
|
2932
|
+
/** Accessible name. Default: the `onThisPage` string ("On this page", not "Sections", which the app
|
|
2933
|
+
* navs use, so the two landmarks differ). */
|
|
2904
2934
|
label?: string;
|
|
2905
2935
|
}
|
|
2906
2936
|
/** A row of jump chips for a long page. The chip of the section being read is marked
|
|
@@ -3017,7 +3047,7 @@ interface ConnectionBannerProps extends Omit<ComponentPropsWithoutRef<'div'>, 'c
|
|
|
3017
3047
|
healthUrl?: string;
|
|
3018
3048
|
/** Base interval between probes. After failures it doubles up to 4x. Default 30000. */
|
|
3019
3049
|
intervalMs?: number;
|
|
3020
|
-
/** Shown when the probe fails. Default "Can't reach the server". */
|
|
3050
|
+
/** Shown when the probe fails. Default: the `serverUnreachable` string ("Can't reach the server"). */
|
|
3021
3051
|
message?: string;
|
|
3022
3052
|
/** Shown when the browser is offline. Default: the provider's `offline` string. */
|
|
3023
3053
|
offlineMessage?: string;
|
|
@@ -3129,7 +3159,7 @@ interface RangeBarProps extends Omit<ComponentPropsWithoutRef<'div'>, 'children'
|
|
|
3129
3159
|
high: number;
|
|
3130
3160
|
/** Marks a value (e.g. the current price) with a dot. */
|
|
3131
3161
|
current?: number;
|
|
3132
|
-
/** The accessible name. Default (English
|
|
3162
|
+
/** The accessible name. Default: the `rangeLabel` string (English: "Range low to high, current x, within min to max"). */
|
|
3133
3163
|
label?: string;
|
|
3134
3164
|
/** The locale of the numbers in the default name. Default: the provider's locale, else en-US. */
|
|
3135
3165
|
locale?: string;
|
|
@@ -3181,9 +3211,9 @@ interface CommandPaletteProps {
|
|
|
3181
3211
|
placeholder?: string;
|
|
3182
3212
|
/** Text shown when nothing matches. Default 'No results'. */
|
|
3183
3213
|
emptyText?: string;
|
|
3184
|
-
/** Screen-reader announcement of the result count. Default "3 results". */
|
|
3214
|
+
/** Screen-reader announcement of the result count. Default: the `resultsCount` string ("3 results"). */
|
|
3185
3215
|
resultsLabel?: (count: number) => string;
|
|
3186
|
-
/** Accessible name of the "opens in a new tab" mark on external rows. Default 'opens in a new tab'. */
|
|
3216
|
+
/** Accessible name of the "opens in a new tab" mark on external rows. Default: the `opensInNewTab` string ('opens in a new tab'). */
|
|
3187
3217
|
externalLabel?: string;
|
|
3188
3218
|
/** Open with Ctrl/Cmd+K, and with `/` when focus is not in a field (default true). */
|
|
3189
3219
|
hotkey?: boolean;
|
|
@@ -3228,8 +3258,9 @@ declare function useNarrow(): boolean;
|
|
|
3228
3258
|
/** The largest Tailwind breakpoint the viewport has reached: base, sm (640), md (768), lg (1024) or xl (1280). */
|
|
3229
3259
|
declare function useBreakpoint(): Breakpoint;
|
|
3230
3260
|
/**
|
|
3231
|
-
* Sets document.title to "title · app" (or just the app, or just the title)
|
|
3232
|
-
* the
|
|
3261
|
+
* Sets document.title to "title · app" (or just the app, or just the title). With several
|
|
3262
|
+
* hooks mounted the innermost one that was given a title wins, and the original title comes
|
|
3263
|
+
* back when the last one unmounts. An undefined title with no app leaves the title alone.
|
|
3233
3264
|
*/
|
|
3234
3265
|
declare function useDocumentTitle(title: string | undefined, o?: {
|
|
3235
3266
|
app?: string;
|
|
@@ -3240,7 +3271,7 @@ declare function useNow(intervalMs?: number): number;
|
|
|
3240
3271
|
* State kept in localStorage. JSON by default, the raw string with { raw: true }. Never
|
|
3241
3272
|
* throws (private mode, quota and bad JSON fall back to the initial value) and follows
|
|
3242
3273
|
* changes from other tabs (`storage` events) and from other hooks on the same key. The
|
|
3243
|
-
* server and the first client render return `initial`.
|
|
3274
|
+
* server and the first client render return `initial`. `initial` is read once per key.
|
|
3244
3275
|
*/
|
|
3245
3276
|
declare function useLocalStorage<T>(key: string, initial: T, o?: {
|
|
3246
3277
|
raw?: boolean;
|
|
@@ -3433,7 +3464,7 @@ interface AppShellProps {
|
|
|
3433
3464
|
hub?: AppHeaderHub | false;
|
|
3434
3465
|
/** Every destination, in order. All show in the rail and the desktop header nav (or the sidebar); the BottomNav shows the first `primary` and puts the rest in a MoreSheet. Empty or left out, the shell has no nav at all (no tabs, rail, sidebar, BottomNav or sheet): the signed-out frame. */
|
|
3435
3466
|
nav?: NavItem[];
|
|
3436
|
-
/** How many items the BottomNav shows before "More". Default 4; when nav.length <= 5 all fit and
|
|
3467
|
+
/** How many items the BottomNav shows before "More". Default 4; when nav.length <= 5 all fit (with moreItems, 4 fit and the sixth cell is More). */
|
|
3437
3468
|
primary?: number;
|
|
3438
3469
|
/** Extra MoreSheet-only items (settings, sign out) shown after the overflow nav items. From md up they sit in a "More" menu in the header. Give them `onSelect`: the menu runs it, and only follows `href` (a full page load) when there is no `onSelect`. */
|
|
3439
3470
|
moreItems?: NavItem[];
|
|
@@ -3628,7 +3659,7 @@ interface FilterBarProps extends Omit<ComponentPropsWithRef<'div'>, 'children'>
|
|
|
3628
3659
|
children?: ReactNode;
|
|
3629
3660
|
/** How many filters differ from their defaults: shown as a count on the Filters button. */
|
|
3630
3661
|
activeCount?: number;
|
|
3631
|
-
/** Shows "Clear" when activeCount > 0
|
|
3662
|
+
/** Shows "Clear filters" inline from md (or lg) when activeCount > 0; below the breakpoint the sheet footer always shows Clear, disabled while activeCount is 0. */
|
|
3632
3663
|
onClear?: () => void;
|
|
3633
3664
|
/** Right-aligned extras that stay visible at every width (a sort Select, a view toggle). */
|
|
3634
3665
|
trailing?: ReactNode;
|
|
@@ -3645,9 +3676,8 @@ interface FilterBarProps extends Omit<ComponentPropsWithRef<'div'>, 'children'>
|
|
|
3645
3676
|
/** The search and filter row of a list page. From md up the controls sit inline; below md
|
|
3646
3677
|
* they move into a bottom sheet behind a Filters button that shows how many are on.
|
|
3647
3678
|
*
|
|
3648
|
-
*
|
|
3649
|
-
*
|
|
3650
|
-
* it only on the client (behind a mounted check, or a dynamic import with ssr: false). */
|
|
3679
|
+
* On the server and the first client render the layout is chosen by CSS at the breakpoint, so
|
|
3680
|
+
* phones see the Filters button from the first paint, then the media query takes over. */
|
|
3651
3681
|
declare function FilterBar({ search, children, activeCount, onClear, trailing, sticky, sheetTitle, sheetBelow, summary, className, ref, ...rest }: FilterBarProps): react.JSX.Element;
|
|
3652
3682
|
|
|
3653
3683
|
/** Where useUrlState reads and writes the query string. */
|
|
@@ -3700,7 +3730,7 @@ interface SettingRowProps extends Omit<ComponentPropsWithRef<'div'>, 'children'>
|
|
|
3700
3730
|
stacked?: boolean;
|
|
3701
3731
|
/** Keep the control at the end of the label row at every width (Switch, Checkbox). */
|
|
3702
3732
|
inline?: boolean;
|
|
3703
|
-
/** Tighter row (44px tall,
|
|
3733
|
+
/** Tighter row (44px tall, label beside the control at every width). No side padding inside a compact SettingsSection; keeps px-4 in a normal section.
|
|
3704
3734
|
* Default: on inside a compact SettingsSection. */
|
|
3705
3735
|
compact?: boolean;
|
|
3706
3736
|
/** A muted status after the control: "Saved", "Saving…", or an error (tone="error" → text-th-loss). */
|
|
@@ -3795,7 +3825,7 @@ interface ComboboxProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'
|
|
|
3795
3825
|
clearLabel?: string;
|
|
3796
3826
|
/** The loading row and its announcement. Default "Searching…" (NishProvider strings). */
|
|
3797
3827
|
loadingText?: string;
|
|
3798
|
-
/** The polite announcement of the result count. Default "3 results" / "1 result". */
|
|
3828
|
+
/** The polite announcement of the result count. Default: the `resultsCount` string ("3 results" / "1 result"). */
|
|
3799
3829
|
resultsText?: (count: number) => string;
|
|
3800
3830
|
className?: string;
|
|
3801
3831
|
}
|
|
@@ -3914,7 +3944,7 @@ interface DatePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange
|
|
|
3914
3944
|
/** A date field: type the date in the reader's own numeric order (or ISO), or pick it from a
|
|
3915
3945
|
* Calendar in a Popover. The value is a YYYY-MM-DD string, like a native date input. `ref`,
|
|
3916
3946
|
* `id`, `aria-*`, `name` and `required` belong to the input; `className` and other attributes
|
|
3917
|
-
* go to the wrapper. */
|
|
3947
|
+
* go to the wrapper. A typed 2-digit year means the year within 80 years before and 19 after this year (CLDR): in 2026, 99 is 1999 and 30 is 2030. */
|
|
3918
3948
|
declare function DatePicker({ ref, value: valueProp, defaultValue, onValueChange, min: minProp, max: maxProp, isDateDisabled, locale, weekStartsOn, captionLayout, placeholder, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, 'aria-invalid': ariaInvalid, invalid, id, name, form, required, disabled, size, calendarLabel, className, ...rest }: DatePickerProps): react.JSX.Element;
|
|
3919
3949
|
|
|
3920
3950
|
interface RangeCalendarProps extends CalendarSharedProps {
|
|
@@ -3986,7 +4016,7 @@ interface DateRangePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onC
|
|
|
3986
4016
|
/** A date range field: type both dates in the reader's own numeric order (or ISO), or pick them
|
|
3987
4017
|
* from a RangeCalendar in a Popover. The value is { from, to } as YYYY-MM-DD strings. `ref`,
|
|
3988
4018
|
* `id`, `aria-*`, `name` and `required` belong to the input; `className` and other attributes
|
|
3989
|
-
* go to the wrapper. */
|
|
4019
|
+
* go to the wrapper. A typed 2-digit year means the year within 80 years before and 19 after this year (CLDR): in 2026, 99 is 1999 and 30 is 2030. */
|
|
3990
4020
|
declare function DateRangePicker({ ref, value: valueProp, defaultValue, onValueChange, min: minProp, max: maxProp, isDateDisabled, allowDisabledInRange, locale, weekStartsOn, captionLayout, placeholder, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, 'aria-invalid': ariaInvalid, invalid, id, name, form, required, disabled, size, calendarLabel, className, ...rest }: DateRangePickerProps): react.JSX.Element;
|
|
3991
4021
|
|
|
3992
4022
|
type HourCycle = 12 | 24;
|
|
@@ -4088,7 +4118,7 @@ interface MultiSelectProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChang
|
|
|
4088
4118
|
loading?: boolean;
|
|
4089
4119
|
/** The loading row and its announcement. Default "Searching…" (NishProvider strings). */
|
|
4090
4120
|
loadingText?: string;
|
|
4091
|
-
/** The polite announcement of the result count. Default "3 results" / "1 result". */
|
|
4121
|
+
/** The polite announcement of the result count. Default: the `resultsCount` string ("3 results" / "1 result"). */
|
|
4092
4122
|
resultsText?: (count: number) => string;
|
|
4093
4123
|
/** md (default) or sm. Both grow to 44px on touch screens. */
|
|
4094
4124
|
size?: 'sm' | 'md';
|
|
@@ -4358,7 +4388,7 @@ type MediaThumbSize = 'sm' | 'md';
|
|
|
4358
4388
|
interface MediaThumbProps extends Omit<ComponentPropsWithoutRef<'span'>, 'children'> {
|
|
4359
4389
|
/** The image URL. Relative, http(s) URLs load; javascript:, data: and other schemes show the fallback. */
|
|
4360
4390
|
src?: string;
|
|
4361
|
-
/** wide: 16:9 (64x36, or 96x54
|
|
4391
|
+
/** wide: 16:9 (64x36 at sm; at md 72x41, or 96x54 from 420px wide). round and square: 36px, or 48px at md. */
|
|
4362
4392
|
shape?: MediaThumbShape;
|
|
4363
4393
|
/** sm for dense lists, md otherwise. */
|
|
4364
4394
|
size?: MediaThumbSize;
|
|
@@ -4634,7 +4664,7 @@ interface PaginationProps extends Omit<ComponentPropsWithoutRef<'nav'>, 'onChang
|
|
|
4634
4664
|
nextLabel?: string;
|
|
4635
4665
|
/** Label of one page button. Default: `pageLabel` from the strings. */
|
|
4636
4666
|
pageLabel?: (page: number) => string;
|
|
4637
|
-
/** The compact text. Default: "Page 3 of 10"
|
|
4667
|
+
/** The compact text. Default: the `pageOfCount` string ("Page 3 of 10"). */
|
|
4638
4668
|
compactLabel?: (page: number, pageCount: number) => string;
|
|
4639
4669
|
ref?: Ref<HTMLElement>;
|
|
4640
4670
|
}
|
|
@@ -4666,9 +4696,11 @@ interface BreadcrumbsProps extends Omit<ComponentPropsWithoutRef<'nav'>, 'childr
|
|
|
4666
4696
|
children?: ReactNode;
|
|
4667
4697
|
/** Renders a crumb with a href as a router link: `(item, props) => <Link to={props.href} {...props} />`. */
|
|
4668
4698
|
renderLink?: (item: BreadcrumbItem, props: BreadcrumbLinkProps) => ReactNode;
|
|
4699
|
+
/** Called instead of a full page load when a crumb inside the collapsed "…" menu is chosen (the menu rows are buttons, so renderLink cannot render them): `(href) => navigate(href)`. Without it the page navigates with location.assign. */
|
|
4700
|
+
onNavigate?: (href: string, item: BreadcrumbItem) => void;
|
|
4669
4701
|
/** The separator between crumbs. Default: a chevron that mirrors in RTL. */
|
|
4670
4702
|
separator?: ReactNode;
|
|
4671
|
-
/** More crumbs than this collapse the middle ones into a "…" menu (default 4). */
|
|
4703
|
+
/** More crumbs than this collapse the middle ones into a "…" menu (default 4; values under 3 act as 3, so first, "…" and the current crumb always fit). */
|
|
4672
4704
|
maxItems?: number;
|
|
4673
4705
|
/** auto (default): collapse only under 640px of container width. always: whenever there are more than maxItems. never: show every crumb. */
|
|
4674
4706
|
collapse?: 'auto' | 'always' | 'never';
|
|
@@ -4680,7 +4712,7 @@ interface BreadcrumbsProps extends Omit<ComponentPropsWithoutRef<'nav'>, 'childr
|
|
|
4680
4712
|
}
|
|
4681
4713
|
/** A trail of where the page sits: links, a chevron between them and aria-current="page" on the
|
|
4682
4714
|
* last crumb. A long trail collapses its middle crumbs into a "…" menu on narrow containers. */
|
|
4683
|
-
declare function Breadcrumbs({ items, children, renderLink, separator, maxItems, collapse, label, moreLabel, className, ref, ...rest }: BreadcrumbsProps): react.JSX.Element;
|
|
4715
|
+
declare function Breadcrumbs({ items, children, renderLink, onNavigate, separator, maxItems, collapse, label, moreLabel, className, ref, ...rest }: BreadcrumbsProps): react.JSX.Element;
|
|
4684
4716
|
|
|
4685
4717
|
type AccordionHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
4686
4718
|
interface AccordionBase extends Omit<ComponentPropsWithoutRef<'div'>, 'defaultValue' | 'onChange'> {
|
package/dist/nish-components.css
CHANGED
|
@@ -655,7 +655,7 @@
|
|
|
655
655
|
/* --- Pill link (.nish-pill-link) -------------------------------------------------------
|
|
656
656
|
The "← nish.software" pill at the top left of a header:
|
|
657
657
|
<a class="nish-pill-link" href="https://nish.software" title="Back to nish.software">← nish.software</a>
|
|
658
|
-
Also in base.css
|
|
658
|
+
Also in base.css, so pages that load only nish.css get it too.
|
|
659
659
|
--compact: under 480px only the arrow shows, in a 44px circle; data-compact="always" at every width.
|
|
660
660
|
<a class="nish-pill-link nish-pill-link--compact" href="/">← <span class="nish-pill-link-label">Artifacts</span></a> */
|
|
661
661
|
:where(.nish-pill-link) {
|
|
@@ -1539,6 +1539,7 @@
|
|
|
1539
1539
|
margin: auto auto 0;
|
|
1540
1540
|
padding: 0 0 env(safe-area-inset-bottom);
|
|
1541
1541
|
overflow-y: auto;
|
|
1542
|
+
overscroll-behavior: contain;
|
|
1542
1543
|
border: 1px solid var(--nish-line);
|
|
1543
1544
|
border-bottom: 0;
|
|
1544
1545
|
border-radius: 16px 16px 0 0;
|
|
@@ -1638,7 +1639,7 @@
|
|
|
1638
1639
|
z-index: var(--nish-z-tooltip, 100);
|
|
1639
1640
|
display: none;
|
|
1640
1641
|
width: max-content;
|
|
1641
|
-
max-width: min(320px, 100vw -
|
|
1642
|
+
max-width: min(320px, 100vw - 32px);
|
|
1642
1643
|
padding: 8px 12px;
|
|
1643
1644
|
border: 1px solid var(--nish-line-strong);
|
|
1644
1645
|
border-radius: var(--nish-radius-sm);
|
|
@@ -1652,9 +1653,20 @@
|
|
|
1652
1653
|
text-align: start;
|
|
1653
1654
|
text-transform: none;
|
|
1654
1655
|
white-space: normal;
|
|
1655
|
-
pointer-events: none;
|
|
1656
1656
|
transform: translateX(-50%);
|
|
1657
1657
|
}
|
|
1658
|
+
/* A transparent bridge over the 8px gap keeps the tip open while the pointer moves onto it (WCAG 1.4.13). */
|
|
1659
|
+
:where(.nish-tooltip) > :where(.nish-tooltip-content)::before {
|
|
1660
|
+
content: '';
|
|
1661
|
+
position: absolute;
|
|
1662
|
+
inset-inline: 0;
|
|
1663
|
+
top: 100%;
|
|
1664
|
+
height: 8px;
|
|
1665
|
+
}
|
|
1666
|
+
:where(.nish-tooltip--bottom) > :where(.nish-tooltip-content)::before {
|
|
1667
|
+
top: auto;
|
|
1668
|
+
bottom: 100%;
|
|
1669
|
+
}
|
|
1658
1670
|
:where(.nish-tooltip--bottom) > :where(.nish-tooltip-content) {
|
|
1659
1671
|
top: calc(100% + 8px);
|
|
1660
1672
|
bottom: auto;
|
|
@@ -1797,13 +1809,8 @@
|
|
|
1797
1809
|
border-color: color-mix(in srgb, var(--nish-on-loss) 35%, transparent);
|
|
1798
1810
|
border-top-color: var(--nish-on-loss);
|
|
1799
1811
|
}
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
animation: nish-pulse 1.6s ease-in-out infinite !important;
|
|
1803
|
-
animation-iteration-count: infinite !important;
|
|
1804
|
-
animation-duration: 1.6s !important;
|
|
1805
|
-
}
|
|
1806
|
-
}
|
|
1812
|
+
/* Under reduced motion the busy ring pulses instead of turning; that rule lives in base.css
|
|
1813
|
+
(same layer as the reset it overrides, because !important reverses layer order). */
|
|
1807
1814
|
|
|
1808
1815
|
/* --- Sheet (dialog.nish-sheet) ------------------------------------------------------
|
|
1809
1816
|
A general dialog that is a bottom sheet under 640px and a centered panel from 640px.
|
|
@@ -1843,7 +1850,7 @@
|
|
|
1843
1850
|
animation: nish-sheet-in 240ms var(--nish-ease-out, ease-out) both;
|
|
1844
1851
|
}
|
|
1845
1852
|
:where(.nish-sheet)::before {
|
|
1846
|
-
/* The grab handle: a 44px target with a 40x4 bar, like the React Modal. */
|
|
1853
|
+
/* The grab handle: a 44px target (openSheet() starts a drag in the same top 44px) with a 40x4 bar, like the React Modal. */
|
|
1847
1854
|
content: '';
|
|
1848
1855
|
flex-shrink: 0;
|
|
1849
1856
|
height: 44px;
|
|
@@ -1863,7 +1870,7 @@
|
|
|
1863
1870
|
animation: nish-fade-out 200ms ease-in both;
|
|
1864
1871
|
}
|
|
1865
1872
|
/* The page behind a modal sheet does not scroll. */
|
|
1866
|
-
:where(html:has(.nish-sheet[open])) {
|
|
1873
|
+
:where(html:has(.nish-sheet[open], dialog.nish-dialog[open], dialog.nish-command[open])) {
|
|
1867
1874
|
overflow: hidden;
|
|
1868
1875
|
}
|
|
1869
1876
|
:where(.nish-sheet-header) {
|
|
@@ -2046,13 +2053,16 @@
|
|
|
2046
2053
|
transform 150ms,
|
|
2047
2054
|
background-color 150ms;
|
|
2048
2055
|
}
|
|
2049
|
-
/* Extends the touch target to
|
|
2056
|
+
/* Extends the touch target to 44x44 under a coarse pointer without moving layout (both the 36x20 and the 28x16 small track). */
|
|
2050
2057
|
@media (pointer: coarse) {
|
|
2051
2058
|
:where(.nish-switch)::before {
|
|
2052
2059
|
content: '';
|
|
2053
2060
|
position: absolute;
|
|
2054
2061
|
inset: -12px -4px;
|
|
2055
2062
|
}
|
|
2063
|
+
:where(.nish-switch--sm)::before {
|
|
2064
|
+
inset: -14px -8px;
|
|
2065
|
+
}
|
|
2056
2066
|
:where(.nish-check-row) {
|
|
2057
2067
|
align-items: center;
|
|
2058
2068
|
min-height: var(--nish-tap-min, 44px);
|
|
@@ -2939,10 +2949,10 @@
|
|
|
2939
2949
|
background: var(--nish-elevated);
|
|
2940
2950
|
font-family: var(--nish-font-mono, ui-monospace, monospace);
|
|
2941
2951
|
line-height: 1rem;
|
|
2942
|
-
/* base.css
|
|
2943
|
-
padding: 0 6px
|
|
2944
|
-
color: var(--nish-hi2)
|
|
2945
|
-
font-size: var(--nish-text-2xs)
|
|
2952
|
+
/* This layer (nish.components) sits above nish.base, so these beat base.css's bare kbd rule without !important, and a site's own unlayered CSS can still restyle them. */
|
|
2953
|
+
padding: 0 6px;
|
|
2954
|
+
color: var(--nish-hi2);
|
|
2955
|
+
font-size: var(--nish-text-2xs);
|
|
2946
2956
|
}
|
|
2947
2957
|
|
|
2948
2958
|
/* --- Page header (.nish-page-header) ----------------------------------------------------
|
|
@@ -3312,6 +3322,22 @@
|
|
|
3312
3322
|
min-height: 0;
|
|
3313
3323
|
min-width: 0;
|
|
3314
3324
|
}
|
|
3325
|
+
/* The tag chip's remove button (the React TAG_REMOVE_HIT): the visible button keeps its xs size and a centred 44px ::after takes the touch. */
|
|
3326
|
+
:where(span.nish-chip) > :where([data-nish-remove]) {
|
|
3327
|
+
min-width: 0;
|
|
3328
|
+
min-height: 0;
|
|
3329
|
+
position: relative;
|
|
3330
|
+
}
|
|
3331
|
+
:where(span.nish-chip) > :where([data-nish-remove])::after {
|
|
3332
|
+
content: '';
|
|
3333
|
+
position: absolute;
|
|
3334
|
+
left: 50%;
|
|
3335
|
+
top: 50%;
|
|
3336
|
+
width: 44px;
|
|
3337
|
+
height: 44px;
|
|
3338
|
+
transform: translate(-50%, -50%);
|
|
3339
|
+
border-radius: 50%;
|
|
3340
|
+
}
|
|
3315
3341
|
:where(.nish-btn--link) {
|
|
3316
3342
|
min-height: 0;
|
|
3317
3343
|
position: relative;
|
|
@@ -3825,7 +3851,7 @@
|
|
|
3825
3851
|
gap: 4px;
|
|
3826
3852
|
}
|
|
3827
3853
|
:where(.nish-media-row--live .nish-media-row-badges)::before {
|
|
3828
|
-
content: 'Live';
|
|
3854
|
+
content: var(--nish-live-label, 'Live');
|
|
3829
3855
|
box-sizing: border-box;
|
|
3830
3856
|
padding: 2px 8px;
|
|
3831
3857
|
border: 1px solid color-mix(in srgb, var(--nish-loss) 30%, transparent);
|
|
@@ -4369,6 +4395,7 @@
|
|
|
4369
4395
|
margin: 0;
|
|
4370
4396
|
padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
|
|
4371
4397
|
overflow: hidden;
|
|
4398
|
+
overscroll-behavior: contain;
|
|
4372
4399
|
border: 1px solid var(--nish-line);
|
|
4373
4400
|
border-radius: 0;
|
|
4374
4401
|
background: var(--nish-surface);
|
|
@@ -4452,10 +4479,10 @@
|
|
|
4452
4479
|
font-size: var(--nish-text-base);
|
|
4453
4480
|
outline: none;
|
|
4454
4481
|
}
|
|
4455
|
-
/*
|
|
4482
|
+
/* This layer sits above nish.base, so it beats base's :focus-visible ring without !important; the row is borderless and has no ring. */
|
|
4456
4483
|
:where(.nish-command-input) > :where(input),
|
|
4457
4484
|
:where(input.nish-command-input) {
|
|
4458
|
-
outline: none
|
|
4485
|
+
outline: none;
|
|
4459
4486
|
}
|
|
4460
4487
|
:where(input.nish-command-input) {
|
|
4461
4488
|
padding-inline: 16px;
|
|
@@ -4692,6 +4719,9 @@
|
|
|
4692
4719
|
:where(.nish-switch--sm:dir(rtl):checked, .nish-switch--sm:dir(rtl)[aria-checked='true'])::after {
|
|
4693
4720
|
transform: translateX(-12px);
|
|
4694
4721
|
}
|
|
4722
|
+
:where(.nish-range-bar-current:dir(rtl)) {
|
|
4723
|
+
transform: translate(50%, -50%);
|
|
4724
|
+
}
|
|
4695
4725
|
:where(.nish-subnav:dir(rtl), .nish-table-wrap--fade:dir(rtl), .nish-scroll-row:dir(rtl)) {
|
|
4696
4726
|
-webkit-mask-image: linear-gradient(to left, var(--nish-fade-start), #000 24px, #000 calc(100% - 24px), var(--nish-fade-end));
|
|
4697
4727
|
mask-image: linear-gradient(to left, var(--nish-fade-start), #000 24px, #000 calc(100% - 24px), var(--nish-fade-end));
|
|
@@ -4813,8 +4843,16 @@
|
|
|
4813
4843
|
background: Highlight;
|
|
4814
4844
|
color: HighlightText;
|
|
4815
4845
|
}
|
|
4846
|
+
/* Masked icons are painted with a background, which forced colors turns into Canvas:
|
|
4847
|
+
pick a system colour so they stay visible. */
|
|
4848
|
+
:where(.nish-disclosure > summary)::before,
|
|
4849
|
+
:where(.nish-error-state)::before,
|
|
4816
4850
|
:where(.nish-combobox-option[aria-selected='true'])::after {
|
|
4817
|
-
|
|
4851
|
+
forced-color-adjust: none;
|
|
4852
|
+
background: CanvasText;
|
|
4853
|
+
}
|
|
4854
|
+
:where(.nish-combobox-option[aria-selected='true'][data-active])::after {
|
|
4855
|
+
background: HighlightText;
|
|
4818
4856
|
}
|
|
4819
4857
|
:where(.nish-badge) {
|
|
4820
4858
|
border: 1px solid currentColor;
|