@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
@@ -14,6 +14,9 @@ interface Props {
14
14
  onFocus?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
15
15
  onBlur?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
16
16
  className?: string;
17
+ error?: boolean;
18
+ helperText?: string;
19
+ label?: string;
17
20
  resize?: TextareaResizes;
18
21
  }
19
22
  type NativeAttrs = Omit<React.TextareaHTMLAttributes<any>, keyof Props>;
@@ -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);
@@ -61,14 +62,13 @@ function _createForOfIteratorHelper(r, e) {
61
62
  }
62
63
  };
63
64
  }
64
- function _extends() {
65
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
66
- for (var e = 1; e < arguments.length; e++) {
67
- var t = arguments[e];
68
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
69
- }
70
- return n;
71
- }, _extends.apply(null, arguments);
65
+ function _defineProperty(e, r, t) {
66
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
67
+ value: t,
68
+ enumerable: true,
69
+ configurable: true,
70
+ writable: true
71
+ }) : e[r] = t, e;
72
72
  }
73
73
  function _iterableToArrayLimit(r, l) {
74
74
  var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
@@ -97,6 +97,27 @@ function _iterableToArrayLimit(r, l) {
97
97
  function _nonIterableRest() {
98
98
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
99
99
  }
100
+ function ownKeys(e, r) {
101
+ var t = Object.keys(e);
102
+ if (Object.getOwnPropertySymbols) {
103
+ var o = Object.getOwnPropertySymbols(e);
104
+ r && (o = o.filter(function (r) {
105
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
106
+ })), t.push.apply(t, o);
107
+ }
108
+ return t;
109
+ }
110
+ function _objectSpread2(e) {
111
+ for (var r = 1; r < arguments.length; r++) {
112
+ var t = null != arguments[r] ? arguments[r] : {};
113
+ r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
114
+ _defineProperty(e, r, t[r]);
115
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
116
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
117
+ });
118
+ }
119
+ return e;
120
+ }
100
121
  function _objectWithoutProperties(e, t) {
101
122
  if (null == e) return {};
102
123
  var o,
@@ -120,6 +141,20 @@ function _objectWithoutPropertiesLoose(r, e) {
120
141
  function _slicedToArray(r, e) {
121
142
  return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
122
143
  }
144
+ function _toPrimitive(t, r) {
145
+ if ("object" != typeof t || !t) return t;
146
+ var e = t[Symbol.toPrimitive];
147
+ if (void 0 !== e) {
148
+ var i = e.call(t, r);
149
+ if ("object" != typeof i) return i;
150
+ throw new TypeError("@@toPrimitive must return a primitive value.");
151
+ }
152
+ return ("string" === r ? String : Number)(t);
153
+ }
154
+ function _toPropertyKey(t) {
155
+ var i = _toPrimitive(t, "string");
156
+ return "symbol" == typeof i ? i : i + "";
157
+ }
123
158
  function _unsupportedIterableToArray(r, a) {
124
159
  if (r) {
125
160
  if ("string" == typeof r) return _arrayLikeToArray(r, a);
@@ -865,11 +900,13 @@ var withScale = function withScale(Render) {
865
900
  getScaleProps: generateGetScaleProps(props),
866
901
  getAllScaleProps: generateGetAllScaleProps(props)
867
902
  };
868
- return /*#__PURE__*/React.createElement(ScaleContext.Provider, {
869
- value: value
870
- }, /*#__PURE__*/React.createElement(Render, _extends({}, props, {
871
- ref: ref
872
- }), children));
903
+ return /*#__PURE__*/jsxRuntime.jsx(ScaleContext.Provider, {
904
+ value: value,
905
+ children: /*#__PURE__*/jsxRuntime.jsx(Render, _objectSpread2(_objectSpread2({}, props), {}, {
906
+ ref: ref,
907
+ children: children
908
+ }))
909
+ });
873
910
  });
874
911
  ScaleFC.displayName = "Scale".concat(Render.displayName || 'Wrapper');
875
912
  return ScaleFC;
@@ -921,26 +958,31 @@ var ToggleComponent = function ToggleComponent(_ref) {
921
958
  if (checked === undefined) return;
922
959
  setSelfChecked(checked);
923
960
  }, [checked]);
924
- return /*#__PURE__*/React.createElement("div", {
925
- className: _JSXStyle.dynamic([["517931406", [disabled ? 'not-allowed' : 'pointer', SCALES.font(1), SCALES.height(0.875), SCALES.width(1.75), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_2, theme$1.palette.background, theme$1.palette.accents_2, theme$1.palette.accents_1, theme$1.palette.accents_2, theme$1.palette.accents_4, theme$1.palette.accents_4, bg]]]) + " " + "toggle-container"
926
- }, children && /*#__PURE__*/React.createElement("span", {
927
- className: _JSXStyle.dynamic([["517931406", [disabled ? 'not-allowed' : 'pointer', SCALES.font(1), SCALES.height(0.875), SCALES.width(1.75), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_2, theme$1.palette.background, theme$1.palette.accents_2, theme$1.palette.accents_1, theme$1.palette.accents_2, theme$1.palette.accents_4, theme$1.palette.accents_4, bg]]]) + " " + "toggle-label"
928
- }, children), /*#__PURE__*/React.createElement("label", _extends({}, props, {
929
- className: _JSXStyle.dynamic([["517931406", [disabled ? 'not-allowed' : 'pointer', SCALES.font(1), SCALES.height(0.875), SCALES.width(1.75), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_2, theme$1.palette.background, theme$1.palette.accents_2, theme$1.palette.accents_1, theme$1.palette.accents_2, theme$1.palette.accents_4, theme$1.palette.accents_4, bg]]]) + " " + (props && props.className != null && props.className || className || "")
930
- }), /*#__PURE__*/React.createElement("input", {
931
- type: "checkbox",
932
- disabled: disabled,
933
- checked: selfChecked,
934
- onChange: changeHandle,
935
- className: _JSXStyle.dynamic([["517931406", [disabled ? 'not-allowed' : 'pointer', SCALES.font(1), SCALES.height(0.875), SCALES.width(1.75), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_2, theme$1.palette.background, theme$1.palette.accents_2, theme$1.palette.accents_1, theme$1.palette.accents_2, theme$1.palette.accents_4, theme$1.palette.accents_4, bg]]])
936
- }), /*#__PURE__*/React.createElement("div", {
937
- className: _JSXStyle.dynamic([["517931406", [disabled ? 'not-allowed' : 'pointer', SCALES.font(1), SCALES.height(0.875), SCALES.width(1.75), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_2, theme$1.palette.background, theme$1.palette.accents_2, theme$1.palette.accents_1, theme$1.palette.accents_2, theme$1.palette.accents_4, theme$1.palette.accents_4, bg]]]) + " " + (classes || "")
938
- }, /*#__PURE__*/React.createElement("span", {
939
- className: _JSXStyle.dynamic([["517931406", [disabled ? 'not-allowed' : 'pointer', SCALES.font(1), SCALES.height(0.875), SCALES.width(1.75), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_2, theme$1.palette.background, theme$1.palette.accents_2, theme$1.palette.accents_1, theme$1.palette.accents_2, theme$1.palette.accents_4, theme$1.palette.accents_4, bg]]]) + " " + "inner"
940
- }))), /*#__PURE__*/React.createElement(_JSXStyle, {
941
- id: "517931406",
942
- dynamic: [disabled ? 'not-allowed' : 'pointer', SCALES.font(1), SCALES.height(0.875), SCALES.width(1.75), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_2, theme$1.palette.background, theme$1.palette.accents_2, theme$1.palette.accents_1, theme$1.palette.accents_2, theme$1.palette.accents_4, theme$1.palette.accents_4, bg]
943
- }, ".toggle-container.__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;gap:5;height:var(--toggle-height);}.toggle-label.__jsx-style-dynamic-selector{margin-right:0.7rem;}label.__jsx-style-dynamic-selector{-webkit-tap-highlight-color:transparent;display:inline-block;vertical-align:middle;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;cursor:".concat(disabled ? 'not-allowed' : 'pointer', ";--toggle-font-size:").concat(SCALES.font(1), ";--toggle-height:").concat(SCALES.height(0.875), ";width:").concat(SCALES.width(1.75), ";height:var(--toggle-height);margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}input.__jsx-style-dynamic-selector{overflow:hidden;visibility:hidden;height:0;opacity:0;width:0;position:absolute;background-color:transparent;z-index:-1;}.toggle.__jsx-style-dynamic-selector{height:var(--toggle-height);width:100%;border-radius:var(--toggle-height);-webkit-transition-delay:0.12s;transition-delay:0.12s;-webkit-transition-duration:0.2s;transition-duration:0.2s;-webkit-transition-property:background,border;transition-property:background,border;-webkit-transition-timing-function:cubic-bezier(0,0,0.2,1);transition-timing-function:cubic-bezier(0,0,0.2,1);position:relative;border:1px solid transparent;background-color:").concat(theme$1.palette.accents_2, ";padding:0;}.inner.__jsx-style-dynamic-selector{width:calc(var(--toggle-height) - 2px);height:calc(var(--toggle-height) - 2px);position:absolute;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);left:1px;box-shadow:rgba(0,0,0,0.2) 0 1px 2px 0,rgba(0,0,0,0.1) 0 1px 3px 0;-webkit-transition:left 280ms cubic-bezier(0,0,0.2,1);transition:left 280ms cubic-bezier(0,0,0.2,1);border-radius:50%;background-color:").concat(theme$1.palette.background, ";}.disabled.__jsx-style-dynamic-selector{border-color:").concat(theme$1.palette.accents_2, ";background-color:").concat(theme$1.palette.accents_1, ";}.disabled.__jsx-style-dynamic-selector>.inner.__jsx-style-dynamic-selector{background-color:").concat(theme$1.palette.accents_2, ";}.disabled.checked.__jsx-style-dynamic-selector{border-color:").concat(theme$1.palette.accents_4, ";background-color:").concat(theme$1.palette.accents_4, ";}.checked.__jsx-style-dynamic-selector{background-color:").concat(bg, ";}.checked.__jsx-style-dynamic-selector>.inner.__jsx-style-dynamic-selector{left:calc(100% - (var(--toggle-height) - 2px));box-shadow:none;}")));
961
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
962
+ className: _JSXStyle.dynamic([["517931406", [disabled ? 'not-allowed' : 'pointer', SCALES.font(1), SCALES.height(0.875), SCALES.width(1.75), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_2, theme$1.palette.background, theme$1.palette.accents_2, theme$1.palette.accents_1, theme$1.palette.accents_2, theme$1.palette.accents_4, theme$1.palette.accents_4, bg]]]) + " " + "toggle-container",
963
+ children: [children && /*#__PURE__*/jsxRuntime.jsx("span", {
964
+ className: _JSXStyle.dynamic([["517931406", [disabled ? 'not-allowed' : 'pointer', SCALES.font(1), SCALES.height(0.875), SCALES.width(1.75), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_2, theme$1.palette.background, theme$1.palette.accents_2, theme$1.palette.accents_1, theme$1.palette.accents_2, theme$1.palette.accents_4, theme$1.palette.accents_4, bg]]]) + " " + "toggle-label",
965
+ children: children
966
+ }), /*#__PURE__*/jsxRuntime.jsxs("label", _objectSpread2(_objectSpread2({}, props), {}, {
967
+ className: _JSXStyle.dynamic([["517931406", [disabled ? 'not-allowed' : 'pointer', SCALES.font(1), SCALES.height(0.875), SCALES.width(1.75), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_2, theme$1.palette.background, theme$1.palette.accents_2, theme$1.palette.accents_1, theme$1.palette.accents_2, theme$1.palette.accents_4, theme$1.palette.accents_4, bg]]]) + " " + (props && props.className != null && props.className || className || ""),
968
+ children: [/*#__PURE__*/jsxRuntime.jsx("input", {
969
+ type: "checkbox",
970
+ disabled: disabled,
971
+ checked: selfChecked,
972
+ onChange: changeHandle,
973
+ className: _JSXStyle.dynamic([["517931406", [disabled ? 'not-allowed' : 'pointer', SCALES.font(1), SCALES.height(0.875), SCALES.width(1.75), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_2, theme$1.palette.background, theme$1.palette.accents_2, theme$1.palette.accents_1, theme$1.palette.accents_2, theme$1.palette.accents_4, theme$1.palette.accents_4, bg]]])
974
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
975
+ className: _JSXStyle.dynamic([["517931406", [disabled ? 'not-allowed' : 'pointer', SCALES.font(1), SCALES.height(0.875), SCALES.width(1.75), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_2, theme$1.palette.background, theme$1.palette.accents_2, theme$1.palette.accents_1, theme$1.palette.accents_2, theme$1.palette.accents_4, theme$1.palette.accents_4, bg]]]) + " " + (classes || ""),
976
+ children: /*#__PURE__*/jsxRuntime.jsx("span", {
977
+ className: _JSXStyle.dynamic([["517931406", [disabled ? 'not-allowed' : 'pointer', SCALES.font(1), SCALES.height(0.875), SCALES.width(1.75), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_2, theme$1.palette.background, theme$1.palette.accents_2, theme$1.palette.accents_1, theme$1.palette.accents_2, theme$1.palette.accents_4, theme$1.palette.accents_4, bg]]]) + " " + "inner"
978
+ })
979
+ })]
980
+ })), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
981
+ id: "517931406",
982
+ dynamic: [disabled ? 'not-allowed' : 'pointer', SCALES.font(1), SCALES.height(0.875), SCALES.width(1.75), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_2, theme$1.palette.background, theme$1.palette.accents_2, theme$1.palette.accents_1, theme$1.palette.accents_2, theme$1.palette.accents_4, theme$1.palette.accents_4, bg],
983
+ children: ".toggle-container.__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;gap:5;height:var(--toggle-height);}.toggle-label.__jsx-style-dynamic-selector{margin-right:0.7rem;}label.__jsx-style-dynamic-selector{-webkit-tap-highlight-color:transparent;display:inline-block;vertical-align:middle;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;cursor:".concat(disabled ? 'not-allowed' : 'pointer', ";--toggle-font-size:").concat(SCALES.font(1), ";--toggle-height:").concat(SCALES.height(0.875), ";width:").concat(SCALES.width(1.75), ";height:var(--toggle-height);margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}input.__jsx-style-dynamic-selector{overflow:hidden;visibility:hidden;height:0;opacity:0;width:0;position:absolute;background-color:transparent;z-index:-1;}.toggle.__jsx-style-dynamic-selector{height:var(--toggle-height);width:100%;border-radius:var(--toggle-height);-webkit-transition-delay:0.12s;transition-delay:0.12s;-webkit-transition-duration:0.2s;transition-duration:0.2s;-webkit-transition-property:background,border;transition-property:background,border;-webkit-transition-timing-function:cubic-bezier(0,0,0.2,1);transition-timing-function:cubic-bezier(0,0,0.2,1);position:relative;border:1px solid transparent;background-color:").concat(theme$1.palette.accents_2, ";padding:0;}.inner.__jsx-style-dynamic-selector{width:calc(var(--toggle-height) - 2px);height:calc(var(--toggle-height) - 2px);position:absolute;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);left:1px;box-shadow:rgba(0,0,0,0.2) 0 1px 2px 0,rgba(0,0,0,0.1) 0 1px 3px 0;-webkit-transition:left 280ms cubic-bezier(0,0,0.2,1);transition:left 280ms cubic-bezier(0,0,0.2,1);border-radius:50%;background-color:").concat(theme$1.palette.background, ";}.disabled.__jsx-style-dynamic-selector{border-color:").concat(theme$1.palette.accents_2, ";background-color:").concat(theme$1.palette.accents_1, ";}.disabled.__jsx-style-dynamic-selector>.inner.__jsx-style-dynamic-selector{background-color:").concat(theme$1.palette.accents_2, ";}.disabled.checked.__jsx-style-dynamic-selector{border-color:").concat(theme$1.palette.accents_4, ";background-color:").concat(theme$1.palette.accents_4, ";}.checked.__jsx-style-dynamic-selector{background-color:").concat(bg, ";}.checked.__jsx-style-dynamic-selector>.inner.__jsx-style-dynamic-selector{left:calc(100% - (var(--toggle-height) - 2px));box-shadow:none;}")
984
+ })]
985
+ });
944
986
  };
