@yr3/ui 1.0.13 → 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 +509 -236
- package/dist/index.d.cts +72 -10
- package/dist/index.d.ts +72 -10
- package/dist/index.js +502 -236
- 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.js
CHANGED
|
@@ -104,6 +104,20 @@ function getMonthCalendar(year, month, startIndex, selected, props) {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
// src/utils/color.ts
|
|
107
|
+
var rgbToHex = (r, g, b) => {
|
|
108
|
+
return "#" + [r, g, b].map(
|
|
109
|
+
(v) => Math.round(Math.max(0, Math.min(255, v))).toString(16).padStart(2, "0")
|
|
110
|
+
).join("");
|
|
111
|
+
};
|
|
112
|
+
var hexToRgb = (hex) => {
|
|
113
|
+
const clean = hex.replace("#", "");
|
|
114
|
+
const num = parseInt(clean, 16);
|
|
115
|
+
return {
|
|
116
|
+
r: num >> 16 & 255,
|
|
117
|
+
g: num >> 8 & 255,
|
|
118
|
+
b: num & 255
|
|
119
|
+
};
|
|
120
|
+
};
|
|
107
121
|
var adjustColor = (hex, amount) => {
|
|
108
122
|
const num = parseInt(hex.replace("#", ""), 16);
|
|
109
123
|
let r = (num >> 16) + amount;
|
|
@@ -131,6 +145,26 @@ var createPaletteColor = (main) => {
|
|
|
131
145
|
contrastText: getContrast(main)
|
|
132
146
|
};
|
|
133
147
|
};
|
|
148
|
+
var lighten = (hex, amount) => {
|
|
149
|
+
const { r, g, b } = hexToRgb(hex);
|
|
150
|
+
return rgbToHex(
|
|
151
|
+
r + (255 - r) * amount,
|
|
152
|
+
g + (255 - g) * amount,
|
|
153
|
+
b + (255 - b) * amount
|
|
154
|
+
);
|
|
155
|
+
};
|
|
156
|
+
var darken = (hex, amount) => {
|
|
157
|
+
const { r, g, b } = hexToRgb(hex);
|
|
158
|
+
return rgbToHex(
|
|
159
|
+
r * (1 - amount),
|
|
160
|
+
g * (1 - amount),
|
|
161
|
+
b * (1 - amount)
|
|
162
|
+
);
|
|
163
|
+
};
|
|
164
|
+
var alpha = (hex, opacity) => {
|
|
165
|
+
const { r, g, b } = hexToRgb(hex);
|
|
166
|
+
return `rgba(${r}, ${g}, ${b}, ${opacity})`;
|
|
167
|
+
};
|
|
134
168
|
|
|
135
169
|
// src/utils/common.ts
|
|
136
170
|
function isEmpty(value) {
|
|
@@ -292,6 +326,24 @@ var getNumberPhone = (phone, dial) => {
|
|
|
292
326
|
return phone;
|
|
293
327
|
};
|
|
294
328
|
|
|
329
|
+
// src/utils/merge.ts
|
|
330
|
+
function mergeDeep(target, source) {
|
|
331
|
+
if (!source) return target;
|
|
332
|
+
const output = { ...target };
|
|
333
|
+
Object.keys(source).forEach((key) => {
|
|
334
|
+
const k = key;
|
|
335
|
+
if (typeof source[k] === "object" && source[k] !== null && !Array.isArray(source[k])) {
|
|
336
|
+
output[k] = mergeDeep(
|
|
337
|
+
target[k] || {},
|
|
338
|
+
source[k]
|
|
339
|
+
);
|
|
340
|
+
} else {
|
|
341
|
+
output[k] = source[k];
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
return output;
|
|
345
|
+
}
|
|
346
|
+
|
|
295
347
|
// src/theme/breakpoint.ts
|
|
296
348
|
var breakpoints = {
|
|
297
349
|
xs: 0,
|
|
@@ -369,6 +421,7 @@ var createTheme = (props) => {
|
|
|
369
421
|
warning: createPaletteColor("#ffc107"),
|
|
370
422
|
info: createPaletteColor("#17a2b8"),
|
|
371
423
|
disabled: "#aeaeae84",
|
|
424
|
+
backdrop: "rgba(0, 0, 0, 0.5)",
|
|
372
425
|
background: {
|
|
373
426
|
default: "#0f0f1a",
|
|
374
427
|
surface: "#1a1a2e"
|
|
@@ -376,6 +429,10 @@ var createTheme = (props) => {
|
|
|
376
429
|
text: {
|
|
377
430
|
primary: "#ffffff",
|
|
378
431
|
secondary: "#2e2f2f"
|
|
432
|
+
},
|
|
433
|
+
common: {
|
|
434
|
+
white: "#ffffff",
|
|
435
|
+
black: "#000000"
|
|
379
436
|
}
|
|
380
437
|
},
|
|
381
438
|
breakpoints,
|
|
@@ -410,6 +467,9 @@ var applyTheme = (theme, target) => {
|
|
|
410
467
|
root.style.setProperty(`--color-${key}-contrast`, value.contrastText);
|
|
411
468
|
}
|
|
412
469
|
});
|
|
470
|
+
if (theme.colors.backdrop) {
|
|
471
|
+
root.style.setProperty("--color-backdrop", theme.colors.backdrop);
|
|
472
|
+
}
|
|
413
473
|
if (theme.colors.background?.default) {
|
|
414
474
|
root.style.setProperty("--color-bg", theme.colors.background.default);
|
|
415
475
|
}
|
|
@@ -419,12 +479,21 @@ var applyTheme = (theme, target) => {
|
|
|
419
479
|
if (theme.colors.disabled) {
|
|
420
480
|
root.style.setProperty("--color-disabled", theme.colors.disabled);
|
|
421
481
|
}
|
|
482
|
+
if (theme.colors.text?.primary) {
|
|
483
|
+
root.style.setProperty("--color-text", theme.colors.text?.primary);
|
|
484
|
+
}
|
|
422
485
|
if (theme.colors.text?.primary) {
|
|
423
486
|
root.style.setProperty("--color-text-primary", theme.colors.text?.primary);
|
|
424
487
|
}
|
|
425
488
|
if (theme.colors.text?.secondary) {
|
|
426
489
|
root.style.setProperty("--color-text-secondary", theme.colors.text?.secondary);
|
|
427
490
|
}
|
|
491
|
+
if (theme.colors.common?.white) {
|
|
492
|
+
root.style.setProperty("--color-white", theme.colors.common.white);
|
|
493
|
+
}
|
|
494
|
+
if (theme.colors.common?.black) {
|
|
495
|
+
root.style.setProperty("--color-black", theme.colors.common.black);
|
|
496
|
+
}
|
|
428
497
|
if (theme.breakpoints) {
|
|
429
498
|
Object.entries(theme.breakpoints).forEach(([key, value]) => {
|
|
430
499
|
document.documentElement.style.setProperty(
|
|
@@ -470,7 +539,8 @@ var avatarVariants = createVariants({
|
|
|
470
539
|
text: "yr3Avatar--color-text",
|
|
471
540
|
warning: "yr3Avatar--color-warning",
|
|
472
541
|
info: "yr3Avatar--color-info",
|
|
473
|
-
error: "yr3Avatar--color-error"
|
|
542
|
+
error: "yr3Avatar--color-error",
|
|
543
|
+
common: "yr3Avatar--color-common"
|
|
474
544
|
},
|
|
475
545
|
size: {
|
|
476
546
|
sm: "yr3Avatar--sm",
|
|
@@ -480,10 +550,11 @@ var avatarVariants = createVariants({
|
|
|
480
550
|
variant: {
|
|
481
551
|
circle: "yr3Avatar--circle",
|
|
482
552
|
square: "yr3Avatar--square",
|
|
483
|
-
rounded: "yr3Avatar--rounded"
|
|
553
|
+
rounded: "yr3Avatar--rounded",
|
|
554
|
+
bordered: "yr3Avatar--bordered"
|
|
484
555
|
},
|
|
485
556
|
bordered: {
|
|
486
|
-
true: "yr3Avatar--
|
|
557
|
+
true: "yr3Avatar--border-active"
|
|
487
558
|
},
|
|
488
559
|
shadow: {
|
|
489
560
|
0: "",
|
|
@@ -508,7 +579,7 @@ var Avatar = ({
|
|
|
508
579
|
variant = "circle",
|
|
509
580
|
color = "primary",
|
|
510
581
|
label,
|
|
511
|
-
bordered =
|
|
582
|
+
bordered = false,
|
|
512
583
|
ui,
|
|
513
584
|
shadow = 0,
|
|
514
585
|
onClick,
|
|
@@ -636,7 +707,8 @@ var textVariants = createVariants({
|
|
|
636
707
|
warning: "yr3Text--color-warning",
|
|
637
708
|
error: "yr3Text--color-error",
|
|
638
709
|
info: "yr3Text--color-info",
|
|
639
|
-
background: "yr3Text--color-background"
|
|
710
|
+
background: "yr3Text--color-background",
|
|
711
|
+
common: "yr3Text--color-common"
|
|
640
712
|
},
|
|
641
713
|
weight: {
|
|
642
714
|
light: "yr3Text--weight-light",
|
|
@@ -696,7 +768,8 @@ var buttonVariant = createVariants({
|
|
|
696
768
|
info: "yr3Button--color-info",
|
|
697
769
|
error: "yr3Button--color-error",
|
|
698
770
|
background: "yr3Button--color-background",
|
|
699
|
-
warning: "yr3Button--color-warning"
|
|
771
|
+
warning: "yr3Button--color-warning",
|
|
772
|
+
common: "yr3Button--color-common"
|
|
700
773
|
},
|
|
701
774
|
size: {
|
|
702
775
|
auto: "yr3Button--size-auto",
|
|
@@ -892,6 +965,19 @@ var Calendar = ({ onSelect, propsComponent = initalPropsComponent, mapCalendar,
|
|
|
892
965
|
// src/components/Checkbox/Checkbox.tsx
|
|
893
966
|
import * as React4 from "react";
|
|
894
967
|
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
968
|
+
var initialPropsComponent = {
|
|
969
|
+
checkbox: {
|
|
970
|
+
ui: {
|
|
971
|
+
color: "primary"
|
|
972
|
+
}
|
|
973
|
+
},
|
|
974
|
+
content: {
|
|
975
|
+
variant: "caption",
|
|
976
|
+
color: "primary",
|
|
977
|
+
ui: {},
|
|
978
|
+
style: {}
|
|
979
|
+
}
|
|
980
|
+
};
|
|
895
981
|
var Checkbox = ({
|
|
896
982
|
checked,
|
|
897
983
|
defaultChecked,
|
|
@@ -900,6 +986,7 @@ var Checkbox = ({
|
|
|
900
986
|
color = "primary",
|
|
901
987
|
disabled,
|
|
902
988
|
propsComponent,
|
|
989
|
+
type = "default",
|
|
903
990
|
variant = "text"
|
|
904
991
|
}) => {
|
|
905
992
|
const [internal, setInternal] = React4.useState(defaultChecked || false);
|
|
@@ -909,11 +996,12 @@ var Checkbox = ({
|
|
|
909
996
|
if (!isControlled) setInternal(e.target.checked);
|
|
910
997
|
onChange?.(e, e.target.checked);
|
|
911
998
|
};
|
|
999
|
+
const properties = mergeDeep(initialPropsComponent, propsComponent || {});
|
|
912
1000
|
const bemClasse = bem("yr3Checkbox");
|
|
913
|
-
const classes = bemClasse(void 0, { color: `color-${color}`, disabled, variant: `variant-${variant}` });
|
|
1001
|
+
const classes = bemClasse(void 0, { color: `color-${color}`, disabled, variant: `variant-${variant}`, type: `type-${type}` });
|
|
914
1002
|
const boxClasses = bem("yr3Checkbox-box");
|
|
915
1003
|
const classesBox = boxClasses(void 0, { checked: !!value });
|
|
916
|
-
return /* @__PURE__ */ jsxs3("label", { className: classes, style: uiStyle(
|
|
1004
|
+
return /* @__PURE__ */ jsxs3("label", { className: classes, style: uiStyle(properties?.checkbox?.ui), "data-testid": "yr3Checkbox", children: [
|
|
917
1005
|
/* @__PURE__ */ jsx8(
|
|
918
1006
|
"input",
|
|
919
1007
|
{
|
|
@@ -925,7 +1013,7 @@ var Checkbox = ({
|
|
|
925
1013
|
}
|
|
926
1014
|
),
|
|
927
1015
|
/* @__PURE__ */ jsx8("span", { className: classesBox, "data-testid": "yr3Checkbox-box" }),
|
|
928
|
-
label && /* @__PURE__ */ jsx8(Text, { variant: "caption", color: !value ?
|
|
1016
|
+
label && /* @__PURE__ */ jsx8(Text, { variant: "caption", color: !value ? properties?.content?.color : color, ...properties?.content, children: label })
|
|
929
1017
|
] });
|
|
930
1018
|
};
|
|
931
1019
|
|
|
@@ -948,7 +1036,10 @@ var chipVariants = createVariants({
|
|
|
948
1036
|
success: "yr3Chip--success",
|
|
949
1037
|
error: "yr3Chip--error",
|
|
950
1038
|
warning: "yr3Chip--warning",
|
|
951
|
-
info: "yr3Chip--info"
|
|
1039
|
+
info: "yr3Chip--info",
|
|
1040
|
+
common: "yr3Chip--common",
|
|
1041
|
+
background: "yr3Chip--background",
|
|
1042
|
+
disabled: "yr3Chip--disabled"
|
|
952
1043
|
},
|
|
953
1044
|
rounded: {
|
|
954
1045
|
true: "yr3Chip--rounded",
|
|
@@ -975,7 +1066,22 @@ var IconClose = (props) => {
|
|
|
975
1066
|
|
|
976
1067
|
// src/components/Chip/Chip.tsx
|
|
977
1068
|
import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
978
|
-
var
|
|
1069
|
+
var initialChipProps = {
|
|
1070
|
+
label: {
|
|
1071
|
+
ui: {},
|
|
1072
|
+
style: {}
|
|
1073
|
+
},
|
|
1074
|
+
delete: {
|
|
1075
|
+
ui: {},
|
|
1076
|
+
style: {}
|
|
1077
|
+
},
|
|
1078
|
+
icon: {
|
|
1079
|
+
width: 20,
|
|
1080
|
+
height: 20
|
|
1081
|
+
}
|
|
1082
|
+
};
|
|
1083
|
+
var Chip = ({ label, variant, color, icon, deleted, onDelete, rounded, size = "medium", propsComponent, ...props }) => {
|
|
1084
|
+
const properties = mergeDeep(initialChipProps, propsComponent);
|
|
979
1085
|
const className = chip_variants_default({ variant, colors: color, rounded, size });
|
|
980
1086
|
return /* @__PURE__ */ jsxs4(
|
|
981
1087
|
"div",
|
|
@@ -983,14 +1089,21 @@ var Chip = ({ label, variant, color, icon, onDelete, rounded, size = "medium", u
|
|
|
983
1089
|
className,
|
|
984
1090
|
"data-testid": "yr3Chip",
|
|
985
1091
|
...props,
|
|
986
|
-
style:
|
|
987
|
-
...style,
|
|
988
|
-
...uiStyle(ui)
|
|
989
|
-
},
|
|
1092
|
+
style: composeStyles(properties.chip?.ui, properties.chip?.style),
|
|
990
1093
|
children: [
|
|
991
1094
|
icon,
|
|
992
|
-
/* @__PURE__ */ jsx10("span", { className: "yr3Chip__label", children: label }),
|
|
993
|
-
|
|
1095
|
+
/* @__PURE__ */ jsx10("span", { className: "yr3Chip__label", style: composeStyles(properties?.label?.ui, properties?.label?.style), children: label }),
|
|
1096
|
+
deleted && /* @__PURE__ */ jsx10(
|
|
1097
|
+
"span",
|
|
1098
|
+
{
|
|
1099
|
+
className: "yr3Chip__delete",
|
|
1100
|
+
onClick: onDelete,
|
|
1101
|
+
role: "button",
|
|
1102
|
+
"aria-label": "delete",
|
|
1103
|
+
style: composeStyles(properties?.delete?.ui, properties?.delete?.style),
|
|
1104
|
+
children: /* @__PURE__ */ jsx10(IconClose, { ...properties?.icon, stroke: color })
|
|
1105
|
+
}
|
|
1106
|
+
)
|
|
994
1107
|
]
|
|
995
1108
|
}
|
|
996
1109
|
);
|
|
@@ -1062,7 +1175,8 @@ var controlVariants = createVariants({
|
|
|
1062
1175
|
disabled: "yr3Control--color-disabled",
|
|
1063
1176
|
info: "yr3Control--color-info",
|
|
1064
1177
|
warning: "yr3Control--color-warning",
|
|
1065
|
-
error: "yr3Control--color-error"
|
|
1178
|
+
error: "yr3Control--color-error",
|
|
1179
|
+
common: "yr3Control--color-common"
|
|
1066
1180
|
},
|
|
1067
1181
|
size: {
|
|
1068
1182
|
auto: "yr3Control--size-auto",
|
|
@@ -1139,7 +1253,8 @@ var dividerVariants = createVariants({
|
|
|
1139
1253
|
text: "yr3Divider--color-text",
|
|
1140
1254
|
warning: "yr3Divider--color-warning",
|
|
1141
1255
|
info: "yr3Divider--color-info",
|
|
1142
|
-
error: "yr3Divider--color-error"
|
|
1256
|
+
error: "yr3Divider--color-error",
|
|
1257
|
+
common: "yr3Divider--color-common"
|
|
1143
1258
|
}
|
|
1144
1259
|
}
|
|
1145
1260
|
});
|
|
@@ -1194,33 +1309,42 @@ var useClickAway = (ref, callback) => {
|
|
|
1194
1309
|
|
|
1195
1310
|
// src/components/Drawer/Drawer.tsx
|
|
1196
1311
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1312
|
+
var initialPropsComponent2 = {
|
|
1313
|
+
drawer: {},
|
|
1314
|
+
closing: null,
|
|
1315
|
+
container: {},
|
|
1316
|
+
onClose: false
|
|
1317
|
+
};
|
|
1197
1318
|
var Drawer = ({ open, anchor = null, onClose, children, propsComponent }) => {
|
|
1198
1319
|
const { show, hide } = useBackdrop();
|
|
1199
1320
|
const ref = React8.useRef(null);
|
|
1321
|
+
const properties = mergeDeep(initialPropsComponent2, propsComponent);
|
|
1200
1322
|
React8.useEffect(() => {
|
|
1201
|
-
if (open) {
|
|
1323
|
+
if (!!open) {
|
|
1202
1324
|
show();
|
|
1325
|
+
} else {
|
|
1326
|
+
hide();
|
|
1203
1327
|
}
|
|
1204
1328
|
}, [open]);
|
|
1205
1329
|
useClickAway(ref, () => {
|
|
1206
|
-
if (!open ||
|
|
1207
|
-
if (
|
|
1330
|
+
if (!open || properties?.closing === null) return;
|
|
1331
|
+
if (properties?.closing === "drawer") {
|
|
1208
1332
|
hide();
|
|
1209
1333
|
onClose();
|
|
1210
1334
|
}
|
|
1211
1335
|
;
|
|
1212
1336
|
});
|
|
1213
1337
|
React8.useEffect(() => {
|
|
1214
|
-
if (
|
|
1338
|
+
if (properties?.onClose) {
|
|
1215
1339
|
hide();
|
|
1216
1340
|
onClose();
|
|
1217
1341
|
}
|
|
1218
|
-
}, [
|
|
1342
|
+
}, [properties?.onClose]);
|
|
1219
1343
|
return /* @__PURE__ */ jsx16(
|
|
1220
1344
|
"div",
|
|
1221
1345
|
{
|
|
1222
1346
|
className: `yr3Drawer ${anchor && `yr3Drawer--${anchor}`} ${open && "yr3Drawer--open"}`,
|
|
1223
|
-
style:
|
|
1347
|
+
style: properties?.drawer,
|
|
1224
1348
|
onClick: (e) => e.stopPropagation(),
|
|
1225
1349
|
ref,
|
|
1226
1350
|
"data-testid": "yr3Drawer",
|
|
@@ -1228,9 +1352,9 @@ var Drawer = ({ open, anchor = null, onClose, children, propsComponent }) => {
|
|
|
1228
1352
|
DrawerContainer_default,
|
|
1229
1353
|
{
|
|
1230
1354
|
children,
|
|
1231
|
-
...
|
|
1232
|
-
props:
|
|
1233
|
-
onClose: () =>
|
|
1355
|
+
...properties?.container,
|
|
1356
|
+
props: properties?.closing,
|
|
1357
|
+
onClose: () => properties?.closing === "container" ? onClose() : {}
|
|
1234
1358
|
}
|
|
1235
1359
|
)
|
|
1236
1360
|
},
|
|
@@ -1388,7 +1512,12 @@ var groupVariants = createVariants({
|
|
|
1388
1512
|
info: "yr3Group--color-info",
|
|
1389
1513
|
disabled: "yr3Group--color-disabled",
|
|
1390
1514
|
text: "yr3Group--color-text",
|
|
1391
|
-
background: "yr3Group--color-background"
|
|
1515
|
+
background: "yr3Group--color-background",
|
|
1516
|
+
common: "yr3Group--color-common"
|
|
1517
|
+
},
|
|
1518
|
+
type: {
|
|
1519
|
+
rounded: "yr3Group--type-rounded",
|
|
1520
|
+
square: "yr3Group--type-square"
|
|
1392
1521
|
}
|
|
1393
1522
|
}
|
|
1394
1523
|
});
|
|
@@ -1410,6 +1539,7 @@ var Group = ({
|
|
|
1410
1539
|
value,
|
|
1411
1540
|
onChange,
|
|
1412
1541
|
variant,
|
|
1542
|
+
type = "rounded",
|
|
1413
1543
|
color = "primary",
|
|
1414
1544
|
propsComponent = initialComponents
|
|
1415
1545
|
}) => {
|
|
@@ -1424,7 +1554,7 @@ var Group = ({
|
|
|
1424
1554
|
return /* @__PURE__ */ jsx20(
|
|
1425
1555
|
"div",
|
|
1426
1556
|
{
|
|
1427
|
-
className: groupVariants({ variant, color }),
|
|
1557
|
+
className: groupVariants({ variant, color, type }),
|
|
1428
1558
|
"data-testid": "yr3Group",
|
|
1429
1559
|
style: composeStyles(propsComponent.group?.ui, propsComponent.group?.style),
|
|
1430
1560
|
children: options.map((opt) => /* @__PURE__ */ jsx20(
|
|
@@ -1465,7 +1595,15 @@ var Image = ({
|
|
|
1465
1595
|
// src/components/ImageDropzone/ImageDropzone.tsx
|
|
1466
1596
|
import * as React11 from "react";
|
|
1467
1597
|
import { jsx as jsx22, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1468
|
-
var
|
|
1598
|
+
var initialPropsComponent3 = {
|
|
1599
|
+
box: {},
|
|
1600
|
+
text: {},
|
|
1601
|
+
container: {},
|
|
1602
|
+
preview: {},
|
|
1603
|
+
content: {}
|
|
1604
|
+
};
|
|
1605
|
+
var ImageDropzone = ({ onChange, multiple, propsComponent, bordered, component, defaultImage, variant = "outlined" }) => {
|
|
1606
|
+
const properties = mergeDeep(initialPropsComponent3, propsComponent || {});
|
|
1469
1607
|
const [dragging, setDragging] = React11.useState(false);
|
|
1470
1608
|
const [files, setFiles] = React11.useState([]);
|
|
1471
1609
|
const inputRef = React11.useRef(null);
|
|
@@ -1480,7 +1618,7 @@ var ImageDropzone = ({ onChange, multiple, ui, style, propsComponent, bordered,
|
|
|
1480
1618
|
};
|
|
1481
1619
|
const classes = bem("yr3Dropzone");
|
|
1482
1620
|
const classComponent = classes(void 0, { "dragging": !!dragging, "bordered": !!bordered, variant });
|
|
1483
|
-
return /* @__PURE__ */ jsx22(Box, { as: "div", position: "relative", content: "center", ...
|
|
1621
|
+
return /* @__PURE__ */ jsx22(Box, { as: "div", position: "relative", content: "center", ...properties?.box, children: /* @__PURE__ */ jsxs5(
|
|
1484
1622
|
"div",
|
|
1485
1623
|
{
|
|
1486
1624
|
className: classComponent,
|
|
@@ -1495,7 +1633,7 @@ var ImageDropzone = ({ onChange, multiple, ui, style, propsComponent, bordered,
|
|
|
1495
1633
|
handleFiles(e.dataTransfer.files);
|
|
1496
1634
|
},
|
|
1497
1635
|
onClick: () => inputRef.current?.click(),
|
|
1498
|
-
style: composeStyles(ui, style),
|
|
1636
|
+
style: composeStyles(properties?.container?.ui, properties?.container?.style),
|
|
1499
1637
|
children: [
|
|
1500
1638
|
/* @__PURE__ */ jsx22(
|
|
1501
1639
|
"input",
|
|
@@ -1508,10 +1646,10 @@ var ImageDropzone = ({ onChange, multiple, ui, style, propsComponent, bordered,
|
|
|
1508
1646
|
onChange: (e) => handleFiles(e.target.files)
|
|
1509
1647
|
}
|
|
1510
1648
|
),
|
|
1511
|
-
isEmpty(files) && /* @__PURE__ */ jsx22("div", { className: "yr3Dropzone--content", children: /* @__PURE__ */ jsx22(Text, { variant: "helper", color: "disabled", ...propsComponent?.text, children: propsComponent?.text?.primary || "Drag and drop an image here, or click to select one" }) }),
|
|
1512
|
-
multiple && /* @__PURE__ */ jsx22("div", { className: "yr3Dropzone--previews", children: files.map((file, i) => /* @__PURE__ */ jsx22("img", { src: URL.createObjectURL(file) }, i)) }),
|
|
1513
|
-
!multiple && /* @__PURE__ */ jsx22("div", { className: "yr3Dropzone--preview", children: files.map((file, i) => /* @__PURE__ */ jsx22("img", { src: URL.createObjectURL(file) }, i)) }),
|
|
1514
|
-
!!defaultImage && /* @__PURE__ */ jsx22("div", { className: "yr3Dropzone--preview", children: /* @__PURE__ */ jsx22("img", { src: defaultImage }) }),
|
|
1649
|
+
isEmpty(files) && /* @__PURE__ */ jsx22("div", { className: "yr3Dropzone--content", style: composeStyles(properties?.content?.ui, properties?.content?.style), children: /* @__PURE__ */ jsx22(Text, { variant: "helper", color: "disabled", ...propsComponent?.text, children: propsComponent?.text?.primary || "Drag and drop an image here, or click to select one" }) }),
|
|
1650
|
+
multiple && /* @__PURE__ */ jsx22("div", { className: "yr3Dropzone--previews", style: composeStyles(properties?.preview?.ui, properties?.preview?.style), children: files.map((file, i) => /* @__PURE__ */ jsx22("img", { src: URL.createObjectURL(file) }, i)) }),
|
|
1651
|
+
!multiple && /* @__PURE__ */ jsx22("div", { className: "yr3Dropzone--preview", style: composeStyles(properties?.preview?.ui, properties?.preview?.style), children: files.map((file, i) => /* @__PURE__ */ jsx22("img", { src: URL.createObjectURL(file) }, i)) }),
|
|
1652
|
+
!!defaultImage && /* @__PURE__ */ jsx22("div", { className: "yr3Dropzone--preview", style: composeStyles(properties?.preview?.ui, properties?.preview?.style), children: /* @__PURE__ */ jsx22("img", { src: defaultImage }) }),
|
|
1515
1653
|
component
|
|
1516
1654
|
]
|
|
1517
1655
|
}
|
|
@@ -1557,7 +1695,8 @@ var inputVariants = createVariants({
|
|
|
1557
1695
|
background: "yr3Input--color-background",
|
|
1558
1696
|
error: "yr3Input--color-error",
|
|
1559
1697
|
warning: "yr3Input--color-warning",
|
|
1560
|
-
info: "yr3Input--color-info"
|
|
1698
|
+
info: "yr3Input--color-info",
|
|
1699
|
+
common: "yr3Input--color-common"
|
|
1561
1700
|
},
|
|
1562
1701
|
size: {
|
|
1563
1702
|
auto: "yr3Input--size-auto",
|
|
@@ -1678,7 +1817,12 @@ var inputAreaVariants = createVariants({
|
|
|
1678
1817
|
secondary: "yr3InputArea--color-secondary",
|
|
1679
1818
|
success: "yr3InputArea--color-success",
|
|
1680
1819
|
text: "yr3InputArea--color-text",
|
|
1681
|
-
disabled: "yr3InputArea--color-disabled"
|
|
1820
|
+
disabled: "yr3InputArea--color-disabled",
|
|
1821
|
+
background: "yr3InputArea--color-background",
|
|
1822
|
+
error: "yr3InputArea--color-error",
|
|
1823
|
+
warning: "yr3InputArea--color-warning",
|
|
1824
|
+
info: "yr3InputArea--color-info",
|
|
1825
|
+
common: "yr3InputArea--color-common"
|
|
1682
1826
|
},
|
|
1683
1827
|
size: {
|
|
1684
1828
|
auto: "yr3InputArea--size-auto",
|
|
@@ -1765,22 +1909,88 @@ var InputArea = ({
|
|
|
1765
1909
|
] });
|
|
1766
1910
|
};
|
|
1767
1911
|
|
|
1768
|
-
// src/components/
|
|
1912
|
+
// src/components/Loader/loader.variants.ts
|
|
1913
|
+
var loaderSpinnerVariants = createVariants({
|
|
1914
|
+
base: "yr3Loader--spinner",
|
|
1915
|
+
variants: {
|
|
1916
|
+
color: {
|
|
1917
|
+
primary: "yr3Loader--spinner-color-primary",
|
|
1918
|
+
secondary: "yr3Loader--spinner-color-secondary",
|
|
1919
|
+
success: "yr3Loader--spinner-color-success",
|
|
1920
|
+
error: "yr3Loader--spinner-color-error",
|
|
1921
|
+
warning: "yr3Loader--spinner-color-warning",
|
|
1922
|
+
info: "yr3Loader--spinner-color-info",
|
|
1923
|
+
disabled: "yr3Loader--spinner-color-disabled",
|
|
1924
|
+
text: "yr3Loader--spinner-color-text",
|
|
1925
|
+
background: "yr3Loader--spinner-color-background",
|
|
1926
|
+
common: "yr3Loader--spinner-color-common"
|
|
1927
|
+
},
|
|
1928
|
+
size: {
|
|
1929
|
+
sm: "yr3Loader--spinner-size-sm",
|
|
1930
|
+
md: "yr3Loader--spinner-size-md",
|
|
1931
|
+
lg: "yr3Loader--spinner-size-lg"
|
|
1932
|
+
},
|
|
1933
|
+
type: {
|
|
1934
|
+
default: "yr3Loader--spinner-default",
|
|
1935
|
+
dots: "yr3Loader--spinner-dots",
|
|
1936
|
+
fancy: "yr3Loader--spinner-fancy"
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1939
|
+
});
|
|
1940
|
+
|
|
1941
|
+
// src/components/Loader/Loader.tsx
|
|
1769
1942
|
import * as React14 from "react";
|
|
1943
|
+
import { jsx as jsx26, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1944
|
+
var initialComponents2 = {
|
|
1945
|
+
loader: {
|
|
1946
|
+
ui: {},
|
|
1947
|
+
style: {}
|
|
1948
|
+
},
|
|
1949
|
+
spinner: {
|
|
1950
|
+
size: "sm",
|
|
1951
|
+
color: "primary",
|
|
1952
|
+
type: "default"
|
|
1953
|
+
},
|
|
1954
|
+
container: {
|
|
1955
|
+
center: true,
|
|
1956
|
+
container: true,
|
|
1957
|
+
ui: {
|
|
1958
|
+
width: "100%",
|
|
1959
|
+
height: "100%"
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
};
|
|
1963
|
+
var Loader = ({ component, loading = false, propsComponent }) => {
|
|
1964
|
+
const properties = mergeDeep(initialComponents2, propsComponent || {});
|
|
1965
|
+
const classSpinner = loaderSpinnerVariants({
|
|
1966
|
+
color: properties?.spinner?.color,
|
|
1967
|
+
type: properties?.spinner?.type,
|
|
1968
|
+
size: properties?.spinner?.size
|
|
1969
|
+
});
|
|
1970
|
+
if (!loading) return null;
|
|
1971
|
+
return /* @__PURE__ */ jsx26("div", { className: "yr3Loader", style: composeStyles(properties?.loader?.ui, properties?.loader?.style), children: /* @__PURE__ */ jsx26(Flex, { ...properties?.container, children: component || /* @__PURE__ */ jsx26("div", { className: classSpinner, children: properties?.spinner?.type === "dots" && /* @__PURE__ */ jsxs8(React14.Fragment, { children: [
|
|
1972
|
+
/* @__PURE__ */ jsx26("span", {}),
|
|
1973
|
+
/* @__PURE__ */ jsx26("span", {}),
|
|
1974
|
+
/* @__PURE__ */ jsx26("span", {})
|
|
1975
|
+
] }) }) }) });
|
|
1976
|
+
};
|
|
1977
|
+
|
|
1978
|
+
// src/components/Modal/Modal.tsx
|
|
1979
|
+
import * as React15 from "react";
|
|
1770
1980
|
|
|
1771
1981
|
// src/components/Modal/ModalContainer.tsx
|
|
1772
|
-
import { jsx as
|
|
1982
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1773
1983
|
var ModalContainer = ({ children, size = "sm", ui, style }) => {
|
|
1774
1984
|
const classes = bem("yr3Modal-container");
|
|
1775
1985
|
const classComponent = classes(void 0, { [`${size}`]: !!size });
|
|
1776
|
-
return /* @__PURE__ */
|
|
1986
|
+
return /* @__PURE__ */ jsx27("div", { className: classComponent, style: composeStyles(ui, style), "data-testid": "yr3Modal-container", children });
|
|
1777
1987
|
};
|
|
1778
1988
|
|
|
1779
1989
|
// src/components/Modal/Modal.tsx
|
|
1780
|
-
import { jsx as
|
|
1990
|
+
import { jsx as jsx28, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1781
1991
|
var Modal = ({ open, onClose, children, propsComponent }) => {
|
|
1782
1992
|
const { show, hide } = useBackdrop();
|
|
1783
|
-
|
|
1993
|
+
React15.useEffect(() => {
|
|
1784
1994
|
if (open) {
|
|
1785
1995
|
show();
|
|
1786
1996
|
} else {
|
|
@@ -1789,9 +1999,9 @@ var Modal = ({ open, onClose, children, propsComponent }) => {
|
|
|
1789
1999
|
}, [open, show]);
|
|
1790
2000
|
const classes = bem("yr3Modal");
|
|
1791
2001
|
const classComponent = classes(void 0, { "open": !!open });
|
|
1792
|
-
return /* @__PURE__ */
|
|
2002
|
+
return /* @__PURE__ */ jsx28("div", { className: classComponent, onClick: (e) => e.stopPropagation(), "data-testid": "yr3Modal", children: /* @__PURE__ */ jsx28(ModalContainer, { ...propsComponent?.container, children: /* @__PURE__ */ jsxs9(Flex, { variant: "column", container: true, center: true, gap: 1, children: [
|
|
1793
2003
|
children,
|
|
1794
|
-
propsComponent?.close ? propsComponent.close : /* @__PURE__ */
|
|
2004
|
+
propsComponent?.close ? propsComponent.close : /* @__PURE__ */ jsx28(Button, { variant: "filled", color: "secondary", onClick: onClose, "data-testid": "yr3Modal-close", children: "Close" })
|
|
1795
2005
|
] }) }) });
|
|
1796
2006
|
};
|
|
1797
2007
|
|
|
@@ -1831,15 +2041,15 @@ var notistackVariants = createVariants({
|
|
|
1831
2041
|
});
|
|
1832
2042
|
|
|
1833
2043
|
// src/components/Notistack/Notistack.tsx
|
|
1834
|
-
import { jsx as
|
|
2044
|
+
import { jsx as jsx29, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1835
2045
|
var Notistack = ({ message, duration = 3e3, variant = "info", color, propsComponent, anchor, exiting = false }) => {
|
|
1836
2046
|
const classes = notistackVariants({ type: variant, color, exiting, direction: `${anchor?.vertical || "bottom"}-${anchor?.horizontal || "right"}` });
|
|
1837
2047
|
const containerStyle = composeStyles(propsComponent?.container?.ui, propsComponent?.container?.style);
|
|
1838
2048
|
const notistackStyle = composeStyles(propsComponent?.notistack?.ui, propsComponent?.notistack?.style);
|
|
1839
2049
|
const progressStyle = composeStyles(propsComponent?.progress?.ui, propsComponent?.progress?.style);
|
|
1840
|
-
return /* @__PURE__ */
|
|
1841
|
-
/* @__PURE__ */
|
|
1842
|
-
/* @__PURE__ */
|
|
2050
|
+
return /* @__PURE__ */ jsxs10("div", { className: classes, "data-testid": "yr3Notistack", style: notistackStyle, children: [
|
|
2051
|
+
/* @__PURE__ */ jsx29("span", { style: containerStyle, children: message }),
|
|
2052
|
+
/* @__PURE__ */ jsx29(
|
|
1843
2053
|
"div",
|
|
1844
2054
|
{
|
|
1845
2055
|
className: "yr3Notistack--progress",
|
|
@@ -1867,13 +2077,14 @@ var pendingVariants = createVariants({
|
|
|
1867
2077
|
text: "yr3Pending--color-text",
|
|
1868
2078
|
info: "yr3Pending--color-info",
|
|
1869
2079
|
background: "yr3Pending--color-background",
|
|
1870
|
-
warning: "yr3Pending--color-warning"
|
|
2080
|
+
warning: "yr3Pending--color-warning",
|
|
2081
|
+
common: "yr3Pending--color-common"
|
|
1871
2082
|
}
|
|
1872
2083
|
}
|
|
1873
2084
|
});
|
|
1874
2085
|
|
|
1875
2086
|
// src/components/Pending/Pending.tsx
|
|
1876
|
-
import { jsx as
|
|
2087
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1877
2088
|
var Pending = ({
|
|
1878
2089
|
variant,
|
|
1879
2090
|
width,
|
|
@@ -1886,7 +2097,7 @@ var Pending = ({
|
|
|
1886
2097
|
const widthStyle = variant === "circle" ? size : width;
|
|
1887
2098
|
const heightStyle = variant === "circle" ? size : height;
|
|
1888
2099
|
const uiStylePending = uiStyle({ width: widthStyle, height: heightStyle, ...ui });
|
|
1889
|
-
return /* @__PURE__ */
|
|
2100
|
+
return /* @__PURE__ */ jsx30(
|
|
1890
2101
|
"div",
|
|
1891
2102
|
{
|
|
1892
2103
|
className: pendingVariants({ variant, color }),
|
|
@@ -1897,19 +2108,19 @@ var Pending = ({
|
|
|
1897
2108
|
};
|
|
1898
2109
|
|
|
1899
2110
|
// src/components/Phone/Phone.tsx
|
|
1900
|
-
import * as
|
|
2111
|
+
import * as React17 from "react";
|
|
1901
2112
|
|
|
1902
2113
|
// src/components/Selector/Selector.tsx
|
|
1903
|
-
import * as
|
|
2114
|
+
import * as React16 from "react";
|
|
1904
2115
|
|
|
1905
2116
|
// src/Icons/IconDown.tsx
|
|
1906
|
-
import { jsx as
|
|
2117
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1907
2118
|
var IconDown = (props) => {
|
|
1908
|
-
return /* @__PURE__ */
|
|
2119
|
+
return /* @__PURE__ */ jsx31("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__ */ jsx31("path", { d: "M7 10L12 15L17 10", stroke: props.stroke || "#fff", strokeWidth: props.strokeWidth || "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1909
2120
|
};
|
|
1910
2121
|
|
|
1911
2122
|
// src/components/Selector/Selector.tsx
|
|
1912
|
-
import { jsx as
|
|
2123
|
+
import { jsx as jsx32, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1913
2124
|
var initalPropsComponent2 = {
|
|
1914
2125
|
text: {
|
|
1915
2126
|
variant: "caption",
|
|
@@ -1922,16 +2133,16 @@ var initalPropsComponent2 = {
|
|
|
1922
2133
|
}
|
|
1923
2134
|
};
|
|
1924
2135
|
var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconColor, icon, propsComponent = initalPropsComponent2 }) => {
|
|
1925
|
-
const [open, setOpen] =
|
|
1926
|
-
const [valueState, setValueState] =
|
|
1927
|
-
const ref =
|
|
2136
|
+
const [open, setOpen] = React16.useState(false);
|
|
2137
|
+
const [valueState, setValueState] = React16.useState(value || defaultValue || null);
|
|
2138
|
+
const ref = React16.useRef(null);
|
|
1928
2139
|
useClickAway(ref, () => setOpen(false));
|
|
1929
|
-
return /* @__PURE__ */
|
|
1930
|
-
/* @__PURE__ */
|
|
1931
|
-
/* @__PURE__ */
|
|
2140
|
+
return /* @__PURE__ */ jsxs11("div", { className: "yr3Selector-wrapper", ref, children: [
|
|
2141
|
+
/* @__PURE__ */ jsx32("div", { className: `yr3Selector ${open ? "yr3Selector--open" : ""}`, style: composeStyles(ui, style), children: /* @__PURE__ */ jsxs11("div", { className: "yr3Selector--control", children: [
|
|
2142
|
+
/* @__PURE__ */ jsx32("div", { className: "yr3Selector--icon", onClick: () => setOpen((prev) => !prev), children: icon ? icon : /* @__PURE__ */ jsx32(IconDown, { stroke: `var(--color-${iconColor || "disabled"})`, width: 24, height: 24 }) }),
|
|
1932
2143
|
valueState
|
|
1933
2144
|
] }) }),
|
|
1934
|
-
open && /* @__PURE__ */
|
|
2145
|
+
open && /* @__PURE__ */ jsx32("div", { className: "yr3Selector--menu", style: composeStyles(propsComponent.menu?.ui, propsComponent.menu?.style), children: options.map((opt) => /* @__PURE__ */ jsx32(
|
|
1935
2146
|
"div",
|
|
1936
2147
|
{
|
|
1937
2148
|
className: "yr3Selector--option",
|
|
@@ -1952,7 +2163,7 @@ var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconC
|
|
|
1952
2163
|
};
|
|
1953
2164
|
onChange?.(event, opt.value);
|
|
1954
2165
|
},
|
|
1955
|
-
children: /* @__PURE__ */
|
|
2166
|
+
children: /* @__PURE__ */ jsx32(Text, { ...propsComponent?.text, children: propsComponent?.text?.children || opt.label })
|
|
1956
2167
|
},
|
|
1957
2168
|
opt.value
|
|
1958
2169
|
)) })
|
|
@@ -1961,7 +2172,7 @@ var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconC
|
|
|
1961
2172
|
var Selector_default = Selector;
|
|
1962
2173
|
|
|
1963
2174
|
// src/components/Phone/Phone.tsx
|
|
1964
|
-
import { jsx as
|
|
2175
|
+
import { jsx as jsx33, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1965
2176
|
var Phone = ({
|
|
1966
2177
|
name,
|
|
1967
2178
|
value,
|
|
@@ -1973,13 +2184,13 @@ var Phone = ({
|
|
|
1973
2184
|
}) => {
|
|
1974
2185
|
const isControlled = value !== void 0;
|
|
1975
2186
|
const initial = value || defaultValue || "";
|
|
1976
|
-
const [prefix, setPrefix] =
|
|
2187
|
+
const [prefix, setPrefix] = React17.useState(
|
|
1977
2188
|
getDialPhone(initial, countries) || countries[0].dial
|
|
1978
2189
|
);
|
|
1979
|
-
const [number, setNumber] =
|
|
2190
|
+
const [number, setNumber] = React17.useState(
|
|
1980
2191
|
getNumberPhone(initial, prefix) || ""
|
|
1981
2192
|
);
|
|
1982
|
-
|
|
2193
|
+
React17.useEffect(() => {
|
|
1983
2194
|
if (isControlled && value) {
|
|
1984
2195
|
const dial = getDialPhone(value, countries);
|
|
1985
2196
|
const num = getNumberPhone(value, dial);
|
|
@@ -1998,10 +2209,10 @@ var Phone = ({
|
|
|
1998
2209
|
setPrefix(val);
|
|
1999
2210
|
onChange?.(null, `${val}${number}`);
|
|
2000
2211
|
};
|
|
2001
|
-
return /* @__PURE__ */
|
|
2002
|
-
/* @__PURE__ */
|
|
2003
|
-
/* @__PURE__ */
|
|
2004
|
-
/* @__PURE__ */
|
|
2212
|
+
return /* @__PURE__ */ jsxs12(Control, { variant: "outlined", ui: { height: 50, position: "relative" }, children: [
|
|
2213
|
+
/* @__PURE__ */ jsx33(Label, { text: label, className: "yr3Input--active" }),
|
|
2214
|
+
/* @__PURE__ */ jsxs12(Flex, { variant: "row", container: true, center: true, children: [
|
|
2215
|
+
/* @__PURE__ */ jsx33(
|
|
2005
2216
|
Selector_default,
|
|
2006
2217
|
{
|
|
2007
2218
|
options: countries.map((c) => ({
|
|
@@ -2013,7 +2224,7 @@ var Phone = ({
|
|
|
2013
2224
|
...propsComponent?.selector
|
|
2014
2225
|
}
|
|
2015
2226
|
),
|
|
2016
|
-
/* @__PURE__ */
|
|
2227
|
+
/* @__PURE__ */ jsx33(
|
|
2017
2228
|
Divider,
|
|
2018
2229
|
{
|
|
2019
2230
|
orientation: "vertical",
|
|
@@ -2022,7 +2233,7 @@ var Phone = ({
|
|
|
2022
2233
|
...propsComponent?.divider
|
|
2023
2234
|
}
|
|
2024
2235
|
),
|
|
2025
|
-
/* @__PURE__ */
|
|
2236
|
+
/* @__PURE__ */ jsx33(
|
|
2026
2237
|
Input,
|
|
2027
2238
|
{
|
|
2028
2239
|
type: "number",
|
|
@@ -2038,9 +2249,9 @@ var Phone = ({
|
|
|
2038
2249
|
};
|
|
2039
2250
|
|
|
2040
2251
|
// src/components/Places/PlacesAutocomplete.tsx
|
|
2041
|
-
import * as
|
|
2252
|
+
import * as React18 from "react";
|
|
2042
2253
|
import { useAutocompletePlaces } from "@yr3/autocomplete-places";
|
|
2043
|
-
import { jsx as
|
|
2254
|
+
import { jsx as jsx34, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2044
2255
|
var initPropsComponent = {
|
|
2045
2256
|
label: {
|
|
2046
2257
|
display: true,
|
|
@@ -2080,9 +2291,9 @@ var PlacesAutocomplete = ({
|
|
|
2080
2291
|
keyApi,
|
|
2081
2292
|
propsComponent = initPropsComponent
|
|
2082
2293
|
}) => {
|
|
2083
|
-
const [value, setValue] =
|
|
2084
|
-
const inputRef =
|
|
2085
|
-
const [anchorEl, setAnchorEl] =
|
|
2294
|
+
const [value, setValue] = React18.useState(null);
|
|
2295
|
+
const inputRef = React18.useRef(null);
|
|
2296
|
+
const [anchorEl, setAnchorEl] = React18.useState(null);
|
|
2086
2297
|
const { suggestions, selectPlace } = useAutocompletePlaces({ input: value, apiKey: keyApi, language, provider });
|
|
2087
2298
|
const handleSelect = async (id) => {
|
|
2088
2299
|
const place = await selectPlace(id);
|
|
@@ -2102,12 +2313,12 @@ var PlacesAutocomplete = ({
|
|
|
2102
2313
|
setValue(place.address);
|
|
2103
2314
|
setAnchorEl(null);
|
|
2104
2315
|
};
|
|
2105
|
-
|
|
2316
|
+
React18.useEffect(() => {
|
|
2106
2317
|
if (defaultLocation) {
|
|
2107
2318
|
setValue(defaultLocation);
|
|
2108
2319
|
}
|
|
2109
2320
|
}, [defaultLocation]);
|
|
2110
|
-
|
|
2321
|
+
React18.useEffect(() => {
|
|
2111
2322
|
if (value === "") {
|
|
2112
2323
|
onSelect(null);
|
|
2113
2324
|
}
|
|
@@ -2117,13 +2328,13 @@ var PlacesAutocomplete = ({
|
|
|
2117
2328
|
setAnchorEl(e.target.value ? inputRef.current : null);
|
|
2118
2329
|
};
|
|
2119
2330
|
const open = suggestions.length > 0 && Boolean(anchorEl);
|
|
2120
|
-
|
|
2331
|
+
React18.useEffect(() => {
|
|
2121
2332
|
if (onChangeForm) {
|
|
2122
2333
|
onChangeForm({ target: { value } });
|
|
2123
2334
|
}
|
|
2124
2335
|
}, [onChangeForm]);
|
|
2125
|
-
return /* @__PURE__ */
|
|
2126
|
-
/* @__PURE__ */
|
|
2336
|
+
return /* @__PURE__ */ jsxs13(Control, { ...propsComponent?.control, children: [
|
|
2337
|
+
/* @__PURE__ */ jsx34(
|
|
2127
2338
|
Input,
|
|
2128
2339
|
{
|
|
2129
2340
|
ref: inputRef,
|
|
@@ -2137,7 +2348,7 @@ var PlacesAutocomplete = ({
|
|
|
2137
2348
|
},
|
|
2138
2349
|
"input-places"
|
|
2139
2350
|
),
|
|
2140
|
-
open && /* @__PURE__ */
|
|
2351
|
+
open && /* @__PURE__ */ jsx34("div", { className: "yr3Places--menu", style: composeStyles(propsComponent.menu?.ui, propsComponent?.menu?.style), children: /* @__PURE__ */ jsx34(Flex, { container: true, ui: { p: 1 }, children: suggestions.map((s) => /* @__PURE__ */ jsx34(Flex, { onClick: () => handleSelect(s.id), ui: { padding: 8, cursor: "pointer", "&:hover": { backgroundColor: "rgba(0,0,0,0.1)" } }, children: /* @__PURE__ */ jsx34(Text, { ...propsComponent?.menu?.text, children: s.description }) }, s.id)) }) })
|
|
2141
2352
|
] });
|
|
2142
2353
|
};
|
|
2143
2354
|
|
|
@@ -2154,13 +2365,18 @@ var radioVariant = createVariants({
|
|
|
2154
2365
|
secondary: "yr3Radio--color-secondary",
|
|
2155
2366
|
success: "yr3Radio--color-success",
|
|
2156
2367
|
text: "yr3Radio--color-text",
|
|
2157
|
-
disabled: "yr3Radio--color-disabled"
|
|
2368
|
+
disabled: "yr3Radio--color-disabled",
|
|
2369
|
+
background: "yr3Radio--color-background",
|
|
2370
|
+
error: "yr3Radio--color-error",
|
|
2371
|
+
warning: "yr3Radio--color-warning",
|
|
2372
|
+
info: "yr3Radio--color-info",
|
|
2373
|
+
common: "yr3Radio--color-common"
|
|
2158
2374
|
}
|
|
2159
2375
|
}
|
|
2160
2376
|
});
|
|
2161
2377
|
|
|
2162
2378
|
// src/components/Radio/Radio.tsx
|
|
2163
|
-
import { jsx as
|
|
2379
|
+
import { jsx as jsx35, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2164
2380
|
var Radio = ({
|
|
2165
2381
|
checked,
|
|
2166
2382
|
value,
|
|
@@ -2176,8 +2392,8 @@ var Radio = ({
|
|
|
2176
2392
|
const bemClass = bem("yr3Radio");
|
|
2177
2393
|
const classes = bemClass(void 0, { [color]: `color-${color}` });
|
|
2178
2394
|
const variantClass = radioVariant({ variant });
|
|
2179
|
-
return /* @__PURE__ */
|
|
2180
|
-
/* @__PURE__ */
|
|
2395
|
+
return /* @__PURE__ */ jsxs14("label", { className: classes, "data-testid": "yr3Radio", style: composeStyles(propsComponent?.radio?.ui, propsComponent?.radio?.style), children: [
|
|
2396
|
+
/* @__PURE__ */ jsx35(
|
|
2181
2397
|
"input",
|
|
2182
2398
|
{
|
|
2183
2399
|
type: "radio",
|
|
@@ -2189,8 +2405,8 @@ var Radio = ({
|
|
|
2189
2405
|
}
|
|
2190
2406
|
),
|
|
2191
2407
|
iconChecked && checked ? iconChecked : !checked && iconUnchecked ? iconUnchecked : null,
|
|
2192
|
-
!iconChecked && !iconUnchecked && /* @__PURE__ */
|
|
2193
|
-
typeof label === "string" && /* @__PURE__ */
|
|
2408
|
+
!iconChecked && !iconUnchecked && /* @__PURE__ */ jsx35("span", { className: variantClass, "data-testid": "yr3Radio-dot" }),
|
|
2409
|
+
typeof label === "string" && /* @__PURE__ */ jsx35(
|
|
2194
2410
|
"span",
|
|
2195
2411
|
{
|
|
2196
2412
|
className: "yr3Radio--label",
|
|
@@ -2203,7 +2419,104 @@ var Radio = ({
|
|
|
2203
2419
|
};
|
|
2204
2420
|
|
|
2205
2421
|
// src/components/Select/Select.tsx
|
|
2206
|
-
import * as
|
|
2422
|
+
import * as React22 from "react";
|
|
2423
|
+
|
|
2424
|
+
// src/theme/ThemeProvider.tsx
|
|
2425
|
+
import * as React20 from "react";
|
|
2426
|
+
|
|
2427
|
+
// src/theme/notistackContext.tsx
|
|
2428
|
+
import * as React19 from "react";
|
|
2429
|
+
import { jsx as jsx36, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2430
|
+
var NotistackContext = React19.createContext(null);
|
|
2431
|
+
var NotistackProvider = ({ children }) => {
|
|
2432
|
+
const [snacks, setSnacks] = React19.useState([]);
|
|
2433
|
+
const notistack = (snack) => {
|
|
2434
|
+
const id = Date.now();
|
|
2435
|
+
setSnacks((prev) => [...prev, { ...snack, id, exiting: false }]);
|
|
2436
|
+
const duration = snack.duration || 3e3;
|
|
2437
|
+
const exitDuration = 300;
|
|
2438
|
+
setTimeout(() => {
|
|
2439
|
+
setSnacks(
|
|
2440
|
+
(prev) => prev.map((s) => s.id === id ? { ...s, exiting: true } : s)
|
|
2441
|
+
);
|
|
2442
|
+
}, duration);
|
|
2443
|
+
setTimeout(() => {
|
|
2444
|
+
setSnacks((prev) => prev.filter((s) => s.id !== id));
|
|
2445
|
+
}, duration + exitDuration);
|
|
2446
|
+
};
|
|
2447
|
+
return /* @__PURE__ */ jsxs15(NotistackContext.Provider, { value: { notistack }, children: [
|
|
2448
|
+
children,
|
|
2449
|
+
/* @__PURE__ */ jsx36("div", { className: "yr3NotistackContainer", children: snacks.map((snack) => /* @__PURE__ */ jsx36(Notistack, { ...snack }, snack.id)) })
|
|
2450
|
+
] });
|
|
2451
|
+
};
|
|
2452
|
+
var useNotistack = () => {
|
|
2453
|
+
const ctx = React19.useContext(NotistackContext);
|
|
2454
|
+
if (!ctx) {
|
|
2455
|
+
throw new Error("NotistackProvider missing");
|
|
2456
|
+
}
|
|
2457
|
+
return ctx;
|
|
2458
|
+
};
|
|
2459
|
+
|
|
2460
|
+
// src/theme/ThemeProvider.tsx
|
|
2461
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
2462
|
+
var ThemeContext = React20.createContext(null);
|
|
2463
|
+
var ThemeProvider = ({ theme, children }) => {
|
|
2464
|
+
React20.useEffect(() => {
|
|
2465
|
+
applyTheme(theme);
|
|
2466
|
+
}, [theme]);
|
|
2467
|
+
return /* @__PURE__ */ jsx37(ThemeContext.Provider, { value: theme, children: /* @__PURE__ */ jsx37(BackdropProvider, { children: /* @__PURE__ */ jsx37(NotistackProvider, { children }) }) });
|
|
2468
|
+
};
|
|
2469
|
+
var useTheme = () => React20.useContext(ThemeContext);
|
|
2470
|
+
|
|
2471
|
+
// src/theme/tokens.ts
|
|
2472
|
+
var baseTokens = {
|
|
2473
|
+
colors: {
|
|
2474
|
+
primary: "#6C5CE7",
|
|
2475
|
+
secondary: "#00CEC9",
|
|
2476
|
+
background: "#0f0f1a",
|
|
2477
|
+
surface: "#1a1a2e",
|
|
2478
|
+
textPrimary: "#ffffff",
|
|
2479
|
+
textSecondary: "#b2bec3"
|
|
2480
|
+
},
|
|
2481
|
+
spacing: (factor) => `${factor * 8}px`,
|
|
2482
|
+
radius: {
|
|
2483
|
+
sm: "6px",
|
|
2484
|
+
md: "12px",
|
|
2485
|
+
lg: "20px"
|
|
2486
|
+
}
|
|
2487
|
+
};
|
|
2488
|
+
|
|
2489
|
+
// src/theme/useMediaQuery.tsx
|
|
2490
|
+
import * as React21 from "react";
|
|
2491
|
+
function useMediaQuery(query) {
|
|
2492
|
+
const theme = useTheme();
|
|
2493
|
+
const computedQuery = typeof query === "function" ? query(theme) : query;
|
|
2494
|
+
const [matches, setMatches] = React21.useState(() => {
|
|
2495
|
+
if (typeof window === "undefined") return false;
|
|
2496
|
+
return window.matchMedia(computedQuery).matches;
|
|
2497
|
+
});
|
|
2498
|
+
React21.useEffect(() => {
|
|
2499
|
+
if (typeof window === "undefined") return;
|
|
2500
|
+
const media = window.matchMedia(computedQuery);
|
|
2501
|
+
const listener = () => setMatches(media.matches);
|
|
2502
|
+
media.addEventListener("change", listener);
|
|
2503
|
+
return () => media.removeEventListener("change", listener);
|
|
2504
|
+
}, [computedQuery]);
|
|
2505
|
+
return matches;
|
|
2506
|
+
}
|
|
2507
|
+
function useBreakpointValue(values) {
|
|
2508
|
+
const xs = useMediaQuery(`(min-width: ${breakpoints.xs}px)`);
|
|
2509
|
+
const sm = useMediaQuery(`(min-width: ${breakpoints.sm}px)`);
|
|
2510
|
+
const md = useMediaQuery(`(min-width: ${breakpoints.md}px)`);
|
|
2511
|
+
const lg = useMediaQuery(`(min-width: ${breakpoints.lg}px)`);
|
|
2512
|
+
const xl = useMediaQuery(`(min-width: ${breakpoints.xl}px)`);
|
|
2513
|
+
if (xl && values.xl !== void 0) return values.xl;
|
|
2514
|
+
if (lg && values.lg !== void 0) return values.lg;
|
|
2515
|
+
if (md && values.md !== void 0) return values.md;
|
|
2516
|
+
if (sm && values.sm !== void 0) return values.sm;
|
|
2517
|
+
if (xs && values.xs !== void 0) return values.xs;
|
|
2518
|
+
return void 0;
|
|
2519
|
+
}
|
|
2207
2520
|
|
|
2208
2521
|
// src/components/Select/select.variants.ts
|
|
2209
2522
|
var selectVariants = createVariants({
|
|
@@ -2227,17 +2540,43 @@ var selectVariants = createVariants({
|
|
|
2227
2540
|
background: "yr3Select--color-background",
|
|
2228
2541
|
error: "yr3Select--color-error",
|
|
2229
2542
|
warning: "yr3Select--color-warning",
|
|
2230
|
-
info: "yr3Select--color-info"
|
|
2543
|
+
info: "yr3Select--color-info",
|
|
2544
|
+
common: "yr3Select--color-common"
|
|
2231
2545
|
},
|
|
2232
2546
|
animated: {
|
|
2233
2547
|
true: "yr3Select--animated"
|
|
2548
|
+
},
|
|
2549
|
+
icon: {
|
|
2550
|
+
true: "yr3Select--icon"
|
|
2551
|
+
}
|
|
2552
|
+
}
|
|
2553
|
+
});
|
|
2554
|
+
var selectIconVariants = createVariants({
|
|
2555
|
+
base: "yr3Select--icon",
|
|
2556
|
+
variants: {
|
|
2557
|
+
color: {
|
|
2558
|
+
primary: "yr3Select--icon-color-primary",
|
|
2559
|
+
secondary: "yr3Select--icon-color-secondary",
|
|
2560
|
+
success: "yr3Select--icon-color-success",
|
|
2561
|
+
text: "yr3Select--icon-color-text",
|
|
2562
|
+
disabled: "yr3Select--icon-color-disabled",
|
|
2563
|
+
background: "yr3Select--icon-color-background",
|
|
2564
|
+
error: "yr3Select--icon-color-error",
|
|
2565
|
+
warning: "yr3Select--icon-color-warning",
|
|
2566
|
+
info: "yr3Select--icon-color-info",
|
|
2567
|
+
common: "yr3Select--icon-color-common"
|
|
2568
|
+
},
|
|
2569
|
+
animated: {
|
|
2570
|
+
true: "yr3Select--icon-animated"
|
|
2571
|
+
},
|
|
2572
|
+
open: {
|
|
2573
|
+
true: "yr3Select--icon-open"
|
|
2234
2574
|
}
|
|
2235
2575
|
}
|
|
2236
2576
|
});
|
|
2237
|
-
var select_variants_default = selectVariants;
|
|
2238
2577
|
|
|
2239
2578
|
// src/components/Select/Select.tsx
|
|
2240
|
-
import { jsx as
|
|
2579
|
+
import { jsx as jsx38, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2241
2580
|
var initiaPropsComponent3 = {
|
|
2242
2581
|
control: {
|
|
2243
2582
|
variant: "outlined",
|
|
@@ -2247,6 +2586,7 @@ var initiaPropsComponent3 = {
|
|
|
2247
2586
|
},
|
|
2248
2587
|
label: {
|
|
2249
2588
|
display: true,
|
|
2589
|
+
color: "primary",
|
|
2250
2590
|
ui: {},
|
|
2251
2591
|
style: {}
|
|
2252
2592
|
},
|
|
@@ -2269,20 +2609,23 @@ var initiaPropsComponent3 = {
|
|
|
2269
2609
|
icon: {
|
|
2270
2610
|
style: {
|
|
2271
2611
|
width: 24,
|
|
2272
|
-
height: 24
|
|
2273
|
-
stroke: "currentColor"
|
|
2612
|
+
height: 24
|
|
2274
2613
|
},
|
|
2614
|
+
color: "primary",
|
|
2275
2615
|
component: void 0
|
|
2276
2616
|
}
|
|
2277
2617
|
};
|
|
2278
|
-
var Select = ({ label, options, name, value, defaultValue, onChange, propsComponent
|
|
2279
|
-
const [open, setOpen] =
|
|
2280
|
-
const [valueState, setValueState] =
|
|
2281
|
-
const ref =
|
|
2618
|
+
var Select = ({ label, options, name, value, defaultValue, onChange, propsComponent }) => {
|
|
2619
|
+
const [open, setOpen] = React22.useState(false);
|
|
2620
|
+
const [valueState, setValueState] = React22.useState(value || defaultValue || null);
|
|
2621
|
+
const ref = React22.useRef(null);
|
|
2282
2622
|
useClickAway(ref, () => setOpen(false));
|
|
2283
|
-
const
|
|
2284
|
-
|
|
2285
|
-
|
|
2623
|
+
const theme = useTheme();
|
|
2624
|
+
const properties = mergeDeep(initiaPropsComponent3, propsComponent || {});
|
|
2625
|
+
const classesIcon = selectIconVariants({ color: properties?.icon?.color, animated: open, open });
|
|
2626
|
+
const classes = selectVariants({ wrapper: true });
|
|
2627
|
+
return /* @__PURE__ */ jsxs16("div", { className: classes, ref, children: [
|
|
2628
|
+
/* @__PURE__ */ jsx38(
|
|
2286
2629
|
Input,
|
|
2287
2630
|
{
|
|
2288
2631
|
label,
|
|
@@ -2290,27 +2633,36 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
2290
2633
|
disabled: true,
|
|
2291
2634
|
value: valueState,
|
|
2292
2635
|
propsComponent: {
|
|
2293
|
-
control:
|
|
2294
|
-
label:
|
|
2636
|
+
control: properties?.control,
|
|
2637
|
+
label: properties?.label
|
|
2295
2638
|
}
|
|
2296
2639
|
}
|
|
2297
2640
|
),
|
|
2298
|
-
/* @__PURE__ */
|
|
2299
|
-
|
|
2641
|
+
/* @__PURE__ */ jsx38(
|
|
2642
|
+
"div",
|
|
2300
2643
|
{
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2644
|
+
className: classesIcon,
|
|
2645
|
+
style: properties?.icon?.style,
|
|
2646
|
+
onClick: () => setOpen((prev) => !prev),
|
|
2647
|
+
"data-testid": "yr3Select-icon",
|
|
2648
|
+
children: properties?.icon?.component ? properties?.icon.component : /* @__PURE__ */ jsx38(
|
|
2649
|
+
IconDown,
|
|
2650
|
+
{
|
|
2651
|
+
width: properties?.icon?.style?.width,
|
|
2652
|
+
height: properties?.icon?.style?.height,
|
|
2653
|
+
stroke: "currentColor",
|
|
2654
|
+
style: properties?.icon?.style
|
|
2655
|
+
}
|
|
2656
|
+
)
|
|
2305
2657
|
}
|
|
2306
|
-
)
|
|
2307
|
-
open && /* @__PURE__ */
|
|
2658
|
+
),
|
|
2659
|
+
open && /* @__PURE__ */ jsx38(
|
|
2308
2660
|
"div",
|
|
2309
2661
|
{
|
|
2310
2662
|
className: "yr3Select--menu",
|
|
2311
|
-
style: composeStyles(
|
|
2663
|
+
style: composeStyles(properties?.menu?.ui, properties?.menu?.style),
|
|
2312
2664
|
"data-testid": "yr3Select-menu",
|
|
2313
|
-
children: options.map((opt) => /* @__PURE__ */
|
|
2665
|
+
children: options.map((opt) => /* @__PURE__ */ jsx38(
|
|
2314
2666
|
"div",
|
|
2315
2667
|
{
|
|
2316
2668
|
className: "yr3Select--option",
|
|
@@ -2331,8 +2683,8 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
2331
2683
|
};
|
|
2332
2684
|
onChange?.(event, opt.value);
|
|
2333
2685
|
},
|
|
2334
|
-
style: composeStyles(
|
|
2335
|
-
children: /* @__PURE__ */
|
|
2686
|
+
style: composeStyles(properties?.menu?.options?.ui, properties?.menu?.options?.style),
|
|
2687
|
+
children: /* @__PURE__ */ jsx38(Text, { as: "span", variant: "caption", color: properties?.menu?.options?.text?.color || "primary", ...properties?.menu?.options?.text, children: opt.label })
|
|
2336
2688
|
},
|
|
2337
2689
|
opt.value
|
|
2338
2690
|
))
|
|
@@ -2342,8 +2694,8 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
2342
2694
|
};
|
|
2343
2695
|
|
|
2344
2696
|
// src/components/Slide/Slide.tsx
|
|
2345
|
-
import * as
|
|
2346
|
-
import { jsx as
|
|
2697
|
+
import * as React23 from "react";
|
|
2698
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
2347
2699
|
var Slide = ({
|
|
2348
2700
|
in: inProp,
|
|
2349
2701
|
children,
|
|
@@ -2357,7 +2709,7 @@ var Slide = ({
|
|
|
2357
2709
|
[direction]: true,
|
|
2358
2710
|
"in": !!inProp
|
|
2359
2711
|
});
|
|
2360
|
-
|
|
2712
|
+
React23.useEffect(() => {
|
|
2361
2713
|
let timeoutId;
|
|
2362
2714
|
if (inProp) {
|
|
2363
2715
|
timeoutId = setTimeout(() => {
|
|
@@ -2367,19 +2719,19 @@ var Slide = ({
|
|
|
2367
2719
|
return () => clearTimeout(timeoutId);
|
|
2368
2720
|
}, [inProp, duration, onTransitionEnd]);
|
|
2369
2721
|
const uiStyleContent = uiStyle({ ...propsComponent?.slide?.ui, transitionDuration: `${duration}ms` });
|
|
2370
|
-
return /* @__PURE__ */
|
|
2722
|
+
return /* @__PURE__ */ jsx39(
|
|
2371
2723
|
"div",
|
|
2372
2724
|
{
|
|
2373
2725
|
className: "yr3Slide",
|
|
2374
2726
|
style: uiStyle({ position: "relative", zIndex: 4, overflow: "hidden" }),
|
|
2375
2727
|
"data-testid": "yr3Slide",
|
|
2376
|
-
children: /* @__PURE__ */
|
|
2728
|
+
children: /* @__PURE__ */ jsx39(
|
|
2377
2729
|
"div",
|
|
2378
2730
|
{
|
|
2379
2731
|
className: classNameContent,
|
|
2380
2732
|
style: composeStyles(uiStyleContent, propsComponent?.slide?.style || {}),
|
|
2381
2733
|
"data-testid": "yr3Slide-content",
|
|
2382
|
-
children: /* @__PURE__ */
|
|
2734
|
+
children: /* @__PURE__ */ jsx39(Box, { ...propsComponent?.box, "data-testid": "yr3Slide-box", children })
|
|
2383
2735
|
}
|
|
2384
2736
|
)
|
|
2385
2737
|
}
|
|
@@ -2387,7 +2739,7 @@ var Slide = ({
|
|
|
2387
2739
|
};
|
|
2388
2740
|
|
|
2389
2741
|
// src/components/Switch/Switch.tsx
|
|
2390
|
-
import * as
|
|
2742
|
+
import * as React24 from "react";
|
|
2391
2743
|
|
|
2392
2744
|
// src/components/Switch/switch.variants.ts
|
|
2393
2745
|
var switchVariants = createVariants({
|
|
@@ -2399,7 +2751,11 @@ var switchVariants = createVariants({
|
|
|
2399
2751
|
success: "yr3Switch--color-success",
|
|
2400
2752
|
text: "yr3Switch--color-text",
|
|
2401
2753
|
disabled: "yr3Switch--color-disabled",
|
|
2402
|
-
warning: "yr3Switch--color-warning"
|
|
2754
|
+
warning: "yr3Switch--color-warning",
|
|
2755
|
+
info: "yr3Switch--color-info",
|
|
2756
|
+
error: "yr3Switch--color-error",
|
|
2757
|
+
background: "yr3Switch--color-background",
|
|
2758
|
+
common: "yr3Switch--color-common"
|
|
2403
2759
|
},
|
|
2404
2760
|
size: {
|
|
2405
2761
|
sm: "yr3Switch--sm",
|
|
@@ -2420,7 +2776,7 @@ var switchVariants = createVariants({
|
|
|
2420
2776
|
});
|
|
2421
2777
|
|
|
2422
2778
|
// src/components/Switch/Switch.tsx
|
|
2423
|
-
import { jsx as
|
|
2779
|
+
import { jsx as jsx40, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2424
2780
|
var Switch = ({
|
|
2425
2781
|
checked,
|
|
2426
2782
|
defaultChecked,
|
|
@@ -2432,7 +2788,7 @@ var Switch = ({
|
|
|
2432
2788
|
placement = "end",
|
|
2433
2789
|
propsComponent
|
|
2434
2790
|
}) => {
|
|
2435
|
-
const [internal, setInternal] =
|
|
2791
|
+
const [internal, setInternal] = React24.useState(defaultChecked || false);
|
|
2436
2792
|
const classname = switchVariants({ colors: color, size, disabled: !!disabled, checked: checked ?? internal, placement });
|
|
2437
2793
|
const isControlled = checked !== void 0;
|
|
2438
2794
|
const value = isControlled ? checked : internal;
|
|
@@ -2440,13 +2796,13 @@ var Switch = ({
|
|
|
2440
2796
|
if (!isControlled) setInternal(e.target.checked);
|
|
2441
2797
|
onChange?.(e, e.target.checked);
|
|
2442
2798
|
};
|
|
2443
|
-
return /* @__PURE__ */
|
|
2799
|
+
return /* @__PURE__ */ jsxs17(
|
|
2444
2800
|
"label",
|
|
2445
2801
|
{
|
|
2446
2802
|
className: classname,
|
|
2447
2803
|
"data-testid": "yr3Switch",
|
|
2448
2804
|
children: [
|
|
2449
|
-
/* @__PURE__ */
|
|
2805
|
+
/* @__PURE__ */ jsx40(
|
|
2450
2806
|
"input",
|
|
2451
2807
|
{
|
|
2452
2808
|
type: "checkbox",
|
|
@@ -2455,8 +2811,8 @@ var Switch = ({
|
|
|
2455
2811
|
disabled
|
|
2456
2812
|
}
|
|
2457
2813
|
),
|
|
2458
|
-
/* @__PURE__ */
|
|
2459
|
-
/* @__PURE__ */
|
|
2814
|
+
/* @__PURE__ */ jsx40("span", { className: "yr3Switch--track", children: /* @__PURE__ */ jsx40("span", { className: "yr3Switch--thumb" }) }),
|
|
2815
|
+
/* @__PURE__ */ jsx40(
|
|
2460
2816
|
"span",
|
|
2461
2817
|
{
|
|
2462
2818
|
className: "yr3Switch--label",
|
|
@@ -2471,9 +2827,9 @@ var Switch = ({
|
|
|
2471
2827
|
};
|
|
2472
2828
|
|
|
2473
2829
|
// src/Icons/IconSearch.tsx
|
|
2474
|
-
import { jsx as
|
|
2830
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
2475
2831
|
var IconSearch = (props) => {
|
|
2476
|
-
return /* @__PURE__ */
|
|
2832
|
+
return /* @__PURE__ */ jsx41("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__ */ jsx41(
|
|
2477
2833
|
"path",
|
|
2478
2834
|
{
|
|
2479
2835
|
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",
|
|
@@ -2485,103 +2841,6 @@ var IconSearch = (props) => {
|
|
|
2485
2841
|
) });
|
|
2486
2842
|
};
|
|
2487
2843
|
|
|
2488
|
-
// src/theme/ThemeProvider.tsx
|
|
2489
|
-
import * as React22 from "react";
|
|
2490
|
-
|
|
2491
|
-
// src/theme/notistackContext.tsx
|
|
2492
|
-
import * as React21 from "react";
|
|
2493
|
-
import { jsx as jsx39, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2494
|
-
var NotistackContext = React21.createContext(null);
|
|
2495
|
-
var NotistackProvider = ({ children }) => {
|
|
2496
|
-
const [snacks, setSnacks] = React21.useState([]);
|
|
2497
|
-
const notistack = (snack) => {
|
|
2498
|
-
const id = Date.now();
|
|
2499
|
-
setSnacks((prev) => [...prev, { ...snack, id, exiting: false }]);
|
|
2500
|
-
const duration = snack.duration || 3e3;
|
|
2501
|
-
const exitDuration = 300;
|
|
2502
|
-
setTimeout(() => {
|
|
2503
|
-
setSnacks(
|
|
2504
|
-
(prev) => prev.map((s) => s.id === id ? { ...s, exiting: true } : s)
|
|
2505
|
-
);
|
|
2506
|
-
}, duration);
|
|
2507
|
-
setTimeout(() => {
|
|
2508
|
-
setSnacks((prev) => prev.filter((s) => s.id !== id));
|
|
2509
|
-
}, duration + exitDuration);
|
|
2510
|
-
};
|
|
2511
|
-
return /* @__PURE__ */ jsxs16(NotistackContext.Provider, { value: { notistack }, children: [
|
|
2512
|
-
children,
|
|
2513
|
-
/* @__PURE__ */ jsx39("div", { className: "yr3NotistackContainer", children: snacks.map((snack) => /* @__PURE__ */ jsx39(Notistack, { ...snack }, snack.id)) })
|
|
2514
|
-
] });
|
|
2515
|
-
};
|
|
2516
|
-
var useNotistack = () => {
|
|
2517
|
-
const ctx = React21.useContext(NotistackContext);
|
|
2518
|
-
if (!ctx) {
|
|
2519
|
-
throw new Error("NotistackProvider missing");
|
|
2520
|
-
}
|
|
2521
|
-
return ctx;
|
|
2522
|
-
};
|
|
2523
|
-
|
|
2524
|
-
// src/theme/ThemeProvider.tsx
|
|
2525
|
-
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
2526
|
-
var ThemeContext = React22.createContext(null);
|
|
2527
|
-
var ThemeProvider = ({ theme, children }) => {
|
|
2528
|
-
React22.useEffect(() => {
|
|
2529
|
-
applyTheme(theme);
|
|
2530
|
-
}, [theme]);
|
|
2531
|
-
return /* @__PURE__ */ jsx40(ThemeContext.Provider, { value: theme, children: /* @__PURE__ */ jsx40(BackdropProvider, { children: /* @__PURE__ */ jsx40(NotistackProvider, { children }) }) });
|
|
2532
|
-
};
|
|
2533
|
-
var useTheme = () => React22.useContext(ThemeContext);
|
|
2534
|
-
|
|
2535
|
-
// src/theme/tokens.ts
|
|
2536
|
-
var baseTokens = {
|
|
2537
|
-
colors: {
|
|
2538
|
-
primary: "#6C5CE7",
|
|
2539
|
-
secondary: "#00CEC9",
|
|
2540
|
-
background: "#0f0f1a",
|
|
2541
|
-
surface: "#1a1a2e",
|
|
2542
|
-
textPrimary: "#ffffff",
|
|
2543
|
-
textSecondary: "#b2bec3"
|
|
2544
|
-
},
|
|
2545
|
-
spacing: (factor) => `${factor * 8}px`,
|
|
2546
|
-
radius: {
|
|
2547
|
-
sm: "6px",
|
|
2548
|
-
md: "12px",
|
|
2549
|
-
lg: "20px"
|
|
2550
|
-
}
|
|
2551
|
-
};
|
|
2552
|
-
|
|
2553
|
-
// src/theme/useMediaQuery.tsx
|
|
2554
|
-
import * as React23 from "react";
|
|
2555
|
-
function useMediaQuery(query) {
|
|
2556
|
-
const theme = useTheme();
|
|
2557
|
-
const computedQuery = typeof query === "function" ? query(theme) : query;
|
|
2558
|
-
const [matches, setMatches] = React23.useState(() => {
|
|
2559
|
-
if (typeof window === "undefined") return false;
|
|
2560
|
-
return window.matchMedia(computedQuery).matches;
|
|
2561
|
-
});
|
|
2562
|
-
React23.useEffect(() => {
|
|
2563
|
-
if (typeof window === "undefined") return;
|
|
2564
|
-
const media = window.matchMedia(computedQuery);
|
|
2565
|
-
const listener = () => setMatches(media.matches);
|
|
2566
|
-
media.addEventListener("change", listener);
|
|
2567
|
-
return () => media.removeEventListener("change", listener);
|
|
2568
|
-
}, [computedQuery]);
|
|
2569
|
-
return matches;
|
|
2570
|
-
}
|
|
2571
|
-
function useBreakpointValue(values) {
|
|
2572
|
-
const xs = useMediaQuery(`(min-width: ${breakpoints.xs}px)`);
|
|
2573
|
-
const sm = useMediaQuery(`(min-width: ${breakpoints.sm}px)`);
|
|
2574
|
-
const md = useMediaQuery(`(min-width: ${breakpoints.md}px)`);
|
|
2575
|
-
const lg = useMediaQuery(`(min-width: ${breakpoints.lg}px)`);
|
|
2576
|
-
const xl = useMediaQuery(`(min-width: ${breakpoints.xl}px)`);
|
|
2577
|
-
if (xl && values.xl !== void 0) return values.xl;
|
|
2578
|
-
if (lg && values.lg !== void 0) return values.lg;
|
|
2579
|
-
if (md && values.md !== void 0) return values.md;
|
|
2580
|
-
if (sm && values.sm !== void 0) return values.sm;
|
|
2581
|
-
if (xs && values.xs !== void 0) return values.xs;
|
|
2582
|
-
return void 0;
|
|
2583
|
-
}
|
|
2584
|
-
|
|
2585
2844
|
// src/hooks/usePlaces.ts
|
|
2586
2845
|
import { useAutocompletePlaces as useAutocompletePlaces2 } from "@yr3/autocomplete-places";
|
|
2587
2846
|
var usePlaces = ({ input, language, apiKey, provider }) => {
|
|
@@ -2593,7 +2852,7 @@ var usePlaces = ({ input, language, apiKey, provider }) => {
|
|
|
2593
2852
|
};
|
|
2594
2853
|
|
|
2595
2854
|
// src/hooks/useBreakpoint.ts
|
|
2596
|
-
import * as
|
|
2855
|
+
import * as React25 from "react";
|
|
2597
2856
|
var breakUp = (bp) => `(min-width: ${bp}px)`;
|
|
2598
2857
|
var breakDown = (bp) => `(max-width: ${bp}px)`;
|
|
2599
2858
|
function useBreakpoint(queryInput) {
|
|
@@ -2603,8 +2862,8 @@ function useBreakpoint(queryInput) {
|
|
|
2603
2862
|
if (typeof window === "undefined") return false;
|
|
2604
2863
|
return window.matchMedia(query).matches;
|
|
2605
2864
|
};
|
|
2606
|
-
const [matches, setMatches] =
|
|
2607
|
-
|
|
2865
|
+
const [matches, setMatches] = React25.useState(getMatch);
|
|
2866
|
+
React25.useEffect(() => {
|
|
2608
2867
|
if (typeof window === "undefined") return;
|
|
2609
2868
|
const media = window.matchMedia(query);
|
|
2610
2869
|
const listener = (e) => {
|
|
@@ -2657,6 +2916,7 @@ export {
|
|
|
2657
2916
|
Input,
|
|
2658
2917
|
InputArea,
|
|
2659
2918
|
Label,
|
|
2919
|
+
Loader,
|
|
2660
2920
|
Modal,
|
|
2661
2921
|
ModalContainer,
|
|
2662
2922
|
Notistack,
|
|
@@ -2673,6 +2933,7 @@ export {
|
|
|
2673
2933
|
ThemeContext,
|
|
2674
2934
|
ThemeProvider,
|
|
2675
2935
|
adjustColor,
|
|
2936
|
+
alpha,
|
|
2676
2937
|
applyTheme,
|
|
2677
2938
|
baseTokens,
|
|
2678
2939
|
bem,
|
|
@@ -2685,14 +2946,19 @@ export {
|
|
|
2685
2946
|
createTheme,
|
|
2686
2947
|
createVariants,
|
|
2687
2948
|
cx,
|
|
2949
|
+
darken,
|
|
2688
2950
|
getContrast,
|
|
2689
2951
|
getCountryCodePhone,
|
|
2690
2952
|
getDialPhone,
|
|
2691
2953
|
getMonthCalendar,
|
|
2692
2954
|
getNumberPhone,
|
|
2955
|
+
hexToRgb,
|
|
2693
2956
|
initTheme,
|
|
2694
2957
|
isEmpty,
|
|
2958
|
+
lighten,
|
|
2959
|
+
mergeDeep,
|
|
2695
2960
|
normalizePhone,
|
|
2961
|
+
rgbToHex,
|
|
2696
2962
|
text,
|
|
2697
2963
|
times,
|
|
2698
2964
|
uiStyle,
|