@canonical/react-ds-global-form 0.47.0 → 0.49.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 (439) hide show
  1. package/README.md +5 -6
  2. package/dist/esm/density.css +40 -79
  3. package/dist/esm/index.css +39 -22
  4. package/dist/esm/lib/{component → _work_in_progress/component}/ColorField/ColorField.js +2 -2
  5. package/dist/esm/lib/_work_in_progress/component/ColorField/ColorField.js.map +1 -0
  6. package/dist/esm/lib/_work_in_progress/component/ColorField/index.js.map +1 -0
  7. package/dist/esm/lib/_work_in_progress/component/ColorField/types.js.map +1 -0
  8. package/dist/esm/lib/{component → _work_in_progress/component}/ComboboxField/ComboboxField.js +2 -2
  9. package/dist/esm/lib/_work_in_progress/component/ComboboxField/ComboboxField.js.map +1 -0
  10. package/dist/esm/lib/_work_in_progress/component/ComboboxField/index.js.map +1 -0
  11. package/dist/esm/lib/_work_in_progress/component/ComboboxField/types.js.map +1 -0
  12. package/dist/esm/lib/{component → _work_in_progress/component}/RatingField/RatingField.js +2 -2
  13. package/dist/esm/lib/_work_in_progress/component/RatingField/RatingField.js.map +1 -0
  14. package/dist/esm/lib/_work_in_progress/component/RatingField/index.js.map +1 -0
  15. package/dist/esm/lib/_work_in_progress/component/RatingField/types.js.map +1 -0
  16. package/dist/esm/lib/_work_in_progress/subcomponent/ColorInput/ColorInput.js.map +1 -0
  17. package/dist/esm/lib/_work_in_progress/subcomponent/ColorInput/index.js.map +1 -0
  18. package/dist/esm/lib/_work_in_progress/subcomponent/ColorInput/types.js.map +1 -0
  19. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/ComboboxInput.js.map +1 -0
  20. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/MultipleCombobox.js +199 -0
  21. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/MultipleCombobox.js.map +1 -0
  22. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/SingleCombobox.js +120 -0
  23. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/SingleCombobox.js.map +1 -0
  24. package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/List/List.js +16 -4
  25. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/common/List/List.js.map +1 -0
  26. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/common/List/index.js.map +1 -0
  27. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/common/List/types.js.map +1 -0
  28. package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/ResetButton/ResetButton.js +3 -3
  29. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/common/ResetButton/ResetButton.js.map +1 -0
  30. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/common/ResetButton/index.js.map +1 -0
  31. package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/ResetButton/styles.css +3 -0
  32. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/common/ResetButton/types.js.map +1 -0
  33. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/common/index.js.map +1 -0
  34. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/constants.js.map +1 -0
  35. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/index.js.map +1 -0
  36. package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/messages.js +1 -0
  37. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/messages.js.map +1 -0
  38. package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/styles.css +1 -2
  39. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/types.js.map +1 -0
  40. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/utils/convertItemToString.js.map +1 -0
  41. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/utils/convertValueToItem.js.map +1 -0
  42. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/utils/filterItems.js.map +1 -0
  43. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/utils/index.js +7 -0
  44. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/utils/index.js.map +1 -0
  45. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/utils/isPromise.js +6 -0
  46. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/utils/isPromise.js.map +1 -0
  47. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/utils/settleLookup.js +10 -0
  48. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/utils/settleLookup.js.map +1 -0
  49. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/utils/stopPageMovesAtEnds.js +25 -0
  50. package/dist/esm/lib/_work_in_progress/subcomponent/ComboboxInput/utils/stopPageMovesAtEnds.js.map +1 -0
  51. package/dist/esm/lib/_work_in_progress/subcomponent/RatingInput/RatingInput.js.map +1 -0
  52. package/dist/esm/lib/_work_in_progress/subcomponent/RatingInput/index.js.map +1 -0
  53. package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/RatingInput/styles.css +7 -7
  54. package/dist/esm/lib/_work_in_progress/subcomponent/RatingInput/types.js.map +1 -0
  55. package/dist/esm/lib/common/Wrapper/InvisibleWrapper.js +3 -1
  56. package/dist/esm/lib/common/Wrapper/InvisibleWrapper.js.map +1 -1
  57. package/dist/esm/lib/common/Wrapper/ToggleWrapper.css +0 -6
  58. package/dist/esm/lib/common/Wrapper/ToggleWrapper.js +2 -1
  59. package/dist/esm/lib/common/Wrapper/ToggleWrapper.js.map +1 -1
  60. package/dist/esm/lib/common/Wrapper/Wrapper.js +10 -6
  61. package/dist/esm/lib/common/Wrapper/Wrapper.js.map +1 -1
  62. package/dist/esm/lib/common/Wrapper/createMiddleware.js +70 -0
  63. package/dist/esm/lib/common/Wrapper/createMiddleware.js.map +1 -0
  64. package/dist/esm/lib/common/Wrapper/hooks/useFieldWrapper.js +2 -2
  65. package/dist/esm/lib/common/Wrapper/hooks/useFieldWrapper.js.map +1 -1
  66. package/dist/esm/lib/common/Wrapper/withConditionalDisplay.js +17 -12
  67. package/dist/esm/lib/common/Wrapper/withConditionalDisplay.js.map +1 -1
  68. package/dist/esm/lib/common/Wrapper/withWrapper.js +16 -10
  69. package/dist/esm/lib/common/Wrapper/withWrapper.js.map +1 -1
  70. package/dist/esm/lib/component/ChoicesField/Choices.js +2 -2
  71. package/dist/esm/lib/component/ChoicesField/Choices.js.map +1 -1
  72. package/dist/esm/lib/component/ChoicesField/ChoicesField.js +3 -2
  73. package/dist/esm/lib/component/ChoicesField/ChoicesField.js.map +1 -1
  74. package/dist/esm/lib/component/ChoicesField/styles.css +3 -65
  75. package/dist/esm/lib/component/DateTimeField/DateTimeField.js +2 -1
  76. package/dist/esm/lib/component/DateTimeField/DateTimeField.js.map +1 -1
  77. package/dist/esm/lib/component/FileUploadField/FileUploadField.js +45 -41
  78. package/dist/esm/lib/component/FileUploadField/FileUploadField.js.map +1 -1
  79. package/dist/esm/lib/component/FileUploadField/fileUploadRules.js +39 -0
  80. package/dist/esm/lib/component/FileUploadField/fileUploadRules.js.map +1 -0
  81. package/dist/esm/lib/component/FileUploadField/styles.css +30 -0
  82. package/dist/esm/lib/component/RichChoicesField/RichChoices.js +2 -2
  83. package/dist/esm/lib/component/RichChoicesField/RichChoices.js.map +1 -1
  84. package/dist/esm/lib/component/RichChoicesField/RichChoicesField.js +2 -2
  85. package/dist/esm/lib/component/index.js +5 -4
  86. package/dist/esm/lib/component/index.js.map +1 -1
  87. package/dist/esm/lib/index.js.map +1 -1
  88. package/dist/esm/lib/pattern/Field/Field.js +3 -3
  89. package/dist/esm/lib/pattern/Field/Field.js.map +1 -1
  90. package/dist/esm/lib/subcomponent/DateInput/styles.css +16 -0
  91. package/dist/esm/lib/subcomponent/DateTimeInput/styles.css +24 -7
  92. package/dist/esm/lib/subcomponent/Field/Description/Description.js +1 -3
  93. package/dist/esm/lib/subcomponent/Field/Description/Description.js.map +1 -1
  94. package/dist/esm/lib/subcomponent/Field/Description/styles.css +4 -0
  95. package/dist/esm/lib/subcomponent/Field/Error/Error.js +4 -4
  96. package/dist/esm/lib/subcomponent/Field/Error/Error.js.map +1 -1
  97. package/dist/esm/lib/subcomponent/Field/Error/styles.css +8 -0
  98. package/dist/esm/lib/subcomponent/Field/Label/styles.css +1 -0
  99. package/dist/esm/lib/subcomponent/FileUploadInput/FileUploadInput.js +119 -64
  100. package/dist/esm/lib/subcomponent/FileUploadInput/FileUploadInput.js.map +1 -1
  101. package/dist/esm/lib/subcomponent/FileUploadInput/common/FileItem/FileItem.js +52 -0
  102. package/dist/esm/lib/subcomponent/FileUploadInput/common/FileItem/FileItem.js.map +1 -0
  103. package/dist/esm/lib/subcomponent/FileUploadInput/common/FileItem/index.js +2 -0
  104. package/dist/esm/lib/subcomponent/FileUploadInput/common/FileItem/index.js.map +1 -0
  105. package/dist/esm/lib/subcomponent/FileUploadInput/common/FileItem/types.js +2 -0
  106. package/dist/esm/lib/subcomponent/FileUploadInput/common/FileItem/types.js.map +1 -0
  107. package/dist/esm/lib/subcomponent/FileUploadInput/common/Thumbnail/Thumbnail.js +40 -0
  108. package/dist/esm/lib/subcomponent/FileUploadInput/common/Thumbnail/Thumbnail.js.map +1 -0
  109. package/dist/esm/lib/subcomponent/FileUploadInput/common/Thumbnail/index.js +2 -0
  110. package/dist/esm/lib/subcomponent/FileUploadInput/common/Thumbnail/index.js.map +1 -0
  111. package/dist/esm/lib/subcomponent/FileUploadInput/common/Thumbnail/types.js +2 -0
  112. package/dist/esm/lib/subcomponent/FileUploadInput/common/Thumbnail/types.js.map +1 -0
  113. package/dist/esm/lib/subcomponent/FileUploadInput/constants.js +3 -0
  114. package/dist/esm/lib/subcomponent/FileUploadInput/constants.js.map +1 -0
  115. package/dist/esm/lib/subcomponent/FileUploadInput/hooks/index.js +3 -0
  116. package/dist/esm/lib/subcomponent/FileUploadInput/hooks/index.js.map +1 -0
  117. package/dist/esm/lib/subcomponent/FileUploadInput/hooks/useFileUploads.js +148 -0
  118. package/dist/esm/lib/subcomponent/FileUploadInput/hooks/useFileUploads.js.map +1 -0
  119. package/dist/esm/lib/subcomponent/FileUploadInput/hooks/useObjectUrl.js +22 -0
  120. package/dist/esm/lib/subcomponent/FileUploadInput/hooks/useObjectUrl.js.map +1 -0
  121. package/dist/esm/lib/subcomponent/FileUploadInput/messages.js +25 -0
  122. package/dist/esm/lib/subcomponent/FileUploadInput/messages.js.map +1 -0
  123. package/dist/esm/lib/subcomponent/FileUploadInput/styles.css +255 -94
  124. package/dist/esm/lib/subcomponent/FileUploadInput/utils/formatFileSize.js +21 -0
  125. package/dist/esm/lib/subcomponent/FileUploadInput/utils/formatFileSize.js.map +1 -0
  126. package/dist/esm/lib/subcomponent/FileUploadInput/utils/getFileMessage.js +20 -0
  127. package/dist/esm/lib/subcomponent/FileUploadInput/utils/getFileMessage.js.map +1 -0
  128. package/dist/esm/lib/subcomponent/FileUploadInput/utils/index.js +4 -0
  129. package/dist/esm/lib/subcomponent/FileUploadInput/utils/index.js.map +1 -0
  130. package/dist/esm/lib/subcomponent/FileUploadInput/utils/matchesAccept.js +26 -0
  131. package/dist/esm/lib/subcomponent/FileUploadInput/utils/matchesAccept.js.map +1 -0
  132. package/dist/esm/lib/subcomponent/NumberInput/NumberInput.js +1 -1
  133. package/dist/esm/lib/subcomponent/NumberInput/NumberInput.js.map +1 -1
  134. package/dist/esm/lib/subcomponent/NumberInput/styles.css +17 -0
  135. package/dist/esm/lib/subcomponent/PasswordInput/styles.css +7 -1
  136. package/dist/esm/lib/subcomponent/PhoneInput/PhoneInput.js +8 -2
  137. package/dist/esm/lib/subcomponent/PhoneInput/PhoneInput.js.map +1 -1
  138. package/dist/esm/lib/subcomponent/RadioInput/styles.css +15 -13
  139. package/dist/esm/lib/subcomponent/SelectInput/SelectInput.js +3 -2
  140. package/dist/esm/lib/subcomponent/SelectInput/SelectInput.js.map +1 -1
  141. package/dist/esm/lib/subcomponent/SelectInput/styles.css +39 -48
  142. package/dist/esm/lib/subcomponent/TextInput/TextInput.js +3 -1
  143. package/dist/esm/lib/subcomponent/TextInput/TextInput.js.map +1 -1
  144. package/dist/esm/lib/subcomponent/index.js +5 -5
  145. package/dist/esm/lib/subcomponent/index.js.map +1 -1
  146. package/dist/esm/lib/utils/hooks/useFieldAriaProperties.js +6 -4
  147. package/dist/esm/lib/utils/hooks/useFieldAriaProperties.js.map +1 -1
  148. package/dist/esm/lib/utils/hooks/useOptionAriaProperties.js +3 -3
  149. package/dist/esm/lib/utils/hooks/useOptionAriaProperties.js.map +1 -1
  150. package/dist/esm/lib/utils/middleware/addRESTOptions.js +99 -39
  151. package/dist/esm/lib/utils/middleware/addRESTOptions.js.map +1 -1
  152. package/dist/esm/lib/utils/middleware/addRESTValidation.js +246 -32
  153. package/dist/esm/lib/utils/middleware/addRESTValidation.js.map +1 -1
  154. package/dist/esm/lib/utils/middleware/index.js +1 -0
  155. package/dist/esm/lib/utils/middleware/index.js.map +1 -1
  156. package/dist/esm/testing/expectNoAxeViolations.js +30 -0
  157. package/dist/esm/testing/expectNoAxeViolations.js.map +1 -0
  158. package/dist/types/lib/{component → _work_in_progress/component}/ColorField/ColorField.d.ts +7 -12
  159. package/dist/types/lib/_work_in_progress/component/ColorField/ColorField.d.ts.map +1 -0
  160. package/dist/types/lib/_work_in_progress/component/ColorField/index.d.ts.map +1 -0
  161. package/dist/types/lib/{component → _work_in_progress/component}/ColorField/types.d.ts +1 -1
  162. package/dist/types/lib/_work_in_progress/component/ColorField/types.d.ts.map +1 -0
  163. package/dist/types/lib/_work_in_progress/component/ComboboxField/ComboboxField.d.ts +53 -0
  164. package/dist/types/lib/_work_in_progress/component/ComboboxField/ComboboxField.d.ts.map +1 -0
  165. package/dist/types/lib/_work_in_progress/component/ComboboxField/index.d.ts.map +1 -0
  166. package/dist/types/lib/{component → _work_in_progress/component}/ComboboxField/types.d.ts +1 -1
  167. package/dist/types/lib/_work_in_progress/component/ComboboxField/types.d.ts.map +1 -0
  168. package/dist/types/lib/{component → _work_in_progress/component}/RatingField/RatingField.d.ts +7 -12
  169. package/dist/types/lib/_work_in_progress/component/RatingField/RatingField.d.ts.map +1 -0
  170. package/dist/types/lib/_work_in_progress/component/RatingField/index.d.ts.map +1 -0
  171. package/dist/types/lib/{component → _work_in_progress/component}/RatingField/types.d.ts +1 -1
  172. package/dist/types/lib/_work_in_progress/component/RatingField/types.d.ts.map +1 -0
  173. package/dist/types/lib/_work_in_progress/subcomponent/ColorInput/ColorInput.d.ts.map +1 -0
  174. package/dist/types/lib/_work_in_progress/subcomponent/ColorInput/index.d.ts.map +1 -0
  175. package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ColorInput/types.d.ts +1 -1
  176. package/dist/types/lib/_work_in_progress/subcomponent/ColorInput/types.d.ts.map +1 -0
  177. package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/ComboboxInput.d.ts +13 -5
  178. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/ComboboxInput.d.ts.map +1 -0
  179. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/MultipleCombobox.d.ts +24 -0
  180. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/MultipleCombobox.d.ts.map +1 -0
  181. package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/SingleCombobox.d.ts +19 -4
  182. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/SingleCombobox.d.ts.map +1 -0
  183. package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/List/List.d.ts +1 -1
  184. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/common/List/List.d.ts.map +1 -0
  185. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/common/List/index.d.ts.map +1 -0
  186. package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/List/types.d.ts +2 -1
  187. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/common/List/types.d.ts.map +1 -0
  188. package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/ResetButton/ResetButton.d.ts +1 -1
  189. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/common/ResetButton/ResetButton.d.ts.map +1 -0
  190. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/common/ResetButton/index.d.ts.map +1 -0
  191. package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/ResetButton/types.d.ts +1 -0
  192. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/common/ResetButton/types.d.ts.map +1 -0
  193. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/common/index.d.ts.map +1 -0
  194. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/constants.d.ts.map +1 -0
  195. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/index.d.ts.map +1 -0
  196. package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/messages.d.ts +1 -0
  197. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/messages.d.ts.map +1 -0
  198. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/types.d.ts +52 -0
  199. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/types.d.ts.map +1 -0
  200. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/convertItemToString.d.ts +4 -0
  201. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/convertItemToString.d.ts.map +1 -0
  202. package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/utils/convertValueToItem.d.ts +1 -1
  203. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/convertValueToItem.d.ts.map +1 -0
  204. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/filterItems.d.ts +4 -0
  205. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/filterItems.d.ts.map +1 -0
  206. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/index.d.ts +7 -0
  207. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/index.d.ts.map +1 -0
  208. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/isPromise.d.ts +4 -0
  209. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/isPromise.d.ts.map +1 -0
  210. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/settleLookup.d.ts +8 -0
  211. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/settleLookup.d.ts.map +1 -0
  212. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/stopPageMovesAtEnds.d.ts +13 -0
  213. package/dist/types/lib/_work_in_progress/subcomponent/ComboboxInput/utils/stopPageMovesAtEnds.d.ts.map +1 -0
  214. package/dist/types/lib/_work_in_progress/subcomponent/RatingInput/RatingInput.d.ts.map +1 -0
  215. package/dist/types/lib/_work_in_progress/subcomponent/RatingInput/index.d.ts.map +1 -0
  216. package/dist/types/lib/_work_in_progress/subcomponent/RatingInput/types.d.ts.map +1 -0
  217. package/dist/types/lib/common/Wrapper/InvisibleWrapper.d.ts.map +1 -1
  218. package/dist/types/lib/common/Wrapper/ToggleWrapper.d.ts.map +1 -1
  219. package/dist/types/lib/common/Wrapper/Wrapper.d.ts +1 -1
  220. package/dist/types/lib/common/Wrapper/Wrapper.d.ts.map +1 -1
  221. package/dist/types/lib/common/Wrapper/createMiddleware.d.ts +43 -0
  222. package/dist/types/lib/common/Wrapper/createMiddleware.d.ts.map +1 -0
  223. package/dist/types/lib/common/Wrapper/hooks/useFieldWrapper.d.ts +2 -0
  224. package/dist/types/lib/common/Wrapper/hooks/useFieldWrapper.d.ts.map +1 -1
  225. package/dist/types/lib/common/Wrapper/withConditionalDisplay.d.ts +9 -3
  226. package/dist/types/lib/common/Wrapper/withConditionalDisplay.d.ts.map +1 -1
  227. package/dist/types/lib/common/Wrapper/withWrapper.d.ts +3 -5
  228. package/dist/types/lib/common/Wrapper/withWrapper.d.ts.map +1 -1
  229. package/dist/types/lib/common/types.d.ts +19 -7
  230. package/dist/types/lib/common/types.d.ts.map +1 -1
  231. package/dist/types/lib/component/ChoicesField/Choices.d.ts +1 -1
  232. package/dist/types/lib/component/ChoicesField/Choices.d.ts.map +1 -1
  233. package/dist/types/lib/component/ChoicesField/ChoicesField.d.ts +9 -13
  234. package/dist/types/lib/component/ChoicesField/ChoicesField.d.ts.map +1 -1
  235. package/dist/types/lib/component/ChoicesField/types.d.ts +2 -2
  236. package/dist/types/lib/component/ChoicesField/types.d.ts.map +1 -1
  237. package/dist/types/lib/component/DateField/DateField.d.ts +6 -11
  238. package/dist/types/lib/component/DateTimeField/DateTimeField.d.ts +7 -11
  239. package/dist/types/lib/component/DateTimeField/DateTimeField.d.ts.map +1 -1
  240. package/dist/types/lib/component/FileUploadField/FileUploadField.d.ts +299 -19
  241. package/dist/types/lib/component/FileUploadField/FileUploadField.d.ts.map +1 -1
  242. package/dist/types/lib/component/FileUploadField/fileUploadRules.d.ts +24 -0
  243. package/dist/types/lib/component/FileUploadField/fileUploadRules.d.ts.map +1 -0
  244. package/dist/types/lib/component/HiddenField/HiddenField.d.ts +6 -11
  245. package/dist/types/lib/component/NumberField/NumberField.d.ts +6 -11
  246. package/dist/types/lib/component/PasswordField/PasswordField.d.ts +6 -11
  247. package/dist/types/lib/component/PhoneField/PhoneField.d.ts +7 -11
  248. package/dist/types/lib/component/RangeField/RangeField.d.ts +6 -11
  249. package/dist/types/lib/component/RichChoicesField/RichChoices.d.ts +1 -1
  250. package/dist/types/lib/component/RichChoicesField/RichChoices.d.ts.map +1 -1
  251. package/dist/types/lib/component/RichChoicesField/RichChoicesField.d.ts +8 -13
  252. package/dist/types/lib/component/RichChoicesField/types.d.ts +2 -2
  253. package/dist/types/lib/component/RichChoicesField/types.d.ts.map +1 -1
  254. package/dist/types/lib/component/SelectField/SelectField.d.ts +6 -11
  255. package/dist/types/lib/component/TextField/TextField.d.ts +6 -11
  256. package/dist/types/lib/component/TextareaField/TextareaField.d.ts +6 -11
  257. package/dist/types/lib/component/TimeField/TimeField.d.ts +6 -11
  258. package/dist/types/lib/component/index.d.ts +3 -3
  259. package/dist/types/lib/component/index.d.ts.map +1 -1
  260. package/dist/types/lib/index.d.ts +1 -1
  261. package/dist/types/lib/index.d.ts.map +1 -1
  262. package/dist/types/lib/pattern/Field/types.d.ts +4 -4
  263. package/dist/types/lib/pattern/Field/types.d.ts.map +1 -1
  264. package/dist/types/lib/subcomponent/Field/Description/Description.d.ts.map +1 -1
  265. package/dist/types/lib/subcomponent/Field/Error/Error.d.ts.map +1 -1
  266. package/dist/types/lib/subcomponent/FileUploadInput/FileUploadInput.d.ts +25 -4
  267. package/dist/types/lib/subcomponent/FileUploadInput/FileUploadInput.d.ts.map +1 -1
  268. package/dist/types/lib/subcomponent/FileUploadInput/common/FileItem/FileItem.d.ts +15 -0
  269. package/dist/types/lib/subcomponent/FileUploadInput/common/FileItem/FileItem.d.ts.map +1 -0
  270. package/dist/types/lib/subcomponent/FileUploadInput/common/FileItem/index.d.ts +3 -0
  271. package/dist/types/lib/subcomponent/FileUploadInput/common/FileItem/index.d.ts.map +1 -0
  272. package/dist/types/lib/subcomponent/FileUploadInput/common/FileItem/types.d.ts +28 -0
  273. package/dist/types/lib/subcomponent/FileUploadInput/common/FileItem/types.d.ts.map +1 -0
  274. package/dist/types/lib/subcomponent/FileUploadInput/common/Thumbnail/Thumbnail.d.ts +14 -0
  275. package/dist/types/lib/subcomponent/FileUploadInput/common/Thumbnail/Thumbnail.d.ts.map +1 -0
  276. package/dist/types/lib/subcomponent/FileUploadInput/common/Thumbnail/index.d.ts +3 -0
  277. package/dist/types/lib/subcomponent/FileUploadInput/common/Thumbnail/index.d.ts.map +1 -0
  278. package/dist/types/lib/subcomponent/FileUploadInput/common/Thumbnail/types.d.ts +9 -0
  279. package/dist/types/lib/subcomponent/FileUploadInput/common/Thumbnail/types.d.ts.map +1 -0
  280. package/dist/types/lib/subcomponent/FileUploadInput/constants.d.ts +3 -0
  281. package/dist/types/lib/subcomponent/FileUploadInput/constants.d.ts.map +1 -0
  282. package/dist/types/lib/subcomponent/FileUploadInput/hooks/index.d.ts +3 -0
  283. package/dist/types/lib/subcomponent/FileUploadInput/hooks/index.d.ts.map +1 -0
  284. package/dist/types/lib/subcomponent/FileUploadInput/hooks/useFileUploads.d.ts +33 -0
  285. package/dist/types/lib/subcomponent/FileUploadInput/hooks/useFileUploads.d.ts.map +1 -0
  286. package/dist/types/lib/subcomponent/FileUploadInput/hooks/useObjectUrl.d.ts +8 -0
  287. package/dist/types/lib/subcomponent/FileUploadInput/hooks/useObjectUrl.d.ts.map +1 -0
  288. package/dist/types/lib/subcomponent/FileUploadInput/index.d.ts +1 -1
  289. package/dist/types/lib/subcomponent/FileUploadInput/index.d.ts.map +1 -1
  290. package/dist/types/lib/subcomponent/FileUploadInput/messages.d.ts +4 -0
  291. package/dist/types/lib/subcomponent/FileUploadInput/messages.d.ts.map +1 -0
  292. package/dist/types/lib/subcomponent/FileUploadInput/types.d.ts +165 -8
  293. package/dist/types/lib/subcomponent/FileUploadInput/types.d.ts.map +1 -1
  294. package/dist/types/lib/subcomponent/FileUploadInput/utils/formatFileSize.d.ts +7 -0
  295. package/dist/types/lib/subcomponent/FileUploadInput/utils/formatFileSize.d.ts.map +1 -0
  296. package/dist/types/lib/subcomponent/FileUploadInput/utils/getFileMessage.d.ts +14 -0
  297. package/dist/types/lib/subcomponent/FileUploadInput/utils/getFileMessage.d.ts.map +1 -0
  298. package/dist/types/lib/subcomponent/FileUploadInput/utils/index.d.ts +5 -0
  299. package/dist/types/lib/subcomponent/FileUploadInput/utils/index.d.ts.map +1 -0
  300. package/dist/types/lib/subcomponent/FileUploadInput/utils/matchesAccept.d.ts +10 -0
  301. package/dist/types/lib/subcomponent/FileUploadInput/utils/matchesAccept.d.ts.map +1 -0
  302. package/dist/types/lib/subcomponent/PhoneInput/PhoneInput.d.ts +12 -0
  303. package/dist/types/lib/subcomponent/PhoneInput/PhoneInput.d.ts.map +1 -1
  304. package/dist/types/lib/subcomponent/PhoneInput/types.d.ts +11 -2
  305. package/dist/types/lib/subcomponent/PhoneInput/types.d.ts.map +1 -1
  306. package/dist/types/lib/subcomponent/SelectInput/SelectInput.d.ts.map +1 -1
  307. package/dist/types/lib/subcomponent/TextInput/TextInput.d.ts +2 -0
  308. package/dist/types/lib/subcomponent/TextInput/TextInput.d.ts.map +1 -1
  309. package/dist/types/lib/subcomponent/index.d.ts +7 -7
  310. package/dist/types/lib/subcomponent/index.d.ts.map +1 -1
  311. package/dist/types/lib/subcomponent/types.d.ts +6 -0
  312. package/dist/types/lib/subcomponent/types.d.ts.map +1 -1
  313. package/dist/types/lib/utils/hooks/useFieldAriaProperties.d.ts +2 -1
  314. package/dist/types/lib/utils/hooks/useFieldAriaProperties.d.ts.map +1 -1
  315. package/dist/types/lib/utils/hooks/useOptionAriaProperties.d.ts +3 -2
  316. package/dist/types/lib/utils/hooks/useOptionAriaProperties.d.ts.map +1 -1
  317. package/dist/types/lib/utils/middleware/addRESTOptions.d.ts +37 -4
  318. package/dist/types/lib/utils/middleware/addRESTOptions.d.ts.map +1 -1
  319. package/dist/types/lib/utils/middleware/addRESTValidation.d.ts +38 -3
  320. package/dist/types/lib/utils/middleware/addRESTValidation.d.ts.map +1 -1
  321. package/dist/types/lib/utils/middleware/index.d.ts +2 -0
  322. package/dist/types/lib/utils/middleware/index.d.ts.map +1 -1
  323. package/dist/types/testing/expectNoAxeViolations.d.ts +10 -0
  324. package/dist/types/testing/expectNoAxeViolations.d.ts.map +1 -0
  325. package/package.json +21 -18
  326. package/dist/esm/lib/component/ColorField/ColorField.js.map +0 -1
  327. package/dist/esm/lib/component/ColorField/index.js.map +0 -1
  328. package/dist/esm/lib/component/ColorField/types.js.map +0 -1
  329. package/dist/esm/lib/component/ComboboxField/ComboboxField.js.map +0 -1
  330. package/dist/esm/lib/component/ComboboxField/index.js.map +0 -1
  331. package/dist/esm/lib/component/ComboboxField/types.js.map +0 -1
  332. package/dist/esm/lib/component/RatingField/RatingField.js.map +0 -1
  333. package/dist/esm/lib/component/RatingField/index.js.map +0 -1
  334. package/dist/esm/lib/component/RatingField/types.js.map +0 -1
  335. package/dist/esm/lib/subcomponent/ColorInput/ColorInput.js.map +0 -1
  336. package/dist/esm/lib/subcomponent/ColorInput/index.js.map +0 -1
  337. package/dist/esm/lib/subcomponent/ColorInput/types.js.map +0 -1
  338. package/dist/esm/lib/subcomponent/ComboboxInput/ComboboxInput.js.map +0 -1
  339. package/dist/esm/lib/subcomponent/ComboboxInput/MultipleCombobox.js +0 -84
  340. package/dist/esm/lib/subcomponent/ComboboxInput/MultipleCombobox.js.map +0 -1
  341. package/dist/esm/lib/subcomponent/ComboboxInput/SingleCombobox.js +0 -67
  342. package/dist/esm/lib/subcomponent/ComboboxInput/SingleCombobox.js.map +0 -1
  343. package/dist/esm/lib/subcomponent/ComboboxInput/common/List/List.js.map +0 -1
  344. package/dist/esm/lib/subcomponent/ComboboxInput/common/List/index.js.map +0 -1
  345. package/dist/esm/lib/subcomponent/ComboboxInput/common/List/types.js.map +0 -1
  346. package/dist/esm/lib/subcomponent/ComboboxInput/common/ResetButton/ResetButton.js.map +0 -1
  347. package/dist/esm/lib/subcomponent/ComboboxInput/common/ResetButton/index.js.map +0 -1
  348. package/dist/esm/lib/subcomponent/ComboboxInput/common/ResetButton/types.js.map +0 -1
  349. package/dist/esm/lib/subcomponent/ComboboxInput/common/index.js.map +0 -1
  350. package/dist/esm/lib/subcomponent/ComboboxInput/constants.js.map +0 -1
  351. package/dist/esm/lib/subcomponent/ComboboxInput/index.js.map +0 -1
  352. package/dist/esm/lib/subcomponent/ComboboxInput/messages.js.map +0 -1
  353. package/dist/esm/lib/subcomponent/ComboboxInput/types.js.map +0 -1
  354. package/dist/esm/lib/subcomponent/ComboboxInput/utils/convertItemToString.js.map +0 -1
  355. package/dist/esm/lib/subcomponent/ComboboxInput/utils/convertValueToItem.js.map +0 -1
  356. package/dist/esm/lib/subcomponent/ComboboxInput/utils/filterItems.js.map +0 -1
  357. package/dist/esm/lib/subcomponent/ComboboxInput/utils/index.js +0 -4
  358. package/dist/esm/lib/subcomponent/ComboboxInput/utils/index.js.map +0 -1
  359. package/dist/esm/lib/subcomponent/RatingInput/RatingInput.js.map +0 -1
  360. package/dist/esm/lib/subcomponent/RatingInput/index.js.map +0 -1
  361. package/dist/esm/lib/subcomponent/RatingInput/types.js.map +0 -1
  362. package/dist/types/lib/component/ColorField/ColorField.d.ts.map +0 -1
  363. package/dist/types/lib/component/ColorField/index.d.ts.map +0 -1
  364. package/dist/types/lib/component/ColorField/types.d.ts.map +0 -1
  365. package/dist/types/lib/component/ComboboxField/ComboboxField.d.ts +0 -56
  366. package/dist/types/lib/component/ComboboxField/ComboboxField.d.ts.map +0 -1
  367. package/dist/types/lib/component/ComboboxField/index.d.ts.map +0 -1
  368. package/dist/types/lib/component/ComboboxField/types.d.ts.map +0 -1
  369. package/dist/types/lib/component/RatingField/RatingField.d.ts.map +0 -1
  370. package/dist/types/lib/component/RatingField/index.d.ts.map +0 -1
  371. package/dist/types/lib/component/RatingField/types.d.ts.map +0 -1
  372. package/dist/types/lib/subcomponent/ColorInput/ColorInput.d.ts.map +0 -1
  373. package/dist/types/lib/subcomponent/ColorInput/index.d.ts.map +0 -1
  374. package/dist/types/lib/subcomponent/ColorInput/types.d.ts.map +0 -1
  375. package/dist/types/lib/subcomponent/ComboboxInput/ComboboxInput.d.ts.map +0 -1
  376. package/dist/types/lib/subcomponent/ComboboxInput/MultipleCombobox.d.ts +0 -16
  377. package/dist/types/lib/subcomponent/ComboboxInput/MultipleCombobox.d.ts.map +0 -1
  378. package/dist/types/lib/subcomponent/ComboboxInput/SingleCombobox.d.ts.map +0 -1
  379. package/dist/types/lib/subcomponent/ComboboxInput/common/List/List.d.ts.map +0 -1
  380. package/dist/types/lib/subcomponent/ComboboxInput/common/List/index.d.ts.map +0 -1
  381. package/dist/types/lib/subcomponent/ComboboxInput/common/List/types.d.ts.map +0 -1
  382. package/dist/types/lib/subcomponent/ComboboxInput/common/ResetButton/ResetButton.d.ts.map +0 -1
  383. package/dist/types/lib/subcomponent/ComboboxInput/common/ResetButton/index.d.ts.map +0 -1
  384. package/dist/types/lib/subcomponent/ComboboxInput/common/ResetButton/types.d.ts.map +0 -1
  385. package/dist/types/lib/subcomponent/ComboboxInput/common/index.d.ts.map +0 -1
  386. package/dist/types/lib/subcomponent/ComboboxInput/constants.d.ts.map +0 -1
  387. package/dist/types/lib/subcomponent/ComboboxInput/index.d.ts.map +0 -1
  388. package/dist/types/lib/subcomponent/ComboboxInput/messages.d.ts.map +0 -1
  389. package/dist/types/lib/subcomponent/ComboboxInput/types.d.ts +0 -27
  390. package/dist/types/lib/subcomponent/ComboboxInput/types.d.ts.map +0 -1
  391. package/dist/types/lib/subcomponent/ComboboxInput/utils/convertItemToString.d.ts +0 -4
  392. package/dist/types/lib/subcomponent/ComboboxInput/utils/convertItemToString.d.ts.map +0 -1
  393. package/dist/types/lib/subcomponent/ComboboxInput/utils/convertValueToItem.d.ts.map +0 -1
  394. package/dist/types/lib/subcomponent/ComboboxInput/utils/filterItems.d.ts +0 -4
  395. package/dist/types/lib/subcomponent/ComboboxInput/utils/filterItems.d.ts.map +0 -1
  396. package/dist/types/lib/subcomponent/ComboboxInput/utils/index.d.ts +0 -4
  397. package/dist/types/lib/subcomponent/ComboboxInput/utils/index.d.ts.map +0 -1
  398. package/dist/types/lib/subcomponent/RatingInput/RatingInput.d.ts.map +0 -1
  399. package/dist/types/lib/subcomponent/RatingInput/index.d.ts.map +0 -1
  400. package/dist/types/lib/subcomponent/RatingInput/types.d.ts.map +0 -1
  401. /package/dist/esm/lib/{component → _work_in_progress/component}/ColorField/index.js +0 -0
  402. /package/dist/esm/lib/{component → _work_in_progress/component}/ColorField/types.js +0 -0
  403. /package/dist/esm/lib/{component → _work_in_progress/component}/ComboboxField/index.js +0 -0
  404. /package/dist/esm/lib/{component → _work_in_progress/component}/ComboboxField/types.js +0 -0
  405. /package/dist/esm/lib/{component → _work_in_progress/component}/RatingField/index.js +0 -0
  406. /package/dist/esm/lib/{component → _work_in_progress/component}/RatingField/types.js +0 -0
  407. /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ColorInput/ColorInput.js +0 -0
  408. /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ColorInput/index.js +0 -0
  409. /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ColorInput/styles.css +0 -0
  410. /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ColorInput/types.js +0 -0
  411. /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/ComboboxInput.js +0 -0
  412. /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/List/index.js +0 -0
  413. /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/List/styles.css +0 -0
  414. /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/List/types.js +0 -0
  415. /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/ResetButton/index.js +0 -0
  416. /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/ResetButton/types.js +0 -0
  417. /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/index.js +0 -0
  418. /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/constants.js +0 -0
  419. /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/index.js +0 -0
  420. /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/types.js +0 -0
  421. /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/utils/convertItemToString.js +0 -0
  422. /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/utils/convertValueToItem.js +0 -0
  423. /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/utils/filterItems.js +0 -0
  424. /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/RatingInput/RatingInput.js +0 -0
  425. /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/RatingInput/index.js +0 -0
  426. /package/dist/esm/lib/{subcomponent → _work_in_progress/subcomponent}/RatingInput/types.js +0 -0
  427. /package/dist/types/lib/{component → _work_in_progress/component}/ColorField/index.d.ts +0 -0
  428. /package/dist/types/lib/{component → _work_in_progress/component}/ComboboxField/index.d.ts +0 -0
  429. /package/dist/types/lib/{component → _work_in_progress/component}/RatingField/index.d.ts +0 -0
  430. /package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ColorInput/ColorInput.d.ts +0 -0
  431. /package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ColorInput/index.d.ts +0 -0
  432. /package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/List/index.d.ts +0 -0
  433. /package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/ResetButton/index.d.ts +0 -0
  434. /package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/common/index.d.ts +0 -0
  435. /package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/constants.d.ts +0 -0
  436. /package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/ComboboxInput/index.d.ts +0 -0
  437. /package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/RatingInput/RatingInput.d.ts +0 -0
  438. /package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/RatingInput/index.d.ts +0 -0
  439. /package/dist/types/lib/{subcomponent → _work_in_progress/subcomponent}/RatingInput/types.d.ts +0 -0
