@cimpress-ui/react 0.0.0 → 0.1.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 (411) hide show
  1. package/README.md +6 -2
  2. package/dist/commonjs/components/button/button.d.ts +6 -1
  3. package/dist/commonjs/components/button/button.d.ts.map +1 -1
  4. package/dist/commonjs/components/button/button.js +16 -3
  5. package/dist/commonjs/components/button/button.js.map +1 -1
  6. package/dist/commonjs/components/button/constants.d.ts +3 -0
  7. package/dist/commonjs/components/button/constants.d.ts.map +1 -0
  8. package/dist/commonjs/components/button/constants.js +9 -0
  9. package/dist/commonjs/components/button/constants.js.map +1 -0
  10. package/dist/commonjs/components/button/icon-button.d.ts +6 -1
  11. package/dist/commonjs/components/button/icon-button.d.ts.map +1 -1
  12. package/dist/commonjs/components/button/icon-button.js +16 -3
  13. package/dist/commonjs/components/button/icon-button.js.map +1 -1
  14. package/dist/commonjs/components/button/icon-link-button.d.ts +9 -3
  15. package/dist/commonjs/components/button/icon-link-button.d.ts.map +1 -1
  16. package/dist/commonjs/components/button/icon-link-button.js +6 -0
  17. package/dist/commonjs/components/button/icon-link-button.js.map +1 -1
  18. package/dist/commonjs/components/button/link-button.d.ts +9 -3
  19. package/dist/commonjs/components/button/link-button.d.ts.map +1 -1
  20. package/dist/commonjs/components/button/link-button.js +6 -0
  21. package/dist/commonjs/components/button/link-button.js.map +1 -1
  22. package/dist/commonjs/components/button/types.d.ts +12 -6
  23. package/dist/commonjs/components/button/types.d.ts.map +1 -1
  24. package/dist/commonjs/components/button/types.js.map +1 -1
  25. package/dist/commonjs/components/checkbox/checkbox-group.d.ts +14 -4
  26. package/dist/commonjs/components/checkbox/checkbox-group.d.ts.map +1 -1
  27. package/dist/commonjs/components/checkbox/checkbox-group.js +16 -10
  28. package/dist/commonjs/components/checkbox/checkbox-group.js.map +1 -1
  29. package/dist/commonjs/components/checkbox/checkbox.d.ts +9 -4
  30. package/dist/commonjs/components/checkbox/checkbox.d.ts.map +1 -1
  31. package/dist/commonjs/components/checkbox/checkbox.js +7 -1
  32. package/dist/commonjs/components/checkbox/checkbox.js.map +1 -1
  33. package/dist/commonjs/components/combo-box/combo-box.d.ts +25 -24
  34. package/dist/commonjs/components/combo-box/combo-box.d.ts.map +1 -1
  35. package/dist/commonjs/components/combo-box/combo-box.js +31 -16
  36. package/dist/commonjs/components/combo-box/combo-box.js.map +1 -1
  37. package/dist/commonjs/components/form/form.d.ts +8 -3
  38. package/dist/commonjs/components/form/form.d.ts.map +1 -1
  39. package/dist/commonjs/components/form/form.js +6 -0
  40. package/dist/commonjs/components/form/form.js.map +1 -1
  41. package/dist/commonjs/components/internal/collapsible-list/collapsible-list.d.ts +16 -0
  42. package/dist/commonjs/components/internal/collapsible-list/collapsible-list.d.ts.map +1 -0
  43. package/dist/commonjs/components/internal/collapsible-list/collapsible-list.js +17 -0
  44. package/dist/commonjs/components/internal/collapsible-list/collapsible-list.js.map +1 -0
  45. package/dist/commonjs/components/internal/form-field/form-field.d.ts +29 -0
  46. package/dist/commonjs/components/internal/form-field/form-field.d.ts.map +1 -0
  47. package/dist/commonjs/components/internal/form-field/form-field.js +56 -0
  48. package/dist/commonjs/components/internal/form-field/form-field.js.map +1 -0
  49. package/dist/commonjs/components/internal/spinner/spinner.d.ts +18 -0
  50. package/dist/commonjs/components/internal/spinner/spinner.d.ts.map +1 -0
  51. package/dist/commonjs/components/internal/spinner/spinner.js +19 -0
  52. package/dist/commonjs/components/internal/spinner/spinner.js.map +1 -0
  53. package/dist/commonjs/components/menu/menu.d.ts +26 -15
  54. package/dist/commonjs/components/menu/menu.d.ts.map +1 -1
  55. package/dist/commonjs/components/menu/menu.js +38 -15
  56. package/dist/commonjs/components/menu/menu.js.map +1 -1
  57. package/dist/commonjs/components/radio/radio-group.d.ts +14 -4
  58. package/dist/commonjs/components/radio/radio-group.d.ts.map +1 -1
  59. package/dist/commonjs/components/radio/radio-group.js +16 -10
  60. package/dist/commonjs/components/radio/radio-group.js.map +1 -1
  61. package/dist/commonjs/components/radio/radio.d.ts +9 -4
  62. package/dist/commonjs/components/radio/radio.d.ts.map +1 -1
  63. package/dist/commonjs/components/radio/radio.js +6 -0
  64. package/dist/commonjs/components/radio/radio.js.map +1 -1
  65. package/dist/commonjs/components/select/select.d.ts +27 -24
  66. package/dist/commonjs/components/select/select.d.ts.map +1 -1
  67. package/dist/commonjs/components/select/select.js +33 -14
  68. package/dist/commonjs/components/select/select.js.map +1 -1
  69. package/dist/commonjs/components/spacing/box/box.d.ts +5 -3
  70. package/dist/commonjs/components/spacing/box/box.d.ts.map +1 -1
  71. package/dist/commonjs/components/spacing/box/box.js +2 -0
  72. package/dist/commonjs/components/spacing/box/box.js.map +1 -1
  73. package/dist/commonjs/components/spacing/stack/stack.d.ts +28 -4
  74. package/dist/commonjs/components/spacing/stack/stack.d.ts.map +1 -1
  75. package/dist/commonjs/components/spacing/stack/stack.js +11 -3
  76. package/dist/commonjs/components/spacing/stack/stack.js.map +1 -1
  77. package/dist/commonjs/components/spacing/types.d.ts +9 -0
  78. package/dist/commonjs/components/spacing/types.d.ts.map +1 -1
  79. package/dist/commonjs/components/spacing/types.js +6 -0
  80. package/dist/commonjs/components/spacing/types.js.map +1 -1
  81. package/dist/commonjs/components/spinner/spinner.d.ts +12 -5
  82. package/dist/commonjs/components/spinner/spinner.d.ts.map +1 -1
  83. package/dist/commonjs/components/spinner/spinner.js +26 -14
  84. package/dist/commonjs/components/spinner/spinner.js.map +1 -1
  85. package/dist/commonjs/components/text-inputs/text-area.d.ts +4 -3
  86. package/dist/commonjs/components/text-inputs/text-area.d.ts.map +1 -1
  87. package/dist/commonjs/components/text-inputs/text-area.js +13 -3
  88. package/dist/commonjs/components/text-inputs/text-area.js.map +1 -1
  89. package/dist/commonjs/components/text-inputs/text-field.d.ts +8 -3
  90. package/dist/commonjs/components/text-inputs/text-field.d.ts.map +1 -1
  91. package/dist/commonjs/components/text-inputs/text-field.js +14 -1
  92. package/dist/commonjs/components/text-inputs/text-field.js.map +1 -1
  93. package/dist/commonjs/components/types.d.ts +80 -12
  94. package/dist/commonjs/components/types.d.ts.map +1 -1
  95. package/dist/commonjs/components/types.js.map +1 -1
  96. package/dist/commonjs/components/typography/link.d.ts +8 -3
  97. package/dist/commonjs/components/typography/link.d.ts.map +1 -1
  98. package/dist/commonjs/components/typography/link.js +9 -1
  99. package/dist/commonjs/components/typography/link.js.map +1 -1
  100. package/dist/commonjs/components/typography/text.d.ts +7 -2
  101. package/dist/commonjs/components/typography/text.d.ts.map +1 -1
  102. package/dist/commonjs/components/typography/text.js +6 -0
  103. package/dist/commonjs/components/typography/text.js.map +1 -1
  104. package/dist/commonjs/components/typography/types.d.ts +4 -3
  105. package/dist/commonjs/components/typography/types.d.ts.map +1 -1
  106. package/dist/commonjs/components/typography/types.js.map +1 -1
  107. package/dist/commonjs/components/typography/utils.d.ts +1 -0
  108. package/dist/commonjs/components/typography/utils.d.ts.map +1 -1
  109. package/dist/commonjs/components/typography/utils.js +1 -0
  110. package/dist/commonjs/components/typography/utils.js.map +1 -1
  111. package/dist/commonjs/forward-ref.d.ts +2 -2
  112. package/dist/commonjs/forward-ref.d.ts.map +1 -1
  113. package/dist/commonjs/forward-ref.js +1 -0
  114. package/dist/commonjs/forward-ref.js.map +1 -1
  115. package/dist/commonjs/icons/accounting-document.d.ts +8 -0
  116. package/dist/commonjs/icons/accounting-document.d.ts.map +1 -0
  117. package/dist/commonjs/icons/accounting-document.js +22 -0
  118. package/dist/commonjs/icons/accounting-document.js.map +1 -0
  119. package/dist/commonjs/icons/add-circle-fill.d.ts +8 -0
  120. package/dist/commonjs/icons/add-circle-fill.d.ts.map +1 -0
  121. package/dist/commonjs/icons/add-circle-fill.js +22 -0
  122. package/dist/commonjs/icons/add-circle-fill.js.map +1 -0
  123. package/dist/commonjs/icons/add-circle.d.ts +8 -0
  124. package/dist/commonjs/icons/add-circle.d.ts.map +1 -0
  125. package/dist/commonjs/icons/add-circle.js +22 -0
  126. package/dist/commonjs/icons/add-circle.js.map +1 -0
  127. package/dist/commonjs/icons/add.d.ts +3 -2
  128. package/dist/commonjs/icons/add.d.ts.map +1 -1
  129. package/dist/commonjs/icons/add.js +17 -2
  130. package/dist/commonjs/icons/add.js.map +1 -1
  131. package/dist/commonjs/icons/alert-triangle.d.ts +3 -2
  132. package/dist/commonjs/icons/alert-triangle.d.ts.map +1 -1
  133. package/dist/commonjs/icons/alert-triangle.js +17 -2
  134. package/dist/commonjs/icons/alert-triangle.js.map +1 -1
  135. package/dist/commonjs/icons/calculator-alt.d.ts +8 -0
  136. package/dist/commonjs/icons/calculator-alt.d.ts.map +1 -0
  137. package/dist/commonjs/icons/calculator-alt.js +22 -0
  138. package/dist/commonjs/icons/calculator-alt.js.map +1 -0
  139. package/dist/commonjs/icons/calculator.d.ts +8 -0
  140. package/dist/commonjs/icons/calculator.d.ts.map +1 -0
  141. package/dist/commonjs/icons/calculator.js +22 -0
  142. package/dist/commonjs/icons/calculator.js.map +1 -0
  143. package/dist/commonjs/icons/checkmark-circle-fill.d.ts +8 -0
  144. package/dist/commonjs/icons/checkmark-circle-fill.d.ts.map +1 -0
  145. package/dist/commonjs/icons/checkmark-circle-fill.js +22 -0
  146. package/dist/commonjs/icons/checkmark-circle-fill.js.map +1 -0
  147. package/dist/commonjs/icons/checkmark-circle.d.ts +8 -0
  148. package/dist/commonjs/icons/checkmark-circle.d.ts.map +1 -0
  149. package/dist/commonjs/icons/checkmark-circle.js +22 -0
  150. package/dist/commonjs/icons/checkmark-circle.js.map +1 -0
  151. package/dist/commonjs/icons/checkmark-small.d.ts +3 -2
  152. package/dist/commonjs/icons/checkmark-small.d.ts.map +1 -1
  153. package/dist/commonjs/icons/checkmark-small.js +17 -2
  154. package/dist/commonjs/icons/checkmark-small.js.map +1 -1
  155. package/dist/commonjs/icons/checkmark.d.ts +8 -0
  156. package/dist/commonjs/icons/checkmark.d.ts.map +1 -0
  157. package/dist/commonjs/icons/checkmark.js +22 -0
  158. package/dist/commonjs/icons/checkmark.js.map +1 -0
  159. package/dist/commonjs/icons/chevron-down-fill.d.ts +8 -0
  160. package/dist/commonjs/icons/chevron-down-fill.d.ts.map +1 -0
  161. package/dist/commonjs/icons/chevron-down-fill.js +22 -0
  162. package/dist/commonjs/icons/chevron-down-fill.js.map +1 -0
  163. package/dist/commonjs/icons/error-circle-fill.d.ts +8 -0
  164. package/dist/commonjs/icons/error-circle-fill.d.ts.map +1 -0
  165. package/dist/commonjs/icons/error-circle-fill.js +22 -0
  166. package/dist/commonjs/icons/error-circle-fill.js.map +1 -0
  167. package/dist/commonjs/icons/index.d.ts +13 -0
  168. package/dist/commonjs/icons/index.d.ts.map +1 -1
  169. package/dist/commonjs/icons/index.js +25 -1
  170. package/dist/commonjs/icons/index.js.map +1 -1
  171. package/dist/commonjs/icons/info-circle-fill.d.ts +8 -0
  172. package/dist/commonjs/icons/info-circle-fill.d.ts.map +1 -0
  173. package/dist/commonjs/icons/info-circle-fill.js +22 -0
  174. package/dist/commonjs/icons/info-circle-fill.js.map +1 -0
  175. package/dist/commonjs/icons/minus-small.d.ts +3 -2
  176. package/dist/commonjs/icons/minus-small.d.ts.map +1 -1
  177. package/dist/commonjs/icons/minus-small.js +17 -2
  178. package/dist/commonjs/icons/minus-small.js.map +1 -1
  179. package/dist/commonjs/icons/warning-circle-fill.d.ts +8 -0
  180. package/dist/commonjs/icons/warning-circle-fill.d.ts.map +1 -0
  181. package/dist/commonjs/icons/warning-circle-fill.js +22 -0
  182. package/dist/commonjs/icons/warning-circle-fill.js.map +1 -0
  183. package/dist/commonjs/index.d.ts +13 -11
  184. package/dist/commonjs/index.d.ts.map +1 -1
  185. package/dist/commonjs/index.js +11 -10
  186. package/dist/commonjs/index.js.map +1 -1
  187. package/dist/commonjs/providers/router/router-provider.d.ts +20 -0
  188. package/dist/commonjs/providers/router/router-provider.d.ts.map +1 -0
  189. package/dist/commonjs/providers/router/router-provider.js +15 -0
  190. package/dist/commonjs/providers/router/router-provider.js.map +1 -0
  191. package/dist/commonjs/providers/ssr/ssr-provider.d.ts +7 -3
  192. package/dist/commonjs/providers/ssr/ssr-provider.d.ts.map +1 -1
  193. package/dist/commonjs/providers/ssr/ssr-provider.js +3 -1
  194. package/dist/commonjs/providers/ssr/ssr-provider.js.map +1 -1
  195. package/dist/commonjs/with-style-props.d.ts +17 -11
  196. package/dist/commonjs/with-style-props.d.ts.map +1 -1
  197. package/dist/commonjs/with-style-props.js.map +1 -1
  198. package/dist/esm/components/button/button.d.ts +6 -1
  199. package/dist/esm/components/button/button.d.ts.map +1 -1
  200. package/dist/esm/components/button/button.js +16 -3
  201. package/dist/esm/components/button/button.js.map +1 -1
  202. package/dist/esm/components/button/constants.d.ts +3 -0
  203. package/dist/esm/components/button/constants.d.ts.map +1 -0
  204. package/dist/esm/components/button/constants.js +6 -0
  205. package/dist/esm/components/button/constants.js.map +1 -0
  206. package/dist/esm/components/button/icon-button.d.ts +6 -1
  207. package/dist/esm/components/button/icon-button.d.ts.map +1 -1
  208. package/dist/esm/components/button/icon-button.js +16 -3
  209. package/dist/esm/components/button/icon-button.js.map +1 -1
  210. package/dist/esm/components/button/icon-link-button.d.ts +9 -3
  211. package/dist/esm/components/button/icon-link-button.d.ts.map +1 -1
  212. package/dist/esm/components/button/icon-link-button.js +6 -0
  213. package/dist/esm/components/button/icon-link-button.js.map +1 -1
  214. package/dist/esm/components/button/link-button.d.ts +9 -3
  215. package/dist/esm/components/button/link-button.d.ts.map +1 -1
  216. package/dist/esm/components/button/link-button.js +6 -0
  217. package/dist/esm/components/button/link-button.js.map +1 -1
  218. package/dist/esm/components/button/types.d.ts +12 -6
  219. package/dist/esm/components/button/types.d.ts.map +1 -1
  220. package/dist/esm/components/button/types.js.map +1 -1
  221. package/dist/esm/components/checkbox/checkbox-group.d.ts +14 -4
  222. package/dist/esm/components/checkbox/checkbox-group.d.ts.map +1 -1
  223. package/dist/esm/components/checkbox/checkbox-group.js +16 -10
  224. package/dist/esm/components/checkbox/checkbox-group.js.map +1 -1
  225. package/dist/esm/components/checkbox/checkbox.d.ts +9 -4
  226. package/dist/esm/components/checkbox/checkbox.d.ts.map +1 -1
  227. package/dist/esm/components/checkbox/checkbox.js +7 -1
  228. package/dist/esm/components/checkbox/checkbox.js.map +1 -1
  229. package/dist/esm/components/combo-box/combo-box.d.ts +25 -24
  230. package/dist/esm/components/combo-box/combo-box.d.ts.map +1 -1
  231. package/dist/esm/components/combo-box/combo-box.js +35 -22
  232. package/dist/esm/components/combo-box/combo-box.js.map +1 -1
  233. package/dist/esm/components/form/form.d.ts +8 -3
  234. package/dist/esm/components/form/form.d.ts.map +1 -1
  235. package/dist/esm/components/form/form.js +6 -0
  236. package/dist/esm/components/form/form.js.map +1 -1
  237. package/dist/esm/components/internal/collapsible-list/collapsible-list.d.ts +16 -0
  238. package/dist/esm/components/internal/collapsible-list/collapsible-list.d.ts.map +1 -0
  239. package/dist/esm/components/internal/collapsible-list/collapsible-list.js +14 -0
  240. package/dist/esm/components/internal/collapsible-list/collapsible-list.js.map +1 -0
  241. package/dist/esm/components/internal/form-field/form-field.d.ts +29 -0
  242. package/dist/esm/components/internal/form-field/form-field.d.ts.map +1 -0
  243. package/dist/esm/components/internal/form-field/form-field.js +48 -0
  244. package/dist/esm/components/internal/form-field/form-field.js.map +1 -0
  245. package/dist/esm/components/internal/spinner/spinner.d.ts +18 -0
  246. package/dist/esm/components/internal/spinner/spinner.d.ts.map +1 -0
  247. package/dist/esm/components/internal/spinner/spinner.js +14 -0
  248. package/dist/esm/components/internal/spinner/spinner.js.map +1 -0
  249. package/dist/esm/components/menu/menu.d.ts +26 -15
  250. package/dist/esm/components/menu/menu.d.ts.map +1 -1
  251. package/dist/esm/components/menu/menu.js +39 -16
  252. package/dist/esm/components/menu/menu.js.map +1 -1
  253. package/dist/esm/components/radio/radio-group.d.ts +14 -4
  254. package/dist/esm/components/radio/radio-group.d.ts.map +1 -1
  255. package/dist/esm/components/radio/radio-group.js +16 -10
  256. package/dist/esm/components/radio/radio-group.js.map +1 -1
  257. package/dist/esm/components/radio/radio.d.ts +9 -4
  258. package/dist/esm/components/radio/radio.d.ts.map +1 -1
  259. package/dist/esm/components/radio/radio.js +6 -0
  260. package/dist/esm/components/radio/radio.js.map +1 -1
  261. package/dist/esm/components/select/select.d.ts +27 -24
  262. package/dist/esm/components/select/select.d.ts.map +1 -1
  263. package/dist/esm/components/select/select.js +35 -18
  264. package/dist/esm/components/select/select.js.map +1 -1
  265. package/dist/esm/components/spacing/box/box.d.ts +5 -3
  266. package/dist/esm/components/spacing/box/box.d.ts.map +1 -1
  267. package/dist/esm/components/spacing/box/box.js +2 -0
  268. package/dist/esm/components/spacing/box/box.js.map +1 -1
  269. package/dist/esm/components/spacing/stack/stack.d.ts +28 -4
  270. package/dist/esm/components/spacing/stack/stack.d.ts.map +1 -1
  271. package/dist/esm/components/spacing/stack/stack.js +11 -3
  272. package/dist/esm/components/spacing/stack/stack.js.map +1 -1
  273. package/dist/esm/components/spacing/types.d.ts +9 -0
  274. package/dist/esm/components/spacing/types.d.ts.map +1 -1
  275. package/dist/esm/components/spacing/types.js +6 -0
  276. package/dist/esm/components/spacing/types.js.map +1 -1
  277. package/dist/esm/components/spinner/spinner.d.ts +12 -5
  278. package/dist/esm/components/spinner/spinner.d.ts.map +1 -1
  279. package/dist/esm/components/spinner/spinner.js +28 -13
  280. package/dist/esm/components/spinner/spinner.js.map +1 -1
  281. package/dist/esm/components/text-inputs/text-area.d.ts +4 -3
  282. package/dist/esm/components/text-inputs/text-area.d.ts.map +1 -1
  283. package/dist/esm/components/text-inputs/text-area.js +13 -3
  284. package/dist/esm/components/text-inputs/text-area.js.map +1 -1
  285. package/dist/esm/components/text-inputs/text-field.d.ts +8 -3
  286. package/dist/esm/components/text-inputs/text-field.d.ts.map +1 -1
  287. package/dist/esm/components/text-inputs/text-field.js +14 -1
  288. package/dist/esm/components/text-inputs/text-field.js.map +1 -1
  289. package/dist/esm/components/types.d.ts +80 -12
  290. package/dist/esm/components/types.d.ts.map +1 -1
  291. package/dist/esm/components/types.js.map +1 -1
  292. package/dist/esm/components/typography/link.d.ts +8 -3
  293. package/dist/esm/components/typography/link.d.ts.map +1 -1
  294. package/dist/esm/components/typography/link.js +10 -2
  295. package/dist/esm/components/typography/link.js.map +1 -1
  296. package/dist/esm/components/typography/text.d.ts +7 -2
  297. package/dist/esm/components/typography/text.d.ts.map +1 -1
  298. package/dist/esm/components/typography/text.js +6 -0
  299. package/dist/esm/components/typography/text.js.map +1 -1
  300. package/dist/esm/components/typography/types.d.ts +4 -3
  301. package/dist/esm/components/typography/types.d.ts.map +1 -1
  302. package/dist/esm/components/typography/types.js.map +1 -1
  303. package/dist/esm/components/typography/utils.d.ts +1 -0
  304. package/dist/esm/components/typography/utils.d.ts.map +1 -1
  305. package/dist/esm/components/typography/utils.js +1 -0
  306. package/dist/esm/components/typography/utils.js.map +1 -1
  307. package/dist/esm/forward-ref.d.ts +2 -2
  308. package/dist/esm/forward-ref.d.ts.map +1 -1
  309. package/dist/esm/forward-ref.js +1 -0
  310. package/dist/esm/forward-ref.js.map +1 -1
  311. package/dist/esm/icons/accounting-document.d.ts +8 -0
  312. package/dist/esm/icons/accounting-document.d.ts.map +1 -0
  313. package/dist/esm/icons/accounting-document.js +17 -0
  314. package/dist/esm/icons/accounting-document.js.map +1 -0
  315. package/dist/esm/icons/add-circle-fill.d.ts +8 -0
  316. package/dist/esm/icons/add-circle-fill.d.ts.map +1 -0
  317. package/dist/esm/icons/add-circle-fill.js +17 -0
  318. package/dist/esm/icons/add-circle-fill.js.map +1 -0
  319. package/dist/esm/icons/add-circle.d.ts +8 -0
  320. package/dist/esm/icons/add-circle.d.ts.map +1 -0
  321. package/dist/esm/icons/add-circle.js +17 -0
  322. package/dist/esm/icons/add-circle.js.map +1 -0
  323. package/dist/esm/icons/add.d.ts +3 -2
  324. package/dist/esm/icons/add.d.ts.map +1 -1
  325. package/dist/esm/icons/add.js +15 -3
  326. package/dist/esm/icons/add.js.map +1 -1
  327. package/dist/esm/icons/alert-triangle.d.ts +3 -2
  328. package/dist/esm/icons/alert-triangle.d.ts.map +1 -1
  329. package/dist/esm/icons/alert-triangle.js +14 -2
  330. package/dist/esm/icons/alert-triangle.js.map +1 -1
  331. package/dist/esm/icons/calculator-alt.d.ts +8 -0
  332. package/dist/esm/icons/calculator-alt.d.ts.map +1 -0
  333. package/dist/esm/icons/calculator-alt.js +17 -0
  334. package/dist/esm/icons/calculator-alt.js.map +1 -0
  335. package/dist/esm/icons/calculator.d.ts +8 -0
  336. package/dist/esm/icons/calculator.d.ts.map +1 -0
  337. package/dist/esm/icons/calculator.js +17 -0
  338. package/dist/esm/icons/calculator.js.map +1 -0
  339. package/dist/esm/icons/checkmark-circle-fill.d.ts +8 -0
  340. package/dist/esm/icons/checkmark-circle-fill.d.ts.map +1 -0
  341. package/dist/esm/icons/checkmark-circle-fill.js +17 -0
  342. package/dist/esm/icons/checkmark-circle-fill.js.map +1 -0
  343. package/dist/esm/icons/checkmark-circle.d.ts +8 -0
  344. package/dist/esm/icons/checkmark-circle.d.ts.map +1 -0
  345. package/dist/esm/icons/checkmark-circle.js +17 -0
  346. package/dist/esm/icons/checkmark-circle.js.map +1 -0
  347. package/dist/esm/icons/checkmark-small.d.ts +3 -2
  348. package/dist/esm/icons/checkmark-small.d.ts.map +1 -1
  349. package/dist/esm/icons/checkmark-small.js +14 -2
  350. package/dist/esm/icons/checkmark-small.js.map +1 -1
  351. package/dist/esm/icons/checkmark.d.ts +8 -0
  352. package/dist/esm/icons/checkmark.d.ts.map +1 -0
  353. package/dist/esm/icons/checkmark.js +17 -0
  354. package/dist/esm/icons/checkmark.js.map +1 -0
  355. package/dist/esm/icons/chevron-down-fill.d.ts +8 -0
  356. package/dist/esm/icons/chevron-down-fill.d.ts.map +1 -0
  357. package/dist/esm/icons/chevron-down-fill.js +17 -0
  358. package/dist/esm/icons/chevron-down-fill.js.map +1 -0
  359. package/dist/esm/icons/error-circle-fill.d.ts +8 -0
  360. package/dist/esm/icons/error-circle-fill.d.ts.map +1 -0
  361. package/dist/esm/icons/error-circle-fill.js +17 -0
  362. package/dist/esm/icons/error-circle-fill.js.map +1 -0
  363. package/dist/esm/icons/index.d.ts +13 -0
  364. package/dist/esm/icons/index.d.ts.map +1 -1
  365. package/dist/esm/icons/index.js +12 -0
  366. package/dist/esm/icons/index.js.map +1 -1
  367. package/dist/esm/icons/info-circle-fill.d.ts +8 -0
  368. package/dist/esm/icons/info-circle-fill.d.ts.map +1 -0
  369. package/dist/esm/icons/info-circle-fill.js +17 -0
  370. package/dist/esm/icons/info-circle-fill.js.map +1 -0
  371. package/dist/esm/icons/minus-small.d.ts +3 -2
  372. package/dist/esm/icons/minus-small.d.ts.map +1 -1
  373. package/dist/esm/icons/minus-small.js +14 -2
  374. package/dist/esm/icons/minus-small.js.map +1 -1
  375. package/dist/esm/icons/warning-circle-fill.d.ts +8 -0
  376. package/dist/esm/icons/warning-circle-fill.d.ts.map +1 -0
  377. package/dist/esm/icons/warning-circle-fill.js +17 -0
  378. package/dist/esm/icons/warning-circle-fill.js.map +1 -0
  379. package/dist/esm/index.d.ts +13 -11
  380. package/dist/esm/index.d.ts.map +1 -1
  381. package/dist/esm/index.js +11 -10
  382. package/dist/esm/index.js.map +1 -1
  383. package/dist/esm/providers/router/router-provider.d.ts +20 -0
  384. package/dist/esm/providers/router/router-provider.d.ts.map +1 -0
  385. package/dist/esm/providers/router/router-provider.js +12 -0
  386. package/dist/esm/providers/router/router-provider.js.map +1 -0
  387. package/dist/esm/providers/ssr/ssr-provider.d.ts +7 -3
  388. package/dist/esm/providers/ssr/ssr-provider.d.ts.map +1 -1
  389. package/dist/esm/providers/ssr/ssr-provider.js +3 -1
  390. package/dist/esm/providers/ssr/ssr-provider.js.map +1 -1
  391. package/dist/esm/with-style-props.d.ts +17 -11
  392. package/dist/esm/with-style-props.d.ts.map +1 -1
  393. package/dist/esm/with-style-props.js.map +1 -1
  394. package/dist-styles/styles.css +1 -1
  395. package/package.json +71 -26
  396. package/dist/commonjs/components/form-field/form-field.d.ts +0 -13
  397. package/dist/commonjs/components/form-field/form-field.d.ts.map +0 -1
  398. package/dist/commonjs/components/form-field/form-field.js +0 -36
  399. package/dist/commonjs/components/form-field/form-field.js.map +0 -1
  400. package/dist/commonjs/components/sr-only/sr-only.d.ts +0 -8
  401. package/dist/commonjs/components/sr-only/sr-only.d.ts.map +0 -1
  402. package/dist/commonjs/components/sr-only/sr-only.js +0 -10
  403. package/dist/commonjs/components/sr-only/sr-only.js.map +0 -1
  404. package/dist/esm/components/form-field/form-field.d.ts +0 -13
  405. package/dist/esm/components/form-field/form-field.d.ts.map +0 -1
  406. package/dist/esm/components/form-field/form-field.js +0 -28
  407. package/dist/esm/components/form-field/form-field.js.map +0 -1
  408. package/dist/esm/components/sr-only/sr-only.d.ts +0 -8
  409. package/dist/esm/components/sr-only/sr-only.d.ts.map +0 -1
  410. package/dist/esm/components/sr-only/sr-only.js +0 -7
  411. package/dist/esm/components/sr-only/sr-only.js.map +0 -1
