@cimpress-ui/react 0.0.1 → 0.2.1

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 (582) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +5 -1
  3. package/dist/commonjs/components/breadcrumbs/breadcrumbs.d.ts +22 -0
  4. package/dist/commonjs/components/breadcrumbs/breadcrumbs.d.ts.map +1 -0
  5. package/dist/commonjs/components/breadcrumbs/breadcrumbs.js +37 -0
  6. package/dist/commonjs/components/breadcrumbs/breadcrumbs.js.map +1 -0
  7. package/dist/commonjs/components/button/button.d.ts +1 -1
  8. package/dist/commonjs/components/button/button.js +2 -2
  9. package/dist/commonjs/components/button/button.js.map +1 -1
  10. package/dist/commonjs/components/button/icon-button.d.ts +1 -1
  11. package/dist/commonjs/components/button/icon-button.js +2 -2
  12. package/dist/commonjs/components/button/icon-button.js.map +1 -1
  13. package/dist/commonjs/components/button/icon-link-button.d.ts +2 -2
  14. package/dist/commonjs/components/button/icon-link-button.d.ts.map +1 -1
  15. package/dist/commonjs/components/button/icon-link-button.js +1 -1
  16. package/dist/commonjs/components/button/icon-link-button.js.map +1 -1
  17. package/dist/commonjs/components/button/link-button.d.ts +2 -2
  18. package/dist/commonjs/components/button/link-button.d.ts.map +1 -1
  19. package/dist/commonjs/components/button/link-button.js +1 -1
  20. package/dist/commonjs/components/button/link-button.js.map +1 -1
  21. package/dist/commonjs/components/button/types.d.ts +1 -1
  22. package/dist/commonjs/components/button/types.d.ts.map +1 -1
  23. package/dist/commonjs/components/button/types.js.map +1 -1
  24. package/dist/commonjs/components/card/card-context.d.ts +4 -0
  25. package/dist/commonjs/components/card/card-context.d.ts.map +1 -0
  26. package/dist/commonjs/components/card/card-context.js +6 -0
  27. package/dist/commonjs/components/card/card-context.js.map +1 -0
  28. package/dist/commonjs/components/card/card.d.ts +15 -0
  29. package/dist/commonjs/components/card/card.d.ts.map +1 -0
  30. package/dist/commonjs/components/card/card.js +24 -0
  31. package/dist/commonjs/components/card/card.js.map +1 -0
  32. package/dist/commonjs/components/checkbox/checkbox-group.d.ts +1 -1
  33. package/dist/commonjs/components/checkbox/checkbox-group.js +1 -1
  34. package/dist/commonjs/components/checkbox/checkbox-group.js.map +1 -1
  35. package/dist/commonjs/components/checkbox/checkbox.d.ts +2 -2
  36. package/dist/commonjs/components/checkbox/checkbox.d.ts.map +1 -1
  37. package/dist/commonjs/components/checkbox/checkbox.js +1 -1
  38. package/dist/commonjs/components/checkbox/checkbox.js.map +1 -1
  39. package/dist/commonjs/components/combo-box/combo-box.d.ts +8 -4
  40. package/dist/commonjs/components/combo-box/combo-box.d.ts.map +1 -1
  41. package/dist/commonjs/components/combo-box/combo-box.js +7 -7
  42. package/dist/commonjs/components/combo-box/combo-box.js.map +1 -1
  43. package/dist/commonjs/components/disclosure/disclosure-group.d.ts +10 -0
  44. package/dist/commonjs/components/disclosure/disclosure-group.d.ts.map +1 -0
  45. package/dist/commonjs/components/disclosure/disclosure-group.js +18 -0
  46. package/dist/commonjs/components/disclosure/disclosure-group.js.map +1 -0
  47. package/dist/commonjs/components/disclosure/disclosure.d.ts +14 -0
  48. package/dist/commonjs/components/disclosure/disclosure.d.ts.map +1 -0
  49. package/dist/commonjs/components/disclosure/disclosure.js +20 -0
  50. package/dist/commonjs/components/disclosure/disclosure.js.map +1 -0
  51. package/dist/commonjs/components/internal/collapsible-list/collapsible-list.d.ts +0 -14
  52. package/dist/commonjs/components/internal/collapsible-list/collapsible-list.d.ts.map +1 -1
  53. package/dist/commonjs/components/internal/collapsible-list/collapsible-list.js +2 -4
  54. package/dist/commonjs/components/internal/collapsible-list/collapsible-list.js.map +1 -1
  55. package/dist/commonjs/components/internal/form-field/form-field.d.ts +1 -28
  56. package/dist/commonjs/components/internal/form-field/form-field.d.ts.map +1 -1
  57. package/dist/commonjs/components/internal/form-field/form-field.js +10 -0
  58. package/dist/commonjs/components/internal/form-field/form-field.js.map +1 -1
  59. package/dist/commonjs/components/internal/spinner/spinner.d.ts +0 -16
  60. package/dist/commonjs/components/internal/spinner/spinner.d.ts.map +1 -1
  61. package/dist/commonjs/components/menu/menu.d.ts +5 -4
  62. package/dist/commonjs/components/menu/menu.d.ts.map +1 -1
  63. package/dist/commonjs/components/menu/menu.js +3 -3
  64. package/dist/commonjs/components/menu/menu.js.map +1 -1
  65. package/dist/commonjs/components/modal/modal.d.ts +19 -0
  66. package/dist/commonjs/components/modal/modal.d.ts.map +1 -0
  67. package/dist/commonjs/components/modal/modal.js +25 -0
  68. package/dist/commonjs/components/modal/modal.js.map +1 -0
  69. package/dist/commonjs/components/nav-tabs/nav-tabs.d.ts +23 -0
  70. package/dist/commonjs/components/nav-tabs/nav-tabs.d.ts.map +1 -0
  71. package/dist/commonjs/components/nav-tabs/nav-tabs.js +27 -0
  72. package/dist/commonjs/components/nav-tabs/nav-tabs.js.map +1 -0
  73. package/dist/commonjs/components/number-field/number-field.d.ts +10 -0
  74. package/dist/commonjs/components/number-field/number-field.d.ts.map +1 -0
  75. package/dist/commonjs/components/number-field/number-field.js +32 -0
  76. package/dist/commonjs/components/number-field/number-field.js.map +1 -0
  77. package/dist/commonjs/components/pagination/pagination.d.ts +14 -0
  78. package/dist/commonjs/components/pagination/pagination.d.ts.map +1 -0
  79. package/dist/commonjs/components/pagination/pagination.js +69 -0
  80. package/dist/commonjs/components/pagination/pagination.js.map +1 -0
  81. package/dist/commonjs/components/radio/radio-group.d.ts +1 -1
  82. package/dist/commonjs/components/radio/radio-group.js +1 -1
  83. package/dist/commonjs/components/radio/radio-group.js.map +1 -1
  84. package/dist/commonjs/components/radio/radio.d.ts +2 -2
  85. package/dist/commonjs/components/radio/radio.d.ts.map +1 -1
  86. package/dist/commonjs/components/radio/radio.js +1 -1
  87. package/dist/commonjs/components/radio/radio.js.map +1 -1
  88. package/dist/commonjs/components/select/select.d.ts +4 -4
  89. package/dist/commonjs/components/select/select.d.ts.map +1 -1
  90. package/dist/commonjs/components/select/select.js +3 -3
  91. package/dist/commonjs/components/select/select.js.map +1 -1
  92. package/dist/commonjs/components/spinner/spinner.d.ts +5 -1
  93. package/dist/commonjs/components/spinner/spinner.d.ts.map +1 -1
  94. package/dist/commonjs/components/spinner/spinner.js +5 -2
  95. package/dist/commonjs/components/spinner/spinner.js.map +1 -1
  96. package/dist/commonjs/components/table/contexts/focus.d.ts +13 -0
  97. package/dist/commonjs/components/table/contexts/focus.d.ts.map +1 -0
  98. package/dist/commonjs/components/table/contexts/focus.js +51 -0
  99. package/dist/commonjs/components/table/contexts/focus.js.map +1 -0
  100. package/dist/commonjs/components/table/contexts/row-state.d.ts +10 -0
  101. package/dist/commonjs/components/table/contexts/row-state.d.ts.map +1 -0
  102. package/dist/commonjs/components/table/contexts/row-state.js +22 -0
  103. package/dist/commonjs/components/table/contexts/row-state.js.map +1 -0
  104. package/dist/commonjs/components/table/hooks/use-table-cell.d.ts +7 -0
  105. package/dist/commonjs/components/table/hooks/use-table-cell.d.ts.map +1 -0
  106. package/dist/commonjs/components/table/hooks/use-table-cell.js +125 -0
  107. package/dist/commonjs/components/table/hooks/use-table-cell.js.map +1 -0
  108. package/dist/commonjs/components/table/hooks/use-table.d.ts +7 -0
  109. package/dist/commonjs/components/table/hooks/use-table.d.ts.map +1 -0
  110. package/dist/commonjs/components/table/hooks/use-table.js +142 -0
  111. package/dist/commonjs/components/table/hooks/use-table.js.map +1 -0
  112. package/dist/commonjs/components/table/table-body-cell.d.ts +26 -0
  113. package/dist/commonjs/components/table/table-body-cell.d.ts.map +1 -0
  114. package/dist/commonjs/components/table/table-body-cell.js +17 -0
  115. package/dist/commonjs/components/table/table-body-cell.js.map +1 -0
  116. package/dist/commonjs/components/table/table-body.d.ts +8 -0
  117. package/dist/commonjs/components/table/table-body.d.ts.map +1 -0
  118. package/dist/commonjs/components/table/table-body.js +11 -0
  119. package/dist/commonjs/components/table/table-body.js.map +1 -0
  120. package/dist/commonjs/components/table/table-container.d.ts +8 -0
  121. package/dist/commonjs/components/table/table-container.d.ts.map +1 -0
  122. package/dist/commonjs/components/table/table-container.js +40 -0
  123. package/dist/commonjs/components/table/table-container.js.map +1 -0
  124. package/dist/commonjs/components/table/table-header-cell.d.ts +26 -0
  125. package/dist/commonjs/components/table/table-header-cell.d.ts.map +1 -0
  126. package/dist/commonjs/components/table/table-header-cell.js +17 -0
  127. package/dist/commonjs/components/table/table-header-cell.js.map +1 -0
  128. package/dist/commonjs/components/table/table-header.d.ts +8 -0
  129. package/dist/commonjs/components/table/table-header.d.ts.map +1 -0
  130. package/dist/commonjs/components/table/table-header.js +11 -0
  131. package/dist/commonjs/components/table/table-header.js.map +1 -0
  132. package/dist/commonjs/components/table/table-row.d.ts +21 -0
  133. package/dist/commonjs/components/table/table-row.d.ts.map +1 -0
  134. package/dist/commonjs/components/table/table-row.js +14 -0
  135. package/dist/commonjs/components/table/table-row.js.map +1 -0
  136. package/dist/commonjs/components/table/table.d.ts +26 -0
  137. package/dist/commonjs/components/table/table.d.ts.map +1 -0
  138. package/dist/commonjs/components/table/table.js +27 -0
  139. package/dist/commonjs/components/table/table.js.map +1 -0
  140. package/dist/commonjs/components/table/utils/focus-table-child.d.ts +4 -0
  141. package/dist/commonjs/components/table/utils/focus-table-child.d.ts.map +1 -0
  142. package/dist/commonjs/components/table/utils/focus-table-child.js +14 -0
  143. package/dist/commonjs/components/table/utils/focus-table-child.js.map +1 -0
  144. package/dist/commonjs/components/tag/tag-group.d.ts +18 -0
  145. package/dist/commonjs/components/tag/tag-group.d.ts.map +1 -0
  146. package/dist/commonjs/components/tag/tag-group.js +27 -0
  147. package/dist/commonjs/components/tag/tag-group.js.map +1 -0
  148. package/dist/commonjs/components/tag/tag.d.ts +17 -0
  149. package/dist/commonjs/components/tag/tag.d.ts.map +1 -0
  150. package/dist/commonjs/components/tag/tag.js +20 -0
  151. package/dist/commonjs/components/tag/tag.js.map +1 -0
  152. package/dist/commonjs/components/text-inputs/text-area.d.ts +1 -1
  153. package/dist/commonjs/components/text-inputs/text-area.d.ts.map +1 -1
  154. package/dist/commonjs/components/text-inputs/text-area.js +1 -1
  155. package/dist/commonjs/components/text-inputs/text-area.js.map +1 -1
  156. package/dist/commonjs/components/text-inputs/text-field.d.ts +2 -2
  157. package/dist/commonjs/components/text-inputs/text-field.d.ts.map +1 -1
  158. package/dist/commonjs/components/text-inputs/text-field.js +2 -2
  159. package/dist/commonjs/components/text-inputs/text-field.js.map +1 -1
  160. package/dist/commonjs/components/tooltip/tooltip.d.ts +9 -0
  161. package/dist/commonjs/components/tooltip/tooltip.d.ts.map +1 -0
  162. package/dist/commonjs/components/tooltip/tooltip.js +15 -0
  163. package/dist/commonjs/components/tooltip/tooltip.js.map +1 -0
  164. package/dist/commonjs/components/types.d.ts +32 -6
  165. package/dist/commonjs/components/types.d.ts.map +1 -1
  166. package/dist/commonjs/components/types.js.map +1 -1
  167. package/dist/commonjs/components/typography/link.d.ts +7 -3
  168. package/dist/commonjs/components/typography/link.d.ts.map +1 -1
  169. package/dist/commonjs/components/typography/link.js +8 -4
  170. package/dist/commonjs/components/typography/link.js.map +1 -1
  171. package/dist/commonjs/components/typography/text.d.ts +5 -1
  172. package/dist/commonjs/components/typography/text.d.ts.map +1 -1
  173. package/dist/commonjs/components/typography/text.js +5 -2
  174. package/dist/commonjs/components/typography/text.js.map +1 -1
  175. package/dist/commonjs/components/typography/types.d.ts +3 -2
  176. package/dist/commonjs/components/typography/types.d.ts.map +1 -1
  177. package/dist/commonjs/components/typography/types.js.map +1 -1
  178. package/dist/commonjs/components/typography/utils.d.ts.map +1 -1
  179. package/dist/commonjs/components/typography/utils.js +2 -2
  180. package/dist/commonjs/components/typography/utils.js.map +1 -1
  181. package/dist/commonjs/components/visually-hidden/visually-hidden.d.ts +17 -0
  182. package/dist/commonjs/components/visually-hidden/visually-hidden.d.ts.map +1 -0
  183. package/dist/commonjs/components/visually-hidden/visually-hidden.js +20 -0
  184. package/dist/commonjs/components/visually-hidden/visually-hidden.js.map +1 -0
  185. package/dist/commonjs/icons/accounting-document.d.ts +8 -0
  186. package/dist/commonjs/icons/accounting-document.d.ts.map +1 -0
  187. package/dist/commonjs/icons/accounting-document.js +24 -0
  188. package/dist/commonjs/icons/accounting-document.js.map +1 -0
  189. package/dist/commonjs/icons/add-circle-fill.d.ts +8 -0
  190. package/dist/commonjs/icons/add-circle-fill.d.ts.map +1 -0
  191. package/dist/commonjs/icons/add-circle-fill.js +24 -0
  192. package/dist/commonjs/icons/add-circle-fill.js.map +1 -0
  193. package/dist/commonjs/icons/add-circle.d.ts +8 -0
  194. package/dist/commonjs/icons/add-circle.d.ts.map +1 -0
  195. package/dist/commonjs/icons/add-circle.js +24 -0
  196. package/dist/commonjs/icons/add-circle.js.map +1 -0
  197. package/dist/commonjs/icons/add.d.ts +1 -1
  198. package/dist/commonjs/icons/add.d.ts.map +1 -1
  199. package/dist/commonjs/icons/add.js +6 -3
  200. package/dist/commonjs/icons/add.js.map +1 -1
  201. package/dist/commonjs/icons/alert-triangle.d.ts +1 -1
  202. package/dist/commonjs/icons/alert-triangle.d.ts.map +1 -1
  203. package/dist/commonjs/icons/alert-triangle.js +6 -3
  204. package/dist/commonjs/icons/alert-triangle.js.map +1 -1
  205. package/dist/commonjs/icons/calculator-alt.d.ts +8 -0
  206. package/dist/commonjs/icons/calculator-alt.d.ts.map +1 -0
  207. package/dist/commonjs/icons/calculator-alt.js +24 -0
  208. package/dist/commonjs/icons/calculator-alt.js.map +1 -0
  209. package/dist/commonjs/icons/calculator.d.ts +8 -0
  210. package/dist/commonjs/icons/calculator.d.ts.map +1 -0
  211. package/dist/commonjs/icons/calculator.js +24 -0
  212. package/dist/commonjs/icons/calculator.js.map +1 -0
  213. package/dist/commonjs/icons/checkmark-circle-fill.d.ts +1 -1
  214. package/dist/commonjs/icons/checkmark-circle-fill.d.ts.map +1 -1
  215. package/dist/commonjs/icons/checkmark-circle-fill.js +6 -3
  216. package/dist/commonjs/icons/checkmark-circle-fill.js.map +1 -1
  217. package/dist/commonjs/icons/checkmark-circle.d.ts +8 -0
  218. package/dist/commonjs/icons/checkmark-circle.d.ts.map +1 -0
  219. package/dist/commonjs/icons/checkmark-circle.js +24 -0
  220. package/dist/commonjs/icons/checkmark-circle.js.map +1 -0
  221. package/dist/commonjs/icons/checkmark-small.d.ts +1 -1
  222. package/dist/commonjs/icons/checkmark-small.d.ts.map +1 -1
  223. package/dist/commonjs/icons/checkmark-small.js +6 -3
  224. package/dist/commonjs/icons/checkmark-small.js.map +1 -1
  225. package/dist/commonjs/icons/checkmark.d.ts +1 -1
  226. package/dist/commonjs/icons/checkmark.d.ts.map +1 -1
  227. package/dist/commonjs/icons/checkmark.js +6 -3
  228. package/dist/commonjs/icons/checkmark.js.map +1 -1
  229. package/dist/commonjs/icons/chevron-down-fill.d.ts +1 -1
  230. package/dist/commonjs/icons/chevron-down-fill.d.ts.map +1 -1
  231. package/dist/commonjs/icons/chevron-down-fill.js +6 -3
  232. package/dist/commonjs/icons/chevron-down-fill.js.map +1 -1
  233. package/dist/commonjs/icons/error-circle-fill.d.ts +1 -1
  234. package/dist/commonjs/icons/error-circle-fill.d.ts.map +1 -1
  235. package/dist/commonjs/icons/error-circle-fill.js +6 -3
  236. package/dist/commonjs/icons/error-circle-fill.js.map +1 -1
  237. package/dist/commonjs/icons/index.d.ts +14 -0
  238. package/dist/commonjs/icons/index.d.ts.map +1 -1
  239. package/dist/commonjs/icons/index.js +29 -1
  240. package/dist/commonjs/icons/index.js.map +1 -1
  241. package/dist/commonjs/icons/info-circle-fill.d.ts +8 -0
  242. package/dist/commonjs/icons/info-circle-fill.d.ts.map +1 -0
  243. package/dist/commonjs/icons/info-circle-fill.js +24 -0
  244. package/dist/commonjs/icons/info-circle-fill.js.map +1 -0
  245. package/dist/commonjs/icons/minus-small.d.ts +1 -1
  246. package/dist/commonjs/icons/minus-small.d.ts.map +1 -1
  247. package/dist/commonjs/icons/minus-small.js +6 -3
  248. package/dist/commonjs/icons/minus-small.js.map +1 -1
  249. package/dist/commonjs/icons/minus.d.ts +8 -0
  250. package/dist/commonjs/icons/minus.d.ts.map +1 -0
  251. package/dist/commonjs/icons/minus.js +24 -0
  252. package/dist/commonjs/icons/minus.js.map +1 -0
  253. package/dist/commonjs/icons/unstable-chevron-left-fill.d.ts +8 -0
  254. package/dist/commonjs/icons/unstable-chevron-left-fill.d.ts.map +1 -0
  255. package/dist/commonjs/icons/unstable-chevron-left-fill.js +24 -0
  256. package/dist/commonjs/icons/unstable-chevron-left-fill.js.map +1 -0
  257. package/dist/commonjs/icons/unstable-chevron-right-fill.d.ts +8 -0
  258. package/dist/commonjs/icons/unstable-chevron-right-fill.d.ts.map +1 -0
  259. package/dist/commonjs/icons/unstable-chevron-right-fill.js +24 -0
  260. package/dist/commonjs/icons/unstable-chevron-right-fill.js.map +1 -0
  261. package/dist/commonjs/icons/unstable-close.d.ts +8 -0
  262. package/dist/commonjs/icons/unstable-close.d.ts.map +1 -0
  263. package/dist/commonjs/icons/unstable-close.js +24 -0
  264. package/dist/commonjs/icons/unstable-close.js.map +1 -0
  265. package/dist/commonjs/icons/unstable-info-circle.d.ts +8 -0
  266. package/dist/commonjs/icons/unstable-info-circle.d.ts.map +1 -0
  267. package/dist/commonjs/icons/unstable-info-circle.js +24 -0
  268. package/dist/commonjs/icons/unstable-info-circle.js.map +1 -0
  269. package/dist/commonjs/icons/unstable-placeholder.d.ts +8 -0
  270. package/dist/commonjs/icons/unstable-placeholder.d.ts.map +1 -0
  271. package/dist/commonjs/icons/unstable-placeholder.js +24 -0
  272. package/dist/commonjs/icons/unstable-placeholder.js.map +1 -0
  273. package/dist/commonjs/icons/warning-circle-fill.d.ts +8 -0
  274. package/dist/commonjs/icons/warning-circle-fill.d.ts.map +1 -0
  275. package/dist/commonjs/icons/warning-circle-fill.js +24 -0
  276. package/dist/commonjs/icons/warning-circle-fill.js.map +1 -0
  277. package/dist/commonjs/index.d.ts +21 -1
  278. package/dist/commonjs/index.d.ts.map +1 -1
  279. package/dist/commonjs/index.js +19 -0
  280. package/dist/commonjs/index.js.map +1 -1
  281. package/dist/commonjs/utils/style/tone.d.ts +3 -0
  282. package/dist/commonjs/utils/style/tone.d.ts.map +1 -0
  283. package/dist/commonjs/utils/style/tone.js +7 -0
  284. package/dist/commonjs/utils/style/tone.js.map +1 -0
  285. package/dist/commonjs/utils/style/types.d.ts +2 -0
  286. package/dist/commonjs/utils/style/types.d.ts.map +1 -0
  287. package/dist/commonjs/utils/style/types.js +3 -0
  288. package/dist/commonjs/utils/style/types.js.map +1 -0
  289. package/dist/commonjs/with-style-props.d.ts +1 -1
  290. package/dist/commonjs/with-style-props.d.ts.map +1 -1
  291. package/dist/commonjs/with-style-props.js.map +1 -1
  292. package/dist/esm/components/breadcrumbs/breadcrumbs.d.ts +22 -0
  293. package/dist/esm/components/breadcrumbs/breadcrumbs.d.ts.map +1 -0
  294. package/dist/esm/components/breadcrumbs/breadcrumbs.js +30 -0
  295. package/dist/esm/components/breadcrumbs/breadcrumbs.js.map +1 -0
  296. package/dist/esm/components/button/button.d.ts +1 -1
  297. package/dist/esm/components/button/button.js +2 -2
  298. package/dist/esm/components/button/button.js.map +1 -1
  299. package/dist/esm/components/button/icon-button.d.ts +1 -1
  300. package/dist/esm/components/button/icon-button.js +2 -2
  301. package/dist/esm/components/button/icon-button.js.map +1 -1
  302. package/dist/esm/components/button/icon-link-button.d.ts +2 -2
  303. package/dist/esm/components/button/icon-link-button.d.ts.map +1 -1
  304. package/dist/esm/components/button/icon-link-button.js +1 -1
  305. package/dist/esm/components/button/icon-link-button.js.map +1 -1
  306. package/dist/esm/components/button/link-button.d.ts +2 -2
  307. package/dist/esm/components/button/link-button.d.ts.map +1 -1
  308. package/dist/esm/components/button/link-button.js +1 -1
  309. package/dist/esm/components/button/link-button.js.map +1 -1
  310. package/dist/esm/components/button/types.d.ts +1 -1
  311. package/dist/esm/components/button/types.d.ts.map +1 -1
  312. package/dist/esm/components/button/types.js.map +1 -1
  313. package/dist/esm/components/card/card-context.d.ts +4 -0
  314. package/dist/esm/components/card/card-context.d.ts.map +1 -0
  315. package/dist/esm/components/card/card-context.js +3 -0
  316. package/dist/esm/components/card/card-context.js.map +1 -0
  317. package/dist/esm/components/card/card.d.ts +15 -0
  318. package/dist/esm/components/card/card.d.ts.map +1 -0
  319. package/dist/esm/components/card/card.js +17 -0
  320. package/dist/esm/components/card/card.js.map +1 -0
  321. package/dist/esm/components/checkbox/checkbox-group.d.ts +1 -1
  322. package/dist/esm/components/checkbox/checkbox-group.js +1 -1
  323. package/dist/esm/components/checkbox/checkbox-group.js.map +1 -1
  324. package/dist/esm/components/checkbox/checkbox.d.ts +2 -2
  325. package/dist/esm/components/checkbox/checkbox.d.ts.map +1 -1
  326. package/dist/esm/components/checkbox/checkbox.js +1 -1
  327. package/dist/esm/components/checkbox/checkbox.js.map +1 -1
  328. package/dist/esm/components/combo-box/combo-box.d.ts +8 -4
  329. package/dist/esm/components/combo-box/combo-box.d.ts.map +1 -1
  330. package/dist/esm/components/combo-box/combo-box.js +8 -8
  331. package/dist/esm/components/combo-box/combo-box.js.map +1 -1
  332. package/dist/esm/components/disclosure/disclosure-group.d.ts +10 -0
  333. package/dist/esm/components/disclosure/disclosure-group.d.ts.map +1 -0
  334. package/dist/esm/components/disclosure/disclosure-group.js +12 -0
  335. package/dist/esm/components/disclosure/disclosure-group.js.map +1 -0
  336. package/dist/esm/components/disclosure/disclosure.d.ts +14 -0
  337. package/dist/esm/components/disclosure/disclosure.d.ts.map +1 -0
  338. package/dist/esm/components/disclosure/disclosure.js +14 -0
  339. package/dist/esm/components/disclosure/disclosure.js.map +1 -0
  340. package/dist/esm/components/internal/collapsible-list/collapsible-list.d.ts +0 -14
  341. package/dist/esm/components/internal/collapsible-list/collapsible-list.d.ts.map +1 -1
  342. package/dist/esm/components/internal/collapsible-list/collapsible-list.js +2 -4
  343. package/dist/esm/components/internal/collapsible-list/collapsible-list.js.map +1 -1
  344. package/dist/esm/components/internal/form-field/form-field.d.ts +1 -28
  345. package/dist/esm/components/internal/form-field/form-field.d.ts.map +1 -1
  346. package/dist/esm/components/internal/form-field/form-field.js +10 -1
  347. package/dist/esm/components/internal/form-field/form-field.js.map +1 -1
  348. package/dist/esm/components/internal/spinner/spinner.d.ts +0 -16
  349. package/dist/esm/components/internal/spinner/spinner.d.ts.map +1 -1
  350. package/dist/esm/components/menu/menu.d.ts +5 -4
  351. package/dist/esm/components/menu/menu.d.ts.map +1 -1
  352. package/dist/esm/components/menu/menu.js +3 -3
  353. package/dist/esm/components/menu/menu.js.map +1 -1
  354. package/dist/esm/components/modal/modal.d.ts +19 -0
  355. package/dist/esm/components/modal/modal.d.ts.map +1 -0
  356. package/dist/esm/components/modal/modal.js +18 -0
  357. package/dist/esm/components/modal/modal.js.map +1 -0
  358. package/dist/esm/components/nav-tabs/nav-tabs.d.ts +23 -0
  359. package/dist/esm/components/nav-tabs/nav-tabs.d.ts.map +1 -0
  360. package/dist/esm/components/nav-tabs/nav-tabs.js +20 -0
  361. package/dist/esm/components/nav-tabs/nav-tabs.js.map +1 -0
  362. package/dist/esm/components/number-field/number-field.d.ts +10 -0
  363. package/dist/esm/components/number-field/number-field.d.ts.map +1 -0
  364. package/dist/esm/components/number-field/number-field.js +26 -0
  365. package/dist/esm/components/number-field/number-field.js.map +1 -0
  366. package/dist/esm/components/pagination/pagination.d.ts +14 -0
  367. package/dist/esm/components/pagination/pagination.d.ts.map +1 -0
  368. package/dist/esm/components/pagination/pagination.js +66 -0
  369. package/dist/esm/components/pagination/pagination.js.map +1 -0
  370. package/dist/esm/components/radio/radio-group.d.ts +1 -1
  371. package/dist/esm/components/radio/radio-group.js +1 -1
  372. package/dist/esm/components/radio/radio-group.js.map +1 -1
  373. package/dist/esm/components/radio/radio.d.ts +2 -2
  374. package/dist/esm/components/radio/radio.d.ts.map +1 -1
  375. package/dist/esm/components/radio/radio.js +1 -1
  376. package/dist/esm/components/radio/radio.js.map +1 -1
  377. package/dist/esm/components/select/select.d.ts +4 -4
  378. package/dist/esm/components/select/select.d.ts.map +1 -1
  379. package/dist/esm/components/select/select.js +3 -3
  380. package/dist/esm/components/select/select.js.map +1 -1
  381. package/dist/esm/components/spinner/spinner.d.ts +5 -1
  382. package/dist/esm/components/spinner/spinner.d.ts.map +1 -1
  383. package/dist/esm/components/spinner/spinner.js +5 -2
  384. package/dist/esm/components/spinner/spinner.js.map +1 -1
  385. package/dist/esm/components/table/contexts/focus.d.ts +13 -0
  386. package/dist/esm/components/table/contexts/focus.d.ts.map +1 -0
  387. package/dist/esm/components/table/contexts/focus.js +47 -0
  388. package/dist/esm/components/table/contexts/focus.js.map +1 -0
  389. package/dist/esm/components/table/contexts/row-state.d.ts +10 -0
  390. package/dist/esm/components/table/contexts/row-state.d.ts.map +1 -0
  391. package/dist/esm/components/table/contexts/row-state.js +18 -0
  392. package/dist/esm/components/table/contexts/row-state.js.map +1 -0
  393. package/dist/esm/components/table/hooks/use-table-cell.d.ts +7 -0
  394. package/dist/esm/components/table/hooks/use-table-cell.d.ts.map +1 -0
  395. package/dist/esm/components/table/hooks/use-table-cell.js +122 -0
  396. package/dist/esm/components/table/hooks/use-table-cell.js.map +1 -0
  397. package/dist/esm/components/table/hooks/use-table.d.ts +7 -0
  398. package/dist/esm/components/table/hooks/use-table.d.ts.map +1 -0
  399. package/dist/esm/components/table/hooks/use-table.js +139 -0
  400. package/dist/esm/components/table/hooks/use-table.js.map +1 -0
  401. package/dist/esm/components/table/table-body-cell.d.ts +26 -0
  402. package/dist/esm/components/table/table-body-cell.d.ts.map +1 -0
  403. package/dist/esm/components/table/table-body-cell.js +14 -0
  404. package/dist/esm/components/table/table-body-cell.js.map +1 -0
  405. package/dist/esm/components/table/table-body.d.ts +8 -0
  406. package/dist/esm/components/table/table-body.d.ts.map +1 -0
  407. package/dist/esm/components/table/table-body.js +8 -0
  408. package/dist/esm/components/table/table-body.js.map +1 -0
  409. package/dist/esm/components/table/table-container.d.ts +8 -0
  410. package/dist/esm/components/table/table-container.d.ts.map +1 -0
  411. package/dist/esm/components/table/table-container.js +34 -0
  412. package/dist/esm/components/table/table-container.js.map +1 -0
  413. package/dist/esm/components/table/table-header-cell.d.ts +26 -0
  414. package/dist/esm/components/table/table-header-cell.d.ts.map +1 -0
  415. package/dist/esm/components/table/table-header-cell.js +14 -0
  416. package/dist/esm/components/table/table-header-cell.js.map +1 -0
  417. package/dist/esm/components/table/table-header.d.ts +8 -0
  418. package/dist/esm/components/table/table-header.d.ts.map +1 -0
  419. package/dist/esm/components/table/table-header.js +8 -0
  420. package/dist/esm/components/table/table-header.js.map +1 -0
  421. package/dist/esm/components/table/table-row.d.ts +21 -0
  422. package/dist/esm/components/table/table-row.d.ts.map +1 -0
  423. package/dist/esm/components/table/table-row.js +11 -0
  424. package/dist/esm/components/table/table-row.js.map +1 -0
  425. package/dist/esm/components/table/table.d.ts +26 -0
  426. package/dist/esm/components/table/table.d.ts.map +1 -0
  427. package/dist/esm/components/table/table.js +24 -0
  428. package/dist/esm/components/table/table.js.map +1 -0
  429. package/dist/esm/components/table/utils/focus-table-child.d.ts +4 -0
  430. package/dist/esm/components/table/utils/focus-table-child.d.ts.map +1 -0
  431. package/dist/esm/components/table/utils/focus-table-child.js +11 -0
  432. package/dist/esm/components/table/utils/focus-table-child.js.map +1 -0
  433. package/dist/esm/components/tag/tag-group.d.ts +18 -0
  434. package/dist/esm/components/tag/tag-group.d.ts.map +1 -0
  435. package/dist/esm/components/tag/tag-group.js +21 -0
  436. package/dist/esm/components/tag/tag-group.js.map +1 -0
  437. package/dist/esm/components/tag/tag.d.ts +17 -0
  438. package/dist/esm/components/tag/tag.d.ts.map +1 -0
  439. package/dist/esm/components/tag/tag.js +14 -0
  440. package/dist/esm/components/tag/tag.js.map +1 -0
  441. package/dist/esm/components/text-inputs/text-area.d.ts +1 -1
  442. package/dist/esm/components/text-inputs/text-area.d.ts.map +1 -1
  443. package/dist/esm/components/text-inputs/text-area.js +3 -3
  444. package/dist/esm/components/text-inputs/text-area.js.map +1 -1
  445. package/dist/esm/components/text-inputs/text-field.d.ts +2 -2
  446. package/dist/esm/components/text-inputs/text-field.d.ts.map +1 -1
  447. package/dist/esm/components/text-inputs/text-field.js +4 -4
  448. package/dist/esm/components/text-inputs/text-field.js.map +1 -1
  449. package/dist/esm/components/tooltip/tooltip.d.ts +9 -0
  450. package/dist/esm/components/tooltip/tooltip.d.ts.map +1 -0
  451. package/dist/esm/components/tooltip/tooltip.js +9 -0
  452. package/dist/esm/components/tooltip/tooltip.js.map +1 -0
  453. package/dist/esm/components/types.d.ts +32 -6
  454. package/dist/esm/components/types.d.ts.map +1 -1
  455. package/dist/esm/components/types.js.map +1 -1
  456. package/dist/esm/components/typography/link.d.ts +7 -3
  457. package/dist/esm/components/typography/link.d.ts.map +1 -1
  458. package/dist/esm/components/typography/link.js +8 -4
  459. package/dist/esm/components/typography/link.js.map +1 -1
  460. package/dist/esm/components/typography/text.d.ts +5 -1
  461. package/dist/esm/components/typography/text.d.ts.map +1 -1
  462. package/dist/esm/components/typography/text.js +5 -2
  463. package/dist/esm/components/typography/text.js.map +1 -1
  464. package/dist/esm/components/typography/types.d.ts +3 -2
  465. package/dist/esm/components/typography/types.d.ts.map +1 -1
  466. package/dist/esm/components/typography/types.js.map +1 -1
  467. package/dist/esm/components/typography/utils.d.ts.map +1 -1
  468. package/dist/esm/components/typography/utils.js +2 -2
  469. package/dist/esm/components/typography/utils.js.map +1 -1
  470. package/dist/esm/components/visually-hidden/visually-hidden.d.ts +17 -0
  471. package/dist/esm/components/visually-hidden/visually-hidden.d.ts.map +1 -0
  472. package/dist/esm/components/visually-hidden/visually-hidden.js +14 -0
  473. package/dist/esm/components/visually-hidden/visually-hidden.js.map +1 -0
  474. package/dist/esm/icons/accounting-document.d.ts +8 -0
  475. package/dist/esm/icons/accounting-document.d.ts.map +1 -0
  476. package/dist/esm/icons/accounting-document.js +19 -0
  477. package/dist/esm/icons/accounting-document.js.map +1 -0
  478. package/dist/esm/icons/add-circle-fill.d.ts +8 -0
  479. package/dist/esm/icons/add-circle-fill.d.ts.map +1 -0
  480. package/dist/esm/icons/add-circle-fill.js +19 -0
  481. package/dist/esm/icons/add-circle-fill.js.map +1 -0
  482. package/dist/esm/icons/add-circle.d.ts +8 -0
  483. package/dist/esm/icons/add-circle.d.ts.map +1 -0
  484. package/dist/esm/icons/add-circle.js +19 -0
  485. package/dist/esm/icons/add-circle.js.map +1 -0
  486. package/dist/esm/icons/add.d.ts +1 -1
  487. package/dist/esm/icons/add.d.ts.map +1 -1
  488. package/dist/esm/icons/add.js +6 -3
  489. package/dist/esm/icons/add.js.map +1 -1
  490. package/dist/esm/icons/alert-triangle.d.ts +1 -1
  491. package/dist/esm/icons/alert-triangle.d.ts.map +1 -1
  492. package/dist/esm/icons/alert-triangle.js +6 -3
  493. package/dist/esm/icons/alert-triangle.js.map +1 -1
  494. package/dist/esm/icons/calculator-alt.d.ts +8 -0
  495. package/dist/esm/icons/calculator-alt.d.ts.map +1 -0
  496. package/dist/esm/icons/calculator-alt.js +19 -0
  497. package/dist/esm/icons/calculator-alt.js.map +1 -0
  498. package/dist/esm/icons/calculator.d.ts +8 -0
  499. package/dist/esm/icons/calculator.d.ts.map +1 -0
  500. package/dist/esm/icons/calculator.js +19 -0
  501. package/dist/esm/icons/calculator.js.map +1 -0
  502. package/dist/esm/icons/checkmark-circle-fill.d.ts +1 -1
  503. package/dist/esm/icons/checkmark-circle-fill.d.ts.map +1 -1
  504. package/dist/esm/icons/checkmark-circle-fill.js +6 -3
  505. package/dist/esm/icons/checkmark-circle-fill.js.map +1 -1
  506. package/dist/esm/icons/checkmark-circle.d.ts +8 -0
  507. package/dist/esm/icons/checkmark-circle.d.ts.map +1 -0
  508. package/dist/esm/icons/checkmark-circle.js +19 -0
  509. package/dist/esm/icons/checkmark-circle.js.map +1 -0
  510. package/dist/esm/icons/checkmark-small.d.ts +1 -1
  511. package/dist/esm/icons/checkmark-small.d.ts.map +1 -1
  512. package/dist/esm/icons/checkmark-small.js +6 -3
  513. package/dist/esm/icons/checkmark-small.js.map +1 -1
  514. package/dist/esm/icons/checkmark.d.ts +1 -1
  515. package/dist/esm/icons/checkmark.d.ts.map +1 -1
  516. package/dist/esm/icons/checkmark.js +6 -3
  517. package/dist/esm/icons/checkmark.js.map +1 -1
  518. package/dist/esm/icons/chevron-down-fill.d.ts +1 -1
  519. package/dist/esm/icons/chevron-down-fill.d.ts.map +1 -1
  520. package/dist/esm/icons/chevron-down-fill.js +6 -3
  521. package/dist/esm/icons/chevron-down-fill.js.map +1 -1
  522. package/dist/esm/icons/error-circle-fill.d.ts +1 -1
  523. package/dist/esm/icons/error-circle-fill.d.ts.map +1 -1
  524. package/dist/esm/icons/error-circle-fill.js +7 -4
  525. package/dist/esm/icons/error-circle-fill.js.map +1 -1
  526. package/dist/esm/icons/index.d.ts +14 -0
  527. package/dist/esm/icons/index.d.ts.map +1 -1
  528. package/dist/esm/icons/index.js +14 -0
  529. package/dist/esm/icons/index.js.map +1 -1
  530. package/dist/esm/icons/info-circle-fill.d.ts +8 -0
  531. package/dist/esm/icons/info-circle-fill.d.ts.map +1 -0
  532. package/dist/esm/icons/info-circle-fill.js +19 -0
  533. package/dist/esm/icons/info-circle-fill.js.map +1 -0
  534. package/dist/esm/icons/minus-small.d.ts +1 -1
  535. package/dist/esm/icons/minus-small.d.ts.map +1 -1
  536. package/dist/esm/icons/minus-small.js +6 -3
  537. package/dist/esm/icons/minus-small.js.map +1 -1
  538. package/dist/esm/icons/minus.d.ts +8 -0
  539. package/dist/esm/icons/minus.d.ts.map +1 -0
  540. package/dist/esm/icons/minus.js +19 -0
  541. package/dist/esm/icons/minus.js.map +1 -0
  542. package/dist/esm/icons/unstable-chevron-left-fill.d.ts +8 -0
  543. package/dist/esm/icons/unstable-chevron-left-fill.d.ts.map +1 -0
  544. package/dist/esm/icons/unstable-chevron-left-fill.js +19 -0
  545. package/dist/esm/icons/unstable-chevron-left-fill.js.map +1 -0
  546. package/dist/esm/icons/unstable-chevron-right-fill.d.ts +8 -0
  547. package/dist/esm/icons/unstable-chevron-right-fill.d.ts.map +1 -0
  548. package/dist/esm/icons/unstable-chevron-right-fill.js +19 -0
  549. package/dist/esm/icons/unstable-chevron-right-fill.js.map +1 -0
  550. package/dist/esm/icons/unstable-close.d.ts +8 -0
  551. package/dist/esm/icons/unstable-close.d.ts.map +1 -0
  552. package/dist/esm/icons/unstable-close.js +19 -0
  553. package/dist/esm/icons/unstable-close.js.map +1 -0
  554. package/dist/esm/icons/unstable-info-circle.d.ts +8 -0
  555. package/dist/esm/icons/unstable-info-circle.d.ts.map +1 -0
  556. package/dist/esm/icons/unstable-info-circle.js +19 -0
  557. package/dist/esm/icons/unstable-info-circle.js.map +1 -0
  558. package/dist/esm/icons/unstable-placeholder.d.ts +8 -0
  559. package/dist/esm/icons/unstable-placeholder.d.ts.map +1 -0
  560. package/dist/esm/icons/unstable-placeholder.js +19 -0
  561. package/dist/esm/icons/unstable-placeholder.js.map +1 -0
  562. package/dist/esm/icons/warning-circle-fill.d.ts +8 -0
  563. package/dist/esm/icons/warning-circle-fill.d.ts.map +1 -0
  564. package/dist/esm/icons/warning-circle-fill.js +19 -0
  565. package/dist/esm/icons/warning-circle-fill.js.map +1 -0
  566. package/dist/esm/index.d.ts +21 -1
  567. package/dist/esm/index.d.ts.map +1 -1
  568. package/dist/esm/index.js +19 -0
  569. package/dist/esm/index.js.map +1 -1
  570. package/dist/esm/utils/style/tone.d.ts +3 -0
  571. package/dist/esm/utils/style/tone.d.ts.map +1 -0
  572. package/dist/esm/utils/style/tone.js +4 -0
  573. package/dist/esm/utils/style/tone.js.map +1 -0
  574. package/dist/esm/utils/style/types.d.ts +2 -0
  575. package/dist/esm/utils/style/types.d.ts.map +1 -0
  576. package/dist/esm/utils/style/types.js +2 -0
  577. package/dist/esm/utils/style/types.js.map +1 -0
  578. package/dist/esm/with-style-props.d.ts +1 -1
  579. package/dist/esm/with-style-props.d.ts.map +1 -1
  580. package/dist/esm/with-style-props.js.map +1 -1
  581. package/dist-styles/styles.css +1 -1
  582. package/package.json +28 -25
