@cimpress-ui/react 1.8.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (417) hide show
  1. package/dist/commonjs/components/app-header/app-header.d.ts +2 -0
  2. package/dist/commonjs/components/app-header/app-header.d.ts.map +1 -1
  3. package/dist/commonjs/components/app-header/app-header.js +7 -2
  4. package/dist/commonjs/components/app-header/app-header.js.map +1 -1
  5. package/dist/commonjs/components/app-header/cimpress-logo.js +1 -1
  6. package/dist/commonjs/components/app-header/cimpress-logo.js.map +1 -1
  7. package/dist/commonjs/components/copy/copy-button.d.ts +7 -0
  8. package/dist/commonjs/components/copy/copy-button.d.ts.map +1 -1
  9. package/dist/commonjs/components/copy/copy-button.js +42 -7
  10. package/dist/commonjs/components/copy/copy-button.js.map +1 -1
  11. package/dist/commonjs/components/copy/use-copy.d.ts.map +1 -1
  12. package/dist/commonjs/components/copy/use-copy.js +10 -10
  13. package/dist/commonjs/components/copy/use-copy.js.map +1 -1
  14. package/dist/commonjs/components/date-picker/views/multi-year/use-multi-year-view-state.js +4 -7
  15. package/dist/commonjs/components/date-picker/views/multi-year/use-multi-year-view-state.js.map +1 -1
  16. package/dist/commonjs/components/select/select.d.ts +7 -1
  17. package/dist/commonjs/components/select/select.d.ts.map +1 -1
  18. package/dist/commonjs/components/select/select.js +2 -2
  19. package/dist/commonjs/components/select/select.js.map +1 -1
  20. package/dist/commonjs/components/table/contexts/column-collection.d.ts.map +1 -1
  21. package/dist/commonjs/components/table/contexts/column-collection.js +0 -1
  22. package/dist/commonjs/components/table/contexts/column-collection.js.map +1 -1
  23. package/dist/commonjs/components/table/contexts/row-state.js.map +1 -1
  24. package/dist/commonjs/components/table/contexts/table-state.js.map +1 -1
  25. package/dist/commonjs/components/table/hooks/use-table-cell.js.map +1 -1
  26. package/dist/commonjs/components/tag-field/tag-field-list-box.js +5 -2
  27. package/dist/commonjs/components/tag-field/tag-field-list-box.js.map +1 -1
  28. package/dist/commonjs/components/tag-field/tag-field-tags.js +2 -0
  29. package/dist/commonjs/components/tag-field/tag-field-tags.js.map +1 -1
  30. package/dist/commonjs/components/tag-field/tag-field.js +1 -1
  31. package/dist/commonjs/components/tag-field/tag-field.js.map +1 -1
  32. package/dist/commonjs/components/toggle-button/internal-toggle-button.js +7 -7
  33. package/dist/commonjs/components/toggle-button/internal-toggle-button.js.map +1 -1
  34. package/dist/commonjs/components/toggle-button/toggle-button-group.d.ts.map +1 -1
  35. package/dist/commonjs/components/toggle-button/toggle-button-group.js +3 -0
  36. package/dist/commonjs/components/toggle-button/toggle-button-group.js.map +1 -1
  37. package/dist/commonjs/components/typography/link.js +1 -1
  38. package/dist/commonjs/components/typography/link.js.map +1 -1
  39. package/dist/commonjs/icons/align-horizontal-center.d.ts +8 -0
  40. package/dist/commonjs/icons/align-horizontal-center.d.ts.map +1 -0
  41. package/dist/commonjs/icons/align-horizontal-center.js +24 -0
  42. package/dist/commonjs/icons/align-horizontal-center.js.map +1 -0
  43. package/dist/commonjs/icons/align-horizontal-left.d.ts +8 -0
  44. package/dist/commonjs/icons/align-horizontal-left.d.ts.map +1 -0
  45. package/dist/commonjs/icons/align-horizontal-left.js +24 -0
  46. package/dist/commonjs/icons/align-horizontal-left.js.map +1 -0
  47. package/dist/commonjs/icons/align-horizontal-right.d.ts +8 -0
  48. package/dist/commonjs/icons/align-horizontal-right.d.ts.map +1 -0
  49. package/dist/commonjs/icons/align-horizontal-right.js +24 -0
  50. package/dist/commonjs/icons/align-horizontal-right.js.map +1 -0
  51. package/dist/commonjs/icons/align-vertical-bottom.d.ts +8 -0
  52. package/dist/commonjs/icons/align-vertical-bottom.d.ts.map +1 -0
  53. package/dist/commonjs/icons/align-vertical-bottom.js +24 -0
  54. package/dist/commonjs/icons/align-vertical-bottom.js.map +1 -0
  55. package/dist/commonjs/icons/align-vertical-center.d.ts +8 -0
  56. package/dist/commonjs/icons/align-vertical-center.d.ts.map +1 -0
  57. package/dist/commonjs/icons/align-vertical-center.js +24 -0
  58. package/dist/commonjs/icons/align-vertical-center.js.map +1 -0
  59. package/dist/commonjs/icons/align-vertical-top.d.ts +8 -0
  60. package/dist/commonjs/icons/align-vertical-top.d.ts.map +1 -0
  61. package/dist/commonjs/icons/align-vertical-top.js +24 -0
  62. package/dist/commonjs/icons/align-vertical-top.js.map +1 -0
  63. package/dist/commonjs/icons/analytics-bars.d.ts +8 -0
  64. package/dist/commonjs/icons/analytics-bars.d.ts.map +1 -0
  65. package/dist/commonjs/icons/analytics-bars.js +24 -0
  66. package/dist/commonjs/icons/analytics-bars.js.map +1 -0
  67. package/dist/commonjs/icons/bolt.d.ts +8 -0
  68. package/dist/commonjs/icons/bolt.d.ts.map +1 -0
  69. package/dist/commonjs/icons/bolt.js +24 -0
  70. package/dist/commonjs/icons/bolt.js.map +1 -0
  71. package/dist/commonjs/icons/border-dashed.d.ts +8 -0
  72. package/dist/commonjs/icons/border-dashed.d.ts.map +1 -0
  73. package/dist/commonjs/icons/border-dashed.js +24 -0
  74. package/dist/commonjs/icons/border-dashed.js.map +1 -0
  75. package/dist/commonjs/icons/border-solid.d.ts +8 -0
  76. package/dist/commonjs/icons/border-solid.d.ts.map +1 -0
  77. package/dist/commonjs/icons/border-solid.js +24 -0
  78. package/dist/commonjs/icons/border-solid.js.map +1 -0
  79. package/dist/commonjs/icons/clock-fill.d.ts +8 -0
  80. package/dist/commonjs/icons/clock-fill.d.ts.map +1 -0
  81. package/dist/commonjs/icons/clock-fill.js +24 -0
  82. package/dist/commonjs/icons/clock-fill.js.map +1 -0
  83. package/dist/commonjs/icons/clock-history.d.ts +8 -0
  84. package/dist/commonjs/icons/clock-history.d.ts.map +1 -0
  85. package/dist/commonjs/icons/clock-history.js +24 -0
  86. package/dist/commonjs/icons/clock-history.js.map +1 -0
  87. package/dist/commonjs/icons/clock-user.d.ts.map +1 -1
  88. package/dist/commonjs/icons/clock-user.js +1 -1
  89. package/dist/commonjs/icons/clock-user.js.map +1 -1
  90. package/dist/commonjs/icons/clock.d.ts +8 -0
  91. package/dist/commonjs/icons/clock.d.ts.map +1 -0
  92. package/dist/commonjs/icons/clock.js +24 -0
  93. package/dist/commonjs/icons/clock.js.map +1 -0
  94. package/dist/commonjs/icons/crown.d.ts +8 -0
  95. package/dist/commonjs/icons/crown.d.ts.map +1 -0
  96. package/dist/commonjs/icons/crown.js +24 -0
  97. package/dist/commonjs/icons/crown.js.map +1 -0
  98. package/dist/commonjs/icons/duplicate.d.ts +8 -0
  99. package/dist/commonjs/icons/duplicate.d.ts.map +1 -0
  100. package/dist/commonjs/icons/duplicate.js +24 -0
  101. package/dist/commonjs/icons/duplicate.js.map +1 -0
  102. package/dist/commonjs/icons/error-fill.d.ts +8 -0
  103. package/dist/commonjs/icons/error-fill.d.ts.map +1 -0
  104. package/dist/commonjs/icons/error-fill.js +24 -0
  105. package/dist/commonjs/icons/error-fill.js.map +1 -0
  106. package/dist/commonjs/icons/error.d.ts +8 -0
  107. package/dist/commonjs/icons/error.d.ts.map +1 -0
  108. package/dist/commonjs/icons/error.js +24 -0
  109. package/dist/commonjs/icons/error.js.map +1 -0
  110. package/dist/commonjs/icons/experiment.d.ts +8 -0
  111. package/dist/commonjs/icons/experiment.d.ts.map +1 -0
  112. package/dist/commonjs/icons/experiment.js +24 -0
  113. package/dist/commonjs/icons/experiment.js.map +1 -0
  114. package/dist/commonjs/icons/external-slack.d.ts +8 -0
  115. package/dist/commonjs/icons/external-slack.d.ts.map +1 -0
  116. package/dist/commonjs/icons/external-slack.js +24 -0
  117. package/dist/commonjs/icons/external-slack.js.map +1 -0
  118. package/dist/commonjs/icons/filter.d.ts +8 -0
  119. package/dist/commonjs/icons/filter.d.ts.map +1 -0
  120. package/dist/commonjs/icons/filter.js +24 -0
  121. package/dist/commonjs/icons/filter.js.map +1 -0
  122. package/dist/commonjs/icons/flip-horizontal.d.ts +8 -0
  123. package/dist/commonjs/icons/flip-horizontal.d.ts.map +1 -0
  124. package/dist/commonjs/icons/flip-horizontal.js +24 -0
  125. package/dist/commonjs/icons/flip-horizontal.js.map +1 -0
  126. package/dist/commonjs/icons/flip-vertical.d.ts +8 -0
  127. package/dist/commonjs/icons/flip-vertical.d.ts.map +1 -0
  128. package/dist/commonjs/icons/flip-vertical.js +24 -0
  129. package/dist/commonjs/icons/flip-vertical.js.map +1 -0
  130. package/dist/commonjs/icons/index.d.ts +40 -0
  131. package/dist/commonjs/icons/index.d.ts.map +1 -1
  132. package/dist/commonjs/icons/index.js +84 -3
  133. package/dist/commonjs/icons/index.js.map +1 -1
  134. package/dist/commonjs/icons/layer-down.d.ts +8 -0
  135. package/dist/commonjs/icons/layer-down.d.ts.map +1 -0
  136. package/dist/commonjs/icons/layer-down.js +24 -0
  137. package/dist/commonjs/icons/layer-down.js.map +1 -0
  138. package/dist/commonjs/icons/layer-up.d.ts +8 -0
  139. package/dist/commonjs/icons/layer-up.d.ts.map +1 -0
  140. package/dist/commonjs/icons/layer-up.js +24 -0
  141. package/dist/commonjs/icons/layer-up.js.map +1 -0
  142. package/dist/commonjs/icons/play.d.ts +8 -0
  143. package/dist/commonjs/icons/play.d.ts.map +1 -0
  144. package/dist/commonjs/icons/play.js +24 -0
  145. package/dist/commonjs/icons/play.js.map +1 -0
  146. package/dist/commonjs/icons/pointer.d.ts +8 -0
  147. package/dist/commonjs/icons/pointer.d.ts.map +1 -0
  148. package/dist/commonjs/icons/pointer.js +24 -0
  149. package/dist/commonjs/icons/pointer.js.map +1 -0
  150. package/dist/commonjs/icons/push-left.d.ts +8 -0
  151. package/dist/commonjs/icons/push-left.d.ts.map +1 -0
  152. package/dist/commonjs/icons/push-left.js +24 -0
  153. package/dist/commonjs/icons/push-left.js.map +1 -0
  154. package/dist/commonjs/icons/push-right.d.ts +8 -0
  155. package/dist/commonjs/icons/push-right.d.ts.map +1 -0
  156. package/dist/commonjs/icons/push-right.js +24 -0
  157. package/dist/commonjs/icons/push-right.js.map +1 -0
  158. package/dist/commonjs/icons/qrcode.d.ts +8 -0
  159. package/dist/commonjs/icons/qrcode.d.ts.map +1 -0
  160. package/dist/commonjs/icons/qrcode.js +24 -0
  161. package/dist/commonjs/icons/qrcode.js.map +1 -0
  162. package/dist/commonjs/icons/rotation-angle.d.ts +8 -0
  163. package/dist/commonjs/icons/rotation-angle.d.ts.map +1 -0
  164. package/dist/commonjs/icons/rotation-angle.js +24 -0
  165. package/dist/commonjs/icons/rotation-angle.js.map +1 -0
  166. package/dist/commonjs/icons/shape-circle.d.ts +8 -0
  167. package/dist/commonjs/icons/shape-circle.d.ts.map +1 -0
  168. package/dist/commonjs/icons/shape-circle.js +24 -0
  169. package/dist/commonjs/icons/shape-circle.js.map +1 -0
  170. package/dist/commonjs/icons/shape-line.d.ts +8 -0
  171. package/dist/commonjs/icons/shape-line.d.ts.map +1 -0
  172. package/dist/commonjs/icons/shape-line.js +24 -0
  173. package/dist/commonjs/icons/shape-line.js.map +1 -0
  174. package/dist/commonjs/icons/shape-rectangle.d.ts +8 -0
  175. package/dist/commonjs/icons/shape-rectangle.d.ts.map +1 -0
  176. package/dist/commonjs/icons/shape-rectangle.js +24 -0
  177. package/dist/commonjs/icons/shape-rectangle.js.map +1 -0
  178. package/dist/commonjs/icons/shape-triangle.d.ts +8 -0
  179. package/dist/commonjs/icons/shape-triangle.d.ts.map +1 -0
  180. package/dist/commonjs/icons/shape-triangle.js +24 -0
  181. package/dist/commonjs/icons/shape-triangle.js.map +1 -0
  182. package/dist/commonjs/icons/shapes.d.ts +8 -0
  183. package/dist/commonjs/icons/shapes.d.ts.map +1 -0
  184. package/dist/commonjs/icons/shapes.js +24 -0
  185. package/dist/commonjs/icons/shapes.js.map +1 -0
  186. package/dist/commonjs/icons/target.d.ts +8 -0
  187. package/dist/commonjs/icons/target.d.ts.map +1 -0
  188. package/dist/commonjs/icons/target.js +24 -0
  189. package/dist/commonjs/icons/target.js.map +1 -0
  190. package/dist/commonjs/icons/text.d.ts +8 -0
  191. package/dist/commonjs/icons/text.d.ts.map +1 -0
  192. package/dist/commonjs/icons/text.js +24 -0
  193. package/dist/commonjs/icons/text.js.map +1 -0
  194. package/dist/commonjs/icons/upload.d.ts +8 -0
  195. package/dist/commonjs/icons/upload.d.ts.map +1 -0
  196. package/dist/commonjs/icons/upload.js +24 -0
  197. package/dist/commonjs/icons/upload.js.map +1 -0
  198. package/dist/commonjs/icons/user.d.ts +8 -0
  199. package/dist/commonjs/icons/user.d.ts.map +1 -0
  200. package/dist/commonjs/icons/user.js +24 -0
  201. package/dist/commonjs/icons/user.js.map +1 -0
  202. package/dist/commonjs/icons/users.d.ts +8 -0
  203. package/dist/commonjs/icons/users.d.ts.map +1 -0
  204. package/dist/commonjs/icons/users.js +24 -0
  205. package/dist/commonjs/icons/users.js.map +1 -0
  206. package/dist/esm/components/app-header/app-header.d.ts +2 -0
  207. package/dist/esm/components/app-header/app-header.d.ts.map +1 -1
  208. package/dist/esm/components/app-header/app-header.js +7 -2
  209. package/dist/esm/components/app-header/app-header.js.map +1 -1
  210. package/dist/esm/components/app-header/cimpress-logo.js +1 -1
  211. package/dist/esm/components/app-header/cimpress-logo.js.map +1 -1
  212. package/dist/esm/components/copy/copy-button.d.ts +7 -0
  213. package/dist/esm/components/copy/copy-button.d.ts.map +1 -1
  214. package/dist/esm/components/copy/copy-button.js +42 -7
  215. package/dist/esm/components/copy/copy-button.js.map +1 -1
  216. package/dist/esm/components/copy/use-copy.d.ts.map +1 -1
  217. package/dist/esm/components/copy/use-copy.js +11 -11
  218. package/dist/esm/components/copy/use-copy.js.map +1 -1
  219. package/dist/esm/components/date-picker/views/multi-year/use-multi-year-view-state.js +4 -7
  220. package/dist/esm/components/date-picker/views/multi-year/use-multi-year-view-state.js.map +1 -1
  221. package/dist/esm/components/select/select.d.ts +7 -1
  222. package/dist/esm/components/select/select.d.ts.map +1 -1
  223. package/dist/esm/components/select/select.js +2 -2
  224. package/dist/esm/components/select/select.js.map +1 -1
  225. package/dist/esm/components/table/contexts/column-collection.d.ts.map +1 -1
  226. package/dist/esm/components/table/contexts/column-collection.js +0 -1
  227. package/dist/esm/components/table/contexts/column-collection.js.map +1 -1
  228. package/dist/esm/components/table/contexts/row-state.js +2 -2
  229. package/dist/esm/components/table/contexts/row-state.js.map +1 -1
  230. package/dist/esm/components/table/contexts/table-state.js +2 -2
  231. package/dist/esm/components/table/contexts/table-state.js.map +1 -1
  232. package/dist/esm/components/table/hooks/use-table-cell.js +2 -2
  233. package/dist/esm/components/table/hooks/use-table-cell.js.map +1 -1
  234. package/dist/esm/components/tag-field/tag-field-list-box.js +5 -2
  235. package/dist/esm/components/tag-field/tag-field-list-box.js.map +1 -1
  236. package/dist/esm/components/tag-field/tag-field-tags.js +2 -0
  237. package/dist/esm/components/tag-field/tag-field-tags.js.map +1 -1
  238. package/dist/esm/components/tag-field/tag-field.js +1 -1
  239. package/dist/esm/components/tag-field/tag-field.js.map +1 -1
  240. package/dist/esm/components/toggle-button/internal-toggle-button.js +7 -7
  241. package/dist/esm/components/toggle-button/internal-toggle-button.js.map +1 -1
  242. package/dist/esm/components/toggle-button/toggle-button-group.d.ts.map +1 -1
  243. package/dist/esm/components/toggle-button/toggle-button-group.js +3 -0
  244. package/dist/esm/components/toggle-button/toggle-button-group.js.map +1 -1
  245. package/dist/esm/components/typography/link.js +1 -1
  246. package/dist/esm/components/typography/link.js.map +1 -1
  247. package/dist/esm/icons/align-horizontal-center.d.ts +8 -0
  248. package/dist/esm/icons/align-horizontal-center.d.ts.map +1 -0
  249. package/dist/esm/icons/align-horizontal-center.js +19 -0
  250. package/dist/esm/icons/align-horizontal-center.js.map +1 -0
  251. package/dist/esm/icons/align-horizontal-left.d.ts +8 -0
  252. package/dist/esm/icons/align-horizontal-left.d.ts.map +1 -0
  253. package/dist/esm/icons/align-horizontal-left.js +19 -0
  254. package/dist/esm/icons/align-horizontal-left.js.map +1 -0
  255. package/dist/esm/icons/align-horizontal-right.d.ts +8 -0
  256. package/dist/esm/icons/align-horizontal-right.d.ts.map +1 -0
  257. package/dist/esm/icons/align-horizontal-right.js +19 -0
  258. package/dist/esm/icons/align-horizontal-right.js.map +1 -0
  259. package/dist/esm/icons/align-vertical-bottom.d.ts +8 -0
  260. package/dist/esm/icons/align-vertical-bottom.d.ts.map +1 -0
  261. package/dist/esm/icons/align-vertical-bottom.js +19 -0
  262. package/dist/esm/icons/align-vertical-bottom.js.map +1 -0
  263. package/dist/esm/icons/align-vertical-center.d.ts +8 -0
  264. package/dist/esm/icons/align-vertical-center.d.ts.map +1 -0
  265. package/dist/esm/icons/align-vertical-center.js +19 -0
  266. package/dist/esm/icons/align-vertical-center.js.map +1 -0
  267. package/dist/esm/icons/align-vertical-top.d.ts +8 -0
  268. package/dist/esm/icons/align-vertical-top.d.ts.map +1 -0
  269. package/dist/esm/icons/align-vertical-top.js +19 -0
  270. package/dist/esm/icons/align-vertical-top.js.map +1 -0
  271. package/dist/esm/icons/analytics-bars.d.ts +8 -0
  272. package/dist/esm/icons/analytics-bars.d.ts.map +1 -0
  273. package/dist/esm/icons/analytics-bars.js +19 -0
  274. package/dist/esm/icons/analytics-bars.js.map +1 -0
  275. package/dist/esm/icons/bolt.d.ts +8 -0
  276. package/dist/esm/icons/bolt.d.ts.map +1 -0
  277. package/dist/esm/icons/bolt.js +19 -0
  278. package/dist/esm/icons/bolt.js.map +1 -0
  279. package/dist/esm/icons/border-dashed.d.ts +8 -0
  280. package/dist/esm/icons/border-dashed.d.ts.map +1 -0
  281. package/dist/esm/icons/border-dashed.js +19 -0
  282. package/dist/esm/icons/border-dashed.js.map +1 -0
  283. package/dist/esm/icons/border-solid.d.ts +8 -0
  284. package/dist/esm/icons/border-solid.d.ts.map +1 -0
  285. package/dist/esm/icons/border-solid.js +19 -0
  286. package/dist/esm/icons/border-solid.js.map +1 -0
  287. package/dist/esm/icons/clock-fill.d.ts +8 -0
  288. package/dist/esm/icons/clock-fill.d.ts.map +1 -0
  289. package/dist/esm/icons/clock-fill.js +19 -0
  290. package/dist/esm/icons/clock-fill.js.map +1 -0
  291. package/dist/esm/icons/clock-history.d.ts +8 -0
  292. package/dist/esm/icons/clock-history.d.ts.map +1 -0
  293. package/dist/esm/icons/clock-history.js +19 -0
  294. package/dist/esm/icons/clock-history.js.map +1 -0
  295. package/dist/esm/icons/clock-user.d.ts.map +1 -1
  296. package/dist/esm/icons/clock-user.js +1 -1
  297. package/dist/esm/icons/clock-user.js.map +1 -1
  298. package/dist/esm/icons/clock.d.ts +8 -0
  299. package/dist/esm/icons/clock.d.ts.map +1 -0
  300. package/dist/esm/icons/clock.js +19 -0
  301. package/dist/esm/icons/clock.js.map +1 -0
  302. package/dist/esm/icons/crown.d.ts +8 -0
  303. package/dist/esm/icons/crown.d.ts.map +1 -0
  304. package/dist/esm/icons/crown.js +19 -0
  305. package/dist/esm/icons/crown.js.map +1 -0
  306. package/dist/esm/icons/duplicate.d.ts +8 -0
  307. package/dist/esm/icons/duplicate.d.ts.map +1 -0
  308. package/dist/esm/icons/duplicate.js +19 -0
  309. package/dist/esm/icons/duplicate.js.map +1 -0
  310. package/dist/esm/icons/error-fill.d.ts +8 -0
  311. package/dist/esm/icons/error-fill.d.ts.map +1 -0
  312. package/dist/esm/icons/error-fill.js +19 -0
  313. package/dist/esm/icons/error-fill.js.map +1 -0
  314. package/dist/esm/icons/error.d.ts +8 -0
  315. package/dist/esm/icons/error.d.ts.map +1 -0
  316. package/dist/esm/icons/error.js +19 -0
  317. package/dist/esm/icons/error.js.map +1 -0
  318. package/dist/esm/icons/experiment.d.ts +8 -0
  319. package/dist/esm/icons/experiment.d.ts.map +1 -0
  320. package/dist/esm/icons/experiment.js +19 -0
  321. package/dist/esm/icons/experiment.js.map +1 -0
  322. package/dist/esm/icons/external-slack.d.ts +8 -0
  323. package/dist/esm/icons/external-slack.d.ts.map +1 -0
  324. package/dist/esm/icons/external-slack.js +19 -0
  325. package/dist/esm/icons/external-slack.js.map +1 -0
  326. package/dist/esm/icons/filter.d.ts +8 -0
  327. package/dist/esm/icons/filter.d.ts.map +1 -0
  328. package/dist/esm/icons/filter.js +19 -0
  329. package/dist/esm/icons/filter.js.map +1 -0
  330. package/dist/esm/icons/flip-horizontal.d.ts +8 -0
  331. package/dist/esm/icons/flip-horizontal.d.ts.map +1 -0
  332. package/dist/esm/icons/flip-horizontal.js +19 -0
  333. package/dist/esm/icons/flip-horizontal.js.map +1 -0
  334. package/dist/esm/icons/flip-vertical.d.ts +8 -0
  335. package/dist/esm/icons/flip-vertical.d.ts.map +1 -0
  336. package/dist/esm/icons/flip-vertical.js +19 -0
  337. package/dist/esm/icons/flip-vertical.js.map +1 -0
  338. package/dist/esm/icons/index.d.ts +40 -0
  339. package/dist/esm/icons/index.d.ts.map +1 -1
  340. package/dist/esm/icons/index.js +40 -0
  341. package/dist/esm/icons/index.js.map +1 -1
  342. package/dist/esm/icons/layer-down.d.ts +8 -0
  343. package/dist/esm/icons/layer-down.d.ts.map +1 -0
  344. package/dist/esm/icons/layer-down.js +19 -0
  345. package/dist/esm/icons/layer-down.js.map +1 -0
  346. package/dist/esm/icons/layer-up.d.ts +8 -0
  347. package/dist/esm/icons/layer-up.d.ts.map +1 -0
  348. package/dist/esm/icons/layer-up.js +19 -0
  349. package/dist/esm/icons/layer-up.js.map +1 -0
  350. package/dist/esm/icons/play.d.ts +8 -0
  351. package/dist/esm/icons/play.d.ts.map +1 -0
  352. package/dist/esm/icons/play.js +19 -0
  353. package/dist/esm/icons/play.js.map +1 -0
  354. package/dist/esm/icons/pointer.d.ts +8 -0
  355. package/dist/esm/icons/pointer.d.ts.map +1 -0
  356. package/dist/esm/icons/pointer.js +19 -0
  357. package/dist/esm/icons/pointer.js.map +1 -0
  358. package/dist/esm/icons/push-left.d.ts +8 -0
  359. package/dist/esm/icons/push-left.d.ts.map +1 -0
  360. package/dist/esm/icons/push-left.js +19 -0
  361. package/dist/esm/icons/push-left.js.map +1 -0
  362. package/dist/esm/icons/push-right.d.ts +8 -0
  363. package/dist/esm/icons/push-right.d.ts.map +1 -0
  364. package/dist/esm/icons/push-right.js +19 -0
  365. package/dist/esm/icons/push-right.js.map +1 -0
  366. package/dist/esm/icons/qrcode.d.ts +8 -0
  367. package/dist/esm/icons/qrcode.d.ts.map +1 -0
  368. package/dist/esm/icons/qrcode.js +19 -0
  369. package/dist/esm/icons/qrcode.js.map +1 -0
  370. package/dist/esm/icons/rotation-angle.d.ts +8 -0
  371. package/dist/esm/icons/rotation-angle.d.ts.map +1 -0
  372. package/dist/esm/icons/rotation-angle.js +19 -0
  373. package/dist/esm/icons/rotation-angle.js.map +1 -0
  374. package/dist/esm/icons/shape-circle.d.ts +8 -0
  375. package/dist/esm/icons/shape-circle.d.ts.map +1 -0
  376. package/dist/esm/icons/shape-circle.js +19 -0
  377. package/dist/esm/icons/shape-circle.js.map +1 -0
  378. package/dist/esm/icons/shape-line.d.ts +8 -0
  379. package/dist/esm/icons/shape-line.d.ts.map +1 -0
  380. package/dist/esm/icons/shape-line.js +19 -0
  381. package/dist/esm/icons/shape-line.js.map +1 -0
  382. package/dist/esm/icons/shape-rectangle.d.ts +8 -0
  383. package/dist/esm/icons/shape-rectangle.d.ts.map +1 -0
  384. package/dist/esm/icons/shape-rectangle.js +19 -0
  385. package/dist/esm/icons/shape-rectangle.js.map +1 -0
  386. package/dist/esm/icons/shape-triangle.d.ts +8 -0
  387. package/dist/esm/icons/shape-triangle.d.ts.map +1 -0
  388. package/dist/esm/icons/shape-triangle.js +19 -0
  389. package/dist/esm/icons/shape-triangle.js.map +1 -0
  390. package/dist/esm/icons/shapes.d.ts +8 -0
  391. package/dist/esm/icons/shapes.d.ts.map +1 -0
  392. package/dist/esm/icons/shapes.js +19 -0
  393. package/dist/esm/icons/shapes.js.map +1 -0
  394. package/dist/esm/icons/target.d.ts +8 -0
  395. package/dist/esm/icons/target.d.ts.map +1 -0
  396. package/dist/esm/icons/target.js +19 -0
  397. package/dist/esm/icons/target.js.map +1 -0
  398. package/dist/esm/icons/text.d.ts +8 -0
  399. package/dist/esm/icons/text.d.ts.map +1 -0
  400. package/dist/esm/icons/text.js +19 -0
  401. package/dist/esm/icons/text.js.map +1 -0
  402. package/dist/esm/icons/upload.d.ts +8 -0
  403. package/dist/esm/icons/upload.d.ts.map +1 -0
  404. package/dist/esm/icons/upload.js +19 -0
  405. package/dist/esm/icons/upload.js.map +1 -0
  406. package/dist/esm/icons/user.d.ts +8 -0
  407. package/dist/esm/icons/user.d.ts.map +1 -0
  408. package/dist/esm/icons/user.js +19 -0
  409. package/dist/esm/icons/user.js.map +1 -0
  410. package/dist/esm/icons/users.d.ts +8 -0
  411. package/dist/esm/icons/users.d.ts.map +1 -0
  412. package/dist/esm/icons/users.js +19 -0
  413. package/dist/esm/icons/users.js.map +1 -0
  414. package/dist-styles/core.css +1 -1
  415. package/dist-styles/normalize.css +1 -1
  416. package/dist-styles/styles.css +1 -1
  417. package/package.json +16 -16
