@goralys/ui 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +75 -53
- package/dist/index.js +2040 -328
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ type GoralysLink = ComponentType<{
|
|
|
5
5
|
href: string;
|
|
6
6
|
className?: string;
|
|
7
7
|
children: ReactNode;
|
|
8
|
+
prefetch?: boolean;
|
|
8
9
|
}>;
|
|
9
10
|
type GoralysImage = ComponentType<{
|
|
10
11
|
src: string;
|
|
@@ -32,13 +33,14 @@ type GoralysUIConfig = {
|
|
|
32
33
|
useRouter: () => GoralysRouter;
|
|
33
34
|
useSearchParams: () => GoralysSearchParams;
|
|
34
35
|
usePathname: () => string;
|
|
36
|
+
isMobile: boolean;
|
|
35
37
|
};
|
|
36
38
|
|
|
37
|
-
interface Props$
|
|
39
|
+
interface Props$J {
|
|
38
40
|
config: GoralysUIConfig;
|
|
39
41
|
children: ReactNode;
|
|
40
42
|
}
|
|
41
|
-
declare function GoralysUIProvider({ config, children }: Props$
|
|
43
|
+
declare function GoralysUIProvider({ config, children }: Props$J): ReactElement;
|
|
42
44
|
declare function useGoralysUI(): GoralysUIConfig;
|
|
43
45
|
|
|
44
46
|
declare function useMediaQuery(query: string): boolean;
|
|
@@ -54,7 +56,7 @@ declare function useAutoResize(ref: React.Ref<HTMLTextAreaElement> | undefined):
|
|
|
54
56
|
|
|
55
57
|
declare function useModalClose(modalRef: RefObject<HTMLDivElement | null>, visible: boolean, onClose: () => void): void;
|
|
56
58
|
|
|
57
|
-
interface Props$
|
|
59
|
+
interface Props$I {
|
|
58
60
|
className?: string;
|
|
59
61
|
text: string;
|
|
60
62
|
type: "submit" | "button" | "reset";
|
|
@@ -62,83 +64,83 @@ interface Props$H {
|
|
|
62
64
|
color?: "sky" | "red" | "green" | "amber";
|
|
63
65
|
disabled?: boolean;
|
|
64
66
|
}
|
|
65
|
-
declare function Button({ text, type, className, onClick, color, disabled }: Props$
|
|
67
|
+
declare function Button({ text, type, className, onClick, color, disabled }: Props$I): ReactElement;
|
|
66
68
|
|
|
67
|
-
interface Props$
|
|
69
|
+
interface Props$H {
|
|
68
70
|
title: string;
|
|
69
71
|
}
|
|
70
|
-
declare function CardTitle({ title }: Props$
|
|
72
|
+
declare function CardTitle({ title }: Props$H): ReactElement;
|
|
71
73
|
|
|
72
74
|
declare function Card({ children, className }: {
|
|
73
75
|
children: ReactNode;
|
|
74
76
|
className?: string;
|
|
75
77
|
}): ReactElement;
|
|
76
78
|
|
|
77
|
-
interface Props$
|
|
79
|
+
interface Props$G {
|
|
78
80
|
admin: User;
|
|
79
81
|
}
|
|
80
|
-
declare function AdminCard({ admin }: Props$
|
|
82
|
+
declare function AdminCard({ admin }: Props$G): ReactElement;
|
|
81
83
|
|
|
82
|
-
interface Props$
|
|
84
|
+
interface Props$F {
|
|
83
85
|
type: "real" | "virtual";
|
|
84
86
|
admins: User[] | null;
|
|
85
87
|
setCurrentAdminsAction: React.Dispatch<React.SetStateAction<User[] | null>>;
|
|
86
88
|
}
|
|
87
|
-
declare function AdminsSearchBar({ type, admins, setCurrentAdminsAction }: Props$
|
|
89
|
+
declare function AdminsSearchBar({ type, admins, setCurrentAdminsAction }: Props$F): ReactElement;
|
|
88
90
|
|
|
89
|
-
interface Props$
|
|
91
|
+
interface Props$E {
|
|
90
92
|
actions: AuditAction[] | null;
|
|
91
93
|
}
|
|
92
|
-
declare function AuditActionCard({ actions }: Props$
|
|
94
|
+
declare function AuditActionCard({ actions }: Props$E): ReactElement;
|
|
93
95
|
|
|
94
|
-
interface Props$
|
|
96
|
+
interface Props$D {
|
|
95
97
|
publicId: string;
|
|
96
98
|
token: AuthToken;
|
|
97
99
|
onUpdate: () => Promise<void>;
|
|
98
100
|
}
|
|
99
|
-
declare function AuthTokenCard({ publicId, token, onUpdate }: Props$
|
|
101
|
+
declare function AuthTokenCard({ publicId, token, onUpdate }: Props$D): ReactElement;
|
|
100
102
|
|
|
101
|
-
interface Props$
|
|
103
|
+
interface Props$C {
|
|
102
104
|
onUpdateAction: () => void;
|
|
103
105
|
syncKey: string;
|
|
104
106
|
virtualSyncKey: string;
|
|
105
107
|
}
|
|
106
|
-
declare function CreateAdminElement({ onUpdateAction, syncKey, virtualSyncKey }: Props$
|
|
108
|
+
declare function CreateAdminElement({ onUpdateAction, syncKey, virtualSyncKey }: Props$C): ReactElement;
|
|
107
109
|
|
|
108
|
-
interface Props$
|
|
110
|
+
interface Props$B {
|
|
109
111
|
onReplaceAction: (firstName: string, lastName: string) => void;
|
|
110
112
|
dropDown?: boolean;
|
|
111
113
|
}
|
|
112
|
-
declare function ReplaceTeacherElement({ onReplaceAction, dropDown }: Props$
|
|
114
|
+
declare function ReplaceTeacherElement({ onReplaceAction, dropDown }: Props$B): ReactElement;
|
|
113
115
|
|
|
114
|
-
interface Props$
|
|
116
|
+
interface Props$A {
|
|
115
117
|
user: User;
|
|
116
118
|
}
|
|
117
|
-
declare function UserCard({ user }: Props$
|
|
119
|
+
declare function UserCard({ user }: Props$A): ReactElement;
|
|
118
120
|
|
|
119
|
-
interface Props$
|
|
121
|
+
interface Props$z {
|
|
120
122
|
type: "real" | "virtual";
|
|
121
123
|
users: User[] | null;
|
|
122
124
|
setCurrentUsers: React.Dispatch<React.SetStateAction<User[] | null>>;
|
|
123
125
|
}
|
|
124
|
-
declare function UsersSearchBar({ type, users, setCurrentUsers }: Props$
|
|
126
|
+
declare function UsersSearchBar({ type, users, setCurrentUsers }: Props$z): ReactElement;
|
|
125
127
|
|
|
126
|
-
interface Props$
|
|
128
|
+
interface Props$y {
|
|
127
129
|
total: number;
|
|
128
130
|
submitted: number;
|
|
129
131
|
approved: number;
|
|
130
132
|
rejected: number;
|
|
131
133
|
notSubmitted: number;
|
|
132
134
|
}
|
|
133
|
-
declare function StatusLegend({ total, submitted, approved, rejected, notSubmitted }: Props$
|
|
135
|
+
declare function StatusLegend({ total, submitted, approved, rejected, notSubmitted }: Props$y): ReactElement;
|
|
134
136
|
|
|
135
|
-
interface Props$
|
|
137
|
+
interface Props$x {
|
|
136
138
|
status: SubjectStatus | "empty";
|
|
137
139
|
size?: number;
|
|
138
140
|
}
|
|
139
|
-
declare function SubjectStudentsDonut({ status, size }: Props$
|
|
141
|
+
declare function SubjectStudentsDonut({ status, size }: Props$x): ReactElement;
|
|
140
142
|
|
|
141
|
-
interface Props$
|
|
143
|
+
interface Props$w {
|
|
142
144
|
size?: number;
|
|
143
145
|
total: number;
|
|
144
146
|
notSubmitted: number;
|
|
@@ -146,30 +148,30 @@ interface Props$v {
|
|
|
146
148
|
rejected: number;
|
|
147
149
|
approved: number;
|
|
148
150
|
}
|
|
149
|
-
declare function SubjectTeachersDonut({ size, total, notSubmitted, submitted, rejected, approved }: Props$
|
|
151
|
+
declare function SubjectTeachersDonut({ size, total, notSubmitted, submitted, rejected, approved }: Props$w): ReactElement;
|
|
150
152
|
|
|
151
|
-
interface Props$
|
|
153
|
+
interface Props$v {
|
|
152
154
|
subjects: Subject[] | null;
|
|
153
155
|
}
|
|
154
|
-
declare function UserSubjectsStudentCard({ subjects }: Props$
|
|
156
|
+
declare function UserSubjectsStudentCard({ subjects }: Props$v): ReactElement;
|
|
155
157
|
|
|
156
|
-
interface Props$
|
|
158
|
+
interface Props$u {
|
|
157
159
|
subjects: Subject[] | null;
|
|
158
160
|
}
|
|
159
|
-
declare function UserSubjectsTeacherCard({ subjects }: Props$
|
|
161
|
+
declare function UserSubjectsTeacherCard({ subjects }: Props$u): ReactElement;
|
|
160
162
|
|
|
161
163
|
declare function CookieBanner(): ReactElement | null;
|
|
162
164
|
|
|
163
|
-
interface Props$
|
|
165
|
+
interface Props$t {
|
|
164
166
|
label: string | ReactNode;
|
|
165
167
|
children?: ReactNode;
|
|
166
168
|
openDefault?: boolean;
|
|
167
169
|
}
|
|
168
|
-
declare function Dropdown({ label, children, openDefault }: Props$
|
|
170
|
+
declare function Dropdown({ label, children, openDefault }: Props$t): ReactElement;
|
|
169
171
|
|
|
170
172
|
declare function GoralysLogoLoader(): ReactElement;
|
|
171
173
|
|
|
172
|
-
interface Props$
|
|
174
|
+
interface Props$s {
|
|
173
175
|
id?: string;
|
|
174
176
|
label: string;
|
|
175
177
|
setValueAction: (v: boolean) => void;
|
|
@@ -177,9 +179,9 @@ interface Props$r {
|
|
|
177
179
|
className?: string | null;
|
|
178
180
|
disabled?: boolean;
|
|
179
181
|
}
|
|
180
|
-
declare function Checkbox({ id, label, setValueAction, defaultValue, className, disabled }: Props$
|
|
182
|
+
declare function Checkbox({ id, label, setValueAction, defaultValue, className, disabled }: Props$s): ReactElement;
|
|
181
183
|
|
|
182
|
-
interface Props$
|
|
184
|
+
interface Props$r {
|
|
183
185
|
autocomplete?: string;
|
|
184
186
|
disabled?: boolean;
|
|
185
187
|
helper?: string;
|
|
@@ -192,22 +194,22 @@ interface Props$q {
|
|
|
192
194
|
value?: string;
|
|
193
195
|
onInput?: InputEventHandler<HTMLInputElement>;
|
|
194
196
|
}
|
|
195
|
-
declare function FloatingInput({ id, label, helper, autocomplete, password, email, disabled, required, defaultValue, value, onInput, }: Props$
|
|
197
|
+
declare function FloatingInput({ id, label, helper, autocomplete, password, email, disabled, required, defaultValue, value, onInput, }: Props$r): ReactElement;
|
|
196
198
|
|
|
197
|
-
interface Props$
|
|
199
|
+
interface Props$q {
|
|
198
200
|
text: string;
|
|
199
201
|
maxSizeKB: number;
|
|
200
202
|
onFileSelected: CallableFunction;
|
|
201
203
|
}
|
|
202
|
-
declare function InputTextFile({ text, maxSizeKB, onFileSelected }: Props$
|
|
204
|
+
declare function InputTextFile({ text, maxSizeKB, onFileSelected }: Props$q): ReactElement;
|
|
203
205
|
|
|
204
|
-
interface Props$
|
|
206
|
+
interface Props$p {
|
|
205
207
|
text: string;
|
|
206
208
|
onFileSelected: CallableFunction;
|
|
207
209
|
}
|
|
208
|
-
declare function InputZipFile({ text, onFileSelected }: Props$
|
|
210
|
+
declare function InputZipFile({ text, onFileSelected }: Props$p): ReactElement;
|
|
209
211
|
|
|
210
|
-
interface Props$
|
|
212
|
+
interface Props$o {
|
|
211
213
|
helper?: string;
|
|
212
214
|
id: string;
|
|
213
215
|
label: string;
|
|
@@ -215,9 +217,9 @@ interface Props$n {
|
|
|
215
217
|
setIsInterdisciplinaryAction?: (v: boolean) => void;
|
|
216
218
|
subjectData: Subject;
|
|
217
219
|
}
|
|
218
|
-
declare function SubjectInputAdmin({ id, label, helper, subjectData, onChangeAction }: Props$
|
|
220
|
+
declare function SubjectInputAdmin({ id, label, helper, subjectData, onChangeAction }: Props$o): ReactElement;
|
|
219
221
|
|
|
220
|
-
interface Props$
|
|
222
|
+
interface Props$n {
|
|
221
223
|
helper?: string;
|
|
222
224
|
id: string;
|
|
223
225
|
label: string;
|
|
@@ -225,9 +227,9 @@ interface Props$m {
|
|
|
225
227
|
setIsInterdisciplinaryAction?: (v: boolean) => void;
|
|
226
228
|
subjectData: Subject;
|
|
227
229
|
}
|
|
228
|
-
declare function SubjectInputStudent({ id, label, helper, subjectData, setIsInterdisciplinaryAction, onChangeAction, }: Props$
|
|
230
|
+
declare function SubjectInputStudent({ id, label, helper, subjectData, setIsInterdisciplinaryAction, onChangeAction, }: Props$n): ReactElement;
|
|
229
231
|
|
|
230
|
-
interface Props$
|
|
232
|
+
interface Props$m {
|
|
231
233
|
helper?: string;
|
|
232
234
|
id: string;
|
|
233
235
|
label: string;
|
|
@@ -235,9 +237,9 @@ interface Props$l {
|
|
|
235
237
|
setIsInterdisciplinaryAction?: (v: boolean) => void;
|
|
236
238
|
subjectData: Subject;
|
|
237
239
|
}
|
|
238
|
-
declare function SubjectInputTeacher({ id, label, helper, subjectData, onChangeAction }: Props$
|
|
240
|
+
declare function SubjectInputTeacher({ id, label, helper, subjectData, onChangeAction }: Props$m): ReactElement;
|
|
239
241
|
|
|
240
|
-
interface Props$
|
|
242
|
+
interface Props$l {
|
|
241
243
|
defaultValue?: string;
|
|
242
244
|
disabled?: boolean;
|
|
243
245
|
ref?: RefObject<HTMLTextAreaElement | null>;
|
|
@@ -249,9 +251,9 @@ interface Props$k {
|
|
|
249
251
|
subjectData: Subject;
|
|
250
252
|
animate: boolean;
|
|
251
253
|
}
|
|
252
|
-
declare function SubjectTextArea({ id, label, helper, disabled, ref, defaultValue, maxLength, onChangeAction, subjectData, animate, }: Props$
|
|
254
|
+
declare function SubjectTextArea({ id, label, helper, disabled, ref, defaultValue, maxLength, onChangeAction, subjectData, animate, }: Props$l): ReactElement;
|
|
253
255
|
|
|
254
|
-
interface Props$
|
|
256
|
+
interface Props$k {
|
|
255
257
|
defaultValue?: string;
|
|
256
258
|
disabled?: boolean;
|
|
257
259
|
ref?: RefObject<HTMLTextAreaElement | null>;
|
|
@@ -262,12 +264,32 @@ interface Props$j {
|
|
|
262
264
|
required?: boolean;
|
|
263
265
|
maxLength?: number;
|
|
264
266
|
}
|
|
265
|
-
declare function TextArea({ id, label, helper, required, disabled, ref, defaultValue, onChangeAction, maxLength, }: Props$
|
|
267
|
+
declare function TextArea({ id, label, helper, required, disabled, ref, defaultValue, onChangeAction, maxLength, }: Props$k): ReactElement;
|
|
266
268
|
|
|
267
269
|
declare function Providers({ children }: {
|
|
268
270
|
children: React.ReactNode;
|
|
269
271
|
}): ReactElement;
|
|
270
272
|
|
|
273
|
+
interface Props$j {
|
|
274
|
+
savedUsername: string;
|
|
275
|
+
visible: boolean;
|
|
276
|
+
onConfirmAction: (askAgain: boolean) => void;
|
|
277
|
+
onCancelAction: () => void;
|
|
278
|
+
}
|
|
279
|
+
declare function ConfirmTokenElement({ savedUsername, visible, onConfirmAction, onCancelAction }: Props$j): ReactElement;
|
|
280
|
+
|
|
281
|
+
type Result = {
|
|
282
|
+
confirm: boolean;
|
|
283
|
+
askAgain: boolean;
|
|
284
|
+
};
|
|
285
|
+
type ConfirmTokenContext = {
|
|
286
|
+
showConfirmToken: (username: string) => Promise<Result>;
|
|
287
|
+
};
|
|
288
|
+
declare function ConfirmTokenProvider({ children }: {
|
|
289
|
+
children: ReactNode;
|
|
290
|
+
}): ReactElement;
|
|
291
|
+
declare function useConfirmToken(): ConfirmTokenContext;
|
|
292
|
+
|
|
271
293
|
interface Props$i {
|
|
272
294
|
title: string;
|
|
273
295
|
message: string;
|
|
@@ -492,4 +514,4 @@ declare function LoginForm(): ReactElement;
|
|
|
492
514
|
|
|
493
515
|
declare function RegisterForm(): ReactElement;
|
|
494
516
|
|
|
495
|
-
export { AdminCard, AdminPanelCardSkeleton, AdminSubjectCardSkeleton, AdminSubjectsCard, AdminsSearchBar, AuditActionCard, AuditActionCardSkeleton, AuthTokenCard, Button, ButtonSkeleton, Card, CardTitle, Checkbox, CommentSkeleton, CommentStudent, CommentTeacher, type ConfirmContext, ConfirmElement, ConfirmProvider, CookieBanner, CreateAdminElement, type DraftModalContext, DraftModalElement, DraftModalProvider, Dropdown, DynamicNav, type EmailModalContext, EmailModalElement, EmailModalProvider, FlashToastListener, FloatingInput, type GoralysImage, type GoralysLink, GoralysLogoLoader, type GoralysRouter, type GoralysSearchParams, type GoralysUIConfig, GoralysUIProvider, type ImportTopicsModalContext, ImportTopicsModalElement, ImportTopicsModalProvider, InputTextFile, InputZipFile, LoginForm, NavLink, type PasswordModalContext, PasswordModalElement, PasswordModalProvider, Providers, ReadonlyCard, RegisterForm, ReplaceTeacherElement, SideNav, StatusLegend, StudentCard, StudentCardSkeleton, SubjectInputAdmin, SubjectInputSkeleton, SubjectInputStudent, SubjectInputTeacher, SubjectStudentsDonut, SubjectTeachersDonut, SubjectTextArea, SubjectsFilter, SubjectsSearchBar, SupportForm, SupportTicketCard, SupportTicketCardSkeleton, TapBar, TapBarLink, TapBarUser, TeacherCard, TeacherCardSkeleton, TextArea, type ToastContext, ToastElement, ToastProvider, UserCard, UserCardSkeleton, UserNav, UserSubjectsStudentCard, UserSubjectsStudentCardSkeleton, UserSubjectsTeacherCard, UserSubjectsTeacherCardSkeleton, UsersSearchBar, useAutoResize, useConfirm, useDraftModal, useEmailModal, useGoralysUI, useImportTopicsModal, useMediaQuery, useModalClose, usePasswordModal, useToast };
|
|
517
|
+
export { AdminCard, AdminPanelCardSkeleton, AdminSubjectCardSkeleton, AdminSubjectsCard, AdminsSearchBar, AuditActionCard, AuditActionCardSkeleton, AuthTokenCard, Button, ButtonSkeleton, Card, CardTitle, Checkbox, CommentSkeleton, CommentStudent, CommentTeacher, type ConfirmContext, ConfirmElement, ConfirmProvider, type ConfirmTokenContext, ConfirmTokenElement, ConfirmTokenProvider, CookieBanner, CreateAdminElement, type DraftModalContext, DraftModalElement, DraftModalProvider, Dropdown, DynamicNav, type EmailModalContext, EmailModalElement, EmailModalProvider, FlashToastListener, FloatingInput, type GoralysImage, type GoralysLink, GoralysLogoLoader, type GoralysRouter, type GoralysSearchParams, type GoralysUIConfig, GoralysUIProvider, type ImportTopicsModalContext, ImportTopicsModalElement, ImportTopicsModalProvider, InputTextFile, InputZipFile, LoginForm, NavLink, type PasswordModalContext, PasswordModalElement, PasswordModalProvider, Providers, ReadonlyCard, RegisterForm, ReplaceTeacherElement, SideNav, StatusLegend, StudentCard, StudentCardSkeleton, SubjectInputAdmin, SubjectInputSkeleton, SubjectInputStudent, SubjectInputTeacher, SubjectStudentsDonut, SubjectTeachersDonut, SubjectTextArea, SubjectsFilter, SubjectsSearchBar, SupportForm, SupportTicketCard, SupportTicketCardSkeleton, TapBar, TapBarLink, TapBarUser, TeacherCard, TeacherCardSkeleton, TextArea, type ToastContext, ToastElement, ToastProvider, UserCard, UserCardSkeleton, UserNav, UserSubjectsStudentCard, UserSubjectsStudentCardSkeleton, UserSubjectsTeacherCard, UserSubjectsTeacherCardSkeleton, UsersSearchBar, useAutoResize, useConfirm, useConfirmToken, useDraftModal, useEmailModal, useGoralysUI, useImportTopicsModal, useMediaQuery, useModalClose, usePasswordModal, useToast };
|