@persona/design-system 0.4.0 → 0.5.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 (312) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/dist/{Action-CcAyQpYN.d.mts → Action-C2waxwIy.d.mts} +2 -2
  3. package/dist/Action.d.mts +1 -1
  4. package/dist/ArrayValueControl.d.mts +1 -1
  5. package/dist/Attribute.d.mts +3 -3
  6. package/dist/{Badge-BL0J5oMa.mjs → Badge-CM2TzkdE.mjs} +2 -2
  7. package/dist/{Badge-BL0J5oMa.mjs.map → Badge-CM2TzkdE.mjs.map} +1 -1
  8. package/dist/BooleanValueControl.d.mts +1 -1
  9. package/dist/{Breadcrumbs-Zi5p0HDR.mjs → Breadcrumbs-BEYQlGbW.mjs} +7 -7
  10. package/dist/{Breadcrumbs-Zi5p0HDR.mjs.map → Breadcrumbs-BEYQlGbW.mjs.map} +1 -1
  11. package/dist/{Button-BrI1s2-r.d.mts → Button-CRFbWv3l.d.mts} +2 -2
  12. package/dist/Button.d.mts +1 -1
  13. package/dist/CalendarBase.d.mts +1 -1
  14. package/dist/{Card-mZDNFaJy.d.mts → Card-BoGV5tY2.d.mts} +4 -4
  15. package/dist/Card.d.mts +1 -1
  16. package/dist/Card2.d.mts +3 -3
  17. package/dist/{CardV2-CXxzl1EZ.mjs → CardV2-B2wx1NE3.mjs} +9 -9
  18. package/dist/{CardV2-CXxzl1EZ.mjs.map → CardV2-B2wx1NE3.mjs.map} +1 -1
  19. package/dist/{Checkbox-DxNHp59y.mjs → Checkbox-DwZEsi7x.mjs} +5 -5
  20. package/dist/{Checkbox-DxNHp59y.mjs.map → Checkbox-DwZEsi7x.mjs.map} +1 -1
  21. package/dist/ChoicesValueControl.d.mts +1 -1
  22. package/dist/{Combobox-C9QBItsc.d.mts → Combobox-BQN5OwB-.d.mts} +3 -3
  23. package/dist/{Combobox-BUtqtzKl.mjs → Combobox-CKaVX-32.mjs} +9 -9
  24. package/dist/{Combobox-BUtqtzKl.mjs.map → Combobox-CKaVX-32.mjs.map} +1 -1
  25. package/dist/Combobox.d.mts +2 -2
  26. package/dist/{ComboboxBase-BkSpdmsT.d.mts → ComboboxBase-nfHr19x-.d.mts} +6 -6
  27. package/dist/ComboboxBase.d.mts +1 -1
  28. package/dist/{ComboboxMultiSelect-DkVfwSKH.d.mts → ComboboxMultiSelect-DRNj2Mtx.d.mts} +2 -2
  29. package/dist/ComboboxMultiSelect.d.mts +1 -1
  30. package/dist/{ComboboxSingleSelect-CpumBcDn.d.mts → ComboboxSingleSelect-BkhbEx-F.d.mts} +3 -3
  31. package/dist/ComboboxSingleSelect.d.mts +1 -1
  32. package/dist/{CompactBar-COxu_FDd.d.mts → CompactBar-CyHbWTv4.d.mts} +2 -2
  33. package/dist/CompactBar.d.mts +1 -1
  34. package/dist/{ConfigFormGroup-aSdn2r6Z.mjs → ConfigFormGroup-CmCRJyse.mjs} +2 -2
  35. package/dist/{ConfigFormGroup-aSdn2r6Z.mjs.map → ConfigFormGroup-CmCRJyse.mjs.map} +1 -1
  36. package/dist/DataTable.d.mts +6 -7
  37. package/dist/{DatePicker-CLP-ajza.mjs → DatePicker-D2SfjS-N.mjs} +7 -7
  38. package/dist/{DatePicker-CLP-ajza.mjs.map → DatePicker-D2SfjS-N.mjs.map} +1 -1
  39. package/dist/DateRangeValueControl.d.mts +1 -1
  40. package/dist/DateValueControl.d.mts +1 -1
  41. package/dist/{DropdownButton-CCAfNZ9h.mjs → DropdownButton-dpGAmVlN.mjs} +3 -3
  42. package/dist/{DropdownButton-CCAfNZ9h.mjs.map → DropdownButton-dpGAmVlN.mjs.map} +1 -1
  43. package/dist/DropdownButton.d.mts +2 -2
  44. package/dist/{DropdownMenu-CUnf420M.mjs → DropdownMenu-CyxizDxJ.mjs} +2 -2
  45. package/dist/{DropdownMenu-CUnf420M.mjs.map → DropdownMenu-CyxizDxJ.mjs.map} +1 -1
  46. package/dist/{DropdownMenu-BoatixlO.d.mts → DropdownMenu-RTxQ0Zu1.d.mts} +3 -3
  47. package/dist/DropdownMenu.d.mts +1 -1
  48. package/dist/FloatValueControl.d.mts +1 -1
  49. package/dist/{FormControl-0H0Jeind.d.mts → FormControl-BMYRsFkI.d.mts} +2 -2
  50. package/dist/{FormControl-1BmoYFCu.mjs → FormControl-DQFefbrI.mjs} +4 -4
  51. package/dist/{FormControl-1BmoYFCu.mjs.map → FormControl-DQFefbrI.mjs.map} +1 -1
  52. package/dist/FormControl.d.mts +1 -1
  53. package/dist/FormControlLabel.d.mts +2 -2
  54. package/dist/{FormField-BcaFdmo5.d.mts → FormField-C1DaUT5U.d.mts} +6 -7
  55. package/dist/{FormField-oBKH25qf.mjs → FormField-C7bW-O6H.mjs} +19 -20
  56. package/dist/FormField-C7bW-O6H.mjs.map +1 -0
  57. package/dist/FormField.d.mts +1 -1
  58. package/dist/{Header-BjSoTEX_.d.mts → Header-BKk3qESS.d.mts} +2 -2
  59. package/dist/Header.d.mts +1 -1
  60. package/dist/{HelperTooltip-S20wVFCS.d.mts → HelperTooltip-CD_yy7Hp.d.mts} +2 -2
  61. package/dist/HelperTooltip.d.mts +1 -1
  62. package/dist/{HoverCopyableField-GMXeF-3J.mjs → HoverCopyableField-Bgt639FR.mjs} +3 -3
  63. package/dist/{HoverCopyableField-GMXeF-3J.mjs.map → HoverCopyableField-Bgt639FR.mjs.map} +1 -1
  64. package/dist/{IconButton-BpyOr8Ev.d.mts → IconButton-Bh-JJ-0x.d.mts} +2 -2
  65. package/dist/{IconButton-BgL3QUVO.mjs → IconButton-BnSEV7eR.mjs} +5 -5
  66. package/dist/{IconButton-BgL3QUVO.mjs.map → IconButton-BnSEV7eR.mjs.map} +1 -1
  67. package/dist/IconButton.d.mts +1 -1
  68. package/dist/ImageTile.d.mts +1 -1
  69. package/dist/InlineCombobox.d.mts +1 -1
  70. package/dist/InlineInput.d.mts +1 -1
  71. package/dist/{Input-qlQVD5h0.d.mts → Input-1bDdMAgO.d.mts} +3 -3
  72. package/dist/{Input-BWlvBYB3.mjs → Input-D7of_GtJ.mjs} +4 -4
  73. package/dist/{Input-BWlvBYB3.mjs.map → Input-D7of_GtJ.mjs.map} +1 -1
  74. package/dist/Input.d.mts +1 -1
  75. package/dist/{InputProps-D_7MnQfE.d.mts → InputProps-BBShwi8N.d.mts} +1 -1
  76. package/dist/InputProps.d.mts +1 -1
  77. package/dist/IntegerValueControl.d.mts +1 -1
  78. package/dist/{ListBox-ZE3MYMt6.d.mts → ListBox-DeFHRX2T.d.mts} +3 -3
  79. package/dist/{ListBox-9jHHEaqW.mjs → ListBox-jzXQDraS.mjs} +9 -9
  80. package/dist/{ListBox-9jHHEaqW.mjs.map → ListBox-jzXQDraS.mjs.map} +1 -1
  81. package/dist/ListBox.d.mts +1 -1
  82. package/dist/ListBoxField.d.mts +2 -2
  83. package/dist/LoadingShimmer.d.mts +1 -1
  84. package/dist/{LogicRow-CbMmaWXU.d.mts → LogicRow-BOhB0uNS.d.mts} +2 -2
  85. package/dist/LogicRow.d.mts +1 -1
  86. package/dist/MaskedInput.d.mts +2 -2
  87. package/dist/MatchHighlight.d.mts +1 -1
  88. package/dist/{Menu-ZShdhNd7.d.mts → Menu-BCVhmNEe.d.mts} +4 -4
  89. package/dist/{Menu-38UCGcte.mjs → Menu-DVI8l-4Q.mjs} +3 -3
  90. package/dist/{Menu-38UCGcte.mjs.map → Menu-DVI8l-4Q.mjs.map} +1 -1
  91. package/dist/Menu.d.mts +1 -1
  92. package/dist/Modal.d.mts +2 -2
  93. package/dist/{PageHeader-B2-Slzhl.mjs → PageHeader-BpGT-BM0.mjs} +2 -2
  94. package/dist/{PageHeader-B2-Slzhl.mjs.map → PageHeader-BpGT-BM0.mjs.map} +1 -1
  95. package/dist/PageHeader.d.mts +1 -1
  96. package/dist/PageLayout.d.mts +1 -1
  97. package/dist/{PageSelector-BcZx4nqe.d.mts → PageSelector-D6tffcGW.d.mts} +3 -3
  98. package/dist/PageSelector.d.mts +1 -1
  99. package/dist/{Pagination-j4hF7GOk.d.mts → Pagination-BkjmybcI.d.mts} +2 -2
  100. package/dist/{Pagination-CtUz0gdA.mjs → Pagination-CVRTcKSG.mjs} +4 -4
  101. package/dist/{Pagination-CtUz0gdA.mjs.map → Pagination-CVRTcKSG.mjs.map} +1 -1
  102. package/dist/Pagination.d.mts +1 -1
  103. package/dist/{Pii-RwKn-K84.mjs → Pii-CA7aCuYT.mjs} +2 -2
  104. package/dist/{Pii-RwKn-K84.mjs.map → Pii-CA7aCuYT.mjs.map} +1 -1
  105. package/dist/PillShell-CVqpZ5iV.d.mts +85 -0
  106. package/dist/PillShell.d.mts +2 -85
  107. package/dist/{Radio-cLL9oatf.mjs → Radio-DYGEt0FT.mjs} +3 -3
  108. package/dist/{Radio-cLL9oatf.mjs.map → Radio-DYGEt0FT.mjs.map} +1 -1
  109. package/dist/{RadioGroup-BqULCH-D.d.mts → RadioGroup-DYIfRj02.d.mts} +1 -1
  110. package/dist/{RadioGroup-BGo_kXKh.mjs → RadioGroup-pegXtLwD.mjs} +2 -2
  111. package/dist/{RadioGroup-BGo_kXKh.mjs.map → RadioGroup-pegXtLwD.mjs.map} +1 -1
  112. package/dist/RadioGroup.d.mts +1 -1
  113. package/dist/SectionHeading.d.mts +1 -1
  114. package/dist/{SegmentedControl-Db78Pzo_.d.mts → SegmentedControl-DIHonamg.d.mts} +1 -1
  115. package/dist/{SegmentedControl-CvWJGhwy.mjs → SegmentedControl-DwbltwDQ.mjs} +2 -2
  116. package/dist/{SegmentedControl-CvWJGhwy.mjs.map → SegmentedControl-DwbltwDQ.mjs.map} +1 -1
  117. package/dist/SegmentedControl.d.mts +1 -1
  118. package/dist/{Select-U_vQhK1A.mjs → Select-CBVvPyRJ.mjs} +7 -7
  119. package/dist/{Select-U_vQhK1A.mjs.map → Select-CBVvPyRJ.mjs.map} +1 -1
  120. package/dist/{Select-bafAe2wd.d.mts → Select-DwqWnWBi.d.mts} +2 -2
  121. package/dist/Select.d.mts +1 -1
  122. package/dist/{Spinner-BTyc6glU.mjs → Spinner-e725Rxkd.mjs} +2 -2
  123. package/dist/{Spinner-BTyc6glU.mjs.map → Spinner-e725Rxkd.mjs.map} +1 -1
  124. package/dist/{Stack-_JcvIE31.d.mts → Stack-6eOrxjJi.d.mts} +2 -2
  125. package/dist/Stack.d.mts +1 -1
  126. package/dist/{Sticker-CQ6sOKUj.mjs → Sticker-By3F8Aip.mjs} +4 -4
  127. package/dist/{Sticker-CQ6sOKUj.mjs.map → Sticker-By3F8Aip.mjs.map} +1 -1
  128. package/dist/{Sticker-OKVOQt_C.d.mts → Sticker-Ep6N4Exq.d.mts} +4 -4
  129. package/dist/Sticker.d.mts +1 -1
  130. package/dist/StringValueControl.d.mts +1 -1
  131. package/dist/Tab.d.mts +2 -2
  132. package/dist/{TabBar-B5NtgtgC.mjs → TabBar-CWF65Tv4.mjs} +5 -5
  133. package/dist/{TabBar-B5NtgtgC.mjs.map → TabBar-CWF65Tv4.mjs.map} +1 -1
  134. package/dist/TabBarIconButton.d.mts +2 -2
  135. package/dist/{Table-BcAgCIWq.d.mts → Table-BOcWdwpv.d.mts} +1 -1
  136. package/dist/{Table-DfUD3I2s.mjs → Table-nWd5ZVbm.mjs} +6 -6
  137. package/dist/{Table-DfUD3I2s.mjs.map → Table-nWd5ZVbm.mjs.map} +1 -1
  138. package/dist/Table.d.mts +1 -1
  139. package/dist/{TableBody-D-RDBun9.d.mts → TableBody-BFPFaZnD.d.mts} +1 -1
  140. package/dist/TableBody.d.mts +1 -1
  141. package/dist/{TableBox-0GvWjRln.mjs → TableBox-Bd-H5oyh.mjs} +11 -11
  142. package/dist/{TableBox-0GvWjRln.mjs.map → TableBox-Bd-H5oyh.mjs.map} +1 -1
  143. package/dist/TableBox.d.mts +2 -2
  144. package/dist/{TableBoxCell-WXc57DwN.d.mts → TableBoxCell-Cjlc_xJz.d.mts} +7 -7
  145. package/dist/TableBoxCell.d.mts +1 -1
  146. package/dist/TableBoxField.d.mts +3 -3
  147. package/dist/{TableBoxRow-BQz0a9vr.d.mts → TableBoxRow-CKDjNUsU.d.mts} +3 -3
  148. package/dist/TableBoxRow.d.mts +1 -1
  149. package/dist/{TableBoxRowActions-DfewtLrn.d.mts → TableBoxRowActions-BJ8ue3Bk.d.mts} +2 -2
  150. package/dist/TableBoxRowActions.d.mts +1 -1
  151. package/dist/TableCell.d.mts +1 -1
  152. package/dist/{TableControls-WUNbzSNq.mjs → TableControls-BnesnTue.mjs} +17 -17
  153. package/dist/{TableControls-WUNbzSNq.mjs.map → TableControls-BnesnTue.mjs.map} +1 -1
  154. package/dist/{TableControls-C26vGkWZ.d.mts → TableControls-D8xMNgyS.d.mts} +1 -1
  155. package/dist/TableControls.d.mts +1 -1
  156. package/dist/{TableHead-PPaqXC0K.d.mts → TableHead-CWDxuy5V.d.mts} +1 -1
  157. package/dist/TableHead.d.mts +1 -1
  158. package/dist/{TableHeaderCell-K_avn-rR.d.mts → TableHeaderCell-C_sIU1d7.d.mts} +1 -1
  159. package/dist/TableHeaderCell.d.mts +1 -1
  160. package/dist/{TableLayout-_Hd-Tvto.d.mts → TableLayout-CgGhKU_A.d.mts} +1 -1
  161. package/dist/TableLayout.d.mts +1 -1
  162. package/dist/{TableRow-BTWf9xVC.d.mts → TableRow-B1UKlbze.d.mts} +1 -1
  163. package/dist/TableRow.d.mts +1 -1
  164. package/dist/TableTH.d.mts +1 -1
  165. package/dist/{TechnicalSticker-ClRR_6Ly.mjs → TechnicalSticker-Ct2WnNzJ.mjs} +3 -3
  166. package/dist/{TechnicalSticker-ClRR_6Ly.mjs.map → TechnicalSticker-Ct2WnNzJ.mjs.map} +1 -1
  167. package/dist/{Text-CAKHcXSd.d.mts → Text-BzzUdBdc.d.mts} +2 -2
  168. package/dist/Text.d.mts +1 -1
  169. package/dist/{TextArea-NjdArapc.d.mts → TextArea-CGpY5xqX.d.mts} +2 -2
  170. package/dist/{TextArea-n4IKHJKo.mjs → TextArea-CospIXEO.mjs} +2 -2
  171. package/dist/{TextArea-n4IKHJKo.mjs.map → TextArea-CospIXEO.mjs.map} +1 -1
  172. package/dist/TextArea.d.mts +1 -1
  173. package/dist/{TextUnderlineTooltip-Duzxfc_r.d.mts → TextUnderlineTooltip-DZYGjJq1.d.mts} +3 -3
  174. package/dist/TextUnderlineTooltip.d.mts +1 -1
  175. package/dist/Tile.d.mts +1 -1
  176. package/dist/Toast.d.mts +1 -1
  177. package/dist/{Toggle-fh80PA8P.d.mts → Toggle-BjAivdyX.d.mts} +1 -1
  178. package/dist/{Toggle-e8DCYa6i.mjs → Toggle-Do5z1VcO.mjs} +5 -5
  179. package/dist/{Toggle-e8DCYa6i.mjs.map → Toggle-Do5z1VcO.mjs.map} +1 -1
  180. package/dist/Toggle.d.mts +1 -1
  181. package/dist/{Tooltip-iJcfJqxn.mjs → Tooltip-DSKGD33G.mjs} +2 -2
  182. package/dist/{Tooltip-iJcfJqxn.mjs.map → Tooltip-DSKGD33G.mjs.map} +1 -1
  183. package/dist/{Tooltip-DabloV0o.d.mts → Tooltip-n3XkX4dp.d.mts} +3 -3
  184. package/dist/Tooltip.d.mts +1 -1
  185. package/dist/{TruncatedText-B1W4BivL.d.mts → TruncatedText-C-MJPIRi.d.mts} +2 -2
  186. package/dist/components/Attribute/index.mjs +3 -3
  187. package/dist/components/Badge/index.mjs +1 -1
  188. package/dist/components/Banner/index.mjs +2 -2
  189. package/dist/components/BottomPanel/index.mjs +3 -3
  190. package/dist/components/Breadcrumbs/index.mjs +1 -1
  191. package/dist/components/Button/index.d.mts +2 -2
  192. package/dist/components/Button/index.mjs +1 -1
  193. package/dist/components/ButtonGroup/index.mjs +2 -2
  194. package/dist/components/Card/index.d.mts +2 -2
  195. package/dist/components/CardV2/index.d.mts +1 -1
  196. package/dist/components/CardV2/index.mjs +1 -1
  197. package/dist/components/Checkbox/index.mjs +1 -1
  198. package/dist/components/Combobox/index.d.mts +2 -2
  199. package/dist/components/Combobox/index.mjs +1 -1
  200. package/dist/components/ConfigFormGroup/index.mjs +2 -2
  201. package/dist/components/DataTable/TableControls/index.d.mts +10 -9
  202. package/dist/components/DataTable/TableControls/index.mjs +2 -2
  203. package/dist/components/DataTable/index.mjs +16 -23
  204. package/dist/components/DataTable/index.mjs.map +1 -1
  205. package/dist/components/DataTable/types.d.mts +2 -2
  206. package/dist/components/DatePicker/index.mjs +1 -1
  207. package/dist/components/DropdownButton/index.mjs +1 -1
  208. package/dist/components/DropdownMenu/index.d.mts +1 -1
  209. package/dist/components/DropdownMenu/index.mjs +1 -1
  210. package/dist/components/FloatingPanel/index.mjs +3 -3
  211. package/dist/components/FormControl/index.d.mts +2 -2
  212. package/dist/components/FormControl/index.mjs +2 -2
  213. package/dist/components/FormField/index.d.mts +1 -1
  214. package/dist/components/FormField/index.mjs +1 -1
  215. package/dist/components/HoverCopyableField/index.mjs +1 -1
  216. package/dist/components/ImageTile/index.mjs +6 -6
  217. package/dist/components/Input/index.d.mts +1 -1
  218. package/dist/components/Input/index.mjs +1 -1
  219. package/dist/components/Link/index.mjs +2 -2
  220. package/dist/components/ListBox/index.d.mts +3 -3
  221. package/dist/components/ListBox/index.mjs +1 -1
  222. package/dist/components/MaskedInput/index.mjs +1 -1
  223. package/dist/components/Menu/index.d.mts +1 -1
  224. package/dist/components/Menu/index.mjs +1 -1
  225. package/dist/components/Modal/index.mjs +2 -2
  226. package/dist/components/PageHeader/index.mjs +1 -1
  227. package/dist/components/Pagination/index.d.mts +3 -3
  228. package/dist/components/Pagination/index.mjs +1 -1
  229. package/dist/components/Pii/index.mjs +1 -1
  230. package/dist/components/ProgressBar/index.mjs +1 -1
  231. package/dist/components/ProgressIndicator/index.mjs +1 -1
  232. package/dist/components/Radio/index.mjs +1 -1
  233. package/dist/components/RadioGroup/index.d.mts +1 -1
  234. package/dist/components/RadioGroup/index.mjs +1 -1
  235. package/dist/components/RightPanel/index.mjs +1 -1
  236. package/dist/components/SegmentedControl/index.d.mts +1 -1
  237. package/dist/components/SegmentedControl/index.mjs +1 -1
  238. package/dist/components/Select/index.d.mts +1 -1
  239. package/dist/components/Select/index.mjs +1 -1
  240. package/dist/components/Slider/index.mjs +2 -2
  241. package/dist/components/Spinner/index.mjs +1 -1
  242. package/dist/components/Stack/index.d.mts +1 -1
  243. package/dist/components/StatusIndicator/index.mjs +1 -1
  244. package/dist/components/Sticker/index.d.mts +1 -1
  245. package/dist/components/Sticker/index.mjs +1 -1
  246. package/dist/components/TabBar/index.mjs +1 -1
  247. package/dist/components/Table/index.d.mts +7 -7
  248. package/dist/components/Table/index.mjs +1 -1
  249. package/dist/components/TableBox/index.d.mts +2 -2
  250. package/dist/components/TableBox/index.mjs +1 -1
  251. package/dist/components/TechnicalSticker/index.mjs +1 -1
  252. package/dist/components/Text/index.d.mts +1 -1
  253. package/dist/components/TextArea/index.d.mts +1 -1
  254. package/dist/components/TextArea/index.mjs +1 -1
  255. package/dist/components/Tile/index.mjs +2 -2
  256. package/dist/components/Toast/index.mjs +4 -4
  257. package/dist/components/Toggle/index.d.mts +1 -1
  258. package/dist/components/Toggle/index.mjs +1 -1
  259. package/dist/components/Tooltip/index.d.mts +3 -3
  260. package/dist/components/Tooltip/index.mjs +1 -1
  261. package/dist/{constants-DcJ3tnwY.d.mts → constants-Bs94Jw4y.d.mts} +1 -1
  262. package/dist/constants.d.mts +1 -1
  263. package/dist/fieldPickerOptions.d.mts +1 -1
  264. package/dist/{index-Dc_BgmPv.d.mts → index-CvBvfQAY.d.mts} +4 -4
  265. package/dist/{index-Dpo-RP6S.d.mts → index-I_Cy3X5R.d.mts} +3 -3
  266. package/dist/index-ehD5GjMH.d.mts +1 -0
  267. package/dist/index.d.mts +1 -1
  268. package/dist/index4.d.mts +2 -14
  269. package/dist/index5.d.mts +15 -2
  270. package/dist/inputFields.d.mts +9 -9
  271. package/dist/{intersperse-DQAyfeEw.mjs → intersperse-CRUnXmnu.mjs} +1 -1
  272. package/dist/{intersperse-DQAyfeEw.mjs.map → intersperse-CRUnXmnu.mjs.map} +1 -1
  273. package/dist/lib/TruncatedText.d.mts +1 -1
  274. package/dist/lib/TruncatedTextWithTooltip.d.mts +1 -1
  275. package/dist/lib/TruncatedTextWithTooltip.mjs +1 -1
  276. package/dist/lib/message.d.mts +1 -1
  277. package/dist/{message-DaiDXonE.d.mts → message-CyxgAWZl.d.mts} +1 -1
  278. package/dist/mixins/hoverable.mjs +1 -1
  279. package/dist/mixins/input.mjs +1 -1
  280. package/dist/{operators-BsSl7gPE.d.mts → operators-CXkmvFpP.d.mts} +1 -1
  281. package/dist/operators.d.mts +1 -1
  282. package/dist/patterns/LayoutLoadingShimmer/index.mjs +3 -3
  283. package/dist/{types-B5VmRRMR.d.mts → types-DBBfOCX1.d.mts} +1 -1
  284. package/dist/{types-Cg3aXHUh2.d.mts → types-Ds43XULD.d.mts} +1 -1
  285. package/dist/types4.d.mts +1 -1
  286. package/dist/types5.d.mts +1 -1
  287. package/dist/{url-state-ektb0HnB.d.mts → url-state-M64mdtQ2.d.mts} +1 -1
  288. package/dist/url-state.d.mts +1 -1
  289. package/dist/useComboboxFooterAction.d.mts +1 -1
  290. package/dist/{useFilterStateV2-BB14vCC-.d.mts → useFilterStateV2-gALqONXf.d.mts} +1 -1
  291. package/dist/useFilterStateV2.d.mts +1 -1
  292. package/dist/{useFormField-CQo08dR4.d.mts → useFormField-Bo7oHMof.d.mts} +1 -1
  293. package/dist/{useFormField-Bz2iMPBO.mjs → useFormField-C-K1lgmv.mjs} +2 -2
  294. package/dist/{useFormField-Bz2iMPBO.mjs.map → useFormField-C-K1lgmv.mjs.map} +1 -1
  295. package/dist/useFormField.d.mts +1 -1
  296. package/dist/{useFormGroup-CaTiD_Yt.mjs → useFormGroup-y-duFylq.mjs} +1 -1
  297. package/dist/{useFormGroup-CaTiD_Yt.mjs.map → useFormGroup-y-duFylq.mjs.map} +1 -1
  298. package/dist/{useTableBoxDragAndDrop-B-Dev5D6.d.mts → useTableBoxDragAndDrop-BrJFRSaG.d.mts} +1 -1
  299. package/dist/useTableBoxDragAndDrop.d.mts +1 -1
  300. package/dist/useTruncation.d.mts +1 -1
  301. package/dist/{validation-B22QjCrV.d.mts → validation-BCBIvN6H.d.mts} +1 -1
  302. package/dist/validation.d.mts +1 -1
  303. package/package.json +1 -1
  304. package/skills/ui-authoring/SKILL.md +1 -1
  305. package/dist/FormField-oBKH25qf.mjs.map +0 -1
  306. /package/dist/{index-BINnViIh.d.mts → index--p6oQT9I.d.mts} +0 -0
  307. /package/dist/{index-B_BBnMou.d.mts → index-BwAfCVZH2.d.mts} +0 -0
  308. /package/dist/{index-BcsXXrHq.d.mts → index-CCKHlTA4.d.mts} +0 -0
  309. /package/dist/{index-CliqZ9rj.d.mts → index-D13oYj4_.d.mts} +0 -0
  310. /package/dist/{index-DBGd4WeR.d.mts → index-D7UbuJwP.d.mts} +0 -0
  311. /package/dist/{index-DDdPqD_H.d.mts → index-DA6_cwf8.d.mts} +0 -0
  312. /package/dist/{index-DztUdPP_.d.mts → index-Es5nKSSL.d.mts} +0 -0
