@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,10 +1,10 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { ButtonProps as RACButtonProps } from 'react-aria-components';
3
- import type { DOMProps } from '../types.js';
3
+ import type { CommonProps, LabellableProps, StringLikeChildren } from '../types.js';
4
4
  /**
5
5
  * Props available on all buttons.
6
6
  */
7
- export interface BaseButtonProps extends DOMProps {
7
+ export interface BaseButtonProps extends CommonProps {
8
8
  /**
9
9
  * Determines the visual appearance of the button.
10
10
  * @default 'secondary'
@@ -30,9 +30,9 @@ export interface BaseButtonProps extends DOMProps {
30
30
  /**
31
31
  * Props available on buttons containing text.
32
32
  */
33
- export interface TextButtonProps {
33
+ export interface TextButtonProps extends Omit<LabellableProps, 'label'> {
34
34
  /** The text displayed on the button. */
35
- children: string;
35
+ children: StringLikeChildren;
36
36
  /** An icon displayed before the button text. */
37
37
  iconStart?: ReactNode;
38
38
  /** An icon displayed after the button text. */
@@ -41,7 +41,7 @@ export interface TextButtonProps {
41
41
  /**
42
42
  * Props available on buttons containing a single icon.
43
43
  */
44
- export interface SingleIconButtonProps {
44
+ export interface SingleIconButtonProps extends Omit<LabellableProps, 'label' | 'aria-label'> {
45
45
  /** The icon displayed on the button. */
46
46
  icon: ReactNode;
47
47
  /** The label describing the function of this button for assistive technologies. */
@@ -50,7 +50,7 @@ export interface SingleIconButtonProps {
50
50
  /**
51
51
  * Props available on buttons that perform an action (non-navigational).
52
52
  */
53
- export interface ActionButtonProps extends Pick<RACButtonProps, 'form' | 'name' | 'value' | 'onPress' | 'type' | 'isDisabled'> {
53
+ export interface ActionButtonProps extends Pick<RACButtonProps, 'form' | 'name' | 'value' | 'onPress' | 'type' | 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {
54
54
  /**
55
55
  * Whether the button is in a loading state.
56
56
  * This disables the button and replaces its contents with a spinner.
@@ -58,5 +58,11 @@ export interface ActionButtonProps extends Pick<RACButtonProps, 'form' | 'name'
58
58
  * @default false
59
59
  */
60
60
  isLoading?: boolean;
61
+ /**
62
+ * A string that identifies the loading state to assistive technologies.
63
+ * It will be announced by screen readers together with the button label.
64
+ * You must provide this prop if `isLoading` is `true`.
65
+ */
66
+ loadingLabel?: string;
61
67
  }
62
68
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,WAAW,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;IAC/C;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC3B;;;OAGG;IAC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B;AAED;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC;IACrE,wCAAwC;IACxC,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,gDAAgD;IAChD,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,YAAY,CAAC;IAC1F,wCAAwC;IACxC,IAAI,EAAE,SAAS,CAAC;IAChB,mFAAmF;IACnF,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,iBACf,SAAQ,IAAI,CACV,cAAc,EACd,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,YAAY,GAAG,cAAc,GAAG,YAAY,CAC9F;IACD;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/button/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\nimport type { ButtonProps as RACButtonProps } from 'react-aria-components';\nimport type { DOMProps } from '../types.js';\n\n/**\n * Props available on all buttons.\n */\nexport interface BaseButtonProps extends DOMProps {\n /**\n * Determines the visual appearance of the button.\n * @default 'secondary'\n */\n variant?: 'primary' | 'secondary' | 'tertiary';\n /**\n * Determines the color tone of the button.\n * @default 'base'\n */\n tone?: 'base' | 'critical';\n /**\n * The size of the button.\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n /**\n * Whether the button should take up the whole available width.\n *\n * @default false\n */\n fullWidth?: boolean;\n}\n\n/**\n * Props available on buttons containing text.\n */\nexport interface TextButtonProps {\n /** The text displayed on the button. */\n children: string;\n /** An icon displayed before the button text. */\n iconStart?: ReactNode;\n /** An icon displayed after the button text. */\n iconEnd?: ReactNode;\n}\n\n/**\n * Props available on buttons containing a single icon.\n */\nexport interface SingleIconButtonProps {\n /** The icon displayed on the button. */\n icon: ReactNode;\n /** The label describing the function of this button for assistive technologies. */\n 'aria-label': string;\n}\n\n/**\n * Props available on buttons that perform an action (non-navigational).\n */\nexport interface ActionButtonProps\n extends Pick<RACButtonProps, 'form' | 'name' | 'value' | 'onPress' | 'type' | 'isDisabled'> {\n /**\n * Whether the button is in a loading state.\n * This disables the button and replaces its contents with a spinner.\n *\n * @default false\n */\n isLoading?: boolean;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/button/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\nimport type { ButtonProps as RACButtonProps } from 'react-aria-components';\nimport type { CommonProps, LabellableProps, StringLikeChildren } from '../types.js';\n\n/**\n * Props available on all buttons.\n */\nexport interface BaseButtonProps extends CommonProps {\n /**\n * Determines the visual appearance of the button.\n * @default 'secondary'\n */\n variant?: 'primary' | 'secondary' | 'tertiary';\n /**\n * Determines the color tone of the button.\n * @default 'base'\n */\n tone?: 'base' | 'critical';\n /**\n * The size of the button.\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n /**\n * Whether the button should take up the whole available width.\n *\n * @default false\n */\n fullWidth?: boolean;\n}\n\n/**\n * Props available on buttons containing text.\n */\nexport interface TextButtonProps extends Omit<LabellableProps, 'label'> {\n /** The text displayed on the button. */\n children: StringLikeChildren;\n /** An icon displayed before the button text. */\n iconStart?: ReactNode;\n /** An icon displayed after the button text. */\n iconEnd?: ReactNode;\n}\n\n/**\n * Props available on buttons containing a single icon.\n */\nexport interface SingleIconButtonProps extends Omit<LabellableProps, 'label' | 'aria-label'> {\n /** The icon displayed on the button. */\n icon: ReactNode;\n /** The label describing the function of this button for assistive technologies. */\n 'aria-label': string;\n}\n\n/**\n * Props available on buttons that perform an action (non-navigational).\n */\nexport interface ActionButtonProps\n extends Pick<\n RACButtonProps,\n 'form' | 'name' | 'value' | 'onPress' | 'type' | 'isDisabled' | 'onHoverStart' | 'onHoverEnd'\n > {\n /**\n * Whether the button is in a loading state.\n * This disables the button and replaces its contents with a spinner.\n *\n * @default false\n */\n isLoading?: boolean;\n /**\n * A string that identifies the loading state to assistive technologies.\n * It will be announced by screen readers together with the button label.\n * You must provide this prop if `isLoading` is `true`.\n */\n loadingLabel?: string;\n}\n"]}
@@ -1,11 +1,21 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import { type CheckboxGroupProps as RACCheckboxGroupProps } from 'react-aria-components';
3
- import { type StackProps } from '../spacing/stack/stack.js';
4
- import type { DOMProps, FieldProps, WithRequired } from '../types.js';
5
- export interface CheckboxGroupProps extends DOMProps, WithRequired<FieldProps<string[]>, 'label'>, Pick<RACCheckboxGroupProps, 'isDisabled' | 'isReadOnly' | 'isRequired' | 'isInvalid' | 'value' | 'onChange' | 'defaultValue' | 'name'>, Pick<StackProps, 'inline'> {
3
+ import type { Responsive } from '../spacing/types.js';
4
+ import type { Direction, CommonProps, FieldProps, WithRequired } from '../types.js';
5
+ export interface CheckboxGroupProps extends CommonProps, WithRequired<FieldProps<string[]>, 'label'>, Pick<RACCheckboxGroupProps, 'isDisabled' | 'isReadOnly' | 'isRequired' | 'isInvalid' | 'value' | 'onChange' | 'defaultValue' | 'name'> {
6
6
  /** Checkboxes belonging to the group. Each checkbox must have a `value` prop defined. */
7
7
  children: ReactNode;
8
+ /**
9
+ * Determines the direction in which checkboxes will be stacked.
10
+ * @default 'vertical'
11
+ */
12
+ direction?: Responsive<Direction>;
8
13
  }
9
- declare const _CheckboxGroup: (props: CheckboxGroupProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => ReactNode;
14
+ /**
15
+ * Allows users to select one or more items from a visible list.
16
+ *
17
+ * See [checkbox usage guidelines](https://ui.cimpress.io/components/checkbox/).
18
+ */
19
+ declare const _CheckboxGroup: (props: CheckboxGroupProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
10
20
  export { _CheckboxGroup as CheckboxGroup };
11
21
  //# sourceMappingURL=checkbox-group.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-group.d.ts","sourceRoot":"","sources":["../../../../src/components/checkbox/checkbox-group.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAEL,KAAK,kBAAkB,IAAI,qBAAqB,EACjD,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEtE,MAAM,WAAW,kBACf,SAAQ,QAAQ,EACd,YAAY,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,OAAO,CAAC,EAC3C,IAAI,CACF,qBAAqB,EACrB,YAAY,GAAG,YAAY,GAAG,YAAY,GAAG,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,cAAc,GAAG,MAAM,CAC1G,EACD,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC;IAC5B,yFAAyF;IACzF,QAAQ,EAAE,SAAS,CAAC;CACrB;AAgCD,QAAA,MAAM,cAAc,2IAA6D,CAAC;AAElF,OAAO,EAAE,cAAc,IAAI,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"checkbox-group.d.ts","sourceRoot":"","sources":["../../../../src/components/checkbox/checkbox-group.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAEL,KAAK,kBAAkB,IAAI,qBAAqB,EACjD,MAAM,uBAAuB,CAAC;AAK/B,OAAO,KAAK,EAAc,UAAU,EAAW,MAAM,qBAAqB,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEpF,MAAM,WAAW,kBACf,SAAQ,WAAW,EACjB,YAAY,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,OAAO,CAAC,EAC3C,IAAI,CACF,qBAAqB,EACrB,YAAY,GAAG,YAAY,GAAG,YAAY,GAAG,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,cAAc,GAAG,MAAM,CAC1G;IACH,yFAAyF;IACzF,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;CACnC;AAgCD;;;;GAIG;AACH,QAAA,MAAM,cAAc,oKAA6D,CAAC;AAElF,OAAO,EAAE,cAAc,IAAI,aAAa,EAAE,CAAC"}
@@ -1,25 +1,31 @@
1
+ 'use client';
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import clsx from 'clsx';
3
4
  import { CheckboxGroup as RACCheckboxGroup, } from 'react-aria-components';
4
5
  import { forwardRef } from '../../forward-ref.js';
5
6
  import { withStyleProps } from '../../with-style-props.js';
6
- import { FormFieldDescription, FormFieldError, FormFieldLabel } from '../form-field/form-field.js';
7
+ import { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';
7
8
  import { Stack } from '../spacing/stack/stack.js';
8
- function CheckboxGroup({ label, description, error: errorMessage, inline = false, children, UNSAFE_className, UNSAFE_style, ...props }, ref) {
9
- return (_jsxs(RACCheckboxGroup, { ...props, ref: ref, className: clsx('cim-checkbox-group', UNSAFE_className), style: UNSAFE_style, children: [_jsx(FormFieldLabel, { isRequired: props.isRequired, children: label }), _jsx(Stack, { gap: getGapFromInline(inline), inline: inline, children: children }), _jsx(FormFieldError, { children: errorMessage }), _jsx(FormFieldDescription, { children: description })] }));
9
+ function CheckboxGroup({ label, description, error: errorMessage, direction = 'vertical', children, UNSAFE_className, UNSAFE_style, ...props }, ref) {
10
+ return (_jsxs(RACCheckboxGroup, { ...props, ref: ref, className: clsx('cim-checkbox-group', UNSAFE_className), style: UNSAFE_style, children: [_jsx(FormFieldLabel, { isRequired: props.isRequired, children: label }), _jsx(Stack, { gap: getGapFromDirection(direction), direction: direction, children: children }), _jsx(FormFieldError, { children: errorMessage }), _jsx(FormFieldDescription, { children: description })] }));
10
11
  }
12
+ /**
13
+ * Allows users to select one or more items from a visible list.
14
+ *
15
+ * See [checkbox usage guidelines](https://ui.cimpress.io/components/checkbox/).
16
+ */
11
17
  const _CheckboxGroup = withStyleProps(forwardRef(CheckboxGroup), 'CheckboxGroup');
12
18
  export { _CheckboxGroup as CheckboxGroup };
13
- // Make sure that checkboxes are spaced by 16px when stacked inline, and 4px otherwise.
14
- function getGapFromInline(inline) {
15
- if (typeof inline === 'object') {
16
- const gap = { xs: inline.xs ? 16 : 4 };
17
- Object.entries(inline).reduce((acc, curr) => {
18
- gap[curr[0]] = curr[1] ? 16 : 4;
19
+ // Make sure that checkboxes are spaced by 16px when stacked horizontally, and 8px otherwise.
20
+ function getGapFromDirection(direction) {
21
+ if (typeof direction === 'object') {
22
+ const gap = { xs: direction.xs === 'horizontal' ? 16 : 8 };
23
+ Object.entries(direction).reduce((acc, curr) => {
24
+ gap[curr[0]] = curr[1] === 'horizontal' ? 16 : 8;
19
25
  return acc;
20
26
  }, gap);
21
27
  return gap;
22
28
  }
23
- return inline ? 16 : 4;
29
+ return direction === 'horizontal' ? 16 : 8;
24
30
  }
25
31
  //# sourceMappingURL=checkbox-group.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-group.js","sourceRoot":"","sources":["../../../../src/components/checkbox/checkbox-group.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EACL,aAAa,IAAI,gBAAgB,GAElC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EA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G,EAAE,IAAI,EAAE,EAAE;YACvE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YAChC,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,GAAG,CAAC,CAAC;QAER,OAAO,GAAG,CAAC;IACb,CAAC;IAED,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACzB,CAAC","sourcesContent":["import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport type { ForwardedRef } from 'react';\nimport {\n CheckboxGroup as RACCheckboxGroup,\n type CheckboxGroupProps as RACCheckboxGroupProps,\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 { Stack, type StackProps } from '../spacing/stack/stack.js';\nimport type { Breakpoint, Responsive, Spacing } from '../spacing/types.js';\nimport type { DOMProps, FieldProps, WithRequired } from '../types.js';\n\nexport interface CheckboxGroupProps\n extends DOMProps,\n WithRequired<FieldProps<string[]>, 'label'>,\n Pick<\n RACCheckboxGroupProps,\n 'isDisabled' | 'isReadOnly' | 'isRequired' | 'isInvalid' | 'value' | 'onChange' | 'defaultValue' | 'name'\n >,\n Pick<StackProps, 'inline'> {\n /** Checkboxes belonging to the group. Each checkbox must have a `value` prop defined. */\n children: ReactNode;\n}\n\nfunction CheckboxGroup(\n {\n label,\n description,\n error: errorMessage,\n inline = false,\n children,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: CheckboxGroupProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n return (\n <RACCheckboxGroup\n {...props}\n ref={ref}\n className={clsx('cim-checkbox-group', UNSAFE_className)}\n style={UNSAFE_style}\n >\n <FormFieldLabel isRequired={props.isRequired}>{label}</FormFieldLabel>\n <Stack gap={getGapFromInline(inline)} inline={inline}>\n {children}\n </Stack>\n <FormFieldError>{errorMessage}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n </RACCheckboxGroup>\n );\n}\n\nconst _CheckboxGroup = withStyleProps(forwardRef(CheckboxGroup), 'CheckboxGroup');\n\nexport { _CheckboxGroup as CheckboxGroup };\n\n// Make sure that checkboxes are spaced by 16px when stacked inline, and 4px otherwise.\nfunction getGapFromInline(inline: Responsive<boolean>): Responsive<Spacing> {\n if (typeof inline === 'object') {\n const gap: Responsive<Spacing> = { xs: inline.xs ? 16 : 4 };\n\n (Object.entries(inline) as [Breakpoint, boolean][]).reduce((acc, curr) => {\n gap[curr[0]] = curr[1] ? 16 : 4;\n return acc;\n }, gap);\n\n return gap;\n }\n\n return inline ? 16 : 4;\n}\n"]}
1
+ {"version":3,"file":"checkbox-group.js","sourceRoot":"","sources":["../../../../src/components/checkbox/checkbox-group.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EACL,aAAa,IAAI,gBAAgB,GAElC,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;AAC5G,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAoBlD,SAAS,aAAa,CACpB,EACE,KAAK,EACL,WAAW,EACX,KAAK,EAAE,YAAY,EACnB,SAAS,GAAG,UAAU,EACtB,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACW,EACrB,GAAiC;IAEjC,OAAO,CACL,MAAC,gBAAgB,OACX,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAI,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,EACvD,KAAK,EAAE,YAAY,aAEnB,KAAC,cAAc,IAAC,UAAU,EAAE,KAAK,CAAC,UAAU,YAAG,KAAK,GAAkB,EACtE,KAAC,KAAK,IAAC,GAAG,EAAE,mBAAmB,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,SAAS,YAC7D,QAAQ,GACH,EACR,KAAC,cAAc,cAAE,YAAY,GAAkB,EAC/C,KAAC,oBAAoB,cAAE,WAAW,GAAwB,IACzC,CACpB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,cAAc,GAAG,cAAc,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,eAAe,CAAC,CAAC;AAElF,OAAO,EAAE,cAAc,IAAI,aAAa,EAAE,CAAC;AAE3C,6FAA6F;AAC7F,SAAS,mBAAmB,CAAC,SAAgC;IAC3D,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;QAClC,MAAM,GAAG,GAAwB,EAAE,EAAE,EAAE,SAAS,CAAC,EAAE,KAAK,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAE/E,MAAM,CAAC,OAAO,CAAC,SAAS,CAA+B,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YAC5E,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YACjD,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,GAAG,CAAC,CAAC;QAER,OAAO,GAAG,CAAC;IACb,CAAC;IAED,OAAO,SAAS,KAAK,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport type { ForwardedRef } from 'react';\nimport {\n CheckboxGroup as RACCheckboxGroup,\n type CheckboxGroupProps as RACCheckboxGroupProps,\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 { Stack } from '../spacing/stack/stack.js';\nimport type { Breakpoint, Responsive, Spacing } from '../spacing/types.js';\nimport type { Direction, CommonProps, FieldProps, WithRequired } from '../types.js';\n\nexport interface CheckboxGroupProps\n extends CommonProps,\n WithRequired<FieldProps<string[]>, 'label'>,\n Pick<\n RACCheckboxGroupProps,\n 'isDisabled' | 'isReadOnly' | 'isRequired' | 'isInvalid' | 'value' | 'onChange' | 'defaultValue' | 'name'\n > {\n /** Checkboxes belonging to the group. Each checkbox must have a `value` prop defined. */\n children: ReactNode;\n /**\n * Determines the direction in which checkboxes will be stacked.\n * @default 'vertical'\n */\n direction?: Responsive<Direction>;\n}\n\nfunction CheckboxGroup(\n {\n label,\n description,\n error: errorMessage,\n direction = 'vertical',\n children,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: CheckboxGroupProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n return (\n <RACCheckboxGroup\n {...props}\n ref={ref}\n className={clsx('cim-checkbox-group', UNSAFE_className)}\n style={UNSAFE_style}\n >\n <FormFieldLabel isRequired={props.isRequired}>{label}</FormFieldLabel>\n <Stack gap={getGapFromDirection(direction)} direction={direction}>\n {children}\n </Stack>\n <FormFieldError>{errorMessage}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n </RACCheckboxGroup>\n );\n}\n\n/**\n * Allows users to select one or more items from a visible list.\n *\n * See [checkbox usage guidelines](https://ui.cimpress.io/components/checkbox/).\n */\nconst _CheckboxGroup = withStyleProps(forwardRef(CheckboxGroup), 'CheckboxGroup');\n\nexport { _CheckboxGroup as CheckboxGroup };\n\n// Make sure that checkboxes are spaced by 16px when stacked horizontally, and 8px otherwise.\nfunction getGapFromDirection(direction: Responsive<Direction>): Responsive<Spacing> {\n if (typeof direction === 'object') {\n const gap: Responsive<Spacing> = { xs: direction.xs === 'horizontal' ? 16 : 8 };\n\n (Object.entries(direction) as [Breakpoint, Direction][]).reduce((acc, curr) => {\n gap[curr[0]] = curr[1] === 'horizontal' ? 16 : 8;\n return acc;\n }, gap);\n\n return gap;\n }\n\n return direction === 'horizontal' ? 16 : 8;\n}\n"]}
@@ -1,9 +1,14 @@
1
1
  import { type CheckboxProps as RACCheckboxProps } from 'react-aria-components';
2
- import type { DOMProps, LabellableProps } from '../types.js';
3
- export interface CheckboxProps extends DOMProps, Omit<LabellableProps, 'label'>, Pick<RACCheckboxProps, 'onChange' | 'isSelected' | 'isIndeterminate' | 'isDisabled' | 'isReadOnly' | 'isRequired' | 'isInvalid' | 'name' | 'value' | 'defaultSelected'> {
2
+ import type { CommonProps, LabellableProps, StringLikeChildren } from '../types.js';
3
+ export interface CheckboxProps extends CommonProps, Omit<LabellableProps, 'label'>, Pick<RACCheckboxProps, 'onChange' | 'isSelected' | 'isIndeterminate' | 'isDisabled' | 'isReadOnly' | 'isRequired' | 'isInvalid' | 'name' | 'value' | 'defaultSelected'> {
4
4
  /** The label rendered next to the checkbox. */
5
- children?: string;
5
+ children?: StringLikeChildren;
6
6
  }
7
- declare const _Checkbox: (props: CheckboxProps & import("react").RefAttributes<HTMLLabelElement> & import("../../with-style-props.js").StyleProps) => import("react").ReactNode;
7
+ /**
8
+ * Allows users to mark an item as selected. Can be used standalone, or as part of `CheckboxGroup`.
9
+ *
10
+ * See [checkbox usage guidelines](https://ui.cimpress.io/components/checkbox/).
11
+ */
12
+ declare const _Checkbox: (props: CheckboxProps & import("react").RefAttributes<HTMLLabelElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
8
13
  export { _Checkbox as Checkbox };
9
14
  //# sourceMappingURL=checkbox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/checkbox/checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA2B,KAAK,aAAa,IAAI,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAIxG,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG7D,MAAM,WAAW,aACf,SAAQ,QAAQ,EACd,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,EAC9B,IAAI,CACF,gBAAgB,EACd,UAAU,GACV,YAAY,GACZ,iBAAiB,GACjB,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,MAAM,GACN,OAAO,GACP,iBAAiB,CACpB;IACH,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAkCD,QAAA,MAAM,SAAS,wJAAmD,CAAC;AAEnE,OAAO,EAAE,SAAS,IAAI,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/checkbox/checkbox.tsx"],"names":[],"mappings":"AAIA,OAAO,EAA2B,KAAK,aAAa,IAAI,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAIxG,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGpF,MAAM,WAAW,aACf,SAAQ,WAAW,EACjB,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,EAC9B,IAAI,CACF,gBAAgB,EACd,UAAU,GACV,YAAY,GACZ,iBAAiB,GACjB,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,MAAM,GACN,OAAO,GACP,iBAAiB,CACpB;IACH,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AAgCD;;;;GAIG;AACH,QAAA,MAAM,SAAS,iKAAmD,CAAC;AAEnE,OAAO,EAAE,SAAS,IAAI,QAAQ,EAAE,CAAC"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import clsx from 'clsx';
3
4
  import { useEffect } from 'react';
@@ -13,8 +14,13 @@ function Checkbox({ children, UNSAFE_className, UNSAFE_style, ...props }, ref) {
13
14
  console.warn('Checkbox requires one of children / aria-label / aria-labelledby for accessibility');
14
15
  }
15
16
  }, [children, ariaLabel, ariaLabelledBy]);
16
- return (_jsx(RACCheckbox, { ...props, ref: ref, className: clsx('cim-checkbox', UNSAFE_className), style: UNSAFE_style, children: ({ isIndeterminate }) => (_jsxs(_Fragment, { children: [_jsx("div", { className: "cim-checkbox-toggle-wrapper", children: _jsx("div", { className: "cim-checkbox-toggle", children: isIndeterminate ? _jsx(IconMinusSmall, { "aria-hidden": "true" }) : _jsx(IconCheckmarkSmall, { "aria-hidden": "true" }) }) }), children && (_jsx(Text, { as: "span", variant: "body", children: children }))] })) }));
17
+ return (_jsx(RACCheckbox, { ...props, ref: ref, className: clsx('cim-checkbox', UNSAFE_className), style: UNSAFE_style, children: ({ isIndeterminate }) => (_jsxs(_Fragment, { children: [_jsx("div", { className: "cim-checkbox-toggle-wrapper", children: _jsx("div", { className: "cim-checkbox-toggle", children: isIndeterminate ? _jsx(IconMinusSmall, {}) : _jsx(IconCheckmarkSmall, {}) }) }), children && (_jsx(Text, { as: "span", variant: "body", children: children }))] })) }));
17
18
  }
19
+ /**
20
+ * Allows users to mark an item as selected. Can be used standalone, or as part of `CheckboxGroup`.
21
+ *
22
+ * See [checkbox usage guidelines](https://ui.cimpress.io/components/checkbox/).
23
+ */
18
24
  const _Checkbox = withStyleProps(forwardRef(Checkbox), 'Checkbox');
19
25
  export { _Checkbox as Checkbox };
20
26
  //# sourceMappingURL=checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../../../src/components/checkbox/checkbox.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAq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ACR,IACA,CACJ,GACW,CACf,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 { useEffect, type ForwardedRef } from 'react';\nimport { Checkbox as RACCheckbox, type CheckboxProps as RACCheckboxProps } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { IconCheckmarkSmall, IconMinusSmall } from '../../icons/index.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { DOMProps, LabellableProps } from '../types.js';\nimport { Text } from '../typography/text.js';\n\nexport interface CheckboxProps\n extends DOMProps,\n Omit<LabellableProps, 'label'>,\n Pick<\n RACCheckboxProps,\n | 'onChange'\n | 'isSelected'\n | 'isIndeterminate'\n | 'isDisabled'\n | 'isReadOnly'\n | 'isRequired'\n | 'isInvalid'\n | 'name'\n | 'value'\n | 'defaultSelected'\n > {\n /** The label rendered next to the checkbox. */\n children?: string;\n}\n\nfunction Checkbox(\n { children, UNSAFE_className, UNSAFE_style, ...props }: CheckboxProps,\n ref: ForwardedRef<HTMLLabelElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!children && !ariaLabel && !ariaLabelledBy) {\n console.warn('Checkbox requires one of children / aria-label / aria-labelledby for accessibility');\n }\n }, [children, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACCheckbox {...props} ref={ref} className={clsx('cim-checkbox', UNSAFE_className)} style={UNSAFE_style}>\n {({ isIndeterminate }) => (\n <>\n <div className=\"cim-checkbox-toggle-wrapper\">\n <div className=\"cim-checkbox-toggle\">\n {isIndeterminate ? <IconMinusSmall aria-hidden=\"true\" /> : <IconCheckmarkSmall aria-hidden=\"true\" />}\n </div>\n </div>\n {children && (\n <Text as=\"span\" variant=\"body\">\n {children}\n </Text>\n )}\n </>\n )}\n </RACCheckbox>\n );\n}\n\nconst _Checkbox = withStyleProps(forwardRef(Checkbox), 'Checkbox');\n\nexport { _Checkbox as Checkbox };\n"]}
1
+ {"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../../../src/components/checkbox/checkbox.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,QAAQ,IAAI,WAAW,EAA0C,MAAM,uBAAuB,CAAC;AACxG,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAsB7C,SAAS,QAAQ,CACf,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAiB,EACrE,GAAmC;IAEnC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE7E,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,QAAQ,IAAI,CAAC,SAAS,IAAI,CAAC,cAAc,EAAE,CAAC;YAC/C,OAAO,CAAC,IAAI,CAAC,oFAAoF,CAAC,CAAC;QACrG,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IAE1C,OAAO,CACL,KAAC,WAAW,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,YACrG,CAAC,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC,CACxB,8BACE,cAAK,SAAS,EAAC,6BAA6B,YAC1C,cAAK,SAAS,EAAC,qBAAqB,YAAE,eAAe,CAAC,CAAC,CAAC,KAAC,cAAc,KAAG,CAAC,CAAC,CAAC,KAAC,kBAAkB,KAAG,GAAO,GACtG,EACL,QAAQ,IAAI,CACX,KAAC,IAAI,IAAC,EAAE,EAAC,MAAM,EAAC,OAAO,EAAC,MAAM,YAC3B,QAAQ,GACJ,CACR,IACA,CACJ,GACW,CACf,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,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 { Checkbox as RACCheckbox, type CheckboxProps as RACCheckboxProps } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { IconCheckmarkSmall, IconMinusSmall } from '../../icons/index.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { CommonProps, LabellableProps, StringLikeChildren } from '../types.js';\nimport { Text } from '../typography/text.js';\n\nexport interface CheckboxProps\n extends CommonProps,\n Omit<LabellableProps, 'label'>,\n Pick<\n RACCheckboxProps,\n | 'onChange'\n | 'isSelected'\n | 'isIndeterminate'\n | 'isDisabled'\n | 'isReadOnly'\n | 'isRequired'\n | 'isInvalid'\n | 'name'\n | 'value'\n | 'defaultSelected'\n > {\n /** The label rendered next to the checkbox. */\n children?: StringLikeChildren;\n}\n\nfunction Checkbox(\n { children, UNSAFE_className, UNSAFE_style, ...props }: CheckboxProps,\n ref: ForwardedRef<HTMLLabelElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!children && !ariaLabel && !ariaLabelledBy) {\n console.warn('Checkbox requires one of children / aria-label / aria-labelledby for accessibility');\n }\n }, [children, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACCheckbox {...props} ref={ref} className={clsx('cim-checkbox', UNSAFE_className)} style={UNSAFE_style}>\n {({ isIndeterminate }) => (\n <>\n <div className=\"cim-checkbox-toggle-wrapper\">\n <div className=\"cim-checkbox-toggle\">{isIndeterminate ? <IconMinusSmall /> : <IconCheckmarkSmall />}</div>\n </div>\n {children && (\n <Text as=\"span\" variant=\"body\">\n {children}\n </Text>\n )}\n </>\n )}\n </RACCheckbox>\n );\n}\n\n/**\n * Allows users to mark an item as selected. Can be used standalone, or as part of `CheckboxGroup`.\n *\n * See [checkbox usage guidelines](https://ui.cimpress.io/components/checkbox/).\n */\nconst _Checkbox = withStyleProps(forwardRef(Checkbox), 'Checkbox');\n\nexport { _Checkbox as Checkbox };\n"]}
@@ -1,33 +1,34 @@
1
- import { type ReactNode } from 'react';
2
- import { type ComboBoxProps as RACComboBoxProps } from 'react-aria-components';
3
- import type { DOMProps, FieldWithPlaceholderProps, Key } from '../types.js';
4
- export interface ComboBoxOption {
5
- /** The unique id of the item. When integrated with a form, this will be the value of the option. */
6
- id: string;
7
- /** The content to display as the label of the option. */
8
- label: string;
9
- /** Whether the option is disabled. */
10
- isDisabled?: boolean;
11
- }
12
- export interface ComboBoxOptionGroup {
13
- /** The unique id of the group. */
14
- id: string;
15
- /** The content to display as the title of the group. */
16
- label: string;
17
- /** The options available for selection within the group. */
18
- options: ComboBoxOption[];
19
- isDisabled?: never;
20
- }
1
+ import { type ListBoxProps as RACListBoxProps, type ComboBoxProps as RACComboBoxProps, type ListBoxItemProps as RACListBoxItemProps } from 'react-aria-components';
2
+ import type { CollectionItem, CollectionProps, CommonProps, FieldWithPlaceholderProps, Key, StringLikeChildren } from '../types.js';
3
+ /** Represents the state of the `ComboBox` component for validation purposes. */
21
4
  export interface ComboBoxValidationValue {
22
5
  /** The selected key in the ComboBox. */
23
6
  selectedKey: Key | null;
24
7
  /** The value of the ComboBox input. */
25
8
  inputValue: string;
26
9
  }
27
- export interface ComboBoxProps<T extends object> extends Pick<RACComboBoxProps<T>, 'name' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'isReadOnly' | 'selectedKey' | 'defaultSelectedKey' | 'inputValue' | 'defaultInputValue' | 'autoFocus' | 'onSelectionChange' | 'onInputChange'>, DOMProps, FieldWithPlaceholderProps<ComboBoxValidationValue> {
28
- /** The options available for selection. Supports groups with a single level of nesting. */
29
- options: Array<ComboBoxOption | ComboBoxOptionGroup>;
10
+ export interface ComboBoxProps<T extends CollectionItem = CollectionItem> extends CommonProps, FieldWithPlaceholderProps<ComboBoxValidationValue>, CollectionProps<T>, Pick<RACComboBoxProps<T>, 'name' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'isReadOnly' | 'selectedKey' | 'defaultSelectedKey' | 'inputValue' | 'defaultInputValue' | 'autoFocus' | 'onSelectionChange' | 'onInputChange' | 'onFocus' | 'onBlur' | 'onOpenChange'>, Pick<RACListBoxProps<T>, 'onScroll'> {
30
11
  }
31
- declare const _ComboBox: <T extends object>(props: ComboBoxProps<T> & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => ReactNode;
12
+ /** Allows users to filter a collapsible list and select one item from it. */
13
+ declare const _ComboBox: <T extends CollectionItem>(props: ComboBoxProps<T> & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
32
14
  export { _ComboBox as ComboBox };
15
+ export interface ComboBoxItemProps<T extends CollectionItem> extends Pick<RACListBoxItemProps<T>, 'id' | 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {
16
+ children: StringLikeChildren;
17
+ }
18
+ /** Renders a single list item within `ComboBox`. */
19
+ export declare function ComboBoxItem<T extends CollectionItem>({ children, ...props }: ComboBoxItemProps<T>): import("react/jsx-runtime").JSX.Element;
20
+ export declare namespace ComboBoxItem {
21
+ var displayName: string;
22
+ }
23
+ export interface ComboBoxSectionProps<T extends CollectionItem> extends CollectionProps<T> {
24
+ /** The ID of the section. Has to be unique across all sections and items. */
25
+ id?: Key;
26
+ /** The content to display as the section title. */
27
+ title: string;
28
+ }
29
+ /** Groups list items within `ComboBox` into a section. */
30
+ export declare function ComboBoxSection<T extends CollectionItem>({ title, children, items, ...props }: ComboBoxSectionProps<T>): import("react/jsx-runtime").JSX.Element;
31
+ export declare namespace ComboBoxSection {
32
+ var displayName: string;
33
+ }
33
34
  //# sourceMappingURL=combo-box.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"combo-box.d.ts","sourceRoot":"","sources":["../../../../src/components/combo-box/combo-box.tsx"],"names":[],"mappings":"AACA,OAAO,EAAyC,KAAK,SAAS,EAAsB,MAAM,OAAO,CAAC;AAClG,OAAO,EAWL,KAAK,aAAa,IAAI,gBAAgB,EAEvC,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAyB,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAG5E,MAAM,WAAW,cAAc;IAC7B,oGAAoG;IACpG,EAAE,EAAE,MAAM,CAAC;IACX,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE,KAAK,CAAC;CACpB;AAED,MAAM,WAAW,uBAAuB;IACtC,wCAAwC;IACxC,WAAW,EAAE,GAAG,GAAG,IAAI,CAAC;IACxB,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,MAAM,CAC7C,SAAQ,IAAI,CACR,gBAAgB,CAAC,CAAC,CAAC,EACjB,MAAM,GACN,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,aAAa,GACb,oBAAoB,GACpB,YAAY,GACZ,mBAAmB,GACnB,WAAW,GACX,mBAAmB,GACnB,eAAe,CAClB,EACD,QAAQ,EACR,yBAAyB,CAAC,uBAAuB,CAAC;IACpD,2FAA2F;IAC3F,OAAO,EAAE,KAAK,CAAC,cAAc,GAAG,mBAAmB,CAAC,CAAC;CACtD;AAyCD,QAAA,MAAM,SAAS,GAvCG,CAAC,SAAS,MAAM,wIAuCgC,CAAC;AAEnE,OAAO,EAAE,SAAS,IAAI,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"combo-box.d.ts","sourceRoot":"","sources":["../../../../src/components/combo-box/combo-box.tsx"],"names":[],"mappings":"AAIA,OAAO,EASL,KAAK,YAAY,IAAI,eAAe,EAIpC,KAAK,aAAa,IAAI,gBAAgB,EACtC,KAAK,gBAAgB,IAAI,mBAAmB,EAC7C,MAAM,uBAAuB,CAAC;AAM/B,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,WAAW,EACX,yBAAyB,EACzB,GAAG,EACH,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAGrB,gFAAgF;AAChF,MAAM,WAAW,uBAAuB;IACtC,wCAAwC;IACxC,WAAW,EAAE,GAAG,GAAG,IAAI,CAAC;IACxB,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,CACtE,SAAQ,WAAW,EACjB,yBAAyB,CAAC,uBAAuB,CAAC,EAClD,eAAe,CAAC,CAAC,CAAC,EAClB,IAAI,CACF,gBAAgB,CAAC,CAAC,CAAC,EACjB,MAAM,GACN,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,aAAa,GACb,oBAAoB,GACpB,YAAY,GACZ,mBAAmB,GACnB,WAAW,GACX,mBAAmB,GACnB,eAAe,GACf,SAAS,GACT,QAAQ,GACR,cAAc,CACjB,EACD,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC;CAAG;AAqE3C,6EAA6E;AAC7E,QAAA,MAAM,SAAS,GApEG,CAAC,SAAS,cAAc,iKAoEwB,CAAC;AAEnE,OAAO,EAAE,SAAS,IAAI,QAAQ,EAAE,CAAC;AAsBjC,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,cAAc,CACzD,SAAQ,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG,YAAY,GAAG,cAAc,GAAG,YAAY,CAAC;IACzF,QAAQ,EAAE,kBAAkB,CAAC;CAC9B;AAED,oDAAoD;AACpD,wBAAgB,YAAY,CAAC,CAAC,SAAS,cAAc,EAAE,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,CAAC,CAAC,CAAC,2CAiBlG;yBAjBe,YAAY;;;AAqB5B,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,cAAc,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;IACxF,6EAA6E;IAC7E,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,0DAA0D;AAC1D,wBAAgB,eAAe,CAAC,CAAC,SAAS,cAAc,EAAE,EACxD,KAAK,EACL,QAAQ,EACR,KAAK,EACL,GAAG,KAAK,EACT,EAAE,oBAAoB,CAAC,CAAC,CAAC,2CAezB;yBApBe,eAAe"}
@@ -1,39 +1,52 @@
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 { useContext, useRef } from 'react';
4
- import { ComboBoxStateContext, Button as RACButton, Collection as RACCollection, ComboBox as RACComboBox, Header as RACHeader, Input as RACInput, ListBox as RACListBox, ListBoxItem as RACListBoxItem, Popover as RACPopover, Section as RACSection, } from 'react-aria-components';
4
+ import { useContext, useEffect, useRef } from 'react';
5
+ import { Button as RACButton, Collection as RACCollection, ComboBox as RACComboBox, ComboBoxStateContext as RACComboBoxStateContext, Group as RACGroup, Header as RACHeader, Input as RACInput, ListBox as RACListBox, ListBoxItem as RACListBoxItem, ListBoxSection as RACListBoxSection, Text as RACText, } from 'react-aria-components';
5
6
  import { forwardRef } from '../../forward-ref.js';
7
+ import { IconCheckmark, IconChevronDownFill } from '../../icons/index.js';
6
8
  import { withStyleProps } from '../../with-style-props.js';
7
- 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';
8
11
  import { textStyle } from '../typography/utils.js';
9
- function ComboBox({ label, description, error, options, placeholder, UNSAFE_className, UNSAFE_style, ...props }, ref) {
12
+ function ComboBox({ label, description, error, items, children, placeholder, UNSAFE_className, UNSAFE_style, isReadOnly, onScroll, ...props }, ref) {
10
13
  const triggerPositioningRef = useRef(null);
11
- return (_jsxs(RACComboBox, { ...props, ref: ref, className: clsx('cim-combo-box', UNSAFE_className), style: UNSAFE_style, menuTrigger: "focus", children: [_jsx(FormFieldLabel, { isRequired: props.isRequired, children: label }), _jsxs("div", { className: "cim-combo-box-input-wrapper", ref: triggerPositioningRef, children: [_jsx(ComboBoxInput, { isReadOnly: props.isReadOnly, placeholder: placeholder }), _jsx(RACButton, { className: "cim-combo-box-button", children: _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-combo-box-popover",
12
- // Position popover relative to wrapper div instead of input to account for border
13
- triggerRef: triggerPositioningRef, "data-experimental-cim-style-root": true, children: _jsx(RACListBox, { className: "cim-combo-box-listbox", items: options, children: renderOptions }) })] }));
14
+ const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
15
+ useEffect(() => {
16
+ if (!label && !ariaLabel && !ariaLabelledBy) {
17
+ console.warn('ComboBox requires one of label / aria-label / aria-labelledby for accessibility');
18
+ }
19
+ }, [label, ariaLabel, ariaLabelledBy]);
20
+ if (items != null && typeof children !== 'function') {
21
+ console.warn('`ComboBox` requires `children` to be a function when using `items` prop');
22
+ }
23
+ return (_jsxs(RACComboBox, { ...props, ref: ref, className: clsx('cim-combo-box', UNSAFE_className), style: UNSAFE_style, menuTrigger: "focus", isReadOnly: isReadOnly, "data-readonly": isReadOnly ? true : undefined, children: [_jsx(FormFieldLabel, { isRequired: props.isRequired, isDisabled: props.isDisabled, children: label }), _jsxs(RACGroup, { className: "cim-combo-box-input-wrapper", ref: triggerPositioningRef, children: [_jsx(ComboBoxInput, { isReadOnly: isReadOnly, placeholder: placeholder }), _jsx(RACButton, { className: "cim-combo-box-button", children: _jsx(IconChevronDownFill, {}) })] }), _jsx(FormFieldError, { children: error }), _jsx(FormFieldDescription, { children: description }), _jsx(CollapsibleList, { offset: 5, maxHeight: 315,
24
+ // Position the list relative to wrapper div instead of input to account for border
25
+ triggerRef: triggerPositioningRef, widthCorrection: 2, children: _jsx(RACListBox, { className: "cim-combo-box-listbox", onScroll: onScroll, items: items, children: children }) })] }));
14
26
  }
27
+ // TODO: add link to usage guidelines
28
+ /** Allows users to filter a collapsible list and select one item from it. */
15
29
  const _ComboBox = withStyleProps(forwardRef(ComboBox), 'ComboBox');
16
30
  export { _ComboBox as ComboBox };
17
31
  function ComboBoxInput({ isReadOnly, placeholder, }) {
18
- const comboBoxState = useContext(ComboBoxStateContext);
32
+ const comboBoxState = useContext(RACComboBoxStateContext);
19
33
  return (_jsx(RACInput, { className: clsx('cim-combo-box-input', textStyle({ variant: 'medium' })),
20
34
  // Ensure the popover opens when the input is clicked.
21
35
  // By default, React Aria only opens the popover when the input is focused.
22
36
  onClick: () => !isReadOnly && comboBoxState.open(), placeholder: placeholder }));
23
37
  }
24
- function renderOptions(item) {
25
- if ('options' in item) {
26
- return (_jsx(ComboBoxSection, { id: item.id, title: item.label, items: item.options, children: (child) => (_jsx(ComboBoxItem, { id: child.id, isDisabled: child.isDisabled, children: child.label })) }));
27
- }
28
- return (_jsx(ComboBoxItem, { id: item.id, isDisabled: item.isDisabled, children: item.label }));
29
- }
30
- function ComboBoxItem({ children, ...props }) {
31
- return (_jsx(RACListBoxItem, { ...props, className: clsx('cim-combo-box-item', textStyle({ variant: 'medium' })), children: children }));
38
+ /** Renders a single list item within `ComboBox`. */
39
+ export function ComboBoxItem({ children, ...props }) {
40
+ const textValue = typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');
41
+ return (_jsx(RACListBoxItem, { ...props, className: "cim-combo-box-item", textValue: textValue, children: ({ isDisabled }) => (_jsxs(_Fragment, { children: [_jsx(IconCheckmark, {}), _jsx(RACText, { slot: "label", className: textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'base' }), children: children })] })) }));
32
42
  }
33
- function ComboBoxSection({ title, children, items, ...props }) {
34
- return (_jsxs(RACSection, { ...props, className: "cim-combo-box-section", children: [_jsx(RACHeader, { className: clsx('cim-combo-box-header', textStyle({ variant: 'small', tone: 'subtle' })), children: title }), _jsx(RACCollection, { items: items, children: children })] }));
35
- }
36
- function ChevronDownIcon(props) {
37
- 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" }) }));
43
+ ComboBoxItem.displayName = 'ComboBoxItem';
44
+ /** Groups list items within `ComboBox` into a section. */
45
+ export function ComboBoxSection({ title, children, items, ...props }) {
46
+ if (items != null && typeof children !== 'function') {
47
+ console.warn('`ComboBoxSection` requires `children` to be a function when using `items` prop');
48
+ }
49
+ return (_jsxs(RACListBoxSection, { ...props, className: "cim-combo-box-section", children: [_jsx(RACHeader, { className: clsx('cim-combo-box-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' })), children: title }), _jsx(RACCollection, { items: items, children: children })] }));
38
50
  }
51
+ ComboBoxSection.displayName = 'ComboBoxSection';
39
52
  //# sourceMappingURL=combo-box.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"combo-box.js","sourceRoot":"","sources":["../../../../src/components/combo-box/combo-box.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,EAAyD,MAAM,OAAO,CAAC;AAClG,OAAO,EACL,oBAAoB,EACpB,MAAM,IAAI,SAAS,EACnB,UAAU,IAAI,aAAa,EAC3B,QAAQ,IAAI,WAAW,EACvB,MAAM,IAAI,SAAS,EACnB,KAAK,IAAI,QAAQ,EACjB,OAAO,IAAI,UAAU,EACrB,WAAW,IAAI,cAAc,EAC7B,OAAO,IAAI,UAAU,EACrB,OAAO,IAAI,UAAU,GAGtB,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;AAkDnD,SAAS,QAAQ,CACf,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAoB,EAC/G,GAAiC;IAEjC,MAAM,qBAAqB,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAE3D,OAAO,CACL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,CAAC,YAChG,KAAK,GACI,EACZ,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAiB,IAC5C,CACd,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,KAAmC;IAC1D,OAAO,CACL,cAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,cAAc,wBAAe,KAAK,YACjG,eAAM,CAAC,EAAC,4OAA4O,GAAG,GACnP,CACP,CAAC;AACJ,CAAC","sourcesContent":["import clsx from 'clsx';\nimport { useContext, useRef, type ForwardedRef, type ReactNode, type SVGAttributes } from 'react';\nimport {\n ComboBoxStateContext,\n Button as RACButton,\n Collection as RACCollection,\n ComboBox as RACComboBox,\n Header as RACHeader,\n Input as RACInput,\n ListBox as RACListBox,\n ListBoxItem as RACListBoxItem,\n Popover as RACPopover,\n Section as RACSection,\n type ComboBoxProps as RACComboBoxProps,\n type ListBoxItemProps as RACListBoxItemProps,\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 ComboBoxOption {\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 ComboBoxOptionGroup {\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: ComboBoxOption[];\n isDisabled?: never;\n}\n\nexport interface ComboBoxValidationValue {\n /** The selected key in the ComboBox. */\n selectedKey: Key | null;\n /** The value of the ComboBox input. */\n inputValue: string;\n}\n\nexport interface ComboBoxProps<T extends object>\n extends Pick<\n RACComboBoxProps<T>,\n | 'name'\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'isReadOnly'\n | 'selectedKey'\n | 'defaultSelectedKey'\n | 'inputValue'\n | 'defaultInputValue'\n | 'autoFocus'\n | 'onSelectionChange'\n | 'onInputChange'\n >,\n DOMProps,\n FieldWithPlaceholderProps<ComboBoxValidationValue> {\n /** The options available for selection. Supports groups with a single level of nesting. */\n options: Array<ComboBoxOption | ComboBoxOptionGroup>;\n}\n\nfunction ComboBox<T extends object>(\n { label, description, error, options, placeholder, UNSAFE_className, UNSAFE_style, ...props }: ComboBoxProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const triggerPositioningRef = useRef<HTMLDivElement>(null);\n\n return (\n <RACComboBox\n {...props}\n ref={ref}\n className={clsx('cim-combo-box', UNSAFE_className)}\n style={UNSAFE_style}\n menuTrigger=\"focus\"\n >\n <FormFieldLabel isRequired={props.isRequired}>{label}</FormFieldLabel>\n <div className=\"cim-combo-box-input-wrapper\" ref={triggerPositioningRef}>\n <ComboBoxInput isReadOnly={props.isReadOnly} placeholder={placeholder} />\n <RACButton className=\"cim-combo-box-button\">\n <ChevronDownIcon height={12} width={12} aria-hidden=\"true\" />\n </RACButton>\n </div>\n <FormFieldError>{error}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n <RACPopover\n offset={2}\n maxHeight={315}\n className=\"cim-combo-box-popover\"\n // Position popover relative to wrapper div instead of input to account for border\n triggerRef={triggerPositioningRef}\n data-experimental-cim-style-root\n >\n <RACListBox className=\"cim-combo-box-listbox\" items={options}>\n {renderOptions}\n </RACListBox>\n </RACPopover>\n </RACComboBox>\n );\n}\n\nconst _ComboBox = withStyleProps(forwardRef(ComboBox), 'ComboBox');\n\nexport { _ComboBox as ComboBox };\n\nfunction ComboBoxInput({\n isReadOnly,\n placeholder,\n}: {\n isReadOnly: boolean | undefined;\n placeholder: string | undefined;\n}) {\n const comboBoxState = useContext(ComboBoxStateContext);\n\n return (\n <RACInput\n className={clsx('cim-combo-box-input', textStyle({ variant: 'medium' }))}\n // Ensure the popover opens when the input is clicked.\n // By default, React Aria only opens the popover when the input is focused.\n onClick={() => !isReadOnly && comboBoxState.open()}\n placeholder={placeholder}\n />\n );\n}\n\nfunction renderOptions(item: ComboBoxOption | ComboBoxOptionGroup) {\n if ('options' in item) {\n return (\n <ComboBoxSection id={item.id} title={item.label} items={item.options}>\n {(child) => (\n <ComboBoxItem id={child.id} isDisabled={child.isDisabled}>\n {child.label}\n </ComboBoxItem>\n )}\n </ComboBoxSection>\n );\n }\n\n return (\n <ComboBoxItem id={item.id} isDisabled={item.isDisabled}>\n {item.label}\n </ComboBoxItem>\n );\n}\n\ninterface ComboBoxItemProps<T extends object> extends Pick<RACListBoxItemProps<T>, 'id' | 'value' | 'isDisabled'> {\n children: string;\n}\n\nfunction ComboBoxItem<T extends object>({ children, ...props }: ComboBoxItemProps<T>) {\n return (\n <RACListBoxItem {...props} className={clsx('cim-combo-box-item', textStyle({ variant: 'medium' }))}>\n {children}\n </RACListBoxItem>\n );\n}\n\ninterface ComboBoxSectionProps<T extends object> {\n id: string;\n title: string;\n children: ReactNode | ((item: T) => ReactNode);\n items?: Iterable<T>;\n}\n\nfunction ComboBoxSection<T extends object>({ title, children, items, ...props }: ComboBoxSectionProps<T>) {\n return (\n <RACSection {...props} className=\"cim-combo-box-section\">\n <RACHeader className={clsx('cim-combo-box-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":"combo-box.js","sourceRoot":"","sources":["../../../../src/components/combo-box/combo-box.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAqB,MAAM,OAAO,CAAC;AACzE,OAAO,EACL,MAAM,IAAI,SAAS,EACnB,UAAU,IAAI,aAAa,EAC3B,QAAQ,IAAI,WAAW,EACvB,oBAAoB,IAAI,uBAAuB,EAC/C,KAAK,IAAI,QAAQ,EACjB,MAAM,IAAI,SAAS,EACnB,KAAK,IAAI,QAAQ,EACjB,OAAO,IAAI,UAAU,EAErB,WAAW,IAAI,cAAc,EAC7B,cAAc,IAAI,iBAAiB,EACnC,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;AAS5G,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAkCnD,SAAS,QAAQ,CACf,EACE,KAAK,EACL,WAAW,EACX,KAAK,EACL,KAAK,EACL,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,GAAG,KAAK,EACS,EACnB,GAAiC;IAEjC,MAAM,qBAAqB,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAE3D,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,cA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E,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,YACjG,QAAQ,GACD,IACT,CACJ,GACc,CAClB,CAAC;AACJ,CAAC;AAED,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAS1C,0DAA0D;AAC1D,MAAM,UAAU,eAAe,CAA2B,EACxD,KAAK,EACL,QAAQ,EACR,KAAK,EACL,GAAG,KAAK,EACgB;IACxB,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,gFAAgF,CAAC,CAAC;IACjG,CAAC;IAED,OAAO,CACL,MAAC,iBAAiB,OAAK,KAAK,EAAE,SAAS,EAAC,uBAAuB,aAC7D,KAAC,SAAS,IACR,SAAS,EAAE,IAAI,CAAC,8BAA8B,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,YAExG,KAAK,GACI,EACZ,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAiB,IACrC,CACrB,CAAC;AACJ,CAAC;AAED,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { useContext, useEffect, useRef, type ForwardedRef } from 'react';\nimport {\n Button as RACButton,\n Collection as RACCollection,\n ComboBox as RACComboBox,\n ComboBoxStateContext as RACComboBoxStateContext,\n Group as RACGroup,\n Header as RACHeader,\n Input as RACInput,\n ListBox as RACListBox,\n type ListBoxProps as RACListBoxProps,\n ListBoxItem as RACListBoxItem,\n ListBoxSection as RACListBoxSection,\n Text as RACText,\n type ComboBoxProps as RACComboBoxProps,\n type ListBoxItemProps as RACListBoxItemProps,\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 {\n CollectionItem,\n CollectionProps,\n CommonProps,\n FieldWithPlaceholderProps,\n Key,\n StringLikeChildren,\n} from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\n/** Represents the state of the `ComboBox` component for validation purposes. */\nexport interface ComboBoxValidationValue {\n /** The selected key in the ComboBox. */\n selectedKey: Key | null;\n /** The value of the ComboBox input. */\n inputValue: string;\n}\n\nexport interface ComboBoxProps<T extends CollectionItem = CollectionItem>\n extends CommonProps,\n FieldWithPlaceholderProps<ComboBoxValidationValue>,\n CollectionProps<T>,\n Pick<\n RACComboBoxProps<T>,\n | 'name'\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'isReadOnly'\n | 'selectedKey'\n | 'defaultSelectedKey'\n | 'inputValue'\n | 'defaultInputValue'\n | 'autoFocus'\n | 'onSelectionChange'\n | 'onInputChange'\n | 'onFocus'\n | 'onBlur'\n | 'onOpenChange'\n >,\n Pick<RACListBoxProps<T>, 'onScroll'> {}\n\nfunction ComboBox<T extends CollectionItem>(\n {\n label,\n description,\n error,\n items,\n children,\n placeholder,\n UNSAFE_className,\n UNSAFE_style,\n isReadOnly,\n onScroll,\n ...props\n }: ComboBoxProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const triggerPositioningRef = useRef<HTMLDivElement>(null);\n\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('ComboBox 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('`ComboBox` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACComboBox\n {...props}\n ref={ref}\n className={clsx('cim-combo-box', UNSAFE_className)}\n style={UNSAFE_style}\n menuTrigger=\"focus\"\n isReadOnly={isReadOnly}\n data-readonly={isReadOnly ? true : undefined}\n >\n <FormFieldLabel isRequired={props.isRequired} isDisabled={props.isDisabled}>\n {label}\n </FormFieldLabel>\n <RACGroup className=\"cim-combo-box-input-wrapper\" ref={triggerPositioningRef}>\n <ComboBoxInput isReadOnly={isReadOnly} placeholder={placeholder} />\n <RACButton className=\"cim-combo-box-button\">\n <IconChevronDownFill />\n </RACButton>\n </RACGroup>\n <FormFieldError>{error}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n <CollapsibleList\n offset={5} // 1px border + 4px actual offset\n maxHeight={315}\n // Position the list relative to wrapper div instead of input to account for border\n triggerRef={triggerPositioningRef}\n widthCorrection={2} // React Aria calculates the width of the trigger based on the width of the input + button, so we need to add 2px to account for the border on `.cim-combo-box-input-wrapper`\n >\n <RACListBox className=\"cim-combo-box-listbox\" onScroll={onScroll} items={items}>\n {children}\n </RACListBox>\n </CollapsibleList>\n </RACComboBox>\n );\n}\n\n// TODO: add link to usage guidelines\n/** Allows users to filter a collapsible list and select one item from it. */\nconst _ComboBox = withStyleProps(forwardRef(ComboBox), 'ComboBox');\n\nexport { _ComboBox as ComboBox };\n\nfunction ComboBoxInput({\n isReadOnly,\n placeholder,\n}: {\n isReadOnly: boolean | undefined;\n placeholder: string | undefined;\n}) {\n const comboBoxState = useContext(RACComboBoxStateContext);\n\n return (\n <RACInput\n className={clsx('cim-combo-box-input', textStyle({ variant: 'medium' }))}\n // Ensure the popover opens when the input is clicked.\n // By default, React Aria only opens the popover when the input is focused.\n onClick={() => !isReadOnly && comboBoxState!.open()}\n placeholder={placeholder}\n />\n );\n}\n\nexport interface ComboBoxItemProps<T extends CollectionItem>\n extends Pick<RACListBoxItemProps<T>, 'id' | 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {\n children: StringLikeChildren;\n}\n\n/** Renders a single list item within `ComboBox`. */\nexport function ComboBoxItem<T extends CollectionItem>({ children, ...props }: ComboBoxItemProps<T>) {\n const textValue =\n typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');\n\n return (\n <RACListBoxItem {...props} className=\"cim-combo-box-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\nComboBoxItem.displayName = 'ComboBoxItem';\n\nexport interface ComboBoxSectionProps<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 `ComboBox` into a section. */\nexport function ComboBoxSection<T extends CollectionItem>({\n title,\n children,\n items,\n ...props\n}: ComboBoxSectionProps<T>) {\n if (items != null && typeof children !== 'function') {\n console.warn('`ComboBoxSection` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACListBoxSection {...props} className=\"cim-combo-box-section\">\n <RACHeader\n className={clsx('cim-combo-box-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' }))}\n >\n {title}\n </RACHeader>\n <RACCollection items={items}>{children}</RACCollection>\n </RACListBoxSection>\n );\n}\n\nComboBoxSection.displayName = 'ComboBoxSection';\n"]}
@@ -1,7 +1,12 @@
1
1
  import { type FormProps as RACFormProps } from 'react-aria-components';
2
- import type { DOMProps, LabellableProps } from '../types.js';
3
- export interface FormProps extends DOMProps, Omit<LabellableProps, 'label'>, Pick<RACFormProps, 'action' | 'validationErrors' | 'encType' | 'method' | 'target' | 'autoComplete' | 'autoCapitalize' | 'children' | 'onSubmit' | 'onReset' | 'onInvalid'> {
2
+ import type { CommonProps, LabellableProps } from '../types.js';
3
+ export interface FormProps extends CommonProps, Omit<LabellableProps, 'label'>, Pick<RACFormProps, 'action' | 'validationErrors' | 'encType' | 'method' | 'target' | 'autoComplete' | 'autoCapitalize' | 'children' | 'onSubmit' | 'onReset' | 'onInvalid'> {
4
4
  }
5
- declare const _Form: (props: FormProps & import("react").RefAttributes<HTMLFormElement> & import("../../with-style-props.js").StyleProps) => import("react").ReactNode;
5
+ /**
6
+ * A group of inputs that allows users to submit data to a server.
7
+ *
8
+ * See [forms guide](https://ui.cimpress.io/dev-guides/forms/).
9
+ */
10
+ declare const _Form: (props: FormProps & import("react").RefAttributes<HTMLFormElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
6
11
  export { _Form as Form };
7
12
  //# sourceMappingURL=form.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../../src/components/form/form.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAmB,KAAK,SAAS,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGxF,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE7D,MAAM,WAAW,SACf,SAAQ,QAAQ,EACd,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,EAC9B,IAAI,CACF,YAAY,EACV,QAAQ,GACR,kBAAkB,GAClB,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,cAAc,GACd,gBAAgB,GAChB,UAAU,GACV,UAAU,GACV,SAAS,GACT,WAAW,CACd;CAAG;AAUR,QAAA,MAAM,KAAK,mJAA2C,CAAC;AAEvD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC"}
1
+ {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../../src/components/form/form.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAmB,KAAK,SAAS,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGxF,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,WAAW,SACf,SAAQ,WAAW,EACjB,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,EAC9B,IAAI,CACF,YAAY,EACV,QAAQ,GACR,kBAAkB,GAClB,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,cAAc,GACd,gBAAgB,GAChB,UAAU,GACV,UAAU,GACV,SAAS,GACT,WAAW,CACd;CAAG;AAUR;;;;GAIG;AACH,QAAA,MAAM,KAAK,4JAA2C,CAAC;AAEvD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import clsx from 'clsx';
3
4
  import { Form as RACForm } from 'react-aria-components';
@@ -6,6 +7,11 @@ import { withStyleProps } from '../../with-style-props.js';
6
7
  function Form({ children, UNSAFE_className, UNSAFE_style, ...props }, ref) {
7
8
  return (_jsx(RACForm, { ...props, className: clsx('cim-form', UNSAFE_className), style: UNSAFE_style, ref: ref, children: children }));
8
9
  }
10
+ /**
11
+ * A group of inputs that allows users to submit data to a server.
12
+ *
13
+ * See [forms guide](https://ui.cimpress.io/dev-guides/forms/).
14
+ */
9
15
  const _Form = withStyleProps(forwardRef(Form), 'Form');
10
16
  export { _Form as Form };
11
17
  //# sourceMappingURL=form.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"form.js","sourceRoot":"","sources":["../../../../src/components/form/form.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,IAAI,IAAI,OAAO,EAAkC,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAqB3D,SAAS,IAAI,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAa,EAAE,GAAkC;IACjH,OAAO,CACL,KAAC,OAAO,OAAK,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,UAAU,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,YAC7F,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAED,MAAM,KAAK,GAAG,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AAEvD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC","sourcesContent":["import clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\nimport { Form as RACForm, type FormProps as RACFormProps } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { DOMProps, LabellableProps } from '../types.js';\n\nexport interface FormProps\n extends DOMProps,\n Omit<LabellableProps, 'label'>,\n Pick<\n RACFormProps,\n | 'action'\n | 'validationErrors'\n | 'encType'\n | 'method'\n | 'target'\n | 'autoComplete'\n | 'autoCapitalize'\n | 'children'\n | 'onSubmit'\n | 'onReset'\n | 'onInvalid'\n > {}\n\nfunction Form({ children, UNSAFE_className, UNSAFE_style, ...props }: FormProps, ref: ForwardedRef<HTMLFormElement>) {\n return (\n <RACForm {...props} className={clsx('cim-form', UNSAFE_className)} style={UNSAFE_style} ref={ref}>\n {children}\n </RACForm>\n );\n}\n\nconst _Form = withStyleProps(forwardRef(Form), 'Form');\n\nexport { _Form as Form };\n"]}
1
+ {"version":3,"file":"form.js","sourceRoot":"","sources":["../../../../src/components/form/form.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,IAAI,IAAI,OAAO,EAAkC,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAqB3D,SAAS,IAAI,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAa,EAAE,GAAkC;IACjH,OAAO,CACL,KAAC,OAAO,OAAK,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,UAAU,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,YAC7F,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,KAAK,GAAG,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AAEvD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\nimport { Form as RACForm, type FormProps as RACFormProps } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { CommonProps, LabellableProps } from '../types.js';\n\nexport interface FormProps\n extends CommonProps,\n Omit<LabellableProps, 'label'>,\n Pick<\n RACFormProps,\n | 'action'\n | 'validationErrors'\n | 'encType'\n | 'method'\n | 'target'\n | 'autoComplete'\n | 'autoCapitalize'\n | 'children'\n | 'onSubmit'\n | 'onReset'\n | 'onInvalid'\n > {}\n\nfunction Form({ children, UNSAFE_className, UNSAFE_style, ...props }: FormProps, ref: ForwardedRef<HTMLFormElement>) {\n return (\n <RACForm {...props} className={clsx('cim-form', UNSAFE_className)} style={UNSAFE_style} ref={ref}>\n {children}\n </RACForm>\n );\n}\n\n/**\n * A group of inputs that allows users to submit data to a server.\n *\n * See [forms guide](https://ui.cimpress.io/dev-guides/forms/).\n */\nconst _Form = withStyleProps(forwardRef(Form), 'Form');\n\nexport { _Form as Form };\n"]}
@@ -0,0 +1,16 @@
1
+ import { type PopoverProps as RACPopoverProps } from 'react-aria-components';
2
+ interface CollapsibleListProps extends Pick<RACPopoverProps, 'placement' | 'offset' | 'maxHeight' | 'children' | 'triggerRef'> {
3
+ /** A correction amount (in px) to add to the minimum list width. */
4
+ widthCorrection?: number;
5
+ }
6
+ /**
7
+ * Displays a collapsible list activated via a trigger element.
8
+ *
9
+ * @internal
10
+ */
11
+ export declare function CollapsibleList({ children, widthCorrection, ...props }: CollapsibleListProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare namespace CollapsibleList {
13
+ var displayName: string;
14
+ }
15
+ export {};
16
+ //# sourceMappingURL=collapsible-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collapsible-list.d.ts","sourceRoot":"","sources":["../../../../../src/components/internal/collapsible-list/collapsible-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,YAAY,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEpG,UAAU,oBACR,SAAQ,IAAI,CAAC,eAAe,EAAE,WAAW,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,YAAY,CAAC;IAC/F,oEAAoE;IACpE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,eAAmB,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,2CAahG;yBAbe,eAAe"}
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Popover as RACPopover } from 'react-aria-components';
3
+ /**
4
+ * Displays a collapsible list activated via a trigger element.
5
+ *
6
+ * @internal
7
+ */
8
+ export function CollapsibleList({ children, widthCorrection = 0, ...props }) {
9
+ return (_jsx(RACPopover, { ...props, className: "cim-collapsible-list",
10
+ // @ts-expect-error `style` doesn't expect CSS variables
11
+ style: { '--trigger-width-corr': `${widthCorrection}px` }, containerPadding: 16, "data-cim-style-root": true, children: children }));
12
+ }
13
+ CollapsibleList.displayName = 'CollapsibleList';
14
+ //# sourceMappingURL=collapsible-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collapsible-list.js","sourceRoot":"","sources":["../../../../../src/components/internal/collapsible-list/collapsible-list.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAwC,MAAM,uBAAuB,CAAC;AAQpG;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,EAAE,QAAQ,EAAE,eAAe,GAAG,CAAC,EAAE,GAAG,KAAK,EAAwB;IAC/F,OAAO,CACL,KAAC,UAAU,OACL,KAAK,EACT,SAAS,EAAC,sBAAsB;QAChC,wDAAwD;QACxD,KAAK,EAAE,EAAE,sBAAsB,EAAE,GAAG,eAAe,IAAI,EAAE,EACzD,gBAAgB,EAAE,EAAE,yCAGnB,QAAQ,GACE,CACd,CAAC;AACJ,CAAC;AAED,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC","sourcesContent":["import { Popover as RACPopover, type PopoverProps as RACPopoverProps } from 'react-aria-components';\n\ninterface CollapsibleListProps\n extends Pick<RACPopoverProps, 'placement' | 'offset' | 'maxHeight' | 'children' | 'triggerRef'> {\n /** A correction amount (in px) to add to the minimum list width. */\n widthCorrection?: number;\n}\n\n/**\n * Displays a collapsible list activated via a trigger element.\n *\n * @internal\n */\nexport function CollapsibleList({ children, widthCorrection = 0, ...props }: CollapsibleListProps) {\n return (\n <RACPopover\n {...props}\n className=\"cim-collapsible-list\"\n // @ts-expect-error `style` doesn't expect CSS variables\n style={{ '--trigger-width-corr': `${widthCorrection}px` }}\n containerPadding={16}\n data-cim-style-root\n >\n {children}\n </RACPopover>\n );\n}\n\nCollapsibleList.displayName = 'CollapsibleList';\n"]}