945
987
  ToggleComponent.displayName = 'Toggle';
946
988
  var Toggle = withScale(ToggleComponent);
@@ -1,8 +1,7 @@
1
1
  import Tooltip from './tooltip';
2
2
  export type { TooltipProps, TooltipOnVisibleChange, TooltipTypes, TooltipTriggers, TooltipPlacement, } from './tooltip';
3
- import SmallTooltip from './tooltip-small';
4
3
  export type TooltipComponentType = typeof Tooltip & {
5
- Small: typeof SmallTooltip;
4
+ Small: typeof Tooltip;
6
5
  };
7
6
  declare const _default: TooltipComponentType;
8
7
  export default _default;
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var React = require('react');
6
6
  var reactDom = require('react-dom');
7
7
  var theme = require('@helpdice/theme');
8
+ var jsxRuntime = require('react/jsx-runtime');
8
9
 
9
10
  function _arrayLikeToArray(r, a) {
10
11
  (null == a || a > r.length) && (a = r.length);
@@ -70,15 +71,6 @@ function _defineProperty(e, r, t) {
70
71
  writable: true
71
72
  }) : e[r] = t, e;
72
73
  }
73
- function _extends() {
74
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
75
- for (var e = 1; e < arguments.length; e++) {
76
- var t = arguments[e];
77
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
78
- }
79
- return n;
80
- }, _extends.apply(null, arguments);
81
- }
82
74
  function _iterableToArrayLimit(r, l) {
83
75
  var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
84
76
  if (null != t) {
@@ -1097,12 +1089,14 @@ var TooltipIcon = function TooltipIcon(_ref) {
1097
1089
  if (!shadow || theme$1.type !== 'dark') return 'var(--tooltip-content-bg)';
1098
1090
  return theme$1.palette.accents_2;
1099
1091
  }, [theme$1.type, shadow]);
1100
- return /*#__PURE__*/React.createElement("span", {
1101
- className: _JSXStyle.dynamic([["2440507693", [bgColorWithDark, left, top, right, bottom, transform]]])
1102
- }, /*#__PURE__*/React.createElement(_JSXStyle, {
1103
- id: "2440507693",
1104
- dynamic: [bgColorWithDark, left, top, right, bottom, transform]
1105
- }, "span.__jsx-style-dynamic-selector{width:0;height:0;border-style:solid;border-width:6px 7px 6px 0;border-color:transparent ".concat(bgColorWithDark, " transparent transparent;position:absolute;left:").concat(left, ";top:").concat(top, ";right:").concat(right, ";bottom:").concat(bottom, ";-webkit-transform:").concat(transform, ";-ms-transform:").concat(transform, ";transform:").concat(transform, ";}")));
1092
+ return /*#__PURE__*/jsxRuntime.jsx("span", {
1093
+ className: _JSXStyle.dynamic([["2440507693", [bgColorWithDark, left, top, right, bottom, transform]]]),
1094
+ children: /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
1095
+ id: "2440507693",
1096
+ dynamic: [bgColorWithDark, left, top, right, bottom, transform],
1097
+ children: "span.__jsx-style-dynamic-selector{width:0;height:0;border-style:solid;border-width:6px 7px 6px 0;border-color:transparent ".concat(bgColorWithDark, " transparent transparent;position:absolute;left:").concat(left, ";top:").concat(top, ";right:").concat(right, ";bottom:").concat(bottom, ";-webkit-transform:").concat(transform, ";-ms-transform:").concat(transform, ";transform:").concat(transform, ";}")
1098
+ })
1099
+ });
1106
1100
  };
