@vector-im/compound-web 8.1.2 → 8.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/dist/components/ActivityMarker/Pill.cjs.map +1 -1
  2. package/dist/components/ActivityMarker/Pill.d.ts.map +1 -1
  3. package/dist/components/ActivityMarker/Pill.js.map +1 -1
  4. package/dist/components/ActivityMarker/Unread.cjs.map +1 -1
  5. package/dist/components/ActivityMarker/Unread.d.ts.map +1 -1
  6. package/dist/components/ActivityMarker/Unread.js.map +1 -1
  7. package/dist/components/ActivityMarker/UnreadCounter.cjs.map +1 -1
  8. package/dist/components/ActivityMarker/UnreadCounter.d.ts.map +1 -1
  9. package/dist/components/ActivityMarker/UnreadCounter.js.map +1 -1
  10. package/dist/components/Alert/Alert.cjs.map +1 -1
  11. package/dist/components/Alert/Alert.d.ts.map +1 -1
  12. package/dist/components/Alert/Alert.js.map +1 -1
  13. package/dist/components/Avatar/Avatar.cjs.map +1 -1
  14. package/dist/components/Avatar/Avatar.d.ts.map +1 -1
  15. package/dist/components/Avatar/Avatar.js.map +1 -1
  16. package/dist/components/Avatar/AvatarStack.cjs.map +1 -1
  17. package/dist/components/Avatar/AvatarStack.js.map +1 -1
  18. package/dist/components/Avatar/avatar-clip.mask.svg.cjs.map +1 -1
  19. package/dist/components/Avatar/avatar-clip.mask.svg.js.map +1 -1
  20. package/dist/components/Avatar/useIdColorHash.cjs.map +1 -1
  21. package/dist/components/Avatar/useIdColorHash.js.map +1 -1
  22. package/dist/components/Badge/Badge.cjs.map +1 -1
  23. package/dist/components/Badge/Badge.d.ts.map +1 -1
  24. package/dist/components/Badge/Badge.js.map +1 -1
  25. package/dist/components/Breadcrumb/Breadcrumb.cjs.map +1 -1
  26. package/dist/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
  27. package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -1
  28. package/dist/components/Button/Button.cjs.map +1 -1
  29. package/dist/components/Button/Button.d.ts.map +1 -1
  30. package/dist/components/Button/Button.js.map +1 -1
  31. package/dist/components/Button/IconButton/IconButton.cjs.map +1 -1
  32. package/dist/components/Button/IconButton/IconButton.d.ts.map +1 -1
  33. package/dist/components/Button/IconButton/IconButton.js.map +1 -1
  34. package/dist/components/Button/UnstyledButton.cjs.map +1 -1
  35. package/dist/components/Button/UnstyledButton.d.ts.map +1 -1
  36. package/dist/components/Button/UnstyledButton.js.map +1 -1
  37. package/dist/components/ChatFilter/ChatFilter.cjs.map +1 -1
  38. package/dist/components/ChatFilter/ChatFilter.d.ts.map +1 -1
  39. package/dist/components/ChatFilter/ChatFilter.js.map +1 -1
  40. package/dist/components/Dropdown/Dropdown.cjs.map +1 -1
  41. package/dist/components/Dropdown/Dropdown.js.map +1 -1
  42. package/dist/components/Form/Controls/Action/Action.cjs.map +1 -1
  43. package/dist/components/Form/Controls/Action/Action.d.ts.map +1 -1
  44. package/dist/components/Form/Controls/Action/Action.js.map +1 -1
  45. package/dist/components/Form/Controls/Checkbox/Checkbox.cjs.map +1 -1
  46. package/dist/components/Form/Controls/Checkbox/Checkbox.d.ts.map +1 -1
  47. package/dist/components/Form/Controls/Checkbox/Checkbox.js.map +1 -1
  48. package/dist/components/Form/Controls/EditInPlace/EditInPlace.cjs.map +1 -1
  49. package/dist/components/Form/Controls/EditInPlace/EditInPlace.js.map +1 -1
  50. package/dist/components/Form/Controls/MFA/MFA.cjs.map +1 -1
  51. package/dist/components/Form/Controls/MFA/MFA.js.map +1 -1
  52. package/dist/components/Form/Controls/Password/Password.cjs.map +1 -1
  53. package/dist/components/Form/Controls/Password/Password.d.ts.map +1 -1
  54. package/dist/components/Form/Controls/Password/Password.js.map +1 -1
  55. package/dist/components/Form/Controls/Radio/Radio.cjs.map +1 -1
  56. package/dist/components/Form/Controls/Radio/Radio.js.map +1 -1
  57. package/dist/components/Form/Controls/SettingsToggle/SettingsToggle.cjs +4 -2
  58. package/dist/components/Form/Controls/SettingsToggle/SettingsToggle.cjs.map +1 -1
  59. package/dist/components/Form/Controls/SettingsToggle/SettingsToggle.d.ts.map +1 -1
  60. package/dist/components/Form/Controls/SettingsToggle/SettingsToggle.js +5 -3
  61. package/dist/components/Form/Controls/SettingsToggle/SettingsToggle.js.map +1 -1
  62. package/dist/components/Form/Controls/Text/Text.cjs.map +1 -1
  63. package/dist/components/Form/Controls/Text/Text.d.ts.map +1 -1
  64. package/dist/components/Form/Controls/Text/Text.js.map +1 -1
  65. package/dist/components/Form/Controls/Toggle/Toggle.cjs +10 -1
  66. package/dist/components/Form/Controls/Toggle/Toggle.cjs.map +1 -1
  67. package/dist/components/Form/Controls/Toggle/Toggle.d.ts.map +1 -1
  68. package/dist/components/Form/Controls/Toggle/Toggle.js +10 -1
  69. package/dist/components/Form/Controls/Toggle/Toggle.js.map +1 -1
  70. package/dist/components/Form/Field.cjs.map +1 -1
  71. package/dist/components/Form/Field.d.ts.map +1 -1
  72. package/dist/components/Form/Field.js.map +1 -1
  73. package/dist/components/Form/InlineField.cjs.map +1 -1
  74. package/dist/components/Form/InlineField.d.ts.map +1 -1
  75. package/dist/components/Form/InlineField.js.map +1 -1
  76. package/dist/components/Form/Label.cjs.map +1 -1
  77. package/dist/components/Form/Label.d.ts.map +1 -1
  78. package/dist/components/Form/Label.js.map +1 -1
  79. package/dist/components/Form/Message.cjs.map +1 -1
  80. package/dist/components/Form/Message.d.ts.map +1 -1
  81. package/dist/components/Form/Message.js.map +1 -1
  82. package/dist/components/Form/Root.cjs.map +1 -1
  83. package/dist/components/Form/Root.d.ts.map +1 -1
  84. package/dist/components/Form/Root.js.map +1 -1
  85. package/dist/components/Form/Submit.cjs.map +1 -1
  86. package/dist/components/Form/Submit.d.ts.map +1 -1
  87. package/dist/components/Form/Submit.js.map +1 -1
  88. package/dist/components/Glass/Glass.cjs.map +1 -1
  89. package/dist/components/Glass/Glass.d.ts.map +1 -1
  90. package/dist/components/Glass/Glass.js.map +1 -1
  91. package/dist/components/Icon/BigIcon/BigIcon.cjs.map +1 -1
  92. package/dist/components/Icon/BigIcon/BigIcon.d.ts.map +1 -1
  93. package/dist/components/Icon/BigIcon/BigIcon.js.map +1 -1
  94. package/dist/components/Icon/IndicatorIcon/IndicatorIcon.cjs.map +1 -1
  95. package/dist/components/Icon/IndicatorIcon/IndicatorIcon.d.ts.map +1 -1
  96. package/dist/components/Icon/IndicatorIcon/IndicatorIcon.js.map +1 -1
  97. package/dist/components/InlineSpinner/InlineSpinner.cjs.map +1 -1
  98. package/dist/components/InlineSpinner/InlineSpinner.d.ts.map +1 -1
  99. package/dist/components/InlineSpinner/InlineSpinner.js.map +1 -1
  100. package/dist/components/Link/Link.cjs.map +1 -1
  101. package/dist/components/Link/Link.d.ts.map +1 -1
  102. package/dist/components/Link/Link.js.map +1 -1
  103. package/dist/components/Menu/CheckboxMenuItem.cjs.map +1 -1
  104. package/dist/components/Menu/CheckboxMenuItem.d.ts.map +1 -1
  105. package/dist/components/Menu/CheckboxMenuItem.js.map +1 -1
  106. package/dist/components/Menu/ContextMenu.cjs.map +1 -1
  107. package/dist/components/Menu/ContextMenu.d.ts.map +1 -1
  108. package/dist/components/Menu/ContextMenu.js.map +1 -1
  109. package/dist/components/Menu/DrawerMenu.cjs.map +1 -1
  110. package/dist/components/Menu/DrawerMenu.d.ts.map +1 -1
  111. package/dist/components/Menu/DrawerMenu.js.map +1 -1
  112. package/dist/components/Menu/DrawerMenu.module.css.cjs +3 -3
  113. package/dist/components/Menu/DrawerMenu.module.css.js +3 -3
  114. package/dist/components/Menu/FloatingMenu.cjs.map +1 -1
  115. package/dist/components/Menu/FloatingMenu.d.ts.map +1 -1
  116. package/dist/components/Menu/FloatingMenu.js.map +1 -1
  117. package/dist/components/Menu/FloatingMenu.module.css.cjs +2 -2
  118. package/dist/components/Menu/FloatingMenu.module.css.js +2 -2
  119. package/dist/components/Menu/Menu.cjs.map +1 -1
  120. package/dist/components/Menu/Menu.d.ts.map +1 -1
  121. package/dist/components/Menu/Menu.js.map +1 -1
  122. package/dist/components/Menu/MenuContext.cjs.map +1 -1
  123. package/dist/components/Menu/MenuContext.d.ts.map +1 -1
  124. package/dist/components/Menu/MenuContext.js.map +1 -1
  125. package/dist/components/Menu/MenuItem.cjs.map +1 -1
  126. package/dist/components/Menu/MenuItem.d.ts.map +1 -1
  127. package/dist/components/Menu/MenuItem.js.map +1 -1
  128. package/dist/components/Menu/MenuTitle.cjs.map +1 -1
  129. package/dist/components/Menu/MenuTitle.js.map +1 -1
  130. package/dist/components/Menu/RadioMenuItem.cjs.map +1 -1
  131. package/dist/components/Menu/RadioMenuItem.d.ts.map +1 -1
  132. package/dist/components/Menu/RadioMenuItem.js.map +1 -1
  133. package/dist/components/Menu/ToggleMenuItem.cjs.map +1 -1
  134. package/dist/components/Menu/ToggleMenuItem.d.ts.map +1 -1
  135. package/dist/components/Menu/ToggleMenuItem.js.map +1 -1
  136. package/dist/components/Nav/NavBar.cjs.map +1 -1
  137. package/dist/components/Nav/NavBar.d.ts.map +1 -1
  138. package/dist/components/Nav/NavBar.js.map +1 -1
  139. package/dist/components/Nav/NavItem.cjs.map +1 -1
  140. package/dist/components/Nav/NavItem.d.ts.map +1 -1
  141. package/dist/components/Nav/NavItem.js.map +1 -1
  142. package/dist/components/Progress/Progress.cjs.map +1 -1
  143. package/dist/components/Progress/Progress.js.map +1 -1
  144. package/dist/components/ReleaseAnnouncement/ReleaseAnnouncement.cjs.map +1 -1
  145. package/dist/components/ReleaseAnnouncement/ReleaseAnnouncement.d.ts.map +1 -1
  146. package/dist/components/ReleaseAnnouncement/ReleaseAnnouncement.js.map +1 -1
  147. package/dist/components/ReleaseAnnouncement/ReleaseAnnouncementContext.cjs.map +1 -1
  148. package/dist/components/ReleaseAnnouncement/ReleaseAnnouncementContext.d.ts.map +1 -1
  149. package/dist/components/ReleaseAnnouncement/ReleaseAnnouncementContext.js.map +1 -1
  150. package/dist/components/ReleaseAnnouncement/useReleaseAnnouncement.cjs.map +1 -1
  151. package/dist/components/ReleaseAnnouncement/useReleaseAnnouncement.d.ts.map +1 -1
  152. package/dist/components/ReleaseAnnouncement/useReleaseAnnouncement.js.map +1 -1
  153. package/dist/components/Search/Search.cjs.map +1 -1
  154. package/dist/components/Search/Search.d.ts.map +1 -1
  155. package/dist/components/Search/Search.js.map +1 -1
  156. package/dist/components/Separator/Separator.cjs.map +1 -1
  157. package/dist/components/Separator/Separator.d.ts.map +1 -1
  158. package/dist/components/Separator/Separator.js.map +1 -1
  159. package/dist/components/Toast/Toast.cjs.map +1 -1
  160. package/dist/components/Toast/Toast.d.ts.map +1 -1
  161. package/dist/components/Toast/Toast.js.map +1 -1
  162. package/dist/components/Tooltip/Tooltip.cjs.map +1 -1
  163. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  164. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  165. package/dist/components/Tooltip/TooltipContext.cjs.map +1 -1
  166. package/dist/components/Tooltip/TooltipContext.d.ts.map +1 -1
  167. package/dist/components/Tooltip/TooltipContext.js.map +1 -1
  168. package/dist/components/Tooltip/TooltipProvider.cjs.map +1 -1
  169. package/dist/components/Tooltip/TooltipProvider.d.ts.map +1 -1
  170. package/dist/components/Tooltip/TooltipProvider.js.map +1 -1
  171. package/dist/components/Tooltip/useTooltip.cjs.map +1 -1
  172. package/dist/components/Tooltip/useTooltip.d.ts.map +1 -1
  173. package/dist/components/Tooltip/useTooltip.js.map +1 -1
  174. package/dist/components/Typography/Body.cjs.map +1 -1
  175. package/dist/components/Typography/Body.js.map +1 -1
  176. package/dist/components/Typography/Heading.cjs.map +1 -1
  177. package/dist/components/Typography/Heading.js.map +1 -1
  178. package/dist/components/Typography/Text.cjs.map +1 -1
  179. package/dist/components/Typography/Text.js.map +1 -1
  180. package/dist/components/Typography/Typography.cjs.map +1 -1
  181. package/dist/components/Typography/Typography.d.ts.map +1 -1
  182. package/dist/components/Typography/Typography.js.map +1 -1
  183. package/dist/components/VisualList/VisualList.cjs.map +1 -1
  184. package/dist/components/VisualList/VisualList.d.ts.map +1 -1
  185. package/dist/components/VisualList/VisualList.js.map +1 -1
  186. package/dist/components/VisualList/VisualListItem.cjs.map +1 -1
  187. package/dist/components/VisualList/VisualListItem.d.ts.map +1 -1
  188. package/dist/components/VisualList/VisualListItem.js.map +1 -1
  189. package/dist/{style.css.css → style.css} +21 -21
  190. package/dist/utils/__ComponentTemplate__/__ComponentTemplate__.d.ts.map +1 -1
  191. package/dist/utils/platform.cjs.map +1 -1
  192. package/dist/utils/platform.js.map +1 -1
  193. package/dist/utils/string.cjs.map +1 -1
  194. package/dist/utils/string.js.map +1 -1
  195. package/package.json +30 -32
  196. package/src/components/ActivityMarker/Pill.tsx +1 -1
  197. package/src/components/ActivityMarker/Unread.tsx +1 -1
  198. package/src/components/ActivityMarker/UnreadCounter.tsx +1 -1
  199. package/src/components/Alert/Alert.tsx +1 -1
  200. package/src/components/Avatar/Avatar.tsx +1 -1
  201. package/src/components/Badge/Badge.tsx +1 -1
  202. package/src/components/Breadcrumb/Breadcrumb.tsx +6 -1
  203. package/src/components/Button/Button.tsx +5 -5
  204. package/src/components/Button/IconButton/IconButton.tsx +2 -2
  205. package/src/components/Button/UnstyledButton.tsx +6 -1
  206. package/src/components/ChatFilter/ChatFilter.tsx +2 -2
  207. package/src/components/Dropdown/Dropdown.tsx +5 -5
  208. package/src/components/Form/Controls/Action/Action.tsx +6 -1
  209. package/src/components/Form/Controls/Checkbox/Checkbox.tsx +5 -1
  210. package/src/components/Form/Controls/MFA/MFA.tsx +3 -3
  211. package/src/components/Form/Controls/Password/Password.tsx +2 -2
  212. package/src/components/Form/Controls/Radio/Radio.tsx +3 -3
  213. package/src/components/Form/Controls/SettingsToggle/SettingsToggle.tsx +8 -5
  214. package/src/components/Form/Controls/Text/Text.tsx +5 -1
  215. package/src/components/Form/Controls/Toggle/Toggle.tsx +10 -4
  216. package/src/components/Form/Field.tsx +1 -1
  217. package/src/components/Form/InlineField.tsx +1 -1
  218. package/src/components/Form/Label.tsx +1 -1
  219. package/src/components/Form/Message.tsx +1 -1
  220. package/src/components/Form/Root.tsx +1 -1
  221. package/src/components/Form/Submit.tsx +1 -1
  222. package/src/components/Glass/Glass.tsx +2 -2
  223. package/src/components/Icon/BigIcon/BigIcon.tsx +1 -1
  224. package/src/components/Icon/IndicatorIcon/IndicatorIcon.tsx +1 -1
  225. package/src/components/InlineSpinner/InlineSpinner.tsx +1 -1
  226. package/src/components/Link/Link.tsx +1 -1
  227. package/src/components/Menu/CheckboxMenuItem.tsx +6 -1
  228. package/src/components/Menu/ContextMenu.tsx +12 -2
  229. package/src/components/Menu/DrawerMenu.module.css +1 -1
  230. package/src/components/Menu/DrawerMenu.tsx +5 -1
  231. package/src/components/Menu/FloatingMenu.module.css +1 -1
  232. package/src/components/Menu/FloatingMenu.tsx +2 -2
  233. package/src/components/Menu/Menu.tsx +6 -2
  234. package/src/components/Menu/MenuContext.tsx +1 -1
  235. package/src/components/Menu/MenuItem.tsx +6 -6
  236. package/src/components/Menu/RadioMenuItem.tsx +6 -1
  237. package/src/components/Menu/ToggleMenuItem.tsx +6 -1
  238. package/src/components/Nav/NavItem.tsx +4 -4
  239. package/src/components/ReleaseAnnouncement/ReleaseAnnouncement.tsx +4 -4
  240. package/src/components/ReleaseAnnouncement/useReleaseAnnouncement.tsx +2 -2
  241. package/src/components/Search/Search.tsx +1 -1
  242. package/src/components/Separator/Separator.tsx +3 -3
  243. package/src/components/Toast/Toast.tsx +1 -1
  244. package/src/components/Tooltip/Tooltip.tsx +9 -9
  245. package/src/components/Tooltip/TooltipProvider.tsx +1 -1
  246. package/src/components/Tooltip/useTooltip.ts +4 -4
  247. package/src/components/Typography/Typography.tsx +1 -1
  248. package/src/components/VisualList/VisualList.tsx +1 -1
  249. package/src/components/VisualList/VisualListItem.tsx +5 -1
  250. package/src/utils/__ComponentTemplate__/__ComponentTemplate__.tsx +1 -1
  251. package/tsconfig.json +3 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Pill.cjs","sources":["../../../src/components/ActivityMarker/Pill.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, { HTMLProps, JSX } from \"react\";\nimport styles from \"./Pill.module.css\";\n\nexport function Pill({\n children,\n ...props\n}: HTMLProps<HTMLSpanElement>): JSX.Element {\n return (\n <span {...props} className={styles.pill}>\n {children}\n </span>\n );\n}\n"],"names":["styles"],"mappings":";;;;AAUO,SAAS,KAAK;AAAA,EACnB;AAAA,EACA,GAAG;AACL,GAA4C;AAC1C,wCACG,QAAM,EAAA,GAAG,OAAO,WAAWA,YAAA,QAAO,MAChC,UACH;AAEJ;;"}
