@krizaka/ui 3.67.0 → 3.68.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 (267) hide show
  1. package/dist/app-header.d.ts +3 -3
  2. package/dist/app-shell.js +2 -2
  3. package/dist/app-shell.js.map +1 -1
  4. package/dist/chunk-PZ4FJOD5.js +44 -0
  5. package/dist/chunk-PZ4FJOD5.js.map +1 -0
  6. package/dist/{chunk-6BMKLAZ7.js → chunk-Z47KIPCT.js} +7 -2
  7. package/dist/{chunk-6BMKLAZ7.js.map → chunk-Z47KIPCT.js.map} +1 -1
  8. package/dist/copy-button.d.ts +29 -0
  9. package/dist/copy-button.js +56 -0
  10. package/dist/copy-button.js.map +1 -0
  11. package/dist/date-picker.js +2 -1
  12. package/dist/date-picker.js.map +1 -1
  13. package/dist/desktop-window.js.map +1 -1
  14. package/dist/file-upload.d.ts +2 -2
  15. package/dist/filter-bar.d.ts +3 -3
  16. package/dist/flock.js +2 -1
  17. package/dist/flock.js.map +1 -1
  18. package/dist/index.js +3 -3
  19. package/dist/kind-config-editor.js +106 -129
  20. package/dist/kind-config-editor.js.map +1 -1
  21. package/dist/map.d.ts +2 -2
  22. package/dist/map.js +3 -3
  23. package/dist/map.js.map +1 -1
  24. package/dist/money-input.d.ts +29 -0
  25. package/dist/money-input.js +78 -0
  26. package/dist/money-input.js.map +1 -0
  27. package/dist/native/map.d.ts +2 -2
  28. package/dist/native/map.js +3 -3
  29. package/dist/native/map.js.map +1 -1
  30. package/dist/nav-bar.d.ts +28 -4
  31. package/dist/nav-bar.js +31 -14
  32. package/dist/nav-bar.js.map +1 -1
  33. package/dist/promo-code-field.d.ts +38 -0
  34. package/dist/promo-code-field.js +94 -0
  35. package/dist/promo-code-field.js.map +1 -0
  36. package/dist/radio-group.js +1 -1
  37. package/dist/retro-tv.d.ts +39 -4
  38. package/dist/retro-tv.js +217 -40
  39. package/dist/retro-tv.js.map +1 -1
  40. package/dist/status-chip.js +1 -1
  41. package/dist/terminal-replay.js +1 -1
  42. package/package.json +46 -3
  43. package/registry/account-menu.json +1 -1
  44. package/registry/account-settings.json +1 -1
  45. package/registry/achievement.json +1 -1
  46. package/registry/action-bar.json +1 -1
  47. package/registry/activity-feed.json +1 -1
  48. package/registry/agenda.json +1 -1
  49. package/registry/alert.json +1 -1
  50. package/registry/analysis-report.json +1 -1
  51. package/registry/anatomy-plate.json +1 -1
  52. package/registry/app-frame.json +34 -34
  53. package/registry/app-header.json +1 -1
  54. package/registry/app-shell.json +3 -3
  55. package/registry/argument-card.json +1 -1
  56. package/registry/audio-player.json +1 -1
  57. package/registry/auth-layout.json +1 -1
  58. package/registry/avatar.json +1 -1
  59. package/registry/badge.json +1 -1
  60. package/registry/bird-plate.json +1 -1
  61. package/registry/button.json +1 -1
  62. package/registry/captcha.json +1 -1
  63. package/registry/card-grid.json +1 -1
  64. package/registry/card.json +1 -1
  65. package/registry/catalogue-page.json +1 -1
  66. package/registry/changelog-page.json +1 -1
  67. package/registry/chapter.json +1 -1
  68. package/registry/chat.json +1 -1
  69. package/registry/checkbox.json +1 -1
  70. package/registry/chip-link.json +1 -1
  71. package/registry/chip-row.json +1 -1
  72. package/registry/chip.json +1 -1
  73. package/registry/choice-grid.json +1 -1
  74. package/registry/code-block.json +1 -1
  75. package/registry/collection-switcher.json +1 -1
  76. package/registry/combobox.json +1 -1
  77. package/registry/command.json +1 -1
  78. package/registry/comparison-table.json +1 -1
  79. package/registry/component-page.json +1 -1
  80. package/registry/confirm-button.json +1 -1
  81. package/registry/contact-page.json +1 -1
  82. package/registry/continue-prompt.json +1 -1
  83. package/registry/copy-button.json +382 -0
  84. package/registry/countdown.json +1 -1
  85. package/registry/cover-hero.json +1 -1
  86. package/registry/cta-panel.json +1 -1
  87. package/registry/dashboard-layout.json +1 -1
  88. package/registry/data-table.json +1 -1
  89. package/registry/date-picker.json +3 -3
  90. package/registry/decision-list.json +1 -1
  91. package/registry/description-list.json +1 -1
  92. package/registry/desktop-window.json +1 -1
  93. package/registry/detail-layout.json +1 -1
  94. package/registry/dialog.json +1 -1
  95. package/registry/docs-article-page.json +1 -1
  96. package/registry/docs-hub-page.json +1 -1
  97. package/registry/docs-layout.json +1 -1
  98. package/registry/docs-nav.json +1 -1
  99. package/registry/document-viewer.json +1 -1
  100. package/registry/doodle.json +1 -1
  101. package/registry/drop-overlay.json +1 -1
  102. package/registry/dropdown-menu.json +1 -1
  103. package/registry/elephant.json +2 -2
  104. package/registry/embed-facade.json +1 -1
  105. package/registry/empty-state.json +1 -1
  106. package/registry/engine-flow.json +1 -1
  107. package/registry/entity-header.json +1 -1
  108. package/registry/environment-notice.json +1 -1
  109. package/registry/error-page.json +1 -1
  110. package/registry/examples/copy-button/default.d.ts +4 -0
  111. package/registry/examples/copy-button/default.js +11 -0
  112. package/registry/examples/copy-button/default.tsx +7 -0
  113. package/registry/examples/copy-button/icon-only.d.ts +4 -0
  114. package/registry/examples/copy-button/icon-only.js +11 -0
  115. package/registry/examples/copy-button/icon-only.tsx +7 -0
  116. package/registry/examples/money-input/currencies.d.ts +4 -0
  117. package/registry/examples/money-input/currencies.js +18 -0
  118. package/registry/examples/money-input/currencies.tsx +16 -0
  119. package/registry/examples/money-input/default.d.ts +4 -0
  120. package/registry/examples/money-input/default.js +18 -0
  121. package/registry/examples/money-input/default.tsx +16 -0
  122. package/registry/examples/promo-code-field/applied.d.ts +4 -0
  123. package/registry/examples/promo-code-field/applied.js +11 -0
  124. package/registry/examples/promo-code-field/applied.tsx +7 -0
  125. package/registry/examples/promo-code-field/default.d.ts +4 -0
  126. package/registry/examples/promo-code-field/default.js +19 -0
  127. package/registry/examples/promo-code-field/default.tsx +14 -0
  128. package/registry/examples/promo-code-field/expired.d.ts +4 -0
  129. package/registry/examples/promo-code-field/expired.js +11 -0
  130. package/registry/examples/promo-code-field/expired.tsx +7 -0
  131. package/registry/examples/retro-tv/playlist-channel.d.ts +4 -0
  132. package/registry/examples/retro-tv/playlist-channel.js +15 -0
  133. package/registry/examples/retro-tv/playlist-channel.tsx +10 -0
  134. package/registry/examples/retro-tv/playlist-crossfade.d.ts +4 -0
  135. package/registry/examples/retro-tv/playlist-crossfade.js +15 -0
  136. package/registry/examples/retro-tv/playlist-crossfade.tsx +10 -0
  137. package/registry/examples/retro-tv/playlist-slide.d.ts +4 -0
  138. package/registry/examples/retro-tv/playlist-slide.js +15 -0
  139. package/registry/examples/retro-tv/playlist-slide.tsx +10 -0
  140. package/registry/field.json +1 -1
  141. package/registry/file-upload.json +1 -1
  142. package/registry/filter-bar.json +1 -1
  143. package/registry/flock.json +2 -2
  144. package/registry/footnote.json +1 -1
  145. package/registry/force-update-screen.json +1 -1
  146. package/registry/form.json +1 -1
  147. package/registry/gallery-page.json +1 -1
  148. package/registry/genui.json +1 -1
  149. package/registry/glossary-term.json +1 -1
  150. package/registry/glossary.json +1 -1
  151. package/registry/glow-card.json +1 -1
  152. package/registry/goal-gauge.json +1 -1
  153. package/registry/grade-stamp.json +1 -1
  154. package/registry/how-it-works-page.json +1 -1
  155. package/registry/image-cropper.json +1 -1
  156. package/registry/index.json +108 -9
  157. package/registry/iso.json +1 -1
  158. package/registry/kanban.json +1 -1
  159. package/registry/kbd.json +1 -1
  160. package/registry/kind-config-editor.json +1 -1
  161. package/registry/kpi-explained.json +1 -1
  162. package/registry/landing-page.json +1 -1
  163. package/registry/landscape.json +1 -1
  164. package/registry/language-switch.json +1 -1
  165. package/registry/legal-page.json +1 -1
  166. package/registry/link-card.json +1 -1
  167. package/registry/list.json +1 -1
  168. package/registry/loader.json +1 -1
  169. package/registry/longform-page.json +1 -1
  170. package/registry/maintenance-screen.json +1 -1
  171. package/registry/map.json +95 -95
  172. package/registry/margin-layout.json +1 -1
  173. package/registry/markdown.json +1 -1
  174. package/registry/marketing-layout.json +1 -1
  175. package/registry/marquee.json +1 -1
  176. package/registry/mascot-quote.json +1 -1
  177. package/registry/mascot-state.json +1 -1
  178. package/registry/mascots.json +1 -1
  179. package/registry/match-dialog.json +1 -1
  180. package/registry/media-capture.json +1 -1
  181. package/registry/media-gallery.json +1 -1
  182. package/registry/media-grid.json +1 -1
  183. package/registry/meta-row.json +1 -1
  184. package/registry/meter.json +1 -1
  185. package/registry/money-input.json +236 -0
  186. package/registry/nav-bar.json +55 -41
  187. package/registry/next-actions.json +1 -1
  188. package/registry/notification-preferences.json +1 -1
  189. package/registry/number-ticker.json +1 -1
  190. package/registry/opening-hours.json +1 -1
  191. package/registry/page-header.json +1 -1
  192. package/registry/page-hero.json +1 -1
  193. package/registry/page-index.json +1 -1
  194. package/registry/page.json +1 -1
  195. package/registry/pagination.json +1 -1
  196. package/registry/photo-grid.json +1 -1
  197. package/registry/pointer-light.json +1 -1
  198. package/registry/popover.json +1 -1
  199. package/registry/pricing-page.json +1 -1
  200. package/registry/product-page.json +1 -1
  201. package/registry/profile-card.json +1 -1
  202. package/registry/progress.json +1 -1
  203. package/registry/promise-card.json +1 -1
  204. package/registry/promo-code-field.json +258 -0
  205. package/registry/qr-code.json +1 -1
  206. package/registry/quota-meter.json +1 -1
  207. package/registry/radio-group.json +1 -1
  208. package/registry/rail-nav.json +34 -34
  209. package/registry/recipes.json +1 -1
  210. package/registry/retro-tv.json +120 -8
  211. package/registry/reviews.json +1 -1
  212. package/registry/router.json +1 -1
  213. package/registry/scroll-stage.json +1 -1
  214. package/registry/search-field.json +1 -1
  215. package/registry/section-backdrop.json +1 -1
  216. package/registry/separator.json +1 -1
  217. package/registry/service-card.json +1 -1
  218. package/registry/settings-layout.json +1 -1
  219. package/registry/shop-composer.json +1 -1
  220. package/registry/shop.json +2 -2
  221. package/registry/showcase.json +1 -1
  222. package/registry/signature.json +1 -1
  223. package/registry/site-cahier.json +1 -1
  224. package/registry/site-footer.json +34 -34
  225. package/registry/sites.json +1 -1
  226. package/registry/skeleton.json +1 -1
  227. package/registry/skip-link.json +1 -1
  228. package/registry/slider.json +1 -1
  229. package/registry/slot-picker.json +1 -1
  230. package/registry/slot.json +1 -1
  231. package/registry/specimen-tag.json +1 -1
  232. package/registry/speed-lines.json +1 -1
  233. package/registry/spinner.json +1 -1
  234. package/registry/split-view.json +1 -1
  235. package/registry/stage-banner.json +1 -1
  236. package/registry/stat.json +1 -1
  237. package/registry/status-chip.json +1 -1
  238. package/registry/status-page.json +1 -1
  239. package/registry/step-progress.json +1 -1
  240. package/registry/step-showcase.json +1 -1
  241. package/registry/stepper.json +1 -1
  242. package/registry/sticky-action.json +1 -1
  243. package/registry/stuck.json +1 -1
  244. package/registry/swipe-deck.json +1 -1
  245. package/registry/switch.json +1 -1
  246. package/registry/tabs.json +1 -1
  247. package/registry/tag-input.json +1 -1
  248. package/registry/tag-selector.json +1 -1
  249. package/registry/taped-photo.json +1 -1
  250. package/registry/terminal-replay.json +1 -1
  251. package/registry/text-style.json +1 -1
  252. package/registry/theme.json +1 -1
  253. package/registry/toast.json +1 -1
  254. package/registry/toc.json +1 -1
  255. package/registry/tooltip.json +1 -1
  256. package/registry/tree-view.json +1 -1
  257. package/registry/update-prompt.json +1 -1
  258. package/registry/upload-queue.json +1 -1
  259. package/registry/usage.json +1 -1
  260. package/registry/verified-badge.json +1 -1
  261. package/registry/versus-card.json +1 -1
  262. package/registry/vertical-video.json +1 -1
  263. package/registry/video-player.json +1 -1
  264. package/registry/video-trimmer.json +1 -1
  265. package/registry/virtual.json +1 -1
  266. package/registry/wall.json +1 -1
  267. package/registry/waveform.json +1 -1
