@willphan1712000/frontend 1.7.0 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +293 -40
- package/dist/index.js +114 -126
- package/dist/index.mjs +75 -82
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,70 +1,323 @@
|
|
|
1
|
-
<img style="width: 15%" src="./will.png">
|
|
1
|
+
<img style="width: 15%" src="./will.png" alt="Will frontend package logo">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# `@willphan1712000/frontend`
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- DropdownSelect, type Options
|
|
7
|
-
- RangeSlider
|
|
8
|
-
- OptionSlider, type SliderOptions
|
|
9
|
-
- ColorPickerSlider
|
|
10
|
-
- MultiSelect
|
|
11
|
-
- Button
|
|
12
|
-
- Avatar
|
|
5
|
+
Reusable React UI components and frontend utilities packaged for application development.
|
|
13
6
|
|
|
14
|
-
##
|
|
15
|
-
- Canvas
|
|
16
|
-
- ImageUtilities
|
|
17
|
-
- tools
|
|
18
|
-
- handleAsync
|
|
19
|
-
- textPreprocessing
|
|
20
|
-
- Auth
|
|
21
|
-
- Math
|
|
7
|
+
## What this package includes
|
|
22
8
|
|
|
23
|
-
|
|
9
|
+
### Components
|
|
10
|
+
- `DropdownSelect`
|
|
11
|
+
- `MultiSelect`
|
|
12
|
+
- `RangeSlider`
|
|
13
|
+
- `OptionSlider`
|
|
14
|
+
- `ColorPickerSlider`
|
|
15
|
+
- `Button`
|
|
16
|
+
- `ModernButton`
|
|
17
|
+
- `Avatar`
|
|
18
|
+
- `InputGoogle`
|
|
19
|
+
- `TextArea`
|
|
20
|
+
- `InputFile`
|
|
21
|
+
- `UploadImage`
|
|
22
|
+
- `Image`
|
|
23
|
+
- `ImageEditor`
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
### Utilities
|
|
26
|
+
- `Canvas`
|
|
27
|
+
- `ImageUtilities`
|
|
28
|
+
- `Transform`
|
|
29
|
+
- `tools`
|
|
30
|
+
- `LinearAlgebra`
|
|
31
|
+
|
|
32
|
+
### Auth helpers
|
|
33
|
+
- `useSession`
|
|
34
|
+
- `SessionProvider`
|
|
35
|
+
- `useAuthClient`
|
|
36
|
+
- `AuthInterface`
|
|
37
|
+
- `StorageInterface`
|
|
26
38
|
|
|
27
39
|
## Installation
|
|
28
40
|
|
|
29
|
-
|
|
41
|
+
This package is intended for React applications.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm install @willphan1712000/frontend
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Make sure your app already has React and React DOM installed:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npm install react react-dom
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Quick start
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
import { useState } from 'react';
|
|
57
|
+
import {
|
|
58
|
+
DropdownSelect,
|
|
59
|
+
RangeSlider,
|
|
60
|
+
Button,
|
|
61
|
+
type Options,
|
|
62
|
+
} from '@willphan1712000/frontend';
|
|
63
|
+
|
|
64
|
+
const options: Options = [
|
|
65
|
+
{ label: 'Low', value: 'low' },
|
|
66
|
+
{ label: 'Medium', value: 'medium' },
|
|
67
|
+
{ label: 'High', value: 'high' },
|
|
68
|
+
];
|
|
69
|
+
|
|
70
|
+
export default function Example() {
|
|
71
|
+
const [priority, setPriority] = useState('medium');
|
|
72
|
+
const [amount, setAmount] = useState('50');
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<div>
|
|
76
|
+
<DropdownSelect
|
|
77
|
+
options={options}
|
|
78
|
+
value={priority}
|
|
79
|
+
onChange={setPriority}
|
|
80
|
+
/>
|
|
81
|
+
|
|
82
|
+
<RangeSlider
|
|
83
|
+
value={amount}
|
|
84
|
+
onChange={setAmount}
|
|
85
|
+
min="0"
|
|
86
|
+
max="100"
|
|
87
|
+
width="240"
|
|
88
|
+
/>
|
|
89
|
+
|
|
90
|
+
<Button
|
|
91
|
+
buttonType="gradient"
|
|
92
|
+
content="Submit"
|
|
93
|
+
type="button"
|
|
94
|
+
/>
|
|
95
|
+
</div>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Core component usage
|
|
101
|
+
|
|
102
|
+
### `DropdownSelect`
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
import { DropdownSelect, type Options } from '@willphan1712000/frontend';
|
|
30
106
|
|
|
31
|
-
|
|
107
|
+
const options: Options = [
|
|
108
|
+
{ label: 'Apple', value: 'apple' },
|
|
109
|
+
{ label: 'Orange', value: 'orange' },
|
|
110
|
+
];
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Props:
|
|
114
|
+
- `options: { label: string; value: string }[]`
|
|
115
|
+
- `value: string`
|
|
116
|
+
- `onChange: (value: string) => void`
|
|
117
|
+
|
|
118
|
+
### `MultiSelect`
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
import { useState } from 'react';
|
|
122
|
+
import { MultiSelect } from '@willphan1712000/frontend';
|
|
123
|
+
|
|
124
|
+
const options = [
|
|
125
|
+
{ label: 'React', value: 'react' },
|
|
126
|
+
{ label: 'TypeScript', value: 'typescript' },
|
|
127
|
+
];
|
|
32
128
|
|
|
33
|
-
|
|
34
|
-
npm i @willphan1712000/frontend
|
|
129
|
+
const [values, setValues] = useState<string[]>([]);
|
|
35
130
|
```
|
|
36
131
|
|
|
37
|
-
|
|
132
|
+
Props:
|
|
133
|
+
- `options: { label: string; value: string }[]`
|
|
134
|
+
- `value: string[]`
|
|
135
|
+
- `onChange: React.Dispatch<React.SetStateAction<string[]>>`
|
|
136
|
+
- `width?: string`
|
|
137
|
+
|
|
138
|
+
### `RangeSlider`
|
|
139
|
+
|
|
140
|
+
Props:
|
|
141
|
+
- `value: string`
|
|
142
|
+
- `onChange: (value: string) => void`
|
|
143
|
+
- `min?: string`
|
|
144
|
+
- `max?: string`
|
|
145
|
+
- `color?: string`
|
|
146
|
+
- `width?: string`
|
|
147
|
+
|
|
148
|
+
### `OptionSlider`
|
|
149
|
+
|
|
150
|
+
The package exports `SliderOptions` for this component.
|
|
38
151
|
|
|
39
|
-
|
|
152
|
+
Props:
|
|
153
|
+
- `value: string`
|
|
154
|
+
- `onChange: (value: string) => void`
|
|
155
|
+
- `options: { label: ReactNode; value: string }[]`
|
|
156
|
+
- `width?: string`
|
|
157
|
+
- `color?: string`
|
|
40
158
|
|
|
41
|
-
|
|
159
|
+
### `ColorPickerSlider`
|
|
42
160
|
|
|
43
|
-
|
|
161
|
+
Props:
|
|
162
|
+
- `value: string`
|
|
163
|
+
- `onChange: (value: string) => void`
|
|
164
|
+
- `width?: string`
|
|
44
165
|
|
|
45
|
-
|
|
166
|
+
### `Button`
|
|
46
167
|
|
|
47
|
-
|
|
168
|
+
Supports:
|
|
169
|
+
- `buttonType="normal"`
|
|
170
|
+
- `buttonType="solid"`
|
|
171
|
+
- `buttonType="gradient"`
|
|
172
|
+
|
|
173
|
+
Additional styling props:
|
|
174
|
+
- `content?: string`
|
|
175
|
+
- `main?: string`
|
|
176
|
+
- `text?: string`
|
|
177
|
+
- `first?: string`
|
|
178
|
+
- `second?: string`
|
|
179
|
+
- `isLoading?: boolean`
|
|
180
|
+
|
|
181
|
+
Also accepts normal button props such as `onClick`, `type`, `disabled`, and `style`.
|
|
182
|
+
|
|
183
|
+
### `Avatar`
|
|
184
|
+
|
|
185
|
+
`Avatar` combines image upload, preview, edit, and remove flows.
|
|
186
|
+
|
|
187
|
+
```tsx
|
|
188
|
+
import { useState } from 'react';
|
|
189
|
+
import { Avatar } from '@willphan1712000/frontend';
|
|
190
|
+
|
|
191
|
+
const [src, setSrc] = useState<string | undefined>(undefined);
|
|
192
|
+
|
|
193
|
+
<Avatar
|
|
194
|
+
src={src}
|
|
195
|
+
setValue={setSrc}
|
|
196
|
+
options={{ defaultImage: '/images/default-avatar.png' }}
|
|
197
|
+
/>;
|
|
198
|
+
```
|
|
48
199
|
|
|
49
|
-
|
|
200
|
+
Props:
|
|
201
|
+
- `src?: string`
|
|
202
|
+
- `setValue: (src?: string) => void`
|
|
203
|
+
- `options?: { defaultImage?: string }`
|
|
50
204
|
|
|
51
|
-
|
|
205
|
+
## Auth usage
|
|
52
206
|
|
|
53
|
-
|
|
207
|
+
The auth helpers are designed around an auth client object that implements `AuthInterface`.
|
|
208
|
+
|
|
209
|
+
```tsx
|
|
210
|
+
import {
|
|
211
|
+
SessionProvider,
|
|
212
|
+
useAuthClient,
|
|
213
|
+
type AuthInterface,
|
|
214
|
+
} from '@willphan1712000/frontend';
|
|
215
|
+
|
|
216
|
+
class AuthClient implements AuthInterface {
|
|
217
|
+
getSignInUrl() {
|
|
218
|
+
return '/signin';
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
async signin() {}
|
|
222
|
+
|
|
223
|
+
async validate() {
|
|
224
|
+
return {
|
|
225
|
+
username: 'will',
|
|
226
|
+
email: 'will@example.com',
|
|
227
|
+
role: 'admin',
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
async signout() {}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const authClient = new AuthClient();
|
|
235
|
+
|
|
236
|
+
function AppProviders({ children }: { children: React.ReactNode }) {
|
|
237
|
+
const session = useAuthClient(authClient);
|
|
238
|
+
|
|
239
|
+
return (
|
|
240
|
+
<SessionProvider value={session}>
|
|
241
|
+
{children}
|
|
242
|
+
</SessionProvider>
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
`useAuthClient` returns:
|
|
248
|
+
- `isLoading`
|
|
249
|
+
- `session`
|
|
250
|
+
- `auth`
|
|
251
|
+
|
|
252
|
+
## Exported utilities
|
|
253
|
+
|
|
254
|
+
```ts
|
|
255
|
+
import {
|
|
256
|
+
Canvas,
|
|
257
|
+
ImageUtilities,
|
|
258
|
+
Transform,
|
|
259
|
+
tools,
|
|
260
|
+
LinearAlgebra,
|
|
261
|
+
} from '@willphan1712000/frontend';
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Included helpers:
|
|
265
|
+
- `tools.handleAsync(...)`
|
|
266
|
+
- `tools.textPreprocessing(...)`
|
|
267
|
+
|
|
268
|
+
## Development
|
|
269
|
+
|
|
270
|
+
Install dependencies:
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
npm install
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
Build the package:
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
npm run build
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Run in watch mode during development:
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
npm run dev
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
## Local package testing with `npm link`
|
|
289
|
+
|
|
290
|
+
Inside this package:
|
|
291
|
+
|
|
292
|
+
```bash
|
|
54
293
|
npm link
|
|
55
294
|
```
|
|
56
295
|
|
|
57
|
-
|
|
296
|
+
Inside the app where you want to test it:
|
|
58
297
|
|
|
59
|
-
```
|
|
298
|
+
```bash
|
|
60
299
|
npm link @willphan1712000/frontend
|
|
61
300
|
```
|
|
62
301
|
|
|
63
|
-
|
|
64
|
-
> if you encounter the problem "3. You might have more than one copy of React in the same app?"
|
|
65
|
-
> it means your application has loaded two different React instances. This breaks React Hooks, which rely on a single, shared state.
|
|
66
|
-
> Run this to connect to react in your testing project
|
|
302
|
+
If React reports multiple copies loaded, link the consumer app's React instance:
|
|
67
303
|
|
|
68
|
-
```
|
|
304
|
+
```bash
|
|
69
305
|
npm link <path_to_your_testing_project>/node_modules/react
|
|
70
306
|
```
|
|
307
|
+
|
|
308
|
+
## Notes
|
|
309
|
+
|
|
310
|
+
- The package is built with `tsup`.
|
|
311
|
+
- It ships CommonJS, ESM, and TypeScript declaration files.
|
|
312
|
+
- Source code is written in TypeScript and React.
|
|
313
|
+
|
|
314
|
+
## Contributing
|
|
315
|
+
|
|
316
|
+
If you find a bug or want to improve the package, open an issue or submit a pull request.
|
|
317
|
+
|
|
318
|
+
Portfolio:
|
|
319
|
+
- [will-five.vercel.app](https://will-five.vercel.app/w)
|
|
320
|
+
|
|
321
|
+
Contact:
|
|
322
|
+
- [Facebook](https://www.facebook.com/phanthanhnha123200/)
|
|
323
|
+
- [Instagram](https://www.instagram.com/phanthanhnha_0117/)
|
package/dist/index.js
CHANGED
|
@@ -1115,9 +1115,10 @@ var MultiSelect = ({ options, value, onChange, width = "200" }) => {
|
|
|
1115
1115
|
var MultiSelect_default = MultiSelect;
|
|
1116
1116
|
|
|
1117
1117
|
// src/components/Buttons/Button.tsx
|
|
1118
|
-
var
|
|
1118
|
+
var import_react10 = require("react");
|
|
1119
1119
|
|
|
1120
1120
|
// src/components/Buttons/gradient/Gradient.tsx
|
|
1121
|
+
var import_react9 = require("react");
|
|
1121
1122
|
var import_framer_motion = require("framer-motion");
|
|
1122
1123
|
|
|
1123
1124
|
// src/components/Buttons/gradient/styles.ts
|
|
@@ -1127,7 +1128,7 @@ var styles6 = (first, second) => {
|
|
|
1127
1128
|
container: {
|
|
1128
1129
|
position: "relative",
|
|
1129
1130
|
borderRadius,
|
|
1130
|
-
padding: "
|
|
1131
|
+
padding: "1px"
|
|
1131
1132
|
},
|
|
1132
1133
|
btn: {
|
|
1133
1134
|
position: "relative",
|
|
@@ -1138,9 +1139,10 @@ var styles6 = (first, second) => {
|
|
|
1138
1139
|
padding: "2px",
|
|
1139
1140
|
borderRadius,
|
|
1140
1141
|
backgroundColor: `${first}`,
|
|
1141
|
-
backgroundImage: `linear-gradient(
|
|
1142
|
+
backgroundImage: `linear-gradient(${120}deg, ${first} 0%, ${second} 100%)`,
|
|
1142
1143
|
border: "none",
|
|
1143
|
-
cursor: "pointer"
|
|
1144
|
+
cursor: "pointer",
|
|
1145
|
+
width: "100%"
|
|
1144
1146
|
},
|
|
1145
1147
|
btnAfter: {
|
|
1146
1148
|
position: "absolute",
|
|
@@ -1151,8 +1153,13 @@ var styles6 = (first, second) => {
|
|
|
1151
1153
|
content: '""',
|
|
1152
1154
|
zIndex: 0,
|
|
1153
1155
|
backgroundColor: `${first}`,
|
|
1154
|
-
backgroundImage: `linear-gradient(
|
|
1155
|
-
filter: "blur(
|
|
1156
|
+
backgroundImage: `linear-gradient(${120}deg, ${first} 0%, ${second} 100%)`,
|
|
1157
|
+
filter: "blur(8px)",
|
|
1158
|
+
borderRadius
|
|
1159
|
+
},
|
|
1160
|
+
labelWrapper: {
|
|
1161
|
+
position: "relative",
|
|
1162
|
+
width: "100%"
|
|
1156
1163
|
},
|
|
1157
1164
|
label: {
|
|
1158
1165
|
backgroundColor: "#111723",
|
|
@@ -1186,16 +1193,6 @@ var styles6 = (first, second) => {
|
|
|
1186
1193
|
position: "relative",
|
|
1187
1194
|
zIndex: 1,
|
|
1188
1195
|
margin: 0
|
|
1189
|
-
},
|
|
1190
|
-
neon: {
|
|
1191
|
-
content: '""',
|
|
1192
|
-
background: "conic-gradient(transparent 270deg, green, transparent)",
|
|
1193
|
-
position: "absolute",
|
|
1194
|
-
top: "50%",
|
|
1195
|
-
left: "50%",
|
|
1196
|
-
transform: "translate(-50%, -50%)",
|
|
1197
|
-
aspectRatio: 1,
|
|
1198
|
-
width: "100%"
|
|
1199
1196
|
}
|
|
1200
1197
|
};
|
|
1201
1198
|
return styles12;
|
|
@@ -1207,54 +1204,43 @@ var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
|
1207
1204
|
var Gradient = () => {
|
|
1208
1205
|
const data = useButtonContext();
|
|
1209
1206
|
const styles12 = styles_default6(data.first, data.second);
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
"div",
|
|
1221
|
-
{
|
|
1222
|
-
style: __spreadProps(__spreadValues({}, styles12.label), {
|
|
1223
|
-
backgroundColor: data.main
|
|
1224
|
-
}),
|
|
1225
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1226
|
-
"p",
|
|
1227
|
-
{
|
|
1228
|
-
style: __spreadProps(__spreadValues({}, styles12.p), {
|
|
1229
|
-
color: `${data.text}`
|
|
1230
|
-
}),
|
|
1231
|
-
children: [
|
|
1232
|
-
data.children,
|
|
1233
|
-
" ",
|
|
1234
|
-
data.content
|
|
1235
|
-
]
|
|
1236
|
-
}
|
|
1237
|
-
)
|
|
1238
|
-
}
|
|
1239
|
-
),
|
|
1240
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: styles12.labelAfter })
|
|
1241
|
-
] }) })),
|
|
1242
|
-
!data.isLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: styles12.btnAfter }),
|
|
1243
|
-
data.isLoading && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1244
|
-
import_framer_motion.motion.div,
|
|
1245
|
-
{
|
|
1246
|
-
style: styles12.btnAfter,
|
|
1247
|
-
animate: { rotate: 360 },
|
|
1248
|
-
transition: {
|
|
1249
|
-
ease: "linear",
|
|
1250
|
-
repeat: Infinity,
|
|
1251
|
-
duration: 3
|
|
1252
|
-
}
|
|
1253
|
-
}
|
|
1254
|
-
)
|
|
1255
|
-
]
|
|
1207
|
+
const angle = (0, import_framer_motion.useMotionValue)(10);
|
|
1208
|
+
const background2 = import_framer_motion.useMotionTemplate`conic-gradient(from ${angle}deg, #00000000 60%, ${data.first}, ${data.second})`;
|
|
1209
|
+
(0, import_react9.useEffect)(() => {
|
|
1210
|
+
if (data.isLoading) {
|
|
1211
|
+
const controls = (0, import_framer_motion.animate)(angle, angle.get() + 360, {
|
|
1212
|
+
repeat: Infinity,
|
|
1213
|
+
duration: 2,
|
|
1214
|
+
ease: "linear"
|
|
1215
|
+
});
|
|
1216
|
+
return controls.stop;
|
|
1256
1217
|
}
|
|
1257
|
-
);
|
|
1218
|
+
}, [data.isLoading, angle]);
|
|
1219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: styles12.container, children: [
|
|
1220
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", __spreadProps(__spreadValues({ style: styles12.btn }, data.props), { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: styles12.labelWrapper, children: [
|
|
1221
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: styles12.labelBefore }),
|
|
1222
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1223
|
+
"div",
|
|
1224
|
+
{
|
|
1225
|
+
style: __spreadProps(__spreadValues({}, styles12.label), { backgroundColor: data.main }),
|
|
1226
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("p", { style: __spreadProps(__spreadValues({}, styles12.p), { color: `${data.text}` }), children: [
|
|
1227
|
+
data.children,
|
|
1228
|
+
" ",
|
|
1229
|
+
data.content
|
|
1230
|
+
] })
|
|
1231
|
+
}
|
|
1232
|
+
),
|
|
1233
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: styles12.labelAfter })
|
|
1234
|
+
] }) })),
|
|
1235
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1236
|
+
import_framer_motion.motion.div,
|
|
1237
|
+
{
|
|
1238
|
+
style: __spreadProps(__spreadValues({}, styles12.btnAfter), {
|
|
1239
|
+
background: background2
|
|
1240
|
+
})
|
|
1241
|
+
}
|
|
1242
|
+
)
|
|
1243
|
+
] });
|
|
1258
1244
|
};
|
|
1259
1245
|
var Gradient_default = Gradient;
|
|
1260
1246
|
|
|
@@ -1367,9 +1353,9 @@ var Solid_default = Solid;
|
|
|
1367
1353
|
|
|
1368
1354
|
// src/components/Buttons/Button.tsx
|
|
1369
1355
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1370
|
-
var ButtonContext = (0,
|
|
1356
|
+
var ButtonContext = (0, import_react10.createContext)(void 0);
|
|
1371
1357
|
function useButtonContext() {
|
|
1372
|
-
const data = (0,
|
|
1358
|
+
const data = (0, import_react10.useContext)(ButtonContext);
|
|
1373
1359
|
if (data === void 0) {
|
|
1374
1360
|
throw new Error("Select Context is undefined");
|
|
1375
1361
|
}
|
|
@@ -1440,7 +1426,7 @@ var Button = (_a) => {
|
|
|
1440
1426
|
var Button_default = Button;
|
|
1441
1427
|
|
|
1442
1428
|
// src/components/Buttons/modern/Modern.tsx
|
|
1443
|
-
var
|
|
1429
|
+
var import_react11 = require("react");
|
|
1444
1430
|
|
|
1445
1431
|
// src/components/Buttons/modern/styles.ts
|
|
1446
1432
|
var styles8 = (first) => {
|
|
@@ -1458,7 +1444,8 @@ var styles8 = (first) => {
|
|
|
1458
1444
|
color: first,
|
|
1459
1445
|
backgroundColor: `color-mix(in srgb, ${first} 20%, transparent)`,
|
|
1460
1446
|
fontSize: "15px",
|
|
1461
|
-
transition: "all .1s linear"
|
|
1447
|
+
transition: "all .1s linear",
|
|
1448
|
+
whiteSpace: "nowrap"
|
|
1462
1449
|
}
|
|
1463
1450
|
};
|
|
1464
1451
|
return styles12;
|
|
@@ -1481,7 +1468,7 @@ var Modern = (_a) => {
|
|
|
1481
1468
|
"hover",
|
|
1482
1469
|
"shadow"
|
|
1483
1470
|
]);
|
|
1484
|
-
const [isHover, setHover] = (0,
|
|
1471
|
+
const [isHover, setHover] = (0, import_react11.useState)(false);
|
|
1485
1472
|
const handleEnter = () => {
|
|
1486
1473
|
if (!hover) return;
|
|
1487
1474
|
setHover(true);
|
|
@@ -1496,13 +1483,14 @@ var Modern = (_a) => {
|
|
|
1496
1483
|
const borderTransparent = `solid 1px ${transparentColor}`;
|
|
1497
1484
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1498
1485
|
"a",
|
|
1499
|
-
__spreadProps(__spreadValues({
|
|
1486
|
+
__spreadProps(__spreadValues({
|
|
1500
1487
|
style: __spreadValues(__spreadProps(__spreadValues({}, styles_default8(first).btn), {
|
|
1501
1488
|
border: hover ? isHover ? `${borderFirst}` : `${borderTransparent}` : `${borderFirst}`,
|
|
1502
1489
|
boxShadow: hover ? isHover ? `${shadowTransparent}` : `` : shadow ? `${shadowTransparent}` : ""
|
|
1503
1490
|
}), style),
|
|
1504
1491
|
onMouseEnter: handleEnter,
|
|
1505
|
-
onMouseLeave: handleLeave
|
|
1492
|
+
onMouseLeave: handleLeave
|
|
1493
|
+
}, props), {
|
|
1506
1494
|
children
|
|
1507
1495
|
})
|
|
1508
1496
|
);
|
|
@@ -1565,17 +1553,17 @@ var styles9 = {
|
|
|
1565
1553
|
var styles_default9 = styles9;
|
|
1566
1554
|
|
|
1567
1555
|
// src/components/Avatar/Avatar.tsx
|
|
1568
|
-
var
|
|
1556
|
+
var import_react12 = require("react");
|
|
1569
1557
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1570
1558
|
var Avatar = ({ src, setValue, options }) => {
|
|
1571
|
-
const [isOpen, setOpen] = (0,
|
|
1572
|
-
const [isNew, setNew] = (0,
|
|
1573
|
-
const defaultImage = (0,
|
|
1574
|
-
const initialImage = (0,
|
|
1575
|
-
const uploadImageRef = (0,
|
|
1559
|
+
const [isOpen, setOpen] = (0, import_react12.useState)(false);
|
|
1560
|
+
const [isNew, setNew] = (0, import_react12.useState)(false);
|
|
1561
|
+
const defaultImage = (0, import_react12.useRef)(void 0);
|
|
1562
|
+
const initialImage = (0, import_react12.useRef)(void 0);
|
|
1563
|
+
const uploadImageRef = (0, import_react12.useRef)(null);
|
|
1576
1564
|
const isAbleToEdit = initialImage.current ? src !== defaultImage.current && src !== initialImage.current : false;
|
|
1577
1565
|
const isAbleToRemove = initialImage.current ? src !== defaultImage.current : false;
|
|
1578
|
-
(0,
|
|
1566
|
+
(0, import_react12.useEffect)(() => {
|
|
1579
1567
|
(function setSrc() {
|
|
1580
1568
|
return __async(this, null, function* () {
|
|
1581
1569
|
var _a, _b;
|
|
@@ -1656,7 +1644,7 @@ var Avatar = ({ src, setValue, options }) => {
|
|
|
1656
1644
|
var Avatar_default = Avatar;
|
|
1657
1645
|
|
|
1658
1646
|
// src/components/Input/InputGoogle/InputGoogle.tsx
|
|
1659
|
-
var
|
|
1647
|
+
var import_react13 = require("react");
|
|
1660
1648
|
|
|
1661
1649
|
// src/components/Input/InputGoogle/InputGoogle.styles.ts
|
|
1662
1650
|
var others2 = {
|
|
@@ -1668,7 +1656,7 @@ var others2 = {
|
|
|
1668
1656
|
borderFocus: "#0957d0",
|
|
1669
1657
|
textRelease: "#000",
|
|
1670
1658
|
textFocus: "#0957d0",
|
|
1671
|
-
border: "solid
|
|
1659
|
+
border: "solid 1px"
|
|
1672
1660
|
};
|
|
1673
1661
|
var styles10 = {
|
|
1674
1662
|
input: {
|
|
@@ -1712,9 +1700,9 @@ var InputGoogle = (_a) => {
|
|
|
1712
1700
|
"label",
|
|
1713
1701
|
"options"
|
|
1714
1702
|
]);
|
|
1715
|
-
const [isFocus, setFocus] = (0,
|
|
1716
|
-
const spanRef = (0,
|
|
1717
|
-
const inputRef = (0,
|
|
1703
|
+
const [isFocus, setFocus] = (0, import_react13.useState)(false);
|
|
1704
|
+
const spanRef = (0, import_react13.useRef)(null);
|
|
1705
|
+
const inputRef = (0, import_react13.useRef)(null);
|
|
1718
1706
|
function transitionOnFocus() {
|
|
1719
1707
|
setFocus(true);
|
|
1720
1708
|
if (spanRef.current) {
|
|
@@ -1736,7 +1724,7 @@ var InputGoogle = (_a) => {
|
|
|
1736
1724
|
}
|
|
1737
1725
|
const inputBorder = isFocus ? `${others2.border} ${options ? options.focusColor : others2.borderFocus}` : `${others2.border} ${others2.borderRelease}`;
|
|
1738
1726
|
const labelTextColor = isFocus ? `${options ? options.focusColor : others2.textFocus}` : `${others2.textRelease}`;
|
|
1739
|
-
(0,
|
|
1727
|
+
(0, import_react13.useEffect)(() => {
|
|
1740
1728
|
transitionOnFocus();
|
|
1741
1729
|
transitionOffFocus();
|
|
1742
1730
|
}, []);
|
|
@@ -1773,7 +1761,7 @@ var InputGoogle = (_a) => {
|
|
|
1773
1761
|
var InputGoogle_default = InputGoogle;
|
|
1774
1762
|
|
|
1775
1763
|
// src/components/Input/TextArea/TextArea.tsx
|
|
1776
|
-
var
|
|
1764
|
+
var import_react14 = require("react");
|
|
1777
1765
|
|
|
1778
1766
|
// src/components/Input/TextArea/TextArea.styles.ts
|
|
1779
1767
|
var labelHeight = 20;
|
|
@@ -1786,7 +1774,7 @@ var others3 = {
|
|
|
1786
1774
|
borderFocus: "#0957d0",
|
|
1787
1775
|
textRelease: "#000",
|
|
1788
1776
|
textFocus: "#0957d0",
|
|
1789
|
-
border: "solid
|
|
1777
|
+
border: "solid 1px"
|
|
1790
1778
|
};
|
|
1791
1779
|
var styles11 = {
|
|
1792
1780
|
input: {
|
|
@@ -1833,9 +1821,9 @@ var TextArea = (_a) => {
|
|
|
1833
1821
|
"label",
|
|
1834
1822
|
"options"
|
|
1835
1823
|
]);
|
|
1836
|
-
const [isFocus, setFocus] = (0,
|
|
1837
|
-
const spanRef = (0,
|
|
1838
|
-
const inputRef = (0,
|
|
1824
|
+
const [isFocus, setFocus] = (0, import_react14.useState)(false);
|
|
1825
|
+
const spanRef = (0, import_react14.useRef)(null);
|
|
1826
|
+
const inputRef = (0, import_react14.useRef)(null);
|
|
1839
1827
|
function transitionOnFocus() {
|
|
1840
1828
|
setFocus(true);
|
|
1841
1829
|
if (spanRef.current) {
|
|
@@ -1857,7 +1845,7 @@ var TextArea = (_a) => {
|
|
|
1857
1845
|
}
|
|
1858
1846
|
const inputBorder = isFocus ? `${others3.border} ${options ? options.focusColor : others3.borderFocus}` : `${others3.border} ${others3.borderRelease}`;
|
|
1859
1847
|
const labelTextColor = isFocus ? `${options ? options.focusColor : others3.textFocus}` : `${others3.textRelease}`;
|
|
1860
|
-
(0,
|
|
1848
|
+
(0, import_react14.useEffect)(() => {
|
|
1861
1849
|
transitionOnFocus();
|
|
1862
1850
|
transitionOffFocus();
|
|
1863
1851
|
}, []);
|
|
@@ -1893,7 +1881,7 @@ var TextArea = (_a) => {
|
|
|
1893
1881
|
var TextArea_default = TextArea;
|
|
1894
1882
|
|
|
1895
1883
|
// src/components/Input/InputFile.tsx
|
|
1896
|
-
var
|
|
1884
|
+
var import_react15 = require("react");
|
|
1897
1885
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1898
1886
|
var InputFile = (_a) => {
|
|
1899
1887
|
var _b = _a, {
|
|
@@ -1908,7 +1896,7 @@ var InputFile = (_a) => {
|
|
|
1908
1896
|
"onCancel",
|
|
1909
1897
|
"acceptType"
|
|
1910
1898
|
]);
|
|
1911
|
-
const [key, setKey] = (0,
|
|
1899
|
+
const [key, setKey] = (0, import_react15.useState)(Date.now());
|
|
1912
1900
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1913
1901
|
"input",
|
|
1914
1902
|
__spreadValues({
|
|
@@ -1977,7 +1965,7 @@ var Image = (_a) => {
|
|
|
1977
1965
|
var Image_default = Image;
|
|
1978
1966
|
|
|
1979
1967
|
// src/components/Image/ImageEditor/ImageEditor.tsx
|
|
1980
|
-
var
|
|
1968
|
+
var import_react19 = require("react");
|
|
1981
1969
|
|
|
1982
1970
|
// src/components/Image/ImageEditor/ImageEditor.styles.ts
|
|
1983
1971
|
var imageEditorStyles = {
|
|
@@ -2396,13 +2384,13 @@ var WTouchEvent = class {
|
|
|
2396
2384
|
};
|
|
2397
2385
|
|
|
2398
2386
|
// src/components/Image/ImageEditor/MainElements/MainElements.tsx
|
|
2399
|
-
var
|
|
2387
|
+
var import_react18 = require("react");
|
|
2400
2388
|
|
|
2401
2389
|
// src/components/Image/ImageEditor/context.ts
|
|
2402
|
-
var
|
|
2403
|
-
var MyContext3 = (0,
|
|
2390
|
+
var import_react16 = require("react");
|
|
2391
|
+
var MyContext3 = (0, import_react16.createContext)(void 0);
|
|
2404
2392
|
function useMyContext3() {
|
|
2405
|
-
const data = (0,
|
|
2393
|
+
const data = (0, import_react16.useContext)(MyContext3);
|
|
2406
2394
|
if (data === void 0) throw new Error("Context is undefined");
|
|
2407
2395
|
return data;
|
|
2408
2396
|
}
|
|
@@ -2533,11 +2521,11 @@ var MainElementStyles = {
|
|
|
2533
2521
|
var MainElements_styles_default = MainElementStyles;
|
|
2534
2522
|
|
|
2535
2523
|
// src/components/Image/ImageEditor/MainElements/Rotate.tsx
|
|
2536
|
-
var
|
|
2524
|
+
var import_react17 = require("react");
|
|
2537
2525
|
var import_fa62 = require("react-icons/fa6");
|
|
2538
2526
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2539
2527
|
var Rotate = () => {
|
|
2540
|
-
const [rotate, setRotate] = (0,
|
|
2528
|
+
const [rotate, setRotate] = (0, import_react17.useState)(false);
|
|
2541
2529
|
const { transformOperation: transformOperation2, refs } = useMyContext3();
|
|
2542
2530
|
const mouseEvent = new WMouseEvent(transformOperation2);
|
|
2543
2531
|
const touchEvent = new WTouchEvent(transformOperation2);
|
|
@@ -2545,7 +2533,7 @@ var Rotate = () => {
|
|
|
2545
2533
|
const handleBackground = (value) => {
|
|
2546
2534
|
return value ? MainElements_styles_default.buttonBackgroundDown : MainElements_styles_default.buttonBackground;
|
|
2547
2535
|
};
|
|
2548
|
-
(0,
|
|
2536
|
+
(0, import_react17.useEffect)(() => {
|
|
2549
2537
|
const controller = new AbortController();
|
|
2550
2538
|
const handler = () => {
|
|
2551
2539
|
setRotate(false);
|
|
@@ -2648,16 +2636,16 @@ var MainElements = () => {
|
|
|
2648
2636
|
} = useMyContext3();
|
|
2649
2637
|
const mouseEvent = new WMouseEvent(transformOperation2);
|
|
2650
2638
|
const touchEvent = new WTouchEvent(transformOperation2);
|
|
2651
|
-
const [topLeft, settopLeft] = (0,
|
|
2652
|
-
const [topRight, settopRight] = (0,
|
|
2653
|
-
const [bottomLeft, setbottomLeft] = (0,
|
|
2654
|
-
const [bottomRight, setbottomRight] = (0,
|
|
2655
|
-
const [reRender, triggierReRender] = (0,
|
|
2639
|
+
const [topLeft, settopLeft] = (0, import_react18.useState)(false);
|
|
2640
|
+
const [topRight, settopRight] = (0, import_react18.useState)(false);
|
|
2641
|
+
const [bottomLeft, setbottomLeft] = (0, import_react18.useState)(false);
|
|
2642
|
+
const [bottomRight, setbottomRight] = (0, import_react18.useState)(false);
|
|
2643
|
+
const [reRender, triggierReRender] = (0, import_react18.useState)(false);
|
|
2656
2644
|
const { angle, width, height } = transformOperation2.getDimension();
|
|
2657
2645
|
const handleBackground = (value) => {
|
|
2658
2646
|
return value ? MainElements_styles_default.buttonBackgroundDown : MainElements_styles_default.buttonBackground;
|
|
2659
2647
|
};
|
|
2660
|
-
(0,
|
|
2648
|
+
(0, import_react18.useEffect)(() => {
|
|
2661
2649
|
const controller = new AbortController();
|
|
2662
2650
|
const handler = () => {
|
|
2663
2651
|
settopLeft(false);
|
|
@@ -2944,21 +2932,21 @@ var ImageEditor = ({
|
|
|
2944
2932
|
},
|
|
2945
2933
|
isNew = false
|
|
2946
2934
|
}) => {
|
|
2947
|
-
const container = (0,
|
|
2948
|
-
const frame = (0,
|
|
2949
|
-
const img = (0,
|
|
2950
|
-
const controller = (0,
|
|
2951
|
-
const topLeft = (0,
|
|
2952
|
-
const topRight = (0,
|
|
2953
|
-
const bottomLeft = (0,
|
|
2954
|
-
const bottomRight = (0,
|
|
2955
|
-
const rotate = (0,
|
|
2956
|
-
const rotateBottom = (0,
|
|
2957
|
-
const [transform, setTransform] = (0,
|
|
2935
|
+
const container = (0, import_react19.useRef)(null);
|
|
2936
|
+
const frame = (0, import_react19.useRef)(null);
|
|
2937
|
+
const img = (0, import_react19.useRef)(null);
|
|
2938
|
+
const controller = (0, import_react19.useRef)(null);
|
|
2939
|
+
const topLeft = (0, import_react19.useRef)(null);
|
|
2940
|
+
const topRight = (0, import_react19.useRef)(null);
|
|
2941
|
+
const bottomLeft = (0, import_react19.useRef)(null);
|
|
2942
|
+
const bottomRight = (0, import_react19.useRef)(null);
|
|
2943
|
+
const rotate = (0, import_react19.useRef)(null);
|
|
2944
|
+
const rotateBottom = (0, import_react19.useRef)(null);
|
|
2945
|
+
const [transform, setTransform] = (0, import_react19.useState)(
|
|
2958
2946
|
void 0
|
|
2959
2947
|
);
|
|
2960
|
-
const transformState = (0,
|
|
2961
|
-
const originalSrc = (0,
|
|
2948
|
+
const transformState = (0, import_react19.useRef)(void 0);
|
|
2949
|
+
const originalSrc = (0, import_react19.useMemo)(() => {
|
|
2962
2950
|
transformState.current = void 0;
|
|
2963
2951
|
return src;
|
|
2964
2952
|
}, [isNew]);
|
|
@@ -3017,7 +3005,7 @@ var ImageEditor = ({
|
|
|
3017
3005
|
function handleWindowScroll(isOpen2) {
|
|
3018
3006
|
document.body.style.overflow = isOpen2 ? "hidden" : "auto";
|
|
3019
3007
|
}
|
|
3020
|
-
(0,
|
|
3008
|
+
(0, import_react19.useEffect)(() => {
|
|
3021
3009
|
isOpen ? createTransform() : setTransform(void 0);
|
|
3022
3010
|
handleWindowScroll(isOpen);
|
|
3023
3011
|
return () => {
|
|
@@ -3551,12 +3539,12 @@ var tools = {
|
|
|
3551
3539
|
var tools_default = tools;
|
|
3552
3540
|
|
|
3553
3541
|
// src/auth/react/context.tsx
|
|
3554
|
-
var
|
|
3555
|
-
var SessionContext = (0,
|
|
3542
|
+
var import_react20 = require("react");
|
|
3543
|
+
var SessionContext = (0, import_react20.createContext)(
|
|
3556
3544
|
void 0
|
|
3557
3545
|
);
|
|
3558
3546
|
function useSession() {
|
|
3559
|
-
const data = (0,
|
|
3547
|
+
const data = (0, import_react20.useContext)(SessionContext);
|
|
3560
3548
|
if (data === void 0) throw new Error("Session context is undefined");
|
|
3561
3549
|
return data;
|
|
3562
3550
|
}
|
|
@@ -3572,11 +3560,11 @@ var SessionProvider = ({
|
|
|
3572
3560
|
var SessionProvider_default = SessionProvider;
|
|
3573
3561
|
|
|
3574
3562
|
// src/auth/react/useAuthClient.ts
|
|
3575
|
-
var
|
|
3563
|
+
var import_react21 = require("react");
|
|
3576
3564
|
var useAuthClient = (auth) => {
|
|
3577
|
-
const [isLoading, setLoading] = (0,
|
|
3578
|
-
const sessionRef = (0,
|
|
3579
|
-
(0,
|
|
3565
|
+
const [isLoading, setLoading] = (0, import_react21.useState)(false);
|
|
3566
|
+
const sessionRef = (0, import_react21.useRef)(void 0);
|
|
3567
|
+
(0, import_react21.useEffect)(() => {
|
|
3580
3568
|
let is = true;
|
|
3581
3569
|
const getSession = () => __async(null, null, function* () {
|
|
3582
3570
|
setLoading(true);
|
package/dist/index.mjs
CHANGED
|
@@ -1074,7 +1074,13 @@ var MultiSelect_default = MultiSelect;
|
|
|
1074
1074
|
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
1075
1075
|
|
|
1076
1076
|
// src/components/Buttons/gradient/Gradient.tsx
|
|
1077
|
-
import {
|
|
1077
|
+
import { useEffect as useEffect7 } from "react";
|
|
1078
|
+
import {
|
|
1079
|
+
motion,
|
|
1080
|
+
useMotionValue,
|
|
1081
|
+
useMotionTemplate,
|
|
1082
|
+
animate
|
|
1083
|
+
} from "framer-motion";
|
|
1078
1084
|
|
|
1079
1085
|
// src/components/Buttons/gradient/styles.ts
|
|
1080
1086
|
var borderRadius = "20px";
|
|
@@ -1083,7 +1089,7 @@ var styles6 = (first, second) => {
|
|
|
1083
1089
|
container: {
|
|
1084
1090
|
position: "relative",
|
|
1085
1091
|
borderRadius,
|
|
1086
|
-
padding: "
|
|
1092
|
+
padding: "1px"
|
|
1087
1093
|
},
|
|
1088
1094
|
btn: {
|
|
1089
1095
|
position: "relative",
|
|
@@ -1094,9 +1100,10 @@ var styles6 = (first, second) => {
|
|
|
1094
1100
|
padding: "2px",
|
|
1095
1101
|
borderRadius,
|
|
1096
1102
|
backgroundColor: `${first}`,
|
|
1097
|
-
backgroundImage: `linear-gradient(
|
|
1103
|
+
backgroundImage: `linear-gradient(${120}deg, ${first} 0%, ${second} 100%)`,
|
|
1098
1104
|
border: "none",
|
|
1099
|
-
cursor: "pointer"
|
|
1105
|
+
cursor: "pointer",
|
|
1106
|
+
width: "100%"
|
|
1100
1107
|
},
|
|
1101
1108
|
btnAfter: {
|
|
1102
1109
|
position: "absolute",
|
|
@@ -1107,8 +1114,13 @@ var styles6 = (first, second) => {
|
|
|
1107
1114
|
content: '""',
|
|
1108
1115
|
zIndex: 0,
|
|
1109
1116
|
backgroundColor: `${first}`,
|
|
1110
|
-
backgroundImage: `linear-gradient(
|
|
1111
|
-
filter: "blur(
|
|
1117
|
+
backgroundImage: `linear-gradient(${120}deg, ${first} 0%, ${second} 100%)`,
|
|
1118
|
+
filter: "blur(8px)",
|
|
1119
|
+
borderRadius
|
|
1120
|
+
},
|
|
1121
|
+
labelWrapper: {
|
|
1122
|
+
position: "relative",
|
|
1123
|
+
width: "100%"
|
|
1112
1124
|
},
|
|
1113
1125
|
label: {
|
|
1114
1126
|
backgroundColor: "#111723",
|
|
@@ -1142,16 +1154,6 @@ var styles6 = (first, second) => {
|
|
|
1142
1154
|
position: "relative",
|
|
1143
1155
|
zIndex: 1,
|
|
1144
1156
|
margin: 0
|
|
1145
|
-
},
|
|
1146
|
-
neon: {
|
|
1147
|
-
content: '""',
|
|
1148
|
-
background: "conic-gradient(transparent 270deg, green, transparent)",
|
|
1149
|
-
position: "absolute",
|
|
1150
|
-
top: "50%",
|
|
1151
|
-
left: "50%",
|
|
1152
|
-
transform: "translate(-50%, -50%)",
|
|
1153
|
-
aspectRatio: 1,
|
|
1154
|
-
width: "100%"
|
|
1155
1157
|
}
|
|
1156
1158
|
};
|
|
1157
1159
|
return styles12;
|
|
@@ -1163,54 +1165,43 @@ import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
|
1163
1165
|
var Gradient = () => {
|
|
1164
1166
|
const data = useButtonContext();
|
|
1165
1167
|
const styles12 = styles_default6(data.first, data.second);
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
"div",
|
|
1177
|
-
{
|
|
1178
|
-
style: __spreadProps(__spreadValues({}, styles12.label), {
|
|
1179
|
-
backgroundColor: data.main
|
|
1180
|
-
}),
|
|
1181
|
-
children: /* @__PURE__ */ jsxs8(
|
|
1182
|
-
"p",
|
|
1183
|
-
{
|
|
1184
|
-
style: __spreadProps(__spreadValues({}, styles12.p), {
|
|
1185
|
-
color: `${data.text}`
|
|
1186
|
-
}),
|
|
1187
|
-
children: [
|
|
1188
|
-
data.children,
|
|
1189
|
-
" ",
|
|
1190
|
-
data.content
|
|
1191
|
-
]
|
|
1192
|
-
}
|
|
1193
|
-
)
|
|
1194
|
-
}
|
|
1195
|
-
),
|
|
1196
|
-
/* @__PURE__ */ jsx10("div", { style: styles12.labelAfter })
|
|
1197
|
-
] }) })),
|
|
1198
|
-
!data.isLoading && /* @__PURE__ */ jsx10("div", { style: styles12.btnAfter }),
|
|
1199
|
-
data.isLoading && /* @__PURE__ */ jsx10(
|
|
1200
|
-
motion.div,
|
|
1201
|
-
{
|
|
1202
|
-
style: styles12.btnAfter,
|
|
1203
|
-
animate: { rotate: 360 },
|
|
1204
|
-
transition: {
|
|
1205
|
-
ease: "linear",
|
|
1206
|
-
repeat: Infinity,
|
|
1207
|
-
duration: 3
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1210
|
-
)
|
|
1211
|
-
]
|
|
1168
|
+
const angle = useMotionValue(10);
|
|
1169
|
+
const background2 = useMotionTemplate`conic-gradient(from ${angle}deg, #00000000 60%, ${data.first}, ${data.second})`;
|
|
1170
|
+
useEffect7(() => {
|
|
1171
|
+
if (data.isLoading) {
|
|
1172
|
+
const controls = animate(angle, angle.get() + 360, {
|
|
1173
|
+
repeat: Infinity,
|
|
1174
|
+
duration: 2,
|
|
1175
|
+
ease: "linear"
|
|
1176
|
+
});
|
|
1177
|
+
return controls.stop;
|
|
1212
1178
|
}
|
|
1213
|
-
);
|
|
1179
|
+
}, [data.isLoading, angle]);
|
|
1180
|
+
return /* @__PURE__ */ jsxs8("div", { style: styles12.container, children: [
|
|
1181
|
+
/* @__PURE__ */ jsx10("button", __spreadProps(__spreadValues({ style: styles12.btn }, data.props), { children: /* @__PURE__ */ jsxs8("div", { style: styles12.labelWrapper, children: [
|
|
1182
|
+
/* @__PURE__ */ jsx10("div", { style: styles12.labelBefore }),
|
|
1183
|
+
/* @__PURE__ */ jsx10(
|
|
1184
|
+
"div",
|
|
1185
|
+
{
|
|
1186
|
+
style: __spreadProps(__spreadValues({}, styles12.label), { backgroundColor: data.main }),
|
|
1187
|
+
children: /* @__PURE__ */ jsxs8("p", { style: __spreadProps(__spreadValues({}, styles12.p), { color: `${data.text}` }), children: [
|
|
1188
|
+
data.children,
|
|
1189
|
+
" ",
|
|
1190
|
+
data.content
|
|
1191
|
+
] })
|
|
1192
|
+
}
|
|
1193
|
+
),
|
|
1194
|
+
/* @__PURE__ */ jsx10("div", { style: styles12.labelAfter })
|
|
1195
|
+
] }) })),
|
|
1196
|
+
/* @__PURE__ */ jsx10(
|
|
1197
|
+
motion.div,
|
|
1198
|
+
{
|
|
1199
|
+
style: __spreadProps(__spreadValues({}, styles12.btnAfter), {
|
|
1200
|
+
background: background2
|
|
1201
|
+
})
|
|
1202
|
+
}
|
|
1203
|
+
)
|
|
1204
|
+
] });
|
|
1214
1205
|
};
|
|
1215
1206
|
var Gradient_default = Gradient;
|
|
1216
1207
|
|
|
@@ -1414,7 +1405,8 @@ var styles8 = (first) => {
|
|
|
1414
1405
|
color: first,
|
|
1415
1406
|
backgroundColor: `color-mix(in srgb, ${first} 20%, transparent)`,
|
|
1416
1407
|
fontSize: "15px",
|
|
1417
|
-
transition: "all .1s linear"
|
|
1408
|
+
transition: "all .1s linear",
|
|
1409
|
+
whiteSpace: "nowrap"
|
|
1418
1410
|
}
|
|
1419
1411
|
};
|
|
1420
1412
|
return styles12;
|
|
@@ -1452,13 +1444,14 @@ var Modern = (_a) => {
|
|
|
1452
1444
|
const borderTransparent = `solid 1px ${transparentColor}`;
|
|
1453
1445
|
return /* @__PURE__ */ jsx13(
|
|
1454
1446
|
"a",
|
|
1455
|
-
__spreadProps(__spreadValues({
|
|
1447
|
+
__spreadProps(__spreadValues({
|
|
1456
1448
|
style: __spreadValues(__spreadProps(__spreadValues({}, styles_default8(first).btn), {
|
|
1457
1449
|
border: hover ? isHover ? `${borderFirst}` : `${borderTransparent}` : `${borderFirst}`,
|
|
1458
1450
|
boxShadow: hover ? isHover ? `${shadowTransparent}` : `` : shadow ? `${shadowTransparent}` : ""
|
|
1459
1451
|
}), style),
|
|
1460
1452
|
onMouseEnter: handleEnter,
|
|
1461
|
-
onMouseLeave: handleLeave
|
|
1453
|
+
onMouseLeave: handleLeave
|
|
1454
|
+
}, props), {
|
|
1462
1455
|
children
|
|
1463
1456
|
})
|
|
1464
1457
|
);
|
|
@@ -1521,7 +1514,7 @@ var styles9 = {
|
|
|
1521
1514
|
var styles_default9 = styles9;
|
|
1522
1515
|
|
|
1523
1516
|
// src/components/Avatar/Avatar.tsx
|
|
1524
|
-
import { useEffect as
|
|
1517
|
+
import { useEffect as useEffect8, useRef as useRef7, useState as useState8 } from "react";
|
|
1525
1518
|
import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1526
1519
|
var Avatar = ({ src, setValue, options }) => {
|
|
1527
1520
|
const [isOpen, setOpen] = useState8(false);
|
|
@@ -1531,7 +1524,7 @@ var Avatar = ({ src, setValue, options }) => {
|
|
|
1531
1524
|
const uploadImageRef = useRef7(null);
|
|
1532
1525
|
const isAbleToEdit = initialImage.current ? src !== defaultImage.current && src !== initialImage.current : false;
|
|
1533
1526
|
const isAbleToRemove = initialImage.current ? src !== defaultImage.current : false;
|
|
1534
|
-
|
|
1527
|
+
useEffect8(() => {
|
|
1535
1528
|
(function setSrc() {
|
|
1536
1529
|
return __async(this, null, function* () {
|
|
1537
1530
|
var _a, _b;
|
|
@@ -1612,7 +1605,7 @@ var Avatar = ({ src, setValue, options }) => {
|
|
|
1612
1605
|
var Avatar_default = Avatar;
|
|
1613
1606
|
|
|
1614
1607
|
// src/components/Input/InputGoogle/InputGoogle.tsx
|
|
1615
|
-
import { useEffect as
|
|
1608
|
+
import { useEffect as useEffect9, useRef as useRef8, useState as useState9 } from "react";
|
|
1616
1609
|
|
|
1617
1610
|
// src/components/Input/InputGoogle/InputGoogle.styles.ts
|
|
1618
1611
|
var others2 = {
|
|
@@ -1624,7 +1617,7 @@ var others2 = {
|
|
|
1624
1617
|
borderFocus: "#0957d0",
|
|
1625
1618
|
textRelease: "#000",
|
|
1626
1619
|
textFocus: "#0957d0",
|
|
1627
|
-
border: "solid
|
|
1620
|
+
border: "solid 1px"
|
|
1628
1621
|
};
|
|
1629
1622
|
var styles10 = {
|
|
1630
1623
|
input: {
|
|
@@ -1692,7 +1685,7 @@ var InputGoogle = (_a) => {
|
|
|
1692
1685
|
}
|
|
1693
1686
|
const inputBorder = isFocus ? `${others2.border} ${options ? options.focusColor : others2.borderFocus}` : `${others2.border} ${others2.borderRelease}`;
|
|
1694
1687
|
const labelTextColor = isFocus ? `${options ? options.focusColor : others2.textFocus}` : `${others2.textRelease}`;
|
|
1695
|
-
|
|
1688
|
+
useEffect9(() => {
|
|
1696
1689
|
transitionOnFocus();
|
|
1697
1690
|
transitionOffFocus();
|
|
1698
1691
|
}, []);
|
|
@@ -1729,7 +1722,7 @@ var InputGoogle = (_a) => {
|
|
|
1729
1722
|
var InputGoogle_default = InputGoogle;
|
|
1730
1723
|
|
|
1731
1724
|
// src/components/Input/TextArea/TextArea.tsx
|
|
1732
|
-
import { useEffect as
|
|
1725
|
+
import { useEffect as useEffect10, useRef as useRef9, useState as useState10 } from "react";
|
|
1733
1726
|
|
|
1734
1727
|
// src/components/Input/TextArea/TextArea.styles.ts
|
|
1735
1728
|
var labelHeight = 20;
|
|
@@ -1742,7 +1735,7 @@ var others3 = {
|
|
|
1742
1735
|
borderFocus: "#0957d0",
|
|
1743
1736
|
textRelease: "#000",
|
|
1744
1737
|
textFocus: "#0957d0",
|
|
1745
|
-
border: "solid
|
|
1738
|
+
border: "solid 1px"
|
|
1746
1739
|
};
|
|
1747
1740
|
var styles11 = {
|
|
1748
1741
|
input: {
|
|
@@ -1813,7 +1806,7 @@ var TextArea = (_a) => {
|
|
|
1813
1806
|
}
|
|
1814
1807
|
const inputBorder = isFocus ? `${others3.border} ${options ? options.focusColor : others3.borderFocus}` : `${others3.border} ${others3.borderRelease}`;
|
|
1815
1808
|
const labelTextColor = isFocus ? `${options ? options.focusColor : others3.textFocus}` : `${others3.textRelease}`;
|
|
1816
|
-
|
|
1809
|
+
useEffect10(() => {
|
|
1817
1810
|
transitionOnFocus();
|
|
1818
1811
|
transitionOffFocus();
|
|
1819
1812
|
}, []);
|
|
@@ -1933,7 +1926,7 @@ var Image = (_a) => {
|
|
|
1933
1926
|
var Image_default = Image;
|
|
1934
1927
|
|
|
1935
1928
|
// src/components/Image/ImageEditor/ImageEditor.tsx
|
|
1936
|
-
import { useEffect as
|
|
1929
|
+
import { useEffect as useEffect13, useMemo, useRef as useRef10, useState as useState14 } from "react";
|
|
1937
1930
|
|
|
1938
1931
|
// src/components/Image/ImageEditor/ImageEditor.styles.ts
|
|
1939
1932
|
var imageEditorStyles = {
|
|
@@ -2352,7 +2345,7 @@ var WTouchEvent = class {
|
|
|
2352
2345
|
};
|
|
2353
2346
|
|
|
2354
2347
|
// src/components/Image/ImageEditor/MainElements/MainElements.tsx
|
|
2355
|
-
import { useEffect as
|
|
2348
|
+
import { useEffect as useEffect12, useState as useState13 } from "react";
|
|
2356
2349
|
|
|
2357
2350
|
// src/components/Image/ImageEditor/context.ts
|
|
2358
2351
|
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
@@ -2489,7 +2482,7 @@ var MainElementStyles = {
|
|
|
2489
2482
|
var MainElements_styles_default = MainElementStyles;
|
|
2490
2483
|
|
|
2491
2484
|
// src/components/Image/ImageEditor/MainElements/Rotate.tsx
|
|
2492
|
-
import { useEffect as
|
|
2485
|
+
import { useEffect as useEffect11, useState as useState12 } from "react";
|
|
2493
2486
|
import { FaArrowRotateLeft } from "react-icons/fa6";
|
|
2494
2487
|
import { Fragment as Fragment2, jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2495
2488
|
var Rotate = () => {
|
|
@@ -2501,7 +2494,7 @@ var Rotate = () => {
|
|
|
2501
2494
|
const handleBackground = (value) => {
|
|
2502
2495
|
return value ? MainElements_styles_default.buttonBackgroundDown : MainElements_styles_default.buttonBackground;
|
|
2503
2496
|
};
|
|
2504
|
-
|
|
2497
|
+
useEffect11(() => {
|
|
2505
2498
|
const controller = new AbortController();
|
|
2506
2499
|
const handler = () => {
|
|
2507
2500
|
setRotate(false);
|
|
@@ -2613,7 +2606,7 @@ var MainElements = () => {
|
|
|
2613
2606
|
const handleBackground = (value) => {
|
|
2614
2607
|
return value ? MainElements_styles_default.buttonBackgroundDown : MainElements_styles_default.buttonBackground;
|
|
2615
2608
|
};
|
|
2616
|
-
|
|
2609
|
+
useEffect12(() => {
|
|
2617
2610
|
const controller = new AbortController();
|
|
2618
2611
|
const handler = () => {
|
|
2619
2612
|
settopLeft(false);
|
|
@@ -2973,7 +2966,7 @@ var ImageEditor = ({
|
|
|
2973
2966
|
function handleWindowScroll(isOpen2) {
|
|
2974
2967
|
document.body.style.overflow = isOpen2 ? "hidden" : "auto";
|
|
2975
2968
|
}
|
|
2976
|
-
|
|
2969
|
+
useEffect13(() => {
|
|
2977
2970
|
isOpen ? createTransform() : setTransform(void 0);
|
|
2978
2971
|
handleWindowScroll(isOpen);
|
|
2979
2972
|
return () => {
|
|
@@ -3528,11 +3521,11 @@ var SessionProvider = ({
|
|
|
3528
3521
|
var SessionProvider_default = SessionProvider;
|
|
3529
3522
|
|
|
3530
3523
|
// src/auth/react/useAuthClient.ts
|
|
3531
|
-
import { useEffect as
|
|
3524
|
+
import { useEffect as useEffect14, useRef as useRef11, useState as useState15 } from "react";
|
|
3532
3525
|
var useAuthClient = (auth) => {
|
|
3533
3526
|
const [isLoading, setLoading] = useState15(false);
|
|
3534
3527
|
const sessionRef = useRef11(void 0);
|
|
3535
|
-
|
|
3528
|
+
useEffect14(() => {
|
|
3536
3529
|
let is = true;
|
|
3537
3530
|
const getSession = () => __async(null, null, function* () {
|
|
3538
3531
|
setLoading(true);
|