1107
1101
 
1108
1102
  /* "use client" */
@@ -1271,11 +1265,13 @@ var withScale = function withScale(Render) {
1271
1265
  getScaleProps: generateGetScaleProps(props),
1272
1266
  getAllScaleProps: generateGetAllScaleProps(props)
1273
1267
  };
1274
- return /*#__PURE__*/React.createElement(ScaleContext.Provider, {
1275
- value: value
1276
- }, /*#__PURE__*/React.createElement(Render, _extends({}, props, {
1277
- ref: ref
1278
- }), children));
1268
+ return /*#__PURE__*/jsxRuntime.jsx(ScaleContext.Provider, {
1269
+ value: value,
1270
+ children: /*#__PURE__*/jsxRuntime.jsx(Render, _objectSpread2(_objectSpread2({}, props), {}, {
1271
+ ref: ref,
1272
+ children: children
1273
+ }))
1274
+ });
1279
1275
  });
1280
1276
  ScaleFC.displayName = "Scale".concat(Render.displayName || 'Wrapper');
1281
1277
  return ScaleFC;
@@ -1327,8 +1323,8 @@ var TooltipContent = function TooltipContent(_ref) {
1327
1323
  offset = _ref.offset,
1328
1324
  iconOffset = _ref.iconOffset,
1329
1325
  placement = _ref.placement,
1330
- _ref$type = _ref.type,
1331
- type = _ref$type === void 0 ? 'default' : _ref$type,
1326
+ _ref$color = _ref.color,
1327
+ color = _ref$color === void 0 ? 'default' : _ref$color,
1332
1328
  className = _ref.className,
1333
1329
  hideArrow = _ref.hideArrow;
1334
1330
  var theme$1 = theme.useTheme();
@@ -1341,9 +1337,9 @@ var TooltipContent = function TooltipContent(_ref) {
1341
1337
  rect = _useState2[0],
1342
1338
  setRect = _useState2[1];
1343
1339
  var colors = React.useMemo(function () {
1344
- return getColors(type, theme$1.palette);
1345
- }, [type, theme$1.palette]);
1346
- var hasShadow = type === 'default';
1340
+ return getColors(color, theme$1.palette);
1341
+ }, [color, theme$1.palette]);
1342
+ var hasShadow = color === 'default';
1347
1343
  var classes = theme.useClasses('tooltip-content', className);
