@nibapp/ui 0.0.0-stage → 0.1.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 (292) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/LICENSE +21 -0
  3. package/README.md +124 -2
  4. package/TRADEMARKS.md +22 -0
  5. package/dist/_bundled/money/index.d.ts +98 -0
  6. package/dist/_bundled/money/index.js +152 -0
  7. package/dist/_bundled/tokens/index.d.ts +2 -0
  8. package/dist/_bundled/tokens/index.js +2 -0
  9. package/dist/_bundled/tokens/palette.gen.d.ts +51 -0
  10. package/dist/_bundled/tokens/palette.gen.js +206 -0
  11. package/dist/_bundled/tokens/spec.d.ts +291 -0
  12. package/dist/_bundled/tokens/spec.js +221 -0
  13. package/dist/components/accordion.d.ts +27 -0
  14. package/dist/components/accordion.js +66 -0
  15. package/dist/components/alert-dialog.d.ts +59 -0
  16. package/dist/components/alert-dialog.js +82 -0
  17. package/dist/components/alert.d.ts +141 -0
  18. package/dist/components/alert.js +55 -0
  19. package/dist/components/appear.d.ts +21 -0
  20. package/dist/components/appear.js +42 -0
  21. package/dist/components/avatar.d.ts +196 -0
  22. package/dist/components/avatar.js +135 -0
  23. package/dist/components/badge.d.ts +183 -0
  24. package/dist/components/badge.js +68 -0
  25. package/dist/components/block-stack.d.ts +33 -0
  26. package/dist/components/block-stack.js +197 -0
  27. package/dist/components/button.d.ts +327 -0
  28. package/dist/components/button.js +101 -0
  29. package/dist/components/card.d.ts +131 -0
  30. package/dist/components/card.js +100 -0
  31. package/dist/components/checkbox.d.ts +34 -0
  32. package/dist/components/checkbox.js +37 -0
  33. package/dist/components/choice-row.d.ts +104 -0
  34. package/dist/components/choice-row.js +56 -0
  35. package/dist/components/clamped-text.d.ts +17 -0
  36. package/dist/components/clamped-text.js +47 -0
  37. package/dist/components/code-block.d.ts +48 -0
  38. package/dist/components/code-block.js +124 -0
  39. package/dist/components/code-input.d.ts +49 -0
  40. package/dist/components/code-input.js +59 -0
  41. package/dist/components/combobox.d.ts +194 -0
  42. package/dist/components/combobox.js +176 -0
  43. package/dist/components/command-palette.d.ts +57 -0
  44. package/dist/components/command-palette.js +83 -0
  45. package/dist/components/context-menu.d.ts +24 -0
  46. package/dist/components/context-menu.js +30 -0
  47. package/dist/components/copy-button.d.ts +9 -0
  48. package/dist/components/copy-button.js +20 -0
  49. package/dist/components/copy-command.d.ts +18 -0
  50. package/dist/components/copy-command.js +19 -0
  51. package/dist/components/data-table.d.ts +240 -0
  52. package/dist/components/data-table.js +63 -0
  53. package/dist/components/dialog.d.ts +80 -0
  54. package/dist/components/dialog.js +85 -0
  55. package/dist/components/diff-lines.d.ts +20 -0
  56. package/dist/components/diff-lines.js +10 -0
  57. package/dist/components/diff-view.d.ts +128 -0
  58. package/dist/components/diff-view.js +675 -0
  59. package/dist/components/disclosure.d.ts +33 -0
  60. package/dist/components/disclosure.js +51 -0
  61. package/dist/components/drawn-check.d.ts +8 -0
  62. package/dist/components/drawn-check.js +16 -0
  63. package/dist/components/edge-resizer.d.ts +26 -0
  64. package/dist/components/edge-resizer.js +53 -0
  65. package/dist/components/empty-state.d.ts +112 -0
  66. package/dist/components/empty-state.js +56 -0
  67. package/dist/components/expand-toggle.d.ts +19 -0
  68. package/dist/components/expand-toggle.js +10 -0
  69. package/dist/components/field.d.ts +48 -0
  70. package/dist/components/field.js +60 -0
  71. package/dist/components/filter-chip.d.ts +47 -0
  72. package/dist/components/filter-chip.js +33 -0
  73. package/dist/components/group.d.ts +10 -0
  74. package/dist/components/group.js +9 -0
  75. package/dist/components/icon-text.d.ts +11 -0
  76. package/dist/components/icon-text.js +10 -0
  77. package/dist/components/image-sources.d.ts +57 -0
  78. package/dist/components/image-sources.js +58 -0
  79. package/dist/components/image-thumbnail.d.ts +34 -0
  80. package/dist/components/image-thumbnail.js +58 -0
  81. package/dist/components/image-viewer.d.ts +60 -0
  82. package/dist/components/image-viewer.js +411 -0
  83. package/dist/components/inline-edit.d.ts +22 -0
  84. package/dist/components/inline-edit.js +51 -0
  85. package/dist/components/input.d.ts +155 -0
  86. package/dist/components/input.js +109 -0
  87. package/dist/components/item-label.d.ts +11 -0
  88. package/dist/components/item-label.js +5 -0
  89. package/dist/components/item-row.d.ts +23 -0
  90. package/dist/components/item-row.js +19 -0
  91. package/dist/components/kbd.d.ts +55 -0
  92. package/dist/components/kbd.js +86 -0
  93. package/dist/components/link-policy.d.ts +24 -0
  94. package/dist/components/link-policy.js +32 -0
  95. package/dist/components/linked-text.d.ts +15 -0
  96. package/dist/components/linked-text.js +48 -0
  97. package/dist/components/loading-region.d.ts +18 -0
  98. package/dist/components/loading-region.js +17 -0
  99. package/dist/components/markdown.d.ts +34 -0
  100. package/dist/components/markdown.js +307 -0
  101. package/dist/components/menu.d.ts +132 -0
  102. package/dist/components/menu.js +102 -0
  103. package/dist/components/message-bubble.d.ts +57 -0
  104. package/dist/components/message-bubble.js +28 -0
  105. package/dist/components/meta-line.d.ts +28 -0
  106. package/dist/components/meta-line.js +36 -0
  107. package/dist/components/money-input.d.ts +23 -0
  108. package/dist/components/money-input.js +34 -0
  109. package/dist/components/native-select.d.ts +120 -0
  110. package/dist/components/native-select.js +85 -0
  111. package/dist/components/page-trail.d.ts +30 -0
  112. package/dist/components/page-trail.js +43 -0
  113. package/dist/components/page.d.ts +80 -0
  114. package/dist/components/page.js +60 -0
  115. package/dist/components/path-text.d.ts +8 -0
  116. package/dist/components/path-text.js +11 -0
  117. package/dist/components/percent-input.d.ts +20 -0
  118. package/dist/components/percent-input.js +32 -0
  119. package/dist/components/popover.d.ts +52 -0
  120. package/dist/components/popover.js +36 -0
  121. package/dist/components/progress.d.ts +389 -0
  122. package/dist/components/progress.js +142 -0
  123. package/dist/components/radio.d.ts +65 -0
  124. package/dist/components/radio.js +54 -0
  125. package/dist/components/remote-image-gate.d.ts +34 -0
  126. package/dist/components/remote-image-gate.js +60 -0
  127. package/dist/components/resizable.d.ts +23 -0
  128. package/dist/components/resizable.js +30 -0
  129. package/dist/components/rolling-number.d.ts +13 -0
  130. package/dist/components/rolling-number.js +69 -0
  131. package/dist/components/scroll-area.d.ts +17 -0
  132. package/dist/components/scroll-area.js +25 -0
  133. package/dist/components/section-label.d.ts +10 -0
  134. package/dist/components/section-label.js +21 -0
  135. package/dist/components/section-nav.d.ts +22 -0
  136. package/dist/components/section-nav.js +80 -0
  137. package/dist/components/segmented-control.d.ts +125 -0
  138. package/dist/components/segmented-control.js +101 -0
  139. package/dist/components/select.d.ts +120 -0
  140. package/dist/components/select.js +89 -0
  141. package/dist/components/separator.d.ts +10 -0
  142. package/dist/components/separator.js +12 -0
  143. package/dist/components/sheet.d.ts +101 -0
  144. package/dist/components/sheet.js +129 -0
  145. package/dist/components/shortcut-recorder.d.ts +31 -0
  146. package/dist/components/shortcut-recorder.js +67 -0
  147. package/dist/components/skeleton.d.ts +31 -0
  148. package/dist/components/skeleton.js +33 -0
  149. package/dist/components/slider.d.ts +138 -0
  150. package/dist/components/slider.js +98 -0
  151. package/dist/components/spinner.d.ts +37 -0
  152. package/dist/components/spinner.js +16 -0
  153. package/dist/components/switch.d.ts +59 -0
  154. package/dist/components/switch.js +56 -0
  155. package/dist/components/tab-strip.d.ts +29 -0
  156. package/dist/components/tab-strip.js +42 -0
  157. package/dist/components/tabs.d.ts +13 -0
  158. package/dist/components/tabs.js +68 -0
  159. package/dist/components/text-link.d.ts +54 -0
  160. package/dist/components/text-link.js +38 -0
  161. package/dist/components/textarea.d.ts +75 -0
  162. package/dist/components/textarea.js +90 -0
  163. package/dist/components/toast.d.ts +74 -0
  164. package/dist/components/toast.js +128 -0
  165. package/dist/components/tooltip.d.ts +50 -0
  166. package/dist/components/tooltip.js +46 -0
  167. package/dist/components/truncated-text.d.ts +15 -0
  168. package/dist/components/truncated-text.js +19 -0
  169. package/dist/i18n/defaults.d.ts +7 -0
  170. package/dist/i18n/defaults.js +7 -0
  171. package/dist/i18n/format.d.ts +84 -0
  172. package/dist/i18n/format.js +169 -0
  173. package/dist/i18n/index.d.ts +6 -0
  174. package/dist/i18n/index.js +8 -0
  175. package/dist/i18n/locales/ru-formatters.d.ts +3 -0
  176. package/dist/i18n/locales/ru-formatters.js +22 -0
  177. package/dist/i18n/locales/ru.d.ts +5 -0
  178. package/dist/i18n/locales/ru.js +185 -0
  179. package/dist/i18n/plural.d.ts +20 -0
  180. package/dist/i18n/plural.js +26 -0
  181. package/dist/i18n/provider.d.ts +36 -0
  182. package/dist/i18n/provider.js +39 -0
  183. package/dist/i18n/rich.d.ts +14 -0
  184. package/dist/i18n/rich.js +44 -0
  185. package/dist/i18n/ru-plural.d.ts +3 -0
  186. package/dist/i18n/ru-plural.js +4 -0
  187. package/dist/i18n/strings/alert-dialog.d.ts +5 -0
  188. package/dist/i18n/strings/alert-dialog.js +5 -0
  189. package/dist/i18n/strings/block-stack.d.ts +17 -0
  190. package/dist/i18n/strings/block-stack.js +11 -0
  191. package/dist/i18n/strings/code-block.d.ts +18 -0
  192. package/dist/i18n/strings/code-block.js +13 -0
  193. package/dist/i18n/strings/combobox.d.ts +12 -0
  194. package/dist/i18n/strings/combobox.js +10 -0
  195. package/dist/i18n/strings/command-palette.d.ts +17 -0
  196. package/dist/i18n/strings/command-palette.js +11 -0
  197. package/dist/i18n/strings/diff-view.d.ts +92 -0
  198. package/dist/i18n/strings/diff-view.js +68 -0
  199. package/dist/i18n/strings/image-viewer.d.ts +43 -0
  200. package/dist/i18n/strings/image-viewer.js +32 -0
  201. package/dist/i18n/strings/index.d.ts +314 -0
  202. package/dist/i18n/strings/index.js +43 -0
  203. package/dist/i18n/strings/kbd.d.ts +42 -0
  204. package/dist/i18n/strings/kbd.js +39 -0
  205. package/dist/i18n/strings/markdown.d.ts +23 -0
  206. package/dist/i18n/strings/markdown.js +18 -0
  207. package/dist/i18n/strings/money.d.ts +7 -0
  208. package/dist/i18n/strings/money.js +5 -0
  209. package/dist/i18n/strings/primitives.d.ts +25 -0
  210. package/dist/i18n/strings/primitives.js +18 -0
  211. package/dist/i18n/strings/progress.d.ts +4 -0
  212. package/dist/i18n/strings/progress.js +4 -0
  213. package/dist/i18n/strings/shortcut-recorder.d.ts +15 -0
  214. package/dist/i18n/strings/shortcut-recorder.js +11 -0
  215. package/dist/i18n/strings/time.d.ts +41 -0
  216. package/dist/i18n/strings/time.js +20 -0
  217. package/dist/i18n/strings/toast.d.ts +6 -0
  218. package/dist/i18n/strings/toast.js +6 -0
  219. package/dist/i18n/time-zones.d.ts +20 -0
  220. package/dist/i18n/time-zones.js +64 -0
  221. package/dist/index.d.ts +84 -0
  222. package/dist/index.js +88 -0
  223. package/dist/lib/ansi.d.ts +55 -0
  224. package/dist/lib/ansi.js +438 -0
  225. package/dist/lib/clock.d.ts +32 -0
  226. package/dist/lib/clock.js +106 -0
  227. package/dist/lib/cn.d.ts +12 -0
  228. package/dist/lib/cn.js +28 -0
  229. package/dist/lib/control-props.d.ts +21 -0
  230. package/dist/lib/control-props.js +14 -0
  231. package/dist/lib/direction.d.ts +13 -0
  232. package/dist/lib/direction.js +25 -0
  233. package/dist/lib/image-size.d.ts +12 -0
  234. package/dist/lib/image-size.js +66 -0
  235. package/dist/lib/keycaps.d.ts +21 -0
  236. package/dist/lib/keycaps.js +62 -0
  237. package/dist/lib/keyed.d.ts +9 -0
  238. package/dist/lib/keyed.js +14 -0
  239. package/dist/lib/keys.d.ts +49 -0
  240. package/dist/lib/keys.js +159 -0
  241. package/dist/lib/kit-motion.d.ts +9 -0
  242. package/dist/lib/kit-motion.js +12 -0
  243. package/dist/lib/link-check-dialog.d.ts +11 -0
  244. package/dist/lib/link-check-dialog.js +18 -0
  245. package/dist/lib/motion-features.d.ts +1 -0
  246. package/dist/lib/motion-features.js +4 -0
  247. package/dist/lib/motion-provider.d.ts +5 -0
  248. package/dist/lib/motion-provider.js +8 -0
  249. package/dist/lib/motion.d.ts +39 -0
  250. package/dist/lib/motion.js +49 -0
  251. package/dist/lib/number-format.d.ts +114 -0
  252. package/dist/lib/number-format.js +313 -0
  253. package/dist/lib/patch.d.ts +72 -0
  254. package/dist/lib/patch.js +344 -0
  255. package/dist/lib/path.d.ts +34 -0
  256. package/dist/lib/path.js +85 -0
  257. package/dist/lib/search.d.ts +10 -0
  258. package/dist/lib/search.js +20 -0
  259. package/dist/lib/shiki-themes.d.ts +7 -0
  260. package/dist/lib/shiki-themes.js +115 -0
  261. package/dist/lib/shiki.d.ts +101 -0
  262. package/dist/lib/shiki.js +353 -0
  263. package/dist/lib/shortcut-context.d.ts +23 -0
  264. package/dist/lib/shortcut-context.js +29 -0
  265. package/dist/lib/text.d.ts +56 -0
  266. package/dist/lib/text.js +149 -0
  267. package/dist/lib/theme-scope.d.ts +18 -0
  268. package/dist/lib/theme-scope.js +24 -0
  269. package/dist/lib/theme.d.ts +40 -0
  270. package/dist/lib/theme.js +96 -0
  271. package/dist/lib/tree-keys.d.ts +72 -0
  272. package/dist/lib/tree-keys.js +126 -0
  273. package/dist/lib/url.d.ts +17 -0
  274. package/dist/lib/url.js +38 -0
  275. package/dist/lib/use-copy-to-clipboard.d.ts +13 -0
  276. package/dist/lib/use-copy-to-clipboard.js +40 -0
  277. package/dist/lib/use-delayed-loading.d.ts +11 -0
  278. package/dist/lib/use-delayed-loading.js +31 -0
  279. package/dist/lib/use-file-picker.d.ts +26 -0
  280. package/dist/lib/use-file-picker.js +43 -0
  281. package/dist/lib/use-hydrated.d.ts +6 -0
  282. package/dist/lib/use-hydrated.js +11 -0
  283. package/dist/lib/use-latest.d.ts +12 -0
  284. package/dist/lib/use-latest.js +22 -0
  285. package/dist/lib/use-resolved-theme.d.ts +12 -0
  286. package/dist/lib/use-resolved-theme.js +25 -0
  287. package/dist/styles/base.css +393 -0
  288. package/dist/styles/code.css +35 -0
  289. package/dist/styles/fonts.css +12 -0
  290. package/dist/styles/index.css +13 -0
  291. package/dist/styles/tokens.gen.css +494 -0
  292. package/package.json +208 -4
