@azx-pbc/axiom-web 0.0.0-stage → 0.0.1

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 (145) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +161 -2
  3. package/dist/address.d.ts +32 -0
  4. package/dist/address.d.ts.map +1 -0
  5. package/dist/address.js +146 -0
  6. package/dist/address.js.map +1 -0
  7. package/dist/capture/MediaCapture.d.ts +45 -0
  8. package/dist/capture/MediaCapture.d.ts.map +1 -0
  9. package/dist/capture/MediaCapture.js +669 -0
  10. package/dist/capture/MediaCapture.js.map +1 -0
  11. package/dist/capture/SignatureCapture.d.ts +31 -0
  12. package/dist/capture/SignatureCapture.d.ts.map +1 -0
  13. package/dist/capture/SignatureCapture.js +329 -0
  14. package/dist/capture/SignatureCapture.js.map +1 -0
  15. package/dist/capture/copy.d.ts +101 -0
  16. package/dist/capture/copy.d.ts.map +1 -0
  17. package/dist/capture/copy.js +1369 -0
  18. package/dist/capture/copy.js.map +1 -0
  19. package/dist/capture/index.d.ts +19 -0
  20. package/dist/capture/index.d.ts.map +1 -0
  21. package/dist/capture/index.js +14 -0
  22. package/dist/capture/index.js.map +1 -0
  23. package/dist/capture/media-kind.d.ts +16 -0
  24. package/dist/capture/media-kind.d.ts.map +1 -0
  25. package/dist/capture/media-kind.js +64 -0
  26. package/dist/capture/media-kind.js.map +1 -0
  27. package/dist/capture/permissions.d.ts +109 -0
  28. package/dist/capture/permissions.d.ts.map +1 -0
  29. package/dist/capture/permissions.js +172 -0
  30. package/dist/capture/permissions.js.map +1 -0
  31. package/dist/capture/refusal.d.ts +13 -0
  32. package/dist/capture/refusal.d.ts.map +1 -0
  33. package/dist/capture/refusal.js +16 -0
  34. package/dist/capture/refusal.js.map +1 -0
  35. package/dist/controls.d.ts +64 -0
  36. package/dist/controls.d.ts.map +1 -0
  37. package/dist/controls.js +2524 -0
  38. package/dist/controls.js.map +1 -0
  39. package/dist/coordinate.d.ts +38 -0
  40. package/dist/coordinate.d.ts.map +1 -0
  41. package/dist/coordinate.js +220 -0
  42. package/dist/coordinate.js.map +1 -0
  43. package/dist/copy.d.ts +313 -0
  44. package/dist/copy.d.ts.map +1 -0
  45. package/dist/copy.js +2602 -0
  46. package/dist/copy.js.map +1 -0
  47. package/dist/countries.d.ts +14 -0
  48. package/dist/countries.d.ts.map +1 -0
  49. package/dist/countries.js +264 -0
  50. package/dist/countries.js.map +1 -0
  51. package/dist/format/calendar-locale.d.ts +19 -0
  52. package/dist/format/calendar-locale.d.ts.map +1 -0
  53. package/dist/format/calendar-locale.js +38 -0
  54. package/dist/format/calendar-locale.js.map +1 -0
  55. package/dist/format/country-names.d.ts +21 -0
  56. package/dist/format/country-names.d.ts.map +1 -0
  57. package/dist/format/country-names.js +2277 -0
  58. package/dist/format/country-names.js.map +1 -0
  59. package/dist/format/date.d.ts +58 -0
  60. package/dist/format/date.d.ts.map +1 -0
  61. package/dist/format/date.js +155 -0
  62. package/dist/format/date.js.map +1 -0
  63. package/dist/format/digits.d.ts +23 -0
  64. package/dist/format/digits.d.ts.map +1 -0
  65. package/dist/format/digits.js +46 -0
  66. package/dist/format/digits.js.map +1 -0
  67. package/dist/format/index.d.ts +28 -0
  68. package/dist/format/index.d.ts.map +1 -0
  69. package/dist/format/index.js +24 -0
  70. package/dist/format/index.js.map +1 -0
  71. package/dist/format/invariant.d.ts +8 -0
  72. package/dist/format/invariant.d.ts.map +1 -0
  73. package/dist/format/invariant.js +10 -0
  74. package/dist/format/invariant.js.map +1 -0
  75. package/dist/format/locale.d.ts +33 -0
  76. package/dist/format/locale.d.ts.map +1 -0
  77. package/dist/format/locale.js +39 -0
  78. package/dist/format/locale.js.map +1 -0
  79. package/dist/format/media-type.d.ts +8 -0
  80. package/dist/format/media-type.d.ts.map +1 -0
  81. package/dist/format/media-type.js +302 -0
  82. package/dist/format/media-type.js.map +1 -0
  83. package/dist/format/money.d.ts +52 -0
  84. package/dist/format/money.d.ts.map +1 -0
  85. package/dist/format/money.js +36 -0
  86. package/dist/format/money.js.map +1 -0
  87. package/dist/format/number.d.ts +28 -0
  88. package/dist/format/number.d.ts.map +1 -0
  89. package/dist/format/number.js +91 -0
  90. package/dist/format/number.js.map +1 -0
  91. package/dist/host.d.ts +122 -0
  92. package/dist/host.d.ts.map +1 -0
  93. package/dist/host.js +20 -0
  94. package/dist/host.js.map +1 -0
  95. package/dist/index.d.ts +57 -0
  96. package/dist/index.d.ts.map +1 -0
  97. package/dist/index.js +49 -0
  98. package/dist/index.js.map +1 -0
  99. package/dist/media.d.ts +42 -0
  100. package/dist/media.d.ts.map +1 -0
  101. package/dist/media.js +151 -0
  102. package/dist/media.js.map +1 -0
  103. package/dist/pickers/DatePicker.d.ts +35 -0
  104. package/dist/pickers/DatePicker.d.ts.map +1 -0
  105. package/dist/pickers/DatePicker.js +212 -0
  106. package/dist/pickers/DatePicker.js.map +1 -0
  107. package/dist/pickers/TimeSegments.d.ts +27 -0
  108. package/dist/pickers/TimeSegments.d.ts.map +1 -0
  109. package/dist/pickers/TimeSegments.js +82 -0
  110. package/dist/pickers/TimeSegments.js.map +1 -0
  111. package/dist/pickers/day-picker-locale.d.ts +15 -0
  112. package/dist/pickers/day-picker-locale.d.ts.map +1 -0
  113. package/dist/pickers/day-picker-locale.js +46 -0
  114. package/dist/pickers/day-picker-locale.js.map +1 -0
  115. package/dist/render/dom.d.ts +100 -0
  116. package/dist/render/dom.d.ts.map +1 -0
  117. package/dist/render/dom.js +882 -0
  118. package/dist/render/dom.js.map +1 -0
  119. package/dist/render/layout.d.ts +45 -0
  120. package/dist/render/layout.d.ts.map +1 -0
  121. package/dist/render/layout.js +8 -0
  122. package/dist/render/layout.js.map +1 -0
  123. package/dist/schedule/SchedulePicker.d.ts +46 -0
  124. package/dist/schedule/SchedulePicker.d.ts.map +1 -0
  125. package/dist/schedule/SchedulePicker.js +160 -0
  126. package/dist/schedule/SchedulePicker.js.map +1 -0
  127. package/dist/schedule/timeslot.d.ts +52 -0
  128. package/dist/schedule/timeslot.d.ts.map +1 -0
  129. package/dist/schedule/timeslot.js +265 -0
  130. package/dist/schedule/timeslot.js.map +1 -0
  131. package/dist/styles.css +2151 -0
  132. package/dist/theme/index.d.ts +12 -0
  133. package/dist/theme/index.d.ts.map +1 -0
  134. package/dist/theme/index.js +11 -0
  135. package/dist/theme/index.js.map +1 -0
  136. package/dist/theme/presets.d.ts +93 -0
  137. package/dist/theme/presets.d.ts.map +1 -0
  138. package/dist/theme/presets.js +200 -0
  139. package/dist/theme/presets.js.map +1 -0
  140. package/dist/tokens.css +234 -0
  141. package/dist/wizard-checkpoints.d.ts +18 -0
  142. package/dist/wizard-checkpoints.d.ts.map +1 -0
  143. package/dist/wizard-checkpoints.js +56 -0
  144. package/dist/wizard-checkpoints.js.map +1 -0
  145. package/package.json +76 -3