1348
1344
 
1349
1345
  // console.log('Having Parent', parent);
@@ -1373,21 +1369,25 @@ var TooltipContent = function TooltipContent(_ref) {
1373
1369
  event.nativeEvent.stopImmediatePropagation();
1374
1370
  };
1375
1371
  if (!el) return null;
1376
- return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React.createElement(theme.CssTransition, {
1377
- visible: visible
1378
- }, /*#__PURE__*/React.createElement("div", {
1379
- ref: selfRef,
1380
- onClick: preventHandler,
1381
- className: _JSXStyle.dynamic([["2237208653", [iconOffset.x, iconOffset.y, colors.bgColor, rect.top, rect.left, rect.transform, colors.color, theme$1.layout.radius, hasShadow ? theme$1.expressiveness.shadowMedium : 'none', SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.font(1), SCALES.pt(0.65), SCALES.pr(0.9), SCALES.pb(0.65), SCALES.pl(0.9)]]]) + " " + (classes || "")
1382
- }, /*#__PURE__*/React.createElement("div", {
1383
- className: _JSXStyle.dynamic([["2237208653", [iconOffset.x, iconOffset.y, colors.bgColor, rect.top, rect.left, rect.transform, colors.color, theme$1.layout.radius, hasShadow ? theme$1.expressiveness.shadowMedium : 'none', SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.font(1), SCALES.pt(0.65), SCALES.pr(0.9), SCALES.pb(0.65), SCALES.pl(0.9)]]]) + " " + "inner"
1384
- }, !hideArrow && /*#__PURE__*/React.createElement(TooltipIcon, {
1385
- placement: placement,
1386
- shadow: hasShadow
1387
- }), children), /*#__PURE__*/React.createElement(_JSXStyle, {
1388
- id: "2237208653",
1389
- dynamic: [iconOffset.x, iconOffset.y, colors.bgColor, rect.top, rect.left, rect.transform, colors.color, theme$1.layout.radius, hasShadow ? theme$1.expressiveness.shadowMedium : 'none', SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.font(1), SCALES.pt(0.65), SCALES.pr(0.9), SCALES.pb(0.65), SCALES.pl(0.9)]
1390
- }, ".tooltip-content.__jsx-style-dynamic-selector{--tooltip-icon-offset-x:".concat(iconOffset.x, ";--tooltip-icon-offset-y:").concat(iconOffset.y, ";--tooltip-content-bg:").concat(colors.bgColor, ";box-sizing:border-box;position:absolute;top:").concat(rect.top, ";left:").concat(rect.left, ";-webkit-transform:").concat(rect.transform, ";-ms-transform:").concat(rect.transform, ";transform:").concat(rect.transform, ";background-color:var(--tooltip-content-bg);color:").concat(colors.color, ";border-radius:").concat(theme$1.layout.radius, ";padding:0;z-index:1000;box-shadow:").concat(hasShadow ? theme$1.expressiveness.shadowMedium : 'none', ";width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";}.inner.__jsx-style-dynamic-selector{box-sizing:border-box;position:relative;font-size:").concat(SCALES.font(1), ";padding:").concat(SCALES.pt(0.65), " ").concat(SCALES.pr(0.9), " ").concat(SCALES.pb(0.65), " ").concat(SCALES.pl(0.9), ";height:100%;}")))), el);
1372
+ return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/jsxRuntime.jsx(theme.CssTransition, {
1373
+ visible: visible,
1374
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
1375
+ ref: selfRef,
1376
+ onClick: preventHandler,
1377
+ className: _JSXStyle.dynamic([["2237208653", [iconOffset.x, iconOffset.y, colors.bgColor, rect.top, rect.left, rect.transform, colors.color, theme$1.layout.radius, hasShadow ? theme$1.expressiveness.shadowMedium : 'none', SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.font(1), SCALES.pt(0.65), SCALES.pr(0.9), SCALES.pb(0.65), SCALES.pl(0.9)]]]) + " " + (classes || ""),
1378
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
1379
+ className: _JSXStyle.dynamic([["2237208653", [iconOffset.x, iconOffset.y, colors.bgColor, rect.top, rect.left, rect.transform, colors.color, theme$1.layout.radius, hasShadow ? theme$1.expressiveness.shadowMedium : 'none', SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.font(1), SCALES.pt(0.65), SCALES.pr(0.9), SCALES.pb(0.65), SCALES.pl(0.9)]]]) + " " + "inner",
1380
+ children: [!hideArrow && /*#__PURE__*/jsxRuntime.jsx(TooltipIcon, {
1381
+ placement: placement,
1382
+ shadow: hasShadow
1383
+ }), children]
1384
+ }), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
1385
+ id: "2237208653",
1386
+ dynamic: [iconOffset.x, iconOffset.y, colors.bgColor, rect.top, rect.left, rect.transform, colors.color, theme$1.layout.radius, hasShadow ? theme$1.expressiveness.shadowMedium : 'none', SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.font(1), SCALES.pt(0.65), SCALES.pr(0.9), SCALES.pb(0.65), SCALES.pl(0.9)],
1387
+ children: ".tooltip-content.__jsx-style-dynamic-selector{--tooltip-icon-offset-x:".concat(iconOffset.x, ";--tooltip-icon-offset-y:").concat(iconOffset.y, ";--tooltip-content-bg:").concat(colors.bgColor, ";box-sizing:border-box;position:absolute;top:").concat(rect.top, ";left:").concat(rect.left, ";-webkit-transform:").concat(rect.transform, ";-ms-transform:").concat(rect.transform, ";transform:").concat(rect.transform, ";background-color:var(--tooltip-content-bg);color:").concat(colors.color, ";border-radius:").concat(theme$1.layout.radius, ";padding:0;z-index:1000;box-shadow:").concat(hasShadow ? theme$1.expressiveness.shadowMedium : 'none', ";width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";}.inner.__jsx-style-dynamic-selector{box-sizing:border-box;position:relative;font-size:").concat(SCALES.font(1), ";padding:").concat(SCALES.pt(0.65), " ").concat(SCALES.pr(0.9), " ").concat(SCALES.pb(0.65), " ").concat(SCALES.pl(0.9), ";height:100%;}")
1388
+ })]
1389
+ })
1390
+ }), el);
1391
1391
  };
