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,315 @@
|
|
|
1
|
+
export const datePickerTheme = {
|
|
2
|
+
container: {
|
|
3
|
+
base: "relative flex flex-col w-full",
|
|
4
|
+
spacing: "gap-1"
|
|
5
|
+
},
|
|
6
|
+
input: {
|
|
7
|
+
wrapper: {
|
|
8
|
+
base: "relative flex items-center w-full cursor-pointer",
|
|
9
|
+
border: {
|
|
10
|
+
base: "border border-gray-300 dark:border-gray-600",
|
|
11
|
+
focused: "border-blue-500 dark:border-blue-400 ring-2 ring-blue-500/20",
|
|
12
|
+
error: "border-red-500 dark:border-red-400",
|
|
13
|
+
disabled: "border-gray-200 dark:border-gray-700 cursor-not-allowed"
|
|
14
|
+
},
|
|
15
|
+
background: {
|
|
16
|
+
light: "bg-white",
|
|
17
|
+
dark: "dark:bg-gray-800"
|
|
18
|
+
},
|
|
19
|
+
padding: "px-4 py-3",
|
|
20
|
+
rounded: "rounded-lg",
|
|
21
|
+
shadow: "shadow-sm",
|
|
22
|
+
transition: "transition-all duration-200 ease-out"
|
|
23
|
+
},
|
|
24
|
+
text: {
|
|
25
|
+
base: "flex-1",
|
|
26
|
+
size: "text-base",
|
|
27
|
+
color: {
|
|
28
|
+
light: "text-gray-900",
|
|
29
|
+
dark: "dark:text-white"
|
|
30
|
+
},
|
|
31
|
+
placeholder: {
|
|
32
|
+
light: "text-gray-400",
|
|
33
|
+
dark: "dark:text-gray-500"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
icon: {
|
|
37
|
+
base: "flex items-center justify-center flex-shrink-0",
|
|
38
|
+
size: "w-5 h-5",
|
|
39
|
+
color: {
|
|
40
|
+
light: "text-gray-400",
|
|
41
|
+
dark: "dark:text-gray-500",
|
|
42
|
+
focused: "text-blue-500 dark:text-blue-400"
|
|
43
|
+
},
|
|
44
|
+
spacing: {
|
|
45
|
+
left: "mr-3",
|
|
46
|
+
right: "ml-3"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
label: {
|
|
51
|
+
base: "block",
|
|
52
|
+
text: {
|
|
53
|
+
size: "text-sm font-medium",
|
|
54
|
+
color: {
|
|
55
|
+
light: "text-gray-700",
|
|
56
|
+
dark: "dark:text-gray-300"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
spacing: "mb-1.5"
|
|
60
|
+
},
|
|
61
|
+
dropdown: {
|
|
62
|
+
base: "absolute left-0 right-0 z-50",
|
|
63
|
+
background: {
|
|
64
|
+
light: "bg-white",
|
|
65
|
+
dark: "dark:bg-gray-800"
|
|
66
|
+
},
|
|
67
|
+
border: {
|
|
68
|
+
light: "border border-gray-200",
|
|
69
|
+
dark: "dark:border-gray-700"
|
|
70
|
+
},
|
|
71
|
+
rounded: "rounded-xl",
|
|
72
|
+
shadow: "shadow-xl",
|
|
73
|
+
padding: "p-4",
|
|
74
|
+
spacing: {
|
|
75
|
+
top: "mb-2",
|
|
76
|
+
bottom: "mt-2"
|
|
77
|
+
},
|
|
78
|
+
position: {
|
|
79
|
+
top: "bottom-full",
|
|
80
|
+
bottom: "top-full"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
calendar: {
|
|
84
|
+
base: "select-none",
|
|
85
|
+
width: "w-72"
|
|
86
|
+
},
|
|
87
|
+
header: {
|
|
88
|
+
base: "flex items-center justify-between",
|
|
89
|
+
padding: "mb-4",
|
|
90
|
+
button: {
|
|
91
|
+
base: "flex items-center justify-center",
|
|
92
|
+
size: "w-8 h-8",
|
|
93
|
+
color: {
|
|
94
|
+
light: "text-gray-600",
|
|
95
|
+
dark: "dark:text-gray-400"
|
|
96
|
+
},
|
|
97
|
+
hover: {
|
|
98
|
+
light: "hover:bg-gray-100",
|
|
99
|
+
dark: "dark:hover:bg-gray-700"
|
|
100
|
+
},
|
|
101
|
+
rounded: "rounded-lg",
|
|
102
|
+
transition: "transition-colors duration-150"
|
|
103
|
+
},
|
|
104
|
+
title: {
|
|
105
|
+
base: "flex items-center justify-center cursor-pointer",
|
|
106
|
+
text: {
|
|
107
|
+
size: "text-base",
|
|
108
|
+
weight: "font-semibold",
|
|
109
|
+
color: {
|
|
110
|
+
light: "text-gray-900",
|
|
111
|
+
dark: "dark:text-white"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
hover: {
|
|
115
|
+
light: "hover:bg-gray-100",
|
|
116
|
+
dark: "dark:hover:bg-gray-700"
|
|
117
|
+
},
|
|
118
|
+
rounded: "rounded-lg",
|
|
119
|
+
padding: "px-3 py-1.5",
|
|
120
|
+
transition: "transition-colors duration-150"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
weekdays: {
|
|
124
|
+
base: "grid grid-cols-7",
|
|
125
|
+
padding: "mb-2",
|
|
126
|
+
text: {
|
|
127
|
+
size: "text-xs",
|
|
128
|
+
weight: "font-medium",
|
|
129
|
+
color: {
|
|
130
|
+
light: "text-gray-500",
|
|
131
|
+
dark: "dark:text-gray-400"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
grid: {
|
|
136
|
+
base: "grid grid-cols-7",
|
|
137
|
+
gap: ""
|
|
138
|
+
},
|
|
139
|
+
dayWrapper: {
|
|
140
|
+
base: "flex items-center justify-center",
|
|
141
|
+
inRange: {
|
|
142
|
+
light: "bg-blue-100",
|
|
143
|
+
dark: "dark:bg-blue-900/40"
|
|
144
|
+
},
|
|
145
|
+
rangeStart: "rounded-l-lg",
|
|
146
|
+
rangeEnd: "rounded-r-lg"
|
|
147
|
+
},
|
|
148
|
+
day: {
|
|
149
|
+
base: "flex items-center justify-center cursor-pointer",
|
|
150
|
+
size: "w-9 h-9",
|
|
151
|
+
text: {
|
|
152
|
+
size: "text-sm",
|
|
153
|
+
color: {
|
|
154
|
+
light: "text-gray-900",
|
|
155
|
+
dark: "dark:text-white"
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
rounded: "rounded-lg",
|
|
159
|
+
transition: "transition-all duration-150",
|
|
160
|
+
states: {
|
|
161
|
+
hover: {
|
|
162
|
+
light: "hover:bg-gray-100",
|
|
163
|
+
dark: "dark:hover:bg-gray-700"
|
|
164
|
+
},
|
|
165
|
+
selected: {
|
|
166
|
+
background: "bg-blue-500 dark:bg-blue-600",
|
|
167
|
+
text: "text-white"
|
|
168
|
+
},
|
|
169
|
+
today: {
|
|
170
|
+
border: "ring-2 ring-blue-500 ring-inset",
|
|
171
|
+
text: "text-blue-600 dark:text-blue-400 font-semibold"
|
|
172
|
+
},
|
|
173
|
+
disabled: {
|
|
174
|
+
opacity: "opacity-30",
|
|
175
|
+
cursor: "cursor-not-allowed"
|
|
176
|
+
},
|
|
177
|
+
inRange: {
|
|
178
|
+
light: "bg-blue-100",
|
|
179
|
+
dark: "dark:bg-blue-900/40"
|
|
180
|
+
},
|
|
181
|
+
rangeStart: {
|
|
182
|
+
rounded: "rounded-l-lg rounded-r-none"
|
|
183
|
+
},
|
|
184
|
+
rangeEnd: {
|
|
185
|
+
rounded: "rounded-r-lg rounded-l-none"
|
|
186
|
+
},
|
|
187
|
+
otherMonth: {
|
|
188
|
+
opacity: "opacity-40"
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
monthSelector: {
|
|
193
|
+
base: "py-2",
|
|
194
|
+
grid: "grid grid-cols-3 gap-2",
|
|
195
|
+
item: {
|
|
196
|
+
base: "flex items-center justify-center cursor-pointer",
|
|
197
|
+
padding: "px-3 py-2",
|
|
198
|
+
rounded: "rounded-lg",
|
|
199
|
+
text: {
|
|
200
|
+
size: "text-sm",
|
|
201
|
+
color: {
|
|
202
|
+
light: "text-gray-900",
|
|
203
|
+
dark: "dark:text-white"
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
hover: {
|
|
207
|
+
light: "hover:bg-gray-100",
|
|
208
|
+
dark: "dark:hover:bg-gray-700"
|
|
209
|
+
},
|
|
210
|
+
selected: {
|
|
211
|
+
background: "bg-blue-500 dark:bg-blue-600",
|
|
212
|
+
text: "text-white"
|
|
213
|
+
},
|
|
214
|
+
transition: "transition-colors duration-150"
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
yearSelector: {
|
|
218
|
+
base: "py-2 max-h-64 overflow-y-auto",
|
|
219
|
+
grid: "grid grid-cols-4 gap-2",
|
|
220
|
+
item: {
|
|
221
|
+
base: "flex items-center justify-center cursor-pointer",
|
|
222
|
+
padding: "px-2 py-2",
|
|
223
|
+
rounded: "rounded-lg",
|
|
224
|
+
text: {
|
|
225
|
+
size: "text-sm",
|
|
226
|
+
color: {
|
|
227
|
+
light: "text-gray-900",
|
|
228
|
+
dark: "dark:text-white"
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
hover: {
|
|
232
|
+
light: "hover:bg-gray-100",
|
|
233
|
+
dark: "dark:hover:bg-gray-700"
|
|
234
|
+
},
|
|
235
|
+
selected: {
|
|
236
|
+
background: "bg-blue-500 dark:bg-blue-600",
|
|
237
|
+
text: "text-white"
|
|
238
|
+
},
|
|
239
|
+
transition: "transition-colors duration-150"
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
footer: {
|
|
243
|
+
base: "flex items-center justify-between",
|
|
244
|
+
padding: "mt-4 pt-4",
|
|
245
|
+
border: {
|
|
246
|
+
light: "border-t border-gray-200",
|
|
247
|
+
dark: "dark:border-gray-700"
|
|
248
|
+
},
|
|
249
|
+
button: {
|
|
250
|
+
base: "flex items-center justify-center",
|
|
251
|
+
padding: "px-4 py-2",
|
|
252
|
+
rounded: "rounded-lg",
|
|
253
|
+
text: {
|
|
254
|
+
size: "text-sm font-medium"
|
|
255
|
+
},
|
|
256
|
+
today: {
|
|
257
|
+
background: {
|
|
258
|
+
light: "bg-blue-50",
|
|
259
|
+
dark: "dark:bg-blue-900/30"
|
|
260
|
+
},
|
|
261
|
+
text: {
|
|
262
|
+
light: "text-blue-600",
|
|
263
|
+
dark: "dark:text-blue-400"
|
|
264
|
+
},
|
|
265
|
+
hover: {
|
|
266
|
+
light: "hover:bg-blue-100",
|
|
267
|
+
dark: "dark:hover:bg-blue-900/50"
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
clear: {
|
|
271
|
+
background: "bg-transparent",
|
|
272
|
+
text: {
|
|
273
|
+
light: "text-gray-600",
|
|
274
|
+
dark: "dark:text-gray-400"
|
|
275
|
+
},
|
|
276
|
+
hover: {
|
|
277
|
+
light: "hover:bg-gray-100",
|
|
278
|
+
dark: "dark:hover:bg-gray-700"
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
transition: "transition-colors duration-150"
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
rangeIndicator: {
|
|
285
|
+
base: "flex items-center justify-center",
|
|
286
|
+
text: {
|
|
287
|
+
size: "text-sm",
|
|
288
|
+
color: {
|
|
289
|
+
light: "text-gray-600",
|
|
290
|
+
dark: "dark:text-gray-400"
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
padding: "py-2 mb-2",
|
|
294
|
+
separator: "mx-2"
|
|
295
|
+
},
|
|
296
|
+
helperText: {
|
|
297
|
+
base: "mt-1",
|
|
298
|
+
text: "text-sm",
|
|
299
|
+
color: {
|
|
300
|
+
light: "text-gray-500",
|
|
301
|
+
dark: "dark:text-gray-400"
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
errorText: {
|
|
305
|
+
base: "mt-1",
|
|
306
|
+
text: "text-sm",
|
|
307
|
+
color: "text-red-500"
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
export function extendDatePickerTheme(overrides) {
|
|
311
|
+
return {
|
|
312
|
+
...datePickerTheme,
|
|
313
|
+
...overrides
|
|
314
|
+
};
|
|
315
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { getLocale } from "../locales";
|
|
2
|
+
export function getMonthDays(year, month) {
|
|
3
|
+
const days = [];
|
|
4
|
+
const firstDay = new Date(year, month, 1);
|
|
5
|
+
const lastDay = new Date(year, month + 1, 0);
|
|
6
|
+
for(let i = 1; i <= lastDay.getDate(); i++){
|
|
7
|
+
days.push(new Date(year, month, i));
|
|
8
|
+
}
|
|
9
|
+
return days;
|
|
10
|
+
}
|
|
11
|
+
export function getCalendarDays(year, month, firstDayOfWeek) {
|
|
12
|
+
const days = [];
|
|
13
|
+
const firstDay = new Date(year, month, 1);
|
|
14
|
+
const lastDay = new Date(year, month + 1, 0);
|
|
15
|
+
let startDay = firstDay.getDay() - firstDayOfWeek;
|
|
16
|
+
if (startDay < 0) startDay += 7;
|
|
17
|
+
for(let i = startDay - 1; i >= 0; i--){
|
|
18
|
+
days.push(new Date(year, month, -i));
|
|
19
|
+
}
|
|
20
|
+
for(let i = 1; i <= lastDay.getDate(); i++){
|
|
21
|
+
days.push(new Date(year, month, i));
|
|
22
|
+
}
|
|
23
|
+
const remainingDays = 42 - days.length;
|
|
24
|
+
for(let i = 1; i <= remainingDays; i++){
|
|
25
|
+
days.push(new Date(year, month + 1, i));
|
|
26
|
+
}
|
|
27
|
+
return days;
|
|
28
|
+
}
|
|
29
|
+
export function isSameDay(date1, date2) {
|
|
30
|
+
if (!date1 || !date2) return false;
|
|
31
|
+
return date1.getFullYear() === date2.getFullYear() && date1.getMonth() === date2.getMonth() && date1.getDate() === date2.getDate();
|
|
32
|
+
}
|
|
33
|
+
export function isSameMonth(date1, date2) {
|
|
34
|
+
return date1.getFullYear() === date2.getFullYear() && date1.getMonth() === date2.getMonth();
|
|
35
|
+
}
|
|
36
|
+
export function isToday(date) {
|
|
37
|
+
return isSameDay(date, new Date());
|
|
38
|
+
}
|
|
39
|
+
export function isDateInRange(date, start, end) {
|
|
40
|
+
if (!start || !end) return false;
|
|
41
|
+
const time = date.getTime();
|
|
42
|
+
return time > start.getTime() && time < end.getTime();
|
|
43
|
+
}
|
|
44
|
+
export function isDateDisabled(date, minDate, maxDate, disabledDates, disabledDaysOfWeek) {
|
|
45
|
+
if (minDate && date < minDate) return true;
|
|
46
|
+
if (maxDate && date > maxDate) return true;
|
|
47
|
+
if (disabledDates) {
|
|
48
|
+
for (const disabledDate of disabledDates){
|
|
49
|
+
if (isSameDay(date, disabledDate)) return true;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (disabledDaysOfWeek && disabledDaysOfWeek.includes(date.getDay())) {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
export function formatDate(date, format) {
|
|
58
|
+
if (!date) return "";
|
|
59
|
+
const day = date.getDate().toString().padStart(2, "0");
|
|
60
|
+
const month = (date.getMonth() + 1).toString().padStart(2, "0");
|
|
61
|
+
const year = date.getFullYear().toString();
|
|
62
|
+
return format.replace("dd", day).replace("MM", month).replace("yyyy", year);
|
|
63
|
+
}
|
|
64
|
+
export function formatDateRange(range, format, separator = " - ") {
|
|
65
|
+
if (!range.start && !range.end) return "";
|
|
66
|
+
if (!range.start) return formatDate(range.end, format);
|
|
67
|
+
if (!range.end) return formatDate(range.start, format);
|
|
68
|
+
return `${formatDate(range.start, format)}${separator}${formatDate(range.end, format)}`;
|
|
69
|
+
}
|
|
70
|
+
export function formatDateWithLocale(date, locale) {
|
|
71
|
+
if (!date) return "";
|
|
72
|
+
const config = getLocale(locale);
|
|
73
|
+
return formatDate(date, config.dateFormat);
|
|
74
|
+
}
|
|
75
|
+
export function formatDateRangeWithLocale(range, locale, separator = " - ") {
|
|
76
|
+
const config = getLocale(locale);
|
|
77
|
+
return formatDateRange(range, config.dateFormat, separator);
|
|
78
|
+
}
|
|
79
|
+
export function addMonths(date, months) {
|
|
80
|
+
const result = new Date(date);
|
|
81
|
+
result.setMonth(result.getMonth() + months);
|
|
82
|
+
return result;
|
|
83
|
+
}
|
|
84
|
+
export function addYears(date, years) {
|
|
85
|
+
const result = new Date(date);
|
|
86
|
+
result.setFullYear(result.getFullYear() + years);
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
89
|
+
export function startOfMonth(date) {
|
|
90
|
+
return new Date(date.getFullYear(), date.getMonth(), 1);
|
|
91
|
+
}
|
|
92
|
+
export function endOfMonth(date) {
|
|
93
|
+
return new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
94
|
+
}
|
|
95
|
+
export function startOfDay(date) {
|
|
96
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
97
|
+
}
|
|
98
|
+
export function getYearRange(centerYear, range = 12) {
|
|
99
|
+
const years = [];
|
|
100
|
+
const startYear = centerYear - Math.floor(range / 2);
|
|
101
|
+
for(let i = 0; i < range; i++){
|
|
102
|
+
years.push(startYear + i);
|
|
103
|
+
}
|
|
104
|
+
return years;
|
|
105
|
+
}
|
|
106
|
+
export function parseDate(dateString, format) {
|
|
107
|
+
if (!dateString) return null;
|
|
108
|
+
try {
|
|
109
|
+
const dayIndex = format.indexOf("dd");
|
|
110
|
+
const monthIndex = format.indexOf("MM");
|
|
111
|
+
const yearIndex = format.indexOf("yyyy");
|
|
112
|
+
const day = Number.parseInt(dateString.slice(dayIndex, dayIndex + 2), 10);
|
|
113
|
+
const month = Number.parseInt(dateString.slice(monthIndex, monthIndex + 2), 10) - 1;
|
|
114
|
+
const year = Number.parseInt(dateString.slice(yearIndex, yearIndex + 4), 10);
|
|
115
|
+
if (Number.isNaN(day) || Number.isNaN(month) || Number.isNaN(year)) {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
return new Date(year, month, day);
|
|
119
|
+
} catch {
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
export function getWeekdaysForLocale(locale, firstDayOfWeek) {
|
|
124
|
+
const config = getLocale(locale);
|
|
125
|
+
const weekdays = [
|
|
126
|
+
...config.weekdaysMin
|
|
127
|
+
];
|
|
128
|
+
for(let i = 0; i < firstDayOfWeek; i++){
|
|
129
|
+
weekdays.push(weekdays.shift());
|
|
130
|
+
}
|
|
131
|
+
return weekdays;
|
|
132
|
+
}
|