@hexure/ui 1.6.2 → 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 CHANGED
@@ -2026,6 +2026,10 @@ var Colors = {
2026
2026
  Hex: '#E7E6E6',
2027
2027
  Rgb: '231, 230, 230',
2028
2028
  },
2029
+ SUBTLE_GRAY: {
2030
+ Hex: '#f5f5f5',
2031
+ Rgb: '245, 245, 245',
2032
+ },
2029
2033
  };
2030
2034
  var FontStyles = {
2031
2035
  DEFAULT: '"Roboto", Helvetica, Arial, sans-serif',
@@ -2102,12 +2106,12 @@ var Badge$1 = styled.span(templateObject_4$9 || (templateObject_4$9 = __makeTemp
2102
2106
  return props.$format ? button_type_mapping[props.$format].badge_content_color : Colors.PRIMARY.Hex;
2103
2107
  }, function (props) { return (props.$small ? '10px' : '12px'); }, FontStyles.DEFAULT, function (props) { return (props.$small ? '5px' : '10px'); }, function (props) { return (props.$small ? '-5px' : '-10px'); });
2104
2108
  var Button = function (_a) {
2105
- 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 = _d === void 0 ? '' : _d, onClick = _a.onClick, _e = _a.small, small = _e === void 0 ? false : _e, _f = _a.format, format = _f === void 0 ? 'primary' : _f, accessibleProps = __rest(_a, ["badge", "children", "disabled", "icon", "isForm", "margin", "onClick", "small", "format"]);
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"]);
2106
2110
  var has_children = children && children.length > 0;
2107
- 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),
2108
2112
  children ? (React.createElement(Label$4, { "$format": format, "$small": small }, children)) : null,
2109
2113
  icon && !badge ? (React.createElement(StyledIcon$2, { "$hasChildren": !!has_children },
2110
- 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,
2111
2115
  badge && !icon ? (React.createElement(Badge$1, { "$format": format, "$small": small }, badge)) : null));
2112
2116
  };
2113
2117
  var templateObject_1$o, templateObject_2$l, templateObject_3$i, templateObject_4$9;
@@ -2149,26 +2153,17 @@ var templateObject_1$m, templateObject_2$k, templateObject_3$h;
2149
2153
 
2150
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"])));
2151
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"])));
2152
- 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"])));
2153
2157
  var ActionDialog = function (_a) {
2154
- var description = _a.description, title = _a.title, onClose = _a.onClose, primaryButton = _a.primaryButton, secondaryButton = _a.secondaryButton, accessibleProps = __rest(_a, ["description", "title", "onClose", "primaryButton", "secondaryButton"]);
2155
- React.useEffect(function () {
2156
- document.onkeydown = function (e) {
2157
- if (e.key === 'Escape') {
2158
- onClose();
2159
- }
2160
- };
2161
- return function cleanup() {
2162
- document.onkeydown = null;
2163
- };
2164
- }, []);
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"]);
2165
2159
  return (React.createElement(Wrapper$f, __assign({}, accessibleProps),
2166
2160
  React.createElement(Container$3, { open: true },
2167
2161
  title ? (React.createElement(Heading, { margin: '0px 0px 20px 0px', type: 'secondary' }, title)) : null,
2168
2162
  description ? React.createElement(Copy, { align: 'center' }, description) : null,
2169
- primaryButton || secondaryButton ? (React.createElement(Buttons, null,
2170
- secondaryButton ? (React.createElement(Button, __assign({}, secondaryButton, { format: 'secondary', margin: '0px 5px' }))) : null,
2171
- primaryButton ? React.createElement(Button, __assign({}, primaryButton, { format: 'primary', margin: '0px 5px' })) : null)) : null)));
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)));
2172
2167
  };
2173
2168
  var templateObject_1$l, templateObject_2$j, templateObject_3$g;
2174
2169
 
@@ -3152,15 +3147,15 @@ var templateObject_1$3, templateObject_2$3, templateObject_3$2;
3152
3147
 
3153
3148
  var Wrapper$1 = styled.div(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n display: inline-block;\n border-radius: 4px;\n padding: 4px 6px;\n background: ", ";\n color: #ffffff;\n box-sizing: border-box;\n cursor: ", ";\n"], ["\n display: inline-block;\n border-radius: 4px;\n padding: 4px 6px;\n background: ", ";\n color: #ffffff;\n box-sizing: border-box;\n cursor: ", ";\n"])), function (props) { return Colors[props.$color].Hex; }, function (props) { return (props.$removable ? 'pointer' : 'default'); });
3154
3149
  var Content = styled.div(templateObject_2$2 || (templateObject_2$2 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
3155
- var Label = styled.div(templateObject_3$1 || (templateObject_3$1 = __makeTemplateObject(["\n color: #ffffff;\n font-size: ", ";\n font-weight: 500;\n font-family: ", ";\n line-height: 1.2em;\n"], ["\n color: #ffffff;\n font-size: ", ";\n font-weight: 500;\n font-family: ", ";\n line-height: 1.2em;\n"])), FontSizes.SMALL, FontStyles.DEFAULT);
3150
+ var Label = styled.div(templateObject_3$1 || (templateObject_3$1 = __makeTemplateObject(["\n color: ", ";\n font-size: ", ";\n font-weight: 500;\n font-family: ", ";\n line-height: 1.2em;\n"], ["\n color: ", ";\n font-size: ", ";\n font-weight: 500;\n font-family: ", ";\n line-height: 1.2em;\n"])), function (props) { return (props.$color === 'SUBTLE_GRAY' ? '#000000' : '#ffffff'); }, FontSizes.SMALL, FontStyles.DEFAULT);
3156
3151
  var Remove = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-left: 10px;\n display: flex;\n align-items: center;\n"], ["\n margin-left: 10px;\n display: flex;\n align-items: center;\n"])));
3157
3152
  var Tag = function (_a) {
3158
3153
  var children = _a.children, _b = _a.color, color = _b === void 0 ? 'PRIMARY' : _b, removable = _a.removable, onClick = _a.onClick, accessibleProps = __rest(_a, ["children", "color", "removable", "onClick"]);
3159
3154
  return (React.createElement(Wrapper$1, __assign({ "$color": color, "$removable": removable, onClick: onClick }, accessibleProps),
3160
3155
  React.createElement(Content, null,
3161
- React.createElement(Label, null, children),
3156
+ React.createElement(Label, { "$color": color }, children),
3162
3157
  removable ? (React.createElement(Remove, null,
3163
- React.createElement(Icon, { color: '#ffffff', path: js.mdiClose, size: '15px' }))) : null)));
3158
+ React.createElement(Icon, { color: color === 'SUBTLE_GRAY' ? '#000000' : '#ffffff', path: js.mdiClose, size: '15px' }))) : null)));
3164
3159
  };
3165
3160
  var templateObject_1$2, templateObject_2$2, templateObject_3$1, templateObject_4;
3166
3161