mayak-common-library 0.0.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/.eslintrc.json +3 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/next-common-library-2.0.iml +12 -0
- package/.idea/vcs.xml +6 -0
- package/README.md +36 -0
- package/dist/close-4XJDSDVO.svg +4 -0
- package/dist/dropdown-arrow-CDZAF5GJ.svg +3 -0
- package/dist/index.css +35 -0
- package/dist/index.d.mts +112 -0
- package/dist/index.d.ts +112 -0
- package/dist/index.js +661 -0
- package/dist/index.mjs +616 -0
- package/dist/search-HJGCO2DZ.svg +3 -0
- package/package.json +53 -0
- package/tailwind.config.js +34 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,661 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var src_exports = {};
|
|
32
|
+
__export(src_exports, {
|
|
33
|
+
AppBar: () => AppBar_default,
|
|
34
|
+
Avatar: () => Avatar_default,
|
|
35
|
+
Badge: () => Badge_default,
|
|
36
|
+
Button: () => Button_default,
|
|
37
|
+
Chip: () => Chip_default,
|
|
38
|
+
FromToInput: () => FromToInput_default,
|
|
39
|
+
Greet: () => Greet,
|
|
40
|
+
IconButton: () => IconButton_default,
|
|
41
|
+
Input: () => Input_default,
|
|
42
|
+
MenuItem: () => MenuItem_default,
|
|
43
|
+
PhoneInput: () => PhoneInput_default,
|
|
44
|
+
Providers: () => Providers_default,
|
|
45
|
+
Radio: () => Radio_default,
|
|
46
|
+
RadioGroup: () => RadioGroup_default,
|
|
47
|
+
Select: () => Select_default,
|
|
48
|
+
SelectPro: () => SelectPro_default,
|
|
49
|
+
Slider: () => Slider_default,
|
|
50
|
+
Switch: () => Switch_default,
|
|
51
|
+
Text: () => Text_default
|
|
52
|
+
});
|
|
53
|
+
module.exports = __toCommonJS(src_exports);
|
|
54
|
+
|
|
55
|
+
// src/components/Greet.tsx
|
|
56
|
+
function Greet(props) {
|
|
57
|
+
const { name } = props;
|
|
58
|
+
return /* @__PURE__ */ React.createElement("div", null, "Hello ", name);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// src/components/Button/Button.tsx
|
|
62
|
+
var import_Button = __toESM(require("@mui/material/Button"));
|
|
63
|
+
var import_material = require("@mui/material");
|
|
64
|
+
var import_Typography = __toESM(require("@mui/material/Typography"));
|
|
65
|
+
var StyledButton = (0, import_material.styled)(import_Button.default)(() => ({
|
|
66
|
+
textTransform: "none",
|
|
67
|
+
width: "fit-content",
|
|
68
|
+
color: "#343434",
|
|
69
|
+
"&:hover": {
|
|
70
|
+
backgroundColor: "unset",
|
|
71
|
+
svg: {
|
|
72
|
+
filter: "brightness(0) saturate(100%) invert(95%) sepia(10%) saturate(806%) hue-rotate(339deg) brightness(83%) contrast(85%)"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
transition: "transform 0.1s ease-in-out",
|
|
76
|
+
"&:active": {
|
|
77
|
+
// p: {
|
|
78
|
+
// transform: "scale(0.99)",
|
|
79
|
+
// },
|
|
80
|
+
}
|
|
81
|
+
}));
|
|
82
|
+
var Button = (props) => {
|
|
83
|
+
const { children, base, bolt, border, small, large, ...rest } = props;
|
|
84
|
+
return /* @__PURE__ */ React.createElement(
|
|
85
|
+
StyledButton,
|
|
86
|
+
{
|
|
87
|
+
...rest,
|
|
88
|
+
disableRipple: true,
|
|
89
|
+
className: `${base ? "bg-accent-dark rounded-none text-white hover:bg-accent-beige text-base" : ""}
|
|
90
|
+
${small ? "py-1.5 px-4" : ""}
|
|
91
|
+
${large ? "py-5 px-10" : ""}
|
|
92
|
+
${border ? "border-b border-solid rounded-none" : ""}`
|
|
93
|
+
},
|
|
94
|
+
/* @__PURE__ */ React.createElement(
|
|
95
|
+
import_Typography.default,
|
|
96
|
+
{
|
|
97
|
+
className: `${bolt ? "font-extrabold leading-4" : "font-normal leading-3"}`
|
|
98
|
+
},
|
|
99
|
+
children
|
|
100
|
+
)
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
var Button_default = Button;
|
|
104
|
+
|
|
105
|
+
// src/components/Button/IconButton.tsx
|
|
106
|
+
var import_material2 = require("@mui/material");
|
|
107
|
+
var StyledButton2 = (0, import_material2.styled)(import_material2.IconButton)(() => ({
|
|
108
|
+
width: "fit-content",
|
|
109
|
+
borderRadius: 0,
|
|
110
|
+
svg: {
|
|
111
|
+
margin: "1px 0 0 0px"
|
|
112
|
+
},
|
|
113
|
+
"&:hover": {
|
|
114
|
+
svg: {
|
|
115
|
+
filter: "brightness(0) saturate(100%) invert(95%) sepia(10%) saturate(806%) hue-rotate(339deg) brightness(83%) contrast(85%)"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}));
|
|
119
|
+
var IconButton = (props) => {
|
|
120
|
+
const { children, ...rest } = props;
|
|
121
|
+
return /* @__PURE__ */ React.createElement(StyledButton2, { ...rest, disableRipple: true }, children);
|
|
122
|
+
};
|
|
123
|
+
var IconButton_default = IconButton;
|
|
124
|
+
|
|
125
|
+
// src/components/Select/Select.tsx
|
|
126
|
+
var import_react = require("react");
|
|
127
|
+
var import_material3 = require("@mui/material");
|
|
128
|
+
|
|
129
|
+
// src/assets/dropdown-arrow.svg
|
|
130
|
+
var dropdown_arrow_default = "./dropdown-arrow-CDZAF5GJ.svg";
|
|
131
|
+
|
|
132
|
+
// src/components/Select/Select.tsx
|
|
133
|
+
var StyledSelect = (0, import_material3.styled)(import_material3.Select)(({ open }) => ({
|
|
134
|
+
minWidth: 250,
|
|
135
|
+
"&.MuiInputBase-root": {
|
|
136
|
+
borderRadius: "0",
|
|
137
|
+
transition: "0.3s ease-in-out",
|
|
138
|
+
"&.Mui-focused": {
|
|
139
|
+
backgroundColor: open ? "white" : "transparent"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
svg: {
|
|
143
|
+
// Added '&' to the beginning of the selector
|
|
144
|
+
position: "absolute",
|
|
145
|
+
right: "18px",
|
|
146
|
+
transform: `${open ? "rotate(180deg)" : "rotate(0deg)"}`
|
|
147
|
+
// Moved the transform style here and added a condition based on the 'open' prop
|
|
148
|
+
},
|
|
149
|
+
".MuiOutlinedInput-notchedOutline": {
|
|
150
|
+
// transition: '0.3s ease-in-out',
|
|
151
|
+
borderColor: "#343434 "
|
|
152
|
+
},
|
|
153
|
+
// '.MuiSvgIcon-root':{
|
|
154
|
+
// transition: '0.3s ease-in-out',
|
|
155
|
+
// },
|
|
156
|
+
":hover": {
|
|
157
|
+
".MuiOutlinedInput-notchedOutline": {
|
|
158
|
+
borderColor: "#343434"
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"&.Mui-focused fieldset": {
|
|
162
|
+
"&.MuiOutlinedInput-notchedOutline": {
|
|
163
|
+
// borderColor: 'accent-dark',
|
|
164
|
+
border: "none"
|
|
165
|
+
// all: 'unset'
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}));
|
|
169
|
+
var CustomSelect = (props) => {
|
|
170
|
+
const { children, placeholder, ...rest } = props;
|
|
171
|
+
const myRef = (0, import_react.useRef)(null);
|
|
172
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
173
|
+
const uniqueId = "select_" + Math.random().toFixed(5).slice(2);
|
|
174
|
+
const handleOpen = () => {
|
|
175
|
+
setOpen(true);
|
|
176
|
+
};
|
|
177
|
+
const handleClose = () => {
|
|
178
|
+
setOpen(false);
|
|
179
|
+
};
|
|
180
|
+
(0, import_react.useEffect)(() => {
|
|
181
|
+
if (!open) myRef.current?.classList.remove("Mui-focused");
|
|
182
|
+
}, [open]);
|
|
183
|
+
return /* @__PURE__ */ React.createElement(
|
|
184
|
+
StyledSelect,
|
|
185
|
+
{
|
|
186
|
+
...rest,
|
|
187
|
+
ref: myRef,
|
|
188
|
+
open,
|
|
189
|
+
onOpen: handleOpen,
|
|
190
|
+
onClose: handleClose,
|
|
191
|
+
sx: {
|
|
192
|
+
"& .MuiSelect-select .notranslate::after": placeholder ? {
|
|
193
|
+
content: `"${placeholder}"`
|
|
194
|
+
// opacity: 0.42,
|
|
195
|
+
} : {}
|
|
196
|
+
},
|
|
197
|
+
inputProps: { "aria-labelledby": uniqueId },
|
|
198
|
+
className: `h-12 `,
|
|
199
|
+
MenuProps: {
|
|
200
|
+
disableScrollLock: true,
|
|
201
|
+
// ref: menuRef,
|
|
202
|
+
id: uniqueId,
|
|
203
|
+
PaperProps: {
|
|
204
|
+
classes: {
|
|
205
|
+
root: `menu ${open ? "menu--open" : "menu--close"}`
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
IconComponent: () => /* @__PURE__ */ React.createElement(dropdown_arrow_default, null)
|
|
210
|
+
},
|
|
211
|
+
children
|
|
212
|
+
);
|
|
213
|
+
};
|
|
214
|
+
var Select_default = CustomSelect;
|
|
215
|
+
|
|
216
|
+
// src/assets/search.svg
|
|
217
|
+
var search_default = "./search-HJGCO2DZ.svg";
|
|
218
|
+
|
|
219
|
+
// src/components/Select/SelectPro.tsx
|
|
220
|
+
var import_react2 = require("react");
|
|
221
|
+
var import_material4 = require("@mui/material");
|
|
222
|
+
|
|
223
|
+
// src/assets/close.svg
|
|
224
|
+
var close_default = "./close-4XJDSDVO.svg";
|
|
225
|
+
|
|
226
|
+
// src/components/Select/SelectPro.tsx
|
|
227
|
+
var SelectPro = ({
|
|
228
|
+
children,
|
|
229
|
+
placeholder,
|
|
230
|
+
childTitle,
|
|
231
|
+
colorBorder = false,
|
|
232
|
+
clickComponent,
|
|
233
|
+
fullContainerWidth = false,
|
|
234
|
+
overButton = false,
|
|
235
|
+
small = false
|
|
236
|
+
}) => {
|
|
237
|
+
const [btn, setAnchorEl] = (0, import_react2.useState)(null);
|
|
238
|
+
const [open, setOpen] = (0, import_react2.useState)(false);
|
|
239
|
+
const handleClick = (event) => {
|
|
240
|
+
if (open)
|
|
241
|
+
setTimeout(() => {
|
|
242
|
+
setAnchorEl(null);
|
|
243
|
+
}, 200);
|
|
244
|
+
else setAnchorEl(event.currentTarget);
|
|
245
|
+
setOpen(!open);
|
|
246
|
+
};
|
|
247
|
+
const handleClose = () => {
|
|
248
|
+
setOpen(false);
|
|
249
|
+
setTimeout(() => {
|
|
250
|
+
setAnchorEl(null);
|
|
251
|
+
}, 200);
|
|
252
|
+
};
|
|
253
|
+
const childrenWithHandleChange = (0, import_react2.isValidElement)(children) ? (0, import_react2.cloneElement)(children, {
|
|
254
|
+
collapseParent: handleClose
|
|
255
|
+
}) : children;
|
|
256
|
+
return /* @__PURE__ */ React.createElement(import_material4.ClickAwayListener, { onClickAway: handleClose }, /* @__PURE__ */ React.createElement(import_material4.Box, null, clickComponent ? (0, import_react2.cloneElement)(clickComponent, {
|
|
257
|
+
ref: btn,
|
|
258
|
+
onClick: handleClick
|
|
259
|
+
}) : /* @__PURE__ */ React.createElement(
|
|
260
|
+
import_material4.Button,
|
|
261
|
+
{
|
|
262
|
+
ref: btn,
|
|
263
|
+
"aria-controls": open ? "basic-menu" : void 0,
|
|
264
|
+
"aria-haspopup": "true",
|
|
265
|
+
"aria-expanded": open ? "true" : void 0,
|
|
266
|
+
onClick: handleClick,
|
|
267
|
+
disableRipple: true,
|
|
268
|
+
fullWidth: true,
|
|
269
|
+
sx: {
|
|
270
|
+
height: small ? "34px" : "49px",
|
|
271
|
+
padding: small ? "0 10px 0 6px" : "0 20px 0 19px"
|
|
272
|
+
},
|
|
273
|
+
className: `border rounded-none border-solid normal-case text-accent-dark hover:bg-white ${open ? "!border-transparent bg-white" : ""} ${colorBorder ? "border-accent-beige flex-row-reverse justify-end gap-x-2" : "justify-between border-accent-dark"}`
|
|
274
|
+
},
|
|
275
|
+
/* @__PURE__ */ React.createElement(
|
|
276
|
+
import_material4.Typography,
|
|
277
|
+
{
|
|
278
|
+
className: "text-sm leading-4"
|
|
279
|
+
},
|
|
280
|
+
`${placeholder}`
|
|
281
|
+
),
|
|
282
|
+
colorBorder ? /* @__PURE__ */ React.createElement(search_default, null) : /* @__PURE__ */ React.createElement(
|
|
283
|
+
dropdown_arrow_default,
|
|
284
|
+
{
|
|
285
|
+
style: {
|
|
286
|
+
transform: open ? "scaleY(-1)" : "scaleY(1)",
|
|
287
|
+
transition: "0.3s ease-in-out"
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
)
|
|
291
|
+
), btn ? /* @__PURE__ */ React.createElement(
|
|
292
|
+
import_material4.Paper,
|
|
293
|
+
{
|
|
294
|
+
sx: {
|
|
295
|
+
position: "absolute",
|
|
296
|
+
width: !fullContainerWidth && btn ? btn.offsetWidth : "100%",
|
|
297
|
+
left: fullContainerWidth ? 0 : "initial",
|
|
298
|
+
right: fullContainerWidth ? 0 : "initial",
|
|
299
|
+
top: overButton ? 0 : "initial"
|
|
300
|
+
},
|
|
301
|
+
className: `menu ${open ? "menu--open" : "menu--close"} z-50 rounded-none shadow-sm`
|
|
302
|
+
},
|
|
303
|
+
/* @__PURE__ */ React.createElement(import_material4.Box, { className: `flex flex-col p-3 gap-3` }, overButton ? /* @__PURE__ */ React.createElement(
|
|
304
|
+
IconButton_default,
|
|
305
|
+
{
|
|
306
|
+
className: "bg-accent-silver p-1 self-end absolute",
|
|
307
|
+
onClick: handleClose
|
|
308
|
+
},
|
|
309
|
+
/* @__PURE__ */ React.createElement(close_default, null)
|
|
310
|
+
) : null, childTitle ? /* @__PURE__ */ React.createElement(
|
|
311
|
+
import_material4.Typography,
|
|
312
|
+
{
|
|
313
|
+
className: "text-sm font-normal text-accent-silver-2"
|
|
314
|
+
},
|
|
315
|
+
childTitle
|
|
316
|
+
) : null, childrenWithHandleChange)
|
|
317
|
+
) : null));
|
|
318
|
+
};
|
|
319
|
+
var SelectPro_default = SelectPro;
|
|
320
|
+
|
|
321
|
+
// src/components/Chip/Chip.tsx
|
|
322
|
+
var import_material5 = require("@mui/material");
|
|
323
|
+
var StyledChip = (0, import_material5.styled)(import_material5.Chip)(({ theme: theme2 }) => ({
|
|
324
|
+
borderRadius: theme2.shape.borderRadius
|
|
325
|
+
}));
|
|
326
|
+
var ChipViews = {
|
|
327
|
+
black: "bg-accent-dark text-accent-white py-1.5 px-4",
|
|
328
|
+
line: "border border-solid border-accent-dark bg-accent-white",
|
|
329
|
+
white: "bg-accent-white text-accent-dark",
|
|
330
|
+
silver: "bg-accent-silver"
|
|
331
|
+
};
|
|
332
|
+
var CustomChip = (props) => {
|
|
333
|
+
const { view, ...rest } = props;
|
|
334
|
+
return /* @__PURE__ */ React.createElement(
|
|
335
|
+
StyledChip,
|
|
336
|
+
{
|
|
337
|
+
className: `rounded-none w-fit h-fit px-2.5 py-0 ${ChipViews[view]}`,
|
|
338
|
+
...rest
|
|
339
|
+
}
|
|
340
|
+
);
|
|
341
|
+
};
|
|
342
|
+
var Chip_default = CustomChip;
|
|
343
|
+
|
|
344
|
+
// src/components/Badge/Badge.tsx
|
|
345
|
+
var import_material6 = require("@mui/material");
|
|
346
|
+
var CustomBadge = (props) => {
|
|
347
|
+
return /* @__PURE__ */ React.createElement(import_material6.Badge, { ...props });
|
|
348
|
+
};
|
|
349
|
+
var Badge_default = CustomBadge;
|
|
350
|
+
|
|
351
|
+
// src/components/Avatar/Avatar.tsx
|
|
352
|
+
var import_Avatar = __toESM(require("@mui/material/Avatar"));
|
|
353
|
+
var CustomAvatar = (props) => {
|
|
354
|
+
return /* @__PURE__ */ React.createElement(import_Avatar.default, { ...props });
|
|
355
|
+
};
|
|
356
|
+
var Avatar_default = CustomAvatar;
|
|
357
|
+
|
|
358
|
+
// src/components/Text/Text.tsx
|
|
359
|
+
var import_Typography2 = __toESM(require("@mui/material/Typography"));
|
|
360
|
+
var Text = (props) => {
|
|
361
|
+
const { children, ...rest } = props;
|
|
362
|
+
return /* @__PURE__ */ React.createElement(import_Typography2.default, { ...rest }, children);
|
|
363
|
+
};
|
|
364
|
+
var Text_default = Text;
|
|
365
|
+
|
|
366
|
+
// src/components/Radio/Radio.tsx
|
|
367
|
+
var import_react3 = __toESM(require("react"));
|
|
368
|
+
var import_Radio = __toESM(require("@mui/material/Radio"));
|
|
369
|
+
var import_FormControlLabel = __toESM(require("@mui/material/FormControlLabel"));
|
|
370
|
+
var CustomRadio = (props) => {
|
|
371
|
+
const { value, label, radioProps, labelProps } = props;
|
|
372
|
+
if (label && value)
|
|
373
|
+
return /* @__PURE__ */ import_react3.default.createElement(
|
|
374
|
+
import_FormControlLabel.default,
|
|
375
|
+
{
|
|
376
|
+
value,
|
|
377
|
+
control: /* @__PURE__ */ import_react3.default.createElement(import_Radio.default, { ...radioProps }),
|
|
378
|
+
label,
|
|
379
|
+
...labelProps
|
|
380
|
+
}
|
|
381
|
+
);
|
|
382
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_Radio.default, { ...radioProps });
|
|
383
|
+
};
|
|
384
|
+
var Radio_default = CustomRadio;
|
|
385
|
+
|
|
386
|
+
// src/components/RadioGroup/RadioGroup.tsx
|
|
387
|
+
var import_react4 = __toESM(require("react"));
|
|
388
|
+
var import_RadioGroup = __toESM(require("@mui/material/RadioGroup"));
|
|
389
|
+
var CustomRadioGroup = (props) => {
|
|
390
|
+
const { children, ...rest } = props;
|
|
391
|
+
return /* @__PURE__ */ import_react4.default.createElement(import_RadioGroup.default, { ...rest }, children);
|
|
392
|
+
};
|
|
393
|
+
var RadioGroup_default = CustomRadioGroup;
|
|
394
|
+
|
|
395
|
+
// src/components/Switch/Switch.tsx
|
|
396
|
+
var import_material7 = require("@mui/material");
|
|
397
|
+
var import_Typography3 = __toESM(require("@mui/material/Typography"));
|
|
398
|
+
var Switch = (0, import_material7.styled)(import_material7.Switch)(({ theme: theme2 }) => ({
|
|
399
|
+
width: 60,
|
|
400
|
+
height: 30,
|
|
401
|
+
padding: 0,
|
|
402
|
+
display: "flex",
|
|
403
|
+
"&:active": {
|
|
404
|
+
"& .MuiSwitch-thumb": {
|
|
405
|
+
width: 20
|
|
406
|
+
},
|
|
407
|
+
"& .MuiSwitch-switchBase.Mui-checked": {
|
|
408
|
+
transform: "translateX(12px)"
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
"& .MuiSwitch-switchBase": {
|
|
412
|
+
padding: 5.1,
|
|
413
|
+
color: "#C8BCA1",
|
|
414
|
+
transform: "translateX(2px)",
|
|
415
|
+
"&.Mui-checked": {
|
|
416
|
+
transform: "translateX(30px)",
|
|
417
|
+
color: "#C8BCA1",
|
|
418
|
+
"& + .MuiSwitch-track": {
|
|
419
|
+
opacity: 1,
|
|
420
|
+
backgroundColor: "#343434"
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
},
|
|
424
|
+
"& .MuiSwitch-thumb": {
|
|
425
|
+
width: 20,
|
|
426
|
+
height: 20,
|
|
427
|
+
borderRadius: "100%",
|
|
428
|
+
transition: theme2.transitions.create(["width"], {
|
|
429
|
+
duration: 200
|
|
430
|
+
})
|
|
431
|
+
},
|
|
432
|
+
"& .MuiSwitch-track": {
|
|
433
|
+
borderRadius: "22px",
|
|
434
|
+
opacity: 1,
|
|
435
|
+
backgroundColor: "#343434",
|
|
436
|
+
boxSizing: "border-box"
|
|
437
|
+
}
|
|
438
|
+
}));
|
|
439
|
+
var CustomSwitch = (props) => {
|
|
440
|
+
const { beforeText, afterText, ...rest } = props;
|
|
441
|
+
return /* @__PURE__ */ React.createElement(import_material7.Stack, { direction: "row", spacing: 1, alignItems: "center" }, beforeText ? /* @__PURE__ */ React.createElement(import_Typography3.default, { className: "text-base" }, beforeText) : null, /* @__PURE__ */ React.createElement(Switch, { defaultChecked: true, ...rest, disableRipple: true }), afterText ? /* @__PURE__ */ React.createElement(import_Typography3.default, { className: "text-base" }, afterText) : null);
|
|
442
|
+
};
|
|
443
|
+
var Switch_default = CustomSwitch;
|
|
444
|
+
|
|
445
|
+
// src/components/Slider/Slider.tsx
|
|
446
|
+
var import_material8 = require("@mui/material");
|
|
447
|
+
var StyledSlider = (0, import_material8.styled)(import_material8.Slider)(() => ({}));
|
|
448
|
+
var CustomSlider = (props) => {
|
|
449
|
+
return /* @__PURE__ */ React.createElement(StyledSlider, { ...props });
|
|
450
|
+
};
|
|
451
|
+
var Slider_default = CustomSlider;
|
|
452
|
+
|
|
453
|
+
// src/components/MenuItem/MenuItem.tsx
|
|
454
|
+
var import_material9 = require("@mui/material");
|
|
455
|
+
var StyledMenuItem = (0, import_material9.styled)(import_material9.MenuItem)(() => ({
|
|
456
|
+
borderRadius: "5px",
|
|
457
|
+
"&.Mui-selected": {
|
|
458
|
+
backgroundColor: "unset",
|
|
459
|
+
color: "purple"
|
|
460
|
+
}
|
|
461
|
+
}));
|
|
462
|
+
var CustomMenuItem = (props) => {
|
|
463
|
+
const { children, ...rest } = props;
|
|
464
|
+
return /* @__PURE__ */ React.createElement(StyledMenuItem, { ...rest }, children);
|
|
465
|
+
};
|
|
466
|
+
var MenuItem_default = CustomMenuItem;
|
|
467
|
+
|
|
468
|
+
// src/components/Input/Input.tsx
|
|
469
|
+
var import_material10 = require("@mui/material");
|
|
470
|
+
var import_Input = __toESM(require("@mui/material/Input"));
|
|
471
|
+
var StyledInput = (0, import_material10.styled)(import_Input.default)(() => ({
|
|
472
|
+
"& input::-webkit-outer-spin-button, & input::-webkit-inner-spin-button": {
|
|
473
|
+
display: "none"
|
|
474
|
+
},
|
|
475
|
+
"& input[type=number]": {
|
|
476
|
+
MozAppearance: "textfield"
|
|
477
|
+
}
|
|
478
|
+
}));
|
|
479
|
+
var CustomInput = (props) => {
|
|
480
|
+
const { type, adornmentText, value, ...rest } = props;
|
|
481
|
+
const handleKeyDown = (event) => {
|
|
482
|
+
if (!/[0-9]/.test(event.key) && event.key !== "Backspace") {
|
|
483
|
+
event.preventDefault();
|
|
484
|
+
event.stopPropagation();
|
|
485
|
+
}
|
|
486
|
+
};
|
|
487
|
+
return /* @__PURE__ */ React.createElement(
|
|
488
|
+
StyledInput,
|
|
489
|
+
{
|
|
490
|
+
disableUnderline: true,
|
|
491
|
+
onKeyDown: handleKeyDown,
|
|
492
|
+
startAdornment: adornmentText ? /* @__PURE__ */ React.createElement(import_material10.InputAdornment, { position: "start", className: "text-sm" }, adornmentText) : void 0,
|
|
493
|
+
value,
|
|
494
|
+
componentsProps: {
|
|
495
|
+
root: {
|
|
496
|
+
className: "border border-black rounded-none border-solid py-1.5 px-2.5 h-8"
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
type: type || "string",
|
|
500
|
+
...rest
|
|
501
|
+
}
|
|
502
|
+
);
|
|
503
|
+
};
|
|
504
|
+
var Input_default = CustomInput;
|
|
505
|
+
|
|
506
|
+
// src/components/Input/PhoneInput.tsx
|
|
507
|
+
var import_react_number_format = require("react-number-format");
|
|
508
|
+
var import_react5 = require("react");
|
|
509
|
+
var PhoneInput = (0, import_react5.forwardRef)(
|
|
510
|
+
function NumericFormatCustom(props, ref) {
|
|
511
|
+
const { onChange, ...other } = props;
|
|
512
|
+
return /* @__PURE__ */ React.createElement(
|
|
513
|
+
import_react_number_format.PatternFormat,
|
|
514
|
+
{
|
|
515
|
+
...other,
|
|
516
|
+
getInputRef: ref,
|
|
517
|
+
customInput: Input_default,
|
|
518
|
+
onValueChange: (values) => {
|
|
519
|
+
onChange({
|
|
520
|
+
target: {
|
|
521
|
+
name: props.name,
|
|
522
|
+
value: values.value
|
|
523
|
+
}
|
|
524
|
+
});
|
|
525
|
+
},
|
|
526
|
+
placeholder: "000 000 00 00",
|
|
527
|
+
format: "### ### ## ##"
|
|
528
|
+
}
|
|
529
|
+
);
|
|
530
|
+
}
|
|
531
|
+
);
|
|
532
|
+
var PhoneInput_default = PhoneInput;
|
|
533
|
+
|
|
534
|
+
// src/components/Input/FromToInput.tsx
|
|
535
|
+
var import_material11 = require("@mui/material");
|
|
536
|
+
var import_Typography4 = __toESM(require("@mui/material/Typography"));
|
|
537
|
+
var FromToInput = ({ label }) => {
|
|
538
|
+
return /* @__PURE__ */ React.createElement(import_material11.Stack, null, label ? /* @__PURE__ */ React.createElement(import_Typography4.default, { className: "text-accent-dark text-xs" }, label) : null, /* @__PURE__ */ React.createElement(import_material11.Stack, { direction: "row", spacing: 1 }, /* @__PURE__ */ React.createElement(Input_default, { adornmentText: "\u0432\u0456\u0434", fullWidth: true, type: "number" }), /* @__PURE__ */ React.createElement(Input_default, { adornmentText: "\u0434\u043E", fullWidth: true, type: "number" })));
|
|
539
|
+
};
|
|
540
|
+
var FromToInput_default = FromToInput;
|
|
541
|
+
|
|
542
|
+
// src/theme/index.tsx
|
|
543
|
+
var import_react6 = require("react");
|
|
544
|
+
var import_cache = __toESM(require("@emotion/cache"));
|
|
545
|
+
var import_navigation = require("next/navigation");
|
|
546
|
+
var import_react7 = require("@emotion/react");
|
|
547
|
+
var import_styles3 = require("@mui/material/styles");
|
|
548
|
+
var import_CssBaseline = __toESM(require("@mui/material/CssBaseline"));
|
|
549
|
+
var import_stylis = require("stylis");
|
|
550
|
+
var theme = (0, import_styles3.createTheme)({});
|
|
551
|
+
function ThemeRegistry(props) {
|
|
552
|
+
const { children } = props;
|
|
553
|
+
const [{ cache, flush }] = (0, import_react6.useState)(() => {
|
|
554
|
+
const cache2 = (0, import_cache.default)({
|
|
555
|
+
key: "mui",
|
|
556
|
+
stylisPlugins: [import_stylis.prefixer]
|
|
557
|
+
});
|
|
558
|
+
cache2.compat = true;
|
|
559
|
+
const prevInsert = cache2.insert;
|
|
560
|
+
let inserted = [];
|
|
561
|
+
cache2.insert = (...args) => {
|
|
562
|
+
const serialized = args[1];
|
|
563
|
+
if (cache2.inserted[serialized.name] === void 0) {
|
|
564
|
+
inserted.push(serialized.name);
|
|
565
|
+
}
|
|
566
|
+
return prevInsert(...args);
|
|
567
|
+
};
|
|
568
|
+
const flush2 = () => {
|
|
569
|
+
const prevInserted = inserted;
|
|
570
|
+
inserted = [];
|
|
571
|
+
return prevInserted;
|
|
572
|
+
};
|
|
573
|
+
return { cache: cache2, flush: flush2 };
|
|
574
|
+
});
|
|
575
|
+
(0, import_navigation.useServerInsertedHTML)(() => {
|
|
576
|
+
const names = flush();
|
|
577
|
+
if (names.length === 0) {
|
|
578
|
+
return null;
|
|
579
|
+
}
|
|
580
|
+
let styles = "";
|
|
581
|
+
for (const name of names) {
|
|
582
|
+
styles += cache.inserted[name];
|
|
583
|
+
}
|
|
584
|
+
return /* @__PURE__ */ React.createElement(
|
|
585
|
+
"style",
|
|
586
|
+
{
|
|
587
|
+
key: cache.key,
|
|
588
|
+
"data-emotion": `${cache.key} ${names.join(" ")}`,
|
|
589
|
+
dangerouslySetInnerHTML: {
|
|
590
|
+
__html: styles
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
);
|
|
594
|
+
});
|
|
595
|
+
return /* @__PURE__ */ React.createElement(import_react7.CacheProvider, { value: cache }, /* @__PURE__ */ React.createElement(import_styles3.ThemeProvider, { theme }, /* @__PURE__ */ React.createElement(import_CssBaseline.default, null), children));
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
// src/providers/Providers.tsx
|
|
599
|
+
var Providers = ({ children }) => {
|
|
600
|
+
return /* @__PURE__ */ React.createElement(ThemeRegistry, null, children);
|
|
601
|
+
};
|
|
602
|
+
var Providers_default = Providers;
|
|
603
|
+
|
|
604
|
+
// src/components/AppBar/AppBar.tsx
|
|
605
|
+
var import_react8 = require("react");
|
|
606
|
+
var import_material12 = require("@mui/material");
|
|
607
|
+
var import_link = __toESM(require("next/link"));
|
|
608
|
+
var AppBar = ({ links }) => {
|
|
609
|
+
const [activeIndex, setActiveIndex] = (0, import_react8.useState)(0);
|
|
610
|
+
const navItemsRef = (0, import_react8.useRef)([]);
|
|
611
|
+
(0, import_react8.useEffect)(() => {
|
|
612
|
+
const indicator = document.querySelector(".nav-indicator");
|
|
613
|
+
const navItem = navItemsRef.current[activeIndex];
|
|
614
|
+
const navItemWidth = navItem.offsetWidth;
|
|
615
|
+
const navItemLeft = navItem.offsetLeft + navItemWidth / 2 - indicator.offsetWidth / 2;
|
|
616
|
+
const navItemTop = navItem.offsetTop - 5;
|
|
617
|
+
indicator?.setAttribute(
|
|
618
|
+
"style",
|
|
619
|
+
`transform: translate(${navItemLeft}px, ${navItemTop}px);`
|
|
620
|
+
);
|
|
621
|
+
}, [activeIndex]);
|
|
622
|
+
const handleClick = (index) => {
|
|
623
|
+
setActiveIndex(index);
|
|
624
|
+
};
|
|
625
|
+
return /* @__PURE__ */ React.createElement(import_material12.Stack, { direction: "row", spacing: 1, position: "relative" }, /* @__PURE__ */ React.createElement(import_material12.Box, { className: "nav-indicator" }), links.map((link, index) => /* @__PURE__ */ React.createElement(
|
|
626
|
+
import_link.default,
|
|
627
|
+
{
|
|
628
|
+
ref: (el) => {
|
|
629
|
+
navItemsRef.current[index] = el;
|
|
630
|
+
},
|
|
631
|
+
key: index,
|
|
632
|
+
href: link.href,
|
|
633
|
+
className: `nav-item ${index === activeIndex ? "active" : ""}`,
|
|
634
|
+
onClick: () => handleClick(index)
|
|
635
|
+
},
|
|
636
|
+
link.title
|
|
637
|
+
)));
|
|
638
|
+
};
|
|
639
|
+
var AppBar_default = AppBar;
|
|
640
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
641
|
+
0 && (module.exports = {
|
|
642
|
+
AppBar,
|
|
643
|
+
Avatar,
|
|
644
|
+
Badge,
|
|
645
|
+
Button,
|
|
646
|
+
Chip,
|
|
647
|
+
FromToInput,
|
|
648
|
+
Greet,
|
|
649
|
+
IconButton,
|
|
650
|
+
Input,
|
|
651
|
+
MenuItem,
|
|
652
|
+
PhoneInput,
|
|
653
|
+
Providers,
|
|
654
|
+
Radio,
|
|
655
|
+
RadioGroup,
|
|
656
|
+
Select,
|
|
657
|
+
SelectPro,
|
|
658
|
+
Slider,
|
|
659
|
+
Switch,
|
|
660
|
+
Text
|
|
661
|
+
});
|