@helpdice/ui 1.4.8 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,15 @@
1
+ import { CSSProperties } from 'react';
2
+ type CompactButtonProps = {
3
+ children?: React.ReactNode;
4
+ iconRight?: React.ReactNode;
5
+ to: string;
6
+ icon?: React.ReactNode;
7
+ scale?: number;
8
+ type?: any;
9
+ style?: CSSProperties;
10
+ a?: boolean;
11
+ target?: string;
12
+ onClick?: () => void;
13
+ };
14
+ declare const _default: import("react").NamedExoticComponent<CompactButtonProps>;
15
+ export default _default;
@@ -5,6 +5,7 @@ interface Props {
5
5
  ghost?: boolean;
6
6
  loading?: boolean;
7
7
  shadow?: boolean;
8
+ round?: boolean;
8
9
  auto?: boolean;
9
10
  effect?: boolean;
10
11
  disabled?: boolean;
@@ -1,4 +1,5 @@
1
1
  import Button from './button';
2
+ export { default as LinkButton } from './button.compact';
2
3
  export type { ButtonProps } from './button';
3
4
  export type { ButtonTypes } from '../utils/prop-types';
4
5
  export default Button;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var React = require('react');
5
+ var React$1 = require('react');
6
6
 
7
7
  function _arrayLikeToArray(r, a) {
8
8
  (null == a || a > r.length) && (a = r.length);
@@ -193,11 +193,11 @@ var hasRequiredIndex;
193
193
  function requireIndex () {
194
194
  if (hasRequiredIndex) return index;
195
195
  hasRequiredIndex = 1;
196
- var React$1 = React;
196
+ var React = React$1;
197
197
 
198
198
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
199
199
 
200
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React$1);
200
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
201
201
 
202
202
  /*
203
203
  Based on Glamor's sheet
@@ -633,15 +633,15 @@ function requireIndex () {
633
633
  throw new Error("StyleSheetRegistry: " + message + ".");
634
634
  }
635
635
  }
636
- var StyleSheetContext = /*#__PURE__*/ React$1.createContext(null);
636
+ var StyleSheetContext = /*#__PURE__*/ React.createContext(null);
637
637
  StyleSheetContext.displayName = "StyleSheetContext";
638
638
  function createStyleRegistry() {
639
639
  return new StyleSheetRegistry();
640
640
  }
641
641
  function StyleRegistry(param) {
642
642
  var configuredRegistry = param.registry, children = param.children;
643
- var rootRegistry = React$1.useContext(StyleSheetContext);
644
- var ref = React$1.useState(function() {
643
+ var rootRegistry = React.useContext(StyleSheetContext);
644
+ var ref = React.useState(function() {
645
645
  return rootRegistry || configuredRegistry || createStyleRegistry();
646
646
  }), registry = ref[0];
647
647
  return /*#__PURE__*/ React__default["default"].createElement(StyleSheetContext.Provider, {
@@ -649,7 +649,7 @@ function requireIndex () {
649
649
  }, children);
650
650
  }
651
651
  function useStyleRegistry() {
652
- return React$1.useContext(StyleSheetContext);
652
+ return React.useContext(StyleSheetContext);
653
653
  }
654
654
 
655
655
  // Opt-into the new `useInsertionEffect` API in React 18, fallback to `useLayoutEffect`.
@@ -738,9 +738,9 @@ var defaultContext$1 = {
738
738
  },
739
739
  unit: '16px'
740
740
  };
741
- var ScaleContext = /*#__PURE__*/React.createContext(defaultContext$1);
741
+ var ScaleContext = /*#__PURE__*/React$1.createContext(defaultContext$1);
742
742
  var useScale = function useScale() {
743
- return React.useContext(ScaleContext);
743
+ return React$1.useContext(ScaleContext);
744
744
  };
745
745
 
746
746
  var defaultFont = {
@@ -987,9 +987,9 @@ var Themes = {
987
987
  /* "use client" */
988
988
 
989
989
  var defaultTheme = Themes.getPresetStaticTheme();
990
- var ThemeContext = /*#__PURE__*/React.createContext(defaultTheme);
990
+ var ThemeContext = /*#__PURE__*/React$1.createContext(defaultTheme);
991
991
  var useTheme = function useTheme() {
992
- return React.useContext(ThemeContext);
992
+ return React$1.useContext(ThemeContext);
993
993
  };
994
994
 
995
995
  /* "use client" */
@@ -1051,7 +1051,7 @@ var reduceScaleCoefficient = function reduceScaleCoefficient(scale) {
1051
1051
  return scale > 1 ? 1 + diff : 1 - diff;
1052
1052
  };
1053
1053
  var withScale = function withScale(Render) {
1054
- var ScaleFC = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1054
+ var ScaleFC = /*#__PURE__*/React$1.forwardRef(function (_ref, ref) {
1055
1055
  var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _ref30, _ref31, _ref32, _ref33;
1056
1056
  var children = _ref.children,
1057
1057
  props = _objectWithoutProperties(_ref, _excluded$3);
@@ -1127,9 +1127,9 @@ var withScale = function withScale(Render) {
1127
1127
  getScaleProps: generateGetScaleProps(props),
1128
1128
  getAllScaleProps: generateGetAllScaleProps(props)
1129
1129
  };
1130
- return /*#__PURE__*/React.createElement(ScaleContext.Provider, {
1130
+ return /*#__PURE__*/React$1.createElement(ScaleContext.Provider, {
1131
1131
  value: value
1132
- }, /*#__PURE__*/React.createElement(Render, _extends({}, props, {
1132
+ }, /*#__PURE__*/React$1.createElement(Render, _extends({}, props, {
1133
1133
  ref: ref
1134
1134
  }), children));
1135
1135
  });
@@ -1144,12 +1144,12 @@ var ButtonDrip = function ButtonDrip(_ref) {
1144
1144
  y = _ref$y === undefined ? 0 : _ref$y,
1145
1145
  color = _ref.color,
1146
1146
  onCompleted = _ref.onCompleted;
1147
- var dripRef = React.useRef(null);
1147
+ var dripRef = React$1.useRef(null);
1148
1148
  /* istanbul ignore next */
1149
1149
  var top = Number.isNaN(+y) ? 0 : y - 10;
1150
1150
  /* istanbul ignore next */
1151
1151
  var left = Number.isNaN(+x) ? 0 : x - 10;
1152
- React.useEffect(function () {
1152
+ React$1.useEffect(function () {
1153
1153
  /* istanbul ignore next */
1154
1154
  if (!dripRef.current) return;
1155
1155
  dripRef.current.addEventListener('animationend', onCompleted);
@@ -1159,10 +1159,10 @@ var ButtonDrip = function ButtonDrip(_ref) {
1159
1159
  dripRef.current.removeEventListener('animationend', onCompleted);
1160
1160
  };
1161
1161
  });
1162
- return /*#__PURE__*/React.createElement("div", {
1162
+ return /*#__PURE__*/React$1.createElement("div", {
1163
1163
  ref: dripRef,
1164
1164
  className: "jsx-3424889537" + " " + "drip"
1165
- }, /*#__PURE__*/React.createElement("svg", {
1165
+ }, /*#__PURE__*/React$1.createElement("svg", {
1166
1166
  width: "20",
1167
1167
  height: "20",
1168
1168
  viewBox: "0 0 20 20",
@@ -1171,21 +1171,21 @@ var ButtonDrip = function ButtonDrip(_ref) {
1171
1171
  left: left
1172
1172
  },
1173
1173
  className: "jsx-3424889537"
1174
- }, /*#__PURE__*/React.createElement("g", {
1174
+ }, /*#__PURE__*/React$1.createElement("g", {
1175
1175
  stroke: "none",
1176
1176
  strokeWidth: "1",
1177
1177
  fill: "none",
1178
1178
  fillRule: "evenodd",
1179
1179
  className: "jsx-3424889537"
1180
- }, /*#__PURE__*/React.createElement("g", {
1180
+ }, /*#__PURE__*/React$1.createElement("g", {
1181
1181
  fill: color,
1182
1182
  className: "jsx-3424889537"
1183
- }, /*#__PURE__*/React.createElement("rect", {
1183
+ }, /*#__PURE__*/React$1.createElement("rect", {
1184
1184
  width: "100%",
1185
1185
  height: "100%",
1186
1186
  rx: "10",
1187
1187
  className: "jsx-3424889537"
1188
- })))), /*#__PURE__*/React.createElement(_JSXStyle, {
1188
+ })))), /*#__PURE__*/React$1.createElement(_JSXStyle, {
1189
1189
  id: "3424889537"
1190
1190
  }, ".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;}}"));
1191
1191
  };
@@ -1249,22 +1249,22 @@ var LoadingComponent = function LoadingComponent(_ref) {
1249
1249
  var _useScale = useScale(),
1250
1250
  SCALES = _useScale.SCALES;
1251
1251
  var classes = useClasses('loading-container', className);
1252
- var bgColor = React.useMemo(function () {
1252
+ var bgColor = React$1.useMemo(function () {
1253
1253
  return getIconBgColor(type, theme.palette, color);
1254
1254
  }, [type, theme.palette, color]);
1255
- return /*#__PURE__*/React.createElement("div", _extends({}, props, {
1255
+ return /*#__PURE__*/React$1.createElement("div", _extends({}, props, {
1256
1256
  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.palette.accents_5, bgColor, spaceRatio]]]) + " " + (props && props.className != null && props.className || classes || "")
1257
- }), /*#__PURE__*/React.createElement("span", {
1257
+ }), /*#__PURE__*/React$1.createElement("span", {
1258
1258
  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.palette.accents_5, bgColor, spaceRatio]]]) + " " + "loading"
1259
- }, children && /*#__PURE__*/React.createElement("label", {
1259
+ }, children && /*#__PURE__*/React$1.createElement("label", {
1260
1260
  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.palette.accents_5, bgColor, spaceRatio]]])
1261
- }, children), /*#__PURE__*/React.createElement("i", {
1261
+ }, children), /*#__PURE__*/React$1.createElement("i", {
1262
1262
  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.palette.accents_5, bgColor, spaceRatio]]])
1263
- }), /*#__PURE__*/React.createElement("i", {
1263
+ }), /*#__PURE__*/React$1.createElement("i", {
1264
1264
  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.palette.accents_5, bgColor, spaceRatio]]])
1265
- }), /*#__PURE__*/React.createElement("i", {
1265
+ }), /*#__PURE__*/React$1.createElement("i", {
1266
1266
  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.palette.accents_5, bgColor, spaceRatio]]])
1267
- })), /*#__PURE__*/React.createElement(_JSXStyle, {
1267
+ })), /*#__PURE__*/React$1.createElement(_JSXStyle, {
1268
1268
  id: "2201634259",
1269
1269
  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.palette.accents_5, bgColor, spaceRatio]
1270
1270
  }, ".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.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;}}")));
