@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.
Files changed (141) hide show
  1. package/dist/auto-complete/index.js +1273 -404
  2. package/dist/avatar/index.js +88 -49
  3. package/dist/badge/index.js +69 -27
  4. package/dist/breadcrumbs/index.js +107 -56
  5. package/dist/button/button.icon.d.ts +3 -16
  6. package/dist/button/button.small.d.ts +3 -16
  7. package/dist/button/index.js +143 -157
  8. package/dist/button-dropdown/index.js +96 -83
  9. package/dist/button-group/index.js +61 -21
  10. package/dist/capacity/index.js +61 -22
  11. package/dist/card/index.js +147 -123
  12. package/dist/carousal/index.js +349 -330
  13. package/dist/checkbox/index.js +72 -67
  14. package/dist/circular-progress/CircularProgress.d.ts +17 -0
  15. package/dist/circular-progress/index.d.ts +3 -4
  16. package/dist/circular-progress/index.js +713 -336
  17. package/dist/circular-progress/useCircularProgress.d.ts +12 -0
  18. package/dist/code/index.js +70 -26
  19. package/dist/col/index.js +61 -24
  20. package/dist/collapse/index.js +102 -52
  21. package/dist/container/index.js +187 -190
  22. package/dist/copy-to-clipboard/index.js +158 -210
  23. package/dist/description/index.js +64 -23
  24. package/dist/display/index.js +64 -23
  25. package/dist/divider/index.js +62 -22
  26. package/dist/dot/index.js +63 -23
  27. package/dist/drawer/index.js +74 -61
  28. package/dist/fieldset/index.js +127 -63
  29. package/dist/form/index.js +15 -40
  30. package/dist/grid/index.js +74 -29
  31. package/dist/html-renderer/index.js +3 -2
  32. package/dist/image/index.js +163 -104
  33. package/dist/index.d.ts +2 -1
  34. package/dist/index.js +5240 -4755
  35. package/dist/input/index.js +1183 -277
  36. package/dist/keyboard/index.js +73 -29
  37. package/dist/linear-progress/index.js +27 -24
  38. package/dist/link/index.js +78 -36
  39. package/dist/list/index.js +118 -63
  40. package/dist/loadable/index.js +76 -27
  41. package/dist/loading/index.js +70 -29
  42. package/dist/menu/index.js +53 -47
  43. package/dist/modal/index.js +225 -178
  44. package/dist/note/index.js +64 -23
  45. package/dist/notetip/index.js +54 -45
  46. package/dist/notetip/note-tip.d.ts +2 -0
  47. package/dist/page/index.js +102 -51
  48. package/dist/pagination/index.js +181 -124
  49. package/dist/placeholder/index.js +554 -538
  50. package/dist/popover/index.js +94 -81
  51. package/dist/progress/index.js +66 -27
  52. package/dist/radio/index.js +94 -48
  53. package/dist/rating/index.js +78 -38
  54. package/dist/row/index.js +62 -25
  55. package/dist/search-bar/index.js +172 -162
  56. package/dist/select/index.js +1098 -163
  57. package/dist/select/select.d.ts +2 -0
  58. package/dist/slider/index.js +91 -47
  59. package/dist/snippet/index.js +39 -39
  60. package/dist/spacer/index.js +58 -19
  61. package/dist/spinner/index.js +69 -28
  62. package/dist/swipe/index.js +28 -13
  63. package/dist/table/index.js +4162 -3863
  64. package/dist/table/table-body.d.ts +4 -3
  65. package/dist/table/table-cell.d.ts +4 -2
  66. package/dist/table/table-types.d.ts +2 -0
  67. package/dist/table/table.d.ts +5 -1
  68. package/dist/tabs/index.js +61 -59
  69. package/dist/tag/index.js +16 -20
  70. package/dist/text/index.js +187 -184
  71. package/dist/text/text.d.ts +3 -0
  72. package/dist/textarea/index.js +916 -36
  73. package/dist/textarea/textarea.d.ts +3 -0
  74. package/dist/toggle/index.js +75 -33
  75. package/dist/tooltip/index.d.ts +1 -2
  76. package/dist/tooltip/index.js +59 -53
  77. package/dist/tooltip/tooltip-content.d.ts +1 -1
  78. package/dist/tooltip/tooltip-small.d.ts +2 -5
  79. package/dist/tooltip/tooltip.d.ts +2 -1
  80. package/dist/tree/index.js +176 -115
  81. package/dist/use-scale/index.js +50 -13
  82. package/dist/user/index.js +152 -100
  83. package/esm/avatar/avatar.js +8 -6
  84. package/esm/button/button.icon.d.ts +3 -16
  85. package/esm/button/button.icon.js +22 -22
  86. package/esm/button/button.js +5 -5
  87. package/esm/button/button.small.d.ts +3 -16
  88. package/esm/button/button.small.js +20 -23
  89. package/esm/circular-progress/CircularProgress.d.ts +17 -0
  90. package/esm/circular-progress/CircularProgress.js +110 -0
  91. package/esm/circular-progress/index.d.ts +3 -4
  92. package/esm/circular-progress/index.js +3 -4
  93. package/esm/circular-progress/useCircularProgress.d.ts +12 -0
  94. package/esm/circular-progress/useCircularProgress.js +35 -0
  95. package/esm/index.d.ts +2 -1
  96. package/esm/index.js +1 -1
  97. package/esm/input/input-field.js +11 -9
  98. package/esm/list/list-item.js +11 -11
  99. package/esm/notetip/note-tip.d.ts +2 -0
  100. package/esm/notetip/note-tip.js +8 -5
  101. package/esm/pagination/pagination-item.js +6 -6
  102. package/esm/select/select.d.ts +2 -0
  103. package/esm/select/select.js +15 -2
  104. package/esm/skeleton/index.js +9 -4
  105. package/esm/table/table-body.d.ts +4 -3
  106. package/esm/table/table-body.js +25 -15
  107. package/esm/table/table-cell.d.ts +4 -2
  108. package/esm/table/table-cell.js +19 -3
  109. package/esm/table/table-types.d.ts +2 -0
  110. package/esm/table/table.d.ts +5 -1
  111. package/esm/table/table.js +52 -25
  112. package/esm/text/text.d.ts +3 -0
  113. package/esm/text/text.js +9 -2
  114. package/esm/textarea/textarea.d.ts +3 -0
  115. package/esm/textarea/textarea.js +19 -2
  116. package/esm/tooltip/index.d.ts +1 -2
  117. package/esm/tooltip/tooltip-content.d.ts +1 -1
  118. package/esm/tooltip/tooltip-content.js +5 -5
  119. package/esm/tooltip/tooltip-small.d.ts +2 -5
  120. package/esm/tooltip/tooltip-small.js +0 -1
  121. package/esm/tooltip/tooltip.d.ts +2 -1
  122. package/esm/tooltip/tooltip.js +6 -5
  123. package/package.json +3 -3
  124. package/dist/circular-progress/CircularProgressbar.d.ts +0 -10
  125. package/dist/circular-progress/CircularProgressbarWithChildren.d.ts +0 -7
  126. package/dist/circular-progress/Path.d.ts +0 -9
  127. package/dist/circular-progress/buildStyles.d.ts +0 -12
  128. package/dist/circular-progress/constants.d.ts +0 -5
  129. package/dist/circular-progress/types.d.ts +0 -50
  130. package/esm/circular-progress/CircularProgressbar.d.ts +0 -10
  131. package/esm/circular-progress/CircularProgressbar.js +0 -118
  132. package/esm/circular-progress/CircularProgressbarWithChildren.d.ts +0 -7
  133. package/esm/circular-progress/CircularProgressbarWithChildren.js +0 -32
  134. package/esm/circular-progress/Path.d.ts +0 -9
  135. package/esm/circular-progress/Path.js +0 -52
  136. package/esm/circular-progress/buildStyles.d.ts +0 -12
  137. package/esm/circular-progress/buildStyles.js +0 -45
  138. package/esm/circular-progress/constants.d.ts +0 -5
  139. package/esm/circular-progress/constants.js +0 -5
  140. package/esm/circular-progress/types.d.ts +0 -50
  141. 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
 