@@ -0,0 +1 @@
1
+ {"version":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BAAkB,aAC9B,KAAK,IAAI,CACR,KAAC,UAAU,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,YAC3F,KAAK,GACK,CACd,EACD,KAAC,UAAU,IACT,IAAI,EAAC,OAAO,EACZ,IAAI,EAAE,KAAC,kBAAkB,KAAG,EAC5B,OAAO,EAAC,UAAU,EAClB,IAAI,EAAC,OAAO,gBACD,aAAa,EACxB,gBAAgB,EAAC,wBAAwB,GACzC,IACE,EACN,cAAK,SAAS,EAAC,mBAAmB,YAAE,QAAQ,GAAO,IACzC,GACH,GACK,CACnB,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport {\n Heading as RACHeading,\n Dialog as RACDialog,\n DialogTrigger as RACDialogTrigger,\n Modal as RACModal,\n ModalOverlay as RACModalOverlay,\n type ModalOverlayProps as RACModalOverlayProps,\n} from 'react-aria-components';\nimport { UNSTABLE_IconClose } from '../../icons/index.js';\nimport { IconButton } from '../button/icon-button.js';\nimport type { CommonProps } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface UNSTABLE_ModalProps extends CommonProps, Pick<RACModalOverlayProps, 'isDismissable'> {\n children: ReactNode;\n title?: string;\n size?: 'small' | 'medium' | 'large';\n /** Whether the modal is open (controlled). */\n isOpen?: boolean;\n /** Whether the modal is open by default (uncontrolled). */\n defaultOpen?: boolean;\n /** Handler that is called when the modal's open state changes. */\n onOpenChange?: (isOpen: boolean) => void;\n}\n\nexport function UNSTABLE_DialogTrigger({ children }: { children: ReactNode }) {\n return <RACDialogTrigger>{children}</RACDialogTrigger>;\n}\n\nexport function UNSTABLE_Modal({\n children,\n title,\n size = 'medium',\n UNSAFE_className,\n UNSAFE_style,\n isDismissable = true,\n isOpen,\n defaultOpen,\n onOpenChange,\n ...props\n}: UNSTABLE_ModalProps) {\n return (\n <RACModalOverlay\n className=\"cim-modal-overlay\"\n isDismissable={isDismissable}\n isOpen={isOpen}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n data-cim-style-root\n >\n <RACModal\n className={clsx('cim-modal', UNSAFE_className, {\n 'cim-modal-small': size === 'small',\n 'cim-modal-medium': size === 'medium',\n 'cim-modal-large': size === 'large',\n })}\n >\n <RACDialog {...props} className={clsx('cim-modal-dialog')} style={UNSAFE_style}>\n <div className=\"cim-modal-header\">\n {title && (\n <RACHeading slot=\"title\" className={clsx('cim-modal-title', textStyle({ variant: 'title-3' }))}>\n {title}\n </RACHeading>\n )}\n <IconButton\n slot=\"close\"\n icon={<UNSTABLE_IconClose />}\n variant=\"tertiary\"\n size=\"small\"\n aria-label=\"Close modal\"\n UNSAFE_className=\"cim-modal-close-button\"\n />\n </div>\n <div className=\"cim-modal-content\">{children}</div>\n </RACDialog>\n </RACModal>\n </RACModalOverlay>\n );\n}\n"]}
@@ -0,0 +1,23 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type LinkProps as RACLinkProps } from 'react-aria-components';
3
+ import type { CommonProps, LabellableProps, NavigationProps, StringLikeChildren, WithRequired } from '../types.js';
4
+ export interface UNSTABLE_NavTabsProps extends CommonProps, Omit<LabellableProps, 'label'> {
5
+ children: ReactNode;
6
+ /**
7
+ * Whether to display the navigation tabs horizontally or vertically.
8
+ * @default 'horizontal'
9
+ */
10
+ orientation?: 'horizontal' | 'vertical';
11
+ }
12
+ export interface UNSTABLE_NavTabItemProps extends Omit<CommonProps, 'id'>, WithRequired<NavigationProps, 'href'>, Pick<RACLinkProps, 'children' | 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {
13
+ children: StringLikeChildren;
14
+ isCurrent?: boolean;
15
+ }
16
+ /** Renders a single navigation tab within `NavTabs`. */
17
+ export declare function UNSTABLE_NavTabItem({ children, isCurrent, UNSAFE_className, UNSAFE_style, ...props }: UNSTABLE_NavTabItemProps): import("react/jsx-runtime").JSX.Element;
18
+ /**
19
+ * Displays a list of navigation tabs to help users navigate through a website.
20
+ */
21
+ declare const _UNSTABLE_NavTabs: (props: UNSTABLE_NavTabsProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
22
+ export { _UNSTABLE_NavTabs as UNSTABLE_NavTabs };
23
+ //# sourceMappingURL=nav-tabs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nav-tabs.d.ts","sourceRoot":"","sources":["../../../../src/components/nav-tabs/nav-tabs.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAgB,MAAM,OAAO,CAAC;AACrD,OAAO,EAAmB,KAAK,SAAS,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGxF,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAInH,MAAM,WAAW,qBAAsB,SAAQ,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC;IACxF,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;CACzC;AAmBD,MAAM,WAAW,wBACf,SAAQ,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,EAC7B,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC,EACrC,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,YAAY,GAAG,cAAc,GAAG,YAAY,CAAC;IAC/E,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wDAAwD;AACxD,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,SAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACT,EAAE,wBAAwB,2CAW1B;AAED;;GAEG;AACH,QAAA,MAAM,iBAAiB,uKAA0D,CAAC;AAElF,OAAO,EAAE,iBAAiB,IAAI,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,20 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import clsx from 'clsx';
4
+ import { Link as RACLink } from 'react-aria-components';
5
+ import { forwardRef } from '../../forward-ref.js';
6
+ import { withStyleProps } from '../../with-style-props.js';
7
+ import { textStyle } from '../typography/utils.js';
8
+ function UNSTABLE_NavTabs({ children, orientation = 'horizontal', UNSAFE_className, UNSAFE_style, ...props }, ref) {
9
+ return (_jsx("div", { ...props, ref: ref, className: clsx('cim-nav-tabs', UNSAFE_className), style: UNSAFE_style, "data-orientation": orientation, children: children }));
10
+ }
11
+ /** Renders a single navigation tab within `NavTabs`. */
12
+ export function UNSTABLE_NavTabItem({ children, isCurrent = false, UNSAFE_className, UNSAFE_style, ...props }) {
13
+ return (_jsx(RACLink, { ...props, className: clsx('cim-nav-tab-item', textStyle({ variant: 'body' }), UNSAFE_className), style: UNSAFE_style, "aria-current": isCurrent ? 'page' : undefined, children: children }));
14
+ }
15
+ /**
16
+ * Displays a list of navigation tabs to help users navigate through a website.
17
+ */
18
+ const _UNSTABLE_NavTabs = withStyleProps(forwardRef(UNSTABLE_NavTabs), 'NavTabs');
19
+ export { _UNSTABLE_NavTabs as UNSTABLE_NavTabs };
20
+ //# sourceMappingURL=nav-tabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nav-tabs.js","sourceRoot":"","sources":["../../../../src/components/nav-tabs/nav-tabs.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;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAYnD,SAAS,gBAAgB,CACvB,EAAE,QAAQ,EAAE,WAAW,GAAG,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAyB,EACzG,GAAiC;IAEjC,OAAO,CACL,iBACM,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,gBAAgB,CAAC,EACjD,KAAK,EAAE,YAAY,sBACD,WAAW,YAE5B,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAUD,wDAAwD;AACxD,MAAM,UAAU,mBAAmB,CAAC,EAClC,QAAQ,EACR,SAAS,GAAG,KAAK,EACjB,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACiB;IACzB,OAAO,CACL,KAAC,OAAO,OACF,KAAK,EACT,SAAS,EAAE,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,gBAAgB,CAAC,EACrF,KAAK,EAAE,YAAY,kBACL,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,YAE3C,QAAQ,GACD,CACX,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,iBAAiB,GAAG,cAAc,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,SAAS,CAAC,CAAC;AAElF,OAAO,EAAE,iBAAiB,IAAI,gBAAgB,EAAE,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ReactNode, ForwardedRef } from 'react';\nimport { Link as RACLink, type LinkProps as RACLinkProps } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport type { CommonProps, LabellableProps, NavigationProps, StringLikeChildren, WithRequired } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\n// TODO: maybe add a `currentHref` prop that would be used to decide which NavTabItem is marked as current\nexport interface UNSTABLE_NavTabsProps extends CommonProps, Omit<LabellableProps, 'label'> {\n children: ReactNode;\n /**\n * Whether to display the navigation tabs horizontally or vertically.\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical';\n}\n\nfunction UNSTABLE_NavTabs(\n { children, orientation = 'horizontal', UNSAFE_className, UNSAFE_style, ...props }: UNSTABLE_NavTabsProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n return (\n <div\n {...props}\n ref={ref}\n className={clsx('cim-nav-tabs', UNSAFE_className)}\n style={UNSAFE_style}\n data-orientation={orientation}\n >\n {children}\n </div>\n );\n}\n\nexport interface UNSTABLE_NavTabItemProps\n extends Omit<CommonProps, 'id'>,\n WithRequired<NavigationProps, 'href'>,\n Pick<RACLinkProps, 'children' | 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {\n children: StringLikeChildren;\n isCurrent?: boolean;\n}\n\n/** Renders a single navigation tab within `NavTabs`. */\nexport function UNSTABLE_NavTabItem({\n children,\n isCurrent = false,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n}: UNSTABLE_NavTabItemProps) {\n return (\n <RACLink\n {...props}\n className={clsx('cim-nav-tab-item', textStyle({ variant: 'body' }), UNSAFE_className)}\n style={UNSAFE_style}\n aria-current={isCurrent ? 'page' : undefined}\n >\n {children}\n </RACLink>\n );\n}\n\n/**\n * Displays a list of navigation tabs to help users navigate through a website.\n */\nconst _UNSTABLE_NavTabs = withStyleProps(forwardRef(UNSTABLE_NavTabs), 'NavTabs');\n\nexport { _UNSTABLE_NavTabs as UNSTABLE_NavTabs };\n"]}
@@ -0,0 +1,10 @@
1
+ import { type NumberFieldProps as RACNumberFieldProps } from 'react-aria-components';
2
+ import type { CommonProps, FieldWithPlaceholderProps } from '../types.js';
3
+ export interface UNSTABLE_NumberFieldProps extends CommonProps, FieldWithPlaceholderProps<number>, Pick<RACNumberFieldProps, 'value' | 'defaultValue' | 'onChange' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'isReadOnly' | 'name' | 'autoFocus' | 'minValue' | 'maxValue' | 'step' | 'formatOptions' | 'onFocus' | 'onBlur'> {
4
+ }
5
+ /**
6
+ * Allows users to enter a number with a keyboard or increment/decrement buttons.
7
+ */
8
+ declare const _NumberField: (props: UNSTABLE_NumberFieldProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
9
+ export { _NumberField as UNSTABLE_NumberField };
10
+ //# sourceMappingURL=number-field.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-field.d.ts","sourceRoot":"","sources":["../../../../src/components/number-field/number-field.tsx"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,gBAAgB,IAAI,mBAAmB,EAE7C,MAAM,uBAAuB,CAAC;AAM/B,OAAO,KAAK,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAG1E,MAAM,WAAW,yBACf,SAAQ,WAAW,EACjB,yBAAyB,CAAC,MAAM,CAAC,EACjC,IAAI,CACF,mBAAmB,EACjB,OAAO,GACP,cAAc,GACd,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,MAAM,GACN,WAAW,GACX,UAAU,GACV,UAAU,GACV,MAAM,GACN,eAAe,GACf,SAAS,GACT,QAAQ,CACX;CAAG;AA8CR;;GAEG;AACH,QAAA,MAAM,YAAY,2KAAkE,CAAC;AAErF,OAAO,EAAE,YAAY,IAAI,oBAAoB,EAAE,CAAC"}
@@ -0,0 +1,26 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import clsx from 'clsx';
4
+ import { useEffect } from 'react';
5
+ import { Input as RACInput, NumberField as RACNumberField, Group as RACGroup, } from 'react-aria-components';
6
+ import { forwardRef } from '../../forward-ref.js';
7
+ import { IconAdd, IconMinus } from '../../icons/index.js';
8
+ import { withStyleProps } from '../../with-style-props.js';
9
+ import { IconButton } from '../button/icon-button.js';
10
+ import { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';
11
+ import { textStyle } from '../typography/utils.js';
12
+ function UNSTABLE_NumberField({ label, description, error: errorMessage, placeholder, UNSAFE_className, UNSAFE_style, ...props }, ref) {
13
+ const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
14
+ useEffect(() => {
15
+ if (!label && !ariaLabel && !ariaLabelledBy) {
16
+ console.warn('NumberField requires one of label / aria-label / aria-labelledby for accessibility');
17
+ }
18
+ }, [label, ariaLabel, ariaLabelledBy]);
19
+ return (_jsxs(RACNumberField, { ...props, ref: ref, className: clsx('cim-number-field', UNSAFE_className), style: UNSAFE_style, children: [_jsx(FormFieldLabel, { isRequired: props.isRequired, isDisabled: props.isDisabled, children: label }), _jsxs(RACGroup, { className: "cim-number-field-input-group", children: [_jsx(RACInput, { className: clsx('cim-number-field-input', textStyle({ variant: 'medium' })), placeholder: placeholder }), _jsxs("div", { className: "cim-number-field-spinner", children: [_jsx(IconButton, { slot: "decrement", icon: _jsx(IconMinus, {}), "aria-label": "Decrement", variant: "tertiary" }), _jsx("div", { className: "cim-number-field-spinner-separator" }), _jsx(IconButton, { slot: "increment", icon: _jsx(IconAdd, {}), "aria-label": "Increment", variant: "tertiary" })] })] }), _jsx(FormFieldError, { children: errorMessage }), _jsx(FormFieldDescription, { children: description })] }));
20
+ }
21
+ /**
22
+ * Allows users to enter a number with a keyboard or increment/decrement buttons.
23
+ */
24
+ const _NumberField = withStyleProps(forwardRef(UNSTABLE_NumberField), 'NumberField');
25
+ export { _NumberField as UNSTABLE_NumberField };
26
+ //# sourceMappingURL=number-field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-field.js","sourceRoot":"","sources":["../../../../src/components/number-field/number-field.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AACrD,OAAO,EACL,KAAK,IAAI,QAAQ,EACjB,WAAW,IAAI,cAAc,EA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EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,EAC3E,WAAW,EAAE,WAAW,GACxB,EACF,eAAK,SAAS,EAAC,0BAA0B,aAEvC,KAAC,UAAU,IAAC,IAAI,EAAC,WAAW,EAAC,IAAI,EAAE,KAAC,SAAS,KAAG,gBAAa,WAAW,EAAC,OAAO,EAAC,UAAU,GAAG,EAC9F,cAAK,SAAS,EAAC,oCAAoC,GAAG,EAEtD,KAAC,UAAU,IAAC,IAAI,EAAC,WAAW,EAAC,IAAI,EAAE,KAAC,OAAO,KAAG,gBAAa,WAAW,EAAC,OAAO,EAAC,UAAU,GAAG,IACxF,IACG,EACX,KAAC,cAAc,cAAE,YAAY,GAAkB,EAC/C,KAAC,oBAAoB,cAAE,WAAW,GAAwB,IAC3C,CAClB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,YAAY,GAAG,cAAc,CAAC,UAAU,CAAC,oBAAoB,CAAC,EAAE,aAAa,CAAC,CAAC;AAErF,OAAO,EAAE,YAAY,IAAI,oBAAoB,EAAE,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { useEffect, type ForwardedRef } from 'react';\nimport {\n Input as RACInput,\n NumberField as RACNumberField,\n type NumberFieldProps as RACNumberFieldProps,\n Group as RACGroup,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { IconAdd, IconMinus } from '../../icons/index.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { IconButton } from '../button/icon-button.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';\nimport type { CommonProps, FieldWithPlaceholderProps } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface UNSTABLE_NumberFieldProps\n extends CommonProps,\n FieldWithPlaceholderProps<number>,\n Pick<\n RACNumberFieldProps,\n | 'value'\n | 'defaultValue'\n | 'onChange'\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'isReadOnly'\n | 'name'\n | 'autoFocus'\n | 'minValue'\n | 'maxValue'\n | 'step'\n | 'formatOptions'\n | 'onFocus'\n | 'onBlur'\n > {}\n\nfunction UNSTABLE_NumberField(\n {\n label,\n description,\n error: errorMessage,\n placeholder,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: UNSTABLE_NumberFieldProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('NumberField requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACNumberField {...props} ref={ref} className={clsx('cim-number-field', UNSAFE_className)} style={UNSAFE_style}>\n <FormFieldLabel isRequired={props.isRequired} isDisabled={props.isDisabled}>\n {label}\n </FormFieldLabel>\n <RACGroup className=\"cim-number-field-input-group\">\n <RACInput\n className={clsx('cim-number-field-input', textStyle({ variant: 'medium' }))}\n placeholder={placeholder}\n />\n <div className=\"cim-number-field-spinner\">\n {/* TODO: i18n */}\n <IconButton slot=\"decrement\" icon={<IconMinus />} aria-label=\"Decrement\" variant=\"tertiary\" />\n <div className=\"cim-number-field-spinner-separator\" />\n {/* TODO: i18n */}\n <IconButton slot=\"increment\" icon={<IconAdd />} aria-label=\"Increment\" variant=\"tertiary\" />\n </div>\n </RACGroup>\n <FormFieldError>{errorMessage}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n </RACNumberField>\n );\n}\n\n/**\n * Allows users to enter a number with a keyboard or increment/decrement buttons.\n */\nconst _NumberField = withStyleProps(forwardRef(UNSTABLE_NumberField), 'NumberField');\n\nexport { _NumberField as UNSTABLE_NumberField };\n"]}
@@ -0,0 +1,14 @@
1
+ export interface PaginationProps {
2
+ /** The current page number. */
3
+ value: number;
4
+ /** The total number of pages. */
5
+ count: number;
6
+ /** The accessibility label for the pagination navigation, must be unique to the page. */
7
+ 'aria-label': string;
8
+ /** A callback function that is called when the page number changes. */
9
+ onPageChange?: (page: number) => void;
10
+ /** A function that returns a URL for a given page number. */
11
+ href?: (page: number) => string;
12
+ }
13
+ export declare function UNSTABLE_Pagination({ value, count, onPageChange, href, 'aria-label': ariaLabel }: PaginationProps): import("react/jsx-runtime").JSX.Element;
14
+ //# sourceMappingURL=pagination.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../../src/components/pagination/pagination.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,eAAe;IAC9B,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,yFAAyF;IACzF,YAAY,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,6DAA6D;IAC7D,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACjC;AAED,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,eAAe,2CA+DjH"}
@@ -0,0 +1,66 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { UNSTABLE_IconChevronLeftFill, UNSTABLE_IconChevronRightFill } from '../../icons/index.js';
3
+ import { Button } from '../button/button.js';
4
+ import { IconButton } from '../button/icon-button.js';
5
+ import { IconLinkButton } from '../button/icon-link-button.js';
6
+ import { LinkButton } from '../button/link-button.js';
7
+ export function UNSTABLE_Pagination({ value, count, onPageChange, href, 'aria-label': ariaLabel }) {
8
+ const visiblePages = getVisiblePages(value, count);
9
+ const previousButtonProps = {
10
+ // TODO: icon doesn't look optically centered, see: https://www.figma.com/design/JVWmaCjDeOlrYAkLlJD5gr?node-id=10376-1487#1082340181
11
+ icon: _jsx(UNSTABLE_IconChevronLeftFill, {}),
12
+ isDisabled: value === 1,
13
+ // TODO: internationalization
14
+ 'aria-label': 'Previous',
15
+ };
16
+ const nextButtonProps = {
17
+ // TODO: icon doesn't look optically centered, see: https://www.figma.com/design/JVWmaCjDeOlrYAkLlJD5gr?node-id=10376-1487#1082340181
18
+ icon: _jsx(UNSTABLE_IconChevronRightFill, {}),
19
+ isDisabled: value === count,
20
+ // TODO: internationalization
21
+ 'aria-label': 'Next',
22
+ };
23
+ return (_jsx("nav", { className: "cim-pagination", "aria-label": ariaLabel, children: _jsxs("ul", { className: "cim-pagination-list", children: [_jsx("li", { children: href ? (_jsx(IconLinkButton, { ...previousButtonProps, href: href?.(value - 1) })) : (_jsx(IconButton, { ...previousButtonProps, onPress: () => onPageChange?.(value - 1) })) }), visiblePages.map((page) => {
24
+ const isCurrentPage = typeof page === 'number' && page === value;
25
+ const pageNumber = typeof page === 'number' ? page : page.page;
26
+ const pageButtonProps = {
27
+ // TODO: internationalization
28
+ // TODO: review if "Current page" is needed once we put `aria-current` on the `button`/`link`
29
+ 'aria-label': isCurrentPage ? `Current page, page ${pageNumber}` : `Go to page ${pageNumber}`,
30
+ children: typeof page === 'number' ? page : '…',
31
+ };
32
+ return (
33
+ // TODO: Put `aria-current` on the `button`/`link` instead of the `li` for better accessibility/screen reader support
34
+ // RAC Button doesn't support `aria-current` as of now
35
+ _jsx("li", { "aria-current": isCurrentPage && href != null ? 'page' : isCurrentPage, children: href ? (_jsx(LinkButton, { href: href?.(pageNumber), ...pageButtonProps })) : (_jsx(Button, { onPress: () => onPageChange?.(pageNumber), ...pageButtonProps })) }, pageNumber));
36
+ }), _jsx("li", { children: href ? (_jsx(IconLinkButton, { ...nextButtonProps, href: href?.(value + 1) })) : (_jsx(IconButton, { ...nextButtonProps, onPress: () => onPageChange?.(value + 1) })) })] }) }));
37
+ }
38
+ function getVisiblePages(currentPage, totalPages) {
39
+ if (totalPages <= 7) {
40
+ return Array.from({ length: totalPages }, (_, index) => index + 1);
41
+ }
42
+ if (currentPage <= 4) {
43
+ return [1, 2, 3, 4, { type: 'ellipsis', page: 5 }, totalPages - 1, totalPages];
44
+ }
45
+ if (currentPage >= totalPages - 3) {
46
+ return [
47
+ 1,
48
+ 2,
49
+ { type: 'ellipsis', page: totalPages - 4 },
50
+ totalPages - 3,
51
+ totalPages - 2,
52
+ totalPages - 1,
53
+ totalPages,
54
+ ];
55
+ }
56
+ return [
57
+ 1,
58
+ { type: 'ellipsis', page: currentPage - 2 },
59
+ currentPage - 1,
60
+ currentPage,
61
+ currentPage + 1,
62
+ { type: 'ellipsis', page: currentPage + 2 },
63
+ totalPages,
64
+ ];
65
+ }
66
+ //# sourceMappingURL=pagination.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../../../src/components/pagination/pagination.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,4BAA4B,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AACnG,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAetD,MAAM,UAAU,mBAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAmB;IAChH,MAAM,YAAY,GAAG,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAEnD,MAAM,mBAAmB,GAAG;QAC1B,qIAAqI;QACrI,IAAI,EAAE,KAAC,4BAA4B,KAAG;QACtC,UAAU,EAAE,KAAK,KAAK,CAAC;QACvB,6BAA6B;QAC7B,YAAY,EAAE,UAAU;KACzB,CAAC;IAEF,MAAM,eAAe,GAAG;QACtB,qIAAqI;QACrI,IAAI,E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C;IACJ,CAAC;IAED,OAAO;QACL,CAAC;QACD,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,GAAG,CAAC,EAAE;QAC3C,WAAW,GAAG,CAAC;QACf,WAAW;QACX,WAAW,GAAG,CAAC;QACf,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,GAAG,CAAC,EAAE;QAC3C,UAAU;KACX,CAAC;AACJ,CAAC","sourcesContent":["import { UNSTABLE_IconChevronLeftFill, UNSTABLE_IconChevronRightFill } from '../../icons/index.js';\nimport { Button } from '../button/button.js';\nimport { IconButton } from '../button/icon-button.js';\nimport { IconLinkButton } from '../button/icon-link-button.js';\nimport { LinkButton } from '../button/link-button.js';\n\nexport interface PaginationProps {\n /** The current page number. */\n value: number;\n /** The total number of pages. */\n count: number;\n /** The accessibility label for the pagination navigation, must be unique to the page. */\n 'aria-label': string;\n /** A callback function that is called when the page number changes. */\n onPageChange?: (page: number) => void;\n /** A function that returns a URL for a given page number. */\n href?: (page: number) => string;\n}\n\nexport function UNSTABLE_Pagination({ value, count, onPageChange, href, 'aria-label': ariaLabel }: PaginationProps) {\n const visiblePages = getVisiblePages(value, count);\n\n const previousButtonProps = {\n // TODO: icon doesn't look optically centered, see: https://www.figma.com/design/JVWmaCjDeOlrYAkLlJD5gr?node-id=10376-1487#1082340181\n icon: <UNSTABLE_IconChevronLeftFill />,\n isDisabled: value === 1,\n // TODO: internationalization\n 'aria-label': 'Previous',\n };\n\n const nextButtonProps = {\n // TODO: icon doesn't look optically centered, see: https://www.figma.com/design/JVWmaCjDeOlrYAkLlJD5gr?node-id=10376-1487#1082340181\n icon: <UNSTABLE_IconChevronRightFill />,\n isDisabled: value === count,\n // TODO: internationalization\n 'aria-label': 'Next',\n };\n\n return (\n <nav className=\"cim-pagination\" aria-label={ariaLabel}>\n <ul className=\"cim-pagination-list\">\n <li>\n {href ? (\n <IconLinkButton {...previousButtonProps} href={href?.(value - 1)} />\n ) : (\n <IconButton {...previousButtonProps} onPress={() => onPageChange?.(value - 1)} />\n )}\n </li>\n\n {visiblePages.map((page) => {\n const isCurrentPage = typeof page === 'number' && page === value;\n const pageNumber = typeof page === 'number' ? page : page.page;\n const pageButtonProps = {\n // TODO: internationalization\n // TODO: review if \"Current page\" is needed once we put `aria-current` on the `button`/`link`\n 'aria-label': isCurrentPage ? `Current page, page ${pageNumber}` : `Go to page ${pageNumber}`,\n children: typeof page === 'number' ? page : '…',\n };\n\n return (\n // TODO: Put `aria-current` on the `button`/`link` instead of the `li` for better accessibility/screen reader support\n // RAC Button doesn't support `aria-current` as of now\n <li key={pageNumber} aria-current={isCurrentPage && href != null ? 'page' : isCurrentPage}>\n {href ? (\n <LinkButton href={href?.(pageNumber)} {...pageButtonProps} />\n ) : (\n <Button onPress={() => onPageChange?.(pageNumber)} {...pageButtonProps} />\n )}\n </li>\n );\n })}\n\n <li>\n {href ? (\n <IconLinkButton {...nextButtonProps} href={href?.(value + 1)} />\n ) : (\n <IconButton {...nextButtonProps} onPress={() => onPageChange?.(value + 1)} />\n )}\n </li>\n </ul>\n </nav>\n );\n}\n\nfunction getVisiblePages(currentPage: number, totalPages: number): (number | { type: 'ellipsis'; page: number })[] {\n if (totalPages <= 7) {\n return Array.from({ length: totalPages }, (_, index) => index + 1);\n }\n\n if (currentPage <= 4) {\n return [1, 2, 3, 4, { type: 'ellipsis', page: 5 }, totalPages - 1, totalPages];\n }\n\n if (currentPage >= totalPages - 3) {\n return [\n 1,\n 2,\n { type: 'ellipsis', page: totalPages - 4 },\n totalPages - 3,\n totalPages - 2,\n totalPages - 1,\n totalPages,\n ];\n }\n\n return [\n 1,\n { type: 'ellipsis', page: currentPage - 2 },\n currentPage - 1,\n currentPage,\n currentPage + 1,\n { type: 'ellipsis', page: currentPage + 2 },\n totalPages,\n ];\n}\n"]}
@@ -14,7 +14,7 @@ export interface RadioGroupProps extends CommonProps, WithRequired<FieldProps<st
14
14
  /**
15
15
  * Allows users to select a single item from a visible list.
16
16
  *
17
- * See [radio usage guidelines](https://ui.cimpress.io/components/radio/usage-guidelines/).
17
+ * See [radio group usage guidelines](https://ui.cimpress.io/components/radio-group/).
18
18
  */
19
19
  declare const _RadioGroup: (props: RadioGroupProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
20
20
  export { _RadioGroup as RadioGroup };
@@ -12,7 +12,7 @@ function RadioGroup({ label, description, error: errorMessage, direction = 'vert
12
12
  /**
13
13
  * Allows users to select a single item from a visible list.
14
14
  *
15
- * See [radio usage guidelines](https://ui.cimpress.io/components/radio/usage-guidelines/).
15
+ * See [radio group usage guidelines](https://ui.cimpress.io/components/radio-group/).
16
16
  */
17
17
  const _RadioGroup = withStyleProps(forwardRef(RadioGroup), 'RadioGroup');
18
18
  export { _RadioGroup as RadioGroup };
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../../src/components/radio/radio-group.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,UAAU,IAAI,aAAa,EAA8C,MAAM,uBAAuB,CAAC;AAChH,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,UAAU,CACjB,EACE,KAAK,EACL,WAAW,EACX,KAAK,EAAE,YAAY,EACnB,SAAS,GAAG,UAAU,EACtB,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACQ,EAClB,GAAiC;IAEjC,OAAO,CACL,MAAC,aAAa,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,iBAAiB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roup, type RadioGroupProps as RACRadioGroupProps } 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 RadioGroupProps\n extends CommonProps,\n WithRequired<FieldProps<string | null>, 'label'>,\n Pick<\n RACRadioGroupProps,\n 'isDisabled' | 'isReadOnly' | 'isRequired' | 'isInvalid' | 'value' | 'onChange' | 'defaultValue' | 'name'\n > {\n /** Radio buttons belonging to the group. */\n children: ReactNode;\n /**\n * Determines the direction in which radio buttons will be stacked.\n * @default 'vertical'\n */\n direction?: Responsive<Direction>;\n}\n\nfunction RadioGroup(\n {\n label,\n description,\n error: errorMessage,\n direction = 'vertical',\n children,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: RadioGroupProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n return (\n <RACRadioGroup {...props} ref={ref} className={clsx('cim-radio-group', UNSAFE_className)} style={UNSAFE_style}>\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 </RACRadioGroup>\n );\n}\n\n/**\n * Allows users to select a single item from a visible list.\n *\n * See [radio usage guidelines](https://ui.cimpress.io/components/radio/usage-guidelines/).\n */\nconst _RadioGroup = withStyleProps(forwardRef(RadioGroup), 'RadioGroup');\n\nexport { _RadioGroup as RadioGroup };\n\n// Make sure that radio buttons 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
+ {"version":3,"file":"radio-group.js","sourceRoot":"","sources":["../../../../src/components/radio/radio-group.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,UAAU,IAAI,aAAa,EAA8C,MAAM,uBAAuB,CAAC;AAChH,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,UAAU,CACjB,EACE,KAAK,EACL,WAAW,EACX,KAAK,EAAE,YAAY,EACnB,SAAS,GAAG,UAAU,EACtB,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACQ,EAClB,GAAiC;IAEjC,OAAO,CACL,MAAC,aAAa,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,aAC3G,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,IAC5C,CACjB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,WAAW,GAAG,cAAc,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,YAAY,CAAC,CAAC;AAEzE,OAAO,EAAE,WAAW,IAAI,UAAU,EAAE,CAAC;AAErC,gGAAgG;AAChG,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 { ForwardedRef, ReactNode } from 'react';\nimport { RadioGroup as RACRadioGroup, type RadioGroupProps as RACRadioGroupProps } 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 RadioGroupProps\n extends CommonProps,\n WithRequired<FieldProps<string | null>, 'label'>,\n Pick<\n RACRadioGroupProps,\n 'isDisabled' | 'isReadOnly' | 'isRequired' | 'isInvalid' | 'value' | 'onChange' | 'defaultValue' | 'name'\n > {\n /** Radio buttons belonging to the group. */\n children: ReactNode;\n /**\n * Determines the direction in which radio buttons will be stacked.\n * @default 'vertical'\n */\n direction?: Responsive<Direction>;\n}\n\nfunction RadioGroup(\n {\n label,\n description,\n error: errorMessage,\n direction = 'vertical',\n children,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: RadioGroupProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n return (\n <RACRadioGroup {...props} ref={ref} className={clsx('cim-radio-group', UNSAFE_className)} style={UNSAFE_style}>\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 </RACRadioGroup>\n );\n}\n\n/**\n * Allows users to select a single item from a visible list.\n *\n * See [radio group usage guidelines](https://ui.cimpress.io/components/radio-group/).\n */\nconst _RadioGroup = withStyleProps(forwardRef(RadioGroup), 'RadioGroup');\n\nexport { _RadioGroup as RadioGroup };\n\n// Make sure that radio buttons 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,13 +1,13 @@
1
1
  import { type RadioProps as RACRadioProps } from 'react-aria-components';
2
2
  import type { CommonProps, LabellableProps, StringLikeChildren } from '../types.js';
3
- export interface RadioProps extends CommonProps, Omit<LabellableProps, 'label'>, Pick<RACRadioProps, 'value' | 'isDisabled'> {
3
+ export interface RadioProps extends CommonProps, Omit<LabellableProps, 'label'>, Pick<RACRadioProps, 'value' | 'isDisabled' | 'autoFocus'> {
4
4
  /** The label rendered next to the radio. */
5
5
  children?: StringLikeChildren;
6
6
  }
7
7
  /**
8
8
  * Renders a single option within `RadioGroup`.
9
9
  *
10
- * See [radio usage guidelines](https://ui.cimpress.io/components/radio/usage-guidelines/).
10
+ * See [radio group usage guidelines](https://ui.cimpress.io/components/radio-group/).
11
11
  */
12
12
  declare const _Radio: (props: RadioProps & import("react").RefAttributes<HTMLLabelElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
13
13
  export { _Radio as Radio };
@@ -1 +1 @@
1
- {"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../../../src/components/radio/radio.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAqB,KAAK,UAAU,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG5F,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGpF,MAAM,WAAW,UACf,SAAQ,WAAW,EACjB,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,EAC9B,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,YAAY,CAAC;IAC7C,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AA8BD;;;;GAIG;AACH,QAAA,MAAM,MAAM,8JAA6C,CAAC;AAE1D,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAC"}
1
+ {"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../../../src/components/radio/radio.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAqB,KAAK,UAAU,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG5F,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGpF,MAAM,WAAW,UACf,SAAQ,WAAW,EACjB,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,EAC9B,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,YAAY,GAAG,WAAW,CAAC;IAC3D,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AA8BD;;;;GAIG;AACH,QAAA,MAAM,MAAM,8JAA6C,CAAC;AAE1D,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAC"}
@@ -18,7 +18,7 @@ function Radio({ children, UNSAFE_className, UNSAFE_style, ...props }, ref) {
18
18
  /**
19
19
  * Renders a single option within `RadioGroup`.
20
20
  *
21
- * See [radio usage guidelines](https://ui.cimpress.io/components/radio/usage-guidelines/).
21
+ * See [radio group usage guidelines](https://ui.cimpress.io/components/radio-group/).
22
22
  */
23
23
  const _Radio = withStyleProps(forwardRef(Radio), 'Radio');
24
24
  export { _Radio as Radio };
@@ -1 +1 @@
1
- {"version":3,"file":"radio.js","sourceRoot":"","sources":["../../../../src/components/radio/radio.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAoC,MAAM,uBAAuB,CAAC;AAC5F,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAU7C,SAAS,KAAK,CACZ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAc,EAClE,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,iFAAiF,CAAC,CAAC;QAClG,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IAE1C,OAAO,CACL,MAAC,QAAQ,OAAK,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,aAChG,cAAK,SAAS,EAAC,0BAA0B,YACvC,cAAK,SAAS,EAAC,kBAAkB,YAC/B,cAAK,SAAS,EAAC,wBAAwB,GAAG,GACtC,GACF,EACL,QAAQ,IAAI,CACX,KAAC,IAAI,IAAC,EAAE,EAAC,MAAM,EAAC,OAAO,EAAC,MAAM,YAC3B,QAAQ,GACJ,CACR,IACQ,CACZ,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;AAE1D,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { useEffect, type ForwardedRef } from 'react';\nimport { Radio as RACRadio, type RadioProps as RACRadioProps } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.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 RadioProps\n extends CommonProps,\n Omit<LabellableProps, 'label'>,\n Pick<RACRadioProps, 'value' | 'isDisabled'> {\n /** The label rendered next to the radio. */\n children?: StringLikeChildren;\n}\n\nfunction Radio(\n { children, UNSAFE_className, UNSAFE_style, ...props }: RadioProps,\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('Radio requires one of children / aria-label / aria-labelledby for accessibility');\n }\n }, [children, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACRadio {...props} className={clsx('cim-radio', UNSAFE_className)} style={UNSAFE_style} ref={ref}>\n <div className=\"cim-radio-toggle-wrapper\">\n <div className=\"cim-radio-toggle\">\n <div className=\"cim-radio-toggle-inner\" />\n </div>\n </div>\n {children && (\n <Text as=\"span\" variant=\"body\">\n {children}\n </Text>\n )}\n </RACRadio>\n );\n}\n\n/**\n * Renders a single option within `RadioGroup`.\n *\n * See [radio usage guidelines](https://ui.cimpress.io/components/radio/usage-guidelines/).\n */\nconst _Radio = withStyleProps(forwardRef(Radio), 'Radio');\n\nexport { _Radio as Radio };\n"]}
1
+ {"version":3,"file":"radio.js","sourceRoot":"","sources":["../../../../src/components/radio/radio.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAoC,MAAM,uBAAuB,CAAC;AAC5F,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAU7C,SAAS,KAAK,CACZ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAc,EAClE,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,iFAAiF,CAAC,CAAC;QAClG,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IAE1C,OAAO,CACL,MAAC,QAAQ,OAAK,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,aAChG,cAAK,SAAS,EAAC,0BAA0B,YACvC,cAAK,SAAS,EAAC,kBAAkB,YAC/B,cAAK,SAAS,EAAC,wBAAwB,GAAG,GACtC,GACF,EACL,QAAQ,IAAI,CACX,KAAC,IAAI,IAAC,EAAE,EAAC,MAAM,EAAC,OAAO,EAAC,MAAM,YAC3B,QAAQ,GACJ,CACR,IACQ,CACZ,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;AAE1D,OAAO,EAAE,MAAM,IAAI,KAAK,EAAE,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { useEffect, type ForwardedRef } from 'react';\nimport { Radio as RACRadio, type RadioProps as RACRadioProps } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.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 RadioProps\n extends CommonProps,\n Omit<LabellableProps, 'label'>,\n Pick<RACRadioProps, 'value' | 'isDisabled' | 'autoFocus'> {\n /** The label rendered next to the radio. */\n children?: StringLikeChildren;\n}\n\nfunction Radio(\n { children, UNSAFE_className, UNSAFE_style, ...props }: RadioProps,\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('Radio requires one of children / aria-label / aria-labelledby for accessibility');\n }\n }, [children, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACRadio {...props} className={clsx('cim-radio', UNSAFE_className)} style={UNSAFE_style} ref={ref}>\n <div className=\"cim-radio-toggle-wrapper\">\n <div className=\"cim-radio-toggle\">\n <div className=\"cim-radio-toggle-inner\" />\n </div>\n </div>\n {children && (\n <Text as=\"span\" variant=\"body\">\n {children}\n </Text>\n )}\n </RACRadio>\n );\n}\n\n/**\n * Renders a single option within `RadioGroup`.\n *\n * See [radio group usage guidelines](https://ui.cimpress.io/components/radio-group/).\n */\nconst _Radio = withStyleProps(forwardRef(Radio), 'Radio');\n\nexport { _Radio as Radio };\n"]}
@@ -1,15 +1,15 @@
1
- import { type ListBoxItemProps as RACListBoxItemProps, type SelectProps as RACSelectProps } from 'react-aria-components';
1
+ import { type ListBoxProps as RACListBoxProps, type ListBoxItemProps as RACListBoxItemProps, type SelectProps as RACSelectProps } from 'react-aria-components';
2
2
  import type { CollectionItem, CollectionProps, CommonProps, FieldProps, Key, StringLikeChildren } from '../types.js';
3
- export interface SelectProps<T extends CollectionItem = CollectionItem> extends CommonProps, FieldProps<Key>, CollectionProps<T>, Pick<RACSelectProps<T>, 'name' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'selectedKey' | 'defaultSelectedKey' | 'autoComplete' | 'autoFocus' | 'onSelectionChange' | 'placeholder'> {
3
+ export interface SelectProps<T extends CollectionItem = CollectionItem> extends CommonProps, FieldProps<Key>, CollectionProps<T>, Pick<RACSelectProps<T>, 'name' | 'isDisabled' | 'isRequired' | 'isInvalid' | 'selectedKey' | 'defaultSelectedKey' | 'autoComplete' | 'autoFocus' | 'onSelectionChange' | 'placeholder' | 'onFocus' | 'onBlur' | 'onOpenChange'>, Pick<RACListBoxProps<T>, 'onScroll'> {
4
4
  }
5
5
  /**
6
6
  * Allows users to select one item from a collapsible list.
7
7
  *
8
- * See [select usage guidelines](https://ui.cimpress.io/components/select/usage-guidelines/).
8
+ * See [select usage guidelines](https://ui.cimpress.io/components/select/).
9
9
  */
10
10
  declare const _Select: <T extends CollectionItem>(props: SelectProps<T> & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
11
11
  export { _Select as Select };
12
- export interface SelectItemProps extends Pick<RACListBoxItemProps, 'id' | 'isDisabled'> {
12
+ export interface SelectItemProps extends Pick<RACListBoxItemProps, 'id' | 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {
13
13
  children: StringLikeChildren;
14
14
  }
15
15
  /** Renders a single list item within `Select`. */
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAIA,OAAO,EAUL,KAAK,gBAAgB,IAAI,mBAAmB,EAC5C,KAAK,WAAW,IAAI,cAAc,EACnC,MAAM,uBAAuB,CAAC;AAM/B,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGrH,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,CACpE,SAAQ,WAAW,EACjB,UAAU,CAAC,GAAG,CAAC,EACf,eAAe,CAAC,CAAC,CAAC,EAClB,IAAI,CACF,cAAc,CAAC,CAAC,CAAC,EACf,MAAM,GACN,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,aAAa,GACb,oBAAoB,GACpB,cAAc,GACd,WAAW,GACX,mBAAmB,GACnB,aAAa,CAChB;CAAG;AA6CR;;;;GAIG;AACH,QAAA,MAAM,OAAO,GAhDG,CAAC,SAAS,cAAc,+JAgDoB,CAAC;AAE7D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,CAAC;AAE7B,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,mBAAmB,EAAE,IAAI,GAAG,YAAY,CAAC;IACrF,QAAQ,EAAE,kBAAkB,CAAC;CAC9B;AAED,kDAAkD;AAClD,wBAAgB,UAAU,CAAC,EAAE,QAAQ,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JAgDoB,CAAC;AAE7D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,CAAC;AAE7B,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,mBAAmB,EAAE,IAAI,GAAG,YAAY,GAAG,cAAc,GAAG,YAAY,CAAC;IACtF,QAAQ,EAAE,kBAAkB,CAAC;CAC9B;AAED,kDAAkD;AAClD,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,2CAiBjE;yBAjBe,UAAU;;;AAqB1B,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,cAAc,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;IACtF,6EAA6E;IAC7E,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wDAAwD;AACxD,wBAAgB,aAAa,CAAC,CAAC,SAAS,cAAc,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,CAAC,CAAC,CAAC,2CAelH;yBAfe,aAAa"}
@@ -9,7 +9,7 @@ import { withStyleProps } from '../../with-style-props.js';
9
9
  import { CollapsibleList } from '../internal/collapsible-list/collapsible-list.js';
10
10
  import { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';
11
11
  import { textStyle } from '../typography/utils.js';
12
- function Select({ children, items, label, description, error, UNSAFE_className, UNSAFE_style, ...props }, ref) {
12
+ function Select({ children, items, label, description, error, UNSAFE_className, UNSAFE_style, onScroll, ...props }, ref) {
13
13
  const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
14
14
  useEffect(() => {
15
15
  if (!label && !ariaLabel && !ariaLabelledBy) {
@@ -19,12 +19,12 @@ function Select({ children, items, label, description, error, UNSAFE_className,
19
19
  if (items != null && typeof children !== 'function') {
20
20
  console.warn('`Select` requires `children` to be a function when using `items` prop');
21
21
  }
22
- return (_jsxs(RACSelect, { ...props, ref: ref, className: clsx('cim-select', UNSAFE_className), style: UNSAFE_style, children: [_jsx(FormFieldLabel, { isRequired: props.isRequired, isDisabled: props.isDisabled, children: label }), _jsxs(RACButton, { className: "cim-select-button", children: [_jsx(RACSelectValue, { className: (values) => clsx(values.defaultClassName, textStyle({ variant: 'medium', alignment: 'start' })), children: ({ selectedText }) => selectedText }), _jsx(IconChevronDownFill, {})] }), _jsx(FormFieldError, { children: error }), _jsx(FormFieldDescription, { children: description }), _jsx(CollapsibleList, { offset: 5, maxHeight: 315, children: _jsx(RACListBox, { className: "cim-select-listbox", items: items, children: children }) })] }));
22
+ return (_jsxs(RACSelect, { ...props, ref: ref, className: clsx('cim-select', UNSAFE_className), style: UNSAFE_style, children: [_jsx(FormFieldLabel, { isRequired: props.isRequired, isDisabled: props.isDisabled, children: label }), _jsxs(RACButton, { className: "cim-select-button", children: [_jsx(RACSelectValue, { className: (values) => clsx(values.defaultClassName, textStyle({ variant: 'medium', alignment: 'start' })), children: ({ selectedText }) => selectedText }), _jsx(IconChevronDownFill, {})] }), _jsx(FormFieldError, { children: error }), _jsx(FormFieldDescription, { children: description }), _jsx(CollapsibleList, { offset: 5, maxHeight: 315, children: _jsx(RACListBox, { className: "cim-select-listbox", onScroll: onScroll, items: items, children: children }) })] }));
23
23
  }
24
24
  /**
25
25
  * Allows users to select one item from a collapsible list.
26
26
  *
27
- * See [select usage guidelines](https://ui.cimpress.io/components/select/usage-guidelines/).
27
+ * See [select usage guidelines](https://ui.cimpress.io/components/select/).
28
28
  */
29
29
  const _Select = withStyleProps(forwardRef(Select), 'Select');
30
30
  export { _Select as Select };
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AACrD,OAAO,EACL,MAAM,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,CAAC,EAAE,CAAC,CAAC;IAEhH,OAAO,CACL,KAAC,cAAc,OAAK,KAAK,EAAE,SAAS,EAAC,iBAAiB,EAAC,SAAS,EAAE,SAAS,YACxE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CACnB,8BACE,KAAC,aAAa,KAAG,EAEjB,KAAC,OAAO,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAE,SAAS,CAAC,EAAE,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,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC;AAStC,wDAAwD;AACxD,MAAM,UAAU,aAAa,CAA2B,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,EAAyB;IACjH,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,8EAA8E,CAAC,CAAC;IAC/F,CAAC;IAED,OAAO,CACL,MAAC,iBAAiB,OAAK,KAAK,EAAE,SAAS,EAAC,oBAAoB,aAC1D,KAAC,SAAS,IACR,SAAS,EAAE,IAAI,CAAC,2BAA2B,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,YAErG,KAAK,GACI,EACZ,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAiB,IACrC,CACrB,CAAC;AACJ,CAAC;AAED,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { useEffect, type ForwardedRef } from 'react';\nimport {\n Button as RACButton,\n Collection as RACCollection,\n Header as RACHeader,\n ListBox as RACListBox,\n ListBoxItem as RACListBoxItem,\n ListBoxSection as RACListBoxSection,\n Select as RACSelect,\n SelectValue as RACSelectValue,\n Text as RACText,\n type ListBoxItemProps as RACListBoxItemProps,\n type SelectProps as RACSelectProps,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { IconCheckmark, IconChevronDownFill } from '../../icons/index.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { CollapsibleList } from '../internal/collapsible-list/collapsible-list.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';\nimport type { CollectionItem, CollectionProps, CommonProps, FieldProps, Key, StringLikeChildren } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface SelectProps<T extends CollectionItem = CollectionItem>\n extends CommonProps,\n FieldProps<Key>,\n CollectionProps<T>,\n Pick<\n RACSelectProps<T>,\n | 'name'\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'selectedKey'\n | 'defaultSelectedKey'\n | 'autoComplete'\n | 'autoFocus'\n | 'onSelectionChange'\n | 'placeholder'\n > {}\n\nfunction Select<T extends CollectionItem>(\n { children, items, label, description, error, UNSAFE_className, UNSAFE_style, ...props }: SelectProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('Select requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n if (items != null && typeof children !== 'function') {\n console.warn('`Select` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACSelect {...props} ref={ref} className={clsx('cim-select', UNSAFE_className)} style={UNSAFE_style}>\n <FormFieldLabel isRequired={props.isRequired} isDisabled={props.isDisabled}>\n {label}\n </FormFieldLabel>\n <RACButton className=\"cim-select-button\">\n <RACSelectValue\n className={(values) => clsx(values.defaultClassName, textStyle({ variant: 'medium', alignment: 'start' }))}\n >\n {({ selectedText }) => selectedText}\n </RACSelectValue>\n <IconChevronDownFill />\n </RACButton>\n <FormFieldError>{error}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n <CollapsibleList\n offset={5} // 1px border + 4px actual offset\n maxHeight={315}\n >\n <RACListBox className=\"cim-select-listbox\" items={items}>\n {children}\n </RACListBox>\n </CollapsibleList>\n </RACSelect>\n );\n}\n\n/**\n * Allows users to select one item from a collapsible list.\n *\n * See [select usage guidelines](https://ui.cimpress.io/components/select/usage-guidelines/).\n */\nconst _Select = withStyleProps(forwardRef(Select), 'Select');\n\nexport { _Select as Select };\n\nexport interface SelectItemProps extends Pick<RACListBoxItemProps, 'id' | 'isDisabled'> {\n children: StringLikeChildren;\n}\n\n/** Renders a single list item within `Select`. */\nexport function SelectItem({ children, ...props }: SelectItemProps) {\n const textValue =\n typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');\n\n return (\n <RACListBoxItem {...props} className=\"cim-select-item\" textValue={textValue}>\n {({ isDisabled }) => (\n <>\n <IconCheckmark />\n\n <RACText slot=\"label\" className={textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'base' })}>\n {children}\n </RACText>\n </>\n )}\n </RACListBoxItem>\n );\n}\n\nSelectItem.displayName = 'SelectItem';\n\nexport interface SelectSectionProps<T extends CollectionItem> extends CollectionProps<T> {\n /** The ID of the section. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the section title. */\n title: string;\n}\n\n/** Groups list items within `Select` into a section. */\nexport function SelectSection<T extends CollectionItem>({ title, children, items, ...props }: SelectSectionProps<T>) {\n if (items != null && typeof children !== 'function') {\n console.warn('`SelectSection` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACListBoxSection {...props} className=\"cim-select-section\">\n <RACHeader\n className={clsx('cim-select-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' }))}\n >\n {title}\n </RACHeader>\n <RACCollection items={items}>{children}</RACCollection>\n </RACListBoxSection>\n );\n}\n\nSelectSection.displayName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KAAK,EAAE,KAAK,YAAG,QAAQ,GAAiB,IACrC,CACrB,CAAC;AACJ,CAAC;AAED,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport { useEffect, type ForwardedRef } from 'react';\nimport {\n Button as RACButton,\n Collection as RACCollection,\n Header as RACHeader,\n ListBox as RACListBox,\n type ListBoxProps as RACListBoxProps,\n ListBoxItem as RACListBoxItem,\n ListBoxSection as RACListBoxSection,\n Select as RACSelect,\n SelectValue as RACSelectValue,\n Text as RACText,\n type ListBoxItemProps as RACListBoxItemProps,\n type SelectProps as RACSelectProps,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { IconCheckmark, IconChevronDownFill } from '../../icons/index.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { CollapsibleList } from '../internal/collapsible-list/collapsible-list.js';\nimport { FormFieldDescription, FormFieldError, FormFieldLabel } from '../internal/form-field/form-field.js';\nimport type { CollectionItem, CollectionProps, CommonProps, FieldProps, Key, StringLikeChildren } from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface SelectProps<T extends CollectionItem = CollectionItem>\n extends CommonProps,\n FieldProps<Key>,\n CollectionProps<T>,\n Pick<\n RACSelectProps<T>,\n | 'name'\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'selectedKey'\n | 'defaultSelectedKey'\n | 'autoComplete'\n | 'autoFocus'\n | 'onSelectionChange'\n | 'placeholder'\n | 'onFocus'\n | 'onBlur'\n | 'onOpenChange'\n >,\n Pick<RACListBoxProps<T>, 'onScroll'> {}\n\nfunction Select<T extends CollectionItem>(\n { children, items, label, description, error, UNSAFE_className, UNSAFE_style, onScroll, ...props }: SelectProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('Select requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n if (items != null && typeof children !== 'function') {\n console.warn('`Select` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACSelect {...props} ref={ref} className={clsx('cim-select', UNSAFE_className)} style={UNSAFE_style}>\n <FormFieldLabel isRequired={props.isRequired} isDisabled={props.isDisabled}>\n {label}\n </FormFieldLabel>\n <RACButton className=\"cim-select-button\">\n <RACSelectValue\n className={(values) => clsx(values.defaultClassName, textStyle({ variant: 'medium', alignment: 'start' }))}\n >\n {({ selectedText }) => selectedText}\n </RACSelectValue>\n <IconChevronDownFill />\n </RACButton>\n <FormFieldError>{error}</FormFieldError>\n <FormFieldDescription>{description}</FormFieldDescription>\n <CollapsibleList\n offset={5} // 1px border + 4px actual offset\n maxHeight={315}\n >\n <RACListBox className=\"cim-select-listbox\" onScroll={onScroll} items={items}>\n {children}\n </RACListBox>\n </CollapsibleList>\n </RACSelect>\n );\n}\n\n/**\n * Allows users to select one item from a collapsible list.\n *\n * See [select usage guidelines](https://ui.cimpress.io/components/select/).\n */\nconst _Select = withStyleProps(forwardRef(Select), 'Select');\n\nexport { _Select as Select };\n\nexport interface SelectItemProps\n extends Pick<RACListBoxItemProps, 'id' | 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {\n children: StringLikeChildren;\n}\n\n/** Renders a single list item within `Select`. */\nexport function SelectItem({ children, ...props }: SelectItemProps) {\n const textValue =\n typeof children === 'string' ? children : typeof children === 'number' ? String(children) : children.join('');\n\n return (\n <RACListBoxItem {...props} className=\"cim-select-item\" textValue={textValue}>\n {({ isDisabled }) => (\n <>\n <IconCheckmark />\n\n <RACText slot=\"label\" className={textStyle({ variant: 'body', tone: isDisabled ? 'muted' : 'base' })}>\n {children}\n </RACText>\n </>\n )}\n </RACListBoxItem>\n );\n}\n\nSelectItem.displayName = 'SelectItem';\n\nexport interface SelectSectionProps<T extends CollectionItem> extends CollectionProps<T> {\n /** The ID of the section. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the section title. */\n title: string;\n}\n\n/** Groups list items within `Select` into a section. */\nexport function SelectSection<T extends CollectionItem>({ title, children, items, ...props }: SelectSectionProps<T>) {\n if (items != null && typeof children !== 'function') {\n console.warn('`SelectSection` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACListBoxSection {...props} className=\"cim-select-section\">\n <RACHeader\n className={clsx('cim-select-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' }))}\n >\n {title}\n </RACHeader>\n <RACCollection items={items}>{children}</RACCollection>\n </RACListBoxSection>\n );\n}\n\nSelectSection.displayName = 'SelectSection';\n"]}
@@ -6,7 +6,11 @@ export interface SpinnerProps extends CommonProps, LabellableProps {
6
6
  */
7
7
  size?: 'small' | 'medium' | 'large';
8
8
  }
9
- /** Displays a loading indicator to represent an ongoing operation. */
9
+ /**
10
+ * Displays a loading indicator to represent an ongoing operation.
11
+ *
12
+ * See [spinner usage guidelines](https://ui.cimpress.io/components/spinner/).
13
+ */
10
14
  declare const _Spinner: (props: SpinnerProps & import("react").RefAttributes<HTMLDivElement> & import("../../with-style-props.js").StyleProps) => import("react").JSX.Element | null;
11
15
  export { _Spinner as Spinner };
12
16
  //# sourceMappingURL=spinner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../../src/components/spinner/spinner.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAIhE,MAAM,WAAW,YAAa,SAAQ,WAAW,EAAE,eAAe;IAChE;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;CACrC;AA+BD,sEAAsE;AACtE,QAAA,MAAM,QAAQ,8JAAiD,CAAC;AAEhE,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../../src/components/spinner/spinner.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAIhE,MAAM,WAAW,YAAa,SAAQ,WAAW,EAAE,eAAe;IAChE;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;CACrC;AA8BD;;;;GAIG;AACH,QAAA,MAAM,QAAQ,8JAAiD,CAAC;AAEhE,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,CAAC"}
@@ -25,8 +25,11 @@ function Spinner({ size = 'medium', label, ...props }, ref) {
25
25
  }, [label, ariaLabel, ariaLabelledBy]);
26
26
  return (_jsx(InternalSpinner, { ...props, size: ringSizes[size], spinnerRef: ref, children: label && _jsx(RACLabel, { className: textStyle({ variant: labelVariants[size], tone: 'title' }), children: label }) }));
27
27
  }
28
- // TODO: add link to usage guidelines
29
- /** Displays a loading indicator to represent an ongoing operation. */
28
+ /**
29
+ * Displays a loading indicator to represent an ongoing operation.
30
+ *
31
+ * See [spinner usage guidelines](https://ui.cimpress.io/components/spinner/).
32
+ */
30
33
  const _Spinner = withStyleProps(forwardRef(Spinner), 'Spinner');
31
34
  export { _Spinner as Spinner };
32
35
  //# sourceMappingURL=spinner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../../../src/components/spinner/spinner.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGjE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAUnD,MAAM,SAAS,GAAsD;IACnE,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,MAAM,aAAa,GAA2E;IAC5F,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,MAAM;CACd,CAAC;AAEF,SAAS,OAAO,CAAC,EAAE,IAAI,GAAG,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,EAAgB,EAAE,GAAiC;IACpG,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE7E,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,IAAI,CAAC,cAAc,EAAE,CAAC;YAC5C,OAAO,CAAC,IAAI,CAAC,gFAAgF,CAAC,CAAC;QACjG,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IAEvC,OAAO,CACL,KAAC,eAAe,OAAK,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,GAAG,YAC/D,KAAK,IAAI,KAAC,QAAQ,IAAC,SAAS,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,YAAG,KAAK,GAAY,GAC7F,CACnB,CAAC;AACJ,CAAC;AAED,qCAAqC;AACrC,sEAAsE;AACtE,MAAM,QAAQ,GAAG,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC;AAEhE,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,CAAC","sourcesContent":["'use client';\n\nimport { useEffect, type ForwardedRef } from 'react';\nimport { Label as RACLabel } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { InternalSpinner } from '../internal/spinner/spinner.js';\nimport type { CommonProps, LabellableProps } from '../types.js';\nimport type { TextStyleOptions } from '../typography/types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface SpinnerProps extends CommonProps, LabellableProps {\n /**\n * Determines the size of the spinner.\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n}\n\nconst ringSizes: Record<NonNullable<SpinnerProps['size']>, string> = {\n small: '24px',\n medium: '48px',\n large: '80px',\n};\n\nconst labelVariants: Record<NonNullable<SpinnerProps['size']>, TextStyleOptions['variant']> = {\n small: 'small',\n medium: 'medium',\n large: 'body',\n};\n\nfunction Spinner({ size = 'medium', label, ...props }: SpinnerProps, ref: ForwardedRef<HTMLDivElement>) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('Spinner requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n return (\n <InternalSpinner {...props} size={ringSizes[size]} spinnerRef={ref}>\n {label && <RACLabel className={textStyle({ variant: labelVariants[size], tone: 'title' })}>{label}</RACLabel>}\n </InternalSpinner>\n );\n}\n\n// TODO: add link to usage guidelines\n/** Displays a loading indicator to represent an ongoing operation. */\nconst _Spinner = withStyleProps(forwardRef(Spinner), 'Spinner');\n\nexport { _Spinner as Spinner };\n"]}
1
+ {"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../../../src/components/spinner/spinner.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,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components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { InternalSpinner } from '../internal/spinner/spinner.js';\nimport type { CommonProps, LabellableProps } from '../types.js';\nimport type { TextStyleOptions } from '../typography/types.js';\nimport { textStyle } from '../typography/utils.js';\n\nexport interface SpinnerProps extends CommonProps, LabellableProps {\n /**\n * Determines the size of the spinner.\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n}\n\nconst ringSizes: Record<NonNullable<SpinnerProps['size']>, string> = {\n small: '24px',\n medium: '48px',\n large: '80px',\n};\n\nconst labelVariants: Record<NonNullable<SpinnerProps['size']>, TextStyleOptions['variant']> = {\n small: 'small',\n medium: 'medium',\n large: 'body',\n};\n\nfunction Spinner({ size = 'medium', label, ...props }: SpinnerProps, ref: ForwardedRef<HTMLDivElement>) {\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn('Spinner requires one of label / aria-label / aria-labelledby for accessibility');\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n return (\n <InternalSpinner {...props} size={ringSizes[size]} spinnerRef={ref}>\n {label && <RACLabel className={textStyle({ variant: labelVariants[size], tone: 'title' })}>{label}</RACLabel>}\n </InternalSpinner>\n );\n}\n\n/**\n * Displays a loading indicator to represent an ongoing operation.\n *\n * See [spinner usage guidelines](https://ui.cimpress.io/components/spinner/).\n */\nconst _Spinner = withStyleProps(forwardRef(Spinner), 'Spinner');\n\nexport { _Spinner as Spinner };\n"]}
@@ -0,0 +1,13 @@
1
+ import { type ReactNode } from 'react';
2
+ export interface TableFocus {
3
+ focusedRowKey: string;
4
+ focusedColumnKey: string;
5
+ childFocusStrategy: ChildFocusStrategy;
6
+ setFocus: (rowKey: string, columnKey: string, childFocusStrategy?: ChildFocusStrategy) => void;
7
+ }
8
+ export type ChildFocusStrategy = 'first' | 'last';
9
+ export declare function TableFocusProvider({ children }: {
10
+ children: ReactNode;
11
+ }): import("react/jsx-runtime").JSX.Element;
12
+ export declare function useTableFocus(): TableFocus;
13
+ //# sourceMappingURL=focus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../../../../../src/components/table/contexts/focus.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAyC,MAAM,OAAO,CAAC;AAE7F,MAAM,WAAW,UAAU;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAChG;AAED,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,MAAM,CAAC;AAIlD,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAwCvE;AAGD,wBAAgB,aAAa,IAAI,UAAU,CAO1C"}
@@ -0,0 +1,47 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext, useMemo, useRef, useState } from 'react';
3
+ const TableFocusContext = createContext(null);
4
+ export function TableFocusProvider({ children }) {
5
+ // When table focus is updated, we want to trigger a re-render,
6
+ // but we also want immediate access to the new values.
7
+ // Hence why they are stored as both a ref and a state.
8
+ const focusedRowKeyRef = useRef('');
9
+ const [_focusedRowKey, setFocusedRowKey] = useState('');
10
+ const focusedColumnKeyRef = useRef('');
11
+ const [_focusedColumnKey, setFocusedColumnKey] = useState('');
12
+ const childFocusStrategyRef = useRef('first');
13
+ const [_childFocusStrategy, setChildFocusStrategy] = useState('first');
14
+ const tableFocus = useMemo(() => ({
15
+ get focusedRowKey() {
16
+ return focusedRowKeyRef.current;
17
+ },
18
+ get focusedColumnKey() {
19
+ return focusedColumnKeyRef.current;
20
+ },
21
+ get childFocusStrategy() {
22
+ return childFocusStrategyRef.current;
23
+ },
24
+ setFocus: (rowKey, columnKey, childFocusStrategy) => {
25
+ focusedRowKeyRef.current = rowKey;
26
+ setFocusedRowKey(rowKey);
27
+ focusedColumnKeyRef.current = columnKey;
28
+ setFocusedColumnKey(columnKey);
29
+ if (childFocusStrategy) {
30
+ childFocusStrategyRef.current = childFocusStrategy;
31
+ setChildFocusStrategy(childFocusStrategy);
32
+ }
33
+ },
34
+ }),
35
+ // eslint-disable-next-line react-hooks/exhaustive-deps
36
+ [_focusedRowKey, _focusedColumnKey, _childFocusStrategy]);
37
+ return _jsx(TableFocusContext.Provider, { value: tableFocus, children: children });
38
+ }
39
+ // eslint-disable-next-line react-refresh/only-export-components
40
+ export function useTableFocus() {
41
+ const tableFocus = useContext(TableFocusContext);
42
+ if (!tableFocus) {
43
+ throw new Error('Cannot use table focus outside of a table');
44
+ }
45
+ return tableFocus;
46
+ }
47
+ //# sourceMappingURL=focus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focus.js","sourceRoot":"","sources":["../../../../../src/components/table/contexts/focus.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAkB,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAW7F,MAAM,iBAAiB,GAAG,aAAa,CAAoB,IAAI,CAAC,CAAC;AAEjE,MAAM,UAAU,kBAAkB,CAAC,EAAE,QAAQ,EAA2B;IACtE,+DAA+D;IAC/D,uDAAuD;IACvD,uDAAuD;IACvD,MAAM,gBAAgB,GAAG,MAAM,CAAS,EAAE,CAAC,CAAC;IAC5C,MAAM,CAAC,cAAc,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAS,EAAE,CAAC,CAAC;IAChE,MAAM,mBAAmB,GAAG,MAAM,CAAS,EAAE,CAAC,CAAC;IAC/C,MAAM,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,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U,CAAC;AACpB,CAAC","sourcesContent":["import { createContext, type ReactNode, useContext, useMemo, useRef, useState } from 'react';\n\nexport interface TableFocus {\n focusedRowKey: string;\n focusedColumnKey: string;\n childFocusStrategy: ChildFocusStrategy;\n setFocus: (rowKey: string, columnKey: string, childFocusStrategy?: ChildFocusStrategy) => void;\n}\n\nexport type ChildFocusStrategy = 'first' | 'last';\n\nconst TableFocusContext = createContext<TableFocus | null>(null);\n\nexport function TableFocusProvider({ children }: { children: ReactNode }) {\n // When table focus is updated, we want to trigger a re-render,\n // but we also want immediate access to the new values.\n // Hence why they are stored as both a ref and a state.\n const focusedRowKeyRef = useRef<string>('');\n const [_focusedRowKey, setFocusedRowKey] = useState<string>('');\n const focusedColumnKeyRef = useRef<string>('');\n const [_focusedColumnKey, setFocusedColumnKey] = useState<string>('');\n const childFocusStrategyRef = useRef<ChildFocusStrategy>('first');\n const [_childFocusStrategy, setChildFocusStrategy] = useState<ChildFocusStrategy>('first');\n\n const tableFocus: TableFocus = useMemo(\n () => ({\n get focusedRowKey() {\n return focusedRowKeyRef.current;\n },\n get focusedColumnKey() {\n return focusedColumnKeyRef.current;\n },\n get childFocusStrategy() {\n return childFocusStrategyRef.current;\n },\n setFocus: (rowKey, columnKey, childFocusStrategy) => {\n focusedRowKeyRef.current = rowKey;\n setFocusedRowKey(rowKey);\n\n focusedColumnKeyRef.current = columnKey;\n setFocusedColumnKey(columnKey);\n\n if (childFocusStrategy) {\n childFocusStrategyRef.current = childFocusStrategy;\n setChildFocusStrategy(childFocusStrategy);\n }\n },\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [_focusedRowKey, _focusedColumnKey, _childFocusStrategy],\n );\n\n return <TableFocusContext.Provider value={tableFocus}>{children}</TableFocusContext.Provider>;\n}\n\n// eslint-disable-next-line react-refresh/only-export-components\nexport function useTableFocus(): TableFocus {\n const tableFocus = useContext(TableFocusContext);\n if (!tableFocus) {\n throw new Error('Cannot use table focus outside of a table');\n }\n\n return tableFocus;\n}\n"]}