@app-studio/web 0.3.40 → 0.3.42
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/Button/Button/Button.props.d.ts +1 -1
- package/dist/web.cjs.development.js +250 -254
- package/dist/web.cjs.development.js.map +1 -1
- package/dist/web.cjs.production.min.js +1 -1
- package/dist/web.cjs.production.min.js.map +1 -1
- package/dist/web.esm.js +252 -256
- package/dist/web.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/web.esm.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import React, { useState,
|
|
2
|
-
import { View as View$1, Element,
|
|
1
|
+
import React, { useState, useEffect, useRef, useMemo, useCallback, Fragment } from 'react';
|
|
2
|
+
import { View as View$1, Element, useTheme, Typography, Input, Image } from 'app-studio';
|
|
3
3
|
import { Link as Link$1 } from 'react-router-dom';
|
|
4
|
-
import { Loader as Loader$1 } from 'src/components/Loader/Loader';
|
|
5
|
-
import { Horizontal as Horizontal$1 } from 'src/components/Layout/Horizontal/Horizontal';
|
|
6
4
|
import format from 'date-fns/format';
|
|
7
5
|
import { create } from 'zustand';
|
|
8
6
|
|
|
@@ -563,7 +561,210 @@ var IconSizes$1 = {
|
|
|
563
561
|
}
|
|
564
562
|
};
|
|
565
563
|
|
|
566
|
-
var
|
|
564
|
+
var DefaultSizes = {
|
|
565
|
+
xs: 14,
|
|
566
|
+
sm: 18,
|
|
567
|
+
md: 22,
|
|
568
|
+
lg: 26,
|
|
569
|
+
xl: 30,
|
|
570
|
+
'2xl': 40,
|
|
571
|
+
'3xl': 50,
|
|
572
|
+
'4xl': 60,
|
|
573
|
+
'5xl': 70,
|
|
574
|
+
'6xl': 80
|
|
575
|
+
};
|
|
576
|
+
var DefaultSpeeds = {
|
|
577
|
+
fast: 50,
|
|
578
|
+
normal: 100,
|
|
579
|
+
slow: 300
|
|
580
|
+
};
|
|
581
|
+
|
|
582
|
+
var _excluded$b = ["size", "speed", "color"],
|
|
583
|
+
_excluded2 = ["size", "speed", "color"],
|
|
584
|
+
_excluded3 = ["size", "speed", "color"],
|
|
585
|
+
_excluded4 = ["size", "children", "textColor", "loaderColor", "type", "speed", "textPosition"];
|
|
586
|
+
var DefaultSpinner = function DefaultSpinner(_ref) {
|
|
587
|
+
var _ref$size = _ref.size,
|
|
588
|
+
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
589
|
+
_ref$speed = _ref.speed,
|
|
590
|
+
speed = _ref$speed === void 0 ? 'normal' : _ref$speed,
|
|
591
|
+
_ref$color = _ref.color,
|
|
592
|
+
color = _ref$color === void 0 ? 'theme.loading' : _ref$color,
|
|
593
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
|
594
|
+
var theme = useTheme();
|
|
595
|
+
var colorStyle = theme.getColor(color);
|
|
596
|
+
var sizeStyle = typeof size === 'number' ? size : DefaultSizes[size];
|
|
597
|
+
var _useState = useState(0),
|
|
598
|
+
angle = _useState[0],
|
|
599
|
+
setAngle = _useState[1];
|
|
600
|
+
useEffect(function () {
|
|
601
|
+
var intervalId = setInterval(function () {
|
|
602
|
+
setAngle(function (prevAngle) {
|
|
603
|
+
return prevAngle + 45;
|
|
604
|
+
});
|
|
605
|
+
}, DefaultSpeeds[speed]);
|
|
606
|
+
return function () {
|
|
607
|
+
return clearInterval(intervalId);
|
|
608
|
+
};
|
|
609
|
+
}, [speed]);
|
|
610
|
+
return React.createElement("svg", Object.assign({
|
|
611
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
612
|
+
width: sizeStyle + "px",
|
|
613
|
+
height: sizeStyle + "px",
|
|
614
|
+
viewBox: "0 0 24 24",
|
|
615
|
+
fill: "none",
|
|
616
|
+
stroke: colorStyle,
|
|
617
|
+
strokeWidth: "2",
|
|
618
|
+
strokeLinecap: "round",
|
|
619
|
+
strokeLinejoin: "round",
|
|
620
|
+
style: {
|
|
621
|
+
transform: "rotate(" + angle + "deg)"
|
|
622
|
+
}
|
|
623
|
+
}, props), React.createElement("g", {
|
|
624
|
+
id: "SVGRepo_bgCarrier",
|
|
625
|
+
strokeWidth: "0"
|
|
626
|
+
}), React.createElement("g", {
|
|
627
|
+
id: "SVGRepo_tracerCarrier",
|
|
628
|
+
strokeLinecap: "round",
|
|
629
|
+
strokeLinejoin: "round"
|
|
630
|
+
}), React.createElement("g", {
|
|
631
|
+
id: "SVGRepo_iconCarrier"
|
|
632
|
+
}, React.createElement("path", {
|
|
633
|
+
d: "M21 12a9 9 0 11-6.219-8.56"
|
|
634
|
+
})));
|
|
635
|
+
};
|
|
636
|
+
var Dotted = function Dotted(_ref2) {
|
|
637
|
+
var _ref2$size = _ref2.size,
|
|
638
|
+
size = _ref2$size === void 0 ? 'md' : _ref2$size,
|
|
639
|
+
_ref2$speed = _ref2.speed,
|
|
640
|
+
speed = _ref2$speed === void 0 ? 'normal' : _ref2$speed,
|
|
641
|
+
_ref2$color = _ref2.color,
|
|
642
|
+
color = _ref2$color === void 0 ? 'theme.loading' : _ref2$color,
|
|
643
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
644
|
+
var theme = useTheme();
|
|
645
|
+
var colorStyle = theme.getColor(color);
|
|
646
|
+
var sizeStyle = typeof size === 'number' ? size : DefaultSizes[size];
|
|
647
|
+
var _useState2 = useState(0),
|
|
648
|
+
angle = _useState2[0],
|
|
649
|
+
setAngle = _useState2[1];
|
|
650
|
+
useEffect(function () {
|
|
651
|
+
var intervalId = setInterval(function () {
|
|
652
|
+
setAngle(function (prevAngle) {
|
|
653
|
+
return prevAngle + 45;
|
|
654
|
+
});
|
|
655
|
+
}, DefaultSpeeds[speed]);
|
|
656
|
+
return function () {
|
|
657
|
+
return clearInterval(intervalId);
|
|
658
|
+
};
|
|
659
|
+
}, [speed]);
|
|
660
|
+
return React.createElement("svg", Object.assign({
|
|
661
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
662
|
+
viewBox: "0 0 50 50",
|
|
663
|
+
width: sizeStyle + "px",
|
|
664
|
+
height: sizeStyle + "px",
|
|
665
|
+
style: {
|
|
666
|
+
transform: "rotate(" + angle + "deg)"
|
|
667
|
+
}
|
|
668
|
+
}, props), React.createElement("circle", {
|
|
669
|
+
cx: "10",
|
|
670
|
+
cy: "25",
|
|
671
|
+
r: "4",
|
|
672
|
+
fill: colorStyle
|
|
673
|
+
}), React.createElement("circle", {
|
|
674
|
+
cx: "25",
|
|
675
|
+
cy: "25",
|
|
676
|
+
r: "4",
|
|
677
|
+
fill: colorStyle
|
|
678
|
+
}), React.createElement("circle", {
|
|
679
|
+
cx: "40",
|
|
680
|
+
cy: "25",
|
|
681
|
+
r: "4",
|
|
682
|
+
fill: colorStyle
|
|
683
|
+
}));
|
|
684
|
+
};
|
|
685
|
+
var Quarter = function Quarter(_ref3) {
|
|
686
|
+
var _ref3$size = _ref3.size,
|
|
687
|
+
size = _ref3$size === void 0 ? 'md' : _ref3$size,
|
|
688
|
+
_ref3$speed = _ref3.speed,
|
|
689
|
+
speed = _ref3$speed === void 0 ? 'normal' : _ref3$speed,
|
|
690
|
+
_ref3$color = _ref3.color,
|
|
691
|
+
color = _ref3$color === void 0 ? 'theme.loading' : _ref3$color,
|
|
692
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded3);
|
|
693
|
+
var theme = useTheme();
|
|
694
|
+
var colorStyle = theme.getColor(color);
|
|
695
|
+
var sizeStyle = typeof size === 'number' ? size : DefaultSizes[size];
|
|
696
|
+
var _useState3 = useState(0),
|
|
697
|
+
angle = _useState3[0],
|
|
698
|
+
setAngle = _useState3[1];
|
|
699
|
+
useEffect(function () {
|
|
700
|
+
var intervalId = setInterval(function () {
|
|
701
|
+
setAngle(function (prevAngle) {
|
|
702
|
+
return prevAngle + 45;
|
|
703
|
+
});
|
|
704
|
+
}, DefaultSpeeds[speed]);
|
|
705
|
+
return function () {
|
|
706
|
+
return clearInterval(intervalId);
|
|
707
|
+
};
|
|
708
|
+
}, [speed]);
|
|
709
|
+
return React.createElement("svg", Object.assign({
|
|
710
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
711
|
+
viewBox: "0 0 50 50",
|
|
712
|
+
width: sizeStyle + "px",
|
|
713
|
+
height: sizeStyle + "px",
|
|
714
|
+
style: {
|
|
715
|
+
transform: "rotate(" + angle + "deg)"
|
|
716
|
+
}
|
|
717
|
+
}, props), React.createElement("circle", {
|
|
718
|
+
cx: "25",
|
|
719
|
+
cy: "25",
|
|
720
|
+
r: "20",
|
|
721
|
+
fill: "none",
|
|
722
|
+
stroke: colorStyle,
|
|
723
|
+
strokeWidth: "5",
|
|
724
|
+
strokeDasharray: "1,10"
|
|
725
|
+
}));
|
|
726
|
+
};
|
|
727
|
+
var LoaderView = function LoaderView(_ref4) {
|
|
728
|
+
var size = _ref4.size,
|
|
729
|
+
children = _ref4.children,
|
|
730
|
+
textColor = _ref4.textColor,
|
|
731
|
+
loaderColor = _ref4.loaderColor,
|
|
732
|
+
_ref4$type = _ref4.type,
|
|
733
|
+
type = _ref4$type === void 0 ? 'default' : _ref4$type,
|
|
734
|
+
_ref4$speed = _ref4.speed,
|
|
735
|
+
speed = _ref4$speed === void 0 ? 'normal' : _ref4$speed,
|
|
736
|
+
_ref4$textPosition = _ref4.textPosition,
|
|
737
|
+
textPosition = _ref4$textPosition === void 0 ? 'right' : _ref4$textPosition,
|
|
738
|
+
props = _objectWithoutPropertiesLoose(_ref4, _excluded4);
|
|
739
|
+
var style = {
|
|
740
|
+
size: size,
|
|
741
|
+
speed: speed,
|
|
742
|
+
color: loaderColor
|
|
743
|
+
};
|
|
744
|
+
var variants = {
|
|
745
|
+
default: React.createElement(DefaultSpinner, Object.assign({}, style)),
|
|
746
|
+
dotted: React.createElement(Dotted, Object.assign({}, style)),
|
|
747
|
+
quarter: React.createElement(Quarter, Object.assign({}, style))
|
|
748
|
+
};
|
|
749
|
+
return React.createElement(Center, Object.assign({
|
|
750
|
+
gap: 10,
|
|
751
|
+
flexDirection: textPosition === 'top' || textPosition === 'bottom' ? 'column' : 'row'
|
|
752
|
+
}, props), (textPosition === 'left' || textPosition === 'top') && children && React.createElement(View, {
|
|
753
|
+
color: textColor
|
|
754
|
+
}, children), variants[type], (textPosition === 'right' || textPosition === 'bottom') && children && React.createElement(View, {
|
|
755
|
+
color: textColor
|
|
756
|
+
}, children));
|
|
757
|
+
};
|
|
758
|
+
|
|
759
|
+
var LoaderComponent = function LoaderComponent(props) {
|
|
760
|
+
return React.createElement(LoaderView, Object.assign({}, props));
|
|
761
|
+
};
|
|
762
|
+
/**
|
|
763
|
+
* It gives the user an insight about an action being processed. It may have an undefined waiting time or display the process length.
|
|
764
|
+
*/
|
|
765
|
+
var Loader = LoaderComponent;
|
|
766
|
+
|
|
767
|
+
var _excluded$c = ["icon", "shadow", "children", "ariaLabel", "externalHref", "isAuto", "isFilled", "isIconRounded", "isLoading", "isDisabled", "size", "variant", "iconPosition", "colorScheme", "shape", "onClick", "loaderProps", "loaderPosition"];
|
|
567
768
|
var ButtonView = function ButtonView(_ref) {
|
|
568
769
|
var _props$onClick;
|
|
569
770
|
var icon = _ref.icon,
|
|
@@ -597,7 +798,7 @@ var ButtonView = function ButtonView(_ref) {
|
|
|
597
798
|
loaderProps = _ref$loaderProps === void 0 ? {} : _ref$loaderProps,
|
|
598
799
|
_ref$loaderPosition = _ref.loaderPosition,
|
|
599
800
|
loaderPosition = _ref$loaderPosition === void 0 ? 'left' : _ref$loaderPosition,
|
|
600
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
801
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
|
601
802
|
var isActive = !(isDisabled || isLoading);
|
|
602
803
|
var defaultNativeProps = {
|
|
603
804
|
disabled: !isActive
|
|
@@ -635,9 +836,9 @@ var ButtonView = function ButtonView(_ref) {
|
|
|
635
836
|
var changePadding = {
|
|
636
837
|
padding: isIconRounded ? IconSizes$1[size].padding : ButtonSizes[size].padding
|
|
637
838
|
};
|
|
638
|
-
var content = React.createElement(Horizontal
|
|
839
|
+
var content = React.createElement(Horizontal, {
|
|
639
840
|
gap: 4
|
|
640
|
-
}, isLoading && loaderPosition === 'left' && React.createElement(Loader
|
|
841
|
+
}, isLoading && loaderPosition === 'left' && React.createElement(Loader, Object.assign({}, loaderProps)), icon && iconPosition === 'left' && !isLoading && icon, children, icon && iconPosition === 'right' && !isLoading && icon, isLoading && loaderPosition === 'right' && React.createElement(Loader, Object.assign({}, loaderProps)));
|
|
641
842
|
return React.createElement(Element, Object.assign({
|
|
642
843
|
gap: 8,
|
|
643
844
|
as: "button",
|
|
@@ -728,7 +929,7 @@ var HeadingSizes = {
|
|
|
728
929
|
}
|
|
729
930
|
};
|
|
730
931
|
|
|
731
|
-
var _excluded$
|
|
932
|
+
var _excluded$d = ["children", "heading", "isItalic", "isUnderlined", "isStriked", "weight", "size"];
|
|
732
933
|
var LabelView = function LabelView(_ref) {
|
|
733
934
|
var children = _ref.children,
|
|
734
935
|
heading = _ref.heading,
|
|
@@ -742,7 +943,7 @@ var LabelView = function LabelView(_ref) {
|
|
|
742
943
|
weight = _ref$weight === void 0 ? 'normal' : _ref$weight,
|
|
743
944
|
_ref$size = _ref.size,
|
|
744
945
|
size = _ref$size === void 0 ? 'sm' : _ref$size,
|
|
745
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
946
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$d);
|
|
746
947
|
var headingStyles = heading ? HeadingSizes[heading] : {};
|
|
747
948
|
return React.createElement(Element, Object.assign({
|
|
748
949
|
as: "label",
|
|
@@ -814,7 +1015,7 @@ var IconSizes$2 = {
|
|
|
814
1015
|
'6xl': 60
|
|
815
1016
|
};
|
|
816
1017
|
|
|
817
|
-
var _excluded$
|
|
1018
|
+
var _excluded$e = ["id", "icon", "name", "label", "isChecked", "onChange", "onValueChange", "shadow", "size", "colorScheme", "error", "isSelected", "isHovered", "isDisabled", "isReadOnly", "isIndeterminate", "defaultIsSelected", "setIsSelected", "setIsHovered", "styles"];
|
|
818
1019
|
var CheckboxView = function CheckboxView(_ref) {
|
|
819
1020
|
var id = _ref.id,
|
|
820
1021
|
icon = _ref.icon,
|
|
@@ -849,7 +1050,7 @@ var CheckboxView = function CheckboxView(_ref) {
|
|
|
849
1050
|
checkbox: {},
|
|
850
1051
|
label: {}
|
|
851
1052
|
} : _ref$styles,
|
|
852
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1053
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
|
853
1054
|
var handleHover = function handleHover() {
|
|
854
1055
|
return setIsHovered(!isHovered);
|
|
855
1056
|
};
|
|
@@ -2393,7 +2594,7 @@ var useCountryPickerState = function useCountryPickerState(_ref) {
|
|
|
2393
2594
|
};
|
|
2394
2595
|
};
|
|
2395
2596
|
|
|
2396
|
-
var _excluded$
|
|
2597
|
+
var _excluded$f = ["children", "wrap", "justify", "isReversed"];
|
|
2397
2598
|
var VerticalView = function VerticalView(_ref) {
|
|
2398
2599
|
var children = _ref.children,
|
|
2399
2600
|
_ref$wrap = _ref.wrap,
|
|
@@ -2402,7 +2603,7 @@ var VerticalView = function VerticalView(_ref) {
|
|
|
2402
2603
|
justify = _ref$justify === void 0 ? 'flex-start' : _ref$justify,
|
|
2403
2604
|
_ref$isReversed = _ref.isReversed,
|
|
2404
2605
|
isReversed = _ref$isReversed === void 0 ? false : _ref$isReversed,
|
|
2405
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
2606
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$f);
|
|
2406
2607
|
return React.createElement(View$1, Object.assign({
|
|
2407
2608
|
display: "flex",
|
|
2408
2609
|
flexWrap: wrap,
|
|
@@ -2452,7 +2653,7 @@ var HeadingSizes$1 = {
|
|
|
2452
2653
|
}
|
|
2453
2654
|
};
|
|
2454
2655
|
|
|
2455
|
-
var _excluded$
|
|
2656
|
+
var _excluded$g = ["children", "heading", "maxLines", "isItalic", "isUnderlined", "isSub", "isSup", "isStriked", "isTruncated", "weight", "size"];
|
|
2456
2657
|
var TextContent = function TextContent(_ref) {
|
|
2457
2658
|
var children = _ref.children,
|
|
2458
2659
|
isSub = _ref.isSub,
|
|
@@ -2509,7 +2710,7 @@ var TextView = function TextView(_ref3) {
|
|
|
2509
2710
|
weight = _ref3$weight === void 0 ? 'normal' : _ref3$weight,
|
|
2510
2711
|
_ref3$size = _ref3.size,
|
|
2511
2712
|
size = _ref3$size === void 0 ? 'md' : _ref3$size,
|
|
2512
|
-
props = _objectWithoutPropertiesLoose(_ref3, _excluded$
|
|
2713
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded$g);
|
|
2513
2714
|
var headingStyles = heading ? HeadingSizes$1[heading] : {};
|
|
2514
2715
|
var noLineBreak = isSub || isSup ? {
|
|
2515
2716
|
display: 'inline'
|
|
@@ -2539,14 +2740,14 @@ var TextComponent = function TextComponent(props) {
|
|
|
2539
2740
|
*/
|
|
2540
2741
|
var Text = TextComponent;
|
|
2541
2742
|
|
|
2542
|
-
var _excluded$
|
|
2743
|
+
var _excluded$h = ["children", "styles"];
|
|
2543
2744
|
var HelperText = function HelperText(_ref) {
|
|
2544
2745
|
var children = _ref.children,
|
|
2545
2746
|
_ref$styles = _ref.styles,
|
|
2546
2747
|
styles = _ref$styles === void 0 ? {
|
|
2547
2748
|
helperText: {}
|
|
2548
2749
|
} : _ref$styles,
|
|
2549
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
2750
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$h);
|
|
2550
2751
|
return React.createElement(Text, Object.assign({
|
|
2551
2752
|
size: "xs",
|
|
2552
2753
|
marginVertical: 0,
|
|
@@ -2555,14 +2756,14 @@ var HelperText = function HelperText(_ref) {
|
|
|
2555
2756
|
}, styles['helperText'], props), children);
|
|
2556
2757
|
};
|
|
2557
2758
|
|
|
2558
|
-
var _excluded$
|
|
2759
|
+
var _excluded$i = ["children", "helperText", "error", "styles"];
|
|
2559
2760
|
var FieldContainer = function FieldContainer(_ref) {
|
|
2560
2761
|
var children = _ref.children,
|
|
2561
2762
|
helperText = _ref.helperText,
|
|
2562
2763
|
_ref$error = _ref.error,
|
|
2563
2764
|
error = _ref$error === void 0 ? false : _ref$error,
|
|
2564
2765
|
styles = _ref.styles,
|
|
2565
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
2766
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$i);
|
|
2566
2767
|
return React.createElement(Vertical, Object.assign({
|
|
2567
2768
|
gap: 5,
|
|
2568
2769
|
position: "relative"
|
|
@@ -2621,7 +2822,7 @@ var PaddingWithoutLabel = {
|
|
|
2621
2822
|
paddingRight: 36
|
|
2622
2823
|
};
|
|
2623
2824
|
|
|
2624
|
-
var _excluded$
|
|
2825
|
+
var _excluded$j = ["label", "shadow", "children", "value", "size", "shape", "variant", "error", "isWithLabel", "isFocused", "isHovered", "isDisabled", "isReadOnly", "colorScheme", "styles"];
|
|
2625
2826
|
var FieldContent = function FieldContent(_ref) {
|
|
2626
2827
|
var shadow = _ref.shadow,
|
|
2627
2828
|
children = _ref.children,
|
|
@@ -2649,7 +2850,7 @@ var FieldContent = function FieldContent(_ref) {
|
|
|
2649
2850
|
styles = _ref$styles === void 0 ? {
|
|
2650
2851
|
pickerBox: {}
|
|
2651
2852
|
} : _ref$styles,
|
|
2652
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
2853
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$j);
|
|
2653
2854
|
var isInteractive = (isHovered || isFocused) && !isDisabled;
|
|
2654
2855
|
var color = error ? 'error' : isInteractive ? colorScheme : 'midgray';
|
|
2655
2856
|
return React.createElement(Horizontal, Object.assign({
|
|
@@ -2669,22 +2870,20 @@ var FieldContent = function FieldContent(_ref) {
|
|
|
2669
2870
|
}, isWithLabel ? PadddingWithLabel : PaddingWithoutLabel, shadow, Shapes[shape], InputVariants[variant], styles['box'], props), children);
|
|
2670
2871
|
};
|
|
2671
2872
|
|
|
2672
|
-
var _excluded$
|
|
2873
|
+
var _excluded$k = ["children"];
|
|
2673
2874
|
var FieldIcons = function FieldIcons(_ref) {
|
|
2674
2875
|
var children = _ref.children,
|
|
2675
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
2876
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$k);
|
|
2676
2877
|
return React.createElement(Center, Object.assign({
|
|
2677
2878
|
gap: 10,
|
|
2678
|
-
top: "50%",
|
|
2679
2879
|
right: 16,
|
|
2680
2880
|
zIndex: 500,
|
|
2681
2881
|
wrap: "nowrap",
|
|
2682
|
-
position: "absolute"
|
|
2683
|
-
transform: "translateY(-50%)"
|
|
2882
|
+
position: "absolute"
|
|
2684
2883
|
}, props), children);
|
|
2685
2884
|
};
|
|
2686
2885
|
|
|
2687
|
-
var _excluded$
|
|
2886
|
+
var _excluded$l = ["children", "size", "error", "color", "styles"];
|
|
2688
2887
|
var FieldLabel = function FieldLabel(_ref) {
|
|
2689
2888
|
var children = _ref.children,
|
|
2690
2889
|
_ref$size = _ref.size,
|
|
@@ -2697,7 +2896,7 @@ var FieldLabel = function FieldLabel(_ref) {
|
|
|
2697
2896
|
styles = _ref$styles === void 0 ? {
|
|
2698
2897
|
label: {}
|
|
2699
2898
|
} : _ref$styles,
|
|
2700
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
2899
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$l);
|
|
2701
2900
|
return React.createElement(Label, Object.assign({
|
|
2702
2901
|
top: 6,
|
|
2703
2902
|
zIndex: 1000,
|
|
@@ -2710,10 +2909,10 @@ var FieldLabel = function FieldLabel(_ref) {
|
|
|
2710
2909
|
}, styles['label'], props), children);
|
|
2711
2910
|
};
|
|
2712
2911
|
|
|
2713
|
-
var _excluded$
|
|
2912
|
+
var _excluded$m = ["children"];
|
|
2714
2913
|
var FieldWrapper = function FieldWrapper(_ref) {
|
|
2715
2914
|
var children = _ref.children,
|
|
2716
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
2915
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$m);
|
|
2717
2916
|
return React.createElement(Vertical, Object.assign({
|
|
2718
2917
|
width: "100%"
|
|
2719
2918
|
}, props), children);
|
|
@@ -2727,7 +2926,7 @@ var IconSizes$3 = {
|
|
|
2727
2926
|
xl: 16
|
|
2728
2927
|
};
|
|
2729
2928
|
|
|
2730
|
-
var _excluded$
|
|
2929
|
+
var _excluded$n = ["id", "name", "label", "selected", "placeholder", "helperText", "hide", "error", "isHovered", "isFocused", "isAutoFocus", "isDisabled", "isReadOnly", "shadow", "newOptions", "size", "variant", "shape", "colorScheme", "onChange", "onBlur", "setHide", "setNewOptions", "setIsHovered", "setIsFocused", "setSelected", "styles"];
|
|
2731
2930
|
var CountryList = function CountryList(props) {
|
|
2732
2931
|
return React.createElement(Element, Object.assign({
|
|
2733
2932
|
as: "ul"
|
|
@@ -2867,7 +3066,7 @@ var CountryPickerView = function CountryPickerView(_ref3) {
|
|
|
2867
3066
|
helperText: {},
|
|
2868
3067
|
box: {}
|
|
2869
3068
|
} : _ref3$styles,
|
|
2870
|
-
props = _objectWithoutPropertiesLoose(_ref3, _excluded$
|
|
3069
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded$n);
|
|
2871
3070
|
var _useTheme = useTheme(),
|
|
2872
3071
|
getColor = _useTheme.getColor;
|
|
2873
3072
|
var IconColor = getColor('color.blueGray.700');
|
|
@@ -3005,7 +3204,7 @@ var useDatePickerState = function useDatePickerState() {
|
|
|
3005
3204
|
};
|
|
3006
3205
|
};
|
|
3007
3206
|
|
|
3008
|
-
var _excluded$
|
|
3207
|
+
var _excluded$o = ["id", "icon", "name", "label", "date", "children", "helperText", "shadow", "size", "variant", "shape", "colorScheme", "styles", "error", "isHovered", "isFocused", "isDisabled", "isReadOnly", "setDate", "setIsFocused", "setIsHovered", "onChange", "onChangeText"];
|
|
3009
3208
|
var DatePickerContent = function DatePickerContent(props) {
|
|
3010
3209
|
return React.createElement(Input, Object.assign({
|
|
3011
3210
|
type: "date"
|
|
@@ -3053,7 +3252,7 @@ var DatePickerView = function DatePickerView(_ref) {
|
|
|
3053
3252
|
setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
|
|
3054
3253
|
onChange = _ref.onChange,
|
|
3055
3254
|
onChangeText = _ref.onChangeText,
|
|
3056
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3255
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$o);
|
|
3057
3256
|
var isWithLabel = !!(isFocused && label);
|
|
3058
3257
|
var handleHover = function handleHover() {
|
|
3059
3258
|
return setIsHovered(!isHovered);
|
|
@@ -3175,7 +3374,7 @@ var usePasswordState = function usePasswordState(props) {
|
|
|
3175
3374
|
}, textFieldStates);
|
|
3176
3375
|
};
|
|
3177
3376
|
|
|
3178
|
-
var _excluded$
|
|
3377
|
+
var _excluded$p = ["id", "name", "label", "value", "hint", "inputValue", "onChange", "leftChild", "rightChild", "helperText", "placeholder", "onChangeText", "shadow", "styles", "size", "shape", "variant", "colorScheme", "error", "isFocused", "isHovered", "isDisabled", "isReadOnly", "isClearable", "isAutoFocus", "setHint", "setIsFocused", "setIsHovered", "setInputValue", "onClick", "onFocus", "onBlur"];
|
|
3179
3378
|
var TextFieldInput = function TextFieldInput(props) {
|
|
3180
3379
|
return React.createElement(Input, Object.assign({
|
|
3181
3380
|
type: "text"
|
|
@@ -3236,7 +3435,7 @@ var TextFieldView = function TextFieldView(_ref) {
|
|
|
3236
3435
|
onFocus = _ref.onFocus,
|
|
3237
3436
|
_ref$onBlur = _ref.onBlur,
|
|
3238
3437
|
onBlur = _ref$onBlur === void 0 ? function () {} : _ref$onBlur,
|
|
3239
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3438
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$p);
|
|
3240
3439
|
var _useTheme = useTheme(),
|
|
3241
3440
|
getColor = _useTheme.getColor;
|
|
3242
3441
|
var IconColor = getColor('color.blueGray.700');
|
|
@@ -3351,8 +3550,8 @@ var TextFieldView = function TextFieldView(_ref) {
|
|
|
3351
3550
|
}))));
|
|
3352
3551
|
};
|
|
3353
3552
|
|
|
3354
|
-
var _excluded$
|
|
3355
|
-
_excluded2 = ["isVisible", "setIsVisible"];
|
|
3553
|
+
var _excluded$q = ["visibleIcon", "hiddenIcon"],
|
|
3554
|
+
_excluded2$1 = ["isVisible", "setIsVisible"];
|
|
3356
3555
|
var PasswordComponent = function PasswordComponent(_ref) {
|
|
3357
3556
|
var _ref$visibleIcon = _ref.visibleIcon,
|
|
3358
3557
|
visibleIcon = _ref$visibleIcon === void 0 ? React.createElement(OpenEyeSvg, {
|
|
@@ -3362,11 +3561,11 @@ var PasswordComponent = function PasswordComponent(_ref) {
|
|
|
3362
3561
|
hiddenIcon = _ref$hiddenIcon === void 0 ? React.createElement(CloseEyeSvg, {
|
|
3363
3562
|
size: 14
|
|
3364
3563
|
}) : _ref$hiddenIcon,
|
|
3365
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3564
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
|
|
3366
3565
|
var _usePasswordState = usePasswordState(props),
|
|
3367
3566
|
isVisible = _usePasswordState.isVisible,
|
|
3368
3567
|
setIsVisible = _usePasswordState.setIsVisible,
|
|
3369
|
-
passwordState = _objectWithoutPropertiesLoose(_usePasswordState, _excluded2);
|
|
3568
|
+
passwordState = _objectWithoutPropertiesLoose(_usePasswordState, _excluded2$1);
|
|
3370
3569
|
return React.createElement(TextFieldView, Object.assign({}, props, passwordState, {
|
|
3371
3570
|
type: isVisible ? 'text' : 'password',
|
|
3372
3571
|
isClearable: false,
|
|
@@ -3430,10 +3629,10 @@ var IconSizes$4 = {
|
|
|
3430
3629
|
xl: 16
|
|
3431
3630
|
};
|
|
3432
3631
|
|
|
3433
|
-
var _excluded$
|
|
3434
|
-
_excluded2$
|
|
3435
|
-
_excluded3 = ["option", "size", "removeOption"],
|
|
3436
|
-
_excluded4 = ["id", "name", "label", "selected", "placeholder", "helperText", "hide", "error", "isMulti", "isFocused", "isHovered", "isDisabled", "isReadOnly", "options", "shadow", "size", "colorScheme", "shape", "variant", "styles", "onChange", "setHide", "setSelected", "setIsHovered", "setIsFocused"];
|
|
3632
|
+
var _excluded$r = ["isHovered", "setIsHovered", "option", "size", "callback"],
|
|
3633
|
+
_excluded2$2 = ["id", "name", "selected", "onChange", "isMulti", "isDisabled", "isReadOnly", "options"],
|
|
3634
|
+
_excluded3$1 = ["option", "size", "removeOption"],
|
|
3635
|
+
_excluded4$1 = ["id", "name", "label", "selected", "placeholder", "helperText", "hide", "error", "isMulti", "isFocused", "isHovered", "isDisabled", "isReadOnly", "options", "shadow", "size", "colorScheme", "shape", "variant", "styles", "onChange", "setHide", "setSelected", "setIsHovered", "setIsFocused"];
|
|
3437
3636
|
var Item = function Item(_ref) {
|
|
3438
3637
|
var isHovered = _ref.isHovered,
|
|
3439
3638
|
setIsHovered = _ref.setIsHovered,
|
|
@@ -3442,7 +3641,7 @@ var Item = function Item(_ref) {
|
|
|
3442
3641
|
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
3443
3642
|
_ref$callback = _ref.callback,
|
|
3444
3643
|
callback = _ref$callback === void 0 ? function () {} : _ref$callback,
|
|
3445
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3644
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$r);
|
|
3446
3645
|
var handleOptionClick = function handleOptionClick(option) {
|
|
3447
3646
|
return callback(option);
|
|
3448
3647
|
};
|
|
@@ -3512,7 +3711,7 @@ var HiddenSelect = function HiddenSelect(_ref3) {
|
|
|
3512
3711
|
isReadOnly = _ref3$isReadOnly === void 0 ? false : _ref3$isReadOnly,
|
|
3513
3712
|
_ref3$options = _ref3.options,
|
|
3514
3713
|
options = _ref3$options === void 0 ? [] : _ref3$options,
|
|
3515
|
-
props = _objectWithoutPropertiesLoose(_ref3, _excluded2$
|
|
3714
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded2$2);
|
|
3516
3715
|
var handleChange = function handleChange(event) {
|
|
3517
3716
|
if (onChange) onChange(event);
|
|
3518
3717
|
};
|
|
@@ -3594,7 +3793,7 @@ var MultiSelect = function MultiSelect(_ref5) {
|
|
|
3594
3793
|
size = _ref5$size === void 0 ? 'md' : _ref5$size,
|
|
3595
3794
|
_ref5$removeOption = _ref5.removeOption,
|
|
3596
3795
|
removeOption = _ref5$removeOption === void 0 ? function () {} : _ref5$removeOption,
|
|
3597
|
-
props = _objectWithoutPropertiesLoose(_ref5, _excluded3);
|
|
3796
|
+
props = _objectWithoutPropertiesLoose(_ref5, _excluded3$1);
|
|
3598
3797
|
var handleClick = function handleClick() {
|
|
3599
3798
|
return removeOption(option);
|
|
3600
3799
|
};
|
|
@@ -3669,7 +3868,7 @@ var SelectView = function SelectView(_ref6) {
|
|
|
3669
3868
|
setIsHovered = _ref6$setIsHovered === void 0 ? function () {} : _ref6$setIsHovered,
|
|
3670
3869
|
_ref6$setIsFocused = _ref6.setIsFocused,
|
|
3671
3870
|
setIsFocused = _ref6$setIsFocused === void 0 ? function () {} : _ref6$setIsFocused,
|
|
3672
|
-
props = _objectWithoutPropertiesLoose(_ref6, _excluded4);
|
|
3871
|
+
props = _objectWithoutPropertiesLoose(_ref6, _excluded4$1);
|
|
3673
3872
|
var isWithLabel = !!(isFocused && label);
|
|
3674
3873
|
var handleHover = function handleHover() {
|
|
3675
3874
|
return setIsHovered(!isHovered);
|
|
@@ -3912,7 +4111,7 @@ var SliderPadding = {
|
|
|
3912
4111
|
}
|
|
3913
4112
|
};
|
|
3914
4113
|
|
|
3915
|
-
var _excluded$
|
|
4114
|
+
var _excluded$s = ["id", "name", "inActiveChild", "activeChild", "shadow", "size", "colorScheme", "on", "isHovered", "isChecked", "isDisabled", "isReadOnly", "onChange", "onValueChange", "setOn", "setIsHovered", "styles"];
|
|
3916
4115
|
var SwitchContent = function SwitchContent(props) {
|
|
3917
4116
|
return React.createElement(Input, Object.assign({
|
|
3918
4117
|
type: "checkbox"
|
|
@@ -3948,7 +4147,7 @@ var SwitchView = function SwitchView(_ref) {
|
|
|
3948
4147
|
slider: {},
|
|
3949
4148
|
circle: {}
|
|
3950
4149
|
} : _ref$styles,
|
|
3951
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4150
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$s);
|
|
3952
4151
|
var handleToggle = function handleToggle(event) {
|
|
3953
4152
|
if (!isReadOnly) {
|
|
3954
4153
|
setOn(!on);
|
|
@@ -4024,7 +4223,7 @@ var useTextAreaState = function useTextAreaState(_ref) {
|
|
|
4024
4223
|
};
|
|
4025
4224
|
};
|
|
4026
4225
|
|
|
4027
|
-
var _excluded$
|
|
4226
|
+
var _excluded$t = ["id", "name", "hint", "error", "value", "label", "shadow", "inputValue", "helperText", "placeholder", "defaultValue", "size", "shape", "variant", "colorScheme", "isHovered", "isFocused", "isEditable", "isReadOnly", "isDisabled", "isAutoFocus", "isMultiline", "maxRows", "maxCols", "onBlur", "onChange", "onFocus", "onChangeText", "setHint", "setInputValue", "setIsFocused", "setIsHovered", "styles"];
|
|
4028
4227
|
var TextAreaView = function TextAreaView(_ref) {
|
|
4029
4228
|
var id = _ref.id,
|
|
4030
4229
|
name = _ref.name,
|
|
@@ -4082,7 +4281,7 @@ var TextAreaView = function TextAreaView(_ref) {
|
|
|
4082
4281
|
helperText: {},
|
|
4083
4282
|
field: {}
|
|
4084
4283
|
} : _ref$styles,
|
|
4085
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4284
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$t);
|
|
4086
4285
|
var isWithLabel = !!(isFocused && label);
|
|
4087
4286
|
useMemo(function () {
|
|
4088
4287
|
setHint(isFocused && !inputValue ? placeholder != null ? placeholder : '' : label != null ? label : placeholder);
|
|
@@ -4190,209 +4389,6 @@ var TextFieldComponent = function TextFieldComponent(props) {
|
|
|
4190
4389
|
*/
|
|
4191
4390
|
var TextField = TextFieldComponent;
|
|
4192
4391
|
|
|
4193
|
-
var DefaultSizes = {
|
|
4194
|
-
xs: 14,
|
|
4195
|
-
sm: 18,
|
|
4196
|
-
md: 22,
|
|
4197
|
-
lg: 26,
|
|
4198
|
-
xl: 30,
|
|
4199
|
-
'2xl': 40,
|
|
4200
|
-
'3xl': 50,
|
|
4201
|
-
'4xl': 60,
|
|
4202
|
-
'5xl': 70,
|
|
4203
|
-
'6xl': 80
|
|
4204
|
-
};
|
|
4205
|
-
var DefaultSpeeds = {
|
|
4206
|
-
fast: 50,
|
|
4207
|
-
normal: 100,
|
|
4208
|
-
slow: 300
|
|
4209
|
-
};
|
|
4210
|
-
|
|
4211
|
-
var _excluded$t = ["size", "speed", "color"],
|
|
4212
|
-
_excluded2$2 = ["size", "speed", "color"],
|
|
4213
|
-
_excluded3$1 = ["size", "speed", "color"],
|
|
4214
|
-
_excluded4$1 = ["size", "children", "textColor", "loaderColor", "type", "speed", "textPosition"];
|
|
4215
|
-
var DefaultSpinner = function DefaultSpinner(_ref) {
|
|
4216
|
-
var _ref$size = _ref.size,
|
|
4217
|
-
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
4218
|
-
_ref$speed = _ref.speed,
|
|
4219
|
-
speed = _ref$speed === void 0 ? 'normal' : _ref$speed,
|
|
4220
|
-
_ref$color = _ref.color,
|
|
4221
|
-
color = _ref$color === void 0 ? 'theme.loading' : _ref$color,
|
|
4222
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$t);
|
|
4223
|
-
var theme = useTheme();
|
|
4224
|
-
var colorStyle = theme.getColor(color);
|
|
4225
|
-
var sizeStyle = typeof size === 'number' ? size : DefaultSizes[size];
|
|
4226
|
-
var _useState = useState(0),
|
|
4227
|
-
angle = _useState[0],
|
|
4228
|
-
setAngle = _useState[1];
|
|
4229
|
-
useEffect(function () {
|
|
4230
|
-
var intervalId = setInterval(function () {
|
|
4231
|
-
setAngle(function (prevAngle) {
|
|
4232
|
-
return prevAngle + 45;
|
|
4233
|
-
});
|
|
4234
|
-
}, DefaultSpeeds[speed]);
|
|
4235
|
-
return function () {
|
|
4236
|
-
return clearInterval(intervalId);
|
|
4237
|
-
};
|
|
4238
|
-
}, [speed]);
|
|
4239
|
-
return React.createElement("svg", Object.assign({
|
|
4240
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
4241
|
-
width: sizeStyle + "px",
|
|
4242
|
-
height: sizeStyle + "px",
|
|
4243
|
-
viewBox: "0 0 24 24",
|
|
4244
|
-
fill: "none",
|
|
4245
|
-
stroke: colorStyle,
|
|
4246
|
-
strokeWidth: "2",
|
|
4247
|
-
strokeLinecap: "round",
|
|
4248
|
-
strokeLinejoin: "round",
|
|
4249
|
-
style: {
|
|
4250
|
-
transform: "rotate(" + angle + "deg)"
|
|
4251
|
-
}
|
|
4252
|
-
}, props), React.createElement("g", {
|
|
4253
|
-
id: "SVGRepo_bgCarrier",
|
|
4254
|
-
strokeWidth: "0"
|
|
4255
|
-
}), React.createElement("g", {
|
|
4256
|
-
id: "SVGRepo_tracerCarrier",
|
|
4257
|
-
strokeLinecap: "round",
|
|
4258
|
-
strokeLinejoin: "round"
|
|
4259
|
-
}), React.createElement("g", {
|
|
4260
|
-
id: "SVGRepo_iconCarrier"
|
|
4261
|
-
}, React.createElement("path", {
|
|
4262
|
-
d: "M21 12a9 9 0 11-6.219-8.56"
|
|
4263
|
-
})));
|
|
4264
|
-
};
|
|
4265
|
-
var Dotted = function Dotted(_ref2) {
|
|
4266
|
-
var _ref2$size = _ref2.size,
|
|
4267
|
-
size = _ref2$size === void 0 ? 'md' : _ref2$size,
|
|
4268
|
-
_ref2$speed = _ref2.speed,
|
|
4269
|
-
speed = _ref2$speed === void 0 ? 'normal' : _ref2$speed,
|
|
4270
|
-
_ref2$color = _ref2.color,
|
|
4271
|
-
color = _ref2$color === void 0 ? 'theme.loading' : _ref2$color,
|
|
4272
|
-
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$2);
|
|
4273
|
-
var theme = useTheme();
|
|
4274
|
-
var colorStyle = theme.getColor(color);
|
|
4275
|
-
var sizeStyle = typeof size === 'number' ? size : DefaultSizes[size];
|
|
4276
|
-
var _useState2 = useState(0),
|
|
4277
|
-
angle = _useState2[0],
|
|
4278
|
-
setAngle = _useState2[1];
|
|
4279
|
-
useEffect(function () {
|
|
4280
|
-
var intervalId = setInterval(function () {
|
|
4281
|
-
setAngle(function (prevAngle) {
|
|
4282
|
-
return prevAngle + 45;
|
|
4283
|
-
});
|
|
4284
|
-
}, DefaultSpeeds[speed]);
|
|
4285
|
-
return function () {
|
|
4286
|
-
return clearInterval(intervalId);
|
|
4287
|
-
};
|
|
4288
|
-
}, [speed]);
|
|
4289
|
-
return React.createElement("svg", Object.assign({
|
|
4290
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
4291
|
-
viewBox: "0 0 50 50",
|
|
4292
|
-
width: sizeStyle + "px",
|
|
4293
|
-
height: sizeStyle + "px",
|
|
4294
|
-
style: {
|
|
4295
|
-
transform: "rotate(" + angle + "deg)"
|
|
4296
|
-
}
|
|
4297
|
-
}, props), React.createElement("circle", {
|
|
4298
|
-
cx: "10",
|
|
4299
|
-
cy: "25",
|
|
4300
|
-
r: "4",
|
|
4301
|
-
fill: colorStyle
|
|
4302
|
-
}), React.createElement("circle", {
|
|
4303
|
-
cx: "25",
|
|
4304
|
-
cy: "25",
|
|
4305
|
-
r: "4",
|
|
4306
|
-
fill: colorStyle
|
|
4307
|
-
}), React.createElement("circle", {
|
|
4308
|
-
cx: "40",
|
|
4309
|
-
cy: "25",
|
|
4310
|
-
r: "4",
|
|
4311
|
-
fill: colorStyle
|
|
4312
|
-
}));
|
|
4313
|
-
};
|
|
4314
|
-
var Quarter = function Quarter(_ref3) {
|
|
4315
|
-
var _ref3$size = _ref3.size,
|
|
4316
|
-
size = _ref3$size === void 0 ? 'md' : _ref3$size,
|
|
4317
|
-
_ref3$speed = _ref3.speed,
|
|
4318
|
-
speed = _ref3$speed === void 0 ? 'normal' : _ref3$speed,
|
|
4319
|
-
_ref3$color = _ref3.color,
|
|
4320
|
-
color = _ref3$color === void 0 ? 'theme.loading' : _ref3$color,
|
|
4321
|
-
props = _objectWithoutPropertiesLoose(_ref3, _excluded3$1);
|
|
4322
|
-
var theme = useTheme();
|
|
4323
|
-
var colorStyle = theme.getColor(color);
|
|
4324
|
-
var sizeStyle = typeof size === 'number' ? size : DefaultSizes[size];
|
|
4325
|
-
var _useState3 = useState(0),
|
|
4326
|
-
angle = _useState3[0],
|
|
4327
|
-
setAngle = _useState3[1];
|
|
4328
|
-
useEffect(function () {
|
|
4329
|
-
var intervalId = setInterval(function () {
|
|
4330
|
-
setAngle(function (prevAngle) {
|
|
4331
|
-
return prevAngle + 45;
|
|
4332
|
-
});
|
|
4333
|
-
}, DefaultSpeeds[speed]);
|
|
4334
|
-
return function () {
|
|
4335
|
-
return clearInterval(intervalId);
|
|
4336
|
-
};
|
|
4337
|
-
}, [speed]);
|
|
4338
|
-
return React.createElement("svg", Object.assign({
|
|
4339
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
4340
|
-
viewBox: "0 0 50 50",
|
|
4341
|
-
width: sizeStyle + "px",
|
|
4342
|
-
height: sizeStyle + "px",
|
|
4343
|
-
style: {
|
|
4344
|
-
transform: "rotate(" + angle + "deg)"
|
|
4345
|
-
}
|
|
4346
|
-
}, props), React.createElement("circle", {
|
|
4347
|
-
cx: "25",
|
|
4348
|
-
cy: "25",
|
|
4349
|
-
r: "20",
|
|
4350
|
-
fill: "none",
|
|
4351
|
-
stroke: colorStyle,
|
|
4352
|
-
strokeWidth: "5",
|
|
4353
|
-
strokeDasharray: "1,10"
|
|
4354
|
-
}));
|
|
4355
|
-
};
|
|
4356
|
-
var LoaderView = function LoaderView(_ref4) {
|
|
4357
|
-
var size = _ref4.size,
|
|
4358
|
-
children = _ref4.children,
|
|
4359
|
-
textColor = _ref4.textColor,
|
|
4360
|
-
loaderColor = _ref4.loaderColor,
|
|
4361
|
-
_ref4$type = _ref4.type,
|
|
4362
|
-
type = _ref4$type === void 0 ? 'default' : _ref4$type,
|
|
4363
|
-
_ref4$speed = _ref4.speed,
|
|
4364
|
-
speed = _ref4$speed === void 0 ? 'normal' : _ref4$speed,
|
|
4365
|
-
_ref4$textPosition = _ref4.textPosition,
|
|
4366
|
-
textPosition = _ref4$textPosition === void 0 ? 'right' : _ref4$textPosition,
|
|
4367
|
-
props = _objectWithoutPropertiesLoose(_ref4, _excluded4$1);
|
|
4368
|
-
var style = {
|
|
4369
|
-
size: size,
|
|
4370
|
-
speed: speed,
|
|
4371
|
-
color: loaderColor
|
|
4372
|
-
};
|
|
4373
|
-
var variants = {
|
|
4374
|
-
default: React.createElement(DefaultSpinner, Object.assign({}, style)),
|
|
4375
|
-
dotted: React.createElement(Dotted, Object.assign({}, style)),
|
|
4376
|
-
quarter: React.createElement(Quarter, Object.assign({}, style))
|
|
4377
|
-
};
|
|
4378
|
-
return React.createElement(Center, Object.assign({
|
|
4379
|
-
gap: 10,
|
|
4380
|
-
flexDirection: textPosition === 'top' || textPosition === 'bottom' ? 'column' : 'row'
|
|
4381
|
-
}, props), (textPosition === 'left' || textPosition === 'top') && children && React.createElement(View, {
|
|
4382
|
-
color: textColor
|
|
4383
|
-
}, children), variants[type], (textPosition === 'right' || textPosition === 'bottom') && children && React.createElement(View, {
|
|
4384
|
-
color: textColor
|
|
4385
|
-
}, children));
|
|
4386
|
-
};
|
|
4387
|
-
|
|
4388
|
-
var LoaderComponent = function LoaderComponent(props) {
|
|
4389
|
-
return React.createElement(LoaderView, Object.assign({}, props));
|
|
4390
|
-
};
|
|
4391
|
-
/**
|
|
4392
|
-
* It gives the user an insight about an action being processed. It may have an undefined waiting time or display the process length.
|
|
4393
|
-
*/
|
|
4394
|
-
var Loader = LoaderComponent;
|
|
4395
|
-
|
|
4396
4392
|
var useModalStore = /*#__PURE__*/create(function (set) {
|
|
4397
4393
|
return {
|
|
4398
4394
|
modal: false,
|