@@ -1,28 +1,45 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
3
  import clsx from 'clsx';
3
- import { Button as RACButton, Collection as RACCollection, Header as RACHeader, ListBox as RACListBox, ListBoxItem as RACListBoxItem, Popover as RACPopover, Section as RACSection, Select as RACSelect, SelectValue as RACSelectValue, } from 'react-aria-components';
4
+ import { useEffect } from 'react';
5
+ import { Button as RACButton, Collection as RACCollection, Header as RACHeader, ListBox as RACListBox, ListBoxItem as RACListBoxItem, ListBoxSection as RACListBoxSection, Select as RACSelect, SelectValue as RACSelectValue, Text as RACText, } from 'react-aria-components';
4
6
  import { forwardRef } from '../../forward-ref.js';
7
+ import { IconCheckmark, IconChevronDownFill } from '../../icons/index.js';
5
8
  import { withStyleProps } from '../../with-style-props.js';
6
- import { FormFieldDescription, FormFieldError, FormFieldLabel } from '../form-field/form-field.js';
9
+ import { CollapsibleList } from '../internal/collapsible-list/collapsible-list.js';
10
+ import { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';
7
11
  import { textStyle } from '../typography/utils.js';
8
- function Select({ label, description, error, options, UNSAFE_className, UNSAFE_style, ...props }, ref) {
9
- return (_jsxs(RACSelect, { ...props, ref: ref, className: clsx('cim-select', UNSAFE_className), style: UNSAFE_style, children: [_jsx(FormFieldLabel, { isRequired: props.isRequired, children: label }), _jsxs(RACButton, { className: "cim-select-button", children: [_jsx(RACSelectValue, { className: (values) => clsx(values.defaultClassName, textStyle({ variant: 'medium', tone: values.isPlaceholder ? 'muted' : 'base' })) }), _jsx(ChevronDownIcon, { height: 12, width: 12, "aria-hidden": "true" })] }), _jsx(FormFieldError, { children: error }), _jsx(FormFieldDescription, { children: description }), _jsx(RACPopover, { offset: 2, maxHeight: 315, className: "cim-select-popover", "data-experimental-cim-style-root": true, children: _jsx(RACListBox, { className: "cim-select-listbox", items: options, children: renderOptions }) })] }));
12
+ function Select({ children, items, label, description, error, UNSAFE_className, UNSAFE_style, onScroll, ...props }, ref) {
13
+ const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
14
+ useEffect(() => {
15
+ if (!label && !ariaLabel && !ariaLabelledBy) {
16
+ console.warn('Select requires one of label / aria-label / aria-labelledby for accessibility');
17
+ }
18
+ }, [label, ariaLabel, ariaLabelledBy]);
19
+ if (items != null && typeof children !== 'function') {
20
+ console.warn('`Select` requires `children` to be a function when using `items` prop');
21
+ }
22
+ return (_jsxs(RACSelect, { ...props, ref: ref, className: clsx('cim-select', UNSAFE_className), style: UNSAFE_style, children: [_jsx(FormFieldLabel, { isRequired: props.isRequired, isDisabled: props.isDisabled, children: label }), _jsxs(RACButton, { className: "cim-select-button", children: [_jsx(RACSelectValue, { className: (values) => clsx(values.defaultClassName, textStyle({ variant: 'medium', alignment: 'start' })), children: ({ selectedText }) => selectedText }), _jsx(IconChevronDownFill, {})] }), _jsx(FormFieldError, { children: error }), _jsx(FormFieldDescription, { children: description }), _jsx(CollapsibleList, { offset: 5, maxHeight: 315, children: _jsx(RACListBox, { className: "cim-select-listbox", onScroll: onScroll, items: items, children: children }) })] }));
10
23
  }
24
+ /**
25
+ * Allows users to select one item from a collapsible list.
26
+ *
27
+ * See [select usage guidelines](https://ui.cimpress.io/components/select/).
28
+ */
11
29
  const _Select = withStyleProps(forwardRef(Select), 'Select');
12
30
  export { _Select as Select };
13
- function renderOptions(item) {
14
- if ('options' in item) {
15
- return (_jsx(SelectSection, { id: item.id, title: item.label, items: item.options, children: (child) => (_jsx(SelectItem, { id: child.id, isDisabled: child.isDisabled, children: child.label })) }));
16
- }
17
- return (_jsx(SelectItem, { id: item.id, isDisabled: item.isDisabled, children: item.label }));
18
- }
19
- function SelectItem({ children, ...props }) {
20
- return (_jsx(RACListBoxItem, { ...props, className: clsx('cim-select-item', textStyle({ variant: 'medium' })), children: children }));
31
+ /** Renders a single list item within `Select`. */
32
+ export function SelectItem({ children, ...props }) {
33
+ const textValue = typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');
34
+ return (_jsx(RACListBoxItem, { ...props, className: "cim-select-item", textValue: textValue, children: ({ isDisabled }) => (_jsxs(_Fragment, { children: [_jsx(IconCheckmark, {}), _jsx(RACText, { slot: "label", className: textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'base' }), children: children })] })) }));
21
35
  }
22
- function SelectSection({ title, children, items, ...props }) {
23
- return (_jsxs(RACSection, { ...props, className: "cim-select-section", children: [_jsx(RACHeader, { className: clsx('cim-select-header', textStyle({ variant: 'small', tone: 'subtle' })), children: title }), _jsx(RACCollection, { items: items, children: children })] }));
24
- }
25
- function ChevronDownIcon(props) {
26
- return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 12 12", fill: "currentColor", "data-icon": true, ...props, children: _jsx("path", { d: "M.124 3.603 5.617 9.84a.533.533 0 0 0 .769 0l5.49-6.236a.493.493 0 0 0-.054-.707l-.925-.778a.514.514 0 0 0-.719.055L6.095 6.9a.125.125 0 0 1-.189 0L1.822 2.173A.51.51 0 0 0 1.474 2a.5.5 0 0 0-.37.119l-.926.777a.494.494 0 0 0-.054.707Z" }) }));
36
+ SelectItem.displayName = 'SelectItem';
37
+ /** Groups list items within `Select` into a section. */
38
+ export function SelectSection({ title, children, items, ...props }) {
39
+ if (items != null && typeof children !== 'function') {
40
+ console.warn('`SelectSection` requires `children` to be a function when using `items` prop');
41
+ }
42
+ return (_jsxs(RACListBoxSection, { ...props, className: "cim-select-section", children: [_jsx(RACHeader, { className: clsx('cim-select-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' })), children: title }), _jsx(RACCollection, { items: items, children: children })] }));
27
43
  }