@@ -0,0 +1,38 @@
1
+ import type { ReactElement, ReactNode } from 'react';
2
+ import type { WireValue } from '@azx-pbc/axiom-runtime';
3
+ /**
4
+ * One `coordinate` value with two ways to answer it.
5
+ *
6
+ * **Capture** asks the host through `HostActions.capturePosition` and paints every outcome the
7
+ * host can report — idle, requesting, granted, denied, unavailable, timed out — as words. A host
8
+ * that supplies no capture port gets the manual path alone: the adapter never reads
9
+ * `navigator.geolocation` itself, because permission, hardware and the timeout are the host's
10
+ * policy and a denial must never look like a button that silently did nothing.
11
+ *
12
+ * **Manual** latitude and longitude entries are always available, so a denied or offline reader
13
+ * can still answer. They accept decimal degrees only, refuse a value outside latitude −90…90 or
14
+ * longitude −180…180 inline, and write the canonical decimal text the wire holds. Accuracy is
15
+ * kept only when the position was captured: editing the point by hand invalidates the radius
16
+ * that described the old one.
17
+ *
18
+ * No network call and no map tiles are involved. A map is the host's own control, supplied
19
+ * through the adapter's component slot map; this editor neither draws one nor asks for one, so it
20
+ * works with the radio off.
21
+ */
22
+ export interface CoordinateEditorProps {
23
+ readonly controlId: string;
24
+ /** The binding the host action acts on. */
25
+ readonly fieldId: string;
26
+ /** The field's label and required marker, already translated for this page. */
27
+ readonly legend: ReactNode;
28
+ readonly label: string;
29
+ readonly value: WireValue | undefined;
30
+ readonly setValue: (value: WireValue) => boolean;
31
+ readonly describedBy: string | undefined;
32
+ readonly required: boolean;
33
+ readonly invalid: boolean;
34
+ readonly disabled: boolean;
35
+ readonly onBlur: () => void;
36
+ }
37
+ export declare function CoordinateEditor({ controlId, fieldId, legend, label, value, setValue, describedBy, required, invalid, disabled, onBlur, }: CoordinateEditorProps): ReactElement;
38
+ //# sourceMappingURL=coordinate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinate.d.ts","sourceRoot":"","sources":["../src/coordinate.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUlE,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAOpE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,2CAA2C;IAC3C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,+EAA+E;IAC/E,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC;IACjD,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC;CAC7B;AAkJD,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,OAAO,EACP,MAAM,EACN,KAAK,EACL,KAAK,EACL,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,MAAM,GACP,EAAE,qBAAqB,GAAG,YAAY,CA2PtC"}
@@ -0,0 +1,220 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { AxiomDecimal, DECIMAL_TEXT_PATTERN, asDecimalString, canonicalDecimal, compareDecimalTexts, isRecord, sameWireValue, } from '@azx-pbc/axiom-runtime';
4
+ import { useHostCopy } from './copy.js';
5
+ import { resolveLocale } from './format/locale.js';
6
+ import { formatDecimal, isDecimalString } from './format/number.js';
7
+ import { useHostActions, useLocale } from './host.js';
8
+ const LATITUDE_LOW = '-90';
9
+ const LATITUDE_HIGH = '90';
10
+ const LONGITUDE_LOW = '-180';
11
+ const LONGITUDE_HIGH = '180';
12
+ /**
13
+ * One decimal-degree entry, read as canonical text inside its declared range.
14
+ *
15
+ * The canonical spelling is the only spelling written: `+1`, `1.`, `1e3` and `-0` are refused
16
+ * rather than normalised, because two spellings of one point must not be two values. The bounds
17
+ * are compared as exact decimals through the runtime, so `90.0000000000000000001` is out of
18
+ * range rather than rounded into it.
19
+ */
20
+ function parseCoordinateMember(raw, low, high) {
21
+ const text = raw.trim();
22
+ if (text === '')
23
+ return { kind: 'empty' };
24
+ if (text === '-0' || !DECIMAL_TEXT_PATTERN.test(text))
25
+ return { kind: 'invalid' };
26
+ const value = asDecimalString(text);
27
+ if (compareDecimalTexts(value, asDecimalString(low)) < 0)
28
+ return { kind: 'range' };
29
+ if (compareDecimalTexts(value, asDecimalString(high)) > 0)
30
+ return { kind: 'range' };
31
+ return { kind: 'value', value };
32
+ }
33
+ /** A finite number as canonical decimal text, or `undefined` when it has no exact spelling. */
34
+ function canonicalCoordinateText(amount) {
35
+ if (!Number.isFinite(amount))
36
+ return undefined;
37
+ try {
38
+ return canonicalDecimal(new AxiomDecimal(amount));
39
+ }
40
+ catch {
41
+ return undefined;
42
+ }
43
+ }
44
+ const BLANK = Object.freeze({ latitude: '', longitude: '' });
45
+ function draftOf(value) {
46
+ if (!isRecord(value))
47
+ return BLANK;
48
+ const latitude = value['latitude'];
49
+ const longitude = value['longitude'];
50
+ return {
51
+ latitude: typeof latitude === 'string' ? latitude : '',
52
+ longitude: typeof longitude === 'string' ? longitude : '',
53
+ };
54
+ }
55
+ const IDLE = { kind: 'idle' };
56
+ /** One manual latitude or longitude: its label, its range, and its own inline refusal. */
57
+ function ManualMember({ id, label, scope, value, range, hintId, required, invalid, describedBy, refusal, disabled, onChange, onBlur, }) {
58
+ const refusalId = `${id}-refusal`;
59
+ const described = [describedBy, hintId, refusal === undefined ? undefined : refusalId]
60
+ .filter((entry) => entry !== undefined && entry !== '')
61
+ .join(' ');
62
+ return (_jsxs("div", { className: "ax-location-member", children: [_jsxs("label", { className: "ax-label", htmlFor: id, children: [label, " ", _jsx("span", { className: "ax-visually-hidden axiom-visually-hidden", children: scope })] }), _jsx("input", { id: id, className: "ax-control ax-control--coordinate", type: "text", inputMode: "decimal", autoComplete: "off", value: value, "aria-required": required, "aria-invalid": invalid || refusal !== undefined, ...(described === '' ? {} : { 'aria-describedby': described }), disabled: disabled, onChange: (event) => onChange(event.target.value), onBlur: onBlur }), _jsx("p", { className: "ax-hint", id: hintId, children: range }), refusal === undefined ? null : (_jsx("p", { className: "ax-error", role: "alert", id: refusalId, children: refusal }))] }));
63
+ }
64
+ export function CoordinateEditor({ controlId, fieldId, legend, label, value, setValue, describedBy, required, invalid, disabled, onBlur, }) {
65
+ const copy = useHostCopy();
66
+ const locale = useLocale();
67
+ const { capturePosition } = useHostActions();
68
+ const published = draftOf(value);
69
+ const [draft, setDraft] = useState(undefined);
70
+ const [state, setState] = useState(IDLE);
71
+ const shown = draft ?? published;
72
+ const latitudeParse = parseCoordinateMember(shown.latitude, LATITUDE_LOW, LATITUDE_HIGH);
73
+ const longitudeParse = parseCoordinateMember(shown.longitude, LONGITUDE_LOW, LONGITUDE_HIGH);
74
+ const latitudeRefusal = latitudeParse.kind === 'range'
75
+ ? copy.coordinateOutOfRange(copy.coordinateLatitude(), LATITUDE_LOW, LATITUDE_HIGH)
76
+ : latitudeParse.kind === 'invalid'
77
+ ? copy.coordinateNotDecimal(copy.coordinateLatitude())
78
+ : undefined;
79
+ const longitudeRefusal = longitudeParse.kind === 'range'
80
+ ? copy.coordinateOutOfRange(copy.coordinateLongitude(), LONGITUDE_LOW, LONGITUDE_HIGH)
81
+ : longitudeParse.kind === 'invalid'
82
+ ? copy.coordinateNotDecimal(copy.coordinateLongitude())
83
+ : undefined;
84
+ const change = (member, text) => {
85
+ const next = { ...shown, [member]: text };
86
+ setDraft(next);
87
+ // A manual edit is a new point; a captured radius describes the old one and cannot travel.
88
+ setState(IDLE);
89
+ const latitude = parseCoordinateMember(next.latitude, LATITUDE_LOW, LATITUDE_HIGH);
90
+ const longitude = parseCoordinateMember(next.longitude, LONGITUDE_LOW, LONGITUDE_HIGH);
91
+ if (latitude.kind === 'value' && longitude.kind === 'value') {
92
+ const record = { latitude: latitude.value, longitude: longitude.value };
93
+ if (!sameWireValue(record, value)) {
94
+ const accepted = setValue(record);
95
+ if (!accepted) {
96
+ setState({ kind: 'failed', sentence: copy.writeRefused() });
97
+ }
98
+ }
99
+ return;
100
+ }
101
+ // The stored value was a complete point and this edit no longer states one. Keeping it would
102
+ // export a point the control no longer shows, so a clear is the write that makes the record
103
+ // and the screen agree; a field that never held a point has nothing to clear, so its draft
104
+ // stays local.
105
+ const storedComplete = parseCoordinateMember(published.latitude, LATITUDE_LOW, LATITUDE_HIGH).kind === 'value' &&
106
+ parseCoordinateMember(published.longitude, LONGITUDE_LOW, LONGITUDE_HIGH).kind === 'value';
107
+ if (storedComplete) {
108
+ const accepted = setValue(null);
109
+ if (!accepted) {
110
+ setState({ kind: 'failed', sentence: copy.writeRefused() });
111
+ }
112
+ }
113
+ };
114
+ const blur = () => {
115
+ if (latitudeParse.kind === 'value' &&
116
+ longitudeParse.kind === 'value' &&
117
+ state.kind !== 'failed') {
118
+ setDraft(undefined);
119
+ }
120
+ onBlur();
121
+ };
122
+ const settle = (result) => {
123
+ switch (result.outcome) {
124
+ case 'granted': {
125
+ const latitude = canonicalCoordinateText(result.latitude);
126
+ const longitude = canonicalCoordinateText(result.longitude);
127
+ if (latitude === undefined ||
128
+ longitude === undefined ||
129
+ parseCoordinateMember(latitude, LATITUDE_LOW, LATITUDE_HIGH).kind !== 'value' ||
130
+ parseCoordinateMember(longitude, LONGITUDE_LOW, LONGITUDE_HIGH).kind !== 'value') {
131
+ setState({ kind: 'failed', sentence: copy.positionInvalidReading() });
132
+ return;
133
+ }
134
+ const accuracy = result.accuracy === undefined ? undefined : canonicalCoordinateText(result.accuracy);
135
+ const accuracyText = accuracy !== undefined &&
136
+ compareDecimalTexts(asDecimalString(accuracy), asDecimalString('0')) >= 0
137
+ ? accuracy
138
+ : undefined;
139
+ const accepted = setValue({
140
+ latitude,
141
+ longitude,
142
+ ...(accuracyText === undefined ? {} : { accuracy: accuracyText }),
143
+ });
144
+ if (!accepted) {
145
+ setState({ kind: 'failed', sentence: copy.writeRefused() });
146
+ return;
147
+ }
148
+ setDraft(undefined);
149
+ setState({
150
+ kind: 'granted',
151
+ accuracy: accuracyText,
152
+ capturedAt: result.capturedAt,
153
+ });
154
+ return;
155
+ }
156
+ case 'denied':
157
+ setState({ kind: 'denied' });
158
+ return;
159
+ case 'unavailable':
160
+ setState({ kind: 'unavailable' });
161
+ return;
162
+ case 'timed-out':
163
+ setState({ kind: 'timed-out' });
164
+ return;
165
+ }
166
+ };
167
+ const failure = (error) => {
168
+ setState({
169
+ kind: 'failed',
170
+ sentence: copy.positionFailed(),
171
+ ...(error instanceof Error && error.message !== '' ? { detail: error.message } : {}),
172
+ });
173
+ };
174
+ const capture = () => {
175
+ if (capturePosition === undefined)
176
+ return;
177
+ setState({ kind: 'requesting' });
178
+ // The action is host code on the other side of a boundary: a synchronous throw and a
179
+ // rejected promise are the same failure, and neither may escape an event handler unhandled.
180
+ try {
181
+ void capturePosition(fieldId).then(settle, failure);
182
+ }
183
+ catch (error) {
184
+ failure(error);
185
+ }
186
+ };
187
+ const status = (() => {
188
+ switch (state.kind) {
189
+ case 'idle':
190
+ // A page with no capture port states the manual path alone: promising "use your current
191
+ // location" beside no button would be a sentence about an affordance that is not there.
192
+ return (_jsx("p", { className: "ax-hint", children: capturePosition === undefined ? copy.positionManualHint() : copy.positionIdleHint() }));
193
+ case 'requesting':
194
+ return _jsx("p", { className: "ax-hint", children: copy.positionRequesting() });
195
+ case 'denied':
196
+ return _jsx("p", { className: "ax-hint", children: copy.positionDenied() });
197
+ case 'unavailable':
198
+ return _jsx("p", { className: "ax-hint", children: copy.positionUnavailable() });
199
+ case 'timed-out':
200
+ return _jsx("p", { className: "ax-hint", children: copy.positionTimedOut() });
201
+ case 'failed':
202
+ return (_jsxs("div", { className: "ax-error", role: "alert", children: [_jsx("p", { children: state.sentence }), state.detail === undefined ? null : _jsx("p", { className: "ax-hint", children: state.detail })] }));
203
+ case 'granted': {
204
+ const accuracyDisplay = state.accuracy === undefined
205
+ ? undefined
206
+ : locale !== undefined && isDecimalString(state.accuracy)
207
+ ? formatDecimal(state.accuracy, resolveLocale(locale).language)
208
+ : state.accuracy;
209
+ return (_jsxs("dl", { className: "ax-position-summary", children: [accuracyDisplay === undefined ? null : (_jsxs("div", { children: [_jsx("dt", { children: copy.positionAccuracyLabel() }), _jsx("dd", { children: _jsx("bdi", { dir: "ltr", children: copy.positionMetres(accuracyDisplay) }) })] })), _jsxs("div", { children: [_jsx("dt", { children: copy.positionCapturedAtLabel() }), _jsx("dd", { children: _jsx("bdi", { dir: "ltr", children: copy.positionCapturedAt(state.capturedAt) }) })] })] }));
210
+ }
211
+ }
212
+ })();
213
+ return (_jsxs("fieldset", { className: "ax-location",
214
+ // The group is the element a summary link lands on; `-1` makes it focusable by script
215
+ // without adding a tab stop. Its members follow as their own stops.
216
+ id: controlId, tabIndex: -1, "aria-invalid": invalid, ...(describedBy === undefined || describedBy === ''
217
+ ? {}
218
+ : { 'aria-describedby': describedBy }), children: [_jsx("legend", { className: "ax-label", children: legend }), capturePosition === undefined ? null : (_jsx("div", { className: "ax-location-capture", children: _jsx("button", { type: "button", className: "ax-button ax-button--secondary", onClick: capture, disabled: disabled || state.kind === 'requesting', "aria-busy": state.kind === 'requesting' ? true : undefined, children: copy.positionCapture(label) }) })), _jsx("div", { className: "ax-position-status", role: "status", "aria-live": "polite", "data-position-status": state.kind, children: status }), _jsxs("div", { className: "ax-location-manual", children: [_jsx(ManualMember, { id: `${controlId}-latitude`, label: copy.coordinateLatitude(), scope: copy.memberScope(label), value: shown.latitude, range: copy.coordinateRange(LATITUDE_LOW, LATITUDE_HIGH), hintId: `${controlId}-latitude-range`, required: required, invalid: invalid, describedBy: describedBy ?? '', refusal: latitudeRefusal, disabled: disabled, onChange: (text) => change('latitude', text), onBlur: blur }), _jsx(ManualMember, { id: `${controlId}-longitude`, label: copy.coordinateLongitude(), scope: copy.memberScope(label), value: shown.longitude, range: copy.coordinateRange(LONGITUDE_LOW, LONGITUDE_HIGH), hintId: `${controlId}-longitude-range`, required: required, invalid: invalid, describedBy: describedBy ?? '', refusal: longitudeRefusal, disabled: disabled, onChange: (text) => change('longitude', text), onBlur: blur })] })] }));
219
+ }
220
+ //# sourceMappingURL=coordinate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinate.js","sourceRoot":"","sources":["../src/coordinate.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,QAAQ,EACR,aAAa,GACd,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CA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AK,CAAC,EAC9B,KAAK,EAAE,KAAK,CAAC,SAAS,EACtB,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,cAAc,CAAC,EAC1D,MAAM,EAAE,GAAG,SAAS,kBAAkB,EACtC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,IAAI,EAAE,EAC9B,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,EAC7C,MAAM,EAAE,IAAI,GACZ,IACE,IACG,CACZ,CAAC;AACJ,CAAC","sourcesContent":["import { useState } from 'react';\nimport type { ChangeEvent, ReactElement, ReactNode } from 'react';\nimport {\n AxiomDecimal,\n DECIMAL_TEXT_PATTERN,\n asDecimalString,\n canonicalDecimal,\n compareDecimalTexts,\n isRecord,\n sameWireValue,\n} from '@azx-pbc/axiom-runtime';\nimport type { WireRecord, WireValue } from '@azx-pbc/axiom-runtime';\nimport { useHostCopy } from './copy.js';\nimport { resolveLocale } from './format/locale.js';\nimport { formatDecimal, isDecimalString } from './format/number.js';\nimport { useHostActions, useLocale } from './host.js';\nimport type { HostPositionResult } from './host.js';\n\n/**\n * One `coordinate` value with two ways to answer it.\n *\n * **Capture** asks the host through `HostActions.capturePosition` and paints every outcome the\n * host can report — idle, requesting, granted, denied, unavailable, timed out — as words. A host\n * that supplies no capture port gets the manual path alone: the adapter never reads\n * `navigator.geolocation` itself, because permission, hardware and the timeout are the host's\n * policy and a denial must never look like a button that silently did nothing.\n *\n * **Manual** latitude and longitude entries are always available, so a denied or offline reader\n * can still answer. They accept decimal degrees only, refuse a value outside latitude −90…90 or\n * longitude −180…180 inline, and write the canonical decimal text the wire holds. Accuracy is\n * kept only when the position was captured: editing the point by hand invalidates the radius\n * that described the old one.\n *\n * No network call and no map tiles are involved. A map is the host's own control, supplied\n * through the adapter's component slot map; this editor neither draws one nor asks for one, so it\n * works with the radio off.\n */\nexport interface CoordinateEditorProps {\n readonly controlId: string;\n /** The binding the host action acts on. */\n readonly fieldId: string;\n /** The field's label and required marker, already translated for this page. */\n readonly legend: ReactNode;\n readonly label: string;\n readonly value: WireValue | undefined;\n readonly setValue: (value: WireValue) => boolean;\n readonly describedBy: string | undefined;\n readonly required: boolean;\n readonly invalid: boolean;\n readonly disabled: boolean;\n readonly onBlur: () => void;\n}\n\nconst LATITUDE_LOW = '-90';\nconst LATITUDE_HIGH = '90';\nconst LONGITUDE_LOW = '-180';\nconst LONGITUDE_HIGH = '180';\n\ntype MemberParse =\n | { readonly kind: 'empty' }\n | { readonly kind: 'invalid' }\n | { readonly kind: 'range' }\n | { readonly kind: 'value'; readonly value: string };\n\n/**\n * One decimal-degree entry, read as canonical text inside its declared range.\n *\n * The canonical spelling is the only spelling written: `+1`, `1.`, `1e3` and `-0` are refused\n * rather than normalised, because two spellings of one point must not be two values. The bounds\n * are compared as exact decimals through the runtime, so `90.0000000000000000001` is out of\n * range rather than rounded into it.\n */\nfunction parseCoordinateMember(raw: string, low: string, high: string): MemberParse {\n const text = raw.trim();\n if (text === '') return { kind: 'empty' };\n if (text === '-0' || !DECIMAL_TEXT_PATTERN.test(text)) return { kind: 'invalid' };\n const value = asDecimalString(text);\n if (compareDecimalTexts(value, asDecimalString(low)) < 0) return { kind: 'range' };\n if (compareDecimalTexts(value, asDecimalString(high)) > 0) return { kind: 'range' };\n return { kind: 'value', value };\n}\n\n/** A finite number as canonical decimal text, or `undefined` when it has no exact spelling. */\nfunction canonicalCoordinateText(amount: number): string | undefined {\n if (!Number.isFinite(amount)) return undefined;\n try {\n return canonicalDecimal(new AxiomDecimal(amount));\n } catch {\n return undefined;\n }\n}\n\ninterface CoordinateDraft {\n readonly latitude: string;\n readonly longitude: string;\n}\n\nconst BLANK: CoordinateDraft = Object.freeze({ latitude: '', longitude: '' });\n\nfunction draftOf(value: WireValue | undefined): CoordinateDraft {\n if (!isRecord(value)) return BLANK;\n const latitude = value['latitude'];\n const longitude = value['longitude'];\n return {\n latitude: typeof latitude === 'string' ? latitude : '',\n longitude: typeof longitude === 'string' ? longitude : '',\n };\n}\n\n/** The coordinator's own state, including every way a host request may end. */\ntype CaptureState =\n | { readonly kind: 'idle' }\n | { readonly kind: 'requesting' }\n | {\n readonly kind: 'granted';\n readonly accuracy: string | undefined;\n readonly capturedAt: string;\n }\n | { readonly kind: 'denied' }\n | { readonly kind: 'unavailable' }\n | { readonly kind: 'timed-out' }\n | {\n readonly kind: 'failed';\n /** The catalogue's sentence; the host's reason is painted apart from it. */\n readonly sentence: string;\n readonly detail?: string;\n };\n\nconst IDLE: CaptureState = { kind: 'idle' };\n\ninterface ManualMemberProps {\n readonly id: string;\n readonly label: string;\n readonly scope: string;\n readonly value: string;\n readonly range: string;\n readonly hintId: string;\n readonly required: boolean;\n readonly invalid: boolean;\n readonly describedBy: string;\n readonly refusal: string | undefined;\n readonly disabled: boolean;\n readonly onChange: (text: string) => void;\n readonly onBlur: () => void;\n}\n\n/** One manual latitude or longitude: its label, its range, and its own inline refusal. */\nfunction ManualMember({\n id,\n label,\n scope,\n value,\n range,\n hintId,\n required,\n invalid,\n describedBy,\n refusal,\n disabled,\n onChange,\n onBlur,\n}: ManualMemberProps): ReactElement {\n const refusalId = `${id}-refusal`;\n const described = [describedBy, hintId, refusal === undefined ? undefined : refusalId]\n .filter((entry) => entry !== undefined && entry !== '')\n .join(' ');\n return (\n <div className=\"ax-location-member\">\n <label className=\"ax-label\" htmlFor={id}>\n {label} <span className=\"ax-visually-hidden axiom-visually-hidden\">{scope}</span>\n </label>\n <input\n id={id}\n className=\"ax-control ax-control--coordinate\"\n type=\"text\"\n inputMode=\"decimal\"\n autoComplete=\"off\"\n value={value}\n aria-required={required}\n aria-invalid={invalid || refusal !== undefined}\n {...(described === '' ? {} : { 'aria-describedby': described })}\n disabled={disabled}\n onChange={(event: ChangeEvent<HTMLInputElement>) => onChange(event.target.value)}\n onBlur={onBlur}\n />\n <p className=\"ax-hint\" id={hintId}>\n {range}\n </p>\n {refusal === undefined ? null : (\n <p className=\"ax-error\" role=\"alert\" id={refusalId}>\n {refusal}\n </p>\n )}\n </div>\n );\n}\n\nexport function CoordinateEditor({\n controlId,\n fieldId,\n legend,\n label,\n value,\n setValue,\n describedBy,\n required,\n invalid,\n disabled,\n onBlur,\n}: CoordinateEditorProps): ReactElement {\n const copy = useHostCopy();\n const locale = useLocale();\n const { capturePosition } = useHostActions();\n const published = draftOf(value);\n const [draft, setDraft] = useState<CoordinateDraft | undefined>(undefined);\n const [state, setState] = useState<CaptureState>(IDLE);\n const shown = draft ?? published;\n const latitudeParse = parseCoordinateMember(shown.latitude, LATITUDE_LOW, LATITUDE_HIGH);\n const longitudeParse = parseCoordinateMember(shown.longitude, LONGITUDE_LOW, LONGITUDE_HIGH);\n const latitudeRefusal =\n latitudeParse.kind === 'range'\n ? copy.coordinateOutOfRange(copy.coordinateLatitude(), LATITUDE_LOW, LATITUDE_HIGH)\n : latitudeParse.kind === 'invalid'\n ? copy.coordinateNotDecimal(copy.coordinateLatitude())\n : undefined;\n const longitudeRefusal =\n longitudeParse.kind === 'range'\n ? copy.coordinateOutOfRange(copy.coordinateLongitude(), LONGITUDE_LOW, LONGITUDE_HIGH)\n : longitudeParse.kind === 'invalid'\n ? copy.coordinateNotDecimal(copy.coordinateLongitude())\n : undefined;\n const change = (member: 'latitude' | 'longitude', text: string): void => {\n const next = { ...shown, [member]: text };\n setDraft(next);\n // A manual edit is a new point; a captured radius describes the old one and cannot travel.\n setState(IDLE);\n const latitude = parseCoordinateMember(next.latitude, LATITUDE_LOW, LATITUDE_HIGH);\n const longitude = parseCoordinateMember(next.longitude, LONGITUDE_LOW, LONGITUDE_HIGH);\n if (latitude.kind === 'value' && longitude.kind === 'value') {\n const record: WireRecord = { latitude: latitude.value, longitude: longitude.value };\n if (!sameWireValue(record, value)) {\n const accepted = setValue(record);\n if (!accepted) {\n setState({ kind: 'failed', sentence: copy.writeRefused() });\n }\n }\n return;\n }\n // The stored value was a complete point and this edit no longer states one. Keeping it would\n // export a point the control no longer shows, so a clear is the write that makes the record\n // and the screen agree; a field that never held a point has nothing to clear, so its draft\n // stays local.\n const storedComplete =\n parseCoordinateMember(published.latitude, LATITUDE_LOW, LATITUDE_HIGH).kind === 'value' &&\n parseCoordinateMember(published.longitude, LONGITUDE_LOW, LONGITUDE_HIGH).kind === 'value';\n if (storedComplete) {\n const accepted = setValue(null);\n if (!accepted) {\n setState({ kind: 'failed', sentence: copy.writeRefused() });\n }\n }\n };\n const blur = (): void => {\n if (\n latitudeParse.kind === 'value' &&\n longitudeParse.kind === 'value' &&\n state.kind !== 'failed'\n ) {\n setDraft(undefined);\n }\n onBlur();\n };\n const settle = (result: HostPositionResult): void => {\n switch (result.outcome) {\n case 'granted': {\n const latitude = canonicalCoordinateText(result.latitude);\n const longitude = canonicalCoordinateText(result.longitude);\n if (\n latitude === undefined ||\n longitude === undefined ||\n parseCoordinateMember(latitude, LATITUDE_LOW, LATITUDE_HIGH).kind !== 'value' ||\n parseCoordinateMember(longitude, LONGITUDE_LOW, LONGITUDE_HIGH).kind !== 'value'\n ) {\n setState({ kind: 'failed', sentence: copy.positionInvalidReading() });\n return;\n }\n const accuracy =\n result.accuracy === undefined ? undefined : canonicalCoordinateText(result.accuracy);\n const accuracyText =\n accuracy !== undefined &&\n compareDecimalTexts(asDecimalString(accuracy), asDecimalString('0')) >= 0\n ? accuracy\n : undefined;\n const accepted = setValue({\n latitude,\n longitude,\n ...(accuracyText === undefined ? {} : { accuracy: accuracyText }),\n });\n if (!accepted) {\n setState({ kind: 'failed', sentence: copy.writeRefused() });\n return;\n }\n setDraft(undefined);\n setState({\n kind: 'granted',\n accuracy: accuracyText,\n capturedAt: result.capturedAt,\n });\n return;\n }\n case 'denied':\n setState({ kind: 'denied' });\n return;\n case 'unavailable':\n setState({ kind: 'unavailable' });\n return;\n case 'timed-out':\n setState({ kind: 'timed-out' });\n return;\n }\n };\n const failure = (error: unknown): void => {\n setState({\n kind: 'failed',\n sentence: copy.positionFailed(),\n ...(error instanceof Error && error.message !== '' ? { detail: error.message } : {}),\n });\n };\n const capture = (): void => {\n if (capturePosition === undefined) return;\n setState({ kind: 'requesting' });\n // The action is host code on the other side of a boundary: a synchronous throw and a\n // rejected promise are the same failure, and neither may escape an event handler unhandled.\n try {\n void capturePosition(fieldId).then(settle, failure);\n } catch (error) {\n failure(error);\n }\n };\n const status = ((): ReactNode => {\n switch (state.kind) {\n case 'idle':\n // A page with no capture port states the manual path alone: promising \"use your current\n // location\" beside no button would be a sentence about an affordance that is not there.\n return (\n <p className=\"ax-hint\">\n {capturePosition === undefined ? copy.positionManualHint() : copy.positionIdleHint()}\n </p>\n );\n case 'requesting':\n return <p className=\"ax-hint\">{copy.positionRequesting()}</p>;\n case 'denied':\n return <p className=\"ax-hint\">{copy.positionDenied()}</p>;\n case 'unavailable':\n return <p className=\"ax-hint\">{copy.positionUnavailable()}</p>;\n case 'timed-out':\n return <p className=\"ax-hint\">{copy.positionTimedOut()}</p>;\n case 'failed':\n return (\n <div className=\"ax-error\" role=\"alert\">\n <p>{state.sentence}</p>\n {state.detail === undefined ? null : <p className=\"ax-hint\">{state.detail}</p>}\n </div>\n );\n case 'granted': {\n const accuracyDisplay =\n state.accuracy === undefined\n ? undefined\n : locale !== undefined && isDecimalString(state.accuracy)\n ? formatDecimal(state.accuracy, resolveLocale(locale).language)\n : state.accuracy;\n return (\n <dl className=\"ax-position-summary\">\n {accuracyDisplay === undefined ? null : (\n <div>\n <dt>{copy.positionAccuracyLabel()}</dt>\n <dd>\n <bdi dir=\"ltr\">{copy.positionMetres(accuracyDisplay)}</bdi>\n </dd>\n </div>\n )}\n <div>\n <dt>{copy.positionCapturedAtLabel()}</dt>\n <dd>\n <bdi dir=\"ltr\">{copy.positionCapturedAt(state.capturedAt)}</bdi>\n </dd>\n </div>\n </dl>\n );\n }\n }\n })();\n return (\n <fieldset\n className=\"ax-location\"\n // The group is the element a summary link lands on; `-1` makes it focusable by script\n // without adding a tab stop. Its members follow as their own stops.\n id={controlId}\n tabIndex={-1}\n aria-invalid={invalid}\n {...(describedBy === undefined || describedBy === ''\n ? {}\n : { 'aria-describedby': describedBy })}\n >\n <legend className=\"ax-label\">{legend}</legend>\n {capturePosition === undefined ? null : (\n <div className=\"ax-location-capture\">\n <button\n type=\"button\"\n className=\"ax-button ax-button--secondary\"\n onClick={capture}\n disabled={disabled || state.kind === 'requesting'}\n aria-busy={state.kind === 'requesting' ? true : undefined}\n >\n {copy.positionCapture(label)}\n </button>\n </div>\n )}\n <div\n className=\"ax-position-status\"\n role=\"status\"\n aria-live=\"polite\"\n data-position-status={state.kind}\n >\n {status}\n </div>\n <div className=\"ax-location-manual\">\n <ManualMember\n id={`${controlId}-latitude`}\n label={copy.coordinateLatitude()}\n scope={copy.memberScope(label)}\n value={shown.latitude}\n range={copy.coordinateRange(LATITUDE_LOW, LATITUDE_HIGH)}\n hintId={`${controlId}-latitude-range`}\n required={required}\n invalid={invalid}\n describedBy={describedBy ?? ''}\n refusal={latitudeRefusal}\n disabled={disabled}\n onChange={(text) => change('latitude', text)}\n onBlur={blur}\n />\n <ManualMember\n id={`${controlId}-longitude`}\n label={copy.coordinateLongitude()}\n scope={copy.memberScope(label)}\n value={shown.longitude}\n range={copy.coordinateRange(LONGITUDE_LOW, LONGITUDE_HIGH)}\n hintId={`${controlId}-longitude-range`}\n required={required}\n invalid={invalid}\n describedBy={describedBy ?? ''}\n refusal={longitudeRefusal}\n disabled={disabled}\n onChange={(text) => change('longitude', text)}\n onBlur={blur}\n />\n </div>\n </fieldset>\n );\n}\n"]}
package/dist/copy.d.ts ADDED
@@ -0,0 +1,313 @@
1
+ import type { Context } from 'react';
2
+ import type { BufferRefusalReason, ValueDisplay } from '@azx-pbc/axiom-react';
3
+ import type { DurationUnit, FieldAccess } from '@azx-pbc/axiom-runtime';
4
+ /**
5
+ * The host's copy for the failures an artifact states no message key for.
6
+ *
7
+ * The runtime and the bindings deliberately invent no i18n key for `required`, `invalid-value`,
8
+ * `access` or a refused screen, because an artifact that never declared one cannot be given one
9
+ * here. A host must therefore supply the words — and must supply them *per locale*, or a Spanish
10
+ * form shows a Spanish label inside an English sentence. This module is that host: one catalogue
11
+ * for each of the nine shipped locales, and an English default for a tag outside them.
12
+ *
13
+ * The two ports below follow the same rule. A buffered entry refuses with a stable reason key,
14
+ * which the host translates here; and a boolean or a list has no locale-neutral spelling, so the
15
+ * host supplies the text through `display`, which the provider receives as `valueDisplay`.
16
+ */
17
+ export interface FormCopy {
18
+ /**
19
+ * A binding the record does not satisfy.
20
+ *
21
+ * A row-scoped binding passes the row's resolved display name, because several rows of one
22
+ * record share a label: "Make is required" in a summary names the field but not which of three
23
+ * rows it is about. A key the host minted has no display name and is omitted, never printed.
24
+ */
25
+ readonly required: (label: string, rowName?: string) => string;
26
+ /**
27
+ * A repeating record outside its declared entry count. The count and the limit are the engine's
28
+ * numbers, so the sentence never re-reads the record to restate them.
29
+ *
30
+ * A minimum of zero cannot fail, so it states nothing: the caller renders no sentence rather
31
+ * than a rule about no entries.
32
+ */
33
+ readonly cardinality: (label: string, bound: 'minItems' | 'maxItems', count: number, limit: number) => string | undefined;
34
+ /** A selection the field's domain no longer offers. */
35
+ readonly invalidValue: (label: string) => string;
36
+ /**
37
+ * An offered option this record may not choose, `RULES-7.1.6`.
38
+ *
39
+ * It is a different cause from `invalidValue`, so the words are different too: the value is in
40
+ * the list, and this record cannot hold it. A declaration that states its own reason, and a host
41
+ * page that states one, carry the sentence instead of this fallback.
42
+ */
43
+ readonly unavailableOption: (label: string) => string;
44
+ /** An offered option whose availability is still an open question, named by its label. */
45
+ readonly undeterminedOption: (label: string, optionLabel: string, cause: 'deferred' | 'unknown') => string;
46
+ /** A selected value a domain refuses when the summary cannot name the field it belongs to. */
47
+ readonly invalidSelection: () => string;
48
+ /** The withheld value itself, announced beside the host's visible stand-in. */
49
+ readonly withheldValue: () => string;
50
+ /**
51
+ * A value the server withheld, stated where a control would otherwise look empty.
52
+ *
53
+ * Deferral is not absence: the record holds a value, the server chose not to send it, and the
54
+ * user may still answer the field. The sentence says which of those facts applies.
55
+ */
56
+ readonly deferredValue: () => string;
57
+ /** A binding whose resolved access withholds the write. */
58
+ /** Why a value is withheld, in the words of the withholding rather than one blanket sentence. */
59
+ readonly notEditable: (label: string, access: FieldAccess) => string;
60
+ /** A reserved row key another row already holds, named by the row's resolved display name. */
61
+ readonly rowKey: (label: string, rowName?: string) => string;
62
+ /**
63
+ * A blocking fact the form is not painting yet, because the user has not supplied what would
64
+ * make it answerable. It is a count, not a failure sentence, so it accuses nobody.
65
+ */
66
+ readonly unanswered: (count: number) => string;
67
+ /**
68
+ * One requirement with no answer yet, named so the summary can link to the control that would
69
+ * answer it. A question, not a failure: it deliberately does not use the `required` sentence.
70
+ */
71
+ readonly notAnswered: (label: string, rowName?: string) => string;
72
+ /**
73
+ * The polite announcement after a row is appended: the position it landed at and the new
74
+ * total, so a reader who is moved into the row also learns the list grew.
75
+ */
76
+ readonly rowAdded: (position: number, total: number) => string;
77
+ /** The quiet heading above the painted failure list. */
78
+ readonly summaryHeading: () => string;
79
+ /** The word a screen reader hears beside a required label's asterisk. */
80
+ readonly requiredMarker: () => string;
81
+ /**
82
+ * A captured signature as a person reads it: `Signed`, the time it was captured and how many
83
+ * fields it covers. The signature's id is an internal reference and is never this text.
84
+ */
85
+ readonly signed: (at: string | undefined, covered: number | undefined) => string;
86
+ /** A captured media value outside its declared type or byte bound. */
87
+ readonly mediaConstraint: (label: string, member: 'accept' | 'minBytes' | 'maxBytes', limit: readonly string[] | number, value: string | number) => string;
88
+ /**
89
+ * What one media type is called in a sentence: `JPEG`, `a ZIP file`, never `image/jpeg`.
90
+ *
91
+ * A declaration and a file both state a wire spelling, and neither is a word a person reads.
92
+ * The port is on the catalogue so a host can name a type its own product vocabulary knows.
93
+ */
94
+ readonly mediaTypeName: (mediaType: string) => string;
95
+ /**
96
+ * An array whose `rowsFrom` count differs from its length, or whose count expression was
97
+ * refused (`MODEL-2.1.22`). The expression is shown as the artifact stated it.
98
+ */
99
+ readonly rowCount: (label: string, expected: number, actual: number, source: string, reason?: 'integer' | 'negative' | 'ceiling', ceiling?: number) => string;
100
+ /** The host action that asks the signer for a signature over the record as shown. */
101
+ readonly captureSignature: (label: string) => string;
102
+ /** A capture the signer did not answer. The host's own detail is rendered apart from it. */
103
+ readonly captureFailed: () => string;
104
+ /** A signer that threw or rejected without a message of its own. */
105
+ readonly signerFailed: () => string;
106
+ /** A signature the device cannot perform, stated beside the read-only value. */
107
+ readonly signatureUnavailable: (label: string) => string;
108
+ /** The action that opens the host's file picker for one media field. */
109
+ readonly attachMedia: () => string;
110
+ /** The action that removes a captured media reference, naming it. */
111
+ readonly removeMedia: (name: string) => string;
112
+ /** A capture the host refused or failed; the host's detail is rendered apart from it. */
113
+ readonly mediaFailed: () => string;
114
+ /** A file larger than the declared `maxBytes`; the sizes are host-formatted. */
115
+ readonly mediaTooLarge: (size: string, limit: string) => string;
116
+ /** A host storage refusal where the file's size is not known. */
117
+ readonly mediaServerRefused: () => string;
118
+ /** The collapse toggle a collapsible section or group renders. */
119
+ readonly sectionToggle: (title: string | undefined, expanded: boolean) => string;
120
+ /** The accessible name of the wizard's step navigation. */
121
+ readonly stepsLabel: () => string;
122
+ /** The live announcement after a step change. */
123
+ readonly stepAnnouncement: (position: number, total: number, title: string) => string;
124
+ /** The cursor's page, read after the title so the state is never colour alone. */
125
+ readonly stepStateCurrent: () => string;
126
+ /** A page the reader has visited and left clean. */
127
+ readonly stepStateComplete: () => string;
128
+ /** A page the reader has not reached. */
129
+ readonly stepStateUnvisited: () => string;
130
+ /** The visible count a blocked checkpoint states. */
131
+ readonly stepStateBlocked: (count: number) => string;
132
+ /** A repeating record with no committed rows. */
133
+ readonly rowsEmpty: () => string;
134
+ /** An array declared inside a row, which v1 cannot address; said instead of thrown. */
135
+ readonly nestedListRefused: () => string;
136
+ /** The polite count after a row is removed. */
137
+ readonly rowRemoved: (count: number) => string;
138
+ /** A row's group name: its position and, when it holds one, its natural key. */
139
+ readonly rowHeading: (position: number, key: string) => string;
140
+ /** A row's name when the host assigned no natural key. */
141
+ readonly rowAtPosition: (position: number) => string;
142
+ /** The add-row button. */
143
+ readonly addRow: () => string;
144
+ /** The remove-row button, naming the row it removes. */
145
+ readonly removeRow: (name: string) => string;
146
+ /** A structural refusal on removal; the engine's detail is rendered apart from it. */
147
+ readonly rowRemoveFailed: () => string;
148
+ /** A structural refusal on append; the engine's detail is rendered apart from it. */
149
+ readonly rowAddFailed: () => string;
150
+ /** A write the session refused, stated beside the control whose value was left unchanged. */
151
+ readonly writeRefused: () => string;
152
+ /** The fallback when a structural refusal is not an `Error`. */
153
+ readonly rowRefused: () => string;
154
+ /** A picker whose domain is still loading. */
155
+ readonly loadingOptions: () => string;
156
+ /** A picker whose domain failed to load; the loader's detail is rendered apart from it. */
157
+ readonly optionsFailed: () => string;
158
+ /** The action that asks a paginated domain for its next page. */
159
+ readonly loadMoreOptions: () => string;
160
+ /** The ordered-list controls. Each takes the item it acts on. */
161
+ readonly rankMoveUp: (label: string) => string;
162
+ readonly rankMoveDown: (label: string) => string;
163
+ readonly rankRemove: (label: string) => string;
164
+ /** The picker's placeholder that adds an item to the ranking. */
165
+ readonly rankAdd: () => string;
166
+ /** An empty ranking's instruction. */
167
+ readonly rankEmpty: () => string;
168
+ /** The add picker's name: the field it belongs to, then the action it offers. */
169
+ readonly rankAddTo: (label: string) => string;
170
+ /** The polite announcement after a move: the item, its new position and the total. */
171
+ readonly rankMoved: (label: string, position: number, total: number) => string;
172
+ /** The polite announcement after a removal, and how many entries remain. */
173
+ readonly rankRemoved: (label: string, remaining: number) => string;
174
+ /**
175
+ * The two halves of a quantity's accessible name.
176
+ *
177
+ * A quantity is one measurement in two controls — the amount and its unit — so each states
178
+ * which half it is, joined to the field's own label. Two controls with one name would make a
179
+ * reader's "Amount" and "Unit" indistinguishable.
180
+ */
181
+ readonly quantityAmount: (label: string) => string;
182
+ readonly quantityUnit: (label: string) => string;
183
+ /** The stepper buttons of a whole-number quantity. */
184
+ readonly quantityStep: (label: string, direction: 'increase' | 'decrease') => string;
185
+ /**
186
+ * The two stepper buttons of an integer entry.
187
+ *
188
+ * The amount is not in the name: the declared step can be 5 or 25, and a sentence that said
189
+ * "by one" would lie about it. The label names the field, which is what a reader needs when
190
+ * several integers share a form.
191
+ */
192
+ readonly integerStep: (label: string, direction: 'increase' | 'decrease') => string;
193
+ /** The percentage sign a percentage entry shows beside its amount. */
194
+ readonly percentageSign: () => string;
195
+ /** The localized unit label shown beside a duration entry (`minutes`, `hours`, `seconds`). */
196
+ readonly durationUnit: (unit: DurationUnit) => string;
197
+ /**
198
+ * The six members of an address editor. Each is a visible label; the field's own label is the
199
+ * group's legend, and `memberScope` is the hidden half that keeps a reader who lands on
200
+ * "Line 1" aware of which address it belongs to.
201
+ */
202
+ readonly addressLine1: () => string;
203
+ readonly addressLine2: () => string;
204
+ readonly addressCity: () => string;
205
+ readonly addressRegion: () => string;
206
+ readonly addressPostalCode: () => string;
207
+ readonly addressCountry: () => string;
208
+ /** The country picker's "no choice" entry. */
209
+ readonly addressCountryPlaceholder: () => string;
210
+ /** A member control's scope, appended to its own visible label for assistive technology. */
211
+ readonly memberScope: (label: string) => string;
212
+ /**
213
+ * The localised name of an ISO 3166-1 alpha-2 code, or the code itself when the platform's CLDR
214
+ * data does not name it. The control never prints a bare code as though it were a country.
215
+ */
216
+ readonly countryName: (code: string) => string;
217
+ /** The two manual coordinate members, and the words that state their range. */
218
+ readonly coordinateLatitude: () => string;
219
+ readonly coordinateLongitude: () => string;
220
+ readonly coordinateRange: (low: string, high: string) => string;
221
+ readonly coordinateOutOfRange: (member: string, low: string, high: string) => string;
222
+ readonly coordinateNotDecimal: (member: string) => string;
223
+ /**
224
+ * The capture action and the states it can end in.
225
+ *
226
+ * A denial, a missing device and a timeout are different facts, so each gets its own sentence
227
+ * and each names the manual path that is still available.
228
+ */
229
+ readonly positionCapture: (label: string) => string;
230
+ readonly positionRequesting: () => string;
231
+ readonly positionIdleHint: () => string;
232
+ /** The instruction a page with no capture port offers: the manual path is the only path. */
233
+ readonly positionManualHint: () => string;
234
+ readonly positionDenied: () => string;
235
+ readonly positionUnavailable: () => string;
236
+ readonly positionTimedOut: () => string;
237
+ readonly positionFailed: () => string;
238
+ readonly positionInvalidReading: () => string;
239
+ readonly positionAccuracyLabel: () => string;
240
+ readonly positionCapturedAtLabel: () => string;
241
+ readonly positionMetres: (metres: string) => string;
242
+ readonly positionCapturedAt: (iso: string) => string;
243
+ /**
244
+ * One refused buffered entry, from the stable reason key the layer states.
245
+ *
246
+ * The web layer also restates through this door: a quantity or percentage refusal the parser's
247
+ * key would misname, and the bounds and step an integer entry states in words.
248
+ */
249
+ readonly buffer: (reason: BufferRefusalReason | WebBufferReason, params: BufferParams) => string;
250
+ /** The locale text for a value whose canonical spelling is not display text. */
251
+ readonly display: ValueDisplay;
252
+ /** The "no choice" entry of a choice picker, which clears the answer. */
253
+ readonly selectPlaceholder: () => string;
254
+ /** The freeform tags rule, and the count it announces when entries commit. */
255
+ readonly freeformTagsHint: () => string;
256
+ readonly freeformTagsCount: (count: number) => string;
257
+ /** A loaded picker whose domain offers nothing, stated apart from the loading sentence. */
258
+ readonly emptyOptions: () => string;
259
+ /**
260
+ * A search whose page came back empty.
261
+ *
262
+ * It says the reader's text matched nothing, which is a different answer from a source that
263
+ * offers no values at all: the second sentence must not accuse the reader's words.
264
+ */
265
+ readonly noMatches: () => string;
266
+ /**
267
+ * The marker appended to an option the declaration still offers but no longer recommends.
268
+ *
269
+ * A deprecated option stays selectable, so the marker is text rather than a disabled state:
270
+ * the visible label and the screen reader hear the same words.
271
+ */
272
+ readonly deprecatedSuffix: () => string;
273
+ /**
274
+ * The one sentence a filtering combobox states about its own contract: typing narrows the
275
+ * list and Enter chooses the highlighted option, where a native select commits on selection.
276
+ */
277
+ readonly comboboxHint: () => string;
278
+ }
279
+ /** The values a buffer refusal message interpolates. */
280
+ type BufferParams = Readonly<Record<string, string | number>> | undefined;
281
+ /**
282
+ * A reason the web layer states where the parser's key would name the wrong family.
283
+ *
284
+ * The parser keeps its own keys: the web layer restates an over-scale quantity and a
285
+ * whole-number refusal on a percentage, and states the bounds and step an integer entry
286
+ * carries, through the same door with the numbers they name.
287
+ */
288
+ export type WebBufferReason = 'buffer.quantity.scale_exceeded' | 'buffer.percentage.digits' | 'buffer.percentage.no_point' | 'buffer.percentage.not_safe' | 'buffer.integer.minimum' | 'buffer.integer.maximum' | 'buffer.integer.range' | 'buffer.integer.step';
289
+ /**
290
+ * The locales this catalogue carries.
291
+ *
292
+ * `formCopy` answers English for a locale not named here, so the list is the difference between
293
+ * "translated" and "fell back". It is exported because the parity gate cannot enumerate a private
294
+ * table: a sixth locale added below without being named here would be invisible to the check that
295
+ * every locale is complete.
296
+ */
297
+ export declare const FORM_COPY_LOCALES: readonly ['en', 'es', 'pt', 'fr', 'ar', 'de', 'it', 'ru', 'zh'];
298
+ /** One locale the catalogue carries. */
299
+ export type FormCopyLocale = (typeof FORM_COPY_LOCALES)[number];
300
+ /** The catalogue's own spelling of a locale tag, or `undefined` when it is not carried. */
301
+ export declare function shippedLocale(tag: string | undefined): FormCopyLocale | undefined;
302
+ /** The published spelling of the host copy for one locale, falling back to English for a locale it does not carry. */
303
+ export declare function formCopy(locale: string | undefined): FormCopy;
304
+ /** The name the earlier reference adapter used; `FormCopy` is the published spelling. */
305
+ export type HostCopy = FormCopy;
306
+ /** The copy the rendered tree reads; the page supplies the provider for the selected locale. */
307
+ export declare const FormCopyContext: Context<FormCopy>;
308
+ /** The copy in force for the tree, under the published name. */
309
+ export declare function useFormCopy(): FormCopy;
310
+ /** The host copy in force for the tree being rendered. */
311
+ export declare function useHostCopy(): FormCopy;
312
+ export {};
313
+ //# sourceMappingURL=copy.d.ts.map