@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
|
@@ -1,3 +1,101 @@
|
|
|
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
|
+
|
|
1
99
|
// src/utils/bem.ts
|
|
2
100
|
var bem = (block) => {
|
|
3
101
|
return (element, modifiers) => {
|
|
@@ -28,11 +126,11 @@ var bemMerge = (...args) => {
|
|
|
28
126
|
};
|
|
29
127
|
|
|
30
128
|
// src/utils/calendar.ts
|
|
31
|
-
|
|
129
|
+
var import_dayjs = __toESM(require("dayjs"), 1);
|
|
32
130
|
function getMonthCalendar(year, month, startIndex, selected, props) {
|
|
33
|
-
const today =
|
|
34
|
-
const startOfMonth =
|
|
35
|
-
const endOfMonth =
|
|
131
|
+
const today = (0, import_dayjs.default)().startOf("day");
|
|
132
|
+
const startOfMonth = (0, import_dayjs.default)().year(year).month(month).startOf("month");
|
|
133
|
+
const endOfMonth = (0, import_dayjs.default)().year(year).month(month).endOf("month");
|
|
36
134
|
let dayCurrent = {};
|
|
37
135
|
let startDay = startOfMonth.day();
|
|
38
136
|
startDay = startDay === 0 ? 6 : startDay - 1;
|
|
@@ -414,7 +512,7 @@ function initTheme() {
|
|
|
414
512
|
}
|
|
415
513
|
|
|
416
514
|
// src/components/Avatar/Avatar.tsx
|
|
417
|
-
|
|
515
|
+
var React = __toESM(require("react"), 1);
|
|
418
516
|
|
|
419
517
|
// src/components/Avatar/avatar.variants.ts
|
|
420
518
|
var avatarVariants = createVariants({
|
|
@@ -457,7 +555,7 @@ var avatarVariants = createVariants({
|
|
|
457
555
|
var avatar_variants_default = avatarVariants;
|
|
458
556
|
|
|
459
557
|
// src/components/Avatar/Avatar.tsx
|
|
460
|
-
|
|
558
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
461
559
|
var Avatar = ({
|
|
462
560
|
src,
|
|
463
561
|
alt,
|
|
@@ -476,30 +574,30 @@ var Avatar = ({
|
|
|
476
574
|
const [error, setError] = React.useState(false);
|
|
477
575
|
const showFallback = !src || error;
|
|
478
576
|
const className = avatar_variants_default({ size, variant, color, bordered, shadow, floating });
|
|
479
|
-
return /* @__PURE__ */ jsx("div", { className, style: uiStyle(ui), "data-testid": "yr3Avatar", role, onClick, children: !showFallback ? /* @__PURE__ */ jsx(
|
|
577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className, style: uiStyle(ui), "data-testid": "yr3Avatar", role, onClick, children: !showFallback ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
480
578
|
"img",
|
|
481
579
|
{
|
|
482
580
|
src,
|
|
483
581
|
alt,
|
|
484
582
|
onError: () => setError(true)
|
|
485
583
|
}
|
|
486
|
-
) : /* @__PURE__ */ jsx("span", { className: "yr3Avatar--fallback", "data-testid": "yr3Avatar-fallback", children: children || label }) });
|
|
584
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "yr3Avatar--fallback", "data-testid": "yr3Avatar-fallback", children: children || label }) });
|
|
487
585
|
};
|
|
488
586
|
|
|
489
587
|
// src/components/Backdrop/Backdrop.tsx
|
|
490
|
-
|
|
588
|
+
var import_react_dom = require("react-dom");
|
|
491
589
|
|
|
492
590
|
// src/theme/backdropContext.tsx
|
|
493
|
-
|
|
494
|
-
|
|
591
|
+
var React2 = __toESM(require("react"), 1);
|
|
592
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
495
593
|
var BackdropContext = React2.createContext(null);
|
|
496
594
|
var BackdropProvider = ({ children }) => {
|
|
497
595
|
const [open, setOpen] = React2.useState(false);
|
|
498
596
|
const show = () => setOpen(true);
|
|
499
597
|
const hide = () => setOpen(false);
|
|
500
|
-
return /* @__PURE__ */ jsxs(BackdropContext.Provider, { value: { open, show, hide }, children: [
|
|
598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(BackdropContext.Provider, { value: { open, show, hide }, children: [
|
|
501
599
|
children,
|
|
502
|
-
/* @__PURE__ */
|
|
600
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Backdrop, {})
|
|
503
601
|
] });
|
|
504
602
|
};
|
|
505
603
|
var useBackdrop = () => {
|
|
@@ -509,11 +607,11 @@ var useBackdrop = () => {
|
|
|
509
607
|
};
|
|
510
608
|
|
|
511
609
|
// src/components/Backdrop/Backdrop.tsx
|
|
512
|
-
|
|
610
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
513
611
|
var Backdrop = () => {
|
|
514
612
|
const { open } = useBackdrop();
|
|
515
|
-
return createPortal(
|
|
516
|
-
/* @__PURE__ */
|
|
613
|
+
return (0, import_react_dom.createPortal)(
|
|
614
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: `yr3Backdrop ${open ? "yr3Backdrop--open" : ""}`, "data-testid": "yr3Backdrop" }),
|
|
517
615
|
document.body
|
|
518
616
|
);
|
|
519
617
|
};
|
|
@@ -540,7 +638,7 @@ var boxVariants = createVariants({
|
|
|
540
638
|
});
|
|
541
639
|
|
|
542
640
|
// src/components/Box/Box.tsx
|
|
543
|
-
|
|
641
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
544
642
|
var Box = ({
|
|
545
643
|
content = "start",
|
|
546
644
|
children,
|
|
@@ -552,7 +650,7 @@ var Box = ({
|
|
|
552
650
|
...props
|
|
553
651
|
}) => {
|
|
554
652
|
const classes = boxVariants({ content, drawer, position });
|
|
555
|
-
return /* @__PURE__ */
|
|
653
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
556
654
|
Component,
|
|
557
655
|
{
|
|
558
656
|
className: classes,
|
|
@@ -565,7 +663,7 @@ var Box = ({
|
|
|
565
663
|
};
|
|
566
664
|
|
|
567
665
|
// src/components/Text/Text.tsx
|
|
568
|
-
|
|
666
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
569
667
|
var Text = ({
|
|
570
668
|
children,
|
|
571
669
|
variant = "inherit",
|
|
@@ -578,7 +676,7 @@ var Text = ({
|
|
|
578
676
|
onClick
|
|
579
677
|
}) => {
|
|
580
678
|
const styleUI = uiStyle({ ...ui, marginTop: gutters[0] || 0, marginBottom: gutters[1] || 0 });
|
|
581
|
-
return /* @__PURE__ */
|
|
679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
582
680
|
Component,
|
|
583
681
|
{
|
|
584
682
|
className: `
|
|
@@ -629,10 +727,10 @@ var buttonVariant = createVariants({
|
|
|
629
727
|
});
|
|
630
728
|
|
|
631
729
|
// src/components/Button/Button.tsx
|
|
632
|
-
|
|
730
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
633
731
|
var Button = ({ children, color = "text", variant = "text", animated, disabled, gradientBorder = false, size = "auto", ui, style, propsComponent, ...props }) => {
|
|
634
732
|
const buttonClassname = buttonVariant({ variant, color, animated, disabled, gradientBorder, size });
|
|
635
|
-
return /* @__PURE__ */
|
|
733
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
636
734
|
"button",
|
|
637
735
|
{
|
|
638
736
|
className: buttonClassname,
|
|
@@ -640,143 +738,99 @@ var Button = ({ children, color = "text", variant = "text", animated, disabled,
|
|
|
640
738
|
"data-testid": "yr3Button",
|
|
641
739
|
...props,
|
|
642
740
|
style: composeStyles(ui, style),
|
|
643
|
-
children: /* @__PURE__ */
|
|
741
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text, { variant: propsComponent?.text?.variant || "button", children })
|
|
644
742
|
}
|
|
645
743
|
);
|
|
646
744
|
};
|
|
647
745
|
|
|
648
746
|
// src/components/Calendar/Calendar.tsx
|
|
649
|
-
|
|
650
|
-
|
|
747
|
+
var React3 = __toESM(require("react"), 1);
|
|
748
|
+
var import_dayjs2 = __toESM(require("dayjs"), 1);
|
|
749
|
+
var import_weekday = __toESM(require("dayjs/plugin/weekday"), 1);
|
|
651
750
|
|
|
652
|
-
// src/components/
|
|
653
|
-
var
|
|
654
|
-
base: "
|
|
751
|
+
// src/components/Calendar/calendar.variants.ts
|
|
752
|
+
var calendarVariants = createVariants({
|
|
753
|
+
base: "yr3Calendar",
|
|
655
754
|
variants: {
|
|
656
755
|
variant: {
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
wrap: "yr3Flex--wrap"
|
|
756
|
+
default: "yr3Calendar--default",
|
|
757
|
+
compact: "yr3Calendar--compact"
|
|
660
758
|
},
|
|
661
|
-
|
|
662
|
-
|
|
759
|
+
size: {
|
|
760
|
+
sm: "yr3Calendar--size-sm",
|
|
761
|
+
md: "yr3Calendar--size-md",
|
|
762
|
+
lg: "yr3Calendar--size-lg"
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
});
|
|
766
|
+
var calendarDayVariants = createVariants({
|
|
767
|
+
base: "yr3Calendar-day",
|
|
768
|
+
variants: {
|
|
769
|
+
isFuture: {
|
|
770
|
+
true: "yr3Calendar-day--future"
|
|
663
771
|
},
|
|
664
|
-
|
|
665
|
-
true: "
|
|
772
|
+
isPast: {
|
|
773
|
+
true: "yr3Calendar-day--past"
|
|
666
774
|
},
|
|
667
|
-
|
|
668
|
-
true: "
|
|
775
|
+
isToday: {
|
|
776
|
+
true: "yr3Calendar-day--today"
|
|
777
|
+
},
|
|
778
|
+
isSelected: {
|
|
779
|
+
true: "yr3Calendar-day--selected"
|
|
669
780
|
},
|
|
670
781
|
bordered: {
|
|
671
|
-
true: "
|
|
782
|
+
true: "yr3Calendar-day--bordered"
|
|
783
|
+
},
|
|
784
|
+
color: {
|
|
785
|
+
primary: "yr3Calendar-day--color-primary",
|
|
786
|
+
secondary: "yr3Calendar-day--color-secondary",
|
|
787
|
+
success: "yr3Calendar-day--color-success",
|
|
788
|
+
text: "yr3Calendar-day--color-text",
|
|
789
|
+
disabled: "yr3Calendar-day--color-disabled",
|
|
790
|
+
info: "yr3Calendar-day--color-info",
|
|
791
|
+
warning: "yr3Calendar-day--color-warning",
|
|
792
|
+
error: "yr3Calendar-day--color-error"
|
|
672
793
|
}
|
|
673
794
|
}
|
|
674
795
|
});
|
|
675
|
-
var flex_variants_default = flexVariants;
|
|
676
|
-
|
|
677
|
-
// src/components/Flex/Flex.tsx
|
|
678
|
-
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
679
|
-
var Flex = ({
|
|
680
|
-
container = false,
|
|
681
|
-
spacing: spacing2 = 1,
|
|
682
|
-
children,
|
|
683
|
-
ui,
|
|
684
|
-
gap,
|
|
685
|
-
variant = "column",
|
|
686
|
-
center = false,
|
|
687
|
-
between = false,
|
|
688
|
-
style,
|
|
689
|
-
bordered = false,
|
|
690
|
-
...props
|
|
691
|
-
}) => {
|
|
692
|
-
const classes = flex_variants_default({ variant, container, center, between, bordered, spacing: spacing2 });
|
|
693
|
-
return /* @__PURE__ */ jsx7(
|
|
694
|
-
"div",
|
|
695
|
-
{
|
|
696
|
-
className: classes,
|
|
697
|
-
style: composeStyles(ui, style),
|
|
698
|
-
...props,
|
|
699
|
-
"data-testid": "yr3Flex",
|
|
700
|
-
children
|
|
701
|
-
}
|
|
702
|
-
);
|
|
703
|
-
};
|
|
704
|
-
|
|
705
|
-
// src/components/Grid/Grid.tsx
|
|
706
|
-
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
707
|
-
var Grid = ({
|
|
708
|
-
container = false,
|
|
709
|
-
spacing: spacing2 = 0,
|
|
710
|
-
children,
|
|
711
|
-
columns = 12,
|
|
712
|
-
span = 1,
|
|
713
|
-
ui,
|
|
714
|
-
style,
|
|
715
|
-
item = false,
|
|
716
|
-
size = 0,
|
|
717
|
-
center = false,
|
|
718
|
-
...props
|
|
719
|
-
}) => {
|
|
720
|
-
if (item) {
|
|
721
|
-
columns = 0;
|
|
722
|
-
}
|
|
723
|
-
if (container) {
|
|
724
|
-
columns = 0;
|
|
725
|
-
ui = {
|
|
726
|
-
...ui,
|
|
727
|
-
gridTemplateColumns: `repeat(${columns}, 1fr)`
|
|
728
|
-
};
|
|
729
|
-
}
|
|
730
|
-
if (center) {
|
|
731
|
-
ui = {
|
|
732
|
-
...ui,
|
|
733
|
-
justifyContent: "center",
|
|
734
|
-
alignItems: "center"
|
|
735
|
-
};
|
|
736
|
-
}
|
|
737
|
-
const classes = bem("yr3Grid");
|
|
738
|
-
const className = classes(void 0, { container, [`spacing-${spacing2}`]: center, span: item && `Col-${size}` });
|
|
739
|
-
return /* @__PURE__ */ jsx8(
|
|
740
|
-
"div",
|
|
741
|
-
{
|
|
742
|
-
className,
|
|
743
|
-
style: composeStyles(ui, style),
|
|
744
|
-
"data-testid": "yr3Grid",
|
|
745
|
-
...props,
|
|
746
|
-
children
|
|
747
|
-
}
|
|
748
|
-
);
|
|
749
|
-
};
|
|
750
796
|
|
|
751
797
|
// src/components/Calendar/Calendar.tsx
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
dayjs2.extend(weekday);
|
|
798
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
799
|
+
import_dayjs2.default.extend(import_weekday.default);
|
|
755
800
|
var initalPropsComponent = {
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
}
|
|
801
|
+
displayButtons: true,
|
|
802
|
+
displayCalendar: true,
|
|
803
|
+
header: {
|
|
804
|
+
color: "primary",
|
|
805
|
+
ui: {},
|
|
806
|
+
style: {}
|
|
807
|
+
},
|
|
808
|
+
month: {
|
|
809
|
+
color: "primary",
|
|
810
|
+
ui: {},
|
|
811
|
+
style: {}
|
|
812
|
+
},
|
|
813
|
+
day: {
|
|
814
|
+
color: "primary",
|
|
815
|
+
bordered: true,
|
|
816
|
+
ui: {},
|
|
817
|
+
style: {}
|
|
818
|
+
},
|
|
819
|
+
buttonNext: {
|
|
820
|
+
disabled: false,
|
|
821
|
+
label: "next"
|
|
822
|
+
},
|
|
823
|
+
buttonBack: {
|
|
824
|
+
disabled: false,
|
|
825
|
+
label: "back"
|
|
772
826
|
}
|
|
773
827
|
};
|
|
774
828
|
var Calendar = ({ onSelect, propsComponent = initalPropsComponent, mapCalendar, onMonthChange }) => {
|
|
775
|
-
const month =
|
|
829
|
+
const month = (0, import_dayjs2.default)().month();
|
|
776
830
|
const [currentMonth, setCurrentMonth] = React3.useState(month);
|
|
777
831
|
const [selected, setSelected] = React3.useState(null);
|
|
778
832
|
const program = React3.useMemo(() => {
|
|
779
|
-
return getMonthCalendar(
|
|
833
|
+
return getMonthCalendar((0, import_dayjs2.default)().year(), currentMonth, 0, selected, mapCalendar);
|
|
780
834
|
}, [selected, currentMonth, mapCalendar]);
|
|
781
835
|
React3.useEffect(() => {
|
|
782
836
|
if (selected) {
|
|
@@ -790,37 +844,36 @@ var Calendar = ({ onSelect, propsComponent = initalPropsComponent, mapCalendar,
|
|
|
790
844
|
onMonthChange && onMonthChange(currentMonth);
|
|
791
845
|
}
|
|
792
846
|
}, [currentMonth]);
|
|
793
|
-
return /* @__PURE__ */
|
|
794
|
-
propsComponent
|
|
795
|
-
/* @__PURE__ */
|
|
796
|
-
/* @__PURE__ */
|
|
797
|
-
/* @__PURE__ */
|
|
847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "yr3Calendar", "data-testid": "yr3Calendar", children: [
|
|
848
|
+
propsComponent?.displayButtons && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "yr3Calendar--header", "data-testid": "yr3CalendarHeader", style: composeStyles(propsComponent?.header?.ui, propsComponent?.header?.style), children: [
|
|
849
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { disabled: propsComponent?.buttonBack?.disabled || false, color: propsComponent.header?.color || "primary", onClick: () => setCurrentMonth(currentMonth - 1), ui: { justifyContent: "flex-start" }, children: propsComponent?.buttonBack?.label }),
|
|
850
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text, { variant: "h6", color: propsComponent.header?.color || "primary", ui: { textTransform: "uppercase", textAlign: "center" }, children: program?.monthLabel }),
|
|
851
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { disabled: propsComponent?.buttonNext?.disabled, color: propsComponent?.header?.color || "primary", onClick: () => setCurrentMonth(currentMonth + 1), ui: { justifyContent: "flex-end" }, children: propsComponent?.buttonNext?.label })
|
|
798
852
|
] }),
|
|
799
|
-
propsComponent
|
|
800
|
-
program?.daysContainer.map((i) => /* @__PURE__ */
|
|
801
|
-
|
|
802
|
-
Flex,
|
|
853
|
+
propsComponent?.displayCalendar && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "yr3Calendar--container", children: [
|
|
854
|
+
program?.daysContainer.map((i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "yr3Calendar--month", style: composeStyles(propsComponent?.month?.ui, propsComponent?.month?.style), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
855
|
+
Text,
|
|
803
856
|
{
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
857
|
+
variant: "caption",
|
|
858
|
+
color: propsComponent?.month?.color || "primary",
|
|
859
|
+
ui: { ...propsComponent?.month?.ui, opacity: 0.7, textTransform: "uppercase" },
|
|
860
|
+
children: (0, import_dayjs2.default)().day(i + 1).format("dd")
|
|
861
|
+
}
|
|
862
|
+
) }, `month_day_${i}`)),
|
|
863
|
+
times(program.calendar.length, (i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(React3.Fragment, { children: times(program.calendar[i].length, (j) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
864
|
+
"div",
|
|
865
|
+
{
|
|
866
|
+
className: calendarDayVariants({
|
|
867
|
+
isToday: program.calendar[i][j]?.isToday,
|
|
868
|
+
isSelected: program.calendar[i][j]?.selected,
|
|
869
|
+
isPast: program.calendar[i][j]?.isPast,
|
|
870
|
+
isFuture: program.calendar[i][j]?.isFuture,
|
|
871
|
+
isCurrentMonth: program.calendar[i][j]?.isCurrentMonth,
|
|
872
|
+
ui: propsComponent?.day?.ui,
|
|
873
|
+
bordered: !!program.calendar[i][j] && propsComponent?.day?.bordered,
|
|
874
|
+
color: propsComponent?.day?.color || "primary"
|
|
875
|
+
}),
|
|
876
|
+
style: composeStyles(propsComponent?.day?.ui, propsComponent?.day?.style),
|
|
824
877
|
"data-testid": "yr3CalendarDay",
|
|
825
878
|
onClick: () => {
|
|
826
879
|
if (selected === program.calendar[i][j]) {
|
|
@@ -829,7 +882,7 @@ var Calendar = ({ onSelect, propsComponent = initalPropsComponent, mapCalendar,
|
|
|
829
882
|
setSelected(program.calendar[i][j]);
|
|
830
883
|
}
|
|
831
884
|
},
|
|
832
|
-
children: /* @__PURE__ */
|
|
885
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
833
886
|
Text,
|
|
834
887
|
{
|
|
835
888
|
variant: "body2",
|
|
@@ -838,15 +891,15 @@ var Calendar = ({ onSelect, propsComponent = initalPropsComponent, mapCalendar,
|
|
|
838
891
|
}
|
|
839
892
|
)
|
|
840
893
|
},
|
|
841
|
-
j
|
|
894
|
+
`day-${i}-${j}`
|
|
842
895
|
)) }, i))
|
|
843
896
|
] })
|
|
844
897
|
] });
|
|
845
898
|
};
|
|
846
899
|
|
|
847
900
|
// src/components/Checkbox/Checkbox.tsx
|
|
848
|
-
|
|
849
|
-
|
|
901
|
+
var React4 = __toESM(require("react"), 1);
|
|
902
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
850
903
|
var Checkbox = ({
|
|
851
904
|
checked,
|
|
852
905
|
defaultChecked,
|
|
@@ -868,8 +921,8 @@ var Checkbox = ({
|
|
|
868
921
|
const classes = bemClasse(void 0, { color: `color-${color}`, disabled, variant: `variant-${variant}` });
|
|
869
922
|
const boxClasses = bem("yr3Checkbox-box");
|
|
870
923
|
const classesBox = boxClasses(void 0, { checked: !!value });
|
|
871
|
-
return /* @__PURE__ */
|
|
872
|
-
/* @__PURE__ */
|
|
924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: classes, style: uiStyle(propsComponent?.checkbox?.ui), "data-testid": "yr3Checkbox", children: [
|
|
925
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
873
926
|
"input",
|
|
874
927
|
{
|
|
875
928
|
type: "checkbox",
|
|
@@ -879,8 +932,8 @@ var Checkbox = ({
|
|
|
879
932
|
"data-testid": "yr3Checkbox-input"
|
|
880
933
|
}
|
|
881
934
|
),
|
|
882
|
-
/* @__PURE__ */
|
|
883
|
-
label && /* @__PURE__ */
|
|
935
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: classesBox, "data-testid": "yr3Checkbox-box" }),
|
|
936
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { variant: "caption", color: !value ? propsComponent?.content?.color : color, ...propsComponent?.content, children: label })
|
|
884
937
|
] });
|
|
885
938
|
};
|
|
886
939
|
|
|
@@ -914,9 +967,9 @@ var chipVariants = createVariants({
|
|
|
914
967
|
var chip_variants_default = chipVariants;
|
|
915
968
|
|
|
916
969
|
// src/Icons/IconClose.tsx
|
|
917
|
-
|
|
970
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
918
971
|
var IconClose = (props) => {
|
|
919
|
-
return /* @__PURE__ */
|
|
972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { width: props.width || "64px", height: props.height || "64px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
920
973
|
"path",
|
|
921
974
|
{
|
|
922
975
|
d: "M16 16L12 12M12 12L8 8M12 12L16 8M12 12L8 16",
|
|
@@ -929,10 +982,10 @@ var IconClose = (props) => {
|
|
|
929
982
|
};
|
|
930
983
|
|
|
931
984
|
// src/components/Chip/Chip.tsx
|
|
932
|
-
|
|
985
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
933
986
|
var Chip = ({ label, variant, color, icon, onDelete, rounded, size = "medium", ui, style, ...props }) => {
|
|
934
987
|
const className = chip_variants_default({ variant, colors: color, rounded, size });
|
|
935
|
-
return /* @__PURE__ */
|
|
988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
936
989
|
"div",
|
|
937
990
|
{
|
|
938
991
|
className,
|
|
@@ -944,16 +997,16 @@ var Chip = ({ label, variant, color, icon, onDelete, rounded, size = "medium", u
|
|
|
944
997
|
},
|
|
945
998
|
children: [
|
|
946
999
|
icon,
|
|
947
|
-
/* @__PURE__ */
|
|
948
|
-
onDelete && /* @__PURE__ */
|
|
1000
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "yr3Chip__label", children: label }),
|
|
1001
|
+
onDelete && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "yr3Chip__delete", onClick: onDelete, role: "button", "aria-label": "delete", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IconClose, { width: 20, height: 20, stroke: color }) })
|
|
949
1002
|
]
|
|
950
1003
|
}
|
|
951
1004
|
);
|
|
952
1005
|
};
|
|
953
1006
|
|
|
954
1007
|
// src/components/Collapse/Collapse.tsx
|
|
955
|
-
|
|
956
|
-
|
|
1008
|
+
var React5 = __toESM(require("react"), 1);
|
|
1009
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
957
1010
|
var Collapse = ({ children, open, anchor }) => {
|
|
958
1011
|
const ref = React5.useRef(null);
|
|
959
1012
|
const [height, setHeight] = React5.useState(0);
|
|
@@ -966,11 +1019,11 @@ var Collapse = ({ children, open, anchor }) => {
|
|
|
966
1019
|
}
|
|
967
1020
|
}
|
|
968
1021
|
}, [open, children]);
|
|
969
|
-
return /* @__PURE__ */
|
|
1022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: `yr3Collapse yr3Collapse--${anchor}`, style: { height }, "data-testid": "yr3Collapse", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ref, className: "yr3Collapse__inner", children }) });
|
|
970
1023
|
};
|
|
971
1024
|
|
|
972
1025
|
// src/components/Container/Container.tsx
|
|
973
|
-
|
|
1026
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
974
1027
|
var Container = ({
|
|
975
1028
|
children,
|
|
976
1029
|
maxWidth = "sm",
|
|
@@ -980,7 +1033,7 @@ var Container = ({
|
|
|
980
1033
|
}) => {
|
|
981
1034
|
const containerClassName = bem("yr3Container");
|
|
982
1035
|
const classes = containerClassName(void 0, { maxWidth, static: fixed });
|
|
983
|
-
return /* @__PURE__ */
|
|
1036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
984
1037
|
"div",
|
|
985
1038
|
{
|
|
986
1039
|
className: classes,
|
|
@@ -992,12 +1045,12 @@ var Container = ({
|
|
|
992
1045
|
};
|
|
993
1046
|
|
|
994
1047
|
// src/theme/controlContext.tsx
|
|
995
|
-
|
|
1048
|
+
var React6 = __toESM(require("react"), 1);
|
|
996
1049
|
var ControlContext = React6.createContext(null);
|
|
997
1050
|
var useControl = () => React6.useContext(ControlContext);
|
|
998
1051
|
|
|
999
1052
|
// src/components/Control/Control.tsx
|
|
1000
|
-
|
|
1053
|
+
var React7 = __toESM(require("react"), 1);
|
|
1001
1054
|
|
|
1002
1055
|
// src/components/Control/control.variants.ts
|
|
1003
1056
|
var controlVariants = createVariants({
|
|
@@ -1039,7 +1092,7 @@ var controlVariants = createVariants({
|
|
|
1039
1092
|
});
|
|
1040
1093
|
|
|
1041
1094
|
// src/components/Control/Control.tsx
|
|
1042
|
-
|
|
1095
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1043
1096
|
var Control = ({
|
|
1044
1097
|
children,
|
|
1045
1098
|
error = false,
|
|
@@ -1058,7 +1111,7 @@ var Control = ({
|
|
|
1058
1111
|
disabled
|
|
1059
1112
|
};
|
|
1060
1113
|
const classes = controlVariants({ variant, color, label });
|
|
1061
|
-
return /* @__PURE__ */
|
|
1114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ControlContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1062
1115
|
"div",
|
|
1063
1116
|
{
|
|
1064
1117
|
className: classes,
|
|
@@ -1100,7 +1153,7 @@ var dividerVariants = createVariants({
|
|
|
1100
1153
|
var dividerVariants_default = dividerVariants;
|
|
1101
1154
|
|
|
1102
1155
|
// src/components/Divider/Divider.tsx
|
|
1103
|
-
|
|
1156
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1104
1157
|
var Divider = ({
|
|
1105
1158
|
orientation = "horizontal",
|
|
1106
1159
|
text: text2,
|
|
@@ -1110,14 +1163,14 @@ var Divider = ({
|
|
|
1110
1163
|
color = "primary"
|
|
1111
1164
|
}) => {
|
|
1112
1165
|
const classname = dividerVariants_default({ orientation, align, withText: !!text2, color });
|
|
1113
|
-
return /* @__PURE__ */
|
|
1166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: classname, style: composeStyles(ui, style), "data-testid": "yr3Divider", children: text2 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "yr3Divider--text", "data-testid": "yr3Divider-text", children: text2 }) });
|
|
1114
1167
|
};
|
|
1115
1168
|
|
|
1116
1169
|
// src/components/Drawer/Drawer.tsx
|
|
1117
|
-
|
|
1170
|
+
var React8 = __toESM(require("react"), 1);
|
|
1118
1171
|
|
|
1119
1172
|
// src/components/Drawer/DrawerContainer.tsx
|
|
1120
|
-
|
|
1173
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1121
1174
|
var DrawerContainer = ({ children, ui, style, props, onClose }) => {
|
|
1122
1175
|
const { hide } = useBackdrop();
|
|
1123
1176
|
const handleClose = () => {
|
|
@@ -1127,14 +1180,14 @@ var DrawerContainer = ({ children, ui, style, props, onClose }) => {
|
|
|
1127
1180
|
}
|
|
1128
1181
|
return;
|
|
1129
1182
|
};
|
|
1130
|
-
return /* @__PURE__ */
|
|
1183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "yr3Drawer--container", style: composeStyles(ui, style), onClick: handleClose, "data-testid": "yr3Drawer-container", children });
|
|
1131
1184
|
};
|
|
1132
1185
|
var DrawerContainer_default = DrawerContainer;
|
|
1133
1186
|
|
|
1134
1187
|
// src/hooks/useClickAway.ts
|
|
1135
|
-
|
|
1188
|
+
var import_react = require("react");
|
|
1136
1189
|
var useClickAway = (ref, callback) => {
|
|
1137
|
-
|
|
1190
|
+
(0, import_react.useEffect)(() => {
|
|
1138
1191
|
const handleClick = (e) => {
|
|
1139
1192
|
if (!ref.current || ref.current.contains(e.target)) return;
|
|
1140
1193
|
callback();
|
|
@@ -1147,7 +1200,7 @@ var useClickAway = (ref, callback) => {
|
|
|
1147
1200
|
};
|
|
1148
1201
|
|
|
1149
1202
|
// src/components/Drawer/Drawer.tsx
|
|
1150
|
-
|
|
1203
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1151
1204
|
var Drawer = ({ open, anchor = null, onClose, children, propsComponent }) => {
|
|
1152
1205
|
const { show, hide } = useBackdrop();
|
|
1153
1206
|
const ref = React8.useRef(null);
|
|
@@ -1170,7 +1223,7 @@ var Drawer = ({ open, anchor = null, onClose, children, propsComponent }) => {
|
|
|
1170
1223
|
onClose();
|
|
1171
1224
|
}
|
|
1172
1225
|
}, [propsComponent?.onClose]);
|
|
1173
|
-
return /* @__PURE__ */
|
|
1226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1174
1227
|
"div",
|
|
1175
1228
|
{
|
|
1176
1229
|
className: `yr3Drawer ${anchor && `yr3Drawer--${anchor}`} ${open && "yr3Drawer--open"}`,
|
|
@@ -1178,13 +1231,13 @@ var Drawer = ({ open, anchor = null, onClose, children, propsComponent }) => {
|
|
|
1178
1231
|
onClick: (e) => e.stopPropagation(),
|
|
1179
1232
|
ref,
|
|
1180
1233
|
"data-testid": "yr3Drawer",
|
|
1181
|
-
children: /* @__PURE__ */
|
|
1234
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1182
1235
|
DrawerContainer_default,
|
|
1183
1236
|
{
|
|
1184
1237
|
children,
|
|
1185
1238
|
...propsComponent?.container,
|
|
1186
1239
|
props: propsComponent?.closing,
|
|
1187
|
-
onClose: () => propsComponent?.closing === "container" ? onClose() :
|
|
1240
|
+
onClose: () => propsComponent?.closing === "container" ? onClose() : {}
|
|
1188
1241
|
}
|
|
1189
1242
|
)
|
|
1190
1243
|
},
|
|
@@ -1193,8 +1246,8 @@ var Drawer = ({ open, anchor = null, onClose, children, propsComponent }) => {
|
|
|
1193
1246
|
};
|
|
1194
1247
|
|
|
1195
1248
|
// src/components/Fade/Fade.tsx
|
|
1196
|
-
|
|
1197
|
-
|
|
1249
|
+
var React9 = __toESM(require("react"), 1);
|
|
1250
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1198
1251
|
var Fade = ({
|
|
1199
1252
|
in: inProp,
|
|
1200
1253
|
children,
|
|
@@ -1211,7 +1264,7 @@ var Fade = ({
|
|
|
1211
1264
|
}
|
|
1212
1265
|
return () => clearTimeout(timeoutId);
|
|
1213
1266
|
}, [inProp, duration, onTransitionEnd]);
|
|
1214
|
-
return /* @__PURE__ */
|
|
1267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1215
1268
|
"div",
|
|
1216
1269
|
{
|
|
1217
1270
|
className: `yr3Fade ${inProp ? "yr3Fade--in" : ""}`,
|
|
@@ -1222,8 +1275,107 @@ var Fade = ({
|
|
|
1222
1275
|
);
|
|
1223
1276
|
};
|
|
1224
1277
|
|
|
1278
|
+
// src/components/Flex/flex.variants.ts
|
|
1279
|
+
var flexVariants = createVariants({
|
|
1280
|
+
base: "yr3Flex",
|
|
1281
|
+
variants: {
|
|
1282
|
+
variant: {
|
|
1283
|
+
row: "yr3Flex--row",
|
|
1284
|
+
column: "yr3Flex--column",
|
|
1285
|
+
wrap: "yr3Flex--wrap"
|
|
1286
|
+
},
|
|
1287
|
+
container: {
|
|
1288
|
+
true: "yr3Flex--container"
|
|
1289
|
+
},
|
|
1290
|
+
center: {
|
|
1291
|
+
true: "yr3Flex--center"
|
|
1292
|
+
},
|
|
1293
|
+
between: {
|
|
1294
|
+
true: "yr3Flex--between"
|
|
1295
|
+
},
|
|
1296
|
+
bordered: {
|
|
1297
|
+
true: "yr3Flex--bordered"
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
});
|
|
1301
|
+
var flex_variants_default = flexVariants;
|
|
1302
|
+
|
|
1303
|
+
// src/components/Flex/Flex.tsx
|
|
1304
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1305
|
+
var Flex = ({
|
|
1306
|
+
container = false,
|
|
1307
|
+
spacing: spacing2 = 1,
|
|
1308
|
+
children,
|
|
1309
|
+
ui,
|
|
1310
|
+
gap,
|
|
1311
|
+
variant = "column",
|
|
1312
|
+
center = false,
|
|
1313
|
+
between = false,
|
|
1314
|
+
style,
|
|
1315
|
+
bordered = false,
|
|
1316
|
+
...props
|
|
1317
|
+
}) => {
|
|
1318
|
+
const classes = flex_variants_default({ variant, container, center, between, bordered, spacing: spacing2 });
|
|
1319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1320
|
+
"div",
|
|
1321
|
+
{
|
|
1322
|
+
className: classes,
|
|
1323
|
+
style: composeStyles(ui, style),
|
|
1324
|
+
...props,
|
|
1325
|
+
"data-testid": "yr3Flex",
|
|
1326
|
+
children
|
|
1327
|
+
}
|
|
1328
|
+
);
|
|
1329
|
+
};
|
|
1330
|
+
|
|
1331
|
+
// src/components/Grid/Grid.tsx
|
|
1332
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1333
|
+
var Grid = ({
|
|
1334
|
+
container = false,
|
|
1335
|
+
spacing: spacing2 = 0,
|
|
1336
|
+
children,
|
|
1337
|
+
columns = 12,
|
|
1338
|
+
span = 1,
|
|
1339
|
+
ui,
|
|
1340
|
+
style,
|
|
1341
|
+
item = false,
|
|
1342
|
+
size = 0,
|
|
1343
|
+
center = false,
|
|
1344
|
+
...props
|
|
1345
|
+
}) => {
|
|
1346
|
+
if (item) {
|
|
1347
|
+
columns = 0;
|
|
1348
|
+
}
|
|
1349
|
+
if (container) {
|
|
1350
|
+
columns = 0;
|
|
1351
|
+
ui = {
|
|
1352
|
+
...ui,
|
|
1353
|
+
gridTemplateColumns: `repeat(${columns}, 1fr)`
|
|
1354
|
+
};
|
|
1355
|
+
}
|
|
1356
|
+
if (center) {
|
|
1357
|
+
ui = {
|
|
1358
|
+
...ui,
|
|
1359
|
+
justifyContent: "center",
|
|
1360
|
+
alignItems: "center"
|
|
1361
|
+
};
|
|
1362
|
+
}
|
|
1363
|
+
const classes = bem("yr3Grid");
|
|
1364
|
+
const className = classes(void 0, { container, [`spacing-${spacing2}`]: center, span: item && `Col-${size}` });
|
|
1365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1366
|
+
"div",
|
|
1367
|
+
{
|
|
1368
|
+
className,
|
|
1369
|
+
style: composeStyles(ui, style),
|
|
1370
|
+
"data-testid": "yr3Grid",
|
|
1371
|
+
...props,
|
|
1372
|
+
children
|
|
1373
|
+
}
|
|
1374
|
+
);
|
|
1375
|
+
};
|
|
1376
|
+
|
|
1225
1377
|
// src/components/Group/Group.tsx
|
|
1226
|
-
|
|
1378
|
+
var React10 = __toESM(require("react"), 1);
|
|
1227
1379
|
|
|
1228
1380
|
// src/components/Group/group.variants.ts
|
|
1229
1381
|
var groupVariants = createVariants({
|
|
@@ -1249,7 +1401,7 @@ var groupVariants = createVariants({
|
|
|
1249
1401
|
});
|
|
1250
1402
|
|
|
1251
1403
|
// src/components/Group/Group.tsx
|
|
1252
|
-
|
|
1404
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1253
1405
|
var initialComponents = {
|
|
1254
1406
|
group: {
|
|
1255
1407
|
ui: {},
|
|
@@ -1276,13 +1428,13 @@ var Group = ({
|
|
|
1276
1428
|
}
|
|
1277
1429
|
}, [value, isControlled]);
|
|
1278
1430
|
const classItems = bem("yr3Group--item");
|
|
1279
|
-
return /* @__PURE__ */
|
|
1431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1280
1432
|
"div",
|
|
1281
1433
|
{
|
|
1282
1434
|
className: groupVariants({ variant, color }),
|
|
1283
1435
|
"data-testid": "yr3Group",
|
|
1284
1436
|
style: composeStyles(propsComponent.group?.ui, propsComponent.group?.style),
|
|
1285
|
-
children: options.map((opt) => /* @__PURE__ */
|
|
1437
|
+
children: options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1286
1438
|
"div",
|
|
1287
1439
|
{
|
|
1288
1440
|
"data-testid": "yr3Group-item",
|
|
@@ -1298,14 +1450,14 @@ var Group = ({
|
|
|
1298
1450
|
};
|
|
1299
1451
|
|
|
1300
1452
|
// src/components/Image/Image.tsx
|
|
1301
|
-
|
|
1453
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1302
1454
|
var Image = ({
|
|
1303
1455
|
src,
|
|
1304
1456
|
alt = "",
|
|
1305
1457
|
ui,
|
|
1306
1458
|
style
|
|
1307
1459
|
}) => {
|
|
1308
|
-
return /* @__PURE__ */
|
|
1460
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1309
1461
|
"img",
|
|
1310
1462
|
{
|
|
1311
1463
|
src,
|
|
@@ -1318,15 +1470,15 @@ var Image = ({
|
|
|
1318
1470
|
};
|
|
1319
1471
|
|
|
1320
1472
|
// src/components/Input/Input.tsx
|
|
1321
|
-
|
|
1473
|
+
var React11 = __toESM(require("react"), 1);
|
|
1322
1474
|
|
|
1323
1475
|
// src/components/Label/Label.tsx
|
|
1324
|
-
|
|
1476
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1325
1477
|
var Label = ({ text: text2, children, className, color = "primary", ui, style }) => {
|
|
1326
1478
|
const classes = bem("yr3Label");
|
|
1327
1479
|
const classComponent = classes(void 0, { color: `color-${color}` });
|
|
1328
1480
|
const classnames = bemMerge(classComponent, className);
|
|
1329
|
-
return /* @__PURE__ */
|
|
1481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1330
1482
|
"span",
|
|
1331
1483
|
{
|
|
1332
1484
|
className: classnames,
|
|
@@ -1378,7 +1530,7 @@ var inputVariants = createVariants({
|
|
|
1378
1530
|
});
|
|
1379
1531
|
|
|
1380
1532
|
// src/components/Input/Input.tsx
|
|
1381
|
-
|
|
1533
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1382
1534
|
var initiaPropsComponent = {
|
|
1383
1535
|
label: {
|
|
1384
1536
|
display: true,
|
|
@@ -1433,8 +1585,8 @@ var Input = React11.forwardRef(
|
|
|
1433
1585
|
onChange?.(e, newValue);
|
|
1434
1586
|
};
|
|
1435
1587
|
const classes = inputVariants({ color, label: propsComponent?.label?.display });
|
|
1436
|
-
return /* @__PURE__ */
|
|
1437
|
-
propsComponent?.label?.display && /* @__PURE__ */
|
|
1588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Control, { variant, color, label: propsComponent?.label?.display, children: [
|
|
1589
|
+
propsComponent?.label?.display && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1438
1590
|
Label,
|
|
1439
1591
|
{
|
|
1440
1592
|
text: label || "",
|
|
@@ -1443,7 +1595,7 @@ var Input = React11.forwardRef(
|
|
|
1443
1595
|
...propsComponent.label
|
|
1444
1596
|
}
|
|
1445
1597
|
),
|
|
1446
|
-
/* @__PURE__ */
|
|
1598
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1447
1599
|
"input",
|
|
1448
1600
|
{
|
|
1449
1601
|
ref,
|
|
@@ -1459,36 +1611,36 @@ var Input = React11.forwardRef(
|
|
|
1459
1611
|
"data-testid": "yr3Input"
|
|
1460
1612
|
}
|
|
1461
1613
|
),
|
|
1462
|
-
/* @__PURE__ */
|
|
1614
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text, { variant: "helper", "data-testid": "yr3Input-helper", children: error || internalError || "" })
|
|
1463
1615
|
] });
|
|
1464
1616
|
}
|
|
1465
1617
|
);
|
|
1466
1618
|
|
|
1467
1619
|
// src/components/Input/InputPhone.tsx
|
|
1468
|
-
|
|
1620
|
+
var React14 = __toESM(require("react"), 1);
|
|
1469
1621
|
|
|
1470
1622
|
// src/components/Select/Selector.tsx
|
|
1471
|
-
|
|
1623
|
+
var React12 = __toESM(require("react"), 1);
|
|
1472
1624
|
|
|
1473
1625
|
// src/Icons/IconDown.tsx
|
|
1474
|
-
|
|
1626
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1475
1627
|
var IconDown = (props) => {
|
|
1476
|
-
return /* @__PURE__ */
|
|
1628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("svg", { width: props.width || "64px", height: props.height || "64px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "data-testid": "yr3Icons", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { d: "M7 10L12 15L17 10", stroke: props.stroke || "#fff", strokeWidth: props.strokeWidth || "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1477
1629
|
};
|
|
1478
1630
|
|
|
1479
1631
|
// src/components/Select/Selector.tsx
|
|
1480
|
-
|
|
1632
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1481
1633
|
var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconColor, icon }) => {
|
|
1482
1634
|
const [open, setOpen] = React12.useState(false);
|
|
1483
1635
|
const [valueState, setValueState] = React12.useState(value || defaultValue || null);
|
|
1484
1636
|
const ref = React12.useRef(null);
|
|
1485
1637
|
useClickAway(ref, () => setOpen(false));
|
|
1486
|
-
return /* @__PURE__ */
|
|
1487
|
-
/* @__PURE__ */
|
|
1488
|
-
/* @__PURE__ */
|
|
1638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "yr3Selector-wrapper", ref, children: [
|
|
1639
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: `yr3Selector ${open ? "yr3Selector--open" : ""}`, style: composeStyles(ui, style), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "yr3Selector--control", children: [
|
|
1640
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "yr3Selector--icon", onClick: () => setOpen((prev) => !prev), children: icon ? icon : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(IconDown, { stroke: `var(--color-${iconColor || "disabled"})`, width: 24, height: 24 }) }),
|
|
1489
1641
|
valueState
|
|
1490
1642
|
] }) }),
|
|
1491
|
-
open && /* @__PURE__ */
|
|
1643
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "yr3Select--menu", children: options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1492
1644
|
"div",
|
|
1493
1645
|
{
|
|
1494
1646
|
className: "yr3Select--option",
|
|
@@ -1518,19 +1670,19 @@ var Selector = ({ ui, style, options, name, value, defaultValue, onChange, iconC
|
|
|
1518
1670
|
var Selector_default = Selector;
|
|
1519
1671
|
|
|
1520
1672
|
// src/theme/ThemeProvider.tsx
|
|
1521
|
-
|
|
1522
|
-
|
|
1673
|
+
var React13 = __toESM(require("react"), 1);
|
|
1674
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1523
1675
|
var ThemeContext = React13.createContext(null);
|
|
1524
1676
|
var ThemeProvider = ({ theme, children }) => {
|
|
1525
1677
|
React13.useEffect(() => {
|
|
1526
1678
|
applyTheme(theme);
|
|
1527
1679
|
}, [theme]);
|
|
1528
|
-
return /* @__PURE__ */
|
|
1680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ThemeContext.Provider, { value: theme, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(BackdropProvider, { children }) });
|
|
1529
1681
|
};
|
|
1530
1682
|
var useTheme = () => React13.useContext(ThemeContext);
|
|
1531
1683
|
|
|
1532
1684
|
// src/components/Input/InputPhone.tsx
|
|
1533
|
-
|
|
1685
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1534
1686
|
var Phone = ({
|
|
1535
1687
|
name,
|
|
1536
1688
|
value,
|
|
@@ -1553,10 +1705,10 @@ var Phone = ({
|
|
|
1553
1705
|
};
|
|
1554
1706
|
onChange?.(event, full);
|
|
1555
1707
|
};
|
|
1556
|
-
return /* @__PURE__ */
|
|
1557
|
-
/* @__PURE__ */
|
|
1558
|
-
/* @__PURE__ */
|
|
1559
|
-
/* @__PURE__ */
|
|
1708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Control, { variant: "outlined", children: [
|
|
1709
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Label, { text: label, className: "yr3Input--active" }),
|
|
1710
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "yr3PhoneInput", "data-testid": "yr3Phone", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Flex, { variant: "row", container: true, center: true, children: [
|
|
1711
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1560
1712
|
Selector_default,
|
|
1561
1713
|
{
|
|
1562
1714
|
options: countries.map((c) => ({
|
|
@@ -1576,8 +1728,8 @@ var Phone = ({
|
|
|
1576
1728
|
style: propsComponent?.selector?.style
|
|
1577
1729
|
}
|
|
1578
1730
|
),
|
|
1579
|
-
/* @__PURE__ */
|
|
1580
|
-
/* @__PURE__ */
|
|
1731
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Divider, { orientation: "vertical", ...propsComponent?.divider }),
|
|
1732
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1581
1733
|
Input,
|
|
1582
1734
|
{
|
|
1583
1735
|
type: "phone",
|
|
@@ -1594,27 +1746,22 @@ var Phone = ({
|
|
|
1594
1746
|
] });
|
|
1595
1747
|
};
|
|
1596
1748
|
|
|
1597
|
-
// src/components/Input/InputPlaces.tsx
|
|
1598
|
-
import * as React15 from "react";
|
|
1599
|
-
import { useAutocompletePlaces } from "@yr3/autocomplete-places";
|
|
1600
|
-
import { jsx as jsx28, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1601
|
-
|
|
1602
1749
|
// src/components/Modal/Modal.tsx
|
|
1603
|
-
|
|
1750
|
+
var React15 = __toESM(require("react"), 1);
|
|
1604
1751
|
|
|
1605
1752
|
// src/components/Modal/ModalContainer.tsx
|
|
1606
|
-
|
|
1753
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1607
1754
|
var ModalContainer = ({ children, size = "sm", ui, style }) => {
|
|
1608
1755
|
const classes = bem("yr3Modal-container");
|
|
1609
1756
|
const classComponent = classes(void 0, { [`${size}`]: !!size });
|
|
1610
|
-
return /* @__PURE__ */
|
|
1757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: classComponent, style: composeStyles(ui, style), "data-testid": "yr3Modal-container", children });
|
|
1611
1758
|
};
|
|
1612
1759
|
|
|
1613
1760
|
// src/components/Modal/Modal.tsx
|
|
1614
|
-
|
|
1761
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1615
1762
|
var Modal = ({ open, onClose, children, propsComponent }) => {
|
|
1616
1763
|
const { show, hide } = useBackdrop();
|
|
1617
|
-
|
|
1764
|
+
React15.useEffect(() => {
|
|
1618
1765
|
if (open) {
|
|
1619
1766
|
show();
|
|
1620
1767
|
} else {
|
|
@@ -1623,9 +1770,9 @@ var Modal = ({ open, onClose, children, propsComponent }) => {
|
|
|
1623
1770
|
}, [open, show]);
|
|
1624
1771
|
const classes = bem("yr3Modal");
|
|
1625
1772
|
const classComponent = classes(void 0, { "open": !!open });
|
|
1626
|
-
return /* @__PURE__ */
|
|
1773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: classComponent, onClick: (e) => e.stopPropagation(), "data-testid": "yr3Modal", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ModalContainer, { ...propsComponent?.container, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Flex, { variant: "column", container: true, center: true, gap: 1, children: [
|
|
1627
1774
|
children,
|
|
1628
|
-
propsComponent?.close ? propsComponent.close : /* @__PURE__ */
|
|
1775
|
+
propsComponent?.close ? propsComponent.close : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button, { variant: "filled", color: "secondary", onClick: onClose, "data-testid": "yr3Modal-close", children: "Close" })
|
|
1629
1776
|
] }) }) });
|
|
1630
1777
|
};
|
|
1631
1778
|
|
|
@@ -1665,15 +1812,15 @@ var notistackVariants = createVariants({
|
|
|
1665
1812
|
});
|
|
1666
1813
|
|
|
1667
1814
|
// src/components/Notistack/Notistack.tsx
|
|
1668
|
-
|
|
1815
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1669
1816
|
var Notistack = ({ message, duration = 3e3, variant = "info", color, propsComponent, anchor, exiting = false }) => {
|
|
1670
1817
|
const classes = notistackVariants({ type: variant, color, exiting, direction: `${anchor?.vertical || "bottom"}-${anchor?.horizontal || "right"}` });
|
|
1671
1818
|
const containerStyle = composeStyles(propsComponent?.container?.ui, propsComponent?.container?.style);
|
|
1672
1819
|
const notistackStyle = composeStyles(propsComponent?.notistack?.ui, propsComponent?.notistack?.style);
|
|
1673
1820
|
const progressStyle = composeStyles(propsComponent?.progress?.ui, propsComponent?.progress?.style);
|
|
1674
|
-
return /* @__PURE__ */
|
|
1675
|
-
/* @__PURE__ */
|
|
1676
|
-
/* @__PURE__ */
|
|
1821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: classes, "data-testid": "yr3Notistack", style: notistackStyle, children: [
|
|
1822
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { style: containerStyle, children: message }),
|
|
1823
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1677
1824
|
"div",
|
|
1678
1825
|
{
|
|
1679
1826
|
className: "yr3Notistack--progress",
|
|
@@ -1707,7 +1854,7 @@ var pendingVariants = createVariants({
|
|
|
1707
1854
|
});
|
|
1708
1855
|
|
|
1709
1856
|
// src/components/Pending/Pending.tsx
|
|
1710
|
-
|
|
1857
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1711
1858
|
var Pending = ({
|
|
1712
1859
|
variant,
|
|
1713
1860
|
width,
|
|
@@ -1720,7 +1867,7 @@ var Pending = ({
|
|
|
1720
1867
|
const widthStyle = variant === "circle" ? size : width;
|
|
1721
1868
|
const heightStyle = variant === "circle" ? size : height;
|
|
1722
1869
|
const uiStylePending = uiStyle({ width: widthStyle, height: heightStyle, ...ui });
|
|
1723
|
-
return /* @__PURE__ */
|
|
1870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1724
1871
|
"div",
|
|
1725
1872
|
{
|
|
1726
1873
|
className: pendingVariants({ variant, color }),
|
|
@@ -1749,7 +1896,7 @@ var radioVariant = createVariants({
|
|
|
1749
1896
|
});
|
|
1750
1897
|
|
|
1751
1898
|
// src/components/Radio/Radio.tsx
|
|
1752
|
-
|
|
1899
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1753
1900
|
var Radio = ({
|
|
1754
1901
|
checked,
|
|
1755
1902
|
value,
|
|
@@ -1765,8 +1912,8 @@ var Radio = ({
|
|
|
1765
1912
|
const bemClass = bem("yr3Radio");
|
|
1766
1913
|
const classes = bemClass(void 0, { [color]: `color-${color}` });
|
|
1767
1914
|
const variantClass = radioVariant({ variant });
|
|
1768
|
-
return /* @__PURE__ */
|
|
1769
|
-
/* @__PURE__ */
|
|
1915
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { className: classes, "data-testid": "yr3Radio", style: composeStyles(propsComponent?.radio?.ui, propsComponent?.radio?.style), children: [
|
|
1916
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1770
1917
|
"input",
|
|
1771
1918
|
{
|
|
1772
1919
|
type: "radio",
|
|
@@ -1778,8 +1925,8 @@ var Radio = ({
|
|
|
1778
1925
|
}
|
|
1779
1926
|
),
|
|
1780
1927
|
iconChecked && checked ? iconChecked : !checked && iconUnchecked ? iconUnchecked : null,
|
|
1781
|
-
!iconChecked && !iconUnchecked && /* @__PURE__ */
|
|
1782
|
-
typeof label === "string" && /* @__PURE__ */
|
|
1928
|
+
!iconChecked && !iconUnchecked && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: variantClass, "data-testid": "yr3Radio-dot" }),
|
|
1929
|
+
typeof label === "string" && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1783
1930
|
"span",
|
|
1784
1931
|
{
|
|
1785
1932
|
className: "yr3Radio--label",
|
|
@@ -1792,15 +1939,15 @@ var Radio = ({
|
|
|
1792
1939
|
};
|
|
1793
1940
|
|
|
1794
1941
|
// src/components/Select/Select.tsx
|
|
1795
|
-
|
|
1796
|
-
|
|
1942
|
+
var React16 = __toESM(require("react"), 1);
|
|
1943
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1797
1944
|
var Select = ({ label, options, name, value, defaultValue, onChange, propsComponent }) => {
|
|
1798
|
-
const [open, setOpen] =
|
|
1799
|
-
const [valueState, setValueState] =
|
|
1800
|
-
const ref =
|
|
1945
|
+
const [open, setOpen] = React16.useState(false);
|
|
1946
|
+
const [valueState, setValueState] = React16.useState(value || defaultValue || null);
|
|
1947
|
+
const ref = React16.useRef(null);
|
|
1801
1948
|
useClickAway(ref, () => setOpen(false));
|
|
1802
|
-
return /* @__PURE__ */
|
|
1803
|
-
/* @__PURE__ */
|
|
1949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Control, { ...propsComponent?.control, children: [
|
|
1950
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1804
1951
|
Label,
|
|
1805
1952
|
{
|
|
1806
1953
|
...propsComponent?.label,
|
|
@@ -1808,10 +1955,10 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
1808
1955
|
className: open || valueState ? "yr3Input--active" : ""
|
|
1809
1956
|
}
|
|
1810
1957
|
),
|
|
1811
|
-
/* @__PURE__ */
|
|
1812
|
-
/* @__PURE__ */
|
|
1813
|
-
/* @__PURE__ */
|
|
1814
|
-
/* @__PURE__ */
|
|
1958
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "yr3Select-wrapper", ref, children: [
|
|
1959
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: `yr3Select ${open ? "yr3Select--open" : ""}`, "data-testid": "yr3Select-wrapper", style: composeStyles(propsComponent?.wrapper?.ui, propsComponent?.wrapper?.style), children: [
|
|
1960
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "yr3Select--control", children: valueState }),
|
|
1961
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "yr3Select--icon", onClick: () => setOpen((prev) => !prev), "data-testid": "yr3Select-icon", children: propsComponent?.icon?.component ? propsComponent.icon.component : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1815
1962
|
IconDown,
|
|
1816
1963
|
{
|
|
1817
1964
|
width: propsComponent?.icon?.style?.width || 26,
|
|
@@ -1821,13 +1968,13 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
1821
1968
|
}
|
|
1822
1969
|
) })
|
|
1823
1970
|
] }),
|
|
1824
|
-
open && /* @__PURE__ */
|
|
1971
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1825
1972
|
"div",
|
|
1826
1973
|
{
|
|
1827
1974
|
className: "yr3Select--menu",
|
|
1828
1975
|
style: composeStyles(propsComponent?.menu?.ui, propsComponent?.menu?.style),
|
|
1829
1976
|
"data-testid": "yr3Select-menu",
|
|
1830
|
-
children: options.map((opt) => /* @__PURE__ */
|
|
1977
|
+
children: options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1831
1978
|
"div",
|
|
1832
1979
|
{
|
|
1833
1980
|
className: "yr3Select--option",
|
|
@@ -1859,8 +2006,8 @@ var Select = ({ label, options, name, value, defaultValue, onChange, propsCompon
|
|
|
1859
2006
|
};
|
|
1860
2007
|
|
|
1861
2008
|
// src/components/Slide/Slide.tsx
|
|
1862
|
-
|
|
1863
|
-
|
|
2009
|
+
var React17 = __toESM(require("react"), 1);
|
|
2010
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1864
2011
|
var Slide = ({
|
|
1865
2012
|
in: inProp,
|
|
1866
2013
|
children,
|
|
@@ -1874,7 +2021,7 @@ var Slide = ({
|
|
|
1874
2021
|
[direction]: true,
|
|
1875
2022
|
"in": !!inProp
|
|
1876
2023
|
});
|
|
1877
|
-
|
|
2024
|
+
React17.useEffect(() => {
|
|
1878
2025
|
let timeoutId;
|
|
1879
2026
|
if (inProp) {
|
|
1880
2027
|
timeoutId = setTimeout(() => {
|
|
@@ -1884,19 +2031,19 @@ var Slide = ({
|
|
|
1884
2031
|
return () => clearTimeout(timeoutId);
|
|
1885
2032
|
}, [inProp, duration, onTransitionEnd]);
|
|
1886
2033
|
const uiStyleContent = uiStyle({ ...propsComponent?.slide?.ui, transitionDuration: `${duration}ms` });
|
|
1887
|
-
return /* @__PURE__ */
|
|
2034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1888
2035
|
"div",
|
|
1889
2036
|
{
|
|
1890
2037
|
className: "yr3Slide",
|
|
1891
2038
|
style: uiStyle({ position: "relative", zIndex: 4, overflow: "hidden" }),
|
|
1892
2039
|
"data-testid": "yr3Slide",
|
|
1893
|
-
children: /* @__PURE__ */
|
|
2040
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1894
2041
|
"div",
|
|
1895
2042
|
{
|
|
1896
2043
|
className: classNameContent,
|
|
1897
2044
|
style: composeStyles(uiStyleContent, propsComponent?.slide?.style || {}),
|
|
1898
2045
|
"data-testid": "yr3Slide-content",
|
|
1899
|
-
children: /* @__PURE__ */
|
|
2046
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Box, { ...propsComponent?.box, "data-testid": "yr3Slide-box", children })
|
|
1900
2047
|
}
|
|
1901
2048
|
)
|
|
1902
2049
|
}
|
|
@@ -1904,7 +2051,7 @@ var Slide = ({
|
|
|
1904
2051
|
};
|
|
1905
2052
|
|
|
1906
2053
|
// src/components/Switch/Switch.tsx
|
|
1907
|
-
|
|
2054
|
+
var React18 = __toESM(require("react"), 1);
|
|
1908
2055
|
|
|
1909
2056
|
// src/components/Switch/switch.variants.ts
|
|
1910
2057
|
var switchVariants = createVariants({
|
|
@@ -1933,7 +2080,7 @@ var switchVariants = createVariants({
|
|
|
1933
2080
|
});
|
|
1934
2081
|
|
|
1935
2082
|
// src/components/Switch/Switch.tsx
|
|
1936
|
-
|
|
2083
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1937
2084
|
var Switch = ({
|
|
1938
2085
|
checked,
|
|
1939
2086
|
defaultChecked,
|
|
@@ -1943,7 +2090,7 @@ var Switch = ({
|
|
|
1943
2090
|
size = "sm",
|
|
1944
2091
|
label
|
|
1945
2092
|
}) => {
|
|
1946
|
-
const [internal, setInternal] =
|
|
2093
|
+
const [internal, setInternal] = React18.useState(defaultChecked || false);
|
|
1947
2094
|
const classname = switchVariants({ colors: color, size, disabled: !!disabled, checked: checked ?? internal });
|
|
1948
2095
|
const isControlled = checked !== void 0;
|
|
1949
2096
|
const value = isControlled ? checked : internal;
|
|
@@ -1951,13 +2098,13 @@ var Switch = ({
|
|
|
1951
2098
|
if (!isControlled) setInternal(e.target.checked);
|
|
1952
2099
|
onChange?.(e, e.target.checked);
|
|
1953
2100
|
};
|
|
1954
|
-
return /* @__PURE__ */
|
|
2101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
1955
2102
|
"label",
|
|
1956
2103
|
{
|
|
1957
2104
|
className: classname,
|
|
1958
2105
|
"data-testid": "yr3Switch",
|
|
1959
2106
|
children: [
|
|
1960
|
-
/* @__PURE__ */
|
|
2107
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1961
2108
|
"input",
|
|
1962
2109
|
{
|
|
1963
2110
|
type: "checkbox",
|
|
@@ -1966,17 +2113,17 @@ var Switch = ({
|
|
|
1966
2113
|
disabled
|
|
1967
2114
|
}
|
|
1968
2115
|
),
|
|
1969
|
-
/* @__PURE__ */
|
|
1970
|
-
/* @__PURE__ */
|
|
2116
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "yr3Switch--track", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "yr3Switch--thumb" }) }),
|
|
2117
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "yr3Switch--label", "data-testid": "yr3Switch-label", children: label })
|
|
1971
2118
|
]
|
|
1972
2119
|
}
|
|
1973
2120
|
);
|
|
1974
2121
|
};
|
|
1975
2122
|
|
|
1976
2123
|
// src/Icons/IconSearch.tsx
|
|
1977
|
-
|
|
2124
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1978
2125
|
var IconSearch = (props) => {
|
|
1979
|
-
return /* @__PURE__ */
|
|
2126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("svg", { width: props.width || "64px", height: props.height || "64px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1980
2127
|
"path",
|
|
1981
2128
|
{
|
|
1982
2129
|
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",
|
|
@@ -2007,11 +2154,11 @@ var baseTokens = {
|
|
|
2007
2154
|
};
|
|
2008
2155
|
|
|
2009
2156
|
// src/theme/notistackContext.tsx
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
var NotistackContext =
|
|
2157
|
+
var React19 = __toESM(require("react"), 1);
|
|
2158
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2159
|
+
var NotistackContext = React19.createContext(null);
|
|
2013
2160
|
var NotistackProvider = ({ children }) => {
|
|
2014
|
-
const [snacks, setSnacks] =
|
|
2161
|
+
const [snacks, setSnacks] = React19.useState([]);
|
|
2015
2162
|
const enqueueNotistack = (snack) => {
|
|
2016
2163
|
const id = Date.now();
|
|
2017
2164
|
setSnacks((prev) => [...prev, { ...snack, id, exiting: false }]);
|
|
@@ -2026,23 +2173,23 @@ var NotistackProvider = ({ children }) => {
|
|
|
2026
2173
|
setSnacks((prev) => prev.filter((s) => s.id !== id));
|
|
2027
2174
|
}, duration + exitDuration);
|
|
2028
2175
|
};
|
|
2029
|
-
return /* @__PURE__ */
|
|
2176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(NotistackContext.Provider, { value: { enqueueNotistack }, children: [
|
|
2030
2177
|
children,
|
|
2031
|
-
/* @__PURE__ */
|
|
2178
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "yr3NotistackContainer", children: snacks.map((snack) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Notistack, { ...snack }, snack.id)) })
|
|
2032
2179
|
] });
|
|
2033
2180
|
};
|
|
2034
|
-
var useNotistack = () =>
|
|
2181
|
+
var useNotistack = () => React19.useContext(NotistackContext);
|
|
2035
2182
|
|
|
2036
2183
|
// src/theme/useMediaQuery.tsx
|
|
2037
|
-
|
|
2184
|
+
var React20 = __toESM(require("react"), 1);
|
|
2038
2185
|
function useMediaQuery(query) {
|
|
2039
2186
|
const theme = useTheme();
|
|
2040
2187
|
const computedQuery = typeof query === "function" ? query(theme) : query;
|
|
2041
|
-
const [matches, setMatches] =
|
|
2188
|
+
const [matches, setMatches] = React20.useState(() => {
|
|
2042
2189
|
if (typeof window === "undefined") return false;
|
|
2043
2190
|
return window.matchMedia(computedQuery).matches;
|
|
2044
2191
|
});
|
|
2045
|
-
|
|
2192
|
+
React20.useEffect(() => {
|
|
2046
2193
|
if (typeof window === "undefined") return;
|
|
2047
2194
|
const media = window.matchMedia(computedQuery);
|
|
2048
2195
|
const listener = () => setMatches(media.matches);
|
|
@@ -2067,7 +2214,8 @@ function useBreakpointValue(values) {
|
|
|
2067
2214
|
|
|
2068
2215
|
// src/index.ts
|
|
2069
2216
|
initTheme();
|
|
2070
|
-
export
|
|
2217
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
2218
|
+
0 && (module.exports = {
|
|
2071
2219
|
Avatar,
|
|
2072
2220
|
Backdrop,
|
|
2073
2221
|
BackdropContext,
|
|
@@ -2131,4 +2279,4 @@ export {
|
|
|
2131
2279
|
useMediaQuery,
|
|
2132
2280
|
useNotistack,
|
|
2133
2281
|
useTheme
|
|
2134
|
-
};
|
|
2282
|
+
});
|