@@ -1274,11 +1274,11 @@ var Loading = withScale(LoadingComponent);
1274
1274
 
1275
1275
  var ButtonLoading = function ButtonLoading(_ref) {
1276
1276
  var color = _ref.color;
1277
- return /*#__PURE__*/React.createElement("div", {
1277
+ return /*#__PURE__*/React$1.createElement("div", {
1278
1278
  className: "jsx-212623367" + " " + "btn-loading"
1279
- }, /*#__PURE__*/React.createElement(Loading, {
1279
+ }, /*#__PURE__*/React$1.createElement(Loading, {
1280
1280
  color: color
1281
- }), /*#__PURE__*/React.createElement(_JSXStyle, {
1281
+ }), /*#__PURE__*/React$1.createElement(_JSXStyle, {
1282
1282
  id: "212623367"
1283
1283
  }, ".btn-loading.jsx-212623367{position:absolute;top:0;left:0;right:0;bottom:0;z-index:2;background-color:var(--helpdice-ui-button-bg);}"));
1284
1284
  };
@@ -1297,9 +1297,9 @@ var ButtonIcon = function ButtonIcon(_ref) {
1297
1297
  right: isRight,
1298
1298
  single: isSingle
1299
1299
  }, className);
1300
- return /*#__PURE__*/React.createElement("span", _extends({}, props, {
1300
+ return /*#__PURE__*/React$1.createElement("span", _extends({}, props, {
1301
1301
  className: "jsx-2467502931" + " " + (props && props.className != null && props.className || classes || "")
1302
- }), children, /*#__PURE__*/React.createElement(_JSXStyle, {
1302
+ }), children, /*#__PURE__*/React$1.createElement(_JSXStyle, {
1303
1303
  id: "2467502931"
1304
1304
  }, ".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;}"));
1305
1305
  };
@@ -1312,20 +1312,20 @@ var getButtonChildrenWithIcon = function getButtonChildrenWithIcon(auto, childre
1312
1312
  var isRight = Boolean(iconRight);
1313
1313
  var paddingForAutoMode = auto ? "calc(var(--helpdice-ui-button-height) / 2 + var(--helpdice-ui-button-icon-padding) * .5)" : 0;
1314
1314
  var classes = useClasses('text', isRight ? 'right' : 'left');
1315
- if (!hasIcon) return /*#__PURE__*/React.createElement("div", {
1315
+ if (!hasIcon) return /*#__PURE__*/React$1.createElement("div", {
1316
1316
  className: "text"
1317
1317
  }, children);
1318
- if (React.Children.count(children) === 0) {
1319
- return /*#__PURE__*/React.createElement(ButtonIcon, {
1318
+ if (React$1.Children.count(children) === 0) {
1319
+ return /*#__PURE__*/React$1.createElement(ButtonIcon, {
1320
1320
  isRight: isRight,
1321
1321
  isSingle: true
1322
1322
  }, hasIcon);
1323
1323
  }
1324
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ButtonIcon, {
1324
+ return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(ButtonIcon, {
1325
1325
  isRight: isRight
1326
- }, hasIcon), /*#__PURE__*/React.createElement("div", {
1326
+ }, hasIcon), /*#__PURE__*/React$1.createElement("div", {
1327
1327
  className: _JSXStyle.dynamic([["3568181479", [paddingForAutoMode, paddingForAutoMode]]]) + " " + (classes || "")
1328
- }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
1328
+ }, children, /*#__PURE__*/React$1.createElement(_JSXStyle, {
1329
1329
  id: "3568181479",
1330
1330
  dynamic: [paddingForAutoMode, paddingForAutoMode]
1331
1331
  }, ".left.__jsx-style-dynamic-selector{padding-left:".concat(paddingForAutoMode, ";}.right.__jsx-style-dynamic-selector{padding-right:").concat(paddingForAutoMode, ";}"))));
@@ -1347,9 +1347,9 @@ var defaultContext = {
1347
1347
  isButtonGroup: false,
1348
1348
  disabled: false
1349
1349
  };
1350
- var ButtonGroupContext = /*#__PURE__*/React.createContext(defaultContext);
1350
+ var ButtonGroupContext = /*#__PURE__*/React$1.createContext(defaultContext);
1351
1351
  var useButtonGroupContext = function useButtonGroupContext() {
1352
- return React.useContext(ButtonGroupContext);
1352
+ return React$1.useContext(ButtonGroupContext);
1353
1353
  };
1354
1354
 
1355
1355
  var hexToRgb = function hexToRgb(color) {
@@ -1574,24 +1574,24 @@ var getButtonDripColor = function getButtonDripColor(palette, props) {
1574
1574
  return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
1575
1575
  };
1576
1576
 
1577
- var _excluded = ["children", "disabled", "type", "loading", "shadow", "ghost", "effect", "onClick", "auto", "icon", "htmlType", "iconRight", "className", "crossOrigin"];
1578
- var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
1577
+ var _excluded = ["children", "disabled", "type", "loading", "shadow", "ghost", "effect", "round", "onClick", "auto", "icon", "htmlType", "iconRight", "className", "crossOrigin"];
1578
+ var ButtonComponent = /*#__PURE__*/React$1.forwardRef(function (btnProps, ref) {
1579
1579
  var theme = useTheme();
1580
1580
  var _useScale = useScale(),
1581
1581
  SCALES = _useScale.SCALES;
1582
- var buttonRef = React.useRef(null);
1583
- React.useImperativeHandle(ref, function () {
1582
+ var buttonRef = React$1.useRef(null);
1583
+ React$1.useImperativeHandle(ref, function () {
1584
1584
  return buttonRef.current;
1585
1585
  });
1586
- var _useState = React.useState(false),
1586
+ var _useState = React$1.useState(false),
1587
1587
  _useState2 = _slicedToArray(_useState, 2),
1588
1588
  dripShow = _useState2[0],
1589
1589
  setDripShow = _useState2[1];
1590
- var _useState3 = React.useState(0),
1590
+ var _useState3 = React$1.useState(0),
1591
1591
  _useState4 = _slicedToArray(_useState3, 2),
1592
1592
  dripX = _useState4[0],
1593
1593
  setDripX = _useState4[1];
1594
- var _useState5 = React.useState(0),
1594
+ var _useState5 = React$1.useState(0),
1595
1595
  _useState6 = _slicedToArray(_useState5, 2),
1596
1596
  dripY = _useState6[0],
1597
1597
  setDripY = _useState6[1];
@@ -1610,6 +1610,8 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
1610
1610
  ghost = _filteredProps$ghost === undefined ? false : _filteredProps$ghost,
1611
1611
  _filteredProps$effect = filteredProps.effect,
1612
1612
  effect = _filteredProps$effect === undefined ? true : _filteredProps$effect,
1613
+ _filteredProps$round = filteredProps.round,
1614
+ round = _filteredProps$round === undefined ? false : _filteredProps$round,
1613
1615
  onClick = filteredProps.onClick,
1614
1616
  _filteredProps$auto = filteredProps.auto,
1615
1617
  auto = _filteredProps$auto === undefined ? false : _filteredProps$auto,
@@ -1623,21 +1625,21 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
1623
1625
  var props = _objectWithoutProperties(filteredProps, _excluded);
1624
1626
  /* eslint-enable @typescript-eslint/no-unused-vars */
1625
1627
 
1626
- var _useMemo = React.useMemo(function () {
1628
+ var _useMemo = React$1.useMemo(function () {
1627
1629
  return getButtonColors(theme.palette, filteredProps);
1628
1630
  }, [theme.palette, filteredProps]),
1629
1631
  bg = _useMemo.bg,
1630
1632
  border = _useMemo.border,
1631
1633
  color = _useMemo.color;
1632
- var hover = React.useMemo(function () {
1634
+ var hover = React$1.useMemo(function () {
1633
1635
  return getButtonHoverColors(theme.palette, filteredProps);
1634
1636
  }, [theme.palette, filteredProps]);
1635
- var _useMemo2 = React.useMemo(function () {
1637
+ var _useMemo2 = React$1.useMemo(function () {
1636
1638
  return getButtonCursor(disabled, loading);
1637
1639
  }, [disabled, loading]),
1638
1640
  cursor = _useMemo2.cursor,
1639
1641
  events = _useMemo2.events;
1640
- var dripColor = React.useMemo(function () {
1642
+ var dripColor = React$1.useMemo(function () {
1641
1643
  return getButtonDripColor(theme.palette, filteredProps);
1642
1644
  }, [theme.palette, filteredProps]);
1643
1645
 
@@ -1659,7 +1661,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
1659
1661
  }
1660
1662
  onClick && onClick(event);
1661
1663
  };
1662
- var childrenWithIcon = React.useMemo(function () {
1664
+ var childrenWithIcon = React$1.useMemo(function () {
1663
1665
  return getButtonChildrenWithIcon(auto, children, {
1664
1666
  icon: icon,
1665
1667
  iconRight: iconRight
@@ -1667,28 +1669,107 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
1667
1669
  }, [auto, children, icon, iconRight]);
1668
1670
  var paddingLeft = auto ? SCALES.pl(1.15) : SCALES.pl(1.375),
1669
1671
  paddingRight = auto ? SCALES.pr(1.15) : SCALES.pr(1.375);
1670
- return /*#__PURE__*/React.createElement("button", _extends({
1672
+ return /*#__PURE__*/React$1.createElement("button", _extends({
1671
1673
  ref: buttonRef,
1672
1674
  type: htmlType,
1673
1675
  disabled: disabled,
1674
1676
  onClick: clickHandler
1675
1677
  }, props, {
1676
- className: _JSXStyle.dynamic([["22324076", [SCALES.height(2.5), theme.layout.radius, SCALES.font(0.875), color, bg, border, cursor, events, shadow ? theme.expressiveness.shadowSmall : '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, shadow ? theme.expressiveness.shadowMedium : 'none', shadow ? '-1px' : '0px']]]) + " " + (props && props.className != null && props.className || useClasses('btn', className) || "")
1677
- }), loading && /*#__PURE__*/React.createElement(ButtonLoading, {
1678
+ className: _JSXStyle.dynamic([["1558010596", [SCALES.height(2.5), round ? '50%' : theme.layout.radius, SCALES.font(0.875), color, bg, border, cursor, events, shadow ? theme.expressiveness.shadowSmall : '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, shadow ? theme.expressiveness.shadowMedium : 'none', shadow ? '-1px' : '0px']]]) + " " + (props && props.className != null && props.className || useClasses('btn', className) || "")
1679
+ }), loading && /*#__PURE__*/React$1.createElement(ButtonLoading, {
1678
1680
  color: color
1679
- }), childrenWithIcon, dripShow && /*#__PURE__*/React.createElement(ButtonDrip, {
1681
+ }), childrenWithIcon, dripShow && /*#__PURE__*/React$1.createElement(ButtonDrip, {
1680
1682
  x: dripX,
1681
1683
  y: dripY,
1682
1684
  color: dripColor,
1683
1685
  onCompleted: dripCompletedHandle
1684
- }), /*#__PURE__*/React.createElement(_JSXStyle, {
1685
- id: "22324076",
1686
- dynamic: [SCALES.height(2.5), theme.layout.radius, SCALES.font(0.875), color, bg, border, cursor, events, shadow ? theme.expressiveness.shadowSmall : '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, shadow ? theme.expressiveness.shadowMedium : 'none', shadow ? '-1px' : '0px']
1687
- }, ".btn.__jsx-style-dynamic-selector{box-sizing:border-box;display:inline-block;line-height:".concat(SCALES.height(2.5), ";border-radius:").concat(theme.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(border, ";cursor:").concat(cursor, ";pointer-events:").concat(events, ";box-shadow:").concat(shadow ? theme.expressiveness.shadowSmall : '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(shadow ? theme.expressiveness.shadowMedium : 'none', ";-webkit-transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);-ms-transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);}.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;}")));
1686
+ }), /*#__PURE__*/React$1.createElement(_JSXStyle, {
1687
+ id: "1558010596",
1688
+ dynamic: [SCALES.height(2.5), round ? '50%' : theme.layout.radius, SCALES.font(0.875), color, bg, border, cursor, events, shadow ? theme.expressiveness.shadowSmall : '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, shadow ? theme.expressiveness.shadowMedium : 'none', shadow ? '-1px' : '0px']
1689
+ }, ".btn.__jsx-style-dynamic-selector{box-sizing:border-box;display:inline-block;line-height:".concat(SCALES.height(2.5), ";border-radius:").concat(round ? '50%' : theme.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(border, ";cursor:").concat(cursor, ";pointer-events:").concat(events, ";box-shadow:").concat(shadow ? theme.expressiveness.shadowSmall : '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(shadow ? theme.expressiveness.shadowMedium : 'none', ";-webkit-transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);-ms-transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);}.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;}")));
1688
1690
  });
1689
1691
  ButtonComponent.displayName = 'Button';
1690
1692
  var Button = withScale(ButtonComponent);
1691
1693
 
1694
+ var CompactButton = function CompactButton(_ref) {
1695
+ var _ref$to = _ref.to,
1696
+ to = _ref$to === undefined ? '/' : _ref$to,
1697
+ children = _ref.children,
1698
+ iconRight = _ref.iconRight,
1699
+ icon = _ref.icon,
1700
+ _ref$scale = _ref.scale,
1701
+ scale = _ref$scale === undefined ? 2 / 3 : _ref$scale,
1702
+ type = _ref.type,
1703
+ style = _ref.style,
1704
+ a = _ref.a,
1705
+ target = _ref.target,
1706
+ onClick = _ref.onClick;
1707
+ if (a) {
1708
+ return /*#__PURE__*/React.createElement("a", {
1709
+ style: {
1710
+ all: 'unset',
1711
+ boxSizing: 'border-box',
1712
+ display: 'inline-block',
1713
+ lineHeight: 'calc(2.5* 16px)',
1714
+ fontWeight: '400',
1715
+ fontSize: 'calc(0.875* 16px)',
1716
+ textAlign: 'center',
1717
+ whiteSpace: 'nowrap',
1718
+ position: 'relative',
1719
+ overflow: 'hidden',
1720
+ color: '#666',
1721
+ backgroundColor: '#fff',
1722
+ cursor: 'pointer',
1723
+ minWidth: 'min-content',
1724
+ width: 'auto',
1725
+ height: 'calc(2.5* 16px)',
1726
+ padding: '0 calc(0.69* 16px) 0 calc(0.69* 16px)',
1727
+ margin: 0,
1728
+ '--helpdice-ui-button-height': 'calc(2.5* 16px)',
1729
+ '--helpdice-ui-button-icon-padding': 'calc(0.4362* 16px)'
1730
+ },
1731
+ href: to,
1732
+ target: target
1733
+ }, /*#__PURE__*/React.createElement("span", {
1734
+ style: {
1735
+ position: 'absolute',
1736
+ right: 'auto',
1737
+ left: 'var(--helpdice-ui-button-icon-padding)',
1738
+ top: '50%',
1739
+ transform: 'translateY(-50%)',
1740
+ display: 'flex',
1741
+ justifyContent: 'center',
1742
+ alignItems: 'center',
1743
+ color: 'var(--helpdice-ui-button-color)',
1744
+ zIndex: 1
1745
+ }
1746
+ }, icon), /*#__PURE__*/React.createElement("div", {
1747
+ style: {
1748
+ display: 'inline-flex',
1749
+ position: 'relative',
1750
+ zIndex: 1,
1751
+ justifyContent: 'center',
1752
+ alignItems: 'center',
1753
+ textAlign: 'center',
1754
+ lineHeight: 'inherit',
1755
+ paddingLeft: icon ? 'calc(var(--helpdice-ui-button-height) / 2 + var(--helpdice-ui-button-icon-padding)* .5)' : 0
1756
+ }
1757
+ }, children));
1758
+ }
1759
+ return /*#__PURE__*/React.createElement(Button, {
1760
+ icon: icon,
1761
+ style: style,
1762
+ type: type,
1763
+ onClick: onClick,
1764
+ auto: true,
1765
+ scale: scale,
1766
+ px: 0.6,
1767
+ iconRight: iconRight
1768
+ }, children);
1769
+ };
1770
+ var button_compact = /*#__PURE__*/React$1.memo(CompactButton);
1771
+
1692
1772
  /* "use client" */
1693
1773
 
1774
+ exports.LinkButton = button_compact;
1694
1775
  exports.default = Button;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ type RendererProps = {
3
+ htmlString: string;
4
+ };
5
+ declare const HtmlRenderer: React.FC<RendererProps>;
6
+ export default HtmlRenderer;
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export { default as Badge } from './badge';
6
6
  export type { BadgeProps, BadgeAnchorProps } from './badge';
7
7
  export { default as Breadcrumbs } from './breadcrumbs';
8
8
  export type { BreadcrumbsProps, BreadcrumbsItemProps, BreadcrumbsSeparatorProps, } from './breadcrumbs';
9
- export { default as Button } from './button';
9
+ export { default as Button, LinkButton } from './button';
10
10
  export type { ButtonProps } from './button';
11
11
  export { default as ButtonDropdown } from './button-dropdown';
12
12
  export type { ButtonDropdownProps, ButtonDropdownItemProps } from './button-dropdown';
@@ -41,6 +41,7 @@ export type { UiProviderProps } from './ui-provider';
41
41
  export { default as Grid } from './grid';
42
42
  export { default as Container } from './grid/grid-container';
43
43
  export type { GridProps, GridContainerProps } from './grid';
44
+ export { default as HtmlRenderer } from './html-renderer';
44
45
  export { default as Image } from './image';
45
46
  export type { ImageProps, ImageBrowserProps } from './image';
46
47
  export { default as Input } from './input';
@@ -95,6 +96,7 @@ export { default as Tooltip } from './tooltip';
95
96
  export type { TooltipProps } from './tooltip';
96
97
  export { default as Tree } from './tree';
97
98
  export type { TreeProps } from './tree';
99
+ export { useTime, useTimer, useStopwatch } from './timer';
98
100
  export { default as useAllThemes } from './use-all-themes';
99
101
  export type { AllThemesConfig } from './use-all-themes';
100
102
  export { default as useToasts } from './use-toasts';