8
9
  function _arrayLikeToArray(r, a) {
9
10
  (null == a || a > r.length) && (a = r.length);
@@ -69,15 +70,6 @@ function _defineProperty(e, r, t) {
69
70
  writable: true
70
71
  }) : e[r] = t, e;
71
72
  }
72
- function _extends() {
73
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
74
- for (var e = 1; e < arguments.length; e++) {
75
- var t = arguments[e];
76
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
77
- }
78
- return n;
79
- }, _extends.apply(null, arguments);
80
- }
81
73
  function _iterableToArrayLimit(r, l) {
82
74
  var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
83
75
  if (null != t) {
@@ -89,7 +81,10 @@ function _iterableToArrayLimit(r, l) {
89
81
  f = true,
90
82
  o = false;
91
83
  try {
92
- if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
84
+ if (i = (t = t.call(r)).next, 0 === l) {
85
+ if (Object(t) !== t) return;
86
+ f = !1;
87
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
93
88
  } catch (r) {
94
89
  o = true, n = r;
95
90
  } finally {
@@ -767,7 +762,7 @@ var ScalePropKeys = ['width', 'height', 'padding', 'margin', 'w', 'h', 'paddingL
767
762
  var defaultDynamicLayoutPipe = function defaultDynamicLayoutPipe(scale1x) {
768
763
  return "".concat(scale1x);
769
764
  };
770
- var defaultContext = {
765
+ var defaultContext$1 = {
771
766
  getScaleProps: function getScaleProps() {
772
767
  return undefined;
773
768
  },
@@ -793,7 +788,7 @@ var defaultContext = {
793
788
  },
794
789
  unit: '16px'
795
790
  };
796
- var ScaleContext = /*#__PURE__*/React.createContext(defaultContext);
791
+ var ScaleContext = /*#__PURE__*/React.createContext(defaultContext$1);
797
792
  var useScale = function useScale() {
798
793
  return React.useContext(ScaleContext);
799
794
  };
@@ -850,7 +845,7 @@ var generateGetAllScaleProps = function generateGetAllScaleProps(props) {
850
845
  return getAllScaleProps;
851
846
  };
852
847
 
853
- var _excluded$1 = ["children"];
848
+ var _excluded$6 = ["children"];
854
849
  var reduceScaleCoefficient = function reduceScaleCoefficient(scale) {
855
850
  if (scale === 1) return scale;
856
851
  var diff = Math.abs((scale - 1) / 2);
@@ -860,7 +855,7 @@ var withScale = function withScale(Render) {
860
855
  var ScaleFC = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
861
856
  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;
862
857
  var children = _ref.children,
863
- props = _objectWithoutProperties(_ref, _excluded$1);
858
+ props = _objectWithoutProperties(_ref, _excluded$6);
864
859
  var _useTheme = theme.useTheme(),
865
860
  layout = _useTheme.layout;
866
861
  var paddingLeft = props.paddingLeft,
@@ -933,17 +928,881 @@ var withScale = function withScale(Render) {
933
928
  getScaleProps: generateGetScaleProps(props),
934
929
  getAllScaleProps: generateGetAllScaleProps(props)
935
930
  };
936
- return /*#__PURE__*/React.createElement(ScaleContext.Provider, {
937
- value: value
938
- }, /*#__PURE__*/React.createElement(Render, _extends({}, props, {
939
- ref: ref
940
- }), children));
931
+ return /*#__PURE__*/jsxRuntime.jsx(ScaleContext.Provider, {
932
+ value: value,
933
+ children: /*#__PURE__*/jsxRuntime.jsx(Render, _objectSpread2(_objectSpread2({}, props), {}, {
934
+ ref: ref,
935
+ children: children
936
+ }))
937
+ });
941
938
  });
942
939
  ScaleFC.displayName = "Scale".concat(Render.displayName || 'Wrapper');
943
940
  return ScaleFC;
944
941
  };
945
942
 
946
- var _excluded = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "resize"];
943
+ var _excluded$5 = ["children", "tag", "className", "color"];
944
+ var getTypeColor = function getTypeColor(type, palette) {
945
+ var colors = {
946
+ "default": 'inherit',
947
+ secondary: palette.secondary,
948
+ success: palette.success,
949
+ warning: palette.warning,
950
+ error: palette.error
951
+ };
952
+ return colors[type] || colors["default"];
953
+ };
954
+ var TextChild = function TextChild(_ref) {
955
+ var children = _ref.children,
956
+ tag = _ref.tag,
957
+ _ref$className = _ref.className,
958
+ className = _ref$className === void 0 ? '' : _ref$className,
959
+ _ref$color = _ref.color,
960
+ color = _ref$color === void 0 ? 'default' : _ref$color,
961
+ props = _objectWithoutProperties(_ref, _excluded$5);
962
+ var Component = tag;
963
+ var theme$1 = theme.useTheme();
964
+ var _useScale = useScale(),
965
+ SCALES = _useScale.SCALES,
966
+ getScaleProps = _useScale.getScaleProps;
967
+ var font = getScaleProps('font');
968
+ var mx = getScaleProps(['margin', 'marginLeft', 'marginRight', 'mx', 'ml', 'mr']);
969
+ var my = getScaleProps(['margin', 'marginTop', 'marginBottom', 'my', 'mt', 'mb']);
970
+ var px = getScaleProps(['padding', 'paddingLeft', 'paddingRight', 'pl', 'pr', 'px']);
971
+ var py = getScaleProps(['padding', 'paddingTop', 'paddingBottom', 'pt', 'pb', 'py']);
972
+ var _color = React.useMemo(function () {
973
+ return getTypeColor(color, theme$1.palette);
974
+ }, [color, theme$1.palette]);
975
+ var classNames = React.useMemo(function () {
976
+ var keys = [{
977
+ value: mx,
978
+ className: 'mx'
979
+ }, {
980
+ value: my,
981
+ className: 'my'
982
+ }, {
983
+ value: px,
984
+ className: 'px'
985
+ }, {
986
+ value: py,
987
+ className: 'py'
988
+ }, {
989
+ value: font,
990
+ className: 'font'
991
+ }];
992
+ var scaleClassNames = keys.reduce(function (pre, next) {
993
+ if (typeof next.value === 'undefined') return pre;
994
+ return "".concat(pre, " ").concat(next.className);
995
+ }, '');
996
+ return "".concat(scaleClassNames, " ").concat(className).trim();
997
+ }, [mx, my, px, py, font, className]);
998
+ return /*#__PURE__*/jsxRuntime.jsxs(Component, _objectSpread2(_objectSpread2({}, props), {}, {
999
+ 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 || ""),
1000
+ children: [children, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
1001
+ id: "2277774325",
1002
+ 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')],
1003
+ 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;}")
1004
+ })]
1005
+ }));
1006
+ };
1007
+ TextChild.displayName = 'TextChild';
1008
+
1009
+ var ButtonDrip = function ButtonDrip(_ref) {
1010
+ var _ref$x = _ref.x,
1011
+ x = _ref$x === void 0 ? 0 : _ref$x,
1012
+ _ref$y = _ref.y,
1013
+ y = _ref$y === void 0 ? 0 : _ref$y,
1014
+ color = _ref.color,
1015
+ onCompleted = _ref.onCompleted;
1016
+ var dripRef = React.useRef(null);
1017
+ /* istanbul ignore next */
1018
+ var top = Number.isNaN(+y) ? 0 : y - 10;
1019
+ /* istanbul ignore next */
1020
+ var left = Number.isNaN(+x) ? 0 : x - 10;
1021
+ React.useEffect(function () {
1022
+ /* istanbul ignore next */
1023
+ if (!dripRef.current) return;
1024
+ dripRef.current.addEventListener('animationend', onCompleted);
1025
+ return function () {
1026
+ /* istanbul ignore next */
1027
+ if (!dripRef.current) return;
1028
+ dripRef.current.removeEventListener('animationend', onCompleted);
1029
+ };
1030
+ });
1031
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
1032
+ ref: dripRef,
1033
+ className: "jsx-3424889537" + " " + "drip",
1034
+ children: [/*#__PURE__*/jsxRuntime.jsx("svg", {
1035
+ width: "20",
1036
+ height: "20",
1037
+ viewBox: "0 0 20 20",
1038
+ style: {
1039
+ top: top,
1040
+ left: left
1041
+ },
1042
+ className: "jsx-3424889537",
1043
+ children: /*#__PURE__*/jsxRuntime.jsx("g", {
1044
+ stroke: "none",
1045
+ strokeWidth: "1",
1046
+ fill: "none",
1047
+ fillRule: "evenodd",
1048
+ className: "jsx-3424889537",
1049
+ children: /*#__PURE__*/jsxRuntime.jsx("g", {
1050
+ fill: color,
1051
+ className: "jsx-3424889537",
1052
+ children: /*#__PURE__*/jsxRuntime.jsx("rect", {
1053
+ width: "100%",
1054
+ height: "100%",
1055
+ rx: "10",
1056
+ className: "jsx-3424889537"
1057
+ })
1058
+ })
1059
+ })
1060
+ }), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
1061
+ id: "3424889537",
1062
+ 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;}}"
1063
+ })]
1064
+ });
1065
+ };
1066
+ ButtonDrip.displayName = 'ButtonDrip';
1067
+
1068
+ var _excluded$4 = ["children", "type", "color", "className", "spaceRatio"];
1069
+ var getIconBgColor = function getIconBgColor(type, palette, color) {
1070
+ var colors = {
1071
+ "default": palette.accents_6,
1072
+ secondary: palette.secondary,
1073
+ success: palette.success,
1074
+ warning: palette.warning,
1075
+ error: palette.error
1076
+ };
1077
+ return color ? color : colors[type];
1078
+ };
1079
+ var LoadingComponent = function LoadingComponent(_ref) {
1080
+ var children = _ref.children,
1081
+ _ref$type = _ref.type,
1082
+ type = _ref$type === void 0 ? 'default' : _ref$type,
1083
+ color = _ref.color,
1084
+ _ref$className = _ref.className,
1085
+ className = _ref$className === void 0 ? '' : _ref$className,
1086
+ _ref$spaceRatio = _ref.spaceRatio,
1087
+ spaceRatio = _ref$spaceRatio === void 0 ? 1 : _ref$spaceRatio,
1088
+ props = _objectWithoutProperties(_ref, _excluded$4);
1089
+ var theme$1 = theme.useTheme();
1090
+ var _useScale = useScale(),
1091
+ SCALES = _useScale.SCALES;
1092
+ var classes = theme.useClasses('loading-container', className);
1093
+ var bgColor = React.useMemo(function () {
1094
+ return getIconBgColor(type, theme$1.palette, color);
1095
+ }, [type, theme$1.palette, color]);
1096
+ return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread2(_objectSpread2({}, props), {}, {
1097
+ 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 || ""),
1098
+ children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
1099
+ 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",
1100
+ children: [children && /*#__PURE__*/jsxRuntime.jsx("label", {
1101
+ 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]]]),
1102
+ children: children
1103
+ }), /*#__PURE__*/jsxRuntime.jsx("i", {
1104
+ 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]]])
1105
+ }), /*#__PURE__*/jsxRuntime.jsx("i", {
1106
+ 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]]])
1107
+ }), /*#__PURE__*/jsxRuntime.jsx("i", {
1108
+ 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]]])
1109
+ })]
1110
+ }), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
1111
+ id: "2201634259",
1112
+ 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],
1113
+ 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;}}")
1114
+ })]
1115
+ }));
1116
+ };
1117
+ LoadingComponent.displayName = 'Loading';
1118
+ var Loading = withScale(LoadingComponent);
1119
+
1120
+ var ButtonLoading = function ButtonLoading(_ref) {
1121
+ var color = _ref.color;
1122
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
1123
+ className: "jsx-212623367" + " " + "btn-loading",
1124
+ children: [/*#__PURE__*/jsxRuntime.jsx(Loading, {
1125
+ color: color
1126
+ }), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
1127
+ id: "212623367",
1128
+ 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);}"
1129
+ })]
1130
+ });
1131
+ };
1132
+ ButtonLoading.displayName = 'ButtonLoading';
1133
+
1134
+ var _excluded$3 = ["isRight", "isSingle", "children", "className"];
1135
+ var ButtonIcon = function ButtonIcon(_ref) {
1136
+ var _ref$isRight = _ref.isRight,
1137
+ isRight = _ref$isRight === void 0 ? false : _ref$isRight,
1138
+ isSingle = _ref.isSingle,
1139
+ children = _ref.children,
1140
+ _ref$className = _ref.className,
1141
+ className = _ref$className === void 0 ? '' : _ref$className,
1142
+ props = _objectWithoutProperties(_ref, _excluded$3);
1143
+ var classes = theme.useClasses('icon', {
1144
+ right: isRight,
1145
+ single: isSingle
1146
+ }, className);
1147
+ return /*#__PURE__*/jsxRuntime.jsxs("span", _objectSpread2(_objectSpread2({}, props), {}, {
1148
+ className: "jsx-2467502931" + " " + (props && props.className != null && props.className || classes || ""),
1149
+ children: [children, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
1150
+ id: "2467502931",
1151
+ 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;}"
1152
+ })]
1153
+ }));
1154
+ };
1155
+ ButtonIcon.displayName = 'ButtonIcon';
1156
+
1157
+ var getButtonChildrenWithIcon = function getButtonChildrenWithIcon(auto, children, icons) {
1158
+ var icon = icons.icon,
1159
+ iconRight = icons.iconRight;
1160
+ var hasIcon = icon || iconRight;
1161
+ var isRight = Boolean(iconRight);
1162
+ var paddingForAutoMode = auto ? "calc(var(--helpdice-ui-button-height) / 2 + var(--helpdice-ui-button-icon-padding) * .5)" : 0;
1163
+ var classes = theme.useClasses('text', isRight ? 'right' : 'left');
1164
+ if (!hasIcon) return /*#__PURE__*/jsxRuntime.jsx("div", {
1165
+ className: "text",
1166
+ children: children
1167
+ });
1168
+ if (React.Children.count(children) === 0) {
1169
+ return /*#__PURE__*/jsxRuntime.jsx(ButtonIcon, {
1170
+ isRight: isRight,
1171
+ isSingle: true,
1172
+ children: hasIcon
1173
+ });
1174
+ }
1175
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1176
+ children: [/*#__PURE__*/jsxRuntime.jsx(ButtonIcon, {
1177
+ isRight: isRight,
1178
+ children: hasIcon
1179
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
1180
+ className: _JSXStyle.dynamic([["3568181479", [paddingForAutoMode, paddingForAutoMode]]]) + " " + (classes || ""),
1181
+ children: [children, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
1182
+ id: "3568181479",
1183
+ dynamic: [paddingForAutoMode, paddingForAutoMode],
1184
+ children: ".left.__jsx-style-dynamic-selector{padding-left:".concat(paddingForAutoMode, ";}.right.__jsx-style-dynamic-selector{padding-right:").concat(paddingForAutoMode, ";}")
1185
+ })]
1186
+ })]
1187
+ });
1188
+ };
1189
+ var filterPropsWithGroup = function filterPropsWithGroup(props, config) {
1190
+ if (!config.isButtonGroup) return props;
1191
+ return _objectSpread2(_objectSpread2({}, props), {}, {
1192
+ auto: true,
1193
+ shadow: false,
1194
+ ghost: config.ghost || props.ghost,
1195
+ type: config.type || props.type,
1196
+ disabled: config.disabled || props.disabled
1197
+ });
1198
+ };
1199
+
1200
+ /* "use client" */
1201
+
1202
+ var defaultContext = {
1203
+ isButtonGroup: false,
1204
+ disabled: false
1205
+ };
1206
+ var ButtonGroupContext = /*#__PURE__*/React.createContext(defaultContext);
1207
+ var useButtonGroupContext = function useButtonGroupContext() {
1208
+ return React.useContext(ButtonGroupContext);
1209
+ };
1210
+
1211
+ var hexToRgb = function hexToRgb(color) {
1212
+ var fullReg = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
1213
+ var full = color.replace(fullReg, function (_, r, g, b) {
1214
+ return "".concat(r).concat(r).concat(g).concat(g).concat(b).concat(b);
1215
+ });
1216
+ var values = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(full);
1217
+ if (!values) {
1218
+ throw new Error("Helpdice UI: Unsupported ".concat(color, " color."));
1219
+ }
1220
+ return [Number.parseInt(values[1], 16), Number.parseInt(values[2], 16), Number.parseInt(values[3], 16)];
1221
+ };
1222
+ var colorToRgbValues = function colorToRgbValues(color) {
1223
+ if (color.charAt(0) === '#') return hexToRgb(color);
1224
+ var safeColor = color.replace(/ /g, '');
1225
+ var colorType = color.substr(0, 4);
1226
+ var regArray = safeColor.match(/\((.+)\)/);
1227
+ if (!colorType.startsWith('rgb') || !regArray) {
1228
+ console.log(color);
1229
+ throw new Error("Helpdice UI: Only support [\"RGB\", \"RGBA\", \"HEX\"] color.");
1230
+ }
1231
+ return regArray[1].split(',').map(function (str) {
1232
+ return Number.parseFloat(str);
1233
+ });
1234
+ };
1235
+ var addColorAlpha = function addColorAlpha(color, alpha) {
1236
+ if (!/^#|rgb|RGB/.test(color)) return color;
1237
+ var _colorToRgbValues = colorToRgbValues(color),
1238
+ _colorToRgbValues2 = _slicedToArray(_colorToRgbValues, 3),
1239
+ r = _colorToRgbValues2[0],
1240
+ g = _colorToRgbValues2[1],
1241
+ b = _colorToRgbValues2[2];
1242
+ var safeAlpha = alpha > 1 ? 1 : alpha < 0 ? 0 : alpha;
1243
+ return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(safeAlpha, ")");
1244
+ };
1245
+
1246
+ var getButtonGhostColors = function getButtonGhostColors(palette, _color) {
1247
+ var colors = {
1248
+ secondary: {
1249
+ bg: palette.background,
1250
+ border: palette.foreground,
1251
+ color: palette.foreground,
1252
+ ripple: ''
1253
+ },
1254
+ success: {
1255
+ bg: palette.background,
1256
+ border: palette.success,
1257
+ color: palette.success,
1258
+ ripple: ''
1259
+ },
1260
+ warning: {
1261
+ bg: palette.background,
1262
+ border: palette.warning,
1263
+ color: palette.warning,
1264
+ ripple: ''
1265
+ },
1266
+ error: {
1267
+ bg: palette.background,
1268
+ border: palette.error,
1269
+ color: palette.error,
1270
+ ripple: ''
1271
+ }
1272
+ };
1273
+ return colors[_color] || null;
1274
+ };
1275
+ var getButtonColors = function getButtonColors(palette, props) {
1276
+ var color = props.color,
1277
+ disabled = props.disabled,
1278
+ ghost = props.ghost;
1279
+ var colors = {
1280
+ "default": {
1281
+ bg: palette.background,
1282
+ border: palette.border,
1283
+ color: palette.accents_5,
1284
+ ripple: palette.accents_1
1285
+ },
1286
+ secondary: {
1287
+ bg: palette.foreground,
1288
+ border: palette.foreground,
1289
+ color: palette.background,
1290
+ ripple: palette.accents_1
1291
+ },
1292
+ success: {
1293
+ bg: palette.success,
1294
+ border: palette.success,
1295
+ color: '#fff',
1296
+ ripple: '#1f93ffff'
1297
+ },
1298
+ warning: {
1299
+ bg: palette.warning,
1300
+ border: palette.warning,
1301
+ color: '#fff',
1302
+ ripple: '#ffca29ff'
1303
+ },
1304
+ error: {
1305
+ bg: palette.error,
1306
+ border: palette.error,
1307
+ color: '#fff',
1308
+ ripple: '#ff5a55ff'
1309
+ },
1310
+ abort: {
1311
+ bg: 'transparent',
1312
+ border: 'transparent',
1313
+ color: palette.accents_5,
1314
+ ripple: palette.accents_1
1315
+ }
1316
+ };
1317
+ if (disabled) return {
1318
+ bg: palette.accents_1,
1319
+ border: palette.accents_2,
1320
+ color: '#ccc',
1321
+ ripple: ''
1322
+ };
1323
+
1324
+ /**
1325
+ * The '-light' type is the same color as the common type,
1326
+ * only hover's color is different.
1327
+ * e.g.
1328
+ * Color['success'] === Color['success-light']
1329
+ * Color['warning'] === Color['warning-light']
1330
+ */
1331
+ var withoutLightType = color === null || color === void 0 ? void 0 : color.replace('-light', '');
1332
+ var defaultColor = colors["default"];
1333
+ if (ghost) return getButtonGhostColors(palette, withoutLightType) || defaultColor;
1334
+ return colors[withoutLightType] || defaultColor;
1335
+ };
1336
+ var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette, _color) {
1337
+ var colors = {
1338
+ secondary: {
1339
+ bg: palette.foreground,
1340
+ border: palette.background,
1341
+ color: palette.background
1342
+ },
1343
+ success: {
1344
+ bg: palette.success,
1345
+ border: palette.background,
1346
+ color: 'white'
1347
+ },
1348
+ warning: {
1349
+ bg: palette.warning,
1350
+ border: palette.background,
1351
+ color: 'white'
1352
+ },
1353
+ error: {
1354
+ bg: palette.error,
1355
+ border: palette.background,
1356
+ color: 'white'
1357
+ }
1358
+ };
1359
+ var withoutLightType = _color === null || _color === void 0 ? void 0 : _color.replace('-light', '');
1360
+ return colors[withoutLightType] || null;
1361
+ };
1362
+ var getButtonHoverColors = function getButtonHoverColors(palette, props) {
1363
+ var color = props.color,
1364
+ disabled = props.disabled,
1365
+ loading = props.loading,
1366
+ shadow = props.shadow,
1367
+ ghost = props.ghost;
1368
+ var defaultColor = getButtonColors(palette, props);
1369
+ var alphaBackground = addColorAlpha(defaultColor.bg, 0.85);
1370
+ var colors = {
1371
+ "default": {
1372
+ bg: palette.background,
1373
+ border: palette.foreground
1374
+ },
1375
+ secondary: {
1376
+ bg: palette.background,
1377
+ border: palette.foreground
1378
+ },
1379
+ success: {
1380
+ bg: palette.background,
1381
+ border: palette.success
1382
+ },
1383
+ warning: {
1384
+ bg: palette.background,
1385
+ border: palette.warning
1386
+ },
1387
+ error: {
1388
+ bg: palette.background,
1389
+ border: palette.error
1390
+ },
1391
+ abort: {
1392
+ bg: 'transparent',
1393
+ border: 'transparent',
1394
+ color: palette.accents_5
1395
+ },
1396
+ 'secondary-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
1397
+ bg: alphaBackground
1398
+ }),
1399
+ 'success-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
1400
+ bg: alphaBackground
1401
+ }),
1402
+ 'warning-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
1403
+ bg: alphaBackground
1404
+ }),
1405
+ 'error-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
1406
+ bg: alphaBackground
1407
+ })
1408
+ };
1409
+ if (disabled) return {
1410
+ bg: palette.accents_1,
1411
+ border: palette.accents_2,
1412
+ color: '#ccc'
1413
+ };
1414
+ if (loading) return _objectSpread2(_objectSpread2({}, defaultColor), {}, {
1415
+ color: 'transparent'
1416
+ });
1417
+ if (shadow) return defaultColor;
1418
+ var hoverColor = (ghost ? getButtonGhostHoverColors(palette, color) : colors[color]) || colors["default"];
1419
+ return _objectSpread2(_objectSpread2({}, hoverColor), {}, {
1420
+ color: hoverColor.color || hoverColor.border
1421
+ });
1422
+ };
1423
+ var getButtonCursor = function getButtonCursor(disabled, loading) {
1424
+ if (disabled) return {
1425
+ cursor: 'not-allowed',
1426
+ events: 'auto'
1427
+ };
1428
+ if (loading) return {
1429
+ cursor: 'default',
1430
+ events: 'none'
1431
+ };
1432
+ return {
1433
+ cursor: 'pointer',
1434
+ events: 'auto'
1435
+ };
1436
+ };
1437
+ var getButtonDripColor = function getButtonDripColor(palette, props) {
1438
+ var type = props.type;
1439
+ var isLightHover = type ? type.endsWith('light') : false;
1440
+ var hoverColors = getButtonHoverColors(palette, props);
1441
+ return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
1442
+ };
1443
+
1444
+ var _excluded$2 = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "relative", "replace", "a", "to", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
1445
+ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
1446
+ var theme$1 = theme.useTheme();
1447
+ // const navigate = useNavigate();
1448
+ var _useScale = useScale(),
1449
+ SCALES = _useScale.SCALES;
1450
+ var buttonRef = React.useRef(null);
1451
+ React.useImperativeHandle(ref, function () {
1452
+ return buttonRef.current;
1453
+ }); // Changed with !
1454
+
1455
+ var _useState = React.useState(false),
1456
+ _useState2 = _slicedToArray(_useState, 2),
1457
+ dripShow = _useState2[0],
1458
+ setDripShow = _useState2[1];
1459
+ var _useState3 = React.useState(0),
1460
+ _useState4 = _slicedToArray(_useState3, 2),
1461
+ dripX = _useState4[0],
1462
+ setDripX = _useState4[1];
1463
+ var _useState5 = React.useState(0),
1464
+ _useState6 = _slicedToArray(_useState5, 2),
1465
+ dripY = _useState6[0],
1466
+ setDripY = _useState6[1];
1467
+ var groupConfig = useButtonGroupContext();
1468
+ var filteredProps = filterPropsWithGroup(btnProps, groupConfig);
1469
+ /* eslint-disable @typescript-eslint/no-unused-vars */
1470
+ var children = filteredProps.children,
1471
+ _filteredProps$disabl = filteredProps.disabled,
1472
+ disabled = _filteredProps$disabl === void 0 ? false : _filteredProps$disabl;
1473
+ filteredProps.color;
1474
+ var _filteredProps$loadin = filteredProps.loading,
1475
+ loading = _filteredProps$loadin === void 0 ? false : _filteredProps$loadin,
1476
+ _filteredProps$shadow = filteredProps.shadow,
1477
+ shadow = _filteredProps$shadow === void 0 ? false : _filteredProps$shadow,
1478
+ _filteredProps$ghost = filteredProps.ghost,
1479
+ ghost = _filteredProps$ghost === void 0 ? false : _filteredProps$ghost,
1480
+ _filteredProps$effect = filteredProps.effect,
1481
+ effect = _filteredProps$effect === void 0 ? true : _filteredProps$effect,
1482
+ _filteredProps$round = filteredProps.round,
1483
+ round = _filteredProps$round === void 0 ? false : _filteredProps$round;
1484
+ filteredProps.relative;
1485
+ filteredProps.replace;
1486
+ filteredProps.a;
1487
+ var to = filteredProps.to,
1488
+ onClick = filteredProps.onClick,
1489
+ _filteredProps$auto = filteredProps.auto,
1490
+ auto = _filteredProps$auto === void 0 ? false : _filteredProps$auto,
1491
+ icon = filteredProps.icon,
1492
+ _filteredProps$type = filteredProps.type,
1493
+ type = _filteredProps$type === void 0 ? 'button' : _filteredProps$type,
1494
+ iconRight = filteredProps.iconRight,
1495
+ _filteredProps$classN = filteredProps.className,
1496
+ className = _filteredProps$classN === void 0 ? '' : _filteredProps$classN;
1497
+ filteredProps.crossOrigin;
1498
+ var props = _objectWithoutProperties(filteredProps, _excluded$2);
1499
+ /* eslint-enable @typescript-eslint/no-unused-vars */
1500
+
1501
+ var _useMemo = React.useMemo(function () {
1502
+ return getButtonColors(theme$1.palette, filteredProps);
1503
+ }, [theme$1.palette, filteredProps]),
1504
+ bg = _useMemo.bg,
1505
+ border = _useMemo.border,
1506
+ color = _useMemo.color,
1507
+ rippleColor = _useMemo.ripple;
1508
+ var hover = React.useMemo(function () {
1509
+ return getButtonHoverColors(theme$1.palette, filteredProps);
1510
+ }, [theme$1.palette, filteredProps]);
1511
+ var _useMemo2 = React.useMemo(function () {
1512
+ return getButtonCursor(disabled, loading);
1513
+ }, [disabled, loading]),
1514
+ cursor = _useMemo2.cursor,
1515
+ events = _useMemo2.events;
1516
+ var dripColor = React.useMemo(function () {
1517
+ return getButtonDripColor(theme$1.palette, filteredProps);
1518
+ }, [theme$1.palette, filteredProps]);
1519
+
1520
+ /* istanbul ignore next */
1521
+ var dripCompletedHandle = function dripCompletedHandle() {
1522
+ setDripShow(false);
1523
+ setDripX(0);
1524
+ setDripY(0);
1525
+ };
1526
+ var createRipple = function createRipple(event) {
1527
+ var button = buttonRef.current;
1528
+ if (!button) return;
1529
+ var rect = button.getBoundingClientRect();
1530
+ var size = Math.max(rect.width, rect.height);
1531
+ var x = event.clientX - rect.left - size / 2;
1532
+ var y = event.clientY - rect.top - size / 2;
1533
+ var rippleCount = 1; // number of rings
1534
+ var rippleDelay = 500; // ms between each ripple
1535
+ var _loop = function _loop() {
1536
+ var ripple = document.createElement('span');
1537
+ Object.assign(ripple.style, {
1538
+ position: 'absolute',
1539
+ borderRadius: '50%',
1540
+ backgroundColor: rippleColor,
1541
+ width: "".concat(size, "px"),
1542
+ height: "".concat(size, "px"),
1543
+ left: "".concat(x, "px"),
1544
+ top: "".concat(y, "px"),
1545
+ pointerEvents: 'none',
1546
+ transform: 'scale(0)',
1547
+ opacity: '1',
1548
+ transition: "transform 600ms ease-out ".concat(i * rippleDelay, "ms, opacity 600ms ease-out ").concat(i * rippleDelay, "ms"),
1549
+ zIndex: 1
1550
+ });
1551
+ button.appendChild(ripple);
1552
+
1553
+ // Force reflow to start transition
1554
+ window.getComputedStyle(ripple).opacity;
1555
+ ripple.style.transform = 'scale(2.5)';
1556
+ ripple.style.opacity = '0';
1557
+ ripple.addEventListener('transitionend', function () {
1558
+ ripple.remove();
1559
+ });
1560
+ };
1561
+ for (var i = 0; i < rippleCount; i++) {
1562
+ _loop();
1563
+ }
1564
+ };
1565
+ var clickHandler = function clickHandler(event) {
1566
+ if (disabled || loading) return;
1567
+ var showDrip = !shadow && !ghost && effect;
1568
+ /* istanbul ignore next */
1569
+ if (showDrip && buttonRef.current) {
1570
+ var rect = buttonRef.current.getBoundingClientRect();
1571
+ setDripShow(true);
1572
+ setDripX(event.clientX - rect.left);
1573
+ setDripY(event.clientY - rect.top);
1574
+ }
1575
+ if (shadow) {
1576
+ createRipple(event);
1577
+ }
1578
+ onClick && onClick(event);
1579
+ };
1580
+ var childrenWithIcon = React.useMemo(function () {
1581
+ return getButtonChildrenWithIcon(auto, children, {
1582
+ icon: icon,
1583
+ iconRight: iconRight
1584
+ });
1585
+ }, [auto, children, icon, iconRight]);
1586
+ var paddingLeft = auto ? SCALES.pl(1.15) : SCALES.pl(1.375),
1587
+ paddingRight = auto ? SCALES.pr(1.15) : SCALES.pr(1.375);
1588
+
1589
+ // If shadow provided is string then value other default
1590
+ var btnShadow = typeof shadow === 'string' ? shadow : shadow ? theme$1.shadows.level.z2 : 'none';
1591
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1592
+ children: [to ? /*#__PURE__*/jsxRuntime.jsxs("a", _objectSpread2(_objectSpread2({
1593
+ href: to
1594
+ }, props), {}, {
1595
+ 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) || ""),
1596
+ children: [loading && /*#__PURE__*/jsxRuntime.jsx(ButtonLoading, {
1597
+ color: color
1598
+ }), childrenWithIcon]
1599
+ })) : /*#__PURE__*/jsxRuntime.jsxs("button", _objectSpread2(_objectSpread2({
1600
+ ref: buttonRef,
1601
+ type: type,
1602
+ disabled: disabled,
1603
+ onClick: clickHandler
1604
+ }, props), {}, {
1605
+ 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) || ""),
1606
+ children: [loading && /*#__PURE__*/jsxRuntime.jsx(ButtonLoading, {
1607
+ color: color
1608
+ }), childrenWithIcon, dripShow && /*#__PURE__*/jsxRuntime.jsx(ButtonDrip, {
1609
+ x: dripX,
1610
+ y: dripY,
1611
+ color: dripColor,
1612
+ onCompleted: dripCompletedHandle
1613
+ })]
1614
+ })), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
1615
+ id: "612376042",
1616
+ 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'],
1617
+ 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;}}")
1618
+ })]
1619
+ });
1620
+ });
1621
+ ButtonComponent.displayName = 'Button';
1622
+ var Button = withScale(ButtonComponent);
1623
+
1624
+ var CompactButton = function CompactButton(props) {
1625
+ // const theme = useTheme();
1626
+ return /*#__PURE__*/jsxRuntime.jsx(Button, _objectSpread2(_objectSpread2({
1627
+ scale: 2 / 3,
1628
+ px: 0.6
1629
+ }, _objectSpread2({
1630
+ auto: true
1631
+ }, props)), {}, {
1632
+ children: props.children
1633
+ }));
1634
+ };
1635
+ var IconButton = /*#__PURE__*/React.memo(CompactButton);
1636
+
1637
+ var SmallButton = function SmallButton(props) {
1638
+ // const theme = useTheme();
1639
+ return /*#__PURE__*/jsxRuntime.jsx(Button, _objectSpread2(_objectSpread2({
1640
+ auto: true,
1641
+ scale: 2 / 3,
1642
+ px: 0.6
1643
+ }, props), {}, {
1644
+ children: props.children
1645
+ }));
1646
+ };
1647
+ var SmallButton$1 = /*#__PURE__*/React.memo(SmallButton);
1648
+
1649
+ /* "use client" */
1650
+
1651
+ Button.Icon = IconButton;
1652
+ Button.Small = SmallButton$1;
1653
+
1654
+ var _excluded$1 = ["h1", "h2", "h3", "h4", "h5", "h6", "p", "b", "small", "i", "span", "del", "em", "blockquote", "noWrap", "collapse", "children", "className", "display", "alignItems", "justify"];
1655
+ var _getModifierChild = function getModifierChild(tags, children) {
1656
+ if (!tags.length) return children;
1657
+ var nextTag = tags.slice(1, tags.length);
1658
+ return /*#__PURE__*/jsxRuntime.jsx(TextChild, {
1659
+ tag: tags[0],
1660
+ children: _getModifierChild(nextTag, children)
1661
+ });
1662
+ };
1663
+ var TextComponent = function TextComponent(_ref) {
1664
+ var _ref$h = _ref.h1,
1665
+ h1 = _ref$h === void 0 ? false : _ref$h,
1666
+ _ref$h2 = _ref.h2,
1667
+ h2 = _ref$h2 === void 0 ? false : _ref$h2,
1668
+ _ref$h3 = _ref.h3,
1669
+ h3 = _ref$h3 === void 0 ? false : _ref$h3,
1670
+ _ref$h4 = _ref.h4,
1671
+ h4 = _ref$h4 === void 0 ? false : _ref$h4,
1672
+ _ref$h5 = _ref.h5,
1673
+ h5 = _ref$h5 === void 0 ? false : _ref$h5,
1674
+ _ref$h6 = _ref.h6,
1675
+ h6 = _ref$h6 === void 0 ? false : _ref$h6,
1676
+ _ref$p = _ref.p,
1677
+ p = _ref$p === void 0 ? false : _ref$p,
1678
+ _ref$b = _ref.b,
1679
+ b = _ref$b === void 0 ? false : _ref$b,
1680
+ _ref$small = _ref.small,
1681
+ small = _ref$small === void 0 ? false : _ref$small,
1682
+ _ref$i = _ref.i,
1683
+ i = _ref$i === void 0 ? false : _ref$i,
1684
+ _ref$span = _ref.span,
1685
+ span = _ref$span === void 0 ? false : _ref$span,
1686
+ _ref$del = _ref.del,
1687
+ del = _ref$del === void 0 ? false : _ref$del,
1688
+ _ref$em = _ref.em,
1689
+ em = _ref$em === void 0 ? false : _ref$em,
1690
+ _ref$blockquote = _ref.blockquote,
1691
+ blockquote = _ref$blockquote === void 0 ? false : _ref$blockquote,
1692
+ _ref$noWrap = _ref.noWrap,
1693
+ noWrap = _ref$noWrap === void 0 ? false : _ref$noWrap,
1694
+ _ref$collapse = _ref.collapse,
1695
+ collapse = _ref$collapse === void 0 ? 0 : _ref$collapse,
1696
+ children = _ref.children,
1697
+ _ref$className = _ref.className,
1698
+ className = _ref$className === void 0 ? '' : _ref$className,
1699
+ _ref$display = _ref.display,
1700
+ display = _ref$display === void 0 ? 'block' : _ref$display,
1701
+ alignItems = _ref.alignItems,
1702
+ justify = _ref.justify,
1703
+ props = _objectWithoutProperties(_ref, _excluded$1);
1704
+ var elements = {
1705
+ h1: h1,
1706
+ h2: h2,
1707
+ h3: h3,
1708
+ h4: h4,
1709
+ h5: h5,
1710
+ h6: h6,
1711
+ p: p,
1712
+ blockquote: blockquote
1713
+ };
1714
+ var inlineElements = {
1715
+ span: span,
1716
+ small: small,
1717
+ b: b,
1718
+ em: em,
1719
+ i: i,
1720
+ del: del
1721
+ };
1722
+ var names = Object.keys(elements).filter(function (name) {
1723
+ return elements[name];
1724
+ });
1725
+ var inlineNames = Object.keys(inlineElements).filter(function (name) {
1726
+ return inlineElements[name];
1727
+ });
1728
+
1729
+ /**
1730
+ * Render element "p" only if no element is found.
1731
+ * If there is only one modifier, just rendered one modifier element
1732
+ * e.g.
1733
+ * <Text /> => <p />
1734
+ * <Text em /> => <em />
1735
+ * <Text p em /> => <p><em>children</em></p>
1736
+ *
1737
+ */
1738
+
1739
+ var _useState = React.useState(false),
1740
+ _useState2 = _slicedToArray(_useState, 2),
1741
+ expand = _useState2[0],
1742
+ setExpand = _useState2[1];
1743
+ var tag = React.useMemo(function () {
1744
+ if (names[0]) return names[0];
1745
+ if (inlineNames[0]) return inlineNames[0];
1746
+ return 'p';
1747
+ }, [names, inlineNames]);
1748
+ var renderableChildElements = inlineNames.filter(function (name) {
1749
+ return name !== tag;
1750
+ });
1751
+ var modifers = React.useMemo(function () {
1752
+ if (!renderableChildElements.length) return children;
1753
+ return _getModifierChild(renderableChildElements, children);
1754
+ }, [renderableChildElements, children]);
1755
+ return /*#__PURE__*/jsxRuntime.jsx(TextChild, _objectSpread2(_objectSpread2({
1756
+ style: {
1757
+ textAlign: props.align,
1758
+ display: display,
1759
+ alignItems: alignItems,
1760
+ justifyContent: justify
1761
+ },
1762
+ className: "".concat(className, " ").concat(noWrap ? 'no-wrap' : ''),
1763
+ tag: tag
1764
+ }, props), {}, {
1765
+ children: typeof children === 'string' && collapse > 50 ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1766
+ children: [expand ? modifers : (modifers === null || modifers === void 0 ? void 0 : modifers.toString().substring(0, collapse)) + '...', /*#__PURE__*/jsxRuntime.jsx(Button, {
1767
+ margin: 0,
1768
+ onClick: function onClick() {
1769
+ return setExpand(!expand);
1770
+ },
1771
+ style: {
1772
+ textTransform: 'lowercase'
1773
+ },
1774
+ effect: false,
1775
+ color: "abort",
1776
+ scale: 2 / 3,
1777
+ px: 0.2,
1778
+ py: 0,
1779
+ auto: true,
1780
+ children: /*#__PURE__*/jsxRuntime.jsx("b", {
1781
+ children: expand ? 'less' : 'more'
1782
+ })
1783
+ })]
1784
+ }) : modifers
1785
+ }));
1786
+ };
1787
+ TextComponent.displayName = 'Text';
1788
+ var Text = withScale(TextComponent);
1789
+
1790
+ var InputBlockLabelComponent = function InputBlockLabelComponent(_ref) {
1791
+ var children = _ref.children;
1792
+ var theme$1 = theme.useTheme();
1793
+ return /*#__PURE__*/jsxRuntime.jsxs("label", {
1794
+ className: _JSXStyle.dynamic([["1278828862", [theme$1.palette.accents_6]]]),
1795
+ children: [children, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
1796
+ id: "1278828862",
1797
+ dynamic: [theme$1.palette.accents_6],
1798
+ 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;}")
1799
+ })]
1800
+ });
1801
+ };
1802
+ InputBlockLabelComponent.displayName = 'InputBlockLabel';
1803
+ var InputBlockLabel = /*#__PURE__*/React.memo(InputBlockLabelComponent);
1804
+
1805
+ var _excluded = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "helperText", "error", "label", "resize"];
947
1806
  tuple('none', 'both', 'horizontal', 'vertical', 'initial', 'inherit');
