Skip to content

Commit

Permalink
Clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanCQ committed Dec 18, 2023
1 parent 36257f4 commit e9a6051
Show file tree
Hide file tree
Showing 98 changed files with 530 additions and 464 deletions.
1 change: 1 addition & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ const config = {
docs: {
autodocs: "tag",
},
staticDirs: ["../dist"],
};
export default config;
9 changes: 9 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- Pull in static files served from your Static directory or the internet -->
<!-- Example: `main.js|ts` is configured with staticDirs: ['../public'] and your font is located in the `fonts` directory inside your `public` directory -->

<!-- Or you can load custom head-tag JavaScript: -->

<script
src="dist/src/utils/syncTheme.js"
type="application/javascript"
></script>
2 changes: 2 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import "../src/styles.css";
import "../src/tokens.css";

const preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
Expand Down
2 changes: 1 addition & 1 deletion components.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"cssVariables": true
},
"aliases": {
"components": "src/components",
"components": "src/atoms",
"utils": "src/utils"
}
}
9 changes: 6 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import commonjs from "@rollup/plugin-commonjs";
import resolve from "@rollup/plugin-node-resolve";
import typescript from "@rollup/plugin-typescript";
import path from "path";
import postcss from "rollup-plugin-postcss";
import { terser } from "rollup-plugin-terser";

export default [
{
input: "src/index.ts",
Expand All @@ -12,6 +12,7 @@ export default [
dir: "dist/",
format: "esm",
sourcemap: true,
preserveModules: true,
},
],
plugins: [
Expand All @@ -25,10 +26,12 @@ export default [
}),
// CSS vendor prefixing etc.
postcss({
extract: false,
modules: true,
extract: path.resolve("./dist/tokens.css"),
config: "./postcss.config.js",
}),
// copy({
// targets: [{ src: "./src/styles.css", dest: "./dist" }],
// }),
// Minify output.
terser(),
],
Expand Down
File renamed without changes.
64 changes: 32 additions & 32 deletions src/components/ui/alert-dialog.tsx → src/atoms/alert-dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
"use client"
"use client";

import * as React from "react"
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
import * as React from "react";

import { cn } from "src/utils"
import { buttonVariants } from "src/components/ui/button"
import { buttonVariants } from "src/atoms/button";
import { cn } from "src/utils";

const AlertDialog = AlertDialogPrimitive.Root
const AlertDialog = AlertDialogPrimitive.Root;

const AlertDialogTrigger = AlertDialogPrimitive.Trigger
const AlertDialogTrigger = AlertDialogPrimitive.Trigger;

const AlertDialogPortal = AlertDialogPrimitive.Portal
const AlertDialogPortal = AlertDialogPrimitive.Portal;

const AlertDialogOverlay = React.forwardRef<
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
Expand All @@ -24,8 +24,8 @@ const AlertDialogOverlay = React.forwardRef<
{...props}
ref={ref}
/>
))
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName
));
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;

const AlertDialogContent = React.forwardRef<
React.ElementRef<typeof AlertDialogPrimitive.Content>,
Expand All @@ -42,8 +42,8 @@ const AlertDialogContent = React.forwardRef<
{...props}
/>
</AlertDialogPortal>
))
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName
));
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;

const AlertDialogHeader = ({
className,
Expand All @@ -56,8 +56,8 @@ const AlertDialogHeader = ({
)}
{...props}
/>
)
AlertDialogHeader.displayName = "AlertDialogHeader"
);
AlertDialogHeader.displayName = "AlertDialogHeader";

const AlertDialogFooter = ({
className,
Expand All @@ -70,8 +70,8 @@ const AlertDialogFooter = ({
)}
{...props}
/>
)
AlertDialogFooter.displayName = "AlertDialogFooter"
);
AlertDialogFooter.displayName = "AlertDialogFooter";

const AlertDialogTitle = React.forwardRef<
React.ElementRef<typeof AlertDialogPrimitive.Title>,
Expand All @@ -82,8 +82,8 @@ const AlertDialogTitle = React.forwardRef<
className={cn("text-lg font-semibold", className)}
{...props}
/>
))
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName
));
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;

