@speakeasy-api/moonshine 1.33.4 → 2.0.0-alpha.2

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 (330) hide show
  1. package/README.md +26 -10
  2. package/package.json +12 -23
  3. package/scripts/generate-utility-docs.js +324 -0
  4. package/src/assets/icons/external/github.svg +3 -0
  5. package/src/assets/icons/external/maven.svg +152 -0
  6. package/src/assets/icons/external/npm.svg +4 -0
  7. package/src/assets/icons/external/nuget.svg +5 -0
  8. package/src/assets/icons/external/packagist.svg +1 -0
  9. package/src/assets/icons/external/pypi.svg +182 -0
  10. package/src/assets/icons/external/rubygems.svg +14 -0
  11. package/src/assets/icons/external/terraform.svg +1 -0
  12. package/src/assets/icons/languages/csharp.svg +1 -0
  13. package/src/assets/icons/languages/go.svg +1 -0
  14. package/src/assets/icons/languages/java.svg +1 -0
  15. package/src/assets/icons/languages/json.svg +2 -0
  16. package/src/assets/icons/languages/php.svg +1 -0
  17. package/src/assets/icons/languages/postman.svg +3 -0
  18. package/src/assets/icons/languages/python.svg +1 -0
  19. package/src/assets/icons/languages/ruby.svg +1 -0
  20. package/src/assets/icons/languages/swift.svg +1 -0
  21. package/src/assets/icons/languages/terraform.svg +1 -0
  22. package/src/assets/icons/languages/typescript.svg +1 -0
  23. package/src/assets/icons/languages/unity.svg +1 -0
  24. package/src/components/AIChat/AIChatContainer.tsx +71 -0
  25. package/src/components/AIChat/AIChatMessage.tsx +135 -0
  26. package/src/components/AIChat/AIChatMessageComposer.tsx +175 -0
  27. package/src/components/AIChat/AIChatMessageList.tsx +34 -0
  28. package/src/components/AIChat/AIChatModelSelector.tsx +159 -0
  29. package/src/components/AIChat/componentsTypes.ts +36 -0
  30. package/src/components/AIChat/context.ts +15 -0
  31. package/src/components/AIChat/index.ts +12 -0
  32. package/src/components/AIChat/parts/AIChatMessageFilePart.tsx +129 -0
  33. package/src/components/AIChat/parts/AIChatMessageReasoningPart.tsx +23 -0
  34. package/src/components/AIChat/parts/AIChatMessageSourcePart.tsx +58 -0
  35. package/src/components/AIChat/parts/AIChatMessageTextPart.tsx +33 -0
  36. package/src/components/AIChat/parts/AIChatMessageToolInvocationPart.tsx +53 -0
  37. package/src/components/AIChat/parts/AIChatMessageToolPart.tsx +395 -0
  38. package/src/components/AIChat/parts/AIChatMessageToolResultPart.tsx +46 -0
  39. package/src/components/AIChat/toolCallApproval.ts +61 -0
  40. package/src/components/AIChat/types.ts +97 -0
  41. package/src/components/ActionBar/index.tsx +184 -0
  42. package/src/components/Alert/index.tsx +118 -0
  43. package/src/components/Alert/types.ts +12 -0
  44. package/src/components/AppLayout/context.tsx +31 -0
  45. package/src/components/AppLayout/index.tsx +550 -0
  46. package/src/components/AppLayout/provider.tsx +40 -0
  47. package/src/components/AppLayout/useAppLayoutKeys.ts +26 -0
  48. package/src/components/Badge/index.tsx +227 -0
  49. package/src/components/Button/index.tsx +531 -0
  50. package/src/components/Card/index.tsx +193 -0
  51. package/src/components/CodeEditorLayout/index.tsx +394 -0
  52. package/src/components/CodeEditorLayout/styles.module.css +8 -0
  53. package/src/components/CodeHighlight/Pre.tsx +63 -0
  54. package/src/components/CodePlayground/index.tsx +411 -0
  55. package/src/components/CodeSnippet/codeSnippet.css +97 -0
  56. package/src/components/CodeSnippet/index.tsx +224 -0
  57. package/src/components/Combobox/index.tsx +193 -0
  58. package/src/components/Command/index.tsx +152 -0
  59. package/src/components/Container/index.tsx +31 -0
  60. package/src/components/ContextDropdown/index.tsx +150 -0
  61. package/src/components/Dialog/index.tsx +123 -0
  62. package/src/components/DragNDrop/DragNDropArea.tsx +30 -0
  63. package/src/components/DragNDrop/DragOverlay.tsx +4 -0
  64. package/src/components/DragNDrop/Draggable.tsx +97 -0
  65. package/src/components/DragNDrop/Droppable.tsx +51 -0
  66. package/src/components/Dropdown/index.tsx +201 -0
  67. package/src/components/ExternalPill/index.tsx +58 -0
  68. package/src/components/Facepile/index.tsx +309 -0
  69. package/src/components/GradientCircle/gradientCircle.css +34 -0
  70. package/src/components/GradientCircle/index.tsx +143 -0
  71. package/src/components/Grid/index.tsx +150 -0
  72. package/src/components/Heading/index.tsx +54 -0
  73. package/src/components/HighlightedText/index.tsx +152 -0
  74. package/src/components/Icon/customIcons/createCustomLucideIcon.ts +25 -0
  75. package/src/components/Icon/customIcons/gems.ts +26 -0
  76. package/{dist/go-DsW1bFpz.mjs → src/components/Icon/customIcons/go.ts} +21 -19
  77. package/src/components/Icon/customIcons/index.ts +11 -0
  78. package/{dist/maven-Dub5liK1.mjs → src/components/Icon/customIcons/maven.ts} +17 -15
  79. package/src/components/Icon/customIcons/npm.ts +19 -0
  80. package/{dist/nuget-D86y5HDl.mjs → src/components/Icon/customIcons/nuget.ts} +17 -15
  81. package/src/components/Icon/customIcons/packagist.ts +124 -0
  82. package/{dist/pypi-2SUX-2OR.mjs → src/components/Icon/customIcons/pypi.ts} +16 -14
  83. package/src/components/Icon/index.tsx +83 -0
  84. package/src/components/Icon/isIconName.ts +10 -0
  85. package/src/components/Icon/names.ts +14 -0
  86. package/src/components/IconButton/index.tsx +51 -0
  87. package/src/components/Input/index.tsx +98 -0
  88. package/src/components/KeyHint/index.tsx +118 -0
  89. package/src/components/LanguageIndicator/index.tsx +68 -0
  90. package/src/components/Link/index.tsx +153 -0
  91. package/src/components/LoggedInUserMenu/index.tsx +116 -0
  92. package/src/components/Logo/Animated.tsx +191 -0
  93. package/src/components/Logo/index.tsx +17 -0
  94. package/src/components/Logo/speakeasy-logo.riv +0 -0
  95. package/src/components/Logo/svgs/index.tsx +126 -0
  96. package/src/components/Modal/index.tsx +104 -0
  97. package/src/components/PageHeader/index.tsx +227 -0
  98. package/src/components/PageHeader/styles.module.css +27 -0
  99. package/src/components/Popover/index.tsx +35 -0
  100. package/src/components/PromptInput/index.tsx +372 -0
  101. package/src/components/PullRequestLink/index.tsx +64 -0
  102. package/src/components/ResizablePanel/index.tsx +119 -0
  103. package/src/components/Score/index.module.css +32 -0
  104. package/src/components/Score/index.tsx +268 -0
  105. package/src/components/ScrollArea/index.tsx +48 -0
  106. package/src/components/SegmentedButton/index.module.css +19 -0
  107. package/src/components/SegmentedButton/index.tsx +101 -0
  108. package/src/components/Select/index.tsx +159 -0
  109. package/src/components/Separator/index.tsx +23 -0
  110. package/src/components/Skeleton/index.tsx +61 -0
  111. package/src/components/Skeleton/skeleton.css +52 -0
  112. package/src/components/Stack/index.tsx +137 -0
  113. package/src/components/Subnav/index.tsx +315 -0
  114. package/src/components/Switch/index.tsx +29 -0
  115. package/src/components/Table/context/context.tsx +19 -0
  116. package/src/components/Table/context/tableProvider.tsx +39 -0
  117. package/src/components/Table/index.tsx +707 -0
  118. package/src/components/Table/styles.module.css +25 -0
  119. package/src/components/Tabs/index.tsx +87 -0
  120. package/src/components/TargetLanguageIcon/index.tsx +84 -0
  121. package/src/components/Text/index.tsx +59 -0
  122. package/src/components/ThemeSwitcher/index.tsx +118 -0
  123. package/src/components/Timeline/index.tsx +290 -0
  124. package/src/components/Tooltip/index.tsx +41 -0
  125. package/src/components/UserAvatar/index.tsx +87 -0
  126. package/src/components/UserAvatar/sizeMap.ts +12 -0
  127. package/src/components/Wizard/index.tsx +208 -0
  128. package/src/components/Wizard/types.ts +17 -0
  129. package/src/components/WorkspaceSelector/CreateOrg.tsx +95 -0
  130. package/src/components/WorkspaceSelector/CreateWorkspace.tsx +196 -0
  131. package/src/components/WorkspaceSelector/OrgList.tsx +115 -0
  132. package/src/components/WorkspaceSelector/OrgSelector.tsx +207 -0
  133. package/src/components/WorkspaceSelector/RecentWorkspaces.tsx +83 -0
  134. package/src/components/WorkspaceSelector/ScrollingList.tsx +84 -0
  135. package/src/components/WorkspaceSelector/SearchBox.tsx +40 -0
  136. package/src/components/WorkspaceSelector/WorkspaceItem.tsx +37 -0
  137. package/src/components/WorkspaceSelector/WorkspaceList.tsx +107 -0
  138. package/src/components/WorkspaceSelector/index.tsx +400 -0
  139. package/src/components/WorkspaceSelector/styles.css +74 -0
  140. package/src/components/__beta__/CLIWizard/index.tsx +357 -0
  141. package/src/components/__beta__/CLIWizard/terminal-command.tsx +108 -0
  142. package/src/components/__beta__/CLIWizard/terminal.tsx +83 -0
  143. package/src/components/__beta__/README.md +3 -0
  144. package/src/components/index.mdx +38 -0
  145. package/src/context/ConfigContext.tsx +43 -0
  146. package/src/context/ModalContext.tsx +118 -0
  147. package/src/context/theme.ts +1 -0
  148. package/src/hooks/useAppLayout.ts +10 -0
  149. package/src/hooks/useConfig.ts +10 -0
  150. package/src/hooks/useIsMounted.ts +13 -0
  151. package/src/hooks/useModal.tsx +10 -0
  152. package/src/hooks/useTailwindBreakpoint.ts +47 -0
  153. package/src/hooks/useTheme.ts +13 -0
  154. package/src/index.ts +234 -0
  155. package/src/lib/assert.ts +9 -0
  156. package/src/lib/codeUtils.ts +177 -0
  157. package/src/lib/debounce.ts +9 -0
  158. package/src/lib/responsiveMappers.ts +69 -0
  159. package/src/lib/responsiveUtils.ts +23 -0
  160. package/src/lib/storybookUtils.tsx +26 -0
  161. package/src/lib/typeUtils.ts +109 -0
  162. package/src/lib/utils.ts +85 -0
  163. package/src/styles/codeSyntax.css +59 -0
  164. package/src/styles/globals.css +51 -0
  165. package/src/types.ts +200 -0
  166. package/src/vite-env.d.ts +6 -0
  167. package/types/utilities.d.ts +1 -1
  168. package/dist/components/AIChat/AIChatContainer.d.ts +0 -26
  169. package/dist/components/AIChat/AIChatMessage.d.ts +0 -19
  170. package/dist/components/AIChat/AIChatMessageComposer.d.ts +0 -22
  171. package/dist/components/AIChat/AIChatMessageList.d.ts +0 -6
  172. package/dist/components/AIChat/AIChatModelSelector.d.ts +0 -14
  173. package/dist/components/AIChat/componentsTypes.d.ts +0 -11
  174. package/dist/components/AIChat/context.d.ts +0 -3
  175. package/dist/components/AIChat/index.d.ts +0 -12
  176. package/dist/components/AIChat/parts/AIChatMessageFilePart.d.ts +0 -7
  177. package/dist/components/AIChat/parts/AIChatMessageReasoningPart.d.ts +0 -5
  178. package/dist/components/AIChat/parts/AIChatMessageSourcePart.d.ts +0 -9
  179. package/dist/components/AIChat/parts/AIChatMessageTextPart.d.ts +0 -5
  180. package/dist/components/AIChat/parts/AIChatMessageToolInvocationPart.d.ts +0 -6
  181. package/dist/components/AIChat/parts/AIChatMessageToolPart.d.ts +0 -33
  182. package/dist/components/AIChat/parts/AIChatMessageToolResultPart.d.ts +0 -5
  183. package/dist/components/AIChat/toolCallApproval.d.ts +0 -15
  184. package/dist/components/AIChat/types.d.ts +0 -79
  185. package/dist/components/ActionBar/index.d.ts +0 -36
  186. package/dist/components/Alert/index.d.ts +0 -18
  187. package/dist/components/Alert/types.d.ts +0 -4
  188. package/dist/components/AppLayout/context.d.ts +0 -16
  189. package/dist/components/AppLayout/index.d.ts +0 -131
  190. package/dist/components/AppLayout/provider.d.ts +0 -8
  191. package/dist/components/AppLayout/useAppLayoutKeys.d.ts +0 -1
  192. package/dist/components/Badge/index.d.ts +0 -21
  193. package/dist/components/Button/index.d.ts +0 -22
  194. package/dist/components/Card/index.d.ts +0 -47
  195. package/dist/components/CodeEditorLayout/index.d.ts +0 -101
  196. package/dist/components/CodeHighlight/Pre.d.ts +0 -8
  197. package/dist/components/CodePlayground/index.d.ts +0 -102
  198. package/dist/components/CodeSnippet/index.d.ts +0 -49
  199. package/dist/components/Combobox/index.d.ts +0 -35
  200. package/dist/components/Command/index.d.ts +0 -80
  201. package/dist/components/Container/index.d.ts +0 -9
  202. package/dist/components/ContextDropdown/index.d.ts +0 -7
  203. package/dist/components/Dialog/index.d.ts +0 -21
  204. package/dist/components/DragNDrop/DragNDropArea.d.ts +0 -8
  205. package/dist/components/DragNDrop/DragOverlay.d.ts +0 -1
  206. package/dist/components/DragNDrop/Draggable.d.ts +0 -29
  207. package/dist/components/DragNDrop/Droppable.d.ts +0 -28
  208. package/dist/components/Dropdown/index.d.ts +0 -27
  209. package/dist/components/ExternalPill/index.d.ts +0 -12
  210. package/dist/components/Facepile/index.d.ts +0 -16
  211. package/dist/components/GradientCircle/index.d.ts +0 -10
  212. package/dist/components/Grid/index.d.ts +0 -80
  213. package/dist/components/Heading/index.d.ts +0 -12
  214. package/dist/components/HighlightedText/index.d.ts +0 -19
  215. package/dist/components/Icon/customIcons/createCustomLucideIcon.d.ts +0 -3
  216. package/dist/components/Icon/customIcons/gems.d.ts +0 -2
  217. package/dist/components/Icon/customIcons/go.d.ts +0 -2
  218. package/dist/components/Icon/customIcons/index.d.ts +0 -10
  219. package/dist/components/Icon/customIcons/maven.d.ts +0 -2
  220. package/dist/components/Icon/customIcons/npm.d.ts +0 -2
  221. package/dist/components/Icon/customIcons/nuget.d.ts +0 -2
  222. package/dist/components/Icon/customIcons/packagist.d.ts +0 -2
  223. package/dist/components/Icon/customIcons/pypi.d.ts +0 -2
  224. package/dist/components/Icon/index.d.ts +0 -10
  225. package/dist/components/Icon/isIconName.d.ts +0 -2
  226. package/dist/components/Icon/names.d.ts +0 -6
  227. package/dist/components/IconButton/index.d.ts +0 -14
  228. package/dist/components/Input/index.d.ts +0 -8
  229. package/dist/components/KeyHint/index.d.ts +0 -16
  230. package/dist/components/LanguageIndicator/index.d.ts +0 -7
  231. package/dist/components/Link/index.d.ts +0 -15
  232. package/dist/components/LoggedInUserMenu/index.d.ts +0 -17
  233. package/dist/components/Logo/Animated.d.ts +0 -7
  234. package/dist/components/Logo/index.d.ts +0 -7
  235. package/dist/components/Logo/svgs/index.d.ts +0 -6
  236. package/dist/components/Modal/index.d.ts +0 -8
  237. package/dist/components/PageHeader/index.d.ts +0 -45
  238. package/dist/components/Popover/index.d.ts +0 -8
  239. package/dist/components/PromptInput/index.d.ts +0 -55
  240. package/dist/components/PullRequestLink/index.d.ts +0 -10
  241. package/dist/components/ResizablePanel/index.d.ts +0 -26
  242. package/dist/components/Score/index.d.ts +0 -37
  243. package/dist/components/ScrollArea/index.d.ts +0 -5
  244. package/dist/components/SegmentedButton/index.d.ts +0 -23
  245. package/dist/components/Select/index.d.ts +0 -13
  246. package/dist/components/Separator/index.d.ts +0 -6
  247. package/dist/components/Skeleton/index.d.ts +0 -27
  248. package/dist/components/Stack/index.d.ts +0 -33
  249. package/dist/components/Subnav/index.d.ts +0 -12
  250. package/dist/components/Switch/index.d.ts +0 -4
  251. package/dist/components/Table/context/context.d.ts +0 -8
  252. package/dist/components/Table/context/tableProvider.d.ts +0 -6
  253. package/dist/components/Table/index.d.ts +0 -94
  254. package/dist/components/Tabs/index.d.ts +0 -21
  255. package/dist/components/TargetLanguageIcon/index.d.ts +0 -7
  256. package/dist/components/Text/index.d.ts +0 -19
  257. package/dist/components/ThemeSwitcher/index.d.ts +0 -6
  258. package/dist/components/Timeline/index.d.ts +0 -49
  259. package/dist/components/Tooltip/index.d.ts +0 -9
  260. package/dist/components/UserAvatar/index.d.ts +0 -9
  261. package/dist/components/UserAvatar/sizeMap.d.ts +0 -3
  262. package/dist/components/Wizard/index.d.ts +0 -19
  263. package/dist/components/Wizard/types.d.ts +0 -15
  264. package/dist/components/WorkspaceSelector/CreateOrg.d.ts +0 -6
  265. package/dist/components/WorkspaceSelector/CreateWorkspace.d.ts +0 -17
  266. package/dist/components/WorkspaceSelector/OrgList.d.ts +0 -12
  267. package/dist/components/WorkspaceSelector/OrgSelector.d.ts +0 -13
  268. package/dist/components/WorkspaceSelector/RecentWorkspaces.d.ts +0 -11
  269. package/dist/components/WorkspaceSelector/ScrollingList.d.ts +0 -21
  270. package/dist/components/WorkspaceSelector/SearchBox.d.ts +0 -9
  271. package/dist/components/WorkspaceSelector/WorkspaceItem.d.ts +0 -9
  272. package/dist/components/WorkspaceSelector/WorkspaceList.d.ts +0 -11
  273. package/dist/components/WorkspaceSelector/index.d.ts +0 -36
  274. package/dist/components/__beta__/CLIWizard/index.d.ts +0 -19
  275. package/dist/components/__beta__/CLIWizard/terminal-command.d.ts +0 -19
  276. package/dist/components/__beta__/CLIWizard/terminal.d.ts +0 -26
  277. package/dist/context/ConfigContext.d.ts +0 -18
  278. package/dist/context/ModalContext.d.ts +0 -22
  279. package/dist/context/theme.d.ts +0 -1
  280. package/dist/createCustomLucideIcon-CatlpFc0.mjs +0 -19
  281. package/dist/createCustomLucideIcon-CatlpFc0.mjs.map +0 -1
  282. package/dist/gems-DQ7pOLLr.mjs +0 -24
  283. package/dist/gems-DQ7pOLLr.mjs.map +0 -1
  284. package/dist/github-kgjMtfE7.mjs +0 -11
  285. package/dist/github-kgjMtfE7.mjs.map +0 -1
  286. package/dist/go-DsW1bFpz.mjs.map +0 -1
  287. package/dist/hooks/useAppLayout.d.ts +0 -1
  288. package/dist/hooks/useConfig.d.ts +0 -2
  289. package/dist/hooks/useIsMounted.d.ts +0 -1
  290. package/dist/hooks/useModal.d.ts +0 -11
  291. package/dist/hooks/useTailwindBreakpoint.d.ts +0 -3
  292. package/dist/hooks/useTheme.d.ts +0 -6
  293. package/dist/index-C9bJtuJ5.mjs +0 -16347
  294. package/dist/index-C9bJtuJ5.mjs.map +0 -1
  295. package/dist/index.d.ts +0 -80
  296. package/dist/lib/assert.d.ts +0 -2
  297. package/dist/lib/codeUtils.d.ts +0 -36
  298. package/dist/lib/debounce.d.ts +0 -1
  299. package/dist/lib/responsiveMappers.d.ts +0 -10
  300. package/dist/lib/responsiveUtils.d.ts +0 -3
  301. package/dist/lib/storybookUtils.d.ts +0 -5
  302. package/dist/lib/typeUtils.d.ts +0 -24
  303. package/dist/lib/utils.d.ts +0 -24
  304. package/dist/maven-Dub5liK1.mjs.map +0 -1
  305. package/dist/maven-W_nkSDNW.mjs +0 -107
  306. package/dist/maven-W_nkSDNW.mjs.map +0 -1
  307. package/dist/moonshine.es.js +0 -125
  308. package/dist/moonshine.es.js.map +0 -1
  309. package/dist/npm-BWTcVvFH.mjs +0 -11
  310. package/dist/npm-BWTcVvFH.mjs.map +0 -1
  311. package/dist/npm-BYcG5_q9.mjs +0 -17
  312. package/dist/npm-BYcG5_q9.mjs.map +0 -1
  313. package/dist/nuget-CV5HU1JR.mjs +0 -11
  314. package/dist/nuget-CV5HU1JR.mjs.map +0 -1
  315. package/dist/nuget-D86y5HDl.mjs.map +0 -1
  316. package/dist/packagist-BFSSrw4p.mjs +0 -118
  317. package/dist/packagist-BFSSrw4p.mjs.map +0 -1
  318. package/dist/packagist-D01fn9N_.mjs +0 -11
  319. package/dist/packagist-D01fn9N_.mjs.map +0 -1
  320. package/dist/pypi-2SUX-2OR.mjs.map +0 -1
  321. package/dist/pypi-DLh6kIJe.mjs +0 -11
  322. package/dist/pypi-DLh6kIJe.mjs.map +0 -1
  323. package/dist/rubygems-DeiNjcDV.mjs +0 -11
  324. package/dist/rubygems-DeiNjcDV.mjs.map +0 -1
  325. package/dist/speakeasy-logo-ByBTXLWb.mjs +0 -5
  326. package/dist/speakeasy-logo-ByBTXLWb.mjs.map +0 -1
  327. package/dist/style.css +0 -1
  328. package/dist/terraform-C4aktQ0o.mjs +0 -11
  329. package/dist/terraform-C4aktQ0o.mjs.map +0 -1
  330. package/dist/types.d.ts +0 -85