@@ -0,0 +1,20 @@
1
+ import matchesAccept from "./matchesAccept.js";
2
+ /**
3
+ * The message for one chosen file: an error when `accept` or `maxSize` rejects
4
+ * it, otherwise whatever `validateFile` returns. The input shows it under the
5
+ * file's tile, and the field turns an error into an invalid field.
6
+ * @note Pure when `validateFile` is.
7
+ */
8
+ export default function getFileMessage(file, { accept, maxSize, validateFile }, messages) {
9
+ if (accept && !matchesAccept(file, accept)) {
10
+ return { level: "error", message: messages.fileTypeNotAccepted(accept) };
11
+ }
12
+ if (typeof maxSize === "number" && file.size > maxSize) {
13
+ return {
14
+ level: "error",
15
+ message: messages.fileTooLarge(messages.fileSize(maxSize)),
16
+ };
17
+ }
18
+ return validateFile?.(file);
19
+ }
20
+ //# sourceMappingURL=getFileMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getFileMessage.js","sourceRoot":"","sources":["../../../../../../src/lib/subcomponent/FileUploadInput/utils/getFileMessage.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAQ/C;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,IAAU,EACV,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAa,EAC5C,QAGC;IAED,IAAI,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC;QAC3C,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAAE,CAAC;IAC3E,CAAC;IACD,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,GAAG,OAAO,EAAE,CAAC;QACvD,OAAO;YACL,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,QAAQ,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;SAC3D,CAAC;IACJ,CAAC;IACD,OAAO,YAAY,EAAE,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { default as formatFileSize } from "./formatFileSize.js";
2
+ export { default as getFileMessage } from "./getFileMessage.js";
3
+ export { default as matchesAccept } from "./matchesAccept.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/lib/subcomponent/FileUploadInput/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Whether a file matches an `accept` list, by the rules of the native
3
+ * `accept` attribute: a `.ext` entry matches the end of the file name, a
4
+ * `type/*` entry matches the start of the MIME type, and any other entry
5
+ * matches the MIME type exactly. Matching ignores case. An empty list accepts
6
+ * every file.
7
+ * @note Pure.
8
+ */
9
+ export default function matchesAccept(file, accept) {
10
+ const entries = accept
11
+ .split(",")
12
+ .map((entry) => entry.trim().toLowerCase())
13
+ .filter(Boolean);
14
+ if (entries.length === 0)
15
+ return true;
16
+ const fileName = file.name.toLowerCase();
17
+ const type = file.type.toLowerCase();
18
+ return entries.some((entry) => {
19
+ if (entry.startsWith("."))
20
+ return fileName.endsWith(entry);
21
+ if (entry.endsWith("/*"))
22
+ return type.startsWith(entry.slice(0, -1));
23
+ return type === entry;
24
+ });
25
+ }
26
+ //# sourceMappingURL=matchesAccept.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matchesAccept.js","sourceRoot":"","sources":["../../../../../../src/lib/subcomponent/FileUploadInput/utils/matchesAccept.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,IAAU,EAAE,MAAc;IAC9D,MAAM,OAAO,GAAG,MAAM;SACnB,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;SAC1C,MAAM,CAAC,OAAO,CAAC,CAAC;IACnB,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IACzC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IACrC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;QAC5B,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,OAAO,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC3D,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACrE,OAAO,IAAI,KAAK,KAAK,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -17,7 +17,7 @@ const componentCssClassName = "ds input number chrome";
17
17
  * @implements ds:global.subcomponent.number_input
