Skip to content

Commit

Permalink
Merge pull request #25 from damianricobelli/feature/improve-andsimpli…
Browse files Browse the repository at this point in the history
…fying-logic

refactor: new API
  • Loading branch information
damianricobelli authored Aug 16, 2024
2 parents fad35a7 + 0235f2f commit e467914
Show file tree
Hide file tree
Showing 59 changed files with 1,010 additions and 2,183 deletions.
10 changes: 0 additions & 10 deletions .changeset/quiet-sheep-laugh.md

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions: {}
jobs:
release:
permissions:
Expand Down
4 changes: 3 additions & 1 deletion docs/components/features.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,7 @@ function Feature({
}

export function Features() {
return features.map((feature, index) => <Feature key={index} {...feature} />);
return features.map((feature, index) => (
<Feature key={`feature-${feature.title}-${index}`} {...feature} />
));
}
17 changes: 5 additions & 12 deletions docs/components/props-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type * as React from "react";
import { DividerHorizontalIcon, InfoCircledIcon } from "@radix-ui/react-icons";
import { Code } from "./ui/code";
import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";
import { ScrollArea } from "./ui/scroll-area";
import { ScrollArea, ScrollBar } from "./ui/scroll-area";
import {
Table,
TableBody,
Expand Down Expand Up @@ -94,18 +94,11 @@ export function PropsTable({
<PopoverContent
side="top"
align="center"
className="w-fit"
className="max-w-[300px] w-full"
>
<ScrollArea type="auto">
<Code
variant="unstyled"
style={{
whiteSpace: "pre",
display: "block",
}}
>
{type}
</Code>
<ScrollArea type="hover">
<Code>{type}</Code>
<ScrollBar orientation="horizontal" />
</ScrollArea>
</PopoverContent>
</Popover>
Expand Down
155 changes: 0 additions & 155 deletions docs/components/test.tsx

This file was deleted.

3 changes: 1 addition & 2 deletions docs/components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ const classForButton = cva(
"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
outline:
"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
secondary:
"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
secondary: "bg-gray-3 text-gray-12 shadow-sm hover:opacity-80",
ghost: "hover:bg-accent hover:text-accent-foreground",
link: "text-primary underline-offset-4 hover:underline",
},
Expand Down
22 changes: 12 additions & 10 deletions docs/components/ui/code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ export function Code({
);
}

const classForCode = cva("rounded-sm px-1 py-0.5 text-xs", {
variants: {
variant: {
default: "bg-gray-3",
info: "bg-info-3",
unstyled: "text-gray-11",
const classForCode = cva(
"rounded-sm px-1 py-0.5 text-xs whitespace-pre bg-transparent",
{
variants: {
variant: {
default: "bg-gray-3",
info: "bg-info-3",
},
},
defaultVariants: {
variant: "default",
},
},
defaultVariants: {
variant: "default",
},
});
);
122 changes: 122 additions & 0 deletions docs/components/ui/dialog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
"use client"

import * as React from "react"
import * as DialogPrimitive from "@radix-ui/react-dialog"
import { Cross2Icon } from "@radix-ui/react-icons"

import { cn } from "@/lib/utils"

const Dialog = DialogPrimitive.Root

const DialogTrigger = DialogPrimitive.Trigger

const DialogPortal = DialogPrimitive.Portal

const DialogClose = DialogPrimitive.Close

const DialogOverlay = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Overlay>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
>(({ className, ...props }, ref) => (
<DialogPrimitive.Overlay
ref={ref}
className={cn(
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
className
)}
{...props}
/>
))
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName

const DialogContent = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
>(({ className, children, ...props }, ref) => (
<DialogPortal>
<DialogOverlay />
<DialogPrimitive.Content
ref={ref}
className={cn(
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
className
)}
{...props}
>
{children}
<DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
<Cross2Icon className="h-4 w-4" />
<span className="sr-only">Close</span>
</DialogPrimitive.Close>
</DialogPrimitive.Content>
</DialogPortal>
))
DialogContent.displayName = DialogPrimitive.Content.displayName

const DialogHeader = ({
className,
...props
}: React.HTMLAttributes<HTMLDivElement>) => (
<div
className={cn(
"flex flex-col space-y-1.5 text-center sm:text-left",
className
)}
{...props}
/>
)
DialogHeader.displayName = "DialogHeader"

const DialogFooter = ({
className,
...props
}: React.HTMLAttributes<HTMLDivElement>) => (
<div
className={cn(
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
className
)}
{...props}
/>
)
DialogFooter.displayName = "DialogFooter"

const DialogTitle = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Title>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
>(({ className, ...props }, ref) => (
<DialogPrimitive.Title
ref={ref}
className={cn(
"text-lg font-semibold leading-none tracking-tight",
className
)}
{...props}
/>
))
DialogTitle.displayName = DialogPrimitive.Title.displayName

const DialogDescription = React.forwardRef<
React.ElementRef<typeof DialogPrimitive.Description>,
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
>(({ className, ...props }, ref) => (
<DialogPrimitive.Description
ref={ref}
className={cn("text-sm text-muted-foreground", className)}
{...props}
/>
))
DialogDescription.displayName = DialogPrimitive.Description.displayName

export {
Dialog,
DialogPortal,
DialogOverlay,
DialogTrigger,
DialogClose,
DialogContent,
DialogHeader,
DialogFooter,
DialogTitle,
DialogDescription,
}
2 changes: 1 addition & 1 deletion docs/components/ui/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const TableRow = React.forwardRef<
<tr
ref={ref}
className={cn(
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
"border-b transition-colors data-[state=selected]:bg-muted",
className,
)}
{...props}
Expand Down
Empty file removed docs/examples/actions-inside.tsx
Empty file.
Loading

0 comments on commit e467914

Please sign in to comment.