@goralys/ui 0.0.0-stage → 0.1.1
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/LICENSE +165 -0
- package/README.md +43 -3
- package/dist/index.d.ts +495 -0
- package/dist/index.js +3514 -0
- package/package.json +59 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 29 June 2007
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
|
6
|
+
of this license document, but changing it is not allowed.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
|
11
|
+
License, supplemented by the additional permissions listed below.
|
|
12
|
+
|
|
13
|
+
0. Additional Definitions.
|
|
14
|
+
|
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
|
17
|
+
General Public License.
|
|
18
|
+
|
|
19
|
+
"The Library" refers to a covered work governed by this License,
|
|
20
|
+
other than an Application or a Combined Work as defined below.
|
|
21
|
+
|
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
|
25
|
+
of using an interface provided by the Library.
|
|
26
|
+
|
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
|
28
|
+
Application with the Library. The particular version of the Library
|
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
|
30
|
+
Version".
|
|
31
|
+
|
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
|
35
|
+
based on the Application, and not on the Linked Version.
|
|
36
|
+
|
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
|
38
|
+
object code and/or source code for the Application, including any data
|
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
|
41
|
+
|
|
42
|
+
1. Exception to Section 3 of the GNU GPL.
|
|
43
|
+
|
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
|
46
|
+
|
|
47
|
+
2. Conveying Modified Versions.
|
|
48
|
+
|
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
|
51
|
+
that uses the facility (other than as an argument passed when the
|
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
|
53
|
+
version:
|
|
54
|
+
|
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
|
56
|
+
ensure that, in the event an Application does not supply the
|
|
57
|
+
function or data, the facility still operates, and performs
|
|
58
|
+
whatever part of its purpose remains meaningful, or
|
|
59
|
+
|
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
|
61
|
+
this License applicable to that copy.
|
|
62
|
+
|
|
63
|
+
3. Object Code Incorporating Material from Library Header Files.
|
|
64
|
+
|
|
65
|
+
The object code form of an Application may incorporate material from
|
|
66
|
+
a header file that is part of the Library. You may convey such object
|
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
|
68
|
+
material is not limited to numerical parameters, data structure
|
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
|
71
|
+
|
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
|
73
|
+
Library is used in it and that the Library and its use are
|
|
74
|
+
covered by this License.
|
|
75
|
+
|
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
|
77
|
+
document.
|
|
78
|
+
|
|
79
|
+
4. Combined Works.
|
|
80
|
+
|
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
|
82
|
+
taken together, effectively do not restrict modification of the
|
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
|
85
|
+
the following:
|
|
86
|
+
|
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
|
88
|
+
the Library is used in it and that the Library and its use are
|
|
89
|
+
covered by this License.
|
|
90
|
+
|
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
|
92
|
+
document.
|
|
93
|
+
|
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
|
95
|
+
execution, include the copyright notice for the Library among
|
|
96
|
+
these notices, as well as a reference directing the user to the
|
|
97
|
+
copies of the GNU GPL and this license document.
|
|
98
|
+
|
|
99
|
+
d) Do one of the following:
|
|
100
|
+
|
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
|
102
|
+
License, and the Corresponding Application Code in a form
|
|
103
|
+
suitable for, and under terms that permit, the user to
|
|
104
|
+
recombine or relink the Application with a modified version of
|
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
|
107
|
+
Corresponding Source.
|
|
108
|
+
|
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
|
111
|
+
a copy of the Library already present on the user's computer
|
|
112
|
+
system, and (b) will operate properly with a modified version
|
|
113
|
+
of the Library that is interface-compatible with the Linked
|
|
114
|
+
Version.
|
|
115
|
+
|
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
|
117
|
+
be required to provide such information under section 6 of the
|
|
118
|
+
GNU GPL, and only to the extent that such information is
|
|
119
|
+
necessary to install and execute a modified version of the
|
|
120
|
+
Combined Work produced by recombining or relinking the
|
|
121
|
+
Application with a modified version of the Linked Version. (If
|
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
|
126
|
+
for conveying Corresponding Source.)
|
|
127
|
+
|
|
128
|
+
5. Combined Libraries.
|
|
129
|
+
|
|
130
|
+
You may place library facilities that are a work based on the
|
|
131
|
+
Library side by side in a single library together with other library
|
|
132
|
+
facilities that are not Applications and are not covered by this
|
|
133
|
+
License, and convey such a combined library under terms of your
|
|
134
|
+
choice, if you do both of the following:
|
|
135
|
+
|
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
|
137
|
+
on the Library, uncombined with any other library facilities,
|
|
138
|
+
conveyed under the terms of this License.
|
|
139
|
+
|
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
|
141
|
+
is a work based on the Library, and explaining where to find the
|
|
142
|
+
accompanying uncombined form of the same work.
|
|
143
|
+
|
|
144
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
|
145
|
+
|
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
|
148
|
+
versions will be similar in spirit to the present version, but may
|
|
149
|
+
differ in detail to address new problems or concerns.
|
|
150
|
+
|
|
151
|
+
Each version is given a distinguishing version number. If the
|
|
152
|
+
Library as you received it specifies that a certain numbered version
|
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
|
154
|
+
applies to it, you have the option of following the terms and
|
|
155
|
+
conditions either of that published version or of any later version
|
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
|
160
|
+
|
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
|
164
|
+
permanent authorization for you to choose that version for the
|
|
165
|
+
Library.
|
package/README.md
CHANGED
|
@@ -1,3 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
## Goralys UI
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
This package contains the ui library for the [Goralys](https://github.com/SAMSAM-55/Goralys) applications – web and
|
|
6
|
+
mobile.
|
|
7
|
+
|
|
8
|
+
This package bundles the reusable ui components for the web frontend and the mobile app to avoid code redundancy and
|
|
9
|
+
duplication across platforms.
|
|
10
|
+
|
|
11
|
+
### Content Overview
|
|
12
|
+
|
|
13
|
+
- `hooks/` – React hooks
|
|
14
|
+
- `lib/` – Small logic used for rendering (e.g, text area auto resize)
|
|
15
|
+
- `types/` – Shared TypeScript types
|
|
16
|
+
- `ui/` – All ui components available in Goralys.
|
|
17
|
+
|
|
18
|
+
The business logic is **not** part of this package.
|
|
19
|
+
|
|
20
|
+
### Setup
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pnpm add @goralys/ui
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Development
|
|
27
|
+
|
|
28
|
+
This package is part of the Goralys monorepo and is managed via pnpm workspaces
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# From the project root
|
|
32
|
+
cd goralys-ui
|
|
33
|
+
pnpm install
|
|
34
|
+
pnpm build
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### License
|
|
38
|
+
|
|
39
|
+
This package is distributed under the LGPL-2.1-or-later license, see [LICENSE](LICENSE) for more information.
|
|
40
|
+
|
|
41
|
+
### Contact
|
|
42
|
+
|
|
43
|
+
sami.saubion@gmail.com – main developer and maintainer of the project
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
import React, { ComponentType, ReactNode, ReactElement, RefCallback, RefObject, InputEventHandler, ChangeEventHandler, SVGProps } from 'react';
|
|
2
|
+
import { User, AuditAction, AuthToken, SubjectStatus, Subject, ConfirmOptions, DraftModalResult, SupportTicket, Toast } from '@goralys/core';
|
|
3
|
+
|
|
4
|
+
type GoralysLink = ComponentType<{
|
|
5
|
+
href: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}>;
|
|
9
|
+
type GoralysImage = ComponentType<{
|
|
10
|
+
src: string;
|
|
11
|
+
alt: string;
|
|
12
|
+
width?: number;
|
|
13
|
+
height?: number;
|
|
14
|
+
className?: string;
|
|
15
|
+
loading?: "lazy" | "eager";
|
|
16
|
+
priority?: boolean;
|
|
17
|
+
}>;
|
|
18
|
+
type GoralysRouter = {
|
|
19
|
+
push: (href: string) => void;
|
|
20
|
+
replace: (href: string) => void;
|
|
21
|
+
back: () => void;
|
|
22
|
+
refresh: () => void;
|
|
23
|
+
};
|
|
24
|
+
type GoralysSearchParams = {
|
|
25
|
+
get: (name: string) => string | null;
|
|
26
|
+
has: (name: string) => boolean;
|
|
27
|
+
toString: () => string;
|
|
28
|
+
};
|
|
29
|
+
type GoralysUIConfig = {
|
|
30
|
+
Link: GoralysLink;
|
|
31
|
+
Image: GoralysImage;
|
|
32
|
+
useRouter: () => GoralysRouter;
|
|
33
|
+
useSearchParams: () => GoralysSearchParams;
|
|
34
|
+
usePathname: () => string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
interface Props$I {
|
|
38
|
+
config: GoralysUIConfig;
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
}
|
|
41
|
+
declare function GoralysUIProvider({ config, children }: Props$I): ReactElement;
|
|
42
|
+
declare function useGoralysUI(): GoralysUIConfig;
|
|
43
|
+
|
|
44
|
+
declare function useMediaQuery(query: string): boolean;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* A hook that provides a callback ref to auto-resize a textarea based on its content.
|
|
48
|
+
* It also handles ref forwarding (both RefObject and RefCallback).
|
|
49
|
+
*
|
|
50
|
+
* @param ref The external ref to forward to.
|
|
51
|
+
* @returns A RefCallback to be passed to the textarea's ref prop.
|
|
52
|
+
*/
|
|
53
|
+
declare function useAutoResize(ref: React.Ref<HTMLTextAreaElement> | undefined): RefCallback<HTMLTextAreaElement>;
|
|
54
|
+
|
|
55
|
+
declare function useModalClose(modalRef: RefObject<HTMLDivElement | null>, visible: boolean, onClose: () => void): void;
|
|
56
|
+
|
|
57
|
+
interface Props$H {
|
|
58
|
+
className?: string;
|
|
59
|
+
text: string;
|
|
60
|
+
type: "submit" | "button" | "reset";
|
|
61
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
62
|
+
color?: "sky" | "red" | "green" | "amber";
|
|
63
|
+
disabled?: boolean;
|
|
64
|
+
}
|
|
65
|
+
declare function Button({ text, type, className, onClick, color, disabled }: Props$H): ReactElement;
|
|
66
|
+
|
|
67
|
+
interface Props$G {
|
|
68
|
+
title: string;
|
|
69
|
+
}
|
|
70
|
+
declare function CardTitle({ title }: Props$G): ReactElement;
|
|
71
|
+
|
|
72
|
+
declare function Card({ children, className }: {
|
|
73
|
+
children: ReactNode;
|
|
74
|
+
className?: string;
|
|
75
|
+
}): ReactElement;
|
|
76
|
+
|
|
77
|
+
interface Props$F {
|
|
78
|
+
admin: User;
|
|
79
|
+
}
|
|
80
|
+
declare function AdminCard({ admin }: Props$F): ReactElement;
|
|
81
|
+
|
|
82
|
+
interface Props$E {
|
|
83
|
+
type: "real" | "virtual";
|
|
84
|
+
admins: User[] | null;
|
|
85
|
+
setCurrentAdminsAction: React.Dispatch<React.SetStateAction<User[] | null>>;
|
|
86
|
+
}
|
|
87
|
+
declare function AdminsSearchBar({ type, admins, setCurrentAdminsAction }: Props$E): ReactElement;
|
|
88
|
+
|
|
89
|
+
interface Props$D {
|
|
90
|
+
actions: AuditAction[] | null;
|
|
91
|
+
}
|
|
92
|
+
declare function AuditActionCard({ actions }: Props$D): ReactElement;
|
|
93
|
+
|
|
94
|
+
interface Props$C {
|
|
95
|
+
publicId: string;
|
|
96
|
+
token: AuthToken;
|
|
97
|
+
onUpdate: () => Promise<void>;
|
|
98
|
+
}
|
|
99
|
+
declare function AuthTokenCard({ publicId, token, onUpdate }: Props$C): ReactElement;
|
|
100
|
+
|
|
101
|
+
interface Props$B {
|
|
102
|
+
onUpdateAction: () => void;
|
|
103
|
+
syncKey: string;
|
|
104
|
+
virtualSyncKey: string;
|
|
105
|
+
}
|
|
106
|
+
declare function CreateAdminElement({ onUpdateAction, syncKey, virtualSyncKey }: Props$B): ReactElement;
|
|
107
|
+
|
|
108
|
+
interface Props$A {
|
|
109
|
+
onReplaceAction: (firstName: string, lastName: string) => void;
|
|
110
|
+
dropDown?: boolean;
|
|
111
|
+
}
|
|
112
|
+
declare function ReplaceTeacherElement({ onReplaceAction, dropDown }: Props$A): ReactElement;
|
|
113
|
+
|
|
114
|
+
interface Props$z {
|
|
115
|
+
user: User;
|
|
116
|
+
}
|
|
117
|
+
declare function UserCard({ user }: Props$z): ReactElement;
|
|
118
|
+
|
|
119
|
+
interface Props$y {
|
|
120
|
+
type: "real" | "virtual";
|
|
121
|
+
users: User[] | null;
|
|
122
|
+
setCurrentUsers: React.Dispatch<React.SetStateAction<User[] | null>>;
|
|
123
|
+
}
|
|
124
|
+
declare function UsersSearchBar({ type, users, setCurrentUsers }: Props$y): ReactElement;
|
|
125
|
+
|
|
126
|
+
interface Props$x {
|
|
127
|
+
total: number;
|
|
128
|
+
submitted: number;
|
|
129
|
+
approved: number;
|
|
130
|
+
rejected: number;
|
|
131
|
+
notSubmitted: number;
|
|
132
|
+
}
|
|
133
|
+
declare function StatusLegend({ total, submitted, approved, rejected, notSubmitted }: Props$x): ReactElement;
|
|
134
|
+
|
|
135
|
+
interface Props$w {
|
|
136
|
+
status: SubjectStatus | "empty";
|
|
137
|
+
size?: number;
|
|
138
|
+
}
|
|
139
|
+
declare function SubjectStudentsDonut({ status, size }: Props$w): ReactElement;
|
|
140
|
+
|
|
141
|
+
interface Props$v {
|
|
142
|
+
size?: number;
|
|
143
|
+
total: number;
|
|
144
|
+
notSubmitted: number;
|
|
145
|
+
submitted: number;
|
|
146
|
+
rejected: number;
|
|
147
|
+
approved: number;
|
|
148
|
+
}
|
|
149
|
+
declare function SubjectTeachersDonut({ size, total, notSubmitted, submitted, rejected, approved }: Props$v): ReactElement;
|
|
150
|
+
|
|
151
|
+
interface Props$u {
|
|
152
|
+
subjects: Subject[] | null;
|
|
153
|
+
}
|
|
154
|
+
declare function UserSubjectsStudentCard({ subjects }: Props$u): ReactElement;
|
|
155
|
+
|
|
156
|
+
interface Props$t {
|
|
157
|
+
subjects: Subject[] | null;
|
|
158
|
+
}
|
|
159
|
+
declare function UserSubjectsTeacherCard({ subjects }: Props$t): ReactElement;
|
|
160
|
+
|
|
161
|
+
declare function CookieBanner(): ReactElement | null;
|
|
162
|
+
|
|
163
|
+
interface Props$s {
|
|
164
|
+
label: string | ReactNode;
|
|
165
|
+
children?: ReactNode;
|
|
166
|
+
openDefault?: boolean;
|
|
167
|
+
}
|
|
168
|
+
declare function Dropdown({ label, children, openDefault }: Props$s): ReactElement;
|
|
169
|
+
|
|
170
|
+
declare function GoralysLogoLoader(): ReactElement;
|
|
171
|
+
|
|
172
|
+
interface Props$r {
|
|
173
|
+
id?: string;
|
|
174
|
+
label: string;
|
|
175
|
+
setValueAction: (v: boolean) => void;
|
|
176
|
+
defaultValue: boolean;
|
|
177
|
+
className?: string | null;
|
|
178
|
+
disabled?: boolean;
|
|
179
|
+
}
|
|
180
|
+
declare function Checkbox({ id, label, setValueAction, defaultValue, className, disabled }: Props$r): ReactElement;
|
|
181
|
+
|
|
182
|
+
interface Props$q {
|
|
183
|
+
autocomplete?: string;
|
|
184
|
+
disabled?: boolean;
|
|
185
|
+
helper?: string;
|
|
186
|
+
id: string;
|
|
187
|
+
label: string;
|
|
188
|
+
password?: boolean;
|
|
189
|
+
email?: boolean;
|
|
190
|
+
required?: boolean;
|
|
191
|
+
defaultValue?: string;
|
|
192
|
+
value?: string;
|
|
193
|
+
onInput?: InputEventHandler<HTMLInputElement>;
|
|
194
|
+
}
|
|
195
|
+
declare function FloatingInput({ id, label, helper, autocomplete, password, email, disabled, required, defaultValue, value, onInput, }: Props$q): ReactElement;
|
|
196
|
+
|
|
197
|
+
interface Props$p {
|
|
198
|
+
text: string;
|
|
199
|
+
maxSizeKB: number;
|
|
200
|
+
onFileSelected: CallableFunction;
|
|
201
|
+
}
|
|
202
|
+
declare function InputTextFile({ text, maxSizeKB, onFileSelected }: Props$p): ReactElement;
|
|
203
|
+
|
|
204
|
+
interface Props$o {
|
|
205
|
+
text: string;
|
|
206
|
+
onFileSelected: CallableFunction;
|
|
207
|
+
}
|
|
208
|
+
declare function InputZipFile({ text, onFileSelected }: Props$o): ReactElement;
|
|
209
|
+
|
|
210
|
+
interface Props$n {
|
|
211
|
+
helper?: string;
|
|
212
|
+
id: string;
|
|
213
|
+
label: string;
|
|
214
|
+
onChangeAction?: ChangeEventHandler<HTMLTextAreaElement>;
|
|
215
|
+
setIsInterdisciplinaryAction?: (v: boolean) => void;
|
|
216
|
+
subjectData: Subject;
|
|
217
|
+
}
|
|
218
|
+
declare function SubjectInputAdmin({ id, label, helper, subjectData, onChangeAction }: Props$n): ReactElement;
|
|
219
|
+
|
|
220
|
+
interface Props$m {
|
|
221
|
+
helper?: string;
|
|
222
|
+
id: string;
|
|
223
|
+
label: string;
|
|
224
|
+
onChangeAction?: ChangeEventHandler<HTMLTextAreaElement>;
|
|
225
|
+
setIsInterdisciplinaryAction?: (v: boolean) => void;
|
|
226
|
+
subjectData: Subject;
|
|
227
|
+
}
|
|
228
|
+
declare function SubjectInputStudent({ id, label, helper, subjectData, setIsInterdisciplinaryAction, onChangeAction, }: Props$m): ReactElement;
|
|
229
|
+
|
|
230
|
+
interface Props$l {
|
|
231
|
+
helper?: string;
|
|
232
|
+
id: string;
|
|
233
|
+
label: string;
|
|
234
|
+
onChangeAction?: ChangeEventHandler<HTMLTextAreaElement>;
|
|
235
|
+
setIsInterdisciplinaryAction?: (v: boolean) => void;
|
|
236
|
+
subjectData: Subject;
|
|
237
|
+
}
|
|
238
|
+
declare function SubjectInputTeacher({ id, label, helper, subjectData, onChangeAction }: Props$l): ReactElement;
|
|
239
|
+
|
|
240
|
+
interface Props$k {
|
|
241
|
+
defaultValue?: string;
|
|
242
|
+
disabled?: boolean;
|
|
243
|
+
ref?: RefObject<HTMLTextAreaElement | null>;
|
|
244
|
+
helper?: string;
|
|
245
|
+
id: string;
|
|
246
|
+
label: string;
|
|
247
|
+
maxLength?: number;
|
|
248
|
+
onChangeAction?: ChangeEventHandler<HTMLTextAreaElement>;
|
|
249
|
+
subjectData: Subject;
|
|
250
|
+
animate: boolean;
|
|
251
|
+
}
|
|
252
|
+
declare function SubjectTextArea({ id, label, helper, disabled, ref, defaultValue, maxLength, onChangeAction, subjectData, animate, }: Props$k): ReactElement;
|
|
253
|
+
|
|
254
|
+
interface Props$j {
|
|
255
|
+
defaultValue?: string;
|
|
256
|
+
disabled?: boolean;
|
|
257
|
+
ref?: RefObject<HTMLTextAreaElement | null>;
|
|
258
|
+
helper?: string;
|
|
259
|
+
id: string;
|
|
260
|
+
label: string;
|
|
261
|
+
onChangeAction?: ChangeEventHandler<HTMLTextAreaElement>;
|
|
262
|
+
required?: boolean;
|
|
263
|
+
maxLength?: number;
|
|
264
|
+
}
|
|
265
|
+
declare function TextArea({ id, label, helper, required, disabled, ref, defaultValue, onChangeAction, maxLength, }: Props$j): ReactElement;
|
|
266
|
+
|
|
267
|
+
declare function Providers({ children }: {
|
|
268
|
+
children: React.ReactNode;
|
|
269
|
+
}): ReactElement;
|
|
270
|
+
|
|
271
|
+
interface Props$i {
|
|
272
|
+
title: string;
|
|
273
|
+
message: string;
|
|
274
|
+
visible: boolean;
|
|
275
|
+
onConfirmAction: () => void;
|
|
276
|
+
onCancelAction: () => void;
|
|
277
|
+
}
|
|
278
|
+
declare function ConfirmElement({ title, message, visible, onConfirmAction, onCancelAction }: Props$i): ReactElement;
|
|
279
|
+
|
|
280
|
+
type ConfirmContext = {
|
|
281
|
+
showConfirm: (options: ConfirmOptions) => Promise<boolean>;
|
|
282
|
+
};
|
|
283
|
+
declare function ConfirmProvider({ children }: {
|
|
284
|
+
children: ReactNode;
|
|
285
|
+
}): ReactElement;
|
|
286
|
+
declare function useConfirm(): ConfirmContext;
|
|
287
|
+
|
|
288
|
+
interface Props$h {
|
|
289
|
+
visible: boolean;
|
|
290
|
+
onCancelAction: () => void;
|
|
291
|
+
onChooseDraftAction: (file: File | null) => void;
|
|
292
|
+
onCloseModalAction: () => void;
|
|
293
|
+
}
|
|
294
|
+
declare function DraftModalElement({ visible, onChooseDraftAction, onCancelAction, onCloseModalAction }: Props$h): ReactElement;
|
|
295
|
+
|
|
296
|
+
type DraftModalContext = {
|
|
297
|
+
showDraftModal: () => Promise<DraftModalResult>;
|
|
298
|
+
};
|
|
299
|
+
declare function DraftModalProvider({ children }: {
|
|
300
|
+
children: ReactNode;
|
|
301
|
+
}): ReactElement;
|
|
302
|
+
declare function useDraftModal(): DraftModalContext;
|
|
303
|
+
|
|
304
|
+
interface Props$g {
|
|
305
|
+
visible: boolean;
|
|
306
|
+
onConfirmAction: (email: string) => void;
|
|
307
|
+
onCancelAction: () => void;
|
|
308
|
+
onCloseModalAction: () => void;
|
|
309
|
+
message: string;
|
|
310
|
+
}
|
|
311
|
+
declare function EmailModalElement({ visible, onConfirmAction, onCancelAction, onCloseModalAction, message }: Props$g): ReactElement;
|
|
312
|
+
|
|
313
|
+
type EmailModalContext = {
|
|
314
|
+
showEmailModal: (message?: string) => Promise<string | null>;
|
|
315
|
+
};
|
|
316
|
+
declare function EmailModalProvider({ children }: {
|
|
317
|
+
children: ReactNode;
|
|
318
|
+
}): ReactElement;
|
|
319
|
+
declare function useEmailModal(): EmailModalContext;
|
|
320
|
+
|
|
321
|
+
interface Props$f {
|
|
322
|
+
visible: boolean;
|
|
323
|
+
onCancelAction: () => void;
|
|
324
|
+
onImportTopicsAction: (file: File | null) => void;
|
|
325
|
+
onCloseModalAction: () => void;
|
|
326
|
+
}
|
|
327
|
+
declare function ImportTopicsModalElement({ visible, onImportTopicsAction, onCancelAction, onCloseModalAction }: Props$f): ReactElement;
|
|
328
|
+
|
|
329
|
+
type ImportTopicsModalContext = {
|
|
330
|
+
showImportTopicsModal: () => Promise<File | string | null>;
|
|
331
|
+
};
|
|
332
|
+
declare function ImportTopicsModalProvider({ children }: {
|
|
333
|
+
children: ReactNode;
|
|
334
|
+
}): ReactElement;
|
|
335
|
+
declare function useImportTopicsModal(): ImportTopicsModalContext;
|
|
336
|
+
|
|
337
|
+
interface Props$e {
|
|
338
|
+
visible: boolean;
|
|
339
|
+
onConfirmAction: (password: string) => void;
|
|
340
|
+
onCancelAction: () => void;
|
|
341
|
+
onCloseModalAction: () => void;
|
|
342
|
+
message: string;
|
|
343
|
+
}
|
|
344
|
+
declare function PasswordModalElement({ visible, onConfirmAction, onCancelAction, onCloseModalAction, message }: Props$e): ReactElement;
|
|
345
|
+
|
|
346
|
+
type PasswordModalContext = {
|
|
347
|
+
showPasswordModal: (confirm?: string) => Promise<string | null>;
|
|
348
|
+
};
|
|
349
|
+
declare function PasswordModalProvider({ children }: {
|
|
350
|
+
children: ReactNode;
|
|
351
|
+
}): ReactElement;
|
|
352
|
+
declare function usePasswordModal(): PasswordModalContext;
|
|
353
|
+
|
|
354
|
+
declare function DynamicNav(): ReactElement;
|
|
355
|
+
|
|
356
|
+
declare function NavLink({ name, url, exact }: {
|
|
357
|
+
name: string;
|
|
358
|
+
url: string;
|
|
359
|
+
exact?: boolean;
|
|
360
|
+
}): ReactElement;
|
|
361
|
+
|
|
362
|
+
declare function SideNav(): ReactElement;
|
|
363
|
+
|
|
364
|
+
declare function UserNav(): ReactElement;
|
|
365
|
+
|
|
366
|
+
type Props$d = {
|
|
367
|
+
name: string;
|
|
368
|
+
url: string;
|
|
369
|
+
icon: ComponentType<SVGProps<SVGSVGElement>>;
|
|
370
|
+
exact?: boolean;
|
|
371
|
+
};
|
|
372
|
+
declare function TapBarLink({ name, url, icon: Icon, exact }: Props$d): ReactElement;
|
|
373
|
+
|
|
374
|
+
declare function TapBarUser(): ReactElement;
|
|
375
|
+
|
|
376
|
+
declare function TapBar(): ReactElement;
|
|
377
|
+
|
|
378
|
+
declare function ButtonSkeleton({ className }: {
|
|
379
|
+
className?: string;
|
|
380
|
+
}): ReactElement;
|
|
381
|
+
|
|
382
|
+
declare function AdminPanelCardSkeleton(): ReactElement;
|
|
383
|
+
|
|
384
|
+
declare function AuditActionCardSkeleton(): ReactElement;
|
|
385
|
+
|
|
386
|
+
declare function UserCardSkeleton(): ReactElement;
|
|
387
|
+
|
|
388
|
+
declare function UserSubjectsTeacherCardSkeleton(): ReactElement;
|
|
389
|
+
|
|
390
|
+
declare function UserSubjectsStudentCardSkeleton(): ReactElement;
|
|
391
|
+
|
|
392
|
+
interface Props$c {
|
|
393
|
+
showMeta?: boolean;
|
|
394
|
+
}
|
|
395
|
+
declare function SubjectInputSkeleton({ showMeta }: Props$c): ReactElement;
|
|
396
|
+
|
|
397
|
+
declare function AdminSubjectCardSkeleton(): ReactElement;
|
|
398
|
+
|
|
399
|
+
declare function CommentSkeleton(): ReactElement;
|
|
400
|
+
|
|
401
|
+
interface Props$b {
|
|
402
|
+
showButtons?: boolean;
|
|
403
|
+
}
|
|
404
|
+
declare function StudentCardSkeleton({ showButtons }: Props$b): ReactElement;
|
|
405
|
+
|
|
406
|
+
interface Props$a {
|
|
407
|
+
showButtons?: boolean;
|
|
408
|
+
}
|
|
409
|
+
declare function TeacherCardSkeleton({ showButtons }: Props$a): ReactElement;
|
|
410
|
+
|
|
411
|
+
declare function SupportTicketCardSkeleton(): ReactElement;
|
|
412
|
+
|
|
413
|
+
interface Props$9 {
|
|
414
|
+
subjectData: Subject;
|
|
415
|
+
onUpdateAction: () => void;
|
|
416
|
+
syncKey: string;
|
|
417
|
+
}
|
|
418
|
+
declare function AdminSubjectsCard({ subjectData, onUpdateAction, syncKey }: Props$9): ReactElement;
|
|
419
|
+
|
|
420
|
+
interface Props$8 {
|
|
421
|
+
subjectData: Subject;
|
|
422
|
+
disabled: boolean;
|
|
423
|
+
onChange?: ChangeEventHandler<HTMLTextAreaElement>;
|
|
424
|
+
}
|
|
425
|
+
declare function CommentStudent({ subjectData, disabled, onChange }: Props$8): ReactElement;
|
|
426
|
+
|
|
427
|
+
interface Props$7 {
|
|
428
|
+
subjectData: Subject;
|
|
429
|
+
disabled: boolean;
|
|
430
|
+
ref?: RefObject<HTMLTextAreaElement | null>;
|
|
431
|
+
onChange?: ChangeEventHandler<HTMLTextAreaElement>;
|
|
432
|
+
}
|
|
433
|
+
declare function CommentTeacher({ subjectData, disabled, ref, onChange }: Props$7): ReactElement;
|
|
434
|
+
|
|
435
|
+
interface Props$6 {
|
|
436
|
+
subjectData: Subject;
|
|
437
|
+
}
|
|
438
|
+
declare function ReadonlyCard({ subjectData }: Props$6): ReactElement;
|
|
439
|
+
|
|
440
|
+
interface Props$5 {
|
|
441
|
+
subjectData: Subject;
|
|
442
|
+
onUpdateAction: () => void;
|
|
443
|
+
}
|
|
444
|
+
declare function StudentCard({ subjectData, onUpdateAction }: Props$5): ReactElement;
|
|
445
|
+
|
|
446
|
+
interface Props$4 {
|
|
447
|
+
subjects: Subject[];
|
|
448
|
+
setCurrentSubjects: (s: Subject[]) => void;
|
|
449
|
+
defaults?: Record<SubjectStatus, boolean>;
|
|
450
|
+
}
|
|
451
|
+
declare function SubjectsFilter({ subjects, setCurrentSubjects, defaults }: Props$4): ReactElement;
|
|
452
|
+
|
|
453
|
+
interface Props$3 {
|
|
454
|
+
subjects: Subject[] | null;
|
|
455
|
+
setCurrentSubjects: React.Dispatch<React.SetStateAction<Subject[] | null>>;
|
|
456
|
+
}
|
|
457
|
+
declare function SubjectsSearchBar({ subjects, setCurrentSubjects }: Props$3): ReactElement;
|
|
458
|
+
|
|
459
|
+
interface Props$2 {
|
|
460
|
+
subjectData: Subject;
|
|
461
|
+
onUpdateAction: () => void;
|
|
462
|
+
}
|
|
463
|
+
declare function TeacherCard({ subjectData, onUpdateAction }: Props$2): ReactElement;
|
|
464
|
+
|
|
465
|
+
declare function SupportForm(): ReactElement;
|
|
466
|
+
|
|
467
|
+
interface Props$1 {
|
|
468
|
+
ticket: SupportTicket;
|
|
469
|
+
}
|
|
470
|
+
declare function SupportTicketCard({ ticket }: Props$1): ReactElement;
|
|
471
|
+
|
|
472
|
+
declare function FlashToastListener(): null;
|
|
473
|
+
|
|
474
|
+
interface Props {
|
|
475
|
+
type: "info" | "warning" | "error" | "success";
|
|
476
|
+
title: string;
|
|
477
|
+
message: string;
|
|
478
|
+
visible: boolean;
|
|
479
|
+
}
|
|
480
|
+
declare function ToastElement({ type, title, message, visible }: Props): ReactElement;
|
|
481
|
+
|
|
482
|
+
type ToastContext = {
|
|
483
|
+
showToast: (toast: Toast, animate?: boolean, duration?: number) => void;
|
|
484
|
+
cacheToast: (toast: Toast, duration?: number) => void;
|
|
485
|
+
};
|
|
486
|
+
declare function ToastProvider({ children }: {
|
|
487
|
+
children: ReactNode;
|
|
488
|
+
}): ReactElement;
|
|
489
|
+
declare function useToast(): ToastContext;
|
|
490
|
+
|
|
491
|
+
declare function LoginForm(): ReactElement;
|
|
492
|
+
|
|
493
|
+
declare function RegisterForm(): ReactElement;
|
|
494
|
+
|
|
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 };
|