@hua-labs/ui 1.0.0 → 1.1.0-alpha.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +897 -210
- package/dist/ComponentLayout-BxCenSAm.d.mts +73 -0
- package/dist/advanced/dashboard.d.ts +7 -0
- package/dist/advanced/dashboard.d.ts.map +1 -0
- package/dist/advanced/motion.d.ts +2 -0
- package/dist/advanced/motion.d.ts.map +1 -0
- package/dist/advanced-dashboard.d.mts +4 -0
- package/dist/advanced-dashboard.js +2 -0
- package/dist/advanced-dashboard.js.map +1 -0
- package/dist/advanced-dashboard.mjs +2 -0
- package/dist/advanced-dashboard.mjs.map +1 -0
- package/dist/advanced-motion.d.mts +93 -0
- package/dist/advanced-motion.js +2 -0
- package/dist/advanced-motion.js.map +1 -0
- package/dist/advanced-motion.mjs +2 -0
- package/dist/advanced-motion.mjs.map +1 -0
- package/dist/advanced.d.mts +734 -0
- package/dist/advanced.d.ts +17 -0
- package/dist/advanced.d.ts.map +1 -0
- package/dist/advanced.js +2 -0
- package/dist/advanced.js.map +1 -0
- package/dist/advanced.mjs +2 -0
- package/dist/advanced.mjs.map +1 -0
- package/dist/chunk-627HOIRV.mjs +2 -0
- package/dist/chunk-627HOIRV.mjs.map +1 -0
- package/dist/chunk-ACEKLG37.mjs +2 -0
- package/dist/chunk-ACEKLG37.mjs.map +1 -0
- package/dist/chunk-E5PN4LUS.mjs +2 -0
- package/dist/chunk-E5PN4LUS.mjs.map +1 -0
- package/dist/chunk-KHEJZ3U4.mjs +2 -0
- package/dist/chunk-KHEJZ3U4.mjs.map +1 -0
- package/dist/chunk-MXGXBG63.mjs +2 -0
- package/dist/chunk-MXGXBG63.mjs.map +1 -0
- package/dist/chunk-R5KCFRYV.mjs +2 -0
- package/dist/chunk-R5KCFRYV.mjs.map +1 -0
- package/dist/chunk-UGSYQDR4.mjs +2 -0
- package/dist/chunk-UGSYQDR4.mjs.map +1 -0
- package/dist/chunk-UUHAXGMO.mjs +2 -0
- package/dist/chunk-UUHAXGMO.mjs.map +1 -0
- package/dist/chunk-VU264VFN.mjs +2 -0
- package/dist/chunk-VU264VFN.mjs.map +1 -0
- package/dist/chunk-ZFS4B5QT.mjs +2 -0
- package/dist/chunk-ZFS4B5QT.mjs.map +1 -0
- package/dist/components/Accordion.d.ts +109 -1
- package/dist/components/Accordion.d.ts.map +1 -1
- package/dist/components/Action.d.ts +68 -0
- package/dist/components/Action.d.ts.map +1 -0
- package/dist/components/ActionToolbar.d.ts +65 -0
- package/dist/components/ActionToolbar.d.ts.map +1 -0
- package/dist/components/Alert.d.ts +49 -0
- package/dist/components/Alert.d.ts.map +1 -1
- package/dist/components/Autocomplete.d.ts +88 -0
- package/dist/components/Autocomplete.d.ts.map +1 -0
- package/dist/components/Avatar.d.ts +71 -1
- package/dist/components/Avatar.d.ts.map +1 -1
- package/dist/components/Badge.d.ts +32 -2
- package/dist/components/Badge.d.ts.map +1 -1
- package/dist/components/Bookmark.d.ts +49 -0
- package/dist/components/Bookmark.d.ts.map +1 -0
- package/dist/components/BottomSheet.d.ts +91 -1
- package/dist/components/BottomSheet.d.ts.map +1 -1
- package/dist/components/Breadcrumb.d.ts +73 -14
- package/dist/components/Breadcrumb.d.ts.map +1 -1
- package/dist/components/Button.d.ts +82 -7
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/Card.d.ts +122 -5
- package/dist/components/Card.d.ts.map +1 -1
- package/dist/components/ChatMessage.d.ts +67 -1
- package/dist/components/ChatMessage.d.ts.map +1 -1
- package/dist/components/Checkbox.d.ts +48 -2
- package/dist/components/Checkbox.d.ts.map +1 -1
- package/dist/components/Command.d.ts +82 -1
- package/dist/components/Command.d.ts.map +1 -1
- package/dist/components/ComponentLayout.d.ts +72 -0
- package/dist/components/ComponentLayout.d.ts.map +1 -0
- package/dist/components/ConfirmModal.d.ts +66 -1
- package/dist/components/ConfirmModal.d.ts.map +1 -1
- package/dist/components/Container.d.ts +39 -0
- package/dist/components/Container.d.ts.map +1 -1
- package/dist/components/ContextMenu.d.ts +51 -1
- package/dist/components/ContextMenu.d.ts.map +1 -1
- package/dist/components/DatePicker.d.ts +62 -0
- package/dist/components/DatePicker.d.ts.map +1 -0
- package/dist/components/Divider.d.ts +13 -3
- package/dist/components/Divider.d.ts.map +1 -1
- package/dist/components/Drawer.d.ts +103 -1
- package/dist/components/Drawer.d.ts.map +1 -1
- package/dist/components/Dropdown.d.ts +51 -1
- package/dist/components/Dropdown.d.ts.map +1 -1
- package/dist/components/EmotionAnalysis.d.ts +59 -1
- package/dist/components/EmotionAnalysis.d.ts.map +1 -1
- package/dist/components/EmotionButton.d.ts +35 -1
- package/dist/components/EmotionButton.d.ts.map +1 -1
- package/dist/components/EmotionMeter.d.ts +38 -2
- package/dist/components/EmotionMeter.d.ts.map +1 -1
- package/dist/components/EmotionSelector.d.ts +51 -1
- package/dist/components/EmotionSelector.d.ts.map +1 -1
- package/dist/components/FeatureCard.d.ts +61 -0
- package/dist/components/FeatureCard.d.ts.map +1 -0
- package/dist/components/Form.d.ts +114 -0
- package/dist/components/Form.d.ts.map +1 -0
- package/dist/components/Grid.d.ts +42 -1
- package/dist/components/Grid.d.ts.map +1 -1
- package/dist/components/HeroSection.d.ts +77 -0
- package/dist/components/HeroSection.d.ts.map +1 -0
- package/dist/components/Icon/Icon.d.ts +159 -0
- package/dist/components/Icon/Icon.d.ts.map +1 -0
- package/dist/components/Icon/IconProvider.d.ts +94 -0
- package/dist/components/Icon/IconProvider.d.ts.map +1 -0
- package/dist/components/Icon/icon-store.d.ts +21 -0
- package/dist/components/Icon/icon-store.d.ts.map +1 -0
- package/dist/components/Icon/index.d.ts +10 -0
- package/dist/components/Icon/index.d.ts.map +1 -0
- package/dist/components/InfoCard.d.ts +48 -0
- package/dist/components/InfoCard.d.ts.map +1 -0
- package/dist/components/Input.d.ts +40 -8
- package/dist/components/Input.d.ts.map +1 -1
- package/dist/components/Label.d.ts +50 -0
- package/dist/components/Label.d.ts.map +1 -0
- package/dist/components/LanguageToggle.d.ts +41 -1
- package/dist/components/LanguageToggle.d.ts.map +1 -1
- package/dist/components/Link.d.ts +52 -0
- package/dist/components/Link.d.ts.map +1 -0
- package/dist/components/LoadingSpinner.d.ts +44 -5
- package/dist/components/LoadingSpinner.d.ts.map +1 -1
- package/dist/components/Menu.d.ts +92 -1
- package/dist/components/Menu.d.ts.map +1 -1
- package/dist/components/Modal.d.ts +67 -5
- package/dist/components/Modal.d.ts.map +1 -1
- package/dist/components/Navigation.d.ts +72 -0
- package/dist/components/Navigation.d.ts.map +1 -0
- package/dist/components/PageNavigation.d.ts +48 -0
- package/dist/components/PageNavigation.d.ts.map +1 -0
- package/dist/components/PageTransition.d.ts +44 -1
- package/dist/components/PageTransition.d.ts.map +1 -1
- package/dist/components/Pagination.d.ts +52 -1
- package/dist/components/Pagination.d.ts.map +1 -1
- package/dist/components/Panel.d.ts +99 -0
- package/dist/components/Panel.d.ts.map +1 -0
- package/dist/components/Popover.d.ts +46 -1
- package/dist/components/Popover.d.ts.map +1 -1
- package/dist/components/Progress.d.ts +52 -3
- package/dist/components/Progress.d.ts.map +1 -1
- package/dist/components/Radio.d.ts +44 -2
- package/dist/components/Radio.d.ts.map +1 -1
- package/dist/components/ScrollArea.d.ts +53 -1
- package/dist/components/ScrollArea.d.ts.map +1 -1
- package/dist/components/ScrollIndicator.d.ts +43 -1
- package/dist/components/ScrollIndicator.d.ts.map +1 -1
- package/dist/components/ScrollProgress.d.ts +37 -0
- package/dist/components/ScrollProgress.d.ts.map +1 -1
- package/dist/components/ScrollToTop.d.ts +48 -11
- package/dist/components/ScrollToTop.d.ts.map +1 -1
- package/dist/components/SectionHeader.d.ts +42 -0
- package/dist/components/SectionHeader.d.ts.map +1 -0
- package/dist/components/Select.d.ts +59 -2
- package/dist/components/Select.d.ts.map +1 -1
- package/dist/components/Skeleton.d.ts +44 -1
- package/dist/components/Skeleton.d.ts.map +1 -1
- package/dist/components/Slider.d.ts +75 -0
- package/dist/components/Slider.d.ts.map +1 -0
- package/dist/components/Stack.d.ts +42 -1
- package/dist/components/Stack.d.ts.map +1 -1
- package/dist/components/StatsPanel.d.ts +72 -0
- package/dist/components/StatsPanel.d.ts.map +1 -0
- package/dist/components/Switch.d.ts +48 -2
- package/dist/components/Switch.d.ts.map +1 -1
- package/dist/components/Table.d.ts +206 -0
- package/dist/components/Table.d.ts.map +1 -0
- package/dist/components/Tabs.d.ts +123 -10
- package/dist/components/Tabs.d.ts.map +1 -1
- package/dist/components/Textarea.d.ts +48 -2
- package/dist/components/Textarea.d.ts.map +1 -1
- package/dist/components/ThemeProvider.d.ts +67 -2
- package/dist/components/ThemeProvider.d.ts.map +1 -1
- package/dist/components/ThemeToggle.d.ts +44 -0
- package/dist/components/ThemeToggle.d.ts.map +1 -1
- package/dist/components/Toast.d.ts +75 -1
- package/dist/components/Toast.d.ts.map +1 -1
- package/dist/components/Toggle.d.ts +62 -0
- package/dist/components/Toggle.d.ts.map +1 -0
- package/dist/components/Tooltip.d.ts +48 -1
- package/dist/components/Tooltip.d.ts.map +1 -1
- package/dist/components/Upload.d.ts +87 -0
- package/dist/components/Upload.d.ts.map +1 -0
- package/dist/components/advanced/AdvancedPageTransition.d.ts +25 -0
- package/dist/components/advanced/AdvancedPageTransition.d.ts.map +1 -0
- package/dist/components/advanced/index.d.ts +4 -0
- package/dist/components/advanced/index.d.ts.map +1 -0
- package/dist/components/advanced/usePageTransition.d.ts +33 -0
- package/dist/components/advanced/usePageTransition.d.ts.map +1 -0
- package/dist/components/advanced/usePageTransitionManager.d.ts +44 -0
- package/dist/components/advanced/usePageTransitionManager.d.ts.map +1 -0
- package/dist/components/dashboard/ActivityFeed.d.ts +87 -0
- package/dist/components/dashboard/ActivityFeed.d.ts.map +1 -0
- package/dist/components/dashboard/BarChart.d.ts +82 -0
- package/dist/components/dashboard/BarChart.d.ts.map +1 -0
- package/dist/components/dashboard/DashboardGrid.d.ts +44 -0
- package/dist/components/dashboard/DashboardGrid.d.ts.map +1 -0
- package/dist/components/dashboard/DashboardSidebar.d.ts +105 -0
- package/dist/components/dashboard/DashboardSidebar.d.ts.map +1 -0
- package/dist/components/dashboard/DashboardToolbar.d.ts +120 -0
- package/dist/components/dashboard/DashboardToolbar.d.ts.map +1 -0
- package/dist/components/dashboard/EmptyState.d.ts +61 -0
- package/dist/components/dashboard/EmptyState.d.ts.map +1 -0
- package/dist/components/dashboard/MembershipBadge.d.ts +45 -0
- package/dist/components/dashboard/MembershipBadge.d.ts.map +1 -0
- package/dist/components/dashboard/MerchantList.d.ts +98 -0
- package/dist/components/dashboard/MerchantList.d.ts.map +1 -0
- package/dist/components/dashboard/MetricCard.d.ts +75 -0
- package/dist/components/dashboard/MetricCard.d.ts.map +1 -0
- package/dist/components/dashboard/MiniBarChart.d.ts +60 -0
- package/dist/components/dashboard/MiniBarChart.d.ts.map +1 -0
- package/dist/components/dashboard/NotificationCard.d.ts +89 -0
- package/dist/components/dashboard/NotificationCard.d.ts.map +1 -0
- package/dist/components/dashboard/ProfileCard.d.ts +82 -0
- package/dist/components/dashboard/ProfileCard.d.ts.map +1 -0
- package/dist/components/dashboard/ProgressCard.d.ts +71 -0
- package/dist/components/dashboard/ProgressCard.d.ts.map +1 -0
- package/dist/components/dashboard/QuickActionCard.d.ts +63 -0
- package/dist/components/dashboard/QuickActionCard.d.ts.map +1 -0
- package/dist/components/dashboard/RoutingBreakdownCard.d.ts +88 -0
- package/dist/components/dashboard/RoutingBreakdownCard.d.ts.map +1 -0
- package/dist/components/dashboard/SettlementTimeline.d.ts +90 -0
- package/dist/components/dashboard/SettlementTimeline.d.ts.map +1 -0
- package/dist/components/dashboard/StatCard.d.ts +70 -0
- package/dist/components/dashboard/StatCard.d.ts.map +1 -0
- package/dist/components/dashboard/SummaryCard.d.ts +73 -0
- package/dist/components/dashboard/SummaryCard.d.ts.map +1 -0
- package/dist/components/dashboard/TransactionDetailDrawer.d.ts +183 -0
- package/dist/components/dashboard/TransactionDetailDrawer.d.ts.map +1 -0
- package/dist/components/dashboard/TransactionsTable.d.ts +137 -0
- package/dist/components/dashboard/TransactionsTable.d.ts.map +1 -0
- package/dist/components/dashboard/TrendChart.d.ts +75 -0
- package/dist/components/dashboard/TrendChart.d.ts.map +1 -0
- package/dist/components/dashboard/index.d.ts +41 -0
- package/dist/components/dashboard/index.d.ts.map +1 -0
- package/dist/components/scrollbar/scrollbar.d.ts +12 -0
- package/dist/components/scrollbar/scrollbar.d.ts.map +1 -0
- package/dist/dashboard-QMssHf5j.d.mts +1801 -0
- package/dist/feedback.d.mts +103 -0
- package/dist/feedback.d.ts +21 -0
- package/dist/feedback.d.ts.map +1 -0
- package/dist/feedback.js +2 -0
- package/dist/feedback.js.map +1 -0
- package/dist/feedback.mjs +2 -0
- package/dist/feedback.mjs.map +1 -0
- package/dist/form.d.mts +803 -0
- package/dist/form.d.ts +42 -0
- package/dist/form.d.ts.map +1 -0
- package/dist/form.js +2 -0
- package/dist/form.js.map +1 -0
- package/dist/form.mjs +2 -0
- package/dist/form.mjs.map +1 -0
- package/dist/hooks/useScrollToggle.d.ts +12 -0
- package/dist/hooks/useScrollToggle.d.ts.map +1 -0
- package/dist/icons-DoSGIez_.d.mts +135 -0
- package/dist/index.d.mts +3770 -0
- package/dist/index.d.ts +76 -38
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +37 -49
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +37 -0
- package/dist/index.mjs.map +1 -0
- package/dist/lib/icon-aliases.d.ts +24 -0
- package/dist/lib/icon-aliases.d.ts.map +1 -0
- package/dist/lib/icon-names.d.ts +47 -0
- package/dist/lib/icon-names.d.ts.map +1 -0
- package/dist/lib/icon-providers.d.ts +559 -0
- package/dist/lib/icon-providers.d.ts.map +1 -0
- package/dist/lib/icons.d.ts +113 -24
- package/dist/lib/icons.d.ts.map +1 -1
- package/dist/lib/phosphor-icons.d.ts +6 -0
- package/dist/lib/phosphor-icons.d.ts.map +1 -0
- package/dist/lib/styles/colors.d.ts +131 -0
- package/dist/lib/styles/colors.d.ts.map +1 -0
- package/dist/lib/styles/index.d.ts +8 -0
- package/dist/lib/styles/index.d.ts.map +1 -0
- package/dist/lib/styles/utils.d.ts +87 -0
- package/dist/lib/styles/utils.d.ts.map +1 -0
- package/dist/lib/styles/variants.d.ts +79 -0
- package/dist/lib/styles/variants.d.ts.map +1 -0
- package/dist/lib/types/common.d.ts +80 -0
- package/dist/lib/types/common.d.ts.map +1 -0
- package/dist/lib/types/index.d.ts +6 -0
- package/dist/lib/types/index.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +73 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/navigation.d.mts +105 -0
- package/dist/navigation.d.ts +22 -0
- package/dist/navigation.d.ts.map +1 -0
- package/dist/navigation.js +2 -0
- package/dist/navigation.js.map +1 -0
- package/dist/navigation.mjs +2 -0
- package/dist/navigation.mjs.map +1 -0
- package/package.json +92 -25
- package/src/styles/toast.css +23 -0
- package/dist/components/Accordion.js +0 -84
- package/dist/components/Alert.js +0 -61
- package/dist/components/Avatar.js +0 -18
- package/dist/components/Badge.js +0 -15
- package/dist/components/BottomSheet.js +0 -96
- package/dist/components/Breadcrumb.js +0 -47
- package/dist/components/Button.js +0 -23
- package/dist/components/Card.js +0 -18
- package/dist/components/ChatMessage.js +0 -59
- package/dist/components/Checkbox.js +0 -30
- package/dist/components/Command.js +0 -119
- package/dist/components/ConfirmModal.js +0 -53
- package/dist/components/Container.js +0 -23
- package/dist/components/ContextMenu.js +0 -110
- package/dist/components/Divider.js +0 -39
- package/dist/components/Drawer.js +0 -79
- package/dist/components/Dropdown.js +0 -174
- package/dist/components/EmotionAnalysis.js +0 -40
- package/dist/components/EmotionButton.js +0 -16
- package/dist/components/EmotionMeter.js +0 -21
- package/dist/components/EmotionSelector.js +0 -46
- package/dist/components/Grid.js +0 -44
- package/dist/components/Icon.d.ts +0 -26
- package/dist/components/Icon.d.ts.map +0 -1
- package/dist/components/Icon.js +0 -48
- package/dist/components/Input.js +0 -25
- package/dist/components/LanguageToggle.js +0 -61
- package/dist/components/LoadingSpinner.js +0 -37
- package/dist/components/Menu.js +0 -122
- package/dist/components/Modal.js +0 -62
- package/dist/components/PageTransition.js +0 -39
- package/dist/components/Pagination.js +0 -87
- package/dist/components/Popover.js +0 -159
- package/dist/components/Progress.js +0 -51
- package/dist/components/Radio.js +0 -29
- package/dist/components/ScrollArea.js +0 -42
- package/dist/components/ScrollIndicator.js +0 -60
- package/dist/components/ScrollProgress.js +0 -39
- package/dist/components/ScrollToTop.js +0 -46
- package/dist/components/Select.js +0 -29
- package/dist/components/Skeleton.js +0 -71
- package/dist/components/Stack.js +0 -34
- package/dist/components/Switch.js +0 -29
- package/dist/components/Tabs.js +0 -117
- package/dist/components/Textarea.js +0 -31
- package/dist/components/ThemeProvider.js +0 -76
- package/dist/components/ThemeToggle.js +0 -49
- package/dist/components/Toast.js +0 -138
- package/dist/components/Tooltip.js +0 -102
- package/dist/lib/icons.js +0 -321
- package/dist/lib/utils.js +0 -5
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { cn } from "../lib/utils";
|
|
5
|
-
const Skeleton = React.forwardRef(({ className, variant = "text", width, height, animation = "pulse", ...props }, ref) => {
|
|
6
|
-
const getVariantClasses = () => {
|
|
7
|
-
switch (variant) {
|
|
8
|
-
case "circular":
|
|
9
|
-
return "rounded-full";
|
|
10
|
-
case "rounded":
|
|
11
|
-
return "rounded-lg";
|
|
12
|
-
case "rectangular":
|
|
13
|
-
return "rounded-none";
|
|
14
|
-
case "text":
|
|
15
|
-
default:
|
|
16
|
-
return "rounded";
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
const getAnimationClasses = () => {
|
|
20
|
-
switch (animation) {
|
|
21
|
-
case "wave":
|
|
22
|
-
return "animate-pulse bg-gradient-to-r from-gray-200 via-gray-300 to-gray-200 bg-[length:200%_100%] animate-shimmer";
|
|
23
|
-
case "shimmer":
|
|
24
|
-
return "bg-gradient-to-r from-gray-200 via-gray-300 to-gray-200 bg-[length:200%_100%] animate-shimmer";
|
|
25
|
-
case "pulse":
|
|
26
|
-
default:
|
|
27
|
-
return "animate-pulse bg-gray-200 dark:bg-gray-700";
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
const getDefaultDimensions = () => {
|
|
31
|
-
switch (variant) {
|
|
32
|
-
case "circular":
|
|
33
|
-
return { width: "40px", height: "40px" };
|
|
34
|
-
case "text":
|
|
35
|
-
return { width: "100%", height: "1em" };
|
|
36
|
-
case "rounded":
|
|
37
|
-
return { width: "100%", height: "200px" };
|
|
38
|
-
case "rectangular":
|
|
39
|
-
return { width: "100%", height: "200px" };
|
|
40
|
-
default:
|
|
41
|
-
return { width: "100%", height: "1em" };
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
const defaultDims = getDefaultDimensions();
|
|
45
|
-
const finalWidth = width || defaultDims.width;
|
|
46
|
-
const finalHeight = height || defaultDims.height;
|
|
47
|
-
return (_jsx("div", { ref: ref, className: cn("block", getVariantClasses(), getAnimationClasses(), className), style: {
|
|
48
|
-
width: typeof finalWidth === "number" ? `${finalWidth}px` : finalWidth,
|
|
49
|
-
height: typeof finalHeight === "number" ? `${finalHeight}px` : finalHeight,
|
|
50
|
-
}, ...props }));
|
|
51
|
-
});
|
|
52
|
-
Skeleton.displayName = "Skeleton";
|
|
53
|
-
// 편의 컴포넌트들
|
|
54
|
-
export const SkeletonText = React.forwardRef(({ className, ...props }, ref) => (_jsx(Skeleton, { ref: ref, variant: "text", className: className, ...props })));
|
|
55
|
-
SkeletonText.displayName = "SkeletonText";
|
|
56
|
-
export const SkeletonCircle = React.forwardRef(({ className, ...props }, ref) => (_jsx(Skeleton, { ref: ref, variant: "circular", className: className, ...props })));
|
|
57
|
-
SkeletonCircle.displayName = "SkeletonCircle";
|
|
58
|
-
export const SkeletonRectangle = React.forwardRef(({ className, ...props }, ref) => (_jsx(Skeleton, { ref: ref, variant: "rectangular", className: className, ...props })));
|
|
59
|
-
SkeletonRectangle.displayName = "SkeletonRectangle";
|
|
60
|
-
export const SkeletonRounded = React.forwardRef(({ className, ...props }, ref) => (_jsx(Skeleton, { ref: ref, variant: "rounded", className: className, ...props })));
|
|
61
|
-
SkeletonRounded.displayName = "SkeletonRounded";
|
|
62
|
-
// 복합 스켈레톤 컴포넌트들
|
|
63
|
-
export const SkeletonCard = React.forwardRef(({ className, ...props }, ref) => (_jsxs("div", { ref: ref, className: cn("space-y-4 p-6", className), ...props, children: [_jsxs("div", { className: "flex items-center space-x-4", children: [" ", _jsx(SkeletonCircle, { className: "w-12 h-12" }), " ", _jsxs("div", { className: "space-y-2 flex-1", children: [" ", _jsx(SkeletonText, { className: "h-4 w-3/4" }), " ", _jsx(SkeletonText, { className: "h-3 w-1/2" }), " "] })] }), _jsx(SkeletonRounded, { className: "w-full h-32" }), " ", _jsxs("div", { className: "space-y-2", children: [" ", _jsx(SkeletonText, { className: "h-4 w-full" }), _jsx(SkeletonText, { className: "h-4 w-5/6" }), _jsx(SkeletonText, { className: "h-4 w-4/6" })] })] })));
|
|
64
|
-
SkeletonCard.displayName = "SkeletonCard";
|
|
65
|
-
export const SkeletonAvatar = React.forwardRef(({ className, ...props }, ref) => (_jsxs("div", { ref: ref, className: cn("flex items-center space-x-4", className), ...props, children: [_jsx(SkeletonCircle, { className: "w-12 h-12" }), " ", _jsxs("div", { className: "space-y-2 flex-1", children: [" ", _jsx(SkeletonText, { className: "h-4 w-3/4" }), _jsx(SkeletonText, { className: "h-3 w-1/2" })] })] })));
|
|
66
|
-
SkeletonAvatar.displayName = "SkeletonAvatar";
|
|
67
|
-
export const SkeletonList = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("space-y-4", className), ...props, children: Array.from({ length: 3 }).map((_, index) => (_jsxs("div", { className: "flex items-center space-x-4", children: [" ", _jsx(SkeletonCircle, { className: "w-10 h-10" }), " ", _jsxs("div", { className: "space-y-2 flex-1", children: [" ", _jsx(SkeletonText, { className: "h-4 w-3/4" }), _jsx(SkeletonText, { className: "h-3 w-1/2" })] })] }, index))) })));
|
|
68
|
-
SkeletonList.displayName = "SkeletonList";
|
|
69
|
-
export const SkeletonTable = React.forwardRef(({ className, ...props }, ref) => (_jsxs("div", { ref: ref, className: cn("space-y-4", className), ...props, children: [_jsxs("div", { className: "flex space-x-4", children: [" ", _jsx(SkeletonText, { className: "h-4 w-1/4" }), _jsx(SkeletonText, { className: "h-4 w-1/4" }), _jsx(SkeletonText, { className: "h-4 w-1/4" }), _jsx(SkeletonText, { className: "h-4 w-1/4" })] }), Array.from({ length: 5 }).map((_, index) => (_jsxs("div", { className: "flex space-x-4", children: [" ", _jsx(SkeletonText, { className: "h-4 w-1/4" }), _jsx(SkeletonText, { className: "h-4 w-1/4" }), _jsx(SkeletonText, { className: "h-4 w-1/4" }), _jsx(SkeletonText, { className: "h-4 w-1/4" })] }, index)))] })));
|
|
70
|
-
SkeletonTable.displayName = "SkeletonTable";
|
|
71
|
-
export { Skeleton };
|
package/dist/components/Stack.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { cn } from "../lib/utils";
|
|
5
|
-
const Stack = React.forwardRef(({ className, direction = "vertical", spacing = "md", align = "start", justify = "start", wrap = false, ...props }, ref) => {
|
|
6
|
-
const directionClasses = {
|
|
7
|
-
vertical: "flex flex-col",
|
|
8
|
-
horizontal: "flex flex-row"
|
|
9
|
-
};
|
|
10
|
-
const spacingClasses = {
|
|
11
|
-
none: "",
|
|
12
|
-
sm: direction === "vertical" ? "space-y-4" : "space-x-4", // 16px
|
|
13
|
-
md: direction === "vertical" ? "space-y-6" : "space-x-6", // 24px
|
|
14
|
-
lg: direction === "vertical" ? "space-y-8" : "space-x-8", // 32px
|
|
15
|
-
xl: direction === "vertical" ? "space-y-12" : "space-x-12" // 48px
|
|
16
|
-
};
|
|
17
|
-
const alignClasses = {
|
|
18
|
-
start: "items-start",
|
|
19
|
-
center: "items-center",
|
|
20
|
-
end: "items-end",
|
|
21
|
-
stretch: "items-stretch"
|
|
22
|
-
};
|
|
23
|
-
const justifyClasses = {
|
|
24
|
-
start: "justify-start",
|
|
25
|
-
center: "justify-center",
|
|
26
|
-
end: "justify-end",
|
|
27
|
-
between: "justify-between",
|
|
28
|
-
around: "justify-around",
|
|
29
|
-
evenly: "justify-evenly"
|
|
30
|
-
};
|
|
31
|
-
return (_jsx("div", { ref: ref, className: cn(directionClasses[direction], spacingClasses[spacing], alignClasses[align], justifyClasses[justify], wrap && "flex-wrap", className), ...props }));
|
|
32
|
-
});
|
|
33
|
-
Stack.displayName = "Stack";
|
|
34
|
-
export { Stack };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { cn } from "../lib/utils";
|
|
5
|
-
const Switch = React.forwardRef(({ className, variant = "default", size = "md", error = false, success = false, label, description, ...props }, ref) => {
|
|
6
|
-
const sizeClasses = {
|
|
7
|
-
sm: "w-8 h-4",
|
|
8
|
-
md: "w-11 h-6",
|
|
9
|
-
lg: "w-14 h-7"
|
|
10
|
-
};
|
|
11
|
-
const thumbSizes = {
|
|
12
|
-
sm: "w-3 h-3",
|
|
13
|
-
md: "w-5 h-5",
|
|
14
|
-
lg: "w-6 h-6"
|
|
15
|
-
};
|
|
16
|
-
const variantClasses = {
|
|
17
|
-
default: "bg-gray-200 peer-checked:bg-blue-600 dark:bg-gray-700 dark:peer-checked:bg-blue-500",
|
|
18
|
-
outline: "bg-transparent border-2 border-gray-300 peer-checked:border-blue-600 peer-checked:bg-blue-600 dark:border-gray-600 dark:peer-checked:border-blue-500 dark:peer-checked:bg-blue-500",
|
|
19
|
-
filled: "bg-gray-100 peer-checked:bg-blue-600 dark:bg-gray-800 dark:peer-checked:bg-blue-500"
|
|
20
|
-
};
|
|
21
|
-
const stateClasses = error
|
|
22
|
-
? "bg-red-200 peer-checked:bg-red-600 dark:bg-red-800 dark:peer-checked:bg-red-500"
|
|
23
|
-
: success
|
|
24
|
-
? "bg-green-200 peer-checked:bg-green-600 dark:bg-green-800 dark:peer-checked:bg-green-500"
|
|
25
|
-
: "";
|
|
26
|
-
return (_jsxs("div", { className: "flex items-start space-x-3", children: [_jsxs("div", { className: "relative", children: [_jsx("input", { type: "checkbox", className: cn("peer sr-only", className), ref: ref, ...props }), _jsx("div", { className: cn("relative inline-flex cursor-pointer items-center rounded-full transition-colors duration-200 ease-in-out", "peer-focus:outline-none peer-focus:ring-2 peer-focus:ring-blue-500 peer-focus:ring-offset-2", "peer-disabled:cursor-not-allowed peer-disabled:opacity-50", sizeClasses[size], variantClasses[variant], stateClasses), children: _jsx("div", { className: cn("pointer-events-none block rounded-full bg-white shadow-lg ring-0 transition-transform duration-200 ease-in-out", "peer-checked:translate-x-full", thumbSizes[size], size === "sm" ? "translate-x-0.5 peer-checked:translate-x-4.5" : "", size === "md" ? "translate-x-0.5 peer-checked:translate-x-5.5" : "", size === "lg" ? "translate-x-0.5 peer-checked:translate-x-7" : "") }) })] }), (label || description) && (_jsxs("div", { className: "flex flex-col", children: [label && (_jsx("label", { className: "text-sm font-medium text-gray-900 dark:text-white cursor-pointer", children: label })), description && (_jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: description }))] }))] }));
|
|
27
|
-
});
|
|
28
|
-
Switch.displayName = "Switch";
|
|
29
|
-
export { Switch };
|
package/dist/components/Tabs.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { cn } from "../lib/utils";
|
|
5
|
-
const Tabs = React.forwardRef(({ className, value, defaultValue, onValueChange, orientation = "horizontal", variant = "default", size = "md", children, ...props }, ref) => {
|
|
6
|
-
const [activeTab, setActiveTab] = React.useState(value || defaultValue || "");
|
|
7
|
-
const isControlled = value !== undefined;
|
|
8
|
-
const currentValue = isControlled ? value : activeTab;
|
|
9
|
-
const handleTabChange = (newValue) => {
|
|
10
|
-
if (!isControlled) {
|
|
11
|
-
setActiveTab(newValue);
|
|
12
|
-
}
|
|
13
|
-
onValueChange?.(newValue);
|
|
14
|
-
};
|
|
15
|
-
React.useEffect(() => {
|
|
16
|
-
if (value !== undefined) {
|
|
17
|
-
setActiveTab(value);
|
|
18
|
-
}
|
|
19
|
-
}, [value]);
|
|
20
|
-
return (_jsx("div", { ref: ref, className: cn("w-full", orientation === "vertical" && "flex", className), ...props, children: React.Children.map(children, (child) => {
|
|
21
|
-
if (React.isValidElement(child)) {
|
|
22
|
-
return React.cloneElement(child, {
|
|
23
|
-
value: currentValue,
|
|
24
|
-
onValueChange: handleTabChange,
|
|
25
|
-
orientation,
|
|
26
|
-
variant,
|
|
27
|
-
size
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
return child;
|
|
31
|
-
}) }));
|
|
32
|
-
});
|
|
33
|
-
Tabs.displayName = "Tabs";
|
|
34
|
-
const TabsList = React.forwardRef(({ className, orientation = "horizontal", variant = "default", size = "md", children, ...props }, ref) => {
|
|
35
|
-
const getVariantClasses = () => {
|
|
36
|
-
switch (variant) {
|
|
37
|
-
case "pills":
|
|
38
|
-
return "bg-gray-100 dark:bg-gray-800 p-1 rounded-lg"; // 4px 패딩
|
|
39
|
-
case "underline":
|
|
40
|
-
return "border-b border-gray-200 dark:border-gray-700";
|
|
41
|
-
case "cards":
|
|
42
|
-
return "bg-gray-50 dark:bg-gray-900 p-1 rounded-lg"; // 4px 패딩
|
|
43
|
-
default:
|
|
44
|
-
return "bg-gray-100 dark:bg-gray-800 p-1 rounded-lg"; // 4px 패딩
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
const getSizeClasses = () => {
|
|
48
|
-
switch (size) {
|
|
49
|
-
case "sm":
|
|
50
|
-
return "h-8"; // 32px 높이
|
|
51
|
-
case "lg":
|
|
52
|
-
return "h-12"; // 48px 높이
|
|
53
|
-
default:
|
|
54
|
-
return "h-10"; // 40px 높이
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
return (_jsx("div", { ref: ref, className: cn("inline-flex items-center justify-center", orientation === "vertical" && "flex-col", getVariantClasses(), getSizeClasses(), className), ...props, children: React.Children.map(children, (child) => {
|
|
58
|
-
if (React.isValidElement(child)) {
|
|
59
|
-
return React.cloneElement(child, {
|
|
60
|
-
orientation,
|
|
61
|
-
variant,
|
|
62
|
-
size
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
return child;
|
|
66
|
-
}) }));
|
|
67
|
-
});
|
|
68
|
-
TabsList.displayName = "TabsList";
|
|
69
|
-
const TabsTrigger = React.forwardRef(({ className, value, orientation = "horizontal", variant = "default", size = "md", active = false, children, ...props }, ref) => {
|
|
70
|
-
const getVariantClasses = () => {
|
|
71
|
-
switch (variant) {
|
|
72
|
-
case "pills":
|
|
73
|
-
return cn("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", active
|
|
74
|
-
? "bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 shadow-sm"
|
|
75
|
-
: "text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100");
|
|
76
|
-
case "underline":
|
|
77
|
-
return cn("inline-flex items-center justify-center whitespace-nowrap border-b-2 px-3 py-2 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", active
|
|
78
|
-
? "border-blue-500 text-blue-600 dark:text-blue-400"
|
|
79
|
-
: "border-transparent text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 hover:border-gray-300 dark:hover:border-gray-600");
|
|
80
|
-
case "cards":
|
|
81
|
-
return cn("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", active
|
|
82
|
-
? "bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 shadow-sm border border-gray-200 dark:border-gray-700"
|
|
83
|
-
: "text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100");
|
|
84
|
-
default:
|
|
85
|
-
return cn("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", active
|
|
86
|
-
? "bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 shadow-sm"
|
|
87
|
-
: "text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100");
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
const getSizeClasses = () => {
|
|
91
|
-
switch (size) {
|
|
92
|
-
case "sm":
|
|
93
|
-
return "h-6 px-2 py-1 text-xs"; // 24px 높이, 8px 패딩
|
|
94
|
-
case "lg":
|
|
95
|
-
return "h-10 px-4 py-2 text-base"; // 40px 높이, 16px 패딩
|
|
96
|
-
default:
|
|
97
|
-
return "h-8 px-3 py-1.5 text-sm"; // 32px 높이, 12px 패딩
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
return (_jsx("button", { ref: ref, className: cn(getVariantClasses(), getSizeClasses(), className), ...props, children: children }));
|
|
101
|
-
});
|
|
102
|
-
TabsTrigger.displayName = "TabsTrigger";
|
|
103
|
-
const TabsContent = React.forwardRef(({ className, value, active = false, children, ...props }, ref) => {
|
|
104
|
-
if (!active)
|
|
105
|
-
return null;
|
|
106
|
-
return (_jsx("div", { ref: ref, className: cn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2", // 8px 여백
|
|
107
|
-
className), ...props, children: children }));
|
|
108
|
-
});
|
|
109
|
-
TabsContent.displayName = "TabsContent";
|
|
110
|
-
// 편의 컴포넌트들
|
|
111
|
-
export const TabsPills = React.forwardRef(({ className, ...props }, ref) => (_jsx(Tabs, { ref: ref, variant: "pills", className: className, ...props })));
|
|
112
|
-
TabsPills.displayName = "TabsPills";
|
|
113
|
-
export const TabsUnderline = React.forwardRef(({ className, ...props }, ref) => (_jsx(Tabs, { ref: ref, variant: "underline", className: className, ...props })));
|
|
114
|
-
TabsUnderline.displayName = "TabsUnderline";
|
|
115
|
-
export const TabsCards = React.forwardRef(({ className, ...props }, ref) => (_jsx(Tabs, { ref: ref, variant: "cards", className: className, ...props })));
|
|
116
|
-
TabsCards.displayName = "TabsCards";
|
|
117
|
-
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { cn } from "../lib/utils";
|
|
5
|
-
const Textarea = React.forwardRef(({ className, variant = "default", size = "md", error = false, success = false, resize = "vertical", ...props }, ref) => {
|
|
6
|
-
const variantClasses = {
|
|
7
|
-
default: "border-gray-300 bg-white text-gray-900 placeholder-gray-500 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-800 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-400 dark:focus:ring-blue-400",
|
|
8
|
-
outline: "border-2 border-gray-200 bg-transparent text-gray-900 placeholder-gray-500 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-400 dark:focus:ring-blue-400",
|
|
9
|
-
filled: "border-transparent bg-gray-50 text-gray-900 placeholder-gray-500 focus:bg-white focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:bg-gray-800 dark:focus:border-blue-400 dark:focus:ring-blue-400",
|
|
10
|
-
ghost: "border-transparent bg-transparent text-gray-900 placeholder-gray-500 focus:bg-gray-50 focus:border-gray-300 focus:ring-gray-500 dark:text-white dark:placeholder-gray-400 dark:focus:bg-gray-800 dark:focus:border-gray-600 dark:focus:ring-gray-400"
|
|
11
|
-
};
|
|
12
|
-
const sizeClasses = {
|
|
13
|
-
sm: "px-3 py-2 text-sm min-h-[80px]",
|
|
14
|
-
md: "px-4 py-3 text-base min-h-[100px]",
|
|
15
|
-
lg: "px-4 py-3 text-lg min-h-[120px]"
|
|
16
|
-
};
|
|
17
|
-
const resizeClasses = {
|
|
18
|
-
none: "resize-none",
|
|
19
|
-
vertical: "resize-y",
|
|
20
|
-
horizontal: "resize-x",
|
|
21
|
-
both: "resize"
|
|
22
|
-
};
|
|
23
|
-
const stateClasses = error
|
|
24
|
-
? "border-red-500 focus:border-red-500 focus:ring-red-500 dark:border-red-400 dark:focus:border-red-400 dark:focus:ring-red-400"
|
|
25
|
-
: success
|
|
26
|
-
? "border-green-500 focus:border-green-500 focus:ring-green-500 dark:border-green-400 dark:focus:border-green-400 dark:focus:ring-green-400"
|
|
27
|
-
: "";
|
|
28
|
-
return (_jsx("textarea", { className: cn("flex w-full rounded-md border transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", variantClasses[variant], sizeClasses[size], resizeClasses[resize], stateClasses, className), ref: ref, ...props }));
|
|
29
|
-
});
|
|
30
|
-
Textarea.displayName = "Textarea";
|
|
31
|
-
export { Textarea };
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { createContext, useContext, useEffect, useState } from "react";
|
|
4
|
-
const initialState = {
|
|
5
|
-
theme: "system",
|
|
6
|
-
setTheme: () => null,
|
|
7
|
-
resolvedTheme: "light",
|
|
8
|
-
toggleTheme: () => null,
|
|
9
|
-
};
|
|
10
|
-
const ThemeProviderContext = createContext(initialState);
|
|
11
|
-
export function ThemeProvider({ children, defaultTheme = "system", storageKey = "hua-ui-theme", enableSystem = true, enableTransition = true, ...props }) {
|
|
12
|
-
const [theme, setTheme] = useState(defaultTheme);
|
|
13
|
-
const [resolvedTheme, setResolvedTheme] = useState("light");
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
// localStorage에서 테마 가져오기 (클라이언트에서만)
|
|
16
|
-
if (typeof window !== 'undefined') {
|
|
17
|
-
const savedTheme = localStorage.getItem(storageKey);
|
|
18
|
-
if (savedTheme) {
|
|
19
|
-
setTheme(savedTheme);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}, [storageKey]);
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
const root = window.document.documentElement;
|
|
25
|
-
root.classList.remove("light", "dark");
|
|
26
|
-
if (theme === "system" && enableSystem) {
|
|
27
|
-
const systemTheme = window.matchMedia("(prefers-color-scheme: dark)")
|
|
28
|
-
.matches
|
|
29
|
-
? "dark"
|
|
30
|
-
: "light";
|
|
31
|
-
root.classList.add(systemTheme);
|
|
32
|
-
setResolvedTheme(systemTheme);
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
root.classList.add(theme);
|
|
36
|
-
setResolvedTheme(theme);
|
|
37
|
-
}
|
|
38
|
-
if (enableTransition) {
|
|
39
|
-
root.classList.add("transition-colors", "duration-300");
|
|
40
|
-
}
|
|
41
|
-
}, [theme, enableSystem, enableTransition]);
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
if (theme === "system" && enableSystem) {
|
|
44
|
-
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
45
|
-
const handleChange = () => {
|
|
46
|
-
const systemTheme = mediaQuery.matches ? "dark" : "light";
|
|
47
|
-
setResolvedTheme(systemTheme);
|
|
48
|
-
document.documentElement.classList.remove("light", "dark");
|
|
49
|
-
document.documentElement.classList.add(systemTheme);
|
|
50
|
-
};
|
|
51
|
-
mediaQuery.addEventListener("change", handleChange);
|
|
52
|
-
return () => mediaQuery.removeEventListener("change", handleChange);
|
|
53
|
-
}
|
|
54
|
-
}, [theme, enableSystem]);
|
|
55
|
-
const value = {
|
|
56
|
-
theme,
|
|
57
|
-
setTheme: (theme) => {
|
|
58
|
-
if (typeof window !== 'undefined') {
|
|
59
|
-
localStorage.setItem(storageKey, theme);
|
|
60
|
-
}
|
|
61
|
-
setTheme(theme);
|
|
62
|
-
},
|
|
63
|
-
resolvedTheme,
|
|
64
|
-
toggleTheme: () => {
|
|
65
|
-
const newTheme = theme === "light" ? "dark" : "light";
|
|
66
|
-
setTheme(newTheme);
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
return (_jsx(ThemeProviderContext.Provider, { ...props, value: value, children: children }));
|
|
70
|
-
}
|
|
71
|
-
export const useTheme = () => {
|
|
72
|
-
const context = useContext(ThemeProviderContext);
|
|
73
|
-
if (context === undefined)
|
|
74
|
-
throw new Error("useTheme must be used within a ThemeProvider");
|
|
75
|
-
return context;
|
|
76
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from "../lib/utils";
|
|
4
|
-
import { Icon } from "./Icon";
|
|
5
|
-
import { useTheme } from "./ThemeProvider";
|
|
6
|
-
export function ThemeToggle({ className, size = "md", variant = "button", showLabel = false, label = {
|
|
7
|
-
light: "라이트",
|
|
8
|
-
dark: "다크",
|
|
9
|
-
system: "시스템"
|
|
10
|
-
}, ...props }) {
|
|
11
|
-
const { theme, setTheme, resolvedTheme } = useTheme();
|
|
12
|
-
const sizeClasses = {
|
|
13
|
-
sm: "h-10 w-10", // 40px - 더 넉넉한 크기
|
|
14
|
-
md: "h-12 w-12", // 48px - 더 넉넉한 크기
|
|
15
|
-
lg: "h-14 w-14" // 56px - 더 넉넉한 크기
|
|
16
|
-
};
|
|
17
|
-
const iconSizes = {
|
|
18
|
-
sm: 16,
|
|
19
|
-
md: 20,
|
|
20
|
-
lg: 24
|
|
21
|
-
};
|
|
22
|
-
const renderIcon = () => {
|
|
23
|
-
if (theme === "system") {
|
|
24
|
-
return _jsx(Icon, { name: "monitor", size: iconSizes[size] });
|
|
25
|
-
}
|
|
26
|
-
return resolvedTheme === "dark" ? (_jsx(Icon, { name: "moon", size: iconSizes[size] })) : (_jsx(Icon, { name: "sun", size: iconSizes[size] }));
|
|
27
|
-
};
|
|
28
|
-
const handleClick = () => {
|
|
29
|
-
if (theme === "system") {
|
|
30
|
-
setTheme("light");
|
|
31
|
-
}
|
|
32
|
-
else if (theme === "light") {
|
|
33
|
-
setTheme("dark");
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
setTheme("system");
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
if (variant === "icon") {
|
|
40
|
-
return (_jsx("button", { onClick: handleClick, className: cn("inline-flex items-center justify-center rounded-lg transition-all duration-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/50 focus-visible:ring-offset-2", sizeClasses[size], className), ...props, children: _jsxs("div", { className: "relative", children: [_jsx("div", { className: cn("absolute inset-0 transition-all duration-300", resolvedTheme === "dark" ? "rotate-0 opacity-100" : "rotate-90 opacity-0"), children: _jsx(Icon, { name: "moon", size: iconSizes[size], className: "text-blue-500" }) }), _jsx("div", { className: cn("transition-all duration-300", resolvedTheme === "dark" ? "rotate-90 opacity-0" : "rotate-0 opacity-100"), children: _jsx(Icon, { name: "sun", size: iconSizes[size], className: "text-yellow-500" }) })] }) }));
|
|
41
|
-
}
|
|
42
|
-
if (variant === "switch") {
|
|
43
|
-
return (_jsxs("button", { onClick: handleClick, className: cn("relative inline-flex h-6 w-11 items-center rounded-full transition-colors duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/50 focus-visible:ring-offset-2", resolvedTheme === "dark"
|
|
44
|
-
? "bg-blue-600"
|
|
45
|
-
: "bg-gray-200 dark:bg-gray-700", className), ...props, children: [_jsx("span", { className: cn("inline-block h-4 w-4 transform rounded-full bg-white transition-transform duration-300 shadow-lg", resolvedTheme === "dark" ? "translate-x-6" : "translate-x-1") }), _jsxs("div", { className: "absolute inset-0 flex items-center justify-between px-1.5", children: [_jsx(Icon, { name: "sun", size: 12, className: "text-yellow-500 opacity-0" }), _jsx(Icon, { name: "moon", size: 12, className: "text-blue-500 opacity-0" })] })] }));
|
|
46
|
-
}
|
|
47
|
-
return (_jsxs("button", { onClick: handleClick, className: cn("inline-flex items-center gap-3 rounded-lg px-4 py-3 text-sm font-medium transition-all duration-300 hover:bg-gray-100 dark:hover:bg-gray-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/50 focus-visible:ring-offset-2", // 12px 간격, 16px, 12px 패딩
|
|
48
|
-
className), ...props, children: [renderIcon(), showLabel && (_jsx("span", { children: theme === "system" ? label.system : theme === "dark" ? label.dark : label.light }))] }));
|
|
49
|
-
}
|
package/dist/components/Toast.js
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { createContext, useContext, useState, useCallback } from "react";
|
|
5
|
-
import { cn } from "../lib/utils";
|
|
6
|
-
// Toast Context 생성
|
|
7
|
-
const ToastContext = createContext(undefined);
|
|
8
|
-
// Toast Hook
|
|
9
|
-
export function useToast() {
|
|
10
|
-
const context = useContext(ToastContext);
|
|
11
|
-
if (!context) {
|
|
12
|
-
throw new Error("useToast must be used within a ToastProvider");
|
|
13
|
-
}
|
|
14
|
-
return context;
|
|
15
|
-
}
|
|
16
|
-
// Toast Provider
|
|
17
|
-
export function ToastProvider({ children, maxToasts = 5, position = "top-right" }) {
|
|
18
|
-
const [toasts, setToasts] = useState([]);
|
|
19
|
-
const removeToast = useCallback((id) => {
|
|
20
|
-
setToasts(prev => prev.filter(toast => toast.id !== id));
|
|
21
|
-
}, []);
|
|
22
|
-
const addToast = useCallback((toast) => {
|
|
23
|
-
const id = Math.random().toString(36).substr(2, 9);
|
|
24
|
-
const newToast = { ...toast, id };
|
|
25
|
-
setToasts(prev => {
|
|
26
|
-
const updatedToasts = [...prev, newToast];
|
|
27
|
-
return updatedToasts.slice(-maxToasts); // 최대 개수 제한
|
|
28
|
-
});
|
|
29
|
-
// 자동 제거
|
|
30
|
-
if (toast.duration !== 0) {
|
|
31
|
-
setTimeout(() => {
|
|
32
|
-
removeToast(id);
|
|
33
|
-
}, toast.duration || 5000);
|
|
34
|
-
}
|
|
35
|
-
}, [maxToasts, removeToast]);
|
|
36
|
-
const clearToasts = useCallback(() => {
|
|
37
|
-
setToasts([]);
|
|
38
|
-
}, []);
|
|
39
|
-
return (_jsxs(ToastContext.Provider, { value: { toasts, addToast, removeToast, clearToasts }, children: [children, _jsx(ToastContainer, { toasts: toasts, removeToast: removeToast, position: position })] }));
|
|
40
|
-
}
|
|
41
|
-
// Toast Container
|
|
42
|
-
function ToastContainer({ toasts, removeToast, position }) {
|
|
43
|
-
const positionClasses = {
|
|
44
|
-
"top-right": "top-4 right-4",
|
|
45
|
-
"top-left": "top-4 left-4",
|
|
46
|
-
"bottom-right": "bottom-4 right-4",
|
|
47
|
-
"bottom-left": "bottom-4 left-4",
|
|
48
|
-
"top-center": "top-4 left-1/2 transform -translate-x-1/2",
|
|
49
|
-
"bottom-center": "bottom-4 left-1/2 transform -translate-x-1/2"
|
|
50
|
-
};
|
|
51
|
-
if (toasts.length === 0)
|
|
52
|
-
return null;
|
|
53
|
-
return (_jsx("div", { className: cn("fixed z-50 space-y-3 max-w-sm", // 12px 간격
|
|
54
|
-
positionClasses[position]), children: toasts.map((toast) => (_jsx(ToastItem, { toast: toast, onRemove: removeToast }, toast.id))) }));
|
|
55
|
-
}
|
|
56
|
-
// Toast Item
|
|
57
|
-
function ToastItem({ toast, onRemove }) {
|
|
58
|
-
const [isVisible, setIsVisible] = useState(false);
|
|
59
|
-
React.useEffect(() => {
|
|
60
|
-
setIsVisible(true);
|
|
61
|
-
}, []);
|
|
62
|
-
const handleRemove = () => {
|
|
63
|
-
setIsVisible(false);
|
|
64
|
-
setTimeout(() => onRemove(toast.id), 300);
|
|
65
|
-
};
|
|
66
|
-
const getToastStyles = (type) => {
|
|
67
|
-
switch (type) {
|
|
68
|
-
case "success":
|
|
69
|
-
return "bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800 text-green-800 dark:text-green-200";
|
|
70
|
-
case "error":
|
|
71
|
-
return "bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-800 text-red-800 dark:text-red-200";
|
|
72
|
-
case "warning":
|
|
73
|
-
return "bg-yellow-50 dark:bg-yellow-900/20 border-yellow-200 dark:border-yellow-800 text-yellow-800 dark:text-yellow-200";
|
|
74
|
-
case "info":
|
|
75
|
-
return "bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800 text-blue-800 dark:text-blue-200";
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
const getIconStyles = (type) => {
|
|
79
|
-
switch (type) {
|
|
80
|
-
case "success":
|
|
81
|
-
return "text-green-500 dark:text-green-400";
|
|
82
|
-
case "error":
|
|
83
|
-
return "text-red-500 dark:text-red-400";
|
|
84
|
-
case "warning":
|
|
85
|
-
return "text-yellow-500 dark:text-yellow-400";
|
|
86
|
-
case "info":
|
|
87
|
-
return "text-blue-500 dark:text-blue-400";
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
const getToastIcon = (type) => {
|
|
91
|
-
switch (type) {
|
|
92
|
-
case "success":
|
|
93
|
-
return (_jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }));
|
|
94
|
-
case "error":
|
|
95
|
-
return (_jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }));
|
|
96
|
-
case "warning":
|
|
97
|
-
return (_jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z" }) }));
|
|
98
|
-
case "info":
|
|
99
|
-
return (_jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }));
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
return (_jsxs("div", { className: cn("flex items-start p-4 rounded-xl border shadow-lg backdrop-blur-sm transition-all duration-300 transform", getToastStyles(toast.type), isVisible
|
|
103
|
-
? "translate-x-0 opacity-100 scale-100"
|
|
104
|
-
: "translate-x-full opacity-0 scale-95"), style: {
|
|
105
|
-
animation: "slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1)"
|
|
106
|
-
}, children: [_jsxs("div", { className: cn("flex-shrink-0 mr-3", getIconStyles(toast.type)), children: [" ", getToastIcon(toast.type)] }), _jsxs("div", { className: "flex-1 min-w-0", children: [toast.title && (_jsxs("h4", { className: "text-sm font-semibold mb-1", children: [" ", toast.title] })), _jsx("p", { className: "text-sm leading-relaxed", children: toast.message }), toast.action && (_jsx("button", { onClick: toast.action.onClick, className: "mt-3 text-sm font-medium underline hover:no-underline transition-all duration-200" // 12px 여백
|
|
107
|
-
, children: toast.action.label }))] }), _jsxs("div", { className: "flex-shrink-0 ml-4", children: [" ", _jsx("button", { onClick: handleRemove, className: cn("inline-flex rounded-md p-1.5 focus:outline-none focus:ring-2 focus:ring-offset-2 transition-all duration-200 hover:bg-black/5 dark:hover:bg-white/5", getIconStyles(toast.type)), "aria-label": "\uB2EB\uAE30", children: _jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })] }), _jsx("style", { dangerouslySetInnerHTML: {
|
|
108
|
-
__html: `
|
|
109
|
-
@keyframes slideInRight {
|
|
110
|
-
from {
|
|
111
|
-
transform: translateX(100%) scale(0.95);
|
|
112
|
-
opacity: 0;
|
|
113
|
-
}
|
|
114
|
-
to {
|
|
115
|
-
transform: translateX(0) scale(1);
|
|
116
|
-
opacity: 1;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
`
|
|
120
|
-
} })] }));
|
|
121
|
-
}
|
|
122
|
-
// 편의 함수들
|
|
123
|
-
export const showToast = (toast) => {
|
|
124
|
-
// 이 함수는 ToastProvider 내부에서만 사용 가능
|
|
125
|
-
console.warn("showToast is deprecated. Use useToast hook instead.");
|
|
126
|
-
};
|
|
127
|
-
export const showSuccessToast = (message, title, duration) => {
|
|
128
|
-
console.warn("showSuccessToast is deprecated. Use useToast hook instead.");
|
|
129
|
-
};
|
|
130
|
-
export const showErrorToast = (message, title, duration) => {
|
|
131
|
-
console.warn("showErrorToast is deprecated. Use useToast hook instead.");
|
|
132
|
-
};
|
|
133
|
-
export const showWarningToast = (message, title, duration) => {
|
|
134
|
-
console.warn("showWarningToast is deprecated. Use useToast hook instead.");
|
|
135
|
-
};
|
|
136
|
-
export const showInfoToast = (message, title, duration) => {
|
|
137
|
-
console.warn("showInfoToast is deprecated. Use useToast hook instead.");
|
|
138
|
-
};
|