nish-ui 1.9.0 → 2.0.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.
Files changed (152) hide show
  1. package/README.md +218 -58
  2. package/dist/base-tailwind.css +1757 -0
  3. package/dist/base.css +1590 -1445
  4. package/dist/chart.d.ts +4 -1
  5. package/dist/chart.js +122 -49
  6. package/dist/elements-all.d.ts +8 -0
  7. package/dist/elements-all.js +178 -0
  8. package/dist/elements-charts.d.ts +71 -0
  9. package/dist/elements-charts.js +56 -57
  10. package/dist/elements-data.d.ts +71 -0
  11. package/dist/elements-data.js +5 -6
  12. package/dist/elements-forms.d.ts +71 -0
  13. package/dist/elements-forms.js +24 -25
  14. package/dist/elements.d.ts +71 -0
  15. package/dist/elements.js +4 -5
  16. package/dist/esm/chart-values.js +58 -0
  17. package/dist/esm/chart.js +10 -0
  18. package/dist/esm/cn.js +19 -0
  19. package/dist/esm/combobox-filter.js +13 -0
  20. package/dist/esm/components/accordion.js +166 -0
  21. package/dist/esm/components/app-shell.js +198 -0
  22. package/dist/esm/components/avatar-classes.js +28 -0
  23. package/dist/esm/components/avatar.js +113 -0
  24. package/dist/esm/components/breadcrumbs.js +154 -0
  25. package/dist/esm/components/canvas/follow-caption.js +32 -0
  26. package/dist/esm/components/canvas/follow.js +119 -0
  27. package/dist/esm/components/canvas/icons.js +70 -0
  28. package/dist/esm/components/canvas/index.js +10 -0
  29. package/dist/esm/components/canvas/layout.js +258 -0
  30. package/dist/esm/components/canvas/legend.js +93 -0
  31. package/dist/esm/components/canvas/minimap.js +127 -0
  32. package/dist/esm/components/canvas/node.js +87 -0
  33. package/dist/esm/components/canvas/route.js +262 -0
  34. package/dist/esm/components/canvas/system-canvas.js +837 -0
  35. package/dist/esm/components/canvas/types.js +10 -0
  36. package/dist/esm/components/canvas/view.js +47 -0
  37. package/dist/esm/components/chart-hooks.js +19 -0
  38. package/dist/esm/components/charts.js +467 -0
  39. package/dist/esm/components/client.js +24 -0
  40. package/dist/esm/components/combobox.js +343 -0
  41. package/dist/esm/components/command.js +403 -0
  42. package/dist/esm/components/data-classes.js +159 -0
  43. package/dist/esm/components/data.js +517 -0
  44. package/dist/esm/components/display-classes.js +130 -0
  45. package/dist/esm/components/display.js +755 -0
  46. package/dist/esm/components/error-boundary.js +64 -0
  47. package/dist/esm/components/feedback.js +136 -0
  48. package/dist/esm/components/file-dropzone.js +184 -0
  49. package/dist/esm/components/filters.js +108 -0
  50. package/dist/esm/components/flow.js +746 -0
  51. package/dist/esm/components/forms-classes.js +43 -0
  52. package/dist/esm/components/forms.js +581 -0
  53. package/dist/esm/components/hooks-classes.js +9 -0
  54. package/dist/esm/components/hooks.js +236 -0
  55. package/dist/esm/components/icons.js +96 -0
  56. package/dist/esm/components/inbox-classes.js +29 -0
  57. package/dist/esm/components/inbox.js +257 -0
  58. package/dist/esm/components/latest.js +13 -0
  59. package/dist/esm/components/layout-vars.js +96 -0
  60. package/dist/esm/components/layout.js +272 -0
  61. package/dist/esm/components/media.js +143 -0
  62. package/dist/esm/components/nav.js +614 -0
  63. package/dist/esm/components/overlay-classes.js +66 -0
  64. package/dist/esm/components/overlay.js +1447 -0
  65. package/dist/esm/components/pagination-classes.js +29 -0
  66. package/dist/esm/components/pagination.js +154 -0
  67. package/dist/esm/components/portal.js +16 -0
  68. package/dist/esm/components/primitives-classes.js +198 -0
  69. package/dist/esm/components/primitives.js +268 -0
  70. package/dist/esm/components/progress.js +77 -0
  71. package/dist/esm/components/provider.js +32 -0
  72. package/dist/esm/components/radio-group.js +186 -0
  73. package/dist/esm/components/resource-classes.js +133 -0
  74. package/dist/esm/components/resource.js +209 -0
  75. package/dist/esm/components/segmented.js +178 -0
  76. package/dist/esm/components/separator.js +38 -0
  77. package/dist/esm/components/service-tokens.js +221 -0
  78. package/dist/esm/components/settings.js +301 -0
  79. package/dist/esm/components/slider.js +262 -0
  80. package/dist/esm/components/split-classes.js +8 -0
  81. package/dist/esm/components/split.js +411 -0
  82. package/dist/esm/components/strings.js +119 -0
  83. package/dist/esm/components/table.js +144 -0
  84. package/dist/esm/components/tabs-classes.js +21 -0
  85. package/dist/esm/components/tabs.js +201 -0
  86. package/dist/esm/components/tag-input.js +257 -0
  87. package/dist/esm/components/theme-toggle.js +177 -0
  88. package/dist/esm/components/toast.js +361 -0
  89. package/dist/esm/components/url-state.js +118 -0
  90. package/dist/esm/components/visually-hidden.js +20 -0
  91. package/dist/esm/format.js +320 -0
  92. package/dist/esm/inbox-client.js +2 -0
  93. package/dist/esm/inbox-types.js +2 -0
  94. package/dist/esm/index.js +320 -0
  95. package/dist/esm/runtime.js +37 -0
  96. package/dist/esm/server/inbox/client.js +297 -0
  97. package/dist/esm/server/inbox/types.js +24 -0
  98. package/dist/esm/sparkline-path.js +59 -0
  99. package/dist/esm/split-layout.js +419 -0
  100. package/dist/esm/system-canvas.js +2 -0
  101. package/dist/esm/theme.js +804 -0
  102. package/dist/esm/tokens.mjs +425 -0
  103. package/dist/esm/url.js +20 -0
  104. package/dist/files.json +5 -1
  105. package/dist/fonts/LICENSE-Inter.txt +93 -0
  106. package/dist/format.d.ts +32 -18
  107. package/dist/format.js +227 -82
  108. package/dist/inbox-client.js +3 -1
  109. package/dist/index.d.ts +1686 -667
  110. package/dist/nish-components.css +4649 -4506
  111. package/dist/nish-components.min.css +1 -0
  112. package/dist/nish.css +1603 -1450
  113. package/dist/nish.min.css +1 -0
  114. package/dist/node/eslint.js +29 -14
  115. package/dist/node/th-check.js +29 -14
  116. package/dist/node/vite.d.ts +12 -0
  117. package/dist/node/vite.js +12 -2
  118. package/dist/server/hono.d.ts +15 -6
  119. package/dist/server/hono.js +30 -25
  120. package/dist/server/index.d.ts +3 -10
  121. package/dist/server/index.js +71 -38
  122. package/dist/{spa-DuVB5O7S.d.ts → spa-BLlMc0eI.d.ts} +38 -5
  123. package/dist/system-canvas-BLuWd69H.d.ts +183 -0
  124. package/dist/system-canvas.d.ts +2 -168
  125. package/dist/tailwind-core.css +114 -0
  126. package/dist/tailwind.css +3 -7
  127. package/dist/theme-init.js +23 -9
  128. package/dist/theme-init.sha256 +1 -0
  129. package/dist/theme.d.ts +243 -4
  130. package/dist/theme.global.js +356 -89
  131. package/dist/theme.js +337 -67
  132. package/dist/tokens.css +14 -6
  133. package/dist/tokens.dtcg.json +1513 -0
  134. package/dist/tokens.js +29 -14
  135. package/dist/tokens.json +512 -0
  136. package/package.json +51 -13
  137. package/dist/chart.js.map +0 -1
  138. package/dist/elements-charts.js.map +0 -1
  139. package/dist/elements-data.js.map +0 -1
  140. package/dist/elements-forms.js.map +0 -1
  141. package/dist/elements.js.map +0 -1
  142. package/dist/format.js.map +0 -1
  143. package/dist/inbox-client.js.map +0 -1
  144. package/dist/index.js +0 -10260
  145. package/dist/index.js.map +0 -1
  146. package/dist/server/hono.js.map +0 -1
  147. package/dist/server/index.js.map +0 -1
  148. package/dist/split-layout.js.map +0 -1
  149. package/dist/system-canvas.js +0 -2204
  150. package/dist/system-canvas.js.map +0 -1
  151. package/dist/theme.global.js.map +0 -1
  152. package/dist/theme.js.map +0 -1