44
+ SelectSection.displayName = 'SelectSection';
28
45
  //# sourceMappingURL=select.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EACL,MAAM,IAAI,SAAS,EACnB,UAAU,IAAI,aAAa,EAC3B,MAAM,IAAI,SAAS,EACnB,OAAO,IAAI,UAAU,EACrB,WAAW,IAAI,cAAc,EAC7B,OAAO,IAAI,UAAU,EACrB,OAAO,IAAI,UAAU,EACrB,MAAM,IAAI,SAAS,EACnB,WAAW,IAAI,cAAc,GAG9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAEnG,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AA2CnD,SAAS,MAAM,CACb,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAA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,CAAC","sourcesContent":["import clsx from 'clsx';\nimport type { ReactNode, SVGAttributes, ForwardedRef } from 'react';\nimport {\n Button as RACButton,\n Collection as RACCollection,\n Header as RACHeader,\n ListBox as RACListBox,\n ListBoxItem as RACListBoxItem,\n Popover as RACPopover,\n Section as RACSection,\n Select as RACSelect,\n SelectValue as RACSelectValue,\n type ListBoxItemProps as RACListBoxItemProps,\n type SelectProps as RACSelectProps,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../form-field/form-field.js';\nimport type { DOMProps, FieldWithPlaceholderProps, Key } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface SelectOption {\n /** The unique id of the item. When integrated with a form, this will be the value of the option. */\n id: string;\n /** The content to display as the label of the option. */\n label: string;\n /** Whether the option is disabled. */\n isDisabled?: boolean;\n}\n\nexport interface SelectOptionGroup {\n /** The unique id of the group. */\n id: string;\n /** The content to display as the title of the group. */\n label: string;\n /** The options available for selection within the group. */\n options: SelectOption[];\n isDisabled?: never;\n}\n\nexport type SelectOptionType = SelectOption | SelectOptionGroup;\n\nexport interface SelectProps\n extends Pick<\n RACSelectProps<SelectOptionType>,\n | 'name'\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'selectedKey'\n | 'defaultSelectedKey'\n | 'placeholder'\n | 'autoComplete'\n | 'autoFocus'\n | 'onSelectionChange'\n >,\n DOMProps,\n FieldWithPlaceholderProps<Key> {\n /** The options available for selection. Supports groups with a single level of nesting. */\n options: SelectOptionType[];\n}\n\nfunction Select(\n { label, description, error, options, UNSAFE_className, UNSAFE_style, ...props }: SelectProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n return (\n <RACSelect {...props} ref={ref} className={clsx('cim-select', UNSAFE_className)} style={UNSAFE_style}>\n <FormFieldLabel isRequired={props.isRequired}>{label}</FormFieldLabel>\n <RACButton className=\"cim-select-button\">\n <RACSelectValue\n className={(values) =>\n clsx(\n values.defaultClassName,\n textStyle({ variant: 'medium', tone: values.isPlaceholder ? 'muted' : 'base' }),\n )\n }\n />\n <ChevronDownIcon height={12} width={12} aria-hidden=\"true\" />\n </RACButton>\n <FormFieldError>{error}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n <RACPopover offset={2} maxHeight={315} className=\"cim-select-popover\" data-experimental-cim-style-root>\n <RACListBox className=\"cim-select-listbox\" items={options}>\n {renderOptions}\n </RACListBox>\n </RACPopover>\n </RACSelect>\n );\n}\n\nconst _Select = withStyleProps(forwardRef(Select), 'Select');\n\nexport { _Select as Select };\n\nfunction renderOptions(item: SelectOptionType) {\n if ('options' in item) {\n return (\n <SelectSection id={item.id} title={item.label} items={item.options}>\n {(child) => (\n <SelectItem id={child.id} isDisabled={child.isDisabled}>\n {child.label}\n </SelectItem>\n )}\n </SelectSection>\n );\n }\n\n return (\n <SelectItem id={item.id} isDisabled={item.isDisabled}>\n {item.label}\n </SelectItem>\n );\n}\n\ninterface SelectItemProps extends Pick<RACListBoxItemProps<SelectOption>, 'id' | 'value' | 'isDisabled'> {\n children: string;\n}\n\nfunction SelectItem({ children, ...props }: SelectItemProps) {\n return (\n <RACListBoxItem {...props} className={clsx('cim-select-item', textStyle({ variant: 'medium' }))}>\n {children}\n </RACListBoxItem>\n );\n}\n\ninterface SelectSectionProps {\n id: string;\n title: string;\n children: ReactNode | ((item: SelectOption) => ReactNode);\n items?: Iterable<SelectOption>;\n}\n\nfunction SelectSection({ title, children, items, ...props }: SelectSectionProps) {\n return (\n <RACSection {...props} className=\"cim-select-section\">\n <RACHeader className={clsx('cim-select-header', textStyle({ variant: 'small', tone: 'subtle' }))}>\n {title}\n </RACHeader>\n <RACCollection items={items}>{children}</RACCollection>\n </RACSection>\n );\n}\n\nfunction ChevronDownIcon(props: SVGAttributes<SVGSVGElement>) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 12 12\" fill=\"currentColor\" data-icon {...props}>\n <path d=\"M.124 3.603 5.617 9.84a.533.533 0 0 0 .769 0l5.49-6.236a.493.493 0 0 0-.054-.707l-.925-.778a.514.514 0 0 0-.719.055L6.095 6.9a.125.125 0 0 1-.189 0L1.822 2.173A.51.51 0 0 0 1.474 2a.5.5 0 0 0-.37.119l-.926.777a.494.494 0 0 0-.054.707Z\" />\n </svg>\n );\n}\n"]}
