@common-origin/design-system 2.19.0 → 2.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. package/dist/client.js +1012 -512
  2. package/dist/client.js.map +1 -1
  3. package/dist/components/atoms/AILabel/AILabel.d.mts +30 -0
  4. package/dist/components/atoms/AILabel/AILabel.d.ts +30 -0
  5. package/dist/components/atoms/AILabel/AILabel.mjs +94 -0
  6. package/dist/components/atoms/AILabel/AILabel.mjs.map +1 -0
  7. package/dist/components/atoms/AILabel/index.d.mts +1 -0
  8. package/dist/components/atoms/AILabel/index.d.ts +1 -0
  9. package/dist/components/atoms/Avatar/Avatar.d.mts +8 -0
  10. package/dist/components/atoms/Avatar/Avatar.mjs +103 -0
  11. package/dist/components/atoms/Avatar/Avatar.mjs.map +1 -0
  12. package/dist/components/atoms/Avatar/index.d.mts +1 -0
  13. package/dist/components/atoms/Badge/Badge.d.mts +25 -0
  14. package/dist/components/atoms/Badge/Badge.mjs +98 -0
  15. package/dist/components/atoms/Badge/Badge.mjs.map +1 -0
  16. package/dist/components/atoms/Badge/index.d.mts +2 -0
  17. package/dist/components/atoms/Box/Box.d.mts +62 -0
  18. package/dist/components/atoms/Box/Box.mjs +246 -0
  19. package/dist/components/atoms/Box/Box.mjs.map +1 -0
  20. package/dist/components/atoms/Box/index.d.mts +1 -0
  21. package/dist/components/atoms/Button/Button.d.mts +40 -0
  22. package/dist/components/atoms/Button/Button.mjs +208 -0
  23. package/dist/components/atoms/Button/Button.mjs.map +1 -0
  24. package/dist/components/atoms/Button/index.d.mts +1 -0
  25. package/dist/components/atoms/CategoryBadge/CategoryBadge.d.mts +29 -0
  26. package/dist/components/atoms/CategoryBadge/CategoryBadge.mjs +29 -0
  27. package/dist/components/atoms/CategoryBadge/CategoryBadge.mjs.map +1 -0
  28. package/dist/components/atoms/CategoryBadge/index.d.mts +2 -0
  29. package/dist/components/atoms/CategoryLabel/CategoryLabel.d.mts +69 -0
  30. package/dist/components/atoms/CategoryLabel/CategoryLabel.mjs +151 -0
  31. package/dist/components/atoms/CategoryLabel/CategoryLabel.mjs.map +1 -0
  32. package/dist/components/atoms/CategoryLabel/index.d.mts +2 -0
  33. package/dist/components/atoms/Chip/BooleanChip.d.mts +28 -0
  34. package/dist/components/atoms/Chip/BooleanChip.mjs +76 -0
  35. package/dist/components/atoms/Chip/BooleanChip.mjs.map +1 -0
  36. package/dist/components/atoms/Chip/Chip.d.mts +37 -0
  37. package/dist/components/atoms/Chip/Chip.mjs +76 -0
  38. package/dist/components/atoms/Chip/Chip.mjs.map +1 -0
  39. package/dist/components/atoms/Chip/FilterChip.d.mts +13 -0
  40. package/dist/components/atoms/Chip/FilterChip.mjs +14 -0
  41. package/dist/components/atoms/Chip/FilterChip.mjs.map +1 -0
  42. package/dist/components/atoms/Chip/InputChip.d.mts +27 -0
  43. package/dist/components/atoms/Chip/InputChip.mjs +97 -0
  44. package/dist/components/atoms/Chip/InputChip.mjs.map +1 -0
  45. package/dist/components/atoms/Chip/SuggestionChip.d.mts +24 -0
  46. package/dist/components/atoms/Chip/SuggestionChip.d.ts +24 -0
  47. package/dist/components/atoms/Chip/SuggestionChip.mjs +61 -0
  48. package/dist/components/atoms/Chip/SuggestionChip.mjs.map +1 -0
  49. package/dist/components/atoms/Chip/index.d.mts +5 -0
  50. package/dist/components/atoms/Chip/index.d.ts +1 -0
  51. package/dist/components/atoms/Chip/shared/ChipBase.d.mts +12 -0
  52. package/dist/components/atoms/Chip/shared/ChipBase.mjs +45 -0
  53. package/dist/components/atoms/Chip/shared/ChipBase.mjs.map +1 -0
  54. package/dist/components/atoms/Chip/shared/types.d.mts +34 -0
  55. package/dist/components/atoms/Chip/shared/utils.d.mts +10 -0
  56. package/dist/components/atoms/Chip/shared/utils.mjs +46 -0
  57. package/dist/components/atoms/Chip/shared/utils.mjs.map +1 -0
  58. package/dist/components/atoms/Container/Container.d.mts +6 -0
  59. package/dist/components/atoms/Container/Container.mjs +24 -0
  60. package/dist/components/atoms/Container/Container.mjs.map +1 -0
  61. package/dist/components/atoms/Container/index.d.mts +1 -0
  62. package/dist/components/atoms/DateFormatter/DateFormatter.d.mts +23 -0
  63. package/dist/components/atoms/DateFormatter/DateFormatter.mjs +64 -0
  64. package/dist/components/atoms/DateFormatter/DateFormatter.mjs.map +1 -0
  65. package/dist/components/atoms/DateFormatter/index.d.mts +1 -0
  66. package/dist/components/atoms/Divider/Divider.d.mts +30 -0
  67. package/dist/components/atoms/Divider/Divider.mjs +134 -0
  68. package/dist/components/atoms/Divider/Divider.mjs.map +1 -0
  69. package/dist/components/atoms/Divider/index.d.mts +1 -0
  70. package/dist/components/atoms/Icon/Icon.d.mts +22 -0
  71. package/dist/components/atoms/Icon/Icon.mjs +95 -0
  72. package/dist/components/atoms/Icon/Icon.mjs.map +1 -0
  73. package/dist/components/atoms/Icon/index.d.mts +1 -0
  74. package/dist/components/atoms/IconButton/IconButton.d.mts +14 -0
  75. package/dist/components/atoms/IconButton/IconButton.mjs +150 -0
  76. package/dist/components/atoms/IconButton/IconButton.mjs.map +1 -0
  77. package/dist/components/atoms/IconButton/index.d.mts +1 -0
  78. package/dist/components/atoms/MoneyDisplay/MoneyDisplay.d.mts +26 -0
  79. package/dist/components/atoms/MoneyDisplay/MoneyDisplay.mjs +126 -0
  80. package/dist/components/atoms/MoneyDisplay/MoneyDisplay.mjs.map +1 -0
  81. package/dist/components/atoms/MoneyDisplay/index.d.mts +2 -0
  82. package/dist/components/atoms/Picture/Picture.d.mts +12 -0
  83. package/dist/components/atoms/Picture/Picture.mjs +65 -0
  84. package/dist/components/atoms/Picture/Picture.mjs.map +1 -0
  85. package/dist/components/atoms/Picture/index.d.mts +1 -0
  86. package/dist/components/atoms/ProgressBar/ProgressBar.d.mts +21 -0
  87. package/dist/components/atoms/ProgressBar/ProgressBar.mjs +91 -0
  88. package/dist/components/atoms/ProgressBar/ProgressBar.mjs.map +1 -0
  89. package/dist/components/atoms/ProgressBar/index.d.mts +2 -0
  90. package/dist/components/atoms/Stack/Stack.d.mts +16 -0
  91. package/dist/components/atoms/Stack/Stack.mjs +71 -0
  92. package/dist/components/atoms/Stack/Stack.mjs.map +1 -0
  93. package/dist/components/atoms/Stack/index.d.mts +1 -0
  94. package/dist/components/atoms/StatusBadge/StatusBadge.d.mts +23 -0
  95. package/dist/components/atoms/StatusBadge/StatusBadge.mjs +18 -0
  96. package/dist/components/atoms/StatusBadge/StatusBadge.mjs.map +1 -0
  97. package/dist/components/atoms/StatusBadge/index.d.mts +2 -0
  98. package/dist/components/atoms/StatusLabel/StatusLabel.d.mts +17 -0
  99. package/dist/components/atoms/StatusLabel/StatusLabel.mjs +28 -0
  100. package/dist/components/atoms/StatusLabel/StatusLabel.mjs.map +1 -0
  101. package/dist/components/atoms/StatusLabel/StatusLabelBase.d.mts +49 -0
  102. package/dist/components/atoms/StatusLabel/StatusLabelBase.mjs +161 -0
  103. package/dist/components/atoms/StatusLabel/StatusLabelBase.mjs.map +1 -0
  104. package/dist/components/atoms/StatusLabel/index.d.mts +2 -0
  105. package/dist/components/atoms/Tag/Tag.d.mts +36 -0
  106. package/dist/components/atoms/Tag/Tag.mjs +115 -0
  107. package/dist/components/atoms/Tag/Tag.mjs.map +1 -0
  108. package/dist/components/atoms/Tag/index.d.mts +2 -0
  109. package/dist/components/atoms/Typography/Typography.d.mts +34 -0
  110. package/dist/components/atoms/Typography/Typography.mjs +139 -0
  111. package/dist/components/atoms/Typography/Typography.mjs.map +1 -0
  112. package/dist/components/atoms/Typography/index.d.mts +1 -0
  113. package/dist/components/atoms/index.d.mts +21 -0
  114. package/dist/components/atoms/index.d.ts +1 -0
  115. package/dist/components/index.d.mts +4 -0
  116. package/dist/components/layout/GridSystem/GridSystem.d.mts +58 -0
  117. package/dist/components/layout/GridSystem/GridSystem.mjs +221 -0
  118. package/dist/components/layout/GridSystem/GridSystem.mjs.map +1 -0
  119. package/dist/components/layout/GridSystem/index.d.mts +1 -0
  120. package/dist/components/layout/index.d.mts +1 -0
  121. package/dist/components/molecules/AccountCard/AccountCard.d.mts +44 -0
  122. package/dist/components/molecules/AccountCard/AccountCard.mjs +191 -0
  123. package/dist/components/molecules/AccountCard/AccountCard.mjs.map +1 -0
  124. package/dist/components/molecules/AccountCard/index.d.mts +2 -0
  125. package/dist/components/molecules/ActionSheet/ActionSheet.d.mts +111 -0
  126. package/dist/components/molecules/ActionSheet/ActionSheet.mjs +283 -0
  127. package/dist/components/molecules/ActionSheet/ActionSheet.mjs.map +1 -0
  128. package/dist/components/molecules/ActionSheet/index.d.mts +2 -0
  129. package/dist/components/molecules/AgentInput/AgentInput.d.mts +92 -0
  130. package/dist/components/molecules/AgentInput/AgentInput.d.ts +63 -1
  131. package/dist/components/molecules/AgentInput/AgentInput.mjs +1099 -0
  132. package/dist/components/molecules/AgentInput/AgentInput.mjs.map +1 -0
  133. package/dist/components/molecules/AgentInput/agentInputSpeech.d.mts +45 -0
  134. package/dist/components/molecules/AgentInput/agentInputSpeech.d.ts +2 -0
  135. package/dist/components/molecules/AgentInput/agentInputSpeech.mjs +53 -0
  136. package/dist/components/molecules/AgentInput/agentInputSpeech.mjs.map +1 -0
  137. package/dist/components/molecules/AgentInput/agentInputStateMachine.d.mts +29 -0
  138. package/dist/components/molecules/AgentInput/agentInputStateMachine.mjs +55 -0
  139. package/dist/components/molecules/AgentInput/agentInputStateMachine.mjs.map +1 -0
  140. package/dist/components/molecules/AgentInput/index.d.mts +3 -0
  141. package/dist/components/molecules/AgentInput/index.d.ts +1 -1
  142. package/dist/components/molecules/Alert/Alert.d.mts +68 -0
  143. package/dist/components/molecules/Alert/Alert.mjs +284 -0
  144. package/dist/components/molecules/Alert/Alert.mjs.map +1 -0
  145. package/dist/components/molecules/Alert/index.d.mts +1 -0
  146. package/dist/components/molecules/Breadcrumbs/Breadcrumbs.d.mts +16 -0
  147. package/dist/components/molecules/Breadcrumbs/Breadcrumbs.mjs +74 -0
  148. package/dist/components/molecules/Breadcrumbs/Breadcrumbs.mjs.map +1 -0
  149. package/dist/components/molecules/Breadcrumbs/index.d.mts +1 -0
  150. package/dist/components/molecules/CardLarge/CardLarge.d.mts +12 -0
  151. package/dist/components/molecules/CardLarge/CardLarge.mjs +76 -0
  152. package/dist/components/molecules/CardLarge/CardLarge.mjs.map +1 -0
  153. package/dist/components/molecules/CardLarge/index.d.mts +1 -0
  154. package/dist/components/molecules/CardSmall/CardSmall.d.mts +16 -0
  155. package/dist/components/molecules/CardSmall/CardSmall.mjs +73 -0
  156. package/dist/components/molecules/CardSmall/CardSmall.mjs.map +1 -0
  157. package/dist/components/molecules/CardSmall/index.d.mts +1 -0
  158. package/dist/components/molecules/Checkbox/Checkbox.d.mts +64 -0
  159. package/dist/components/molecules/Checkbox/Checkbox.mjs +139 -0
  160. package/dist/components/molecules/Checkbox/Checkbox.mjs.map +1 -0
  161. package/dist/components/molecules/Checkbox/SelectableInputBase.d.mts +40 -0
  162. package/dist/components/molecules/Checkbox/SelectableInputBase.mjs +99 -0
  163. package/dist/components/molecules/Checkbox/SelectableInputBase.mjs.map +1 -0
  164. package/dist/components/molecules/Checkbox/index.d.mts +3 -0
  165. package/dist/components/molecules/ChipGroup/ChipGroup.d.mts +7 -0
  166. package/dist/components/molecules/ChipGroup/ChipGroup.mjs +56 -0
  167. package/dist/components/molecules/ChipGroup/ChipGroup.mjs.map +1 -0
  168. package/dist/components/molecules/ChipGroup/index.d.mts +1 -0
  169. package/dist/components/molecules/CodeBlock/CodeBlock.d.mts +46 -0
  170. package/dist/components/molecules/CodeBlock/CodeBlock.mjs +231 -0
  171. package/dist/components/molecules/CodeBlock/CodeBlock.mjs.map +1 -0
  172. package/dist/components/molecules/CodeBlock/index.d.mts +1 -0
  173. package/dist/components/molecules/DateGroup/DateGroup.d.mts +37 -0
  174. package/dist/components/molecules/DateGroup/DateGroup.mjs +104 -0
  175. package/dist/components/molecules/DateGroup/DateGroup.mjs.map +1 -0
  176. package/dist/components/molecules/DateGroup/index.d.mts +2 -0
  177. package/dist/components/molecules/Dropdown/Dropdown.d.mts +27 -0
  178. package/dist/components/molecules/Dropdown/Dropdown.mjs +282 -0
  179. package/dist/components/molecules/Dropdown/Dropdown.mjs.map +1 -0
  180. package/dist/components/molecules/Dropdown/index.d.mts +1 -0
  181. package/dist/components/molecules/EmptyState/EmptyState.d.mts +32 -0
  182. package/dist/components/molecules/EmptyState/EmptyState.mjs +133 -0
  183. package/dist/components/molecules/EmptyState/EmptyState.mjs.map +1 -0
  184. package/dist/components/molecules/EmptyState/index.d.mts +2 -0
  185. package/dist/components/molecules/FeatureBlock/FeatureBlock.d.mts +14 -0
  186. package/dist/components/molecules/FeatureBlock/FeatureBlock.mjs +100 -0
  187. package/dist/components/molecules/FeatureBlock/FeatureBlock.mjs.map +1 -0
  188. package/dist/components/molecules/FeatureBlock/index.d.mts +1 -0
  189. package/dist/components/molecules/InlineAlert/InlineAlert.d.mts +54 -0
  190. package/dist/components/molecules/InlineAlert/InlineAlert.mjs +140 -0
  191. package/dist/components/molecules/InlineAlert/InlineAlert.mjs.map +1 -0
  192. package/dist/components/molecules/InlineAlert/index.d.mts +2 -0
  193. package/dist/components/molecules/List/List.d.mts +30 -0
  194. package/dist/components/molecules/List/List.mjs +45 -0
  195. package/dist/components/molecules/List/List.mjs.map +1 -0
  196. package/dist/components/molecules/List/ListContext.d.mts +6 -0
  197. package/dist/components/molecules/List/ListContext.mjs +11 -0
  198. package/dist/components/molecules/List/ListContext.mjs.map +1 -0
  199. package/dist/components/molecules/List/ListItem.d.mts +101 -0
  200. package/dist/components/molecules/List/ListItem.mjs +224 -0
  201. package/dist/components/molecules/List/ListItem.mjs.map +1 -0
  202. package/dist/components/molecules/List/index.d.mts +4 -0
  203. package/dist/components/molecules/Modal/Modal.d.mts +69 -0
  204. package/dist/components/molecules/Modal/Modal.mjs +259 -0
  205. package/dist/components/molecules/Modal/Modal.mjs.map +1 -0
  206. package/dist/components/molecules/Modal/index.d.mts +2 -0
  207. package/dist/components/molecules/NumberInput/NumberInput.d.mts +86 -0
  208. package/dist/components/molecules/NumberInput/NumberInput.mjs +268 -0
  209. package/dist/components/molecules/NumberInput/NumberInput.mjs.map +1 -0
  210. package/dist/components/molecules/NumberInput/index.d.mts +2 -0
  211. package/dist/components/molecules/PageTitle/PageTitle.d.mts +21 -0
  212. package/dist/components/molecules/PageTitle/PageTitle.mjs +77 -0
  213. package/dist/components/molecules/PageTitle/PageTitle.mjs.map +1 -0
  214. package/dist/components/molecules/PageTitle/index.d.mts +1 -0
  215. package/dist/components/molecules/PasswordField/PasswordField.d.mts +55 -0
  216. package/dist/components/molecules/PasswordField/PasswordField.mjs +146 -0
  217. package/dist/components/molecules/PasswordField/PasswordField.mjs.map +1 -0
  218. package/dist/components/molecules/PasswordField/index.d.mts +2 -0
  219. package/dist/components/molecules/SearchField/SearchField.d.mts +108 -0
  220. package/dist/components/molecules/SearchField/SearchField.mjs +340 -0
  221. package/dist/components/molecules/SearchField/SearchField.mjs.map +1 -0
  222. package/dist/components/molecules/SearchField/index.d.mts +2 -0
  223. package/dist/components/molecules/Sheet/Sheet.d.mts +96 -0
  224. package/dist/components/molecules/Sheet/Sheet.mjs +243 -0
  225. package/dist/components/molecules/Sheet/Sheet.mjs.map +1 -0
  226. package/dist/components/molecules/Sheet/index.d.mts +2 -0
  227. package/dist/components/molecules/Slider/Slider.d.mts +102 -0
  228. package/dist/components/molecules/Slider/Slider.mjs +462 -0
  229. package/dist/components/molecules/Slider/Slider.mjs.map +1 -0
  230. package/dist/components/molecules/Slider/index.d.mts +2 -0
  231. package/dist/components/molecules/TabBar/TabBar.d.mts +82 -0
  232. package/dist/components/molecules/TabBar/TabBar.mjs +213 -0
  233. package/dist/components/molecules/TabBar/TabBar.mjs.map +1 -0
  234. package/dist/components/molecules/TabBar/index.d.mts +2 -0
  235. package/dist/components/molecules/TextField/InputBase.d.mts +22 -0
  236. package/dist/components/molecules/TextField/InputBase.mjs +56 -0
  237. package/dist/components/molecules/TextField/InputBase.mjs.map +1 -0
  238. package/dist/components/molecules/TextField/TextField.d.mts +56 -0
  239. package/dist/components/molecules/TextField/TextField.mjs +115 -0
  240. package/dist/components/molecules/TextField/TextField.mjs.map +1 -0
  241. package/dist/components/molecules/TextField/index.d.mts +4 -0
  242. package/dist/components/molecules/TransactionListItem/TransactionListItem.d.mts +39 -0
  243. package/dist/components/molecules/TransactionListItem/TransactionListItem.mjs +224 -0
  244. package/dist/components/molecules/TransactionListItem/TransactionListItem.mjs.map +1 -0
  245. package/dist/components/molecules/TransactionListItem/index.d.mts +2 -0
  246. package/dist/components/molecules/index.d.mts +26 -0
  247. package/dist/data.js +316 -3
  248. package/dist/data.js.map +1 -1
  249. package/dist/index.d.mts +3 -0
  250. package/dist/index.js +2 -0
  251. package/dist/index.js.map +1 -1
  252. package/dist/index.mjs +57 -0
  253. package/dist/index.mjs.map +1 -0
  254. package/dist/lib/cssTokens.d.mts +14 -0
  255. package/dist/lib/cssTokens.mjs +19 -0
  256. package/dist/lib/cssTokens.mjs.map +1 -0
  257. package/dist/lib/cssVariables.d.mts +15 -0
  258. package/dist/lib/cssVariables.mjs +37 -0
  259. package/dist/lib/cssVariables.mjs.map +1 -0
  260. package/dist/lib/styleUtils.d.mts +42 -0
  261. package/dist/lib/styleUtils.mjs +160 -0
  262. package/dist/lib/styleUtils.mjs.map +1 -0
  263. package/dist/lib/tokenAliases.d.mts +13 -0
  264. package/dist/lib/tokenAliases.mjs +122 -0
  265. package/dist/lib/tokenAliases.mjs.map +1 -0
  266. package/dist/lib/usePresence.d.mts +16 -0
  267. package/dist/lib/usePresence.mjs +50 -0
  268. package/dist/lib/usePresence.mjs.map +1 -0
  269. package/dist/styles/icons.json +30 -1
  270. package/dist/{data.esm.js → styles/icons.json.mjs} +33 -1466
  271. package/dist/styles/icons.json.mjs.map +1 -0
  272. package/dist/styles/tokens.d.mts +3718 -0
  273. package/dist/styles/tokens.d.ts +545 -1
  274. package/dist/styles/tokens.json +284 -2
  275. package/dist/styles/tokens.json.mjs +1736 -0
  276. package/dist/{tokens/index.esm.js.map → styles/tokens.json.mjs.map} +1 -1
  277. package/dist/tokens/index.js +284 -2
  278. package/dist/tokens/index.js.map +1 -1
  279. package/dist/tokens/{index.esm.js → index.mjs} +285 -3
  280. package/dist/tokens/index.mjs.map +1 -0
  281. package/dist/tokens/styles/tokens.d.mts +3718 -0
  282. package/dist/tokens/styles/tokens.d.ts +545 -1
  283. package/dist/tokens/tokens.d.mts +4 -0
  284. package/dist/tokens/types/tokens.d.mts +6 -0
  285. package/dist/tokens.css +242 -0
  286. package/dist/tokens.css.d.mts +4 -0
  287. package/dist/types/icons.d.mts +25 -0
  288. package/dist/types/icons.d.ts +1 -1
  289. package/dist/types/icons.mjs +10 -0
  290. package/dist/types/icons.mjs.map +1 -0
  291. package/dist/types/index.d.mts +1 -0
  292. package/dist/types/tokens.d.mts +6 -0
  293. package/dist/types/tokens.mjs +10 -0
  294. package/dist/types/tokens.mjs.map +1 -0
  295. package/dist/vendor/tslib/tslib.es6.mjs +99 -0
  296. package/dist/vendor/tslib/tslib.es6.mjs.map +1 -0
  297. package/package.json +26 -12
  298. package/dist/client.esm.js +0 -8289
  299. package/dist/client.esm.js.map +0 -1
  300. package/dist/data.esm.js.map +0 -1
  301. package/dist/index.esm.js +0 -8
  302. package/dist/index.esm.js.map +0 -1
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import { type IconName } from '../../atoms/Icon/index.mjs';
3
+ export type AccountType = 'checking' | 'savings' | 'credit' | 'investment' | 'loan';
4
+ export type TrendDirection = 'up' | 'down' | 'neutral';
5
+ export interface AccountCardAction {
6
+ label: string;
7
+ onClick: () => void;
8
+ icon?: IconName;
9
+ variant?: 'primary' | 'secondary' | 'naked';
10
+ }
11
+ export interface AccountCardProps {
12
+ /** Type of account */
13
+ accountType: AccountType;
14
+ /** Display name of the account */
15
+ accountName: string;
16
+ /** Account balance */
17
+ balance: number;
18
+ /** Optional account number (last 4 digits) */
19
+ accountNumber?: string;
20
+ /** Trend direction for balance change */
21
+ trend?: TrendDirection;
22
+ /** Trend value (e.g., percentage or amount) */
23
+ trendValue?: string;
24
+ /** Primary action button */
25
+ action?: AccountCardAction;
26
+ /** Secondary action button */
27
+ secondaryAction?: AccountCardAction;
28
+ /** Currency code */
29
+ currency?: string;
30
+ /** Whether the card should be interactive (clickable) */
31
+ onClick?: () => void;
32
+ /** Test identifier for automated testing */
33
+ 'data-testid'?: string;
34
+ }
35
+ /**
36
+ * AccountCard component
37
+ *
38
+ * Displays account information in a card format with account type icon,
39
+ * name, balance, optional trend indicator, and action buttons. Minimum
40
+ * 300x200px with elevation and hover effects.
41
+ *
42
+ * Composes: Stack, Box, Avatar, Typography, MoneyDisplay, Button
43
+ */
44
+ export declare const AccountCard: React.FC<AccountCardProps>;
@@ -0,0 +1,191 @@
1
+ 'use client';
2
+ import { __makeTemplateObject } from '../../../vendor/tslib/tslib.es6.mjs';
3
+ import { jsx, jsxs } from 'react/jsx-runtime';
4
+ import styled$module from 'styled-components';
5
+ const styled = styled$module.default || styled$module;
6
+ import { Stack } from '../../atoms/Stack/Stack.mjs';
7
+ import { Box } from '../../atoms/Box/Box.mjs';
8
+ import { Typography } from '../../atoms/Typography/Typography.mjs';
9
+ import { MoneyDisplay } from '../../atoms/MoneyDisplay/MoneyDisplay.mjs';
10
+ import { Button } from '../../atoms/Button/Button.mjs';
11
+ import { CategoryLabel } from '../../atoms/CategoryLabel/CategoryLabel.mjs';
12
+ import { Avatar } from '../../atoms/Avatar/Avatar.mjs';
13
+ import tokens from '../../../lib/cssTokens.mjs';
14
+
15
+ // Destructure tokens for cleaner access
16
+ var semantic = tokens.semantic;
17
+ var space = semantic.space;
18
+ var StyledBalanceSection = /*#__PURE__*/styled.div.withConfig({
19
+ displayName: "AccountCard__StyledBalanceSection",
20
+ componentId: "sc-1erp7zn-0"
21
+ })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-bottom: ", ";\n"], ["\n margin-bottom: ", ";\n"])), space[400]);
22
+ var StyledTrendSection = /*#__PURE__*/styled.div.withConfig({
23
+ displayName: "AccountCard__StyledTrendSection",
24
+ componentId: "sc-1erp7zn-1"
25
+ })(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: ", ";\n"], ["\n display: flex;\n align-items: center;\n gap: ", ";\n"])), space[100]);
26
+ /*#__PURE__*/styled.div.withConfig({
27
+ displayName: "AccountCard__StyledActions",
28
+ componentId: "sc-1erp7zn-2"
29
+ })(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n gap: ", ";\n margin-top: auto;\n"], ["\n display: flex;\n gap: ", ";\n margin-top: auto;\n"])), space[200]);
30
+ var StyledStackWrapper = /*#__PURE__*/styled.div.withConfig({
31
+ displayName: "AccountCard__StyledStackWrapper",
32
+ componentId: "sc-1erp7zn-3"
33
+ })(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 100%;\n"], ["\n height: 100%;\n"])));
34
+ var StyledHeaderWrapper = /*#__PURE__*/styled.div.withConfig({
35
+ displayName: "AccountCard__StyledHeaderWrapper",
36
+ componentId: "sc-1erp7zn-4"
37
+ })(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n min-height: ", ";\n display: flex;\n flex-direction: column;\n justify-content: center;\n gap: ", ";\n\n & > span {\n margin-top: calc(-1 * ", ");\n }\n"], ["\n min-height: ", ";\n display: flex;\n flex-direction: column;\n justify-content: center;\n gap: ", ";\n\n & > span {\n margin-top: calc(-1 * ", ");\n }\n"
38
+ // Map trend direction to icon and color
39
+ ])), tokens.component.accountCard.header.minHeight, space[0], space[100]);
40
+ // Map trend direction to icon and color
41
+ var trendToIcon = {
42
+ up: 'arrowUp',
43
+ down: 'arrowDown',
44
+ neutral: 'arrowRight'
45
+ };
46
+ var trendToColor = {
47
+ up: 'green',
48
+ down: 'red',
49
+ neutral: 'blue'
50
+ };
51
+ /**
52
+ * AccountCard component
53
+ *
54
+ * Displays account information in a card format with account type icon,
55
+ * name, balance, optional trend indicator, and action buttons. Minimum
56
+ * 300x200px with elevation and hover effects.
57
+ *
58
+ * Composes: Stack, Box, Avatar, Typography, MoneyDisplay, Button
59
+ */
60
+ var AccountCard = function AccountCard(_a) {
61
+ var accountName = _a.accountName,
62
+ balance = _a.balance,
63
+ accountNumber = _a.accountNumber,
64
+ trend = _a.trend,
65
+ trendValue = _a.trendValue,
66
+ action = _a.action,
67
+ secondaryAction = _a.secondaryAction,
68
+ _b = _a.currency,
69
+ currency = _b === void 0 ? 'AUD' : _b,
70
+ onClick = _a.onClick,
71
+ dataTestId = _a["data-testid"];
72
+ var isClickable = !!onClick;
73
+ // Get trend icon and color
74
+ var trendIcon = trend ? trendToIcon[trend] : undefined;
75
+ var trendColor = trend ? trendToColor[trend] : undefined;
76
+ var handleClick = function handleClick() {
77
+ if (isClickable && onClick) {
78
+ onClick();
79
+ }
80
+ };
81
+ var handleKeyDown = function handleKeyDown(e) {
82
+ if (isClickable && (e.key === 'Enter' || e.key === ' ')) {
83
+ e.preventDefault();
84
+ onClick === null || onClick === void 0 ? void 0 : onClick();
85
+ }
86
+ };
87
+ return jsx(Box, {
88
+ minWidth: tokens.component.accountCard.minWidth,
89
+ p: "lg",
90
+ bg: "subtle",
91
+ border: "default",
92
+ borderRadius: "xl",
93
+ transition: "box-shadow ".concat(semantic.motion.duration.moderate, " ").concat(semantic.motion.easing.decelerate),
94
+ cursor: isClickable ? 'pointer' : 'default',
95
+ hoverShadow: isClickable ? 'floating' : undefined,
96
+ onClick: handleClick,
97
+ onKeyDown: handleKeyDown,
98
+ tabIndex: isClickable ? 0 : undefined,
99
+ role: isClickable ? 'button' : 'article',
100
+ "aria-label": isClickable ? "".concat(accountName, " account, balance ").concat(balance) : undefined,
101
+ "data-testid": dataTestId,
102
+ children: jsx(StyledStackWrapper, {
103
+ children: jsxs(Stack, {
104
+ direction: "row",
105
+ justifyContent: "space-between",
106
+ children: [jsxs(Stack, {
107
+ direction: "row",
108
+ gap: "md",
109
+ children: [jsx(Avatar, {
110
+ name: accountName,
111
+ size: "lg",
112
+ "data-testid": dataTestId ? "".concat(dataTestId, "-avatar") : undefined
113
+ }), jsxs(Stack, {
114
+ direction: "column",
115
+ justifyContent: "space-between",
116
+ alignItems: "stretch",
117
+ gap: "md",
118
+ children: [jsx(Stack, {
119
+ direction: "row",
120
+ gap: "md",
121
+ alignItems: "center",
122
+ children: jsxs(StyledHeaderWrapper, {
123
+ children: [jsx(Typography, {
124
+ variant: "h4",
125
+ children: accountName
126
+ }), accountNumber && jsxs(Typography, {
127
+ variant: "small",
128
+ color: "subdued",
129
+ children: ["\u2022\u2022\u2022\u2022 ", accountNumber]
130
+ })]
131
+ })
132
+ }), jsx(StyledBalanceSection, {
133
+ children: jsxs(Stack, {
134
+ direction: "row",
135
+ gap: "sm",
136
+ children: [jsx(MoneyDisplay, {
137
+ amount: balance,
138
+ currency: currency,
139
+ size: "medium",
140
+ "data-testid": dataTestId ? "".concat(dataTestId, "-balance") : undefined
141
+ }), jsx(Typography, {
142
+ color: "subdued",
143
+ children: "Available"
144
+ }), trend && trendValue && jsx(StyledTrendSection, {
145
+ "aria-label": "Trend ".concat(trend),
146
+ role: "img",
147
+ children: jsx(CategoryLabel, {
148
+ size: "medium",
149
+ icon: trendIcon,
150
+ color: trendColor,
151
+ variant: "minimal",
152
+ children: trendValue
153
+ })
154
+ })]
155
+ })
156
+ })]
157
+ })]
158
+ }), (action || secondaryAction) && jsxs(Stack, {
159
+ direction: "row",
160
+ gap: "sm",
161
+ justifyContent: "flex-end",
162
+ children: [secondaryAction && jsx(Button, {
163
+ onClick: function onClick(e) {
164
+ e.stopPropagation();
165
+ secondaryAction.onClick();
166
+ },
167
+ variant: secondaryAction.variant || 'secondary',
168
+ iconName: secondaryAction.icon,
169
+ "data-testid": dataTestId ? "".concat(dataTestId, "-secondary-action") : undefined,
170
+ size: "small",
171
+ children: secondaryAction.label
172
+ }), action && jsx(Button, {
173
+ onClick: function onClick(e) {
174
+ e.stopPropagation();
175
+ action.onClick();
176
+ },
177
+ variant: action.variant || 'primary',
178
+ iconName: action.icon,
179
+ "data-testid": dataTestId ? "".concat(dataTestId, "-action") : undefined,
180
+ size: "small",
181
+ children: action.label
182
+ })]
183
+ })]
184
+ })
185
+ })
186
+ });
187
+ };
188
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
189
+
190
+ export { AccountCard };
191
+ //# sourceMappingURL=AccountCard.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountCard.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export { AccountCard } from './AccountCard.mjs';
2
+ export type { AccountCardProps, AccountType, TrendDirection, AccountCardAction } from './AccountCard.mjs';
@@ -0,0 +1,111 @@
1
+ import React from 'react';
2
+ import { type IconName } from '../../../types/icons.mjs';
3
+ /**
4
+ * Action item for the action sheet
5
+ */
6
+ export interface Action {
7
+ /**
8
+ * Unique identifier
9
+ */
10
+ id: string;
11
+ /**
12
+ * Display label
13
+ */
14
+ label: string;
15
+ /**
16
+ * Optional icon
17
+ */
18
+ icon?: IconName;
19
+ /**
20
+ * Whether this is a destructive action (shown in red)
21
+ * @default false
22
+ */
23
+ destructive?: boolean;
24
+ /**
25
+ * Whether this action is disabled
26
+ * @default false
27
+ */
28
+ disabled?: boolean;
29
+ /**
30
+ * Callback when action is selected
31
+ */
32
+ onSelect: () => void;
33
+ }
34
+ /**
35
+ * Props for the ActionSheet component
36
+ */
37
+ export interface ActionSheetProps {
38
+ /**
39
+ * Whether the action sheet is open
40
+ */
41
+ isOpen: boolean;
42
+ /**
43
+ * Callback when the action sheet should close
44
+ */
45
+ onClose: () => void;
46
+ /**
47
+ * Title of the action sheet
48
+ */
49
+ title?: string;
50
+ /**
51
+ * Optional description
52
+ */
53
+ description?: string;
54
+ /**
55
+ * Array of actions
56
+ */
57
+ actions: Action[];
58
+ /**
59
+ * Whether to close on overlay click
60
+ * @default true
61
+ */
62
+ closeOnOverlayClick?: boolean;
63
+ /**
64
+ * Whether to close on Escape key
65
+ * @default true
66
+ */
67
+ closeOnEscape?: boolean;
68
+ /**
69
+ * Show close button in header
70
+ * @default true
71
+ */
72
+ showCloseButton?: boolean;
73
+ /**
74
+ * Test identifier
75
+ */
76
+ 'data-testid'?: string;
77
+ }
78
+ /**
79
+ * ActionSheet component for bottom sheet modals
80
+ *
81
+ * Displays a modal action sheet that slides up from the bottom,
82
+ * providing a list of actions for the user to choose from.
83
+ * Includes focus trapping, keyboard navigation, and accessibility features.
84
+ *
85
+ * @example
86
+ * ```tsx
87
+ * const [isOpen, setIsOpen] = useState(false)
88
+ *
89
+ * <ActionSheet
90
+ * isOpen={isOpen}
91
+ * onClose={() => setIsOpen(false)}
92
+ * title="Choose an action"
93
+ * actions={[
94
+ * {
95
+ * id: 'edit',
96
+ * label: 'Edit',
97
+ * icon: 'edit',
98
+ * onSelect: () => console.log('Edit')
99
+ * },
100
+ * {
101
+ * id: 'delete',
102
+ * label: 'Delete',
103
+ * icon: 'trash',
104
+ * destructive: true,
105
+ * onSelect: () => console.log('Delete')
106
+ * }
107
+ * ]}
108
+ * />
109
+ * ```
110
+ */
111
+ export declare const ActionSheet: ({ isOpen, onClose, title, description, actions, closeOnOverlayClick, closeOnEscape, showCloseButton, "data-testid": dataTestId }: ActionSheetProps) => React.ReactPortal | null;
@@ -0,0 +1,283 @@
1
+ 'use client';
2
+ import { __makeTemplateObject } from '../../../vendor/tslib/tslib.es6.mjs';
3
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
4
+ import React, { useRef, useEffect } from 'react';
5
+ import { createPortal } from 'react-dom';
6
+ import styled$module, { keyframes } from 'styled-components';
7
+ const styled = styled$module.default || styled$module;
8
+ import { Divider } from '../../atoms/Divider/Divider.mjs';
9
+ import { Icon } from '../../atoms/Icon/Icon.mjs';
10
+ import { Stack } from '../../atoms/Stack/Stack.mjs';
11
+ import { Typography } from '../../atoms/Typography/Typography.mjs';
12
+ import { ListItem } from '../List/ListItem.mjs';
13
+ import tokens from '../../../lib/cssTokens.mjs';
14
+ import { exitAnimation, reducedMotion } from '../../../lib/styleUtils.mjs';
15
+ import { usePresence, useInert } from '../../../lib/usePresence.mjs';
16
+
17
+ var _a = tokens.semantic,
18
+ color = _a.color,
19
+ border = _a.border,
20
+ space = _a.space,
21
+ motion = _a.motion,
22
+ elevation = _a.elevation;
23
+ var slideUp = keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n from {\n transform: translateY(100%);\n }\n to {\n transform: translateY(0);\n }\n"], ["\n from {\n transform: translateY(100%);\n }\n to {\n transform: translateY(0);\n }\n"])));
24
+ var fadeIn = keyframes(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n"], ["\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n"])));
25
+ var StyledOverlay = /*#__PURE__*/styled.div.withConfig({
26
+ displayName: "ActionSheet__StyledOverlay",
27
+ componentId: "sc-regbol-0"
28
+ })(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: fixed;\n inset: 0;\n background-color: ", ";\n z-index: ", ";\n animation: ", " ", " ", "", ";\n"], ["\n position: fixed;\n inset: 0;\n background-color: ", ";\n z-index: ", ";\n animation: ", " ", " ", "", ";\n"])), tokens.semantic.surface.scrim, tokens.semantic.layer.modal, fadeIn, motion.duration.moderate, motion.easing.decelerate, function (_a) {
29
+ var $isExiting = _a.$isExiting;
30
+ return $isExiting && exitAnimation;
31
+ });
32
+ var StyledActionSheet = /*#__PURE__*/styled.div.withConfig({
33
+ displayName: "ActionSheet__StyledActionSheet",
34
+ componentId: "sc-regbol-1"
35
+ })(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: ", ";\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n box-shadow: ", ";\n max-height: 90vh;\n overflow-y: auto;\n z-index: ", ";\n animation: ", " ", " ", "", ";\n\n ", " {\n animation: ", " ", " ", "", ";\n }\n\n"], ["\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: ", ";\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n box-shadow: ", ";\n max-height: 90vh;\n overflow-y: auto;\n z-index: ", ";\n animation: ", " ", " ", "", ";\n\n ", " {\n animation: ", " ", " ", "", ";\n }\n\n"])), tokens.semantic.surface.raised, tokens.semantic.radius.lg, tokens.semantic.radius.lg, elevation.overlay, tokens.semantic.layer.modal, slideUp, motion.duration.slow, motion.easing.decelerate, function (_a) {
36
+ var $isExiting = _a.$isExiting;
37
+ return $isExiting && exitAnimation;
38
+ }, reducedMotion, fadeIn, motion.duration.slow, motion.easing.decelerate, function (_a) {
39
+ var $isExiting = _a.$isExiting;
40
+ return $isExiting && exitAnimation;
41
+ });
42
+ var StyledHeader = /*#__PURE__*/styled.div.withConfig({
43
+ displayName: "ActionSheet__StyledHeader",
44
+ componentId: "sc-regbol-2"
45
+ })(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n padding: ", " ", " ", ";\n border-bottom: ", ";\n"], ["\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n padding: ", " ", " ", ";\n border-bottom: ", ";\n"])), space[400], space[400], space[300], border["default"]);
46
+ var StyledHeaderContent = /*#__PURE__*/styled.div.withConfig({
47
+ displayName: "ActionSheet__StyledHeaderContent",
48
+ componentId: "sc-regbol-3"
49
+ })(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n flex: 1;\n"], ["\n flex: 1;\n"])));
50
+ var StyledCloseButton = /*#__PURE__*/styled.button.withConfig({
51
+ displayName: "ActionSheet__StyledCloseButton",
52
+ componentId: "sc-regbol-4"
53
+ })(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n padding: ", ";\n border: none;\n background: transparent;\n color: ", ";\n cursor: pointer;\n border-radius: ", ";\n transition: ", ";\n margin-left: ", ";\n \n &:hover {\n color: ", ";\n background-color: ", ";\n }\n \n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n }\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n padding: ", ";\n border: none;\n background: transparent;\n color: ", ";\n cursor: pointer;\n border-radius: ", ";\n transition: ", ";\n margin-left: ", ";\n \n &:hover {\n color: ", ";\n background-color: ", ";\n }\n \n &:focus-visible {\n outline: ", ";\n outline-offset: ", ";\n }\n"])), space[200], color.icon.muted, tokens.semantic.radius.sm, motion.transition.feedback, space[200], color.icon["default"], color.fill.muted, border.focus, border.focusOffset);
54
+ var StyledActionsList = /*#__PURE__*/styled.ul.withConfig({
55
+ displayName: "ActionSheet__StyledActionsList",
56
+ componentId: "sc-regbol-5"
57
+ })(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n padding: ", " ", ";\n margin: 0;\n list-style: none;\n"], ["\n padding: ", " ", ";\n margin: 0;\n list-style: none;\n"
58
+ /**
59
+ * ActionSheet component for bottom sheet modals
60
+ *
61
+ * Displays a modal action sheet that slides up from the bottom,
62
+ * providing a list of actions for the user to choose from.
63
+ * Includes focus trapping, keyboard navigation, and accessibility features.
64
+ *
65
+ * @example
66
+ * ```tsx
67
+ * const [isOpen, setIsOpen] = useState(false)
68
+ *
69
+ * <ActionSheet
70
+ * isOpen={isOpen}
71
+ * onClose={() => setIsOpen(false)}
72
+ * title="Choose an action"
73
+ * actions={[
74
+ * {
75
+ * id: 'edit',
76
+ * label: 'Edit',
77
+ * icon: 'edit',
78
+ * onSelect: () => console.log('Edit')
79
+ * },
80
+ * {
81
+ * id: 'delete',
82
+ * label: 'Delete',
83
+ * icon: 'trash',
84
+ * destructive: true,
85
+ * onSelect: () => console.log('Delete')
86
+ * }
87
+ * ]}
88
+ * />
89
+ * ```
90
+ */])), space[200], space[300]);
91
+ /**
92
+ * ActionSheet component for bottom sheet modals
93
+ *
94
+ * Displays a modal action sheet that slides up from the bottom,
95
+ * providing a list of actions for the user to choose from.
96
+ * Includes focus trapping, keyboard navigation, and accessibility features.
97
+ *
98
+ * @example
99
+ * ```tsx
100
+ * const [isOpen, setIsOpen] = useState(false)
101
+ *
102
+ * <ActionSheet
103
+ * isOpen={isOpen}
104
+ * onClose={() => setIsOpen(false)}
105
+ * title="Choose an action"
106
+ * actions={[
107
+ * {
108
+ * id: 'edit',
109
+ * label: 'Edit',
110
+ * icon: 'edit',
111
+ * onSelect: () => console.log('Edit')
112
+ * },
113
+ * {
114
+ * id: 'delete',
115
+ * label: 'Delete',
116
+ * icon: 'trash',
117
+ * destructive: true,
118
+ * onSelect: () => console.log('Delete')
119
+ * }
120
+ * ]}
121
+ * />
122
+ * ```
123
+ */
124
+ var ActionSheet = function ActionSheet(_a) {
125
+ var isOpen = _a.isOpen,
126
+ onClose = _a.onClose,
127
+ title = _a.title,
128
+ description = _a.description,
129
+ actions = _a.actions,
130
+ _b = _a.closeOnOverlayClick,
131
+ closeOnOverlayClick = _b === void 0 ? true : _b,
132
+ _c = _a.closeOnEscape,
133
+ closeOnEscape = _c === void 0 ? true : _c,
134
+ _d = _a.showCloseButton,
135
+ showCloseButton = _d === void 0 ? true : _d,
136
+ dataTestId = _a["data-testid"];
137
+ var sheetRef = useRef(null);
138
+ var previousActiveElement = useRef(null);
139
+ var _e = usePresence(isOpen),
140
+ isPresent = _e.isPresent,
141
+ isExiting = _e.isExiting;
142
+ useInert(sheetRef, isExiting);
143
+ // Store the element that had focus when sheet opened
144
+ useEffect(function () {
145
+ if (isOpen) {
146
+ previousActiveElement.current = document.activeElement;
147
+ }
148
+ }, [isOpen]);
149
+ // Focus management and escape key handling
150
+ useEffect(function () {
151
+ if (!isOpen) return;
152
+ var handleKeyDown = function handleKeyDown(e) {
153
+ if (e.key === 'Escape' && closeOnEscape) {
154
+ e.preventDefault();
155
+ onClose();
156
+ }
157
+ // Focus trap
158
+ if (e.key === 'Tab' && sheetRef.current) {
159
+ var focusableElements = sheetRef.current.querySelectorAll('button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])');
160
+ var firstElement = focusableElements[0];
161
+ var lastElement = focusableElements[focusableElements.length - 1];
162
+ if (e.shiftKey && document.activeElement === firstElement) {
163
+ e.preventDefault();
164
+ lastElement === null || lastElement === void 0 ? void 0 : lastElement.focus();
165
+ } else if (!e.shiftKey && document.activeElement === lastElement) {
166
+ e.preventDefault();
167
+ firstElement === null || firstElement === void 0 ? void 0 : firstElement.focus();
168
+ }
169
+ }
170
+ };
171
+ document.addEventListener('keydown', handleKeyDown);
172
+ // Focus first focusable element (button or element with role="button")
173
+ var frame = requestAnimationFrame(function () {
174
+ var _a;
175
+ var firstFocusable = (_a = sheetRef.current) === null || _a === void 0 ? void 0 : _a.querySelector('button:not(:disabled), [role="button"][tabindex]:not([aria-disabled="true"])');
176
+ firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
177
+ });
178
+ // Prevent body scroll
179
+ var originalOverflow = document.body.style.overflow;
180
+ document.body.style.overflow = 'hidden';
181
+ return function () {
182
+ // A quick close cancels the pending focus, so it can't pull focus back into the exiting sheet
183
+ cancelAnimationFrame(frame);
184
+ document.removeEventListener('keydown', handleKeyDown);
185
+ document.body.style.overflow = originalOverflow;
186
+ // Return focus to previous element
187
+ if (previousActiveElement.current) {
188
+ previousActiveElement.current.focus();
189
+ }
190
+ };
191
+ }, [isOpen, onClose, closeOnEscape]);
192
+ var handleOverlayClick = function handleOverlayClick(e) {
193
+ // While exiting, the backdrop still catches clicks but doesn't close again
194
+ if (!isExiting && closeOnOverlayClick && e.target === e.currentTarget) {
195
+ onClose();
196
+ }
197
+ };
198
+ var handleActionClick = function handleActionClick(action) {
199
+ if (!action.disabled) {
200
+ action.onSelect();
201
+ onClose();
202
+ }
203
+ };
204
+ // Stays mounted while the exit fade runs, hidden from assistive technology
205
+ if (!isPresent) return null;
206
+ // Find if there are any destructive actions to add divider
207
+ var destructiveIndex = actions.findIndex(function (a) {
208
+ return a.destructive;
209
+ });
210
+ var hasDestructive = destructiveIndex >= 0;
211
+ return /*#__PURE__*/createPortal(jsxs(Fragment, {
212
+ children: [jsx(StyledOverlay, {
213
+ onClick: handleOverlayClick,
214
+ "$isExiting": isExiting
215
+ }), jsxs(StyledActionSheet, {
216
+ ref: sheetRef,
217
+ role: "dialog",
218
+ "aria-modal": "true",
219
+ "aria-hidden": isExiting || undefined,
220
+ "$isExiting": isExiting,
221
+ "aria-labelledby": title ? 'action-sheet-title' : undefined,
222
+ "aria-describedby": description ? 'action-sheet-description' : undefined,
223
+ "data-testid": dataTestId,
224
+ children: [(title || description || showCloseButton) && jsxs(StyledHeader, {
225
+ children: [jsx(StyledHeaderContent, {
226
+ children: jsxs(Stack, {
227
+ direction: "column",
228
+ gap: description && title ? 'xs' : 'none',
229
+ children: [title && jsx("div", {
230
+ id: "action-sheet-title",
231
+ children: jsx(Typography, {
232
+ variant: "h3",
233
+ children: title
234
+ })
235
+ }), description && jsx("div", {
236
+ id: "action-sheet-description",
237
+ children: jsx(Typography, {
238
+ variant: "body",
239
+ color: "subdued",
240
+ children: description
241
+ })
242
+ })]
243
+ })
244
+ }), showCloseButton && jsx(StyledCloseButton, {
245
+ type: "button",
246
+ onClick: onClose,
247
+ "aria-label": "Close",
248
+ children: jsx(Icon, {
249
+ name: "close",
250
+ size: "sm",
251
+ iconColor: "subdued"
252
+ })
253
+ })]
254
+ }), jsx(StyledActionsList, {
255
+ children: actions.map(function (action, index) {
256
+ return jsxs(React.Fragment, {
257
+ children: [hasDestructive && index === destructiveIndex && index > 0 && jsx(Divider, {
258
+ size: "small"
259
+ }), jsx(ListItem, {
260
+ primary: action.label,
261
+ icon: action.icon && jsx(Icon, {
262
+ name: action.icon,
263
+ size: "md",
264
+ iconColor: action.disabled ? 'disabled' : action.destructive ? 'error' : 'default'
265
+ }),
266
+ interactive: true,
267
+ onClick: function onClick() {
268
+ return handleActionClick(action);
269
+ },
270
+ disabled: action.disabled,
271
+ destructive: action.destructive,
272
+ spacing: "compact"
273
+ })]
274
+ }, action.id);
275
+ })
276
+ })]
277
+ })]
278
+ }), document.body);
279
+ };
280
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
281
+
282
+ export { ActionSheet };
283
+ //# sourceMappingURL=ActionSheet.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionSheet.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export { ActionSheet } from './ActionSheet.mjs';
2
+ export type { ActionSheetProps, Action } from './ActionSheet.mjs';