@appcorp/shadcn 1.2.0 → 2.0.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/app-sidebar.js +16 -23
- package/components/audio.js +11 -19
- package/components/dashboard.js +27 -65
- package/components/drawer-generic.js +20 -28
- package/components/enhanced-checkbox.js +10 -57
- package/components/enhanced-combobox.js +99 -143
- package/components/enhanced-drawer-footer.js +22 -31
- package/components/enhanced-drawer-header.js +6 -14
- package/components/enhanced-dropzone-impl.d.ts +32 -0
- package/components/enhanced-dropzone-impl.js +218 -0
- package/components/enhanced-dropzone.d.ts +2 -63
- package/components/enhanced-dropzone.js +6 -294
- package/components/enhanced-input.js +10 -57
- package/components/enhanced-label.js +6 -52
- package/components/enhanced-radio.js +12 -20
- package/components/enhanced-select.js +13 -61
- package/components/enhanced-slider.js +11 -58
- package/components/enhanced-switch.js +11 -58
- package/components/enhanced-table-footer-action.js +11 -19
- package/components/enhanced-table-footer-page.js +16 -24
- package/components/enhanced-table-footer-pagination.js +11 -21
- package/components/enhanced-table-header-action.js +22 -30
- package/components/enhanced-table-header-search.js +9 -17
- package/components/enhanced-table.js +125 -153
- package/components/enhanced-textarea.js +10 -57
- package/components/field.d.ts +1 -1
- package/components/field.js +31 -88
- package/components/image-resize-dialog.js +61 -159
- package/components/nav-main.js +32 -78
- package/components/nav-projects.js +37 -48
- package/components/nav-user.js +41 -51
- package/components/show-toast.js +5 -9
- package/components/sidebar.d.ts +1 -1
- package/components/sidebar.js +115 -184
- package/components/team-switcher.js +36 -47
- package/components/theme-provider.js +36 -84
- package/components/timeline.js +12 -20
- package/components/tooltip.js +10 -59
- package/components/ui/accordion.js +17 -67
- package/components/ui/alert-dialog.js +32 -89
- package/components/ui/alert.d.ts +1 -1
- package/components/ui/alert.js +14 -63
- package/components/ui/area-chart-v1-impl.d.ts +19 -0
- package/components/ui/area-chart-v1-impl.js +75 -0
- package/components/ui/area-chart-v1.d.ts +2 -19
- package/components/ui/area-chart-v1.js +4 -113
- package/components/ui/aspect-ratio.js +3 -39
- package/components/ui/avatar.js +13 -62
- package/components/ui/badge.d.ts +2 -2
- package/components/ui/badge.js +7 -55
- package/components/ui/breadcrumb.js +27 -80
- package/components/ui/button.d.ts +2 -2
- package/components/ui/button.js +10 -58
- package/components/ui/calendar-impl.d.ts +8 -0
- package/components/ui/calendar-impl.js +55 -0
- package/components/ui/calendar.d.ts +2 -8
- package/components/ui/calendar.js +5 -108
- package/components/ui/card.js +21 -73
- package/components/ui/carousel-impl.d.ts +18 -0
- package/components/ui/carousel-impl.js +117 -0
- package/components/ui/carousel.d.ts +6 -18
- package/components/ui/carousel.js +8 -170
- package/components/ui/chart-impl.d.ts +62 -0
- package/components/ui/chart-impl.js +162 -0
- package/components/ui/chart.d.ts +7 -62
- package/components/ui/chart.js +9 -219
- package/components/ui/checkbox.js +10 -57
- package/components/ui/collapsible.js +5 -43
- package/components/ui/combobox.js +22 -58
- package/components/ui/command-impl.d.ts +80 -0
- package/components/ui/command-impl.js +63 -0
- package/components/ui/command.d.ts +9 -80
- package/components/ui/command.js +12 -117
- package/components/ui/context-menu.js +41 -102
- package/components/ui/dialog.js +28 -84
- package/components/ui/drawer-impl.d.ts +22 -0
- package/components/ui/drawer-impl.js +56 -0
- package/components/ui/drawer.d.ts +10 -22
- package/components/ui/drawer.js +13 -111
- package/components/ui/dropdown-menu.js +41 -102
- package/components/ui/form.d.ts +4 -2
- package/components/ui/form.js +41 -95
- package/components/ui/hover-card.js +9 -58
- package/components/ui/input-otp-impl.d.ts +34 -0
- package/components/ui/input-otp-impl.js +43 -0
- package/components/ui/input-otp.d.ts +4 -34
- package/components/ui/input-otp.js +7 -92
- package/components/ui/input.js +6 -53
- package/components/ui/label.d.ts +1 -1
- package/components/ui/label.js +9 -56
- package/components/ui/language-selector.js +17 -55
- package/components/ui/menubar.js +46 -108
- package/components/ui/navigation-menu.d.ts +1 -1
- package/components/ui/navigation-menu.js +29 -84
- package/components/ui/pagination.js +30 -83
- package/components/ui/popover.js +10 -60
- package/components/ui/progress.js +8 -55
- package/components/ui/radio-group.js +12 -60
- package/components/ui/resizable-impl.d.ts +24 -0
- package/components/ui/resizable-impl.js +27 -0
- package/components/ui/resizable.d.ts +3 -24
- package/components/ui/resizable.js +6 -78
- package/components/ui/scroll-area.js +10 -58
- package/components/ui/select.js +34 -90
- package/components/ui/separator.js +7 -54
- package/components/ui/sheet.d.ts +1 -1
- package/components/ui/sheet.js +30 -86
- package/components/ui/skeleton.js +5 -21
- package/components/ui/slider.js +10 -57
- package/components/ui/sonner.js +7 -24
- package/components/ui/switch.js +8 -55
- package/components/ui/table.js +27 -81
- package/components/ui/tabs.js +14 -64
- package/components/ui/textarea.js +6 -53
- package/components/ui/theme-switcher.js +41 -91
- package/components/ui/toggle.d.ts +2 -2
- package/components/ui/toggle.js +9 -57
- package/data/admin-dashboard.js +16 -19
- package/hooks/use-enhanced-combobox.js +47 -124
- package/hooks/use-mobile.js +8 -44
- package/hooks/use-outside-click.js +6 -10
- package/lib/themes.js +1 -4
- package/lib/toast-utils.js +78 -120
- package/lib/utils.js +4 -11
- package/package.json +9 -90
- package/utils/transform-breadcrumbs.js +4 -8
- package/utils/transform-navitems.js +7 -22
- package/components/aceternity-ui/apple-cards-carousel.d.ts +0 -35
- package/components/aceternity-ui/apple-cards-carousel.js +0 -263
- package/components/shadcn-example/ai-chat/chat-interface.d.ts +0 -11
- package/components/shadcn-example/ai-chat/chat-interface.js +0 -70
- package/components/shadcn-example/ai-chat/index.d.ts +0 -38
- package/components/shadcn-example/ai-chat/index.js +0 -66
- package/components/shadcn-example/ai-chat/sidebar.d.ts +0 -15
- package/components/shadcn-example/ai-chat/sidebar.js +0 -68
- package/components/shadcn-example/ai-chat/welcome-section.d.ts +0 -12
- package/components/shadcn-example/ai-chat/welcome-section.js +0 -26
- package/components/shadcn-example/authentication/index.d.ts +0 -24
- package/components/shadcn-example/authentication/index.js +0 -59
- package/components/shadcn-example/authentication/user-auth-form.d.ts +0 -11
- package/components/shadcn-example/authentication/user-auth-form.js +0 -54
- package/components/shadcn-example/blog-detail-page/comment-section.d.ts +0 -15
- package/components/shadcn-example/blog-detail-page/comment-section.js +0 -83
- package/components/shadcn-example/blog-detail-page/content.d.ts +0 -7
- package/components/shadcn-example/blog-detail-page/content.js +0 -15
- package/components/shadcn-example/blog-detail-page/header.d.ts +0 -11
- package/components/shadcn-example/blog-detail-page/header.js +0 -36
- package/components/shadcn-example/blog-detail-page/index.d.ts +0 -25
- package/components/shadcn-example/blog-detail-page/index.js +0 -74
- package/components/shadcn-example/blog-page/blog-post-card.d.ts +0 -13
- package/components/shadcn-example/blog-page/blog-post-card.js +0 -30
- package/components/shadcn-example/blog-page/featured-post-sidebar-item.d.ts +0 -10
- package/components/shadcn-example/blog-page/featured-post-sidebar-item.js +0 -19
- package/components/shadcn-example/blog-page/index.d.ts +0 -20
- package/components/shadcn-example/blog-page/index.js +0 -36
- package/components/shadcn-example/coming-soon/countdown.d.ts +0 -2
- package/components/shadcn-example/coming-soon/countdown.js +0 -82
- package/components/shadcn-example/coming-soon/index.d.ts +0 -10
- package/components/shadcn-example/coming-soon/index.js +0 -41
- package/components/shadcn-io/color-picker/index.d.ts +0 -43
- package/components/shadcn-io/color-picker/index.js +0 -304
- package/components/shadcn-io/copy-button/index.d.ts +0 -16
- package/components/shadcn-io/copy-button/index.js +0 -121
- package/components/shadcn-io/dropzone/index.d.ts +0 -19
- package/components/shadcn-io/dropzone/index.js +0 -131
- package/components/shadcn-io/gantt/index.d.ts +0 -145
- package/components/shadcn-io/gantt/index.js +0 -766
- package/components/shadcn-io/table/index.d.ts +0 -60
- package/components/shadcn-io/table/index.js +0 -138
- package/templates/appcorp-v1/footer/bottom-bar.d.ts +0 -6
- package/templates/appcorp-v1/footer/bottom-bar.js +0 -25
- package/templates/appcorp-v1/footer/cta.d.ts +0 -6
- package/templates/appcorp-v1/footer/cta.js +0 -21
- package/templates/appcorp-v1/footer/footer-grid.d.ts +0 -14
- package/templates/appcorp-v1/footer/footer-grid.js +0 -52
- package/templates/appcorp-v1/footer/index.d.ts +0 -3
- package/templates/appcorp-v1/footer/index.js +0 -28
- package/templates/appcorp-v1/footer/newsletter.d.ts +0 -11
- package/templates/appcorp-v1/footer/newsletter.js +0 -28
- package/templates/appcorp-v1/footer/stats.d.ts +0 -6
- package/templates/appcorp-v1/footer/stats.js +0 -15
- package/templates/appcorp-v1/header/announcement-bar.d.ts +0 -3
- package/templates/appcorp-v1/header/announcement-bar.js +0 -15
- package/templates/appcorp-v1/header/dropdown-panel.d.ts +0 -8
- package/templates/appcorp-v1/header/dropdown-panel.js +0 -72
- package/templates/appcorp-v1/header/index.d.ts +0 -12
- package/templates/appcorp-v1/header/index.js +0 -16
- package/templates/appcorp-v1/header/mobile-menu.d.ts +0 -14
- package/templates/appcorp-v1/header/mobile-menu.js +0 -101
- package/templates/appcorp-v1/header/navigation-bar.d.ts +0 -3
- package/templates/appcorp-v1/header/navigation-bar.js +0 -117
- package/templates/appcorp-v1/header/social-button.d.ts +0 -7
- package/templates/appcorp-v1/header/social-button.js +0 -48
- package/templates/appcorp-v1/home.d.ts +0 -3
- package/templates/appcorp-v1/home.js +0 -27
- package/templates/data/appcorp-v1.d.ts +0 -93
- package/templates/data/appcorp-v1.js +0 -348
- package/templates/data/edupilotpro-v1.d.ts +0 -33
- package/templates/data/edupilotpro-v1.js +0 -116
- package/templates/data/school-v1.d.ts +0 -328
- package/templates/data/school-v1.js +0 -1563
- package/templates/edupilotpro-v1/feature-card.d.ts +0 -13
- package/templates/edupilotpro-v1/feature-card.js +0 -28
- package/templates/edupilotpro-v1/mockups/dashboard-mockup.d.ts +0 -3
- package/templates/edupilotpro-v1/mockups/dashboard-mockup.js +0 -55
- package/templates/school-v1/footer.d.ts +0 -3
- package/templates/school-v1/footer.js +0 -75
- package/templates/school-v1/index.d.ts +0 -18
- package/templates/school-v1/index.js +0 -60
- package/templates/school-v1/navigation.d.ts +0 -3
- package/templates/school-v1/navigation.js +0 -123
- package/templates/school-v1/sections/about.d.ts +0 -3
- package/templates/school-v1/sections/about.js +0 -49
- package/templates/school-v1/sections/admissions.d.ts +0 -3
- package/templates/school-v1/sections/admissions.js +0 -77
- package/templates/school-v1/sections/contact.d.ts +0 -3
- package/templates/school-v1/sections/contact.js +0 -67
- package/templates/school-v1/sections/faqs.d.ts +0 -3
- package/templates/school-v1/sections/faqs.js +0 -50
- package/templates/school-v1/sections/hero.d.ts +0 -3
- package/templates/school-v1/sections/hero.js +0 -132
- package/templates/school-v1/sections/management.d.ts +0 -3
- package/templates/school-v1/sections/management.js +0 -34
- package/templates/school-v1/sections/policies.d.ts +0 -3
- package/templates/school-v1/sections/policies.js +0 -127
- package/templates/school-v1/sections/programs.d.ts +0 -3
- package/templates/school-v1/sections/programs.js +0 -107
- package/templates/school-v1/sections/testimonials.d.ts +0 -3
- package/templates/school-v1/sections/testimonials.js +0 -46
- package/templates/school-v1/sections/why-choose-us.d.ts +0 -3
- package/templates/school-v1/sections/why-choose-us.js +0 -57
|
@@ -1,30 +0,0 @@
|
|
|
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.BlogPostCard = void 0;
|
|
7
|
-
var react_1 = __importDefault(require("react"));
|
|
8
|
-
var image_1 = __importDefault(require("next/image"));
|
|
9
|
-
var avatar_1 = require("../../../components/ui/avatar");
|
|
10
|
-
var BlogPostCard = function (_a) {
|
|
11
|
-
var authorAvatarSrc = _a.authorAvatarSrc, authorName = _a.authorName, description = _a.description, handleOnClick = _a.handleOnClick, imageAlt = _a.imageAlt, imageSrc = _a.imageSrc, readTime = _a.readTime, title = _a.title;
|
|
12
|
-
return (react_1.default.createElement("div", { className: "bg-card text-card-foreground overflow-hidden rounded-lg border cursor-pointer", onClick: handleOnClick },
|
|
13
|
-
react_1.default.createElement(image_1.default, { alt: imageAlt, className: "h-48 w-full object-cover", height: 225, src: imageSrc, width: 400 }),
|
|
14
|
-
react_1.default.createElement("div", { className: "grid gap-2 p-4" },
|
|
15
|
-
react_1.default.createElement("h3", { className: "text-lg leading-tight font-semibold" }, title),
|
|
16
|
-
react_1.default.createElement("p", { className: "text-muted-foreground line-clamp-3 text-sm" }, description),
|
|
17
|
-
react_1.default.createElement("div", { className: "text-muted-foreground flex items-center gap-2 text-sm" },
|
|
18
|
-
react_1.default.createElement(avatar_1.Avatar, { className: "h-6 w-6" },
|
|
19
|
-
react_1.default.createElement(avatar_1.AvatarImage, { src: authorAvatarSrc || "/placeholder.svg" }),
|
|
20
|
-
react_1.default.createElement(avatar_1.AvatarFallback, null, authorName
|
|
21
|
-
.split(" ")
|
|
22
|
-
.map(function (n) { return n[0]; })
|
|
23
|
-
.join(""))),
|
|
24
|
-
react_1.default.createElement("span", null, authorName),
|
|
25
|
-
react_1.default.createElement("span", null, "\u2022"),
|
|
26
|
-
react_1.default.createElement("span", null,
|
|
27
|
-
readTime,
|
|
28
|
-
" read")))));
|
|
29
|
-
};
|
|
30
|
-
exports.BlogPostCard = BlogPostCard;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface FeaturedPostSidebarItemProps {
|
|
3
|
-
handleOnClick: () => void;
|
|
4
|
-
imageAlt: string;
|
|
5
|
-
imageSrc: string;
|
|
6
|
-
tags: string[];
|
|
7
|
-
title: string;
|
|
8
|
-
}
|
|
9
|
-
export declare const FeaturedPostSidebarItem: ({ handleOnClick, imageAlt, imageSrc, tags, title, }: FeaturedPostSidebarItemProps) => React.JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
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.FeaturedPostSidebarItem = void 0;
|
|
7
|
-
var react_1 = __importDefault(require("react"));
|
|
8
|
-
var image_1 = __importDefault(require("next/image"));
|
|
9
|
-
var badge_1 = require("../../ui/badge");
|
|
10
|
-
var FeaturedPostSidebarItem = function (_a) {
|
|
11
|
-
var handleOnClick = _a.handleOnClick, imageAlt = _a.imageAlt, imageSrc = _a.imageSrc, tags = _a.tags, title = _a.title;
|
|
12
|
-
return (react_1.default.createElement("div", { className: "flex flex-col gap-2 cursor-pointer", onClick: handleOnClick },
|
|
13
|
-
react_1.default.createElement("div", { className: "flex items-center gap-4" },
|
|
14
|
-
react_1.default.createElement(image_1.default, { alt: imageAlt, className: "aspect-square rounded-md object-cover", height: 64, src: imageSrc || "/placeholder.svg", width: 64 }),
|
|
15
|
-
react_1.default.createElement("div", null,
|
|
16
|
-
react_1.default.createElement("h4", { className: "text-sm leading-snug font-medium" }, title),
|
|
17
|
-
react_1.default.createElement("div", { className: "flex flex-row gap-4" }, tags === null || tags === void 0 ? void 0 : tags.map(function (tag) { return (react_1.default.createElement(badge_1.Badge, { key: tag, className: "mb-2 w-fit bg-black text-white backdrop-blur-sm" }, tag)); }))))));
|
|
18
|
-
};
|
|
19
|
-
exports.FeaturedPostSidebarItem = FeaturedPostSidebarItem;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
export type BlogItem = {
|
|
3
|
-
authorAvatarSrc: string;
|
|
4
|
-
authorName: string;
|
|
5
|
-
description: string;
|
|
6
|
-
handleOnClick: () => void;
|
|
7
|
-
imageAlt?: string;
|
|
8
|
-
imageSrc: string;
|
|
9
|
-
isFeatured: boolean;
|
|
10
|
-
link: string;
|
|
11
|
-
readTime: string;
|
|
12
|
-
tags: string[];
|
|
13
|
-
title: string;
|
|
14
|
-
};
|
|
15
|
-
type BlogPageProps = {
|
|
16
|
-
items: BlogItem[];
|
|
17
|
-
recommendedPosts: BlogItem[];
|
|
18
|
-
};
|
|
19
|
-
export declare const BlogPage: FC<BlogPageProps>;
|
|
20
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
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.BlogPage = void 0;
|
|
7
|
-
var react_1 = __importDefault(require("react"));
|
|
8
|
-
var link_1 = __importDefault(require("next/link"));
|
|
9
|
-
var image_1 = __importDefault(require("next/image"));
|
|
10
|
-
var badge_1 = require("../../../components/ui/badge");
|
|
11
|
-
var button_1 = require("../../../components/ui/button");
|
|
12
|
-
var blog_post_card_1 = require("./blog-post-card");
|
|
13
|
-
var featured_post_sidebar_item_1 = require("./featured-post-sidebar-item");
|
|
14
|
-
var BlogPage = function (_a) {
|
|
15
|
-
var _b;
|
|
16
|
-
var items = _a.items, recommendedPosts = _a.recommendedPosts;
|
|
17
|
-
var featuredPost = items.find(function (item) { return item.isFeatured; });
|
|
18
|
-
var otherPosts = items.filter(function (item) { return !item.isFeatured; });
|
|
19
|
-
return (react_1.default.createElement("div", { className: "container mx-auto px-4 py-8 md:px-6 lg:px-8" },
|
|
20
|
-
react_1.default.createElement("div", { className: "grid grid-cols-1 gap-8 lg:grid-cols-3" },
|
|
21
|
-
react_1.default.createElement("div", { className: "relative h-[400px] overflow-hidden rounded-lg shadow-lg md:h-[500px] lg:col-span-2 cursor-pointer", onClick: featuredPost === null || featuredPost === void 0 ? void 0 : featuredPost.handleOnClick },
|
|
22
|
-
(featuredPost === null || featuredPost === void 0 ? void 0 : featuredPost.imageSrc) && (react_1.default.createElement(image_1.default, { alt: featuredPost.imageAlt, className: "w-full object-cover", fill: true, height: 0, sizes: "70vw", src: featuredPost.imageSrc, width: 0 })),
|
|
23
|
-
react_1.default.createElement("div", { className: "absolute inset-0 flex flex-col justify-end bg-gradient-to-t from-black/70 to-transparent p-6 text-white" },
|
|
24
|
-
react_1.default.createElement("div", { className: "flex flex-row gap-4" }, (_b = featuredPost === null || featuredPost === void 0 ? void 0 : featuredPost.tags) === null || _b === void 0 ? void 0 : _b.map(function (tag) { return (react_1.default.createElement(badge_1.Badge, { key: tag, className: "mb-2 w-fit bg-white/20 text-white backdrop-blur-sm" }, tag)); })),
|
|
25
|
-
react_1.default.createElement("h2", { className: "text-2xl leading-tight font-bold md:text-3xl" }, featuredPost === null || featuredPost === void 0 ? void 0 : featuredPost.title))),
|
|
26
|
-
react_1.default.createElement("div", { className: "bg-card text-card-foreground space-y-6 rounded-lg border p-6 lg:col-span-1" },
|
|
27
|
-
react_1.default.createElement("h3", { className: "text-xl font-semibold" }, "Other posts"),
|
|
28
|
-
react_1.default.createElement("div", { className: "space-y-4" }, otherPosts.map(function (item) { return (react_1.default.createElement(featured_post_sidebar_item_1.FeaturedPostSidebarItem, { handleOnClick: item.handleOnClick, imageAlt: item.imageAlt, imageSrc: item.imageSrc, key: item.title, tags: item.tags, title: item.title })); })))),
|
|
29
|
-
react_1.default.createElement("div", { className: "mt-12" },
|
|
30
|
-
react_1.default.createElement("div", { className: "mb-6 flex items-center justify-between" },
|
|
31
|
-
react_1.default.createElement("h2", { className: "text-2xl font-bold" }, "Recommended Posts"),
|
|
32
|
-
react_1.default.createElement(button_1.Button, { variant: "outline", asChild: true },
|
|
33
|
-
react_1.default.createElement(link_1.default, { href: "#" }, "All Posts"))),
|
|
34
|
-
react_1.default.createElement("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3" }, recommendedPosts.map(function (p) { return (react_1.default.createElement(blog_post_card_1.BlogPostCard, { authorAvatarSrc: p.authorAvatarSrc, authorName: p.authorName, description: p.description, handleOnClick: p.handleOnClick, imageAlt: p.imageAlt, imageSrc: p.imageSrc, key: p.title, readTime: p.readTime, title: p.title })); })))));
|
|
35
|
-
};
|
|
36
|
-
exports.BlogPage = BlogPage;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
36
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.Countdown = void 0;
|
|
38
|
-
var react_1 = __importStar(require("react"));
|
|
39
|
-
var calculateTimeLeft = function (targetDate) {
|
|
40
|
-
var difference = +targetDate - +new Date();
|
|
41
|
-
var timeLeft = {
|
|
42
|
-
days: 0,
|
|
43
|
-
hours: 0,
|
|
44
|
-
minutes: 0,
|
|
45
|
-
seconds: 0,
|
|
46
|
-
};
|
|
47
|
-
if (difference > 0) {
|
|
48
|
-
timeLeft = {
|
|
49
|
-
days: Math.floor(difference / (1000 * 60 * 60 * 24)),
|
|
50
|
-
hours: Math.floor((difference / (1000 * 60 * 60)) % 24),
|
|
51
|
-
minutes: Math.floor((difference / 1000 / 60) % 60),
|
|
52
|
-
seconds: Math.floor((difference / 1000) % 60),
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
return timeLeft;
|
|
56
|
-
};
|
|
57
|
-
var Countdown = function () {
|
|
58
|
-
// Initialize targetDate only once using useState's functional update
|
|
59
|
-
var targetDate = (0, react_1.useState)(function () {
|
|
60
|
-
var date = new Date();
|
|
61
|
-
date.setDate(date.getDate() + 30); // Set to 30 days from the initial render time
|
|
62
|
-
return date;
|
|
63
|
-
})[0];
|
|
64
|
-
var _a = (0, react_1.useState)(calculateTimeLeft(targetDate)), timeLeft = _a[0], setTimeLeft = _a[1];
|
|
65
|
-
(0, react_1.useEffect)(function () {
|
|
66
|
-
// Use setInterval for continuous updates
|
|
67
|
-
var timer = setInterval(function () {
|
|
68
|
-
setTimeLeft(calculateTimeLeft(targetDate));
|
|
69
|
-
}, 1000); // Update every second
|
|
70
|
-
// Clean up the interval when the component unmounts or targetDate changes (though targetDate is stable here)
|
|
71
|
-
return function () { return clearInterval(timer); };
|
|
72
|
-
}, [targetDate]); // Dependency array ensures effect runs only if targetDate changes (which it won't after initial render)
|
|
73
|
-
var timerComponents = [];
|
|
74
|
-
Object.keys(timeLeft).forEach(function (interval) {
|
|
75
|
-
var value = timeLeft[interval];
|
|
76
|
-
timerComponents.push(react_1.default.createElement("div", { key: interval, className: "flex flex-col items-center" },
|
|
77
|
-
react_1.default.createElement("span", { className: "text-5xl font-bold" }, value < 10 ? "0".concat(value) : value),
|
|
78
|
-
react_1.default.createElement("span", { className: "text-sm uppercase opacity-80" }, interval)));
|
|
79
|
-
});
|
|
80
|
-
return (react_1.default.createElement("div", { className: "flex justify-center gap-6 md:gap-8" }, timerComponents.length ? timerComponents : react_1.default.createElement("span", null, "Time up!")));
|
|
81
|
-
};
|
|
82
|
-
exports.Countdown = Countdown;
|
|
@@ -1,41 +0,0 @@
|
|
|
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.ComingSoon = void 0;
|
|
7
|
-
var link_1 = __importDefault(require("next/link"));
|
|
8
|
-
var lucide_react_1 = require("lucide-react");
|
|
9
|
-
var input_1 = require("../../ui/input");
|
|
10
|
-
var button_1 = require("../../ui/button");
|
|
11
|
-
var countdown_1 = require("./countdown");
|
|
12
|
-
// import { Logo } from "@/components/logo";
|
|
13
|
-
var image_1 = __importDefault(require("next/image"));
|
|
14
|
-
var react_1 = __importDefault(require("react"));
|
|
15
|
-
var ComingSoon = function (_a) {
|
|
16
|
-
var backgroundImage = _a.backgroundImage, footerLinks = _a.footerLinks, logo = _a.logo;
|
|
17
|
-
return (react_1.default.createElement("div", { className: "grid min-h-screen lg:grid-cols-2" },
|
|
18
|
-
react_1.default.createElement("div", { className: "posi relative flex flex-1 flex-col items-center justify-between bg-top p-8 lg:p-12", style: {
|
|
19
|
-
background: "url(".concat(backgroundImage, ")"),
|
|
20
|
-
backgroundSize: "cover",
|
|
21
|
-
backgroundRepeat: "no-repeat",
|
|
22
|
-
} },
|
|
23
|
-
react_1.default.createElement("div", { className: "z-10 flex w-full items-center justify-start" },
|
|
24
|
-
react_1.default.createElement("div", { className: "flex items-center gap-2" },
|
|
25
|
-
react_1.default.createElement(image_1.default, { src: logo, width: 30, height: 30, alt: "logo" }))),
|
|
26
|
-
react_1.default.createElement("nav", { className: "relative z-10 mt-8 flex w-full justify-center gap-6 text-gray-600 lg:justify-start" }, footerLinks.slice(0, 4).map(function (link) { return (react_1.default.createElement(link_1.default, { key: link.label, href: link.href, className: "text-black hover:underline" }, link.label)); }))),
|
|
27
|
-
react_1.default.createElement("div", { className: "relative flex flex-1 flex-col items-center justify-center bg-gradient-to-br p-8 lg:p-12" },
|
|
28
|
-
react_1.default.createElement("div", { className: "flex w-full items-center justify-end" },
|
|
29
|
-
react_1.default.createElement(lucide_react_1.Share2, { className: "h-6 w-6 cursor-pointer opacity-80 hover:opacity-100" })),
|
|
30
|
-
react_1.default.createElement("div", { className: "flex flex-col items-center space-y-20 text-center" },
|
|
31
|
-
react_1.default.createElement("div", { className: "relative z-10 flex flex-col items-center space-y-2 text-center" },
|
|
32
|
-
react_1.default.createElement("h1", { className: "text-4xl font-bold text-[#6a5acd] lg:text-5xl" }, "Coming Soon"),
|
|
33
|
-
react_1.default.createElement("p", { className: "text-muted-foreground lg:text-lg" }, "Stay Connected, Stay Updated!")),
|
|
34
|
-
react_1.default.createElement(countdown_1.Countdown, null),
|
|
35
|
-
react_1.default.createElement("div", { className: "space-y-6" },
|
|
36
|
-
react_1.default.createElement("h2", { className: "text-xl font-semibold md:text-2xl" }, "Get Updates!"),
|
|
37
|
-
react_1.default.createElement("form", { className: "flex w-full max-w-sm rounded-full border p-1" },
|
|
38
|
-
react_1.default.createElement(input_1.Input, { type: "email", placeholder: "Email Address", className: "flex-1 rounded-full border-none bg-transparent px-4 focus-visible:ring-0 focus-visible:ring-offset-0" }),
|
|
39
|
-
react_1.default.createElement(button_1.Button, { type: "submit", className: "rounded-full" }, "Send Now")))))));
|
|
40
|
-
};
|
|
41
|
-
exports.ComingSoon = ComingSoon;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import Color from "color";
|
|
3
|
-
import { Slider } from "radix-ui";
|
|
4
|
-
import { type ComponentProps, type HTMLAttributes } from "react";
|
|
5
|
-
import { Button } from "../../ui/button";
|
|
6
|
-
import { SelectTrigger } from "../../ui/select";
|
|
7
|
-
interface ColorPickerContextValue {
|
|
8
|
-
hue: number;
|
|
9
|
-
saturation: number;
|
|
10
|
-
lightness: number;
|
|
11
|
-
alpha: number;
|
|
12
|
-
mode: string;
|
|
13
|
-
setHue: (hue: number) => void;
|
|
14
|
-
setSaturation: (saturation: number) => void;
|
|
15
|
-
setLightness: (lightness: number) => void;
|
|
16
|
-
setAlpha: (alpha: number) => void;
|
|
17
|
-
setMode: (mode: string) => void;
|
|
18
|
-
}
|
|
19
|
-
export declare const useColorPicker: () => ColorPickerContextValue;
|
|
20
|
-
export type ColorPickerProps = Omit<HTMLAttributes<HTMLDivElement>, "onChange"> & {
|
|
21
|
-
value?: Parameters<typeof Color>[0];
|
|
22
|
-
defaultValue?: Parameters<typeof Color>[0];
|
|
23
|
-
onChange?: (value: [number, number, number, number]) => void;
|
|
24
|
-
error?: string;
|
|
25
|
-
info?: string;
|
|
26
|
-
label?: string;
|
|
27
|
-
required?: boolean;
|
|
28
|
-
id?: string;
|
|
29
|
-
};
|
|
30
|
-
export declare const ColorPicker: ({ value, defaultValue, onChange, className, error, info, label, required, id, ...props }: ColorPickerProps) => React.JSX.Element;
|
|
31
|
-
export type ColorPickerSelectionProps = HTMLAttributes<HTMLDivElement>;
|
|
32
|
-
export declare const ColorPickerSelection: React.MemoExoticComponent<({ className, ...props }: ColorPickerSelectionProps) => React.JSX.Element>;
|
|
33
|
-
export type ColorPickerHueProps = ComponentProps<typeof Slider.Root>;
|
|
34
|
-
export declare const ColorPickerHue: ({ className, ...props }: ColorPickerHueProps) => React.JSX.Element;
|
|
35
|
-
export type ColorPickerAlphaProps = ComponentProps<typeof Slider.Root>;
|
|
36
|
-
export declare const ColorPickerAlpha: ({ className, ...props }: ColorPickerAlphaProps) => React.JSX.Element;
|
|
37
|
-
export type ColorPickerEyeDropperProps = ComponentProps<typeof Button>;
|
|
38
|
-
export declare const ColorPickerEyeDropper: ({ className, ...props }: ColorPickerEyeDropperProps) => React.JSX.Element;
|
|
39
|
-
export type ColorPickerOutputProps = ComponentProps<typeof SelectTrigger>;
|
|
40
|
-
export declare const ColorPickerOutput: ({ className, ...props }: ColorPickerOutputProps) => React.JSX.Element;
|
|
41
|
-
export type ColorPickerFormatProps = HTMLAttributes<HTMLDivElement>;
|
|
42
|
-
export declare const ColorPickerFormat: ({ className, ...props }: ColorPickerFormatProps) => React.JSX.Element | null;
|
|
43
|
-
export {};
|
|
@@ -1,304 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
var __assign = (this && this.__assign) || function () {
|
|
4
|
-
__assign = Object.assign || function(t) {
|
|
5
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
-
s = arguments[i];
|
|
7
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8
|
-
t[p] = s[p];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
return __assign.apply(this, arguments);
|
|
13
|
-
};
|
|
14
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
24
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
25
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
26
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
27
|
-
function step(op) {
|
|
28
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
29
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
30
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
31
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
32
|
-
switch (op[0]) {
|
|
33
|
-
case 0: case 1: t = op; break;
|
|
34
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
35
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
36
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
37
|
-
default:
|
|
38
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
39
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
40
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
41
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
42
|
-
if (t[2]) _.ops.pop();
|
|
43
|
-
_.trys.pop(); continue;
|
|
44
|
-
}
|
|
45
|
-
op = body.call(thisArg, _);
|
|
46
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
47
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
51
|
-
var t = {};
|
|
52
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
53
|
-
t[p] = s[p];
|
|
54
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
55
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
56
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
57
|
-
t[p[i]] = s[p[i]];
|
|
58
|
-
}
|
|
59
|
-
return t;
|
|
60
|
-
};
|
|
61
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
62
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
63
|
-
};
|
|
64
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
|
-
exports.ColorPickerFormat = exports.ColorPickerOutput = exports.ColorPickerEyeDropper = exports.ColorPickerAlpha = exports.ColorPickerHue = exports.ColorPickerSelection = exports.ColorPicker = exports.useColorPicker = void 0;
|
|
66
|
-
var react_1 = __importDefault(require("react"));
|
|
67
|
-
var color_1 = __importDefault(require("color"));
|
|
68
|
-
var lucide_react_1 = require("lucide-react");
|
|
69
|
-
var radix_ui_1 = require("radix-ui");
|
|
70
|
-
var react_2 = require("react");
|
|
71
|
-
var button_1 = require("../../ui/button");
|
|
72
|
-
var input_1 = require("../../ui/input");
|
|
73
|
-
var enhanced_label_1 = require("../../enhanced-label");
|
|
74
|
-
var select_1 = require("../../ui/select");
|
|
75
|
-
var utils_1 = require("../../../lib/utils");
|
|
76
|
-
var ColorPickerContext = (0, react_2.createContext)(undefined);
|
|
77
|
-
var useColorPicker = function () {
|
|
78
|
-
var context = (0, react_2.useContext)(ColorPickerContext);
|
|
79
|
-
if (!context) {
|
|
80
|
-
throw new Error("useColorPicker must be used within a ColorPickerProvider");
|
|
81
|
-
}
|
|
82
|
-
return context;
|
|
83
|
-
};
|
|
84
|
-
exports.useColorPicker = useColorPicker;
|
|
85
|
-
var ColorPicker = function (_a) {
|
|
86
|
-
var value = _a.value, _b = _a.defaultValue, defaultValue = _b === void 0 ? "#000000" : _b, onChange = _a.onChange, className = _a.className, error = _a.error, info = _a.info, label = _a.label, required = _a.required, id = _a.id, props = __rest(_a, ["value", "defaultValue", "onChange", "className", "error", "info", "label", "required", "id"]);
|
|
87
|
-
var selectedColor = (0, color_1.default)(value);
|
|
88
|
-
var defaultColor = (0, color_1.default)(defaultValue);
|
|
89
|
-
var _c = (0, react_2.useState)(selectedColor.hue() || defaultColor.hue() || 0), hue = _c[0], setHue = _c[1];
|
|
90
|
-
var _d = (0, react_2.useState)(selectedColor.saturationl() || defaultColor.saturationl() || 100), saturation = _d[0], setSaturation = _d[1];
|
|
91
|
-
var _e = (0, react_2.useState)(selectedColor.lightness() || defaultColor.lightness() || 50), lightness = _e[0], setLightness = _e[1];
|
|
92
|
-
var _f = (0, react_2.useState)(selectedColor.alpha() * 100 || defaultColor.alpha() * 100), alpha = _f[0], setAlpha = _f[1];
|
|
93
|
-
var _g = (0, react_2.useState)("hex"), mode = _g[0], setMode = _g[1];
|
|
94
|
-
// Determine if there's an error (for styling)
|
|
95
|
-
var hasError = Boolean(error);
|
|
96
|
-
// Update color when controlled value changes
|
|
97
|
-
(0, react_2.useEffect)(function () {
|
|
98
|
-
if (value) {
|
|
99
|
-
var color = color_1.default.rgb(value).rgb().object();
|
|
100
|
-
setHue(color.r);
|
|
101
|
-
setSaturation(color.g);
|
|
102
|
-
setLightness(color.b);
|
|
103
|
-
setAlpha(color.a);
|
|
104
|
-
}
|
|
105
|
-
}, [value]);
|
|
106
|
-
// Notify parent of changes
|
|
107
|
-
(0, react_2.useEffect)(function () {
|
|
108
|
-
if (onChange) {
|
|
109
|
-
var color = color_1.default.hsl(hue, saturation, lightness).alpha(alpha / 100);
|
|
110
|
-
var rgba = color.rgb().array();
|
|
111
|
-
onChange([rgba[0], rgba[1], rgba[2], alpha / 100]);
|
|
112
|
-
}
|
|
113
|
-
}, [hue, saturation, lightness, alpha, onChange]);
|
|
114
|
-
var colorPickerElement = (react_1.default.createElement(ColorPickerContext.Provider, { value: {
|
|
115
|
-
hue: hue,
|
|
116
|
-
saturation: saturation,
|
|
117
|
-
lightness: lightness,
|
|
118
|
-
alpha: alpha,
|
|
119
|
-
mode: mode,
|
|
120
|
-
setHue: setHue,
|
|
121
|
-
setSaturation: setSaturation,
|
|
122
|
-
setLightness: setLightness,
|
|
123
|
-
setAlpha: setAlpha,
|
|
124
|
-
setMode: setMode,
|
|
125
|
-
} },
|
|
126
|
-
react_1.default.createElement("div", __assign({ id: id, className: (0, utils_1.cn)("flex size-full flex-col gap-4",
|
|
127
|
-
// Error state styling
|
|
128
|
-
hasError && "border-destructive", className), "aria-invalid": hasError }, props))));
|
|
129
|
-
// If label is provided, render the complete color picker with label structure
|
|
130
|
-
if (label) {
|
|
131
|
-
return (react_1.default.createElement("div", { className: "w-full space-y-2" },
|
|
132
|
-
react_1.default.createElement(enhanced_label_1.EnhancedLabel, { htmlFor: id, required: required }, label),
|
|
133
|
-
colorPickerElement,
|
|
134
|
-
(error || info) && (react_1.default.createElement("div", null, error ? (react_1.default.createElement("p", { className: "text-xs text-destructive" }, error)) : info ? (react_1.default.createElement("p", { className: "text-xs text-blue-600 dark:text-blue-400" }, info)) : null))));
|
|
135
|
-
}
|
|
136
|
-
// If no label, render just the color picker with messages (backward compatibility)
|
|
137
|
-
return (react_1.default.createElement("div", { className: "w-full" },
|
|
138
|
-
colorPickerElement,
|
|
139
|
-
(error || info) && (react_1.default.createElement("div", null, error ? (react_1.default.createElement("p", { className: "text-xs text-destructive" }, error)) : info ? (react_1.default.createElement("p", { className: "text-xs text-blue-600 dark:text-blue-400" }, info)) : null))));
|
|
140
|
-
};
|
|
141
|
-
exports.ColorPicker = ColorPicker;
|
|
142
|
-
exports.ColorPickerSelection = (0, react_2.memo)(function (_a) {
|
|
143
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
144
|
-
var containerRef = (0, react_2.useRef)(null);
|
|
145
|
-
var _b = (0, react_2.useState)(false), isDragging = _b[0], setIsDragging = _b[1];
|
|
146
|
-
var _c = (0, react_2.useState)(0), positionX = _c[0], setPositionX = _c[1];
|
|
147
|
-
var _d = (0, react_2.useState)(0), positionY = _d[0], setPositionY = _d[1];
|
|
148
|
-
var _e = (0, exports.useColorPicker)(), hue = _e.hue, setSaturation = _e.setSaturation, setLightness = _e.setLightness;
|
|
149
|
-
var backgroundGradient = (0, react_2.useMemo)(function () {
|
|
150
|
-
return "linear-gradient(0deg, rgba(0,0,0,1), rgba(0,0,0,0)),\n linear-gradient(90deg, rgba(255,255,255,1), rgba(255,255,255,0)),\n hsl(".concat(hue, ", 100%, 50%)");
|
|
151
|
-
}, [hue]);
|
|
152
|
-
var handlePointerMove = (0, react_2.useCallback)(function (event) {
|
|
153
|
-
if (!(isDragging && containerRef.current)) {
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
var rect = containerRef.current.getBoundingClientRect();
|
|
157
|
-
var x = Math.max(0, Math.min(1, (event.clientX - rect.left) / rect.width));
|
|
158
|
-
var y = Math.max(0, Math.min(1, (event.clientY - rect.top) / rect.height));
|
|
159
|
-
setPositionX(x);
|
|
160
|
-
setPositionY(y);
|
|
161
|
-
setSaturation(x * 100);
|
|
162
|
-
var topLightness = x < 0.01 ? 100 : 50 + 50 * (1 - x);
|
|
163
|
-
var lightness = topLightness * (1 - y);
|
|
164
|
-
setLightness(lightness);
|
|
165
|
-
}, [isDragging, setSaturation, setLightness]);
|
|
166
|
-
(0, react_2.useEffect)(function () {
|
|
167
|
-
var handlePointerUp = function () { return setIsDragging(false); };
|
|
168
|
-
if (isDragging) {
|
|
169
|
-
window.addEventListener("pointermove", handlePointerMove);
|
|
170
|
-
window.addEventListener("pointerup", handlePointerUp);
|
|
171
|
-
}
|
|
172
|
-
return function () {
|
|
173
|
-
window.removeEventListener("pointermove", handlePointerMove);
|
|
174
|
-
window.removeEventListener("pointerup", handlePointerUp);
|
|
175
|
-
};
|
|
176
|
-
}, [isDragging, handlePointerMove]);
|
|
177
|
-
return (react_1.default.createElement("div", __assign({ className: (0, utils_1.cn)("relative size-full cursor-crosshair rounded", className), onPointerDown: function (e) {
|
|
178
|
-
e.preventDefault();
|
|
179
|
-
setIsDragging(true);
|
|
180
|
-
handlePointerMove(e.nativeEvent);
|
|
181
|
-
}, ref: containerRef, style: {
|
|
182
|
-
background: backgroundGradient,
|
|
183
|
-
} }, props),
|
|
184
|
-
react_1.default.createElement("div", { className: "-translate-x-1/2 -translate-y-1/2 pointer-events-none absolute h-4 w-4 rounded-full border-2 border-white", style: {
|
|
185
|
-
left: "".concat(positionX * 100, "%"),
|
|
186
|
-
top: "".concat(positionY * 100, "%"),
|
|
187
|
-
boxShadow: "0 0 0 1px rgba(0,0,0,0.5)",
|
|
188
|
-
} })));
|
|
189
|
-
});
|
|
190
|
-
exports.ColorPickerSelection.displayName = "ColorPickerSelection";
|
|
191
|
-
var ColorPickerHue = function (_a) {
|
|
192
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
193
|
-
var _b = (0, exports.useColorPicker)(), hue = _b.hue, setHue = _b.setHue;
|
|
194
|
-
return (react_1.default.createElement(radix_ui_1.Slider.Root, __assign({ className: (0, utils_1.cn)("relative flex h-4 w-full touch-none", className), max: 360, onValueChange: function (_a) {
|
|
195
|
-
var hue = _a[0];
|
|
196
|
-
return setHue(hue);
|
|
197
|
-
}, step: 1, value: [hue] }, props),
|
|
198
|
-
react_1.default.createElement(radix_ui_1.Slider.Track, { className: "relative my-0.5 h-3 w-full grow rounded-full bg-[linear-gradient(90deg,#FF0000,#FFFF00,#00FF00,#00FFFF,#0000FF,#FF00FF,#FF0000)]" },
|
|
199
|
-
react_1.default.createElement(radix_ui_1.Slider.Range, { className: "absolute h-full" })),
|
|
200
|
-
react_1.default.createElement(radix_ui_1.Slider.Thumb, { className: "block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50" })));
|
|
201
|
-
};
|
|
202
|
-
exports.ColorPickerHue = ColorPickerHue;
|
|
203
|
-
var ColorPickerAlpha = function (_a) {
|
|
204
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
205
|
-
var _b = (0, exports.useColorPicker)(), alpha = _b.alpha, setAlpha = _b.setAlpha;
|
|
206
|
-
return (react_1.default.createElement(radix_ui_1.Slider.Root, __assign({ className: (0, utils_1.cn)("relative flex h-4 w-full touch-none", className), max: 100, onValueChange: function (_a) {
|
|
207
|
-
var alpha = _a[0];
|
|
208
|
-
return setAlpha(alpha);
|
|
209
|
-
}, step: 1, value: [alpha] }, props),
|
|
210
|
-
react_1.default.createElement(radix_ui_1.Slider.Track, { className: "relative my-0.5 h-3 w-full grow rounded-full", style: {
|
|
211
|
-
background: 'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==") left center',
|
|
212
|
-
} },
|
|
213
|
-
react_1.default.createElement("div", { className: "absolute inset-0 rounded-full bg-gradient-to-r from-transparent to-black/50" }),
|
|
214
|
-
react_1.default.createElement(radix_ui_1.Slider.Range, { className: "absolute h-full rounded-full bg-transparent" })),
|
|
215
|
-
react_1.default.createElement(radix_ui_1.Slider.Thumb, { className: "block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50" })));
|
|
216
|
-
};
|
|
217
|
-
exports.ColorPickerAlpha = ColorPickerAlpha;
|
|
218
|
-
var ColorPickerEyeDropper = function (_a) {
|
|
219
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
220
|
-
var _b = (0, exports.useColorPicker)(), setHue = _b.setHue, setSaturation = _b.setSaturation, setLightness = _b.setLightness, setAlpha = _b.setAlpha;
|
|
221
|
-
var handleEyeDropper = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
222
|
-
var eyeDropper, result, color, _a, h, s, l, error_1;
|
|
223
|
-
return __generator(this, function (_b) {
|
|
224
|
-
switch (_b.label) {
|
|
225
|
-
case 0:
|
|
226
|
-
_b.trys.push([0, 2, , 3]);
|
|
227
|
-
eyeDropper = new EyeDropper();
|
|
228
|
-
return [4 /*yield*/, eyeDropper.open()];
|
|
229
|
-
case 1:
|
|
230
|
-
result = _b.sent();
|
|
231
|
-
color = (0, color_1.default)(result.sRGBHex);
|
|
232
|
-
_a = color.hsl().array(), h = _a[0], s = _a[1], l = _a[2];
|
|
233
|
-
setHue(h);
|
|
234
|
-
setSaturation(s);
|
|
235
|
-
setLightness(l);
|
|
236
|
-
setAlpha(100);
|
|
237
|
-
return [3 /*break*/, 3];
|
|
238
|
-
case 2:
|
|
239
|
-
error_1 = _b.sent();
|
|
240
|
-
console.error("EyeDropper failed:", error_1);
|
|
241
|
-
return [3 /*break*/, 3];
|
|
242
|
-
case 3: return [2 /*return*/];
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
}); };
|
|
246
|
-
return (react_1.default.createElement(button_1.Button, __assign({ className: (0, utils_1.cn)("shrink-0 text-muted-foreground", className), onClick: handleEyeDropper, size: "icon", variant: "outline", type: "button" }, props),
|
|
247
|
-
react_1.default.createElement(lucide_react_1.PipetteIcon, { size: 16 })));
|
|
248
|
-
};
|
|
249
|
-
exports.ColorPickerEyeDropper = ColorPickerEyeDropper;
|
|
250
|
-
var formats = ["hex", "rgb", "css", "hsl"];
|
|
251
|
-
var ColorPickerOutput = function (_a) {
|
|
252
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
253
|
-
var _b = (0, exports.useColorPicker)(), mode = _b.mode, setMode = _b.setMode;
|
|
254
|
-
return (react_1.default.createElement(select_1.Select, { onValueChange: setMode, value: mode },
|
|
255
|
-
react_1.default.createElement(select_1.SelectTrigger, __assign({ className: (0, utils_1.cn)("h-8 w-20 shrink-0 text-xs", className) }, props),
|
|
256
|
-
react_1.default.createElement(select_1.SelectValue, { placeholder: "Mode" })),
|
|
257
|
-
react_1.default.createElement(select_1.SelectContent, null, formats.map(function (format) { return (react_1.default.createElement(select_1.SelectItem, { className: "text-xs", key: format, value: format }, format.toUpperCase())); }))));
|
|
258
|
-
};
|
|
259
|
-
exports.ColorPickerOutput = ColorPickerOutput;
|
|
260
|
-
var PercentageInput = function (_a) {
|
|
261
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
262
|
-
return (react_1.default.createElement("div", { className: "relative" },
|
|
263
|
-
react_1.default.createElement(input_1.Input, __assign({ readOnly: true, type: "text" }, props, { className: (0, utils_1.cn)("h-8 w-[3.25rem] rounded-l-none bg-secondary px-2 text-xs shadow-none", className) })),
|
|
264
|
-
react_1.default.createElement("span", { className: "-translate-y-1/2 absolute top-1/2 right-2 text-muted-foreground text-xs" }, "%")));
|
|
265
|
-
};
|
|
266
|
-
var ColorPickerFormat = function (_a) {
|
|
267
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
268
|
-
var _b = (0, exports.useColorPicker)(), hue = _b.hue, saturation = _b.saturation, lightness = _b.lightness, alpha = _b.alpha, mode = _b.mode;
|
|
269
|
-
var color = color_1.default.hsl(hue, saturation, lightness, alpha / 100);
|
|
270
|
-
if (mode === "hex") {
|
|
271
|
-
var hex = color.hex();
|
|
272
|
-
return (react_1.default.createElement("div", __assign({ className: (0, utils_1.cn)("-space-x-px relative flex w-full items-center rounded-md shadow-sm", className) }, props),
|
|
273
|
-
react_1.default.createElement(input_1.Input, { className: "h-8 rounded-r-none bg-secondary px-2 text-xs shadow-none", readOnly: true, type: "text", value: hex }),
|
|
274
|
-
react_1.default.createElement(PercentageInput, { value: alpha })));
|
|
275
|
-
}
|
|
276
|
-
if (mode === "rgb") {
|
|
277
|
-
var rgb = color
|
|
278
|
-
.rgb()
|
|
279
|
-
.array()
|
|
280
|
-
.map(function (value) { return Math.round(value); });
|
|
281
|
-
return (react_1.default.createElement("div", __assign({ className: (0, utils_1.cn)("-space-x-px flex items-center rounded-md shadow-sm", className) }, props),
|
|
282
|
-
rgb.map(function (value, index) { return (react_1.default.createElement(input_1.Input, { className: (0, utils_1.cn)("h-8 rounded-r-none bg-secondary px-2 text-xs shadow-none", index && "rounded-l-none", className), key: index, readOnly: true, type: "text", value: value })); }),
|
|
283
|
-
react_1.default.createElement(PercentageInput, { value: alpha })));
|
|
284
|
-
}
|
|
285
|
-
if (mode === "css") {
|
|
286
|
-
var rgb = color
|
|
287
|
-
.rgb()
|
|
288
|
-
.array()
|
|
289
|
-
.map(function (value) { return Math.round(value); });
|
|
290
|
-
return (react_1.default.createElement("div", __assign({ className: (0, utils_1.cn)("w-full rounded-md shadow-sm", className) }, props),
|
|
291
|
-
react_1.default.createElement(input_1.Input, __assign({ className: "h-8 w-full bg-secondary px-2 text-xs shadow-none", readOnly: true, type: "text", value: "rgba(".concat(rgb.join(", "), ", ").concat(alpha, "%)") }, props))));
|
|
292
|
-
}
|
|
293
|
-
if (mode === "hsl") {
|
|
294
|
-
var hsl = color
|
|
295
|
-
.hsl()
|
|
296
|
-
.array()
|
|
297
|
-
.map(function (value) { return Math.round(value); });
|
|
298
|
-
return (react_1.default.createElement("div", __assign({ className: (0, utils_1.cn)("-space-x-px flex items-center rounded-md shadow-sm", className) }, props),
|
|
299
|
-
hsl.map(function (value, index) { return (react_1.default.createElement(input_1.Input, { className: (0, utils_1.cn)("h-8 rounded-r-none bg-secondary px-2 text-xs shadow-none", index && "rounded-l-none", className), key: index, readOnly: true, type: "text", value: value })); }),
|
|
300
|
-
react_1.default.createElement(PercentageInput, { value: alpha })));
|
|
301
|
-
}
|
|
302
|
-
return null;
|
|
303
|
-
};
|
|
304
|
-
exports.ColorPickerFormat = ColorPickerFormat;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { HTMLMotionProps } from "motion/react";
|
|
3
|
-
import { type VariantProps } from "class-variance-authority";
|
|
4
|
-
declare const buttonVariants: (props?: ({
|
|
5
|
-
variant?: "secondary" | "default" | "destructive" | "outline" | "ghost" | "muted" | null | undefined;
|
|
6
|
-
size?: "default" | "sm" | "lg" | "md" | null | undefined;
|
|
7
|
-
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
8
|
-
type CopyButtonProps = Omit<HTMLMotionProps<"button">, "children" | "onCopy"> & VariantProps<typeof buttonVariants> & {
|
|
9
|
-
content?: string;
|
|
10
|
-
delay?: number;
|
|
11
|
-
onCopy?: (content: string) => void;
|
|
12
|
-
isCopied?: boolean;
|
|
13
|
-
onCopyChange?: (isCopied: boolean) => void;
|
|
14
|
-
};
|
|
15
|
-
declare function CopyButton({ content, className, size, variant, delay, onClick, onCopy, isCopied, onCopyChange, ...props }: CopyButtonProps): React.JSX.Element;
|
|
16
|
-
export { CopyButton, buttonVariants, type CopyButtonProps };
|