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.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
Nextjs page (#108)
Neil Kanakiac83275ef9c82
diff --git a/apps/carbon/app/components/MultiSelect.tsx b/apps/carbon/app/components/MultiSelect.tsxindex 1f7b9a03db..3b5803578a 100644--- a/apps/carbon/app/components/MultiSelect.tsx+++ b/apps/carbon/app/components/MultiSelect.tsx@@ -62,9 +62,10 @@ const MultiSelect = forwardRef<HTMLButtonElement, MultiSelectProps>(aria-controls={id}aria-expanded={open}role="combobox"+ variant="secondary"className={cn(multiSelectTriggerVariants({ size, hasSelections }),- "px-2",+ "bg-transparent px-2",className)}onClick={() => setOpen(!open)}@@ -100,7 +101,7 @@ const MultiSelect = forwardRef<HTMLButtonElement, MultiSelectProps>())}</div>) : (- <span className="text-muted-foreground text-sm">+ <span className="text-muted-foreground">{placeholder ?? "Select"}</span>)}diff --git a/apps/carbon/app/modules/sales/ui/Customers/CustomersTable.tsx b/apps/carbon/app/modules/sales/ui/Customers/CustomersTable.tsxindex 425f60eb5f..905c8b9f3d 100644--- a/apps/carbon/app/modules/sales/ui/Customers/CustomersTable.tsx+++ b/apps/carbon/app/modules/sales/ui/Customers/CustomersTable.tsx@@ -67,7 +67,7 @@ const CustomersTable = memo(},{id: "accountManagerId",- header: "Updated By",+ header: "Account Manager",cell: ({ row }) => (<EmployeeAvatar employeeId={row.original.accountManagerId} />),diff --git a/package-lock.json b/package-lock.jsonindex 180178aacd..aef501168f 100644--- a/package-lock.json+++ b/package-lock.json@@ -1680,6 +1680,14 @@"react-dom": "^16 || ^17 || ^18"}},+ "node_modules/@hookform/resolvers": {+ "version": "3.3.4",+ "resolved": "https://registry.npmjs.org/@hookform/resolvers/-/resolvers-3.3.4.tgz",+ "integrity": "sha512-o5cgpGOuJYrd+iMKvkttOclgwRW86EsWJZZRC23prf0uU2i48Htq4PuT73AVb9ionFyZrwYEITuOFGF+BydEtQ==",+ "peerDependencies": {+ "react-hook-form": "^7.0.0"+ }+ },"node_modules/@humanwhocodes/config-array": {"version": "0.11.14","resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",@@ -3507,6 +3515,29 @@}}},+ "node_modules/@radix-ui/react-label": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/@radix-ui/react-label/-/react-label-2.0.2.tgz",+ "integrity": "sha512-N5ehvlM7qoTLx7nWPodsPYPgMzA5WM8zZChQg8nyFJKnDO5WHdba1vv5/H6IO5LtJMfD2Q3wh1qHFGNtK0w3bQ==",+ "dependencies": {+ "@babel/runtime": "^7.13.10",+ "@radix-ui/react-primitive": "1.0.3"+ },+ "peerDependencies": {+ "@types/react": "*",+ "@types/react-dom": "*",+ "react": "^16.8 || ^17.0 || ^18.0",+ "react-dom": "^16.8 || ^17.0 || ^18.0"+ },+ "peerDependenciesMeta": {+ "@types/react": {+ "optional": true+ },+ "@types/react-dom": {+ "optional": true+ }+ }+ },"node_modules/@radix-ui/react-menu": {"version": "2.0.6","resolved": "https://registry.npmjs.org/@radix-ui/react-menu/-/react-menu-2.0.6.tgz",@@ -7426,9 +7457,9 @@}},"node_modules/@supabase/supabase-js": {- "version": "2.39.7",- "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.39.7.tgz",- "integrity": "sha512-1vxsX10Uhc2b+Dv9pRjBjHfqmw2N2h1PyTg9LEfICR3x2xwE24By1MGCjDZuzDKH5OeHCsf4it6K8KRluAAEXA==",+ "version": "2.40.0",+ "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.40.0.tgz",+ "integrity": "sha512-XF8OrsA13DYBL074sHH4M0NhXJCWhQ0R5JbVeVUytZ0coPMS9krRdzxl+0c4z4LLjqbm/Wdz0UYlTYM9MgnDag==","dependencies": {"@supabase/functions-js": "2.1.5","@supabase/gotrue-js": "2.62.2",@@ -19722,6 +19753,14 @@"node": "14 || >=16.14"}},+ "node_modules/lucide-react": {+ "version": "0.363.0",+ "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.363.0.tgz",+ "integrity": "sha512-AlsfPCsXQyQx7wwsIgzcKOL9LwC498LIMAo+c0Es5PkHJa33xwmYAkkSoKoJWWWSYQEStqu58/jT4tL2gi32uQ==",+ "peerDependencies": {+ "react": "^16.5.1 || ^17.0.0 || ^18.0.0"+ }+ },"node_modules/lz-string": {"version": "1.5.0","resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz",@@ -25399,6 +25438,21 @@"react": "^18.2.0"}},+ "node_modules/react-hook-form": {+ "version": "7.51.1",+ "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.51.1.tgz",+ "integrity": "sha512-ifnBjl+kW0ksINHd+8C/Gp6a4eZOdWyvRv0UBaByShwU8JbVx5hTcTWEcd5VdybvmPTATkVVXk9npXArHmo56w==",+ "engines": {+ "node": ">=12.22.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/react-hook-form"+ },+ "peerDependencies": {+ "react": "^16.8.0 || ^17 || ^18"+ }+ },"node_modules/react-icons": {"version": "4.12.0","resolved": "https://registry.npmjs.org/react-icons/-/react-icons-4.12.0.tgz",@@ -32408,18 +32462,26 @@"www": {"version": "0.0.1","dependencies": {+ "@hookform/resolvers": "^3.3.4",+ "@radix-ui/react-label": "^2.0.2",+ "@radix-ui/react-slot": "^1.0.2",+ "@supabase/supabase-js": "^2.40.0","@tabler/icons-react": "2.47.0",- "clsx": "^2.0.0",+ "class-variance-authority": "^0.7.0",+ "clsx": "^2.1.0","framer-motion": "^10.13.1","geist": "1.2.0",+ "lucide-react": "^0.363.0","next": "^13.4.16","nextra": "^2.5.2","nextra-theme-docs": "^2.5.2","react": "^18.2.0","react-dom": "^18.2.0",+ "react-hook-form": "^7.51.1","react-icons": "^4.12.0",- "tailwind-merge": "2.2.1",- "tailwindcss-animate": "^1.0.7"+ "tailwind-merge": "^2.2.1",+ "tailwindcss-animate": "^1.0.7",+ "zod": "^3.22.4"},"devDependencies": {"@carbon/tsconfig": "*",@@ -32428,6 +32490,7 @@"@types/react": "^18.2.33","@types/react-dom": "^18.2.14","autoprefixer": "10.4.14",+ "dotenv": "16.3.1","eslint-config-carbon": "*","postcss": "^8.4.33","tailwindcss": "3.3.2",diff --git a/packages/react/src/Card.tsx b/packages/react/src/Card.tsxindex b81677ddad..d7e4fe0b1d 100644--- a/packages/react/src/Card.tsx+++ b/packages/react/src/Card.tsx@@ -7,7 +7,7 @@ const Card = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(<divref={ref}className={cn(- "flex flex-col rounded-lg border border-border bg-card text-card-foreground shadow-sm w-full",+ "flex flex-col rounded-lg border border-border bg-gradient-to-bl from-card to-background text-card-foreground shadow-sm w-full",className)}{...props}diff --git a/www/components.json b/www/components.jsonnew file mode 100644index 0000000000..bcca5fe878--- /dev/null+++ b/www/components.json@@ -0,0 +1,17 @@+{+ "$schema": "https://ui.shadcn.com/schema.json",+ "style": "default",+ "rsc": false,+ "tsx": true,+ "tailwind": {+ "config": "tailwind.config.js",+ "css": "styles.css",+ "baseColor": "zinc",+ "cssVariables": true,+ "prefix": ""+ },+ "aliases": {+ "components": "/components",+ "utils": "www/utils/cn.tsx"+ }+}diff --git a/www/components/Home/components/macbook.tsx b/www/components/Home/components/macbook.tsxindex 6c13aecab7..2666b8b91d 100644--- a/www/components/Home/components/macbook.tsx+++ b/www/components/Home/components/macbook.tsx@@ -1,3 +1,4 @@+import { zodResolver } from "@hookform/resolvers/zod";import {IconBrightnessDown,IconBrightnessUp,@@ -23,7 +24,19 @@ import type { MotionValue } from "framer-motion";import { motion, useScroll, useTransform } from "framer-motion";import Image from "next/image";import React, { useEffect, useRef, useState } from "react";+import { useForm } from "react-hook-form";+import { z } from "zod";import { cn } from "../../../utils/cn";+import { supabase } from "../../../utils/supabase";+import { Button } from "../../ui/button";+import {+ Form,+ FormControl,+ FormField,+ FormItem,+ FormMessage,+} from "../../ui/form";+import { Input } from "../../ui/input";const MacbookScroll = ({showGradient,@@ -33,6 +46,41 @@ const MacbookScroll = ({title?: string | React.ReactNode;badge?: React.ReactNode;}) => {+ const [showForm, setShowForm] = useState(true);+ const formSchema = z.object({+ email: z.string().email(),+ });++ const form = useForm<z.infer<typeof formSchema>>({+ resolver: zodResolver(formSchema),+ defaultValues: {+ email: "",+ },+ });++ async function onSubmit(values: z.infer<typeof formSchema>) {+ try {+ const response = await supabase+ .from("leads")+ .insert({ email: values.email });++ if (response.error) {+ form.setError("email", {+ type: "manual",+ message: "Failed to insert email",+ });+ console.error(response.error.message);+ } else {+ form.reset();+ form.clearErrors();+ setShowForm(false);+ }++ // const data = await response.json();+ } catch (error) {+ console.error("Failed to submit email:", error);+ }+ }const ref = useRef<HTMLDivElement>(null);const { scrollYProgress } = useScroll({target: ref,@@ -59,32 +107,55 @@ const MacbookScroll = ({);const translate = useTransform(scrollYProgress, [0, 1], [0, 1500]);const rotate = useTransform(scrollYProgress, [0.1, 0.12, 0.3], [-28, -28, 0]);- const textTransform = useTransform(scrollYProgress, [0, 0.3], [0, 100]);- const textOpacity = useTransform(scrollYProgress, [0, 0.2], [1, 0]);return (- <div+ <motion.div+ initial={{ opacity: 0, y: -10 }}+ animate={{ opacity: 1, y: 0 }}+ transition={{ duration: 0.4, delay: 0.1 }}ref={ref}- className="min-h-[200vh] flex flex-col items-center py-0 md:py-[12rem] justify-start flex-shrink-0 [perspective:800px] transform md:scale-100 scale-[0.75] sm:scale-[0.9] text-center"+ className="min-h-[200vh] flex flex-col items-center py-0 md:py-[12rem] justify-start flex-shrink-0 [perspective:800px] transform md:scale-100 scale-[0.75] sm:scale-[0.9] text-center">- <motion.h1- style={{- translateY: textTransform,- opacity: textOpacity,- }}- className="max-w-5xl mx-auto text-7xl font-extrabold tracking-tighter leading-tighter sm:text-7xl lg:text-6xl xl:text-7xl"- >+ <h1 className="max-w-5xl mx-auto text-7xl font-extrabold tracking-tighter leading-tighter sm:text-7xl lg:text-6xl xl:text-7xl"><span className="dark:bg-clip-text dark:text-transparent dark:bg-gradient-to-b dark:from-white dark:to-zinc-400">ERP for</span>{" "}- <span className="bg-gradient-to-r bg-clip-text text-transparent dark:bg-gradient-to-b dark:from-[#3ECF8E] dark:via-[#3ECF8E] dark:to-[#3ecfb2] from-black via-orange-600 to-amber-500 ">+ <span className="bg-gradient-to-r bg-clip-text text-transparent dark:bg-gradient-to-b dark:from-[#3ECF8E] dark:via-[#3ECF8E] dark:to-[#3ecfb2] from-black to-black">the builders</span>- </motion.h1>- <p className="mt-6 nx-text-xl font-medium leading-tight text-black/60 dark:text-white/60 sm:nx-text-2xl md:nx-text-3xl lg:nx-text-4xl mb-20">- Carbon is an open-source starting point for manufacturing- </p>- {/* Lid */}+ </h1>+ <div className="flex flex-col gap-6 items-center mt-6 mb-20">+ <p className="max-w-lg nx-text-2xl font-medium leading-tight text-black/80 dark:text-white/80 sm:nx-text-2xl md:nx-text-3xl lg:nx-text-4xl">+ Carbon is an open-source ERP to meet your exact manufacturing needs+ </p>+ {showForm && (+ <Form {...form}>+ <form+ onSubmit={form.handleSubmit(onSubmit)}+ className="flex w-full max-w-sm items-start space-x-2"+ >+ <FormField+ control={form.control}+ name="email"+ render={({ field }) => (+ <FormItem>+ <FormControl>+ <Input+ className="w-60"+ type="email"+ placeholder="Email"+ {...field}+ />+ </FormControl>+ <FormMessage />+ </FormItem>+ )}+ />+ <Button type="submit">Get early access</Button>+ </form>+ </Form>+ )}+ </div><LidscaleX={scaleX}scaleY={scaleY}@@ -114,7 +185,7 @@ const MacbookScroll = ({<div className="h-40 w-full absolute bottom-0 inset-x-0 bg-gradient-to-t dark:from-black from-white via-white dark:via-black to-transparent z-50"></div>)}</div>- </div>+ </motion.div>);};diff --git a/www/components/ui/button.tsx b/www/components/ui/button.tsxnew file mode 100644index 0000000000..b7b3dc1937--- /dev/null+++ b/www/components/ui/button.tsx@@ -0,0 +1,56 @@+import * as React from "react";+import { Slot } from "@radix-ui/react-slot";+import { cva, type VariantProps } from "class-variance-authority";++import { cn } from "www/utils/cn.tsx";++const buttonVariants = cva(+ "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",+ {+ variants: {+ variant: {+ default: "bg-primary text-primary-foreground hover:bg-primary/90",+ destructive:+ "bg-destructive text-destructive-foreground hover:bg-destructive/90",+ outline:+ "border border-input bg-background hover:bg-accent hover:text-accent-foreground",+ secondary:+ "bg-secondary text-secondary-foreground hover:bg-secondary/80",+ ghost: "hover:bg-accent hover:text-accent-foreground",+ link: "text-primary underline-offset-4 hover:underline",+ },+ size: {+ default: "h-10 px-4 py-2",+ sm: "h-9 rounded-md px-3",+ lg: "h-11 rounded-md px-8",+ icon: "h-10 w-10",+ },+ },+ defaultVariants: {+ variant: "default",+ size: "default",+ },+ }+);++export interface ButtonProps+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,+ VariantProps<typeof buttonVariants> {+ asChild?: boolean;+}++const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(+ ({ className, variant, size, asChild = false, ...props }, ref) => {+ const Comp = asChild ? Slot : "button";+ return (+ <Comp+ className={cn(buttonVariants({ variant, size, className }))}+ ref={ref}+ {...props}+ />+ );+ }+);+Button.displayName = "Button";++export { Button, buttonVariants };diff --git a/www/components/ui/form.tsx b/www/components/ui/form.tsxnew file mode 100644index 0000000000..798aac2147--- /dev/null+++ b/www/components/ui/form.tsx@@ -0,0 +1,178 @@+import * as React from "react";+import type * as LabelPrimitive from "@radix-ui/react-label";+import { Slot } from "@radix-ui/react-slot";+import type {+ ControllerProps,+ FieldPath,+ FieldValues} from "react-hook-form";+import {+ Controller,+ FormProvider,+ useFormContext,+} from "react-hook-form";++import { cn } from "www/utils/cn.tsx";+import { Label } from "/components/ui/label";++const Form = FormProvider;++type FormFieldContextValue<+ TFieldValues extends FieldValues = FieldValues,+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>+> = {+ name: TName;+};++const FormFieldContext = React.createContext<FormFieldContextValue>(+ {} as FormFieldContextValue+);++const FormField = <+ TFieldValues extends FieldValues = FieldValues,+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>+>({+ ...props+}: ControllerProps<TFieldValues, TName>) => {+ return (+ <FormFieldContext.Provider value={{ name: props.name }}>+ <Controller {...props} />+ </FormFieldContext.Provider>+ );+};++const useFormField = () => {+ const fieldContext = React.useContext(FormFieldContext);+ const itemContext = React.useContext(FormItemContext);+ const { getFieldState, formState } = useFormContext();++ const fieldState = getFieldState(fieldContext.name, formState);++ if (!fieldContext) {+ throw new Error("useFormField should be used within <FormField>");+ }++ const { id } = itemContext;++ return {+ id,+ name: fieldContext.name,+ formItemId: `${id}-form-item`,+ formDescriptionId: `${id}-form-item-description`,+ formMessageId: `${id}-form-item-message`,+ ...fieldState,+ };+};++type FormItemContextValue = {+ id: string;+};++const FormItemContext = React.createContext<FormItemContextValue>(+ {} as FormItemContextValue+);++const FormItem = React.forwardRef<+ HTMLDivElement,+ React.HTMLAttributes<HTMLDivElement>+>(({ className, ...props }, ref) => {+ const id = React.useId();++ return (+ <FormItemContext.Provider value={{ id }}>+ <div ref={ref} className={cn("space-y-2", className)} {...props} />+ </FormItemContext.Provider>+ );+});+FormItem.displayName = "FormItem";++const FormLabel = React.forwardRef<+ React.ElementRef<typeof LabelPrimitive.Root>,+ React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>+>(({ className, ...props }, ref) => {+ const { error, formItemId } = useFormField();++ return (+ <Label+ ref={ref}+ className={cn(error && "text-destructive", className)}+ htmlFor={formItemId}+ {...props}+ />+ );+});+FormLabel.displayName = "FormLabel";++const FormControl = React.forwardRef<+ React.ElementRef<typeof Slot>,+ React.ComponentPropsWithoutRef<typeof Slot>+>(({ ...props }, ref) => {+ const { error, formItemId, formDescriptionId, formMessageId } =+ useFormField();++ return (+ <Slot+ ref={ref}+ id={formItemId}+ aria-describedby={+ !error+ ? `${formDescriptionId}`+ : `${formDescriptionId} ${formMessageId}`+ }+ aria-invalid={!!error}+ {...props}+ />+ );+});+FormControl.displayName = "FormControl";++const FormDescription = React.forwardRef<+ HTMLParagraphElement,+ React.HTMLAttributes<HTMLParagraphElement>+>(({ className, ...props }, ref) => {+ const { formDescriptionId } = useFormField();++ return (+ <p+ ref={ref}+ id={formDescriptionId}+ className={cn("text-sm text-muted-foreground", className)}+ {...props}+ />+ );+});+FormDescription.displayName = "FormDescription";++const FormMessage = React.forwardRef<+ HTMLParagraphElement,+ React.HTMLAttributes<HTMLParagraphElement>+>(({ className, children, ...props }, ref) => {+ const { error, formMessageId } = useFormField();+ const body = error ? String(error?.message) : children;++ if (!body) {+ return null;+ }++ return (+ <p+ ref={ref}+ id={formMessageId}+ className={cn("text-sm font-medium text-destructive", className)}+ {...props}+ >+ {body}+ </p>+ );+});+FormMessage.displayName = "FormMessage";++export {+ useFormField,+ Form,+ FormItem,+ FormLabel,+ FormControl,+ FormDescription,+ FormMessage,+ FormField,+};diff --git a/www/components/ui/input.tsx b/www/components/ui/input.tsxnew file mode 100644index 0000000000..1538e73f64--- /dev/null+++ b/www/components/ui/input.tsx@@ -0,0 +1,25 @@+import * as React from "react";++import { cn } from "www/utils/cn.tsx";++export interface InputProps+ extends React.InputHTMLAttributes<HTMLInputElement> {}++const Input = React.forwardRef<HTMLInputElement, InputProps>(+ ({ className, type, ...props }, ref) => {+ return (+ <input+ type={type}+ className={cn(+ "flex h-10 w-full rounded-md border border-input px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",+ className+ )}+ ref={ref}+ {...props}+ />+ );+ }+);+Input.displayName = "Input";++export { Input };diff --git a/www/components/ui/label.tsx b/www/components/ui/label.tsxnew file mode 100644index 0000000000..22dbcac41e--- /dev/null+++ b/www/components/ui/label.tsx@@ -0,0 +1,24 @@+import * as React from "react";+import * as LabelPrimitive from "@radix-ui/react-label";+import { cva, type VariantProps } from "class-variance-authority";++import { cn } from "www/utils/cn.tsx";++const labelVariants = cva(+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"+);++const Label = React.forwardRef<+ React.ElementRef<typeof LabelPrimitive.Root>,+ React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &+ VariantProps<typeof labelVariants>+>(({ className, ...props }, ref) => (+ <LabelPrimitive.Root+ ref={ref}+ className={cn(labelVariants(), className)}+ {...props}+ />+));+Label.displayName = LabelPrimitive.Root.displayName;++export { Label };diff --git a/www/package.json b/www/package.jsonindex 5e3e274d73..5db7ba0c2f 100644--- a/www/package.json+++ b/www/package.json@@ -2,18 +2,26 @@"name": "www","version": "0.0.1","dependencies": {+ "@hookform/resolvers": "^3.3.4",+ "@radix-ui/react-label": "^2.0.2",+ "@radix-ui/react-slot": "^1.0.2",+ "@supabase/supabase-js": "^2.40.0","@tabler/icons-react": "2.47.0",- "clsx": "^2.0.0",+ "class-variance-authority": "^0.7.0",+ "clsx": "^2.1.0","framer-motion": "^10.13.1","geist": "1.2.0",+ "lucide-react": "^0.363.0","next": "^13.4.16","nextra": "^2.5.2","nextra-theme-docs": "^2.5.2","react": "^18.2.0","react-dom": "^18.2.0",+ "react-hook-form": "^7.51.1","react-icons": "^4.12.0",- "tailwind-merge": "2.2.1",- "tailwindcss-animate": "^1.0.7"+ "tailwind-merge": "^2.2.1",+ "tailwindcss-animate": "^1.0.7",+ "zod": "^3.22.4"},"devDependencies": {"@carbon/tsconfig": "*",@@ -22,6 +30,7 @@"@types/react": "^18.2.33","@types/react-dom": "^18.2.14","autoprefixer": "10.4.14",+ "dotenv": "16.3.1","eslint-config-carbon": "*","postcss": "^8.4.33","tailwindcss": "3.3.2",diff --git a/www/styles.css b/www/styles.cssindex f47a41eda0..bbd49630aa 100644--- a/www/styles.css+++ b/www/styles.css@@ -1,304 +1,76 @@+@tailwind base;+@tailwind components;@tailwind utilities;-:root {- --radius: 12px;-}--code {- @apply text-sm;-}--:root {- --nextra-primary-hue: 230deg;-}--.dark {- --nextra-primary-hue: 161deg;-}--body {- background: linear-gradient(- to bottom,- rgba(255, 255, 255, 0) 0%,- rgba(255, 255, 255, 1) 300px- ),- fixed 0 0 / 20px 20px radial-gradient(#d1d1d1 1px, transparent 0),- fixed 10px 10px / 20px 20px radial-gradient(#d1d1d1 1px, transparent 0);-}--.dark .invert-on-dark {- filter: invert(1) brightness(1.8);-}--#__next .nextra-body > main h1 {- margin-top: 0;-}--.dark body article pre {- background-color: transparent;- border: 1px solid rgba(224, 243, 255, 0.1);- border-radius: 5px;-}--.light body article pre {- background-color: transparent;- border: 1px solid #e5e7eb;- border-radius: 5px;-}--.light body {- --shiki-color-text: #111;- --shiki-token-constant: var(--shiki-color-text);- --shiki-token-comment: #999;- --shiki-token-keyword: #ff0078;- --shiki-token-function: #2a0093;- --shiki-token-string-expression: #028265;- --shiki-token-punctuation: var(--shiki-color-text);- --shiki-token-string: #797afa;-}--.dark body {- --shiki-color-text: #eaeaea;- --shiki-token-constant: var(--shiki-color-text);- --shiki-token-comment: #666;- --shiki-token-keyword: #ff0078;- --shiki-token-function: #12ff00;- --shiki-token-string-expression: #50e3c2;- --shiki-token-punctuation: var(--shiki-color-text);- --shiki-token-string: #797afa;-- background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, #111 300px),- fixed 0 0 / 20px 20px radial-gradient(#313131 1px, transparent 0),- fixed 10px 10px / 20px 20px radial-gradient(#313131 1px, transparent 0);-}--code[data-language="sh"] {- --shiki-token-string: var(--shiki-color-text);-}+@layer base {+ :root {+ --background: 0 0% 100%;+ --foreground: 240 10% 3.9%;-#__next article.nextra-body h1 {- font-size: 2em;-}--#__next article.nextra-body h2 {- font-size: 1.5em;-}--#__next article.nextra-body h3 {- font-size: 1.25em;-}+ --card: 0 0% 100%;+ --card-foreground: 240 10% 3.9%;-#__next article.nextra-body h4 {- font-size: 1em;-}+ --popover: 0 0% 100%;+ --popover-foreground: 240 10% 3.9%;-#__next article.nextra-body h5 {- font-size: 0.875em;-}+ --primary: 240 5.9% 10%;+ --primary-foreground: 0 0% 98%;-#__next article.nextra-body h5 {- font-size: 0.85em;-}+ --secondary: 240 4.8% 95.9%;+ --secondary-foreground: 240 5.9% 10%;-.light .nx-text-primary-600 {- --tw-text-opacity: 1;- color: hsl(- var(--nextra-primary-hue) var(--nextra-primary-saturation) 35% /- var(--tw-text-opacity)- );-}+ --muted: 240 4.8% 95.9%;+ --muted-foreground: 240 3.8% 46.1%;-.nextra-nav-container {- position: fixed;-}+ --accent: 240 4.8% 95.9%;+ --accent-foreground: 240 5.9% 10%;-.nextra-nav-container + div {- min-height: 100vh;-}+ --destructive: 0 84.2% 60.2%;+ --destructive-foreground: 0 0% 98%;-section > section {- padding-left: 0.5rem;- padding-right: 0.5rem;-}+ --border: 240 5.9% 90%;+ --input: 240 5.9% 90%;+ --ring: 240 10% 3.9%;-article {- padding-top: 70px;-}+ --radius: 0.5rem;+ }-aside {- padding-top: 15px;-}+ .dark {+ --background: 240 10% 3.9%;+ --foreground: 0 0% 98%;-/* Credit: https://cmdk.paco.me/ */+ --card: 240 10% 3.9%;+ --card-foreground: 0 0% 98%;-.background {- width: 100vw;- min-height: 100vh;- position: fixed;- top: 0;- display: flex;- justify-content: center;- padding: 120px 24px 160px 24px;- pointer-events: none;-}+ --popover: 240 10% 3.9%;+ --popover-foreground: 0 0% 98%;-.background:before {- background: radial-gradient(circle, rgba(2, 0, 36, 0) 0, #fafafa 100%);- position: absolute;- content: "";- z-index: 2;- width: 100%;- height: 100%;- top: 0;-}+ --primary: 0 0% 98%;+ --primary-foreground: 240 5.9% 10%;-.dark .background:before {- background: radial-gradient(circle, rgba(2, 0, 36, 0) 0, #161616 100%);- position: absolute;- content: "";- z-index: 2;- width: 100%;- height: 100%;- top: 0;-}+ --secondary: 240 3.7% 15.9%;+ --secondary-foreground: 0 0% 98%;-.background:after {- content: "";- background-image: url("/grid.svg");- z-index: 1;- position: absolute;- width: 100%;- height: 100%;- top: 0;- opacity: 0.4;- filter: invert(1);-}+ --muted: 240 3.7% 15.9%;+ --muted-foreground: 240 5% 64.9%;-.dark .background:after {- filter: invert(0);-}+ --accent: 240 3.7% 15.9%;+ --accent-foreground: 0 0% 98%;-.gradient {- height: fit-content;- z-index: 3;- width: 100%;- max-width: 640px;- background-image: radial-gradient(- at 27% 37%,- hsla(215, 98%, 61%, 1) 0px,- transparent 0%- ),- radial-gradient(at 97% 21%, hsla(125, 60%, 72%, 1) 0px, transparent 55%),- radial-gradient(at 52% 99%, hsla(354, 40%, 61%, 1) 0px, transparent 55%),- radial-gradient(at 10% 29%, hsla(256, 50%, 67%, 1) 0px, transparent 55%),- radial-gradient(at 97% 96%, hsla(38, 40%, 74%, 1) 0px, transparent 55%),- radial-gradient(at 33% 50%, hsla(222, 60%, 73%, 1) 0px, transparent 55%),- radial-gradient(at 79% 53%, hsla(343, 20%, 79%, 1) 0px, transparent 55%);- position: absolute;- content: "";- width: 100%;- height: 100%;- filter: blur(100px) saturate(150%);- top: 80px;- opacity: 0.15;-}+ --destructive: 0 62.8% 30.6%;+ --destructive-foreground: 0 0% 98%;-@media screen and (max-width: 640px) {- .content {- display: none;+ --border: 240 3.7% 15.9%;+ --input: 240 3.7% 15.9%;+ --ring: 240 4.9% 83.9%;}}-/* Glow specific styles */--.round {- border-radius: var(--radius);-}--.dark [data-glow] {- --border-size: calc(var(--border, 2) * 1px);- --spotlight-size: calc(var(--size, 150) * 1px);- --hue: calc(var(--base) + (var(--xp, 0) * var(--spread, 0)));- background-image: radial-gradient(- var(--spotlight-size) var(--spotlight-size) at calc(var(--x, 0) * 1px)- calc(var(--y, 0) * 1px),- hsl(- var(--hue, 210) calc(var(--saturation, 100) * 1%)- calc(var(--lightness, 70) * 1%) / var(--bg-spot-opacity, 0.1)- ),- transparent- );- background-color: var(--backdrop, transparent);- background-size: calc(100% + (2 * var(--border-size)))- calc(100% + (2 * var(--border-size)));- background-position: 50% 50%;- background-attachment: fixed;- border: var(--border-size) solid var(--backup-border);- position: relative;-}--.dark [data-glow]::before,-.dark [data-glow]::after {- pointer-events: none;- content: "";- position: absolute;- inset: calc(var(--border-size) * -1);- border: var(--border-size) solid transparent;- border-radius: var(--radius);- background-attachment: fixed;- background-size: calc(100% + (2 * var(--border-size)))- calc(100% + (2 * var(--border-size)));- background-repeat: no-repeat;- background-position: 50% 50%;- mask: linear-gradient(transparent, transparent), linear-gradient(white, white);- mask-clip: padding-box, border-box;- mask-composite: intersect;-}--/* This is the emphasis light */-.dark [data-glow]::before {- background-image: radial-gradient(- calc(var(--spotlight-size) * 0.75) calc(var(--spotlight-size) * 0.75) at- calc(var(--x, 0) * 1px) calc(var(--y, 0) * 1px),- hsl(- var(--hue, 210) calc(var(--saturation, 100) * 1%)- calc(var(--lightness, 50) * 1%) / var(--border-spot-opacity, 1)- ),- transparent 100%- );- z-index: 2;- filter: brightness(2);-}-/* This is the spotlight */-.dark [data-glow]::after {- background-image: radial-gradient(- calc(var(--spotlight-size) * 0.5) calc(var(--spotlight-size) * 0.5) at- calc(var(--x, 0) * 1px) calc(var(--y, 0) * 1px),- hsl(0 100% 100% / var(--border-light-opacity, 1)),- transparent 100%- );- z-index: 2;-}--.dark [data-glow] [data-glow] {- position: absolute;- inset: 0;- will-change: filter;-}--.dark [data-glow] > [data-glow] {- border-radius: calc(var(--radius) * 1px);- border-width: calc(var(--border-size) * 20);- filter: blur(calc(var(--border-size) * 10));- background: none;- pointer-events: none;-}--.dark [data-glow] > [data-glow]::before {- inset: -10px;- border-width: 10px;-}--.dark [data-glow] [data-glow] {- border: none;-}+@layer base {+ * {+ @apply border-border;+ }+ body {+ @apply bg-background text-foreground;+ }+}\ No newline at end of filediff --git a/www/tailwind.config.js b/www/tailwind.config.jsindex 33e70e2ad3..0730ff9c1d 100644--- a/www/tailwind.config.js+++ b/www/tailwind.config.js@@ -1,50 +1,77 @@-const colors = require("tailwindcss/colors");-+/** @type {import('tailwindcss').Config} */module.exports = {+ darkMode: ["class"],content: [- "./components/**/*.js",- "./components/**/*.tsx",- "./nextra-theme-docs/**/*.js",- "./nextra-theme-docs/**/*.tsx",- "./nextra-theme-docs/**/*.css",- "./pages/**/*.md",- "./pages/**/*.mdx",- "./pages/**/*.tsx",- "./theme.config.js",- "./styles.css",- ],- plugins: [- require("tailwindcss-animate"),- // ...+ "./pages/**/*.{ts,tsx}",+ "./components/**/*.{ts,tsx}",+ "./app/**/*.{ts,tsx}",+ "./src/**/*.{ts,tsx}",],+ prefix: "",theme: {- extend: {- fontFamily: {- sans: ["var(--font-geist-sans)", "sans-serif"],- mono: [- "var(--font-geist-mono)",- "Menlo",- "Monaco",- "Lucida Console",- "monospace",- ],+ container: {+ center: true,+ padding: "2rem",+ screens: {+ "2xl": "1400px",},+ },+ extend: {colors: {- dark: "#000",- gray: colors.neutral,- blue: colors.blue,- orange: colors.orange,- green: colors.green,- red: colors.red,- yellow: colors.yellow,+ border: "hsl(var(--border))",+ input: "hsl(var(--input))",+ ring: "hsl(var(--ring))",+ background: "hsl(var(--background))",+ foreground: "hsl(var(--foreground))",+ primary: {+ DEFAULT: "hsl(var(--primary))",+ foreground: "hsl(var(--primary-foreground))",+ },+ secondary: {+ DEFAULT: "hsl(var(--secondary))",+ foreground: "hsl(var(--secondary-foreground))",+ },+ destructive: {+ DEFAULT: "hsl(var(--destructive))",+ foreground: "hsl(var(--destructive-foreground))",+ },+ muted: {+ DEFAULT: "hsl(var(--muted))",+ foreground: "hsl(var(--muted-foreground))",+ },+ accent: {+ DEFAULT: "hsl(var(--accent))",+ foreground: "hsl(var(--accent-foreground))",+ },+ popover: {+ DEFAULT: "hsl(var(--popover))",+ foreground: "hsl(var(--popover-foreground))",+ },+ card: {+ DEFAULT: "hsl(var(--card))",+ foreground: "hsl(var(--card-foreground))",+ },},- screens: {- sm: "640px",- md: "768px",- lg: "1024px",- betterhover: { raw: "(hover: hover)" },+ borderRadius: {+ lg: "var(--radius)",+ md: "calc(var(--radius) - 2px)",+ sm: "calc(var(--radius) - 4px)",+ },+ keyframes: {+ "accordion-down": {+ from: { height: "0" },+ to: { height: "var(--radix-accordion-content-height)" },+ },+ "accordion-up": {+ from: { height: "var(--radix-accordion-content-height)" },+ to: { height: "0" },+ },+ },+ animation: {+ "accordion-down": "accordion-down 0.2s ease-out",+ "accordion-up": "accordion-up 0.2s ease-out",},},},- darkMode: "class",+ plugins: [require("tailwindcss-animate")],};diff --git a/www/tsconfig.json b/www/tsconfig.jsonindex e54d4e04e5..e981962739 100644--- a/www/tsconfig.json+++ b/www/tsconfig.json@@ -2,9 +2,11 @@"exclude": ["node_modules"],"extends": "@carbon/tsconfig/nextjs.json","compilerOptions": {- "rootDir": "pages","outDir": "dist",- "baseUrl": "."+ "baseUrl": ".",+ "paths": {+ "~/*": ["./src/*"]+ }},"include": ["next-env.d.ts", "pages"]}diff --git a/www/utils/supabase.ts b/www/utils/supabase.tsnew file mode 100644index 0000000000..a1e468e572--- /dev/null+++ b/www/utils/supabase.ts@@ -0,0 +1,11 @@+import { createClient } from "@supabase/supabase-js";++const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL;+const supabaseKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY;++if (!supabaseUrl || !supabaseKey) {+ console.log({ env: process.env, supabaseUrl, supabaseKey });+ throw new Error("Supabase URL or Supabase Key is undefined.");+}++export const supabase = createClient(supabaseUrl, supabaseKey);