@bykhd/lab-ds 0.0.0-stage → 1.1.0-beta.4
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 +88 -2
- package/dist/index.d.ts +137 -0
- package/dist/index.js +1041 -0
- package/dist/styles.css +3224 -0
- package/package.json +57 -4
- package/src/components/Alert/Alert.md +82 -0
- package/src/components/Badge/Badge.md +77 -0
- package/src/components/Button/Button.md +126 -0
- package/src/components/Card/Card.md +82 -0
- package/src/components/Checkbox/Checkbox.md +65 -0
- package/src/components/Dialog/Dialog.md +154 -0
- package/src/components/Field/Field.md +77 -0
- package/src/components/Input/Input.md +62 -0
- package/src/components/InputGroup/InputGroup.md +72 -0
- package/src/components/InputOTP/InputOTP.md +84 -0
- package/src/components/Label/Label.md +47 -0
- package/src/components/ProductCard/ProductCard.md +61 -0
- package/src/components/Separator/Separator.md +51 -0
- package/src/components/Tabs/Tabs.md +112 -0
- package/src/components/Textarea/Textarea.md +58 -0
package/README.md
CHANGED
|
@@ -1,3 +1,89 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @bykhd/lab-ds
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Daidai design system: React components built on [Base UI](https://base-ui.com) and styled with Tailwind CSS v4. Made for Next.js apps, works in any React 19 app.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @bykhd/lab-ds
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
`react` and `react-dom` 19 are peer dependencies.
|
|
12
|
+
|
|
13
|
+
## Stylesheet setup
|
|
14
|
+
|
|
15
|
+
The package ships one stylesheet, `@bykhd/lab-ds/styles.css`: the design tokens (CSS variables, Tailwind `@theme`, dark mode) plus the precompiled component styles. Import it after Tailwind in your global CSS:
|
|
16
|
+
|
|
17
|
+
```css
|
|
18
|
+
/* app/globals.css */
|
|
19
|
+
@import "tailwindcss";
|
|
20
|
+
@import "@bykhd/lab-ds/styles.css";
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
No `@source` line is needed: component styles are already compiled. Your app's Tailwind can use the tokens as utilities (`bg-…`, `text-…`, `border-…`).
|
|
24
|
+
|
|
25
|
+
Provide the font through `--font-sans`, for example with `next/font`:
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
// app/layout.tsx
|
|
29
|
+
import { Inter } from "next/font/google"
|
|
30
|
+
import "./globals.css"
|
|
31
|
+
|
|
32
|
+
const inter = Inter({ subsets: ["latin"], variable: "--font-sans" })
|
|
33
|
+
|
|
34
|
+
export default function RootLayout({ children }: { children: React.ReactNode }) {
|
|
35
|
+
return (
|
|
36
|
+
<html lang="en" className={inter.variable}>
|
|
37
|
+
<body>{children}</body>
|
|
38
|
+
</html>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Dark mode: add the `dark` class to `<html>`.
|
|
44
|
+
|
|
45
|
+
## Example
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
import { Button, Field, FieldLabel, Input } from "@bykhd/lab-ds"
|
|
49
|
+
|
|
50
|
+
export function SignUp() {
|
|
51
|
+
return (
|
|
52
|
+
<form>
|
|
53
|
+
<Field>
|
|
54
|
+
<FieldLabel htmlFor="email">Email</FieldLabel>
|
|
55
|
+
<Input id="email" type="email" />
|
|
56
|
+
</Field>
|
|
57
|
+
<Button type="submit">Sign up</Button>
|
|
58
|
+
</form>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The entry is marked `"use client"`, so you can import components straight into a Server Component file in the Next.js App Router.
|
|
64
|
+
|
|
65
|
+
## Components
|
|
66
|
+
|
|
67
|
+
Each component has a usage guideline shipped in the package at `node_modules/@bykhd/lab-ds/src/components/<Name>/<Name>.md`.
|
|
68
|
+
|
|
69
|
+
| Component | Exports |
|
|
70
|
+
| --- | --- |
|
|
71
|
+
| Alert | `Alert`, `AlertTitle`, `AlertDescription`, `AlertAction` |
|
|
72
|
+
| Badge | `Badge`, `badgeVariants` |
|
|
73
|
+
| Button | `Button`, `buttonVariants` |
|
|
74
|
+
| Card | `Card`, `CardHeader`, `CardTitle`, `CardDescription`, `CardAction`, `CardContent`, `CardFooter` |
|
|
75
|
+
| Checkbox | `Checkbox` |
|
|
76
|
+
| Dialog | `Dialog`, `DialogTrigger`, `DialogPortal`, `DialogOverlay`, `DialogContent`, `DialogHeader`, `DialogFooter`, `DialogTitle`, `DialogDescription`, `DialogClose` |
|
|
77
|
+
| Field | `Field`, `FieldSet`, `FieldLegend`, `FieldGroup`, `FieldContent`, `FieldLabel`, `FieldTitle`, `FieldDescription`, `FieldSeparator`, `FieldError` |
|
|
78
|
+
| Input | `Input` |
|
|
79
|
+
| InputGroup | `InputGroup`, `InputGroupAddon`, `InputGroupButton`, `InputGroupText`, `InputGroupInput`, `InputGroupTextarea` |
|
|
80
|
+
| InputOTP | `InputOTP`, `InputOTPGroup`, `InputOTPSlot`, `InputOTPSeparator` |
|
|
81
|
+
| Label | `Label` |
|
|
82
|
+
| ProductCard | `ProductCard` |
|
|
83
|
+
| Separator | `Separator` |
|
|
84
|
+
| Tabs | `Tabs`, `TabsList`, `TabsTrigger`, `TabsContent` |
|
|
85
|
+
| Textarea | `Textarea` |
|
|
86
|
+
|
|
87
|
+
## License
|
|
88
|
+
|
|
89
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import { Button as Button$1 } from '@base-ui/react/button';
|
|
4
|
+
import { Checkbox as Checkbox$1 } from '@base-ui/react/checkbox';
|
|
5
|
+
import { Dialog as Dialog$1 } from '@base-ui/react/dialog';
|
|
6
|
+
import { OTPInput } from 'input-otp';
|
|
7
|
+
import { Separator as Separator$1 } from '@base-ui/react/separator';
|
|
8
|
+
import { Tabs as Tabs$1 } from '@base-ui/react/tabs';
|
|
9
|
+
|
|
10
|
+
type AlertVariant = "default" | "destructive";
|
|
11
|
+
declare function Alert({ className, variant, ...props }: React$1.ComponentProps<"div"> & {
|
|
12
|
+
variant?: AlertVariant;
|
|
13
|
+
}): React$1.JSX.Element;
|
|
14
|
+
declare function AlertTitle({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
15
|
+
declare function AlertDescription({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
16
|
+
declare function AlertAction({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
17
|
+
|
|
18
|
+
type BadgeVariant = "default" | "secondary" | "destructive" | "outline" | "ghost" | "link";
|
|
19
|
+
type BadgeStyleProps = {
|
|
20
|
+
variant?: BadgeVariant;
|
|
21
|
+
};
|
|
22
|
+
/** Class string for styling non-Badge elements as badges. */
|
|
23
|
+
declare function badgeVariants({ variant }?: BadgeStyleProps): string;
|
|
24
|
+
declare function Badge({ className, variant, render, ...props }: useRender.ComponentProps<"span"> & BadgeStyleProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
25
|
+
|
|
26
|
+
type ButtonVariant = "default" | "outline" | "secondary" | "ghost" | "destructive" | "link";
|
|
27
|
+
type ButtonSize = "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg";
|
|
28
|
+
type ButtonStyleProps = {
|
|
29
|
+
variant?: ButtonVariant;
|
|
30
|
+
size?: ButtonSize;
|
|
31
|
+
/** Danger styling; currently defined for the `default` (primary) variant. */
|
|
32
|
+
danger?: boolean;
|
|
33
|
+
};
|
|
34
|
+
/** Class string for styling non-Button elements (e.g. links) as buttons. */
|
|
35
|
+
declare function buttonVariants({ variant, size, danger, }?: ButtonStyleProps): string;
|
|
36
|
+
declare function Button({ className, variant, size, danger, ...props }: Button$1.Props & ButtonStyleProps): React$1.JSX.Element;
|
|
37
|
+
|
|
38
|
+
type CardSize = "default" | "sm";
|
|
39
|
+
declare function Card({ className, size, ...props }: React$1.ComponentProps<"div"> & {
|
|
40
|
+
size?: CardSize;
|
|
41
|
+
}): React$1.JSX.Element;
|
|
42
|
+
declare function CardHeader({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
43
|
+
declare function CardTitle({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
44
|
+
declare function CardDescription({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
45
|
+
declare function CardAction({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
46
|
+
declare function CardContent({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
47
|
+
declare function CardFooter({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
48
|
+
|
|
49
|
+
declare function Checkbox({ className, ...props }: Checkbox$1.Root.Props): React$1.JSX.Element;
|
|
50
|
+
|
|
51
|
+
declare function Dialog({ ...props }: Dialog$1.Root.Props): React$1.JSX.Element;
|
|
52
|
+
declare function DialogTrigger({ ...props }: Dialog$1.Trigger.Props): React$1.JSX.Element;
|
|
53
|
+
declare function DialogPortal({ ...props }: Dialog$1.Portal.Props): React$1.JSX.Element;
|
|
54
|
+
declare function DialogClose({ ...props }: Dialog$1.Close.Props): React$1.JSX.Element;
|
|
55
|
+
declare function DialogOverlay({ className, ...props }: Dialog$1.Backdrop.Props): React$1.JSX.Element;
|
|
56
|
+
declare function DialogContent({ className, children, showCloseButton, ...props }: Dialog$1.Popup.Props & {
|
|
57
|
+
showCloseButton?: boolean;
|
|
58
|
+
}): React$1.JSX.Element;
|
|
59
|
+
declare function DialogHeader({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
60
|
+
declare function DialogFooter({ className, showCloseButton, children, ...props }: React$1.ComponentProps<"div"> & {
|
|
61
|
+
showCloseButton?: boolean;
|
|
62
|
+
}): React$1.JSX.Element;
|
|
63
|
+
declare function DialogTitle({ className, ...props }: Dialog$1.Title.Props): React$1.JSX.Element;
|
|
64
|
+
declare function DialogDescription({ className, ...props }: Dialog$1.Description.Props): React$1.JSX.Element;
|
|
65
|
+
|
|
66
|
+
declare function Label({ className, ...props }: React$1.ComponentProps<"label">): React$1.JSX.Element;
|
|
67
|
+
|
|
68
|
+
type FieldOrientation = "vertical" | "horizontal" | "responsive";
|
|
69
|
+
declare function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">): React$1.JSX.Element;
|
|
70
|
+
declare function FieldLegend({ className, variant, ...props }: React.ComponentProps<"legend"> & {
|
|
71
|
+
variant?: "legend" | "label";
|
|
72
|
+
}): React$1.JSX.Element;
|
|
73
|
+
declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">): React$1.JSX.Element;
|
|
74
|
+
declare function Field({ className, orientation, ...props }: React.ComponentProps<"div"> & {
|
|
75
|
+
orientation?: FieldOrientation;
|
|
76
|
+
}): React$1.JSX.Element;
|
|
77
|
+
declare function FieldContent({ className, ...props }: React.ComponentProps<"div">): React$1.JSX.Element;
|
|
78
|
+
declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>): React$1.JSX.Element;
|
|
79
|
+
declare function FieldTitle({ className, ...props }: React.ComponentProps<"div">): React$1.JSX.Element;
|
|
80
|
+
declare function FieldDescription({ className, ...props }: React.ComponentProps<"p">): React$1.JSX.Element;
|
|
81
|
+
declare function FieldSeparator({ children, className, ...props }: React.ComponentProps<"div"> & {
|
|
82
|
+
children?: React.ReactNode;
|
|
83
|
+
}): React$1.JSX.Element;
|
|
84
|
+
declare function FieldError({ className, children, errors, ...props }: React.ComponentProps<"div"> & {
|
|
85
|
+
errors?: Array<{
|
|
86
|
+
message?: string;
|
|
87
|
+
} | undefined>;
|
|
88
|
+
}): React$1.JSX.Element | null;
|
|
89
|
+
|
|
90
|
+
declare function Input({ className, type, ...props }: React$1.ComponentProps<"input">): React$1.JSX.Element;
|
|
91
|
+
|
|
92
|
+
type InputGroupAddonAlign = "inline-start" | "inline-end" | "block-start" | "block-end";
|
|
93
|
+
type InputGroupButtonSize = "xs" | "sm" | "icon-xs" | "icon-sm";
|
|
94
|
+
declare function InputGroup({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
95
|
+
declare function InputGroupAddon({ className, align, ...props }: React$1.ComponentProps<"div"> & {
|
|
96
|
+
align?: InputGroupAddonAlign;
|
|
97
|
+
}): React$1.JSX.Element;
|
|
98
|
+
declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React$1.ComponentProps<typeof Button>, "size" | "type"> & {
|
|
99
|
+
size?: InputGroupButtonSize;
|
|
100
|
+
type?: "button" | "submit" | "reset";
|
|
101
|
+
}): React$1.JSX.Element;
|
|
102
|
+
declare function InputGroupText({ className, ...props }: React$1.ComponentProps<"span">): React$1.JSX.Element;
|
|
103
|
+
declare function InputGroupInput({ className, ...props }: React$1.ComponentProps<"input">): React$1.JSX.Element;
|
|
104
|
+
declare function InputGroupTextarea({ className, ...props }: React$1.ComponentProps<"textarea">): React$1.JSX.Element;
|
|
105
|
+
|
|
106
|
+
declare function InputOTP({ className, containerClassName, ...props }: React$1.ComponentProps<typeof OTPInput> & {
|
|
107
|
+
containerClassName?: string;
|
|
108
|
+
}): React$1.JSX.Element;
|
|
109
|
+
declare function InputOTPGroup({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
110
|
+
declare function InputOTPSlot({ index, className, ...props }: React$1.ComponentProps<"div"> & {
|
|
111
|
+
index: number;
|
|
112
|
+
}): React$1.JSX.Element;
|
|
113
|
+
declare function InputOTPSeparator({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
114
|
+
|
|
115
|
+
type ProductCardProps = Omit<React$1.ComponentProps<"div">, "children"> & {
|
|
116
|
+
image: string;
|
|
117
|
+
imageAlt?: string;
|
|
118
|
+
productName: string;
|
|
119
|
+
brandName: string;
|
|
120
|
+
price: number;
|
|
121
|
+
size?: CardSize;
|
|
122
|
+
};
|
|
123
|
+
declare function ProductCard({ image, imageAlt, productName, brandName, price, className, ...props }: ProductCardProps): React$1.JSX.Element;
|
|
124
|
+
|
|
125
|
+
declare function Separator({ className, orientation, ...props }: Separator$1.Props): React$1.JSX.Element;
|
|
126
|
+
|
|
127
|
+
type TabsListVariant = "default" | "line";
|
|
128
|
+
declare function Tabs({ className, orientation, ...props }: Tabs$1.Root.Props): React$1.JSX.Element;
|
|
129
|
+
declare function TabsList({ className, variant, ...props }: Tabs$1.List.Props & {
|
|
130
|
+
variant?: TabsListVariant;
|
|
131
|
+
}): React$1.JSX.Element;
|
|
132
|
+
declare function TabsTrigger({ className, ...props }: Tabs$1.Tab.Props): React$1.JSX.Element;
|
|
133
|
+
declare function TabsContent({ className, ...props }: Tabs$1.Panel.Props): React$1.JSX.Element;
|
|
134
|
+
|
|
135
|
+
declare function Textarea({ className, ...props }: React$1.ComponentProps<"textarea">): React$1.JSX.Element;
|
|
136
|
+
|
|
137
|
+
export { Alert, AlertAction, AlertDescription, AlertTitle, type AlertVariant, Badge, type BadgeStyleProps, type BadgeVariant, Button, type ButtonSize, type ButtonStyleProps, type ButtonVariant, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, type CardSize, CardTitle, Checkbox, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, type FieldOrientation, FieldSeparator, FieldSet, FieldTitle, Input, InputGroup, InputGroupAddon, type InputGroupAddonAlign, InputGroupButton, type InputGroupButtonSize, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Label, ProductCard, type ProductCardProps, Separator, Tabs, TabsContent, TabsList, type TabsListVariant, TabsTrigger, Textarea, badgeVariants, buttonVariants };
|