@@ -0,0 +1,114 @@
1
+ /* Generated from src/tokens.mjs by scripts/build.mjs. Do not edit. */
2
+
3
+ @import "./tokens.css";
4
+ @import "./fonts.css";
5
+ @import "./base-tailwind.css" layer(base);
6
+
7
+
8
+ /* dark: follows the active theme, not the OS. */
9
+ @custom-variant dark (&:where([data-scheme='dark'], [data-scheme='dark'] *));
10
+ @custom-variant light (&:where([data-scheme='light'], [data-scheme='light'] *));
11
+
12
+ @theme inline {
13
+ --color-th-bg: var(--nish-bg);
14
+ --color-th-surface: var(--nish-surface);
15
+ --color-th-elevated: var(--nish-elevated);
16
+ --color-th-overlay: var(--nish-overlay);
17
+ --color-th-line: var(--nish-line);
18
+ --color-th-line-strong: var(--nish-line-strong);
19
+ --color-th-line-control: var(--nish-line-control);
20
+ --color-th-hi: var(--nish-hi);
21
+ --color-th-hi2: var(--nish-hi2);
22
+ --color-th-hi3: var(--nish-hi3);
23
+ --color-th-ghost: var(--nish-ghost);
24
+ --color-th-accent: var(--nish-accent);
25
+ --color-th-accent2: var(--nish-accent2);
26
+ --color-th-on-accent: var(--nish-on-accent);
27
+ --color-th-on-accent2: var(--nish-on-accent2);
28
+ --color-th-on-ok: var(--nish-on-ok);
29
+ --color-th-on-loss: var(--nish-on-loss);
30
+ --color-th-on-warn: var(--nish-on-warn);
31
+ --color-th-on-info: var(--nish-on-info);
32
+ --color-th-ok: var(--nish-ok);
33
+ --color-th-loss: var(--nish-loss);
34
+ --color-th-warn: var(--nish-warn);
35
+ --color-th-info: var(--nish-info);
36
+ --color-th-ok-fill: var(--nish-ok-fill);
37
+ --color-th-loss-fill: var(--nish-loss-fill);
38
+ --color-th-warn-fill: var(--nish-warn-fill);
39
+ --color-th-info-fill: var(--nish-info-fill);
40
+ --color-th-scrim: var(--nish-scrim);
41
+ --color-th-invert-bg: var(--nish-invert-bg);
42
+ --color-th-invert-text: var(--nish-invert-text);
43
+ --color-th-emerald: var(--nish-emerald);
44
+ --color-th-indigo: var(--nish-indigo);
45
+ --color-th-amber: var(--nish-amber);
46
+ --color-th-lime: var(--nish-lime);
47
+ --color-th-rose: var(--nish-rose);
48
+ --color-th-sky: var(--nish-sky);
49
+ --color-th-violet: var(--nish-violet);
50
+ --color-th-teal: var(--nish-teal);
51
+ --color-th-chart-1: var(--nish-chart-1);
52
+ --color-th-chart-2: var(--nish-chart-2);
53
+ --color-th-chart-3: var(--nish-chart-3);
54
+ --color-th-chart-4: var(--nish-chart-4);
55
+ --color-th-chart-5: var(--nish-chart-5);
56
+ --color-th-chart-6: var(--nish-chart-6);
57
+ --color-th-chart-7: var(--nish-chart-7);
58
+ --color-th-chart-8: var(--nish-chart-8);
59
+ --color-th-accent-soft: var(--nish-accent-soft);
60
+ --color-th-accent-soft-solid: var(--nish-accent-soft-solid);
61
+ --color-th-ok-soft: var(--nish-ok-soft);
62
+ --color-th-ok-soft-solid: var(--nish-ok-soft-solid);
63
+ --color-th-loss-soft: var(--nish-loss-soft);
64
+ --color-th-loss-soft-solid: var(--nish-loss-soft-solid);
65
+ --color-th-warn-soft: var(--nish-warn-soft);
66
+ --color-th-warn-soft-solid: var(--nish-warn-soft-solid);
67
+ --color-th-info-soft: var(--nish-info-soft);
68
+ --color-th-info-soft-solid: var(--nish-info-soft-solid);
69
+ --color-th-emerald-soft: var(--nish-emerald-soft);
70
+ --color-th-emerald-soft-solid: var(--nish-emerald-soft-solid);
71
+ --color-th-indigo-soft: var(--nish-indigo-soft);
72
+ --color-th-indigo-soft-solid: var(--nish-indigo-soft-solid);
73
+ --color-th-amber-soft: var(--nish-amber-soft);
74
+ --color-th-amber-soft-solid: var(--nish-amber-soft-solid);
75
+ --color-th-lime-soft: var(--nish-lime-soft);
76
+ --color-th-lime-soft-solid: var(--nish-lime-soft-solid);
77
+ --color-th-rose-soft: var(--nish-rose-soft);
78
+ --color-th-rose-soft-solid: var(--nish-rose-soft-solid);
79
+ --color-th-sky-soft: var(--nish-sky-soft);
80
+ --color-th-sky-soft-solid: var(--nish-sky-soft-solid);
81
+ --color-th-violet-soft: var(--nish-violet-soft);
82
+ --color-th-violet-soft-solid: var(--nish-violet-soft-solid);
83
+ --color-th-teal-soft: var(--nish-teal-soft);
84
+ --color-th-teal-soft-solid: var(--nish-teal-soft-solid);
85
+ --color-th-gain: var(--nish-ok);
86
+ --color-th-danger: var(--nish-loss);
87
+ --color-th-2: var(--nish-hi2);
88
+ --color-th-3: var(--nish-hi3);
89
+ --color-th-bar: var(--nish-surface);
90
+ --color-th-focus: var(--nish-focus);
91
+ --text-2xs: var(--nish-text-2xs);
92
+ --text-2xs--line-height: var(--nish-text-2xs-lh);
93
+ --text-3xs: var(--nish-text-3xs);
94
+ --text-3xs--line-height: var(--nish-text-3xs-lh);
95
+ --font-sans: var(--nish-font-sans);
96
+ --font-mono: var(--nish-font-mono);
97
+ --shadow-card: var(--nish-shadow-card);
98
+ --shadow-pop: var(--nish-shadow-pop);
99
+ --shadow-modal: var(--nish-shadow-modal);
100
+ --ease-nish: var(--nish-ease-out);
101
+ --animate-fade-in: nish-fade-in var(--nish-dur-fast) ease-out;
102
+ --animate-rise-in: nish-rise-in var(--nish-dur-fast) var(--nish-ease-out);
103
+ --animate-slide-in-right: nish-slide-in-right var(--nish-dur-med) var(--nish-ease-out);
104
+ --animate-slide-in-left: nish-slide-in-left var(--nish-dur-med) var(--nish-ease-out);
105
+ }
106
+
107
+ @layer base {
108
+ *, ::before, ::after, ::backdrop, ::file-selector-button {
109
+ border-color: var(--nish-line);
110
+ }
111
+ button:not(:disabled), [role='button']:not([aria-disabled='true']) {
112
+ cursor: pointer;
113
+ }
114
+ }
package/dist/tailwind.css CHANGED
@@ -2,15 +2,10 @@
2
2
 
