@hyphen/hyphen-components 2.20.0 → 2.22.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/css/utilities.css +1 -1
- package/dist/css/variables.css +2 -2
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useIsMobile/useIsMobile.d.ts +1 -0
- package/dist/hooks/useIsMobile/useIsMobile.stories.d.ts +6 -0
- package/dist/hyphen-components.cjs.development.js +42 -0
- package/dist/hyphen-components.cjs.development.js.map +1 -1
- package/dist/hyphen-components.cjs.production.min.js +1 -1
- package/dist/hyphen-components.cjs.production.min.js.map +1 -1
- package/dist/hyphen-components.esm.js +239 -216
- package/dist/hyphen-components.esm.js.map +1 -1
- package/dist/lib/tokens.d.ts +1 -1
- package/package.json +2 -2
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useIsMobile/useIsMobile.mdx +12 -0
- package/src/hooks/useIsMobile/useIsMobile.stories.tsx +27 -0
- package/src/hooks/useIsMobile/useIsMobile.test.tsx +46 -0
- package/src/hooks/useIsMobile/useIsMobile.tsx +23 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import React__default, { forwardRef, Children, createElement, cloneElement, useRef, useState, useEffect, isValidElement, useCallback, useMemo, useLayoutEffect, createContext } from 'react';
|
|
3
4
|
import classNames from 'classnames';
|
|
4
5
|
import icons from '@hyphen/hyphen-design-tokens/build/assets/icons/react';
|
|
5
6
|
import format from 'date-fns/format';
|
|
@@ -493,11 +494,11 @@ var Icon = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
493
494
|
var IconComponent = icons[name];
|
|
494
495
|
if (!IconComponent) console.error("Icon '" + name + "' not found"); // eslint-disable-line no-console
|
|
495
496
|
var iconClasses = classNames(className, generateResponsiveClasses('font-color', color), generateResponsiveClasses('font-size', size));
|
|
496
|
-
return IconComponent ?
|
|
497
|
+
return IconComponent ? React__default.createElement(IconComponent, _extends({
|
|
497
498
|
className: iconClasses || null,
|
|
498
499
|
ref: ref,
|
|
499
500
|
"data-testid": "icon-testid--" + name
|
|
500
|
-
}, restProps)) :
|
|
501
|
+
}, restProps)) : React__default.createElement(Box, {
|
|
501
502
|
fontWeight: "bold",
|
|
502
503
|
background: "error",
|
|
503
504
|
color: "white",
|
|
@@ -556,10 +557,10 @@ var Alert = function Alert(_ref) {
|
|
|
556
557
|
onClose(event);
|
|
557
558
|
};
|
|
558
559
|
var renderAlertIcon = function renderAlertIcon() {
|
|
559
|
-
return
|
|
560
|
+
return React__default.createElement(Box, {
|
|
560
561
|
fontSize: "md",
|
|
561
562
|
className: styles$v["alert__icon__" + variant]
|
|
562
|
-
},
|
|
563
|
+
}, React__default.createElement(Icon, {
|
|
563
564
|
name: ALERT_ICONS_MAP[variant].icon,
|
|
564
565
|
"data-testid": "alert-icon-" + variant + "-test-id"
|
|
565
566
|
}));
|
|
@@ -568,21 +569,21 @@ var Alert = function Alert(_ref) {
|
|
|
568
569
|
var handleCloseKeyPress = function handleCloseKeyPress(event) {
|
|
569
570
|
if (event.keyCode === 13) handleClose(event);
|
|
570
571
|
};
|
|
571
|
-
return
|
|
572
|
+
return React__default.createElement(Box, {
|
|
572
573
|
margin: "0 0 0 auto",
|
|
573
574
|
color: "secondary",
|
|
574
575
|
className: styles$v['close-icon']
|
|
575
|
-
},
|
|
576
|
+
}, React__default.createElement("button", {
|
|
576
577
|
type: "button",
|
|
577
578
|
onClick: handleClose,
|
|
578
579
|
onKeyUp: handleCloseKeyPress
|
|
579
|
-
}, closeText ||
|
|
580
|
+
}, closeText || React__default.createElement(Icon, {
|
|
580
581
|
name: "remove",
|
|
581
582
|
"data-testid": "alert-close-icon-test-id"
|
|
582
583
|
})));
|
|
583
584
|
};
|
|
584
585
|
var alertContainerClasses = classNames(styles$v["alert__" + variant], styles$v.alert, className);
|
|
585
|
-
return
|
|
586
|
+
return React__default.createElement(Box, _extends({
|
|
586
587
|
alignItems: "flex-start",
|
|
587
588
|
gap: "md",
|
|
588
589
|
className: alertContainerClasses,
|
|
@@ -591,15 +592,15 @@ var Alert = function Alert(_ref) {
|
|
|
591
592
|
radius: "md",
|
|
592
593
|
role: "alert",
|
|
593
594
|
fontSize: "sm"
|
|
594
|
-
}, restProps), hasIcon && renderAlertIcon(),
|
|
595
|
+
}, restProps), hasIcon && renderAlertIcon(), React__default.createElement("div", null, render ? render() : React__default.createElement(Box, {
|
|
595
596
|
display: "block",
|
|
596
597
|
childGap: message && title ? '2xs' : undefined
|
|
597
|
-
}, title &&
|
|
598
|
+
}, title && React__default.createElement(Box, {
|
|
598
599
|
as: "h4",
|
|
599
600
|
fontSize: "sm",
|
|
600
601
|
fontWeight: "semibold",
|
|
601
602
|
className: styles$v['alert-heading']
|
|
602
|
-
}, title), message && (typeof message === 'string' ?
|
|
603
|
+
}, title), message && (typeof message === 'string' ? React__default.createElement("p", null, message) : message))), isClosable && renderCloseIcon());
|
|
603
604
|
};
|
|
604
605
|
|
|
605
606
|
var styles$u = {"badge":"Badge-module_badge__ZbEBU","size-sm":"Badge-module_size-sm__rL8a6","size-md":"Badge-module_size-md__kf6IH","size-lg":"Badge-module_size-lg__of6XJ","inverse":"Badge-module_inverse__qZCFA","purple":"Badge-module_purple__rX-xW","green":"Badge-module_green__W03uU","red":"Badge-module_red__fl2jg","blue":"Badge-module_blue__C7kyV","yellow":"Badge-module_yellow__gGZ6R","light-grey":"Badge-module_light-grey__Wtrhx","dark-grey":"Badge-module_dark-grey__X-807","hyphen":"Badge-module_hyphen__9pe7x","size-sm-tablet":"Badge-module_size-sm-tablet__6xMVk","size-md-tablet":"Badge-module_size-md-tablet__4w-7I","size-lg-tablet":"Badge-module_size-lg-tablet__8xyRF","size-sm-desktop":"Badge-module_size-sm-desktop__Ayf5L","size-md-desktop":"Badge-module_size-md-desktop__XSq7m","size-lg-desktop":"Badge-module_size-lg-desktop__Baw3S","size-sm-hd":"Badge-module_size-sm-hd__Da6Au","size-md-hd":"Badge-module_size-md-hd__-VNMk","size-lg-hd":"Badge-module_size-lg-hd__6MOwL"};
|
|
@@ -620,7 +621,7 @@ var Badge = function Badge(_ref) {
|
|
|
620
621
|
return styles$u[c];
|
|
621
622
|
});
|
|
622
623
|
var badgeClasses = classNames(styles$u.badge, className, responsiveClasses, (_classNames = {}, _classNames[styles$u[variant]] = variant, _classNames));
|
|
623
|
-
return
|
|
624
|
+
return React__default.createElement(Box, _extends({
|
|
624
625
|
className: badgeClasses,
|
|
625
626
|
display: "inline-block"
|
|
626
627
|
}, restProps), message);
|
|
@@ -641,24 +642,24 @@ var Spinner = function Spinner(_ref) {
|
|
|
641
642
|
if (size === 'xl') pixels = '30';
|
|
642
643
|
return pixels;
|
|
643
644
|
};
|
|
644
|
-
return
|
|
645
|
+
return React__default.createElement("span", {
|
|
645
646
|
className: classes
|
|
646
|
-
},
|
|
647
|
+
}, React__default.createElement("svg", {
|
|
647
648
|
xmlns: "http://www.w3.org/2000/svg",
|
|
648
649
|
width: sizeInPixels(),
|
|
649
650
|
height: sizeInPixels(),
|
|
650
651
|
viewBox: "0 0 16 16",
|
|
651
652
|
"data-testid": "spinner-testid"
|
|
652
|
-
},
|
|
653
|
+
}, React__default.createElement("g", {
|
|
653
654
|
fill: "currentColor"
|
|
654
|
-
},
|
|
655
|
+
}, React__default.createElement("rect", {
|
|
655
656
|
fill: "currentColor",
|
|
656
657
|
height: "2",
|
|
657
658
|
rx: ".5",
|
|
658
659
|
width: "4",
|
|
659
660
|
x: "12",
|
|
660
661
|
y: "7"
|
|
661
|
-
}),
|
|
662
|
+
}), React__default.createElement("rect", {
|
|
662
663
|
fill: "currentColor",
|
|
663
664
|
height: "4.001",
|
|
664
665
|
rx: ".5",
|
|
@@ -667,7 +668,7 @@ var Spinner = function Spinner(_ref) {
|
|
|
667
668
|
x: "11.243",
|
|
668
669
|
y: "10.242",
|
|
669
670
|
transform: "rotate(-44.975 12.243 12.243)"
|
|
670
|
-
}),
|
|
671
|
+
}), React__default.createElement("rect", {
|
|
671
672
|
fill: "currentColor",
|
|
672
673
|
height: "4",
|
|
673
674
|
rx: ".5",
|
|
@@ -675,7 +676,7 @@ var Spinner = function Spinner(_ref) {
|
|
|
675
676
|
opacity: ".4",
|
|
676
677
|
x: "7",
|
|
677
678
|
y: "12"
|
|
678
|
-
}),
|
|
679
|
+
}), React__default.createElement("rect", {
|
|
679
680
|
fill: "currentColor",
|
|
680
681
|
height: "1.999",
|
|
681
682
|
rx: ".5",
|
|
@@ -684,14 +685,14 @@ var Spinner = function Spinner(_ref) {
|
|
|
684
685
|
x: "1.757",
|
|
685
686
|
y: "11.243",
|
|
686
687
|
transform: "rotate(-45.03 3.757 12.242)"
|
|
687
|
-
}),
|
|
688
|
+
}), React__default.createElement("rect", {
|
|
688
689
|
fill: "currentColor",
|
|
689
690
|
height: "2",
|
|
690
691
|
rx: ".5",
|
|
691
692
|
width: "4",
|
|
692
693
|
opacity: ".4",
|
|
693
694
|
y: "7"
|
|
694
|
-
}),
|
|
695
|
+
}), React__default.createElement("rect", {
|
|
695
696
|
fill: "currentColor",
|
|
696
697
|
height: "4.001",
|
|
697
698
|
rx: ".5",
|
|
@@ -700,14 +701,14 @@ var Spinner = function Spinner(_ref) {
|
|
|
700
701
|
x: "2.758",
|
|
701
702
|
y: "1.757",
|
|
702
703
|
transform: "rotate(-44.975 3.757 3.757)"
|
|
703
|
-
}),
|
|
704
|
+
}), React__default.createElement("rect", {
|
|
704
705
|
fill: "currentColor",
|
|
705
706
|
height: "4",
|
|
706
707
|
rx: ".5",
|
|
707
708
|
width: "2",
|
|
708
709
|
opacity: ".6",
|
|
709
710
|
x: "7"
|
|
710
|
-
}),
|
|
711
|
+
}), React__default.createElement("rect", {
|
|
711
712
|
fill: "currentColor",
|
|
712
713
|
height: "1.999",
|
|
713
714
|
rx: ".5",
|
|
@@ -806,34 +807,34 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
806
807
|
var handleBlur = function handleBlur(event) {
|
|
807
808
|
if (onBlur) onBlur(event);
|
|
808
809
|
};
|
|
809
|
-
var buttonContent = iconPrefix || iconSuffix ?
|
|
810
|
+
var buttonContent = iconPrefix || iconSuffix ? React__default.createElement(Box, {
|
|
810
811
|
display: "inline-flex",
|
|
811
812
|
direction: "row",
|
|
812
813
|
alignItems: "center",
|
|
813
814
|
gap: "md"
|
|
814
|
-
}, isLoading &&
|
|
815
|
+
}, isLoading && React__default.createElement(Spinner, {
|
|
815
816
|
className: styles$s['spinner-wrapper']
|
|
816
|
-
}), iconPrefix &&
|
|
817
|
+
}), iconPrefix && React__default.createElement(Icon, {
|
|
817
818
|
className: styles$s.label,
|
|
818
819
|
name: iconPrefix,
|
|
819
820
|
"aria-hidden": "true",
|
|
820
821
|
focusable: "false",
|
|
821
822
|
"data-testid": "prefixIcon",
|
|
822
823
|
size: size === 'md' ? 'sm' : size
|
|
823
|
-
}), children &&
|
|
824
|
+
}), children && React__default.createElement("span", {
|
|
824
825
|
className: styles$s.label
|
|
825
|
-
}, children), iconSuffix &&
|
|
826
|
+
}, children), iconSuffix && React__default.createElement(Icon, {
|
|
826
827
|
className: styles$s.label,
|
|
827
828
|
name: iconSuffix,
|
|
828
829
|
"aria-hidden": "true",
|
|
829
830
|
focusable: "false",
|
|
830
831
|
"data-testid": "suffixIcon",
|
|
831
832
|
size: size === 'md' ? 'sm' : size
|
|
832
|
-
})) :
|
|
833
|
+
})) : React__default.createElement(React__default.Fragment, null, isLoading && React__default.createElement(Spinner, {
|
|
833
834
|
className: styles$s['spinner-wrapper']
|
|
834
835
|
}), function () {
|
|
835
836
|
if (children) {
|
|
836
|
-
return
|
|
837
|
+
return React__default.createElement("span", {
|
|
837
838
|
className: styles$s.label
|
|
838
839
|
}, children);
|
|
839
840
|
}
|
|
@@ -862,7 +863,7 @@ var CardFooter = function CardFooter(_ref) {
|
|
|
862
863
|
_ref$padding = _ref.padding,
|
|
863
864
|
padding = _ref$padding === void 0 ? '2xl' : _ref$padding,
|
|
864
865
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$E);
|
|
865
|
-
return
|
|
866
|
+
return React__default.createElement(Box, _extends({
|
|
866
867
|
display: display,
|
|
867
868
|
padding: padding,
|
|
868
869
|
background: background,
|
|
@@ -918,12 +919,12 @@ var CardHeader = function CardHeader(_ref) {
|
|
|
918
919
|
title = _ref$title === void 0 ? null : _ref$title,
|
|
919
920
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$C);
|
|
920
921
|
var renderTitle = function renderTitle() {
|
|
921
|
-
return typeof title === 'string' ?
|
|
922
|
+
return typeof title === 'string' ? React__default.createElement(Heading, {
|
|
922
923
|
size: "sm",
|
|
923
924
|
as: "h4"
|
|
924
925
|
}, title) : title;
|
|
925
926
|
};
|
|
926
|
-
return
|
|
927
|
+
return React__default.createElement(Box, _extends({
|
|
927
928
|
childGap: childGap,
|
|
928
929
|
display: display,
|
|
929
930
|
padding: padding,
|
|
@@ -959,30 +960,30 @@ var CardSection = function CardSection(_ref) {
|
|
|
959
960
|
_ref$title = _ref.title,
|
|
960
961
|
title = _ref$title === void 0 ? undefined : _ref$title,
|
|
961
962
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$B);
|
|
962
|
-
var renderTitle = typeof title === 'string' ?
|
|
963
|
+
var renderTitle = typeof title === 'string' ? React__default.createElement(Box, {
|
|
963
964
|
className: "m-bottom-md"
|
|
964
|
-
},
|
|
965
|
+
}, React__default.createElement(Box, {
|
|
965
966
|
as: "h4",
|
|
966
967
|
fontWeight: "bold",
|
|
967
968
|
fontSize: "sm",
|
|
968
969
|
color: "base"
|
|
969
970
|
}, title)) : title;
|
|
970
971
|
var sectionClasses = classNames((_classNames = {}, _classNames[styles$q['card-section-border']] = borderColor === undefined && borderWidth === undefined, _classNames[styles$q['card-subdued']] = subdued, _classNames), className);
|
|
971
|
-
return
|
|
972
|
+
return React__default.createElement(Box, _extends({
|
|
972
973
|
background: background,
|
|
973
974
|
borderColor: borderColor,
|
|
974
975
|
borderWidth: borderWidth,
|
|
975
976
|
className: sectionClasses,
|
|
976
977
|
display: display,
|
|
977
978
|
padding: padding
|
|
978
|
-
}, restProps), renderTitle,
|
|
979
|
+
}, restProps), renderTitle, React__default.createElement(Box, {
|
|
979
980
|
gap: gap,
|
|
980
981
|
childGap: childGap
|
|
981
982
|
}, children));
|
|
982
983
|
};
|
|
983
984
|
|
|
984
985
|
var _excluded$A = ["children", "subdued", "overflow", "display", "width"];
|
|
985
|
-
var CardBaseComponent = /*#__PURE__*/
|
|
986
|
+
var CardBaseComponent = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
986
987
|
var children = _ref.children,
|
|
987
988
|
subdued = _ref.subdued,
|
|
988
989
|
_ref$overflow = _ref.overflow,
|
|
@@ -992,7 +993,7 @@ var CardBaseComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
992
993
|
_ref$width = _ref.width,
|
|
993
994
|
width = _ref$width === void 0 ? '100' : _ref$width,
|
|
994
995
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$A);
|
|
995
|
-
return
|
|
996
|
+
return React__default.createElement(Box, _extends({
|
|
996
997
|
background: subdued ? 'secondary' : 'primary',
|
|
997
998
|
borderWidth: "sm",
|
|
998
999
|
borderColor: "subtle",
|
|
@@ -1040,11 +1041,11 @@ var CheckboxIcon = function CheckboxIcon(_ref) {
|
|
|
1040
1041
|
}
|
|
1041
1042
|
if (error) color = 'danger';
|
|
1042
1043
|
if (isDisabled && error) color = 'danger-disabled';
|
|
1043
|
-
return
|
|
1044
|
+
return React__default.createElement(Box, _extends({
|
|
1044
1045
|
className: className,
|
|
1045
1046
|
display: "inline-block",
|
|
1046
1047
|
color: color
|
|
1047
|
-
}, restProps),
|
|
1048
|
+
}, restProps), React__default.createElement(Icon, {
|
|
1048
1049
|
name: name
|
|
1049
1050
|
}));
|
|
1050
1051
|
};
|
|
@@ -1052,7 +1053,7 @@ var CheckboxIcon = function CheckboxIcon(_ref) {
|
|
|
1052
1053
|
var styles$p = {"checkbox":"Checkbox-module_checkbox__dY-7P","size-sm":"Checkbox-module_size-sm__mJkMQ","size-md":"Checkbox-module_size-md__I2s8g","size-lg":"Checkbox-module_size-lg__rFFnb","hidden":"Checkbox-module_hidden__2y7Zr","size-sm-tablet":"Checkbox-module_size-sm-tablet__GhQUW","size-md-tablet":"Checkbox-module_size-md-tablet__XRHf4","size-lg-tablet":"Checkbox-module_size-lg-tablet__quoAJ","size-sm-desktop":"Checkbox-module_size-sm-desktop__fqeEc","size-md-desktop":"Checkbox-module_size-md-desktop__9a278","size-lg-desktop":"Checkbox-module_size-lg-desktop__WQnv0","size-sm-hd":"Checkbox-module_size-sm-hd__X3yIF","size-md-hd":"Checkbox-module_size-md-hd__6T0dF","size-lg-hd":"Checkbox-module_size-lg-hd__UXCt1"};
|
|
1053
1054
|
|
|
1054
1055
|
var _excluded$y = ["className", "display", "id", "isChecked", "label", "labelledby", "onChange", "error", "isDisabled", "isHidden", "isIndeterminate", "isRequired", "onBlur", "onFocus", "size", "value"];
|
|
1055
|
-
var Checkbox = /*#__PURE__*/
|
|
1056
|
+
var Checkbox = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
1056
1057
|
var _ref2;
|
|
1057
1058
|
var _ref$className = _ref.className,
|
|
1058
1059
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
@@ -1082,8 +1083,8 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1082
1083
|
_ref$value = _ref.value,
|
|
1083
1084
|
value = _ref$value === void 0 ? undefined : _ref$value,
|
|
1084
1085
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$y);
|
|
1085
|
-
var inputRef =
|
|
1086
|
-
|
|
1086
|
+
var inputRef = React__default.useRef(null);
|
|
1087
|
+
React__default.useEffect(function () {
|
|
1087
1088
|
if (inputRef != null && inputRef.current) {
|
|
1088
1089
|
inputRef.current.indeterminate = isIndeterminate;
|
|
1089
1090
|
}
|
|
@@ -1121,19 +1122,19 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1121
1122
|
var iconClasses = classNames.apply(void 0, responsiveClasses.map(function (c) {
|
|
1122
1123
|
return styles$p[c];
|
|
1123
1124
|
}));
|
|
1124
|
-
return
|
|
1125
|
+
return React__default.createElement(Box, _extends({
|
|
1125
1126
|
display: display,
|
|
1126
1127
|
ref: ref,
|
|
1127
1128
|
style: {
|
|
1128
1129
|
position: 'relative'
|
|
1129
1130
|
},
|
|
1130
1131
|
className: containerClasses
|
|
1131
|
-
}, restProps),
|
|
1132
|
+
}, restProps), React__default.createElement("input", _extends({}, inputProps, {
|
|
1132
1133
|
style: {
|
|
1133
1134
|
position: 'absolute',
|
|
1134
1135
|
opacity: '0'
|
|
1135
1136
|
}
|
|
1136
|
-
})), !isHidden &&
|
|
1137
|
+
})), !isHidden && React__default.createElement(CheckboxIcon, {
|
|
1137
1138
|
isChecked: isChecked,
|
|
1138
1139
|
isDisabled: isDisabled,
|
|
1139
1140
|
isIndeterminate: isIndeterminate,
|
|
@@ -1149,7 +1150,7 @@ var InputValidationMessage = function InputValidationMessage(_ref) {
|
|
|
1149
1150
|
_ref$size = _ref.size,
|
|
1150
1151
|
size = _ref$size === void 0 ? 'sm' : _ref$size;
|
|
1151
1152
|
var classes = classNames('hyphen-components__variables__form-control', styles$o['input-validation-message'], 'font-color-danger', "font-size-" + size, 'm-top-sm');
|
|
1152
|
-
return
|
|
1153
|
+
return React__default.createElement("div", {
|
|
1153
1154
|
className: classes
|
|
1154
1155
|
}, children);
|
|
1155
1156
|
};
|
|
@@ -1161,7 +1162,7 @@ var styles$m = {"help-text":"HelpText-module_help-text__8WodW"};
|
|
|
1161
1162
|
var HelpText = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
1162
1163
|
var children = _ref.children,
|
|
1163
1164
|
className = _ref.className;
|
|
1164
|
-
return
|
|
1165
|
+
return React__default.createElement(Box, {
|
|
1165
1166
|
ref: ref,
|
|
1166
1167
|
className: classNames('hyphen-components__variables__form-control', styles$m['help-text'], className),
|
|
1167
1168
|
display: "block",
|
|
@@ -1194,7 +1195,7 @@ var FormLabel = function FormLabel(_ref) {
|
|
|
1194
1195
|
padding = _ref$padding === void 0 ? '0' : _ref$padding,
|
|
1195
1196
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$x);
|
|
1196
1197
|
var labelClasses = classNames('hyphen-components__variables__form-control', styles$n.label, className, (_classNames = {}, _classNames[styles$n.disabled] = isDisabled, _classNames[styles$n.disabled] = isDisabled, _classNames[styles$n['radio-input-label']] = isRadioInputLabel, _classNames));
|
|
1197
|
-
return
|
|
1198
|
+
return React__default.createElement(Box, _extends({
|
|
1198
1199
|
as: "label",
|
|
1199
1200
|
id: inputId + "Label",
|
|
1200
1201
|
className: labelClasses,
|
|
@@ -1202,7 +1203,7 @@ var FormLabel = function FormLabel(_ref) {
|
|
|
1202
1203
|
margin: margin,
|
|
1203
1204
|
padding: padding,
|
|
1204
1205
|
htmlFor: inputId
|
|
1205
|
-
}, restProps), children, isFieldRequired && requiredIndicator &&
|
|
1206
|
+
}, restProps), children, isFieldRequired && requiredIndicator && React__default.createElement("span", null, requiredIndicator), helpText && React__default.createElement(HelpText, null, helpText));
|
|
1206
1207
|
};
|
|
1207
1208
|
|
|
1208
1209
|
var _excluded$w = ["id", "isChecked", "label", "onChange", "className", "error", "hideLabel", "helpText", "isDisabled", "isIndeterminate", "isRequired", "onBlur", "onFocus", "requiredIndicator", "size"];
|
|
@@ -1282,14 +1283,14 @@ var CheckboxInput = function CheckboxInput(_ref2) {
|
|
|
1282
1283
|
requiredIndicator: requiredIndicator,
|
|
1283
1284
|
className: classNames.apply(void 0, cssShorthandToClasses('m', computedResponsiveSize(size)))
|
|
1284
1285
|
};
|
|
1285
|
-
return
|
|
1286
|
+
return React__default.createElement(Box, _extends({
|
|
1286
1287
|
className: className
|
|
1287
|
-
}, restProps),
|
|
1288
|
+
}, restProps), React__default.createElement(Box, {
|
|
1288
1289
|
alignItems: "flex-start",
|
|
1289
1290
|
direction: "row"
|
|
1290
|
-
},
|
|
1291
|
+
}, React__default.createElement(Checkbox, _extends({}, checkboxProps, {
|
|
1291
1292
|
labelledby: id + "Label"
|
|
1292
|
-
})), label && !hideLabel &&
|
|
1293
|
+
})), label && !hideLabel && React__default.createElement(FormLabel, _extends({}, labelProps), label)), error && error !== true && React__default.createElement(InputValidationMessage, null, error));
|
|
1293
1294
|
};
|
|
1294
1295
|
|
|
1295
1296
|
var styles$l = {};
|
|
@@ -1328,7 +1329,7 @@ var DatePicker = function DatePicker(_ref) {
|
|
|
1328
1329
|
} : _ref$formatWeekDay,
|
|
1329
1330
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$v);
|
|
1330
1331
|
var datePickerClasses = classNames(styles$l['react-datepicker'], className);
|
|
1331
|
-
return
|
|
1332
|
+
return React__default.createElement(ReactDatePicker, _extends({
|
|
1332
1333
|
inline: true,
|
|
1333
1334
|
calendarClassName: datePickerClasses,
|
|
1334
1335
|
formatWeekDay: formatWeekDay,
|
|
@@ -1347,7 +1348,7 @@ var DatePicker = function DatePicker(_ref) {
|
|
|
1347
1348
|
};
|
|
1348
1349
|
|
|
1349
1350
|
var _excluded$u = ["label", "hideLabel", "children", "error", "id", "isRequired", "helpText", "isDisabled", "requiredIndicator", "width"];
|
|
1350
|
-
var FormControl = /*#__PURE__*/
|
|
1351
|
+
var FormControl = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
1351
1352
|
var label = _ref.label,
|
|
1352
1353
|
hideLabel = _ref.hideLabel,
|
|
1353
1354
|
children = _ref.children,
|
|
@@ -1368,10 +1369,10 @@ var FormControl = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1368
1369
|
isFieldRequired: isRequired,
|
|
1369
1370
|
requiredIndicator: requiredIndicator
|
|
1370
1371
|
};
|
|
1371
|
-
return
|
|
1372
|
+
return React__default.createElement(Box, _extends({
|
|
1372
1373
|
width: width,
|
|
1373
1374
|
ref: ref
|
|
1374
|
-
}, restProps), label && !hideLabel &&
|
|
1375
|
+
}, restProps), label && !hideLabel && React__default.createElement(FormLabel, _extends({}, labelProps), label), children, error && error !== true && React__default.createElement(InputValidationMessage, null, error));
|
|
1375
1376
|
});
|
|
1376
1377
|
|
|
1377
1378
|
// eslint-disable-next-line import/prefer-default-export
|
|
@@ -1441,14 +1442,14 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1441
1442
|
var handleKeyPress = function handleKeyPress(event) {
|
|
1442
1443
|
if (event.keyCode === 13 && onClear) onClear(event);
|
|
1443
1444
|
};
|
|
1444
|
-
return
|
|
1445
|
+
return React__default.createElement("button", {
|
|
1445
1446
|
type: "button",
|
|
1446
1447
|
onClick: onClear,
|
|
1447
1448
|
onKeyUp: handleKeyPress,
|
|
1448
1449
|
className: clearBtnClasses,
|
|
1449
1450
|
"data-testid": "text-input-clear-button",
|
|
1450
1451
|
"aria-label": "clear input"
|
|
1451
|
-
},
|
|
1452
|
+
}, React__default.createElement(Icon, {
|
|
1452
1453
|
name: "remove",
|
|
1453
1454
|
className: "display-block"
|
|
1454
1455
|
}));
|
|
@@ -1478,7 +1479,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1478
1479
|
'p-h-0': !suffix && !prefix
|
|
1479
1480
|
})
|
|
1480
1481
|
});
|
|
1481
|
-
return
|
|
1482
|
+
return React__default.createElement(FormControl, _extends({
|
|
1482
1483
|
helpText: helpText,
|
|
1483
1484
|
error: error,
|
|
1484
1485
|
label: label,
|
|
@@ -1488,17 +1489,17 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1488
1489
|
isRequired: isRequired,
|
|
1489
1490
|
requiredIndicator: requiredIndicator,
|
|
1490
1491
|
ref: ref
|
|
1491
|
-
}, restProps),
|
|
1492
|
+
}, restProps), React__default.createElement(Box, {
|
|
1492
1493
|
direction: "row",
|
|
1493
1494
|
overflow: "hidden",
|
|
1494
1495
|
className: inputWrapperClasses
|
|
1495
|
-
}, prefix &&
|
|
1496
|
+
}, prefix && React__default.createElement(Box, {
|
|
1496
1497
|
color: "secondary",
|
|
1497
1498
|
background: "secondary",
|
|
1498
1499
|
className: classNames(styles$k.prefix, 'ws-nowrap')
|
|
1499
|
-
}, prefix),
|
|
1500
|
+
}, prefix), React__default.createElement(Box, _extends({
|
|
1500
1501
|
as: "input"
|
|
1501
|
-
}, computedInputProps)), !!onClear && !!value && renderClearIcon(), suffix &&
|
|
1502
|
+
}, computedInputProps)), !!onClear && !!value && renderClearIcon(), suffix && React__default.createElement(Box, {
|
|
1502
1503
|
color: "secondary",
|
|
1503
1504
|
background: "secondary",
|
|
1504
1505
|
className: classNames(styles$k.suffix, 'ws-nowrap')
|
|
@@ -1668,28 +1669,28 @@ var Popover = function Popover(_ref) {
|
|
|
1668
1669
|
});
|
|
1669
1670
|
var renderPopperContent = function renderPopperContent() {
|
|
1670
1671
|
var renderPopperBox = function renderPopperBox() {
|
|
1671
|
-
return
|
|
1672
|
+
return React__default.createElement(Box, _extends({
|
|
1672
1673
|
ref: popperRef,
|
|
1673
1674
|
className: classNames(styles$j.popover, className),
|
|
1674
1675
|
style: popperStyles.popper,
|
|
1675
1676
|
role: "dialog",
|
|
1676
1677
|
"aria-label": "Popover",
|
|
1677
1678
|
"aria-hidden": !isOpen
|
|
1678
|
-
}, containerBoxProps, attributes.popper, restProps),
|
|
1679
|
+
}, containerBoxProps, attributes.popper, restProps), React__default.createElement("div", {
|
|
1679
1680
|
ref: setArrowElement,
|
|
1680
1681
|
style: popperStyles.arrow,
|
|
1681
1682
|
className: arrowClasses,
|
|
1682
1683
|
"data-popper-arrow": true
|
|
1683
1684
|
}), content);
|
|
1684
1685
|
};
|
|
1685
|
-
return trapFocus ?
|
|
1686
|
+
return trapFocus ? React__default.createElement(FocusTrap, {
|
|
1686
1687
|
active: isOpen,
|
|
1687
1688
|
focusTrapOptions: {
|
|
1688
1689
|
clickOutsideDeactivates: true
|
|
1689
1690
|
}
|
|
1690
1691
|
}, renderPopperBox()) : renderPopperBox();
|
|
1691
1692
|
};
|
|
1692
|
-
var childrenWithRef =
|
|
1693
|
+
var childrenWithRef = React__default.Children.map(children, function (child) {
|
|
1693
1694
|
var childProps = {
|
|
1694
1695
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1695
1696
|
ref: triggerRef,
|
|
@@ -1710,7 +1711,7 @@ var Popover = function Popover(_ref) {
|
|
|
1710
1711
|
}
|
|
1711
1712
|
return child;
|
|
1712
1713
|
});
|
|
1713
|
-
return
|
|
1714
|
+
return React__default.createElement(React__default.Fragment, null, childrenWithRef, isOpen && (
|
|
1714
1715
|
// portalTarget should always be defined if withPortal is true, but better safe than sorry here!
|
|
1715
1716
|
withPortal && portalTarget ? createPortal(renderPopperContent(), portalTarget) : renderPopperContent()));
|
|
1716
1717
|
};
|
|
@@ -1782,19 +1783,19 @@ var DateInput = function DateInput(_ref) {
|
|
|
1782
1783
|
handleTogglePopover(false);
|
|
1783
1784
|
};
|
|
1784
1785
|
var renderDatePicker = function renderDatePicker() {
|
|
1785
|
-
return
|
|
1786
|
+
return React__default.createElement(DatePicker, _extends({}, mergedDatePickerProps, {
|
|
1786
1787
|
onChange: handleDatePickerChange,
|
|
1787
1788
|
selected: mergedDatePickerProps.selected,
|
|
1788
1789
|
selectsRange: mergedDatePickerProps.selectsRange
|
|
1789
1790
|
}));
|
|
1790
1791
|
};
|
|
1791
|
-
return
|
|
1792
|
+
return React__default.createElement(Popover, _extends({}, mergedPopoverProps, {
|
|
1792
1793
|
isOpen: isPopoverOpen,
|
|
1793
1794
|
content: renderDatePicker(),
|
|
1794
1795
|
withPortal: true,
|
|
1795
1796
|
portalTarget: document.body,
|
|
1796
1797
|
onClickOutside: handleOnClickOutside
|
|
1797
|
-
}),
|
|
1798
|
+
}), React__default.createElement(TextInput, _extends({}, mergedTextInputProps, {
|
|
1798
1799
|
id: mergedTextInputProps.id,
|
|
1799
1800
|
name: mergedTextInputProps.name,
|
|
1800
1801
|
label: mergedTextInputProps.label,
|
|
@@ -1844,7 +1845,7 @@ var DetailsSummary = function DetailsSummary(_ref) {
|
|
|
1844
1845
|
restProps.onKeyDown(event);
|
|
1845
1846
|
}
|
|
1846
1847
|
};
|
|
1847
|
-
return
|
|
1848
|
+
return React__default.createElement(Box, _extends({}, restProps, {
|
|
1848
1849
|
as: "summary",
|
|
1849
1850
|
display: display,
|
|
1850
1851
|
role: "button",
|
|
@@ -1858,7 +1859,7 @@ var DetailsSummary = function DetailsSummary(_ref) {
|
|
|
1858
1859
|
var styles$i = {"details-reset":"Details-module_details-reset__HWtSD"};
|
|
1859
1860
|
|
|
1860
1861
|
var _excluded$p = ["children", "className", "display", "isOpen"];
|
|
1861
|
-
var DetailsBaseComponent = /*#__PURE__*/
|
|
1862
|
+
var DetailsBaseComponent = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
1862
1863
|
var children = _ref.children,
|
|
1863
1864
|
className = _ref.className,
|
|
1864
1865
|
_ref$display = _ref.display,
|
|
@@ -1866,7 +1867,7 @@ var DetailsBaseComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1866
1867
|
isOpen = _ref.isOpen,
|
|
1867
1868
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$p);
|
|
1868
1869
|
var detailsClasses = classNames(className, styles$i['details-reset'], styles$i.details);
|
|
1869
|
-
return
|
|
1870
|
+
return React__default.createElement(Box, _extends({
|
|
1870
1871
|
as: "details",
|
|
1871
1872
|
className: detailsClasses,
|
|
1872
1873
|
display: display,
|
|
@@ -1932,11 +1933,11 @@ var Drawer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1932
1933
|
var contentClassnames = classNames(styles$h['drawer-content'], styles$h[placement], (_classNames2 = {}, _classNames2[styles$h['hide-overlay']] = hideOverlay, _classNames2['overflow-auto'] = !closeButton && !title, _classNames2.className = className, _classNames2));
|
|
1933
1934
|
var renderHeader = function renderHeader() {
|
|
1934
1935
|
if (closeButton && onDismiss && !title) {
|
|
1935
|
-
return
|
|
1936
|
+
return React__default.createElement(Box, {
|
|
1936
1937
|
alignItems: "flex-end",
|
|
1937
1938
|
justifyContent: "center",
|
|
1938
1939
|
padding: "md lg"
|
|
1939
|
-
},
|
|
1940
|
+
}, React__default.createElement(Button, {
|
|
1940
1941
|
variant: "tertiary",
|
|
1941
1942
|
onClick: onDismiss,
|
|
1942
1943
|
"aria-label": "close",
|
|
@@ -1945,7 +1946,7 @@ var Drawer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1945
1946
|
}));
|
|
1946
1947
|
}
|
|
1947
1948
|
if (title) {
|
|
1948
|
-
return
|
|
1949
|
+
return React__default.createElement(Box, {
|
|
1949
1950
|
direction: "row",
|
|
1950
1951
|
justifyContent: "space-between",
|
|
1951
1952
|
alignItems: "center",
|
|
@@ -1953,10 +1954,10 @@ var Drawer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1953
1954
|
base: '2xl',
|
|
1954
1955
|
tablet: '4xl'
|
|
1955
1956
|
}
|
|
1956
|
-
},
|
|
1957
|
+
}, React__default.createElement(Box, {
|
|
1957
1958
|
className: styles$h.title,
|
|
1958
1959
|
fontWeight: "bold"
|
|
1959
|
-
}, title), onDismiss &&
|
|
1960
|
+
}, title), onDismiss && React__default.createElement(Button, {
|
|
1960
1961
|
variant: "tertiary",
|
|
1961
1962
|
onClick: onDismiss,
|
|
1962
1963
|
"aria-label": "close",
|
|
@@ -1966,24 +1967,24 @@ var Drawer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1966
1967
|
}
|
|
1967
1968
|
return null;
|
|
1968
1969
|
};
|
|
1969
|
-
var content = title || closeButton ?
|
|
1970
|
+
var content = title || closeButton ? React__default.createElement(Box, {
|
|
1970
1971
|
flex: "auto",
|
|
1971
1972
|
overflow: "auto"
|
|
1972
1973
|
}, children) : children;
|
|
1973
1974
|
var parentElement = containerRef != null && containerRef.current ? containerRef.current : document.body;
|
|
1974
1975
|
var isDisabledFocusLock = hideOverlay || dangerouslyBypassFocusLock;
|
|
1975
1976
|
var isDisabledRemoveScroll = hideOverlay || dangerouslyBypassScrollLock;
|
|
1976
|
-
return
|
|
1977
|
+
return React__default.createElement(FocusLock, {
|
|
1977
1978
|
autoFocus: true,
|
|
1978
1979
|
returnFocus: true,
|
|
1979
1980
|
disabled: isDisabledFocusLock || !isOpen,
|
|
1980
1981
|
onActivation: activateFocusLock
|
|
1981
|
-
},
|
|
1982
|
+
}, React__default.createElement(RemoveScroll, {
|
|
1982
1983
|
allowPinchZoom: allowPinchZoom,
|
|
1983
1984
|
enabled: !isDisabledRemoveScroll && isOpen
|
|
1984
|
-
},
|
|
1985
|
+
}, React__default.createElement(Box, {
|
|
1985
1986
|
ref: ref
|
|
1986
|
-
},
|
|
1987
|
+
}, React__default.createElement(ReactModal, {
|
|
1987
1988
|
isOpen: isOpen,
|
|
1988
1989
|
overlayClassName: overlayClassnames,
|
|
1989
1990
|
className: contentClassnames,
|
|
@@ -1996,7 +1997,7 @@ var Drawer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1996
1997
|
parentSelector: function parentSelector() {
|
|
1997
1998
|
return parentElement;
|
|
1998
1999
|
}
|
|
1999
|
-
},
|
|
2000
|
+
}, React__default.createElement(Box, {
|
|
2000
2001
|
"aria-label": ariaLabel,
|
|
2001
2002
|
"aria-labelledby": ariaLabelledBy,
|
|
2002
2003
|
height: "100%"
|
|
@@ -2017,7 +2018,7 @@ var FormikCheckboxInput = function FormikCheckboxInput(_ref) {
|
|
|
2017
2018
|
id = _ref.id,
|
|
2018
2019
|
label = _ref.label,
|
|
2019
2020
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$o);
|
|
2020
|
-
return
|
|
2021
|
+
return React__default.createElement(CheckboxInput, _extends({}, props, {
|
|
2021
2022
|
id: id,
|
|
2022
2023
|
label: label,
|
|
2023
2024
|
error: getIn(touched, name) && getIn(errors, name),
|
|
@@ -2051,9 +2052,9 @@ var RadioInputIcon = function RadioInputIcon(_ref) {
|
|
|
2051
2052
|
}
|
|
2052
2053
|
if (error) color = 'danger';
|
|
2053
2054
|
if (isDisabled && error) color = 'danger-disabled';
|
|
2054
|
-
return
|
|
2055
|
+
return React__default.createElement(Box, _extends({
|
|
2055
2056
|
className: className
|
|
2056
|
-
}, restProps),
|
|
2057
|
+
}, restProps), React__default.createElement(Icon, {
|
|
2057
2058
|
color: color,
|
|
2058
2059
|
name: name
|
|
2059
2060
|
}));
|
|
@@ -2061,7 +2062,7 @@ var RadioInputIcon = function RadioInputIcon(_ref) {
|
|
|
2061
2062
|
|
|
2062
2063
|
var styles$g = {"size-sm":"RadioInput-module_size-sm__6DLmn","size-md":"RadioInput-module_size-md__wiJ4R","size-lg":"RadioInput-module_size-lg__pX8S8","radio-container":"RadioInput-module_radio-container__EBRgV","hidden":"RadioInput-module_hidden__KF4as","size-sm-tablet":"RadioInput-module_size-sm-tablet__x7edi","size-md-tablet":"RadioInput-module_size-md-tablet__T-HTa","size-lg-tablet":"RadioInput-module_size-lg-tablet__0Hkim","size-sm-desktop":"RadioInput-module_size-sm-desktop__HjeWG","size-md-desktop":"RadioInput-module_size-md-desktop__3Y1fn","size-lg-desktop":"RadioInput-module_size-lg-desktop__z3nKW","size-sm-hd":"RadioInput-module_size-sm-hd__oxAR7","size-md-hd":"RadioInput-module_size-md-hd__ws7ro","size-lg-hd":"RadioInput-module_size-lg-hd__87uii"};
|
|
2063
2064
|
|
|
2064
|
-
var RadioInput = /*#__PURE__*/
|
|
2065
|
+
var RadioInput = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
2065
2066
|
var _classNames;
|
|
2066
2067
|
var name = _ref.name,
|
|
2067
2068
|
onChange = _ref.onChange,
|
|
@@ -2093,14 +2094,14 @@ var RadioInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2093
2094
|
justifyContent: 'center'
|
|
2094
2095
|
};
|
|
2095
2096
|
var containerClasses = classNames('hyphen-components__variables__form-control', className, styles$g['radio-container'], responsiveClasses, (_classNames = {}, _classNames[styles$g.hidden] = isHidden, _classNames));
|
|
2096
|
-
return
|
|
2097
|
+
return React__default.createElement(React__default.Fragment, null, option && React__default.createElement(Box, {
|
|
2097
2098
|
className: containerClasses,
|
|
2098
2099
|
key: option.id,
|
|
2099
2100
|
direction: "row",
|
|
2100
2101
|
alignItems: "center",
|
|
2101
2102
|
ref: ref,
|
|
2102
2103
|
position: "relative"
|
|
2103
|
-
},
|
|
2104
|
+
}, React__default.createElement(Box, {
|
|
2104
2105
|
"aria-required": isRequired,
|
|
2105
2106
|
as: "input",
|
|
2106
2107
|
id: option.id,
|
|
@@ -2118,14 +2119,14 @@ var RadioInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2118
2119
|
opacity: '0'
|
|
2119
2120
|
},
|
|
2120
2121
|
margin: isHidden ? '0' : '0 xs 0 2xs'
|
|
2121
|
-
}), !isHidden &&
|
|
2122
|
+
}), !isHidden && React__default.createElement(RadioInputIcon, {
|
|
2122
2123
|
isSelected: isSelected,
|
|
2123
2124
|
isDisabled: isDisabled,
|
|
2124
2125
|
margin: isHidden ? '0' : '0 xs 0 2xs',
|
|
2125
2126
|
className: responsiveClasses,
|
|
2126
2127
|
background: isDisabled && !isSelected ? 'secondary' : 'primary',
|
|
2127
2128
|
radius: "circle"
|
|
2128
|
-
}), option.label &&
|
|
2129
|
+
}), option.label && React__default.createElement(FormLabel, _extends({}, labelProps), option.label)));
|
|
2129
2130
|
});
|
|
2130
2131
|
|
|
2131
2132
|
var styles$f = {"radio-group":"RadioGroup-module_radio-group__FWPcT","fieldset":"RadioGroup-module_fieldset__PEUXI","legend":"RadioGroup-module_legend__tcfV7","description":"RadioGroup-module_description__8fzM-"};
|
|
@@ -2162,20 +2163,20 @@ var RadioGroup = function RadioGroup(_ref) {
|
|
|
2162
2163
|
value = _ref$value === void 0 ? undefined : _ref$value,
|
|
2163
2164
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$m);
|
|
2164
2165
|
var groupClasses = classNames('hyphen-components__variables__form-control', className, (_classNames = {}, _classNames[styles$f.loading] = error, _classNames));
|
|
2165
|
-
return
|
|
2166
|
+
return React__default.createElement("div", _extends({
|
|
2166
2167
|
className: classNames(styles$f['radio-group'], groupClasses)
|
|
2167
|
-
}, restProps),
|
|
2168
|
+
}, restProps), React__default.createElement("fieldset", {
|
|
2168
2169
|
className: styles$f.fieldset
|
|
2169
|
-
}, (title || description) &&
|
|
2170
|
+
}, (title || description) && React__default.createElement("legend", {
|
|
2170
2171
|
className: styles$f.legend
|
|
2171
|
-
}, title, isRequired &&
|
|
2172
|
+
}, title, isRequired && React__default.createElement("span", null, requiredIndicator), description && React__default.createElement("div", {
|
|
2172
2173
|
className: styles$f.description
|
|
2173
|
-
}, description)),
|
|
2174
|
+
}, description)), React__default.createElement(Box, {
|
|
2174
2175
|
direction: direction,
|
|
2175
2176
|
gap: "sm",
|
|
2176
2177
|
className: styles$f.options
|
|
2177
2178
|
}, options && options.map(function (option) {
|
|
2178
|
-
return
|
|
2179
|
+
return React__default.createElement(RadioInput, {
|
|
2179
2180
|
key: option.id,
|
|
2180
2181
|
name: name,
|
|
2181
2182
|
onChange: onChange,
|
|
@@ -2187,7 +2188,7 @@ var RadioGroup = function RadioGroup(_ref) {
|
|
|
2187
2188
|
onFocus: onFocus,
|
|
2188
2189
|
size: size
|
|
2189
2190
|
});
|
|
2190
|
-
}))), error && typeof error !== 'boolean' &&
|
|
2191
|
+
}))), error && typeof error !== 'boolean' && React__default.createElement(InputValidationMessage, null, error));
|
|
2191
2192
|
};
|
|
2192
2193
|
|
|
2193
2194
|
var _excluded$l = ["field", "form", "onChange", "options"];
|
|
@@ -2203,7 +2204,7 @@ var FormikRadioGroup = function FormikRadioGroup(_ref) {
|
|
|
2203
2204
|
onChange = _ref.onChange,
|
|
2204
2205
|
options = _ref.options,
|
|
2205
2206
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$l);
|
|
2206
|
-
return
|
|
2207
|
+
return React__default.createElement(RadioGroup, _extends({}, props, {
|
|
2207
2208
|
options: options,
|
|
2208
2209
|
name: name,
|
|
2209
2210
|
onBlur: onBlur,
|
|
@@ -2288,7 +2289,7 @@ function SelectInput(props) {
|
|
|
2288
2289
|
requiredIndicator: requiredIndicator
|
|
2289
2290
|
};
|
|
2290
2291
|
var ClearIndicator = function ClearIndicator(props) {
|
|
2291
|
-
return
|
|
2292
|
+
return React__default.createElement(components.ClearIndicator, _extends({}, props), React__default.createElement(Icon, {
|
|
2292
2293
|
name: "remove"
|
|
2293
2294
|
}));
|
|
2294
2295
|
};
|
|
@@ -2298,10 +2299,10 @@ function SelectInput(props) {
|
|
|
2298
2299
|
} : {
|
|
2299
2300
|
options: options
|
|
2300
2301
|
};
|
|
2301
|
-
return
|
|
2302
|
+
return React__default.createElement(Box, {
|
|
2302
2303
|
width: "100%",
|
|
2303
2304
|
className: wrapperClasses
|
|
2304
|
-
}, label && !hideLabel &&
|
|
2305
|
+
}, label && !hideLabel && React__default.createElement(FormLabel, _extends({}, labelProps), label), React__default.createElement(Component, _extends({}, restProps, selectOptions, {
|
|
2305
2306
|
inputId: id,
|
|
2306
2307
|
"aria-label": label,
|
|
2307
2308
|
components: {
|
|
@@ -2328,7 +2329,7 @@ function SelectInput(props) {
|
|
|
2328
2329
|
}
|
|
2329
2330
|
},
|
|
2330
2331
|
value: value
|
|
2331
|
-
})), error && typeof error !== 'boolean' &&
|
|
2332
|
+
})), error && typeof error !== 'boolean' && React__default.createElement(InputValidationMessage, null, error));
|
|
2332
2333
|
}
|
|
2333
2334
|
|
|
2334
2335
|
var _excluded$j = ["field", "form", "onChange", "id", "label", "options", "error"];
|
|
@@ -2357,7 +2358,7 @@ var FormikSelectInput = function FormikSelectInput(_ref) {
|
|
|
2357
2358
|
return err == null ? void 0 : err.label;
|
|
2358
2359
|
})) == null ? void 0 : _error$find.label;
|
|
2359
2360
|
}
|
|
2360
|
-
return
|
|
2361
|
+
return React__default.createElement(SelectInput, _extends({
|
|
2361
2362
|
id: id,
|
|
2362
2363
|
label: label,
|
|
2363
2364
|
options: options,
|
|
@@ -2419,14 +2420,14 @@ var SelectInputInset = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
2419
2420
|
var handleKeyPress = function handleKeyPress(event) {
|
|
2420
2421
|
if (event.keyCode === 13 && onClear) onClear(event);
|
|
2421
2422
|
};
|
|
2422
|
-
return
|
|
2423
|
+
return React__default.createElement("button", {
|
|
2423
2424
|
type: "button",
|
|
2424
2425
|
onClick: onClear,
|
|
2425
2426
|
onKeyUp: handleKeyPress,
|
|
2426
2427
|
className: clearBtnClasses,
|
|
2427
2428
|
"data-testid": "text-input-clear-button",
|
|
2428
2429
|
"aria-label": "clear input"
|
|
2429
|
-
},
|
|
2430
|
+
}, React__default.createElement(Icon, {
|
|
2430
2431
|
name: "remove",
|
|
2431
2432
|
className: "display-block"
|
|
2432
2433
|
}));
|
|
@@ -2449,17 +2450,17 @@ var SelectInputInset = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
2449
2450
|
value: value != null ? value : '',
|
|
2450
2451
|
className: classNames(inputProps.className)
|
|
2451
2452
|
});
|
|
2452
|
-
return
|
|
2453
|
+
return React__default.createElement("div", {
|
|
2453
2454
|
ref: ref
|
|
2454
|
-
},
|
|
2455
|
+
}, React__default.createElement(Box, {
|
|
2455
2456
|
direction: "row",
|
|
2456
2457
|
flex: "auto",
|
|
2457
2458
|
position: "relative",
|
|
2458
2459
|
className: inputWrapperClasses
|
|
2459
|
-
},
|
|
2460
|
+
}, React__default.createElement(Box, _extends({
|
|
2460
2461
|
as: "select"
|
|
2461
2462
|
}, computedInputProps), optionsWithPlaceholder.map(function (option) {
|
|
2462
|
-
return
|
|
2463
|
+
return React__default.createElement(Box, {
|
|
2463
2464
|
as: "option",
|
|
2464
2465
|
key: option.value,
|
|
2465
2466
|
value: option.value,
|
|
@@ -2467,11 +2468,11 @@ var SelectInputInset = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
2467
2468
|
hidden: option.value === '',
|
|
2468
2469
|
color: option.value === '' ? 'secondary' : 'base'
|
|
2469
2470
|
}, option.label);
|
|
2470
|
-
})), !!onClear && !!value && renderClearIcon(),
|
|
2471
|
+
})), !!onClear && !!value && renderClearIcon(), React__default.createElement("label", {
|
|
2471
2472
|
htmlFor: id,
|
|
2472
2473
|
className: styles$d['select-input-label'],
|
|
2473
2474
|
id: id + "Label"
|
|
2474
|
-
}, label, isRequired && requiredIndicator &&
|
|
2475
|
+
}, label, isRequired && requiredIndicator && React__default.createElement("span", null, requiredIndicator))), helpText && React__default.createElement(HelpText, null, helpText), error && error !== true && React__default.createElement(InputValidationMessage, null, error));
|
|
2475
2476
|
});
|
|
2476
2477
|
|
|
2477
2478
|
var _excluded$i = ["field", "form", "onChange", "id", "label", "options"];
|
|
@@ -2489,7 +2490,7 @@ var FormikSelectInputInset = function FormikSelectInputInset(_ref) {
|
|
|
2489
2490
|
label = _ref.label,
|
|
2490
2491
|
options = _ref.options,
|
|
2491
2492
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$i);
|
|
2492
|
-
return
|
|
2493
|
+
return React__default.createElement(SelectInputInset, _extends({}, props, {
|
|
2493
2494
|
id: id,
|
|
2494
2495
|
label: label,
|
|
2495
2496
|
options: options,
|
|
@@ -2569,21 +2570,21 @@ var TextareaInputInset = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
2569
2570
|
type: type,
|
|
2570
2571
|
value: value
|
|
2571
2572
|
});
|
|
2572
|
-
return
|
|
2573
|
+
return React__default.createElement(Box, {
|
|
2573
2574
|
width: "100",
|
|
2574
2575
|
ref: ref,
|
|
2575
2576
|
className: className
|
|
2576
|
-
},
|
|
2577
|
+
}, React__default.createElement(Box, {
|
|
2577
2578
|
display: "block",
|
|
2578
2579
|
position: "relative",
|
|
2579
2580
|
className: inputWrapperClasses
|
|
2580
|
-
},
|
|
2581
|
+
}, React__default.createElement(Box, _extends({
|
|
2581
2582
|
as: "textarea"
|
|
2582
|
-
}, computedInputProps)),
|
|
2583
|
+
}, computedInputProps)), React__default.createElement("label", {
|
|
2583
2584
|
htmlFor: id,
|
|
2584
2585
|
className: styles$c['text-input-label'],
|
|
2585
2586
|
id: id + "Label"
|
|
2586
|
-
}, label, isRequired && requiredIndicator &&
|
|
2587
|
+
}, label, isRequired && requiredIndicator && React__default.createElement("span", null, requiredIndicator))), helpText && React__default.createElement(HelpText, null, helpText), error && error !== true && React__default.createElement(InputValidationMessage, null, error));
|
|
2587
2588
|
});
|
|
2588
2589
|
|
|
2589
2590
|
var _excluded$h = ["field", "form", "onChange", "id", "label"];
|
|
@@ -2600,7 +2601,7 @@ var FormikTextareaInputInset = function FormikTextareaInputInset(_ref) {
|
|
|
2600
2601
|
id = _ref.id,
|
|
2601
2602
|
label = _ref.label,
|
|
2602
2603
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$h);
|
|
2603
|
-
return
|
|
2604
|
+
return React__default.createElement(TextareaInputInset, _extends({}, props, {
|
|
2604
2605
|
id: id,
|
|
2605
2606
|
label: label,
|
|
2606
2607
|
name: name,
|
|
@@ -2663,14 +2664,14 @@ var TextInputInset = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
2663
2664
|
var handleKeyPress = function handleKeyPress(event) {
|
|
2664
2665
|
if (event.keyCode === 13 && onClear) onClear(event);
|
|
2665
2666
|
};
|
|
2666
|
-
return
|
|
2667
|
+
return React__default.createElement("button", {
|
|
2667
2668
|
type: "button",
|
|
2668
2669
|
onClick: onClear,
|
|
2669
2670
|
onKeyUp: handleKeyPress,
|
|
2670
2671
|
className: clearBtnClasses,
|
|
2671
2672
|
"data-testid": "text-input-clear-button",
|
|
2672
2673
|
"aria-label": "clear input"
|
|
2673
|
-
},
|
|
2674
|
+
}, React__default.createElement(Icon, {
|
|
2674
2675
|
name: "remove",
|
|
2675
2676
|
className: "display-block"
|
|
2676
2677
|
}));
|
|
@@ -2696,34 +2697,34 @@ var TextInputInset = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
2696
2697
|
value: value,
|
|
2697
2698
|
className: classNames(inputProps.className)
|
|
2698
2699
|
});
|
|
2699
|
-
return
|
|
2700
|
+
return React__default.createElement(Box, {
|
|
2700
2701
|
width: "100",
|
|
2701
2702
|
ref: ref
|
|
2702
|
-
},
|
|
2703
|
+
}, React__default.createElement(Box, {
|
|
2703
2704
|
direction: "row",
|
|
2704
2705
|
className: inputWrapperClasses
|
|
2705
|
-
}, prefix &&
|
|
2706
|
+
}, prefix && React__default.createElement(Box, {
|
|
2706
2707
|
color: "base",
|
|
2707
2708
|
alignItems: "center",
|
|
2708
2709
|
justifyContent: "center",
|
|
2709
2710
|
background: "secondary",
|
|
2710
2711
|
className: classNames(styles$b.prefix, 'ws-nowrap')
|
|
2711
|
-
}, prefix),
|
|
2712
|
+
}, prefix), React__default.createElement(Box, {
|
|
2712
2713
|
direction: "row",
|
|
2713
2714
|
position: "relative",
|
|
2714
2715
|
className: "label-input-wrapper",
|
|
2715
2716
|
flex: "auto"
|
|
2716
|
-
},
|
|
2717
|
+
}, React__default.createElement(Box, _extends({
|
|
2717
2718
|
as: "input"
|
|
2718
|
-
}, computedInputProps)), !!onClear && !!value && renderClearIcon(),
|
|
2719
|
+
}, computedInputProps)), !!onClear && !!value && renderClearIcon(), React__default.createElement("label", {
|
|
2719
2720
|
htmlFor: id,
|
|
2720
2721
|
className: styles$b['text-input-label'],
|
|
2721
2722
|
id: id + "Label"
|
|
2722
|
-
}, label, isRequired && requiredIndicator &&
|
|
2723
|
+
}, label, isRequired && requiredIndicator && React__default.createElement("span", null, requiredIndicator))), suffix && React__default.createElement(Box, {
|
|
2723
2724
|
color: "base",
|
|
2724
2725
|
background: "secondary",
|
|
2725
2726
|
className: classNames(styles$b.suffix, 'ws-nowrap')
|
|
2726
|
-
}, suffix)), helpText &&
|
|
2727
|
+
}, suffix)), helpText && React__default.createElement(HelpText, null, helpText), error && error !== true && React__default.createElement(InputValidationMessage, null, error));
|
|
2727
2728
|
});
|
|
2728
2729
|
|
|
2729
2730
|
var _excluded$g = ["field", "form", "onChange", "id", "label"];
|
|
@@ -2740,7 +2741,7 @@ var FormikTextInputInset = function FormikTextInputInset(_ref) {
|
|
|
2740
2741
|
id = _ref.id,
|
|
2741
2742
|
label = _ref.label,
|
|
2742
2743
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$g);
|
|
2743
|
-
return
|
|
2744
|
+
return React__default.createElement(TextInputInset, _extends({}, props, {
|
|
2744
2745
|
id: id,
|
|
2745
2746
|
label: label,
|
|
2746
2747
|
name: name,
|
|
@@ -2785,7 +2786,7 @@ var SelectInputNative = function SelectInputNative(_ref) {
|
|
|
2785
2786
|
var selectWrapperClasses = classNames.apply(void 0, ['hyphen-components__variables__form-control', styles$a['select-input-native-wrapper']].concat(responsiveClasses.map(function (className) {
|
|
2786
2787
|
return styles$a[className];
|
|
2787
2788
|
}), [(_ref2 = {}, _ref2[styles$a.disabled] = isDisabled, _ref2[styles$a.error] = error, _ref2)]));
|
|
2788
|
-
return
|
|
2789
|
+
return React__default.createElement(FormControl, _extends({
|
|
2789
2790
|
label: label,
|
|
2790
2791
|
hideLabel: hideLabel,
|
|
2791
2792
|
id: id,
|
|
@@ -2794,9 +2795,9 @@ var SelectInputNative = function SelectInputNative(_ref) {
|
|
|
2794
2795
|
isDisabled: isDisabled,
|
|
2795
2796
|
isRequired: isRequired,
|
|
2796
2797
|
requiredIndicator: requiredIndicator
|
|
2797
|
-
}, restProps),
|
|
2798
|
+
}, restProps), React__default.createElement(Box, {
|
|
2798
2799
|
className: selectWrapperClasses
|
|
2799
|
-
},
|
|
2800
|
+
}, React__default.createElement(Box, {
|
|
2800
2801
|
as: "select",
|
|
2801
2802
|
"aria-label": label,
|
|
2802
2803
|
"aria-labelledby": label && !hideLabel ? id + "Label" : undefined,
|
|
@@ -2810,7 +2811,7 @@ var SelectInputNative = function SelectInputNative(_ref) {
|
|
|
2810
2811
|
id: id,
|
|
2811
2812
|
required: isRequired
|
|
2812
2813
|
}, optionsWithPlaceholder.map(function (option) {
|
|
2813
|
-
return
|
|
2814
|
+
return React__default.createElement(Box, {
|
|
2814
2815
|
as: "option",
|
|
2815
2816
|
key: option.value,
|
|
2816
2817
|
value: option.value,
|
|
@@ -2836,7 +2837,7 @@ var FormikSelectInputNative = function FormikSelectInputNative(_ref) {
|
|
|
2836
2837
|
id = _ref.id,
|
|
2837
2838
|
label = _ref.label,
|
|
2838
2839
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
|
2839
|
-
return
|
|
2840
|
+
return React__default.createElement(SelectInputNative, _extends({}, props, {
|
|
2840
2841
|
options: options,
|
|
2841
2842
|
id: id,
|
|
2842
2843
|
label: label,
|
|
@@ -2862,7 +2863,7 @@ var FormikTextInput = function FormikTextInput(_ref) {
|
|
|
2862
2863
|
id = _ref.id,
|
|
2863
2864
|
label = _ref.label,
|
|
2864
2865
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$d);
|
|
2865
|
-
return
|
|
2866
|
+
return React__default.createElement(TextInput, _extends({}, props, {
|
|
2866
2867
|
id: id,
|
|
2867
2868
|
label: label,
|
|
2868
2869
|
name: name,
|
|
@@ -2948,15 +2949,15 @@ var TextareaInput = function TextareaInput(_ref) {
|
|
|
2948
2949
|
isFieldRequired: isRequired,
|
|
2949
2950
|
requiredIndicator: requiredIndicator
|
|
2950
2951
|
};
|
|
2951
|
-
return
|
|
2952
|
+
return React__default.createElement(Box, _extends({
|
|
2952
2953
|
width: "100%",
|
|
2953
2954
|
className: className
|
|
2954
|
-
}, restProps), label && !hideLabel &&
|
|
2955
|
+
}, restProps), label && !hideLabel && React__default.createElement(FormLabel, _extends({}, labelProps), label), React__default.createElement(Box, {
|
|
2955
2956
|
display: "block",
|
|
2956
2957
|
className: inputWrapperClasses
|
|
2957
|
-
},
|
|
2958
|
+
}, React__default.createElement(Box, _extends({
|
|
2958
2959
|
as: "textarea"
|
|
2959
|
-
}, inputProps))), error && error !== true &&
|
|
2960
|
+
}, inputProps))), error && error !== true && React__default.createElement(InputValidationMessage, null, error));
|
|
2960
2961
|
};
|
|
2961
2962
|
|
|
2962
2963
|
var _excluded$b = ["field", "form", "onChange", "id", "label"];
|
|
@@ -2973,7 +2974,7 @@ var FormikTextareaInput = function FormikTextareaInput(_ref) {
|
|
|
2973
2974
|
id = _ref.id,
|
|
2974
2975
|
label = _ref.label,
|
|
2975
2976
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
|
2976
|
-
return
|
|
2977
|
+
return React__default.createElement(TextareaInput, _extends({}, props, {
|
|
2977
2978
|
id: id,
|
|
2978
2979
|
label: label,
|
|
2979
2980
|
name: name,
|
|
@@ -3023,7 +3024,7 @@ var TimePicker = function TimePicker(_ref) {
|
|
|
3023
3024
|
}
|
|
3024
3025
|
return timeOptions;
|
|
3025
3026
|
};
|
|
3026
|
-
return
|
|
3027
|
+
return React__default.createElement(SelectInput, _extends({}, restProps, {
|
|
3027
3028
|
id: id,
|
|
3028
3029
|
name: name,
|
|
3029
3030
|
label: label,
|
|
@@ -3047,7 +3048,7 @@ var FormikTimePicker = function FormikTimePicker(_ref) {
|
|
|
3047
3048
|
options = _ref.options,
|
|
3048
3049
|
onChange = _ref.onChange,
|
|
3049
3050
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$9);
|
|
3050
|
-
return
|
|
3051
|
+
return React__default.createElement(TimePicker, _extends({}, props, {
|
|
3051
3052
|
name: name,
|
|
3052
3053
|
onBlur: onBlur,
|
|
3053
3054
|
onChange: onChange != null ? onChange : formikOnChange,
|
|
@@ -3097,7 +3098,7 @@ var TimePickerNative = function TimePickerNative(_ref) {
|
|
|
3097
3098
|
return timeOptions;
|
|
3098
3099
|
};
|
|
3099
3100
|
var options = generateTimes();
|
|
3100
|
-
return
|
|
3101
|
+
return React__default.createElement(SelectInputNative, _extends({}, restProps, {
|
|
3101
3102
|
id: id,
|
|
3102
3103
|
name: name,
|
|
3103
3104
|
label: label,
|
|
@@ -3120,7 +3121,7 @@ var FormikTimePickerNative = function FormikTimePickerNative(_ref) {
|
|
|
3120
3121
|
errors = _ref$form.errors,
|
|
3121
3122
|
onChange = _ref.onChange,
|
|
3122
3123
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
3123
|
-
return
|
|
3124
|
+
return React__default.createElement(TimePickerNative, _extends({}, props, {
|
|
3124
3125
|
name: name,
|
|
3125
3126
|
onBlur: onBlur,
|
|
3126
3127
|
onChange: onChange != null ? onChange : formikOnChange,
|
|
@@ -3197,27 +3198,27 @@ var Toggle = function Toggle(_ref) {
|
|
|
3197
3198
|
isFieldRequired: isRequired,
|
|
3198
3199
|
requiredIndicator: requiredIndicator
|
|
3199
3200
|
};
|
|
3200
|
-
return
|
|
3201
|
+
return React__default.createElement(Box, {
|
|
3201
3202
|
className: className
|
|
3202
|
-
},
|
|
3203
|
+
}, React__default.createElement(Box, {
|
|
3203
3204
|
className: wrapperClasses
|
|
3204
|
-
},
|
|
3205
|
+
}, React__default.createElement(FormLabel, _extends({}, labelProps), React__default.createElement("input", _extends({}, inputProps)), React__default.createElement("span", {
|
|
3205
3206
|
"aria-hidden": "true",
|
|
3206
3207
|
className: trackClasses,
|
|
3207
3208
|
"data-testid": "toggleTrack"
|
|
3208
|
-
},
|
|
3209
|
+
}, React__default.createElement("span", {
|
|
3209
3210
|
className: thumbClasses,
|
|
3210
3211
|
"data-testid": "toggleThumb"
|
|
3211
|
-
})), !hideLabel &&
|
|
3212
|
+
})), !hideLabel && React__default.createElement(Box, {
|
|
3212
3213
|
gap: "2xs",
|
|
3213
3214
|
className: helpText && (size === 'md' || size === 'lg') ? 'm-top-2xs' : ''
|
|
3214
|
-
}, label &&
|
|
3215
|
+
}, label && React__default.createElement("div", null, label), helpText && React__default.createElement(Box, {
|
|
3215
3216
|
as: "p",
|
|
3216
3217
|
display: "block",
|
|
3217
3218
|
fontSize: "sm",
|
|
3218
3219
|
fontWeight: "normal",
|
|
3219
3220
|
color: "secondary"
|
|
3220
|
-
}, helpText)))), error && error !== true &&
|
|
3221
|
+
}, helpText)))), error && error !== true && React__default.createElement(InputValidationMessage, null, error));
|
|
3221
3222
|
};
|
|
3222
3223
|
|
|
3223
3224
|
var _excluded$6 = ["field", "form"];
|
|
@@ -3231,7 +3232,7 @@ var FormikToggle = function FormikToggle(_ref) {
|
|
|
3231
3232
|
touched = _ref$form.touched,
|
|
3232
3233
|
errors = _ref$form.errors,
|
|
3233
3234
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
3234
|
-
return
|
|
3235
|
+
return React__default.createElement(Toggle, _extends({
|
|
3235
3236
|
error: getIn(touched, name) && getIn(errors, name),
|
|
3236
3237
|
isChecked: value,
|
|
3237
3238
|
onBlur: onBlur,
|
|
@@ -3253,7 +3254,7 @@ var ModalFooter = function ModalFooter(_ref) {
|
|
|
3253
3254
|
gap = _ref$gap === void 0 ? 'md' : _ref$gap,
|
|
3254
3255
|
style = _ref.style,
|
|
3255
3256
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
3256
|
-
return
|
|
3257
|
+
return React__default.createElement(Box, _extends({
|
|
3257
3258
|
padding: padding,
|
|
3258
3259
|
direction: direction,
|
|
3259
3260
|
alignItems: alignItems,
|
|
@@ -3271,7 +3272,7 @@ var ModalHeader = function ModalHeader(_ref) {
|
|
|
3271
3272
|
_ref$title = _ref.title,
|
|
3272
3273
|
title = _ref$title === void 0 ? undefined : _ref$title;
|
|
3273
3274
|
var justifyContentValue = title === undefined && onDismiss ? 'flex-end' : 'space-between';
|
|
3274
|
-
return
|
|
3275
|
+
return React__default.createElement(Box, {
|
|
3275
3276
|
direction: "row",
|
|
3276
3277
|
alignItems: "center",
|
|
3277
3278
|
justifyContent: justifyContentValue,
|
|
@@ -3279,14 +3280,14 @@ var ModalHeader = function ModalHeader(_ref) {
|
|
|
3279
3280
|
style: {
|
|
3280
3281
|
flexShrink: 0
|
|
3281
3282
|
}
|
|
3282
|
-
}, title &&
|
|
3283
|
+
}, title && React__default.createElement(Box, {
|
|
3283
3284
|
as: "h4",
|
|
3284
3285
|
fontSize: {
|
|
3285
3286
|
base: 'md',
|
|
3286
3287
|
tablet: 'lg'
|
|
3287
3288
|
},
|
|
3288
3289
|
id: id
|
|
3289
|
-
}, title), onDismiss &&
|
|
3290
|
+
}, title), onDismiss && React__default.createElement(Button, {
|
|
3290
3291
|
"aria-label": "close",
|
|
3291
3292
|
variant: "tertiary",
|
|
3292
3293
|
onClick: onDismiss,
|
|
@@ -3305,7 +3306,7 @@ var ModalBody = function ModalBody(_ref) {
|
|
|
3305
3306
|
_ref$height = _ref.height,
|
|
3306
3307
|
height = _ref$height === void 0 ? '100' : _ref$height,
|
|
3307
3308
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
3308
|
-
return
|
|
3309
|
+
return React__default.createElement(Box, _extends({
|
|
3309
3310
|
flex: flex,
|
|
3310
3311
|
overflow: overflow,
|
|
3311
3312
|
height: height,
|
|
@@ -3352,18 +3353,18 @@ var ModalBaseComponent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
3352
3353
|
var contentClassnames = classNames(styles$7['modal-content'], className, maxWidthCss.classes, (_classNames = {}, _classNames["overflow-" + overflow] = overflow, _classNames));
|
|
3353
3354
|
if (!isOpen) return null;
|
|
3354
3355
|
var parentElement = containerRef != null && containerRef.current ? containerRef.current : undefined;
|
|
3355
|
-
return
|
|
3356
|
+
return React__default.createElement(FocusLock, {
|
|
3356
3357
|
autoFocus: true,
|
|
3357
3358
|
returnFocus: true,
|
|
3358
3359
|
disabled: !isOpen,
|
|
3359
3360
|
onActivation: activateFocusLock,
|
|
3360
3361
|
crossFrame: true
|
|
3361
|
-
},
|
|
3362
|
+
}, React__default.createElement(RemoveScroll, {
|
|
3362
3363
|
allowPinchZoom: allowPinchZoom,
|
|
3363
3364
|
enabled: isOpen
|
|
3364
|
-
},
|
|
3365
|
+
}, React__default.createElement(Box, {
|
|
3365
3366
|
ref: ref
|
|
3366
|
-
},
|
|
3367
|
+
}, React__default.createElement(ReactModal, _extends({
|
|
3367
3368
|
isOpen: isOpen,
|
|
3368
3369
|
overlayClassName: overlayClassnames,
|
|
3369
3370
|
className: contentClassnames,
|
|
@@ -3375,7 +3376,7 @@ var ModalBaseComponent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
3375
3376
|
style: {
|
|
3376
3377
|
content: _extends({}, maxWidthCss.styles)
|
|
3377
3378
|
}
|
|
3378
|
-
}, restProps),
|
|
3379
|
+
}, restProps), React__default.createElement(Box, {
|
|
3379
3380
|
"aria-label": ariaLabel,
|
|
3380
3381
|
"aria-labelledby": ariaLabelledBy,
|
|
3381
3382
|
height: "100",
|
|
@@ -3495,13 +3496,13 @@ var Pagination = function Pagination(_ref) {
|
|
|
3495
3496
|
}
|
|
3496
3497
|
return "Showing " + activeListRange.first + "-" + activeListRange.last + " of " + totalItemsCount;
|
|
3497
3498
|
}, [activeListRange, totalItemsCount]);
|
|
3498
|
-
return
|
|
3499
|
+
return React__default.createElement(Box, {
|
|
3499
3500
|
as: "nav",
|
|
3500
3501
|
direction: "row",
|
|
3501
3502
|
alignItems: "center",
|
|
3502
3503
|
justifyContent: "space-between",
|
|
3503
3504
|
className: paginationClassNames
|
|
3504
|
-
},
|
|
3505
|
+
}, React__default.createElement(Box, {
|
|
3505
3506
|
direction: "row",
|
|
3506
3507
|
justifyContent: {
|
|
3507
3508
|
base: 'space-between'
|
|
@@ -3511,20 +3512,20 @@ var Pagination = function Pagination(_ref) {
|
|
|
3511
3512
|
tablet: 'none'
|
|
3512
3513
|
},
|
|
3513
3514
|
gap: isCompact ? 'xs' : 'sm'
|
|
3514
|
-
},
|
|
3515
|
+
}, React__default.createElement(Button, {
|
|
3515
3516
|
variant: "secondary",
|
|
3516
3517
|
size: isCompact ? 'sm' : 'md',
|
|
3517
3518
|
isDisabled: validActivePage === 1,
|
|
3518
3519
|
onClick: function onClick() {
|
|
3519
3520
|
return onChange(validActivePage - 1);
|
|
3520
3521
|
}
|
|
3521
|
-
}, prevPageText), arePagesVisible &&
|
|
3522
|
+
}, prevPageText), arePagesVisible && React__default.createElement(Box, {
|
|
3522
3523
|
direction: "row",
|
|
3523
3524
|
gap: "2xs"
|
|
3524
3525
|
}, pages.map(function (_ref2, index) {
|
|
3525
3526
|
var pageNumber = _ref2.pageNumber,
|
|
3526
3527
|
isPage = _ref2.isPage;
|
|
3527
|
-
return isPage ?
|
|
3528
|
+
return isPage ? React__default.createElement(Button, {
|
|
3528
3529
|
key: pageNumber,
|
|
3529
3530
|
onClick: function onClick() {
|
|
3530
3531
|
return onChange(pageNumber);
|
|
@@ -3535,7 +3536,7 @@ var Pagination = function Pagination(_ref) {
|
|
|
3535
3536
|
minWidth: isCompact ? '33px' : '42px'
|
|
3536
3537
|
},
|
|
3537
3538
|
className: className
|
|
3538
|
-
}, pageNumber) :
|
|
3539
|
+
}, pageNumber) : React__default.createElement(Box, {
|
|
3539
3540
|
key: "ellipsis-" + index,
|
|
3540
3541
|
style: {
|
|
3541
3542
|
display: 'flexk',
|
|
@@ -3544,14 +3545,14 @@ var Pagination = function Pagination(_ref) {
|
|
|
3544
3545
|
alignItems: 'center'
|
|
3545
3546
|
}
|
|
3546
3547
|
}, "...");
|
|
3547
|
-
})),
|
|
3548
|
+
})), React__default.createElement(Button, {
|
|
3548
3549
|
variant: "secondary",
|
|
3549
3550
|
size: isCompact ? 'sm' : 'md',
|
|
3550
3551
|
isDisabled: validActivePage === pageTotal,
|
|
3551
3552
|
onClick: function onClick() {
|
|
3552
3553
|
return onChange(validActivePage + 1);
|
|
3553
3554
|
}
|
|
3554
|
-
}, nextPageText)),
|
|
3555
|
+
}, nextPageText)), React__default.createElement(Box, {
|
|
3555
3556
|
as: "p",
|
|
3556
3557
|
display: {
|
|
3557
3558
|
base: 'none',
|
|
@@ -3577,7 +3578,7 @@ var RangeInput = function RangeInput(_ref) {
|
|
|
3577
3578
|
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
3578
3579
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
3579
3580
|
var currentProgress = value > 0 ? value / max * 100 : 0;
|
|
3580
|
-
return
|
|
3581
|
+
return React__default.createElement("input", _extends({}, restProps, {
|
|
3581
3582
|
id: id,
|
|
3582
3583
|
type: "range",
|
|
3583
3584
|
min: "0",
|
|
@@ -3643,7 +3644,7 @@ var ResponsiveProvider = function ResponsiveProvider(_ref) {
|
|
|
3643
3644
|
};
|
|
3644
3645
|
}
|
|
3645
3646
|
}, [throttle]);
|
|
3646
|
-
return
|
|
3647
|
+
return React__default.createElement(ResponsiveContext.Provider, {
|
|
3647
3648
|
value: {
|
|
3648
3649
|
innerWidth: innerWidth,
|
|
3649
3650
|
innerHeight: innerHeight,
|
|
@@ -3684,7 +3685,7 @@ var TableBodyCell = function TableBodyCell(_ref) {
|
|
|
3684
3685
|
width = _ref$width === void 0 ? undefined : _ref$width;
|
|
3685
3686
|
var columnIsSticky = sticky === 'left' || sticky === 'right';
|
|
3686
3687
|
var tableCellClasses = classNames(styles$2['table-cell'], (_classNames = {}, _classNames[styles$2.truncated] = truncateOverflow, _classNames[styles$2.compact] = isCompact, _classNames[styles$2.borderless] = isBorderless, _classNames[styles$2['sticky-column']] = columnIsSticky, _classNames[styles$2['sticky-column-left']] = sticky === 'left', _classNames[styles$2['sticky-column-right']] = sticky === 'right', _classNames[styles$2['align-right']] = align === 'right', _classNames[styles$2['align-center']] = align === 'center', _classNames), className);
|
|
3687
|
-
return
|
|
3688
|
+
return React__default.createElement(Box, {
|
|
3688
3689
|
as: columnIsSticky ? 'th' : 'td',
|
|
3689
3690
|
className: tableCellClasses,
|
|
3690
3691
|
display: "table-cell",
|
|
@@ -3736,18 +3737,18 @@ var TableHeaderCell = function TableHeaderCell(_ref) {
|
|
|
3736
3737
|
var renderIcon = function renderIcon() {
|
|
3737
3738
|
var renderArrows = function renderArrows() {
|
|
3738
3739
|
if (getSortDirection() === 'ascending') {
|
|
3739
|
-
return
|
|
3740
|
+
return React__default.createElement(Icon, {
|
|
3740
3741
|
name: "caret-sm-up",
|
|
3741
3742
|
"data-testid": "tableHeaderCellSortAsc-testid"
|
|
3742
3743
|
});
|
|
3743
3744
|
}
|
|
3744
3745
|
if (getSortDirection() === 'descending') {
|
|
3745
|
-
return
|
|
3746
|
+
return React__default.createElement(Icon, {
|
|
3746
3747
|
name: "caret-sm-down",
|
|
3747
3748
|
"data-testid": "tableHeaderCellSortDesc-testid"
|
|
3748
3749
|
});
|
|
3749
3750
|
}
|
|
3750
|
-
return
|
|
3751
|
+
return React__default.createElement(Box, {
|
|
3751
3752
|
display: "inline-block",
|
|
3752
3753
|
width: "12px",
|
|
3753
3754
|
height: "12px",
|
|
@@ -3755,7 +3756,7 @@ var TableHeaderCell = function TableHeaderCell(_ref) {
|
|
|
3755
3756
|
"data-testid": "tableHeaderCellSortNone-testid"
|
|
3756
3757
|
});
|
|
3757
3758
|
};
|
|
3758
|
-
return
|
|
3759
|
+
return React__default.createElement("span", {
|
|
3759
3760
|
className: styles$1['sort-icon']
|
|
3760
3761
|
}, renderArrows());
|
|
3761
3762
|
};
|
|
@@ -3778,7 +3779,7 @@ var TableHeaderCell = function TableHeaderCell(_ref) {
|
|
|
3778
3779
|
onSort(eventWithKey);
|
|
3779
3780
|
};
|
|
3780
3781
|
var tableHeaderClasses = classNames(styles$1['table-header-cell'], (_classNames = {}, _classNames[styles$1.sortable] = isSortable, _classNames[styles$1.compact] = isCompact, _classNames[styles$1.truncated] = truncateOverflow, _classNames[styles$1.borderless] = isBorderless, _classNames[styles$1['sticky-header']] = hasStickyHeader, _classNames[styles$1['sticky-column']] = sticky === 'left' || sticky === 'right', _classNames[styles$1['sticky-column-left']] = sticky === 'left', _classNames[styles$1['sticky-column-right']] = sticky === 'right', _classNames[styles$1['align-right']] = align === 'right', _classNames[styles$1['align-center']] = align === 'center', _classNames), className);
|
|
3781
|
-
return
|
|
3782
|
+
return React__default.createElement(Box, {
|
|
3782
3783
|
as: "th",
|
|
3783
3784
|
display: "table-cell",
|
|
3784
3785
|
className: tableHeaderClasses,
|
|
@@ -3788,7 +3789,7 @@ var TableHeaderCell = function TableHeaderCell(_ref) {
|
|
|
3788
3789
|
onClick: handleSort,
|
|
3789
3790
|
onKeyDown: handleKeyPress,
|
|
3790
3791
|
scope: "col"
|
|
3791
|
-
},
|
|
3792
|
+
}, React__default.createElement("div", {
|
|
3792
3793
|
className: styles$1.heading
|
|
3793
3794
|
}, column.heading, isSortable && renderIcon()));
|
|
3794
3795
|
};
|
|
@@ -3839,10 +3840,10 @@ var TableRow = function TableRow(_ref) {
|
|
|
3839
3840
|
}
|
|
3840
3841
|
return undefined;
|
|
3841
3842
|
};
|
|
3842
|
-
return
|
|
3843
|
+
return React__default.createElement("tr", {
|
|
3843
3844
|
className: tableRowClasses
|
|
3844
3845
|
}, Object.values(columns).map(function (column, columnIndex) {
|
|
3845
|
-
return isTableHead ?
|
|
3846
|
+
return isTableHead ? React__default.createElement(TableHeaderCell, {
|
|
3846
3847
|
column: column,
|
|
3847
3848
|
align: column.align || align,
|
|
3848
3849
|
key: getColumnKeys(columns)[columnIndex],
|
|
@@ -3857,7 +3858,7 @@ var TableRow = function TableRow(_ref) {
|
|
|
3857
3858
|
width: column.width,
|
|
3858
3859
|
hasStickyHeader: hasStickyHeader,
|
|
3859
3860
|
sticky: column.sticky
|
|
3860
|
-
}) :
|
|
3861
|
+
}) : React__default.createElement(TableBodyCell, {
|
|
3861
3862
|
align: column.align || align,
|
|
3862
3863
|
className: getCellClassName(column),
|
|
3863
3864
|
emptyCellPlaceholder: column.emptyCellPlaceholder || emptyCellPlaceholder,
|
|
@@ -3892,10 +3893,10 @@ var TableBody = function TableBody(_ref) {
|
|
|
3892
3893
|
_ref$truncateOverflow = _ref.truncateOverflow,
|
|
3893
3894
|
truncateOverflow = _ref$truncateOverflow === void 0 ? false : _ref$truncateOverflow;
|
|
3894
3895
|
var tableBodyClasses = classNames(styles$4['table-body'], (_classNames = {}, _classNames[styles$4.striped] = isStriped, _classNames[styles$4.hover] = hoverableRows, _classNames), className);
|
|
3895
|
-
return
|
|
3896
|
+
return React__default.createElement("tbody", {
|
|
3896
3897
|
className: tableBodyClasses
|
|
3897
3898
|
}, rows.map(function (row, rowIndex) {
|
|
3898
|
-
return
|
|
3899
|
+
return React__default.createElement(TableRow, {
|
|
3899
3900
|
columns: columns,
|
|
3900
3901
|
row: row,
|
|
3901
3902
|
rowIndex: rowIndex,
|
|
@@ -3928,9 +3929,9 @@ var TableHead = function TableHead(_ref) {
|
|
|
3928
3929
|
_ref$truncateOverflow = _ref.truncateOverflow,
|
|
3929
3930
|
truncateOverflow = _ref$truncateOverflow === void 0 ? false : _ref$truncateOverflow;
|
|
3930
3931
|
var tableHeadClasses = classNames(className);
|
|
3931
|
-
return
|
|
3932
|
+
return React__default.createElement("thead", {
|
|
3932
3933
|
className: tableHeadClasses
|
|
3933
|
-
},
|
|
3934
|
+
}, React__default.createElement(TableRow, {
|
|
3934
3935
|
columns: columns,
|
|
3935
3936
|
align: align,
|
|
3936
3937
|
isTableHead: true,
|
|
@@ -3979,18 +3980,18 @@ var Table = function Table(_ref) {
|
|
|
3979
3980
|
var containerClasses = classNames(styles$5.container, (_classNames = {}, _classNames[styles$5['full-height']] = !!(isScrollable != null && isScrollable.y), _classNames));
|
|
3980
3981
|
var scrollContainerClasses = classNames(styles$5['scroll-container'], (_classNames2 = {}, _classNames2[styles$5.scrollable] = !!(isScrollable != null && isScrollable.x) || !!(isScrollable != null && isScrollable.y), _classNames2[styles$5['scrollable-x']] = !!(isScrollable != null && isScrollable.x), _classNames2[styles$5['scrollable-y']] = !!(isScrollable != null && isScrollable.y), _classNames2), className);
|
|
3981
3982
|
var tableClasses = classNames(styles$5.table, (_classNames3 = {}, _classNames3[styles$5.fixed] = useFixedTableLayout, _classNames3[styles$5.striped] = isStriped, _classNames3[styles$5.borderless] = isBorderless, _classNames3[styles$5.compact] = isCompact, _classNames3));
|
|
3982
|
-
return
|
|
3983
|
+
return React__default.createElement("div", {
|
|
3983
3984
|
className: containerClasses
|
|
3984
|
-
}, isLoading &&
|
|
3985
|
+
}, isLoading && React__default.createElement("div", {
|
|
3985
3986
|
className: styles$5['loading-mask']
|
|
3986
|
-
},
|
|
3987
|
+
}, React__default.createElement(Spinner, {
|
|
3987
3988
|
size: "xl"
|
|
3988
|
-
})),
|
|
3989
|
+
})), React__default.createElement("div", {
|
|
3989
3990
|
className: scrollContainerClasses,
|
|
3990
3991
|
"data-testid": "tableContainerDiv-testid"
|
|
3991
|
-
},
|
|
3992
|
+
}, React__default.createElement("table", {
|
|
3992
3993
|
className: tableClasses
|
|
3993
|
-
},
|
|
3994
|
+
}, React__default.createElement(TableHead, {
|
|
3994
3995
|
columns: columns,
|
|
3995
3996
|
align: align,
|
|
3996
3997
|
onSort: onSort,
|
|
@@ -3999,7 +4000,7 @@ var Table = function Table(_ref) {
|
|
|
3999
4000
|
sortedColumn: sortedColumn,
|
|
4000
4001
|
truncateOverflow: truncateOverflow,
|
|
4001
4002
|
hasStickyHeader: hasStickyHeader
|
|
4002
|
-
}),
|
|
4003
|
+
}), React__default.createElement(TableBody, {
|
|
4003
4004
|
rows: rows,
|
|
4004
4005
|
columns: columns,
|
|
4005
4006
|
rowKey: rowKey,
|
|
@@ -4052,7 +4053,7 @@ function ThemeProvider(_ref) {
|
|
|
4052
4053
|
},
|
|
4053
4054
|
isDarkMode: isDarkMode
|
|
4054
4055
|
};
|
|
4055
|
-
return
|
|
4056
|
+
return React__default.createElement(ThemeProviderContext.Provider, _extends({}, props, {
|
|
4056
4057
|
value: value
|
|
4057
4058
|
}), children);
|
|
4058
4059
|
}
|
|
@@ -4081,12 +4082,12 @@ var renderToastIcon = function renderToastIcon(toast) {
|
|
|
4081
4082
|
iconName = 'c-warning';
|
|
4082
4083
|
iconColor = 'white';
|
|
4083
4084
|
}
|
|
4084
|
-
var icon = type !== 'loading' ?
|
|
4085
|
+
var icon = type !== 'loading' ? React__default.createElement(Icon, {
|
|
4085
4086
|
name: iconName,
|
|
4086
4087
|
color: iconColor
|
|
4087
|
-
}) :
|
|
4088
|
+
}) : React__default.createElement(Spinner, null);
|
|
4088
4089
|
// eslint-disable-next-line consistent-return
|
|
4089
|
-
return
|
|
4090
|
+
return React__default.createElement(Box, {
|
|
4090
4091
|
justifyContent: "center",
|
|
4091
4092
|
height: "100"
|
|
4092
4093
|
}, icon);
|
|
@@ -4094,7 +4095,7 @@ var renderToastIcon = function renderToastIcon(toast) {
|
|
|
4094
4095
|
var renderDismissIcon = function renderDismissIcon(toast, onDismiss) {
|
|
4095
4096
|
if (!toast.canDismiss) return;
|
|
4096
4097
|
// eslint-disable-next-line consistent-return
|
|
4097
|
-
return
|
|
4098
|
+
return React__default.createElement(Box, {
|
|
4098
4099
|
as: "button",
|
|
4099
4100
|
borderWidth: "0",
|
|
4100
4101
|
className: styles['toast-dismiss'],
|
|
@@ -4107,12 +4108,12 @@ var renderDismissIcon = function renderDismissIcon(toast, onDismiss) {
|
|
|
4107
4108
|
height: "100",
|
|
4108
4109
|
onClick: onDismiss,
|
|
4109
4110
|
"aria-label": "dismiss notification"
|
|
4110
|
-
},
|
|
4111
|
+
}, React__default.createElement(Icon, {
|
|
4111
4112
|
name: "remove"
|
|
4112
4113
|
}));
|
|
4113
4114
|
};
|
|
4114
4115
|
// eslint-disable-next-line import/prefer-default-export
|
|
4115
|
-
var ToastNotification = /*#__PURE__*/
|
|
4116
|
+
var ToastNotification = /*#__PURE__*/React__default.memo(function (_ref2) {
|
|
4116
4117
|
var _classNames;
|
|
4117
4118
|
var toast = _ref2.toast,
|
|
4118
4119
|
_ref2$position = _ref2.position,
|
|
@@ -4120,7 +4121,7 @@ var ToastNotification = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
4120
4121
|
style = _ref2.style,
|
|
4121
4122
|
children = _ref2.children,
|
|
4122
4123
|
onDismiss = _ref2.onDismiss;
|
|
4123
|
-
var message =
|
|
4124
|
+
var message = React__default.createElement(Box, _extends({
|
|
4124
4125
|
direction: "row",
|
|
4125
4126
|
justifyContent: "center",
|
|
4126
4127
|
style: {
|
|
@@ -4131,7 +4132,7 @@ var ToastNotification = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
4131
4132
|
var classes = classNames(toast.className, styles['toast-notification'], animationClass, (_classNames = {
|
|
4132
4133
|
'toast-notification--not-visible': !toast.visible
|
|
4133
4134
|
}, _classNames[styles['toast-error']] = toast.type === 'error', _classNames));
|
|
4134
|
-
return
|
|
4135
|
+
return React__default.createElement(Box, {
|
|
4135
4136
|
alignItems: "center",
|
|
4136
4137
|
maxWidth: "300px",
|
|
4137
4138
|
padding: toast.isCompact ? 'sm' : 'md',
|
|
@@ -4143,7 +4144,7 @@ var ToastNotification = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
4143
4144
|
})
|
|
4144
4145
|
}, typeof children === 'function' ? children({
|
|
4145
4146
|
message: message
|
|
4146
|
-
}) :
|
|
4147
|
+
}) : React__default.createElement(React__default.Fragment, null, renderToastIcon(toast), message, renderDismissIcon(toast, onDismiss)));
|
|
4147
4148
|
});
|
|
4148
4149
|
|
|
4149
4150
|
var _actionHandlers;
|
|
@@ -4542,7 +4543,7 @@ var renderNotification = function renderNotification(currentToast, children, con
|
|
|
4542
4543
|
if (children) {
|
|
4543
4544
|
return children(currentToast);
|
|
4544
4545
|
}
|
|
4545
|
-
return
|
|
4546
|
+
return React__default.createElement(ToastNotification, {
|
|
4546
4547
|
toast: currentToast,
|
|
4547
4548
|
position: toastPosition,
|
|
4548
4549
|
onDismiss: function onDismiss() {
|
|
@@ -4568,7 +4569,7 @@ var ToastContainer = function ToastContainer(_ref) {
|
|
|
4568
4569
|
var _useToasts = useToasts(toastOptions),
|
|
4569
4570
|
toasts = _useToasts.toasts,
|
|
4570
4571
|
handlers = _useToasts.handlers;
|
|
4571
|
-
return
|
|
4572
|
+
return React__default.createElement(Box, _extends({
|
|
4572
4573
|
style: _extends({
|
|
4573
4574
|
top: DEFAULT_OFFSET,
|
|
4574
4575
|
left: DEFAULT_OFFSET,
|
|
@@ -4592,7 +4593,7 @@ var ToastContainer = function ToastContainer(_ref) {
|
|
|
4592
4593
|
var ref = t.height ? undefined : createRectRef(function (rect) {
|
|
4593
4594
|
handlers.updateHeight(t.id, rect.height);
|
|
4594
4595
|
});
|
|
4595
|
-
return
|
|
4596
|
+
return React__default.createElement(Box, {
|
|
4596
4597
|
ref: ref,
|
|
4597
4598
|
zIndex: t.visible ? 'popover' : undefined,
|
|
4598
4599
|
key: t.id,
|
|
@@ -4603,7 +4604,7 @@ var ToastContainer = function ToastContainer(_ref) {
|
|
|
4603
4604
|
};
|
|
4604
4605
|
|
|
4605
4606
|
var useWindowSize = function useWindowSize() {
|
|
4606
|
-
var _React$useContext =
|
|
4607
|
+
var _React$useContext = React__default.useContext(ResponsiveContext),
|
|
4607
4608
|
innerWidth = _React$useContext.innerWidth,
|
|
4608
4609
|
innerHeight = _React$useContext.innerHeight,
|
|
4609
4610
|
outerHeight = _React$useContext.outerHeight,
|
|
@@ -4648,6 +4649,28 @@ var useBreakpoint = function useBreakpoint() {
|
|
|
4648
4649
|
};
|
|
4649
4650
|
};
|
|
4650
4651
|
|
|
4652
|
+
var desktopBreakpoint = /*#__PURE__*/BREAKPOINTS.find(function (b) {
|
|
4653
|
+
return b.name === 'desktop';
|
|
4654
|
+
});
|
|
4655
|
+
var MOBILE_BREAKPOINT = desktopBreakpoint ? desktopBreakpoint.minWidth : 0; // min width in pixels
|
|
4656
|
+
function useIsMobile() {
|
|
4657
|
+
var _React$useState = React.useState(undefined),
|
|
4658
|
+
isMobile = _React$useState[0],
|
|
4659
|
+
setIsMobile = _React$useState[1];
|
|
4660
|
+
React.useEffect(function () {
|
|
4661
|
+
var mql = window.matchMedia("(max-width: " + (MOBILE_BREAKPOINT - 1) + "px)");
|
|
4662
|
+
var onChange = function onChange() {
|
|
4663
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
4664
|
+
};
|
|
4665
|
+
mql.addEventListener('change', onChange);
|
|
4666
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
4667
|
+
return function () {
|
|
4668
|
+
return mql.removeEventListener('change', onChange);
|
|
4669
|
+
};
|
|
4670
|
+
}, []);
|
|
4671
|
+
return !!isMobile;
|
|
4672
|
+
}
|
|
4673
|
+
|
|
4651
4674
|
var useOpenClose = function useOpenClose(props) {
|
|
4652
4675
|
if (props === void 0) {
|
|
4653
4676
|
props = {};
|
|
@@ -4696,10 +4719,10 @@ var useOpenClose = function useOpenClose(props) {
|
|
|
4696
4719
|
};
|
|
4697
4720
|
|
|
4698
4721
|
var useTheme = function useTheme() {
|
|
4699
|
-
var context =
|
|
4722
|
+
var context = React__default.useContext(ThemeProviderContext);
|
|
4700
4723
|
if (context === undefined) throw new Error('useTheme must be used within a ThemeProvider. Be sure your App is wrapped in ThemeProvider.');
|
|
4701
4724
|
return context;
|
|
4702
4725
|
};
|
|
4703
4726
|
|
|
4704
|
-
export { Alert, Badge, Box, Button, Card, CardBaseComponent, Checkbox, CheckboxInput, DateInput, DatePicker, Details, DetailsBaseComponent, DetailsSummary, Drawer, FormControl, FormLabel, FormikCheckboxInput, FormikRadioGroup, FormikSelectInput, FormikSelectInputInset, FormikSelectInputNative, FormikTextInput, FormikTextInputInset, FormikTextareaInput, FormikTextareaInputInset, FormikTimePicker, FormikTimePickerNative, FormikToggle, Heading, Icon, Modal, ModalBaseComponent, Pagination, Popover, RadioGroup, RangeInput, ResponsiveContext, ResponsiveProvider, SelectInput, SelectInputInset, SelectInputNative, Spinner, Table, TextInput, TextInputInset, TextareaInput, TextareaInputInset, ThemeProvider, ThemeProviderContext, TimePicker, TimePickerNative, ToastContainer, Toggle, boxPropsKeys, createRectRef, toast, useBreakpoint, useIsomorphicLayoutEffect, useOpenClose, useTheme, useToasts, useWindowSize };
|
|
4727
|
+
export { Alert, Badge, Box, Button, Card, CardBaseComponent, Checkbox, CheckboxInput, DateInput, DatePicker, Details, DetailsBaseComponent, DetailsSummary, Drawer, FormControl, FormLabel, FormikCheckboxInput, FormikRadioGroup, FormikSelectInput, FormikSelectInputInset, FormikSelectInputNative, FormikTextInput, FormikTextInputInset, FormikTextareaInput, FormikTextareaInputInset, FormikTimePicker, FormikTimePickerNative, FormikToggle, Heading, Icon, Modal, ModalBaseComponent, Pagination, Popover, RadioGroup, RangeInput, ResponsiveContext, ResponsiveProvider, SelectInput, SelectInputInset, SelectInputNative, Spinner, Table, TextInput, TextInputInset, TextareaInput, TextareaInputInset, ThemeProvider, ThemeProviderContext, TimePicker, TimePickerNative, ToastContainer, Toggle, boxPropsKeys, createRectRef, toast, useBreakpoint, useIsMobile, useIsomorphicLayoutEffect, useOpenClose, useTheme, useToasts, useWindowSize };
|
|
4705
4728
|
//# sourceMappingURL=hyphen-components.esm.js.map
|