@kornorg/design-system 0.8.0 → 0.8.2
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/README.md +5 -4
- package/dist/index.d.ts +87 -103
- package/dist/index.mjs +413 -579
- package/dist/themes/cobalt.css +2 -2
- package/dist/themes/gestplate.css +2 -2
- package/dist/themes/modern-neutral.css +2 -2
- package/dist/themes/spartan.css +2 -2
- package/dist/themes/sprout.css +2 -2
- package/dist/themes/warm.css +2 -2
- package/dist/tokens.d.ts +28 -31
- package/dist/tokens.mjs +48 -40
- package/package.json +12 -13
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ A React + Tailwind CSS v4 component library, distributed as an installable
|
|
|
4
4
|
package and kept in sync with [Claude Design](https://claude.ai/design) via
|
|
5
5
|
`/design-sync`. Supports various themes.
|
|
6
6
|
|
|
7
|
-
**[View the live showcase →](https://
|
|
7
|
+
**[View the live showcase →](https://lurking-walrus.github.io/design-system/)** — every
|
|
8
8
|
component, all six feels, light and dark, from one page. No install required.
|
|
9
9
|
|
|
10
10
|
## Using it in an app
|
|
@@ -156,8 +156,9 @@ pnpm check:contrast # Regenerate docs/accessibility/contrast.md after a token ch
|
|
|
156
156
|
(one file per feel); `src/tokens.ts` types the values with no CSS backing
|
|
157
157
|
(spacing, type scale, font weights) and `scripts/build-css.mjs` resolves the
|
|
158
158
|
default theme's CSS to literal values for the rest.
|
|
159
|
-
- **The package build** (
|
|
160
|
-
[ADR-0011](./docs/adr/0011-design-system-package.md)
|
|
159
|
+
- **The package build** (tsdown + Tailwind CLI) emits `dist/` — see
|
|
160
|
+
[ADR-0011](./docs/adr/0011-design-system-package.md) and
|
|
161
|
+
[ADR-0015](./docs/adr/0015-typescript-7-and-tsdown.md) (TypeScript 7, tsdown).
|
|
161
162
|
- **Adding/changing components**: edit source, run `pnpm build`, then re-sync to
|
|
162
163
|
Claude Design with `/design-sync` (it reads the built `dist/`). The sync inputs
|
|
163
164
|
live in `.design-sync/`.
|
|
@@ -168,7 +169,7 @@ pnpm check:contrast # Regenerate docs/accessibility/contrast.md after a token ch
|
|
|
168
169
|
|------|---------|
|
|
169
170
|
| [React 19](https://react.dev) + [Radix UI](https://www.radix-ui.com) | Components |
|
|
170
171
|
| [Tailwind CSS v4](https://tailwindcss.com) | Token-driven styling |
|
|
171
|
-
| [
|
|
172
|
+
| [tsdown](https://tsdown.dev) + [TypeScript 7](https://www.typescriptlang.org) | Library build (ESM + `.d.ts`) |
|
|
172
173
|
| [Biome](https://biomejs.dev) | Linter + formatter |
|
|
173
174
|
| [Vitest](https://vitest.dev) / [Playwright](https://playwright.dev) | Tests |
|
|
174
175
|
| [Next.js](https://nextjs.org) | Component showcase / docs surface |
|
package/dist/index.d.ts
CHANGED
|
@@ -1,88 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Design system — public component surface.
|
|
3
|
+
* Import from `@/components/ui` in apps that consume this package.
|
|
4
|
+
*/
|
|
5
|
+
import { VariantProps } from "class-variance-authority";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { Avatar as Avatar$1, Checkbox as Checkbox$1, Dialog as Dialog$1, Label as Label$1, Select as Select$1, Switch as Switch$1, Tabs as Tabs$1, Tooltip as Tooltip$1 } from "radix-ui";
|
|
6
8
|
declare const alertVariants: (props?: ({
|
|
7
|
-
|
|
8
|
-
} &
|
|
9
|
-
interface AlertProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof alertVariants> {
|
|
10
|
-
}
|
|
11
|
-
declare function
|
|
12
|
-
declare function
|
|
13
|
-
declare function
|
|
14
|
-
|
|
15
|
-
declare function
|
|
16
|
-
declare function AvatarImage({ className, ...props }: React.ComponentProps<typeof Avatar$1.Image>): React.JSX.Element;
|
|
17
|
-
declare function AvatarFallback({ className, ...props }: React.ComponentProps<typeof Avatar$1.Fallback>): React.JSX.Element;
|
|
18
|
-
|
|
9
|
+
variant?: "default" | "destructive" | "success" | "warning" | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
|
+
export interface AlertProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof alertVariants> {}
|
|
12
|
+
export declare function Alert({ className, variant, ...props }: AlertProps): React.JSX.Element;
|
|
13
|
+
export declare function AlertTitle({ className, ...props }: React.ComponentProps<"h5">): React.JSX.Element;
|
|
14
|
+
export declare function AlertDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
15
|
+
export declare function Avatar({ className, ...props }: React.ComponentProps<typeof Avatar$1.Root>): React.JSX.Element;
|
|
16
|
+
export declare function AvatarImage({ className, ...props }: React.ComponentProps<typeof Avatar$1.Image>): React.JSX.Element;
|
|
17
|
+
export declare function AvatarFallback({ className, ...props }: React.ComponentProps<typeof Avatar$1.Fallback>): React.JSX.Element;
|
|
19
18
|
declare const badgeVariants: (props?: ({
|
|
20
|
-
|
|
21
|
-
} &
|
|
22
|
-
interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
|
|
23
|
-
}
|
|
24
|
-
declare function Badge({ className, variant, ...props }: BadgeProps): React.JSX.Element;
|
|
25
|
-
|
|
19
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "success" | "warning" | null | undefined;
|
|
20
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
21
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {}
|
|
22
|
+
export declare function Badge({ className, variant, ...props }: BadgeProps): React.JSX.Element;
|
|
26
23
|
declare const buttonVariants: (props?: ({
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} &
|
|
30
|
-
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
variant?: "destructive" | "ghost" | "link" | "outline" | "primary" | "secondary" | null | undefined;
|
|
25
|
+
size?: "icon" | "lg" | "md" | "sm" | null | undefined;
|
|
26
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
27
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
28
|
+
/** Render as the child element (e.g. an `<a>`) instead of a `<button>`. */
|
|
29
|
+
asChild?: boolean;
|
|
33
30
|
}
|
|
34
|
-
declare function Button({ className, variant, size, asChild, ...props }: ButtonProps): React.JSX.Element;
|
|
35
|
-
|
|
36
|
-
declare function
|
|
37
|
-
declare function
|
|
38
|
-
declare function
|
|
39
|
-
declare function
|
|
40
|
-
declare function
|
|
41
|
-
declare function
|
|
42
|
-
|
|
43
|
-
declare
|
|
44
|
-
|
|
45
|
-
declare
|
|
46
|
-
declare
|
|
47
|
-
declare
|
|
48
|
-
declare function
|
|
49
|
-
declare function
|
|
50
|
-
|
|
51
|
-
declare function
|
|
52
|
-
declare function
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
declare
|
|
56
|
-
|
|
57
|
-
declare function
|
|
58
|
-
|
|
59
|
-
declare
|
|
60
|
-
declare
|
|
61
|
-
declare
|
|
62
|
-
declare function
|
|
63
|
-
declare function
|
|
64
|
-
declare function
|
|
65
|
-
declare function
|
|
66
|
-
|
|
67
|
-
declare function
|
|
68
|
-
|
|
69
|
-
declare
|
|
70
|
-
declare function
|
|
71
|
-
declare function
|
|
72
|
-
declare function
|
|
73
|
-
|
|
74
|
-
declare function
|
|
75
|
-
declare function TableCell({ className, ...props }: React.ComponentProps<"td">): React.JSX.Element;
|
|
76
|
-
declare function TableCaption({ className, ...props }: React.ComponentProps<"caption">): React.JSX.Element;
|
|
77
|
-
|
|
78
|
-
declare const Tabs: React.ForwardRefExoticComponent<Tabs$1.TabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
79
|
-
declare function TabsList({ className, ...props }: React.ComponentProps<typeof Tabs$1.List>): React.JSX.Element;
|
|
80
|
-
declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof Tabs$1.Trigger>): React.JSX.Element;
|
|
81
|
-
declare function TabsContent({ className, ...props }: React.ComponentProps<typeof Tabs$1.Content>): React.JSX.Element;
|
|
82
|
-
|
|
83
|
-
type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
84
|
-
declare function Textarea({ className, ...props }: TextareaProps): React.JSX.Element;
|
|
85
|
-
|
|
31
|
+
export declare function Button({ className, variant, size, asChild, ...props }: ButtonProps): React.JSX.Element;
|
|
32
|
+
export declare function Card({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
33
|
+
export declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
34
|
+
export declare function CardTitle({ className, ...props }: React.ComponentProps<"h3">): React.JSX.Element;
|
|
35
|
+
export declare function CardDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
|
36
|
+
export declare function CardContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
37
|
+
export declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
38
|
+
export declare function Checkbox({ className, ...props }: React.ComponentProps<typeof Checkbox$1.Root>): React.JSX.Element;
|
|
39
|
+
export declare const Dialog: React.FC<Dialog$1.DialogProps>;
|
|
40
|
+
export declare const DialogTrigger: React.ForwardRefExoticComponent<Dialog$1.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
41
|
+
export declare const DialogClose: React.ForwardRefExoticComponent<Dialog$1.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
42
|
+
export declare function DialogContent({ className, children, ...props }: React.ComponentProps<typeof Dialog$1.Content>): React.JSX.Element;
|
|
43
|
+
export declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
44
|
+
export declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
45
|
+
export declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof Dialog$1.Title>): React.JSX.Element;
|
|
46
|
+
export declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof Dialog$1.Description>): React.JSX.Element;
|
|
47
|
+
export type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
|
|
48
|
+
export declare function Input({ className, type, ...props }: InputProps): React.JSX.Element;
|
|
49
|
+
export declare function Label({ className, ...props }: React.ComponentProps<typeof Label$1.Root>): React.JSX.Element;
|
|
50
|
+
export declare const Select: React.FC<Select$1.SelectProps>;
|
|
51
|
+
export declare const SelectGroup: React.ForwardRefExoticComponent<Select$1.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
52
|
+
export declare const SelectValue: React.ForwardRefExoticComponent<Select$1.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
53
|
+
export declare function SelectTrigger({ className, children, ...props }: React.ComponentProps<typeof Select$1.Trigger>): React.JSX.Element;
|
|
54
|
+
export declare function SelectContent({ className, children, position, ...props }: React.ComponentProps<typeof Select$1.Content>): React.JSX.Element;
|
|
55
|
+
export declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof Select$1.Label>): React.JSX.Element;
|
|
56
|
+
export declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof Select$1.Item>): React.JSX.Element;
|
|
57
|
+
export declare function Switch({ className, ...props }: React.ComponentProps<typeof Switch$1.Root>): React.JSX.Element;
|
|
58
|
+
export declare function Table({ className, ...props }: React.ComponentProps<"table">): React.JSX.Element;
|
|
59
|
+
export declare function TableHeader({ className, ...props }: React.ComponentProps<"thead">): React.JSX.Element;
|
|
60
|
+
export declare function TableBody({ className, ...props }: React.ComponentProps<"tbody">): React.JSX.Element;
|
|
61
|
+
export declare function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">): React.JSX.Element;
|
|
62
|
+
export declare function TableRow({ className, ...props }: React.ComponentProps<"tr">): React.JSX.Element;
|
|
63
|
+
export declare function TableHead({ className, ...props }: React.ComponentProps<"th">): React.JSX.Element;
|
|
64
|
+
export declare function TableCell({ className, ...props }: React.ComponentProps<"td">): React.JSX.Element;
|
|
65
|
+
export declare function TableCaption({ className, ...props }: React.ComponentProps<"caption">): React.JSX.Element;
|
|
66
|
+
export declare const Tabs: React.ForwardRefExoticComponent<Tabs$1.TabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
67
|
+
export declare function TabsList({ className, ...props }: React.ComponentProps<typeof Tabs$1.List>): React.JSX.Element;
|
|
68
|
+
export declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof Tabs$1.Trigger>): React.JSX.Element;
|
|
69
|
+
export declare function TabsContent({ className, ...props }: React.ComponentProps<typeof Tabs$1.Content>): React.JSX.Element;
|
|
70
|
+
export type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
71
|
+
export declare function Textarea({ className, ...props }: TextareaProps): React.JSX.Element;
|
|
86
72
|
/**
|
|
87
73
|
* Class-based light/dark switching for every feel in the system.
|
|
88
74
|
*
|
|
@@ -93,21 +79,21 @@ declare function Textarea({ className, ...props }: TextareaProps): React.JSX.Ele
|
|
|
93
79
|
* wherever the control belongs. Dependency-free by design; if an app already
|
|
94
80
|
* uses `next-themes`, prefer that and use only the token layer from here.
|
|
95
81
|
*/
|
|
96
|
-
type ThemeMode = "light" | "dark" | "system";
|
|
82
|
+
export type ThemeMode = "light" | "dark" | "system";
|
|
97
83
|
/** localStorage key shared by <ThemeScript /> and <ThemeToggle /> unless overridden. */
|
|
98
|
-
declare const THEME_STORAGE_KEY = "theme";
|
|
84
|
+
export declare const THEME_STORAGE_KEY = "theme";
|
|
99
85
|
/**
|
|
100
86
|
* Read and change the current mode. `resolvedTheme` is undefined until mounted,
|
|
101
87
|
* because the concrete appearance is only knowable in the browser.
|
|
102
88
|
*/
|
|
103
|
-
declare function useTheme(storageKey?: string): {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
89
|
+
export declare function useTheme(storageKey?: string): {
|
|
90
|
+
theme: ThemeMode;
|
|
91
|
+
resolvedTheme: "dark" | "light" | undefined;
|
|
92
|
+
setTheme: (next: ThemeMode) => void;
|
|
93
|
+
mounted: boolean;
|
|
108
94
|
};
|
|
109
|
-
interface ThemeScriptProps {
|
|
110
|
-
|
|
95
|
+
export interface ThemeScriptProps {
|
|
96
|
+
storageKey?: string;
|
|
111
97
|
}
|
|
112
98
|
/**
|
|
113
99
|
* Blocking inline script that sets the `dark` class before first paint. Render
|
|
@@ -115,22 +101,20 @@ interface ThemeScriptProps {
|
|
|
115
101
|
* and add `suppressHydrationWarning` to <html> since the class it writes is not
|
|
116
102
|
* present in the server-rendered markup.
|
|
117
103
|
*/
|
|
118
|
-
declare function ThemeScript({ storageKey }: ThemeScriptProps): React.JSX.Element;
|
|
119
|
-
interface ThemeToggleProps extends Omit<ButtonProps, "onClick" | "children"> {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
104
|
+
export declare function ThemeScript({ storageKey }: ThemeScriptProps): React.JSX.Element;
|
|
105
|
+
export interface ThemeToggleProps extends Omit<ButtonProps, "onClick" | "children"> {
|
|
106
|
+
/** Cycle light → dark → system instead of a plain light/dark flip. */
|
|
107
|
+
withSystem?: boolean;
|
|
108
|
+
storageKey?: string;
|
|
123
109
|
}
|
|
124
110
|
/**
|
|
125
111
|
* Icon button that switches mode. The sun/moon glyphs are chosen in CSS off the
|
|
126
112
|
* `dark` class rather than from state, so the first paint is correct and there
|
|
127
113
|
* is nothing for hydration to mismatch on.
|
|
128
114
|
*/
|
|
129
|
-
declare function ThemeToggle({ withSystem, storageKey, variant, size, className, ...props }: ThemeToggleProps): React.JSX.Element;
|
|
130
|
-
|
|
131
|
-
declare const
|
|
132
|
-
declare const
|
|
133
|
-
declare
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
export { Alert, AlertDescription, type AlertProps, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Input, type InputProps, Label, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue, Switch, THEME_STORAGE_KEY, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, type ThemeMode, ThemeScript, type ThemeScriptProps, ThemeToggle, type ThemeToggleProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, alertVariants, badgeVariants, buttonVariants, useTheme };
|
|
115
|
+
export declare function ThemeToggle({ withSystem, storageKey, variant, size, className, ...props }: ThemeToggleProps): React.JSX.Element;
|
|
116
|
+
export declare const TooltipProvider: React.FC<Tooltip$1.TooltipProviderProps>;
|
|
117
|
+
export declare const Tooltip: React.FC<Tooltip$1.TooltipProps>;
|
|
118
|
+
export declare const TooltipTrigger: React.ForwardRefExoticComponent<Tooltip$1.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
119
|
+
export declare function TooltipContent({ className, sideOffset, ...props }: React.ComponentProps<typeof Tooltip$1.Content>): React.JSX.Element;
|
|
120
|
+
export { alertVariants, badgeVariants, buttonVariants };
|