@@ -10,6 +10,8 @@ export interface AppHeaderProps extends CommonProps {
10
10
  /** The tools to render at the end of the header. */
11
11
  tools?: ReactNode;
12
12
  UNSTABLE_navButton?: ReactNode;
13
+ UNSTABLE_postTitle?: ReactNode;
14
+ UNSTABLE_search?: ReactNode;
13
15
  }
14
16
  /**
15
17
  * Displays a basic application header.
@@ -1 +1 @@
1
- {"version":3,"file":"app-header.d.ts","sourceRoot":"","sources":["../../../../src/components/app-header/app-header.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAKpF,MAAM,WAAW,uBAAwB,SAAQ,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC;CAAG;AAEzF,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD,sGAAsG;IACtG,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,SAAS,EAAE,IAAI,GAAG,uBAAuB,CAAC;IAC1C,oDAAoD;IACpD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,kBAAkB,CAAC,EAAE,SAAS,CAAC;CAChC;AA4BD;;;;GAIG;AACH,QAAA,MAAM,UAAU,+GAAqC,CAAC;AAEtD,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"app-header.d.ts","sourceRoot":"","sources":["../../../../src/components/app-header/app-header.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AAOrD,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAKpF,MAAM,WAAW,uBAAwB,SAAQ,YAAY,CAAC,eAAe,EAAE,MAAM,CAAC;CAAG;AAEzF,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD,sGAAsG;IACtG,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,SAAS,EAAE,IAAI,GAAG,uBAAuB,CAAC;IAC1C,oDAAoD;IACpD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAC/B,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAC/B,eAAe,CAAC,EAAE,SAAS,CAAC;CAC7B;AA2DD;;;;GAIG;AACH,QAAA,MAAM,UAAU,+GAAqC,CAAC;AAEtD,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,CAAC"}
@@ -8,13 +8,18 @@ exports.AppHeader = void 0;
8
8
  const jsx_runtime_1 = require("react/jsx-runtime");
9
9
  const clsx_1 = __importDefault(require("clsx"));
10
10
  const forward_ref_js_1 = require("../../forward-ref.js");
11
+ const index_js_1 = require("../../icons/index.js");
12
+ const use_is_mobile_js_1 = require("../../utils/use-is-mobile.js");
13
+ const icon_button_js_1 = require("../button/icon-button.js");
11
14
  const divider_js_1 = require("../divider/divider.js");
15
+ const popover_js_1 = require("../popover/popover.js");
12
16
  const link_js_1 = require("../typography/link.js");
13
17
  const text_js_1 = require("../typography/text.js");
14
18
  const cimpress_logo_js_1 = require("./cimpress-logo.js");
15
- function AppHeader({ title, titleLink, tools, UNSTABLE_navButton: navButton, UNSAFE_className, UNSAFE_style, ...props }, ref) {
19
+ function AppHeader({ title, titleLink, tools, UNSTABLE_navButton: navButton, UNSTABLE_postTitle: postTitle, UNSTABLE_search: search, UNSAFE_className, UNSAFE_style, ...props }, ref) {
20
+ const isMobile = (0, use_is_mobile_js_1.useIsMobile)();
16
21
  const titleLinkProps = typeof titleLink === 'object' && 'href' in titleLink ? titleLink : { href: titleLink };
17
- return ((0, jsx_runtime_1.jsx)("div", { className: "cim-app-header-container", children: (0, jsx_runtime_1.jsxs)("header", { ...props, ref: ref, className: (0, clsx_1.default)('cim-app-header', UNSAFE_className), style: UNSAFE_style, children: [navButton, (0, jsx_runtime_1.jsxs)("div", { className: "cim-app-header-title", children: [(0, jsx_runtime_1.jsx)(cimpress_logo_js_1.CimpressLogo, { height: 18 }), (0, jsx_runtime_1.jsx)(divider_js_1.Divider, { orientation: "vertical" }), (0, jsx_runtime_1.jsx)(text_js_1.Text, { as: "h1", variant: "title-5", tone: "base", children: (0, jsx_runtime_1.jsx)(link_js_1.Link, { ...titleLinkProps, UNSAFE_className: "cim-app-header-title-link", children: title }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "cim-app-header-tools", children: tools })] }) }));
22
+ return ((0, jsx_runtime_1.jsxs)("header", { ...props, ref: ref, className: (0, clsx_1.default)('cim-app-header', UNSAFE_className), style: UNSAFE_style, children: [(0, jsx_runtime_1.jsxs)("div", { className: "cim-app-header-title", children: [navButton, (0, jsx_runtime_1.jsx)(cimpress_logo_js_1.CimpressLogo, { height: 24 }), (0, jsx_runtime_1.jsx)(divider_js_1.Divider, { orientation: "vertical" }), (0, jsx_runtime_1.jsx)(text_js_1.Text, { as: "h1", variant: "title-5", tone: "base", children: (0, jsx_runtime_1.jsx)(link_js_1.Link, { ...titleLinkProps, UNSAFE_className: "cim-app-header-title-link", children: title }) }), postTitle] }), search && (0, jsx_runtime_1.jsx)("div", { className: "cim-app-header-search", children: search }), (0, jsx_runtime_1.jsx)("div", { className: "cim-app-header-tools", children: isMobile ? ((0, jsx_runtime_1.jsxs)(popover_js_1.PopoverRoot, { children: [(0, jsx_runtime_1.jsx)(icon_button_js_1.IconButton, { icon: (0, jsx_runtime_1.jsx)(index_js_1.IconMenuMoreVertical, {}), "aria-label": "Expand/collapse header", variant: "tertiary", size: "small" }), (0, jsx_runtime_1.jsx)(popover_js_1.Popover, { "aria-label": "Expanded header", placement: "bottom end", children: (0, jsx_runtime_1.jsx)("div", { className: "cim-app-header-tools-collapsed", children: tools }) })] })) : (tools) })] }));
18
23
  }
19
24
  /**
20
25
  * Displays a basic application header.
@@ -1 +1 @@
1
- {"version":3,"file":"app-header.js","sourceRoot":"","sources":["../../../../src/components/app-header/app-header.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAEb,gDAAwB;AAExB,yDAAkD;AAClD,sDAAgD;AAEhD,mDAA6C;AAC7C,mDAA6C;AAC7C,yDAAkD;AAclD,SAAS,SAAS,CAChB,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,KAAK,EAAkB,EACpH,GAAiC;IAEjC,MAAM,cAAc,GAAG,OAAO,SAAS,KAAK,QAAQ,IAAI,MAAM,IAAI,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAE9G,OAAO,CACL,gCAAK,SAAS,EAAC,0BAA0B,YACvC,uCAAY,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAA,cAAI,EAAC,gBAAgB,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,aAClG,SAAS,EACV,iCAAK,SAAS,EAAC,sBAAsB,aACnC,uBAAC,+BAAY,IAAC,MAAM,EAAE,EAAE,GAAI,EAC5B,uBAAC,oBAAO,IAAC,WAAW,EAAC,UAAU,GAAG,EAClC,uBAAC,cAAI,IAAC,EAAE,EAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,IAAI,EAAC,MAAM,YACzC,uBAAC,cAAI,OAAK,cAAc,EAAE,gBAAgB,EAAC,2BAA2B,YACnE,KAAK,GACD,GACF,IACH,EAEN,gCAAK,SAAS,EAAC,sBAAsB,YAAE,KAAK,GAAO,IAC5C,GACL,CACP,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,GAAG,IAAA,2BAAU,EAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AAE/B,+BAAS","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef, ReactNode } from 'react';\nimport { forwardRef } from '../../forward-ref.js';\nimport { Divider } from '../divider/divider.js';\nimport type { CommonProps, Href, NavigationProps, WithRequired } from '../types.js';\nimport { Link } from '../typography/link.js';\nimport { Text } from '../typography/text.js';\nimport { CimpressLogo } from './cimpress-logo.js';\n\nexport interface AppHeaderTitleLinkProps extends WithRequired<NavigationProps, 'href'> {}\n\nexport interface AppHeaderProps extends CommonProps {\n /** The title displayed in the header, usually the application name. Rendered as an `<h1>` element. */\n title: string;\n /** The props of the link that is rendered around the header title. */\n titleLink: Href | AppHeaderTitleLinkProps;\n /** The tools to render at the end of the header. */\n tools?: ReactNode;\n UNSTABLE_navButton?: ReactNode;\n}\n\nfunction AppHeader(\n { title, titleLink, tools, UNSTABLE_navButton: navButton, UNSAFE_className, UNSAFE_style, ...props }: AppHeaderProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const titleLinkProps = typeof titleLink === 'object' && 'href' in titleLink ? titleLink : { href: titleLink };\n\n return (\n <div className=\"cim-app-header-container\">\n <header {...props} ref={ref} className={clsx('cim-app-header', UNSAFE_className)} style={UNSAFE_style}>\n {navButton}\n <div className=\"cim-app-header-title\">\n <CimpressLogo height={18} />\n <Divider orientation=\"vertical\" />\n <Text as=\"h1\" variant=\"title-5\" tone=\"base\">\n <Link {...titleLinkProps} UNSAFE_className=\"cim-app-header-title-link\">\n {title}\n </Link>\n </Text>\n </div>\n\n <div className=\"cim-app-header-tools\">{tools}</div>\n </header>\n </div>\n );\n}\n\n/**\n * Displays a basic application header.\n *\n * See [app header usage guidelines](https://ui.cimpress.io/components/app-header/).\n */\nconst _AppHeader = forwardRef(AppHeader, 'AppHeader');\n\nexport { _AppHeader as AppHeader };\n"]}
1
+ {"version":3,"file":"app-header.js","sourceRoot":"","sources":["../../../../src/components/app-header/app-header.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;AAEb,gDAAwB;AAExB,yDAAkD;AAClD,mDAA4D;AAC5D,mEAA2D;AAC3D,6DAAsD;AACtD,sDAAgD;AAChD,sDAA6D;AAE7D,mDAA6C;AAC7C,mDAA6C;AAC7C,yDAAkD;AAgBlD,SAAS,SAAS,CAChB,EACE,KAAK,EACL,SAAS,EACT,KAAK,EACL,kBAAkB,EAAE,SAAS,EAC7B,kBAAkB,EAAE,SAAS,EAC7B,eAAe,EAAE,MAAM,EACvB,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACO,EACjB,GAAiC;IAEjC,MAAM,QAAQ,GAAG,IAAA,8BAAW,GAAE,CAAC;IAE/B,MAAM,cAAc,GAAG,OAAO,SAAS,KAAK,QAAQ,IAAI,MAAM,IAAI,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAE9G,OAAO,CACL,uCAAY,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAA,cAAI,EAAC,gBAAgB,EAAE,gBAAgB,CAAC,EAAE,KAAK,EAAE,YAAY,aACnG,iCAAK,SAAS,EAAC,sBAAsB,aAClC,SAAS,EACV,uBAAC,+BAAY,IAAC,MAAM,EAAE,EAAE,GAAI,EAC5B,uBAAC,oBAAO,IAAC,WAAW,EAAC,UAAU,GAAG,EAClC,uBAAC,cAAI,IAAC,EAAE,EAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,IAAI,EAAC,MAAM,YACzC,uBAAC,cAAI,OAAK,cAAc,EAAE,gBAAgB,EAAC,2BAA2B,YACnE,KAAK,GACD,GACF,EAEN,SAAS,IACN,EAEL,MAAM,IAAI,gCAAK,SAAS,EAAC,uBAAuB,YAAE,MAAM,GAAO,EAEhE,gCAAK,SAAS,EAAC,sBAAsB,YAClC,QAAQ,CAAC,CAAC,CAAC,CACV,wBAAC,wBAAW,eACV,uBAAC,2BAAU,IACT,IAAI,EAAE,uBAAC,+BAAoB,KAAG,gBAEnB,wBAAwB,EACnC,OAAO,EAAC,UAAU,EAClB,IAAI,EAAC,OAAO,GACZ,EACF,uBAAC,oBAAO,kBAAY,iBAAiB,EAAC,SAAS,EAAC,YAAY,YAC1D,gCAAK,SAAS,EAAC,gCAAgC,YAAE,KAAK,GAAO,GACrD,IACE,CACf,CAAC,CAAC,CAAC,CACF,KAAK,CACN,GACG,IACC,CACV,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,GAAG,IAAA,2BAAU,EAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AAE/B,+BAAS","sourcesContent":["'use client';\n\nimport clsx from 'clsx';\nimport type { ForwardedRef, ReactNode } from 'react';\nimport { forwardRef } from '../../forward-ref.js';\nimport { IconMenuMoreVertical } from '../../icons/index.js';\nimport { useIsMobile } from '../../utils/use-is-mobile.js';\nimport { IconButton } from '../button/icon-button.js';\nimport { Divider } from '../divider/divider.js';\nimport { Popover, PopoverRoot } from '../popover/popover.js';\nimport type { CommonProps, Href, NavigationProps, WithRequired } from '../types.js';\nimport { Link } from '../typography/link.js';\nimport { Text } from '../typography/text.js';\nimport { CimpressLogo } from './cimpress-logo.js';\n\nexport interface AppHeaderTitleLinkProps extends WithRequired<NavigationProps, 'href'> {}\n\nexport interface AppHeaderProps extends CommonProps {\n /** The title displayed in the header, usually the application name. Rendered as an `<h1>` element. */\n title: string;\n /** The props of the link that is rendered around the header title. */\n titleLink: Href | AppHeaderTitleLinkProps;\n /** The tools to render at the end of the header. */\n tools?: ReactNode;\n UNSTABLE_navButton?: ReactNode;\n UNSTABLE_postTitle?: ReactNode;\n UNSTABLE_search?: ReactNode;\n}\n\nfunction AppHeader(\n {\n title,\n titleLink,\n tools,\n UNSTABLE_navButton: navButton,\n UNSTABLE_postTitle: postTitle,\n UNSTABLE_search: search,\n UNSAFE_className,\n UNSAFE_style,\n ...props\n }: AppHeaderProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const isMobile = useIsMobile();\n\n const titleLinkProps = typeof titleLink === 'object' && 'href' in titleLink ? titleLink : { href: titleLink };\n\n return (\n <header {...props} ref={ref} className={clsx('cim-app-header', UNSAFE_className)} style={UNSAFE_style}>\n <div className=\"cim-app-header-title\">\n {navButton}\n <CimpressLogo height={24} />\n <Divider orientation=\"vertical\" />\n <Text as=\"h1\" variant=\"title-5\" tone=\"base\">\n <Link {...titleLinkProps} UNSAFE_className=\"cim-app-header-title-link\">\n {title}\n </Link>\n </Text>\n\n {postTitle}\n </div>\n\n {search && <div className=\"cim-app-header-search\">{search}</div>}\n\n <div className=\"cim-app-header-tools\">\n {isMobile ? (\n <PopoverRoot>\n <IconButton\n icon={<IconMenuMoreVertical />}\n // TODO: i18n\n aria-label=\"Expand/collapse header\"\n variant=\"tertiary\"\n size=\"small\"\n />\n <Popover aria-label=\"Expanded header\" placement=\"bottom end\">\n <div className=\"cim-app-header-tools-collapsed\">{tools}</div>\n </Popover>\n </PopoverRoot>\n ) : (\n tools\n )}\n </div>\n </header>\n );\n}\n\n/**\n * Displays a basic application header.\n *\n * See [app header usage guidelines](https://ui.cimpress.io/components/app-header/).\n */\nconst _AppHeader = forwardRef(AppHeader, 'AppHeader');\n\nexport { _AppHeader as AppHeader };\n"]}
@@ -4,6 +4,6 @@ exports.CimpressLogo = CimpressLogo;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  /** @internal */
6
6
  function CimpressLogo({ width, height }) {
7
- return ((0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 100 16", fill: "none", width: width, height: height, children: [(0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.82445 7.32716C7.82445 7.32716 7.1549 7.99671 7.82445 8.66552L9.65352 10.4946C9.65352 10.4946 10.3231 11.1641 10.9919 10.4946L12.8188 8.6677C12.8188 8.6677 13.4883 7.99816 12.8188 7.32862L10.9904 5.50027C10.9904 5.50027 10.3209 4.83073 9.65133 5.50027L7.82445 7.32716Z", fill: "#F0563A" }), (0, jsx_runtime_1.jsx)("mask", { id: "mask0_246_126", style: { maskType: 'alpha' }, maskUnits: "userSpaceOnUse", x: "0", y: "2", width: "8", height: "12", children: (0, jsx_runtime_1.jsx)("path", { d: "M0 2.5517V13.4427H7.41408V2.5517H0H0Z", fill: "white" }) }), (0, jsx_runtime_1.jsx)("g", { mask: "url(#mask0_246_126)", children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.1165 10.8122L4.29439 7.99012L7.10197 5.18254C7.10197 5.18254 7.77151 4.513 7.10197 3.84345L6.10746 2.84895C6.10746 2.84895 5.43792 2.18013 4.7691 2.84895L0.297476 7.32057C0.297476 7.32057 -0.372068 7.99012 0.297476 8.65966L1.29198 9.65416C1.29198 9.65416 1.29416 9.65562 1.29707 9.65925L4.78364 13.1451C4.78364 13.1451 5.45246 13.8146 6.122 13.1451L7.1165 12.1506C7.1165 12.1506 7.78605 11.4818 7.1165 10.8122Z", fill: "#3A414C" }) }), (0, jsx_runtime_1.jsx)("mask", { id: "mask1_246_126", style: { maskType: 'alpha' }, maskUnits: "userSpaceOnUse", x: "10", y: "0", width: "11", height: "16", children: (0, jsx_runtime_1.jsx)("path", { d: "M20.6549 0H10.6956V15.99H20.6549V0V0Z", fill: "white" }) }), (0, jsx_runtime_1.jsx)("g", { mask: "url(#mask1_246_126)", children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M20.3573 7.32819L19.365 6.33514L13.3267 0.296886C13.3267 0.296886 12.6572 -0.371931 11.9876 0.296886L10.9931 1.29212C10.9931 1.29212 10.3236 1.96093 10.9931 2.63048L16.3604 7.99773L10.9982 13.3592C10.9982 13.3592 10.3287 14.0287 10.9982 14.6983L11.9927 15.6928C11.9927 15.6928 12.6615 16.3616 13.3311 15.6928L20.3573 8.66655C20.3573 8.66655 21.0268 7.99774 20.3573 7.32819Z", fill: "#3A414C" }) }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M23.3056 8.02943V7.99162C23.3056 5.12225 25.4996 2.75958 28.5754 2.75958C30.1508 2.75958 31.2383 3.20958 32.1012 3.95982C32.2699 4.10958 32.3448 4.27823 32.3448 4.44689C32.3448 4.61628 32.2699 4.78494 32.1202 4.95359L31.3328 5.79761C31.1634 5.96627 30.9948 6.06005 30.8261 6.06005C30.6764 6.06005 30.507 5.98517 30.3194 5.83542C29.8324 5.44139 29.3068 5.21603 28.5565 5.21603C27.1316 5.21603 26.119 6.47297 26.119 7.95455V7.99162C26.119 9.5299 27.1127 10.7672 28.6692 10.7672C29.3824 10.7672 29.9261 10.5426 30.451 10.1486C30.6197 10.017 30.7883 9.9421 30.9577 9.9421C31.1264 9.9421 31.295 10.017 31.4637 10.1864L32.158 10.8799C32.3448 11.0675 32.4204 11.255 32.4204 11.4237C32.4204 11.5364 32.3826 11.6679 32.2699 11.7799C31.3699 12.6428 30.3013 13.2244 28.5383 13.2244C25.5185 13.2244 23.3056 10.8988 23.3056 8.02943Z", fill: "#3A414C" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M32.9921 3.6594C32.9921 3.1905 33.2356 2.94696 33.7045 2.94696H35.1301C35.599 2.94696 35.8425 3.1905 35.8425 3.6594V12.2864C35.8425 12.7553 35.599 12.9996 35.1301 12.9996H33.7045C33.2356 12.9996 32.9921 12.7553 32.9921 12.2864V3.6594Z", fill: "#3A414C" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M36.8636 3.65936C36.8636 3.19047 37.1079 2.94693 37.576 2.94693H39.0016C39.4705 2.94693 39.7141 3.19047 39.7141 3.65936V4.37253C40.3705 3.52851 41.2334 2.75937 42.6772 2.75937C43.9901 2.75937 44.9846 3.34095 45.5095 4.35363C46.3906 3.32205 47.4411 2.75937 48.81 2.75937C50.9291 2.75937 52.2049 4.03448 52.2049 6.45386V12.2864C52.2049 12.7553 51.9607 12.9995 51.4918 12.9995H50.0669C49.598 12.9995 49.3537 12.7553 49.3537 12.2864V7.39166C49.3537 6.04166 48.754 5.3474 47.6846 5.3474C46.616 5.3474 45.9595 6.04166 45.9595 7.39166V12.2864C45.9595 12.7553 45.716 12.9995 45.2471 12.9995H43.8215C43.3526 12.9995 43.109 12.7553 43.109 12.2864V7.39166C43.109 6.04166 42.5085 5.3474 41.4399 5.3474C40.3705 5.3474 39.7141 6.04166 39.7141 7.39166V12.2864C39.7141 12.7553 39.4705 12.9995 39.0016 12.9995H37.576C37.1079 12.9995 36.8636 12.7553 36.8636 12.2864V3.65936Z", fill: "#3A414C" }), (0, jsx_runtime_1.jsx)("mask", { id: "mask2_246_126", style: { maskType: 'alpha' }, maskUnits: "userSpaceOnUse", x: "53", y: "2", width: "11", height: "14", children: (0, jsx_runtime_1.jsx)("path", { d: "M53.2376 16H63.7962V2.75909H53.2376V16Z", fill: "white" }) }), (0, jsx_runtime_1.jsx)("g", { mask: "url(#mask2_246_126)", children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M60.9457 7.99186V7.95406C60.9457 6.28492 59.8203 5.17847 58.4892 5.17847C57.1574 5.17847 56.051 6.28492 56.051 7.95406V7.99186C56.051 9.661 57.1574 10.7675 58.4892 10.7675C59.8203 10.7675 60.9457 9.6799 60.9457 7.99186ZM53.2376 3.65909C53.2376 3.19092 53.4811 2.94665 53.95 2.94665H55.3756C55.8445 2.94665 56.088 3.19092 56.088 3.65909V4.39115C56.7823 3.45336 57.739 2.75909 59.2206 2.75909C61.5644 2.75909 63.7962 4.59761 63.7962 7.95406V7.99186C63.7962 11.349 61.6022 13.1868 59.2206 13.1868C57.7012 13.1868 56.7634 12.4926 56.088 11.6864V15.2871C56.088 15.756 55.8445 16.0002 55.3756 16.0002H53.95C53.4811 16.0002 53.2376 15.756 53.2376 15.2871V3.65909Z", fill: "#3A414C" }) }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M64.36 3.65937C64.36 3.19047 64.5854 2.94694 65.0725 2.94694H66.4792C66.9481 2.94694 67.2105 3.19047 67.2105 3.65937V4.40961C67.5107 3.65937 68.4296 2.98401 69.6866 2.79718C70.1547 2.72157 70.399 3.02181 70.399 3.49071V4.87851C70.399 5.59167 70.1366 5.68473 69.6299 5.76033C67.811 6.04167 67.2105 7.59812 67.2105 9.30434V12.3053C67.2105 12.7742 66.9481 13.0177 66.4792 13.0177H65.0725C64.5854 13.0177 64.36 12.7742 64.36 12.3053V3.65937Z", fill: "#3A414C" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M77.1967 7.18541C77.028 5.91029 76.2778 5.04737 75.0775 5.04737C73.8962 5.04737 73.1271 5.89139 72.9017 7.18541H77.1967ZM70.1072 8.02943V7.99162C70.1072 5.12225 72.1522 2.75958 75.0775 2.75958C78.4347 2.75958 79.9723 5.36652 79.9723 8.21699V8.27296C79.9723 8.72296 79.6909 8.96723 79.2409 8.96723H72.9395C73.2208 10.2612 74.1208 10.9366 75.396 10.9366C76.1462 10.9366 76.7278 10.749 77.3283 10.3361C77.5158 10.2045 77.6845 10.1297 77.8531 10.1297C78.0029 10.1297 78.1723 10.2045 78.322 10.3361L78.9225 10.8799C79.1282 11.0486 79.2409 11.2361 79.2409 11.4237C79.2409 11.5553 79.166 11.6868 79.0534 11.7988C78.1534 12.6995 76.9342 13.2244 75.3589 13.2244C72.339 13.2244 70.1072 11.1053 70.1072 8.02943Z", fill: "#3A414C" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M80.243 12.0802C80.0176 11.9304 79.9049 11.724 79.9049 11.5175C79.9049 11.3859 79.9616 11.2362 80.0554 11.0864L80.5054 10.3922C80.6552 10.1486 80.8435 10.0359 81.0681 10.0359C81.199 10.0359 81.3494 10.0919 81.4992 10.1864C82.3999 10.7113 83.2999 10.9926 84.0691 10.9926C84.8942 10.9926 85.2693 10.6924 85.2693 10.2424V10.2046C85.2693 9.66082 84.5001 9.43619 83.5623 9.15485C83.4497 9.11705 83.3188 9.07924 83.1872 9.04217C81.7805 8.62925 80.187 7.97279 80.187 6.02231V5.98524C80.187 3.94098 81.8372 2.79672 83.8626 2.79672C84.9131 2.79672 86.0377 3.09696 87.0133 3.60294C87.2757 3.73452 87.4073 3.92208 87.4073 4.14744C87.4073 4.2783 87.3506 4.42878 87.2757 4.57854L86.8635 5.30988C86.7131 5.57231 86.5255 5.7039 86.3009 5.7039C86.1882 5.7039 86.0377 5.66609 85.8879 5.59122C85.1188 5.2161 84.3875 4.99146 83.8066 4.99146C83.1123 4.99146 82.7561 5.29097 82.7561 5.685V5.7228C82.7561 6.28548 83.7128 6.54791 84.8004 6.92303C86.2071 7.39193 87.8384 8.06657 87.8384 9.90509V9.94216C87.8384 12.174 86.1693 13.1867 83.9934 13.1867C82.775 13.1867 81.4432 12.8304 80.243 12.0802Z", fill: "#3A414C" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M88.2829 12.0802C88.0575 11.9304 87.9456 11.724 87.9456 11.5175C87.9456 11.3859 88.0015 11.2362 88.0953 11.0864L88.5453 10.3922C88.6958 10.1486 88.8834 10.0359 89.108 10.0359C89.2396 10.0359 89.3893 10.0919 89.5398 10.1864C90.4398 10.7113 91.3398 10.9926 92.1089 10.9926C92.9341 10.9926 93.3092 10.6924 93.3092 10.2424V10.2046C93.3092 9.66082 92.54 9.43619 91.6022 9.15485C91.4896 9.11705 91.3587 9.07924 91.2279 9.04217C89.8212 8.62925 88.2269 7.97279 88.2269 6.02231V5.98524C88.2269 3.94098 89.8771 2.79672 91.9025 2.79672C92.953 2.79672 94.0776 3.09696 95.0532 3.60294C95.3156 3.73452 95.4472 3.92208 95.4472 4.14744C95.4472 4.2783 95.3905 4.42878 95.3156 4.57854L94.9034 5.30988C94.753 5.57231 94.5654 5.7039 94.3408 5.7039C94.2281 5.7039 94.0776 5.66609 93.9278 5.59122C93.1594 5.2161 92.4274 4.99146 91.8465 4.99146C91.1522 4.99146 90.796 5.29097 90.796 5.685V5.7228C90.796 6.28548 91.7527 6.54791 92.8403 6.92303C94.247 7.39193 95.8783 8.06657 95.8783 9.90509V9.94216C95.8783 12.174 94.2092 13.1867 92.0341 13.1867C90.8149 13.1867 89.4831 12.8304 88.2829 12.0802Z", fill: "#3A414C" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M96.4204 3.30818H95.8788V2.94687H97.3538V3.30818H96.8122V4.72796H96.4204V3.30818Z", fill: "#3A414C" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M97.6551 2.94687H98.0775L98.5457 3.70002L99.0138 2.94687H99.4362V4.72796H99.0466V3.56552L98.5457 4.32594H98.5355L98.039 3.57279V4.72796H97.6551V2.94687Z", fill: "#3A414C" })] }));
7
+ return ((0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", width: width, height: height, children: [(0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M22.0019 11.5603L20.9782 10.5358L14.7487 4.3063C14.7487 4.3063 14.0579 3.6163 13.3672 4.3063L12.3412 5.33305C12.3412 5.33305 11.6504 6.02305 12.3412 6.7138L17.8784 12.251L12.3464 17.7823C12.3464 17.7823 11.6557 18.4731 12.3464 19.1638L13.3724 20.1898C13.3724 20.1898 14.0624 20.8798 14.7532 20.1898L22.0019 12.941C22.0019 12.941 22.6927 12.2511 22.0019 11.5603Z", fill: "#3A414C" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9.07214 11.5592C9.07214 11.5592 8.38139 12.25 9.07214 12.94L10.9591 14.827C10.9591 14.827 11.6499 15.5177 12.3399 14.827L14.2246 12.9422C14.2246 12.9422 14.9154 12.2515 14.2246 11.5607L12.3384 9.67449C12.3384 9.67449 11.6476 8.98374 10.9569 9.67449L9.07214 11.5592Z", fill: "#F0563A" }), (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.342 15.1547L5.4305 12.2432L8.327 9.34667C8.327 9.34667 9.01775 8.65592 8.327 7.96517L7.301 6.93917C7.301 6.93917 6.61025 6.24917 5.92025 6.93917L1.307 11.5524C1.307 11.5524 0.61625 12.2432 1.307 12.9339L2.333 13.9599C2.333 13.9599 2.33525 13.9614 2.33825 13.9652L5.93525 17.5614C5.93525 17.5614 6.62525 18.2522 7.316 17.5614L8.342 16.5354C8.342 16.5354 9.03275 15.8454 8.342 15.1547Z", fill: "#3A414C" })] }));
8
8
  }
9
9
  //# sourceMappingURL=cimpress-logo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cimpress-logo.js","sourceRoot":"","sources":["../../../../src/components/app-header/cimpress-logo.tsx"],"names":[],"mappings":";;AACA,oCA0HC;;AA3HD,gBAAgB;AAChB,SAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,MAAM,EAAuC;IACjF,OAAO,CACL,iCAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,YAAY,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,aACnG,iCACE,QA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AAC,EAAC,01BAA01B,EAC51B,IAAI,EAAC,SAAS,GACd,EACF,iCACE,EAAE,EAAC,eAAe,EAClB,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAC5B,SAAS,EAAC,gBAAgB,EAC1B,CAAC,EAAC,IAAI,EACN,CAAC,EAAC,GAAG,EACL,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,YAEX,iCAAM,CAAC,EAAC,yCAAyC,EAAC,IAAI,EAAC,OAAO,GAAG,GAC5D,EACP,8BAAG,IAAI,EAAC,qBAAqB,YAC3B,iCACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,kpBAAkpB,EACppB,IAAI,EAAC,SAAS,GACd,GACA,EACJ,iCACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,ubAAub,EACzb,IAAI,EAAC,SAAS,GACd,EACF,iCACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,8rBAA8rB,EAChsB,IAAI,EAAC,SAAS,GACd,EACF,iCACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,kjCAAkjC,EACpjC,IAAI,EAAC,SAAS,GACd,EACF,iCACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,gjCAAgjC,EACljC,IAAI,EAAC,SAAS,GACd,EACF,iCACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,mFAAmF,EACrF,IAAI,EAAC,SAAS,GACd,EACF,iCACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,0JAA0J,EAC5J,IAAI,EAAC,SAAS,GACd,IACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["/** @internal */\nexport function CimpressLogo({ width, height }: { width?: number; height?: number }) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 16\" fill=\"none\" width={width} height={height}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M7.82445 7.32716C7.82445 7.32716 7.1549 7.99671 7.82445 8.66552L9.65352 10.4946C9.65352 10.4946 10.3231 11.1641 10.9919 10.4946L12.8188 8.6677C12.8188 8.6677 13.4883 7.99816 12.8188 7.32862L10.9904 5.50027C10.9904 5.50027 10.3209 4.83073 9.65133 5.50027L7.82445 7.32716Z\"\n fill=\"#F0563A\"\n />\n <mask\n id=\"mask0_246_126\"\n style={{ maskType: 'alpha' }}\n maskUnits=\"userSpaceOnUse\"\n x=\"0\"\n y=\"2\"\n width=\"8\"\n height=\"12\"\n >\n <path d=\"M0 2.5517V13.4427H7.41408V2.5517H0H0Z\" fill=\"white\" />\n </mask>\n <g mask=\"url(#mask0_246_126)\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M7.1165 10.8122L4.29439 7.99012L7.10197 5.18254C7.10197 5.18254 7.77151 4.513 7.10197 3.84345L6.10746 2.84895C6.10746 2.84895 5.43792 2.18013 4.7691 2.84895L0.297476 7.32057C0.297476 7.32057 -0.372068 7.99012 0.297476 8.65966L1.29198 9.65416C1.29198 9.65416 1.29416 9.65562 1.29707 9.65925L4.78364 13.1451C4.78364 13.1451 5.45246 13.8146 6.122 13.1451L7.1165 12.1506C7.1165 12.1506 7.78605 11.4818 7.1165 10.8122Z\"\n fill=\"#3A414C\"\n />\n </g>\n <mask\n id=\"mask1_246_126\"\n style={{ maskType: 'alpha' }}\n maskUnits=\"userSpaceOnUse\"\n x=\"10\"\n y=\"0\"\n width=\"11\"\n height=\"16\"\n >\n <path d=\"M20.6549 0H10.6956V15.99H20.6549V0V0Z\" fill=\"white\" />\n </mask>\n <g mask=\"url(#mask1_246_126)\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M20.3573 7.32819L19.365 6.33514L13.3267 0.296886C13.3267 0.296886 12.6572 -0.371931 11.9876 0.296886L10.9931 1.29212C10.9931 1.29212 10.3236 1.96093 10.9931 2.63048L16.3604 7.99773L10.9982 13.3592C10.9982 13.3592 10.3287 14.0287 10.9982 14.6983L11.9927 15.6928C11.9927 15.6928 12.6615 16.3616 13.3311 15.6928L20.3573 8.66655C20.3573 8.66655 21.0268 7.99774 20.3573 7.32819Z\"\n fill=\"#3A414C\"\n />\n </g>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M23.3056 8.02943V7.99162C23.3056 5.12225 25.4996 2.75958 28.5754 2.75958C30.1508 2.75958 31.2383 3.20958 32.1012 3.95982C32.2699 4.10958 32.3448 4.27823 32.3448 4.44689C32.3448 4.61628 32.2699 4.78494 32.1202 4.95359L31.3328 5.79761C31.1634 5.96627 30.9948 6.06005 30.8261 6.06005C30.6764 6.06005 30.507 5.98517 30.3194 5.83542C29.8324 5.44139 29.3068 5.21603 28.5565 5.21603C27.1316 5.21603 26.119 6.47297 26.119 7.95455V7.99162C26.119 9.5299 27.1127 10.7672 28.6692 10.7672C29.3824 10.7672 29.9261 10.5426 30.451 10.1486C30.6197 10.017 30.7883 9.9421 30.9577 9.9421C31.1264 9.9421 31.295 10.017 31.4637 10.1864L32.158 10.8799C32.3448 11.0675 32.4204 11.255 32.4204 11.4237C32.4204 11.5364 32.3826 11.6679 32.2699 11.7799C31.3699 12.6428 30.3013 13.2244 28.5383 13.2244C25.5185 13.2244 23.3056 10.8988 23.3056 8.02943Z\"\n fill=\"#3A414C\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M32.9921 3.6594C32.9921 3.1905 33.2356 2.94696 33.7045 2.94696H35.1301C35.599 2.94696 35.8425 3.1905 35.8425 3.6594V12.2864C35.8425 12.7553 35.599 12.9996 35.1301 12.9996H33.7045C33.2356 12.9996 32.9921 12.7553 32.9921 12.2864V3.6594Z\"\n fill=\"#3A414C\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M36.8636 3.65936C36.8636 3.19047 37.1079 2.94693 37.576 2.94693H39.0016C39.4705 2.94693 39.7141 3.19047 39.7141 3.65936V4.37253C40.3705 3.52851 41.2334 2.75937 42.6772 2.75937C43.9901 2.75937 44.9846 3.34095 45.5095 4.35363C46.3906 3.32205 47.4411 2.75937 48.81 2.75937C50.9291 2.75937 52.2049 4.03448 52.2049 6.45386V12.2864C52.2049 12.7553 51.9607 12.9995 51.4918 12.9995H50.0669C49.598 12.9995 49.3537 12.7553 49.3537 12.2864V7.39166C49.3537 6.04166 48.754 5.3474 47.6846 5.3474C46.616 5.3474 45.9595 6.04166 45.9595 7.39166V12.2864C45.9595 12.7553 45.716 12.9995 45.2471 12.9995H43.8215C43.3526 12.9995 43.109 12.7553 43.109 12.2864V7.39166C43.109 6.04166 42.5085 5.3474 41.4399 5.3474C40.3705 5.3474 39.7141 6.04166 39.7141 7.39166V12.2864C39.7141 12.7553 39.4705 12.9995 39.0016 12.9995H37.576C37.1079 12.9995 36.8636 12.7553 36.8636 12.2864V3.65936Z\"\n fill=\"#3A414C\"\n />\n <mask\n id=\"mask2_246_126\"\n style={{ maskType: 'alpha' }}\n maskUnits=\"userSpaceOnUse\"\n x=\"53\"\n y=\"2\"\n width=\"11\"\n height=\"14\"\n >\n <path d=\"M53.2376 16H63.7962V2.75909H53.2376V16Z\" fill=\"white\" />\n </mask>\n <g mask=\"url(#mask2_246_126)\">\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M60.9457 7.99186V7.95406C60.9457 6.28492 59.8203 5.17847 58.4892 5.17847C57.1574 5.17847 56.051 6.28492 56.051 7.95406V7.99186C56.051 9.661 57.1574 10.7675 58.4892 10.7675C59.8203 10.7675 60.9457 9.6799 60.9457 7.99186ZM53.2376 3.65909C53.2376 3.19092 53.4811 2.94665 53.95 2.94665H55.3756C55.8445 2.94665 56.088 3.19092 56.088 3.65909V4.39115C56.7823 3.45336 57.739 2.75909 59.2206 2.75909C61.5644 2.75909 63.7962 4.59761 63.7962 7.95406V7.99186C63.7962 11.349 61.6022 13.1868 59.2206 13.1868C57.7012 13.1868 56.7634 12.4926 56.088 11.6864V15.2871C56.088 15.756 55.8445 16.0002 55.3756 16.0002H53.95C53.4811 16.0002 53.2376 15.756 53.2376 15.2871V3.65909Z\"\n fill=\"#3A414C\"\n />\n </g>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M64.36 3.65937C64.36 3.19047 64.5854 2.94694 65.0725 2.94694H66.4792C66.9481 2.94694 67.2105 3.19047 67.2105 3.65937V4.40961C67.5107 3.65937 68.4296 2.98401 69.6866 2.79718C70.1547 2.72157 70.399 3.02181 70.399 3.49071V4.87851C70.399 5.59167 70.1366 5.68473 69.6299 5.76033C67.811 6.04167 67.2105 7.59812 67.2105 9.30434V12.3053C67.2105 12.7742 66.9481 13.0177 66.4792 13.0177H65.0725C64.5854 13.0177 64.36 12.7742 64.36 12.3053V3.65937Z\"\n fill=\"#3A414C\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M77.1967 7.18541C77.028 5.91029 76.2778 5.04737 75.0775 5.04737C73.8962 5.04737 73.1271 5.89139 72.9017 7.18541H77.1967ZM70.1072 8.02943V7.99162C70.1072 5.12225 72.1522 2.75958 75.0775 2.75958C78.4347 2.75958 79.9723 5.36652 79.9723 8.21699V8.27296C79.9723 8.72296 79.6909 8.96723 79.2409 8.96723H72.9395C73.2208 10.2612 74.1208 10.9366 75.396 10.9366C76.1462 10.9366 76.7278 10.749 77.3283 10.3361C77.5158 10.2045 77.6845 10.1297 77.8531 10.1297C78.0029 10.1297 78.1723 10.2045 78.322 10.3361L78.9225 10.8799C79.1282 11.0486 79.2409 11.2361 79.2409 11.4237C79.2409 11.5553 79.166 11.6868 79.0534 11.7988C78.1534 12.6995 76.9342 13.2244 75.3589 13.2244C72.339 13.2244 70.1072 11.1053 70.1072 8.02943Z\"\n fill=\"#3A414C\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M80.243 12.0802C80.0176 11.9304 79.9049 11.724 79.9049 11.5175C79.9049 11.3859 79.9616 11.2362 80.0554 11.0864L80.5054 10.3922C80.6552 10.1486 80.8435 10.0359 81.0681 10.0359C81.199 10.0359 81.3494 10.0919 81.4992 10.1864C82.3999 10.7113 83.2999 10.9926 84.0691 10.9926C84.8942 10.9926 85.2693 10.6924 85.2693 10.2424V10.2046C85.2693 9.66082 84.5001 9.43619 83.5623 9.15485C83.4497 9.11705 83.3188 9.07924 83.1872 9.04217C81.7805 8.62925 80.187 7.97279 80.187 6.02231V5.98524C80.187 3.94098 81.8372 2.79672 83.8626 2.79672C84.9131 2.79672 86.0377 3.09696 87.0133 3.60294C87.2757 3.73452 87.4073 3.92208 87.4073 4.14744C87.4073 4.2783 87.3506 4.42878 87.2757 4.57854L86.8635 5.30988C86.7131 5.57231 86.5255 5.7039 86.3009 5.7039C86.1882 5.7039 86.0377 5.66609 85.8879 5.59122C85.1188 5.2161 84.3875 4.99146 83.8066 4.99146C83.1123 4.99146 82.7561 5.29097 82.7561 5.685V5.7228C82.7561 6.28548 83.7128 6.54791 84.8004 6.92303C86.2071 7.39193 87.8384 8.06657 87.8384 9.90509V9.94216C87.8384 12.174 86.1693 13.1867 83.9934 13.1867C82.775 13.1867 81.4432 12.8304 80.243 12.0802Z\"\n fill=\"#3A414C\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M88.2829 12.0802C88.0575 11.9304 87.9456 11.724 87.9456 11.5175C87.9456 11.3859 88.0015 11.2362 88.0953 11.0864L88.5453 10.3922C88.6958 10.1486 88.8834 10.0359 89.108 10.0359C89.2396 10.0359 89.3893 10.0919 89.5398 10.1864C90.4398 10.7113 91.3398 10.9926 92.1089 10.9926C92.9341 10.9926 93.3092 10.6924 93.3092 10.2424V10.2046C93.3092 9.66082 92.54 9.43619 91.6022 9.15485C91.4896 9.11705 91.3587 9.07924 91.2279 9.04217C89.8212 8.62925 88.2269 7.97279 88.2269 6.02231V5.98524C88.2269 3.94098 89.8771 2.79672 91.9025 2.79672C92.953 2.79672 94.0776 3.09696 95.0532 3.60294C95.3156 3.73452 95.4472 3.92208 95.4472 4.14744C95.4472 4.2783 95.3905 4.42878 95.3156 4.57854L94.9034 5.30988C94.753 5.57231 94.5654 5.7039 94.3408 5.7039C94.2281 5.7039 94.0776 5.66609 93.9278 5.59122C93.1594 5.2161 92.4274 4.99146 91.8465 4.99146C91.1522 4.99146 90.796 5.29097 90.796 5.685V5.7228C90.796 6.28548 91.7527 6.54791 92.8403 6.92303C94.247 7.39193 95.8783 8.06657 95.8783 9.90509V9.94216C95.8783 12.174 94.2092 13.1867 92.0341 13.1867C90.8149 13.1867 89.4831 12.8304 88.2829 12.0802Z\"\n fill=\"#3A414C\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M96.4204 3.30818H95.8788V2.94687H97.3538V3.30818H96.8122V4.72796H96.4204V3.30818Z\"\n fill=\"#3A414C\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M97.6551 2.94687H98.0775L98.5457 3.70002L99.0138 2.94687H99.4362V4.72796H99.0466V3.56552L98.5457 4.32594H98.5355L98.039 3.57279V4.72796H97.6551V2.94687Z\"\n fill=\"#3A414C\"\n />\n </svg>\n );\n}\n"]}
1
+ {"version":3,"file":"cimpress-logo.js","sourceRoot":"","sources":["../../../../src/components/app-header/cimpress-logo.tsx"],"names":[],"mappings":";;AACA,oCAuBC;;AAxBD,gBAAgB;AAChB,SAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,MAAM,EAAuC;IACjF,OAAO,CACL,iCAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,aAClG,iCACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,2WAA2W,EAC7W,IAAI,EAAC,SAAS,GACd,EACF,iCACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,4QAA4Q,EAC9Q,IAAI,EAAC,SAAS,GACd,EACF,iCACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,oYAAoY,EACtY,IAAI,EAAC,SAAS,GACd,IACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["/** @internal */\nexport function CimpressLogo({ width, height }: { width?: number; height?: number }) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" width={width} height={height}>\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M22.0019 11.5603L20.9782 10.5358L14.7487 4.3063C14.7487 4.3063 14.0579 3.6163 13.3672 4.3063L12.3412 5.33305C12.3412 5.33305 11.6504 6.02305 12.3412 6.7138L17.8784 12.251L12.3464 17.7823C12.3464 17.7823 11.6557 18.4731 12.3464 19.1638L13.3724 20.1898C13.3724 20.1898 14.0624 20.8798 14.7532 20.1898L22.0019 12.941C22.0019 12.941 22.6927 12.2511 22.0019 11.5603Z\"\n fill=\"#3A414C\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9.07214 11.5592C9.07214 11.5592 8.38139 12.25 9.07214 12.94L10.9591 14.827C10.9591 14.827 11.6499 15.5177 12.3399 14.827L14.2246 12.9422C14.2246 12.9422 14.9154 12.2515 14.2246 11.5607L12.3384 9.67449C12.3384 9.67449 11.6476 8.98374 10.9569 9.67449L9.07214 11.5592Z\"\n fill=\"#F0563A\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M8.342 15.1547L5.4305 12.2432L8.327 9.34667C8.327 9.34667 9.01775 8.65592 8.327 7.96517L7.301 6.93917C7.301 6.93917 6.61025 6.24917 5.92025 6.93917L1.307 11.5524C1.307 11.5524 0.61625 12.2432 1.307 12.9339L2.333 13.9599C2.333 13.9599 2.33525 13.9614 2.33825 13.9652L5.93525 17.5614C5.93525 17.5614 6.62525 18.2522 7.316 17.5614L8.342 16.5354C8.342 16.5354 9.03275 15.8454 8.342 15.1547Z\"\n fill=\"#3A414C\"\n />\n </svg>\n );\n}\n"]}
@@ -3,8 +3,15 @@ import type { AriaLabelingProps, CommonProps, StringLikeChildren } from '../type
3
3
  export interface UNSTABLE_CopyButtonProps extends CommonProps, AriaLabelingProps, Pick<BaseButtonProps, 'size'>, Pick<ActionButtonProps, 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {
4
4
  /** The text displayed on the button. */
5
5
  children?: StringLikeChildren;
6
+ /**
7
+ * Determines the visual appearance of the button.
8
+ * @default 'secondary'
9
+ */
10
+ variant?: 'secondary' | 'tertiary';
6
11
  /** The content to be copied. */
7
12
  value: string;
13
+ /** The help text that appears in a tooltip when the user hovers or focuses the button. */
14
+ helpText?: string;
8
15
  /** A handler that gets called when the user triggers the copying. */
9
16
  onCopy?: () => void;
10
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"copy-button.d.ts","sourceRoot":"","sources":["../../../../src/components/copy/copy-button.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGtF,MAAM,WAAW,wBACf,SAAQ,WAAW,EACjB,iBAAiB,EACjB,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,EAC7B,IAAI,CAAC,iBAAiB,EAAE,YAAY,GAAG,cAAc,GAAG,YAAY,CAAC;IACvE,wCAAwC;IACxC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AA0CD,QAAA,MAAM,oBAAoB,6KAAgE,CAAC;AAE3F,OAAO,EAAE,oBAAoB,IAAI,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"copy-button.d.ts","sourceRoot":"","sources":["../../../../src/components/copy/copy-button.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGtF,MAAM,WAAW,wBACf,SAAQ,WAAW,EACjB,iBAAiB,EACjB,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,EAC7B,IAAI,CAAC,iBAAiB,EAAE,YAAY,GAAG,cAAc,GAAG,YAAY,CAAC;IACvE,wCAAwC;IACxC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC;IACnC,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAyDD,QAAA,MAAM,oBAAoB,6KAAgE,CAAC;AAE3F,OAAO,EAAE,oBAAoB,IAAI,mBAAmB,EAAE,CAAC"}
@@ -3,6 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.UNSTABLE_CopyButton = void 0;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const react_1 = require("react");
7
+ const react_aria_components_1 = require("react-aria-components");
6
8
  const forward_ref_js_1 = require("../../forward-ref.js");
7
9
  const index_js_1 = require("../../icons/index.js");
8
10
  const use_production_warning_js_1 = require("../../utils/use-production-warning.js");
@@ -11,23 +13,56 @@ const button_js_1 = require("../button/button.js");
11
13
  const icon_button_js_1 = require("../button/icon-button.js");
12
14
  const tooltip_js_1 = require("../tooltip/tooltip.js");
13
15
  const use_copy_js_1 = require("./use-copy.js");
14
- function UNSTABLE_CopyButton({ UNSAFE_className, UNSAFE_style, children, value, onCopy, ...props }, ref) {
16
+ function UNSTABLE_CopyButton({ onCopy, helpText, ...props }, ref) {
15
17
  const [copyStatus, showCopyFeedback, copyToClipboard] = (0, use_copy_js_1.useCopyToClipboard)();
16
- const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
18
+ const [showCopyFeedbackLabel, setShowCopyFeedbackLabel] = (0, react_1.useState)(showCopyFeedback);
19
+ (0, react_1.useEffect)(() => {
20
+ let labelChangeTimeout;
21
+ if (showCopyFeedback) {
22
+ setShowCopyFeedbackLabel(true);
23
+ }
24
+ else {
25
+ // Wait until the tooltip has animated away before changing the label
26
+ labelChangeTimeout = setTimeout(() => setShowCopyFeedbackLabel(false), 200);
27
+ }
28
+ return () => {
29
+ if (labelChangeTimeout) {
30
+ clearTimeout(labelChangeTimeout);
31
+ }
32
+ };
33
+ }, [showCopyFeedback]);
34
+ const { children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
17
35
  (0, use_production_warning_js_1.useProductionWarning)(() => {
18
36
  if (!children && !ariaLabel && !ariaLabelledBy) {
19
37
  console.warn('CopyButton requires one of children / aria-label / aria-labelledby for accessibility');
20
38
  }
21
39
  }, [children, ariaLabel, ariaLabelledBy]);
22
- const icon = showCopyFeedback ? (0, jsx_runtime_1.jsx)(index_js_1.IconCheckCircle, {}) : (0, jsx_runtime_1.jsx)(index_js_1.IconCopy, {});
23
40
  const onPress = () => {
24
- copyToClipboard(value);
41
+ copyToClipboard(props.value);
25
42
  onCopy?.();
26
43
  };
27
- return ((0, jsx_runtime_1.jsx)(tooltip_js_1.Tooltip, { isOpen: showCopyFeedback, isDisabled: props.isDisabled,
28
- // TODO: i18n
29
- label: copyStatus?.success ? 'Copied to clipboard.' : 'Failed to copy to clipboard.', placement: "top", children: children ? ((0, jsx_runtime_1.jsx)(button_js_1.Button, { ...props, ref: ref, iconEnd: icon, variant: "secondary", tone: "base", onPress: onPress, children: children })) : ((0, jsx_runtime_1.jsx)(icon_button_js_1.IconButton, { ...props, ref: ref, icon: icon, "aria-label": ariaLabel ?? '', onPress: onPress })) }));
44
+ return ((0, jsx_runtime_1.jsx)(tooltip_js_1.Tooltip, { isDisabled: props.isDisabled || (!showCopyFeedback && !helpText), label: showCopyFeedbackLabel
45
+ ? copyStatus?.success
46
+ ? // TODO: i18n
47
+ 'Copied to clipboard.'
48
+ : 'Failed to copy to clipboard.'
49
+ : (helpText ?? ''), placement: "top", children: (0, jsx_runtime_1.jsx)(CopyButtonInner, { ...props, buttonRef: ref, onCopy: onPress, showCopyFeedback: showCopyFeedback }) }));
30
50
  }
31
51
  const _UNSTABLE_CopyButton = (0, with_style_props_js_1.withStyleProps)((0, forward_ref_js_1.forwardRef)(UNSTABLE_CopyButton), 'CopyButton');
32
52
  exports.UNSTABLE_CopyButton = _UNSTABLE_CopyButton;
53
+ // eslint-disable-next-line react-refresh/only-export-components
54
+ function CopyButtonInner({ UNSAFE_className, UNSAFE_style, children, value, onCopy, buttonRef, showCopyFeedback, ...props }) {
55
+ const tooltipTriggerState = (0, react_1.useContext)(react_aria_components_1.TooltipTriggerStateContext);
56
+ const icon = showCopyFeedback ? (0, jsx_runtime_1.jsx)(index_js_1.IconCheckCircle, {}) : (0, jsx_runtime_1.jsx)(index_js_1.IconCopy, {});
57
+ (0, react_1.useEffect)(() => {
58
+ if (showCopyFeedback) {
59
+ tooltipTriggerState?.open(true);
60
+ }
61
+ else {
62
+ tooltipTriggerState?.close(true);
63
+ }
64
+ // eslint-disable-next-line react-hooks/exhaustive-deps
65
+ }, [showCopyFeedback]);
66
+ return children ? ((0, jsx_runtime_1.jsx)(button_js_1.Button, { ...props, ref: buttonRef, iconStart: icon, tone: "base", onPress: onCopy, children: children })) : ((0, jsx_runtime_1.jsx)(icon_button_js_1.IconButton, { ...props, ref: buttonRef, icon: icon, tone: "base", "aria-label": props['aria-label'] ?? '', onPress: onCopy }));
67
+ }
33
68
  //# sourceMappingURL=copy-button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"copy-button.js","sourceRoot":"","sources":["../../../../src/components/copy/copy-button.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;AAGb,yDAAkD;AAClD,mDAAiE;AACjE,qFAA6E;AAC7E,mEAA2D;AAC3D,mDAA6C;AAC7C,6DAAsD;AAEtD,sDAAgD;AAEhD,+CAAmD;AAenD,SAAS,mBAAmB,CAC1B,EAAE,gBAAgB,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,EAA4B,EAC/F,GAAoC;IAEpC,MAAM,CAAC,UAAU,EAAE,gBAAgB,EAAE,eAAe,CAAC,GAAG,IAAA,gCAAkB,GAAE,CAAC;IAE7E,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IAE7E,IAAA,gDAAoB,EAAC,GAAG,EAAE;QACxB,IAAI,CAAC,QAAQ,IAAI,CAAC,SAAS,IAAI,CAAC,cAAc,EAAE,CAAC;YAC/C,OAAO,CAAC,IAAI,CAAC,sFAAsF,CAAC,CAAC;QACvG,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;IAE1C,MAAM,IAAI,GAAG,gBAAgB,CAAC,CAAC,CAAC,uBAAC,0BAAe,KAAG,CAAC,CAAC,CAAC,uBAAC,mBAAQ,KAAG,CAAC;IAEnE,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,eAAe,CAAC,KAAK,CAAC,CAAC;QACvB,MAAM,EAAE,EAAE,CAAC;IACb,CAAC,CAAC;IAEF,OAAO,CACL,uBAAC,oBAAO,IACN,MAAM,EAAE,gBAAgB,EACxB,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,aAAa;QACb,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,8BAA8B,EACpF,SAAS,EAAC,KAAK,YAEd,QAAQ,CAAC,CAAC,CAAC,CACV,uBAAC,kBAAM,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,OAAO,EAAE,OAAO,YACzF,QAAQ,GACF,CACV,CAAC,CAAC,CAAC,CACF,uBAAC,2BAAU,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,gBAAc,SAAS,IAAI,EAAE,EAAE,OAAO,EAAE,OAAO,GAAI,CAC/F,GACO,CACX,CAAC;AACJ,CAAC;AAED,MAAM,oBAAoB,GAAG,IAAA,oCAAc,EAAC,IAAA,2BAAU,EAAC,mBAAmB,CAAC,EAAE,YAAY,CAAC,CAAC;AAE1D,mDAAmB","sourcesContent":["'use client';\n\nimport type { ForwardedRef } from 'react';\nimport { forwardRef } from '../../forward-ref.js';\nimport { IconCheckCircle, IconCopy } from '../../icons/index.js';\nimport { useProductionWarning } from '../../utils/use-production-warning.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { Button } from '../button/button.js';\nimport { IconButton } from '../button/icon-button.js';\nimport type { ActionButtonProps, BaseButtonProps } from '../button/types.js';\nimport { Tooltip } from '../tooltip/tooltip.js';\nimport type { AriaLabelingProps, CommonProps, StringLikeChildren } from '../types.js';\nimport { useCopyToClipboard } from './use-copy.js';\n\nexport interface UNSTABLE_CopyButtonProps\n extends CommonProps,\n AriaLabelingProps,\n Pick<BaseButtonProps, 'size'>,\n Pick<ActionButtonProps, 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {\n /** The text displayed on the button. */\n children?: StringLikeChildren;\n /** The content to be copied. */\n value: string;\n /** A handler that gets called when the user triggers the copying. */\n onCopy?: () => void;\n}\n\nfunction UNSTABLE_CopyButton(\n { UNSAFE_className, UNSAFE_style, children, value, onCopy, ...props }: UNSTABLE_CopyButtonProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) {\n const [copyStatus, showCopyFeedback, copyToClipboard] = useCopyToClipboard();\n\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useProductionWarning(() => {\n if (!children && !ariaLabel && !ariaLabelledBy) {\n console.warn('CopyButton requires one of children / aria-label / aria-labelledby for accessibility');\n }\n }, [children, ariaLabel, ariaLabelledBy]);\n\n const icon = showCopyFeedback ? <IconCheckCircle /> : <IconCopy />;\n\n const onPress = () => {\n copyToClipboard(value);\n onCopy?.();\n };\n\n return (\n <Tooltip\n isOpen={showCopyFeedback}\n isDisabled={props.isDisabled}\n // TODO: i18n\n label={copyStatus?.success ? 'Copied to clipboard.' : 'Failed to copy to clipboard.'}\n placement=\"top\"\n >\n {children ? (\n <Button {...props} ref={ref} iconEnd={icon} variant=\"secondary\" tone=\"base\" onPress={onPress}>\n {children}\n </Button>\n ) : (\n <IconButton {...props} ref={ref} icon={icon} aria-label={ariaLabel ?? ''} onPress={onPress} />\n )}\n </Tooltip>\n );\n}\n\nconst _UNSTABLE_CopyButton = withStyleProps(forwardRef(UNSTABLE_CopyButton), 'CopyButton');\n\nexport { _UNSTABLE_CopyButton as UNSTABLE_CopyButton };\n"]}
1
+ {"version":3,"file":"copy-button.js","sourceRoot":"","sources":["../../../../src/components/copy/copy-button.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;AAEb,iCAA2E;AAC3E,iEAAoG;AACpG,yDAAkD;AAClD,mDAAiE;AACjE,qFAA6E;AAC7E,mEAA2D;AAC3D,mDAA6C;AAC7C,6DAAsD;AAEtD,sDAAgD;AAEhD,+CAAmD;AAsBnD,SAAS,mBAAmB,CAC1B,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,EAA4B,EAC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M,EAAC,OAAO,EAAE,MAAM,YAC5E,QAAQ,GACF,CACV,CAAC,CAAC,CAAC,CACF,uBAAC,2BAAU,OACL,KAAK,EACT,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,IAAI,EACV,IAAI,EAAC,MAAM,gBACC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,EACrC,OAAO,EAAE,MAAM,GACf,CACH,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport { useContext, useEffect, useState, type ForwardedRef } from 'react';\nimport { TooltipTriggerStateContext as RACTooltipTriggerStateContext } from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { IconCheckCircle, IconCopy } from '../../icons/index.js';\nimport { useProductionWarning } from '../../utils/use-production-warning.js';\nimport { withStyleProps } from '../../with-style-props.js';\nimport { Button } from '../button/button.js';\nimport { IconButton } from '../button/icon-button.js';\nimport type { ActionButtonProps, BaseButtonProps } from '../button/types.js';\nimport { Tooltip } from '../tooltip/tooltip.js';\nimport type { AriaLabelingProps, CommonProps, StringLikeChildren } from '../types.js';\nimport { useCopyToClipboard } from './use-copy.js';\n\nexport interface UNSTABLE_CopyButtonProps\n extends CommonProps,\n AriaLabelingProps,\n Pick<BaseButtonProps, 'size'>,\n Pick<ActionButtonProps, 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {\n /** The text displayed on the button. */\n children?: StringLikeChildren;\n /**\n * Determines the visual appearance of the button.\n * @default 'secondary'\n */\n variant?: 'secondary' | 'tertiary';\n /** The content to be copied. */\n value: string;\n /** The help text that appears in a tooltip when the user hovers or focuses the button. */\n helpText?: string;\n /** A handler that gets called when the user triggers the copying. */\n onCopy?: () => void;\n}\n\nfunction UNSTABLE_CopyButton(\n { onCopy, helpText, ...props }: UNSTABLE_CopyButtonProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) {\n const [copyStatus, showCopyFeedback, copyToClipboard] = useCopyToClipboard();\n const [showCopyFeedbackLabel, setShowCopyFeedbackLabel] = useState(showCopyFeedback);\n\n useEffect(() => {\n let labelChangeTimeout: ReturnType<typeof setTimeout> | undefined;\n\n if (showCopyFeedback) {\n setShowCopyFeedbackLabel(true);\n } else {\n // Wait until the tooltip has animated away before changing the label\n labelChangeTimeout = setTimeout(() => setShowCopyFeedbackLabel(false), 200);\n }\n\n return () => {\n if (labelChangeTimeout) {\n clearTimeout(labelChangeTimeout);\n }\n };\n }, [showCopyFeedback]);\n\n const { children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useProductionWarning(() => {\n if (!children && !ariaLabel && !ariaLabelledBy) {\n console.warn('CopyButton requires one of children / aria-label / aria-labelledby for accessibility');\n }\n }, [children, ariaLabel, ariaLabelledBy]);\n\n const onPress = () => {\n copyToClipboard(props.value);\n onCopy?.();\n };\n\n return (\n <Tooltip\n isDisabled={props.isDisabled || (!showCopyFeedback && !helpText)}\n label={\n showCopyFeedbackLabel\n ? copyStatus?.success\n ? // TODO: i18n\n 'Copied to clipboard.'\n : 'Failed to copy to clipboard.'\n : (helpText ?? '')\n }\n placement=\"top\"\n >\n <CopyButtonInner {...props} buttonRef={ref} onCopy={onPress} showCopyFeedback={showCopyFeedback} />\n </Tooltip>\n );\n}\n\nconst _UNSTABLE_CopyButton = withStyleProps(forwardRef(UNSTABLE_CopyButton), 'CopyButton');\n\nexport { _UNSTABLE_CopyButton as UNSTABLE_CopyButton };\n\n// eslint-disable-next-line react-refresh/only-export-components\nfunction CopyButtonInner({\n UNSAFE_className,\n UNSAFE_style,\n children,\n value,\n onCopy,\n buttonRef,\n showCopyFeedback,\n ...props\n}: Omit<UNSTABLE_CopyButtonProps, 'helpText'> & {\n buttonRef: ForwardedRef<HTMLButtonElement>;\n showCopyFeedback: boolean;\n}) {\n const tooltipTriggerState = useContext(RACTooltipTriggerStateContext);\n\n const icon = showCopyFeedback ? <IconCheckCircle /> : <IconCopy />;\n\n useEffect(() => {\n if (showCopyFeedback) {\n tooltipTriggerState?.open(true);\n } else {\n tooltipTriggerState?.close(true);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [showCopyFeedback]);\n\n return children ? (\n <Button {...props} ref={buttonRef} iconStart={icon} tone=\"base\" onPress={onCopy}>\n {children}\n </Button>\n ) : (\n <IconButton\n {...props}\n ref={buttonRef}\n icon={icon}\n tone=\"base\"\n aria-label={props['aria-label'] ?? ''}\n onPress={onCopy}\n />\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"use-copy.d.ts","sourceRoot":"","sources":["../../../../src/components/copy/use-copy.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,kBAAkB,IAAI;IACpC,UAAU,EAAE,UAAU,GAAG,SAAS;IAClC,gBAAgB,EAAE,OAAO;IACzB,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI;CACxC,CA8BA"}
1
+ {"version":3,"file":"use-copy.d.ts","sourceRoot":"","sources":["../../../../src/components/copy/use-copy.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,kBAAkB,IAAI;IACpC,UAAU,EAAE,UAAU,GAAG,SAAS;IAClC,gBAAgB,EAAE,OAAO;IACzB,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI;CACxC,CA2BA"}
@@ -5,7 +5,11 @@ const react_1 = require("react");
5
5
  function useCopyToClipboard() {
6
6
  const [copyStatus, setCopyStatus] = (0, react_1.useState)(undefined);
7
7
  const [showCopyFeedback, setShowCopyFeedback] = (0, react_1.useState)(false);
8
+ const timeoutRef = (0, react_1.useRef)(undefined);
8
9
  const copyToClipboard = (0, react_1.useCallback)((text) => {
10
+ setCopyStatus(undefined);
11
+ setShowCopyFeedback(false);
12
+ clearTimeout(timeoutRef.current);
9
13
  navigator.clipboard
10
14
  .writeText(text)
11
15
  .then(() => {
@@ -13,18 +17,14 @@ function useCopyToClipboard() {
13
17
  })
14
18
  .catch(() => {
15
19
  setCopyStatus({ success: false, timestamp: Date.now() });
20
+ })
21
+ .finally(() => {
22
+ setShowCopyFeedback(true);
23
+ timeoutRef.current = setTimeout(() => {
24
+ setShowCopyFeedback(false);
25
+ }, 2000);
16
26
  });
17
27
  }, []);
18
- (0, react_1.useEffect)(() => {
19
- if (!copyStatus) {
20
- return;
21
- }
22
- setShowCopyFeedback(true);
23
- const timeout = setTimeout(() => {
24
- setShowCopyFeedback(false);
25
- }, 2000);
26
- return () => clearTimeout(timeout);
27
- }, [copyStatus]);
28
28
  return [copyStatus, showCopyFeedback, copyToClipboard];
29
29
  }
30
30
  //# sourceMappingURL=use-copy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-copy.js","sourceRoot":"","sources":["../../../../src/components/copy/use-copy.ts"],"names":[],"mappings":";;AAOA,gDAkCC;AAzCD,iCAAyD;AAOzD,SAAgB,kBAAkB;IAKhC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAyB,SAAS,CAAC,CAAC;IAChF,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAEhE,MAAM,eAAe,GAAG,IAAA,mBAAW,EAAC,CAAC,IAAY,EAAE,EAAE;QACnD,SAAS,CAAC,SAAS;aAChB,SAAS,CAAC,IAAI,CAAC;aACf,IAAI,CAAC,GAAG,EAAE;YACT,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC1D,CAAC,CAAC;aACD,KAAK,CAAC,GAAG,EAAE;YACV,aAAa,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;IACP,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO;QACT,CAAC;QAED,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAE1B,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;YAC9B,mBAAmB,CAAC,KAAK,CAAC,CAAC;QAC7B,CAAC,EAAE,IAAI,CAAC,CAAC;QAET,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,OAAO,CAAC,UAAU,EAAE,gBAAgB,EAAE,eAAe,CAAC,CAAC;AACzD,CAAC","sourcesContent":["import { useCallback, useEffect, useState } from 'react';\n\nexport interface CopyStatus {\n success: boolean;\n timestamp: number;\n}\n\nexport function useCopyToClipboard(): [\n copyStatus: CopyStatus | undefined,\n showCopyFeedback: boolean,\n copyToClipboard: (text: string) => void,\n] {\n const [copyStatus, setCopyStatus] = useState<CopyStatus | undefined>(undefined);\n const [showCopyFeedback, setShowCopyFeedback] = useState(false);\n\n const copyToClipboard = useCallback((text: string) => {\n navigator.clipboard\n .writeText(text)\n .then(() => {\n setCopyStatus({ success: true, timestamp: Date.now() });\n })\n .catch(() => {\n setCopyStatus({ success: false, timestamp: Date.now() });\n });\n }, []);\n\n useEffect(() => {\n if (!copyStatus) {\n return;\n }\n\n setShowCopyFeedback(true);\n\n const timeout = setTimeout(() => {\n setShowCopyFeedback(false);\n }, 2000);\n\n return () => clearTimeout(timeout);\n }, [copyStatus]);\n\n return [copyStatus, showCopyFeedback, copyToClipboard];\n}\n"]}
1
+ {"version":3,"file":"use-copy.js","sourceRoot":"","sources":["../../../../src/components/copy/use-copy.ts"],"names":[],"mappings":";;AAOA,gDA+BC;AAtCD,iCAAsD;AAOtD,SAAgB,kBAAkB;IAKhC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAyB,SAAS,CAAC,CAAC;IAChF,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAChE,MAAM,UAAU,GAAG,IAAA,cAAM,EAA4C,SAAS,CAAC,CAAC;IAEhF,MAAM,eAAe,GAAG,IAAA,mBAAW,EAAC,CAAC,IAAY,EAAE,EAAE;QACnD,aAAa,CAAC,SAAS,CAAC,CAAC;QACzB,mBAAmB,CAAC,KAAK,CAAC,CAAC;QAC3B,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAEjC,SAAS,CAAC,SAAS;aAChB,SAAS,CAAC,IAAI,CAAC;aACf,IAAI,CAAC,GAAG,EAAE;YACT,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC1D,CAAC,CAAC;aACD,KAAK,CAAC,GAAG,EAAE;YACV,aAAa,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC3D,CAAC,CAAC;aACD,OAAO,CAAC,GAAG,EAAE;YACZ,mBAAmB,CAAC,IAAI,CAAC,CAAC;YAC1B,UAAU,CAAC,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;gBACnC,mBAAmB,CAAC,KAAK,CAAC,CAAC;YAC7B,CAAC,EAAE,IAAI,CAAC,CAAC;QACX,CAAC,CAAC,CAAC;IACP,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CAAC,UAAU,EAAE,gBAAgB,EAAE,eAAe,CAAC,CAAC;AACzD,CAAC","sourcesContent":["import { useCallback, useRef, useState } from 'react';\n\nexport interface CopyStatus {\n success: boolean;\n timestamp: number;\n}\n\nexport function useCopyToClipboard(): [\n copyStatus: CopyStatus | undefined,\n showCopyFeedback: boolean,\n copyToClipboard: (text: string) => void,\n] {\n const [copyStatus, setCopyStatus] = useState<CopyStatus | undefined>(undefined);\n const [showCopyFeedback, setShowCopyFeedback] = useState(false);\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n\n const copyToClipboard = useCallback((text: string) => {\n setCopyStatus(undefined);\n setShowCopyFeedback(false);\n clearTimeout(timeoutRef.current);\n\n navigator.clipboard\n .writeText(text)\n .then(() => {\n setCopyStatus({ success: true, timestamp: Date.now() });\n })\n .catch(() => {\n setCopyStatus({ success: false, timestamp: Date.now() });\n })\n .finally(() => {\n setShowCopyFeedback(true);\n timeoutRef.current = setTimeout(() => {\n setShowCopyFeedback(false);\n }, 2000);\n });\n }, []);\n\n return [copyStatus, showCopyFeedback, copyToClipboard];\n}\n"]}
@@ -24,16 +24,13 @@ function useMultiYearViewState() {
24
24
  calendar: focusedDate.calendar.identifier,
25
25
  timeZone: calendarState.timeZone,
26
26
  });
27
- let startYear = (Math.ceil(focusedDate.year / YEARS_PER_SECTION) - 1) * YEARS_PER_SECTION + 1;
28
- let endYear = startYear + YEARS_PER_SECTION - 1;
27
+ const lowerYear = (Math.ceil(focusedDate.year / YEARS_PER_SECTION) - 1) * YEARS_PER_SECTION + 1;
28
+ const higherYear = lowerYear + YEARS_PER_SECTION - 1;
29
29
  // Years are always represented by positive numbers.
30
30
  // If era implies negative years, flip start and end.
31
31
  const isNegativeEra = focusedDate.era === 'BC';
32
- if (isNegativeEra) {
33
- const temp = startYear;
34
- startYear = endYear;
35
- endYear = temp;
36
- }
32
+ const startYear = isNegativeEra ? higherYear : lowerYear;
33
+ const endYear = isNegativeEra ? lowerYear : higherYear;
37
34
  const data = (0, react_1.useMemo)(() => {
38
35
  const rowCount = Math.ceil(YEARS_PER_SECTION / ITEMS_PER_ROW);
39
36
  const result = new Array(rowCount);
@@ -1 +1 @@
1
- {"version":3,"file":"use-multi-year-view-state.js","sourceRoot":"","sources":["../../../../../../src/components/date-picker/views/multi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W,CAAC,CAAC;QACvC,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { endOfYear, isSameDay, isSameYear, startOfYear, today, type CalendarDate } from '@internationalized/date';\nimport { useContext, useMemo, useState } from 'react';\nimport { useDateFormatter } from 'react-aria';\nimport { CalendarStateContext as RACCalendarStateContext } from 'react-aria-components';\nimport { useLocalizedMessages } from '../../../../i18n/index.js';\nimport { constrainValue, getEraFormat, isDateInvalid } from '../../utils.js';\nimport type { ViewGridCellData, ViewGridState } from '../types.js';\nimport { useDatePickerView } from '../view-provider.js';\n\nconst ITEMS_PER_ROW = 4;\nconst YEARS_PER_SECTION = 20;\nconst YEARS_SKIP_AMOUNT = 100;\n\n/** @internal */\nexport function useMultiYearViewState(): ViewGridState {\n const calendarState = useContext(RACCalendarStateContext)!;\n const { switchToView, focusedDate, setFocusedDate } = useDatePickerView();\n const messages = useLocalizedMessages('datePicker');\n const [isFocused, setIsFocused] = useState(true);\n\n const currentDate = useMemo(() => today(calendarState.timeZone), [calendarState.timeZone]);\n\n const yearFormatter = useDateFormatter({\n year: 'numeric',\n era: getEraFormat(focusedDate),\n calendar: focusedDate.calendar.identifier,\n timeZone: calendarState.timeZone,\n });\n\n let startYear = (Math.ceil(focusedDate.year / YEARS_PER_SECTION) - 1) * YEARS_PER_SECTION + 1;\n let endYear = startYear + YEARS_PER_SECTION - 1;\n\n // Years are always represented by positive numbers.\n // If era implies negative years, flip start and end.\n const isNegativeEra = focusedDate.era === 'BC';\n if (isNegativeEra) {\n const temp = startYear;\n startYear = endYear;\n endYear = temp;\n }\n\n const data: (ViewGridCellData | null)[][] = useMemo(() => {\n const rowCount = Math.ceil(YEARS_PER_SECTION / ITEMS_PER_ROW);\n const result: (ViewGridCellData | null)[][] = new Array(rowCount);\n\n for (let rowIdx = 0; rowIdx < rowCount; rowIdx++) {\n result[rowIdx] = new Array(ITEMS_PER_ROW).fill(null);\n }\n\n for (let yearIdx = 0; yearIdx < YEARS_PER_SECTION; yearIdx++) {\n const rowIdx = Math.floor(yearIdx / ITEMS_PER_ROW);\n const colIdx = yearIdx % ITEMS_PER_ROW;\n\n const yearToSet = startYear + (isNegativeEra ? -yearIdx : yearIdx);\n const date = focusedDate.set({ year: yearToSet });\n\n if (date.year !== yearToSet) {\n // Reached minimum/maximum date\n continue;\n }\n\n const content = yearFormatter.format(date.toDate(calendarState.timeZone));\n\n result[rowIdx]![colIdx] = {\n date,\n content,\n ariaLabel: content,\n isCurrent: isSameYear(date, currentDate),\n };\n }\n\n return result;\n }, [startYear, calendarState.timeZone, focusedDate, yearFormatter, isNegativeEra, currentDate]);\n\n const focusCell = (date: CalendarDate) => {\n setFocusedDate(constrainValue(date, calendarState.minValue, calendarState.maxValue));\n };\n\n return {\n header: yearFormatter.formatRange(\n focusedDate.set({ year: startYear }).toDate(calendarState.timeZone),\n focusedDate.set({ year: endYear }).toDate(calendarState.timeZone),\n ),\n previousLabel: messages.format('previousMultiYearSection', { yearCount: 20 }),\n nextLabel: messages.format('nextMultiYearSection', { yearCount: 20 }),\n data,\n isReadOnly: calendarState.isReadOnly,\n isDisabled: calendarState.isDisabled,\n isFocused,\n setIsFocused,\n focusedDate,\n setFocusedDate,\n timeZone: calendarState.timeZone,\n focusPreviousItem() {\n focusCell(focusedDate.subtract({ years: 1 }));\n },\n focusNextItem() {\n focusCell(focusedDate.add({ years: 1 }));\n },\n focusPreviousRow() {\n focusCell(focusedDate.subtract({ years: ITEMS_PER_ROW }));\n },\n focusNextRow() {\n focusCell(focusedDate.add({ years: ITEMS_PER_ROW }));\n },\n focusSectionStart() {\n focusCell(focusedDate.set({ year: startYear }));\n },\n focusSectionEnd() {\n focusCell(focusedDate.set({ year: endYear }));\n },\n focusPreviousSection(shouldSkip) {\n focusCell(focusedDate.subtract({ years: shouldSkip ? YEARS_SKIP_AMOUNT : YEARS_PER_SECTION }));\n },\n focusNextSection(shouldSkip) {\n focusCell(focusedDate.add({ years: shouldSkip ? YEARS_SKIP_AMOUNT : YEARS_PER_SECTION }));\n },\n isPreviousSectionInvalid() {\n const current = startOfYear(focusedDate.set({ year: startYear }));\n const prev = current.subtract({ days: 1 });\n\n return (\n isDateInvalid(current, calendarState.minValue, calendarState.maxValue) ||\n isDateInvalid(prev, calendarState.minValue, calendarState.maxValue) ||\n isSameDay(prev, current)\n );\n },\n isNextSectionInvalid() {\n const current = endOfYear(focusedDate.set({ year: endYear }));\n const next = current.add({ days: 1 });\n\n return (\n isDateInvalid(current, calendarState.minValue, calendarState.maxValue) ||\n isDateInvalid(next, calendarState.minValue, calendarState.maxValue) ||\n isSameDay(next, current)\n );\n },\n selectFocusedDate() {\n switchToView('year');\n },\n isCellDisabled(date) {\n return (\n isDateInvalid(endOfYear(date), calendarState.minValue, null) ||\n isDateInvalid(startOfYear(date), null, calendarState.maxValue)\n );\n },\n isCellSelected(date) {\n return calendarState.value !== null && isSameYear(date, calendarState.value);\n },\n isCellTabbable(date) {\n return isSameYear(date, focusedDate);\n },\n };\n}\n"]}
1
+ {"version":3,"file":"use-multi-year-view-state.js","sourceRoot":"","sources":["../../../../../../src/components/date-picker/views/multi-year/use-multi-year-view-state.ts"],"names":[],"mappings":";;AAcA,sDAwIC;AAtJD,kDAAkH;AAClH,iCAAsD;AACtD,2CAA8C;AAC9C,iEAAwF;AACxF,wDAAiE;AACjE,6CAA6E;AAE7E,0DAAwD;AAExD,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B,gBAAgB;AAChB,SAAgB,qBAAqB;IACnC,MAAM,aAAa,GAAG,IAAA,kBAAU,EAAC,4CAAuB,CAAE,CAAC;IAC3D,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,IAAA,oCAAiB,GAAE,CAAC;IAC1E,MAAM,QAAQ,GAAG,IAAA,+BAAoB,EAAC,YAAY,CAAC,CAAC;IACpD,MAAM,CAAC,SAAS,EAAE,YAAY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AC;gBACtE,IAAA,wBAAa,EAAC,IAAI,EAAE,aAAa,CAAC,QAAQ,EAAE,aAAa,CAAC,QAAQ,CAAC;gBACnE,IAAA,gBAAS,EAAC,IAAI,EAAE,OAAO,CAAC,CACzB,CAAC;QACJ,CAAC;QACD,iBAAiB;YACf,YAAY,CAAC,MAAM,CAAC,CAAC;QACvB,CAAC;QACD,cAAc,CAAC,IAAI;YACjB,OAAO,CACL,IAAA,wBAAa,EAAC,IAAA,gBAAS,EAAC,IAAI,CAAC,EAAE,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC;gBAC5D,IAAA,wBAAa,EAAC,IAAA,kBAAW,EAAC,IAAI,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,QAAQ,CAAC,CAC/D,CAAC;QACJ,CAAC;QACD,cAAc,CAAC,IAAI;YACjB,OAAO,aAAa,CAAC,KAAK,KAAK,IAAI,IAAI,IAAA,iBAAU,EAAC,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;QAC/E,CAAC;QACD,cAAc,CAAC,IAAI;YACjB,OAAO,IAAA,iBAAU,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACvC,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { endOfYear, isSameDay, isSameYear, startOfYear, today, type CalendarDate } from '@internationalized/date';\nimport { useContext, useMemo, useState } from 'react';\nimport { useDateFormatter } from 'react-aria';\nimport { CalendarStateContext as RACCalendarStateContext } from 'react-aria-components';\nimport { useLocalizedMessages } from '../../../../i18n/index.js';\nimport { constrainValue, getEraFormat, isDateInvalid } from '../../utils.js';\nimport type { ViewGridCellData, ViewGridState } from '../types.js';\nimport { useDatePickerView } from '../view-provider.js';\n\nconst ITEMS_PER_ROW = 4;\nconst YEARS_PER_SECTION = 20;\nconst YEARS_SKIP_AMOUNT = 100;\n\n/** @internal */\nexport function useMultiYearViewState(): ViewGridState {\n const calendarState = useContext(RACCalendarStateContext)!;\n const { switchToView, focusedDate, setFocusedDate } = useDatePickerView();\n const messages = useLocalizedMessages('datePicker');\n const [isFocused, setIsFocused] = useState(true);\n\n const currentDate = useMemo(() => today(calendarState.timeZone), [calendarState.timeZone]);\n\n const yearFormatter = useDateFormatter({\n year: 'numeric',\n era: getEraFormat(focusedDate),\n calendar: focusedDate.calendar.identifier,\n timeZone: calendarState.timeZone,\n });\n\n const lowerYear = (Math.ceil(focusedDate.year / YEARS_PER_SECTION) - 1) * YEARS_PER_SECTION + 1;\n const higherYear = lowerYear + YEARS_PER_SECTION - 1;\n\n // Years are always represented by positive numbers.\n // If era implies negative years, flip start and end.\n const isNegativeEra = focusedDate.era === 'BC';\n const startYear = isNegativeEra ? higherYear : lowerYear;\n const endYear = isNegativeEra ? lowerYear : higherYear;\n\n const data: (ViewGridCellData | null)[][] = useMemo(() => {\n const rowCount = Math.ceil(YEARS_PER_SECTION / ITEMS_PER_ROW);\n const result: (ViewGridCellData | null)[][] = new Array(rowCount);\n\n for (let rowIdx = 0; rowIdx < rowCount; rowIdx++) {\n result[rowIdx] = new Array(ITEMS_PER_ROW).fill(null);\n }\n\n for (let yearIdx = 0; yearIdx < YEARS_PER_SECTION; yearIdx++) {\n const rowIdx = Math.floor(yearIdx / ITEMS_PER_ROW);\n const colIdx = yearIdx % ITEMS_PER_ROW;\n\n const yearToSet = startYear + (isNegativeEra ? -yearIdx : yearIdx);\n const date = focusedDate.set({ year: yearToSet });\n\n if (date.year !== yearToSet) {\n // Reached minimum/maximum date\n continue;\n }\n\n const content = yearFormatter.format(date.toDate(calendarState.timeZone));\n\n result[rowIdx]![colIdx] = {\n date,\n content,\n ariaLabel: content,\n isCurrent: isSameYear(date, currentDate),\n };\n }\n\n return result;\n }, [startYear, calendarState.timeZone, focusedDate, yearFormatter, isNegativeEra, currentDate]);\n\n const focusCell = (date: CalendarDate) => {\n setFocusedDate(constrainValue(date, calendarState.minValue, calendarState.maxValue));\n };\n\n return {\n header: yearFormatter.formatRange(\n focusedDate.set({ year: startYear }).toDate(calendarState.timeZone),\n focusedDate.set({ year: endYear }).toDate(calendarState.timeZone),\n ),\n previousLabel: messages.format('previousMultiYearSection', { yearCount: 20 }),\n nextLabel: messages.format('nextMultiYearSection', { yearCount: 20 }),\n data,\n isReadOnly: calendarState.isReadOnly,\n isDisabled: calendarState.isDisabled,\n isFocused,\n setIsFocused,\n focusedDate,\n setFocusedDate,\n timeZone: calendarState.timeZone,\n focusPreviousItem() {\n focusCell(focusedDate.subtract({ years: 1 }));\n },\n focusNextItem() {\n focusCell(focusedDate.add({ years: 1 }));\n },\n focusPreviousRow() {\n focusCell(focusedDate.subtract({ years: ITEMS_PER_ROW }));\n },\n focusNextRow() {\n focusCell(focusedDate.add({ years: ITEMS_PER_ROW }));\n },\n focusSectionStart() {\n focusCell(focusedDate.set({ year: startYear }));\n },\n focusSectionEnd() {\n focusCell(focusedDate.set({ year: endYear }));\n },\n focusPreviousSection(shouldSkip) {\n focusCell(focusedDate.subtract({ years: shouldSkip ? YEARS_SKIP_AMOUNT : YEARS_PER_SECTION }));\n },\n focusNextSection(shouldSkip) {\n focusCell(focusedDate.add({ years: shouldSkip ? YEARS_SKIP_AMOUNT : YEARS_PER_SECTION }));\n },\n isPreviousSectionInvalid() {\n const current = startOfYear(focusedDate.set({ year: startYear }));\n const prev = current.subtract({ days: 1 });\n\n return (\n isDateInvalid(current, calendarState.minValue, calendarState.maxValue) ||\n isDateInvalid(prev, calendarState.minValue, calendarState.maxValue) ||\n isSameDay(prev, current)\n );\n },\n isNextSectionInvalid() {\n const current = endOfYear(focusedDate.set({ year: endYear }));\n const next = current.add({ days: 1 });\n\n return (\n isDateInvalid(current, calendarState.minValue, calendarState.maxValue) ||\n isDateInvalid(next, calendarState.minValue, calendarState.maxValue) ||\n isSameDay(next, current)\n );\n },\n selectFocusedDate() {\n switchToView('year');\n },\n isCellDisabled(date) {\n return (\n isDateInvalid(endOfYear(date), calendarState.minValue, null) ||\n isDateInvalid(startOfYear(date), null, calendarState.maxValue)\n );\n },\n isCellSelected(date) {\n return calendarState.value !== null && isSameYear(date, calendarState.value);\n },\n isCellTabbable(date) {\n return isSameYear(date, focusedDate);\n },\n };\n}\n"]}
@@ -1,7 +1,13 @@
1
1
  import { type UIEventHandler } from 'react';
2
2
  import { type ListBoxItemProps as RACListBoxItemProps, type SelectProps as RACSelectProps } from 'react-aria-components';
3
3
  import type { ApiProps, AsyncItemLoadingProps, CollectionItem, CollectionProps, CommonProps, FieldProps, Key, StringLikeChildren } from '../types.js';
4
- export interface SelectProps<T extends CollectionItem = CollectionItem> extends CommonProps, FieldProps<Key>, CollectionProps<T>, AsyncItemLoadingProps, ApiProps<SelectApi>, Pick<RACSelectProps<T>, 'isDisabled' | 'isRequired' | 'isInvalid' | 'selectedKey' | 'defaultSelectedKey' | 'autoComplete' | 'autoFocus' | 'onSelectionChange' | 'placeholder' | 'onFocus' | 'onBlur' | 'onOpenChange'> {
4
+ export interface SelectProps<T extends CollectionItem = CollectionItem> extends CommonProps, FieldProps<Key>, CollectionProps<T>, AsyncItemLoadingProps, ApiProps<SelectApi>, Pick<RACSelectProps<T>, 'isDisabled' | 'isRequired' | 'isInvalid' | 'autoComplete' | 'autoFocus' | 'placeholder' | 'onFocus' | 'onBlur' | 'onOpenChange'> {
5
+ /** The currently selected key in the collection (controlled). */
6
+ selectedKey?: Key | null;
7
+ /** The initial selected key in the collection (uncontrolled). */
8
+ defaultSelectedKey?: Key;
9
+ /** Handler that is called when the selection changes. */
10
+ onSelectionChange?: (key: Key | null) => void;
5
11
  /**
6
12
  * Whether the list of options should be virtualized. Use this as a performance optimization for large lists.
7
13
  * @default false
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAqB,KAAK,cAAc,EAA+B,MAAM,OAAO,CAAC;AAC5F,OAAO,EAaL,KAAK,gBAAgB,IAAI,mBAAmB,EAC5C,KAAK,WAAW,IAAI,cAAc,EAEnC,MAAM,uBAAuB,CAA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AAc,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"}
1
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAqB,KAAK,cAAc,EAA+B,MAAM,OAAO,CAAC;AAC5F,OAAO,EAaL,KAAK,gBAAgB,IAAI,mBAAmB,EAC5C,KAAK,WAAW,IAAI,cAAc,EAEnC,MAAM,uBAAuB,CAAC;AAW/B,OAAO,KAAK,EACV,QAAQ,EACR,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,WAAW,EACX,UAAU,EACV,GAAG,EACH,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAWrB,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,CACpE,SAAQ,WAAW,EACjB,UAAU,CAAC,GAAG,CAAC,EACf,eAAe,CAAC,CAAC,CAAC,EAClB,qBAAqB,EACrB,QAAQ,CAAC,SAAS,CAAC,EACnB,IAAI,CACF,cAAc,CAAC,CAAC,CAAC,EACf,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,cAAc,GACd,WAAW,GACX,aAAa,GACb,SAAS,GACT,QAAQ,GACR,cAAc,CACjB;IACH,iEAAiE;IACjE,WAAW,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IACzB,iEAAiE;IACjE,kBAAkB,CAAC,EAAE,GAAG,CAAC;IACzB,yDAAyD;IACzD,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9C;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CAC3C;AAED,4DAA4D;AAC5D,MAAM,WAAW,SAAS;IACxB,8DAA8D;IAC9D,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAqGD;;;;GAIG;AACH,QAAA,MAAM,OAAO,GAxGG,CAAC,SAAS,cAAc,+JAwGoB,CAAC;AAE7D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,CAAC;AAE7B,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,mBAAmB,EAAE,YAAY,GAAG,cAAc,GAAG,YAAY,CAAC;IAC9G,0EAA0E;IAC1E,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,2CAA2C;IAC3C,QAAQ,EAAE,kBAAkB,CAAC;CAC9B;AAED,kDAAkD;AAClD,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,2CAgBjE;yBAhBe,UAAU;;;AAoB1B,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"}
@@ -29,7 +29,7 @@ const VIRTUAL_LAYOUT_OPTIONS = {
29
29
  padding: 0,
30
30
  gap: 0,
31
31
  };
32
- function Select({ children, items, label, description, error, UNSAFE_className, UNSAFE_style, onScroll, isVirtualized = false, apiRef, UNSTABLE_isLoading: isLoading, UNSTABLE_onLoadMore: onLoadMore, ...props }, ref) {
32
+ function Select({ children, items, label, description, error, UNSAFE_className, UNSAFE_style, onScroll, isVirtualized = false, apiRef, UNSTABLE_isLoading: isLoading, UNSTABLE_onLoadMore: onLoadMore, selectedKey, defaultSelectedKey, onSelectionChange, ...props }, ref) {
33
33
  const triggerRef = (0, react_1.useRef)(null);
34
34
  const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;
35
35
  (0, use_production_warning_js_1.useProductionWarning)(() => {
@@ -45,7 +45,7 @@ function Select({ children, items, label, description, error, UNSAFE_className,
45
45
  focus: () => triggerRef.current?.focus(),
46
46
  }), []);
47
47
  const listBox = ((0, jsx_runtime_1.jsxs)(react_aria_components_1.ListBox, { className: "cim-select-listbox", onScroll: onScroll, renderEmptyState: () => isLoading ? (0, jsx_runtime_1.jsx)(spinner_js_1.Spinner, { "aria-label": collectionMessages.format('loading'), size: "small", marginY: 8 }) : null, children: [(0, jsx_runtime_1.jsx)(react_aria_components_1.Collection, { items: items, children: children }), (0, jsx_runtime_1.jsx)(react_aria_components_1.ListBoxLoadMoreItem, { onLoadMore: onLoadMore, isLoading: isLoading, children: (0, jsx_runtime_1.jsx)(spinner_js_1.Spinner, { "aria-label": collectionMessages.format('loadingMore'), size: "small", marginY: 8 }) })] }));
48
- return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.Select, { ...props, ref: ref, className: (0, clsx_1.default)('cim-select', UNSAFE_className), style: UNSAFE_style, children: [(0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldLabel, { isRequired: props.isRequired, isDisabled: props.isDisabled, children: label }), (0, jsx_runtime_1.jsxs)(react_aria_components_1.Button, { ref: triggerRef, className: "cim-select-button", children: [(0, jsx_runtime_1.jsx)(react_aria_components_1.SelectValue, { className: (values) => (0, clsx_1.default)(values.defaultClassName, (0, utils_js_1.textStyle)({ variant: 'body', alignment: 'start' })), children: ({ selectedText }) => selectedText }), (0, jsx_runtime_1.jsx)(index_js_2.IconChevronDown, {})] }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldError, { children: error }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldDescription, { children: description }), (0, jsx_runtime_1.jsx)(collapsible_list_js_1.CollapsibleList, { offset: 5, maxHeight: 315, children: isVirtualized ? ((0, jsx_runtime_1.jsx)(react_aria_components_1.Virtualizer, { layout: react_aria_components_1.ListLayout, layoutOptions: VIRTUAL_LAYOUT_OPTIONS, children: listBox })) : (listBox) })] }));
48
+ return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.Select, { ...props, ref: ref, className: (0, clsx_1.default)('cim-select', UNSAFE_className), style: UNSAFE_style, value: selectedKey, defaultValue: defaultSelectedKey, onChange: onSelectionChange, children: [(0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldLabel, { isRequired: props.isRequired, isDisabled: props.isDisabled, children: label }), (0, jsx_runtime_1.jsxs)(react_aria_components_1.Button, { ref: triggerRef, className: "cim-select-button", children: [(0, jsx_runtime_1.jsx)(react_aria_components_1.SelectValue, { className: (values) => (0, clsx_1.default)(values.defaultClassName, (0, utils_js_1.textStyle)({ variant: 'body', alignment: 'start' })), children: ({ selectedText }) => selectedText }), (0, jsx_runtime_1.jsx)(index_js_2.IconChevronDown, {})] }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldError, { children: error }), (0, jsx_runtime_1.jsx)(form_field_js_1.FormFieldDescription, { children: description }), (0, jsx_runtime_1.jsx)(collapsible_list_js_1.CollapsibleList, { offset: 5, maxHeight: 315, children: isVirtualized ? ((0, jsx_runtime_1.jsx)(react_aria_components_1.Virtualizer, { layout: react_aria_components_1.ListLayout, layoutOptions: VIRTUAL_LAYOUT_OPTIONS, children: listBox })) : (listBox) })] }));
49
49
  }
50
50
  /**
51
51
  * Allows users to select one item from a collapsible list.
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;A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W,GAAG,YAAY,CAAC;AAStC,wDAAwD;AACxD,SAAgB,aAAa,CAA2B,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,EAAyB;IACjH,IAAI,CAAC,IAAA,+BAAY,GAAE,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACvE,OAAO,CAAC,IAAI,CAAC,8EAA8E,CAAC,CAAC;IAC/F,CAAC;IAED,OAAO,CACL,wBAAC,sCAAiB,OAAK,KAAK,EAAE,SAAS,EAAC,oBAAoB,aAC1D,uBAAC,8BAAS,IACR,SAAS,EAAE,IAAA,cAAI,EAAC,2BAA2B,EAAE,IAAA,oBAAS,EAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,YAErG,KAAK,GACI,EACZ,uBAAC,kCAAa,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 { type ForwardedRef, type UIEventHandler, useImperativeHandle, useRef } from 'react';\nimport {\n Button as RACButton,\n Collection as RACCollection,\n Header as RACHeader,\n ListBox as RACListBox,\n ListBoxLoadMoreItem as RACListBoxLoadMoreItem,\n ListBoxItem as RACListBoxItem,\n ListBoxSection as RACListBoxSection,\n ListLayout as RACListLayout,\n type ListLayoutOptions as RACListLayoutOptions,\n Select as RACSelect,\n SelectValue as RACSelectValue,\n Text as RACText,\n type ListBoxItemProps as RACListBoxItemProps,\n type SelectProps as RACSelectProps,\n Virtualizer as RACVirtualizer,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { useLocalizedMessages } from '../../i18n/index.js';\nimport { IconCheck, IconChevronDown } from '../../icons/index.js';\nimport { isProduction } from '../../utils/is-production.js';\nimport { stringLikeChildrenToString } from '../../utils/string-like-children-to-string.js';\nimport { useProductionWarning } from '../../utils/use-production-warning.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 { Spinner } from '../spinner/spinner.js';\nimport type {\n ApiProps,\n AsyncItemLoadingProps,\n CollectionItem,\n CollectionProps,\n CommonProps,\n FieldProps,\n Key,\n StringLikeChildren,\n} from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nconst VIRTUAL_LAYOUT_OPTIONS: RACListLayoutOptions = {\n rowHeight: 40,\n headingHeight: 32,\n loaderHeight: 40,\n padding: 0,\n gap: 0,\n};\n\nexport interface SelectProps<T extends CollectionItem = CollectionItem>\n extends CommonProps,\n FieldProps<Key>,\n CollectionProps<T>,\n AsyncItemLoadingProps,\n ApiProps<SelectApi>,\n Pick<\n RACSelectProps<T>,\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 /**\n * Whether the list of options should be virtualized. Use this as a performance optimization for large lists.\n * @default false\n */\n isVirtualized?: boolean;\n /** Handler that is called when the list of items is scrolled. */\n onScroll?: UIEventHandler<HTMLDivElement>;\n}\n\n/** The imperative API exposed by the `Select` component. */\nexport interface SelectApi {\n /** Focuses the trigger button and opens the list of items. */\n focus: () => void;\n}\n\nfunction Select<T extends CollectionItem>(\n {\n children,\n items,\n label,\n description,\n error,\n UNSAFE_className,\n UNSAFE_style,\n onScroll,\n isVirtualized = false,\n apiRef,\n UNSTABLE_isLoading: isLoading,\n UNSTABLE_onLoadMore: onLoadMore,\n ...props\n }: SelectProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const triggerRef = useRef<HTMLButtonElement>(null);\n\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useProductionWarning(() => {\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 (!isProduction() && items != null && typeof children !== 'function') {\n console.warn('`Select` requires `children` to be a function when using `items` prop');\n }\n\n const collectionMessages = useLocalizedMessages('UNSTABLE_collection');\n\n useImperativeHandle(\n apiRef,\n () => ({\n focus: () => triggerRef.current?.focus(),\n }),\n [],\n );\n\n const listBox = (\n <RACListBox\n className=\"cim-select-listbox\"\n onScroll={onScroll}\n renderEmptyState={() =>\n isLoading ? <Spinner aria-label={collectionMessages.format('loading')} size=\"small\" marginY={8} /> : null\n }\n >\n <RACCollection items={items}>{children}</RACCollection>\n <RACListBoxLoadMoreItem onLoadMore={onLoadMore} isLoading={isLoading}>\n <Spinner aria-label={collectionMessages.format('loadingMore')} size=\"small\" marginY={8} />\n </RACListBoxLoadMoreItem>\n </RACListBox>\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 ref={triggerRef} className=\"cim-select-button\">\n <RACSelectValue\n className={(values) => clsx(values.defaultClassName, textStyle({ variant: 'body', alignment: 'start' }))}\n >\n {({ selectedText }) => selectedText}\n </RACSelectValue>\n <IconChevronDown />\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 {isVirtualized ? (\n <RACVirtualizer layout={RACListLayout} layoutOptions={VIRTUAL_LAYOUT_OPTIONS}>\n {listBox}\n </RACVirtualizer>\n ) : (\n listBox\n )}\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 extends Pick<RACListBoxItemProps, 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {\n /** The ID of the item. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the label. */\n children: StringLikeChildren;\n}\n\n/** Renders a single list item within `Select`. */\nexport function SelectItem({ children, ...props }: SelectItemProps) {\n const textValue = stringLikeChildrenToString(children);\n\n return (\n <RACListBoxItem {...props} className=\"cim-select-item\" textValue={textValue}>\n {({ isDisabled }) => (\n <>\n <IconCheck />\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 (!isProduction() && items != null && typeof children !== 'function') {\n console.warn('`SelectSection` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACListBoxSection {...props} className=\"cim-select-section\">\n <RACHeader\n className={clsx('cim-select-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' }))}\n >\n {title}\n </RACHeader>\n <RACCollection items={items}>{children}</RACCollection>\n </RACListBoxSection>\n );\n}\n\nSelectSection.displayName = 'SelectSection';\n"]}
1
+ {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../../src/components/select/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;AA8Mb,gCAgBC;AAYD,sCAeC;;AAvPD,gDAAwB;AACxB,iCAA4F;AAC5F,iEAgB+B;AAC/B,yDAAkD;AAClD,kDAA2D;AAC3D,mDAAkE;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AAG,YAAY,CAAC;AAStC,wDAAwD;AACxD,SAAgB,aAAa,CAA2B,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,EAAyB;IACjH,IAAI,CAAC,IAAA,+BAAY,GAAE,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACvE,OAAO,CAAC,IAAI,CAAC,8EAA8E,CAAC,CAAC;IAC/F,CAAC;IAED,OAAO,CACL,wBAAC,sCAAiB,OAAK,KAAK,EAAE,SAAS,EAAC,oBAAoB,aAC1D,uBAAC,8BAAS,IACR,SAAS,EAAE,IAAA,cAAI,EAAC,2BAA2B,EAAE,IAAA,oBAAS,EAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,YAErG,KAAK,GACI,EACZ,uBAAC,kCAAa,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 { type ForwardedRef, type UIEventHandler, useImperativeHandle, useRef } from 'react';\nimport {\n Button as RACButton,\n Collection as RACCollection,\n Header as RACHeader,\n ListBox as RACListBox,\n ListBoxLoadMoreItem as RACListBoxLoadMoreItem,\n ListBoxItem as RACListBoxItem,\n ListBoxSection as RACListBoxSection,\n ListLayout as RACListLayout,\n type ListLayoutOptions as RACListLayoutOptions,\n Select as RACSelect,\n SelectValue as RACSelectValue,\n Text as RACText,\n type ListBoxItemProps as RACListBoxItemProps,\n type SelectProps as RACSelectProps,\n Virtualizer as RACVirtualizer,\n} from 'react-aria-components';\nimport { forwardRef } from '../../forward-ref.js';\nimport { useLocalizedMessages } from '../../i18n/index.js';\nimport { IconCheck, IconChevronDown } from '../../icons/index.js';\nimport { isProduction } from '../../utils/is-production.js';\nimport { stringLikeChildrenToString } from '../../utils/string-like-children-to-string.js';\nimport { useProductionWarning } from '../../utils/use-production-warning.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 { Spinner } from '../spinner/spinner.js';\nimport type {\n ApiProps,\n AsyncItemLoadingProps,\n CollectionItem,\n CollectionProps,\n CommonProps,\n FieldProps,\n Key,\n StringLikeChildren,\n} from '../types.js';\nimport { textStyle } from '../typography/utils.js';\n\nconst VIRTUAL_LAYOUT_OPTIONS: RACListLayoutOptions = {\n rowHeight: 40,\n headingHeight: 32,\n loaderHeight: 40,\n padding: 0,\n gap: 0,\n};\n\nexport interface SelectProps<T extends CollectionItem = CollectionItem>\n extends CommonProps,\n FieldProps<Key>,\n CollectionProps<T>,\n AsyncItemLoadingProps,\n ApiProps<SelectApi>,\n Pick<\n RACSelectProps<T>,\n | 'isDisabled'\n | 'isRequired'\n | 'isInvalid'\n | 'autoComplete'\n | 'autoFocus'\n | 'placeholder'\n | 'onFocus'\n | 'onBlur'\n | 'onOpenChange'\n > {\n /** The currently selected key in the collection (controlled). */\n selectedKey?: Key | null;\n /** The initial selected key in the collection (uncontrolled). */\n defaultSelectedKey?: Key;\n /** Handler that is called when the selection changes. */\n onSelectionChange?: (key: Key | null) => void;\n /**\n * Whether the list of options should be virtualized. Use this as a performance optimization for large lists.\n * @default false\n */\n isVirtualized?: boolean;\n /** Handler that is called when the list of items is scrolled. */\n onScroll?: UIEventHandler<HTMLDivElement>;\n}\n\n/** The imperative API exposed by the `Select` component. */\nexport interface SelectApi {\n /** Focuses the trigger button and opens the list of items. */\n focus: () => void;\n}\n\nfunction Select<T extends CollectionItem>(\n {\n children,\n items,\n label,\n description,\n error,\n UNSAFE_className,\n UNSAFE_style,\n onScroll,\n isVirtualized = false,\n apiRef,\n UNSTABLE_isLoading: isLoading,\n UNSTABLE_onLoadMore: onLoadMore,\n selectedKey,\n defaultSelectedKey,\n onSelectionChange,\n ...props\n }: SelectProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const triggerRef = useRef<HTMLButtonElement>(null);\n\n const { 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy } = props;\n\n useProductionWarning(() => {\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 (!isProduction() && items != null && typeof children !== 'function') {\n console.warn('`Select` requires `children` to be a function when using `items` prop');\n }\n\n const collectionMessages = useLocalizedMessages('UNSTABLE_collection');\n\n useImperativeHandle(\n apiRef,\n () => ({\n focus: () => triggerRef.current?.focus(),\n }),\n [],\n );\n\n const listBox = (\n <RACListBox\n className=\"cim-select-listbox\"\n onScroll={onScroll}\n renderEmptyState={() =>\n isLoading ? <Spinner aria-label={collectionMessages.format('loading')} size=\"small\" marginY={8} /> : null\n }\n >\n <RACCollection items={items}>{children}</RACCollection>\n <RACListBoxLoadMoreItem onLoadMore={onLoadMore} isLoading={isLoading}>\n <Spinner aria-label={collectionMessages.format('loadingMore')} size=\"small\" marginY={8} />\n </RACListBoxLoadMoreItem>\n </RACListBox>\n );\n\n return (\n <RACSelect\n {...props}\n ref={ref}\n className={clsx('cim-select', UNSAFE_className)}\n style={UNSAFE_style}\n value={selectedKey}\n defaultValue={defaultSelectedKey}\n onChange={onSelectionChange}\n >\n <FormFieldLabel isRequired={props.isRequired} isDisabled={props.isDisabled}>\n {label}\n </FormFieldLabel>\n <RACButton ref={triggerRef} className=\"cim-select-button\">\n <RACSelectValue\n className={(values) => clsx(values.defaultClassName, textStyle({ variant: 'body', alignment: 'start' }))}\n >\n {({ selectedText }) => selectedText}\n </RACSelectValue>\n <IconChevronDown />\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 {isVirtualized ? (\n <RACVirtualizer layout={RACListLayout} layoutOptions={VIRTUAL_LAYOUT_OPTIONS}>\n {listBox}\n </RACVirtualizer>\n ) : (\n listBox\n )}\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 extends Pick<RACListBoxItemProps, 'isDisabled' | 'onHoverStart' | 'onHoverEnd'> {\n /** The ID of the item. Has to be unique across all sections and items. */\n id?: Key;\n /** The content to display as the label. */\n children: StringLikeChildren;\n}\n\n/** Renders a single list item within `Select`. */\nexport function SelectItem({ children, ...props }: SelectItemProps) {\n const textValue = stringLikeChildrenToString(children);\n\n return (\n <RACListBoxItem {...props} className=\"cim-select-item\" textValue={textValue}>\n {({ isDisabled }) => (\n <>\n <IconCheck />\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 (!isProduction() && items != null && typeof children !== 'function') {\n console.warn('`SelectSection` requires `children` to be a function when using `items` prop');\n }\n\n return (\n <RACListBoxSection {...props} className=\"cim-select-section\">\n <RACHeader\n className={clsx('cim-select-section-header', textStyle({ variant: 'small-semibold', tone: 'subtle' }))}\n >\n {title}\n </RACHeader>\n <RACCollection items={items}>{children}</RACCollection>\n </RACListBoxSection>\n );\n}\n\nSelectSection.displayName = 'SelectSection';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"column-collection.d.ts","sourceRoot":"","sources":["../../../../../src/components/table/contexts/column-collection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAyC,MAAM,OAAO,CAAC;AAQ7G,UAAU,UAAU;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,gBAAgB,EAAE,sBAAsB,CAAC;CAC1C;AAED,2EAA2E;AAC3E,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAMhE,wBAAgB,wBAAwB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAsB7E;AAED,KAAK,iBAAiB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,KAAK,MAAM,IAAI,CAAC;AAGvE,wBAAgB,qBAAqB,IAAI,iBAAiB,CAuBzD;AAGD,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,UAAU,CAAC,GAAG,SAAS,CAO3E;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAGD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,SAAS,CAAC,oBAAoB,GAAG,IAAI,CAAC,GAAG,iBAAiB,CAchG"}
1
+ {"version":3,"file":"column-collection.d.ts","sourceRoot":"","sources":["../../../../../src/components/table/contexts/column-collection.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAyC,MAAM,OAAO,CAAC;AAQ7G,UAAU,UAAU;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,gBAAgB,EAAE,sBAAsB,CAAC;CAC1C;AAED,2EAA2E;AAC3E,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAMhE,wBAAgB,wBAAwB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAsB7E;AAED,KAAK,iBAAiB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,KAAK,MAAM,IAAI,CAAC;AAGvE,wBAAgB,qBAAqB,IAAI,iBAAiB,CAsBzD;AAGD,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,UAAU,CAAC,GAAG,SAAS,CAO3E;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAGD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,SAAS,CAAC,oBAAoB,GAAG,IAAI,CAAC,GAAG,iBAAiB,CAchG"}
@@ -43,7 +43,6 @@ function useColumnRegistration() {
43
43
  const { columns } = columnCollection;
44
44
  if (columns[key] === data) {
45
45
  // This is a temporary deletion before a context update, so this is fine
46
- // eslint-disable-next-line react-hooks/react-compiler
47
46
  delete columns[key];
48
47
  columnCollection.setColumns({ ...columns });
49
48
  }