diff --git a/web/apps/admin/package.json b/web/apps/admin/package.json index 805563840..055d5bcf5 100644 --- a/web/apps/admin/package.json +++ b/web/apps/admin/package.json @@ -17,7 +17,7 @@ "@hookform/resolvers": "^3.0.1", "@radix-ui/react-form": "^0.1.8", "@radix-ui/react-icons": "^1.3.0", - "@raystack/apsara": "0.56.6", + "@raystack/apsara-v1": "npm:@raystack/apsara@1.0.0-rc.6", "@raystack/frontier": "workspace:^", "@raystack/proton": "0.1.0-7523cfd3a676d3fb72d63c8c4f0476738a2217b3", "@stitches/react": "^1.2.8", @@ -37,7 +37,6 @@ "react-router-dom": "^6.9.0", "react-select": "^5.8.0", "slugify": "^1.6.6", - "sonner": "^1.4.41", "swr": "^2.1.2", "usehooks-ts": "^3.1.1", "vite-tsconfig-paths": "^4.0.7", diff --git a/web/apps/admin/src/App.tsx b/web/apps/admin/src/App.tsx index 8372175ba..f72e4cf1f 100644 --- a/web/apps/admin/src/App.tsx +++ b/web/apps/admin/src/App.tsx @@ -1,7 +1,7 @@ -import { Flex } from "@raystack/apsara"; +import { Flex } from "@raystack/apsara-v1"; import { Outlet } from "react-router-dom"; -import "@raystack/apsara/style.css"; -import "@raystack/apsara/normalize.css"; +import "@raystack/apsara-v1/normalize.css"; +import "@raystack/apsara-v1/style.css"; import "./App.css"; import IAMSidebar from "./components/Sidebar"; diff --git a/web/apps/admin/src/components/Layout.tsx b/web/apps/admin/src/components/Layout.tsx index 3e3c0d939..6c3ea1214 100644 --- a/web/apps/admin/src/components/Layout.tsx +++ b/web/apps/admin/src/components/Layout.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { Box, Flex } from "@raystack/apsara"; +import { Box, Flex } from "@raystack/apsara-v1"; type Props = { header?: React.ReactNode; diff --git a/web/apps/admin/src/components/Price.tsx b/web/apps/admin/src/components/Price.tsx index 546843ad4..de1ebdd47 100644 --- a/web/apps/admin/src/components/Price.tsx +++ b/web/apps/admin/src/components/Price.tsx @@ -1,4 +1,4 @@ -import { Flex } from "@raystack/apsara"; +import { Flex } from "@raystack/apsara-v1"; import { getCurrencyValue } from "~/utils/helper"; type PriceProps = { diff --git a/web/apps/admin/src/components/Sidebar/index.tsx b/web/apps/admin/src/components/Sidebar/index.tsx index 6190f58bc..e3c58f5c3 100644 --- a/web/apps/admin/src/components/Sidebar/index.tsx +++ b/web/apps/admin/src/components/Sidebar/index.tsx @@ -2,17 +2,17 @@ import type React from "react"; import { useContext } from "react"; import { Avatar, - DropdownMenu, + Menu, Flex, Sidebar, Text, useTheme, -} from "@raystack/apsara"; +} from "@raystack/apsara-v1"; import { useMutation } from "@connectrpc/connect-query"; import { FrontierServiceQueries } from "@raystack/proton/frontier"; import styles from "./sidebar.module.css"; -import { OrganizationIcon } from "@raystack/apsara/icons"; +import { OrganizationIcon } from "@raystack/apsara-v1/icons"; import IAMIcon from "~/assets/icons/iam.svg?react"; import UserIcon from "~/assets/icons/users.svg?react"; import InvoicesIcon from "~/assets/icons/invoices.svg?react"; @@ -157,7 +157,7 @@ export default function IAMSidebar() { key={subItem.name} active={isActive(subItem.to)} data-test-id={`admin-sidebar-navigation-cell-${subItem.name}`} - as={}> + render={}> {subItem.name} ))} @@ -168,7 +168,7 @@ export default function IAMSidebar() { key={nav.name} active={isActive(nav.to)} data-test-id={`admin-sidebar-navigation-cell-${nav.name}`} - as={}> + render={}> {nav.name} ); @@ -207,28 +207,30 @@ function UserDropdown() { : { icon: , label: "Light" }; return ( - - - - } - data-test-id="frontier-sdk-sidebar-logout"> - {user?.email} - - - - + + } + data-test-id="frontier-sdk-sidebar-logout"> + {user?.email} + + } + /> + + {themeData.icon} {themeData.label} - - + logoutMutation.mutate({})} data-test-id="admin-logout-btn"> Logout - - - + + + ); } diff --git a/web/apps/admin/src/components/Sidebar/sidebar.module.css b/web/apps/admin/src/components/Sidebar/sidebar.module.css index 02bf05c6b..0ae3f445b 100644 --- a/web/apps/admin/src/components/Sidebar/sidebar.module.css +++ b/web/apps/admin/src/components/Sidebar/sidebar.module.css @@ -6,6 +6,10 @@ width: 220px !important; } +.sidebar :global(.sidebar-module_main__qDvo4) { + gap: var(--rs-space-1); +} + .sidebar-group { margin-top: var(--rs-space-5); } diff --git a/web/apps/admin/src/components/assign-role.tsx b/web/apps/admin/src/components/assign-role.tsx index 482c6dabf..29fc430f0 100644 --- a/web/apps/admin/src/components/assign-role.tsx +++ b/web/apps/admin/src/components/assign-role.tsx @@ -5,8 +5,8 @@ import { Flex, Label, Text, - toast, -} from "@raystack/apsara"; + toastManager, +} from "@raystack/apsara-v1"; import { useCallback } from "react"; import type { SearchOrganizationUsersResponse_OrganizationUser, @@ -139,9 +139,9 @@ export const AssignRole = ({ onRoleUpdate(); } - toast.success("Role assigned successfully"); + toastManager.add({ title: "Role assigned successfully", type: "success" }); } catch (error) { - toast.error("Failed to assign role"); + toastManager.add({ title: "Failed to assign role", type: "error" }); console.error(error); } }; @@ -187,16 +187,18 @@ export const AssignRole = ({ - - - + + Cancel + + } + /> - + + Cancel + + } + /> - + + {selectedValues.size} selected + + } + /> - + No results found. {options.map((option: Option) => { const isSelected = selectedValues.has(option.value); return ( handleSelect(option.value)} + key={option.value as React.Key} + onClick={() => handleSelect(option.value)} + data-test-id={`frontier-admin-multiselect-item-${option.value}`} > - - + + {option.label} @@ -67,11 +71,11 @@ export function MultiSelect({ ); })} - + <> - + {