nucleus-core-ts 0.8.7 → 0.8.8
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/dist/client.js +1 -1
- package/dist/fe/components/AbstractAnimatedBackground/index.js +437 -0
- package/dist/fe/components/AuthorizationPage/components/AuthorizationPage.js +841 -0
- package/dist/fe/components/AuthorizationPage/components/ClaimList.js +100 -0
- package/dist/fe/components/AuthorizationPage/components/RoleClaimEditor.js +232 -0
- package/dist/fe/components/AuthorizationPage/components/RoleList.js +115 -0
- package/dist/fe/components/AuthorizationPage/index.js +6 -0
- package/dist/fe/components/AuthorizationPage/store/index.js +117 -0
- package/dist/fe/components/AuthorizationPage/theme/index.js +137 -0
- package/dist/fe/components/AuthorizationPage/types/index.js +1 -0
- package/dist/fe/components/Button/components/Button.js +158 -0
- package/dist/fe/components/Button/components/ButtonSpinner.js +52 -0
- package/dist/fe/components/Button/index.js +3 -0
- package/dist/fe/components/Button/theme/index.js +186 -0
- package/dist/fe/components/Button/types/index.js +1 -0
- package/dist/fe/components/Button/utils/cn.js +5 -0
- package/dist/fe/components/Captcha/components/Captcha.js +311 -0
- package/dist/fe/components/Captcha/index.js +2 -0
- package/dist/fe/components/Captcha/theme.js +52 -0
- package/dist/fe/components/Captcha/types.js +1 -0
- package/dist/fe/components/ChangePasswordPage/components/ChangePasswordForm.js +242 -0
- package/dist/fe/components/ChangePasswordPage/components/ChangePasswordHeader.js +39 -0
- package/dist/fe/components/ChangePasswordPage/components/ChangePasswordPage.js +60 -0
- package/dist/fe/components/ChangePasswordPage/index.js +5 -0
- package/dist/fe/components/ChangePasswordPage/store/index.js +44 -0
- package/dist/fe/components/ChangePasswordPage/theme/index.js +87 -0
- package/dist/fe/components/ChangePasswordPage/types/index.js +1 -0
- package/dist/fe/components/Checkbox/components/Checkbox.js +115 -0
- package/dist/fe/components/Checkbox/components/CheckboxIcon.js +119 -0
- package/dist/fe/components/Checkbox/components/SwitchTrack.js +178 -0
- package/dist/fe/components/Checkbox/index.js +4 -0
- package/dist/fe/components/Checkbox/theme/index.js +221 -0
- package/dist/fe/components/Checkbox/types/index.js +1 -0
- package/dist/fe/components/Checkbox/utils/cn.js +5 -0
- package/dist/fe/components/DataTable/DataTable.js +225 -0
- package/dist/fe/components/DataTable/components/ActionCell.js +26 -0
- package/dist/fe/components/DataTable/components/DataCell.js +76 -0
- package/dist/fe/components/DataTable/components/EditableCell.js +221 -0
- package/dist/fe/components/DataTable/components/EmptyState.js +29 -0
- package/dist/fe/components/DataTable/components/HeaderCell.js +64 -0
- package/dist/fe/components/DataTable/components/InfiniteScrollTrigger.js +66 -0
- package/dist/fe/components/DataTable/components/LoadingSpinner.js +19 -0
- package/dist/fe/components/DataTable/components/ResizeHandle.js +41 -0
- package/dist/fe/components/DataTable/components/SelectionCell.js +105 -0
- package/dist/fe/components/DataTable/components/SkeletonRow.js +56 -0
- package/dist/fe/components/DataTable/components/SkeletonTable.js +83 -0
- package/dist/fe/components/DataTable/components/SortIcon.js +39 -0
- package/dist/fe/components/DataTable/components/TableHeader.js +49 -0
- package/dist/fe/components/DataTable/components/TableRow.js +118 -0
- package/dist/fe/components/DataTable/components/index.js +14 -0
- package/dist/fe/components/DataTable/hooks/index.js +2 -0
- package/dist/fe/components/DataTable/hooks/useAutoFitColumn.js +23 -0
- package/dist/fe/components/DataTable/hooks/useResizeColumn.js +122 -0
- package/dist/fe/components/DataTable/index.js +3 -0
- package/dist/fe/components/DataTable/store/index.js +97 -0
- package/dist/fe/components/DataTable/theme/index.js +144 -0
- package/dist/fe/components/DataTable/types/index.js +1 -0
- package/dist/fe/components/DataTable/utils/cn.js +5 -0
- package/dist/fe/components/DatePicker/components/CalendarGrid.js +95 -0
- package/dist/fe/components/DatePicker/components/CalendarHeader.js +152 -0
- package/dist/fe/components/DatePicker/components/DatePicker.js +381 -0
- package/dist/fe/components/DatePicker/components/MonthYearSelector.js +93 -0
- package/dist/fe/components/DatePicker/index.js +7 -0
- package/dist/fe/components/DatePicker/locales/index.js +1113 -0
- package/dist/fe/components/DatePicker/theme/index.js +315 -0
- package/dist/fe/components/DatePicker/types/index.js +1 -0
- package/dist/fe/components/DatePicker/utils/cn.js +5 -0
- package/dist/fe/components/DatePicker/utils/date.js +132 -0
- package/dist/fe/components/DevicesPage/components/DeviceCard.js +251 -0
- package/dist/fe/components/DevicesPage/components/DevicesHeader.js +42 -0
- package/dist/fe/components/DevicesPage/components/DevicesPage.js +450 -0
- package/dist/fe/components/DevicesPage/index.js +5 -0
- package/dist/fe/components/DevicesPage/store/index.js +55 -0
- package/dist/fe/components/DevicesPage/theme/index.js +131 -0
- package/dist/fe/components/DevicesPage/types/index.js +1 -0
- package/dist/fe/components/ForgotPasswordPage/components/ForgotPasswordForm.js +214 -0
- package/dist/fe/components/ForgotPasswordPage/components/ForgotPasswordHeader.js +42 -0
- package/dist/fe/components/ForgotPasswordPage/components/ForgotPasswordPage.js +59 -0
- package/dist/fe/components/ForgotPasswordPage/index.js +5 -0
- package/dist/fe/components/ForgotPasswordPage/store/index.js +28 -0
- package/dist/fe/components/ForgotPasswordPage/theme/index.js +87 -0
- package/dist/fe/components/ForgotPasswordPage/types/index.js +1 -0
- package/dist/fe/components/FormBuilder/components/FormBuilder.js +156 -0
- package/dist/fe/components/FormBuilder/components/FormField.js +218 -0
- package/dist/fe/components/FormBuilder/hooks/useFormBuilder.js +152 -0
- package/dist/fe/components/FormBuilder/index.js +4 -0
- package/dist/fe/components/FormBuilder/theme/index.js +134 -0
- package/dist/fe/components/FormBuilder/types/index.js +1 -0
- package/dist/fe/components/FormBuilder/utils/cn.js +5 -0
- package/dist/fe/components/FormBuilder/utils/fieldMapping.js +216 -0
- package/dist/fe/components/FormBuilder/utils/validation.js +78 -0
- package/dist/fe/components/LoginPage/components/LoginForm.js +214 -0
- package/dist/fe/components/LoginPage/components/LoginHeader.js +24 -0
- package/dist/fe/components/LoginPage/components/LoginPage.js +138 -0
- package/dist/fe/components/LoginPage/index.js +5 -0
- package/dist/fe/components/LoginPage/store/index.js +59 -0
- package/dist/fe/components/LoginPage/theme/index.js +98 -0
- package/dist/fe/components/LoginPage/types/index.js +1 -0
- package/dist/fe/components/MagicLinkVerifyPage/components/MagicLinkVerifyPage.js +200 -0
- package/dist/fe/components/MagicLinkVerifyPage/index.js +3 -0
- package/dist/fe/components/MagicLinkVerifyPage/store.js +20 -0
- package/dist/fe/components/MagicLinkVerifyPage/theme.js +36 -0
- package/dist/fe/components/MagicLinkVerifyPage/types.js +1 -0
- package/dist/fe/components/NucleusEntityShowcase.js +1409 -0
- package/dist/fe/components/NucleusTextInput/components/FloatingLabel.js +56 -0
- package/dist/fe/components/NucleusTextInput/components/InputIcons.js +258 -0
- package/dist/fe/components/NucleusTextInput/components/NucleusTextInput.js +321 -0
- package/dist/fe/components/NucleusTextInput/components/PasswordStrengthIndicator.js +104 -0
- package/dist/fe/components/NucleusTextInput/components/TypewriterText.js +56 -0
- package/dist/fe/components/NucleusTextInput/index.js +7 -0
- package/dist/fe/components/NucleusTextInput/theme/index.js +121 -0
- package/dist/fe/components/NucleusTextInput/types/index.js +1 -0
- package/dist/fe/components/NucleusTextInput/utils/cn.js +5 -0
- package/dist/fe/components/NucleusTextInput/utils/format.js +62 -0
- package/dist/fe/components/NucleusTextInput/utils/validation.js +191 -0
- package/dist/fe/components/ProfilePage/components/AddressCard.js +196 -0
- package/dist/fe/components/ProfilePage/components/PhoneCard.js +206 -0
- package/dist/fe/components/ProfilePage/components/ProfileHeader.js +150 -0
- package/dist/fe/components/ProfilePage/components/ProfilePage.js +1336 -0
- package/dist/fe/components/ProfilePage/index.js +6 -0
- package/dist/fe/components/ProfilePage/store/index.js +115 -0
- package/dist/fe/components/ProfilePage/theme/index.js +168 -0
- package/dist/fe/components/ProfilePage/types/index.js +1 -0
- package/dist/fe/components/RangePicker/components/RangePicker.js +338 -0
- package/dist/fe/components/RangePicker/components/RangeThumb.js +68 -0
- package/dist/fe/components/RangePicker/components/RangeTooltip.js +45 -0
- package/dist/fe/components/RangePicker/components/RangeTrack.js +32 -0
- package/dist/fe/components/RangePicker/index.js +5 -0
- package/dist/fe/components/RangePicker/theme/index.js +88 -0
- package/dist/fe/components/RangePicker/types/index.js +1 -0
- package/dist/fe/components/RangePicker/utils/cn.js +3 -0
- package/dist/fe/components/RegisterPage/components/PasswordStrengthIndicator.js +107 -0
- package/dist/fe/components/RegisterPage/components/RegisterForm.js +322 -0
- package/dist/fe/components/RegisterPage/components/RegisterHeader.js +23 -0
- package/dist/fe/components/RegisterPage/components/RegisterPage.js +85 -0
- package/dist/fe/components/RegisterPage/index.js +6 -0
- package/dist/fe/components/RegisterPage/store/index.js +106 -0
- package/dist/fe/components/RegisterPage/theme/index.js +128 -0
- package/dist/fe/components/RegisterPage/types/index.js +1 -0
- package/dist/fe/components/ResetPasswordPage/components/ResetPasswordForm.js +347 -0
- package/dist/fe/components/ResetPasswordPage/components/ResetPasswordHeader.js +42 -0
- package/dist/fe/components/ResetPasswordPage/components/ResetPasswordPage.js +61 -0
- package/dist/fe/components/ResetPasswordPage/index.js +5 -0
- package/dist/fe/components/ResetPasswordPage/store/index.js +36 -0
- package/dist/fe/components/ResetPasswordPage/theme/index.js +99 -0
- package/dist/fe/components/ResetPasswordPage/types/index.js +1 -0
- package/dist/fe/components/SearchBox/components/SearchBox.js +271 -0
- package/dist/fe/components/SearchBox/components/SearchBoxDropdown.js +87 -0
- package/dist/fe/components/SearchBox/index.js +5 -0
- package/dist/fe/components/SearchBox/theme/index.js +184 -0
- package/dist/fe/components/SearchBox/types/index.js +1 -0
- package/dist/fe/components/SearchBox/utils/cn.js +5 -0
- package/dist/fe/components/SearchBox/utils/debounce.js +22 -0
- package/dist/fe/components/SearchBox/utils/sanitize.js +48 -0
- package/dist/fe/components/SelectBox/components/SelectBox.js +364 -0
- package/dist/fe/components/SelectBox/components/SelectDropdown.js +92 -0
- package/dist/fe/components/SelectBox/components/SelectOptionItem.js +43 -0
- package/dist/fe/components/SelectBox/components/SelectTrigger.js +22 -0
- package/dist/fe/components/SelectBox/index.js +5 -0
- package/dist/fe/components/SelectBox/theme/index.js +98 -0
- package/dist/fe/components/SelectBox/types/index.js +1 -0
- package/dist/fe/components/SelectBox/utils/cn.js +3 -0
- package/dist/fe/components/SetPasswordPage/components/PasswordStrengthIndicator.js +107 -0
- package/dist/fe/components/SetPasswordPage/components/SetPasswordForm.js +142 -0
- package/dist/fe/components/SetPasswordPage/components/SetPasswordHeader.js +23 -0
- package/dist/fe/components/SetPasswordPage/components/SetPasswordPage.js +263 -0
- package/dist/fe/components/SetPasswordPage/index.js +7 -0
- package/dist/fe/components/SetPasswordPage/store/index.js +79 -0
- package/dist/fe/components/SetPasswordPage/theme/index.js +98 -0
- package/dist/fe/components/SetPasswordPage/types/index.js +12 -0
- package/dist/fe/components/UsersPage/components/InviteUserModal.js +262 -0
- package/dist/fe/components/UsersPage/components/Pagination.js +147 -0
- package/dist/fe/components/UsersPage/components/RoleAssignmentModal.js +186 -0
- package/dist/fe/components/UsersPage/components/StatsCards.js +124 -0
- package/dist/fe/components/UsersPage/components/UserDetailDrawer.js +444 -0
- package/dist/fe/components/UsersPage/components/UserFilters.js +142 -0
- package/dist/fe/components/UsersPage/components/UserListItem.js +125 -0
- package/dist/fe/components/UsersPage/components/UserListSkeleton.js +40 -0
- package/dist/fe/components/UsersPage/components/UsersPage.js +556 -0
- package/dist/fe/components/UsersPage/index.js +10 -0
- package/dist/fe/components/UsersPage/store/index.js +151 -0
- package/dist/fe/components/UsersPage/theme/index.js +231 -0
- package/dist/fe/components/UsersPage/types/index.js +1 -0
- package/dist/fe/components/VerifyEmailPage/components/VerifyEmailPage.js +290 -0
- package/dist/fe/components/VerifyEmailPage/index.js +3 -0
- package/dist/fe/components/VerifyEmailPage/store/index.js +45 -0
- package/dist/fe/components/VerifyEmailPage/theme/index.js +52 -0
- package/dist/fe/components/VerifyEmailPage/types/index.js +1 -0
- package/dist/fe/hooks/useNucleusEntity.js +247 -0
- package/dist/fe/index.js +28 -157
- package/dist/fe/types/index.js +1 -0
- package/dist/fe/utils/cn.js +5 -0
- package/dist/fe/utils/columnUtils.js +189 -0
- package/dist/fe/utils/endpointKeys.js +44 -0
- package/dist/index.js +1 -1
- package/dist/src/Client/Proxy/httpProxy.js +1 -0
- package/dist/src/Client/Proxy/index.js +1 -1
- package/dist/src/Client/Proxy/server.js +1 -0
- package/dist/src/Client/Proxy/types.js +1 -0
- package/dist/src/Client/Proxy/utils.js +1 -0
- package/dist/src/Client/Proxy/wsProxy.js +1 -0
- package/package.json +1 -1
- package/scripts/build.ts +32 -16
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
export const authorizationPageTheme = {
|
|
2
|
+
container: "min-h-screen bg-zinc-50 dark:bg-zinc-950 p-4 sm:p-6",
|
|
3
|
+
header: {
|
|
4
|
+
wrapper: "mb-6 sm:mb-8",
|
|
5
|
+
title: "text-2xl sm:text-3xl font-bold text-zinc-900 dark:text-zinc-100",
|
|
6
|
+
subtitle: "text-sm sm:text-base text-zinc-500 dark:text-zinc-400 mt-1"
|
|
7
|
+
},
|
|
8
|
+
tabs: {
|
|
9
|
+
wrapper: "flex gap-2 sm:gap-4 mb-4 sm:mb-6",
|
|
10
|
+
button: "px-3 sm:px-4 py-2 rounded-lg font-medium transition-colors text-sm sm:text-base",
|
|
11
|
+
buttonActive: "bg-blue-600 text-white",
|
|
12
|
+
buttonInactive: "bg-zinc-200 dark:bg-zinc-800 text-zinc-700 dark:text-zinc-300 hover:bg-zinc-300 dark:hover:bg-zinc-700"
|
|
13
|
+
},
|
|
14
|
+
filters: {
|
|
15
|
+
wrapper: "mb-4 sm:mb-6 md:mb-6 lg:mb-8 xl:mb-8 2xl:mb-10",
|
|
16
|
+
row: "grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 2xl:grid-cols-8",
|
|
17
|
+
control: "flex flex-col justify-end",
|
|
18
|
+
search: "sm:col-span-2 md:col-span-2 lg:col-span-2 xl:col-span-3 2xl:col-span-4",
|
|
19
|
+
searchContainer: "w-full",
|
|
20
|
+
searchInput: "text-sm sm:text-sm md:text-sm lg:text-sm xl:text-base 2xl:text-base",
|
|
21
|
+
toggle: "items-start sm:items-end"
|
|
22
|
+
},
|
|
23
|
+
card: {
|
|
24
|
+
wrapper: "bg-white dark:bg-zinc-900 rounded-xl shadow-sm border border-zinc-200 dark:border-zinc-800 p-4 sm:p-6",
|
|
25
|
+
header: "text-lg sm:text-xl font-semibold text-zinc-900 dark:text-zinc-100 mb-4"
|
|
26
|
+
},
|
|
27
|
+
roleList: {
|
|
28
|
+
wrapper: "space-y-2",
|
|
29
|
+
item: "w-full text-left p-3 sm:p-4 rounded-lg cursor-pointer transition-colors border",
|
|
30
|
+
itemSelected: "bg-blue-50 dark:bg-blue-900/20 border-2 border-blue-500",
|
|
31
|
+
itemHover: "bg-zinc-50 dark:bg-zinc-800 border-zinc-200 dark:border-zinc-700 hover:border-blue-300 dark:hover:border-blue-700",
|
|
32
|
+
name: "font-medium text-zinc-900 dark:text-zinc-100",
|
|
33
|
+
description: "text-sm text-zinc-500 dark:text-zinc-400 mt-1",
|
|
34
|
+
badge: "ml-2 px-2 py-0.5 text-xs bg-purple-100 dark:bg-purple-900 text-purple-700 dark:text-purple-300 rounded-full",
|
|
35
|
+
deleteButton: "p-2 text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors"
|
|
36
|
+
},
|
|
37
|
+
claimList: {
|
|
38
|
+
wrapper: "space-y-4",
|
|
39
|
+
group: "border border-zinc-200 dark:border-zinc-700 rounded-lg overflow-hidden",
|
|
40
|
+
groupHeader: "bg-zinc-100 dark:bg-zinc-800 px-3 sm:px-4 py-2 font-medium text-zinc-700 dark:text-zinc-300 capitalize text-sm sm:text-base",
|
|
41
|
+
item: "px-3 sm:px-4 py-2",
|
|
42
|
+
itemAction: "text-sm font-mono text-zinc-900 dark:text-zinc-100 truncate",
|
|
43
|
+
itemDescription: "text-xs text-zinc-500 dark:text-zinc-400",
|
|
44
|
+
methodBadge: {
|
|
45
|
+
get: "bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-300",
|
|
46
|
+
post: "bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300",
|
|
47
|
+
put: "bg-yellow-100 text-yellow-700 dark:bg-yellow-900 dark:text-yellow-300",
|
|
48
|
+
patch: "bg-yellow-100 text-yellow-700 dark:bg-yellow-900 dark:text-yellow-300",
|
|
49
|
+
delete: "bg-red-100 text-red-700 dark:bg-red-900 dark:text-red-300"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
form: {
|
|
53
|
+
wrapper: "mb-4 sm:mb-6 p-3 sm:p-4 bg-zinc-50 dark:bg-zinc-800 rounded-lg",
|
|
54
|
+
title: "text-sm font-medium text-zinc-700 dark:text-zinc-300 mb-3",
|
|
55
|
+
input: "w-full px-3 py-2 rounded-lg border border-zinc-300 dark:border-zinc-600 bg-white dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm sm:text-base",
|
|
56
|
+
button: "w-full px-4 py-2 bg-blue-600 text-white rounded-lg font-medium hover:bg-blue-700 transition-colors text-sm sm:text-base",
|
|
57
|
+
buttonDisabled: "opacity-50 cursor-not-allowed"
|
|
58
|
+
},
|
|
59
|
+
search: {
|
|
60
|
+
input: "w-full px-3 py-2 rounded-lg border border-zinc-300 dark:border-zinc-600 bg-white dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm sm:text-base mb-4"
|
|
61
|
+
},
|
|
62
|
+
checkbox: {
|
|
63
|
+
wrapper: "flex items-center gap-3 px-3 sm:px-4 py-2 hover:bg-zinc-50 dark:hover:bg-zinc-800 cursor-pointer",
|
|
64
|
+
input: "w-4 h-4 text-blue-600 rounded border-zinc-300 dark:border-zinc-600 focus:ring-blue-500",
|
|
65
|
+
label: "flex-1 min-w-0"
|
|
66
|
+
},
|
|
67
|
+
empty: {
|
|
68
|
+
wrapper: "text-center py-6 sm:py-8",
|
|
69
|
+
icon: "w-10 h-10 sm:w-12 sm:h-12 mx-auto text-purple-500 mb-2",
|
|
70
|
+
text: "text-zinc-600 dark:text-zinc-400"
|
|
71
|
+
},
|
|
72
|
+
loading: {
|
|
73
|
+
wrapper: "text-center py-6 sm:py-8",
|
|
74
|
+
text: "text-zinc-500 text-sm sm:text-base"
|
|
75
|
+
},
|
|
76
|
+
stats: {
|
|
77
|
+
text: "text-sm text-zinc-500 dark:text-zinc-400 mb-4"
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
export function extendAuthorizationPageTheme(overrides) {
|
|
81
|
+
return {
|
|
82
|
+
...authorizationPageTheme,
|
|
83
|
+
...overrides,
|
|
84
|
+
header: {
|
|
85
|
+
...authorizationPageTheme.header,
|
|
86
|
+
...overrides.header
|
|
87
|
+
},
|
|
88
|
+
tabs: {
|
|
89
|
+
...authorizationPageTheme.tabs,
|
|
90
|
+
...overrides.tabs
|
|
91
|
+
},
|
|
92
|
+
filters: {
|
|
93
|
+
...authorizationPageTheme.filters,
|
|
94
|
+
...overrides.filters
|
|
95
|
+
},
|
|
96
|
+
card: {
|
|
97
|
+
...authorizationPageTheme.card,
|
|
98
|
+
...overrides.card
|
|
99
|
+
},
|
|
100
|
+
roleList: {
|
|
101
|
+
...authorizationPageTheme.roleList,
|
|
102
|
+
...overrides.roleList
|
|
103
|
+
},
|
|
104
|
+
claimList: {
|
|
105
|
+
...authorizationPageTheme.claimList,
|
|
106
|
+
...overrides.claimList,
|
|
107
|
+
methodBadge: {
|
|
108
|
+
...authorizationPageTheme.claimList.methodBadge,
|
|
109
|
+
...overrides.claimList?.methodBadge
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
form: {
|
|
113
|
+
...authorizationPageTheme.form,
|
|
114
|
+
...overrides.form
|
|
115
|
+
},
|
|
116
|
+
search: {
|
|
117
|
+
...authorizationPageTheme.search,
|
|
118
|
+
...overrides.search
|
|
119
|
+
},
|
|
120
|
+
checkbox: {
|
|
121
|
+
...authorizationPageTheme.checkbox,
|
|
122
|
+
...overrides.checkbox
|
|
123
|
+
},
|
|
124
|
+
empty: {
|
|
125
|
+
...authorizationPageTheme.empty,
|
|
126
|
+
...overrides.empty
|
|
127
|
+
},
|
|
128
|
+
loading: {
|
|
129
|
+
...authorizationPageTheme.loading,
|
|
130
|
+
...overrides.loading
|
|
131
|
+
},
|
|
132
|
+
stats: {
|
|
133
|
+
...authorizationPageTheme.stats,
|
|
134
|
+
...overrides.stats
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useGSAP } from "@gsap/react";
|
|
4
|
+
import gsap from "gsap";
|
|
5
|
+
import { forwardRef, useLayoutEffect, useRef, useState } from "react";
|
|
6
|
+
import { buttonTheme } from "../theme";
|
|
7
|
+
import { cn } from "../utils/cn";
|
|
8
|
+
gsap.registerPlugin(useGSAP);
|
|
9
|
+
export const Button = /*#__PURE__*/ forwardRef(({ children, variant = "nucleus", size = "md", shape = "default", loading = false, disabled = false, fullWidth = false, leftIcon, rightIcon, iconOnly = false, ripple = true, pulse = false, className, onClick, onMouseEnter, onMouseLeave, ...props }, ref)=>{
|
|
10
|
+
const buttonRef = useRef(null);
|
|
11
|
+
const rippleContainerRef = useRef(null);
|
|
12
|
+
const contentRef = useRef(null);
|
|
13
|
+
const [buttonWidth, setButtonWidth] = useState(undefined);
|
|
14
|
+
const theme = buttonTheme;
|
|
15
|
+
const isDisabled = disabled || loading;
|
|
16
|
+
useLayoutEffect(()=>{
|
|
17
|
+
if (loading && buttonRef.current && !buttonWidth) {
|
|
18
|
+
setButtonWidth(buttonRef.current.offsetWidth);
|
|
19
|
+
}
|
|
20
|
+
if (!loading && buttonWidth) {
|
|
21
|
+
setButtonWidth(undefined);
|
|
22
|
+
}
|
|
23
|
+
}, [
|
|
24
|
+
loading,
|
|
25
|
+
buttonWidth
|
|
26
|
+
]);
|
|
27
|
+
const { contextSafe } = useGSAP({
|
|
28
|
+
scope: buttonRef
|
|
29
|
+
});
|
|
30
|
+
const handleClick = contextSafe((e)=>{
|
|
31
|
+
if (isDisabled) return;
|
|
32
|
+
if (ripple && rippleContainerRef.current && buttonRef.current) {
|
|
33
|
+
const rect = buttonRef.current.getBoundingClientRect();
|
|
34
|
+
const x = e.clientX - rect.left;
|
|
35
|
+
const y = e.clientY - rect.top;
|
|
36
|
+
const size = Math.max(rect.width, rect.height) * 2;
|
|
37
|
+
const rippleEl = document.createElement("span");
|
|
38
|
+
rippleEl.className = theme.ripple.base;
|
|
39
|
+
rippleEl.style.width = `${size}px`;
|
|
40
|
+
rippleEl.style.height = `${size}px`;
|
|
41
|
+
rippleEl.style.left = `${x - size / 2}px`;
|
|
42
|
+
rippleEl.style.top = `${y - size / 2}px`;
|
|
43
|
+
rippleContainerRef.current.appendChild(rippleEl);
|
|
44
|
+
gsap.fromTo(rippleEl, {
|
|
45
|
+
scale: 0,
|
|
46
|
+
opacity: 0.6
|
|
47
|
+
}, {
|
|
48
|
+
scale: 1,
|
|
49
|
+
opacity: 0,
|
|
50
|
+
duration: 0.6,
|
|
51
|
+
ease: "power2.out",
|
|
52
|
+
onComplete: ()=>{
|
|
53
|
+
rippleEl.remove();
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
if (contentRef.current) {
|
|
58
|
+
gsap.to(contentRef.current, {
|
|
59
|
+
scale: 0.95,
|
|
60
|
+
duration: 0.1,
|
|
61
|
+
ease: "power2.out",
|
|
62
|
+
onComplete: ()=>{
|
|
63
|
+
gsap.to(contentRef.current, {
|
|
64
|
+
scale: 1,
|
|
65
|
+
duration: 0.2,
|
|
66
|
+
ease: "elastic.out(1, 0.5)"
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
onClick?.(e);
|
|
72
|
+
});
|
|
73
|
+
const handleMouseEnter = contextSafe((e)=>{
|
|
74
|
+
if (isDisabled) return;
|
|
75
|
+
onMouseEnter?.(e);
|
|
76
|
+
});
|
|
77
|
+
const handleMouseLeave = contextSafe((e)=>{
|
|
78
|
+
onMouseLeave?.(e);
|
|
79
|
+
});
|
|
80
|
+
const variantStyles = theme.variant[variant];
|
|
81
|
+
const renderIcon = (icon, position)=>{
|
|
82
|
+
if (!icon) return null;
|
|
83
|
+
return /*#__PURE__*/ _jsx("span", {
|
|
84
|
+
className: cn("inline-flex items-center justify-center shrink-0", theme.size[size].iconSize, loading && position === "left" && "opacity-0"),
|
|
85
|
+
children: icon
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
return /*#__PURE__*/ _jsxs("button", {
|
|
89
|
+
ref: (node)=>{
|
|
90
|
+
buttonRef.current = node;
|
|
91
|
+
if (typeof ref === "function") {
|
|
92
|
+
ref(node);
|
|
93
|
+
} else if (ref) {
|
|
94
|
+
ref.current = node;
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
type: "button",
|
|
98
|
+
disabled: isDisabled,
|
|
99
|
+
"aria-disabled": isDisabled,
|
|
100
|
+
"aria-busy": loading,
|
|
101
|
+
onClick: handleClick,
|
|
102
|
+
onMouseEnter: handleMouseEnter,
|
|
103
|
+
onMouseLeave: handleMouseLeave,
|
|
104
|
+
className: cn(theme.base, theme.font.weight, theme.font.family, theme.transition, theme.focus, theme.disabled.opacity, theme.disabled.cursor, theme.shape[shape], iconOnly ? theme.iconOnly[size] : cn(theme.size[size].padding, theme.size[size].height), theme.size[size].text, theme.size[size].gap, variantStyles.background, variantStyles.text, variantStyles.border, variantStyles.shadow, !isDisabled && variantStyles.hover, !isDisabled && variantStyles.active, fullWidth && theme.fullWidth, pulse && !loading && theme.pulse.animation, className),
|
|
105
|
+
style: buttonWidth ? {
|
|
106
|
+
width: buttonWidth
|
|
107
|
+
} : undefined,
|
|
108
|
+
...props,
|
|
109
|
+
children: [
|
|
110
|
+
/*#__PURE__*/ _jsx("span", {
|
|
111
|
+
ref: rippleContainerRef,
|
|
112
|
+
className: "absolute inset-0 overflow-hidden rounded-[inherit] pointer-events-none",
|
|
113
|
+
"aria-hidden": "true"
|
|
114
|
+
}),
|
|
115
|
+
/*#__PURE__*/ _jsxs("span", {
|
|
116
|
+
ref: contentRef,
|
|
117
|
+
className: cn("relative inline-flex items-center justify-center z-10", theme.size[size].gap),
|
|
118
|
+
children: [
|
|
119
|
+
loading && /*#__PURE__*/ _jsx("span", {
|
|
120
|
+
className: "absolute inset-0 flex items-center justify-center",
|
|
121
|
+
"aria-hidden": "true",
|
|
122
|
+
children: /*#__PURE__*/ _jsxs("svg", {
|
|
123
|
+
className: cn("animate-spin", theme.size[size].iconSize),
|
|
124
|
+
viewBox: "0 0 24 24",
|
|
125
|
+
fill: "none",
|
|
126
|
+
"aria-hidden": "true",
|
|
127
|
+
children: [
|
|
128
|
+
/*#__PURE__*/ _jsx("circle", {
|
|
129
|
+
className: "opacity-25",
|
|
130
|
+
cx: "12",
|
|
131
|
+
cy: "12",
|
|
132
|
+
r: "10",
|
|
133
|
+
stroke: "currentColor",
|
|
134
|
+
strokeWidth: "4"
|
|
135
|
+
}),
|
|
136
|
+
/*#__PURE__*/ _jsx("path", {
|
|
137
|
+
className: "opacity-75",
|
|
138
|
+
fill: "currentColor",
|
|
139
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
140
|
+
})
|
|
141
|
+
]
|
|
142
|
+
})
|
|
143
|
+
}),
|
|
144
|
+
/*#__PURE__*/ _jsxs("span", {
|
|
145
|
+
className: cn("inline-flex items-center", theme.size[size].gap, loading && "invisible"),
|
|
146
|
+
"aria-hidden": loading,
|
|
147
|
+
children: [
|
|
148
|
+
renderIcon(leftIcon, "left"),
|
|
149
|
+
children,
|
|
150
|
+
renderIcon(rightIcon, "right")
|
|
151
|
+
]
|
|
152
|
+
})
|
|
153
|
+
]
|
|
154
|
+
})
|
|
155
|
+
]
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
Button.displayName = "Button";
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useGSAP } from "@gsap/react";
|
|
4
|
+
import gsap from "gsap";
|
|
5
|
+
import { useRef } from "react";
|
|
6
|
+
import { buttonTheme } from "../theme";
|
|
7
|
+
import { cn } from "../utils/cn";
|
|
8
|
+
gsap.registerPlugin(useGSAP);
|
|
9
|
+
export function ButtonSpinner({ size }) {
|
|
10
|
+
const spinnerRef = useRef(null);
|
|
11
|
+
const circleRef = useRef(null);
|
|
12
|
+
const theme = buttonTheme;
|
|
13
|
+
useGSAP(()=>{
|
|
14
|
+
if (!spinnerRef.current || !circleRef.current) return;
|
|
15
|
+
gsap.to(spinnerRef.current, {
|
|
16
|
+
rotate: 360,
|
|
17
|
+
duration: 1,
|
|
18
|
+
repeat: -1,
|
|
19
|
+
ease: "linear"
|
|
20
|
+
});
|
|
21
|
+
const circumference = 2 * Math.PI * 10;
|
|
22
|
+
gsap.set(circleRef.current, {
|
|
23
|
+
strokeDasharray: circumference,
|
|
24
|
+
strokeDashoffset: circumference * 0.75
|
|
25
|
+
});
|
|
26
|
+
gsap.to(circleRef.current, {
|
|
27
|
+
strokeDashoffset: circumference * 0.25,
|
|
28
|
+
duration: 1.5,
|
|
29
|
+
repeat: -1,
|
|
30
|
+
yoyo: true,
|
|
31
|
+
ease: "power2.inOut"
|
|
32
|
+
});
|
|
33
|
+
}, []);
|
|
34
|
+
return /*#__PURE__*/ _jsx("svg", {
|
|
35
|
+
ref: spinnerRef,
|
|
36
|
+
viewBox: "0 0 24 24",
|
|
37
|
+
fill: "none",
|
|
38
|
+
className: cn(theme.spinner.size[size]),
|
|
39
|
+
"aria-hidden": "true",
|
|
40
|
+
children: /*#__PURE__*/ _jsx("circle", {
|
|
41
|
+
ref: circleRef,
|
|
42
|
+
cx: "12",
|
|
43
|
+
cy: "12",
|
|
44
|
+
r: "10",
|
|
45
|
+
stroke: "currentColor",
|
|
46
|
+
strokeWidth: "3",
|
|
47
|
+
strokeLinecap: "round",
|
|
48
|
+
fill: "none",
|
|
49
|
+
opacity: "0.9"
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
export const buttonTheme = {
|
|
2
|
+
base: "relative inline-flex items-center justify-center overflow-hidden select-none",
|
|
3
|
+
display: "inline-flex",
|
|
4
|
+
alignment: "items-center justify-center",
|
|
5
|
+
font: {
|
|
6
|
+
weight: "font-semibold",
|
|
7
|
+
family: "font-sans"
|
|
8
|
+
},
|
|
9
|
+
transition: "transition-all duration-200 ease-out",
|
|
10
|
+
focus: "focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-violet-500 dark:focus-visible:ring-offset-gray-900",
|
|
11
|
+
disabled: {
|
|
12
|
+
opacity: "disabled:opacity-50",
|
|
13
|
+
cursor: "disabled:cursor-not-allowed disabled:pointer-events-none"
|
|
14
|
+
},
|
|
15
|
+
fullWidth: "w-full",
|
|
16
|
+
size: {
|
|
17
|
+
xs: {
|
|
18
|
+
padding: "px-2.5 py-1",
|
|
19
|
+
text: "text-xs",
|
|
20
|
+
height: "h-7",
|
|
21
|
+
iconSize: "w-3 h-3",
|
|
22
|
+
gap: "gap-1"
|
|
23
|
+
},
|
|
24
|
+
sm: {
|
|
25
|
+
padding: "px-3 py-1.5",
|
|
26
|
+
text: "text-sm",
|
|
27
|
+
height: "h-8",
|
|
28
|
+
iconSize: "w-3.5 h-3.5",
|
|
29
|
+
gap: "gap-1.5"
|
|
30
|
+
},
|
|
31
|
+
md: {
|
|
32
|
+
padding: "px-4 py-2",
|
|
33
|
+
text: "text-sm",
|
|
34
|
+
height: "h-10",
|
|
35
|
+
iconSize: "w-4 h-4",
|
|
36
|
+
gap: "gap-2"
|
|
37
|
+
},
|
|
38
|
+
lg: {
|
|
39
|
+
padding: "px-5 py-2.5",
|
|
40
|
+
text: "text-base",
|
|
41
|
+
height: "h-12",
|
|
42
|
+
iconSize: "w-5 h-5",
|
|
43
|
+
gap: "gap-2.5"
|
|
44
|
+
},
|
|
45
|
+
xl: {
|
|
46
|
+
padding: "px-6 py-3",
|
|
47
|
+
text: "text-lg",
|
|
48
|
+
height: "h-14",
|
|
49
|
+
iconSize: "w-6 h-6",
|
|
50
|
+
gap: "gap-3"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
shape: {
|
|
54
|
+
default: "rounded-lg",
|
|
55
|
+
rounded: "rounded-xl",
|
|
56
|
+
pill: "rounded-full",
|
|
57
|
+
square: "rounded-none"
|
|
58
|
+
},
|
|
59
|
+
iconOnly: {
|
|
60
|
+
xs: "w-7 h-7 p-0",
|
|
61
|
+
sm: "w-8 h-8 p-0",
|
|
62
|
+
md: "w-10 h-10 p-0",
|
|
63
|
+
lg: "w-12 h-12 p-0",
|
|
64
|
+
xl: "w-14 h-14 p-0"
|
|
65
|
+
},
|
|
66
|
+
variant: {
|
|
67
|
+
nucleus: {
|
|
68
|
+
background: "bg-zinc-900 dark:bg-white",
|
|
69
|
+
text: "text-white dark:text-zinc-900",
|
|
70
|
+
border: "border-0",
|
|
71
|
+
shadow: "shadow-sm",
|
|
72
|
+
hover: "hover:bg-zinc-800 dark:hover:bg-zinc-100",
|
|
73
|
+
active: "active:bg-zinc-950 dark:active:bg-zinc-200 active:scale-[0.98]"
|
|
74
|
+
},
|
|
75
|
+
"nucleus-outline": {
|
|
76
|
+
background: "bg-transparent",
|
|
77
|
+
text: "text-zinc-900 dark:text-white",
|
|
78
|
+
border: "border-2 border-zinc-900 dark:border-white",
|
|
79
|
+
shadow: "",
|
|
80
|
+
hover: "hover:bg-zinc-900 hover:text-white dark:hover:bg-white dark:hover:text-zinc-900",
|
|
81
|
+
active: "active:bg-zinc-800 dark:active:bg-zinc-100 active:scale-[0.98]"
|
|
82
|
+
},
|
|
83
|
+
"nucleus-ghost": {
|
|
84
|
+
background: "bg-transparent",
|
|
85
|
+
text: "text-zinc-700 dark:text-zinc-300",
|
|
86
|
+
border: "border-0",
|
|
87
|
+
shadow: "",
|
|
88
|
+
hover: "hover:bg-zinc-100 dark:hover:bg-zinc-800",
|
|
89
|
+
active: "active:bg-zinc-200 dark:active:bg-zinc-700"
|
|
90
|
+
},
|
|
91
|
+
"nucleus-soft": {
|
|
92
|
+
background: "bg-zinc-100 dark:bg-zinc-800",
|
|
93
|
+
text: "text-zinc-900 dark:text-white",
|
|
94
|
+
border: "border-0",
|
|
95
|
+
shadow: "",
|
|
96
|
+
hover: "hover:bg-zinc-200 dark:hover:bg-zinc-700",
|
|
97
|
+
active: "active:bg-zinc-300 dark:active:bg-zinc-600 active:scale-[0.98]"
|
|
98
|
+
},
|
|
99
|
+
primary: {
|
|
100
|
+
background: "bg-blue-600 dark:bg-blue-500",
|
|
101
|
+
text: "text-white",
|
|
102
|
+
border: "border-0",
|
|
103
|
+
shadow: "shadow-md shadow-blue-500/20",
|
|
104
|
+
hover: "hover:bg-blue-500 hover:shadow-lg hover:shadow-blue-500/30 hover:-translate-y-0.5",
|
|
105
|
+
active: "active:bg-blue-700 active:translate-y-0 active:shadow-sm"
|
|
106
|
+
},
|
|
107
|
+
secondary: {
|
|
108
|
+
background: "bg-gray-100 dark:bg-gray-800",
|
|
109
|
+
text: "text-gray-900 dark:text-gray-100",
|
|
110
|
+
border: "border border-gray-200 dark:border-gray-700",
|
|
111
|
+
shadow: "shadow-sm",
|
|
112
|
+
hover: "hover:bg-gray-200 dark:hover:bg-gray-700 hover:shadow-md hover:-translate-y-0.5",
|
|
113
|
+
active: "active:bg-gray-300 dark:active:bg-gray-600 active:translate-y-0"
|
|
114
|
+
},
|
|
115
|
+
success: {
|
|
116
|
+
background: "bg-emerald-600 dark:bg-emerald-500",
|
|
117
|
+
text: "text-white",
|
|
118
|
+
border: "border-0",
|
|
119
|
+
shadow: "shadow-md shadow-emerald-500/20",
|
|
120
|
+
hover: "hover:bg-emerald-500 hover:shadow-lg hover:shadow-emerald-500/30 hover:-translate-y-0.5",
|
|
121
|
+
active: "active:bg-emerald-700 active:translate-y-0 active:shadow-sm"
|
|
122
|
+
},
|
|
123
|
+
warning: {
|
|
124
|
+
background: "bg-amber-500",
|
|
125
|
+
text: "text-white",
|
|
126
|
+
border: "border-0",
|
|
127
|
+
shadow: "shadow-md shadow-amber-500/20",
|
|
128
|
+
hover: "hover:bg-amber-400 hover:shadow-lg hover:shadow-amber-500/30 hover:-translate-y-0.5",
|
|
129
|
+
active: "active:bg-amber-600 active:translate-y-0 active:shadow-sm"
|
|
130
|
+
},
|
|
131
|
+
danger: {
|
|
132
|
+
background: "bg-red-600 dark:bg-red-500",
|
|
133
|
+
text: "text-white",
|
|
134
|
+
border: "border-0",
|
|
135
|
+
shadow: "shadow-md shadow-red-500/20",
|
|
136
|
+
hover: "hover:bg-red-500 hover:shadow-lg hover:shadow-red-500/30 hover:-translate-y-0.5",
|
|
137
|
+
active: "active:bg-red-700 active:translate-y-0 active:shadow-sm"
|
|
138
|
+
},
|
|
139
|
+
ghost: {
|
|
140
|
+
background: "bg-transparent",
|
|
141
|
+
text: "text-gray-700 dark:text-gray-300",
|
|
142
|
+
border: "border-0",
|
|
143
|
+
shadow: "",
|
|
144
|
+
hover: "hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
145
|
+
active: "active:bg-gray-200 dark:active:bg-gray-700"
|
|
146
|
+
},
|
|
147
|
+
outline: {
|
|
148
|
+
background: "bg-transparent",
|
|
149
|
+
text: "text-gray-700 dark:text-gray-300",
|
|
150
|
+
border: "border-2 border-gray-300 dark:border-gray-600",
|
|
151
|
+
shadow: "",
|
|
152
|
+
hover: "hover:bg-gray-100 dark:hover:bg-gray-800 hover:border-gray-400 dark:hover:border-gray-500",
|
|
153
|
+
active: "active:bg-gray-200 dark:active:bg-gray-700"
|
|
154
|
+
},
|
|
155
|
+
link: {
|
|
156
|
+
background: "bg-transparent",
|
|
157
|
+
text: "text-violet-600 dark:text-violet-400",
|
|
158
|
+
border: "border-0",
|
|
159
|
+
shadow: "",
|
|
160
|
+
hover: "hover:underline hover:text-violet-700 dark:hover:text-violet-300",
|
|
161
|
+
active: "active:text-violet-800 dark:active:text-violet-200"
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
spinner: {
|
|
165
|
+
base: "animate-spin",
|
|
166
|
+
size: {
|
|
167
|
+
xs: "w-3 h-3",
|
|
168
|
+
sm: "w-3.5 h-3.5",
|
|
169
|
+
md: "w-4 h-4",
|
|
170
|
+
lg: "w-5 h-5",
|
|
171
|
+
xl: "w-6 h-6"
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
ripple: {
|
|
175
|
+
base: "absolute rounded-full bg-white/30 pointer-events-none"
|
|
176
|
+
},
|
|
177
|
+
pulse: {
|
|
178
|
+
animation: "animate-pulse"
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
export function extendButtonTheme(overrides) {
|
|
182
|
+
return {
|
|
183
|
+
...buttonTheme,
|
|
184
|
+
...overrides
|
|
185
|
+
};
|
|
186
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|