@hexure/ui 1.6.3 → 1.6.4
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/cjs/index.js +9 -18
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/ActionDialog/ActionDialog.d.ts +4 -1
- package/dist/cjs/types/components/Button/Button.d.ts +2 -0
- package/dist/esm/index.js +11 -20
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/ActionDialog/ActionDialog.d.ts +4 -1
- package/dist/esm/types/components/Button/Button.d.ts +2 -0
- package/dist/index.d.ts +6 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -2106,12 +2106,12 @@ var Badge$1 = styled.span(templateObject_4$9 || (templateObject_4$9 = __makeTemp
|
|
|
2106
2106
|
return props.$format ? button_type_mapping[props.$format].badge_content_color : Colors.PRIMARY.Hex;
|
|
2107
2107
|
}, function (props) { return (props.$small ? '10px' : '12px'); }, FontStyles.DEFAULT, function (props) { return (props.$small ? '5px' : '10px'); }, function (props) { return (props.$small ? '-5px' : '-10px'); });
|
|
2108
2108
|
var Button = function (_a) {
|
|
2109
|
-
var badge = _a.badge, children = _a.children, _b = _a.disabled, disabled = _b === void 0 ? false : _b, icon = _a.icon, _c = _a.isForm, isForm = _c === void 0 ? false : _c, _d = _a.margin, margin =
|
|
2109
|
+
var badge = _a.badge, children = _a.children, _b = _a.disabled, disabled = _b === void 0 ? false : _b, icon = _a.icon, _c = _a.isForm, isForm = _c === void 0 ? false : _c, _d = _a.loading, loading = _d === void 0 ? false : _d, _e = _a.margin, margin = _e === void 0 ? '' : _e, onClick = _a.onClick, _f = _a.small, small = _f === void 0 ? false : _f, _g = _a.format, format = _g === void 0 ? 'primary' : _g, accessibleProps = __rest(_a, ["badge", "children", "disabled", "icon", "isForm", "loading", "margin", "onClick", "small", "format"]);
|
|
2110
2110
|
var has_children = children && children.length > 0;
|
|
2111
|
-
return (React.createElement(StyledButton, __assign({ "$disabled": disabled, "$format": format, "$hasChildren": !!has_children, "$margin": margin, "$small": small, onClick: disabled ? undefined : onClick, type: isForm ? 'submit' : undefined }, accessibleProps),
|
|
2111
|
+
return (React.createElement(StyledButton, __assign({ "$disabled": disabled || loading, "$format": format, "$hasChildren": !!has_children, "$margin": margin, "$small": small, onClick: disabled || loading ? undefined : onClick, type: isForm ? 'submit' : undefined }, accessibleProps),
|
|
2112
2112
|
children ? (React.createElement(Label$4, { "$format": format, "$small": small }, children)) : null,
|
|
2113
2113
|
icon && !badge ? (React.createElement(StyledIcon$2, { "$hasChildren": !!has_children },
|
|
2114
|
-
React.createElement(Icon, { color: format ? button_type_mapping[format].content_color : '#fff', path: icon, size: small ? '20px' : '24px' }))) : null,
|
|
2114
|
+
React.createElement(Icon, { color: format ? button_type_mapping[format].content_color : '#fff', path: loading ? js.mdiLoading : icon, size: small ? '20px' : '24px', spin: loading }))) : null,
|
|
2115
2115
|
badge && !icon ? (React.createElement(Badge$1, { "$format": format, "$small": small }, badge)) : null));
|
|
2116
2116
|
};
|
|
2117
2117
|
var templateObject_1$o, templateObject_2$l, templateObject_3$i, templateObject_4$9;
|
|
@@ -2153,26 +2153,17 @@ var templateObject_1$m, templateObject_2$k, templateObject_3$h;
|
|
|
2153
2153
|
|
|
2154
2154
|
var Wrapper$f = styled.div(templateObject_1$l || (templateObject_1$l = __makeTemplateObject(["\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 9999;\n background: rgba(0, 0, 0, 0.8);\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n"], ["\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 9999;\n background: rgba(0, 0, 0, 0.8);\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n"])));
|
|
2155
2155
|
var Container$3 = styled.dialog(templateObject_2$j || (templateObject_2$j = __makeTemplateObject(["\n max-width: 600px;\n width: auto;\n border-radius: 8px;\n overflow: hidden;\n box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);\n outline: none;\n border: none;\n position: relative;\n padding: 40px;\n text-align: center;\n box-sizing: border-box;\n"], ["\n max-width: 600px;\n width: auto;\n border-radius: 8px;\n overflow: hidden;\n box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);\n outline: none;\n border: none;\n position: relative;\n padding: 40px;\n text-align: center;\n box-sizing: border-box;\n"])));
|
|
2156
|
-
var Buttons = styled.div(templateObject_3$g || (templateObject_3$g = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n margin-top: 30px;\n box-sizing: border-box;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n margin-top: 30px;\n box-sizing: border-box;\n"])));
|
|
2156
|
+
var Buttons = styled.div(templateObject_3$g || (templateObject_3$g = __makeTemplateObject(["\n display: flex;\n gap: 10px;\n align-items: center;\n justify-content: center;\n margin-top: 30px;\n box-sizing: border-box;\n"], ["\n display: flex;\n gap: 10px;\n align-items: center;\n justify-content: center;\n margin-top: 30px;\n box-sizing: border-box;\n"])));
|
|
2157
2157
|
var ActionDialog = function (_a) {
|
|
2158
|
-
var description = _a.description, title = _a.title,
|
|
2159
|
-
React.useEffect(function () {
|
|
2160
|
-
document.onkeydown = function (e) {
|
|
2161
|
-
if (e.key === 'Escape') {
|
|
2162
|
-
onClose();
|
|
2163
|
-
}
|
|
2164
|
-
};
|
|
2165
|
-
return function cleanup() {
|
|
2166
|
-
document.onkeydown = null;
|
|
2167
|
-
};
|
|
2168
|
-
}, []);
|
|
2158
|
+
var description = _a.description, title = _a.title, primaryButton = _a.primaryButton, secondaryButton = _a.secondaryButton, tertiaryButton = _a.tertiaryButton, accessibleProps = __rest(_a, ["description", "title", "primaryButton", "secondaryButton", "tertiaryButton"]);
|
|
2169
2159
|
return (React.createElement(Wrapper$f, __assign({}, accessibleProps),
|
|
2170
2160
|
React.createElement(Container$3, { open: true },
|
|
2171
2161
|
title ? (React.createElement(Heading, { margin: '0px 0px 20px 0px', type: 'secondary' }, title)) : null,
|
|
2172
2162
|
description ? React.createElement(Copy, { align: 'center' }, description) : null,
|
|
2173
|
-
primaryButton || secondaryButton ? (React.createElement(Buttons, null,
|
|
2174
|
-
|
|
2175
|
-
|
|
2163
|
+
primaryButton || secondaryButton || tertiaryButton ? (React.createElement(Buttons, null,
|
|
2164
|
+
tertiaryButton ? React.createElement(Button, __assign({}, tertiaryButton, { format: 'secondary' })) : null,
|
|
2165
|
+
secondaryButton ? React.createElement(Button, __assign({}, secondaryButton, { format: 'secondary' })) : null,
|
|
2166
|
+
primaryButton ? React.createElement(Button, __assign({}, primaryButton, { format: 'primary' })) : null)) : null)));
|
|
2176
2167
|
};
|
|
2177
2168
|
var templateObject_1$l, templateObject_2$j, templateObject_3$g;
|
|
2178
2169
|
|