@canonical/react-ds-global-form 0.36.0 → 0.38.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 (126) hide show
  1. package/README.md +40 -0
  2. package/dist/esm/density.css +320 -302
  3. package/dist/esm/docs/examples/density-examples.css +19 -14
  4. package/dist/esm/index.css +361 -335
  5. package/dist/esm/lib/_work_in_progress/DensityTestbed/baseline-system.css +71 -64
  6. package/dist/esm/lib/_work_in_progress/DensityTestbed/density.testbed.css +127 -123
  7. package/dist/esm/lib/common/Wrapper/ToggleWrapper.css +73 -54
  8. package/dist/esm/lib/common/Wrapper/styles.css +35 -31
  9. package/dist/esm/lib/component/ChoicesField/common/Option/Option.js +4 -1
  10. package/dist/esm/lib/component/ChoicesField/common/Option/Option.js.map +1 -1
  11. package/dist/esm/lib/component/ChoicesField/styles.css +195 -163
  12. package/dist/esm/lib/component/RangeField/common/RangeControl/styles.css +39 -35
  13. package/dist/esm/lib/component/RichChoicesField/styles.css +93 -89
  14. package/dist/esm/lib/index.js +2 -0
  15. package/dist/esm/lib/index.js.map +1 -1
  16. package/dist/esm/lib/subcomponent/CheckboxInput/styles.css +115 -111
  17. package/dist/esm/lib/subcomponent/ColorInput/styles.css +177 -173
  18. package/dist/esm/lib/subcomponent/ComboboxInput/SingleCombobox.js +2 -1
  19. package/dist/esm/lib/subcomponent/ComboboxInput/SingleCombobox.js.map +1 -1
  20. package/dist/esm/lib/subcomponent/ComboboxInput/common/List/List.js +1 -1
  21. package/dist/esm/lib/subcomponent/ComboboxInput/common/List/List.js.map +1 -1
  22. package/dist/esm/lib/subcomponent/ComboboxInput/common/List/styles.css +33 -29
  23. package/dist/esm/lib/subcomponent/ComboboxInput/common/ResetButton/styles.css +21 -17
  24. package/dist/esm/lib/subcomponent/ComboboxInput/styles.css +59 -55
  25. package/dist/esm/lib/subcomponent/ComboboxInput/utils/index.js +0 -1
  26. package/dist/esm/lib/subcomponent/ComboboxInput/utils/index.js.map +1 -1
  27. package/dist/esm/lib/subcomponent/DateInput/styles.css +23 -19
  28. package/dist/esm/lib/subcomponent/DateTimeInput/styles.css +24 -20
  29. package/dist/esm/lib/subcomponent/Field/Description/styles.css +9 -5
  30. package/dist/esm/lib/subcomponent/Field/Error/styles.css +9 -5
  31. package/dist/esm/lib/subcomponent/Field/Label/Label.js +2 -2
  32. package/dist/esm/lib/subcomponent/Field/Label/Label.js.map +1 -1
  33. package/dist/esm/lib/subcomponent/Field/Label/styles.css +25 -21
  34. package/dist/esm/lib/subcomponent/FileUploadInput/styles.css +125 -119
  35. package/dist/esm/lib/subcomponent/NumberInput/styles.css +32 -28
  36. package/dist/esm/lib/subcomponent/PasswordInput/styles.css +58 -54
  37. package/dist/esm/lib/subcomponent/PhoneInput/PhoneInput.js +44 -20
  38. package/dist/esm/lib/subcomponent/PhoneInput/PhoneInput.js.map +1 -1
  39. package/dist/esm/lib/subcomponent/PhoneInput/styles.css +53 -49
  40. package/dist/esm/lib/subcomponent/RadioInput/styles.css +70 -66
  41. package/dist/esm/lib/subcomponent/RangeInput/styles.css +74 -70
  42. package/dist/esm/lib/subcomponent/RatingInput/styles.css +132 -128
  43. package/dist/esm/lib/subcomponent/SelectInput/styles.css +44 -40
  44. package/dist/esm/lib/subcomponent/SwitchInput/styles.css +90 -86
  45. package/dist/esm/lib/subcomponent/TextInput/styles.css +30 -26
  46. package/dist/esm/lib/subcomponent/TextareaInput/styles.css +14 -10
  47. package/dist/esm/lib/subcomponent/TimeInput/styles.css +19 -15
  48. package/dist/esm/lib/utils/countries/index.js +3 -3
  49. package/dist/esm/lib/utils/countries/index.js.map +1 -1
  50. package/dist/esm/lib/utils/formatter/applyPattern.js +38 -0
  51. package/dist/esm/lib/utils/formatter/applyPattern.js.map +1 -0
  52. package/dist/esm/lib/utils/formatter/createFormatterRegisterOptions.js +22 -0
  53. package/dist/esm/lib/utils/formatter/createFormatterRegisterOptions.js.map +1 -0
  54. package/dist/esm/lib/utils/formatter/createPatternFormatter.js +25 -0
  55. package/dist/esm/lib/utils/formatter/createPatternFormatter.js.map +1 -0
  56. package/dist/esm/lib/utils/formatter/index.js +8 -0
  57. package/dist/esm/lib/utils/formatter/index.js.map +1 -0
  58. package/dist/esm/lib/utils/formatter/stripToDigits.js +12 -0
  59. package/dist/esm/lib/utils/formatter/stripToDigits.js.map +1 -0
  60. package/dist/esm/lib/utils/formatter/types.js +2 -0
  61. package/dist/esm/lib/utils/formatter/types.js.map +1 -0
  62. package/dist/esm/lib/utils/hooks/index.js +1 -0
  63. package/dist/esm/lib/utils/hooks/index.js.map +1 -1
  64. package/dist/esm/lib/utils/hooks/types.js +2 -0
  65. package/dist/esm/lib/utils/hooks/types.js.map +1 -0
  66. package/dist/esm/lib/utils/hooks/useFormattedValue.js +195 -0
  67. package/dist/esm/lib/utils/hooks/useFormattedValue.js.map +1 -0
  68. package/dist/esm/lib/utils/index.js +6 -2
  69. package/dist/esm/lib/utils/index.js.map +1 -1
  70. package/dist/esm/lib/utils/mergeRefs.js +25 -0
  71. package/dist/esm/lib/utils/mergeRefs.js.map +1 -0
  72. package/dist/esm/lib/utils/middleware/addRESTValidation.js +1 -1
  73. package/dist/esm/lib/utils/middleware/addRESTValidation.js.map +1 -1
  74. package/dist/types/lib/component/ChoicesField/common/Option/Option.d.ts.map +1 -1
  75. package/dist/types/lib/component/PhoneField/PhoneField.d.ts +2 -1
  76. package/dist/types/lib/component/PhoneField/PhoneField.d.ts.map +1 -1
  77. package/dist/types/lib/index.d.ts +4 -0
  78. package/dist/types/lib/index.d.ts.map +1 -1
  79. package/dist/types/lib/subcomponent/ComboboxInput/SingleCombobox.d.ts.map +1 -1
  80. package/dist/types/lib/subcomponent/ComboboxInput/utils/index.d.ts +0 -1
  81. package/dist/types/lib/subcomponent/ComboboxInput/utils/index.d.ts.map +1 -1
  82. package/dist/types/lib/subcomponent/PhoneInput/PhoneInput.d.ts +19 -2
  83. package/dist/types/lib/subcomponent/PhoneInput/PhoneInput.d.ts.map +1 -1
  84. package/dist/types/lib/subcomponent/PhoneInput/types.d.ts +20 -7
  85. package/dist/types/lib/subcomponent/PhoneInput/types.d.ts.map +1 -1
  86. package/dist/types/lib/utils/countries/index.d.ts +0 -3
  87. package/dist/types/lib/utils/countries/index.d.ts.map +1 -1
  88. package/dist/types/lib/utils/formatter/applyPattern.d.ts +17 -0
  89. package/dist/types/lib/utils/formatter/applyPattern.d.ts.map +1 -0
  90. package/dist/types/lib/utils/formatter/createFormatterRegisterOptions.d.ts +20 -0
  91. package/dist/types/lib/utils/formatter/createFormatterRegisterOptions.d.ts.map +1 -0
  92. package/dist/types/lib/utils/formatter/createPatternFormatter.d.ts +19 -0
  93. package/dist/types/lib/utils/formatter/createPatternFormatter.d.ts.map +1 -0
  94. package/dist/types/lib/utils/formatter/index.d.ts +6 -0
  95. package/dist/types/lib/utils/formatter/index.d.ts.map +1 -0
  96. package/dist/types/lib/utils/formatter/stripToDigits.d.ts +10 -0
  97. package/dist/types/lib/utils/formatter/stripToDigits.d.ts.map +1 -0
  98. package/dist/types/lib/utils/formatter/types.d.ts +30 -0
  99. package/dist/types/lib/utils/formatter/types.d.ts.map +1 -0
  100. package/dist/types/lib/utils/hooks/index.d.ts +2 -0
  101. package/dist/types/lib/utils/hooks/index.d.ts.map +1 -1
  102. package/dist/types/lib/utils/hooks/types.d.ts +33 -0
  103. package/dist/types/lib/utils/hooks/types.d.ts.map +1 -0
  104. package/dist/types/lib/utils/hooks/useFormattedValue.d.ts +30 -0
  105. package/dist/types/lib/utils/hooks/useFormattedValue.d.ts.map +1 -0
  106. package/dist/types/lib/utils/index.d.ts +2 -0
  107. package/dist/types/lib/utils/index.d.ts.map +1 -1
  108. package/dist/types/lib/utils/mergeRefs.d.ts +14 -0
  109. package/dist/types/lib/utils/mergeRefs.d.ts.map +1 -0
  110. package/package.json +17 -16
  111. package/dist/esm/lib/subcomponent/ComboboxInput/utils/mergeRefs.js +0 -12
  112. package/dist/esm/lib/subcomponent/ComboboxInput/utils/mergeRefs.js.map +0 -1
  113. package/dist/esm/lib/utils/countries/applyPhoneMask.js +0 -35
  114. package/dist/esm/lib/utils/countries/applyPhoneMask.js.map +0 -1
  115. package/dist/esm/lib/utils/countries/phoneRegisterOptions.js +0 -18
  116. package/dist/esm/lib/utils/countries/phoneRegisterOptions.js.map +0 -1
  117. package/dist/esm/lib/utils/countries/removePhoneMask.js +0 -12
  118. package/dist/esm/lib/utils/countries/removePhoneMask.js.map +0 -1
  119. package/dist/types/lib/subcomponent/ComboboxInput/utils/mergeRefs.d.ts +0 -3
  120. package/dist/types/lib/subcomponent/ComboboxInput/utils/mergeRefs.d.ts.map +0 -1
  121. package/dist/types/lib/utils/countries/applyPhoneMask.d.ts +0 -14
  122. package/dist/types/lib/utils/countries/applyPhoneMask.d.ts.map +0 -1
  123. package/dist/types/lib/utils/countries/phoneRegisterOptions.d.ts +0 -14
  124. package/dist/types/lib/utils/countries/phoneRegisterOptions.d.ts.map +0 -1
  125. package/dist/types/lib/utils/countries/removePhoneMask.d.ts +0 -10
  126. package/dist/types/lib/utils/countries/removePhoneMask.d.ts.map +0 -1
