@persona/design-system 0.10.5 → 0.10.6

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 (202) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/Badge-8YzapjWf.mjs.map +1 -1
  3. package/dist/Breadcrumbs-Dft2TR4v.mjs.map +1 -1
  4. package/dist/Card-DuQHyroh.mjs.map +1 -1
  5. package/dist/CardV2-BRJbRSts.mjs.map +1 -1
  6. package/dist/Checkbox-Dr4LMKHV.mjs.map +1 -1
  7. package/dist/{CheckboxGroupField-UHpA38U5.d.mts → CheckboxGroupField-CjeEoiPa.d.mts} +2 -2
  8. package/dist/CheckboxGroupField.d.mts +1 -1
  9. package/dist/Combobox-DQxaOCLA.mjs.map +1 -1
  10. package/dist/{Combobox-BXkcQ2aY.d.mts → Combobox-O6LbofT2.d.mts} +3 -3
  11. package/dist/Combobox.d.mts +2 -2
  12. package/dist/{ComboboxBase-D2rDQHYZ.d.mts → ComboboxBase-5aSDuY-E.d.mts} +2 -2
  13. package/dist/ComboboxBase.d.mts +1 -1
  14. package/dist/{ComboboxMultiSelect-CrvB6ap5.d.mts → ComboboxMultiSelect-D3mX4Dzq.d.mts} +2 -2
  15. package/dist/ComboboxMultiSelect.d.mts +1 -1
  16. package/dist/{ComboboxSingleSelect-Dp0iTdDO.d.mts → ComboboxSingleSelect-CfSy6sCU.d.mts} +3 -3
  17. package/dist/ComboboxSingleSelect.d.mts +1 -1
  18. package/dist/{DataTable-C000E74h.d.mts → DataTable-BXHmi-SW.d.mts} +7 -6
  19. package/dist/{DataTable-DEJHWrsy.mjs → DataTable-CAfZNJmb.mjs} +8 -7
  20. package/dist/DataTable-CAfZNJmb.mjs.map +1 -0
  21. package/dist/DataTable.d.mts +1 -1
  22. package/dist/DatePicker-D-_ibUd1.mjs.map +1 -1
  23. package/dist/DropdownButton-BiFRlSVD.mjs.map +1 -1
  24. package/dist/DropdownButton.d.mts +1 -1
  25. package/dist/{DropdownMenu-CQbS7ML5.d.mts → DropdownMenu-CAYVX9Q3.d.mts} +2 -2
  26. package/dist/DropdownMenu-Q8S-9rXm.mjs.map +1 -1
  27. package/dist/DropdownMenu.d.mts +1 -1
  28. package/dist/FormControl-BztNXLn6.mjs.map +1 -1
  29. package/dist/{FormField-g1zQFM9T.mjs → FormField-BStxmlZT.mjs} +2 -2
  30. package/dist/FormField-BStxmlZT.mjs.map +1 -0
  31. package/dist/{FormField-PBo1ctY8.d.mts → FormField-D10LW9-a.d.mts} +2 -2
  32. package/dist/FormField.d.mts +1 -1
  33. package/dist/HoverCopyableField-CW7Jxmni.mjs.map +1 -1
  34. package/dist/{I18nContext-EPmbUprm.d.mts → I18nContext-BBVKF9ui.d.mts} +2 -2
  35. package/dist/I18nContext.d.mts +1 -1
  36. package/dist/IconButton-DftINsp7.mjs.map +1 -1
  37. package/dist/IndexTableLayout.d.mts +3 -3
  38. package/dist/InlineCombobox.d.mts +1 -1
  39. package/dist/InlineInput.d.mts +1 -1
  40. package/dist/Input-DtO3qMnE.mjs.map +1 -1
  41. package/dist/Link-DKYmdL9t.mjs.map +1 -1
  42. package/dist/ListBox-CDG0EAPg.mjs.map +1 -1
  43. package/dist/{ListBox-D9SYTzOd.d.mts → ListBox-CvnFiHK5.d.mts} +2 -2
  44. package/dist/ListBox.d.mts +1 -1
  45. package/dist/{ListBoxField-CtPDd_Aw.d.mts → ListBoxField-DuUwx9Cv.d.mts} +4 -4
  46. package/dist/ListBoxField.d.mts +1 -1
  47. package/dist/LoadingShimmer-oPIv2ESr.mjs.map +1 -1
  48. package/dist/{LogicRow-BWIZ7262.d.mts → LogicRow-COvZNiUd.d.mts} +2 -2
  49. package/dist/LogicRow.d.mts +1 -1
  50. package/dist/{Menu-DizjcMbO.d.mts → Menu-ByYFNvgS.d.mts} +2 -2
  51. package/dist/Menu-EIT_MwK6.mjs.map +1 -1
  52. package/dist/Menu.d.mts +1 -1
  53. package/dist/{Modal-92O_uW8H.mjs → Modal-ziuzDCPN.mjs} +2 -2
  54. package/dist/Modal-ziuzDCPN.mjs.map +1 -0
  55. package/dist/PageHeader-BzvA_NNt.mjs.map +1 -1
  56. package/dist/PageLayout-DCe3F76N.mjs.map +1 -1
  57. package/dist/{PageSelector-QaKYtk6y.d.mts → PageSelector-BOe4EzbS.d.mts} +8 -2
  58. package/dist/PageSelector.d.mts +1 -1
  59. package/dist/{Pagination-dTsHLVAk.mjs → Pagination-Dpc6TadZ.mjs} +15 -11
  60. package/dist/Pagination-Dpc6TadZ.mjs.map +1 -0
  61. package/dist/{Pagination-DeXorbSK.d.mts → Pagination-Dy-OSH0Y.d.mts} +10 -2
  62. package/dist/Pagination.d.mts +1 -1
  63. package/dist/Popover-DordjYNM.mjs.map +1 -1
  64. package/dist/ProgressIndicator-ISARECzW.mjs.map +1 -1
  65. package/dist/Radio-BlEtetrr.mjs.map +1 -1
  66. package/dist/RadioGroup-CMrXmmn4.mjs.map +1 -1
  67. package/dist/SegmentedControl-D_DA-MU1.mjs.map +1 -1
  68. package/dist/{Select-Chk5WB1F.d.mts → Select-BLqHxJUz.d.mts} +2 -2
  69. package/dist/Select-DkUMz4LG.mjs.map +1 -1
  70. package/dist/Select.d.mts +1 -1
  71. package/dist/SmartTextInputField.d.mts +2 -2
  72. package/dist/Spacer-C4d9Aho6.mjs.map +1 -1
  73. package/dist/Spinner-CXb-KUs1.mjs.map +1 -1
  74. package/dist/StatusIndicator-pWl1-FLb.mjs.map +1 -1
  75. package/dist/Sticker-Bi_fezCO.mjs.map +1 -1
  76. package/dist/TabBar-DpXYsWgS.mjs.map +1 -1
  77. package/dist/Table-DPi4Dt5H.mjs.map +1 -1
  78. package/dist/TableBox-BfSF36Gy.mjs.map +1 -1
  79. package/dist/TableBox.d.mts +1 -1
  80. package/dist/{TableBoxCell-CwroLAWy.d.mts → TableBoxCell-DPXrw63v.d.mts} +4 -4
  81. package/dist/TableBoxCell.d.mts +1 -1
  82. package/dist/{TableBoxField-B7bHv7uV.d.mts → TableBoxField-C7MGSie9.d.mts} +5 -5
  83. package/dist/TableBoxField.d.mts +1 -1
  84. package/dist/{TableBoxRow-Dke8B99J.d.mts → TableBoxRow-uToXVWvl.d.mts} +2 -2
  85. package/dist/TableBoxRow.d.mts +1 -1
  86. package/dist/{TableBoxRowActions-CkUDVERC.d.mts → TableBoxRowActions-Do646IVE.d.mts} +2 -2
  87. package/dist/TableBoxRowActions.d.mts +1 -1
  88. package/dist/{TableControls-DAjx1TYG.d.mts → TableControls-BHv-tXA-.d.mts} +4 -3
  89. package/dist/{TableControls-BDXOQMr7.mjs → TableControls-C-0Dw8vM.mjs} +7 -5
  90. package/dist/TableControls-C-0Dw8vM.mjs.map +1 -0
  91. package/dist/TableControls.d.mts +1 -1
  92. package/dist/{TableControlsContext-BEIvE9qN.d.mts → TableControlsContext-D6rifk-v.d.mts} +2 -2
  93. package/dist/TableControlsContext.d.mts +1 -1
  94. package/dist/{TableViewConfigurationDropdown-vYnU0d4k.d.mts → TableViewConfigurationDropdown-C5bjxTGX.d.mts} +2 -2
  95. package/dist/TableViewConfigurationDropdown.d.mts +1 -1
  96. package/dist/TechnicalSticker-B_JlBkXZ.mjs.map +1 -1
  97. package/dist/Text-D0vEReED.mjs.map +1 -1
  98. package/dist/TextArea-Dro-HH8O.mjs.map +1 -1
  99. package/dist/Toggle-D9MzTIZs.mjs.map +1 -1
  100. package/dist/Tooltip-YViXzMdm.mjs.map +1 -1
  101. package/dist/{clientFilterUtils-DYKgw2Yq.d.mts → clientFilterUtils-DDDG1g7e.d.mts} +2 -2
  102. package/dist/clientFilterUtils.d.mts +1 -1
  103. package/dist/components/Accordion/index.mjs.map +1 -1
  104. package/dist/components/Attribute/index.mjs.map +1 -1
  105. package/dist/components/Banner/index.mjs.map +1 -1
  106. package/dist/components/BottomPanel/index.mjs.map +1 -1
  107. package/dist/components/ButtonGroup/index.mjs.map +1 -1
  108. package/dist/components/CodeHighlight/index.mjs.map +1 -1
  109. package/dist/components/Combobox/index.d.mts +2 -2
  110. package/dist/components/DataTable/TableControls/index.d.mts +6 -6
  111. package/dist/components/DataTable/TableControls/index.mjs +1 -1
  112. package/dist/components/DataTable/index.d.mts +5 -5
  113. package/dist/components/DataTable/index.mjs +1 -1
  114. package/dist/components/DataTable/types.d.mts +1 -1
  115. package/dist/components/DropdownMenu/index.d.mts +1 -1
  116. package/dist/components/FloatingPanel/index.mjs.map +1 -1
  117. package/dist/components/FormField/index.d.mts +5 -5
  118. package/dist/components/FormField/index.mjs +1 -1
  119. package/dist/components/ImageTile/index.mjs.map +1 -1
  120. package/dist/components/ListBox/index.d.mts +3 -3
  121. package/dist/components/MaskedInput/index.mjs.map +1 -1
  122. package/dist/components/MatchHighlight/index.mjs.map +1 -1
  123. package/dist/components/Menu/index.d.mts +1 -1
  124. package/dist/components/Modal/index.mjs +1 -1
  125. package/dist/components/Pagination/index.d.mts +2 -2
  126. package/dist/components/Pagination/index.mjs +1 -1
  127. package/dist/components/ProgressBar/index.mjs.map +1 -1
  128. package/dist/components/RichTextEditor/index.mjs +1 -1
  129. package/dist/components/RichTextEditor/index.mjs.map +1 -1
  130. package/dist/components/RightPanel/index.mjs.map +1 -1
  131. package/dist/components/Select/index.d.mts +1 -1
  132. package/dist/components/SelectionCard/index.mjs.map +1 -1
  133. package/dist/components/Slider/index.mjs.map +1 -1
  134. package/dist/components/SmartTextInput/index.mjs +1 -1
  135. package/dist/components/SmartTextInput/index.mjs.map +1 -1
  136. package/dist/components/SwatchPicker/index.mjs.map +1 -1
  137. package/dist/components/TableBox/index.d.mts +1 -1
  138. package/dist/components/Tile/index.mjs.map +1 -1
  139. package/dist/components/Toast/index.mjs.map +1 -1
  140. package/dist/components/VersionHistory/index.mjs +1 -1
  141. package/dist/components/VersionHistory/index.mjs.map +1 -1
  142. package/dist/display.d.mts +1 -1
  143. package/dist/fieldPickerOptions.d.mts +1 -1
  144. package/dist/{filters-DjXkx8GJ.d.mts → filters-CkAFU8LV.d.mts} +2 -2
  145. package/dist/filters.d.mts +1 -1
  146. package/dist/{helpers-CdxEL7ri.d.mts → helpers-Dvvcz-hL.d.mts} +3 -3
  147. package/dist/helpers.d.mts +1 -1
  148. package/dist/{i18n-BLyCaSdJ.mjs → i18n-CKRi992F.mjs} +2 -1
  149. package/dist/i18n-CKRi992F.mjs.map +1 -0
  150. package/dist/{index-DX5Zu9JU.d.mts → index-B3A74_ew.d.mts} +3 -3
  151. package/dist/index6.d.mts +1 -1
  152. package/dist/{inputFields-CYttsz5M.d.mts → inputFields-Dfpxi68z.d.mts} +5 -5
  153. package/dist/inputFields.d.mts +1 -1
  154. package/dist/lib/PDSProvider.d.mts +1 -1
  155. package/dist/lib/PDSProvider.mjs +1 -1
  156. package/dist/lib/PDSProvider.mjs.map +1 -1
  157. package/dist/lib/TruncatedText.mjs.map +1 -1
  158. package/dist/lib/TruncatedTextWithTooltip.mjs.map +1 -1
  159. package/dist/lib/color.mjs.map +1 -1
  160. package/dist/lib/colorMode.mjs.map +1 -1
  161. package/dist/lib/i18n/index.d.mts +2 -2
  162. package/dist/lib/i18n/index.mjs +1 -1
  163. package/dist/lib/pseudoClass.mjs.map +1 -1
  164. package/dist/lib/semanticColor.mjs.map +1 -1
  165. package/dist/lib/useEmbeddedSurface.mjs.map +1 -1
  166. package/dist/mixins/focus.mjs.map +1 -1
  167. package/dist/mixins/hoverable.mjs.map +1 -1
  168. package/dist/mixins/input.mjs.map +1 -1
  169. package/dist/mixins/menuItem.mjs.map +1 -1
  170. package/dist/mixins/print/index.mjs.map +1 -1
  171. package/dist/mixins/scrollbar.mjs.map +1 -1
  172. package/dist/{operators-gCG7uZ6y.d.mts → operators-BrrJKENE.d.mts} +2 -2
  173. package/dist/operators.d.mts +1 -1
  174. package/dist/patterns/CardGrouping/index.mjs.map +1 -1
  175. package/dist/patterns/IndexTableLayout/index.mjs +1 -1
  176. package/dist/patterns/IndexTableLayout/index.mjs.map +1 -1
  177. package/dist/patterns/LayoutLoadingShimmer/index.mjs.map +1 -1
  178. package/dist/patterns/LayoutLoadingSpinner/index.mjs.map +1 -1
  179. package/dist/patterns/WizardModal/index.mjs +1 -1
  180. package/dist/patterns/WizardModal/index.mjs.map +1 -1
  181. package/dist/{strings-CK9n6b65.d.mts → strings-BGXKl_m6.d.mts} +6 -1
  182. package/dist/strings.d.mts +1 -1
  183. package/dist/theme.mjs.map +1 -1
  184. package/dist/{types-DJobO07d.d.mts → types-DoJubhWu.d.mts} +2 -2
  185. package/dist/{types-CayYd8EX.d.mts → types-sUEmxsGM.d.mts} +2 -2
  186. package/dist/types5.d.mts +1 -1
  187. package/dist/useChain-D1aNsdvn.mjs.map +1 -1
  188. package/dist/useColumnConfiguration.d.mts +2 -2
  189. package/dist/useComboboxFooterAction.d.mts +1 -1
  190. package/dist/useFormField-pOVkb5BK.mjs.map +1 -1
  191. package/dist/{useTableColumns-BK-KYY0L.d.mts → useTableColumns-nPrbDfF_.d.mts} +2 -2
  192. package/dist/useTableColumns.d.mts +1 -1
  193. package/dist/useTruncation.d.mts +1 -1
  194. package/dist/utils/storybook.mjs.map +1 -1
  195. package/dist/variables/effect.mjs.map +1 -1
  196. package/package.json +16 -3
  197. package/dist/DataTable-DEJHWrsy.mjs.map +0 -1
  198. package/dist/FormField-g1zQFM9T.mjs.map +0 -1
  199. package/dist/Modal-92O_uW8H.mjs.map +0 -1
  200. package/dist/Pagination-dTsHLVAk.mjs.map +0 -1
  201. package/dist/TableControls-BDXOQMr7.mjs.map +0 -1
  202. package/dist/i18n-BLyCaSdJ.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## 0.10.6 (2026-10-28)