1
+ {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AACrD,OAAO,EACL,MAAM,IAAI,SAAS,EACnB,UAAU,IAAI,aAAa,EAC3B,MAAM,IAAI,SAAS,EACnB,OAAO,IAAI,UAAU,EAErB,WAAW,IAAI,cAAc,EAC7B,cAAc,IAAI,iBAAiB,EACnC,MAAM,IAAI,SAAS,EACnB,WAAW,IAAI,cAAc,EAC7B,IAAI,IAAI,OAAO,GAGhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAE5G,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAwBnD,SAAS,MAAM,CACb,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAkB,EAClH,GAAiC;IAEjC,MAAM,EAAE,YAAY,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MAAC,iBAAiB,OAAK,KAAK,EAAE,SAAS,EAAC,oBAAoB,aAC1D,KAAC,SAAS,IACR,SAAS,EAAE,IAAI,CAAC,2BAA2B,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,YAErG,KAAK,GACI,EACZ,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAiB,IACrC,CACrB,CAAC;AACJ,CAAC;AAED,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { useEffect, type ForwardedRef } from 'react';\nimport {\n Button as RACButton,\n Collection as RACCollection,\n Header as RACHeader,\n ListBox as RACListBox,\n type ListBoxProps as RACListBoxProps,\n ListBoxItem as RACListBoxItem,\n ListBoxSection as RACListBoxSection,\n Select as RACSelect,\n SelectValue as RACSelectValue,\n Text as RACText,\n type ListBoxItemProps as RACListBoxItemProps,\n type SelectProps as RACSelectProps,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { IconCheckmark, IconChevronDownFill } from '../../icons/index.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { CollapsibleList } from '../internal/collapsible-list/collapsible-list.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';\nimport type { CollectionItem, CollectionProps, CommonProps, FieldProps, Key, StringLikeChildren } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface SelectProps<T extends CollectionItem = CollectionItem>\n extends CommonProps,\n FieldProps<Key>,\n CollectionProps<T>,\n Pick<\n RACSelectProps<T>,\n | 'name'\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'selectedKey'\n | 'defaultSelectedKey'\n | 'autoComplete'\n | 'autoFocus'\n | 'onSelectionChange'\n | 'placeholder'\n | 'onFocus'\n | 'onBlur'\n | 'onOpenChange'\n >,\n Pick<RACListBoxProps<T>, 'onScroll'> {}\n\nfunction Select<T extends CollectionItem>(\n { children, items, label, description, error, UNSAFE_className, UNSAFE_style, onScroll, ...props }: SelectProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('Select requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n if (items != null && typeof children !== 'function') {\n console.warn('`Select` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACSelect {...props} ref={ref} className={clsx('cim-select', UNSAFE_className)} style={UNSAFE_style}>\n <FormFieldLabel isRequired={props.isRequired} isDisabled={props.isDisabled}>\n {label}\n </FormFieldLabel>\n <RACButton className=\"cim-select-button\">\n <RACSelectValue\n className={(values) => clsx(values.defaultClassName, textStyle({ variant: 'medium', alignment: 'start' }))}\n >\n {({ selectedText }) => selectedText}\n </RACSelectValue>\n <IconChevronDownFill />\n </RACButton>\n <FormFieldError>{error}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n <CollapsibleList\n offset={5} // 1px border + 4px actual offset\n maxHeight={315}\n >\n <RACListBox className=\"cim-select-listbox\" onScroll={onScroll} items={items}>\n {children}\n </RACListBox>\n </CollapsibleList>\n </RACSelect>\n );\n}\n\n/**\n * Allows users to select one item from a collapsible list.\n *\n * See [select usage guidelines](https://ui.cimpress.io/components/select/).\n */\nconst _Select = withStyleProps(forwardRef(Select), 'Select');\n\nexport { _Select as Select };\n\nexport interface SelectItemProps\n extends Pick<RACListBoxItemProps, 'id' | 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {\n children: StringLikeChildren;\n}\n\n/** Renders a single list item within `Select`. */\nexport function SelectItem({ children, ...props }: SelectItemProps) {\n const textValue =\n typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');\n\n return (\n <RACListBoxItem {...props} className=\"cim-select-item\" textValue={textValue}>\n {({ isDisabled }) => (\n <>\n <IconCheckmark />\n\n <RACText slot=\"label\" className={textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'base' })}>\n {children}\n </RACText>\n </>\n )}\n </RACListBoxItem>\n );\n}\n\nSelectItem.displayName = 'SelectItem';\n\nexport interface SelectSectionProps<T extends CollectionItem> extends CollectionProps<T> {\n /** The ID of the section. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the section title. */\n title: string;\n}\n\n/** Groups list items within `Select` into a section. */\nexport function SelectSection<T extends CollectionItem>({ title, children, items, ...props }: SelectSectionProps<T>) {\n if (items != null && typeof children !== 'function') {\n console.warn('`SelectSection` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACListBoxSection {...props} className=\"cim-select-section\">\n <RACHeader\n className={clsx('cim-select-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' }))}\n >\n {title}\n </RACHeader>\n <RACCollection items={items}>{children}</RACCollection>\n </RACListBoxSection>\n );\n}\n\nSelectSection.displayName = 'SelectSection';\n"]}
@@ -1,8 +1,10 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { DOMProps } from '../../types.js';
3
- export interface BoxProps extends DOMProps {
2
+ import type { CommonProps } from '../../types.js';
3
+ export interface BoxProps extends CommonProps {
4
+ /** The contents of the box. */
4
5
  children: ReactNode;
5
6
  }
6
- declare const _Box: (props: BoxProps & import("react").RefAttributes<HTMLDivElement> & import("../../../with-style-props.js").StyleProps) => ReactNode;
7
+ /** A primitive layout component that exposes style props. */
8
+ declare const _Box: (props: BoxProps & import("react").RefAttributes<HTMLDivElement> & import("../../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
7
9
  export { _Box as Box };
8
10
  //# sourceMappingURL=box.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../../../../../src/components/spacing/box/box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,WAAW,QAAS,SAAQ,QAAQ;IACxC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAUD,QAAA,MAAM,IAAI,oIAAyC,CAAC;AAEpD,OAAO,EAAE,IAAI,IAAI,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../../../../../src/components/spacing/box/box.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,QAAS,SAAQ,WAAW;IAC3C,+BAA+B;IAC/B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAUD,6DAA6D;AAC7D,QAAA,MAAM,IAAI,6JAAyC,CAAC;AAEpD,OAAO,EAAE,IAAI,IAAI,GAAG,EAAE,CAAC"}
@@ -1,9 +1,11 @@
1
+ 'use client';
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import { forwardRef } from '../../../forward-ref.js';
3
4
  import { withStyleProps } from '../../../with-style-props.js';
4
5
  function Box({ children, UNSAFE_className, UNSAFE_style, ...props }, ref) {
5
6
  return (_jsx("div", { ...props, ref: ref, className: UNSAFE_className, style: UNSAFE_style, role: "presentation", children: children }));
6
7
  }
8
+ /** A primitive layout component that exposes style props. */
7
9
  const _Box = withStyleProps(forwardRef(Box), 'Box');
8
10
  export { _Box as Box };
9
11
  //# sourceMappingURL=box.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"box.js","sourceRoot":"","sources":["../../../../../src/components/spacing/box/box.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAO9D,SAAS,GAAG,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAY,EAAE,GAAiC;IAC9G,OAAO,CACL,iBAAS,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAC,cAAc,YAC5F,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAED,MAAM,IAAI,GAAG,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;AAEpD,OAAO,EAAE,IAAI,IAAI,GAAG,EAAE,CAAC","sourcesContent":["import type { ForwardedRef, ReactNode } from 'react';\nimport { forwardRef } from '../../../forward-ref.js';\nimport { withStyleProps } from '../../../with-style-props.js';\nimport type { DOMProps } from '../../types.js';\n\nexport interface BoxProps extends DOMProps {\n children: ReactNode;\n}\n\nfunction Box({ children, UNSAFE_className, UNSAFE_style, ...props }: BoxProps, ref: ForwardedRef<HTMLDivElement>) {\n return (\n <div {...props} ref={ref} className={UNSAFE_className} style={UNSAFE_style} role=\"presentation\">\n {children}\n </div>\n );\n}\n\nconst _Box = withStyleProps(forwardRef(Box), 'Box');\n\nexport { _Box as Box };\n"]}
1
+ {"version":3,"file":"box.js","sourceRoot":"","sources":["../../../../../src/components/spacing/box/box.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAQ9D,SAAS,GAAG,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAY,EAAE,GAAiC;IAC9G,OAAO,CACL,iBAAS,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAC,cAAc,YAC5F,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAED,6DAA6D;AAC7D,MAAM,IAAI,GAAG,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;AAEpD,OAAO,EAAE,IAAI,IAAI,GAAG,EAAE,CAAC","sourcesContent":["'use client';\n\nimport type { ForwardedRef, ReactNode } from 'react';\nimport { forwardRef } from '../../../forward-ref.js';\nimport { withStyleProps } from '../../../with-style-props.js';\nimport type { CommonProps } from '../../types.js';\n\nexport interface BoxProps extends CommonProps {\n /** The contents of the box. */\n children: ReactNode;\n}\n\nfunction Box({ children, UNSAFE_className, UNSAFE_style, ...props }: BoxProps, ref: ForwardedRef<HTMLDivElement>) {\n return (\n <div {...props} ref={ref} className={UNSAFE_className} style={UNSAFE_style} role=\"presentation\">\n {children}\n </div>\n );\n}\n\n/** A primitive layout component that exposes style props. */\nconst _Box = withStyleProps(forwardRef(Box), 'Box');\n\nexport { _Box as Box };\n"]}
@@ -1,11 +1,35 @@
1
1
  import type { ReactNode } from 'react';
2
- import type { DOMProps } from '../../types.js';
2
+ import type { Direction, CommonProps } from '../../types.js';
3
3
  import { type Responsive, type Spacing } from '../types.js';
4
- export interface StackProps extends DOMProps {
4
+ export type Alignment = 'start' | 'center' | 'end' | 'stretch';
5
+ export type Justify = 'start' | 'center' | 'end' | 'space-around' | 'space-between' | 'space-evenly';
6
+ export interface StackProps extends CommonProps {
7
+ /** The items to stack. */
5
8
  children: ReactNode;
6
- inline?: Responsive<boolean>;
9
+ /**
10
+ * Determines the stacking direction (ie. which direction is the primary axis)
11
+ * @default 'vertical'
12
+ */
13
+ direction?: Responsive<Direction>;
14
+ /** The amount of space between items. */
7
15
  gap: Responsive<Spacing>;
16
+ /**
17
+ * Determines how items are distributed along the primary axis.
18
+ * @default 'start'
19
+ */
20
+ justify?: Responsive<Justify>;
21
+ /**
22
+ * Determines how each item is aligned along the cross axis.
23
+ * @default 'stretch'
24
+ */
25
+ align?: Responsive<Alignment>;
26
+ /**
27
+ * Determines whether items will wrap to a new line if stack size is too small.
28
+ * @default true
29
+ */
30
+ wrap?: Responsive<boolean>;
8
31
  }
9
- declare const _Stack: (props: StackProps & import("react").RefAttributes<HTMLDivElement> & import("../../../with-style-props.js").StyleProps) => ReactNode;
32
+ /** Stacks its children with a specified amount of space between them. */
33
+ declare const _Stack: (props: StackProps & import("react").RefAttributes<HTMLDivElement> & import("../../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
10
34
  export { _Stack as Stack };
11
35
  //# sourceMappingURL=stack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../../../../src/components/spacing/stack/stack.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAgB,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAA0B,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpF,MAAM,WAAW,UAAW,SAAQ,QAAQ;IAC1C,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC7B,GAAG,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;CAC1B;AA0BD,QAAA,MAAM,MAAM,sIAA6C,CAAC;AAE1D,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAC"}
1
+ {"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../../../../src/components/spacing/stack/stack.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAgB,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAA0B,KAAK,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEpF,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;AAC/D,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,cAAc,GAAG,eAAe,GAAG,cAAc,CAAC;AAErG,MAAM,WAAW,UAAW,SAAQ,WAAW;IAC7C,0BAA0B;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAClC,yCAAyC;IACzC,GAAG,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IACzB;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC9B;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAC9B;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;CAC5B;AA0CD,yEAAyE;AACzE,QAAA,MAAM,MAAM,+JAA6C,CAAC;AAE1D,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAC"}
@@ -1,17 +1,25 @@
1
+ 'use client';
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import clsx from 'clsx';
3
4
  import { forwardRef } from '../../../forward-ref.js';
4
5
  import { withStyleProps } from '../../../with-style-props.js';
5
6
  import { getResponsiveVariables } from '../types.js';
6
- function Stack({ children, inline: responsiveInline, gap: responsiveGap, UNSAFE_className, UNSAFE_style, ...props }, ref) {
7
+ function Stack({ children, direction: responsiveDirection, gap: responsiveGap, justify: responsiveJustify, align: responsiveAlign, wrap: responsiveWrap, UNSAFE_className, UNSAFE_style, ...props }, ref) {
7
8
  const gap = getResponsiveVariables('stack-gap', 'space', responsiveGap, 0);
8
- const inline = getResponsiveVariables('stack-fd', 'stack-fd-inline', responsiveInline, false);
9
+ const direction = getResponsiveVariables('stack-fd', 'stack-direction', responsiveDirection, 'vertical');
10
+ const justify = getResponsiveVariables('stack-jc', 'stack-justify', responsiveJustify, 'start');
11
+ const align = getResponsiveVariables('stack-ai', 'stack-align', responsiveAlign, 'stretch');
12
+ const wrap = getResponsiveVariables('stack-fw', 'stack-wrap', responsiveWrap, true);
9
13
  return (_jsx("div", { ...props, ref: ref, className: clsx('cim-stack', UNSAFE_className), style: {
10
14
  ...UNSAFE_style,
11
15
  ...gap,
12
- ...inline,
16
+ ...direction,
17
+ ...justify,
18
+ ...align,
19
+ ...wrap,
13
20
  }, role: "presentation", children: children }));
14
21
  }
22
+ /** Stacks its children with a specified amount of space between them. */
15
23
  const _Stack = withStyleProps(forwardRef(Stack), 'Stack');
16
24
  export { _Stack as Stack };
17
25
  //# sourceMappingURL=stack.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stack.js","sourceRoot":"","sources":["../../../../../src/components/spacing/stack/stack.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,sBAAsB,EAAiC,MAAM,aAAa,CAAC;AAQpF,SAAS,KAAK,CACZ,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAc,EAChH,GAAiC;IAEjC,MAAM,GAAG,GAAG,sBAAsB,CAAC,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC;IAC3E,MAAM,MAAM,GAAG,sBAAsB,CAAC,UAAU,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;IAE9F,OAAO,CACL,iBACM,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,gBAAgB,CAAC,EAC9C,KAAK,EAAE;YACL,GAAG,YAAY;YACf,GAAG,GAAG;YACN,GAAG,MAAM;SACV,EACD,IAAI,EAAC,cAAc,YAElB,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;AAE1D,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAC","sourcesContent":["import clsx from 'clsx';\nimport type { ReactNode, ForwardedRef } from 'react';\nimport { forwardRef } from '../../../forward-ref.js';\nimport { withStyleProps } from '../../../with-style-props.js';\nimport type { DOMProps } from '../../types.js';\nimport { getResponsiveVariables, type Responsive, type Spacing } from '../types.js';\n\nexport interface StackProps extends DOMProps {\n children: ReactNode;\n inline?: Responsive<boolean>;\n gap: Responsive<Spacing>;\n}\n\nfunction Stack(\n { children, inline: responsiveInline, gap: responsiveGap, UNSAFE_className, UNSAFE_style, ...props }: StackProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const gap = getResponsiveVariables('stack-gap', 'space', responsiveGap, 0);\n const inline = getResponsiveVariables('stack-fd', 'stack-fd-inline', responsiveInline, false);\n\n return (\n <div\n {...props}\n ref={ref}\n className={clsx('cim-stack', UNSAFE_className)}\n style={{\n ...UNSAFE_style,\n ...gap,\n ...inline,\n }}\n role=\"presentation\"\n >\n {children}\n </div>\n );\n}\n\nconst _Stack = withStyleProps(forwardRef(Stack), 'Stack');\n\nexport { _Stack as Stack };\n"]}
1
+ {"version":3,"file":"stack.js","sourceRoot":"","sources":["../../../../../src/components/spacing/stack/stack.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,sBAAsB,EAAiC,MAAM,aAAa,CAAC;AAgCpF,SAAS,KAAK,CACZ,EACE,QAAQ,EACR,SAAS,EAAE,mBAAmB,EAC9B,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,cAAc,EACpB,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACG,EACb,GAAiC;IAEjC,MAAM,GAAG,GAAG,sBAAsB,CAAC,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC;IAC3E,MAAM,SAAS,GAAG,sBAAsB,CAAC,UAAU,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,UAAU,CAAC,CAAC;IACzG,MAAM,OAAO,GAAG,sBAAsB,CAAC,UAAU,EAAE,eAAe,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAC;IAChG,MAAM,KAAK,GAAG,sBAAsB,CAAC,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;IAC5F,MAAM,IAAI,GAAG,sBAAsB,CAAC,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;IAEpF,OAAO,CACL,iBACM,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,gBAAgB,CAAC,EAC9C,KAAK,EAAE;YACL,GAAG,YAAY;YACf,GAAG,GAAG;YACN,GAAG,SAAS;YACZ,GAAG,OAAO;YACV,GAAG,KAAK;YACR,GAAG,IAAI;SACR,EACD,IAAI,EAAC,cAAc,YAElB,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAED,yEAAyE;AACzE,MAAM,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;AAE1D,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ReactNode, ForwardedRef } from 'react';\nimport { forwardRef } from '../../../forward-ref.js';\nimport { withStyleProps } from '../../../with-style-props.js';\nimport type { Direction, CommonProps } from '../../types.js';\nimport { getResponsiveVariables, type Responsive, type Spacing } from '../types.js';\n\nexport type Alignment = 'start' | 'center' | 'end' | 'stretch';\nexport type Justify = 'start' | 'center' | 'end' | 'space-around' | 'space-between' | 'space-evenly';\n\nexport interface StackProps extends CommonProps {\n /** The items to stack. */\n children: ReactNode;\n /**\n * Determines the stacking direction (ie. which direction is the primary axis)\n * @default 'vertical'\n */\n direction?: Responsive<Direction>;\n /** The amount of space between items. */\n gap: Responsive<Spacing>;\n /**\n * Determines how items are distributed along the primary axis.\n * @default 'start'\n */\n justify?: Responsive<Justify>;\n /**\n * Determines how each item is aligned along the cross axis.\n * @default 'stretch'\n */\n align?: Responsive<Alignment>;\n /**\n * Determines whether items will wrap to a new line if stack size is too small.\n * @default true\n */\n wrap?: Responsive<boolean>;\n}\n\nfunction Stack(\n {\n children,\n direction: responsiveDirection,\n gap: responsiveGap,\n justify: responsiveJustify,\n align: responsiveAlign,\n wrap: responsiveWrap,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: StackProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const gap = getResponsiveVariables('stack-gap', 'space', responsiveGap, 0);\n const direction = getResponsiveVariables('stack-fd', 'stack-direction', responsiveDirection, 'vertical');\n const justify = getResponsiveVariables('stack-jc', 'stack-justify', responsiveJustify, 'start');\n const align = getResponsiveVariables('stack-ai', 'stack-align', responsiveAlign, 'stretch');\n const wrap = getResponsiveVariables('stack-fw', 'stack-wrap', responsiveWrap, true);\n\n return (\n <div\n {...props}\n ref={ref}\n className={clsx('cim-stack', UNSAFE_className)}\n style={{\n ...UNSAFE_style,\n ...gap,\n ...direction,\n ...justify,\n ...align,\n ...wrap,\n }}\n role=\"presentation\"\n >\n {children}\n </div>\n );\n}\n\n/** Stacks its children with a specified amount of space between them. */\nconst _Stack = withStyleProps(forwardRef(Stack), 'Stack');\n\nexport { _Stack as Stack };\n"]}
@@ -1,8 +1,13 @@
1
+ /** Represents a valid spacing amount within the design system. */
1
2
  export type Spacing = 0 | 2 | 4 | 8 | 12 | 16 | 24 | 32 | 40 | 48 | 64 | 96;
3
+ /** Represents a screen size breakpoint for responsive design. */
2
4
  export type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
5
+ /** Represents a primitive value that can change based on screen size. */
3
6
  export type Responsive<T extends string | number | boolean> = T | Partial<Record<Breakpoint, T>>;
4
7
  /**
5
8
  * Given params like so:
9
+ *
10
+ * ```ts
6
11
  * (
7
12
  * 'box-ml',
8
13
  * 'space',
@@ -11,12 +16,16 @@ export type Responsive<T extends string | number | boolean> = T | Partial<Record
11
16
  * lg: 6,
12
17
  * }
13
18
  * )
19
+ * ```
14
20
  *
15
21
  * Creates an object like so:
22
+ *
23
+ * ```ts
16
24
  * {
17
25
  * '--cim-box-ml-sm': 'var(--cim-space-4)',
18
26
  * '--cim-box-ml-lg': 'var(--cim-space-6)',
19
27
  * }
28
+ * ```
20
29
  *
21
30
  */
22
31
  export declare function getResponsiveVariables<T extends string | number | boolean>(targetTokenGroup: string, sourceTokenGroup: string, data?: Responsive<T>, defaultValue?: T): Record<string, string> | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/spacing/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAC5E,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE1D,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;AAEjG;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,EACxE,gBAAgB,EAAE,MAAM,EACxB,gBAAgB,EAAE,MAAM,EACxB,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EACpB,YAAY,CAAC,EAAE,CAAC,GACf,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAqBpC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/spacing/types.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAE5E,iEAAiE;AACjE,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE1D,yEAAyE;AACzE,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;AAEjG;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,EACxE,gBAAgB,EAAE,MAAM,EACxB,gBAAgB,EAAE,MAAM,EACxB,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EACpB,YAAY,CAAC,EAAE,CAAC,GACf,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAqBpC"}
@@ -1,5 +1,7 @@
1
1
  /**
2
2
  * Given params like so:
3
+ *
4
+ * ```ts
3
5
  * (
4
6
  * 'box-ml',
5
7
  * 'space',
@@ -8,12 +10,16 @@
8
10
  * lg: 6,
9
11
  * }
10
12
  * )
13
+ * ```
11
14
  *
12
15
  * Creates an object like so:
16
+ *
17
+ * ```ts
13
18
  * {
14
19
  * '--cim-box-ml-sm': 'var(--cim-space-4)',
15
20
  * '--cim-box-ml-lg': 'var(--cim-space-6)',
16
21
  * }
22
+ * ```
17
23
  *
18
24
  */
19
25
  export function getResponsiveVariables(targetTokenGroup, sourceTokenGroup, data, defaultValue) {
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/spacing/types.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,sBAAsB,CACpC,gBAAwB,EACxB,gBAAwB,EACxB,IAAoB,EACpB,YAAgB;IAEhB,IAAI,IAAI,KAAK,SAAS,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QACrD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO;YACL,CAAC,SAAS,gBAAgB,KAAK,CAAC,EAAE,aAAa,gBAAgB,IAAI,IAAI,IAAI,YAAY,GAAG;SAC3F,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAA2B;QACrC,8DAA8D;QAC9D,CAAC,SAAS,gBAAgB,KAAK,CAAC,EAAE,aAAa,gBAAgB,IAAI,YAAY,GAAG;KACnF,CAAC;IAEF,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,EAAE,KAAK,CAAC,EAAE,EAAE;QACnD,MAAM,CAAC,SAAS,gBAAgB,IAAI,UAAU,EAAE,CAAC,GAAG,aAAa,gBAAgB,IAAI,KAAK,GAAG,CAAC;IAChG,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["export type Spacing = 0 | 2 | 4 | 8 | 12 | 16 | 24 | 32 | 40 | 48 | 64 | 96;\nexport type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\nexport type Responsive<T extends string | number | boolean> = T | Partial<Record<Breakpoint, T>>;\n\n/**\n * Given params like so:\n * (\n * 'box-ml',\n * 'space',\n * {\n * sm: 4,\n * lg: 6,\n * }\n * )\n *\n * Creates an object like so:\n * {\n * '--cim-box-ml-sm': 'var(--cim-space-4)',\n * '--cim-box-ml-lg': 'var(--cim-space-6)',\n * }\n *\n */\nexport function getResponsiveVariables<T extends string | number | boolean>(\n targetTokenGroup: string,\n sourceTokenGroup: string,\n data?: Responsive<T>,\n defaultValue?: T,\n): Record<string, string> | undefined {\n if (data === undefined && defaultValue === undefined) {\n return undefined;\n }\n\n if (typeof data !== 'object') {\n return {\n [`--cim-${targetTokenGroup}-xs`]: `var(--cim-${sourceTokenGroup}-${data ?? defaultValue})`,\n };\n }\n\n const result: Record<string, string> = {\n // Default value in case the smallest breakpoint isn't defined\n [`--cim-${targetTokenGroup}-xs`]: `var(--cim-${sourceTokenGroup}-${defaultValue})`,\n };\n\n Object.entries(data).forEach(([breakpoint, value]) => {\n result[`--cim-${targetTokenGroup}-${breakpoint}`] = `var(--cim-${sourceTokenGroup}-${value})`;\n });\n\n return result;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/spacing/types.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,sBAAsB,CACpC,gBAAwB,EACxB,gBAAwB,EACxB,IAAoB,EACpB,YAAgB;IAEhB,IAAI,IAAI,KAAK,SAAS,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QACrD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO;YACL,CAAC,SAAS,gBAAgB,KAAK,CAAC,EAAE,aAAa,gBAAgB,IAAI,IAAI,IAAI,YAAY,GAAG;SAC3F,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAA2B;QACrC,8DAA8D;QAC9D,CAAC,SAAS,gBAAgB,KAAK,CAAC,EAAE,aAAa,gBAAgB,IAAI,YAAY,GAAG;KACnF,CAAC;IAEF,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,EAAE,KAAK,CAAC,EAAE,EAAE;QACnD,MAAM,CAAC,SAAS,gBAAgB,IAAI,UAAU,EAAE,CAAC,GAAG,aAAa,gBAAgB,IAAI,KAAK,GAAG,CAAC;IAChG,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/** Represents a valid spacing amount within the design system. */\nexport type Spacing = 0 | 2 | 4 | 8 | 12 | 16 | 24 | 32 | 40 | 48 | 64 | 96;\n\n/** Represents a screen size breakpoint for responsive design. */\nexport type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/** Represents a primitive value that can change based on screen size. */\nexport type Responsive<T extends string | number | boolean> = T | Partial<Record<Breakpoint, T>>;\n\n/**\n * Given params like so:\n *\n * ```ts\n * (\n * 'box-ml',\n * 'space',\n * {\n * sm: 4,\n * lg: 6,\n * }\n * )\n * ```\n *\n * Creates an object like so:\n *\n * ```ts\n * {\n * '--cim-box-ml-sm': 'var(--cim-space-4)',\n * '--cim-box-ml-lg': 'var(--cim-space-6)',\n * }\n * ```\n *\n */\nexport function getResponsiveVariables<T extends string | number | boolean>(\n targetTokenGroup: string,\n sourceTokenGroup: string,\n data?: Responsive<T>,\n defaultValue?: T,\n): Record<string, string> | undefined {\n if (data === undefined && defaultValue === undefined) {\n return undefined;\n }\n\n if (typeof data !== 'object') {\n return {\n [`--cim-${targetTokenGroup}-xs`]: `var(--cim-${sourceTokenGroup}-${data ?? defaultValue})`,\n };\n }\n\n const result: Record<string, string> = {\n // Default value in case the smallest breakpoint isn't defined\n [`--cim-${targetTokenGroup}-xs`]: `var(--cim-${sourceTokenGroup}-${defaultValue})`,\n };\n\n Object.entries(data).forEach(([breakpoint, value]) => {\n result[`--cim-${targetTokenGroup}-${breakpoint}`] = `var(--cim-${sourceTokenGroup}-${value})`;\n });\n\n return result;\n}\n"]}
@@ -1,9 +1,16 @@
1
- import type { DOMProps } from '../types.js';
2
- interface SpinnerProps extends DOMProps {
1
+ import type { CommonProps, LabellableProps } from '../types.js';
2
+ export interface SpinnerProps extends CommonProps, LabellableProps {
3
+ /**
4
+ * Determines the size of the spinner.
5
+ * @default 'medium'
6
+ */
3
7
  size?: 'small' | 'medium' | 'large';
4
- /** A string value that identifies the spinner's purpose for assistive technologies. */
5
- 'aria-label': string;
6
8
  }
7
- declare const _Spinner: (props: SpinnerProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").ReactNode;
9
+ /**
10
+ * Displays a loading indicator to represent an ongoing operation.
11
+ *
12
+ * See [spinner usage guidelines](https://ui.cimpress.io/components/spinner/).
13
+ */
14
+ declare const _Spinner: (props: SpinnerProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
8
15
  export { _Spinner as Spinner };
9
16
  //# sourceMappingURL=spinner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../../src/components/spinner/spinner.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,UAAU,YAAa,SAAQ,QAAQ;IACrC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,uFAAuF;IACvF,YAAY,EAAE,MAAM,CAAC;CACtB;AAyDD,QAAA,MAAM,QAAQ,qJAAiD,CAAC;AAEhE,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../../src/components/spinner/spinner.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAIhE,MAAM,WAAW,YAAa,SAAQ,WAAW,EAAE,eAAe;IAChE;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;CACrC;AA8BD;;;;GAIG;AACH,QAAA,MAAM,QAAQ,8JAAiD,CAAC;AAEhE,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,CAAC"}
@@ -1,20 +1,35 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import clsx from 'clsx';
3
- import { ProgressBar as RACProgressBar } from 'react-aria-components';
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useEffect } from 'react';
4
+ import { Label as RACLabel } from 'react-aria-components';
4
5
  import { forwardRef } from '../../forward-ref.js';
5
6
  import { withStyleProps } from '../../with-style-props.js';
6
- const spinnerDimensions = {
7
- small: '16px',
8
- medium: '38px',
9
- large: '72px',
7
+ import { InternalSpinner } from '../internal/spinner/spinner.js';
8
+ import { textStyle } from '../typography/utils.js';
9
+ const ringSizes = {
10
+ small: '24px',
11
+ medium: '48px',
12
+ large: '80px',
10
13
  };
11
- const offset = 0;
12
- const duration = 2;
13
- const modOffset = offset % 1;
14
- const begin = (1 - modOffset) * duration - duration;
15
- function Spinner({ size = 'large', UNSAFE_className, UNSAFE_style, ...props }, ref) {
16
- return (_jsx(RACProgressBar, { ...props, isIndeterminate: true, ref: ref, className: clsx('cim-spinner', UNSAFE_className), style: UNSAFE_style, children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: spinnerDimensions[size], height: spinnerDimensions[size], viewBox: "0 0 100 100", preserveAspectRatio: "xMidYMid", "aria-hidden": true, children: [_jsx("circle", { className: "cim-spinner-ring-bg", cx: "50", cy: "50", r: "40" }), _jsxs("circle", { className: "cim-spinner-ring-animated", cx: "50", cy: "50", r: "40", children: [_jsx("animate", { attributeName: "stroke-dashoffset", dur: duration, repeatCount: "indefinite", from: "0", to: "-502", begin: begin }), _jsx("animate", { attributeName: "stroke-dasharray", dur: duration, repeatCount: "indefinite", values: "75.3 175.7;1 250;75.3 175.7", begin: begin })] })] }) }));
14
+ const labelVariants = {
15
+ small: 'small',
16
+ medium: 'medium',
17
+ large: 'body',
18
+ };
19
+ function Spinner({ size = 'medium', label, ...props }, ref) {
20
+ const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
21
+ useEffect(() => {
22
+ if (!label && !ariaLabel && !ariaLabelledBy) {
23
+ console.warn('Spinner requires one of label / aria-label / aria-labelledby for accessibility');
24
+ }
25
+ }, [label, ariaLabel, ariaLabelledBy]);
26
+ return (_jsx(InternalSpinner, { ...props, size: ringSizes[size], spinnerRef: ref, children: label && _jsx(RACLabel, { className: textStyle({ variant: labelVariants[size], tone: 'title' }), children: label }) }));
17
27
  }
28
+ /**
29
+ * Displays a loading indicator to represent an ongoing operation.
30
+ *
31
+ * See [spinner usage guidelines](https://ui.cimpress.io/components/spinner/).
32
+ */
18
33
  const _Spinner = withStyleProps(forwardRef(Spinner), 'Spinner');
19
34
  export { _Spinner as Spinner };
20
35
  //# sourceMappingURL=spinner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../../../src/components/spinner/spinner.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAS3D,MAAM,iBAAiB,GAAG;IACxB,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,MAAM,MAAM,GAAG,CAAC,CAAC;AACjB,MAAM,QAAQ,GAAG,CAAC,CAAC;AACnB,MAAM,SAAS,GAAG,MAAM,GAAG,CAAC,CAAC;AAC7B,MAAM,KAAK,GAAG,CAAC,CAAC,GAAG,SAAS,CAA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ressBar } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { DOMProps } from '../types.js';\n\ninterface SpinnerProps extends DOMProps {\n size?: 'small' | 'medium' | 'large';\n /** A string value that identifies the spinner's purpose for assistive technologies. */\n 'aria-label': string;\n}\n\nconst spinnerDimensions = {\n small: '16px',\n medium: '38px',\n large: '72px',\n};\n\nconst offset = 0;\nconst duration = 2;\nconst modOffset = offset % 1;\nconst begin = (1 - modOffset) * duration - duration;\n\nfunction Spinner(\n { size = 'large', UNSAFE_className, UNSAFE_style, ...props }: SpinnerProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n return (\n <RACProgressBar\n {...props}\n isIndeterminate\n ref={ref}\n className={clsx('cim-spinner', UNSAFE_className)}\n style={UNSAFE_style}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={spinnerDimensions[size]}\n height={spinnerDimensions[size]}\n viewBox=\"0 0 100 100\"\n preserveAspectRatio=\"xMidYMid\"\n aria-hidden\n >\n <circle className=\"cim-spinner-ring-bg\" cx=\"50\" cy=\"50\" r=\"40\" />\n\n <circle className=\"cim-spinner-ring-animated\" cx=\"50\" cy=\"50\" r=\"40\">\n <animate\n attributeName=\"stroke-dashoffset\"\n dur={duration}\n repeatCount=\"indefinite\"\n from=\"0\"\n to=\"-502\"\n begin={begin}\n />\n <animate\n attributeName=\"stroke-dasharray\"\n dur={duration}\n repeatCount=\"indefinite\"\n values=\"75.3 175.7;1 250;75.3 175.7\"\n begin={begin}\n />\n </circle>\n </svg>\n </RACProgressBar>\n );\n}\n\nconst _Spinner = withStyleProps(forwardRef(Spinner), 'Spinner');\n\nexport { _Spinner as Spinner };\n"]}
1
+ {"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../../../src/components/spinner/spinner.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE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Ac,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC;AAEhE,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,CAAC","sourcesContent":["'use client';\n\nimport { useEffect, type ForwardedRef } from 'react';\nimport { Label as RACLabel } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { InternalSpinner } from '../internal/spinner/spinner.js';\nimport type { CommonProps, LabellableProps } from '../types.js';\nimport type { TextStyleOptions } from '../typography/types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface SpinnerProps extends CommonProps, LabellableProps {\n /**\n * Determines the size of the spinner.\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n}\n\nconst ringSizes: Record<NonNullable<SpinnerProps['size']>, string> = {\n small: '24px',\n medium: '48px',\n large: '80px',\n};\n\nconst labelVariants: Record<NonNullable<SpinnerProps['size']>, TextStyleOptions['variant']> = {\n small: 'small',\n medium: 'medium',\n large: 'body',\n};\n\nfunction Spinner({ size = 'medium', label, ...props }: SpinnerProps, ref: ForwardedRef<HTMLDivElement>) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('Spinner requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n return (\n <InternalSpinner {...props} size={ringSizes[size]} spinnerRef={ref}>\n {label && <RACLabel className={textStyle({ variant: labelVariants[size], tone: 'title' })}>{label}</RACLabel>}\n </InternalSpinner>\n );\n}\n\n/**\n * Displays a loading indicator to represent an ongoing operation.\n *\n * See [spinner usage guidelines](https://ui.cimpress.io/components/spinner/).\n */\nconst _Spinner = withStyleProps(forwardRef(Spinner), 'Spinner');\n\nexport { _Spinner as Spinner };\n"]}
@@ -1,7 +1,8 @@
1
1
  import { type TextAreaProps as RACTextAreaProps, type TextFieldProps as RACTextFieldProps } from 'react-aria-components';
2
- import type { DOMProps, FieldWithPlaceholderProps } from '../types.js';
3
- export interface TextAreaProps extends DOMProps, FieldWithPlaceholderProps<string>, Pick<RACTextFieldProps, 'value' | 'defaultValue' | 'onChange' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'isReadOnly' | 'name' | 'type' | 'autoFocus' | 'autoComplete' | 'inputMode' | 'minLength' | 'maxLength'>, Pick<RACTextAreaProps, 'autoCapitalize' | 'autoCorrect' | 'spellCheck' | 'wrap'> {
2
+ import type { CommonProps, FieldWithPlaceholderProps } from '../types.js';
3
+ export interface TextAreaProps extends CommonProps, FieldWithPlaceholderProps<string>, Pick<RACTextFieldProps, 'value' | 'defaultValue' | 'onChange' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'isReadOnly' | 'name' | 'type' | 'autoFocus' | 'autoComplete' | 'inputMode' | 'minLength' | 'maxLength' | 'onFocus' | 'onBlur'>, Pick<RACTextAreaProps, 'autoCapitalize' | 'autoCorrect' | 'rows' | 'spellCheck' | 'wrap'> {
4
4
  }
5
- declare const _TextArea: (props: TextAreaProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").ReactNode;
5
+ /** Allows users to enter multiple lines of text with a keyboard. */
6
+ declare const _TextArea: (props: TextAreaProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
6
7
  export { _TextArea as TextArea };
7
8
  //# sourceMappingURL=text-area.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-area.d.ts","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-area.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,aAAa,IAAI,gBAAgB,EACtC,KAAK,cAAc,IAAI,iBAAiB,EACzC,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAGvE,MAAM,WAAW,aACf,SAAQ,QAAQ,EACd,yBAAyB,CAAC,MAAM,CAAC,EACjC,IAAI,CACF,iBAAiB,EACf,OAAO,GACP,cAAc,GACd,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,MAAM,GACN,MAAM,GACN,WAAW,GACX,cAAc,GACd,WAAW,GACX,WAAW,GACX,WAAW,CACd,EACD,IAAI,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,aAAa,GAAG,YAAY,GAAG,MAAM,CAAC;CAAG;AAqCvF,QAAA,MAAM,SAAS,sJAAmD,CAAC;AAEnE,OAAO,EAAE,SAAS,IAAI,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"text-area.d.ts","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-area.tsx"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,aAAa,IAAI,gBAAgB,EACtC,KAAK,cAAc,IAAI,iBAAiB,EACzC,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAG1E,MAAM,WAAW,aACf,SAAQ,WAAW,EACjB,yBAAyB,CAAC,MAAM,CAAC,EACjC,IAAI,CACF,iBAAiB,EACf,OAAO,GACP,cAAc,GACd,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,MAAM,GACN,MAAM,GACN,WAAW,GACX,cAAc,GACd,WAAW,GACX,WAAW,GACX,WAAW,GACX,SAAS,GACT,QAAQ,CACX,EACD,IAAI,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,aAAa,GAAG,MAAM,GAAG,YAAY,GAAG,MAAM,CAAC;CAAG;AAgDhG,oEAAoE;AACpE,QAAA,MAAM,SAAS,+JAAmD,CAAC;AAEnE,OAAO,EAAE,SAAS,IAAI,QAAQ,EAAE,CAAC"}
@@ -1,13 +1,23 @@
1
+ 'use client';
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import clsx from 'clsx';
4
+ import { useEffect } from 'react';
3
5
  import { TextArea as RACTextArea, TextField as RACTextField, } from 'react-aria-components';
4
6
  import { forwardRef } from '../../forward-ref.js';
5
7
  import { withStyleProps } from '../../with-style-props.js';
6
- import { FormFieldDescription, FormFieldError, FormFieldLabel } from '../form-field/form-field.js';
8
+ import { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';
7
9
  import { textStyle } from '../typography/utils.js';
8
- function TextArea({ label, description, error: errorMessage, placeholder, autoCapitalize, autoCorrect, spellCheck, wrap, UNSAFE_className, UNSAFE_style, ...props }, ref) {
9
- return (_jsxs(RACTextField, { ...props, ref: ref, className: clsx('cim-text-area', UNSAFE_className), style: UNSAFE_style, children: [_jsx(FormFieldLabel, { isRequired: props.isRequired, isDisabled: props.isDisabled, children: label }), _jsx(RACTextArea, { className: clsx('cim-text-area-input', textStyle({ variant: 'medium', tone: 'base' })), placeholder: placeholder, autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, spellCheck: spellCheck, wrap: wrap }), _jsx(FormFieldError, { children: errorMessage }), _jsx(FormFieldDescription, { children: description })] }));
10
+ function TextArea({ label, description, error: errorMessage, placeholder, autoCapitalize, autoCorrect, rows, spellCheck, wrap, UNSAFE_className, UNSAFE_style, ...props }, ref) {
11
+ const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
12
+ useEffect(() => {
13
+ if (!label && !ariaLabel && !ariaLabelledBy) {
14
+ console.warn('TextArea requires one of label / aria-label / aria-labelledby for accessibility');
15
+ }
16
+ }, [label, ariaLabel, ariaLabelledBy]);
17
+ return (_jsxs(RACTextField, { ...props, ref: ref, className: clsx('cim-text-area', UNSAFE_className), style: UNSAFE_style, children: [_jsx(FormFieldLabel, { isRequired: props.isRequired, isDisabled: props.isDisabled, children: label }), _jsx(RACTextArea, { className: clsx('cim-text-area-input', textStyle({ variant: 'medium', tone: 'base' })), placeholder: placeholder, autoCapitalize: autoCapitalize, autoCorrect: autoCorrect, rows: rows, spellCheck: spellCheck, wrap: wrap }), _jsx(FormFieldError, { children: errorMessage }), _jsx(FormFieldDescription, { children: description })] }));
10
18
  }
19
+ // TODO: add link to usage guidelines
20
+ /** Allows users to enter multiple lines of text with a keyboard. */
11
21
  const _TextArea = withStyleProps(forwardRef(TextArea), 'TextArea');
12
22
  export { _TextArea as TextArea };
13
23
  //# sourceMappingURL=text-area.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-area.js","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-area.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EACL,QAAQ,IAAI,WAAW,EACvB,SAAS,IAAI,YAAY,GAG1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAEnG,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAwBnD,SAAS,QAAQ,CACf,EACE,KAAK,EACL,WAAW,EACX,KAAK,EAAE,YAAY,EACnB,WAAW,EACX,cAAc,EACd,WAAW,EACX,UAAU,EACV,IAAI,EACJ,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACM,EAChB,GAAiC;IAEjC,OAAO,CACL,MAAC,YAAY,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,eAAe,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,aACxG,KAAC,cAAc,IAAC,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,YACvE,KAAK,GACS,EACjB,KAAC,WAAW,IACV,SAAS,EAAE,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,EACtF,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,GACV,EACF,KAAC,cAAc,cAAE,YAAY,GAAkB,EAC/C,KAAC,oBAAoB,cAAE,WAAW,GAAwB,IAC7C,CAChB,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAG,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;AAEnE,OAAO,EAAE,SAAS,IAAI,QAAQ,EAAE,CAAC","sourcesContent":["import clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\nimport {\n TextArea as RACTextArea,\n TextField as RACTextField,\n type TextAreaProps as RACTextAreaProps,\n type TextFieldProps as RACTextFieldProps,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../form-field/form-field.js';\nimport type { DOMProps, FieldWithPlaceholderProps } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface TextAreaProps\n extends DOMProps,\n FieldWithPlaceholderProps<string>,\n Pick<\n RACTextFieldProps,\n | 'value'\n | 'defaultValue'\n | 'onChange'\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'isReadOnly'\n | 'name'\n | 'type'\n | 'autoFocus'\n | 'autoComplete'\n | 'inputMode'\n | 'minLength'\n | 'maxLength'\n >,\n Pick<RACTextAreaProps, 'autoCapitalize' | 'autoCorrect' | 'spellCheck' | 'wrap'> {}\n\nfunction TextArea(\n {\n label,\n description,\n error: errorMessage,\n placeholder,\n autoCapitalize,\n autoCorrect,\n spellCheck,\n wrap,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: TextAreaProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n return (\n <RACTextField {...props} ref={ref} className={clsx('cim-text-area', UNSAFE_className)} style={UNSAFE_style}>\n <FormFieldLabel isRequired={props.isRequired} isDisabled={props.isDisabled}>\n {label}\n </FormFieldLabel>\n <RACTextArea\n className={clsx('cim-text-area-input', textStyle({ variant: 'medium', tone: 'base' }))}\n placeholder={placeholder}\n autoCapitalize={autoCapitalize}\n autoCorrect={autoCorrect}\n spellCheck={spellCheck}\n wrap={wrap}\n />\n <FormFieldError>{errorMessage}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n </RACTextField>\n );\n}\n\nconst _TextArea = withStyleProps(forwardRef(TextArea), 'TextArea');\n\nexport { _TextArea as TextArea };\n"]}
1
+ {"version":3,"file":"text-area.js","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-area.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AACrD,OAAO,EACL,QAAQ,IAAI,WAAW,EACvB,SAAS,IAAI,YAAY,GAG1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAE5G,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AA0BnD,SAAS,QAAQ,CACf,EACE,KAAK,EACL,WAAW,EACX,KAAK,EAAE,YAAY,EACnB,WAAW,EACX,cAAc,EACd,WAAW,EACX,IAAI,EACJ,UAAU,EACV,IAAI,EACJ,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACM,EAChB,GAAiC;IAEjC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE7E,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,IAAI,CAAC,cAAc,EAAE,CAAC;YAC5C,OAAO,CAAC,IAAI,CAAC,iFAAiF,CAAC,CAAC;QAClG,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IAEvC,OAAO,CACL,MAAC,YAAY,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,eAAe,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,aACxG,KAAC,cAAc,IAAC,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,YACvE,KAAK,GACS,EACjB,KAAC,WAAW,IACV,SAAS,EAAE,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,EACtF,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,IAAI,GACV,EACF,KAAC,cAAc,cAAE,YAAY,GAAkB,EAC/C,KAAC,oBAAoB,cAAE,WAAW,GAAwB,IAC7C,CAChB,CAAC;AACJ,CAAC;AAED,qCAAqC;AACrC,oEAAoE;AACpE,MAAM,SAAS,GAAG,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;AAEnE,OAAO,EAAE,SAAS,IAAI,QAAQ,EAAE,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { useEffect, type ForwardedRef } from 'react';\nimport {\n TextArea as RACTextArea,\n TextField as RACTextField,\n type TextAreaProps as RACTextAreaProps,\n type TextFieldProps as RACTextFieldProps,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';\nimport type { CommonProps, FieldWithPlaceholderProps } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface TextAreaProps\n extends CommonProps,\n FieldWithPlaceholderProps<string>,\n Pick<\n RACTextFieldProps,\n | 'value'\n | 'defaultValue'\n | 'onChange'\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'isReadOnly'\n | 'name'\n | 'type'\n | 'autoFocus'\n | 'autoComplete'\n | 'inputMode'\n | 'minLength'\n | 'maxLength'\n | 'onFocus'\n | 'onBlur'\n >,\n Pick<RACTextAreaProps, 'autoCapitalize' | 'autoCorrect' | 'rows' | 'spellCheck' | 'wrap'> {}\n\nfunction TextArea(\n {\n label,\n description,\n error: errorMessage,\n placeholder,\n autoCapitalize,\n autoCorrect,\n rows,\n spellCheck,\n wrap,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: TextAreaProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('TextArea requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACTextField {...props} ref={ref} className={clsx('cim-text-area', UNSAFE_className)} style={UNSAFE_style}>\n <FormFieldLabel isRequired={props.isRequired} isDisabled={props.isDisabled}>\n {label}\n </FormFieldLabel>\n <RACTextArea\n className={clsx('cim-text-area-input', textStyle({ variant: 'medium', tone: 'base' }))}\n placeholder={placeholder}\n autoCapitalize={autoCapitalize}\n autoCorrect={autoCorrect}\n rows={rows}\n spellCheck={spellCheck}\n wrap={wrap}\n />\n <FormFieldError>{errorMessage}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n </RACTextField>\n );\n}\n\n// TODO: add link to usage guidelines\n/** Allows users to enter multiple lines of text with a keyboard. */\nconst _TextArea = withStyleProps(forwardRef(TextArea), 'TextArea');\n\nexport { _TextArea as TextArea };\n"]}
@@ -1,7 +1,12 @@
1
1
  import { type TextFieldProps as RACTextFieldProps } from 'react-aria-components';
2
- import type { DOMProps, FieldWithPlaceholderProps } from '../types.js';
3
- export interface TextFieldProps extends DOMProps, FieldWithPlaceholderProps<string>, Pick<RACTextFieldProps, 'value' | 'defaultValue' | 'onChange' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'isReadOnly' | 'name' | 'type' | 'autoFocus' | 'autoComplete' | 'inputMode' | 'minLength' | 'maxLength' | 'pattern'> {
2
+ import type { CommonProps, FieldWithPlaceholderProps } from '../types.js';
3
+ export interface TextFieldProps extends CommonProps, FieldWithPlaceholderProps<string>, Pick<RACTextFieldProps, 'value' | 'defaultValue' | 'onChange' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'isReadOnly' | 'name' | 'type' | 'autoFocus' | 'autoComplete' | 'inputMode' | 'minLength' | 'maxLength' | 'pattern' | 'onFocus' | 'onBlur'> {
4
4
  }
5
- declare const _TextField: (props: TextFieldProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").ReactNode;
5
+ /**
6
+ * Allows users to enter a single line of text with a keyboard.
7
+ *
8
+ * See [text field usage guidelines](https://ui.cimpress.io/components/text-field/).
9
+ */
10
+ declare const _TextField: (props: TextFieldProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
6
11
  export { _TextField as TextField };
7
12
  //# sourceMappingURL=text-field.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-field.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,cAAc,IAAI,iBAAiB,EACzC,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAGvE,MAAM,WAAW,cACf,SAAQ,QAAQ,EACd,yBAAyB,CAAC,MAAM,CAAC,EACjC,IAAI,CACF,iBAAiB,EACf,OAAO,GACP,cAAc,GACd,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,MAAM,GACN,MAAM,GACN,WAAW,GACX,cAAc,GACd,WAAW,GACX,WAAW,GACX,WAAW,GACX,SAAS,CACZ;CAAG;AAqBR,QAAA,MAAM,UAAU,uJAAqD,CAAC;AAEtE,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../../../src/components/text-inputs/text-field.tsx"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,cAAc,IAAI,iBAAiB,EACzC,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAG1E,MAAM,WAAW,cACf,SAAQ,WAAW,EACjB,yBAAyB,CAAC,MAAM,CAAC,EACjC,IAAI,CACF,iBAAiB,EACf,OAAO,GACP,cAAc,GACd,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,MAAM,GACN,MAAM,GACN,WAAW,GACX,cAAc,GACd,WAAW,GACX,WAAW,GACX,WAAW,GACX,SAAS,GACT,SAAS,GACT,QAAQ,CACX;CAAG;AA6BR;;;;GAIG;AACH,QAAA,MAAM,UAAU,gKAAqD,CAAC;AAEtE,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,CAAC"}