@@ -0,0 +1,195 @@
1
+ import { useEffect, useLayoutEffect, useRef, useState } from "react";
2
+ // `useLayoutEffect` has no meaning on the server and React warns when it is
3
+ // called there. The caret work is inherently client-only, so fall back to
4
+ // `useEffect`, which never runs during `renderToString`.
5
+ const useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
6
+ /**
7
+ * Drop the model character at `index`.
8
+ *
9
+ * @note Pure.
10
+ */
11
+ function removeModelCharAt(model, index) {
12
+ return model.slice(0, index) + model.slice(index + 1);
13
+ }
14
+ /**
15
+ * Classify an edit as an insertion or a deletion, and which way the deletion
16
+ * ran. Backspace and forward Delete over a separator produce an identical value
17
+ * and caret, so the event is the only thing that tells them apart.
18
+ *
19
+ * Falls back to backspace when `inputType` is absent — synthetic events dispatch
20
+ * a plain `Event`, and backspace is the only deletion worth assuming.
21
+ *
22
+ * @note Pure.
23
+ */
24
+ function readEditIntent(event) {
25
+ const { inputType } = event.nativeEvent;
26
+ if (inputType === undefined)
27
+ return "deleteBackward";
28
+ if (inputType.includes("Forward"))
29
+ return "deleteForward";
30
+ if (inputType.startsWith("delete"))
31
+ return "deleteBackward";
32
+ return "insert";
33
+ }
34
+ /**
35
+ * Find the offset in `view` with exactly `offset` model characters before it —
36
+ * where the caret belongs once the value has been reformatted.
37
+ *
38
+ * Display offsets cannot be carried across a reformat directly, because
39
+ * inserting one digit can move every separator after it. Counting model
40
+ * characters is stable under that: the user's caret is "after the 4th digit"
41
+ * whatever decoration surrounds it.
42
+ *
43
+ * @note Pure.
44
+ */
45
+ function findCaretOffset(formatter, view, offset) {
46
+ let position = 0;
47
+ while (position < view.length &&
48
+ formatter.parse(view.slice(0, position)).length < offset) {
49
+ position += 1;
50
+ }
51
+ return position;
52
+ }
53
+ /**
54
+ * Work out which model an edit produces, and where the caret ends up in it.
55
+ *
56
+ * Deleting a separator is the case worth naming: it leaves the model untouched,
57
+ * so a reformat would put the character straight back and the keystroke would
58
+ * appear to do nothing. A model character is removed instead — the one behind
59
+ * the caret for a backspace, the one ahead of it for a forward delete.
60
+ *
61
+ * That substitution applies only when a deletion removed exactly one display
62
+ * character. A wider edit — a paste, or a range replaced with equivalent text —
63
+ * can legitimately produce the same model from a shorter string, and must not be
64
+ * read as "take a digit instead".
65
+ *
66
+ * @note Pure.
67
+ */
68
+ function resolveEdit(formatter, model, view, caret, intent) {
69
+ const offset = formatter.parse(view.slice(0, caret)).length;
70
+ const parsed = formatter.parse(view);
71
+ const removedOneCharacter = view.length === formatter.format(model).length - 1;
72
+ if (parsed !== model || intent === "insert" || !removedOneCharacter) {
73
+ return { model: parsed, offset };
74
+ }
75
+ if (intent === "deleteForward") {
76
+ // The caret does not move: the character it was sitting in front of goes.
77
+ return offset < model.length
78
+ ? { model: removeModelCharAt(model, offset), offset }
79
+ : { model, offset };
80
+ }
81
+ return offset > 0
82
+ ? { model: removeModelCharAt(model, offset - 1), offset: offset - 1 }
83
+ : { model, offset };
84
+ }
85
+ /**
86
+ * Put the formatted value back on an element after an edit that changed nothing.
87
+ *
88
+ * Typing a character the formatter discards leaves the model equal, so React
89
+ * re-renders nothing and the rejected text would otherwise sit in the DOM.
90
+ *
91
+ * @note Impure — writes the element's value and selection directly, because
92
+ * there is no render to hang the correction on.
93
+ */
94
+ function restoreRejectedEdit(node, formatter, model, offset) {
95
+ const view = formatter.format(model);
96
+ node.value = view;
97
+ const position = findCaretOffset(formatter, view, offset);
98
+ node.setSelectionRange(position, position);
99
+ }
100
+ /**
101
+ * Drive a text input whose displayed string is a formatted projection of the
102
+ * value it stores, without the caret jumping to the end on every keystroke.
103
+ *
104
+ * The naive spelling of this — `value={format(model)}` with an `onChange` that
105
+ * parses back — reformats the whole string on each edit, so React rewrites
106
+ * `input.value` and the browser drops the caret at the end. Editing anywhere but
107
+ * the end becomes impossible. This hook does the same projection but restores
108
+ * the caret afterwards, by position in the model rather than in the display.
109
+ *
110
+ * Composed text is rendered verbatim until `compositionend`, so an IME is never
111
+ * rewritten mid-composition.
112
+ *
113
+ * The value is owned by the caller: this hook never holds it in state, so it
114
+ * composes with react-hook-form, a `useState` above it, or any other source.
115
+ *
116
+ * The `formatter` must satisfy the contract on {@link Formatter} — in
117
+ * particular `parse(format(m)) === m`. A `parse` that truncates or is not a left
118
+ * inverse will strand the caret at the end and can make a deletion remove the
119
+ * wrong character.
120
+ *
121
+ * Only for inputs that support text selection. `setSelectionRange` throws on
122
+ * `type="number"` and `type="email"`.
123
+ *
124
+ * @note Impure — moves the caret on the element behind `ref`, which is the whole
125
+ * point of the hook and cannot be expressed as a return value.
126
+ */
127
+ export default function useFormattedValue({ formatter, model, onModelChange, }) {
128
+ const ref = useRef(null);
129
+ // The caret to restore once the reformatted value has been committed, stamped
130
+ // with the view it belongs to so an unrelated commit cannot consume it.
131
+ const pending = useRef(null);
132
+ const composing = useRef(false);
133
+ // The raw text an IME is composing, rendered verbatim so the element is not
134
+ // rewritten mid-composition. Null whenever no composition is in progress.
135
+ const [composingView, setComposingView] = useState(null);
136
+ const commit = (next, offset) => {
137
+ pending.current = { offset, view: formatter.format(next) };
138
+ onModelChange(next);
139
+ };
140
+ const handleChange = (event) => {
141
+ const node = event.target;
142
+ // Mid-composition the text is provisional. Render it back exactly as typed:
143
+ // formatting it, or simply declining to emit, both let React restore the
144
+ // previous value underneath the IME and destroy the composition.
145
+ if (composing.current) {
146
+ setComposingView(node.value);
147
+ return;
148
+ }
149
+ const caret = node.selectionStart ?? node.value.length;
150
+ const edit = resolveEdit(formatter, model, node.value, caret, readEditIntent(event));
151
+ if (edit.model === model) {
152
+ restoreRejectedEdit(node, formatter, model, edit.offset);
153
+ return;
154
+ }
155
+ commit(edit.model, edit.offset);
156
+ };
157
+ const handleCompositionStart = () => {
158
+ composing.current = true;
159
+ };
160
+ const handleCompositionEnd = (event) => {
161
+ composing.current = false;
162
+ const node = event.currentTarget;
163
+ const composed = node.value;
164
+ const caret = node.selectionStart ?? composed.length;
165
+ setComposingView(null);
166
+ const parsed = formatter.parse(composed);
167
+ if (parsed === model)
168
+ return;
169
+ commit(parsed, formatter.parse(composed.slice(0, caret)).length);
170
+ };
171
+ // Runs after every commit, but acts only on the one this hook's own edit
172
+ // produced — matching the committed view against the caret's stamp. A render
173
+ // the user did not cause (an external `reset()`, say) never moves their cursor.
174
+ useIsomorphicLayoutEffect(() => {
175
+ const node = ref.current;
176
+ const target = pending.current;
177
+ if (node === null || target === null)
178
+ return;
179
+ if (node.value !== target.view)
180
+ return;
181
+ pending.current = null;
182
+ if (document.activeElement !== node)
183
+ return;
184
+ const position = findCaretOffset(formatter, node.value, target.offset);
185
+ node.setSelectionRange(position, position);
186
+ });
187
+ return {
188
+ value: composingView ?? formatter.format(model),
189
+ onChange: handleChange,
190
+ onCompositionStart: handleCompositionStart,
191
+ onCompositionEnd: handleCompositionEnd,
192
+ ref,
193
+ };
194
+ }
195
+ //# sourceMappingURL=useFormattedValue.js.map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M,KAAK,IAAI;YAAE,OAAO;QAC7C,IAAI,IAAI,CAAC,KAAK,KAAK,MAAM,CAAC,IAAI;YAAE,OAAO;QACvC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;QACvB,IAAI,QAAQ,CAAC,aAAa,KAAK,IAAI;YAAE,OAAO;QAE5C,MAAM,QAAQ,GAAG,eAAe,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QACvE,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,KAAK,EAAE,aAAa,IAAI,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC;QAC/C,QAAQ,EAAE,YAAY;QACtB,kBAAkB,EAAE,sBAAsB;QAC1C,gBAAgB,EAAE,oBAAoB;QACtC,GAAG;KACJ,CAAC;AACJ,CAAC"}
@@ -1,5 +1,9 @@
1
- // Generic supporting helpers (not an ontology tier): shared hooks + form
2
- // middleware. Any tier may depend on `utils/` downward.
1
+ // Generic supporting helpers (not an ontology tier): shared hooks, value
2
+ // formatting, form middleware, and the ref merger they share. Any tier may
3
+ // depend on `utils/` downward. The country dataset is reached directly rather
4
+ // than through here, since only the phone input has any use for it.
5
+ export * from "./formatter/index.js";
3
6
  export * from "./hooks/index.js";
