@yr3/ui 1.0.2 → 1.0.3
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/Calendar/calendar.css +100 -0
- package/dist/components/Calendar/calendar.css.map +1 -1
- package/dist/components/Grid/Grid.css +0 -3
- package/dist/components/Grid/Grid.css.map +1 -1
- package/dist/{index.mjs → index.cjs} +444 -296
- package/dist/{index.d.mts → index.d.cts} +81 -72
- package/dist/index.d.ts +81 -72
- package/dist/index.js +345 -395
- package/dist/styles/index.css +102 -3
- package/dist/styles/index.css.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,101 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/index.ts
|
|
31
|
-
var index_exports = {};
|
|
32
|
-
__export(index_exports, {
|
|
33
|
-
Avatar: () => Avatar,
|
|
34
|
-
Backdrop: () => Backdrop,
|
|
35
|
-
BackdropContext: () => BackdropContext,
|
|
36
|
-
BackdropProvider: () => BackdropProvider,
|
|
37
|
-
Box: () => Box,
|
|
38
|
-
Button: () => Button,
|
|
39
|
-
Calendar: () => Calendar,
|
|
40
|
-
Checkbox: () => Checkbox,
|
|
41
|
-
Chip: () => Chip,
|
|
42
|
-
Collapse: () => Collapse,
|
|
43
|
-
Container: () => Container,
|
|
44
|
-
Control: () => Control,
|
|
45
|
-
ControlContext: () => ControlContext,
|
|
46
|
-
Divider: () => Divider,
|
|
47
|
-
Drawer: () => Drawer,
|
|
48
|
-
Fade: () => Fade,
|
|
49
|
-
Flex: () => Flex,
|
|
50
|
-
Grid: () => Grid,
|
|
51
|
-
Group: () => Group,
|
|
52
|
-
IconClose: () => IconClose,
|
|
53
|
-
IconDown: () => IconDown,
|
|
54
|
-
IconSearch: () => IconSearch,
|
|
55
|
-
Image: () => Image,
|
|
56
|
-
Input: () => Input,
|
|
57
|
-
Label: () => Label,
|
|
58
|
-
Modal: () => Modal,
|
|
59
|
-
ModalContainer: () => ModalContainer,
|
|
60
|
-
Notistack: () => Notistack,
|
|
61
|
-
NotistackProvider: () => NotistackProvider,
|
|
62
|
-
Pending: () => Pending,
|
|
63
|
-
Phone: () => Phone,
|
|
64
|
-
Radio: () => Radio,
|
|
65
|
-
Select: () => Select,
|
|
66
|
-
Slide: () => Slide,
|
|
67
|
-
Switch: () => Switch,
|
|
68
|
-
Text: () => Text,
|
|
69
|
-
ThemeContext: () => ThemeContext,
|
|
70
|
-
ThemeProvider: () => ThemeProvider,
|
|
71
|
-
adjustColor: () => adjustColor,
|
|
72
|
-
applyTheme: () => applyTheme,
|
|
73
|
-
baseTokens: () => baseTokens,
|
|
74
|
-
bem: () => bem,
|
|
75
|
-
bemMerge: () => bemMerge,
|
|
76
|
-
breakpoints: () => breakpoints,
|
|
77
|
-
composeStyles: () => composeStyles,
|
|
78
|
-
createPaletteColor: () => createPaletteColor,
|
|
79
|
-
createTheme: () => createTheme,
|
|
80
|
-
createVariants: () => createVariants,
|
|
81
|
-
cx: () => cx,
|
|
82
|
-
getContrast: () => getContrast,
|
|
83
|
-
getMonthCalendar: () => getMonthCalendar,
|
|
84
|
-
initTheme: () => initTheme,
|
|
85
|
-
isEmpty: () => isEmpty,
|
|
86
|
-
text: () => text,
|
|
87
|
-
times: () => times,
|
|
88
|
-
uiStyle: () => uiStyle,
|
|
89
|
-
useBackdrop: () => useBackdrop,
|
|
90
|
-
useBreakpointValue: () => useBreakpointValue,
|
|
91
|
-
useClickAway: () => useClickAway,
|
|
92
|
-
useControl: () => useControl,
|
|
93
|
-
useMediaQuery: () => useMediaQuery,
|
|
94
|
-
useNotistack: () => useNotistack,
|
|
95
|
-
useTheme: () => useTheme
|
|
96
|
-
});
|
|
97
|
-
module.exports = __toCommonJS(index_exports);
|
|
98
|
-
|
|
99
1
|
// src/utils/bem.ts
|
|
100
2
|
var bem = (block) => {
|
|
101
3
|
return (element, modifiers) => {
|
|
@@ -126,11 +28,11 @@ var bemMerge = (...args) => {
|
|
|
126
28
|
};
|
|
127
29
|
|
|
128
30
|
// src/utils/calendar.ts
|
|
129
|
-
|
|
31
|
+
import dayjs from "dayjs";
|
|
130
32
|
function getMonthCalendar(year, month, startIndex, selected, props) {
|
|
131
|
-
const today = (
|
|
132
|
-
const startOfMonth = (
|
|
133
|
-
const endOfMonth = (
|
|
33
|
+
const today = dayjs().startOf("day");
|
|
34
|
+
const startOfMonth = dayjs().year(year).month(month).startOf("month");
|
|
35
|
+
const endOfMonth = dayjs().year(year).month(month).endOf("month");
|
|
134
36
|
let dayCurrent = {};
|
|
135
37
|
let startDay = startOfMonth.day();
|
|
136
38
|
startDay = startDay === 0 ? 6 : startDay - 1;
|
|
@@ -512,7 +414,7 @@ function initTheme() {
|
|
|
512
414
|
}
|
|
513
415
|
|
|
514
416
|
// src/components/Avatar/Avatar.tsx
|
|
515
|
-
|
|
417
|
+
import * as React from "react";
|
|
516
418
|
|
|
517
419
|
// src/components/Avatar/avatar.variants.ts
|
|
518
420
|
var avatarVariants = createVariants({
|
|
@@ -555,7 +457,7 @@ var avatarVariants = createVariants({
|
|
|
555
457
|
var avatar_variants_default = avatarVariants;
|
|
556
458
|
|
|
557
459
|
// src/components/Avatar/Avatar.tsx
|
|
558
|
-
|
|
460
|
+
import { jsx } from "react/jsx-runtime";
|
|
559
461
|
var Avatar = ({
|
|
560
462
|
src,
|
|
561
463
|
alt,
|
|
@@ -574,30 +476,30 @@ var Avatar = ({
|
|
|
574
476
|
const [error, setError] = React.useState(false);
|
|
575
477
|
const showFallback = !src || error;
|
|
576
478
|
const className = avatar_variants_default({ size, variant, color, bordered, shadow, floating });
|
|
577
|
-
return /* @__PURE__ */
|
|
479
|
+
return /* @__PURE__ */ jsx("div", { className, style: uiStyle(ui), "data-testid": "yr3Avatar", role, onClick, children: !showFallback ? /* @__PURE__ */ jsx(
|
|
578
480
|
"img",
|
|
579
481
|
{
|
|
580
482
|
src,
|
|
581
483
|
alt,
|
|
582
484
|
onError: () => setError(true)
|
|
583
485
|
}
|
|
584
|
-
) : /* @__PURE__ */
|
|
486
|
+
) : /* @__PURE__ */ jsx("span", { className: "yr3Avatar--fallback", "data-testid": "yr3Avatar-fallback", children: children || label }) });
|
|
585
487
|
};
|
|
586
488
|
|
|
587
489
|
// src/components/Backdrop/Backdrop.tsx
|
|
588
|
-
|
|
490
|
+
import { createPortal } from "react-dom";
|
|
589
491
|
|
|
590
492
|
// src/theme/backdropContext.tsx
|
|
591
|
-
|
|
592
|
-
|
|
493
|
+
import * as React2 from "react";
|
|
494
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
593
495
|
var BackdropContext = React2.createContext(null);
|
|
594
496
|
var BackdropProvider = ({ children }) => {
|
|
595
497
|
const [open, setOpen] = React2.useState(false);
|
|
596
498
|
const show = () => setOpen(true);
|
|
597
499
|
const hide = () => setOpen(false);
|
|
598
|
-
return /* @__PURE__ */
|
|
500
|
+
return /* @__PURE__ */ jsxs(BackdropContext.Provider, { value: { open, show, hide }, children: [
|
|
599
501
|
children,
|
|
600
|
-
/* @__PURE__ */ (
|
|
502
|
+
/* @__PURE__ */ jsx2(Backdrop, {})
|
|
601
503
|
] });
|
|
602
504
|
};
|
|
603
505
|
var useBackdrop = () => {
|
|
@@ -607,11 +509,11 @@ var useBackdrop = () => {
|
|
|
607
509
|
};
|
|
608
510
|
|
|
609
511
|
// src/components/Backdrop/Backdrop.tsx
|
|
610
|
-
|
|
512
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
611
513
|
var Backdrop = () => {
|
|
612
514
|
const { open } = useBackdrop();
|
|
613
|
-
return
|
|
614
|
-
/* @__PURE__ */ (
|
|
515
|
+
return createPortal(
|
|
516
|
+
/* @__PURE__ */ jsx3("div", { className: `yr3Backdrop ${open ? "yr3Backdrop--open" : ""}`, "data-testid": "yr3Backdrop" }),
|
|
615
517
|
document.body
|
|
616
518
|
);
|
|
617
519
|
};
|
|
@@ -638,7 +540,7 @@ var boxVariants = createVariants({
|
|
|
638
540
|
});
|
|
639
541
|
|
|
640
542
|
// src/components/Box/Box.tsx
|
|
641
|
-
|
|
543
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
642
544
|
var Box = ({
|
|
643
545
|
content = "start",
|
|
644
546
|
children,
|
|
@@ -650,7 +552,7 @@ var Box = ({
|
|
|
650
552
|
...props
|
|
651
553
|
}) => {
|
|
652
554
|
const classes = boxVariants({ content, drawer, position });
|
|
653
|
-
return /* @__PURE__ */ (
|
|
555
|
+
return /* @__PURE__ */ jsx4(
|
|
654
556
|
Component,
|
|
655
557
|
{
|
|
656
558
|
className: classes,
|
|
@@ -663,7 +565,7 @@ var Box = ({
|
|
|
663
565
|
};
|
|
664
566
|
|
|
665
567
|
// src/components/Text/Text.tsx
|
|
666
|
-
|
|
568
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
667
569
|
var Text = ({
|
|
668
570
|
children,
|
|
669
571
|
variant = "inherit",
|
|
@@ -676,7 +578,7 @@ var Text = ({
|
|
|
676
578
|
onClick
|
|
677
579
|
}) => {
|
|
678
580
|
const styleUI = uiStyle({ ...ui, marginTop: gutters[0] || 0, marginBottom: gutters[1] || 0 });
|
|
679
|
-
return /* @__PURE__ */ (
|
|
581
|
+
return /* @__PURE__ */ jsx5(
|
|
680
582
|
Component,
|
|
681
583
|
{
|
|
682
584
|
className: `
|
|
@@ -727,10 +629,10 @@ var buttonVariant = createVariants({
|
|
|
727
629
|
});
|
|
728
630
|
|
|
729
631
|
// src/components/Button/Button.tsx
|
|
730
|
-
|
|
632
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
731
633
|
var Button = ({ children, color = "text", variant = "text", animated, disabled, gradientBorder = false, size = "auto", ui, style, propsComponent, ...props }) => {
|
|
732
634
|
const buttonClassname = buttonVariant({ variant, color, animated, disabled, gradientBorder, size });
|
|
733
|
-
return /* @__PURE__ */ (
|
|
635
|
+
return /* @__PURE__ */ jsx6(
|
|
734
636
|
"button",
|
|
735
637
|
{
|
|
736
638
|
className: buttonClassname,
|
|
@@ -738,143 +640,99 @@ var Button = ({ children, color = "text", variant = "text", animated, disabled,
|
|
|
738
640
|
"data-testid": "yr3Button",
|
|
739
641
|
...props,
|
|
740
642
|
style: composeStyles(ui, style),
|
|
741
|
-
children: /* @__PURE__ */ (
|
|
643
|
+
children: /* @__PURE__ */ jsx6(Text, { variant: propsComponent?.text?.variant || "button", children })
|
|
742
644
|
}
|
|
743
645
|
);
|
|
744
646
|
};
|
|
745
647
|
|
|
746
648
|
// src/components/Calendar/Calendar.tsx
|
|
747
|
-
|
|
748
|
-
|
|
649
|
+
import * as React3 from "react";
|
|
650
|
+
import dayjs2 from "dayjs";
|
|
651
|
+
import weekday from "dayjs/plugin/weekday";
|
|
749
652
|
|
|
750
|
-
// src/components/
|
|
751
|
-
var
|
|
752
|
-
base: "
|
|
653
|
+
// src/components/Calendar/calendar.variants.ts
|
|
654
|
+
var calendarVariants = createVariants({
|
|
655
|
+
base: "yr3Calendar",
|
|
753
656
|
variants: {
|
|
754
657
|
variant: {
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
wrap: "yr3Flex--wrap"
|
|
658
|
+
default: "yr3Calendar--default",
|
|
659
|
+
compact: "yr3Calendar--compact"
|
|
758
660
|
},
|
|
759
|
-
|
|
760
|
-
|
|
661
|
+
size: {
|
|
662
|
+
sm: "yr3Calendar--size-sm",
|
|
663
|
+
md: "yr3Calendar--size-md",
|
|
664
|
+
lg: "yr3Calendar--size-lg"
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
});
|
|
668
|
+
var calendarDayVariants = createVariants({
|
|
669
|
+
base: "yr3Calendar-day",
|
|
670
|
+
variants: {
|
|
671
|
+
isFuture: {
|
|
672
|
+
true: "yr3Calendar-day--future"
|
|
761
673
|
},
|
|
762
|
-
|
|
763
|
-
true: "
|
|
674
|
+
isPast: {
|
|
675
|
+
true: "yr3Calendar-day--past"
|
|
764
676
|
},
|
|
765
|
-
|
|
766
|
-
true: "
|
|
677
|
+
isToday: {
|
|
678
|
+
true: "yr3Calendar-day--today"
|
|
679
|
+
},
|
|
680
|
+
isSelected: {
|
|
681
|
+
true: "yr3Calendar-day--selected"
|
|
767
682
|
},
|
|
768
683
|
bordered: {
|
|
769
|
-
true: "
|
|
684
|
+
true: "yr3Calendar-day--bordered"
|
|
685
|
+
},
|
|
686
|
+
color: {
|
|
687
|
+
primary: "yr3Calendar-day--color-primary",
|
|
688
|
+
secondary: "yr3Calendar-day--color-secondary",
|
|
689
|
+
success: "yr3Calendar-day--color-success",
|
|
690
|
+
text: "yr3Calendar-day--color-text",
|
|
691
|
+
disabled: "yr3Calendar-day--color-disabled",
|
|
692
|
+
info: "yr3Calendar-day--color-info",
|
|
693
|
+
warning: "yr3Calendar-day--color-warning",
|
|
694
|
+
error: "yr3Calendar-day--color-error"
|
|
770
695
|
}
|
|
771
696
|
}
|
|
772
697
|
});
|
|
773
|
-
var flex_variants_default = flexVariants;
|
|
774
|
-
|
|
775
|
-
// src/components/Flex/Flex.tsx
|
|
776
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
777
|
-
var Flex = ({
|
|
778
|
-
container = false,
|
|
779
|
-
spacing: spacing2 = 1,
|
|
780
|
-
children,
|
|
781
|
-
ui,
|
|
782
|
-
gap,
|
|
783
|
-
variant = "column",
|
|
784
|
-
center = false,
|
|
785
|
-
between = false,
|
|
786
|
-
style,
|
|
787
|
-
bordered = false,
|
|
788
|
-
...props
|
|
789
|
-
}) => {
|
|
790
|
-
const classes = flex_variants_default({ variant, container, center, between, bordered, spacing: spacing2 });
|
|
791
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
792
|
-
"div",
|
|
793
|
-
{
|
|
794
|
-
className: classes,
|
|
795
|
-
style: composeStyles(ui, style),
|
|
796
|
-
...props,
|
|
797
|
-
"data-testid": "yr3Flex",
|
|
798
|
-
children
|
|
799
|
-
}
|
|
800
|
-
);
|
|
801
|
-
};
|
|
802
|
-
|
|
803
|
-
// src/components/Grid/Grid.tsx
|
|
804
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
805
|
-
var Grid = ({
|
|
806
|
-
container = false,
|
|
807
|
-
spacing: spacing2 = 0,
|
|
808
|
-
children,
|
|
809
|
-
columns = 12,
|
|
810
|
-
span = 1,
|
|
811
|
-
ui,
|
|
812
|
-
style,
|
|
813
|
-
item = false,
|
|
814
|
-
size = 0,
|
|
815
|
-
center = false,
|
|
816
|
-
...props
|
|
817
|
-
}) => {
|
|
818
|
-
if (item) {
|
|
819
|
-
columns = 0;
|
|
820
|
-
}
|
|
821
|
-
if (container) {
|
|
822
|
-
columns = 0;
|
|
823
|
-
ui = {
|
|
824
|
-
...ui,
|
|
825
|
-
gridTemplateColumns: `repeat(${columns}, 1fr)`
|
|
826
|
-
};
|
|
827
|
-
}
|
|
828
|
-
if (center) {
|
|
829
|
-
ui = {
|
|
830
|
-
...ui,
|
|
831
|
-
justifyContent: "center",
|
|
832
|
-
alignItems: "center"
|
|
833
|
-
};
|
|
834
|
-
}
|
|
835
|
-
const classes = bem("yr3Grid");
|
|
836
|
-
const className = classes(void 0, { container, [`spacing-${spacing2}`]: center, span: item && `Col-${size}` });
|
|
837
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
838
|
-
"div",
|
|
839
|
-
{
|
|
840
|
-
className,
|
|
841
|
-
style: composeStyles(ui, style),
|
|
842
|
-
"data-testid": "yr3Grid",
|
|
843
|
-
...props,
|
|
844
|
-
children
|
|
845
|
-
}
|
|
846
|
-
);
|
|
847
|
-
};
|
|
848
698
|
|
|
849
699
|
// src/components/Calendar/Calendar.tsx
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
import_dayjs2.default.extend(import_weekday.default);
|
|
700
|
+
import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
701
|
+
dayjs2.extend(weekday);
|
|
853
702
|
var initalPropsComponent = {
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
}
|
|
703
|
+
displayButtons: true,
|
|
704
|
+
displayCalendar: true,
|
|
705
|
+
header: {
|
|
706
|
+
color: "primary",
|
|
707
|
+
ui: {},
|
|
708
|
+
style: {}
|
|
709
|
+
},
|
|
710
|
+
month: {
|
|
711
|
+
color: "primary",
|
|
712
|
+
ui: {},
|
|
713
|
+
style: {}
|
|
714
|
+
},
|
|
715
|
+
day: {
|
|
716
|
+
color: "primary",
|
|
717
|
+
bordered: true,
|
|
718
|
+
ui: {},
|
|
719
|
+
style: {}
|
|
720
|
+
},
|
|
721
|
+
buttonNext: {
|
|
722
|
+
disabled: false,
|
|
723
|
+
label: "next"
|
|
724
|
+
},
|
|
725
|
+
buttonBack: {
|
|
726
|
+
disabled: false,
|
|
727
|
+
label: "back"
|
|
870
728
|
}
|
|
871
729
|
};
|
|
872
730
|
var Calendar = ({ onSelect, propsComponent = initalPropsComponent, mapCalendar, onMonthChange }) => {
|
|
873
|
-
const month = (
|
|
731
|
+
const month = dayjs2().month();
|
|
874
732
|
const [currentMonth, setCurrentMonth] = React3.useState(month);
|
|
875
733
|
const [selected, setSelected] = React3.useState(null);
|
|
876
734
|
const program = React3.useMemo(() => {
|
|
877
|
-
return getMonthCalendar((
|
|
735
|
+
return getMonthCalendar(dayjs2().year(), currentMonth, 0, selected, mapCalendar);
|
|
878
736
|
}, [selected, currentMonth, mapCalendar]);
|
|
879
737
|
React3.useEffect(() => {
|
|
880
738
|
if (selected) {
|
|
@@ -888,37 +746,36 @@ var Calendar = ({ onSelect, propsComponent = initalPropsComponent, mapCalendar,
|
|
|
888
746
|
onMonthChange && onMonthChange(currentMonth);
|
|
889
747
|
}
|
|
890
748
|
}, [currentMonth]);
|
|
891
|
-
return /* @__PURE__ */ (
|
|
892
|
-
propsComponent
|
|
893
|
-
/* @__PURE__ */ (
|
|
894
|
-
/* @__PURE__ */ (
|
|
895
|
-
/* @__PURE__ */ (
|
|
749
|
+
return /* @__PURE__ */ jsxs2("div", { className: "yr3Calendar", "data-testid": "yr3Calendar", children: [
|
|
750
|
+
propsComponent?.displayButtons && /* @__PURE__ */ jsxs2("div", { className: "yr3Calendar--header", "data-testid": "yr3CalendarHeader", style: composeStyles(propsComponent?.header?.ui, propsComponent?.header?.style), children: [
|
|
751
|
+
/* @__PURE__ */ jsx7(Button, { disabled: propsComponent?.buttonBack?.disabled || false, color: propsComponent.header?.color || "primary", onClick: () => setCurrentMonth(currentMonth - 1), ui: { justifyContent: "flex-start" }, children: propsComponent?.buttonBack?.label }),
|
|
752
|
+
/* @__PURE__ */ jsx7(Text, { variant: "h6", color: propsComponent.header?.color || "primary", ui: { textTransform: "uppercase", textAlign: "center" }, children: program?.monthLabel }),
|
|
753
|
+
/* @__PURE__ */ jsx7(Button, { disabled: propsComponent?.buttonNext?.disabled, color: propsComponent?.header?.color || "primary", onClick: () => setCurrentMonth(currentMonth + 1), ui: { justifyContent: "flex-end" }, children: propsComponent?.buttonNext?.label })
|
|
896
754
|
] }),
|
|
897
|
-
propsComponent
|
|
898
|
-
program?.daysContainer.map((i) => /* @__PURE__ */ (
|
|
899
|
-
|
|
900
|
-
Flex,
|
|
755
|
+
propsComponent?.displayCalendar && /* @__PURE__ */ jsxs2("div", { className: "yr3Calendar--container", children: [
|
|
756
|
+
program?.daysContainer.map((i) => /* @__PURE__ */ jsx7("div", { className: "yr3Calendar--month", style: composeStyles(propsComponent?.month?.ui, propsComponent?.month?.style), children: /* @__PURE__ */ jsx7(
|
|
757
|
+
Text,
|
|
901
758
|
{
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
759
|
+
variant: "caption",
|
|
760
|
+
color: propsComponent?.month?.color || "primary",
|
|
761
|
+
ui: { ...propsComponent?.month?.ui, opacity: 0.7, textTransform: "uppercase" },
|
|
762
|
+
children: dayjs2().day(i + 1).format("dd")
|
|
763
|
+
}
|
|
764
|
+
) }, `month_day_${i}`)),
|
|
765
|
+
times(program.calendar.length, (i) => /* @__PURE__ */ jsx7(React3.Fragment, { children: times(program.calendar[i].length, (j) => /* @__PURE__ */ jsx7(
|
|
766
|
+
"div",
|
|
767
|
+
{
|
|
768
|
+
className: calendarDayVariants({
|
|
769
|
+
isToday: program.calendar[i][j]?.isToday,
|
|
770
|
+
isSelected: program.calendar[i][j]?.selected,
|
|
771
|
+
isPast: program.calendar[i][j]?.isPast,
|
|
772
|
+
isFuture: program.calendar[i][j]?.isFuture,
|
|
773
|
+
isCurrentMonth: program.calendar[i][j]?.isCurrentMonth,
|
|
774
|
+
ui: propsComponent?.day?.ui,
|
|
775
|
+
bordered: !!program.calendar[i][j] && propsComponent?.day?.bordered,
|
|
776
|
+
color: propsComponent?.day?.color || "primary"
|
|
777
|
+
}),
|
|
778
|
+
style: composeStyles(propsComponent?.day?.ui, propsComponent?.day?.style),
|
|
922
779
|
"data-testid": "yr3CalendarDay",
|
|
923
780
|
onClick: () => {
|
|
924
781
|
if (selected === program.calendar[i][j]) {
|
|
@@ -927,7 +784,7 @@ var Calendar = ({ onSelect, propsComponent = initalPropsComponent, mapCalendar,
|
|
|
927
784
|
setSelected(program.calendar[i][j]);
|
|
928
785
|
}
|
|
929
786
|
},
|
|
930
|
-
children: /* @__PURE__ */ (
|
|
787
|
+
children: /* @__PURE__ */ jsx7(
|
|
931
788
|
Text,
|
|
932
789
|
{
|
|
933
790
|
variant: "body2",
|
|
@@ -936,15 +793,15 @@ var Calendar = ({ onSelect, propsComponent = initalPropsComponent, mapCalendar,
|
|
|
936
793
|
}
|
|
937
794
|
)
|
|
938
795
|
},
|
|
939
|
-
j
|
|
796
|
+
`day-${i}-${j}`
|
|
940
797
|
)) }, i))
|
|
941
798
|
] })
|
|
942
799
|
] });
|
|
943
800
|
};
|
|
944
801
|
|
|
945
802
|
// src/components/Checkbox/Checkbox.tsx
|
|
946
|
-
|
|
947
|
-
|
|
803
|
+
import * as React4 from "react";
|
|
804
|
+
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
948
805
|
var Checkbox = ({
|
|
949
806
|
checked,
|
|
950
807
|
defaultChecked,
|
|
@@ -966,8 +823,8 @@ var Checkbox = ({
|
|
|
966
823
|
const classes = bemClasse(void 0, { color: `color-${color}`, disabled, variant: `variant-${variant}` });
|
|
967
824
|
const boxClasses = bem("yr3Checkbox-box");
|
|
968
825
|
const classesBox = boxClasses(void 0, { checked: !!value });
|
|
969
|
-
return /* @__PURE__ */ (
|
|
970
|
-
/* @__PURE__ */ (
|
|
826
|
+
return /* @__PURE__ */ jsxs3("label", { className: classes, style: uiStyle(propsComponent?.checkbox?.ui), "data-testid": "yr3Checkbox", children: [
|
|
827
|
+
/* @__PURE__ */ jsx8(
|
|
971
828
|
"input",
|
|
972
829
|
{
|
|
973
830
|
type: "checkbox",
|
|
@@ -977,8 +834,8 @@ var Checkbox = ({
|
|
|
977
834
|
"data-testid": "yr3Checkbox-input"
|
|
978
835
|
}
|
|
979
836
|
),
|
|
980
|
-
/* @__PURE__ */ (
|
|
981
|
-
label && /* @__PURE__ */ (
|
|
837
|
+
/* @__PURE__ */ jsx8("span", { className: classesBox, "data-testid": "yr3Checkbox-box" }),
|
|
838
|
+
label && /* @__PURE__ */ jsx8(Text, { variant: "caption", color: !value ? propsComponent?.content?.color : color, ...propsComponent?.content, children: label })
|
|
982
839
|
] });
|
|
983
840
|
};
|
|
984
841
|
|
|
@@ -1012,9 +869,9 @@ var chipVariants = createVariants({
|
|
|
1012
869
|
var chip_variants_default = chipVariants;
|
|
1013
870
|
|
|
1014
871
|
// src/Icons/IconClose.tsx
|
|
1015
|
-
|
|
872
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1016
873
|
var IconClose = (props) => {
|
|
1017
|
-
return /* @__PURE__ */ (
|
|
874
|
+
return /* @__PURE__ */ jsx9("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__ */ jsx9(
|
|
1018
875
|
"path",
|
|
1019
876
|
{
|
|
1020
877
|
d: "M16 16L12 12M12 12L8 8M12 12L16 8M12 12L8 16",
|
|
@@ -1027,10 +884,10 @@ var IconClose = (props) => {
|
|
|
1027
884
|
};
|
|
1028
885
|
|
|
1029
886
|
// src/components/Chip/Chip.tsx
|
|
1030
|
-
|
|
887
|
+
import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1031
888
|
var Chip = ({ label, variant, color, icon, onDelete, rounded, size = "medium", ui, style, ...props }) => {
|
|
1032
889
|
const className = chip_variants_default({ variant, colors: color, rounded, size });
|
|
1033
|
-
return /* @__PURE__ */ (
|
|
890
|
+
return /* @__PURE__ */ jsxs4(
|
|
1034
891
|
"div",
|
|
1035
892
|
{
|
|
1036
893
|
className,
|
|
@@ -1042,16 +899,16 @@ var Chip = ({ label, variant, color, icon, onDelete, rounded, size = "medium", u
|
|
|
1042
899
|
},
|
|
1043
900
|
children: [
|
|
1044
901
|
icon,
|
|
1045
|
-
/* @__PURE__ */ (
|
|
1046
|
-
onDelete && /* @__PURE__ */ (
|
|
902
|
+
/* @__PURE__ */ jsx10("span", { className: "yr3Chip__label", children: label }),
|
|
903
|
+
onDelete && /* @__PURE__ */ jsx10("span", { className: "yr3Chip__delete", onClick: onDelete, role: "button", "aria-label": "delete", children: /* @__PURE__ */ jsx10(IconClose, { width: 20, height: 20, stroke: color }) })
|
|
1047
904
|
]
|
|
1048
905
|
}
|
|
1049
906
|
);
|
|
1050
907
|
};
|
|
1051
908
|
|
|
1052
909
|
// src/components/Collapse/Collapse.tsx
|
|
1053
|
-
|
|
1054
|
-
|
|
910
|
+
import * as React5 from "react";
|
|
911
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1055
912
|
var Collapse = ({ children, open, anchor }) => {
|
|
1056
913
|
const ref = React5.useRef(null);
|
|
1057
914
|
const [height, setHeight] = React5.useState(0);
|
|
@@ -1064,11 +921,11 @@ var Collapse = ({ children, open, anchor }) => {
|
|
|
1064
921
|
}
|
|
1065
922
|
}
|
|
1066
923
|
}, [open, children]);
|
|
1067
|
-
return /* @__PURE__ */ (
|
|
924
|
+
return /* @__PURE__ */ jsx11("div", { className: `yr3Collapse yr3Collapse--${anchor}`, style: { height }, "data-testid": "yr3Collapse", children: /* @__PURE__ */ jsx11("div", { ref, className: "yr3Collapse__inner", children }) });
|
|
1068
925
|
};
|
|
1069
926
|
|
|
1070
927
|
// src/components/Container/Container.tsx
|
|
1071
|
-
|
|
928
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1072
929
|
var Container = ({
|
|
1073
930
|
children,
|
|
1074
931
|
maxWidth = "sm",
|
|
@@ -1078,7 +935,7 @@ var Container = ({
|
|
|
1078
935
|
}) => {
|
|
1079
936
|
const containerClassName = bem("yr3Container");
|
|
1080
937
|
const classes = containerClassName(void 0, { maxWidth, static: fixed });
|
|
1081
|
-
return /* @__PURE__ */ (
|
|
938
|
+
return /* @__PURE__ */ jsx12(
|
|
1082
939
|
"div",
|
|
1083
940
|
{
|
|
1084
941
|
className: classes,
|
|
@@ -1090,12 +947,12 @@ var Container = ({
|
|
|
1090
947
|
};
|
|
1091
948
|
|
|
1092
949
|
// src/theme/controlContext.tsx
|
|
1093
|
-
|
|
950
|
+
import * as React6 from "react";
|
|
1094
951
|
var ControlContext = React6.createContext(null);
|
|
1095
952
|
var useControl = () => React6.useContext(ControlContext);
|
|
1096
953
|
|
|
1097
954
|
// src/components/Control/Control.tsx
|
|
1098
|
-
|
|
955
|
+
import * as React7 from "react";
|
|
1099
956
|
|
|
1100
957
|
// src/components/Control/control.variants.ts
|
|
1101
958
|
var controlVariants = createVariants({
|
|
@@ -1137,7 +994,7 @@ var controlVariants = createVariants({
|
|
|
1137
994
|
});
|
|
1138
995
|
|
|
1139
996
|
// src/components/Control/Control.tsx
|
|
1140
|
-
|
|
997
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1141
998
|
var Control = ({
|
|
1142
999
|
children,
|
|
1143
1000
|
error = false,
|
|
@@ -1156,7 +1013,7 @@ var Control = ({
|
|
|
1156
1013
|
disabled
|
|
1157
1014
|
};
|
|
1158
1015
|
const classes = controlVariants({ variant, color, label });
|
|
1159
|
-
return /* @__PURE__ */ (
|
|
1016
|
+
return /* @__PURE__ */ jsx13(ControlContext.Provider, { value, children: /* @__PURE__ */ jsx13(
|
|
1160
1017
|
"div",
|
|
1161
1018
|
{
|
|
1162
1019
|
className: classes,
|
|
@@ -1198,7 +1055,7 @@ var dividerVariants = createVariants({
|
|
|
1198
1055
|
var dividerVariants_default = dividerVariants;
|
|
1199
1056
|
|
|
1200
1057
|
// src/components/Divider/Divider.tsx
|
|
1201
|
-
|
|
1058
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1202
1059
|
var Divider = ({
|
|
1203
1060
|
orientation = "horizontal",
|
|
1204
1061
|
text: text2,
|
|
@@ -1208,14 +1065,14 @@ var Divider = ({
|
|
|
1208
1065
|
color = "primary"
|
|
1209
1066
|
}) => {
|
|
1210
1067
|
const classname = dividerVariants_default({ orientation, align, withText: !!text2, color });
|
|
1211
|
-
return /* @__PURE__ */ (
|
|
1068
|
+
return /* @__PURE__ */ jsx14("div", { className: classname, style: composeStyles(ui, style), "data-testid": "yr3Divider", children: text2 && /* @__PURE__ */ jsx14("span", { className: "yr3Divider--text", "data-testid": "yr3Divider-text", children: text2 }) });
|
|
1212
1069
|
};
|
|
1213
1070
|
|
|
1214
1071
|
// src/components/Drawer/Drawer.tsx
|
|
1215
|
-
|
|
1072
|
+
import * as React8 from "react";
|
|
1216
1073
|
|
|
1217
1074
|
// src/components/Drawer/DrawerContainer.tsx
|
|
1218
|
-
|
|
1075
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1219
1076
|
var DrawerContainer = ({ children, ui, style, props, onClose }) => {
|
|
1220
1077
|
const { hide } = useBackdrop();
|
|
1221
1078
|
const handleClose = () => {
|
|
@@ -1225,14 +1082,14 @@ var DrawerContainer = ({ children, ui, style, props, onClose }) => {
|
|
|
1225
1082
|
}
|
|
1226
1083
|
return;
|
|
1227
1084
|
};
|
|
1228
|
-
return /* @__PURE__ */ (
|
|
1085
|
+
return /* @__PURE__ */ jsx15("div", { className: "yr3Drawer--container", style: composeStyles(ui, style), onClick: handleClose, "data-testid": "yr3Drawer-container", children });
|
|
1229
1086
|
};
|
|
1230
1087
|
var DrawerContainer_default = DrawerContainer;
|
|
1231
1088
|
|
|
1232
1089
|
// src/hooks/useClickAway.ts
|
|
1233
|
-
|
|
1090
|
+
import { useEffect as useEffect3 } from "react";
|
|
1234
1091
|
var useClickAway = (ref, callback) => {
|
|
1235
|
-
(
|
|
1092
|
+
useEffect3(() => {
|
|
1236
1093
|
const handleClick = (e) => {
|
|
1237
1094
|
if (!ref.current || ref.current.contains(e.target)) return;
|
|
1238
1095
|
callback();
|
|
@@ -1245,7 +1102,7 @@ var useClickAway = (ref, callback) => {
|
|
|
1245
1102
|
};
|
|
1246
1103
|
|
|
1247
1104
|
// src/components/Drawer/Drawer.tsx
|
|
1248
|
-
|
|
1105
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1249
1106
|
var Drawer = ({ open, anchor = null, onClose, children, propsComponent }) => {
|
|
1250
1107
|
const { show, hide } = useBackdrop();
|
|
1251
1108
|
const ref = React8.useRef(null);
|
|
@@ -1268,7 +1125,7 @@ var Drawer = ({ open, anchor = null, onClose, children, propsComponent }) => {
|
|
|
1268
1125
|
onClose();
|
|
1269
1126
|
}
|
|
1270
1127
|
}, [propsComponent?.onClose]);
|
|
1271
|
-
return /* @__PURE__ */ (
|
|
1128
|
+
return /* @__PURE__ */ jsx16(
|
|
1272
1129
|
"div",
|
|
1273
1130
|
{
|
|
1274
1131
|
className: `yr3Drawer ${anchor && `yr3Drawer--${anchor}`} ${open && "yr3Drawer--open"}`,
|
|
@@ -1276,13 +1133,13 @@ var Drawer = ({ open, anchor = null, onClose, children, propsComponent }) => {
|
|
|
1276
1133
|
onClick: (e) => e.stopPropagation(),
|
|
1277
1134
|
ref,
|
|
1278
1135
|
"data-testid": "yr3Drawer",
|
|
1279
|
-
children: /* @__PURE__ */ (
|
|
1136
|
+
children: /* @__PURE__ */ jsx16(
|
|
1280
1137
|
DrawerContainer_default,
|
|
1281
1138
|
{
|
|
1282
1139
|
children,
|
|
1283
1140
|
...propsComponent?.container,
|
|
1284
1141
|
props: propsComponent?.closing,
|
|
1285
|
-
onClose: () => propsComponent?.closing === "container" ? onClose() :
|
|
1142
|
+
onClose: () => propsComponent?.closing === "container" ? onClose() : {}
|
|
1286
1143
|
}
|
|
1287
1144
|
)
|
|
1288
1145
|
},
|
|
@@ -1291,8 +1148,8 @@ var Drawer = ({ open, anchor = null, onClose, children, propsComponent }) => {
|
|
|
1291
1148
|
};
|
|
1292
1149
|
|
|
1293
1150
|
// src/components/Fade/Fade.tsx
|
|
1294
|
-
|
|
1295
|
-
|
|
1151
|
+
import * as React9 from "react";
|
|
1152
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1296
1153
|
var Fade = ({
|
|
1297
1154
|
in: inProp,
|
|
1298
1155
|
children,
|
|
@@ -1309,7 +1166,7 @@ var Fade = ({
|
|
|
1309
1166
|
}
|
|
1310
1167
|
return () => clearTimeout(timeoutId);
|
|
1311
1168
|
}, [inProp, duration, onTransitionEnd]);
|
|
1312
|
-
return /* @__PURE__ */ (
|
|
1169
|
+
return /* @__PURE__ */ jsx17(
|
|
1313
1170
|
"div",
|
|
1314
1171
|
{
|
|
1315
1172
|
className: `yr3Fade ${inProp ? "yr3Fade--in" : ""}`,
|
|
@@ -1320,8 +1177,107 @@ var Fade = ({
|
|
|
1320
1177
|
);
|
|
1321
1178
|
};
|
|
1322
1179
|
|
|
1180
|
+
// src/components/Flex/flex.variants.ts
|
|
1181
|
+
var flexVariants = createVariants({
|
|
1182
|
+
base: "yr3Flex",
|
|
1183
|
+
variants: {
|
|
1184
|
+
variant: {
|
|
1185
|
+
row: "yr3Flex--row",
|
|
1186
|
+
column: "yr3Flex--column",
|
|
1187
|
+
wrap: "yr3Flex--wrap"
|
|
1188
|
+
},
|
|
1189
|
+
container: {
|
|
1190
|
+
true: "yr3Flex--container"
|
|
1191
|
+
},
|
|
1192
|
+
center: {
|
|
1193
|
+
true: "yr3Flex--center"
|
|
1194
|
+
},
|
|
1195
|
+
between: {
|
|
1196
|
+
true: "yr3Flex--between"
|
|
1197
|
+
},
|
|
1198
|
+
bordered: {
|
|
1199
|
+
true: "yr3Flex--bordered"
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
});
|
|
1203
|
+
var flex_variants_default = flexVariants;
|
|
1204
|
+
|
|
1205
|
+
// src/components/Flex/Flex.tsx
|
|
1206
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1207
|
+
var Flex = ({
|
|
1208
|
+
container = false,
|
|
1209
|
+
spacing: spacing2 = 1,
|
|
1210
|
+
children,
|
|
1211
|
+
ui,
|
|
1212
|
+
gap,
|
|
1213
|
+
variant = "column",
|
|
1214
|
+
center = false,
|
|
1215
|
+
between = false,
|
|
1216
|
+
style,
|
|
1217
|
+
bordered = false,
|
|
1218
|
+
...props
|
|
1219
|
+
}) => {
|
|
1220
|
+
const classes = flex_variants_default({ variant, container, center, between, bordered, spacing: spacing2 });
|
|
1221
|
+
return /* @__PURE__ */ jsx18(
|
|
1222
|
+
"div",
|
|
1223
|
+
{
|
|
1224
|
+
className: classes,
|
|
1225
|
+
style: composeStyles(ui, style),
|
|
1226
|
+
...props,
|
|
1227
|
+
"data-testid": "yr3Flex",
|
|
1228
|
+
children
|
|
1229
|
+
}
|
|
1230
|
+
);
|
|
1231
|
+
};
|
|
1232
|
+
|
|
1233
|
+
// src/components/Grid/Grid.tsx
|
|
1234
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1235
|
+
var Grid = ({
|
|
1236
|
+
container = false,
|
|
1237
|
+
spacing: spacing2 = 0,
|
|
1238
|
+
children,
|
|
1239
|
+
columns = 12,
|
|
1240
|
+
span = 1,
|
|
1241
|
+
ui,
|
|
1242
|
+
style,
|
|
1243
|
+
item = false,
|
|
1244
|
+
size = 0,
|
|
1245
|
+
center = false,
|
|
1246
|
+
...props
|
|
1247
|
+
}) => {
|
|
1248
|
+
if (item) {
|
|
1249
|
+
columns = 0;
|
|
1250
|
+
}
|
|
1251
|
+
if (container) {
|
|
1252
|
+
columns = 0;
|
|
1253
|
+
ui = {
|
|
1254
|
+
...ui,
|
|
1255
|
+
gridTemplateColumns: `repeat(${columns}, 1fr)`
|
|
1256
|
+
};
|
|
1257
|
+
}
|
|
1258
|
+
if (center) {
|
|
1259
|
+
ui = {
|
|
1260
|
+
...ui,
|
|
1261
|
+
justifyContent: "center",
|
|
1262
|
+
alignItems: "center"
|
|
1263
|
+
};
|
|
1264
|
+
}
|
|
1265
|
+
const classes = bem("yr3Grid");
|
|
1266
|
+
const className = classes(void 0, { container, [`spacing-${spacing2}`]: center, span: item && `Col-${size}` });
|
|
1267
|
+
return /* @__PURE__ */ jsx19(
|
|
1268
|
+
"div",
|
|
1269
|
+
{
|
|
1270
|
+
className,
|
|
1271
|
+
style: composeStyles(ui, style),
|
|
1272
|
+
"data-testid": "yr3Grid",
|
|
1273
|
+
...props,
|
|
1274
|
+
children
|
|
1275
|
+
}
|
|
1276
|
+
);
|
|
1277
|
+
};
|
|
1278
|
+
|
|
1323
1279
|
// src/components/Group/Group.tsx
|
|
1324
|
-
|
|
1280
|
+
import * as React10 from "react";
|
|
1325
1281
|
|
|
1326
1282
|
// src/components/Group/group.variants.ts
|
|
1327
1283
|
var groupVariants = createVariants({
|
|
@@ -1347,7 +1303,7 @@ var groupVariants = createVariants({
|
|
|
1347
1303
|
});
|
|
1348
1304
|
|
|
1349
1305
|
// src/components/Group/Group.tsx
|
|
1350
|
-
|
|
1306
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1351
1307
|
var initialComponents = {
|
|
1352
1308
|
group: {
|
|
1353
1309
|
ui: {},
|
|
@@ -1374,13 +1330,13 @@ var Group = ({
|
|
|
1374
1330
|
}
|
|
1375
1331
|
}, [value, isControlled]);
|
|
1376
1332
|
const classItems = bem("yr3Group--item");
|
|
1377
|
-
return /* @__PURE__ */ (
|
|
1333
|
+
return /* @__PURE__ */ jsx20(
|
|
1378
1334
|
"div",
|
|
1379
1335
|
{
|
|
1380
1336
|
className: groupVariants({ variant, color }),
|
|
1381
1337
|
"data-testid": "yr3Group",
|
|
1382
1338
|
style: composeStyles(propsComponent.group?.ui, propsComponent.group?.style),
|
|
1383
|
-
children: options.map((opt) => /* @__PURE__ */ (
|
|
1339
|
+
children: options.map((opt) => /* @__PURE__ */ jsx20(
|
|
1384
1340
|
"div",
|
|
1385
1341
|
{
|
|
1386
1342
|
"data-testid": "yr3Group-item",
|
|
@@ -1396,14 +1352,14 @@ var Group = ({
|
|
|
1396
1352
|
};
|
|
1397
1353
|
|
|
1398
1354
|
// src/components/Image/Image.tsx
|
|
1399
|
-
|
|
1355
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1400
1356
|
var Image = ({
|
|
1401
1357
|
src,
|
|
1402
1358
|
alt = "",
|
|
1403
1359
|
ui,
|
|
1404
1360
|
style
|
|
1405
1361
|
}) => {
|
|
1406
|
-
return /* @__PURE__ */ (
|
|
1362
|
+
return /* @__PURE__ */ jsx21(
|
|
1407
1363
|
"img",
|
|
1408
1364
|
{
|
|
1409
1365
|
src,
|
|
@@ -1416,15 +1372,15 @@ var Image = ({
|
|
|
1416
1372
|
};
|
|
1417
1373
|
|
|
1418
1374
|
// src/components/Input/Input.tsx
|
|
1419
|
-
|
|
1375
|
+
import * as React11 from "react";
|
|
1420
1376
|
|
|
1421
1377
|
// src/components/Label/Label.tsx
|
|
1422
|
-
|
|
1378
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1423
1379
|
var Label = ({ text: text2, children, className, color = "primary", ui, style }) => {
|
|
1424
1380
|
const classes = bem("yr3Label");
|
|
1425
1381
|
const classComponent = classes(void 0, { color: `color-${color}` });
|
|
1426
1382
|
const classnames = bemMerge(classComponent, className);
|
|
1427
|
-
return /* @__PURE__ */ (
|
|
1383
|
+
return /* @__PURE__ */ jsx22(
|
|
1428
1384
|
"span",
|
|
1429
1385
|
{
|
|
1430
1386
|
className: classnames,
|
|
@@ -1476,7 +1432,7 @@ var inputVariants = createVariants({
|
|
|
1476
1432
|
});
|
|
1477
1433
|
|
|
1478
1434
|
// src/components/Input/Input.tsx
|
|
1479
|
-
|
|
1435
|
+
import { jsx as jsx23, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1480
1436
|
var initiaPropsComponent = {
|
|
1481
1437
|
label: {
|
|
1482
1438
|
display: true,
|
|
@@ -1531,8 +1487,8 @@ var Input = React11.forwardRef(
|
|
|
1531
1487
|
onChange?.(e, newValue);
|
|
1532
1488
|
};
|
|
1533
1489
|
const classes = inputVariants({ color, label: propsComponent?.label?.display });
|
|
1534
|
-
return /* @__PURE__ */ (
|
|
1535
|
-
propsComponent?.label?.display && /* @__PURE__ */ (
|
|
1490
|
+
return /* @__PURE__ */ jsxs5(Control, { variant, color, label: propsComponent?.label?.display, children: [
|
|
1491
|
+
propsComponent?.label?.display && /* @__PURE__ */ jsx23(
|
|
1536
1492
|
Label,
|
|
1537
1493
|
{
|
|
1538
1494
|
text: label || "",
|
|
@@ -1541,7 +1497,7 @@ var Input = React11.forwardRef(
|
|
|
1541
1497
|
...propsComponent.label
|
|
1542
1498
|
}
|
|
1543
1499
|
),
|
|
1544
|
-
/* @__PURE__ */ (
|
|
1500
|
+
/* @__PURE__ */ jsx23(
|
|
1545
1501
|
"input",
|
|
1546
1502
|
{
|
|
1547
1503
|
ref,
|
|
@@ -1557,36 +1513,36 @@ var Input = React11.forwardRef(
|
|
|
1557
1513
|
"data-testid": "yr3Input"
|
|
1558
1514
|
}
|
|
1559
1515
|
),
|
|
1560
|
-
/* @__PURE__ */ (
|
|
1516
|
+
/* @__PURE__ */ jsx23(Text, { variant: "helper", "data-testid": "yr3Input-helper", children: error || internalError || "" })
|
|
1561
1517
|
] });
|
|
1562
1518
|
}
|
|
1563
1519
|
);
|
|
1564
1520
|
|
|
1565
1521
|
// src/components/Input/InputPhone.tsx
|
|
1566
|
-
|
|
1522
|
+
import * as React14 from "react";
|
|
1567
1523
|
|
|
1568
1524
|
// src/components/Select/Selector.tsx
|
|
1569
|
-
|
|
1525
|
+
import * as React12 from "react";
|
|
1570
1526
|
|
|
1571
1527
|
// src/Icons/IconDown.tsx
|
|
1572
|
-
|
|
1528
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1573
1529
|
var IconDown = (props) => {
|
|
1574
|
-
return /* @__PURE__ */ (
|
|
1530
|
+
return /* @__PURE__ */ jsx24("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__ */ jsx24("path", { d: "M7 10L12 15L17 10", stroke: props.stroke || "#fff", strokeWidth: props.strokeWidth || "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1575
1531
|
};
|
|
1576
1532
|
|
|
1577
1533
|
// src/components/Select/Selector.tsx
|
|
1578
|
-
|
|
1534
|
+
import { jsx as jsx25, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1579
1535
|
var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconColor, icon }) => {
|
|
1580
1536
|
const [open, setOpen] = React12.useState(false);
|
|
1581
1537
|
const [valueState, setValueState] = React12.useState(value || defaultValue || null);
|
|
1582
1538
|
const ref = React12.useRef(null);
|
|
1583
1539
|
useClickAway(ref, () => setOpen(false));
|
|
1584
|
-
return /* @__PURE__ */ (
|
|
1585
|
-
/* @__PURE__ */ (
|
|
1586
|
-
/* @__PURE__ */ (
|
|
1540
|
+
return /* @__PURE__ */ jsxs6("div", { className: "yr3Selector-wrapper", ref, children: [
|
|
1541
|
+
/* @__PURE__ */ jsx25("div", { className: `yr3Selector ${open ? "yr3Selector--open" : ""}`, style: composeStyles(ui, style), children: /* @__PURE__ */ jsxs6("div", { className: "yr3Selector--control", children: [
|
|
1542
|
+
/* @__PURE__ */ jsx25("div", { className: "yr3Selector--icon", onClick: () => setOpen((prev) => !prev), children: icon ? icon : /* @__PURE__ */ jsx25(IconDown, { stroke: `var(--color-${iconColor || "disabled"})`, width: 24, height: 24 }) }),
|
|
1587
1543
|
valueState
|
|
1588
1544
|
] }) }),
|
|
1589
|
-
open && /* @__PURE__ */ (
|
|
1545
|
+
open && /* @__PURE__ */ jsx25("div", { className: "yr3Select--menu", children: options.map((opt) => /* @__PURE__ */ jsx25(
|
|
1590
1546
|
"div",
|
|
1591
1547
|
{
|
|
1592
1548
|
className: "yr3Select--option",
|
|
@@ -1616,19 +1572,19 @@ var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconC
|
|
|
1616
1572
|
var Selector_default = Selector;
|
|
1617
1573
|
|
|
1618
1574
|
// src/theme/ThemeProvider.tsx
|
|
1619
|
-
|
|
1620
|
-
|
|
1575
|
+
import * as React13 from "react";
|
|
1576
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1621
1577
|
var ThemeContext = React13.createContext(null);
|
|
1622
1578
|
var ThemeProvider = ({ theme, children }) => {
|
|
1623
1579
|
React13.useEffect(() => {
|
|
1624
1580
|
applyTheme(theme);
|
|
1625
1581
|
}, [theme]);
|
|
1626
|
-
return /* @__PURE__ */ (
|
|
1582
|
+
return /* @__PURE__ */ jsx26(ThemeContext.Provider, { value: theme, children: /* @__PURE__ */ jsx26(BackdropProvider, { children }) });
|
|
1627
1583
|
};
|
|
1628
1584
|
var useTheme = () => React13.useContext(ThemeContext);
|
|
1629
1585
|
|
|
1630
1586
|
// src/components/Input/InputPhone.tsx
|
|
1631
|
-
|
|
1587
|
+
import { jsx as jsx27, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1632
1588
|
var Phone = ({
|
|
1633
1589
|
name,
|
|
1634
1590
|
value,
|
|
@@ -1651,10 +1607,10 @@ var Phone = ({
|
|
|
1651
1607
|
};
|
|
1652
1608
|
onChange?.(event, full);
|
|
1653
1609
|
};
|
|
1654
|
-
return /* @__PURE__ */ (
|
|
1655
|
-
/* @__PURE__ */ (
|
|
1656
|
-
/* @__PURE__ */ (
|
|
1657
|
-
/* @__PURE__ */ (
|
|
1610
|
+
return /* @__PURE__ */ jsxs7(Control, { variant: "outlined", children: [
|
|
1611
|
+
/* @__PURE__ */ jsx27(Label, { text: label, className: "yr3Input--active" }),
|
|
1612
|
+
/* @__PURE__ */ jsx27("div", { className: "yr3PhoneInput", "data-testid": "yr3Phone", children: /* @__PURE__ */ jsxs7(Flex, { variant: "row", container: true, center: true, children: [
|
|
1613
|
+
/* @__PURE__ */ jsx27(
|
|
1658
1614
|
Selector_default,
|
|
1659
1615
|
{
|
|
1660
1616
|
options: countries.map((c) => ({
|
|
@@ -1674,8 +1630,8 @@ var Phone = ({
|
|
|
1674
1630
|
style: propsComponent?.selector?.style
|
|
1675
1631
|
}
|
|
1676
1632
|
),
|
|
1677
|
-
/* @__PURE__ */ (
|
|
1678
|
-
/* @__PURE__ */ (
|
|
1633
|
+
/* @__PURE__ */ jsx27(Divider, { orientation: "vertical", ...propsComponent?.divider }),
|
|
1634
|
+
/* @__PURE__ */ jsx27(
|
|
1679
1635
|
Input,
|
|
1680
1636
|
{
|
|
1681
1637
|
type: "phone",
|
|
@@ -1692,27 +1648,22 @@ var Phone = ({
|
|
|
1692
1648
|
] });
|
|
1693
1649
|
};
|
|
1694
1650
|
|
|
1695
|
-
// src/components/Input/InputPlaces.tsx
|
|
1696
|
-
var React15 = __toESM(require("react"));
|
|
1697
|
-
var import_autocomplete_places = require("@yr3/autocomplete-places");
|
|
1698
|
-
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1699
|
-
|
|
1700
1651
|
// src/components/Modal/Modal.tsx
|
|
1701
|
-
|
|
1652
|
+
import * as React15 from "react";
|
|
1702
1653
|
|
|
1703
1654
|
// src/components/Modal/ModalContainer.tsx
|
|
1704
|
-
|
|
1655
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1705
1656
|
var ModalContainer = ({ children, size = "sm", ui, style }) => {
|
|
1706
1657
|
const classes = bem("yr3Modal-container");
|
|
1707
1658
|
const classComponent = classes(void 0, { [`${size}`]: !!size });
|
|
1708
|
-
return /* @__PURE__ */ (
|
|
1659
|
+
return /* @__PURE__ */ jsx28("div", { className: classComponent, style: composeStyles(ui, style), "data-testid": "yr3Modal-container", children });
|
|
1709
1660
|
};
|
|
1710
1661
|
|
|
1711
1662
|
// src/components/Modal/Modal.tsx
|
|
1712
|
-
|
|
1663
|
+
import { jsx as jsx29, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1713
1664
|
var Modal = ({ open, onClose, children, propsComponent }) => {
|
|
1714
1665
|
const { show, hide } = useBackdrop();
|
|
1715
|
-
|
|
1666
|
+
React15.useEffect(() => {
|
|
1716
1667
|
if (open) {
|
|
1717
1668
|
show();
|
|
1718
1669
|
} else {
|
|
@@ -1721,9 +1672,9 @@ var Modal = ({ open, onClose, children, propsComponent }) => {
|
|
|
1721
1672
|
}, [open, show]);
|
|
1722
1673
|
const classes = bem("yr3Modal");
|
|
1723
1674
|
const classComponent = classes(void 0, { "open": !!open });
|
|
1724
|
-
return /* @__PURE__ */ (
|
|
1675
|
+
return /* @__PURE__ */ jsx29("div", { className: classComponent, onClick: (e) => e.stopPropagation(), "data-testid": "yr3Modal", children: /* @__PURE__ */ jsx29(ModalContainer, { ...propsComponent?.container, children: /* @__PURE__ */ jsxs8(Flex, { variant: "column", container: true, center: true, gap: 1, children: [
|
|
1725
1676
|
children,
|
|
1726
|
-
propsComponent?.close ? propsComponent.close : /* @__PURE__ */ (
|
|
1677
|
+
propsComponent?.close ? propsComponent.close : /* @__PURE__ */ jsx29(Button, { variant: "filled", color: "secondary", onClick: onClose, "data-testid": "yr3Modal-close", children: "Close" })
|
|
1727
1678
|
] }) }) });
|
|
1728
1679
|
};
|
|
1729
1680
|
|
|
@@ -1763,15 +1714,15 @@ var notistackVariants = createVariants({
|
|
|
1763
1714
|
});
|
|
1764
1715
|
|
|
1765
1716
|
// src/components/Notistack/Notistack.tsx
|
|
1766
|
-
|
|
1717
|
+
import { jsx as jsx30, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1767
1718
|
var Notistack = ({ message, duration = 3e3, variant = "info", color, propsComponent, anchor, exiting = false }) => {
|
|
1768
1719
|
const classes = notistackVariants({ type: variant, color, exiting, direction: `${anchor?.vertical || "bottom"}-${anchor?.horizontal || "right"}` });
|
|
1769
1720
|
const containerStyle = composeStyles(propsComponent?.container?.ui, propsComponent?.container?.style);
|
|
1770
1721
|
const notistackStyle = composeStyles(propsComponent?.notistack?.ui, propsComponent?.notistack?.style);
|
|
1771
1722
|
const progressStyle = composeStyles(propsComponent?.progress?.ui, propsComponent?.progress?.style);
|
|
1772
|
-
return /* @__PURE__ */ (
|
|
1773
|
-
/* @__PURE__ */ (
|
|
1774
|
-
/* @__PURE__ */ (
|
|
1723
|
+
return /* @__PURE__ */ jsxs9("div", { className: classes, "data-testid": "yr3Notistack", style: notistackStyle, children: [
|
|
1724
|
+
/* @__PURE__ */ jsx30("span", { style: containerStyle, children: message }),
|
|
1725
|
+
/* @__PURE__ */ jsx30(
|
|
1775
1726
|
"div",
|
|
1776
1727
|
{
|
|
1777
1728
|
className: "yr3Notistack--progress",
|
|
@@ -1805,7 +1756,7 @@ var pendingVariants = createVariants({
|
|
|
1805
1756
|
});
|
|
1806
1757
|
|
|
1807
1758
|
// src/components/Pending/Pending.tsx
|
|
1808
|
-
|
|
1759
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1809
1760
|
var Pending = ({
|
|
1810
1761
|
variant,
|
|
1811
1762
|
width,
|
|
@@ -1818,7 +1769,7 @@ var Pending = ({
|
|
|
1818
1769
|
const widthStyle = variant === "circle" ? size : width;
|
|
1819
1770
|
const heightStyle = variant === "circle" ? size : height;
|
|
1820
1771
|
const uiStylePending = uiStyle({ width: widthStyle, height: heightStyle, ...ui });
|
|
1821
|
-
return /* @__PURE__ */ (
|
|
1772
|
+
return /* @__PURE__ */ jsx31(
|
|
1822
1773
|
"div",
|
|
1823
1774
|
{
|
|
1824
1775
|
className: pendingVariants({ variant, color }),
|
|
@@ -1847,7 +1798,7 @@ var radioVariant = createVariants({
|
|
|
1847
1798
|
});
|
|
1848
1799
|
|
|
1849
1800
|
// src/components/Radio/Radio.tsx
|
|
1850
|
-
|
|
1801
|
+
import { jsx as jsx32, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1851
1802
|
var Radio = ({
|
|
1852
1803
|
checked,
|
|
1853
1804
|
value,
|
|
@@ -1863,8 +1814,8 @@ var Radio = ({
|
|
|
1863
1814
|
const bemClass = bem("yr3Radio");
|
|
1864
1815
|
const classes = bemClass(void 0, { [color]: `color-${color}` });
|
|
1865
1816
|
const variantClass = radioVariant({ variant });
|
|
1866
|
-
return /* @__PURE__ */ (
|
|
1867
|
-
/* @__PURE__ */ (
|
|
1817
|
+
return /* @__PURE__ */ jsxs10("label", { className: classes, "data-testid": "yr3Radio", style: composeStyles(propsComponent?.radio?.ui, propsComponent?.radio?.style), children: [
|
|
1818
|
+
/* @__PURE__ */ jsx32(
|
|
1868
1819
|
"input",
|
|
1869
1820
|
{
|
|
1870
1821
|
type: "radio",
|
|
@@ -1876,8 +1827,8 @@ var Radio = ({
|
|
|
1876
1827
|
}
|
|
1877
1828
|
),
|
|
1878
1829
|
iconChecked && checked ? iconChecked : !checked && iconUnchecked ? iconUnchecked : null,
|
|
1879
|
-
!iconChecked && !iconUnchecked && /* @__PURE__ */ (
|
|
1880
|
-
typeof label === "string" && /* @__PURE__ */ (
|
|
1830
|
+
!iconChecked && !iconUnchecked && /* @__PURE__ */ jsx32("span", { className: variantClass, "data-testid": "yr3Radio-dot" }),
|
|
1831
|
+
typeof label === "string" && /* @__PURE__ */ jsx32(
|
|
1881
1832
|
"span",
|
|
1882
1833
|
{
|
|
1883
1834
|
className: "yr3Radio--label",
|
|
@@ -1890,15 +1841,15 @@ var Radio = ({
|
|
|
1890
1841
|
};
|
|
1891
1842
|
|
|
1892
1843
|
// src/components/Select/Select.tsx
|
|
1893
|
-
|
|
1894
|
-
|
|
1844
|
+
import * as React16 from "react";
|
|
1845
|
+
import { jsx as jsx33, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1895
1846
|
var Select = ({ label, options, name, value, defaultValue, onChange, propsComponent }) => {
|
|
1896
|
-
const [open, setOpen] =
|
|
1897
|
-
const [valueState, setValueState] =
|
|
1898
|
-
const ref =
|
|
1847
|
+
const [open, setOpen] = React16.useState(false);
|
|
1848
|
+
const [valueState, setValueState] = React16.useState(value || defaultValue || null);
|
|
1849
|
+
const ref = React16.useRef(null);
|
|
1899
1850
|
useClickAway(ref, () => setOpen(false));
|
|
1900
|
-
return /* @__PURE__ */ (
|
|
1901
|
-
/* @__PURE__ */ (
|
|
1851
|
+
return /* @__PURE__ */ jsxs11(Control, { ...propsComponent?.control, children: [
|
|
1852
|
+
/* @__PURE__ */ jsx33(
|
|
1902
1853
|
Label,
|
|
1903
1854
|
{
|
|
1904
1855
|
...propsComponent?.label,
|
|
@@ -1906,10 +1857,10 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
1906
1857
|
className: open || valueState ? "yr3Input--active" : ""
|
|
1907
1858
|
}
|
|
1908
1859
|
),
|
|
1909
|
-
/* @__PURE__ */ (
|
|
1910
|
-
/* @__PURE__ */ (
|
|
1911
|
-
/* @__PURE__ */ (
|
|
1912
|
-
/* @__PURE__ */ (
|
|
1860
|
+
/* @__PURE__ */ jsxs11("div", { className: "yr3Select-wrapper", ref, children: [
|
|
1861
|
+
/* @__PURE__ */ jsxs11("div", { className: `yr3Select ${open ? "yr3Select--open" : ""}`, "data-testid": "yr3Select-wrapper", style: composeStyles(propsComponent?.wrapper?.ui, propsComponent?.wrapper?.style), children: [
|
|
1862
|
+
/* @__PURE__ */ jsx33("div", { className: "yr3Select--control", children: valueState }),
|
|
1863
|
+
/* @__PURE__ */ jsx33("div", { className: "yr3Select--icon", onClick: () => setOpen((prev) => !prev), "data-testid": "yr3Select-icon", children: propsComponent?.icon?.component ? propsComponent.icon.component : /* @__PURE__ */ jsx33(
|
|
1913
1864
|
IconDown,
|
|
1914
1865
|
{
|
|
1915
1866
|
width: propsComponent?.icon?.style?.width || 26,
|
|
@@ -1919,13 +1870,13 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
1919
1870
|
}
|
|
1920
1871
|
) })
|
|
1921
1872
|
] }),
|
|
1922
|
-
open && /* @__PURE__ */ (
|
|
1873
|
+
open && /* @__PURE__ */ jsx33(
|
|
1923
1874
|
"div",
|
|
1924
1875
|
{
|
|
1925
1876
|
className: "yr3Select--menu",
|
|
1926
1877
|
style: composeStyles(propsComponent?.menu?.ui, propsComponent?.menu?.style),
|
|
1927
1878
|
"data-testid": "yr3Select-menu",
|
|
1928
|
-
children: options.map((opt) => /* @__PURE__ */ (
|
|
1879
|
+
children: options.map((opt) => /* @__PURE__ */ jsx33(
|
|
1929
1880
|
"div",
|
|
1930
1881
|
{
|
|
1931
1882
|
className: "yr3Select--option",
|
|
@@ -1957,8 +1908,8 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
1957
1908
|
};
|
|
1958
1909
|
|
|
1959
1910
|
// src/components/Slide/Slide.tsx
|
|
1960
|
-
|
|
1961
|
-
|
|
1911
|
+
import * as React17 from "react";
|
|
1912
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
1962
1913
|
var Slide = ({
|
|
1963
1914
|
in: inProp,
|
|
1964
1915
|
children,
|
|
@@ -1972,7 +1923,7 @@ var Slide = ({
|
|
|
1972
1923
|
[direction]: true,
|
|
1973
1924
|
"in": !!inProp
|
|
1974
1925
|
});
|
|
1975
|
-
|
|
1926
|
+
React17.useEffect(() => {
|
|
1976
1927
|
let timeoutId;
|
|
1977
1928
|
if (inProp) {
|
|
1978
1929
|
timeoutId = setTimeout(() => {
|
|
@@ -1982,19 +1933,19 @@ var Slide = ({
|
|
|
1982
1933
|
return () => clearTimeout(timeoutId);
|
|
1983
1934
|
}, [inProp, duration, onTransitionEnd]);
|
|
1984
1935
|
const uiStyleContent = uiStyle({ ...propsComponent?.slide?.ui, transitionDuration: `${duration}ms` });
|
|
1985
|
-
return /* @__PURE__ */ (
|
|
1936
|
+
return /* @__PURE__ */ jsx34(
|
|
1986
1937
|
"div",
|
|
1987
1938
|
{
|
|
1988
1939
|
className: "yr3Slide",
|
|
1989
1940
|
style: uiStyle({ position: "relative", zIndex: 4, overflow: "hidden" }),
|
|
1990
1941
|
"data-testid": "yr3Slide",
|
|
1991
|
-
children: /* @__PURE__ */ (
|
|
1942
|
+
children: /* @__PURE__ */ jsx34(
|
|
1992
1943
|
"div",
|
|
1993
1944
|
{
|
|
1994
1945
|
className: classNameContent,
|
|
1995
1946
|
style: composeStyles(uiStyleContent, propsComponent?.slide?.style || {}),
|
|
1996
1947
|
"data-testid": "yr3Slide-content",
|
|
1997
|
-
children: /* @__PURE__ */ (
|
|
1948
|
+
children: /* @__PURE__ */ jsx34(Box, { ...propsComponent?.box, "data-testid": "yr3Slide-box", children })
|
|
1998
1949
|
}
|
|
1999
1950
|
)
|
|
2000
1951
|
}
|
|
@@ -2002,7 +1953,7 @@ var Slide = ({
|
|
|
2002
1953
|
};
|
|
2003
1954
|
|
|
2004
1955
|
// src/components/Switch/Switch.tsx
|
|
2005
|
-
|
|
1956
|
+
import * as React18 from "react";
|
|
2006
1957
|
|
|
2007
1958
|
// src/components/Switch/switch.variants.ts
|
|
2008
1959
|
var switchVariants = createVariants({
|
|
@@ -2031,7 +1982,7 @@ var switchVariants = createVariants({
|
|
|
2031
1982
|
});
|
|
2032
1983
|
|
|
2033
1984
|
// src/components/Switch/Switch.tsx
|
|
2034
|
-
|
|
1985
|
+
import { jsx as jsx35, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2035
1986
|
var Switch = ({
|
|
2036
1987
|
checked,
|
|
2037
1988
|
defaultChecked,
|
|
@@ -2041,7 +1992,7 @@ var Switch = ({
|
|
|
2041
1992
|
size = "sm",
|
|
2042
1993
|
label
|
|
2043
1994
|
}) => {
|
|
2044
|
-
const [internal, setInternal] =
|
|
1995
|
+
const [internal, setInternal] = React18.useState(defaultChecked || false);
|
|
2045
1996
|
const classname = switchVariants({ colors: color, size, disabled: !!disabled, checked: checked ?? internal });
|
|
2046
1997
|
const isControlled = checked !== void 0;
|
|
2047
1998
|
const value = isControlled ? checked : internal;
|
|
@@ -2049,13 +2000,13 @@ var Switch = ({
|
|
|
2049
2000
|
if (!isControlled) setInternal(e.target.checked);
|
|
2050
2001
|
onChange?.(e, e.target.checked);
|
|
2051
2002
|
};
|
|
2052
|
-
return /* @__PURE__ */ (
|
|
2003
|
+
return /* @__PURE__ */ jsxs12(
|
|
2053
2004
|
"label",
|
|
2054
2005
|
{
|
|
2055
2006
|
className: classname,
|
|
2056
2007
|
"data-testid": "yr3Switch",
|
|
2057
2008
|
children: [
|
|
2058
|
-
/* @__PURE__ */ (
|
|
2009
|
+
/* @__PURE__ */ jsx35(
|
|
2059
2010
|
"input",
|
|
2060
2011
|
{
|
|
2061
2012
|
type: "checkbox",
|
|
@@ -2064,17 +2015,17 @@ var Switch = ({
|
|
|
2064
2015
|
disabled
|
|
2065
2016
|
}
|
|
2066
2017
|
),
|
|
2067
|
-
/* @__PURE__ */ (
|
|
2068
|
-
/* @__PURE__ */ (
|
|
2018
|
+
/* @__PURE__ */ jsx35("span", { className: "yr3Switch--track", children: /* @__PURE__ */ jsx35("span", { className: "yr3Switch--thumb" }) }),
|
|
2019
|
+
/* @__PURE__ */ jsx35("span", { className: "yr3Switch--label", "data-testid": "yr3Switch-label", children: label })
|
|
2069
2020
|
]
|
|
2070
2021
|
}
|
|
2071
2022
|
);
|
|
2072
2023
|
};
|
|
2073
2024
|
|
|
2074
2025
|
// src/Icons/IconSearch.tsx
|
|
2075
|
-
|
|
2026
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
2076
2027
|
var IconSearch = (props) => {
|
|
2077
|
-
return /* @__PURE__ */ (
|
|
2028
|
+
return /* @__PURE__ */ jsx36("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__ */ jsx36(
|
|
2078
2029
|
"path",
|
|
2079
2030
|
{
|
|
2080
2031
|
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",
|
|
@@ -2105,11 +2056,11 @@ var baseTokens = {
|
|
|
2105
2056
|
};
|
|
2106
2057
|
|
|
2107
2058
|
// src/theme/notistackContext.tsx
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
var NotistackContext =
|
|
2059
|
+
import * as React19 from "react";
|
|
2060
|
+
import { jsx as jsx37, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2061
|
+
var NotistackContext = React19.createContext(null);
|
|
2111
2062
|
var NotistackProvider = ({ children }) => {
|
|
2112
|
-
const [snacks, setSnacks] =
|
|
2063
|
+
const [snacks, setSnacks] = React19.useState([]);
|
|
2113
2064
|
const enqueueNotistack = (snack) => {
|
|
2114
2065
|
const id = Date.now();
|
|
2115
2066
|
setSnacks((prev) => [...prev, { ...snack, id, exiting: false }]);
|
|
@@ -2124,23 +2075,23 @@ var NotistackProvider = ({ children }) => {
|
|
|
2124
2075
|
setSnacks((prev) => prev.filter((s) => s.id !== id));
|
|
2125
2076
|
}, duration + exitDuration);
|
|
2126
2077
|
};
|
|
2127
|
-
return /* @__PURE__ */ (
|
|
2078
|
+
return /* @__PURE__ */ jsxs13(NotistackContext.Provider, { value: { enqueueNotistack }, children: [
|
|
2128
2079
|
children,
|
|
2129
|
-
/* @__PURE__ */ (
|
|
2080
|
+
/* @__PURE__ */ jsx37("div", { className: "yr3NotistackContainer", children: snacks.map((snack) => /* @__PURE__ */ jsx37(Notistack, { ...snack }, snack.id)) })
|
|
2130
2081
|
] });
|
|
2131
2082
|
};
|
|
2132
|
-
var useNotistack = () =>
|
|
2083
|
+
var useNotistack = () => React19.useContext(NotistackContext);
|
|
2133
2084
|
|
|
2134
2085
|
// src/theme/useMediaQuery.tsx
|
|
2135
|
-
|
|
2086
|
+
import * as React20 from "react";
|
|
2136
2087
|
function useMediaQuery(query) {
|
|
2137
2088
|
const theme = useTheme();
|
|
2138
2089
|
const computedQuery = typeof query === "function" ? query(theme) : query;
|
|
2139
|
-
const [matches, setMatches] =
|
|
2090
|
+
const [matches, setMatches] = React20.useState(() => {
|
|
2140
2091
|
if (typeof window === "undefined") return false;
|
|
2141
2092
|
return window.matchMedia(computedQuery).matches;
|
|
2142
2093
|
});
|
|
2143
|
-
|
|
2094
|
+
React20.useEffect(() => {
|
|
2144
2095
|
if (typeof window === "undefined") return;
|
|
2145
2096
|
const media = window.matchMedia(computedQuery);
|
|
2146
2097
|
const listener = () => setMatches(media.matches);
|
|
@@ -2165,8 +2116,7 @@ function useBreakpointValue(values) {
|
|
|
2165
2116
|
|
|
2166
2117
|
// src/index.ts
|
|
2167
2118
|
initTheme();
|
|
2168
|
-
|
|
2169
|
-
0 && (module.exports = {
|
|
2119
|
+
export {
|
|
2170
2120
|
Avatar,
|
|
2171
2121
|
Backdrop,
|
|
2172
2122
|
BackdropContext,
|
|
@@ -2230,4 +2180,4 @@ initTheme();
|
|
|
2230
2180
|
useMediaQuery,
|
|
2231
2181
|
useNotistack,
|
|
2232
2182
|
useTheme
|
|
2233
|
-
}
|
|
2183
|
+
};
|