@persona/design-system 0.2.1 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (448) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +3 -3
  3. package/dist/{Action-DnR0YTxO.d.mts → Action-DL3kHI9Z.d.mts} +3 -3
  4. package/dist/Action.d.mts +1 -1
  5. package/dist/AdvancedFilterRuleRow.d.mts +2 -2
  6. package/dist/AdvancedFilterRulesPopover.d.mts +2 -2
  7. package/dist/ArrayValueControl.d.mts +1 -1
  8. package/dist/Attribute.d.mts +4 -4
  9. package/dist/{Badge-DRn_r6is.mjs → Badge-BL0J5oMa.mjs} +3 -3
  10. package/dist/{Badge-DRn_r6is.mjs.map → Badge-BL0J5oMa.mjs.map} +1 -1
  11. package/dist/BooleanValueControl.d.mts +1 -1
  12. package/dist/{Breadcrumb-DEwZFJHF.d.mts → Breadcrumb-Czgdi0xf.d.mts} +1 -1
  13. package/dist/Breadcrumb.d.mts +1 -1
  14. package/dist/{Breadcrumbs-Byf2ye6H.mjs → Breadcrumbs-ed4wRDS7.mjs} +10 -10
  15. package/dist/{Breadcrumbs-Byf2ye6H.mjs.map → Breadcrumbs-ed4wRDS7.mjs.map} +1 -1
  16. package/dist/{Breadcrumbs-0e_3v9FF.d.mts → Breadcrumbs-zei-cpdU.d.mts} +2 -2
  17. package/dist/Breadcrumbs.d.mts +1 -1
  18. package/dist/{Button-DkjwN_Op.d.mts → Button-CKzNTpPL.d.mts} +3 -3
  19. package/dist/Button.d.mts +1 -1
  20. package/dist/Calendar-CcxN7y3e.d.mts +12 -0
  21. package/dist/Calendar.d.mts +2 -12
  22. package/dist/CalendarBase.d.mts +1 -1
  23. package/dist/{Card-CLTkZLKr.mjs → Card-CKrJtn1f.mjs} +5 -5
  24. package/dist/{Card-CLTkZLKr.mjs.map → Card-CKrJtn1f.mjs.map} +1 -1
  25. package/dist/{Card-DxFajLnx.d.mts → Card-pr4FQWjn.d.mts} +4 -4
  26. package/dist/Card.d.mts +1 -1
  27. package/dist/Card2.d.mts +4 -4
  28. package/dist/{CardV2-m9yOInMU.mjs → CardV2-D3m5EKlp.mjs} +19 -13
  29. package/dist/CardV2-D3m5EKlp.mjs.map +1 -0
  30. package/dist/{Checkbox-CU27-Aa8.mjs → Checkbox-Ccuicmlo.mjs} +8 -8
  31. package/dist/Checkbox-Ccuicmlo.mjs.map +1 -0
  32. package/dist/ChoicesValueControl.d.mts +1 -1
  33. package/dist/{Combobox-DhTUY8JT.mjs → Combobox-BGRyr_-L.mjs} +12 -12
  34. package/dist/{Combobox-DhTUY8JT.mjs.map → Combobox-BGRyr_-L.mjs.map} +1 -1
  35. package/dist/{Combobox-BgKEHP9p.d.mts → Combobox-Bf_Xe1BG.d.mts} +3 -3
  36. package/dist/Combobox.d.mts +2 -2
  37. package/dist/{ComboboxBase-Dmzn8a53.d.mts → ComboboxBase-CWzN8GML.d.mts} +7 -7
  38. package/dist/ComboboxBase.d.mts +1 -1
  39. package/dist/{ComboboxMultiSelect-BLKUKNEW.d.mts → ComboboxMultiSelect-iSuvyOx2.d.mts} +2 -2
  40. package/dist/ComboboxMultiSelect.d.mts +1 -1
  41. package/dist/{ComboboxSingleSelect-Kpl-iOok.d.mts → ComboboxSingleSelect-DVRFKPi1.d.mts} +4 -4
  42. package/dist/ComboboxSingleSelect.d.mts +1 -1
  43. package/dist/{CompactBar-E9hPDRvI.d.mts → CompactBar-C_61pgp7.d.mts} +3 -3
  44. package/dist/CompactBar.d.mts +1 -1
  45. package/dist/{ConfigFormGroup-GgzSDzgL.mjs → ConfigFormGroup-DGCTW3by.mjs} +3 -3
  46. package/dist/{ConfigFormGroup-GgzSDzgL.mjs.map → ConfigFormGroup-DGCTW3by.mjs.map} +1 -1
  47. package/dist/{ControlBar-DYrjBDzu.d.mts → ControlBar-0XwbM4yC.d.mts} +2 -2
  48. package/dist/ControlBar.d.mts +1 -1
  49. package/dist/DataTable.d.mts +3 -3
  50. package/dist/DateField-CKeSIhGy.d.mts +23 -0
  51. package/dist/DateField.d.mts +2 -23
  52. package/dist/DatePicker-B1iWrqR5.d.mts +19 -0
  53. package/dist/{DatePicker-DpGvo7Bd.mjs → DatePicker-BNnZ6L1y.mjs} +37 -19
  54. package/dist/DatePicker-BNnZ6L1y.mjs.map +1 -0
  55. package/dist/DatePicker.d.mts +2 -19
  56. package/dist/DateRangePicker-BmF9eH9R.d.mts +53 -0
  57. package/dist/DateRangePicker.d.mts +2 -53
  58. package/dist/DateRangeValueControl.d.mts +19 -0
  59. package/dist/DateValueControl.d.mts +1 -1
  60. package/dist/{DropdownButton-DGgfGW_o.mjs → DropdownButton-BlVeFbJ0.mjs} +3 -3
  61. package/dist/{DropdownButton-DGgfGW_o.mjs.map → DropdownButton-BlVeFbJ0.mjs.map} +1 -1
  62. package/dist/DropdownButton.d.mts +2 -2
  63. package/dist/{DropdownMenu-DZIFSJXD.mjs → DropdownMenu-82xH1AZr.mjs} +3 -3
  64. package/dist/{DropdownMenu-DZIFSJXD.mjs.map → DropdownMenu-82xH1AZr.mjs.map} +1 -1
  65. package/dist/{DropdownMenu-B2t3Bwky.d.mts → DropdownMenu-DuTnq9j7.d.mts} +3 -3
  66. package/dist/DropdownMenu.d.mts +1 -1
  67. package/dist/{FieldRegistry-COyIA4VU.d.mts → FieldRegistry-D1vghSC_.d.mts} +2 -2
  68. package/dist/FieldRegistry.d.mts +1 -1
  69. package/dist/{FilterBar-CS2YjiTr.d.mts → FilterBar-Ck085Dic.d.mts} +5 -8
  70. package/dist/FilterBar.d.mts +1 -1
  71. package/dist/FilterPickerMenu.d.mts +2 -2
  72. package/dist/FilterPill.d.mts +1 -1
  73. package/dist/FilterPopover.d.mts +2 -12
  74. package/dist/FloatValueControl.d.mts +1 -1
  75. package/dist/FloatingPanel.d.mts +80 -0
  76. package/dist/FloatingPanelContext.d.mts +33 -0
  77. package/dist/FloatingPanelRenderer.d.mts +7 -0
  78. package/dist/{FormControl-CZFmub1N.d.mts → FormControl-CfpwZGlD.d.mts} +2 -2
  79. package/dist/{FormControl-BIXJ-FPI.mjs → FormControl-D1HIqDKm.mjs} +6 -6
  80. package/dist/FormControl-D1HIqDKm.mjs.map +1 -0
  81. package/dist/FormControl.d.mts +1 -1
  82. package/dist/FormControlLabel.d.mts +2 -2
  83. package/dist/{FormField-8rlT8pm0.d.mts → FormField-0p4y0sS5.d.mts} +2 -2
  84. package/dist/{FormField-DcGQvgNW.mjs → FormField-CVnbsNvU.mjs} +46 -44
  85. package/dist/FormField-CVnbsNvU.mjs.map +1 -0
  86. package/dist/FormField.d.mts +1 -1
  87. package/dist/{Header-OLZuv8fF.d.mts → Header-gDUTQgWj.d.mts} +2 -2
  88. package/dist/Header.d.mts +1 -1
  89. package/dist/{HelperTooltip-CJDG7Ugp.d.mts → HelperTooltip-CqhiRb5g.d.mts} +2 -2
  90. package/dist/HelperTooltip.d.mts +1 -1
  91. package/dist/{HoverCopyableField-BHdCaR-R.mjs → HoverCopyableField-HWshrU_1.mjs} +32 -21
  92. package/dist/HoverCopyableField-HWshrU_1.mjs.map +1 -0
  93. package/dist/HoverCopyableField.d.mts +14 -3
  94. package/dist/{IconButton-DC4rh6ow.mjs → IconButton-BgL3QUVO.mjs} +9 -9
  95. package/dist/IconButton-BgL3QUVO.mjs.map +1 -0
  96. package/dist/{IconButton-Dc17jZPG.d.mts → IconButton-CLsHdYm7.d.mts} +2 -2
  97. package/dist/IconButton.d.mts +1 -1
  98. package/dist/ImageTile.d.mts +1 -1
  99. package/dist/InlineCombobox.d.mts +1 -1
  100. package/dist/InlineInput.d.mts +1 -1
  101. package/dist/{Input-DsS4J78T.d.mts → Input-BHHWpSKN.d.mts} +5 -5
  102. package/dist/{Input-PWfwMSJ7.mjs → Input-DoB8YswA.mjs} +5 -5
  103. package/dist/{Input-PWfwMSJ7.mjs.map → Input-DoB8YswA.mjs.map} +1 -1
  104. package/dist/Input.d.mts +1 -1
  105. package/dist/{InputProps-Buxtnz77.d.mts → InputProps-sHxlDiss.d.mts} +2 -2
  106. package/dist/InputProps.d.mts +1 -1
  107. package/dist/IntegerValueControl.d.mts +1 -1
  108. package/dist/LayoutLoadingSpinner.d.mts +11 -0
  109. package/dist/Link.d.mts +2 -2
  110. package/dist/{ListBox-BwD-q7wF.mjs → ListBox-B9uuMt2R.mjs} +23 -16
  111. package/dist/ListBox-B9uuMt2R.mjs.map +1 -0
  112. package/dist/{ListBox-Nl9aOBeh.d.mts → ListBox-BrY1bQ5-.d.mts} +3 -3
  113. package/dist/ListBox.d.mts +1 -1
  114. package/dist/ListBoxField.d.mts +5 -2
  115. package/dist/{LoadingShimmer-BPYPtFE1.mjs → LoadingShimmer-dsBWRdTU.mjs} +2 -2
  116. package/dist/{LoadingShimmer-BPYPtFE1.mjs.map → LoadingShimmer-dsBWRdTU.mjs.map} +1 -1
  117. package/dist/LoadingShimmer.d.mts +2 -2
  118. package/dist/{LogicRow-BAREMenx.d.mts → LogicRow-9a_klV2v.d.mts} +3 -3
  119. package/dist/LogicRow.d.mts +1 -1
  120. package/dist/MaskedInput.d.mts +2 -2
  121. package/dist/MatchHighlight.d.mts +1 -1
  122. package/dist/{Menu-DpM8o234.mjs → Menu-CHbUf9PQ.mjs} +5 -5
  123. package/dist/{Menu-DpM8o234.mjs.map → Menu-CHbUf9PQ.mjs.map} +1 -1
  124. package/dist/{Menu-DM9OoZ71.d.mts → Menu-D4Y_J-QI.d.mts} +4 -4
  125. package/dist/Menu.d.mts +1 -1
  126. package/dist/{MiddleTruncatedText-Bzpg3zAU.mjs → MiddleTruncatedText-DnF7F_1D.mjs} +2 -2
  127. package/dist/{MiddleTruncatedText-Bzpg3zAU.mjs.map → MiddleTruncatedText-DnF7F_1D.mjs.map} +1 -1
  128. package/dist/Modal.d.mts +4 -5
  129. package/dist/{PageHeader-Dq-J3san.mjs → PageHeader-XxGsFLHb.mjs} +4 -4
  130. package/dist/{PageHeader-Dq-J3san.mjs.map → PageHeader-XxGsFLHb.mjs.map} +1 -1
  131. package/dist/PageHeader.d.mts +2 -2
  132. package/dist/PageLayout.d.mts +1 -1
  133. package/dist/{PageSelector-Ca4TcyxG.d.mts → PageSelector-BDo3ge1E.d.mts} +2 -2
  134. package/dist/PageSelector.d.mts +1 -1
  135. package/dist/{Pagination-GALyid4q.mjs → Pagination-DvVKQLdC.mjs} +8 -8
  136. package/dist/{Pagination-GALyid4q.mjs.map → Pagination-DvVKQLdC.mjs.map} +1 -1
  137. package/dist/{Pii-BalLvfze.mjs → Pii-BD48BtZ0.mjs} +2 -2
  138. package/dist/{Pii-BalLvfze.mjs.map → Pii-BD48BtZ0.mjs.map} +1 -1
  139. package/dist/PillShell.d.mts +1 -1
  140. package/dist/{Popover-BZ5Bs80y.mjs → Popover-DNH8Jx1-.mjs} +4 -4
  141. package/dist/{Popover-BZ5Bs80y.mjs.map → Popover-DNH8Jx1-.mjs.map} +1 -1
  142. package/dist/{PseudoClassProps-CcSlKNev.d.mts → PseudoClassProps-DgT5G_z5.d.mts} +1 -1
  143. package/dist/PseudoClassProps.d.mts +1 -1
  144. package/dist/{Radio-CtPz3EzX.mjs → Radio-DSMPX5_2.mjs} +5 -5
  145. package/dist/Radio-DSMPX5_2.mjs.map +1 -0
  146. package/dist/{RadioGroup-sjBzFE_-.mjs → RadioGroup-D5IITQLz.mjs} +3 -3
  147. package/dist/{RadioGroup-sjBzFE_-.mjs.map → RadioGroup-D5IITQLz.mjs.map} +1 -1
  148. package/dist/{RadioGroup-Xn46ovrV.d.mts → RadioGroup-Jl1yAvGu.d.mts} +1 -1
  149. package/dist/RadioGroup.d.mts +1 -1
  150. package/dist/RuleEditorFields.d.mts +2 -2
  151. package/dist/RulesPill.d.mts +1 -1
  152. package/dist/{SearchInput-Try11aJD.d.mts → SearchInput-CaKHRC_s.d.mts} +2 -2
  153. package/dist/SearchInput.d.mts +1 -1
  154. package/dist/Section.d.mts +1 -1
  155. package/dist/SectionHeading.d.mts +77 -2
  156. package/dist/{SegmentedControl-BugnH-h2.mjs → SegmentedControl-JUgRw_M-.mjs} +3 -3
  157. package/dist/{SegmentedControl-BugnH-h2.mjs.map → SegmentedControl-JUgRw_M-.mjs.map} +1 -1
  158. package/dist/{SegmentedControl-DckAdhcD.d.mts → SegmentedControl-e6xDtoHC.d.mts} +1 -1
  159. package/dist/SegmentedControl.d.mts +1 -1
  160. package/dist/{Select-BmJ1OjXA.d.mts → Select-CPYztD4m.d.mts} +3 -3
  161. package/dist/{Select-DL-AjL0Q.mjs → Select-DX3toj6M.mjs} +10 -10
  162. package/dist/{Select-DL-AjL0Q.mjs.map → Select-DX3toj6M.mjs.map} +1 -1
  163. package/dist/Select.d.mts +1 -1
  164. package/dist/{Spacer-Ln3KChb5.mjs → Spacer-BsK8tTwA.mjs} +2 -2
  165. package/dist/{Spacer-Ln3KChb5.mjs.map → Spacer-BsK8tTwA.mjs.map} +1 -1
  166. package/dist/{Spinner-BgBCCHGo.mjs → Spinner-D3wXIoXN.mjs} +3 -3
  167. package/dist/{Spinner-BgBCCHGo.mjs.map → Spinner-D3wXIoXN.mjs.map} +1 -1
  168. package/dist/{Stack-ckRN7LrP.mjs → Stack-Bre2oiov.mjs} +2 -2
  169. package/dist/{Stack-ckRN7LrP.mjs.map → Stack-Bre2oiov.mjs.map} +1 -1
  170. package/dist/{Stack-CbcJykx9.d.mts → Stack-DHaK1-dw.d.mts} +2 -2
  171. package/dist/Stack.d.mts +1 -1
  172. package/dist/{Sticker-B0TbkV4o.mjs → Sticker-CQ6sOKUj.mjs} +6 -6
  173. package/dist/{Sticker-B0TbkV4o.mjs.map → Sticker-CQ6sOKUj.mjs.map} +1 -1
  174. package/dist/{Sticker-BIVuastf.d.mts → Sticker-DnSemOcW.d.mts} +5 -5
  175. package/dist/Sticker.d.mts +1 -1
  176. package/dist/StringValueControl.d.mts +1 -1
  177. package/dist/Tab.d.mts +2 -2
  178. package/dist/{TabBar-DLf4Hwa4.mjs → TabBar-sYllYizt.mjs} +6 -6
  179. package/dist/{TabBar-DLf4Hwa4.mjs.map → TabBar-sYllYizt.mjs.map} +1 -1
  180. package/dist/TabBarIconButton.d.mts +2 -2
  181. package/dist/{Table-C-mx8Uj0.mjs → Table-C2pkP5Xg.mjs} +7 -7
  182. package/dist/{Table-C-mx8Uj0.mjs.map → Table-C2pkP5Xg.mjs.map} +1 -1
  183. package/dist/{Table-8jXlKYLy.d.mts → Table-CFbPINKr.d.mts} +1 -1
  184. package/dist/Table.d.mts +1 -1
  185. package/dist/{TableBody-ByEcFueE.d.mts → TableBody-BQsGc4Lw.d.mts} +1 -1
  186. package/dist/TableBody.d.mts +1 -1
  187. package/dist/{TableBox-DGjKVQFO.mjs → TableBox-CaTHcR4F.mjs} +15 -15
  188. package/dist/{TableBox-DGjKVQFO.mjs.map → TableBox-CaTHcR4F.mjs.map} +1 -1
  189. package/dist/TableBox.d.mts +2 -2
  190. package/dist/{TableBoxCell-BmoPs1u1.d.mts → TableBoxCell-52g97gEg.d.mts} +7 -7
  191. package/dist/TableBoxCell.d.mts +1 -1
  192. package/dist/TableBoxField.d.mts +3 -3
  193. package/dist/{TableBoxRow-BAYvEDjT.d.mts → TableBoxRow-DnoumHIE.d.mts} +3 -3
  194. package/dist/TableBoxRow.d.mts +1 -1
  195. package/dist/{TableBoxRowActions-DRs4MdK0.d.mts → TableBoxRowActions-CDcREhP4.d.mts} +2 -2
  196. package/dist/TableBoxRowActions.d.mts +1 -1
  197. package/dist/TableCell.d.mts +1 -1
  198. package/dist/{TableControls-BK8DCsqi.mjs → TableControls-3bXyd8gS.mjs} +247 -103
  199. package/dist/TableControls-3bXyd8gS.mjs.map +1 -0
  200. package/dist/{TableControls-DscP6fyt.d.mts → TableControls-CrGGlkEG.d.mts} +4 -8
  201. package/dist/TableControls.d.mts +1 -1
  202. package/dist/{TableControlsContext-BeJ7GHPN.d.mts → TableControlsContext-BKZt2Jid.d.mts} +2 -2
  203. package/dist/TableControlsContext.d.mts +1 -1
  204. package/dist/{TableHead-g3afLl5B.d.mts → TableHead-CqVIJfjh.d.mts} +1 -1
  205. package/dist/TableHead.d.mts +1 -1
  206. package/dist/{TableHeaderCell-CWTMf2Fe.d.mts → TableHeaderCell-DK4R8vdK.d.mts} +1 -1
  207. package/dist/TableHeaderCell.d.mts +1 -1
  208. package/dist/{TableLayout-hPlVO3dD.d.mts → TableLayout-BcIazRB-.d.mts} +1 -1
  209. package/dist/TableLayout.d.mts +1 -1
  210. package/dist/{TableRow-lvjbVccA.d.mts → TableRow-DdJcjG2b.d.mts} +2 -2
  211. package/dist/TableRow.d.mts +1 -1
  212. package/dist/TableTH.d.mts +1 -1
  213. package/dist/{TableViewConfigurationDropdown-Ccxtk5dA.d.mts → TableViewConfigurationDropdown-CHBOjw7O.d.mts} +5 -3
  214. package/dist/TableViewConfigurationDropdown.d.mts +1 -1
  215. package/dist/{TechnicalSticker-BrvR0zhC.mjs → TechnicalSticker-D3eeGMDR.mjs} +6 -6
  216. package/dist/{TechnicalSticker-BrvR0zhC.mjs.map → TechnicalSticker-D3eeGMDR.mjs.map} +1 -1
  217. package/dist/{Text-hEoPeOc9.mjs → Text-B0orb-cZ.mjs} +2 -2
  218. package/dist/{Text-hEoPeOc9.mjs.map → Text-B0orb-cZ.mjs.map} +1 -1
  219. package/dist/{Text-CfIFUyHt.d.mts → Text-BIgrwIdS.d.mts} +4 -4
  220. package/dist/Text.d.mts +1 -1
  221. package/dist/{TextArea-DiKEhpfD.d.mts → TextArea-CiLttt0s.d.mts} +2 -2
  222. package/dist/{TextArea-BFsXUkuj.mjs → TextArea-DWXuV2aZ.mjs} +3 -3
  223. package/dist/{TextArea-BFsXUkuj.mjs.map → TextArea-DWXuV2aZ.mjs.map} +1 -1
  224. package/dist/TextArea.d.mts +1 -1
  225. package/dist/{TextUnderlineTooltip-Bs6Jn5yr.d.mts → TextUnderlineTooltip-_7mIrZ2-.d.mts} +3 -3
  226. package/dist/TextUnderlineTooltip.d.mts +1 -1
  227. package/dist/Tile.d.mts +1 -1
  228. package/dist/Toast.d.mts +1 -1
  229. package/dist/{Toggle-oukvAn6V.d.mts → Toggle-Cav7bMxg.d.mts} +1 -1
  230. package/dist/{Toggle-CC2FTAKS.mjs → Toggle-e8DCYa6i.mjs} +6 -6
  231. package/dist/{Toggle-CC2FTAKS.mjs.map → Toggle-e8DCYa6i.mjs.map} +1 -1
  232. package/dist/Toggle.d.mts +1 -1
  233. package/dist/{Tooltip-0iXDCV2O.d.mts → Tooltip-DX-N-szt.d.mts} +3 -3
  234. package/dist/{Tooltip-CDvOu1UN.mjs → Tooltip-iJcfJqxn.mjs} +4 -4
  235. package/dist/{Tooltip-CDvOu1UN.mjs.map → Tooltip-iJcfJqxn.mjs.map} +1 -1
  236. package/dist/Tooltip.d.mts +1 -1
  237. package/dist/{TruncatedText-CdeU19Ev.d.mts → TruncatedText-D2R7uy_y.d.mts} +2 -2
  238. package/dist/components/Attribute/index.mjs +8 -9
  239. package/dist/components/Attribute/index.mjs.map +1 -1
  240. package/dist/components/Badge/index.mjs +1 -1
  241. package/dist/components/Banner/index.mjs +3 -3
  242. package/dist/components/Breadcrumbs/index.d.mts +1 -1
  243. package/dist/components/Breadcrumbs/index.mjs +1 -1
  244. package/dist/components/Button/index.d.mts +2 -2
  245. package/dist/components/Button/index.mjs +1 -1
  246. package/dist/components/ButtonGroup/index.mjs +3 -3
  247. package/dist/components/Card/index.d.mts +2 -2
  248. package/dist/components/Card/index.mjs +1 -1
  249. package/dist/components/CardV2/index.d.mts +3 -2
  250. package/dist/components/CardV2/index.mjs +2 -2
  251. package/dist/components/Checkbox/index.mjs +1 -1
  252. package/dist/components/Combobox/index.d.mts +2 -2
  253. package/dist/components/Combobox/index.mjs +1 -1
  254. package/dist/components/ConfigFormGroup/index.mjs +2 -2
  255. package/dist/components/DataTable/TableControls/index.d.mts +16 -16
  256. package/dist/components/DataTable/TableControls/index.mjs +2 -2
  257. package/dist/components/DataTable/index.mjs +22 -24
  258. package/dist/components/DataTable/index.mjs.map +1 -1
  259. package/dist/components/DataTable/types.d.mts +2 -2
  260. package/dist/components/DatePicker/index.d.mts +4 -4
  261. package/dist/components/DatePicker/index.mjs +1 -1
  262. package/dist/components/DropdownButton/index.mjs +1 -1
  263. package/dist/components/DropdownMenu/index.d.mts +1 -1
  264. package/dist/components/DropdownMenu/index.mjs +1 -1
  265. package/dist/components/FloatingPanel/index.d.mts +5 -0
  266. package/dist/components/FloatingPanel/index.mjs +635 -0
  267. package/dist/components/FloatingPanel/index.mjs.map +1 -0
  268. package/dist/components/FormControl/index.d.mts +2 -2
  269. package/dist/components/FormControl/index.mjs +2 -2
  270. package/dist/components/FormField/index.d.mts +1 -1
  271. package/dist/components/FormField/index.mjs +1 -1
  272. package/dist/components/HoverCopyableField/index.d.mts +2 -2
  273. package/dist/components/HoverCopyableField/index.mjs +2 -2
  274. package/dist/components/ImageTile/index.mjs +9 -9
  275. package/dist/components/Input/index.d.mts +1 -1
  276. package/dist/components/Input/index.mjs +1 -1
  277. package/dist/components/Link/index.mjs +3 -3
  278. package/dist/components/Link/index.mjs.map +1 -1
  279. package/dist/components/ListBox/index.d.mts +3 -3
  280. package/dist/components/ListBox/index.mjs +1 -1
  281. package/dist/components/LoadingShimmer/index.mjs +1 -1
  282. package/dist/components/MaskedInput/index.mjs +1 -1
  283. package/dist/components/MatchHighlight/index.mjs +1 -1
  284. package/dist/components/Menu/index.d.mts +1 -1
  285. package/dist/components/Menu/index.mjs +1 -1
  286. package/dist/components/Modal/index.mjs +46 -17
  287. package/dist/components/Modal/index.mjs.map +1 -1
  288. package/dist/components/PageHeader/index.mjs +1 -1
  289. package/dist/components/Pagination/index.d.mts +1 -1
  290. package/dist/components/Pagination/index.mjs +1 -1
  291. package/dist/components/Pii/index.mjs +1 -1
  292. package/dist/components/Popover/index.mjs +1 -1
  293. package/dist/components/ProgressBar/index.mjs +4 -4
  294. package/dist/components/ProgressBar/index.mjs.map +1 -1
  295. package/dist/components/ProgressIndicator/index.mjs +2 -2
  296. package/dist/components/Radio/index.mjs +1 -1
  297. package/dist/components/RadioGroup/index.d.mts +1 -1
  298. package/dist/components/RadioGroup/index.mjs +1 -1
  299. package/dist/components/SegmentedControl/index.d.mts +1 -1
  300. package/dist/components/SegmentedControl/index.mjs +1 -1
  301. package/dist/components/Select/index.d.mts +1 -1
  302. package/dist/components/Select/index.mjs +1 -1
  303. package/dist/components/Slider/index.mjs +5 -5
  304. package/dist/components/Slider/index.mjs.map +1 -1
  305. package/dist/components/Spacer/index.mjs +1 -1
  306. package/dist/components/Spinner/index.mjs +1 -1
  307. package/dist/components/Stack/index.d.mts +1 -1
  308. package/dist/components/Stack/index.mjs +1 -1
  309. package/dist/components/StatusIndicator/index.mjs +2 -2
  310. package/dist/components/Sticker/index.d.mts +1 -1
  311. package/dist/components/Sticker/index.mjs +1 -1
  312. package/dist/components/SwatchPicker/index.mjs +1 -1
  313. package/dist/components/TabBar/index.mjs +1 -1
  314. package/dist/components/Table/index.d.mts +7 -7
  315. package/dist/components/Table/index.mjs +1 -1
  316. package/dist/components/TableBox/index.d.mts +2 -2
  317. package/dist/components/TableBox/index.mjs +1 -1
  318. package/dist/components/TechnicalSticker/index.mjs +1 -1
  319. package/dist/components/Text/index.d.mts +1 -1
  320. package/dist/components/Text/index.mjs +1 -1
  321. package/dist/components/TextArea/index.d.mts +1 -1
  322. package/dist/components/TextArea/index.mjs +1 -1
  323. package/dist/components/Tile/index.mjs +5 -5
  324. package/dist/components/Toast/index.mjs +5 -5
  325. package/dist/components/Toggle/index.d.mts +1 -1
  326. package/dist/components/Toggle/index.mjs +1 -1
  327. package/dist/components/Tooltip/index.d.mts +3 -3
  328. package/dist/components/Tooltip/index.mjs +1 -1
  329. package/dist/compound-expression.d.mts +1 -1
  330. package/dist/display.d.mts +1 -1
  331. package/dist/fieldPickerOptions.d.mts +2 -2
  332. package/dist/{filter-size-context-C1TvrE_O.d.mts → filter-size-context-C7injfBh.d.mts} +2 -2
  333. package/dist/filter-size-context.d.mts +1 -1
  334. package/dist/{index-BC4edEsD.d.mts → index-BPfK-u7y.d.mts} +2 -2
  335. package/dist/{index-CdaoOvFH.d.mts → index-BxBsQi2S.d.mts} +3 -3
  336. package/dist/{index-DJn4AeE4.d.mts → index-d_fTFuMM.d.mts} +4 -4
  337. package/dist/index.d.mts +1 -1
  338. package/dist/index2.d.mts +1 -1
  339. package/dist/index3.d.mts +3 -3
  340. package/dist/index4.d.mts +11 -11
  341. package/dist/{input-D3Qd6dI8.d.mts → input-D9FuQmlI.d.mts} +2 -2
  342. package/dist/inputFields.d.mts +10 -24
  343. package/dist/{intersperse-yd3oMrQl.mjs → intersperse-CLkblj9A.mjs} +1 -1
  344. package/dist/{intersperse-yd3oMrQl.mjs.map → intersperse-CLkblj9A.mjs.map} +1 -1
  345. package/dist/lib/ConfigContext.d.mts +4 -1
  346. package/dist/lib/ConfigContext.mjs.map +1 -1
  347. package/dist/lib/GlobalStyles.mjs +1 -1
  348. package/dist/lib/HeadlessAriaButton.mjs +1 -1
  349. package/dist/lib/MiddleTruncatedText.mjs +1 -1
  350. package/dist/lib/PDSProvider.d.mts +1 -1
  351. package/dist/lib/PDSProvider.mjs +1 -1
  352. package/dist/lib/TruncatedText.d.mts +1 -1
  353. package/dist/lib/TruncatedText.mjs +1 -1
  354. package/dist/lib/TruncatedTextWithTooltip.d.mts +1 -1
  355. package/dist/lib/TruncatedTextWithTooltip.mjs +1 -1
  356. package/dist/lib/embeddedSurfaceProtocol.d.mts +13 -1
  357. package/dist/lib/embeddedSurfaceProtocol.mjs +32 -5
  358. package/dist/lib/embeddedSurfaceProtocol.mjs.map +1 -1
  359. package/dist/lib/message.d.mts +1 -1
  360. package/dist/lib/pseudoClass.d.mts +1 -1
  361. package/dist/lib/useEmbeddedSurface.d.mts +31 -3
  362. package/dist/lib/useEmbeddedSurface.mjs +118 -13
  363. package/dist/lib/useEmbeddedSurface.mjs.map +1 -1
  364. package/dist/{message-CsK3sIq0.d.mts → message-CqKB5mko.d.mts} +1 -1
  365. package/dist/mixins/focus.d.mts +1 -1
  366. package/dist/mixins/focus.mjs +1 -1
  367. package/dist/mixins/hoverable.d.mts +2 -2
  368. package/dist/mixins/hoverable.mjs +2 -2
  369. package/dist/mixins/input.d.mts +1 -1
  370. package/dist/mixins/input.mjs +2 -2
  371. package/dist/mixins/menuItem.d.mts +2 -2
  372. package/dist/mixins/menuItem.mjs +1 -1
  373. package/dist/mixins/print/index.mjs +1 -1
  374. package/dist/mixins/text.d.mts +1 -1
  375. package/dist/mixins/text.mjs +1 -1
  376. package/dist/{operators-C_xPzItk.d.mts → operators-CgcsYzfy.d.mts} +24 -3
  377. package/dist/operators.d.mts +2 -2
  378. package/dist/patterns/LayoutLoadingShimmer/index.mjs +6 -6
  379. package/dist/patterns/LayoutLoadingSpinner/index.d.mts +2 -0
  380. package/dist/patterns/LayoutLoadingSpinner/index.mjs +56 -0
  381. package/dist/patterns/LayoutLoadingSpinner/index.mjs.map +1 -0
  382. package/dist/patterns/PageLayout/index.mjs +1 -1
  383. package/dist/styledComponentsInterop-8zScIQyC.mjs +33 -0
  384. package/dist/styledComponentsInterop-8zScIQyC.mjs.map +1 -0
  385. package/dist/{text-BaQdW8qa.d.mts → text-xwtyWIbE.d.mts} +1 -1
  386. package/dist/{theme-D9Y6NOzb.d.mts → theme-Ftogn9Wo.d.mts} +1 -1
  387. package/dist/theme.d.mts +1 -1
  388. package/dist/{types-CjHuZoVJ.d.mts → types-0_9G0kWg.d.mts} +3 -1
  389. package/dist/{types-BKEwt0uq.d.mts → types-BrNreYUU.d.mts} +2 -2
  390. package/dist/{types-mb3woqzE.d.mts → types-D55MZSyx.d.mts} +6 -3
  391. package/dist/types.d.mts +1 -1
  392. package/dist/types2.d.mts +1 -1
  393. package/dist/types3.d.mts +1 -1
  394. package/dist/useComboboxFooterAction.d.mts +1 -1
  395. package/dist/{useFilterStateV2-CGzRyv0i.d.mts → useFilterStateV2-D8Q8QKhS.d.mts} +3 -3
  396. package/dist/useFilterStateV2.d.mts +1 -1
  397. package/dist/{useFormField-DhwEi45-.d.mts → useFormField-BBbq1izo.d.mts} +1 -1
  398. package/dist/{useFormField-eftOPiXj.mjs → useFormField-Bz2iMPBO.mjs} +2 -2
  399. package/dist/{useFormField-eftOPiXj.mjs.map → useFormField-Bz2iMPBO.mjs.map} +1 -1
  400. package/dist/useFormField.d.mts +1 -1
  401. package/dist/{useFormGroup-BMukAMAd.mjs → useFormGroup-CaTiD_Yt.mjs} +1 -1
  402. package/dist/{useFormGroup-BMukAMAd.mjs.map → useFormGroup-CaTiD_Yt.mjs.map} +1 -1
  403. package/dist/{useTableBoxDragAndDrop-CsnN52lx.d.mts → useTableBoxDragAndDrop-Bye8gJTl.d.mts} +1 -1
  404. package/dist/useTableBoxDragAndDrop.d.mts +1 -1
  405. package/dist/{useToggle-3k3EkV8V.mjs → useToggle-Bo3yd14Y.mjs} +1 -1
  406. package/dist/{useToggle-3k3EkV8V.mjs.map → useToggle-Bo3yd14Y.mjs.map} +1 -1
  407. package/dist/useTruncation.d.mts +1 -1
  408. package/dist/{utilities-DnSIlR1i.d.mts → utilities-Bmwk_DRn.d.mts} +1 -1
  409. package/dist/utilities.d.mts +1 -1
  410. package/dist/utils/storybook.mjs +1 -1
  411. package/dist/utils.d.mts +1 -1
  412. package/dist/utils2.d.mts +12 -1
  413. package/dist/utils3.d.mts +7 -0
  414. package/dist/{validation-BdP2vajF.d.mts → validation-CAtTuHO9.d.mts} +3 -3
  415. package/dist/validation.d.mts +1 -1
  416. package/dist/{value-control-resolver-CiGEHQAc.d.mts → value-control-resolver-DadI8r9a.d.mts} +2 -2
  417. package/dist/value-control-resolver.d.mts +1 -1
  418. package/dist/variables/keyframes.mjs +1 -1
  419. package/llms.txt +5 -5
  420. package/package.json +8 -3
  421. package/skills/ui-authoring/COMPONENTS.md +69 -305
  422. package/skills/ui-authoring/PATTERNS.md +362 -0
  423. package/skills/ui-authoring/SKILL.md +15 -147
  424. package/skills/ui-authoring/TOKENS.md +400 -0
  425. package/dist/CardV2-m9yOInMU.mjs.map +0 -1
  426. package/dist/Checkbox-CU27-Aa8.mjs.map +0 -1
  427. package/dist/DatePicker-DpGvo7Bd.mjs.map +0 -1
  428. package/dist/FormControl-BIXJ-FPI.mjs.map +0 -1
  429. package/dist/FormField-DcGQvgNW.mjs.map +0 -1
  430. package/dist/HoverCopyableField-BHdCaR-R.mjs.map +0 -1
  431. package/dist/IconButton-DC4rh6ow.mjs.map +0 -1
  432. package/dist/ListBox-BwD-q7wF.mjs.map +0 -1
  433. package/dist/Radio-CtPz3EzX.mjs.map +0 -1
  434. package/dist/SectionHeading-DvP9NEgN.d.mts +0 -71
  435. package/dist/TableControls-BK8DCsqi.mjs.map +0 -1
  436. package/skills/ui-authoring/EXAMPLES.md +0 -370
  437. package/skills/ui-authoring/REFERENCE.md +0 -293
  438. /package/dist/{index-7rWKHdox.d.mts → index-BSVhZrWN.d.mts} +0 -0
  439. /package/dist/{index-B4woaFSm.d.mts → index-BrGZHEgX.d.mts} +0 -0
  440. /package/dist/{index-BOn0AAue.d.mts → index-BwAfCVZH2.d.mts} +0 -0
  441. /package/dist/{index-CKKoxA9V.d.mts → index-CDGG7lCB.d.mts} +0 -0
  442. /package/dist/{index-CRo77wc3.d.mts → index-CFhUdAHM.d.mts} +0 -0
  443. /package/dist/{index-Ci-uuV07.d.mts → index-CROz1VSV.d.mts} +0 -0
  444. /package/dist/{index-DDdPqD_H.d.mts → index-DA6_cwf8.d.mts} +0 -0
  445. /package/dist/{index-Es5nKSSL.d.mts → index-DM6vVDZD.d.mts} +0 -0
  446. /package/dist/{index-FtE8MXJ_.d.mts → index-Jh0C5PIG.d.mts} +0 -0
  447. /package/dist/{index-ehD5GjMH.d.mts → index-PWQavSPf.d.mts} +0 -0
  448. /package/dist/{index-uMNhmxEh.d.mts → index-sViox9YW.d.mts} +0 -0
