@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
package/package.json
CHANGED
|
@@ -1,50 +1,110 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hua-labs/ui",
|
|
3
|
-
"version": "1.0.0",
|
|
3
|
+
"version": "1.1.0-alpha.0.2",
|
|
4
4
|
"description": "HUA Labs - Modern React UI Component Library - Beautiful, accessible, and customizable components for React applications",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
6
7
|
"types": "./dist/index.d.ts",
|
|
7
8
|
"exports": {
|
|
8
9
|
".": {
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./src/index.ts",
|
|
12
|
+
"require": "./src/index.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./advanced": {
|
|
16
|
+
"types": "./dist/advanced.d.ts",
|
|
17
|
+
"import": "./dist/advanced.mjs",
|
|
18
|
+
"require": "./dist/advanced.js"
|
|
19
|
+
},
|
|
20
|
+
"./advanced/dashboard": {
|
|
21
|
+
"types": "./src/advanced/dashboard.ts",
|
|
22
|
+
"import": "./src/advanced/dashboard.ts",
|
|
23
|
+
"require": "./src/advanced/dashboard.ts",
|
|
24
|
+
"default": "./dist/advanced-dashboard.mjs"
|
|
25
|
+
},
|
|
26
|
+
"./advanced/motion": {
|
|
27
|
+
"types": "./src/advanced/motion.ts",
|
|
28
|
+
"import": "./src/advanced/motion.ts",
|
|
29
|
+
"require": "./src/advanced/motion.ts",
|
|
30
|
+
"default": "./dist/advanced-motion.mjs"
|
|
31
|
+
},
|
|
32
|
+
"./form": {
|
|
33
|
+
"types": "./dist/form.d.ts",
|
|
34
|
+
"import": "./dist/form.mjs",
|
|
35
|
+
"require": "./dist/form.js"
|
|
36
|
+
},
|
|
37
|
+
"./navigation": {
|
|
38
|
+
"types": "./dist/navigation.d.ts",
|
|
39
|
+
"import": "./dist/navigation.mjs",
|
|
40
|
+
"require": "./dist/navigation.js"
|
|
41
|
+
},
|
|
42
|
+
"./feedback": {
|
|
43
|
+
"types": "./dist/feedback.d.ts",
|
|
44
|
+
"import": "./dist/feedback.mjs",
|
|
45
|
+
"require": "./dist/feedback.js"
|
|
46
|
+
},
|
|
47
|
+
"./components/*": {
|
|
48
|
+
"types": "./dist/components/*.d.ts",
|
|
49
|
+
"import": "./dist/components/*.mjs",
|
|
50
|
+
"require": "./dist/components/*.js"
|
|
51
|
+
},
|
|
52
|
+
"./components/advanced/*": {
|
|
53
|
+
"types": "./dist/components/advanced/*.d.ts",
|
|
54
|
+
"import": "./dist/components/advanced/*.mjs",
|
|
55
|
+
"require": "./dist/components/advanced/*.js"
|
|
56
|
+
},
|
|
57
|
+
"./styles/toast.css": "./src/styles/toast.css"
|
|
13
58
|
},
|
|
14
59
|
"files": [
|
|
15
|
-
"dist"
|
|
60
|
+
"dist",
|
|
61
|
+
"src/styles"
|
|
16
62
|
],
|
|
17
63
|
"dependencies": {
|
|
18
|
-
"react": "^19.0.0",
|
|
19
64
|
"clsx": "^2.0.0",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
65
|
+
"lucide-react": "^0.263.1",
|
|
66
|
+
"tailwind-merge": "^2.0.0"
|
|
22
67
|
},
|
|
23
68
|
"devDependencies": {
|
|
69
|
+
"@phosphor-icons/react": "^2.1.10",
|
|
70
|
+
"@testing-library/jest-dom": "^6.8.0",
|
|
71
|
+
"@testing-library/react": "^16.3.0",
|
|
72
|
+
"@testing-library/user-event": "^14.6.1",
|
|
73
|
+
"@types/jest": "^29.0.0",
|
|
24
74
|
"@types/node": "^20.0.0",
|
|
25
|
-
"@types/react": "^19.
|
|
26
|
-
"@types/react-dom": "^19.
|
|
27
|
-
"
|
|
75
|
+
"@types/react": "^19.2.7",
|
|
76
|
+
"@types/react-dom": "^19.2.3",
|
|
77
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
78
|
+
"eslint": "^9.39.1",
|
|
28
79
|
"jest": "^29.0.0",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
80
|
+
"jsdom": "^27.2.0",
|
|
81
|
+
"react": "^19.2.1",
|
|
82
|
+
"react-dom": "^19.2.1",
|
|
83
|
+
"rollup-plugin-visualizer": "^6.0.5",
|
|
84
|
+
"tsup": "^8.5.1",
|
|
85
|
+
"tsx": "^4.21.0",
|
|
86
|
+
"typescript": "^5.9.3",
|
|
87
|
+
"vitest": "^4.0.14"
|
|
31
88
|
},
|
|
32
89
|
"peerDependencies": {
|
|
90
|
+
"@hua-labs/motion-core": "*",
|
|
91
|
+
"@phosphor-icons/react": "*",
|
|
33
92
|
"react": ">=16.8.0",
|
|
34
93
|
"react-dom": ">=16.8.0"
|
|
35
94
|
},
|
|
36
95
|
"keywords": [
|
|
37
|
-
"
|
|
38
|
-
"
|
|
96
|
+
"hua-labs",
|
|
97
|
+
"ui-library",
|
|
98
|
+
"react-components",
|
|
39
99
|
"react",
|
|
40
100
|
"typescript",
|
|
41
101
|
"design-system",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
102
|
+
"accessibility",
|
|
103
|
+
"aria",
|
|
104
|
+
"dark-mode",
|
|
44
105
|
"tailwind",
|
|
45
106
|
"nextjs",
|
|
46
|
-
"
|
|
47
|
-
"english"
|
|
107
|
+
"ssr"
|
|
48
108
|
],
|
|
49
109
|
"author": "HUA Labs",
|
|
50
110
|
"license": "MIT",
|
|
@@ -57,11 +117,18 @@
|
|
|
57
117
|
},
|
|
58
118
|
"homepage": "https://github.com/HUA-Labs/HUA-Labs-public#readme",
|
|
59
119
|
"scripts": {
|
|
60
|
-
"build": "tsc",
|
|
61
|
-
"
|
|
120
|
+
"build": "pnpm exec tsup && pnpm exec tsc --emitDeclarationOnly",
|
|
121
|
+
"build:watch": "pnpm exec tsup --watch",
|
|
122
|
+
"dev": "pnpm exec tsup --watch",
|
|
62
123
|
"clean": "rm -rf dist",
|
|
63
|
-
"test": "
|
|
64
|
-
"
|
|
65
|
-
"
|
|
124
|
+
"test": "vitest",
|
|
125
|
+
"test:ui": "vitest --ui",
|
|
126
|
+
"test:coverage": "vitest --coverage",
|
|
127
|
+
"analyze": "node scripts/analyze-bundle.js",
|
|
128
|
+
"build:analyze": "pnpm build && pnpm analyze",
|
|
129
|
+
"lint": "echo 'Skipping lint for hua-ui (ESLint 8, needs separate config)'",
|
|
130
|
+
"type-check": "tsc --noEmit",
|
|
131
|
+
"generate:icon-types": "tsx scripts/generate-icon-types.ts",
|
|
132
|
+
"generate:icon-snippets": "tsx scripts/generate-icon-snippets.ts"
|
|
66
133
|
}
|
|
67
134
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toast Component Animations
|
|
3
|
+
*
|
|
4
|
+
* This CSS file contains animations for the Toast component.
|
|
5
|
+
* Import this file in your application's global CSS or layout.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* import '@hua-labs/ui/styles/toast.css';
|
|
9
|
+
* // or in your global CSS:
|
|
10
|
+
* @import '@hua-labs/ui/styles/toast.css';
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
@keyframes slideInRight {
|
|
14
|
+
from {
|
|
15
|
+
transform: translateX(100%) scale(0.95);
|
|
16
|
+
opacity: 0;
|
|
17
|
+
}
|
|
18
|
+
to {
|
|
19
|
+
transform: translateX(0) scale(1);
|
|
20
|
+
opacity: 1;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
@@ -1,84 +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
|
-
import { Icon } from "./Icon";
|
|
6
|
-
const Accordion = React.forwardRef(({ children, className, type = "single", defaultValue, value, onValueChange, collapsible = false, ...props }, ref) => {
|
|
7
|
-
const [openItems, setOpenItems] = React.useState(value ? (Array.isArray(value) ? value : [value]) :
|
|
8
|
-
defaultValue ? (Array.isArray(defaultValue) ? defaultValue : [defaultValue]) : []);
|
|
9
|
-
React.useEffect(() => {
|
|
10
|
-
if (value !== undefined) {
|
|
11
|
-
setOpenItems(Array.isArray(value) ? value : [value]);
|
|
12
|
-
}
|
|
13
|
-
}, [value]);
|
|
14
|
-
const handleItemToggle = (itemValue) => {
|
|
15
|
-
let newOpenItems;
|
|
16
|
-
if (type === "single") {
|
|
17
|
-
if (openItems.includes(itemValue)) {
|
|
18
|
-
newOpenItems = collapsible ? [] : openItems;
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
newOpenItems = [itemValue];
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
if (openItems.includes(itemValue)) {
|
|
26
|
-
newOpenItems = openItems.filter(item => item !== itemValue);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
newOpenItems = [...openItems, itemValue];
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
setOpenItems(newOpenItems);
|
|
33
|
-
onValueChange?.(type === "single" ? newOpenItems[0] || "" : newOpenItems);
|
|
34
|
-
};
|
|
35
|
-
return (_jsx("div", { ref: ref, className: cn("space-y-2", className), ...props, children: React.Children.map(children, (child) => {
|
|
36
|
-
if (React.isValidElement(child)) {
|
|
37
|
-
return React.cloneElement(child, {
|
|
38
|
-
openItems,
|
|
39
|
-
onToggle: handleItemToggle,
|
|
40
|
-
...child.props
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
return child;
|
|
44
|
-
}) }));
|
|
45
|
-
});
|
|
46
|
-
Accordion.displayName = "Accordion";
|
|
47
|
-
const AccordionItem = React.forwardRef(({ value, children, className, disabled = false, openItems = [], onToggle, ...props }, ref) => {
|
|
48
|
-
const isOpen = openItems.includes(value);
|
|
49
|
-
return (_jsx("div", { ref: ref, className: cn("border border-gray-200/50 dark:border-gray-700/50 rounded-lg overflow-hidden", disabled && "opacity-50 pointer-events-none", className), ...props, children: React.Children.map(children, (child) => {
|
|
50
|
-
if (React.isValidElement(child)) {
|
|
51
|
-
return React.cloneElement(child, {
|
|
52
|
-
value,
|
|
53
|
-
isOpen,
|
|
54
|
-
disabled,
|
|
55
|
-
onToggle: () => onToggle?.(value),
|
|
56
|
-
...child.props
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
return child;
|
|
60
|
-
}) }));
|
|
61
|
-
});
|
|
62
|
-
AccordionItem.displayName = "AccordionItem";
|
|
63
|
-
const AccordionTrigger = React.forwardRef(({ children, className, icon, iconPosition = "right", isOpen = false, disabled = false, onToggle, ...props }, ref) => {
|
|
64
|
-
const defaultIcon = (_jsx(Icon, { name: "chevronDown", size: 20, className: cn("transition-transform duration-300 ease-out", isOpen && "rotate-180") }));
|
|
65
|
-
return (_jsxs("button", { ref: ref, onClick: onToggle, disabled: disabled, className: cn("flex w-full items-center justify-between px-6 py-4 text-left font-medium transition-all hover:bg-gray-50/80 dark:hover:bg-gray-800/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/50 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", className), ...props, children: [_jsxs("div", { className: "flex items-center gap-3 flex-1", children: [iconPosition === "left" && (icon || defaultIcon), _jsx("span", { className: "flex-1", children: children })] }), iconPosition === "right" && (icon || defaultIcon)] }));
|
|
66
|
-
});
|
|
67
|
-
AccordionTrigger.displayName = "AccordionTrigger";
|
|
68
|
-
const AccordionContent = React.forwardRef(({ children, className, isOpen = false, ...props }, ref) => {
|
|
69
|
-
const [height, setHeight] = React.useState(0);
|
|
70
|
-
const contentRef = React.useRef(null);
|
|
71
|
-
React.useEffect(() => {
|
|
72
|
-
if (contentRef.current) {
|
|
73
|
-
if (isOpen) {
|
|
74
|
-
setHeight(contentRef.current.scrollHeight);
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
setHeight(0);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}, [isOpen, children]);
|
|
81
|
-
return (_jsx("div", { ref: ref, className: "overflow-hidden transition-all duration-300 ease-out", style: { height: `${height}px` }, ...props, children: _jsx("div", { ref: contentRef, className: cn("px-6 pb-4", className), children: children }) }));
|
|
82
|
-
});
|
|
83
|
-
AccordionContent.displayName = "AccordionContent";
|
|
84
|
-
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
package/dist/components/Alert.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { cn } from "../lib/utils";
|
|
5
|
-
const Alert = React.forwardRef(({ className, variant = "default", title, description, icon, action, closable = false, onClose, children, ...props }, ref) => {
|
|
6
|
-
const getVariantClasses = () => {
|
|
7
|
-
switch (variant) {
|
|
8
|
-
case "success":
|
|
9
|
-
return "bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800 text-green-800 dark:text-green-200";
|
|
10
|
-
case "warning":
|
|
11
|
-
return "bg-yellow-50 dark:bg-yellow-900/20 border-yellow-200 dark:border-yellow-800 text-yellow-800 dark:text-yellow-200";
|
|
12
|
-
case "error":
|
|
13
|
-
return "bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-800 text-red-800 dark:text-red-200";
|
|
14
|
-
case "info":
|
|
15
|
-
return "bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800 text-blue-800 dark:text-blue-200";
|
|
16
|
-
default:
|
|
17
|
-
return "bg-gray-50 dark:bg-gray-900/20 border-gray-200 dark:border-gray-800 text-gray-800 dark:text-gray-200";
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
const getIconClasses = () => {
|
|
21
|
-
switch (variant) {
|
|
22
|
-
case "success":
|
|
23
|
-
return "text-green-500 dark:text-green-400";
|
|
24
|
-
case "warning":
|
|
25
|
-
return "text-yellow-500 dark:text-yellow-400";
|
|
26
|
-
case "error":
|
|
27
|
-
return "text-red-500 dark:text-red-400";
|
|
28
|
-
case "info":
|
|
29
|
-
return "text-blue-500 dark:text-blue-400";
|
|
30
|
-
default:
|
|
31
|
-
return "text-gray-500 dark:text-gray-400";
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
const getDefaultIcon = () => {
|
|
35
|
-
switch (variant) {
|
|
36
|
-
case "success":
|
|
37
|
-
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" }) }));
|
|
38
|
-
case "warning":
|
|
39
|
-
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" }) }));
|
|
40
|
-
case "error":
|
|
41
|
-
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" }) }));
|
|
42
|
-
case "info":
|
|
43
|
-
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" }) }));
|
|
44
|
-
default:
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
return (_jsx("div", { ref: ref, className: cn("relative rounded-lg border p-4", // 16px 패딩
|
|
49
|
-
getVariantClasses(), className), ...props, children: _jsxs("div", { className: "flex items-start gap-3", children: [" ", (icon || getDefaultIcon()) && (_jsx("div", { className: cn("flex-shrink-0 mt-0.5", getIconClasses()), children: icon || getDefaultIcon() })), _jsxs("div", { className: "flex-1 min-w-0", children: [title && (_jsxs("h4", { className: "text-sm font-semibold mb-1", children: [" ", title] })), description && (_jsx("p", { className: "text-sm leading-relaxed", children: description })), children && (_jsxs("div", { className: "mt-2", children: [" ", children] }))] }), (action || closable) && (_jsxs("div", { className: "flex-shrink-0 flex items-center gap-2", children: [" ", action, closable && (_jsx("button", { onClick: onClose, 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", getIconClasses()), "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" }) }) }))] }))] }) }));
|
|
50
|
-
});
|
|
51
|
-
Alert.displayName = "Alert";
|
|
52
|
-
// 편의 컴포넌트들
|
|
53
|
-
export const AlertSuccess = React.forwardRef(({ className, ...props }, ref) => (_jsx(Alert, { ref: ref, variant: "success", className: className, ...props })));
|
|
54
|
-
AlertSuccess.displayName = "AlertSuccess";
|
|
55
|
-
export const AlertWarning = React.forwardRef(({ className, ...props }, ref) => (_jsx(Alert, { ref: ref, variant: "warning", className: className, ...props })));
|
|
56
|
-
AlertWarning.displayName = "AlertWarning";
|
|
57
|
-
export const AlertError = React.forwardRef(({ className, ...props }, ref) => (_jsx(Alert, { ref: ref, variant: "error", className: className, ...props })));
|
|
58
|
-
AlertError.displayName = "AlertError";
|
|
59
|
-
export const AlertInfo = React.forwardRef(({ className, ...props }, ref) => (_jsx(Alert, { ref: ref, variant: "info", className: className, ...props })));
|
|
60
|
-
AlertInfo.displayName = "AlertInfo";
|
|
61
|
-
export { Alert };
|
|
@@ -1,18 +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 Avatar = React.forwardRef(({ className, size = "md", ...props }, ref) => {
|
|
6
|
-
const sizeClasses = {
|
|
7
|
-
sm: "w-8 h-8",
|
|
8
|
-
md: "w-10 h-10",
|
|
9
|
-
lg: "w-12 h-12"
|
|
10
|
-
};
|
|
11
|
-
return (_jsx("div", { ref: ref, className: cn("relative flex shrink-0 overflow-hidden rounded-full", sizeClasses[size], className), ...props }));
|
|
12
|
-
});
|
|
13
|
-
Avatar.displayName = "Avatar";
|
|
14
|
-
const AvatarImage = React.forwardRef(({ className, ...props }, ref) => (_jsx("img", { ref: ref, className: cn("aspect-square h-full w-full", className), ...props })));
|
|
15
|
-
AvatarImage.displayName = "AvatarImage";
|
|
16
|
-
const AvatarFallback = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex h-full w-full items-center justify-center rounded-full bg-gray-100 dark:bg-gray-800", className), ...props })));
|
|
17
|
-
AvatarFallback.displayName = "AvatarFallback";
|
|
18
|
-
export { Avatar, AvatarImage, AvatarFallback };
|
package/dist/components/Badge.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { cn } from "../lib/utils";
|
|
5
|
-
const Badge = React.forwardRef(({ className, variant = "default", ...props }, ref) => {
|
|
6
|
-
const variantClasses = {
|
|
7
|
-
default: "bg-gray-900 text-gray-50 hover:bg-gray-900/80 dark:bg-gray-50 dark:text-gray-900 dark:hover:bg-gray-50/80",
|
|
8
|
-
secondary: "bg-gray-100 text-gray-900 hover:bg-gray-100/80 dark:bg-gray-800 dark:text-gray-50 dark:hover:bg-gray-800/80",
|
|
9
|
-
destructive: "bg-red-500 text-gray-50 hover:bg-red-500/80 dark:bg-red-900 dark:text-gray-50 dark:hover:bg-red-900/80",
|
|
10
|
-
outline: "text-gray-950 border border-gray-200 hover:bg-gray-100 hover:text-gray-900 dark:border-gray-800 dark:text-gray-50 dark:hover:bg-gray-800 dark:hover:text-gray-50"
|
|
11
|
-
};
|
|
12
|
-
return (_jsx("div", { ref: ref, className: cn("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2", variantClasses[variant], className), ...props }));
|
|
13
|
-
});
|
|
14
|
-
Badge.displayName = "Badge";
|
|
15
|
-
export { Badge };
|
|
@@ -1,96 +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
|
-
import { Icon } from "./Icon";
|
|
6
|
-
const BottomSheet = React.forwardRef(({ open, onOpenChange, children, className, height = "md", showBackdrop = true, closeOnBackdropClick = true, closeOnEscape = true, showDragHandle = true, snapPoints = [25, 50, 75, 100], defaultSnap = 50, ...props }, ref) => {
|
|
7
|
-
const [isVisible, setIsVisible] = React.useState(false);
|
|
8
|
-
const [isAnimating, setIsAnimating] = React.useState(false);
|
|
9
|
-
const [currentHeight, setCurrentHeight] = React.useState(defaultSnap);
|
|
10
|
-
const [isDragging, setIsDragging] = React.useState(false);
|
|
11
|
-
const [startY, setStartY] = React.useState(0);
|
|
12
|
-
const [currentY, setCurrentY] = React.useState(0);
|
|
13
|
-
const heightClasses = {
|
|
14
|
-
sm: "h-64",
|
|
15
|
-
md: "h-96",
|
|
16
|
-
lg: "h-[32rem]",
|
|
17
|
-
xl: "h-[40rem]",
|
|
18
|
-
full: "h-full"
|
|
19
|
-
};
|
|
20
|
-
React.useEffect(() => {
|
|
21
|
-
if (open) {
|
|
22
|
-
setIsVisible(true);
|
|
23
|
-
setIsAnimating(true);
|
|
24
|
-
const timer = setTimeout(() => setIsAnimating(false), 50);
|
|
25
|
-
return () => clearTimeout(timer);
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
setIsAnimating(true);
|
|
29
|
-
const timer = setTimeout(() => {
|
|
30
|
-
setIsVisible(false);
|
|
31
|
-
setIsAnimating(false);
|
|
32
|
-
}, 300);
|
|
33
|
-
return () => clearTimeout(timer);
|
|
34
|
-
}
|
|
35
|
-
}, [open]);
|
|
36
|
-
React.useEffect(() => {
|
|
37
|
-
if (!closeOnEscape)
|
|
38
|
-
return;
|
|
39
|
-
const handleEscape = (e) => {
|
|
40
|
-
if (e.key === "Escape" && open) {
|
|
41
|
-
onOpenChange(false);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
if (open) {
|
|
45
|
-
document.addEventListener("keydown", handleEscape);
|
|
46
|
-
document.body.style.overflow = "hidden";
|
|
47
|
-
}
|
|
48
|
-
return () => {
|
|
49
|
-
document.removeEventListener("keydown", handleEscape);
|
|
50
|
-
document.body.style.overflow = "";
|
|
51
|
-
};
|
|
52
|
-
}, [open, closeOnEscape, onOpenChange]);
|
|
53
|
-
const handleTouchStart = (e) => {
|
|
54
|
-
setIsDragging(true);
|
|
55
|
-
setStartY(e.touches[0].clientY);
|
|
56
|
-
setCurrentY(e.touches[0].clientY);
|
|
57
|
-
};
|
|
58
|
-
const handleTouchMove = (e) => {
|
|
59
|
-
if (!isDragging)
|
|
60
|
-
return;
|
|
61
|
-
setCurrentY(e.touches[0].clientY);
|
|
62
|
-
};
|
|
63
|
-
const handleTouchEnd = () => {
|
|
64
|
-
if (!isDragging)
|
|
65
|
-
return;
|
|
66
|
-
setIsDragging(false);
|
|
67
|
-
const deltaY = currentY - startY;
|
|
68
|
-
const threshold = 100;
|
|
69
|
-
if (deltaY > threshold) {
|
|
70
|
-
// 아래로 드래그 - 닫기
|
|
71
|
-
onOpenChange(false);
|
|
72
|
-
}
|
|
73
|
-
else if (deltaY < -threshold) {
|
|
74
|
-
// 위로 드래그 - 다음 스냅 포인트
|
|
75
|
-
const currentIndex = snapPoints.indexOf(currentHeight);
|
|
76
|
-
const nextIndex = Math.min(currentIndex + 1, snapPoints.length - 1);
|
|
77
|
-
setCurrentHeight(snapPoints[nextIndex]);
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
if (!isVisible)
|
|
81
|
-
return null;
|
|
82
|
-
return (_jsxs("div", { className: "fixed inset-0 z-50", children: [showBackdrop && (_jsx("div", { className: cn("absolute inset-0 bg-black/50 backdrop-blur-sm transition-opacity duration-300", isAnimating ? (open ? "opacity-100" : "opacity-0") : ""), onClick: closeOnBackdropClick ? () => onOpenChange(false) : undefined })), _jsxs("div", { ref: ref, className: cn("absolute bottom-0 left-0 right-0 bg-white/95 dark:!bg-gray-800/95 backdrop-blur-xl border-t border-gray-200/50 dark:!border-gray-600/50 shadow-2xl rounded-t-2xl transition-transform duration-300 ease-out", heightClasses[height], isAnimating ? (open ? "translate-y-0" : "translate-y-full") : "", className), style: {
|
|
83
|
-
height: `${currentHeight}%`,
|
|
84
|
-
transform: isDragging ? `translateY(${currentY - startY}px)` : undefined
|
|
85
|
-
}, onTouchStart: handleTouchStart, onTouchMove: handleTouchMove, onTouchEnd: handleTouchEnd, ...props, children: [showDragHandle && (_jsx("div", { className: "flex justify-center pt-3 pb-2", children: _jsx("div", { className: "w-12 h-1.5 bg-gray-300 dark:bg-gray-600 rounded-full" }) })), children] })] }));
|
|
86
|
-
});
|
|
87
|
-
BottomSheet.displayName = "BottomSheet";
|
|
88
|
-
const BottomSheetHeader = React.forwardRef(({ children, className, showCloseButton = true, onClose, ...props }, ref) => {
|
|
89
|
-
return (_jsxs("div", { ref: ref, className: cn("flex items-center justify-between px-6 py-4", className), ...props, children: [_jsx("div", { className: "flex-1", children: children }), showCloseButton && (_jsx("button", { onClick: onClose, className: "p-2 rounded-lg hover:bg-gray-100/80 dark:hover:bg-gray-800/80 transition-colors", children: _jsx(Icon, { name: "x", size: 20 }) }))] }));
|
|
90
|
-
});
|
|
91
|
-
BottomSheetHeader.displayName = "BottomSheetHeader";
|
|
92
|
-
const BottomSheetContent = React.forwardRef(({ children, className, ...props }, ref) => {
|
|
93
|
-
return (_jsx("div", { ref: ref, className: cn("flex-1 px-6 pb-6 overflow-y-auto", className), ...props, children: children }));
|
|
94
|
-
});
|
|
95
|
-
BottomSheetContent.displayName = "BottomSheetContent";
|
|
96
|
-
export { BottomSheet, BottomSheetHeader, BottomSheetContent };
|
|
@@ -1,47 +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
|
-
import { Icon } from "./Icon";
|
|
6
|
-
const Breadcrumb = React.forwardRef(({ items, separator = _jsx(Icon, { name: "chevron-right", size: 16, className: "text-gray-400 dark:text-gray-500" }), className, maxItems, showHomeIcon = true, homeLabel = "홈", homeHref = "/", ...props }, ref) => {
|
|
7
|
-
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
8
|
-
// 홈 아이템 추가
|
|
9
|
-
const allItems = [
|
|
10
|
-
{
|
|
11
|
-
label: homeLabel,
|
|
12
|
-
href: homeHref,
|
|
13
|
-
icon: showHomeIcon ? "home" : undefined
|
|
14
|
-
},
|
|
15
|
-
...items
|
|
16
|
-
];
|
|
17
|
-
// 최대 아이템 수 제한
|
|
18
|
-
const displayItems = maxItems && allItems.length > maxItems && !isExpanded
|
|
19
|
-
? [
|
|
20
|
-
...allItems.slice(0, 1),
|
|
21
|
-
{ label: "...", href: undefined },
|
|
22
|
-
...allItems.slice(-maxItems + 2)
|
|
23
|
-
]
|
|
24
|
-
: allItems;
|
|
25
|
-
const renderItem = (item, index) => {
|
|
26
|
-
const isLast = index === displayItems.length - 1;
|
|
27
|
-
const isClickable = item.href || item.onClick;
|
|
28
|
-
const itemContent = (_jsxs("div", { className: "flex items-center gap-2", children: [item.icon && _jsx(Icon, { name: item.icon, size: 16 }), _jsx("span", { className: "truncate", children: item.label })] }));
|
|
29
|
-
if (isLast) {
|
|
30
|
-
return (_jsx("span", { className: "text-gray-900 dark:text-gray-400 font-medium truncate", children: itemContent }, index));
|
|
31
|
-
}
|
|
32
|
-
if (isClickable) {
|
|
33
|
-
return (_jsx("a", { href: item.href, onClick: item.onClick, className: "text-gray-600 dark:text-gray-500 hover:text-gray-900 dark:hover:text-gray-300 transition-colors truncate hover:underline", children: itemContent }, index));
|
|
34
|
-
}
|
|
35
|
-
return (_jsx("span", { className: "text-gray-500 dark:text-gray-500 truncate cursor-default", children: itemContent }, index));
|
|
36
|
-
};
|
|
37
|
-
return (_jsxs("nav", { ref: ref, className: cn("flex items-center gap-2 text-sm", className), "aria-label": "Breadcrumb", ...props, children: [displayItems.map((item, index) => (_jsxs(React.Fragment, { children: [renderItem(item, index), index < displayItems.length - 1 && (_jsx("span", { className: "flex-shrink-0", "aria-hidden": "true", children: separator }))] }, index))), maxItems && allItems.length > maxItems && (_jsx("button", { onClick: () => setIsExpanded(!isExpanded), className: "ml-2 text-blue-600 dark:text-blue-400 hover:underline text-xs", children: isExpanded ? "접기" : "펼치기" }))] }));
|
|
38
|
-
});
|
|
39
|
-
Breadcrumb.displayName = "Breadcrumb";
|
|
40
|
-
const BreadcrumbItem = React.forwardRef(({ children, className, href, onClick, isActive = false, ...props }, ref) => {
|
|
41
|
-
const Component = href ? "a" : "button";
|
|
42
|
-
return (_jsx(Component, { ref: ref, href: href, onClick: onClick, className: cn("flex items-center gap-2 text-sm transition-colors", isActive
|
|
43
|
-
? "text-gray-900 dark:text-gray-400 font-medium"
|
|
44
|
-
: "text-gray-600 dark:text-gray-500 hover:text-gray-900 dark:hover:text-gray-300", className), ...props, children: children }));
|
|
45
|
-
});
|
|
46
|
-
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
47
|
-
export { Breadcrumb, BreadcrumbItem };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { cn } from "../lib/utils";
|
|
5
|
-
const Button = React.forwardRef(({ className, variant = "default", size = "md", asChild = false, ...props }, ref) => {
|
|
6
|
-
const variantClasses = {
|
|
7
|
-
default: "bg-gray-900 text-white hover:bg-gray-800 dark:bg-gray-50 dark:text-gray-900 dark:hover:bg-gray-100",
|
|
8
|
-
primary: "bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600",
|
|
9
|
-
secondary: "bg-gray-100 text-gray-900 hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-100 dark:hover:bg-gray-700",
|
|
10
|
-
outline: "border border-gray-200 bg-white hover:bg-gray-50 dark:border-gray-800 dark:bg-gray-950 dark:hover:bg-gray-800",
|
|
11
|
-
ghost: "hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-gray-800 dark:hover:text-gray-100",
|
|
12
|
-
destructive: "bg-red-500 text-white hover:bg-red-600 dark:bg-red-600 dark:hover:bg-red-700"
|
|
13
|
-
};
|
|
14
|
-
const sizeClasses = {
|
|
15
|
-
sm: "h-10 px-4 py-3 text-sm", // 더 넉넉한 여백
|
|
16
|
-
md: "h-12 px-6 py-4 text-base", // 더 넉넉한 여백
|
|
17
|
-
lg: "h-14 px-8 py-5 text-lg", // 더 넉넉한 여백
|
|
18
|
-
icon: "h-12 w-12" // 더 넉넉한 아이콘 버튼
|
|
19
|
-
};
|
|
20
|
-
return (_jsx("button", { className: cn("inline-flex items-center justify-center rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-400 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", variantClasses[variant], sizeClasses[size], className), ref: ref, ...props }));
|
|
21
|
-
});
|
|
22
|
-
Button.displayName = "Button";
|
|
23
|
-
export { Button };
|
package/dist/components/Card.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { cn } from "../lib/utils";
|
|
5
|
-
const Card = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("rounded-lg border bg-card text-card-foreground shadow-sm", className), ...props })));
|
|
6
|
-
Card.displayName = "Card";
|
|
7
|
-
const CardHeader = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex flex-col space-y-2 p-8", className), ...props })));
|
|
8
|
-
CardHeader.displayName = "CardHeader";
|
|
9
|
-
const CardTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx("h3", { ref: ref, className: cn("text-2xl font-semibold leading-none tracking-tight", className), ...props })));
|
|
10
|
-
CardTitle.displayName = "CardTitle";
|
|
11
|
-
const CardDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx("p", { ref: ref, className: cn("text-sm text-muted-foreground", className), ...props })));
|
|
12
|
-
CardDescription.displayName = "CardDescription";
|
|
13
|
-
const CardContent = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("p-8 pt-0", className), ...props }) // 더 넉넉한 여백
|
|
14
|
-
));
|
|
15
|
-
CardContent.displayName = "CardContent";
|
|
16
|
-
const CardFooter = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex items-center p-8 pt-0", className), ...props })));
|
|
17
|
-
CardFooter.displayName = "CardFooter";
|
|
18
|
-
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
|
|
@@ -1,59 +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
|
-
import { Avatar, AvatarImage, AvatarFallback } from "./Avatar";
|
|
6
|
-
import { Badge } from "./Badge";
|
|
7
|
-
import { Card, CardContent } from "./Card";
|
|
8
|
-
const ChatMessage = React.forwardRef(({ className, message, user = { name: "사용자", color: "#3b82f6" }, assistant = { name: "AI", color: "#10b981" }, showAvatar = true, showTimestamp = true, showEmotion = true, variant = "default", theme = {
|
|
9
|
-
userBubbleBg: "#3b82f6",
|
|
10
|
-
userBubbleText: "#ffffff",
|
|
11
|
-
aiBubbleBg: "#f3f4f6",
|
|
12
|
-
aiBubbleText: "#1f2937"
|
|
13
|
-
}, ...props }, ref) => {
|
|
14
|
-
const isUser = message.role === "user";
|
|
15
|
-
const isAssistant = message.role === "assistant";
|
|
16
|
-
const isSystem = message.role === "system";
|
|
17
|
-
const getEmotionColor = (emotion) => {
|
|
18
|
-
if (!emotion)
|
|
19
|
-
return "bg-gray-100";
|
|
20
|
-
const emotionColors = {
|
|
21
|
-
joy: "bg-yellow-100 text-yellow-800",
|
|
22
|
-
sadness: "bg-blue-100 text-blue-800",
|
|
23
|
-
anger: "bg-red-100 text-red-800",
|
|
24
|
-
calm: "bg-green-100 text-green-800",
|
|
25
|
-
excitement: "bg-pink-100 text-pink-800",
|
|
26
|
-
worry: "bg-gray-100 text-gray-800",
|
|
27
|
-
gratitude: "bg-purple-100 text-purple-800",
|
|
28
|
-
loneliness: "bg-indigo-100 text-indigo-800"
|
|
29
|
-
};
|
|
30
|
-
return emotionColors[emotion] || "bg-gray-100 text-gray-800";
|
|
31
|
-
};
|
|
32
|
-
const formatTime = (date) => {
|
|
33
|
-
return date.toLocaleTimeString('ko-KR', {
|
|
34
|
-
hour: '2-digit',
|
|
35
|
-
minute: '2-digit'
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
if (variant === "bubble") {
|
|
39
|
-
return (_jsx("div", { ref: ref, className: cn("flex w-full", isUser ? "justify-end" : "justify-start", className), ...props, children: _jsxs("div", { className: cn("flex max-w-[80%] space-x-2", isUser ? "flex-row-reverse space-x-reverse" : "flex-row"), children: [showAvatar && (_jsxs(Avatar, { className: "w-8 h-8 flex-shrink-0", children: [_jsx(AvatarImage, { src: isUser ? user.avatar : assistant.avatar, alt: isUser ? user.name : assistant.name }), _jsx(AvatarFallback, { style: {
|
|
40
|
-
backgroundColor: isUser ? user.color : assistant.color
|
|
41
|
-
}, children: (isUser ? user.name : assistant.name)?.charAt(0) })] })), _jsxs("div", { className: "space-y-1", children: [_jsx("div", { className: cn("px-4 py-2 rounded-2xl max-w-full break-words", isUser
|
|
42
|
-
? "rounded-br-md"
|
|
43
|
-
: "rounded-bl-md"), style: {
|
|
44
|
-
backgroundColor: isUser ? theme.userBubbleBg : theme.aiBubbleBg,
|
|
45
|
-
color: isUser ? theme.userBubbleText : theme.aiBubbleText
|
|
46
|
-
}, children: message.isTyping ? (_jsxs("div", { className: "flex space-x-1", children: [_jsx("div", { className: "w-2 h-2 bg-current rounded-full animate-bounce" }), _jsx("div", { className: "w-2 h-2 bg-current rounded-full animate-bounce delay-100" }), _jsx("div", { className: "w-2 h-2 bg-current rounded-full animate-bounce delay-200" })] })) : (_jsx("div", { className: "whitespace-pre-wrap", children: message.content })) }), _jsxs("div", { className: cn("flex items-center space-x-2 text-xs text-muted-foreground", isUser ? "justify-end" : "justify-start"), children: [showTimestamp && (_jsx("span", { children: formatTime(message.timestamp) })), showEmotion && message.emotion && (_jsx(Badge, { variant: "secondary", className: cn("text-xs", getEmotionColor(message.emotion)), children: message.emotion }))] })] })] }) }));
|
|
47
|
-
}
|
|
48
|
-
if (variant === "compact") {
|
|
49
|
-
return (_jsxs("div", { ref: ref, className: cn("flex items-start space-x-3 py-2", className), ...props, children: [showAvatar && (_jsxs(Avatar, { className: "w-6 h-6 flex-shrink-0", children: [_jsx(AvatarImage, { src: isUser ? user.avatar : assistant.avatar, alt: isUser ? user.name : assistant.name }), _jsx(AvatarFallback, { style: {
|
|
50
|
-
backgroundColor: isUser ? user.color : assistant.color
|
|
51
|
-
}, children: (isUser ? user.name : assistant.name)?.charAt(0) })] })), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsxs("div", { className: "flex items-center space-x-2 mb-1", children: [_jsx("span", { className: "text-sm font-medium", children: isUser ? user.name : assistant.name }), showTimestamp && (_jsx("span", { className: "text-xs text-muted-foreground", children: formatTime(message.timestamp) })), showEmotion && message.emotion && (_jsx(Badge, { variant: "secondary", className: cn("text-xs", getEmotionColor(message.emotion)), children: message.emotion }))] }), _jsx("div", { className: "text-sm", children: message.isTyping ? (_jsxs("div", { className: "flex space-x-1", children: [_jsx("div", { className: "w-1.5 h-1.5 bg-muted-foreground rounded-full animate-bounce" }), _jsx("div", { className: "w-1.5 h-1.5 bg-muted-foreground rounded-full animate-bounce delay-100" }), _jsx("div", { className: "w-1.5 h-1.5 bg-muted-foreground rounded-full animate-bounce delay-200" })] })) : (_jsx("div", { className: "whitespace-pre-wrap", children: message.content })) })] })] }));
|
|
52
|
-
}
|
|
53
|
-
// default variant
|
|
54
|
-
return (_jsxs("div", { ref: ref, className: cn("flex items-start space-x-3 py-4", className), ...props, children: [showAvatar && (_jsxs(Avatar, { className: "w-10 h-10 flex-shrink-0", children: [_jsx(AvatarImage, { src: isUser ? user.avatar : assistant.avatar, alt: isUser ? user.name : assistant.name }), _jsx(AvatarFallback, { style: {
|
|
55
|
-
backgroundColor: isUser ? user.color : assistant.color
|
|
56
|
-
}, children: (isUser ? user.name : assistant.name)?.charAt(0) })] })), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsxs("div", { className: "flex items-center space-x-2 mb-2", children: [_jsx("span", { className: "font-medium", children: isUser ? user.name : assistant.name }), showTimestamp && (_jsx("span", { className: "text-sm text-muted-foreground", children: formatTime(message.timestamp) })), showEmotion && message.emotion && (_jsx(Badge, { variant: "secondary", className: cn("text-xs", getEmotionColor(message.emotion)), children: message.emotion }))] }), _jsx(Card, { className: cn("inline-block", isUser ? "bg-primary text-primary-foreground" : "bg-muted"), children: _jsx(CardContent, { className: "p-3", children: message.isTyping ? (_jsxs("div", { className: "flex space-x-1", children: [_jsx("div", { className: "w-2 h-2 bg-current rounded-full animate-bounce" }), _jsx("div", { className: "w-2 h-2 bg-current rounded-full animate-bounce delay-100" }), _jsx("div", { className: "w-2 h-2 bg-current rounded-full animate-bounce delay-200" })] })) : (_jsx("div", { className: "whitespace-pre-wrap", children: message.content })) }) })] })] }));
|
|
57
|
-
});
|
|
58
|
-
ChatMessage.displayName = "ChatMessage";
|
|
59
|
-
export { ChatMessage };
|