1
+ {"version":3,"file":"Pill.cjs","sources":["../../../src/components/ActivityMarker/Pill.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, { type HTMLProps, type JSX } from \"react\";\nimport styles from \"./Pill.module.css\";\n\nexport function Pill({\n children,\n ...props\n}: HTMLProps<HTMLSpanElement>): JSX.Element {\n return (\n <span {...props} className={styles.pill}>\n {children}\n </span>\n );\n}\n"],"names":["styles"],"mappings":";;;;AAUO,SAAS,KAAK;AAAA,EACnB;AAAA,EACA,GAAG;AACL,GAA4C;AAC1C,wCACG,QAAA,EAAM,GAAG,OAAO,WAAWA,YAAAA,QAAO,MAChC,UACH;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Pill.d.ts","sourceRoot":"","sources":["../../../src/components/ActivityMarker/Pill.tsx"],"names":[],"mappings":"AAOA,OAAc,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG9C,wBAAgB,IAAI,CAAC,EACnB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,SAAS,CAAC,eAAe,CAAC,GAAG,GAAG,CAAC,OAAO,CAM1C"}
1
+ {"version":3,"file":"Pill.d.ts","sourceRoot":"","sources":["../../../src/components/ActivityMarker/Pill.tsx"],"names":[],"mappings":"AAOA,OAAc,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAGxD,wBAAgB,IAAI,CAAC,EACnB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,SAAS,CAAC,eAAe,CAAC,GAAG,GAAG,CAAC,OAAO,CAM1C"}
@@ -1 +1 @@
1
- {"version":3,"file":"Pill.js","sources":["../../../src/components/ActivityMarker/Pill.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, { HTMLProps, JSX } from \"react\";\nimport styles from \"./Pill.module.css\";\n\nexport function Pill({\n children,\n ...props\n}: HTMLProps<HTMLSpanElement>): JSX.Element {\n return (\n <span {...props} className={styles.pill}>\n {children}\n </span>\n );\n}\n"],"names":[],"mappings":";;AAUO,SAAS,KAAK;AAAA,EACnB;AAAA,EACA,GAAG;AACL,GAA4C;AAC1C,6BACG,QAAM,EAAA,GAAG,OAAO,WAAW,OAAO,MAChC,UACH;AAEJ;"}
1
+ {"version":3,"file":"Pill.js","sources":["../../../src/components/ActivityMarker/Pill.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, { type HTMLProps, type JSX } from \"react\";\nimport styles from \"./Pill.module.css\";\n\nexport function Pill({\n children,\n ...props\n}: HTMLProps<HTMLSpanElement>): JSX.Element {\n return (\n <span {...props} className={styles.pill}>\n {children}\n </span>\n );\n}\n"],"names":[],"mappings":";;AAUO,SAAS,KAAK;AAAA,EACnB;AAAA,EACA,GAAG;AACL,GAA4C;AAC1C,6BACG,QAAA,EAAM,GAAG,OAAO,WAAW,OAAO,MAChC,UACH;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Unread.cjs","sources":["../../../src/components/ActivityMarker/Unread.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, { HTMLProps } from \"react\";\nimport styles from \"./Unread.module.css\";\n\nexport function Unread(props: HTMLProps<HTMLDivElement>) {\n return (\n <div {...props} className={styles.unread}>\n <div />\n </div>\n );\n}\n"],"names":["jsx","styles"],"mappings":";;;;AAUO,SAAS,OAAO,OAAkC;AAErD,SAAAA,2BAAA,IAAC,SAAK,GAAG,OAAO,WAAWC,cAAAA,QAAO,QAChC,UAACD,2BAAA,IAAA,OAAA,CAAA,CAAI,EACP,CAAA;AAEJ;;"}
1
+ {"version":3,"file":"Unread.cjs","sources":["../../../src/components/ActivityMarker/Unread.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, { type HTMLProps } from \"react\";\nimport styles from \"./Unread.module.css\";\n\nexport function Unread(props: HTMLProps<HTMLDivElement>) {\n return (\n <div {...props} className={styles.unread}>\n <div />\n </div>\n );\n}\n"],"names":["jsx","styles"],"mappings":";;;;AAUO,SAAS,OAAO,OAAkC;AACvD,SACEA,2BAAAA,IAAC,SAAK,GAAG,OAAO,WAAWC,cAAAA,QAAO,QAChC,UAAAD,2BAAAA,IAAC,OAAA,CAAA,CAAI,EAAA,CACP;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Unread.d.ts","sourceRoot":"","sources":["../../../src/components/ActivityMarker/Unread.tsx"],"names":[],"mappings":"AAOA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzC,wBAAgB,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,cAAc,CAAC,2CAMtD"}
1
+ {"version":3,"file":"Unread.d.ts","sourceRoot":"","sources":["../../../src/components/ActivityMarker/Unread.tsx"],"names":[],"mappings":"AAOA,OAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG9C,wBAAgB,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,cAAc,CAAC,2CAMtD"}
@@ -1 +1 @@
1
- {"version":3,"file":"Unread.js","sources":["../../../src/components/ActivityMarker/Unread.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, { HTMLProps } from \"react\";\nimport styles from \"./Unread.module.css\";\n\nexport function Unread(props: HTMLProps<HTMLDivElement>) {\n return (\n <div {...props} className={styles.unread}>\n <div />\n </div>\n );\n}\n"],"names":[],"mappings":";;AAUO,SAAS,OAAO,OAAkC;AAErD,SAAA,oBAAC,SAAK,GAAG,OAAO,WAAW,OAAO,QAChC,UAAC,oBAAA,OAAA,CAAA,CAAI,EACP,CAAA;AAEJ;"}
1
+ {"version":3,"file":"Unread.js","sources":["../../../src/components/ActivityMarker/Unread.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, { type HTMLProps } from \"react\";\nimport styles from \"./Unread.module.css\";\n\nexport function Unread(props: HTMLProps<HTMLDivElement>) {\n return (\n <div {...props} className={styles.unread}>\n <div />\n </div>\n );\n}\n"],"names":[],"mappings":";;AAUO,SAAS,OAAO,OAAkC;AACvD,SACE,oBAAC,SAAK,GAAG,OAAO,WAAW,OAAO,QAChC,UAAA,oBAAC,OAAA,CAAA,CAAI,EAAA,CACP;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"UnreadCounter.cjs","sources":["../../../src/components/ActivityMarker/UnreadCounter.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, { HTMLProps } from \"react\";\nimport styles from \"./UnreadCounter.module.css\";\n\ninterface UnreadCounterProps extends HTMLProps<HTMLDivElement> {\n /**\n * The number to display.\n * If `null`, the counter will be empty.\n */\n count: string | number | null;\n}\n\nexport function UnreadCounter({ count, ...props }: UnreadCounterProps) {\n if (count === null)\n return <div {...props} className={styles[\"unread-counter\"]} />;\n\n return (\n <span {...props} className={styles[\"unread-counter\"]}>\n {count}\n </span>\n );\n}\n"],"names":["styles","jsx"],"mappings":";;;;AAkBO,SAAS,cAAc,EAAE,OAAO,GAAG,SAA6B;AACrE,MAAI,UAAU;AACZ,0CAAQ,OAAK,EAAA,GAAG,OAAO,WAAWA,qBAAA,QAAO,gBAAgB,GAAG;AAG5D,SAAAC,+BAAC,UAAM,GAAG,OAAO,WAAWD,qBAAO,QAAA,gBAAgB,GAChD,UACH,OAAA;AAEJ;;"}
1
+ {"version":3,"file":"UnreadCounter.cjs","sources":["../../../src/components/ActivityMarker/UnreadCounter.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, { type HTMLProps } from \"react\";\nimport styles from \"./UnreadCounter.module.css\";\n\ninterface UnreadCounterProps extends HTMLProps<HTMLDivElement> {\n /**\n * The number to display.\n * If `null`, the counter will be empty.\n */\n count: string | number | null;\n}\n\nexport function UnreadCounter({ count, ...props }: UnreadCounterProps) {\n if (count === null)\n return <div {...props} className={styles[\"unread-counter\"]} />;\n\n return (\n <span {...props} className={styles[\"unread-counter\"]}>\n {count}\n </span>\n );\n}\n"],"names":["styles","jsx"],"mappings":";;;;AAkBO,SAAS,cAAc,EAAE,OAAO,GAAG,SAA6B;AACrE,MAAI,UAAU;AACZ,0CAAQ,OAAA,EAAK,GAAG,OAAO,WAAWA,qBAAAA,QAAO,gBAAgB,GAAG;AAE9D,SACEC,+BAAC,UAAM,GAAG,OAAO,WAAWD,qBAAAA,QAAO,gBAAgB,GAChD,UAAA,OACH;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"UnreadCounter.d.ts","sourceRoot":"","sources":["../../../src/components/ActivityMarker/UnreadCounter.tsx"],"names":[],"mappings":"AAOA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzC,UAAU,kBAAmB,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC5D;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,2CASpE"}
1
+ {"version":3,"file":"UnreadCounter.d.ts","sourceRoot":"","sources":["../../../src/components/ActivityMarker/UnreadCounter.tsx"],"names":[],"mappings":"AAOA,OAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG9C,UAAU,kBAAmB,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC5D;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,2CASpE"}
@@ -1 +1 @@
1
- {"version":3,"file":"UnreadCounter.js","sources":["../../../src/components/ActivityMarker/UnreadCounter.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, { HTMLProps } from \"react\";\nimport styles from \"./UnreadCounter.module.css\";\n\ninterface UnreadCounterProps extends HTMLProps<HTMLDivElement> {\n /**\n * The number to display.\n * If `null`, the counter will be empty.\n */\n count: string | number | null;\n}\n\nexport function UnreadCounter({ count, ...props }: UnreadCounterProps) {\n if (count === null)\n return <div {...props} className={styles[\"unread-counter\"]} />;\n\n return (\n <span {...props} className={styles[\"unread-counter\"]}>\n {count}\n </span>\n );\n}\n"],"names":[],"mappings":";;AAkBO,SAAS,cAAc,EAAE,OAAO,GAAG,SAA6B;AACrE,MAAI,UAAU;AACZ,+BAAQ,OAAK,EAAA,GAAG,OAAO,WAAW,OAAO,gBAAgB,GAAG;AAG5D,SAAA,oBAAC,UAAM,GAAG,OAAO,WAAW,OAAO,gBAAgB,GAChD,UACH,OAAA;AAEJ;"}
1
+ {"version":3,"file":"UnreadCounter.js","sources":["../../../src/components/ActivityMarker/UnreadCounter.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, { type HTMLProps } from \"react\";\nimport styles from \"./UnreadCounter.module.css\";\n\ninterface UnreadCounterProps extends HTMLProps<HTMLDivElement> {\n /**\n * The number to display.\n * If `null`, the counter will be empty.\n */\n count: string | number | null;\n}\n\nexport function UnreadCounter({ count, ...props }: UnreadCounterProps) {\n if (count === null)\n return <div {...props} className={styles[\"unread-counter\"]} />;\n\n return (\n <span {...props} className={styles[\"unread-counter\"]}>\n {count}\n </span>\n );\n}\n"],"names":[],"mappings":";;AAkBO,SAAS,cAAc,EAAE,OAAO,GAAG,SAA6B;AACrE,MAAI,UAAU;AACZ,+BAAQ,OAAA,EAAK,GAAG,OAAO,WAAW,OAAO,gBAAgB,GAAG;AAE9D,SACE,oBAAC,UAAM,GAAG,OAAO,WAAW,OAAO,gBAAgB,GAChD,UAAA,OACH;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.cjs","sources":["../../../src/components/Alert/Alert.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classNames from \"classnames\";\nimport React, { PropsWithChildren, useCallback } from \"react\";\n\nimport CheckCircleIcon from \"@vector-im/compound-design-tokens/assets/web/icons/check-circle\";\nimport ErrorIcon from \"@vector-im/compound-design-tokens/assets/web/icons/error-solid\";\nimport InfoIcon from \"@vector-im/compound-design-tokens/assets/web/icons/info\";\nimport CloseIcon from \"@vector-im/compound-design-tokens/assets/web/icons/close\";\n\nimport styles from \"./Alert.module.css\";\nimport { Text } from \"../Typography/Text\";\nimport { IconButton } from \"../Button\";\n\ntype AlertProps = {\n /**\n * The type of alert\n */\n type: \"success\" | \"critical\" | \"info\";\n /**\n * The headline of the alert.\n */\n title: string;\n /**\n * The CSS class name.\n */\n className?: string;\n /**\n * Actions that will be displayed to the right of the content\n * Wraps and stacks actions under content when alert's size is <=600px\n * eg\n * ```\n * <Alert\n * title='Title'\n * actions={<Button onClick={doSomething}>Yes</Button>}\n * />\n * ```\n */\n actions?: React.ReactNode;\n /**\n * Event callback when dismissing the alert. Determines the display of the\n * \"close\" button at the top right of the alert.\n * @param e the event parameters\n */\n onClose?: (e: React.MouseEvent) => void;\n};\n\n/**\n * An alert component component that is dismissable when passing an `onClose`\n * property.\n */\nexport const Alert: React.FC<PropsWithChildren<AlertProps>> = ({\n type,\n title,\n children,\n className,\n actions,\n onClose,\n ...props\n}: PropsWithChildren<AlertProps>) => {\n const classes = classNames(styles.alert, className);\n\n const renderIcon = useCallback(\n (props: React.ComponentProps<typeof ErrorIcon>) => {\n switch (type) {\n case \"critical\":\n return <ErrorIcon {...props} />;\n case \"info\":\n return <InfoIcon {...props} />;\n case \"success\":\n return <CheckCircleIcon {...props} />;\n }\n },\n [type],\n );\n\n return (\n <div {...props} className={classes} data-type={type}>\n {renderIcon({\n width: 24,\n height: 24,\n className: styles.icon,\n \"aria-hidden\": true,\n })}\n <div className={styles.content}>\n <div className={styles[\"text-content\"]}>\n <Text size=\"md\" weight=\"semibold\">\n {title}\n </Text>\n <Text size=\"sm\" weight=\"regular\">\n {children}\n </Text>\n </div>\n {actions && <div className={styles.actions}>{actions}</div>}\n </div>\n {/* TODO: Setup an i18n function for the aria label below */}\n {onClose && (\n <IconButton\n onClick={onClose}\n aria-label=\"Close\"\n role=\"button\"\n className={styles.close}\n >\n <CloseIcon />\n </IconButton>\n )}\n </div>\n );\n};\n"],"names":["styles","useCallback","props","jsx","jsxs","Text","IconButton"],"mappings":";;;;;;;;;;;;AAwDO,MAAM,QAAiD,CAAC;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAqC;AACnC,QAAM,UAAU,WAAWA,qBAAO,OAAO,SAAS;AAElD,QAAM,aAAaC,MAAA;AAAA,IACjB,CAACC,WAAkD;AACjD,cAAQ,MAAM;AAAA,QACZ,KAAK;AACI,iBAAAC,+BAAC,WAAW,EAAA,GAAGD,OAAO,CAAA;AAAA,QAC/B,KAAK;AACI,iBAAAC,+BAAC,UAAU,EAAA,GAAGD,OAAO,CAAA;AAAA,QAC9B,KAAK;AACI,iBAAAC,+BAAC,iBAAiB,EAAA,GAAGD,OAAO,CAAA;AAAA,MAAA;AAAA,IAEzC;AAAA,IACA,CAAC,IAAI;AAAA,EACP;AAEA,yCACG,OAAK,EAAA,GAAG,OAAO,WAAW,SAAS,aAAW,MAC5C,UAAA;AAAA,IAAW,WAAA;AAAA,MACV,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,WAAWF,aAAO,QAAA;AAAA,MAClB,eAAe;AAAA,IAAA,CAChB;AAAA,IACAI,2BAAA,KAAA,OAAA,EAAI,WAAWJ,aAAAA,QAAO,SACrB,UAAA;AAAA,MAAAI,2BAAA,KAAC,OAAI,EAAA,WAAWJ,aAAAA,QAAO,cAAc,GACnC,UAAA;AAAA,QAAAG,+BAACE,KAAAA,MAAK,EAAA,MAAK,MAAK,QAAO,YACpB,UACH,OAAA;AAAA,uCACCA,KAAK,MAAA,EAAA,MAAK,MAAK,QAAO,WACpB,SACH,CAAA;AAAA,MAAA,GACF;AAAA,MACC,WAAYF,2BAAAA,IAAA,OAAA,EAAI,WAAWH,aAAAA,QAAO,SAAU,UAAQ,QAAA,CAAA;AAAA,IAAA,GACvD;AAAA,IAEC,WACCG,2BAAA;AAAA,MAACG,WAAA;AAAA,MAAA;AAAA,QACC,SAAS;AAAA,QACT,cAAW;AAAA,QACX,MAAK;AAAA,QACL,WAAWN,aAAO,QAAA;AAAA,QAElB,yCAAC,WAAU,CAAA,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACb,GAEJ;AAEJ;;"}
1
+ {"version":3,"file":"Alert.cjs","sources":["../../../src/components/Alert/Alert.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classNames from \"classnames\";\nimport React, { type PropsWithChildren, useCallback } from \"react\";\n\nimport CheckCircleIcon from \"@vector-im/compound-design-tokens/assets/web/icons/check-circle\";\nimport ErrorIcon from \"@vector-im/compound-design-tokens/assets/web/icons/error-solid\";\nimport InfoIcon from \"@vector-im/compound-design-tokens/assets/web/icons/info\";\nimport CloseIcon from \"@vector-im/compound-design-tokens/assets/web/icons/close\";\n\nimport styles from \"./Alert.module.css\";\nimport { Text } from \"../Typography/Text\";\nimport { IconButton } from \"../Button\";\n\ntype AlertProps = {\n /**\n * The type of alert\n */\n type: \"success\" | \"critical\" | \"info\";\n /**\n * The headline of the alert.\n */\n title: string;\n /**\n * The CSS class name.\n */\n className?: string;\n /**\n * Actions that will be displayed to the right of the content\n * Wraps and stacks actions under content when alert's size is <=600px\n * eg\n * ```\n * <Alert\n * title='Title'\n * actions={<Button onClick={doSomething}>Yes</Button>}\n * />\n * ```\n */\n actions?: React.ReactNode;\n /**\n * Event callback when dismissing the alert. Determines the display of the\n * \"close\" button at the top right of the alert.\n * @param e the event parameters\n */\n onClose?: (e: React.MouseEvent) => void;\n};\n\n/**\n * An alert component component that is dismissable when passing an `onClose`\n * property.\n */\nexport const Alert: React.FC<PropsWithChildren<AlertProps>> = ({\n type,\n title,\n children,\n className,\n actions,\n onClose,\n ...props\n}: PropsWithChildren<AlertProps>) => {\n const classes = classNames(styles.alert, className);\n\n const renderIcon = useCallback(\n (props: React.ComponentProps<typeof ErrorIcon>) => {\n switch (type) {\n case \"critical\":\n return <ErrorIcon {...props} />;\n case \"info\":\n return <InfoIcon {...props} />;\n case \"success\":\n return <CheckCircleIcon {...props} />;\n }\n },\n [type],\n );\n\n return (\n <div {...props} className={classes} data-type={type}>\n {renderIcon({\n width: 24,\n height: 24,\n className: styles.icon,\n \"aria-hidden\": true,\n })}\n <div className={styles.content}>\n <div className={styles[\"text-content\"]}>\n <Text size=\"md\" weight=\"semibold\">\n {title}\n </Text>\n <Text size=\"sm\" weight=\"regular\">\n {children}\n </Text>\n </div>\n {actions && <div className={styles.actions}>{actions}</div>}\n </div>\n {/* TODO: Setup an i18n function for the aria label below */}\n {onClose && (\n <IconButton\n onClick={onClose}\n aria-label=\"Close\"\n role=\"button\"\n className={styles.close}\n >\n <CloseIcon />\n </IconButton>\n )}\n </div>\n );\n};\n"],"names":["styles","useCallback","props","jsx","jsxs","Text","IconButton"],"mappings":";;;;;;;;;;;;AAwDO,MAAM,QAAiD,CAAC;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAqC;AACnC,QAAM,UAAU,WAAWA,qBAAO,OAAO,SAAS;AAElD,QAAM,aAAaC,MAAAA;AAAAA,IACjB,CAACC,WAAkD;AACjD,cAAQ,MAAA;AAAA,QACN,KAAK;AACH,iBAAOC,+BAAC,WAAA,EAAW,GAAGD,OAAAA,CAAO;AAAA,QAC/B,KAAK;AACH,iBAAOC,+BAAC,UAAA,EAAU,GAAGD,OAAAA,CAAO;AAAA,QAC9B,KAAK;AACH,iBAAOC,+BAAC,iBAAA,EAAiB,GAAGD,OAAAA,CAAO;AAAA,MAAA;AAAA,IAEzC;AAAA,IACA,CAAC,IAAI;AAAA,EAAA;AAGP,yCACG,OAAA,EAAK,GAAG,OAAO,WAAW,SAAS,aAAW,MAC5C,UAAA;AAAA,IAAA,WAAW;AAAA,MACV,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,WAAWF,aAAAA,QAAO;AAAA,MAClB,eAAe;AAAA,IAAA,CAChB;AAAA,IACDI,2BAAAA,KAAC,OAAA,EAAI,WAAWJ,aAAAA,QAAO,SACrB,UAAA;AAAA,MAAAI,2BAAAA,KAAC,OAAA,EAAI,WAAWJ,aAAAA,QAAO,cAAc,GACnC,UAAA;AAAA,QAAAG,+BAACE,KAAAA,MAAA,EAAK,MAAK,MAAK,QAAO,YACpB,UAAA,OACH;AAAA,uCACCA,KAAAA,MAAA,EAAK,MAAK,MAAK,QAAO,WACpB,SAAA,CACH;AAAA,MAAA,GACF;AAAA,MACC,WAAWF,2BAAAA,IAAC,OAAA,EAAI,WAAWH,aAAAA,QAAO,SAAU,UAAA,QAAA,CAAQ;AAAA,IAAA,GACvD;AAAA,IAEC,WACCG,2BAAAA;AAAAA,MAACG,WAAAA;AAAAA,MAAA;AAAA,QACC,SAAS;AAAA,QACT,cAAW;AAAA,QACX,MAAK;AAAA,QACL,WAAWN,aAAAA,QAAO;AAAA,QAElB,yCAAC,WAAA,CAAA,CAAU;AAAA,MAAA;AAAA,IAAA;AAAA,EACb,GAEJ;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/Alert.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAe,MAAM,OAAO,CAAC;AAW9D,KAAK,UAAU,GAAG;IAChB;;OAEG;IACH,IAAI,EAAE,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;IACtC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAyDzD,CAAC"}
1
+ {"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/Alert.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAe,MAAM,OAAO,CAAC;AAWnE,KAAK,UAAU,GAAG;IAChB;;OAEG;IACH,IAAI,EAAE,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;IACtC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAyDzD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.js","sources":["../../../src/components/Alert/Alert.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classNames from \"classnames\";\nimport React, { PropsWithChildren, useCallback } from \"react\";\n\nimport CheckCircleIcon from \"@vector-im/compound-design-tokens/assets/web/icons/check-circle\";\nimport ErrorIcon from \"@vector-im/compound-design-tokens/assets/web/icons/error-solid\";\nimport InfoIcon from \"@vector-im/compound-design-tokens/assets/web/icons/info\";\nimport CloseIcon from \"@vector-im/compound-design-tokens/assets/web/icons/close\";\n\nimport styles from \"./Alert.module.css\";\nimport { Text } from \"../Typography/Text\";\nimport { IconButton } from \"../Button\";\n\ntype AlertProps = {\n /**\n * The type of alert\n */\n type: \"success\" | \"critical\" | \"info\";\n /**\n * The headline of the alert.\n */\n title: string;\n /**\n * The CSS class name.\n */\n className?: string;\n /**\n * Actions that will be displayed to the right of the content\n * Wraps and stacks actions under content when alert's size is <=600px\n * eg\n * ```\n * <Alert\n * title='Title'\n * actions={<Button onClick={doSomething}>Yes</Button>}\n * />\n * ```\n */\n actions?: React.ReactNode;\n /**\n * Event callback when dismissing the alert. Determines the display of the\n * \"close\" button at the top right of the alert.\n * @param e the event parameters\n */\n onClose?: (e: React.MouseEvent) => void;\n};\n\n/**\n * An alert component component that is dismissable when passing an `onClose`\n * property.\n */\nexport const Alert: React.FC<PropsWithChildren<AlertProps>> = ({\n type,\n title,\n children,\n className,\n actions,\n onClose,\n ...props\n}: PropsWithChildren<AlertProps>) => {\n const classes = classNames(styles.alert, className);\n\n const renderIcon = useCallback(\n (props: React.ComponentProps<typeof ErrorIcon>) => {\n switch (type) {\n case \"critical\":\n return <ErrorIcon {...props} />;\n case \"info\":\n return <InfoIcon {...props} />;\n case \"success\":\n return <CheckCircleIcon {...props} />;\n }\n },\n [type],\n );\n\n return (\n <div {...props} className={classes} data-type={type}>\n {renderIcon({\n width: 24,\n height: 24,\n className: styles.icon,\n \"aria-hidden\": true,\n })}\n <div className={styles.content}>\n <div className={styles[\"text-content\"]}>\n <Text size=\"md\" weight=\"semibold\">\n {title}\n </Text>\n <Text size=\"sm\" weight=\"regular\">\n {children}\n </Text>\n </div>\n {actions && <div className={styles.actions}>{actions}</div>}\n </div>\n {/* TODO: Setup an i18n function for the aria label below */}\n {onClose && (\n <IconButton\n onClick={onClose}\n aria-label=\"Close\"\n role=\"button\"\n className={styles.close}\n >\n <CloseIcon />\n </IconButton>\n )}\n </div>\n );\n};\n"],"names":["props"],"mappings":";;;;;;;;;;AAwDO,MAAM,QAAiD,CAAC;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAqC;AACnC,QAAM,UAAU,WAAW,OAAO,OAAO,SAAS;AAElD,QAAM,aAAa;AAAA,IACjB,CAACA,WAAkD;AACjD,cAAQ,MAAM;AAAA,QACZ,KAAK;AACI,iBAAA,oBAAC,WAAW,EAAA,GAAGA,OAAO,CAAA;AAAA,QAC/B,KAAK;AACI,iBAAA,oBAAC,UAAU,EAAA,GAAGA,OAAO,CAAA;AAAA,QAC9B,KAAK;AACI,iBAAA,oBAAC,iBAAiB,EAAA,GAAGA,OAAO,CAAA;AAAA,MAAA;AAAA,IAEzC;AAAA,IACA,CAAC,IAAI;AAAA,EACP;AAEA,8BACG,OAAK,EAAA,GAAG,OAAO,WAAW,SAAS,aAAW,MAC5C,UAAA;AAAA,IAAW,WAAA;AAAA,MACV,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,WAAW,OAAO;AAAA,MAClB,eAAe;AAAA,IAAA,CAChB;AAAA,IACA,qBAAA,OAAA,EAAI,WAAW,OAAO,SACrB,UAAA;AAAA,MAAA,qBAAC,OAAI,EAAA,WAAW,OAAO,cAAc,GACnC,UAAA;AAAA,QAAA,oBAAC,MAAK,EAAA,MAAK,MAAK,QAAO,YACpB,UACH,OAAA;AAAA,4BACC,MAAK,EAAA,MAAK,MAAK,QAAO,WACpB,SACH,CAAA;AAAA,MAAA,GACF;AAAA,MACC,WAAY,oBAAA,OAAA,EAAI,WAAW,OAAO,SAAU,UAAQ,QAAA,CAAA;AAAA,IAAA,GACvD;AAAA,IAEC,WACC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAAS;AAAA,QACT,cAAW;AAAA,QACX,MAAK;AAAA,QACL,WAAW,OAAO;AAAA,QAElB,8BAAC,WAAU,CAAA,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACb,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"Alert.js","sources":["../../../src/components/Alert/Alert.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classNames from \"classnames\";\nimport React, { type PropsWithChildren, useCallback } from \"react\";\n\nimport CheckCircleIcon from \"@vector-im/compound-design-tokens/assets/web/icons/check-circle\";\nimport ErrorIcon from \"@vector-im/compound-design-tokens/assets/web/icons/error-solid\";\nimport InfoIcon from \"@vector-im/compound-design-tokens/assets/web/icons/info\";\nimport CloseIcon from \"@vector-im/compound-design-tokens/assets/web/icons/close\";\n\nimport styles from \"./Alert.module.css\";\nimport { Text } from \"../Typography/Text\";\nimport { IconButton } from \"../Button\";\n\ntype AlertProps = {\n /**\n * The type of alert\n */\n type: \"success\" | \"critical\" | \"info\";\n /**\n * The headline of the alert.\n */\n title: string;\n /**\n * The CSS class name.\n */\n className?: string;\n /**\n * Actions that will be displayed to the right of the content\n * Wraps and stacks actions under content when alert's size is <=600px\n * eg\n * ```\n * <Alert\n * title='Title'\n * actions={<Button onClick={doSomething}>Yes</Button>}\n * />\n * ```\n */\n actions?: React.ReactNode;\n /**\n * Event callback when dismissing the alert. Determines the display of the\n * \"close\" button at the top right of the alert.\n * @param e the event parameters\n */\n onClose?: (e: React.MouseEvent) => void;\n};\n\n/**\n * An alert component component that is dismissable when passing an `onClose`\n * property.\n */\nexport const Alert: React.FC<PropsWithChildren<AlertProps>> = ({\n type,\n title,\n children,\n className,\n actions,\n onClose,\n ...props\n}: PropsWithChildren<AlertProps>) => {\n const classes = classNames(styles.alert, className);\n\n const renderIcon = useCallback(\n (props: React.ComponentProps<typeof ErrorIcon>) => {\n switch (type) {\n case \"critical\":\n return <ErrorIcon {...props} />;\n case \"info\":\n return <InfoIcon {...props} />;\n case \"success\":\n return <CheckCircleIcon {...props} />;\n }\n },\n [type],\n );\n\n return (\n <div {...props} className={classes} data-type={type}>\n {renderIcon({\n width: 24,\n height: 24,\n className: styles.icon,\n \"aria-hidden\": true,\n })}\n <div className={styles.content}>\n <div className={styles[\"text-content\"]}>\n <Text size=\"md\" weight=\"semibold\">\n {title}\n </Text>\n <Text size=\"sm\" weight=\"regular\">\n {children}\n </Text>\n </div>\n {actions && <div className={styles.actions}>{actions}</div>}\n </div>\n {/* TODO: Setup an i18n function for the aria label below */}\n {onClose && (\n <IconButton\n onClick={onClose}\n aria-label=\"Close\"\n role=\"button\"\n className={styles.close}\n >\n <CloseIcon />\n </IconButton>\n )}\n </div>\n );\n};\n"],"names":["props"],"mappings":";;;;;;;;;;AAwDO,MAAM,QAAiD,CAAC;AAAA,EAC7D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAqC;AACnC,QAAM,UAAU,WAAW,OAAO,OAAO,SAAS;AAElD,QAAM,aAAa;AAAA,IACjB,CAACA,WAAkD;AACjD,cAAQ,MAAA;AAAA,QACN,KAAK;AACH,iBAAO,oBAAC,WAAA,EAAW,GAAGA,OAAAA,CAAO;AAAA,QAC/B,KAAK;AACH,iBAAO,oBAAC,UAAA,EAAU,GAAGA,OAAAA,CAAO;AAAA,QAC9B,KAAK;AACH,iBAAO,oBAAC,iBAAA,EAAiB,GAAGA,OAAAA,CAAO;AAAA,MAAA;AAAA,IAEzC;AAAA,IACA,CAAC,IAAI;AAAA,EAAA;AAGP,8BACG,OAAA,EAAK,GAAG,OAAO,WAAW,SAAS,aAAW,MAC5C,UAAA;AAAA,IAAA,WAAW;AAAA,MACV,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,WAAW,OAAO;AAAA,MAClB,eAAe;AAAA,IAAA,CAChB;AAAA,IACD,qBAAC,OAAA,EAAI,WAAW,OAAO,SACrB,UAAA;AAAA,MAAA,qBAAC,OAAA,EAAI,WAAW,OAAO,cAAc,GACnC,UAAA;AAAA,QAAA,oBAAC,MAAA,EAAK,MAAK,MAAK,QAAO,YACpB,UAAA,OACH;AAAA,4BACC,MAAA,EAAK,MAAK,MAAK,QAAO,WACpB,SAAA,CACH;AAAA,MAAA,GACF;AAAA,MACC,WAAW,oBAAC,OAAA,EAAI,WAAW,OAAO,SAAU,UAAA,QAAA,CAAQ;AAAA,IAAA,GACvD;AAAA,IAEC,WACC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAAS;AAAA,QACT,cAAW;AAAA,QACX,MAAK;AAAA,QACL,WAAW,OAAO;AAAA,QAElB,8BAAC,WAAA,CAAA,CAAU;AAAA,MAAA;AAAA,IAAA;AAAA,EACb,GAEJ;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.cjs","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classnames from \"classnames\";\nimport React, { ComponentProps, forwardRef } from \"react\";\nimport { getInitialLetter } from \"../../utils/string\";\nimport styles from \"./Avatar.module.css\";\nimport { useIdColorHash } from \"./useIdColorHash\";\n\ntype AvatarProps = (ComponentProps<\"button\"> | ComponentProps<\"span\">) & {\n /**\n * The avatar image URL, if any.\n */\n src?: React.ComponentProps<\"img\">[\"src\"];\n /**\n * The Matrix ID, Room ID, or Alias to generate the color when no image source\n * is provided. Also used as a fallback when name is empty.\n */\n id: string;\n /**\n * The name used for the initial letter displayed when no image source is provided.\n */\n name: string;\n /**\n * Defines the avatar type, typically round, square is usually for spaces.\n * @default \"round\"\n */\n type?: \"square\" | \"round\";\n /**\n * The avatar size in CSS units, e.g. `\"24px\"`.\n */\n size?: CSSStyleDeclaration[\"height\"];\n /**\n * On click handler, will turn the avatar into a button element.\n */\n onClick?: (e: React.MouseEvent) => void;\n /**\n * Key down handler, will turn the avatar into a button element.\n */\n onKeyDown?: (e: React.KeyboardEvent) => void;\n /**\n * Key up handler, will turn the avatar into a button element.\n */\n onKeyUp?: (e: React.KeyboardEvent) => void;\n /**\n * Callback when the image has failed to load.\n */\n onError?: React.ComponentProps<\"img\">[\"onError\"];\n};\n\n/**\n * Some props warrant that the avatar become a button for accessibility purposes\n * @param props Avatar props\n * @returns whether the avatar should be a button or not\n */\nfunction shouldBeAButton(props: Partial<AvatarProps>): boolean {\n return !!(props.onClick || props.onKeyDown || props.onKeyUp);\n}\n\n/**\n * Avatar component that will fallback to an initial letter over a coloured\n * background if no source is provided or if the source has failed to load.\n */\nexport const Avatar = forwardRef<\n HTMLSpanElement | HTMLButtonElement,\n AvatarProps\n>(function Avatar(\n {\n src,\n id,\n name = \"\",\n type = \"round\",\n className = \"\",\n size,\n style = {},\n onError,\n ...props\n },\n ref,\n) {\n return React.createElement(\n shouldBeAButton(props) ? \"button\" : \"span\",\n {\n ref,\n role: \"img\",\n // Default the aria-label to id\n \"aria-label\": id,\n ...props,\n \"data-type\": type,\n \"data-color\": useIdColorHash(id),\n className: classnames(styles.avatar, className, {\n [styles[\"avatar-imageless\"]]: !src,\n }),\n style: {\n ...style,\n \"--cpd-avatar-size\": size,\n } as React.CSSProperties,\n },\n <React.Fragment>\n {!src ? (\n getInitialLetter(name)\n ) : (\n <img\n loading=\"lazy\"\n alt=\"\"\n src={src}\n referrerPolicy=\"no-referrer\"\n className={classnames(styles.image)}\n data-type={type}\n style={style}\n width={size}\n height={size}\n onError={onError}\n />\n )}\n </React.Fragment>,\n );\n});\n"],"names":["forwardRef","Avatar","useIdColorHash","classnames","styles","jsx","getInitialLetter"],"mappings":";;;;;;;;AA2DA,SAAS,gBAAgB,OAAsC;AAC7D,SAAO,CAAC,EAAE,MAAM,WAAW,MAAM,aAAa,MAAM;AACtD;AAMa,MAAA,SAASA,MAAAA,WAGpB,SAASC,QACT;AAAA,EACE;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,OAAO;AAAA,EACP,YAAY;AAAA,EACZ;AAAA,EACA,QAAQ,CAAC;AAAA,EACT;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,SAAO,MAAM;AAAA,IACX,gBAAgB,KAAK,IAAI,WAAW;AAAA,IACpC;AAAA,MACE;AAAA,MACA,MAAM;AAAA;AAAA,MAEN,cAAc;AAAA,MACd,GAAG;AAAA,MACH,aAAa;AAAA,MACb,cAAcC,8BAAe,EAAE;AAAA,MAC/B,WAAWC,WAAWC,sBAAO,QAAQ,WAAW;AAAA,QAC9C,CAACA,cAAA,QAAO,kBAAkB,CAAC,GAAG,CAAC;AAAA,MAAA,CAChC;AAAA,MACD,OAAO;AAAA,QACL,GAAG;AAAA,QACH,qBAAqB;AAAA,MAAA;AAAA,IAEzB;AAAA,IACAC,+BAAC,MAAM,UAAN,EACE,WAAC,MACAC,OAAAA,iBAAiB,IAAI,IAErBD,2BAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,KAAI;AAAA,QACJ;AAAA,QACA,gBAAe;AAAA,QACf,WAAWF,WAAWC,cAAA,QAAO,KAAK;AAAA,QAClC,aAAW;AAAA,QACX;AAAA,QACA,OAAO;AAAA,QACP,QAAQ;AAAA,QACR;AAAA,MAAA;AAAA,IAAA,EAGN,CAAA;AAAA,EACF;AACF,CAAC;;"}
1
+ {"version":3,"file":"Avatar.cjs","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classnames from \"classnames\";\nimport React, { type ComponentProps, forwardRef } from \"react\";\nimport { getInitialLetter } from \"../../utils/string\";\nimport styles from \"./Avatar.module.css\";\nimport { useIdColorHash } from \"./useIdColorHash\";\n\ntype AvatarProps = (ComponentProps<\"button\"> | ComponentProps<\"span\">) & {\n /**\n * The avatar image URL, if any.\n */\n src?: React.ComponentProps<\"img\">[\"src\"];\n /**\n * The Matrix ID, Room ID, or Alias to generate the color when no image source\n * is provided. Also used as a fallback when name is empty.\n */\n id: string;\n /**\n * The name used for the initial letter displayed when no image source is provided.\n */\n name: string;\n /**\n * Defines the avatar type, typically round, square is usually for spaces.\n * @default \"round\"\n */\n type?: \"square\" | \"round\";\n /**\n * The avatar size in CSS units, e.g. `\"24px\"`.\n */\n size?: CSSStyleDeclaration[\"height\"];\n /**\n * On click handler, will turn the avatar into a button element.\n */\n onClick?: (e: React.MouseEvent) => void;\n /**\n * Key down handler, will turn the avatar into a button element.\n */\n onKeyDown?: (e: React.KeyboardEvent) => void;\n /**\n * Key up handler, will turn the avatar into a button element.\n */\n onKeyUp?: (e: React.KeyboardEvent) => void;\n /**\n * Callback when the image has failed to load.\n */\n onError?: React.ComponentProps<\"img\">[\"onError\"];\n};\n\n/**\n * Some props warrant that the avatar become a button for accessibility purposes\n * @param props Avatar props\n * @returns whether the avatar should be a button or not\n */\nfunction shouldBeAButton(props: Partial<AvatarProps>): boolean {\n return !!(props.onClick || props.onKeyDown || props.onKeyUp);\n}\n\n/**\n * Avatar component that will fallback to an initial letter over a coloured\n * background if no source is provided or if the source has failed to load.\n */\nexport const Avatar = forwardRef<\n HTMLSpanElement | HTMLButtonElement,\n AvatarProps\n>(function Avatar(\n {\n src,\n id,\n name = \"\",\n type = \"round\",\n className = \"\",\n size,\n style = {},\n onError,\n ...props\n },\n ref,\n) {\n return React.createElement(\n shouldBeAButton(props) ? \"button\" : \"span\",\n {\n ref,\n role: \"img\",\n // Default the aria-label to id\n \"aria-label\": id,\n ...props,\n \"data-type\": type,\n \"data-color\": useIdColorHash(id),\n className: classnames(styles.avatar, className, {\n [styles[\"avatar-imageless\"]]: !src,\n }),\n style: {\n ...style,\n \"--cpd-avatar-size\": size,\n } as React.CSSProperties,\n },\n <React.Fragment>\n {!src ? (\n getInitialLetter(name)\n ) : (\n <img\n loading=\"lazy\"\n alt=\"\"\n src={src}\n referrerPolicy=\"no-referrer\"\n className={classnames(styles.image)}\n data-type={type}\n style={style}\n width={size}\n height={size}\n onError={onError}\n />\n )}\n </React.Fragment>,\n );\n});\n"],"names":["forwardRef","Avatar","useIdColorHash","classnames","styles","jsx","getInitialLetter"],"mappings":";;;;;;;;AA2DA,SAAS,gBAAgB,OAAsC;AAC7D,SAAO,CAAC,EAAE,MAAM,WAAW,MAAM,aAAa,MAAM;AACtD;AAMO,MAAM,SAASA,MAAAA,WAGpB,SAASC,QACT;AAAA,EACE;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,OAAO;AAAA,EACP,YAAY;AAAA,EACZ;AAAA,EACA,QAAQ,CAAA;AAAA,EACR;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,SAAO,MAAM;AAAA,IACX,gBAAgB,KAAK,IAAI,WAAW;AAAA,IACpC;AAAA,MACE;AAAA,MACA,MAAM;AAAA;AAAA,MAEN,cAAc;AAAA,MACd,GAAG;AAAA,MACH,aAAa;AAAA,MACb,cAAcC,eAAAA,eAAe,EAAE;AAAA,MAC/B,WAAWC,WAAWC,sBAAO,QAAQ,WAAW;AAAA,QAC9C,CAACA,cAAAA,QAAO,kBAAkB,CAAC,GAAG,CAAC;AAAA,MAAA,CAChC;AAAA,MACD,OAAO;AAAA,QACL,GAAG;AAAA,QACH,qBAAqB;AAAA,MAAA;AAAA,IACvB;AAAA,IAEFC,+BAAC,MAAM,UAAN,EACE,WAAC,MACAC,OAAAA,iBAAiB,IAAI,IAErBD,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,KAAI;AAAA,QACJ;AAAA,QACA,gBAAe;AAAA,QACf,WAAWF,WAAWC,cAAAA,QAAO,KAAK;AAAA,QAClC,aAAW;AAAA,QACX;AAAA,QACA,OAAO;AAAA,QACP,QAAQ;AAAA,QACR;AAAA,MAAA;AAAA,IAAA,EACF,CAEJ;AAAA,EAAA;AAEJ,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/Avatar.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAuD1D;;;GAGG;AACH,eAAO,MAAM,MAAM;IArDjB;;OAEG;UACG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC;IACxC;;;OAGG;QACC,MAAM;IACV;;OAEG;UACG,MAAM;IACZ;;;OAGG;WACI,QAAQ,GAAG,OAAO;IACzB;;OAEG;WACI,mBAAmB,CAAC,QAAQ,CAAC;IACpC;;OAEG;cACO,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI;IACvC;;OAEG;gBACS,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI;IAC5C;;OAEG;cACO,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI;IAC1C;;OAEG;cACO,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC;;IArChD;;OAEG;UACG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC;IACxC;;;OAGG;QACC,MAAM;IACV;;OAEG;UACG,MAAM;IACZ;;;OAGG;WACI,QAAQ,GAAG,OAAO;IACzB;;OAEG;WACI,mBAAmB,CAAC,QAAQ,CAAC;IACpC;;OAEG;cACO,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI;IACvC;;OAEG;gBACS,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI;IAC5C;;OAEG;cACO,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI;IAC1C;;OAEG;cACO,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC;sEAsEhD,CAAC"}
1
+ {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/components/Avatar/Avatar.tsx"],"names":[],"mappings":"AAQA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAuD/D;;;GAGG;AACH,eAAO,MAAM,MAAM;IArDjB;;OAEG;UACG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC;IACxC;;;OAGG;QACC,MAAM;IACV;;OAEG;UACG,MAAM;IACZ;;;OAGG;WACI,QAAQ,GAAG,OAAO;IACzB;;OAEG;WACI,mBAAmB,CAAC,QAAQ,CAAC;IACpC;;OAEG;cACO,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI;IACvC;;OAEG;gBACS,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI;IAC5C;;OAEG;cACO,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI;IAC1C;;OAEG;cACO,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC;;IArChD;;OAEG;UACG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC;IACxC;;;OAGG;QACC,MAAM;IACV;;OAEG;UACG,MAAM;IACZ;;;OAGG;WACI,QAAQ,GAAG,OAAO;IACzB;;OAEG;WACI,mBAAmB,CAAC,QAAQ,CAAC;IACpC;;OAEG;cACO,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI;IACvC;;OAEG;gBACS,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI;IAC5C;;OAEG;cACO,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI;IAC1C;;OAEG;cACO,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC;sEAsEhD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.js","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classnames from \"classnames\";\nimport React, { ComponentProps, forwardRef } from \"react\";\nimport { getInitialLetter } from \"../../utils/string\";\nimport styles from \"./Avatar.module.css\";\nimport { useIdColorHash } from \"./useIdColorHash\";\n\ntype AvatarProps = (ComponentProps<\"button\"> | ComponentProps<\"span\">) & {\n /**\n * The avatar image URL, if any.\n */\n src?: React.ComponentProps<\"img\">[\"src\"];\n /**\n * The Matrix ID, Room ID, or Alias to generate the color when no image source\n * is provided. Also used as a fallback when name is empty.\n */\n id: string;\n /**\n * The name used for the initial letter displayed when no image source is provided.\n */\n name: string;\n /**\n * Defines the avatar type, typically round, square is usually for spaces.\n * @default \"round\"\n */\n type?: \"square\" | \"round\";\n /**\n * The avatar size in CSS units, e.g. `\"24px\"`.\n */\n size?: CSSStyleDeclaration[\"height\"];\n /**\n * On click handler, will turn the avatar into a button element.\n */\n onClick?: (e: React.MouseEvent) => void;\n /**\n * Key down handler, will turn the avatar into a button element.\n */\n onKeyDown?: (e: React.KeyboardEvent) => void;\n /**\n * Key up handler, will turn the avatar into a button element.\n */\n onKeyUp?: (e: React.KeyboardEvent) => void;\n /**\n * Callback when the image has failed to load.\n */\n onError?: React.ComponentProps<\"img\">[\"onError\"];\n};\n\n/**\n * Some props warrant that the avatar become a button for accessibility purposes\n * @param props Avatar props\n * @returns whether the avatar should be a button or not\n */\nfunction shouldBeAButton(props: Partial<AvatarProps>): boolean {\n return !!(props.onClick || props.onKeyDown || props.onKeyUp);\n}\n\n/**\n * Avatar component that will fallback to an initial letter over a coloured\n * background if no source is provided or if the source has failed to load.\n */\nexport const Avatar = forwardRef<\n HTMLSpanElement | HTMLButtonElement,\n AvatarProps\n>(function Avatar(\n {\n src,\n id,\n name = \"\",\n type = \"round\",\n className = \"\",\n size,\n style = {},\n onError,\n ...props\n },\n ref,\n) {\n return React.createElement(\n shouldBeAButton(props) ? \"button\" : \"span\",\n {\n ref,\n role: \"img\",\n // Default the aria-label to id\n \"aria-label\": id,\n ...props,\n \"data-type\": type,\n \"data-color\": useIdColorHash(id),\n className: classnames(styles.avatar, className, {\n [styles[\"avatar-imageless\"]]: !src,\n }),\n style: {\n ...style,\n \"--cpd-avatar-size\": size,\n } as React.CSSProperties,\n },\n <React.Fragment>\n {!src ? (\n getInitialLetter(name)\n ) : (\n <img\n loading=\"lazy\"\n alt=\"\"\n src={src}\n referrerPolicy=\"no-referrer\"\n className={classnames(styles.image)}\n data-type={type}\n style={style}\n width={size}\n height={size}\n onError={onError}\n />\n )}\n </React.Fragment>,\n );\n});\n"],"names":["Avatar","classnames"],"mappings":";;;;;;AA2DA,SAAS,gBAAgB,OAAsC;AAC7D,SAAO,CAAC,EAAE,MAAM,WAAW,MAAM,aAAa,MAAM;AACtD;AAMa,MAAA,SAAS,WAGpB,SAASA,QACT;AAAA,EACE;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,OAAO;AAAA,EACP,YAAY;AAAA,EACZ;AAAA,EACA,QAAQ,CAAC;AAAA,EACT;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,SAAO,MAAM;AAAA,IACX,gBAAgB,KAAK,IAAI,WAAW;AAAA,IACpC;AAAA,MACE;AAAA,MACA,MAAM;AAAA;AAAA,MAEN,cAAc;AAAA,MACd,GAAG;AAAA,MACH,aAAa;AAAA,MACb,cAAc,eAAe,EAAE;AAAA,MAC/B,WAAWC,WAAW,OAAO,QAAQ,WAAW;AAAA,QAC9C,CAAC,OAAO,kBAAkB,CAAC,GAAG,CAAC;AAAA,MAAA,CAChC;AAAA,MACD,OAAO;AAAA,QACL,GAAG;AAAA,QACH,qBAAqB;AAAA,MAAA;AAAA,IAEzB;AAAA,IACA,oBAAC,MAAM,UAAN,EACE,WAAC,MACA,iBAAiB,IAAI,IAErB;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,KAAI;AAAA,QACJ;AAAA,QACA,gBAAe;AAAA,QACf,WAAWA,WAAW,OAAO,KAAK;AAAA,QAClC,aAAW;AAAA,QACX;AAAA,QACA,OAAO;AAAA,QACP,QAAQ;AAAA,QACR;AAAA,MAAA;AAAA,IAAA,EAGN,CAAA;AAAA,EACF;AACF,CAAC;"}
1
+ {"version":3,"file":"Avatar.js","sources":["../../../src/components/Avatar/Avatar.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classnames from \"classnames\";\nimport React, { type ComponentProps, forwardRef } from \"react\";\nimport { getInitialLetter } from \"../../utils/string\";\nimport styles from \"./Avatar.module.css\";\nimport { useIdColorHash } from \"./useIdColorHash\";\n\ntype AvatarProps = (ComponentProps<\"button\"> | ComponentProps<\"span\">) & {\n /**\n * The avatar image URL, if any.\n */\n src?: React.ComponentProps<\"img\">[\"src\"];\n /**\n * The Matrix ID, Room ID, or Alias to generate the color when no image source\n * is provided. Also used as a fallback when name is empty.\n */\n id: string;\n /**\n * The name used for the initial letter displayed when no image source is provided.\n */\n name: string;\n /**\n * Defines the avatar type, typically round, square is usually for spaces.\n * @default \"round\"\n */\n type?: \"square\" | \"round\";\n /**\n * The avatar size in CSS units, e.g. `\"24px\"`.\n */\n size?: CSSStyleDeclaration[\"height\"];\n /**\n * On click handler, will turn the avatar into a button element.\n */\n onClick?: (e: React.MouseEvent) => void;\n /**\n * Key down handler, will turn the avatar into a button element.\n */\n onKeyDown?: (e: React.KeyboardEvent) => void;\n /**\n * Key up handler, will turn the avatar into a button element.\n */\n onKeyUp?: (e: React.KeyboardEvent) => void;\n /**\n * Callback when the image has failed to load.\n */\n onError?: React.ComponentProps<\"img\">[\"onError\"];\n};\n\n/**\n * Some props warrant that the avatar become a button for accessibility purposes\n * @param props Avatar props\n * @returns whether the avatar should be a button or not\n */\nfunction shouldBeAButton(props: Partial<AvatarProps>): boolean {\n return !!(props.onClick || props.onKeyDown || props.onKeyUp);\n}\n\n/**\n * Avatar component that will fallback to an initial letter over a coloured\n * background if no source is provided or if the source has failed to load.\n */\nexport const Avatar = forwardRef<\n HTMLSpanElement | HTMLButtonElement,\n AvatarProps\n>(function Avatar(\n {\n src,\n id,\n name = \"\",\n type = \"round\",\n className = \"\",\n size,\n style = {},\n onError,\n ...props\n },\n ref,\n) {\n return React.createElement(\n shouldBeAButton(props) ? \"button\" : \"span\",\n {\n ref,\n role: \"img\",\n // Default the aria-label to id\n \"aria-label\": id,\n ...props,\n \"data-type\": type,\n \"data-color\": useIdColorHash(id),\n className: classnames(styles.avatar, className, {\n [styles[\"avatar-imageless\"]]: !src,\n }),\n style: {\n ...style,\n \"--cpd-avatar-size\": size,\n } as React.CSSProperties,\n },\n <React.Fragment>\n {!src ? (\n getInitialLetter(name)\n ) : (\n <img\n loading=\"lazy\"\n alt=\"\"\n src={src}\n referrerPolicy=\"no-referrer\"\n className={classnames(styles.image)}\n data-type={type}\n style={style}\n width={size}\n height={size}\n onError={onError}\n />\n )}\n </React.Fragment>,\n );\n});\n"],"names":["Avatar","classnames"],"mappings":";;;;;;AA2DA,SAAS,gBAAgB,OAAsC;AAC7D,SAAO,CAAC,EAAE,MAAM,WAAW,MAAM,aAAa,MAAM;AACtD;AAMO,MAAM,SAAS,WAGpB,SAASA,QACT;AAAA,EACE;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,OAAO;AAAA,EACP,YAAY;AAAA,EACZ;AAAA,EACA,QAAQ,CAAA;AAAA,EACR;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,SAAO,MAAM;AAAA,IACX,gBAAgB,KAAK,IAAI,WAAW;AAAA,IACpC;AAAA,MACE;AAAA,MACA,MAAM;AAAA;AAAA,MAEN,cAAc;AAAA,MACd,GAAG;AAAA,MACH,aAAa;AAAA,MACb,cAAc,eAAe,EAAE;AAAA,MAC/B,WAAWC,WAAW,OAAO,QAAQ,WAAW;AAAA,QAC9C,CAAC,OAAO,kBAAkB,CAAC,GAAG,CAAC;AAAA,MAAA,CAChC;AAAA,MACD,OAAO;AAAA,QACL,GAAG;AAAA,QACH,qBAAqB;AAAA,MAAA;AAAA,IACvB;AAAA,IAEF,oBAAC,MAAM,UAAN,EACE,WAAC,MACA,iBAAiB,IAAI,IAErB;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,KAAI;AAAA,QACJ;AAAA,QACA,gBAAe;AAAA,QACf,WAAWA,WAAW,OAAO,KAAK;AAAA,QAClC,aAAW;AAAA,QACX;AAAA,QACA,OAAO;AAAA,QACP,QAAQ;AAAA,QACR;AAAA,MAAA;AAAA,IAAA,EACF,CAEJ;AAAA,EAAA;AAEJ,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarStack.cjs","sources":["../../../src/components/Avatar/AvatarStack.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classnames from \"classnames\";\nimport React, { useEffect } from \"react\";\nimport styles from \"./Avatar.module.css\";\nimport clipMask from \"./avatar-clip.mask.svg?raw\";\n\ntype AvatarStackProps = {\n className?: string;\n};\n\nconst AVATAR_MASK_ID = \"cpdAvatarClipSvg\";\nlet AvatarStackUsageCount = 0;\n\n/**\n * Renders a stack of avatars and clips the content appropriately.\n *\n * The `type` of avatars should always be set to `round`\n * And all the avatars should have the same size.\n */\nexport const AvatarStack: React.FC<\n React.PropsWithChildren<AvatarStackProps>\n> = ({ children, className }) => {\n /**\n * The `clip-path` property in CSS supports a `path()` function, however\n * that has to use pixel values.\n * `clipPathUnits=\"objectBoundingBox\"` only exists inside an SVG document.\n * Which is why we have the external `avatar-clip.mask.svg`.\n *\n * It is possible to load this SVG externally using `url(path/to/doc.svg#id)`\n * But this is only supported in Firefox\n * This leaves us with no choice but rendering SVG inline in the HTML document\n * And making sure there is always only a single instance regardless of the\n * amount of `AvatarStack` instance in the document.\n */\n useEffect(() => {\n if (AvatarStackUsageCount === 0) {\n const svgMask = `\n <div aria-hidden=\"true\" id=\"${AVATAR_MASK_ID}\" class=\"${styles[\"clip-path\"]}\">\n ${clipMask}\n </div>\n `;\n document.body.insertAdjacentHTML(\"beforeend\", svgMask);\n }\n AvatarStackUsageCount++;\n return () => {\n AvatarStackUsageCount--;\n if (AvatarStackUsageCount <= 0) {\n // Cleanup the mask if there are no instances of `AvatarStack` left\n // on the page\n document.getElementById(AVATAR_MASK_ID)?.remove();\n }\n };\n }, []);\n\n return (\n <div className={classnames(styles[\"stacked-avatars\"], className)}>\n {children}\n </div>\n );\n};\n"],"names":["useEffect","styles","clipMask","jsx","classnames"],"mappings":";;;;;;;AAgBA,MAAM,iBAAiB;AACvB,IAAI,wBAAwB;AAQrB,MAAM,cAET,CAAC,EAAE,UAAU,gBAAgB;AAa/BA,QAAAA,UAAU,MAAM;AACd,QAAI,0BAA0B,GAAG;AAC/B,YAAM,UAAU;AAAA,sCACgB,cAAc,YAAYC,cAAO,QAAA,WAAW,CAAC;AAAA,YACvEC,gBAAQ,OAAA;AAAA;AAAA;AAGL,eAAA,KAAK,mBAAmB,aAAa,OAAO;AAAA,IAAA;AAEvD;AACA,WAAO,MAAM;AACX;AACA,UAAI,yBAAyB,GAAG;AAGrB,iBAAA,eAAe,cAAc,GAAG,OAAO;AAAA,MAAA;AAAA,IAEpD;AAAA,EACF,GAAG,EAAE;AAGH,SAAAC,+BAAC,SAAI,WAAWC,WAAWH,sBAAO,iBAAiB,GAAG,SAAS,GAC5D,UACH;AAEJ;;"}
1
+ {"version":3,"file":"AvatarStack.cjs","sources":["../../../src/components/Avatar/AvatarStack.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classnames from \"classnames\";\nimport React, { useEffect } from \"react\";\nimport styles from \"./Avatar.module.css\";\nimport clipMask from \"./avatar-clip.mask.svg?raw\";\n\ntype AvatarStackProps = {\n className?: string;\n};\n\nconst AVATAR_MASK_ID = \"cpdAvatarClipSvg\";\nlet AvatarStackUsageCount = 0;\n\n/**\n * Renders a stack of avatars and clips the content appropriately.\n *\n * The `type` of avatars should always be set to `round`\n * And all the avatars should have the same size.\n */\nexport const AvatarStack: React.FC<\n React.PropsWithChildren<AvatarStackProps>\n> = ({ children, className }) => {\n /**\n * The `clip-path` property in CSS supports a `path()` function, however\n * that has to use pixel values.\n * `clipPathUnits=\"objectBoundingBox\"` only exists inside an SVG document.\n * Which is why we have the external `avatar-clip.mask.svg`.\n *\n * It is possible to load this SVG externally using `url(path/to/doc.svg#id)`\n * But this is only supported in Firefox\n * This leaves us with no choice but rendering SVG inline in the HTML document\n * And making sure there is always only a single instance regardless of the\n * amount of `AvatarStack` instance in the document.\n */\n useEffect(() => {\n if (AvatarStackUsageCount === 0) {\n const svgMask = `\n <div aria-hidden=\"true\" id=\"${AVATAR_MASK_ID}\" class=\"${styles[\"clip-path\"]}\">\n ${clipMask}\n </div>\n `;\n document.body.insertAdjacentHTML(\"beforeend\", svgMask);\n }\n AvatarStackUsageCount++;\n return () => {\n AvatarStackUsageCount--;\n if (AvatarStackUsageCount <= 0) {\n // Cleanup the mask if there are no instances of `AvatarStack` left\n // on the page\n document.getElementById(AVATAR_MASK_ID)?.remove();\n }\n };\n }, []);\n\n return (\n <div className={classnames(styles[\"stacked-avatars\"], className)}>\n {children}\n </div>\n );\n};\n"],"names":["useEffect","styles","clipMask","jsx","classnames"],"mappings":";;;;;;;AAgBA,MAAM,iBAAiB;AACvB,IAAI,wBAAwB;AAQrB,MAAM,cAET,CAAC,EAAE,UAAU,gBAAgB;AAa/BA,QAAAA,UAAU,MAAM;AACd,QAAI,0BAA0B,GAAG;AAC/B,YAAM,UAAU;AAAA,sCACgB,cAAc,YAAYC,cAAAA,QAAO,WAAW,CAAC;AAAA,YACvEC,gBAAAA,OAAQ;AAAA;AAAA;AAGd,eAAS,KAAK,mBAAmB,aAAa,OAAO;AAAA,IACvD;AACA;AACA,WAAO,MAAM;AACX;AACA,UAAI,yBAAyB,GAAG;AAG9B,iBAAS,eAAe,cAAc,GAAG,OAAA;AAAA,MAC3C;AAAA,IACF;AAAA,EACF,GAAG,CAAA,CAAE;AAEL,SACEC,+BAAC,SAAI,WAAWC,WAAWH,sBAAO,iBAAiB,GAAG,SAAS,GAC5D,UACH;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarStack.js","sources":["../../../src/components/Avatar/AvatarStack.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classnames from \"classnames\";\nimport React, { useEffect } from \"react\";\nimport styles from \"./Avatar.module.css\";\nimport clipMask from \"./avatar-clip.mask.svg?raw\";\n\ntype AvatarStackProps = {\n className?: string;\n};\n\nconst AVATAR_MASK_ID = \"cpdAvatarClipSvg\";\nlet AvatarStackUsageCount = 0;\n\n/**\n * Renders a stack of avatars and clips the content appropriately.\n *\n * The `type` of avatars should always be set to `round`\n * And all the avatars should have the same size.\n */\nexport const AvatarStack: React.FC<\n React.PropsWithChildren<AvatarStackProps>\n> = ({ children, className }) => {\n /**\n * The `clip-path` property in CSS supports a `path()` function, however\n * that has to use pixel values.\n * `clipPathUnits=\"objectBoundingBox\"` only exists inside an SVG document.\n * Which is why we have the external `avatar-clip.mask.svg`.\n *\n * It is possible to load this SVG externally using `url(path/to/doc.svg#id)`\n * But this is only supported in Firefox\n * This leaves us with no choice but rendering SVG inline in the HTML document\n * And making sure there is always only a single instance regardless of the\n * amount of `AvatarStack` instance in the document.\n */\n useEffect(() => {\n if (AvatarStackUsageCount === 0) {\n const svgMask = `\n <div aria-hidden=\"true\" id=\"${AVATAR_MASK_ID}\" class=\"${styles[\"clip-path\"]}\">\n ${clipMask}\n </div>\n `;\n document.body.insertAdjacentHTML(\"beforeend\", svgMask);\n }\n AvatarStackUsageCount++;\n return () => {\n AvatarStackUsageCount--;\n if (AvatarStackUsageCount <= 0) {\n // Cleanup the mask if there are no instances of `AvatarStack` left\n // on the page\n document.getElementById(AVATAR_MASK_ID)?.remove();\n }\n };\n }, []);\n\n return (\n <div className={classnames(styles[\"stacked-avatars\"], className)}>\n {children}\n </div>\n );\n};\n"],"names":["classnames"],"mappings":";;;;;AAgBA,MAAM,iBAAiB;AACvB,IAAI,wBAAwB;AAQrB,MAAM,cAET,CAAC,EAAE,UAAU,gBAAgB;AAa/B,YAAU,MAAM;AACd,QAAI,0BAA0B,GAAG;AAC/B,YAAM,UAAU;AAAA,sCACgB,cAAc,YAAY,OAAO,WAAW,CAAC;AAAA,YACvE,QAAQ;AAAA;AAAA;AAGL,eAAA,KAAK,mBAAmB,aAAa,OAAO;AAAA,IAAA;AAEvD;AACA,WAAO,MAAM;AACX;AACA,UAAI,yBAAyB,GAAG;AAGrB,iBAAA,eAAe,cAAc,GAAG,OAAO;AAAA,MAAA;AAAA,IAEpD;AAAA,EACF,GAAG,EAAE;AAGH,SAAA,oBAAC,SAAI,WAAWA,WAAW,OAAO,iBAAiB,GAAG,SAAS,GAC5D,UACH;AAEJ;"}
1
+ {"version":3,"file":"AvatarStack.js","sources":["../../../src/components/Avatar/AvatarStack.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classnames from \"classnames\";\nimport React, { useEffect } from \"react\";\nimport styles from \"./Avatar.module.css\";\nimport clipMask from \"./avatar-clip.mask.svg?raw\";\n\ntype AvatarStackProps = {\n className?: string;\n};\n\nconst AVATAR_MASK_ID = \"cpdAvatarClipSvg\";\nlet AvatarStackUsageCount = 0;\n\n/**\n * Renders a stack of avatars and clips the content appropriately.\n *\n * The `type` of avatars should always be set to `round`\n * And all the avatars should have the same size.\n */\nexport const AvatarStack: React.FC<\n React.PropsWithChildren<AvatarStackProps>\n> = ({ children, className }) => {\n /**\n * The `clip-path` property in CSS supports a `path()` function, however\n * that has to use pixel values.\n * `clipPathUnits=\"objectBoundingBox\"` only exists inside an SVG document.\n * Which is why we have the external `avatar-clip.mask.svg`.\n *\n * It is possible to load this SVG externally using `url(path/to/doc.svg#id)`\n * But this is only supported in Firefox\n * This leaves us with no choice but rendering SVG inline in the HTML document\n * And making sure there is always only a single instance regardless of the\n * amount of `AvatarStack` instance in the document.\n */\n useEffect(() => {\n if (AvatarStackUsageCount === 0) {\n const svgMask = `\n <div aria-hidden=\"true\" id=\"${AVATAR_MASK_ID}\" class=\"${styles[\"clip-path\"]}\">\n ${clipMask}\n </div>\n `;\n document.body.insertAdjacentHTML(\"beforeend\", svgMask);\n }\n AvatarStackUsageCount++;\n return () => {\n AvatarStackUsageCount--;\n if (AvatarStackUsageCount <= 0) {\n // Cleanup the mask if there are no instances of `AvatarStack` left\n // on the page\n document.getElementById(AVATAR_MASK_ID)?.remove();\n }\n };\n }, []);\n\n return (\n <div className={classnames(styles[\"stacked-avatars\"], className)}>\n {children}\n </div>\n );\n};\n"],"names":["classnames"],"mappings":";;;;;AAgBA,MAAM,iBAAiB;AACvB,IAAI,wBAAwB;AAQrB,MAAM,cAET,CAAC,EAAE,UAAU,gBAAgB;AAa/B,YAAU,MAAM;AACd,QAAI,0BAA0B,GAAG;AAC/B,YAAM,UAAU;AAAA,sCACgB,cAAc,YAAY,OAAO,WAAW,CAAC;AAAA,YACvE,QAAQ;AAAA;AAAA;AAGd,eAAS,KAAK,mBAAmB,aAAa,OAAO;AAAA,IACvD;AACA;AACA,WAAO,MAAM;AACX;AACA,UAAI,yBAAyB,GAAG;AAG9B,iBAAS,eAAe,cAAc,GAAG,OAAA;AAAA,MAC3C;AAAA,IACF;AAAA,EACF,GAAG,CAAA,CAAE;AAEL,SACE,oBAAC,SAAI,WAAWA,WAAW,OAAO,iBAAiB,GAAG,SAAS,GAC5D,UACH;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"avatar-clip.mask.svg.cjs","sources":["../../../src/components/Avatar/avatar-clip.mask.svg?raw"],"sourcesContent":["export default \"<!--\\nCopyright 2023 New Vector Ltd.\\n\\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\\nPlease see LICENSE files in the repository root for full details.\\n-->\\n\\n<svg>\\n <clipPath id=\\\"cpdAvatarClip\\\" clipPathUnits=\\\"objectBoundingBox\\\">\\n <!-- \\n All values below need to be between 0 and 1\\n for objectBoundingBox to work\\n -->\\n <path d=\\\"\\n M 0.875 0.16666\\n A 0.5 0.5 0 1 0 0.875 0.83333\\n Q 0.65 0.5 0.875 0.16666\\n Z\\n \\\"/>\\n </clipPath>\\n</svg>\\n\""],"names":[],"mappings":";;AAAA,MAAe,WAAA;;"}
1
+ {"version":3,"file":"avatar-clip.mask.svg.cjs","sources":["../../../src/components/Avatar/avatar-clip.mask.svg?raw"],"sourcesContent":["export default \"<!--\\nCopyright 2023 New Vector Ltd.\\n\\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\\nPlease see LICENSE files in the repository root for full details.\\n-->\\n\\n<svg>\\n <clipPath id=\\\"cpdAvatarClip\\\" clipPathUnits=\\\"objectBoundingBox\\\">\\n <!-- \\n All values below need to be between 0 and 1\\n for objectBoundingBox to work\\n -->\\n <path d=\\\"\\n M 0.875 0.16666\\n A 0.5 0.5 0 1 0 0.875 0.83333\\n Q 0.65 0.5 0.875 0.16666\\n Z\\n \\\"/>\\n </clipPath>\\n</svg>\\n\""],"names":[],"mappings":";;AAAA,MAAA,WAAe;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"avatar-clip.mask.svg.js","sources":["../../../src/components/Avatar/avatar-clip.mask.svg?raw"],"sourcesContent":["export default \"<!--\\nCopyright 2023 New Vector Ltd.\\n\\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\\nPlease see LICENSE files in the repository root for full details.\\n-->\\n\\n<svg>\\n <clipPath id=\\\"cpdAvatarClip\\\" clipPathUnits=\\\"objectBoundingBox\\\">\\n <!-- \\n All values below need to be between 0 and 1\\n for objectBoundingBox to work\\n -->\\n <path d=\\\"\\n M 0.875 0.16666\\n A 0.5 0.5 0 1 0 0.875 0.83333\\n Q 0.65 0.5 0.875 0.16666\\n Z\\n \\\"/>\\n </clipPath>\\n</svg>\\n\""],"names":[],"mappings":"AAAA,MAAe,WAAA;"}
1
+ {"version":3,"file":"avatar-clip.mask.svg.js","sources":["../../../src/components/Avatar/avatar-clip.mask.svg?raw"],"sourcesContent":["export default \"<!--\\nCopyright 2023 New Vector Ltd.\\n\\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\\nPlease see LICENSE files in the repository root for full details.\\n-->\\n\\n<svg>\\n <clipPath id=\\\"cpdAvatarClip\\\" clipPathUnits=\\\"objectBoundingBox\\\">\\n <!-- \\n All values below need to be between 0 and 1\\n for objectBoundingBox to work\\n -->\\n <path d=\\\"\\n M 0.875 0.16666\\n A 0.5 0.5 0 1 0 0.875 0.83333\\n Q 0.65 0.5 0.875 0.16666\\n Z\\n \\\"/>\\n </clipPath>\\n</svg>\\n\""],"names":[],"mappings":"AAAA,MAAA,WAAe;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useIdColorHash.cjs","sources":["../../../src/components/Avatar/useIdColorHash.ts"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\n/**\n * Determines a number for a given Matrix ID or room ID, helps disambiguating users\n * who are trying to impersonate someone else.\n * @param id - a Matrix ID or room ID\n * @returns a hash of the ID provided\n */\nexport function useIdColorHash(id: string): number {\n const MIN = 1;\n const MAX = 6;\n // Sum up the values of all the char codes in the string\n const charCodeSum = id.split(\"\").reduce((sum, char) => {\n return sum + char.charCodeAt(0);\n }, 0);\n return (charCodeSum % MAX) + MIN;\n}\n"],"names":[],"mappings":";;AAaO,SAAS,eAAe,IAAoB;AACjD,QAAM,MAAM;AACZ,QAAM,MAAM;AAEN,QAAA,cAAc,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,KAAK,SAAS;AAC9C,WAAA,MAAM,KAAK,WAAW,CAAC;AAAA,KAC7B,CAAC;AACJ,SAAQ,cAAc,MAAO;AAC/B;;"}
1
+ {"version":3,"file":"useIdColorHash.cjs","sources":["../../../src/components/Avatar/useIdColorHash.ts"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\n/**\n * Determines a number for a given Matrix ID or room ID, helps disambiguating users\n * who are trying to impersonate someone else.\n * @param id - a Matrix ID or room ID\n * @returns a hash of the ID provided\n */\nexport function useIdColorHash(id: string): number {\n const MIN = 1;\n const MAX = 6;\n // Sum up the values of all the char codes in the string\n const charCodeSum = id.split(\"\").reduce((sum, char) => {\n return sum + char.charCodeAt(0);\n }, 0);\n return (charCodeSum % MAX) + MIN;\n}\n"],"names":[],"mappings":";;AAaO,SAAS,eAAe,IAAoB;AACjD,QAAM,MAAM;AACZ,QAAM,MAAM;AAEZ,QAAM,cAAc,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,KAAK,SAAS;AACrD,WAAO,MAAM,KAAK,WAAW,CAAC;AAAA,EAChC,GAAG,CAAC;AACJ,SAAQ,cAAc,MAAO;AAC/B;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useIdColorHash.js","sources":["../../../src/components/Avatar/useIdColorHash.ts"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\n/**\n * Determines a number for a given Matrix ID or room ID, helps disambiguating users\n * who are trying to impersonate someone else.\n * @param id - a Matrix ID or room ID\n * @returns a hash of the ID provided\n */\nexport function useIdColorHash(id: string): number {\n const MIN = 1;\n const MAX = 6;\n // Sum up the values of all the char codes in the string\n const charCodeSum = id.split(\"\").reduce((sum, char) => {\n return sum + char.charCodeAt(0);\n }, 0);\n return (charCodeSum % MAX) + MIN;\n}\n"],"names":[],"mappings":"AAaO,SAAS,eAAe,IAAoB;AACjD,QAAM,MAAM;AACZ,QAAM,MAAM;AAEN,QAAA,cAAc,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,KAAK,SAAS;AAC9C,WAAA,MAAM,KAAK,WAAW,CAAC;AAAA,KAC7B,CAAC;AACJ,SAAQ,cAAc,MAAO;AAC/B;"}
1
+ {"version":3,"file":"useIdColorHash.js","sources":["../../../src/components/Avatar/useIdColorHash.ts"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\n/**\n * Determines a number for a given Matrix ID or room ID, helps disambiguating users\n * who are trying to impersonate someone else.\n * @param id - a Matrix ID or room ID\n * @returns a hash of the ID provided\n */\nexport function useIdColorHash(id: string): number {\n const MIN = 1;\n const MAX = 6;\n // Sum up the values of all the char codes in the string\n const charCodeSum = id.split(\"\").reduce((sum, char) => {\n return sum + char.charCodeAt(0);\n }, 0);\n return (charCodeSum % MAX) + MIN;\n}\n"],"names":[],"mappings":"AAaO,SAAS,eAAe,IAAoB;AACjD,QAAM,MAAM;AACZ,QAAM,MAAM;AAEZ,QAAM,cAAc,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,KAAK,SAAS;AACrD,WAAO,MAAM,KAAK,WAAW,CAAC;AAAA,EAChC,GAAG,CAAC;AACJ,SAAQ,cAAc,MAAO;AAC/B;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.cjs","sources":["../../../src/components/Badge/Badge.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classnames from \"classnames\";\nimport React, { PropsWithChildren } from \"react\";\nimport styles from \"./Badge.module.css\";\nimport { Typography } from \"../Typography/Typography\";\n\ntype BadgeProps = {\n /**\n * The CSS class name.\n */\n className?: string;\n /**\n * The type of badge.\n */\n kind?: \"default\" | \"grey\" | \"on-solid\" | \"blue\" | \"green\" | \"red\";\n};\n\n/**\n * A Badge component.\n */\nexport const Badge: React.FC<PropsWithChildren<BadgeProps>> = ({\n children,\n kind = \"default\",\n className,\n}) => {\n const classes = classnames(styles.badge, className);\n return (\n <Typography\n as=\"span\"\n size=\"sm\"\n weight=\"medium\"\n className={classes}\n data-kind={kind}\n >\n {children}\n </Typography>\n );\n};\n"],"names":["classnames","styles","jsx","Typography"],"mappings":";;;;;;AA0BO,MAAM,QAAiD,CAAC;AAAA,EAC7D;AAAA,EACA,OAAO;AAAA,EACP;AACF,MAAM;AACJ,QAAM,UAAUA,WAAWC,qBAAO,OAAO,SAAS;AAEhD,SAAAC,2BAAA;AAAA,IAACC,WAAA;AAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH,MAAK;AAAA,MACL,QAAO;AAAA,MACP,WAAW;AAAA,MACX,aAAW;AAAA,MAEV;AAAA,IAAA;AAAA,EACH;AAEJ;;"}
1
+ {"version":3,"file":"Badge.cjs","sources":["../../../src/components/Badge/Badge.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classnames from \"classnames\";\nimport React, { type PropsWithChildren } from \"react\";\nimport styles from \"./Badge.module.css\";\nimport { Typography } from \"../Typography/Typography\";\n\ntype BadgeProps = {\n /**\n * The CSS class name.\n */\n className?: string;\n /**\n * The type of badge.\n */\n kind?: \"default\" | \"grey\" | \"on-solid\" | \"blue\" | \"green\" | \"red\";\n};\n\n/**\n * A Badge component.\n */\nexport const Badge: React.FC<PropsWithChildren<BadgeProps>> = ({\n children,\n kind = \"default\",\n className,\n}) => {\n const classes = classnames(styles.badge, className);\n return (\n <Typography\n as=\"span\"\n size=\"sm\"\n weight=\"medium\"\n className={classes}\n data-kind={kind}\n >\n {children}\n </Typography>\n );\n};\n"],"names":["classnames","styles","jsx","Typography"],"mappings":";;;;;;AA0BO,MAAM,QAAiD,CAAC;AAAA,EAC7D;AAAA,EACA,OAAO;AAAA,EACP;AACF,MAAM;AACJ,QAAM,UAAUA,WAAWC,qBAAO,OAAO,SAAS;AAClD,SACEC,2BAAAA;AAAAA,IAACC,WAAAA;AAAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH,MAAK;AAAA,MACL,QAAO;AAAA,MACP,WAAW;AAAA,MACX,aAAW;AAAA,MAEV;AAAA,IAAA;AAAA,EAAA;AAGP;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAIjD,KAAK,UAAU,GAAG;IAChB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;CACnE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAiBzD,CAAC"}
1
+ {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAItD,KAAK,UAAU,GAAG;IAChB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;CACnE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAiBzD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.js","sources":["../../../src/components/Badge/Badge.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classnames from \"classnames\";\nimport React, { PropsWithChildren } from \"react\";\nimport styles from \"./Badge.module.css\";\nimport { Typography } from \"../Typography/Typography\";\n\ntype BadgeProps = {\n /**\n * The CSS class name.\n */\n className?: string;\n /**\n * The type of badge.\n */\n kind?: \"default\" | \"grey\" | \"on-solid\" | \"blue\" | \"green\" | \"red\";\n};\n\n/**\n * A Badge component.\n */\nexport const Badge: React.FC<PropsWithChildren<BadgeProps>> = ({\n children,\n kind = \"default\",\n className,\n}) => {\n const classes = classnames(styles.badge, className);\n return (\n <Typography\n as=\"span\"\n size=\"sm\"\n weight=\"medium\"\n className={classes}\n data-kind={kind}\n >\n {children}\n </Typography>\n );\n};\n"],"names":["classnames"],"mappings":";;;;AA0BO,MAAM,QAAiD,CAAC;AAAA,EAC7D;AAAA,EACA,OAAO;AAAA,EACP;AACF,MAAM;AACJ,QAAM,UAAUA,WAAW,OAAO,OAAO,SAAS;AAEhD,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH,MAAK;AAAA,MACL,QAAO;AAAA,MACP,WAAW;AAAA,MACX,aAAW;AAAA,MAEV;AAAA,IAAA;AAAA,EACH;AAEJ;"}
1
+ {"version":3,"file":"Badge.js","sources":["../../../src/components/Badge/Badge.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classnames from \"classnames\";\nimport React, { type PropsWithChildren } from \"react\";\nimport styles from \"./Badge.module.css\";\nimport { Typography } from \"../Typography/Typography\";\n\ntype BadgeProps = {\n /**\n * The CSS class name.\n */\n className?: string;\n /**\n * The type of badge.\n */\n kind?: \"default\" | \"grey\" | \"on-solid\" | \"blue\" | \"green\" | \"red\";\n};\n\n/**\n * A Badge component.\n */\nexport const Badge: React.FC<PropsWithChildren<BadgeProps>> = ({\n children,\n kind = \"default\",\n className,\n}) => {\n const classes = classnames(styles.badge, className);\n return (\n <Typography\n as=\"span\"\n size=\"sm\"\n weight=\"medium\"\n className={classes}\n data-kind={kind}\n >\n {children}\n </Typography>\n );\n};\n"],"names":["classnames"],"mappings":";;;;AA0BO,MAAM,QAAiD,CAAC;AAAA,EAC7D;AAAA,EACA,OAAO;AAAA,EACP;AACF,MAAM;AACJ,QAAM,UAAUA,WAAW,OAAO,OAAO,SAAS;AAClD,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH,MAAK;AAAA,MACL,QAAO;AAAA,MACP,WAAW;AAAA,MACX,aAAW;AAAA,MAEV;AAAA,IAAA;AAAA,EAAA;AAGP;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumb.cjs","sources":["../../../src/components/Breadcrumb/Breadcrumb.tsx"],"sourcesContent":["/*\nCopyright 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { HTMLProps, JSX, MouseEventHandler, KeyboardEvent } from \"react\";\nimport { IconButton } from \"../Button\";\nimport Chevron from \"@vector-im/compound-design-tokens/assets/web/icons/chevron-left\";\nimport styles from \"./Breadcrumb.module.css\";\nimport { Link } from \"../Link/Link.tsx\";\nimport classNames from \"classnames\";\n\ninterface BreadcrumbProps extends HTMLProps<HTMLElement> {\n /**\n * The label for the back button.\n */\n backLabel: string;\n /**\n * The click handler for the back button.\n */\n onBackClick: MouseEventHandler<HTMLButtonElement>;\n /**\n * The pages to display in the breadcrumb.\n * All the pages except the last one are displayed as links.\n */\n pages: string[];\n /**\n * The click handler for a page.\n * @param page - The page that was clicked.\n * @param index - The index of the page that was clicked.\n */\n onPageClick: (page: string, index: number) => void;\n}\n\n/**\n * A breadcrumb component.\n */\nexport function Breadcrumb({\n backLabel,\n onBackClick,\n pages,\n onPageClick,\n className,\n ...props\n}: BreadcrumbProps): JSX.Element {\n return (\n <nav className={classNames(styles.breadcrumb, className)} {...props}>\n <IconButton\n kind=\"secondary\"\n size=\"28px\"\n aria-label={backLabel}\n onClick={onBackClick}\n >\n <Chevron />\n </IconButton>\n <ol className={styles.pages}>\n {pages.map((page, index) => (\n <Page\n key={index}\n page={page}\n isLastPage={index === pages.length - 1}\n onClick={() => onPageClick(page, index)}\n />\n ))}\n </ol>\n </nav>\n );\n}\n\ninterface PageProps {\n /**\n * The page to display.\n */\n page: string;\n /**\n * Whether this is the last page in the breadcrumb.\n */\n isLastPage: boolean;\n /**\n * The click handler for the page, ignore for last page.\n */\n onClick: () => void;\n}\n\n/**\n * A breadcrumb page.\n * If not the last page, the page is displayed in a link.\n */\nfunction Page({ page, isLastPage, onClick }: PageProps): JSX.Element {\n const onKeyDown = (event: KeyboardEvent<HTMLAnchorElement>) => {\n if (event.key === \" \") {\n onClick();\n }\n };\n\n return (\n <li>\n {isLastPage ? (\n <span className={styles[\"last-page\"]} aria-current=\"page\">\n {page}\n </span>\n ) : (\n <Link\n size=\"small\"\n role=\"button\"\n onClick={onClick}\n onKeyDown={onKeyDown}\n tabIndex={0}\n >\n {page}\n </Link>\n )}\n </li>\n );\n}\n"],"names":["jsxs","styles","jsx","IconButton","Link"],"mappings":";;;;;;;;AAuCO,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAiC;AAE7B,SAAAA,gCAAC,SAAI,WAAW,WAAWC,0BAAO,YAAY,SAAS,GAAI,GAAG,OAC5D,UAAA;AAAA,IAAAC,2BAAA;AAAA,MAACC,WAAA;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,SAAS;AAAA,QAET,yCAAC,SAAQ,CAAA,CAAA;AAAA,MAAA;AAAA,IACX;AAAA,IACAD,2BAAAA,IAAC,QAAG,WAAWD,kBAAA,QAAO,OACnB,UAAM,MAAA,IAAI,CAAC,MAAM,UAChBC,2BAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC;AAAA,QACA,YAAY,UAAU,MAAM,SAAS;AAAA,QACrC,SAAS,MAAM,YAAY,MAAM,KAAK;AAAA,MAAA;AAAA,MAHjC;AAAA,IAAA,CAKR,EACH,CAAA;AAAA,EAAA,GACF;AAEJ;AAqBA,SAAS,KAAK,EAAE,MAAM,YAAY,WAAmC;AAC7D,QAAA,YAAY,CAAC,UAA4C;AACzD,QAAA,MAAM,QAAQ,KAAK;AACb,cAAA;AAAA,IAAA;AAAA,EAEZ;AAEA,SACGA,2BAAAA,IAAA,MAAA,EACE,UACC,aAAAA,2BAAAA,IAAC,QAAK,EAAA,WAAWD,kBAAAA,QAAO,WAAW,GAAG,gBAAa,QAChD,UAAA,KACH,CAAA,IAEAC,2BAAA;AAAA,IAACE,KAAA;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,MAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MAET,UAAA;AAAA,IAAA;AAAA,EAAA,GAGP;AAEJ;;"}
1
+ {"version":3,"file":"Breadcrumb.cjs","sources":["../../../src/components/Breadcrumb/Breadcrumb.tsx"],"sourcesContent":["/*\nCopyright 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, {\n type HTMLProps,\n type JSX,\n type MouseEventHandler,\n type KeyboardEvent,\n} from \"react\";\nimport { IconButton } from \"../Button\";\nimport Chevron from \"@vector-im/compound-design-tokens/assets/web/icons/chevron-left\";\nimport styles from \"./Breadcrumb.module.css\";\nimport { Link } from \"../Link/Link.tsx\";\nimport classNames from \"classnames\";\n\ninterface BreadcrumbProps extends HTMLProps<HTMLElement> {\n /**\n * The label for the back button.\n */\n backLabel: string;\n /**\n * The click handler for the back button.\n */\n onBackClick: MouseEventHandler<HTMLButtonElement>;\n /**\n * The pages to display in the breadcrumb.\n * All the pages except the last one are displayed as links.\n */\n pages: string[];\n /**\n * The click handler for a page.\n * @param page - The page that was clicked.\n * @param index - The index of the page that was clicked.\n */\n onPageClick: (page: string, index: number) => void;\n}\n\n/**\n * A breadcrumb component.\n */\nexport function Breadcrumb({\n backLabel,\n onBackClick,\n pages,\n onPageClick,\n className,\n ...props\n}: BreadcrumbProps): JSX.Element {\n return (\n <nav className={classNames(styles.breadcrumb, className)} {...props}>\n <IconButton\n kind=\"secondary\"\n size=\"28px\"\n aria-label={backLabel}\n onClick={onBackClick}\n >\n <Chevron />\n </IconButton>\n <ol className={styles.pages}>\n {pages.map((page, index) => (\n <Page\n key={index}\n page={page}\n isLastPage={index === pages.length - 1}\n onClick={() => onPageClick(page, index)}\n />\n ))}\n </ol>\n </nav>\n );\n}\n\ninterface PageProps {\n /**\n * The page to display.\n */\n page: string;\n /**\n * Whether this is the last page in the breadcrumb.\n */\n isLastPage: boolean;\n /**\n * The click handler for the page, ignore for last page.\n */\n onClick: () => void;\n}\n\n/**\n * A breadcrumb page.\n * If not the last page, the page is displayed in a link.\n */\nfunction Page({ page, isLastPage, onClick }: PageProps): JSX.Element {\n const onKeyDown = (event: KeyboardEvent<HTMLAnchorElement>) => {\n if (event.key === \" \") {\n onClick();\n }\n };\n\n return (\n <li>\n {isLastPage ? (\n <span className={styles[\"last-page\"]} aria-current=\"page\">\n {page}\n </span>\n ) : (\n <Link\n size=\"small\"\n role=\"button\"\n onClick={onClick}\n onKeyDown={onKeyDown}\n tabIndex={0}\n >\n {page}\n </Link>\n )}\n </li>\n );\n}\n"],"names":["jsxs","styles","jsx","IconButton","Link"],"mappings":";;;;;;;;AA4CO,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAiC;AAC/B,SACEA,gCAAC,SAAI,WAAW,WAAWC,0BAAO,YAAY,SAAS,GAAI,GAAG,OAC5D,UAAA;AAAA,IAAAC,2BAAAA;AAAAA,MAACC,WAAAA;AAAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,SAAS;AAAA,QAET,yCAAC,SAAA,CAAA,CAAQ;AAAA,MAAA;AAAA,IAAA;AAAA,IAEXD,2BAAAA,IAAC,QAAG,WAAWD,kBAAAA,QAAO,OACnB,UAAA,MAAM,IAAI,CAAC,MAAM,UAChBC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QAEC;AAAA,QACA,YAAY,UAAU,MAAM,SAAS;AAAA,QACrC,SAAS,MAAM,YAAY,MAAM,KAAK;AAAA,MAAA;AAAA,MAHjC;AAAA,IAAA,CAKR,EAAA,CACH;AAAA,EAAA,GACF;AAEJ;AAqBA,SAAS,KAAK,EAAE,MAAM,YAAY,WAAmC;AACnE,QAAM,YAAY,CAAC,UAA4C;AAC7D,QAAI,MAAM,QAAQ,KAAK;AACrB,cAAA;AAAA,IACF;AAAA,EACF;AAEA,SACEA,2BAAAA,IAAC,MAAA,EACE,UAAA,aACCA,2BAAAA,IAAC,QAAA,EAAK,WAAWD,kBAAAA,QAAO,WAAW,GAAG,gBAAa,QAChD,UAAA,KAAA,CACH,IAEAC,2BAAAA;AAAAA,IAACE,KAAAA;AAAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,MAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MAET,UAAA;AAAA,IAAA;AAAA,EAAA,GAGP;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumb.d.ts","sourceRoot":"","sources":["../../../src/components/Breadcrumb/Breadcrumb.tsx"],"names":[],"mappings":"AAOA,OAAc,EAAE,SAAS,EAAE,GAAG,EAAE,iBAAiB,EAAiB,MAAM,OAAO,CAAC;AAOhF,UAAU,eAAgB,SAAQ,SAAS,CAAC,WAAW,CAAC;IACtD;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,WAAW,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAClD;;;OAGG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;;;;OAIG;IACH,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,WAAW,EACX,KAAK,EACL,WAAW,EACX,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,GAAG,GAAG,CAAC,OAAO,CAuB/B"}
1
+ {"version":3,"file":"Breadcrumb.d.ts","sourceRoot":"","sources":["../../../src/components/Breadcrumb/Breadcrumb.tsx"],"names":[],"mappings":"AAOA,OAAc,EACZ,KAAK,SAAS,EACd,KAAK,GAAG,EACR,KAAK,iBAAiB,EAEvB,MAAM,OAAO,CAAC;AAOf,UAAU,eAAgB,SAAQ,SAAS,CAAC,WAAW,CAAC;IACtD;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,WAAW,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAClD;;;OAGG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;;;;OAIG;IACH,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,WAAW,EACX,KAAK,EACL,WAAW,EACX,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,GAAG,GAAG,CAAC,OAAO,CAuB/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumb.js","sources":["../../../src/components/Breadcrumb/Breadcrumb.tsx"],"sourcesContent":["/*\nCopyright 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { HTMLProps, JSX, MouseEventHandler, KeyboardEvent } from \"react\";\nimport { IconButton } from \"../Button\";\nimport Chevron from \"@vector-im/compound-design-tokens/assets/web/icons/chevron-left\";\nimport styles from \"./Breadcrumb.module.css\";\nimport { Link } from \"../Link/Link.tsx\";\nimport classNames from \"classnames\";\n\ninterface BreadcrumbProps extends HTMLProps<HTMLElement> {\n /**\n * The label for the back button.\n */\n backLabel: string;\n /**\n * The click handler for the back button.\n */\n onBackClick: MouseEventHandler<HTMLButtonElement>;\n /**\n * The pages to display in the breadcrumb.\n * All the pages except the last one are displayed as links.\n */\n pages: string[];\n /**\n * The click handler for a page.\n * @param page - The page that was clicked.\n * @param index - The index of the page that was clicked.\n */\n onPageClick: (page: string, index: number) => void;\n}\n\n/**\n * A breadcrumb component.\n */\nexport function Breadcrumb({\n backLabel,\n onBackClick,\n pages,\n onPageClick,\n className,\n ...props\n}: BreadcrumbProps): JSX.Element {\n return (\n <nav className={classNames(styles.breadcrumb, className)} {...props}>\n <IconButton\n kind=\"secondary\"\n size=\"28px\"\n aria-label={backLabel}\n onClick={onBackClick}\n >\n <Chevron />\n </IconButton>\n <ol className={styles.pages}>\n {pages.map((page, index) => (\n <Page\n key={index}\n page={page}\n isLastPage={index === pages.length - 1}\n onClick={() => onPageClick(page, index)}\n />\n ))}\n </ol>\n </nav>\n );\n}\n\ninterface PageProps {\n /**\n * The page to display.\n */\n page: string;\n /**\n * Whether this is the last page in the breadcrumb.\n */\n isLastPage: boolean;\n /**\n * The click handler for the page, ignore for last page.\n */\n onClick: () => void;\n}\n\n/**\n * A breadcrumb page.\n * If not the last page, the page is displayed in a link.\n */\nfunction Page({ page, isLastPage, onClick }: PageProps): JSX.Element {\n const onKeyDown = (event: KeyboardEvent<HTMLAnchorElement>) => {\n if (event.key === \" \") {\n onClick();\n }\n };\n\n return (\n <li>\n {isLastPage ? (\n <span className={styles[\"last-page\"]} aria-current=\"page\">\n {page}\n </span>\n ) : (\n <Link\n size=\"small\"\n role=\"button\"\n onClick={onClick}\n onKeyDown={onKeyDown}\n tabIndex={0}\n >\n {page}\n </Link>\n )}\n </li>\n );\n}\n"],"names":[],"mappings":";;;;;;AAuCO,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAiC;AAE7B,SAAA,qBAAC,SAAI,WAAW,WAAW,OAAO,YAAY,SAAS,GAAI,GAAG,OAC5D,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,SAAS;AAAA,QAET,8BAAC,SAAQ,CAAA,CAAA;AAAA,MAAA;AAAA,IACX;AAAA,IACA,oBAAC,QAAG,WAAW,OAAO,OACnB,UAAM,MAAA,IAAI,CAAC,MAAM,UAChB;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC;AAAA,QACA,YAAY,UAAU,MAAM,SAAS;AAAA,QACrC,SAAS,MAAM,YAAY,MAAM,KAAK;AAAA,MAAA;AAAA,MAHjC;AAAA,IAAA,CAKR,EACH,CAAA;AAAA,EAAA,GACF;AAEJ;AAqBA,SAAS,KAAK,EAAE,MAAM,YAAY,WAAmC;AAC7D,QAAA,YAAY,CAAC,UAA4C;AACzD,QAAA,MAAM,QAAQ,KAAK;AACb,cAAA;AAAA,IAAA;AAAA,EAEZ;AAEA,SACG,oBAAA,MAAA,EACE,UACC,aAAA,oBAAC,QAAK,EAAA,WAAW,OAAO,WAAW,GAAG,gBAAa,QAChD,UAAA,KACH,CAAA,IAEA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,MAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MAET,UAAA;AAAA,IAAA;AAAA,EAAA,GAGP;AAEJ;"}
1
+ {"version":3,"file":"Breadcrumb.js","sources":["../../../src/components/Breadcrumb/Breadcrumb.tsx"],"sourcesContent":["/*\nCopyright 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, {\n type HTMLProps,\n type JSX,\n type MouseEventHandler,\n type KeyboardEvent,\n} from \"react\";\nimport { IconButton } from \"../Button\";\nimport Chevron from \"@vector-im/compound-design-tokens/assets/web/icons/chevron-left\";\nimport styles from \"./Breadcrumb.module.css\";\nimport { Link } from \"../Link/Link.tsx\";\nimport classNames from \"classnames\";\n\ninterface BreadcrumbProps extends HTMLProps<HTMLElement> {\n /**\n * The label for the back button.\n */\n backLabel: string;\n /**\n * The click handler for the back button.\n */\n onBackClick: MouseEventHandler<HTMLButtonElement>;\n /**\n * The pages to display in the breadcrumb.\n * All the pages except the last one are displayed as links.\n */\n pages: string[];\n /**\n * The click handler for a page.\n * @param page - The page that was clicked.\n * @param index - The index of the page that was clicked.\n */\n onPageClick: (page: string, index: number) => void;\n}\n\n/**\n * A breadcrumb component.\n */\nexport function Breadcrumb({\n backLabel,\n onBackClick,\n pages,\n onPageClick,\n className,\n ...props\n}: BreadcrumbProps): JSX.Element {\n return (\n <nav className={classNames(styles.breadcrumb, className)} {...props}>\n <IconButton\n kind=\"secondary\"\n size=\"28px\"\n aria-label={backLabel}\n onClick={onBackClick}\n >\n <Chevron />\n </IconButton>\n <ol className={styles.pages}>\n {pages.map((page, index) => (\n <Page\n key={index}\n page={page}\n isLastPage={index === pages.length - 1}\n onClick={() => onPageClick(page, index)}\n />\n ))}\n </ol>\n </nav>\n );\n}\n\ninterface PageProps {\n /**\n * The page to display.\n */\n page: string;\n /**\n * Whether this is the last page in the breadcrumb.\n */\n isLastPage: boolean;\n /**\n * The click handler for the page, ignore for last page.\n */\n onClick: () => void;\n}\n\n/**\n * A breadcrumb page.\n * If not the last page, the page is displayed in a link.\n */\nfunction Page({ page, isLastPage, onClick }: PageProps): JSX.Element {\n const onKeyDown = (event: KeyboardEvent<HTMLAnchorElement>) => {\n if (event.key === \" \") {\n onClick();\n }\n };\n\n return (\n <li>\n {isLastPage ? (\n <span className={styles[\"last-page\"]} aria-current=\"page\">\n {page}\n </span>\n ) : (\n <Link\n size=\"small\"\n role=\"button\"\n onClick={onClick}\n onKeyDown={onKeyDown}\n tabIndex={0}\n >\n {page}\n </Link>\n )}\n </li>\n );\n}\n"],"names":[],"mappings":";;;;;;AA4CO,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAiC;AAC/B,SACE,qBAAC,SAAI,WAAW,WAAW,OAAO,YAAY,SAAS,GAAI,GAAG,OAC5D,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,MAAK;AAAA,QACL,cAAY;AAAA,QACZ,SAAS;AAAA,QAET,8BAAC,SAAA,CAAA,CAAQ;AAAA,MAAA;AAAA,IAAA;AAAA,IAEX,oBAAC,QAAG,WAAW,OAAO,OACnB,UAAA,MAAM,IAAI,CAAC,MAAM,UAChB;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC;AAAA,QACA,YAAY,UAAU,MAAM,SAAS;AAAA,QACrC,SAAS,MAAM,YAAY,MAAM,KAAK;AAAA,MAAA;AAAA,MAHjC;AAAA,IAAA,CAKR,EAAA,CACH;AAAA,EAAA,GACF;AAEJ;AAqBA,SAAS,KAAK,EAAE,MAAM,YAAY,WAAmC;AACnE,QAAM,YAAY,CAAC,UAA4C;AAC7D,QAAI,MAAM,QAAQ,KAAK;AACrB,cAAA;AAAA,IACF;AAAA,EACF;AAEA,SACE,oBAAC,MAAA,EACE,UAAA,aACC,oBAAC,QAAA,EAAK,WAAW,OAAO,WAAW,GAAG,gBAAa,QAChD,UAAA,KAAA,CACH,IAEA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,MAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MAET,UAAA;AAAA,IAAA;AAAA,EAAA,GAGP;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Button.cjs","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["/*\nCopyright 2023, 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classNames from \"classnames\";\nimport React, {\n ComponentType,\n PropsWithChildren,\n forwardRef,\n ForwardedRef,\n Ref,\n} from \"react\";\nimport styles from \"./Button.module.css\";\nimport { UnstyledButton, UnstyledButtonPropsFor } from \"./UnstyledButton\";\n\ninterface ButtonComponent {\n // With the explicit `as` prop\n <C extends React.ElementType>(\n props: { as: C } & ButtonPropsFor<C>,\n ): React.ReactElement;\n // Without the explicit `as` prop, defaulting to a <button>\n (props: ButtonPropsFor<\"button\">): React.ReactElement;\n}\n\ntype ButtonOwnProps = PropsWithChildren<{\n /**\n * The type of button.\n * Note: \"destructive\" is deprecated, please use the destructive prop in\n * conjunction with another button kind.\n */\n kind?: \"primary\" | \"secondary\" | \"tertiary\" | \"destructive\";\n /**\n * The t-shirt size of the button.\n */\n size?: \"sm\" | \"lg\";\n\n /**\n * Whether the button is an icon only button.\n */\n iconOnly?: boolean;\n\n /**\n * An icon to display within the button.\n */\n Icon?: ComponentType<React.SVGAttributes<SVGElement>>;\n /**\n * Whether this button triggers a destructive action.\n * @default false\n */\n destructive?: boolean;\n}>;\n\ntype ButtonPropsFor<C extends React.ElementType> = ButtonOwnProps &\n UnstyledButtonPropsFor<C>;\n\n/**\n * A button component that can be transformed into a link, but keep the button\n * styling using the `as` property.\n */\nexport const Button = forwardRef(function Button<\n C extends React.ElementType = \"button\",\n>(\n {\n as,\n kind: kindProp = \"primary\",\n size = \"lg\",\n children,\n className,\n iconOnly,\n Icon,\n destructive: destructiveProp,\n disabled,\n ...props\n }: ButtonPropsFor<C> & { as?: C },\n ref: ForwardedRef<C>,\n): React.ReactElement {\n // Fallback for the deprecated \"destructive\" kind\n const [kind, destructive] =\n kindProp === \"destructive\"\n ? [\"secondary\", true]\n : [kindProp, destructiveProp];\n\n const classes = classNames(styles.button, className, {\n [styles[\"has-icon\"]]: Icon,\n [styles[\"icon-only\"]]: iconOnly,\n [styles.destructive]: destructive,\n });\n\n const iconSize = iconOnly && size === \"lg\" ? 24 : 20;\n\n return (\n <UnstyledButton\n {...props}\n as={as || (\"button\" as const)}\n ref={ref as Ref<C>}\n className={classes}\n data-size={size}\n data-kind={kind}\n tabIndex={0}\n disabled={disabled}\n >\n {Icon && (\n <Icon\n width={iconSize}\n height={iconSize}\n className={styles.icon}\n aria-hidden={true}\n />\n )}\n {children}\n </UnstyledButton>\n );\n}) as ButtonComponent;\n"],"names":["forwardRef","Button","styles","jsxs","UnstyledButton","jsx"],"mappings":";;;;;;;AA8Da,MAAA,SAASA,MAAAA,WAAW,SAASC,QAGxC;AAAA,EACE;AAAA,EACA,MAAM,WAAW;AAAA,EACjB,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA,GAAG;AACL,GACA,KACoB;AAEpB,QAAM,CAAC,MAAM,WAAW,IACtB,aAAa,gBACT,CAAC,aAAa,IAAI,IAClB,CAAC,UAAU,eAAe;AAEhC,QAAM,UAAU,WAAWC,sBAAO,QAAQ,WAAW;AAAA,IACnD,CAACA,cAAA,QAAO,UAAU,CAAC,GAAG;AAAA,IACtB,CAACA,cAAA,QAAO,WAAW,CAAC,GAAG;AAAA,IACvB,CAACA,cAAAA,QAAO,WAAW,GAAG;AAAA,EAAA,CACvB;AAED,QAAM,WAAW,YAAY,SAAS,OAAO,KAAK;AAGhD,SAAAC,2BAAA;AAAA,IAACC,eAAA;AAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ,IAAI,MAAO;AAAA,MACX;AAAA,MACA,WAAW;AAAA,MACX,aAAW;AAAA,MACX,aAAW;AAAA,MACX,UAAU;AAAA,MACV;AAAA,MAEC,UAAA;AAAA,QACC,QAAAC,2BAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,WAAWH,cAAO,QAAA;AAAA,YAClB,eAAa;AAAA,UAAA;AAAA,QACf;AAAA,QAED;AAAA,MAAA;AAAA,IAAA;AAAA,EACH;AAEJ,CAAC;;"}
1
+ {"version":3,"file":"Button.cjs","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["/*\nCopyright 2023, 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classNames from \"classnames\";\nimport React, {\n type ComponentType,\n type PropsWithChildren,\n forwardRef,\n type ForwardedRef,\n type Ref,\n} from \"react\";\nimport styles from \"./Button.module.css\";\nimport { UnstyledButton, type UnstyledButtonPropsFor } from \"./UnstyledButton\";\n\ninterface ButtonComponent {\n // With the explicit `as` prop\n <C extends React.ElementType>(\n props: { as: C } & ButtonPropsFor<C>,\n ): React.ReactElement;\n // Without the explicit `as` prop, defaulting to a <button>\n (props: ButtonPropsFor<\"button\">): React.ReactElement;\n}\n\ntype ButtonOwnProps = PropsWithChildren<{\n /**\n * The type of button.\n * Note: \"destructive\" is deprecated, please use the destructive prop in\n * conjunction with another button kind.\n */\n kind?: \"primary\" | \"secondary\" | \"tertiary\" | \"destructive\";\n /**\n * The t-shirt size of the button.\n */\n size?: \"sm\" | \"lg\";\n\n /**\n * Whether the button is an icon only button.\n */\n iconOnly?: boolean;\n\n /**\n * An icon to display within the button.\n */\n Icon?: ComponentType<React.SVGAttributes<SVGElement>>;\n /**\n * Whether this button triggers a destructive action.\n * @default false\n */\n destructive?: boolean;\n}>;\n\ntype ButtonPropsFor<C extends React.ElementType> = ButtonOwnProps &\n UnstyledButtonPropsFor<C>;\n\n/**\n * A button component that can be transformed into a link, but keep the button\n * styling using the `as` property.\n */\nexport const Button = forwardRef(function Button<\n C extends React.ElementType = \"button\",\n>(\n {\n as,\n kind: kindProp = \"primary\",\n size = \"lg\",\n children,\n className,\n iconOnly,\n Icon,\n destructive: destructiveProp,\n disabled,\n ...props\n }: ButtonPropsFor<C> & { as?: C },\n ref: ForwardedRef<C>,\n): React.ReactElement {\n // Fallback for the deprecated \"destructive\" kind\n const [kind, destructive] =\n kindProp === \"destructive\"\n ? [\"secondary\", true]\n : [kindProp, destructiveProp];\n\n const classes = classNames(styles.button, className, {\n [styles[\"has-icon\"]]: Icon,\n [styles[\"icon-only\"]]: iconOnly,\n [styles.destructive]: destructive,\n });\n\n const iconSize = iconOnly && size === \"lg\" ? 24 : 20;\n\n return (\n <UnstyledButton\n {...props}\n as={as || (\"button\" as const)}\n ref={ref as Ref<C>}\n className={classes}\n data-size={size}\n data-kind={kind}\n tabIndex={0}\n disabled={disabled}\n >\n {Icon && (\n <Icon\n width={iconSize}\n height={iconSize}\n className={styles.icon}\n aria-hidden={true}\n />\n )}\n {children}\n </UnstyledButton>\n );\n}) as ButtonComponent;\n"],"names":["forwardRef","Button","styles","jsxs","UnstyledButton","jsx"],"mappings":";;;;;;;AA8DO,MAAM,SAASA,MAAAA,WAAW,SAASC,QAGxC;AAAA,EACE;AAAA,EACA,MAAM,WAAW;AAAA,EACjB,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA,GAAG;AACL,GACA,KACoB;AAEpB,QAAM,CAAC,MAAM,WAAW,IACtB,aAAa,gBACT,CAAC,aAAa,IAAI,IAClB,CAAC,UAAU,eAAe;AAEhC,QAAM,UAAU,WAAWC,sBAAO,QAAQ,WAAW;AAAA,IACnD,CAACA,cAAAA,QAAO,UAAU,CAAC,GAAG;AAAA,IACtB,CAACA,cAAAA,QAAO,WAAW,CAAC,GAAG;AAAA,IACvB,CAACA,cAAAA,QAAO,WAAW,GAAG;AAAA,EAAA,CACvB;AAED,QAAM,WAAW,YAAY,SAAS,OAAO,KAAK;AAElD,SACEC,2BAAAA;AAAAA,IAACC,eAAAA;AAAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ,IAAI,MAAO;AAAA,MACX;AAAA,MACA,WAAW;AAAA,MACX,aAAW;AAAA,MACX,aAAW;AAAA,MACX,UAAU;AAAA,MACV;AAAA,MAEC,UAAA;AAAA,QAAA,QACCC,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,WAAWH,cAAAA,QAAO;AAAA,YAClB,eAAa;AAAA,UAAA;AAAA,QAAA;AAAA,QAGhB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,EACZ,aAAa,EACb,iBAAiB,EAIlB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAkB,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1E,UAAU,eAAe;IAEvB,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,EAC1B,KAAK,EAAE;QAAE,EAAE,EAAE,CAAC,CAAA;KAAE,GAAG,cAAc,CAAC,CAAC,CAAC,GACnC,KAAK,CAAC,YAAY,CAAC;IAEtB,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC;CACvD;AAED,KAAK,cAAc,GAAG,iBAAiB,CAAC;IACtC;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,aAAa,CAAC;IAC5D;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC;IACtD;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC,CAAC;AAEH,KAAK,cAAc,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,IAAI,cAAc,GAC/D,sBAAsB,CAAC,CAAC,CAAC,CAAC;AAE5B;;;GAGG;AACH,eAAO,MAAM,MAAM,EAqDb,eAAe,CAAC"}
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,EACZ,KAAK,aAAa,EAClB,KAAK,iBAAiB,EAIvB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAkB,KAAK,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE/E,UAAU,eAAe;IAEvB,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,EAC1B,KAAK,EAAE;QAAE,EAAE,EAAE,CAAC,CAAA;KAAE,GAAG,cAAc,CAAC,CAAC,CAAC,GACnC,KAAK,CAAC,YAAY,CAAC;IAEtB,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC;CACvD;AAED,KAAK,cAAc,GAAG,iBAAiB,CAAC;IACtC;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,aAAa,CAAC;IAC5D;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC;IACtD;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC,CAAC;AAEH,KAAK,cAAc,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,IAAI,cAAc,GAC/D,sBAAsB,CAAC,CAAC,CAAC,CAAC;AAE5B;;;GAGG;AACH,eAAO,MAAM,MAAM,EAqDb,eAAe,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["/*\nCopyright 2023, 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classNames from \"classnames\";\nimport React, {\n ComponentType,\n PropsWithChildren,\n forwardRef,\n ForwardedRef,\n Ref,\n} from \"react\";\nimport styles from \"./Button.module.css\";\nimport { UnstyledButton, UnstyledButtonPropsFor } from \"./UnstyledButton\";\n\ninterface ButtonComponent {\n // With the explicit `as` prop\n <C extends React.ElementType>(\n props: { as: C } & ButtonPropsFor<C>,\n ): React.ReactElement;\n // Without the explicit `as` prop, defaulting to a <button>\n (props: ButtonPropsFor<\"button\">): React.ReactElement;\n}\n\ntype ButtonOwnProps = PropsWithChildren<{\n /**\n * The type of button.\n * Note: \"destructive\" is deprecated, please use the destructive prop in\n * conjunction with another button kind.\n */\n kind?: \"primary\" | \"secondary\" | \"tertiary\" | \"destructive\";\n /**\n * The t-shirt size of the button.\n */\n size?: \"sm\" | \"lg\";\n\n /**\n * Whether the button is an icon only button.\n */\n iconOnly?: boolean;\n\n /**\n * An icon to display within the button.\n */\n Icon?: ComponentType<React.SVGAttributes<SVGElement>>;\n /**\n * Whether this button triggers a destructive action.\n * @default false\n */\n destructive?: boolean;\n}>;\n\ntype ButtonPropsFor<C extends React.ElementType> = ButtonOwnProps &\n UnstyledButtonPropsFor<C>;\n\n/**\n * A button component that can be transformed into a link, but keep the button\n * styling using the `as` property.\n */\nexport const Button = forwardRef(function Button<\n C extends React.ElementType = \"button\",\n>(\n {\n as,\n kind: kindProp = \"primary\",\n size = \"lg\",\n children,\n className,\n iconOnly,\n Icon,\n destructive: destructiveProp,\n disabled,\n ...props\n }: ButtonPropsFor<C> & { as?: C },\n ref: ForwardedRef<C>,\n): React.ReactElement {\n // Fallback for the deprecated \"destructive\" kind\n const [kind, destructive] =\n kindProp === \"destructive\"\n ? [\"secondary\", true]\n : [kindProp, destructiveProp];\n\n const classes = classNames(styles.button, className, {\n [styles[\"has-icon\"]]: Icon,\n [styles[\"icon-only\"]]: iconOnly,\n [styles.destructive]: destructive,\n });\n\n const iconSize = iconOnly && size === \"lg\" ? 24 : 20;\n\n return (\n <UnstyledButton\n {...props}\n as={as || (\"button\" as const)}\n ref={ref as Ref<C>}\n className={classes}\n data-size={size}\n data-kind={kind}\n tabIndex={0}\n disabled={disabled}\n >\n {Icon && (\n <Icon\n width={iconSize}\n height={iconSize}\n className={styles.icon}\n aria-hidden={true}\n />\n )}\n {children}\n </UnstyledButton>\n );\n}) as ButtonComponent;\n"],"names":["Button"],"mappings":";;;;;AA8Da,MAAA,SAAS,WAAW,SAASA,QAGxC;AAAA,EACE;AAAA,EACA,MAAM,WAAW;AAAA,EACjB,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA,GAAG;AACL,GACA,KACoB;AAEpB,QAAM,CAAC,MAAM,WAAW,IACtB,aAAa,gBACT,CAAC,aAAa,IAAI,IAClB,CAAC,UAAU,eAAe;AAEhC,QAAM,UAAU,WAAW,OAAO,QAAQ,WAAW;AAAA,IACnD,CAAC,OAAO,UAAU,CAAC,GAAG;AAAA,IACtB,CAAC,OAAO,WAAW,CAAC,GAAG;AAAA,IACvB,CAAC,OAAO,WAAW,GAAG;AAAA,EAAA,CACvB;AAED,QAAM,WAAW,YAAY,SAAS,OAAO,KAAK;AAGhD,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ,IAAI,MAAO;AAAA,MACX;AAAA,MACA,WAAW;AAAA,MACX,aAAW;AAAA,MACX,aAAW;AAAA,MACX,UAAU;AAAA,MACV;AAAA,MAEC,UAAA;AAAA,QACC,QAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,WAAW,OAAO;AAAA,YAClB,eAAa;AAAA,UAAA;AAAA,QACf;AAAA,QAED;AAAA,MAAA;AAAA,IAAA;AAAA,EACH;AAEJ,CAAC;"}
1
+ {"version":3,"file":"Button.js","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["/*\nCopyright 2023, 2024 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classNames from \"classnames\";\nimport React, {\n type ComponentType,\n type PropsWithChildren,\n forwardRef,\n type ForwardedRef,\n type Ref,\n} from \"react\";\nimport styles from \"./Button.module.css\";\nimport { UnstyledButton, type UnstyledButtonPropsFor } from \"./UnstyledButton\";\n\ninterface ButtonComponent {\n // With the explicit `as` prop\n <C extends React.ElementType>(\n props: { as: C } & ButtonPropsFor<C>,\n ): React.ReactElement;\n // Without the explicit `as` prop, defaulting to a <button>\n (props: ButtonPropsFor<\"button\">): React.ReactElement;\n}\n\ntype ButtonOwnProps = PropsWithChildren<{\n /**\n * The type of button.\n * Note: \"destructive\" is deprecated, please use the destructive prop in\n * conjunction with another button kind.\n */\n kind?: \"primary\" | \"secondary\" | \"tertiary\" | \"destructive\";\n /**\n * The t-shirt size of the button.\n */\n size?: \"sm\" | \"lg\";\n\n /**\n * Whether the button is an icon only button.\n */\n iconOnly?: boolean;\n\n /**\n * An icon to display within the button.\n */\n Icon?: ComponentType<React.SVGAttributes<SVGElement>>;\n /**\n * Whether this button triggers a destructive action.\n * @default false\n */\n destructive?: boolean;\n}>;\n\ntype ButtonPropsFor<C extends React.ElementType> = ButtonOwnProps &\n UnstyledButtonPropsFor<C>;\n\n/**\n * A button component that can be transformed into a link, but keep the button\n * styling using the `as` property.\n */\nexport const Button = forwardRef(function Button<\n C extends React.ElementType = \"button\",\n>(\n {\n as,\n kind: kindProp = \"primary\",\n size = \"lg\",\n children,\n className,\n iconOnly,\n Icon,\n destructive: destructiveProp,\n disabled,\n ...props\n }: ButtonPropsFor<C> & { as?: C },\n ref: ForwardedRef<C>,\n): React.ReactElement {\n // Fallback for the deprecated \"destructive\" kind\n const [kind, destructive] =\n kindProp === \"destructive\"\n ? [\"secondary\", true]\n : [kindProp, destructiveProp];\n\n const classes = classNames(styles.button, className, {\n [styles[\"has-icon\"]]: Icon,\n [styles[\"icon-only\"]]: iconOnly,\n [styles.destructive]: destructive,\n });\n\n const iconSize = iconOnly && size === \"lg\" ? 24 : 20;\n\n return (\n <UnstyledButton\n {...props}\n as={as || (\"button\" as const)}\n ref={ref as Ref<C>}\n className={classes}\n data-size={size}\n data-kind={kind}\n tabIndex={0}\n disabled={disabled}\n >\n {Icon && (\n <Icon\n width={iconSize}\n height={iconSize}\n className={styles.icon}\n aria-hidden={true}\n />\n )}\n {children}\n </UnstyledButton>\n );\n}) as ButtonComponent;\n"],"names":["Button"],"mappings":";;;;;AA8DO,MAAM,SAAS,WAAW,SAASA,QAGxC;AAAA,EACE;AAAA,EACA,MAAM,WAAW;AAAA,EACjB,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA,GAAG;AACL,GACA,KACoB;AAEpB,QAAM,CAAC,MAAM,WAAW,IACtB,aAAa,gBACT,CAAC,aAAa,IAAI,IAClB,CAAC,UAAU,eAAe;AAEhC,QAAM,UAAU,WAAW,OAAO,QAAQ,WAAW;AAAA,IACnD,CAAC,OAAO,UAAU,CAAC,GAAG;AAAA,IACtB,CAAC,OAAO,WAAW,CAAC,GAAG;AAAA,IACvB,CAAC,OAAO,WAAW,GAAG;AAAA,EAAA,CACvB;AAED,QAAM,WAAW,YAAY,SAAS,OAAO,KAAK;AAElD,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ,IAAI,MAAO;AAAA,MACX;AAAA,MACA,WAAW;AAAA,MACX,aAAW;AAAA,MACX,aAAW;AAAA,MACX,UAAU;AAAA,MACV;AAAA,MAEC,UAAA;AAAA,QAAA,QACC;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,WAAW,OAAO;AAAA,YAClB,eAAa;AAAA,UAAA;AAAA,QAAA;AAAA,QAGhB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.cjs","sources":["../../../../src/components/Button/IconButton/IconButton.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { PropsWithChildren, forwardRef } from \"react\";\nimport classnames from \"classnames\";\n\nimport styles from \"./IconButton.module.css\";\nimport { UnstyledButton, UnstyledButtonPropsFor } from \"../UnstyledButton\";\nimport { IndicatorIcon } from \"../../Icon/IndicatorIcon/IndicatorIcon\";\nimport { Tooltip } from \"../../Tooltip/Tooltip\";\n\ntype IconButtonProps = UnstyledButtonPropsFor<\"button\"> & {\n /**\n * The type of button.\n * @default \"primary\"\n */\n kind?: \"primary\" | \"secondary\";\n /**\n * The CSS class name.\n */\n className?: string;\n /**\n * The size of the button in CSS units, e.g. `\"24px\"`.\n * Note that this is the size of the *button* itself: the icon will be 0.75 * this size\n * @default 32px\n */\n size?: CSSStyleDeclaration[\"height\"];\n /**\n * The icon button indicator dot displayed on the top right\n * As in IndicatorIcon\n */\n indicator?: \"default\" | \"success\" | \"critical\";\n /**\n * Whether the button is interactable\n */\n disabled?: boolean;\n /**\n * Whether this button triggers a destructive action.\n * @default false\n */\n destructive?: boolean;\n /**\n * Optional tooltip for the button\n */\n tooltip?: string;\n /**\n * Hide the background when the button is not active or hovered.\n * @default false\n */\n noBackground?: boolean;\n};\n\n/**\n * Display an icon as a button. Can render an indicator\n */\nexport const IconButton = forwardRef<\n HTMLButtonElement,\n PropsWithChildren<IconButtonProps>\n>(function IconButton(\n {\n kind = \"primary\",\n children,\n className,\n indicator,\n size = \"32px\",\n style,\n disabled,\n destructive,\n tooltip,\n noBackground = false,\n ...props\n },\n ref,\n) {\n const classes = classnames(styles[\"icon-button\"], className, {\n [styles.destructive]: destructive,\n [styles[\"no-background\"]]: noBackground,\n });\n\n const button = (\n <UnstyledButton\n as=\"button\"\n ref={ref}\n className={classes}\n style={\n {\n \"--cpd-icon-button-size\": size,\n ...style,\n } as React.CSSProperties\n }\n disabled={disabled}\n {...props}\n data-indicator={indicator}\n data-kind={kind}\n >\n <IndicatorIcon\n indicator={indicator}\n colour={disabled ? \"var(--cpd-color-icon-disabled)\" : undefined}\n >\n {React.Children.only(children)}\n </IndicatorIcon>\n </UnstyledButton>\n );\n\n return tooltip ? <Tooltip label={tooltip}>{button}</Tooltip> : button;\n});\n"],"names":["forwardRef","IconButton","classnames","styles","jsx","UnstyledButton","IndicatorIcon","Tooltip"],"mappings":";;;;;;;;;AA2Da,MAAA,aAAaA,MAAAA,WAGxB,SAASC,YACT;AAAA,EACE,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,GAAG;AACL,GACA,KACA;AACA,QAAM,UAAUC,WAAWC,kBAAO,QAAA,aAAa,GAAG,WAAW;AAAA,IAC3D,CAACA,kBAAAA,QAAO,WAAW,GAAG;AAAA,IACtB,CAACA,kBAAAA,QAAO,eAAe,CAAC,GAAG;AAAA,EAAA,CAC5B;AAED,QAAM,SACJC,2BAAA;AAAA,IAACC,eAAA;AAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH;AAAA,MACA,WAAW;AAAA,MACX,OACE;AAAA,QACE,0BAA0B;AAAA,QAC1B,GAAG;AAAA,MACL;AAAA,MAEF;AAAA,MACC,GAAG;AAAA,MACJ,kBAAgB;AAAA,MAChB,aAAW;AAAA,MAEX,UAAAD,2BAAA;AAAA,QAACE,cAAA;AAAA,QAAA;AAAA,UACC;AAAA,UACA,QAAQ,WAAW,mCAAmC;AAAA,UAErD,UAAA,MAAM,SAAS,KAAK,QAAQ;AAAA,QAAA;AAAA,MAAA;AAAA,IAC/B;AAAA,EACF;AAGF,SAAO,UAAWF,+BAAAG,QAAAA,SAAA,EAAQ,OAAO,SAAU,iBAAO,CAAA,IAAa;AACjE,CAAC;;"}
1
+ {"version":3,"file":"IconButton.cjs","sources":["../../../../src/components/Button/IconButton/IconButton.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { type PropsWithChildren, forwardRef } from \"react\";\nimport classnames from \"classnames\";\n\nimport styles from \"./IconButton.module.css\";\nimport { UnstyledButton, type UnstyledButtonPropsFor } from \"../UnstyledButton\";\nimport { IndicatorIcon } from \"../../Icon/IndicatorIcon/IndicatorIcon\";\nimport { Tooltip } from \"../../Tooltip/Tooltip\";\n\ntype IconButtonProps = UnstyledButtonPropsFor<\"button\"> & {\n /**\n * The type of button.\n * @default \"primary\"\n */\n kind?: \"primary\" | \"secondary\";\n /**\n * The CSS class name.\n */\n className?: string;\n /**\n * The size of the button in CSS units, e.g. `\"24px\"`.\n * Note that this is the size of the *button* itself: the icon will be 0.75 * this size\n * @default 32px\n */\n size?: CSSStyleDeclaration[\"height\"];\n /**\n * The icon button indicator dot displayed on the top right\n * As in IndicatorIcon\n */\n indicator?: \"default\" | \"success\" | \"critical\";\n /**\n * Whether the button is interactable\n */\n disabled?: boolean;\n /**\n * Whether this button triggers a destructive action.\n * @default false\n */\n destructive?: boolean;\n /**\n * Optional tooltip for the button\n */\n tooltip?: string;\n /**\n * Hide the background when the button is not active or hovered.\n * @default false\n */\n noBackground?: boolean;\n};\n\n/**\n * Display an icon as a button. Can render an indicator\n */\nexport const IconButton = forwardRef<\n HTMLButtonElement,\n PropsWithChildren<IconButtonProps>\n>(function IconButton(\n {\n kind = \"primary\",\n children,\n className,\n indicator,\n size = \"32px\",\n style,\n disabled,\n destructive,\n tooltip,\n noBackground = false,\n ...props\n },\n ref,\n) {\n const classes = classnames(styles[\"icon-button\"], className, {\n [styles.destructive]: destructive,\n [styles[\"no-background\"]]: noBackground,\n });\n\n const button = (\n <UnstyledButton\n as=\"button\"\n ref={ref}\n className={classes}\n style={\n {\n \"--cpd-icon-button-size\": size,\n ...style,\n } as React.CSSProperties\n }\n disabled={disabled}\n {...props}\n data-indicator={indicator}\n data-kind={kind}\n >\n <IndicatorIcon\n indicator={indicator}\n colour={disabled ? \"var(--cpd-color-icon-disabled)\" : undefined}\n >\n {React.Children.only(children)}\n </IndicatorIcon>\n </UnstyledButton>\n );\n\n return tooltip ? <Tooltip label={tooltip}>{button}</Tooltip> : button;\n});\n"],"names":["forwardRef","IconButton","classnames","styles","jsx","UnstyledButton","IndicatorIcon","Tooltip"],"mappings":";;;;;;;;;AA2DO,MAAM,aAAaA,MAAAA,WAGxB,SAASC,YACT;AAAA,EACE,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,GAAG;AACL,GACA,KACA;AACA,QAAM,UAAUC,WAAWC,kBAAAA,QAAO,aAAa,GAAG,WAAW;AAAA,IAC3D,CAACA,kBAAAA,QAAO,WAAW,GAAG;AAAA,IACtB,CAACA,kBAAAA,QAAO,eAAe,CAAC,GAAG;AAAA,EAAA,CAC5B;AAED,QAAM,SACJC,2BAAAA;AAAAA,IAACC,eAAAA;AAAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH;AAAA,MACA,WAAW;AAAA,MACX,OACE;AAAA,QACE,0BAA0B;AAAA,QAC1B,GAAG;AAAA,MAAA;AAAA,MAGP;AAAA,MACC,GAAG;AAAA,MACJ,kBAAgB;AAAA,MAChB,aAAW;AAAA,MAEX,UAAAD,2BAAAA;AAAAA,QAACE,cAAAA;AAAAA,QAAA;AAAA,UACC;AAAA,UACA,QAAQ,WAAW,mCAAmC;AAAA,UAErD,UAAA,MAAM,SAAS,KAAK,QAAQ;AAAA,QAAA;AAAA,MAAA;AAAA,IAC/B;AAAA,EAAA;AAIJ,SAAO,UAAUF,+BAACG,QAAAA,SAAA,EAAQ,OAAO,SAAU,kBAAO,IAAa;AACjE,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/IconButton/IconButton.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAI7D,OAAO,EAAkB,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAI3E,KAAK,eAAe,GAAG,sBAAsB,CAAC,QAAQ,CAAC,GAAG;IACxD;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAC/B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACrC;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;IAC/C;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,iIAkDrB,CAAC"}
1
+ {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/IconButton/IconButton.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAIlE,OAAO,EAAkB,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAIhF,KAAK,eAAe,GAAG,sBAAsB,CAAC,QAAQ,CAAC,GAAG;IACxD;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAC/B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACrC;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;IAC/C;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,iIAkDrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.js","sources":["../../../../src/components/Button/IconButton/IconButton.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { PropsWithChildren, forwardRef } from \"react\";\nimport classnames from \"classnames\";\n\nimport styles from \"./IconButton.module.css\";\nimport { UnstyledButton, UnstyledButtonPropsFor } from \"../UnstyledButton\";\nimport { IndicatorIcon } from \"../../Icon/IndicatorIcon/IndicatorIcon\";\nimport { Tooltip } from \"../../Tooltip/Tooltip\";\n\ntype IconButtonProps = UnstyledButtonPropsFor<\"button\"> & {\n /**\n * The type of button.\n * @default \"primary\"\n */\n kind?: \"primary\" | \"secondary\";\n /**\n * The CSS class name.\n */\n className?: string;\n /**\n * The size of the button in CSS units, e.g. `\"24px\"`.\n * Note that this is the size of the *button* itself: the icon will be 0.75 * this size\n * @default 32px\n */\n size?: CSSStyleDeclaration[\"height\"];\n /**\n * The icon button indicator dot displayed on the top right\n * As in IndicatorIcon\n */\n indicator?: \"default\" | \"success\" | \"critical\";\n /**\n * Whether the button is interactable\n */\n disabled?: boolean;\n /**\n * Whether this button triggers a destructive action.\n * @default false\n */\n destructive?: boolean;\n /**\n * Optional tooltip for the button\n */\n tooltip?: string;\n /**\n * Hide the background when the button is not active or hovered.\n * @default false\n */\n noBackground?: boolean;\n};\n\n/**\n * Display an icon as a button. Can render an indicator\n */\nexport const IconButton = forwardRef<\n HTMLButtonElement,\n PropsWithChildren<IconButtonProps>\n>(function IconButton(\n {\n kind = \"primary\",\n children,\n className,\n indicator,\n size = \"32px\",\n style,\n disabled,\n destructive,\n tooltip,\n noBackground = false,\n ...props\n },\n ref,\n) {\n const classes = classnames(styles[\"icon-button\"], className, {\n [styles.destructive]: destructive,\n [styles[\"no-background\"]]: noBackground,\n });\n\n const button = (\n <UnstyledButton\n as=\"button\"\n ref={ref}\n className={classes}\n style={\n {\n \"--cpd-icon-button-size\": size,\n ...style,\n } as React.CSSProperties\n }\n disabled={disabled}\n {...props}\n data-indicator={indicator}\n data-kind={kind}\n >\n <IndicatorIcon\n indicator={indicator}\n colour={disabled ? \"var(--cpd-color-icon-disabled)\" : undefined}\n >\n {React.Children.only(children)}\n </IndicatorIcon>\n </UnstyledButton>\n );\n\n return tooltip ? <Tooltip label={tooltip}>{button}</Tooltip> : button;\n});\n"],"names":["IconButton","classnames"],"mappings":";;;;;;;AA2Da,MAAA,aAAa,WAGxB,SAASA,YACT;AAAA,EACE,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,GAAG;AACL,GACA,KACA;AACA,QAAM,UAAUC,WAAW,OAAO,aAAa,GAAG,WAAW;AAAA,IAC3D,CAAC,OAAO,WAAW,GAAG;AAAA,IACtB,CAAC,OAAO,eAAe,CAAC,GAAG;AAAA,EAAA,CAC5B;AAED,QAAM,SACJ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH;AAAA,MACA,WAAW;AAAA,MACX,OACE;AAAA,QACE,0BAA0B;AAAA,QAC1B,GAAG;AAAA,MACL;AAAA,MAEF;AAAA,MACC,GAAG;AAAA,MACJ,kBAAgB;AAAA,MAChB,aAAW;AAAA,MAEX,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA,QAAQ,WAAW,mCAAmC;AAAA,UAErD,UAAA,MAAM,SAAS,KAAK,QAAQ;AAAA,QAAA;AAAA,MAAA;AAAA,IAC/B;AAAA,EACF;AAGF,SAAO,UAAW,oBAAA,SAAA,EAAQ,OAAO,SAAU,iBAAO,CAAA,IAAa;AACjE,CAAC;"}
1
+ {"version":3,"file":"IconButton.js","sources":["../../../../src/components/Button/IconButton/IconButton.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { type PropsWithChildren, forwardRef } from \"react\";\nimport classnames from \"classnames\";\n\nimport styles from \"./IconButton.module.css\";\nimport { UnstyledButton, type UnstyledButtonPropsFor } from \"../UnstyledButton\";\nimport { IndicatorIcon } from \"../../Icon/IndicatorIcon/IndicatorIcon\";\nimport { Tooltip } from \"../../Tooltip/Tooltip\";\n\ntype IconButtonProps = UnstyledButtonPropsFor<\"button\"> & {\n /**\n * The type of button.\n * @default \"primary\"\n */\n kind?: \"primary\" | \"secondary\";\n /**\n * The CSS class name.\n */\n className?: string;\n /**\n * The size of the button in CSS units, e.g. `\"24px\"`.\n * Note that this is the size of the *button* itself: the icon will be 0.75 * this size\n * @default 32px\n */\n size?: CSSStyleDeclaration[\"height\"];\n /**\n * The icon button indicator dot displayed on the top right\n * As in IndicatorIcon\n */\n indicator?: \"default\" | \"success\" | \"critical\";\n /**\n * Whether the button is interactable\n */\n disabled?: boolean;\n /**\n * Whether this button triggers a destructive action.\n * @default false\n */\n destructive?: boolean;\n /**\n * Optional tooltip for the button\n */\n tooltip?: string;\n /**\n * Hide the background when the button is not active or hovered.\n * @default false\n */\n noBackground?: boolean;\n};\n\n/**\n * Display an icon as a button. Can render an indicator\n */\nexport const IconButton = forwardRef<\n HTMLButtonElement,\n PropsWithChildren<IconButtonProps>\n>(function IconButton(\n {\n kind = \"primary\",\n children,\n className,\n indicator,\n size = \"32px\",\n style,\n disabled,\n destructive,\n tooltip,\n noBackground = false,\n ...props\n },\n ref,\n) {\n const classes = classnames(styles[\"icon-button\"], className, {\n [styles.destructive]: destructive,\n [styles[\"no-background\"]]: noBackground,\n });\n\n const button = (\n <UnstyledButton\n as=\"button\"\n ref={ref}\n className={classes}\n style={\n {\n \"--cpd-icon-button-size\": size,\n ...style,\n } as React.CSSProperties\n }\n disabled={disabled}\n {...props}\n data-indicator={indicator}\n data-kind={kind}\n >\n <IndicatorIcon\n indicator={indicator}\n colour={disabled ? \"var(--cpd-color-icon-disabled)\" : undefined}\n >\n {React.Children.only(children)}\n </IndicatorIcon>\n </UnstyledButton>\n );\n\n return tooltip ? <Tooltip label={tooltip}>{button}</Tooltip> : button;\n});\n"],"names":["IconButton","classnames"],"mappings":";;;;;;;AA2DO,MAAM,aAAa,WAGxB,SAASA,YACT;AAAA,EACE,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,GAAG;AACL,GACA,KACA;AACA,QAAM,UAAUC,WAAW,OAAO,aAAa,GAAG,WAAW;AAAA,IAC3D,CAAC,OAAO,WAAW,GAAG;AAAA,IACtB,CAAC,OAAO,eAAe,CAAC,GAAG;AAAA,EAAA,CAC5B;AAED,QAAM,SACJ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH;AAAA,MACA,WAAW;AAAA,MACX,OACE;AAAA,QACE,0BAA0B;AAAA,QAC1B,GAAG;AAAA,MAAA;AAAA,MAGP;AAAA,MACC,GAAG;AAAA,MACJ,kBAAgB;AAAA,MAChB,aAAW;AAAA,MAEX,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA,QAAQ,WAAW,mCAAmC;AAAA,UAErD,UAAA,MAAM,SAAS,KAAK,QAAQ;AAAA,QAAA;AAAA,MAAA;AAAA,IAC/B;AAAA,EAAA;AAIJ,SAAO,UAAU,oBAAC,SAAA,EAAQ,OAAO,SAAU,kBAAO,IAAa;AACjE,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"UnstyledButton.cjs","sources":["../../../src/components/Button/UnstyledButton.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { PropsWithChildren, forwardRef, ForwardedRef, Ref } from \"react\";\n\ninterface ButtonComponent {\n // With the explicit `as` prop\n <C extends React.ElementType>(\n props: { as: C } & UnstyledButtonPropsFor<C>,\n ): React.ReactElement;\n // Without the explicit `as` prop, defaulting to a <button>\n (props: UnstyledButtonPropsFor<\"button\">): React.ReactElement;\n}\n\ntype UnstyledButtonProps = PropsWithChildren<{\n /**\n * Note that disabled attribute is not added to buttons, so that disabled buttons are discoverable by keyboard.\n * `aria-disabled` attribute is used to indicate button is disabled.\n * Event handlers are not passed to disabled buttons (onClick, onSubmit, etc.)\n */\n disabled?: boolean;\n}>;\n\nexport type UnstyledButtonPropsFor<C extends React.ElementType> =\n UnstyledButtonProps &\n Omit<\n React.ComponentPropsWithoutRef<C>,\n keyof UnstyledButtonProps | \"as\"\n > & {\n ref?: React.Ref<React.ComponentRef<C>>;\n };\n\n/**\n * Unstyled button component. Can be disabled and optionally rendered as an anchor.\n * Intended to be wrapped with styles and exported as new button type - eg `IconButton` or `Button`.\n *\n * Not to be used externally.\n */\nexport const UnstyledButton = forwardRef(function UnstyledButton<\n C extends React.ElementType = \"button\",\n>(\n {\n as,\n children,\n className,\n disabled,\n ...props\n }: UnstyledButtonPropsFor<C> & { as?: C },\n ref: ForwardedRef<C>,\n): React.ReactElement {\n const Component = as || (\"button\" as const);\n\n const {\n onClick,\n onSubmit,\n onPointerDown,\n onPointerUp,\n onKeyDown,\n onKeyUp,\n onKeyPress,\n ...restProps\n } = props;\n const eventHandlers = disabled\n ? {}\n : {\n onClick,\n onSubmit,\n onPointerDown,\n onPointerUp,\n onKeyDown,\n onKeyUp,\n onKeyPress,\n };\n\n return (\n <Component\n {...restProps}\n ref={ref as Ref<C>}\n className={className}\n // All elements roles should be overriden at the exceptions of anchors\n // We want them to behave like links but look like buttons\n role={as === \"a\" ? \"link\" : \"button\"}\n tabIndex={0}\n {...eventHandlers}\n aria-disabled={disabled}\n >\n {children}\n </Component>\n );\n}) as ButtonComponent;\n"],"names":["forwardRef","UnstyledButton","jsx"],"mappings":";;;;AA0Ca,MAAA,iBAAiBA,MAAAA,WAAW,SAASC,gBAGhD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GACA,KACoB;AACpB,QAAM,YAAY,MAAO;AAEnB,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD;AACE,QAAA,gBAAgB,WAClB,KACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAGF,SAAAC,2BAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MAGA,MAAM,OAAO,MAAM,SAAS;AAAA,MAC5B,UAAU;AAAA,MACT,GAAG;AAAA,MACJ,iBAAe;AAAA,MAEd;AAAA,IAAA;AAAA,EACH;AAEJ,CAAC;;"}
1
+ {"version":3,"file":"UnstyledButton.cjs","sources":["../../../src/components/Button/UnstyledButton.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, {\n type PropsWithChildren,\n forwardRef,\n type ForwardedRef,\n type Ref,\n} from \"react\";\n\ninterface ButtonComponent {\n // With the explicit `as` prop\n <C extends React.ElementType>(\n props: { as: C } & UnstyledButtonPropsFor<C>,\n ): React.ReactElement;\n // Without the explicit `as` prop, defaulting to a <button>\n (props: UnstyledButtonPropsFor<\"button\">): React.ReactElement;\n}\n\ntype UnstyledButtonProps = PropsWithChildren<{\n /**\n * Note that disabled attribute is not added to buttons, so that disabled buttons are discoverable by keyboard.\n * `aria-disabled` attribute is used to indicate button is disabled.\n * Event handlers are not passed to disabled buttons (onClick, onSubmit, etc.)\n */\n disabled?: boolean;\n}>;\n\nexport type UnstyledButtonPropsFor<C extends React.ElementType> =\n UnstyledButtonProps &\n Omit<\n React.ComponentPropsWithoutRef<C>,\n keyof UnstyledButtonProps | \"as\"\n > & {\n ref?: React.Ref<React.ComponentRef<C>>;\n };\n\n/**\n * Unstyled button component. Can be disabled and optionally rendered as an anchor.\n * Intended to be wrapped with styles and exported as new button type - eg `IconButton` or `Button`.\n *\n * Not to be used externally.\n */\nexport const UnstyledButton = forwardRef(function UnstyledButton<\n C extends React.ElementType = \"button\",\n>(\n {\n as,\n children,\n className,\n disabled,\n ...props\n }: UnstyledButtonPropsFor<C> & { as?: C },\n ref: ForwardedRef<C>,\n): React.ReactElement {\n const Component = as || (\"button\" as const);\n\n const {\n onClick,\n onSubmit,\n onPointerDown,\n onPointerUp,\n onKeyDown,\n onKeyUp,\n onKeyPress,\n ...restProps\n } = props;\n const eventHandlers = disabled\n ? {}\n : {\n onClick,\n onSubmit,\n onPointerDown,\n onPointerUp,\n onKeyDown,\n onKeyUp,\n onKeyPress,\n };\n\n return (\n <Component\n {...restProps}\n ref={ref as Ref<C>}\n className={className}\n // All elements roles should be overriden at the exceptions of anchors\n // We want them to behave like links but look like buttons\n role={as === \"a\" ? \"link\" : \"button\"}\n tabIndex={0}\n {...eventHandlers}\n aria-disabled={disabled}\n >\n {children}\n </Component>\n );\n}) as ButtonComponent;\n"],"names":["forwardRef","UnstyledButton","jsx"],"mappings":";;;;AA+CO,MAAM,iBAAiBA,MAAAA,WAAW,SAASC,gBAGhD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GACA,KACoB;AACpB,QAAM,YAAY,MAAO;AAEzB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD;AACJ,QAAM,gBAAgB,WAClB,KACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAGN,SACEC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MAGA,MAAM,OAAO,MAAM,SAAS;AAAA,MAC5B,UAAU;AAAA,MACT,GAAG;AAAA,MACJ,iBAAe;AAAA,MAEd;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"UnstyledButton.d.ts","sourceRoot":"","sources":["../../../src/components/Button/UnstyledButton.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAiC,MAAM,OAAO,CAAC;AAEhF,UAAU,eAAe;IAEvB,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,EAC1B,KAAK,EAAE;QAAE,EAAE,EAAE,CAAC,CAAA;KAAE,GAAG,sBAAsB,CAAC,CAAC,CAAC,GAC3C,KAAK,CAAC,YAAY,CAAC;IAEtB,CAAC,KAAK,EAAE,sBAAsB,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC;CAC/D;AAED,KAAK,mBAAmB,GAAG,iBAAiB,CAAC;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,IAC5D,mBAAmB,GACjB,IAAI,CACF,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC,EACjC,MAAM,mBAAmB,GAAG,IAAI,CACjC,GAAG;IACF,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;CACxC,CAAC;AAEN;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAmDrB,eAAe,CAAC"}
1
+ {"version":3,"file":"UnstyledButton.d.ts","sourceRoot":"","sources":["../../../src/components/Button/UnstyledButton.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,EACZ,KAAK,iBAAiB,EAIvB,MAAM,OAAO,CAAC;AAEf,UAAU,eAAe;IAEvB,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,EAC1B,KAAK,EAAE;QAAE,EAAE,EAAE,CAAC,CAAA;KAAE,GAAG,sBAAsB,CAAC,CAAC,CAAC,GAC3C,KAAK,CAAC,YAAY,CAAC;IAEtB,CAAC,KAAK,EAAE,sBAAsB,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC;CAC/D;AAED,KAAK,mBAAmB,GAAG,iBAAiB,CAAC;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,IAC5D,mBAAmB,GACjB,IAAI,CACF,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC,EACjC,MAAM,mBAAmB,GAAG,IAAI,CACjC,GAAG;IACF,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;CACxC,CAAC;AAEN;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAmDrB,eAAe,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"UnstyledButton.js","sources":["../../../src/components/Button/UnstyledButton.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { PropsWithChildren, forwardRef, ForwardedRef, Ref } from \"react\";\n\ninterface ButtonComponent {\n // With the explicit `as` prop\n <C extends React.ElementType>(\n props: { as: C } & UnstyledButtonPropsFor<C>,\n ): React.ReactElement;\n // Without the explicit `as` prop, defaulting to a <button>\n (props: UnstyledButtonPropsFor<\"button\">): React.ReactElement;\n}\n\ntype UnstyledButtonProps = PropsWithChildren<{\n /**\n * Note that disabled attribute is not added to buttons, so that disabled buttons are discoverable by keyboard.\n * `aria-disabled` attribute is used to indicate button is disabled.\n * Event handlers are not passed to disabled buttons (onClick, onSubmit, etc.)\n */\n disabled?: boolean;\n}>;\n\nexport type UnstyledButtonPropsFor<C extends React.ElementType> =\n UnstyledButtonProps &\n Omit<\n React.ComponentPropsWithoutRef<C>,\n keyof UnstyledButtonProps | \"as\"\n > & {\n ref?: React.Ref<React.ComponentRef<C>>;\n };\n\n/**\n * Unstyled button component. Can be disabled and optionally rendered as an anchor.\n * Intended to be wrapped with styles and exported as new button type - eg `IconButton` or `Button`.\n *\n * Not to be used externally.\n */\nexport const UnstyledButton = forwardRef(function UnstyledButton<\n C extends React.ElementType = \"button\",\n>(\n {\n as,\n children,\n className,\n disabled,\n ...props\n }: UnstyledButtonPropsFor<C> & { as?: C },\n ref: ForwardedRef<C>,\n): React.ReactElement {\n const Component = as || (\"button\" as const);\n\n const {\n onClick,\n onSubmit,\n onPointerDown,\n onPointerUp,\n onKeyDown,\n onKeyUp,\n onKeyPress,\n ...restProps\n } = props;\n const eventHandlers = disabled\n ? {}\n : {\n onClick,\n onSubmit,\n onPointerDown,\n onPointerUp,\n onKeyDown,\n onKeyUp,\n onKeyPress,\n };\n\n return (\n <Component\n {...restProps}\n ref={ref as Ref<C>}\n className={className}\n // All elements roles should be overriden at the exceptions of anchors\n // We want them to behave like links but look like buttons\n role={as === \"a\" ? \"link\" : \"button\"}\n tabIndex={0}\n {...eventHandlers}\n aria-disabled={disabled}\n >\n {children}\n </Component>\n );\n}) as ButtonComponent;\n"],"names":["UnstyledButton"],"mappings":";;AA0Ca,MAAA,iBAAiB,WAAW,SAASA,gBAGhD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GACA,KACoB;AACpB,QAAM,YAAY,MAAO;AAEnB,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD;AACE,QAAA,gBAAgB,WAClB,KACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAGF,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MAGA,MAAM,OAAO,MAAM,SAAS;AAAA,MAC5B,UAAU;AAAA,MACT,GAAG;AAAA,MACJ,iBAAe;AAAA,MAEd;AAAA,IAAA;AAAA,EACH;AAEJ,CAAC;"}
1
+ {"version":3,"file":"UnstyledButton.js","sources":["../../../src/components/Button/UnstyledButton.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, {\n type PropsWithChildren,\n forwardRef,\n type ForwardedRef,\n type Ref,\n} from \"react\";\n\ninterface ButtonComponent {\n // With the explicit `as` prop\n <C extends React.ElementType>(\n props: { as: C } & UnstyledButtonPropsFor<C>,\n ): React.ReactElement;\n // Without the explicit `as` prop, defaulting to a <button>\n (props: UnstyledButtonPropsFor<\"button\">): React.ReactElement;\n}\n\ntype UnstyledButtonProps = PropsWithChildren<{\n /**\n * Note that disabled attribute is not added to buttons, so that disabled buttons are discoverable by keyboard.\n * `aria-disabled` attribute is used to indicate button is disabled.\n * Event handlers are not passed to disabled buttons (onClick, onSubmit, etc.)\n */\n disabled?: boolean;\n}>;\n\nexport type UnstyledButtonPropsFor<C extends React.ElementType> =\n UnstyledButtonProps &\n Omit<\n React.ComponentPropsWithoutRef<C>,\n keyof UnstyledButtonProps | \"as\"\n > & {\n ref?: React.Ref<React.ComponentRef<C>>;\n };\n\n/**\n * Unstyled button component. Can be disabled and optionally rendered as an anchor.\n * Intended to be wrapped with styles and exported as new button type - eg `IconButton` or `Button`.\n *\n * Not to be used externally.\n */\nexport const UnstyledButton = forwardRef(function UnstyledButton<\n C extends React.ElementType = \"button\",\n>(\n {\n as,\n children,\n className,\n disabled,\n ...props\n }: UnstyledButtonPropsFor<C> & { as?: C },\n ref: ForwardedRef<C>,\n): React.ReactElement {\n const Component = as || (\"button\" as const);\n\n const {\n onClick,\n onSubmit,\n onPointerDown,\n onPointerUp,\n onKeyDown,\n onKeyUp,\n onKeyPress,\n ...restProps\n } = props;\n const eventHandlers = disabled\n ? {}\n : {\n onClick,\n onSubmit,\n onPointerDown,\n onPointerUp,\n onKeyDown,\n onKeyUp,\n onKeyPress,\n };\n\n return (\n <Component\n {...restProps}\n ref={ref as Ref<C>}\n className={className}\n // All elements roles should be overriden at the exceptions of anchors\n // We want them to behave like links but look like buttons\n role={as === \"a\" ? \"link\" : \"button\"}\n tabIndex={0}\n {...eventHandlers}\n aria-disabled={disabled}\n >\n {children}\n </Component>\n );\n}) as ButtonComponent;\n"],"names":["UnstyledButton"],"mappings":";;AA+CO,MAAM,iBAAiB,WAAW,SAASA,gBAGhD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GACA,KACoB;AACpB,QAAM,YAAY,MAAO;AAEzB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD;AACJ,QAAM,gBAAgB,WAClB,KACA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAGN,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MAGA,MAAM,OAAO,MAAM,SAAS;AAAA,MAC5B,UAAU;AAAA,MACT,GAAG;AAAA,MACJ,iBAAe;AAAA,MAEd;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ChatFilter.cjs","sources":["../../../src/components/ChatFilter/ChatFilter.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, { ForwardedRef, forwardRef } from \"react\";\nimport {\n UnstyledButton,\n UnstyledButtonPropsFor,\n} from \"../Button/UnstyledButton\";\nimport styles from \"./ChatFilter.module.css\";\n\ntype ChatFilterProps = Omit<UnstyledButtonPropsFor<\"button\">, \"disabled\"> & {\n /**\n * Whether the filter is selected.\n */\n selected?: boolean;\n};\n\n/**\n * A chat filter button.\n */\nexport const ChatFilter = forwardRef(function ChatFilter(\n { children, selected, ...props }: ChatFilterProps,\n ref: ForwardedRef<HTMLButtonElement>,\n): React.ReactElement {\n return (\n <UnstyledButton\n {...props}\n className={styles[\"chat-filter\"]}\n aria-selected={selected}\n as=\"button\"\n ref={ref}\n tabIndex={0}\n >\n {children}\n </UnstyledButton>\n );\n});\n"],"names":["forwardRef","ChatFilter","jsx","UnstyledButton","styles"],"mappings":";;;;;;AAwBa,MAAA,aAAaA,MAAAA,WAAW,SAASC,YAC5C,EAAE,UAAU,UAAU,GAAG,MAAM,GAC/B,KACoB;AAElB,SAAAC,2BAAA;AAAA,IAACC,eAAA;AAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAWC,0BAAO,aAAa;AAAA,MAC/B,iBAAe;AAAA,MACf,IAAG;AAAA,MACH;AAAA,MACA,UAAU;AAAA,MAET;AAAA,IAAA;AAAA,EACH;AAEJ,CAAC;;"}
1
+ {"version":3,"file":"ChatFilter.cjs","sources":["../../../src/components/ChatFilter/ChatFilter.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, { type ForwardedRef, forwardRef } from \"react\";\nimport {\n UnstyledButton,\n type UnstyledButtonPropsFor,\n} from \"../Button/UnstyledButton\";\nimport styles from \"./ChatFilter.module.css\";\n\ntype ChatFilterProps = Omit<UnstyledButtonPropsFor<\"button\">, \"disabled\"> & {\n /**\n * Whether the filter is selected.\n */\n selected?: boolean;\n};\n\n/**\n * A chat filter button.\n */\nexport const ChatFilter = forwardRef(function ChatFilter(\n { children, selected, ...props }: ChatFilterProps,\n ref: ForwardedRef<HTMLButtonElement>,\n): React.ReactElement {\n return (\n <UnstyledButton\n {...props}\n className={styles[\"chat-filter\"]}\n aria-selected={selected}\n as=\"button\"\n ref={ref}\n tabIndex={0}\n >\n {children}\n </UnstyledButton>\n );\n});\n"],"names":["forwardRef","ChatFilter","jsx","UnstyledButton","styles"],"mappings":";;;;;;AAwBO,MAAM,aAAaA,MAAAA,WAAW,SAASC,YAC5C,EAAE,UAAU,UAAU,GAAG,MAAA,GACzB,KACoB;AACpB,SACEC,2BAAAA;AAAAA,IAACC,eAAAA;AAAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAWC,kBAAAA,QAAO,aAAa;AAAA,MAC/B,iBAAe;AAAA,MACf,IAAG;AAAA,MACH;AAAA,MACA,UAAU;AAAA,MAET;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ChatFilter.d.ts","sourceRoot":"","sources":["../../../src/components/ChatFilter/ChatFilter.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAmC,MAAM,OAAO,CAAC;AACxD,OAAO,EAEL,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAGlC,KAAK,eAAe,GAAG,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,GAAG;IAC1E;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,wGAgBrB,CAAC"}
1
+ {"version":3,"file":"ChatFilter.d.ts","sourceRoot":"","sources":["../../../src/components/ChatFilter/ChatFilter.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAC7D,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,0BAA0B,CAAC;AAGlC,KAAK,eAAe,GAAG,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,GAAG;IAC1E;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,wGAgBrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ChatFilter.js","sources":["../../../src/components/ChatFilter/ChatFilter.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, { ForwardedRef, forwardRef } from \"react\";\nimport {\n UnstyledButton,\n UnstyledButtonPropsFor,\n} from \"../Button/UnstyledButton\";\nimport styles from \"./ChatFilter.module.css\";\n\ntype ChatFilterProps = Omit<UnstyledButtonPropsFor<\"button\">, \"disabled\"> & {\n /**\n * Whether the filter is selected.\n */\n selected?: boolean;\n};\n\n/**\n * A chat filter button.\n */\nexport const ChatFilter = forwardRef(function ChatFilter(\n { children, selected, ...props }: ChatFilterProps,\n ref: ForwardedRef<HTMLButtonElement>,\n): React.ReactElement {\n return (\n <UnstyledButton\n {...props}\n className={styles[\"chat-filter\"]}\n aria-selected={selected}\n as=\"button\"\n ref={ref}\n tabIndex={0}\n >\n {children}\n </UnstyledButton>\n );\n});\n"],"names":["ChatFilter"],"mappings":";;;;AAwBa,MAAA,aAAa,WAAW,SAASA,YAC5C,EAAE,UAAU,UAAU,GAAG,MAAM,GAC/B,KACoB;AAElB,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,OAAO,aAAa;AAAA,MAC/B,iBAAe;AAAA,MACf,IAAG;AAAA,MACH;AAAA,MACA,UAAU;AAAA,MAET;AAAA,IAAA;AAAA,EACH;AAEJ,CAAC;"}
1
+ {"version":3,"file":"ChatFilter.js","sources":["../../../src/components/ChatFilter/ChatFilter.tsx"],"sourcesContent":["/*\n * Copyright 2025 New Vector Ltd\n *\n * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\n * Please see LICENSE files in the repository root for full details.\n */\n\nimport React, { type ForwardedRef, forwardRef } from \"react\";\nimport {\n UnstyledButton,\n type UnstyledButtonPropsFor,\n} from \"../Button/UnstyledButton\";\nimport styles from \"./ChatFilter.module.css\";\n\ntype ChatFilterProps = Omit<UnstyledButtonPropsFor<\"button\">, \"disabled\"> & {\n /**\n * Whether the filter is selected.\n */\n selected?: boolean;\n};\n\n/**\n * A chat filter button.\n */\nexport const ChatFilter = forwardRef(function ChatFilter(\n { children, selected, ...props }: ChatFilterProps,\n ref: ForwardedRef<HTMLButtonElement>,\n): React.ReactElement {\n return (\n <UnstyledButton\n {...props}\n className={styles[\"chat-filter\"]}\n aria-selected={selected}\n as=\"button\"\n ref={ref}\n tabIndex={0}\n >\n {children}\n </UnstyledButton>\n );\n});\n"],"names":["ChatFilter"],"mappings":";;;;AAwBO,MAAM,aAAa,WAAW,SAASA,YAC5C,EAAE,UAAU,UAAU,GAAG,MAAA,GACzB,KACoB;AACpB,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAG;AAAA,MACJ,WAAW,OAAO,aAAa;AAAA,MAC/B,iBAAe;AAAA,MACf,IAAG;AAAA,MACH;AAAA,MACA,UAAU;AAAA,MAET;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}