@app-studio/web 0.3.69 → 0.6.0
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/bot/Bot.d.ts +4 -3
- package/dist/bot/DocuCode.d.ts +7 -2
- package/dist/bot/FileHandler.d.ts +5 -0
- package/dist/bot/OpenAIConnector.d.ts +2 -0
- package/dist/bot/prompt/1-project.d.ts +1 -1
- package/dist/bot/prompt/2-response.d.ts +1 -1
- package/dist/bot/prompt/3-comment.d.ts +1 -1
- package/dist/components/Button/Button/Button.props.d.ts +0 -60
- package/dist/components/Button/Button.d.ts +0 -3
- package/dist/components/Form/Checkbox/Checkbox/Checkbox.props.d.ts +1 -71
- package/dist/components/Form/Checkbox/examples/index.d.ts +1 -0
- package/dist/components/Form/Checkbox/examples/infoText.d.ts +2 -0
- package/dist/components/Form/ComboBox/ComboBox/ComboBox.context.d.ts +10 -0
- package/dist/components/Form/ComboBox/ComboBox/ComboBox.props.d.ts +36 -0
- package/dist/components/Form/ComboBox/ComboBox/ComboBox.provider.d.ts +2 -0
- package/dist/components/Form/ComboBox/ComboBox/ComboBox.state.d.ts +2 -0
- package/dist/components/Form/ComboBox/ComboBox/ComboBox.type.d.ts +12 -0
- package/dist/components/Form/ComboBox/ComboBox/ComboBox.view.d.ts +4 -0
- package/dist/components/Form/ComboBox/ComboBox.d.ts +3 -0
- package/dist/components/Form/ComboBox/examples/default.d.ts +2 -0
- package/dist/components/Form/ComboBox/examples/index.d.ts +10 -0
- package/dist/components/Form/ComboBox/examples/label.d.ts +2 -0
- package/dist/components/Form/ComboBox/examples/left.d.ts +2 -0
- package/dist/components/Form/ComboBox/examples/onSelect.d.ts +2 -0
- package/dist/components/Form/ComboBox/examples/placeholder.d.ts +2 -0
- package/dist/components/Form/ComboBox/examples/right.d.ts +2 -0
- package/dist/components/Form/ComboBox/examples/searchEnabled.d.ts +2 -0
- package/dist/components/Form/ComboBox/examples/searchPlaceholder.d.ts +2 -0
- package/dist/components/Form/ComboBox/examples/showTick.d.ts +2 -0
- package/dist/components/Form/ComboBox/examples/styles.d.ts +2 -0
- package/dist/components/Form/DatePicker/DatePicker/DatePicker.props.d.ts +0 -3
- package/dist/components/Form/Label/Label/Label.props.d.ts +0 -24
- package/dist/components/Form/Select/Select/Select.props.d.ts +1 -0
- package/dist/components/Form/Select/Select/Select.state.d.ts +2 -0
- package/dist/components/Form/Select/examples/color.d.ts +2 -0
- package/dist/components/Form/Select/examples/index.d.ts +2 -1
- package/dist/components/Form/Select/examples/isScrollable.d.ts +2 -0
- package/dist/components/Form/TextField/examples/index.d.ts +1 -1
- package/dist/components/Formik/Formik.ComboBox.d.ts +6 -0
- package/dist/components/Formik/examples/FormikComboBox.d.ts +2 -0
- package/dist/components/Formik/examples/index.d.ts +1 -0
- package/dist/components/Formik/index.d.ts +1 -0
- package/dist/components/Layout/index.d.ts +4 -0
- package/dist/components/Message/Message/Message.layout.d.ts +1 -1
- package/dist/components/Message/Message/Message.props.d.ts +31 -107
- package/dist/components/Message/Message/Message.store.d.ts +2 -8
- package/dist/components/Message/Message/Message.style.d.ts +2 -2
- package/dist/components/Message/Message/Message.view.d.ts +2 -18
- package/dist/components/Message/examples/action.d.ts +2 -0
- package/dist/components/Message/examples/default.d.ts +2 -0
- package/dist/components/Message/examples/index.d.ts +9 -0
- package/dist/components/Message/examples/isClosable.d.ts +2 -0
- package/dist/components/Message/examples/showIcon.d.ts +2 -0
- package/dist/components/Message/examples/styles.d.ts +2 -0
- package/dist/components/Message/examples/subtitle.d.ts +2 -0
- package/dist/components/Message/examples/timeout.d.ts +2 -0
- package/dist/components/Message/examples/title.d.ts +2 -0
- package/dist/components/Message/examples/variant.d.ts +2 -0
- package/dist/components/Svg/Error.d.ts +8 -0
- package/dist/components/Svg/Info.d.ts +8 -0
- package/dist/components/Svg/Plus.d.ts +8 -0
- package/dist/components/Svg/Search.d.ts +8 -0
- package/dist/components/Svg/Success.d.ts +8 -0
- package/dist/components/Svg/Tick.d.ts +8 -0
- package/dist/components/Svg/index.d.ts +3 -0
- package/dist/components/Table/Table/Table.context.d.ts +16 -0
- package/dist/components/Table/Table/Table.props.d.ts +22 -0
- package/dist/components/Table/Table/Table.state.d.ts +5 -0
- package/dist/components/Table/Table/Table.type.d.ts +19 -0
- package/dist/components/Table/Table/Table.view.d.ts +11 -0
- package/dist/components/Table/Table.d.ts +13 -0
- package/dist/components/Table/examples/caption.d.ts +2 -0
- package/dist/components/Table/examples/data.d.ts +2 -0
- package/dist/components/Table/examples/default.d.ts +2 -0
- package/dist/components/Table/examples/footer.d.ts +2 -0
- package/dist/components/Table/examples/index.d.ts +5 -0
- package/dist/components/Table/examples/styles.d.ts +2 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/pages/comboBox.page.d.ts +3 -0
- package/dist/pages/message.page.d.ts +2 -2
- package/dist/pages/table.page.d.ts +3 -0
- package/dist/utils/componentsPageImports.d.ts +6 -0
- package/dist/web.cjs.development.js +1044 -243
- 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 +1039 -244
- package/dist/web.esm.js.map +1 -1
- package/package.json +7 -5
- package/dist/components/Form/Select/examples/Color.d.ts +0 -2
- package/dist/components/Message/Examples/CloseButtonMessage.d.ts +0 -2
- package/dist/components/Message/Examples/DefaultMessage.d.ts +0 -2
- package/dist/components/Message/Examples/VariantMessage.d.ts +0 -2
- package/dist/components/Message/Examples/index.d.ts +0 -3
- /package/dist/components/Form/TextField/examples/{ColorScheme.d.ts → colorScheme.d.ts} +0 -0
|
@@ -8,6 +8,7 @@ var React = require('react');
|
|
|
8
8
|
var React__default = _interopDefault(React);
|
|
9
9
|
var appStudio = require('app-studio');
|
|
10
10
|
var reactRouterDom = require('react-router-dom');
|
|
11
|
+
var Layout = require('src/components/Layout');
|
|
11
12
|
var format = _interopDefault(require('date-fns/format'));
|
|
12
13
|
var formik = require('formik');
|
|
13
14
|
var zustand = require('zustand');
|
|
@@ -16,11 +17,15 @@ var useButtonState = function useButtonState() {
|
|
|
16
17
|
var _React$useState = React__default.useState(false),
|
|
17
18
|
isHovered = _React$useState[0],
|
|
18
19
|
setIsHovered = _React$useState[1];
|
|
20
|
+
// This custom react hook 'useButtonState' is defined for managing the state of a button, especially for hover interactions.
|
|
19
21
|
return {
|
|
20
22
|
isHovered: isHovered,
|
|
21
23
|
setIsHovered: setIsHovered
|
|
22
24
|
};
|
|
25
|
+
// The 'setIsHovered' function is used to update the value of 'isHovered' state when the hover status of the button changes.
|
|
26
|
+
// A state variable 'isHovered' is declared with its initial value set to 'false', indicating that the button is not hovered by default.
|
|
23
27
|
};
|
|
28
|
+
// The hook returns an object containing 'isHovered' state and the 'setIsHovered' function to enable state management from the consumer component.
|
|
24
29
|
|
|
25
30
|
function _extends() {
|
|
26
31
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -441,6 +446,101 @@ var WarningSvg = function WarningSvg(_ref) {
|
|
|
441
446
|
})))))));
|
|
442
447
|
};
|
|
443
448
|
|
|
449
|
+
var _excluded$b = ["size", "color"];
|
|
450
|
+
var SuccessSvg = function SuccessSvg(_ref) {
|
|
451
|
+
var _ref$size = _ref.size,
|
|
452
|
+
size = _ref$size === void 0 ? 64 : _ref$size,
|
|
453
|
+
_ref$color = _ref.color,
|
|
454
|
+
color = _ref$color === void 0 ? 'white' : _ref$color,
|
|
455
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
|
456
|
+
return React__default.createElement(Center, {
|
|
457
|
+
width: size + "px",
|
|
458
|
+
height: size + "px"
|
|
459
|
+
}, React__default.createElement("svg", Object.assign({
|
|
460
|
+
height: size + "px",
|
|
461
|
+
width: size + "px",
|
|
462
|
+
version: "1.1",
|
|
463
|
+
id: "Capa_1",
|
|
464
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
465
|
+
viewBox: "0 0 484.8 484.8",
|
|
466
|
+
fill: color
|
|
467
|
+
}, props), React__default.createElement("g", {
|
|
468
|
+
id: "SVGRepo_bgCarrier"
|
|
469
|
+
}), React__default.createElement("g", {
|
|
470
|
+
id: "SVGRepo_tracerCarrier"
|
|
471
|
+
}), React__default.createElement("g", {
|
|
472
|
+
id: "SVGRepo_iconCarrier"
|
|
473
|
+
}, React__default.createElement("g", null, React__default.createElement("g", null, React__default.createElement("path", {
|
|
474
|
+
d: "M242.4,0C108.6,0,0,108.6,0,242.4S108.6,484.8,242.4,484.8S484.8,376.2,484.8,242.4S376.2,0,242.4,0z M198.4,358.8l-120-120L84,228l114.4,114.4l188-188l28.8,28.8L198.4,358.8z",
|
|
475
|
+
fill: color
|
|
476
|
+
}))))));
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
var _excluded$c = ["size", "color"];
|
|
480
|
+
var InfoSvg = function InfoSvg(_ref) {
|
|
481
|
+
var _ref$size = _ref.size,
|
|
482
|
+
size = _ref$size === void 0 ? 64 : _ref$size,
|
|
483
|
+
_ref$color = _ref.color,
|
|
484
|
+
color = _ref$color === void 0 ? 'white' : _ref$color,
|
|
485
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
|
486
|
+
return React__default.createElement(Center, {
|
|
487
|
+
width: size + "px",
|
|
488
|
+
height: size + "px"
|
|
489
|
+
}, React__default.createElement("svg", Object.assign({
|
|
490
|
+
height: size + "px",
|
|
491
|
+
width: size + "px",
|
|
492
|
+
version: "1.1",
|
|
493
|
+
id: "Capa_1",
|
|
494
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
495
|
+
viewBox: "0 0 192.146 192.146",
|
|
496
|
+
fill: color
|
|
497
|
+
}, props), React__default.createElement("g", {
|
|
498
|
+
id: "SVGRepo_bgCarrier"
|
|
499
|
+
}), React__default.createElement("g", {
|
|
500
|
+
id: "SVGRepo_tracerCarrier"
|
|
501
|
+
}), React__default.createElement("g", {
|
|
502
|
+
id: "SVGRepo_iconCarrier"
|
|
503
|
+
}, React__default.createElement("g", null, React__default.createElement("g", null, React__default.createElement("g", null, React__default.createElement("path", {
|
|
504
|
+
d: "M96.073,3.515C43.19,3.515,0,46.705,0,99.587s43.19,96.072,96.073,96.072s96.073-43.19,96.073-96.072 S148.955,3.515,96.073,3.515z M101.468,154.072h-15.447V120.57h15.447V154.072z M101.468,111.875h-15.447V49.54h15.447V111.875z"
|
|
505
|
+
})))))));
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
var _excluded$d = ["size", "color"];
|
|
509
|
+
var ErrorSvg = function ErrorSvg(_ref) {
|
|
510
|
+
var _ref$size = _ref.size,
|
|
511
|
+
size = _ref$size === void 0 ? 64 : _ref$size,
|
|
512
|
+
_ref$color = _ref.color,
|
|
513
|
+
color = _ref$color === void 0 ? 'white' : _ref$color,
|
|
514
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$d);
|
|
515
|
+
return React__default.createElement(Center, {
|
|
516
|
+
width: size + "px",
|
|
517
|
+
height: size + "px"
|
|
518
|
+
}, React__default.createElement("svg", Object.assign({
|
|
519
|
+
height: size + "px",
|
|
520
|
+
width: size + "px",
|
|
521
|
+
version: "1.1",
|
|
522
|
+
id: "Capa_1",
|
|
523
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
524
|
+
viewBox: "0 0 510 510",
|
|
525
|
+
fill: color
|
|
526
|
+
}, props), React__default.createElement("g", {
|
|
527
|
+
id: "SVGRepo_bgCarrier"
|
|
528
|
+
}), React__default.createElement("g", {
|
|
529
|
+
id: "SVGRepo_tracerCarrier"
|
|
530
|
+
}), React__default.createElement("g", {
|
|
531
|
+
id: "SVGRepo_iconCarrier"
|
|
532
|
+
}, React__default.createElement("g", null, React__default.createElement("g", null, React__default.createElement("path", {
|
|
533
|
+
d: "M255,0C114.615,0,0,114.615,0,255s114.615,255,255,255s255-114.615,255-255S395.385,0,255,0z M255,459c-114.75,0-207-92.25-207-207c0-114.75,92.25-207,207-207c114.75,0,207,92.25,207,207C462,366.75,369.75,459,255,459z",
|
|
534
|
+
fill: color
|
|
535
|
+
}), React__default.createElement("path", {
|
|
536
|
+
d: "M255,140.25c11.05,0,20-8.95,20-20s-8.95-20-20-20s-20,8.95-20,20S243.95,140.25,255,140.25z",
|
|
537
|
+
fill: color
|
|
538
|
+
}), React__default.createElement("path", {
|
|
539
|
+
d: "M265,357c0,11.05-8.95,20-20,20s-20-8.95-20-20v-175c0-11.05,8.95-20,20-20s20,8.95,20,20V357z",
|
|
540
|
+
fill: color
|
|
541
|
+
}))))));
|
|
542
|
+
};
|
|
543
|
+
|
|
444
544
|
var IconSizes = {
|
|
445
545
|
xs: 12,
|
|
446
546
|
sm: 14,
|
|
@@ -454,7 +554,7 @@ var IconSizes = {
|
|
|
454
554
|
'6xl': 64
|
|
455
555
|
};
|
|
456
556
|
|
|
457
|
-
var _excluded$
|
|
557
|
+
var _excluded$e = ["children", "href", "iconSize", "underline", "isHovered", "isExternal", "styles", "setIsHovered"];
|
|
458
558
|
var LinkView = function LinkView(_ref) {
|
|
459
559
|
var children = _ref.children,
|
|
460
560
|
_ref$href = _ref.href,
|
|
@@ -474,7 +574,7 @@ var LinkView = function LinkView(_ref) {
|
|
|
474
574
|
} : _ref$styles,
|
|
475
575
|
_ref$setIsHovered = _ref.setIsHovered,
|
|
476
576
|
setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
|
|
477
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
577
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
|
478
578
|
var handleHover = function handleHover() {
|
|
479
579
|
if (underline === 'hover') setIsHovered(true);
|
|
480
580
|
};
|
|
@@ -505,7 +605,9 @@ var LinkComponent = function LinkComponent(props) {
|
|
|
505
605
|
var Link = LinkComponent;
|
|
506
606
|
|
|
507
607
|
var ButtonSizes = {
|
|
608
|
+
// Defines a constant 'ButtonSizes' as a mapping from 'Size' to corresponding 'CSSProperties'.
|
|
508
609
|
xs: {
|
|
610
|
+
// Establishes style configuration for extra-small (xs) button size.
|
|
509
611
|
width: 79,
|
|
510
612
|
paddingTop: 8,
|
|
511
613
|
paddingBottom: 8,
|
|
@@ -524,6 +626,7 @@ var ButtonSizes = {
|
|
|
524
626
|
paddingRight: 16,
|
|
525
627
|
fontWeight: 600,
|
|
526
628
|
fontSize: 'sm',
|
|
629
|
+
// Establishes style configuration for medium (md) button size.
|
|
527
630
|
lineHeight: 20,
|
|
528
631
|
letterSpacing: 1.25
|
|
529
632
|
},
|
|
@@ -533,6 +636,7 @@ var ButtonSizes = {
|
|
|
533
636
|
paddingBottom: 12,
|
|
534
637
|
paddingLeft: 18,
|
|
535
638
|
paddingRight: 18,
|
|
639
|
+
// Establishes style configuration for large (lg) button size.
|
|
536
640
|
fontWeight: 600,
|
|
537
641
|
fontSize: 'md',
|
|
538
642
|
lineHeight: 24,
|
|
@@ -542,6 +646,7 @@ var ButtonSizes = {
|
|
|
542
646
|
width: 178,
|
|
543
647
|
paddingTop: 14,
|
|
544
648
|
paddingBottom: 14,
|
|
649
|
+
// Establishes style configuration for extra-large (xl) button size.
|
|
545
650
|
paddingLeft: 22,
|
|
546
651
|
paddingRight: 22,
|
|
547
652
|
fontWeight: 600,
|
|
@@ -552,28 +657,38 @@ var ButtonSizes = {
|
|
|
552
657
|
xl: {
|
|
553
658
|
width: 220,
|
|
554
659
|
paddingTop: 16,
|
|
660
|
+
// Defines a constant 'ButtonShapes' with style properties for different button shapes such as 'sharp', 'rounded', and 'pillShaped'.
|
|
555
661
|
paddingBottom: 16,
|
|
662
|
+
// Sets the border-radius for a sharp-edged button shape to '0'.
|
|
556
663
|
paddingLeft: 26,
|
|
664
|
+
// Sets the border-radius for a rounded button shape to '4'.
|
|
557
665
|
paddingRight: 26,
|
|
666
|
+
// Sets the border-radius for a pill-shaped button to '24'.
|
|
558
667
|
fontWeight: 600,
|
|
559
668
|
fontSize: 'xl',
|
|
669
|
+
// Defines a constant 'IconSizes' as a mapping from 'Size' to corresponding 'CSSProperties' for icons.
|
|
560
670
|
lineHeight: 24,
|
|
671
|
+
// Sets the width, height, and padding for icons of extra-small size.
|
|
561
672
|
letterSpacing: 1.25
|
|
562
673
|
}
|
|
563
674
|
};
|
|
564
675
|
var ButtonShapes = {
|
|
676
|
+
// Sets the width, height, and padding for icons of small size.
|
|
565
677
|
sharp: 0,
|
|
566
678
|
rounded: 4,
|
|
567
679
|
pillShaped: 24
|
|
568
680
|
};
|
|
681
|
+
// Sets the width, height, and padding for icons of medium size.
|
|
569
682
|
var IconSizes$1 = {
|
|
570
683
|
xs: {
|
|
571
684
|
width: 24,
|
|
572
685
|
height: 24,
|
|
686
|
+
// Sets the width, height, and padding for icons of large size.
|
|
573
687
|
padding: 12
|
|
574
688
|
},
|
|
575
689
|
sm: {
|
|
576
690
|
width: 24,
|
|
691
|
+
// Sets the width, height, and padding for icons of extra-large size.
|
|
577
692
|
height: 24,
|
|
578
693
|
padding: 15
|
|
579
694
|
},
|
|
@@ -612,7 +727,7 @@ var DefaultSpeeds = {
|
|
|
612
727
|
slow: 300
|
|
613
728
|
};
|
|
614
729
|
|
|
615
|
-
var _excluded$
|
|
730
|
+
var _excluded$f = ["size", "speed", "color"],
|
|
616
731
|
_excluded2 = ["size", "speed", "color"],
|
|
617
732
|
_excluded3 = ["size", "speed", "color"],
|
|
618
733
|
_excluded4 = ["size", "children", "textColor", "loaderColor", "type", "speed", "textPosition"];
|
|
@@ -623,7 +738,7 @@ var DefaultSpinner = function DefaultSpinner(_ref) {
|
|
|
623
738
|
speed = _ref$speed === void 0 ? 'normal' : _ref$speed,
|
|
624
739
|
_ref$color = _ref.color,
|
|
625
740
|
color = _ref$color === void 0 ? 'theme.loading' : _ref$color,
|
|
626
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
741
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$f);
|
|
627
742
|
var theme = appStudio.useTheme();
|
|
628
743
|
var colorStyle = theme.getColor(color);
|
|
629
744
|
var sizeStyle = typeof size === 'number' ? size : DefaultSizes[size];
|
|
@@ -797,7 +912,7 @@ var LoaderComponent = function LoaderComponent(props) {
|
|
|
797
912
|
*/
|
|
798
913
|
var Loader = LoaderComponent;
|
|
799
914
|
|
|
800
|
-
var _excluded$
|
|
915
|
+
var _excluded$g = ["icon", "shadow", "children", "ariaLabel", "externalHref", "isAuto", "isFilled", "isIconRounded", "isLoading", "isDisabled", "size", "variant", "iconPosition", "colorScheme", "shape", "onClick", "loaderProps", "loaderPosition", "effect", "isHovered"];
|
|
801
916
|
var ButtonView = function ButtonView(_ref) {
|
|
802
917
|
var _props$onClick;
|
|
803
918
|
var icon = _ref.icon,
|
|
@@ -834,7 +949,7 @@ var ButtonView = function ButtonView(_ref) {
|
|
|
834
949
|
_ref$effect = _ref.effect,
|
|
835
950
|
effect = _ref$effect === void 0 ? 'default' : _ref$effect,
|
|
836
951
|
isHovered = _ref.isHovered,
|
|
837
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
952
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$g);
|
|
838
953
|
var isActive = !(isDisabled || isLoading);
|
|
839
954
|
var defaultNativeProps = {
|
|
840
955
|
disabled: !isActive
|
|
@@ -844,6 +959,7 @@ var ButtonView = function ButtonView(_ref) {
|
|
|
844
959
|
var reverse = isHovered && effect === 'reverse';
|
|
845
960
|
var ButtonVariants = {
|
|
846
961
|
filled: {
|
|
962
|
+
// Defines CSS properties for 'link' variant of the button with conditional styles based on reverse state, includes text decoration.
|
|
847
963
|
backgroundColor: reverse ? 'transparent' : buttonColor,
|
|
848
964
|
color: reverse ? buttonColor : 'color.white',
|
|
849
965
|
borderWidth: 1,
|
|
@@ -852,15 +968,20 @@ var ButtonView = function ButtonView(_ref) {
|
|
|
852
968
|
},
|
|
853
969
|
outline: {
|
|
854
970
|
backgroundColor: reverse ? buttonColor : 'transparent',
|
|
971
|
+
// Defines CSS properties for 'ghost' variant of the button with conditional styles based on reverse state.
|
|
855
972
|
borderWidth: 1,
|
|
856
973
|
borderStyle: 'solid',
|
|
857
974
|
borderColor: reverse ? buttonColor : colorScheme,
|
|
975
|
+
// Fetches size-specific styles from ButtonSizes based on the 'size' prop.
|
|
858
976
|
color: reverse ? 'white' : buttonColor
|
|
859
977
|
},
|
|
978
|
+
// Adjusts button width based on isAuto and isFilled properties, using buttonSizeStyles for fallback width.
|
|
860
979
|
link: {
|
|
861
980
|
backgroundColor: 'transparent',
|
|
981
|
+
// Changes padding for the button based on whether isIconRounded is true or false.
|
|
862
982
|
borderWidth: 1,
|
|
863
983
|
borderStyle: 'solid',
|
|
984
|
+
// Creates the content for the button including loaders and icons positioned based on their respective properties.
|
|
864
985
|
borderColor: reverse ? buttonColor : 'transparent',
|
|
865
986
|
color: buttonColor,
|
|
866
987
|
textDecoration: reverse ? 'none' : 'underline'
|
|
@@ -873,6 +994,7 @@ var ButtonView = function ButtonView(_ref) {
|
|
|
873
994
|
borderColor: reverse ? buttonColor : 'transparent'
|
|
874
995
|
}
|
|
875
996
|
};
|
|
997
|
+
// Executes rendering of the button or a link element based on the variant; applies conditional rendering for externalHref in 'link' variant.
|
|
876
998
|
var buttonSizeStyles = ButtonSizes[size];
|
|
877
999
|
var buttonVariant = ButtonVariants[variant];
|
|
878
1000
|
var scaleWidth = {
|
|
@@ -909,23 +1031,32 @@ var ButtonView = function ButtonView(_ref) {
|
|
|
909
1031
|
}, content) : content);
|
|
910
1032
|
};
|
|
911
1033
|
|
|
1034
|
+
// Importing a custom hook to manage the state specific to the button component.
|
|
912
1035
|
var ButtonComponent = function ButtonComponent(props) {
|
|
1036
|
+
// Importing the view part of the button, which is presumably a presentational component.
|
|
913
1037
|
var _useButtonState = useButtonState(),
|
|
914
1038
|
isHovered = _useButtonState.isHovered,
|
|
915
1039
|
setIsHovered = _useButtonState.setIsHovered;
|
|
1040
|
+
// Defining the button component with generic React Functional Component type augmented with ButtonProps type.
|
|
916
1041
|
var handleHover = function handleHover() {
|
|
917
1042
|
return setIsHovered(!isHovered);
|
|
918
1043
|
};
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
1044
|
+
// Destructuring the state and state update function from the custom hook for button state management.
|
|
1045
|
+
return (
|
|
1046
|
+
// Defines a function to toggle the hover state of the button.
|
|
1047
|
+
React__default.createElement(ButtonView, Object.assign({
|
|
1048
|
+
isHovered: isHovered,
|
|
1049
|
+
// Rendering the ButtonView component and spreading the received props on it.
|
|
1050
|
+
setIsHovered: setIsHovered,
|
|
1051
|
+
// Passing the isHovered state and the setIsHovered function to the ButtonView.
|
|
1052
|
+
onMouseEnter: handleHover,
|
|
1053
|
+
// Binding handleHover function to onMouseEnter and onMouseLeave events to toggle hover effect.
|
|
1054
|
+
onMouseLeave: handleHover
|
|
1055
|
+
}, props))
|
|
1056
|
+
);
|
|
1057
|
+
// Exports the Button component for use in other parts of the application.
|
|
925
1058
|
};
|
|
926
|
-
|
|
927
|
-
* Buttons allow us to trigger an event or an action with a single click.
|
|
928
|
-
*/
|
|
1059
|
+
|
|
929
1060
|
var Button = ButtonComponent;
|
|
930
1061
|
|
|
931
1062
|
var useCheckboxState = function useCheckboxState(_ref) {
|
|
@@ -945,40 +1076,49 @@ var useCheckboxState = function useCheckboxState(_ref) {
|
|
|
945
1076
|
};
|
|
946
1077
|
};
|
|
947
1078
|
|
|
1079
|
+
// Import Headings type definition from Label.type module for type safety and consistency.
|
|
948
1080
|
var HeadingSizes = {
|
|
1081
|
+
// Initialize a constant 'HeadingSizes' to define styles for different heading levels.
|
|
949
1082
|
h1: {
|
|
1083
|
+
// Use TypeScript's 'Record' utility type to ensure the object matches the shape of 'Headings'.
|
|
950
1084
|
fontSize: 96,
|
|
1085
|
+
// Define style properties for 'h1' heading tag, including font size, line height, and letter spacing.
|
|
951
1086
|
lineHeight: 112,
|
|
952
1087
|
letterSpacing: -1.5
|
|
953
1088
|
},
|
|
954
1089
|
h2: {
|
|
955
1090
|
fontSize: 60,
|
|
1091
|
+
// Define style properties for 'h2' heading tag similar to 'h1', but with adjusted values for size and spacing.
|
|
956
1092
|
lineHeight: 71,
|
|
957
1093
|
letterSpacing: -0.5
|
|
958
1094
|
},
|
|
959
1095
|
h3: {
|
|
960
1096
|
fontSize: 48,
|
|
1097
|
+
// Define style properties for 'h3' heading tag with a standard letter spacing of 0.
|
|
961
1098
|
lineHeight: 57,
|
|
962
1099
|
letterSpacing: 0
|
|
963
1100
|
},
|
|
964
1101
|
h4: {
|
|
965
1102
|
fontSize: 34,
|
|
1103
|
+
// Provide style properties for 'h4' heading tag, with a slight increase in letter spacing.
|
|
966
1104
|
lineHeight: 40,
|
|
967
1105
|
letterSpacing: 0.25
|
|
968
1106
|
},
|
|
969
1107
|
h5: {
|
|
970
1108
|
fontSize: 24,
|
|
1109
|
+
// Set the 'h5' heading tag styles, opting for no additional letter spacing.
|
|
971
1110
|
lineHeight: 28,
|
|
972
1111
|
letterSpacing: 0
|
|
973
1112
|
},
|
|
974
1113
|
h6: {
|
|
975
1114
|
fontSize: 20,
|
|
1115
|
+
// Set the 'h6' heading tag styles, with the smallest font size and a subtle letter spacing.
|
|
976
1116
|
lineHeight: 24,
|
|
977
1117
|
letterSpacing: 0.15
|
|
978
1118
|
}
|
|
979
1119
|
};
|
|
980
1120
|
|
|
981
|
-
var _excluded$
|
|
1121
|
+
var _excluded$h = ["children", "heading", "isItalic", "isUnderlined", "isStriked", "weight", "size"];
|
|
982
1122
|
var LabelView = function LabelView(_ref) {
|
|
983
1123
|
var children = _ref.children,
|
|
984
1124
|
heading = _ref.heading,
|
|
@@ -992,22 +1132,37 @@ var LabelView = function LabelView(_ref) {
|
|
|
992
1132
|
weight = _ref$weight === void 0 ? 'normal' : _ref$weight,
|
|
993
1133
|
_ref$size = _ref.size,
|
|
994
1134
|
size = _ref$size === void 0 ? 'sm' : _ref$size,
|
|
995
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
1135
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$h);
|
|
1136
|
+
// The fontStyle prop toggles between 'italic' and 'normal' based on the 'isItalic' boolean prop.
|
|
996
1137
|
var headingStyles = heading ? HeadingSizes[heading] : {};
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1138
|
+
// fontWeight is derived from the Typography module, ensuring consistent font weighting across the app.
|
|
1139
|
+
return (
|
|
1140
|
+
// textDecoration conditionally applies 'line-through' or 'underline' based on respective boolean props; defaults to 'none' if both are false.
|
|
1141
|
+
React__default.createElement(appStudio.Element, Object.assign({
|
|
1142
|
+
as: "label",
|
|
1143
|
+
// Spreads any additional style properties from headingStyles into the Element if a heading size is specified.
|
|
1144
|
+
width: "100%",
|
|
1145
|
+
// Spreads the rest of the props to support extensibility of the LabelView component for future use cases.
|
|
1146
|
+
fontSize: size,
|
|
1147
|
+
// Includes children elements inside the Element, allowing for nested content within the label.
|
|
1148
|
+
fontStyle: isItalic ? 'italic' : 'normal',
|
|
1149
|
+
fontWeight: appStudio.Typography.fontWeights[weight],
|
|
1150
|
+
textDecoration: isStriked ? 'line-through' : isUnderlined ? 'underline' : 'none'
|
|
1151
|
+
}, headingStyles, props), children)
|
|
1152
|
+
);
|
|
1005
1153
|
};
|
|
1006
1154
|
|
|
1155
|
+
// Import custom type 'LabelProps' to type check the properties passed into the Label component.
|
|
1007
1156
|
var LabelComponent = function LabelComponent(props) {
|
|
1008
|
-
return
|
|
1157
|
+
return (
|
|
1158
|
+
// Import 'LabelView' as a visual component for the label, separating the view from business logic.
|
|
1159
|
+
React__default.createElement(LabelView, Object.assign({}, props))
|
|
1160
|
+
// Define 'LabelComponent' as a functional component that uses React's FC type for type checking and utilizing React features.
|
|
1161
|
+
);
|
|
1009
1162
|
};
|
|
1163
|
+
// Pass all properties received by 'LabelComponent' to 'LabelView' using the spread syntax, ensuring it has all props needed for rendering.
|
|
1010
1164
|
var Label = LabelComponent;
|
|
1165
|
+
// Export the 'LabelComponent' as 'Label' to be reused throughout the project.
|
|
1011
1166
|
|
|
1012
1167
|
var Sizes = {
|
|
1013
1168
|
xs: {
|
|
@@ -1064,7 +1219,134 @@ var IconSizes$2 = {
|
|
|
1064
1219
|
'6xl': 60
|
|
1065
1220
|
};
|
|
1066
1221
|
|
|
1067
|
-
var
|
|
1222
|
+
var HeadingSizes$1 = {
|
|
1223
|
+
h1: {
|
|
1224
|
+
fontSize: 96,
|
|
1225
|
+
lineHeight: 112,
|
|
1226
|
+
letterSpacing: -1.5
|
|
1227
|
+
},
|
|
1228
|
+
h2: {
|
|
1229
|
+
fontSize: 60,
|
|
1230
|
+
lineHeight: 71,
|
|
1231
|
+
letterSpacing: -0.5
|
|
1232
|
+
},
|
|
1233
|
+
h3: {
|
|
1234
|
+
fontSize: 48,
|
|
1235
|
+
lineHeight: 57,
|
|
1236
|
+
letterSpacing: 0
|
|
1237
|
+
},
|
|
1238
|
+
h4: {
|
|
1239
|
+
fontSize: 34,
|
|
1240
|
+
lineHeight: 40,
|
|
1241
|
+
letterSpacing: 0.25
|
|
1242
|
+
},
|
|
1243
|
+
h5: {
|
|
1244
|
+
fontSize: 24,
|
|
1245
|
+
lineHeight: 28,
|
|
1246
|
+
letterSpacing: 0
|
|
1247
|
+
},
|
|
1248
|
+
h6: {
|
|
1249
|
+
fontSize: 20,
|
|
1250
|
+
lineHeight: 24,
|
|
1251
|
+
letterSpacing: 0.15
|
|
1252
|
+
}
|
|
1253
|
+
};
|
|
1254
|
+
|
|
1255
|
+
var _excluded$i = ["children", "heading", "maxLines", "isItalic", "isUnderlined", "isSub", "isSup", "isStriked", "isTruncated", "weight", "size"];
|
|
1256
|
+
var TextContent = function TextContent(_ref) {
|
|
1257
|
+
var children = _ref.children,
|
|
1258
|
+
isSub = _ref.isSub,
|
|
1259
|
+
isSup = _ref.isSup;
|
|
1260
|
+
return React__default.createElement(React__default.Fragment, null, typeof children === 'string' ? React__default.createElement(React__default.Fragment, null, isSub && React__default.createElement("sup", null, children), isSup && React__default.createElement("sup", null, children), !isSub && !isSup && React__default.createElement(React__default.Fragment, null, children)) : children);
|
|
1261
|
+
};
|
|
1262
|
+
var TruncateText = function TruncateText(_ref2) {
|
|
1263
|
+
var text = _ref2.text,
|
|
1264
|
+
_ref2$maxLines = _ref2.maxLines,
|
|
1265
|
+
maxLines = _ref2$maxLines === void 0 ? 1 : _ref2$maxLines;
|
|
1266
|
+
var containerRef = React.useRef(null);
|
|
1267
|
+
var _useState = React.useState(text.length),
|
|
1268
|
+
truncatedLength = _useState[0],
|
|
1269
|
+
setTruncatedLength = _useState[1];
|
|
1270
|
+
React.useEffect(function () {
|
|
1271
|
+
var textNode = containerRef.current;
|
|
1272
|
+
if (!textNode) return;
|
|
1273
|
+
var updateTruncatedText = function updateTruncatedText() {
|
|
1274
|
+
var comLineHeight = getComputedStyle(textNode).lineHeight;
|
|
1275
|
+
var lineHeight = comLineHeight !== 'normal' ? parseFloat(comLineHeight) : 20;
|
|
1276
|
+
var maxHeight = lineHeight * maxLines;
|
|
1277
|
+
var start = 0;
|
|
1278
|
+
var end = text.length;
|
|
1279
|
+
var middle;
|
|
1280
|
+
while (start <= end) {
|
|
1281
|
+
middle = Math.floor((start + end) / 2);
|
|
1282
|
+
textNode.innerText = text.substring(0, middle) + '...';
|
|
1283
|
+
var currentHeight = textNode.offsetHeight;
|
|
1284
|
+
if (currentHeight > maxHeight) {
|
|
1285
|
+
end = middle - 1;
|
|
1286
|
+
} else {
|
|
1287
|
+
start = middle + 1;
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
setTruncatedLength(end);
|
|
1291
|
+
};
|
|
1292
|
+
updateTruncatedText();
|
|
1293
|
+
}, [text, maxLines]);
|
|
1294
|
+
var displayText = text.length > truncatedLength ? text.substring(0, truncatedLength) + '...' : text;
|
|
1295
|
+
return React__default.createElement("div", {
|
|
1296
|
+
ref: containerRef
|
|
1297
|
+
}, displayText);
|
|
1298
|
+
};
|
|
1299
|
+
var TextView = function TextView(_ref3) {
|
|
1300
|
+
var children = _ref3.children,
|
|
1301
|
+
heading = _ref3.heading,
|
|
1302
|
+
maxLines = _ref3.maxLines,
|
|
1303
|
+
_ref3$isItalic = _ref3.isItalic,
|
|
1304
|
+
isItalic = _ref3$isItalic === void 0 ? false : _ref3$isItalic,
|
|
1305
|
+
_ref3$isUnderlined = _ref3.isUnderlined,
|
|
1306
|
+
isUnderlined = _ref3$isUnderlined === void 0 ? false : _ref3$isUnderlined,
|
|
1307
|
+
_ref3$isSub = _ref3.isSub,
|
|
1308
|
+
isSub = _ref3$isSub === void 0 ? false : _ref3$isSub,
|
|
1309
|
+
_ref3$isSup = _ref3.isSup,
|
|
1310
|
+
isSup = _ref3$isSup === void 0 ? false : _ref3$isSup,
|
|
1311
|
+
_ref3$isStriked = _ref3.isStriked,
|
|
1312
|
+
isStriked = _ref3$isStriked === void 0 ? false : _ref3$isStriked,
|
|
1313
|
+
_ref3$isTruncated = _ref3.isTruncated,
|
|
1314
|
+
isTruncated = _ref3$isTruncated === void 0 ? false : _ref3$isTruncated,
|
|
1315
|
+
_ref3$weight = _ref3.weight,
|
|
1316
|
+
weight = _ref3$weight === void 0 ? 'normal' : _ref3$weight,
|
|
1317
|
+
_ref3$size = _ref3.size,
|
|
1318
|
+
size = _ref3$size === void 0 ? 'md' : _ref3$size,
|
|
1319
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded$i);
|
|
1320
|
+
var headingStyles = heading ? HeadingSizes$1[heading] : {};
|
|
1321
|
+
var noLineBreak = isSub || isSup ? {
|
|
1322
|
+
display: 'inline'
|
|
1323
|
+
} : {};
|
|
1324
|
+
var fontSize = appStudio.Typography.fontSizes[size];
|
|
1325
|
+
return React__default.createElement(appStudio.Element, Object.assign({
|
|
1326
|
+
role: "text",
|
|
1327
|
+
fontSize: fontSize,
|
|
1328
|
+
lineHeight: appStudio.Typography.lineHeights[size],
|
|
1329
|
+
fontStyle: isItalic ? 'italic' : 'normal',
|
|
1330
|
+
fontWeight: appStudio.Typography.fontWeights[weight],
|
|
1331
|
+
textDecoration: isStriked ? 'line-through' : isUnderlined ? 'underline' : 'none'
|
|
1332
|
+
}, noLineBreak, headingStyles, props), isTruncated && maxLines && typeof children === 'string' ? React__default.createElement(TruncateText, {
|
|
1333
|
+
text: children,
|
|
1334
|
+
maxLines: maxLines
|
|
1335
|
+
}) : React__default.createElement(TextContent, Object.assign({
|
|
1336
|
+
isSub: isSub,
|
|
1337
|
+
isSup: isSup
|
|
1338
|
+
}, props), children));
|
|
1339
|
+
};
|
|
1340
|
+
|
|
1341
|
+
var TextComponent = function TextComponent(props) {
|
|
1342
|
+
return React__default.createElement(TextView, Object.assign({}, props));
|
|
1343
|
+
};
|
|
1344
|
+
/**
|
|
1345
|
+
* The Text component is a simple component that renders a text string or paragraphs as a DOM element in the UI. It is a <p> tag by default.
|
|
1346
|
+
*/
|
|
1347
|
+
var Text = TextComponent;
|
|
1348
|
+
|
|
1349
|
+
var _excluded$j = ["id", "icon", "name", "label", "isChecked", "onChange", "onValueChange", "shadow", "labelPosition", "size", "colorScheme", "error", "isSelected", "isHovered", "isDisabled", "isReadOnly", "isIndeterminate", "defaultIsSelected", "setIsSelected", "setIsHovered", "styles", "infoText"];
|
|
1068
1350
|
var CheckboxView = function CheckboxView(_ref) {
|
|
1069
1351
|
var id = _ref.id,
|
|
1070
1352
|
icon = _ref.icon,
|
|
@@ -1101,7 +1383,8 @@ var CheckboxView = function CheckboxView(_ref) {
|
|
|
1101
1383
|
checkbox: {},
|
|
1102
1384
|
label: {}
|
|
1103
1385
|
} : _ref$styles,
|
|
1104
|
-
|
|
1386
|
+
infoText = _ref.infoText,
|
|
1387
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$j);
|
|
1105
1388
|
var handleHover = function handleHover() {
|
|
1106
1389
|
return setIsHovered(!isHovered);
|
|
1107
1390
|
};
|
|
@@ -1142,9 +1425,22 @@ var CheckboxView = function CheckboxView(_ref) {
|
|
|
1142
1425
|
onMouseEnter: handleHover,
|
|
1143
1426
|
onMouseLeave: handleHover,
|
|
1144
1427
|
size: appStudio.Typography.fontSizes[size]
|
|
1145
|
-
}, checkboxStyle.container, props),
|
|
1428
|
+
}, checkboxStyle.container, props), React__default.createElement(Layout.Vertical, {
|
|
1429
|
+
gap: 8
|
|
1430
|
+
}, React__default.createElement(Layout.Horizontal, {
|
|
1431
|
+
gap: 10,
|
|
1432
|
+
alignItems: "center"
|
|
1433
|
+
}, labelPosition === 'left' && label && React__default.createElement(Text, Object.assign({
|
|
1434
|
+
size: size
|
|
1435
|
+
}, styles == null ? void 0 : styles.label), label), React__default.createElement(Center, Object.assign({}, checkboxStyle.checkbox), isIndeterminate ? React__default.createElement(IndeterminateSvg, null) : (isChecked || isSelected) && (icon != null ? icon : React__default.createElement(CheckSvg, {
|
|
1146
1436
|
size: IconSizes$2[size]
|
|
1147
|
-
}))), labelPosition === 'right' && label && React__default.createElement(
|
|
1437
|
+
}))), labelPosition === 'right' && label && React__default.createElement(Text, Object.assign({
|
|
1438
|
+
size: size
|
|
1439
|
+
}, styles == null ? void 0 : styles.label), label)), infoText && React__default.createElement(Text, Object.assign({
|
|
1440
|
+
marginLeft: labelPosition === 'left' ? 0 : 27,
|
|
1441
|
+
color: "color.gray.400",
|
|
1442
|
+
size: "sm"
|
|
1443
|
+
}, styles == null ? void 0 : styles.infoText), infoText)));
|
|
1148
1444
|
};
|
|
1149
1445
|
|
|
1150
1446
|
var CheckboxComponent = function CheckboxComponent(props) {
|
|
@@ -2629,154 +2925,27 @@ var useCountryPickerState = function useCountryPickerState(_ref) {
|
|
|
2629
2925
|
isHovered = _React$useState5[0],
|
|
2630
2926
|
setIsHovered = _React$useState5[1];
|
|
2631
2927
|
return {
|
|
2632
|
-
hide: hide,
|
|
2633
|
-
setHide: setHide,
|
|
2634
|
-
newOptions: newOptions,
|
|
2635
|
-
setNewOptions: setNewOptions,
|
|
2636
|
-
isHovered: isHovered,
|
|
2637
|
-
setIsHovered: setIsHovered,
|
|
2638
|
-
isFocused: isFocused,
|
|
2639
|
-
setIsFocused: setIsFocused,
|
|
2640
|
-
value: value,
|
|
2641
|
-
setValue: setValue
|
|
2642
|
-
};
|
|
2643
|
-
};
|
|
2644
|
-
|
|
2645
|
-
var HeadingSizes$1 = {
|
|
2646
|
-
h1: {
|
|
2647
|
-
fontSize: 96,
|
|
2648
|
-
lineHeight: 112,
|
|
2649
|
-
letterSpacing: -1.5
|
|
2650
|
-
},
|
|
2651
|
-
h2: {
|
|
2652
|
-
fontSize: 60,
|
|
2653
|
-
lineHeight: 71,
|
|
2654
|
-
letterSpacing: -0.5
|
|
2655
|
-
},
|
|
2656
|
-
h3: {
|
|
2657
|
-
fontSize: 48,
|
|
2658
|
-
lineHeight: 57,
|
|
2659
|
-
letterSpacing: 0
|
|
2660
|
-
},
|
|
2661
|
-
h4: {
|
|
2662
|
-
fontSize: 34,
|
|
2663
|
-
lineHeight: 40,
|
|
2664
|
-
letterSpacing: 0.25
|
|
2665
|
-
},
|
|
2666
|
-
h5: {
|
|
2667
|
-
fontSize: 24,
|
|
2668
|
-
lineHeight: 28,
|
|
2669
|
-
letterSpacing: 0
|
|
2670
|
-
},
|
|
2671
|
-
h6: {
|
|
2672
|
-
fontSize: 20,
|
|
2673
|
-
lineHeight: 24,
|
|
2674
|
-
letterSpacing: 0.15
|
|
2675
|
-
}
|
|
2676
|
-
};
|
|
2677
|
-
|
|
2678
|
-
var _excluded$g = ["children", "heading", "maxLines", "isItalic", "isUnderlined", "isSub", "isSup", "isStriked", "isTruncated", "weight", "size"];
|
|
2679
|
-
var TextContent = function TextContent(_ref) {
|
|
2680
|
-
var children = _ref.children,
|
|
2681
|
-
isSub = _ref.isSub,
|
|
2682
|
-
isSup = _ref.isSup;
|
|
2683
|
-
return React__default.createElement(React__default.Fragment, null, typeof children === 'string' ? React__default.createElement(React__default.Fragment, null, isSub && React__default.createElement("sup", null, children), isSup && React__default.createElement("sup", null, children), !isSub && !isSup && React__default.createElement(React__default.Fragment, null, children)) : children);
|
|
2684
|
-
};
|
|
2685
|
-
var TruncateText = function TruncateText(_ref2) {
|
|
2686
|
-
var text = _ref2.text,
|
|
2687
|
-
_ref2$maxLines = _ref2.maxLines,
|
|
2688
|
-
maxLines = _ref2$maxLines === void 0 ? 1 : _ref2$maxLines;
|
|
2689
|
-
var containerRef = React.useRef(null);
|
|
2690
|
-
var _useState = React.useState(text.length),
|
|
2691
|
-
truncatedLength = _useState[0],
|
|
2692
|
-
setTruncatedLength = _useState[1];
|
|
2693
|
-
React.useEffect(function () {
|
|
2694
|
-
var textNode = containerRef.current;
|
|
2695
|
-
if (!textNode) return;
|
|
2696
|
-
var updateTruncatedText = function updateTruncatedText() {
|
|
2697
|
-
var comLineHeight = getComputedStyle(textNode).lineHeight;
|
|
2698
|
-
var lineHeight = comLineHeight !== 'normal' ? parseFloat(comLineHeight) : 20;
|
|
2699
|
-
var maxHeight = lineHeight * maxLines;
|
|
2700
|
-
var start = 0;
|
|
2701
|
-
var end = text.length;
|
|
2702
|
-
var middle;
|
|
2703
|
-
while (start <= end) {
|
|
2704
|
-
middle = Math.floor((start + end) / 2);
|
|
2705
|
-
textNode.innerText = text.substring(0, middle) + '...';
|
|
2706
|
-
var currentHeight = textNode.offsetHeight;
|
|
2707
|
-
if (currentHeight > maxHeight) {
|
|
2708
|
-
end = middle - 1;
|
|
2709
|
-
} else {
|
|
2710
|
-
start = middle + 1;
|
|
2711
|
-
}
|
|
2712
|
-
}
|
|
2713
|
-
setTruncatedLength(end);
|
|
2714
|
-
};
|
|
2715
|
-
updateTruncatedText();
|
|
2716
|
-
}, [text, maxLines]);
|
|
2717
|
-
var displayText = text.length > truncatedLength ? text.substring(0, truncatedLength) + '...' : text;
|
|
2718
|
-
return React__default.createElement("div", {
|
|
2719
|
-
ref: containerRef
|
|
2720
|
-
}, displayText);
|
|
2721
|
-
};
|
|
2722
|
-
var TextView = function TextView(_ref3) {
|
|
2723
|
-
var children = _ref3.children,
|
|
2724
|
-
heading = _ref3.heading,
|
|
2725
|
-
maxLines = _ref3.maxLines,
|
|
2726
|
-
_ref3$isItalic = _ref3.isItalic,
|
|
2727
|
-
isItalic = _ref3$isItalic === void 0 ? false : _ref3$isItalic,
|
|
2728
|
-
_ref3$isUnderlined = _ref3.isUnderlined,
|
|
2729
|
-
isUnderlined = _ref3$isUnderlined === void 0 ? false : _ref3$isUnderlined,
|
|
2730
|
-
_ref3$isSub = _ref3.isSub,
|
|
2731
|
-
isSub = _ref3$isSub === void 0 ? false : _ref3$isSub,
|
|
2732
|
-
_ref3$isSup = _ref3.isSup,
|
|
2733
|
-
isSup = _ref3$isSup === void 0 ? false : _ref3$isSup,
|
|
2734
|
-
_ref3$isStriked = _ref3.isStriked,
|
|
2735
|
-
isStriked = _ref3$isStriked === void 0 ? false : _ref3$isStriked,
|
|
2736
|
-
_ref3$isTruncated = _ref3.isTruncated,
|
|
2737
|
-
isTruncated = _ref3$isTruncated === void 0 ? false : _ref3$isTruncated,
|
|
2738
|
-
_ref3$weight = _ref3.weight,
|
|
2739
|
-
weight = _ref3$weight === void 0 ? 'normal' : _ref3$weight,
|
|
2740
|
-
_ref3$size = _ref3.size,
|
|
2741
|
-
size = _ref3$size === void 0 ? 'md' : _ref3$size,
|
|
2742
|
-
props = _objectWithoutPropertiesLoose(_ref3, _excluded$g);
|
|
2743
|
-
var headingStyles = heading ? HeadingSizes$1[heading] : {};
|
|
2744
|
-
var noLineBreak = isSub || isSup ? {
|
|
2745
|
-
display: 'inline'
|
|
2746
|
-
} : {};
|
|
2747
|
-
var fontSize = appStudio.Typography.fontSizes[size];
|
|
2748
|
-
return React__default.createElement(appStudio.Element, Object.assign({
|
|
2749
|
-
role: "text",
|
|
2750
|
-
fontSize: fontSize,
|
|
2751
|
-
lineHeight: appStudio.Typography.lineHeights[size],
|
|
2752
|
-
fontStyle: isItalic ? 'italic' : 'normal',
|
|
2753
|
-
fontWeight: appStudio.Typography.fontWeights[weight],
|
|
2754
|
-
textDecoration: isStriked ? 'line-through' : isUnderlined ? 'underline' : 'none'
|
|
2755
|
-
}, noLineBreak, headingStyles, props), isTruncated && maxLines && typeof children === 'string' ? React__default.createElement(TruncateText, {
|
|
2756
|
-
text: children,
|
|
2757
|
-
maxLines: maxLines
|
|
2758
|
-
}) : React__default.createElement(TextContent, Object.assign({
|
|
2759
|
-
isSub: isSub,
|
|
2760
|
-
isSup: isSup
|
|
2761
|
-
}, props), children));
|
|
2762
|
-
};
|
|
2763
|
-
|
|
2764
|
-
var TextComponent = function TextComponent(props) {
|
|
2765
|
-
return React__default.createElement(TextView, Object.assign({}, props));
|
|
2928
|
+
hide: hide,
|
|
2929
|
+
setHide: setHide,
|
|
2930
|
+
newOptions: newOptions,
|
|
2931
|
+
setNewOptions: setNewOptions,
|
|
2932
|
+
isHovered: isHovered,
|
|
2933
|
+
setIsHovered: setIsHovered,
|
|
2934
|
+
isFocused: isFocused,
|
|
2935
|
+
setIsFocused: setIsFocused,
|
|
2936
|
+
value: value,
|
|
2937
|
+
setValue: setValue
|
|
2938
|
+
};
|
|
2766
2939
|
};
|
|
2767
|
-
/**
|
|
2768
|
-
* The Text component is a simple component that renders a text string or paragraphs as a DOM element in the UI. It is a <p> tag by default.
|
|
2769
|
-
*/
|
|
2770
|
-
var Text = TextComponent;
|
|
2771
2940
|
|
|
2772
|
-
var _excluded$
|
|
2941
|
+
var _excluded$k = ["children", "styles"];
|
|
2773
2942
|
var HelperText = function HelperText(_ref) {
|
|
2774
2943
|
var children = _ref.children,
|
|
2775
2944
|
_ref$styles = _ref.styles,
|
|
2776
2945
|
styles = _ref$styles === void 0 ? {
|
|
2777
2946
|
helperText: {}
|
|
2778
2947
|
} : _ref$styles,
|
|
2779
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
2948
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$k);
|
|
2780
2949
|
return React__default.createElement(Text, Object.assign({
|
|
2781
2950
|
size: "xs",
|
|
2782
2951
|
marginVertical: 0,
|
|
@@ -2785,7 +2954,7 @@ var HelperText = function HelperText(_ref) {
|
|
|
2785
2954
|
}, styles['helperText'], props), children);
|
|
2786
2955
|
};
|
|
2787
2956
|
|
|
2788
|
-
var _excluded$
|
|
2957
|
+
var _excluded$l = ["children", "wrap", "justify", "isReversed"];
|
|
2789
2958
|
var VerticalView = function VerticalView(_ref) {
|
|
2790
2959
|
var children = _ref.children,
|
|
2791
2960
|
_ref$wrap = _ref.wrap,
|
|
@@ -2794,7 +2963,7 @@ var VerticalView = function VerticalView(_ref) {
|
|
|
2794
2963
|
justify = _ref$justify === void 0 ? 'flex-start' : _ref$justify,
|
|
2795
2964
|
_ref$isReversed = _ref.isReversed,
|
|
2796
2965
|
isReversed = _ref$isReversed === void 0 ? false : _ref$isReversed,
|
|
2797
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
2966
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$l);
|
|
2798
2967
|
return React__default.createElement(appStudio.View, Object.assign({
|
|
2799
2968
|
display: "flex",
|
|
2800
2969
|
flexWrap: wrap,
|
|
@@ -2811,14 +2980,14 @@ var VerticalComponent = function VerticalComponent(props) {
|
|
|
2811
2980
|
};
|
|
2812
2981
|
var Vertical = VerticalComponent;
|
|
2813
2982
|
|
|
2814
|
-
var _excluded$
|
|
2983
|
+
var _excluded$m = ["children", "helperText", "error", "styles"];
|
|
2815
2984
|
var FieldContainer = function FieldContainer(_ref) {
|
|
2816
2985
|
var children = _ref.children,
|
|
2817
2986
|
helperText = _ref.helperText,
|
|
2818
2987
|
_ref$error = _ref.error,
|
|
2819
2988
|
error = _ref$error === void 0 ? false : _ref$error,
|
|
2820
2989
|
styles = _ref.styles,
|
|
2821
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
2990
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$m);
|
|
2822
2991
|
return React__default.createElement(Vertical, Object.assign({
|
|
2823
2992
|
gap: 5,
|
|
2824
2993
|
position: "relative"
|
|
@@ -2877,7 +3046,7 @@ var PaddingWithoutLabel = {
|
|
|
2877
3046
|
paddingRight: 36
|
|
2878
3047
|
};
|
|
2879
3048
|
|
|
2880
|
-
var _excluded$
|
|
3049
|
+
var _excluded$n = ["label", "shadow", "children", "value", "size", "shape", "variant", "error", "isWithLabel", "isFocused", "isHovered", "isDisabled", "isReadOnly", "colorScheme", "styles"];
|
|
2881
3050
|
var FieldContent = function FieldContent(_ref) {
|
|
2882
3051
|
var shadow = _ref.shadow,
|
|
2883
3052
|
children = _ref.children,
|
|
@@ -2905,7 +3074,7 @@ var FieldContent = function FieldContent(_ref) {
|
|
|
2905
3074
|
styles = _ref$styles === void 0 ? {
|
|
2906
3075
|
pickerBox: {}
|
|
2907
3076
|
} : _ref$styles,
|
|
2908
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3077
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$n);
|
|
2909
3078
|
var isInteractive = (isHovered || isFocused) && !isDisabled;
|
|
2910
3079
|
var color = error ? 'error' : isInteractive ? colorScheme : 'midgray';
|
|
2911
3080
|
return React__default.createElement(Horizontal, Object.assign({
|
|
@@ -2926,10 +3095,10 @@ var FieldContent = function FieldContent(_ref) {
|
|
|
2926
3095
|
}, isWithLabel ? PadddingWithLabel : PaddingWithoutLabel, shadow, Shapes[shape], InputVariants[variant], styles['box'], props), children);
|
|
2927
3096
|
};
|
|
2928
3097
|
|
|
2929
|
-
var _excluded$
|
|
3098
|
+
var _excluded$o = ["children"];
|
|
2930
3099
|
var FieldIcons = function FieldIcons(_ref) {
|
|
2931
3100
|
var children = _ref.children,
|
|
2932
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3101
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$o);
|
|
2933
3102
|
return React__default.createElement(Center, Object.assign({
|
|
2934
3103
|
gap: 10,
|
|
2935
3104
|
right: 16,
|
|
@@ -2939,7 +3108,7 @@ var FieldIcons = function FieldIcons(_ref) {
|
|
|
2939
3108
|
}, props), children);
|
|
2940
3109
|
};
|
|
2941
3110
|
|
|
2942
|
-
var _excluded$
|
|
3111
|
+
var _excluded$p = ["children", "size", "error", "color", "styles"];
|
|
2943
3112
|
var FieldLabel = function FieldLabel(_ref) {
|
|
2944
3113
|
var children = _ref.children,
|
|
2945
3114
|
_ref$size = _ref.size,
|
|
@@ -2952,7 +3121,7 @@ var FieldLabel = function FieldLabel(_ref) {
|
|
|
2952
3121
|
styles = _ref$styles === void 0 ? {
|
|
2953
3122
|
label: {}
|
|
2954
3123
|
} : _ref$styles,
|
|
2955
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3124
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$p);
|
|
2956
3125
|
return React__default.createElement(Label, Object.assign({
|
|
2957
3126
|
top: 6,
|
|
2958
3127
|
zIndex: 1000,
|
|
@@ -2965,10 +3134,10 @@ var FieldLabel = function FieldLabel(_ref) {
|
|
|
2965
3134
|
}, styles['label'], props), children);
|
|
2966
3135
|
};
|
|
2967
3136
|
|
|
2968
|
-
var _excluded$
|
|
3137
|
+
var _excluded$q = ["children"];
|
|
2969
3138
|
var FieldWrapper = function FieldWrapper(_ref) {
|
|
2970
3139
|
var children = _ref.children,
|
|
2971
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3140
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
|
|
2972
3141
|
return React__default.createElement(Vertical, Object.assign({
|
|
2973
3142
|
width: "100%"
|
|
2974
3143
|
}, props), children);
|
|
@@ -2982,7 +3151,7 @@ var IconSizes$3 = {
|
|
|
2982
3151
|
xl: 16
|
|
2983
3152
|
};
|
|
2984
3153
|
|
|
2985
|
-
var _excluded$
|
|
3154
|
+
var _excluded$r = ["id", "name", "label", "value", "placeholder", "helperText", "hide", "error", "isHovered", "isFocused", "isAutoFocus", "isDisabled", "isReadOnly", "shadow", "newOptions", "size", "variant", "shape", "colorScheme", "onChange", "onBlur", "setHide", "setNewOptions", "setIsHovered", "setIsFocused", "setValue", "styles"];
|
|
2986
3155
|
var CountryList = function CountryList(props) {
|
|
2987
3156
|
return React__default.createElement(appStudio.Element, Object.assign({
|
|
2988
3157
|
as: "ul"
|
|
@@ -3122,7 +3291,7 @@ var CountryPickerView = function CountryPickerView(_ref3) {
|
|
|
3122
3291
|
helperText: {},
|
|
3123
3292
|
box: {}
|
|
3124
3293
|
} : _ref3$styles,
|
|
3125
|
-
props = _objectWithoutPropertiesLoose(_ref3, _excluded$
|
|
3294
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded$r);
|
|
3126
3295
|
var _useTheme = appStudio.useTheme(),
|
|
3127
3296
|
getColor = _useTheme.getColor;
|
|
3128
3297
|
var IconColor = getColor('color.blueGray.700');
|
|
@@ -3260,7 +3429,7 @@ var useDatePickerState = function useDatePickerState() {
|
|
|
3260
3429
|
};
|
|
3261
3430
|
};
|
|
3262
3431
|
|
|
3263
|
-
var _excluded$
|
|
3432
|
+
var _excluded$s = ["id", "icon", "name", "label", "date", "children", "helperText", "shadow", "size", "variant", "shape", "colorScheme", "styles", "error", "isHovered", "isFocused", "isDisabled", "isReadOnly", "setDate", "setIsFocused", "setIsHovered", "onChange", "onChangeText"];
|
|
3264
3433
|
var DatePickerContent = function DatePickerContent(props) {
|
|
3265
3434
|
return React__default.createElement(appStudio.Input, Object.assign({
|
|
3266
3435
|
type: "date"
|
|
@@ -3308,7 +3477,7 @@ var DatePickerView = function DatePickerView(_ref) {
|
|
|
3308
3477
|
setIsHovered = _ref$setIsHovered === void 0 ? function () {} : _ref$setIsHovered,
|
|
3309
3478
|
onChange = _ref.onChange,
|
|
3310
3479
|
onChangeText = _ref.onChangeText,
|
|
3311
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3480
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$s);
|
|
3312
3481
|
var isWithLabel = !!(isFocused && label);
|
|
3313
3482
|
var handleHover = function handleHover() {
|
|
3314
3483
|
return setIsHovered(!isHovered);
|
|
@@ -3433,7 +3602,7 @@ var usePasswordState = function usePasswordState(props) {
|
|
|
3433
3602
|
}, props, textFieldStates);
|
|
3434
3603
|
};
|
|
3435
3604
|
|
|
3436
|
-
var _excluded$
|
|
3605
|
+
var _excluded$t = ["id", "name", "label", "hint", "value", "onChange", "leftChild", "rightChild", "helperText", "placeholder", "onChangeText", "shadow", "styles", "size", "shape", "variant", "colorScheme", "error", "isFocused", "isHovered", "isDisabled", "isReadOnly", "isClearable", "isAutoFocus", "setHint", "setIsFocused", "setIsHovered", "setValue", "onClick", "onFocus", "onBlur"];
|
|
3437
3606
|
var TextFieldInput = function TextFieldInput(props) {
|
|
3438
3607
|
return React__default.createElement(appStudio.Input, Object.assign({
|
|
3439
3608
|
type: "text"
|
|
@@ -3491,7 +3660,7 @@ var TextFieldView = function TextFieldView(_ref) {
|
|
|
3491
3660
|
onFocus = _ref.onFocus,
|
|
3492
3661
|
_ref$onBlur = _ref.onBlur,
|
|
3493
3662
|
onBlur = _ref$onBlur === void 0 ? function () {} : _ref$onBlur,
|
|
3494
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3663
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$t);
|
|
3495
3664
|
var _useTheme = appStudio.useTheme(),
|
|
3496
3665
|
getColor = _useTheme.getColor;
|
|
3497
3666
|
var IconColor = getColor('color.blueGray.700');
|
|
@@ -3599,7 +3768,7 @@ var TextFieldView = function TextFieldView(_ref) {
|
|
|
3599
3768
|
}), rightChild && React__default.createElement(React__default.Fragment, null, rightChild))));
|
|
3600
3769
|
};
|
|
3601
3770
|
|
|
3602
|
-
var _excluded$
|
|
3771
|
+
var _excluded$u = ["visibleIcon", "hiddenIcon"],
|
|
3603
3772
|
_excluded2$1 = ["isVisible", "setIsVisible"];
|
|
3604
3773
|
var PasswordComponent = function PasswordComponent(_ref) {
|
|
3605
3774
|
var _ref$visibleIcon = _ref.visibleIcon,
|
|
@@ -3610,7 +3779,7 @@ var PasswordComponent = function PasswordComponent(_ref) {
|
|
|
3610
3779
|
hiddenIcon = _ref$hiddenIcon === void 0 ? React__default.createElement(CloseEyeSvg, {
|
|
3611
3780
|
size: 14
|
|
3612
3781
|
}) : _ref$hiddenIcon,
|
|
3613
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3782
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$u);
|
|
3614
3783
|
var _usePasswordState = usePasswordState(props),
|
|
3615
3784
|
isVisible = _usePasswordState.isVisible,
|
|
3616
3785
|
setIsVisible = _usePasswordState.setIsVisible,
|
|
@@ -3649,6 +3818,9 @@ var useSelectState = function useSelectState(_ref) {
|
|
|
3649
3818
|
var _React$useState4 = React__default.useState(defaultValue),
|
|
3650
3819
|
value = _React$useState4[0],
|
|
3651
3820
|
setValue = _React$useState4[1];
|
|
3821
|
+
var _React$useState5 = React__default.useState(0),
|
|
3822
|
+
highlightedIndex = _React$useState5[0],
|
|
3823
|
+
setHighlightedIndex = _React$useState5[1];
|
|
3652
3824
|
return {
|
|
3653
3825
|
value: value,
|
|
3654
3826
|
setValue: setValue,
|
|
@@ -3657,13 +3829,15 @@ var useSelectState = function useSelectState(_ref) {
|
|
|
3657
3829
|
isHovered: isHovered,
|
|
3658
3830
|
setIsHovered: setIsHovered,
|
|
3659
3831
|
isFocused: isFocused,
|
|
3660
|
-
setIsFocused: setIsFocused
|
|
3832
|
+
setIsFocused: setIsFocused,
|
|
3833
|
+
highlightedIndex: highlightedIndex,
|
|
3834
|
+
setHighlightedIndex: setHighlightedIndex
|
|
3661
3835
|
};
|
|
3662
3836
|
};
|
|
3663
3837
|
var useItemState = function useItemState() {
|
|
3664
|
-
var _React$
|
|
3665
|
-
isHovered = _React$
|
|
3666
|
-
setIsHovered = _React$
|
|
3838
|
+
var _React$useState6 = React__default.useState(false),
|
|
3839
|
+
isHovered = _React$useState6[0],
|
|
3840
|
+
setIsHovered = _React$useState6[1];
|
|
3667
3841
|
return {
|
|
3668
3842
|
isHovered: isHovered,
|
|
3669
3843
|
setIsHovered: setIsHovered
|
|
@@ -3678,10 +3852,10 @@ var IconSizes$4 = {
|
|
|
3678
3852
|
xl: 16
|
|
3679
3853
|
};
|
|
3680
3854
|
|
|
3681
|
-
var _excluded$
|
|
3855
|
+
var _excluded$v = ["isHovered", "setIsHovered", "option", "size", "callback"],
|
|
3682
3856
|
_excluded2$2 = ["id", "name", "value", "onChange", "isMulti", "isDisabled", "isReadOnly", "options"],
|
|
3683
3857
|
_excluded3$1 = ["option", "size", "removeOption"],
|
|
3684
|
-
_excluded4$1 = ["id", "name", "label", "value", "placeholder", "helperText", "hide", "error", "isMulti", "isFocused", "isHovered", "isDisabled", "isReadOnly", "options", "shadow", "size", "colorScheme", "shape", "variant", "styles", "onChange", "setHide", "setValue", "setIsHovered", "setIsFocused"];
|
|
3858
|
+
_excluded4$1 = ["id", "name", "label", "value", "placeholder", "helperText", "hide", "error", "isMulti", "isFocused", "isHovered", "isDisabled", "isReadOnly", "options", "shadow", "size", "colorScheme", "shape", "variant", "styles", "onChange", "setHide", "setValue", "setIsHovered", "setIsFocused", "setHighlightedIndex", "highlightedIndex"];
|
|
3685
3859
|
var Item = function Item(_ref) {
|
|
3686
3860
|
var isHovered = _ref.isHovered,
|
|
3687
3861
|
setIsHovered = _ref.setIsHovered,
|
|
@@ -3690,7 +3864,7 @@ var Item = function Item(_ref) {
|
|
|
3690
3864
|
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
3691
3865
|
_ref$callback = _ref.callback,
|
|
3692
3866
|
callback = _ref$callback === void 0 ? function () {} : _ref$callback,
|
|
3693
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3867
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$v);
|
|
3694
3868
|
var handleOptionClick = function handleOptionClick(option) {
|
|
3695
3869
|
return callback(option);
|
|
3696
3870
|
};
|
|
@@ -3700,7 +3874,7 @@ var Item = function Item(_ref) {
|
|
|
3700
3874
|
return React__default.createElement(appStudio.Element, Object.assign({
|
|
3701
3875
|
as: "li",
|
|
3702
3876
|
margin: 0,
|
|
3703
|
-
paddingVertical:
|
|
3877
|
+
paddingVertical: 10,
|
|
3704
3878
|
paddingHorizontal: 12,
|
|
3705
3879
|
listStyleType: "none",
|
|
3706
3880
|
onMouseEnter: handleHover,
|
|
@@ -3710,7 +3884,7 @@ var Item = function Item(_ref) {
|
|
|
3710
3884
|
return handleOptionClick(option);
|
|
3711
3885
|
},
|
|
3712
3886
|
backgroundColor: isHovered ? 'trueGray.100' : 'transparent'
|
|
3713
|
-
}, props), option);
|
|
3887
|
+
}, props), React__default.createElement(Text, null, " ", option));
|
|
3714
3888
|
};
|
|
3715
3889
|
var SelectBox = function SelectBox(_ref2) {
|
|
3716
3890
|
var _ref2$size = _ref2.size,
|
|
@@ -3792,7 +3966,9 @@ var DropDown$1 = function DropDown(_ref4) {
|
|
|
3792
3966
|
} : _ref4$styles,
|
|
3793
3967
|
options = _ref4.options,
|
|
3794
3968
|
_ref4$callback = _ref4.callback,
|
|
3795
|
-
callback = _ref4$callback === void 0 ? function () {} : _ref4$callback
|
|
3969
|
+
callback = _ref4$callback === void 0 ? function () {} : _ref4$callback,
|
|
3970
|
+
highlightedIndex = _ref4.highlightedIndex,
|
|
3971
|
+
setHighlightedIndex = _ref4.setHighlightedIndex;
|
|
3796
3972
|
var itemStates = useItemState();
|
|
3797
3973
|
var handleCallback = function handleCallback(option) {
|
|
3798
3974
|
return callback(option);
|
|
@@ -3816,7 +3992,7 @@ var DropDown$1 = function DropDown(_ref4) {
|
|
|
3816
3992
|
width: "100%",
|
|
3817
3993
|
display: "flex",
|
|
3818
3994
|
zIndex: 1000,
|
|
3819
|
-
overflowY: "
|
|
3995
|
+
overflowY: "scroll",
|
|
3820
3996
|
marginTop: 5,
|
|
3821
3997
|
marginLeft: 0,
|
|
3822
3998
|
marginRight: 0,
|
|
@@ -3826,13 +4002,24 @@ var DropDown$1 = function DropDown(_ref4) {
|
|
|
3826
4002
|
position: "absolute",
|
|
3827
4003
|
flexDirection: "column",
|
|
3828
4004
|
backgroundColor: "white",
|
|
3829
|
-
|
|
3830
|
-
|
|
4005
|
+
maxHeight: "200px",
|
|
4006
|
+
style: {
|
|
4007
|
+
scrollbarWidth: 'none' /* For Firefox */,
|
|
4008
|
+
msOverflowStyle: 'none' /* For Internet Explorer and Edge */,
|
|
4009
|
+
'&::-webkit-scrollbar': {
|
|
4010
|
+
display: 'none' /* For Chrome, Safari, and Opera */
|
|
4011
|
+
}
|
|
4012
|
+
}
|
|
4013
|
+
}, shadow, styles['dropDown']), options.map(function (option, index) {
|
|
3831
4014
|
return React__default.createElement(Item, Object.assign({
|
|
3832
4015
|
key: option,
|
|
3833
4016
|
size: size,
|
|
3834
4017
|
option: option,
|
|
3835
|
-
callback: handleCallback
|
|
4018
|
+
callback: handleCallback,
|
|
4019
|
+
backgroundColor: index === highlightedIndex ? 'color.gray.100' : 'transparent',
|
|
4020
|
+
onMouseEnter: function onMouseEnter() {
|
|
4021
|
+
return setHighlightedIndex(index);
|
|
4022
|
+
}
|
|
3836
4023
|
}, itemStates, styles['text']));
|
|
3837
4024
|
}));
|
|
3838
4025
|
};
|
|
@@ -3917,6 +4104,8 @@ var SelectView = function SelectView(_ref6) {
|
|
|
3917
4104
|
setIsHovered = _ref6$setIsHovered === void 0 ? function () {} : _ref6$setIsHovered,
|
|
3918
4105
|
_ref6$setIsFocused = _ref6.setIsFocused,
|
|
3919
4106
|
setIsFocused = _ref6$setIsFocused === void 0 ? function () {} : _ref6$setIsFocused,
|
|
4107
|
+
setHighlightedIndex = _ref6.setHighlightedIndex,
|
|
4108
|
+
highlightedIndex = _ref6.highlightedIndex,
|
|
3920
4109
|
props = _objectWithoutPropertiesLoose(_ref6, _excluded4$1);
|
|
3921
4110
|
var isWithLabel = !!(isFocused && label);
|
|
3922
4111
|
var handleHover = function handleHover() {
|
|
@@ -4004,7 +4193,9 @@ var SelectView = function SelectView(_ref6) {
|
|
|
4004
4193
|
size: size,
|
|
4005
4194
|
styles: styles,
|
|
4006
4195
|
options: options,
|
|
4007
|
-
callback: handleCallback
|
|
4196
|
+
callback: handleCallback,
|
|
4197
|
+
highlightedIndex: highlightedIndex,
|
|
4198
|
+
setHighlightedIndex: setHighlightedIndex
|
|
4008
4199
|
}));
|
|
4009
4200
|
};
|
|
4010
4201
|
|
|
@@ -4161,7 +4352,7 @@ var SliderPadding = {
|
|
|
4161
4352
|
}
|
|
4162
4353
|
};
|
|
4163
4354
|
|
|
4164
|
-
var _excluded$
|
|
4355
|
+
var _excluded$w = ["id", "name", "label", "inActiveChild", "activeChild", "labelPosition", "shadow", "size", "colorScheme", "value", "isHovered", "isDisabled", "isReadOnly", "onChange", "setValue", "setIsHovered", "styles"];
|
|
4165
4356
|
var SwitchContent = function SwitchContent(props) {
|
|
4166
4357
|
return React__default.createElement(appStudio.Input, Object.assign({
|
|
4167
4358
|
type: "checkbox"
|
|
@@ -4200,7 +4391,7 @@ var SwitchView = function SwitchView(_ref) {
|
|
|
4200
4391
|
circle: {},
|
|
4201
4392
|
label: {}
|
|
4202
4393
|
} : _ref$styles,
|
|
4203
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4394
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$w);
|
|
4204
4395
|
var handleToggle = function handleToggle(event) {
|
|
4205
4396
|
if (!isReadOnly) {
|
|
4206
4397
|
setValue(!value);
|
|
@@ -4286,7 +4477,7 @@ var useTextAreaState = function useTextAreaState(_ref) {
|
|
|
4286
4477
|
};
|
|
4287
4478
|
};
|
|
4288
4479
|
|
|
4289
|
-
var _excluded$
|
|
4480
|
+
var _excluded$x = ["id", "name", "hint", "error", "value", "label", "shadow", "helperText", "placeholder", "size", "shape", "variant", "colorScheme", "isHovered", "isFocused", "isEditable", "isReadOnly", "isDisabled", "isAutoFocus", "isMultiline", "maxRows", "maxCols", "onBlur", "onChange", "onFocus", "onChangeText", "setHint", "setValue", "setIsFocused", "setIsHovered", "styles"];
|
|
4290
4481
|
var TextAreaView = function TextAreaView(_ref) {
|
|
4291
4482
|
var id = _ref.id,
|
|
4292
4483
|
name = _ref.name,
|
|
@@ -4341,7 +4532,7 @@ var TextAreaView = function TextAreaView(_ref) {
|
|
|
4341
4532
|
helperText: {},
|
|
4342
4533
|
field: {}
|
|
4343
4534
|
} : _ref$styles,
|
|
4344
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4535
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$x);
|
|
4345
4536
|
var isWithLabel = !!(isFocused && label);
|
|
4346
4537
|
var fieldStyles = _extends({
|
|
4347
4538
|
margin: 0,
|
|
@@ -4509,7 +4700,7 @@ var FormikForm = function FormikForm(_ref) {
|
|
|
4509
4700
|
}, React__default.createElement(appStudio.Form, null, children));
|
|
4510
4701
|
};
|
|
4511
4702
|
|
|
4512
|
-
var _excluded$
|
|
4703
|
+
var _excluded$y = ["name", "type"];
|
|
4513
4704
|
var getInputTypeProps = function getInputTypeProps(type) {
|
|
4514
4705
|
switch (type) {
|
|
4515
4706
|
case 'email':
|
|
@@ -4539,7 +4730,7 @@ var getInputTypeProps = function getInputTypeProps(type) {
|
|
|
4539
4730
|
var useFormikInput = function useFormikInput(_ref) {
|
|
4540
4731
|
var name = _ref.name,
|
|
4541
4732
|
type = _ref.type,
|
|
4542
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4733
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$y);
|
|
4543
4734
|
var focus = useFormFocus();
|
|
4544
4735
|
var _useFormikContext = formik.useFormikContext(),
|
|
4545
4736
|
touched = _useFormikContext.touched,
|
|
@@ -4586,11 +4777,11 @@ var useFormikInput = function useFormikInput(_ref) {
|
|
|
4586
4777
|
// import FormRater from 'src/Rate/Rate';
|
|
4587
4778
|
// import Upload from 'src/Upload/Upload';
|
|
4588
4779
|
|
|
4589
|
-
var _excluded$
|
|
4780
|
+
var _excluded$z = ["value"];
|
|
4590
4781
|
var CheckboxComponent$1 = function CheckboxComponent(props) {
|
|
4591
4782
|
var _useFormikInput = useFormikInput(props),
|
|
4592
4783
|
value = _useFormikInput.value,
|
|
4593
|
-
formProps = _objectWithoutPropertiesLoose(_useFormikInput, _excluded$
|
|
4784
|
+
formProps = _objectWithoutPropertiesLoose(_useFormikInput, _excluded$z);
|
|
4594
4785
|
formProps.isChecked = value;
|
|
4595
4786
|
var checkboxStates = useCheckboxState(props);
|
|
4596
4787
|
return React__default.createElement(CheckboxView, Object.assign({}, checkboxStates, formProps));
|
|
@@ -4648,11 +4839,11 @@ var TextAreaComponent$1 = function TextAreaComponent(props) {
|
|
|
4648
4839
|
*/
|
|
4649
4840
|
var FormikTextArea = TextAreaComponent$1;
|
|
4650
4841
|
|
|
4651
|
-
var _excluded$
|
|
4842
|
+
var _excluded$A = ["value"];
|
|
4652
4843
|
var TextFieldComponent$1 = function TextFieldComponent(props) {
|
|
4653
4844
|
var formProps = useFormikInput(props);
|
|
4654
4845
|
var _useTextFieldState = useTextFieldState(props),
|
|
4655
|
-
textFieldStates = _objectWithoutPropertiesLoose(_useTextFieldState, _excluded$
|
|
4846
|
+
textFieldStates = _objectWithoutPropertiesLoose(_useTextFieldState, _excluded$A);
|
|
4656
4847
|
return React__default.createElement(TextFieldView, Object.assign({}, textFieldStates, formProps));
|
|
4657
4848
|
};
|
|
4658
4849
|
/**
|
|
@@ -4660,7 +4851,7 @@ var TextFieldComponent$1 = function TextFieldComponent(props) {
|
|
|
4660
4851
|
*/
|
|
4661
4852
|
var FormikTextField = TextFieldComponent$1;
|
|
4662
4853
|
|
|
4663
|
-
var _excluded$
|
|
4854
|
+
var _excluded$B = ["visibleIcon", "hiddenIcon"],
|
|
4664
4855
|
_excluded2$3 = ["isVisible", "setIsVisible"];
|
|
4665
4856
|
var PasswordComponent$1 = function PasswordComponent(_ref) {
|
|
4666
4857
|
var _ref$visibleIcon = _ref.visibleIcon,
|
|
@@ -4671,7 +4862,7 @@ var PasswordComponent$1 = function PasswordComponent(_ref) {
|
|
|
4671
4862
|
hiddenIcon = _ref$hiddenIcon === void 0 ? React__default.createElement(CloseEyeSvg, {
|
|
4672
4863
|
size: 14
|
|
4673
4864
|
}) : _ref$hiddenIcon,
|
|
4674
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4865
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$B);
|
|
4675
4866
|
var formProps = useFormikInput(props);
|
|
4676
4867
|
var _usePasswordState = usePasswordState(formProps),
|
|
4677
4868
|
isVisible = _usePasswordState.isVisible,
|
|
@@ -4694,6 +4885,281 @@ var PasswordComponent$1 = function PasswordComponent(_ref) {
|
|
|
4694
4885
|
*/
|
|
4695
4886
|
var FormikPassword = PasswordComponent$1;
|
|
4696
4887
|
|
|
4888
|
+
// Defines the useComboBoxState hook with parameters for the list of items and optional placeholder texts.
|
|
4889
|
+
var useComboBoxState = function useComboBoxState(items, placeholder, searchPlaceholder) {
|
|
4890
|
+
// State hook for filtered items with initial state set to the items passed to the hook.
|
|
4891
|
+
var _useState = React.useState(items),
|
|
4892
|
+
filteredItems = _useState[0],
|
|
4893
|
+
setFilteredItems = _useState[1];
|
|
4894
|
+
// State hook to track the selected item with an initial state based on the placeholder or the first item.
|
|
4895
|
+
var _useState2 = React.useState(placeholder ? {
|
|
4896
|
+
value: placeholder,
|
|
4897
|
+
label: placeholder
|
|
4898
|
+
} : items[0]),
|
|
4899
|
+
selectedItem = _useState2[0],
|
|
4900
|
+
setSelectedItem = _useState2[1];
|
|
4901
|
+
// State hook for highlighted index in the dropdown list, initialized to 0.
|
|
4902
|
+
var _useState3 = React.useState(0),
|
|
4903
|
+
highlightedIndex = _useState3[0],
|
|
4904
|
+
setHighlightedIndex = _useState3[1];
|
|
4905
|
+
// State hook for search query with an initial state based on the searchPlaceholder or empty string.
|
|
4906
|
+
var _useState4 = React.useState(searchPlaceholder != null ? searchPlaceholder : ''),
|
|
4907
|
+
searchQuery = _useState4[0],
|
|
4908
|
+
setSearchQuery = _useState4[1];
|
|
4909
|
+
// State hook to manage dropdown visibility, starts as false (hidden).
|
|
4910
|
+
var _useState5 = React.useState(false),
|
|
4911
|
+
isDropdownVisible = _useState5[0],
|
|
4912
|
+
setIsDropdownVisible = _useState5[1];
|
|
4913
|
+
// Start of object returned by the useComboBoxState hook containing all state and state updater functions.
|
|
4914
|
+
return {
|
|
4915
|
+
filteredItems: filteredItems,
|
|
4916
|
+
setFilteredItems: setFilteredItems,
|
|
4917
|
+
selectedItem: selectedItem,
|
|
4918
|
+
setSelectedItem: setSelectedItem,
|
|
4919
|
+
highlightedIndex: highlightedIndex,
|
|
4920
|
+
setHighlightedIndex: setHighlightedIndex,
|
|
4921
|
+
searchQuery: searchQuery,
|
|
4922
|
+
setSearchQuery: setSearchQuery,
|
|
4923
|
+
isDropdownVisible: isDropdownVisible,
|
|
4924
|
+
setIsDropdownVisible: setIsDropdownVisible
|
|
4925
|
+
};
|
|
4926
|
+
};
|
|
4927
|
+
|
|
4928
|
+
var _excluded$C = ["size", "color"];
|
|
4929
|
+
var TickSvg = function TickSvg(_ref) {
|
|
4930
|
+
var _ref$size = _ref.size,
|
|
4931
|
+
size = _ref$size === void 0 ? 16 : _ref$size,
|
|
4932
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$C);
|
|
4933
|
+
return React__default.createElement(Center, {
|
|
4934
|
+
width: size + "px",
|
|
4935
|
+
height: size + "px"
|
|
4936
|
+
}, React__default.createElement("svg", Object.assign({
|
|
4937
|
+
width: size + "px",
|
|
4938
|
+
height: size + "px",
|
|
4939
|
+
viewBox: "0 -0.5 25 25",
|
|
4940
|
+
fill: "none",
|
|
4941
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
4942
|
+
}, props), React__default.createElement("g", {
|
|
4943
|
+
id: "SVGRepo_bgCarrier",
|
|
4944
|
+
strokeWidth: "0"
|
|
4945
|
+
}), React__default.createElement("g", {
|
|
4946
|
+
id: "SVGRepo_tracerCarrier",
|
|
4947
|
+
strokeLinecap: "round",
|
|
4948
|
+
strokeLinejoin: "round"
|
|
4949
|
+
}), React__default.createElement("g", {
|
|
4950
|
+
id: "SVGRepo_iconCarrier"
|
|
4951
|
+
}, ' ', React__default.createElement("path", {
|
|
4952
|
+
d: "M5.5 12.5L10.167 17L19.5 8",
|
|
4953
|
+
stroke: "#444444",
|
|
4954
|
+
strokeWidth: "1.5",
|
|
4955
|
+
strokeLinecap: "round",
|
|
4956
|
+
strokeLinejoin: "round"
|
|
4957
|
+
}), ' ')));
|
|
4958
|
+
};
|
|
4959
|
+
|
|
4960
|
+
var _excluded$D = ["size", "color"];
|
|
4961
|
+
var SearchLoopSvg = function SearchLoopSvg(_ref) {
|
|
4962
|
+
var _ref$size = _ref.size,
|
|
4963
|
+
size = _ref$size === void 0 ? 14 : _ref$size,
|
|
4964
|
+
_ref$color = _ref.color,
|
|
4965
|
+
color = _ref$color === void 0 ? '#c0c0c0' : _ref$color,
|
|
4966
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$D);
|
|
4967
|
+
return React__default.createElement(Center, {
|
|
4968
|
+
width: size + "px",
|
|
4969
|
+
height: size + "px"
|
|
4970
|
+
}, React__default.createElement("svg", Object.assign({
|
|
4971
|
+
fill: "#c0c0c0",
|
|
4972
|
+
width: size + "px",
|
|
4973
|
+
height: size + "px",
|
|
4974
|
+
version: "1.1",
|
|
4975
|
+
id: "Capa_1",
|
|
4976
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4977
|
+
viewBox: "0 0 488.4 488.4",
|
|
4978
|
+
stroke: color
|
|
4979
|
+
}, props), React__default.createElement("g", {
|
|
4980
|
+
id: "SVGRepo_bgCarrier",
|
|
4981
|
+
strokeWidth: "9.279599999999999"
|
|
4982
|
+
}), React__default.createElement("g", {
|
|
4983
|
+
id: "SVGRepo_tracerCarrier",
|
|
4984
|
+
strokeLinecap: "round",
|
|
4985
|
+
strokeLinejoin: "round"
|
|
4986
|
+
}), React__default.createElement("g", {
|
|
4987
|
+
id: "SVGRepo_iconCarrier"
|
|
4988
|
+
}, React__default.createElement("g", null, React__default.createElement("g", null, React__default.createElement("path", {
|
|
4989
|
+
d: "M0,203.25c0,112.1,91.2,203.2,203.2,203.2c51.6,0,98.8-19.4,134.7-51.2l129.5,129.5c2.4,2.4,5.5,3.6,8.7,3.6 s6.3-1.2,8.7-3.6c4.8-4.8,4.8-12.5,0-17.3l-129.6-129.5c31.8-35.9,51.2-83,51.2-134.7c0-112.1-91.2-203.2-203.2-203.2 S0,91.15,0,203.25z M381.9,203.25c0,98.5-80.2,178.7-178.7,178.7s-178.7-80.2-178.7-178.7s80.2-178.7,178.7-178.7 S381.9,104.65,381.9,203.25z"
|
|
4990
|
+
}), ' ')))));
|
|
4991
|
+
};
|
|
4992
|
+
|
|
4993
|
+
var _excluded$E = ["placeholder", "items", "showTick", "onSelect", "searchEnabled", "left", "right", "label", "filteredItems", "setSelectedItem", "selectedItem", "highlightedIndex", "setHighlightedIndex", "searchQuery", "setSearchQuery", "setFilteredItems", "styles", "isDropdownVisible", "setIsDropdownVisible"];
|
|
4994
|
+
// Defines the functional component 'ComboBoxView' with destructured props.
|
|
4995
|
+
var ComboBoxView = function ComboBoxView(_ref) {
|
|
4996
|
+
var placeholder = _ref.placeholder,
|
|
4997
|
+
items = _ref.items,
|
|
4998
|
+
_ref$showTick = _ref.showTick,
|
|
4999
|
+
showTick = _ref$showTick === void 0 ? true : _ref$showTick,
|
|
5000
|
+
onSelect = _ref.onSelect,
|
|
5001
|
+
_ref$searchEnabled = _ref.searchEnabled,
|
|
5002
|
+
searchEnabled = _ref$searchEnabled === void 0 ? true : _ref$searchEnabled,
|
|
5003
|
+
left = _ref.left,
|
|
5004
|
+
right = _ref.right,
|
|
5005
|
+
label = _ref.label,
|
|
5006
|
+
filteredItems = _ref.filteredItems,
|
|
5007
|
+
setSelectedItem = _ref.setSelectedItem,
|
|
5008
|
+
selectedItem = _ref.selectedItem,
|
|
5009
|
+
highlightedIndex = _ref.highlightedIndex,
|
|
5010
|
+
setHighlightedIndex = _ref.setHighlightedIndex,
|
|
5011
|
+
searchQuery = _ref.searchQuery,
|
|
5012
|
+
setSearchQuery = _ref.setSearchQuery,
|
|
5013
|
+
setFilteredItems = _ref.setFilteredItems,
|
|
5014
|
+
styles = _ref.styles,
|
|
5015
|
+
isDropdownVisible = _ref.isDropdownVisible,
|
|
5016
|
+
setIsDropdownVisible = _ref.setIsDropdownVisible,
|
|
5017
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$E);
|
|
5018
|
+
// Sets up an effect to handle clicking outside the dropdown to close it.
|
|
5019
|
+
React.useEffect(function () {
|
|
5020
|
+
var handleClickOutside = function handleClickOutside(event) {
|
|
5021
|
+
var path = event.composedPath();
|
|
5022
|
+
var isOutside = !path.some(function (element) {
|
|
5023
|
+
return (element == null ? void 0 : element.id) === 'combobox-dropdown';
|
|
5024
|
+
});
|
|
5025
|
+
if (isOutside) {
|
|
5026
|
+
setIsDropdownVisible(false);
|
|
5027
|
+
}
|
|
5028
|
+
};
|
|
5029
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
5030
|
+
return function () {
|
|
5031
|
+
return document.removeEventListener('mousedown', handleClickOutside);
|
|
5032
|
+
};
|
|
5033
|
+
}, []);
|
|
5034
|
+
// Defines 'handleSearch' to filter items based on the user's query.
|
|
5035
|
+
var handleSearch = function handleSearch(query) {
|
|
5036
|
+
setSearchQuery(query);
|
|
5037
|
+
if (query === '') {
|
|
5038
|
+
setFilteredItems(items);
|
|
5039
|
+
} else {
|
|
5040
|
+
var filtered = items.filter(function (item) {
|
|
5041
|
+
return item.label.toLowerCase().includes(query.toLowerCase());
|
|
5042
|
+
});
|
|
5043
|
+
setFilteredItems(filtered);
|
|
5044
|
+
}
|
|
5045
|
+
setHighlightedIndex(0);
|
|
5046
|
+
};
|
|
5047
|
+
// Defines 'handleSelect' to handle item selection and close the dropdown.
|
|
5048
|
+
var handleSelect = function handleSelect(item) {
|
|
5049
|
+
setSelectedItem(item);
|
|
5050
|
+
onSelect == null || onSelect(item);
|
|
5051
|
+
setIsDropdownVisible(false);
|
|
5052
|
+
};
|
|
5053
|
+
// Starts the JSX returned by the component representing the combobox.
|
|
5054
|
+
return React__default.createElement(Horizontal, Object.assign({
|
|
5055
|
+
role: "combobox",
|
|
5056
|
+
wrap: "nowrap",
|
|
5057
|
+
gap: 15,
|
|
5058
|
+
alignItems: "center",
|
|
5059
|
+
width: "100%"
|
|
5060
|
+
}, props), label && React__default.createElement(Text, {
|
|
5061
|
+
styles: styles == null ? void 0 : styles.label,
|
|
5062
|
+
htmlFor: props.id
|
|
5063
|
+
}, label), React__default.createElement(View, {
|
|
5064
|
+
position: "relative"
|
|
5065
|
+
}, React__default.createElement(Horizontal, Object.assign({
|
|
5066
|
+
cursor: "pointer",
|
|
5067
|
+
backgroundColor: "white",
|
|
5068
|
+
boxShadow: "rgba(0, 0, 0, 0.16) 0px 1px 4px",
|
|
5069
|
+
padding: "12px",
|
|
5070
|
+
display: "flex",
|
|
5071
|
+
alignItems: "center",
|
|
5072
|
+
borderRadius: "4px",
|
|
5073
|
+
justify: "space-between",
|
|
5074
|
+
minWidth: 300,
|
|
5075
|
+
wrap: "nowrap"
|
|
5076
|
+
}, styles == null ? void 0 : styles.container), React__default.createElement(Horizontal, Object.assign({
|
|
5077
|
+
gap: 15,
|
|
5078
|
+
alignItems: "center",
|
|
5079
|
+
position: "relative",
|
|
5080
|
+
width: "100%",
|
|
5081
|
+
onClick: function onClick() {
|
|
5082
|
+
return setIsDropdownVisible(!isDropdownVisible);
|
|
5083
|
+
}
|
|
5084
|
+
}, styles == null ? void 0 : styles.labelContainer), left, React__default.createElement(Text, Object.assign({
|
|
5085
|
+
weight: "medium",
|
|
5086
|
+
flexGrow: 1
|
|
5087
|
+
}, styles == null ? void 0 : styles.label), selectedItem.label)), right, isDropdownVisible && React__default.createElement(View, Object.assign({
|
|
5088
|
+
id: "combobox-dropdown",
|
|
5089
|
+
position: "absolute",
|
|
5090
|
+
backgroundColor: "white",
|
|
5091
|
+
boxShadow: "rgba(0, 0 ,0 ,0.16) 0px 1px 4px",
|
|
5092
|
+
width: "100%",
|
|
5093
|
+
overflowY: "auto",
|
|
5094
|
+
zIndex: 10000,
|
|
5095
|
+
bottom: -8,
|
|
5096
|
+
left: 0,
|
|
5097
|
+
transform: "translateY(100%)",
|
|
5098
|
+
marginTop: "4px",
|
|
5099
|
+
borderRadius: "4px"
|
|
5100
|
+
}, styles == null ? void 0 : styles.dropdown), searchEnabled && React__default.createElement(TextFieldView, {
|
|
5101
|
+
id: props.id,
|
|
5102
|
+
name: props.name,
|
|
5103
|
+
width: "100%",
|
|
5104
|
+
type: "search",
|
|
5105
|
+
value: searchQuery,
|
|
5106
|
+
onChange: function onChange(value) {
|
|
5107
|
+
return handleSearch(value);
|
|
5108
|
+
},
|
|
5109
|
+
hint: placeholder,
|
|
5110
|
+
isClearable: false,
|
|
5111
|
+
leftChild: React__default.createElement(SearchLoopSvg, {
|
|
5112
|
+
size: 12
|
|
5113
|
+
}),
|
|
5114
|
+
styles: {
|
|
5115
|
+
box: _extends({
|
|
5116
|
+
width: '100%',
|
|
5117
|
+
padding: '6px 12px',
|
|
5118
|
+
borderBottom: filteredItems.length > 0 ? '1px solid #ccc' : '1px solid transparent'
|
|
5119
|
+
}, styles == null ? void 0 : styles.text)
|
|
5120
|
+
}
|
|
5121
|
+
}), filteredItems.length > 0 && React__default.createElement(View, {
|
|
5122
|
+
margin: 0,
|
|
5123
|
+
padding: 4
|
|
5124
|
+
}, filteredItems.map(function (item, index) {
|
|
5125
|
+
return React__default.createElement(Horizontal, Object.assign({
|
|
5126
|
+
justify: "space-between",
|
|
5127
|
+
key: item.value,
|
|
5128
|
+
padding: "12px",
|
|
5129
|
+
cursor: "pointer",
|
|
5130
|
+
borderRadius: 4,
|
|
5131
|
+
backgroundColor: index === highlightedIndex ? 'color.gray.100' : 'transparent',
|
|
5132
|
+
onMouseEnter: function onMouseEnter() {
|
|
5133
|
+
return setHighlightedIndex(index);
|
|
5134
|
+
},
|
|
5135
|
+
onClick: function onClick() {
|
|
5136
|
+
return handleSelect(item);
|
|
5137
|
+
}
|
|
5138
|
+
}, styles == null ? void 0 : styles.item), React__default.createElement(Text, null, item.label), React__default.createElement(React__default.Fragment, null, item.icon && item.icon, item.value === selectedItem.value && showTick && !item.icon && React__default.createElement(TickSvg, null)));
|
|
5139
|
+
}))))));
|
|
5140
|
+
};
|
|
5141
|
+
|
|
5142
|
+
var _excluded$F = ["items", "placeholder", "searchPlaceholder"];
|
|
5143
|
+
var ComboBoxComponent = function ComboBoxComponent(_ref) {
|
|
5144
|
+
var items = _ref.items,
|
|
5145
|
+
placeholder = _ref.placeholder,
|
|
5146
|
+
searchPlaceholder = _ref.searchPlaceholder,
|
|
5147
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$F);
|
|
5148
|
+
var formProps = useFormikInput(props);
|
|
5149
|
+
var ComboBoxStates = useComboBoxState(items, placeholder, searchPlaceholder);
|
|
5150
|
+
// Ensure the onChange function from formProps is being called when an item is selected
|
|
5151
|
+
var handleSelect = function handleSelect(item) {
|
|
5152
|
+
formProps.onChange(item);
|
|
5153
|
+
};
|
|
5154
|
+
return React__default.createElement(ComboBoxView, Object.assign({}, ComboBoxStates, formProps, {
|
|
5155
|
+
onSelect: handleSelect
|
|
5156
|
+
}));
|
|
5157
|
+
};
|
|
5158
|
+
/**
|
|
5159
|
+
* ComboBox allows users to select one or more options from a list of choices.
|
|
5160
|
+
*/
|
|
5161
|
+
var FormikComboBox = ComboBoxComponent;
|
|
5162
|
+
|
|
4697
5163
|
var useModalStore = /*#__PURE__*/zustand.create(function (set) {
|
|
4698
5164
|
return {
|
|
4699
5165
|
modal: false,
|
|
@@ -4779,7 +5245,7 @@ var HeaderIconSizes = {
|
|
|
4779
5245
|
xl: 28
|
|
4780
5246
|
};
|
|
4781
5247
|
|
|
4782
|
-
var _excluded$
|
|
5248
|
+
var _excluded$G = ["children", "blur", "isOpen", "isClosePrevented", "onClose", "position"],
|
|
4783
5249
|
_excluded2$4 = ["children", "shadow", "isFullScreen", "shape"],
|
|
4784
5250
|
_excluded3$2 = ["children", "buttonColor", "iconSize", "buttonPosition"],
|
|
4785
5251
|
_excluded4$2 = ["children"],
|
|
@@ -4795,7 +5261,7 @@ var ModalOverlay = function ModalOverlay(_ref) {
|
|
|
4795
5261
|
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
|
|
4796
5262
|
_ref$position = _ref.position,
|
|
4797
5263
|
position = _ref$position === void 0 ? 'center' : _ref$position,
|
|
4798
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
5264
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$G);
|
|
4799
5265
|
var handleClick = function handleClick() {
|
|
4800
5266
|
if (!isClosePrevented) onClose();
|
|
4801
5267
|
};
|
|
@@ -4951,12 +5417,12 @@ Modal.Body = ModalBody;
|
|
|
4951
5417
|
Modal.Footer = ModalFooter;
|
|
4952
5418
|
Modal.Layout = ModalLayout;
|
|
4953
5419
|
|
|
4954
|
-
var _excluded$
|
|
5420
|
+
var _excluded$H = ["src", "color"],
|
|
4955
5421
|
_excluded2$5 = ["path"];
|
|
4956
5422
|
var FileSVG = function FileSVG(_ref) {
|
|
4957
5423
|
var src = _ref.src,
|
|
4958
5424
|
color = _ref.color,
|
|
4959
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
5425
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$H);
|
|
4960
5426
|
var _useTheme = appStudio.useTheme(),
|
|
4961
5427
|
getColor = _useTheme.getColor;
|
|
4962
5428
|
var Colorprops = color ? {
|
|
@@ -4977,18 +5443,15 @@ var FileImage = function FileImage(_ref2) {
|
|
|
4977
5443
|
}, props));
|
|
4978
5444
|
};
|
|
4979
5445
|
|
|
5446
|
+
// Initializes a custom hook for managing tab states with an array of 'Tab' objects passed as properties.
|
|
4980
5447
|
var useTabsState = function useTabsState(propTabs) {
|
|
4981
|
-
// Defines a custom hook, named `useTabsState`, that manages the state of tabs within a component.
|
|
4982
5448
|
var _useState = React.useState(propTabs[0]),
|
|
4983
5449
|
isActive = _useState[0],
|
|
4984
5450
|
setIsActive = _useState[1];
|
|
4985
|
-
// Initializes 'isActive' state with the first tab from the 'propTabs' array, indicating the currently active tab.
|
|
4986
5451
|
var _useState2 = React.useState(propTabs),
|
|
4987
5452
|
tabsState = _useState2[0],
|
|
4988
5453
|
setTabsState = _useState2[1];
|
|
4989
|
-
// Initializes 'tabsState' as a stateful array that reflects the tabs passed through 'propTabs' prop, setting the initial state of tabs.
|
|
4990
5454
|
return {
|
|
4991
|
-
// The hook returns an object containing both the state and the functions to update the state, allowing components to control and access the current state of the tabs.
|
|
4992
5455
|
isActive: isActive,
|
|
4993
5456
|
setIsActive: setIsActive,
|
|
4994
5457
|
tabsState: tabsState,
|
|
@@ -4996,21 +5459,31 @@ var useTabsState = function useTabsState(propTabs) {
|
|
|
4996
5459
|
};
|
|
4997
5460
|
};
|
|
4998
5461
|
|
|
5462
|
+
// Defines a functional component 'TabsView' with props of type 'TabsViewProps'.
|
|
4999
5463
|
var TabsView = function TabsView(props) {
|
|
5464
|
+
// Destructures 'tabs', 'styles', 'isActive', 'setIsActive', 'tabsState', and 'setTabsState' from the component props.
|
|
5000
5465
|
var tabs = props.tabs,
|
|
5001
5466
|
styles = props.styles,
|
|
5002
5467
|
isActive = props.isActive,
|
|
5003
5468
|
setIsActive = props.setIsActive,
|
|
5004
5469
|
tabsState = props.tabsState,
|
|
5005
5470
|
setTabsState = props.setTabsState;
|
|
5471
|
+
// Declares a function 'moveSelectedTabToTop' that takes an index and modifies the tabs order.
|
|
5006
5472
|
var moveSelectedTabToTop = function moveSelectedTabToTop(idx) {
|
|
5473
|
+
// Creates a copy of the 'tabs' array from props to be altered.
|
|
5007
5474
|
var newTabs = [].concat(tabs);
|
|
5475
|
+
// Removes the tab at the provided index, effectively selecting this tab.
|
|
5008
5476
|
var selectedTab = newTabs.splice(idx, 1);
|
|
5477
|
+
// Places the selected tab at the start of the 'newTabs' array.
|
|
5009
5478
|
newTabs.unshift(selectedTab[0]);
|
|
5479
|
+
// Updates the state with the reordered tabs.
|
|
5010
5480
|
setTabsState(newTabs);
|
|
5481
|
+
// Sets the active tab to the first tab in the 'newTabs' array.
|
|
5011
5482
|
setIsActive(newTabs[0]);
|
|
5012
5483
|
};
|
|
5484
|
+
// Defines a function 'isContentActive' that checks if the given tab's content is to be displayed.
|
|
5013
5485
|
var isContentActive = function isContentActive(tab) {
|
|
5486
|
+
// Returns a boolean indicating if the given tab is identical to the first tab in 'tabsState'.
|
|
5014
5487
|
return tab.value === tabsState[0].value;
|
|
5015
5488
|
};
|
|
5016
5489
|
return React__default.createElement(Horizontal, Object.assign({
|
|
@@ -5039,17 +5512,14 @@ var TabsView = function TabsView(props) {
|
|
|
5039
5512
|
})));
|
|
5040
5513
|
};
|
|
5041
5514
|
|
|
5042
|
-
// Define the functional component TabsComponent that utilizes the TabsProps interface for its props.
|
|
5043
5515
|
var TabsComponent = function TabsComponent(_ref) {
|
|
5044
5516
|
var tabs = _ref.tabs,
|
|
5045
5517
|
styles = _ref.styles;
|
|
5046
|
-
// Destructure the 'tabs' and 'styles' properties from the component's props.
|
|
5047
5518
|
var _useTabsState = useTabsState(tabs),
|
|
5048
5519
|
isActive = _useTabsState.isActive,
|
|
5049
5520
|
setIsActive = _useTabsState.setIsActive,
|
|
5050
5521
|
tabsState = _useTabsState.tabsState,
|
|
5051
5522
|
setTabsState = _useTabsState.setTabsState;
|
|
5052
|
-
// Invoke the useTabsState custom hook with 'tabs' to manage state related to tab activities like the active tab and tab state management.
|
|
5053
5523
|
return React__default.createElement(TabsView, {
|
|
5054
5524
|
tabs: tabs,
|
|
5055
5525
|
styles: styles,
|
|
@@ -5061,54 +5531,66 @@ var TabsComponent = function TabsComponent(_ref) {
|
|
|
5061
5531
|
};
|
|
5062
5532
|
var Tabs = /*#__PURE__*/React__default.memo(TabsComponent);
|
|
5063
5533
|
|
|
5534
|
+
// Define a constant object 'Themes' exporting various theme styles.
|
|
5064
5535
|
var Themes = {
|
|
5536
|
+
// Start of the 'default' theme definition with style properties.
|
|
5065
5537
|
default: {
|
|
5066
5538
|
container: {
|
|
5067
5539
|
backgroundColor: 'white',
|
|
5068
5540
|
border: 'color.blackAlpha.800'
|
|
5069
5541
|
},
|
|
5542
|
+
// Defines the content style for the 'default' theme.
|
|
5070
5543
|
content: {
|
|
5071
5544
|
color: 'color.blackAlpha.800'
|
|
5072
5545
|
}
|
|
5073
5546
|
},
|
|
5547
|
+
// The 'info' theme with unique container and content styles.
|
|
5074
5548
|
info: {
|
|
5075
5549
|
container: {
|
|
5076
5550
|
backgroundColor: 'color.blue.200',
|
|
5077
5551
|
border: 'color.blue.400'
|
|
5078
5552
|
},
|
|
5553
|
+
// Content styles specific to the 'info' theme.
|
|
5079
5554
|
content: {
|
|
5080
5555
|
color: '#60a5fa'
|
|
5081
5556
|
}
|
|
5082
5557
|
},
|
|
5558
|
+
// Specifies the 'success' theme with corresponding container and content styles.
|
|
5083
5559
|
success: {
|
|
5084
5560
|
container: {
|
|
5085
5561
|
backgroundColor: 'color.green.200',
|
|
5086
5562
|
border: 'color.green.400'
|
|
5087
5563
|
},
|
|
5564
|
+
// Sets the content styling nuances for the 'success' theme.
|
|
5088
5565
|
content: {
|
|
5089
5566
|
color: '#22c55e'
|
|
5090
5567
|
}
|
|
5091
5568
|
},
|
|
5569
|
+
// Start of the 'error' theme with its characteristic styles.
|
|
5092
5570
|
error: {
|
|
5093
5571
|
container: {
|
|
5094
5572
|
backgroundColor: 'color.red.200',
|
|
5095
5573
|
border: 'color.red.400'
|
|
5096
5574
|
},
|
|
5575
|
+
// Content styling for the 'error' theme.
|
|
5097
5576
|
content: {
|
|
5098
5577
|
color: '#ef4444'
|
|
5099
5578
|
}
|
|
5100
5579
|
},
|
|
5580
|
+
// Introduction of the 'warning' theme styles.
|
|
5101
5581
|
warning: {
|
|
5102
5582
|
container: {
|
|
5103
5583
|
backgroundColor: 'color.orange.200',
|
|
5104
5584
|
border: 'color.orange.400'
|
|
5105
5585
|
},
|
|
5586
|
+
// Defines color and aesthetics for the 'warning' theme's content.
|
|
5106
5587
|
content: {
|
|
5107
5588
|
color: '#f97316'
|
|
5108
5589
|
}
|
|
5109
5590
|
}
|
|
5110
5591
|
};
|
|
5111
5592
|
|
|
5593
|
+
// Defines AlertView as a functional component using destructuring to extract props.
|
|
5112
5594
|
var AlertView = function AlertView(_ref) {
|
|
5113
5595
|
var _styles$icon$color;
|
|
5114
5596
|
var icon = _ref.icon,
|
|
@@ -5141,6 +5623,7 @@ var AlertView = function AlertView(_ref) {
|
|
|
5141
5623
|
}, styles == null ? void 0 : styles.description), description)));
|
|
5142
5624
|
};
|
|
5143
5625
|
|
|
5626
|
+
// Definition of the AlertComponent functional component with destructured props.
|
|
5144
5627
|
var AlertComponent = function AlertComponent(_ref) {
|
|
5145
5628
|
var icon = _ref.icon,
|
|
5146
5629
|
title = _ref.title,
|
|
@@ -5155,14 +5638,16 @@ var AlertComponent = function AlertComponent(_ref) {
|
|
|
5155
5638
|
variant: variant
|
|
5156
5639
|
});
|
|
5157
5640
|
};
|
|
5641
|
+
// Exporting the AlertComponent as 'Alert' for use in other parts of the application.
|
|
5158
5642
|
var Alert = AlertComponent;
|
|
5159
5643
|
|
|
5160
|
-
var _excluded$
|
|
5644
|
+
var _excluded$I = ["ratio", "children"];
|
|
5645
|
+
// Declaration of a functional component named AspectRatioView.
|
|
5161
5646
|
var AspectRatioView = function AspectRatioView(_ref) {
|
|
5162
5647
|
var _ref$ratio = _ref.ratio,
|
|
5163
5648
|
ratio = _ref$ratio === void 0 ? 16 / 9 : _ref$ratio,
|
|
5164
5649
|
children = _ref.children,
|
|
5165
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
5650
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$I);
|
|
5166
5651
|
return React__default.createElement(Center, Object.assign({
|
|
5167
5652
|
width: '100%',
|
|
5168
5653
|
position: "relative",
|
|
@@ -5178,27 +5663,32 @@ var AspectRatioView = function AspectRatioView(_ref) {
|
|
|
5178
5663
|
}, children));
|
|
5179
5664
|
};
|
|
5180
5665
|
|
|
5181
|
-
var _excluded$
|
|
5666
|
+
var _excluded$J = ["ratio", "children"];
|
|
5667
|
+
// Declaration of the AspectRatioComponent functional component with destructured props.
|
|
5182
5668
|
var AspectRatioComponent = function AspectRatioComponent(_ref) {
|
|
5183
5669
|
var ratio = _ref.ratio,
|
|
5184
5670
|
children = _ref.children,
|
|
5185
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
5671
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$J);
|
|
5672
|
+
// Beginning of the return statement in the functional component.
|
|
5186
5673
|
return React__default.createElement(AspectRatioView, Object.assign({
|
|
5187
5674
|
ratio: ratio
|
|
5188
5675
|
}, props), children);
|
|
5189
5676
|
};
|
|
5190
5677
|
var AspectRatio = AspectRatioComponent;
|
|
5191
5678
|
|
|
5679
|
+
// Defines a state hook for managing avatar image error status, initialized as false.
|
|
5192
5680
|
var useAvatarState = function useAvatarState() {
|
|
5193
5681
|
var _useState = React.useState(false),
|
|
5194
5682
|
imageError = _useState[0],
|
|
5195
5683
|
setImageError = _useState[1];
|
|
5684
|
+
// Provides an object containing the image error state and its setter function.
|
|
5196
5685
|
return {
|
|
5197
5686
|
imageError: imageError,
|
|
5198
5687
|
setImageError: setImageError
|
|
5199
5688
|
};
|
|
5200
5689
|
};
|
|
5201
5690
|
|
|
5691
|
+
// Defines a mapping of avatar sizes to their respective numeric values
|
|
5202
5692
|
var AvatarSizeMap = {
|
|
5203
5693
|
xs: 24,
|
|
5204
5694
|
sm: 32,
|
|
@@ -5207,6 +5697,7 @@ var AvatarSizeMap = {
|
|
|
5207
5697
|
xl: 80
|
|
5208
5698
|
};
|
|
5209
5699
|
|
|
5700
|
+
// Declaration of the AvatarView functional component with destructured props from AvatarViewProps.
|
|
5210
5701
|
var AvatarView = function AvatarView(_ref) {
|
|
5211
5702
|
var src = _ref.src,
|
|
5212
5703
|
_ref$size = _ref.size,
|
|
@@ -5216,10 +5707,13 @@ var AvatarView = function AvatarView(_ref) {
|
|
|
5216
5707
|
styles = _ref.styles,
|
|
5217
5708
|
imageError = _ref.imageError,
|
|
5218
5709
|
setImageError = _ref.setImageError;
|
|
5710
|
+
// Determines the size of the avatar by mapping the size prop to the predefined AvatarSizeMap.
|
|
5219
5711
|
var avatarSize = AvatarSizeMap[size];
|
|
5712
|
+
// Initiates a style object for the image with an objectFit property and spreads additional image styles if provided.
|
|
5220
5713
|
var imageStyle = _extends({
|
|
5221
5714
|
objectFit: 'cover'
|
|
5222
5715
|
}, (styles == null ? void 0 : styles.image) || {});
|
|
5716
|
+
// Start of the JSX returned by the AvatarView component, which uses the Center component as its root element.
|
|
5223
5717
|
return React__default.createElement(Center, Object.assign({
|
|
5224
5718
|
role: "avatar",
|
|
5225
5719
|
width: avatarSize,
|
|
@@ -5229,7 +5723,7 @@ var AvatarView = function AvatarView(_ref) {
|
|
|
5229
5723
|
borderWidth: "1px",
|
|
5230
5724
|
borderStyle: "solid",
|
|
5231
5725
|
borderColor: imageError ? 'black' : 'transparent',
|
|
5232
|
-
boxShadow: "0px 2px 4px rgba(0, 0, 0, 0.25)"
|
|
5726
|
+
boxShadow: "0px 2px 4px rgba(0, 0, 0, 0.25)"
|
|
5233
5727
|
}, styles == null ? void 0 : styles.container), !imageError ? React__default.createElement(appStudio.Image, {
|
|
5234
5728
|
alt: "IM",
|
|
5235
5729
|
src: src,
|
|
@@ -5244,14 +5738,17 @@ var AvatarView = function AvatarView(_ref) {
|
|
|
5244
5738
|
}, styles == null ? void 0 : styles.fallback), fallback));
|
|
5245
5739
|
};
|
|
5246
5740
|
|
|
5741
|
+
// Defines the AvatarComponent functional component with destructured props from AvatarProps type.
|
|
5247
5742
|
var AvatarComponent = function AvatarComponent(_ref) {
|
|
5248
5743
|
var src = _ref.src,
|
|
5249
5744
|
size = _ref.size,
|
|
5250
5745
|
styles = _ref.styles,
|
|
5251
5746
|
fallback = _ref.fallback;
|
|
5747
|
+
// Uses custom hook useAvatarState to manage the avatar image loading error state.
|
|
5252
5748
|
var _useAvatarState = useAvatarState(),
|
|
5253
5749
|
imageError = _useAvatarState.imageError,
|
|
5254
5750
|
setImageError = _useAvatarState.setImageError;
|
|
5751
|
+
// Begins the JSX return block for rendering the AvatarView component.
|
|
5255
5752
|
return React__default.createElement(AvatarView, {
|
|
5256
5753
|
src: src,
|
|
5257
5754
|
size: size,
|
|
@@ -5260,7 +5757,9 @@ var AvatarComponent = function AvatarComponent(_ref) {
|
|
|
5260
5757
|
imageError: imageError,
|
|
5261
5758
|
setImageError: setImageError
|
|
5262
5759
|
});
|
|
5760
|
+
// AvatarComponent is a functional component that wraps the AvatarView with added state logic.
|
|
5263
5761
|
};
|
|
5762
|
+
// Exports the AvatarComponent as Avatar for use in other parts of the application.
|
|
5264
5763
|
var Avatar = AvatarComponent;
|
|
5265
5764
|
|
|
5266
5765
|
var BadgeSizes = {
|
|
@@ -5295,7 +5794,6 @@ var BadgeShapes = {
|
|
|
5295
5794
|
rounded: 4,
|
|
5296
5795
|
pillShaped: 24
|
|
5297
5796
|
};
|
|
5298
|
-
// Example of how you might adjust styles based on the 'position' prop
|
|
5299
5797
|
var PositionStyles = {
|
|
5300
5798
|
'top-right': {
|
|
5301
5799
|
top: 0,
|
|
@@ -5319,6 +5817,7 @@ var PositionStyles = {
|
|
|
5319
5817
|
}
|
|
5320
5818
|
};
|
|
5321
5819
|
|
|
5820
|
+
// Importing Text component to display the content text within the badge.
|
|
5322
5821
|
var BadgeView = function BadgeView(_ref) {
|
|
5323
5822
|
var content = _ref.content,
|
|
5324
5823
|
position = _ref.position,
|
|
@@ -5340,6 +5839,7 @@ var BadgeView = function BadgeView(_ref) {
|
|
|
5340
5839
|
borderColor: 'transparent'
|
|
5341
5840
|
},
|
|
5342
5841
|
outline: {
|
|
5842
|
+
// Combining various style objects along with conditional styles based on props to create the badge's appearance.
|
|
5343
5843
|
backgroundColor: 'transparent',
|
|
5344
5844
|
borderWidth: 1,
|
|
5345
5845
|
borderStyle: 'solid',
|
|
@@ -5348,10 +5848,13 @@ var BadgeView = function BadgeView(_ref) {
|
|
|
5348
5848
|
},
|
|
5349
5849
|
link: {
|
|
5350
5850
|
backgroundColor: 'transparent',
|
|
5851
|
+
// Rendering the Badge component using the Center layout component with combinedStyles applied.
|
|
5351
5852
|
borderWidth: 1,
|
|
5853
|
+
// Inserting a Text component into the badge to display the content, with dynamic size and additional text styles.
|
|
5352
5854
|
borderStyle: 'solid',
|
|
5353
5855
|
borderColor: 'transparent',
|
|
5354
5856
|
color: colorScheme,
|
|
5857
|
+
// Exporting BadgeView to be used in other parts of the application.
|
|
5355
5858
|
textDecoration: 'underline'
|
|
5356
5859
|
},
|
|
5357
5860
|
ghost: {
|
|
@@ -5374,6 +5877,7 @@ var BadgeView = function BadgeView(_ref) {
|
|
|
5374
5877
|
}, styles == null ? void 0 : styles.text), content));
|
|
5375
5878
|
};
|
|
5376
5879
|
|
|
5880
|
+
// Importing type definitions for BadgeProps that will be used to type-check the Badge component's props.
|
|
5377
5881
|
var Badge = function Badge(_ref) {
|
|
5378
5882
|
var content = _ref.content,
|
|
5379
5883
|
shape = _ref.shape,
|
|
@@ -5393,13 +5897,17 @@ var Badge = function Badge(_ref) {
|
|
|
5393
5897
|
});
|
|
5394
5898
|
};
|
|
5395
5899
|
|
|
5900
|
+
// Declares the useToggleState function which takes defaultToggled parameter to initialize the toggle state.
|
|
5396
5901
|
var useToggleState = function useToggleState(defaultToggled) {
|
|
5902
|
+
// Creates a stateful value isHovered for tracking hover state and a function setIsHovered to update that state, initially false.
|
|
5397
5903
|
var _useState = React.useState(false),
|
|
5398
5904
|
isHovered = _useState[0],
|
|
5399
5905
|
setIsHovered = _useState[1];
|
|
5906
|
+
// Creates a stateful value isToggle to store the current toggle state and a function setIsToggled to modify it, initialized with defaultToggled.
|
|
5400
5907
|
var _useState2 = React.useState(defaultToggled),
|
|
5401
5908
|
isToggle = _useState2[0],
|
|
5402
5909
|
setIsToggled = _useState2[1];
|
|
5910
|
+
// Returns an object containing the current states and the functions to update them for external use.
|
|
5403
5911
|
return {
|
|
5404
5912
|
isHovered: isHovered,
|
|
5405
5913
|
setIsHovered: setIsHovered,
|
|
@@ -5414,7 +5922,7 @@ var ToggleShapes = {
|
|
|
5414
5922
|
pillShaped: 24
|
|
5415
5923
|
};
|
|
5416
5924
|
|
|
5417
|
-
var _excluded$
|
|
5925
|
+
var _excluded$K = ["children", "shape", "colorScheme", "variant", "isHovered", "setIsHovered", "isDisabled", "isToggle", "setIsToggled", "onToggle"];
|
|
5418
5926
|
var ToggleView = function ToggleView(_ref) {
|
|
5419
5927
|
var children = _ref.children,
|
|
5420
5928
|
_ref$shape = _ref.shape,
|
|
@@ -5429,7 +5937,7 @@ var ToggleView = function ToggleView(_ref) {
|
|
|
5429
5937
|
isToggle = _ref.isToggle,
|
|
5430
5938
|
setIsToggled = _ref.setIsToggled,
|
|
5431
5939
|
onToggle = _ref.onToggle,
|
|
5432
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
5940
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$K);
|
|
5433
5941
|
var toggleColor = !isDisabled ? colorScheme : 'theme.disabled';
|
|
5434
5942
|
var isActive = !!(isToggle || isHovered);
|
|
5435
5943
|
var ToggleVariants = {
|
|
@@ -5451,14 +5959,12 @@ var ToggleView = function ToggleView(_ref) {
|
|
|
5451
5959
|
setIsToggled(function (prev) {
|
|
5452
5960
|
var newState = !prev;
|
|
5453
5961
|
if (onToggle) {
|
|
5454
|
-
// Check if onToggle is defined before calling it
|
|
5455
5962
|
onToggle(newState);
|
|
5456
5963
|
}
|
|
5457
|
-
return newState;
|
|
5964
|
+
return newState;
|
|
5458
5965
|
});
|
|
5459
5966
|
}
|
|
5460
5967
|
};
|
|
5461
|
-
|
|
5462
5968
|
return React__default.createElement(Center, Object.assign({
|
|
5463
5969
|
role: "Toggle",
|
|
5464
5970
|
padding: shape === 'pillShaped' ? '10px 12px' : '8px',
|
|
@@ -5477,7 +5983,8 @@ var ToggleView = function ToggleView(_ref) {
|
|
|
5477
5983
|
}, ToggleVariants[variant], props), children);
|
|
5478
5984
|
};
|
|
5479
5985
|
|
|
5480
|
-
var _excluded$
|
|
5986
|
+
var _excluded$L = ["children", "shape", "colorScheme", "variant", "isDisabled", "isToggled", "onToggle"];
|
|
5987
|
+
// Destructuring properties from ToggleProps to be used within the ToggleComponent.
|
|
5481
5988
|
var ToggleComponent = function ToggleComponent(_ref) {
|
|
5482
5989
|
var children = _ref.children,
|
|
5483
5990
|
shape = _ref.shape,
|
|
@@ -5487,15 +5994,18 @@ var ToggleComponent = function ToggleComponent(_ref) {
|
|
|
5487
5994
|
_ref$isToggled = _ref.isToggled,
|
|
5488
5995
|
isToggled = _ref$isToggled === void 0 ? false : _ref$isToggled,
|
|
5489
5996
|
onToggle = _ref.onToggle,
|
|
5490
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
5997
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$L);
|
|
5998
|
+
// Initializing toggle state and set state functions using the custom hook useToggleState.
|
|
5491
5999
|
var _useToggleState = useToggleState(isToggled),
|
|
5492
6000
|
isHovered = _useToggleState.isHovered,
|
|
5493
6001
|
setIsHovered = _useToggleState.setIsHovered,
|
|
5494
6002
|
isToggle = _useToggleState.isToggle,
|
|
5495
6003
|
setIsToggled = _useToggleState.setIsToggled;
|
|
6004
|
+
// Creating an effect that updates the isToggled state whenever the isToggled prop changes.
|
|
5496
6005
|
React.useEffect(function () {
|
|
5497
6006
|
setIsToggled(isToggled);
|
|
5498
6007
|
}, [isToggled]);
|
|
6008
|
+
// Beginning of the JSX block to render the Toggle view component.
|
|
5499
6009
|
return React__default.createElement(ToggleView, Object.assign({
|
|
5500
6010
|
shape: shape,
|
|
5501
6011
|
colorScheme: colorScheme,
|
|
@@ -5510,6 +6020,7 @@ var ToggleComponent = function ToggleComponent(_ref) {
|
|
|
5510
6020
|
};
|
|
5511
6021
|
var Toggle = ToggleComponent;
|
|
5512
6022
|
|
|
6023
|
+
// Define a custom hook for managing ToggleGroup state
|
|
5513
6024
|
var useToggleGroupState = function useToggleGroupState() {
|
|
5514
6025
|
var _useState = React.useState([]),
|
|
5515
6026
|
activeToggles = _useState[0],
|
|
@@ -5520,6 +6031,7 @@ var useToggleGroupState = function useToggleGroupState() {
|
|
|
5520
6031
|
};
|
|
5521
6032
|
};
|
|
5522
6033
|
|
|
6034
|
+
// ToggleGroupView component declaration with destructured properties from props.
|
|
5523
6035
|
var ToggleGroupView = function ToggleGroupView(_ref) {
|
|
5524
6036
|
var items = _ref.items,
|
|
5525
6037
|
onToggleChange = _ref.onToggleChange,
|
|
@@ -5531,14 +6043,13 @@ var ToggleGroupView = function ToggleGroupView(_ref) {
|
|
|
5531
6043
|
variant = _ref$variant === void 0 ? 'ghost' : _ref$variant,
|
|
5532
6044
|
_ref$colorScheme = _ref.colorScheme,
|
|
5533
6045
|
colorScheme = _ref$colorScheme === void 0 ? 'color.trueGray.400' : _ref$colorScheme;
|
|
6046
|
+
// handleToggle is a memoized callback that handles the toggle state changes.
|
|
5534
6047
|
var handleToggle = React.useCallback(function (id, isActive) {
|
|
5535
6048
|
setActiveToggles(function (prevActiveToggles) {
|
|
5536
6049
|
var newActiveToggles;
|
|
5537
6050
|
if (isActive) {
|
|
5538
|
-
// Add the ID only if it's not already included
|
|
5539
6051
|
newActiveToggles = prevActiveToggles.includes(id) ? prevActiveToggles : [].concat(prevActiveToggles, [id]);
|
|
5540
6052
|
} else {
|
|
5541
|
-
// Remove the ID if it's included
|
|
5542
6053
|
newActiveToggles = prevActiveToggles.filter(function (toggleId) {
|
|
5543
6054
|
return toggleId !== id;
|
|
5544
6055
|
});
|
|
@@ -5568,12 +6079,14 @@ var ToggleGroupView = function ToggleGroupView(_ref) {
|
|
|
5568
6079
|
}));
|
|
5569
6080
|
};
|
|
5570
6081
|
|
|
6082
|
+
// Define the functional component with destructured props
|
|
5571
6083
|
var ToggleGroupComponent = function ToggleGroupComponent(_ref) {
|
|
5572
6084
|
var items = _ref.items,
|
|
5573
6085
|
shape = _ref.shape,
|
|
5574
6086
|
colorScheme = _ref.colorScheme,
|
|
5575
6087
|
variant = _ref.variant,
|
|
5576
6088
|
onToggleChange = _ref.onToggleChange;
|
|
6089
|
+
// Hook to manage toggle group state, returns active toggles and a setter for it
|
|
5577
6090
|
var _useToggleGroupState = useToggleGroupState(),
|
|
5578
6091
|
activeToggles = _useToggleGroupState.activeToggles,
|
|
5579
6092
|
setActiveToggles = _useToggleGroupState.setActiveToggles;
|
|
@@ -5587,8 +6100,290 @@ var ToggleGroupComponent = function ToggleGroupComponent(_ref) {
|
|
|
5587
6100
|
onToggleChange: onToggleChange
|
|
5588
6101
|
});
|
|
5589
6102
|
};
|
|
6103
|
+
// Expose the ToggleGroupComponent for import into other modules
|
|
5590
6104
|
var ToggleGroup = ToggleGroupComponent;
|
|
5591
6105
|
|
|
6106
|
+
// Create your store with the initial state and actions.
|
|
6107
|
+
var useMessageStore = /*#__PURE__*/zustand.create(function (set) {
|
|
6108
|
+
return {
|
|
6109
|
+
// initial state
|
|
6110
|
+
visible: false,
|
|
6111
|
+
title: '',
|
|
6112
|
+
subtitle: '',
|
|
6113
|
+
variant: 'info',
|
|
6114
|
+
isClosable: false,
|
|
6115
|
+
styles: {},
|
|
6116
|
+
action: function action() {},
|
|
6117
|
+
actionText: '',
|
|
6118
|
+
showIcon: false,
|
|
6119
|
+
timeout: 3000,
|
|
6120
|
+
show: function show(variant, title, subtitle, isClosable, styles, action, actionText, showIcon, timeout) {
|
|
6121
|
+
if (title === void 0) {
|
|
6122
|
+
title = '';
|
|
6123
|
+
}
|
|
6124
|
+
if (subtitle === void 0) {
|
|
6125
|
+
subtitle = '';
|
|
6126
|
+
}
|
|
6127
|
+
return set({
|
|
6128
|
+
visible: true,
|
|
6129
|
+
variant: variant,
|
|
6130
|
+
title: title,
|
|
6131
|
+
subtitle: subtitle,
|
|
6132
|
+
isClosable: isClosable,
|
|
6133
|
+
styles: styles,
|
|
6134
|
+
action: action,
|
|
6135
|
+
actionText: actionText,
|
|
6136
|
+
showIcon: showIcon,
|
|
6137
|
+
timeout: timeout
|
|
6138
|
+
});
|
|
6139
|
+
},
|
|
6140
|
+
hide: function hide() {
|
|
6141
|
+
return set({
|
|
6142
|
+
visible: false
|
|
6143
|
+
});
|
|
6144
|
+
}
|
|
6145
|
+
};
|
|
6146
|
+
});
|
|
6147
|
+
var showMessage = function showMessage(variant, title, subtitle, props) {
|
|
6148
|
+
useMessageStore.getState().show(variant, title, subtitle, props == null ? void 0 : props.isClosable, props == null ? void 0 : props.styles, props == null ? void 0 : props.action, props == null ? void 0 : props.actionText, props == null ? void 0 : props.showIcon, props == null ? void 0 : props.timeout);
|
|
6149
|
+
};
|
|
6150
|
+
var hideMessage = function hideMessage() {
|
|
6151
|
+
useMessageStore.getState().hide();
|
|
6152
|
+
};
|
|
6153
|
+
|
|
6154
|
+
var Themes$1 = {
|
|
6155
|
+
info: {
|
|
6156
|
+
container: {
|
|
6157
|
+
backgroundColor: 'color.blue.200',
|
|
6158
|
+
border: 'color.blue.400'
|
|
6159
|
+
},
|
|
6160
|
+
icon: {
|
|
6161
|
+
color: 'color.blue.500',
|
|
6162
|
+
name: 'InformationSvg'
|
|
6163
|
+
},
|
|
6164
|
+
content: {
|
|
6165
|
+
color: 'color.blue.500'
|
|
6166
|
+
},
|
|
6167
|
+
close: {
|
|
6168
|
+
color: 'color.blue.500',
|
|
6169
|
+
name: 'CloseSvg'
|
|
6170
|
+
}
|
|
6171
|
+
},
|
|
6172
|
+
success: {
|
|
6173
|
+
container: {
|
|
6174
|
+
backgroundColor: 'color.green.200',
|
|
6175
|
+
border: 'color.green.400'
|
|
6176
|
+
},
|
|
6177
|
+
icon: {
|
|
6178
|
+
color: 'color.green.500',
|
|
6179
|
+
name: 'CheckCircleSvg'
|
|
6180
|
+
},
|
|
6181
|
+
content: {
|
|
6182
|
+
color: 'color.green.500'
|
|
6183
|
+
},
|
|
6184
|
+
close: {
|
|
6185
|
+
color: 'color.green.500',
|
|
6186
|
+
name: 'CloseSvg'
|
|
6187
|
+
}
|
|
6188
|
+
},
|
|
6189
|
+
error: {
|
|
6190
|
+
container: {
|
|
6191
|
+
backgroundColor: 'color.red.200',
|
|
6192
|
+
border: 'color.red.400'
|
|
6193
|
+
},
|
|
6194
|
+
icon: {
|
|
6195
|
+
color: 'color.red.500',
|
|
6196
|
+
name: 'ErrrorSvg'
|
|
6197
|
+
},
|
|
6198
|
+
content: {
|
|
6199
|
+
color: 'color.red.500'
|
|
6200
|
+
},
|
|
6201
|
+
close: {
|
|
6202
|
+
color: 'color.red.500',
|
|
6203
|
+
name: 'CloseSvg'
|
|
6204
|
+
}
|
|
6205
|
+
},
|
|
6206
|
+
warning: {
|
|
6207
|
+
container: {
|
|
6208
|
+
backgroundColor: 'color.orange.200',
|
|
6209
|
+
border: 'color.orange.400'
|
|
6210
|
+
},
|
|
6211
|
+
icon: {
|
|
6212
|
+
color: 'color.orange.500',
|
|
6213
|
+
name: 'ErrrorSvg'
|
|
6214
|
+
},
|
|
6215
|
+
content: {
|
|
6216
|
+
color: 'color.orange.500'
|
|
6217
|
+
},
|
|
6218
|
+
close: {
|
|
6219
|
+
color: 'color.orange.500',
|
|
6220
|
+
name: 'CloseSvg'
|
|
6221
|
+
}
|
|
6222
|
+
}
|
|
6223
|
+
};
|
|
6224
|
+
|
|
6225
|
+
var MessageView = function MessageView(_ref) {
|
|
6226
|
+
var _styles$closingIcon, _styles$closingIcon2;
|
|
6227
|
+
var variant = _ref.variant,
|
|
6228
|
+
hide = _ref.hide,
|
|
6229
|
+
title = _ref.title,
|
|
6230
|
+
subtitle = _ref.subtitle,
|
|
6231
|
+
theme = _ref.theme,
|
|
6232
|
+
action = _ref.action,
|
|
6233
|
+
actionText = _ref.actionText,
|
|
6234
|
+
_ref$showIcon = _ref.showIcon,
|
|
6235
|
+
showIcon = _ref$showIcon === void 0 ? false : _ref$showIcon,
|
|
6236
|
+
_ref$isClosable = _ref.isClosable,
|
|
6237
|
+
isClosable = _ref$isClosable === void 0 ? false : _ref$isClosable,
|
|
6238
|
+
_ref$timeout = _ref.timeout,
|
|
6239
|
+
timeout = _ref$timeout === void 0 ? 3000 : _ref$timeout,
|
|
6240
|
+
styles = _ref.styles;
|
|
6241
|
+
React.useEffect(function () {
|
|
6242
|
+
if (timeout && !isClosable) {
|
|
6243
|
+
var timeId = setTimeout(function () {
|
|
6244
|
+
// After 3 seconds set the show value to false
|
|
6245
|
+
hide();
|
|
6246
|
+
}, timeout);
|
|
6247
|
+
return function () {
|
|
6248
|
+
clearTimeout(timeId);
|
|
6249
|
+
};
|
|
6250
|
+
}
|
|
6251
|
+
return;
|
|
6252
|
+
}, []);
|
|
6253
|
+
var Theme = theme != null ? theme : Themes$1;
|
|
6254
|
+
var isWithAction = !!(action && actionText);
|
|
6255
|
+
var containerStyle = {
|
|
6256
|
+
borderWidth: 1,
|
|
6257
|
+
borderStyle: 'solid',
|
|
6258
|
+
borderRadius: 8,
|
|
6259
|
+
borderColor: "" + Theme[variant].container.border
|
|
6260
|
+
};
|
|
6261
|
+
var iconColor = {
|
|
6262
|
+
info: '#3b82f6',
|
|
6263
|
+
success: '#4ade80',
|
|
6264
|
+
warning: '#f97316',
|
|
6265
|
+
error: '#ef4444'
|
|
6266
|
+
}[variant];
|
|
6267
|
+
var iconComponent = {
|
|
6268
|
+
info: React__default.createElement(InfoSvg, Object.assign({
|
|
6269
|
+
size: 24,
|
|
6270
|
+
color: iconColor
|
|
6271
|
+
}, styles == null ? void 0 : styles.icon)),
|
|
6272
|
+
success: React__default.createElement(SuccessSvg, Object.assign({
|
|
6273
|
+
size: 24,
|
|
6274
|
+
color: iconColor
|
|
6275
|
+
}, styles == null ? void 0 : styles.icon)),
|
|
6276
|
+
warning: React__default.createElement(WarningSvg, Object.assign({
|
|
6277
|
+
size: 24,
|
|
6278
|
+
color: iconColor
|
|
6279
|
+
}, styles == null ? void 0 : styles.icon)),
|
|
6280
|
+
error: React__default.createElement(ErrorSvg, Object.assign({
|
|
6281
|
+
size: 24,
|
|
6282
|
+
color: iconColor
|
|
6283
|
+
}, styles == null ? void 0 : styles.icon))
|
|
6284
|
+
}[variant];
|
|
6285
|
+
var isShowIcon = showIcon && iconComponent;
|
|
6286
|
+
return React__default.createElement(Horizontal, Object.assign({
|
|
6287
|
+
role: "messageContent",
|
|
6288
|
+
gap: 16,
|
|
6289
|
+
width: 400,
|
|
6290
|
+
// safe={true}
|
|
6291
|
+
wrap: "nowrap",
|
|
6292
|
+
position: 'relative',
|
|
6293
|
+
alignItems: "center",
|
|
6294
|
+
padding: "14px 24px 14px 14px",
|
|
6295
|
+
color: "" + Theme[variant].content.color,
|
|
6296
|
+
backgroundColor: "" + Theme[variant].container.backgroundColor,
|
|
6297
|
+
onClick: isClosable ? function () {} : function () {
|
|
6298
|
+
hide();
|
|
6299
|
+
}
|
|
6300
|
+
}, containerStyle, styles == null ? void 0 : styles.container), isShowIcon && iconComponent, React__default.createElement(Vertical, {
|
|
6301
|
+
gap: 8,
|
|
6302
|
+
width: "100%"
|
|
6303
|
+
}, React__default.createElement(Text, Object.assign({
|
|
6304
|
+
size: "md",
|
|
6305
|
+
weight: "semiBold"
|
|
6306
|
+
}, styles == null ? void 0 : styles.title), title), subtitle && React__default.createElement(Text, Object.assign({
|
|
6307
|
+
size: "sm"
|
|
6308
|
+
}, styles == null ? void 0 : styles.subtitle), subtitle)), isWithAction && React__default.createElement(Text, Object.assign({
|
|
6309
|
+
marginRight: 10,
|
|
6310
|
+
onClick: action,
|
|
6311
|
+
padding: "6px 10px",
|
|
6312
|
+
whiteSpace: "nowrap"
|
|
6313
|
+
}, containerStyle, styles == null ? void 0 : styles.actionText), actionText), isClosable && React__default.createElement(View, Object.assign({
|
|
6314
|
+
position: "absolute",
|
|
6315
|
+
zIndex: 10000,
|
|
6316
|
+
right: 8,
|
|
6317
|
+
top: 6,
|
|
6318
|
+
onClick: function onClick() {
|
|
6319
|
+
hide();
|
|
6320
|
+
}
|
|
6321
|
+
}, styles == null || (_styles$closingIcon = styles.closingIcon) == null ? void 0 : _styles$closingIcon.container), React__default.createElement(CloseSvg, Object.assign({
|
|
6322
|
+
size: 18,
|
|
6323
|
+
color: iconColor
|
|
6324
|
+
}, styles == null || (_styles$closingIcon2 = styles.closingIcon) == null ? void 0 : _styles$closingIcon2.icon))));
|
|
6325
|
+
};
|
|
6326
|
+
|
|
6327
|
+
var MessageLayout = function MessageLayout(_ref) {
|
|
6328
|
+
var container = _ref.container,
|
|
6329
|
+
theme = _ref.theme,
|
|
6330
|
+
_ref$position = _ref.position,
|
|
6331
|
+
position = _ref$position === void 0 ? 'topRight' : _ref$position;
|
|
6332
|
+
var _useMessageStore = useMessageStore(),
|
|
6333
|
+
visible = _useMessageStore.visible,
|
|
6334
|
+
title = _useMessageStore.title,
|
|
6335
|
+
variant = _useMessageStore.variant,
|
|
6336
|
+
subtitle = _useMessageStore.subtitle,
|
|
6337
|
+
isClosable = _useMessageStore.isClosable,
|
|
6338
|
+
styles = _useMessageStore.styles,
|
|
6339
|
+
action = _useMessageStore.action,
|
|
6340
|
+
actionText = _useMessageStore.actionText,
|
|
6341
|
+
showIcon = _useMessageStore.showIcon,
|
|
6342
|
+
timeout = _useMessageStore.timeout;
|
|
6343
|
+
var toastPosition = {
|
|
6344
|
+
topLeft: {
|
|
6345
|
+
top: 6,
|
|
6346
|
+
left: 8
|
|
6347
|
+
},
|
|
6348
|
+
topRight: {
|
|
6349
|
+
top: 6,
|
|
6350
|
+
right: 8
|
|
6351
|
+
},
|
|
6352
|
+
bottomLeft: {
|
|
6353
|
+
bottom: 8,
|
|
6354
|
+
left: 6
|
|
6355
|
+
},
|
|
6356
|
+
bottomRight: {
|
|
6357
|
+
bottom: 8,
|
|
6358
|
+
right: 6
|
|
6359
|
+
}
|
|
6360
|
+
}[position];
|
|
6361
|
+
// Crée une fonction pour construire le contenu du message
|
|
6362
|
+
var renderMessageContent = function renderMessageContent() {
|
|
6363
|
+
return React__default.createElement(MessageView, {
|
|
6364
|
+
variant: variant,
|
|
6365
|
+
subtitle: subtitle,
|
|
6366
|
+
show: visible,
|
|
6367
|
+
title: title,
|
|
6368
|
+
theme: theme,
|
|
6369
|
+
isClosable: isClosable,
|
|
6370
|
+
styles: styles,
|
|
6371
|
+
action: action,
|
|
6372
|
+
actionText: actionText,
|
|
6373
|
+
showIcon: showIcon,
|
|
6374
|
+
timeout: timeout,
|
|
6375
|
+
hide: function hide() {
|
|
6376
|
+
return hideMessage();
|
|
6377
|
+
}
|
|
6378
|
+
});
|
|
6379
|
+
};
|
|
6380
|
+
var MessageContainer = container ? React__default.cloneElement(container, {}, renderMessageContent()) : React__default.createElement(View, Object.assign({
|
|
6381
|
+
position: 'absolute',
|
|
6382
|
+
zIndex: 10000
|
|
6383
|
+
}, toastPosition), renderMessageContent());
|
|
6384
|
+
return visible ? MessageContainer : null;
|
|
6385
|
+
};
|
|
6386
|
+
|
|
5592
6387
|
exports.Alert = Alert;
|
|
5593
6388
|
exports.AspectRatio = AspectRatio;
|
|
5594
6389
|
exports.Avatar = Avatar;
|
|
@@ -5602,6 +6397,7 @@ exports.DatePicker = DatePicker;
|
|
|
5602
6397
|
exports.FileImage = FileImage;
|
|
5603
6398
|
exports.FileSVG = FileSVG;
|
|
5604
6399
|
exports.FormikCheckbox = FormikCheckbox;
|
|
6400
|
+
exports.FormikComboBox = FormikComboBox;
|
|
5605
6401
|
exports.FormikCountryPicker = FormikCountryPicker;
|
|
5606
6402
|
exports.FormikDatePicker = FormikDatePicker;
|
|
5607
6403
|
exports.FormikForm = FormikForm;
|
|
@@ -5615,6 +6411,8 @@ exports.Inline = Inline;
|
|
|
5615
6411
|
exports.Left = Left;
|
|
5616
6412
|
exports.Link = Link;
|
|
5617
6413
|
exports.Loader = Loader;
|
|
6414
|
+
exports.MessageLayout = MessageLayout;
|
|
6415
|
+
exports.MessageView = MessageView;
|
|
5618
6416
|
exports.Modal = Modal;
|
|
5619
6417
|
exports.Password = Password;
|
|
5620
6418
|
exports.Right = Right;
|
|
@@ -5629,7 +6427,10 @@ exports.ToggleGroup = ToggleGroup;
|
|
|
5629
6427
|
exports.Top = Top;
|
|
5630
6428
|
exports.Vertical = Vertical;
|
|
5631
6429
|
exports.View = View;
|
|
6430
|
+
exports.hideMessage = hideMessage;
|
|
5632
6431
|
exports.hideModal = hideModal;
|
|
6432
|
+
exports.showMessage = showMessage;
|
|
5633
6433
|
exports.showModal = showModal;
|
|
6434
|
+
exports.useMessageStore = useMessageStore;
|
|
5634
6435
|
exports.useModalStore = useModalStore;
|
|
5635
6436
|
//# sourceMappingURL=web.cjs.development.js.map
|