1392
1392
 
1393
1393
  /* "use client" */
@@ -1427,15 +1427,16 @@ var TooltipComponent = function TooltipComponent(_ref) {
1427
1427
  leaveDelay = _ref$leaveDelay === void 0 ? 150 : _ref$leaveDelay,
1428
1428
  _ref$trigger = _ref.trigger,
1429
1429
  trigger = _ref$trigger === void 0 ? 'hover' : _ref$trigger,
1430
- _ref$type = _ref.type,
1431
- type = _ref$type === void 0 ? 'default' : _ref$type,
1430
+ _ref$color = _ref.color,
1431
+ color = _ref$color === void 0 ? 'default' : _ref$color,
1432
1432
  _ref$className = _ref.className,
1433
1433
  className = _ref$className === void 0 ? '' : _ref$className,
1434
1434
  _ref$onVisibleChange = _ref.onVisibleChange,
1435
1435
  onVisibleChange = _ref$onVisibleChange === void 0 ? function () {} : _ref$onVisibleChange,
1436
1436
  _ref$hideArrow = _ref.hideArrow,
1437
1437
  hideArrow = _ref$hideArrow === void 0 ? false : _ref$hideArrow,
1438
- customVisible = _ref.visible;
1438
+ customVisible = _ref.visible,
1439
+ disabled = _ref.disabled;
1439
1440
  var timer = React.useRef(undefined);
1440
1441
  var ref = React.useRef(null);
1441
1442
  var _useState = React.useState(initialVisible),
@@ -1454,8 +1455,8 @@ var TooltipComponent = function TooltipComponent(_ref) {
1454
1455
  };
1455
1456
  }, [ref === null || ref === void 0 ? void 0 : ref.current]);
