@wordpress/components 29.13.1-next.719a03cbe.0 → 30.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/CHANGELOG.md +14 -3
  2. package/build/autocomplete/index.js +4 -0
  3. package/build/autocomplete/index.js.map +1 -1
  4. package/build/calendar/date-calendar/index.js +13 -4
  5. package/build/calendar/date-calendar/index.js.map +1 -1
  6. package/build/calendar/date-range-calendar/index.js +8 -4
  7. package/build/calendar/date-range-calendar/index.js.map +1 -1
  8. package/build/calendar/types.js.map +1 -1
  9. package/build/icon/index.js +2 -0
  10. package/build/icon/index.js.map +1 -1
  11. package/build/index.js +0 -19
  12. package/build/index.js.map +1 -1
  13. package/build/private-apis.js +5 -1
  14. package/build/private-apis.js.map +1 -1
  15. package/build/select-control/index.js +1 -1
  16. package/build/select-control/index.js.map +1 -1
  17. package/build/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
  18. package/build/utils/hooks/use-controlled-value.js +8 -4
  19. package/build/utils/hooks/use-controlled-value.js.map +1 -1
  20. package/build/validated-form-controls/components/checkbox-control.js +52 -0
  21. package/build/validated-form-controls/components/checkbox-control.js.map +1 -0
  22. package/build/validated-form-controls/components/combobox-control.js +64 -0
  23. package/build/validated-form-controls/components/combobox-control.js.map +1 -0
  24. package/build/validated-form-controls/components/custom-select-control.js +71 -0
  25. package/build/validated-form-controls/components/custom-select-control.js.map +1 -0
  26. package/build/validated-form-controls/components/index.js +138 -0
  27. package/build/validated-form-controls/components/index.js.map +1 -0
  28. package/build/validated-form-controls/components/input-control.js +50 -0
  29. package/build/validated-form-controls/components/input-control.js.map +1 -0
  30. package/build/validated-form-controls/components/number-control.js +53 -0
  31. package/build/validated-form-controls/components/number-control.js.map +1 -0
  32. package/build/validated-form-controls/components/radio-control.js +51 -0
  33. package/build/validated-form-controls/components/radio-control.js.map +1 -0
  34. package/build/validated-form-controls/components/range-control.js +51 -0
  35. package/build/validated-form-controls/components/range-control.js.map +1 -0
  36. package/build/validated-form-controls/components/select-control.js +53 -0
  37. package/build/validated-form-controls/components/select-control.js.map +1 -0
  38. package/build/validated-form-controls/components/text-control.js +51 -0
  39. package/build/validated-form-controls/components/text-control.js.map +1 -0
  40. package/build/validated-form-controls/components/textarea-control.js +50 -0
  41. package/build/validated-form-controls/components/textarea-control.js.map +1 -0
  42. package/build/validated-form-controls/components/toggle-control.js +60 -0
  43. package/build/validated-form-controls/components/toggle-control.js.map +1 -0
  44. package/build/validated-form-controls/components/toggle-group-control.js +69 -0
  45. package/build/validated-form-controls/components/toggle-group-control.js.map +1 -0
  46. package/build/validated-form-controls/components/types.js +6 -0
  47. package/build/validated-form-controls/components/types.js.map +1 -0
  48. package/build/validated-form-controls/control-with-error.js +137 -0
  49. package/build/validated-form-controls/control-with-error.js.map +1 -0
  50. package/build/validated-form-controls/index.js +28 -0
  51. package/build/validated-form-controls/index.js.map +1 -0
  52. package/build-module/autocomplete/index.js +4 -0
  53. package/build-module/autocomplete/index.js.map +1 -1
  54. package/build-module/calendar/date-calendar/index.js +11 -3
  55. package/build-module/calendar/date-calendar/index.js.map +1 -1
  56. package/build-module/calendar/date-range-calendar/index.js +8 -4
  57. package/build-module/calendar/date-range-calendar/index.js.map +1 -1
  58. package/build-module/calendar/types.js.map +1 -1
  59. package/build-module/icon/index.js +2 -0
  60. package/build-module/icon/index.js.map +1 -1
  61. package/build-module/index.js +0 -1
  62. package/build-module/index.js.map +1 -1
  63. package/build-module/private-apis.js +5 -1
  64. package/build-module/private-apis.js.map +1 -1
  65. package/build-module/select-control/index.js +1 -1
  66. package/build-module/select-control/index.js.map +1 -1
  67. package/build-module/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
  68. package/build-module/utils/hooks/use-controlled-value.js +9 -5
  69. package/build-module/utils/hooks/use-controlled-value.js.map +1 -1
  70. package/build-module/validated-form-controls/components/checkbox-control.js +44 -0
  71. package/build-module/validated-form-controls/components/checkbox-control.js.map +1 -0
  72. package/build-module/validated-form-controls/components/combobox-control.js +56 -0
  73. package/build-module/validated-form-controls/components/combobox-control.js.map +1 -0
  74. package/build-module/validated-form-controls/components/custom-select-control.js +63 -0
  75. package/build-module/validated-form-controls/components/custom-select-control.js.map +1 -0
  76. package/build-module/validated-form-controls/components/index.js +13 -0
  77. package/build-module/validated-form-controls/components/index.js.map +1 -0
  78. package/build-module/validated-form-controls/components/input-control.js +42 -0
  79. package/build-module/validated-form-controls/components/input-control.js.map +1 -0
  80. package/build-module/validated-form-controls/components/number-control.js +45 -0
  81. package/build-module/validated-form-controls/components/number-control.js.map +1 -0
  82. package/build-module/validated-form-controls/components/radio-control.js +43 -0
  83. package/build-module/validated-form-controls/components/radio-control.js.map +1 -0
  84. package/build-module/validated-form-controls/components/range-control.js +43 -0
  85. package/build-module/validated-form-controls/components/range-control.js.map +1 -0
  86. package/build-module/validated-form-controls/components/select-control.js +45 -0
  87. package/build-module/validated-form-controls/components/select-control.js.map +1 -0
  88. package/build-module/validated-form-controls/components/text-control.js +43 -0
  89. package/build-module/validated-form-controls/components/text-control.js.map +1 -0
  90. package/build-module/validated-form-controls/components/textarea-control.js +42 -0
  91. package/build-module/validated-form-controls/components/textarea-control.js.map +1 -0
  92. package/build-module/validated-form-controls/components/toggle-control.js +52 -0
  93. package/build-module/validated-form-controls/components/toggle-control.js.map +1 -0
  94. package/build-module/validated-form-controls/components/toggle-group-control.js +62 -0
  95. package/build-module/validated-form-controls/components/toggle-group-control.js.map +1 -0
  96. package/build-module/validated-form-controls/components/types.js +2 -0
  97. package/build-module/validated-form-controls/components/types.js.map +1 -0
  98. package/build-module/validated-form-controls/control-with-error.js +129 -0
  99. package/build-module/validated-form-controls/control-with-error.js.map +1 -0
  100. package/build-module/validated-form-controls/index.js +3 -0
  101. package/build-module/validated-form-controls/index.js.map +1 -0
  102. package/build-style/style-rtl.css +60 -17
  103. package/build-style/style.css +60 -17
  104. package/build-types/autocomplete/index.d.ts.map +1 -1
  105. package/build-types/calendar/date-calendar/index.d.ts.map +1 -1
  106. package/build-types/calendar/date-range-calendar/index.d.ts.map +1 -1
  107. package/build-types/calendar/types.d.ts +2 -2
  108. package/build-types/calendar/types.d.ts.map +1 -1
  109. package/build-types/color-picker/styles.d.ts.map +1 -1
  110. package/build-types/icon/index.d.ts.map +1 -1
  111. package/build-types/index.d.ts +0 -1
  112. package/build-types/index.d.ts.map +1 -1
  113. package/build-types/private-apis.d.ts.map +1 -1
  114. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  115. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts.map +1 -1
  116. package/build-types/utils/hooks/use-controlled-value.d.ts +2 -2
  117. package/build-types/utils/hooks/use-controlled-value.d.ts.map +1 -1
  118. package/build-types/validated-form-controls/components/checkbox-control.d.ts +9 -0
  119. package/build-types/validated-form-controls/components/checkbox-control.d.ts.map +1 -0
  120. package/build-types/validated-form-controls/components/combobox-control.d.ts +21 -0
  121. package/build-types/validated-form-controls/components/combobox-control.d.ts.map +1 -0
  122. package/build-types/validated-form-controls/components/custom-select-control.d.ts +4 -0
  123. package/build-types/validated-form-controls/components/custom-select-control.d.ts.map +1 -0
  124. package/build-types/validated-form-controls/components/index.d.ts +13 -0
  125. package/build-types/validated-form-controls/components/index.d.ts.map +1 -0
  126. package/build-types/validated-form-controls/components/input-control.d.ts +4 -0
  127. package/build-types/validated-form-controls/components/input-control.d.ts.map +1 -0
  128. package/build-types/validated-form-controls/components/number-control.d.ts +17 -0
  129. package/build-types/validated-form-controls/components/number-control.d.ts.map +1 -0
  130. package/build-types/validated-form-controls/components/radio-control.d.ts +11 -0
  131. package/build-types/validated-form-controls/components/radio-control.d.ts.map +1 -0
  132. package/build-types/validated-form-controls/components/range-control.d.ts +36 -0
  133. package/build-types/validated-form-controls/components/range-control.d.ts.map +1 -0
  134. package/build-types/validated-form-controls/components/select-control.d.ts +9 -0
  135. package/build-types/validated-form-controls/components/select-control.d.ts.map +1 -0
  136. package/build-types/validated-form-controls/components/stories/checkbox-control.story.d.ts +12 -0
  137. package/build-types/validated-form-controls/components/stories/checkbox-control.story.d.ts.map +1 -0
  138. package/build-types/validated-form-controls/components/stories/combobox-control.story.d.ts +12 -0
  139. package/build-types/validated-form-controls/components/stories/combobox-control.story.d.ts.map +1 -0
  140. package/build-types/validated-form-controls/components/stories/custom-select-control.story.d.ts +12 -0
  141. package/build-types/validated-form-controls/components/stories/custom-select-control.story.d.ts.map +1 -0
  142. package/build-types/validated-form-controls/components/stories/input-control.story.d.ts +18 -0
  143. package/build-types/validated-form-controls/components/stories/input-control.story.d.ts.map +1 -0
  144. package/build-types/validated-form-controls/components/stories/number-control.story.d.ts +12 -0
  145. package/build-types/validated-form-controls/components/stories/number-control.story.d.ts.map +1 -0
  146. package/build-types/validated-form-controls/components/stories/overview.story.d.ts +19 -0
  147. package/build-types/validated-form-controls/components/stories/overview.story.d.ts.map +1 -0
  148. package/build-types/validated-form-controls/components/stories/radio-control.story.d.ts +12 -0
  149. package/build-types/validated-form-controls/components/stories/radio-control.story.d.ts.map +1 -0
  150. package/build-types/validated-form-controls/components/stories/range-control.story.d.ts +9 -0
  151. package/build-types/validated-form-controls/components/stories/range-control.story.d.ts.map +1 -0
  152. package/build-types/validated-form-controls/components/stories/select-control.story.d.ts +12 -0
  153. package/build-types/validated-form-controls/components/stories/select-control.story.d.ts.map +1 -0
  154. package/build-types/validated-form-controls/components/stories/story-utils.d.ts +9 -0
  155. package/build-types/validated-form-controls/components/stories/story-utils.d.ts.map +1 -0
  156. package/build-types/validated-form-controls/components/stories/text-control.story.d.ts +9 -0
  157. package/build-types/validated-form-controls/components/stories/text-control.story.d.ts.map +1 -0
  158. package/build-types/validated-form-controls/components/stories/textarea-control.story.d.ts +9 -0
  159. package/build-types/validated-form-controls/components/stories/textarea-control.story.d.ts.map +1 -0
  160. package/build-types/validated-form-controls/components/stories/toggle-control.story.d.ts +9 -0
  161. package/build-types/validated-form-controls/components/stories/toggle-control.story.d.ts.map +1 -0
  162. package/build-types/validated-form-controls/components/stories/toggle-group-control.story.d.ts +9 -0
  163. package/build-types/validated-form-controls/components/stories/toggle-group-control.story.d.ts.map +1 -0
  164. package/build-types/validated-form-controls/components/text-control.d.ts +8 -0
  165. package/build-types/validated-form-controls/components/text-control.d.ts.map +1 -0
  166. package/build-types/validated-form-controls/components/textarea-control.d.ts +7 -0
  167. package/build-types/validated-form-controls/components/textarea-control.d.ts.map +1 -0
  168. package/build-types/validated-form-controls/components/toggle-control.d.ts +7 -0
  169. package/build-types/validated-form-controls/components/toggle-control.d.ts.map +1 -0
  170. package/build-types/validated-form-controls/components/toggle-group-control.d.ts +15 -0
  171. package/build-types/validated-form-controls/components/toggle-group-control.d.ts.map +1 -0
  172. package/build-types/validated-form-controls/components/types.d.ts +27 -0
  173. package/build-types/validated-form-controls/components/types.d.ts.map +1 -0
  174. package/build-types/validated-form-controls/control-with-error.d.ts +36 -0
  175. package/build-types/validated-form-controls/control-with-error.d.ts.map +1 -0
  176. package/build-types/validated-form-controls/index.d.ts +3 -0
  177. package/build-types/validated-form-controls/index.d.ts.map +1 -0
  178. package/package.json +19 -19
  179. package/src/autocomplete/index.tsx +4 -0
  180. package/src/calendar/date-calendar/README.md +57 -46
  181. package/src/calendar/date-calendar/index.tsx +22 -8
  182. package/src/calendar/date-range-calendar/README.md +63 -52
  183. package/src/calendar/date-range-calendar/index.tsx +23 -11
  184. package/src/calendar/types.ts +2 -2
  185. package/src/dimension-control/test/__snapshots__/index.test.js.snap +8 -8
  186. package/src/icon/index.tsx +2 -0
  187. package/src/index.ts +0 -1
  188. package/src/private-apis.ts +5 -0
  189. package/src/select-control/index.tsx +1 -1
  190. package/src/style.scss +2 -2
  191. package/src/toggle-group-control/toggle-group-control/as-button-group.tsx +3 -1
  192. package/src/utils/hooks/use-controlled-value.ts +16 -8
  193. package/src/validated-form-controls/components/checkbox-control.tsx +64 -0
  194. package/src/validated-form-controls/components/combobox-control.tsx +77 -0
  195. package/src/validated-form-controls/components/custom-select-control.tsx +86 -0
  196. package/src/validated-form-controls/components/index.ts +12 -0
  197. package/src/validated-form-controls/components/input-control.tsx +59 -0
  198. package/src/validated-form-controls/components/number-control.tsx +61 -0
  199. package/src/validated-form-controls/components/radio-control.tsx +60 -0
  200. package/src/validated-form-controls/components/range-control.tsx +60 -0
  201. package/src/validated-form-controls/components/select-control.tsx +75 -0
  202. package/src/validated-form-controls/components/stories/checkbox-control.story.tsx +57 -0
  203. package/src/validated-form-controls/components/stories/combobox-control.story.tsx +64 -0
  204. package/src/validated-form-controls/components/stories/custom-select-control.story.tsx +64 -0
  205. package/src/validated-form-controls/components/stories/input-control.story.tsx +132 -0
  206. package/src/validated-form-controls/components/stories/number-control.story.tsx +62 -0
  207. package/src/validated-form-controls/components/stories/overview.mdx +52 -0
  208. package/src/validated-form-controls/components/stories/overview.story.tsx +100 -0
  209. package/src/validated-form-controls/components/stories/radio-control.story.tsx +64 -0
  210. package/src/validated-form-controls/components/stories/range-control.story.tsx +60 -0
  211. package/src/validated-form-controls/components/stories/select-control.story.tsx +60 -0
  212. package/src/validated-form-controls/components/stories/story-utils.tsx +46 -0
  213. package/src/validated-form-controls/components/stories/text-control.story.tsx +55 -0
  214. package/src/validated-form-controls/components/stories/textarea-control.story.tsx +52 -0
  215. package/src/validated-form-controls/components/stories/toggle-control.story.tsx +55 -0
  216. package/src/validated-form-controls/components/stories/toggle-group-control.story.tsx +66 -0
  217. package/src/validated-form-controls/components/text-control.tsx +60 -0
  218. package/src/validated-form-controls/components/textarea-control.tsx +59 -0
  219. package/src/validated-form-controls/components/toggle-control.tsx +69 -0
  220. package/src/validated-form-controls/components/toggle-group-control.tsx +82 -0
  221. package/src/validated-form-controls/components/types.ts +28 -0
  222. package/src/validated-form-controls/control-with-error.tsx +198 -0
  223. package/src/validated-form-controls/index.ts +2 -0
  224. package/src/validated-form-controls/style.scss +75 -0
  225. package/tsconfig.tsbuildinfo +1 -1
  226. package/build/calendar/utils/use-controlled-value.js +0 -58
  227. package/build/calendar/utils/use-controlled-value.js.map +0 -1
  228. package/build-module/calendar/utils/use-controlled-value.js +0 -51
  229. package/build-module/calendar/utils/use-controlled-value.js.map +0 -1
  230. package/build-types/calendar/utils/use-controlled-value.d.ts +0 -27
  231. package/build-types/calendar/utils/use-controlled-value.d.ts.map +0 -1
  232. package/src/calendar/utils/use-controlled-value.ts +0 -61
  233. package/src/dimension-control/style.scss +0 -22
