@helpdice/ui 2.1.5 → 2.1.9
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 +2158 -17
- package/dist/button/button.d.ts +1 -1
- package/dist/button/index.js +73 -16
- package/dist/button/styles.d.ts +1 -0
- package/dist/carousal/index.js +73 -16
- package/dist/container/box.d.ts +42 -0
- package/dist/container/index.d.ts +2 -0
- package/dist/container/index.js +948 -0
- package/dist/copy-to-clipboard/clipboard.d.ts +14 -0
- package/dist/copy-to-clipboard/copy.d.ts +2 -0
- package/dist/copy-to-clipboard/index.d.ts +2 -0
- package/dist/copy-to-clipboard/index.js +1702 -0
- package/dist/copy-to-clipboard/toggle-selection.d.ts +1 -0
- package/dist/grid/index.d.ts +2 -3
- package/dist/grid/index.js +0 -1
- package/dist/html-renderer/index.js +35 -12
- package/dist/index.d.ts +6 -6
- package/dist/index.js +15776 -15418
- package/dist/input/index.d.ts +4 -0
- package/dist/input/index.js +2162 -18
- package/dist/input/input-props.d.ts +1 -0
- package/dist/input/phone-input/phone.d.ts +13 -0
- package/dist/modal/index.js +73 -16
- package/dist/notetip/index.js +690 -0
- package/{esm/notetip/index.d.ts → dist/notetip/note-tip.d.ts} +2 -2
- package/dist/placeholder/index.js +643 -8
- package/dist/table/index.js +4370 -2163
- package/dist/text/child.d.ts +1 -0
- package/dist/text/index.js +686 -8
- package/dist/text/text.d.ts +1 -0
- package/esm/button/button.d.ts +1 -1
- package/esm/button/button.js +51 -5
- package/esm/button/styles.d.ts +1 -0
- package/esm/button/styles.js +22 -11
- package/esm/container/box.d.ts +42 -0
- package/esm/container/box.js +39 -0
- package/esm/container/index.d.ts +2 -0
- package/esm/container/index.js +2 -0
- package/esm/copy-to-clipboard/clipboard.d.ts +14 -0
- package/esm/copy-to-clipboard/clipboard.js +91 -0
- package/esm/copy-to-clipboard/copy.d.ts +2 -0
- package/esm/copy-to-clipboard/copy.js +105 -0
- package/esm/copy-to-clipboard/index.d.ts +2 -0
- package/esm/copy-to-clipboard/index.js +2 -0
- package/esm/copy-to-clipboard/toggle-selection.d.ts +1 -0
- package/esm/copy-to-clipboard/toggle-selection.js +31 -0
- package/esm/grid/index.d.ts +2 -3
- package/esm/grid/index.js +5 -3
- package/esm/index.d.ts +6 -6
- package/esm/index.js +7 -5
- package/esm/input/index.d.ts +4 -0
- package/esm/input/index.js +4 -0
- package/esm/input/input-field.js +12 -10
- package/esm/input/input-props.d.ts +1 -0
- package/esm/input/phone-input/phone.d.ts +13 -0
- package/esm/input/phone-input/phone.js +166 -0
- package/esm/notetip/index.js +2 -97
- package/{dist/notetip/index.d.ts → esm/notetip/note-tip.d.ts} +2 -2
- package/esm/notetip/note-tip.js +97 -0
- package/esm/table/table-body.js +2 -2
- package/esm/table/table-cell.js +1 -1
- package/esm/table/table-head.js +4 -2
- package/esm/table/table.js +0 -1
- package/esm/text/child.d.ts +1 -0
- package/esm/text/text.d.ts +1 -0
- package/esm/text/text.js +25 -3
- package/package.json +19 -19
- package/dist/currency-input/index.js +0 -862
- package/dist/phone-input/index.js +0 -2033
- package/dist/phone-input/phone.d.ts +0 -11
- package/esm/phone-input/phone.d.ts +0 -11
- package/esm/phone-input/phone.js +0 -161
- /package/dist/{currency-input → input/currency-input}/components/CurrencyInput.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/CurrencyInputProps.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/cleanValue.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/escapeRegExp.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/fixedDecimalValue.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/formatValue.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/getLocaleConfig.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/getSuffix.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/index.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/isNumber.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/padTrimValue.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/parseAbbrValue.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/removeInvalidChars.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/removeSeparators.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/components/utils/repositionCursor.d.ts +0 -0
- /package/dist/{currency-input → input/currency-input}/index.d.ts +0 -0
- /package/dist/{phone-input → input/phone-input}/index.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/CurrencyInput.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/CurrencyInput.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/CurrencyInputProps.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/CurrencyInputProps.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/addSeparators.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/cleanValue.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/cleanValue.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/escapeRegExp.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/escapeRegExp.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/fixedDecimalValue.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/fixedDecimalValue.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/formatValue.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/formatValue.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/getLocaleConfig.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/getLocaleConfig.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/getSuffix.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/getSuffix.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/index.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/index.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/isNumber.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/isNumber.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/padTrimValue.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/padTrimValue.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/parseAbbrValue.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/parseAbbrValue.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/removeInvalidChars.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/removeInvalidChars.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/removeSeparators.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/removeSeparators.js +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/repositionCursor.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/components/utils/repositionCursor.js +0 -0
- /package/esm/{currency-input → input/currency-input}/index.d.ts +0 -0
- /package/esm/{currency-input → input/currency-input}/index.js +0 -0
- /package/esm/{phone-input → input/phone-input}/index.d.ts +0 -0
- /package/esm/{phone-input → input/phone-input}/index.js +0 -0
package/dist/button/button.d.ts
CHANGED
package/dist/button/index.js
CHANGED
|
@@ -1121,22 +1121,26 @@ var getButtonGhostColors = function getButtonGhostColors(palette, _color) {
|
|
|
1121
1121
|
secondary: {
|
|
1122
1122
|
bg: palette.background,
|
|
1123
1123
|
border: palette.foreground,
|
|
1124
|
-
color: palette.foreground
|
|
1124
|
+
color: palette.foreground,
|
|
1125
|
+
ripple: ''
|
|
1125
1126
|
},
|
|
1126
1127
|
success: {
|
|
1127
1128
|
bg: palette.background,
|
|
1128
1129
|
border: palette.success,
|
|
1129
|
-
color: palette.success
|
|
1130
|
+
color: palette.success,
|
|
1131
|
+
ripple: ''
|
|
1130
1132
|
},
|
|
1131
1133
|
warning: {
|
|
1132
1134
|
bg: palette.background,
|
|
1133
1135
|
border: palette.warning,
|
|
1134
|
-
color: palette.warning
|
|
1136
|
+
color: palette.warning,
|
|
1137
|
+
ripple: ''
|
|
1135
1138
|
},
|
|
1136
1139
|
error: {
|
|
1137
1140
|
bg: palette.background,
|
|
1138
1141
|
border: palette.error,
|
|
1139
|
-
color: palette.error
|
|
1142
|
+
color: palette.error,
|
|
1143
|
+
ripple: ''
|
|
1140
1144
|
}
|
|
1141
1145
|
};
|
|
1142
1146
|
return colors[_color] || null;
|
|
@@ -1149,38 +1153,45 @@ var getButtonColors = function getButtonColors(palette, props) {
|
|
|
1149
1153
|
"default": {
|
|
1150
1154
|
bg: palette.background,
|
|
1151
1155
|
border: palette.border,
|
|
1152
|
-
color: palette.accents_5
|
|
1156
|
+
color: palette.accents_5,
|
|
1157
|
+
ripple: palette.accents_1
|
|
1153
1158
|
},
|
|
1154
1159
|
secondary: {
|
|
1155
1160
|
bg: palette.foreground,
|
|
1156
1161
|
border: palette.foreground,
|
|
1157
|
-
color: palette.background
|
|
1162
|
+
color: palette.background,
|
|
1163
|
+
ripple: palette.accents_1
|
|
1158
1164
|
},
|
|
1159
1165
|
success: {
|
|
1160
1166
|
bg: palette.success,
|
|
1161
1167
|
border: palette.success,
|
|
1162
|
-
color: '#fff'
|
|
1168
|
+
color: '#fff',
|
|
1169
|
+
ripple: '#1f93ffff'
|
|
1163
1170
|
},
|
|
1164
1171
|
warning: {
|
|
1165
1172
|
bg: palette.warning,
|
|
1166
1173
|
border: palette.warning,
|
|
1167
|
-
color: '#fff'
|
|
1174
|
+
color: '#fff',
|
|
1175
|
+
ripple: '#ffca29ff'
|
|
1168
1176
|
},
|
|
1169
1177
|
error: {
|
|
1170
1178
|
bg: palette.error,
|
|
1171
1179
|
border: palette.error,
|
|
1172
|
-
color: '#fff'
|
|
1180
|
+
color: '#fff',
|
|
1181
|
+
ripple: '#ff5a55ff'
|
|
1173
1182
|
},
|
|
1174
1183
|
abort: {
|
|
1175
1184
|
bg: 'transparent',
|
|
1176
1185
|
border: 'transparent',
|
|
1177
|
-
color: palette.accents_5
|
|
1186
|
+
color: palette.accents_5,
|
|
1187
|
+
ripple: palette.accents_1
|
|
1178
1188
|
}
|
|
1179
1189
|
};
|
|
1180
1190
|
if (disabled) return {
|
|
1181
1191
|
bg: palette.accents_1,
|
|
1182
1192
|
border: palette.accents_2,
|
|
1183
|
-
color: '#ccc'
|
|
1193
|
+
color: '#ccc',
|
|
1194
|
+
ripple: ''
|
|
1184
1195
|
};
|
|
1185
1196
|
|
|
1186
1197
|
/**
|
|
@@ -1360,7 +1371,8 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1360
1371
|
}, [theme$1.palette, filteredProps]),
|
|
1361
1372
|
bg = _useMemo.bg,
|
|
1362
1373
|
border = _useMemo.border,
|
|
1363
|
-
color = _useMemo.color
|
|
1374
|
+
color = _useMemo.color,
|
|
1375
|
+
rippleColor = _useMemo.ripple;
|
|
1364
1376
|
var hover = React.useMemo(function () {
|
|
1365
1377
|
return getButtonHoverColors(theme$1.palette, filteredProps);
|
|
1366
1378
|
}, [theme$1.palette, filteredProps]);
|
|
@@ -1379,6 +1391,45 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1379
1391
|
setDripX(0);
|
|
1380
1392
|
setDripY(0);
|
|
1381
1393
|
};
|
|
1394
|
+
var createRipple = function createRipple(event) {
|
|
1395
|
+
var button = buttonRef.current;
|
|
1396
|
+
if (!button) return;
|
|
1397
|
+
var rect = button.getBoundingClientRect();
|
|
1398
|
+
var size = Math.max(rect.width, rect.height);
|
|
1399
|
+
var x = event.clientX - rect.left - size / 2;
|
|
1400
|
+
var y = event.clientY - rect.top - size / 2;
|
|
1401
|
+
var rippleCount = 1; // number of rings
|
|
1402
|
+
var rippleDelay = 500; // ms between each ripple
|
|
1403
|
+
var _loop = function _loop() {
|
|
1404
|
+
var ripple = document.createElement('span');
|
|
1405
|
+
Object.assign(ripple.style, {
|
|
1406
|
+
position: 'absolute',
|
|
1407
|
+
borderRadius: '50%',
|
|
1408
|
+
backgroundColor: rippleColor,
|
|
1409
|
+
width: "".concat(size, "px"),
|
|
1410
|
+
height: "".concat(size, "px"),
|
|
1411
|
+
left: "".concat(x, "px"),
|
|
1412
|
+
top: "".concat(y, "px"),
|
|
1413
|
+
pointerEvents: 'none',
|
|
1414
|
+
transform: 'scale(0)',
|
|
1415
|
+
opacity: '1',
|
|
1416
|
+
transition: "transform 600ms ease-out ".concat(i * rippleDelay, "ms, opacity 600ms ease-out ").concat(i * rippleDelay, "ms"),
|
|
1417
|
+
zIndex: 1
|
|
1418
|
+
});
|
|
1419
|
+
button.appendChild(ripple);
|
|
1420
|
+
|
|
1421
|
+
// Force reflow to start transition
|
|
1422
|
+
window.getComputedStyle(ripple).opacity;
|
|
1423
|
+
ripple.style.transform = 'scale(2.5)';
|
|
1424
|
+
ripple.style.opacity = '0';
|
|
1425
|
+
ripple.addEventListener('transitionend', function () {
|
|
1426
|
+
ripple.remove();
|
|
1427
|
+
});
|
|
1428
|
+
};
|
|
1429
|
+
for (var i = 0; i < rippleCount; i++) {
|
|
1430
|
+
_loop();
|
|
1431
|
+
}
|
|
1432
|
+
};
|
|
1382
1433
|
var clickHandler = function clickHandler(event) {
|
|
1383
1434
|
if (disabled || loading) return;
|
|
1384
1435
|
var showDrip = !shadow && !ghost && effect;
|
|
@@ -1389,6 +1440,9 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1389
1440
|
setDripX(event.clientX - rect.left);
|
|
1390
1441
|
setDripY(event.clientY - rect.top);
|
|
1391
1442
|
}
|
|
1443
|
+
if (shadow) {
|
|
1444
|
+
createRipple(event);
|
|
1445
|
+
}
|
|
1392
1446
|
onClick && onClick(event);
|
|
1393
1447
|
};
|
|
1394
1448
|
var childrenWithIcon = React.useMemo(function () {
|
|
@@ -1399,13 +1453,16 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1399
1453
|
}, [auto, children, icon, iconRight]);
|
|
1400
1454
|
var paddingLeft = auto ? SCALES.pl(1.15) : SCALES.pl(1.375),
|
|
1401
1455
|
paddingRight = auto ? SCALES.pr(1.15) : SCALES.pr(1.375);
|
|
1456
|
+
|
|
1457
|
+
// If shadow provided is string then value other default
|
|
1458
|
+
var btnShadow = typeof shadow === 'string' ? shadow : shadow ? theme$1.shadows.level.z2 : 'none';
|
|
1402
1459
|
return /*#__PURE__*/React.createElement("button", _extends({
|
|
1403
1460
|
ref: buttonRef,
|
|
1404
1461
|
type: type,
|
|
1405
1462
|
disabled: disabled,
|
|
1406
1463
|
onClick: clickHandler
|
|
1407
1464
|
}, props, {
|
|
1408
|
-
className: _JSXStyle.dynamic([["
|
|
1465
|
+
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) || "")
|
|
1409
1466
|
}), loading && /*#__PURE__*/React.createElement(ButtonLoading, {
|
|
1410
1467
|
color: color
|
|
1411
1468
|
}), childrenWithIcon, dripShow && /*#__PURE__*/React.createElement(ButtonDrip, {
|
|
@@ -1414,9 +1471,9 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1414
1471
|
color: dripColor,
|
|
1415
1472
|
onCompleted: dripCompletedHandle
|
|
1416
1473
|
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1417
|
-
id: "
|
|
1418
|
-
dynamic: [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, border, cursor, events, shadow ?
|
|
1419
|
-
}, ".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(border, ";cursor:").concat(cursor, ";pointer-events:").concat(events, ";box-shadow:").concat(shadow ?
|
|
1474
|
+
id: "905110486",
|
|
1475
|
+
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
|
+
}, ".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;}}")));
|
|
1420
1477
|
});
|
|
1421
1478
|
ButtonComponent.displayName = 'Button';
|
|
1422
1479
|
var Button = withScale(ButtonComponent);
|
package/dist/button/styles.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export interface ButtonColorGroup {
|
|
|
5
5
|
bg: string;
|
|
6
6
|
border: string;
|
|
7
7
|
color: string;
|
|
8
|
+
ripple?: string;
|
|
8
9
|
}
|
|
9
10
|
export declare const getButtonGhostColors: (palette: HUIThemesPalette, _color: ButtonTypes) => ButtonColorGroup | null;
|
|
10
11
|
export declare const getButtonColors: (palette: HUIThemesPalette, props: ButtonProps) => ButtonColorGroup;
|
package/dist/carousal/index.js
CHANGED
|
@@ -2532,22 +2532,26 @@ var getButtonGhostColors = function getButtonGhostColors(palette, _color) {
|
|
|
2532
2532
|
secondary: {
|
|
2533
2533
|
bg: palette.background,
|
|
2534
2534
|
border: palette.foreground,
|
|
2535
|
-
color: palette.foreground
|
|
2535
|
+
color: palette.foreground,
|
|
2536
|
+
ripple: ''
|
|
2536
2537
|
},
|
|
2537
2538
|
success: {
|
|
2538
2539
|
bg: palette.background,
|
|
2539
2540
|
border: palette.success,
|
|
2540
|
-
color: palette.success
|
|
2541
|
+
color: palette.success,
|
|
2542
|
+
ripple: ''
|
|
2541
2543
|
},
|
|
2542
2544
|
warning: {
|
|
2543
2545
|
bg: palette.background,
|
|
2544
2546
|
border: palette.warning,
|
|
2545
|
-
color: palette.warning
|
|
2547
|
+
color: palette.warning,
|
|
2548
|
+
ripple: ''
|
|
2546
2549
|
},
|
|
2547
2550
|
error: {
|
|
2548
2551
|
bg: palette.background,
|
|
2549
2552
|
border: palette.error,
|
|
2550
|
-
color: palette.error
|
|
2553
|
+
color: palette.error,
|
|
2554
|
+
ripple: ''
|
|
2551
2555
|
}
|
|
2552
2556
|
};
|
|
2553
2557
|
return colors[_color] || null;
|
|
@@ -2560,38 +2564,45 @@ var getButtonColors = function getButtonColors(palette, props) {
|
|
|
2560
2564
|
"default": {
|
|
2561
2565
|
bg: palette.background,
|
|
2562
2566
|
border: palette.border,
|
|
2563
|
-
color: palette.accents_5
|
|
2567
|
+
color: palette.accents_5,
|
|
2568
|
+
ripple: palette.accents_1
|
|
2564
2569
|
},
|
|
2565
2570
|
secondary: {
|
|
2566
2571
|
bg: palette.foreground,
|
|
2567
2572
|
border: palette.foreground,
|
|
2568
|
-
color: palette.background
|
|
2573
|
+
color: palette.background,
|
|
2574
|
+
ripple: palette.accents_1
|
|
2569
2575
|
},
|
|
2570
2576
|
success: {
|
|
2571
2577
|
bg: palette.success,
|
|
2572
2578
|
border: palette.success,
|
|
2573
|
-
color: '#fff'
|
|
2579
|
+
color: '#fff',
|
|
2580
|
+
ripple: '#1f93ffff'
|
|
2574
2581
|
},
|
|
2575
2582
|
warning: {
|
|
2576
2583
|
bg: palette.warning,
|
|
2577
2584
|
border: palette.warning,
|
|
2578
|
-
color: '#fff'
|
|
2585
|
+
color: '#fff',
|
|
2586
|
+
ripple: '#ffca29ff'
|
|
2579
2587
|
},
|
|
2580
2588
|
error: {
|
|
2581
2589
|
bg: palette.error,
|
|
2582
2590
|
border: palette.error,
|
|
2583
|
-
color: '#fff'
|
|
2591
|
+
color: '#fff',
|
|
2592
|
+
ripple: '#ff5a55ff'
|
|
2584
2593
|
},
|
|
2585
2594
|
abort: {
|
|
2586
2595
|
bg: 'transparent',
|
|
2587
2596
|
border: 'transparent',
|
|
2588
|
-
color: palette.accents_5
|
|
2597
|
+
color: palette.accents_5,
|
|
2598
|
+
ripple: palette.accents_1
|
|
2589
2599
|
}
|
|
2590
2600
|
};
|
|
2591
2601
|
if (disabled) return {
|
|
2592
2602
|
bg: palette.accents_1,
|
|
2593
2603
|
border: palette.accents_2,
|
|
2594
|
-
color: '#ccc'
|
|
2604
|
+
color: '#ccc',
|
|
2605
|
+
ripple: ''
|
|
2595
2606
|
};
|
|
2596
2607
|
|
|
2597
2608
|
/**
|
|
@@ -2771,7 +2782,8 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
2771
2782
|
}, [theme$1.palette, filteredProps]),
|
|
2772
2783
|
bg = _useMemo.bg,
|
|
2773
2784
|
border = _useMemo.border,
|
|
2774
|
-
color = _useMemo.color
|
|
2785
|
+
color = _useMemo.color,
|
|
2786
|
+
rippleColor = _useMemo.ripple;
|
|
2775
2787
|
var hover = React.useMemo(function () {
|
|
2776
2788
|
return getButtonHoverColors(theme$1.palette, filteredProps);
|
|
2777
2789
|
}, [theme$1.palette, filteredProps]);
|
|
@@ -2790,6 +2802,45 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
2790
2802
|
setDripX(0);
|
|
2791
2803
|
setDripY(0);
|
|
2792
2804
|
};
|
|
2805
|
+
var createRipple = function createRipple(event) {
|
|
2806
|
+
var button = buttonRef.current;
|
|
2807
|
+
if (!button) return;
|
|
2808
|
+
var rect = button.getBoundingClientRect();
|
|
2809
|
+
var size = Math.max(rect.width, rect.height);
|
|
2810
|
+
var x = event.clientX - rect.left - size / 2;
|
|
2811
|
+
var y = event.clientY - rect.top - size / 2;
|
|
2812
|
+
var rippleCount = 1; // number of rings
|
|
2813
|
+
var rippleDelay = 500; // ms between each ripple
|
|
2814
|
+
var _loop = function _loop() {
|
|
2815
|
+
var ripple = document.createElement('span');
|
|
2816
|
+
Object.assign(ripple.style, {
|
|
2817
|
+
position: 'absolute',
|
|
2818
|
+
borderRadius: '50%',
|
|
2819
|
+
backgroundColor: rippleColor,
|
|
2820
|
+
width: "".concat(size, "px"),
|
|
2821
|
+
height: "".concat(size, "px"),
|
|
2822
|
+
left: "".concat(x, "px"),
|
|
2823
|
+
top: "".concat(y, "px"),
|
|
2824
|
+
pointerEvents: 'none',
|
|
2825
|
+
transform: 'scale(0)',
|
|
2826
|
+
opacity: '1',
|
|
2827
|
+
transition: "transform 600ms ease-out ".concat(i * rippleDelay, "ms, opacity 600ms ease-out ").concat(i * rippleDelay, "ms"),
|
|
2828
|
+
zIndex: 1
|
|
2829
|
+
});
|
|
2830
|
+
button.appendChild(ripple);
|
|
2831
|
+
|
|
2832
|
+
// Force reflow to start transition
|
|
2833
|
+
window.getComputedStyle(ripple).opacity;
|
|
2834
|
+
ripple.style.transform = 'scale(2.5)';
|
|
2835
|
+
ripple.style.opacity = '0';
|
|
2836
|
+
ripple.addEventListener('transitionend', function () {
|
|
2837
|
+
ripple.remove();
|
|
2838
|
+
});
|
|
2839
|
+
};
|
|
2840
|
+
for (var i = 0; i < rippleCount; i++) {
|
|
2841
|
+
_loop();
|
|
2842
|
+
}
|
|
2843
|
+
};
|
|
2793
2844
|
var clickHandler = function clickHandler(event) {
|
|
2794
2845
|
if (disabled || loading) return;
|
|
2795
2846
|
var showDrip = !shadow && !ghost && effect;
|
|
@@ -2800,6 +2851,9 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
2800
2851
|
setDripX(event.clientX - rect.left);
|
|
2801
2852
|
setDripY(event.clientY - rect.top);
|
|
2802
2853
|
}
|
|
2854
|
+
if (shadow) {
|
|
2855
|
+
createRipple(event);
|
|
2856
|
+
}
|
|
2803
2857
|
onClick && onClick(event);
|
|
2804
2858
|
};
|
|
2805
2859
|
var childrenWithIcon = React.useMemo(function () {
|
|
@@ -2810,13 +2864,16 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
2810
2864
|
}, [auto, children, icon, iconRight]);
|
|
2811
2865
|
var paddingLeft = auto ? SCALES.pl(1.15) : SCALES.pl(1.375),
|
|
2812
2866
|
paddingRight = auto ? SCALES.pr(1.15) : SCALES.pr(1.375);
|
|
2867
|
+
|
|
2868
|
+
// If shadow provided is string then value other default
|
|
2869
|
+
var btnShadow = typeof shadow === 'string' ? shadow : shadow ? theme$1.shadows.level.z2 : 'none';
|
|
2813
2870
|
return /*#__PURE__*/React.createElement("button", _extends({
|
|
2814
2871
|
ref: buttonRef,
|
|
2815
2872
|
type: type,
|
|
2816
2873
|
disabled: disabled,
|
|
2817
2874
|
onClick: clickHandler
|
|
2818
2875
|
}, props, {
|
|
2819
|
-
className: _JSXStyle.dynamic([["
|
|
2876
|
+
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) || "")
|
|
2820
2877
|
}), loading && /*#__PURE__*/React.createElement(ButtonLoading, {
|
|
2821
2878
|
color: color
|
|
2822
2879
|
}), childrenWithIcon, dripShow && /*#__PURE__*/React.createElement(ButtonDrip, {
|
|
@@ -2825,9 +2882,9 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
2825
2882
|
color: dripColor,
|
|
2826
2883
|
onCompleted: dripCompletedHandle
|
|
2827
2884
|
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
2828
|
-
id: "
|
|
2829
|
-
dynamic: [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, border, cursor, events, shadow ?
|
|
2830
|
-
}, ".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(border, ";cursor:").concat(cursor, ";pointer-events:").concat(events, ";box-shadow:").concat(shadow ?
|
|
2885
|
+
id: "905110486",
|
|
2886
|
+
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']
|
|
2887
|
+
}, ".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;}}")));
|
|
2831
2888
|
});
|
|
2832
2889
|
ButtonComponent.displayName = 'Button';
|
|
2833
2890
|
var Button = withScale(ButtonComponent);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare const wrap: ["nowrap", "wrap", "wrap-reverse"];
|
|
2
|
+
export type Wrap = typeof wrap[number];
|
|
3
|
+
type ContainerProps = {
|
|
4
|
+
gap?: number;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
wrap?: Wrap;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import("react").ForwardRefExoticComponent<ContainerProps & {
|
|
10
|
+
width?: string | number;
|
|
11
|
+
height?: string | number;
|
|
12
|
+
padding?: string | number;
|
|
13
|
+
margin?: string | number;
|
|
14
|
+
w?: string | number;
|
|
15
|
+
h?: string | number;
|
|
16
|
+
paddingLeft?: string | number;
|
|
17
|
+
paddingRight?: string | number;
|
|
18
|
+
paddingTop?: string | number;
|
|
19
|
+
paddingBottom?: string | number;
|
|
20
|
+
pl?: string | number;
|
|
21
|
+
pr?: string | number;
|
|
22
|
+
pt?: string | number;
|
|
23
|
+
pb?: string | number;
|
|
24
|
+
marginLeft?: string | number;
|
|
25
|
+
marginRight?: string | number;
|
|
26
|
+
marginTop?: string | number;
|
|
27
|
+
marginBottom?: string | number;
|
|
28
|
+
ml?: string | number;
|
|
29
|
+
mr?: string | number;
|
|
30
|
+
mt?: string | number;
|
|
31
|
+
mb?: string | number;
|
|
32
|
+
px?: string | number;
|
|
33
|
+
py?: string | number;
|
|
34
|
+
mx?: string | number;
|
|
35
|
+
my?: string | number;
|
|
36
|
+
font?: string | number;
|
|
37
|
+
unit?: string;
|
|
38
|
+
scale?: number;
|
|
39
|
+
children?: any;
|
|
40
|
+
className?: string;
|
|
41
|
+
} & import("react").InputHTMLAttributes<any> & import("react").RefAttributes<unknown>>;
|
|
42
|
+
export default _default;
|