@@ -0,0 +1,39 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { DirectionProvider } from "@base-ui/react/direction-provider";
4
+ import { createContext, use, useMemo } from "react";
5
+ import { useClock } from "../lib/clock.js";
6
+ import { DEFAULT_LOCALE } from "./defaults.js";
7
+ import { createFormatters, englishFormatters } from "./format.js";
8
+ import { EN_UI_STRINGS } from "./strings/index.js";
9
+ // No default value: nothing locale-bound is created at module scope. Without a provider the hooks
10
+ // fall back to English ("en").
11
+ const UiI18nContext = createContext(null);
12
+ /**
13
+ * Localizes every kit component below it: its words (`strings`), formatters for the exact tag in its
14
+ * currency, and the writing direction for Base UI (arrow keys, sliders and popup sides follow it in a
15
+ * right-to-left language). Any language works: pass its table and its direction. Without a provider,
16
+ * components render English with "en-GB" formatting, left to right. Explicit label props on a component
17
+ * always win over these strings.
18
+ */
19
+ export function UiI18nProvider({ locale, strings = EN_UI_STRINGS, timeZone, currency, direction = "ltr", children, }) {
20
+ const value = useMemo(() => ({ locale, strings, formatters: createFormatters(locale, strings, timeZone, currency) }), [locale, strings, timeZone, currency]);
21
+ return (_jsx(UiI18nContext, { value: value, children: _jsx(DirectionProvider, { direction: direction, children: children }) }));
22
+ }
23
+ /** The provider's strings; English without one. */
24
+ export function useUiStrings() {
25
+ return use(UiI18nContext)?.strings ?? EN_UI_STRINGS;
26
+ }
27
+ /** Exactly the BCP 47 tag the provider was given ("ru-RU", "en-US"); the default language without one. */
28
+ export function useUiLocale() {
29
+ return use(UiI18nContext)?.locale ?? DEFAULT_LOCALE;
30
+ }
31
+ /** Count, money, percent, duration, relative-time and date formatters for the provider's locale. */
32
+ export function useFormatters() {
33
+ const context = use(UiI18nContext);
34
+ const clock = useClock();
35
+ const fallback = useMemo(() => (context === null ? englishFormatters() : undefined), [context]);
36
+ const formatters = context?.formatters ?? fallback ?? englishFormatters();
37
+ // A relative time given no "now" reads the kit's one clock, so a pinned clock pins it too.
38
+ return useMemo(() => ({ ...formatters, relativeTime: (at, now = clock.now()) => formatters.relativeTime(at, now) }), [formatters, clock]);
39
+ }
@@ -0,0 +1,14 @@
1
+ import { type ReactNode } from "react";
2
+ /** A message's params for `richText`: numeric params stay numbers, string params may be React nodes. */
3
+ export type RichParams<P extends Record<string, string | number>> = {
4
+ readonly [K in keyof P]: P[K] extends number ? number : ReactNode;
5
+ };
6
+ /**
7
+ * Renders a string message with React nodes in its placeholders. Messages stay plain
8
+ * `(params) => string` functions (so Paraglide or any ICU catalog can supply them); element params
9
+ * go in as private-use tokens and are swapped back in after the message ran. String params pass
10
+ * straight through; numeric params (plural selectors such as `count`) stay numbers.
11
+ *
12
+ * `richText(strings.receipts.cacheSaved, { amount: <Money amount={0.42} />, share: "(61% of input)" })`
13
+ */
14
+ export declare function richText<P extends Record<string, string | number>>(message: (params: P) => string, params: RichParams<P>): ReactNode;
@@ -0,0 +1,44 @@
1
+ import { createElement, Fragment } from "react";
2
+ // Private-use code points: never typed by a translator, and they survive any string interpolation.
3
+ const OPEN = "\uE000";
4
+ const CLOSE = "\uE001";
5
+ const TOKEN = /\uE000([^\uE001]*)\uE001/;
6
+ /**
7
+ * Renders a string message with React nodes in its placeholders. Messages stay plain
8
+ * `(params) => string` functions (so Paraglide or any ICU catalog can supply them); element params
9
+ * go in as private-use tokens and are swapped back in after the message ran. String params pass
10
+ * straight through; numeric params (plural selectors such as `count`) stay numbers.
11
+ *
12
+ * `richText(strings.receipts.cacheSaved, { amount: <Money amount={0.42} />, share: "(61% of input)" })`
13
+ */
14
+ export function richText(message, params) {
15
+ const values = {};
16
+ const nodes = new Map();
17
+ for (const [key, value] of Object.entries(params)) {
18
+ if (typeof value === "string" || typeof value === "number") {
19
+ values[key] = value;
20
+ }
21
+ else {
22
+ values[key] = `${OPEN}${key}${CLOSE}`;
23
+ nodes.set(key, value);
24
+ }
25
+ }
26
+ // `values` matches `P` key for key (numbers where the message takes numbers, else strings); the
27
+ // method-shaped type lets the message take the untyped record without an assertion.
28
+ const run = message;
29
+ const text = run(values);
30
+ if (nodes.size === 0)
31
+ return text;
32
+ // Children passed as arguments (not an array) need no keys.
33
+ const parts = [];
34
+ let rest = text;
35
+ for (let match = TOKEN.exec(rest); match !== null; match = TOKEN.exec(rest)) {
36
+ if (match.index > 0)
37
+ parts.push(rest.slice(0, match.index));
38
+ parts.push(nodes.get(match[1] ?? ""));
39
+ rest = rest.slice(match.index + match[0].length);
40
+ }
41
+ if (rest !== "")
42
+ parts.push(rest);
43
+ return createElement(Fragment, null, ...parts);
44
+ }
@@ -0,0 +1,3 @@
1
+ /** "# файл / # файла / # файлов": `few` doubles as `other` (fractions). */
2
+ export declare const ru: (count: number, one: string, few: string, many: string) => string;
3
+ export declare const NBSP = "\u00A0";
@@ -0,0 +1,4 @@
1
+ import { plural } from "./plural.js";
2
+ /** "# файл / # файла / # файлов": `few` doubles as `other` (fractions). */
3
+ export const ru = (count, one, few, many) => plural("ru", count, { one, few, many, other: few });
4
+ export const NBSP = "\u00A0";
@@ -0,0 +1,5 @@
1
+ /** `alertDialog.*`: the default actions of `AlertDialog` (its `confirmLabel` / `cancelLabel` props win). */
2
+ export declare const alertDialog: {
3
+ confirm: string;
4
+ cancel: string;
5
+ };
@@ -0,0 +1,5 @@
1
+ /** `alertDialog.*`: the default actions of `AlertDialog` (its `confirmLabel` / `cancelLabel` props win). */
2
+ export const alertDialog = {
3
+ confirm: "Confirm",
4
+ cancel: "Cancel",
5
+ };
@@ -0,0 +1,17 @@
1
+ /** `blockStack.*`: a panel's collapsible, reorderable blocks (`BlockStack`). */
2
+ export declare const blockStack: {
3
+ /** The grip's name. */
4
+ reorder: (p: {
5
+ title: string;
6
+ }) => string;
7
+ /** What the grip is, said in place of "button" (`aria-roledescription`). */
8
+ grip: string;
9
+ /** How to move a block, read after the grip's name. */
10
+ reorderHint: string;
11
+ /** Said after a block moved. */
12
+ moved: (p: {
13
+ title: string;
14
+ position: number;
15
+ count: number;
16
+ }) => string;
17
+ };
@@ -0,0 +1,11 @@
1
+ /** `blockStack.*`: a panel's collapsible, reorderable blocks (`BlockStack`). */
2
+ export const blockStack = {
3
+ /** The grip's name. */
4
+ reorder: (p) => `Move ${p.title}`,
5
+ /** What the grip is, said in place of "button" (`aria-roledescription`). */
6
+ grip: "sortable",
7
+ /** How to move a block, read after the grip's name. */
8
+ reorderHint: "Drag, or use the up and down arrow keys.",
9
+ /** Said after a block moved. */
10
+ moved: (p) => `${p.title} moved to position ${p.position} of ${p.count}.`,
11
+ };
@@ -0,0 +1,18 @@
1
+ /** `codeBlock.*`: <CodeBlock>'s copy control, the shared <CopyButton> and <CopyCommand>. */
2
+ export declare const codeBlock: {
3
+ /** <CopyButton>'s default label; a `label` prop wins. */
4
+ copy: string;
5
+ /** Tooltip and label right after copying. */
6
+ copied: string;
7
+ /** What a screen reader hears once the text is copied. */
8
+ copiedAnnouncement: string;
9
+ /** <CopyCommand>'s name: what it copies, then the command it shows (a name holds its visible text). */
10
+ copyCommand: (p: {
11
+ command: string;
12
+ }) => string;
13
+ copyLabelledCommand: (p: {
14
+ label: string;
15
+ command: string;
16
+ }) => string;
17
+ copyCode: string;
18
+ };
@@ -0,0 +1,13 @@
1
+ /** `codeBlock.*`: <CodeBlock>'s copy control, the shared <CopyButton> and <CopyCommand>. */
2
+ export const codeBlock = {
3
+ /** <CopyButton>'s default label; a `label` prop wins. */
4
+ copy: "Copy",
5
+ /** Tooltip and label right after copying. */
6
+ copied: "Copied",
7
+ /** What a screen reader hears once the text is copied. */
8
+ copiedAnnouncement: "Copied to clipboard",
9
+ /** <CopyCommand>'s name: what it copies, then the command it shows (a name holds its visible text). */
10
+ copyCommand: (p) => `Copy ${p.command}`,
11
+ copyLabelledCommand: (p) => `${p.label}: ${p.command}`,
12
+ copyCode: "Copy code",
13
+ };
@@ -0,0 +1,12 @@
1
+ /** `combobox.*`: the field's buttons, chip removal and the empty list. */
2
+ export declare const combobox: {
3
+ clearSelection: string;
4
+ showOptions: string;
5
+ /** A chip's remove button when its label isn't plain text. */
6
+ remove: string;
7
+ removeItem: (p: {
8
+ label: string;
9
+ }) => string;
10
+ /** `Combobox` `emptyMessage` default. */
11
+ noMatches: string;
12
+ };
@@ -0,0 +1,10 @@
1
+ /** `combobox.*`: the field's buttons, chip removal and the empty list. */
2
+ export const combobox = {
3
+ clearSelection: "Clear selection",
4
+ showOptions: "Show options",
5
+ /** A chip's remove button when its label isn't plain text. */
6
+ remove: "Remove",
7
+ removeItem: (p) => `Remove ${p.label}`,
8
+ /** `Combobox` `emptyMessage` default. */
9
+ noMatches: "No matches",
10
+ };
@@ -0,0 +1,17 @@
1
+ /** `commandPalette.*`: the launcher's search, loading and empty states, and the footer hints. */
2
+ export declare const commandPalette: {
3
+ placeholder: string;
4
+ /** Accessible name of the dialog and listbox. */
5
+ label: string;
6
+ loadingResults: string;
7
+ searching: string;
8
+ noResults: string;
9
+ nothingMatches: (p: {
10
+ query: string;
11
+ }) => string;
12
+ hints: {
13
+ navigate: string;
14
+ select: string;
15
+ close: string;
16
+ };
17
+ };
@@ -0,0 +1,11 @@
1
+ /** `commandPalette.*`: the launcher's search, loading and empty states, and the footer hints. */
2
+ export const commandPalette = {
3
+ placeholder: "Type a command or search…",
4
+ /** Accessible name of the dialog and listbox. */
5
+ label: "Command palette",
6
+ loadingResults: "Loading results",
7
+ searching: "Searching…",
8
+ noResults: "No results",
9
+ nothingMatches: (p) => `Nothing matches “${p.query}”. Try a different word.`,
10
+ hints: { navigate: "Navigate", select: "Select", close: "Close" },
11
+ };
@@ -0,0 +1,92 @@
1
+ type Hunk = {
2
+ index: number;
3
+ };
4
+ /** `diffView.*`: <DiffView>'s header, hunk toolbars and inline review comments. */
5
+ export declare const diffView: {
6
+ /** Badge next to the path for whole-file changes. */
7
+ changeKinds: {
8
+ new: string;
9
+ deleted: string;
10
+ renamed: string;
11
+ };
12
+ /** <DiffStat>'s spoken summary (the visible "+12 −3" is aria-hidden). */
13
+ stats: (p: {
14
+ additions: number;
15
+ deletions: number;
16
+ }) => string;
17
+ expandFile: (p: {
18
+ path: string;
19
+ }) => string;
20
+ collapseFile: (p: {
21
+ path: string;
22
+ }) => string;
23
+ copyFile: string;
24
+ copyPatch: string;
25
+ /** The "show unchanged lines" toggle: its name, and its tooltip in each state. */
26
+ showUnchangedLines: string;
27
+ showAllLines: string;
28
+ collapseUnchangedLines: string;
29
+ /** The soft-wrap toggle: its name, and its tooltip in each state. */
30
+ softWrap: string;
31
+ wrapLines: string;
32
+ unwrapLines: string;
33
+ /** The layout toggle names the layout it switches to. */
34
+ splitView: string;
35
+ unifiedView: string;
36
+ switchToSplit: string;
37
+ switchToUnified: string;
38
+ /** The expand buttons between hunks, by the way they open. */
39
+ expandLines: {
40
+ up: string;
41
+ down: string;
42
+ both: string;
43
+ };
44
+ noChanges: string;
45
+ nothingToCompare: string;
46
+ hunk: {
47
+ /** The toolbar's accessible name. */
48
+ label: (p: Hunk & {
49
+ total: number;
50
+ }) => string;
51
+ /** Its compact visible position. */
52
+ position: (p: Hunk & {
53
+ total: number;
54
+ }) => string;
55
+ ask: string;
56
+ askLabel: (p: Hunk) => string;
57
+ comment: string;
58
+ commentLabel: (p: Hunk) => string;
59
+ revert: string;
60
+ revertLabel: (p: Hunk) => string;
61
+ accept: string;
62
+ acceptLabel: (p: Hunk) => string;
63
+ accepted: string;
64
+ reverted: string;
65
+ };
66
+ comment: {
67
+ /** Author shown when a comment has none (the local reviewer). */
68
+ you: string;
69
+ /** After the author: "You · line 12". */
70
+ line: (p: {
71
+ line: number;
72
+ }) => string;
73
+ remove: (p: {
74
+ line: number;
75
+ }) => string;
76
+ /** The inline composer's accessible name, per side of the diff. */
77
+ onOldLine: (p: {
78
+ line: number;
79
+ }) => string;
80
+ onNewLine: (p: {
81
+ line: number;
82
+ }) => string;
83
+ placeholder: string;
84
+ /** The key hint; `keys` renders as the ⌘↵ keycaps: "⌘↵ to add". */
85
+ toAdd: (p: {
86
+ keys: string;
87
+ }) => string;
88
+ cancel: string;
89
+ submit: string;
90
+ };
91
+ };
92
+ export {};
@@ -0,0 +1,68 @@
1
+ import { plural } from "../plural.js";
2
+ /** `diffView.*`: <DiffView>'s header, hunk toolbars and inline review comments. */
3
+ export const diffView = {
4
+ /** Badge next to the path for whole-file changes. */
5
+ changeKinds: {
6
+ new: "New",
7
+ deleted: "Deleted",
8
+ renamed: "Renamed",
9
+ },
10
+ /** <DiffStat>'s spoken summary (the visible "+12 −3" is aria-hidden). */
11
+ stats: (p) => `${plural("en", p.additions, { one: "# line added", other: "# lines added" })}, ${plural("en", p.deletions, { one: "# line removed", other: "# lines removed" })}`,
12
+ expandFile: (p) => `Expand ${p.path}`,
13
+ collapseFile: (p) => `Collapse ${p.path}`,
14
+ copyFile: "Copy file",
15
+ copyPatch: "Copy patch",
16
+ /** The "show unchanged lines" toggle: its name, and its tooltip in each state. */
17
+ showUnchangedLines: "Show unchanged lines",
18
+ showAllLines: "Show all lines",
19
+ collapseUnchangedLines: "Collapse unchanged lines",
20
+ /** The soft-wrap toggle: its name, and its tooltip in each state. */
21
+ softWrap: "Soft wrap",
22
+ wrapLines: "Wrap long lines",
23
+ unwrapLines: "Don't wrap lines",
24
+ /** The layout toggle names the layout it switches to. */
25
+ splitView: "Split view",
26
+ unifiedView: "Unified view",
27
+ switchToSplit: "Switch to split view",
28
+ switchToUnified: "Switch to unified view",
29
+ /** The expand buttons between hunks, by the way they open. */
30
+ expandLines: {
31
+ up: "Show the lines above",
32
+ down: "Show the lines below",
33
+ both: "Show the hidden lines",
34
+ },
35
+ noChanges: "No changes.",
36
+ nothingToCompare: "Nothing to compare.",
37
+ hunk: {
38
+ /** The toolbar's accessible name. */
39
+ label: (p) => `Hunk ${p.index} of ${p.total}`,
40
+ /** Its compact visible position. */
41
+ position: (p) => `Hunk ${p.index}/${p.total}`,
42
+ ask: "Ask",
43
+ askLabel: (p) => `Ask about hunk ${p.index}`,
44
+ comment: "Comment",
45
+ commentLabel: (p) => `Comment on hunk ${p.index}`,
46
+ revert: "Revert",
47
+ revertLabel: (p) => `Revert hunk ${p.index}`,
48
+ accept: "Accept",
49
+ acceptLabel: (p) => `Accept hunk ${p.index}`,
50
+ accepted: "Accepted",
51
+ reverted: "Reverted",
52
+ },
53
+ comment: {
54
+ /** Author shown when a comment has none (the local reviewer). */
55
+ you: "You",
56
+ /** After the author: "You · line 12". */
57
+ line: (p) => `line ${p.line}`,
58
+ remove: (p) => `Remove comment on line ${p.line}`,
59
+ /** The inline composer's accessible name, per side of the diff. */
60
+ onOldLine: (p) => `Comment on old line ${p.line}`,
61
+ onNewLine: (p) => `Comment on new line ${p.line}`,
62
+ placeholder: "Leave a comment…",
63
+ /** The key hint; `keys` renders as the ⌘↵ keycaps: "⌘↵ to add". */
64
+ toAdd: (p) => `${p.keys} to add`,
65
+ cancel: "Cancel",
66
+ submit: "Comment",
67
+ },
68
+ };
@@ -0,0 +1,43 @@
1
+ /** `imageViewer.*`: images in the transcript (a thumbnail in place) and the viewer a click opens. */
2
+ export declare const imageViewer: {
3
+ /** A thumbnail's button: opens the image full size; `alt` says what it shows. */
4
+ open: (p: {
5
+ alt: string;
6
+ }) => string;
7
+ /** What an image is called when nothing says what it shows. */
8
+ untitled: string;
9
+ /** Where the viewer is among the turn's images: "2 of 5". */
10
+ position: (p: {
11
+ index: number;
12
+ total: number;
13
+ }) => string;
14
+ previous: string;
15
+ next: string;
16
+ zoomIn: string;
17
+ zoomOut: string;
18
+ /** The zoom button while the image is at another size: back to the whole image in the window. */
19
+ fit: string;
20
+ /** The zoom button while the image fits the window: one image pixel to one screen pixel. */
21
+ actualSize: string;
22
+ copy: string;
23
+ copied: string;
24
+ copyFailed: string;
25
+ save: string;
26
+ /** Placeholder while the image is on its way. */
27
+ loading: string;
28
+ /** The image couldn't be loaded (missing, unreadable, refused). */
29
+ failed: string;
30
+ /** The image is over what the transcript shows; `size` is its size ("12 MB"), when known. */
31
+ tooLarge: (p: {
32
+ size?: string | undefined;
33
+ }) => string;
34
+ /** A remote image in a message: `host` is where it lives; it opens in the browser, never loads here. */
35
+ remote: (p: {
36
+ host: string;
37
+ }) => string;
38
+ /** After a remote image's alt (which may be cut short): where it lives, always shown in full. */
39
+ remoteHost: (p: {
40
+ host: string;
41
+ }) => string;
42
+ openInBrowser: string;
43
+ };
@@ -0,0 +1,32 @@
1
+ /** `imageViewer.*`: images in the transcript (a thumbnail in place) and the viewer a click opens. */
2
+ export const imageViewer = {
3
+ /** A thumbnail's button: opens the image full size; `alt` says what it shows. */
4
+ open: (p) => `Open image: ${p.alt}`,
5
+ /** What an image is called when nothing says what it shows. */
6
+ untitled: "Image",
7
+ /** Where the viewer is among the turn's images: "2 of 5". */
8
+ position: (p) => `${p.index} of ${p.total}`,
9
+ previous: "Previous image",
10
+ next: "Next image",
11
+ zoomIn: "Zoom in",
12
+ zoomOut: "Zoom out",
13
+ /** The zoom button while the image is at another size: back to the whole image in the window. */
14
+ fit: "Fit to window",
15
+ /** The zoom button while the image fits the window: one image pixel to one screen pixel. */
16
+ actualSize: "Actual size",
17
+ copy: "Copy image",
18
+ copied: "Image copied",
19
+ copyFailed: "Couldn't copy the image",
20
+ save: "Save image",
21
+ /** Placeholder while the image is on its way. */
22
+ loading: "Loading image",
23
+ /** The image couldn't be loaded (missing, unreadable, refused). */
24
+ failed: "Couldn't load the image",
25
+ /** The image is over what the transcript shows; `size` is its size ("12 MB"), when known. */
26
+ tooLarge: (p) => p.size === undefined ? "Too large to show here" : `Too large to show here (${p.size})`,
27
+ /** A remote image in a message: `host` is where it lives; it opens in the browser, never loads here. */
28
+ remote: (p) => `Image on ${p.host}`,
29
+ /** After a remote image's alt (which may be cut short): where it lives, always shown in full. */
30
+ remoteHost: (p) => `— image on ${p.host}`,
31
+ openInBrowser: "Open in browser",
32
+ };