@helpdice/ui 2.1.5 → 2.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auto-complete/index.js +12 -10
- 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/copy-to-clipboard/clipboard.d.ts +2 -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 +1717 -0
- package/dist/copy-to-clipboard/toggle-selection.d.ts +1 -0
- package/dist/html-renderer/index.js +35 -12
- package/dist/index.d.ts +3 -2
- package/dist/index.js +539 -220
- package/dist/input/index.js +12 -10
- package/dist/input/input-props.d.ts +1 -0
- package/dist/modal/index.js +73 -16
- package/dist/notetip/index.js +690 -0
- package/dist/notetip/{index.d.ts → note-tip.d.ts} +2 -2
- package/dist/table/index.js +990 -930
- 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/copy-to-clipboard/clipboard.d.ts +2 -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/index.d.ts +3 -2
- package/esm/index.js +3 -2
- package/esm/input/input-field.js +12 -10
- package/esm/input/input-props.d.ts +1 -0
- package/esm/notetip/index.js +2 -97
- package/esm/notetip/{index.d.ts → 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/package.json +14 -7
package/dist/input/index.js
CHANGED
|
@@ -1009,7 +1009,7 @@ var withScale = function withScale(Render) {
|
|
|
1009
1009
|
return ScaleFC;
|
|
1010
1010
|
};
|
|
1011
1011
|
|
|
1012
|
-
var _excluded$2 = ["label", "labelRight", "color", "error", "type", "icon", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled", "fullWidth"];
|
|
1012
|
+
var _excluded$2 = ["label", "labelRight", "color", "error", "type", "icon", "variant", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled", "fullWidth"];
|
|
1013
1013
|
var simulateChangeEvent = function simulateChangeEvent(el, event) {
|
|
1014
1014
|
return _objectSpread2(_objectSpread2({}, event), {}, {
|
|
1015
1015
|
target: el,
|
|
@@ -1025,6 +1025,8 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1025
1025
|
_ref$type = _ref.type,
|
|
1026
1026
|
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
1027
1027
|
icon = _ref.icon,
|
|
1028
|
+
_ref$variant = _ref.variant,
|
|
1029
|
+
variant = _ref$variant === void 0 ? 'normal' : _ref$variant,
|
|
1028
1030
|
iconRight = _ref.iconRight,
|
|
1029
1031
|
_ref$iconClickable = _ref.iconClickable,
|
|
1030
1032
|
iconClickable = _ref$iconClickable === void 0 ? false : _ref$iconClickable,
|
|
@@ -1129,11 +1131,11 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1129
1131
|
var inputProps = _objectSpread2(_objectSpread2({}, props), controlledValue);
|
|
1130
1132
|
var defaultWidth = fullWidth ? '100%' : 'initial';
|
|
1131
1133
|
return /*#__PURE__*/React.createElement("div", {
|
|
1132
|
-
className: _JSXStyle.dynamic([["
|
|
1134
|
+
className: _JSXStyle.dynamic([["3970712841", [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]]]) + " " + "with-label"
|
|
1133
1135
|
}, children && /*#__PURE__*/React.createElement(InputBlockLabel, null, children), /*#__PURE__*/React.createElement("div", {
|
|
1134
|
-
className: _JSXStyle.dynamic([["
|
|
1136
|
+
className: _JSXStyle.dynamic([["3970712841", [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]]]) + " " + (theme.useClasses('input-container', className) || "")
|
|
1135
1137
|
}, label && /*#__PURE__*/React.createElement(MemoInputLabel, null, label), /*#__PURE__*/React.createElement("div", {
|
|
1136
|
-
className: _JSXStyle.dynamic([["
|
|
1138
|
+
className: _JSXStyle.dynamic([["3970712841", [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]]]) + " " + (theme.useClasses('input-wrapper', {
|
|
1137
1139
|
hover: hover,
|
|
1138
1140
|
disabled: disabled
|
|
1139
1141
|
}, labelClasses) || "")
|
|
@@ -1150,7 +1152,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1150
1152
|
onChange: changeHandler,
|
|
1151
1153
|
autoComplete: autoComplete
|
|
1152
1154
|
}, inputProps, {
|
|
1153
|
-
className: _JSXStyle.dynamic([["
|
|
1155
|
+
className: _JSXStyle.dynamic([["3970712841", [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({
|
|
1154
1156
|
disabled: disabled
|
|
1155
1157
|
}, iconClasses) || "")
|
|
1156
1158
|
})), clearable && /*#__PURE__*/React.createElement(MemoInputIconClear, {
|
|
@@ -1162,7 +1164,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1162
1164
|
}, iconProps))), labelRight && /*#__PURE__*/React.createElement(MemoInputLabel, {
|
|
1163
1165
|
isRight: true
|
|
1164
1166
|
}, labelRight), /*#__PURE__*/React.createElement("br", {
|
|
1165
|
-
className: _JSXStyle.dynamic([["
|
|
1167
|
+
className: _JSXStyle.dynamic([["3970712841", [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]]])
|
|
1166
1168
|
})), error && /*#__PURE__*/React.createElement("p", {
|
|
1167
1169
|
style: {
|
|
1168
1170
|
marginTop: 0.4,
|
|
@@ -1171,11 +1173,11 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1171
1173
|
marginBottom: '0.4rem',
|
|
1172
1174
|
textAlign: 'left'
|
|
1173
1175
|
},
|
|
1174
|
-
className: _JSXStyle.dynamic([["
|
|
1176
|
+
className: _JSXStyle.dynamic([["3970712841", [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]]]) + " " + "input-error"
|
|
1175
1177
|
}, error), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1176
|
-
id: "
|
|
1177
|
-
dynamic: [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), theme$1.layout.radius, 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]
|
|
1178
|
-
}, ".with-label.__jsx-style-dynamic-selector{display:inline-block;box-sizing:border-box;-webkit-box-align:center;--input-height:".concat(SCALES.height(2.25), ";font-size:").concat(SCALES.font(0.875), ";width:").concat(SCALES.width(1, defaultWidth), ";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), ";}.input-error.__jsx-style-dynamic-selector{color:#aa4a44;}.input-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;width:").concat(SCALES.width(1, defaultWidth), ";height:var(--input-height);}.input-wrapper.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;-webkit-flex:1;-ms-flex:1;flex:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:").concat(theme$1.layout.radius, ";border:1px solid ").concat(borderColor, ";-webkit-transition:border 0.2s ease 0s,color 0.2s ease 0s;transition:border 0.2s ease 0s,color 0.2s ease 0s;}.input-wrapper.left-label.__jsx-style-dynamic-selector{border-top-left-radius:0;border-bottom-left-radius:0;}.input-wrapper.right-label.__jsx-style-dynamic-selector{border-top-right-radius:0;border-bottom-right-radius:0;}.input-wrapper.disabled.__jsx-style-dynamic-selector{background-color:").concat(theme$1.palette.accents_1, ";border-color:").concat(theme$1.palette.accents_2, ";cursor:not-allowed;}input.disabled.__jsx-style-dynamic-selector{cursor:not-allowed;}.input-wrapper.hover.__jsx-style-dynamic-selector{border-color:").concat(hoverBorder, ";}input.__jsx-style-dynamic-selector{margin:0.25em 0.625em;padding:0;box-shadow:none;font-size:").concat(SCALES.font(0.875), ";background-color:transparent;border:none;color:").concat(color, ";outline:none;border-radius:0;width:100%;min-width:0;-webkit-appearance:none;}input.left-icon.__jsx-style-dynamic-selector{margin-left:0;}input.right-icon.__jsx-style-dynamic-selector{margin-right:0;}.__jsx-style-dynamic-selector::-webkit-input-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme$1.palette.accents_3, ";}.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme$1.palette.accents_3, ";}.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme$1.palette.accents_3, ";}.__jsx-style-dynamic-selector::placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme$1.palette.accents_3, ";}.__jsx-style-dynamic-selector::-ms-reveal{display:none !important;}input.__jsx-style-dynamic-selector:-webkit-autofill,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:hover,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:active,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:focus{-webkit-box-shadow:0 0 0 30px ").concat(theme$1.palette.background, " inset !important;-webkit-text-fill-color:").concat(color, " !important;}")));
|
|
1178
|
+
id: "3970712841",
|
|
1179
|
+
dynamic: [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]
|
|
1180
|
+
}, ".with-label.__jsx-style-dynamic-selector{display:inline-block;box-sizing:border-box;-webkit-box-align:center;--input-height:".concat(SCALES.height(2.25), ";font-size:").concat(SCALES.font(0.875), ";width:").concat(SCALES.width(1, defaultWidth), ";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), ";}.input-error.__jsx-style-dynamic-selector{color:#aa4a44;}.input-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;width:").concat(SCALES.width(1, defaultWidth), ";height:var(--input-height);}.input-wrapper.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;-webkit-flex:1;-ms-flex:1;flex:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-radius:").concat(variant === 'normal' ? theme$1.layout.radius : '', ";").concat(variant === 'none' ? '' : variant === 'line' ? "border-bottom: 1px solid ".concat(borderColor) : "border: 1px solid ".concat(borderColor), ";-webkit-transition:border 0.2s ease 0s,color 0.2s ease 0s;transition:border 0.2s ease 0s,color 0.2s ease 0s;}.input-wrapper.left-label.__jsx-style-dynamic-selector{border-top-left-radius:0;border-bottom-left-radius:0;}.input-wrapper.right-label.__jsx-style-dynamic-selector{border-top-right-radius:0;border-bottom-right-radius:0;}.input-wrapper.disabled.__jsx-style-dynamic-selector{background-color:").concat(theme$1.palette.accents_1, ";border-color:").concat(theme$1.palette.accents_2, ";cursor:not-allowed;}input.disabled.__jsx-style-dynamic-selector{cursor:not-allowed;}.input-wrapper.hover.__jsx-style-dynamic-selector{border-color:").concat(hoverBorder, ";}input.__jsx-style-dynamic-selector{margin:0.25em 0.625em;padding:0;box-shadow:none;font-size:").concat(SCALES.font(0.875), ";background-color:transparent;border:none;color:").concat(color, ";outline:none;border-radius:0;width:100%;min-width:0;-webkit-appearance:none;}input.left-icon.__jsx-style-dynamic-selector{margin-left:0;}input.right-icon.__jsx-style-dynamic-selector{margin-right:0;}.__jsx-style-dynamic-selector::-webkit-input-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme$1.palette.accents_3, ";}.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme$1.palette.accents_3, ";}.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme$1.palette.accents_3, ";}.__jsx-style-dynamic-selector::placeholder,.__jsx-style-dynamic-selector::-moz-placeholder,.__jsx-style-dynamic-selector:-ms-input-placeholder,.__jsx-style-dynamic-selector::-webkit-input-placeholder{color:").concat(theme$1.palette.accents_3, ";}.__jsx-style-dynamic-selector::-ms-reveal{display:none !important;}input.__jsx-style-dynamic-selector:-webkit-autofill,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:hover,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:active,input.__jsx-style-dynamic-selector:-webkit-autofill.__jsx-style-dynamic-selector:focus{-webkit-box-shadow:0 0 0 30px ").concat(theme$1.palette.background, " inset !important;-webkit-text-fill-color:").concat(color, " !important;}")));
|
|
1179
1181
|
});
|
|
1180
1182
|
InputComponent.displayName = 'Input';
|
|
1181
1183
|
var Input = withScale(InputComponent);
|
package/dist/modal/index.js
CHANGED
|
@@ -1267,22 +1267,26 @@ var getButtonGhostColors = function getButtonGhostColors(palette, _color) {
|
|
|
1267
1267
|
secondary: {
|
|
1268
1268
|
bg: palette.background,
|
|
1269
1269
|
border: palette.foreground,
|
|
1270
|
-
color: palette.foreground
|
|
1270
|
+
color: palette.foreground,
|
|
1271
|
+
ripple: ''
|
|
1271
1272
|
},
|
|
1272
1273
|
success: {
|
|
1273
1274
|
bg: palette.background,
|
|
1274
1275
|
border: palette.success,
|
|
1275
|
-
color: palette.success
|
|
1276
|
+
color: palette.success,
|
|
1277
|
+
ripple: ''
|
|
1276
1278
|
},
|
|
1277
1279
|
warning: {
|
|
1278
1280
|
bg: palette.background,
|
|
1279
1281
|
border: palette.warning,
|
|
1280
|
-
color: palette.warning
|
|
1282
|
+
color: palette.warning,
|
|
1283
|
+
ripple: ''
|
|
1281
1284
|
},
|
|
1282
1285
|
error: {
|
|
1283
1286
|
bg: palette.background,
|
|
1284
1287
|
border: palette.error,
|
|
1285
|
-
color: palette.error
|
|
1288
|
+
color: palette.error,
|
|
1289
|
+
ripple: ''
|
|
1286
1290
|
}
|
|
1287
1291
|
};
|
|
1288
1292
|
return colors[_color] || null;
|
|
@@ -1295,38 +1299,45 @@ var getButtonColors = function getButtonColors(palette, props) {
|
|
|
1295
1299
|
"default": {
|
|
1296
1300
|
bg: palette.background,
|
|
1297
1301
|
border: palette.border,
|
|
1298
|
-
color: palette.accents_5
|
|
1302
|
+
color: palette.accents_5,
|
|
1303
|
+
ripple: palette.accents_1
|
|
1299
1304
|
},
|
|
1300
1305
|
secondary: {
|
|
1301
1306
|
bg: palette.foreground,
|
|
1302
1307
|
border: palette.foreground,
|
|
1303
|
-
color: palette.background
|
|
1308
|
+
color: palette.background,
|
|
1309
|
+
ripple: palette.accents_1
|
|
1304
1310
|
},
|
|
1305
1311
|
success: {
|
|
1306
1312
|
bg: palette.success,
|
|
1307
1313
|
border: palette.success,
|
|
1308
|
-
color: '#fff'
|
|
1314
|
+
color: '#fff',
|
|
1315
|
+
ripple: '#1f93ffff'
|
|
1309
1316
|
},
|
|
1310
1317
|
warning: {
|
|
1311
1318
|
bg: palette.warning,
|
|
1312
1319
|
border: palette.warning,
|
|
1313
|
-
color: '#fff'
|
|
1320
|
+
color: '#fff',
|
|
1321
|
+
ripple: '#ffca29ff'
|
|
1314
1322
|
},
|
|
1315
1323
|
error: {
|
|
1316
1324
|
bg: palette.error,
|
|
1317
1325
|
border: palette.error,
|
|
1318
|
-
color: '#fff'
|
|
1326
|
+
color: '#fff',
|
|
1327
|
+
ripple: '#ff5a55ff'
|
|
1319
1328
|
},
|
|
1320
1329
|
abort: {
|
|
1321
1330
|
bg: 'transparent',
|
|
1322
1331
|
border: 'transparent',
|
|
1323
|
-
color: palette.accents_5
|
|
1332
|
+
color: palette.accents_5,
|
|
1333
|
+
ripple: palette.accents_1
|
|
1324
1334
|
}
|
|
1325
1335
|
};
|
|
1326
1336
|
if (disabled) return {
|
|
1327
1337
|
bg: palette.accents_1,
|
|
1328
1338
|
border: palette.accents_2,
|
|
1329
|
-
color: '#ccc'
|
|
1339
|
+
color: '#ccc',
|
|
1340
|
+
ripple: ''
|
|
1330
1341
|
};
|
|
1331
1342
|
|
|
1332
1343
|
/**
|
|
@@ -1506,7 +1517,8 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1506
1517
|
}, [theme$1.palette, filteredProps]),
|
|
1507
1518
|
bg = _useMemo.bg,
|
|
1508
1519
|
border = _useMemo.border,
|
|
1509
|
-
color = _useMemo.color
|
|
1520
|
+
color = _useMemo.color,
|
|
1521
|
+
rippleColor = _useMemo.ripple;
|
|
1510
1522
|
var hover = React.useMemo(function () {
|
|
1511
1523
|
return getButtonHoverColors(theme$1.palette, filteredProps);
|
|
1512
1524
|
}, [theme$1.palette, filteredProps]);
|
|
@@ -1525,6 +1537,45 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1525
1537
|
setDripX(0);
|
|
1526
1538
|
setDripY(0);
|
|
1527
1539
|
};
|
|
1540
|
+
var createRipple = function createRipple(event) {
|
|
1541
|
+
var button = buttonRef.current;
|
|
1542
|
+
if (!button) return;
|
|
1543
|
+
var rect = button.getBoundingClientRect();
|
|
1544
|
+
var size = Math.max(rect.width, rect.height);
|
|
1545
|
+
var x = event.clientX - rect.left - size / 2;
|
|
1546
|
+
var y = event.clientY - rect.top - size / 2;
|
|
1547
|
+
var rippleCount = 1; // number of rings
|
|
1548
|
+
var rippleDelay = 500; // ms between each ripple
|
|
1549
|
+
var _loop = function _loop() {
|
|
1550
|
+
var ripple = document.createElement('span');
|
|
1551
|
+
Object.assign(ripple.style, {
|
|
1552
|
+
position: 'absolute',
|
|
1553
|
+
borderRadius: '50%',
|
|
1554
|
+
backgroundColor: rippleColor,
|
|
1555
|
+
width: "".concat(size, "px"),
|
|
1556
|
+
height: "".concat(size, "px"),
|
|
1557
|
+
left: "".concat(x, "px"),
|
|
1558
|
+
top: "".concat(y, "px"),
|
|
1559
|
+
pointerEvents: 'none',
|
|
1560
|
+
transform: 'scale(0)',
|
|
1561
|
+
opacity: '1',
|
|
1562
|
+
transition: "transform 600ms ease-out ".concat(i * rippleDelay, "ms, opacity 600ms ease-out ").concat(i * rippleDelay, "ms"),
|
|
1563
|
+
zIndex: 1
|
|
1564
|
+
});
|
|
1565
|
+
button.appendChild(ripple);
|
|
1566
|
+
|
|
1567
|
+
// Force reflow to start transition
|
|
1568
|
+
window.getComputedStyle(ripple).opacity;
|
|
1569
|
+
ripple.style.transform = 'scale(2.5)';
|
|
1570
|
+
ripple.style.opacity = '0';
|
|
1571
|
+
ripple.addEventListener('transitionend', function () {
|
|
1572
|
+
ripple.remove();
|
|
1573
|
+
});
|
|
1574
|
+
};
|
|
1575
|
+
for (var i = 0; i < rippleCount; i++) {
|
|
1576
|
+
_loop();
|
|
1577
|
+
}
|
|
1578
|
+
};
|
|
1528
1579
|
var clickHandler = function clickHandler(event) {
|
|
1529
1580
|
if (disabled || loading) return;
|
|
1530
1581
|
var showDrip = !shadow && !ghost && effect;
|
|
@@ -1535,6 +1586,9 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1535
1586
|
setDripX(event.clientX - rect.left);
|
|
1536
1587
|
setDripY(event.clientY - rect.top);
|
|
1537
1588
|
}
|
|
1589
|
+
if (shadow) {
|
|
1590
|
+
createRipple(event);
|
|
1591
|
+
}
|
|
1538
1592
|
onClick && onClick(event);
|
|
1539
1593
|
};
|
|
1540
1594
|
var childrenWithIcon = React.useMemo(function () {
|
|
@@ -1545,13 +1599,16 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1545
1599
|
}, [auto, children, icon, iconRight]);
|
|
1546
1600
|
var paddingLeft = auto ? SCALES.pl(1.15) : SCALES.pl(1.375),
|
|
1547
1601
|
paddingRight = auto ? SCALES.pr(1.15) : SCALES.pr(1.375);
|
|
1602
|
+
|
|
1603
|
+
// If shadow provided is string then value other default
|
|
1604
|
+
var btnShadow = typeof shadow === 'string' ? shadow : shadow ? theme$1.shadows.level.z2 : 'none';
|
|
1548
1605
|
return /*#__PURE__*/React.createElement("button", _extends({
|
|
1549
1606
|
ref: buttonRef,
|
|
1550
1607
|
type: type,
|
|
1551
1608
|
disabled: disabled,
|
|
1552
1609
|
onClick: clickHandler
|
|
1553
1610
|
}, props, {
|
|
1554
|
-
className: _JSXStyle.dynamic([["
|
|
1611
|
+
className: _JSXStyle.dynamic([["960361315", [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) || "")
|
|
1555
1612
|
}), loading && /*#__PURE__*/React.createElement(ButtonLoading, {
|
|
1556
1613
|
color: color
|
|
1557
1614
|
}), childrenWithIcon, dripShow && /*#__PURE__*/React.createElement(ButtonDrip, {
|
|
@@ -1560,9 +1617,9 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
|
1560
1617
|
color: dripColor,
|
|
1561
1618
|
onCompleted: dripCompletedHandle
|
|
1562
1619
|
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
1563
|
-
id: "
|
|
1564
|
-
dynamic: [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, border, cursor, events, shadow ?
|
|
1565
|
-
}, ".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 ?
|
|
1620
|
+
id: "960361315",
|
|
1621
|
+
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']
|
|
1622
|
+
}, ".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;}}")));
|
|
1566
1623
|
});
|
|
1567
1624
|
ButtonComponent.displayName = 'Button';
|
|
1568
1625
|
var Button = withScale(ButtonComponent);
|