2
+
3
+ ### Features
4
+
5
+ - **pagination:** show totals that are lower bounds as N+ ([#475](https://github.com/persona-id/persona-design-system/pull/475))
6
+
7
+ ### Bug Fixes
8
+
9
+ - **design-system:** forward and gate the saved-view Reset action ([#474](https://github.com/persona-id/persona-design-system/pull/474))
10
+
11
+ ### 🧱 Updated Dependencies
12
+
13
+ - Updated design-tokens to 0.4.22
14
+ - Updated icons to 0.1.11
15
+
1
16
  ## 0.10.5 (2026-10-27)
2
17
 
3
18
  ### Features
@@ -1 +1 @@
1
- {"version":3,"file":"Badge-8YzapjWf.mjs","names":[],"sources":["../src/components/Badge/Badge.tsx"],"sourcesContent":["import styled, { css, type DefaultTheme, type StyledComponent } from 'styled-components';\n\nimport Sticker, { type StickerProps } from 'design-system/components/Sticker';\n\nexport interface BadgeProps {\n /**\n * When rendered on a secondary background (e.g. inside a panel or card with\n * a grey fill), set this to true so the component adjusts its colours\n * appropriately for certain variants.\n */\n onSecondaryBackground?: boolean;\n /**\n * Semantic colour variant for the badge.\n *\n * - `basic` – neutral grey, for informational counts or labels (default).\n * - `active` – purple, to highlight an active or selected state.\n * - `alert` – red/danger, to draw attention to errors or urgent counts.\n *\n * @defaultValue 'basic'\n */\n variant?: 'alert' | 'active' | 'basic';\n}\n\nexport const Badge = styled(({ variant, ...rest }: BadgeProps) => {\n let variantProp: StickerProps['variant'];\n switch (variant) {\n case 'alert':\n variantProp = 'danger';\n break;\n case 'active':\n variantProp = 'purple';\n break;\n case 'basic':\n default:\n variantProp = 'grey';\n }\n\n return <Sticker {...rest} variant={variantProp} />;\n})<BadgeProps>(\n () => css`\n min-width: 16px;\n text-align: center;\n border-radius: 100px;\n span {\n font-size: 10px;\n }\n `,\n) as StyledComponent<'span', DefaultTheme, BadgeProps, never>;\n/**\n * The type workaround above makes the correct types available for Badge.\n * Having duplicate prop names between Badge and Sticker seems to cause some oddities.\n *\n * We insist on making this a styled component so the component itself can be targeted in styles.\n * See: https://styled-components.com/docs/advanced#referring-to-other-components\n */\n\nexport default Badge;\n"],"mappings":";;;;AAuBA,MAAa,QAAQ,QAAQ,EAAE,SAAS,GAAG,WAAuB;CAChE,IAAI;AACJ,SAAQ,SAAR;EACE,KAAK;AACH,iBAAc;AACd;EACF,KAAK;AACH,iBAAc;AACd;EAEF,QACE,eAAc;;AAGlB,QAAO,oBAAC,SAAD;EAAS,GAAI;EAAM,SAAS;EAAe,CAAA;EAClD,OACM,GAAG;;;;;;;IAQV"}
1
+ {"version":3,"file":"Badge-8YzapjWf.mjs","names":[],"sources":["../src/components/Badge/Badge.tsx"],"sourcesContent":["import styled, { css, type DefaultTheme, type StyledComponent } from 'styled-components';\n\nimport Sticker, { type StickerProps } from '#src/components/Sticker';\n\nexport interface BadgeProps {\n /**\n * When rendered on a secondary background (e.g. inside a panel or card with\n * a grey fill), set this to true so the component adjusts its colours\n * appropriately for certain variants.\n */\n onSecondaryBackground?: boolean;\n /**\n * Semantic colour variant for the badge.\n *\n * - `basic` – neutral grey, for informational counts or labels (default).\n * - `active` – purple, to highlight an active or selected state.\n * - `alert` – red/danger, to draw attention to errors or urgent counts.\n *\n * @defaultValue 'basic'\n */\n variant?: 'alert' | 'active' | 'basic';\n}\n\nexport const Badge = styled(({ variant, ...rest }: BadgeProps) => {\n let variantProp: StickerProps['variant'];\n switch (variant) {\n case 'alert':\n variantProp = 'danger';\n break;\n case 'active':\n variantProp = 'purple';\n break;\n case 'basic':\n default:\n variantProp = 'grey';\n }\n\n return <Sticker {...rest} variant={variantProp} />;\n})<BadgeProps>(\n () => css`\n min-width: 16px;\n text-align: center;\n border-radius: 100px;\n span {\n font-size: 10px;\n }\n `,\n) as StyledComponent<'span', DefaultTheme, BadgeProps, never>;\n/**\n * The type workaround above makes the correct types available for Badge.\n * Having duplicate prop names between Badge and Sticker seems to cause some oddities.\n *\n * We insist on making this a styled component so the component itself can be targeted in styles.\n * See: https://styled-components.com/docs/advanced#referring-to-other-components\n */\n\nexport default Badge;\n"],"mappings":";;;;AAuBA,MAAa,QAAQ,QAAQ,EAAE,SAAS,GAAG,WAAuB;CAChE,IAAI;AACJ,SAAQ,SAAR;EACE,KAAK;AACH,iBAAc;AACd;EACF,KAAK;AACH,iBAAc;AACd;EAEF,QACE,eAAc;;AAGlB,QAAO,oBAAC,SAAD;EAAS,GAAI;EAAM,SAAS;EAAe,CAAA;EAClD,OACM,GAAG;;;;;;;IAQV"}
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumbs-Dft2TR4v.mjs","names":["Input"],"sources":["../src/components/Breadcrumbs/Breadcrumb.tsx","../src/components/Breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import { type ChangeEvent, useEffect, useRef, useState } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Spacing } from '@persona/design-tokens';\nimport { CopyIcon, EditIcon } from '@persona/icons';\nimport { IconButton } from 'design-system/components/Button';\nimport Input from 'design-system/components/Input';\nimport { HStack } from 'design-system/components/Stack';\nimport TechnicalSticker from 'design-system/components/TechnicalSticker';\nimport { Paragraph } from 'design-system/components/Text';\nimport Tooltip from 'design-system/components/Tooltip';\nimport { RouterLink } from 'design-system/lib/router';\nimport { semanticColor } from 'design-system/lib/semanticColor';\nimport TruncatedTextWithTooltip from 'design-system/lib/TruncatedTextWithTooltip';\nimport { focusOutline } from 'design-system/mixins/focus';\nimport { paragraphMixins } from 'design-system/mixins/text';\nimport { TransitionDuration } from 'design-system/variables/transitions';\n\nexport type BreadcrumbSize = 'md' | 'lg';\n\nexport type BreadcrumbHeadingAs = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\nconst COPY_TOOLTIP_LABEL = 'Copy ID';\nconst COPIED_TOOLTIP_LABEL = 'Copied!';\nconst DEFAULT_EDIT_MAX_LENGTH = 100;\nconst COPY_TOOLTIP_STICKER_MAX_WIDTH = '96px';\nconst COPY_TOOLTIP_STICKER_TOOLTIP_MAX_WIDTH = '250px';\n\nexport type BreadcrumbProps = {\n label: string;\n size?: BreadcrumbSize;\n current?: boolean;\n /**\n * Overrides the heading element rendered for the current crumb. Defaults to `h1`; use `h2` or\n * lower when the page already has an `h1`.\n */\n headingAs?: BreadcrumbHeadingAs;\n showCopyAction?: boolean;\n copyValue?: string;\n copyTooltipLabel?: string;\n /** Copy tooltip text shown after a successful copy. Defaults to `Copied!`. */\n copiedTooltipLabel?: string;\n /**\n * Appends `copyValue` to both copy tooltip texts as a `TechnicalSticker`, so the tooltip shows\n * which token is being copied.\n */\n showCopyValueInTooltip?: boolean;\n /** Internal path (e.g. `/cases`), rendered as a router-aware link. */\n href?: string;\n /**\n * Activates a non-current crumb without a route change, for trails that navigate in-place (e.g.\n * a control panel drilling into a sub-panel). Ignored when `href` is set.\n */\n onClick?: () => void;\n onEdit?: (newLabel: string) => void;\n editMaxLength?: number;\n onCopy?: () => void;\n};\n\nconst LABEL_ACTION_GAP = Spacing[2];\nconst ACTION_BUTTON_GAP = Spacing[1];\n\nexport const getInlineActionCount = ({\n onEdit,\n showCopyAction,\n copyValue,\n}: Pick<BreadcrumbProps, 'onEdit' | 'showCopyAction' | 'copyValue'>) =>\n Number(onEdit != null) + (showCopyAction && copyValue != null ? 1 : 0);\n\nconst CrumbRow = styled(HStack)`\n align-items: center;\n min-width: 0;\n`;\n\nconst InlineActions = styled(HStack)`\n flex-shrink: 0;\n`;\n\nconst BreadcrumbLabel = styled.span`\n overflow-wrap: anywhere;\n`;\n\nconst TruncatedBreadcrumbLabel = ({ label }: { label: string }) => (\n <TruncatedTextWithTooltip tooltipProps={{ maxWidth: '400px' }}>\n <BreadcrumbLabel>{label}</BreadcrumbLabel>\n </TruncatedTextWithTooltip>\n);\n\nconst crumbLayoutStyles = (size: BreadcrumbSize) => css`\n display: inline-flex;\n align-items: center;\n min-width: 0;\n min-height: ${({ theme }) => theme.element.height.xs};\n ${\n size === 'lg'\n ? css`\n font-size: ${({ theme }) => theme.text.paragraph.lg.fontSize};\n line-height: ${({ theme }) => theme.text.paragraph.lg.lineHeight};\n `\n : css``\n };\n`;\n\nconst editInputTextStyles = (size: BreadcrumbSize, current: boolean) => {\n if (current) {\n return size === 'lg' ? paragraphMixins.lgBold : paragraphMixins.mdBold;\n }\n return size === 'lg' ? paragraphMixins.lg : paragraphMixins.md;\n};\n\nconst ancestorCrumbStyles = css<{ $size: BreadcrumbSize }>`\n ${paragraphMixins.md};\n color: ${({ theme }) => semanticColor(theme, 'FgSecondary', theme.color.text.secondary)};\n text-decoration: none;\n transition: color ${TransitionDuration.ExtraFast} ease-out;\n ${focusOutline}\n ${({ $size }) => crumbLayoutStyles($size)}\n\n &:hover {\n color: ${({ theme }) => semanticColor(theme, 'FgPrimary', theme.color.text.primary)};\n }\n`;\n\nconst AncestorNavLink = styled(RouterLink)<{ $size: BreadcrumbSize }>`\n ${ancestorCrumbStyles}\n`;\n\nconst AncestorNavButton = styled.button<{ $size: BreadcrumbSize }>`\n ${ancestorCrumbStyles}\n padding: 0;\n border: none;\n background: none;\n cursor: pointer;\n`;\n\nconst InlineEditInput = styled(Input)<{\n $size: BreadcrumbSize;\n $current: boolean;\n $editMinWidth?: number;\n}>`\n margin: 0;\n padding: 2px 10px;\n width: auto;\n max-width: 100%;\n min-width: ${({ $editMinWidth }) => ($editMinWidth != null ? `${$editMinWidth}px` : '0')};\n field-sizing: content;\n display: inline-block;\n ${({ $size, $current }) => editInputTextStyles($size, $current)};\n background-color: ${({ theme }) => semanticColor(theme, 'SurfacePrimary', theme.color.background.primary)};\n color: ${({ theme }) => semanticColor(theme, 'FgPrimary', theme.color.text.primary)};\n\n &:not(:focus) {\n border-color: transparent;\n }\n\n &:hover:not(:disabled) {\n border-style: solid;\n }\n`;\n\nconst CurrentLabel = styled(Paragraph)<{ $size: BreadcrumbSize }>`\n margin: 0;\n ${({ $size }) => crumbLayoutStyles($size)}\n`;\n\nconst copyToClipboard = async (value: string): Promise<boolean> => {\n try {\n if (navigator.clipboard?.writeText == null) {\n return false;\n }\n\n await navigator.clipboard.writeText(value);\n return true;\n } catch {\n return false;\n }\n};\n\nconst BreadcrumbCopyButton = ({\n copyValue,\n copyTooltipLabel = COPY_TOOLTIP_LABEL,\n copiedTooltipLabel = COPIED_TOOLTIP_LABEL,\n showCopyValueInTooltip = false,\n onCopy,\n}: {\n copyValue: string;\n copyTooltipLabel?: string;\n copiedTooltipLabel?: string;\n showCopyValueInTooltip?: boolean;\n onCopy?: () => void;\n}) => {\n const [tooltipOpen, setTooltipOpen] = useState(false);\n const [copied, setCopied] = useState(false);\n\n const handleCopy = async () => {\n const success = await copyToClipboard(copyValue);\n if (!success) {\n return;\n }\n\n setCopied(true);\n setTooltipOpen(true);\n onCopy?.();\n\n window.setTimeout(() => {\n setTooltipOpen(false);\n window.setTimeout(() => setCopied(false), 200);\n }, 1000);\n };\n\n const handleMouseEnter = () => {\n if (!copied) {\n setTooltipOpen(true);\n }\n };\n\n const handleMouseLeave = () => {\n if (!copied) {\n setTooltipOpen(false);\n }\n };\n\n const trigger = (\n <span onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave}>\n <IconButton\n type='button'\n size='sm'\n aria-label={`Copy ${copyValue}`}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n void handleCopy();\n }}\n >\n <CopyIcon />\n </IconButton>\n </span>\n );\n\n const tooltipLabel = copied ? copiedTooltipLabel : copyTooltipLabel;\n\n return (\n <Tooltip\n trigger={trigger}\n open={tooltipOpen}\n side='top'\n sideOffset={4}\n size='sm'\n contentAlignment='center'\n interactive={false}\n hideArrow\n portal={false}\n maxWidth={showCopyValueInTooltip ? COPY_TOOLTIP_STICKER_TOOLTIP_MAX_WIDTH : undefined}\n >\n {showCopyValueInTooltip ? (\n <HStack spacing={ACTION_BUTTON_GAP} align='center'>\n <span>{tooltipLabel}</span>\n <TechnicalSticker copyable={false} maxWidth={COPY_TOOLTIP_STICKER_MAX_WIDTH}>\n {copyValue}\n </TechnicalSticker>\n </HStack>\n ) : (\n tooltipLabel\n )}\n </Tooltip>\n );\n};\n\nconst Breadcrumb = ({\n label,\n size = 'md',\n current = false,\n headingAs = 'h1',\n showCopyAction = false,\n copyValue,\n copyTooltipLabel,\n copiedTooltipLabel,\n showCopyValueInTooltip,\n href,\n onClick,\n onEdit,\n editMaxLength = DEFAULT_EDIT_MAX_LENGTH,\n onCopy,\n}: BreadcrumbProps) => {\n const [isEditing, setIsEditing] = useState(false);\n const [editValue, setEditValue] = useState(label);\n const [editMinWidth, setEditMinWidth] = useState<number | undefined>();\n const editInputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (!isEditing) {\n setEditValue(label);\n }\n }, [isEditing, label]);\n\n useEffect(() => {\n if (!isEditing) {\n setEditMinWidth(undefined);\n return;\n }\n\n const input = editInputRef.current;\n if (input == null) {\n return;\n }\n\n setEditMinWidth(input.offsetWidth);\n input.focus();\n input.select();\n }, [isEditing]);\n\n const commitEdit = () => {\n if (!isEditing) {\n return;\n }\n\n setIsEditing(false);\n if (editValue !== label) {\n onEdit?.(editValue);\n }\n };\n\n const inlineActionCount = getInlineActionCount({ onEdit, showCopyAction, copyValue });\n const inlineActions = !isEditing && inlineActionCount > 0 && (\n <InlineActions spacing={ACTION_BUTTON_GAP} align='center'>\n {onEdit != null && (\n <IconButton\n type='button'\n size='sm'\n aria-label={`Edit ${label}`}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setIsEditing(true);\n }}\n >\n <EditIcon />\n </IconButton>\n )}\n {showCopyAction && copyValue != null && (\n <BreadcrumbCopyButton\n copyValue={copyValue}\n copyTooltipLabel={copyTooltipLabel}\n copiedTooltipLabel={copiedTooltipLabel}\n showCopyValueInTooltip={showCopyValueInTooltip}\n onCopy={onCopy}\n />\n )}\n </InlineActions>\n );\n\n if (isEditing) {\n return (\n <CrumbRow spacing={LABEL_ACTION_GAP}>\n <InlineEditInput\n ref={editInputRef}\n $size={size}\n $current={current}\n $editMinWidth={editMinWidth}\n size='md'\n aria-label={`Edit ${label}`}\n maxLength={editMaxLength}\n value={editValue}\n onChange={(event: ChangeEvent<HTMLInputElement>) => setEditValue(event.target.value)}\n onBlur={commitEdit}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n commitEdit();\n }\n if (event.key === 'Escape') {\n setEditValue(label);\n setIsEditing(false);\n }\n }}\n />\n </CrumbRow>\n );\n }\n\n if (current) {\n return (\n <CrumbRow spacing={LABEL_ACTION_GAP}>\n <CurrentLabel\n $size={size}\n size={size === 'lg' ? 'lg' : 'md'}\n weight='bold'\n color='primary'\n as={headingAs}\n >\n <TruncatedBreadcrumbLabel label={label} />\n </CurrentLabel>\n {inlineActions}\n </CrumbRow>\n );\n }\n\n if (href == null && onClick != null) {\n return (\n <CrumbRow spacing={LABEL_ACTION_GAP}>\n <AncestorNavButton type='button' onClick={onClick} $size={size}>\n <TruncatedBreadcrumbLabel label={label} />\n </AncestorNavButton>\n {inlineActions}\n </CrumbRow>\n );\n }\n\n return (\n <CrumbRow spacing={LABEL_ACTION_GAP}>\n <AncestorNavLink to={href ?? ''} $size={size}>\n <TruncatedBreadcrumbLabel label={label} />\n </AncestorNavLink>\n {inlineActions}\n </CrumbRow>\n );\n};\n\nexport default Breadcrumb;\n","import styled from 'styled-components';\n\nimport { Spacing } from '@persona/design-tokens';\nimport { intersperse } from 'design-system/lib/intersperse';\nimport { semanticColor } from 'design-system/lib/semanticColor';\nimport { paragraphMixins } from 'design-system/mixins/text';\n\nimport Breadcrumb, {\n type BreadcrumbHeadingAs,\n type BreadcrumbProps,\n type BreadcrumbSize,\n getInlineActionCount,\n} from './Breadcrumb';\n\nexport type BreadcrumbsItemProps = Omit<BreadcrumbProps, 'size' | 'current' | 'headingAs'>;\n\nexport type BreadcrumbsProps = {\n items: BreadcrumbsItemProps[];\n size?: BreadcrumbSize;\n /**\n * Overrides the heading element rendered for the current crumb. Defaults to `h1`; use `h2` or\n * lower when the page already has an `h1`.\n */\n headingAs?: BreadcrumbHeadingAs;\n 'aria-label'?: string;\n className?: string;\n};\n\nconst ANCESTOR_MIN_CHARS = 8;\nconst CURRENT_MIN_CHARS = 12;\n\nconst BreadcrumbNav = styled.nav`\n min-width: 0;\n`;\n\nconst BreadcrumbList = styled.ol`\n max-width: 100%;\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n list-style: none;\n margin: 0;\n padding: 0;\n min-width: 0;\n`;\n\nconst BreadcrumbListItem = styled.li<{\n $size: BreadcrumbSize;\n $isCurrent: boolean;\n $isShort: boolean;\n $minWidth?: string;\n}>`\n display: flex;\n align-items: center;\n ${({ $size }) => ($size === 'lg' ? paragraphMixins.lg : paragraphMixins.md)};\n ${({ $isShort, $isCurrent }) =>\n $isShort ? 'flex-shrink: 0;' : $isCurrent ? 'flex: 0 1 auto;' : 'flex: 0 100000 auto;'}\n ${({ $minWidth }) => $minWidth != null && `min-width: ${$minWidth};`}\n\n &:has(input) {\n flex-shrink: 1;\n }\n`;\n\nconst SeparatorListItem = styled.li`\n display: flex;\n align-items: center;\n flex-shrink: 0;\n`;\n\nconst Separator = styled.span<{ $size: BreadcrumbSize }>`\n padding: 0 ${Spacing[2]};\n color: ${({ theme }) => semanticColor(theme, 'FgSecondary', theme.color.text.tertiary)};\n user-select: none;\n ${({ $size }) => ($size === 'lg' ? paragraphMixins.lg : paragraphMixins.md)};\n`;\n\nexport const Breadcrumbs = ({\n items,\n size = 'md',\n headingAs = 'h1',\n 'aria-label': ariaLabel = 'Breadcrumbs',\n className,\n}: BreadcrumbsProps) => {\n if (items.length === 0) {\n return null;\n }\n\n const crumbNodes = items.map((item, index) => {\n const isCurrent = index === items.length - 1;\n const minChars = isCurrent ? CURRENT_MIN_CHARS : ANCESTOR_MIN_CHARS;\n const actionCount = getInlineActionCount(item);\n const actionsWidth =\n actionCount === 0\n ? 0\n : Number.parseFloat(Spacing[2]) +\n actionCount * 24 +\n (actionCount - 1) * Number.parseFloat(Spacing[1]);\n\n return (\n <BreadcrumbListItem\n key={`${item.label}-${index}`}\n aria-current={isCurrent ? 'page' : undefined}\n $size={size}\n $isCurrent={isCurrent}\n $isShort={item.label.length <= minChars}\n $minWidth={\n item.label.length > minChars ? `calc(${minChars}ch + ${actionsWidth}px)` : undefined\n }\n >\n <Breadcrumb {...item} size={size} current={isCurrent} headingAs={headingAs} />\n </BreadcrumbListItem>\n );\n });\n\n const listItems = intersperse(crumbNodes, (separatorIndex: number) => (\n <SeparatorListItem key={`separator-${separatorIndex}`} aria-hidden='true'>\n <Separator $size={size}>/</Separator>\n </SeparatorListItem>\n ));\n\n return (\n <BreadcrumbNav aria-label={ariaLabel} className={className}>\n <BreadcrumbList>{listItems}</BreadcrumbList>\n </BreadcrumbNav>\n );\n};\n\nexport default Breadcrumbs;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAsBA,MAAM,qBAAqB;AAC3B,MAAM,uBAAuB;AAC7B,MAAM,0BAA0B;AAChC,MAAM,iCAAiC;AACvC,MAAM,yCAAyC;AAiC/C,MAAM,mBAAmB,QAAQ;AACjC,MAAM,oBAAoB,QAAQ;AAElC,MAAa,wBAAwB,EACnC,QACA,gBACA,gBAEA,OAAO,UAAU,KAAK,IAAI,kBAAkB,aAAa,OAAO,IAAI;AAEtE,MAAM,WAAW,OAAO,OAAO;;;;AAK/B,MAAM,gBAAgB,OAAO,OAAO;;;AAIpC,MAAM,kBAAkB,OAAO,IAAI;;;AAInC,MAAM,4BAA4B,EAAE,YAClC,oBAAC,0BAAD;CAA0B,cAAc,EAAE,UAAU,SAAS;WAC3D,oBAAC,iBAAD,EAAA,UAAkB,OAAwB,CAAA;CACjB,CAAA;AAG7B,MAAM,qBAAqB,SAAyB,GAAG;;;;iBAItC,EAAE,YAAY,MAAM,QAAQ,OAAO,GAAG;IAEnD,SAAS,OACL,GAAG;sBACW,EAAE,YAAY,MAAM,KAAK,UAAU,GAAG,SAAS;wBAC7C,EAAE,YAAY,MAAM,KAAK,UAAU,GAAG,WAAW;UAEjE,GAAG,GACR;;AAGH,MAAM,uBAAuB,MAAsB,YAAqB;AACtE,KAAI,QACF,QAAO,SAAS,OAAO,gBAAgB,SAAS,gBAAgB;AAElE,QAAO,SAAS,OAAO,gBAAgB,KAAK,gBAAgB;;AAG9D,MAAM,sBAAsB,GAA8B;IACtD,gBAAgB,GAAG;YACX,EAAE,YAAY,cAAc,OAAO,eAAe,MAAM,MAAM,KAAK,UAAU,CAAC;;8BAEvC;IAC/C,aAAa;KACZ,EAAE,YAAY,kBAAkB,MAAM,CAAC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Q,GAAG;AAEvD,UACE,oBAAC,oBAAD;IAEE,gBAAc,YAAY,SAAS,KAAA;IACnC,OAAO;IACP,YAAY;IACZ,UAAU,KAAK,MAAM,UAAU;IAC/B,WACE,KAAK,MAAM,SAAS,WAAW,QAAQ,SAAS,OAAO,aAAa,OAAO,KAAA;cAG7E,oBAAC,YAAD;KAAY,GAAI;KAAY;KAAM,SAAS;KAAsB;KAAa,CAAA;IAC3D,EAVd,GAAG,KAAK,MAAM,GAAG,QAUH;IAIe,GAAG,mBACzC,oBAAC,mBAAD;GAAuD,eAAY;aACjE,oBAAC,WAAD;IAAW,OAAO;cAAM;IAAa,CAAA;GACnB,EAFI,aAAa,iBAEjB,CAKQ,EAAkB,CAAA;EAC9B,CAAA"}
1
+ {"version":3,"file":"Breadcrumbs-Dft2TR4v.mjs","names":["Input"],"sources":["../src/components/Breadcrumbs/Breadcrumb.tsx","../src/components/Breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import { type ChangeEvent, useEffect, useRef, useState } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Spacing } from '@persona/design-tokens';\nimport { CopyIcon, EditIcon } from '@persona/icons';\n\nimport { IconButton } from '#src/components/Button';\nimport Input from '#src/components/Input';\nimport { HStack } from '#src/components/Stack';\nimport TechnicalSticker from '#src/components/TechnicalSticker';\nimport { Paragraph } from '#src/components/Text';\nimport Tooltip from '#src/components/Tooltip';\nimport { RouterLink } from '#src/lib/router';\nimport { semanticColor } from '#src/lib/semanticColor';\nimport TruncatedTextWithTooltip from '#src/lib/TruncatedTextWithTooltip';\nimport { focusOutline } from '#src/mixins/focus';\nimport { paragraphMixins } from '#src/mixins/text';\nimport { TransitionDuration } from '#src/variables/transitions';\n\nexport type BreadcrumbSize = 'md' | 'lg';\n\nexport type BreadcrumbHeadingAs = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\nconst COPY_TOOLTIP_LABEL = 'Copy ID';\nconst COPIED_TOOLTIP_LABEL = 'Copied!';\nconst DEFAULT_EDIT_MAX_LENGTH = 100;\nconst COPY_TOOLTIP_STICKER_MAX_WIDTH = '96px';\nconst COPY_TOOLTIP_STICKER_TOOLTIP_MAX_WIDTH = '250px';\n\nexport type BreadcrumbProps = {\n label: string;\n size?: BreadcrumbSize;\n current?: boolean;\n /**\n * Overrides the heading element rendered for the current crumb. Defaults to `h1`; use `h2` or\n * lower when the page already has an `h1`.\n */\n headingAs?: BreadcrumbHeadingAs;\n showCopyAction?: boolean;\n copyValue?: string;\n copyTooltipLabel?: string;\n /** Copy tooltip text shown after a successful copy. Defaults to `Copied!`. */\n copiedTooltipLabel?: string;\n /**\n * Appends `copyValue` to both copy tooltip texts as a `TechnicalSticker`, so the tooltip shows\n * which token is being copied.\n */\n showCopyValueInTooltip?: boolean;\n /** Internal path (e.g. `/cases`), rendered as a router-aware link. */\n href?: string;\n /**\n * Activates a non-current crumb without a route change, for trails that navigate in-place (e.g.\n * a control panel drilling into a sub-panel). Ignored when `href` is set.\n */\n onClick?: () => void;\n onEdit?: (newLabel: string) => void;\n editMaxLength?: number;\n onCopy?: () => void;\n};\n\nconst LABEL_ACTION_GAP = Spacing[2];\nconst ACTION_BUTTON_GAP = Spacing[1];\n\nexport const getInlineActionCount = ({\n onEdit,\n showCopyAction,\n copyValue,\n}: Pick<BreadcrumbProps, 'onEdit' | 'showCopyAction' | 'copyValue'>) =>\n Number(onEdit != null) + (showCopyAction && copyValue != null ? 1 : 0);\n\nconst CrumbRow = styled(HStack)`\n align-items: center;\n min-width: 0;\n`;\n\nconst InlineActions = styled(HStack)`\n flex-shrink: 0;\n`;\n\nconst BreadcrumbLabel = styled.span`\n overflow-wrap: anywhere;\n`;\n\nconst TruncatedBreadcrumbLabel = ({ label }: { label: string }) => (\n <TruncatedTextWithTooltip tooltipProps={{ maxWidth: '400px' }}>\n <BreadcrumbLabel>{label}</BreadcrumbLabel>\n </TruncatedTextWithTooltip>\n);\n\nconst crumbLayoutStyles = (size: BreadcrumbSize) => css`\n display: inline-flex;\n align-items: center;\n min-width: 0;\n min-height: ${({ theme }) => theme.element.height.xs};\n ${\n size === 'lg'\n ? css`\n font-size: ${({ theme }) => theme.text.paragraph.lg.fontSize};\n line-height: ${({ theme }) => theme.text.paragraph.lg.lineHeight};\n `\n : css``\n };\n`;\n\nconst editInputTextStyles = (size: BreadcrumbSize, current: boolean) => {\n if (current) {\n return size === 'lg' ? paragraphMixins.lgBold : paragraphMixins.mdBold;\n }\n return size === 'lg' ? paragraphMixins.lg : paragraphMixins.md;\n};\n\nconst ancestorCrumbStyles = css<{ $size: BreadcrumbSize }>`\n ${paragraphMixins.md};\n color: ${({ theme }) => semanticColor(theme, 'FgSecondary', theme.color.text.secondary)};\n text-decoration: none;\n transition: color ${TransitionDuration.ExtraFast} ease-out;\n ${focusOutline}\n ${({ $size }) => crumbLayoutStyles($size)}\n\n &:hover {\n color: ${({ theme }) => semanticColor(theme, 'FgPrimary', theme.color.text.primary)};\n }\n`;\n\nconst AncestorNavLink = styled(RouterLink)<{ $size: BreadcrumbSize }>`\n ${ancestorCrumbStyles}\n`;\n\nconst AncestorNavButton = styled.button<{ $size: BreadcrumbSize }>`\n ${ancestorCrumbStyles}\n padding: 0;\n border: none;\n background: none;\n cursor: pointer;\n`;\n\nconst InlineEditInput = styled(Input)<{\n $size: BreadcrumbSize;\n $current: boolean;\n $editMinWidth?: number;\n}>`\n margin: 0;\n padding: 2px 10px;\n width: auto;\n max-width: 100%;\n min-width: ${({ $editMinWidth }) => ($editMinWidth != null ? `${$editMinWidth}px` : '0')};\n field-sizing: content;\n display: inline-block;\n ${({ $size, $current }) => editInputTextStyles($size, $current)};\n background-color: ${({ theme }) => semanticColor(theme, 'SurfacePrimary', theme.color.background.primary)};\n color: ${({ theme }) => semanticColor(theme, 'FgPrimary', theme.color.text.primary)};\n\n &:not(:focus) {\n border-color: transparent;\n }\n\n &:hover:not(:disabled) {\n border-style: solid;\n }\n`;\n\nconst CurrentLabel = styled(Paragraph)<{ $size: BreadcrumbSize }>`\n margin: 0;\n ${({ $size }) => crumbLayoutStyles($size)}\n`;\n\nconst copyToClipboard = async (value: string): Promise<boolean> => {\n try {\n if (navigator.clipboard?.writeText == null) {\n return false;\n }\n\n await navigator.clipboard.writeText(value);\n return true;\n } catch {\n return false;\n }\n};\n\nconst BreadcrumbCopyButton = ({\n copyValue,\n copyTooltipLabel = COPY_TOOLTIP_LABEL,\n copiedTooltipLabel = COPIED_TOOLTIP_LABEL,\n showCopyValueInTooltip = false,\n onCopy,\n}: {\n copyValue: string;\n copyTooltipLabel?: string;\n copiedTooltipLabel?: string;\n showCopyValueInTooltip?: boolean;\n onCopy?: () => void;\n}) => {\n const [tooltipOpen, setTooltipOpen] = useState(false);\n const [copied, setCopied] = useState(false);\n\n const handleCopy = async () => {\n const success = await copyToClipboard(copyValue);\n if (!success) {\n return;\n }\n\n setCopied(true);\n setTooltipOpen(true);\n onCopy?.();\n\n window.setTimeout(() => {\n setTooltipOpen(false);\n window.setTimeout(() => setCopied(false), 200);\n }, 1000);\n };\n\n const handleMouseEnter = () => {\n if (!copied) {\n setTooltipOpen(true);\n }\n };\n\n const handleMouseLeave = () => {\n if (!copied) {\n setTooltipOpen(false);\n }\n };\n\n const trigger = (\n <span onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave}>\n <IconButton\n type='button'\n size='sm'\n aria-label={`Copy ${copyValue}`}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n void handleCopy();\n }}\n >\n <CopyIcon />\n </IconButton>\n </span>\n );\n\n const tooltipLabel = copied ? copiedTooltipLabel : copyTooltipLabel;\n\n return (\n <Tooltip\n trigger={trigger}\n open={tooltipOpen}\n side='top'\n sideOffset={4}\n size='sm'\n contentAlignment='center'\n interactive={false}\n hideArrow\n portal={false}\n maxWidth={showCopyValueInTooltip ? COPY_TOOLTIP_STICKER_TOOLTIP_MAX_WIDTH : undefined}\n >\n {showCopyValueInTooltip ? (\n <HStack spacing={ACTION_BUTTON_GAP} align='center'>\n <span>{tooltipLabel}</span>\n <TechnicalSticker copyable={false} maxWidth={COPY_TOOLTIP_STICKER_MAX_WIDTH}>\n {copyValue}\n </TechnicalSticker>\n </HStack>\n ) : (\n tooltipLabel\n )}\n </Tooltip>\n );\n};\n\nconst Breadcrumb = ({\n label,\n size = 'md',\n current = false,\n headingAs = 'h1',\n showCopyAction = false,\n copyValue,\n copyTooltipLabel,\n copiedTooltipLabel,\n showCopyValueInTooltip,\n href,\n onClick,\n onEdit,\n editMaxLength = DEFAULT_EDIT_MAX_LENGTH,\n onCopy,\n}: BreadcrumbProps) => {\n const [isEditing, setIsEditing] = useState(false);\n const [editValue, setEditValue] = useState(label);\n const [editMinWidth, setEditMinWidth] = useState<number | undefined>();\n const editInputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (!isEditing) {\n setEditValue(label);\n }\n }, [isEditing, label]);\n\n useEffect(() => {\n if (!isEditing) {\n setEditMinWidth(undefined);\n return;\n }\n\n const input = editInputRef.current;\n if (input == null) {\n return;\n }\n\n setEditMinWidth(input.offsetWidth);\n input.focus();\n input.select();\n }, [isEditing]);\n\n const commitEdit = () => {\n if (!isEditing) {\n return;\n }\n\n setIsEditing(false);\n if (editValue !== label) {\n onEdit?.(editValue);\n }\n };\n\n const inlineActionCount = getInlineActionCount({ onEdit, showCopyAction, copyValue });\n const inlineActions = !isEditing && inlineActionCount > 0 && (\n <InlineActions spacing={ACTION_BUTTON_GAP} align='center'>\n {onEdit != null && (\n <IconButton\n type='button'\n size='sm'\n aria-label={`Edit ${label}`}\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n setIsEditing(true);\n }}\n >\n <EditIcon />\n </IconButton>\n )}\n {showCopyAction && copyValue != null && (\n <BreadcrumbCopyButton\n copyValue={copyValue}\n copyTooltipLabel={copyTooltipLabel}\n copiedTooltipLabel={copiedTooltipLabel}\n showCopyValueInTooltip={showCopyValueInTooltip}\n onCopy={onCopy}\n />\n )}\n </InlineActions>\n );\n\n if (isEditing) {\n return (\n <CrumbRow spacing={LABEL_ACTION_GAP}>\n <InlineEditInput\n ref={editInputRef}\n $size={size}\n $current={current}\n $editMinWidth={editMinWidth}\n size='md'\n aria-label={`Edit ${label}`}\n maxLength={editMaxLength}\n value={editValue}\n onChange={(event: ChangeEvent<HTMLInputElement>) => setEditValue(event.target.value)}\n onBlur={commitEdit}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n commitEdit();\n }\n if (event.key === 'Escape') {\n setEditValue(label);\n setIsEditing(false);\n }\n }}\n />\n </CrumbRow>\n );\n }\n\n if (current) {\n return (\n <CrumbRow spacing={LABEL_ACTION_GAP}>\n <CurrentLabel\n $size={size}\n size={size === 'lg' ? 'lg' : 'md'}\n weight='bold'\n color='primary'\n as={headingAs}\n >\n <TruncatedBreadcrumbLabel label={label} />\n </CurrentLabel>\n {inlineActions}\n </CrumbRow>\n );\n }\n\n if (href == null && onClick != null) {\n return (\n <CrumbRow spacing={LABEL_ACTION_GAP}>\n <AncestorNavButton type='button' onClick={onClick} $size={size}>\n <TruncatedBreadcrumbLabel label={label} />\n </AncestorNavButton>\n {inlineActions}\n </CrumbRow>\n );\n }\n\n return (\n <CrumbRow spacing={LABEL_ACTION_GAP}>\n <AncestorNavLink to={href ?? ''} $size={size}>\n <TruncatedBreadcrumbLabel label={label} />\n </AncestorNavLink>\n {inlineActions}\n </CrumbRow>\n );\n};\n\nexport default Breadcrumb;\n","import styled from 'styled-components';\n\nimport { Spacing } from '@persona/design-tokens';\n\nimport { intersperse } from '#src/lib/intersperse';\nimport { semanticColor } from '#src/lib/semanticColor';\nimport { paragraphMixins } from '#src/mixins/text';\n\nimport Breadcrumb, {\n type BreadcrumbHeadingAs,\n type BreadcrumbProps,\n type BreadcrumbSize,\n getInlineActionCount,\n} from './Breadcrumb';\n\nexport type BreadcrumbsItemProps = Omit<BreadcrumbProps, 'size' | 'current' | 'headingAs'>;\n\nexport type BreadcrumbsProps = {\n items: BreadcrumbsItemProps[];\n size?: BreadcrumbSize;\n /**\n * Overrides the heading element rendered for the current crumb. Defaults to `h1`; use `h2` or\n * lower when the page already has an `h1`.\n */\n headingAs?: BreadcrumbHeadingAs;\n 'aria-label'?: string;\n className?: string;\n};\n\nconst ANCESTOR_MIN_CHARS = 8;\nconst CURRENT_MIN_CHARS = 12;\n\nconst BreadcrumbNav = styled.nav`\n min-width: 0;\n`;\n\nconst BreadcrumbList = styled.ol`\n max-width: 100%;\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n list-style: none;\n margin: 0;\n padding: 0;\n min-width: 0;\n`;\n\nconst BreadcrumbListItem = styled.li<{\n $size: BreadcrumbSize;\n $isCurrent: boolean;\n $isShort: boolean;\n $minWidth?: string;\n}>`\n display: flex;\n align-items: center;\n ${({ $size }) => ($size === 'lg' ? paragraphMixins.lg : paragraphMixins.md)};\n ${({ $isShort, $isCurrent }) =>\n $isShort ? 'flex-shrink: 0;' : $isCurrent ? 'flex: 0 1 auto;' : 'flex: 0 100000 auto;'}\n ${({ $minWidth }) => $minWidth != null && `min-width: ${$minWidth};`}\n\n &:has(input) {\n flex-shrink: 1;\n }\n`;\n\nconst SeparatorListItem = styled.li`\n display: flex;\n align-items: center;\n flex-shrink: 0;\n`;\n\nconst Separator = styled.span<{ $size: BreadcrumbSize }>`\n padding: 0 ${Spacing[2]};\n color: ${({ theme }) => semanticColor(theme, 'FgSecondary', theme.color.text.tertiary)};\n user-select: none;\n ${({ $size }) => ($size === 'lg' ? paragraphMixins.lg : paragraphMixins.md)};\n`;\n\nexport const Breadcrumbs = ({\n items,\n size = 'md',\n headingAs = 'h1',\n 'aria-label': ariaLabel = 'Breadcrumbs',\n className,\n}: BreadcrumbsProps) => {\n if (items.length === 0) {\n return null;\n }\n\n const crumbNodes = items.map((item, index) => {\n const isCurrent = index === items.length - 1;\n const minChars = isCurrent ? CURRENT_MIN_CHARS : ANCESTOR_MIN_CHARS;\n const actionCount = getInlineActionCount(item);\n const actionsWidth =\n actionCount === 0\n ? 0\n : Number.parseFloat(Spacing[2]) +\n actionCount * 24 +\n (actionCount - 1) * Number.parseFloat(Spacing[1]);\n\n return (\n <BreadcrumbListItem\n key={`${item.label}-${index}`}\n aria-current={isCurrent ? 'page' : undefined}\n $size={size}\n $isCurrent={isCurrent}\n $isShort={item.label.length <= minChars}\n $minWidth={\n item.label.length > minChars ? `calc(${minChars}ch + ${actionsWidth}px)` : undefined\n }\n >\n <Breadcrumb {...item} size={size} current={isCurrent} headingAs={headingAs} />\n </BreadcrumbListItem>\n );\n });\n\n const listItems = intersperse(crumbNodes, (separatorIndex: number) => (\n <SeparatorListItem key={`separator-${separatorIndex}`} aria-hidden='true'>\n <Separator $size={size}>/</Separator>\n </SeparatorListItem>\n ));\n\n return (\n <BreadcrumbNav aria-label={ariaLabel} className={className}>\n <BreadcrumbList>{listItems}</BreadcrumbList>\n </BreadcrumbNav>\n );\n};\n\nexport default Breadcrumbs;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAuBA,MAAM,qBAAqB;AAC3B,MAAM,uBAAuB;AAC7B,MAAM,0BAA0B;AAChC,MAAM,iCAAiC;AACvC,MAAM,yCAAyC;AAiC/C,MAAM,mBAAmB,QAAQ;AACjC,MAAM,oBAAoB,QAAQ;AAElC,MAAa,wBAAwB,EACnC,QACA,gBACA,gBAEA,OAAO,UAAU,KAAK,IAAI,kBAAkB,aAAa,OAAO,IAAI;AAEtE,MAAM,WAAW,OAAO,OAAO;;;;AAK/B,MAAM,gBAAgB,OAAO,OAAO;;;AAIpC,MAAM,kBAAkB,OAAO,IAAI;;;AAInC,MAAM,4BAA4B,EAAE,YAClC,oBAAC,0BAAD;CAA0B,cAAc,EAAE,UAAU,SAAS;WAC3D,oBAAC,iBAAD,EAAA,UAAkB,OAAwB,CAAA;CACjB,CAAA;AAG7B,MAAM,qBAAqB,SAAyB,GAAG;;;;iBAItC,EAAE,YAAY,MAAM,QAAQ,OAAO,GAAG;IAEnD,SAAS,OACL,GAAG;sBACW,EAAE,YAAY,M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B,OACA,OAAO,MACP,YAAY,MACZ,cAAc,YAAY,eAC1B,gBACsB;AACtB,KAAI,MAAM,WAAW,EACnB,QAAO;AAoCT,QACE,oBAAC,eAAD;EAAe,cAAY;EAAsB;YAC/C,oBAAC,gBAAD,EAAA,UARc,YA3BC,MAAM,KAAK,MAAM,UAAU;GAC5C,MAAM,YAAY,UAAU,MAAM,SAAS;GAC3C,MAAM,WAAW,YAAY,oBAAoB;GACjD,MAAM,cAAc,qBAAqB,KAAK;GAC9C,MAAM,eACJ,gBAAgB,IACZ,IACA,OAAO,WAAW,QAAQ,GAAG,GAC7B,cAAc,MACb,cAAc,KAAK,OAAO,WAAW,QAAQ,GAAG;AAEvD,UACE,oBAAC,oBAAD;IAEE,gBAAc,YAAY,SAAS,KAAA;IACnC,OAAO;IACP,YAAY;IACZ,UAAU,KAAK,MAAM,UAAU;IAC/B,WACE,KAAK,MAAM,SAAS,WAAW,QAAQ,SAAS,OAAO,aAAa,OAAO,KAAA;cAG7E,oBAAC,YAAD;KAAY,GAAI;KAAY;KAAM,SAAS;KAAsB;KAAa,CAAA;IAC3D,EAVd,GAAG,KAAK,MAAM,GAAG,QAUH;IAIe,GAAG,mBACzC,oBAAC,mBAAD;GAAuD,eAAY;aACjE,oBAAC,WAAD;IAAW,OAAO;cAAM;IAAa,CAAA;GACnB,EAFI,aAAa,iBAEjB,CAKQ,EAAkB,CAAA;EAC9B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Card-DuQHyroh.mjs","names":["Title","Spacer"],"sources":["../src/components/Card/Header/Header.tsx","../src/components/Card/Card.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, ReactNode } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Color, Spacing } from '@persona/design-tokens';\nimport { semanticColor, semanticOnly } from 'design-system/lib/semanticColor';\nimport { headingMixins, paragraphMixins } from 'design-system/mixins/text';\n\nexport interface HeaderProps {\n children: ReactNode;\n subtitle?: ReactNode;\n variant?: 'title' | 'section';\n actions?: ReactNode;\n $matchCardV2?: boolean;\n}\n\nexport const HeaderContainer = styled.div<Pick<HeaderProps, 'variant' | '$matchCardV2'>>`\n ${paragraphMixins.md};\n display: flex;\n align-items: center;\n justify-content: space-between;\n &:not(:only-child) {\n margin: 0px 0px ${Spacing[4]} 0px;\n ${({ $matchCardV2 }) =>\n $matchCardV2 &&\n css`\n margin-bottom: ${Spacing[1]};\n `}\n }\n ${({ variant }) =>\n variant === 'section' &&\n css`\n border-bottom: 1px solid ${({ theme }) => semanticColor(theme, 'BorderDivider', theme.color.border.primary)};\n `}\n`;\n\nexport const TitleContainer = styled.div`\n display: flex;\n align-items: center;\n gap: ${Spacing[2]};\n`;\n\nexport const Title = styled.h3<Pick<HeaderProps, 'variant' | '$matchCardV2'>>`\n display: flex;\n align-items: center;\n margin: 0px;\n gap: ${Spacing[2]};\n ${semanticOnly((tokens) => `color: ${tokens.FgPrimary};`)}\n ${({ variant }) => {\n switch (variant) {\n case 'section':\n return paragraphMixins.lgBold;\n case 'title':\n default:\n return headingMixins.sm;\n }\n }}\n ${({ $matchCardV2 }) =>\n $matchCardV2 &&\n css`\n ${headingMixins.xsm};\n `}\n`;\n\nexport const ActionsContainer = styled.div`\n color: ${({ theme }) => semanticColor(theme, 'FgSecondary', theme.color.text.secondary)};\n display: flex;\n align-items: center;\n gap: ${Spacing[2]};\n`;\n\nconst FullDivider = styled.hr`\n border-top: 1px solid ${({ theme }) => semanticColor(theme, 'BorderSubtle', Color.BorderDivider)};\n margin: 0;\n\n /* Use negative margin to bleed the divider out of the grid. */\n margin-left: -${Spacing[5]};\n margin-right: -${Spacing[5]};\n`;\n\nconst Header = ({\n children,\n variant,\n actions,\n subtitle,\n $matchCardV2,\n ...elemProps\n}: HeaderProps & ComponentPropsWithoutRef<'div'>) => {\n return (\n <>\n <HeaderContainer variant={variant} {...elemProps} $matchCardV2={$matchCardV2}>\n <TitleContainer>\n <Title variant={variant} $matchCardV2={$matchCardV2}>\n {children}\n </Title>\n {subtitle}\n </TitleContainer>\n <ActionsContainer>{actions}</ActionsContainer>\n </HeaderContainer>\n {$matchCardV2 && <FullDivider />}\n </>\n );\n};\n\nexport const Root = Header;\n\nexport default Header;\n","import type {\n ComponentPropsWithoutRef,\n FC,\n PropsWithChildren,\n ReactElement,\n ReactNode,\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Spacing } from '@persona/design-tokens';\nimport { ChevronDownIcon, ChevronUpIcon } from '@persona/icons';\nimport Header, { type HeaderProps } from 'design-system/components/Card/Header';\nimport Spacer from 'design-system/components/Spacer';\nimport { Paragraph } from 'design-system/components/Text';\nimport { semanticColor } from 'design-system/lib/semanticColor';\nimport useToggle from 'design-system/lib/useToggle';\nimport { BASE } from 'design-system/variables/spacing';\n\nexport interface CardProps {\n elevated?: boolean;\n $matchCardV2?: boolean;\n}\n\n/**\n * @deprecated Use CardV2 instead\n */\nconst Card = styled('div')<CardProps>`\n border-radius: ${({ theme }) => {\n return theme.card.borderRadius;\n }};\n display: flex;\n flex-direction: column;\n margin-bottom: ${Spacing[4]};\n background-color: ${({ theme }) => semanticColor(theme, 'SurfacePrimary', theme.color.background.primary)};\n font-family: ${({ theme }) => theme.text.fontFamily.base};\n ${({ elevated }) =>\n elevated &&\n css`\n box-shadow: 0px 0px 14px 2px rgba(0, 0, 0, 0.12);\n `}\n\n ${({ $matchCardV2 }) =>\n $matchCardV2 &&\n css`\n margin-bottom: 0;\n `}\n`;\n\n/**\n * To be used within cards. Provides padding and basic layout. Should not be\n * used if card's contents are edge-to-edge with no padding.\n */\nconst Body = styled('section')<{ gap?: number; padding?: Spacing; $matchCardV2?: boolean }>`\n margin: 0;\n padding: ${({ padding }) => padding ?? Spacing[5]};\n display: grid;\n grid-auto-flow: row;\n grid-gap: ${({ gap }) => (gap != null ? gap : BASE)}px;\n /**\n * Prevent grid blowout\n * https://css-tricks.com/preventing-a-grid-blowout/\n */\n grid-template-columns: minmax(0, 1fr);\n\n ${({ $matchCardV2 }) =>\n $matchCardV2 &&\n css`\n padding: ${Spacing[4]} ${Spacing[5]};\n grid-gap: ${Spacing[3]};\n `}\n`;\n\nconst IconContainer = styled('div')`\n margin-right: ${Spacing[3]};\n display: flex;\n align-items: center;\n\n > svg {\n height: 24px;\n width: 24px;\n }\n`;\n\nconst ImageWrapper = styled('div')<{ height: number }>`\n width: 100%;\n overflow: hidden;\n border-radius: ${({ theme }) => theme.card.borderRadius} ${({ theme }) => theme.card.borderRadius}\n 0px 0px;\n\n ${({ height }) => {\n return css`\n height: ${height}px;\n `;\n }};\n\n > img,\n svg {\n width: 100%;\n border-radius: ${({ theme }) => theme.card.borderRadius}\n ${({ theme }) => theme.card.borderRadius} 0px 0px;\n }\n`;\n\ninterface TitleBaseProps {\n icon?: ReactElement;\n}\n\ninterface TitleProps\n extends\n TitleBaseProps,\n Pick<HeaderProps, 'actions' | 'subtitle'>,\n Omit<ComponentPropsWithoutRef<'h3'>, 'color' | 'size'> {\n $matchCardV2?: boolean;\n}\n\n/**\n * Label to be used within cards. Note that some cards lead with a Title while\n * some others lead with a Subtitle (see below).\n */\nconst Title: FC<TitleProps> = ({ icon, children, ...elemProps }) => (\n <Header variant='title' {...elemProps}>\n {icon != null && <IconContainer>{icon}</IconContainer>}\n {children}\n </Header>\n);\n\n/**\n * Smaller label to be used within cards.\n */\nconst Subtitle = styled(Paragraph).attrs(() => ({ size: 'md' }))`\n color: ${({ theme }) => semanticColor(theme, 'FgSecondary', theme.color.text.tertiary)};\n`;\n\nexport interface SectionProps\n extends\n Pick<HeaderProps, 'subtitle' | 'actions'>,\n Omit<ComponentPropsWithoutRef<'h3'>, 'color' | 'size'> {}\n\n/**\n * Header for section headers within a Card\n */\nconst SectionHeader = ({ children, ...elemProps }: SectionProps) => (\n <Header variant='section' {...elemProps}>\n {children}\n </Header>\n);\n\n/**\n * Wrapper for a full-width image to be used at the top of a card.\n */\n\ninterface ImageProps {\n height: number;\n children: ReactNode;\n}\n\nconst Image: FC<ImageProps> = ({ height, children, ...elemProps }) => (\n <ImageWrapper {...elemProps} height={height}>\n {children}\n </ImageWrapper>\n);\n\ninterface CollapsibleSectionProps {\n id?: string;\n defaultExpanded?: boolean;\n title: ReactNode;\n}\n\nconst CollapsibleSection: FC<PropsWithChildren<CollapsibleSectionProps>> = ({\n id,\n defaultExpanded,\n title,\n children,\n}) => {\n const [isOpen, { toggle }] = useToggle(defaultExpanded);\n\n return (\n <section>\n <div id={id} onClick={toggle}>\n <Header variant='section'>\n <HeaderIcon>\n {isOpen ? <ChevronUpIcon /> : <ChevronDownIcon />}\n <Spacer width={0.5} height={0} />\n </HeaderIcon>\n {title}\n </Header>\n </div>\n <div>\n {isOpen && (\n <>\n <Spacer height={1} />\n {children}\n </>\n )}\n </div>\n <Spacer height={1} />\n </section>\n );\n};\n\nconst HeaderIcon = styled.div`\n display: flex;\n`;\n\nexport default Object.assign(Card, {\n Title,\n SectionHeader,\n Subtitle,\n Body,\n Image,\n CollapsibleSection,\n}) as typeof Card & {\n Title: typeof Title;\n SectionHeader: typeof SectionHeader;\n Subtitle: typeof Subtitle;\n Body: typeof Body;\n Image: typeof Image;\n CollapsibleSection: typeof CollapsibleSection;\n};\n"],"mappings":";;;;;;;;;;;AAeA,MAAa,kBAAkB,OAAO,GAAkD;IACpF,gBAAgB,GAAG;;;;;sBAKD,QAAQ,GAAG;OAC1B,EAAE,mBACH,gBACA,GAAG;yBACgB,QAAQ,GAAG;QAC5B;;KAEH,EAAE,cACH,YAAY,aACZ,GAAG;kCAC2B,EAAE,YAAY,cAAc,OAAO,iBAAiB,MAAM,MAAM,OAAO,QAAQ,CAAC;MAC5G;;AAGN,MAAa,iBAAiB,OAAO,GAAG;;;SAG/B,QAAQ,GAAG;;AAGpB,MAAaA,UAAQ,OAAO,EAAiD;;;;SAIpE,QAAQ,GAAG;IAChB,cAAc,WAAW,UAAU,OAAO,UAAU,GAAG,CAAC;KACvD,EAAE,cAAc;AACjB,SAAQ,SAAR;EACE,KAAK,UACH,QAAO,gBAAgB;EAE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,CAAA,EACZ,MACM;;GACL,CAAA;EACN,oBAAC,OAAD,EAAA,UACG,UACC,qBAAA,UAAA,EAAA,UAAA,CACE,oBAACA,gBAAD,EAAQ,QAAQ,GAAK,CAAA,EACpB,SACA,EAAA,CAAA,EAED,CAAA;EACN,oBAACA,gBAAD,EAAQ,QAAQ,GAAK,CAAA;EACb,EAAA,CAAA;;AAId,MAAM,aAAa,OAAO,GAAG;;;AAI7B,IAAA,eAAe,OAAO,OAAO,MAAM;CACjC;CACA;CACA;CACA;CACA;CACA;CACD,CAAC"}
1
+ {"version":3,"file":"Card-DuQHyroh.mjs","names":["Title","Spacer"],"sources":["../src/components/Card/Header/Header.tsx","../src/components/Card/Card.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, ReactNode } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Color, Spacing } from '@persona/design-tokens';\n\nimport { semanticColor, semanticOnly } from '#src/lib/semanticColor';\nimport { headingMixins, paragraphMixins } from '#src/mixins/text';\n\nexport interface HeaderProps {\n children: ReactNode;\n subtitle?: ReactNode;\n variant?: 'title' | 'section';\n actions?: ReactNode;\n $matchCardV2?: boolean;\n}\n\nexport const HeaderContainer = styled.div<Pick<HeaderProps, 'variant' | '$matchCardV2'>>`\n ${paragraphMixins.md};\n display: flex;\n align-items: center;\n justify-content: space-between;\n &:not(:only-child) {\n margin: 0px 0px ${Spacing[4]} 0px;\n ${({ $matchCardV2 }) =>\n $matchCardV2 &&\n css`\n margin-bottom: ${Spacing[1]};\n `}\n }\n ${({ variant }) =>\n variant === 'section' &&\n css`\n border-bottom: 1px solid ${({ theme }) => semanticColor(theme, 'BorderDivider', theme.color.border.primary)};\n `}\n`;\n\nexport const TitleContainer = styled.div`\n display: flex;\n align-items: center;\n gap: ${Spacing[2]};\n`;\n\nexport const Title = styled.h3<Pick<HeaderProps, 'variant' | '$matchCardV2'>>`\n display: flex;\n align-items: center;\n margin: 0px;\n gap: ${Spacing[2]};\n ${semanticOnly((tokens) => `color: ${tokens.FgPrimary};`)}\n ${({ variant }) => {\n switch (variant) {\n case 'section':\n return paragraphMixins.lgBold;\n case 'title':\n default:\n return headingMixins.sm;\n }\n }}\n ${({ $matchCardV2 }) =>\n $matchCardV2 &&\n css`\n ${headingMixins.xsm};\n `}\n`;\n\nexport const ActionsContainer = styled.div`\n color: ${({ theme }) => semanticColor(theme, 'FgSecondary', theme.color.text.secondary)};\n display: flex;\n align-items: center;\n gap: ${Spacing[2]};\n`;\n\nconst FullDivider = styled.hr`\n border-top: 1px solid ${({ theme }) => semanticColor(theme, 'BorderSubtle', Color.BorderDivider)};\n margin: 0;\n\n /* Use negative margin to bleed the divider out of the grid. */\n margin-left: -${Spacing[5]};\n margin-right: -${Spacing[5]};\n`;\n\nconst Header = ({\n children,\n variant,\n actions,\n subtitle,\n $matchCardV2,\n ...elemProps\n}: HeaderProps & ComponentPropsWithoutRef<'div'>) => {\n return (\n <>\n <HeaderContainer variant={variant} {...elemProps} $matchCardV2={$matchCardV2}>\n <TitleContainer>\n <Title variant={variant} $matchCardV2={$matchCardV2}>\n {children}\n </Title>\n {subtitle}\n </TitleContainer>\n <ActionsContainer>{actions}</ActionsContainer>\n </HeaderContainer>\n {$matchCardV2 && <FullDivider />}\n </>\n );\n};\n\nexport const Root = Header;\n\nexport default Header;\n","import type {\n ComponentPropsWithoutRef,\n FC,\n PropsWithChildren,\n ReactElement,\n ReactNode,\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Spacing } from '@persona/design-tokens';\nimport { ChevronDownIcon, ChevronUpIcon } from '@persona/icons';\n\nimport Header, { type HeaderProps } from '#src/components/Card/Header';\nimport Spacer from '#src/components/Spacer';\nimport { Paragraph } from '#src/components/Text';\nimport { semanticColor } from '#src/lib/semanticColor';\nimport useToggle from '#src/lib/useToggle';\nimport { BASE } from '#src/variables/spacing';\n\nexport interface CardProps {\n elevated?: boolean;\n $matchCardV2?: boolean;\n}\n\n/**\n * @deprecated Use CardV2 instead\n */\nconst Card = styled('div')<CardProps>`\n border-radius: ${({ theme }) => {\n return theme.card.borderRadius;\n }};\n display: flex;\n flex-direction: column;\n margin-bottom: ${Spacing[4]};\n background-color: ${({ theme }) => semanticColor(theme, 'SurfacePrimary', theme.color.background.primary)};\n font-family: ${({ theme }) => theme.text.fontFamily.base};\n ${({ elevated }) =>\n elevated &&\n css`\n box-shadow: 0px 0px 14px 2px rgba(0, 0, 0, 0.12);\n `}\n\n ${({ $matchCardV2 }) =>\n $matchCardV2 &&\n css`\n margin-bottom: 0;\n `}\n`;\n\n/**\n * To be used within cards. Provides padding and basic layout. Should not be\n * used if card's contents are edge-to-edge with no padding.\n */\nconst Body = styled('section')<{ gap?: number; padding?: Spacing; $matchCardV2?: boolean }>`\n margin: 0;\n padding: ${({ padding }) => padding ?? Spacing[5]};\n display: grid;\n grid-auto-flow: row;\n grid-gap: ${({ gap }) => (gap != null ? gap : BASE)}px;\n /**\n * Prevent grid blowout\n * https://css-tricks.com/preventing-a-grid-blowout/\n */\n grid-template-columns: minmax(0, 1fr);\n\n ${({ $matchCardV2 }) =>\n $matchCardV2 &&\n css`\n padding: ${Spacing[4]} ${Spacing[5]};\n grid-gap: ${Spacing[3]};\n `}\n`;\n\nconst IconContainer = styled('div')`\n margin-right: ${Spacing[3]};\n display: flex;\n align-items: center;\n\n > svg {\n height: 24px;\n width: 24px;\n }\n`;\n\nconst ImageWrapper = styled('div')<{ height: number }>`\n width: 100%;\n overflow: hidden;\n border-radius: ${({ theme }) => theme.card.borderRadius} ${({ theme }) => theme.card.borderRadius}\n 0px 0px;\n\n ${({ height }) => {\n return css`\n height: ${height}px;\n `;\n }};\n\n > img,\n svg {\n width: 100%;\n border-radius: ${({ theme }) => theme.card.borderRadius}\n ${({ theme }) => theme.card.borderRadius} 0px 0px;\n }\n`;\n\ninterface TitleBaseProps {\n icon?: ReactElement;\n}\n\ninterface TitleProps\n extends\n TitleBaseProps,\n Pick<HeaderProps, 'actions' | 'subtitle'>,\n Omit<ComponentPropsWithoutRef<'h3'>, 'color' | 'size'> {\n $matchCardV2?: boolean;\n}\n\n/**\n * Label to be used within cards. Note that some cards lead with a Title while\n * some others lead with a Subtitle (see below).\n */\nconst Title: FC<TitleProps> = ({ icon, children, ...elemProps }) => (\n <Header variant='title' {...elemProps}>\n {icon != null && <IconContainer>{icon}</IconContainer>}\n {children}\n </Header>\n);\n\n/**\n * Smaller label to be used within cards.\n */\nconst Subtitle = styled(Paragraph).attrs(() => ({ size: 'md' }))`\n color: ${({ theme }) => semanticColor(theme, 'FgSecondary', theme.color.text.tertiary)};\n`;\n\nexport interface SectionProps\n extends\n Pick<HeaderProps, 'subtitle' | 'actions'>,\n Omit<ComponentPropsWithoutRef<'h3'>, 'color' | 'size'> {}\n\n/**\n * Header for section headers within a Card\n */\nconst SectionHeader = ({ children, ...elemProps }: SectionProps) => (\n <Header variant='section' {...elemProps}>\n {children}\n </Header>\n);\n\n/**\n * Wrapper for a full-width image to be used at the top of a card.\n */\n\ninterface ImageProps {\n height: number;\n children: ReactNode;\n}\n\nconst Image: FC<ImageProps> = ({ height, children, ...elemProps }) => (\n <ImageWrapper {...elemProps} height={height}>\n {children}\n </ImageWrapper>\n);\n\ninterface CollapsibleSectionProps {\n id?: string;\n defaultExpanded?: boolean;\n title: ReactNode;\n}\n\nconst CollapsibleSection: FC<PropsWithChildren<CollapsibleSectionProps>> = ({\n id,\n defaultExpanded,\n title,\n children,\n}) => {\n const [isOpen, { toggle }] = useToggle(defaultExpanded);\n\n return (\n <section>\n <div id={id} onClick={toggle}>\n <Header variant='section'>\n <HeaderIcon>\n {isOpen ? <ChevronUpIcon /> : <ChevronDownIcon />}\n <Spacer width={0.5} height={0} />\n </HeaderIcon>\n {title}\n </Header>\n </div>\n <div>\n {isOpen && (\n <>\n <Spacer height={1} />\n {children}\n </>\n )}\n </div>\n <Spacer height={1} />\n </section>\n );\n};\n\nconst HeaderIcon = styled.div`\n display: flex;\n`;\n\nexport default Object.assign(Card, {\n Title,\n SectionHeader,\n Subtitle,\n Body,\n Image,\n CollapsibleSection,\n}) as typeof Card & {\n Title: typeof Title;\n SectionHeader: typeof SectionHeader;\n Subtitle: typeof Subtitle;\n Body: typeof Body;\n Image: typeof Image;\n CollapsibleSection: typeof CollapsibleSection;\n};\n"],"mappings":";;;;;;;;;;;AAgBA,MAAa,kBAAkB,OAAO,GAAkD;IACpF,gBAAgB,GAAG;;;;;sBAKD,QAAQ,GAAG;OAC1B,EAAE,mBACH,gBACA,GAAG;yBACgB,QAAQ,GAAG;QAC5B;;KAEH,EAAE,cACH,YAAY,aACZ,GAAG;kCAC2B,EAAE,YAAY,cAAc,OAAO,iBAAiB,MAAM,MAAM,OAAO,QAAQ,CAAC;MAC5G;;AAGN,MAAa,iBAAiB,OAAO,GAAG;;;SAG/B,QAAQ,GAAG;;AAGpB,MAAaA,UAAQ,OAAO,EAAiD;;;;SAIpE,QAAQ,GAAG;IAChB,cAAc,WAAW,UAAU,OAAO,UAAU,GAAG,CAAC;KACvD,EAAE,cAAc;AACjB,SAAQ,SAAR;EACE,KAAK,UACH,QAAO,gBAAgB;EAEzB,QACE,QAAO,cAAc;;EAEzB;KACC,EAAE,mBACH,gBACA,GAAG;QACC,cAAc,IAAI;MACpB;;AAGN,MAAa,mBAAmB,OAAO,GAAG;YAC9B,EAAE,YAAY,cAAc,OAAO,eAAe,MAAM,MAAM,KAAK,UAAU,CAAC;;;SAGjF,QAAQ,GAAG;;AAGpB,MAAM,cAAc,OAAO,EAAE;2BACF,EAAE,YAAY,cAAc,OAAO,gBAAgB,MAAM,cAAc,CAAC;;;;kBAIjF,QAAQ,GAAG;mBACV,QAAQ,GAAG;;AAG9B,MAAM,UAAU,EACd,UACA,SACA,SACA,UACA,cACA,GAAG,gBACgD;AACnD,QACE,qBAAA,UAAA,EAAA,UAAA,CACE,qBAAC,iBAAD;EAA0B;EAAS,GAAI;EAAyB;YAAhE,CACE,qBAAC,gBAAD,EAAA,UAAA,CACE,oBAACA,SAAD;GAAgB;GAAuB;GACpC;GAC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M,EAAE;YACpD,EAAE,YAAY,cAAc,OAAO,eAAe,MAAM,MAAM,KAAK,SAAS,CAAC;;;;;AAWzF,MAAM,iBAAiB,EAAE,UAAU,GAAG,gBACpC,oBAAC,QAAD;CAAQ,SAAQ;CAAU,GAAI;CAC3B;CACM,CAAA;AAYX,MAAM,SAAyB,EAAE,QAAQ,UAAU,GAAG,gBACpD,oBAAC,cAAD;CAAc,GAAI;CAAmB;CAClC;CACY,CAAA;AASjB,MAAM,sBAAsE,EAC1E,IACA,iBACA,OACA,eACI;CACJ,MAAM,CAAC,QAAQ,EAAE,YAAY,UAAU,gBAAgB;AAEvD,QACE,qBAAC,WAAD,EAAA,UAAA;EACE,oBAAC,OAAD;GAAS;GAAI,SAAS;aACpB,qBAAC,QAAD;IAAQ,SAAQ;cAAhB,CACE,qBAAC,YAAD,EAAA,UAAA,CACG,SAAS,oBAAC,eAAD,EAAiB,CAAA,GAAG,oBAAC,iBAAD,EAAmB,CAAA,EACjD,oBAACC,gBAAD;KAAQ,OAAO;KAAK,QAAQ;KAAK,CAAA,CACtB,EAAA,CAAA,EACZ,MACM;;GACL,CAAA;EACN,oBAAC,OAAD,EAAA,UACG,UACC,qBAAA,UAAA,EAAA,UAAA,CACE,oBAACA,gBAAD,EAAQ,QAAQ,GAAK,CAAA,EACpB,SACA,EAAA,CAAA,EAED,CAAA;EACN,oBAACA,gBAAD,EAAQ,QAAQ,GAAK,CAAA;EACb,EAAA,CAAA;;AAId,MAAM,aAAa,OAAO,GAAG;;;AAI7B,IAAA,eAAe,OAAO,OAAO,MAAM;CACjC;CACA;CACA;CACA;CACA;CACA;CACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CardV2-BRJbRSts.mjs","names":["CardLoadingShimmer","Heading","Button","DropdownMenu"],"sources":["../src/components/CardV2/SectionHeading.tsx","../src/components/CardV2/Section.tsx","../src/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 { semanticColor } from 'design-system/lib/semanticColor';\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\n/**\n * Distance from the top of a card to the underside of an expanded top-section heading: the\n * `Spacing[4]` padding above and below a 24px title line, plus the divider. Sticky content inside\n * the card pins here so the heading's divider stays the only line between them.\n */\nexport const CARD_HEADING_STICKY_OFFSET = `calc(${Spacing[9]} + 1px)`;\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 ${({ theme }) => semanticColor(theme, 'BorderSubtle', 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 { semanticColor } from 'design-system/lib/semanticColor';\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 ${({ theme }) => semanticColor(theme, 'BorderSubtle', 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 }) => semanticColor(theme, 'SurfacePrimary', 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';\nimport { semanticColor } from 'design-system/lib/semanticColor';\nimport { semanticScrollbar } from 'design-system/mixins/scrollbar';\n\nconst CardContainer = styled.div`\n border-radius: ${({ theme }) => theme.card.borderRadius};\n background-color: ${({ theme }) => semanticColor(theme, 'SurfacePrimary', 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 ${semanticScrollbar}\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 }) => semanticColor(theme, 'SurfacePrimary', 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 ${({ theme }) => semanticColor(theme, 'BorderSubtle', 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 = '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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAa,6BAA6B,QAAQ,QAAQ,GAAG;AAE7D,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;;;AAIxE,MAAM,eAAe,OAAO,mBAAmB;;;;cAIjC,mBAAm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AAc,WAAW,uBAAkC,CAAA;EAC/D,CAAA;CAGZ,MAAM,UACJ,oBAAC,SAAD;EAAS,cAAA;EAAqB;EAAQ,GAAI;EACvC;EACO,CAAA;AAGZ,QACE,oBAAC,eAAD;EACE,UACE,YACE,gBAEA,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
+ {"version":3,"file":"CardV2-BRJbRSts.mjs","names":["CardLoadingShimmer","Heading","Button","DropdownMenu"],"sources":["../src/components/CardV2/SectionHeading.tsx","../src/components/CardV2/Section.tsx","../src/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';\n\nimport Button, { IconButton } from '#src/components/Button';\nimport DropdownButton from '#src/components/DropdownButton';\nimport DropdownMenu from '#src/components/DropdownMenu';\nimport { LoadingShimmer } from '#src/components/LoadingShimmer';\nimport { HStack } from '#src/components/Stack';\nimport { Heading } from '#src/components/Text';\nimport Tooltip from '#src/components/Tooltip';\nimport { HeadlessAriaButton } from '#src/lib/HeadlessAriaButton';\nimport { semanticColor } from '#src/lib/semanticColor';\nimport { TruncatedText } from '#src/lib/TruncatedText';\nimport { focusStyle } from '#src/mixins/focus';\nimport type { HeadingSize } from '#src/mixins/text';\nimport type { IconAction, MenuAction, TextAction } from '#src/types/Action';\nimport { TransitionDuration } from '#src/variables/transitions';\n\n/**\n * Distance from the top of a card to the underside of an expanded top-section heading: the\n * `Spacing[4]` padding above and below a 24px title line, plus the divider. Sticky content inside\n * the card pins here so the heading's divider stays the only line between them.\n */\nexport const CARD_HEADING_STICKY_OFFSET = `calc(${Spacing[9]} + 1px)`;\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 ${({ theme }) => semanticColor(theme, 'BorderSubtle', 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';\n\nimport { SectionHeading } from '#src/components/CardV2/SectionHeading';\nimport { LoadingShimmer } from '#src/components/LoadingShimmer';\nimport { HStack } from '#src/components/Stack';\nimport { Paragraph } from '#src/components/Text';\nimport { intersperse } from '#src/lib/intersperse';\nimport { semanticColor } from '#src/lib/semanticColor';\nimport { Z_INDICES } from '#src/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 ${({ theme }) => semanticColor(theme, 'BorderSubtle', 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 }) => semanticColor(theme, 'SurfacePrimary', 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';\n\nimport { Section } from '#src/components/CardV2/Section';\nimport { Paragraph } from '#src/components/Text';\nimport ConfigContext from '#src/lib/ConfigContext';\nimport { intersperse } from '#src/lib/intersperse';\nimport { semanticColor } from '#src/lib/semanticColor';\nimport { semanticScrollbar } from '#src/mixins/scrollbar';\n\nconst CardContainer = styled.div`\n border-radius: ${({ theme }) => theme.card.borderRadius};\n background-color: ${({ theme }) => semanticColor(theme, 'SurfacePrimary', 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 ${semanticScrollbar}\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 }) => semanticColor(theme, 'SurfacePrimary', 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 ${({ theme }) => semanticColor(theme, 'BorderSubtle', 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 = '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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAa,6BAA6B,QAAQ,QAAQ,GAAG;AAE7D,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;;;AAIxE,MAAM,eAAe,OAAO,mBAAmB;;;;cAIjC,mBAAmB;;;;sBAIX,mBAAmB;;MAEnC,WAAW;;;AAUjB,MAAM,mBAAmB,OAAO,OAAO;;;KAGlC,EAAE,oBACH,iBACA,GAAG;iBACU,QAAQ,GAAG,GAAG,QAAQ,GAAG;MACpC;KACD,EAAE,eACH,YACA,GAAG;kCAC2B,EAAE,YAAY,cAAc,OAAO,gBAAgB,MAAM,cAAc,CAAC;MACpG;KACD,EAAE,eAAe,YAAY,kBAC9B,iBACA,CAAC,cACD,CAAC,eACD,GAAG;;;;wBAIiB,QAAQ,GAAG;MAC7B;;AAQN,MAAM,gBAAgB,OAAOC,UAAQ;;;;SAI5B,QAAQ,GAAG;;;;KAIf,EAAE,qBAAqB,kBAAkB,mBAAmB;KAC5D,EAAE,oBACH,CAAC,iBAC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iB,CAAA,GAAG,oBAAA,YAAA,EAAA,UAAG,SAAW,CAAA;GAClC,CAAA;EAEJ,CAAA;;AAIpB,IAAA,eAAe,OAAO,OAAO,MAAM;CACjC,SAAS;CACA;CACV,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox-Dr4LMKHV.mjs","names":[],"sources":["../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import { uniqueId } from 'lodash-es';\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 { opacityOf } from 'design-system/lib/color';\nimport {\n isChecked,\n isDisabled,\n isFocusedVisible,\n isHovered,\n isIndeterminate,\n isNotDisabled,\n} from 'design-system/lib/pseudoClass';\nimport { semanticColor, semanticOnly } from 'design-system/lib/semanticColor';\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 ${({ theme }) => semanticColor(theme, 'InputBorderStrong', Color.BorderInputCheckbox)};\n background: ${({ theme }) => semanticColor(theme, 'InputSurfaceDefault', Color.BackgroundInputDefault)};\n\n svg {\n color: ${({ theme }) => semanticColor(theme, 'FgInverseStatic', Color.BorderIconInverse)};\n }\n\n &${isDisabled} {\n cursor: default;\n background: ${({ theme }) =>\n semanticColor(theme, 'InputSurfaceDisabled', Color.BackgroundInputDisabled)};\n border-color: ${({ theme }) =>\n semanticColor(theme, 'InputBorderDisabled', Color.BorderInputDisabled)};\n ${semanticOnly((tokens) => `opacity: ${opacityOf(tokens.Opacity65)};`)}\n }\n\n ${({ checked, theme }) =>\n checked &&\n css`\n border-color: ${semanticColor(theme, 'InputBorderAccent', Color.BackgroundInputActive)};\n background: ${semanticColor(theme, 'InputSurfaceAccent', Color.BackgroundInputActive)};\n\n &${isDisabled} {\n border-color: ${semanticColor(theme, 'InputSurfaceAccentDisabled', Color.BackgroundInputActiveDisabled)};\n background: ${semanticColor(theme, 'InputSurfaceAccentDisabled', 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: ${({ theme }) =>\n semanticColor(theme, 'InputBorderHoverStrong', Color.BorderInputCheckboxHover)};\n ${semanticOnly((tokens) => `background: ${tokens.InputSurfaceHover};`)}\n }\n\n &${isChecked}, &${isIndeterminate} {\n &${isHovered}${isNotDisabled} ~ ${CheckboxBox} {\n background: ${({ theme }) => semanticColor(theme, 'InputSurfaceAccentHover', Color.BackgroundInputActiveHover)};\n border-color: ${({ theme }) => semanticColor(theme, 'InputSurfaceAccentHover', 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: ${({ theme }) => semanticColor(theme, 'FgPrimary', 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: ${semanticColor(theme, 'FgDisabled', 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 // Re-sync on `checked` changes too: a native click clears the input's\n // `indeterminate` property, so it must be re-applied when the prop stays true.\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, checked, 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' : undefined}\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 ))}\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BAAgB,UAAU,KAAA;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
+ {"version":3,"file":"Checkbox-Dr4LMKHV.mjs","names":[],"sources":["../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import { uniqueId } from 'lodash-es';\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';\n\nimport useFormField from '#src/components/FormControl/useFormField';\nimport Stack from '#src/components/Stack/Stack';\nimport Tooltip from '#src/components/Tooltip';\nimport { TextWithDashedUnderline } from '#src/components/Tooltip/TextUnderlineTooltip';\nimport { opacityOf } from '#src/lib/color';\nimport {\n isChecked,\n isDisabled,\n isFocusedVisible,\n isHovered,\n isIndeterminate,\n isNotDisabled,\n} from '#src/lib/pseudoClass';\nimport { semanticColor, semanticOnly } from '#src/lib/semanticColor';\nimport useControlled from '#src/lib/useControlled';\nimport { focusStyle } from '#src/mixins/focus';\nimport { TransitionDuration } from '#src/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 ${({ theme }) => semanticColor(theme, 'InputBorderStrong', Color.BorderInputCheckbox)};\n background: ${({ theme }) => semanticColor(theme, 'InputSurfaceDefault', Color.BackgroundInputDefault)};\n\n svg {\n color: ${({ theme }) => semanticColor(theme, 'FgInverseStatic', Color.BorderIconInverse)};\n }\n\n &${isDisabled} {\n cursor: default;\n background: ${({ theme }) =>\n semanticColor(theme, 'InputSurfaceDisabled', Color.BackgroundInputDisabled)};\n border-color: ${({ theme }) =>\n semanticColor(theme, 'InputBorderDisabled', Color.BorderInputDisabled)};\n ${semanticOnly((tokens) => `opacity: ${opacityOf(tokens.Opacity65)};`)}\n }\n\n ${({ checked, theme }) =>\n checked &&\n css`\n border-color: ${semanticColor(theme, 'InputBorderAccent', Color.BackgroundInputActive)};\n background: ${semanticColor(theme, 'InputSurfaceAccent', Color.BackgroundInputActive)};\n\n &${isDisabled} {\n border-color: ${semanticColor(theme, 'InputSurfaceAccentDisabled', Color.BackgroundInputActiveDisabled)};\n background: ${semanticColor(theme, 'InputSurfaceAccentDisabled', 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: ${({ theme }) =>\n semanticColor(theme, 'InputBorderHoverStrong', Color.BorderInputCheckboxHover)};\n ${semanticOnly((tokens) => `background: ${tokens.InputSurfaceHover};`)}\n }\n\n &${isChecked}, &${isIndeterminate} {\n &${isHovered}${isNotDisabled} ~ ${CheckboxBox} {\n background: ${({ theme }) => semanticColor(theme, 'InputSurfaceAccentHover', Color.BackgroundInputActiveHover)};\n border-color: ${({ theme }) => semanticColor(theme, 'InputSurfaceAccentHover', 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: ${({ theme }) => semanticColor(theme, 'FgPrimary', 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: ${semanticColor(theme, 'FgDisabled', 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 // Re-sync on `checked` changes too: a native click clears the input's\n // `indeterminate` property, so it must be re-applied when the prop stays true.\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, checked, 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' : undefined}\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":";;;;;;;;;;;;;;;;AAkCA,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;;uBAEC,EAAE,YAAY,cAAc,OAAO,qBAAqB,MAAM,oBAAoB,CAAC;iBACzF,EAAE,YAAY,cAAc,OAAO,uBAAuB,MAAM,uBAAuB,CAAC;;;cAG3F,EAAE,YAAY,cAAc,OAAO,mBAAmB,MAAM,kBAAkB,CAAC;;;KAGxF,WAAW;;mBAEG,EAAE,YACf,cAAc,OAAO,wBAAwB,MAAM,wBAAwB,CAAC;qBAC7D,EAAE,YACjB,cAAc,OAAO,uBAAuB,MAAM,oBAAoB,CAAC;MACvE,cAAc,WAAW,YAAY,UAAU,OAAO,UAAU,CAAC,GAAG,CAAC;;;KAGtE,EAAE,SAAS,YACZ,WACA,GAAG;sBACe,cAAc,OAAO,qBAAqB,MAAM,sBAAsB,CAAC;oBACzE,cAAc,OAAO,sBAAsB,MAAM,sBAAsB,CAAC;;SAEnF,WAAW;wBACI,cAAc,OAAO,8BAA8B,MAAM,8BAA8B,CAAC;sBAC1F,cAAc,OAAO,8BAA8B,MAAM,8BAA8B,CAAC;;MAExG;;AAGN,MAAM,gBAA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AAC,WAAD;EACE,WAAU;EACC;EACX,aAAW;EACX,UAAU,MAAM;EAChB,OAAM;EACA;EACN,GAAI;YAPN;GASE,oBAAC,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,KAAA;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,5 +1,5 @@
1
1
  import { n as CheckboxProps } from "./Checkbox-ZywrdT_h.mjs";
2
- import { o as ImplementsFormField } from "./inputFields-CYttsz5M.mjs";
2
+ import { o as ImplementsFormField } from "./inputFields-Dfpxi68z.mjs";
3
3
  import { ReactElement } from "react";
4
4
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
5
5
  import { AriaCheckboxGroupProps } from "react-aria";
@@ -22,4 +22,4 @@ declare const CheckboxGroupField: ({
22
22
  }: CheckboxGroupFieldProps) => _$react_jsx_runtime0.JSX.Element;
23
23
  //#endregion
24
24
  export { CheckboxGroupField as t };
25
- //# sourceMappingURL=CheckboxGroupField-UHpA38U5.d.mts.map
25
+ //# sourceMappingURL=CheckboxGroupField-CjeEoiPa.d.mts.map
@@ -1,2 +1,2 @@
1
- import { t as CheckboxGroupField } from "./CheckboxGroupField-UHpA38U5.mjs";
1
+ import { t as CheckboxGroupField } from "./CheckboxGroupField-CjeEoiPa.mjs";
2
2
  export { CheckboxGroupField as default };