@yr3/ui 1.0.12 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Avatar/avatar.css +14 -2
- package/dist/components/Avatar/avatar.css.map +1 -1
- package/dist/components/Backdrop/backdrop.css +1 -1
- package/dist/components/Button/buttons.css +7 -4
- package/dist/components/Button/buttons.css.map +1 -1
- package/dist/components/Checkbox/checkbox.css +55 -31
- package/dist/components/Checkbox/checkbox.css.map +1 -1
- package/dist/components/Chip/chip.css +9 -0
- package/dist/components/Chip/chip.css.map +1 -1
- package/dist/components/Control/control.css +12 -0
- package/dist/components/Control/control.css.map +1 -1
- package/dist/components/Divider/divider.css +4 -0
- package/dist/components/Divider/divider.css.map +1 -1
- package/dist/components/Group/group.css +26 -18
- package/dist/components/Group/group.css.map +1 -1
- package/dist/components/Input/input.css +5 -1
- package/dist/components/Input/input.css.map +1 -1
- package/dist/components/InputArea/inputArea.css +5 -0
- package/dist/components/InputArea/inputArea.css.map +1 -1
- package/dist/components/Label/label.css +4 -0
- package/dist/components/Label/label.css.map +1 -1
- package/dist/components/Loader/loader.css +112 -0
- package/dist/components/Loader/loader.css.map +1 -0
- package/dist/components/Notistack/notistack.css +5 -0
- package/dist/components/Notistack/notistack.css.map +1 -1
- package/dist/components/Pending/pending.css +4 -0
- package/dist/components/Pending/pending.css.map +1 -1
- package/dist/components/Radio/radio.css +5 -0
- package/dist/components/Radio/radio.css.map +1 -1
- package/dist/components/Select/select.css +44 -0
- package/dist/components/Select/select.css.map +1 -1
- package/dist/components/Switch/switch.css +28 -0
- package/dist/components/Switch/switch.css.map +1 -1
- package/dist/components/Text/text.css +9 -1
- package/dist/components/Text/text.css.map +1 -1
- package/dist/index.cjs +511 -228
- package/dist/index.d.cts +170 -96
- package/dist/index.d.ts +170 -96
- package/dist/index.js +503 -228
- package/dist/styles/global.css +5 -0
- package/dist/styles/global.css.map +1 -1
- package/dist/styles/index.css +352 -58
- package/dist/styles/index.css.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -57,9 +57,11 @@ __export(index_exports, {
|
|
|
57
57
|
Input: () => Input,
|
|
58
58
|
InputArea: () => InputArea,
|
|
59
59
|
Label: () => Label,
|
|
60
|
+
Loader: () => Loader,
|
|
60
61
|
Modal: () => Modal,
|
|
61
62
|
ModalContainer: () => ModalContainer,
|
|
62
63
|
Notistack: () => Notistack,
|
|
64
|
+
NotistackContext: () => NotistackContext,
|
|
63
65
|
NotistackProvider: () => NotistackProvider,
|
|
64
66
|
Pending: () => Pending,
|
|
65
67
|
Phone: () => Phone,
|
|
@@ -72,6 +74,7 @@ __export(index_exports, {
|
|
|
72
74
|
ThemeContext: () => ThemeContext,
|
|
73
75
|
ThemeProvider: () => ThemeProvider,
|
|
74
76
|
adjustColor: () => adjustColor,
|
|
77
|
+
alpha: () => alpha,
|
|
75
78
|
applyTheme: () => applyTheme,
|
|
76
79
|
baseTokens: () => baseTokens,
|
|
77
80
|
bem: () => bem,
|
|
@@ -84,14 +87,19 @@ __export(index_exports, {
|
|
|
84
87
|
createTheme: () => createTheme,
|
|
85
88
|
createVariants: () => createVariants,
|
|
86
89
|
cx: () => cx,
|
|
90
|
+
darken: () => darken,
|
|
87
91
|
getContrast: () => getContrast,
|
|
88
92
|
getCountryCodePhone: () => getCountryCodePhone,
|
|
89
93
|
getDialPhone: () => getDialPhone,
|
|
90
94
|
getMonthCalendar: () => getMonthCalendar,
|
|
91
95
|
getNumberPhone: () => getNumberPhone,
|
|
96
|
+
hexToRgb: () => hexToRgb,
|
|
92
97
|
initTheme: () => initTheme,
|
|
93
98
|
isEmpty: () => isEmpty,
|
|
99
|
+
lighten: () => lighten,
|
|
100
|
+
mergeDeep: () => mergeDeep,
|
|
94
101
|
normalizePhone: () => normalizePhone,
|
|
102
|
+
rgbToHex: () => rgbToHex,
|
|
95
103
|
text: () => text,
|
|
96
104
|
times: () => times,
|
|
97
105
|
uiStyle: () => uiStyle,
|
|
@@ -213,6 +221,20 @@ function getMonthCalendar(year, month, startIndex, selected, props) {
|
|
|
213
221
|
}
|
|
214
222
|
|
|
215
223
|
// src/utils/color.ts
|
|
224
|
+
var rgbToHex = (r, g, b) => {
|
|
225
|
+
return "#" + [r, g, b].map(
|
|
226
|
+
(v) => Math.round(Math.max(0, Math.min(255, v))).toString(16).padStart(2, "0")
|
|
227
|
+
).join("");
|
|
228
|
+
};
|
|
229
|
+
var hexToRgb = (hex) => {
|
|
230
|
+
const clean = hex.replace("#", "");
|
|
231
|
+
const num = parseInt(clean, 16);
|
|
232
|
+
return {
|
|
233
|
+
r: num >> 16 & 255,
|
|
234
|
+
g: num >> 8 & 255,
|
|
235
|
+
b: num & 255
|
|
236
|
+
};
|
|
237
|
+
};
|
|
216
238
|
var adjustColor = (hex, amount) => {
|
|
217
239
|
const num = parseInt(hex.replace("#", ""), 16);
|
|
218
240
|
let r = (num >> 16) + amount;
|
|
@@ -240,6 +262,26 @@ var createPaletteColor = (main) => {
|
|
|
240
262
|
contrastText: getContrast(main)
|
|
241
263
|
};
|
|
242
264
|
};
|
|
265
|
+
var lighten = (hex, amount) => {
|
|
266
|
+
const { r, g, b } = hexToRgb(hex);
|
|
267
|
+
return rgbToHex(
|
|
268
|
+
r + (255 - r) * amount,
|
|
269
|
+
g + (255 - g) * amount,
|
|
270
|
+
b + (255 - b) * amount
|
|
271
|
+
);
|
|
272
|
+
};
|
|
273
|
+
var darken = (hex, amount) => {
|
|
274
|
+
const { r, g, b } = hexToRgb(hex);
|
|
275
|
+
return rgbToHex(
|
|
276
|
+
r * (1 - amount),
|
|
277
|
+
g * (1 - amount),
|
|
278
|
+
b * (1 - amount)
|
|
279
|
+
);
|
|
280
|
+
};
|
|
281
|
+
var alpha = (hex, opacity) => {
|
|
282
|
+
const { r, g, b } = hexToRgb(hex);
|
|
283
|
+
return `rgba(${r}, ${g}, ${b}, ${opacity})`;
|
|
284
|
+
};
|
|
243
285
|
|
|
244
286
|
// src/utils/common.ts
|
|
245
287
|
function isEmpty(value) {
|
|
@@ -401,6 +443,24 @@ var getNumberPhone = (phone, dial) => {
|
|
|
401
443
|
return phone;
|
|
402
444
|
};
|
|
403
445
|
|
|
446
|
+
// src/utils/merge.ts
|
|
447
|
+
function mergeDeep(target, source) {
|
|
448
|
+
if (!source) return target;
|
|
449
|
+
const output = { ...target };
|
|
450
|
+
Object.keys(source).forEach((key) => {
|
|
451
|
+
const k = key;
|
|
452
|
+
if (typeof source[k] === "object" && source[k] !== null && !Array.isArray(source[k])) {
|
|
453
|
+
output[k] = mergeDeep(
|
|
454
|
+
target[k] || {},
|
|
455
|
+
source[k]
|
|
456
|
+
);
|
|
457
|
+
} else {
|
|
458
|
+
output[k] = source[k];
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
return output;
|
|
462
|
+
}
|
|
463
|
+
|
|
404
464
|
// src/theme/breakpoint.ts
|
|
405
465
|
var breakpoints = {
|
|
406
466
|
xs: 0,
|
|
@@ -478,6 +538,7 @@ var createTheme = (props) => {
|
|
|
478
538
|
warning: createPaletteColor("#ffc107"),
|
|
479
539
|
info: createPaletteColor("#17a2b8"),
|
|
480
540
|
disabled: "#aeaeae84",
|
|
541
|
+
backdrop: "rgba(0, 0, 0, 0.5)",
|
|
481
542
|
background: {
|
|
482
543
|
default: "#0f0f1a",
|
|
483
544
|
surface: "#1a1a2e"
|
|
@@ -485,6 +546,10 @@ var createTheme = (props) => {
|
|
|
485
546
|
text: {
|
|
486
547
|
primary: "#ffffff",
|
|
487
548
|
secondary: "#2e2f2f"
|
|
549
|
+
},
|
|
550
|
+
common: {
|
|
551
|
+
white: "#ffffff",
|
|
552
|
+
black: "#000000"
|
|
488
553
|
}
|
|
489
554
|
},
|
|
490
555
|
breakpoints,
|
|
@@ -519,6 +584,9 @@ var applyTheme = (theme, target) => {
|
|
|
519
584
|
root.style.setProperty(`--color-${key}-contrast`, value.contrastText);
|
|
520
585
|
}
|
|
521
586
|
});
|
|
587
|
+
if (theme.colors.backdrop) {
|
|
588
|
+
root.style.setProperty("--color-backdrop", theme.colors.backdrop);
|
|
589
|
+
}
|
|
522
590
|
if (theme.colors.background?.default) {
|
|
523
591
|
root.style.setProperty("--color-bg", theme.colors.background.default);
|
|
524
592
|
}
|
|
@@ -528,12 +596,21 @@ var applyTheme = (theme, target) => {
|
|
|
528
596
|
if (theme.colors.disabled) {
|
|
529
597
|
root.style.setProperty("--color-disabled", theme.colors.disabled);
|
|
530
598
|
}
|
|
599
|
+
if (theme.colors.text?.primary) {
|
|
600
|
+
root.style.setProperty("--color-text", theme.colors.text?.primary);
|
|
601
|
+
}
|
|
531
602
|
if (theme.colors.text?.primary) {
|
|
532
603
|
root.style.setProperty("--color-text-primary", theme.colors.text?.primary);
|
|
533
604
|
}
|
|
534
605
|
if (theme.colors.text?.secondary) {
|
|
535
606
|
root.style.setProperty("--color-text-secondary", theme.colors.text?.secondary);
|
|
536
607
|
}
|
|
608
|
+
if (theme.colors.common?.white) {
|
|
609
|
+
root.style.setProperty("--color-white", theme.colors.common.white);
|
|
610
|
+
}
|
|
611
|
+
if (theme.colors.common?.black) {
|
|
612
|
+
root.style.setProperty("--color-black", theme.colors.common.black);
|
|
613
|
+
}
|
|
537
614
|
if (theme.breakpoints) {
|
|
538
615
|
Object.entries(theme.breakpoints).forEach(([key, value]) => {
|
|
539
616
|
document.documentElement.style.setProperty(
|
|
@@ -579,7 +656,8 @@ var avatarVariants = createVariants({
|
|
|
579
656
|
text: "yr3Avatar--color-text",
|
|
580
657
|
warning: "yr3Avatar--color-warning",
|
|
581
658
|
info: "yr3Avatar--color-info",
|
|
582
|
-
error: "yr3Avatar--color-error"
|
|
659
|
+
error: "yr3Avatar--color-error",
|
|
660
|
+
common: "yr3Avatar--color-common"
|
|
583
661
|
},
|
|
584
662
|
size: {
|
|
585
663
|
sm: "yr3Avatar--sm",
|
|
@@ -589,10 +667,11 @@ var avatarVariants = createVariants({
|
|
|
589
667
|
variant: {
|
|
590
668
|
circle: "yr3Avatar--circle",
|
|
591
669
|
square: "yr3Avatar--square",
|
|
592
|
-
rounded: "yr3Avatar--rounded"
|
|
670
|
+
rounded: "yr3Avatar--rounded",
|
|
671
|
+
bordered: "yr3Avatar--bordered"
|
|
593
672
|
},
|
|
594
673
|
bordered: {
|
|
595
|
-
true: "yr3Avatar--
|
|
674
|
+
true: "yr3Avatar--border-active"
|
|
596
675
|
},
|
|
597
676
|
shadow: {
|
|
598
677
|
0: "",
|
|
@@ -617,7 +696,7 @@ var Avatar = ({
|
|
|
617
696
|
variant = "circle",
|
|
618
697
|
color = "primary",
|
|
619
698
|
label,
|
|
620
|
-
bordered =
|
|
699
|
+
bordered = false,
|
|
621
700
|
ui,
|
|
622
701
|
shadow = 0,
|
|
623
702
|
onClick,
|
|
@@ -745,7 +824,8 @@ var textVariants = createVariants({
|
|
|
745
824
|
warning: "yr3Text--color-warning",
|
|
746
825
|
error: "yr3Text--color-error",
|
|
747
826
|
info: "yr3Text--color-info",
|
|
748
|
-
background: "yr3Text--color-background"
|
|
827
|
+
background: "yr3Text--color-background",
|
|
828
|
+
common: "yr3Text--color-common"
|
|
749
829
|
},
|
|
750
830
|
weight: {
|
|
751
831
|
light: "yr3Text--weight-light",
|
|
@@ -805,7 +885,8 @@ var buttonVariant = createVariants({
|
|
|
805
885
|
info: "yr3Button--color-info",
|
|
806
886
|
error: "yr3Button--color-error",
|
|
807
887
|
background: "yr3Button--color-background",
|
|
808
|
-
warning: "yr3Button--color-warning"
|
|
888
|
+
warning: "yr3Button--color-warning",
|
|
889
|
+
common: "yr3Button--color-common"
|
|
809
890
|
},
|
|
810
891
|
size: {
|
|
811
892
|
auto: "yr3Button--size-auto",
|
|
@@ -1001,6 +1082,19 @@ var Calendar = ({ onSelect, propsComponent = initalPropsComponent, mapCalendar,
|
|
|
1001
1082
|
// src/components/Checkbox/Checkbox.tsx
|
|
1002
1083
|
var React4 = __toESM(require("react"), 1);
|
|
1003
1084
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1085
|
+
var initialPropsComponent = {
|
|
1086
|
+
checkbox: {
|
|
1087
|
+
ui: {
|
|
1088
|
+
color: "primary"
|
|
1089
|
+
}
|
|
1090
|
+
},
|
|
1091
|
+
content: {
|
|
1092
|
+
variant: "caption",
|
|
1093
|
+
color: "primary",
|
|
1094
|
+
ui: {},
|
|
1095
|
+
style: {}
|
|
1096
|
+
}
|
|
1097
|
+
};
|
|
1004
1098
|
var Checkbox = ({
|
|
1005
1099
|
checked,
|
|
1006
1100
|
defaultChecked,
|
|
@@ -1009,6 +1103,7 @@ var Checkbox = ({
|
|
|
1009
1103
|
color = "primary",
|
|
1010
1104
|
disabled,
|
|
1011
1105
|
propsComponent,
|
|
1106
|
+
type = "default",
|
|
1012
1107
|
variant = "text"
|
|
1013
1108
|
}) => {
|
|
1014
1109
|
const [internal, setInternal] = React4.useState(defaultChecked || false);
|
|
@@ -1018,11 +1113,12 @@ var Checkbox = ({
|
|
|
1018
1113
|
if (!isControlled) setInternal(e.target.checked);
|
|
1019
1114
|
onChange?.(e, e.target.checked);
|
|
1020
1115
|
};
|
|
1116
|
+
const properties = mergeDeep(initialPropsComponent, propsComponent || {});
|
|
1021
1117
|
const bemClasse = bem("yr3Checkbox");
|
|
1022
|
-
const classes = bemClasse(void 0, { color: `color-${color}`, disabled, variant: `variant-${variant}` });
|
|
1118
|
+
const classes = bemClasse(void 0, { color: `color-${color}`, disabled, variant: `variant-${variant}`, type: `type-${type}` });
|
|
1023
1119
|
const boxClasses = bem("yr3Checkbox-box");
|
|
1024
1120
|
const classesBox = boxClasses(void 0, { checked: !!value });
|
|
1025
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: classes, style: uiStyle(
|
|
1121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: classes, style: uiStyle(properties?.checkbox?.ui), "data-testid": "yr3Checkbox", children: [
|
|
1026
1122
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1027
1123
|
"input",
|
|
1028
1124
|
{
|
|
@@ -1034,7 +1130,7 @@ var Checkbox = ({
|
|
|
1034
1130
|
}
|
|
1035
1131
|
),
|
|
1036
1132
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: classesBox, "data-testid": "yr3Checkbox-box" }),
|
|
1037
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { variant: "caption", color: !value ?
|
|
1133
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { variant: "caption", color: !value ? properties?.content?.color : color, ...properties?.content, children: label })
|
|
1038
1134
|
] });
|
|
1039
1135
|
};
|
|
1040
1136
|
|
|
@@ -1057,7 +1153,10 @@ var chipVariants = createVariants({
|
|
|
1057
1153
|
success: "yr3Chip--success",
|
|
1058
1154
|
error: "yr3Chip--error",
|
|
1059
1155
|
warning: "yr3Chip--warning",
|
|
1060
|
-
info: "yr3Chip--info"
|
|
1156
|
+
info: "yr3Chip--info",
|
|
1157
|
+
common: "yr3Chip--common",
|
|
1158
|
+
background: "yr3Chip--background",
|
|
1159
|
+
disabled: "yr3Chip--disabled"
|
|
1061
1160
|
},
|
|
1062
1161
|
rounded: {
|
|
1063
1162
|
true: "yr3Chip--rounded",
|
|
@@ -1084,7 +1183,22 @@ var IconClose = (props) => {
|
|
|
1084
1183
|
|
|
1085
1184
|
// src/components/Chip/Chip.tsx
|
|
1086
1185
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1087
|
-
var
|
|
1186
|
+
var initialChipProps = {
|
|
1187
|
+
label: {
|
|
1188
|
+
ui: {},
|
|
1189
|
+
style: {}
|
|
1190
|
+
},
|
|
1191
|
+
delete: {
|
|
1192
|
+
ui: {},
|
|
1193
|
+
style: {}
|
|
1194
|
+
},
|
|
1195
|
+
icon: {
|
|
1196
|
+
width: 20,
|
|
1197
|
+
height: 20
|
|
1198
|
+
}
|
|
1199
|
+
};
|
|
1200
|
+
var Chip = ({ label, variant, color, icon, deleted, onDelete, rounded, size = "medium", propsComponent, ...props }) => {
|
|
1201
|
+
const properties = mergeDeep(initialChipProps, propsComponent);
|
|
1088
1202
|
const className = chip_variants_default({ variant, colors: color, rounded, size });
|
|
1089
1203
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1090
1204
|
"div",
|
|
@@ -1092,14 +1206,21 @@ var Chip = ({ label, variant, color, icon, onDelete, rounded, size = "medium", u
|
|
|
1092
1206
|
className,
|
|
1093
1207
|
"data-testid": "yr3Chip",
|
|
1094
1208
|
...props,
|
|
1095
|
-
style:
|
|
1096
|
-
...style,
|
|
1097
|
-
...uiStyle(ui)
|
|
1098
|
-
},
|
|
1209
|
+
style: composeStyles(properties.chip?.ui, properties.chip?.style),
|
|
1099
1210
|
children: [
|
|
1100
1211
|
icon,
|
|
1101
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "yr3Chip__label", children: label }),
|
|
1102
|
-
|
|
1212
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "yr3Chip__label", style: composeStyles(properties?.label?.ui, properties?.label?.style), children: label }),
|
|
1213
|
+
deleted && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1214
|
+
"span",
|
|
1215
|
+
{
|
|
1216
|
+
className: "yr3Chip__delete",
|
|
1217
|
+
onClick: onDelete,
|
|
1218
|
+
role: "button",
|
|
1219
|
+
"aria-label": "delete",
|
|
1220
|
+
style: composeStyles(properties?.delete?.ui, properties?.delete?.style),
|
|
1221
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IconClose, { ...properties?.icon, stroke: color })
|
|
1222
|
+
}
|
|
1223
|
+
)
|
|
1103
1224
|
]
|
|
1104
1225
|
}
|
|
1105
1226
|
);
|
|
@@ -1171,7 +1292,8 @@ var controlVariants = createVariants({
|
|
|
1171
1292
|
disabled: "yr3Control--color-disabled",
|
|
1172
1293
|
info: "yr3Control--color-info",
|
|
1173
1294
|
warning: "yr3Control--color-warning",
|
|
1174
|
-
error: "yr3Control--color-error"
|
|
1295
|
+
error: "yr3Control--color-error",
|
|
1296
|
+
common: "yr3Control--color-common"
|
|
1175
1297
|
},
|
|
1176
1298
|
size: {
|
|
1177
1299
|
auto: "yr3Control--size-auto",
|
|
@@ -1248,7 +1370,8 @@ var dividerVariants = createVariants({
|
|
|
1248
1370
|
text: "yr3Divider--color-text",
|
|
1249
1371
|
warning: "yr3Divider--color-warning",
|
|
1250
1372
|
info: "yr3Divider--color-info",
|
|
1251
|
-
error: "yr3Divider--color-error"
|
|
1373
|
+
error: "yr3Divider--color-error",
|
|
1374
|
+
common: "yr3Divider--color-common"
|
|
1252
1375
|
}
|
|
1253
1376
|
}
|
|
1254
1377
|
});
|
|
@@ -1303,33 +1426,42 @@ var useClickAway = (ref, callback) => {
|
|
|
1303
1426
|
|
|
1304
1427
|
// src/components/Drawer/Drawer.tsx
|
|
1305
1428
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1429
|
+
var initialPropsComponent2 = {
|
|
1430
|
+
drawer: {},
|
|
1431
|
+
closing: null,
|
|
1432
|
+
container: {},
|
|
1433
|
+
onClose: false
|
|
1434
|
+
};
|
|
1306
1435
|
var Drawer = ({ open, anchor = null, onClose, children, propsComponent }) => {
|
|
1307
1436
|
const { show, hide } = useBackdrop();
|
|
1308
1437
|
const ref = React8.useRef(null);
|
|
1438
|
+
const properties = mergeDeep(initialPropsComponent2, propsComponent);
|
|
1309
1439
|
React8.useEffect(() => {
|
|
1310
|
-
if (open) {
|
|
1440
|
+
if (!!open) {
|
|
1311
1441
|
show();
|
|
1442
|
+
} else {
|
|
1443
|
+
hide();
|
|
1312
1444
|
}
|
|
1313
1445
|
}, [open]);
|
|
1314
1446
|
useClickAway(ref, () => {
|
|
1315
|
-
if (!open ||
|
|
1316
|
-
if (
|
|
1447
|
+
if (!open || properties?.closing === null) return;
|
|
1448
|
+
if (properties?.closing === "drawer") {
|
|
1317
1449
|
hide();
|
|
1318
1450
|
onClose();
|
|
1319
1451
|
}
|
|
1320
1452
|
;
|
|
1321
1453
|
});
|
|
1322
1454
|
React8.useEffect(() => {
|
|
1323
|
-
if (
|
|
1455
|
+
if (properties?.onClose) {
|
|
1324
1456
|
hide();
|
|
1325
1457
|
onClose();
|
|
1326
1458
|
}
|
|
1327
|
-
}, [
|
|
1459
|
+
}, [properties?.onClose]);
|
|
1328
1460
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1329
1461
|
"div",
|
|
1330
1462
|
{
|
|
1331
1463
|
className: `yr3Drawer ${anchor && `yr3Drawer--${anchor}`} ${open && "yr3Drawer--open"}`,
|
|
1332
|
-
style:
|
|
1464
|
+
style: properties?.drawer,
|
|
1333
1465
|
onClick: (e) => e.stopPropagation(),
|
|
1334
1466
|
ref,
|
|
1335
1467
|
"data-testid": "yr3Drawer",
|
|
@@ -1337,9 +1469,9 @@ var Drawer = ({ open, anchor = null, onClose, children, propsComponent }) => {
|
|
|
1337
1469
|
DrawerContainer_default,
|
|
1338
1470
|
{
|
|
1339
1471
|
children,
|
|
1340
|
-
...
|
|
1341
|
-
props:
|
|
1342
|
-
onClose: () =>
|
|
1472
|
+
...properties?.container,
|
|
1473
|
+
props: properties?.closing,
|
|
1474
|
+
onClose: () => properties?.closing === "container" ? onClose() : {}
|
|
1343
1475
|
}
|
|
1344
1476
|
)
|
|
1345
1477
|
},
|
|
@@ -1497,7 +1629,12 @@ var groupVariants = createVariants({
|
|
|
1497
1629
|
info: "yr3Group--color-info",
|
|
1498
1630
|
disabled: "yr3Group--color-disabled",
|
|
1499
1631
|
text: "yr3Group--color-text",
|
|
1500
|
-
background: "yr3Group--color-background"
|
|
1632
|
+
background: "yr3Group--color-background",
|
|
1633
|
+
common: "yr3Group--color-common"
|
|
1634
|
+
},
|
|
1635
|
+
type: {
|
|
1636
|
+
rounded: "yr3Group--type-rounded",
|
|
1637
|
+
square: "yr3Group--type-square"
|
|
1501
1638
|
}
|
|
1502
1639
|
}
|
|
1503
1640
|
});
|
|
@@ -1519,6 +1656,7 @@ var Group = ({
|
|
|
1519
1656
|
value,
|
|
1520
1657
|
onChange,
|
|
1521
1658
|
variant,
|
|
1659
|
+
type = "rounded",
|
|
1522
1660
|
color = "primary",
|
|
1523
1661
|
propsComponent = initialComponents
|
|
1524
1662
|
}) => {
|
|
@@ -1533,7 +1671,7 @@ var Group = ({
|
|
|
1533
1671
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1534
1672
|
"div",
|
|
1535
1673
|
{
|
|
1536
|
-
className: groupVariants({ variant, color }),
|
|
1674
|
+
className: groupVariants({ variant, color, type }),
|
|
1537
1675
|
"data-testid": "yr3Group",
|
|
1538
1676
|
style: composeStyles(propsComponent.group?.ui, propsComponent.group?.style),
|
|
1539
1677
|
children: options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
@@ -1574,7 +1712,15 @@ var Image = ({
|
|
|
1574
1712
|
// src/components/ImageDropzone/ImageDropzone.tsx
|
|
1575
1713
|
var React11 = __toESM(require("react"), 1);
|
|
1576
1714
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1577
|
-
var
|
|
1715
|
+
var initialPropsComponent3 = {
|
|
1716
|
+
box: {},
|
|
1717
|
+
text: {},
|
|
1718
|
+
container: {},
|
|
1719
|
+
preview: {},
|
|
1720
|
+
content: {}
|
|
1721
|
+
};
|
|
1722
|
+
var ImageDropzone = ({ onChange, multiple, propsComponent, bordered, component, defaultImage, variant = "outlined" }) => {
|
|
1723
|
+
const properties = mergeDeep(initialPropsComponent3, propsComponent || {});
|
|
1578
1724
|
const [dragging, setDragging] = React11.useState(false);
|
|
1579
1725
|
const [files, setFiles] = React11.useState([]);
|
|
1580
1726
|
const inputRef = React11.useRef(null);
|
|
@@ -1589,7 +1735,7 @@ var ImageDropzone = ({ onChange, multiple, ui, style, propsComponent, bordered,
|
|
|
1589
1735
|
};
|
|
1590
1736
|
const classes = bem("yr3Dropzone");
|
|
1591
1737
|
const classComponent = classes(void 0, { "dragging": !!dragging, "bordered": !!bordered, variant });
|
|
1592
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Box, { as: "div", position: "relative", content: "center", ...
|
|
1738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Box, { as: "div", position: "relative", content: "center", ...properties?.box, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1593
1739
|
"div",
|
|
1594
1740
|
{
|
|
1595
1741
|
className: classComponent,
|
|
@@ -1604,7 +1750,7 @@ var ImageDropzone = ({ onChange, multiple, ui, style, propsComponent, bordered,
|
|
|
1604
1750
|
handleFiles(e.dataTransfer.files);
|
|
1605
1751
|
},
|
|
1606
1752
|
onClick: () => inputRef.current?.click(),
|
|
1607
|
-
style: composeStyles(ui, style),
|
|
1753
|
+
style: composeStyles(properties?.container?.ui, properties?.container?.style),
|
|
1608
1754
|
children: [
|
|
1609
1755
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1610
1756
|
"input",
|
|
@@ -1617,10 +1763,10 @@ var ImageDropzone = ({ onChange, multiple, ui, style, propsComponent, bordered,
|
|
|
1617
1763
|
onChange: (e) => handleFiles(e.target.files)
|
|
1618
1764
|
}
|
|
1619
1765
|
),
|
|
1620
|
-
isEmpty(files) && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "yr3Dropzone--content", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { variant: "helper", color: "disabled", ...propsComponent?.text, children: propsComponent?.text?.primary || "Drag and drop an image here, or click to select one" }) }),
|
|
1621
|
-
multiple && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "yr3Dropzone--previews", children: files.map((file, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("img", { src: URL.createObjectURL(file) }, i)) }),
|
|
1622
|
-
!multiple && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "yr3Dropzone--preview", children: files.map((file, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("img", { src: URL.createObjectURL(file) }, i)) }),
|
|
1623
|
-
!!defaultImage && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "yr3Dropzone--preview", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("img", { src: defaultImage }) }),
|
|
1766
|
+
isEmpty(files) && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "yr3Dropzone--content", style: composeStyles(properties?.content?.ui, properties?.content?.style), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { variant: "helper", color: "disabled", ...propsComponent?.text, children: propsComponent?.text?.primary || "Drag and drop an image here, or click to select one" }) }),
|
|
1767
|
+
multiple && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "yr3Dropzone--previews", style: composeStyles(properties?.preview?.ui, properties?.preview?.style), children: files.map((file, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("img", { src: URL.createObjectURL(file) }, i)) }),
|
|
1768
|
+
!multiple && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "yr3Dropzone--preview", style: composeStyles(properties?.preview?.ui, properties?.preview?.style), children: files.map((file, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("img", { src: URL.createObjectURL(file) }, i)) }),
|
|
1769
|
+
!!defaultImage && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "yr3Dropzone--preview", style: composeStyles(properties?.preview?.ui, properties?.preview?.style), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("img", { src: defaultImage }) }),
|
|
1624
1770
|
component
|
|
1625
1771
|
]
|
|
1626
1772
|
}
|
|
@@ -1666,7 +1812,8 @@ var inputVariants = createVariants({
|
|
|
1666
1812
|
background: "yr3Input--color-background",
|
|
1667
1813
|
error: "yr3Input--color-error",
|
|
1668
1814
|
warning: "yr3Input--color-warning",
|
|
1669
|
-
info: "yr3Input--color-info"
|
|
1815
|
+
info: "yr3Input--color-info",
|
|
1816
|
+
common: "yr3Input--color-common"
|
|
1670
1817
|
},
|
|
1671
1818
|
size: {
|
|
1672
1819
|
auto: "yr3Input--size-auto",
|
|
@@ -1787,7 +1934,12 @@ var inputAreaVariants = createVariants({
|
|
|
1787
1934
|
secondary: "yr3InputArea--color-secondary",
|
|
1788
1935
|
success: "yr3InputArea--color-success",
|
|
1789
1936
|
text: "yr3InputArea--color-text",
|
|
1790
|
-
disabled: "yr3InputArea--color-disabled"
|
|
1937
|
+
disabled: "yr3InputArea--color-disabled",
|
|
1938
|
+
background: "yr3InputArea--color-background",
|
|
1939
|
+
error: "yr3InputArea--color-error",
|
|
1940
|
+
warning: "yr3InputArea--color-warning",
|
|
1941
|
+
info: "yr3InputArea--color-info",
|
|
1942
|
+
common: "yr3InputArea--color-common"
|
|
1791
1943
|
},
|
|
1792
1944
|
size: {
|
|
1793
1945
|
auto: "yr3InputArea--size-auto",
|
|
@@ -1874,22 +2026,88 @@ var InputArea = ({
|
|
|
1874
2026
|
] });
|
|
1875
2027
|
};
|
|
1876
2028
|
|
|
1877
|
-
// src/components/
|
|
2029
|
+
// src/components/Loader/loader.variants.ts
|
|
2030
|
+
var loaderSpinnerVariants = createVariants({
|
|
2031
|
+
base: "yr3Loader--spinner",
|
|
2032
|
+
variants: {
|
|
2033
|
+
color: {
|
|
2034
|
+
primary: "yr3Loader--spinner-color-primary",
|
|
2035
|
+
secondary: "yr3Loader--spinner-color-secondary",
|
|
2036
|
+
success: "yr3Loader--spinner-color-success",
|
|
2037
|
+
error: "yr3Loader--spinner-color-error",
|
|
2038
|
+
warning: "yr3Loader--spinner-color-warning",
|
|
2039
|
+
info: "yr3Loader--spinner-color-info",
|
|
2040
|
+
disabled: "yr3Loader--spinner-color-disabled",
|
|
2041
|
+
text: "yr3Loader--spinner-color-text",
|
|
2042
|
+
background: "yr3Loader--spinner-color-background",
|
|
2043
|
+
common: "yr3Loader--spinner-color-common"
|
|
2044
|
+
},
|
|
2045
|
+
size: {
|
|
2046
|
+
sm: "yr3Loader--spinner-size-sm",
|
|
2047
|
+
md: "yr3Loader--spinner-size-md",
|
|
2048
|
+
lg: "yr3Loader--spinner-size-lg"
|
|
2049
|
+
},
|
|
2050
|
+
type: {
|
|
2051
|
+
default: "yr3Loader--spinner-default",
|
|
2052
|
+
dots: "yr3Loader--spinner-dots",
|
|
2053
|
+
fancy: "yr3Loader--spinner-fancy"
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
});
|
|
2057
|
+
|
|
2058
|
+
// src/components/Loader/Loader.tsx
|
|
1878
2059
|
var React14 = __toESM(require("react"), 1);
|
|
2060
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2061
|
+
var initialComponents2 = {
|
|
2062
|
+
loader: {
|
|
2063
|
+
ui: {},
|
|
2064
|
+
style: {}
|
|
2065
|
+
},
|
|
2066
|
+
spinner: {
|
|
2067
|
+
size: "sm",
|
|
2068
|
+
color: "primary",
|
|
2069
|
+
type: "default"
|
|
2070
|
+
},
|
|
2071
|
+
container: {
|
|
2072
|
+
center: true,
|
|
2073
|
+
container: true,
|
|
2074
|
+
ui: {
|
|
2075
|
+
width: "100%",
|
|
2076
|
+
height: "100%"
|
|
2077
|
+
}
|
|
2078
|
+
}
|
|
2079
|
+
};
|
|
2080
|
+
var Loader = ({ component, loading = false, propsComponent }) => {
|
|
2081
|
+
const properties = mergeDeep(initialComponents2, propsComponent || {});
|
|
2082
|
+
const classSpinner = loaderSpinnerVariants({
|
|
2083
|
+
color: properties?.spinner?.color,
|
|
2084
|
+
type: properties?.spinner?.type,
|
|
2085
|
+
size: properties?.spinner?.size
|
|
2086
|
+
});
|
|
2087
|
+
if (!loading) return null;
|
|
2088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "yr3Loader", style: composeStyles(properties?.loader?.ui, properties?.loader?.style), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Flex, { ...properties?.container, children: component || /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: classSpinner, children: properties?.spinner?.type === "dots" && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(React14.Fragment, { children: [
|
|
2089
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", {}),
|
|
2090
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", {}),
|
|
2091
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", {})
|
|
2092
|
+
] }) }) }) });
|
|
2093
|
+
};
|
|
2094
|
+
|
|
2095
|
+
// src/components/Modal/Modal.tsx
|
|
2096
|
+
var React15 = __toESM(require("react"), 1);
|
|
1879
2097
|
|
|
1880
2098
|
// src/components/Modal/ModalContainer.tsx
|
|
1881
|
-
var
|
|
2099
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1882
2100
|
var ModalContainer = ({ children, size = "sm", ui, style }) => {
|
|
1883
2101
|
const classes = bem("yr3Modal-container");
|
|
1884
2102
|
const classComponent = classes(void 0, { [`${size}`]: !!size });
|
|
1885
|
-
return /* @__PURE__ */ (0,
|
|
2103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: classComponent, style: composeStyles(ui, style), "data-testid": "yr3Modal-container", children });
|
|
1886
2104
|
};
|
|
1887
2105
|
|
|
1888
2106
|
// src/components/Modal/Modal.tsx
|
|
1889
|
-
var
|
|
2107
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1890
2108
|
var Modal = ({ open, onClose, children, propsComponent }) => {
|
|
1891
2109
|
const { show, hide } = useBackdrop();
|
|
1892
|
-
|
|
2110
|
+
React15.useEffect(() => {
|
|
1893
2111
|
if (open) {
|
|
1894
2112
|
show();
|
|
1895
2113
|
} else {
|
|
@@ -1898,9 +2116,9 @@ var Modal = ({ open, onClose, children, propsComponent }) => {
|
|
|
1898
2116
|
}, [open, show]);
|
|
1899
2117
|
const classes = bem("yr3Modal");
|
|
1900
2118
|
const classComponent = classes(void 0, { "open": !!open });
|
|
1901
|
-
return /* @__PURE__ */ (0,
|
|
2119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: classComponent, onClick: (e) => e.stopPropagation(), "data-testid": "yr3Modal", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ModalContainer, { ...propsComponent?.container, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Flex, { variant: "column", container: true, center: true, gap: 1, children: [
|
|
1902
2120
|
children,
|
|
1903
|
-
propsComponent?.close ? propsComponent.close : /* @__PURE__ */ (0,
|
|
2121
|
+
propsComponent?.close ? propsComponent.close : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button, { variant: "filled", color: "secondary", onClick: onClose, "data-testid": "yr3Modal-close", children: "Close" })
|
|
1904
2122
|
] }) }) });
|
|
1905
2123
|
};
|
|
1906
2124
|
|
|
@@ -1940,15 +2158,15 @@ var notistackVariants = createVariants({
|
|
|
1940
2158
|
});
|
|
1941
2159
|
|
|
1942
2160
|
// src/components/Notistack/Notistack.tsx
|
|
1943
|
-
var
|
|
2161
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1944
2162
|
var Notistack = ({ message, duration = 3e3, variant = "info", color, propsComponent, anchor, exiting = false }) => {
|
|
1945
2163
|
const classes = notistackVariants({ type: variant, color, exiting, direction: `${anchor?.vertical || "bottom"}-${anchor?.horizontal || "right"}` });
|
|
1946
2164
|
const containerStyle = composeStyles(propsComponent?.container?.ui, propsComponent?.container?.style);
|
|
1947
2165
|
const notistackStyle = composeStyles(propsComponent?.notistack?.ui, propsComponent?.notistack?.style);
|
|
1948
2166
|
const progressStyle = composeStyles(propsComponent?.progress?.ui, propsComponent?.progress?.style);
|
|
1949
|
-
return /* @__PURE__ */ (0,
|
|
1950
|
-
/* @__PURE__ */ (0,
|
|
1951
|
-
/* @__PURE__ */ (0,
|
|
2167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: classes, "data-testid": "yr3Notistack", style: notistackStyle, children: [
|
|
2168
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { style: containerStyle, children: message }),
|
|
2169
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1952
2170
|
"div",
|
|
1953
2171
|
{
|
|
1954
2172
|
className: "yr3Notistack--progress",
|
|
@@ -1976,13 +2194,14 @@ var pendingVariants = createVariants({
|
|
|
1976
2194
|
text: "yr3Pending--color-text",
|
|
1977
2195
|
info: "yr3Pending--color-info",
|
|
1978
2196
|
background: "yr3Pending--color-background",
|
|
1979
|
-
warning: "yr3Pending--color-warning"
|
|
2197
|
+
warning: "yr3Pending--color-warning",
|
|
2198
|
+
common: "yr3Pending--color-common"
|
|
1980
2199
|
}
|
|
1981
2200
|
}
|
|
1982
2201
|
});
|
|
1983
2202
|
|
|
1984
2203
|
// src/components/Pending/Pending.tsx
|
|
1985
|
-
var
|
|
2204
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1986
2205
|
var Pending = ({
|
|
1987
2206
|
variant,
|
|
1988
2207
|
width,
|
|
@@ -1995,7 +2214,7 @@ var Pending = ({
|
|
|
1995
2214
|
const widthStyle = variant === "circle" ? size : width;
|
|
1996
2215
|
const heightStyle = variant === "circle" ? size : height;
|
|
1997
2216
|
const uiStylePending = uiStyle({ width: widthStyle, height: heightStyle, ...ui });
|
|
1998
|
-
return /* @__PURE__ */ (0,
|
|
2217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1999
2218
|
"div",
|
|
2000
2219
|
{
|
|
2001
2220
|
className: pendingVariants({ variant, color }),
|
|
@@ -2006,19 +2225,19 @@ var Pending = ({
|
|
|
2006
2225
|
};
|
|
2007
2226
|
|
|
2008
2227
|
// src/components/Phone/Phone.tsx
|
|
2009
|
-
var
|
|
2228
|
+
var React17 = __toESM(require("react"), 1);
|
|
2010
2229
|
|
|
2011
2230
|
// src/components/Selector/Selector.tsx
|
|
2012
|
-
var
|
|
2231
|
+
var React16 = __toESM(require("react"), 1);
|
|
2013
2232
|
|
|
2014
2233
|
// src/Icons/IconDown.tsx
|
|
2015
|
-
var
|
|
2234
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2016
2235
|
var IconDown = (props) => {
|
|
2017
|
-
return /* @__PURE__ */ (0,
|
|
2236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("svg", { width: props.width || "64px", height: props.height || "64px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "data-testid": "yr3Icons", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("path", { d: "M7 10L12 15L17 10", stroke: props.stroke || "#fff", strokeWidth: props.strokeWidth || "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
2018
2237
|
};
|
|
2019
2238
|
|
|
2020
2239
|
// src/components/Selector/Selector.tsx
|
|
2021
|
-
var
|
|
2240
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2022
2241
|
var initalPropsComponent2 = {
|
|
2023
2242
|
text: {
|
|
2024
2243
|
variant: "caption",
|
|
@@ -2031,16 +2250,16 @@ var initalPropsComponent2 = {
|
|
|
2031
2250
|
}
|
|
2032
2251
|
};
|
|
2033
2252
|
var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconColor, icon, propsComponent = initalPropsComponent2 }) => {
|
|
2034
|
-
const [open, setOpen] =
|
|
2035
|
-
const [valueState, setValueState] =
|
|
2036
|
-
const ref =
|
|
2253
|
+
const [open, setOpen] = React16.useState(false);
|
|
2254
|
+
const [valueState, setValueState] = React16.useState(value || defaultValue || null);
|
|
2255
|
+
const ref = React16.useRef(null);
|
|
2037
2256
|
useClickAway(ref, () => setOpen(false));
|
|
2038
|
-
return /* @__PURE__ */ (0,
|
|
2039
|
-
/* @__PURE__ */ (0,
|
|
2040
|
-
/* @__PURE__ */ (0,
|
|
2257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "yr3Selector-wrapper", ref, children: [
|
|
2258
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: `yr3Selector ${open ? "yr3Selector--open" : ""}`, style: composeStyles(ui, style), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "yr3Selector--control", children: [
|
|
2259
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "yr3Selector--icon", onClick: () => setOpen((prev) => !prev), children: icon ? icon : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(IconDown, { stroke: `var(--color-${iconColor || "disabled"})`, width: 24, height: 24 }) }),
|
|
2041
2260
|
valueState
|
|
2042
2261
|
] }) }),
|
|
2043
|
-
open && /* @__PURE__ */ (0,
|
|
2262
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "yr3Selector--menu", style: composeStyles(propsComponent.menu?.ui, propsComponent.menu?.style), children: options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2044
2263
|
"div",
|
|
2045
2264
|
{
|
|
2046
2265
|
className: "yr3Selector--option",
|
|
@@ -2061,7 +2280,7 @@ var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconC
|
|
|
2061
2280
|
};
|
|
2062
2281
|
onChange?.(event, opt.value);
|
|
2063
2282
|
},
|
|
2064
|
-
children: /* @__PURE__ */ (0,
|
|
2283
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Text, { ...propsComponent?.text, children: propsComponent?.text?.children || opt.label })
|
|
2065
2284
|
},
|
|
2066
2285
|
opt.value
|
|
2067
2286
|
)) })
|
|
@@ -2070,7 +2289,7 @@ var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconC
|
|
|
2070
2289
|
var Selector_default = Selector;
|
|
2071
2290
|
|
|
2072
2291
|
// src/components/Phone/Phone.tsx
|
|
2073
|
-
var
|
|
2292
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2074
2293
|
var Phone = ({
|
|
2075
2294
|
name,
|
|
2076
2295
|
value,
|
|
@@ -2082,13 +2301,13 @@ var Phone = ({
|
|
|
2082
2301
|
}) => {
|
|
2083
2302
|
const isControlled = value !== void 0;
|
|
2084
2303
|
const initial = value || defaultValue || "";
|
|
2085
|
-
const [prefix, setPrefix] =
|
|
2304
|
+
const [prefix, setPrefix] = React17.useState(
|
|
2086
2305
|
getDialPhone(initial, countries) || countries[0].dial
|
|
2087
2306
|
);
|
|
2088
|
-
const [number, setNumber] =
|
|
2307
|
+
const [number, setNumber] = React17.useState(
|
|
2089
2308
|
getNumberPhone(initial, prefix) || ""
|
|
2090
2309
|
);
|
|
2091
|
-
|
|
2310
|
+
React17.useEffect(() => {
|
|
2092
2311
|
if (isControlled && value) {
|
|
2093
2312
|
const dial = getDialPhone(value, countries);
|
|
2094
2313
|
const num = getNumberPhone(value, dial);
|
|
@@ -2107,10 +2326,10 @@ var Phone = ({
|
|
|
2107
2326
|
setPrefix(val);
|
|
2108
2327
|
onChange?.(null, `${val}${number}`);
|
|
2109
2328
|
};
|
|
2110
|
-
return /* @__PURE__ */ (0,
|
|
2111
|
-
/* @__PURE__ */ (0,
|
|
2112
|
-
/* @__PURE__ */ (0,
|
|
2113
|
-
/* @__PURE__ */ (0,
|
|
2329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Control, { variant: "outlined", ui: { height: 50, position: "relative" }, children: [
|
|
2330
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Label, { text: label, className: "yr3Input--active" }),
|
|
2331
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Flex, { variant: "row", container: true, center: true, children: [
|
|
2332
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2114
2333
|
Selector_default,
|
|
2115
2334
|
{
|
|
2116
2335
|
options: countries.map((c) => ({
|
|
@@ -2122,7 +2341,7 @@ var Phone = ({
|
|
|
2122
2341
|
...propsComponent?.selector
|
|
2123
2342
|
}
|
|
2124
2343
|
),
|
|
2125
|
-
/* @__PURE__ */ (0,
|
|
2344
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2126
2345
|
Divider,
|
|
2127
2346
|
{
|
|
2128
2347
|
orientation: "vertical",
|
|
@@ -2131,7 +2350,7 @@ var Phone = ({
|
|
|
2131
2350
|
...propsComponent?.divider
|
|
2132
2351
|
}
|
|
2133
2352
|
),
|
|
2134
|
-
/* @__PURE__ */ (0,
|
|
2353
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2135
2354
|
Input,
|
|
2136
2355
|
{
|
|
2137
2356
|
type: "number",
|
|
@@ -2147,9 +2366,9 @@ var Phone = ({
|
|
|
2147
2366
|
};
|
|
2148
2367
|
|
|
2149
2368
|
// src/components/Places/PlacesAutocomplete.tsx
|
|
2150
|
-
var
|
|
2369
|
+
var React18 = __toESM(require("react"), 1);
|
|
2151
2370
|
var import_autocomplete_places = require("@yr3/autocomplete-places");
|
|
2152
|
-
var
|
|
2371
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2153
2372
|
var initPropsComponent = {
|
|
2154
2373
|
label: {
|
|
2155
2374
|
display: true,
|
|
@@ -2189,9 +2408,9 @@ var PlacesAutocomplete = ({
|
|
|
2189
2408
|
keyApi,
|
|
2190
2409
|
propsComponent = initPropsComponent
|
|
2191
2410
|
}) => {
|
|
2192
|
-
const [value, setValue] =
|
|
2193
|
-
const inputRef =
|
|
2194
|
-
const [anchorEl, setAnchorEl] =
|
|
2411
|
+
const [value, setValue] = React18.useState(null);
|
|
2412
|
+
const inputRef = React18.useRef(null);
|
|
2413
|
+
const [anchorEl, setAnchorEl] = React18.useState(null);
|
|
2195
2414
|
const { suggestions, selectPlace } = (0, import_autocomplete_places.useAutocompletePlaces)({ input: value, apiKey: keyApi, language, provider });
|
|
2196
2415
|
const handleSelect = async (id) => {
|
|
2197
2416
|
const place = await selectPlace(id);
|
|
@@ -2211,12 +2430,12 @@ var PlacesAutocomplete = ({
|
|
|
2211
2430
|
setValue(place.address);
|
|
2212
2431
|
setAnchorEl(null);
|
|
2213
2432
|
};
|
|
2214
|
-
|
|
2433
|
+
React18.useEffect(() => {
|
|
2215
2434
|
if (defaultLocation) {
|
|
2216
2435
|
setValue(defaultLocation);
|
|
2217
2436
|
}
|
|
2218
2437
|
}, [defaultLocation]);
|
|
2219
|
-
|
|
2438
|
+
React18.useEffect(() => {
|
|
2220
2439
|
if (value === "") {
|
|
2221
2440
|
onSelect(null);
|
|
2222
2441
|
}
|
|
@@ -2226,13 +2445,13 @@ var PlacesAutocomplete = ({
|
|
|
2226
2445
|
setAnchorEl(e.target.value ? inputRef.current : null);
|
|
2227
2446
|
};
|
|
2228
2447
|
const open = suggestions.length > 0 && Boolean(anchorEl);
|
|
2229
|
-
|
|
2448
|
+
React18.useEffect(() => {
|
|
2230
2449
|
if (onChangeForm) {
|
|
2231
2450
|
onChangeForm({ target: { value } });
|
|
2232
2451
|
}
|
|
2233
2452
|
}, [onChangeForm]);
|
|
2234
|
-
return /* @__PURE__ */ (0,
|
|
2235
|
-
/* @__PURE__ */ (0,
|
|
2453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Control, { ...propsComponent?.control, children: [
|
|
2454
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2236
2455
|
Input,
|
|
2237
2456
|
{
|
|
2238
2457
|
ref: inputRef,
|
|
@@ -2246,7 +2465,7 @@ var PlacesAutocomplete = ({
|
|
|
2246
2465
|
},
|
|
2247
2466
|
"input-places"
|
|
2248
2467
|
),
|
|
2249
|
-
open && /* @__PURE__ */ (0,
|
|
2468
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "yr3Places--menu", style: composeStyles(propsComponent.menu?.ui, propsComponent?.menu?.style), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Flex, { container: true, ui: { p: 1 }, children: suggestions.map((s) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Flex, { onClick: () => handleSelect(s.id), ui: { padding: 8, cursor: "pointer", "&:hover": { backgroundColor: "rgba(0,0,0,0.1)" } }, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text, { ...propsComponent?.menu?.text, children: s.description }) }, s.id)) }) })
|
|
2250
2469
|
] });
|
|
2251
2470
|
};
|
|
2252
2471
|
|
|
@@ -2263,13 +2482,18 @@ var radioVariant = createVariants({
|
|
|
2263
2482
|
secondary: "yr3Radio--color-secondary",
|
|
2264
2483
|
success: "yr3Radio--color-success",
|
|
2265
2484
|
text: "yr3Radio--color-text",
|
|
2266
|
-
disabled: "yr3Radio--color-disabled"
|
|
2485
|
+
disabled: "yr3Radio--color-disabled",
|
|
2486
|
+
background: "yr3Radio--color-background",
|
|
2487
|
+
error: "yr3Radio--color-error",
|
|
2488
|
+
warning: "yr3Radio--color-warning",
|
|
2489
|
+
info: "yr3Radio--color-info",
|
|
2490
|
+
common: "yr3Radio--color-common"
|
|
2267
2491
|
}
|
|
2268
2492
|
}
|
|
2269
2493
|
});
|
|
2270
2494
|
|
|
2271
2495
|
// src/components/Radio/Radio.tsx
|
|
2272
|
-
var
|
|
2496
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2273
2497
|
var Radio = ({
|
|
2274
2498
|
checked,
|
|
2275
2499
|
value,
|
|
@@ -2285,8 +2509,8 @@ var Radio = ({
|
|
|
2285
2509
|
const bemClass = bem("yr3Radio");
|
|
2286
2510
|
const classes = bemClass(void 0, { [color]: `color-${color}` });
|
|
2287
2511
|
const variantClass = radioVariant({ variant });
|
|
2288
|
-
return /* @__PURE__ */ (0,
|
|
2289
|
-
/* @__PURE__ */ (0,
|
|
2512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { className: classes, "data-testid": "yr3Radio", style: composeStyles(propsComponent?.radio?.ui, propsComponent?.radio?.style), children: [
|
|
2513
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2290
2514
|
"input",
|
|
2291
2515
|
{
|
|
2292
2516
|
type: "radio",
|
|
@@ -2298,8 +2522,8 @@ var Radio = ({
|
|
|
2298
2522
|
}
|
|
2299
2523
|
),
|
|
2300
2524
|
iconChecked && checked ? iconChecked : !checked && iconUnchecked ? iconUnchecked : null,
|
|
2301
|
-
!iconChecked && !iconUnchecked && /* @__PURE__ */ (0,
|
|
2302
|
-
typeof label === "string" && /* @__PURE__ */ (0,
|
|
2525
|
+
!iconChecked && !iconUnchecked && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: variantClass, "data-testid": "yr3Radio-dot" }),
|
|
2526
|
+
typeof label === "string" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2303
2527
|
"span",
|
|
2304
2528
|
{
|
|
2305
2529
|
className: "yr3Radio--label",
|
|
@@ -2312,7 +2536,104 @@ var Radio = ({
|
|
|
2312
2536
|
};
|
|
2313
2537
|
|
|
2314
2538
|
// src/components/Select/Select.tsx
|
|
2315
|
-
var
|
|
2539
|
+
var React22 = __toESM(require("react"), 1);
|
|
2540
|
+
|
|
2541
|
+
// src/theme/ThemeProvider.tsx
|
|
2542
|
+
var React20 = __toESM(require("react"), 1);
|
|
2543
|
+
|
|
2544
|
+
// src/theme/notistackContext.tsx
|
|
2545
|
+
var React19 = __toESM(require("react"), 1);
|
|
2546
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2547
|
+
var NotistackContext = React19.createContext(null);
|
|
2548
|
+
var NotistackProvider = ({ children }) => {
|
|
2549
|
+
const [snacks, setSnacks] = React19.useState([]);
|
|
2550
|
+
const notistack = (snack) => {
|
|
2551
|
+
const id = Date.now();
|
|
2552
|
+
setSnacks((prev) => [...prev, { ...snack, id, exiting: false }]);
|
|
2553
|
+
const duration = snack.duration || 3e3;
|
|
2554
|
+
const exitDuration = 300;
|
|
2555
|
+
setTimeout(() => {
|
|
2556
|
+
setSnacks(
|
|
2557
|
+
(prev) => prev.map((s) => s.id === id ? { ...s, exiting: true } : s)
|
|
2558
|
+
);
|
|
2559
|
+
}, duration);
|
|
2560
|
+
setTimeout(() => {
|
|
2561
|
+
setSnacks((prev) => prev.filter((s) => s.id !== id));
|
|
2562
|
+
}, duration + exitDuration);
|
|
2563
|
+
};
|
|
2564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(NotistackContext.Provider, { value: { notistack }, children: [
|
|
2565
|
+
children,
|
|
2566
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "yr3NotistackContainer", children: snacks.map((snack) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Notistack, { ...snack }, snack.id)) })
|
|
2567
|
+
] });
|
|
2568
|
+
};
|
|
2569
|
+
var useNotistack = () => {
|
|
2570
|
+
const ctx = React19.useContext(NotistackContext);
|
|
2571
|
+
if (!ctx) {
|
|
2572
|
+
throw new Error("NotistackProvider missing");
|
|
2573
|
+
}
|
|
2574
|
+
return ctx;
|
|
2575
|
+
};
|
|
2576
|
+
|
|
2577
|
+
// src/theme/ThemeProvider.tsx
|
|
2578
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2579
|
+
var ThemeContext = React20.createContext(null);
|
|
2580
|
+
var ThemeProvider = ({ theme, children }) => {
|
|
2581
|
+
React20.useEffect(() => {
|
|
2582
|
+
applyTheme(theme);
|
|
2583
|
+
}, [theme]);
|
|
2584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ThemeContext.Provider, { value: theme, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(BackdropProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(NotistackProvider, { children }) }) });
|
|
2585
|
+
};
|
|
2586
|
+
var useTheme = () => React20.useContext(ThemeContext);
|
|
2587
|
+
|
|
2588
|
+
// src/theme/tokens.ts
|
|
2589
|
+
var baseTokens = {
|
|
2590
|
+
colors: {
|
|
2591
|
+
primary: "#6C5CE7",
|
|
2592
|
+
secondary: "#00CEC9",
|
|
2593
|
+
background: "#0f0f1a",
|
|
2594
|
+
surface: "#1a1a2e",
|
|
2595
|
+
textPrimary: "#ffffff",
|
|
2596
|
+
textSecondary: "#b2bec3"
|
|
2597
|
+
},
|
|
2598
|
+
spacing: (factor) => `${factor * 8}px`,
|
|
2599
|
+
radius: {
|
|
2600
|
+
sm: "6px",
|
|
2601
|
+
md: "12px",
|
|
2602
|
+
lg: "20px"
|
|
2603
|
+
}
|
|
2604
|
+
};
|
|
2605
|
+
|
|
2606
|
+
// src/theme/useMediaQuery.tsx
|
|
2607
|
+
var React21 = __toESM(require("react"), 1);
|
|
2608
|
+
function useMediaQuery(query) {
|
|
2609
|
+
const theme = useTheme();
|
|
2610
|
+
const computedQuery = typeof query === "function" ? query(theme) : query;
|
|
2611
|
+
const [matches, setMatches] = React21.useState(() => {
|
|
2612
|
+
if (typeof window === "undefined") return false;
|
|
2613
|
+
return window.matchMedia(computedQuery).matches;
|
|
2614
|
+
});
|
|
2615
|
+
React21.useEffect(() => {
|
|
2616
|
+
if (typeof window === "undefined") return;
|
|
2617
|
+
const media = window.matchMedia(computedQuery);
|
|
2618
|
+
const listener = () => setMatches(media.matches);
|
|
2619
|
+
media.addEventListener("change", listener);
|
|
2620
|
+
return () => media.removeEventListener("change", listener);
|
|
2621
|
+
}, [computedQuery]);
|
|
2622
|
+
return matches;
|
|
2623
|
+
}
|
|
2624
|
+
function useBreakpointValue(values) {
|
|
2625
|
+
const xs = useMediaQuery(`(min-width: ${breakpoints.xs}px)`);
|
|
2626
|
+
const sm = useMediaQuery(`(min-width: ${breakpoints.sm}px)`);
|
|
2627
|
+
const md = useMediaQuery(`(min-width: ${breakpoints.md}px)`);
|
|
2628
|
+
const lg = useMediaQuery(`(min-width: ${breakpoints.lg}px)`);
|
|
2629
|
+
const xl = useMediaQuery(`(min-width: ${breakpoints.xl}px)`);
|
|
2630
|
+
if (xl && values.xl !== void 0) return values.xl;
|
|
2631
|
+
if (lg && values.lg !== void 0) return values.lg;
|
|
2632
|
+
if (md && values.md !== void 0) return values.md;
|
|
2633
|
+
if (sm && values.sm !== void 0) return values.sm;
|
|
2634
|
+
if (xs && values.xs !== void 0) return values.xs;
|
|
2635
|
+
return void 0;
|
|
2636
|
+
}
|
|
2316
2637
|
|
|
2317
2638
|
// src/components/Select/select.variants.ts
|
|
2318
2639
|
var selectVariants = createVariants({
|
|
@@ -2336,17 +2657,43 @@ var selectVariants = createVariants({
|
|
|
2336
2657
|
background: "yr3Select--color-background",
|
|
2337
2658
|
error: "yr3Select--color-error",
|
|
2338
2659
|
warning: "yr3Select--color-warning",
|
|
2339
|
-
info: "yr3Select--color-info"
|
|
2660
|
+
info: "yr3Select--color-info",
|
|
2661
|
+
common: "yr3Select--color-common"
|
|
2340
2662
|
},
|
|
2341
2663
|
animated: {
|
|
2342
2664
|
true: "yr3Select--animated"
|
|
2665
|
+
},
|
|
2666
|
+
icon: {
|
|
2667
|
+
true: "yr3Select--icon"
|
|
2668
|
+
}
|
|
2669
|
+
}
|
|
2670
|
+
});
|
|
2671
|
+
var selectIconVariants = createVariants({
|
|
2672
|
+
base: "yr3Select--icon",
|
|
2673
|
+
variants: {
|
|
2674
|
+
color: {
|
|
2675
|
+
primary: "yr3Select--icon-color-primary",
|
|
2676
|
+
secondary: "yr3Select--icon-color-secondary",
|
|
2677
|
+
success: "yr3Select--icon-color-success",
|
|
2678
|
+
text: "yr3Select--icon-color-text",
|
|
2679
|
+
disabled: "yr3Select--icon-color-disabled",
|
|
2680
|
+
background: "yr3Select--icon-color-background",
|
|
2681
|
+
error: "yr3Select--icon-color-error",
|
|
2682
|
+
warning: "yr3Select--icon-color-warning",
|
|
2683
|
+
info: "yr3Select--icon-color-info",
|
|
2684
|
+
common: "yr3Select--icon-color-common"
|
|
2685
|
+
},
|
|
2686
|
+
animated: {
|
|
2687
|
+
true: "yr3Select--icon-animated"
|
|
2688
|
+
},
|
|
2689
|
+
open: {
|
|
2690
|
+
true: "yr3Select--icon-open"
|
|
2343
2691
|
}
|
|
2344
2692
|
}
|
|
2345
2693
|
});
|
|
2346
|
-
var select_variants_default = selectVariants;
|
|
2347
2694
|
|
|
2348
2695
|
// src/components/Select/Select.tsx
|
|
2349
|
-
var
|
|
2696
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2350
2697
|
var initiaPropsComponent3 = {
|
|
2351
2698
|
control: {
|
|
2352
2699
|
variant: "outlined",
|
|
@@ -2356,6 +2703,7 @@ var initiaPropsComponent3 = {
|
|
|
2356
2703
|
},
|
|
2357
2704
|
label: {
|
|
2358
2705
|
display: true,
|
|
2706
|
+
color: "primary",
|
|
2359
2707
|
ui: {},
|
|
2360
2708
|
style: {}
|
|
2361
2709
|
},
|
|
@@ -2378,20 +2726,23 @@ var initiaPropsComponent3 = {
|
|
|
2378
2726
|
icon: {
|
|
2379
2727
|
style: {
|
|
2380
2728
|
width: 24,
|
|
2381
|
-
height: 24
|
|
2382
|
-
stroke: "currentColor"
|
|
2729
|
+
height: 24
|
|
2383
2730
|
},
|
|
2731
|
+
color: "primary",
|
|
2384
2732
|
component: void 0
|
|
2385
2733
|
}
|
|
2386
2734
|
};
|
|
2387
|
-
var Select = ({ label, options, name, value, defaultValue, onChange, propsComponent
|
|
2388
|
-
const [open, setOpen] =
|
|
2389
|
-
const [valueState, setValueState] =
|
|
2390
|
-
const ref =
|
|
2735
|
+
var Select = ({ label, options, name, value, defaultValue, onChange, propsComponent }) => {
|
|
2736
|
+
const [open, setOpen] = React22.useState(false);
|
|
2737
|
+
const [valueState, setValueState] = React22.useState(value || defaultValue || null);
|
|
2738
|
+
const ref = React22.useRef(null);
|
|
2391
2739
|
useClickAway(ref, () => setOpen(false));
|
|
2392
|
-
const
|
|
2393
|
-
|
|
2394
|
-
|
|
2740
|
+
const theme = useTheme();
|
|
2741
|
+
const properties = mergeDeep(initiaPropsComponent3, propsComponent || {});
|
|
2742
|
+
const classesIcon = selectIconVariants({ color: properties?.icon?.color, animated: open, open });
|
|
2743
|
+
const classes = selectVariants({ wrapper: true });
|
|
2744
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: classes, ref, children: [
|
|
2745
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2395
2746
|
Input,
|
|
2396
2747
|
{
|
|
2397
2748
|
label,
|
|
@@ -2399,27 +2750,36 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
2399
2750
|
disabled: true,
|
|
2400
2751
|
value: valueState,
|
|
2401
2752
|
propsComponent: {
|
|
2402
|
-
control:
|
|
2403
|
-
label:
|
|
2753
|
+
control: properties?.control,
|
|
2754
|
+
label: properties?.label
|
|
2404
2755
|
}
|
|
2405
2756
|
}
|
|
2406
2757
|
),
|
|
2407
|
-
/* @__PURE__ */ (0,
|
|
2408
|
-
|
|
2758
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2759
|
+
"div",
|
|
2409
2760
|
{
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2761
|
+
className: classesIcon,
|
|
2762
|
+
style: properties?.icon?.style,
|
|
2763
|
+
onClick: () => setOpen((prev) => !prev),
|
|
2764
|
+
"data-testid": "yr3Select-icon",
|
|
2765
|
+
children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2766
|
+
IconDown,
|
|
2767
|
+
{
|
|
2768
|
+
width: properties?.icon?.style?.width,
|
|
2769
|
+
height: properties?.icon?.style?.height,
|
|
2770
|
+
stroke: "currentColor",
|
|
2771
|
+
style: properties?.icon?.style
|
|
2772
|
+
}
|
|
2773
|
+
)
|
|
2414
2774
|
}
|
|
2415
|
-
)
|
|
2416
|
-
open && /* @__PURE__ */ (0,
|
|
2775
|
+
),
|
|
2776
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2417
2777
|
"div",
|
|
2418
2778
|
{
|
|
2419
2779
|
className: "yr3Select--menu",
|
|
2420
|
-
style: composeStyles(
|
|
2780
|
+
style: composeStyles(properties?.menu?.ui, properties?.menu?.style),
|
|
2421
2781
|
"data-testid": "yr3Select-menu",
|
|
2422
|
-
children: options.map((opt) => /* @__PURE__ */ (0,
|
|
2782
|
+
children: options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2423
2783
|
"div",
|
|
2424
2784
|
{
|
|
2425
2785
|
className: "yr3Select--option",
|
|
@@ -2440,8 +2800,8 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
2440
2800
|
};
|
|
2441
2801
|
onChange?.(event, opt.value);
|
|
2442
2802
|
},
|
|
2443
|
-
style: composeStyles(
|
|
2444
|
-
children: /* @__PURE__ */ (0,
|
|
2803
|
+
style: composeStyles(properties?.menu?.options?.ui, properties?.menu?.options?.style),
|
|
2804
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Text, { as: "span", variant: "caption", color: properties?.menu?.options?.text?.color || "primary", ...properties?.menu?.options?.text, children: opt.label })
|
|
2445
2805
|
},
|
|
2446
2806
|
opt.value
|
|
2447
2807
|
))
|
|
@@ -2451,8 +2811,8 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
2451
2811
|
};
|
|
2452
2812
|
|
|
2453
2813
|
// src/components/Slide/Slide.tsx
|
|
2454
|
-
var
|
|
2455
|
-
var
|
|
2814
|
+
var React23 = __toESM(require("react"), 1);
|
|
2815
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2456
2816
|
var Slide = ({
|
|
2457
2817
|
in: inProp,
|
|
2458
2818
|
children,
|
|
@@ -2466,7 +2826,7 @@ var Slide = ({
|
|
|
2466
2826
|
[direction]: true,
|
|
2467
2827
|
"in": !!inProp
|
|
2468
2828
|
});
|
|
2469
|
-
|
|
2829
|
+
React23.useEffect(() => {
|
|
2470
2830
|
let timeoutId;
|
|
2471
2831
|
if (inProp) {
|
|
2472
2832
|
timeoutId = setTimeout(() => {
|
|
@@ -2476,19 +2836,19 @@ var Slide = ({
|
|
|
2476
2836
|
return () => clearTimeout(timeoutId);
|
|
2477
2837
|
}, [inProp, duration, onTransitionEnd]);
|
|
2478
2838
|
const uiStyleContent = uiStyle({ ...propsComponent?.slide?.ui, transitionDuration: `${duration}ms` });
|
|
2479
|
-
return /* @__PURE__ */ (0,
|
|
2839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2480
2840
|
"div",
|
|
2481
2841
|
{
|
|
2482
2842
|
className: "yr3Slide",
|
|
2483
2843
|
style: uiStyle({ position: "relative", zIndex: 4, overflow: "hidden" }),
|
|
2484
2844
|
"data-testid": "yr3Slide",
|
|
2485
|
-
children: /* @__PURE__ */ (0,
|
|
2845
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2486
2846
|
"div",
|
|
2487
2847
|
{
|
|
2488
2848
|
className: classNameContent,
|
|
2489
2849
|
style: composeStyles(uiStyleContent, propsComponent?.slide?.style || {}),
|
|
2490
2850
|
"data-testid": "yr3Slide-content",
|
|
2491
|
-
children: /* @__PURE__ */ (0,
|
|
2851
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Box, { ...propsComponent?.box, "data-testid": "yr3Slide-box", children })
|
|
2492
2852
|
}
|
|
2493
2853
|
)
|
|
2494
2854
|
}
|
|
@@ -2496,7 +2856,7 @@ var Slide = ({
|
|
|
2496
2856
|
};
|
|
2497
2857
|
|
|
2498
2858
|
// src/components/Switch/Switch.tsx
|
|
2499
|
-
var
|
|
2859
|
+
var React24 = __toESM(require("react"), 1);
|
|
2500
2860
|
|
|
2501
2861
|
// src/components/Switch/switch.variants.ts
|
|
2502
2862
|
var switchVariants = createVariants({
|
|
@@ -2508,7 +2868,11 @@ var switchVariants = createVariants({
|
|
|
2508
2868
|
success: "yr3Switch--color-success",
|
|
2509
2869
|
text: "yr3Switch--color-text",
|
|
2510
2870
|
disabled: "yr3Switch--color-disabled",
|
|
2511
|
-
warning: "yr3Switch--color-warning"
|
|
2871
|
+
warning: "yr3Switch--color-warning",
|
|
2872
|
+
info: "yr3Switch--color-info",
|
|
2873
|
+
error: "yr3Switch--color-error",
|
|
2874
|
+
background: "yr3Switch--color-background",
|
|
2875
|
+
common: "yr3Switch--color-common"
|
|
2512
2876
|
},
|
|
2513
2877
|
size: {
|
|
2514
2878
|
sm: "yr3Switch--sm",
|
|
@@ -2529,7 +2893,7 @@ var switchVariants = createVariants({
|
|
|
2529
2893
|
});
|
|
2530
2894
|
|
|
2531
2895
|
// src/components/Switch/Switch.tsx
|
|
2532
|
-
var
|
|
2896
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2533
2897
|
var Switch = ({
|
|
2534
2898
|
checked,
|
|
2535
2899
|
defaultChecked,
|
|
@@ -2541,7 +2905,7 @@ var Switch = ({
|
|
|
2541
2905
|
placement = "end",
|
|
2542
2906
|
propsComponent
|
|
2543
2907
|
}) => {
|
|
2544
|
-
const [internal, setInternal] =
|
|
2908
|
+
const [internal, setInternal] = React24.useState(defaultChecked || false);
|
|
2545
2909
|
const classname = switchVariants({ colors: color, size, disabled: !!disabled, checked: checked ?? internal, placement });
|
|
2546
2910
|
const isControlled = checked !== void 0;
|
|
2547
2911
|
const value = isControlled ? checked : internal;
|
|
@@ -2549,13 +2913,13 @@ var Switch = ({
|
|
|
2549
2913
|
if (!isControlled) setInternal(e.target.checked);
|
|
2550
2914
|
onChange?.(e, e.target.checked);
|
|
2551
2915
|
};
|
|
2552
|
-
return /* @__PURE__ */ (0,
|
|
2916
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
2553
2917
|
"label",
|
|
2554
2918
|
{
|
|
2555
2919
|
className: classname,
|
|
2556
2920
|
"data-testid": "yr3Switch",
|
|
2557
2921
|
children: [
|
|
2558
|
-
/* @__PURE__ */ (0,
|
|
2922
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2559
2923
|
"input",
|
|
2560
2924
|
{
|
|
2561
2925
|
type: "checkbox",
|
|
@@ -2564,8 +2928,8 @@ var Switch = ({
|
|
|
2564
2928
|
disabled
|
|
2565
2929
|
}
|
|
2566
2930
|
),
|
|
2567
|
-
/* @__PURE__ */ (0,
|
|
2568
|
-
/* @__PURE__ */ (0,
|
|
2931
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "yr3Switch--track", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "yr3Switch--thumb" }) }),
|
|
2932
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2569
2933
|
"span",
|
|
2570
2934
|
{
|
|
2571
2935
|
className: "yr3Switch--label",
|
|
@@ -2580,9 +2944,9 @@ var Switch = ({
|
|
|
2580
2944
|
};
|
|
2581
2945
|
|
|
2582
2946
|
// src/Icons/IconSearch.tsx
|
|
2583
|
-
var
|
|
2947
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2584
2948
|
var IconSearch = (props) => {
|
|
2585
|
-
return /* @__PURE__ */ (0,
|
|
2949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("svg", { width: props.width || "64px", height: props.height || "64px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2586
2950
|
"path",
|
|
2587
2951
|
{
|
|
2588
2952
|
d: "M15.7955 15.8111L21 21M18 10.5C18 14.6421 14.6421 18 10.5 18C6.35786 18 3 14.6421 3 10.5C3 6.35786 6.35786 3 10.5 3C14.6421 3 18 6.35786 18 10.5Z",
|
|
@@ -2594,95 +2958,6 @@ var IconSearch = (props) => {
|
|
|
2594
2958
|
) });
|
|
2595
2959
|
};
|
|
2596
2960
|
|
|
2597
|
-
// src/theme/ThemeProvider.tsx
|
|
2598
|
-
var React21 = __toESM(require("react"), 1);
|
|
2599
|
-
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2600
|
-
var ThemeContext = React21.createContext(null);
|
|
2601
|
-
var ThemeProvider = ({ theme, children }) => {
|
|
2602
|
-
React21.useEffect(() => {
|
|
2603
|
-
applyTheme(theme);
|
|
2604
|
-
}, [theme]);
|
|
2605
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ThemeContext.Provider, { value: theme, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(BackdropProvider, { children }) });
|
|
2606
|
-
};
|
|
2607
|
-
var useTheme = () => React21.useContext(ThemeContext);
|
|
2608
|
-
|
|
2609
|
-
// src/theme/tokens.ts
|
|
2610
|
-
var baseTokens = {
|
|
2611
|
-
colors: {
|
|
2612
|
-
primary: "#6C5CE7",
|
|
2613
|
-
secondary: "#00CEC9",
|
|
2614
|
-
background: "#0f0f1a",
|
|
2615
|
-
surface: "#1a1a2e",
|
|
2616
|
-
textPrimary: "#ffffff",
|
|
2617
|
-
textSecondary: "#b2bec3"
|
|
2618
|
-
},
|
|
2619
|
-
spacing: (factor) => `${factor * 8}px`,
|
|
2620
|
-
radius: {
|
|
2621
|
-
sm: "6px",
|
|
2622
|
-
md: "12px",
|
|
2623
|
-
lg: "20px"
|
|
2624
|
-
}
|
|
2625
|
-
};
|
|
2626
|
-
|
|
2627
|
-
// src/theme/notistackContext.tsx
|
|
2628
|
-
var React22 = __toESM(require("react"), 1);
|
|
2629
|
-
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2630
|
-
var NotistackContext = React22.createContext(null);
|
|
2631
|
-
var NotistackProvider = ({ children }) => {
|
|
2632
|
-
const [snacks, setSnacks] = React22.useState([]);
|
|
2633
|
-
const enqueueNotistack = (snack) => {
|
|
2634
|
-
const id = Date.now();
|
|
2635
|
-
setSnacks((prev) => [...prev, { ...snack, id, exiting: false }]);
|
|
2636
|
-
const duration = snack.duration || 3e3;
|
|
2637
|
-
const exitDuration = 300;
|
|
2638
|
-
setTimeout(() => {
|
|
2639
|
-
setSnacks(
|
|
2640
|
-
(prev) => prev.map((s) => s.id === id ? { ...s, exiting: true } : s)
|
|
2641
|
-
);
|
|
2642
|
-
}, duration);
|
|
2643
|
-
setTimeout(() => {
|
|
2644
|
-
setSnacks((prev) => prev.filter((s) => s.id !== id));
|
|
2645
|
-
}, duration + exitDuration);
|
|
2646
|
-
};
|
|
2647
|
-
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(NotistackContext.Provider, { value: { enqueueNotistack }, children: [
|
|
2648
|
-
children,
|
|
2649
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "yr3NotistackContainer", children: snacks.map((snack) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Notistack, { ...snack }, snack.id)) })
|
|
2650
|
-
] });
|
|
2651
|
-
};
|
|
2652
|
-
var useNotistack = () => React22.useContext(NotistackContext);
|
|
2653
|
-
|
|
2654
|
-
// src/theme/useMediaQuery.tsx
|
|
2655
|
-
var React23 = __toESM(require("react"), 1);
|
|
2656
|
-
function useMediaQuery(query) {
|
|
2657
|
-
const theme = useTheme();
|
|
2658
|
-
const computedQuery = typeof query === "function" ? query(theme) : query;
|
|
2659
|
-
const [matches, setMatches] = React23.useState(() => {
|
|
2660
|
-
if (typeof window === "undefined") return false;
|
|
2661
|
-
return window.matchMedia(computedQuery).matches;
|
|
2662
|
-
});
|
|
2663
|
-
React23.useEffect(() => {
|
|
2664
|
-
if (typeof window === "undefined") return;
|
|
2665
|
-
const media = window.matchMedia(computedQuery);
|
|
2666
|
-
const listener = () => setMatches(media.matches);
|
|
2667
|
-
media.addEventListener("change", listener);
|
|
2668
|
-
return () => media.removeEventListener("change", listener);
|
|
2669
|
-
}, [computedQuery]);
|
|
2670
|
-
return matches;
|
|
2671
|
-
}
|
|
2672
|
-
function useBreakpointValue(values) {
|
|
2673
|
-
const xs = useMediaQuery(`(min-width: ${breakpoints.xs}px)`);
|
|
2674
|
-
const sm = useMediaQuery(`(min-width: ${breakpoints.sm}px)`);
|
|
2675
|
-
const md = useMediaQuery(`(min-width: ${breakpoints.md}px)`);
|
|
2676
|
-
const lg = useMediaQuery(`(min-width: ${breakpoints.lg}px)`);
|
|
2677
|
-
const xl = useMediaQuery(`(min-width: ${breakpoints.xl}px)`);
|
|
2678
|
-
if (xl && values.xl !== void 0) return values.xl;
|
|
2679
|
-
if (lg && values.lg !== void 0) return values.lg;
|
|
2680
|
-
if (md && values.md !== void 0) return values.md;
|
|
2681
|
-
if (sm && values.sm !== void 0) return values.sm;
|
|
2682
|
-
if (xs && values.xs !== void 0) return values.xs;
|
|
2683
|
-
return void 0;
|
|
2684
|
-
}
|
|
2685
|
-
|
|
2686
2961
|
// src/hooks/usePlaces.ts
|
|
2687
2962
|
var import_autocomplete_places2 = require("@yr3/autocomplete-places");
|
|
2688
2963
|
var usePlaces = ({ input, language, apiKey, provider }) => {
|
|
@@ -2694,7 +2969,7 @@ var usePlaces = ({ input, language, apiKey, provider }) => {
|
|
|
2694
2969
|
};
|
|
2695
2970
|
|
|
2696
2971
|
// src/hooks/useBreakpoint.ts
|
|
2697
|
-
var
|
|
2972
|
+
var React25 = __toESM(require("react"), 1);
|
|
2698
2973
|
var breakUp = (bp) => `(min-width: ${bp}px)`;
|
|
2699
2974
|
var breakDown = (bp) => `(max-width: ${bp}px)`;
|
|
2700
2975
|
function useBreakpoint(queryInput) {
|
|
@@ -2704,8 +2979,8 @@ function useBreakpoint(queryInput) {
|
|
|
2704
2979
|
if (typeof window === "undefined") return false;
|
|
2705
2980
|
return window.matchMedia(query).matches;
|
|
2706
2981
|
};
|
|
2707
|
-
const [matches, setMatches] =
|
|
2708
|
-
|
|
2982
|
+
const [matches, setMatches] = React25.useState(getMatch);
|
|
2983
|
+
React25.useEffect(() => {
|
|
2709
2984
|
if (typeof window === "undefined") return;
|
|
2710
2985
|
const media = window.matchMedia(query);
|
|
2711
2986
|
const listener = (e) => {
|
|
@@ -2759,9 +3034,11 @@ initTheme();
|
|
|
2759
3034
|
Input,
|
|
2760
3035
|
InputArea,
|
|
2761
3036
|
Label,
|
|
3037
|
+
Loader,
|
|
2762
3038
|
Modal,
|
|
2763
3039
|
ModalContainer,
|
|
2764
3040
|
Notistack,
|
|
3041
|
+
NotistackContext,
|
|
2765
3042
|
NotistackProvider,
|
|
2766
3043
|
Pending,
|
|
2767
3044
|
Phone,
|
|
@@ -2774,6 +3051,7 @@ initTheme();
|
|
|
2774
3051
|
ThemeContext,
|
|
2775
3052
|
ThemeProvider,
|
|
2776
3053
|
adjustColor,
|
|
3054
|
+
alpha,
|
|
2777
3055
|
applyTheme,
|
|
2778
3056
|
baseTokens,
|
|
2779
3057
|
bem,
|
|
@@ -2786,14 +3064,19 @@ initTheme();
|
|
|
2786
3064
|
createTheme,
|
|
2787
3065
|
createVariants,
|
|
2788
3066
|
cx,
|
|
3067
|
+
darken,
|
|
2789
3068
|
getContrast,
|
|
2790
3069
|
getCountryCodePhone,
|
|
2791
3070
|
getDialPhone,
|
|
2792
3071
|
getMonthCalendar,
|
|
2793
3072
|
getNumberPhone,
|
|
3073
|
+
hexToRgb,
|
|
2794
3074
|
initTheme,
|
|
2795
3075
|
isEmpty,
|
|
3076
|
+
lighten,
|
|
3077
|
+
mergeDeep,
|
|
2796
3078
|
normalizePhone,
|
|
3079
|
+
rgbToHex,
|
|
2797
3080
|
text,
|
|
2798
3081
|
times,
|
|
2799
3082
|
uiStyle,
|