@helpdice/ui 2.5.4 → 2.5.8
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 +1273 -404
- package/dist/avatar/index.js +88 -49
- package/dist/badge/index.js +69 -27
- package/dist/breadcrumbs/index.js +107 -56
- package/dist/button/button.icon.d.ts +3 -16
- package/dist/button/button.small.d.ts +3 -16
- package/dist/button/index.js +143 -157
- package/dist/button-dropdown/index.js +96 -83
- package/dist/button-group/index.js +61 -21
- package/dist/capacity/index.js +61 -22
- package/dist/card/index.js +147 -123
- package/dist/carousal/index.js +349 -330
- package/dist/checkbox/index.js +72 -67
- package/dist/circular-progress/CircularProgress.d.ts +17 -0
- package/dist/circular-progress/index.d.ts +3 -4
- package/dist/circular-progress/index.js +713 -336
- package/dist/circular-progress/useCircularProgress.d.ts +12 -0
- package/dist/code/index.js +70 -26
- package/dist/col/index.js +61 -24
- package/dist/collapse/index.js +102 -52
- package/dist/container/index.js +187 -190
- package/dist/copy-to-clipboard/index.js +158 -210
- package/dist/description/index.js +64 -23
- package/dist/display/index.js +64 -23
- package/dist/divider/index.js +62 -22
- package/dist/dot/index.js +63 -23
- package/dist/drawer/index.js +74 -61
- package/dist/fieldset/index.js +127 -63
- package/dist/form/index.js +15 -40
- package/dist/grid/index.js +74 -29
- package/dist/html-renderer/index.js +3 -2
- package/dist/image/index.js +163 -104
- package/dist/index.d.ts +2 -1
- package/dist/index.js +5240 -4755
- package/dist/input/index.js +1183 -277
- package/dist/keyboard/index.js +73 -29
- package/dist/linear-progress/index.js +27 -24
- package/dist/link/index.js +78 -36
- package/dist/list/index.js +118 -63
- package/dist/loadable/index.js +76 -27
- package/dist/loading/index.js +70 -29
- package/dist/menu/index.js +53 -47
- package/dist/modal/index.js +225 -178
- package/dist/note/index.js +64 -23
- package/dist/notetip/index.js +54 -45
- package/dist/notetip/note-tip.d.ts +2 -0
- package/dist/page/index.js +102 -51
- package/dist/pagination/index.js +181 -124
- package/dist/placeholder/index.js +554 -538
- package/dist/popover/index.js +94 -81
- package/dist/progress/index.js +66 -27
- package/dist/radio/index.js +94 -48
- package/dist/rating/index.js +78 -38
- package/dist/row/index.js +62 -25
- package/dist/search-bar/index.js +172 -162
- package/dist/select/index.js +1098 -163
- package/dist/select/select.d.ts +2 -0
- package/dist/slider/index.js +91 -47
- package/dist/snippet/index.js +39 -39
- package/dist/spacer/index.js +58 -19
- package/dist/spinner/index.js +69 -28
- package/dist/swipe/index.js +28 -13
- package/dist/table/index.js +4162 -3863
- package/dist/table/table-body.d.ts +4 -3
- package/dist/table/table-cell.d.ts +4 -2
- package/dist/table/table-types.d.ts +2 -0
- package/dist/table/table.d.ts +5 -1
- package/dist/tabs/index.js +61 -59
- package/dist/tag/index.js +16 -20
- package/dist/text/index.js +187 -184
- package/dist/text/text.d.ts +3 -0
- package/dist/textarea/index.js +916 -36
- package/dist/textarea/textarea.d.ts +3 -0
- package/dist/toggle/index.js +75 -33
- package/dist/tooltip/index.d.ts +1 -2
- package/dist/tooltip/index.js +59 -53
- package/dist/tooltip/tooltip-content.d.ts +1 -1
- package/dist/tooltip/tooltip-small.d.ts +2 -5
- package/dist/tooltip/tooltip.d.ts +2 -1
- package/dist/tree/index.js +176 -115
- package/dist/use-scale/index.js +50 -13
- package/dist/user/index.js +152 -100
- package/esm/avatar/avatar.js +8 -6
- package/esm/button/button.icon.d.ts +3 -16
- package/esm/button/button.icon.js +22 -22
- package/esm/button/button.js +5 -5
- package/esm/button/button.small.d.ts +3 -16
- package/esm/button/button.small.js +20 -23
- package/esm/circular-progress/CircularProgress.d.ts +17 -0
- package/esm/circular-progress/CircularProgress.js +110 -0
- package/esm/circular-progress/index.d.ts +3 -4
- package/esm/circular-progress/index.js +3 -4
- package/esm/circular-progress/useCircularProgress.d.ts +12 -0
- package/esm/circular-progress/useCircularProgress.js +35 -0
- package/esm/index.d.ts +2 -1
- package/esm/index.js +1 -1
- package/esm/input/input-field.js +11 -9
- package/esm/list/list-item.js +11 -11
- package/esm/notetip/note-tip.d.ts +2 -0
- package/esm/notetip/note-tip.js +8 -5
- 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/skeleton/index.js +9 -4
- package/esm/table/table-body.d.ts +4 -3
- package/esm/table/table-body.js +25 -15
- package/esm/table/table-cell.d.ts +4 -2
- package/esm/table/table-cell.js +19 -3
- package/esm/table/table-types.d.ts +2 -0
- package/esm/table/table.d.ts +5 -1
- package/esm/table/table.js +52 -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/index.d.ts +1 -2
- package/esm/tooltip/tooltip-content.d.ts +1 -1
- package/esm/tooltip/tooltip-content.js +5 -5
- package/esm/tooltip/tooltip-small.d.ts +2 -5
- package/esm/tooltip/tooltip-small.js +0 -1
- package/esm/tooltip/tooltip.d.ts +2 -1
- package/esm/tooltip/tooltip.js +6 -5
- package/package.json +3 -3
- package/dist/circular-progress/CircularProgressbar.d.ts +0 -10
- package/dist/circular-progress/CircularProgressbarWithChildren.d.ts +0 -7
- package/dist/circular-progress/Path.d.ts +0 -9
- package/dist/circular-progress/buildStyles.d.ts +0 -12
- package/dist/circular-progress/constants.d.ts +0 -5
- package/dist/circular-progress/types.d.ts +0 -50
- package/esm/circular-progress/CircularProgressbar.d.ts +0 -10
- package/esm/circular-progress/CircularProgressbar.js +0 -118
- package/esm/circular-progress/CircularProgressbarWithChildren.d.ts +0 -7
- package/esm/circular-progress/CircularProgressbarWithChildren.js +0 -32
- package/esm/circular-progress/Path.d.ts +0 -9
- package/esm/circular-progress/Path.js +0 -52
- package/esm/circular-progress/buildStyles.d.ts +0 -12
- package/esm/circular-progress/buildStyles.js +0 -45
- package/esm/circular-progress/constants.d.ts +0 -5
- package/esm/circular-progress/constants.js +0 -5
- package/esm/circular-progress/types.d.ts +0 -50
- package/esm/circular-progress/types.js +0 -1
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var theme = require('@helpdice/theme');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
8
|
var icons = require('@helpdice/icons');
|
|
8
9
|
|
|
9
10
|
function _arrayLikeToArray(r, a) {
|
|
@@ -73,15 +74,6 @@ function _defineProperty(e, r, t) {
|
|
|
73
74
|
writable: true
|
|
74
75
|
}) : e[r] = t, e;
|
|
75
76
|
}
|
|
76
|
-
function _extends() {
|
|
77
|
-
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
78
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
79
|
-
var t = arguments[e];
|
|
80
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
81
|
-
}
|
|
82
|
-
return n;
|
|
83
|
-
}, _extends.apply(null, arguments);
|
|
84
|
-
}
|
|
85
77
|
function _iterableToArray(r) {
|
|
86
78
|
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
87
79
|
}
|
|
@@ -734,24 +726,28 @@ var InputLabel = function InputLabel(_ref) {
|
|
|
734
726
|
var children = _ref.children,
|
|
735
727
|
isRight = _ref.isRight;
|
|
736
728
|
var theme$1 = theme.useTheme();
|
|
737
|
-
return /*#__PURE__*/
|
|
738
|
-
className: _JSXStyle.dynamic([["3089782703", [theme$1.layout.gapHalf, theme$1.palette.accents_4, theme$1.palette.accents_1, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border]]]) + " " + ((isRight ? 'right' : '') || "")
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
729
|
+
return /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
730
|
+
className: _JSXStyle.dynamic([["3089782703", [theme$1.layout.gapHalf, theme$1.palette.accents_4, theme$1.palette.accents_1, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border]]]) + " " + ((isRight ? 'right' : '') || ""),
|
|
731
|
+
children: [children, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
732
|
+
id: "3089782703",
|
|
733
|
+
dynamic: [theme$1.layout.gapHalf, theme$1.palette.accents_4, theme$1.palette.accents_1, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border, theme$1.palette.border, theme$1.palette.border, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.border],
|
|
734
|
+
children: "span.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;width:initial;height:100%;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;pointer-events:none;margin:0;padding:0 ".concat(theme$1.layout.gapHalf, ";color:").concat(theme$1.palette.accents_4, ";background-color:").concat(theme$1.palette.accents_1, ";border-top-left-radius:").concat(theme$1.layout.radius, ";border-bottom-left-radius:").concat(theme$1.layout.radius, ";border-top:1px solid ").concat(theme$1.palette.border, ";border-left:1px solid ").concat(theme$1.palette.border, ";border-bottom:1px solid ").concat(theme$1.palette.border, ";font-size:inherit;line-height:1;}span.right.__jsx-style-dynamic-selector{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:").concat(theme$1.layout.radius, ";border-bottom-right-radius:").concat(theme$1.layout.radius, ";border-left:0;border-right:1px solid ").concat(theme$1.palette.border, ";}")
|
|
735
|
+
})]
|
|
736
|
+
});
|
|
743
737
|
};
|
|
744
738
|
var MemoInputLabel = /*#__PURE__*/React.memo(InputLabel);
|
|
745
739
|
|
|
746
740
|
var InputBlockLabelComponent = function InputBlockLabelComponent(_ref) {
|
|
747
741
|
var children = _ref.children;
|
|
748
742
|
var theme$1 = theme.useTheme();
|
|
749
|
-
return /*#__PURE__*/
|
|
750
|
-
className: _JSXStyle.dynamic([["1278828862", [theme$1.palette.accents_6]]])
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
743
|
+
return /*#__PURE__*/jsxRuntime.jsxs("label", {
|
|
744
|
+
className: _JSXStyle.dynamic([["1278828862", [theme$1.palette.accents_6]]]),
|
|
745
|
+
children: [children, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
746
|
+
id: "1278828862",
|
|
747
|
+
dynamic: [theme$1.palette.accents_6],
|
|
748
|
+
children: "label.__jsx-style-dynamic-selector{display:block;font-weight:normal;color:".concat(theme$1.palette.accents_6, ";padding:0 0 0 1px;margin-bottom:0.5em;font-size:1em;line-height:1.5;}label.__jsx-style-dynamic-selector>*:first-child{margin-top:0;}label.__jsx-style-dynamic-selector>*:last-child{margin-bottom:0;}")
|
|
749
|
+
})]
|
|
750
|
+
});
|
|
755
751
|
};
|
|
756
752
|
InputBlockLabelComponent.displayName = 'InputBlockLabel';
|
|
757
753
|
var InputBlockLabel = /*#__PURE__*/React.memo(InputBlockLabelComponent);
|
|
@@ -761,13 +757,15 @@ var InputIconComponent = function InputIconComponent(_ref) {
|
|
|
761
757
|
_ref$clickable = _ref.clickable,
|
|
762
758
|
clickable = _ref$clickable === void 0 ? false : _ref$clickable,
|
|
763
759
|
onClick = _ref.onClick;
|
|
764
|
-
return /*#__PURE__*/
|
|
760
|
+
return /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
765
761
|
onClick: onClick,
|
|
766
|
-
className: _JSXStyle.dynamic([["4247656379", [clickable ? 'pointer' : 'default', clickable ? 'auto' : 'none']]]) + " " + "input-icon"
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
762
|
+
className: _JSXStyle.dynamic([["4247656379", [clickable ? 'pointer' : 'default', clickable ? 'auto' : 'none']]]) + " " + "input-icon",
|
|
763
|
+
children: [icon, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
764
|
+
id: "4247656379",
|
|
765
|
+
dynamic: [clickable ? 'pointer' : 'default', clickable ? 'auto' : 'none'],
|
|
766
|
+
children: ".input-icon.__jsx-style-dynamic-selector{box-sizing:border-box;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;width:calc(var(--input-height) - 2px);-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;height:100%;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;margin:0;padding:0;line-height:1;position:relative;cursor:".concat(clickable ? 'pointer' : 'default', ";pointer-events:").concat(clickable ? 'auto' : 'none', ";}.input-icon.__jsx-style-dynamic-selector svg{width:calc(var(--input-height) - 2px);height:calc(var(--input-height) - 2px);-webkit-transform:scale(0.44);-ms-transform:scale(0.44);transform:scale(0.44);}")
|
|
767
|
+
})]
|
|
768
|
+
});
|
|
771
769
|
};
|
|
772
770
|
InputIconComponent.displayName = 'InputIcon';
|
|
773
771
|
var InputIcon = /*#__PURE__*/React.memo(InputIconComponent);
|
|
@@ -786,70 +784,41 @@ var InputIconClear = function InputIconClear(_ref) {
|
|
|
786
784
|
event.nativeEvent.stopImmediatePropagation();
|
|
787
785
|
onClick && onClick(event);
|
|
788
786
|
};
|
|
789
|
-
return /*#__PURE__*/
|
|
787
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
790
788
|
onClick: clickHandler,
|
|
791
|
-
className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground]]]) + " " + (classes || "")
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
789
|
+
className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground]]]) + " " + (classes || ""),
|
|
790
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("svg", {
|
|
791
|
+
viewBox: "0 0 24 24",
|
|
792
|
+
stroke: "currentColor",
|
|
793
|
+
strokeWidth: "1.5",
|
|
794
|
+
strokeLinecap: "round",
|
|
795
|
+
strokeLinejoin: "round",
|
|
796
|
+
fill: "none",
|
|
797
|
+
shapeRendering: "geometricPrecision",
|
|
798
|
+
className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground]]]),
|
|
799
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("path", {
|
|
800
|
+
d: "M18 6L6 18",
|
|
801
|
+
className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground]]])
|
|
802
|
+
}), /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
803
|
+
d: "M6 6l12 12",
|
|
804
|
+
className: _JSXStyle.dynamic([["1567030211", [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground]]])
|
|
805
|
+
})]
|
|
806
|
+
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
807
|
+
id: "1567030211",
|
|
808
|
+
dynamic: [disabled ? 'not-allowed' : 'pointer', theme$1.palette.accents_3, disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground],
|
|
809
|
+
children: ".clear-icon.__jsx-style-dynamic-selector{box-sizing:border-box;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;width:calc(var(--input-height) - 2px);-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;height:100%;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;cursor:".concat(disabled ? 'not-allowed' : 'pointer', ";-webkit-transition:color 150ms ease 0s;transition:color 150ms ease 0s;margin:0;padding:0;color:").concat(theme$1.palette.accents_3, ";visibility:hidden;opacity:0;}.visible.__jsx-style-dynamic-selector{visibility:visible;opacity:1;}.clear-icon.__jsx-style-dynamic-selector:hover{color:").concat(disabled ? theme$1.palette.accents_3 : theme$1.palette.foreground, ";}svg.__jsx-style-dynamic-selector{color:currentColor;width:calc(var(--input-height) - 2px);height:calc(var(--input-height) - 2px);-webkit-transform:scale(0.44);-ms-transform:scale(0.44);transform:scale(0.44);}")
|
|
810
|
+
})]
|
|
811
|
+
});
|
|
811
812
|
};
|
|
812
813
|
var MemoInputIconClear = /*#__PURE__*/React.memo(InputIconClear);
|
|
813
814
|
|
|
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
815
|
/* "use client" */
|
|
847
816
|
|
|
848
817
|
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
818
|
var defaultDynamicLayoutPipe = function defaultDynamicLayoutPipe(scale1x) {
|
|
850
819
|
return "".concat(scale1x);
|
|
851
820
|
};
|
|
852
|
-
var defaultContext$
|
|
821
|
+
var defaultContext$2 = {
|
|
853
822
|
getScaleProps: function getScaleProps() {
|
|
854
823
|
return undefined;
|
|
855
824
|
},
|
|
@@ -875,7 +844,7 @@ var defaultContext$1 = {
|
|
|
875
844
|
},
|
|
876
845
|
unit: '16px'
|
|
877
846
|
};
|
|
878
|
-
var ScaleContext = /*#__PURE__*/React.createContext(defaultContext$
|
|
847
|
+
var ScaleContext = /*#__PURE__*/React.createContext(defaultContext$2);
|
|
879
848
|
var useScale = function useScale() {
|
|
880
849
|
return React.useContext(ScaleContext);
|
|
881
850
|
};
|
|
@@ -945,7 +914,7 @@ var generateGetAllScaleProps = function generateGetAllScaleProps(props) {
|
|
|
945
914
|
return getAllScaleProps;
|
|
946
915
|
};
|
|
947
916
|
|
|
948
|
-
var _excluded$
|
|
917
|
+
var _excluded$a = ["children"];
|
|
949
918
|
var reduceScaleCoefficient = function reduceScaleCoefficient(scale) {
|
|
950
919
|
if (scale === 1) return scale;
|
|
951
920
|
var diff = Math.abs((scale - 1) / 2);
|
|
@@ -955,7 +924,7 @@ var withScale = function withScale(Render) {
|
|
|
955
924
|
var ScaleFC = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
956
925
|
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
926
|
var children = _ref.children,
|
|
958
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
927
|
+
props = _objectWithoutProperties(_ref, _excluded$a);
|
|
959
928
|
var _useTheme = theme.useTheme(),
|
|
960
929
|
layout = _useTheme.layout;
|
|
961
930
|
var paddingLeft = props.paddingLeft,
|
|
@@ -1028,17 +997,898 @@ var withScale = function withScale(Render) {
|
|
|
1028
997
|
getScaleProps: generateGetScaleProps(props),
|
|
1029
998
|
getAllScaleProps: generateGetAllScaleProps(props)
|
|
1030
999
|
};
|
|
1031
|
-
return /*#__PURE__*/
|
|
1032
|
-
value: value
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1000
|
+
return /*#__PURE__*/jsxRuntime.jsx(ScaleContext.Provider, {
|
|
1001
|
+
value: value,
|
|
1002
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Render, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
1003
|
+
ref: ref,
|
|
1004
|
+
children: children
|
|
1005
|
+
}))
|
|
1006
|
+
});
|
|
1036
1007
|
});
|
|
1037
1008
|
ScaleFC.displayName = "Scale".concat(Render.displayName || 'Wrapper');
|
|
1038
1009
|
return ScaleFC;
|
|
1039
1010
|
};
|
|
1040
1011
|
|
|
1041
|
-
var _excluded$
|
|
1012
|
+
var _excluded$9 = ["children", "tag", "className", "color"];
|
|
1013
|
+
var getTypeColor = function getTypeColor(type, palette) {
|
|
1014
|
+
var colors = {
|
|
1015
|
+
"default": 'inherit',
|
|
1016
|
+
secondary: palette.secondary,
|
|
1017
|
+
success: palette.success,
|
|
1018
|
+
warning: palette.warning,
|
|
1019
|
+
error: palette.error
|
|
1020
|
+
};
|
|
1021
|
+
return colors[type] || colors["default"];
|
|
1022
|
+
};
|
|
1023
|
+
var TextChild = function TextChild(_ref) {
|
|
1024
|
+
var children = _ref.children,
|
|
1025
|
+
tag = _ref.tag,
|
|
1026
|
+
_ref$className = _ref.className,
|
|
1027
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1028
|
+
_ref$color = _ref.color,
|
|
1029
|
+
color = _ref$color === void 0 ? 'default' : _ref$color,
|
|
1030
|
+
props = _objectWithoutProperties(_ref, _excluded$9);
|
|
1031
|
+
var Component = tag;
|
|
1032
|
+
var theme$1 = theme.useTheme();
|
|
1033
|
+
var _useScale = useScale(),
|
|
1034
|
+
SCALES = _useScale.SCALES,
|
|
1035
|
+
getScaleProps = _useScale.getScaleProps;
|
|
1036
|
+
var font = getScaleProps('font');
|
|
1037
|
+
var mx = getScaleProps(['margin', 'marginLeft', 'marginRight', 'mx', 'ml', 'mr']);
|
|
1038
|
+
var my = getScaleProps(['margin', 'marginTop', 'marginBottom', 'my', 'mt', 'mb']);
|
|
1039
|
+
var px = getScaleProps(['padding', 'paddingLeft', 'paddingRight', 'pl', 'pr', 'px']);
|
|
1040
|
+
var py = getScaleProps(['padding', 'paddingTop', 'paddingBottom', 'pt', 'pb', 'py']);
|
|
1041
|
+
var _color = React.useMemo(function () {
|
|
1042
|
+
return getTypeColor(color, theme$1.palette);
|
|
1043
|
+
}, [color, theme$1.palette]);
|
|
1044
|
+
var classNames = React.useMemo(function () {
|
|
1045
|
+
var keys = [{
|
|
1046
|
+
value: mx,
|
|
1047
|
+
className: 'mx'
|
|
1048
|
+
}, {
|
|
1049
|
+
value: my,
|
|
1050
|
+
className: 'my'
|
|
1051
|
+
}, {
|
|
1052
|
+
value: px,
|
|
1053
|
+
className: 'px'
|
|
1054
|
+
}, {
|
|
1055
|
+
value: py,
|
|
1056
|
+
className: 'py'
|
|
1057
|
+
}, {
|
|
1058
|
+
value: font,
|
|
1059
|
+
className: 'font'
|
|
1060
|
+
}];
|
|
1061
|
+
var scaleClassNames = keys.reduce(function (pre, next) {
|
|
1062
|
+
if (typeof next.value === 'undefined') return pre;
|
|
1063
|
+
return "".concat(pre, " ").concat(next.className);
|
|
1064
|
+
}, '');
|
|
1065
|
+
return "".concat(scaleClassNames, " ").concat(className).trim();
|
|
1066
|
+
}, [mx, my, px, py, font, className]);
|
|
1067
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Component, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
1068
|
+
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 || ""),
|
|
1069
|
+
children: [children, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
1070
|
+
id: "2277774325",
|
|
1071
|
+
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')],
|
|
1072
|
+
children: "".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;}")
|
|
1073
|
+
})]
|
|
1074
|
+
}));
|
|
1075
|
+
};
|
|
1076
|
+
TextChild.displayName = 'TextChild';
|
|
1077
|
+
|
|
1078
|
+
var ButtonDrip = function ButtonDrip(_ref) {
|
|
1079
|
+
var _ref$x = _ref.x,
|
|
1080
|
+
x = _ref$x === void 0 ? 0 : _ref$x,
|
|
1081
|
+
_ref$y = _ref.y,
|
|
1082
|
+
y = _ref$y === void 0 ? 0 : _ref$y,
|
|
1083
|
+
color = _ref.color,
|
|
1084
|
+
onCompleted = _ref.onCompleted;
|
|
1085
|
+
var dripRef = React.useRef(null);
|
|
1086
|
+
/* istanbul ignore next */
|
|
1087
|
+
var top = Number.isNaN(+y) ? 0 : y - 10;
|
|
1088
|
+
/* istanbul ignore next */
|
|
1089
|
+
var left = Number.isNaN(+x) ? 0 : x - 10;
|
|
1090
|
+
React.useEffect(function () {
|
|
1091
|
+
/* istanbul ignore next */
|
|
1092
|
+
if (!dripRef.current) return;
|
|
1093
|
+
dripRef.current.addEventListener('animationend', onCompleted);
|
|
1094
|
+
return function () {
|
|
1095
|
+
/* istanbul ignore next */
|
|
1096
|
+
if (!dripRef.current) return;
|
|
1097
|
+
dripRef.current.removeEventListener('animationend', onCompleted);
|
|
1098
|
+
};
|
|
1099
|
+
});
|
|
1100
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1101
|
+
ref: dripRef,
|
|
1102
|
+
className: "jsx-3424889537" + " " + "drip",
|
|
1103
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
1104
|
+
width: "20",
|
|
1105
|
+
height: "20",
|
|
1106
|
+
viewBox: "0 0 20 20",
|
|
1107
|
+
style: {
|
|
1108
|
+
top: top,
|
|
1109
|
+
left: left
|
|
1110
|
+
},
|
|
1111
|
+
className: "jsx-3424889537",
|
|
1112
|
+
children: /*#__PURE__*/jsxRuntime.jsx("g", {
|
|
1113
|
+
stroke: "none",
|
|
1114
|
+
strokeWidth: "1",
|
|
1115
|
+
fill: "none",
|
|
1116
|
+
fillRule: "evenodd",
|
|
1117
|
+
className: "jsx-3424889537",
|
|
1118
|
+
children: /*#__PURE__*/jsxRuntime.jsx("g", {
|
|
1119
|
+
fill: color,
|
|
1120
|
+
className: "jsx-3424889537",
|
|
1121
|
+
children: /*#__PURE__*/jsxRuntime.jsx("rect", {
|
|
1122
|
+
width: "100%",
|
|
1123
|
+
height: "100%",
|
|
1124
|
+
rx: "10",
|
|
1125
|
+
className: "jsx-3424889537"
|
|
1126
|
+
})
|
|
1127
|
+
})
|
|
1128
|
+
})
|
|
1129
|
+
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
1130
|
+
id: "3424889537",
|
|
1131
|
+
children: ".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;}}"
|
|
1132
|
+
})]
|
|
1133
|
+
});
|
|
1134
|
+
};
|
|
1135
|
+
ButtonDrip.displayName = 'ButtonDrip';
|
|
1136
|
+
|
|
1137
|
+
var _excluded$8 = ["children", "type", "color", "className", "spaceRatio"];
|
|
1138
|
+
var getIconBgColor = function getIconBgColor(type, palette, color) {
|
|
1139
|
+
var colors = {
|
|
1140
|
+
"default": palette.accents_6,
|
|
1141
|
+
secondary: palette.secondary,
|
|
1142
|
+
success: palette.success,
|
|
1143
|
+
warning: palette.warning,
|
|
1144
|
+
error: palette.error
|
|
1145
|
+
};
|
|
1146
|
+
return color ? color : colors[type];
|
|
1147
|
+
};
|
|
1148
|
+
var LoadingComponent = function LoadingComponent(_ref) {
|
|
1149
|
+
var children = _ref.children,
|
|
1150
|
+
_ref$type = _ref.type,
|
|
1151
|
+
type = _ref$type === void 0 ? 'default' : _ref$type,
|
|
1152
|
+
color = _ref.color,
|
|
1153
|
+
_ref$className = _ref.className,
|
|
1154
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1155
|
+
_ref$spaceRatio = _ref.spaceRatio,
|
|
1156
|
+
spaceRatio = _ref$spaceRatio === void 0 ? 1 : _ref$spaceRatio,
|
|
1157
|
+
props = _objectWithoutProperties(_ref, _excluded$8);
|
|
1158
|
+
var theme$1 = theme.useTheme();
|
|
1159
|
+
var _useScale = useScale(),
|
|
1160
|
+
SCALES = _useScale.SCALES;
|
|
1161
|
+
var classes = theme.useClasses('loading-container', className);
|
|
1162
|
+
var bgColor = React.useMemo(function () {
|
|
1163
|
+
return getIconBgColor(type, theme$1.palette, color);
|
|
1164
|
+
}, [type, theme$1.palette, color]);
|
|
1165
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
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]]]) + " " + (props && props.className != null && props.className || classes || ""),
|
|
1167
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
1168
|
+
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",
|
|
1169
|
+
children: [children && /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
1170
|
+
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]]]),
|
|
1171
|
+
children: children
|
|
1172
|
+
}), /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
1173
|
+
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]]])
|
|
1174
|
+
}), /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
1175
|
+
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]]])
|
|
1176
|
+
}), /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
1177
|
+
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]]])
|
|
1178
|
+
})]
|
|
1179
|
+
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
1180
|
+
id: "2201634259",
|
|
1181
|
+
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],
|
|
1182
|
+
children: ".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;}}")
|
|
1183
|
+
})]
|
|
1184
|
+
}));
|
|
1185
|
+
};
|
|
1186
|
+
LoadingComponent.displayName = 'Loading';
|
|
1187
|
+
var Loading = withScale(LoadingComponent);
|
|
1188
|
+
|
|
1189
|
+
var ButtonLoading = function ButtonLoading(_ref) {
|
|
1190
|
+
var color = _ref.color;
|
|
1191
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1192
|
+
className: "jsx-212623367" + " " + "btn-loading",
|
|
1193
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Loading, {
|
|
1194
|
+
color: color
|
|
1195
|
+
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
1196
|
+
id: "212623367",
|
|
1197
|
+
children: ".btn-loading.jsx-212623367{position:absolute;top:0;left:0;right:0;bottom:0;z-index:2;background-color:var(--helpdice-ui-button-bg);}"
|
|
1198
|
+
})]
|
|
1199
|
+
});
|
|
1200
|
+
};
|
|
1201
|
+
ButtonLoading.displayName = 'ButtonLoading';
|
|
1202
|
+
|
|
1203
|
+
var _excluded$7 = ["isRight", "isSingle", "children", "className"];
|
|
1204
|
+
var ButtonIcon = function ButtonIcon(_ref) {
|
|
1205
|
+
var _ref$isRight = _ref.isRight,
|
|
1206
|
+
isRight = _ref$isRight === void 0 ? false : _ref$isRight,
|
|
1207
|
+
isSingle = _ref.isSingle,
|
|
1208
|
+
children = _ref.children,
|
|
1209
|
+
_ref$className = _ref.className,
|
|
1210
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1211
|
+
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
1212
|
+
var classes = theme.useClasses('icon', {
|
|
1213
|
+
right: isRight,
|
|
1214
|
+
single: isSingle
|
|
1215
|
+
}, className);
|
|
1216
|
+
return /*#__PURE__*/jsxRuntime.jsxs("span", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
1217
|
+
className: "jsx-2467502931" + " " + (props && props.className != null && props.className || classes || ""),
|
|
1218
|
+
children: [children, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
1219
|
+
id: "2467502931",
|
|
1220
|
+
children: ".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;}"
|
|
1221
|
+
})]
|
|
1222
|
+
}));
|
|
1223
|
+
};
|
|
1224
|
+
ButtonIcon.displayName = 'ButtonIcon';
|
|
1225
|
+
|
|
1226
|
+
var getButtonChildrenWithIcon = function getButtonChildrenWithIcon(auto, children, icons) {
|
|
1227
|
+
var icon = icons.icon,
|
|
1228
|
+
iconRight = icons.iconRight;
|
|
1229
|
+
var hasIcon = icon || iconRight;
|
|
1230
|
+
var isRight = Boolean(iconRight);
|
|
1231
|
+
var paddingForAutoMode = auto ? "calc(var(--helpdice-ui-button-height) / 2 + var(--helpdice-ui-button-icon-padding) * .5)" : 0;
|
|
1232
|
+
var classes = theme.useClasses('text', isRight ? 'right' : 'left');
|
|
1233
|
+
if (!hasIcon) return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1234
|
+
className: "text",
|
|
1235
|
+
children: children
|
|
1236
|
+
});
|
|
1237
|
+
if (React.Children.count(children) === 0) {
|
|
1238
|
+
return /*#__PURE__*/jsxRuntime.jsx(ButtonIcon, {
|
|
1239
|
+
isRight: isRight,
|
|
1240
|
+
isSingle: true,
|
|
1241
|
+
children: hasIcon
|
|
1242
|
+
});
|
|
1243
|
+
}
|
|
1244
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1245
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(ButtonIcon, {
|
|
1246
|
+
isRight: isRight,
|
|
1247
|
+
children: hasIcon
|
|
1248
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1249
|
+
className: _JSXStyle.dynamic([["3568181479", [paddingForAutoMode, paddingForAutoMode]]]) + " " + (classes || ""),
|
|
1250
|
+
children: [children, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
1251
|
+
id: "3568181479",
|
|
1252
|
+
dynamic: [paddingForAutoMode, paddingForAutoMode],
|
|
1253
|
+
children: ".left.__jsx-style-dynamic-selector{padding-left:".concat(paddingForAutoMode, ";}.right.__jsx-style-dynamic-selector{padding-right:").concat(paddingForAutoMode, ";}")
|
|
1254
|
+
})]
|
|
1255
|
+
})]
|
|
1256
|
+
});
|
|
1257
|
+
};
|
|
1258
|
+
var filterPropsWithGroup = function filterPropsWithGroup(props, config) {
|
|
1259
|
+
if (!config.isButtonGroup) return props;
|
|
1260
|
+
return _objectSpread2(_objectSpread2({}, props), {}, {
|
|
1261
|
+
auto: true,
|
|
1262
|
+
shadow: false,
|
|
1263
|
+
ghost: config.ghost || props.ghost,
|
|
1264
|
+
type: config.type || props.type,
|
|
1265
|
+
disabled: config.disabled || props.disabled
|
|
1266
|
+
});
|
|
1267
|
+
};
|
|
1268
|
+
|
|
1269
|
+
/* "use client" */
|
|
1270
|
+
|
|
1271
|
+
var defaultContext$1 = {
|
|
1272
|
+
isButtonGroup: false,
|
|
1273
|
+
disabled: false
|
|
1274
|
+
};
|
|
1275
|
+
var ButtonGroupContext = /*#__PURE__*/React.createContext(defaultContext$1);
|
|
1276
|
+
var useButtonGroupContext = function useButtonGroupContext() {
|
|
1277
|
+
return React.useContext(ButtonGroupContext);
|
|
1278
|
+
};
|
|
1279
|
+
|
|
1280
|
+
var hexToRgb = function hexToRgb(color) {
|
|
1281
|
+
var fullReg = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
|
1282
|
+
var full = color.replace(fullReg, function (_, r, g, b) {
|
|
1283
|
+
return "".concat(r).concat(r).concat(g).concat(g).concat(b).concat(b);
|
|
1284
|
+
});
|
|
1285
|
+
var values = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(full);
|
|
1286
|
+
if (!values) {
|
|
1287
|
+
throw new Error("Helpdice UI: Unsupported ".concat(color, " color."));
|
|
1288
|
+
}
|
|
1289
|
+
return [Number.parseInt(values[1], 16), Number.parseInt(values[2], 16), Number.parseInt(values[3], 16)];
|
|
1290
|
+
};
|
|
1291
|
+
var colorToRgbValues = function colorToRgbValues(color) {
|
|
1292
|
+
if (color.charAt(0) === '#') return hexToRgb(color);
|
|
1293
|
+
var safeColor = color.replace(/ /g, '');
|
|
1294
|
+
var colorType = color.substr(0, 4);
|
|
1295
|
+
var regArray = safeColor.match(/\((.+)\)/);
|
|
1296
|
+
if (!colorType.startsWith('rgb') || !regArray) {
|
|
1297
|
+
console.log(color);
|
|
1298
|
+
throw new Error("Helpdice UI: Only support [\"RGB\", \"RGBA\", \"HEX\"] color.");
|
|
1299
|
+
}
|
|
1300
|
+
return regArray[1].split(',').map(function (str) {
|
|
1301
|
+
return Number.parseFloat(str);
|
|
1302
|
+
});
|
|
1303
|
+
};
|
|
1304
|
+
var addColorAlpha = function addColorAlpha(color, alpha) {
|
|
1305
|
+
if (!/^#|rgb|RGB/.test(color)) return color;
|
|
1306
|
+
var _colorToRgbValues = colorToRgbValues(color),
|
|
1307
|
+
_colorToRgbValues2 = _slicedToArray(_colorToRgbValues, 3),
|
|
1308
|
+
r = _colorToRgbValues2[0],
|
|
1309
|
+
g = _colorToRgbValues2[1],
|
|
1310
|
+
b = _colorToRgbValues2[2];
|
|
1311
|
+
var safeAlpha = alpha > 1 ? 1 : alpha < 0 ? 0 : alpha;
|
|
1312
|
+
return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(safeAlpha, ")");
|
|
1313
|
+
};
|
|
1314
|
+
|
|
1315
|
+
var getButtonGhostColors = function getButtonGhostColors(palette, _color) {
|
|
1316
|
+
var colors = {
|
|
1317
|
+
secondary: {
|
|
1318
|
+
bg: palette.background,
|
|
1319
|
+
border: palette.foreground,
|
|
1320
|
+
color: palette.foreground,
|
|
1321
|
+
ripple: ''
|
|
1322
|
+
},
|
|
1323
|
+
success: {
|
|
1324
|
+
bg: palette.background,
|
|
1325
|
+
border: palette.success,
|
|
1326
|
+
color: palette.success,
|
|
1327
|
+
ripple: ''
|
|
1328
|
+
},
|
|
1329
|
+
warning: {
|
|
1330
|
+
bg: palette.background,
|
|
1331
|
+
border: palette.warning,
|
|
1332
|
+
color: palette.warning,
|
|
1333
|
+
ripple: ''
|
|
1334
|
+
},
|
|
1335
|
+
error: {
|
|
1336
|
+
bg: palette.background,
|
|
1337
|
+
border: palette.error,
|
|
1338
|
+
color: palette.error,
|
|
1339
|
+
ripple: ''
|
|
1340
|
+
}
|
|
1341
|
+
};
|
|
1342
|
+
return colors[_color] || null;
|
|
1343
|
+
};
|
|
1344
|
+
var getButtonColors = function getButtonColors(palette, props) {
|
|
1345
|
+
var color = props.color,
|
|
1346
|
+
disabled = props.disabled,
|
|
1347
|
+
ghost = props.ghost;
|
|
1348
|
+
var colors = {
|
|
1349
|
+
"default": {
|
|
1350
|
+
bg: palette.background,
|
|
1351
|
+
border: palette.border,
|
|
1352
|
+
color: palette.accents_5,
|
|
1353
|
+
ripple: palette.accents_1
|
|
1354
|
+
},
|
|
1355
|
+
secondary: {
|
|
1356
|
+
bg: palette.foreground,
|
|
1357
|
+
border: palette.foreground,
|
|
1358
|
+
color: palette.background,
|
|
1359
|
+
ripple: palette.accents_1
|
|
1360
|
+
},
|
|
1361
|
+
success: {
|
|
1362
|
+
bg: palette.success,
|
|
1363
|
+
border: palette.success,
|
|
1364
|
+
color: '#fff',
|
|
1365
|
+
ripple: '#1f93ffff'
|
|
1366
|
+
},
|
|
1367
|
+
warning: {
|
|
1368
|
+
bg: palette.warning,
|
|
1369
|
+
border: palette.warning,
|
|
1370
|
+
color: '#fff',
|
|
1371
|
+
ripple: '#ffca29ff'
|
|
1372
|
+
},
|
|
1373
|
+
error: {
|
|
1374
|
+
bg: palette.error,
|
|
1375
|
+
border: palette.error,
|
|
1376
|
+
color: '#fff',
|
|
1377
|
+
ripple: '#ff5a55ff'
|
|
1378
|
+
},
|
|
1379
|
+
abort: {
|
|
1380
|
+
bg: 'transparent',
|
|
1381
|
+
border: 'transparent',
|
|
1382
|
+
color: palette.accents_5,
|
|
1383
|
+
ripple: palette.accents_1
|
|
1384
|
+
}
|
|
1385
|
+
};
|
|
1386
|
+
if (disabled) return {
|
|
1387
|
+
bg: palette.accents_1,
|
|
1388
|
+
border: palette.accents_2,
|
|
1389
|
+
color: '#ccc',
|
|
1390
|
+
ripple: ''
|
|
1391
|
+
};
|
|
1392
|
+
|
|
1393
|
+
/**
|
|
1394
|
+
* The '-light' type is the same color as the common type,
|
|
1395
|
+
* only hover's color is different.
|
|
1396
|
+
* e.g.
|
|
1397
|
+
* Color['success'] === Color['success-light']
|
|
1398
|
+
* Color['warning'] === Color['warning-light']
|
|
1399
|
+
*/
|
|
1400
|
+
var withoutLightType = color === null || color === void 0 ? void 0 : color.replace('-light', '');
|
|
1401
|
+
var defaultColor = colors["default"];
|
|
1402
|
+
if (ghost) return getButtonGhostColors(palette, withoutLightType) || defaultColor;
|
|
1403
|
+
return colors[withoutLightType] || defaultColor;
|
|
1404
|
+
};
|
|
1405
|
+
var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette, _color) {
|
|
1406
|
+
var colors = {
|
|
1407
|
+
secondary: {
|
|
1408
|
+
bg: palette.foreground,
|
|
1409
|
+
border: palette.background,
|
|
1410
|
+
color: palette.background
|
|
1411
|
+
},
|
|
1412
|
+
success: {
|
|
1413
|
+
bg: palette.success,
|
|
1414
|
+
border: palette.background,
|
|
1415
|
+
color: 'white'
|
|
1416
|
+
},
|
|
1417
|
+
warning: {
|
|
1418
|
+
bg: palette.warning,
|
|
1419
|
+
border: palette.background,
|
|
1420
|
+
color: 'white'
|
|
1421
|
+
},
|
|
1422
|
+
error: {
|
|
1423
|
+
bg: palette.error,
|
|
1424
|
+
border: palette.background,
|
|
1425
|
+
color: 'white'
|
|
1426
|
+
}
|
|
1427
|
+
};
|
|
1428
|
+
var withoutLightType = _color === null || _color === void 0 ? void 0 : _color.replace('-light', '');
|
|
1429
|
+
return colors[withoutLightType] || null;
|
|
1430
|
+
};
|
|
1431
|
+
var getButtonHoverColors = function getButtonHoverColors(palette, props) {
|
|
1432
|
+
var color = props.color,
|
|
1433
|
+
disabled = props.disabled,
|
|
1434
|
+
loading = props.loading,
|
|
1435
|
+
shadow = props.shadow,
|
|
1436
|
+
ghost = props.ghost;
|
|
1437
|
+
var defaultColor = getButtonColors(palette, props);
|
|
1438
|
+
var alphaBackground = addColorAlpha(defaultColor.bg, 0.85);
|
|
1439
|
+
var colors = {
|
|
1440
|
+
"default": {
|
|
1441
|
+
bg: palette.background,
|
|
1442
|
+
border: palette.foreground
|
|
1443
|
+
},
|
|
1444
|
+
secondary: {
|
|
1445
|
+
bg: palette.background,
|
|
1446
|
+
border: palette.foreground
|
|
1447
|
+
},
|
|
1448
|
+
success: {
|
|
1449
|
+
bg: palette.background,
|
|
1450
|
+
border: palette.success
|
|
1451
|
+
},
|
|
1452
|
+
warning: {
|
|
1453
|
+
bg: palette.background,
|
|
1454
|
+
border: palette.warning
|
|
1455
|
+
},
|
|
1456
|
+
error: {
|
|
1457
|
+
bg: palette.background,
|
|
1458
|
+
border: palette.error
|
|
1459
|
+
},
|
|
1460
|
+
abort: {
|
|
1461
|
+
bg: 'transparent',
|
|
1462
|
+
border: 'transparent',
|
|
1463
|
+
color: palette.accents_5
|
|
1464
|
+
},
|
|
1465
|
+
'secondary-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
1466
|
+
bg: alphaBackground
|
|
1467
|
+
}),
|
|
1468
|
+
'success-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
1469
|
+
bg: alphaBackground
|
|
1470
|
+
}),
|
|
1471
|
+
'warning-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
1472
|
+
bg: alphaBackground
|
|
1473
|
+
}),
|
|
1474
|
+
'error-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
1475
|
+
bg: alphaBackground
|
|
1476
|
+
})
|
|
1477
|
+
};
|
|
1478
|
+
if (disabled) return {
|
|
1479
|
+
bg: palette.accents_1,
|
|
1480
|
+
border: palette.accents_2,
|
|
1481
|
+
color: '#ccc'
|
|
1482
|
+
};
|
|
1483
|
+
if (loading) return _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
1484
|
+
color: 'transparent'
|
|
1485
|
+
});
|
|
1486
|
+
if (shadow) return defaultColor;
|
|
1487
|
+
var hoverColor = (ghost ? getButtonGhostHoverColors(palette, color) : colors[color]) || colors["default"];
|
|
1488
|
+
return _objectSpread2(_objectSpread2({}, hoverColor), {}, {
|
|
1489
|
+
color: hoverColor.color || hoverColor.border
|
|
1490
|
+
});
|
|
1491
|
+
};
|
|
1492
|
+
var getButtonCursor = function getButtonCursor(disabled, loading) {
|
|
1493
|
+
if (disabled) return {
|
|
1494
|
+
cursor: 'not-allowed',
|
|
1495
|
+
events: 'auto'
|
|
1496
|
+
};
|
|
1497
|
+
if (loading) return {
|
|
1498
|
+
cursor: 'default',
|
|
1499
|
+
events: 'none'
|
|
1500
|
+
};
|
|
1501
|
+
return {
|
|
1502
|
+
cursor: 'pointer',
|
|
1503
|
+
events: 'auto'
|
|
1504
|
+
};
|
|
1505
|
+
};
|
|
1506
|
+
var getButtonDripColor = function getButtonDripColor(palette, props) {
|
|
1507
|
+
var type = props.type;
|
|
1508
|
+
var isLightHover = type ? type.endsWith('light') : false;
|
|
1509
|
+
var hoverColors = getButtonHoverColors(palette, props);
|
|
1510
|
+
return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
|
|
1511
|
+
};
|
|
1512
|
+
|
|
1513
|
+
var _excluded$6 = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "relative", "replace", "a", "to", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
|
|
1514
|
+
var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
1515
|
+
var theme$1 = theme.useTheme();
|
|
1516
|
+
// const navigate = useNavigate();
|
|
1517
|
+
var _useScale = useScale(),
|
|
1518
|
+
SCALES = _useScale.SCALES;
|
|
1519
|
+
var buttonRef = React.useRef(null);
|
|
1520
|
+
React.useImperativeHandle(ref, function () {
|
|
1521
|
+
return buttonRef.current;
|
|
1522
|
+
}); // Changed with !
|
|
1523
|
+
|
|
1524
|
+
var _useState = React.useState(false),
|
|
1525
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1526
|
+
dripShow = _useState2[0],
|
|
1527
|
+
setDripShow = _useState2[1];
|
|
1528
|
+
var _useState3 = React.useState(0),
|
|
1529
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
1530
|
+
dripX = _useState4[0],
|
|
1531
|
+
setDripX = _useState4[1];
|
|
1532
|
+
var _useState5 = React.useState(0),
|
|
1533
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
1534
|
+
dripY = _useState6[0],
|
|
1535
|
+
setDripY = _useState6[1];
|
|
1536
|
+
var groupConfig = useButtonGroupContext();
|
|
1537
|
+
var filteredProps = filterPropsWithGroup(btnProps, groupConfig);
|
|
1538
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
1539
|
+
var children = filteredProps.children,
|
|
1540
|
+
_filteredProps$disabl = filteredProps.disabled,
|
|
1541
|
+
disabled = _filteredProps$disabl === void 0 ? false : _filteredProps$disabl;
|
|
1542
|
+
filteredProps.color;
|
|
1543
|
+
var _filteredProps$loadin = filteredProps.loading,
|
|
1544
|
+
loading = _filteredProps$loadin === void 0 ? false : _filteredProps$loadin,
|
|
1545
|
+
_filteredProps$shadow = filteredProps.shadow,
|
|
1546
|
+
shadow = _filteredProps$shadow === void 0 ? false : _filteredProps$shadow,
|
|
1547
|
+
_filteredProps$ghost = filteredProps.ghost,
|
|
1548
|
+
ghost = _filteredProps$ghost === void 0 ? false : _filteredProps$ghost,
|
|
1549
|
+
_filteredProps$effect = filteredProps.effect,
|
|
1550
|
+
effect = _filteredProps$effect === void 0 ? true : _filteredProps$effect,
|
|
1551
|
+
_filteredProps$round = filteredProps.round,
|
|
1552
|
+
round = _filteredProps$round === void 0 ? false : _filteredProps$round;
|
|
1553
|
+
filteredProps.relative;
|
|
1554
|
+
filteredProps.replace;
|
|
1555
|
+
filteredProps.a;
|
|
1556
|
+
var to = filteredProps.to,
|
|
1557
|
+
onClick = filteredProps.onClick,
|
|
1558
|
+
_filteredProps$auto = filteredProps.auto,
|
|
1559
|
+
auto = _filteredProps$auto === void 0 ? false : _filteredProps$auto,
|
|
1560
|
+
icon = filteredProps.icon,
|
|
1561
|
+
_filteredProps$type = filteredProps.type,
|
|
1562
|
+
type = _filteredProps$type === void 0 ? 'button' : _filteredProps$type,
|
|
1563
|
+
iconRight = filteredProps.iconRight,
|
|
1564
|
+
_filteredProps$classN = filteredProps.className,
|
|
1565
|
+
className = _filteredProps$classN === void 0 ? '' : _filteredProps$classN;
|
|
1566
|
+
filteredProps.crossOrigin;
|
|
1567
|
+
var props = _objectWithoutProperties(filteredProps, _excluded$6);
|
|
1568
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
1569
|
+
|
|
1570
|
+
var _useMemo = React.useMemo(function () {
|
|
1571
|
+
return getButtonColors(theme$1.palette, filteredProps);
|
|
1572
|
+
}, [theme$1.palette, filteredProps]),
|
|
1573
|
+
bg = _useMemo.bg,
|
|
1574
|
+
border = _useMemo.border,
|
|
1575
|
+
color = _useMemo.color,
|
|
1576
|
+
rippleColor = _useMemo.ripple;
|
|
1577
|
+
var hover = React.useMemo(function () {
|
|
1578
|
+
return getButtonHoverColors(theme$1.palette, filteredProps);
|
|
1579
|
+
}, [theme$1.palette, filteredProps]);
|
|
1580
|
+
var _useMemo2 = React.useMemo(function () {
|
|
1581
|
+
return getButtonCursor(disabled, loading);
|
|
1582
|
+
}, [disabled, loading]),
|
|
1583
|
+
cursor = _useMemo2.cursor,
|
|
1584
|
+
events = _useMemo2.events;
|
|
1585
|
+
var dripColor = React.useMemo(function () {
|
|
1586
|
+
return getButtonDripColor(theme$1.palette, filteredProps);
|
|
1587
|
+
}, [theme$1.palette, filteredProps]);
|
|
1588
|
+
|
|
1589
|
+
/* istanbul ignore next */
|
|
1590
|
+
var dripCompletedHandle = function dripCompletedHandle() {
|
|
1591
|
+
setDripShow(false);
|
|
1592
|
+
setDripX(0);
|
|
1593
|
+
setDripY(0);
|
|
1594
|
+
};
|
|
1595
|
+
var createRipple = function createRipple(event) {
|
|
1596
|
+
var button = buttonRef.current;
|
|
1597
|
+
if (!button) return;
|
|
1598
|
+
var rect = button.getBoundingClientRect();
|
|
1599
|
+
var size = Math.max(rect.width, rect.height);
|
|
1600
|
+
var x = event.clientX - rect.left - size / 2;
|
|
1601
|
+
var y = event.clientY - rect.top - size / 2;
|
|
1602
|
+
var rippleCount = 1; // number of rings
|
|
1603
|
+
var rippleDelay = 500; // ms between each ripple
|
|
1604
|
+
var _loop = function _loop() {
|
|
1605
|
+
var ripple = document.createElement('span');
|
|
1606
|
+
Object.assign(ripple.style, {
|
|
1607
|
+
position: 'absolute',
|
|
1608
|
+
borderRadius: '50%',
|
|
1609
|
+
backgroundColor: rippleColor,
|
|
1610
|
+
width: "".concat(size, "px"),
|
|
1611
|
+
height: "".concat(size, "px"),
|
|
1612
|
+
left: "".concat(x, "px"),
|
|
1613
|
+
top: "".concat(y, "px"),
|
|
1614
|
+
pointerEvents: 'none',
|
|
1615
|
+
transform: 'scale(0)',
|
|
1616
|
+
opacity: '1',
|
|
1617
|
+
transition: "transform 600ms ease-out ".concat(i * rippleDelay, "ms, opacity 600ms ease-out ").concat(i * rippleDelay, "ms"),
|
|
1618
|
+
zIndex: 1
|
|
1619
|
+
});
|
|
1620
|
+
button.appendChild(ripple);
|
|
1621
|
+
|
|
1622
|
+
// Force reflow to start transition
|
|
1623
|
+
window.getComputedStyle(ripple).opacity;
|
|
1624
|
+
ripple.style.transform = 'scale(2.5)';
|
|
1625
|
+
ripple.style.opacity = '0';
|
|
1626
|
+
ripple.addEventListener('transitionend', function () {
|
|
1627
|
+
ripple.remove();
|
|
1628
|
+
});
|
|
1629
|
+
};
|
|
1630
|
+
for (var i = 0; i < rippleCount; i++) {
|
|
1631
|
+
_loop();
|
|
1632
|
+
}
|
|
1633
|
+
};
|
|
1634
|
+
var clickHandler = function clickHandler(event) {
|
|
1635
|
+
if (disabled || loading) return;
|
|
1636
|
+
var showDrip = !shadow && !ghost && effect;
|
|
1637
|
+
/* istanbul ignore next */
|
|
1638
|
+
if (showDrip && buttonRef.current) {
|
|
1639
|
+
var rect = buttonRef.current.getBoundingClientRect();
|
|
1640
|
+
setDripShow(true);
|
|
1641
|
+
setDripX(event.clientX - rect.left);
|
|
1642
|
+
setDripY(event.clientY - rect.top);
|
|
1643
|
+
}
|
|
1644
|
+
if (shadow) {
|
|
1645
|
+
createRipple(event);
|
|
1646
|
+
}
|
|
1647
|
+
onClick && onClick(event);
|
|
1648
|
+
};
|
|
1649
|
+
var childrenWithIcon = React.useMemo(function () {
|
|
1650
|
+
return getButtonChildrenWithIcon(auto, children, {
|
|
1651
|
+
icon: icon,
|
|
1652
|
+
iconRight: iconRight
|
|
1653
|
+
});
|
|
1654
|
+
}, [auto, children, icon, iconRight]);
|
|
1655
|
+
var paddingLeft = auto ? SCALES.pl(1.15) : SCALES.pl(1.375),
|
|
1656
|
+
paddingRight = auto ? SCALES.pr(1.15) : SCALES.pr(1.375);
|
|
1657
|
+
|
|
1658
|
+
// If shadow provided is string then value other default
|
|
1659
|
+
var btnShadow = typeof shadow === 'string' ? shadow : shadow ? theme$1.shadows.level.z2 : 'none';
|
|
1660
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1661
|
+
children: [to ? /*#__PURE__*/jsxRuntime.jsxs("a", _objectSpread2(_objectSpread2({
|
|
1662
|
+
href: to
|
|
1663
|
+
}, props), {}, {
|
|
1664
|
+
className: _JSXStyle.dynamic([["612376042", [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) || ""),
|
|
1665
|
+
children: [loading && /*#__PURE__*/jsxRuntime.jsx(ButtonLoading, {
|
|
1666
|
+
color: color
|
|
1667
|
+
}), childrenWithIcon]
|
|
1668
|
+
})) : /*#__PURE__*/jsxRuntime.jsxs("button", _objectSpread2(_objectSpread2({
|
|
1669
|
+
ref: buttonRef,
|
|
1670
|
+
type: type,
|
|
1671
|
+
disabled: disabled,
|
|
1672
|
+
onClick: clickHandler
|
|
1673
|
+
}, props), {}, {
|
|
1674
|
+
className: _JSXStyle.dynamic([["612376042", [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) || ""),
|
|
1675
|
+
children: [loading && /*#__PURE__*/jsxRuntime.jsx(ButtonLoading, {
|
|
1676
|
+
color: color
|
|
1677
|
+
}), childrenWithIcon, dripShow && /*#__PURE__*/jsxRuntime.jsx(ButtonDrip, {
|
|
1678
|
+
x: dripX,
|
|
1679
|
+
y: dripY,
|
|
1680
|
+
color: dripColor,
|
|
1681
|
+
onCompleted: dripCompletedHandle
|
|
1682
|
+
})]
|
|
1683
|
+
})), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
1684
|
+
id: "612376042",
|
|
1685
|
+
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'],
|
|
1686
|
+
children: ".btn.__jsx-style-dynamic-selector{box-sizing:border-box;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;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{-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;}}")
|
|
1687
|
+
})]
|
|
1688
|
+
});
|
|
1689
|
+
});
|
|
1690
|
+
ButtonComponent.displayName = 'Button';
|
|
1691
|
+
var Button = withScale(ButtonComponent);
|
|
1692
|
+
|
|
1693
|
+
var CompactButton = function CompactButton(props) {
|
|
1694
|
+
// const theme = useTheme();
|
|
1695
|
+
return /*#__PURE__*/jsxRuntime.jsx(Button, _objectSpread2(_objectSpread2({
|
|
1696
|
+
scale: 2 / 3,
|
|
1697
|
+
px: 0.6
|
|
1698
|
+
}, _objectSpread2({
|
|
1699
|
+
auto: true
|
|
1700
|
+
}, props)), {}, {
|
|
1701
|
+
children: props.children
|
|
1702
|
+
}));
|
|
1703
|
+
};
|
|
1704
|
+
var IconButton = /*#__PURE__*/React.memo(CompactButton);
|
|
1705
|
+
|
|
1706
|
+
var SmallButton = function SmallButton(props) {
|
|
1707
|
+
// const theme = useTheme();
|
|
1708
|
+
return /*#__PURE__*/jsxRuntime.jsx(Button, _objectSpread2(_objectSpread2({
|
|
1709
|
+
auto: true,
|
|
1710
|
+
scale: 2 / 3,
|
|
1711
|
+
px: 0.6
|
|
1712
|
+
}, props), {}, {
|
|
1713
|
+
children: props.children
|
|
1714
|
+
}));
|
|
1715
|
+
};
|
|
1716
|
+
var SmallButton$1 = /*#__PURE__*/React.memo(SmallButton);
|
|
1717
|
+
|
|
1718
|
+
/* "use client" */
|
|
1719
|
+
|
|
1720
|
+
Button.Icon = IconButton;
|
|
1721
|
+
Button.Small = SmallButton$1;
|
|
1722
|
+
|
|
1723
|
+
var _excluded$5 = ["h1", "h2", "h3", "h4", "h5", "h6", "p", "b", "small", "i", "span", "del", "em", "blockquote", "noWrap", "collapse", "children", "className", "display", "alignItems", "justify"];
|
|
1724
|
+
var _getModifierChild = function getModifierChild(tags, children) {
|
|
1725
|
+
if (!tags.length) return children;
|
|
1726
|
+
var nextTag = tags.slice(1, tags.length);
|
|
1727
|
+
return /*#__PURE__*/jsxRuntime.jsx(TextChild, {
|
|
1728
|
+
tag: tags[0],
|
|
1729
|
+
children: _getModifierChild(nextTag, children)
|
|
1730
|
+
});
|
|
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__*/jsxRuntime.jsx(TextChild, _objectSpread2(_objectSpread2({
|
|
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), {}, {
|
|
1834
|
+
children: typeof children === 'string' && collapse > 50 ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1835
|
+
children: [expand ? modifers : (modifers === null || modifers === void 0 ? void 0 : modifers.toString().substring(0, collapse)) + '...', /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
1836
|
+
margin: 0,
|
|
1837
|
+
onClick: function onClick() {
|
|
1838
|
+
return setExpand(!expand);
|
|
1839
|
+
},
|
|
1840
|
+
style: {
|
|
1841
|
+
textTransform: 'lowercase'
|
|
1842
|
+
},
|
|
1843
|
+
effect: false,
|
|
1844
|
+
color: "abort",
|
|
1845
|
+
scale: 2 / 3,
|
|
1846
|
+
px: 0.2,
|
|
1847
|
+
py: 0,
|
|
1848
|
+
auto: true,
|
|
1849
|
+
children: /*#__PURE__*/jsxRuntime.jsx("b", {
|
|
1850
|
+
children: expand ? 'less' : 'more'
|
|
1851
|
+
})
|
|
1852
|
+
})]
|
|
1853
|
+
}) : modifers
|
|
1854
|
+
}));
|
|
1855
|
+
};
|
|
1856
|
+
TextComponent.displayName = 'Text';
|
|
1857
|
+
var Text = withScale(TextComponent);
|
|
1858
|
+
|
|
1859
|
+
var getColors = function getColors(palette, status) {
|
|
1860
|
+
var colors = {
|
|
1861
|
+
"default": {
|
|
1862
|
+
color: palette.foreground,
|
|
1863
|
+
borderColor: palette.border,
|
|
1864
|
+
hoverBorder: palette.accents_5
|
|
1865
|
+
},
|
|
1866
|
+
secondary: {
|
|
1867
|
+
color: palette.foreground,
|
|
1868
|
+
borderColor: palette.secondary,
|
|
1869
|
+
hoverBorder: palette.secondary
|
|
1870
|
+
},
|
|
1871
|
+
success: {
|
|
1872
|
+
color: palette.foreground,
|
|
1873
|
+
borderColor: palette.successLight,
|
|
1874
|
+
hoverBorder: palette.success
|
|
1875
|
+
},
|
|
1876
|
+
warning: {
|
|
1877
|
+
color: palette.foreground,
|
|
1878
|
+
borderColor: palette.warningLight,
|
|
1879
|
+
hoverBorder: palette.warning
|
|
1880
|
+
},
|
|
1881
|
+
error: {
|
|
1882
|
+
color: palette.error,
|
|
1883
|
+
borderColor: palette.error,
|
|
1884
|
+
hoverBorder: palette.errorDark
|
|
1885
|
+
}
|
|
1886
|
+
};
|
|
1887
|
+
if (!status) return colors["default"];
|
|
1888
|
+
return colors[status];
|
|
1889
|
+
};
|
|
1890
|
+
|
|
1891
|
+
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
1892
|
var simulateChangeEvent = function simulateChangeEvent(el, event) {
|
|
1043
1893
|
return _objectSpread2(_objectSpread2({}, event), {}, {
|
|
1044
1894
|
target: el,
|
|
@@ -1084,7 +1934,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1084
1934
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
1085
1935
|
_ref$fullWidth = _ref.fullWidth,
|
|
1086
1936
|
fullWidth = _ref$fullWidth === void 0 ? false : _ref$fullWidth,
|
|
1087
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1937
|
+
props = _objectWithoutProperties(_ref, _excluded$4);
|
|
1088
1938
|
var theme$1 = theme.useTheme();
|
|
1089
1939
|
var _useScale = useScale(),
|
|
1090
1940
|
SCALES = _useScale.SCALES;
|
|
@@ -1166,55 +2016,66 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1166
2016
|
};
|
|
1167
2017
|
var inputProps = _objectSpread2(_objectSpread2({}, props), controlledValue);
|
|
1168
2018
|
var defaultWidth = fullWidth ? '100%' : 'initial';
|
|
1169
|
-
return /*#__PURE__*/
|
|
1170
|
-
className: _JSXStyle.dynamic([["
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
},
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
2019
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2020
|
+
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",
|
|
2021
|
+
children: [children && /*#__PURE__*/jsxRuntime.jsx(InputBlockLabel, {
|
|
2022
|
+
children: children
|
|
2023
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2024
|
+
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) || ""),
|
|
2025
|
+
children: [label && /*#__PURE__*/jsxRuntime.jsx(MemoInputLabel, {
|
|
2026
|
+
children: label
|
|
2027
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2028
|
+
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', {
|
|
2029
|
+
hover: hover,
|
|
2030
|
+
disabled: disabled
|
|
2031
|
+
}, labelClasses) || ""),
|
|
2032
|
+
children: [icon && /*#__PURE__*/jsxRuntime.jsx(InputIcon, _objectSpread2({
|
|
2033
|
+
icon: icon
|
|
2034
|
+
}, iconProps)), /*#__PURE__*/jsxRuntime.jsx("input", _objectSpread2(_objectSpread2({
|
|
2035
|
+
type: type,
|
|
2036
|
+
ref: inputRef,
|
|
2037
|
+
placeholder: placeholder,
|
|
2038
|
+
disabled: disabled,
|
|
2039
|
+
readOnly: readOnly,
|
|
2040
|
+
onFocus: focusHandler,
|
|
2041
|
+
onBlur: blurHandler,
|
|
2042
|
+
onChange: changeHandler,
|
|
2043
|
+
autoComplete: autoComplete,
|
|
2044
|
+
onKeyDown: handleKeyDown
|
|
2045
|
+
}, inputProps), {}, {
|
|
2046
|
+
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({
|
|
2047
|
+
disabled: disabled
|
|
2048
|
+
}, iconClasses) || "")
|
|
2049
|
+
})), clearable && /*#__PURE__*/jsxRuntime.jsx(MemoInputIconClear, {
|
|
2050
|
+
visible: Boolean(inputRef.current && inputRef.current.value !== ''),
|
|
2051
|
+
disabled: disabled || readOnly,
|
|
2052
|
+
onClick: clearHandler
|
|
2053
|
+
}), iconRight && /*#__PURE__*/jsxRuntime.jsx(InputIcon, _objectSpread2({
|
|
2054
|
+
icon: iconRight
|
|
2055
|
+
}, iconProps))]
|
|
2056
|
+
}), labelRight && /*#__PURE__*/jsxRuntime.jsx(MemoInputLabel, {
|
|
2057
|
+
isRight: true,
|
|
2058
|
+
children: labelRight
|
|
2059
|
+
}), /*#__PURE__*/jsxRuntime.jsx("br", {
|
|
2060
|
+
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]]])
|
|
2061
|
+
})]
|
|
2062
|
+
}), helperText && /*#__PURE__*/jsxRuntime.jsxs(Text, {
|
|
2063
|
+
font: 0.8,
|
|
2064
|
+
style: {
|
|
2065
|
+
marginTop: 0.4,
|
|
2066
|
+
marginRight: 0,
|
|
2067
|
+
marginLeft: 0,
|
|
2068
|
+
marginBottom: '0.4rem',
|
|
2069
|
+
textAlign: 'left'
|
|
2070
|
+
},
|
|
2071
|
+
color: error ? "error" : 'default',
|
|
2072
|
+
children: ["\xA0", helperText]
|
|
2073
|
+
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
2074
|
+
id: "1343268165",
|
|
2075
|
+
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],
|
|
2076
|
+
children: ".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;}")
|
|
2077
|
+
})]
|
|
2078
|
+
});
|
|
1218
2079
|
});
|
|
1219
2080
|
InputComponent.displayName = 'Input';
|
|
1220
2081
|
var Input = withScale(InputComponent);
|
|
@@ -1234,7 +2095,7 @@ tuple('hover', 'click');
|
|
|
1234
2095
|
tuple('top', 'topStart', 'topEnd', 'left', 'leftStart', 'leftEnd', 'bottom', 'bottomStart', 'bottomEnd', 'right', 'rightStart', 'rightEnd');
|
|
1235
2096
|
tuple('start', 'center', 'end', 'left', 'right');
|
|
1236
2097
|
|
|
1237
|
-
var _excluded$
|
|
2098
|
+
var _excluded$3 = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "helperText", "error", "label", "resize"];
|
|
1238
2099
|
tuple('none', 'both', 'horizontal', 'vertical', 'initial', 'inherit');
|
|
1239
2100
|
var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
1240
2101
|
var _ref$type = _ref.type,
|
|
@@ -1252,9 +2113,12 @@ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1252
2113
|
onChange = _ref.onChange,
|
|
1253
2114
|
value = _ref.value,
|
|
1254
2115
|
placeholder = _ref.placeholder,
|
|
2116
|
+
helperText = _ref.helperText,
|
|
2117
|
+
error = _ref.error,
|
|
2118
|
+
label = _ref.label,
|
|
1255
2119
|
_ref$resize = _ref.resize,
|
|
1256
2120
|
resize = _ref$resize === void 0 ? 'none' : _ref$resize,
|
|
1257
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
2121
|
+
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
1258
2122
|
var theme$1 = theme.useTheme();
|
|
1259
2123
|
var _useScale = useScale(),
|
|
1260
2124
|
SCALES = _useScale.SCALES;
|
|
@@ -1307,29 +2171,47 @@ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1307
2171
|
defaultValue: initialValue
|
|
1308
2172
|
};
|
|
1309
2173
|
var textareaProps = _objectSpread2(_objectSpread2({}, props), controlledValue);
|
|
1310
|
-
return /*#__PURE__*/
|
|
1311
|
-
className:
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
2174
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2175
|
+
className: "with-label",
|
|
2176
|
+
children: [label && /*#__PURE__*/jsxRuntime.jsx(InputBlockLabel, {
|
|
2177
|
+
children: label
|
|
2178
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2179
|
+
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 || ""),
|
|
2180
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("textarea", _objectSpread2(_objectSpread2({
|
|
2181
|
+
ref: textareaRef,
|
|
2182
|
+
disabled: disabled,
|
|
2183
|
+
placeholder: placeholder,
|
|
2184
|
+
readOnly: readOnly,
|
|
2185
|
+
onFocus: focusHandler,
|
|
2186
|
+
onBlur: blurHandler,
|
|
2187
|
+
onChange: changeHandler
|
|
2188
|
+
}, textareaProps), {}, {
|
|
2189
|
+
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]]]) + " " + (textareaProps && textareaProps.className != null && textareaProps.className || "")
|
|
2190
|
+
})), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
2191
|
+
id: "12276481",
|
|
2192
|
+
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],
|
|
2193
|
+
children: ".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;}")
|
|
2194
|
+
})]
|
|
2195
|
+
}), helperText && /*#__PURE__*/jsxRuntime.jsxs(Text, {
|
|
2196
|
+
font: 0.8,
|
|
2197
|
+
style: {
|
|
2198
|
+
marginTop: 0.4,
|
|
2199
|
+
marginRight: 0,
|
|
2200
|
+
marginLeft: 0,
|
|
2201
|
+
marginBottom: '0.4rem',
|
|
2202
|
+
textAlign: 'left'
|
|
2203
|
+
},
|
|
2204
|
+
color: error ? "error" : 'default',
|
|
2205
|
+
children: ["\xA0", helperText]
|
|
2206
|
+
})]
|
|
2207
|
+
});
|
|
1326
2208
|
});
|
|
1327
2209
|
TextareaComponent.displayName = 'Textarea';
|
|
1328
2210
|
var Textarea = withScale(TextareaComponent);
|
|
1329
2211
|
|
|
1330
2212
|
var PasswordIcon = function PasswordIcon(_ref) {
|
|
1331
2213
|
var visible = _ref.visible;
|
|
1332
|
-
return /*#__PURE__*/
|
|
2214
|
+
return /*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
1333
2215
|
viewBox: "0 0 24 24",
|
|
1334
2216
|
stroke: "currentColor",
|
|
1335
2217
|
strokeWidth: "1.5",
|
|
@@ -1339,26 +2221,31 @@ var PasswordIcon = function PasswordIcon(_ref) {
|
|
|
1339
2221
|
shapeRendering: "geometricPrecision",
|
|
1340
2222
|
style: {
|
|
1341
2223
|
color: 'currentColor'
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
2224
|
+
},
|
|
2225
|
+
children: !visible ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2226
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("path", {
|
|
2227
|
+
d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"
|
|
2228
|
+
}), /*#__PURE__*/jsxRuntime.jsx("circle", {
|
|
2229
|
+
cx: "12",
|
|
2230
|
+
cy: "12",
|
|
2231
|
+
r: "3"
|
|
2232
|
+
})]
|
|
2233
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
2234
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("path", {
|
|
2235
|
+
d: "M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24"
|
|
2236
|
+
}), /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
2237
|
+
d: "M1 1l22 22"
|
|
2238
|
+
})]
|
|
2239
|
+
})
|
|
2240
|
+
});
|
|
1354
2241
|
};
|
|
1355
2242
|
var MemoPasswordIcon = /*#__PURE__*/React.memo(PasswordIcon);
|
|
1356
2243
|
|
|
1357
|
-
var _excluded$
|
|
2244
|
+
var _excluded$2 = ["hideToggle", "children"];
|
|
1358
2245
|
var InputPasswordComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
1359
2246
|
var hideToggle = _ref.hideToggle,
|
|
1360
2247
|
children = _ref.children,
|
|
1361
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
2248
|
+
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
1362
2249
|
var _useScale = useScale(),
|
|
1363
2250
|
getAllScaleProps = _useScale.getAllScaleProps;
|
|
1364
2251
|
var inputRef = React.useRef(null);
|
|
@@ -1389,13 +2276,15 @@ var InputPasswordComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
|
1389
2276
|
}, [props, iconClickHandler, visible, inputRef]);
|
|
1390
2277
|
var icon = React.useMemo(function () {
|
|
1391
2278
|
if (hideToggle) return null;
|
|
1392
|
-
return /*#__PURE__*/
|
|
2279
|
+
return /*#__PURE__*/jsxRuntime.jsx(MemoPasswordIcon, {
|
|
1393
2280
|
visible: visible
|
|
1394
2281
|
});
|
|
1395
2282
|
}, [hideToggle, visible]);
|
|
1396
|
-
return /*#__PURE__*/
|
|
2283
|
+
return /*#__PURE__*/jsxRuntime.jsx(Input, _objectSpread2(_objectSpread2(_objectSpread2({
|
|
1397
2284
|
iconRight: icon
|
|
1398
|
-
}, getAllScaleProps(), inputProps),
|
|
2285
|
+
}, getAllScaleProps()), inputProps), {}, {
|
|
2286
|
+
children: children
|
|
2287
|
+
}));
|
|
1399
2288
|
});
|
|
1400
2289
|
InputPasswordComponent.displayName = 'InputPassword';
|
|
1401
2290
|
var InputPassword = withScale(InputPasswordComponent);
|
|
@@ -2469,92 +3358,105 @@ function PhoneInput(_ref) {
|
|
|
2469
3358
|
return "".concat(c.label, " ").concat(c.code, " ").concat(c.phone).toLowerCase().includes(searchTerm.toLowerCase());
|
|
2470
3359
|
});
|
|
2471
3360
|
var defaultWidth = fullWidth ? '100%' : 'initial';
|
|
2472
|
-
return /*#__PURE__*/
|
|
3361
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2473
3362
|
ref: dropdownRef,
|
|
2474
|
-
className: _JSXStyle.dynamic([["2480261071", [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), hoverBorder, borderColor, SCALES.width(1, defaultWidth), borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "with-label ".concat(isFocused ? 'focused' : '')
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
3363
|
+
className: _JSXStyle.dynamic([["2480261071", [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), hoverBorder, borderColor, SCALES.width(1, defaultWidth), borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "with-label ".concat(isFocused ? 'focused' : ''),
|
|
3364
|
+
children: [children && /*#__PURE__*/jsxRuntime.jsx(InputBlockLabel, {
|
|
3365
|
+
children: children
|
|
3366
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3367
|
+
className: _JSXStyle.dynamic([["2480261071", [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), hoverBorder, borderColor, SCALES.width(1, defaultWidth), borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "input-wrapper",
|
|
3368
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3369
|
+
onClick: function onClick() {
|
|
3370
|
+
return setDropdownOpen(!dropdownOpen);
|
|
3371
|
+
},
|
|
3372
|
+
className: _JSXStyle.dynamic([["2480261071", [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), hoverBorder, borderColor, SCALES.width(1, defaultWidth), borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "dropdown-toggle",
|
|
3373
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
3374
|
+
style: {
|
|
3375
|
+
display: 'flex',
|
|
3376
|
+
alignItems: 'center',
|
|
3377
|
+
gap: 5,
|
|
3378
|
+
paddingRight: '15px'
|
|
3379
|
+
},
|
|
3380
|
+
className: _JSXStyle.dynamic([["2480261071", [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), hoverBorder, borderColor, SCALES.width(1, defaultWidth), borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]]),
|
|
3381
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("img", {
|
|
3382
|
+
loading: "lazy",
|
|
3383
|
+
width: "20",
|
|
3384
|
+
height: "20",
|
|
3385
|
+
src: "https://flagcdn.com/w20/".concat(selectedCountry.code.toLowerCase(), ".png"),
|
|
3386
|
+
srcSet: "https://flagcdn.com/w40/".concat(selectedCountry.code.toLowerCase(), ".png 2x"),
|
|
3387
|
+
alt: "".concat(selectedCountry.label, " Flag"),
|
|
3388
|
+
className: _JSXStyle.dynamic([["2480261071", [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), hoverBorder, borderColor, SCALES.width(1, defaultWidth), borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]])
|
|
3389
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
3390
|
+
className: _JSXStyle.dynamic([["2480261071", [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), hoverBorder, borderColor, SCALES.width(1, defaultWidth), borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]]),
|
|
3391
|
+
children: selectedCountry.phone
|
|
3392
|
+
})]
|
|
3393
|
+
})
|
|
3394
|
+
}), /*#__PURE__*/jsxRuntime.jsx("input", {
|
|
3395
|
+
type: "tel",
|
|
3396
|
+
placeholder: placeholder,
|
|
3397
|
+
value: phoneNumber,
|
|
3398
|
+
onChange: handlePhoneChange,
|
|
3399
|
+
onFocus: function onFocus() {
|
|
3400
|
+
return setIsFocused(true);
|
|
3401
|
+
},
|
|
3402
|
+
onBlur: function onBlur() {
|
|
3403
|
+
return setIsFocused(false);
|
|
3404
|
+
},
|
|
3405
|
+
className: _JSXStyle.dynamic([["2480261071", [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), hoverBorder, borderColor, SCALES.width(1, defaultWidth), borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "phone-input"
|
|
3406
|
+
})]
|
|
3407
|
+
}), dropdownOpen && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3408
|
+
className: _JSXStyle.dynamic([["2480261071", [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), hoverBorder, borderColor, SCALES.width(1, defaultWidth), borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "dropdown",
|
|
3409
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("input", {
|
|
3410
|
+
type: "text",
|
|
3411
|
+
placeholder: "Search country...",
|
|
3412
|
+
value: searchTerm,
|
|
3413
|
+
onChange: function onChange(e) {
|
|
3414
|
+
return setSearchTerm(e.target.value);
|
|
3415
|
+
},
|
|
3416
|
+
className: _JSXStyle.dynamic([["2480261071", [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), hoverBorder, borderColor, SCALES.width(1, defaultWidth), borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "search-input"
|
|
3417
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3418
|
+
className: _JSXStyle.dynamic([["2480261071", [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), hoverBorder, borderColor, SCALES.width(1, defaultWidth), borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "country-list",
|
|
3419
|
+
children: filteredCountries.length > 0 ? filteredCountries.map(function (c) {
|
|
3420
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3421
|
+
onClick: function onClick() {
|
|
3422
|
+
return handleSelectCountry(c);
|
|
3423
|
+
},
|
|
3424
|
+
className: _JSXStyle.dynamic([["2480261071", [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), hoverBorder, borderColor, SCALES.width(1, defaultWidth), borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "dropdown-item",
|
|
3425
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
3426
|
+
style: {
|
|
3427
|
+
display: 'flex',
|
|
3428
|
+
alignItems: 'center',
|
|
3429
|
+
gap: 5
|
|
3430
|
+
},
|
|
3431
|
+
className: _JSXStyle.dynamic([["2480261071", [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), hoverBorder, borderColor, SCALES.width(1, defaultWidth), borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]]),
|
|
3432
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("img", {
|
|
3433
|
+
loading: "lazy",
|
|
3434
|
+
width: "23",
|
|
3435
|
+
height: "23",
|
|
3436
|
+
src: "https://flagcdn.com/w20/".concat(c.code.toLowerCase(), ".png"),
|
|
3437
|
+
srcSet: "https://flagcdn.com/w40/".concat(c.code.toLowerCase(), ".png 2x"),
|
|
3438
|
+
alt: "".concat(c.label, " Flag"),
|
|
3439
|
+
className: _JSXStyle.dynamic([["2480261071", [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), hoverBorder, borderColor, SCALES.width(1, defaultWidth), borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]])
|
|
3440
|
+
}), c.phone, " ", /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
3441
|
+
style: {
|
|
3442
|
+
color: 'grey'
|
|
3443
|
+
},
|
|
3444
|
+
className: _JSXStyle.dynamic([["2480261071", [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), hoverBorder, borderColor, SCALES.width(1, defaultWidth), borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]]),
|
|
3445
|
+
children: c.label
|
|
3446
|
+
})]
|
|
3447
|
+
})
|
|
3448
|
+
}, c.code);
|
|
3449
|
+
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3450
|
+
className: _JSXStyle.dynamic([["2480261071", [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), hoverBorder, borderColor, SCALES.width(1, defaultWidth), borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "dropdown-item disabled",
|
|
3451
|
+
children: "No results"
|
|
3452
|
+
})
|
|
3453
|
+
})]
|
|
3454
|
+
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
3455
|
+
id: "2480261071",
|
|
3456
|
+
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), hoverBorder, borderColor, SCALES.width(1, defaultWidth), borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef'],
|
|
3457
|
+
children: ".with-label.__jsx-style-dynamic-selector{position:relative;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), ";}.phone-input-container.focused.__jsx-style-dynamic-selector{outline:1px solid ").concat(hoverBorder, ";border-radius:6px;}.input-wrapper.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border:1px solid ").concat(borderColor, ";width:").concat(SCALES.width(1, defaultWidth), ";height:var(--input-height);border-radius:6px;overflow:hidden;}.dropdown-toggle.__jsx-style-dynamic-selector{padding:7px 12px;border-radius:6px 0px 0px 6px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:14px;border-right:1px solid ").concat(borderColor, ";}.phone-input.__jsx-style-dynamic-selector{width:100%;min-width:0;padding:5px 10px;background-color:transparent;font-size:14px;border:none;}.phone-input.__jsx-style-dynamic-selector:focus{outline:none;}.dropdown.__jsx-style-dynamic-selector{position:absolute;top:100%;left:0;width:").concat(SCALES.width(1, defaultWidth), ";background:").concat(theme$1.type == 'dark' ? 'black' : 'white', ";border:1px solid ").concat(borderColor, ";border-radius:6px;margin-top:4px;z-index:999;box-shadow:0 4px 10px rgba(0,0,0,0.1);}.search-input.__jsx-style-dynamic-selector{width:100%;padding:8px 10px;border:none;background-color:transparent;border-bottom:1px solid ").concat(borderColor, ";font-size:14px;}.search-input.__jsx-style-dynamic-selector:focus{outline:none;}.country-list.__jsx-style-dynamic-selector{max-height:200px;overflow-y:auto;}.dropdown-item.__jsx-style-dynamic-selector{padding:10px;cursor:pointer;font-size:14px;}.dropdown-item.__jsx-style-dynamic-selector:hover{background:").concat(theme$1.type == 'dark' ? '#3a3d3d' : '#efefef', ";}.dropdown-item.disabled.__jsx-style-dynamic-selector{color:#888;cursor:default;}")
|
|
3458
|
+
})]
|
|
3459
|
+
});
|
|
2558
3460
|
}
|
|
2559
3461
|
var PhoneInput$1 = withScale(PhoneInput);
|
|
2560
3462
|
|
|
@@ -2944,7 +3846,7 @@ var repositionCursor = function repositionCursor(_ref) {
|
|
|
2944
3846
|
};
|
|
2945
3847
|
};
|
|
2946
3848
|
|
|
2947
|
-
var _excluded$
|
|
3849
|
+
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
3850
|
var InputCurrency = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
2949
3851
|
var _ref$allowDecimals = _ref.allowDecimals,
|
|
2950
3852
|
allowDecimals = _ref$allowDecimals === void 0 ? true : _ref$allowDecimals,
|
|
@@ -2986,7 +3888,7 @@ var InputCurrency = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2986
3888
|
_ref$formatValueOnBlu = _ref.formatValueOnBlur,
|
|
2987
3889
|
formatValueOnBlur = _ref$formatValueOnBlu === void 0 ? true : _ref$formatValueOnBlu,
|
|
2988
3890
|
children = _ref.children,
|
|
2989
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
3891
|
+
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
2990
3892
|
var _useScale = useScale(),
|
|
2991
3893
|
SCALES = _useScale.SCALES;
|
|
2992
3894
|
var theme$1 = theme.useTheme();
|
|
@@ -3256,28 +4158,32 @@ var InputCurrency = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
3256
4158
|
}, props);
|
|
3257
4159
|
if (customInput) {
|
|
3258
4160
|
var CustomInput = customInput;
|
|
3259
|
-
return /*#__PURE__*/
|
|
4161
|
+
return /*#__PURE__*/jsxRuntime.jsx(CustomInput, _objectSpread2({}, inputProps));
|
|
3260
4162
|
}
|
|
3261
|
-
return /*#__PURE__*/
|
|
3262
|
-
className: _JSXStyle.dynamic([["1592876518", [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)]]]) + " " + "with-label"
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
4163
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4164
|
+
className: _JSXStyle.dynamic([["1592876518", [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)]]]) + " " + "with-label",
|
|
4165
|
+
children: [children && /*#__PURE__*/jsxRuntime.jsx(InputBlockLabel, {
|
|
4166
|
+
children: children
|
|
4167
|
+
}), /*#__PURE__*/jsxRuntime.jsx("input", _objectSpread2(_objectSpread2({}, inputProps), {}, {
|
|
4168
|
+
style: {
|
|
4169
|
+
textAlign: 'right',
|
|
4170
|
+
border: "1px solid ".concat(theme$1.palette.border),
|
|
4171
|
+
fontSize: '14px',
|
|
4172
|
+
borderRadius: '5px',
|
|
4173
|
+
height: '35px',
|
|
4174
|
+
padding: '5px 10px',
|
|
4175
|
+
fontWeight: 'light',
|
|
4176
|
+
width: 'auto',
|
|
4177
|
+
background: 'transparent',
|
|
4178
|
+
minWidth: '200px'
|
|
4179
|
+
},
|
|
4180
|
+
className: _JSXStyle.dynamic([["1592876518", [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)]]]) + " " + (inputProps && inputProps.className != null && inputProps.className || "")
|
|
4181
|
+
})), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
4182
|
+
id: "1592876518",
|
|
4183
|
+
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)],
|
|
4184
|
+
children: ".with-label.__jsx-style-dynamic-selector{position:relative;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), ";}")
|
|
4185
|
+
})]
|
|
4186
|
+
});
|
|
3281
4187
|
});
|
|
3282
4188
|
|
|
3283
4189
|
// CurrencyInput.displayName = 'CurrencyInput';
|
|
@@ -3300,8 +4206,6 @@ var useAutoCompleteContext = function useAutoCompleteContext() {
|
|
|
3300
4206
|
return React.useContext(AutoCompleteContext);
|
|
3301
4207
|
};
|
|
3302
4208
|
|
|
3303
|
-
// interface Props
|
|
3304
|
-
|
|
3305
4209
|
var AutoCompleteItemComponent = function AutoCompleteItemComponent(_ref) {
|
|
3306
4210
|
var identValue = _ref.value,
|
|
3307
4211
|
children = _ref.children,
|
|
@@ -3323,15 +4227,18 @@ var AutoCompleteItemComponent = function AutoCompleteItemComponent(_ref) {
|
|
|
3323
4227
|
var classes = theme.useClasses('item', {
|
|
3324
4228
|
active: isActive
|
|
3325
4229
|
});
|
|
3326
|
-
return /*#__PURE__*/
|
|
4230
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3327
4231
|
onClick: selectHandler,
|
|
3328
|
-
className: _JSXStyle.dynamic([["2003094915", [theme$1.palette.background, theme$1.palette.foreground, SCALES.font(0.875), SCALES.width(1, 'auto'), isLabelOnly ? SCALES.height(2.5) : SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0.75), SCALES.pb(0), SCALES.pl(0.75), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.layout.radius, theme$1.layout.radius, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.accents_1, theme$1.palette.accents_1, theme$1.palette.success]]]) + " " + (classes || "")
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
4232
|
+
className: _JSXStyle.dynamic([["2003094915", [theme$1.palette.background, theme$1.palette.foreground, SCALES.font(0.875), SCALES.width(1, 'auto'), isLabelOnly ? SCALES.height(2.5) : SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0.75), SCALES.pb(0), SCALES.pl(0.75), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.layout.radius, theme$1.layout.radius, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.accents_1, theme$1.palette.accents_1, theme$1.palette.success]]]) + " " + (classes || ""),
|
|
4233
|
+
children: [isLabelOnly ? /*#__PURE__*/jsxRuntime.jsx(theme.Ellipsis, {
|
|
4234
|
+
height: SCALES.height(2),
|
|
4235
|
+
children: children
|
|
4236
|
+
}) : children, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
4237
|
+
id: "2003094915",
|
|
4238
|
+
dynamic: [theme$1.palette.background, theme$1.palette.foreground, SCALES.font(0.875), SCALES.width(1, 'auto'), isLabelOnly ? SCALES.height(2.5) : SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0.75), SCALES.pb(0), SCALES.pl(0.75), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.layout.radius, theme$1.layout.radius, theme$1.layout.radius, theme$1.layout.radius, theme$1.palette.accents_1, theme$1.palette.accents_1, theme$1.palette.success],
|
|
4239
|
+
children: ".item.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-weight:normal;white-space:pre;background-color:".concat(theme$1.palette.background, ";color:").concat(theme$1.palette.foreground, ";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:0;cursor:pointer;-webkit-transition:background 0.2s ease 0s,border-color 0.2s ease 0s;transition:background 0.2s ease 0s,border-color 0.2s ease 0s;font-size:").concat(SCALES.font(0.875), ";width:").concat(SCALES.width(1, 'auto'), ";height:").concat(isLabelOnly ? SCALES.height(2.5) : SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0.75), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0.75), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.item.__jsx-style-dynamic-selector:first-of-type{border-top-left-radius:").concat(theme$1.layout.radius, ";border-top-right-radius:").concat(theme$1.layout.radius, ";}.item.__jsx-style-dynamic-selector:last-of-type{border-bottom-left-radius:").concat(theme$1.layout.radius, ";border-bottom-right-radius:").concat(theme$1.layout.radius, ";}.item.__jsx-style-dynamic-selector:hover{background-color:").concat(theme$1.palette.accents_1, ";}.item.active.__jsx-style-dynamic-selector{background-color:").concat(theme$1.palette.accents_1, ";color:").concat(theme$1.palette.success, ";}")
|
|
4240
|
+
})]
|
|
4241
|
+
});
|
|
3335
4242
|
};
|
|
3336
4243
|
AutoCompleteItemComponent.displayName = 'AutoCompleteItem';
|
|
3337
4244
|
|
|
@@ -3356,38 +4263,39 @@ var AutoCompleteDropdown = function AutoCompleteDropdown(_ref) {
|
|
|
3356
4263
|
event.stopPropagation();
|
|
3357
4264
|
event.nativeEvent.stopImmediatePropagation();
|
|
3358
4265
|
};
|
|
3359
|
-
return /*#__PURE__*/
|
|
4266
|
+
return /*#__PURE__*/jsxRuntime.jsx(theme.Dropdown, {
|
|
3360
4267
|
parent: ref,
|
|
3361
4268
|
visible: visible,
|
|
3362
4269
|
disableMatchWidth: disableMatchWidth,
|
|
3363
|
-
getPopupContainer: getPopupContainer
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
4270
|
+
getPopupContainer: getPopupContainer,
|
|
4271
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4272
|
+
style: dropdownStyle,
|
|
4273
|
+
onClick: clickHandler,
|
|
4274
|
+
className: _JSXStyle.dynamic([["155200262", [theme$1.layout.radius, isEmpty ? 'none' : theme$1.expressiveness.shadowLarge, theme$1.palette.background]]]) + " " + (classes || ""),
|
|
4275
|
+
children: [children, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
4276
|
+
id: "155200262",
|
|
4277
|
+
dynamic: [theme$1.layout.radius, isEmpty ? 'none' : theme$1.expressiveness.shadowLarge, theme$1.palette.background],
|
|
4278
|
+
children: ".auto-complete-dropdown.__jsx-style-dynamic-selector{border-radius:".concat(theme$1.layout.radius, ";box-shadow:").concat(isEmpty ? 'none' : theme$1.expressiveness.shadowLarge, ";background-color:").concat(theme$1.palette.background, ";overflow-y:auto;max-height:15rem;overflow-anchor:none;}")
|
|
4279
|
+
})]
|
|
4280
|
+
})
|
|
4281
|
+
});
|
|
3372
4282
|
};
|
|
3373
4283
|
AutoCompleteDropdown.displayName = 'AutoCompleteDropdown';
|
|
3374
4284
|
|
|
3375
|
-
// interface Props {
|
|
3376
|
-
// className?: string
|
|
3377
|
-
// }
|
|
3378
|
-
|
|
3379
4285
|
var AutoCompleteSearchComponent = function AutoCompleteSearchComponent(_ref) {
|
|
3380
4286
|
var children = _ref.children,
|
|
3381
4287
|
className = _ref.className;
|
|
3382
4288
|
var theme$1 = theme.useTheme();
|
|
3383
4289
|
var _useScale = useScale(),
|
|
3384
4290
|
SCALES = _useScale.SCALES;
|
|
3385
|
-
return /*#__PURE__*/
|
|
3386
|
-
className: _JSXStyle.dynamic([["2266351824", [theme$1.layout.gapHalf, theme$1.palette.background, theme$1.palette.accents_5, theme$1.layout.radius, SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0.875), SCALES.pr(0.875), SCALES.pb(0.875), SCALES.pl(0.875), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]]) + " " + (className || "")
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
4291
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4292
|
+
className: _JSXStyle.dynamic([["2266351824", [theme$1.layout.gapHalf, theme$1.palette.background, theme$1.palette.accents_5, theme$1.layout.radius, SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0.875), SCALES.pr(0.875), SCALES.pb(0.875), SCALES.pl(0.875), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]]) + " " + (className || ""),
|
|
4293
|
+
children: [children, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
4294
|
+
id: "2266351824",
|
|
4295
|
+
dynamic: [theme$1.layout.gapHalf, theme$1.palette.background, theme$1.palette.accents_5, theme$1.layout.radius, SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0.875), SCALES.pr(0.875), SCALES.pb(0.875), SCALES.pl(0.875), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)],
|
|
4296
|
+
children: "div.__jsx-style-dynamic-selector{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;text-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-weight:normal;white-space:pre;padding:".concat(theme$1.layout.gapHalf, ";line-height:1;background-color:").concat(theme$1.palette.background, ";color:").concat(theme$1.palette.accents_5, ";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:0;border-radius:").concat(theme$1.layout.radius, ";font-size:").concat(SCALES.font(0.875), ";width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0.875), " ").concat(SCALES.pr(0.875), " ").concat(SCALES.pb(0.875), " ").concat(SCALES.pl(0.875), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}")
|
|
4297
|
+
})]
|
|
4298
|
+
});
|
|
3391
4299
|
};
|
|
3392
4300
|
AutoCompleteSearchComponent.displayName = 'AutoCompleteSearch';
|
|
3393
4301
|
var AutoCompleteSearch = withScale(AutoCompleteSearchComponent);
|
|
@@ -3399,60 +4307,13 @@ var AutoCompleteEmpty = function AutoCompleteEmpty(_ref) {
|
|
|
3399
4307
|
_ref$className = _ref.className,
|
|
3400
4308
|
className = _ref$className === void 0 ? '' : _ref$className;
|
|
3401
4309
|
if (hidden) return null;
|
|
3402
|
-
return /*#__PURE__*/
|
|
3403
|
-
className: className
|
|
3404
|
-
|
|
4310
|
+
return /*#__PURE__*/jsxRuntime.jsx(AutoCompleteSearch, {
|
|
4311
|
+
className: className,
|
|
4312
|
+
children: children
|
|
4313
|
+
});
|
|
3405
4314
|
};
|
|
3406
4315
|
AutoCompleteEmpty.displayName = 'AutoCompleteEmpty';
|
|
3407
4316
|
|
|
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
4317
|
var _excluded = ["options", "initialValue", "onSelect", "onSearch", "onChange", "searching", "children", "type", "color", "value", "clearable", "disabled", "dropdownClassName", "dropdownStyle", "disableMatchWidth", "disableFreeSolo", "getPopupContainer"];
|
|
3457
4318
|
var childrenToOptionsNode = function childrenToOptionsNode(options) {
|
|
3458
4319
|
return options.map(function (item, index) {
|
|
@@ -3461,11 +4322,11 @@ var childrenToOptionsNode = function childrenToOptionsNode(options) {
|
|
|
3461
4322
|
key: key
|
|
3462
4323
|
});
|
|
3463
4324
|
var validItem = item;
|
|
3464
|
-
return /*#__PURE__*/
|
|
3465
|
-
key: key,
|
|
4325
|
+
return /*#__PURE__*/jsxRuntime.jsx(AutoCompleteItemComponent, {
|
|
3466
4326
|
value: validItem.value,
|
|
3467
|
-
isLabelOnly: true
|
|
3468
|
-
|
|
4327
|
+
isLabelOnly: true,
|
|
4328
|
+
children: validItem.label
|
|
4329
|
+
}, key);
|
|
3469
4330
|
});
|
|
3470
4331
|
};
|
|
3471
4332
|
|
|
@@ -3474,9 +4335,9 @@ var childrenToOptionsNode = function childrenToOptionsNode(options) {
|
|
|
3474
4335
|
var getSearchIcon = function getSearchIcon(searching) {
|
|
3475
4336
|
var scale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
3476
4337
|
if (searching === undefined) return null;
|
|
3477
|
-
return searching ? /*#__PURE__*/
|
|
4338
|
+
return searching ? /*#__PURE__*/jsxRuntime.jsx(Loading, {
|
|
3478
4339
|
scale: +scale / 2
|
|
3479
|
-
}) : /*#__PURE__*/
|
|
4340
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(icons.ArrowRight, {});
|
|
3480
4341
|
};
|
|
3481
4342
|
var AutoCompleteComponent = /*#__PURE__*/React.forwardRef(function (_ref, userRef) {
|
|
3482
4343
|
var _ref$options = _ref.options,
|
|
@@ -3536,11 +4397,15 @@ var AutoCompleteComponent = /*#__PURE__*/React.forwardRef(function (_ref, userRe
|
|
|
3536
4397
|
var hasSearchChild = searchChild && React.Children.count(searchChild) > 0;
|
|
3537
4398
|
var hasEmptyChild = emptyChild && React.Children.count(emptyChild) > 0;
|
|
3538
4399
|
if (searching) {
|
|
3539
|
-
return hasSearchChild ? searchChild : /*#__PURE__*/
|
|
4400
|
+
return hasSearchChild ? searchChild : /*#__PURE__*/jsxRuntime.jsx(AutoCompleteSearch, {
|
|
4401
|
+
children: "Searching..."
|
|
4402
|
+
});
|
|
3540
4403
|
}
|
|
3541
4404
|
if (options.length === 0) {
|
|
3542
4405
|
if (state === '') return null;
|
|
3543
|
-
return hasEmptyChild ? emptyChild : /*#__PURE__*/
|
|
4406
|
+
return hasEmptyChild ? emptyChild : /*#__PURE__*/jsxRuntime.jsx(AutoCompleteEmpty, {
|
|
4407
|
+
children: "No Options"
|
|
4408
|
+
});
|
|
3544
4409
|
}
|
|
3545
4410
|
return childrenToOptionsNode(options);
|
|
3546
4411
|
}, [searching, options]);
|
|
@@ -3606,37 +4471,41 @@ var AutoCompleteComponent = /*#__PURE__*/React.forwardRef(function (_ref, userRe
|
|
|
3606
4471
|
disabled: disabled,
|
|
3607
4472
|
value: state
|
|
3608
4473
|
});
|
|
3609
|
-
return /*#__PURE__*/
|
|
3610
|
-
value: initialValue
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
4474
|
+
return /*#__PURE__*/jsxRuntime.jsx(AutoCompleteContext.Provider, {
|
|
4475
|
+
value: initialValue,
|
|
4476
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4477
|
+
ref: ref,
|
|
4478
|
+
className: _JSXStyle.dynamic([["2878925540", [SCALES.width(1, 'max-content'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]]) + " " + "auto-complete",
|
|
4479
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Input, _objectSpread2({
|
|
4480
|
+
fullWidth: true,
|
|
4481
|
+
ref: inputRef,
|
|
4482
|
+
type: type,
|
|
4483
|
+
color: color,
|
|
4484
|
+
onChange: onInputChange,
|
|
4485
|
+
onFocus: function onFocus() {
|
|
4486
|
+
return toggleFocusHandler(true);
|
|
4487
|
+
},
|
|
4488
|
+
onBlur: function onBlur() {
|
|
4489
|
+
return toggleFocusHandler(false);
|
|
4490
|
+
},
|
|
4491
|
+
clearable: showClearIcon,
|
|
4492
|
+
width: SCALES.width(1, 'initial'),
|
|
4493
|
+
height: SCALES.height(2.25),
|
|
4494
|
+
iconRight: getSearchIcon(searching, getScaleProps('scale'))
|
|
4495
|
+
}, inputProps)), /*#__PURE__*/jsxRuntime.jsx(AutoCompleteDropdown, {
|
|
4496
|
+
visible: visible,
|
|
4497
|
+
disableMatchWidth: disableMatchWidth,
|
|
4498
|
+
className: dropdownClassName,
|
|
4499
|
+
dropdownStyle: dropdownStyle,
|
|
4500
|
+
getPopupContainer: getPopupContainer,
|
|
4501
|
+
children: autoCompleteItems
|
|
4502
|
+
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
4503
|
+
id: "2878925540",
|
|
4504
|
+
dynamic: [SCALES.width(1, 'max-content'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)],
|
|
4505
|
+
children: ".auto-complete.__jsx-style-dynamic-selector{width:".concat(SCALES.width(1, 'max-content'), ";height:").concat(SCALES.height(1, 'auto'), ";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), ";}.auto-complete.__jsx-style-dynamic-selector .loading{width:-webkit-max-content;width:-moz-max-content;width:max-content;}")
|
|
4506
|
+
})]
|
|
4507
|
+
})
|
|
4508
|
+
});
|
|
3640
4509
|
});
|
|
3641
4510
|
AutoCompleteComponent.displayName = 'AutoComplete';
|
|
3642
4511
|
var AutoComplete = withScale(AutoCompleteComponent);
|