Skip to content

Commit 0948bc4

Browse files
authored
fix: colors & skeleton (codse#173)
1 parent 8430768 commit 0948bc4

File tree

14 files changed

+185
-220
lines changed

14 files changed

+185
-220
lines changed

animata/container/marquee.stories.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const Primary: Story = {
6464
},
6565

6666
render: (args) => (
67-
<div className="relative flex h-full max-h-96 min-h-72 w-full min-w-72 max-w-xl items-center justify-center overflow-hidden rounded border bg-background">
67+
<div className="storybook-fix relative flex h-full max-h-96 min-h-72 w-full min-w-72 items-center justify-center overflow-hidden rounded border bg-background">
6868
<Marquee {...args}>
6969
<Content />
7070
</Marquee>
@@ -75,7 +75,7 @@ export const Primary: Story = {
7575
export const Vertical: Story = {
7676
args: { vertical: true },
7777
render: (args) => (
78-
<div className="relative flex h-full max-h-96 min-h-72 w-full min-w-72 max-w-xl items-center justify-center overflow-hidden rounded-md border bg-background">
78+
<div className="storybook-fix relative flex h-full max-h-96 min-h-72 w-full min-w-72 items-center justify-center overflow-hidden rounded-md border bg-background">
7979
<Marquee className="items-center" {...args}>
8080
<Content />
8181
</Marquee>
@@ -88,7 +88,7 @@ export const Multiple: Story = {
8888
render: (args) => (
8989
<div
9090
className={cn(
91-
"relative flex h-full max-h-96 min-h-72 w-full min-w-72 max-w-xl items-center justify-center overflow-hidden rounded-md border bg-background",
91+
"storybook-fix relative flex h-full max-h-96 min-h-72 w-full min-w-72 items-center justify-center overflow-hidden rounded-md border bg-background",
9292
{
9393
"flex-row": args.vertical,
9494
"flex-col": !args.vertical,

animata/container/marquee.tsx

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -43,42 +43,41 @@ export default function Marquee({
4343
...props
4444
}: MarqueeProps) {
4545
return (
46-
<>
47-
<div
48-
{...props}
49-
className={cn(
50-
"group relative flex h-full w-full overflow-hidden p-2 [--duration:10s] [--gap:12px] [gap:var(--gap)]",
51-
{
52-
"flex-col": vertical,
53-
"flex-row": !vertical,
54-
},
55-
className,
56-
)}
57-
>
58-
{Array.from({ length: repeat }).map((_, index) => (
59-
<div
60-
key={`item-${index}`}
61-
className={cn("flex shrink-0 [gap:var(--gap)]", {
62-
"group-hover:[animation-play-state:paused]": pauseOnHover,
63-
"[animation-direction:reverse]": reverse,
64-
"animate-marquee-horizontal flex-row": !vertical,
65-
"animate-marquee-vertical flex-col": vertical,
66-
})}
67-
>
68-
{children}
69-
</div>
70-
))}
71-
</div>
72-
{applyMask && (
46+
<div
47+
{...props}
48+
className={cn(
49+
"group relative flex h-full w-full p-2 [--duration:10s] [--gap:12px] [gap:var(--gap)]",
50+
{
51+
"flex-col": vertical,
52+
"flex-row": !vertical,
53+
},
54+
className,
55+
)}
56+
>
57+
{Array.from({ length: repeat }).map((_, index) => (
7358
<div
74-
className={cn("pointer-events-none absolute z-10 h-full w-full", {
75-
"bg-gradient-to-b from-white/50 from-5% via-transparent via-50% to-white/50 to-95% dark:from-black/50 dark:to-black/50":
76-
vertical,
77-
"bg-gradient-to-r from-white/50 from-5% via-transparent via-50% to-white/50 to-95% dark:from-black/50 dark:to-black/50":
78-
!vertical,
59+
key={`item-${index}`}
60+
className={cn("flex shrink-0 [gap:var(--gap)]", {
61+
"group-hover:[animation-play-state:paused]": pauseOnHover,
62+
"[animation-direction:reverse]": reverse,
63+
"animate-marquee-horizontal flex-row": !vertical,
64+
"animate-marquee-vertical flex-col": vertical,
7965
})}
66+
>
67+
{children}
68+
</div>
69+
))}
70+
{applyMask && (
71+
<div
72+
className={cn(
73+
"pointer-events-none absolute inset-0 z-10 h-full w-full from-white/50 from-5% via-transparent via-50% to-white/50 to-95% dark:from-gray-800/50 dark:via-transparent dark:to-gray-800/50",
74+
{
75+
"bg-gradient-to-b": vertical,
76+
"bg-gradient-to-r": !vertical,
77+
},
78+
)}
8079
/>
8180
)}
82-
</>
81+
</div>
8382
);
8483
}

animata/skeleton/code.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { CodeIcon } from "lucide-react";
22

33
export default function Code() {
44
return (
5-
<div className="flex h-48 w-52 flex-col gap-3 rounded-md border bg-background p-3 shadow-xl transition-shadow hover:shadow-sm dark:border-zinc-700">
5+
<div className="flex min-h-52 w-52 flex-col gap-3 rounded-md border bg-background p-3 shadow-xl transition-shadow hover:shadow-sm dark:border-zinc-700">
66
<CodeIcon className="w-6 text-blue-500" />
77
<div className="flex flex-1 flex-col justify-center gap-2">
88
<div className="h-2 w-1/2 rounded-md bg-muted" />

animata/skeleton/cookie-banner.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default function CookieBanner() {
22
return (
3-
<div className="flex h-48 w-52 flex-col gap-3 rounded-md border bg-background p-3 shadow-xl transition-shadow hover:shadow-sm dark:border-zinc-700">
3+
<div className="flex min-h-52 w-52 flex-col gap-3 rounded-md border bg-background p-3 shadow-xl transition-shadow hover:shadow-sm dark:border-zinc-700">
44
<div className="flex flex-1 flex-col justify-center gap-2">
55
<div className="h-2 w-1/2 rounded-md bg-muted-foreground/25" />
66
<div className="h-2 w-3/4 rounded-md bg-muted" />

animata/skeleton/list.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default function List() {
22
return (
3-
<div className="flex min-h-48 w-52 flex-col gap-3 rounded-md border bg-background p-3 shadow-xl transition-shadow hover:shadow-sm dark:border-zinc-700">
3+
<div className="flex min-h-52 w-52 flex-col gap-3 rounded-md border bg-background p-3 shadow-xl transition-shadow hover:shadow-sm dark:border-zinc-700">
44
{Array.from({ length: 6 }).map((_, i) => (
55
<div key={`item-${i}`} className="flex w-full items-center justify-between gap-2">
66
<div className="h-2 w-2 rounded-md bg-muted" />
@@ -9,7 +9,7 @@ export default function List() {
99
</div>
1010
))}
1111

12-
<div className="flex w-full justify-end gap-2">
12+
<div className="mt-auto flex w-full justify-end gap-2">
1313
<button className="w-2/5 rounded-sm bg-green-500 p-2">
1414
<span className="block h-1.5 rounded-sm bg-muted" />
1515
</button>

animata/skeleton/receipt.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Building, DollarSign } from "lucide-react";
22

33
export default function Receipt() {
44
return (
5-
<div className="flex min-h-48 w-52 flex-col gap-3 rounded-md border bg-background p-3 shadow-xl transition-shadow hover:shadow-sm dark:border-zinc-700">
5+
<div className="flex min-h-52 w-52 flex-col gap-3 rounded-md border bg-background p-3 shadow-xl transition-shadow hover:shadow-sm dark:border-zinc-700">
66
<div className="flex justify-between border-b pb-3 dark:border-zinc-700">
77
<Building className="w-6 text-muted-foreground" />
88
<DollarSign className="w-6 text-blue-600" />
@@ -33,7 +33,7 @@ export default function Receipt() {
3333
<div className="h-2 w-8 rounded-md bg-muted" />
3434
</div>
3535

36-
<span className="inline-block w-fit rounded-md bg-blue-600 px-2 py-1 text-center text-xs font-semibold text-white">
36+
<span className="mt-auto inline-block w-fit rounded-md bg-blue-600 px-2 py-1 text-center text-xs font-semibold text-white">
3737
Receipt
3838
</span>
3939
</div>

animata/skeleton/report.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default function Report({ className }: { className?: string }) {
44
return (
55
<div
66
className={cn(
7-
"flex min-h-48 w-52 flex-col gap-3 rounded-md border bg-background p-3 shadow-xl transition-shadow hover:shadow-sm dark:border-zinc-700",
7+
"flex min-h-52 w-52 flex-col gap-3 rounded-md border bg-background p-3 shadow-xl transition-shadow hover:shadow-sm dark:border-zinc-700",
88
className,
99
)}
1010
>

components/command-menu.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,13 @@ export function CommandMenu({ ...props }: DialogProps) {
5555
<Button
5656
variant="outline"
5757
className={cn(
58-
"relative h-8 w-full justify-start rounded-[0.5rem] bg-background text-sm font-normal text-muted-foreground shadow-none sm:pr-12 md:w-40 lg:w-64",
58+
"relative h-8 w-full justify-start rounded-full border-none bg-foreground/10 px-4 text-sm font-normal text-background/75 shadow-none transition-all duration-300 hover:bg-foreground/20 hover:text-background/80 md:w-40 lg:w-64",
5959
)}
6060
onClick={() => setOpen(true)}
6161
{...props}
6262
>
63-
<span className="hidden lg:inline-flex">Search documentation...</span>
64-
<span className="inline-flex lg:hidden">Search...</span>
65-
<kbd className="pointer-events-none absolute right-[0.3rem] top-[0.3rem] hidden h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 sm:flex">
63+
<span className="inline-flex flex-1">Search...</span>
64+
<kbd className="pointer-events-none hidden flex-shrink-0 select-none items-center gap-1 rounded border border-background/30 bg-muted-foreground px-2 font-mono text-[10px] font-medium sm:flex">
6665
<span className="text-xs"></span>K
6766
</kbd>
6867
</Button>
@@ -72,7 +71,7 @@ export function CommandMenu({ ...props }: DialogProps) {
7271
<CommandEmpty>No results found.</CommandEmpty>
7372
<CommandGroup heading="Links">
7473
{docsConfig.mainNav
75-
.filter((navitem) => !navitem.external)
74+
.filter((item) => !item.external)
7675
.map((navItem) => (
7776
<CommandItem
7877
key={navItem.href}

components/ui/accordion.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
"use client"
1+
"use client";
22

3-
import * as React from "react"
4-
import * as AccordionPrimitive from "@radix-ui/react-accordion"
5-
import { ChevronDownIcon } from "@radix-ui/react-icons"
3+
import * as React from "react";
4+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
5+
import { ChevronDownIcon } from "@radix-ui/react-icons";
66

7-
import { cn } from "@/lib/utils"
7+
import { cn } from "@/lib/utils";
88

9-
const Accordion = AccordionPrimitive.Root
9+
const Accordion = AccordionPrimitive.Root;
1010

1111
const AccordionItem = React.forwardRef<
1212
React.ElementRef<typeof AccordionPrimitive.Item>,
1313
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
1414
>(({ className, ...props }, ref) => (
1515
<AccordionPrimitive.Item
1616
ref={ref}
17-
className={cn("border-b", className)}
17+
className={cn("border-b border-border", className)}
1818
{...props}
1919
/>
20-
))
21-
AccordionItem.displayName = "AccordionItem"
20+
));
21+
AccordionItem.displayName = "AccordionItem";
2222

2323
const AccordionTrigger = React.forwardRef<
2424
React.ElementRef<typeof AccordionPrimitive.Trigger>,
@@ -29,16 +29,16 @@ const AccordionTrigger = React.forwardRef<
2929
ref={ref}
3030
className={cn(
3131
"flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
32-
className
32+
className,
3333
)}
3434
{...props}
3535
>
3636
{children}
3737
<ChevronDownIcon className="h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200" />
3838
</AccordionPrimitive.Trigger>
3939
</AccordionPrimitive.Header>
40-
))
41-
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
40+
));
41+
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
4242

4343
const AccordionContent = React.forwardRef<
4444
React.ElementRef<typeof AccordionPrimitive.Content>,
@@ -51,7 +51,7 @@ const AccordionContent = React.forwardRef<
5151
>
5252
<div className={cn("pb-4 pt-0", className)}>{children}</div>
5353
</AccordionPrimitive.Content>
54-
))
55-
AccordionContent.displayName = AccordionPrimitive.Content.displayName
54+
));
55+
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
5656

57-
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
57+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };

0 commit comments

Comments
 (0)