7
+ export { default as mergeRefs } from "./mergeRefs.js";
4
8
  export * from "./middleware/index.js";
5
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,wDAAwD;AACxD,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,2EAA2E;AAC3E,8EAA8E;AAC9E,oEAAoE;AACpE,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtD,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Fan one element out to several refs, so a component can keep its own internal
3
+ * ref while still honouring a forwarded one. Accepts both callback refs and ref
4
+ * objects, and ignores `undefined` entries, so an optional forwarded ref can be
5
+ * passed straight through.
6
+ *
7
+ * @example
8
+ * <input ref={mergeRefs(internalRef, forwardedRef)} />
9
+ *
10
+ * @note Pure — returns a new callback ref; the returned callback is impure by
11
+ * necessity, since assigning the element to each ref is its whole purpose.
12
+ */
13
+ export default function mergeRefs(...refs) {
14
+ return (instance) => {
15
+ for (const ref of refs) {
16
+ if (typeof ref === "function") {
17
+ ref(instance);
18
+ }
19
+ else if (ref) {
20
+ ref.current = instance;
21
+ }
22
+ }
23
+ };
24
+ }
25
+ //# sourceMappingURL=mergeRefs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mergeRefs.js","sourceRoot":"","sources":["../../../../src/lib/utils/mergeRefs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,GAAG,IAAkC;IAErC,OAAO,CAAC,QAAkB,EAAE,EAAE;QAC5B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE,CAAC;gBAC9B,GAAG,CAAC,QAAQ,CAAC,CAAC;YAChB,CAAC;iBAAM,IAAI,GAAG,EAAE,CAAC;gBACd,GAAiC,CAAC,OAAO,GAAG,QAAQ,CAAC;YACxD,CAAC;QACH,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
@@ -1,4 +1,4 @@
1
- import { debounce } from "@canonical/utils";
1
+ import { debounce } from "@canonical/ds-utils";
2
2
  import { createElement, useCallback, useEffect } from "react";