@@ -0,0 +1,29 @@
1
+ import * as React from 'react';
2
+
3
+ type MoneyInputProps = Omit<React.ComponentProps<"input">, "value" | "defaultValue" | "onChange" | "type" | "inputMode"> & {
4
+ /** The amount in minor units (cents), an integer, or `null` when empty. */
5
+ value: number | null;
6
+ /** Called with the new amount in minor units, or `null` when the field is emptied. */
7
+ onValueChange: (minorUnits: number | null) => void;
8
+ /** ISO 4217 code: `"CAD"`. */
9
+ currency: string;
10
+ /** BCP 47 locale for the separators: `"fr-CA"`, `"en-CA"`. */
11
+ locale: string;
12
+ /** The currencies to choose among (ISO codes). Omitted: the currency is fixed. */
13
+ currencies?: readonly string[];
14
+ /** Called with the chosen currency (required with `currencies`). */
15
+ onCurrencyChange?: (currency: string) => void;
16
+ /** The currency select's accessible name, passed translated: "Currency". */
17
+ currencyLabel?: string;
18
+ /** Marks the amount invalid (pair it with a `Field.Error`). */
19
+ invalid?: boolean;
20
+ };
21
+ /** "12,50" → 1250 without a float; `undefined` when the text is not an amount or has too many decimals. */
22
+ declare function parseMinorUnits(text: string, locale: string, digits: number): number | null | undefined;
23
+ /** Minor units → "1 234,50" in the locale, exact (BigInt), padded to the currency's decimals. */
24
+ declare function formatMinorUnits(minor: number, locale: string, digits: number): string;
25
+ /** An amount field in minor units. The caller holds an integer; the person sees their locale's decimal. */
26
+ declare function MoneyInput({ value, onValueChange, currency, locale, currencies, onCurrencyChange, currencyLabel, invalid, className, onBlur, disabled, ...props }: MoneyInputProps): React.JSX.Element;
27
+
28
+ export { MoneyInput, formatMinorUnits, parseMinorUnits };
29
+ export type { MoneyInputProps };
@@ -0,0 +1,78 @@
1
+ "use client";
2
+ import {
3
+ Input,
4
+ Select
5
+ } from "./chunk-PZ4FJOD5.js";
6
+ import {
7
+ cn
8
+ } from "./chunk-NSLXEDIS.js";
9
+
10
+ // src/money-input/money-input.tsx
11
+ import { currencyDigits } from "@krizaka/intl";
12
+ import * as React from "react";
13
+ import { jsx, jsxs } from "react/jsx-runtime";
14
+ var separators = (locale) => {
15
+ const parts = new Intl.NumberFormat(locale, { useGrouping: true, minimumFractionDigits: 1 }).formatToParts(12345671e-1);
16
+ return { decimal: parts.find((p) => p.type === "decimal")?.value ?? ".", group: parts.find((p) => p.type === "group")?.value ?? "," };
17
+ };
18
+ function parseMinorUnits(text, locale, digits) {
19
+ const { decimal } = separators(locale);
20
+ const cleaned = text.replace(/\s/g, "");
21
+ if (cleaned === "") return null;
22
+ const marks = [...cleaned].filter((c) => c === "." || c === "," || c === decimal);
23
+ if (!/^[\d.,]+$/.test(cleaned.replaceAll(decimal, ""))) return void 0;
24
+ const last = marks.length ? Math.max(cleaned.lastIndexOf("."), cleaned.lastIndexOf(","), cleaned.lastIndexOf(decimal)) : -1;
25
+ const whole = (last >= 0 ? cleaned.slice(0, last) : cleaned).replace(/\D/g, "");
26
+ const fraction = last >= 0 ? cleaned.slice(last + 1) : "";
27
+ if (!/^\d*$/.test(fraction) || fraction.length > digits || digits === 0 && last >= 0) return void 0;
28
+ const minor = Number(`${whole || "0"}${fraction.padEnd(digits, "0")}`);
29
+ return Number.isSafeInteger(minor) ? minor : void 0;
30
+ }
31
+ function formatMinorUnits(minor, locale, digits) {
32
+ const { decimal } = separators(locale);
33
+ const abs = BigInt(Math.abs(minor)).toString().padStart(digits + 1, "0");
34
+ const whole = new Intl.NumberFormat(locale).format(BigInt(digits ? abs.slice(0, -digits) : abs));
35
+ return `${minor < 0 ? "-" : ""}${whole}${digits ? decimal + abs.slice(-digits) : ""}`;
36
+ }
37
+ function MoneyInput({ value, onValueChange, currency, locale, currencies, onCurrencyChange, currencyLabel, invalid, className, onBlur, disabled, ...props }) {
38
+ const digits = currencyDigits(currency);
39
+ const [text, setText] = React.useState(() => value === null ? "" : formatMinorUnits(value, locale, digits));
40
+ const typed = React.useRef(value);
41
+ React.useEffect(() => {
42
+ if (typed.current !== value) setText(value === null ? "" : formatMinorUnits(value, locale, digits));
43
+ typed.current = value;
44
+ }, [value, locale, digits]);
45
+ return /* @__PURE__ */ jsxs("span", { className: cn("flex w-full items-stretch gap-2", className), children: [
46
+ /* @__PURE__ */ jsx(
47
+ Input,
48
+ {
49
+ ...props,
50
+ type: "text",
51
+ inputMode: digits ? "decimal" : "numeric",
52
+ autoComplete: "off",
53
+ disabled,
54
+ invalid,
55
+ "data-currency": currency,
56
+ value: text,
57
+ onChange: (event) => {
58
+ const parsed = parseMinorUnits(event.target.value, locale, digits);
59
+ if (parsed === void 0) return;
60
+ setText(event.target.value);
61
+ typed.current = parsed;
62
+ onValueChange(parsed);
63
+ },
64
+ onBlur: (event) => {
65
+ onBlur?.(event);
66
+ if (value !== null) setText(formatMinorUnits(value, locale, digits));
67
+ }
68
+ }
69
+ ),
70
+ currencies ? /* @__PURE__ */ jsx(Select, { "aria-label": currencyLabel, disabled, value: currency, onChange: (event) => onCurrencyChange?.(event.target.value), className: "w-28", children: currencies.map((code) => /* @__PURE__ */ jsx("option", { value: code, children: code }, code)) }) : /* @__PURE__ */ jsx("span", { className: "flex items-center text-sm font-medium text-fg-secondary", children: currency })
71
+ ] });
72
+ }
73
+ export {
74
+ MoneyInput,
75
+ formatMinorUnits,
76
+ parseMinorUnits
77
+ };
78
+ //# sourceMappingURL=money-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/money-input/money-input.tsx"],"sourcesContent":["// Client (the text being typed). An amount in INTEGER minor units (cents) plus a currency. The person types a\n// decimal in their locale's way; it is read as a string (never a float) into cents, refused beyond the currency's own\n// decimals, and written back grouped and padded on blur. The currency can be chosen among `currencies` (a native\n// select). Words arrive as props.\nimport { currencyDigits } from \"@krizaka/intl\";\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { Input, Select } from \"../field/field\";\n\nexport type MoneyInputProps = Omit<React.ComponentProps<\"input\">, \"value\" | \"defaultValue\" | \"onChange\" | \"type\" | \"inputMode\"> & {\n /** The amount in minor units (cents), an integer, or `null` when empty. */\n value: number | null;\n /** Called with the new amount in minor units, or `null` when the field is emptied. */\n onValueChange: (minorUnits: number | null) => void;\n /** ISO 4217 code: `\"CAD\"`. */\n currency: string;\n /** BCP 47 locale for the separators: `\"fr-CA\"`, `\"en-CA\"`. */\n locale: string;\n /** The currencies to choose among (ISO codes). Omitted: the currency is fixed. */\n currencies?: readonly string[];\n /** Called with the chosen currency (required with `currencies`). */\n onCurrencyChange?: (currency: string) => void;\n /** The currency select's accessible name, passed translated: \"Currency\". */\n currencyLabel?: string;\n /** Marks the amount invalid (pair it with a `Field.Error`). */\n invalid?: boolean;\n};\n\nconst separators = (locale: string) => {\n const parts = new Intl.NumberFormat(locale, { useGrouping: true, minimumFractionDigits: 1 }).formatToParts(1234567.1);\n return { decimal: parts.find((p) => p.type === \"decimal\")?.value ?? \".\", group: parts.find((p) => p.type === \"group\")?.value ?? \",\" };\n};\n\n/** \"12,50\" → 1250 without a float; `undefined` when the text is not an amount or has too many decimals. */\nexport function parseMinorUnits(text: string, locale: string, digits: number): number | null | undefined {\n const { decimal } = separators(locale);\n const cleaned = text.replace(/\\s/g, \"\");\n if (cleaned === \"\") return null;\n // The locale's decimal mark, and \".\" or \",\" as a typed alternative; any other mark is a thousands separator.\n const marks = [...cleaned].filter((c) => c === \".\" || c === \",\" || c === decimal);\n if (!/^[\\d.,]+$/.test(cleaned.replaceAll(decimal, \"\"))) return undefined;\n const last = marks.length ? Math.max(cleaned.lastIndexOf(\".\"), cleaned.lastIndexOf(\",\"), cleaned.lastIndexOf(decimal)) : -1;\n const whole = (last >= 0 ? cleaned.slice(0, last) : cleaned).replace(/\\D/g, \"\");\n const fraction = last >= 0 ? cleaned.slice(last + 1) : \"\";\n if (!/^\\d*$/.test(fraction) || fraction.length > digits || (digits === 0 && last >= 0)) return undefined;\n const minor = Number(`${whole || \"0\"}${fraction.padEnd(digits, \"0\")}`);\n return Number.isSafeInteger(minor) ? minor : undefined;\n}\n\n/** Minor units → \"1 234,50\" in the locale, exact (BigInt), padded to the currency's decimals. */\nexport function formatMinorUnits(minor: number, locale: string, digits: number): string {\n const { decimal } = separators(locale);\n const abs = BigInt(Math.abs(minor)).toString().padStart(digits + 1, \"0\");\n const whole = new Intl.NumberFormat(locale).format(BigInt(digits ? abs.slice(0, -digits) : abs));\n return `${minor < 0 ? \"-\" : \"\"}${whole}${digits ? decimal + abs.slice(-digits) : \"\"}`;\n}\n\n/** An amount field in minor units. The caller holds an integer; the person sees their locale's decimal. */\nexport function MoneyInput({ value, onValueChange, currency, locale, currencies, onCurrencyChange, currencyLabel, invalid, className, onBlur, disabled, ...props }: MoneyInputProps) {\n const digits = currencyDigits(currency);\n const [text, setText] = React.useState(() => (value === null ? \"\" : formatMinorUnits(value, locale, digits)));\n const typed = React.useRef<number | null>(value);\n // Follow the caller when the value changes from outside (a reset, another currency's digits).\n React.useEffect(() => {\n if (typed.current !== value) setText(value === null ? \"\" : formatMinorUnits(value, locale, digits));\n typed.current = value;\n }, [value, locale, digits]);\n return (\n <span className={cn(\"flex w-full items-stretch gap-2\", className)}>\n <Input\n {...props}\n type=\"text\"\n inputMode={digits ? \"decimal\" : \"numeric\"}\n autoComplete=\"off\"\n disabled={disabled}\n invalid={invalid}\n data-currency={currency}\n value={text}\n onChange={(event) => {\n const parsed = parseMinorUnits(event.target.value, locale, digits);\n if (parsed === undefined) return; // refused: not an amount, or more decimals than the currency has\n setText(event.target.value);\n typed.current = parsed;\n onValueChange(parsed);\n }}\n onBlur={(event) => {\n onBlur?.(event);\n if (value !== null) setText(formatMinorUnits(value, locale, digits));\n }}\n />\n {currencies ? (\n <Select aria-label={currencyLabel} disabled={disabled} value={currency} onChange={(event) => onCurrencyChange?.(event.target.value)} className=\"w-28\">\n {currencies.map((code) => (\n <option key={code} value={code}>\n {code}\n </option>\n ))}\n </Select>\n ) : (\n <span className=\"flex items-center text-sm font-medium text-fg-secondary\">{currency}</span>\n )}\n </span>\n );\n}\n"],"mappings":";;;;;;;;;;AAIA,SAAS,sBAAsB;AAC/B,YAAY,WAAW;AAgEnB,SACE,KADF;AAxCJ,IAAM,aAAa,CAAC,WAAmB;AACrC,QAAM,QAAQ,IAAI,KAAK,aAAa,QAAQ,EAAE,aAAa,MAAM,uBAAuB,EAAE,CAAC,EAAE,cAAc,WAAS;AACpH,SAAO,EAAE,SAAS,MAAM,KAAK,CAAC,MAAM,EAAE,SAAS,SAAS,GAAG,SAAS,KAAK,OAAO,MAAM,KAAK,CAAC,MAAM,EAAE,SAAS,OAAO,GAAG,SAAS,IAAI;AACtI;AAGO,SAAS,gBAAgB,MAAc,QAAgB,QAA2C;AACvG,QAAM,EAAE,QAAQ,IAAI,WAAW,MAAM;AACrC,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Props = {
112
112
  style?: StyleProp<ViewStyle>;