@@ -0,0 +1,116 @@
1
+ import { Icon } from '../Icon'
2
+ import {
3
+ DropdownMenu,
4
+ DropdownMenuContent,
5
+ DropdownMenuItem,
6
+ DropdownMenuSeparator,
7
+ DropdownMenuTrigger,
8
+ } from '../Dropdown'
9
+ import { Stack } from '../Stack'
10
+ import { UserAvatar } from '../UserAvatar'
11
+ import { UserAvatarProps } from '../UserAvatar'
12
+ import React, { Children, Fragment, ReactNode } from 'react'
13
+ import { cn } from '../../lib/utils'
14
+
15
+ export interface LoggedInUserProps extends UserAvatarProps {
16
+ email: string
17
+ children?: ReactNode | ReactNode[]
18
+ onSignOut: () => void
19
+ }
20
+
21
+ const Root: React.FC<LoggedInUserProps> = ({
22
+ email,
23
+ name,
24
+ onSignOut,
25
+ imageUrl,
26
+ size = 'small',
27
+ children,
28
+ }) => {
29
+ const validChildren = Children.toArray(children).filter(
30
+ (child) =>
31
+ React.isValidElement(child) &&
32
+ (child.type === MenuItem || child.type === Seperator)
33
+ )
34
+
35
+ return (
36
+ <DropdownMenu>
37
+ <DropdownMenuTrigger
38
+ className="cursor-pointer outline-none"
39
+ aria-label="open menu"
40
+ >
41
+ <UserAvatar name={name} imageUrl={imageUrl} size={size} />
42
+ </DropdownMenuTrigger>
43
+ <DropdownMenuContent align="end" className="mt-2 max-w-64 p-0">
44
+ <LoggedInMenuContent name={name} email={email} onSignOut={onSignOut}>
45
+ {validChildren}
46
+ </LoggedInMenuContent>
47
+ </DropdownMenuContent>
48
+ </DropdownMenu>
49
+ )
50
+ }
51
+ Root.displayName = 'LoggedInUserMenu'
52
+
53
+ interface LoggedInMenuContentProps extends Omit<LoggedInUserProps, 'imageUrl'> {
54
+ email: string
55
+ children?: ReactNode | ReactNode[]
56
+ onSignOut: () => void
57
+ }
58
+
59
+ const LoggedInMenuContent: React.FC<LoggedInMenuContentProps> = ({
60
+ email,
61
+ name,
62
+ children,
63
+ onSignOut,
64
+ }) => {
65
+ return (
66
+ <>
67
+ <Stack padding={3}>
68
+ <div className="truncate text-sm font-semibold">{name}</div>
69
+ <div className="text-body truncate text-sm" title={email}>
70
+ {email}
71
+ </div>
72
+ </Stack>
73
+ <Seperator />
74
+ {Children.map(children, (child, index) => (
75
+ <Fragment key={index}>{child}</Fragment>
76
+ ))}
77
+ <MenuItem onSelect={onSignOut}>
78
+ <Icon name="log-out" />
79
+ Logout
80
+ </MenuItem>
81
+ </>
82
+ )
83
+ }
84
+
85
+ interface LoggedInMenuItemProps {
86
+ onSelect: () => void
87
+ children?: ReactNode | ReactNode[]
88
+ className?: string
89
+ }
90
+
91
+ const MenuItem: React.FC<LoggedInMenuItemProps> = ({
92
+ onSelect,
93
+ children,
94
+ className,
95
+ }) => {
96
+ return (
97
+ <DropdownMenuItem
98
+ onSelect={onSelect}
99
+ className={cn('cursor-pointer p-3', className)}
100
+ >
101
+ {children}
102
+ </DropdownMenuItem>
103
+ )
104
+ }
105
+ MenuItem.displayName = 'LoggedInUserMenu.MenuItem'
106
+
107
+ const Seperator: React.FC = () => {
108
+ return (
109
+ <DropdownMenuSeparator data-component="separator" className="peer my-0" />
110
+ )
111
+ }
112
+
113
+ export const LoggedInUserMenu = Object.assign(Root, {
114
+ MenuItem,
115
+ Seperator,
116
+ })
@@ -0,0 +1,191 @@
1
+ import { useTheme } from '../../hooks/useTheme'
2
+ import { cn } from '../../lib/utils'
3
+ import {
4
+ Fit,
5
+ Layout,
6
+ useRive,
7
+ useViewModelInstanceBoolean,
8
+ } from '@rive-app/react-canvas-lite'
9
+ import { cva } from 'class-variance-authority'
10
+ import { FC, useEffect, useState } from 'react'
11
+ import riveFileUrl from './speakeasy-logo.riv'
12
+
13
+ const stackLogoClass = cva('relative', {
14
+ variants: {
15
+ size: {
16
+ xl: 'size-20',
17
+ lg: 'size-16',
18
+ md: 'size-8',
19
+ sm: 'size-6',
20
+ },
21
+ },
22
+ })
23
+
24
+ type Size = 'sm' | 'md' | 'lg' | 'xl'
25
+
26
+ type StateMachine = 'loop-dark' | 'loop-light'
27
+
28
+ const lettersLogoClass = cva('hidden mt-px md:block', {
29
+ variants: {
30
+ size: {
31
+ xl: 'ml-4 w-[22rem] h-auto',
32
+ lg: 'ml-3 w-[19.75rem] h-auto',
33
+ md: 'ml-2 w-[9.75rem] h-auto',
34
+ sm: 'ml-2 w-[8.75rem] h-auto',
35
+ },
36
+ },
37
+ })
38
+
39
+ export const AnimatedLogo = ({
40
+ className,
41
+ size = 'md',
42
+ variant = 'icon',
43
+ onMouseEnter,
44
+ onMouseLeave,
45
+ ...rest
46
+ }: {
47
+ className?: string
48
+ size?: Size
49
+ variant?: 'icon' | 'icon-with-wordmark'
50
+ } & React.HTMLAttributes<HTMLDivElement>) => {
51
+ const [riveLoaded, setRiveLoaded] = useState(false)
52
+ const theme = useTheme()
53
+ const [stateMachine, setStateMachine] = useState<StateMachine>('loop-dark')
54
+ const { rive, RiveComponent } = useRive({
55
+ src: riveFileUrl,
56
+ stateMachines: stateMachine,
57
+ autoplay: true,
58
+ layout: new Layout({
59
+ fit: Fit.Contain,
60
+ }),
61
+ onLoad: () => {
62
+ setRiveLoaded(true)
63
+ },
64
+ })
65
+
66
+ const { setValue: setIsHovered } = useViewModelInstanceBoolean(
67
+ 'isHovered',
68
+ rive?.viewModelInstance
69
+ )
70
+
71
+ useEffect(() => {
72
+ setStateMachine(theme === 'dark' ? 'loop-dark' : 'loop-light')
73
+ }, [theme])
74
+
75
+ useEffect(() => {
76
+ return () => {
77
+ rive?.cleanup()
78
+ }
79
+ }, [rive])
80
+
81
+ return (
82
+ <div
83
+ className={cn('flex items-center', className)}
84
+ onMouseEnter={(e) => {
85
+ setIsHovered(true)
86
+ onMouseEnter?.(e)
87
+ }}
88
+ onMouseLeave={(e) => {
89
+ setIsHovered(false)
90
+ onMouseLeave?.(e)
91
+ }}
92
+ {...rest}
93
+ >
94
+ <div className={cn(stackLogoClass({ size }))}>
95
+ <LogoSvg
96
+ aria-hidden
97
+ className={cn(
98
+ 'pointer-events-none absolute top-0 left-0 size-full scale-[0.87] transition-opacity duration-100',
99
+ {
100
+ 'opacity-0': riveLoaded,
101
+ }
102
+ )}
103
+ />
104
+ <RiveComponent key={stateMachine} className="size-full" />
105
+ </div>
106
+ {variant === 'icon-with-wordmark' && <WordmarkSvg size={size} />}
107
+ </div>
108
+ )
109
+ }
110
+
111
+ const WordmarkSvg: FC<{ size: Size }> = ({ size = 'md' }) => (
112
+ <>
113
+ <p className="sr-only">Speakeasy Logo</p>
114
+ <svg
115
+ width="106"
116
+ height="22"
117
+ viewBox="0 0 106 22"
118
+ fill="none"
119
+ xmlns="http://www.w3.org/2000/svg"
120
+ className={lettersLogoClass({ size })}
121
+ >
122
+ <path
123
+ d="M102.372 4.72596L98.9819 13.7316L95.4811 4.72596H93.1875L97.8247 16.2969L97.2496 17.6066C97.087 17.995 96.9453 18.2702 96.8328 18.4212L96.8231 18.4347C96.7314 18.5885 96.6105 18.6937 96.4535 18.7557C96.2882 18.8232 96.0284 18.8569 95.6811 18.8569H93.8696V20.7964H96.2549C96.8106 20.7964 97.2634 20.7087 97.6038 20.5361C97.9455 20.3621 98.2345 20.091 98.4596 19.7295C98.6763 19.3829 98.9277 18.8596 99.2042 18.1731L104.665 4.72461H102.37L102.372 4.72596Z"
124
+ fill="var(--foreground)"
125
+ />
126
+ <path
127
+ d="M91.0858 9.92009C90.4231 9.71103 89.566 9.54378 88.538 9.42509C87.8114 9.33742 87.2613 9.25515 86.9001 9.18232C86.575 9.11353 86.3041 8.9827 86.0944 8.79253C85.8929 8.61044 85.7943 8.35148 85.7943 8.00081C85.7943 7.52604 86.0138 7.15513 86.4681 6.86515C86.9307 6.55629 87.553 6.39983 88.3143 6.39983C89.0756 6.39983 89.6855 6.58461 90.1786 6.95012C90.6718 7.31699 90.9469 7.76747 91.0191 8.32855L91.0344 8.44724H93.1863L93.1752 8.30158C93.0807 7.10928 92.5764 6.17729 91.6762 5.53393C90.7996 4.89597 89.6466 4.57227 88.2463 4.57227C87.3905 4.57227 86.607 4.72602 85.9207 5.02815C85.2289 5.31813 84.6704 5.73759 84.2592 6.27575C83.8619 6.8166 83.6605 7.44107 83.6605 8.13433C83.6605 8.90717 83.873 9.52895 84.2939 9.98483C84.7065 10.4164 85.2511 10.7347 85.9138 10.9344C86.5598 11.1286 87.4016 11.2877 88.413 11.4064C89.1228 11.4941 89.673 11.5831 90.0494 11.6708C90.419 11.753 90.7204 11.9068 90.9455 12.124C91.1705 12.3411 91.272 12.6459 91.272 13.0519C91.272 13.5267 91.0372 13.9043 90.5565 14.2064C90.0772 14.5018 89.4312 14.6529 88.6366 14.6529C87.7392 14.6529 86.996 14.4452 86.4278 14.0351C85.8763 13.6265 85.5943 13.1139 85.5651 12.4679L85.5595 12.3384H83.4062V12.4746C83.4243 13.729 83.9119 14.723 84.8621 15.4298C85.8137 16.1271 87.0835 16.4804 88.6366 16.4804C89.5063 16.4804 90.3106 16.3348 91.0274 16.0475C91.7498 15.7575 92.3319 15.3394 92.7584 14.8039C93.1877 14.2631 93.4058 13.6292 93.4058 12.9184C93.4058 12.1024 93.1863 11.4442 92.7542 10.9613C92.3416 10.4839 91.7804 10.1332 91.0872 9.91874L91.0858 9.92009Z"
128
+ fill="var(--foreground)"
129
+ />
130
+ <path
131
+ d="M82.037 14.2455C81.9314 14.1349 81.8786 13.9568 81.8786 13.7194V8.82345C81.8786 7.4693 81.4465 6.41592 80.595 5.69703C79.7628 4.96601 78.5667 4.59375 77.0414 4.59375C75.6119 4.59375 74.4283 4.91745 73.5211 5.55406C72.6223 6.19742 72.0944 7.10514 71.9527 8.25023L71.9346 8.40129H74.0837L74.106 8.29339C74.2213 7.74579 74.5172 7.32228 75.0117 6.99723C75.5202 6.6587 76.1731 6.4874 76.9511 6.4874C77.8304 6.4874 78.5167 6.68567 78.9946 7.07951C79.485 7.472 79.7239 8.0061 79.7239 8.7115V9.35486H76.4246C74.8714 9.35486 73.6628 9.67182 72.8432 10.2882L72.8307 10.2949C72.0041 10.9275 71.5859 11.846 71.5859 13.0275C71.5859 14.0903 71.9971 14.9414 72.8098 15.5605C73.6253 16.1701 74.7103 16.479 76.0342 16.479C77.6512 16.479 78.9321 15.9206 79.8462 14.8173C79.9142 15.257 80.0865 15.609 80.3616 15.8626C80.7075 16.1823 81.2798 16.3455 82.062 16.3455H83.2317V14.406H82.5204C82.2995 14.406 82.1412 14.3534 82.0384 14.2441L82.037 14.2455ZM79.7211 11.1622V11.583C79.7211 12.5042 79.4044 13.2568 78.7807 13.8206C78.1527 14.3736 77.2747 14.6528 76.1703 14.6528C75.4257 14.6528 74.8297 14.4896 74.3977 14.1686C73.9712 13.8516 73.7642 13.4429 73.7642 12.9183C73.7642 12.3275 73.9601 11.8986 74.3616 11.6073C74.77 11.3119 75.4021 11.1608 76.2384 11.1608H79.7211V11.1622Z"
132
+ fill="var(--foreground)"
133
+ />
134
+ <path
135
+ d="M67.9452 5.25464C67.1033 4.8163 66.1253 4.59375 65.0376 4.59375C63.9498 4.59375 62.9371 4.84732 62.0786 5.34636C61.22 5.83191 60.5379 6.53056 60.0545 7.42479C59.5877 8.31632 59.3516 9.36295 59.3516 10.5364C59.3516 11.7098 59.5961 12.7416 60.0795 13.6493C60.5782 14.5422 61.2826 15.2489 62.173 15.7493C63.0608 16.2335 64.1096 16.479 65.2904 16.479C66.6463 16.479 67.8091 16.1013 68.7496 15.3568C69.6873 14.5975 70.2819 13.6129 70.5166 12.43L70.5486 12.2695H68.3717L68.3439 12.3693C68.155 13.0612 67.7716 13.6129 67.2062 14.0081C66.6519 14.3898 65.9614 14.584 65.1543 14.584C64.1138 14.584 63.2594 14.2603 62.6176 13.6237C61.9744 12.9844 61.6326 12.1171 61.6021 11.0462V11.026H70.6681L70.6792 10.9019C70.7097 10.5377 70.725 10.2801 70.725 10.1088C70.6945 8.99474 70.4333 8.00745 69.9512 7.17527C69.4664 6.34039 68.7926 5.69434 67.948 5.25329L67.9452 5.25464ZM68.4814 9.24561H61.7327C61.8452 8.44715 62.2092 7.78626 62.8135 7.27912C63.4567 6.73962 64.2124 6.46582 65.0612 6.46582C66.0156 6.46582 66.8102 6.72479 67.4229 7.23462C68.0147 7.71612 68.3703 8.39185 68.4801 9.24561H68.4814Z"
136
+ fill="var(--foreground)"
137
+ />
138
+ <path
139
+ d="M59.6949 4.72835H57.0679L51.3291 10.6224V0.5H49.1716V14.4084H47.5879C47.3671 14.4084 47.2087 14.3558 47.1059 14.2465C47.0003 14.1359 46.9475 13.9579 46.9475 13.7205V8.82453C46.9475 7.47037 46.5155 6.417 45.6639 5.69811C44.8317 4.96708 43.6356 4.59483 42.1103 4.59483C40.6808 4.59483 39.4972 4.91853 38.59 5.55514C37.6912 6.1985 37.1633 7.10621 37.0216 8.2513L37.0036 8.40237H39.1527L39.1749 8.29447C39.2902 7.74687 39.5861 7.32336 40.0806 6.99831C40.5891 6.65977 41.242 6.48713 42.02 6.48713C42.8994 6.48713 43.5856 6.6854 44.0635 7.07924C44.5539 7.47172 44.7928 8.00448 44.7928 8.71123V9.35459H41.4935C39.9403 9.35459 38.7317 9.67155 37.901 10.296C37.0744 10.9286 36.6562 11.8471 36.6562 13.0286C36.6562 14.0914 37.0675 14.9425 37.8801 15.5616C38.6956 16.1712 39.7806 16.4801 41.1045 16.4801C42.7215 16.4801 44.0024 15.9217 44.9165 14.8184C44.9846 15.2581 45.1568 15.6088 45.4319 15.8637C45.7778 16.1833 46.3501 16.3465 47.1323 16.3465H49.1744H51.3319V13.2606L53.5143 11.0378L57.3138 16.2885L57.3555 16.3465H59.963L55.0619 9.52588L59.6977 4.727L59.6949 4.72835ZM39.4305 11.6084C39.8389 11.313 40.471 11.1619 41.3073 11.1619H44.7901V11.5827C44.7901 12.5039 44.4733 13.2565 43.8496 13.8203C43.2216 14.3733 42.3437 14.6525 41.2392 14.6525C40.4946 14.6525 39.8987 14.4893 39.4666 14.1683C39.0401 13.8513 38.8331 13.4427 38.8331 12.918C38.8331 12.3272 39.029 11.8983 39.4305 11.607V11.6084Z"
140
+ fill="var(--foreground)"
141
+ />
142
+ <path
143
+ d="M33.0116 5.25464C32.1698 4.8163 31.1918 4.59375 30.104 4.59375C29.0163 4.59375 28.0035 4.84732 27.145 5.34636C26.2851 5.83191 25.6044 6.53056 25.1209 7.42479C24.6541 8.31632 24.418 9.36295 24.418 10.5364C24.418 11.7098 24.6625 12.7416 25.1459 13.6493C25.6446 14.5422 26.349 15.2489 27.2395 15.7493C28.1272 16.2335 29.176 16.479 30.3555 16.479C31.7113 16.479 32.8755 16.1013 33.8146 15.3568C34.7523 14.5975 35.3469 13.6129 35.5817 12.43L35.6136 12.2695H33.4367L33.4089 12.3693C33.22 13.0612 32.8366 13.6129 32.2712 14.0081C31.7169 14.3898 31.0264 14.584 30.2193 14.584C29.1788 14.584 28.3244 14.2603 27.6826 13.6237C27.0394 12.9844 26.6977 12.1171 26.6685 11.0462V11.026H35.7345L35.7456 10.9019C35.7761 10.5377 35.7914 10.2801 35.7914 10.1088C35.7609 8.99339 35.4997 8.00745 35.0176 7.17527C34.5328 6.34039 33.859 5.69434 33.0144 5.25329L33.0116 5.25464ZM33.5479 9.24561H26.7991C26.9116 8.44715 27.2756 7.78626 27.8799 7.27912C28.5231 6.73962 29.2788 6.46582 30.1276 6.46582C31.082 6.46582 31.8766 6.72479 32.4893 7.23462C33.0811 7.71612 33.4367 8.39185 33.5465 9.24561H33.5479Z"
144
+ fill="var(--foreground)"
145
+ />
146
+ <path
147
+ d="M20.7354 5.3005C19.8783 4.83113 18.8836 4.59375 17.7792 4.59375C16.1593 4.59375 14.8424 5.18451 13.8616 6.34848L13.6379 4.72728H11.75V20.7977H13.9074V14.8942C14.2714 15.3326 14.734 15.6954 15.2855 15.9759H15.2883C15.9774 16.3118 16.8151 16.4803 17.7806 16.4803C18.8711 16.4803 19.8658 16.2268 20.7396 15.7277C21.6134 15.2274 22.3024 14.5206 22.7859 13.6277C23.2832 12.7362 23.5361 11.6963 23.5361 10.5377C23.5361 9.31845 23.2832 8.24888 22.7859 7.3587C22.301 6.46448 21.612 5.77121 20.7368 5.30185L20.7354 5.3005ZM21.33 10.5377C21.33 11.73 20.9799 12.7173 20.2881 13.4753C19.6157 14.2131 18.7099 14.5867 17.5958 14.5867C16.8762 14.5867 16.2219 14.414 15.6523 14.0728C15.0966 13.7316 14.659 13.2487 14.352 12.6377C14.0422 12.0065 13.8838 11.2849 13.8838 10.4932C13.8838 9.70149 14.0408 9.01767 14.3506 8.41613C14.6576 7.80514 15.0952 7.32903 15.6509 7.00263C16.2219 6.66139 16.8762 6.48875 17.5958 6.48875C18.7099 6.48875 19.6157 6.87045 20.2895 7.62441C20.9799 8.36622 21.3314 9.34677 21.3314 10.5377H21.33Z"
148
+ fill="var(--foreground)"
149
+ />
150
+ <path
151
+ d="M8.1483 9.92009C7.48565 9.71103 6.6285 9.54378 5.60049 9.42509C4.87532 9.33742 4.32381 9.25515 3.96261 9.18232C3.63754 9.11353 3.36664 8.9827 3.15687 8.79253C2.95544 8.61044 2.8568 8.35148 2.8568 8.00081C2.8568 7.52604 3.0763 7.15513 3.53057 6.86515C3.99318 6.55629 4.61554 6.39983 5.37683 6.39983C6.13812 6.39983 6.74798 6.58461 7.24115 6.95012C7.73431 7.31564 8.00938 7.76747 8.08162 8.32855L8.0969 8.44724H10.2488L10.2377 8.30158C10.1432 7.10928 9.63892 6.17729 8.73871 5.53393C7.86212 4.89597 6.70908 4.57227 5.30875 4.57227C4.453 4.57227 3.66949 4.72602 2.98322 5.02815C2.29139 5.31813 1.73293 5.73759 1.32173 6.27575C0.924413 6.81525 0.722976 7.44107 0.722976 8.13433C0.722976 8.90717 0.935526 9.52895 1.35646 9.98483C1.76905 10.4164 2.31362 10.7347 2.97627 10.9344C3.62226 11.1286 4.46412 11.2877 5.47546 11.4064C6.18535 11.4941 6.73547 11.5831 7.11195 11.6708C7.48148 11.753 7.78294 11.9068 8.00799 12.124C8.22471 12.3344 8.33445 12.6459 8.33445 13.0519C8.33445 13.5267 8.09968 13.9043 7.61901 14.2064C7.13973 14.5018 6.49375 14.6529 5.69912 14.6529C4.80169 14.6529 4.05847 14.4452 3.49028 14.0351C2.93876 13.6265 2.65676 13.1139 2.62758 12.4679L2.62202 12.3384H0.46875V12.4746C0.485421 13.729 0.974422 14.723 1.92325 15.4298C2.87486 16.1271 4.14599 16.4804 5.69774 16.4804C6.56738 16.4804 7.37173 16.3348 8.08856 16.0475C8.81095 15.7575 9.39303 15.3394 9.81952 14.8039C10.2488 14.2631 10.4669 13.6278 10.4669 12.9184C10.4669 12.1024 10.2474 11.4442 9.81535 10.9613C9.40276 10.4839 8.84152 10.1332 8.14691 9.91874L8.1483 9.92009Z"
152
+ fill="var(--foreground)"
153
+ />
154
+ </svg>
155
+ </>
156
+ )
157
+
158
+ const LogoSvg: FC<JSX.IntrinsicElements['svg']> = (props) => {
159
+ return (
160
+ <svg
161
+ xmlns="http://www.w3.org/2000/svg"
162
+ width="30"
163
+ height="30"
164
+ viewBox="0 0 30 30"
165
+ fill="none"
166
+ {...props}
167
+ >
168
+ <title>Speakeasy Logo</title>
169
+ <path
170
+ fill="var(--foreground)"
171
+ d="m20.639 27.548-19.17-2.724L0 26.1l20.639 2.931 8.456-7.336-1.468-.208-6.988 6.062Z"
172
+ />
173
+ <path
174
+ fill="var(--foreground)"
175
+ d="m20.639 23.1 8.456-7.336-1.468-.207-6.988 6.06-6.84-.972-9.394-1.333-2.936-.417L0 20.169l2.937.416L0 23.132l20.639 2.931 8.456-7.334-1.468-.208-6.986 6.062-9.78-1.39 1.468-1.273 8.31 1.18Z"
176
+ />
177
+ <path
178
+ fill="var(--foreground)"
179
+ d="m20.639 18.65-19.17-2.724L0 17.201l20.639 2.931 8.456-7.334-1.468-.208-6.988 6.06Z"
180
+ />
181
+ <path
182
+ fill="var(--foreground)"
183
+ d="M27.627 6.658 24.69 9.205 20.64 12.72l-7.923-1.126L1.469 9.996 0 11.271l11.246 1.596-1.467 1.275-8.311-1.181L0 14.235l20.639 2.932 8.456-7.334-2.937-.418 2.937-2.549-1.468-.208Z"
184
+ />
185
+ <path
186
+ fill="var(--foreground)"
187
+ d="M29.095 3.902 8.456.971 0 8.305l20.639 2.934 8.456-7.337Z"
188
+ />
189
+ </svg>
190
+ )
191
+ }
@@ -0,0 +1,17 @@
1
+ import * as svgs from './svgs'
2
+
3
+ type LogoVariant = 'wordmark' | 'icon'
4
+
5
+ export interface LogoProps extends React.SVGProps<SVGSVGElement> {
6
+ variant: LogoVariant
7
+ muted?: boolean
8
+ }
9
+
10
+ export function Logo({ variant, className, ...props }: LogoProps) {
11
+ switch (variant) {
12
+ case 'wordmark':
13
+ return <svgs.Wordmark {...props} className={className} />
14
+ case 'icon':
15
+ return <svgs.Logo className={className} {...props} />
16
+ }
17
+ }
@@ -0,0 +1,126 @@
1
+ import { cn } from '../../../lib/utils'
2
+
3
+ interface SvgProps extends React.SVGProps<SVGSVGElement> {
4
+ muted?: boolean
5
+ }
6
+
7
+ export function Wordmark({ className, muted, ...props }: SvgProps) {
8
+ return (
9
+ <svg
10
+ aria-label="Speakeasy Logo"
11
+ xmlns="http://www.w3.org/2000/svg"
12
+ shapeRendering="geometricPrecision"
13
+ textRendering="optimizeLegibility"
14
+ viewBox={`0 0 140 24`}
15
+ preserveAspectRatio="xMidYMid meet"
16
+ className={cn(
17
+ muted ? 'text-foreground/80' : 'text-foreground dark:text-primary',
18
+ className
19
+ )}
20
+ {...props}
21
+ >
22
+ <g opacity="1">
23
+ <path
24
+ d="M16.0663 19.6857L1.58654 17.6882L0.476562 18.6229L16.0663 20.7728L22.4539 15.3926L21.3453 15.2402L16.0663 19.6857Z"
25
+ fill="currentColor"
26
+ />
27
+ <path
28
+ d="M16.0663 16.4252L22.4539 11.045L21.3453 10.8926L16.0663 15.3367L10.8998 14.6246L3.80372 13.6467L1.58654 13.3406L0.476563 14.2753L2.69513 14.5801L0.476562 16.4481L16.0663 18.598L22.4539 13.2192L21.3453 13.0668L16.0677 17.5123L8.68123 16.4926L9.78982 15.5593L16.0663 16.4252Z"
29
+ fill="currentColor"
30
+ />
31
+ <path
32
+ d="M16.0663 13.161L1.58654 11.1634L0.476562 12.0981L16.0663 14.248L22.4539 8.86921L21.3453 8.7168L16.0663 13.161Z"
33
+ fill="currentColor"
34
+ />
35
+ <path
36
+ d="M21.3453 4.36719L19.1267 6.23522L16.0663 8.81269L10.0816 7.98725L1.58654 6.81518L0.476562 7.74987L8.97158 8.92059L7.86299 9.85528L1.58515 8.98938L0.476563 9.92406L16.0663 12.074L22.4539 6.69514L20.2353 6.38897L22.4539 4.5196L21.3453 4.36719Z"
37
+ fill="currentColor"
38
+ />
39
+ <path
40
+ d="M22.4539 2.34523L6.86415 0.195312L0.476562 5.57415L16.0663 7.72542L22.4539 2.34523Z"
41
+ fill="currentColor"
42
+ />
43
+
44
+ {/* Text part - hidden on mobile */}
45
+ <g>
46
+ <path
47
+ d="M134.145 4.5619L130.755 13.5675L127.255 4.5619H124.961L129.598 16.1329L129.023 17.4425C128.86 17.831 128.719 18.1061 128.606 18.2572L128.597 18.2707C128.505 18.4244 128.384 18.5296 128.227 18.5917C128.062 18.6591 127.802 18.6928 127.455 18.6928H125.643V20.6323H128.028C128.584 20.6323 129.037 20.5447 129.377 20.372C129.719 20.198 130.008 19.9269 130.233 19.5655C130.45 19.2188 130.701 18.6955 130.978 18.009L136.439 4.56055H134.144L134.145 4.5619Z"
48
+ fill="currentColor"
49
+ />
50
+ <path
51
+ d="M122.859 9.75602C122.197 9.54697 121.339 9.37972 120.311 9.26103C119.585 9.17336 119.035 9.09109 118.674 9.01825C118.348 8.94947 118.078 8.81864 117.868 8.62846C117.666 8.44638 117.568 8.18742 117.568 7.83674C117.568 7.36198 117.787 6.99107 118.242 6.70109C118.704 6.39222 119.326 6.23577 120.088 6.23577C120.849 6.23577 121.459 6.42055 121.952 6.78606C122.445 7.15292 122.72 7.60341 122.793 8.16449L122.808 8.28318H124.96L124.949 8.13752C124.854 6.94521 124.35 6.01322 123.45 5.36987C122.573 4.7319 121.42 4.4082 120.02 4.4082C119.164 4.4082 118.38 4.56196 117.694 4.86408C117.002 5.15407 116.444 5.57353 116.033 6.11168C115.635 6.65253 115.434 7.27701 115.434 7.97027C115.434 8.74311 115.646 9.36488 116.067 9.82076C116.48 10.2524 117.025 10.5707 117.687 10.7703C118.333 10.9645 119.175 11.1237 120.186 11.2424C120.896 11.33 121.446 11.419 121.823 11.5067C122.192 11.589 122.494 11.7427 122.719 11.9599C122.944 12.177 123.045 12.4819 123.045 12.8878C123.045 13.3626 122.811 13.7403 122.33 14.0424C121.851 14.3378 121.205 14.4888 120.41 14.4888C119.513 14.4888 118.769 14.2811 118.201 13.8711C117.65 13.4624 117.368 12.9499 117.339 12.3038L117.333 12.1743H115.18V12.3106C115.198 13.5649 115.685 14.5589 116.636 15.2657C117.587 15.963 118.857 16.3164 120.41 16.3164C121.28 16.3164 122.084 16.1707 122.801 15.8834C123.523 15.5934 124.105 15.1753 124.532 14.6399C124.961 14.099 125.179 13.4651 125.179 12.7543C125.179 11.9383 124.96 11.2801 124.528 10.7973C124.115 10.3198 123.554 9.96913 122.861 9.75467L122.859 9.75602Z"
52
+ fill="currentColor"
53
+ />
54
+ <path
55
+ d="M113.81 14.0814C113.705 13.9708 113.652 13.7928 113.652 13.5554V8.65939C113.652 7.30524 113.22 6.25186 112.368 5.53297C111.536 4.80194 110.34 4.42969 108.815 4.42969C107.385 4.42969 106.202 4.75339 105.295 5.39C104.396 6.03336 103.868 6.94107 103.726 8.08617L103.708 8.23723H105.857L105.879 8.12933C105.995 7.58173 106.291 7.15822 106.785 6.83317C107.294 6.49463 107.947 6.32334 108.725 6.32334C109.604 6.32334 110.29 6.52161 110.768 6.91545C111.258 7.30793 111.497 7.84204 111.497 8.54744V9.1908H108.198C106.645 9.1908 105.436 9.50776 104.617 10.1241L104.604 10.1309C103.778 10.7634 103.359 11.682 103.359 12.8635C103.359 13.9263 103.771 14.7773 104.583 15.3964C105.399 16.0061 106.484 16.3149 107.808 16.3149C109.425 16.3149 110.706 15.7565 111.62 14.6533C111.688 15.093 111.86 15.445 112.135 15.6986C112.481 16.0182 113.053 16.1814 113.835 16.1814H115.005V14.2419H114.294C114.073 14.2419 113.915 14.1893 113.812 14.08L113.81 14.0814ZM111.495 10.9981V11.4189C111.495 12.3401 111.178 13.0928 110.554 13.6565C109.926 14.2095 109.048 14.4887 107.944 14.4887C107.199 14.4887 106.603 14.3255 106.171 14.0045C105.745 13.6876 105.538 13.2789 105.538 12.7542C105.538 12.1635 105.734 11.7346 106.135 11.4432C106.543 11.1478 107.176 10.9968 108.012 10.9968H111.495V10.9981Z"
56
+ fill="currentColor"
57
+ />
58
+ <path
59
+ d="M99.7186 5.09058C98.8768 4.65223 97.8988 4.42969 96.811 4.42969C95.7233 4.42969 94.7105 4.68325 93.852 5.18229C92.9935 5.66785 92.3114 6.3665 91.8279 7.26073C91.3612 8.15226 91.125 9.19889 91.125 10.3723C91.125 11.5457 91.3695 12.5775 91.8529 13.4852C92.3517 14.3781 93.056 15.0849 93.9465 15.5853C94.8342 16.0695 95.883 16.3149 97.0639 16.3149C98.4197 16.3149 99.5825 15.9373 100.523 15.1928C101.461 14.4334 102.055 13.4488 102.29 12.266L102.322 12.1055H100.145L100.117 12.2053C99.9284 12.8972 99.545 13.4488 98.9796 13.844C98.4253 14.2257 97.7349 14.4199 96.9277 14.4199C95.8872 14.4199 95.0328 14.0962 94.391 13.4596C93.7478 12.8203 93.4061 11.9531 93.3755 10.8821V10.8619H102.442L102.453 10.7378C102.483 10.3737 102.498 10.116 102.498 9.94475C102.468 8.83068 102.207 7.84339 101.725 7.01121C101.24 6.17633 100.566 5.53027 99.7214 5.08923L99.7186 5.09058ZM100.255 9.08155H93.5061C93.6186 8.28309 93.9826 7.62219 94.5869 7.11506C95.2301 6.57556 95.9858 6.30176 96.8347 6.30176C97.789 6.30176 98.5837 6.56072 99.1963 7.07055C99.7881 7.55206 100.144 8.22779 100.253 9.08155H100.255Z"
60
+ fill="currentColor"
61
+ />
62
+ <path
63
+ d="M91.4683 4.56429H88.8413L83.1025 10.4584V0.335938H80.9451V14.2443H79.3614C79.1405 14.2443 78.9821 14.1917 78.8793 14.0825C78.7737 13.9719 78.7209 13.7938 78.7209 13.5565V8.66046C78.7209 7.30631 78.2889 6.25293 77.4373 5.53405C76.6052 4.80302 75.4091 4.43076 73.8837 4.43076C72.4542 4.43076 71.2706 4.75446 70.3635 5.39108C69.4646 6.03443 68.9367 6.94215 68.795 8.08724L68.777 8.2383H70.9261L70.9483 8.1304C71.0636 7.58281 71.3595 7.1593 71.8541 6.83425C72.3625 6.49571 73.0155 6.32307 73.7934 6.32307C74.6728 6.32307 75.3591 6.52134 75.837 6.91517C76.3273 7.30766 76.5663 7.84042 76.5663 8.54717V9.19053H73.2669C71.7138 9.19053 70.5052 9.50748 69.6744 10.132C68.8478 10.7645 68.4297 11.683 68.4297 12.8645C68.4297 13.9274 68.8409 14.7784 69.6536 15.3975C70.469 16.0071 71.554 16.316 72.8779 16.316C74.495 16.316 75.7758 15.7576 76.6899 14.6543C76.758 15.094 76.9303 15.4447 77.2053 15.6996C77.5512 16.0193 78.1236 16.1825 78.9057 16.1825H80.9478H83.1053V13.0965L85.2877 10.8738L89.0872 16.1245L89.1289 16.1825H91.7364L86.8353 9.36182L91.4711 4.56294L91.4683 4.56429ZM71.2039 11.4443C71.6124 11.1489 72.2445 10.9979 73.0808 10.9979H76.5635V11.4187C76.5635 12.3399 76.2468 13.0925 75.623 13.6563C74.9951 14.2092 74.1171 14.4884 73.0127 14.4884C72.2681 14.4884 71.6721 14.3252 71.2401 14.0042C70.8136 13.6873 70.6066 13.2786 70.6066 12.7539C70.6066 12.1632 70.8025 11.7343 71.2039 11.4429V11.4443Z"
64
+ fill="currentColor"
65
+ />
66
+ <path
67
+ d="M64.7851 5.09058C63.9432 4.65223 62.9652 4.42969 61.8774 4.42969C60.7897 4.42969 59.777 4.68325 58.9184 5.18229C58.0585 5.66785 57.3778 6.3665 56.8943 7.26073C56.4276 8.15226 56.1914 9.19889 56.1914 10.3723C56.1914 11.5457 56.4359 12.5775 56.9194 13.4852C57.4181 14.3781 58.1224 15.0849 59.0129 15.5853C59.9006 16.0695 60.9495 16.3149 62.1289 16.3149C63.4848 16.3149 64.6489 15.9373 65.588 15.1928C66.5257 14.4334 67.1203 13.4488 67.3551 12.266L67.387 12.1055H65.2102L65.1824 12.2053C64.9934 12.8972 64.61 13.4488 64.0446 13.844C63.4903 14.2257 62.7999 14.4199 61.9927 14.4199C60.9522 14.4199 60.0979 14.0962 59.456 13.4596C58.8128 12.8203 58.4711 11.9531 58.4419 10.8821V10.8619H67.5079L67.519 10.7378C67.5496 10.3737 67.5649 10.116 67.5649 9.94475C67.5343 8.82933 67.2731 7.84339 66.7911 7.01121C66.3062 6.17633 65.6325 5.53027 64.7878 5.08923L64.7851 5.09058ZM65.3213 9.08155H58.5725C58.685 8.28309 59.049 7.62219 59.6533 7.11506C60.2965 6.57556 61.0522 6.30176 61.9011 6.30176C62.8554 6.30176 63.6501 6.56072 64.2627 7.07055C64.8545 7.55206 65.2102 8.22779 65.3199 9.08155H65.3213Z"
68
+ fill="currentColor"
69
+ />
70
+ <path
71
+ d="M52.5088 5.13644C51.6517 4.66707 50.657 4.42969 49.5526 4.42969C47.9328 4.42969 46.6158 5.02044 45.635 6.18442L45.4114 4.56321H43.5234V20.6337H45.6809V14.7301C46.0449 15.1685 46.5075 15.5313 47.059 15.8118H47.0617C47.7508 16.1477 48.5885 16.3163 49.554 16.3163C50.6445 16.3163 51.6392 16.0627 52.513 15.5637C53.3868 15.0633 54.0759 14.3565 54.5593 13.4637C55.0566 12.5721 55.3095 11.5322 55.3095 10.3737C55.3095 9.15438 55.0566 8.08482 54.5593 7.19464C54.0745 6.30041 53.3854 5.60715 52.5102 5.13778L52.5088 5.13644ZM53.1034 10.3737C53.1034 11.566 52.7533 12.5533 52.0615 13.3113C51.3891 14.049 50.4834 14.4226 49.3692 14.4226C48.6496 14.4226 47.9953 14.25 47.4257 13.9088C46.87 13.5675 46.4324 13.0847 46.1254 12.4737C45.8156 11.8425 45.6573 11.1209 45.6573 10.3292C45.6573 9.53743 45.8142 8.85361 46.124 8.25206C46.431 7.64108 46.8687 7.16497 47.4243 6.83857C47.9953 6.49733 48.6496 6.32469 49.3692 6.32469C50.4834 6.32469 51.3891 6.70639 52.0629 7.46034C52.7533 8.20216 53.1048 9.18271 53.1048 10.3737H53.1034Z"
72
+ fill="currentColor"
73
+ />
74
+ <path
75
+ d="M39.9217 9.75602C39.2591 9.54697 38.4019 9.37972 37.3739 9.26103C36.6488 9.17336 36.0972 9.09109 35.7361 9.01825C35.411 8.94947 35.1401 8.81864 34.9303 8.62846C34.7289 8.44638 34.6302 8.18742 34.6302 7.83674C34.6302 7.36198 34.8497 6.99107 35.304 6.70109C35.7666 6.39222 36.389 6.23577 37.1503 6.23577C37.9116 6.23577 38.5214 6.42055 39.0146 6.78606C39.5078 7.15157 39.7828 7.60341 39.8551 8.16449L39.8703 8.28318H42.0222L42.0111 8.13752C41.9166 6.94521 41.4124 6.01322 40.5122 5.36987C39.6356 4.7319 38.4825 4.4082 37.0822 4.4082C36.2264 4.4082 35.4429 4.56196 34.7567 4.86408C34.0648 5.15407 33.5064 5.57353 33.0952 6.11168C32.6979 6.65119 32.4964 7.27701 32.4964 7.97027C32.4964 8.74311 32.709 9.36488 33.1299 9.82076C33.5425 10.2524 34.0871 10.5707 34.7497 10.7703C35.3957 10.9645 36.2376 11.1237 37.2489 11.2424C37.9588 11.33 38.5089 11.419 38.8854 11.5067C39.2549 11.589 39.5564 11.7427 39.7814 11.9599C39.9981 12.1703 40.1079 12.4819 40.1079 12.8878C40.1079 13.3626 39.8731 13.7403 39.3924 14.0424C38.9132 14.3378 38.2672 14.4888 37.4726 14.4888C36.5751 14.4888 35.8319 14.2811 35.2637 13.8711C34.7122 13.4624 34.4302 12.9499 34.401 12.3038L34.3955 12.1743H32.2422V12.3106C32.2589 13.5649 32.7479 14.5589 33.6967 15.2657C34.6483 15.963 35.9194 16.3164 37.4712 16.3164C38.3408 16.3164 39.1452 16.1707 39.862 15.8834C40.5844 15.5934 41.1665 15.1753 41.593 14.6399C42.0222 14.099 42.2403 13.4638 42.2403 12.7543C42.2403 11.9383 42.0208 11.2801 41.5888 10.7973C41.1762 10.3198 40.615 9.96913 39.9204 9.75467L39.9217 9.75602Z"
76
+ fill="currentColor"
77
+ />
78
+ </g>
79
+ </g>
80
+ </svg>
81
+ )
82
+ }
83
+
84
+ export function Logo({ className, muted, ...props }: SvgProps) {
85
+ return (
86
+ <svg
87
+ width={24}
88
+ height={24}
89
+ shapeRendering="geometricPrecision"
90
+ textRendering="optimizeLegibility"
91
+ viewBox={`0 0 24 24`}
92
+ xmlns="http://www.w3.org/2000/svg"
93
+ preserveAspectRatio="xMidYMid meet"
94
+ className={cn(
95
+ muted
96
+ ? 'text-foreground/80 h-[24px] w-[24px]'
97
+ : 'dark:text-primary text-black',
98
+ className
99
+ )}
100
+ {...props}
101
+ >
102
+ <g clipPath="url(#clip0)">
103
+ <path
104
+ d="M16.0663 19.6857L1.58654 17.6882L0.476562 18.6229L16.0663 20.7728L22.4539 15.3926L21.3453 15.2402L16.0663 19.6857Z"
105
+ fill="currentColor"
106
+ />
107
+ <path
108
+ d="M16.0663 16.4252L22.4539 11.045L21.3453 10.8926L16.0663 15.3367L10.8998 14.6246L3.80372 13.6467L1.58654 13.3406L0.476563 14.2753L2.69513 14.5801L0.476562 16.4481L16.0663 18.598L22.4539 13.2192L21.3453 13.0668L16.0677 17.5123L8.68123 16.4926L9.78982 15.5593L16.0663 16.4252Z"
109
+ fill="currentColor"
110
+ />
111
+ <path
112
+ d="M16.0663 13.161L1.58654 11.1634L0.476562 12.0981L16.0663 14.248L22.4539 8.86921L21.3453 8.7168L16.0663 13.161Z"
113
+ fill="currentColor"
114
+ />
115
+ <path
116
+ d="M21.3453 4.36719L19.1267 6.23522L16.0663 8.81269L10.0816 7.98725L1.58654 6.81518L0.476562 7.74987L8.97158 8.92059L7.86299 9.85528L1.58515 8.98938L0.476563 9.92406L16.0663 12.074L22.4539 6.69514L20.2353 6.38897L22.4539 4.5196L21.3453 4.36719Z"
117
+ fill="currentColor"
118
+ />
119
+ <path
120
+ d="M22.4539 2.34523L6.86415 0.195312L0.476562 5.57415L16.0663 7.72542L22.4539 2.34523Z"
121
+ fill="currentColor"
122
+ />
123
+ </g>
124
+ </svg>
125
+ )
126
+ }
@@ -0,0 +1,104 @@
1
+ import {
2
+ Dialog,
3
+ DialogClose,
4
+ DialogContent,
5
+ DialogDescription,
6
+ DialogOverlay,
7
+ DialogPortal,
8
+ DialogTitle,
9
+ } from '@radix-ui/react-dialog'
10
+ import { useModal } from '../../hooks/useModal'
11
+ import { cn } from '../../lib/utils'
12
+ import { IconButton } from '../IconButton'
13
+ import { Icon } from '../Icon'
14
+ import { Screen } from '../../context/ModalContext'
15
+
16
+ export interface ModalProps {
17
+ closable?: boolean
18
+ className?: string
19
+ layout: 'default' | 'custom'
20
+ onClose?: (currentScreen: Screen) => void
21
+ }
22
+
23
+ export const Modal = ({
24
+ closable = false,
25
+ className,
26
+ layout = 'default',
27
+ onClose,
28
+ }: ModalProps) => {
29
+ const { screens, currentIndex, isOpen, close } = useModal()
30
+ const currentScreen = screens[currentIndex]
31
+
32
+ const handleOpenChange = (open: boolean) => {
33
+ if (closable && !open) {
34
+ close()
35
+ onClose?.(currentScreen)
36
+ }
37
+ }
38
+
39
+ if (!isOpen) return null
40
+ if (!currentScreen) return null
41
+
42
+ return (
43
+ <Dialog open={isOpen} onOpenChange={handleOpenChange}>
44
+ <DialogPortal>
45
+ <DialogOverlay className="bg-surface-secondary fixed top-0 z-10 h-screen w-screen opacity-85" />
46
+
47
+ {layout === 'default' ? (
48
+ <DialogContent
49
+ className={cn(
50
+ 'bg-surface-primary border-neutral-default fixed top-1/2 left-1/2 z-20 flex h-auto max-h-[85vh] min-h-[40vh] w-[90vw] max-w-[800px] -translate-x-1/2 -translate-y-1/2 flex-col gap-3 overflow-y-auto rounded-md p-10 shadow-lg outline-none',
51
+ className
52
+ )}
53
+ >
54
+ {closable && (
55
+ <DialogClose asChild>
56
+ <IconButton
57
+ variant="tertiary"
58
+ icon={
59
+ <Icon
60
+ name="x"
61
+ className="text-neutral-default hover:text-neutral-default/80 size-7 focus:outline-none"
62
+ />
63
+ }
64
+ aria-label="Close modal"
65
+ className="absolute top-4 right-4 focus:ring-0 focus:outline-none focus-visible:ring-0"
66
+ />
67
+ </DialogClose>
68
+ )}
69
+ {currentScreen.title && (
70
+ <DialogTitle className="text-display-sm">
71
+ {currentScreen.title}
72
+ </DialogTitle>
73
+ )}
74
+ <DialogDescription>{currentScreen.component}</DialogDescription>
75
+ </DialogContent>
76
+ ) : (
77
+ <DialogContent
78
+ className={cn(
79
+ 'bg-surface-primary border-neutral-default fixed top-1/2 left-1/2 z-20 flex h-auto max-h-[85vh] min-h-[40vh] w-[90vw] max-w-[800px] -translate-x-1/2 -translate-y-1/2 flex-col gap-3 overflow-y-auto rounded-md p-10 shadow-lg outline-none',
80
+ className
81
+ )}
82
+ >
83
+ {closable && (
84
+ <DialogClose asChild>
85
+ <IconButton
86
+ variant="tertiary"
87
+ icon={
88
+ <Icon
89
+ name="x"
90
+ className="text-neutral-default hover:text-neutral-default/80 size-7 focus:outline-none"
91
+ />
92
+ }
93
+ aria-label="Close modal"
94
+ className="absolute top-4 right-4 focus:ring-0 focus:outline-none focus-visible:ring-0"
95
+ />
96
+ </DialogClose>
97
+ )}
98
+ {currentScreen.component}
99
+ </DialogContent>
100
+ )}
101
+ </DialogPortal>
102
+ </Dialog>
103
+ )
104
+ }