@@ -1,7 +1,7 @@
1
1
  import { a as styled } from "./styledComponentsInterop-8zScIQyC.mjs";
2
2
  import "./variables/spacing.mjs";
3
3
  import { Z_INDICES } from "./lib/zindex.mjs";
4
- import { a as MenuDivider, i as Menu, o as MenuHeading, s as MenuItem } from "./Menu-38UCGcte.mjs";
4
+ import { a as MenuDivider, i as Menu, o as MenuHeading, s as MenuItem } from "./Menu-DVI8l-4Q.mjs";
5
5
  import { Children, forwardRef } from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import * as Primitive from "@radix-ui/react-dropdown-menu";
@@ -57,4 +57,4 @@ var DropdownMenu_default = Object.assign(DropdownMenu, {
57
57
  //#endregion
58
58
  export { DropdownMenu_default as n, DropdownMenu as t };
59
59
 
60
- //# sourceMappingURL=DropdownMenu-CUnf420M.mjs.map
60
+ //# sourceMappingURL=DropdownMenu-CyxizDxJ.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownMenu-CUnf420M.mjs","names":[],"sources":["../components/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["import * as Primitive from '@radix-ui/react-dropdown-menu';\nimport type { Property } from 'csstype';\nimport {\n Children,\n type ComponentPropsWithoutRef,\n type ComponentPropsWithRef,\n type ElementType,\n type FC,\n forwardRef,\n type FunctionComponentElement,\n type Ref,\n} from 'react';\nimport styled from 'styled-components';\n\nimport Menu, {\n MenuDivider,\n MenuHeading,\n MenuItem,\n type MenuItemProps,\n} from 'design-system/components/Menu/Menu';\nimport { Z_INDICES } from 'design-system/lib/zindex';\nimport { BASE } from 'design-system/variables/spacing';\n\nconst DropdownMenuContent = styled(Primitive.Content)<{ $zIndex?: Property.ZIndex }>`\n z-index: ${({ $zIndex }) => $zIndex || Z_INDICES.tooltip};\n`;\n\nexport interface DropdownMenuProps\n extends Primitive.DropdownMenuProps, Pick<Primitive.DropdownMenuContentProps, 'side' | 'align'> {\n id?: string;\n className?: string;\n\n trigger: FunctionComponentElement<any>;\n\n /**\n * Props passed to internal DropdownMenu.Content component.\n */\n contentProps?: Primitive.DropdownMenuContentProps;\n\n /**\n * Props passed to internal DropdownMenu.Trigger component.\n */\n triggerProps?: Primitive.DropdownMenuTriggerProps;\n\n /**\n * Props passed to internal DropdownMenu.Portal component.\n */\n portalProps?: Primitive.DropdownMenuPortalProps;\n\n /**\n * Whether or not to wrap menu with DropdownMenu.Portal component.\n */\n portal?: boolean;\n\n /**\n * Whether or not clicks render menu items.\n */\n disabled?: boolean;\n\n zIndex?: Property.ZIndex;\n}\n\nexport const DropdownMenu = ({\n trigger,\n children,\n side,\n align = 'end',\n contentProps,\n triggerProps,\n portalProps,\n className,\n portal = false, // Default to false for old behavior\n modal = false,\n disabled = false,\n zIndex,\n ...props\n}: DropdownMenuProps) => {\n if (Children.count(children) === 0) {\n return null;\n }\n\n const content = disabled ? null : (\n <DropdownMenuContent\n sideOffset={BASE}\n collisionPadding={BASE}\n align={align}\n side={side}\n $zIndex={zIndex}\n {...contentProps}\n >\n <Menu className={className} doNotSetRole>\n {children}\n </Menu>\n </DropdownMenuContent>\n );\n\n return (\n <Primitive.Root modal={modal} {...props}>\n <Primitive.Trigger asChild {...triggerProps}>\n {trigger}\n </Primitive.Trigger>\n\n {portal ? <Primitive.Portal {...portalProps}>{content}</Primitive.Portal> : content}\n </Primitive.Root>\n );\n};\n\ninterface DropdownMenuItemProps<T extends ElementType = 'div'>\n extends MenuItemProps<T>, Omit<Primitive.DropdownMenuItemProps, 'asChild' | 'children'> {}\n\ninterface DropdownMenuItemType<T extends ElementType = 'div'> extends FC<\n DropdownMenuItemProps<T> & ComponentPropsWithRef<T>\n> {\n <T extends ElementType = 'div'>(\n props: DropdownMenuItemProps<T> & ComponentPropsWithoutRef<T>,\n ): ReturnType<FC<DropdownMenuItemProps<T> & ComponentPropsWithoutRef<T>>>;\n}\n\n/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\nconst DropdownMenuItem: DropdownMenuItemType = forwardRef(function DropdownMenuItem(\n { children, disabled, ...props },\n ref: Ref<HTMLDivElement>,\n) {\n return (\n <Primitive.Item asChild disabled={disabled} {...props}>\n <MenuItem disabled={disabled} ref={ref}>\n {children}\n </MenuItem>\n </Primitive.Item>\n );\n});\n\nexport default Object.assign(DropdownMenu, {\n Item: DropdownMenuItem,\n Heading: MenuHeading,\n Divider: MenuDivider,\n});\n"],"mappings":";;;;;;;;AAuBA,MAAM,sBAAsB,OAAO,UAAU,QAAQ;cACvC,EAAE,cAAc,WAAW,UAAU,QAAQ;;AAsC3D,MAAa,gBAAgB,EAC3B,SACA,UACA,MACA,QAAQ,OACR,cACA,cACA,aACA,WACA,SAAS,OACT,QAAQ,OACR,WAAW,OACX,QACA,GAAG,YACoB;AACvB,KAAI,SAAS,MAAM,SAAS,KAAK,EAC/B,QAAO;CAGT,MAAM,UAAU,WAAW,OACzB,oBAAC,qBAAD;EACE,YAAA;EACA,kBAAA;EACO;EACD;EACN,SAAS;EACT,GAAI;YAEJ,oBAAC,MAAD;GAAiB;GAAW,cAAA;GACzB;GACI,CAAA;EACa,CAAA;AAGxB,QACE,qBAAC,UAAU,MAAX;EAAuB;EAAO,GAAI;YAAlC,CACE,oBAAC,UAAU,SAAX;GAAmB,SAAA;GAAQ,GAAI;aAC5B;GACiB,CAAA,EAEnB,SAAS,oBAAC,UAAU,QAAX;GAAkB,GAAI;aAAc;GAA2B,CAAA,GAAG,QAC7D;;;AAgBrB,MAAM,mBAAyC,WAAW,SAAS,iBACjE,EAAE,UAAU,UAAU,GAAG,SACzB,KACA;AACA,QACE,oBAAC,UAAU,MAAX;EAAgB,SAAA;EAAkB;EAAU,GAAI;YAC9C,oBAAC,UAAD;GAAoB;GAAe;GAChC;GACQ,CAAA;EACI,CAAA;EAEnB;AAEF,IAAA,uBAAe,OAAO,OAAO,cAAc;CACzC,MAAM;CACN,SAAS;CACT,SAAS;CACV,CAAC"}
1
+ {"version":3,"file":"DropdownMenu-CyxizDxJ.mjs","names":[],"sources":["../components/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["import * as Primitive from '@radix-ui/react-dropdown-menu';\nimport type { Property } from 'csstype';\nimport {\n Children,\n type ComponentPropsWithoutRef,\n type ComponentPropsWithRef,\n type ElementType,\n type FC,\n forwardRef,\n type FunctionComponentElement,\n type Ref,\n} from 'react';\nimport styled from 'styled-components';\n\nimport Menu, {\n MenuDivider,\n MenuHeading,\n MenuItem,\n type MenuItemProps,\n} from 'design-system/components/Menu/Menu';\nimport { Z_INDICES } from 'design-system/lib/zindex';\nimport { BASE } from 'design-system/variables/spacing';\n\nconst DropdownMenuContent = styled(Primitive.Content)<{ $zIndex?: Property.ZIndex }>`\n z-index: ${({ $zIndex }) => $zIndex || Z_INDICES.tooltip};\n`;\n\nexport interface DropdownMenuProps\n extends Primitive.DropdownMenuProps, Pick<Primitive.DropdownMenuContentProps, 'side' | 'align'> {\n id?: string;\n className?: string;\n\n trigger: FunctionComponentElement<any>;\n\n /**\n * Props passed to internal DropdownMenu.Content component.\n */\n contentProps?: Primitive.DropdownMenuContentProps;\n\n /**\n * Props passed to internal DropdownMenu.Trigger component.\n */\n triggerProps?: Primitive.DropdownMenuTriggerProps;\n\n /**\n * Props passed to internal DropdownMenu.Portal component.\n */\n portalProps?: Primitive.DropdownMenuPortalProps;\n\n /**\n * Whether or not to wrap menu with DropdownMenu.Portal component.\n */\n portal?: boolean;\n\n /**\n * Whether or not clicks render menu items.\n */\n disabled?: boolean;\n\n zIndex?: Property.ZIndex;\n}\n\nexport const DropdownMenu = ({\n trigger,\n children,\n side,\n align = 'end',\n contentProps,\n triggerProps,\n portalProps,\n className,\n portal = false, // Default to false for old behavior\n modal = false,\n disabled = false,\n zIndex,\n ...props\n}: DropdownMenuProps) => {\n if (Children.count(children) === 0) {\n return null;\n }\n\n const content = disabled ? null : (\n <DropdownMenuContent\n sideOffset={BASE}\n collisionPadding={BASE}\n align={align}\n side={side}\n $zIndex={zIndex}\n {...contentProps}\n >\n <Menu className={className} doNotSetRole>\n {children}\n </Menu>\n </DropdownMenuContent>\n );\n\n return (\n <Primitive.Root modal={modal} {...props}>\n <Primitive.Trigger asChild {...triggerProps}>\n {trigger}\n </Primitive.Trigger>\n\n {portal ? <Primitive.Portal {...portalProps}>{content}</Primitive.Portal> : content}\n </Primitive.Root>\n );\n};\n\ninterface DropdownMenuItemProps<T extends ElementType = 'div'>\n extends MenuItemProps<T>, Omit<Primitive.DropdownMenuItemProps, 'asChild' | 'children'> {}\n\ninterface DropdownMenuItemType<T extends ElementType = 'div'> extends FC<\n DropdownMenuItemProps<T> & ComponentPropsWithRef<T>\n> {\n <T extends ElementType = 'div'>(\n props: DropdownMenuItemProps<T> & ComponentPropsWithoutRef<T>,\n ): ReturnType<FC<DropdownMenuItemProps<T> & ComponentPropsWithoutRef<T>>>;\n}\n\n/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\nconst DropdownMenuItem: DropdownMenuItemType = forwardRef(function DropdownMenuItem(\n { children, disabled, ...props },\n ref: Ref<HTMLDivElement>,\n) {\n return (\n <Primitive.Item asChild disabled={disabled} {...props}>\n <MenuItem disabled={disabled} ref={ref}>\n {children}\n </MenuItem>\n </Primitive.Item>\n );\n});\n\nexport default Object.assign(DropdownMenu, {\n Item: DropdownMenuItem,\n Heading: MenuHeading,\n Divider: MenuDivider,\n});\n"],"mappings":";;;;;;;;AAuBA,MAAM,sBAAsB,OAAO,UAAU,QAAQ;cACvC,EAAE,cAAc,WAAW,UAAU,QAAQ;;AAsC3D,MAAa,gBAAgB,EAC3B,SACA,UACA,MACA,QAAQ,OACR,cACA,cACA,aACA,WACA,SAAS,OACT,QAAQ,OACR,WAAW,OACX,QACA,GAAG,YACoB;AACvB,KAAI,SAAS,MAAM,SAAS,KAAK,EAC/B,QAAO;CAGT,MAAM,UAAU,WAAW,OACzB,oBAAC,qBAAD;EACE,YAAA;EACA,kBAAA;EACO;EACD;EACN,SAAS;EACT,GAAI;YAEJ,oBAAC,MAAD;GAAiB;GAAW,cAAA;GACzB;GACI,CAAA;EACa,CAAA;AAGxB,QACE,qBAAC,UAAU,MAAX;EAAuB;EAAO,GAAI;YAAlC,CACE,oBAAC,UAAU,SAAX;GAAmB,SAAA;GAAQ,GAAI;aAC5B;GACiB,CAAA,EAEnB,SAAS,oBAAC,UAAU,QAAX;GAAkB,GAAI;aAAc;GAA2B,CAAA,GAAG,QAC7D;;;AAgBrB,MAAM,mBAAyC,WAAW,SAAS,iBACjE,EAAE,UAAU,UAAU,GAAG,SACzB,KACA;AACA,QACE,oBAAC,UAAU,MAAX;EAAgB,SAAA;EAAkB;EAAU,GAAI;YAC9C,oBAAC,UAAD;GAAoB;GAAe;GAChC;GACQ,CAAA;EACI,CAAA;EAEnB;AAEF,IAAA,uBAAe,OAAO,OAAO,cAAc;CACzC,MAAM;CACN,SAAS;CACT,SAAS;CACV,CAAC"}
@@ -1,6 +1,6 @@
1
- import { l as MenuItemProps, s as MenuHeadingProps } from "./Menu-ZShdhNd7.mjs";
2
- import { ComponentPropsWithRef, ComponentPropsWithoutRef, ElementType, FC, FunctionComponentElement } from "react";
1
+ import { l as MenuItemProps, s as MenuHeadingProps } from "./Menu-BCVhmNEe.mjs";
3
2
  import * as _$styled_components0 from "styled-components";
3
+ import { ComponentPropsWithRef, ComponentPropsWithoutRef, ElementType, FC, FunctionComponentElement } from "react";
4
4
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
5
5
  import * as Primitive from "@radix-ui/react-dropdown-menu";
6
6
  import { Property } from "csstype";
@@ -72,4 +72,4 @@ declare const _default: (({
72
72
  };
73
73
  //#endregion
74
74
  export { DropdownMenuProps as n, _default as r, DropdownMenu as t };
75
- //# sourceMappingURL=DropdownMenu-BoatixlO.d.mts.map
75
+ //# sourceMappingURL=DropdownMenu-RTxQ0Zu1.d.mts.map
@@ -1,2 +1,2 @@
1
- import { n as DropdownMenuProps, r as _default, t as DropdownMenu } from "./DropdownMenu-BoatixlO.mjs";
1
+ import { n as DropdownMenuProps, r as _default, t as DropdownMenu } from "./DropdownMenu-RTxQ0Zu1.mjs";
2
2
  export { DropdownMenu, DropdownMenuProps, _default as default };
@@ -1,4 +1,4 @@
1
- import { t as ValueControlProps } from "./types-B5VmRRMR.mjs";
1
+ import { t as ValueControlProps } from "./types-DBBfOCX1.mjs";
2
2
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region components/DataTable/TableControls/FiltersV2/value-controls/FloatValueControl/FloatValueControl.d.ts
@@ -1,7 +1,7 @@
1
1
  import { t as ErrorProps } from "./ErrorProps-C9T857Wk.mjs";
2
+ import * as _$styled_components0 from "styled-components";
2
3
  import * as _$react from "react";
3
4
  import { ComponentPropsWithoutRef, ReactNode } from "react";
4
- import * as _$styled_components0 from "styled-components";
5
5
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
6
6
  import { Root } from "@radix-ui/react-label";
7
7
 
@@ -57,4 +57,4 @@ interface FormControlProps extends ComponentPropsWithoutRef<'div'>, FormControlB
57
57
  declare const FormControl: _$react.ForwardRefExoticComponent<FormControlProps & _$react.RefAttributes<HTMLDivElement>>;
58
58
  //#endregion
59
59
  export { FormControlProps as a, FormLabelProps as c, FormControlBaseProps as i, HelperText as l, ErrorText as n, FormInputContainer as o, FormControl as r, FormLabel as s, Container as t, WarningText as u };
60
- //# sourceMappingURL=FormControl-0H0Jeind.d.mts.map
60
+ //# sourceMappingURL=FormControl-BMYRsFkI.d.mts.map
@@ -1,7 +1,7 @@
1
1
  import { a as styled, r as css } from "./styledComponentsInterop-8zScIQyC.mjs";
2
- import { a as Tooltip, n as TextWithDashedUnderline } from "./Tooltip-iJcfJqxn.mjs";
3
- import { n as useFormGroup } from "./useFormGroup-CaTiD_Yt.mjs";
4
- import { n as useFormField, t as FormControlContext } from "./useFormField-Bz2iMPBO.mjs";
2
+ import { a as Tooltip, n as TextWithDashedUnderline } from "./Tooltip-DSKGD33G.mjs";
3
+ import { n as useFormGroup } from "./useFormGroup-y-duFylq.mjs";
4
+ import { n as useFormField, t as FormControlContext } from "./useFormField-C-K1lgmv.mjs";
5
5
  import { Color, Spacing, Typography } from "@persona/design-tokens";
6
6
  import { Children, forwardRef, isValidElement, useMemo } from "react";
7
7
  import { jsx } from "react/jsx-runtime";
@@ -165,4 +165,4 @@ const FormControl = forwardRef(function FormControl({ children, hasError, hasWar
165
165
  //#endregion
166
166
  export { FormLabel as a, FormInputContainer as i, ErrorText as n, HelperText as o, FormControl as r, WarningText as s, Container as t };
167
167
 
168
- //# sourceMappingURL=FormControl-1BmoYFCu.mjs.map
168
+ //# sourceMappingURL=FormControl-DQFefbrI.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormControl-1BmoYFCu.mjs","names":[],"sources":["../components/FormControl/FormControl.tsx"],"sourcesContent":["import { Root } from '@radix-ui/react-label';\nimport { uniqueId } from 'lodash-es';\nimport {\n Children,\n type ComponentPropsWithoutRef,\n forwardRef,\n isValidElement,\n type ReactNode,\n useMemo,\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Color, Spacing, Typography } from '@persona/design-tokens';\nimport useFormGroup from 'design-system/components/ConfigFormGroup/useFormGroup';\nimport useFormField, {\n FormControlContext,\n type FormControlContextProps,\n} from 'design-system/components/FormControl/useFormField';\nimport Tooltip, { TextWithDashedUnderline } from 'design-system/components/Tooltip';\nimport type ErrorProps from 'design-system/types/ErrorProps';\n\ntype LabelSizes = 'md' | 'sm';\n\ninterface StyledLabelProps {\n $size?: LabelSizes;\n}\n\nconst LabelBase = styled(Root)<StyledLabelProps>`\n ${({ $size }) => {\n switch ($size) {\n default:\n case 'md':\n return css`\n ${Typography.TextMedium};\n `;\n case 'sm':\n return css`\n ${Typography.TextSmall};\n `;\n }\n }}\n\n color: ${({ theme }) => theme.color.text.primary};\n`;\n\nexport interface FormLabelProps extends ComponentPropsWithoutRef<typeof Root> {\n tooltip?: ReactNode;\n size?: LabelSizes;\n side?: 'top' | 'right' | 'bottom' | 'left';\n labelTooltipZIndex?: number;\n}\n\nexport const FormLabel = ({\n tooltip,\n side,\n size,\n children,\n labelTooltipZIndex,\n ...props\n}: FormLabelProps) => {\n const field = useFormField({ labelId: props.id });\n const formGroup = useFormGroup();\n const labelProps = {\n id: field.labelId,\n htmlFor: field.inputId,\n ...props,\n };\n\n // Use labelTooltipZIndex from props, then from form group context\n const effectivelabelTooltipZIndex = labelTooltipZIndex ?? formGroup.labelTooltipZIndex;\n\n if (tooltip) {\n return (\n <Tooltip\n size={size}\n trigger={\n <LabelBase {...labelProps} $size={size}>\n <TextWithDashedUnderline>{children}</TextWithDashedUnderline>\n </LabelBase>\n }\n side={side}\n {...(effectivelabelTooltipZIndex != null && { zIndex: effectivelabelTooltipZIndex })}\n >\n {tooltip}\n </Tooltip>\n );\n }\n\n return (\n <LabelBase {...labelProps} $size={size}>\n {children}\n </LabelBase>\n );\n};\n\n/**\n * Used to target an input field within a FormControl.\n */\nexport const FormInputContainer = styled.div``;\n\nconst HelperTextBase = styled.div<ErrorProps>`\n ${Typography.TextSmall};\n line-height: 1;\n color: ${({ theme, hasWarning, hasError }) =>\n hasError\n ? theme.color.variants.danger.default\n : hasWarning\n ? Color.CoreOrange900\n : theme.color.text.secondary};\n`;\n\ninterface HelperTextProps extends ComponentPropsWithoutRef<'div'>, ErrorProps {}\n\nexport const HelperText = forwardRef<HTMLDivElement, HelperTextProps>(\n function HelperText(props, ref) {\n const field = useFormField({ helperTextId: props.id });\n return (\n <HelperTextBase\n hasError={field.hasError}\n hasWarning={field.hasWarning}\n id={field.helperTextId}\n ref={ref}\n {...props}\n />\n );\n },\n);\n\nexport const ErrorText = forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>(\n function ErrorText(props, ref) {\n const field = useFormField({ errorTextId: props.id });\n return <HelperTextBase hasError id={field.errorTextId} ref={ref} {...props} />;\n },\n);\n\nexport const WarningText = forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>(\n function WarningText(props, ref) {\n const field = useFormField({ warningTextId: props.id });\n return <HelperTextBase hasWarning id={field.warningTextId} ref={ref} {...props} />;\n },\n);\n\nexport const Container = styled.div<{\n $configField?: boolean;\n $hasRightActions?: boolean;\n $configFieldInputWidth?: string;\n}>`\n display: flex;\n ${({ $configField, $hasRightActions, $configFieldInputWidth }) =>\n $configField\n ? $hasRightActions\n ? css`\n flex-direction: column;\n `\n : css`\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n gap: ${Spacing[4]};\n min-width: 288px;\n\n > ${FormInputContainer} {\n display: flex;\n flex-direction: row-reverse;\n width: ${$configFieldInputWidth ?? '50%'};\n min-width: 180px;\n }\n\n &:has(textarea) {\n flex-direction: column;\n align-items: flex-start;\n gap: ${Spacing[1]};\n\n > ${FormInputContainer} {\n width: 100%;\n }\n }\n `\n : css`\n flex-direction: column;\n margin-bottom: ${Spacing[3]};\n `}\n\n > *:not(:first-child) {\n margin-top: ${({ $configField, $hasRightActions }) =>\n $hasRightActions ? Spacing[1] : $configField ? Spacing[0] : Spacing[2]};\n }\n\n > ${HelperTextBase} {\n margin-top: ${Spacing[1]};\n }\n`;\n\nexport interface FormControlBaseProps extends ErrorProps {\n inputId?: string;\n disabled?: boolean;\n /**\n * Whether to render the form field as a config field.\n * This will remove the label and helper text.\n */\n configField?: boolean;\n /**\n * Whether the form field has right actions.\n */\n hasRightActions?: boolean;\n /**\n * Override the width of the form input container when `configField` is true.\n * Accepts any valid CSS width value (e.g. `'33%'`, `'66.67%'`).\n * Defaults to `'50%'`.\n */\n configFieldInputWidth?: string;\n}\n\nexport interface FormControlProps extends ComponentPropsWithoutRef<'div'>, FormControlBaseProps {}\n\nexport const FormControl = forwardRef<HTMLDivElement, FormControlProps>(function FormControl(\n {\n children,\n hasError,\n hasWarning,\n inputId,\n disabled,\n configField,\n hasRightActions,\n configFieldInputWidth,\n ...props\n }: FormControlProps,\n ref,\n) {\n const generatedId = useMemo(() => uniqueId('pds_form_control__'), []);\n\n const initFormField: FormControlContextProps = {\n hasError,\n hasWarning,\n disabled,\n inputId: inputId ?? generatedId,\n configField,\n };\n\n Children.map(children, (child: ReactNode) => {\n if (isValidElement(child)) {\n switch (child.type) {\n case FormLabel: {\n initFormField.labelId = child.props.id ?? `${initFormField.inputId}-label`;\n break;\n }\n case HelperText: {\n initFormField.helperTextId = child.props.id ?? `${initFormField.inputId}-help-text`;\n break;\n }\n case ErrorText: {\n initFormField.errorTextId = child.props.id ?? `${initFormField.inputId}-error-text`;\n break;\n }\n case WarningText: {\n initFormField.warningTextId = child.props.id ?? `${initFormField.inputId}-warning-text`;\n break;\n }\n }\n }\n });\n\n const field = useFormField(initFormField);\n\n return (\n <FormControlContext.Provider value={field}>\n <Container\n ref={ref}\n $configField={field.configField}\n $hasRightActions={hasRightActions}\n $configFieldInputWidth={configFieldInputWidth}\n {...props}\n >\n {children}\n </Container>\n </FormControlContext.Provider>\n );\n});\n\nexport default FormControl;\n"],"mappings":";;;;;;;;;;AA2BA,MAAM,YAAY,OAAO,KAAK;KACzB,EAAE,YAAY;AACf,SAAQ,OAAR;EACE;EACA,KAAK,KACH,QAAO,GAAG;YACN,WAAW,WAA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AO;YAClC,oBAAC,WAAD;GACO;GACL,cAAc,MAAM;GACpB,kBAAkB;GAClB,wBAAwB;GACxB,GAAI;GAEH;GACS,CAAA;EACgB,CAAA;EAEhC"}
1
+ {"version":3,"file":"FormControl-DQFefbrI.mjs","names":[],"sources":["../components/FormControl/FormControl.tsx"],"sourcesContent":["import { Root } from '@radix-ui/react-label';\nimport { uniqueId } from 'lodash-es';\nimport {\n Children,\n type ComponentPropsWithoutRef,\n forwardRef,\n isValidElement,\n type ReactNode,\n useMemo,\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Color, Spacing, Typography } from '@persona/design-tokens';\nimport useFormGroup from 'design-system/components/ConfigFormGroup/useFormGroup';\nimport useFormField, {\n FormControlContext,\n type FormControlContextProps,\n} from 'design-system/components/FormControl/useFormField';\nimport Tooltip, { TextWithDashedUnderline } from 'design-system/components/Tooltip';\nimport type ErrorProps from 'design-system/types/ErrorProps';\n\ntype LabelSizes = 'md' | 'sm';\n\ninterface StyledLabelProps {\n $size?: LabelSizes;\n}\n\nconst LabelBase = styled(Root)<StyledLabelProps>`\n ${({ $size }) => {\n switch ($size) {\n default:\n case 'md':\n return css`\n ${Typography.TextMedium};\n `;\n case 'sm':\n return css`\n ${Typography.TextSmall};\n `;\n }\n }}\n\n color: ${({ theme }) => theme.color.text.primary};\n`;\n\nexport interface FormLabelProps extends ComponentPropsWithoutRef<typeof Root> {\n tooltip?: ReactNode;\n size?: LabelSizes;\n side?: 'top' | 'right' | 'bottom' | 'left';\n labelTooltipZIndex?: number;\n}\n\nexport const FormLabel = ({\n tooltip,\n side,\n size,\n children,\n labelTooltipZIndex,\n ...props\n}: FormLabelProps) => {\n const field = useFormField({ labelId: props.id });\n const formGroup = useFormGroup();\n const labelProps = {\n id: field.labelId,\n htmlFor: field.inputId,\n ...props,\n };\n\n // Use labelTooltipZIndex from props, then from form group context\n const effectivelabelTooltipZIndex = labelTooltipZIndex ?? formGroup.labelTooltipZIndex;\n\n if (tooltip) {\n return (\n <Tooltip\n size={size}\n trigger={\n <LabelBase {...labelProps} $size={size}>\n <TextWithDashedUnderline>{children}</TextWithDashedUnderline>\n </LabelBase>\n }\n side={side}\n {...(effectivelabelTooltipZIndex != null && { zIndex: effectivelabelTooltipZIndex })}\n >\n {tooltip}\n </Tooltip>\n );\n }\n\n return (\n <LabelBase {...labelProps} $size={size}>\n {children}\n </LabelBase>\n );\n};\n\n/**\n * Used to target an input field within a FormControl.\n */\nexport const FormInputContainer = styled.div``;\n\nconst HelperTextBase = styled.div<ErrorProps>`\n ${Typography.TextSmall};\n line-height: 1;\n color: ${({ theme, hasWarning, hasError }) =>\n hasError\n ? theme.color.variants.danger.default\n : hasWarning\n ? Color.CoreOrange900\n : theme.color.text.secondary};\n`;\n\ninterface HelperTextProps extends ComponentPropsWithoutRef<'div'>, ErrorProps {}\n\nexport const HelperText = forwardRef<HTMLDivElement, HelperTextProps>(\n function HelperText(props, ref) {\n const field = useFormField({ helperTextId: props.id });\n return (\n <HelperTextBase\n hasError={field.hasError}\n hasWarning={field.hasWarning}\n id={field.helperTextId}\n ref={ref}\n {...props}\n />\n );\n },\n);\n\nexport const ErrorText = forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>(\n function ErrorText(props, ref) {\n const field = useFormField({ errorTextId: props.id });\n return <HelperTextBase hasError id={field.errorTextId} ref={ref} {...props} />;\n },\n);\n\nexport const WarningText = forwardRef<HTMLDivElement, React.ComponentPropsWithoutRef<'div'>>(\n function WarningText(props, ref) {\n const field = useFormField({ warningTextId: props.id });\n return <HelperTextBase hasWarning id={field.warningTextId} ref={ref} {...props} />;\n },\n);\n\nexport const Container = styled.div<{\n $configField?: boolean;\n $hasRightActions?: boolean;\n $configFieldInputWidth?: string;\n}>`\n display: flex;\n ${({ $configField, $hasRightActions, $configFieldInputWidth }) =>\n $configField\n ? $hasRightActions\n ? css`\n flex-direction: column;\n `\n : css`\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n gap: ${Spacing[4]};\n min-width: 288px;\n\n > ${FormInputContainer} {\n display: flex;\n flex-direction: row-reverse;\n width: ${$configFieldInputWidth ?? '50%'};\n min-width: 180px;\n }\n\n &:has(textarea) {\n flex-direction: column;\n align-items: flex-start;\n gap: ${Spacing[1]};\n\n > ${FormInputContainer} {\n width: 100%;\n }\n }\n `\n : css`\n flex-direction: column;\n margin-bottom: ${Spacing[3]};\n `}\n\n > *:not(:first-child) {\n margin-top: ${({ $configField, $hasRightActions }) =>\n $hasRightActions ? Spacing[1] : $configField ? Spacing[0] : Spacing[2]};\n }\n\n > ${HelperTextBase} {\n margin-top: ${Spacing[1]};\n }\n`;\n\nexport interface FormControlBaseProps extends ErrorProps {\n inputId?: string;\n disabled?: boolean;\n /**\n * Whether to render the form field as a config field.\n * This will remove the label and helper text.\n */\n configField?: boolean;\n /**\n * Whether the form field has right actions.\n */\n hasRightActions?: boolean;\n /**\n * Override the width of the form input container when `configField` is true.\n * Accepts any valid CSS width value (e.g. `'33%'`, `'66.67%'`).\n * Defaults to `'50%'`.\n */\n configFieldInputWidth?: string;\n}\n\nexport interface FormControlProps extends ComponentPropsWithoutRef<'div'>, FormControlBaseProps {}\n\nexport const FormControl = forwardRef<HTMLDivElement, FormControlProps>(function FormControl(\n {\n children,\n hasError,\n hasWarning,\n inputId,\n disabled,\n configField,\n hasRightActions,\n configFieldInputWidth,\n ...props\n }: FormControlProps,\n ref,\n) {\n const generatedId = useMemo(() => uniqueId('pds_form_control__'), []);\n\n const initFormField: FormControlContextProps = {\n hasError,\n hasWarning,\n disabled,\n inputId: inputId ?? generatedId,\n configField,\n };\n\n Children.map(children, (child: ReactNode) => {\n if (isValidElement(child)) {\n switch (child.type) {\n case FormLabel: {\n initFormField.labelId = child.props.id ?? `${initFormField.inputId}-label`;\n break;\n }\n case HelperText: {\n initFormField.helperTextId = child.props.id ?? `${initFormField.inputId}-help-text`;\n break;\n }\n case ErrorText: {\n initFormField.errorTextId = child.props.id ?? `${initFormField.inputId}-error-text`;\n break;\n }\n case WarningText: {\n initFormField.warningTextId = child.props.id ?? `${initFormField.inputId}-warning-text`;\n break;\n }\n }\n }\n });\n\n const field = useFormField(initFormField);\n\n return (\n <FormControlContext.Provider value={field}>\n <Container\n ref={ref}\n $configField={field.configField}\n $hasRightActions={hasRightActions}\n $configFieldInputWidth={configFieldInputWidth}\n {...props}\n >\n {children}\n </Container>\n </FormControlContext.Provider>\n );\n});\n\nexport default FormControl;\n"],"mappings":";;;;;;;;;;AA2BA,MAAM,YAAY,OAAO,KAAK;KACzB,EAAE,YAAY;AACf,SAAQ,OAAR;EACE;EACA,KAAK,KACH,QAAO,GAAG;YACN,WAAW,WAAW;;EAE5B,KAAK,KACH,QAAO,GAAG;YACN,WAAW,UAAU;;;EAG7B;;YAEQ,EAAE,YAAY,MAAM,MAAM,KAAK,QAAQ;;AAUnD,MAAa,aAAa,EACxB,SACA,MACA,MACA,UACA,oBACA,GAAG,YACiB;CACpB,MAAM,QAAQ,aAAa,EAAE,SAAS,MAAM,IAAI,CAAC;CACjD,MAAM,YAAY,cAAc;CAChC,MAAM,aAAa;EACjB,IAAI,MAAM;EACV,SAAS,MAAM;EACf,GAAG;EACJ;CAGD,MAAM,8BAA8B,sBAAsB,UAAU;AAEpE,KAAI,QACF,QACE,oBAAC,SAAD;EACQ;EACN,SACE,oBAAC,WAAD;GAAW,GAAI;GAAY,OAAO;aAChC,oBAAC,yBAAD,EAA0B,UAAmC,CAAA;GACnD,CAAA;EAER;EACN,GAAK,+BAA+B,QAAQ,EAAE,QAAQ,6BAA6B;YAElF;EACO,CAAA;AAId,QACE,oBAAC,WAAD;EAAW,GAAI;EAAY,OAAO;EAC/B;EACS,CAAA;;;;;AAOhB,MAAa,qBAAqB,OAAO,GAAG;AAE5C,MAAM,iBAAiB,OAAO,GAAe;IACzC,WAAW,UAAU;;YAEb,EAAE,OAAO,YAAY,eAC7B,WACI,MAAM,MAAM,SAAS,OAAO,UAC5B,aACE,MAAM,gBACN,MAAM,MAAM,KAAK,UAAU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,CACvB,SAAQ,MAAM,MAAd;GACE,KAAK;AACH,kBAAc,UAAU,MAAM,MAAM,MAAM,GAAG,cAAc,QAAQ;AACnE;GAEF,KAAK;AACH,kBAAc,eAAe,MAAM,MAAM,MAAM,GAAG,cAAc,QAAQ;AACxE;GAEF,KAAK;AACH,kBAAc,cAAc,MAAM,MAAM,MAAM,GAAG,cAAc,QAAQ;AACvE;GAEF,KAAK;AACH,kBAAc,gBAAgB,MAAM,MAAM,MAAM,GAAG,cAAc,QAAQ;AACzE;;GAIN;CAEF,MAAM,QAAQ,aAAa,cAAc;AAEzC,QACE,oBAAC,mBAAmB,UAApB;EAA6B,OAAO;YAClC,oBAAC,WAAD;GACO;GACL,cAAc,MAAM;GACpB,kBAAkB;GAClB,wBAAwB;GACxB,GAAI;GAEH;GACS,CAAA;EACgB,CAAA;EAEhC"}
@@ -1,2 +1,2 @@
1
- import { a as FormControlProps, c as FormLabelProps, i as FormControlBaseProps, l as HelperText, n as ErrorText, o as FormInputContainer, r as FormControl, s as FormLabel, t as Container, u as WarningText } from "./FormControl-0H0Jeind.mjs";
1
+ import { a as FormControlProps, c as FormLabelProps, i as FormControlBaseProps, l as HelperText, n as ErrorText, o as FormInputContainer, r as FormControl, s as FormLabel, t as Container, u as WarningText } from "./FormControl-BMYRsFkI.mjs";
2
2
  export { Container, ErrorText, FormControl, FormControl as default, FormControlBaseProps, FormControlProps, FormInputContainer, FormLabel, FormLabelProps, HelperText, WarningText };
@@ -1,6 +1,6 @@
1
- import { c as ParagraphProps, o as LabelProps, u as SpanProps } from "./Text-CAKHcXSd.mjs";
2
- import * as _$react from "react";
1
+ import { c as ParagraphProps, o as LabelProps, u as SpanProps } from "./Text-BzzUdBdc.mjs";
3
2
  import * as _$styled_components0 from "styled-components";
3
+ import * as _$react from "react";
4
4
 
5
5
  //#region components/DataTable/FormControlLabel/FormControlLabel.d.ts
6
6
  declare const FormControlLabel: _$styled_components0.StyledComponent<_$react.FC<_$react.PropsWithChildren<SpanProps>>, any, ParagraphProps & LabelProps & {
@@ -1,4 +1,4 @@
1
- import { a as FormControlProps, l as HelperText, n as ErrorText, s as FormLabel, u as WarningText } from "./FormControl-0H0Jeind.mjs";
1
+ import { a as FormControlProps, l as HelperText, n as ErrorText, s as FormLabel, u as WarningText } from "./FormControl-BMYRsFkI.mjs";
2
2
  import * as _$react from "react";
3
3
  import { ComponentPropsWithRef, ReactElement, ReactNode } from "react";
4
4
 
@@ -50,12 +50,11 @@ interface FormFieldBaseProps {
50
50
  }
51
51
  interface FormFieldProps extends Omit<FormControlProps, 'children'>, FormFieldBaseProps {}
52
52
  /**
53
- * > **Please do not use in production! This component is subject to API and style changes.**
53
+ * Helper component with preset slots for label, input, and helper texts.
54
54
  *
55
- * Helper components with preset slots for label, input, and helper texts.
56
- * Fully composed components with different form input types are available.
57
- * This is the recommended way to implement form elements.
58
- * You can use `<FormControl>` if you require more flexibility.
55
+ * Prefer a composed field component, such as `<TextField>`, `<SelectField>`, or
56
+ * `<CheckboxField>`, when one is available for the input type. Use `<FormField>` directly
57
+ * when composing a custom control or layout.
59
58
  *
60
59
  * ## Usage
61
60
  *
@@ -66,4 +65,4 @@ interface FormFieldProps extends Omit<FormControlProps, 'children'>, FormFieldBa
66
65
  declare const FormField: _$react.ForwardRefExoticComponent<FormFieldProps & _$react.RefAttributes<HTMLDivElement>>;
67
66
  //#endregion
68
67
  export { FormFieldBaseProps as n, FormFieldProps as r, FormField as t };
69
- //# sourceMappingURL=FormField-BcaFdmo5.d.mts.map
68
+ //# sourceMappingURL=FormField-C1DaUT5U.d.mts.map
@@ -1,19 +1,19 @@
1
1
  import { t as HStack } from "./Stack-Bre2oiov.mjs";
2
- import { t as IconButton } from "./IconButton-BgL3QUVO.mjs";
3
- import { n as useFormGroup } from "./useFormGroup-CaTiD_Yt.mjs";
4
- import { t as FormControlContext } from "./useFormField-Bz2iMPBO.mjs";
2
+ import { t as IconButton } from "./IconButton-BnSEV7eR.mjs";
3
+ import { n as useFormGroup } from "./useFormGroup-y-duFylq.mjs";
4
+ import { t as FormControlContext } from "./useFormField-C-K1lgmv.mjs";
5
5
  import Input_default from "./components/Input/index.mjs";
6
- import { n as DropdownMenu_default } from "./DropdownMenu-CUnf420M.mjs";
7
- import { t as Checkbox } from "./Checkbox-DxNHp59y.mjs";
8
- import { t as Combobox } from "./Combobox-BUtqtzKl.mjs";
9
- import { n as Select } from "./Select-U_vQhK1A.mjs";
10
- import { t as Toggle } from "./Toggle-e8DCYa6i.mjs";
11
- import { a as FormLabel, i as FormInputContainer, n as ErrorText, o as HelperText, r as FormControl, s as WarningText } from "./FormControl-1BmoYFCu.mjs";
12
- import { t as ListBox } from "./ListBox-9jHHEaqW.mjs";
13
- import { t as RadioGroup } from "./RadioGroup-BGo_kXKh.mjs";
14
- import { t as SegmentedControl } from "./SegmentedControl-CvWJGhwy.mjs";
15
- import { t as TextAreaWithStyle } from "./TextArea-n4IKHJKo.mjs";
16
- import { t as TableBox } from "./TableBox-0GvWjRln.mjs";
6
+ import { n as DropdownMenu_default } from "./DropdownMenu-CyxizDxJ.mjs";
7
+ import { t as Checkbox } from "./Checkbox-DwZEsi7x.mjs";
8
+ import { t as Combobox } from "./Combobox-CKaVX-32.mjs";
9
+ import { n as Select } from "./Select-CBVvPyRJ.mjs";
10
+ import { t as Toggle } from "./Toggle-Do5z1VcO.mjs";
11
+ import { a as FormLabel, i as FormInputContainer, n as ErrorText, o as HelperText, r as FormControl, s as WarningText } from "./FormControl-DQFefbrI.mjs";
12
+ import { t as ListBox } from "./ListBox-jzXQDraS.mjs";
13
+ import { t as RadioGroup } from "./RadioGroup-pegXtLwD.mjs";
14
+ import { t as SegmentedControl } from "./SegmentedControl-DwbltwDQ.mjs";
15
+ import { t as TextAreaWithStyle } from "./TextArea-CospIXEO.mjs";
16
+ import { t as TableBox } from "./TableBox-Bd-H5oyh.mjs";
17
17
  import { Spacing } from "@persona/design-tokens";
18
18
  import { Children, Fragment, cloneElement, createContext, forwardRef, useContext, useMemo, useRef, useState } from "react";
19
19
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -24,12 +24,11 @@ import { useCheckboxGroupState } from "react-stately";
24
24
  import innerText from "react-innertext";
25
25
  //#region components/FormField/FormField.tsx
26
26
  /**
27
- * > **Please do not use in production! This component is subject to API and style changes.**
27
+ * Helper component with preset slots for label, input, and helper texts.
28
28
  *
29
- * Helper components with preset slots for label, input, and helper texts.
30
- * Fully composed components with different form input types are available.
31
- * This is the recommended way to implement form elements.
32
- * You can use `<FormControl>` if you require more flexibility.
29
+ * Prefer a composed field component, such as `<TextField>`, `<SelectField>`, or
30
+ * `<CheckboxField>`, when one is available for the input type. Use `<FormField>` directly
31
+ * when composing a custom control or layout.
33
32
  *
34
33
  * ## Usage
35
34
  *
@@ -474,4 +473,4 @@ TableBoxField.Cell = TableBox.Cell;
474
473
  //#endregion
475
474
  export { CheckboxField as a, SegmentedControlField as c, TextField as d, ToggleField as f, CheckboxGroupField as i, SelectField as l, FormField as m, TableBoxField as n, ComboboxField as o, splitOutFormFieldProps as p, ListBoxField as r, RadioGroupField as s, TABLE_BOX_FIELD_ADD_BUTTON_ARIA_LABEL as t, TextAreaField as u };
476
475
 
477
- //# sourceMappingURL=FormField-oBKH25qf.mjs.map
476
+ //# sourceMappingURL=FormField-C7bW-O6H.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormField-C7bW-O6H.mjs","names":["Input","TextArea","DropdownMenu","DropdownMenu"],"sources":["../components/FormField/FormField.tsx","../components/FormField/inputFields.tsx","../components/FormField/CheckboxGroupField.tsx","../components/FormField/ListBoxField.tsx","../components/FormField/TableBoxField.tsx"],"sourcesContent":["import { type ComponentPropsWithRef, forwardRef, type ReactElement, type ReactNode } from 'react';\n\nimport { Spacing } from '@persona/design-tokens';\nimport useFormGroup from 'design-system/components/ConfigFormGroup/useFormGroup';\nimport FormControl, {\n ErrorText,\n type FormControlProps,\n FormInputContainer,\n FormLabel,\n HelperText,\n WarningText,\n} from 'design-system/components/FormControl';\nimport { HStack } from 'design-system/components/Stack';\n\nexport interface FormFieldBaseProps {\n /**\n * Renders `<Label>` above input\n */\n label?: ReactNode;\n\n /**\n * ID of the input element. Providing this will automatically link the label to the input.\n */\n inputId?: string;\n\n /**\n * Renders `<HelperText>` below input\n */\n helperText?: ReactNode;\n\n /**\n * Renders `<ErrorText>` below input and helper text.\n */\n errorText?: ReactNode;\n\n /**\n * Renders `<WarningText>` below input and helper text.\n */\n warningText?: ReactNode;\n\n /**\n * Should be an input of some sort\n */\n children?: ReactElement;\n\n labelProps?: ComponentPropsWithRef<typeof FormLabel>;\n helperProps?: ComponentPropsWithRef<typeof HelperText>;\n warningProps?: ComponentPropsWithRef<typeof WarningText>;\n errorProps?: ComponentPropsWithRef<typeof ErrorText>;\n\n /**\n * Whether to render the form field as a config field.\n * This will render the helper text as a tooltip.\n */\n configField?: boolean;\n\n /**\n * Override the width of the input area when `configField` is true.\n * Accepts any valid CSS width value (e.g. `'33%'`, `'66.67%'`).\n * Defaults to `'50%'`.\n */\n configFieldInputWidth?: string;\n\n /**\n * Renders actions to the right of the label.\n */\n rightActions?: ReactNode;\n}\n\nexport interface FormFieldProps extends Omit<FormControlProps, 'children'>, FormFieldBaseProps {}\n\n/**\n * Helper component with preset slots for label, input, and helper texts.\n *\n * Prefer a composed field component, such as `<TextField>`, `<SelectField>`, or\n * `<CheckboxField>`, when one is available for the input type. Use `<FormField>` directly\n * when composing a custom control or layout.\n *\n * ## Usage\n *\n * ```tsx\n * import FormField from 'design-system/components/FormField';\n * ```\n */\nexport const FormField = forwardRef<HTMLDivElement, FormFieldProps>(function FormField(\n {\n label,\n children,\n helperText,\n warningText,\n errorText,\n labelProps,\n helperProps,\n warningProps,\n errorProps,\n configField: configFieldProp,\n configFieldInputWidth,\n rightActions,\n ...props\n }: FormFieldProps,\n ref,\n) {\n const { configField: configFieldFormGroup } = useFormGroup();\n const configField = configFieldProp ?? configFieldFormGroup;\n\n const labelElement = label ? (\n <FormLabel tooltip={configField && helperText ? helperText : undefined} {...labelProps}>\n {label}\n </FormLabel>\n ) : null;\n\n return (\n <FormControl\n hasError={!!errorText}\n hasWarning={!!warningText}\n ref={ref}\n configField={configField}\n hasRightActions={!!rightActions}\n configFieldInputWidth={configFieldInputWidth}\n {...props}\n >\n {rightActions ? (\n <HStack justify='space-between' align='center'>\n {labelElement}\n <HStack spacing={Spacing[1]}>{rightActions}</HStack>\n </HStack>\n ) : (\n labelElement\n )}\n <FormInputContainer>{children}</FormInputContainer>\n {!configField && helperText && <HelperText {...helperProps}>{helperText}</HelperText>}\n {!configField && warningText && <WarningText {...warningProps}>{warningText}</WarningText>}\n {!configField && errorText && <ErrorText {...errorProps}>{errorText}</ErrorText>}\n </FormControl>\n );\n});\n\nexport default FormField;\n","import { uniqueId } from 'lodash-es';\nimport { forwardRef, useMemo } from 'react';\n\nimport Checkbox, { type CheckboxProps } from 'design-system/components/Checkbox';\nimport Combobox from 'design-system/components/Combobox';\nimport type { ComboboxMultiSelectProps } from 'design-system/components/Combobox/ComboboxMultiSelect';\nimport type { ComboboxSingleSelectProps } from 'design-system/components/Combobox/ComboboxSingleSelect';\nimport FormField, { type FormFieldBaseProps } from 'design-system/components/FormField/FormField';\nimport Input, { type InputProps } from 'design-system/components/Input';\nimport RadioGroup, { type RadioGroupProps } from 'design-system/components/RadioGroup';\nimport SegmentedControl, {\n type SegmentedControlProps,\n} from 'design-system/components/SegmentedControl';\nimport Select, { type SelectProps } from 'design-system/components/Select';\nimport TextArea, { type TextAreaProps } from 'design-system/components/TextArea';\nimport Toggle, { type ToggleProps } from 'design-system/components/Toggle';\n\nexport type ImplementsFormField = Omit<FormFieldBaseProps, 'children'>;\n\ntype ExtractFormFieldProps<T extends ImplementsFormField> = Pick<\n T,\n | 'label'\n | 'inputId'\n | 'helperText'\n | 'errorText'\n | 'warningText'\n | 'labelProps'\n | 'helperProps'\n | 'warningProps'\n | 'errorProps'\n | 'configField'\n | 'configFieldInputWidth'\n | 'rightActions'\n>;\ntype OmitFormFieldProps<T extends ImplementsFormField> = Omit<T, keyof ExtractFormFieldProps<T>>;\n\n/**\n * Helper to split out props that are sent to the FormField component from props sent\n * to the underlying input component.\n */\nexport const splitOutFormFieldProps = <T extends ImplementsFormField>(\n props: T,\n): {\n formFieldProps: ExtractFormFieldProps<T>;\n inputProps: OmitFormFieldProps<T>;\n} => {\n const {\n label,\n inputId,\n helperText,\n errorText,\n warningText,\n labelProps,\n helperProps,\n warningProps,\n errorProps,\n configField,\n configFieldInputWidth,\n rightActions,\n ...inputProps\n } = props;\n\n return {\n formFieldProps: {\n label,\n inputId,\n helperText,\n errorText,\n warningText,\n labelProps,\n helperProps,\n warningProps,\n errorProps,\n configField,\n configFieldInputWidth,\n rightActions,\n },\n inputProps,\n };\n};\n\nexport interface TextFieldProps extends ImplementsFormField, InputProps {}\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n function TextField(props, ref) {\n const { formFieldProps, inputProps } = splitOutFormFieldProps(props);\n const { id, ...rest } = inputProps;\n\n return (\n <FormField\n {...formFieldProps}\n labelProps={{ size: props.size, ...formFieldProps.labelProps }}\n inputId={formFieldProps.inputId ?? id}\n >\n <Input {...rest} ref={ref} />\n </FormField>\n );\n },\n);\n\nexport interface TextAreaFieldProps extends ImplementsFormField, TextAreaProps {}\n\nexport const TextAreaField = forwardRef<HTMLTextAreaElement, TextAreaFieldProps>(\n function TextAreaField(props, ref) {\n const { formFieldProps, inputProps } = splitOutFormFieldProps(props);\n const { id, ...rest } = inputProps;\n\n return (\n <FormField\n {...formFieldProps}\n labelProps={{ size: props.size, ...formFieldProps.labelProps }}\n inputId={formFieldProps.inputId ?? id}\n >\n <TextArea {...rest} ref={ref} />\n </FormField>\n );\n },\n);\n\nexport interface SelectFieldProps extends ImplementsFormField, SelectProps {}\n\nexport const SelectField = ({ id, children, ...props }: SelectFieldProps) => {\n const { formFieldProps, inputProps } = splitOutFormFieldProps(props);\n const linkedId = useMemo(\n () => formFieldProps.inputId ?? id ?? uniqueId('pds-form-field-input-fields-select__'),\n [formFieldProps.inputId, id],\n );\n\n return (\n <FormField\n {...formFieldProps}\n inputId={linkedId}\n labelProps={{ htmlFor: linkedId, size: inputProps.size, ...formFieldProps.labelProps }}\n >\n <Select {...inputProps} id={linkedId}>\n {children}\n </Select>\n </FormField>\n );\n};\n\nexport interface RadioGroupFieldProps\n extends Omit<ImplementsFormField, 'configField'>, RadioGroupProps {}\n\nexport const RadioGroupField = ({\n label,\n helperText,\n errorText,\n warningText,\n children,\n ...props\n}: RadioGroupFieldProps) => {\n return (\n <FormField\n label={label}\n helperText={helperText}\n warningText={warningText}\n errorText={errorText}\n >\n <RadioGroup {...props}>{children}</RadioGroup>\n </FormField>\n );\n};\n\nexport interface CheckboxFieldProps extends ImplementsFormField, CheckboxProps {\n checkboxLabel?: CheckboxProps['label'];\n}\n\nexport const CheckboxField = ({\n label,\n helperText,\n errorText,\n warningText,\n checkboxLabel,\n configField,\n labelProps,\n ...props\n}: CheckboxFieldProps) => {\n return (\n <FormField\n label={label}\n helperText={helperText}\n warningText={warningText}\n errorText={errorText}\n configField={configField}\n labelProps={labelProps}\n >\n <Checkbox label={checkboxLabel} {...props} />\n </FormField>\n );\n};\n\nexport interface ToggleFieldProps extends ImplementsFormField, ToggleProps {}\n\nexport const ToggleField = forwardRef<HTMLDivElement, ToggleFieldProps>(\n function ToggleField(props, ref) {\n const { formFieldProps, inputProps } = splitOutFormFieldProps(props);\n\n return (\n <FormField\n {...formFieldProps}\n labelProps={{ size: inputProps.size, ...formFieldProps.labelProps }}\n >\n <Toggle {...inputProps} ref={ref} />\n </FormField>\n );\n },\n);\n\nexport interface SegmentedControlFieldProps\n extends ImplementsFormField, Omit<SegmentedControlProps, 'children'> {\n children?: SegmentedControlProps['children'];\n}\n\nexport const SegmentedControlField = forwardRef<HTMLDivElement, SegmentedControlFieldProps>(\n function SegmentedControlField(\n { label, helperText, errorText, warningText, configField, children, labelProps, ...props },\n ref,\n ) {\n return (\n <FormField\n label={label}\n helperText={helperText}\n warningText={warningText}\n errorText={errorText}\n configField={configField}\n labelProps={labelProps}\n >\n <SegmentedControl fullWidth {...props} ref={ref}>\n {children}\n </SegmentedControl>\n </FormField>\n );\n },\n);\n\nexport type ComboboxSingleSelectFieldProps<T = string> = ImplementsFormField &\n ComboboxSingleSelectProps<T>;\nexport type ComboboxMultiSelectFieldProps<T = string> = ImplementsFormField &\n ComboboxMultiSelectProps<T>;\n\nexport const ComboboxField = (\n props: ComboboxSingleSelectFieldProps | ComboboxMultiSelectFieldProps,\n) => {\n // `Combobox` registers its own id with the surrounding `FormControl`, which is what links the\n // label to it, so the field only forwards an explicit `inputId` when one is given. Each mode is\n // split separately: `multiple` discriminates the two, and a union split at once loses that.\n if (props.multiple) {\n const { formFieldProps, inputProps } = splitOutFormFieldProps(props);\n\n return (\n <FormField {...formFieldProps}>\n <Combobox {...inputProps} />\n </FormField>\n );\n }\n\n const { formFieldProps, inputProps } = splitOutFormFieldProps(props);\n\n return (\n <FormField {...formFieldProps}>\n <Combobox {...inputProps} />\n </FormField>\n );\n};\n","import {\n Children,\n cloneElement,\n type ComponentPropsWithRef,\n createContext,\n type ReactElement,\n type ReactNode,\n useContext,\n useRef,\n} from 'react';\nimport {\n type AriaCheckboxGroupProps,\n mergeProps,\n useCheckboxGroup,\n useCheckboxGroupItem,\n} from 'react-aria';\nimport innerText from 'react-innertext';\nimport { type CheckboxGroupState, useCheckboxGroupState } from 'react-stately';\n\nimport type { CheckboxProps } from 'design-system/components/Checkbox';\nimport type Checkbox from 'design-system/components/Checkbox';\nimport { FormControlContext } from 'design-system/components/FormControl/useFormField';\nimport FormField from 'design-system/components/FormField/FormField';\nimport type { ImplementsFormField } from 'design-system/components/FormField/inputFields';\n\n/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\nconst CheckboxGroupContext = createContext<CheckboxGroupState>(null);\n\n/** Preserves the parent FormControl context (disabled, hasError, etc.) but clears\n * inputId so each Checkbox inside the group generates its own unique id. */\nconst ClearGroupInputId = ({ children }: { children: ReactNode }) => {\n const parentContext = useContext(FormControlContext);\n return (\n <FormControlContext.Provider value={{ ...parentContext, inputId: undefined }}>\n {children}\n </FormControlContext.Provider>\n );\n};\n\ninterface CheckboxGroupItemProps {\n children: ReactElement<ComponentPropsWithRef<typeof Checkbox>>;\n}\n\nconst CheckboxGroupItem = (props: CheckboxGroupItemProps) => {\n const { children } = props;\n const checkboxProps = children.props;\n\n const state = useContext(CheckboxGroupContext);\n const ref = useRef();\n const { inputProps } = useCheckboxGroupItem(\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n {\n ...checkboxProps,\n onChange: undefined,\n isDisabled: checkboxProps.disabled,\n isReadOnly: checkboxProps.readOnly,\n isRequired: checkboxProps.required,\n isIndeterminate: checkboxProps.indeterminate,\n value: String(children.props.value),\n 'aria-label': innerText(checkboxProps.label),\n },\n state,\n ref,\n );\n\n return cloneElement(\n children,\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n mergeProps(inputProps, {\n onChange: checkboxProps.onChange,\n disabled: state.isDisabled || checkboxProps.disabled,\n checked: state.isSelected(String(inputProps.value)),\n ref,\n } as ComponentPropsWithRef<typeof Checkbox>),\n );\n};\n\ninterface CheckboxGroupFieldProps\n extends\n Omit<ImplementsFormField, 'configField'>,\n Omit<\n AriaCheckboxGroupProps,\n 'description' | 'disabled' | 'isReadOnly' | 'isRequired' | 'errorMessage'\n > {\n children?: ReactElement<CheckboxProps>[];\n disabled?: boolean;\n readOnly?: boolean;\n required?: boolean;\n}\n\nconst CheckboxGroupField = ({\n children,\n name,\n onChange,\n disabled,\n readOnly,\n required,\n ...props\n}: CheckboxGroupFieldProps) => {\n const reactAriaProps = {\n ...props,\n description: props.helperText,\n errorMessage: props.errorText,\n onChange,\n name,\n isDisabled: disabled,\n isReadOnly: readOnly,\n isRequired: required,\n };\n const state = useCheckboxGroupState(reactAriaProps);\n const { groupProps, labelProps, descriptionProps, errorMessageProps } = useCheckboxGroup(\n reactAriaProps,\n state,\n );\n\n return (\n <FormField\n labelProps={labelProps}\n helperProps={descriptionProps}\n errorProps={errorMessageProps}\n disabled={disabled}\n {...groupProps}\n {...props}\n >\n <ClearGroupInputId>\n <CheckboxGroupContext.Provider value={state}>\n {Children.map(children, (checkbox) => (\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n <CheckboxGroupItem>{checkbox}</CheckboxGroupItem>\n ))}\n </CheckboxGroupContext.Provider>\n </ClearGroupInputId>\n </FormField>\n );\n};\n\nexport default CheckboxGroupField;\n","import { type ReactNode, useState } from 'react';\n\nimport { MoreIcon, PlusIcon } from '@persona/icons';\nimport { IconButton } from 'design-system/components/Button';\nimport useFormGroup from 'design-system/components/ConfigFormGroup/useFormGroup';\nimport DropdownMenu from 'design-system/components/DropdownMenu';\nimport FormField from 'design-system/components/FormField/FormField';\nimport type { ImplementsFormField } from 'design-system/components/FormField/inputFields';\nimport ListBox, { type ListBoxProps } from 'design-system/components/ListBox';\nimport type { MenuItemProps } from 'design-system/components/Menu';\n\ninterface ListBoxFieldAction extends Omit<MenuItemProps, 'children'> {\n label: string;\n onClick: (selectedKeys: ListBoxProps<any>['selectedKeys']) => void;\n}\n\ninterface AddDropdownConfig {\n options: ({ label: ReactNode; value: string } & Omit<MenuItemProps, 'children'>)[];\n onSelection: (value: string) => void;\n}\n\ninterface ListBoxFieldProps<T extends object> extends ImplementsFormField, ListBoxProps<T> {\n actions?: ListBoxFieldAction[];\n addDropdownConfig?: AddDropdownConfig;\n /** Disables the add button, e.g. while the list is read-only. */\n addDisabled?: boolean;\n}\n\nconst ListBoxField = <T extends object>({\n label,\n helperText,\n errorText,\n warningText,\n labelProps,\n helperProps,\n errorProps,\n warningProps,\n inputId,\n onAdd,\n onDelete,\n deleteDisabled,\n configField: configFieldProp,\n size = 'md',\n actions = [],\n addDropdownConfig,\n addDisabled,\n selectedKeys: selectedKeysProp,\n onSelectionChange,\n defaultSelectedKeys,\n ...props\n}: ListBoxFieldProps<T>) => {\n const { configField } = useFormGroup({ configField: configFieldProp });\n const menuActions: ListBoxFieldAction[] = [...actions];\n const [selectedKeysState, setSelectedKeys] = useState(defaultSelectedKeys);\n const selectedKeys = selectedKeysProp ?? selectedKeysState;\n const effectiveSize = configField ? 'sm' : size;\n\n if (onDelete) {\n menuActions.unshift({\n label: 'Delete',\n onClick: () => onDelete(selectedKeys),\n disabled:\n deleteDisabled ||\n selectedKeys == null ||\n (typeof selectedKeys === 'object' && [...selectedKeys].length === 0),\n });\n }\n\n const addButton = (\n <IconButton size='sm' onClick={onAdd} aria-label='Add item to list' disabled={addDisabled}>\n <PlusIcon />\n </IconButton>\n );\n\n return (\n <FormField\n label={label}\n helperText={helperText}\n errorText={errorText}\n warningText={warningText}\n labelProps={labelProps}\n helperProps={helperProps}\n errorProps={errorProps}\n warningProps={warningProps}\n inputId={inputId}\n configField={configField}\n rightActions={\n configField && (\n <>\n {menuActions.length > 0 && (\n <DropdownMenu\n trigger={\n <IconButton aria-label='Actions' size='sm'>\n <MoreIcon />\n </IconButton>\n }\n portal\n >\n {menuActions.map((action) => (\n <DropdownMenu.Item\n key={action.label}\n {...action}\n onClick={() => action.onClick(selectedKeys)}\n size={effectiveSize}\n >\n {action.label}\n </DropdownMenu.Item>\n ))}\n </DropdownMenu>\n )}\n {onAdd && !addDropdownConfig && addButton}\n {addDropdownConfig && (\n <DropdownMenu trigger={addButton} align='start' portal>\n {addDropdownConfig.options.map((option) => (\n <DropdownMenu.Item\n key={option.value}\n {...option}\n onClick={() => addDropdownConfig.onSelection(option.value)}\n size={effectiveSize}\n >\n {option.label}\n </DropdownMenu.Item>\n ))}\n </DropdownMenu>\n )}\n </>\n )\n }\n >\n <ListBox\n id={inputId}\n fullWidth={configField}\n size={effectiveSize}\n deleteDisabled={deleteDisabled}\n // We have to control the keys so we can power the `rightActions`\n selectedKeys={selectedKeys}\n onSelectionChange={(keys) => {\n onSelectionChange?.(keys);\n setSelectedKeys(keys);\n }}\n {...props}\n />\n </FormField>\n );\n};\n\nexport default ListBoxField;\n","import { Fragment, type MouseEvent, type ReactNode, useState } from 'react';\n\nimport { IconButton } from '@persona/design-system/components/Button';\nimport { useFormGroup } from '@persona/design-system/components/ConfigFormGroup';\nimport DropdownMenu from '@persona/design-system/components/DropdownMenu';\nimport type { FormLabelProps } from '@persona/design-system/components/FormControl';\nimport type { MenuItemProps } from '@persona/design-system/components/Menu';\nimport TableBox, { type TableBoxProps } from '@persona/design-system/components/TableBox';\nimport { MoreIcon, PlusIcon } from '@persona/icons';\n\nimport FormField from './FormField';\nimport type { ImplementsFormField } from './inputFields';\n\nexport interface TableBoxFieldAction extends Omit<MenuItemProps, 'children'> {\n label: string;\n onClick: (selectedKey: TableBoxProps['selectedKey']) => void;\n}\n\nexport interface TableBoxFieldActionGroup {\n type: 'group';\n heading: string;\n actions: TableBoxFieldAction[];\n}\n\nexport type TableBoxFieldActionEntry = TableBoxFieldAction | TableBoxFieldActionGroup;\n\n/** Aria-label on TableBoxField's + button. Consumers that style or detect that\n * button (e.g. popover toggle guards) should import this rather than redefining it. */\nexport const TABLE_BOX_FIELD_ADD_BUTTON_ARIA_LABEL = 'Add item to table';\n\nconst isActionGroup = (action: TableBoxFieldActionEntry): action is TableBoxFieldActionGroup =>\n 'type' in action && action.type === 'group';\n\ninterface AddDropdownConfig {\n options: Array<{ label: string; value: string }>;\n onSelection: (value: string) => void;\n}\n\ninterface TableBoxFieldProps<T extends object = object>\n extends ImplementsFormField, Omit<TableBoxProps<T>, 'aria-label' | 'onCreateNewRow'> {\n onAdd?: (e: MouseEvent<HTMLButtonElement>) => void;\n onDelete?: (selectedKey: string | null) => void;\n deleteDisabled?: boolean;\n /** Actions and labeled action groups rendered in order. Empty groups are omitted. */\n actions?: TableBoxFieldActionEntry[];\n addDropdownConfig?: AddDropdownConfig;\n\n /**\n * Callback to create a new row and add it to the rows array\n * Should return the id of the newly created row\n */\n createNewRow?: () => string;\n children?: ReactNode;\n}\n\nconst TableBoxField = <T extends object = object>({\n label,\n helperText,\n errorText,\n warningText,\n labelProps: labelPropsProp,\n helperProps,\n errorProps,\n warningProps,\n inputId,\n onAdd,\n onDelete,\n deleteDisabled,\n configField: configFieldProp = true,\n actions = [],\n addDropdownConfig,\n selectedKey: selectedKeyProp,\n onSelectionChange,\n defaultSelectedKey,\n selectionMode,\n disabled,\n createNewRow,\n children,\n emptyText = 'No data',\n ...props\n}: TableBoxFieldProps<T>) => {\n const { configField } = useFormGroup({ configField: configFieldProp });\n const menuActions: TableBoxFieldActionEntry[] = [...actions];\n const [selectedKeyState, setSelectedKey] = useState(defaultSelectedKey);\n const selectedKey = selectedKeyProp ?? selectedKeyState;\n const [newRowId, setNewRowId] = useState<string | null>(null);\n const labelProps: FormLabelProps = { size: 'sm', ...labelPropsProp };\n\n const handleCreateNewRow = () => {\n if (createNewRow) {\n setNewRowId(createNewRow());\n }\n };\n\n // Handle add button click\n const handleAddClick = (e: MouseEvent<HTMLButtonElement>) => {\n if (createNewRow) {\n handleCreateNewRow();\n } else if (onAdd) {\n onAdd(e);\n }\n };\n\n if (onDelete) {\n menuActions.unshift({\n label: 'Delete',\n onClick: () => selectedKey && onDelete(selectedKey),\n disabled: deleteDisabled || selectedKey == null,\n });\n }\n const visibleMenuActions = menuActions.filter(\n (action) => !isActionGroup(action) || action.actions.length > 0,\n );\n\n const addButton = (\n <IconButton\n size='sm'\n onClick={handleAddClick}\n aria-label={TABLE_BOX_FIELD_ADD_BUTTON_ARIA_LABEL}\n disabled={disabled}\n >\n <PlusIcon />\n </IconButton>\n );\n\n return (\n <FormField\n label={label}\n helperText={helperText}\n errorText={errorText}\n warningText={warningText}\n labelProps={labelProps}\n helperProps={helperProps}\n errorProps={errorProps}\n warningProps={warningProps}\n inputId={inputId}\n rightActions={\n configField && (\n <>\n {visibleMenuActions.length > 0 && (\n <DropdownMenu\n trigger={\n <IconButton aria-label='Actions' size='sm' disabled={disabled}>\n <MoreIcon />\n </IconButton>\n }\n portal\n >\n {visibleMenuActions.map((entry, entryIndex) => {\n const previousEntry = visibleMenuActions[entryIndex - 1];\n if (isActionGroup(entry)) {\n return (\n <Fragment key={`${entry.heading}-${entryIndex}`}>\n {entryIndex > 0 && <DropdownMenu.Divider />}\n <DropdownMenu.Heading size='sm'>{entry.heading}</DropdownMenu.Heading>\n {entry.actions.map((action) => (\n <DropdownMenu.Item\n key={action.label}\n {...action}\n disabled={disabled || action.disabled}\n onClick={() => action.onClick(selectedKey)}\n size='sm'\n >\n {action.label}\n </DropdownMenu.Item>\n ))}\n </Fragment>\n );\n }\n\n return (\n <Fragment key={`${entry.label}-${entryIndex}`}>\n {previousEntry && isActionGroup(previousEntry) && <DropdownMenu.Divider />}\n <DropdownMenu.Item\n {...entry}\n disabled={disabled || entry.disabled}\n onClick={() => entry.onClick(selectedKey)}\n size='sm'\n >\n {entry.label}\n </DropdownMenu.Item>\n </Fragment>\n );\n })}\n </DropdownMenu>\n )}\n {(onAdd || createNewRow) && !addDropdownConfig && addButton}\n {addDropdownConfig && (\n <DropdownMenu trigger={addButton} portal>\n {addDropdownConfig.options.map((option) => (\n <DropdownMenu.Item\n key={option.value}\n {...option}\n onClick={() => addDropdownConfig.onSelection(option.value)}\n size='sm'\n >\n {option.label}\n </DropdownMenu.Item>\n ))}\n </DropdownMenu>\n )}\n </>\n )\n }\n >\n <TableBox\n aria-label={`${label} table`}\n // We have to control the keys so we can power the `rightActions`\n selectedKey={selectedKey}\n onSelectionChange={(key) => {\n onSelectionChange?.(key);\n setSelectedKey(key);\n }}\n selectionMode={selectionMode}\n newRowId={newRowId}\n onCreateNewRow={createNewRow ? handleCreateNewRow : undefined}\n emptyText={emptyText}\n disabled={disabled}\n {...props}\n >\n {children}\n </TableBox>\n </FormField>\n );\n};\n\n// Attach subcomponents to TableBoxField\nTableBoxField.Row = TableBox.Row;\nTableBoxField.Cell = TableBox.Cell;\n\nexport default TableBoxField;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoFA,MAAa,YA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 +1,2 @@
1
- import { n as FormFieldBaseProps, r as FormFieldProps, t as FormField } from "./FormField-BcaFdmo5.mjs";
1
+ import { n as FormFieldBaseProps, r as FormFieldProps, t as FormField } from "./FormField-C1DaUT5U.mjs";
2
2
  export { FormField, FormField as default, FormFieldBaseProps, FormFieldProps };
@@ -1,5 +1,5 @@
1
- import { ComponentPropsWithoutRef, ReactNode } from "react";
2
1
  import * as _$styled_components0 from "styled-components";
2
+ import { ComponentPropsWithoutRef, ReactNode } from "react";
3
3
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
4
 
5
5
  //#region components/Card/Header/Header.d.ts
@@ -32,4 +32,4 @@ declare const Root: ({
32
32
  }: HeaderProps & ComponentPropsWithoutRef<"div">) => _$react_jsx_runtime0.JSX.Element;
33
33
  //#endregion
34
34
  export { Root as a, HeaderProps as i, Header as n, Title as o, HeaderContainer as r, TitleContainer as s, ActionsContainer as t };
35
- //# sourceMappingURL=Header-BjSoTEX_.d.mts.map
35
+ //# sourceMappingURL=Header-BKk3qESS.d.mts.map
package/dist/Header.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as Root, i as HeaderProps, n as Header, o as Title, r as HeaderContainer, s as TitleContainer, t as ActionsContainer } from "./Header-BjSoTEX_.mjs";
1
+ import { a as Root, i as HeaderProps, n as Header, o as Title, r as HeaderContainer, s as TitleContainer, t as ActionsContainer } from "./Header-BKk3qESS.mjs";
2
2
  export { ActionsContainer, HeaderContainer, HeaderProps, Root, Title, TitleContainer, Header as default };
@@ -1,4 +1,4 @@
1
- import { i as TooltipWithIconProps } from "./Tooltip-DabloV0o.mjs";
1
+ import { i as TooltipWithIconProps } from "./Tooltip-n3XkX4dp.mjs";
2
2
  import { ReactNode } from "react";
3
3
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
4
 
@@ -17,4 +17,4 @@ declare const HelperTooltip: ({
17
17
  }: HelperTooltipProps) => _$react_jsx_runtime0.JSX.Element;
18
18
  //#endregion
19
19
  export { HelperTooltipProps as n, HelperTooltip as t };
20
- //# sourceMappingURL=HelperTooltip-S20wVFCS.d.mts.map
20
+ //# sourceMappingURL=HelperTooltip-CD_yy7Hp.d.mts.map
@@ -1,2 +1,2 @@
1
- import { n as HelperTooltipProps, t as HelperTooltip } from "./HelperTooltip-S20wVFCS.mjs";
1
+ import { n as HelperTooltipProps, t as HelperTooltip } from "./HelperTooltip-CD_yy7Hp.mjs";
2
2
  export { HelperTooltipProps, HelperTooltip as default };
@@ -1,10 +1,10 @@
1
1
  import { a as styled } from "./styledComponentsInterop-8zScIQyC.mjs";
2
+ import "./variables/transitions.mjs";
2
3
  import { t as Card_default } from "./Card-CKrJtn1f.mjs";
3
4
  import { i as Paragraph } from "./Text-B0orb-cZ.mjs";
4
5
  import { t as useToggle } from "./useToggle-Bo3yd14Y.mjs";
5
6
  import { fadeIn } from "./variables/keyframes.mjs";
6
- import "./variables/transitions.mjs";
7
- import { n as Button } from "./IconButton-BgL3QUVO.mjs";
7
+ import { n as Button } from "./IconButton-BnSEV7eR.mjs";
8
8
  import { s as Popover_default } from "./Popover-DlXyKYL5.mjs";
9
9
  import { Spacing } from "@persona/design-tokens";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -111,4 +111,4 @@ const HoverCopyableField = ({ copyValue, confirmationText = "Copied", onCopySucc
111
111
  //#endregion
112
112
  export { HoverCopyableField as t };
113
113
 
114
- //# sourceMappingURL=HoverCopyableField-GMXeF-3J.mjs.map
114
+ //# sourceMappingURL=HoverCopyableField-Bgt639FR.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"HoverCopyableField-GMXeF-3J.mjs","names":["Card","Popover"],"sources":["../components/HoverCopyableField/HoverCopyableField.tsx"],"sourcesContent":["import type { MouseEvent, ReactNode } from 'react';\nimport styled from 'styled-components';\n\nimport { Spacing } from '@persona/design-tokens';\nimport { CopyIcon } from '@persona/icons';\nimport Button from 'design-system/components/Button';\nimport Card from 'design-system/components/Card';\nimport Popover from 'design-system/components/Popover';\nimport { Paragraph } from 'design-system/components/Text';\nimport useToggle from 'design-system/lib/useToggle';\nimport { fadeIn } from 'design-system/variables/keyframes';\nimport { TransitionDuration } from 'design-system/variables/transitions';\n\nexport type CopySuccessDetail = {\n text: string;\n clientX: number;\n clientY: number;\n};\n\nexport type HoverCopyableFieldProps = {\n copyValue: string | undefined;\n confirmationText?: string;\n /**\n * Called after a successful clipboard write. When provided, the Copied\n * popover is skipped so the host can own post-copy UX.\n */\n onCopySuccess?: (detail: CopySuccessDetail) => void;\n children: ReactNode;\n};\n\nconst copyToClipboard = async (text: string): Promise<boolean> => {\n try {\n if ('clipboard' in navigator) {\n await navigator.clipboard.writeText(text);\n return true;\n } else {\n return document.execCommand('copy', true, text);\n }\n } catch {\n return false;\n }\n};\n\nconst clickOrigin = (e: MouseEvent<HTMLButtonElement>): { clientX: number; clientY: number } => {\n const rect = e.currentTarget.getBoundingClientRect();\n const hasPointer = e.clientX !== 0 || e.clientY !== 0;\n return {\n clientX: hasPointer ? e.clientX : rect.left + rect.width / 2,\n clientY: rect.top,\n };\n};\n\nconst CopyableFieldContainer = styled.div`\n display: flex;\n gap: ${Spacing[1]};\n align-items: center;\n`;\n\nconst CopyButton = styled(Button).attrs(() => ({\n type: 'button',\n variant: 'inverse',\n width: 'icon',\n}))<{ isActive: boolean }>`\n height: ${Spacing[5]};\n width: ${Spacing[5]};\n visibility: ${({ isActive }) => (isActive ? 'visible' : 'hidden')};\n animation: ${fadeIn} ${TransitionDuration.Medium} ease-in-out;\n svg {\n width: 14px;\n height: 14px;\n }\n`;\n\nconst StyledCard = styled(Card)`\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n animation: ${fadeIn} ${TransitionDuration.Medium} ease-in-out;\n padding: 6px;\n margin: 0;\n`;\n\nconst HoverCopyableField = ({\n copyValue,\n confirmationText = 'Copied',\n onCopySuccess,\n children,\n}: HoverCopyableFieldProps) => {\n const [copyButtonActive, { enable: showCopyButton, disable: hideCopyButton }] = useToggle(false);\n const [confirmationActive, { enable: showConfirmation, disable: hideConfirmation }] =\n useToggle(false);\n\n const copyTextToClipboard = async (origin: { clientX: number; clientY: number }) => {\n if (copyValue == null) {\n return;\n }\n const copyWasSuccessful = await copyToClipboard(copyValue);\n if (!copyWasSuccessful) {\n return;\n }\n if (onCopySuccess) {\n onCopySuccess({ text: copyValue, ...origin });\n hideCopyButton();\n return;\n }\n showConfirmation();\n setTimeout(() => {\n hideCopyButton();\n hideConfirmation();\n }, 1200);\n };\n\n const copyField = (e: MouseEvent<HTMLButtonElement>) => {\n e.preventDefault();\n e.stopPropagation();\n void copyTextToClipboard(clickOrigin(e));\n };\n\n return copyValue != null && copyValue.trim().length > 0 ? (\n <CopyableFieldContainer onMouseEnter={showCopyButton} onMouseLeave={hideCopyButton}>\n {children}\n <Popover open={confirmationActive}>\n <Popover.Anchor asChild>\n <CopyButton\n id='hover-copyable-field__copy-button'\n isActive={copyButtonActive || confirmationActive}\n onClick={copyField}\n >\n <CopyIcon width={16} height={16} />\n </CopyButton>\n </Popover.Anchor>\n <Popover.Content side='top' align='center' style={{ zIndex: 2 }}>\n <StyledCard elevated>\n <Paragraph>{confirmationText}</Paragraph>\n </StyledCard>\n </Popover.Content>\n </Popover>\n </CopyableFieldContainer>\n ) : null;\n};\n\nexport default HoverCopyableField;\n"],"mappings":";;;;;;;;;;;;AA8BA,MAAM,kBAAkB,OAAO,SAAmC;AAChE,KAAI;AACF,MAAI,eAAe,WAAW;AAC5B,SAAM,UAAU,UAAU,UAAU,KAAK;AACzC,UAAO;QAEP,QAAO,SAAS,YAAY,QAAQ,MAAM,KAAK;SAE3C;AACN,SAAO;;;AAIX,MAAM,eAAe,MAA2E;CAC9F,MAAM,OAAO,EAAE,cAAc,uBAAuB;AAEpD,QAAO;EACL,SAFiB,EAAE,YAAY,KAAK,EAAE,YAAY,IAE5B,EAAE,UAAU,KAAK,OAAO,KAAK,QAAQ;EAC3D,SAAS,KAAK;EACf;;AAGH,MAAM,yBAAyB,OAA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;IAAM,OAAM;IAAS,OAAO,EAAE,QAAQ,GAAG;cAC7D,oBAAC,YAAD;KAAY,UAAA;eACV,oBAAC,WAAD,EAAA,UAAY,kBAA6B,CAAA;KAC9B,CAAA;IACG,CAAA,CACV;KACa;MACvB"}
1
+ {"version":3,"file":"HoverCopyableField-Bgt639FR.mjs","names":["Card","Popover"],"sources":["../components/HoverCopyableField/HoverCopyableField.tsx"],"sourcesContent":["import type { MouseEvent, ReactNode } from 'react';\nimport styled from 'styled-components';\n\nimport { Spacing } from '@persona/design-tokens';\nimport { CopyIcon } from '@persona/icons';\nimport Button from 'design-system/components/Button';\nimport Card from 'design-system/components/Card';\nimport Popover from 'design-system/components/Popover';\nimport { Paragraph } from 'design-system/components/Text';\nimport useToggle from 'design-system/lib/useToggle';\nimport { fadeIn } from 'design-system/variables/keyframes';\nimport { TransitionDuration } from 'design-system/variables/transitions';\n\nexport type CopySuccessDetail = {\n text: string;\n clientX: number;\n clientY: number;\n};\n\nexport type HoverCopyableFieldProps = {\n copyValue: string | undefined;\n confirmationText?: string;\n /**\n * Called after a successful clipboard write. When provided, the Copied\n * popover is skipped so the host can own post-copy UX.\n */\n onCopySuccess?: (detail: CopySuccessDetail) => void;\n children: ReactNode;\n};\n\nconst copyToClipboard = async (text: string): Promise<boolean> => {\n try {\n if ('clipboard' in navigator) {\n await navigator.clipboard.writeText(text);\n return true;\n } else {\n return document.execCommand('copy', true, text);\n }\n } catch {\n return false;\n }\n};\n\nconst clickOrigin = (e: MouseEvent<HTMLButtonElement>): { clientX: number; clientY: number } => {\n const rect = e.currentTarget.getBoundingClientRect();\n const hasPointer = e.clientX !== 0 || e.clientY !== 0;\n return {\n clientX: hasPointer ? e.clientX : rect.left + rect.width / 2,\n clientY: rect.top,\n };\n};\n\nconst CopyableFieldContainer = styled.div`\n display: flex;\n gap: ${Spacing[1]};\n align-items: center;\n`;\n\nconst CopyButton = styled(Button).attrs(() => ({\n type: 'button',\n variant: 'inverse',\n width: 'icon',\n}))<{ isActive: boolean }>`\n height: ${Spacing[5]};\n width: ${Spacing[5]};\n visibility: ${({ isActive }) => (isActive ? 'visible' : 'hidden')};\n animation: ${fadeIn} ${TransitionDuration.Medium} ease-in-out;\n svg {\n width: 14px;\n height: 14px;\n }\n`;\n\nconst StyledCard = styled(Card)`\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n animation: ${fadeIn} ${TransitionDuration.Medium} ease-in-out;\n padding: 6px;\n margin: 0;\n`;\n\nconst HoverCopyableField = ({\n copyValue,\n confirmationText = 'Copied',\n onCopySuccess,\n children,\n}: HoverCopyableFieldProps) => {\n const [copyButtonActive, { enable: showCopyButton, disable: hideCopyButton }] = useToggle(false);\n const [confirmationActive, { enable: showConfirmation, disable: hideConfirmation }] =\n useToggle(false);\n\n const copyTextToClipboard = async (origin: { clientX: number; clientY: number }) => {\n if (copyValue == null) {\n return;\n }\n const copyWasSuccessful = await copyToClipboard(copyValue);\n if (!copyWasSuccessful) {\n return;\n }\n if (onCopySuccess) {\n onCopySuccess({ text: copyValue, ...origin });\n hideCopyButton();\n return;\n }\n showConfirmation();\n setTimeout(() => {\n hideCopyButton();\n hideConfirmation();\n }, 1200);\n };\n\n const copyField = (e: MouseEvent<HTMLButtonElement>) => {\n e.preventDefault();\n e.stopPropagation();\n void copyTextToClipboard(clickOrigin(e));\n };\n\n return copyValue != null && copyValue.trim().length > 0 ? (\n <CopyableFieldContainer onMouseEnter={showCopyButton} onMouseLeave={hideCopyButton}>\n {children}\n <Popover open={confirmationActive}>\n <Popover.Anchor asChild>\n <CopyButton\n id='hover-copyable-field__copy-button'\n isActive={copyButtonActive || confirmationActive}\n onClick={copyField}\n >\n <CopyIcon width={16} height={16} />\n </CopyButton>\n </Popover.Anchor>\n <Popover.Content side='top' align='center' style={{ zIndex: 2 }}>\n <StyledCard elevated>\n <Paragraph>{confirmationText}</Paragraph>\n </StyledCard>\n </Popover.Content>\n </Popover>\n </CopyableFieldContainer>\n ) : null;\n};\n\nexport default Ho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AAE,gBAAgB;AAClB,IAAE,iBAAiB;AACd,sBAAoB,YAAY,EAAE,CAAC;;AAG1C,QAAO,aAAa,QAAQ,UAAU,MAAM,CAAC,SAAS,IACpD,qBAAC,wBAAD;EAAwB,cAAc;EAAgB,cAAc;YAApE,CACG,UACD,qBAACC,iBAAD;GAAS,MAAM;aAAf,CACE,oBAACA,gBAAQ,QAAT;IAAgB,SAAA;cACd,oBAAC,YAAD;KACE,IAAG;KACH,UAAU,oBAAoB;KAC9B,SAAS;eAET,oBAAC,UAAD;MAAU,OAAO;MAAI,QAAQ;MAAM,CAAA;KACxB,CAAA;IACE,CAAA,EACjB,oBAACA,gBAAQ,SAAT;IAAiB,MAAK;IAAM,OAAM;IAAS,OAAO,EAAE,QAAQ,GAAG;cAC7D,oBAAC,YAAD;KAAY,UAAA;eACV,oBAAC,WAAD,EAAA,UAAY,kBAA6B,CAAA;KAC9B,CAAA;IACG,CAAA,CACV;KACa;MACvB"}
@@ -1,4 +1,4 @@
1
- import { r as ButtonProps } from "./Button-BrI1s2-r.mjs";
1
+ import { r as ButtonProps } from "./Button-CRFbWv3l.mjs";
2
2
  import * as _$react from "react";
3
3
 
4
4
  //#region components/Button/IconButton.d.ts
@@ -21,4 +21,4 @@ interface IconButtonProps extends Omit<ButtonProps, 'width' | 'prefixIcon' | 'pr
21
21
  declare const IconButton: _$react.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & _$react.RefAttributes<HTMLButtonElement>>;
22
22
  //#endregion
23
23
  export { IconButtonProps as n, IconButton as t };
24
- //# sourceMappingURL=IconButton-BpyOr8Ev.d.mts.map
24
+ //# sourceMappingURL=IconButton-Bh-JJ-0x.d.mts.map
@@ -1,11 +1,11 @@
1
1
  import { a as styled, r as css } from "./styledComponentsInterop-8zScIQyC.mjs";
2
- import { paragraphMixins } from "./mixins/text.mjs";
3
- import { t as useToggle } from "./useToggle-Bo3yd14Y.mjs";
4
- import { rotate } from "./variables/keyframes.mjs";
5
- import "./variables/transitions.mjs";
6
2
  import { isDisabled, isHovered, isNotDisabled } from "./lib/pseudoClass.mjs";
7
3
  import { focusOutlineControlled } from "./mixins/focus.mjs";
4
+ import "./variables/transitions.mjs";
8
5
  import { printMixins } from "./mixins/print/index.mjs";
6
+ import { paragraphMixins } from "./mixins/text.mjs";
7
+ import { t as useToggle } from "./useToggle-Bo3yd14Y.mjs";
8
+ import { rotate } from "./variables/keyframes.mjs";
9
9
  import { BorderRadius, Color, Spacing } from "@persona/design-tokens";
10
10
  import { forwardRef, useCallback } from "react";
11
11
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -338,4 +338,4 @@ const IconButton = forwardRef(function IconButton({ size = "xs", ...props }, ref
338
338
  //#endregion
339
339
  export { SuffixIconContainer as a, StyledButton as i, Button as n, ButtonChildren as r, IconButton as t };
340
340
 
341
- //# sourceMappingURL=IconButton-BgL3QUVO.mjs.map
341
+ //# sourceMappingURL=IconButton-BnSEV7eR.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton-BgL3QUVO.mjs","names":["noop"],"sources":["../components/Button/Button.tsx","../components/Button/IconButton.tsx"],"sourcesContent":["import { isEmpty, isFunction } from 'lodash-es';\nimport {\n type ComponentPropsWithoutRef,\n forwardRef,\n type MouseEvent,\n type ReactNode,\n type Ref,\n useCallback,\n} from 'react';\nimport { Link, type LinkProps } from 'react-router-dom';\nimport styled, {\n css,\n type DefaultTheme,\n type FlattenInterpolation,\n type ThemeProps,\n} from 'styled-components';\n\nimport { Color, Spacing } from '@persona/design-tokens';\nimport { LoaderIcon } from '@persona/icons';\nimport { isDisabled, isHovered, isNotDisabled } from 'design-system/lib/pseudoClass';\nimport useToggle from 'design-system/lib/useToggle';\nimport { focusOutlineControlled } from 'design-system/mixins/focus';\nimport { printMixins } from 'design-system/mixins/print';\nimport { paragraphMixins } from 'design-system/mixins/text';\nimport type PseudoClassProps from 'design-system/types/PseudoClassProps';\nimport { rotate } from 'design-system/variables/keyframes';\nimport { TransitionDuration } from 'design-system/variables/transitions';\n\nconst noop = (): void => undefined;\n\n// TODO(joseph): Bring this fix back to pseudoClass\nconst isActive = ({ active }: PseudoClassProps) => (active ? '' : ':active:enabled');\n\n/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\nconst sizeStyles: Record<ButtonProps['size'], FlattenInterpolation<ThemeProps<DefaultTheme>>> = {\n md: css`\n ${paragraphMixins.md}\n height: ${({ theme }) => theme.button.height.md};\n padding: ${Spacing[2]};\n svg {\n height: 16px;\n width: 16px;\n }\n `,\n sm: css`\n ${paragraphMixins.sm}\n height: ${({ theme }) => theme.button.height.sm};\n padding: ${Spacing[1]} 6px;\n svg {\n height: 16px;\n width: 16px;\n }\n `,\n};\n\n/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\nconst widthStyles: Record<ButtonProps['width'], FlattenInterpolation<ThemeProps<DefaultTheme>>> = {\n full: css`\n width: 100%;\n `,\n auto: css`\n width: auto;\n `,\n // TODO: rename this prop to 'element' as a standard unresponsive element width\n button: css`\n width: ${({ theme }) => theme.element.width.md};\n `,\n icon: css<ButtonProps>`\n width: ${({ theme, size }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return theme.button.height[size];\n }};\n padding: 0;\n flex: none;\n `,\n};\n\ninterface ButtonPropsWithTransientProps extends Omit<ButtonProps, 'isPending'> {\n $isPending: boolean;\n $onSecondaryBackground?: boolean;\n}\n\nexport const StyledButton = styled.button.attrs<ButtonPropsWithTransientProps>(({ to, target }) => {\n if (isEmpty(to)) {\n return 'button';\n } else if (typeof to === 'string' && to.startsWith('https://')) {\n return {\n as: 'a',\n href: to,\n target: target ?? '_blank',\n rel: 'noreferrer',\n };\n } else {\n return {\n as: Link,\n };\n }\n})<ButtonPropsWithTransientProps>`\n cursor: pointer;\n border: none;\n box-sizing: border-box;\n white-space: nowrap;\n ${({ theme, variant }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n const palette = theme.color.variants[variant] as any;\n return css`\n &:disabled {\n background-color: ${palette.disabled};\n color: ${palette.textDisabled};\n svg path {\n stroke: ${palette.textDisabled};\n }\n\n /* For backwards compatibility with current coloring scheme (targeting stroke property) */\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n /* Support icons with stroke */\n path[stroke] {\n stroke: currentColor;\n }\n }\n\n user-select: none;\n }\n `;\n }}\n\n ${({ variant }) =>\n variant === 'outline' &&\n css`\n border: 1px solid ${({ theme }) => theme.color.border.input};\n `}\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n /* To properly position loading spinner */\n position: relative;\n\n border-radius: ${({ theme }) => theme.button.borderRadius};\n\n transition-duration: ${TransitionDuration.Fast};\n transition-property: background-color, color, border-color, width, height;\n\n ${({ size }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return sizeStyles[size];\n }}\n ${({ width }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return widthStyles[width];\n }}\n\n /* Variant styling */\n ${({ theme, variant, $isPending, $onSecondaryBackground }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n let palette = theme.color.variants[variant] as any;\n\n if (variant === 'basic' && $onSecondaryBackground) {\n palette = {\n ...palette,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n default: Color.CoreSlate300,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n hover: Color.CoreSlate400,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n active: Color.CoreSlate400,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n disabled: Color.CoreSlate100,\n };\n }\n\n return css`\n background-color: ${palette.default};\n color: ${palette.text};\n svg path {\n stroke: ${palette.text};\n }\n\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n path[stroke] {\n stroke: currentColor;\n }\n }\n\n &${isHovered}${isNotDisabled} {\n background-color: ${palette.hover};\n }\n\n &${isDisabled} {\n cursor: not-allowed;\n }\n\n &${isActive} {\n background-color: ${palette.active};\n }\n\n ${focusOutlineControlled}\n\n ${\n $isPending &&\n css`\n cursor: default;\n background-color: ${palette.active};\n &:disabled {\n background-color: ${({ theme }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return theme.color.variants[variant].active;\n }};\n user-select: none;\n }\n\n svg path {\n stroke: ${palette.highlightDark};\n }\n\n // For backwards compatibility with current coloring scheme (targeting stroke property)\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n path[stroke] {\n stroke: currentColor;\n }\n }\n `\n }\n `;\n }}\n\n\n ${printMixins.hide}\n`;\n\ntype WithPendingProps = Pick<ButtonProps, 'isPending'>;\n\nconst LoaderContainer = styled.div<WithPendingProps>`\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: opacity 2s;\n opacity: ${({ isPending }) => (isPending ? '1' : '0')};\n`;\n\nconst Loader = styled(LoaderIcon)`\n animation: ${rotate} linear 1s infinite;\n`;\n\nexport const ButtonChildren = styled('div').attrs(({ isPending }: WithPendingProps) => ({\n ['aria-hidden']: isPending,\n}))<WithPendingProps>`\n width: 100%;\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n justify-content: center;\n transition: opacity ${TransitionDuration.Fast};\n opacity: ${({ isPending }) => (isPending ? '0' : '1')};\n gap: ${Spacing[1]};\n`;\n\nconst PrefixIconContainer = styled.div`\n display: flex;\n align-items: center;\n`;\n\nconst InheritPrefixIconContainer = styled.div`\n display: flex;\n align-items: center;\n\n & svg {\n width: inherit;\n height: inherit;\n }\n`;\n\nexport const SuffixIconContainer = styled(PrefixIconContainer)`\n margin-right: 0;\n flex-grow: 1;\n justify-content: flex-end;\n`;\n\nconst ButtonText = styled.span<{ size: 'md' | 'sm'; width: 'full' | 'auto' | 'button' | 'icon' }>`\n position: relative;\n\n /* Needed to align for browsers that don't support text-box yet\n (which at this time, is firefox, and opera, and a few niche browsers)\n This checks firefox. Otherwise, it will default back to the original\n which is a slightly misaligned button\n */\n\n /* Was trying to use this with @supports not, but genuinely could not figure out why this wouldn't\n work */\n\n line-height: ${({ width }) => (width === 'icon' ? '0' : 'inherit')};\n @-moz-document url-prefix() {\n top: ${({ size }) => (size === 'md' ? '1px' : '0.5px')};\n }\n\n @supports (text-box: cap alphabetic) {\n text-box: ${({ width }) => (width === 'icon' ? 'normal' : 'cap alphabetic')};\n }\n`;\n\ntype MaybePromise =\n | ((e: MouseEvent<HTMLButtonElement>) => void)\n | ((e: MouseEvent<HTMLButtonElement>) => Promise<void>);\n\nexport interface ButtonProps\n extends ComponentPropsWithoutRef<'button'>, Omit<PseudoClassProps, 'checked'> {\n /**\n * Visual style of the button.\n *\n * - `primary` – filled brand colour, for the primary action on a surface.\n * - `basic` – subtle grey fill, for secondary actions.\n * - `outline` – transparent with a border, alternative secondary style.\n * - `text` – no background or border, for tertiary / inline actions.\n * - `inverse` – inverted fill for use on dark/coloured backgrounds.\n * - `danger` – red fill, for destructive actions.\n *\n * @defaultValue 'primary'\n */\n variant?: 'basic' | 'primary' | 'inverse' | 'danger' | 'text' | 'outline';\n /**\n * Shows a loading spinner and disables the button. Also triggers automatically\n * when `onClick` returns a Promise, clearing once the promise settles.\n */\n isPending?: boolean;\n /**\n * Icon rendered to the left of the button label.\n * Import from `@persona/icons`.\n */\n prefixIcon?: ReactNode;\n /**\n * Controls how the prefix icon inherits sizing.\n *\n * - `basic` – icon is rendered inside a fixed-size container.\n * - `inherit` – icon stretches to fill the surrounding element's dimensions.\n *\n * @defaultValue 'basic'\n */\n prefixIconType?: 'basic' | 'inherit';\n\n /**\n * Icon rendered to the right of the button label.\n * Import from `@persona/icons`.\n */\n suffixIcon?: ReactNode;\n\n /**\n * Height and typography scale of the button.\n *\n * @defaultValue 'md'\n */\n size?: 'md' | 'sm';\n\n /**\n * Changes the button into a link.\n * Pass a relative path to use `react-router-dom` `<Link>`, or an absolute\n * `https://` URL to render an `<a>` tag that opens in a new tab.\n */\n to?: LinkProps['to'];\n\n /**\n * Overrides the target of the link if `to` is provided and is an external link.\n */\n target?: LinkProps['target'];\n\n /**\n * Note: we may want to default this to 'button' in the future, but many instances of this Button component\n * in dashboard currently rely on the default 'submit' behavior that occurs when using this in redux-form\n * so we'll have to comb through and manually add the type='submit' prop.\n */\n type?: 'button' | 'reset' | 'submit';\n /**\n * Controls the width of the button.\n *\n * - `full` – stretches to fill its container (`width: 100%`).\n * - `auto` – shrinks to fit its content.\n * - `button` – a fixed medium element width (from design tokens).\n * - `icon` – square, sized to match the button height; use for icon-only buttons.\n *\n * @defaultValue 'full'\n */\n width?: 'full' | 'auto' | 'button' | 'icon';\n onClick?: MaybePromise;\n ref?: Ref<HTMLButtonElement>;\n\n /**\n * In some cases we render a button on a secondary background, which needs an adjustment\n * for certain variants.\n */\n onSecondaryBackground?: boolean;\n}\n\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n id,\n children,\n prefixIcon,\n suffixIcon,\n disabled,\n isPending,\n type = 'button',\n prefixIconType = 'basic',\n variant = 'primary',\n size = 'md',\n width = 'full',\n onClick,\n onSecondaryBackground,\n ...props\n }: ButtonProps,\n ref,\n) {\n const [isResolving, { enable, disable }] = useToggle(false);\n const innerOnClick: MaybePromise = isFunction(onClick) ? onClick : noop;\n const loading = isPending || isResolving;\n\n const handleClick = useCallback(\n async (e: MouseEvent<HTMLButtonElement>) => {\n if (loading) {\n return;\n }\n\n const maybePromise = innerOnClick(e);\n\n if (maybePromise instanceof Promise) {\n enable();\n await maybePromise;\n disable();\n }\n },\n [loading, innerOnClick],\n );\n\n return (\n <StyledButton\n id={id}\n type={type}\n data-test={'button__' + variant}\n variant={variant}\n size={size}\n width={width}\n disabled={disabled || loading}\n $isPending={loading}\n $onSecondaryBackground={onSecondaryBackground}\n {...props}\n onClick={handleClick}\n ref={ref}\n >\n {loading && (\n <LoaderContainer isPending={loading}>\n <Loader aria-label={`Loading ${props['aria-label'] || ''}`} />\n </LoaderContainer>\n )}\n <ButtonChildren isPending={loading}>\n {prefixIcon != null && (\n <>\n {prefixIconType === 'basic' && <PrefixIconContainer>{prefixIcon}</PrefixIconContainer>}\n {prefixIconType === 'inherit' && (\n <InheritPrefixIconContainer>{prefixIcon}</InheritPrefixIconContainer>\n )}\n </>\n )}\n {children && (\n <ButtonText width={width} size={size}>\n {children}\n </ButtonText>\n )}\n {suffixIcon != null && <SuffixIconContainer>{suffixIcon}</SuffixIconContainer>}\n </ButtonChildren>\n </StyledButton>\n );\n});\n\nexport default Button;\n","import { forwardRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { BorderRadius } from '@persona/design-tokens';\n\nimport Button, { type ButtonProps } from './Button';\n\nconst BUTTON_SIZE_MAP = {\n xs: '16px',\n sm: '24px',\n md: '32px',\n};\n\nconst ICON_SIZE_MAP = {\n xs: '12px',\n sm: '16px',\n md: '16px',\n};\n\ntype IconBtnSize = keyof typeof BUTTON_SIZE_MAP;\n\nconst IconBtn = styled(Button).attrs({\n width: 'icon',\n variant: 'basic',\n})`\n background-color: transparent;\n padding: 0;\n border-radius: ${BorderRadius.Md};\n\n ${({ size }) => css`\n height: ${BUTTON_SIZE_MAP[size as IconBtnSize]};\n width: ${BUTTON_SIZE_MAP[size as IconBtnSize]};\n\n svg {\n width: ${ICON_SIZE_MAP[size as IconBtnSize]};\n height: ${ICON_SIZE_MAP[size as IconBtnSize]};\n }\n `}\n`;\n\nexport interface IconButtonProps extends Omit<\n ButtonProps,\n 'width' | 'prefixIcon' | 'prefixIconType' | 'suffixIcon' | 'variant' | 'size'\n> {\n /**\n * `xs` - 16px. `sm` - 24px. `md` - 32px.\n * Pair with a PDS icon in the prescribed size.\n */\n size?: IconBtnSize;\n}\n\n/**\n * Use to render icon-only buttons. Ensure buttons have proper aria properties.\n */\nconst IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n { size = 'xs', ...props },\n ref,\n) {\n return <IconBtn size={size as ButtonProps['size']} ref={ref} {...props} />;\n});\n\nexport default IconButton;\n"],"mappings":";;;;;;;;;;;;;;;AA4BA,MAAMA,eAAmB,KA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,gBAAgB,MAAqB;;;eAGnC,cAAc,MAAqB;gBAClC,cAAc,MAAqB;;IAE/C;;;;;AAiBJ,MAAM,aAAa,WAA+C,SAAS,WACzE,EAAE,OAAO,MAAM,GAAG,SAClB,KACA;AACA,QAAO,oBAAC,SAAD;EAAe;EAAkC;EAAK,GAAI;EAAS,CAAA;EAC1E"}
1
+ {"version":3,"file":"IconButton-BnSEV7eR.mjs","names":["noop"],"sources":["../components/Button/Button.tsx","../components/Button/IconButton.tsx"],"sourcesContent":["import { isEmpty, isFunction } from 'lodash-es';\nimport {\n type ComponentPropsWithoutRef,\n forwardRef,\n type MouseEvent,\n type ReactNode,\n type Ref,\n useCallback,\n} from 'react';\nimport { Link, type LinkProps } from 'react-router-dom';\nimport styled, {\n css,\n type DefaultTheme,\n type FlattenInterpolation,\n type ThemeProps,\n} from 'styled-components';\n\nimport { Color, Spacing } from '@persona/design-tokens';\nimport { LoaderIcon } from '@persona/icons';\nimport { isDisabled, isHovered, isNotDisabled } from 'design-system/lib/pseudoClass';\nimport useToggle from 'design-system/lib/useToggle';\nimport { focusOutlineControlled } from 'design-system/mixins/focus';\nimport { printMixins } from 'design-system/mixins/print';\nimport { paragraphMixins } from 'design-system/mixins/text';\nimport type PseudoClassProps from 'design-system/types/PseudoClassProps';\nimport { rotate } from 'design-system/variables/keyframes';\nimport { TransitionDuration } from 'design-system/variables/transitions';\n\nconst noop = (): void => undefined;\n\n// TODO(joseph): Bring this fix back to pseudoClass\nconst isActive = ({ active }: PseudoClassProps) => (active ? '' : ':active:enabled');\n\n/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\nconst sizeStyles: Record<ButtonProps['size'], FlattenInterpolation<ThemeProps<DefaultTheme>>> = {\n md: css`\n ${paragraphMixins.md}\n height: ${({ theme }) => theme.button.height.md};\n padding: ${Spacing[2]};\n svg {\n height: 16px;\n width: 16px;\n }\n `,\n sm: css`\n ${paragraphMixins.sm}\n height: ${({ theme }) => theme.button.height.sm};\n padding: ${Spacing[1]} 6px;\n svg {\n height: 16px;\n width: 16px;\n }\n `,\n};\n\n/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\nconst widthStyles: Record<ButtonProps['width'], FlattenInterpolation<ThemeProps<DefaultTheme>>> = {\n full: css`\n width: 100%;\n `,\n auto: css`\n width: auto;\n `,\n // TODO: rename this prop to 'element' as a standard unresponsive element width\n button: css`\n width: ${({ theme }) => theme.element.width.md};\n `,\n icon: css<ButtonProps>`\n width: ${({ theme, size }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return theme.button.height[size];\n }};\n padding: 0;\n flex: none;\n `,\n};\n\ninterface ButtonPropsWithTransientProps extends Omit<ButtonProps, 'isPending'> {\n $isPending: boolean;\n $onSecondaryBackground?: boolean;\n}\n\nexport const StyledButton = styled.button.attrs<ButtonPropsWithTransientProps>(({ to, target }) => {\n if (isEmpty(to)) {\n return 'button';\n } else if (typeof to === 'string' && to.startsWith('https://')) {\n return {\n as: 'a',\n href: to,\n target: target ?? '_blank',\n rel: 'noreferrer',\n };\n } else {\n return {\n as: Link,\n };\n }\n})<ButtonPropsWithTransientProps>`\n cursor: pointer;\n border: none;\n box-sizing: border-box;\n white-space: nowrap;\n ${({ theme, variant }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n const palette = theme.color.variants[variant] as any;\n return css`\n &:disabled {\n background-color: ${palette.disabled};\n color: ${palette.textDisabled};\n svg path {\n stroke: ${palette.textDisabled};\n }\n\n /* For backwards compatibility with current coloring scheme (targeting stroke property) */\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n /* Support icons with stroke */\n path[stroke] {\n stroke: currentColor;\n }\n }\n\n user-select: none;\n }\n `;\n }}\n\n ${({ variant }) =>\n variant === 'outline' &&\n css`\n border: 1px solid ${({ theme }) => theme.color.border.input};\n `}\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n /* To properly position loading spinner */\n position: relative;\n\n border-radius: ${({ theme }) => theme.button.borderRadius};\n\n transition-duration: ${TransitionDuration.Fast};\n transition-property: background-color, color, border-color, width, height;\n\n ${({ size }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return sizeStyles[size];\n }}\n ${({ width }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return widthStyles[width];\n }}\n\n /* Variant styling */\n ${({ theme, variant, $isPending, $onSecondaryBackground }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n let palette = theme.color.variants[variant] as any;\n\n if (variant === 'basic' && $onSecondaryBackground) {\n palette = {\n ...palette,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n default: Color.CoreSlate300,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n hover: Color.CoreSlate400,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n active: Color.CoreSlate400,\n // eslint-disable-next-line rulesdir/no-core-color-tokens\n disabled: Color.CoreSlate100,\n };\n }\n\n return css`\n background-color: ${palette.default};\n color: ${palette.text};\n svg path {\n stroke: ${palette.text};\n }\n\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n path[stroke] {\n stroke: currentColor;\n }\n }\n\n &${isHovered}${isNotDisabled} {\n background-color: ${palette.hover};\n }\n\n &${isDisabled} {\n cursor: not-allowed;\n }\n\n &${isActive} {\n background-color: ${palette.active};\n }\n\n ${focusOutlineControlled}\n\n ${\n $isPending &&\n css`\n cursor: default;\n background-color: ${palette.active};\n &:disabled {\n background-color: ${({ theme }) => {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n return theme.color.variants[variant].active;\n }};\n user-select: none;\n }\n\n svg path {\n stroke: ${palette.highlightDark};\n }\n\n // For backwards compatibility with current coloring scheme (targeting stroke property)\n svg.pds-icon {\n path {\n stroke: unset;\n }\n\n path[stroke] {\n stroke: currentColor;\n }\n }\n `\n }\n `;\n }}\n\n\n ${printMixins.hide}\n`;\n\ntype WithPendingProps = Pick<ButtonProps, 'isPending'>;\n\nconst LoaderContainer = styled.div<WithPendingProps>`\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: opacity 2s;\n opacity: ${({ isPending }) => (isPending ? '1' : '0')};\n`;\n\nconst Loader = styled(LoaderIcon)`\n animation: ${rotate} linear 1s infinite;\n`;\n\nexport const ButtonChildren = styled('div').attrs(({ isPending }: WithPendingProps) => ({\n ['aria-hidden']: isPending,\n}))<WithPendingProps>`\n width: 100%;\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n justify-content: center;\n transition: opacity ${TransitionDuration.Fast};\n opacity: ${({ isPending }) => (isPending ? '0' : '1')};\n gap: ${Spacing[1]};\n`;\n\nconst PrefixIconContainer = styled.div`\n display: flex;\n align-items: center;\n`;\n\nconst InheritPrefixIconContainer = styled.div`\n display: flex;\n align-items: center;\n\n & svg {\n width: inherit;\n height: inherit;\n }\n`;\n\nexport const SuffixIconContainer = styled(PrefixIconContainer)`\n margin-right: 0;\n flex-grow: 1;\n justify-content: flex-end;\n`;\n\nconst ButtonText = styled.span<{ size: 'md' | 'sm'; width: 'full' | 'auto' | 'button' | 'icon' }>`\n position: relative;\n\n /* Needed to align for browsers that don't support text-box yet\n (which at this time, is firefox, and opera, and a few niche browsers)\n This checks firefox. Otherwise, it will default back to the original\n which is a slightly misaligned button\n */\n\n /* Was trying to use this with @supports not, but genuinely could not figure out why this wouldn't\n work */\n\n line-height: ${({ width }) => (width === 'icon' ? '0' : 'inherit')};\n @-moz-document url-prefix() {\n top: ${({ size }) => (size === 'md' ? '1px' : '0.5px')};\n }\n\n @supports (text-box: cap alphabetic) {\n text-box: ${({ width }) => (width === 'icon' ? 'normal' : 'cap alphabetic')};\n }\n`;\n\ntype MaybePromise =\n | ((e: MouseEvent<HTMLButtonElement>) => void)\n | ((e: MouseEvent<HTMLButtonElement>) => Promise<void>);\n\nexport interface ButtonProps\n extends ComponentPropsWithoutRef<'button'>, Omit<PseudoClassProps, 'checked'> {\n /**\n * Visual style of the button.\n *\n * - `primary` – filled brand colour, for the primary action on a surface.\n * - `basic` – subtle grey fill, for secondary actions.\n * - `outline` – transparent with a border, alternative secondary style.\n * - `text` – no background or border, for tertiary / inline actions.\n * - `inverse` – inverted fill for use on dark/coloured backgrounds.\n * - `danger` – red fill, for destructive actions.\n *\n * @defaultValue 'primary'\n */\n variant?: 'basic' | 'primary' | 'inverse' | 'danger' | 'text' | 'outline';\n /**\n * Shows a loading spinner and disables the button. Also triggers automatically\n * when `onClick` returns a Promise, clearing once the promise settles.\n */\n isPending?: boolean;\n /**\n * Icon rendered to the left of the button label.\n * Import from `@persona/icons`.\n */\n prefixIcon?: ReactNode;\n /**\n * Controls how the prefix icon inherits sizing.\n *\n * - `basic` – icon is rendered inside a fixed-size container.\n * - `inherit` – icon stretches to fill the surrounding element's dimensions.\n *\n * @defaultValue 'basic'\n */\n prefixIconType?: 'basic' | 'inherit';\n\n /**\n * Icon rendered to the right of the button label.\n * Import from `@persona/icons`.\n */\n suffixIcon?: ReactNode;\n\n /**\n * Height and typography scale of the button.\n *\n * @defaultValue 'md'\n */\n size?: 'md' | 'sm';\n\n /**\n * Changes the button into a link.\n * Pass a relative path to use `react-router-dom` `<Link>`, or an absolute\n * `https://` URL to render an `<a>` tag that opens in a new tab.\n */\n to?: LinkProps['to'];\n\n /**\n * Overrides the target of the link if `to` is provided and is an external link.\n */\n target?: LinkProps['target'];\n\n /**\n * Note: we may want to default this to 'button' in the future, but many instances of this Button component\n * in dashboard currently rely on the default 'submit' behavior that occurs when using this in redux-form\n * so we'll have to comb through and manually add the type='submit' prop.\n */\n type?: 'button' | 'reset' | 'submit';\n /**\n * Controls the width of the button.\n *\n * - `full` – stretches to fill its container (`width: 100%`).\n * - `auto` – shrinks to fit its content.\n * - `button` – a fixed medium element width (from design tokens).\n * - `icon` – square, sized to match the button height; use for icon-only buttons.\n *\n * @defaultValue 'full'\n */\n width?: 'full' | 'auto' | 'button' | 'icon';\n onClick?: MaybePromise;\n ref?: Ref<HTMLButtonElement>;\n\n /**\n * In some cases we render a button on a secondary background, which needs an adjustment\n * for certain variants.\n */\n onSecondaryBackground?: boolean;\n}\n\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n id,\n children,\n prefixIcon,\n suffixIcon,\n disabled,\n isPending,\n type = 'button',\n prefixIconType = 'basic',\n variant = 'primary',\n size = 'md',\n width = 'full',\n onClick,\n onSecondaryBackground,\n ...props\n }: ButtonProps,\n ref,\n) {\n const [isResolving, { enable, disable }] = useToggle(false);\n const innerOnClick: MaybePromise = isFunction(onClick) ? onClick : noop;\n const loading = isPending || isResolving;\n\n const handleClick = useCallback(\n async (e: MouseEvent<HTMLButtonElement>) => {\n if (loading) {\n return;\n }\n\n const maybePromise = innerOnClick(e);\n\n if (maybePromise instanceof Promise) {\n enable();\n await maybePromise;\n disable();\n }\n },\n [loading, innerOnClick],\n );\n\n return (\n <StyledButton\n id={id}\n type={type}\n data-test={'button__' + variant}\n variant={variant}\n size={size}\n width={width}\n disabled={disabled || loading}\n $isPending={loading}\n $onSecondaryBackground={onSecondaryBackground}\n {...props}\n onClick={handleClick}\n ref={ref}\n >\n {loading && (\n <LoaderContainer isPending={loading}>\n <Loader aria-label={`Loading ${props['aria-label'] || ''}`} />\n </LoaderContainer>\n )}\n <ButtonChildren isPending={loading}>\n {prefixIcon != null && (\n <>\n {prefixIconType === 'basic' && <PrefixIconContainer>{prefixIcon}</PrefixIconContainer>}\n {prefixIconType === 'inherit' && (\n <InheritPrefixIconContainer>{prefixIcon}</InheritPrefixIconContainer>\n )}\n </>\n )}\n {children && (\n <ButtonText width={width} size={size}>\n {children}\n </ButtonText>\n )}\n {suffixIcon != null && <SuffixIconContainer>{suffixIcon}</SuffixIconContainer>}\n </ButtonChildren>\n </StyledButton>\n );\n});\n\nexport default Button;\n","import { forwardRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { BorderRadius } from '@persona/design-tokens';\n\nimport Button, { type ButtonProps } from './Button';\n\nconst BUTTON_SIZE_MAP = {\n xs: '16px',\n sm: '24px',\n md: '32px',\n};\n\nconst ICON_SIZE_MAP = {\n xs: '12px',\n sm: '16px',\n md: '16px',\n};\n\ntype IconBtnSize = keyof typeof BUTTON_SIZE_MAP;\n\nconst IconBtn = styled(Button).attrs({\n width: 'icon',\n variant: 'basic',\n})`\n background-color: transparent;\n padding: 0;\n border-radius: ${BorderRadius.Md};\n\n ${({ size }) => css`\n height: ${BUTTON_SIZE_MAP[size as IconBtnSize]};\n width: ${BUTTON_SIZE_MAP[size as IconBtnSize]};\n\n svg {\n width: ${ICON_SIZE_MAP[size as IconBtnSize]};\n height: ${ICON_SIZE_MAP[size as IconBtnSize]};\n }\n `}\n`;\n\nexport interface IconButtonProps extends Omit<\n ButtonProps,\n 'width' | 'prefixIcon' | 'prefixIconType' | 'suffixIcon' | 'variant' | 'size'\n> {\n /**\n * `xs` - 16px. `sm` - 24px. `md` - 32px.\n * Pair with a PDS icon in the prescribed size.\n */\n size?: IconBtnSize;\n}\n\n/**\n * Use to render icon-only buttons. Ensure buttons have proper aria properties.\n */\nconst IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n { size = 'xs', ...props },\n ref,\n) {\n return <IconBtn size={size as ButtonProps['size']} ref={ref} {...props} />;\n});\n\nexport default IconButton;\n"],"mappings":";;;;;;;;;;;;;;;AA4BA,MAAMA,eAAmB,KAAA;AAGzB,MAAM,YAAY,EAAE,aAAgC,SAAS,KAAK;AAGlE,MAAM,aAA0F;CAC9F,IAAI,GAAG;MACH,gBAAgB,GAAG;eACV,EAAE,YAAY,MAAM,OAAO,OAAO,GAAG;eACrC,QAAQ,GAAG;;;;;;CAMxB,IAAI,GAAG;MACH,gBAAgB,GAAG;eACV,EAAE,YAAY,MAAM,OAAO,OAAO,GAAG;eACrC,QAAQ,GAAG;;;;;;CAMzB;AAGD,MAAM,cAA4F;CAChG,MAAM,GAAG;;;CAGT,MAAM,GAAG;;;CAIT,QAAQ,GAAG;cACC,EAAE,YAAY,MAAM,QAAQ,M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;EACP,UAAU,YAAY;EACtB,YAAY;EACZ,wBAAwB;EACxB,GAAI;EACJ,SAAS;EACJ;YAZP,CAcG,WACC,oBAAC,iBAAD;GAAiB,WAAW;aAC1B,oBAAC,QAAD,EAAQ,cAAY,WAAW,MAAM,iBAAiB,MAAQ,CAAA;GAC9C,CAAA,EAEpB,qBAAC,gBAAD;GAAgB,WAAW;aAA3B;IACG,cAAc,QACb,qBAAA,YAAA,EAAA,UAAA,CACG,mBAAmB,WAAW,oBAAC,qBAAD,EAAA,UAAsB,YAAiC,CAAA,EACrF,mBAAmB,aAClB,oBAAC,4BAAD,EAAA,UAA6B,YAAwC,CAAA,CAEtE,EAAA,CAAA;IAEJ,YACC,oBAAC,YAAD;KAAmB;KAAa;KAC7B;KACU,CAAA;IAEd,cAAc,QAAQ,oBAAC,qBAAD,EAAA,UAAsB,YAAiC,CAAA;IAC/D;KACJ;;EAEjB;;;AC/dF,MAAM,kBAAkB;CACtB,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAED,MAAM,gBAAgB;CACpB,IAAI;CACJ,IAAI;CACJ,IAAI;CACL;AAID,MAAM,UAAU,OAAO,OAAO,CAAC,MAAM;CACnC,OAAO;CACP,SAAS;CACV,CAAC;;;mBAGiB,aAAa,GAAG;;KAE9B,EAAE,WAAW,GAAG;cACP,gBAAgB,MAAqB;aACtC,gBAAgB,MAAqB;;;eAGnC,cAAc,MAAqB;gBAClC,cAAc,MAAqB;;IAE/C;;;;;AAiBJ,MAAM,aAAa,WAA+C,SAAS,WACzE,EAAE,OAAO,MAAM,GAAG,SAClB,KACA;AACA,QAAO,oBAAC,SAAD;EAAe;EAAkC;EAAK,GAAI;EAAS,CAAA;EAC1E"}
@@ -1,2 +1,2 @@
1
- import { n as IconButtonProps, t as IconButton } from "./IconButton-BpyOr8Ev.mjs";
1
+ import { n as IconButtonProps, t as IconButton } from "./IconButton-Bh-JJ-0x.mjs";
2
2
  export { IconButtonProps, IconButton as default };