@appcorp/shadcn 1.0.10
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 +138 -0
- package/app/layout.d.ts +7 -0
- package/app/layout.js +18 -0
- package/app/page.d.ts +2 -0
- package/app/page.js +16 -0
- package/components/badge.d.ts +9 -0
- package/components/badge.js +82 -0
- package/components/button.d.ts +10 -0
- package/components/button.js +91 -0
- package/components/card.d.ts +9 -0
- package/components/card.js +94 -0
- package/components/carousel.d.ts +19 -0
- package/components/carousel.js +168 -0
- package/components/checkbox.d.ts +9 -0
- package/components/checkbox.js +87 -0
- package/components/combobox.d.ts +70 -0
- package/components/combobox.js +315 -0
- package/components/command.d.ts +18 -0
- package/components/command.js +115 -0
- package/components/context-menu.d.ts +25 -0
- package/components/context-menu.js +148 -0
- package/components/dialog.d.ts +15 -0
- package/components/dialog.js +118 -0
- package/components/drawer.d.ts +13 -0
- package/components/drawer.js +115 -0
- package/components/dropdown-menu.d.ts +25 -0
- package/components/dropdown-menu.js +148 -0
- package/components/enhanced-dropzone.d.ts +21 -0
- package/components/enhanced-dropzone.js +187 -0
- package/components/enhanced-table-footer-action.d.ts +35 -0
- package/components/enhanced-table-footer-action.js +110 -0
- package/components/enhanced-table-footer-page.d.ts +34 -0
- package/components/enhanced-table-footer-page.js +132 -0
- package/components/enhanced-table-footer-pagination.d.ts +38 -0
- package/components/enhanced-table-footer-pagination.js +116 -0
- package/components/enhanced-table-header-action.d.ts +7 -0
- package/components/enhanced-table-header-action.js +21 -0
- package/components/enhanced-table-header-search.d.ts +12 -0
- package/components/enhanced-table-header-search.js +17 -0
- package/components/enhanced-table.d.ts +87 -0
- package/components/enhanced-table.js +221 -0
- package/components/form.d.ts +24 -0
- package/components/form.js +125 -0
- package/components/input.d.ts +8 -0
- package/components/input.js +86 -0
- package/components/label.d.ts +7 -0
- package/components/label.js +68 -0
- package/components/popover.d.ts +7 -0
- package/components/popover.js +82 -0
- package/components/select.d.ts +15 -0
- package/components/select.js +127 -0
- package/components/separator.d.ts +4 -0
- package/components/separator.js +66 -0
- package/components/shadcn-io/color-picker/index.d.ts +43 -0
- package/components/shadcn-io/color-picker/index.js +304 -0
- package/components/shadcn-io/copy-button/index.d.ts +16 -0
- package/components/shadcn-io/copy-button/index.js +121 -0
- package/components/shadcn-io/dropzone/index.d.ts +19 -0
- package/components/shadcn-io/dropzone/index.js +131 -0
- package/components/shadcn-io/gantt/index.d.ts +145 -0
- package/components/shadcn-io/gantt/index.js +767 -0
- package/components/shadcn-io/table/index.d.ts +60 -0
- package/components/shadcn-io/table/index.js +138 -0
- package/components/sonner.d.ts +4 -0
- package/components/sonner.js +54 -0
- package/components/switch.d.ts +9 -0
- package/components/switch.js +89 -0
- package/components/table.d.ts +10 -0
- package/components/table.js +101 -0
- package/components/textarea.d.ts +8 -0
- package/components/textarea.js +86 -0
- package/lib/themes.d.ts +147 -0
- package/lib/themes.js +150 -0
- package/lib/toast-utils.d.ts +44 -0
- package/lib/toast-utils.js +212 -0
- package/lib/utils.d.ts +2 -0
- package/lib/utils.js +12 -0
- package/package.json +101 -0
package/README.md
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# shadcn
|
|
2
|
+
|
|
3
|
+
A modern Next.js project with shadcn/ui components, Storybook, TypeScript, and comprehensive tooling.
|
|
4
|
+
|
|
5
|
+
## Tech Stack
|
|
6
|
+
|
|
7
|
+
- **Framework**: [Next.js 15](https://nextjs.org/) with App Router
|
|
8
|
+
- **Language**: [TypeScript](https://www.typescriptlang.org/)
|
|
9
|
+
- **Styling**: [Tailwind CSS](https://tailwindcss.com/)
|
|
10
|
+
- **UI Components**: [shadcn/ui](https://ui.shadcn.com/)
|
|
11
|
+
- **Component Development**: [Storybook](https://storybook.js.org/)
|
|
12
|
+
- **Testing**: [Jest](https://jestjs.io/) with [Testing Library](https://testing-library.com/)
|
|
13
|
+
- **Package Manager**: [Yarn](https://yarnpkg.com/)
|
|
14
|
+
- **Code Quality**:
|
|
15
|
+
- [ESLint](https://eslint.org/) - Linting
|
|
16
|
+
- [Prettier](https://prettier.io/) - Code formatting
|
|
17
|
+
- [Husky](https://typicode.github.io/husky/) - Git hooks
|
|
18
|
+
- [lint-staged](https://github.com/okonet/lint-staged) - Run linters on staged files
|
|
19
|
+
- [commitlint](https://commitlint.js.org/) - Commit message linting
|
|
20
|
+
|
|
21
|
+
## Getting Started
|
|
22
|
+
|
|
23
|
+
### Prerequisites
|
|
24
|
+
|
|
25
|
+
- Node.js 18+
|
|
26
|
+
- Yarn
|
|
27
|
+
|
|
28
|
+
### Installation
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Install dependencies
|
|
32
|
+
yarn install
|
|
33
|
+
|
|
34
|
+
# Run the development server
|
|
35
|
+
yarn dev
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Open [http://localhost:3000](http://localhost:3000) to see your application.
|
|
39
|
+
|
|
40
|
+
## Available Scripts
|
|
41
|
+
|
|
42
|
+
- `yarn dev` - Start the development server
|
|
43
|
+
- `yarn build` - Build the production application
|
|
44
|
+
- `yarn start` - Start the production server
|
|
45
|
+
- `yarn lint` - Run ESLint
|
|
46
|
+
- `yarn format` - Format code with Prettier
|
|
47
|
+
- `yarn format:check` - Check code formatting
|
|
48
|
+
- `yarn test` - Run tests
|
|
49
|
+
- `yarn test:watch` - Run tests in watch mode
|
|
50
|
+
- `yarn storybook` - Start Storybook development server
|
|
51
|
+
- `yarn build-storybook` - Build Storybook for production
|
|
52
|
+
|
|
53
|
+
## Project Structure
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
shadcn/
|
|
57
|
+
├── .husky/ # Git hooks
|
|
58
|
+
├── .storybook/ # Storybook configuration
|
|
59
|
+
├── .vscode/ # VS Code settings (format on save enabled)
|
|
60
|
+
├── src/
|
|
61
|
+
│ ├── __tests__/ # Test files
|
|
62
|
+
│ ├── app/ # Next.js app directory
|
|
63
|
+
│ ├── components/ # React components
|
|
64
|
+
│ │ └── ui/ # shadcn/ui components
|
|
65
|
+
│ ├── lib/ # Utility functions
|
|
66
|
+
│ └── stories/ # Storybook stories
|
|
67
|
+
├── components.json # shadcn/ui configuration
|
|
68
|
+
├── jest.config.ts # Jest configuration
|
|
69
|
+
├── next.config.ts # Next.js configuration
|
|
70
|
+
├── tailwind.config.ts # Tailwind CSS configuration
|
|
71
|
+
└── tsconfig.json # TypeScript configuration
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Code Quality
|
|
75
|
+
|
|
76
|
+
### Format on Save
|
|
77
|
+
|
|
78
|
+
This project is configured to format code on save in VS Code. Install the recommended extensions:
|
|
79
|
+
|
|
80
|
+
- Prettier - Code formatter
|
|
81
|
+
- ESLint
|
|
82
|
+
- Tailwind CSS IntelliSense
|
|
83
|
+
|
|
84
|
+
### Git Hooks
|
|
85
|
+
|
|
86
|
+
The project uses Husky to enforce code quality:
|
|
87
|
+
|
|
88
|
+
- **pre-commit**: Runs lint-staged to format and lint staged files
|
|
89
|
+
- **commit-msg**: Validates commit messages using conventional commits format
|
|
90
|
+
|
|
91
|
+
### Commit Message Format
|
|
92
|
+
|
|
93
|
+
Follow the [Conventional Commits](https://www.conventionalcommits.org/) specification:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
<type>: <description>
|
|
97
|
+
|
|
98
|
+
[optional body]
|
|
99
|
+
|
|
100
|
+
[optional footer]
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`
|
|
104
|
+
|
|
105
|
+
Example:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
git commit -m "feat: add button component"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## shadcn/ui Components
|
|
112
|
+
|
|
113
|
+
This project includes the shadcn/ui component library. Add new components using:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
npx shadcn@latest add [component-name]
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Note: Due to network restrictions, you may need to add components manually. The utility function for className merging is available at `src/lib/utils.ts`.
|
|
120
|
+
|
|
121
|
+
## Storybook
|
|
122
|
+
|
|
123
|
+
View and develop components in isolation:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
yarn storybook
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Open [http://localhost:6006](http://localhost:6006) to see Storybook.
|
|
130
|
+
|
|
131
|
+
## Testing
|
|
132
|
+
|
|
133
|
+
Run tests:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
yarn test # Run all tests
|
|
137
|
+
yarn test:watch # Run tests in watch mode
|
|
138
|
+
```
|
package/app/layout.d.ts
ADDED
package/app/layout.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.metadata = void 0;
|
|
7
|
+
exports.default = RootLayout;
|
|
8
|
+
var react_1 = __importDefault(require("react"));
|
|
9
|
+
require("./globals.css");
|
|
10
|
+
exports.metadata = {
|
|
11
|
+
title: "ShadCN/UI App",
|
|
12
|
+
description: "Next.js app with ShadCN/UI components",
|
|
13
|
+
};
|
|
14
|
+
function RootLayout(_a) {
|
|
15
|
+
var children = _a.children;
|
|
16
|
+
return (react_1.default.createElement("html", { lang: "en" },
|
|
17
|
+
react_1.default.createElement("body", null, children)));
|
|
18
|
+
}
|
package/app/page.d.ts
ADDED
package/app/page.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = Home;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
function Home() {
|
|
9
|
+
return (react_1.default.createElement("main", { className: "flex min-h-screen flex-col items-center justify-center p-24" },
|
|
10
|
+
react_1.default.createElement("div", { className: "z-10 w-full max-w-5xl items-center justify-between font-mono text-sm" },
|
|
11
|
+
react_1.default.createElement("h1", { className: "text-4xl font-bold text-center mb-8" }, "Welcome to Next.js with ShadCN/UI"),
|
|
12
|
+
react_1.default.createElement("p", { className: "text-center text-muted-foreground mb-8" },
|
|
13
|
+
"Get started by editing",
|
|
14
|
+
" ",
|
|
15
|
+
react_1.default.createElement("code", { className: "font-mono font-bold" }, "src/app/page.tsx")))));
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "secondary" | "destructive" | "outline" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
7
|
+
asChild?: boolean;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
47
|
+
var t = {};
|
|
48
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
49
|
+
t[p] = s[p];
|
|
50
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
51
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
52
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
53
|
+
t[p[i]] = s[p[i]];
|
|
54
|
+
}
|
|
55
|
+
return t;
|
|
56
|
+
};
|
|
57
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
|
+
exports.badgeVariants = void 0;
|
|
59
|
+
exports.Badge = Badge;
|
|
60
|
+
var React = __importStar(require("react"));
|
|
61
|
+
var react_slot_1 = require("@radix-ui/react-slot");
|
|
62
|
+
var class_variance_authority_1 = require("class-variance-authority");
|
|
63
|
+
var utils_1 = require("../lib/utils");
|
|
64
|
+
var badgeVariants = (0, class_variance_authority_1.cva)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden", {
|
|
65
|
+
variants: {
|
|
66
|
+
variant: {
|
|
67
|
+
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
68
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
69
|
+
destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
70
|
+
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
defaultVariants: {
|
|
74
|
+
variant: "default",
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
exports.badgeVariants = badgeVariants;
|
|
78
|
+
function Badge(_a) {
|
|
79
|
+
var className = _a.className, variant = _a.variant, _b = _a.asChild, asChild = _b === void 0 ? false : _b, props = __rest(_a, ["className", "variant", "asChild"]);
|
|
80
|
+
var Comp = asChild ? react_slot_1.Slot : "span";
|
|
81
|
+
return (React.createElement(Comp, __assign({ "data-slot": "badge", className: (0, utils_1.cn)(badgeVariants({ variant: variant }), className) }, props)));
|
|
82
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
|
|
5
|
+
size?: "icon" | "default" | "sm" | "lg" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
47
|
+
var t = {};
|
|
48
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
49
|
+
t[p] = s[p];
|
|
50
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
51
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
52
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
53
|
+
t[p[i]] = s[p[i]];
|
|
54
|
+
}
|
|
55
|
+
return t;
|
|
56
|
+
};
|
|
57
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
|
+
exports.buttonVariants = void 0;
|
|
59
|
+
exports.Button = Button;
|
|
60
|
+
var React = __importStar(require("react"));
|
|
61
|
+
var react_slot_1 = require("@radix-ui/react-slot");
|
|
62
|
+
var class_variance_authority_1 = require("class-variance-authority");
|
|
63
|
+
var utils_1 = require("../lib/utils");
|
|
64
|
+
var buttonVariants = (0, class_variance_authority_1.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
|
|
65
|
+
variants: {
|
|
66
|
+
variant: {
|
|
67
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
68
|
+
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
69
|
+
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
70
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
71
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
72
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
73
|
+
},
|
|
74
|
+
size: {
|
|
75
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
76
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
77
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
78
|
+
icon: "size-9",
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
defaultVariants: {
|
|
82
|
+
variant: "default",
|
|
83
|
+
size: "default",
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
exports.buttonVariants = buttonVariants;
|
|
87
|
+
function Button(_a) {
|
|
88
|
+
var className = _a.className, variant = _a.variant, size = _a.size, _b = _a.asChild, asChild = _b === void 0 ? false : _b, props = __rest(_a, ["className", "variant", "size", "asChild"]);
|
|
89
|
+
var Comp = asChild ? react_slot_1.Slot : "button";
|
|
90
|
+
return (React.createElement(Comp, __assign({ "data-slot": "button", className: (0, utils_1.cn)(buttonVariants({ variant: variant, size: size, className: className })) }, props)));
|
|
91
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Card({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
3
|
+
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
4
|
+
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
5
|
+
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
6
|
+
declare function CardAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
7
|
+
declare function CardContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
8
|
+
declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
47
|
+
var t = {};
|
|
48
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
49
|
+
t[p] = s[p];
|
|
50
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
51
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
52
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
53
|
+
t[p[i]] = s[p[i]];
|
|
54
|
+
}
|
|
55
|
+
return t;
|
|
56
|
+
};
|
|
57
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
|
+
exports.Card = Card;
|
|
59
|
+
exports.CardHeader = CardHeader;
|
|
60
|
+
exports.CardFooter = CardFooter;
|
|
61
|
+
exports.CardTitle = CardTitle;
|
|
62
|
+
exports.CardAction = CardAction;
|
|
63
|
+
exports.CardDescription = CardDescription;
|
|
64
|
+
exports.CardContent = CardContent;
|
|
65
|
+
var React = __importStar(require("react"));
|
|
66
|
+
var utils_1 = require("../lib/utils");
|
|
67
|
+
function Card(_a) {
|
|
68
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
69
|
+
return (React.createElement("div", __assign({ "data-slot": "card", className: (0, utils_1.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm", className) }, props)));
|
|
70
|
+
}
|
|
71
|
+
function CardHeader(_a) {
|
|
72
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
73
|
+
return (React.createElement("div", __assign({ "data-slot": "card-header", className: (0, utils_1.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className) }, props)));
|
|
74
|
+
}
|
|
75
|
+
function CardTitle(_a) {
|
|
76
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
77
|
+
return (React.createElement("div", __assign({ "data-slot": "card-title", className: (0, utils_1.cn)("leading-none font-semibold", className) }, props)));
|
|
78
|
+
}
|
|
79
|
+
function CardDescription(_a) {
|
|
80
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
81
|
+
return (React.createElement("div", __assign({ "data-slot": "card-description", className: (0, utils_1.cn)("text-muted-foreground text-sm", className) }, props)));
|
|
82
|
+
}
|
|
83
|
+
function CardAction(_a) {
|
|
84
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
85
|
+
return (React.createElement("div", __assign({ "data-slot": "card-action", className: (0, utils_1.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className) }, props)));
|
|
86
|
+
}
|
|
87
|
+
function CardContent(_a) {
|
|
88
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
89
|
+
return (React.createElement("div", __assign({ "data-slot": "card-content", className: (0, utils_1.cn)("px-6", className) }, props)));
|
|
90
|
+
}
|
|
91
|
+
function CardFooter(_a) {
|
|
92
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
93
|
+
return (React.createElement("div", __assign({ "data-slot": "card-footer", className: (0, utils_1.cn)("flex items-center px-6 [.border-t]:pt-6", className) }, props)));
|
|
94
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import useEmblaCarousel, { type UseEmblaCarouselType } from "embla-carousel-react";
|
|
3
|
+
import { Button } from "./button";
|
|
4
|
+
type CarouselApi = UseEmblaCarouselType[1];
|
|
5
|
+
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
6
|
+
type CarouselOptions = UseCarouselParameters[0];
|
|
7
|
+
type CarouselPlugin = UseCarouselParameters[1];
|
|
8
|
+
type CarouselProps = {
|
|
9
|
+
opts?: CarouselOptions;
|
|
10
|
+
plugins?: CarouselPlugin;
|
|
11
|
+
orientation?: "horizontal" | "vertical";
|
|
12
|
+
setApi?: (api: CarouselApi) => void;
|
|
13
|
+
};
|
|
14
|
+
declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: React.ComponentProps<"div"> & CarouselProps): React.JSX.Element;
|
|
15
|
+
declare function CarouselContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
16
|
+
declare function CarouselItem({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
17
|
+
declare function CarouselPrevious({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
18
|
+
declare function CarouselNext({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
19
|
+
export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
|