1456
1457
  var contentProps = {
1457
- type: type,
1458
- visible: visible,
1458
+ color: color,
1459
+ visible: disabled ? false : visible,
1459
1460
  offset: offset,
1460
1461
  placement: placement,
1461
1462
  hideArrow: hideArrow,
@@ -1498,7 +1499,7 @@ var TooltipComponent = function TooltipComponent(_ref) {
1498
1499
  if (customVisible === undefined) return;
1499
1500
  changeVisible(customVisible);
1500
1501
  }, [customVisible]);
1501
- return /*#__PURE__*/React.createElement("div", {
1502
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
1502
1503
  ref: ref,
1503
1504
  onClick: clickEventHandler,
1504
1505
  onMouseEnter: function onMouseEnter() {
@@ -1509,21 +1510,26 @@ var TooltipComponent = function TooltipComponent(_ref) {
1509
1510
  }
1510
1511
  // {...props}
1511
1512
  ,
1512
- className: "jsx-418573366" + " " + (theme.useClasses('tooltip', className) || "")
1513
- }, children, /*#__PURE__*/React.createElement(TooltipContent, contentProps, text), /*#__PURE__*/React.createElement(_JSXStyle, {
1514
- id: "418573366"
1515
- }, ".tooltip.jsx-418573366{width:-webkit-max-content;width:-moz-max-content;width:max-content;display:inline-block;}"));
1513
+ className: "jsx-418573366" + " " + (theme.useClasses('tooltip', className) || ""),
1514
+ children: [children, /*#__PURE__*/jsxRuntime.jsx(TooltipContent, _objectSpread2(_objectSpread2({}, contentProps), {}, {
1515
+ children: text
1516
+ })), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
1517
+ id: "418573366",
1518
+ children: ".tooltip.jsx-418573366{width:-webkit-max-content;width:-moz-max-content;width:max-content;display:inline-block;}"
1519
+ })]
1520
+ });
1516
1521
  };