3
3
  @import "./tokens.css";
4
4
  @import "./fonts.css";
5
- @import "./base.css" layer(base);
5
+ @import "./base-tailwind.css" layer(base);
6
6
 
7
7
  /* Class names used by the components in this package. */
8
- @source "./*.js";
9
- @source not "./theme.global.js";
10
- @source not "./node";
11
- @source not "./*.map";
12
- @source not "./*.d.ts";
13
- @source not "./*/**";
8
+ @source "./esm/components";
14
9
 
15
10
  /* dark: follows the active theme, not the OS. */
16
11
  @custom-variant dark (&:where([data-scheme='dark'], [data-scheme='dark'] *));
@@ -23,6 +18,7 @@
23
18
  --color-th-overlay: var(--nish-overlay);
24
19
  --color-th-line: var(--nish-line);
25
20
  --color-th-line-strong: var(--nish-line-strong);
21
+ --color-th-line-control: var(--nish-line-control);
26
22
  --color-th-hi: var(--nish-hi);
27
23
  --color-th-hi2: var(--nish-hi2);
28
24
  --color-th-hi3: var(--nish-hi3);
@@ -5,18 +5,29 @@
5
5
  (function () {
6
6
  var THEMES = {"dark":"dark","light":"light","slate":"dark","terminal":"dark","mocha":"dark","ocean":"dark","contrast":"dark"};
7
7
  var BG = {"dark":"#0a0b0f","light":"#f7f6f3","slate":"#18181b","terminal":"#050807","mocha":"#1c1917","ocean":"#020c18","contrast":"#000000"};
8
+ var own = function (o, k) {
9
+ return Object.prototype.hasOwnProperty.call(o, k);
10
+ };
11
+ var root = document.documentElement;
8
12
  // An app's own themes: window.__nishExtraThemes = { rose: 'dark', paper: 'light' }.
9
13
  var extra = window.__nishExtraThemes || {};
10
- for (var k in extra) if (!THEMES[k]) THEMES[k] = extra[k];
14
+ for (var k in extra) if (own(extra, k) && !own(THEMES, k)) THEMES[k] = extra[k];
11
15
  var DEFAULT = "dark";
12
- var KEY = 'nish-theme';
13
- var root = document.documentElement;
16
+ // Storage and cookie name: <html data-nish-storage-key="x"> (letters, digits, - and _).
17
+ var KEY = root.getAttribute('data-nish-storage-key');
18
+ if (!KEY || !/^[A-Za-z0-9_-]+$/.test(KEY)) KEY = 'nish-theme';
14
19
  var choice = null;
20
+ // Cookies and storage can each throw (sandboxed iframe, blocked site data): read them apart.
15
21
  try {
16
- var m = document.cookie.match(/(?:^|;\s*)nish-theme=([a-z0-9-]+)/);
17
- choice = m ? m[1] : localStorage.getItem(KEY);
22
+ var m = document.cookie.match(new RegExp('(?:^|;\\s*)' + KEY + '=([a-z0-9-]+)'));
23
+ choice = m ? m[1] : null;
18
24
  } catch (e) {}
19
- if (choice !== 'system' && !THEMES[choice]) choice = 'system';
25
+ if (choice == null) {
26
+ try {
27
+ choice = localStorage.getItem(KEY);
28
+ } catch (e) {}
29
+ }
30
+ if (choice !== 'system' && !(typeof choice === 'string' && own(THEMES, choice))) choice = 'system';
20
31
  var theme = choice;
21
32
  if (theme === 'system') {
22
33
  theme = window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : DEFAULT;
@@ -31,7 +42,7 @@
31
42
  root.style.colorScheme = THEMES[theme];
32
43
  // Browser and PWA chrome in the theme's bg from the first frame. An app's own
33
44
  // (registered) theme has no baked color: theme.ts sets it once its CSS is live.
34
- if (BG[theme]) {
45
+ if (own(BG, theme)) {
35
46
  try {
36
47
  var meta = document.querySelector('meta[name="theme-color"][data-nish]');
37
48
  if (!meta) {
@@ -42,10 +53,13 @@
42
53
  }
43
54
  meta.setAttribute('content', BG[theme]);
44
55
  // A static theme-color an app ships would win over ours (the first one is used).
45
- // Drop those, but keep the ones scoped by a media attribute.
56
+ // Drop those, but keep the ones scoped by a media attribute or marked data-nish-keep.
46
57
  var metas = document.querySelectorAll('meta[name="theme-color"]');
47
58
  for (var i = 0; i < metas.length; i++) {
48
- if (metas[i] !== meta && !metas[i].hasAttribute('media') && metas[i].parentNode) metas[i].parentNode.removeChild(metas[i]);
59
+ var other = metas[i];
60
+ if (other !== meta && !other.hasAttribute('media') && !other.hasAttribute('data-nish-keep') && other.parentNode) {
61
+ other.parentNode.removeChild(other);
62
+ }
49
63
  }
50
64
  } catch (e) {}
51
65
  }
@@ -0,0 +1 @@
1
+ sha256-rGP+jF8KBMsf35Md4+Zv+b6LagiGzxoV8QzAVcU6RIg=
package/dist/theme.d.ts CHANGED
@@ -6,6 +6,235 @@ interface ThemeDef {
6
6
  }
7
7
  declare const THEMES: Record<'dark' | 'light' | 'slate' | 'terminal' | 'mocha' | 'ocean' | 'contrast', ThemeDef>;
8
8
 
9
+ interface NishStrings {
10
+ /** Modal, Drawer, SheetHandle, CommandPalette: close button label. */
11
+ close: string;
12
+ /** ConfirmDialog, service-tokens revoke dialog: cancel button. */
13
+ cancel: string;
14
+ /** DropdownMenu: sheet title on phones. */
15
+ menu: string;
16
+ /** DropdownMenu sub-menu header, read by screen readers before the parent label. */
17
+ back: string;
18
+ /** Toast, Callout: dismiss button. */
19
+ dismiss: string;
20
+ /** Callout: badge label for a repeat count. */
21
+ moreCount: (count: number) => string;
22
+ /** CopyButton: idle label. */
23
+ copy: string;
24
+ /** CopyButton: label after copying. */
25
+ copied: string;
26
+ /** AppHeader: hub pill title. */
27
+ hubTitle: string;
28
+ /** AppHeader: hub pill text. */
29
+ hubLabel: string;
30
+ /** AppHeader: overflow kebab. */
31
+ moreActions: string;
32
+ /** BottomNav, MoreSheet, AppShell: the More tab and sheet title. */
33
+ more: string;
34
+ /** ChartLegend, LineChart: legend landmark. */
35
+ legend: string;
36
+ /** Field, FieldGroup: tag for a non-required field. */
37
+ optional: string;
38
+ /** SearchInput, FilterBar, CommandPalette: input placeholder and aria fallback. */
39
+ search: string;
40
+ /** SearchInput: clear button. */
41
+ clearSearch: string;
42
+ /** Chip: remove button without a name. */
43
+ remove: string;
44
+ /** Chip: remove button for a named chip. */
45
+ removeNamed: (name: string) => string;
46
+ /** Combobox, CommandPalette: empty list. */
47
+ noMatches: string;
48
+ /** Combobox, FilterBar, FilterSheet: clear button. */
49
+ clear: string;
50
+ /** Combobox: loading row. */
51
+ searching: string;
52
+ /** CommandPalette: input placeholder. */
53
+ searchPlaceholder: string;
54
+ /** CommandPalette: nothing found. */
55
+ noResults: string;
56
+ /** CommandPalette: listbox label. */
57
+ results: string;
58
+ /** Spinner, Skeleton, SkeletonRows, SkeletonCard, LoadingBar, Progress: announced loading state. */
59
+ loading: string;
60
+ /** ErrorState, AsyncPanel: default message. */
61
+ failedToLoad: string;
62
+ /** ErrorState, ConnectionBanner: retry button. */
63
+ retry: string;
64
+ /** StickyActionBar: landmark label. */
65
+ actions: string;
66
+ /** ConnectionBanner: offline message. */
67
+ offline: string;
68
+ /** ResponsiveTable, AsyncPanel: empty state. */
69
+ nothingHere: string;
70
+ /** ResponsiveTable: skeleton label. */
71
+ loadingNamed: (label: string) => string;
72
+ /** ResponsiveTable: phone sort select label. */
73
+ sortBy: string;
74
+ /** ResponsiveTable: phone sort default option. */
75
+ sortDefault: string;
76
+ /** LineChart, BarChart: empty text. */
77
+ noData: string;
78
+ /** LineChart, BarChart: aria label of an empty chart. */
79
+ noDataNamed: (label: string) => string;
80
+ /** FilterBar, FilterSheet: title. */
81
+ filters: string;
82
+ /** FilterBar: clear all filters. */
83
+ clearFilters: string;
84
+ /** FilterSheet: result button. */
85
+ done: string;
86
+ /** FilterBar: badge aria label. */
87
+ activeCount: (n: number) => string;
88
+ /** Nav badges: aria label. */
89
+ newCount: (value: string | number) => string;
90
+ /** BottomNav, NavRail, SectionNav: landmark. */
91
+ sections: string;
92
+ /** MoreSheet: theme row. */
93
+ theme: string;
94
+ /** NavRail: sidebar landmark. */
95
+ sidebar: string;
96
+ /** NavRail: expand button. */
97
+ expandSidebar: string;
98
+ /** NavRail: collapse button. */
99
+ collapseSidebar: string;
100
+ /** AppShell: skip link. */
101
+ skipToContent: string;
102
+ /** ThemeToggle: name of the system mode. */
103
+ themeSystem: string;
104
+ /** ThemeToggle: name of the light mode. */
105
+ themeLight: string;
106
+ /** ThemeToggle: name of the dark mode. */
107
+ themeDark: string;
108
+ /** ThemeToggle: button label for the current and next mode. */
109
+ themeToggleLabel: (current: string, next: string) => string;
110
+ /** ThemeToggle: preset select aria label. */
111
+ themePreset: string;
112
+ /** ThemeToggle: preset select placeholder. */
113
+ themePresetPlaceholder: string;
114
+ /** AppErrorBoundary: title when a new version is deployed. */
115
+ errorStaleTitle: string;
116
+ /** AppErrorBoundary: body when a new version is deployed. */
117
+ errorStaleBody: string;
118
+ /** AppErrorBoundary: title. */
119
+ errorTitle: string;
120
+ /** AppErrorBoundary: body when the error has no message. */
121
+ errorBody: string;
122
+ /** AppErrorBoundary: stack summary. */
123
+ errorDetails: string;
124
+ /** AppErrorBoundary: reset button. */
125
+ errorTryAgain: string;
126
+ /** AppErrorBoundary: reload button. */
127
+ errorReload: string;
128
+ /** useSaveStatus, SettingRow: saving. */
129
+ saving: string;
130
+ /** useSaveStatus, SettingRow: saved. */
131
+ saved: string;
132
+ /** useSaveStatus, SettingRow: failed with no message. */
133
+ saveFailed: string;
134
+ /** NumberField: validation message. */
135
+ enterNumber: string;
136
+ /** SplitDividers: column divider label. */
137
+ resizeColumns: string;
138
+ /** SplitDividers: row divider label. */
139
+ resizeRows: string;
140
+ /** LayoutPresetPicker: group label. */
141
+ layoutPresets: string;
142
+ /** MediaRow: live badge. */
143
+ live: string;
144
+ /** MediaRow: offline badge. */
145
+ offlineBadge: string;
146
+ /** FlowSteps: group label. */
147
+ progress: string;
148
+ /** WorkflowBoard: group label. */
149
+ workflow: string;
150
+ /** ActivityFeed: group label. */
151
+ activity: string;
152
+ /** WorkflowBoard: catch-all column. */
153
+ other: string;
154
+ /** WorkflowBoard: waiting column. */
155
+ waiting: string;
156
+ /** ActivityFeed: empty text. */
157
+ noActivity: string;
158
+ /** SystemCanvas: region label. */
159
+ systemMap: string;
160
+ /** SystemCanvas: zoom out button. */
161
+ zoomOut: string;
162
+ /** SystemCanvas: zoom in button. */
163
+ zoomIn: string;
164
+ /** SystemCanvas: fit button. */
165
+ fitToScreen: string;
166
+ /** SystemCanvas: follow button. */
167
+ followActivity: string;
168
+ /** SystemCanvas legend: menu label. */
169
+ canvasLines: string;
170
+ /** ServiceTokens: title. */
171
+ serviceTokens: string;
172
+ /** ServiceTokens: intro text. */
173
+ serviceTokensIntro: string;
174
+ /** ServiceTokens: loading label. */
175
+ loadingServiceTokens: string;
176
+ /** ServiceTokens: revoke button and confirm label. */
177
+ tokenRevoke: string;
178
+ /** ServiceTokens: revoked tag. */
179
+ tokenRevoked: string;
180
+ /** ServiceTokens: revoked tag title with a time. */
181
+ tokenRevokedAt: (when: string) => string;
182
+ /** ServiceTokens: revoke button aria label. */
183
+ tokenRevokeNamed: (name: string) => string;
184
+ /** ServiceTokens: confirm dialog title. */
185
+ tokenRevokeTitle: (name: string) => string;
186
+ /** ServiceTokens: revoke failure with no message. */
187
+ tokenRevokeFailed: string;
188
+ /** Inbox: mark-handled action. */
189
+ inboxMarkHandled: string;
190
+ /** Inbox: snooze action. */
191
+ inboxSnooze: string;
192
+ /** Inbox: row actions menu. */
193
+ inboxActions: string;
194
+ /** Inbox: tab list label. */
195
+ inboxViews: string;
196
+ /** Inbox: Open tab. */
197
+ inboxOpen: string;
198
+ /** Inbox: Snoozed tab. */
199
+ inboxSnoozed: string;
200
+ /** Inbox: Handled tab. */
201
+ inboxHandled: string;
202
+ /** Inbox: source chip group label. */
203
+ inboxFilterBySource: string;
204
+ /** Inbox: repeat count aria label. */
205
+ inboxHappened: (count: number) => string;
206
+ /** Pagination: previous button. */
207
+ previousPage: string;
208
+ /** Pagination: next button. */
209
+ nextPage: string;
210
+ /** Pagination: page button aria label. */
211
+ pageLabel: (n: number) => string;
212
+ /** Pagination: nav landmark. */
213
+ paginationLabel: string;
214
+ /** Breadcrumbs: nav landmark. */
215
+ breadcrumbs: string;
216
+ /** TagInput: remove button aria label. */
217
+ removeTag: (tag: string) => string;
218
+ /** FileDropzone: drop area text. */
219
+ dropzoneLabel: string;
220
+ /** FileDropzone: browse button. */
221
+ browseFiles: string;
222
+ /** FileDropzone: remove button aria label. */
223
+ removeFile: (name: string) => string;
224
+ /** Avatar: fallback image label. */
225
+ avatar: string;
226
+ /** AvatarGroup: overflow badge aria label. */
227
+ avatarMore: (count: number) => string;
228
+ /** Slider: minimum thumb label on a range. */
229
+ sliderMin: string;
230
+ /** Slider: maximum thumb label on a range. */
231
+ sliderMax: string;
232
+ /** Accordion: group label. */
233
+ accordion: string;
234
+ /** Progress: label of an indeterminate bar. */
235
+ progressIndeterminate: string;
236
+ }
237
+
9
238
  /** Theme switching shared by every nish.software page.
10
239
  *
11
240
  * The choice ('system' or a theme name) lives in a `nish-theme` cookie on
@@ -26,6 +255,7 @@ interface ThemePreset {
26
255
  colors: Record<string, string>;
27
256
  }
28
257
  declare const PRESETS: ThemePreset[];
258
+ type Listener = (choice: ThemeChoice, theme: ThemeName) => void;
29
259
  /** Let an app offer its own themes next to the shared ones. Call it before
30
260
  * initTheme(), and set the same map on window.__nishExtraThemes before theme-init.js
31
261
  * runs, so the first paint knows them too. */
@@ -42,7 +272,6 @@ declare function applyTheme(choice?: ThemeChoice): ThemeName;
42
272
  declare function setThemeChoice(choice: ThemeChoice): ThemeName;
43
273
  /** Current value of a token on <html>, e.g. readToken('chart-1') for canvas charts. */
44
274
  declare function readToken(name: string): string;
45
- type Listener = (choice: ThemeChoice, theme: ThemeName) => void;
46
275
  /** Subscribe to theme changes; returns an unsubscribe function. */
47
276
  declare function onThemeChange(fn: Listener): () => void;
48
277
  /** The order a one-button toggle steps through. */
@@ -56,6 +285,11 @@ interface MountThemeToggleOptions {
56
285
  /** Replace the words "System", "Light" and "Dark" in the button's label, e.g. for
57
286
  * another language. The label reads "Theme: Light. Switch to Dark". */
58
287
  labels?: ThemeToggleLabels;
288
+ /** Replace the label sentence: `themeToggleLabel(current, next)`. Defaults to DEFAULT_STRINGS. */
289
+ strings?: Partial<Pick<NishStrings, 'themeToggleLabel'>>;
290
+ /** The words after a preset saved on another site: "Theme: Mocha (set on another site). …".
291
+ * Default "set on another site". */
292
+ elsewhereLabel?: string;
59
293
  /** Also show the current choice as a word after the icon (System, Light, Dark, or a
60
294
  * preset's name such as "Mocha" when one was saved on another site): a
61
295
  * <span data-theme-word aria-hidden="true">, kept in sync on click and on theme
@@ -89,14 +323,17 @@ interface ShowToastOptions {
89
323
  * user can reach a link inside it. */
90
324
  duration?: number | 'sticky';
91
325
  /** One text action after the message: a link (href) or a button (onClick). Clicking
92
- * it hides the toast. */
326
+ * it hides the toast. An href goes through safeUrl(): a javascript: or data: URL
327
+ * drops the action. */
93
328
  action?: {
94
329
  label: string;
95
330
  href?: string;
96
331
  onClick?: () => void;
97
332
  };
98
- /** Accessible name of the dismiss button. Default "Dismiss". */
333
+ /** Accessible name of the dismiss button. Default DEFAULT_STRINGS.dismiss ("Dismiss"). */
99
334
  dismissLabel?: string;
335
+ /** Strings for this toast (another language): `dismiss`. `dismissLabel` wins when both are given. */
336
+ strings?: Partial<Pick<NishStrings, 'dismiss'>>;
100
337
  }
101
338
  /** Show one toast on a static page: a .nish-toast inside a single role="status"
102
339
  * aria-live="polite" region (created on first use). A new toast replaces the one on
@@ -111,8 +348,10 @@ interface ConfirmDialogOptions {
111
348
  body?: string | Node;
112
349
  /** The confirm button's label: a verb that names the action. Default "Confirm". */
113
350
  confirmLabel?: string;
114
- /** The cancel button's label. Default "Cancel". */
351
+ /** The cancel button's label. Default DEFAULT_STRINGS.cancel ("Cancel"). */
115
352
  cancelLabel?: string;
353
+ /** Strings for this dialog (another language): `cancel`. `cancelLabel` wins when both are given. */
354
+ strings?: Partial<Pick<NishStrings, 'cancel'>>;
116
355
  /** danger: a red confirm button, and focus starts on Cancel (as in the React
117
356
  * ConfirmDialog). Without it: an accent confirm button that takes the first focus. */
118
357
  tone?: 'danger' | 'primary';