@helpdice/ui 2.5.4 → 2.5.8-beta.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/auto-complete/index.js +913 -102
- package/dist/avatar/index.js +11 -9
- package/dist/button/button.icon.d.ts +0 -1
- package/dist/button/button.small.d.ts +0 -1
- package/dist/button/index.js +7 -9
- package/dist/carousal/index.js +7 -9
- package/dist/container/index.js +7 -9
- package/dist/copy-to-clipboard/index.js +7 -9
- package/dist/index.js +3046 -2989
- package/dist/input/index.js +906 -47
- package/dist/modal/index.js +5 -5
- package/dist/pagination/index.js +6 -6
- package/dist/placeholder/index.js +16 -11
- package/dist/select/index.js +912 -14
- package/dist/select/select.d.ts +2 -0
- package/dist/table/index.js +21623 -21568
- package/dist/table/table-body.d.ts +1 -2
- package/dist/table/table.d.ts +1 -0
- package/dist/text/index.js +16 -11
- package/dist/text/text.d.ts +3 -0
- package/dist/textarea/index.js +881 -7
- package/dist/textarea/textarea.d.ts +3 -0
- package/dist/tooltip/index.js +0 -1
- package/dist/tooltip/tooltip-small.d.ts +2 -5
- package/dist/user/index.js +11 -9
- package/esm/avatar/avatar.js +8 -6
- package/esm/button/button.icon.d.ts +0 -1
- package/esm/button/button.js +5 -5
- package/esm/button/button.small.d.ts +0 -1
- package/esm/button/button.small.js +2 -4
- package/esm/input/input-field.js +11 -9
- package/esm/pagination/pagination-item.js +6 -6
- package/esm/select/select.d.ts +2 -0
- package/esm/select/select.js +15 -2
- package/esm/table/table-body.d.ts +1 -2
- package/esm/table/table-body.js +16 -11
- package/esm/table/table.d.ts +1 -0
- package/esm/table/table.js +45 -25
- package/esm/text/text.d.ts +3 -0
- package/esm/text/text.js +9 -2
- package/esm/textarea/textarea.d.ts +3 -0
- package/esm/textarea/textarea.js +19 -2
- package/esm/tooltip/tooltip-small.d.ts +2 -5
- package/esm/tooltip/tooltip-small.js +0 -1
- package/package.json +2 -2
|
@@ -811,45 +811,13 @@ var InputIconClear = function InputIconClear(_ref) {
|
|
|
811
811
|
};
|
|
812
812
|
var MemoInputIconClear = /*#__PURE__*/React.memo(InputIconClear);
|
|
813
813
|
|
|
814
|
-
var getColors = function getColors(palette, status) {
|
|
815
|
-
var colors = {
|
|
816
|
-
"default": {
|
|
817
|
-
color: palette.foreground,
|
|
818
|
-
borderColor: palette.border,
|
|
819
|
-
hoverBorder: palette.accents_5
|
|
820
|
-
},
|
|
821
|
-
secondary: {
|
|
822
|
-
color: palette.foreground,
|
|
823
|
-
borderColor: palette.secondary,
|
|
824
|
-
hoverBorder: palette.secondary
|
|
825
|
-
},
|
|
826
|
-
success: {
|
|
827
|
-
color: palette.foreground,
|
|
828
|
-
borderColor: palette.successLight,
|
|
829
|
-
hoverBorder: palette.success
|
|
830
|
-
},
|
|
831
|
-
warning: {
|
|
832
|
-
color: palette.foreground,
|
|
833
|
-
borderColor: palette.warningLight,
|
|
834
|
-
hoverBorder: palette.warning
|
|
835
|
-
},
|
|
836
|
-
error: {
|
|
837
|
-
color: palette.error,
|
|
838
|
-
borderColor: palette.error,
|
|
839
|
-
hoverBorder: palette.errorDark
|
|
840
|
-
}
|
|
841
|
-
};
|
|
842
|
-
if (!status) return colors["default"];
|
|
843
|
-
return colors[status];
|
|
844
|
-
};
|
|
845
|
-
|
|
846
814
|
/* "use client" */
|
|
847
815
|
|
|
848
816
|
var ScalePropKeys = ['width', 'height', 'padding', 'margin', 'w', 'h', 'paddingLeft', 'paddingRight', 'paddingTop', 'paddingBottom', 'pl', 'pr', 'pt', 'pb', 'marginLeft', 'marginRight', 'marginTop', 'marginBottom', 'ml', 'mr', 'mt', 'mb', 'px', 'py', 'mx', 'my', 'font', 'unit', 'scale'];
|
|
849
817
|
var defaultDynamicLayoutPipe = function defaultDynamicLayoutPipe(scale1x) {
|
|
850
818
|
return "".concat(scale1x);
|
|
851
819
|
};
|
|
852
|
-
var defaultContext$
|
|
820
|
+
var defaultContext$2 = {
|
|
853
821
|
getScaleProps: function getScaleProps() {
|
|
854
822
|
return undefined;
|
|
855
823
|
},
|
|
@@ -875,7 +843,7 @@ var defaultContext$1 = {
|
|
|
875
843
|
},
|
|
876
844
|
unit: '16px'
|
|
877
845
|
};
|
|
878
|
-
var ScaleContext = /*#__PURE__*/React.createContext(defaultContext$
|
|
846
|
+
var ScaleContext = /*#__PURE__*/React.createContext(defaultContext$2);
|
|
879
847
|
var useScale = function useScale() {
|
|
880
848
|
return React.useContext(ScaleContext);
|
|
881
849
|
};
|
|
@@ -945,7 +913,7 @@ var generateGetAllScaleProps = function generateGetAllScaleProps(props) {
|
|
|
945
913
|
return getAllScaleProps;
|
|
946
914
|
};
|
|
947
915
|
|
|
948
|
-
var _excluded$
|
|
916
|
+
var _excluded$a = ["children"];
|
|
949
917
|
var reduceScaleCoefficient = function reduceScaleCoefficient(scale) {
|
|
950
918
|
if (scale === 1) return scale;
|
|
951
919
|
var diff = Math.abs((scale - 1) / 2);
|
|
@@ -955,7 +923,7 @@ var withScale = function withScale(Render) {
|
|
|
955
923
|
var ScaleFC = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
956
924
|
var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref0, _ref1, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _ref30, _ref31;
|
|
957
925
|
var children = _ref.children,
|
|
958
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
926
|
+
props = _objectWithoutProperties(_ref, _excluded$a);
|
|
959
927
|
var _useTheme = theme.useTheme(),
|
|
960
928
|
layout = _useTheme.layout;
|
|
961
929
|
var paddingLeft = props.paddingLeft,
|
|
@@ -1038,7 +1006,882 @@ var withScale = function withScale(Render) {
|
|
|
1038
1006
|
return ScaleFC;
|
|
1039
1007
|
};
|
|
1040
1008
|
|
|
1041
|
-
var _excluded$
|
|
1009
|
+
var _excluded$9 = ["children", "tag", "className", "color"];
|
|
1010
|
+
var getTypeColor = function getTypeColor(type, palette) {
|
|
1011
|
+
var colors = {
|
|
1012
|
+
"default": 'inherit',
|
|
1013
|
+
secondary: palette.secondary,
|
|
1014
|
+
success: palette.success,
|
|
1015
|
+
warning: palette.warning,
|
|
1016
|
+
error: palette.error
|
|
1017
|
+
};
|
|
1018
|
+
return colors[type] || colors["default"];
|
|
1019
|
+
};
|
|
1020
|
+
var TextChild = function TextChild(_ref) {
|
|
1021
|
+
var children = _ref.children,
|
|
1022
|
+
tag = _ref.tag,
|
|
1023
|
+
_ref$className = _ref.className,
|
|
1024
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1025
|
+
_ref$color = _ref.color,
|
|
1026
|
+
color = _ref$color === void 0 ? 'default' : _ref$color,
|
|
1027
|
+
props = _objectWithoutProperties(_ref, _excluded$9);
|
|
1028
|
+
var Component = tag;
|
|
1029
|
+
var theme$1 = theme.useTheme();
|
|
1030
|
+
var _useScale = useScale(),
|
|
1031
|
+
SCALES = _useScale.SCALES,
|
|
1032
|
+
getScaleProps = _useScale.getScaleProps;
|
|
1033
|
+
var font = getScaleProps('font');
|
|
1034
|
+
var mx = getScaleProps(['margin', 'marginLeft', 'marginRight', 'mx', 'ml', 'mr']);
|
|
1035
|
+
var my = getScaleProps(['margin', 'marginTop', 'marginBottom', 'my', 'mt', 'mb']);
|
|
1036
|
+
var px = getScaleProps(['padding', 'paddingLeft', 'paddingRight', 'pl', 'pr', 'px']);
|
|
1037
|
+
var py = getScaleProps(['padding', 'paddingTop', 'paddingBottom', 'pt', 'pb', 'py']);
|
|
1038
|
+
var _color = React.useMemo(function () {
|
|
1039
|
+
return getTypeColor(color, theme$1.palette);
|
|
1040
|
+
}, [color, theme$1.palette]);
|
|
1041
|
+
var classNames = React.useMemo(function () {
|
|
1042
|
+
var keys = [{
|
|
1043
|
+
value: mx,
|
|
1044
|
+
className: 'mx'
|
|
1045
|
+
}, {
|
|
1046
|
+
value: my,
|
|
1047
|
+
className: 'my'
|
|
1048
|
+
}, {
|
|
1049
|
+
value: px,
|
|
1050
|
+
className: 'px'
|
|
1051
|
+
}, {
|
|
1052
|
+
value: py,
|
|
1053
|
+
className: 'py'
|
|
1054
|
+
}, {
|
|
1055
|
+
value: font,
|
|
1056
|
+
className: 'font'
|
|
1057
|
+
}];
|
|
1058
|
+
var scaleClassNames = keys.reduce(function (pre, next) {
|
|
1059
|
+
if (typeof next.value === 'undefined') return pre;
|
|
1060
|
+
return "".concat(pre, " ").concat(next.className);
|
|
1061
|
+
}, '');
|
|
1062
|
+
return "".concat(scaleClassNames, " ").concat(className).trim();
|
|
1063
|
+
}, [mx, my, px, py, font, className]);
|
|
1064
|
+
return /*#__PURE__*/React.createElement(Component, _extends({}, props, {
|
|
1065
|
+
className: _JSXStyle.dynamic([["2277774325", [tag, _color, SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.font(1, 'inherit'), SCALES.ml(0, 'revert'), SCALES.mr(0, 'revert'), SCALES.mt(0, 'revert'), SCALES.mb(0, 'revert'), SCALES.pl(0, 'revert'), SCALES.pr(0, 'revert'), SCALES.pt(0, 'revert'), SCALES.pb(0, 'revert')]]]) + " " + (props && props.className != null && props.className || classNames || "")
|
|
1066
|
+
}), children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1067
|
+
id: "2277774325",
|
|
1068
|
+
dynamic: [tag, _color, SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.font(1, 'inherit'), SCALES.ml(0, 'revert'), SCALES.mr(0, 'revert'), SCALES.mt(0, 'revert'), SCALES.mb(0, 'revert'), SCALES.pl(0, 'revert'), SCALES.pr(0, 'revert'), SCALES.pt(0, 'revert'), SCALES.pb(0, 'revert')]
|
|
1069
|
+
}, "".concat(tag, ".__jsx-style-dynamic-selector{color:").concat(_color, ";width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";}.font.__jsx-style-dynamic-selector{font-size:").concat(SCALES.font(1, 'inherit'), ";}.mx.__jsx-style-dynamic-selector{margin-left:").concat(SCALES.ml(0, 'revert'), ";margin-right:").concat(SCALES.mr(0, 'revert'), ";}.my.__jsx-style-dynamic-selector{margin-top:").concat(SCALES.mt(0, 'revert'), ";margin-bottom:").concat(SCALES.mb(0, 'revert'), ";}.px.__jsx-style-dynamic-selector{padding-left:").concat(SCALES.pl(0, 'revert'), ";padding-right:").concat(SCALES.pr(0, 'revert'), ";}.py.__jsx-style-dynamic-selector{padding-top:").concat(SCALES.pt(0, 'revert'), ";padding-bottom:").concat(SCALES.pb(0, 'revert'), ";}.no-wrap.__jsx-style-dynamic-selector{white-space:nowrap;}")));
|
|
1070
|
+
};
|
|
1071
|
+
TextChild.displayName = 'TextChild';
|
|
1072
|
+
|
|
1073
|
+
var ButtonDrip = function ButtonDrip(_ref) {
|
|
1074
|
+
var _ref$x = _ref.x,
|
|
1075
|
+
x = _ref$x === void 0 ? 0 : _ref$x,
|
|
1076
|
+
_ref$y = _ref.y,
|
|
1077
|
+
y = _ref$y === void 0 ? 0 : _ref$y,
|
|
1078
|
+
color = _ref.color,
|
|
1079
|
+
onCompleted = _ref.onCompleted;
|
|
1080
|
+
var dripRef = React.useRef(null);
|
|
1081
|
+
/* istanbul ignore next */
|
|
1082
|
+
var top = Number.isNaN(+y) ? 0 : y - 10;
|
|
1083
|
+
/* istanbul ignore next */
|
|
1084
|
+
var left = Number.isNaN(+x) ? 0 : x - 10;
|
|
1085
|
+
React.useEffect(function () {
|
|
1086
|
+
/* istanbul ignore next */
|
|
1087
|
+
if (!dripRef.current) return;
|
|
1088
|
+
dripRef.current.addEventListener('animationend', onCompleted);
|
|
1089
|
+
return function () {
|
|
1090
|
+
/* istanbul ignore next */
|
|
1091
|
+
if (!dripRef.current) return;
|
|
1092
|
+
dripRef.current.removeEventListener('animationend', onCompleted);
|
|
1093
|
+
};
|
|
1094
|
+
});
|
|
1095
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1096
|
+
ref: dripRef,
|
|
1097
|
+
className: "jsx-3424889537" + " " + "drip"
|
|
1098
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
1099
|
+
width: "20",
|
|
1100
|
+
height: "20",
|
|
1101
|
+
viewBox: "0 0 20 20",
|
|
1102
|
+
style: {
|
|
1103
|
+
top: top,
|
|
1104
|
+
left: left
|
|
1105
|
+
},
|
|
1106
|
+
className: "jsx-3424889537"
|
|
1107
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
1108
|
+
stroke: "none",
|
|
1109
|
+
strokeWidth: "1",
|
|
1110
|
+
fill: "none",
|
|
1111
|
+
fillRule: "evenodd",
|
|
1112
|
+
className: "jsx-3424889537"
|
|
1113
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
1114
|
+
fill: color,
|
|
1115
|
+
className: "jsx-3424889537"
|
|
1116
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
1117
|
+
width: "100%",
|
|
1118
|
+
height: "100%",
|
|
1119
|
+
rx: "10",
|
|
1120
|
+
className: "jsx-3424889537"
|
|
1121
|
+
})))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1122
|
+
id: "3424889537"
|
|
1123
|
+
}, ".drip.jsx-3424889537{position:absolute;left:0;right:0;top:0;bottom:0;}svg.jsx-3424889537{position:absolute;-webkit-animation:350ms ease-in expand-jsx-3424889537;animation:350ms ease-in expand-jsx-3424889537;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;width:1rem;height:1rem;}@-webkit-keyframes expand-jsx-3424889537{0%{opacity:0;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);}30%{opacity:1;}80%{opacity:0.5;}100%{-webkit-transform:scale(28);-ms-transform:scale(28);transform:scale(28);opacity:0;}}@keyframes expand-jsx-3424889537{0%{opacity:0;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);}30%{opacity:1;}80%{opacity:0.5;}100%{-webkit-transform:scale(28);-ms-transform:scale(28);transform:scale(28);opacity:0;}}"));
|
|
1124
|
+
};
|
|
1125
|
+
ButtonDrip.displayName = 'ButtonDrip';
|
|
1126
|
+
|
|
1127
|
+
var _excluded$8 = ["children", "type", "color", "className", "spaceRatio"];
|
|
1128
|
+
var getIconBgColor = function getIconBgColor(type, palette, color) {
|
|
1129
|
+
var colors = {
|
|
1130
|
+
"default": palette.accents_6,
|
|
1131
|
+
secondary: palette.secondary,
|
|
1132
|
+
success: palette.success,
|
|
1133
|
+
warning: palette.warning,
|
|
1134
|
+
error: palette.error
|
|
1135
|
+
};
|
|
1136
|
+
return color ? color : colors[type];
|
|
1137
|
+
};
|
|
1138
|
+
var LoadingComponent = function LoadingComponent(_ref) {
|
|
1139
|
+
var children = _ref.children,
|
|
1140
|
+
_ref$type = _ref.type,
|
|
1141
|
+
type = _ref$type === void 0 ? 'default' : _ref$type,
|
|
1142
|
+
color = _ref.color,
|
|
1143
|
+
_ref$className = _ref.className,
|
|
1144
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1145
|
+
_ref$spaceRatio = _ref.spaceRatio,
|
|
1146
|
+
spaceRatio = _ref$spaceRatio === void 0 ? 1 : _ref$spaceRatio,
|
|
1147
|
+
props = _objectWithoutProperties(_ref, _excluded$8);
|
|
1148
|
+
var theme$1 = theme.useTheme();
|
|
1149
|
+
var _useScale = useScale(),
|
|
1150
|
+
SCALES = _useScale.SCALES;
|
|
1151
|
+
var classes = theme.useClasses('loading-container', className);
|
|
1152
|
+
var bgColor = React.useMemo(function () {
|
|
1153
|
+
return getIconBgColor(type, theme$1.palette, color);
|
|
1154
|
+
}, [type, theme$1.palette, color]);
|
|
1155
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
1156
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
1157
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
1158
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]]) + " " + "loading"
|
|
1159
|
+
}, children && /*#__PURE__*/React.createElement("label", {
|
|
1160
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]])
|
|
1161
|
+
}, children), /*#__PURE__*/React.createElement("i", {
|
|
1162
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]])
|
|
1163
|
+
}), /*#__PURE__*/React.createElement("i", {
|
|
1164
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]])
|
|
1165
|
+
}), /*#__PURE__*/React.createElement("i", {
|
|
1166
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]])
|
|
1167
|
+
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1168
|
+
id: "2201634259",
|
|
1169
|
+
dynamic: [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]
|
|
1170
|
+
}, ".loading-container.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative;font-size:".concat(SCALES.font(1), ";width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, '100%'), ";min-height:1em;padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}label.__jsx-style-dynamic-selector{margin-right:0.5em;color:").concat(theme$1.palette.accents_5, ";line-height:1;}label.__jsx-style-dynamic-selector *{margin:0;}.loading.__jsx-style-dynamic-selector{position:absolute;top:50%;left:50%;width:100%;height:100%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:transparent;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}i.__jsx-style-dynamic-selector{width:0.25em;height:0.25em;border-radius:50%;background-color:").concat(bgColor, ";margin:0 calc(0.25em / 2 * ").concat(spaceRatio, ");display:inline-block;-webkit-animation:loading-blink-__jsx-style-dynamic-selector 1.4s infinite both;animation:loading-blink-__jsx-style-dynamic-selector 1.4s infinite both;}i.__jsx-style-dynamic-selector:nth-child(2){-webkit-animation-delay:0.2s;animation-delay:0.2s;}i.__jsx-style-dynamic-selector:nth-child(3){-webkit-animation-delay:0.4s;animation-delay:0.4s;}@-webkit-keyframes loading-blink-__jsx-style-dynamic-selector{0%{opacity:0.2;}20%{opacity:1;}100%{opacity:0.2;}}@keyframes loading-blink-__jsx-style-dynamic-selector{0%{opacity:0.2;}20%{opacity:1;}100%{opacity:0.2;}}")));
|
|
1171
|
+
};
|
|
1172
|
+
LoadingComponent.displayName = 'Loading';
|
|
1173
|
+
var Loading = withScale(LoadingComponent);
|
|
1174
|
+
|
|
1175
|
+
var ButtonLoading = function ButtonLoading(_ref) {
|
|
1176
|
+
var color = _ref.color;
|
|
1177
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
1178
|
+
className: "jsx-212623367" + " " + "btn-loading"
|
|
1179
|
+
}, /*#__PURE__*/React.createElement(Loading, {
|
|
1180
|
+
color: color
|
|
1181
|
+
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1182
|
+
id: "212623367"
|
|
1183
|
+
}, ".btn-loading.jsx-212623367{position:absolute;top:0;left:0;right:0;bottom:0;z-index:2;background-color:var(--helpdice-ui-button-bg);}"));
|
|
1184
|
+
};
|
|
1185
|
+
ButtonLoading.displayName = 'ButtonLoading';
|
|
1186
|
+
|
|
1187
|
+
var _excluded$7 = ["isRight", "isSingle", "children", "className"];
|
|
1188
|
+
var ButtonIcon = function ButtonIcon(_ref) {
|
|
1189
|
+
var _ref$isRight = _ref.isRight,
|
|
1190
|
+
isRight = _ref$isRight === void 0 ? false : _ref$isRight,
|
|
1191
|
+
isSingle = _ref.isSingle,
|
|
1192
|
+
children = _ref.children,
|
|
1193
|
+
_ref$className = _ref.className,
|
|
1194
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1195
|
+
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
1196
|
+
var classes = theme.useClasses('icon', {
|
|
1197
|
+
right: isRight,
|
|
1198
|
+
single: isSingle
|
|
1199
|
+
}, className);
|
|
1200
|
+
return /*#__PURE__*/React.createElement("span", _extends({}, props, {
|
|
1201
|
+
className: "jsx-2467502931" + " " + (props && props.className != null && props.className || classes || "")
|
|
1202
|
+
}), children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1203
|
+
id: "2467502931"
|
|
1204
|
+
}, ".icon.jsx-2467502931{position:absolute;left:var(--helpdice-ui-button-icon-padding);right:auto;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--helpdice-ui-button-color);z-index:1;}.right.jsx-2467502931{right:var(--helpdice-ui-button-icon-padding);left:auto;}.icon.jsx-2467502931 svg{background:transparent;height:calc(var(--helpdice-ui-button-height) / 2.35);width:calc(var(--helpdice-ui-button-height) / 2.35);}.single.jsx-2467502931{position:static;-webkit-transform:none;-ms-transform:none;transform:none;}"));
|
|
1205
|
+
};
|
|
1206
|
+
ButtonIcon.displayName = 'ButtonIcon';
|
|
1207
|
+
|
|
1208
|
+
var getButtonChildrenWithIcon = function getButtonChildrenWithIcon(auto, children, icons) {
|
|
1209
|
+
var icon = icons.icon,
|
|
1210
|
+
iconRight = icons.iconRight;
|
|
1211
|
+
var hasIcon = icon || iconRight;
|
|
1212
|
+
var isRight = Boolean(iconRight);
|
|
1213
|
+
var paddingForAutoMode = auto ? "calc(var(--helpdice-ui-button-height) / 2 + var(--helpdice-ui-button-icon-padding) * .5)" : 0;
|
|
1214
|
+
var classes = theme.useClasses('text', isRight ? 'right' : 'left');
|
|
1215
|
+
if (!hasIcon) return /*#__PURE__*/React.createElement("div", {
|
|
1216
|
+
className: "text"
|
|
1217
|
+
}, children);
|
|
1218
|
+
if (React.Children.count(children) === 0) {
|
|
1219
|
+
return /*#__PURE__*/React.createElement(ButtonIcon, {
|
|
1220
|
+
isRight: isRight,
|
|
1221
|
+
isSingle: true
|
|
1222
|
+
}, hasIcon);
|
|
1223
|
+
}
|
|
1224
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ButtonIcon, {
|
|
1225
|
+
isRight: isRight
|
|
1226
|
+
}, hasIcon), /*#__PURE__*/React.createElement("div", {
|
|
1227
|
+
className: _JSXStyle.dynamic([["3568181479", [paddingForAutoMode, paddingForAutoMode]]]) + " " + (classes || "")
|
|
1228
|
+
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1229
|
+
id: "3568181479",
|
|
1230
|
+
dynamic: [paddingForAutoMode, paddingForAutoMode]
|
|
1231
|
+
}, ".left.__jsx-style-dynamic-selector{padding-left:".concat(paddingForAutoMode, ";}.right.__jsx-style-dynamic-selector{padding-right:").concat(paddingForAutoMode, ";}"))));
|
|
1232
|
+
};
|
|
1233
|
+
var filterPropsWithGroup = function filterPropsWithGroup(props, config) {
|
|
1234
|
+
if (!config.isButtonGroup) return props;
|
|
1235
|
+
return _objectSpread2(_objectSpread2({}, props), {}, {
|
|
1236
|
+
auto: true,
|
|
1237
|
+
shadow: false,
|
|
1238
|
+
ghost: config.ghost || props.ghost,
|
|
1239
|
+
type: config.type || props.type,
|
|
1240
|
+
disabled: config.disabled || props.disabled
|
|
1241
|
+
});
|
|
1242
|
+
};
|
|
1243
|
+
|
|
1244
|
+
/* "use client" */
|
|
1245
|
+
|
|
1246
|
+
var defaultContext$1 = {
|
|
1247
|
+
isButtonGroup: false,
|
|
1248
|
+
disabled: false
|
|
1249
|
+
};
|
|
1250
|
+
var ButtonGroupContext = /*#__PURE__*/React.createContext(defaultContext$1);
|
|
1251
|
+
var useButtonGroupContext = function useButtonGroupContext() {
|
|
1252
|
+
return React.useContext(ButtonGroupContext);
|
|
1253
|
+
};
|
|
1254
|
+
|
|
1255
|
+
var hexToRgb = function hexToRgb(color) {
|
|
1256
|
+
var fullReg = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
|
1257
|
+
var full = color.replace(fullReg, function (_, r, g, b) {
|
|
1258
|
+
return "".concat(r).concat(r).concat(g).concat(g).concat(b).concat(b);
|
|
1259
|
+
});
|
|
1260
|
+
var values = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(full);
|
|
1261
|
+
if (!values) {
|
|
1262
|
+
throw new Error("Helpdice UI: Unsupported ".concat(color, " color."));
|
|
1263
|
+
}
|
|
1264
|
+
return [Number.parseInt(values[1], 16), Number.parseInt(values[2], 16), Number.parseInt(values[3], 16)];
|
|
1265
|
+
};
|
|
1266
|
+
var colorToRgbValues = function colorToRgbValues(color) {
|
|
1267
|
+
if (color.charAt(0) === '#') return hexToRgb(color);
|
|
1268
|
+
var safeColor = color.replace(/ /g, '');
|
|
1269
|
+
var colorType = color.substr(0, 4);
|
|
1270
|
+
var regArray = safeColor.match(/\((.+)\)/);
|
|
1271
|
+
if (!colorType.startsWith('rgb') || !regArray) {
|
|
1272
|
+
console.log(color);
|
|
1273
|
+
throw new Error("Helpdice UI: Only support [\"RGB\", \"RGBA\", \"HEX\"] color.");
|
|
1274
|
+
}
|
|
1275
|
+
return regArray[1].split(',').map(function (str) {
|
|
1276
|
+
return Number.parseFloat(str);
|
|
1277
|
+
});
|
|
1278
|
+
};
|
|
1279
|
+
var addColorAlpha = function addColorAlpha(color, alpha) {
|
|
1280
|
+
if (!/^#|rgb|RGB/.test(color)) return color;
|
|
1281
|
+
var _colorToRgbValues = colorToRgbValues(color),
|
|
1282
|
+
_colorToRgbValues2 = _slicedToArray(_colorToRgbValues, 3),
|
|
1283
|
+
r = _colorToRgbValues2[0],
|
|
1284
|
+
g = _colorToRgbValues2[1],
|
|
1285
|
+
b = _colorToRgbValues2[2];
|
|
1286
|
+
var safeAlpha = alpha > 1 ? 1 : alpha < 0 ? 0 : alpha;
|
|
1287
|
+
return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(safeAlpha, ")");
|
|
1288
|
+
};
|
|
1289
|
+
|
|
1290
|
+
var getButtonGhostColors = function getButtonGhostColors(palette, _color) {
|
|
1291
|
+
var colors = {
|
|
1292
|
+
secondary: {
|
|
1293
|
+
bg: palette.background,
|
|
1294
|
+
border: palette.foreground,
|
|
1295
|
+
color: palette.foreground,
|
|
1296
|
+
ripple: ''
|
|
1297
|
+
},
|
|
1298
|
+
success: {
|
|
1299
|
+
bg: palette.background,
|
|
1300
|
+
border: palette.success,
|
|
1301
|
+
color: palette.success,
|
|
1302
|
+
ripple: ''
|
|
1303
|
+
},
|
|
1304
|
+
warning: {
|
|
1305
|
+
bg: palette.background,
|
|
1306
|
+
border: palette.warning,
|
|
1307
|
+
color: palette.warning,
|
|
1308
|
+
ripple: ''
|
|
1309
|
+
},
|
|
1310
|
+
error: {
|
|
1311
|
+
bg: palette.background,
|
|
1312
|
+
border: palette.error,
|
|
1313
|
+
color: palette.error,
|
|
1314
|
+
ripple: ''
|
|
1315
|
+
}
|
|
1316
|
+
};
|
|
1317
|
+
return colors[_color] || null;
|
|
1318
|
+
};
|
|
1319
|
+
var getButtonColors = function getButtonColors(palette, props) {
|
|
1320
|
+
var color = props.color,
|
|
1321
|
+
disabled = props.disabled,
|
|
1322
|
+
ghost = props.ghost;
|
|
1323
|
+
var colors = {
|
|
1324
|
+
"default": {
|
|
1325
|
+
bg: palette.background,
|
|
1326
|
+
border: palette.border,
|
|
1327
|
+
color: palette.accents_5,
|
|
1328
|
+
ripple: palette.accents_1
|
|
1329
|
+
},
|
|
1330
|
+
secondary: {
|
|
1331
|
+
bg: palette.foreground,
|
|
1332
|
+
border: palette.foreground,
|
|
1333
|
+
color: palette.background,
|
|
1334
|
+
ripple: palette.accents_1
|
|
1335
|
+
},
|
|
1336
|
+
success: {
|
|
1337
|
+
bg: palette.success,
|
|
1338
|
+
border: palette.success,
|
|
1339
|
+
color: '#fff',
|
|
1340
|
+
ripple: '#1f93ffff'
|
|
1341
|
+
},
|
|
1342
|
+
warning: {
|
|
1343
|
+
bg: palette.warning,
|
|
1344
|
+
border: palette.warning,
|
|
1345
|
+
color: '#fff',
|
|
1346
|
+
ripple: '#ffca29ff'
|
|
1347
|
+
},
|
|
1348
|
+
error: {
|
|
1349
|
+
bg: palette.error,
|
|
1350
|
+
border: palette.error,
|
|
1351
|
+
color: '#fff',
|
|
1352
|
+
ripple: '#ff5a55ff'
|
|
1353
|
+
},
|
|
1354
|
+
abort: {
|
|
1355
|
+
bg: 'transparent',
|
|
1356
|
+
border: 'transparent',
|
|
1357
|
+
color: palette.accents_5,
|
|
1358
|
+
ripple: palette.accents_1
|
|
1359
|
+
}
|
|
1360
|
+
};
|
|
1361
|
+
if (disabled) return {
|
|
1362
|
+
bg: palette.accents_1,
|
|
1363
|
+
border: palette.accents_2,
|
|
1364
|
+
color: '#ccc',
|
|
1365
|
+
ripple: ''
|
|
1366
|
+
};
|
|
1367
|
+
|
|
1368
|
+
/**
|
|
1369
|
+
* The '-light' type is the same color as the common type,
|
|
1370
|
+
* only hover's color is different.
|
|
1371
|
+
* e.g.
|
|
1372
|
+
* Color['success'] === Color['success-light']
|
|
1373
|
+
* Color['warning'] === Color['warning-light']
|
|
1374
|
+
*/
|
|
1375
|
+
var withoutLightType = color === null || color === void 0 ? void 0 : color.replace('-light', '');
|
|
1376
|
+
var defaultColor = colors["default"];
|
|
1377
|
+
if (ghost) return getButtonGhostColors(palette, withoutLightType) || defaultColor;
|
|
1378
|
+
return colors[withoutLightType] || defaultColor;
|
|
1379
|
+
};
|
|
1380
|
+
var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette, _color) {
|
|
1381
|
+
var colors = {
|
|
1382
|
+
secondary: {
|
|
1383
|
+
bg: palette.foreground,
|
|
1384
|
+
border: palette.background,
|
|
1385
|
+
color: palette.background
|
|
1386
|
+
},
|
|
1387
|
+
success: {
|
|
1388
|
+
bg: palette.success,
|
|
1389
|
+
border: palette.background,
|
|
1390
|
+
color: 'white'
|
|
1391
|
+
},
|
|
1392
|
+
warning: {
|
|
1393
|
+
bg: palette.warning,
|
|
1394
|
+
border: palette.background,
|
|
1395
|
+
color: 'white'
|
|
1396
|
+
},
|
|
1397
|
+
error: {
|
|
1398
|
+
bg: palette.error,
|
|
1399
|
+
border: palette.background,
|
|
1400
|
+
color: 'white'
|
|
1401
|
+
}
|
|
1402
|
+
};
|
|
1403
|
+
var withoutLightType = _color === null || _color === void 0 ? void 0 : _color.replace('-light', '');
|
|
1404
|
+
return colors[withoutLightType] || null;
|
|
1405
|
+
};
|
|
1406
|
+
var getButtonHoverColors = function getButtonHoverColors(palette, props) {
|
|
1407
|
+
var color = props.color,
|
|
1408
|
+
disabled = props.disabled,
|
|
1409
|
+
loading = props.loading,
|
|
1410
|
+
shadow = props.shadow,
|
|
1411
|
+
ghost = props.ghost;
|
|
1412
|
+
var defaultColor = getButtonColors(palette, props);
|
|
1413
|
+
var alphaBackground = addColorAlpha(defaultColor.bg, 0.85);
|
|
1414
|
+
var colors = {
|
|
1415
|
+
"default": {
|
|
1416
|
+
bg: palette.background,
|
|
1417
|
+
border: palette.foreground
|
|
1418
|
+
},
|
|
1419
|
+
secondary: {
|
|
1420
|
+
bg: palette.background,
|
|
1421
|
+
border: palette.foreground
|
|
1422
|
+
},
|
|
1423
|
+
success: {
|
|
1424
|
+
bg: palette.background,
|
|
1425
|
+
border: palette.success
|
|
1426
|
+
},
|
|
1427
|
+
warning: {
|
|
1428
|
+
bg: palette.background,
|
|
1429
|
+
border: palette.warning
|
|
1430
|
+
},
|
|
1431
|
+
error: {
|
|
1432
|
+
bg: palette.background,
|
|
1433
|
+
border: palette.error
|
|
1434
|
+
},
|
|
1435
|
+
abort: {
|
|
1436
|
+
bg: 'transparent',
|
|
1437
|
+
border: 'transparent',
|
|
1438
|
+
color: palette.accents_5
|
|
1439
|
+
},
|
|
1440
|
+
'secondary-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
1441
|
+
bg: alphaBackground
|
|
1442
|
+
}),
|
|
1443
|
+
'success-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
1444
|
+
bg: alphaBackground
|
|
1445
|
+
}),
|
|
1446
|
+
'warning-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
1447
|
+
bg: alphaBackground
|
|
1448
|
+
}),
|
|
1449
|
+
'error-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
1450
|
+
bg: alphaBackground
|
|
1451
|
+
})
|
|
1452
|
+
};
|
|
1453
|
+
if (disabled) return {
|
|
1454
|
+
bg: palette.accents_1,
|
|
1455
|
+
border: palette.accents_2,
|
|
1456
|
+
color: '#ccc'
|
|
1457
|
+
};
|
|
1458
|
+
if (loading) return _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
1459
|
+
color: 'transparent'
|
|
1460
|
+
});
|
|
1461
|
+
if (shadow) return defaultColor;
|
|
1462
|
+
var hoverColor = (ghost ? getButtonGhostHoverColors(palette, color) : colors[color]) || colors["default"];
|
|
1463
|
+
return _objectSpread2(_objectSpread2({}, hoverColor), {}, {
|
|
1464
|
+
color: hoverColor.color || hoverColor.border
|
|
1465
|
+
});
|
|
1466
|
+
};
|
|
1467
|
+
var getButtonCursor = function getButtonCursor(disabled, loading) {
|
|
1468
|
+
if (disabled) return {
|
|
1469
|
+
cursor: 'not-allowed',
|
|
1470
|
+
events: 'auto'
|
|
1471
|
+
};
|
|
1472
|
+
if (loading) return {
|
|
1473
|
+
cursor: 'default',
|
|
1474
|
+
events: 'none'
|
|
1475
|
+
};
|
|
1476
|
+
return {
|
|
1477
|
+
cursor: 'pointer',
|
|
1478
|
+
events: 'auto'
|
|
1479
|
+
};
|
|
1480
|
+
};
|
|
1481
|
+
var getButtonDripColor = function getButtonDripColor(palette, props) {
|
|
1482
|
+
var type = props.type;
|
|
1483
|
+
var isLightHover = type ? type.endsWith('light') : false;
|
|
1484
|
+
var hoverColors = getButtonHoverColors(palette, props);
|
|
1485
|
+
return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
|
|
1486
|
+
};
|
|
1487
|
+
|
|
1488
|
+
var _excluded$6 = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "relative", "replace", "a", "to", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
|
|
1489
|
+
var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
1490
|
+
var theme$1 = theme.useTheme();
|
|
1491
|
+
// const navigate = useNavigate();
|
|
1492
|
+
var _useScale = useScale(),
|
|
1493
|
+
SCALES = _useScale.SCALES;
|
|
1494
|
+
var buttonRef = React.useRef(null);
|
|
1495
|
+
React.useImperativeHandle(ref, function () {
|
|
1496
|
+
return buttonRef.current;
|
|
1497
|
+
}); // Changed with !
|
|
1498
|
+
|
|
1499
|
+
var _useState = React.useState(false),
|
|
1500
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1501
|
+
dripShow = _useState2[0],
|
|
1502
|
+
setDripShow = _useState2[1];
|
|
1503
|
+
var _useState3 = React.useState(0),
|
|
1504
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
1505
|
+
dripX = _useState4[0],
|
|
1506
|
+
setDripX = _useState4[1];
|
|
1507
|
+
var _useState5 = React.useState(0),
|
|
1508
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
1509
|
+
dripY = _useState6[0],
|
|
1510
|
+
setDripY = _useState6[1];
|
|
1511
|
+
var groupConfig = useButtonGroupContext();
|
|
1512
|
+
var filteredProps = filterPropsWithGroup(btnProps, groupConfig);
|
|
1513
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
1514
|
+
var children = filteredProps.children,
|
|
1515
|
+
_filteredProps$disabl = filteredProps.disabled,
|
|
1516
|
+
disabled = _filteredProps$disabl === void 0 ? false : _filteredProps$disabl;
|
|
1517
|
+
filteredProps.color;
|
|
1518
|
+
var _filteredProps$loadin = filteredProps.loading,
|
|
1519
|
+
loading = _filteredProps$loadin === void 0 ? false : _filteredProps$loadin,
|
|
1520
|
+
_filteredProps$shadow = filteredProps.shadow,
|
|
1521
|
+
shadow = _filteredProps$shadow === void 0 ? false : _filteredProps$shadow,
|
|
1522
|
+
_filteredProps$ghost = filteredProps.ghost,
|
|
1523
|
+
ghost = _filteredProps$ghost === void 0 ? false : _filteredProps$ghost,
|
|
1524
|
+
_filteredProps$effect = filteredProps.effect,
|
|
1525
|
+
effect = _filteredProps$effect === void 0 ? true : _filteredProps$effect,
|
|
1526
|
+
_filteredProps$round = filteredProps.round,
|
|
1527
|
+
round = _filteredProps$round === void 0 ? false : _filteredProps$round;
|
|
1528
|
+
filteredProps.relative;
|
|
1529
|
+
filteredProps.replace;
|
|
1530
|
+
filteredProps.a;
|
|
1531
|
+
var to = filteredProps.to,
|
|
1532
|
+
onClick = filteredProps.onClick,
|
|
1533
|
+
_filteredProps$auto = filteredProps.auto,
|
|
1534
|
+
auto = _filteredProps$auto === void 0 ? false : _filteredProps$auto,
|
|
1535
|
+
icon = filteredProps.icon,
|
|
1536
|
+
_filteredProps$type = filteredProps.type,
|
|
1537
|
+
type = _filteredProps$type === void 0 ? 'button' : _filteredProps$type,
|
|
1538
|
+
iconRight = filteredProps.iconRight,
|
|
1539
|
+
_filteredProps$classN = filteredProps.className,
|
|
1540
|
+
className = _filteredProps$classN === void 0 ? '' : _filteredProps$classN;
|
|
1541
|
+
filteredProps.crossOrigin;
|
|
1542
|
+
var props = _objectWithoutProperties(filteredProps, _excluded$6);
|
|
1543
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
1544
|
+
|
|
1545
|
+
var _useMemo = React.useMemo(function () {
|
|
1546
|
+
return getButtonColors(theme$1.palette, filteredProps);
|
|
1547
|
+
}, [theme$1.palette, filteredProps]),
|
|
1548
|
+
bg = _useMemo.bg,
|
|
1549
|
+
border = _useMemo.border,
|
|
1550
|
+
color = _useMemo.color,
|
|
1551
|
+
rippleColor = _useMemo.ripple;
|
|
1552
|
+
var hover = React.useMemo(function () {
|
|
1553
|
+
return getButtonHoverColors(theme$1.palette, filteredProps);
|
|
1554
|
+
}, [theme$1.palette, filteredProps]);
|
|
1555
|
+
var _useMemo2 = React.useMemo(function () {
|
|
1556
|
+
return getButtonCursor(disabled, loading);
|
|
1557
|
+
}, [disabled, loading]),
|
|
1558
|
+
cursor = _useMemo2.cursor,
|
|
1559
|
+
events = _useMemo2.events;
|
|
1560
|
+
var dripColor = React.useMemo(function () {
|
|
1561
|
+
return getButtonDripColor(theme$1.palette, filteredProps);
|
|
1562
|
+
}, [theme$1.palette, filteredProps]);
|
|
1563
|
+
|
|
1564
|
+
/* istanbul ignore next */
|
|
1565
|
+
var dripCompletedHandle = function dripCompletedHandle() {
|
|
1566
|
+
setDripShow(false);
|
|
1567
|
+
setDripX(0);
|
|
1568
|
+
setDripY(0);
|
|
1569
|
+
};
|
|
1570
|
+
var createRipple = function createRipple(event) {
|
|
1571
|
+
var button = buttonRef.current;
|
|
1572
|
+
if (!button) return;
|
|
1573
|
+
var rect = button.getBoundingClientRect();
|
|
1574
|
+
var size = Math.max(rect.width, rect.height);
|
|
1575
|
+
var x = event.clientX - rect.left - size / 2;
|
|
1576
|
+
var y = event.clientY - rect.top - size / 2;
|
|
1577
|
+
var rippleCount = 1; // number of rings
|
|
1578
|
+
var rippleDelay = 500; // ms between each ripple
|
|
1579
|
+
var _loop = function _loop() {
|
|
1580
|
+
var ripple = document.createElement('span');
|
|
1581
|
+
Object.assign(ripple.style, {
|
|
1582
|
+
position: 'absolute',
|
|
1583
|
+
borderRadius: '50%',
|
|
1584
|
+
backgroundColor: rippleColor,
|
|
1585
|
+
width: "".concat(size, "px"),
|
|
1586
|
+
height: "".concat(size, "px"),
|
|
1587
|
+
left: "".concat(x, "px"),
|
|
1588
|
+
top: "".concat(y, "px"),
|
|
1589
|
+
pointerEvents: 'none',
|
|
1590
|
+
transform: 'scale(0)',
|
|
1591
|
+
opacity: '1',
|
|
1592
|
+
transition: "transform 600ms ease-out ".concat(i * rippleDelay, "ms, opacity 600ms ease-out ").concat(i * rippleDelay, "ms"),
|
|
1593
|
+
zIndex: 1
|
|
1594
|
+
});
|
|
1595
|
+
button.appendChild(ripple);
|
|
1596
|
+
|
|
1597
|
+
// Force reflow to start transition
|
|
1598
|
+
window.getComputedStyle(ripple).opacity;
|
|
1599
|
+
ripple.style.transform = 'scale(2.5)';
|
|
1600
|
+
ripple.style.opacity = '0';
|
|
1601
|
+
ripple.addEventListener('transitionend', function () {
|
|
1602
|
+
ripple.remove();
|
|
1603
|
+
});
|
|
1604
|
+
};
|
|
1605
|
+
for (var i = 0; i < rippleCount; i++) {
|
|
1606
|
+
_loop();
|
|
1607
|
+
}
|
|
1608
|
+
};
|
|
1609
|
+
var clickHandler = function clickHandler(event) {
|
|
1610
|
+
if (disabled || loading) return;
|
|
1611
|
+
var showDrip = !shadow && !ghost && effect;
|
|
1612
|
+
/* istanbul ignore next */
|
|
1613
|
+
if (showDrip && buttonRef.current) {
|
|
1614
|
+
var rect = buttonRef.current.getBoundingClientRect();
|
|
1615
|
+
setDripShow(true);
|
|
1616
|
+
setDripX(event.clientX - rect.left);
|
|
1617
|
+
setDripY(event.clientY - rect.top);
|
|
1618
|
+
}
|
|
1619
|
+
if (shadow) {
|
|
1620
|
+
createRipple(event);
|
|
1621
|
+
}
|
|
1622
|
+
onClick && onClick(event);
|
|
1623
|
+
};
|
|
1624
|
+
var childrenWithIcon = React.useMemo(function () {
|
|
1625
|
+
return getButtonChildrenWithIcon(auto, children, {
|
|
1626
|
+
icon: icon,
|
|
1627
|
+
iconRight: iconRight
|
|
1628
|
+
});
|
|
1629
|
+
}, [auto, children, icon, iconRight]);
|
|
1630
|
+
var paddingLeft = auto ? SCALES.pl(1.15) : SCALES.pl(1.375),
|
|
1631
|
+
paddingRight = auto ? SCALES.pr(1.15) : SCALES.pr(1.375);
|
|
1632
|
+
|
|
1633
|
+
// If shadow provided is string then value other default
|
|
1634
|
+
var btnShadow = typeof shadow === 'string' ? shadow : shadow ? theme$1.shadows.level.z2 : 'none';
|
|
1635
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, to ? /*#__PURE__*/React.createElement("a", _extends({
|
|
1636
|
+
href: to
|
|
1637
|
+
}, props, {
|
|
1638
|
+
className: _JSXStyle.dynamic([["331518307", [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, shadow ? 'transparent' : border, cursor !== null && cursor !== void 0 ? cursor : 'pointer', events, shadow ? btnShadow : 'none', SCALES.pl(0.727), SCALES.height(2.5), color, bg, auto ? 'min-content' : SCALES.width(10.5), auto ? 'auto' : 'initial', SCALES.height(2.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hover.color, hover.color, hover.bg, hover.border, cursor, events, btnShadow, shadow ? '-1px' : '0px']]]) + " " + (props && props.className != null && props.className || theme.useClasses('btn', 'btn-link', className) || "")
|
|
1639
|
+
}), loading && /*#__PURE__*/React.createElement(ButtonLoading, {
|
|
1640
|
+
color: color
|
|
1641
|
+
}), childrenWithIcon) : /*#__PURE__*/React.createElement("button", _extends({
|
|
1642
|
+
ref: buttonRef,
|
|
1643
|
+
type: type,
|
|
1644
|
+
disabled: disabled,
|
|
1645
|
+
onClick: clickHandler
|
|
1646
|
+
}, props, {
|
|
1647
|
+
className: _JSXStyle.dynamic([["331518307", [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, shadow ? 'transparent' : border, cursor !== null && cursor !== void 0 ? cursor : 'pointer', events, shadow ? btnShadow : 'none', SCALES.pl(0.727), SCALES.height(2.5), color, bg, auto ? 'min-content' : SCALES.width(10.5), auto ? 'auto' : 'initial', SCALES.height(2.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hover.color, hover.color, hover.bg, hover.border, cursor, events, btnShadow, shadow ? '-1px' : '0px']]]) + " " + (props && props.className != null && props.className || theme.useClasses('btn', className) || "")
|
|
1648
|
+
}), loading && /*#__PURE__*/React.createElement(ButtonLoading, {
|
|
1649
|
+
color: color
|
|
1650
|
+
}), childrenWithIcon, dripShow && /*#__PURE__*/React.createElement(ButtonDrip, {
|
|
1651
|
+
x: dripX,
|
|
1652
|
+
y: dripY,
|
|
1653
|
+
color: dripColor,
|
|
1654
|
+
onCompleted: dripCompletedHandle
|
|
1655
|
+
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1656
|
+
id: "331518307",
|
|
1657
|
+
dynamic: [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, shadow ? 'transparent' : border, cursor !== null && cursor !== void 0 ? cursor : 'pointer', events, shadow ? btnShadow : 'none', SCALES.pl(0.727), SCALES.height(2.5), color, bg, auto ? 'min-content' : SCALES.width(10.5), auto ? 'auto' : 'initial', SCALES.height(2.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hover.color, hover.color, hover.bg, hover.border, cursor, events, btnShadow, shadow ? '-1px' : '0px']
|
|
1658
|
+
}, ".btn.__jsx-style-dynamic-selector{box-sizing:border-box;display:inline-block;line-height:".concat(SCALES.height(2.5), ";border-radius:").concat(round ? '50%' : theme$1.layout.radius, ";font-weight:400;font-size:").concat(SCALES.font(0.875), ";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;text-transform:capitalize;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center;white-space:nowrap;-webkit-transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;position:relative;overflow:hidden;color:").concat(color, ";background-color:").concat(bg, ";border:1px solid ").concat(shadow ? 'transparent' : border, ";cursor:").concat(cursor !== null && cursor !== void 0 ? cursor : 'pointer', ";pointer-events:").concat(events, ";box-shadow:").concat(shadow ? btnShadow : 'none', ";--helpdice-ui-button-icon-padding:").concat(SCALES.pl(0.727), ";--helpdice-ui-button-height:").concat(SCALES.height(2.5), ";--helpdice-ui-button-color:").concat(color, ";--helpdice-ui-button-bg:").concat(bg, ";min-width:").concat(auto ? 'min-content' : SCALES.width(10.5), ";width:").concat(auto ? 'auto' : 'initial', ";height:").concat(SCALES.height(2.5), ";padding:").concat(SCALES.pt(0), " ").concat(paddingRight, " ").concat(SCALES.pb(0), " ").concat(paddingLeft, ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.btn.__jsx-style-dynamic-selector:hover,.btn.__jsx-style-dynamic-selector:focus{color:").concat(hover.color, ";--helpdice-ui-button-color:").concat(hover.color, ";background-color:").concat(hover.bg, ";border-color:").concat(hover.border, ";cursor:").concat(cursor, ";pointer-events:").concat(events, ";box-shadow:").concat(btnShadow, ";}.btn-link.__jsx-style-dynamic-selector{display:-webkit-box !important;display:-webkit-flex !important;display:-ms-flexbox !important;display:flex !important;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.btn.__jsx-style-dynamic-selector .text{position:relative;z-index:1;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;text-align:center;line-height:inherit;top:-1px;}.btn.__jsx-style-dynamic-selector .text p,.btn.__jsx-style-dynamic-selector .text pre,.btn.__jsx-style-dynamic-selector .text div{margin:0;}.ripple.__jsx-style-dynamic-selector{position:absolute;border-radius:50%;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);-webkit-animation:ripple-animation-__jsx-style-dynamic-selector 600ms ease-out;animation:ripple-animation-__jsx-style-dynamic-selector 600ms ease-out;background-color:rgba(0,0,0,0.3);pointer-events:none;z-index:1;}@-webkit-keyframes ripple-animation-__jsx-style-dynamic-selector{to{-webkit-transform:scale(2.5);-ms-transform:scale(2.5);transform:scale(2.5);opacity:0;}}@keyframes ripple-animation-__jsx-style-dynamic-selector{to{-webkit-transform:scale(2.5);-ms-transform:scale(2.5);transform:scale(2.5);opacity:0;}}")));
|
|
1659
|
+
});
|
|
1660
|
+
ButtonComponent.displayName = 'Button';
|
|
1661
|
+
var Button = withScale(ButtonComponent);
|
|
1662
|
+
|
|
1663
|
+
// import { useTheme } from '@helpdice/theme';
|
|
1664
|
+
|
|
1665
|
+
var CompactButton = function CompactButton(_ref) {
|
|
1666
|
+
_ref.color;
|
|
1667
|
+
var children = _ref.children,
|
|
1668
|
+
iconRight = _ref.iconRight,
|
|
1669
|
+
icon = _ref.icon,
|
|
1670
|
+
_ref$scale = _ref.scale,
|
|
1671
|
+
scale = _ref$scale === void 0 ? 2 / 3 : _ref$scale,
|
|
1672
|
+
type = _ref.type,
|
|
1673
|
+
style = _ref.style,
|
|
1674
|
+
onClick = _ref.onClick,
|
|
1675
|
+
to = _ref.to;
|
|
1676
|
+
// const theme = useTheme();
|
|
1677
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
1678
|
+
to: to,
|
|
1679
|
+
icon: icon,
|
|
1680
|
+
style: style,
|
|
1681
|
+
type: type,
|
|
1682
|
+
onClick: onClick,
|
|
1683
|
+
auto: true,
|
|
1684
|
+
scale: scale,
|
|
1685
|
+
px: 0.6,
|
|
1686
|
+
iconRight: iconRight
|
|
1687
|
+
}, children);
|
|
1688
|
+
};
|
|
1689
|
+
var IconButton = /*#__PURE__*/React.memo(CompactButton);
|
|
1690
|
+
|
|
1691
|
+
// import { useTheme } from '@helpdice/theme';
|
|
1692
|
+
|
|
1693
|
+
var SmallButton = function SmallButton(_ref) {
|
|
1694
|
+
_ref.color;
|
|
1695
|
+
var children = _ref.children,
|
|
1696
|
+
iconRight = _ref.iconRight,
|
|
1697
|
+
icon = _ref.icon,
|
|
1698
|
+
_ref$scale = _ref.scale,
|
|
1699
|
+
scale = _ref$scale === void 0 ? 2 / 3 : _ref$scale,
|
|
1700
|
+
type = _ref.type,
|
|
1701
|
+
style = _ref.style,
|
|
1702
|
+
onClick = _ref.onClick,
|
|
1703
|
+
to = _ref.to;
|
|
1704
|
+
// const theme = useTheme();
|
|
1705
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
1706
|
+
to: to,
|
|
1707
|
+
icon: icon,
|
|
1708
|
+
style: style,
|
|
1709
|
+
type: type,
|
|
1710
|
+
onClick: onClick,
|
|
1711
|
+
auto: true,
|
|
1712
|
+
scale: scale,
|
|
1713
|
+
px: 0.6,
|
|
1714
|
+
iconRight: iconRight
|
|
1715
|
+
}, children);
|
|
1716
|
+
};
|
|
1717
|
+
var SmallButton$1 = /*#__PURE__*/React.memo(SmallButton);
|
|
1718
|
+
|
|
1719
|
+
/* "use client" */
|
|
1720
|
+
|
|
1721
|
+
Button.Icon = IconButton;
|
|
1722
|
+
Button.Small = SmallButton$1;
|
|
1723
|
+
|
|
1724
|
+
var _excluded$5 = ["h1", "h2", "h3", "h4", "h5", "h6", "p", "b", "small", "i", "span", "del", "em", "blockquote", "noWrap", "collapse", "children", "className", "display", "alignItems", "justify"];
|
|
1725
|
+
var _getModifierChild = function getModifierChild(tags, children) {
|
|
1726
|
+
if (!tags.length) return children;
|
|
1727
|
+
var nextTag = tags.slice(1, tags.length);
|
|
1728
|
+
return /*#__PURE__*/React.createElement(TextChild, {
|
|
1729
|
+
tag: tags[0]
|
|
1730
|
+
}, _getModifierChild(nextTag, children));
|
|
1731
|
+
};
|
|
1732
|
+
var TextComponent = function TextComponent(_ref) {
|
|
1733
|
+
var _ref$h = _ref.h1,
|
|
1734
|
+
h1 = _ref$h === void 0 ? false : _ref$h,
|
|
1735
|
+
_ref$h2 = _ref.h2,
|
|
1736
|
+
h2 = _ref$h2 === void 0 ? false : _ref$h2,
|
|
1737
|
+
_ref$h3 = _ref.h3,
|
|
1738
|
+
h3 = _ref$h3 === void 0 ? false : _ref$h3,
|
|
1739
|
+
_ref$h4 = _ref.h4,
|
|
1740
|
+
h4 = _ref$h4 === void 0 ? false : _ref$h4,
|
|
1741
|
+
_ref$h5 = _ref.h5,
|
|
1742
|
+
h5 = _ref$h5 === void 0 ? false : _ref$h5,
|
|
1743
|
+
_ref$h6 = _ref.h6,
|
|
1744
|
+
h6 = _ref$h6 === void 0 ? false : _ref$h6,
|
|
1745
|
+
_ref$p = _ref.p,
|
|
1746
|
+
p = _ref$p === void 0 ? false : _ref$p,
|
|
1747
|
+
_ref$b = _ref.b,
|
|
1748
|
+
b = _ref$b === void 0 ? false : _ref$b,
|
|
1749
|
+
_ref$small = _ref.small,
|
|
1750
|
+
small = _ref$small === void 0 ? false : _ref$small,
|
|
1751
|
+
_ref$i = _ref.i,
|
|
1752
|
+
i = _ref$i === void 0 ? false : _ref$i,
|
|
1753
|
+
_ref$span = _ref.span,
|
|
1754
|
+
span = _ref$span === void 0 ? false : _ref$span,
|
|
1755
|
+
_ref$del = _ref.del,
|
|
1756
|
+
del = _ref$del === void 0 ? false : _ref$del,
|
|
1757
|
+
_ref$em = _ref.em,
|
|
1758
|
+
em = _ref$em === void 0 ? false : _ref$em,
|
|
1759
|
+
_ref$blockquote = _ref.blockquote,
|
|
1760
|
+
blockquote = _ref$blockquote === void 0 ? false : _ref$blockquote,
|
|
1761
|
+
_ref$noWrap = _ref.noWrap,
|
|
1762
|
+
noWrap = _ref$noWrap === void 0 ? false : _ref$noWrap,
|
|
1763
|
+
_ref$collapse = _ref.collapse,
|
|
1764
|
+
collapse = _ref$collapse === void 0 ? 0 : _ref$collapse,
|
|
1765
|
+
children = _ref.children,
|
|
1766
|
+
_ref$className = _ref.className,
|
|
1767
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1768
|
+
_ref$display = _ref.display,
|
|
1769
|
+
display = _ref$display === void 0 ? 'block' : _ref$display,
|
|
1770
|
+
alignItems = _ref.alignItems,
|
|
1771
|
+
justify = _ref.justify,
|
|
1772
|
+
props = _objectWithoutProperties(_ref, _excluded$5);
|
|
1773
|
+
var elements = {
|
|
1774
|
+
h1: h1,
|
|
1775
|
+
h2: h2,
|
|
1776
|
+
h3: h3,
|
|
1777
|
+
h4: h4,
|
|
1778
|
+
h5: h5,
|
|
1779
|
+
h6: h6,
|
|
1780
|
+
p: p,
|
|
1781
|
+
blockquote: blockquote
|
|
1782
|
+
};
|
|
1783
|
+
var inlineElements = {
|
|
1784
|
+
span: span,
|
|
1785
|
+
small: small,
|
|
1786
|
+
b: b,
|
|
1787
|
+
em: em,
|
|
1788
|
+
i: i,
|
|
1789
|
+
del: del
|
|
1790
|
+
};
|
|
1791
|
+
var names = Object.keys(elements).filter(function (name) {
|
|
1792
|
+
return elements[name];
|
|
1793
|
+
});
|
|
1794
|
+
var inlineNames = Object.keys(inlineElements).filter(function (name) {
|
|
1795
|
+
return inlineElements[name];
|
|
1796
|
+
});
|
|
1797
|
+
|
|
1798
|
+
/**
|
|
1799
|
+
* Render element "p" only if no element is found.
|
|
1800
|
+
* If there is only one modifier, just rendered one modifier element
|
|
1801
|
+
* e.g.
|
|
1802
|
+
* <Text /> => <p />
|
|
1803
|
+
* <Text em /> => <em />
|
|
1804
|
+
* <Text p em /> => <p><em>children</em></p>
|
|
1805
|
+
*
|
|
1806
|
+
*/
|
|
1807
|
+
|
|
1808
|
+
var _useState = React.useState(false),
|
|
1809
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1810
|
+
expand = _useState2[0],
|
|
1811
|
+
setExpand = _useState2[1];
|
|
1812
|
+
var tag = React.useMemo(function () {
|
|
1813
|
+
if (names[0]) return names[0];
|
|
1814
|
+
if (inlineNames[0]) return inlineNames[0];
|
|
1815
|
+
return 'p';
|
|
1816
|
+
}, [names, inlineNames]);
|
|
1817
|
+
var renderableChildElements = inlineNames.filter(function (name) {
|
|
1818
|
+
return name !== tag;
|
|
1819
|
+
});
|
|
1820
|
+
var modifers = React.useMemo(function () {
|
|
1821
|
+
if (!renderableChildElements.length) return children;
|
|
1822
|
+
return _getModifierChild(renderableChildElements, children);
|
|
1823
|
+
}, [renderableChildElements, children]);
|
|
1824
|
+
return /*#__PURE__*/React.createElement(TextChild, _extends({
|
|
1825
|
+
style: {
|
|
1826
|
+
textAlign: props.align,
|
|
1827
|
+
display: display,
|
|
1828
|
+
alignItems: alignItems,
|
|
1829
|
+
justifyContent: justify
|
|
1830
|
+
},
|
|
1831
|
+
className: "".concat(className, " ").concat(noWrap ? 'no-wrap' : ''),
|
|
1832
|
+
tag: tag
|
|
1833
|
+
}, props), typeof children === 'string' && collapse > 50 ? /*#__PURE__*/React.createElement(React.Fragment, null, expand ? modifers : (modifers === null || modifers === void 0 ? void 0 : modifers.toString().substring(0, collapse)) + '...', /*#__PURE__*/React.createElement(Button, {
|
|
1834
|
+
margin: 0,
|
|
1835
|
+
onClick: function onClick() {
|
|
1836
|
+
return setExpand(!expand);
|
|
1837
|
+
},
|
|
1838
|
+
style: {
|
|
1839
|
+
textTransform: 'lowercase'
|
|
1840
|
+
},
|
|
1841
|
+
effect: false,
|
|
1842
|
+
color: "abort",
|
|
1843
|
+
scale: 2 / 3,
|
|
1844
|
+
px: 0.2,
|
|
1845
|
+
py: 0,
|
|
1846
|
+
auto: true
|
|
1847
|
+
}, /*#__PURE__*/React.createElement("b", null, expand ? 'less' : 'more'))) : modifers);
|
|
1848
|
+
};
|
|
1849
|
+
TextComponent.displayName = 'Text';
|
|
1850
|
+
var Text = withScale(TextComponent);
|
|
1851
|
+
|
|
1852
|
+
var getColors = function getColors(palette, status) {
|
|
1853
|
+
var colors = {
|
|
1854
|
+
"default": {
|
|
1855
|
+
color: palette.foreground,
|
|
1856
|
+
borderColor: palette.border,
|
|
1857
|
+
hoverBorder: palette.accents_5
|
|
1858
|
+
},
|
|
1859
|
+
secondary: {
|
|
1860
|
+
color: palette.foreground,
|
|
1861
|
+
borderColor: palette.secondary,
|
|
1862
|
+
hoverBorder: palette.secondary
|
|
1863
|
+
},
|
|
1864
|
+
success: {
|
|
1865
|
+
color: palette.foreground,
|
|
1866
|
+
borderColor: palette.successLight,
|
|
1867
|
+
hoverBorder: palette.success
|
|
1868
|
+
},
|
|
1869
|
+
warning: {
|
|
1870
|
+
color: palette.foreground,
|
|
1871
|
+
borderColor: palette.warningLight,
|
|
1872
|
+
hoverBorder: palette.warning
|
|
1873
|
+
},
|
|
1874
|
+
error: {
|
|
1875
|
+
color: palette.error,
|
|
1876
|
+
borderColor: palette.error,
|
|
1877
|
+
hoverBorder: palette.errorDark
|
|
1878
|
+
}
|
|
1879
|
+
};
|
|
1880
|
+
if (!status) return colors["default"];
|
|
1881
|
+
return colors[status];
|
|
1882
|
+
};
|
|
1883
|
+
|
|
1884
|
+
var _excluded$4 = ["label", "labelRight", "error", "color", "helperText", "type", "icon", "variant", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "onEnter", "autoComplete", "placeholder", "children", "disabled", "fullWidth"];
|
|
1042
1885
|
var simulateChangeEvent = function simulateChangeEvent(el, event) {
|
|
1043
1886
|
return _objectSpread2(_objectSpread2({}, event), {}, {
|
|
1044
1887
|
target: el,
|
|
@@ -1084,7 +1927,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1084
1927
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
1085
1928
|
_ref$fullWidth = _ref.fullWidth,
|
|
1086
1929
|
fullWidth = _ref$fullWidth === void 0 ? false : _ref$fullWidth,
|
|
1087
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1930
|
+
props = _objectWithoutProperties(_ref, _excluded$4);
|
|
1088
1931
|
var theme$1 = theme.useTheme();
|
|
1089
1932
|
var _useScale = useScale(),
|
|
1090
1933
|
SCALES = _useScale.SCALES;
|
|
@@ -1167,11 +2010,11 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1167
2010
|
var inputProps = _objectSpread2(_objectSpread2({}, props), controlledValue);
|
|
1168
2011
|
var defaultWidth = fullWidth ? '100%' : 'initial';
|
|
1169
2012
|
return /*#__PURE__*/React.createElement("div", {
|
|
1170
|
-
className: _JSXStyle.dynamic([["
|
|
2013
|
+
className: _JSXStyle.dynamic([["1343268165", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme$1.palette.accents_3, theme$1.palette.background, color]]]) + " " + "with-label"
|
|
1171
2014
|
}, children && /*#__PURE__*/React.createElement(InputBlockLabel, null, children), /*#__PURE__*/React.createElement("div", {
|
|
1172
|
-
className: _JSXStyle.dynamic([["
|
|
2015
|
+
className: _JSXStyle.dynamic([["1343268165", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme$1.palette.accents_3, theme$1.palette.background, color]]]) + " " + (theme.useClasses('input-container', className) || "")
|
|
1173
2016
|
}, label && /*#__PURE__*/React.createElement(MemoInputLabel, null, label), /*#__PURE__*/React.createElement("div", {
|
|
1174
|
-
className: _JSXStyle.dynamic([["
|
|
2017
|
+
className: _JSXStyle.dynamic([["1343268165", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme$1.palette.accents_3, theme$1.palette.background, color]]]) + " " + (theme.useClasses('input-wrapper', {
|
|
1175
2018
|
hover: hover,
|
|
1176
2019
|
disabled: disabled
|
|
1177
2020
|
}, labelClasses) || "")
|
|
@@ -1189,7 +2032,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1189
2032
|
autoComplete: autoComplete,
|
|
1190
2033
|
onKeyDown: handleKeyDown
|
|
1191
2034
|
}, inputProps, {
|
|
1192
|
-
className: _JSXStyle.dynamic([["
|
|
2035
|
+
className: _JSXStyle.dynamic([["1343268165", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme$1.palette.accents_3, theme$1.palette.background, color]]]) + " " + (inputProps && inputProps.className != null && inputProps.className || theme.useClasses({
|
|
1193
2036
|
disabled: disabled
|
|
1194
2037
|
}, iconClasses) || "")
|
|
1195
2038
|
})), clearable && /*#__PURE__*/React.createElement(MemoInputIconClear, {
|
|
@@ -1201,8 +2044,9 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1201
2044
|
}, iconProps))), labelRight && /*#__PURE__*/React.createElement(MemoInputLabel, {
|
|
1202
2045
|
isRight: true
|
|
1203
2046
|
}, labelRight), /*#__PURE__*/React.createElement("br", {
|
|
1204
|
-
className: _JSXStyle.dynamic([["
|
|
1205
|
-
})), helperText && /*#__PURE__*/React.createElement(
|
|
2047
|
+
className: _JSXStyle.dynamic([["1343268165", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme$1.palette.accents_3, theme$1.palette.background, color]]])
|
|
2048
|
+
})), helperText && /*#__PURE__*/React.createElement(Text, {
|
|
2049
|
+
font: 0.8,
|
|
1206
2050
|
style: {
|
|
1207
2051
|
marginTop: 0.4,
|
|
1208
2052
|
marginRight: 0,
|
|
@@ -1210,11 +2054,11 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1210
2054
|
marginBottom: '0.4rem',
|
|
1211
2055
|
textAlign: 'left'
|
|
1212
2056
|
},
|
|
1213
|
-
|
|
2057
|
+
color: error ? "error" : 'default'
|
|
1214
2058
|
}, "\xA0", helperText), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1215
|
-
id: "
|
|
2059
|
+
id: "1343268165",
|
|
1216
2060
|
dynamic: [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme$1.palette.accents_3, theme$1.palette.background, color]
|
|
1217
|
-
}, ".with-label.__jsx-style-dynamic-selector{display:inline-block;box-sizing:border-box;-webkit-box-align:center;--input-height:".concat(SCALES.height(2.25), ";font-size:").concat(SCALES.font(0.875), ";width:").concat(SCALES.width(1, defaultWidth), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.input-
|
|
2061
|
+
}, ".with-label.__jsx-style-dynamic-selector{display:inline-block;box-sizing:border-box;-webkit-box-align:center;--input-height:".concat(SCALES.height(2.25), ";font-size:").concat(SCALES.font(0.875), ";width:").concat(SCALES.width(1, defaultWidth), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.input-container.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:").concat(SCALES.width(1, defaultWidth), ";height:var(--input-height);}.input-wrapper.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;-webkit-flex:1;-ms-flex:1;flex:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:").concat(variant === 'normal' ? theme$1.layout.radius : '', ";").concat(variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), ";-webkit-transition:border 0.2s ease 0s,color 0.2s ease 0s;transition:border 0.2s ease 0s,color 0.2s ease 0s;}.input-wrapper.left-label.__jsx-style-dynamic-selector{border-top-left-radius:0;border-bottom-left-radius:0;}.input-wrapper.right-label.__jsx-style-dynamic-selector{border-top-right-radius:0;border-bottom-right-radius:0;}.input-wrapper.disabled.__jsx-style-dynamic-selector{background-color:").concat(theme$1.palette.accents_1, ";border-color:").concat(theme$1.palette.accents_2, ";cursor:not-allowed;}input.disabled.__jsx-style-dynamic-selector{cursor:not-allowed;}.input-wrapper.hover.__jsx-style-dynamic-selector{border-color:").concat(hoverBorder, ";}input.__jsx-style-dynamic-selector{margin:0.25em 0.625em;padding:0;box-shadow:none;font-size:").concat(SCALES.font(0.875), ";background-color:transparent;border:none;color:").concat(color, ";outline:none;border-radius:0;width:100%;min-width:0;-webkit-appearance:none;}input.left-icon.__jsx-style-dynamic-selector{margin-left:0;}input.right-icon.__jsx-style-dynamic-selector{margin-right:0;}.__jsx-style-dynamic-selector::-webkit-input-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme$1.palette.accents_3, ";}.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme$1.palette.accents_3, ";}.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme$1.palette.accents_3, ";}.__jsx-style-dynamic-selector::placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme$1.palette.accents_3, ";}.__jsx-style-dynamic-selector::-ms-reveal{display:none !important;}input.__jsx-style-dynamic-selector:-webkit-autofill,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:hover,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:active,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:focus{-webkit-box-shadow:0 0 0 30px ").concat(theme$1.palette.background, " inset !important;-webkit-text-fill-color:").concat(color, " !important;}")));
|
|
1218
2062
|
});
|
|
1219
2063
|
InputComponent.displayName = 'Input';
|
|
1220
2064
|
var Input = withScale(InputComponent);
|
|
@@ -1234,7 +2078,7 @@ tuple('hover', 'click');
|
|
|
1234
2078
|
tuple('top', 'topStart', 'topEnd', 'left', 'leftStart', 'leftEnd', 'bottom', 'bottomStart', 'bottomEnd', 'right', 'rightStart', 'rightEnd');
|
|
1235
2079
|
tuple('start', 'center', 'end', 'left', 'right');
|
|
1236
2080
|
|
|
1237
|
-
var _excluded$
|
|
2081
|
+
var _excluded$3 = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "helperText", "error", "label", "resize"];
|
|
1238
2082
|
tuple('none', 'both', 'horizontal', 'vertical', 'initial', 'inherit');
|
|
1239
2083
|
var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
1240
2084
|
var _ref$type = _ref.type,
|
|
@@ -1252,9 +2096,12 @@ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1252
2096
|
onChange = _ref.onChange,
|
|
1253
2097
|
value = _ref.value,
|
|
1254
2098
|
placeholder = _ref.placeholder,
|
|
2099
|
+
helperText = _ref.helperText,
|
|
2100
|
+
error = _ref.error,
|
|
2101
|
+
label = _ref.label,
|
|
1255
2102
|
_ref$resize = _ref.resize,
|
|
1256
2103
|
resize = _ref$resize === void 0 ? 'none' : _ref$resize,
|
|
1257
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
2104
|
+
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
1258
2105
|
var theme$1 = theme.useTheme();
|
|
1259
2106
|
var _useScale = useScale(),
|
|
1260
2107
|
SCALES = _useScale.SCALES;
|
|
@@ -1308,6 +2155,8 @@ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1308
2155
|
};
|
|
1309
2156
|
var textareaProps = _objectSpread2(_objectSpread2({}, props), controlledValue);
|
|
1310
2157
|
return /*#__PURE__*/React.createElement("div", {
|
|
2158
|
+
className: "with-label"
|
|
2159
|
+
}, label && /*#__PURE__*/React.createElement(InputBlockLabel, null, label), /*#__PURE__*/React.createElement("div", {
|
|
1311
2160
|
className: _JSXStyle.dynamic([["12276481", [theme$1.layout.radius, borderColor, color, SCALES.font(0.875), SCALES.height(1, 'auto'), SCALES.width(1, 'initial'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverBorder, theme$1.palette.accents_1, theme$1.palette.accents_2, theme$1.font.sans, SCALES.pt(0.5), SCALES.pr(0.5), SCALES.pb(0.5), SCALES.pl(0.5), resize, theme$1.palette.background]]]) + " " + (classes || "")
|
|
1312
2161
|
}, /*#__PURE__*/React.createElement("textarea", _extends({
|
|
1313
2162
|
ref: textareaRef,
|
|
@@ -1322,7 +2171,17 @@ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1322
2171
|
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1323
2172
|
id: "12276481",
|
|
1324
2173
|
dynamic: [theme$1.layout.radius, borderColor, color, SCALES.font(0.875), SCALES.height(1, 'auto'), SCALES.width(1, 'initial'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverBorder, theme$1.palette.accents_1, theme$1.palette.accents_2, theme$1.font.sans, SCALES.pt(0.5), SCALES.pr(0.5), SCALES.pb(0.5), SCALES.pl(0.5), resize, theme$1.palette.background]
|
|
1325
|
-
}, ".wrapper.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:".concat(theme$1.layout.radius, ";border:1px solid ").concat(borderColor, ";color:").concat(color, ";-webkit-transition:border 0.2s ease 0s,color 0.2s ease 0s;transition:border 0.2s ease 0s,color 0.2s ease 0s;min-width:12.5rem;max-width:95vw;--textarea-font-size:").concat(SCALES.font(0.875), ";--textarea-height:").concat(SCALES.height(1, 'auto'), ";width:").concat(SCALES.width(1, 'initial'), ";height:var(--textarea-height);margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.wrapper.hover.__jsx-style-dynamic-selector{border-color:").concat(hoverBorder, ";}.wrapper.disabled.__jsx-style-dynamic-selector{background-color:").concat(theme$1.palette.accents_1, ";border-color:").concat(theme$1.palette.accents_2, ";cursor:not-allowed;}textarea.__jsx-style-dynamic-selector{background-color:transparent;box-shadow:none;display:block;font-family:").concat(theme$1.font.sans, ";font-size:var(--textarea-font-size);width:100%;height:var(--textarea-height);border:none;outline:none;padding:").concat(SCALES.pt(0.5), " ").concat(SCALES.pr(0.5), " ").concat(SCALES.pb(0.5), " ").concat(SCALES.pl(0.5), ";resize:").concat(resize, ";}.disabled.__jsx-style-dynamic-selector>textarea.__jsx-style-dynamic-selector{cursor:not-allowed;}textarea.__jsx-style-dynamic-selector:-webkit-autofill,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:hover,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:active,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:focus{-webkit-box-shadow:0 0 0 30px ").concat(theme$1.palette.background, " inset !important;}")))
|
|
2174
|
+
}, ".wrapper.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:".concat(theme$1.layout.radius, ";border:1px solid ").concat(borderColor, ";color:").concat(color, ";-webkit-transition:border 0.2s ease 0s,color 0.2s ease 0s;transition:border 0.2s ease 0s,color 0.2s ease 0s;min-width:12.5rem;max-width:95vw;--textarea-font-size:").concat(SCALES.font(0.875), ";--textarea-height:").concat(SCALES.height(1, 'auto'), ";width:").concat(SCALES.width(1, 'initial'), ";height:var(--textarea-height);margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.wrapper.hover.__jsx-style-dynamic-selector{border-color:").concat(hoverBorder, ";}.wrapper.disabled.__jsx-style-dynamic-selector{background-color:").concat(theme$1.palette.accents_1, ";border-color:").concat(theme$1.palette.accents_2, ";cursor:not-allowed;}textarea.__jsx-style-dynamic-selector{background-color:transparent;box-shadow:none;display:block;font-family:").concat(theme$1.font.sans, ";font-size:var(--textarea-font-size);width:100%;height:var(--textarea-height);border:none;outline:none;padding:").concat(SCALES.pt(0.5), " ").concat(SCALES.pr(0.5), " ").concat(SCALES.pb(0.5), " ").concat(SCALES.pl(0.5), ";resize:").concat(resize, ";}.disabled.__jsx-style-dynamic-selector>textarea.__jsx-style-dynamic-selector{cursor:not-allowed;}textarea.__jsx-style-dynamic-selector:-webkit-autofill,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:hover,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:active,textarea.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:focus{-webkit-box-shadow:0 0 0 30px ").concat(theme$1.palette.background, " inset !important;}"))), helperText && /*#__PURE__*/React.createElement(Text, {
|
|
2175
|
+
font: 0.8,
|
|
2176
|
+
style: {
|
|
2177
|
+
marginTop: 0.4,
|
|
2178
|
+
marginRight: 0,
|
|
2179
|
+
marginLeft: 0,
|
|
2180
|
+
marginBottom: '0.4rem',
|
|
2181
|
+
textAlign: 'left'
|
|
2182
|
+
},
|
|
2183
|
+
color: error ? "error" : 'default'
|
|
2184
|
+
}, "\xA0", helperText));
|
|
1326
2185
|
});
|
|
1327
2186
|
TextareaComponent.displayName = 'Textarea';
|
|
1328
2187
|
var Textarea = withScale(TextareaComponent);
|
|
@@ -1354,11 +2213,11 @@ var PasswordIcon = function PasswordIcon(_ref) {
|
|
|
1354
2213
|
};
|
|
1355
2214
|
var MemoPasswordIcon = /*#__PURE__*/React.memo(PasswordIcon);
|
|
1356
2215
|
|
|
1357
|
-
var _excluded$
|
|
2216
|
+
var _excluded$2 = ["hideToggle", "children"];
|
|
1358
2217
|
var InputPasswordComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
1359
2218
|
var hideToggle = _ref.hideToggle,
|
|
1360
2219
|
children = _ref.children,
|
|
1361
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
2220
|
+
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
1362
2221
|
var _useScale = useScale(),
|
|
1363
2222
|
getAllScaleProps = _useScale.getAllScaleProps;
|
|
1364
2223
|
var inputRef = React.useRef(null);
|
|
@@ -2944,7 +3803,7 @@ var repositionCursor = function repositionCursor(_ref) {
|
|
|
2944
3803
|
};
|
|
2945
3804
|
};
|
|
2946
3805
|
|
|
2947
|
-
var _excluded$
|
|
3806
|
+
var _excluded$1 = ["allowDecimals", "allowNegativeValue", "id", "name", "className", "customInput", "decimalsLimit", "defaultValue", "disabled", "maxLength", "value", "onValueChange", "fixedDecimalLength", "placeholder", "decimalScale", "prefix", "suffix", "intlConfig", "fullWidth", "step", "min", "max", "disableGroupSeparators", "disableAbbreviations", "decimalSeparator", "groupSeparator", "onChange", "onFocus", "onBlur", "onKeyDown", "onKeyUp", "transformRawValue", "formatValueOnBlur", "children"];
|
|
2948
3807
|
var InputCurrency = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
2949
3808
|
var _ref$allowDecimals = _ref.allowDecimals,
|
|
2950
3809
|
allowDecimals = _ref$allowDecimals === void 0 ? true : _ref$allowDecimals,
|
|
@@ -2986,7 +3845,7 @@ var InputCurrency = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2986
3845
|
_ref$formatValueOnBlu = _ref.formatValueOnBlur,
|
|
2987
3846
|
formatValueOnBlur = _ref$formatValueOnBlu === void 0 ? true : _ref$formatValueOnBlu,
|
|
2988
3847
|
children = _ref.children,
|
|
2989
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
3848
|
+
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
2990
3849
|
var _useScale = useScale(),
|
|
2991
3850
|
SCALES = _useScale.SCALES;
|
|
2992
3851
|
var theme$1 = theme.useTheme();
|
|
@@ -3405,54 +4264,6 @@ var AutoCompleteEmpty = function AutoCompleteEmpty(_ref) {
|
|
|
3405
4264
|
};
|
|
3406
4265
|
AutoCompleteEmpty.displayName = 'AutoCompleteEmpty';
|
|
3407
4266
|
|
|
3408
|
-
var _excluded$1 = ["children", "type", "color", "className", "spaceRatio"];
|
|
3409
|
-
var getIconBgColor = function getIconBgColor(type, palette, color) {
|
|
3410
|
-
var colors = {
|
|
3411
|
-
"default": palette.accents_6,
|
|
3412
|
-
secondary: palette.secondary,
|
|
3413
|
-
success: palette.success,
|
|
3414
|
-
warning: palette.warning,
|
|
3415
|
-
error: palette.error
|
|
3416
|
-
};
|
|
3417
|
-
return color ? color : colors[type];
|
|
3418
|
-
};
|
|
3419
|
-
var LoadingComponent = function LoadingComponent(_ref) {
|
|
3420
|
-
var children = _ref.children,
|
|
3421
|
-
_ref$type = _ref.type,
|
|
3422
|
-
type = _ref$type === void 0 ? 'default' : _ref$type,
|
|
3423
|
-
color = _ref.color,
|
|
3424
|
-
_ref$className = _ref.className,
|
|
3425
|
-
className = _ref$className === void 0 ? '' : _ref$className,
|
|
3426
|
-
_ref$spaceRatio = _ref.spaceRatio,
|
|
3427
|
-
spaceRatio = _ref$spaceRatio === void 0 ? 1 : _ref$spaceRatio,
|
|
3428
|
-
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
3429
|
-
var theme$1 = theme.useTheme();
|
|
3430
|
-
var _useScale = useScale(),
|
|
3431
|
-
SCALES = _useScale.SCALES;
|
|
3432
|
-
var classes = theme.useClasses('loading-container', className);
|
|
3433
|
-
var bgColor = React.useMemo(function () {
|
|
3434
|
-
return getIconBgColor(type, theme$1.palette, color);
|
|
3435
|
-
}, [type, theme$1.palette, color]);
|
|
3436
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
3437
|
-
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
3438
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
3439
|
-
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]]) + " " + "loading"
|
|
3440
|
-
}, children && /*#__PURE__*/React.createElement("label", {
|
|
3441
|
-
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]])
|
|
3442
|
-
}, children), /*#__PURE__*/React.createElement("i", {
|
|
3443
|
-
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]])
|
|
3444
|
-
}), /*#__PURE__*/React.createElement("i", {
|
|
3445
|
-
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]])
|
|
3446
|
-
}), /*#__PURE__*/React.createElement("i", {
|
|
3447
|
-
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]])
|
|
3448
|
-
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
3449
|
-
id: "2201634259",
|
|
3450
|
-
dynamic: [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]
|
|
3451
|
-
}, ".loading-container.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative;font-size:".concat(SCALES.font(1), ";width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, '100%'), ";min-height:1em;padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}label.__jsx-style-dynamic-selector{margin-right:0.5em;color:").concat(theme$1.palette.accents_5, ";line-height:1;}label.__jsx-style-dynamic-selector *{margin:0;}.loading.__jsx-style-dynamic-selector{position:absolute;top:50%;left:50%;width:100%;height:100%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:transparent;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}i.__jsx-style-dynamic-selector{width:0.25em;height:0.25em;border-radius:50%;background-color:").concat(bgColor, ";margin:0 calc(0.25em / 2 * ").concat(spaceRatio, ");display:inline-block;-webkit-animation:loading-blink-__jsx-style-dynamic-selector 1.4s infinite both;animation:loading-blink-__jsx-style-dynamic-selector 1.4s infinite both;}i.__jsx-style-dynamic-selector:nth-child(2){-webkit-animation-delay:0.2s;animation-delay:0.2s;}i.__jsx-style-dynamic-selector:nth-child(3){-webkit-animation-delay:0.4s;animation-delay:0.4s;}@-webkit-keyframes loading-blink-__jsx-style-dynamic-selector{0%{opacity:0.2;}20%{opacity:1;}100%{opacity:0.2;}}@keyframes loading-blink-__jsx-style-dynamic-selector{0%{opacity:0.2;}20%{opacity:1;}100%{opacity:0.2;}}")));
|
|
3452
|
-
};
|
|
3453
|
-
LoadingComponent.displayName = 'Loading';
|
|
3454
|
-
var Loading = withScale(LoadingComponent);
|
|
3455
|
-
|
|
3456
4267
|
var _excluded = ["options", "initialValue", "onSelect", "onSearch", "onChange", "searching", "children", "type", "color", "value", "clearable", "disabled", "dropdownClassName", "dropdownStyle", "disableMatchWidth", "disableFreeSolo", "getPopupContainer"];
|
|
3457
4268
|
var childrenToOptionsNode = function childrenToOptionsNode(options) {
|
|
3458
4269
|
return options.map(function (item, index) {
|