1517
1522
  TooltipComponent.displayName = 'Tooltip';
1518
1523
  var Tooltip = withScale(TooltipComponent);
1519
1524
 
1520
1525
  var SmallTooltip = function SmallTooltip(props) {
1521
- return /*#__PURE__*/React.createElement(Tooltip, _extends({
1522
- text: props.text,
1526
+ return /*#__PURE__*/jsxRuntime.jsx(Tooltip, _objectSpread2(_objectSpread2({
1523
1527
  font: 0.8,
1524
1528
  px: 0.6,
1525
1529
  py: 0.4
1526
- }, props), props.children);
1530
+ }, props), {}, {
1531
+ children: props.children
1532
+ }));
1527
1533
  };
1528
1534
  SmallTooltip.displayName = 'Tooltip.Small';
1529
1535
  var SmallTooltip$1 = /*#__PURE__*/React.memo(SmallTooltip);
@@ -3,7 +3,7 @@ import { Placement, SnippetTypes } from '../utils/prop-types';
3
3
  interface Props {
4
4
  parent?: RefObject<HTMLElement | null> | undefined;
5
5
  placement: Placement;
6
- type: SnippetTypes;
6
+ color: SnippetTypes;
7
7
  visible: boolean;
8
8
  hideArrow: boolean;
9
9
  offset: number;
@@ -1,7 +1,4 @@
1
1
  import React from 'react';
2
- type SmallTooltipProps = {
3
- children?: React.ReactNode;
4
- text?: string | React.ReactNode;
5
- };
6
- declare const _default: React.NamedExoticComponent<SmallTooltipProps>;
2
+ import { TooltipProps } from './tooltip';
3
+ declare const _default: React.NamedExoticComponent<TooltipProps>;
7
4
  export default _default;
@@ -6,7 +6,7 @@ export type TooltipTriggers = TriggerTypes;
6
6
  export type TooltipPlacement = Placement;
7
7
  interface Props {
8
8
  text: string | React.ReactNode;
9
- type?: TooltipTypes;
9
+ color?: TooltipTypes;
10
10
  placement?: TooltipPlacement;
11
11
  visible?: boolean;
12
12
  initialVisible?: boolean;
@@ -14,6 +14,7 @@ interface Props {
14
14
  trigger?: TooltipTriggers;
15
15
  enterDelay?: number;
16
16
  leaveDelay?: number;
17
+ disabled?: boolean;
17
18
  offset?: number;
18
19
  className?: string;
19
20
  portalClassName?: string;