3
3
  import { useFormContext } from "react-hook-form";
4
4
  function addRESTFieldValidation(url, options = {}) {
@@ -1 +1 @@
1
- {"version":3,"file":"addRESTValidation.js","sourceRoot":"","sources":["../../../../../src/lib/utils/middleware/addRESTValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAajD,SAAS,sBAAsB,CAC7B,GAAW,EACX,UAA6B,EAAE;IAG/B,MAAM,EACJ,MAAM,GAAG,MAAM,EACf,OAAO,GAAG,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAChD,aAAa,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EACtC,cAAc,GAAG,KAAK,IAAI,EAAE,CAAC,mBAAmB,EAChD,SAAS,GAAG,CAAC,EACb,YAAY,GAAG,GAAG,GACnB,GAAG,OAAO,CAAC;IAEZ,OAAO,CAAC,gBAAgB,EAAE,EAAE;QAC1B,OAAO,SAAS,iBAAiB,CAAC,KAAK;YACrC,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;YACvB,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,cAAc,EAAE,CAAC;YAC1D,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;YAE1B,MAAM,cAAc,GAAG,WAAW,CAChC,QAAQ,CAAC,KAAK,EAAE,GAAW,EAAE,EAAE;gBAC7B,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;oBAChC,MAAM;oBACN,OAAO;oBACP,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;iBACzC,CAAC,CAAC;gBACH,IAAI,CAAC,QAAQ,CAAC,EAAE,E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AW,CAAC,CAAC,CAAC;YAE/C,OAAO,aAAa,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;QAChD,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED,eAAe,sBAAsB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Option.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/component/ChoicesField/common/Option/Option.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI9C;;;;;GAKG;AACH,QAAA,MAAM,MAAM,GAAI,sDAOb,WAAW,KAAG,KAAK,CAAC,YAuBtB,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Option.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/component/ChoicesField/common/Option/Option.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI9C;;;;;GAKG;AACH,QAAA,MAAM,MAAM,GAAI,sDAOb,WAAW,KAAG,KAAK,CAAC,YAmCtB,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -27,6 +27,7 @@ declare const _default: (props: {
27
27
  "aria-errormessage"?: string | undefined;
28
28
  "aria-invalid"?: boolean | undefined;
29
29
  "aria-labelledby"?: string | undefined;
30
+ onBlur?: React.FocusEventHandler<HTMLInputElement> | undefined;
30
31
  onChange?: ((value: string | import("../../subcomponent/PhoneInput/types.js").PhoneValue) => void) | undefined;
31
32
  registerProps?: import("react-hook-form").RegisterOptions | undefined;
32
33
  isOptional?: boolean | undefined;
@@ -44,8 +45,8 @@ declare const _default: (props: {
44
45
  }>>) | undefined;
45
46
  condition?: import("../../index.js").Condition | undefined;
46
47
  defaultCountry?: import("../../utils/countries/types.js").KnownCountryCode | undefined;
47
- preferredCountries?: import("../../utils/countries/types.js").KnownCountryCode[] | undefined;
48
48
  filteredCountries?: import("../../utils/countries/types.js").KnownCountryCode[] | undefined;
49
+ preferredCountries?: import("../../utils/countries/types.js").KnownCountryCode[] | undefined;
49
50
  countries?: import("../../utils/countries/types.js").CountryData[] | undefined;
50
51
  valueFormat?: "e164" | "structured" | undefined;
51
52
  countryDisplay?: "code" | "name" | "flag" | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"PhoneField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/PhoneField/PhoneField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;;;;;;;;;GAaG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBAEE"}
1
+ {"version":3,"file":"PhoneField.d.ts","sourceRoot":"","sources":["../../../../../src/lib/component/PhoneField/PhoneField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;;;;;;;;;GAaG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACH,wBAEE"}
@@ -1,5 +1,9 @@
1
1
  export * from "./pattern/index.js";
2
2
  export type { RatingInputProps, RatingScale, } from "./subcomponent/index.js";
3
3
  export { RatingInput } from "./subcomponent/index.js";
4
+ export type { Formatter } from "./utils/formatter/index.js";
5
+ export { applyPattern, createFormatterRegisterOptions, createPatternFormatter, stripToDigits, } from "./utils/formatter/index.js";
6
+ export type { UseFormattedValueProps, UseFormattedValueResult, } from "./utils/hooks/index.js";
7
+ export { useFormattedValue } from "./utils/hooks/index.js";
4
8
  export * from "./utils/middleware/index.js";
5
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAIA,cAAc,oBAAoB,CAAC;AAMnC,YAAY,EACV,gBAAgB,EAChB,WAAW,GACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAIA,cAAc,oBAAoB,CAAC;AAMnC,YAAY,EACV,gBAAgB,EAChB,WAAW,GACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAMtD,YAAY,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EACL,YAAY,EACZ,8BAA8B,EAC9B,sBAAsB,EACtB,aAAa,GACd,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,cAAc,6BAA6B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SingleCombobox.d.ts","sourceRoot":"","sources":["../../../../../src/lib/subcomponent/ComboboxInput/SingleCombobox.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAI1C,OAAO,EACL,mBAAmB,IAAI,0BAA0B,EACjD,kBAAkB,IAAI,yBAAyB,EAGhD,MAAM,kBAAkB,CAAC;AAC1B,OAAO,cAAc,CAAC;AAGtB;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;oDAsH1B,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"SingleCombobox.d.ts","sourceRoot":"","sources":["../../../../../src/lib/subcomponent/ComboboxInput/SingleCombobox.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAI1C,OAAO,EACL,mBAAmB,IAAI,0BAA0B,EACjD,kBAAkB,IAAI,yBAAyB,EAEhD,MAAM,kBAAkB,CAAC;AAC1B,OAAO,cAAc,CAAC;AAItB;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;oDAsH1B,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,5 +1,4 @@
1
1
  export { default as convertItemToString } from "./convertItemToString.js";
2
2
  export { default as convertValueToItem } from "./convertValueToItem.js";
3
3
  export { default as filterItems } from "./filterItems.js";
4
- export { default as mergeRefs } from "./mergeRefs.js";
5
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/subcomponent/ComboboxInput/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/subcomponent/ComboboxInput/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type React from "react";
2
- import type { PhoneInputProps } from "./types.js";
2
+ import { type CountryData, type KnownCountryCode } from "../../utils/countries/index.js";
3
+ import type { PhoneValue } from "./types.js";
3
4
  import "./styles.css";
4
5
  /**
5
6
  * Presentational phone input combining a country code selector with a telephone
@@ -10,12 +11,28 @@ import "./styles.css";
10
11
  * (an E.164 string or a structured `{ countryCode, number }` object). It
11
12
  * defaults defensively, so an undefined initial `value` renders the
12
13
  * `defaultCountry` with an empty number.
14
+ *
15
+ * The forwarded ref reaches the national-number input — the field's focusable
16
+ * element, and what react-hook-form needs for `setFocus` and focus-on-error.
13
17
  * @returns {React.ReactElement} - Rendered Phone
14
18
  *
15
19
  * `import { PhoneInput } from "@canonical/react-ds-global-form";`
16
20
  *
17
21
  * @implements ds:global.subcomponent.phone_input
18
22
  */
19
- export declare const PhoneInput: ({ id, className, style, value, onChange, defaultCountry, preferredCountries, filteredCountries, countries, valueFormat, countryDisplay, mask, disabled, }: PhoneInputProps) => React.ReactElement;
23
+ export declare const PhoneInput: React.ForwardRefExoticComponent<import("../types.js").BaseProps & {
24
+ name?: string;
25
+ value?: string | PhoneValue;
26
+ onChange?: (value: string | PhoneValue) => void;
27
+ onBlur?: React.FocusEventHandler<HTMLInputElement>;
28
+ defaultCountry?: KnownCountryCode;
29
+ filteredCountries?: KnownCountryCode[];
30
+ preferredCountries?: KnownCountryCode[];
31
+ countries?: CountryData[];
32
+ valueFormat?: "e164" | "structured";
33
+ countryDisplay?: "code" | "name" | "flag";
34
+ mask?: boolean;
35
+ disabled?: boolean;
36
+ } & React.RefAttributes<HTMLInputElement>>;
20
37
  export default PhoneInput;
21
38
  //# sourceMappingURL=PhoneInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PhoneInput.d.ts","sourceRoot":"","sources":["../../../../../src/lib/subcomponent/PhoneInput/PhoneInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,KAAK,EAAE,eAAe,EAAc,MAAM,YAAY,CAAC;AAC9D,OAAO,cAAc,CAAC;AAkCtB;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,UAAU,GAAI,2JAcxB,eAAe,KAAG,KAAK,CAAC,YAgI1B,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"PhoneInput.d.ts","sourceRoot":"","sources":["../../../../../src/lib/subcomponent/PhoneInput/PhoneInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,gBAAgB,EACtB,MAAM,gCAAgC,CAAC;AAIxC,OAAO,KAAK,EAAmB,UAAU,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,cAAc,CAAC;AAgDtB;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;0CAgKtB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -3,10 +3,22 @@ import type { BaseProps } from "../types.js";
3
3
  export type { CountryCode, CountryData, KnownCountryCode, } from "../../utils/countries/index.js";
4
4
  /** Props for the presentational Phone input (controlled, no react-hook-form). */
5
5
  export type PhoneInputProps = BaseProps & {
6
+ /**
7
+ * Name for the national-number input. The field tier supplies this; it is what
8
+ * gives the control a name in a plain HTML submission, so the entry is not
9
+ * silently dropped when scripting is unavailable.
10
+ */
11
+ name?: string;
6
12
  /** Controlled value — E.164 string or structured object. */
7
13
  value?: string | PhoneValue;
8
14
  /** Called with the next value in the configured `valueFormat`. */
9
15
  onChange?: (value: string | PhoneValue) => void;
16
+ /**
17
+ * Called when the national-number input loses focus. The field tier supplies
18
+ * this; without it react-hook-form never marks the field touched, so
19
+ * `mode: "onTouched"` never validates it and a touched-gated error never shows.
20
+ */
21
+ onBlur?: React.FocusEventHandler<HTMLInputElement>;
10
22
  /** Default country (a known ISO 3166-1 alpha-2 code from the dataset). */
11
23
  defaultCountry?: KnownCountryCode;
12
24
  /**
@@ -42,13 +54,14 @@ export type PhoneInputProps = BaseProps & {
42
54
  */
43
55
  countryDisplay?: "code" | "name" | "flag";
44
56
  /**
45
- * Opt in to live national-number formatting using the selected country's
46
- * display mask (cosmetic spacing/dashes; see {@link CountryData.format}).
47
- * Defaults to `false` — the number is shown as raw digits and `applyPhoneMask`
48
- * is not invoked. The submitted value is always raw digits / E.164 regardless
49
- * of this option. (The RHF-side `removePhoneMask` / `phoneRegisterOptions`
50
- * helpers are separate opt-in modules, so they are tree-shaken out unless
51
- * imported.)
57
+ * Opt in to live national-number grouping using the selected country's display
58
+ * pattern (cosmetic spacing/dashes; see {@link CountryData.format}). Defaults
59
+ * to `false`, which shows the number as raw digits.
60
+ *
61
+ * The submitted value is always raw digits / E.164 either way — the grouping is
62
+ * a display projection only, applied through `utils/formatter` and kept
63
+ * caret-stable by `useFormattedValue`, so the number stays editable in the
64
+ * middle rather than forcing the cursor to the end.
52
65
  */
53
66
  mask?: boolean;
54
67
  /** Whether the input is disabled. */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/subcomponent/PhoneInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAI7C,YAAY,EACV,WAAW,EACX,WAAW,EACX,gBAAgB,GACjB,MAAM,gCAAgC,CAAC;AAExC,iFAAiF;AACjF,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG;IACxC,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAE5B,kEAAkE;IAClE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,KAAK,IAAI,CAAC;IAEhD,0EAA0E;IAC1E,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAElC;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAEvC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAExC;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,EAAE,CAAC;IAE1B,uDAAuD;IACvD,WAAW,CAAC,EAAE,MA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CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAEpC;;;;;;;;;;OAUG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAE1C;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
@@ -1,8 +1,5 @@
1
- export { default as applyPhoneMask } from "./applyPhoneMask.js";
2
1
  export { default as countries } from "./countries.js";
3
2
  export type { MaskKey } from "./masks.js";
4
3
  export { default as masks } from "./masks.js";
5
- export { default as phoneRegisterOptions } from "./phoneRegisterOptions.js";
6
- export { default as removePhoneMask } from "./removePhoneMask.js";
7
4
  export type { CountryCode, CountryData, KnownCountryCode } from "./types.js";
8
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/countries/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtD,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAClE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/countries/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtD,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC;AAC9C,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Group a run of digits according to a display pattern (cosmetic only).
3
+ *
4
+ * The pattern uses `#` as a digit slot; any other character is a literal
5
+ * separator emitted between digits (e.g. `"(###) ###-####"`). Non-digits in
6
+ * `value` are stripped first, so the result is purely a function of the digits
7
+ * given. Extra digits beyond the pattern's slots are appended unformatted, so a
8
+ * longer-than-typical value is never truncated. With no pattern, the digits are
9
+ * returned as they are.
10
+ *
11
+ * This is display-only — callers keep the digits as the source of truth and
12
+ * recover them with {@link stripToDigits}.
13
+ *
14
+ * @note Pure.
15
+ */
16
+ export default function applyPattern(value: string, pattern?: string): string;
17
+ //# sourceMappingURL=applyPattern.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applyPattern.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/formatter/applyPattern.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAmB5E"}
@@ -0,0 +1,20 @@
1
+ import type { RegisterOptions } from "react-hook-form";
2
+ import type { Formatter } from "./types.js";
3
+ /**
4
+ * Build react-hook-form `register()` options that normalise a formatted display
5
+ * value back to its model form, so the registered value is whatever the
6
+ * formatter's `parse` yields regardless of how the input is decorated on screen.
7
+ * Spread into `register(name, createFormatterRegisterOptions(formatter))`, or
8
+ * merge with your own rules.
9
+ *
10
+ * This covers the `register()` path only. react-hook-form does not apply
11
+ * `setValueAs` to a field bound with `useController`, so a controlled input must
12
+ * normalise in its own change handler instead — as PhoneInput does.
13
+ *
14
+ * @example
15
+ * <input {...register("phone", createFormatterRegisterOptions(formatter))} />
16
+ *
17
+ * @note Pure.
18
+ */
19
+ export default function createFormatterRegisterOptions(formatter: Formatter): RegisterOptions;
20
+ //# sourceMappingURL=createFormatterRegisterOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createFormatterRegisterOptions.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/formatter/createFormatterRegisterOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,OAAO,UAAU,8BAA8B,CACpD,SAAS,EAAE,SAAS,GACnB,eAAe,CAIjB"}
@@ -0,0 +1,19 @@
1
+ import type { Formatter } from "./types.js";
2
+ /**
3
+ * Build a {@link Formatter} for a fixed digit-grouping pattern — the common
4
+ * case, where the separators sit at the same offsets whatever the value is.
5
+ *
6
+ * The pattern uses `#` as a digit slot and treats any other character as a
7
+ * literal separator, so `"(###) ###-####"` groups ten digits as
8
+ * `"(555) 123-4567"`. With no pattern the formatter still strips the value to
9
+ * digits, which is how a field expresses "normalise but do not decorate".
10
+ *
11
+ * @example
12
+ * const formatter = createPatternFormatter("(###) ###-####");
13
+ * formatter.format("5551234567"); // "(555) 123-4567"
14
+ * formatter.parse("(555) 123-4567"); // "5551234567"
15
+ *
16
+ * @note Pure — the returned formatter's halves are pure too.
17
+ */
18
+ export default function createPatternFormatter(pattern?: string): Formatter;
19
+ //# sourceMappingURL=createPatternFormatter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createPatternFormatter.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/formatter/createPatternFormatter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAK1E"}
@@ -0,0 +1,6 @@
1
+ export { default as applyPattern } from "./applyPattern.js";
2
+ export { default as createFormatterRegisterOptions } from "./createFormatterRegisterOptions.js";
3
+ export { default as createPatternFormatter } from "./createPatternFormatter.js";
4
+ export { default as stripToDigits } from "./stripToDigits.js";
5
+ export type { Formatter } from "./types.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/formatter/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAChG,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC9D,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Reduce a display string to the digits it contains, dropping every separator
3
+ * (spaces, dashes, parens, and anything else). This is the `parse` half of a
4
+ * digit-grouping {@link Formatter} — the inverse of
5
+ * {@link applyPattern}.
6
+ *
7
+ * @note Pure.
8
+ */
9
+ export default function stripToDigits(value: string): string;
10
+ //# sourceMappingURL=stripToDigits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stripToDigits.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/formatter/stripToDigits.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3D"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * A model/view pair for one input: `format` projects the stored value into what
3
+ * the user sees, `parse` recovers the stored value from whatever the user typed.
4
+ *
5
+ * The split exists because for some fields the string on screen is deliberately
6
+ * not the string that is submitted — a phone number shown as `(555) 123-4567` is
7
+ * stored as `5551234567`. The formatter names that split, so the display rule and
8
+ * the normalisation rule travel together instead of drifting apart.
9
+ *
10
+ * Two properties are required of an implementation, because `useFormattedValue`
11
+ * relies on them to place the caret after a reformat:
12
+ *
13
+ * - **`format` accepts partial models.** It is called on every keystroke, so it
14
+ * must render half-typed values (`"555"`) without waiting for a complete one.
15
+ * - **`parse` is total and left-inverse to `format`** — `parse(format(m)) === m`
16
+ * for any model `m` the field can hold, and `parse` never throws, whatever the
17
+ * user pastes in.
18
+ *
19
+ * A fixed pattern is only the simplest case; `createPatternFormatter` builds one
20
+ * from a grouping string. Because `format` is an ordinary function it can just as
21
+ * well choose its grouping from the value itself — which is what a card number
22
+ * needs, since American Express groups 4-6-5 where most brands group 4-4-4-4.
23
+ */
24
+ export type Formatter = {
25
+ /** Project the stored model value into the string the user sees. */
26
+ format: (model: string) => string;
27
+ /** Recover the stored model value from the string the user typed. */
28
+ parse: (view: string) => string;
29
+ };
30
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/formatter/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,oEAAoE;IACpE,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAElC,qEAAqE;IACrE,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACjC,CAAC"}
@@ -1,4 +1,6 @@
1
+ export type { UseFormattedValueProps, UseFormattedValueResult, } from "./types.js";
1
2
  export { default as useFieldAriaProperties } from "./useFieldAriaProperties.js";
2
3
  export { default as useFieldError } from "./useFieldError.js";
4
+ export { default as useFormattedValue } from "./useFormattedValue.js";
3
5
  export { default as useOptionAriaProperties } from "./useOptionAriaProperties.js";
4
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/hooks/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}