@@ -0,0 +1,400 @@
1
+ # Design Tokens
2
+
3
+ How to pick values from `@persona/design-tokens`, plus the `Color` / `Spacing` / `Typography` catalog.
4
+
5
+ ```tsx
6
+ import { BorderRadius, ChartingColors, Color, Spacing, Typography } from '@persona/design-tokens';
7
+ ```
8
+
9
+ ## Color
10
+
11
+ `Color` is an enum of named colors organized by purpose (`Text*`, `Background*`, `Border*`, and
12
+ others), plus a `Core*` palette and a `Primary*` brand set.
13
+
14
+ Use according to this priority:
15
+
16
+ 1. Purpose-named `Color.*` (`Text*`, `Background*`, `Border*`, …)
17
+ 2. `Color.Core*` / `Color.Primary*` with a comment explaining the choice. For `Core*`, that comment is an `oxlint-disable-next-line persona-web/no-core-color-tokens`.
18
+ 3. Hardcoded hex (only if absolutely necessary) with a comment explaining the choice.
19
+
20
+ ```tsx
21
+ // ❌ Color.CorePurple500 / Color.PrimaryPurple / #3F48FD
22
+ // ✅ Color.TextActive / Color.BackgroundButtonPrimary
23
+ ```
24
+
25
+ | Need | Use |
26
+ |------|-----|
27
+ | Text | `Color.TextPrimary` / `TextSecondary` / `TextInverse` / `TextActive` / `TextDanger` / `TextDisabled` |
28
+ | Page / card background | `Color.BackgroundPrimary` / `BackgroundSecondary` |
29
+ | Borders | `Color.BorderHairline` / `BorderDivider` / `BorderFocus` |
30
+ | Buttons | `Color.BackgroundButtonPrimary` (and Default / Danger + Hover variants) |
31
+ | Inputs | `Color.BackgroundInputDefault` / `BorderInputDefault` |
32
+ | Charts | `ChartingColors.Sequential` or `.Categorical` |
33
+
34
+ ```tsx
35
+ const Panel = styled.div`
36
+ background-color: ${Color.BackgroundPrimary};
37
+ border: 1px solid ${Color.BorderDivider};
38
+ color: ${Color.TextPrimary};
39
+
40
+ &:hover {
41
+ background-color: ${Color.BackgroundSecondary};
42
+ }
43
+ `;
44
+ ```
45
+
46
+ ### Core
47
+
48
+ Each core color has shades from 50 (lightest) to 1100 (darkest):
49
+
50
+ ```tsx
51
+ // Purple
52
+ Color.CorePurple50 // #F4F5FF (lightest)
53
+ Color.CorePurple100
54
+ Color.CorePurple500 // Mid-range purple
55
+ Color.CorePurple700
56
+ Color.CorePurple1100 // #010334 (darkest)
57
+
58
+ // Other core colors follow same pattern:
59
+ // CoreRed, CoreOrange, CoreYellow, CoreGreen, CoreTeal, CoreBlue, CoreSlate
60
+ ```
61
+
62
+ ### Primary
63
+
64
+ ```tsx
65
+ Color.PrimaryBlack // #000000
66
+ Color.PrimaryWhite // #FFFFFF
67
+ Color.PrimaryPurple // #3F48FD (brand purple)
68
+ Color.PrimaryRed // #F04B38
69
+ Color.PrimaryOrange // #F59602
70
+ Color.PrimaryYellow // #DFFD2F
71
+ Color.PrimaryGreen // #41D49D
72
+ Color.PrimaryTeal // #36EBFD
73
+ Color.PrimaryBlue // #2B7FFD
74
+ ```
75
+
76
+ ### Background
77
+
78
+ ```tsx
79
+ Color.BackgroundPrimary // #FFFFFF (main background)
80
+ Color.BackgroundSecondary // #F5F5F6
81
+
82
+ // Button backgrounds
83
+ Color.BackgroundButtonDefault
84
+ Color.BackgroundButtonDefaultHover
85
+ Color.BackgroundButtonPrimary
86
+ Color.BackgroundButtonPrimaryHover
87
+ Color.BackgroundButtonDanger
88
+ Color.BackgroundButtonDangerHover
89
+
90
+ // Input backgrounds
91
+ Color.BackgroundInputDefault
92
+ Color.BackgroundInputActive
93
+ Color.BackgroundInputDisabled
94
+
95
+ // Label backgrounds
96
+ Color.BackgroundLabelGrey
97
+ Color.BackgroundLabelPurple
98
+ Color.BackgroundLabelRed
99
+ Color.BackgroundLabelGreen
100
+ // ... and more label variants
101
+
102
+ // Status indicator backgrounds
103
+ Color.BackgroundStatusIndicatorSuccess
104
+ Color.BackgroundStatusIndicatorWarning
105
+ Color.BackgroundStatusIndicatorCritical
106
+ Color.BackgroundStatusIndicatorFeature
107
+ ```
108
+
109
+ ### Text
110
+
111
+ ```tsx
112
+ Color.TextPrimary // #313131 (main text)
113
+ Color.TextSecondary // #707070 (secondary text)
114
+ Color.TextInverse // #FFFFFF (text on dark backgrounds)
115
+ Color.TextActive // #3F48FD (active/link text)
116
+ Color.TextDanger // #B81F0E (error text)
117
+ Color.TextDisabled // #BDBDBD (disabled text)
118
+
119
+ // Status indicator text colors
120
+ Color.TextStatusIndicatorSuccess
121
+ Color.TextStatusIndicatorWarning
122
+ Color.TextStatusIndicatorCritical
123
+ ```
124
+
125
+ ### Border
126
+
127
+ ```tsx
128
+ Color.BorderHairline // #F1F1F2 (subtle border)
129
+ Color.BorderDivider // #E2E2E3 (section divider)
130
+ Color.BorderFocus // #2B7FFD (focus state)
131
+
132
+ // Input borders
133
+ Color.BorderInputDefault
134
+ Color.BorderInputHover
135
+ Color.BorderInputActive
136
+ Color.BorderInputWarning
137
+ Color.BorderInputDanger
138
+ Color.BorderInputDisabled
139
+
140
+ // Icon borders
141
+ Color.BorderIconPrimary
142
+ Color.BorderIconSecondary
143
+ Color.BorderIconActive
144
+ Color.BorderIconSuccess
145
+ Color.BorderIconWarning
146
+ Color.BorderIconDanger
147
+ ```
148
+
149
+ ## Spacing
150
+
151
+ `Spacing` is an enum of fixed gaps from `0` to `56px` (`Spacing[0]`–`Spacing[9]`).
152
+
153
+ Use according to this priority:
154
+
155
+ 1. `Spacing[0–9]`
156
+ 2. Hardcoded px (multiple of 4, only if absolutely necessary); comment what it's doing
157
+
158
+ Pass `Spacing[n]` into `Stack` / `HStack` `spacing` — do not set `gap` on a styled flex wrapper.
159
+
160
+ ```tsx
161
+ // ❌ gap: 18px;
162
+ // ✅ spacing={Spacing[4]} / padding: ${Spacing[5]};
163
+ // ✅ padding: 72px; /* hero offset; no Spacing step */
164
+ ```
165
+
166
+ | Need | Use |
167
+ |------|-----|
168
+ | Icon-to-text, tight groupings | `Spacing[1]`–`Spacing[2]` |
169
+ | Form field padding, button padding | `Spacing[3]`–`Spacing[4]` |
170
+ | Section margins, card padding | `Spacing[5]` |
171
+ | Component spacing, page sections | `Spacing[6]`–`Spacing[7]` |
172
+ | Hero sections, major divisions | `Spacing[8]`–`Spacing[9]` |
173
+
174
+ ```tsx
175
+ const Container = styled.div`
176
+ padding: ${Spacing[5]};
177
+ margin-bottom: ${Spacing[4]};
178
+ `;
179
+ ```
180
+
181
+ ### Scale
182
+
183
+ ```tsx
184
+ Spacing[0] // "0px"
185
+ Spacing[1] // "4px"
186
+ Spacing[2] // "8px"
187
+ Spacing[3] // "12px"
188
+ Spacing[4] // "16px"
189
+ Spacing[5] // "24px"
190
+ Spacing[6] // "32px"
191
+ Spacing[7] // "40px"
192
+ Spacing[8] // "48px"
193
+ Spacing[9] // "56px"
194
+ ```
195
+
196
+ ## Typography
197
+
198
+ `Typography` is a set of complete type styles (`fontFamily`, `fontWeight`, `lineHeight`, `fontSize`,
199
+ `textDecoration`).
200
+
201
+ **IMPORTANT:** Never assemble type from individual `FontSize` / `FontWeight` / `FontFamily` tokens or hardcoded sizes.
202
+
203
+ Use according to this priority:
204
+
205
+ 1. `Heading` / `Paragraph` / `Label`
206
+ 2. Complete `Typography.*` style
207
+
208
+ `Paragraph` defaults to `color="secondary"` (grey). Use `color="primary"` for body that should read
209
+ as main text.
210
+
211
+ ```tsx
212
+ // ❌ font-size: 14px; font-weight: 500;
213
+ // ✅ <Paragraph size="md">…</Paragraph>
214
+ // ✅ ${Typography.TextMedium}
215
+ ```
216
+
217
+ | Need | Use |
218
+ |------|-----|
219
+ | Headers and hero sections | `Typography.DisplayLarge` / `DisplayMedium` / `DisplaySmall` |
220
+ | Section headers and sub-headers | `Heading` / `Typography.HeadingLarge`–`HeadingExtraSmall` |
221
+ | Body copy and UI text | `Paragraph` / `Typography.TextMedium` |
222
+ | Caption / helper | `Paragraph` `size="sm"` / `Typography.TextSmall` |
223
+ | Form label | `Label` |
224
+ | Code | `Typography.TextMono` |
225
+
226
+ Each `Typography` style is a complete `PDSTypeStyle`:
227
+
228
+ ```tsx
229
+ type PDSTypeStyle = {
230
+ fontFamily: FontFamily;
231
+ fontWeight: FontWeight;
232
+ lineHeight: LineHeight;
233
+ fontSize: FontSize;
234
+ textDecoration: TextDecoration;
235
+ };
236
+ ```
237
+
238
+ Styled components usage:
239
+
240
+ ```tsx
241
+ const Heading = styled.h1`
242
+ ${Typography.HeadingLarge}
243
+ color: ${Color.TextPrimary};
244
+ `;
245
+
246
+ const BodyText = styled.p`
247
+ ${Typography.TextMedium}
248
+ color: ${Color.TextSecondary};
249
+ `;
250
+
251
+ const SmallLabel = styled.span`
252
+ ${Typography.TextSmall}
253
+ color: ${Color.TextSecondary};
254
+ `;
255
+ ```
256
+
257
+ ### Display
258
+
259
+ ```tsx
260
+ Typography.DisplayLarge // 64px, bold
261
+ Typography.DisplayMedium // 48px, bold
262
+ Typography.DisplaySmall // 36px, bold
263
+ ```
264
+
265
+ ### Heading
266
+
267
+ ```tsx
268
+ Typography.HeadingLarge // 28px
269
+ Typography.HeadingMedium // 24px
270
+ Typography.HeadingSmall // 20px
271
+ Typography.HeadingExtraSmall // 16px
272
+ ```
273
+
274
+ ### Text / paragraph
275
+
276
+ ```tsx
277
+ Typography.TextLarge // 16px, regular
278
+ Typography.TextLargeBold // 16px, bold
279
+ Typography.TextLargeLight // 16px, light
280
+
281
+ Typography.TextMedium // 14px, regular — most common body
282
+ Typography.TextMediumBold // 14px, bold
283
+ Typography.TextMediumLight // 14px, light
284
+ Typography.TextMediumLink // 14px, regular, underlined
285
+
286
+ Typography.TextSmall // 12px, regular
287
+ Typography.TextSmallBold // 12px, bold
288
+ Typography.TextSmallLink // 12px, regular, underlined
289
+ Typography.TextExtraSmall // 10px
290
+
291
+ Typography.TextMono // 14px, monospace
292
+ ```
293
+
294
+ ## Radius
295
+
296
+ `BorderRadius` is a small set of corner radii.
297
+
298
+ Use according to this priority:
299
+
300
+ 1. `BorderRadius.Sm` / `Md` / `Lg` / `Xl` / `Circle`
301
+ 2. Hardcoded value (only if absolutely necessary); comment what it's doing
302
+
303
+ | Need | Use |
304
+ |------|-----|
305
+ | Subtle rounding on small interactive elements (Checkboxes) | `BorderRadius.Sm` |
306
+ | Inputs, Menus, Banners, Buttons | `BorderRadius.Md` |
307
+ | Cards, Modals | `BorderRadius.Lg` |
308
+ | Pills, larger rounding | `BorderRadius.Xl` |
309
+ | Circular components (Radio Buttons) | `BorderRadius.Circle` |
310
+
311
+ ```tsx
312
+ const Card = styled.div`
313
+ border-radius: ${BorderRadius.Lg};
314
+ `;
315
+ ```
316
+
317
+ ### Scale
318
+
319
+ ```tsx
320
+ BorderRadius.Sm // 3px
321
+ BorderRadius.Md // 4px
322
+ BorderRadius.Lg // 8px
323
+ BorderRadius.Xl // 12px
324
+ BorderRadius.Circle // 50%
325
+ ```
326
+
327
+ ## Elevation
328
+
329
+ `Elevation` is a set of box-shadows for stacking UI. Import it from
330
+ `@persona/design-system/variables/effect` — it is not in `@persona/design-tokens`.
331
+
332
+ ```tsx
333
+ import { Elevation } from '@persona/design-system/variables/effect';
334
+ ```
335
+
336
+ Use according to this priority:
337
+
338
+ 1. `Elevation.Low` / `Mid` / `High`
339
+ 2. Custom shadow (only if absolutely necessary); comment what it's doing
340
+
341
+ | Need | Use |
342
+ |------|-----|
343
+ | Menus, Popovers | `Elevation.Low` |
344
+ | Cards, Date Pickers | `Elevation.Mid` |
345
+ | Modals | `Elevation.High` |
346
+
347
+ ```tsx
348
+ const Menu = styled.div`
349
+ box-shadow: ${Elevation.Low};
350
+ `;
351
+ ```
352
+
353
+ ## Charts
354
+
355
+ Use `recharts` for all chart components.
356
+
357
+ Use according to this priority:
358
+
359
+ 1. `ChartingColors.Sequential` (ordered / numeric) or `ChartingColors.Categorical` (unordered)
360
+ 2. Hardcoded hex (only if absolutely necessary) with a comment explaining the choice.
361
+
362
+ `Categorical` is for light backgrounds. If you exceed the max series, group leftover items or link
363
+ to an export — do not invent extra hex colors.
364
+
365
+ | Need | Use | Max series |
366
+ |------|-----|------------|
367
+ | Numeric / ordered | `ChartingColors.Sequential` | 8 |
368
+ | Categorical / unordered | `ChartingColors.Categorical` | 14 |
369
+
370
+ ```tsx
371
+ <Pie data={data} dataKey="value">
372
+ {data.map((_, i) => (
373
+ <Cell key={i} fill={ChartingColors.Categorical[i % ChartingColors.Categorical.length]} />
374
+ ))}
375
+ </Pie>
376
+ ```
377
+
378
+ ## Token Verification
379
+
380
+ To explore available tokens in your project:
381
+
382
+ ```bash
383
+ # Search for color definitions
384
+ grep -r "Color\." node_modules/@persona/design-tokens/dist/js/colors.d.ts
385
+
386
+ # Check spacing values
387
+ cat node_modules/@persona/design-tokens/dist/js/spacing.d.ts
388
+
389
+ # See typography styles
390
+ cat node_modules/@persona/design-tokens/dist/js/typography.d.ts
391
+ ```
392
+
393
+ Or check programmatically:
394
+
395
+ ```tsx
396
+ import * as DesignTokens from '@persona/design-tokens';
397
+ console.log(DesignTokens.Color);
398
+ console.log(DesignTokens.Spacing);
399
+ console.log(DesignTokens.Typography);
400
+ ```
@@ -1 +0,0 @@
1
- {"version":3,"file":"CardV2-m9yOInMU.mjs","names":["CardLoadingShimmer","Heading","Button","DropdownMenu"],"sources":["../components/CardV2/SectionHeading.tsx","../components/CardV2/Section.tsx","../components/CardV2/Card.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, FC, ReactElement, ReactNode } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Color, Spacing, Typography } from '@persona/design-tokens';\nimport { ChevronDownIcon, MoreIcon } from '@persona/icons';\nimport Button, { IconButton } from 'design-system/components/Button';\nimport DropdownButton from 'design-system/components/DropdownButton';\nimport DropdownMenu from 'design-system/components/DropdownMenu';\nimport { LoadingShimmer } from 'design-system/components/LoadingShimmer';\nimport { HStack } from 'design-system/components/Stack';\nimport { Heading } from 'design-system/components/Text';\nimport Tooltip from 'design-system/components/Tooltip';\nimport { HeadlessAriaButton } from 'design-system/lib/HeadlessAriaButton';\nimport { TruncatedText } from 'design-system/lib/TruncatedText';\nimport { focusStyle } from 'design-system/mixins/focus';\nimport type { HeadingSize } from 'design-system/mixins/text';\nimport type { IconAction, MenuAction, TextAction } from 'design-system/types/Action';\nimport { TransitionDuration } from 'design-system/variables/transitions';\n\nconst CardLoadingShimmer = styled(LoadingShimmer)`\n border-radius: ${({ theme }) => theme.card.borderRadius};\n`;\n\nconst StickerContainer = styled.div`\n display: flex;\n max-width: 180px;\n`;\n\ntype AccordionContainerProps = {\n $isTopSection: boolean;\n $expanded: boolean;\n};\nconst AccordionContainer = styled.div<AccordionContainerProps>`\n transition: opacity ${TransitionDuration.Faster};\n position: absolute;\n opacity: 0;\n\n height: 12px;\n width: 12px;\n display: flex;\n align-items: center;\n /* Because of padding in the top section heading we need to offset differently. */\n /* We want a 12px icon to be off-center in 24px padding, 4px on the right and 8px on the left */\n left: ${({ $isTopSection }) => ($isTopSection ? '8px' : '-16px')};\n /* center the icon vertically */\n top: calc(50% - 6px);\n\n border-radius: 1px;\n\n & svg {\n transition: transform ${TransitionDuration.Faster} ease-out;\n transform: rotate(${({ $expanded }) => ($expanded ? '0' : '-90deg')});\n }\n`;\n\nconst HeaderButton = styled(HeadlessAriaButton)`\n min-width: 0;\n flex: 1;\n\n &:hover ~ ${AccordionContainer} {\n opacity: 1;\n }\n\n &:focus-visible ~ ${AccordionContainer} {\n opacity: 1;\n ${focusStyle}\n }\n`;\n\ntype HeadingContainerProps = {\n $isTopSection: boolean;\n $divider: boolean;\n $hasFooter: boolean;\n $isExpanded: boolean;\n};\nconst HeadingContainer = styled(HStack)<HeadingContainerProps>`\n position: relative;\n\n ${({ $isTopSection }) =>\n $isTopSection &&\n css`\n padding: ${Spacing[4]} ${Spacing[5]};\n `}\n ${({ $divider }) =>\n $divider &&\n css`\n border-bottom: 1px solid ${Color.BorderDivider};\n `}\n ${({ $isTopSection, $hasFooter, $isExpanded }) =>\n $isTopSection &&\n !$hasFooter &&\n !$isExpanded &&\n css`\n // We apply 4px of whitespace to the bottom of the card container so that content has a buffer\n // when being scrolled and still appears inside the card. Here we adjust, subtracting\n // 4px from the 16px padding.\n padding-bottom: ${Spacing[3]};\n `}\n`;\n\ntype StyledHeadingProps = {\n $isCollapsible: boolean;\n $isTopSection: boolean;\n size: HeadingSize;\n};\nconst StyledHeading = styled(Heading)<StyledHeadingProps>`\n flex: 1;\n display: flex;\n align-items: center;\n gap: ${Spacing[2]};\n line-height: 24px; // We want an adjusted line-height to hit the target header size.\n overflow: hidden;\n\n ${({ $isCollapsible }) => $isCollapsible && 'cursor: pointer;'}\n ${({ $isTopSection }) =>\n !$isTopSection &&\n css`\n ${Typography.TextLargeBold};\n `}\n`;\n\nconst isIconAction = (action: IconAction | TextAction): action is IconAction => 'icon' in action;\n\nconst ButtonRow: FC<{\n actions: (IconAction | TextAction)[];\n menuActions: MenuAction[];\n}> = ({ actions, menuActions }) => {\n const buttons = actions\n .filter((action) => !action.hidden)\n .map((action, i) => {\n const key = isIconAction(action)\n ? (action.id ?? action.ariaLabel ?? `action-${i}`)\n : (action.id ?? action.label ?? `action-${i}`);\n\n const button = isIconAction(action) ? (\n <IconButton\n id={action.id}\n key={key}\n to={action.to}\n onClick={(e) => {\n e.stopPropagation();\n return action.onClick?.(e);\n }}\n disabled={action.disabled}\n aria-label={action.ariaLabel}\n size='sm'\n >\n {action.icon}\n </IconButton>\n ) : (\n <Button\n id={action.id}\n key={key}\n aria-label={action.ariaLabel}\n to={action.to}\n onClick={(e) => {\n e.stopPropagation();\n return action.onClick?.(e);\n }}\n disabled={action.disabled}\n variant={action.variant ?? 'basic'}\n size='sm'\n width='auto'\n prefixIcon={action.prefixIcon}\n suffixIcon={action.suffixIcon}\n >\n {action.label}\n </Button>\n );\n\n return action.tooltip ? (\n <Tooltip key={key} {...action.tooltipProps} trigger={button}>\n {action.tooltip}\n </Tooltip>\n ) : (\n button\n );\n });\n\n return (\n <HStack>\n {buttons}\n {menuActions.length > 0 && (\n <DropdownButton\n variant='text'\n width='icon'\n size='sm'\n suffixIcon={undefined}\n style={{ justifySelf: 'flex-end' }}\n aria-label='More actions'\n menuProps={{\n portal: true,\n }}\n menuItems={menuActions\n .filter((action) => !action.hidden)\n .map((action) => (\n <DropdownMenu.Item\n id={action.id ?? action.label}\n key={action.id ?? action.label}\n onClick={action.onClick}\n disabled={action.disabled}\n >\n {action.label}\n </DropdownMenu.Item>\n ))}\n >\n <MoreIcon />\n </DropdownButton>\n )}\n </HStack>\n );\n};\n\n/**\n * Private component for rendering the heading of a section, both the primary card heading and\n * section headings.\n */\nexport const SectionHeading: FC<{\n /**\n * Whether this is the top-level section of the card which has different visual treatment.\n */\n isTopSection: boolean;\n\n /**\n * Whether this heading's section has content.\n */\n sectionHasContent: boolean;\n\n /**\n * Whether this heading's section has a footer.\n */\n hasFooter: boolean;\n\n loading: boolean;\n\n /**\n * Title text to render in the heading.\n */\n title: string;\n\n /**\n * Optional sticker to render after the title.\n */\n sticker?: ReactElement;\n\n /**\n * Optional icon to render before the title text.\n *\n * Usage of this icon slot should be avoided if possible to maintain left-text alignement. If\n * using this icon slot for a section heading use it for all sections.\n */\n leftDecorativeIcon?: ReactElement;\n\n /**\n * Optional actions to render in the heading.\n * Only accepts IconButton or Button components with specific prop restrictions.\n */\n actions?: (IconAction | TextAction | undefined)[];\n\n /**\n * Optional actions to render in the heading in a menu.\n */\n menuActions?: (MenuAction | undefined)[];\n\n /**\n * Optional custom content to render in the heading in the button row. Prefer setting `actions` or\n * `menuActions` if possible.\n */\n headerActionsRowContent?: ReactNode;\n\n /**\n * Callback to toggle collapsed state of the section. Omit to disable collapsing.\n */\n toggle?: () => void;\n\n /**\n * Whether the section is currently expanded or collapsed.\n */\n isExpanded: boolean;\n\n /**\n * Optional props to pass to the heading element. Accepts an `as` key to override the\n * rendered heading level. Defaults to `h2` for the top-level card heading and `h3` for\n * section headings so that the document heading hierarchy reflects the visual hierarchy.\n */\n headingProps?: Omit<ComponentPropsWithoutRef<'span'>, 'color'> & {\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n };\n}> = ({\n isTopSection,\n sectionHasContent,\n hasFooter,\n loading,\n title,\n actions = [],\n menuActions = [],\n headerActionsRowContent,\n sticker,\n leftDecorativeIcon,\n toggle,\n isExpanded,\n headingProps,\n}) => {\n const renderButtonRow = actions.length > 0 || menuActions.length > 0;\n const { as: headingAs, ...restHeadingProps } = headingProps ?? {};\n\n return (\n <HeadingContainer\n $isTopSection={isTopSection}\n $hasFooter={hasFooter}\n $isExpanded={isExpanded}\n $divider={isTopSection && isExpanded && sectionHasContent}\n align='center'\n justify='space-between'\n spacing={Spacing[2]}\n >\n {loading ? (\n <CardLoadingShimmer height='24px' width='200px' />\n ) : (\n <>\n {/* https://github.com/adobe/react-spectrum/issues/7444 */}\n <HeaderButton slot='trigger' isDisabled={!toggle}>\n <StyledHeading\n forwardedAs={headingAs ?? (isTopSection ? 'h2' : 'h3')}\n size='xsm'\n $isCollapsible={!!toggle}\n $isTopSection={isTopSection}\n aria-label={title}\n {...restHeadingProps}\n >\n {leftDecorativeIcon}\n <TruncatedText>{title}</TruncatedText>\n {sticker && <StickerContainer>{sticker}</StickerContainer>}\n </StyledHeading>\n </HeaderButton>\n {headerActionsRowContent}\n {renderButtonRow && (\n <ButtonRow\n actions={actions.filter((action) => action != null)}\n menuActions={menuActions.filter((action) => action != null)}\n />\n )}\n {toggle && (\n <AccordionContainer $isTopSection={isTopSection} $expanded={isExpanded}>\n <ChevronDownIcon />\n </AccordionContainer>\n )}\n </>\n )}\n </HeadingContainer>\n );\n};\n","import type { ComponentProps, FC, ReactNode } from 'react';\nimport { Disclosure, DisclosurePanel } from 'react-aria-components';\nimport styled, { css } from 'styled-components';\n\nimport { Color, Spacing } from '@persona/design-tokens';\nimport { SectionHeading } from 'design-system/components/CardV2/SectionHeading';\nimport { LoadingShimmer } from 'design-system/components/LoadingShimmer';\nimport { HStack } from 'design-system/components/Stack';\nimport { Paragraph } from 'design-system/components/Text';\nimport { intersperse } from 'design-system/lib/intersperse';\nimport { Z_INDICES } from 'design-system/lib/zindex';\n\nconst FooterParagraph = styled(Paragraph)`\n line-height: 16px;\n`;\n\ntype FooterContainerProps = {\n $divider: boolean;\n};\nconst FooterContainer = styled.div<FooterContainerProps>`\n ${({ $divider }) =>\n $divider &&\n css`\n border-top: 1px solid ${Color.BorderDivider};\n `}\n padding: ${Spacing[3]} ${Spacing[5]} ${Spacing[2]};\n`;\n\ntype MaybeStickyContainerProps = {\n $enabled: boolean;\n $bottom?: boolean;\n};\nconst MaybeStickyContainer = styled.div<MaybeStickyContainerProps>`\n ${({ $enabled }) =>\n $enabled &&\n css`\n // We are using sticky positioning here to have consistent scrollbar behavior between\n // different card configurations. Usage of sticky allows us to keep the scroll container at\n // the top of the card DOM structure regardless of whether the heading or footer is sticky.\n //\n // This also afaict helps eliminate the need to carry height values through the card DOM\n // structure to the content container (and possibly needing to adjust heights for heading and footer).\n position: sticky;\n top: 0;\n background-color: ${({ theme }) => theme.color.background.primary};\n z-index: ${Z_INDICES.sticky};\n `}\n\n ${({ $bottom = false }) =>\n $bottom &&\n css`\n top: unset;\n bottom: 0;\n `}\n`;\n\ntype StyledDisclosureProps = {\n $fullHeight: boolean;\n};\nconst StyledDisclosure = styled(Disclosure)<StyledDisclosureProps>`\n display: flex;\n flex-direction: column;\n gap: 0;\n ${({ $fullHeight }) =>\n $fullHeight &&\n css`\n height: 100%;\n `}\n`;\n\ntype StyledDisclosurePanelProps = {\n $isTopSection: boolean;\n};\nconst StyledDisclosurePanel = styled(DisclosurePanel)<StyledDisclosurePanelProps>`\n flex: 1;\n ${({ $isTopSection }) =>\n $isTopSection &&\n css`\n // Safari does not support hidden='until-found' so react-aria uses display: none instead.\n // Since react-aria is using display to hide content we need to not set display ourselves.\n &:not([aria-hidden='true']) {\n display: flex;\n }\n `}\n`;\n\nconst CardLoadingShimmer = styled(LoadingShimmer)`\n border-radius: ${({ theme }) => theme.card.borderRadius};\n`;\n\ntype SectionContentContainerProps = {\n $isTopSection: boolean;\n $hasHeading: boolean;\n $hasFooter: boolean;\n};\nconst SectionContentContainer = styled.div<SectionContentContainerProps>`\n ${({ $isTopSection }) =>\n $isTopSection &&\n css`\n padding: ${Spacing[5]};\n display: flex;\n flex-direction: column;\n gap: ${Spacing[5]};\n flex: 1;\n /* Prevent grid blowout https://css-tricks.com/preventing-a-grid-blowout/ */\n min-width: 0;\n `}\n\n ${({ $isTopSection, $hasHeading }) =>\n !$isTopSection &&\n $hasHeading &&\n css`\n padding-top: ${Spacing[3]};\n `}\n\n ${({ $isTopSection, $hasFooter }) =>\n $isTopSection &&\n !$hasFooter &&\n css`\n // We apply 4px of whitespace to the bottom of the card container so that content has a buffer\n // when being scrolled and still appears inside the card. Here we adjust, subtracting\n // 4px from the 24px padding.\n padding-bottom: 20px;\n `}\n`;\n\n/**\n * Private component for rendering sections of the card, both the primary card section and\n * individual sections.\n */\nexport const Section: FC<{\n children?: ReactNode;\n\n /**\n * Whether this is the top-level section of the card which has different visual treatment.\n */\n isTopSection: boolean;\n\n /**\n * Available props for the section's heading.\n */\n heading?: Pick<\n ComponentProps<typeof SectionHeading>,\n | 'title'\n | 'actions'\n | 'menuActions'\n | 'headerActionsRowContent'\n | 'sticker'\n | 'leftDecorativeIcon'\n | 'headingProps'\n >;\n\n /**\n * Optional footer to render at the bottom of the card. Footer content is rendered as a\n * paragraph with the items separated by a dot.\n */\n footer?: ReactNode[];\n\n /**\n * Optional arbitrary footer content to render as-is.\n */\n footerContent?: ReactNode;\n\n /**\n * Whether the section is collapsible.\n */\n collapsible?: boolean;\n\n /**\n * Whether the section heading and footer are sticky.\n */\n sticky?: boolean;\n\n /**\n * Whether the section is initially collapsed.\n */\n defaultCollapsed?: boolean;\n\n /**\n * If true, the section will be rendered in a loading state.\n */\n loading?: boolean;\n\n /**\n * Set height of the loading state.\n */\n loadingProps?: {\n height?: string;\n };\n\n /**\n * Control display of the empty state.\n */\n empty?: boolean;\n\n /**\n * Props for the empty state.\n */\n emptyProps?: {\n /**\n * Empty state message.\n */\n message?: string;\n };\n\n fullHeight?: boolean;\n}> = ({\n children,\n isTopSection,\n heading,\n footer,\n footerContent,\n loading = false,\n loadingProps,\n empty = false,\n emptyProps,\n defaultCollapsed = false,\n collapsible = false,\n sticky = false,\n fullHeight = false,\n}) => {\n let content: ReactNode;\n if (loading) {\n content = <CardLoadingShimmer height={loadingProps?.height ?? '200px'} width='100%' />;\n } else if (empty) {\n content = <Paragraph>{emptyProps?.message ?? 'No data collected'}</Paragraph>;\n } else {\n content = children;\n }\n\n const hasFooter = !!(footer || footerContent);\n const hasContent = !!content;\n\n // Normally we would have `isDisabled` as well but there's a react-aria-components quirk\n // that sets `hidden` on the disclosure panel if both `defaultExpanded` and `isDisabled` are true.\n // https://github.com/adobe/react-spectrum/issues/7444\n return (\n <StyledDisclosure defaultExpanded={!defaultCollapsed} $fullHeight={fullHeight}>\n {({ isExpanded, state }) => (\n <>\n {heading && (\n <MaybeStickyContainer $enabled={sticky}>\n <SectionHeading\n isTopSection={isTopSection}\n hasFooter={hasFooter}\n sectionHasContent={hasContent}\n loading={loading}\n toggle={collapsible ? state.toggle : undefined}\n isExpanded={isExpanded}\n {...heading}\n />\n </MaybeStickyContainer>\n )}\n {hasContent && (\n <StyledDisclosurePanel $isTopSection={isTopSection}>\n <SectionContentContainer\n $isTopSection={isTopSection}\n $hasHeading={!!heading}\n $hasFooter={hasFooter}\n >\n {content}\n </SectionContentContainer>\n </StyledDisclosurePanel>\n )}\n {hasFooter && (\n <MaybeStickyContainer $enabled={sticky} $bottom>\n <FooterContainer $divider={hasContent}>\n {loading ? (\n <HStack>\n <CardLoadingShimmer height='16px' width='120px' />\n <CardLoadingShimmer height='16px' width='120px' />\n </HStack>\n ) : (\n <>\n {footer && (\n <FooterParagraph size='sm'>\n <HStack spacing={Spacing[1]}>\n {intersperse(\n footer\n .filter((item) => item != null)\n .map((item, i) => <span key={`footer-item-${i}`}>{item}</span>),\n (i) => (\n <span key={i}>•</span>\n ),\n )}\n </HStack>\n </FooterParagraph>\n )}\n {footerContent}\n </>\n )}\n </FooterContainer>\n </MaybeStickyContainer>\n )}\n </>\n )}\n </StyledDisclosure>\n );\n};\n","import { type ComponentProps, createContext, type FC, type ReactNode, useContext } from 'react';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport styled from 'styled-components';\n\nimport { Color } from '@persona/design-tokens';\nimport { Section } from 'design-system/components/CardV2/Section';\nimport { Paragraph } from 'design-system/components/Text';\nimport ConfigContext from 'design-system/lib/ConfigContext';\nimport { intersperse } from 'design-system/lib/intersperse';\n\nconst CardContainer = styled.div`\n border-radius: ${({ theme }) => theme.card.borderRadius};\n background-color: ${({ theme }) => theme.color.background.primary};\n // Height has been tricky here.\n // inherit seems to work well for both grid and flexbox layouts. In a grid we want this\n // container to receive the full cell height, In a flexbox we want this container to flex, maintaining\n // the minimum height for it's content.\n height: inherit;\n overflow-y: auto;\n\n box-sizing: border-box;\n // Small buffer so that content is not scrolling right on the edge of the card.\n border-bottom: 4px solid ${({ theme }) => theme.color.background.primary};\n`;\n\nconst CardContext = createContext<{ isStacked?: boolean }>({});\n\nconst Divider = styled.hr`\n margin: 0;\n border: none;\n border-top: 1px solid ${Color.BorderDivider};\n`;\n\n/**\n * Renders a card section.\n */\nconst PublicSection: FC<\n Pick<\n ComponentProps<typeof Section>,\n | 'children'\n | 'collapsible'\n | 'defaultCollapsed'\n | 'heading'\n | 'loading'\n | 'loadingProps'\n | 'empty'\n | 'emptyProps'\n >\n> = (props) => {\n return <Section isTopSection={false} {...props} />;\n};\n\n/**\n * Render the card in a \"stacked\" mode. Used for rendering multiple cards on top of each other\n * that appear visually as a single card.\n */\nconst Stacked: FC<{\n children: ReactNode[];\n}> = ({ children }) => {\n return (\n <CardContext.Provider value={{ isStacked: true }}>\n <CardContainer>\n {intersperse(children, (i) => (\n <Divider key={i} />\n ))}\n </CardContainer>\n </CardContext.Provider>\n );\n};\n\nconst DEFAULT_ERROR_MESSAGE = '🔍 Oops, something went wrong loading this card.';\n\n/**\n * Renders a PDS Card.\n *\n * To render sections of the card use `<Card.Section>...</Card.Section>`\n */\nconst Card: FC<\n {\n /**\n * Optional footer to render at the bottom of the card. Footer content is rendered as a\n * paragraph with the items separated by a dot.\n */\n footer?: ReactNode[];\n\n /**\n * Optional arbitrary footer content to render as-is.\n */\n footerContent?: ReactNode;\n\n /**\n * Whether the card heading and footer are sticky.\n */\n sticky?: boolean;\n\n /**\n * Force the card to render in an errored state. Errors bubbling up from children will also\n * render the errored state.\n */\n errored?: boolean;\n\n /**\n * Props for the errored state.\n */\n erroredProps?: {\n /**\n * Message to render in the errored state.\n */\n message?: string;\n /**\n * Callback to handle errors. Note this callback is only called when the error is bubbled up\n * from children, not when `errored` is set to true.\n */\n onError?: (error: Error) => void;\n };\n\n containerProps?: ComponentProps<typeof CardContainer>;\n\n /**\n * Whether the card should render its content with 100% height. This is a bit of a hack for cards\n * that want full control of their content and don't use sections.\n */\n fullHeight?: boolean;\n } & ComponentProps<typeof PublicSection>\n> = ({ children, errored, erroredProps, containerProps, sticky = true, ...sectionProps }) => {\n const { isStacked = false } = useContext(CardContext);\n const { captureException } = useContext(ConfigContext);\n\n const errorFallback = (\n <Section isTopSection {...sectionProps}>\n <Paragraph>{erroredProps?.message ?? DEFAULT_ERROR_MESSAGE}</Paragraph>\n </Section>\n );\n\n const section = (\n <Section isTopSection sticky={sticky} {...sectionProps}>\n {children}\n </Section>\n );\n\n return (\n <ErrorBoundary\n fallback={\n isStacked ? (\n errorFallback\n ) : (\n <CardContainer {...containerProps}>{errorFallback}</CardContainer>\n )\n }\n onError={erroredProps?.onError ?? ((error) => captureException(error))}\n >\n {isStacked ? (\n <>{errored ? <>{errorFallback}</> : <>{section}</>}</>\n ) : (\n <CardContainer {...containerProps}>\n {errored ? <>{errorFallback}</> : <>{section}</>}\n </CardContainer>\n )}\n </ErrorBoundary>\n );\n};\n\nexport default Object.assign(Card, {\n Section: PublicSection,\n Stacked: Stacked,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAMA,uBAAqB,OAAO,eAAe;oBAC7B,EAAE,YAAY,MAAM,KAAK,aAAa;;AAG1D,MAAM,mBAAmB,OAAO,GAAG;;;;AASnC,MAAM,qBAAqB,OAAO,GAA4B;gCACZ;;;;;;;;;;WAUvC,EAAE,oBAAqB,gBAAgB,QAAQ,QAAS;;;;;;;oCAOb;yBAC7B,EAAE,gBAAiB,YAAY,MAAM,SAAU;;;AA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BAEA,oBAAC,eAAD;GAAe,GAAI;aAAiB;GAA8B,CAAA;EAGtE,SAAS,cAAc,aAAa,UAAU,iBAAiB,MAAM;YAEpE,YACC,oBAAA,YAAA,EAAA,UAAG,UAAU,oBAAA,YAAA,EAAA,UAAG,eAAiB,CAAA,GAAG,oBAAA,YAAA,EAAA,UAAG,SAAW,CAAA,EAAI,CAAA,GAEtD,oBAAC,eAAD;GAAe,GAAI;aAChB,UAAU,oBAAA,YAAA,EAAA,UAAG,eAAiB,CAAA,GAAG,oBAAA,YAAA,EAAA,UAAG,SAAW,CAAA;GAClC,CAAA;EAEJ,CAAA;;AAIpB,IAAA,eAAe,OAAO,OAAO,MAAM;CACjC,SAAS;CACA;CACV,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Checkbox-CU27-Aa8.mjs","names":[],"sources":["../components/Checkbox/Checkbox.tsx"],"sourcesContent":["import { uniqueId } from 'lodash';\nimport {\n type ChangeEvent,\n type ComponentPropsWithoutRef,\n forwardRef,\n type ReactNode,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Color, Spacing, Typography } from '@persona/design-tokens';\nimport { InputCheckIcon, InputDashIcon } from '@persona/icons';\nimport useFormField from 'design-system/components/FormControl/useFormField';\nimport Stack from 'design-system/components/Stack/Stack';\nimport Tooltip from 'design-system/components/Tooltip';\nimport { TextWithDashedUnderline } from 'design-system/components/Tooltip/TextUnderlineTooltip';\nimport {\n isChecked,\n isDisabled,\n isFocusedVisible,\n isHovered,\n isIndeterminate,\n isNotDisabled,\n} from 'design-system/lib/pseudoClass';\nimport useControlled from 'design-system/lib/useControlled';\nimport { focusStyle } from 'design-system/mixins/focus';\nimport { TransitionDuration } from 'design-system/variables/transitions';\n\nconst Container = styled(Stack)<{ size: 'md' | 'sm'; disabled?: boolean }>`\n position: relative;\n cursor: pointer;\n\n flex-wrap: nowrap;\n\n ${({ size }) =>\n size === 'sm' &&\n css`\n height: 16px;\n `}\n\n &${isDisabled} {\n cursor: default;\n }\n`;\n\nconst CheckboxBox = styled.div<{ disabled?: boolean; checked?: boolean }>`\n cursor: pointer;\n display: flex;\n flex: 0 0 16px;\n justify-content: center;\n align-items: center;\n transition:\n box-shadow ${TransitionDuration.Fast},\n background-color ${TransitionDuration.Fast},\n border-color ${TransitionDuration.Fast};\n border-radius: 3px;\n height: ${Spacing[4]};\n width: ${Spacing[4]};\n box-sizing: border-box;\n border: 1px solid ${Color.BorderInputCheckbox};\n background: ${Color.BackgroundInputDefault};\n\n svg {\n color: ${Color.BorderIconInverse};\n }\n\n &${isDisabled} {\n cursor: default;\n background: ${Color.BackgroundInputDisabled};\n border-color: ${Color.BorderInputDisabled};\n }\n\n ${({ checked }) =>\n checked &&\n css`\n border-color: ${Color.BackgroundInputActive};\n background: ${Color.BackgroundInputActive};\n\n &${isDisabled} {\n border-color: ${Color.BackgroundInputActiveDisabled};\n background: ${Color.BackgroundInputActiveDisabled};\n }\n `}\n`;\n\nconst CheckboxInput = styled.input`\n cursor: inherit;\n height: 16px;\n width: 16px;\n margin: 0;\n border: 0;\n opacity: 0;\n overflow: hidden;\n position: absolute;\n\n &${isHovered}${isNotDisabled} ~ ${CheckboxBox} {\n border-color: ${Color.BorderInputCheckboxHover};\n }\n\n &${isChecked}, &${isIndeterminate} {\n &${isHovered}${isNotDisabled} ~ ${CheckboxBox} {\n background: ${Color.BackgroundInputActiveHover};\n border-color: ${Color.BackgroundInputActiveHover};\n }\n }\n\n &${isFocusedVisible}${isNotDisabled} ~ ${CheckboxBox} {\n ${focusStyle}\n }\n`;\n\nconst Label = styled.label<{ disabled: boolean; size: 'md' | 'sm' }>`\n cursor: inherit;\n color: ${Color.TextPrimary};\n\n ${({ size }) =>\n size === 'sm'\n ? css`\n ${Typography.TextSmall};\n line-height: 16px;\n `\n : css`\n ${Typography.TextMedium};\n\n /** Nudge text for visual alignment */\n position: relative;\n bottom: -1px;\n `}\n\n ${({ theme, disabled }) =>\n disabled &&\n css`\n cursor: default;\n color: ${theme.color.text.disabled};\n `}\n`;\n\nexport interface CheckboxProps extends Omit<ComponentPropsWithoutRef<'input'>, 'value' | 'size'> {\n /**\n * `id` for the underlying `<input>`. If not provided a unique ID is generated\n * automatically and linked to the label.\n */\n id?: string;\n /** Called whenever the checked state changes. */\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void;\n /** Visible label rendered to the right of the checkbox box. */\n label?: ReactNode;\n /** Disables interaction and renders the checkbox in a muted style. */\n disabled?: boolean;\n /**\n * When true the checkbox displays a dash (−) instead of a tick, indicating a\n * mixed / partially-selected state. Sets `aria-checked=\"mixed\"` for screen readers.\n */\n indeterminate?: boolean;\n /**\n * Controlled checked state. Omit (or pass `undefined`) to let the component\n * manage state internally via `defaultChecked`.\n */\n checked?: boolean;\n /** Value submitted with a form. */\n value?: unknown;\n 'data-test'?: string;\n /** Additional props forwarded to the outer container `<div>`. */\n containerProps?: ComponentPropsWithoutRef<'div'>;\n /**\n * Size of the checkbox and its label text.\n * @defaultValue 'md'\n */\n size?: 'md' | 'sm';\n /**\n * Tooltip content to display when hovering over the label.\n * When provided, the label will be wrapped in a tooltip.\n */\n tooltip?: ReactNode;\n}\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n {\n className,\n disabled,\n indeterminate,\n onChange,\n checked: checkedProp,\n defaultChecked,\n id,\n label,\n 'data-test': dataTest,\n containerProps,\n value,\n size = 'md',\n tooltip,\n ...elemProps\n },\n ref,\n) {\n const field = useFormField({ disabled });\n const [checked, setChecked] = useControlled({\n controlledValue: checkedProp,\n default: defaultChecked,\n });\n const generatedId = useMemo(() => uniqueId('pds_checkbox__'), []);\n const inputRef = useRef<HTMLInputElement>();\n\n // Use the inputId from FormControl context if available, otherwise use the provided id or generate one\n const inputId = field.inputId || id || generatedId;\n\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n useImperativeHandle(ref, () => inputRef.current, [inputRef]);\n\n useEffect(() => {\n if (inputRef.current) {\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n inputRef.current.indeterminate = indeterminate;\n }\n }, [indeterminate, inputRef]);\n\n return (\n <Container\n direction='horizontal'\n className={className}\n data-test={dataTest}\n disabled={field.disabled}\n align='center'\n size={size}\n {...containerProps}\n >\n <CheckboxInput\n id={inputId}\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n ref={inputRef}\n data-test={dataTest && `${dataTest}-input`}\n disabled={field.disabled}\n type='checkbox'\n checked={checkedProp == null ? undefined : checked}\n defaultChecked={defaultChecked}\n onChange={(e) => {\n setChecked(e.target.checked);\n if (onChange) {\n onChange(e);\n }\n }}\n aria-checked={indeterminate ? 'mixed' : checked}\n value={value as unknown as string}\n {...elemProps}\n />\n <CheckboxBox\n aria-hidden='true'\n disabled={field.disabled}\n checked={(checked != null && checked) || indeterminate}\n >\n {indeterminate ? <InputDashIcon /> : checked ? <InputCheckIcon /> : null}\n </CheckboxBox>\n {label &&\n (tooltip ? (\n <Tooltip\n size={size}\n trigger={\n <Label htmlFor={inputId} disabled={!!field.disabled} size={size}>\n <TextWithDashedUnderline>{label}</TextWithDashedUnderline>\n </Label>\n }\n >\n {tooltip}\n </Tooltip>\n ) : (\n <Label htmlFor={inputId} disabled={!!field.disabled} size={size}>\n {label}\n </Label>\n ))}\n </Container>\n );\n});\n\nexport default Checkbox;\n"],"mappings":";;;;;;;;;;;;;;AA+BA,MAAM,YAAY,OAAO,MAAM;;;;;;KAM1B,EAAE,WACH,SAAS,QACT,GAAG;;MAED;;KAED,WAAW;;;;AAKhB,MAAM,cAAc,OAAO,GAA8C;;;;;;;yBAOhC;+BACM;2BACJ;;YAE/B,QAAQ,GAAG;WACZ,QAAQ,GAAG;;sBAEA,MAAM,oBAAoB;gBAChC,MAAM,uBAAuB;;;aAGhC,MAAM,kBAAkB;;;KAGhC,WAAW;;kBAEE,MAAM,wBAAwB;oBAC5B,MAAM,oBAAoB;;;KAGzC,EAAE,cACH,WACA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eAAD;IACE,IAAI;IAEJ,KAAK;IACL,aAAW,YAAY,GAAG,SAAS;IACnC,UAAU,MAAM;IAChB,MAAK;IACL,SAAS,eAAe,OAAO,KAAA,IAAY;IAC3B;IAChB,WAAW,MAAM;AACf,gBAAW,EAAE,OAAO,QAAQ;AAC5B,SAAI,SACF,UAAS,EAAE;;IAGf,gBAAc,gBAAgB,UAAU;IACjC;IACP,GAAI;IACJ,CAAA;GACF,oBAAC,aAAD;IACE,eAAY;IACZ,UAAU,MAAM;IAChB,SAAU,WAAW,QAAQ,WAAY;cAExC,gBAAgB,oBAAC,eAAD,EAAiB,CAAA,GAAG,UAAU,oBAAC,gBAAD,EAAkB,CAAA,GAAG;IACxD,CAAA;GACb,UACE,UACC,oBAAC,SAAD;IACQ;IACN,SACE,oBAAC,OAAD;KAAO,SAAS;KAAS,UAAU,CAAC,CAAC,MAAM;KAAgB;eACzD,oBAAC,yBAAD,EAAA,UAA0B,OAAgC,CAAA;KACpD,CAAA;cAGT;IACO,CAAA,GAEV,oBAAC,OAAD;IAAO,SAAS;IAAS,UAAU,CAAC,CAAC,MAAM;IAAgB;cACxD;IACK,CAAA;GAEF;;EAEd"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DatePicker-DpGvo7Bd.mjs","names":["useLocale","OpenButton","Popover","Card","RangeCalendarPresets","Popover"],"sources":["../components/DatePicker/Calendar/CalendarBase.tsx","../components/DatePicker/Calendar/CalendarCell.tsx","../components/DatePicker/Calendar/CalendarGrid.tsx","../components/DatePicker/common.ts","../components/DatePicker/Calendar/Calendar.tsx","../components/DatePicker/DateField.tsx","../components/DatePicker/DatePicker.tsx","../components/DatePicker/Calendar/RangeCalendarPresets.tsx","../components/DatePicker/Calendar/RangeCalendar.tsx","../components/DatePicker/DateRangePicker.tsx"],"sourcesContent":["import { useRef } from 'react';\nimport { useButton } from 'react-aria';\nimport styled from 'styled-components';\n\nimport { Spacing, Typography } from '@persona/design-tokens';\nimport { IconButton } from 'design-system/components/Button';\nimport type { IconButtonProps } from 'design-system/components/Button/IconButton';\n\nexport const CalendarContainer = styled.div`\n display: inline-block;\n`;\n\nexport const CalendarHeader = styled.div`\n display: flex;\n align-items: center;\n margin-bottom: ${Spacing[2]};\n`;\n\nexport const CalendarHeading = styled.div`\n ${Typography.TextLargeBold};\n flex: 1;\n text-align: center;\n`;\n\nconst StyledCalendarButton = styled(IconButton)`\n width: 32px;\n height: 32px;\n`;\n\nexport const CalendarButton = (props: IconButtonProps) => {\n const ref = useRef();\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n const { buttonProps } = useButton(props, ref);\n\n return (\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n <StyledCalendarButton {...buttonProps} className={props.className} ref={ref}>\n {props.children}\n </StyledCalendarButton>\n );\n};\n","import { type CalendarDate, type DateValue, isSameDay, isSameMonth } from '@internationalized/date';\nimport { useRef } from 'react';\nimport { useCalendarCell } from 'react-aria';\nimport type { CalendarState, RangeCalendarState } from 'react-stately';\nimport styled, { css } from 'styled-components';\n\nimport { BorderRadius, Color, Typography } from '@persona/design-tokens';\n\nconst CalendarCellContainer = styled.td`\n text-align: center;\n width: 38px;\n height: 38px;\n padding: 0px;\n`;\n\ninterface CalendarCellButtonProps {\n isSelected?: boolean;\n isSelectionStart?: boolean;\n isSelectionEnd?: boolean;\n isInvalid?: boolean;\n isDisabled?: boolean;\n}\n\nconst CalendarCellButton = styled.button<CalendarCellButtonProps>`\n ${Typography.TextMedium};\n border-style: none;\n padding: 0;\n background: none;\n width: 100%;\n height: 100%;\n cursor: pointer;\n position: relative;\n\n ${({ isSelected }) =>\n isSelected &&\n css`\n background: ${Color.CorePurple100};\n `}\n\n ${({ isSelectionStart }) =>\n isSelectionStart &&\n css`\n background: ${Color.BackgroundButtonPrimary};\n color: ${Color.TextInverse};\n border-top-left-radius: ${BorderRadius.Sm};\n border-bottom-left-radius: ${BorderRadius.Sm};\n `}\n\n ${({ isSelectionEnd }) =>\n isSelectionEnd &&\n css`\n background: ${Color.BackgroundButtonPrimary};\n color: ${Color.TextInverse};\n border-top-right-radius: ${BorderRadius.Sm};\n border-bottom-right-radius: ${BorderRadius.Sm};\n `}\n\n ${({ isDisabled }) =>\n isDisabled &&\n css`\n color: ${Color.CoreSlate300};\n `}\n\n ${({ isInvalid }) =>\n isInvalid &&\n css`\n background: ${Color.BackgroundButtonDanger};\n color: ${Color.TextInverse};\n `}\n\n &:focus-visible {\n outline: 2px solid ${Color.BorderFocus};\n outline-offset: -2px;\n box-shadow: ${Color.PrimaryWhite} 0px 0px 0px 3px inset;\n z-index: 1;\n }\n`;\n\ninterface CalendarCellProps {\n state: CalendarState | RangeCalendarState;\n date: CalendarDate;\n currentMonth: DateValue;\n}\n\nconst CalendarCell = ({ state, date, currentMonth }: CalendarCellProps) => {\n const ref = useRef();\n const { cellProps, buttonProps, isSelected, isInvalid, isDisabled, formattedDate } =\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n useCalendarCell({ date }, state, ref);\n\n const highlightedRange = 'highlightedRange' in state && state.highlightedRange;\n\n const isOutsideMonth = !isSameMonth(currentMonth, date);\n const isSelectionStart = highlightedRange ? isSameDay(date, highlightedRange.start) : isSelected;\n const isSelectionEnd = highlightedRange ? isSameDay(date, highlightedRange.end) : isSelected;\n\n return (\n <CalendarCellContainer {...cellProps}>\n <CalendarCellButton\n {...buttonProps}\n hidden={isOutsideMonth}\n isSelected={isSelected}\n isSelectionStart={isSelectionStart}\n isSelectionEnd={isSelectionEnd}\n isInvalid={isInvalid}\n isDisabled={isDisabled}\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n ref={ref}\n >\n {formattedDate}\n </CalendarCellButton>\n </CalendarCellContainer>\n );\n};\n\nexport default CalendarCell;\n","import { type DateDuration, endOfMonth, getWeeksInMonth } from '@internationalized/date';\nimport { useCalendarGrid, useLocale } from 'react-aria';\nimport type { CalendarState, RangeCalendarState } from 'react-stately';\nimport styled from 'styled-components';\n\nimport { Color, Typography } from '@persona/design-tokens';\n\nimport CalendarCell from './CalendarCell';\n\nconst CalendarGridContainer = styled.table`\n width: 266px;\n border-spacing: 0px;\n border-collapse: collapse;\n\n &:focus-visible {\n outline: 2px solid ${Color.BorderFocus};\n outline-offset: 1px;\n }\n`;\n\nconst CalendarGridDayHeader = styled.th`\n ${Typography.TextMedium};\n color: ${Color.TextSecondary};\n`;\n\ninterface CalendarGridProps {\n state: CalendarState | RangeCalendarState;\n offset?: DateDuration;\n skipFromTabOrder?: boolean;\n}\n\nconst CalendarGrid = ({ state, offset = {}, skipFromTabOrder = false }: CalendarGridProps) => {\n const { locale } = useLocale();\n const startDate = state.visibleRange.start.add(offset);\n const endDate = endOfMonth(startDate);\n\n const { gridProps, headerProps, weekDays } = useCalendarGrid(\n {\n startDate,\n endDate,\n },\n state,\n );\n\n const weeksInMonth = getWeeksInMonth(startDate, locale);\n\n // Remove second calendar grid from tab order - use arrow keys to navigate between months\n const modifiedGridProps = skipFromTabOrder ? { ...gridProps, tabIndex: -1 } : gridProps;\n\n return (\n <CalendarGridContainer {...modifiedGridProps}>\n <thead {...headerProps}>\n <tr>\n {weekDays.map((day, index) => (\n <CalendarGridDayHeader key={index}>{day}</CalendarGridDayHeader>\n ))}\n </tr>\n </thead>\n <tbody>\n {[...new Array(weeksInMonth).keys()].map((weekIndex) => (\n <tr key={weekIndex}>\n {state\n .getDatesInWeek(weekIndex, startDate)\n .map((date, i) =>\n date ? (\n <CalendarCell key={i} state={state} date={date} currentMonth={startDate} />\n ) : (\n <td key={i} />\n ),\n )}\n </tr>\n ))}\n </tbody>\n </CalendarGridContainer>\n );\n};\n\nexport default CalendarGrid;\n","import { GregorianCalendar } from '@internationalized/date';\n\nexport const createCalendar = () => new GregorianCalendar();\n","import type { Ref } from 'react';\nimport { type AriaCalendarProps, type DateValue, useCalendar, useLocale } from 'react-aria';\nimport { useCalendarState } from 'react-stately';\n\nimport { ArrowLeftIcon, ArrowRightIcon } from '@persona/icons';\nimport {\n CalendarButton,\n CalendarContainer,\n CalendarHeader,\n CalendarHeading,\n} from 'design-system/components/DatePicker/Calendar/CalendarBase';\nimport CalendarGrid from 'design-system/components/DatePicker/Calendar/CalendarGrid';\nimport { createCalendar } from 'design-system/components/DatePicker/common';\n\ninterface CalendarProps extends AriaCalendarProps<DateValue> {\n calendarRef?: Ref<HTMLDivElement>;\n}\n\nconst Calendar = (props: CalendarProps) => {\n const { locale } = useLocale();\n const state = useCalendarState({ ...props, locale, createCalendar });\n const { calendarProps, prevButtonProps, nextButtonProps, title } = useCalendar(props, state);\n\n return (\n <CalendarContainer {...calendarProps} ref={props.calendarRef}>\n <CalendarHeader>\n <CalendarButton {...prevButtonProps}>\n <ArrowLeftIcon />\n </CalendarButton>\n <CalendarHeading>{title}</CalendarHeading>\n <CalendarButton {...nextButtonProps}>\n <ArrowRightIcon />\n </CalendarButton>\n </CalendarHeader>\n <CalendarGrid state={state} />\n </CalendarContainer>\n );\n};\n\nexport default Calendar;\n","import type { DateValue } from '@internationalized/date';\nimport { type AriaDateFieldProps, useDateField, useDateSegment } from '@react-aria/datepicker';\nimport { useLocale } from '@react-aria/i18n';\nimport { mergeRefs } from '@react-aria/utils';\nimport {\n type DateFieldState,\n type DateSegment as DateSegmentObj,\n type SegmentType,\n useDateFieldState,\n} from '@react-stately/datepicker';\nimport { forwardRef, useRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Color, Spacing } from '@persona/design-tokens';\nimport { createCalendar } from 'design-system/components/DatePicker/common';\nimport { isFocused, isFocusedVisible, isNotDisabled } from 'design-system/lib/pseudoClass';\nimport { focusWithinOutline } from 'design-system/mixins/focus';\nimport inputMixin, { type InputMixinProps, type InputSizes } from 'design-system/mixins/input';\nimport type PseudoClassProps from 'design-system/types/PseudoClassProps';\n\ntype DateSegmentContainerProps = { $isComma?: boolean; $isTimezone?: boolean } & PseudoClassProps;\nconst DateSegmentContainer = styled.div<DateSegmentContainerProps>`\n font-variant-numeric: tabular-nums;\n box-sizing: content-box;\n text-align: end;\n\n ${isFocused} {\n outline: 2px solid ${Color.BorderFocus};\n outline-offset: 1px;\n background-color: ${Color.CorePurple200};\n }\n\n ${({ $isComma, $isTimezone }) =>\n ($isComma || $isTimezone) &&\n css`\n margin-left: 0.25ch;\n margin-right: 0.25ch;\n `}\n\n ${({ $isTimezone }) =>\n $isTimezone &&\n css`\n color: ${Color.TextSecondary};\n pointer-events: none;\n\n &:focus {\n outline: none;\n background-color: transparent;\n }\n `}\n`;\n\ntype DateSegmentPlaceholderProps = { isPlaceholder?: boolean; type: SegmentType };\nconst DateSegmentPlaceholder = styled.span<DateSegmentPlaceholderProps>`\n display: block;\n width: 100%;\n pointer-events: none;\n\n &:focus {\n outline: none;\n }\n\n ${({ isPlaceholder }) =>\n isPlaceholder\n ? css`\n height: 100%;\n color: ${({ theme }) => theme.color.text.tertiary};\n `\n : css`\n visibility: hidden;\n height: 0;\n `}\n ${({ type }) =>\n type === 'literal' &&\n css`\n padding-left: ${Spacing[1]};\n padding-right: ${Spacing[1]};\n `}\n ${({ type, isPlaceholder }) =>\n type === 'month' &&\n isPlaceholder &&\n css`\n width: 3ch;\n `}\n`;\n\ninterface DateSegmentProps {\n segment: DateSegmentObj;\n state: DateFieldState;\n}\n\nfunction DateSegment({ segment, state }: DateSegmentProps) {\n const ref = useRef();\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n const { segmentProps } = useDateSegment(segment, state, ref);\n\n let minWidth: string;\n\n switch (segment.type) {\n case 'dayPeriod': {\n minWidth = '2.75ch';\n break;\n }\n default: {\n minWidth = `${segment.maxValue != null && String(segment.maxValue).length + 0.25}ch`;\n break;\n }\n }\n\n const isComma = segment.type === 'literal' && segment.text === ', ';\n const isTimezone = segment.type === 'timeZoneName';\n\n return (\n <DateSegmentContainer\n {...segmentProps}\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n ref={ref}\n style={{\n ...segmentProps.style,\n minWidth,\n }}\n $isComma={isComma}\n $isTimezone={isTimezone}\n {...(isTimezone && { tabIndex: -1, role: 'presentation' })}\n >\n {/* Always reserve space for the placeholder, to prevent layout shift when editing. */}\n {segment.placeholder && (\n <DateSegmentPlaceholder\n aria-hidden='true'\n isPlaceholder={segment.isPlaceholder}\n type={segment.type}\n >\n {segment.placeholder}\n </DateSegmentPlaceholder>\n )}\n {segment.isPlaceholder ? '' : segment.text}\n </DateSegmentContainer>\n );\n}\n\nconst InputBox = styled.div<InputMixinProps & { $inputPosition: 'start' | 'end' }>`\n ${inputMixin};\n display: flex;\n padding-left: ${Spacing[2]};\n padding-right: ${Spacing[2]};\n line-height: 1;\n position: relative;\n\n &${isFocusedVisible}${isNotDisabled} {\n position: relative;\n z-index: 1;\n }\n\n ${focusWithinOutline}\n\n ${({ $inputPosition }) => {\n switch ($inputPosition) {\n case 'start': {\n return css`\n border-top-right-radius: 0px;\n border-bottom-right-radius: 0px;\n `;\n }\n case 'end': {\n return css`\n margin-left: -1px;\n border-top-left-radius: 0px;\n border-bottom-left-radius: 0px;\n `;\n }\n }\n }}\n`;\n\ninterface DateFieldProps extends AriaDateFieldProps<DateValue> {\n inputPosition?: 'start' | 'end';\n focused?: boolean;\n readOnly?: boolean;\n value?: DateValue;\n disabled?: boolean;\n size?: InputSizes;\n style?: React.CSSProperties;\n dateFieldProps?: {\n style?: React.CSSProperties;\n };\n hasError?: boolean;\n}\n\nexport const DateField = forwardRef<HTMLDivElement, DateFieldProps>(function DateField(\n props: DateFieldProps,\n forwardedRef,\n) {\n const { locale } = useLocale();\n const state = useDateFieldState({\n ...props,\n locale,\n createCalendar,\n });\n\n const ref = useRef<HTMLDivElement>();\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n const { fieldProps } = useDateField(props, state, ref);\n\n return (\n <InputBox\n {...fieldProps}\n {...(props.dateFieldProps || {})}\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n ref={mergeRefs<HTMLDivElement>(ref, forwardedRef)}\n focused={props.focused}\n disabled={props.disabled}\n aria-label={props['aria-label']}\n $size={props.size ?? 'md'}\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n $inputPosition={props.inputPosition}\n hasError={props.hasError}\n >\n {state.segments.map((segment, i) => (\n <DateSegment key={i} segment={segment} state={state} />\n ))}\n </InputBox>\n );\n});\n\nexport default DateField;\n","import type { DateValue } from '@internationalized/date';\nimport type { DatePickerProps as DatePickerBase } from '@react-types/datepicker';\nimport { type RefObject, useCallback, useRef } from 'react';\nimport { mergeProps, useButton, useDatePicker, useFocusWithin, VisuallyHidden } from 'react-aria';\nimport { useDatePickerState } from 'react-stately';\n\nimport Calendar from 'design-system/components/DatePicker/Calendar/Calendar';\nimport DateField from 'design-system/components/DatePicker/DateField';\nimport Popover from 'design-system/components/Popover';\nimport { Z_INDICES } from 'design-system/lib/zindex';\nimport type { InputSizes } from 'design-system/mixins/input';\n\nexport interface DatePickerProps extends DatePickerBase<DateValue> {\n id?: string;\n dateFieldProps?: {\n style?: React.CSSProperties;\n };\n disabled?: boolean;\n size?: InputSizes;\n useModalZIndex?: boolean;\n}\n\nconst OpenButton = ({ calendarRef }: { calendarRef: RefObject<HTMLElement> }) => {\n const openCalBtnRef = useRef<HTMLButtonElement>(null);\n const { buttonProps } = useButton(\n {\n onPress: () => {\n if (calendarRef.current) {\n (\n calendarRef.current.querySelector('button[aria-label=\"Previous\"]') as HTMLButtonElement\n ).focus();\n }\n },\n },\n openCalBtnRef,\n );\n\n return <button {...buttonProps} ref={openCalBtnRef} aria-label='Open calendar' />;\n};\n\nexport const DatePicker = (props: DatePickerProps) => {\n const state = useDatePickerState(props);\n const ref = useRef<HTMLDivElement>(null);\n const fieldRef = useRef<HTMLDivElement>(null);\n const { groupProps, fieldProps, calendarProps } = useDatePicker(props, state, ref);\n const calendarRef = useRef<HTMLDivElement>(null);\n // A ref, not state: the close sequence focuses the field before a state update would commit.\n const isClosingRef = useRef(false);\n\n const { focusWithinProps } = useFocusWithin({\n onFocusWithin: () => {\n if (!state.isOpen && !isClosingRef.current) {\n state.setOpen(true);\n }\n },\n onBlurWithin: (e) => {\n // Close calendar if next target is not within the calendar\n if (e.relatedTarget && !calendarRef?.current?.contains(e.relatedTarget) && state.isOpen) {\n state.setOpen(false);\n }\n },\n });\n\n const handleOutsideClick = (e: Event) => {\n const target = e.target as Node;\n // Don't close if clicking on the date input itself\n if (ref.current?.contains(target)) {\n return;\n }\n if (state.isOpen) {\n state.setOpen(false);\n }\n };\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n if (event.key === 'Enter' && !state.isOpen) {\n event.preventDefault();\n state.setOpen(true);\n }\n },\n [state],\n );\n\n return (\n <div style={{ display: 'flex', flexDirection: 'column' }}>\n <Popover\n open={state.isOpen}\n modal={false}\n contentProps={{\n style: { zIndex: props.useModalZIndex ? Z_INDICES.modalDropdown : Z_INDICES.dropdown },\n align: 'start',\n 'aria-modal': true,\n onInteractOutside: handleOutsideClick,\n onEscapeKeyDown: () => {\n state.setOpen(false);\n },\n onCloseAutoFocus: (e: Event) => {\n // Prevent Radix's default focus restoration\n e.preventDefault();\n isClosingRef.current = true;\n\n // Manually restore focus to the date field\n if (fieldRef.current) {\n const firstEditableSegment = fieldRef.current.querySelector('[tabindex=\"0\"]');\n if (firstEditableSegment instanceof HTMLElement) {\n firstEditableSegment.focus();\n }\n }\n\n // Reset flag after focus is done\n requestAnimationFrame(() => {\n isClosingRef.current = false;\n });\n },\n noPadding: true,\n }}\n >\n <Popover.Trigger asChild>\n <div\n {...mergeProps(groupProps, focusWithinProps)}\n ref={ref}\n style={{ display: 'flex', position: 'relative' }}\n >\n <DateField\n ref={fieldRef}\n id={props.id}\n dateFieldProps={props.dateFieldProps}\n disabled={props.disabled}\n size={props.size}\n {...mergeProps(fieldProps, { onKeyDown: handleKeyDown })}\n value={fieldProps.value ?? undefined}\n />\n <VisuallyHidden>\n <OpenButton calendarRef={calendarRef} />\n </VisuallyHidden>\n </div>\n </Popover.Trigger>\n <Calendar\n {...{ ...calendarProps, autoFocus: undefined }}\n calendarRef={calendarRef}\n id='calendar-popover'\n />\n </Popover>\n </div>\n );\n};\n\nexport default DatePicker;\n","import {\n type CalendarDate,\n type DateValue,\n endOfMonth,\n endOfYear,\n startOfMonth,\n startOfYear,\n today,\n} from '@internationalized/date';\nimport type { RangeValue } from '@react-types/shared';\nimport { Settings } from 'luxon';\nimport { memo, useRef } from 'react';\nimport { mergeProps, useButton } from 'react-aria';\nimport type { RangeCalendarState } from 'react-stately';\nimport styled, { css } from 'styled-components';\n\nimport { Color } from '@persona/design-tokens';\nimport { MenuItem, MenuList } from 'design-system/components/Menu';\nimport { isFocused, isHovered, isNotDisabled } from 'design-system/lib/pseudoClass';\n\ninterface DateRangePreset {\n label: string;\n range: RangeValue<CalendarDate>;\n}\n\nconst getDefaultPresets = (tz: string) => {\n const now = today(tz);\n return [\n {\n label: 'Last 7 days',\n range: {\n start: now.subtract({ days: 7 }),\n end: now,\n },\n },\n {\n label: 'Last 14 days',\n range: {\n start: now.subtract({ days: 14 }),\n end: now,\n },\n },\n {\n label: 'Last 30 days',\n range: {\n start: now.subtract({ days: 30 }),\n end: now,\n },\n },\n {\n label: 'This month',\n range: {\n start: startOfMonth(now),\n // Effectively, this should always be today, since we can't look forward\n end: now,\n },\n },\n {\n label: 'Last month',\n range: {\n start: startOfMonth(now.subtract({ months: 1 })),\n end: endOfMonth(now.subtract({ months: 1 })),\n },\n },\n {\n label: 'This year',\n range: {\n start: startOfYear(now),\n end: now,\n },\n },\n {\n label: 'Last year',\n range: {\n start: startOfYear(now.subtract({ years: 1 })),\n end: endOfYear(now.subtract({ years: 1 })),\n },\n },\n ];\n};\n\n/**\n * Compare two date values by year/month/day only, ignoring time components.\n */\nconst datesMatchByDay = (a: CalendarDate, b: DateValue): boolean =>\n a.year === b.year && a.month === b.month && a.day === b.day;\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n`;\n\ninterface PresetButtonProps {\n state: RangeCalendarState;\n preset: DateRangePreset;\n isSelected: boolean;\n setDateMode: (mode: 'start' | 'end' | null) => void;\n}\n\nconst StyledPresetButton = styled(MenuItem)`\n ${({ selected }) =>\n !selected &&\n css`\n &${isNotDisabled}${isHovered}, &${isNotDisabled}${isFocused} {\n background-color: transparent;\n }\n `}\n\n &:focus-visible {\n // MenuItems default to outline: none, so we need to override it here.\n outline: 2px solid ${Color.BorderFocus} !important;\n outline-offset: 1px;\n }\n`;\n\ninterface DateRangePickerPresetsProps {\n presetsFn?: (tz: string) => DateRangePreset[];\n state: RangeCalendarState;\n setDateMode: (mode: 'start' | 'end' | null) => void;\n}\n\nconst PresetButton = ({ state, preset, isSelected, setDateMode, ...props }: PresetButtonProps) => {\n const ref = useRef<HTMLDivElement>();\n const { buttonProps } = useButton(\n {\n onPress: () => {\n state.setValue(preset.range);\n setDateMode(null);\n },\n },\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n ref,\n );\n\n // Strip aria-current from useButton's props so it doesn't override MenuItem's.\n const { 'aria-current': _ariaCurrent, ...mergedProps } = mergeProps(props, buttonProps);\n\n return (\n <StyledPresetButton\n selected={isSelected}\n {...mergedProps}\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n ref={ref}\n >\n {preset.label}\n </StyledPresetButton>\n );\n};\n\nconst DateRangePickerPresets = ({\n presetsFn = getDefaultPresets,\n state,\n setDateMode,\n ...props\n}: DateRangePickerPresetsProps) => {\n // The reason that we need to do this at render time is because the default timezone for moment is set after\n // the current User's timezone is loaded. Thus we woudln't be getting the right timezone unless if we defer getting\n // the timezone.\n const presets = presetsFn(Settings.defaultZone.name);\n\n // First match wins — prevents multiple presets appearing selected when ranges overlap.\n const { value } = state;\n const selectedPresetIndex = value\n ? presets.findIndex(\n (preset) =>\n datesMatchByDay(preset.range.start, value.start) &&\n datesMatchByDay(preset.range.end, value.end),\n )\n : -1;\n\n return (\n <Container {...props}>\n <MenuList aria-label='Date range presets'>\n {presets.map((preset, i) => (\n <PresetButton\n key={i}\n preset={preset}\n state={state}\n setDateMode={setDateMode}\n isSelected={i === selectedPresetIndex}\n />\n ))}\n </MenuList>\n </Container>\n );\n};\n\n// Memoize to prevent re-renders when irrelevant state properties change\n// Only re-render when the actual selected date range (state.value) changes\nconst arePropsEqual = (\n prevProps: DateRangePickerPresetsProps,\n nextProps: DateRangePickerPresetsProps,\n) => {\n // Only care about the selected date range, not internal calendar state like isInvalid, visibleRange, etc.\n const prevValue = prevProps.state.value;\n const nextValue = nextProps.state.value;\n\n // If both are null/undefined, they're equal\n if (!prevValue && !nextValue) {\n return true;\n }\n // If only one is null/undefined, they're different\n if (!prevValue || !nextValue) {\n return false;\n }\n\n // Compare the actual date values\n return (\n prevValue.start.compare(nextValue.start) === 0 && prevValue.end.compare(nextValue.end) === 0\n );\n};\n\nexport default memo(DateRangePickerPresets, arePropsEqual);\n","import { type CalendarDate, type DateValue, toCalendarDateTime } from '@internationalized/date';\nimport { range } from 'lodash/fp';\nimport { Settings } from 'luxon';\nimport { type Ref, useRef } from 'react';\nimport {\n type DateRange,\n type RangeCalendarProps as RangeCalendarBaseProps,\n useDateFormatter,\n useLocale,\n useRangeCalendar,\n VisuallyHidden,\n} from 'react-aria';\nimport { type RangeCalendarState, useRangeCalendarState } from 'react-stately';\nimport styled from 'styled-components';\n\nimport { BorderRadius, Color, Spacing } from '@persona/design-tokens';\nimport { ArrowLeftIcon, ArrowRightIcon } from '@persona/icons';\nimport Card from 'design-system/components/Card';\nimport {\n CalendarButton,\n CalendarContainer,\n CalendarHeader,\n CalendarHeading,\n} from 'design-system/components/DatePicker/Calendar/CalendarBase';\nimport CalendarGrid from 'design-system/components/DatePicker/Calendar/CalendarGrid';\nimport RangeCalendarPresets from 'design-system/components/DatePicker/Calendar/RangeCalendarPresets';\nimport { createCalendar } from 'design-system/components/DatePicker/common';\n\nconst RangeCalendarHeader = styled(CalendarHeader)`\n gap: ${Spacing[5]};\n`;\n\nconst CalendarHeaderMonth = styled.div`\n display: grid;\n grid-template-columns: minmax(auto, 1fr) auto minmax(auto, 1fr);\n grid-template-areas: 'prev title next';\n width: 266px;\n align-items: center;\n`;\n\nconst CalendarGrids = styled.div`\n display: flex;\n gap: ${Spacing[5]};\n align-items: start;\n`;\n\nconst PrevButton = styled(CalendarButton)`\n grid-area: prev;\n justify-self: start;\n border-radius: ${BorderRadius.Sm};\n`;\n\nconst NextButton = styled(CalendarButton)`\n grid-area: next;\n justify-self: end;\n border-radius: ${BorderRadius.Sm};\n`;\n\nconst RangeCalendarHeading = styled(CalendarHeading)`\n grid-area: title;\n`;\n\nconst RangeCalendarContainer = styled.div`\n display: flex;\n`;\n\nconst PresetsContainer = styled(Card.Body)`\n border-right: 1px solid ${Color.BorderHairline};\n`;\n\nexport interface RangeCalendarProps extends RangeCalendarBaseProps<DateValue> {\n minDate?: RangeCalendarBaseProps<DateValue>['minValue'];\n maxDate?: RangeCalendarBaseProps<DateValue>['maxValue'];\n calendarRef?: Ref<HTMLDivElement>;\n hidePresets?: boolean;\n visibleMonths?: 1 | 2;\n onSelectDate?: (d: CalendarDate) => void;\n setDateMode: (mode: 'start' | 'end' | null) => void;\n /**\n * From setValue of DateRangePicker\n */\n setValue: (value: DateRange | null) => void;\n granularity: 'day' | 'hour' | 'minute' | 'second';\n}\n\nconst RangeCalendar = ({\n calendarRef,\n onSelectDate,\n minDate,\n maxDate,\n hidePresets,\n visibleMonths = 2,\n setDateMode,\n setValue,\n granularity,\n ...props\n}: RangeCalendarProps) => {\n const { locale } = useLocale();\n // Must gather the TZ from the user's settings.\n const timezoneName = Settings.defaultZone.name;\n const rangeCalendarState = useRangeCalendarState({\n ...props,\n minValue: minDate,\n maxValue: maxDate,\n visibleDuration: {\n months: visibleMonths,\n },\n locale,\n createCalendar,\n });\n\n const state: RangeCalendarState = {\n ...rangeCalendarState,\n setValue: (value) => {\n if (!value || granularity === 'day') {\n rangeCalendarState.setValue(value);\n return;\n }\n\n setValue({\n start: toCalendarDateTime(value.start),\n end: toCalendarDateTime(value.end),\n });\n },\n selectDate: (date) => {\n if (onSelectDate) {\n onSelectDate(date);\n rangeCalendarState.setAnchorDate(null);\n } else {\n rangeCalendarState.selectDate(date);\n }\n },\n };\n\n const ref = useRef();\n\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n const { calendarProps, prevButtonProps, nextButtonProps } = useRangeCalendar(props, state, ref);\n\n const monthDateFormatter = useDateFormatter({\n month: 'long',\n year: 'numeric',\n timeZone: timezoneName,\n });\n\n const monthHeaders = range(0, visibleMonths).map((i) => {\n return (\n <CalendarHeaderMonth key={`calendar-month-${i}`}>\n {i === 0 && (\n <PrevButton {...prevButtonProps}>\n <ArrowLeftIcon />\n </PrevButton>\n )}\n <RangeCalendarHeading aria-hidden>\n {monthDateFormatter.format(\n state.visibleRange.start.add({ months: i }).toDate(timezoneName),\n )}\n </RangeCalendarHeading>\n {i === visibleMonths - 1 && (\n <NextButton {...nextButtonProps}>\n <ArrowRightIcon />\n </NextButton>\n )}\n </CalendarHeaderMonth>\n );\n });\n\n const monthGrids = range(0, visibleMonths).map((i) => {\n return (\n <CalendarGrid\n key={`calendar-grid-${i}`}\n state={state}\n offset={{ months: i }}\n skipFromTabOrder={i > 0}\n />\n );\n });\n\n return (\n <RangeCalendarContainer ref={calendarRef}>\n {!hidePresets && (\n <PresetsContainer padding={Spacing[3]}>\n <RangeCalendarPresets state={state} setDateMode={setDateMode} />\n </PresetsContainer>\n )}\n <Card.Body padding={Spacing[3]}>\n {/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */}\n <CalendarContainer {...calendarProps} ref={ref}>\n {/* Calendar header is separate from grid like this to facilitate a11y. */}\n <RangeCalendarHeader>\n <VisuallyHidden isFocusable={false}>{calendarProps['aria-label']}</VisuallyHidden>\n {monthHeaders}\n </RangeCalendarHeader>\n <CalendarGrids>{monthGrids}</CalendarGrids>\n </CalendarContainer>\n </Card.Body>\n </RangeCalendarContainer>\n );\n};\n\nexport default RangeCalendar;\n","import {\n CalendarDate,\n type DateValue,\n parseAbsolute,\n toCalendarDateTime,\n} from '@internationalized/date';\nimport type { DateRangePickerProps as DateRangePickerBase } from '@react-types/datepicker';\nimport type { AriaLabelingProps, RangeValue } from '@react-types/shared';\nimport { type DateTime, Settings } from 'luxon';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport {\n mergeProps,\n useButton,\n useDateRangePicker,\n useFocusWithin,\n usePress,\n VisuallyHidden,\n} from 'react-aria';\nimport { useDateRangePickerState } from 'react-stately';\nimport styled from 'styled-components';\n\nimport { Spacing, Typography } from '@persona/design-tokens';\nimport { CircleXInverseIcon } from '@persona/icons';\nimport RangeCalendar from 'design-system/components/DatePicker/Calendar/RangeCalendar';\nimport DateField from 'design-system/components/DatePicker/DateField';\nimport { FormLabel } from 'design-system/components/FormControl';\nimport { ClearButton } from 'design-system/components/Input';\nimport Popover from 'design-system/components/Popover';\nimport { isDisabled } from 'design-system/lib/pseudoClass';\nimport type { InputSizes } from 'design-system/mixins/input';\n\nconst DateRangeContainer = styled.div`\n display: inline-flex;\n flex-direction: column;\n width: 100%;\n`;\n\nconst DateRangeInputs = styled.div`\n display: flex;\n align-items: center;\n`;\n\nconst CustomFormLabel = styled(FormLabel)`\n margin-bottom: ${Spacing[2]};\n ${Typography.TextMediumBold};\n`;\n\nexport type DateRange = {\n startDate?: DateTime;\n endDate?: DateTime;\n};\n\nexport interface DateRangePickerProps extends DateRangePickerBase<DateValue>, AriaLabelingProps {\n dateRange: DateRange;\n onChange: (range: RangeValue<DateValue> | null) => void;\n disabled?: boolean;\n size?: InputSizes;\n minDate?: DateValue;\n maxDate?: DateValue;\n label?: string | null;\n dataTest?: string;\n id?: string;\n hidePresets?: boolean;\n visibleMonths?: 1 | 2;\n className?: string;\n /**\n * Whether or not to display clear button\n */\n showClear?: boolean;\n /**\n * Called when the clear button is clicked/pressed\n */\n onClear?: () => void;\n /**\n * z-index of the calendar popover\n */\n calendarZIndex?: number;\n /**\n * Element that should contain the calendar portal.\n */\n portalContainer?: HTMLElement | null;\n}\n\nconst OpenButton = ({ onOpen, disabled }: { onOpen: () => void; disabled?: boolean }) => {\n const openCalBtnRef = useRef<HTMLButtonElement>(null);\n const { buttonProps } = useButton(\n {\n isDisabled: disabled,\n onPress: onOpen,\n },\n openCalBtnRef,\n );\n\n return (\n <button\n {...buttonProps}\n type='button'\n ref={openCalBtnRef}\n aria-label='Open calendar'\n tabIndex={-1}\n />\n );\n};\n\nconst ClearRangeButton = styled(ClearButton)`\n height: 16px;\n width: 16px;\n margin-left: ${Spacing[2]};\n\n &${isDisabled}, &:disabled {\n background-color: transparent;\n }\n`;\n\nconst DateRangePicker = ({\n granularity = 'day',\n hideTimeZone = true,\n className,\n calendarZIndex,\n portalContainer,\n ...props\n}: DateRangePickerProps) => {\n const state = useDateRangePickerState({ granularity, hideTimeZone, ...props });\n const ref = useRef<HTMLDivElement>(null);\n const startFieldRef = useRef<HTMLDivElement>(null);\n const endFieldRef = useRef<HTMLDivElement>(null);\n const calendarRef = useRef<HTMLDivElement>(null);\n const [dateMode, setDateMode] = useState<'start' | 'end' | null>(null);\n // A ref, not state: focus can return to a field before a state update would commit.\n const isClosingRef = useRef(false);\n const { groupProps, startFieldProps, endFieldProps, calendarProps, labelProps } =\n useDateRangePicker({ granularity, hideTimeZone, ...props }, state, ref);\n\n const focusCalendar = useCallback(() => {\n requestAnimationFrame(() => {\n const firstFocusableCalendarElement = calendarRef.current?.querySelector<HTMLElement>(\n '[role=\"menuitem\"], button:not(:disabled), [tabindex=\"0\"]',\n );\n firstFocusableCalendarElement?.focus();\n });\n }, []);\n\n const openCalendar = useCallback(() => {\n if (!props.disabled && !state.isOpen && !isClosingRef.current) {\n state.setOpen(true);\n }\n }, [props.disabled, state]);\n\n const openCalendarWithFocus = useCallback(() => {\n openCalendar();\n focusCalendar();\n }, [focusCalendar, openCalendar]);\n\n useEffect(() => {\n // If not set, return early\n if (!props.dateRange.startDate || !props.dateRange.endDate) {\n return;\n }\n\n if (!props.dateRange.startDate.isValid || !props.dateRange.endDate.isValid) {\n return;\n }\n\n // Find out the real time by adjusting the date to the user's timezone\n const startDate = props.dateRange.startDate.setZone(Settings.defaultZone);\n const endDate = props.dateRange.endDate.setZone(Settings.defaultZone);\n\n if (!startDate.isValid || !endDate.isValid) {\n return;\n }\n\n // Months are 1-indexed, no translations need to happen to CalendarDates\n const startCalendar = state.hasTime\n ? parseAbsolute(startDate.toISO(), Settings.defaultZone.name)\n : new CalendarDate(startDate.year, startDate.month, startDate.day);\n const endCalendar = state.hasTime\n ? parseAbsolute(endDate.toISO(), Settings.defaultZone.name)\n : new CalendarDate(endDate.year, endDate.month, endDate.day);\n\n const dateRangeV2: RangeValue<DateValue> = {\n start: startCalendar,\n end: endCalendar,\n };\n\n state.setValue(dateRangeV2);\n }, [props.dateRange.startDate, props.dateRange.endDate, granularity]);\n\n // Auto-close overlay when a complete range is selected (e.g., from presets with time enabled)\n const prevValueRef = useRef<RangeValue<DateValue | null> | null>(state.value);\n useEffect(() => {\n const prevValue = prevValueRef.current;\n const currentValue = state.value;\n\n // Update ref for next comparison\n prevValueRef.current = currentValue;\n\n // Close overlay only if BOTH start and end changed simultaneously to DIFFERENT dates (e.g., preset selection)\n // Do not close during manual date selection where:\n // 1. Only one date changes at a time, OR\n // 2. Both dates are set to the same value (initial selection from empty state)\n // Use value comparison (.compare) instead of object identity to handle controlled component re-renders\n const startChanged =\n prevValue?.start && currentValue?.start\n ? prevValue.start.compare(currentValue.start) !== 0\n : prevValue?.start !== currentValue?.start;\n const endChanged =\n prevValue?.end && currentValue?.end\n ? prevValue.end.compare(currentValue.end) !== 0\n : prevValue?.end !== currentValue?.end;\n const datesAreDifferent =\n currentValue?.start &&\n currentValue?.end &&\n currentValue.start.compare(currentValue.end) !== 0;\n\n if (state.isOpen && startChanged && endChanged && datesAreDifferent) {\n state.setOpen(false);\n }\n }, [state.value, state.isOpen]);\n\n const { focusWithinProps: startFocusWithinProps } = useFocusWithin({\n onFocusWithin: () => {\n setDateMode('start');\n openCalendar();\n },\n });\n\n const { focusWithinProps: endFocusWithinProps } = useFocusWithin({\n onFocusWithin: () => {\n setDateMode('end');\n openCalendar();\n },\n });\n\n const { focusWithinProps: containerFocusProps } = useFocusWithin({\n onBlurWithin: () => {\n requestAnimationFrame(() => {\n // Wait for popover focus transitions to settle before closing.\n const activeElement = document.activeElement;\n const isFocusInDateRangeInput =\n activeElement instanceof Node && ref.current?.contains(activeElement);\n const isFocusInCalendar =\n activeElement instanceof Node && calendarRef.current?.contains(activeElement);\n\n if (isFocusInDateRangeInput || isFocusInCalendar) {\n return;\n }\n\n setDateMode(null);\n if (state.isOpen) {\n state.setOpen(false);\n }\n });\n },\n });\n\n const handleOutsideClick = (e: Event) => {\n const target = e.target as Node;\n // Don't close if clicking on the date inputs themselves\n if (ref.current?.contains(target)) {\n return;\n }\n\n // When there's a click outside of the containers + calendars, reset the highlighted date\n // Only close the calendar if it's open\n // Note: Radix UI's onInteractOutside already ensures the interaction is outside the popover content\n if (state.isOpen) {\n setDateMode(null);\n state.setOpen(false);\n }\n };\n\n const { pressProps: pressClearProps } = usePress({\n onPress: () => {\n state.setValue(null);\n\n if (props.onClear) {\n props.onClear();\n }\n },\n });\n\n const handleKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n if (event.key === 'Enter') {\n event.preventDefault(); // Prevent form submission\n openCalendarWithFocus();\n }\n },\n [openCalendarWithFocus],\n );\n\n const isValueNull = state.value && state.value.start == null && state.value.end == null;\n\n return (\n <DateRangeContainer data-test={props.dataTest} className={className}>\n {props.label && <CustomFormLabel {...labelProps}>{props.label}</CustomFormLabel>}\n <Popover\n open={state.isOpen}\n modal={false}\n portalProps={portalContainer ? { container: portalContainer } : undefined}\n contentProps={{\n align: 'start',\n 'aria-modal': true,\n 'aria-label': props['aria-label'] ?? undefined,\n onInteractOutside: handleOutsideClick,\n onOpenAutoFocus: (e: Event) => {\n // Field focus opens the calendar for editing, while Enter/Open calendar moves focus inside.\n e.preventDefault();\n },\n onEscapeKeyDown: () => {\n state.setOpen(false);\n // Restore focus to the date field for keyboard users\n if (dateMode) {\n const fieldRef = dateMode === 'start' ? startFieldRef : endFieldRef;\n const seg = fieldRef.current?.querySelector('[tabindex=\"0\"]');\n if (seg instanceof HTMLElement) {\n seg.focus();\n }\n }\n },\n onCloseAutoFocus: (e: Event) => {\n // Prevent Radix's default focus restoration — Escape handles its own above.\n e.preventDefault();\n isClosingRef.current = true;\n requestAnimationFrame(() => {\n isClosingRef.current = false;\n });\n },\n noPadding: true,\n style: { zIndex: calendarZIndex },\n zIndex: calendarZIndex,\n }}\n >\n <Popover.Trigger asChild>\n <DateRangeInputs {...mergeProps(groupProps, containerFocusProps)} ref={ref}>\n {/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */}\n <DateField\n ref={startFieldRef}\n inputPosition='start'\n focused={dateMode === 'start'}\n disabled={props.disabled}\n size={props.size}\n {...mergeProps(startFieldProps, startFocusWithinProps, { onKeyDown: handleKeyDown })}\n />\n {/* @ts-expect-error [strict-migration] The following line is not strict; please fix! */}\n <DateField\n ref={endFieldRef}\n inputPosition='end'\n focused={dateMode === 'end'}\n disabled={props.disabled}\n size={props.size}\n {...mergeProps(endFieldProps, endFocusWithinProps, { onKeyDown: handleKeyDown })}\n />\n {props.showClear && (\n <ClearRangeButton\n {...pressClearProps}\n type='button'\n disabled={isValueNull}\n aria-label='Clear date range'\n >\n <CircleXInverseIcon />\n </ClearRangeButton>\n )}\n <VisuallyHidden>\n <OpenButton onOpen={openCalendarWithFocus} disabled={props.disabled} />\n </VisuallyHidden>\n </DateRangeInputs>\n </Popover.Trigger>\n <RangeCalendar\n {...{ ...calendarProps, autoFocus: undefined }}\n calendarRef={calendarRef}\n setDateMode={setDateMode}\n setValue={state.setValue}\n granularity={granularity}\n hidePresets={props.hidePresets}\n visibleMonths={props.visibleMonths}\n onSelectDate={(dateVal) => {\n /**\n * Please use caution when editing the logic below.\n * It is specific to react-aria's date picker and can be brittle.\n */\n if (dateVal) {\n const date = state.hasTime ? toCalendarDateTime(dateVal) : dateVal;\n\n if (dateMode === 'start') {\n // Handle a case where we've deleted both dates\n if (state.value.end == null && state.value.start == null) {\n state.setValue({\n start: date,\n end: date,\n });\n }\n // If end becomes the start\n else if (state.value.end && date.compare(state.value.end) > 0) {\n state.setValue({\n start: state.value.end,\n end: state.value.end.set(dateVal), // Preserve time\n });\n } else {\n state.setValue({\n // if start is not set, set it to the date or date + time value, otherwise set the dateVal to preserve time\n start: state.value.start == null ? date : state.value.start.set(dateVal),\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n\n end: state.value.end,\n });\n }\n setDateMode('end');\n } else {\n // Handle a case where we've deleted both dates\n if (state.value.end == null && state.value.start == null) {\n state.setValue({\n start: date,\n end: date,\n });\n }\n // If start becomes the end\n else if (state.value.start && date.compare(state.value.start) < 0) {\n state.setValue({\n start: state.value.start.set(dateVal),\n end: state.value.start,\n });\n } else {\n state.setValue({\n /* @ts-expect-error [strict-migration] The following line is not strict; please fix! */\n start: state.value.start,\n // if end is not set, set it to the date or date + time value, otherwise set the dateVal to preserve time\n end: state.value.end == null ? date : state.value.end.set(dateVal),\n });\n }\n // Close popover and keep focus on end field\n state.setOpen(false);\n }\n }\n }}\n minDate={props.minDate}\n maxDate={props.maxDate}\n />\n </Popover>\n </DateRangeContainer>\n );\n};\n\nexport default DateRangePicker;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAa,oBAAoB,OAAO,GAAG;;;AAI3C,MAAa,iBAAiB,OAAO,GAAG;;;mBAGrB,QAAQ,GAAG;;AAG9B,MAAa,kBAAkB,OAAO,GAAG;IACrC,WAAW,cAAc;;;;AAK7B,MAAM,uBAAuB,OAAO,WAAW;;;;AAK/C,MAAa,kBAAkB,UAA2B;CACxD,MAAM,MAAM,QAAQ;CAEpB,MAAM,EAAE,gBAAgB,UAAU,OAAO,IAAI;AAE7C,QAEE,oBAAC,sBAAD;EAAsB,GAAI;EAAa,WAAW,MAAM;EAAgB;YACrE,MAAM;EACc,CAAA;;;;AC9B3B,MAAM,wBAAwB,OAAO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