open-ds 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +66 -2
- package/assets/schemes/accessible-first.json +3093 -0
- package/assets/schemes/brand-expressive.json +3124 -0
- package/assets/schemes/content-first.json +3110 -0
- package/assets/schemes/dense-data.json +3489 -0
- package/assets/schemes/grammar.json +3903 -0
- package/assets/schemes/multi-brand.json +4359 -0
- package/assets/skills/open-ds/SKILL.md +50 -0
- package/assets/skills/open-ds-build/SKILL.md +19 -0
- package/assets/skills/open-ds-change/SKILL.md +19 -0
- package/assets/skills/open-ds-choose/SKILL.md +18 -0
- package/assets/skills/open-ds-review/SKILL.md +22 -0
- package/assets/skills/open-ds-write/SKILL.md +13 -0
- package/assets/stories/accordion.stories.tsx +46 -0
- package/assets/stories/alert-dialog.stories.tsx +65 -0
- package/assets/stories/alert.stories.tsx +44 -0
- package/assets/stories/aspect-ratio.stories.tsx +37 -0
- package/assets/stories/avatar.stories.tsx +42 -0
- package/assets/stories/badge.stories.tsx +39 -0
- package/assets/stories/breadcrumb.stories.tsx +54 -0
- package/assets/stories/button.stories.tsx +46 -0
- package/assets/stories/calendar.stories.tsx +30 -0
- package/assets/stories/card.stories.tsx +50 -0
- package/assets/stories/carousel.stories.tsx +64 -0
- package/assets/stories/chart.stories.tsx +61 -0
- package/assets/stories/checkbox.stories.tsx +29 -0
- package/assets/stories/collapsible.stories.tsx +39 -0
- package/assets/stories/combobox.stories.tsx +57 -0
- package/assets/stories/command.stories.tsx +60 -0
- package/assets/stories/context-menu.stories.tsx +55 -0
- package/assets/stories/data-table.stories.tsx +93 -0
- package/assets/stories/date-picker.stories.tsx +27 -0
- package/assets/stories/dialog.stories.tsx +70 -0
- package/assets/stories/drawer.stories.tsx +62 -0
- package/assets/stories/dropdown-menu.stories.tsx +65 -0
- package/assets/stories/empty.stories.tsx +39 -0
- package/assets/stories/field.stories.tsx +42 -0
- package/assets/stories/form.stories.tsx +56 -0
- package/assets/stories/input-group.stories.tsx +41 -0
- package/assets/stories/input-otp.stories.tsx +48 -0
- package/assets/stories/input.stories.tsx +32 -0
- package/assets/stories/kbd.stories.tsx +30 -0
- package/assets/stories/label.stories.tsx +26 -0
- package/assets/stories/native-select.stories.tsx +39 -0
- package/assets/stories/navigation-menu.stories.tsx +41 -0
- package/assets/stories/pagination.stories.tsx +61 -0
- package/assets/stories/popover.stories.tsx +37 -0
- package/assets/stories/progress.stories.tsx +30 -0
- package/assets/stories/radio-group.stories.tsx +45 -0
- package/assets/stories/resizable.stories.tsx +54 -0
- package/assets/stories/scroll-area.stories.tsx +47 -0
- package/assets/stories/select.stories.tsx +57 -0
- package/assets/stories/separator.stories.tsx +28 -0
- package/assets/stories/sheet.stories.tsx +46 -0
- package/assets/stories/sidebar.stories.tsx +62 -0
- package/assets/stories/skeleton.stories.tsx +27 -0
- package/assets/stories/slider.stories.tsx +44 -0
- package/assets/stories/spinner.stories.tsx +25 -0
- package/assets/stories/switch.stories.tsx +29 -0
- package/assets/stories/table.stories.tsx +97 -0
- package/assets/stories/tabs.stories.tsx +55 -0
- package/assets/stories/textarea.stories.tsx +28 -0
- package/assets/stories/toast.stories.tsx +30 -0
- package/assets/stories/toggle-group.stories.tsx +41 -0
- package/assets/stories/toggle.stories.tsx +20 -0
- package/assets/stories/tooltip.stories.tsx +49 -0
- package/assets/tokens/accessible-first/content.json +32 -0
- package/assets/tokens/accessible-first/dark.tokens.json +581 -0
- package/assets/tokens/accessible-first/light.tokens.json +581 -0
- package/assets/tokens/accessible-first/shadcn.css +21 -0
- package/assets/tokens/accessible-first/theme.css +101 -0
- package/assets/tokens/accessible-first/tokens.css +331 -0
- package/assets/tokens/accessible-first/tokens.json +1616 -0
- package/assets/tokens/accessible-first/tokens.scoped.css +333 -0
- package/assets/tokens/brand-expressive/content.json +32 -0
- package/assets/tokens/brand-expressive/dark.tokens.json +585 -0
- package/assets/tokens/brand-expressive/light.tokens.json +585 -0
- package/assets/tokens/brand-expressive/shadcn.css +21 -0
- package/assets/tokens/brand-expressive/theme.css +101 -0
- package/assets/tokens/brand-expressive/tokens.css +331 -0
- package/assets/tokens/brand-expressive/tokens.json +1651 -0
- package/assets/tokens/brand-expressive/tokens.scoped.css +333 -0
- package/assets/tokens/content-first/content.json +32 -0
- package/assets/tokens/content-first/dark.tokens.json +582 -0
- package/assets/tokens/content-first/light.tokens.json +582 -0
- package/assets/tokens/content-first/shadcn.css +21 -0
- package/assets/tokens/content-first/theme.css +101 -0
- package/assets/tokens/content-first/tokens.css +331 -0
- package/assets/tokens/content-first/tokens.json +1631 -0
- package/assets/tokens/content-first/tokens.scoped.css +333 -0
- package/assets/tokens/dense-data/content.json +32 -0
- package/assets/tokens/dense-data/dark.tokens.json +580 -0
- package/assets/tokens/dense-data/light.tokens.json +580 -0
- package/assets/tokens/dense-data/shadcn.css +21 -0
- package/assets/tokens/dense-data/theme.css +101 -0
- package/assets/tokens/dense-data/tokens.css +331 -0
- package/assets/tokens/dense-data/tokens.json +1623 -0
- package/assets/tokens/dense-data/tokens.scoped.css +333 -0
- package/assets/tokens/index.json +143 -0
- package/assets/tokens/multi-brand/aster-dark.tokens.json +625 -0
- package/assets/tokens/multi-brand/aster-light.tokens.json +625 -0
- package/assets/tokens/multi-brand/birch-dark.tokens.json +625 -0
- package/assets/tokens/multi-brand/birch-light.tokens.json +625 -0
- package/assets/tokens/multi-brand/content.json +32 -0
- package/assets/tokens/multi-brand/coral-dark.tokens.json +625 -0
- package/assets/tokens/multi-brand/coral-light.tokens.json +625 -0
- package/assets/tokens/multi-brand/shadcn.css +21 -0
- package/assets/tokens/multi-brand/theme.css +101 -0
- package/assets/tokens/multi-brand/tokens.css +1002 -0
- package/assets/tokens/multi-brand/tokens.json +1754 -0
- package/assets/tokens/multi-brand/tokens.scoped.css +1022 -0
- package/assets/tokens/shadcn-map.json +34 -0
- package/assets/ui/components/accordion.tsx +60 -0
- package/assets/ui/components/alert-dialog.tsx +171 -0
- package/assets/ui/components/alert.tsx +56 -0
- package/assets/ui/components/aspect-ratio.tsx +17 -0
- package/assets/ui/components/avatar.tsx +96 -0
- package/assets/ui/components/badge.tsx +36 -0
- package/assets/ui/components/breadcrumb.tsx +99 -0
- package/assets/ui/components/button.tsx +53 -0
- package/assets/ui/components/calendar.tsx +169 -0
- package/assets/ui/components/card.tsx +72 -0
- package/assets/ui/components/carousel.tsx +224 -0
- package/assets/ui/components/chart.tsx +315 -0
- package/assets/ui/components/checkbox.tsx +29 -0
- package/assets/ui/components/collapsible.tsx +25 -0
- package/assets/ui/components/combobox.tsx +275 -0
- package/assets/ui/components/command.tsx +145 -0
- package/assets/ui/components/context-menu.tsx +218 -0
- package/assets/ui/components/data-table.tsx +307 -0
- package/assets/ui/components/date-picker.tsx +79 -0
- package/assets/ui/components/dialog.tsx +68 -0
- package/assets/ui/components/drawer.tsx +115 -0
- package/assets/ui/components/dropdown-menu.tsx +58 -0
- package/assets/ui/components/empty.tsx +92 -0
- package/assets/ui/components/field.tsx +234 -0
- package/assets/ui/components/form.tsx +146 -0
- package/assets/ui/components/input-group.tsx +154 -0
- package/assets/ui/components/input-otp.tsx +75 -0
- package/assets/ui/components/input.tsx +25 -0
- package/assets/ui/components/kbd.tsx +30 -0
- package/assets/ui/components/label.tsx +22 -0
- package/assets/ui/components/native-select.tsx +59 -0
- package/assets/ui/components/navigation-menu.tsx +149 -0
- package/assets/ui/components/pagination.tsx +108 -0
- package/assets/ui/components/popover.tsx +61 -0
- package/assets/ui/components/progress.tsx +31 -0
- package/assets/ui/components/radio-group.tsx +40 -0
- package/assets/ui/components/resizable.tsx +54 -0
- package/assets/ui/components/scroll-area.tsx +55 -0
- package/assets/ui/components/select.tsx +81 -0
- package/assets/ui/components/separator.tsx +35 -0
- package/assets/ui/components/sheet.tsx +114 -0
- package/assets/ui/components/sidebar.tsx +685 -0
- package/assets/ui/components/skeleton.tsx +15 -0
- package/assets/ui/components/slider.tsx +70 -0
- package/assets/ui/components/spinner.tsx +16 -0
- package/assets/ui/components/switch.tsx +32 -0
- package/assets/ui/components/table.tsx +78 -0
- package/assets/ui/components/tabs.tsx +49 -0
- package/assets/ui/components/textarea.tsx +25 -0
- package/assets/ui/components/toast.tsx +54 -0
- package/assets/ui/components/toggle-group.tsx +88 -0
- package/assets/ui/components/toggle.tsx +48 -0
- package/assets/ui/components/tooltip.tsx +34 -0
- package/assets/ui/lib/use-mobile.ts +20 -0
- package/assets/ui/lib/utils.ts +7 -0
- package/assets/ui/styles.css +27 -0
- package/bin/open-ds.js +6 -0
- package/package.json +56 -4
- package/src/agents.mjs +150 -0
- package/src/cli.mjs +445 -0
- package/src/components.mjs +69 -0
- package/src/context.mjs +143 -0
- package/src/create.mjs +377 -0
- package/src/docs.mjs +570 -0
- package/src/guidance.mjs +63 -0
- package/src/index.mjs +20 -0
- package/src/mcp.mjs +660 -0
- package/src/readmes.mjs +106 -0
- package/src/schemes.mjs +188 -0
- package/src/tokens.mjs +127 -0
- package/templates/project/.github/workflows/ci.yml +15 -0
- package/templates/project/.storybook/component-docs.mdx +26 -0
- package/templates/project/.storybook/main.ts +17 -0
- package/templates/project/.storybook/manager-head.html +3 -0
- package/templates/project/.storybook/manager.ts +37 -0
- package/templates/project/.storybook/preview-head.html +3 -0
- package/templates/project/.storybook/preview.tsx +82 -0
- package/templates/project/docs/docusaurus.config.ts +64 -0
- package/templates/project/docs/sidebars.ts +8 -0
- package/templates/project/docs/src/css/custom.css +275 -0
- package/templates/project/gitignore +6 -0
- package/templates/project/src/styles/index.css +16 -0
- package/templates/project/src/vite-env.d.ts +7 -0
- package/templates/project/stories/docs-blocks.tsx +190 -0
- package/templates/project/stories/samples.tsx +102 -0
- package/templates/project/stories/usage.tsx +31 -0
- package/templates/project/tokens/build.mjs +468 -0
- package/templates/project/tsconfig.json +15 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pagination. Moves between pages of results.
|
|
3
|
+
*
|
|
4
|
+
* From shadcn/ui (new-york-v4, MIT), carried by the schemes whose inventory names it.
|
|
5
|
+
* Reads the shadcn variables, which theme.css maps onto the scheme's semantic tokens, and the
|
|
6
|
+
* radius, shadow and text scale that shadcn.css maps onto the scheme's tokens. Dark mode comes
|
|
7
|
+
* from the tokens, so no dark: classes.
|
|
8
|
+
*/
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
import { cn } from "../lib/utils";
|
|
11
|
+
import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
|
|
12
|
+
|
|
13
|
+
import { buttonVariants, type Button } from "./button";
|
|
14
|
+
|
|
15
|
+
function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
|
|
16
|
+
return (
|
|
17
|
+
<nav
|
|
18
|
+
role="navigation"
|
|
19
|
+
aria-label="pagination"
|
|
20
|
+
data-slot="pagination"
|
|
21
|
+
className={cn("mx-auto flex w-full justify-center", className)}
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function PaginationContent({ className, ...props }: React.ComponentProps<"ul">) {
|
|
28
|
+
return <ul data-slot="pagination-content" className={cn("flex flex-row items-center gap-1", className)} {...props} />;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function PaginationItem({ ...props }: React.ComponentProps<"li">) {
|
|
32
|
+
return <li data-slot="pagination-item" {...props} />;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
type PaginationLinkProps = {
|
|
36
|
+
isActive?: boolean;
|
|
37
|
+
} & Pick<React.ComponentProps<typeof Button>, "size"> &
|
|
38
|
+
React.ComponentProps<"a">;
|
|
39
|
+
|
|
40
|
+
function PaginationLink({ className, isActive, size = "icon", ...props }: PaginationLinkProps) {
|
|
41
|
+
return (
|
|
42
|
+
<a
|
|
43
|
+
aria-current={isActive ? "page" : undefined}
|
|
44
|
+
data-slot="pagination-link"
|
|
45
|
+
data-active={isActive}
|
|
46
|
+
className={cn(
|
|
47
|
+
buttonVariants({
|
|
48
|
+
variant: isActive ? "secondary" : "ghost",
|
|
49
|
+
size,
|
|
50
|
+
}),
|
|
51
|
+
className,
|
|
52
|
+
)}
|
|
53
|
+
{...props}
|
|
54
|
+
/>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function PaginationPrevious({ className, ...props }: React.ComponentProps<typeof PaginationLink>) {
|
|
59
|
+
return (
|
|
60
|
+
<PaginationLink
|
|
61
|
+
aria-label="Go to previous page"
|
|
62
|
+
size="default"
|
|
63
|
+
className={cn("gap-1 px-2.5 sm:pl-2.5", className)}
|
|
64
|
+
{...props}
|
|
65
|
+
>
|
|
66
|
+
<ChevronLeftIcon />
|
|
67
|
+
<span className="hidden sm:block">Previous</span>
|
|
68
|
+
</PaginationLink>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function PaginationNext({ className, ...props }: React.ComponentProps<typeof PaginationLink>) {
|
|
73
|
+
return (
|
|
74
|
+
<PaginationLink
|
|
75
|
+
aria-label="Go to next page"
|
|
76
|
+
size="default"
|
|
77
|
+
className={cn("gap-1 px-2.5 sm:pr-2.5", className)}
|
|
78
|
+
{...props}
|
|
79
|
+
>
|
|
80
|
+
<span className="hidden sm:block">Next</span>
|
|
81
|
+
<ChevronRightIcon />
|
|
82
|
+
</PaginationLink>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function PaginationEllipsis({ className, ...props }: React.ComponentProps<"span">) {
|
|
87
|
+
return (
|
|
88
|
+
<span
|
|
89
|
+
aria-hidden
|
|
90
|
+
data-slot="pagination-ellipsis"
|
|
91
|
+
className={cn("flex size-9 items-center justify-center", className)}
|
|
92
|
+
{...props}
|
|
93
|
+
>
|
|
94
|
+
<MoreHorizontalIcon className="size-4" />
|
|
95
|
+
<span className="sr-only">More pages</span>
|
|
96
|
+
</span>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export {
|
|
101
|
+
Pagination,
|
|
102
|
+
PaginationContent,
|
|
103
|
+
PaginationLink,
|
|
104
|
+
PaginationItem,
|
|
105
|
+
PaginationPrevious,
|
|
106
|
+
PaginationNext,
|
|
107
|
+
PaginationEllipsis,
|
|
108
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Popover. Rich content in a floating panel, opened by click.
|
|
3
|
+
*
|
|
4
|
+
* From shadcn/ui (new-york-v4, MIT), carried by the schemes whose inventory names it.
|
|
5
|
+
* Reads the shadcn variables, which theme.css maps onto the scheme's semantic tokens, and the
|
|
6
|
+
* radius, shadow and text scale that shadcn.css maps onto the scheme's tokens. Dark mode comes
|
|
7
|
+
* from the tokens, so no dark: classes.
|
|
8
|
+
*/
|
|
9
|
+
"use client";
|
|
10
|
+
|
|
11
|
+
import * as React from "react";
|
|
12
|
+
import { cn } from "../lib/utils";
|
|
13
|
+
import { Popover as PopoverPrimitive } from "radix-ui";
|
|
14
|
+
|
|
15
|
+
function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
|
|
16
|
+
return <PopoverPrimitive.Root data-slot="popover" {...props} />;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
|
|
20
|
+
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function PopoverContent({
|
|
24
|
+
className,
|
|
25
|
+
align = "center",
|
|
26
|
+
sideOffset = 4,
|
|
27
|
+
...props
|
|
28
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Content>) {
|
|
29
|
+
return (
|
|
30
|
+
<PopoverPrimitive.Portal>
|
|
31
|
+
<PopoverPrimitive.Content
|
|
32
|
+
data-slot="popover-content"
|
|
33
|
+
align={align}
|
|
34
|
+
sideOffset={sideOffset}
|
|
35
|
+
className={cn(
|
|
36
|
+
"z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
37
|
+
className,
|
|
38
|
+
)}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
</PopoverPrimitive.Portal>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
|
|
46
|
+
return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
50
|
+
return <div data-slot="popover-header" className={cn("flex flex-col gap-1 text-sm", className)} {...props} />;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">) {
|
|
54
|
+
return <div data-slot="popover-title" className={cn("font-medium", className)} {...props} />;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function PopoverDescription({ className, ...props }: React.ComponentProps<"p">) {
|
|
58
|
+
return <p data-slot="popover-description" className={cn("text-muted-foreground", className)} {...props} />;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor, PopoverHeader, PopoverTitle, PopoverDescription };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Progress. How far a task has come.
|
|
3
|
+
*
|
|
4
|
+
* From shadcn/ui (new-york-v4, MIT), carried by the schemes whose inventory names it.
|
|
5
|
+
* Reads the shadcn variables, which theme.css maps onto the scheme's semantic tokens, and the
|
|
6
|
+
* radius, shadow and text scale that shadcn.css maps onto the scheme's tokens. Dark mode comes
|
|
7
|
+
* from the tokens, so no dark: classes.
|
|
8
|
+
*/
|
|
9
|
+
"use client";
|
|
10
|
+
|
|
11
|
+
import * as React from "react";
|
|
12
|
+
import { cn } from "../lib/utils";
|
|
13
|
+
import { Progress as ProgressPrimitive } from "radix-ui";
|
|
14
|
+
|
|
15
|
+
function Progress({ className, value, ...props }: React.ComponentProps<typeof ProgressPrimitive.Root>) {
|
|
16
|
+
return (
|
|
17
|
+
<ProgressPrimitive.Root
|
|
18
|
+
data-slot="progress"
|
|
19
|
+
className={cn("relative h-2 w-full overflow-hidden rounded-full bg-primary/20", className)}
|
|
20
|
+
{...props}
|
|
21
|
+
>
|
|
22
|
+
<ProgressPrimitive.Indicator
|
|
23
|
+
data-slot="progress-indicator"
|
|
24
|
+
className="h-full w-full flex-1 bg-primary transition-all"
|
|
25
|
+
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
|
|
26
|
+
/>
|
|
27
|
+
</ProgressPrimitive.Root>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { Progress };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Radio group. One choice from a short list.
|
|
3
|
+
*
|
|
4
|
+
* From shadcn/ui (new-york-v4, MIT), carried by the schemes whose inventory names it.
|
|
5
|
+
* Reads the shadcn variables, which theme.css maps onto the scheme's semantic tokens, and the
|
|
6
|
+
* radius, shadow and text scale that shadcn.css maps onto the scheme's tokens. Dark mode comes
|
|
7
|
+
* from the tokens, so no dark: classes.
|
|
8
|
+
*/
|
|
9
|
+
"use client";
|
|
10
|
+
|
|
11
|
+
import * as React from "react";
|
|
12
|
+
import { cn } from "../lib/utils";
|
|
13
|
+
import { CircleIcon } from "lucide-react";
|
|
14
|
+
import { RadioGroup as RadioGroupPrimitive } from "radix-ui";
|
|
15
|
+
|
|
16
|
+
function RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
|
|
17
|
+
return <RadioGroupPrimitive.Root data-slot="radio-group" className={cn("grid gap-3", className)} {...props} />;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function RadioGroupItem({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
|
|
21
|
+
return (
|
|
22
|
+
<RadioGroupPrimitive.Item
|
|
23
|
+
data-slot="radio-group-item"
|
|
24
|
+
className={cn(
|
|
25
|
+
"aspect-square size-4 shrink-0 rounded-full border border-input text-primary shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20",
|
|
26
|
+
className,
|
|
27
|
+
)}
|
|
28
|
+
{...props}
|
|
29
|
+
>
|
|
30
|
+
<RadioGroupPrimitive.Indicator
|
|
31
|
+
data-slot="radio-group-indicator"
|
|
32
|
+
className="relative flex items-center justify-center"
|
|
33
|
+
>
|
|
34
|
+
<CircleIcon className="absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-primary" />
|
|
35
|
+
</RadioGroupPrimitive.Indicator>
|
|
36
|
+
</RadioGroupPrimitive.Item>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resizable. Panels the user can resize by dragging.
|
|
3
|
+
*
|
|
4
|
+
* From shadcn/ui (new-york-v4, MIT), carried by the schemes whose inventory names it.
|
|
5
|
+
* Reads the shadcn variables, which theme.css maps onto the scheme's semantic tokens, and the
|
|
6
|
+
* radius, shadow and text scale that shadcn.css maps onto the scheme's tokens. Dark mode comes
|
|
7
|
+
* from the tokens, so no dark: classes.
|
|
8
|
+
*/
|
|
9
|
+
"use client";
|
|
10
|
+
|
|
11
|
+
import { cn } from "../lib/utils";
|
|
12
|
+
import { GripVerticalIcon } from "lucide-react";
|
|
13
|
+
import * as ResizablePrimitive from "react-resizable-panels";
|
|
14
|
+
|
|
15
|
+
function ResizablePanelGroup({ className, ...props }: ResizablePrimitive.GroupProps) {
|
|
16
|
+
return (
|
|
17
|
+
<ResizablePrimitive.Group
|
|
18
|
+
data-slot="resizable-panel-group"
|
|
19
|
+
className={cn("flex h-full w-full aria-[orientation=vertical]:flex-col", className)}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function ResizablePanel({ ...props }: ResizablePrimitive.PanelProps) {
|
|
26
|
+
return <ResizablePrimitive.Panel data-slot="resizable-panel" {...props} />;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function ResizableHandle({
|
|
30
|
+
withHandle,
|
|
31
|
+
className,
|
|
32
|
+
...props
|
|
33
|
+
}: ResizablePrimitive.SeparatorProps & {
|
|
34
|
+
withHandle?: boolean;
|
|
35
|
+
}) {
|
|
36
|
+
return (
|
|
37
|
+
<ResizablePrimitive.Separator
|
|
38
|
+
data-slot="resizable-handle"
|
|
39
|
+
className={cn(
|
|
40
|
+
"relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90",
|
|
41
|
+
className,
|
|
42
|
+
)}
|
|
43
|
+
{...props}
|
|
44
|
+
>
|
|
45
|
+
{withHandle && (
|
|
46
|
+
<div className="z-10 flex h-4 w-3 items-center justify-center rounded-xs border bg-border">
|
|
47
|
+
<GripVerticalIcon className="size-2.5" />
|
|
48
|
+
</div>
|
|
49
|
+
)}
|
|
50
|
+
</ResizablePrimitive.Separator>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { ResizableHandle, ResizablePanel, ResizablePanelGroup };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scroll area. A region with styled scrollbars.
|
|
3
|
+
*
|
|
4
|
+
* From shadcn/ui (new-york-v4, MIT), carried by the schemes whose inventory names it.
|
|
5
|
+
* Reads the shadcn variables, which theme.css maps onto the scheme's semantic tokens, and the
|
|
6
|
+
* radius, shadow and text scale that shadcn.css maps onto the scheme's tokens. Dark mode comes
|
|
7
|
+
* from the tokens, so no dark: classes.
|
|
8
|
+
*/
|
|
9
|
+
"use client";
|
|
10
|
+
|
|
11
|
+
import * as React from "react";
|
|
12
|
+
import { cn } from "../lib/utils";
|
|
13
|
+
import { ScrollArea as ScrollAreaPrimitive } from "radix-ui";
|
|
14
|
+
|
|
15
|
+
function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
|
|
16
|
+
return (
|
|
17
|
+
<ScrollAreaPrimitive.Root data-slot="scroll-area" className={cn("relative", className)} {...props}>
|
|
18
|
+
<ScrollAreaPrimitive.Viewport
|
|
19
|
+
data-slot="scroll-area-viewport"
|
|
20
|
+
className="size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1"
|
|
21
|
+
>
|
|
22
|
+
{children}
|
|
23
|
+
</ScrollAreaPrimitive.Viewport>
|
|
24
|
+
<ScrollBar />
|
|
25
|
+
<ScrollAreaPrimitive.Corner />
|
|
26
|
+
</ScrollAreaPrimitive.Root>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function ScrollBar({
|
|
31
|
+
className,
|
|
32
|
+
orientation = "vertical",
|
|
33
|
+
...props
|
|
34
|
+
}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
|
|
35
|
+
return (
|
|
36
|
+
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
37
|
+
data-slot="scroll-area-scrollbar"
|
|
38
|
+
orientation={orientation}
|
|
39
|
+
className={cn(
|
|
40
|
+
"flex touch-none p-px transition-colors select-none",
|
|
41
|
+
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent",
|
|
42
|
+
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
|
|
43
|
+
className,
|
|
44
|
+
)}
|
|
45
|
+
{...props}
|
|
46
|
+
>
|
|
47
|
+
<ScrollAreaPrimitive.ScrollAreaThumb
|
|
48
|
+
data-slot="scroll-area-thumb"
|
|
49
|
+
className="relative flex-1 rounded-full bg-border"
|
|
50
|
+
/>
|
|
51
|
+
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Select. Pick one option from a list. Uses the input keys for the trigger and the overlay keys
|
|
3
|
+
* for the list.
|
|
4
|
+
*
|
|
5
|
+
* Reads only component keys: --input-*, --overlay-*.
|
|
6
|
+
*/
|
|
7
|
+
import { Check, ChevronDown } from "lucide-react";
|
|
8
|
+
import { Select as SelectPrimitive } from "radix-ui";
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
import { cn } from "../lib/utils";
|
|
11
|
+
|
|
12
|
+
export const Select = SelectPrimitive.Root;
|
|
13
|
+
export const SelectGroup = SelectPrimitive.Group;
|
|
14
|
+
export const SelectValue = SelectPrimitive.Value;
|
|
15
|
+
|
|
16
|
+
export function SelectTrigger({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger>) {
|
|
17
|
+
return (
|
|
18
|
+
<SelectPrimitive.Trigger
|
|
19
|
+
data-slot="select-trigger"
|
|
20
|
+
className={cn(
|
|
21
|
+
"flex w-full items-center justify-between gap-2 h-[var(--input-height)] px-[var(--input-padding-x)] rounded-[var(--input-radius)]",
|
|
22
|
+
"bg-[var(--input-background)] text-[var(--input-text)] text-[length:var(--input-font-size)] [font-family:var(--type-body-font-family)]",
|
|
23
|
+
"border-[length:var(--border-width-default)] border-[var(--input-border)] data-[placeholder]:text-[var(--input-placeholder)]",
|
|
24
|
+
"outline-none focus-visible:ring-[length:var(--border-width-focus)] focus-visible:ring-[color:var(--input-border-focus)]",
|
|
25
|
+
className,
|
|
26
|
+
)}
|
|
27
|
+
{...props}
|
|
28
|
+
>
|
|
29
|
+
{children}
|
|
30
|
+
<SelectPrimitive.Icon asChild>
|
|
31
|
+
<ChevronDown className="size-[var(--size-icon)] opacity-70" />
|
|
32
|
+
</SelectPrimitive.Icon>
|
|
33
|
+
</SelectPrimitive.Trigger>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function SelectContent({
|
|
38
|
+
className,
|
|
39
|
+
children,
|
|
40
|
+
position = "popper",
|
|
41
|
+
...props
|
|
42
|
+
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
43
|
+
return (
|
|
44
|
+
<SelectPrimitive.Portal>
|
|
45
|
+
<SelectPrimitive.Content
|
|
46
|
+
data-slot="select-content"
|
|
47
|
+
position={position}
|
|
48
|
+
className={cn(
|
|
49
|
+
"z-50 min-w-[8rem] overflow-hidden p-1 rounded-[var(--overlay-radius)] bg-[var(--overlay-background)] text-[var(--color-text-primary)]",
|
|
50
|
+
"[box-shadow:var(--overlay-shadow)] border-[length:var(--border-width-default)] border-[var(--color-border-default)]",
|
|
51
|
+
position === "popper" && "w-[var(--radix-select-trigger-width)] translate-y-1",
|
|
52
|
+
className,
|
|
53
|
+
)}
|
|
54
|
+
{...props}
|
|
55
|
+
>
|
|
56
|
+
<SelectPrimitive.Viewport>{children}</SelectPrimitive.Viewport>
|
|
57
|
+
</SelectPrimitive.Content>
|
|
58
|
+
</SelectPrimitive.Portal>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>) {
|
|
63
|
+
return (
|
|
64
|
+
<SelectPrimitive.Item
|
|
65
|
+
data-slot="select-item"
|
|
66
|
+
className={cn(
|
|
67
|
+
"relative flex w-full cursor-default select-none items-center gap-2 pl-[var(--space-inset-cell-x)] pr-8 min-h-[var(--overlay-item-height)] rounded-[var(--radius-badge)]",
|
|
68
|
+
"text-[length:var(--type-body-font-size)] outline-none focus:bg-[var(--color-surface-sunken)] data-[disabled]:opacity-[var(--opacity-disabled)]",
|
|
69
|
+
className,
|
|
70
|
+
)}
|
|
71
|
+
{...props}
|
|
72
|
+
>
|
|
73
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
74
|
+
<span className="absolute right-2 flex items-center">
|
|
75
|
+
<SelectPrimitive.ItemIndicator>
|
|
76
|
+
<Check className="size-[var(--size-icon)]" />
|
|
77
|
+
</SelectPrimitive.ItemIndicator>
|
|
78
|
+
</span>
|
|
79
|
+
</SelectPrimitive.Item>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Separator. A line between groups.
|
|
3
|
+
*
|
|
4
|
+
* From shadcn/ui (new-york-v4, MIT), carried by the schemes whose inventory names it.
|
|
5
|
+
* Reads the shadcn variables, which theme.css maps onto the scheme's semantic tokens, and the
|
|
6
|
+
* radius, shadow and text scale that shadcn.css maps onto the scheme's tokens. Dark mode comes
|
|
7
|
+
* from the tokens, so no dark: classes.
|
|
8
|
+
*/
|
|
9
|
+
"use client";
|
|
10
|
+
|
|
11
|
+
import * as React from "react";
|
|
12
|
+
import { cn } from "../lib/utils";
|
|
13
|
+
import { Separator as SeparatorPrimitive } from "radix-ui";
|
|
14
|
+
|
|
15
|
+
function Separator({
|
|
16
|
+
className,
|
|
17
|
+
orientation = "horizontal",
|
|
18
|
+
decorative = true,
|
|
19
|
+
...props
|
|
20
|
+
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
|
|
21
|
+
return (
|
|
22
|
+
<SeparatorPrimitive.Root
|
|
23
|
+
data-slot="separator"
|
|
24
|
+
decorative={decorative}
|
|
25
|
+
orientation={orientation}
|
|
26
|
+
className={cn(
|
|
27
|
+
"shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
28
|
+
className,
|
|
29
|
+
)}
|
|
30
|
+
{...props}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { Separator };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sheet. A panel that slides in from an edge.
|
|
3
|
+
*
|
|
4
|
+
* From shadcn/ui (new-york-v4, MIT), carried by the schemes whose inventory names it.
|
|
5
|
+
* Reads the shadcn variables, which theme.css maps onto the scheme's semantic tokens, and the
|
|
6
|
+
* radius, shadow and text scale that shadcn.css maps onto the scheme's tokens. Dark mode comes
|
|
7
|
+
* from the tokens, so no dark: classes.
|
|
8
|
+
*/
|
|
9
|
+
"use client";
|
|
10
|
+
|
|
11
|
+
import * as React from "react";
|
|
12
|
+
import { cn } from "../lib/utils";
|
|
13
|
+
import { XIcon } from "lucide-react";
|
|
14
|
+
import { Dialog as SheetPrimitive } from "radix-ui";
|
|
15
|
+
|
|
16
|
+
function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
|
|
17
|
+
return <SheetPrimitive.Root data-slot="sheet" {...props} />;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
|
|
21
|
+
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>) {
|
|
25
|
+
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function SheetPortal({ ...props }: React.ComponentProps<typeof SheetPrimitive.Portal>) {
|
|
29
|
+
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function SheetOverlay({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
|
|
33
|
+
return (
|
|
34
|
+
<SheetPrimitive.Overlay
|
|
35
|
+
data-slot="sheet-overlay"
|
|
36
|
+
className={cn(
|
|
37
|
+
"fixed inset-0 z-50 bg-[var(--color-surface-scrim)] data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
38
|
+
className,
|
|
39
|
+
)}
|
|
40
|
+
{...props}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function SheetContent({
|
|
46
|
+
className,
|
|
47
|
+
children,
|
|
48
|
+
side = "right",
|
|
49
|
+
showCloseButton = true,
|
|
50
|
+
...props
|
|
51
|
+
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
52
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
53
|
+
showCloseButton?: boolean;
|
|
54
|
+
}) {
|
|
55
|
+
return (
|
|
56
|
+
<SheetPortal>
|
|
57
|
+
<SheetOverlay />
|
|
58
|
+
<SheetPrimitive.Content
|
|
59
|
+
data-slot="sheet-content"
|
|
60
|
+
className={cn(
|
|
61
|
+
"fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500",
|
|
62
|
+
side === "right" &&
|
|
63
|
+
"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
|
|
64
|
+
side === "left" &&
|
|
65
|
+
"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
66
|
+
side === "top" &&
|
|
67
|
+
"inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
|
|
68
|
+
side === "bottom" &&
|
|
69
|
+
"inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
70
|
+
className,
|
|
71
|
+
)}
|
|
72
|
+
{...props}
|
|
73
|
+
>
|
|
74
|
+
{children}
|
|
75
|
+
{showCloseButton && (
|
|
76
|
+
<SheetPrimitive.Close className="absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary">
|
|
77
|
+
<XIcon className="size-4" />
|
|
78
|
+
<span className="sr-only">Close</span>
|
|
79
|
+
</SheetPrimitive.Close>
|
|
80
|
+
)}
|
|
81
|
+
</SheetPrimitive.Content>
|
|
82
|
+
</SheetPortal>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
87
|
+
return <div data-slot="sheet-header" className={cn("flex flex-col gap-1.5 p-4", className)} {...props} />;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
91
|
+
return <div data-slot="sheet-footer" className={cn("mt-auto flex flex-col gap-2 p-4", className)} {...props} />;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>) {
|
|
95
|
+
return (
|
|
96
|
+
<SheetPrimitive.Title
|
|
97
|
+
data-slot="sheet-title"
|
|
98
|
+
className={cn("font-semibold text-foreground", className)}
|
|
99
|
+
{...props}
|
|
100
|
+
/>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>) {
|
|
105
|
+
return (
|
|
106
|
+
<SheetPrimitive.Description
|
|
107
|
+
data-slot="sheet-description"
|
|
108
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
109
|
+
{...props}
|
|
110
|
+
/>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription };
|