Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

refactor: card component

Brad Barbind330af758562
diff --git a/apps/carbon/app/components/Layout/Background/Background.tsx b/apps/carbon/app/components/Layout/Background.tsx
similarity index 100%
rename from apps/carbon/app/components/Layout/Background/Background.tsx
rename to apps/carbon/app/components/Layout/Background.tsx
diff --git a/apps/carbon/app/components/Layout/Background/index.ts b/apps/carbon/app/components/Layout/Background/index.ts
deleted file mode 100644
index 6c76274954..0000000000
--- a/apps/carbon/app/components/Layout/Background/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import Background from "./Background";
-
-export default Background;
diff --git a/apps/carbon/app/components/Layout/PageTitle/PageTitle.tsx b/apps/carbon/app/components/Layout/PageTitle.tsx
similarity index 100%
rename from apps/carbon/app/components/Layout/PageTitle/PageTitle.tsx
rename to apps/carbon/app/components/Layout/PageTitle.tsx
diff --git a/apps/carbon/app/components/Layout/PageTitle/index.ts b/apps/carbon/app/components/Layout/PageTitle/index.ts
deleted file mode 100644
index ce9b043a16..0000000000
--- a/apps/carbon/app/components/Layout/PageTitle/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import PageTitle from "./PageTitle";
-
-export default PageTitle;
diff --git a/apps/carbon/app/components/Layout/SectionTitle/SectionTitle.tsx b/apps/carbon/app/components/Layout/SectionTitle.tsx
similarity index 100%
rename from apps/carbon/app/components/Layout/SectionTitle/SectionTitle.tsx
rename to apps/carbon/app/components/Layout/SectionTitle.tsx
diff --git a/apps/carbon/app/components/Layout/SectionTitle/index.ts b/apps/carbon/app/components/Layout/SectionTitle/index.ts
deleted file mode 100644
index 12113ff6f7..0000000000
--- a/apps/carbon/app/components/Layout/SectionTitle/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import SectionTitle from "./SectionTitle";
-
-export default SectionTitle;
diff --git a/apps/carbon/app/components/Layout/Sidebar/DetailSidebar.tsx b/apps/carbon/app/components/Layout/Sidebar/DetailSidebar.tsx
new file mode 100644
index 0000000000..bf372d43fd
--- /dev/null
+++ b/apps/carbon/app/components/Layout/Sidebar/DetailSidebar.tsx
@@ -0,0 +1,50 @@
+import { Count, VStack } from "@carbon/react";
+import { Button } from "@chakra-ui/react";
+import { Link, useMatches } from "@remix-run/react";
+import type { IconType } from "react-icons";
+
+type DetailSidebarProps = {
+ links: {
+ name: string;
+ to: string;
+ icon?: IconType;
+ count?: number;
+ }[];
+};
+
+const DetailSidebar = ({ links }: DetailSidebarProps) => {
+ const matches = useMatches();
+
+ return (
+ <VStack className="overflow-y-auto h-full" spacing={1}>
+ {links.map((route) => {
+ const isActive = matches.some(
+ (match) =>
+ (match.pathname.includes(route.to) && route.to !== "") ||
+ (match.id.includes(".index") && route.to === "")
+ );
+
+ return (
+ <Button
+ key={route.name}
+ className="border-border"
+ as={Link}
+ to={route.to}
+ colorScheme={isActive ? "brand" : "gray"}
+ variant={isActive ? "solid" : "ghost"}
+ border={isActive ? "1px solid" : "none"}
+ fontWeight={isActive ? "bold" : "normal"}
+ justifyContent="space-between"
+ size="md"
+ w="full"
+ >
+ <span>{route.name}</span>
+ {route.count !== undefined && <Count count={route.count} />}
+ </Button>
+ );
+ })}
+ </VStack>
+ );
+};
+
+export default DetailSidebar;
diff --git a/apps/carbon/app/components/Layout/Sidebar/index.ts b/apps/carbon/app/components/Layout/Sidebar/index.ts
index 24f707e687..df2f37b9a2 100644
--- a/apps/carbon/app/components/Layout/Sidebar/index.ts
+++ b/apps/carbon/app/components/Layout/Sidebar/index.ts
@@ -1,5 +1,6 @@
import ContentSidebar from "./ContentSidebar";
+import DetailSidebar from "./DetailSidebar";
import GroupedContentSidebar from "./GroupedContentSidebar";
import IconSidebar from "./IconSidebar";
-export { ContentSidebar, GroupedContentSidebar, IconSidebar };
+export { ContentSidebar, DetailSidebar, GroupedContentSidebar, IconSidebar };
diff --git a/apps/carbon/app/components/Layout/Topbar/Topbar.tsx b/apps/carbon/app/components/Layout/Topbar/Topbar.tsx
index 9a5c36e6b9..db190fe6a9 100644
--- a/apps/carbon/app/components/Layout/Topbar/Topbar.tsx
+++ b/apps/carbon/app/components/Layout/Topbar/Topbar.tsx
@@ -1,4 +1,4 @@
-import { HStack, useColor } from "@carbon/react";
+import { HStack } from "@carbon/react";
import { Button, GridItem } from "@chakra-ui/react";
import { BiHelpCircle } from "react-icons/bi";
import { BsChatSquare } from "react-icons/bs";
@@ -8,21 +8,10 @@ import Breadcrumbs from "./Breadcrumbs";
import Create from "./Create";
const Topbar = () => {
- const borderColor = useColor("gray.200");
-
return (
<GridItem
- bg={useColor("white")}
- borderBottom={1}
- borderBottomColor={borderColor}
- borderBottomStyle="solid"
- display="grid"
- gap={4}
+ className="grid bg-background text-foreground border-b border-border px-4 top-0 sticky z-10 space-x-4"
gridTemplateColumns="1fr auto 1fr"
- position="sticky"
- px={4}
- top={0}
- zIndex={1}
>
<Breadcrumbs />
<Search />
diff --git a/apps/carbon/app/components/Layout/index.ts b/apps/carbon/app/components/Layout/index.ts
index 85a4f2eaf9..a6dc89d9c0 100644
--- a/apps/carbon/app/components/Layout/index.ts
+++ b/apps/carbon/app/components/Layout/index.ts
@@ -1,12 +1,19 @@
import Background from "./Background";
import PageTitle from "./PageTitle";
import SectionTitle from "./SectionTitle";
-import { ContentSidebar, IconSidebar } from "./Sidebar";
+import {
+ ContentSidebar,
+ DetailSidebar,
+ GroupedContentSidebar,
+ IconSidebar,
+} from "./Sidebar";
import Topbar from "./Topbar";
export {
Background,
ContentSidebar,
+ DetailSidebar,
+ GroupedContentSidebar,
IconSidebar,
PageTitle,
SectionTitle,
diff --git a/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceForm/PurchaseInvoiceForm.tsx b/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceForm/PurchaseInvoiceForm.tsx
index 176f16af5e..35a86990ed 100644
--- a/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceForm/PurchaseInvoiceForm.tsx
+++ b/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceForm/PurchaseInvoiceForm.tsx
@@ -1,5 +1,13 @@
-import { Heading, VStack } from "@carbon/react";
-import { Card, CardBody, CardFooter, CardHeader, Grid } from "@chakra-ui/react";
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ VStack,
+} from "@carbon/react";
+import { Grid } from "@chakra-ui/react";
import { useState } from "react";
import { ValidatedForm } from "remix-validated-form";
import {
@@ -58,19 +66,19 @@ const PurchaseInvoiceForm = ({
validator={purchaseInvoiceValidator}
defaultValues={initialValues}
>
- <Card w="full">
+ <Card className="w-full">
<CardHeader>
- <Heading size="h3">
+ <CardTitle>
{isEditing ? "Purchase Invoice" : "New Purchase Invoice"}
- </Heading>
+ </CardTitle>
{!isEditing && (
- <p className="text-muted-foreground font-normal">
+ <CardDescription>
A purchase invoice is a document that specifies the products or
services purchased by a customer and the corresponding cost.
- </p>
+ </CardDescription>
)}
</CardHeader>
- <CardBody>
+ <CardContent>
<Hidden name="id" />
<Hidden name="invoiceId" />
<VStack>
@@ -141,7 +149,7 @@ const PurchaseInvoiceForm = ({
</VStack>
</Grid>
</VStack>
- </CardBody>
+ </CardContent>
<CardFooter>
<Submit
isDisabled={
diff --git a/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceHeader/PurchaseInvoiceHeader.tsx b/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceHeader/PurchaseInvoiceHeader.tsx
index fcb8f86915..2d11414d54 100644
--- a/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceHeader/PurchaseInvoiceHeader.tsx
+++ b/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceHeader/PurchaseInvoiceHeader.tsx
@@ -1,15 +1,17 @@
import {
- HStack,
- Heading,
+ Card,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
Menubar,
MenubarItem,
VStack,
useDisclosure,
} from "@carbon/react";
-import { Button, Card, CardBody, CardHeader, Stack } from "@chakra-ui/react";
+import { Stack } from "@chakra-ui/react";
import { useParams } from "@remix-run/react";
import { useMemo, useState } from "react";
-import { FaHistory } from "react-icons/fa";
import { usePermissions, useRouteData } from "~/hooks";
import { useSupabase } from "~/lib/supabase";
import type { PurchaseInvoice } from "~/modules/invoicing";
@@ -82,28 +84,20 @@ const PurchaseInvoiceHeader = () => {
</Menubar>
)}
- <Card w="full">
+ <Card className="w-full">
<CardHeader>
- <HStack className="items-start justify-between">
- <VStack>
- <Heading size="h3">{purchaseInvoice.invoiceId}</Heading>
- <span className="text-muted-foreground font-normal">
- {purchaseInvoice.supplierName}
- </span>
- </VStack>
- <Button onClick={() => alert("TODO")} leftIcon={<FaHistory />}>
- Supplier Details
- </Button>
- </HStack>
+ <CardTitle>{purchaseInvoice.invoiceId}</CardTitle>
+ <CardDescription>{purchaseInvoice.supplierName}</CardDescription>
</CardHeader>
- <CardBody>
+
+ <CardContent>
<Stack direction={["column", "column", "row"]} spacing={8}>
<Stack
direction={["row", "row", "column"]}
alignItems="start"
justifyContent="space-between"
>
- <span className="text-muted-foreground">Total</span>
+ <span className="text-sm text-muted-foreground">Total</span>
<span className="font-bold">
{formatter.format(purchaseInvoiceTotals?.total ?? 0)}
</span>
@@ -113,7 +107,9 @@ const PurchaseInvoiceHeader = () => {
alignItems="start"
justifyContent="space-between"
>
- <span className="text-muted-foreground">Date Issued</span>
+ <span className="text-sm text-muted-foreground">
+ Date Issued
+ </span>
<span className="font-bold">{purchaseInvoice.dateIssued}</span>
</Stack>
@@ -122,11 +118,11 @@ const PurchaseInvoiceHeader = () => {
alignItems="start"
justifyContent="space-between"
>
- <span className="text-muted-foreground">Status</span>
+ <span className="text-sm text-muted-foreground">Status</span>
<PurchaseInvoicingStatus status={purchaseInvoice.status} />
</Stack>
</Stack>
- </CardBody>
+ </CardContent>
</Card>
</VStack>
<PurchaseInvoicePostModal
diff --git a/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceLines/PurchaseInvoiceLines.tsx b/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceLines/PurchaseInvoiceLines.tsx
index af7906a6e3..0130bcd62c 100644
--- a/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceLines/PurchaseInvoiceLines.tsx
+++ b/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceLines/PurchaseInvoiceLines.tsx
@@ -1,10 +1,13 @@
-import { Heading, HStack } from "@carbon/react";
import {
- Box,
- Button,
Card,
- CardBody,
+ CardAction,
+ CardContent,
CardHeader,
+ CardTitle,
+ HStack,
+} from "@carbon/react";
+import {
+ Button,
IconButton,
Menu,
MenuButton,
@@ -67,7 +70,7 @@ const PurchaseInvoiceLines = () => {
cell: ({ row }) => (
<HStack className="justify-between min-w-[100px]">
<span>{row.original.invoiceLineType}</span>
- <Box position="relative" w={6} h={5}>
+ <div className="relative w-6 h-5">
<Menu>
<MenuButton
as={IconButton}
@@ -97,7 +100,7 @@ const PurchaseInvoiceLines = () => {
</MenuItem>
</MenuList>
</Menu>
- </Box>
+ </div>
</HStack>
),
},
@@ -192,18 +195,20 @@ const PurchaseInvoiceLines = () => {
return (
<>
- <Card w="full" h="full">
- <CardHeader display="flex" justifyContent="space-between">
- <Heading size="h3" className="inline-flex">
- Purchase Invoice Lines
- </Heading>
- {canEdit && isEditable && (
- <Button colorScheme="brand" as={Link} to="new">
- New
- </Button>
- )}
- </CardHeader>
- <CardBody>
+ <Card className="w-full h-full">
+ <HStack className="justify-between items-start">
+ <CardHeader>
+ <CardTitle>Purchase Invoice Lines</CardTitle>
+ </CardHeader>
+ <CardAction>
+ {canEdit && isEditable && (
+ <Button colorScheme="brand" as={Link} to="new">
+ New
+ </Button>
+ )}
+ </CardAction>
+ </HStack>
+ <CardContent>
<Grid<PurchaseInvoiceLine>
data={routeData?.purchaseInvoiceLines ?? []}
columns={columns}
@@ -222,7 +227,7 @@ const PurchaseInvoiceLines = () => {
}}
onNewRow={canEdit && isEditable ? () => navigate("new") : undefined}
/>
- </CardBody>
+ </CardContent>
</Card>
<Outlet />
</>
diff --git a/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceSidebar/PurchaseInvoiceSidebar.tsx b/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceSidebar/PurchaseInvoiceSidebar.tsx
index 88263b36be..3c6135decb 100644
--- a/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceSidebar/PurchaseInvoiceSidebar.tsx
+++ b/apps/carbon/app/modules/invoicing/ui/PurchaseInvoice/PurchaseInvoiceSidebar/PurchaseInvoiceSidebar.tsx
@@ -1,6 +1,5 @@
-import { Count, VStack, useColor } from "@carbon/react";
-import { Button } from "@chakra-ui/react";
-import { Link, useMatches, useParams } from "@remix-run/react";
+import { useParams } from "@remix-run/react";
+import { DetailSidebar } from "~/components/Layout";
import { useRouteData } from "~/hooks";
import type { PurchaseInvoiceLine } from "~/modules/invoicing";
import { path } from "~/utils/path";
@@ -8,7 +7,7 @@ import { usePurchaseInvoiceSidebar } from "./usePurchaseInvoiceSidebar";
const PurchaseInvoiceSidebar = () => {
const { invoiceId } = useParams();
- const borderColor = useColor("gray.200");
+
if (!invoiceId)
throw new Error(
"PurchaseInvoiceSidebar requires an invoiceId and could not find invoiceId in params"
@@ -21,45 +20,8 @@ const PurchaseInvoiceSidebar = () => {
const links = usePurchaseInvoiceSidebar({
lines: routeData?.purchaseInvoiceLines.length ?? 0,
});
- const matches = useMatches();
-
- return (
- <VStack className="h-full">
- <div className="overflow-y-auto h-full w-full">
- <VStack>
- <VStack spacing={1}>
- {links.map((route) => {
- const isActive = matches.some(
- (match) =>
- (match.pathname.includes(route.to) && route.to !== "") ||
- (match.id.includes(".index") && route.to === "")
- );
- return (
- <Button
- key={route.name}
- as={Link}
- to={route.to}
- variant={isActive ? "solid" : "ghost"}
- border={isActive ? "1px solid" : "none"}
- borderColor={borderColor}
- fontWeight={isActive ? "bold" : "normal"}
- justifyContent={
- route.count === undefined ? "start" : "space-between"
- }
- size="md"
- w="full"
- >
- <span>{route.name}</span>
- {route.count !== undefined && <Count count={route.count} />}
- </Button>
- );
- })}
- </VStack>
- </VStack>
- </div>
- </VStack>
- );
+ return <DetailSidebar links={links} />;
};
export default PurchaseInvoiceSidebar;
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartCostingForm/PartCostingForm.tsx b/apps/carbon/app/modules/parts/ui/Part/PartCostingForm/PartCostingForm.tsx
index ca4bdf76f8..95ccb3c4b1 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartCostingForm/PartCostingForm.tsx
+++ b/apps/carbon/app/modules/parts/ui/Part/PartCostingForm/PartCostingForm.tsx
@@ -1,5 +1,12 @@
-import { Heading, VStack } from "@carbon/react";
-import { Card, CardBody, CardFooter, CardHeader, Grid } from "@chakra-ui/react";
+import {
+ Card,
+ CardContent,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ VStack,
+} from "@carbon/react";
+import { Grid } from "@chakra-ui/react";
import { ValidatedForm } from "remix-validated-form";
import { Boolean, Hidden, Number, Select, Submit } from "~/components/Form";
import { usePermissions } from "~/hooks";
@@ -26,11 +33,11 @@ const PartCostingForm = ({ initialValues }: PartCostingFormProps) => {
validator={partCostValidator}
defaultValues={initialValues}
>
- <Card w="full">
+ <Card className="w-full">
<CardHeader>
- <Heading size="h3">Costing & Posting</Heading>
+ <CardTitle>Costing & Posting</CardTitle>
</CardHeader>
- <CardBody>
+ <CardContent>
<Hidden name="partId" />
<Grid
gridTemplateColumns={["1fr", "1fr", "1fr 1fr 1fr"]}
@@ -63,7 +70,7 @@ const PartCostingForm = ({ initialValues }: PartCostingFormProps) => {
<Boolean name="costIsAdjusted" label="Cost Is Adjusted" />
</VStack>
</Grid>
- </CardBody>
+ </CardContent>
<CardFooter>
<Submit isDisabled={!permissions.can("update", "parts")}>Save</Submit>
</CardFooter>
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartForm/PartForm.tsx b/apps/carbon/app/modules/parts/ui/Part/PartForm/PartForm.tsx
index 9959a4b2e6..87dac6ff3f 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartForm/PartForm.tsx
+++ b/apps/carbon/app/modules/parts/ui/Part/PartForm/PartForm.tsx
@@ -1,5 +1,13 @@
-import { Heading, VStack } from "@carbon/react";
-import { Card, CardBody, CardFooter, CardHeader, Grid } from "@chakra-ui/react";
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ VStack,
+} from "@carbon/react";
+import { Grid } from "@chakra-ui/react";
import { useState } from "react";
import { ValidatedForm } from "remix-validated-form";
import {
@@ -78,7 +86,7 @@ const PartForm = ({ initialValues }: PartFormProps) => {
const { partId, onPartIdChange, loading } = useNextPartIdShortcut();
const permissions = usePermissions();
- const isEditing = initialValues.id !== undefined;
+ const isEditing = !!initialValues.id;
const partGroupOptions =
sharedPartsData?.partGroups.map((partGroup) => ({
@@ -110,17 +118,17 @@ const PartForm = ({ initialValues }: PartFormProps) => {
validator={partValidator}
defaultValues={initialValues}
>
- <Card w="full">
+ <Card className="w-full">
<CardHeader>
- <Heading size="h3">{isEditing ? "Part Details" : "New Part"}</Heading>
+ <CardTitle>{isEditing ? "Part Details" : "New Part"}</CardTitle>
{!isEditing && (
- <p className="text-muted-foreground font-normal">
+ <CardDescription>
A part contains the information about a specific item that can be
purchased or manufactured.
- </p>
+ </CardDescription>
)}
</CardHeader>
- <CardBody>
+ <CardContent>
<Grid
gridTemplateColumns={
isEditing ? ["1fr", "1fr", "1fr 1fr 1fr"] : "1fr"
@@ -173,7 +181,7 @@ const PartForm = ({ initialValues }: PartFormProps) => {
{isEditing && <Boolean name="active" label="Active" />}
</VStack>
</Grid>
- </CardBody>
+ </CardContent>
<CardFooter>
<Submit
isDisabled={
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartInventoryForm/PartInventoryForm.tsx b/apps/carbon/app/modules/parts/ui/Part/PartInventoryForm/PartInventoryForm.tsx
index a8607096a0..4a750df37f 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartInventoryForm/PartInventoryForm.tsx
+++ b/apps/carbon/app/modules/parts/ui/Part/PartInventoryForm/PartInventoryForm.tsx
@@ -1,5 +1,15 @@
-import { HStack, Heading, Select, VStack } from "@carbon/react";
-import { Card, CardBody, CardFooter, CardHeader, Grid } from "@chakra-ui/react";
+import {
+ Card,
+ CardAction,
+ CardContent,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ HStack,
+ Select,
+ VStack,
+} from "@carbon/react";
+import { Grid } from "@chakra-ui/react";
import { useState } from "react";
import { ValidatedForm } from "remix-validated-form";
import { CreatableSelect, Hidden, Number, Submit } from "~/components/Form";
@@ -40,29 +50,31 @@ const PartInventoryForm = ({
validator={partInventoryValidator}
defaultValues={{ ...quantities, ...initialValues }}
>
- <Card w="full">
- <CardHeader>
- <HStack className="w-full justify-between">
- <Heading size="h3">Inventory</Heading>
- <div className="w-[180px]">
- <Select
- // @ts-ignore
- size="sm"
- value={locationOptions.find(
- (location) => location.value === initialValues.locationId
- )}
- options={locationOptions}
- onChange={(selected) => {
- // hard refresh because initialValues update has no effect otherwise
- window.location.href = `${path.to.partInventory(
- initialValues.partId
- )}?location=${selected?.value}`;
- }}
- />
- </div>
- </HStack>
- </CardHeader>
- <CardBody>
+ <Card className="w-full">
+ <HStack className="w-full justify-between items-start">
+ <CardHeader>
+ <CardTitle>Inventory</CardTitle>
+ </CardHeader>
+
+ <CardAction>
+ <Select
+ // @ts-ignore
+ size="sm"
+ value={locationOptions.find(
+ (location) => location.value === initialValues.locationId
+ )}
+ options={locationOptions}
+ onChange={(selected) => {
+ // hard refresh because initialValues update has no effect otherwise
+ window.location.href = `${path.to.partInventory(
+ initialValues.partId
+ )}?location=${selected?.value}`;
+ }}
+ />
+ </CardAction>
+ </HStack>
+
+ <CardContent>
<Hidden name="partId" />
<Hidden name="locationId" />
<Hidden name="hasNewShelf" value={hasNewShelf.toString()} />
@@ -112,7 +124,7 @@ const PartInventoryForm = ({
/>
</VStack>
</Grid>
- </CardBody>
+ </CardContent>
<CardFooter>
<Submit isDisabled={!permissions.can("update", "parts")}>Save</Submit>
</CardFooter>
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartManufacturingForm/PartManufacturingForm.tsx b/apps/carbon/app/modules/parts/ui/Part/PartManufacturingForm/PartManufacturingForm.tsx
index b6070e4621..c406368216 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartManufacturingForm/PartManufacturingForm.tsx
+++ b/apps/carbon/app/modules/parts/ui/Part/PartManufacturingForm/PartManufacturingForm.tsx
@@ -1,5 +1,12 @@
-import { Heading, VStack } from "@carbon/react";
-import { Card, CardBody, CardFooter, CardHeader, Grid } from "@chakra-ui/react";
+import {
+ Card,
+ CardContent,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ VStack,
+} from "@carbon/react";
+import { Grid } from "@chakra-ui/react";
import { ValidatedForm } from "remix-validated-form";
import { Boolean, Hidden, Number, Select, Submit } from "~/components/Form";
import { usePermissions } from "~/hooks";
@@ -30,11 +37,11 @@ const PartManufacturingForm = ({
validator={partManufacturingValidator}
defaultValues={initialValues}
>
- <Card w="full">
+ <Card className="w-full">
<CardHeader>
- <Heading size="h3">Manufacturing</Heading>
+ <CardTitle>Manufacturing</CardTitle>
</CardHeader>
- <CardBody>
+ <CardContent>
<Hidden name="partId" />
<Grid
gridTemplateColumns={["1fr", "1fr", "1fr 1fr 1fr"]}
@@ -70,7 +77,7 @@ const PartManufacturingForm = ({
/>
</VStack>
</Grid>
- </CardBody>
+ </CardContent>
<CardFooter>
<Submit isDisabled={!permissions.can("update", "parts")}>Save</Submit>
</CardFooter>
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartPlanningForm/PartPlanningForm.tsx b/apps/carbon/app/modules/parts/ui/Part/PartPlanningForm/PartPlanningForm.tsx
index af2458f87e..c2db68831a 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartPlanningForm/PartPlanningForm.tsx
+++ b/apps/carbon/app/modules/parts/ui/Part/PartPlanningForm/PartPlanningForm.tsx
@@ -1,5 +1,15 @@
-import { HStack, Heading, Select, VStack } from "@carbon/react";
-import { Card, CardBody, CardFooter, CardHeader, Grid } from "@chakra-ui/react";
+import {
+ Card,
+ CardAction,
+ CardContent,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ HStack,
+ Select,
+ VStack,
+} from "@carbon/react";
+import { Grid } from "@chakra-ui/react";
import { ValidatedForm } from "remix-validated-form";
import {
Boolean,
@@ -36,29 +46,29 @@ const PartPlanningForm = ({
validator={partPlanningValidator}
defaultValues={initialValues}
>
- <Card w="full">
- <CardHeader>
- <HStack className="w-full justify-between">
- <Heading size="h3">Planning</Heading>
- <div className="w-[180px]">
- <Select
- // @ts-ignore
- size="sm"
- value={locationOptions.find(
- (location) => location.value === initialValues.locationId
- )}
- options={locationOptions}
- onChange={(selected) => {
- // hard refresh because initialValues update has no effect otherwise
- window.location.href = `${path.to.partPlanning(
- initialValues.partId
- )}?location=${selected?.value}`;
- }}
- />
- </div>
- </HStack>
- </CardHeader>
- <CardBody>
+ <Card className="w-full">
+ <HStack className="w-full justify-between items-start">
+ <CardHeader>
+ <CardTitle>Planning</CardTitle>
+ </CardHeader>
+ <CardAction>
+ <Select
+ // @ts-ignore
+ size="sm"
+ value={locationOptions.find(
+ (location) => location.value === initialValues.locationId
+ )}
+ options={locationOptions}
+ onChange={(selected) => {
+ // hard refresh because initialValues update has no effect otherwise
+ window.location.href = `${path.to.partPlanning(
+ initialValues.partId
+ )}?location=${selected?.value}`;
+ }}
+ />
+ </CardAction>
+ </HStack>
+ <CardContent>
<Hidden name="partId" />
<Hidden name="locationId" />
<Grid
@@ -118,7 +128,7 @@ const PartPlanningForm = ({
/>
</VStack>
</Grid>
- </CardBody>
+ </CardContent>
<CardFooter>
<Submit isDisabled={!permissions.can("update", "parts")}>Save</Submit>
</CardFooter>
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartPreview/PartPreview.tsx b/apps/carbon/app/modules/parts/ui/Part/PartPreview/PartPreview.tsx
index 7935bf584a..d2b1ed1a61 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartPreview/PartPreview.tsx
+++ b/apps/carbon/app/modules/parts/ui/Part/PartPreview/PartPreview.tsx
@@ -1,5 +1,13 @@
-import { HStack, Heading, VStack } from "@carbon/react";
-import { Button, Card, CardBody, CardHeader, Stack } from "@chakra-ui/react";
+import {
+ Card,
+ CardAction,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+ HStack,
+} from "@carbon/react";
+import { Button, Stack } from "@chakra-ui/react";
import { useParams } from "@remix-run/react";
import { FaHistory } from "react-icons/fa";
import { useRouteData } from "~/hooks";
@@ -15,28 +23,28 @@ const PartPreview = () => {
);
return (
- <Card w="full">
- <CardHeader>
- <HStack className="justify-between align-start">
- <VStack spacing={0}>
- <Heading size="h3">{routeData?.partSummary?.id}</Heading>
- <span className="text-muted-foreground">
- {routeData?.partSummary?.name}
- </span>
- </VStack>
+ <Card className="w-full">
+ <HStack className="justify-between items-start">
+ <CardHeader>
+ <CardTitle>{routeData?.partSummary?.id}</CardTitle>
+ <CardDescription>{routeData?.partSummary?.name}</CardDescription>
+ </CardHeader>
+ <CardAction>
<Button onClick={() => alert("TODO")} leftIcon={<FaHistory />}>
View History
</Button>
- </HStack>
- </CardHeader>
- <CardBody>
+ </CardAction>
+ </HStack>
+ <CardContent>
<Stack direction={["column", "column", "row"]} spacing={8}>
<Stack
direction={["row", "row", "column"]}
alignItems="start"
justifyContent="space-between"
>
- <span className="text-muted-foreground">Replenishment System</span>
+ <span className="text-sm text-muted-foreground">
+ Replenishment System
+ </span>
<span className="font-bold">
{routeData?.partSummary?.replenishmentSystem}
</span>
@@ -46,7 +54,7 @@ const PartPreview = () => {
alignItems="start"
justifyContent="space-between"
>
- <span className="text-muted-foreground">Part Type</span>
+ <span className="text-sm text-muted-foreground">Part Type</span>
<span className="font-bold">
{routeData?.partSummary?.partType}
</span>
@@ -56,13 +64,15 @@ const PartPreview = () => {
alignItems="start"
justifyContent="space-between"
>
- <span className="text-muted-foreground">Unit of Measure</span>
+ <span className="text-sm text-muted-foreground">
+ Unit of Measure
+ </span>
<span className="font-bold">
{routeData?.partSummary?.unitOfMeasureCode}
</span>
</Stack>
</Stack>
- </CardBody>
+ </CardContent>
</Card>
);
};
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartPurchasingForm/PartPurchasingForm.tsx b/apps/carbon/app/modules/parts/ui/Part/PartPurchasingForm/PartPurchasingForm.tsx
index d60d8b103c..388ca4d0cc 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartPurchasingForm/PartPurchasingForm.tsx
+++ b/apps/carbon/app/modules/parts/ui/Part/PartPurchasingForm/PartPurchasingForm.tsx
@@ -1,5 +1,12 @@
-import { Heading, VStack } from "@carbon/react";
-import { Card, CardBody, CardFooter, CardHeader, Grid } from "@chakra-ui/react";
+import {
+ Card,
+ CardContent,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ VStack,
+} from "@carbon/react";
+import { Grid } from "@chakra-ui/react";
import { ValidatedForm } from "remix-validated-form";
import {
Boolean,
@@ -36,11 +43,11 @@ const PartPurchasingForm = ({
validator={partPurchasingValidator}
defaultValues={initialValues}
>
- <Card w="full">
+ <Card className="w-full">
<CardHeader>
- <Heading size="h3">Purchasing</Heading>
+ <CardTitle>Purchasing</CardTitle>
</CardHeader>
- <CardBody>
+ <CardContent>
<Hidden name="partId" />
<Grid
gridTemplateColumns={["1fr", "1fr", "1fr 1fr 1fr"]}
@@ -68,7 +75,7 @@ const PartPurchasingForm = ({
<Boolean name="purchasingBlocked" label="Purchasing Blocked" />
</VStack>
</Grid>
- </CardBody>
+ </CardContent>
<CardFooter>
<Submit isDisabled={!permissions.can("update", "parts")}>Save</Submit>
</CardFooter>
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartSalePriceForm/PartSalePriceForm.tsx b/apps/carbon/app/modules/parts/ui/Part/PartSalePriceForm/PartSalePriceForm.tsx
index b94e831d5e..5145b1f614 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartSalePriceForm/PartSalePriceForm.tsx
+++ b/apps/carbon/app/modules/parts/ui/Part/PartSalePriceForm/PartSalePriceForm.tsx
@@ -1,5 +1,12 @@
-import { Heading, VStack } from "@carbon/react";
-import { Card, CardBody, CardFooter, CardHeader, Grid } from "@chakra-ui/react";
+import {
+ Card,
+ CardContent,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ VStack,
+} from "@carbon/react";
+import { Grid } from "@chakra-ui/react";
import { ValidatedForm } from "remix-validated-form";
import {
Boolean,
@@ -36,11 +43,11 @@ const PartSalePriceForm = ({
validator={partUnitSalePriceValidator}
defaultValues={initialValues}
>
- <Card w="full">
+ <Card className="w-full">
<CardHeader>
- <Heading size="h3">Sale Price</Heading>
+ <CardTitle>Sale Price</CardTitle>
</CardHeader>
- <CardBody>
+ <CardContent>
<Hidden name="partId" />
<Grid
gridTemplateColumns={["1fr", "1fr", "1fr 1fr 1fr"]}
@@ -68,7 +75,7 @@ const PartSalePriceForm = ({
/>
</VStack>
</Grid>
- </CardBody>
+ </CardContent>
<CardFooter>
<Submit isDisabled={!permissions.can("update", "parts")}>Save</Submit>
</CardFooter>
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartSidebar/PartSidebar.tsx b/apps/carbon/app/modules/parts/ui/Part/PartSidebar/PartSidebar.tsx
index 6a167838b8..62909322ea 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartSidebar/PartSidebar.tsx
+++ b/apps/carbon/app/modules/parts/ui/Part/PartSidebar/PartSidebar.tsx
@@ -1,6 +1,5 @@
-import { VStack, useColor } from "@carbon/react";
-import { Button } from "@chakra-ui/react";
-import { Link, useMatches, useParams } from "@remix-run/react";
+import { useParams } from "@remix-run/react";
+import { DetailSidebar } from "~/components/Layout";
import { useRouteData } from "~/hooks";
import type { PartSummary } from "~/modules/parts/types";
import { path } from "~/utils/path";
@@ -8,7 +7,6 @@ import { usePartSidebar } from "./usePartSidebar";
const PartSidebar = () => {
const { partId } = useParams();
- const borderColor = useColor("gray.200");
if (!partId) throw new Error("partId not found");
const routeData = useRouteData<{ partSummary: PartSummary }>(
@@ -18,42 +16,8 @@ const PartSidebar = () => {
throw new Error("Could not find replenishmentSystem in routeData");
const links = usePartSidebar(routeData.partSummary.replenishmentSystem);
- const matches = useMatches();
- return (
- <VStack className="h-full">
- <div className="overflow-y-auto h-full w-full">
- <VStack>
- <VStack spacing={1}>
- {links.map((route) => {
- const isActive = matches.some(
- (match) =>
- (match.pathname.includes(route.to) && route.to !== "") ||
- (match.id.includes(".index") && route.to === "")
- );
-
- return (
- <Button
- key={route.name}
- as={Link}
- to={route.to}
- variant={isActive ? "solid" : "ghost"}
- border={isActive ? "1px solid" : "none"}
- borderColor={borderColor}
- fontWeight={isActive ? "bold" : "normal"}
- justifyContent="start"
- size="md"
- w="full"
- >
- {route.name}
- </Button>
- );
- })}
- </VStack>
- </VStack>
- </div>
- </VStack>
- );
+ return <DetailSidebar links={links} />;
};
export default PartSidebar;
diff --git a/apps/carbon/app/modules/parts/ui/Part/PartSuppliers/PartSuppliers.tsx b/apps/carbon/app/modules/parts/ui/Part/PartSuppliers/PartSuppliers.tsx
index ceafc1c8f4..3d1ff345a4 100644
--- a/apps/carbon/app/modules/parts/ui/Part/PartSuppliers/PartSuppliers.tsx
+++ b/apps/carbon/app/modules/parts/ui/Part/PartSuppliers/PartSuppliers.tsx
@@ -1,11 +1,12 @@
-import { Heading, HStack } from "@carbon/react";
import {
- Button,
Card,
- CardBody,
+ CardAction,
+ CardContent,
CardHeader,
- IconButton,
-} from "@chakra-ui/react";
+ CardTitle,
+ HStack,
+} from "@carbon/react";
+import { Button, IconButton } from "@chakra-ui/react";
import { Link, Outlet, useNavigate } from "@remix-run/react";
import type { ColumnDef } from "@tanstack/react-table";
import { useMemo } from "react";
@@ -104,18 +105,20 @@ const PartSuppliers = ({ partSuppliers }: PartSuppliersProps) => {
return (
<>
- <Card w="full">
- <CardHeader display="flex" justifyContent="space-between">
- <Heading size="h3" className="inline-flex">
- Suppliers
- </Heading>
- {canEdit && (
- <Button colorScheme="brand" as={Link} to="new">
- New
- </Button>
- )}
- </CardHeader>
- <CardBody>
+ <Card className="w-full">
+ <HStack className="justify-between items-start">
+ <CardHeader>
+ <CardTitle>Suppliers</CardTitle>
+ </CardHeader>
+ <CardAction>
+ {canEdit && (
+ <Button colorScheme="brand" as={Link} to="new">
+ New
+ </Button>
+ )}
+ </CardAction>
+ </HStack>
+ <CardContent>
<Grid<PartSupplier>
data={partSuppliers}
columns={columns}
@@ -123,7 +126,7 @@ const PartSuppliers = ({ partSuppliers }: PartSuppliersProps) => {
editableComponents={editableComponents}
onNewRow={canEdit ? () => navigate("new") : undefined}
/>
- </CardBody>
+ </CardContent>
</Card>
<Outlet />
</>
diff --git a/apps/carbon/app/modules/parts/ui/Service/ServiceForm/ServiceForm.tsx b/apps/carbon/app/modules/parts/ui/Service/ServiceForm/ServiceForm.tsx
index 258e22423a..b79f373066 100644
--- a/apps/carbon/app/modules/parts/ui/Service/ServiceForm/ServiceForm.tsx
+++ b/apps/carbon/app/modules/parts/ui/Service/ServiceForm/ServiceForm.tsx
@@ -1,5 +1,13 @@
-import { Heading, VStack } from "@carbon/react";
-import { Card, CardBody, CardFooter, CardHeader, Grid } from "@chakra-ui/react";
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ VStack,
+} from "@carbon/react";
+import { Grid } from "@chakra-ui/react";
import { useState } from "react";
import { ValidatedForm } from "remix-validated-form";
import {
@@ -93,19 +101,17 @@ const ServiceForm = ({ initialValues }: ServiceFormProps) => {
validator={serviceValidator}
defaultValues={initialValues}
>
- <Card w="full">
+ <Card className="w-full">
<CardHeader>
- <Heading size="h3">
- {isEditing ? "Service Details" : "New Service"}
- </Heading>
+ <CardTitle>{isEditing ? "Service Details" : "New Service"}</CardTitle>
{!isEditing && (
- <p className="text-muted-foreground font-normal">
+ <CardDescription>
A service is an intangible activity that can be purchased or sold.
When a service is purchased, it is accounted for as overhead.
- </p>
+ </CardDescription>
)}
</CardHeader>
- <CardBody>
+ <CardContent>
<Grid
gridTemplateColumns={
isEditing ? ["1fr", "1fr", "1fr 1fr 1fr"] : "1fr"
@@ -147,7 +153,7 @@ const ServiceForm = ({ initialValues }: ServiceFormProps) => {
{isEditing && <Boolean name="active" label="Active" />}
</VStack>
</Grid>
- </CardBody>
+ </CardContent>
<CardFooter>
<Submit
isDisabled={
diff --git a/apps/carbon/app/modules/parts/ui/Service/ServicePreview/ServicePreview.tsx b/apps/carbon/app/modules/parts/ui/Service/ServicePreview/ServicePreview.tsx
index 9b9016ac64..8928e029eb 100644
--- a/apps/carbon/app/modules/parts/ui/Service/ServicePreview/ServicePreview.tsx
+++ b/apps/carbon/app/modules/parts/ui/Service/ServicePreview/ServicePreview.tsx
@@ -1,5 +1,13 @@
-import { HStack, Heading } from "@carbon/react";
-import { Button, Card, CardBody, CardHeader, Stack } from "@chakra-ui/react";
+import {
+ Card,
+ CardAction,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+ HStack,
+} from "@carbon/react";
+import { Button, Stack } from "@chakra-ui/react";
import { useParams } from "@remix-run/react";
import { FaHistory } from "react-icons/fa";
import { useRouteData } from "~/hooks";
@@ -15,28 +23,26 @@ const ServicePreview = () => {
);
return (
- <Card w="full">
- <CardHeader>
- <HStack className="justify-between items-start">
- <Stack direction="column" spacing={2}>
- <Heading size="h3">{routeData?.service?.name}</Heading>
- <p className="text-muted-foreground line-clamp-1">
- {routeData?.service?.description}
- </p>
- </Stack>
+ <Card className="w-full">
+ <HStack className="justify-between items-start">
+ <CardHeader>
+ <CardTitle>{routeData?.service?.name}</CardTitle>
+ <CardDescription>{routeData?.service?.description}</CardDescription>
+ </CardHeader>
+ <CardAction>
<Button onClick={() => alert("TODO")} leftIcon={<FaHistory />}>
View History
</Button>
- </HStack>
- </CardHeader>
- <CardBody>
+ </CardAction>
+ </HStack>
+ <CardContent>
<Stack direction={["column", "column", "row"]} spacing={8}>
<Stack
direction={["row", "row", "column"]}
alignItems="start"
justifyContent="space-between"
>
- <span className="text-muted-foreground">Type</span>
+ <span className="text-sm text-muted-foreground">Type</span>
<span className="font-bold">{routeData?.service?.serviceType}</span>
</Stack>
<Stack
@@ -44,11 +50,11 @@ const ServicePreview = () => {
alignItems="start"
justifyContent="space-between"
>
- <span className="text-muted-foreground">Part Group</span>
+ <span className="text-sm text-muted-foreground">Part Group</span>
<span className="font-bold">{routeData?.service?.partGroup}</span>
</Stack>
</Stack>
- </CardBody>
+ </CardContent>
</Card>
);
};
diff --git a/apps/carbon/app/modules/parts/ui/Service/ServiceSidebar/ServiceSidebar.tsx b/apps/carbon/app/modules/parts/ui/Service/ServiceSidebar/ServiceSidebar.tsx
index e4d4557388..bdac8ef253 100644
--- a/apps/carbon/app/modules/parts/ui/Service/ServiceSidebar/ServiceSidebar.tsx
+++ b/apps/carbon/app/modules/parts/ui/Service/ServiceSidebar/ServiceSidebar.tsx
@@ -1,6 +1,5 @@
-import { useColor, VStack } from "@carbon/react";
-import { Button } from "@chakra-ui/react";
-import { Link, useMatches, useParams } from "@remix-run/react";
+import { useParams } from "@remix-run/react";
+import { DetailSidebar } from "~/components/Layout";
import { useRouteData } from "~/hooks";
import type { Service } from "~/modules/parts/types";
import { path } from "~/utils/path";
@@ -8,7 +7,7 @@ import { useServiceSidebar } from "./useServiceSidebar";
const ServiceSidebar = () => {
const { serviceId } = useParams();
- const borderColor = useColor("gray.200");
+
if (!serviceId) throw new Error("serviceId not found");
const routeData = useRouteData<{ service: Service }>(
@@ -18,42 +17,8 @@ const ServiceSidebar = () => {
throw new Error("Could not find service type in routeData");
const links = useServiceSidebar(routeData.service.serviceType);
- const matches = useMatches();
-
- return (
- <VStack className="h-full">
- <div className="overflow-y-auto h-full w-full">
- <VStack>
- <VStack spacing={1}>
- {links.map((route) => {
- const isActive = matches.some(
- (match) =>
- (match.pathname.includes(route.to) && route.to !== "") ||
- (match.id.includes(".index") && route.to === "")
- );
- return (
- <Button
- key={route.name}
- as={Link}
- to={route.to}
- variant={isActive ? "solid" : "ghost"}
- border={isActive ? "1px solid" : "none"}
- borderColor={borderColor}
- fontWeight={isActive ? "bold" : "normal"}
- justifyContent="start"
- size="md"
- w="full"
- >
- {route.name}
- </Button>
- );
- })}
- </VStack>
- </VStack>
- </div>
- </VStack>
- );
+ return <DetailSidebar links={links} />;
};
export default ServiceSidebar;
diff --git a/apps/carbon/app/modules/parts/ui/Service/ServiceSuppliers/ServiceSuppliers.tsx b/apps/carbon/app/modules/parts/ui/Service/ServiceSuppliers/ServiceSuppliers.tsx
index 20958ae1e8..6ef4a20c1f 100644
--- a/apps/carbon/app/modules/parts/ui/Service/ServiceSuppliers/ServiceSuppliers.tsx
+++ b/apps/carbon/app/modules/parts/ui/Service/ServiceSuppliers/ServiceSuppliers.tsx
@@ -1,11 +1,12 @@
-import { HStack, Heading } from "@carbon/react";
import {
- Button,
Card,
- CardBody,
+ CardAction,
+ CardContent,
CardHeader,
- IconButton,
-} from "@chakra-ui/react";
+ CardTitle,
+ HStack,
+} from "@carbon/react";
+import { Button, IconButton } from "@chakra-ui/react";
import { Link, Outlet, useNavigate } from "@remix-run/react";
import type { ColumnDef } from "@tanstack/react-table";
import { useMemo } from "react";
@@ -68,18 +69,20 @@ const ServiceSuppliers = ({ serviceSuppliers }: ServiceSuppliersProps) => {
return (
<>
- <Card w="full">
- <CardHeader display="flex" justifyContent="space-between">
- <Heading size="h3" className="inline-flex">
- Suppliers
- </Heading>
- {canEdit && (
- <Button colorScheme="brand" as={Link} to="new">
- New
- </Button>
- )}
- </CardHeader>
- <CardBody>
+ <Card className="w-full">
+ <HStack className="justify-between items-start">
+ <CardHeader>
+ <CardTitle>Suppliers</CardTitle>
+ </CardHeader>
+ <CardAction>
+ {canEdit && (
+ <Button colorScheme="brand" as={Link} to="new">
+ New
+ </Button>
+ )}
+ </CardAction>
+ </HStack>
+ <CardContent>
<Grid<ServiceSupplier>
data={serviceSuppliers}
columns={columns}
@@ -87,7 +90,7 @@ const ServiceSuppliers = ({ serviceSuppliers }: ServiceSuppliersProps) => {
editableComponents={editableComponents}
onNewRow={canEdit ? () => navigate("new") : undefined}
/>
- </CardBody>
+ </CardContent>
</Card>
<Outlet />
</>
diff --git a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderDeliveryForm/PurchaseOrderDeliveryForm.tsx b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderDeliveryForm/PurchaseOrderDeliveryForm.tsx
index defeb661e9..33c97c9e0a 100644
--- a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderDeliveryForm/PurchaseOrderDeliveryForm.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderDeliveryForm/PurchaseOrderDeliveryForm.tsx
@@ -1,5 +1,12 @@
-import { Heading, VStack } from "@carbon/react";
-import { Card, CardBody, CardFooter, CardHeader, Grid } from "@chakra-ui/react";
+import {
+ Card,
+ CardContent,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ VStack,
+} from "@carbon/react";
+import { Grid } from "@chakra-ui/react";
import { useState } from "react";
import { ValidatedForm } from "remix-validated-form";
import {
@@ -55,11 +62,11 @@ const PurchaseOrderDeliveryForm = ({
validator={purchaseOrderDeliveryValidator}
defaultValues={initialValues}
>
- <Card w="full">
+ <Card className="w-full">
<CardHeader>
- <Heading size="h3">Delivery</Heading>
+ <CardTitle>Delivery</CardTitle>
</CardHeader>
- <CardBody>
+ <CardContent>
<Hidden name="id" />
<Grid
gridTemplateColumns={["1fr", "1fr", "1fr 1fr 1fr"]}
@@ -115,7 +122,7 @@ const PurchaseOrderDeliveryForm = ({
)}
</VStack>
</Grid>
- </CardBody>
+ </CardContent>
<CardFooter>
<Submit isDisabled={!permissions.can("update", "purchasing")}>
Save
diff --git a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderForm/PurchaseOrderForm.tsx b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderForm/PurchaseOrderForm.tsx
index b6cc572489..921824e579 100644
--- a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderForm/PurchaseOrderForm.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderForm/PurchaseOrderForm.tsx
@@ -1,5 +1,13 @@
-import { Heading, VStack } from "@carbon/react";
-import { Card, CardBody, CardFooter, CardHeader, Grid } from "@chakra-ui/react";
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ VStack,
+} from "@carbon/react";
+import { Grid } from "@chakra-ui/react";
import { useState } from "react";
import { ValidatedForm } from "remix-validated-form";
import {
@@ -52,19 +60,19 @@ const PurchaseOrderForm = ({ initialValues }: PurchaseOrderFormProps) => {
validator={purchaseOrderValidator}
defaultValues={initialValues}
>
- <Card w="full">
+ <Card className="w-full">
<CardHeader>
- <Heading size="h3">
+ <CardTitle>
{isEditing ? "Purchase Order" : "New Purchase Order"}
- </Heading>
+ </CardTitle>
{!isEditing && (
- <p className="text-muted-foreground font-normal">
+ <CardDescription>
A purchase order contains information about the agreement between
the company and a specific supplier for parts and services.
- </p>
+ </CardDescription>
)}
</CardHeader>
- <CardBody>
+ <CardContent>
<Hidden name="purchaseOrderId" />
<VStack>
<Grid
@@ -134,7 +142,7 @@ const PurchaseOrderForm = ({ initialValues }: PurchaseOrderFormProps) => {
</VStack>
</Grid>
</VStack>
- </CardBody>
+ </CardContent>
<CardFooter>
<Submit
isDisabled={
diff --git a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderHeader/PurchaseOrderHeader.tsx b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderHeader/PurchaseOrderHeader.tsx
index 02b534b433..1d83c6e7c9 100644
--- a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderHeader/PurchaseOrderHeader.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderHeader/PurchaseOrderHeader.tsx
@@ -1,5 +1,16 @@
-import { Heading, HStack, Menubar, MenubarItem, VStack } from "@carbon/react";
-import { Button, Card, CardBody, CardHeader, Stack } from "@chakra-ui/react";
+import {
+ Card,
+ CardAction,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+ HStack,
+ Menubar,
+ MenubarItem,
+ VStack,
+} from "@carbon/react";
+import { Button, Stack } from "@chakra-ui/react";
import { useParams } from "@remix-run/react";
import { useMemo } from "react";
import { FaHistory } from "react-icons/fa";
@@ -76,30 +87,28 @@ const PurchaseOrderHeader = () => {
</Menubar>
)}
- <Card w="full">
- <CardHeader>
- <HStack className="justify-between items-start">
- <Stack direction="column" spacing={2}>
- <Heading size="h3">
- {routeData?.purchaseOrder?.purchaseOrderId}
- </Heading>
- <span className="text-muted-foreground">
- {routeData?.purchaseOrder?.supplierName}
- </span>
- </Stack>
+ <Card className="w-full">
+ <HStack className="justify-between items-start">
+ <CardHeader>
+ <CardTitle>{routeData?.purchaseOrder?.purchaseOrderId}</CardTitle>
+ <CardDescription>
+ {routeData?.purchaseOrder?.supplierName}
+ </CardDescription>
+ </CardHeader>
+ <CardAction>
<Button onClick={() => alert("TODO")} leftIcon={<FaHistory />}>
Supplier Details
</Button>
- </HStack>
- </CardHeader>
- <CardBody>
+ </CardAction>
+ </HStack>
+ <CardContent>
<Stack direction={["column", "column", "row"]} spacing={8}>
<Stack
direction={["row", "row", "column"]}
alignItems="start"
justifyContent="space-between"
>
- <span className="text-muted-foreground">Total</span>
+ <span className="text-sm text-muted-foreground">Total</span>
<span className="font-bold">
{formatter.format(purchaseOrderTotals?.total ?? 0)}
</span>
@@ -109,7 +118,7 @@ const PurchaseOrderHeader = () => {
alignItems="start"
justifyContent="space-between"
>
- <span className="text-muted-foreground">Order Date</span>
+ <span className="text-sm text-muted-foreground">Order Date</span>
<span className="font-bold">
{routeData?.purchaseOrder?.orderDate}
</span>
@@ -120,7 +129,9 @@ const PurchaseOrderHeader = () => {
alignItems="start"
justifyContent="space-between"
>
- <span className="text-muted-foreground">Promised Date</span>
+ <span className="text-sm text-muted-foreground">
+ Promised Date
+ </span>
<span className="font-bold">
{routeData?.purchaseOrder?.receiptPromisedDate}
</span>
@@ -130,7 +141,7 @@ const PurchaseOrderHeader = () => {
alignItems="start"
justifyContent="space-between"
>
- <span className="text-muted-foreground">Type</span>
+ <span className="text-sm text-muted-foreground">Type</span>
<span className="font-bold">
{routeData?.purchaseOrder?.type}
</span>
@@ -141,7 +152,7 @@ const PurchaseOrderHeader = () => {
alignItems="start"
justifyContent="space-between"
>
- <span className="text-muted-foreground">Subtotal</span>
+ <span className="text-sm text-muted-foreground">Subtotal</span>
<span className="font-bold">
// TODO: this doesn't update when client-side lines are updated
{currencyFormatter.format(
@@ -155,11 +166,11 @@ const PurchaseOrderHeader = () => {
alignItems="start"
justifyContent="space-between"
>
- <span className="text-muted-foreground">Status</span>
+ <span className="text-sm text-muted-foreground">Status</span>
<PurchasingStatus status={routeData?.purchaseOrder?.status} />
</Stack>
</Stack>
- </CardBody>
+ </CardContent>
</Card>
</VStack>
);
diff --git a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderInternalDocuments/PurchaseOrderDocuments.tsx b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderInternalDocuments/PurchaseOrderDocuments.tsx
index 7a8bdbe3bf..7f8519e3bd 100644
--- a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderInternalDocuments/PurchaseOrderDocuments.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderInternalDocuments/PurchaseOrderDocuments.tsx
@@ -1,9 +1,13 @@
-import { HStack, Heading } from "@carbon/react";
-import { convertKbToString } from "@carbon/utils";
import {
Card,
- CardBody,
+ CardAction,
+ CardContent,
CardHeader,
+ CardTitle,
+ HStack,
+} from "@carbon/react";
+import { convertKbToString } from "@carbon/utils";
+import {
IconButton,
Link,
Menu,
@@ -43,17 +47,21 @@ const PurchaseOrderDocuments = ({
return (
<>
- <Card w="full">
- <CardHeader display="flex" justifyContent="space-between">
- <Heading size="h3" className="inline-flex">
- {isExternal ? "External" : "Internal"} Attachments
- </Heading>
- <PurchaseOrderDocumentForm
- isExternal={isExternal}
- orderId={orderId}
- />
- </CardHeader>
- <CardBody>
+ <Card className="w-full">
+ <HStack className="justify-between items-start">
+ <CardHeader>
+ <CardTitle>
+ {isExternal ? "External" : "Internal"} Attachments
+ </CardTitle>
+ </CardHeader>
+ <CardAction>
+ <PurchaseOrderDocumentForm
+ isExternal={isExternal}
+ orderId={orderId}
+ />
+ </CardAction>
+ </HStack>
+ <CardContent>
<Table>
<Thead>
<Tr>
@@ -123,7 +131,7 @@ const PurchaseOrderDocuments = ({
)}
</Tbody>
</Table>
- </CardBody>
+ </CardContent>
</Card>
<Outlet />
</>
diff --git a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderLines/PurchaseOrderLines.tsx b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderLines/PurchaseOrderLines.tsx
index d2b89482d3..ff5ed768ad 100644
--- a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderLines/PurchaseOrderLines.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderLines/PurchaseOrderLines.tsx
@@ -1,9 +1,14 @@
-import { HStack, Heading } from "@carbon/react";
import {
- Button,
Card,
- CardBody,
+ CardAction,
+ CardContent,
+ CardDescription,
CardHeader,
+ CardTitle,
+ HStack,
+} from "@carbon/react";
+import {
+ Button,
Checkbox,
IconButton,
Menu,
@@ -278,18 +283,24 @@ const PurchaseOrderLines = () => {
return (
<>
- <Card w="full" h="full">
- <CardHeader display="flex" justifyContent="space-between">
- <Heading size="h3" className="inline-flex">
- Purchase Order Lines
- </Heading>
- {canEdit && isEditable && (
- <Button colorScheme="brand" as={Link} to="new">
- New
- </Button>
- )}
- </CardHeader>
- <CardBody>
+ <Card className="w-full h-full">
+ <HStack className="justify-between items-start">
+ <CardHeader>
+ <CardTitle>Purchase Order Lines</CardTitle>
+ <CardDescription>
+ {routeData?.purchaseOrder?.purchaseOrderNumber}
+ </CardDescription>
+ </CardHeader>
+ <CardAction>
+ {canEdit && isEditable && (
+ <Button colorScheme="brand" as={Link} to="new">
+ New
+ </Button>
+ )}
+ </CardAction>
+ </HStack>
+
+ <CardContent>
<Grid<PurchaseOrderLine>
data={routeData?.purchaseOrderLines ?? []}
columns={columns}
@@ -309,7 +320,7 @@ const PurchaseOrderLines = () => {
}}
onNewRow={canEdit && isEditable ? () => navigate("new") : undefined}
/>
- </CardBody>
+ </CardContent>
</Card>
<Outlet />
</>
diff --git a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderPaymentForm/PurchaseOrderPaymentForm.tsx b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderPaymentForm/PurchaseOrderPaymentForm.tsx
index 288e0aa986..3108c43ab4 100644
--- a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderPaymentForm/PurchaseOrderPaymentForm.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderPaymentForm/PurchaseOrderPaymentForm.tsx
@@ -1,5 +1,12 @@
-import { Heading, VStack } from "@carbon/react";
-import { Card, CardBody, CardFooter, CardHeader, Grid } from "@chakra-ui/react";
+import {
+ Card,
+ CardContent,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ VStack,
+} from "@carbon/react";
+import { Grid } from "@chakra-ui/react";
import { useState } from "react";
import { ValidatedForm } from "remix-validated-form";
import {
@@ -43,11 +50,11 @@ const PurchaseOrderPaymentForm = ({
validator={purchaseOrderPaymentValidator}
defaultValues={initialValues}
>
- <Card w="full">
+ <Card className="w-full">
<CardHeader>
- <Heading size="h3">Payment</Heading>
+ <CardTitle>Payment</CardTitle>
</CardHeader>
- <CardBody>
+ <CardContent>
<Hidden name="id" />
<Grid
gridTemplateColumns={["1fr", "1fr", "1fr 1fr 1fr"]}
@@ -84,7 +91,7 @@ const PurchaseOrderPaymentForm = ({
<Boolean name="paymentComplete" label="Payment Complete" />
</VStack>
</Grid>
- </CardBody>
+ </CardContent>
<CardFooter>
<Submit isDisabled={!permissions.can("update", "purchasing")}>
Save
diff --git a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderSidebar/PurchaseOrderSidebar.tsx b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderSidebar/PurchaseOrderSidebar.tsx
index 7be112ee6c..162b0afc1c 100644
--- a/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderSidebar/PurchaseOrderSidebar.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/PurchaseOrder/PurchaseOrderSidebar/PurchaseOrderSidebar.tsx
@@ -1,6 +1,5 @@
-import { Count, VStack, useColor } from "@carbon/react";
-import { Button } from "@chakra-ui/react";
-import { Link, useMatches, useParams } from "@remix-run/react";
+import { useParams } from "@remix-run/react";
+import { DetailSidebar } from "~/components/Layout";
import { useRouteData } from "~/hooks";
import type {
PurchaseOrder,
@@ -12,7 +11,7 @@ import { usePurchaseOrderSidebar } from "./usePurchaseOrderSidebar";
const PurchaseOrderSidebar = () => {
const { orderId } = useParams();
- const borderColor = useColor("gray.200");
+
if (!orderId)
throw new Error(
"PurchaseOrderSidebar requires an orderId and could not find orderId in params"
@@ -30,45 +29,8 @@ const PurchaseOrderSidebar = () => {
internalDocuments: routeData?.internalDocuments.length ?? 0,
externalDocuments: routeData?.externalDocuments.length ?? 0,
});
- const matches = useMatches();
-
- return (
- <VStack className="h-full">
- <div className="overflow-y-auto h-full w-full">
- <VStack>
- <VStack spacing={1}>
- {links.map((route) => {
- const isActive = matches.some(
- (match) =>
- (match.pathname.includes(route.to) && route.to !== "") ||
- (match.id.includes(".index") && route.to === "")
- );
- return (
- <Button
- key={route.name}
- as={Link}
- to={route.to}
- variant={isActive ? "solid" : "ghost"}
- border={isActive ? "1px solid" : "none"}
- borderColor={borderColor}
- fontWeight={isActive ? "bold" : "normal"}
- justifyContent={
- route.count === undefined ? "start" : "space-between"
- }
- size="md"
- w="full"
- >
- <span>{route.name}</span>
- {route.count !== undefined && <Count count={route.count} />}
- </Button>
- );
- })}
- </VStack>
- </VStack>
- </div>
- </VStack>
- );
+ return <DetailSidebar links={links} />;
};
export default PurchaseOrderSidebar;
diff --git a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierContacts/SupplierContacts.tsx b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierContacts/SupplierContacts.tsx
index 33fd8a4b02..2fee0775f8 100644
--- a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierContacts/SupplierContacts.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierContacts/SupplierContacts.tsx
@@ -1,12 +1,13 @@
-import { Heading, useDisclosure } from "@carbon/react";
import {
- Button,
Card,
- CardBody,
+ CardAction,
+ CardContent,
CardHeader,
- List,
- ListItem,
-} from "@chakra-ui/react";
+ CardTitle,
+ HStack,
+ useDisclosure,
+} from "@carbon/react";
+import { Button, List, ListItem } from "@chakra-ui/react";
import { Link, Outlet, useNavigate, useParams } from "@remix-run/react";
import { useCallback, useState } from "react";
import { BsPencilSquare } from "react-icons/bs";
@@ -87,18 +88,20 @@ const SupplierContacts = ({ contacts }: SupplierContactsProps) => {
return (
<>
- <Card w="full">
- <CardHeader display="flex" justifyContent="space-between">
- <Heading size="h3" className="inline-flex">
- Contacts
- </Heading>
- {canEdit && (
- <Button colorScheme="brand" as={Link} to="new">
- New
- </Button>
- )}
- </CardHeader>
- <CardBody>
+ <Card className="w-full">
+ <HStack className="justify-between items-start">
+ <CardHeader>
+ <CardTitle>Contacts</CardTitle>
+ </CardHeader>
+ <CardAction>
+ {canEdit && (
+ <Button colorScheme="brand" as={Link} to="new">
+ New
+ </Button>
+ )}
+ </CardAction>
+ </HStack>
+ <CardContent>
{isEmpty ? (
<div className="my-8 text-center w-full">
<p className="text-muted-foreground text-sm">
@@ -123,7 +126,7 @@ const SupplierContacts = ({ contacts }: SupplierContactsProps) => {
))}
</List>
)}
- </CardBody>
+ </CardContent>
</Card>
{selectedContact && selectedContact.id && (
diff --git a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierForm/SupplierForm.tsx b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierForm/SupplierForm.tsx
index b82066bacc..21fa2289a2 100644
--- a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierForm/SupplierForm.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierForm/SupplierForm.tsx
@@ -1,5 +1,14 @@
-import { Heading, HStack, VStack } from "@carbon/react";
-import { Card, CardBody, CardFooter, CardHeader, Grid } from "@chakra-ui/react";
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ HStack,
+ VStack,
+} from "@carbon/react";
+import { Grid } from "@chakra-ui/react";
import { ValidatedForm } from "remix-validated-form";
import { Employee, Hidden, Input, Select, Submit } from "~/components/Form";
import { usePermissions, useRouteData } from "~/hooks";
@@ -43,19 +52,19 @@ const SupplierForm = ({ initialValues }: SupplierFormProps) => {
validator={supplierValidator}
defaultValues={initialValues}
>
- <Card w="full">
+ <Card className="w-full">
<CardHeader>
- <Heading size="h3">
+ <CardTitle>
{isEditing ? "Supplier Overview" : "New Supplier"}
- </Heading>
+ </CardTitle>
{!isEditing && (
- <p className="text-muted-foreground font-normal">
+ <CardDescription>
A supplier is a business or person who sells you parts or
services.
- </p>
+ </CardDescription>
)}
</CardHeader>
- <CardBody>
+ <CardContent>
<Hidden name="id" />
<Grid
gridTemplateColumns={
@@ -91,7 +100,7 @@ const SupplierForm = ({ initialValues }: SupplierFormProps) => {
</>
)}
</Grid>
- </CardBody>
+ </CardContent>
<CardFooter>
<HStack>
<Submit isDisabled={isDisabled}>Save</Submit>
diff --git a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierHeader/SupplierHeader.tsx b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierHeader/SupplierHeader.tsx
index 026c3c117c..71842375f0 100644
--- a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierHeader/SupplierHeader.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierHeader/SupplierHeader.tsx
@@ -1,5 +1,13 @@
-import { Heading, HStack, VStack } from "@carbon/react";
-import { Button, Card, CardBody, CardHeader, Stack } from "@chakra-ui/react";
+import {
+ Card,
+ CardAction,
+ CardContent,
+ CardHeader,
+ CardTitle,
+ HStack,
+ VStack,
+} from "@carbon/react";
+import { Button, Stack } from "@chakra-ui/react";
import { useParams } from "@remix-run/react";
import { FaHistory } from "react-icons/fa";
import { useRouteData } from "~/hooks";
@@ -26,25 +34,25 @@ const SupplierHeader = () => {
return (
<VStack>
- <Card w="full">
- <CardHeader>
- <HStack className="justify-between items-center">
- <Stack direction="column" spacing={2}>
- <Heading size="h3">{routeData?.supplier?.name}</Heading>
- </Stack>
+ <Card className="w-full">
+ <HStack className="justify-between items-start">
+ <CardHeader>
+ <CardTitle>{routeData?.supplier?.name}</CardTitle>
+ </CardHeader>
+ <CardAction>
<Button onClick={() => alert("TODO")} leftIcon={<FaHistory />}>
Supplier Details
</Button>
- </HStack>
- </CardHeader>
- <CardBody>
+ </CardAction>
+ </HStack>
+ <CardContent>
<Stack direction={["column", "column", "row"]} spacing={8}>
<Stack
direction={["row", "row", "column"]}
alignItems="start"
justifyContent="space-between"
>
- <span className="text-muted-foreground">Type</span>
+ <span className="text-sm text-muted-foreground">Type</span>
<span className="font-bold">
{sharedSupplierData?.supplierTypes?.find(
(type) => type.id === routeData?.supplier?.supplierTypeId
@@ -56,7 +64,7 @@ const SupplierHeader = () => {
alignItems="start"
justifyContent="space-between"
>
- <span className="text-muted-foreground">Status</span>
+ <span className="text-sm text-muted-foreground">Status</span>
<span className="font-bold">
{sharedSupplierData?.supplierStatuses?.find(
(status) =>
@@ -69,7 +77,9 @@ const SupplierHeader = () => {
alignItems="start"
justifyContent="space-between"
>
- <span className="text-muted-foreground">Payment Terms</span>
+ <span className="text-sm text-muted-foreground">
+ Payment Terms
+ </span>
<span className="font-bold">
{/* // TODO: defaultPaymentTermId */}
{sharedSupplierData?.paymentTerms?.find(
@@ -79,7 +89,7 @@ const SupplierHeader = () => {
</span>
</Stack>
</Stack>
- </CardBody>
+ </CardContent>
</Card>
</VStack>
);
diff --git a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierLocations/SupplierLocations.tsx b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierLocations/SupplierLocations.tsx
index 0f384cf881..ac52ff6c07 100644
--- a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierLocations/SupplierLocations.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierLocations/SupplierLocations.tsx
@@ -1,12 +1,13 @@
-import { Heading, useDisclosure } from "@carbon/react";
import {
- Button,
Card,
- CardBody,
+ CardAction,
+ CardContent,
CardHeader,
- List,
- ListItem,
-} from "@chakra-ui/react";
+ CardTitle,
+ HStack,
+ useDisclosure,
+} from "@carbon/react";
+import { Button, List, ListItem } from "@chakra-ui/react";
import { Link, Outlet, useNavigate, useParams } from "@remix-run/react";
import { useCallback, useState } from "react";
import { BsPencilSquare } from "react-icons/bs";
@@ -74,18 +75,20 @@ const SupplierLocations = ({ locations }: SupplierLocationsProps) => {
return (
<>
- <Card w="full">
- <CardHeader display="flex" justifyContent="space-between">
- <Heading size="h3" className="inline-flex">
- Locations
- </Heading>
- {canEdit && (
- <Button colorScheme="brand" as={Link} to="new">
- New
- </Button>
- )}
- </CardHeader>
- <CardBody>
+ <Card className="w-full">
+ <HStack className="justify-between items-start">
+ <CardHeader>
+ <CardTitle>Locations</CardTitle>
+ </CardHeader>
+ <CardAction>
+ {canEdit && (
+ <Button colorScheme="brand" as={Link} to="new">
+ New
+ </Button>
+ )}
+ </CardAction>
+ </HStack>
+ <CardContent>
{isEmpty ? (
<div className="my-8 text-center w-full">
<p className="text-muted-foreground text-sm">
@@ -106,7 +109,7 @@ const SupplierLocations = ({ locations }: SupplierLocationsProps) => {
))}
</List>
)}
- </CardBody>
+ </CardContent>
</Card>
{selectedLocation && selectedLocation.id && (
diff --git a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierPaymentForm/SupplierPaymentForm.tsx b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierPaymentForm/SupplierPaymentForm.tsx
index 60e11e2feb..5296f79226 100644
--- a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierPaymentForm/SupplierPaymentForm.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierPaymentForm/SupplierPaymentForm.tsx
@@ -1,5 +1,13 @@
-import { Heading, HStack, VStack } from "@carbon/react";
-import { Card, CardBody, CardFooter, CardHeader, Grid } from "@chakra-ui/react";
+import {
+ Card,
+ CardContent,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ HStack,
+ VStack,
+} from "@carbon/react";
+import { Grid } from "@chakra-ui/react";
import { useState } from "react";
import { ValidatedForm } from "remix-validated-form";
import {
@@ -45,11 +53,11 @@ const SupplierPaymentForm = ({ initialValues }: SupplierPaymentFormProps) => {
validator={supplierPaymentValidator}
defaultValues={initialValues}
>
- <Card w="full">
+ <Card className="w-full">
<CardHeader>
- <Heading size="h3">Supplier Payment</Heading>
+ <CardTitle>Supplier Payment</CardTitle>
</CardHeader>
- <CardBody>
+ <CardContent>
<Hidden name="supplierId" />
<Grid
gridTemplateColumns={["1fr", "1fr", "1fr 1fr 1fr"]}
@@ -83,7 +91,7 @@ const SupplierPaymentForm = ({ initialValues }: SupplierPaymentFormProps) => {
<Currency name="currencyCode" label="Currency" />
</VStack>
</Grid>
- </CardBody>
+ </CardContent>
<CardFooter>
<HStack>
<Submit isDisabled={isDisabled}>Save</Submit>
diff --git a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierShippingForm/SupplierShippingForm.tsx b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierShippingForm/SupplierShippingForm.tsx
index 06c2a5cb2e..3e74e40afe 100644
--- a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierShippingForm/SupplierShippingForm.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierShippingForm/SupplierShippingForm.tsx
@@ -1,5 +1,13 @@
-import { Heading, HStack, VStack } from "@carbon/react";
-import { Card, CardBody, CardFooter, CardHeader, Grid } from "@chakra-ui/react";
+import {
+ Card,
+ CardContent,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ HStack,
+ VStack,
+} from "@carbon/react";
+import { Grid } from "@chakra-ui/react";
import { useState } from "react";
import { ValidatedForm } from "remix-validated-form";
import {
@@ -51,11 +59,11 @@ const SupplierShippingForm = ({ initialValues }: SupplierShippingFormProps) => {
validator={supplierShippingValidator}
defaultValues={initialValues}
>
- <Card w="full">
+ <Card className="w-full">
<CardHeader>
- <Heading size="h3">Supplier Shipping</Heading>
+ <CardTitle>Supplier Shipping</CardTitle>
</CardHeader>
- <CardBody>
+ <CardContent>
<Hidden name="supplierId" />
<Grid
gridTemplateColumns={["1fr", "1fr", "1fr 1fr 1fr"]}
@@ -93,7 +101,7 @@ const SupplierShippingForm = ({ initialValues }: SupplierShippingFormProps) => {
/>
</VStack>
</Grid>
- </CardBody>
+ </CardContent>
<CardFooter>
<HStack>
<Submit isDisabled={isDisabled}>Save</Submit>
diff --git a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierSidebar/SupplierSidebar.tsx b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierSidebar/SupplierSidebar.tsx
index 3281a2140b..e709e4882f 100644
--- a/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierSidebar/SupplierSidebar.tsx
+++ b/apps/carbon/app/modules/purchasing/ui/Supplier/SupplierSidebar/SupplierSidebar.tsx
@@ -1,6 +1,5 @@
-import { Count, VStack, useColor } from "@carbon/react";
-import { Button } from "@chakra-ui/react";
-import { Link, useMatches, useParams } from "@remix-run/react";
+import { useParams } from "@remix-run/react";
+import { DetailSidebar } from "~/components/Layout";
import { useRouteData } from "~/hooks";
import type {
SupplierContact,
@@ -12,7 +11,7 @@ import { useSupplierSidebar } from "./useSupplierSidebar";
const SupplierSidebar = () => {
const { supplierId } = useParams();
- const borderColor = useColor("gray.200");
+
if (!supplierId)
throw new Error(
"SupplierSidebar requires an supplierId and could not find supplierId in params"
@@ -28,45 +27,8 @@ const SupplierSidebar = () => {
contacts: routeData?.contacts.length ?? 0,
locations: routeData?.locations.length ?? 0,
});
- const matches = useMatches();
-
- return (
- <VStack className="h-full">
- <div className="overflow-y-auto h-full w-full">
- <VStack>
- <VStack spacing={1}>
- {links.map((route) => {
- const isActive = matches.some(
- (match) =>
- (match.pathname.includes(route.to) && route.to !== "") ||
- (match.id.includes(".index") && route.to === "")
- );
- return (
- <Button
- key={route.name}
- as={Link}
- to={route.to}
- variant={isActive ? "solid" : "ghost"}
- border={isActive ? "1px solid" : "none"}
- borderColor={borderColor}
- fontWeight={isActive ? "bold" : "normal"}
- justifyContent={
- route.count === undefined ? "start" : "space-between"
- }
- size="md"
- w="full"
- >
- <span>{route.name}</span>
- {route.count !== undefined && <Count count={route.count} />}
- </Button>
- );
- })}
- </VStack>
- </VStack>
- </div>
- </VStack>
- );
+ return <DetailSidebar links={links} />;
};
export default SupplierSidebar;
diff --git a/apps/carbon/app/modules/resources/ui/Person/PersonAbilities/PersonAbilities.tsx b/apps/carbon/app/modules/resources/ui/Person/PersonAbilities/PersonAbilities.tsx
index dc2a07a39d..a348a72be1 100644
--- a/apps/carbon/app/modules/resources/ui/Person/PersonAbilities/PersonAbilities.tsx
+++ b/apps/carbon/app/modules/resources/ui/Person/PersonAbilities/PersonAbilities.tsx
@@ -1,14 +1,6 @@
-import { Heading } from "@carbon/react";
+import { Card, CardContent, CardHeader, CardTitle } from "@carbon/react";
import { formatDate } from "@carbon/utils";
-import {
- Card,
- CardBody,
- CardHeader,
- Grid,
- Icon,
- List,
- ListItem,
-} from "@chakra-ui/react";
+import { Grid, Icon, List, ListItem } from "@chakra-ui/react";
import { Link } from "@remix-run/react";
import clsx from "clsx";
import type { IconType } from "react-icons";
@@ -46,11 +38,11 @@ const AbilityIcons: Record<
const PersonAbilities = ({ abilities }: PersonAbilitiesProps) => {
return (
- <Card w="full">
+ <Card className="w-full">
<CardHeader>
- <Heading size="h3">Abilities</Heading>
+ <CardTitle>Abilities</CardTitle>
</CardHeader>
- <CardBody>
+ <CardContent>
{abilities?.length > 0 ? (
<List spacing={4}>
{abilities.map((employeeAbility) => {
@@ -121,7 +113,7 @@ const PersonAbilities = ({ abilities }: PersonAbilitiesProps) => {
No abilities added
</div>
)}
- </CardBody>
+ </CardContent>
</Card>
);
};
diff --git a/apps/carbon/app/modules/resources/ui/Person/PersonDaysOff/PersonDaysOff.tsx b/apps/carbon/app/modules/resources/ui/Person/PersonDaysOff/PersonDaysOff.tsx
index c7c59214ec..b23c27cf02 100644
--- a/apps/carbon/app/modules/resources/ui/Person/PersonDaysOff/PersonDaysOff.tsx
+++ b/apps/carbon/app/modules/resources/ui/Person/PersonDaysOff/PersonDaysOff.tsx
@@ -1,19 +1,18 @@
-import { Heading } from "@carbon/react";
-import { Box, Card, CardBody, CardHeader } from "@chakra-ui/react";
+import { Card, CardContent, CardHeader, CardTitle } from "@carbon/react";
type PersonDaysOffProps = {};
const PersonDaysOff = (props: PersonDaysOffProps) => {
return (
- <Card w="full">
+ <Card className="w-full">
<CardHeader>
- <Heading size="h3">Days Off</Heading>
+ <CardTitle>Days Off</CardTitle>
</CardHeader>
- <CardBody>
- <Box color="gray.500" p={4} w="full" textAlign="center">
+ <CardContent>
+ <div className="text-muted-foreground p-4 w-full text-center">
No days off scheduled
- </Box>
- </CardBody>
+ </div>
+ </CardContent>
</Card>
);
};
diff --git a/apps/carbon/app/modules/resources/ui/Person/PersonHeader/PersonHeader.tsx b/apps/carbon/app/modules/resources/ui/Person/PersonHeader/PersonHeader.tsx
index 8f3edcd4fe..f4caef7709 100644
--- a/apps/carbon/app/modules/resources/ui/Person/PersonHeader/PersonHeader.tsx
+++ b/apps/carbon/app/modules/resources/ui/Person/PersonHeader/PersonHeader.tsx
@@ -1,4 +1,4 @@
-import { Heading, HStack, VStack } from "@carbon/react";
+import { CardTitle, HStack, VStack } from "@carbon/react";
import { Button } from "@chakra-ui/react";
import { BsEnvelopeFill } from "react-icons/bs";
import { Avatar } from "~/components";
@@ -12,7 +12,7 @@ const PersonHeader = ({ user }: { user: Account }) => {
<HStack spacing={4}>
<Avatar size="lg" path={user.avatarUrl} />
<VStack spacing={1}>
- <Heading size="h3">{user.fullName}</Heading>
+ <CardTitle>{user.fullName}</CardTitle>
<p className="text-muted-foreground text-sm">{user.about}</p>
</VStack>
</HStack>
diff --git a/apps/carbon/app/modules/resources/ui/Person/PersonOvertime/PersonOvertime.tsx b/apps/carbon/app/modules/resources/ui/Person/PersonOvertime/PersonOvertime.tsx
index b37bf2edc2..c1f494fcf1 100644
--- a/apps/carbon/app/modules/resources/ui/Person/PersonOvertime/PersonOvertime.tsx
+++ b/apps/carbon/app/modules/resources/ui/Person/PersonOvertime/PersonOvertime.tsx
@@ -1,19 +1,18 @@
-import { Heading } from "@carbon/react";
-import { Box, Card, CardBody, CardHeader } from "@chakra-ui/react";
+import { Card, CardContent, CardHeader, CardTitle } from "@carbon/react";
type PersonOvertimeProps = {};
const PersonOvertime = (props: PersonOvertimeProps) => {
return (
- <Card w="full">
+ <Card className="w-full">
<CardHeader>
- <Heading size="h3">Overtime</Heading>
+ <CardTitle>Overtime</CardTitle>
</CardHeader>
- <CardBody>
- <Box color="gray.500" p={4} w="full" textAlign="center">
+ <CardContent>
+ <div className="text-muted-foreground p-4 w-full text-center">
No overtime scheduled
- </Box>
- </CardBody>
+ </div>
+ </CardContent>
</Card>
);
};
diff --git a/apps/carbon/app/modules/resources/ui/Person/PersonTabs/PersonTabs.tsx b/apps/carbon/app/modules/resources/ui/Person/PersonTabs/PersonTabs.tsx
index 3a535c31d7..2c417bc6d6 100644
--- a/apps/carbon/app/modules/resources/ui/Person/PersonTabs/PersonTabs.tsx
+++ b/apps/carbon/app/modules/resources/ui/Person/PersonTabs/PersonTabs.tsx
@@ -1,7 +1,5 @@
+import { Card, CardContent } from "@carbon/react";
import {
- Box,
- Card,
- CardBody,
Icon,
Tab,
TabList,
@@ -39,8 +37,8 @@ const PersonsTabs = ({
if (!personId) throw new Error("Missing personId");
return (
- <Card w="full">
- <CardBody>
+ <Card className="w-full">
+ <CardContent>
<Tabs colorScheme="gray">
<TabList>
<Tab>Profile</Tab>
@@ -64,29 +62,29 @@ const PersonsTabs = ({
<TabPanel>
{publicAttributes.length ? (
publicAttributes.map((category: PublicAttributes) => (
- <Box key={category.id} mb={8} w="full">
+ <div key={category.id} className="mb-8 w-full">
<SectionTitle>{category.name}</SectionTitle>
<UserAttributesForm attributeCategory={category} />
- </Box>
+ </div>
))
) : (
- <Box color="gray.500" p={4} w="full" textAlign="center">
+ <div className="text-muted-foreground p-4 w-full text-center">
No public attributes
- </Box>
+ </div>
)}
</TabPanel>
<TabPanel>
{privateAttributes.length ? (
privateAttributes.map((category: PrivateAttributes) => (
- <Box key={category.id} mb={8} w="full">
+ <div key={category.id} className="mb-8 w-full">
<SectionTitle>{category.name}</SectionTitle>
<UserAttributesForm attributeCategory={category} />
- </Box>
+ </div>
))
) : (
- <Box color="gray.500" p={4} w="full" textAlign="center">
+ <div className="text-muted-foreground p-4 w-full text-center">
No private attributes
- </Box>
+ </div>
)}
</TabPanel>
<TabPanel>
@@ -94,7 +92,7 @@ const PersonsTabs = ({
</TabPanel>
</TabPanels>
</Tabs>
- </CardBody>
+ </CardContent>
</Card>
);
};
diff --git a/apps/carbon/app/modules/sales/ui/Customer/CustomerContacts/CustomerContacts.tsx b/apps/carbon/app/modules/sales/ui/Customer/CustomerContacts/CustomerContacts.tsx
index 07f3bca41f..272142c28d 100644
--- a/apps/carbon/app/modules/sales/ui/Customer/CustomerContacts/CustomerContacts.tsx
+++ b/apps/carbon/app/modules/sales/ui/Customer/CustomerContacts/CustomerContacts.tsx
@@ -1,14 +1,12 @@
-import { Heading } from "@carbon/react";
import {
- Box,
- Button,
Card,
- CardBody,
+ CardAction,
+ CardContent,
CardHeader,
- List,
- ListItem,
- useDisclosure,
-} from "@chakra-ui/react";
+ CardTitle,
+ HStack,
+} from "@carbon/react";
+import { Button, List, ListItem, useDisclosure } from "@chakra-ui/react";
import { Link, Outlet, useNavigate, useParams } from "@remix-run/react";
import { useCallback, useState } from "react";
import { BsPencilSquare } from "react-icons/bs";
@@ -78,24 +76,26 @@ const CustomerContacts = ({ contacts }: CustomerContactsProps) => {
return (
<>
- <Card w="full">
- <CardHeader display="flex" justifyContent="space-between">
- <Heading size="h3" className="inline-flex">
- Contacts
- </Heading>
- {canEdit && (
- <Button colorScheme="brand" as={Link} to="new">
- New
- </Button>
- )}
- </CardHeader>
- <CardBody>
+ <Card className="w-full">
+ <HStack className="justify-between items-start">
+ <CardHeader>
+ <CardTitle>Contacts</CardTitle>
+ </CardHeader>
+ <CardAction>
+ {canEdit && (
+ <Button colorScheme="brand" as={Link} to="new">
+ New
+ </Button>
+ )}
+ </CardAction>
+ </HStack>
+ <CardContent>
{isEmpty ? (
- <Box w="full" my={8} textAlign="center">
+ <div className="w-full my-8 text-center">
<p className="text-muted-foreground text-sm">
You haven’t created any contacts yet.
</p>
- </Box>
+ </div>
) : (
<List w="full" spacing={4}>
{contacts?.map((contact) => (
@@ -114,7 +114,7 @@ const CustomerContacts = ({ contacts }: CustomerContactsProps) => {
))}
</List>
)}
- </CardBody>
+ </CardContent>
</Card>
{contact && contact.id && (
diff --git a/apps/carbon/app/modules/sales/ui/Customer/CustomerForm/CustomerForm.tsx b/apps/carbon/app/modules/sales/ui/Customer/CustomerForm/CustomerForm.tsx
index 725bf8d89b..40ae0cca8b 100644
--- a/apps/carbon/app/modules/sales/ui/Customer/CustomerForm/CustomerForm.tsx
+++ b/apps/carbon/app/modules/sales/ui/Customer/CustomerForm/CustomerForm.tsx
@@ -1,5 +1,14 @@
-import { Heading, HStack, VStack } from "@carbon/react";
-import { Card, CardBody, CardFooter, CardHeader, Grid } from "@chakra-ui/react";
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ HStack,
+ VStack,
+} from "@carbon/react";
+import { Grid } from "@chakra-ui/react";
import { ValidatedForm } from "remix-validated-form";
import { Employee, Hidden, Input, Select, Submit } from "~/components/Form";
import { usePermissions, useRouteData } from "~/hooks";
@@ -43,19 +52,19 @@ const CustomerForm = ({ initialValues }: CustomerFormProps) => {
validator={customerValidator}
defaultValues={initialValues}
>
- <Card w="full">
+ <Card className="w-full">
<CardHeader>
- <Heading size="h3">
+ <CardTitle>
{isEditing ? "Customer Overview" : "New Customer"}
- </Heading>
+ </CardTitle>
{!isEditing && (
- <p className="text-muted-foreground font-normal">
+ <CardDescription>
A customer is a business or person who buys your parts or
services.
- </p>
+ </CardDescription>
)}
</CardHeader>
- <CardBody>
+ <CardContent>
<Hidden name="id" />
<Grid
gridTemplateColumns={
@@ -91,7 +100,7 @@ const CustomerForm = ({ initialValues }: CustomerFormProps) => {
</>
)}
</Grid>
- </CardBody>
+ </CardContent>
<CardFooter>
<HStack>
<Submit isDisabled={isDisabled}>Save</Submit>
diff --git a/apps/carbon/app/modules/sales/ui/Customer/CustomerHeader/CustomerHeader.tsx b/apps/carbon/app/modules/sales/ui/Customer/CustomerHeader/CustomerHeader.tsx
index a6025e685b..0f81316554 100644
--- a/apps/carbon/app/modules/sales/ui/Customer/CustomerHeader/CustomerHeader.tsx
+++ b/apps/carbon/app/modules/sales/ui/Customer/CustomerHeader/CustomerHeader.tsx
@@ -1,5 +1,13 @@
-import { Heading, HStack, VStack } from "@carbon/react";
-import { Button, Card, CardBody, CardHeader, Stack } from "@chakra-ui/react";
+import {
+ Card,
+ CardAction,
+ CardContent,
+ CardHeader,
+ CardTitle,
+ HStack,
+ VStack,
+} from "@carbon/react";
+import { Button, Stack } from "@chakra-ui/react";
import { useParams } from "@remix-run/react";
import { FaHistory } from "react-icons/fa";
import { useRouteData } from "~/hooks";
@@ -25,25 +33,25 @@ const CustomerHeader = () => {
return (
<VStack>
- <Card w="full">
- <CardHeader>
- <HStack className="justify-between items-start">
- <VStack>
- <Heading size="h3">{routeData?.customer?.name}</Heading>
- </VStack>
+ <Card className="w-full">
+ <HStack className="justify-between items-start">
+ <CardHeader>
+ <CardTitle>{routeData?.customer?.name}</CardTitle>
+ </CardHeader>
+ <CardAction>
<Button onClick={() => alert("TODO")} leftIcon={<FaHistory />}>
Customer Details
</Button>
- </HStack>
- </CardHeader>
- <CardBody>
+ </CardAction>
+ </HStack>
+ <CardContent>
<Stack direction={["column", "column", "row"]} spacing={8}>
<Stack
direction={["row", "row", "column"]}
alignItems="start"
justifyContent="space-between"
>
- <span className="text-muted-foreground">Type</span>
+ <span className="text-sm text-muted-foreground">Type</span>
<span className="font-bold">
{sharedCustomerData?.customerTypes?.find(
(type) => type.id === routeData?.customer?.customerTypeId
@@ -55,7 +63,7 @@ const CustomerHeader = () => {
alignItems="start"
justifyContent="space-between"
>
- <span className="text-muted-foreground">Status</span>
+ <span className="text-sm text-muted-foreground">Status</span>
<span className="font-bold">
{sharedCustomerData?.customerStatuses?.find(
(status) =>
@@ -68,7 +76,9 @@ const CustomerHeader = () => {
alignItems="start"
justifyContent="space-between"
>
- <span className="text-muted-foreground">Payment Terms</span>
+ <span className="text-sm text-muted-foreground">
+ Payment Terms
+ </span>
<span className="font-bold">
{sharedCustomerData?.paymentTerms?.find(
(term) =>
@@ -77,7 +87,7 @@ const CustomerHeader = () => {
</span>
</Stack>
</Stack>
- </CardBody>
+ </CardContent>
</Card>
</VStack>
);
diff --git a/apps/carbon/app/modules/sales/ui/Customer/CustomerLocations/CustomerLocations.tsx b/apps/carbon/app/modules/sales/ui/Customer/CustomerLocations/CustomerLocations.tsx
index 694e7dc3ad..99298516e1 100644
--- a/apps/carbon/app/modules/sales/ui/Customer/CustomerLocations/CustomerLocations.tsx
+++ b/apps/carbon/app/modules/sales/ui/Customer/CustomerLocations/CustomerLocations.tsx
@@ -1,12 +1,13 @@
-import { Heading, useDisclosure } from "@carbon/react";
import {
- Button,
Card,
- CardBody,
+ CardAction,
+ CardContent,
CardHeader,
- List,
- ListItem,
-} from "@chakra-ui/react";
+ CardTitle,
+ HStack,
+ useDisclosure,
+} from "@carbon/react";
+import { Button, List, ListItem } from "@chakra-ui/react";
import { Link, Outlet, useNavigate, useParams } from "@remix-run/react";
import { useCallback, useState } from "react";
import { BsPencilSquare } from "react-icons/bs";
@@ -62,18 +63,20 @@ const CustomerLocations = ({ locations }: CustomerLocationsProps) => {
return (
<>
- <Card w="full">
- <CardHeader display="flex" justifyContent="space-between">
- <Heading size="h3" className="inline-flex">
- Locations
- </Heading>
- {canEdit && (
- <Button colorScheme="brand" as={Link} to="new">
- New
- </Button>
- )}
- </CardHeader>
- <CardBody>
+ <Card className="w-full">
+ <HStack className="justify-between items-start">
+ <CardHeader>
+ <CardTitle>Locations</CardTitle>
+ </CardHeader>
+ <CardAction>
+ {canEdit && (
+ <Button colorScheme="brand" as={Link} to="new">
+ New
+ </Button>
+ )}
+ </CardAction>
+ </HStack>
+ <CardContent>
{isEmpty ? (
<div className="my-8 text-center w-full">
<p className="text-muted-foreground text-sm">
@@ -94,7 +97,7 @@ const CustomerLocations = ({ locations }: CustomerLocationsProps) => {
))}
</List>
)}
- </CardBody>
+ </CardContent>
</Card>
{deleteLocationModal.isOpen && location?.id && (
diff --git a/apps/carbon/app/modules/sales/ui/Customer/CustomerPaymentForm/CustomerPaymentForm.tsx b/apps/carbon/app/modules/sales/ui/Customer/CustomerPaymentForm/CustomerPaymentForm.tsx
index 51ba61267e..5c5e852679 100644
--- a/apps/carbon/app/modules/sales/ui/Customer/CustomerPaymentForm/CustomerPaymentForm.tsx
+++ b/apps/carbon/app/modules/sales/ui/Customer/CustomerPaymentForm/CustomerPaymentForm.tsx
@@ -1,5 +1,13 @@
-import { Heading, HStack, VStack } from "@carbon/react";
-import { Card, CardBody, CardFooter, CardHeader, Grid } from "@chakra-ui/react";
+import {
+ Card,
+ CardContent,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ HStack,
+ VStack,
+} from "@carbon/react";
+import { Grid } from "@chakra-ui/react";
import { useState } from "react";
import { ValidatedForm } from "remix-validated-form";
import {
@@ -45,11 +53,11 @@ const CustomerPaymentForm = ({ initialValues }: CustomerPaymentFormProps) => {
validator={customerPaymentValidator}
defaultValues={initialValues}
>
- <Card w="full">
+ <Card className="w-full">
<CardHeader>
- <Heading size="h3">Customer Payment</Heading>
+ <CardTitle>Customer Payment</CardTitle>
</CardHeader>
- <CardBody>
+ <CardContent>
<Hidden name="customerId" />
<Grid
gridTemplateColumns={["1fr", "1fr", "1fr 1fr 1fr"]}
@@ -83,7 +91,7 @@ const CustomerPaymentForm = ({ initialValues }: CustomerPaymentFormProps) => {
<Currency name="currencyCode" label="Currency" />
</VStack>
</Grid>
- </CardBody>
+ </CardContent>
<CardFooter>
<HStack>
<Submit isDisabled={isDisabled}>Save</Submit>
diff --git a/apps/carbon/app/modules/sales/ui/Customer/CustomerShippingForm/CustomerShippingForm.tsx b/apps/carbon/app/modules/sales/ui/Customer/CustomerShippingForm/CustomerShippingForm.tsx
index 16fa230f58..f9104b8851 100644
--- a/apps/carbon/app/modules/sales/ui/Customer/CustomerShippingForm/CustomerShippingForm.tsx
+++ b/apps/carbon/app/modules/sales/ui/Customer/CustomerShippingForm/CustomerShippingForm.tsx
@@ -1,5 +1,13 @@
-import { Heading, HStack, VStack } from "@carbon/react";
-import { Card, CardBody, CardFooter, CardHeader, Grid } from "@chakra-ui/react";
+import {
+ Card,
+ CardContent,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+ HStack,
+ VStack,
+} from "@carbon/react";
+import { Grid } from "@chakra-ui/react";
import { useState } from "react";
import { ValidatedForm } from "remix-validated-form";
import {
@@ -51,11 +59,11 @@ const CustomerShippingForm = ({ initialValues }: CustomerShippingFormProps) => {
validator={customerShippingValidator}
defaultValues={initialValues}
>
- <Card w="full">
+ <Card className="w-full">
<CardHeader>
- <Heading size="h3">Customer Shipping</Heading>
+ <CardTitle>Customer Shipping</CardTitle>
</CardHeader>
- <CardBody>
+ <CardContent>
<Hidden name="customerId" />
<Grid
gridTemplateColumns={["1fr", "1fr", "1fr 1fr 1fr"]}
@@ -93,7 +101,7 @@ const CustomerShippingForm = ({ initialValues }: CustomerShippingFormProps) => {
/>
</VStack>
</Grid>
- </CardBody>
+ </CardContent>
<CardFooter>
<HStack>
<Submit isDisabled={isDisabled}>Save</Submit>
diff --git a/apps/carbon/app/modules/sales/ui/Customer/CustomerSidebar/CustomerSidebar.tsx b/apps/carbon/app/modules/sales/ui/Customer/CustomerSidebar/CustomerSidebar.tsx
index 0fff7ce70a..84ab97b0fa 100644
--- a/apps/carbon/app/modules/sales/ui/Customer/CustomerSidebar/CustomerSidebar.tsx
+++ b/apps/carbon/app/modules/sales/ui/Customer/CustomerSidebar/CustomerSidebar.tsx
@@ -1,6 +1,5 @@
-import { Count, VStack, useColor } from "@carbon/react";
-import { Button } from "@chakra-ui/react";
-import { Link, useMatches, useParams } from "@remix-run/react";
+import { useParams } from "@remix-run/react";
+import { DetailSidebar } from "~/components/Layout";
import { useRouteData } from "~/hooks";
import type {
CustomerContact,
@@ -23,46 +22,8 @@ const CustomerSidebar = () => {
contacts: routeData?.contacts.length ?? 0,
locations: routeData?.locations.length ?? 0,
});
- const matches = useMatches();
- const borderColor = useColor("gray.200");
- return (
- <VStack className="h-full">
- <div className="overflow-y-auto h-full w-full">
- <VStack>
- <VStack spacing={1}>
- {links.map((route) => {
- const isActive = matches.some(
- (match) =>
- (match.pathname.includes(route.to) && route.to !== "") ||
- (match.id.includes(".index") && route.to === "")
- );
-
- return (
- <Button
- key={route.name}
- as={Link}
- to={route.to}
- variant={isActive ? "solid" : "ghost"}
- border={isActive ? "1px solid" : "none"}
- borderColor={borderColor}
- fontWeight={isActive ? "bold" : "normal"}
- justifyContent={
- route.count === undefined ? "start" : "space-between"
- }
- size="md"
- w="full"
- >
- <span>{route.name}</span>
- {route.count !== undefined && <Count count={route.count} />}
- </Button>
- );
- })}
- </VStack>
- </VStack>
- </div>
- </VStack>
- );
+ return <DetailSidebar links={links} />;
};
export default CustomerSidebar;
diff --git a/apps/carbon/app/modules/shared/ui/Notes/Notes.tsx b/apps/carbon/app/modules/shared/ui/Notes/Notes.tsx
index 080c662f4b..34dbe69692 100644
--- a/apps/carbon/app/modules/shared/ui/Notes/Notes.tsx
+++ b/apps/carbon/app/modules/shared/ui/Notes/Notes.tsx
@@ -47,7 +47,7 @@ const Notes = ({ documentId, notes }: NotesProps) => {
<p className="font-bold">{note.user?.fullName!}</p>
<HTML text={note.note} />
<HStack spacing={4}>
- <span className="text-muted-foreground">
+ <span className="text-sm text-muted-foreground">
{formatTimeAgo(note.createdAt)}
</span>
{/* @ts-ignore */}
diff --git a/apps/carbon/app/modules/shared/ui/Realtime/RealtimeDataProvider.tsx b/apps/carbon/app/modules/shared/ui/Realtime/RealtimeDataProvider.tsx
index 83f2e7868f..4d73419825 100644
--- a/apps/carbon/app/modules/shared/ui/Realtime/RealtimeDataProvider.tsx
+++ b/apps/carbon/app/modules/shared/ui/Realtime/RealtimeDataProvider.tsx
@@ -1,4 +1,4 @@
-import { Image, useColorModeValue } from "@chakra-ui/react";
+import { useColorModeValue } from "@chakra-ui/react";
import { useEffect, useState } from "react";
import { useSupabase } from "~/lib/supabase";
import { useCustomers, useParts, useSuppliers } from "~/stores";
@@ -205,14 +205,13 @@ const RealtimeDataProvider = ({ children }: { children: React.ReactNode }) => {
function Loading() {
return (
<div className="flex flex-col h-screen w-screen items-center justify-center">
- <Image
+ <img
src={useColorModeValue(
"/carbon-logo-dark.png",
"/carbon-logo-light.png"
)}
alt="Carbon Logo"
- maxW={100}
- marginBottom={3}
+ className="max-w-[100px]"
/>
</div>
);
diff --git a/apps/carbon/app/routes/x+/accounting+/_layout.tsx b/apps/carbon/app/routes/x+/accounting+/_layout.tsx
index 3101b51343..7043404e71 100644
--- a/apps/carbon/app/routes/x+/accounting+/_layout.tsx
+++ b/apps/carbon/app/routes/x+/accounting+/_layout.tsx
@@ -3,7 +3,7 @@ import { Grid } from "@chakra-ui/react";
import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { Outlet } from "@remix-run/react";
-import { GroupedContentSidebar } from "~/components/Layout/Sidebar";
+import { GroupedContentSidebar } from "~/components/Layout";
import {
getAccountsList,
getBaseCurrency,
diff --git a/apps/carbon/app/routes/x+/customer+/new.tsx b/apps/carbon/app/routes/x+/customer+/new.tsx
index 0448b86d8c..f512ccf3f1 100644
--- a/apps/carbon/app/routes/x+/customer+/new.tsx
+++ b/apps/carbon/app/routes/x+/customer+/new.tsx
@@ -49,5 +49,9 @@ export default function CustomersNewRoute() {
const initialValues = {
name: "",
};
- return <CustomerForm initialValues={initialValues} />;
+ return (
+ <div className="w-1/2 max-w-[720px] min-w-[420px] mx-auto">
+ <CustomerForm initialValues={initialValues} />
+ </div>
+ );
}
diff --git a/apps/carbon/app/routes/x+/inventory+/_layout.tsx b/apps/carbon/app/routes/x+/inventory+/_layout.tsx
index 79a183aedd..76a22e5d26 100644
--- a/apps/carbon/app/routes/x+/inventory+/_layout.tsx
+++ b/apps/carbon/app/routes/x+/inventory+/_layout.tsx
@@ -2,7 +2,7 @@ import { VStack } from "@carbon/react";
import { Grid } from "@chakra-ui/react";
import type { MetaFunction } from "@remix-run/node";
import { Outlet } from "@remix-run/react";
-import { GroupedContentSidebar } from "~/components/Layout/Sidebar";
+import { GroupedContentSidebar } from "~/components/Layout";
import { useInventorySidebar } from "~/modules/inventory";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/invoicing+/_layout.tsx b/apps/carbon/app/routes/x+/invoicing+/_layout.tsx
index 8da194499b..02447c210b 100644
--- a/apps/carbon/app/routes/x+/invoicing+/_layout.tsx
+++ b/apps/carbon/app/routes/x+/invoicing+/_layout.tsx
@@ -1,7 +1,7 @@
import { VStack } from "@carbon/react";
import { Grid } from "@chakra-ui/react";
import { Outlet } from "@remix-run/react";
-import { GroupedContentSidebar } from "~/components/Layout/Sidebar";
+import { GroupedContentSidebar } from "~/components/Layout";
import { useInvoicingSidebar } from "~/modules/invoicing";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/part+/new.tsx b/apps/carbon/app/routes/x+/part+/new.tsx
index 44551e4f97..90e371abac 100644
--- a/apps/carbon/app/routes/x+/part+/new.tsx
+++ b/apps/carbon/app/routes/x+/part+/new.tsx
@@ -1,4 +1,3 @@
-import { Box } from "@chakra-ui/react";
import type { ActionFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { validationError } from "remix-validated-form";
@@ -40,16 +39,19 @@ export async function action({ request }: ActionFunctionArgs) {
export default function PartsNewRoute() {
const initialValues = {
+ id: "",
name: "",
description: "",
partType: "Inventory" as "Inventory",
replenishmentSystem: "Buy" as "Buy",
unitOfMeasureCode: "EA",
+ blocked: false,
+ active: false,
};
return (
- <Box w="50%" maxW={720} minW={420}>
+ <div className="w-1/2 max-w-[720px] min-w-[420px] mx-auto">
<PartForm initialValues={initialValues} />
- </Box>
+ </div>
);
}
diff --git a/apps/carbon/app/routes/x+/parts+/_layout.tsx b/apps/carbon/app/routes/x+/parts+/_layout.tsx
index 6156a19924..9cdaeb902e 100644
--- a/apps/carbon/app/routes/x+/parts+/_layout.tsx
+++ b/apps/carbon/app/routes/x+/parts+/_layout.tsx
@@ -2,7 +2,7 @@ import { VStack } from "@carbon/react";
import { Grid } from "@chakra-ui/react";
import type { MetaFunction } from "@remix-run/node";
import { Outlet } from "@remix-run/react";
-import { GroupedContentSidebar } from "~/components/Layout/Sidebar";
+import { GroupedContentSidebar } from "~/components/Layout";
import { usePartsSidebar } from "~/modules/parts";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/purchase-invoice+/new.tsx b/apps/carbon/app/routes/x+/purchase-invoice+/new.tsx
index 0bb2e0115f..823d0cadcd 100644
--- a/apps/carbon/app/routes/x+/purchase-invoice+/new.tsx
+++ b/apps/carbon/app/routes/x+/purchase-invoice+/new.tsx
@@ -1,4 +1,3 @@
-import { Box } from "@chakra-ui/react";
import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import type { FunctionsResponse } from "@supabase/functions-js";
@@ -141,12 +140,12 @@ export default function PurchaseInvoiceNewRoute() {
};
return (
- <Box w="50%" maxW={720} minW={420}>
+ <div className="w-1/2 max-w-[720px] min-w-[420px] mx-auto">
<PurchaseInvoiceForm
// @ts-expect-error
initialValues={initialValues}
paymentTerms={sharedData?.paymentTerms ?? []}
/>
- </Box>
+ </div>
);
}
diff --git a/apps/carbon/app/routes/x+/purchase-order+/new.tsx b/apps/carbon/app/routes/x+/purchase-order+/new.tsx
index c1ef904966..99a9b584e9 100644
--- a/apps/carbon/app/routes/x+/purchase-order+/new.tsx
+++ b/apps/carbon/app/routes/x+/purchase-order+/new.tsx
@@ -1,4 +1,3 @@
-import { Box } from "@chakra-ui/react";
import { getLocalTimeZone, today } from "@internationalized/date";
import type { ActionFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
@@ -81,11 +80,11 @@ export default function PurchaseOrderNewRoute() {
};
return (
- <Box w="50%" maxW={720} minW={420}>
+ <div className="w-1/2 max-w-[720px] min-w-[420px] mx-auto">
<PurchaseOrderForm
// @ts-expect-error
initialValues={initialValues}
/>
- </Box>
+ </div>
);
}
diff --git a/apps/carbon/app/routes/x+/purchasing+/_layout.tsx b/apps/carbon/app/routes/x+/purchasing+/_layout.tsx
index 2243b23195..2510c06a8c 100644
--- a/apps/carbon/app/routes/x+/purchasing+/_layout.tsx
+++ b/apps/carbon/app/routes/x+/purchasing+/_layout.tsx
@@ -2,7 +2,7 @@ import { VStack } from "@carbon/react";
import { Grid } from "@chakra-ui/react";
import type { MetaFunction } from "@remix-run/node";
import { Outlet } from "@remix-run/react";
-import { GroupedContentSidebar } from "~/components/Layout/Sidebar";
+import { GroupedContentSidebar } from "~/components/Layout";
import { usePurchasingSidebar } from "~/modules/purchasing";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/resources+/_layout.tsx b/apps/carbon/app/routes/x+/resources+/_layout.tsx
index 7f12f2c253..f6a018b814 100644
--- a/apps/carbon/app/routes/x+/resources+/_layout.tsx
+++ b/apps/carbon/app/routes/x+/resources+/_layout.tsx
@@ -2,7 +2,7 @@ import { VStack } from "@carbon/react";
import { Grid } from "@chakra-ui/react";
import type { MetaFunction } from "@remix-run/node";
import { Outlet } from "@remix-run/react";
-import { GroupedContentSidebar } from "~/components/Layout/Sidebar";
+import { GroupedContentSidebar } from "~/components/Layout";
import { useResourcesSidebar } from "~/modules/resources";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/sales+/_layout.tsx b/apps/carbon/app/routes/x+/sales+/_layout.tsx
index 4e8a48c493..c0e04b76bc 100644
--- a/apps/carbon/app/routes/x+/sales+/_layout.tsx
+++ b/apps/carbon/app/routes/x+/sales+/_layout.tsx
@@ -2,7 +2,7 @@ import { VStack } from "@carbon/react";
import { Grid } from "@chakra-ui/react";
import type { MetaFunction } from "@remix-run/node";
import { Outlet } from "@remix-run/react";
-import { GroupedContentSidebar } from "~/components/Layout/Sidebar";
+import { GroupedContentSidebar } from "~/components/Layout";
import { useSalesSidebar } from "~/modules/sales";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/service+/new.tsx b/apps/carbon/app/routes/x+/service+/new.tsx
index 11902d113a..6857b69dbc 100644
--- a/apps/carbon/app/routes/x+/service+/new.tsx
+++ b/apps/carbon/app/routes/x+/service+/new.tsx
@@ -1,4 +1,3 @@
-import { Box } from "@chakra-ui/react";
import type { ActionFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { validationError } from "remix-validated-form";
@@ -64,9 +63,9 @@ export default function ServiceNewRoute() {
};
return (
- <Box w="50%" maxW={720} minW={420}>
+ <div className="w-1/2 max-w-[720px] min-w-[420px] mx-auto">
{/* @ts-ignore */}
<ServiceForm initialValues={initialValues} />
- </Box>
+ </div>
);
}
diff --git a/apps/carbon/app/routes/x+/settings+/_layout.tsx b/apps/carbon/app/routes/x+/settings+/_layout.tsx
index e3cb476b9d..f23ec49c72 100644
--- a/apps/carbon/app/routes/x+/settings+/_layout.tsx
+++ b/apps/carbon/app/routes/x+/settings+/_layout.tsx
@@ -2,7 +2,7 @@ import { VStack } from "@carbon/react";
import { Grid } from "@chakra-ui/react";
import type { MetaFunction } from "@remix-run/node";
import { Outlet } from "@remix-run/react";
-import { GroupedContentSidebar } from "~/components/Layout/Sidebar";
+import { GroupedContentSidebar } from "~/components/Layout";
import { useSettingsSidebar } from "~/modules/settings";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
diff --git a/apps/carbon/app/routes/x+/settings+/sequences.tsx b/apps/carbon/app/routes/x+/settings+/sequences.tsx
index f671fecaad..6eee6ca05d 100644
--- a/apps/carbon/app/routes/x+/settings+/sequences.tsx
+++ b/apps/carbon/app/routes/x+/settings+/sequences.tsx
@@ -1,4 +1,4 @@
-import { VStack } from "@chakra-ui/react";
+import { VStack } from "@carbon/react";
import type { LoaderFunctionArgs } from "@remix-run/node";
import { json } from "@remix-run/node";
import { Outlet, useLoaderData } from "@remix-run/react";
diff --git a/apps/carbon/app/routes/x+/supplier+/new.tsx b/apps/carbon/app/routes/x+/supplier+/new.tsx
index ac33aa6e88..303b97a0c8 100644
--- a/apps/carbon/app/routes/x+/supplier+/new.tsx
+++ b/apps/carbon/app/routes/x+/supplier+/new.tsx
@@ -49,5 +49,9 @@ export default function SuppliersNewRoute() {
const initialValues = {
name: "",
};
- return <SupplierForm initialValues={initialValues} />;
+ return (
+ <div className="w-1/2 max-w-[720px] min-w-[420px] mx-auto">
+ <SupplierForm initialValues={initialValues} />
+ </div>
+ );
}
diff --git a/apps/carbon/app/routes/x+/users+/_layout.tsx b/apps/carbon/app/routes/x+/users+/_layout.tsx
index f4fae16e64..cb63c7a0bd 100644
--- a/apps/carbon/app/routes/x+/users+/_layout.tsx
+++ b/apps/carbon/app/routes/x+/users+/_layout.tsx
@@ -2,7 +2,7 @@ import { VStack } from "@carbon/react";
import { Grid } from "@chakra-ui/react";
import type { MetaFunction } from "@remix-run/node";
import { Outlet } from "@remix-run/react";
-import { GroupedContentSidebar } from "~/components/Layout/Sidebar";
+import { GroupedContentSidebar } from "~/components/Layout";
import { useUsersSidebar } from "~/modules/users";
import type { Handle } from "~/utils/handle";
import { path } from "~/utils/path";
diff --git a/packages/react/src/Overlay/ActionMenu/ActionMenu.tsx b/packages/react/src/ActionMenu.tsx
similarity index 96%
rename from packages/react/src/Overlay/ActionMenu/ActionMenu.tsx
rename to packages/react/src/ActionMenu.tsx
index 6fc527a309..6397d8f674 100644
--- a/packages/react/src/Overlay/ActionMenu/ActionMenu.tsx
+++ b/packages/react/src/ActionMenu.tsx
@@ -27,4 +27,4 @@ const ActionMenu = ({ children, disabled, icon }: ActionMenuProps) => {
);
};
-export default ActionMenu;
+export { ActionMenu };
diff --git a/packages/react/src/Card.tsx b/packages/react/src/Card.tsx
new file mode 100644
index 0000000000..27b7d93ca0
--- /dev/null
+++ b/packages/react/src/Card.tsx
@@ -0,0 +1,98 @@
+import type { HTMLAttributes } from "react";
+import { forwardRef } from "react";
+import { cn } from "~/utils/cn";
+
+const Card = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(
+ ({ className, ...props }, ref) => (
+ <div
+ ref={ref}
+ className={cn(
+ "flex flex-col rounded-lg border border-border bg-card text-card-foreground shadow-sm",
+ className
+ )}
+ {...props}
+ />
+ )
+);
+Card.displayName = "Card";
+
+const CardAction = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(
+ ({ className, ...props }, ref) => (
+ <div
+ ref={ref}
+ className={cn("flex flex-col space-y-1.5 p-6", className)}
+ {...props}
+ />
+ )
+);
+CardAction.displayName = "CardAction";
+
+const CardHeader = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(
+ ({ className, ...props }, ref) => (
+ <div
+ ref={ref}
+ className={cn("flex flex-col space-y-1.5 p-6", className)}
+ {...props}
+ />
+ )
+);
+CardHeader.displayName = "CardHeader";
+
+const CardTitle = forwardRef<
+ HTMLParagraphElement,
+ HTMLAttributes<HTMLHeadingElement>
+>(({ className, ...props }, ref) => (
+ <h3
+ ref={ref}
+ className={cn(
+ "text-2xl font-semibold leading-none tracking-tight",
+ className
+ )}
+ {...props}
+ />
+));
+CardTitle.displayName = "CardTitle";
+
+const CardDescription = forwardRef<
+ HTMLParagraphElement,
+ HTMLAttributes<HTMLParagraphElement>
+>(({ className, ...props }, ref) => (
+ <p
+ ref={ref}
+ className={cn("text-sm text-muted-foreground", className)}
+ {...props}
+ />
+));
+CardDescription.displayName = "CardDescription";
+
+const CardContent = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(
+ ({ className, ...props }, ref) => (
+ <div
+ ref={ref}
+ className={cn("flex flex-col flex-1 p-6 pt-0", className)}
+ {...props}
+ />
+ )
+);
+CardContent.displayName = "CardContent";
+
+const CardFooter = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(
+ ({ className, ...props }, ref) => (
+ <div
+ ref={ref}
+ className={cn("flex items-center p-6 pt-0", className)}
+ {...props}
+ />
+ )
+);
+CardFooter.displayName = "CardFooter";
+
+export {
+ Card,
+ CardAction,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+};
diff --git a/packages/react/src/SSR/ClientOnly.tsx b/packages/react/src/ClientOnly.tsx
similarity index 93%
rename from packages/react/src/SSR/ClientOnly.tsx
rename to packages/react/src/ClientOnly.tsx
index 18c7d20d67..23589fd3ed 100644
--- a/packages/react/src/SSR/ClientOnly.tsx
+++ b/packages/react/src/ClientOnly.tsx
@@ -1,5 +1,5 @@
import type { ReactNode } from "react";
-import { useHydrated } from "../hooks";
+import { useHydrated } from "./hooks";
type Props = {
/**
@@ -30,4 +30,4 @@ const ClientOnly = ({ children, fallback = null }: Props) => {
return useHydrated() ? <>{children()}</> : <>{fallback}</>;
};
-export default ClientOnly;
+export { ClientOnly };
diff --git a/packages/react/src/Overlay/ContextMenu/ContextMenu.tsx b/packages/react/src/ContextMenu.tsx
similarity index 93%
rename from packages/react/src/Overlay/ContextMenu/ContextMenu.tsx
rename to packages/react/src/ContextMenu.tsx
index aeed353a05..ead41eb7ef 100644
--- a/packages/react/src/Overlay/ContextMenu/ContextMenu.tsx
+++ b/packages/react/src/ContextMenu.tsx
@@ -20,9 +20,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
-import type { PortalProps, MenuButtonProps, MenuProps } from "@chakra-ui/react";
-import { useEventListener, Portal, Menu, MenuButton } from "@chakra-ui/react";
-import type { ReactNode, MutableRefObject } from "react";
+import type { MenuButtonProps, MenuProps, PortalProps } from "@chakra-ui/react";
+import { Menu, MenuButton, Portal, useEventListener } from "@chakra-ui/react";
+import type { MutableRefObject, ReactNode } from "react";
import { useCallback, useEffect, useRef, useState } from "react";
/*
@@ -56,7 +56,7 @@ export interface ContextMenuProps<T extends HTMLElement> {
menuButtonProps?: MenuButtonProps;
}
-export default function ContextMenu<T extends HTMLElement = HTMLElement>({
+export function ContextMenu<T extends HTMLElement = HTMLElement>({
renderMenu,
children,
menuProps,
diff --git a/packages/react/src/Count.tsx b/packages/react/src/Count.tsx
index 30aa6348a6..991fdbb9bf 100644
--- a/packages/react/src/Count.tsx
+++ b/packages/react/src/Count.tsx
@@ -7,7 +7,7 @@ const Count = ({ count, ...props }: CountProps) => {
const c = count > 99 ? "99+" : count;
return (
<div
- className="bg-primary text-primary-foreground rounded-full text-xs h-5 min-w-[1.25rem] flex items-center justify-center"
+ className="text-foreground font-mono font-semibold text-sm flex items-center justify-center"
{...props}
>{`${c}`}</div>
);
diff --git a/packages/react/src/Inputs/Date/DatePicker.tsx b/packages/react/src/Date/DatePicker.tsx
similarity index 100%
rename from packages/react/src/Inputs/Date/DatePicker.tsx
rename to packages/react/src/Date/DatePicker.tsx
diff --git a/packages/react/src/Inputs/Date/DateRangePicker.tsx b/packages/react/src/Date/DateRangePicker.tsx
similarity index 100%
rename from packages/react/src/Inputs/Date/DateRangePicker.tsx
rename to packages/react/src/Date/DateRangePicker.tsx
diff --git a/packages/react/src/Inputs/Date/DateTimePicker.tsx b/packages/react/src/Date/DateTimePicker.tsx
similarity index 100%
rename from packages/react/src/Inputs/Date/DateTimePicker.tsx
rename to packages/react/src/Date/DateTimePicker.tsx
diff --git a/packages/react/src/Inputs/Date/TimePicker.tsx b/packages/react/src/Date/TimePicker.tsx
similarity index 100%
rename from packages/react/src/Inputs/Date/TimePicker.tsx
rename to packages/react/src/Date/TimePicker.tsx
diff --git a/packages/react/src/Inputs/Date/components/Button.tsx b/packages/react/src/Date/components/Button.tsx
similarity index 100%
rename from packages/react/src/Inputs/Date/components/Button.tsx
rename to packages/react/src/Date/components/Button.tsx
diff --git a/packages/react/src/Inputs/Date/components/Calendar.tsx b/packages/react/src/Date/components/Calendar.tsx
similarity index 100%
rename from packages/react/src/Inputs/Date/components/Calendar.tsx
rename to packages/react/src/Date/components/Calendar.tsx
diff --git a/packages/react/src/Inputs/Date/components/CalendarCell.tsx b/packages/react/src/Date/components/CalendarCell.tsx
similarity index 100%
rename from packages/react/src/Inputs/Date/components/CalendarCell.tsx
rename to packages/react/src/Date/components/CalendarCell.tsx
diff --git a/packages/react/src/Inputs/Date/components/CalendarGrid.tsx b/packages/react/src/Date/components/CalendarGrid.tsx
similarity index 100%
rename from packages/react/src/Inputs/Date/components/CalendarGrid.tsx
rename to packages/react/src/Date/components/CalendarGrid.tsx
diff --git a/packages/react/src/Inputs/Date/components/DateField.tsx b/packages/react/src/Date/components/DateField.tsx
similarity index 100%
rename from packages/react/src/Inputs/Date/components/DateField.tsx
rename to packages/react/src/Date/components/DateField.tsx
diff --git a/packages/react/src/Inputs/Date/components/DateSegment.tsx b/packages/react/src/Date/components/DateSegment.tsx
similarity index 97%
rename from packages/react/src/Inputs/Date/components/DateSegment.tsx
rename to packages/react/src/Date/components/DateSegment.tsx
index c9c1875ee0..2e9a1ce217 100644
--- a/packages/react/src/Inputs/Date/components/DateSegment.tsx
+++ b/packages/react/src/Date/components/DateSegment.tsx
@@ -5,7 +5,7 @@ import type {
useDateFieldState,
} from "@react-stately/datepicker";
import { useId, useRef } from "react";
-import { useColor } from "../../../hooks";
+import { useColor } from "../../hooks";
export const DateSegment = ({
segment,
diff --git a/packages/react/src/Inputs/Date/components/Popover.tsx b/packages/react/src/Date/components/Popover.tsx
similarity index 93%
rename from packages/react/src/Inputs/Date/components/Popover.tsx
rename to packages/react/src/Date/components/Popover.tsx
index fcf9540150..81867e31b8 100644
--- a/packages/react/src/Inputs/Date/components/Popover.tsx
+++ b/packages/react/src/Date/components/Popover.tsx
@@ -1,6 +1,6 @@
-import { useRef } from "react";
import { Box, useColorModeValue, useOutsideClick } from "@chakra-ui/react";
-import { useEscape } from "../../../hooks";
+import { useRef } from "react";
+import { useEscape } from "../../hooks";
export function Popover(props: any) {
const ref = useRef();
diff --git a/packages/react/src/Inputs/Date/components/RangeCalendar.tsx b/packages/react/src/Date/components/RangeCalendar.tsx
similarity index 100%
rename from packages/react/src/Inputs/Date/components/RangeCalendar.tsx
rename to packages/react/src/Date/components/RangeCalendar.tsx
diff --git a/packages/react/src/Inputs/Date/components/StyledField.tsx b/packages/react/src/Date/components/StyledField.tsx
similarity index 100%
rename from packages/react/src/Inputs/Date/components/StyledField.tsx
rename to packages/react/src/Date/components/StyledField.tsx
diff --git a/packages/react/src/Inputs/Date/index.ts b/packages/react/src/Date/index.ts
similarity index 100%
rename from packages/react/src/Inputs/Date/index.ts
rename to packages/react/src/Date/index.ts
diff --git a/packages/react/src/Dot/Dot.tsx b/packages/react/src/Dot.tsx
similarity index 95%
rename from packages/react/src/Dot/Dot.tsx
rename to packages/react/src/Dot.tsx
index 87aba6ff85..1b75bb8708 100644
--- a/packages/react/src/Dot/Dot.tsx
+++ b/packages/react/src/Dot.tsx
@@ -23,4 +23,4 @@ const Dot = ({ color, size = 3, title, ...props }: DotProps) => {
);
};
-export default Dot;
+export { Dot };
diff --git a/packages/react/src/Dot/index.ts b/packages/react/src/Dot/index.ts
deleted file mode 100644
index 95c3a69d6a..0000000000
--- a/packages/react/src/Dot/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import Dot from "./Dot";
-
-export default Dot;
diff --git a/packages/react/src/Inputs/Editor/Editor.tsx b/packages/react/src/Editor/Editor.tsx
similarity index 100%
rename from packages/react/src/Inputs/Editor/Editor.tsx
rename to packages/react/src/Editor/Editor.tsx
diff --git a/packages/react/src/Inputs/Editor/Toolbar/BlockQuote.tsx b/packages/react/src/Editor/Toolbar/BlockQuote.tsx
similarity index 100%
rename from packages/react/src/Inputs/Editor/Toolbar/BlockQuote.tsx
rename to packages/react/src/Editor/Toolbar/BlockQuote.tsx
diff --git a/packages/react/src/Inputs/Editor/Toolbar/Bold.tsx b/packages/react/src/Editor/Toolbar/Bold.tsx
similarity index 100%
rename from packages/react/src/Inputs/Editor/Toolbar/Bold.tsx
rename to packages/react/src/Editor/Toolbar/Bold.tsx
diff --git a/packages/react/src/Inputs/Editor/Toolbar/Code.tsx b/packages/react/src/Editor/Toolbar/Code.tsx
similarity index 100%
rename from packages/react/src/Inputs/Editor/Toolbar/Code.tsx
rename to packages/react/src/Editor/Toolbar/Code.tsx
diff --git a/packages/react/src/Inputs/Editor/Toolbar/CodeBlock.tsx b/packages/react/src/Editor/Toolbar/CodeBlock.tsx
similarity index 100%
rename from packages/react/src/Inputs/Editor/Toolbar/CodeBlock.tsx
rename to packages/react/src/Editor/Toolbar/CodeBlock.tsx
diff --git a/packages/react/src/Inputs/Editor/Toolbar/Heading.tsx b/packages/react/src/Editor/Toolbar/Heading.tsx
similarity index 100%
rename from packages/react/src/Inputs/Editor/Toolbar/Heading.tsx
rename to packages/react/src/Editor/Toolbar/Heading.tsx
diff --git a/packages/react/src/Inputs/Editor/Toolbar/HorizontalRule.tsx b/packages/react/src/Editor/Toolbar/HorizontalRule.tsx
similarity index 100%
rename from packages/react/src/Inputs/Editor/Toolbar/HorizontalRule.tsx
rename to packages/react/src/Editor/Toolbar/HorizontalRule.tsx
diff --git a/packages/react/src/Inputs/Editor/Toolbar/Italic.tsx b/packages/react/src/Editor/Toolbar/Italic.tsx
similarity index 100%
rename from packages/react/src/Inputs/Editor/Toolbar/Italic.tsx
rename to packages/react/src/Editor/Toolbar/Italic.tsx
diff --git a/packages/react/src/Inputs/Editor/Toolbar/OrderedList.tsx b/packages/react/src/Editor/Toolbar/OrderedList.tsx
similarity index 100%
rename from packages/react/src/Inputs/Editor/Toolbar/OrderedList.tsx
rename to packages/react/src/Editor/Toolbar/OrderedList.tsx
diff --git a/packages/react/src/Inputs/Editor/Toolbar/Paragraph.tsx b/packages/react/src/Editor/Toolbar/Paragraph.tsx
similarity index 100%
rename from packages/react/src/Inputs/Editor/Toolbar/Paragraph.tsx
rename to packages/react/src/Editor/Toolbar/Paragraph.tsx
diff --git a/packages/react/src/Inputs/Editor/Toolbar/Strike.tsx b/packages/react/src/Editor/Toolbar/Strike.tsx
similarity index 100%
rename from packages/react/src/Inputs/Editor/Toolbar/Strike.tsx
rename to packages/react/src/Editor/Toolbar/Strike.tsx
diff --git a/packages/react/src/Inputs/Editor/Toolbar/Toolbar.tsx b/packages/react/src/Editor/Toolbar/Toolbar.tsx
similarity index 100%
rename from packages/react/src/Inputs/Editor/Toolbar/Toolbar.tsx
rename to packages/react/src/Editor/Toolbar/Toolbar.tsx
diff --git a/packages/react/src/Inputs/Editor/Toolbar/ToolbarButton.tsx b/packages/react/src/Editor/Toolbar/ToolbarButton.tsx
similarity index 100%
rename from packages/react/src/Inputs/Editor/Toolbar/ToolbarButton.tsx
rename to packages/react/src/Editor/Toolbar/ToolbarButton.tsx
diff --git a/packages/react/src/Inputs/Editor/Toolbar/UnorderedList.tsx b/packages/react/src/Editor/Toolbar/UnorderedList.tsx
similarity index 100%
rename from packages/react/src/Inputs/Editor/Toolbar/UnorderedList.tsx
rename to packages/react/src/Editor/Toolbar/UnorderedList.tsx
diff --git a/packages/react/src/Inputs/Editor/Toolbar/index.ts b/packages/react/src/Editor/Toolbar/index.ts
similarity index 100%
rename from packages/react/src/Inputs/Editor/Toolbar/index.ts
rename to packages/react/src/Editor/Toolbar/index.ts
diff --git a/packages/react/src/Inputs/Editor/index.tsx b/packages/react/src/Editor/index.tsx
similarity index 100%
rename from packages/react/src/Inputs/Editor/index.tsx
rename to packages/react/src/Editor/index.tsx
diff --git a/packages/react/src/Inputs/Editor/types.ts b/packages/react/src/Editor/types.ts
similarity index 100%
rename from packages/react/src/Inputs/Editor/types.ts
rename to packages/react/src/Editor/types.ts
diff --git a/packages/react/src/Inputs/File/File.tsx b/packages/react/src/File.tsx
similarity index 97%
rename from packages/react/src/Inputs/File/File.tsx
rename to packages/react/src/File.tsx
index 884d3e397d..b8bfb1f1f1 100644
--- a/packages/react/src/Inputs/File/File.tsx
+++ b/packages/react/src/File.tsx
@@ -36,4 +36,4 @@ const File = ({ accept, children, onChange, ...props }: FileProps) => {
);
};
-export default File;
+export { File };
diff --git a/packages/react/src/HTML/HTML.tsx b/packages/react/src/HTML.tsx
similarity index 89%
rename from packages/react/src/HTML/HTML.tsx
rename to packages/react/src/HTML.tsx
index 9acfabdff6..588fb5d96d 100644
--- a/packages/react/src/HTML/HTML.tsx
+++ b/packages/react/src/HTML.tsx
@@ -1,7 +1,7 @@
import { Box } from "@chakra-ui/react";
import { sanitize } from "dompurify";
import { useMemo } from "react";
-import { reset } from "../Theme";
+import { reset } from "./Theme";
type HTMLProps = {
text: string;
@@ -25,4 +25,4 @@ const HTML = ({ text }: HTMLProps) => {
);
};
-export default HTML;
+export { HTML };
diff --git a/packages/react/src/HTML/index.ts b/packages/react/src/HTML/index.ts
deleted file mode 100644
index aaca7f0cc7..0000000000
--- a/packages/react/src/HTML/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import HTML from "./HTML";
-
-export default HTML;
diff --git a/packages/react/src/Heading.tsx b/packages/react/src/Heading.tsx
index e97deb1b69..29224b3250 100644
--- a/packages/react/src/Heading.tsx
+++ b/packages/react/src/Heading.tsx
@@ -5,32 +5,35 @@ import { forwardRef } from "react";
import { cn } from "~/utils/cn";
-const headingVariants = cva("text-foreground font-bold tracking-tight", {
- variants: {
- size: {
- display: "md:text-5xl text-4xl",
- h1: "md:text-3xl text-2xl",
- h2: "md:text-2xl text-xl",
- h3: "md:text-xl text-base",
- h4: "md:text-base text-sm",
+const headingVariants = cva(
+ "font-semibold leading-none tracking-tight text-foreground",
+ {
+ variants: {
+ size: {
+ display: "md:text-5xl text-4xl",
+ h1: "md:text-3xl text-2xl",
+ h2: "md:text-2xl text-xl",
+ h3: "md:text-xl text-base",
+ h4: "md:text-base text-sm",
+ },
+ noOfLines: {
+ 1: "line-clamp-1",
+ 2: "line-clamp-2",
+ 3: "line-clamp-3",
+ 4: "line-clamp-4",
+ 5: "line-clamp-5",
+ 6: "line-clamp-6",
+ 7: "line-clamp-7",
+ 8: "line-clamp-8",
+ 9: "line-clamp-9",
+ 10: "line-clamp-10",
+ },
},
- noOfLines: {
- 1: "line-clamp-1",
- 2: "line-clamp-2",
- 3: "line-clamp-3",
- 4: "line-clamp-4",
- 5: "line-clamp-5",
- 6: "line-clamp-6",
- 7: "line-clamp-7",
- 8: "line-clamp-8",
- 9: "line-clamp-9",
- 10: "line-clamp-10",
+ defaultVariants: {
+ size: "h2",
},
- },
- defaultVariants: {
- size: "h2",
- },
-});
+ }
+);
export interface HeadingProps
extends ComponentProps<"h2">,
diff --git a/packages/react/src/Inputs/File/index.ts b/packages/react/src/Inputs/File/index.ts
deleted file mode 100644
index 6c405123f0..0000000000
--- a/packages/react/src/Inputs/File/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import File from "./File";
-
-export default File;
diff --git a/packages/react/src/Inputs/Phone/countries.json b/packages/react/src/Inputs/Phone/countries.json
deleted file mode 100644
index 994472be45..0000000000
--- a/packages/react/src/Inputs/Phone/countries.json
+++ /dev/null
@@ -1,473 +0,0 @@
-[
- { "name": "Afghanistan", "flag": "🇦🇫", "code": "AF", "dial_code": "+93" },
- { "name": "Åland Islands", "flag": "🇦🇽", "code": "AX", "dial_code": "+358" },
- { "name": "Albania", "flag": "🇦🇱", "code": "AL", "dial_code": "+355" },
- { "name": "Algeria", "flag": "🇩🇿", "code": "DZ", "dial_code": "+213" },
- {
- "name": "American Samoa",
- "flag": "🇦🇸",
- "code": "AS",
- "dial_code": "+1684"
- },
- { "name": "Andorra", "flag": "🇦🇩", "code": "AD", "dial_code": "+376" },
- { "name": "Angola", "flag": "🇦🇴", "code": "AO", "dial_code": "+244" },
- { "name": "Anguilla", "flag": "🇦🇮", "code": "AI", "dial_code": "+1264" },
- { "name": "Antarctica", "flag": "🇦🇶", "code": "AQ", "dial_code": "+672" },
- {
- "name": "Antigua and Barbuda",
- "flag": "🇦🇬",
- "code": "AG",
- "dial_code": "+1268"
- },
- { "name": "Argentina", "flag": "🇦🇷", "code": "AR", "dial_code": "+54" },
- { "name": "Armenia", "flag": "🇦🇲", "code": "AM", "dial_code": "+374" },
- { "name": "Aruba", "flag": "🇦🇼", "code": "AW", "dial_code": "+297" },
- { "name": "Australia", "flag": "🇦🇺", "code": "AU", "dial_code": "+61" },
- { "name": "Austria", "flag": "🇦🇹", "code": "AT", "dial_code": "+43" },
- { "name": "Azerbaijan", "flag": "🇦🇿", "code": "AZ", "dial_code": "+994" },
- { "name": "Bahamas", "flag": "🇧🇸", "code": "BS", "dial_code": "+1242" },
- { "name": "Bahrain", "flag": "🇧🇭", "code": "BH", "dial_code": "+973" },
- { "name": "Bangladesh", "flag": "🇧🇩", "code": "BD", "dial_code": "+880" },
- { "name": "Barbados", "flag": "🇧🇧", "code": "BB", "dial_code": "+1246" },
- { "name": "Belarus", "flag": "🇧🇾", "code": "BY", "dial_code": "+375" },
- { "name": "Belgium", "flag": "🇧🇪", "code": "BE", "dial_code": "+32" },
- { "name": "Belize", "flag": "🇧🇿", "code": "BZ", "dial_code": "+501" },
- { "name": "Benin", "flag": "🇧🇯", "code": "BJ", "dial_code": "+229" },
- { "name": "Bermuda", "flag": "🇧🇲", "code": "BM", "dial_code": "+1441" },
- { "name": "Bhutan", "flag": "🇧🇹", "code": "BT", "dial_code": "+975" },
- {
- "name": "Bolivia, Plurinational State of bolivia",
- "flag": "🇧🇴",
- "code": "BO",
- "dial_code": "+591"
- },
- {
- "name": "Bosnia and Herzegovina",
- "flag": "🇧🇦",
- "code": "BA",
- "dial_code": "+387"
- },
- { "name": "Botswana", "flag": "🇧🇼", "code": "BW", "dial_code": "+267" },
- { "name": "Bouvet Island", "flag": "🇧🇻", "code": "BV", "dial_code": "+47" },
- { "name": "Brazil", "flag": "🇧🇷", "code": "BR", "dial_code": "+55" },
- {
- "name": "British Indian Ocean Territory",
- "flag": "🇮🇴",
- "code": "IO",
- "dial_code": "+246"
- },
- {
- "name": "Brunei Darussalam",
- "flag": "🇧🇳",
- "code": "BN",
- "dial_code": "+673"
- },
- { "name": "Bulgaria", "flag": "🇧🇬", "code": "BG", "dial_code": "+359" },
- { "name": "Burkina Faso", "flag": "🇧🇫", "code": "BF", "dial_code": "+226" },
- { "name": "Burundi", "flag": "🇧🇮", "code": "BI", "dial_code": "+257" },
- { "name": "Cambodia", "flag": "🇰🇭", "code": "KH", "dial_code": "+855" },
- { "name": "Cameroon", "flag": "🇨🇲", "code": "CM", "dial_code": "+237" },
- { "name": "Canada", "flag": "🇨🇦", "code": "CA", "dial_code": "+1" },
- { "name": "Cape Verde", "flag": "🇨🇻", "code": "CV", "dial_code": "+238" },
- { "name": "Cayman Islands", "flag": "🇰🇾", "code": "KY", "dial_code": "+345" },
- {
- "name": "Central African Republic",
- "flag": "🇨🇫",
- "code": "CF",
- "dial_code": "+236"
- },
- { "name": "Chad", "flag": "🇹🇩", "code": "TD", "dial_code": "+235" },
- { "name": "Chile", "flag": "🇨🇱", "code": "CL", "dial_code": "+56" },
- { "name": "China", "flag": "🇨🇳", "code": "CN", "dial_code": "+86" },
- {
- "name": "Christmas Island",
- "flag": "🇨🇽",
- "code": "CX",
- "dial_code": "+61"
- },
- {
- "name": "Cocos (Keeling) Islands",
- "flag": "🇨🇨",
- "code": "CC",
- "dial_code": "+61"
- },
- { "name": "Colombia", "flag": "🇨🇴", "code": "CO", "dial_code": "+57" },
- { "name": "Comoros", "flag": "🇰🇲", "code": "KM", "dial_code": "+269" },
- { "name": "Congo", "flag": "🇨🇬", "code": "CG", "dial_code": "+242" },
- {
- "name": "Congo, The Democratic Republic of the Congo",
- "flag": "🇨🇩",
- "code": "CD",
- "dial_code": "+243"
- },
- { "name": "Cook Islands", "flag": "🇨🇰", "code": "CK", "dial_code": "+682" },
- { "name": "Costa Rica", "flag": "🇨🇷", "code": "CR", "dial_code": "+506" },
- { "name": "Cote d'Ivoire", "flag": "🇨🇮", "code": "CI", "dial_code": "+225" },
- { "name": "Croatia", "flag": "🇭🇷", "code": "HR", "dial_code": "+385" },
- { "name": "Cuba", "flag": "🇨🇺", "code": "CU", "dial_code": "+53" },
- { "name": "Cyprus", "flag": "🇨🇾", "code": "CY", "dial_code": "+357" },
- { "name": "Czech Republic", "flag": "🇨🇿", "code": "CZ", "dial_code": "+420" },
- { "name": "Denmark", "flag": "🇩🇰", "code": "DK", "dial_code": "+45" },
- { "name": "Djibouti", "flag": "🇩🇯", "code": "DJ", "dial_code": "+253" },
- { "name": "Dominica", "flag": "🇩🇲", "code": "DM", "dial_code": "+1767" },
- {
- "name": "Dominican Republic",
- "flag": "🇩🇴",
- "code": "DO",
- "dial_code": "+1849"
- },
- { "name": "Ecuador", "flag": "🇪🇨", "code": "EC", "dial_code": "+593" },
- { "name": "Egypt", "flag": "🇪🇬", "code": "EG", "dial_code": "+20" },
- { "name": "El Salvador", "flag": "🇸🇻", "code": "SV", "dial_code": "+503" },
- {
- "name": "Equatorial Guinea",
- "flag": "🇬🇶",
- "code": "GQ",
- "dial_code": "+240"
- },
- { "name": "Eritrea", "flag": "🇪🇷", "code": "ER", "dial_code": "+291" },
- { "name": "Estonia", "flag": "🇪🇪", "code": "EE", "dial_code": "+372" },
- { "name": "Ethiopia", "flag": "🇪🇹", "code": "ET", "dial_code": "+251" },
- {
- "name": "Falkland Islands (Malvinas)",
- "flag": "🇫🇰",
- "code": "FK",
- "dial_code": "+500"
- },
- { "name": "Faroe Islands", "flag": "🇫🇴", "code": "FO", "dial_code": "+298" },
- { "name": "Fiji", "flag": "🇫🇯", "code": "FJ", "dial_code": "+679" },
- { "name": "Finland", "flag": "🇫🇮", "code": "FI", "dial_code": "+358" },
- { "name": "France", "flag": "🇫🇷", "code": "FR", "dial_code": "+33" },
- { "name": "French Guiana", "flag": "🇬🇫", "code": "GF", "dial_code": "+594" },
- {
- "name": "French Polynesia",
- "flag": "🇵🇫",
- "code": "PF",
- "dial_code": "+689"
- },
- {
- "name": "French Southern Territories",
- "flag": "🇹🇫",
- "code": "TF",
- "dial_code": "+262"
- },
- { "name": "Gabon", "flag": "🇬🇦", "code": "GA", "dial_code": "+241" },
- { "name": "Gambia", "flag": "🇬🇲", "code": "GM", "dial_code": "+220" },
- { "name": "Georgia", "flag": "🇬🇪", "code": "GE", "dial_code": "+995" },
- { "name": "Germany", "flag": "🇩🇪", "code": "DE", "dial_code": "+49" },
- { "name": "Ghana", "flag": "🇬🇭", "code": "GH", "dial_code": "+233" },
- { "name": "Gibraltar", "flag": "🇬🇮", "code": "GI", "dial_code": "+350" },
- { "name": "Greece", "flag": "🇬🇷", "code": "GR", "dial_code": "+30" },
- { "name": "Greenland", "flag": "🇬🇱", "code": "GL", "dial_code": "+299" },
- { "name": "Grenada", "flag": "🇬🇩", "code": "GD", "dial_code": "+1473" },
- { "name": "Guadeloupe", "flag": "🇬🇵", "code": "GP", "dial_code": "+590" },
- { "name": "Guam", "flag": "🇬🇺", "code": "GU", "dial_code": "+1671" },
- { "name": "Guatemala", "flag": "🇬🇹", "code": "GT", "dial_code": "+502" },
- { "name": "Guernsey", "flag": "🇬🇬", "code": "GG", "dial_code": "+44" },
- { "name": "Guinea", "flag": "🇬🇳", "code": "GN", "dial_code": "+224" },
- { "name": "Guinea-Bissau", "flag": "🇬🇼", "code": "GW", "dial_code": "+245" },
- { "name": "Guyana", "flag": "🇬🇾", "code": "GY", "dial_code": "+592" },
- { "name": "Haiti", "flag": "🇭🇹", "code": "HT", "dial_code": "+509" },
- {
- "name": "Heard Island and Mcdonald Islands",
- "flag": "🇭🇲",
- "code": "HM",
- "dial_code": "+672"
- },
- {
- "name": "Holy See (Vatican City State)",
- "flag": "🇻🇦",
- "code": "VA",
- "dial_code": "+379"
- },
- { "name": "Honduras", "flag": "🇭🇳", "code": "HN", "dial_code": "+504" },
- { "name": "Hong Kong", "flag": "🇭🇰", "code": "HK", "dial_code": "+852" },
- { "name": "Hungary", "flag": "🇭🇺", "code": "HU", "dial_code": "+36" },
- { "name": "Iceland", "flag": "🇮🇸", "code": "IS", "dial_code": "+354" },
- { "name": "India", "flag": "🇮🇳", "code": "IN", "dial_code": "+91" },
- { "name": "Indonesia", "flag": "🇮🇩", "code": "ID", "dial_code": "+62" },
- {
- "name": "Iran, Islamic Republic of Persian Gulf",
- "flag": "🇮🇷",
- "code": "IR",
- "dial_code": "+98"
- },
- { "name": "Iraq", "flag": "🇮🇶", "code": "IQ", "dial_code": "+964" },
- { "name": "Ireland", "flag": "🇮🇪", "code": "IE", "dial_code": "+353" },
- { "name": "Isle of Man", "flag": "🇮🇲", "code": "IM", "dial_code": "+44" },
- { "name": "Israel", "flag": "🇮🇱", "code": "IL", "dial_code": "+972" },
- { "name": "Italy", "flag": "🇮🇹", "code": "IT", "dial_code": "+39" },
- { "name": "Jamaica", "flag": "🇯🇲", "code": "JM", "dial_code": "+1876" },
- { "name": "Japan", "flag": "🇯🇵", "code": "JP", "dial_code": "+81" },
- { "name": "Jersey", "flag": "🇯🇪", "code": "JE", "dial_code": "+44" },
- { "name": "Jordan", "flag": "🇯🇴", "code": "JO", "dial_code": "+962" },
- { "name": "Kazakhstan", "flag": "🇰🇿", "code": "KZ", "dial_code": "+7" },
- { "name": "Kenya", "flag": "🇰🇪", "code": "KE", "dial_code": "+254" },
- { "name": "Kiribati", "flag": "🇰🇮", "code": "KI", "dial_code": "+686" },
- {
- "name": "Korea, Democratic People's Republic of Korea",
- "flag": "🇰🇵",
- "code": "KP",
- "dial_code": "+850"
- },
- {
- "name": "Korea, Republic of South Korea",
- "flag": "🇰🇷",
- "code": "KR",
- "dial_code": "+82"
- },
- { "name": "Kosovo", "flag": "🇽🇰", "code": "XK", "dial_code": "+383" },
- { "name": "Kuwait", "flag": "🇰🇼", "code": "KW", "dial_code": "+965" },
- { "name": "Kyrgyzstan", "flag": "🇰🇬", "code": "KG", "dial_code": "+996" },
- { "name": "Laos", "flag": "🇱🇦", "code": "LA", "dial_code": "+856" },
- { "name": "Latvia", "flag": "🇱🇻", "code": "LV", "dial_code": "+371" },
- { "name": "Lebanon", "flag": "🇱🇧", "code": "LB", "dial_code": "+961" },
- { "name": "Lesotho", "flag": "🇱🇸", "code": "LS", "dial_code": "+266" },
- { "name": "Liberia", "flag": "🇱🇷", "code": "LR", "dial_code": "+231" },
- {
- "name": "Libyan Arab Jamahiriya",
- "flag": "🇱🇾",
- "code": "LY",
- "dial_code": "+218"
- },
- { "name": "Liechtenstein", "flag": "🇱🇮", "code": "LI", "dial_code": "+423" },
- { "name": "Lithuania", "flag": "🇱🇹", "code": "LT", "dial_code": "+370" },
- { "name": "Luxembourg", "flag": "🇱🇺", "code": "LU", "dial_code": "+352" },
- { "name": "Macao", "flag": "🇲🇴", "code": "MO", "dial_code": "+853" },
- { "name": "Macedonia", "flag": "🇲🇰", "code": "MK", "dial_code": "+389" },
- { "name": "Madagascar", "flag": "🇲🇬", "code": "MG", "dial_code": "+261" },
- { "name": "Malawi", "flag": "🇲🇼", "code": "MW", "dial_code": "+265" },
- { "name": "Malaysia", "flag": "🇲🇾", "code": "MY", "dial_code": "+60" },
- { "name": "Maldives", "flag": "🇲🇻", "code": "MV", "dial_code": "+960" },
- { "name": "Mali", "flag": "🇲🇱", "code": "ML", "dial_code": "+223" },
- { "name": "Malta", "flag": "🇲🇹", "code": "MT", "dial_code": "+356" },
- {
- "name": "Marshall Islands",
- "flag": "🇲🇭",
- "code": "MH",
- "dial_code": "+692"
- },
- { "name": "Martinique", "flag": "🇲🇶", "code": "MQ", "dial_code": "+596" },
- { "name": "Mauritania", "flag": "🇲🇷", "code": "MR", "dial_code": "+222" },
- { "name": "Mauritius", "flag": "🇲🇺", "code": "MU", "dial_code": "+230" },
- { "name": "Mayotte", "flag": "🇾🇹", "code": "YT", "dial_code": "+262" },
- { "name": "Mexico", "flag": "🇲🇽", "code": "MX", "dial_code": "+52" },
- {
- "name": "Micronesia, Federated States of Micronesia",
- "flag": "🇫🇲",
- "code": "FM",
- "dial_code": "+691"
- },
- { "name": "Moldova", "flag": "🇲🇩", "code": "MD", "dial_code": "+373" },
- { "name": "Monaco", "flag": "🇲🇨", "code": "MC", "dial_code": "+377" },
- { "name": "Mongolia", "flag": "🇲🇳", "code": "MN", "dial_code": "+976" },
- { "name": "Montenegro", "flag": "🇲🇪", "code": "ME", "dial_code": "+382" },
- { "name": "Montserrat", "flag": "🇲🇸", "code": "MS", "dial_code": "+1664" },
- { "name": "Morocco", "flag": "🇲🇦", "code": "MA", "dial_code": "+212" },
- { "name": "Mozambique", "flag": "🇲🇿", "code": "MZ", "dial_code": "+258" },
- { "name": "Myanmar", "flag": "🇲🇲", "code": "MM", "dial_code": "+95" },
- { "name": "Namibia", "flag": "🇳🇦", "code": "NA", "dial_code": "+264" },
- { "name": "Nauru", "flag": "🇳🇷", "code": "NR", "dial_code": "+674" },
- { "name": "Nepal", "flag": "🇳🇵", "code": "NP", "dial_code": "+977" },
- { "name": "Netherlands", "flag": "🇳🇱", "code": "NL", "dial_code": "+31" },
- {
- "name": "Netherlands Antilles",
- "flag": "",
- "code": "AN",
- "dial_code": "+599"
- },
- { "name": "New Caledonia", "flag": "🇳🇨", "code": "NC", "dial_code": "+687" },
- { "name": "New Zealand", "flag": "🇳🇿", "code": "NZ", "dial_code": "+64" },
- { "name": "Nicaragua", "flag": "🇳🇮", "code": "NI", "dial_code": "+505" },
- { "name": "Niger", "flag": "🇳🇪", "code": "NE", "dial_code": "+227" },
- { "name": "Nigeria", "flag": "🇳🇬", "code": "NG", "dial_code": "+234" },
- { "name": "Niue", "flag": "🇳🇺", "code": "NU", "dial_code": "+683" },
- { "name": "Norfolk Island", "flag": "🇳🇫", "code": "NF", "dial_code": "+672" },
- {
- "name": "Northern Mariana Islands",
- "flag": "🇲🇵",
- "code": "MP",
- "dial_code": "+1670"
- },
- { "name": "Norway", "flag": "🇳🇴", "code": "NO", "dial_code": "+47" },
- { "name": "Oman", "flag": "🇴🇲", "code": "OM", "dial_code": "+968" },
- { "name": "Pakistan", "flag": "🇵🇰", "code": "PK", "dial_code": "+92" },
- { "name": "Palau", "flag": "🇵🇼", "code": "PW", "dial_code": "+680" },
- {
- "name": "Palestinian Territory, Occupied",
- "flag": "🇵🇸",
- "code": "PS",
- "dial_code": "+970"
- },
- { "name": "Panama", "flag": "🇵🇦", "code": "PA", "dial_code": "+507" },
- {
- "name": "Papua New Guinea",
- "flag": "🇵🇬",
- "code": "PG",
- "dial_code": "+675"
- },
- { "name": "Paraguay", "flag": "🇵🇾", "code": "PY", "dial_code": "+595" },
- { "name": "Peru", "flag": "🇵🇪", "code": "PE", "dial_code": "+51" },
- { "name": "Philippines", "flag": "🇵🇭", "code": "PH", "dial_code": "+63" },
- { "name": "Pitcairn", "flag": "🇵🇳", "code": "PN", "dial_code": "+64" },
- { "name": "Poland", "flag": "🇵🇱", "code": "PL", "dial_code": "+48" },
- { "name": "Portugal", "flag": "🇵🇹", "code": "PT", "dial_code": "+351" },
- { "name": "Puerto Rico", "flag": "🇵🇷", "code": "PR", "dial_code": "+1939" },
- { "name": "Qatar", "flag": "🇶🇦", "code": "QA", "dial_code": "+974" },
- { "name": "Romania", "flag": "🇷🇴", "code": "RO", "dial_code": "+40" },
- { "name": "Russia", "flag": "🇷🇺", "code": "RU", "dial_code": "+7" },
- { "name": "Rwanda", "flag": "🇷🇼", "code": "RW", "dial_code": "+250" },
- { "name": "Reunion", "flag": "🇷🇪", "code": "RE", "dial_code": "+262" },
- {
- "name": "Saint Barthelemy",
- "flag": "🇧🇱",
- "code": "BL",
- "dial_code": "+590"
- },
- {
- "name": "Saint Helena, Ascension and Tristan Da Cunha",
- "flag": "🇸🇭",
- "code": "SH",
- "dial_code": "+290"
- },
- {
- "name": "Saint Kitts and Nevis",
- "flag": "🇰🇳",
- "code": "KN",
- "dial_code": "+1869"
- },
- { "name": "Saint Lucia", "flag": "🇱🇨", "code": "LC", "dial_code": "+1758" },
- { "name": "Saint Martin", "flag": "🇲🇫", "code": "MF", "dial_code": "+590" },
- {
- "name": "Saint Pierre and Miquelon",
- "flag": "🇵🇲",
- "code": "PM",
- "dial_code": "+508"
- },
- {
- "name": "Saint Vincent and the Grenadines",
- "flag": "🇻🇨",
- "code": "VC",
- "dial_code": "+1784"
- },
- { "name": "Samoa", "flag": "🇼🇸", "code": "WS", "dial_code": "+685" },
- { "name": "San Marino", "flag": "🇸🇲", "code": "SM", "dial_code": "+378" },
- {
- "name": "Sao Tome and Principe",
- "flag": "🇸🇹",
- "code": "ST",
- "dial_code": "+239"
- },
- { "name": "Saudi Arabia", "flag": "🇸🇦", "code": "SA", "dial_code": "+966" },
- { "name": "Senegal", "flag": "🇸🇳", "code": "SN", "dial_code": "+221" },
- { "name": "Serbia", "flag": "🇷🇸", "code": "RS", "dial_code": "+381" },
- { "name": "Seychelles", "flag": "🇸🇨", "code": "SC", "dial_code": "+248" },
- { "name": "Sierra Leone", "flag": "🇸🇱", "code": "SL", "dial_code": "+232" },
- { "name": "Singapore", "flag": "🇸🇬", "code": "SG", "dial_code": "+65" },
- { "name": "Slovakia", "flag": "🇸🇰", "code": "SK", "dial_code": "+421" },
- { "name": "Slovenia", "flag": "🇸🇮", "code": "SI", "dial_code": "+386" },
- {
- "name": "Solomon Islands",
- "flag": "🇸🇧",
- "code": "SB",
- "dial_code": "+677"
- },
- { "name": "Somalia", "flag": "🇸🇴", "code": "SO", "dial_code": "+252" },
- { "name": "South Africa", "flag": "🇿🇦", "code": "ZA", "dial_code": "+27" },
- { "name": "South Sudan", "flag": "🇸🇸", "code": "SS", "dial_code": "+211" },
- {
- "name": "South Georgia and the South Sandwich Islands",
- "flag": "🇬🇸",
- "code": "GS",
- "dial_code": "+500"
- },
- { "name": "Spain", "flag": "🇪🇸", "code": "ES", "dial_code": "+34" },
- { "name": "Sri Lanka", "flag": "🇱🇰", "code": "LK", "dial_code": "+94" },
- { "name": "Sudan", "flag": "🇸🇩", "code": "SD", "dial_code": "+249" },
- { "name": "Suriname", "flag": "🇸🇷", "code": "SR", "dial_code": "+597" },
- {
- "name": "Svalbard and Jan Mayen",
- "flag": "🇸🇯",
- "code": "SJ",
- "dial_code": "+47"
- },
- { "name": "Swaziland", "flag": "🇸🇿", "code": "SZ", "dial_code": "+268" },
- { "name": "Sweden", "flag": "🇸🇪", "code": "SE", "dial_code": "+46" },
- { "name": "Switzerland", "flag": "🇨🇭", "code": "CH", "dial_code": "+41" },
- {
- "name": "Syrian Arab Republic",
- "flag": "🇸🇾",
- "code": "SY",
- "dial_code": "+963"
- },
- { "name": "Taiwan", "flag": "🇹🇼", "code": "TW", "dial_code": "+886" },
- { "name": "Tajikistan", "flag": "🇹🇯", "code": "TJ", "dial_code": "+992" },
- {
- "name": "Tanzania, United Republic of Tanzania",
- "flag": "🇹🇿",
- "code": "TZ",
- "dial_code": "+255"
- },
- { "name": "Thailand", "flag": "🇹🇭", "code": "TH", "dial_code": "+66" },
- { "name": "Timor-Leste", "flag": "🇹🇱", "code": "TL", "dial_code": "+670" },
- { "name": "Togo", "flag": "🇹🇬", "code": "TG", "dial_code": "+228" },
- { "name": "Tokelau", "flag": "🇹🇰", "code": "TK", "dial_code": "+690" },
- { "name": "Tonga", "flag": "🇹🇴", "code": "TO", "dial_code": "+676" },
- {
- "name": "Trinidad and Tobago",
- "flag": "🇹🇹",
- "code": "TT",
- "dial_code": "+1868"
- },
- { "name": "Tunisia", "flag": "🇹🇳", "code": "TN", "dial_code": "+216" },
- { "name": "Turkey", "flag": "🇹🇷", "code": "TR", "dial_code": "+90" },
- { "name": "Turkmenistan", "flag": "🇹🇲", "code": "TM", "dial_code": "+993" },
- {
- "name": "Turks and Caicos Islands",
- "flag": "🇹🇨",
- "code": "TC",
- "dial_code": "+1649"
- },
- { "name": "Tuvalu", "flag": "🇹🇻", "code": "TV", "dial_code": "+688" },
- { "name": "Uganda", "flag": "🇺🇬", "code": "UG", "dial_code": "+256" },
- { "name": "Ukraine", "flag": "🇺🇦", "code": "UA", "dial_code": "+380" },
- {
- "name": "United Arab Emirates",
- "flag": "🇦🇪",
- "code": "AE",
- "dial_code": "+971"
- },
- { "name": "United Kingdom", "flag": "🇬🇧", "code": "GB", "dial_code": "+44" },
- { "name": "United States", "flag": "🇺🇸", "code": "US", "dial_code": "+1" },
- { "name": "Uruguay", "flag": "🇺🇾", "code": "UY", "dial_code": "+598" },
- { "name": "Uzbekistan", "flag": "🇺🇿", "code": "UZ", "dial_code": "+998" },
- { "name": "Vanuatu", "flag": "🇻🇺", "code": "VU", "dial_code": "+678" },
- {
- "name": "Venezuela, Bolivarian Republic of Venezuela",
- "flag": "🇻🇪",
- "code": "VE",
- "dial_code": "+58"
- },
- { "name": "Vietnam", "flag": "🇻🇳", "code": "VN", "dial_code": "+84" },
- {
- "name": "Virgin Islands, British",
- "flag": "🇻🇬",
- "code": "VG",
- "dial_code": "+1284"
- },
- {
- "name": "Virgin Islands, U.S.",
- "flag": "🇻🇮",
- "code": "VI",
- "dial_code": "+1340"
- },
- {
- "name": "Wallis and Futuna",
- "flag": "🇼🇫",
- "code": "WF",
- "dial_code": "+681"
- },
- { "name": "Yemen", "flag": "🇾🇪", "code": "YE", "dial_code": "+967" },
- { "name": "Zambia", "flag": "🇿🇲", "code": "ZM", "dial_code": "+260" },
- { "name": "Zimbabwe", "flag": "🇿🇼", "code": "ZW", "dial_code": "+263" }
-]
diff --git a/packages/react/src/Inputs/index.ts b/packages/react/src/Inputs/index.ts
deleted file mode 100644
index 186262761e..0000000000
--- a/packages/react/src/Inputs/index.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import type { GroupBase, OptionProps } from "react-select";
-import {
- DatePicker,
- DateRangePicker,
- DateTimePicker,
- TimePicker,
-} from "./Date";
-import { Editor, useEditor } from "./Editor";
-import File from "./File";
-import type { MultiValue, SingleValue } from "./Select";
-import { AsyncSelect, CreatableSelect, createFilter, Select } from "./Select";
-import type { OptionBase } from "./Select/types";
-
-export type { OptionBase, OptionProps, GroupBase, MultiValue, SingleValue };
-export {
- AsyncSelect,
- CreatableSelect,
- DatePicker,
- DateTimePicker,
- DateRangePicker,
- Editor,
- File,
- Select,
- TimePicker,
- createFilter,
- useEditor,
-};
diff --git a/packages/react/src/Loading/Loading.tsx b/packages/react/src/Loading.tsx
similarity index 87%
rename from packages/react/src/Loading/Loading.tsx
rename to packages/react/src/Loading.tsx
index 7b424f667a..c40a875e39 100644
--- a/packages/react/src/Loading/Loading.tsx
+++ b/packages/react/src/Loading.tsx
@@ -4,7 +4,7 @@ type LoadingProps = {
size?: "sm" | "md" | "lg" | "xl";
};
-export default function Loading({ size = "lg" }: LoadingProps) {
+export function Loading({ size = "lg" }: LoadingProps) {
const { colorMode } = useColorMode();
const emptyColor = colorMode !== "dark" ? "gray.200" : "whiteAlpha.300";
diff --git a/packages/react/src/Loading/index.ts b/packages/react/src/Loading/index.ts
deleted file mode 100644
index e1c0ccbd7b..0000000000
--- a/packages/react/src/Loading/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import Loading from "./Loading";
-
-export default Loading;
diff --git a/packages/react/src/Menu/index.ts b/packages/react/src/Menu/index.ts
deleted file mode 100644
index 44e02171c4..0000000000
--- a/packages/react/src/Menu/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { Menubar, MenubarItem, MenubarTrigger } from "./Menubar";
-
-export { Menubar, MenubarItem, MenubarTrigger };
diff --git a/packages/react/src/Menu/Menubar.tsx b/packages/react/src/Menubar.tsx
similarity index 100%
rename from packages/react/src/Menu/Menubar.tsx
rename to packages/react/src/Menubar.tsx
diff --git a/packages/react/src/Message/index.ts b/packages/react/src/Message/index.ts
deleted file mode 100644
index 7e102a77a9..0000000000
--- a/packages/react/src/Message/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-import useNotification from "./useNotification";
-export { useNotification };
diff --git a/packages/react/src/Overlay/ActionMenu/index.ts b/packages/react/src/Overlay/ActionMenu/index.ts
deleted file mode 100644
index ca361b6055..0000000000
--- a/packages/react/src/Overlay/ActionMenu/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import ActionMenu from "./ActionMenu";
-
-export default ActionMenu;
diff --git a/packages/react/src/Overlay/ContextMenu/index.ts b/packages/react/src/Overlay/ContextMenu/index.ts
deleted file mode 100644
index 1cff37db4f..0000000000
--- a/packages/react/src/Overlay/ContextMenu/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import ContextMenu from "./ContextMenu";
-
-export default ContextMenu;
diff --git a/packages/react/src/Overlay/index.ts b/packages/react/src/Overlay/index.ts
deleted file mode 100644
index b0a2cac8d0..0000000000
--- a/packages/react/src/Overlay/index.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-import ActionMenu from "./ActionMenu";
-import ContextMenu from "./ContextMenu";
-
-export { ActionMenu, ContextMenu };
diff --git a/packages/react/src/SSR/index.ts b/packages/react/src/SSR/index.ts
deleted file mode 100644
index 5c006f3ade..0000000000
--- a/packages/react/src/SSR/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import ClientOnly from "./ClientOnly";
-
-export { ClientOnly };
diff --git a/packages/react/src/Inputs/Select/chakra-components/containers.tsx b/packages/react/src/Select/chakra-components/containers.tsx
similarity index 100%
rename from packages/react/src/Inputs/Select/chakra-components/containers.tsx
rename to packages/react/src/Select/chakra-components/containers.tsx
diff --git a/packages/react/src/Inputs/Select/chakra-components/control.tsx b/packages/react/src/Select/chakra-components/control.tsx
similarity index 99%
rename from packages/react/src/Inputs/Select/chakra-components/control.tsx
rename to packages/react/src/Select/chakra-components/control.tsx
index b316b65ab7..b75ed1f0ce 100644
--- a/packages/react/src/Inputs/Select/chakra-components/control.tsx
+++ b/packages/react/src/Select/chakra-components/control.tsx
@@ -12,7 +12,7 @@ import type {
IndicatorSeparatorProps,
LoadingIndicatorProps,
} from "react-select";
-import { useColor } from "../../../hooks";
+import { useColor } from "../../hooks";
import type { SizeProps } from "../types";
import { useSize } from "../utils";
diff --git a/packages/react/src/Inputs/Select/chakra-components/index.tsx b/packages/react/src/Select/chakra-components/index.tsx
similarity index 100%
rename from packages/react/src/Inputs/Select/chakra-components/index.tsx
rename to packages/react/src/Select/chakra-components/index.tsx
diff --git a/packages/react/src/Inputs/Select/chakra-components/input.tsx b/packages/react/src/Select/chakra-components/input.tsx
similarity index 100%
rename from packages/react/src/Inputs/Select/chakra-components/input.tsx
rename to packages/react/src/Select/chakra-components/input.tsx
diff --git a/packages/react/src/Inputs/Select/chakra-components/menu.tsx b/packages/react/src/Select/chakra-components/menu.tsx
similarity index 100%
rename from packages/react/src/Inputs/Select/chakra-components/menu.tsx
rename to packages/react/src/Select/chakra-components/menu.tsx
diff --git a/packages/react/src/Inputs/Select/chakra-components/multi-value.tsx b/packages/react/src/Select/chakra-components/multi-value.tsx
similarity index 100%
rename from packages/react/src/Inputs/Select/chakra-components/multi-value.tsx
rename to packages/react/src/Select/chakra-components/multi-value.tsx
diff --git a/packages/react/src/Inputs/Select/chakra-components/placeholder.tsx b/packages/react/src/Select/chakra-components/placeholder.tsx
similarity index 100%
rename from packages/react/src/Inputs/Select/chakra-components/placeholder.tsx
rename to packages/react/src/Select/chakra-components/placeholder.tsx
diff --git a/packages/react/src/Inputs/Select/chakra-components/single-value.tsx b/packages/react/src/Select/chakra-components/single-value.tsx
similarity index 100%
rename from packages/react/src/Inputs/Select/chakra-components/single-value.tsx
rename to packages/react/src/Select/chakra-components/single-value.tsx
diff --git a/packages/react/src/Inputs/Select/index.ts b/packages/react/src/Select/index.ts
similarity index 100%
rename from packages/react/src/Inputs/Select/index.ts
rename to packages/react/src/Select/index.ts
diff --git a/packages/react/src/Inputs/Select/module-augmentation.ts b/packages/react/src/Select/module-augmentation.ts
similarity index 100%
rename from packages/react/src/Inputs/Select/module-augmentation.ts
rename to packages/react/src/Select/module-augmentation.ts
diff --git a/packages/react/src/Inputs/Select/select/async-creatable-select.tsx b/packages/react/src/Select/select/async-creatable-select.tsx
similarity index 100%
rename from packages/react/src/Inputs/Select/select/async-creatable-select.tsx
rename to packages/react/src/Select/select/async-creatable-select.tsx
diff --git a/packages/react/src/Inputs/Select/select/async-select.tsx b/packages/react/src/Select/select/async-select.tsx
similarity index 100%
rename from packages/react/src/Inputs/Select/select/async-select.tsx
rename to packages/react/src/Select/select/async-select.tsx
diff --git a/packages/react/src/Inputs/Select/select/creatable-select.tsx b/packages/react/src/Select/select/creatable-select.tsx
similarity index 100%
rename from packages/react/src/Inputs/Select/select/creatable-select.tsx
rename to packages/react/src/Select/select/creatable-select.tsx
diff --git a/packages/react/src/Inputs/Select/select/select.tsx b/packages/react/src/Select/select/select.tsx
similarity index 100%
rename from packages/react/src/Inputs/Select/select/select.tsx
rename to packages/react/src/Select/select/select.tsx
diff --git a/packages/react/src/Inputs/Select/types.ts b/packages/react/src/Select/types.ts
similarity index 100%
rename from packages/react/src/Inputs/Select/types.ts
rename to packages/react/src/Select/types.ts
diff --git a/packages/react/src/Inputs/Select/use-chakra-select-props.ts b/packages/react/src/Select/use-chakra-select-props.ts
similarity index 100%
rename from packages/react/src/Inputs/Select/use-chakra-select-props.ts
rename to packages/react/src/Select/use-chakra-select-props.ts
diff --git a/packages/react/src/Inputs/Select/utils.ts b/packages/react/src/Select/utils.ts
similarity index 100%
rename from packages/react/src/Inputs/Select/utils.ts
rename to packages/react/src/Select/utils.ts
diff --git a/packages/react/src/Status/Status.tsx b/packages/react/src/Status.tsx
similarity index 96%
rename from packages/react/src/Status/Status.tsx
rename to packages/react/src/Status.tsx
index 7cac78dcde..0c5d13a0da 100644
--- a/packages/react/src/Status/Status.tsx
+++ b/packages/react/src/Status.tsx
@@ -19,4 +19,4 @@ const Status = forwardRef<
Status.displayName = "Status";
-export default Status;
+export { Status };
diff --git a/packages/react/src/Status/index.ts b/packages/react/src/Status/index.ts
deleted file mode 100644
index 7da932ef6a..0000000000
--- a/packages/react/src/Status/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-import Status from "./Status";
-export default Status;
diff --git a/packages/react/src/hooks/index.ts b/packages/react/src/hooks/index.ts
index 3110f1750f..c3c5e84500 100644
--- a/packages/react/src/hooks/index.ts
+++ b/packages/react/src/hooks/index.ts
@@ -7,6 +7,7 @@ import useInterval from "./useInterval";
import useKeyboardShortcuts from "./useKeyboardShortcuts";
import useLocalStorage from "./useLocalStorage";
import useMount from "./useMount";
+import useNotification from "./useNotification";
import useOutsideClick from "./useOutsideClick";
export {
@@ -19,5 +20,6 @@ export {
useKeyboardShortcuts,
useLocalStorage,
useMount,
+ useNotification,
useOutsideClick,
};
diff --git a/packages/react/src/Message/useNotification.tsx b/packages/react/src/hooks/useNotification.tsx
similarity index 98%
rename from packages/react/src/Message/useNotification.tsx
rename to packages/react/src/hooks/useNotification.tsx
index 0255349b75..3081fe4110 100644
--- a/packages/react/src/Message/useNotification.tsx
+++ b/packages/react/src/hooks/useNotification.tsx
@@ -1,3 +1,4 @@
+import type { UseToastOptions } from "@chakra-ui/react";
import {
Alert,
AlertDescription,
@@ -8,9 +9,8 @@ import {
useColorModeValue,
useToast,
} from "@chakra-ui/react";
-import type { UseToastOptions } from "@chakra-ui/react";
import { useMemo } from "react";
-import { ClientOnly } from "../SSR";
+import { ClientOnly } from "~/ClientOnly";
const defaultOptions: UseToastOptions = {
isClosable: true,
diff --git a/packages/react/src/index.tsx b/packages/react/src/index.tsx
index 50ab618eaf..739c3005f6 100644
--- a/packages/react/src/index.tsx
+++ b/packages/react/src/index.tsx
@@ -1,35 +1,41 @@
+import { ActionMenu } from "./ActionMenu";
import Button from "./Button";
+import {
+ Card,
+ CardAction,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+} from "./Card";
+import { ClientOnly } from "./ClientOnly";
+import { ContextMenu } from "./ContextMenu";
import { Count } from "./Count";
import DataTable, { DataTableColumnHeader } from "./DataTable";
-import Dot from "./Dot";
+import {
+ DatePicker,
+ DateRangePicker,
+ DateTimePicker,
+ TimePicker,
+} from "./Date";
+import { Dot } from "./Dot";
+import { Editor, useEditor } from "./Editor";
+import { File } from "./File";
import { HStack } from "./HStack";
-import HTML from "./HTML";
+import { HTML } from "./HTML";
import { Heading } from "./Heading";
+import { Loading } from "./Loading";
+import { Menubar, MenubarItem, MenubarTrigger } from "./Menubar";
import type {
GroupBase,
MultiValue,
OptionBase,
OptionProps,
SingleValue,
-} from "./Inputs";
-import {
- CreatableSelect,
- DatePicker,
- DateRangePicker,
- DateTimePicker,
- Editor,
- File,
- Select,
- TimePicker,
- createFilter,
- useEditor,
-} from "./Inputs";
-import Loading from "./Loading";
-import { Menubar, MenubarItem, MenubarTrigger } from "./Menu";
-import { useNotification } from "./Message";
-import { ActionMenu, ContextMenu } from "./Overlay";
-import { ClientOnly } from "./SSR";
-import Status from "./Status";
+} from "./Select";
+import { CreatableSelect, Select, createFilter } from "./Select";
+import { Status } from "./Status";
import ThemeProvider, { theme } from "./Theme";
import {
Tooltip,
@@ -47,6 +53,7 @@ import {
useInterval,
useKeyboardShortcuts,
useMount,
+ useNotification,
useOutsideClick,
} from "./hooks";
import { cn } from "./utils/cn";
@@ -54,6 +61,13 @@ import { cn } from "./utils/cn";
export {
ActionMenu,
Button,
+ Card,
+ CardAction,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
ClientOnly,
ContextMenu,
Count,