18
18
  */
19
19
  export const NumberInput = forwardRef(function NumberInput({ id, className, style, prefix, suffix, ...nativeProps }, ref) {
20
- return (_jsxs("div", { style: style, className: [componentCssClassName, className].filter(Boolean).join(" "), children: [prefix && _jsx("span", { className: "prefix", children: prefix }), _jsx("input", { id: id, className: "p", ref: ref, ...nativeProps, type: "number" }), suffix && _jsx("span", { className: "suffix", children: suffix })] }));
20
+ return (_jsxs("div", { style: style, className: [componentCssClassName, className].filter(Boolean).join(" "), children: [prefix && _jsx("span", { className: "prefix p", children: prefix }), _jsx("input", { id: id, className: "p", ref: ref, ...nativeProps, type: "number" }), suffix && _jsx("span", { className: "suffix p", children: suffix })] }));
21
21
  });
22
22
  export default NumberInput;
23
23
  //# sourceMappingURL=NumberInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NumberInput.js","sourceRoot":"","sources":["../../../../../src/lib/subcomponent/NumberInput/NumberInput.tsx"],"names":[],"mappings":";AAAA,wDAAwD;AAExD,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAEtD,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,wBAAwB,CAAC;AAEvD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CACnC,SAAS,WAAW,CAClB,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,EACxD,GAAG;IAEH,OAAO,CACL,eACE,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,aAEtE,MAAM,IAAI,eAAM,SAAS,EAAC,QAAQ,YAAE,MAAM,GAAQ,EAInD,gBAAO,EAAE,EAAE,EAAE,EAAE,SAAS,EAAC,GAAG,EAAC,GAAG,EAAE,GAAG,KAAM,WAAW,EAAE,IAAI,EAAC,QAAQ,GAAG,EACvE,MAAM,IAAI,eAAM,SAAS,EAAC,QAAQ,YAAE,MAAM,GAAQ,IAC/C,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"NumberInput.js","sourceRoot":"","sources":["../../../../../src/lib/subcomponent/NumberInput/NumberInput.tsx"],"names":[],"mappings":";AAAA,wDAAwD;AAExD,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAEtD,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,wBAAwB,CAAC;AAEvD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CACnC,SAAS,WAAW,CAClB,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,EACxD,GAAG;IAEH,OAAO,CACL,eACE,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,aAEtE,MAAM,IAAI,eAAM,SAAS,EAAC,UAAU,YAAE,MAAM,GAAQ,EAIrD,gBAAO,EAAE,EAAE,EAAE,EAAE,SAAS,EAAC,GAAG,EAAC,GAAG,EAAE,GAAG,KAAM,WAAW,EAAE,IAAI,EAAC,QAAQ,GAAG,EACvE,MAAM,IAAI,eAAM,SAAS,EAAC,UAAU,YAAE,MAAM,GAAQ,IACjD,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -34,4 +34,21 @@