948
1807
  var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
949
1808
  var _ref$type = _ref.type,
@@ -961,6 +1820,9 @@ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
961
1820
  onChange = _ref.onChange,
962
1821
  value = _ref.value,
963
1822
  placeholder = _ref.placeholder,
1823
+ helperText = _ref.helperText,
1824
+ error = _ref.error,
1825
+ label = _ref.label,
964
1826
  _ref$resize = _ref.resize,
965
1827
  resize = _ref$resize === void 0 ? 'none' : _ref$resize,
966
1828
  props = _objectWithoutProperties(_ref, _excluded);
@@ -1016,22 +1878,40 @@ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1016
1878
  defaultValue: initialValue
1017
1879
  };
1018
1880
  var textareaProps = _objectSpread2(_objectSpread2({}, props), controlledValue);
1019
- return /*#__PURE__*/React.createElement("div", {
1020
- 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 || "")
1021
- }, /*#__PURE__*/React.createElement("textarea", _extends({
1022
- ref: textareaRef,
1023
- disabled: disabled,
1024
- placeholder: placeholder,
1025
- readOnly: readOnly,
1026
- onFocus: focusHandler,
1027
- onBlur: blurHandler,
1028
- onChange: changeHandler
1029
- }, textareaProps, {
1030
- 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 || "")
1031
- })), /*#__PURE__*/React.createElement(_JSXStyle, {
1032
- id: "12276481",
1033
- 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]
1034
- }, ".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;}")));
1881
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
1882
+ className: "with-label",
1883
+ children: [label && /*#__PURE__*/jsxRuntime.jsx(InputBlockLabel, {
1884
+ children: label
1885
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
1886
+ 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 || ""),
1887
+ children: [/*#__PURE__*/jsxRuntime.jsx("textarea", _objectSpread2(_objectSpread2({
1888
+ ref: textareaRef,
1889
+ disabled: disabled,
1890
+ placeholder: placeholder,
1891
+ readOnly: readOnly,
1892
+ onFocus: focusHandler,
1893
+ onBlur: blurHandler,
1894
+ onChange: changeHandler
1895
+ }, textareaProps), {}, {
1896
+ 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 || "")
1897
+ })), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
1898
+ id: "12276481",
1899
+ 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],
1900
+ 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;}")
1901
+ })]
1902
+ }), helperText && /*#__PURE__*/jsxRuntime.jsxs(Text, {
1903
+ font: 0.8,
1904
+ style: {
1905
+ marginTop: 0.4,
1906
+ marginRight: 0,
1907
+ marginLeft: 0,
1908
+ marginBottom: '0.4rem',
1909
+ textAlign: 'left'
1910
+ },
1911
+ color: error ? "error" : 'default',
1912
+ children: ["\xA0", helperText]
1913
+ })]
1914
+ });
1035
1915
  });
1036
1916
  TextareaComponent.displayName = 'Textarea';
1037
1917
  var Textarea = withScale(TextareaComponent);