@@ -0,0 +1,45 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { forwardRef, useRef } from '@wordpress/element';
5
+ import { useMergeRefs } from '@wordpress/compose';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { ControlWithError } from '../control-with-error';
11
+ import NumberControl from '../../number-control';
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ const UnforwardedValidatedNumberControl = ({
14
+ required,
15
+ customValidator,
16
+ onChange,
17
+ markWhenOptional,
18
+ ...restProps
19
+ }, forwardedRef) => {
20
+ const validityTargetRef = useRef(null);
21
+ const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
22
+ const valueRef = useRef(restProps.value);
23
+ return /*#__PURE__*/_jsx(ControlWithError, {
24
+ required: required,
25
+ markWhenOptional: markWhenOptional,
26
+ customValidator: () => {
27
+ return customValidator?.(valueRef.current);
28
+ },
29
+ getValidityTarget: () => validityTargetRef.current,
30
+ children: /*#__PURE__*/_jsx(NumberControl, {
31
+ __next40pxDefaultSize: true,
32
+ ref: mergedRefs
33
+ // TODO: Upstream limitation - When form is submitted when value is undefined, it will
34
+ // automatically set a clamped value (as defined by `min` attribute, so 0 by default).
35
+ ,
36
+ onChange: (value, ...args) => {
37
+ valueRef.current = value;
38
+ onChange?.(value, ...args);
39
+ },
40
+ ...restProps
41
+ })
42
+ });
43
+ };
44
+ export const ValidatedNumberControl = forwardRef(UnforwardedValidatedNumberControl);
45
+ //# sourceMappingURL=number-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["forwardRef","useRef","useMergeRefs","ControlWithError","NumberControl","jsx","_jsx","UnforwardedValidatedNumberControl","required","customValidator","onChange","markWhenOptional","restProps","forwardedRef","validityTargetRef","mergedRefs","valueRef","value","current","getValidityTarget","children","__next40pxDefaultSize","ref","args","ValidatedNumberControl"],"sources":["@wordpress/components/src/validated-form-controls/components/number-control.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { ControlWithError } from '../control-with-error';\nimport NumberControl from '../../number-control';\nimport type { ValidatedControlProps } from './types';\nimport type { NumberControlProps } from '../../number-control/types';\n\ntype Value = NumberControlProps[ 'value' ];\n\nconst UnforwardedValidatedNumberControl = (\n\t{\n\t\trequired,\n\t\tcustomValidator,\n\t\tonChange,\n\t\tmarkWhenOptional,\n\t\t...restProps\n\t}: Omit<\n\t\tReact.ComponentProps< typeof NumberControl >,\n\t\t'__next40pxDefaultSize'\n\t> &\n\t\tValidatedControlProps< Value >,\n\tforwardedRef: React.ForwardedRef< HTMLInputElement >\n) => {\n\tconst validityTargetRef = useRef< HTMLInputElement >( null );\n\tconst mergedRefs = useMergeRefs( [ forwardedRef, validityTargetRef ] );\n\tconst valueRef = useRef< Value >( restProps.value );\n\n\treturn (\n\t\t<ControlWithError\n\t\t\trequired={ required }\n\t\t\tmarkWhenOptional={ markWhenOptional }\n\t\t\tcustomValidator={ () => {\n\t\t\t\treturn customValidator?.( valueRef.current );\n\t\t\t} }\n\t\t\tgetValidityTarget={ () => validityTargetRef.current }\n\t\t>\n\t\t\t<NumberControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tref={ mergedRefs }\n\t\t\t\t// TODO: Upstream limitation - When form is submitted when value is undefined, it will\n\t\t\t\t// automatically set a clamped value (as defined by `min` attribute, so 0 by default).\n\t\t\t\tonChange={ ( value, ...args ) => {\n\t\t\t\t\tvalueRef.current = value;\n\t\t\t\t\tonChange?.( value, ...args );\n\t\t\t\t} }\n\t\t\t\t{ ...restProps }\n\t\t\t/>\n\t\t</ControlWithError>\n\t);\n};\n\nexport const ValidatedNumberControl = forwardRef(\n\tUnforwardedValidatedNumberControl\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,MAAM,QAAQ,oBAAoB;AACvD,SAASC,YAAY,QAAQ,oBAAoB;;AAEjD;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,OAAOC,aAAa,MAAM,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAMjD,MAAMC,iCAAiC,GAAGA,CACzC;EACCC,QAAQ;EACRC,eAAe;EACfC,QAAQ;EACRC,gBAAgB;EAChB,GAAGC;AAK0B,CAAC,EAC/BC,YAAoD,KAChD;EACJ,MAAMC,iBAAiB,GAAGb,MAAM,CAAsB,IAAK,CAAC;EAC5D,MAAMc,UAAU,GAAGb,YAAY,CAAE,CAAEW,YAAY,EAAEC,iBAAiB,CAAG,CAAC;EACtE,MAAME,QAAQ,GAAGf,MAAM,CAAWW,SAAS,CAACK,KAAM,CAAC;EAEnD,oBACCX,IAAA,CAACH,gBAAgB;IAChBK,QAAQ,EAAGA,QAAU;IACrBG,gBAAgB,EAAGA,gBAAkB;IACrCF,eAAe,EAAGA,CAAA,KAAM;MACvB,OAAOA,eAAe,GAAIO,QAAQ,CAACE,OAAQ,CAAC;IAC7C,CAAG;IACHC,iBAAiB,EAAGA,CAAA,KAAML,iBAAiB,CAACI,OAAS;IAAAE,QAAA,eAErDd,IAAA,CAACF,aAAa;MACbiB,qBAAqB;MACrBC,GAAG,EAAGP;MACN;MACA;MAAA;MACAL,QAAQ,EAAGA,CAAEO,KAAK,EAAE,GAAGM,IAAI,KAAM;QAChCP,QAAQ,CAACE,OAAO,GAAGD,KAAK;QACxBP,QAAQ,GAAIO,KAAK,EAAE,GAAGM,IAAK,CAAC;MAC7B,CAAG;MAAA,GACEX;IAAS,CACd;EAAC,CACe,CAAC;AAErB,CAAC;AAED,OAAO,MAAMY,sBAAsB,GAAGxB,UAAU,CAC/CO,iCACD,CAAC","ignoreList":[]}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useMergeRefs } from '@wordpress/compose';
5
+ import { forwardRef, useRef } from '@wordpress/element';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { ControlWithError } from '../control-with-error';
11
+ import RadioControl from '../../radio-control';
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ const UnforwardedValidatedRadioControl = ({
14
+ required,
15
+ customValidator,
16
+ onChange,
17
+ markWhenOptional,
18
+ ...restProps
19
+ }, forwardedRef) => {
20
+ const validityTargetRef = useRef(null);
21
+ const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
22
+ const valueRef = useRef(restProps.selected);
23
+ return /*#__PURE__*/_jsx(ControlWithError, {
24
+ required: required,
25
+ markWhenOptional: markWhenOptional
26
+ // TODO: Upstream limitation - RadioControl does not accept a ref.
27
+ ,
28
+ ref: mergedRefs,
29
+ customValidator: () => {
30
+ return customValidator?.(valueRef.current);
31
+ },
32
+ getValidityTarget: () => validityTargetRef.current?.querySelector('input[type="radio"]'),
33
+ children: /*#__PURE__*/_jsx(RadioControl, {
34
+ onChange: value => {
35
+ valueRef.current = value;
36
+ onChange?.(value);
37
+ },
38
+ ...restProps
39
+ })
40
+ });
41
+ };
42
+ export const ValidatedRadioControl = forwardRef(UnforwardedValidatedRadioControl);
43
+ //# sourceMappingURL=radio-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useMergeRefs","forwardRef","useRef","ControlWithError","RadioControl","jsx","_jsx","UnforwardedValidatedRadioControl","required","customValidator","onChange","markWhenOptional","restProps","forwardedRef","validityTargetRef","mergedRefs","valueRef","selected","ref","current","getValidityTarget","querySelector","children","value","ValidatedRadioControl"],"sources":["@wordpress/components/src/validated-form-controls/components/radio-control.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { ControlWithError } from '../control-with-error';\nimport type { ValidatedControlProps } from './types';\nimport RadioControl from '../../radio-control';\nimport type { RadioControlProps } from '../../radio-control/types';\n\ntype Value = RadioControlProps[ 'selected' ];\n\nconst UnforwardedValidatedRadioControl = (\n\t{\n\t\trequired,\n\t\tcustomValidator,\n\t\tonChange,\n\t\tmarkWhenOptional,\n\t\t...restProps\n\t}: React.ComponentProps< typeof RadioControl > &\n\t\tValidatedControlProps< Value >,\n\tforwardedRef: React.ForwardedRef< HTMLDivElement >\n) => {\n\tconst validityTargetRef = useRef< HTMLDivElement >( null );\n\tconst mergedRefs = useMergeRefs( [ forwardedRef, validityTargetRef ] );\n\tconst valueRef = useRef< Value >( restProps.selected );\n\n\treturn (\n\t\t<ControlWithError\n\t\t\trequired={ required }\n\t\t\tmarkWhenOptional={ markWhenOptional }\n\t\t\t// TODO: Upstream limitation - RadioControl does not accept a ref.\n\t\t\tref={ mergedRefs }\n\t\t\tcustomValidator={ () => {\n\t\t\t\treturn customValidator?.( valueRef.current );\n\t\t\t} }\n\t\t\tgetValidityTarget={ () =>\n\t\t\t\tvalidityTargetRef.current?.querySelector< HTMLInputElement >(\n\t\t\t\t\t'input[type=\"radio\"]'\n\t\t\t\t)\n\t\t\t}\n\t\t>\n\t\t\t<RadioControl\n\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\tvalueRef.current = value;\n\t\t\t\t\tonChange?.( value );\n\t\t\t\t} }\n\t\t\t\t{ ...restProps }\n\t\t\t/>\n\t\t</ControlWithError>\n\t);\n};\n\nexport const ValidatedRadioControl = forwardRef(\n\tUnforwardedValidatedRadioControl\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,oBAAoB;AACjD,SAASC,UAAU,EAAEC,MAAM,QAAQ,oBAAoB;;AAEvD;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,uBAAuB;AAExD,OAAOC,YAAY,MAAM,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAK/C,MAAMC,gCAAgC,GAAGA,CACxC;EACCC,QAAQ;EACRC,eAAe;EACfC,QAAQ;EACRC,gBAAgB;EAChB,GAAGC;AAE0B,CAAC,EAC/BC,YAAkD,KAC9C;EACJ,MAAMC,iBAAiB,GAAGZ,MAAM,CAAoB,IAAK,CAAC;EAC1D,MAAMa,UAAU,GAAGf,YAAY,CAAE,CAAEa,YAAY,EAAEC,iBAAiB,CAAG,CAAC;EACtE,MAAME,QAAQ,GAAGd,MAAM,CAAWU,SAAS,CAACK,QAAS,CAAC;EAEtD,oBACCX,IAAA,CAACH,gBAAgB;IAChBK,QAAQ,EAAGA,QAAU;IACrBG,gBAAgB,EAAGA;IACnB;IAAA;IACAO,GAAG,EAAGH,UAAY;IAClBN,eAAe,EAAGA,CAAA,KAAM;MACvB,OAAOA,eAAe,GAAIO,QAAQ,CAACG,OAAQ,CAAC;IAC7C,CAAG;IACHC,iBAAiB,EAAGA,CAAA,KACnBN,iBAAiB,CAACK,OAAO,EAAEE,aAAa,CACvC,qBACD,CACA;IAAAC,QAAA,eAEDhB,IAAA,CAACF,YAAY;MACZM,QAAQ,EAAKa,KAAK,IAAM;QACvBP,QAAQ,CAACG,OAAO,GAAGI,KAAK;QACxBb,QAAQ,GAAIa,KAAM,CAAC;MACpB,CAAG;MAAA,GACEX;IAAS,CACd;EAAC,CACe,CAAC;AAErB,CAAC;AAED,OAAO,MAAMY,qBAAqB,GAAGvB,UAAU,CAC9CM,gCACD,CAAC","ignoreList":[]}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useMergeRefs } from '@wordpress/compose';
5
+ import { forwardRef, useRef } from '@wordpress/element';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { ControlWithError } from '../control-with-error';
11
+ import RangeControl from '../../range-control';
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ const UnforwardedValidatedRangeControl = ({
14
+ required,
15
+ customValidator,
16
+ onChange,
17
+ markWhenOptional,
18
+ ...restProps
19
+ }, forwardedRef) => {
20
+ const validityTargetRef = useRef(null);
21
+ const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
22
+ const valueRef = useRef(restProps.value);
23
+ return /*#__PURE__*/_jsx(ControlWithError, {
24
+ required: required,
25
+ markWhenOptional: markWhenOptional,
26
+ customValidator: () => {
27
+ return customValidator?.(valueRef.current);
28
+ },
29
+ getValidityTarget: () => validityTargetRef.current,
30
+ children: /*#__PURE__*/_jsx(RangeControl, {
31
+ __next40pxDefaultSize: true,
32
+ __nextHasNoMarginBottom: true,
33
+ ref: mergedRefs,
34
+ onChange: value => {
35
+ valueRef.current = value;
36
+ onChange?.(value);
37
+ },
38
+ ...restProps
39
+ })
40
+ });
41
+ };
42
+ export const ValidatedRangeControl = forwardRef(UnforwardedValidatedRangeControl);
43
+ //# sourceMappingURL=range-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useMergeRefs","forwardRef","useRef","ControlWithError","RangeControl","jsx","_jsx","UnforwardedValidatedRangeControl","required","customValidator","onChange","markWhenOptional","restProps","forwardedRef","validityTargetRef","mergedRefs","valueRef","value","current","getValidityTarget","children","__next40pxDefaultSize","__nextHasNoMarginBottom","ref","ValidatedRangeControl"],"sources":["@wordpress/components/src/validated-form-controls/components/range-control.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { ControlWithError } from '../control-with-error';\nimport type { ValidatedControlProps } from './types';\nimport RangeControl from '../../range-control';\nimport type { RangeControlProps } from '../../range-control/types';\n\ntype Value = RangeControlProps[ 'value' ];\n\nconst UnforwardedValidatedRangeControl = (\n\t{\n\t\trequired,\n\t\tcustomValidator,\n\t\tonChange,\n\t\tmarkWhenOptional,\n\t\t...restProps\n\t}: Omit<\n\t\tReact.ComponentProps< typeof RangeControl >,\n\t\t'__next40pxDefaultSize' | '__nextHasNoMarginBottom'\n\t> &\n\t\tValidatedControlProps< Value >,\n\tforwardedRef: React.ForwardedRef< HTMLInputElement >\n) => {\n\tconst validityTargetRef = useRef< HTMLInputElement >( null );\n\tconst mergedRefs = useMergeRefs( [ forwardedRef, validityTargetRef ] );\n\tconst valueRef = useRef< Value >( restProps.value );\n\n\treturn (\n\t\t<ControlWithError\n\t\t\trequired={ required }\n\t\t\tmarkWhenOptional={ markWhenOptional }\n\t\t\tcustomValidator={ () => {\n\t\t\t\treturn customValidator?.( valueRef.current );\n\t\t\t} }\n\t\t\tgetValidityTarget={ () => validityTargetRef.current }\n\t\t>\n\t\t\t<RangeControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tref={ mergedRefs }\n\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\tvalueRef.current = value;\n\t\t\t\t\tonChange?.( value );\n\t\t\t\t} }\n\t\t\t\t{ ...restProps }\n\t\t\t/>\n\t\t</ControlWithError>\n\t);\n};\n\nexport const ValidatedRangeControl = forwardRef(\n\tUnforwardedValidatedRangeControl\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,oBAAoB;AACjD,SAASC,UAAU,EAAEC,MAAM,QAAQ,oBAAoB;;AAEvD;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,uBAAuB;AAExD,OAAOC,YAAY,MAAM,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAK/C,MAAMC,gCAAgC,GAAGA,CACxC;EACCC,QAAQ;EACRC,eAAe;EACfC,QAAQ;EACRC,gBAAgB;EAChB,GAAGC;AAK0B,CAAC,EAC/BC,YAAoD,KAChD;EACJ,MAAMC,iBAAiB,GAAGZ,MAAM,CAAsB,IAAK,CAAC;EAC5D,MAAMa,UAAU,GAAGf,YAAY,CAAE,CAAEa,YAAY,EAAEC,iBAAiB,CAAG,CAAC;EACtE,MAAME,QAAQ,GAAGd,MAAM,CAAWU,SAAS,CAACK,KAAM,CAAC;EAEnD,oBACCX,IAAA,CAACH,gBAAgB;IAChBK,QAAQ,EAAGA,QAAU;IACrBG,gBAAgB,EAAGA,gBAAkB;IACrCF,eAAe,EAAGA,CAAA,KAAM;MACvB,OAAOA,eAAe,GAAIO,QAAQ,CAACE,OAAQ,CAAC;IAC7C,CAAG;IACHC,iBAAiB,EAAGA,CAAA,KAAML,iBAAiB,CAACI,OAAS;IAAAE,QAAA,eAErDd,IAAA,CAACF,YAAY;MACZiB,qBAAqB;MACrBC,uBAAuB;MACvBC,GAAG,EAAGR,UAAY;MAClBL,QAAQ,EAAKO,KAAK,IAAM;QACvBD,QAAQ,CAACE,OAAO,GAAGD,KAAK;QACxBP,QAAQ,GAAIO,KAAM,CAAC;MACpB,CAAG;MAAA,GACEL;IAAS,CACd;EAAC,CACe,CAAC;AAErB,CAAC;AAED,OAAO,MAAMY,qBAAqB,GAAGvB,UAAU,CAC9CM,gCACD,CAAC","ignoreList":[]}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { forwardRef, useRef } from '@wordpress/element';
5
+ import { useMergeRefs } from '@wordpress/compose';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { ControlWithError } from '../control-with-error';
11
+ import SelectControl from '../../select-control';
12
+
13
+ // Only support single value selection
14
+ import { jsx as _jsx } from "react/jsx-runtime";
15
+ const UnforwardedValidatedSelectControl = ({
16
+ required,
17
+ customValidator,
18
+ onChange,
19
+ markWhenOptional,
20
+ ...restProps
21
+ }, forwardedRef) => {
22
+ const validityTargetRef = useRef(null);
23
+ const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
24
+ const valueRef = useRef(restProps.value);
25
+ return /*#__PURE__*/_jsx(ControlWithError, {
26
+ required: required,
27
+ markWhenOptional: markWhenOptional,
28
+ customValidator: () => {
29
+ return customValidator?.(valueRef.current);
30
+ },
31
+ getValidityTarget: () => validityTargetRef.current,
32
+ children: /*#__PURE__*/_jsx(SelectControl, {
33
+ __nextHasNoMarginBottom: true,
34
+ __next40pxDefaultSize: true,
35
+ ref: mergedRefs,
36
+ onChange: value => {
37
+ valueRef.current = value;
38
+ onChange?.(value);
39
+ },
40
+ ...restProps
41
+ })
42
+ });
43
+ };
44
+ export const ValidatedSelectControl = forwardRef(UnforwardedValidatedSelectControl);
45
+ //# sourceMappingURL=select-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["forwardRef","useRef","useMergeRefs","ControlWithError","SelectControl","jsx","_jsx","UnforwardedValidatedSelectControl","required","customValidator","onChange","markWhenOptional","restProps","forwardedRef","validityTargetRef","mergedRefs","valueRef","value","current","getValidityTarget","children","__nextHasNoMarginBottom","__next40pxDefaultSize","ref","ValidatedSelectControl"],"sources":["@wordpress/components/src/validated-form-controls/components/select-control.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { ControlWithError } from '../control-with-error';\nimport SelectControl from '../../select-control';\nimport type { ValidatedControlProps } from './types';\nimport type { SelectControlProps as _SelectControlProps } from '../../select-control/types';\n\n// Only support single value selection\ntype SelectControlProps = Omit<\n\t_SelectControlProps,\n\t'multiple' | 'onChange' | 'value'\n> & {\n\tonChange?: ( value: string ) => void;\n\tvalue?: string;\n};\n\ntype Value = SelectControlProps[ 'value' ];\n\nconst UnforwardedValidatedSelectControl = (\n\t{\n\t\trequired,\n\t\tcustomValidator,\n\t\tonChange,\n\t\tmarkWhenOptional,\n\t\t...restProps\n\t}: Omit<\n\t\tReact.ComponentProps< typeof SelectControl >,\n\t\t| '__next40pxDefaultSize'\n\t\t| '__nextHasNoMarginBottom'\n\t\t| 'multiple'\n\t\t| 'onChange'\n\t\t| 'value'\n\t> & {\n\t\tvalue?: string;\n\t\tonChange: ( value: string ) => void;\n\t} & ValidatedControlProps< Value >,\n\tforwardedRef: React.ForwardedRef< HTMLSelectElement >\n) => {\n\tconst validityTargetRef = useRef< HTMLSelectElement >( null );\n\tconst mergedRefs = useMergeRefs( [ forwardedRef, validityTargetRef ] );\n\tconst valueRef = useRef< Value >( restProps.value );\n\n\treturn (\n\t\t<ControlWithError\n\t\t\trequired={ required }\n\t\t\tmarkWhenOptional={ markWhenOptional }\n\t\t\tcustomValidator={ () => {\n\t\t\t\treturn customValidator?.( valueRef.current );\n\t\t\t} }\n\t\t\tgetValidityTarget={ () => validityTargetRef.current }\n\t\t>\n\t\t\t<SelectControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tref={ mergedRefs }\n\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\tvalueRef.current = value;\n\t\t\t\t\tonChange?.( value );\n\t\t\t\t} }\n\t\t\t\t{ ...restProps }\n\t\t\t/>\n\t\t</ControlWithError>\n\t);\n};\n\nexport const ValidatedSelectControl = forwardRef(\n\tUnforwardedValidatedSelectControl\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,MAAM,QAAQ,oBAAoB;AACvD,SAASC,YAAY,QAAQ,oBAAoB;;AAEjD;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,OAAOC,aAAa,MAAM,sBAAsB;;AAIhD;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAWA,MAAMC,iCAAiC,GAAGA,CACzC;EACCC,QAAQ;EACRC,eAAe;EACfC,QAAQ;EACRC,gBAAgB;EAChB,GAAGC;AAW6B,CAAC,EAClCC,YAAqD,KACjD;EACJ,MAAMC,iBAAiB,GAAGb,MAAM,CAAuB,IAAK,CAAC;EAC7D,MAAMc,UAAU,GAAGb,YAAY,CAAE,CAAEW,YAAY,EAAEC,iBAAiB,CAAG,CAAC;EACtE,MAAME,QAAQ,GAAGf,MAAM,CAAWW,SAAS,CAACK,KAAM,CAAC;EAEnD,oBACCX,IAAA,CAACH,gBAAgB;IAChBK,QAAQ,EAAGA,QAAU;IACrBG,gBAAgB,EAAGA,gBAAkB;IACrCF,eAAe,EAAGA,CAAA,KAAM;MACvB,OAAOA,eAAe,GAAIO,QAAQ,CAACE,OAAQ,CAAC;IAC7C,CAAG;IACHC,iBAAiB,EAAGA,CAAA,KAAML,iBAAiB,CAACI,OAAS;IAAAE,QAAA,eAErDd,IAAA,CAACF,aAAa;MACbiB,uBAAuB;MACvBC,qBAAqB;MACrBC,GAAG,EAAGR,UAAY;MAClBL,QAAQ,EAAKO,KAAK,IAAM;QACvBD,QAAQ,CAACE,OAAO,GAAGD,KAAK;QACxBP,QAAQ,GAAIO,KAAM,CAAC;MACpB,CAAG;MAAA,GACEL;IAAS,CACd;EAAC,CACe,CAAC;AAErB,CAAC;AAED,OAAO,MAAMY,sBAAsB,GAAGxB,UAAU,CAC/CO,iCACD,CAAC","ignoreList":[]}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useMergeRefs } from '@wordpress/compose';
5
+ import { forwardRef, useRef } from '@wordpress/element';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { ControlWithError } from '../control-with-error';
11
+ import TextControl from '../../text-control';
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ const UnforwardedValidatedTextControl = ({
14
+ required,
15
+ customValidator,
16
+ onChange,
17
+ markWhenOptional,
18
+ ...restProps
19
+ }, forwardedRef) => {
20
+ const validityTargetRef = useRef(null);
21
+ const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
22
+ const valueRef = useRef(restProps.value);
23
+ return /*#__PURE__*/_jsx(ControlWithError, {
24
+ required: required,
25
+ markWhenOptional: markWhenOptional,
26
+ customValidator: () => {
27
+ return customValidator?.(valueRef.current);
28
+ },
29
+ getValidityTarget: () => validityTargetRef.current,
30
+ children: /*#__PURE__*/_jsx(TextControl, {
31
+ __next40pxDefaultSize: true,
32
+ __nextHasNoMarginBottom: true,
33
+ ref: mergedRefs,
34
+ onChange: value => {
35
+ valueRef.current = value;
36
+ onChange?.(value);
37
+ },
38
+ ...restProps
39
+ })
40
+ });
41
+ };
42
+ export const ValidatedTextControl = forwardRef(UnforwardedValidatedTextControl);
43
+ //# sourceMappingURL=text-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useMergeRefs","forwardRef","useRef","ControlWithError","TextControl","jsx","_jsx","UnforwardedValidatedTextControl","required","customValidator","onChange","markWhenOptional","restProps","forwardedRef","validityTargetRef","mergedRefs","valueRef","value","current","getValidityTarget","children","__next40pxDefaultSize","__nextHasNoMarginBottom","ref","ValidatedTextControl"],"sources":["@wordpress/components/src/validated-form-controls/components/text-control.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { ControlWithError } from '../control-with-error';\nimport type { ValidatedControlProps } from './types';\nimport TextControl from '../../text-control';\nimport type { TextControlProps } from '../../text-control/types';\n\ntype Value = TextControlProps[ 'value' ];\n\nconst UnforwardedValidatedTextControl = (\n\t{\n\t\trequired,\n\t\tcustomValidator,\n\t\tonChange,\n\t\tmarkWhenOptional,\n\t\t...restProps\n\t}: Omit<\n\t\tReact.ComponentProps< typeof TextControl >,\n\t\t'__next40pxDefaultSize' | '__nextHasNoMarginBottom'\n\t> &\n\t\tValidatedControlProps< Value >,\n\tforwardedRef: React.ForwardedRef< HTMLInputElement >\n) => {\n\tconst validityTargetRef = useRef< HTMLInputElement >( null );\n\tconst mergedRefs = useMergeRefs( [ forwardedRef, validityTargetRef ] );\n\tconst valueRef = useRef< Value >( restProps.value );\n\n\treturn (\n\t\t<ControlWithError\n\t\t\trequired={ required }\n\t\t\tmarkWhenOptional={ markWhenOptional }\n\t\t\tcustomValidator={ () => {\n\t\t\t\treturn customValidator?.( valueRef.current );\n\t\t\t} }\n\t\t\tgetValidityTarget={ () => validityTargetRef.current }\n\t\t>\n\t\t\t<TextControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tref={ mergedRefs }\n\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\tvalueRef.current = value;\n\t\t\t\t\tonChange?.( value );\n\t\t\t\t} }\n\t\t\t\t{ ...restProps }\n\t\t\t/>\n\t\t</ControlWithError>\n\t);\n};\n\nexport const ValidatedTextControl = forwardRef(\n\tUnforwardedValidatedTextControl\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,oBAAoB;AACjD,SAASC,UAAU,EAAEC,MAAM,QAAQ,oBAAoB;;AAEvD;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,uBAAuB;AAExD,OAAOC,WAAW,MAAM,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAK7C,MAAMC,+BAA+B,GAAGA,CACvC;EACCC,QAAQ;EACRC,eAAe;EACfC,QAAQ;EACRC,gBAAgB;EAChB,GAAGC;AAK0B,CAAC,EAC/BC,YAAoD,KAChD;EACJ,MAAMC,iBAAiB,GAAGZ,MAAM,CAAsB,IAAK,CAAC;EAC5D,MAAMa,UAAU,GAAGf,YAAY,CAAE,CAAEa,YAAY,EAAEC,iBAAiB,CAAG,CAAC;EACtE,MAAME,QAAQ,GAAGd,MAAM,CAAWU,SAAS,CAACK,KAAM,CAAC;EAEnD,oBACCX,IAAA,CAACH,gBAAgB;IAChBK,QAAQ,EAAGA,QAAU;IACrBG,gBAAgB,EAAGA,gBAAkB;IACrCF,eAAe,EAAGA,CAAA,KAAM;MACvB,OAAOA,eAAe,GAAIO,QAAQ,CAACE,OAAQ,CAAC;IAC7C,CAAG;IACHC,iBAAiB,EAAGA,CAAA,KAAML,iBAAiB,CAACI,OAAS;IAAAE,QAAA,eAErDd,IAAA,CAACF,WAAW;MACXiB,qBAAqB;MACrBC,uBAAuB;MACvBC,GAAG,EAAGR,UAAY;MAClBL,QAAQ,EAAKO,KAAK,IAAM;QACvBD,QAAQ,CAACE,OAAO,GAAGD,KAAK;QACxBP,QAAQ,GAAIO,KAAM,CAAC;MACpB,CAAG;MAAA,GACEL;IAAS,CACd;EAAC,CACe,CAAC;AAErB,CAAC;AAED,OAAO,MAAMY,oBAAoB,GAAGvB,UAAU,CAC7CM,+BACD,CAAC","ignoreList":[]}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { forwardRef, useRef } from '@wordpress/element';
5
+ import { useMergeRefs } from '@wordpress/compose';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { ControlWithError } from '../control-with-error';
11
+ import TextareaControl from '../../textarea-control';
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ const UnforwardedValidatedTextareaControl = ({
14
+ required,
15
+ customValidator,
16
+ onChange,
17
+ markWhenOptional,
18
+ ...restProps
19
+ }, forwardedRef) => {
20
+ const validityTargetRef = useRef(null);
21
+ const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
22
+ const valueRef = useRef(restProps.value);
23
+ return /*#__PURE__*/_jsx(ControlWithError, {
24
+ required: required,
25
+ markWhenOptional: markWhenOptional,
26
+ customValidator: () => {
27
+ return customValidator?.(valueRef.current);
28
+ },
29
+ getValidityTarget: () => validityTargetRef.current,
30
+ children: /*#__PURE__*/_jsx(TextareaControl, {
31
+ __nextHasNoMarginBottom: true,
32
+ ref: mergedRefs,
33
+ onChange: value => {
34
+ valueRef.current = value;
35
+ onChange?.(value);
36
+ },
37
+ ...restProps
38
+ })
39
+ });
40
+ };
41
+ export const ValidatedTextareaControl = forwardRef(UnforwardedValidatedTextareaControl);
42
+ //# sourceMappingURL=textarea-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["forwardRef","useRef","useMergeRefs","ControlWithError","TextareaControl","jsx","_jsx","UnforwardedValidatedTextareaControl","required","customValidator","onChange","markWhenOptional","restProps","forwardedRef","validityTargetRef","mergedRefs","valueRef","value","current","getValidityTarget","children","__nextHasNoMarginBottom","ref","ValidatedTextareaControl"],"sources":["@wordpress/components/src/validated-form-controls/components/textarea-control.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { ControlWithError } from '../control-with-error';\nimport type { ValidatedControlProps } from './types';\nimport TextareaControl from '../../textarea-control';\nimport type { TextareaControlProps } from '../../textarea-control/types';\n\ntype Value = TextareaControlProps[ 'value' ];\n\nconst UnforwardedValidatedTextareaControl = (\n\t{\n\t\trequired,\n\t\tcustomValidator,\n\t\tonChange,\n\t\tmarkWhenOptional,\n\t\t...restProps\n\t}: Omit<\n\t\tReact.ComponentProps< typeof TextareaControl >,\n\t\t'__nextHasNoMarginBottom'\n\t> &\n\t\tValidatedControlProps< Value >,\n\tforwardedRef: React.ForwardedRef< HTMLTextAreaElement >\n) => {\n\tconst validityTargetRef = useRef< HTMLTextAreaElement >( null );\n\tconst mergedRefs = useMergeRefs( [ forwardedRef, validityTargetRef ] );\n\tconst valueRef = useRef< Value >( restProps.value );\n\n\treturn (\n\t\t<ControlWithError\n\t\t\trequired={ required }\n\t\t\tmarkWhenOptional={ markWhenOptional }\n\t\t\tcustomValidator={ () => {\n\t\t\t\treturn customValidator?.( valueRef.current );\n\t\t\t} }\n\t\t\tgetValidityTarget={ () => validityTargetRef.current }\n\t\t>\n\t\t\t<TextareaControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tref={ mergedRefs }\n\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\tvalueRef.current = value;\n\t\t\t\t\tonChange?.( value );\n\t\t\t\t} }\n\t\t\t\t{ ...restProps }\n\t\t\t/>\n\t\t</ControlWithError>\n\t);\n};\n\nexport const ValidatedTextareaControl = forwardRef(\n\tUnforwardedValidatedTextareaControl\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,MAAM,QAAQ,oBAAoB;AACvD,SAASC,YAAY,QAAQ,oBAAoB;;AAEjD;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,uBAAuB;AAExD,OAAOC,eAAe,MAAM,wBAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAKrD,MAAMC,mCAAmC,GAAGA,CAC3C;EACCC,QAAQ;EACRC,eAAe;EACfC,QAAQ;EACRC,gBAAgB;EAChB,GAAGC;AAK0B,CAAC,EAC/BC,YAAuD,KACnD;EACJ,MAAMC,iBAAiB,GAAGb,MAAM,CAAyB,IAAK,CAAC;EAC/D,MAAMc,UAAU,GAAGb,YAAY,CAAE,CAAEW,YAAY,EAAEC,iBAAiB,CAAG,CAAC;EACtE,MAAME,QAAQ,GAAGf,MAAM,CAAWW,SAAS,CAACK,KAAM,CAAC;EAEnD,oBACCX,IAAA,CAACH,gBAAgB;IAChBK,QAAQ,EAAGA,QAAU;IACrBG,gBAAgB,EAAGA,gBAAkB;IACrCF,eAAe,EAAGA,CAAA,KAAM;MACvB,OAAOA,eAAe,GAAIO,QAAQ,CAACE,OAAQ,CAAC;IAC7C,CAAG;IACHC,iBAAiB,EAAGA,CAAA,KAAML,iBAAiB,CAACI,OAAS;IAAAE,QAAA,eAErDd,IAAA,CAACF,eAAe;MACfiB,uBAAuB;MACvBC,GAAG,EAAGP,UAAY;MAClBL,QAAQ,EAAKO,KAAK,IAAM;QACvBD,QAAQ,CAACE,OAAO,GAAGD,KAAK;QACxBP,QAAQ,GAAIO,KAAM,CAAC;MACpB,CAAG;MAAA,GACEL;IAAS,CACd;EAAC,CACe,CAAC;AAErB,CAAC;AAED,OAAO,MAAMW,wBAAwB,GAAGvB,UAAU,CACjDO,mCACD,CAAC","ignoreList":[]}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { forwardRef, useRef, useEffect } from '@wordpress/element';
5
+ import { useMergeRefs } from '@wordpress/compose';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { ControlWithError } from '../control-with-error';
11
+ import ToggleControl from '../../toggle-control';
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ // TODO: Should we customize the default `missingValue` message? It says to "check this box".
14
+
15
+ const UnforwardedValidatedToggleControl = ({
16
+ required,
17
+ customValidator,
18
+ onChange,
19
+ markWhenOptional,
20
+ ...restProps
21
+ }, forwardedRef) => {
22
+ const validityTargetRef = useRef(null);
23
+ const mergedRefs = useMergeRefs([forwardedRef, validityTargetRef]);
24
+ const valueRef = useRef(restProps.checked);
25
+
26
+ // TODO: Upstream limitation - The `required` attribute is not passed down to the input,
27
+ // so we need to set it manually.
28
+ useEffect(() => {
29
+ if (validityTargetRef.current) {
30
+ validityTargetRef.current.required = required !== null && required !== void 0 ? required : false;
31
+ }
32
+ }, [required]);
33
+ return /*#__PURE__*/_jsx(ControlWithError, {
34
+ required: required,
35
+ markWhenOptional: markWhenOptional,
36
+ customValidator: () => {
37
+ return customValidator?.(valueRef.current);
38
+ },
39
+ getValidityTarget: () => validityTargetRef.current,
40
+ children: /*#__PURE__*/_jsx(ToggleControl, {
41
+ __nextHasNoMarginBottom: true,
42
+ ref: mergedRefs,
43
+ onChange: value => {
44
+ valueRef.current = value;
45
+ onChange?.(value);
46
+ },
47
+ ...restProps
48
+ })
49
+ });
50
+ };
51
+ export const ValidatedToggleControl = forwardRef(UnforwardedValidatedToggleControl);
52
+ //# sourceMappingURL=toggle-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["forwardRef","useRef","useEffect","useMergeRefs","ControlWithError","ToggleControl","jsx","_jsx","UnforwardedValidatedToggleControl","required","customValidator","onChange","markWhenOptional","restProps","forwardedRef","validityTargetRef","mergedRefs","valueRef","checked","current","getValidityTarget","children","__nextHasNoMarginBottom","ref","value","ValidatedToggleControl"],"sources":["@wordpress/components/src/validated-form-controls/components/toggle-control.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useRef, useEffect } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { ControlWithError } from '../control-with-error';\nimport type { ValidatedControlProps } from './types';\nimport ToggleControl from '../../toggle-control';\nimport type { ToggleControlProps } from '../../toggle-control/types';\n\ntype Value = ToggleControlProps[ 'checked' ];\n\n// TODO: Should we customize the default `missingValue` message? It says to \"check this box\".\n\nconst UnforwardedValidatedToggleControl = (\n\t{\n\t\trequired,\n\t\tcustomValidator,\n\t\tonChange,\n\t\tmarkWhenOptional,\n\t\t...restProps\n\t}: Omit<\n\t\tReact.ComponentProps< typeof ToggleControl >,\n\t\t'__nextHasNoMarginBottom'\n\t> &\n\t\tValidatedControlProps< Value >,\n\tforwardedRef: React.ForwardedRef< HTMLInputElement >\n) => {\n\tconst validityTargetRef = useRef< HTMLInputElement >( null );\n\tconst mergedRefs = useMergeRefs( [ forwardedRef, validityTargetRef ] );\n\tconst valueRef = useRef< Value >( restProps.checked );\n\n\t// TODO: Upstream limitation - The `required` attribute is not passed down to the input,\n\t// so we need to set it manually.\n\tuseEffect( () => {\n\t\tif ( validityTargetRef.current ) {\n\t\t\tvalidityTargetRef.current.required = required ?? false;\n\t\t}\n\t}, [ required ] );\n\n\treturn (\n\t\t<ControlWithError\n\t\t\trequired={ required }\n\t\t\tmarkWhenOptional={ markWhenOptional }\n\t\t\tcustomValidator={ () => {\n\t\t\t\treturn customValidator?.( valueRef.current );\n\t\t\t} }\n\t\t\tgetValidityTarget={ () => validityTargetRef.current }\n\t\t>\n\t\t\t<ToggleControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tref={ mergedRefs }\n\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\tvalueRef.current = value;\n\t\t\t\t\tonChange?.( value );\n\t\t\t\t} }\n\t\t\t\t{ ...restProps }\n\t\t\t/>\n\t\t</ControlWithError>\n\t);\n};\n\nexport const ValidatedToggleControl = forwardRef(\n\tUnforwardedValidatedToggleControl\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;AAClE,SAASC,YAAY,QAAQ,oBAAoB;;AAEjD;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,uBAAuB;AAExD,OAAOC,aAAa,MAAM,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAKjD;;AAEA,MAAMC,iCAAiC,GAAGA,CACzC;EACCC,QAAQ;EACRC,eAAe;EACfC,QAAQ;EACRC,gBAAgB;EAChB,GAAGC;AAK0B,CAAC,EAC/BC,YAAoD,KAChD;EACJ,MAAMC,iBAAiB,GAAGd,MAAM,CAAsB,IAAK,CAAC;EAC5D,MAAMe,UAAU,GAAGb,YAAY,CAAE,CAAEW,YAAY,EAAEC,iBAAiB,CAAG,CAAC;EACtE,MAAME,QAAQ,GAAGhB,MAAM,CAAWY,SAAS,CAACK,OAAQ,CAAC;;EAErD;EACA;EACAhB,SAAS,CAAE,MAAM;IAChB,IAAKa,iBAAiB,CAACI,OAAO,EAAG;MAChCJ,iBAAiB,CAACI,OAAO,CAACV,QAAQ,GAAGA,QAAQ,aAARA,QAAQ,cAARA,QAAQ,GAAI,KAAK;IACvD;EACD,CAAC,EAAE,CAAEA,QAAQ,CAAG,CAAC;EAEjB,oBACCF,IAAA,CAACH,gBAAgB;IAChBK,QAAQ,EAAGA,QAAU;IACrBG,gBAAgB,EAAGA,gBAAkB;IACrCF,eAAe,EAAGA,CAAA,KAAM;MACvB,OAAOA,eAAe,GAAIO,QAAQ,CAACE,OAAQ,CAAC;IAC7C,CAAG;IACHC,iBAAiB,EAAGA,CAAA,KAAML,iBAAiB,CAACI,OAAS;IAAAE,QAAA,eAErDd,IAAA,CAACF,aAAa;MACbiB,uBAAuB;MACvBC,GAAG,EAAGP,UAAY;MAClBL,QAAQ,EAAKa,KAAK,IAAM;QACvBP,QAAQ,CAACE,OAAO,GAAGK,KAAK;QACxBb,QAAQ,GAAIa,KAAM,CAAC;MACpB,CAAG;MAAA,GACEX;IAAS,CACd;EAAC,CACe,CAAC;AAErB,CAAC;AAED,OAAO,MAAMY,sBAAsB,GAAGzB,UAAU,CAC/CQ,iCACD,CAAC","ignoreList":[]}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { forwardRef, useId, useRef } from '@wordpress/element';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import { ControlWithError } from '../control-with-error';
10
+ import { ToggleGroupControl } from '../../toggle-group-control';
11
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
+ const UnforwardedValidatedToggleGroupControl = ({
13
+ required,
14
+ customValidator,
15
+ onChange,
16
+ markWhenOptional,
17
+ ...restProps
18
+ }, forwardedRef) => {
19
+ const validityTargetRef = useRef(null);
20
+ const valueRef = useRef(restProps.value);
21
+ const nameAttr = useId();
22
+ return /*#__PURE__*/_jsxs("div", {
23
+ className: "components-validated-control__wrapper-with-error-delegate",
24
+ children: [/*#__PURE__*/_jsx(ControlWithError, {
25
+ required: required,
26
+ markWhenOptional: markWhenOptional,
27
+ customValidator: () => {
28
+ return customValidator?.(valueRef.current);
29
+ },
30
+ getValidityTarget: () => validityTargetRef.current,
31
+ children: /*#__PURE__*/_jsx(ToggleGroupControl, {
32
+ __nextHasNoMarginBottom: true,
33
+ __next40pxDefaultSize: true,
34
+ ref: forwardedRef
35
+ // TODO: Upstream limitation - In uncontrolled mode, starting from an undefined value then
36
+ // setting a value has a visual bug.
37
+ ,
38
+ onChange: value => {
39
+ valueRef.current = value;
40
+ onChange?.(value);
41
+ },
42
+ ...restProps
43
+ })
44
+ }), /*#__PURE__*/_jsx("input", {
45
+ className: "components-validated-control__error-delegate",
46
+ type: "radio",
47
+ ref: validityTargetRef,
48
+ required: required,
49
+ checked: restProps.value !== null,
50
+ tabIndex: -1
51
+ // A name attribute is needed for the `required` behavior to work.
52
+ ,
53
+ name: nameAttr,
54
+ onChange: () => {},
55
+ onFocus: e => {
56
+ e.target.previousElementSibling?.querySelector('[data-active-item="true"]')?.focus();
57
+ }
58
+ })]
59
+ });
60
+ };
61
+ export const ValidatedToggleGroupControl = forwardRef(UnforwardedValidatedToggleGroupControl);
62
+ //# sourceMappingURL=toggle-group-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["forwardRef","useId","useRef","ControlWithError","ToggleGroupControl","jsx","_jsx","jsxs","_jsxs","UnforwardedValidatedToggleGroupControl","required","customValidator","onChange","markWhenOptional","restProps","forwardedRef","validityTargetRef","valueRef","value","nameAttr","className","children","current","getValidityTarget","__nextHasNoMarginBottom","__next40pxDefaultSize","ref","type","checked","tabIndex","name","onFocus","e","target","previousElementSibling","querySelector","focus","ValidatedToggleGroupControl"],"sources":["@wordpress/components/src/validated-form-controls/components/toggle-group-control.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useId, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { ControlWithError } from '../control-with-error';\nimport type { ValidatedControlProps } from './types';\nimport { ToggleGroupControl } from '../../toggle-group-control';\nimport type { ToggleGroupControlProps } from '../../toggle-group-control/types';\n\ntype Value = ToggleGroupControlProps[ 'value' ];\n\nconst UnforwardedValidatedToggleGroupControl = (\n\t{\n\t\trequired,\n\t\tcustomValidator,\n\t\tonChange,\n\t\tmarkWhenOptional,\n\t\t...restProps\n\t}: Omit<\n\t\tReact.ComponentProps< typeof ToggleGroupControl >,\n\t\t'__next40pxDefaultSize' | '__nextHasNoMarginBottom'\n\t> &\n\t\tValidatedControlProps< Value >,\n\tforwardedRef: React.ForwardedRef< HTMLInputElement >\n) => {\n\tconst validityTargetRef = useRef< HTMLInputElement >( null );\n\tconst valueRef = useRef< Value >( restProps.value );\n\n\tconst nameAttr = useId();\n\n\treturn (\n\t\t<div className=\"components-validated-control__wrapper-with-error-delegate\">\n\t\t\t<ControlWithError\n\t\t\t\trequired={ required }\n\t\t\t\tmarkWhenOptional={ markWhenOptional }\n\t\t\t\tcustomValidator={ () => {\n\t\t\t\t\treturn customValidator?.( valueRef.current );\n\t\t\t\t} }\n\t\t\t\tgetValidityTarget={ () => validityTargetRef.current }\n\t\t\t>\n\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tref={ forwardedRef }\n\t\t\t\t\t// TODO: Upstream limitation - In uncontrolled mode, starting from an undefined value then\n\t\t\t\t\t// setting a value has a visual bug.\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\tvalueRef.current = value;\n\t\t\t\t\t\tonChange?.( value );\n\t\t\t\t\t} }\n\t\t\t\t\t{ ...restProps }\n\t\t\t\t/>\n\t\t\t</ControlWithError>\n\t\t\t<input\n\t\t\t\tclassName=\"components-validated-control__error-delegate\"\n\t\t\t\ttype=\"radio\"\n\t\t\t\tref={ validityTargetRef }\n\t\t\t\trequired={ required }\n\t\t\t\tchecked={ restProps.value !== null }\n\t\t\t\ttabIndex={ -1 }\n\t\t\t\t// A name attribute is needed for the `required` behavior to work.\n\t\t\t\tname={ nameAttr }\n\t\t\t\tonChange={ () => {} }\n\t\t\t\tonFocus={ ( e ) => {\n\t\t\t\t\te.target.previousElementSibling\n\t\t\t\t\t\t?.querySelector< HTMLButtonElement | HTMLInputElement >(\n\t\t\t\t\t\t\t'[data-active-item=\"true\"]'\n\t\t\t\t\t\t)\n\t\t\t\t\t\t?.focus();\n\t\t\t\t} }\n\t\t\t/>\n\t\t</div>\n\t);\n};\n\nexport const ValidatedToggleGroupControl = forwardRef(\n\tUnforwardedValidatedToggleGroupControl\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,KAAK,EAAEC,MAAM,QAAQ,oBAAoB;;AAE9D;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,uBAAuB;AAExD,SAASC,kBAAkB,QAAQ,4BAA4B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAKhE,MAAMC,sCAAsC,GAAGA,CAC9C;EACCC,QAAQ;EACRC,eAAe;EACfC,QAAQ;EACRC,gBAAgB;EAChB,GAAGC;AAK0B,CAAC,EAC/BC,YAAoD,KAChD;EACJ,MAAMC,iBAAiB,GAAGd,MAAM,CAAsB,IAAK,CAAC;EAC5D,MAAMe,QAAQ,GAAGf,MAAM,CAAWY,SAAS,CAACI,KAAM,CAAC;EAEnD,MAAMC,QAAQ,GAAGlB,KAAK,CAAC,CAAC;EAExB,oBACCO,KAAA;IAAKY,SAAS,EAAC,2DAA2D;IAAAC,QAAA,gBACzEf,IAAA,CAACH,gBAAgB;MAChBO,QAAQ,EAAGA,QAAU;MACrBG,gBAAgB,EAAGA,gBAAkB;MACrCF,eAAe,EAAGA,CAAA,KAAM;QACvB,OAAOA,eAAe,GAAIM,QAAQ,CAACK,OAAQ,CAAC;MAC7C,CAAG;MACHC,iBAAiB,EAAGA,CAAA,KAAMP,iBAAiB,CAACM,OAAS;MAAAD,QAAA,eAErDf,IAAA,CAACF,kBAAkB;QAClBoB,uBAAuB;QACvBC,qBAAqB;QACrBC,GAAG,EAAGX;QACN;QACA;QAAA;QACAH,QAAQ,EAAKM,KAAK,IAAM;UACvBD,QAAQ,CAACK,OAAO,GAAGJ,KAAK;UACxBN,QAAQ,GAAIM,KAAM,CAAC;QACpB,CAAG;QAAA,GACEJ;MAAS,CACd;IAAC,CACe,CAAC,eACnBR,IAAA;MACCc,SAAS,EAAC,8CAA8C;MACxDO,IAAI,EAAC,OAAO;MACZD,GAAG,EAAGV,iBAAmB;MACzBN,QAAQ,EAAGA,QAAU;MACrBkB,OAAO,EAAGd,SAAS,CAACI,KAAK,KAAK,IAAM;MACpCW,QAAQ,EAAG,CAAC;MACZ;MAAA;MACAC,IAAI,EAAGX,QAAU;MACjBP,QAAQ,EAAGA,CAAA,KAAM,CAAC,CAAG;MACrBmB,OAAO,EAAKC,CAAC,IAAM;QAClBA,CAAC,CAACC,MAAM,CAACC,sBAAsB,EAC5BC,aAAa,CACd,2BACD,CAAC,EACCC,KAAK,CAAC,CAAC;MACX;IAAG,CACH,CAAC;EAAA,CACE,CAAC;AAER,CAAC;AAED,OAAO,MAAMC,2BAA2B,GAAGrC,UAAU,CACpDS,sCACD,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/validated-form-controls/components/types.ts"],"sourcesContent":["export type ValidatedControlProps< V > = {\n\t/**\n\t * Whether the control is required.\n\t * @default false\n\t */\n\trequired?: boolean;\n\t/**\n\t * Label the control as \"optional\" when _not_ `required`, instead of the inverse.\n\t * @default false\n\t */\n\tmarkWhenOptional?: boolean;\n\t/**\n\t * A function that returns a custom validity message when applicable. This error message will be applied to the\n\t * underlying element using the native [`setCustomValidity()` method](https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/setCustomValidity).\n\t * This means the custom validator will be run _in addition_ to any other HTML attribute-based validation, and\n\t * will be prioritized over any existing validity messages dictated by the HTML attributes.\n\t * An empty string or `undefined` return value will clear any existing custom validity message.\n\t *\n\t * Make sure you don't programatically pass a value (such as an initial value) to the control component\n\t * that fails this validator, because the validator will only run for user-initiated changes.\n\t *\n\t * Always prefer using standard HTML attributes like `required` and `min`/`max` over custom validators\n\t * when possible, as they are simpler and have localized error messages built in.\n\t */\n\t// TODO: Technically, we could add an optional `customValidity` string prop so the consumer can set\n\t// an error message at any point in time. We should wait until we have a use case though.\n\tcustomValidator?: ( currentValue: V ) => string | void;\n};\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,129 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import { error } from '@wordpress/icons';
6
+
7
+ /**
8
+ * External dependencies
9
+ */
10
+ import { cloneElement, forwardRef, useEffect, useState } from '@wordpress/element';
11
+
12
+ /**
13
+ * Internal dependencies
14
+ */
15
+ import { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';
16
+ import Icon from '../icon';
17
+ import { Fragment as _Fragment, jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
18
+ function appendRequiredIndicator(label, required, markWhenOptional) {
19
+ if (required && !markWhenOptional) {
20
+ return /*#__PURE__*/_jsxs(_Fragment, {
21
+ children: [label, " ", `(${__('Required')})`]
22
+ });
23
+ }
24
+ if (!required && markWhenOptional) {
25
+ return /*#__PURE__*/_jsxs(_Fragment, {
26
+ children: [label, " ", `(${__('Optional')})`]
27
+ });
28
+ }
29
+ return label;
30
+ }
31
+
32
+ /**
33
+ * HTML elements that support the Constraint Validation API.
34
+ *
35
+ * Here, we exclude HTMLButtonElement because although it does technically support the API,
36
+ * normal buttons are actually exempted from any validation.
37
+ * @see https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Forms/Form_validation
38
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/willValidate
39
+ */
40
+
41
+ function UnforwardedControlWithError({
42
+ required,
43
+ markWhenOptional,
44
+ customValidator,
45
+ getValidityTarget,
46
+ children
47
+ }, forwardedRef) {
48
+ const [errorMessage, setErrorMessage] = useState();
49
+ const [isTouched, setIsTouched] = useState(false);
50
+
51
+ // Ensure that error messages are visible after user attemps to submit a form
52
+ // with multiple invalid fields.
53
+ useEffect(() => {
54
+ const validityTarget = getValidityTarget();
55
+ const showValidationMessage = () => setErrorMessage(validityTarget?.validationMessage);
56
+ validityTarget?.addEventListener('invalid', showValidationMessage);
57
+ return () => {
58
+ validityTarget?.removeEventListener('invalid', showValidationMessage);
59
+ };
60
+ });
61
+ const validate = () => {
62
+ const message = customValidator?.();
63
+ const validityTarget = getValidityTarget();
64
+ validityTarget?.setCustomValidity(message !== null && message !== void 0 ? message : '');
65
+ setErrorMessage(validityTarget?.validationMessage);
66
+ };
67
+ const onBlur = event => {
68
+ // Only consider "blurred from the component" if focus has fully left the wrapping div.
69
+ // This prevents unnecessary blurs from components with multiple focusable elements.
70
+ if (!event.relatedTarget || !event.currentTarget.contains(event.relatedTarget)) {
71
+ setIsTouched(true);
72
+ const validityTarget = getValidityTarget();
73
+
74
+ // Prevents a double flash of the native error tooltip when the control is already showing one.
75
+ if (!validityTarget?.validity.valid) {
76
+ if (!errorMessage) {
77
+ setErrorMessage(validityTarget?.validationMessage);
78
+ }
79
+ return;
80
+ }
81
+ validate();
82
+ }
83
+ };
84
+ const onChange = (...args) => {
85
+ children.props.onChange?.(...args);
86
+
87
+ // Only validate incrementally if the field has blurred at least once,
88
+ // or currently has an error message.
89
+ if (isTouched || errorMessage) {
90
+ validate();
91
+ }
92
+ };
93
+ const onKeyDown = event => {
94
+ // Ensures that custom validators are triggered when the user submits by pressing Enter,
95
+ // without ever blurring the control.
96
+ if (event.key === 'Enter') {
97
+ validate();
98
+ }
99
+ };
100
+ return (
101
+ /*#__PURE__*/
102
+ // Disable reason: Just listening to a bubbled event, not for interaction.
103
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
104
+ _jsxs("div", {
105
+ className: "components-validated-control",
106
+ ref: forwardedRef,
107
+ onBlur: onBlur,
108
+ onKeyDown: withIgnoreIMEEvents(onKeyDown),
109
+ children: [cloneElement(children, {
110
+ label: appendRequiredIndicator(children.props.label, required, markWhenOptional),
111
+ onChange,
112
+ required
113
+ }), /*#__PURE__*/_jsx("div", {
114
+ "aria-live": "polite",
115
+ children: errorMessage && /*#__PURE__*/_jsxs("p", {
116
+ className: "components-validated-control__error",
117
+ children: [/*#__PURE__*/_jsx(Icon, {
118
+ className: "components-validated-control__error-icon",
119
+ icon: error,
120
+ size: 16,
121
+ fill: "currentColor"
122
+ }), errorMessage]
123
+ })
124
+ })]
125
+ })
126
+ );
127
+ }
128
+ export const ControlWithError = forwardRef(UnforwardedControlWithError);
129
+ //# sourceMappingURL=control-with-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__","error","cloneElement","forwardRef","useEffect","useState","withIgnoreIMEEvents","Icon","Fragment","_Fragment","jsxs","_jsxs","jsx","_jsx","appendRequiredIndicator","label","required","markWhenOptional","children","UnforwardedControlWithError","customValidator","getValidityTarget","forwardedRef","errorMessage","setErrorMessage","isTouched","setIsTouched","validityTarget","showValidationMessage","validationMessage","addEventListener","removeEventListener","validate","message","setCustomValidity","onBlur","event","relatedTarget","currentTarget","contains","validity","valid","onChange","args","props","onKeyDown","key","className","ref","icon","size","fill","ControlWithError"],"sources":["@wordpress/components/src/validated-form-controls/control-with-error.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { error } from '@wordpress/icons';\n\n/**\n * External dependencies\n */\nimport {\n\tcloneElement,\n\tforwardRef,\n\tuseEffect,\n\tuseState,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';\n\nimport Icon from '../icon';\n\nfunction appendRequiredIndicator(\n\tlabel: React.ReactNode,\n\trequired: boolean | undefined,\n\tmarkWhenOptional: boolean | undefined\n) {\n\tif ( required && ! markWhenOptional ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ label } { `(${ __( 'Required' ) })` }\n\t\t\t</>\n\t\t);\n\t}\n\tif ( ! required && markWhenOptional ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ label } { `(${ __( 'Optional' ) })` }\n\t\t\t</>\n\t\t);\n\t}\n\treturn label;\n}\n\n/**\n * HTML elements that support the Constraint Validation API.\n *\n * Here, we exclude HTMLButtonElement because although it does technically support the API,\n * normal buttons are actually exempted from any validation.\n * @see https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Forms/Form_validation\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/willValidate\n */\ntype ValidityTarget =\n\t| HTMLFieldSetElement\n\t| HTMLInputElement\n\t| HTMLSelectElement\n\t| HTMLTextAreaElement;\n\nfunction UnforwardedControlWithError< C extends React.ReactElement >(\n\t{\n\t\trequired,\n\t\tmarkWhenOptional,\n\t\tcustomValidator,\n\t\tgetValidityTarget,\n\t\tchildren,\n\t}: {\n\t\t/**\n\t\t * Whether the control is required.\n\t\t */\n\t\trequired?: boolean;\n\t\t/**\n\t\t * Label the control as \"optional\" when _not_ `required`, instead of the inverse.\n\t\t */\n\t\tmarkWhenOptional?: boolean;\n\t\t/**\n\t\t * A function that returns a custom validity message when applicable.\n\t\t *\n\t\t * This message will be applied to the element returned by `getValidityTarget`.\n\t\t * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/setCustomValidity\n\t\t */\n\t\tcustomValidator?: () => string | void;\n\t\t/**\n\t\t * A function that returns the actual element on which the validity data should be applied.\n\t\t */\n\t\tgetValidityTarget: () => ValidityTarget | null | undefined;\n\t\t/**\n\t\t * The control component to apply validation to.\n\t\t */\n\t\tchildren: C;\n\t},\n\tforwardedRef: React.ForwardedRef< HTMLDivElement >\n) {\n\tconst [ errorMessage, setErrorMessage ] = useState< string | undefined >();\n\tconst [ isTouched, setIsTouched ] = useState( false );\n\n\t// Ensure that error messages are visible after user attemps to submit a form\n\t// with multiple invalid fields.\n\tuseEffect( () => {\n\t\tconst validityTarget = getValidityTarget();\n\t\tconst showValidationMessage = () =>\n\t\t\tsetErrorMessage( validityTarget?.validationMessage );\n\n\t\tvalidityTarget?.addEventListener( 'invalid', showValidationMessage );\n\n\t\treturn () => {\n\t\t\tvalidityTarget?.removeEventListener(\n\t\t\t\t'invalid',\n\t\t\t\tshowValidationMessage\n\t\t\t);\n\t\t};\n\t} );\n\n\tconst validate = () => {\n\t\tconst message = customValidator?.();\n\t\tconst validityTarget = getValidityTarget();\n\n\t\tvalidityTarget?.setCustomValidity( message ?? '' );\n\t\tsetErrorMessage( validityTarget?.validationMessage );\n\t};\n\n\tconst onBlur = ( event: React.FocusEvent< HTMLDivElement > ) => {\n\t\t// Only consider \"blurred from the component\" if focus has fully left the wrapping div.\n\t\t// This prevents unnecessary blurs from components with multiple focusable elements.\n\t\tif (\n\t\t\t! event.relatedTarget ||\n\t\t\t! event.currentTarget.contains( event.relatedTarget )\n\t\t) {\n\t\t\tsetIsTouched( true );\n\n\t\t\tconst validityTarget = getValidityTarget();\n\n\t\t\t// Prevents a double flash of the native error tooltip when the control is already showing one.\n\t\t\tif ( ! validityTarget?.validity.valid ) {\n\t\t\t\tif ( ! errorMessage ) {\n\t\t\t\t\tsetErrorMessage( validityTarget?.validationMessage );\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvalidate();\n\t\t}\n\t};\n\n\tconst onChange = ( ...args: unknown[] ) => {\n\t\tchildren.props.onChange?.( ...args );\n\n\t\t// Only validate incrementally if the field has blurred at least once,\n\t\t// or currently has an error message.\n\t\tif ( isTouched || errorMessage ) {\n\t\t\tvalidate();\n\t\t}\n\t};\n\n\tconst onKeyDown = ( event: React.KeyboardEvent< HTMLDivElement > ) => {\n\t\t// Ensures that custom validators are triggered when the user submits by pressing Enter,\n\t\t// without ever blurring the control.\n\t\tif ( event.key === 'Enter' ) {\n\t\t\tvalidate();\n\t\t}\n\t};\n\n\treturn (\n\t\t// Disable reason: Just listening to a bubbled event, not for interaction.\n\t\t// eslint-disable-next-line jsx-a11y/no-static-element-interactions\n\t\t<div\n\t\t\tclassName=\"components-validated-control\"\n\t\t\tref={ forwardedRef }\n\t\t\tonBlur={ onBlur }\n\t\t\tonKeyDown={ withIgnoreIMEEvents( onKeyDown ) }\n\t\t>\n\t\t\t{ cloneElement( children, {\n\t\t\t\tlabel: appendRequiredIndicator(\n\t\t\t\t\tchildren.props.label,\n\t\t\t\t\trequired,\n\t\t\t\t\tmarkWhenOptional\n\t\t\t\t),\n\t\t\t\tonChange,\n\t\t\t\trequired,\n\t\t\t} ) }\n\t\t\t<div aria-live=\"polite\">\n\t\t\t\t{ errorMessage && (\n\t\t\t\t\t<p className=\"components-validated-control__error\">\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tclassName=\"components-validated-control__error-icon\"\n\t\t\t\t\t\t\ticon={ error }\n\t\t\t\t\t\t\tsize={ 16 }\n\t\t\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ errorMessage }\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport const ControlWithError = forwardRef( UnforwardedControlWithError );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,QAAQ,kBAAkB;;AAExC;AACA;AACA;AACA,SACCC,YAAY,EACZC,UAAU,EACVC,SAAS,EACTC,QAAQ,QACF,oBAAoB;;AAE3B;AACA;AACA;AACA,SAASC,mBAAmB,QAAQ,iCAAiC;AAErE,OAAOC,IAAI,MAAM,SAAS;AAAC,SAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,GAAA,IAAAC,IAAA;AAE3B,SAASC,uBAAuBA,CAC/BC,KAAsB,EACtBC,QAA6B,EAC7BC,gBAAqC,EACpC;EACD,IAAKD,QAAQ,IAAI,CAAEC,gBAAgB,EAAG;IACrC,oBACCN,KAAA,CAAAF,SAAA;MAAAS,QAAA,GACGH,KAAK,EAAE,GAAC,EAAE,IAAKf,EAAE,CAAE,UAAW,CAAC,GAAI;IAAA,CACpC,CAAC;EAEL;EACA,IAAK,CAAEgB,QAAQ,IAAIC,gBAAgB,EAAG;IACrC,oBACCN,KAAA,CAAAF,SAAA;MAAAS,QAAA,GACGH,KAAK,EAAE,GAAC,EAAE,IAAKf,EAAE,CAAE,UAAW,CAAC,GAAI;IAAA,CACpC,CAAC;EAEL;EACA,OAAOe,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA,SAASI,2BAA2BA,CACnC;EACCH,QAAQ;EACRC,gBAAgB;EAChBG,eAAe;EACfC,iBAAiB;EACjBH;AAyBD,CAAC,EACDI,YAAkD,EACjD;EACD,MAAM,CAAEC,YAAY,EAAEC,eAAe,CAAE,GAAGnB,QAAQ,CAAuB,CAAC;EAC1E,MAAM,CAAEoB,SAAS,EAAEC,YAAY,CAAE,GAAGrB,QAAQ,CAAE,KAAM,CAAC;;EAErD;EACA;EACAD,SAAS,CAAE,MAAM;IAChB,MAAMuB,cAAc,GAAGN,iBAAiB,CAAC,CAAC;IAC1C,MAAMO,qBAAqB,GAAGA,CAAA,KAC7BJ,eAAe,CAAEG,cAAc,EAAEE,iBAAkB,CAAC;IAErDF,cAAc,EAAEG,gBAAgB,CAAE,SAAS,EAAEF,qBAAsB,CAAC;IAEpE,OAAO,MAAM;MACZD,cAAc,EAAEI,mBAAmB,CAClC,SAAS,EACTH,qBACD,CAAC;IACF,CAAC;EACF,CAAE,CAAC;EAEH,MAAMI,QAAQ,GAAGA,CAAA,KAAM;IACtB,MAAMC,OAAO,GAAGb,eAAe,GAAG,CAAC;IACnC,MAAMO,cAAc,GAAGN,iBAAiB,CAAC,CAAC;IAE1CM,cAAc,EAAEO,iBAAiB,CAAED,OAAO,aAAPA,OAAO,cAAPA,OAAO,GAAI,EAAG,CAAC;IAClDT,eAAe,CAAEG,cAAc,EAAEE,iBAAkB,CAAC;EACrD,CAAC;EAED,MAAMM,MAAM,GAAKC,KAAyC,IAAM;IAC/D;IACA;IACA,IACC,CAAEA,KAAK,CAACC,aAAa,IACrB,CAAED,KAAK,CAACE,aAAa,CAACC,QAAQ,CAAEH,KAAK,CAACC,aAAc,CAAC,EACpD;MACDX,YAAY,CAAE,IAAK,CAAC;MAEpB,MAAMC,cAAc,GAAGN,iBAAiB,CAAC,CAAC;;MAE1C;MACA,IAAK,CAAEM,cAAc,EAAEa,QAAQ,CAACC,KAAK,EAAG;QACvC,IAAK,CAAElB,YAAY,EAAG;UACrBC,eAAe,CAAEG,cAAc,EAAEE,iBAAkB,CAAC;QACrD;QACA;MACD;MAEAG,QAAQ,CAAC,CAAC;IACX;EACD,CAAC;EAED,MAAMU,QAAQ,GAAGA,CAAE,GAAGC,IAAe,KAAM;IAC1CzB,QAAQ,CAAC0B,KAAK,CAACF,QAAQ,GAAI,GAAGC,IAAK,CAAC;;IAEpC;IACA;IACA,IAAKlB,SAAS,IAAIF,YAAY,EAAG;MAChCS,QAAQ,CAAC,CAAC;IACX;EACD,CAAC;EAED,MAAMa,SAAS,GAAKT,KAA4C,IAAM;IACrE;IACA;IACA,IAAKA,KAAK,CAACU,GAAG,KAAK,OAAO,EAAG;MAC5Bd,QAAQ,CAAC,CAAC;IACX;EACD,CAAC;EAED;IAAA;IACC;IACA;IACArB,KAAA;MACCoC,SAAS,EAAC,8BAA8B;MACxCC,GAAG,EAAG1B,YAAc;MACpBa,MAAM,EAAGA,MAAQ;MACjBU,SAAS,EAAGvC,mBAAmB,CAAEuC,SAAU,CAAG;MAAA3B,QAAA,GAE5ChB,YAAY,CAAEgB,QAAQ,EAAE;QACzBH,KAAK,EAAED,uBAAuB,CAC7BI,QAAQ,CAAC0B,KAAK,CAAC7B,KAAK,EACpBC,QAAQ,EACRC,gBACD,CAAC;QACDyB,QAAQ;QACR1B;MACD,CAAE,CAAC,eACHH,IAAA;QAAK,aAAU,QAAQ;QAAAK,QAAA,EACpBK,YAAY,iBACbZ,KAAA;UAAGoC,SAAS,EAAC,qCAAqC;UAAA7B,QAAA,gBACjDL,IAAA,CAACN,IAAI;YACJwC,SAAS,EAAC,0CAA0C;YACpDE,IAAI,EAAGhD,KAAO;YACdiD,IAAI,EAAG,EAAI;YACXC,IAAI,EAAC;UAAc,CACnB,CAAC,EACA5B,YAAY;QAAA,CACZ;MACH,CACG,CAAC;IAAA,CACF;EAAC;AAER;AAEA,OAAO,MAAM6B,gBAAgB,GAAGjD,UAAU,CAAEgB,2BAA4B,CAAC","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ export * from './components';
2
+ export * from './control-with-error';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/validated-form-controls/index.ts"],"sourcesContent":["export * from './components';\nexport * from './control-with-error';\n"],"mappings":"AAAA,cAAc,cAAc;AAC5B,cAAc,sBAAsB","ignoreList":[]}