34
34
  user-select: none;
35
35
  }
36
36
  }
37
+
38
+ /* Under a density context the unit text rides the SAME line box as the
39
+ value: the leaf's line-height and seat pads are already declared on the
40
+ wrapper by the composite seat (density.css), so the affixes read them
41
+ here. Their `align-items: center` then lands on the value's optical
42
+ centre — centring on the bare box would float the unit above the seated
43
+ text, because the pad split is asymmetric (seat-before ≠ seat-after).
44
+ Without a context class the unit spans carry `.p`, seated by the baseline
45
+ engine exactly like the input leaf. */
46
+ :is(.comfortable, .dense, .app, .site, .docs)
47
+ .ds.input.number
48
+ > :is(.prefix, .suffix) {
49
+ line-height: var(--seat-line-floored);
50
+ /* Top pad only, exactly like the leaf (its pad-end is 0 too): the affix
51
+ box then equals the leaf box, so it can never grow the wrapper. */
52
+ padding-block: var(--seat-before) 0;
53
+ }
37
54
  }
@@ -32,7 +32,6 @@
32
32
  padding-inline: var(--form-field-inline-gap);
33
33
  border: none;
34
34
  background: transparent;
35
- color: var(--color-icon);
36
35
  cursor: pointer;
37
36
 