113
113
  };
114
114
  /** A map: MapLibre Native over our Protomaps tiles, styled from the tokens in the app's scheme; its places in its name. */
115
- declare function Map({ label, center, zoom, brand, lang, region, world, interactive, onMoveEnd, onPress, children, style }: MapProps): React.JSX.Element;
115
+ declare function NativeMap({ label, center, zoom, brand, lang, region, world, interactive, onMoveEnd, onPress, children, style }: MapProps): React.JSX.Element;
116
116
  type MarkerProps = {
117
117
  /** Where it stands. */
118
118
  position: LngLat;
@@ -197,5 +197,5 @@ type LocationPickerProps = Pick<MapProps, "brand" | "lang" | "region" | "world"
197
197
  /** A position picked by moving the map under a pin; its distance from the person; "near me" asks for the location only when pressed. */
198
198
  declare function LocationPicker({ label, value, onValueChange, locale, zoom, radius: zone, origin: originProp, labels: given, style, ...map }: LocationPickerProps): React.JSX.Element;
199
199
 
200
- export { Cluster, LocationPicker, MAP_ATTRIBUTION, MAP_GLYPHS, MAP_TILES, Map, Marker, RadiusCircle, UserPosition, circlePolygon, distanceMeters, formatDistance, mapPalette, mapStyle };
200
+ export { Cluster, LocationPicker, MAP_ATTRIBUTION, MAP_GLYPHS, MAP_TILES, NativeMap as Map, Marker, RadiusCircle, UserPosition, circlePolygon, distanceMeters, formatDistance, mapPalette, mapStyle };
201
201
  export type { ClusterPoint, ClusterProps, LngLat, LocationPickerLabels, LocationPickerProps, MapProps, MapRegion, MarkerProps, RadiusCircleProps, UserPositionProps };
@@ -582,7 +582,7 @@ var useMapContext = () => {
582
582
  if (!ctx) throw new Error("inside a <Map> only");
583
583
  return ctx;
584
584
  };
585
- function Map({ label, center, zoom = 12, brand, lang, region, world, interactive = true, onMoveEnd, onPress, children, style }) {
585
+ function NativeMap({ label, center, zoom = 12, brand, lang, region, world, interactive = true, onMoveEnd, onPress, children, style }) {
586
586
  const { scheme, theme, radius, motion } = useTheme();
587
587
  const reduce = motion.duration.base === 0;
588
588
  const camera = React.useRef(null);
@@ -759,7 +759,7 @@ function LocationPicker({ label, value, onValueChange, locale, zoom = 14, radius
759
759
  const message = status === "locating" ? labels.locating : status === "denied" ? labels.denied : status === "unavailable" ? labels.unavailable : null;
760
760
  return /* @__PURE__ */ jsxs(View, { role: "group", "aria-label": label, style: [styles.picker, style], children: [
761
761
  /* @__PURE__ */ jsxs(View, { style: styles.pickerFrame, children: [
762
- /* @__PURE__ */ jsxs(Map, { ...map, label, center: camera, zoom, onMoveEnd: (v) => onValueChange(v.center), style: StyleSheet.absoluteFill, children: [
762
+ /* @__PURE__ */ jsxs(NativeMap, { ...map, label, center: camera, zoom, onMoveEnd: (v) => onValueChange(v.center), style: StyleSheet.absoluteFill, children: [
763
763
  zone ? /* @__PURE__ */ jsx(RadiusCircle, { center: value, radius: zone }) : null,
764
764
  origin ? /* @__PURE__ */ jsx(UserPosition, { position: origin, label: labels.you }) : null
765
765
  ] }),
@@ -798,7 +798,7 @@ export {
798
798
  MAP_ATTRIBUTION,
799
799
  MAP_GLYPHS,
800
800
  MAP_TILES,
801
- Map,
801
+ NativeMap as Map,
802
802
  Marker,
803
803
  RadiusCircle,
804
804
  UserPosition,