@banhosdev/moldsoft-ui 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/components.json +21 -0
- package/dist/index.d.mts +21 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +164 -0
- package/dist/index.mjs +120 -0
- package/package.json +29 -0
- package/src/components/ui/button.tsx +56 -0
- package/src/components/ui/card.tsx +79 -0
- package/src/index.ts +2 -0
- package/src/lib/utils.ts +6 -0
- package/src/styles/globals.css +107 -0
- package/tsconfig.json +25 -0
package/components.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
+
"style": "default",
|
|
4
|
+
"rsc": false,
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"tailwind": {
|
|
7
|
+
"config": "",
|
|
8
|
+
"css": "src/styles/globals.css",
|
|
9
|
+
"baseColor": "slate",
|
|
10
|
+
"cssVariables": true,
|
|
11
|
+
"prefix": ""
|
|
12
|
+
},
|
|
13
|
+
"aliases": {
|
|
14
|
+
"components": "@/components",
|
|
15
|
+
"utils": "@/lib/utils",
|
|
16
|
+
"ui": "@/components/ui",
|
|
17
|
+
"lib": "@/lib",
|
|
18
|
+
"hooks": "@/hooks"
|
|
19
|
+
},
|
|
20
|
+
"iconLibrary": "lucide"
|
|
21
|
+
}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
declare const buttonVariants: (props?: ({
|
|
6
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
7
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
8
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
10
|
+
asChild?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
13
|
+
|
|
14
|
+
declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
|
|
21
|
+
export { Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, buttonVariants };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
declare const buttonVariants: (props?: ({
|
|
6
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
7
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
8
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
10
|
+
asChild?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
13
|
+
|
|
14
|
+
declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
|
|
21
|
+
export { Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, buttonVariants };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
Button: () => Button,
|
|
34
|
+
Card: () => Card,
|
|
35
|
+
CardContent: () => CardContent,
|
|
36
|
+
CardDescription: () => CardDescription,
|
|
37
|
+
CardFooter: () => CardFooter,
|
|
38
|
+
CardHeader: () => CardHeader,
|
|
39
|
+
CardTitle: () => CardTitle,
|
|
40
|
+
buttonVariants: () => buttonVariants
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(index_exports);
|
|
43
|
+
|
|
44
|
+
// src/components/ui/button.tsx
|
|
45
|
+
var React = __toESM(require("react"));
|
|
46
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
47
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
48
|
+
|
|
49
|
+
// src/lib/utils.ts
|
|
50
|
+
var import_clsx = require("clsx");
|
|
51
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
52
|
+
function cn(...inputs) {
|
|
53
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// src/components/ui/button.tsx
|
|
57
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
58
|
+
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
59
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
60
|
+
{
|
|
61
|
+
variants: {
|
|
62
|
+
variant: {
|
|
63
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
64
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
65
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
66
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
67
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
68
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
69
|
+
},
|
|
70
|
+
size: {
|
|
71
|
+
default: "h-10 px-4 py-2",
|
|
72
|
+
sm: "h-9 rounded-md px-3",
|
|
73
|
+
lg: "h-11 rounded-md px-8",
|
|
74
|
+
icon: "h-10 w-10"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
defaultVariants: {
|
|
78
|
+
variant: "default",
|
|
79
|
+
size: "default"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
var Button = React.forwardRef(
|
|
84
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
85
|
+
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
86
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
87
|
+
Comp,
|
|
88
|
+
{
|
|
89
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
90
|
+
ref,
|
|
91
|
+
...props
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
Button.displayName = "Button";
|
|
97
|
+
|
|
98
|
+
// src/components/ui/card.tsx
|
|
99
|
+
var React2 = __toESM(require("react"));
|
|
100
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
101
|
+
var Card = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
102
|
+
"div",
|
|
103
|
+
{
|
|
104
|
+
ref,
|
|
105
|
+
className: cn(
|
|
106
|
+
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
107
|
+
className
|
|
108
|
+
),
|
|
109
|
+
...props
|
|
110
|
+
}
|
|
111
|
+
));
|
|
112
|
+
Card.displayName = "Card";
|
|
113
|
+
var CardHeader = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
114
|
+
"div",
|
|
115
|
+
{
|
|
116
|
+
ref,
|
|
117
|
+
className: cn("flex flex-col space-y-1.5 p-6", className),
|
|
118
|
+
...props
|
|
119
|
+
}
|
|
120
|
+
));
|
|
121
|
+
CardHeader.displayName = "CardHeader";
|
|
122
|
+
var CardTitle = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
123
|
+
"div",
|
|
124
|
+
{
|
|
125
|
+
ref,
|
|
126
|
+
className: cn(
|
|
127
|
+
"text-2xl font-semibold leading-none tracking-tight",
|
|
128
|
+
className
|
|
129
|
+
),
|
|
130
|
+
...props
|
|
131
|
+
}
|
|
132
|
+
));
|
|
133
|
+
CardTitle.displayName = "CardTitle";
|
|
134
|
+
var CardDescription = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
135
|
+
"div",
|
|
136
|
+
{
|
|
137
|
+
ref,
|
|
138
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
139
|
+
...props
|
|
140
|
+
}
|
|
141
|
+
));
|
|
142
|
+
CardDescription.displayName = "CardDescription";
|
|
143
|
+
var CardContent = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { ref, className: cn("p-6 pt-0", className), ...props }));
|
|
144
|
+
CardContent.displayName = "CardContent";
|
|
145
|
+
var CardFooter = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
146
|
+
"div",
|
|
147
|
+
{
|
|
148
|
+
ref,
|
|
149
|
+
className: cn("flex items-center p-6 pt-0", className),
|
|
150
|
+
...props
|
|
151
|
+
}
|
|
152
|
+
));
|
|
153
|
+
CardFooter.displayName = "CardFooter";
|
|
154
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
155
|
+
0 && (module.exports = {
|
|
156
|
+
Button,
|
|
157
|
+
Card,
|
|
158
|
+
CardContent,
|
|
159
|
+
CardDescription,
|
|
160
|
+
CardFooter,
|
|
161
|
+
CardHeader,
|
|
162
|
+
CardTitle,
|
|
163
|
+
buttonVariants
|
|
164
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// src/components/ui/button.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
|
|
6
|
+
// src/lib/utils.ts
|
|
7
|
+
import { clsx } from "clsx";
|
|
8
|
+
import { twMerge } from "tailwind-merge";
|
|
9
|
+
function cn(...inputs) {
|
|
10
|
+
return twMerge(clsx(inputs));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// src/components/ui/button.tsx
|
|
14
|
+
import { jsx } from "react/jsx-runtime";
|
|
15
|
+
var buttonVariants = cva(
|
|
16
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
17
|
+
{
|
|
18
|
+
variants: {
|
|
19
|
+
variant: {
|
|
20
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
21
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
22
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
23
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
24
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
25
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
26
|
+
},
|
|
27
|
+
size: {
|
|
28
|
+
default: "h-10 px-4 py-2",
|
|
29
|
+
sm: "h-9 rounded-md px-3",
|
|
30
|
+
lg: "h-11 rounded-md px-8",
|
|
31
|
+
icon: "h-10 w-10"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
variant: "default",
|
|
36
|
+
size: "default"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
var Button = React.forwardRef(
|
|
41
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
42
|
+
const Comp = asChild ? Slot : "button";
|
|
43
|
+
return /* @__PURE__ */ jsx(
|
|
44
|
+
Comp,
|
|
45
|
+
{
|
|
46
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
47
|
+
ref,
|
|
48
|
+
...props
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
Button.displayName = "Button";
|
|
54
|
+
|
|
55
|
+
// src/components/ui/card.tsx
|
|
56
|
+
import * as React2 from "react";
|
|
57
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
58
|
+
var Card = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
ref,
|
|
62
|
+
className: cn(
|
|
63
|
+
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
64
|
+
className
|
|
65
|
+
),
|
|
66
|
+
...props
|
|
67
|
+
}
|
|
68
|
+
));
|
|
69
|
+
Card.displayName = "Card";
|
|
70
|
+
var CardHeader = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
71
|
+
"div",
|
|
72
|
+
{
|
|
73
|
+
ref,
|
|
74
|
+
className: cn("flex flex-col space-y-1.5 p-6", className),
|
|
75
|
+
...props
|
|
76
|
+
}
|
|
77
|
+
));
|
|
78
|
+
CardHeader.displayName = "CardHeader";
|
|
79
|
+
var CardTitle = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
80
|
+
"div",
|
|
81
|
+
{
|
|
82
|
+
ref,
|
|
83
|
+
className: cn(
|
|
84
|
+
"text-2xl font-semibold leading-none tracking-tight",
|
|
85
|
+
className
|
|
86
|
+
),
|
|
87
|
+
...props
|
|
88
|
+
}
|
|
89
|
+
));
|
|
90
|
+
CardTitle.displayName = "CardTitle";
|
|
91
|
+
var CardDescription = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
92
|
+
"div",
|
|
93
|
+
{
|
|
94
|
+
ref,
|
|
95
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
96
|
+
...props
|
|
97
|
+
}
|
|
98
|
+
));
|
|
99
|
+
CardDescription.displayName = "CardDescription";
|
|
100
|
+
var CardContent = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2("div", { ref, className: cn("p-6 pt-0", className), ...props }));
|
|
101
|
+
CardContent.displayName = "CardContent";
|
|
102
|
+
var CardFooter = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
103
|
+
"div",
|
|
104
|
+
{
|
|
105
|
+
ref,
|
|
106
|
+
className: cn("flex items-center p-6 pt-0", className),
|
|
107
|
+
...props
|
|
108
|
+
}
|
|
109
|
+
));
|
|
110
|
+
CardFooter.displayName = "CardFooter";
|
|
111
|
+
export {
|
|
112
|
+
Button,
|
|
113
|
+
Card,
|
|
114
|
+
CardContent,
|
|
115
|
+
CardDescription,
|
|
116
|
+
CardFooter,
|
|
117
|
+
CardHeader,
|
|
118
|
+
CardTitle,
|
|
119
|
+
buttonVariants
|
|
120
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@banhosdev/moldsoft-ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"main": "./src/index.ts",
|
|
6
|
+
"types": "./src/index.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsup src/index.ts --format cjs,esm --dts",
|
|
9
|
+
"dev": "tsup src/index.ts --format cjs,esm --watch --dts",
|
|
10
|
+
"lint": "eslint src"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@radix-ui/react-slot": "^1.2.4",
|
|
14
|
+
"class-variance-authority": "^0.7.0",
|
|
15
|
+
"clsx": "^2.1.1",
|
|
16
|
+
"lucide-react": "^0.454.0",
|
|
17
|
+
"react": "19.2.3",
|
|
18
|
+
"react-dom": "19.2.3",
|
|
19
|
+
"tailwind-merge": "^2.5.4"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@tailwindcss/postcss": "4",
|
|
23
|
+
"@types/react": "^19",
|
|
24
|
+
"@types/react-dom": "^19",
|
|
25
|
+
"tailwindcss": "4",
|
|
26
|
+
"tsup": "^8.3.5",
|
|
27
|
+
"typescript": "^5"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot"
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
4
|
+
|
|
5
|
+
import { cn } from "../../lib/utils"
|
|
6
|
+
|
|
7
|
+
const buttonVariants = cva(
|
|
8
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
13
|
+
destructive:
|
|
14
|
+
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
15
|
+
outline:
|
|
16
|
+
"border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
17
|
+
secondary:
|
|
18
|
+
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
19
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
20
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
default: "h-10 px-4 py-2",
|
|
24
|
+
sm: "h-9 rounded-md px-3",
|
|
25
|
+
lg: "h-11 rounded-md px-8",
|
|
26
|
+
icon: "h-10 w-10",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
variant: "default",
|
|
31
|
+
size: "default",
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
export interface ButtonProps
|
|
37
|
+
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
38
|
+
VariantProps<typeof buttonVariants> {
|
|
39
|
+
asChild?: boolean
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
43
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
44
|
+
const Comp = asChild ? Slot : "button"
|
|
45
|
+
return (
|
|
46
|
+
<Comp
|
|
47
|
+
className={cn(buttonVariants({ variant, size, className }))}
|
|
48
|
+
ref={ref}
|
|
49
|
+
{...props}
|
|
50
|
+
/>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
Button.displayName = "Button"
|
|
55
|
+
|
|
56
|
+
export { Button, buttonVariants }
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../lib/utils"
|
|
4
|
+
|
|
5
|
+
const Card = React.forwardRef<
|
|
6
|
+
HTMLDivElement,
|
|
7
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
8
|
+
>(({ className, ...props }, ref) => (
|
|
9
|
+
<div
|
|
10
|
+
ref={ref}
|
|
11
|
+
className={cn(
|
|
12
|
+
"rounded-lg border bg-card text-card-foreground shadow-sm",
|
|
13
|
+
className
|
|
14
|
+
)}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
))
|
|
18
|
+
Card.displayName = "Card"
|
|
19
|
+
|
|
20
|
+
const CardHeader = React.forwardRef<
|
|
21
|
+
HTMLDivElement,
|
|
22
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
23
|
+
>(({ className, ...props }, ref) => (
|
|
24
|
+
<div
|
|
25
|
+
ref={ref}
|
|
26
|
+
className={cn("flex flex-col space-y-1.5 p-6", className)}
|
|
27
|
+
{...props}
|
|
28
|
+
/>
|
|
29
|
+
))
|
|
30
|
+
CardHeader.displayName = "CardHeader"
|
|
31
|
+
|
|
32
|
+
const CardTitle = React.forwardRef<
|
|
33
|
+
HTMLDivElement,
|
|
34
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
35
|
+
>(({ className, ...props }, ref) => (
|
|
36
|
+
<div
|
|
37
|
+
ref={ref}
|
|
38
|
+
className={cn(
|
|
39
|
+
"text-2xl font-semibold leading-none tracking-tight",
|
|
40
|
+
className
|
|
41
|
+
)}
|
|
42
|
+
{...props}
|
|
43
|
+
/>
|
|
44
|
+
))
|
|
45
|
+
CardTitle.displayName = "CardTitle"
|
|
46
|
+
|
|
47
|
+
const CardDescription = React.forwardRef<
|
|
48
|
+
HTMLDivElement,
|
|
49
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
50
|
+
>(({ className, ...props }, ref) => (
|
|
51
|
+
<div
|
|
52
|
+
ref={ref}
|
|
53
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
54
|
+
{...props}
|
|
55
|
+
/>
|
|
56
|
+
))
|
|
57
|
+
CardDescription.displayName = "CardDescription"
|
|
58
|
+
|
|
59
|
+
const CardContent = React.forwardRef<
|
|
60
|
+
HTMLDivElement,
|
|
61
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
62
|
+
>(({ className, ...props }, ref) => (
|
|
63
|
+
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
|
|
64
|
+
))
|
|
65
|
+
CardContent.displayName = "CardContent"
|
|
66
|
+
|
|
67
|
+
const CardFooter = React.forwardRef<
|
|
68
|
+
HTMLDivElement,
|
|
69
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
70
|
+
>(({ className, ...props }, ref) => (
|
|
71
|
+
<div
|
|
72
|
+
ref={ref}
|
|
73
|
+
className={cn("flex items-center p-6 pt-0", className)}
|
|
74
|
+
{...props}
|
|
75
|
+
/>
|
|
76
|
+
))
|
|
77
|
+
CardFooter.displayName = "CardFooter"
|
|
78
|
+
|
|
79
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
|
package/src/index.ts
ADDED
package/src/lib/utils.ts
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
|
|
3
|
+
@theme {
|
|
4
|
+
--color-background: hsl(var(--background));
|
|
5
|
+
--color-foreground: hsl(var(--foreground));
|
|
6
|
+
|
|
7
|
+
--color-card: hsl(var(--card));
|
|
8
|
+
--color-card-foreground: hsl(var(--card-foreground));
|
|
9
|
+
|
|
10
|
+
--color-popover: hsl(var(--popover));
|
|
11
|
+
--color-popover-foreground: hsl(var(--popover-foreground));
|
|
12
|
+
|
|
13
|
+
--color-primary: hsl(var(--primary));
|
|
14
|
+
--color-primary-foreground: hsl(var(--primary-foreground));
|
|
15
|
+
|
|
16
|
+
--color-secondary: hsl(var(--secondary));
|
|
17
|
+
--color-secondary-foreground: hsl(var(--secondary-foreground));
|
|
18
|
+
|
|
19
|
+
--color-muted: hsl(var(--muted));
|
|
20
|
+
--color-muted-foreground: hsl(var(--muted-foreground));
|
|
21
|
+
|
|
22
|
+
--color-accent: hsl(var(--accent));
|
|
23
|
+
--color-accent-foreground: hsl(var(--accent-foreground));
|
|
24
|
+
|
|
25
|
+
--color-destructive: hsl(var(--destructive));
|
|
26
|
+
--color-destructive-foreground: hsl(var(--destructive-foreground));
|
|
27
|
+
|
|
28
|
+
--color-border: hsl(var(--border));
|
|
29
|
+
--color-input: hsl(var(--input));
|
|
30
|
+
--color-ring: hsl(var(--ring));
|
|
31
|
+
|
|
32
|
+
--color-chart-1: hsl(var(--chart-1));
|
|
33
|
+
--color-chart-2: hsl(var(--chart-2));
|
|
34
|
+
--color-chart-3: hsl(var(--chart-3));
|
|
35
|
+
--color-chart-4: hsl(var(--chart-4));
|
|
36
|
+
--color-chart-5: hsl(var(--chart-5));
|
|
37
|
+
|
|
38
|
+
--radius-lg: var(--radius);
|
|
39
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
40
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@layer base {
|
|
44
|
+
:root {
|
|
45
|
+
--background: 0 0% 100%;
|
|
46
|
+
--foreground: 0 0% 3.9%;
|
|
47
|
+
--card: 0 0% 100%;
|
|
48
|
+
--card-foreground: 0 0% 3.9%;
|
|
49
|
+
--popover: 0 0% 100%;
|
|
50
|
+
--popover-foreground: 0 0% 3.9%;
|
|
51
|
+
--primary: 0 0% 9%;
|
|
52
|
+
--primary-foreground: 0 0% 98%;
|
|
53
|
+
--secondary: 0 0% 96.1%;
|
|
54
|
+
--secondary-foreground: 0 0% 9%;
|
|
55
|
+
--muted: 0 0% 96.1%;
|
|
56
|
+
--muted-foreground: 0 0% 45.1%;
|
|
57
|
+
--accent: 0 0% 96.1%;
|
|
58
|
+
--accent-foreground: 0 0% 9%;
|
|
59
|
+
--destructive: 0 84.2% 60.2%;
|
|
60
|
+
--destructive-foreground: 0 0% 98%;
|
|
61
|
+
--border: 0 0% 89.8%;
|
|
62
|
+
--input: 0 0% 89.8%;
|
|
63
|
+
--ring: 0 0% 3.9%;
|
|
64
|
+
--chart-1: 12 76% 61%;
|
|
65
|
+
--chart-2: 173 58% 39%;
|
|
66
|
+
--chart-3: 197 37% 24%;
|
|
67
|
+
--chart-4: 43 74% 66%;
|
|
68
|
+
--chart-5: 27 87% 67%;
|
|
69
|
+
--radius: 0.5rem;
|
|
70
|
+
}
|
|
71
|
+
.dark {
|
|
72
|
+
--background: 0 0% 3.9%;
|
|
73
|
+
--foreground: 0 0% 98%;
|
|
74
|
+
--card: 0 0% 3.9%;
|
|
75
|
+
--card-foreground: 0 0% 98%;
|
|
76
|
+
--popover: 0 0% 3.9%;
|
|
77
|
+
--popover-foreground: 0 0% 98%;
|
|
78
|
+
--primary: 0 0% 98%;
|
|
79
|
+
--primary-foreground: 0 0% 9%;
|
|
80
|
+
--secondary: 0 0% 14.9%;
|
|
81
|
+
--secondary-foreground: 0 0% 98%;
|
|
82
|
+
--muted: 0 0% 14.9%;
|
|
83
|
+
--muted-foreground: 0 0% 63.9%;
|
|
84
|
+
--accent: 0 0% 14.9%;
|
|
85
|
+
--accent-foreground: 0 0% 98%;
|
|
86
|
+
--destructive: 0 62.8% 30.6%;
|
|
87
|
+
--destructive-foreground: 0 0% 98%;
|
|
88
|
+
--border: 0 0% 14.9%;
|
|
89
|
+
--input: 0 0% 14.9%;
|
|
90
|
+
--ring: 0 0% 83.1%;
|
|
91
|
+
--chart-1: 220 70% 50%;
|
|
92
|
+
--chart-2: 160 60% 45%;
|
|
93
|
+
--chart-3: 30 80% 55%;
|
|
94
|
+
--chart-4: 280 65% 60%;
|
|
95
|
+
--chart-5: 340 75% 55%;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@layer base {
|
|
100
|
+
* {
|
|
101
|
+
@apply border-border outline-ring/50;
|
|
102
|
+
}
|
|
103
|
+
body {
|
|
104
|
+
background-color: hsl(var(--background));
|
|
105
|
+
color: hsl(var(--foreground));
|
|
106
|
+
}
|
|
107
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"lib": [
|
|
5
|
+
"DOM",
|
|
6
|
+
"DOM.Iterable",
|
|
7
|
+
"ESNext"
|
|
8
|
+
],
|
|
9
|
+
"module": "ESNext",
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"jsx": "react-jsx",
|
|
12
|
+
"strict": true,
|
|
13
|
+
"declaration": true,
|
|
14
|
+
"declarationMap": true,
|
|
15
|
+
"sourceMap": true,
|
|
16
|
+
"esModuleInterop": true,
|
|
17
|
+
"forceConsistentCasingInFileNames": true,
|
|
18
|
+
"skipLibCheck": true,
|
|
19
|
+
"paths": {
|
|
20
|
+
"@/*": [
|
|
21
|
+
"./src/*"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
}
|
|
25
|
+
}
|