@typeolymp/ui-components 1.16.1 → 1.16.2
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/build/components/atoms/Subheading/index.d.ts +1 -0
- package/build/components/molecules/Collapse/index.d.ts +1 -1
- package/build/components/organisms/Form/index.d.ts +1 -1
- package/build/index.es.js +8 -4
- package/build/index.es.js.map +1 -1
- package/build/index.js +8 -4
- package/build/index.js.map +1 -1
- package/package.json +19 -11
package/build/index.js
CHANGED
|
@@ -3515,7 +3515,11 @@ var Button = React$3.forwardRef(function (_a, ref) {
|
|
|
3515
3515
|
var buttonRef = React$3.useRef(null);
|
|
3516
3516
|
var _b = React$3.useState(false), isLoading = _b[0], setIsLoading = _b[1];
|
|
3517
3517
|
var as = href || asAnchor ? "a" : "button";
|
|
3518
|
-
var onClick = function () {
|
|
3518
|
+
var onClick = function (e) {
|
|
3519
|
+
if (props.onClickAsync || props.onClick) {
|
|
3520
|
+
e.stopPropagation();
|
|
3521
|
+
e.preventDefault();
|
|
3522
|
+
}
|
|
3519
3523
|
if (props.onClickAsync) {
|
|
3520
3524
|
setIsLoading(true);
|
|
3521
3525
|
new Promise(function (resolve) {
|
|
@@ -11261,7 +11265,7 @@ var Checkboxes = function (props) {
|
|
|
11261
11265
|
};
|
|
11262
11266
|
|
|
11263
11267
|
var Container$i = styled__default["default"].div(templateObject_1$x || (templateObject_1$x = __makeTemplateObject$1(["\n width: 100%;\n background-color: ", ";\n box-shadow: 0px 4px 0px rgba(0, 0, 0, 20%);\n border-radius: 6px;\n padding: 10px 20px;\n"], ["\n width: 100%;\n background-color: ", ";\n box-shadow: 0px 4px 0px rgba(0, 0, 0, 20%);\n border-radius: 6px;\n padding: 10px 20px;\n"])), theme.colors.lightGray.light);
|
|
11264
|
-
var Item = styled__default["default"].div(templateObject_2$s || (templateObject_2$s = __makeTemplateObject$1(["\n padding: 10px 0;\n cursor: pointer;\n\n > div:first-child {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 5px;\n }\n\n p {\n display: ", ";\n }\n\n :not(:last-child) {\n border-bottom: 1px solid ", ";\n }\n"], ["\n padding: 10px 0;\n cursor: pointer;\n\n > div:first-child {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 5px;\n }\n\n p {\n display: ", ";\n }\n\n :not(:last-child) {\n border-bottom: 1px solid ", ";\n }\n"])), function (_a) {
|
|
11268
|
+
var Item = styled__default["default"].div(templateObject_2$s || (templateObject_2$s = __makeTemplateObject$1(["\n padding: 10px 0;\n cursor: pointer;\n\n > div:first-child {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 5px;\n }\n\n p, > div:last-child {\n display: ", ";\n margin: 0;\n }\n\n :not(:last-child) {\n border-bottom: 1px solid ", ";\n }\n"], ["\n padding: 10px 0;\n cursor: pointer;\n\n > div:first-child {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 5px;\n }\n\n p, > div:last-child {\n display: ", ";\n margin: 0;\n }\n\n :not(:last-child) {\n border-bottom: 1px solid ", ";\n }\n"])), function (_a) {
|
|
11265
11269
|
var isOpen = _a.isOpen;
|
|
11266
11270
|
return (isOpen ? "" : "none");
|
|
11267
11271
|
}, theme.colors.lightGray.dark);
|
|
@@ -11279,7 +11283,7 @@ var Collapse = function (props) {
|
|
|
11279
11283
|
};
|
|
11280
11284
|
return (jsxRuntime.jsx(Container$i, __assign$2({}, props, { children: props.items.map(function (item, index) {
|
|
11281
11285
|
var isOpen = openItems.includes(index);
|
|
11282
|
-
return (jsxRuntime.jsxs(Item, __assign$2({ isOpen: isOpen, onClick: function () { return onClickItem(index, isOpen); } }, { children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Heading, __assign$2({ type: "h6" }, { children: item.title })), jsxRuntime.jsx(Icon, { type: isOpen ? "chevronUp" : "chevronDown", color: "blue" })] }), jsxRuntime.jsx(Paragraph, __assign$2({ weight: "regular" }, { children: item.content }))] }), "".concat(item.title, "-").concat(index)));
|
|
11286
|
+
return (jsxRuntime.jsxs(Item, __assign$2({ isOpen: isOpen, onClick: function () { return onClickItem(index, isOpen); } }, { children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Heading, __assign$2({ type: "h6" }, { children: item.title })), jsxRuntime.jsx(Icon, { type: isOpen ? "chevronUp" : "chevronDown", color: "blue" })] }), jsxRuntime.jsx(Paragraph, __assign$2({ weight: "regular", as: typeof item.content !== "string" ? "div" : undefined }, { children: item.content }))] }), "".concat(item.title, "-").concat(index)));
|
|
11283
11287
|
}) })));
|
|
11284
11288
|
};
|
|
11285
11289
|
|
|
@@ -12129,7 +12133,7 @@ var Form = React$3.forwardRef(function (props, ref) {
|
|
|
12129
12133
|
props.onError(feedback);
|
|
12130
12134
|
}
|
|
12131
12135
|
};
|
|
12132
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [props.title && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Heading, __assign$2({ type: "h4" }, { children: props.title })), jsxRuntime.jsx(Spacer, { vertical: 15 })] })), props.description && (jsxRuntime.jsx(DescriptionWrapper, { children: jsxRuntime.jsx(Paragraph, __assign$2({ color: "darkGray", weight: "regular" }, { children: htmlReactParser(props.description) })) })), jsxRuntime.jsx(FormWrapper, { children: props.fields.map(function (field, index) {
|
|
12136
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [props.title && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Heading, __assign$2({ type: "h4" }, { children: props.title })), jsxRuntime.jsx(Spacer, { vertical: 15 })] })), props.description && (jsxRuntime.jsx(DescriptionWrapper, { children: typeof props.description === "string" ? (jsxRuntime.jsx(Paragraph, __assign$2({ color: "darkGray", weight: "regular" }, { children: htmlReactParser(props.description) }))) : (props.description) })), jsxRuntime.jsx(FormWrapper, { children: props.fields.map(function (field, index) {
|
|
12133
12137
|
switch (field.type) {
|
|
12134
12138
|
case "text":
|
|
12135
12139
|
return (React$3.createElement(WithValidation, __assign$2({}, feedback[field.name], { key: "field-".concat(index) }),
|