@helpdice/ui 2.3.2 → 2.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auto-complete/index.js +9 -2
- package/dist/avatar/avatar.d.ts +1 -0
- package/dist/avatar/index.js +7 -1
- package/dist/button/button.d.ts +1 -0
- package/dist/button/index.d.ts +6 -2
- package/dist/button/index.js +23 -27
- package/dist/carousal/index.js +49 -3
- package/dist/container/index.js +49 -3
- package/dist/copy-to-clipboard/index.js +49 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +42 -31
- package/dist/input/index.js +9 -2
- package/dist/input/input-props.d.ts +1 -0
- package/dist/modal/index.js +9 -3
- package/dist/placeholder/index.js +49 -3
- package/dist/table/index.js +68 -6
- package/dist/text/index.js +49 -3
- package/dist/user/index.js +7 -1
- package/esm/avatar/avatar.d.ts +1 -0
- package/esm/avatar/avatar.js +7 -1
- package/esm/button/button.compact.js +10 -21
- package/esm/button/button.d.ts +1 -0
- package/esm/button/button.js +9 -3
- package/esm/button/index.d.ts +6 -2
- package/esm/button/index.js +2 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/input/input-field.js +9 -2
- package/esm/input/input-props.d.ts +1 -0
- package/esm/table/table-cell.js +2 -1
- package/package.json +2 -2
|
@@ -1038,7 +1038,7 @@ var withScale = function withScale(Render) {
|
|
|
1038
1038
|
return ScaleFC;
|
|
1039
1039
|
};
|
|
1040
1040
|
|
|
1041
|
-
var _excluded$5 = ["label", "labelRight", "error", "color", "helperText", "type", "icon", "variant", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled", "fullWidth"];
|
|
1041
|
+
var _excluded$5 = ["label", "labelRight", "error", "color", "helperText", "type", "icon", "variant", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "onEnter", "autoComplete", "placeholder", "children", "disabled", "fullWidth"];
|
|
1042
1042
|
var simulateChangeEvent = function simulateChangeEvent(el, event) {
|
|
1043
1043
|
return _objectSpread2(_objectSpread2({}, event), {}, {
|
|
1044
1044
|
target: el,
|
|
@@ -1074,6 +1074,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1074
1074
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1075
1075
|
onBlur = _ref.onBlur,
|
|
1076
1076
|
onFocus = _ref.onFocus,
|
|
1077
|
+
onEnter = _ref.onEnter,
|
|
1077
1078
|
_ref$autoComplete = _ref.autoComplete,
|
|
1078
1079
|
autoComplete = _ref$autoComplete === void 0 ? 'off' : _ref$autoComplete,
|
|
1079
1080
|
_ref$placeholder = _ref.placeholder,
|
|
@@ -1153,6 +1154,11 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1153
1154
|
setSelfValue(value);
|
|
1154
1155
|
}
|
|
1155
1156
|
});
|
|
1157
|
+
var handleKeyDown = function handleKeyDown(e) {
|
|
1158
|
+
if (e.key === "Enter") {
|
|
1159
|
+
onEnter && onEnter(e);
|
|
1160
|
+
}
|
|
1161
|
+
};
|
|
1156
1162
|
var controlledValue = isControlledComponent ? {
|
|
1157
1163
|
value: selfValue
|
|
1158
1164
|
} : {
|
|
@@ -1180,7 +1186,8 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1180
1186
|
onFocus: focusHandler,
|
|
1181
1187
|
onBlur: blurHandler,
|
|
1182
1188
|
onChange: changeHandler,
|
|
1183
|
-
autoComplete: autoComplete
|
|
1189
|
+
autoComplete: autoComplete,
|
|
1190
|
+
onKeyDown: handleKeyDown
|
|
1184
1191
|
}, inputProps, {
|
|
1185
1192
|
className: _JSXStyle.dynamic([["2582554466", [SCALES.height(2.25), SCALES.font(0.875), SCALES.width(1, defaultWidth), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.width(1, defaultWidth), variant === 'normal' ? theme$1.layout.radius : '', variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), theme$1.palette.accents_1, theme$1.palette.accents_2, hoverBorder, SCALES.font(0.875), color, theme$1.palette.accents_3, theme$1.palette.background, color]]]) + " " + (inputProps && inputProps.className != null && inputProps.className || theme.useClasses({
|
|
1186
1193
|
disabled: disabled
|
package/dist/avatar/avatar.d.ts
CHANGED
package/dist/avatar/index.js
CHANGED
|
@@ -820,7 +820,7 @@ var withScale = function withScale(Render) {
|
|
|
820
820
|
return ScaleFC;
|
|
821
821
|
};
|
|
822
822
|
|
|
823
|
-
var _excluded = ["src", "stacked", "text", "isSquare", "className", "children"];
|
|
823
|
+
var _excluded = ["src", "errorSrc", "stacked", "text", "isSquare", "className", "children"];
|
|
824
824
|
|
|
825
825
|
// type NativeAttrs = Omit<
|
|
826
826
|
// Partial<React.ImgHTMLAttributes<any> & React.HTMLAttributes<any>>,
|
|
@@ -833,6 +833,7 @@ var safeText = function safeText(text) {
|
|
|
833
833
|
};
|
|
834
834
|
var AvatarComponent = function AvatarComponent(_ref) {
|
|
835
835
|
var src = _ref.src,
|
|
836
|
+
errorSrc = _ref.errorSrc,
|
|
836
837
|
_ref$stacked = _ref.stacked,
|
|
837
838
|
stacked = _ref$stacked === void 0 ? false : _ref$stacked,
|
|
838
839
|
_ref$text = _ref.text,
|
|
@@ -857,6 +858,11 @@ var AvatarComponent = function AvatarComponent(_ref) {
|
|
|
857
858
|
src: src,
|
|
858
859
|
draggable: false
|
|
859
860
|
}, props, {
|
|
861
|
+
onError: function onError(e) {
|
|
862
|
+
var target = e.currentTarget;
|
|
863
|
+
target.onerror = null; // prevent loop
|
|
864
|
+
target.src = errorSrc !== null && errorSrc !== void 0 ? errorSrc : "https://helpdice.com/avatar.webp";
|
|
865
|
+
},
|
|
860
866
|
className: _JSXStyle.dynamic([["2295275975", [theme$1.palette.accents_2, radius, theme$1.palette.background, SCALES.width(1.75) || SCALES.height(1.75), SCALES.height(1.75) || SCALES.width(1.75), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), marginLeft, radius, SCALES.font(1)]]]) + " " + (props && props.className != null && props.className || "avatar-img")
|
|
861
867
|
})), showText && /*#__PURE__*/React.createElement("span", _extends({}, props, {
|
|
862
868
|
className: _JSXStyle.dynamic([["2295275975", [theme$1.palette.accents_2, radius, theme$1.palette.background, SCALES.width(1.75) || SCALES.height(1.75), SCALES.height(1.75) || SCALES.width(1.75), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), marginLeft, radius, SCALES.font(1)]]]) + " " + (props && props.className != null && props.className || "avatar-text")
|
package/dist/button/button.d.ts
CHANGED
package/dist/button/index.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import Button from './button';
|
|
2
|
-
|
|
2
|
+
import CompactButton from './button.compact';
|
|
3
3
|
export type { ButtonProps } from './button';
|
|
4
4
|
export type { ButtonTypes } from '../utils/prop-types';
|
|
5
|
-
export
|
|
5
|
+
export type ButtonComponentType = typeof Button & {
|
|
6
|
+
Compact: typeof CompactButton;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: ButtonComponentType;
|
|
9
|
+
export default _default;
|
package/dist/button/index.js
CHANGED
|
@@ -1314,7 +1314,7 @@ var getButtonDripColor = function getButtonDripColor(palette, props) {
|
|
|
1314
1314
|
return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
|
|
1315
1315
|
};
|
|
1316
1316
|
|
|
1317
|
-
var _excluded = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
|
|
1317
|
+
var _excluded = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "a", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
|
|
1318
1318
|
var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
1319
1319
|
var theme$1 = theme.useTheme();
|
|
1320
1320
|
var _useScale = useScale(),
|
|
@@ -1353,6 +1353,8 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1353
1353
|
effect = _filteredProps$effect === void 0 ? true : _filteredProps$effect,
|
|
1354
1354
|
_filteredProps$round = filteredProps.round,
|
|
1355
1355
|
round = _filteredProps$round === void 0 ? false : _filteredProps$round,
|
|
1356
|
+
_filteredProps$a = filteredProps.a,
|
|
1357
|
+
a = _filteredProps$a === void 0 ? false : _filteredProps$a,
|
|
1356
1358
|
onClick = filteredProps.onClick,
|
|
1357
1359
|
_filteredProps$auto = filteredProps.auto,
|
|
1358
1360
|
auto = _filteredProps$auto === void 0 ? false : _filteredProps$auto,
|
|
@@ -1456,7 +1458,11 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1456
1458
|
|
|
1457
1459
|
// If shadow provided is string then value other default
|
|
1458
1460
|
var btnShadow = typeof shadow === 'string' ? shadow : shadow ? theme$1.shadows.level.z2 : 'none';
|
|
1459
|
-
return /*#__PURE__*/React.createElement("
|
|
1461
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, a ? /*#__PURE__*/React.createElement("a", _extends({}, props, {
|
|
1462
|
+
className: _JSXStyle.dynamic([["905110486", [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, shadow ? 'transparent' : border, cursor, 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) || "")
|
|
1463
|
+
}), loading && /*#__PURE__*/React.createElement(ButtonLoading, {
|
|
1464
|
+
color: color
|
|
1465
|
+
}), childrenWithIcon) : /*#__PURE__*/React.createElement("button", _extends({
|
|
1460
1466
|
ref: buttonRef,
|
|
1461
1467
|
type: type,
|
|
1462
1468
|
disabled: disabled,
|
|
@@ -1470,7 +1476,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1470
1476
|
y: dripY,
|
|
1471
1477
|
color: dripColor,
|
|
1472
1478
|
onCompleted: dripCompletedHandle
|
|
1473
|
-
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1479
|
+
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1474
1480
|
id: "905110486",
|
|
1475
1481
|
dynamic: [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, shadow ? 'transparent' : border, cursor, 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']
|
|
1476
1482
|
}, ".btn.__jsx-style-dynamic-selector{box-sizing:border-box;display:inline-block;line-height:".concat(SCALES.height(2.5), ";border-radius:").concat(round ? '50%' : theme$1.layout.radius, ";font-weight:400;font-size:").concat(SCALES.font(0.875), ";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;text-transform:capitalize;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center;white-space:nowrap;-webkit-transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;position:relative;overflow:hidden;color:").concat(color, ";background-color:").concat(bg, ";border:1px solid ").concat(shadow ? 'transparent' : border, ";cursor:").concat(cursor, ";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.__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;}}")));
|
|
@@ -1480,36 +1486,25 @@ var Button = withScale(ButtonComponent);
|
|
|
1480
1486
|
|
|
1481
1487
|
var CompactButton = function CompactButton(_ref) {
|
|
1482
1488
|
_ref.color;
|
|
1483
|
-
var
|
|
1484
|
-
to = _ref$to === void 0 ? '/' : _ref$to,
|
|
1485
|
-
children = _ref.children,
|
|
1489
|
+
var children = _ref.children,
|
|
1486
1490
|
iconRight = _ref.iconRight,
|
|
1487
1491
|
icon = _ref.icon,
|
|
1488
1492
|
_ref$scale = _ref.scale,
|
|
1489
1493
|
scale = _ref$scale === void 0 ? 2 / 3 : _ref$scale,
|
|
1490
1494
|
type = _ref.type,
|
|
1491
1495
|
style = _ref.style,
|
|
1492
|
-
a = _ref.a,
|
|
1493
|
-
_ref$target = _ref.target,
|
|
1494
|
-
target = _ref$target === void 0 ? "_self" : _ref$target,
|
|
1495
1496
|
onClick = _ref.onClick;
|
|
1496
1497
|
var theme$1 = theme.useTheme();
|
|
1497
|
-
if (a) {
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
auto: true,
|
|
1508
|
-
scale: scale,
|
|
1509
|
-
px: 0.6,
|
|
1510
|
-
iconRight: iconRight
|
|
1511
|
-
}, children);
|
|
1512
|
-
}
|
|
1498
|
+
// if (a) {
|
|
1499
|
+
// return (
|
|
1500
|
+
// <Button icon={icon} style={{
|
|
1501
|
+
// ...style,
|
|
1502
|
+
// backgroundColor: theme.palette.background
|
|
1503
|
+
// }} type={type} onClick={() => window.open(to, target)} auto scale={scale} px={0.6} iconRight={iconRight}>
|
|
1504
|
+
// {children}
|
|
1505
|
+
// </Button>
|
|
1506
|
+
// );
|
|
1507
|
+
// }
|
|
1513
1508
|
return /*#__PURE__*/React.createElement(Button, {
|
|
1514
1509
|
icon: icon,
|
|
1515
1510
|
style: _objectSpread2(_objectSpread2({}, style), {}, {
|
|
@@ -1523,9 +1518,10 @@ var CompactButton = function CompactButton(_ref) {
|
|
|
1523
1518
|
iconRight: iconRight
|
|
1524
1519
|
}, children);
|
|
1525
1520
|
};
|
|
1526
|
-
var
|
|
1521
|
+
var CompactButton$1 = /*#__PURE__*/React.memo(CompactButton);
|
|
1527
1522
|
|
|
1528
1523
|
/* "use client" */
|
|
1529
1524
|
|
|
1530
|
-
|
|
1525
|
+
Button.Compact = CompactButton$1;
|
|
1526
|
+
|
|
1531
1527
|
exports.default = Button;
|
package/dist/carousal/index.js
CHANGED
|
@@ -2727,7 +2727,7 @@ var getButtonDripColor = function getButtonDripColor(palette, props) {
|
|
|
2727
2727
|
return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
|
|
2728
2728
|
};
|
|
2729
2729
|
|
|
2730
|
-
var _excluded = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
|
|
2730
|
+
var _excluded = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "a", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
|
|
2731
2731
|
var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
2732
2732
|
var theme$1 = theme.useTheme();
|
|
2733
2733
|
var _useScale = useScale(),
|
|
@@ -2766,6 +2766,8 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
2766
2766
|
effect = _filteredProps$effect === void 0 ? true : _filteredProps$effect,
|
|
2767
2767
|
_filteredProps$round = filteredProps.round,
|
|
2768
2768
|
round = _filteredProps$round === void 0 ? false : _filteredProps$round,
|
|
2769
|
+
_filteredProps$a = filteredProps.a,
|
|
2770
|
+
a = _filteredProps$a === void 0 ? false : _filteredProps$a,
|
|
2769
2771
|
onClick = filteredProps.onClick,
|
|
2770
2772
|
_filteredProps$auto = filteredProps.auto,
|
|
2771
2773
|
auto = _filteredProps$auto === void 0 ? false : _filteredProps$auto,
|
|
@@ -2869,7 +2871,11 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
2869
2871
|
|
|
2870
2872
|
// If shadow provided is string then value other default
|
|
2871
2873
|
var btnShadow = typeof shadow === 'string' ? shadow : shadow ? theme$1.shadows.level.z2 : 'none';
|
|
2872
|
-
return /*#__PURE__*/React.createElement("
|
|
2874
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, a ? /*#__PURE__*/React.createElement("a", _extends({}, props, {
|
|
2875
|
+
className: _JSXStyle.dynamic([["905110486", [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, shadow ? 'transparent' : border, cursor, 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) || "")
|
|
2876
|
+
}), loading && /*#__PURE__*/React.createElement(ButtonLoading, {
|
|
2877
|
+
color: color
|
|
2878
|
+
}), childrenWithIcon) : /*#__PURE__*/React.createElement("button", _extends({
|
|
2873
2879
|
ref: buttonRef,
|
|
2874
2880
|
type: type,
|
|
2875
2881
|
disabled: disabled,
|
|
@@ -2883,7 +2889,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
2883
2889
|
y: dripY,
|
|
2884
2890
|
color: dripColor,
|
|
2885
2891
|
onCompleted: dripCompletedHandle
|
|
2886
|
-
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
2892
|
+
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
2887
2893
|
id: "905110486",
|
|
2888
2894
|
dynamic: [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, shadow ? 'transparent' : border, cursor, 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']
|
|
2889
2895
|
}, ".btn.__jsx-style-dynamic-selector{box-sizing:border-box;display:inline-block;line-height:".concat(SCALES.height(2.5), ";border-radius:").concat(round ? '50%' : theme$1.layout.radius, ";font-weight:400;font-size:").concat(SCALES.font(0.875), ";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;text-transform:capitalize;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center;white-space:nowrap;-webkit-transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;position:relative;overflow:hidden;color:").concat(color, ";background-color:").concat(bg, ";border:1px solid ").concat(shadow ? 'transparent' : border, ";cursor:").concat(cursor, ";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.__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;}}")));
|
|
@@ -2891,6 +2897,46 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
2891
2897
|
ButtonComponent.displayName = 'Button';
|
|
2892
2898
|
var Button = withScale(ButtonComponent);
|
|
2893
2899
|
|
|
2900
|
+
var CompactButton = function CompactButton(_ref) {
|
|
2901
|
+
_ref.color;
|
|
2902
|
+
var children = _ref.children,
|
|
2903
|
+
iconRight = _ref.iconRight,
|
|
2904
|
+
icon = _ref.icon,
|
|
2905
|
+
_ref$scale = _ref.scale,
|
|
2906
|
+
scale = _ref$scale === void 0 ? 2 / 3 : _ref$scale,
|
|
2907
|
+
type = _ref.type,
|
|
2908
|
+
style = _ref.style,
|
|
2909
|
+
onClick = _ref.onClick;
|
|
2910
|
+
var theme$1 = theme.useTheme();
|
|
2911
|
+
// if (a) {
|
|
2912
|
+
// return (
|
|
2913
|
+
// <Button icon={icon} style={{
|
|
2914
|
+
// ...style,
|
|
2915
|
+
// backgroundColor: theme.palette.background
|
|
2916
|
+
// }} type={type} onClick={() => window.open(to, target)} auto scale={scale} px={0.6} iconRight={iconRight}>
|
|
2917
|
+
// {children}
|
|
2918
|
+
// </Button>
|
|
2919
|
+
// );
|
|
2920
|
+
// }
|
|
2921
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
2922
|
+
icon: icon,
|
|
2923
|
+
style: _objectSpread2(_objectSpread2({}, style), {}, {
|
|
2924
|
+
backgroundColor: theme$1.palette.background
|
|
2925
|
+
}),
|
|
2926
|
+
type: type,
|
|
2927
|
+
onClick: onClick,
|
|
2928
|
+
auto: true,
|
|
2929
|
+
scale: scale,
|
|
2930
|
+
px: 0.6,
|
|
2931
|
+
iconRight: iconRight
|
|
2932
|
+
}, children);
|
|
2933
|
+
};
|
|
2934
|
+
var CompactButton$1 = /*#__PURE__*/React.memo(CompactButton);
|
|
2935
|
+
|
|
2936
|
+
/* "use client" */
|
|
2937
|
+
|
|
2938
|
+
Button.Compact = CompactButton$1;
|
|
2939
|
+
|
|
2894
2940
|
var isKeyboardEvent$1 = function isKeyboardEvent(e) {
|
|
2895
2941
|
return e.hasOwnProperty('key');
|
|
2896
2942
|
};
|
package/dist/container/index.js
CHANGED
|
@@ -1407,7 +1407,7 @@ var getButtonDripColor = function getButtonDripColor(palette, props) {
|
|
|
1407
1407
|
return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
|
|
1408
1408
|
};
|
|
1409
1409
|
|
|
1410
|
-
var _excluded$1 = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
|
|
1410
|
+
var _excluded$1 = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "a", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
|
|
1411
1411
|
var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
1412
1412
|
var theme$1 = theme.useTheme();
|
|
1413
1413
|
var _useScale = useScale(),
|
|
@@ -1446,6 +1446,8 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1446
1446
|
effect = _filteredProps$effect === void 0 ? true : _filteredProps$effect,
|
|
1447
1447
|
_filteredProps$round = filteredProps.round,
|
|
1448
1448
|
round = _filteredProps$round === void 0 ? false : _filteredProps$round,
|
|
1449
|
+
_filteredProps$a = filteredProps.a,
|
|
1450
|
+
a = _filteredProps$a === void 0 ? false : _filteredProps$a,
|
|
1449
1451
|
onClick = filteredProps.onClick,
|
|
1450
1452
|
_filteredProps$auto = filteredProps.auto,
|
|
1451
1453
|
auto = _filteredProps$auto === void 0 ? false : _filteredProps$auto,
|
|
@@ -1549,7 +1551,11 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1549
1551
|
|
|
1550
1552
|
// If shadow provided is string then value other default
|
|
1551
1553
|
var btnShadow = typeof shadow === 'string' ? shadow : shadow ? theme$1.shadows.level.z2 : 'none';
|
|
1552
|
-
return /*#__PURE__*/React.createElement("
|
|
1554
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, a ? /*#__PURE__*/React.createElement("a", _extends({}, props, {
|
|
1555
|
+
className: _JSXStyle.dynamic([["905110486", [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, shadow ? 'transparent' : border, cursor, 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) || "")
|
|
1556
|
+
}), loading && /*#__PURE__*/React.createElement(ButtonLoading, {
|
|
1557
|
+
color: color
|
|
1558
|
+
}), childrenWithIcon) : /*#__PURE__*/React.createElement("button", _extends({
|
|
1553
1559
|
ref: buttonRef,
|
|
1554
1560
|
type: type,
|
|
1555
1561
|
disabled: disabled,
|
|
@@ -1563,7 +1569,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1563
1569
|
y: dripY,
|
|
1564
1570
|
color: dripColor,
|
|
1565
1571
|
onCompleted: dripCompletedHandle
|
|
1566
|
-
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1572
|
+
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1567
1573
|
id: "905110486",
|
|
1568
1574
|
dynamic: [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, shadow ? 'transparent' : border, cursor, 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']
|
|
1569
1575
|
}, ".btn.__jsx-style-dynamic-selector{box-sizing:border-box;display:inline-block;line-height:".concat(SCALES.height(2.5), ";border-radius:").concat(round ? '50%' : theme$1.layout.radius, ";font-weight:400;font-size:").concat(SCALES.font(0.875), ";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;text-transform:capitalize;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center;white-space:nowrap;-webkit-transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;position:relative;overflow:hidden;color:").concat(color, ";background-color:").concat(bg, ";border:1px solid ").concat(shadow ? 'transparent' : border, ";cursor:").concat(cursor, ";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.__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;}}")));
|
|
@@ -1571,6 +1577,46 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1571
1577
|
ButtonComponent.displayName = 'Button';
|
|
1572
1578
|
var Button = withScale(ButtonComponent);
|
|
1573
1579
|
|
|
1580
|
+
var CompactButton = function CompactButton(_ref) {
|
|
1581
|
+
_ref.color;
|
|
1582
|
+
var children = _ref.children,
|
|
1583
|
+
iconRight = _ref.iconRight,
|
|
1584
|
+
icon = _ref.icon,
|
|
1585
|
+
_ref$scale = _ref.scale,
|
|
1586
|
+
scale = _ref$scale === void 0 ? 2 / 3 : _ref$scale,
|
|
1587
|
+
type = _ref.type,
|
|
1588
|
+
style = _ref.style,
|
|
1589
|
+
onClick = _ref.onClick;
|
|
1590
|
+
var theme$1 = theme.useTheme();
|
|
1591
|
+
// if (a) {
|
|
1592
|
+
// return (
|
|
1593
|
+
// <Button icon={icon} style={{
|
|
1594
|
+
// ...style,
|
|
1595
|
+
// backgroundColor: theme.palette.background
|
|
1596
|
+
// }} type={type} onClick={() => window.open(to, target)} auto scale={scale} px={0.6} iconRight={iconRight}>
|
|
1597
|
+
// {children}
|
|
1598
|
+
// </Button>
|
|
1599
|
+
// );
|
|
1600
|
+
// }
|
|
1601
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
1602
|
+
icon: icon,
|
|
1603
|
+
style: _objectSpread2(_objectSpread2({}, style), {}, {
|
|
1604
|
+
backgroundColor: theme$1.palette.background
|
|
1605
|
+
}),
|
|
1606
|
+
type: type,
|
|
1607
|
+
onClick: onClick,
|
|
1608
|
+
auto: true,
|
|
1609
|
+
scale: scale,
|
|
1610
|
+
px: 0.6,
|
|
1611
|
+
iconRight: iconRight
|
|
1612
|
+
}, children);
|
|
1613
|
+
};
|
|
1614
|
+
var CompactButton$1 = /*#__PURE__*/React.memo(CompactButton);
|
|
1615
|
+
|
|
1616
|
+
/* "use client" */
|
|
1617
|
+
|
|
1618
|
+
Button.Compact = CompactButton$1;
|
|
1619
|
+
|
|
1574
1620
|
var _excluded = ["gap", "children", "direction", "justify", "alignItems", "alignContent", "collapse", "className"];
|
|
1575
1621
|
var wrap = tuple('nowrap', 'wrap', 'wrap-reverse');
|
|
1576
1622
|
var Container = function Container(_ref) {
|
|
@@ -1449,7 +1449,7 @@ var getButtonDripColor = function getButtonDripColor(palette, props) {
|
|
|
1449
1449
|
return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
|
|
1450
1450
|
};
|
|
1451
1451
|
|
|
1452
|
-
var _excluded = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
|
|
1452
|
+
var _excluded = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "a", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
|
|
1453
1453
|
var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
1454
1454
|
var theme$1 = theme.useTheme();
|
|
1455
1455
|
var _useScale = useScale(),
|
|
@@ -1488,6 +1488,8 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1488
1488
|
effect = _filteredProps$effect === void 0 ? true : _filteredProps$effect,
|
|
1489
1489
|
_filteredProps$round = filteredProps.round,
|
|
1490
1490
|
round = _filteredProps$round === void 0 ? false : _filteredProps$round,
|
|
1491
|
+
_filteredProps$a = filteredProps.a,
|
|
1492
|
+
a = _filteredProps$a === void 0 ? false : _filteredProps$a,
|
|
1491
1493
|
onClick = filteredProps.onClick,
|
|
1492
1494
|
_filteredProps$auto = filteredProps.auto,
|
|
1493
1495
|
auto = _filteredProps$auto === void 0 ? false : _filteredProps$auto,
|
|
@@ -1591,7 +1593,11 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1591
1593
|
|
|
1592
1594
|
// If shadow provided is string then value other default
|
|
1593
1595
|
var btnShadow = typeof shadow === 'string' ? shadow : shadow ? theme$1.shadows.level.z2 : 'none';
|
|
1594
|
-
return /*#__PURE__*/React.createElement("
|
|
1596
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, a ? /*#__PURE__*/React.createElement("a", _extends({}, props, {
|
|
1597
|
+
className: _JSXStyle.dynamic([["905110486", [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, shadow ? 'transparent' : border, cursor, 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) || "")
|
|
1598
|
+
}), loading && /*#__PURE__*/React.createElement(ButtonLoading, {
|
|
1599
|
+
color: color
|
|
1600
|
+
}), childrenWithIcon) : /*#__PURE__*/React.createElement("button", _extends({
|
|
1595
1601
|
ref: buttonRef,
|
|
1596
1602
|
type: type,
|
|
1597
1603
|
disabled: disabled,
|
|
@@ -1605,7 +1611,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1605
1611
|
y: dripY,
|
|
1606
1612
|
color: dripColor,
|
|
1607
1613
|
onCompleted: dripCompletedHandle
|
|
1608
|
-
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1614
|
+
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1609
1615
|
id: "905110486",
|
|
1610
1616
|
dynamic: [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, shadow ? 'transparent' : border, cursor, 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']
|
|
1611
1617
|
}, ".btn.__jsx-style-dynamic-selector{box-sizing:border-box;display:inline-block;line-height:".concat(SCALES.height(2.5), ";border-radius:").concat(round ? '50%' : theme$1.layout.radius, ";font-weight:400;font-size:").concat(SCALES.font(0.875), ";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;text-transform:capitalize;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center;white-space:nowrap;-webkit-transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;position:relative;overflow:hidden;color:").concat(color, ";background-color:").concat(bg, ";border:1px solid ").concat(shadow ? 'transparent' : border, ";cursor:").concat(cursor, ";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.__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;}}")));
|
|
@@ -1613,6 +1619,46 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1613
1619
|
ButtonComponent.displayName = 'Button';
|
|
1614
1620
|
var Button = withScale(ButtonComponent);
|
|
1615
1621
|
|
|
1622
|
+
var CompactButton = function CompactButton(_ref) {
|
|
1623
|
+
_ref.color;
|
|
1624
|
+
var children = _ref.children,
|
|
1625
|
+
iconRight = _ref.iconRight,
|
|
1626
|
+
icon = _ref.icon,
|
|
1627
|
+
_ref$scale = _ref.scale,
|
|
1628
|
+
scale = _ref$scale === void 0 ? 2 / 3 : _ref$scale,
|
|
1629
|
+
type = _ref.type,
|
|
1630
|
+
style = _ref.style,
|
|
1631
|
+
onClick = _ref.onClick;
|
|
1632
|
+
var theme$1 = theme.useTheme();
|
|
1633
|
+
// if (a) {
|
|
1634
|
+
// return (
|
|
1635
|
+
// <Button icon={icon} style={{
|
|
1636
|
+
// ...style,
|
|
1637
|
+
// backgroundColor: theme.palette.background
|
|
1638
|
+
// }} type={type} onClick={() => window.open(to, target)} auto scale={scale} px={0.6} iconRight={iconRight}>
|
|
1639
|
+
// {children}
|
|
1640
|
+
// </Button>
|
|
1641
|
+
// );
|
|
1642
|
+
// }
|
|
1643
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
1644
|
+
icon: icon,
|
|
1645
|
+
style: _objectSpread2(_objectSpread2({}, style), {}, {
|
|
1646
|
+
backgroundColor: theme$1.palette.background
|
|
1647
|
+
}),
|
|
1648
|
+
type: type,
|
|
1649
|
+
onClick: onClick,
|
|
1650
|
+
auto: true,
|
|
1651
|
+
scale: scale,
|
|
1652
|
+
px: 0.6,
|
|
1653
|
+
iconRight: iconRight
|
|
1654
|
+
}, children);
|
|
1655
|
+
};
|
|
1656
|
+
var CompactButton$1 = /*#__PURE__*/React.memo(CompactButton);
|
|
1657
|
+
|
|
1658
|
+
/* "use client" */
|
|
1659
|
+
|
|
1660
|
+
Button.Compact = CompactButton$1;
|
|
1661
|
+
|
|
1616
1662
|
// export function Clipboard(props: ClipboardProps) {
|
|
1617
1663
|
// const { setToast } = useToasts();
|
|
1618
1664
|
// const { showIcon, text, onCopy, options: options, children, } = props;
|
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
|
|
9
|
+
export { default as Button } 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';
|