const AlertDialogDescription = React.forwardRef<
React.ElementRef<typeof AlertDialogPrimitive.Description>,
Expand All @@ -94,9 +94,9 @@ const AlertDialogDescription = React.forwardRef<
className={cn("text-sm text-muted-foreground", className)}
{...props}
/>
))
));
AlertDialogDescription.displayName =
AlertDialogPrimitive.Description.displayName
AlertDialogPrimitive.Description.displayName;

const AlertDialogAction = React.forwardRef<
React.ElementRef<typeof AlertDialogPrimitive.Action>,
Expand All @@ -107,8 +107,8 @@ const AlertDialogAction = React.forwardRef<
className={cn(buttonVariants(), className)}
{...props}
/>
))
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName
));
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;

const AlertDialogCancel = React.forwardRef<
React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
Expand All @@ -123,19 +123,19 @@ const AlertDialogCancel = React.forwardRef<
)}
{...props}
/>
))
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName
));
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;

export {
AlertDialog,
AlertDialogPortal,
AlertDialogOverlay,
AlertDialogTrigger,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogHeader,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogOverlay,
AlertDialogPortal,
AlertDialogTitle,
AlertDialogDescription,
AlertDialogAction,
AlertDialogCancel,
}
AlertDialogTrigger,
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 10 additions & 10 deletions src/components/ui/calendar.tsx → src/atoms/calendar.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"use client"
"use client";

import * as React from "react"
import { ChevronLeftIcon, ChevronRightIcon } from "@radix-ui/react-icons"
import { DayPicker } from "react-day-picker"
import { ChevronLeftIcon, ChevronRightIcon } from "@radix-ui/react-icons";
import * as React from "react";
import { DayPicker } from "react-day-picker";

import { cn } from "src/utils"
import { buttonVariants } from "src/components/ui/button"
import { buttonVariants } from "src/atoms/button";
import { cn } from "src/utils";

export type CalendarProps = React.ComponentProps<typeof DayPicker>
export type CalendarProps = React.ComponentProps<typeof DayPicker>;

function Calendar({
className,
Expand Down Expand Up @@ -65,8 +65,8 @@ function Calendar({
}}
{...props}
/>
)
);
}
Calendar.displayName = "Calendar"
Calendar.displayName = "Calendar";

export { Calendar }
export { Calendar };
37 changes: 15 additions & 22 deletions src/components/ui/card.tsx → src/atoms/card.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import * as React from "react"

import { cn } from "src/utils";
import { cn } from "src/utils"

const Card = React.forwardRef<
HTMLDivElement,
Expand All @@ -14,8 +14,8 @@ const Card = React.forwardRef<
)}
{...props}
/>
));
Card.displayName = "Card";
))
Card.displayName = "Card"

const CardHeader = React.forwardRef<
HTMLDivElement,
Expand All @@ -26,8 +26,8 @@ const CardHeader = React.forwardRef<
className={cn("flex flex-col space-y-1.5 p-6", className)}
{...props}
/>
));
CardHeader.displayName = "CardHeader";
))
CardHeader.displayName = "CardHeader"

const CardTitle = React.forwardRef<
HTMLParagraphElement,
Expand All @@ -38,8 +38,8 @@ const CardTitle = React.forwardRef<
className={cn("font-semibold leading-none tracking-tight", className)}
{...props}
/>
));
CardTitle.displayName = "CardTitle";
))
CardTitle.displayName = "CardTitle"

const CardDescription = React.forwardRef<
HTMLParagraphElement,
Expand All @@ -50,16 +50,16 @@ const CardDescription = React.forwardRef<
className={cn("text-sm text-muted-foreground", className)}
{...props}
/>
));
CardDescription.displayName = "CardDescription";
))
CardDescription.displayName = "CardDescription"

const CardContent = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
));
CardContent.displayName = "CardContent";
))
CardContent.displayName = "CardContent"

const CardFooter = React.forwardRef<
HTMLDivElement,
Expand All @@ -70,14 +70,7 @@ const CardFooter = React.forwardRef<
className={cn("flex items-center p-6 pt-0", className)}
{...props}
/>
));
CardFooter.displayName = "CardFooter";
))
CardFooter.displayName = "CardFooter"

export {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
};
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit e9a6051

Please sign in to comment.