38
37
  & > .reveal-icon {
@@ -60,6 +59,13 @@
60
59
  /* No hover colour change: the reveal toggle keeps `--color-icon` in all
61
60
  * pointer states (per design review). */
62
61
 
62
+ /* Disabled field: the icon mask reads `currentColor`, so the disabled
63
+ * icon colour rides on the toggle itself. */
64
+ &:disabled {
65
+ color: var(--form-input-color-disabled);
66
+ cursor: not-allowed;
67
+ }
68
+
63
69
  &:focus-visible {
64
70
  outline: none;
65
71
  box-shadow: 0 0 0 1px var(--color-focus-ring);
@@ -55,13 +55,19 @@ function getCountryLabel(country, display) {
55
55
  *
56
56
  * The forwarded ref reaches the national-number input — the field's focusable
57
57
  * element, and what react-hook-form needs for `setFocus` and focus-on-error.
58
+ * The `id` and the field's ARIA wiring go on that input too, so the field label
59
+ * names it; the country `<select>` keeps its own "Country code" label. Without
60
+ * `aria-labelledby` the number input falls back to a "Phone number" label.
61
+ *
62
+ * With a `name`, both controls post in a plain HTML submission: the number as
63
+ * `<name>` and the selected country code as `<name>-country`.
58
64
  * @returns {React.ReactElement} - Rendered Phone
59
65
  *
60
66
  * `import { PhoneInput } from "@canonical/react-ds-global-form";`
61
67
  *
62
68
  * @implements ds:global.subcomponent.phone_input
63
69
  */
64
- export const PhoneInput = forwardRef(function PhoneInput({ id, className, style, name, value, onChange, onBlur, defaultCountry = "US", preferredCountries = [], filteredCountries, countries = defaultCountries, valueFormat = "e164", countryDisplay = "code", mask = false, disabled = false, }, ref) {
70
+ export const PhoneInput = forwardRef(function PhoneInput({ id, className, style, name, value, onChange, onBlur, defaultCountry = "US", preferredCountries = [], filteredCountries, countries = defaultCountries, valueFormat = "e164", countryDisplay = "code", mask = false, disabled = false, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-errormessage": ariaErrorMessage, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, }, ref) {
65
71
  const [selectedCountry, setSelectedCountry] = useState(() => {
66
72
  if (valueFormat === "structured" && value && typeof value === "object") {
67
73
  return value.countryCode || defaultCountry;
@@ -139,7 +145,7 @@ export const PhoneInput = forwardRef(function PhoneInput({ id, className, style,
139
145
  model: formatter.parse(getCurrentNumber()),
140
146
  onModelChange: (digits) => emitValue(selectedCountry, digits),
141
147
  });
142
- return (_jsxs("div", { id: id, style: style, className: [componentCssClassName, className].filter(Boolean).join(" "), children: [_jsx("select", { className: "country-select p", value: selectedCountry, onChange: handleCountryChange, disabled: disabled, autoComplete: "tel-country-code", "aria-label": "Country code", children: sortedCountries.map((country) => (_jsxs("option", { value: country.code, children: [country.dialCode, " ", getCountryLabel(country, countryDisplay)] }, country.code))) }), _jsx("input", { type: "tel", className: "number-input p", name: name, inputMode: "tel", autoComplete: "tel-national", pattern: ALLOWED_NUMBER_CHARACTERS, title: "Digits, and the spacing characters used by the number's format.", value: number.value, onChange: number.onChange, onCompositionStart: number.onCompositionStart, onCompositionEnd: number.onCompositionEnd, onBlur: onBlur, ref: mergeRefs(number.ref, ref), disabled: disabled, "aria-label": "Phone number" })] }));
148
+ return (_jsxs("div", { style: style, className: [componentCssClassName, className].filter(Boolean).join(" "), children: [_jsx("select", { className: "country-select p", name: name ? `${name}-country` : undefined, value: selectedCountry, onChange: handleCountryChange, disabled: disabled, autoComplete: "tel-country-code", "aria-label": "Country code", children: sortedCountries.map((country) => (_jsxs("option", { value: country.code, children: [country.dialCode, " ", getCountryLabel(country, countryDisplay)] }, country.code))) }), _jsx("input", { id: id, type: "tel", className: "number-input p", name: name, inputMode: "tel", autoComplete: "tel-national", pattern: ALLOWED_NUMBER_CHARACTERS, title: "Digits, and the spacing characters used by the number's format.", value: number.value, onChange: number.onChange, onCompositionStart: number.onCompositionStart, onCompositionEnd: number.onCompositionEnd, onBlur: onBlur, ref: mergeRefs(number.ref, ref), disabled: disabled, "aria-label": ariaLabelledBy ? undefined : "Phone number", "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-errormessage": ariaErrorMessage, "aria-invalid": ariaInvalid, "aria-required": ariaRequired })] }));
143
149
  });
144
150
  export default PhoneInput;
145
151
  //# sourceMappingURL=PhoneInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PhoneInput.js","sourceRoot":"","sources":["../../../../../src/lib/subcomponent/PhoneInput/PhoneInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,EAEL,SAAS,IAAI,gBAAgB,GAE9B,MAAM,gCAAgC,CAAC;AACxC,OAAO,sBAAsB,MAAM,iDAAiD,CAAC;AACrF,OAAO,iBAAiB,MAAM,wCAAwC,CAAC;AACvE,OAAO,SAAS,MAAM,0BAA0B,CAAC;AAEjD,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AAEtD,iFAAiF;AACjF,iFAAiF;AACjF,wEAAwE;AACxE,MAAM,uBAAuB,GAC3B,mDAAmD,CAAC;AAEtD,8EAA8E;AAC9E,iFAAiF;AACjF,wEAAwE;AACxE,0EAA0E;AAC1E,4EAA4E;AAC5E,oDAAoD;AACpD,MAAM,yBAAyB,GAAG,wBAAwB,CAAC;AAE3D;;;;;;GAMG;AACH,SAAS,cAAc,CAAC,IAAY;IAClC,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IACjC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3C,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CACtC,MAAM,CAAC,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAClD,CAAC;AACJ,CAAC;AAED,oEAAoE;AACpE,SAAS,gBAAgB,CAAC,QAAgB;IACxC,OAAO,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAA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,YAExB,eAAe,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAChC,kBAA2B,KAAK,EAAE,OAAO,CAAC,IAAI,aAC3C,OAAO,CAAC,QAAQ,OAAG,eAAe,CAAC,OAAO,EAAE,cAAc,CAAC,KADjD,OAAO,CAAC,IAAI,CAEhB,CACV,CAAC,GACK,EACT,gBACE,EAAE,EAAE,EAAE,EACN,IAAI,EAAC,KAAK,EACV,SAAS,EAAC,gBAAgB,EAC1B,IAAI,EAAE,IAAI,EACV,SAAS,EAAC,KAAK,EACf,YAAY,EAAC,cAAc,EAC3B,OAAO,EAAE,yBAAyB,EAClC,KAAK,EAAC,iEAAiE,EACvE,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,kBAAkB,EAAE,MAAM,CAAC,kBAAkB,EAC7C,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,EACzC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAC/B,QAAQ,EAAE,QAAQ,gBACN,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,qBACtC,cAAc,sBACb,eAAe,uBACd,gBAAgB,kBACrB,WAAW,mBACV,YAAY,GAC3B,IACE,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -24,24 +24,25 @@
24
24
  background-color var(--motion-duration-fast) ease,
25
25
  border-color var(--motion-duration-fast) ease;
26
26
 
27
+ /* Ring fill = selected token, centre dot = unselected token; both
28
+ * surface-provided (flat fallback) so the control adapts to OnSurface
29
+ * stepping. */
27
30
  &:checked {
28
- /* Dot = selected token, ring fill = unselected token; both surface-provided
29
- * (flat fallback) so the control adapts to OnSurface stepping. */
30
31
  border-color: var(
31
32
  --surface-color-foreground-radio-selected,
32
33
  var(--color-foreground-radio-selected)
33
34
  );
34
35
  background: radial-gradient(
35
- var(
36
- --surface-color-foreground-radio-selected,
37
- var(--color-foreground-radio-selected)
38
- )
39
- 40%,
40
36
  var(
41
37
  --surface-color-foreground-radio-unselected,
42
38
  var(--color-foreground-radio-unselected)
43
39
  )
44
- 41%
40
+ 30%,
41
+ var(
42
+ --surface-color-foreground-radio-selected,
43
+ var(--color-foreground-radio-selected)
44
+ )
45
+ 31%
45
46
  );
46
47
  }
47
48
 
@@ -49,18 +50,19 @@
49
50
  background-color: var(--color-foreground-radio-unselected-hover);
50
51
  }
51
52
 
52
- /* Hover on a selected radio shifts only the dot's fill, not via a whole-element
53
- * brightness filter (which would also dim the ring). Re-paint the gradient with
54
- * the hovered selected shade from the `--hover--…-selected` channel. */
53
+ /* Hover on a selected radio shifts only the ring's fill, not via a
54
+ * whole-element brightness filter (which would also dim the dot).
55
+ * Re-paint the gradient with the hovered selected shade from the
56
+ * `--hover--…-selected` channel. */
55
57
  &:checked:hover:not(:disabled) {
56
58
  border-color: var(--hover--color-foreground-radio-selected);
57
59
  background: radial-gradient(
58
- var(--hover--color-foreground-radio-selected) 40%,
59
60
  var(
60
61
  --surface-color-foreground-radio-unselected,
61
62
  var(--color-foreground-radio-unselected)
62
63
  )
63
- 41%
64
+ 30%,
65
+ var(--hover--color-foreground-radio-selected) 31%
64
66
  );
65
67
  }
66
68
 
@@ -1,4 +1,5 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Icon } from "@canonical/react-ds-global";
2
3
  import { forwardRef } from "react";
3
4
  import "./styles.css";
4
5
  const componentCssClassName = "ds input select chrome";
@@ -14,7 +15,7 @@ const componentCssClassName = "ds input select chrome";
14
15
  * @implements ds:global.subcomponent.select_input
15
16
  */
16
17
  export const SelectInput = forwardRef(function SelectInput({ id, className, style, options, ...nativeProps }, ref) {
17
- return (_jsx("select", { id: id, className: [componentCssClassName, className].filter(Boolean).join(" "), style: style, ref: ref, ...nativeProps, children: options.map((option) => (_jsx("option", { value: option.value, disabled: option.disabled, lang: option.lang, children: option.label }, option.value))) }));
18
+ return (_jsxs("div", { style: style, className: [componentCssClassName, className].filter(Boolean).join(" "), children: [_jsx("select", { id: id, className: "p", ref: ref, ...nativeProps, children: options.map((option) => (_jsx("option", { value: option.value, disabled: option.disabled, lang: option.lang, children: option.label }, option.value))) }), !nativeProps.multiple && (_jsx(Icon, { icon: "chevron-down", className: "chevron" }))] }));
18
19
  });
19
20
  export default SelectInput;
20
21
  //# sourceMappingURL=SelectInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectInput.js","sourceRoot":"","sources":["../../../../../src/lib/subcomponent/SelectInput/SelectInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAEtD,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,wBAAwB,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CACnC,SAAS,WAAW,CAClB,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,WAAW,EAAE,EACjD,GAAG;IAEH,OAAO,CACL,iBACE,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EACvE,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,KACJ,WAAW,YAEd,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACvB,iBAEE,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,IAAI,EAAE,MAAM,CAAC,IAAI,YAEhB,MAAM,CAAC,KAAK,IALR,MAAM,CAAC,KAAK,CAMV,CACV,CAAC,GACK,CACV,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"SelectInput.js","sourceRoot":"","sources":["../../../../../src/lib/subcomponent/SelectInput/SelectInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAEtD,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,wBAAwB,CAAC;AAEvD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CACnC,SAAS,WAAW,CAClB,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,WAAW,EAAE,EACjD,GAAG;IAEH,OAAO,CACL,eACE,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,aAIvE,iBAAQ,EAAE,EAAE,EAAE,EAAE,SAAS,EAAC,GAAG,EAAC,GAAG,EAAE,GAAG,KAAM,WAAW,YACpD,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACvB,iBAEE,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,IAAI,EAAE,MAAM,CAAC,IAAI,YAEhB,MAAM,CAAC,KAAK,IALR,MAAM,CAAC,KAAK,CAMV,CACV,CAAC,GACK,EAGR,CAAC,WAAW,CAAC,QAAQ,IAAI,CACxB,KAAC,IAAI,IAAC,IAAI,EAAC,cAAc,EAAC,SAAS,EAAC,SAAS,GAAG,CACjD,IACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,56 +1,47 @@
1
1
  /* Layer: ds.components.global (@canonical/styles README, "Cascade layers"). */
2
2
 
3
3
  @layer ds.components.global {
4
- /* Chevron indicator, painted with CSS gradients so it takes the theme colour.
5
- * A `background-image` SVG cannot be recoloured by CSS (no inheritance into
6
- * the image document), which left the caret black on dark themes — the same
7
- * reason the checkbox/accordion glyphs are masks. A <select> is a replaced
8
- * element with no ::before/::after to mask, so the chevron is drawn instead:
9
- * two diagonally-striped gradient squares butted together form a down-chevron
10
- * STROKE (transparent → colour → transparent along each diagonal), coloured by
11
- * --color-icon like every other control glyph. */
4
+ /* Composite input: the wrapper carries the chrome (`.ds.input.chrome` in
5
+ * index.css paints border, background and height here) and the <select> is
6
+ * the bare text-bearing leaf. A <select> is a replaced element — no
7
+ * ::before/::after, no children — so the chevron-down icon overlays it:
8
+ * leaf and icon stack in one grid area, and the leaf's end padding keeps
9
+ * the option text clear of the glyph. */
12
10
  .ds.input.select {
13
- appearance: none;
14
- --select-caret-color: var(--color-icon, currentColor);
15
- --select-caret-half: 0.4em; /* each square; the chevron is two halves wide */
16
- /* left half: rising stroke ╱ */
17
- background-image:
18
- linear-gradient(
19
- 45deg,
20
- transparent 42%,
21
- var(--select-caret-color) 42%,
22
- var(--select-caret-color) 58%,
23
- transparent 58%
24
- ),
25
- /* right half: falling stroke ╲ */
26
- linear-gradient(
27
- 135deg,
28
- transparent 42%,
29
- var(--select-caret-color) 42%,
30
- var(--select-caret-color) 58%,
31
- transparent 58%
32
- );
33
- background-repeat: no-repeat;
34
- background-position:
35
- right calc(var(--form-input-padding-inline) + var(--select-caret-half))
36
- center,
37
- right var(--form-input-padding-inline) center;
38
- background-size: var(--select-caret-half) var(--select-caret-half);
39
- /* This element IS the text-bearing leaf, so it carries the inline padding
40
- * (`.ds.input.chrome` provides only the block padding). The end side leaves
41
- * room for the chevron. */
42
- padding-inline-start: var(--form-input-padding-inline);
43
- padding-inline-end: calc(var(--form-input-padding-inline) * 2 + 1em);
11
+ direction: inherit;
12
+ display: inline-grid;
13
+ align-items: center;
14
+ grid-template-areas: "select";
15
+ padding: 0;
44
16
 
45
- /* The padding above is logical, so in right-to-left text the room for
46
- the chevron opens on the left; `background-position` has no logical
47
- keywords, so the chevron moves there explicitly. Mirrored, the two
48
- gradient squares swap halves: the 45deg square is the outer one. */
49
- &:dir(rtl) {
50
- background-position:
51
- left var(--form-input-padding-inline) center,
52
- left calc(var(--form-input-padding-inline) + var(--select-caret-half))
53
- center;
17
+ & > * {
18
+ grid-area: select;
19
+ }
20
+
21
+ & > select {
22
+ appearance: none;
23
+ box-sizing: border-box;
24
+ border: none;
25
+ background: transparent;
26
+ color: inherit;
27
+ font-family: inherit;
28
+ outline: none;
29
+ /* Baseline engine provides font-size, line-height, padding-block via
30
+ * the `.p` class; the leaf carries the inline padding (`.ds.input.chrome`
31
+ * provides only the block padding, and the wrapper zeroes it). The end
32
+ * side leaves room for the chevron overlay. */
33
+ padding-inline-start: var(--form-input-padding-inline);
34
+ padding-inline-end: calc(var(--form-input-padding-inline) * 2 + 1em);
35
+ }
36
+
37
+ & > .chevron {
38
+ justify-self: end;
39
+ /* The density seat stretches the wrapper's items; the glyph keeps its
40
+ * own height and rides the line instead of distorting. */
41
+ align-self: center;
42
+ pointer-events: none;
43
+ margin-inline-end: var(--form-input-padding-inline);
44
+ color: var(--color-icon, currentColor);
54
45
  }
55
46
  }
56
47
  }
@@ -7,6 +7,8 @@ const componentCssClassName = "ds input text chrome";
7
7
  *
8
8
  * Usable standalone (controlled via `value`/`onChange`, or uncontrolled) or via
9
9
  * the field tier, which spreads react-hook-form's `register()` result onto it.
10
+ * The `id` goes on the native `<input>`, not the chrome wrapper, so a
11
+ * `<label for>` names and focuses the real control.
10
12
  * @returns {ReactElement} - Rendered Text
11
13
  *
12
14
  * `import { TextInput } from "@canonical/react-ds-global-form";`
@@ -14,7 +16,7 @@ const componentCssClassName = "ds input text chrome";
14
16
  * @implements ds:global.subcomponent.text_input
15
17
  */
16
18
  export const TextInput = forwardRef(function TextInput({ id, className, style, inputType = "text", prefix, suffix, ...nativeProps }, ref) {
17
- return (_jsxs("div", { id: id, style: style, className: [componentCssClassName, className].filter(Boolean).join(" "), children: [prefix && _jsx("span", { className: "prefix", children: prefix }), _jsx("input", { type: inputType, ref: ref, ...nativeProps }), suffix && _jsx("span", { className: "suffix", children: suffix })] }));
19
+ return (_jsxs("div", { style: style, className: [componentCssClassName, className].filter(Boolean).join(" "), children: [prefix && _jsx("span", { className: "prefix", children: prefix }), _jsx("input", { id: id, type: inputType, ref: ref, ...nativeProps }), suffix && _jsx("span", { className: "suffix", children: suffix })] }));
18
20
  });
19
21
  export default TextInput;
20
22
  //# sourceMappingURL=TextInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../../../src/lib/subcomponent/TextInput/TextInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAEtD,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,sBAAsB,CAAC;AAErD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CACjC,SAAS,SAAS,CAChB,EACE,EAAE,EACF,SAAS,EACT,KAAK,EACL,SAAS,GAAG,MAAM,EAClB,MAAM,EACN,MAAM,EACN,GAAG,WAAW,EACf,EACD,GAAG;IAEH,OAAO,CACL,eACE,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,aAEtE,MAAM,IAAI,eAAM,SAAS,EAAC,QAAQ,YAAE,MAAM,GAAQ,EACnD,gBAAO,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAM,WAAW,GAAI,EACpD,MAAM,IAAI,eAAM,SAAS,EAAC,QAAQ,YAAE,MAAM,GAAQ,IAC/C,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../../../src/lib/subcomponent/TextInput/TextInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAC;AAEtD,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,sBAAsB,CAAC;AAErD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CACjC,SAAS,SAAS,CAChB,EACE,EAAE,EACF,SAAS,EACT,KAAK,EACL,SAAS,GAAG,MAAM,EAClB,MAAM,EACN,MAAM,EACN,GAAG,WAAW,EACf,EACD,GAAG;IAEH,OAAO,CACL,eACE,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,aAEtE,MAAM,IAAI,eAAM,SAAS,EAAC,QAAQ,YAAE,MAAM,GAAQ,EACnD,gBAAO,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAM,WAAW,GAAI,EAC5D,MAAM,IAAI,eAAM,SAAS,EAAC,QAAQ,YAAE,MAAM,GAAQ,IAC/C,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -1,10 +1,11 @@
1
1
  // ds:Subcomponent tier barrel. Presentational input parts (no react-hook-form
2
2
  // context) + the Field chrome subcomponents (Field.Label/Description/Error).
3
- // The field/RHF-bound versions live under `component/` (via `fields/`).
4
- // Input subcomponents
3
+ // The field/RHF-bound versions live under `component/` (via `fields/`). The
4
+ // work-in-progress inputs live under `_work_in_progress/` until they are ready.
5
+ export { ColorInput } from "../_work_in_progress/subcomponent/ColorInput/index.js";
6
+ export { ComboboxInput } from "../_work_in_progress/subcomponent/ComboboxInput/index.js";
7
+ export { RatingInput } from "../_work_in_progress/subcomponent/RatingInput/index.js";
5
8
  export { CheckboxInput } from "./CheckboxInput/index.js";
6
- export { ColorInput } from "./ColorInput/index.js";
7
- export { ComboboxInput } from "./ComboboxInput/index.js";
8
9
  export { DateInput } from "./DateInput/index.js";
9
10
  export { DateTimeInput } from "./DateTimeInput/index.js";
10
11
  // Field chrome subcomponents (Field.Label / Field.Description / Field.Error)
@@ -16,7 +17,6 @@ export { PasswordInput } from "./PasswordInput/index.js";
16
17
  export { PhoneInput } from "./PhoneInput/index.js";
17
18
  export { RadioInput } from "./RadioInput/index.js";
18
19
  export { RangeInput } from "./RangeInput/index.js";
19
- export { RatingInput } from "./RatingInput/index.js";
20
20
  export { SelectInput } from "./SelectInput/index.js";
21
21
  export { SwitchInput } from "./SwitchInput/index.js";
22
22
  export { TextareaInput } from "./TextareaInput/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/subcomponent/index.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,6EAA6E;AAC7E,wEAAwE;AAIxE,sBAAsB;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,6EAA6E;AAC7E,cAAc,kBAAkB,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,O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,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,gFAAgF;AAChF,cAAc,YAAY,CAAC"}
@@ -4,9 +4,10 @@ import { useId, useMemo } from "react";
4
4
  * @param {string} name - The name of the field.
5
5
  * @param {boolean} isError - Indicates if the field is in an error state.
6
6
  * @param {boolean} [isRequired] - Whether the field is required (drives `aria-required`, independent of error state).
7
+ * @param {boolean} [hasDescription] - Whether a description is rendered. `aria-describedby` only references ids that are in the document.
7
8
  * @returns An object containing ARIA attributes for input, label, description, and error state.
8
9
  */
9
- const useFieldAriaProps = (name, isError, isRequired = false) => {
10
+ const useFieldAriaProps = (name, isError, isRequired = false, hasDescription = false) => {
10
11
  const uniqueId = useId();
11
12
  const props = useMemo(() => {
12
13
  const baseId = `${uniqueId}-${name}`;
@@ -17,8 +18,9 @@ const useFieldAriaProps = (name, isError, isRequired = false) => {
17
18
  input: {
18
19
  id: baseId,
19
20
  "aria-labelledby": labelId,
20
- "aria-describedby": [descriptionId, isError ? errorId : ""].filter(Boolean).join(" ") ||
21
- undefined,
21
+ "aria-describedby": [hasDescription ? descriptionId : "", isError ? errorId : ""]
22
+ .filter(Boolean)
23
+ .join(" ") || undefined,
22
24
  "aria-errormessage": isError ? errorId : undefined,
23
25
  "aria-invalid": isError,
24
26
  // Required state is a property of the field's optionality, NOT its
@@ -36,7 +38,7 @@ const useFieldAriaProps = (name, isError, isRequired = false) => {
36
38
  // role: "alert",
37
39
  },
38
40
  };
39
- }, [name, isError, isRequired, uniqueId]);
41
+ }, [name, isError, isRequired, hasDescription, uniqueId]);
40
42
  return props;
41
43
  };
42
44
  export default useFieldAriaProps;
@@ -1 +1 @@
1
- {"version":3,"file":"useFieldAriaProperties.js","sourceRoot":"","sources":["../../../../../src/lib/utils/hooks/useFieldAriaProperties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;;;GAMG;AACH,MAAM,iBAAiB,GAAG,CACxB,IAAY,EACZ,OAAgB,EAChB,UAAU,GAAG,KAAK,EAClB,EAAE;IACF,MAAM,QAAQ,GAAG,KAAK,EAAE,CAAC;IACzB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE;QACzB,MAAM,MAAM,GAAG,GAAG,QAAQ,IAAI,IAAI,EAAE,CAAC;QACrC,MAAM,OAAO,GAAG,GAAG,MAAM,QAAQ,CAAC;QAClC,MAAM,aAAa,GAAG,GAAG,MAAM,cAAc,CAAC;QAC9C,MAAM,OAAO,GAAG,GAAG,MAAM,QAAQ,CAAC;QAElC,OAAO;YACL,KAAK,EAAE;gBACL,EAAE,EAAE,MAAM;gBACV,iBAAiB,EAAE,OAAO;gBAC1B,kBAAkB,EAChB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;oBACjE,SAAS;gBACX,mBAAmB,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;gBAClD,cAAc,EAAE,OAAO;gBACvB,mEAAmE;gBACnE,wEAAwE;gBACxE,4DAA4D;gBAC5D,eAAe,EAAE,UAAU,IAAI,SAAS;aACzC;YACD,KAAK,EAAE;gBACL,EAAE,EAAE,OAAO;gBACX,OAAO,EAAE,MAAM;aAChB;YACD,WAAW,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE;YAClC,KAAK,EAAE;gBACL,EAAE,EAAE,OAAO;gBACX,iBAAiB;aAClB;SACF,CAAC;IACJ,CAAC,E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ACD,KAAK,EAAE;gBACL,EAAE,EAAE,OAAO;gBACX,OAAO,EAAE,MAAM;aAChB;YACD,WAAW,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE;YAClC,KAAK,EAAE;gBACL,EAAE,EAAE,OAAO;gBACX,iBAAiB;aAClB;SACF,CAAC;IACJ,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC1D,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -2,7 +2,9 @@ import { useId, useMemo } from "react";
2
2
  /**
3
3
  * Generates ARIA properties for a specific option in a choice-style field.
4
4
  * Pure (no react-hook-form) — lives in the presentational tier so option-group
5
- * inputs (Choices, RichChoices) can use it standalone.
5
+ * inputs (Choices, RichChoices) can use it standalone. Options carry no
6
+ * `aria-describedby`: the field description describes the whole group, so it is
7
+ * referenced from the group's fieldset instead.
6
8
  * @param {string} name - The base name of the input field.
7
9
  * @param {string} optionValue - The value of the specific option.
8
10
  * @returns An object containing ARIA attributes for the option.
@@ -11,14 +13,12 @@ const useOptionAriaProps = (name, optionValue) => {
11
13
  const uniqueId = useId();
12
14
  const props = useMemo(() => {
13
15
  const baseId = `${uniqueId}-${name}`;
14
- const descriptionId = `${baseId}-description`;
15
16
  const optionBaseId = `${baseId}-${optionValue}`;
16
17
  const optionLabelId = `${optionBaseId}-label`;
17
18
  return {
18
19
  input: {
19
20
  id: optionBaseId,
20
21
  "aria-labelledby": optionLabelId,
21
- "aria-describedby": descriptionId,
22
22
  },
23
23
  label: {
24
24
  id: optionLabelId,
@@ -1 +1 @@
1
- {"version":3,"file":"useOptionAriaProperties.js","sourceRoot":"","sources":["../../../../../src/lib/utils/hooks/useOptionAriaProperties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;;;;GAOG;AACH,MAAM,k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AAK,EAAE;gBACL,EAAE,EAAE,YAAY;gBAChB,iBAAiB,EAAE,aAAa;aACjC;YACD,KAAK,EAAE;gBACL,EAAE,EAAE,aAAa;gBACjB,OAAO,EAAE,YAAY;aACtB;SACF,CAAC;IACJ,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;IAClC,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}