@typeolymp/ui-components 2.1.15 → 2.2.0
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/index.js
CHANGED
|
@@ -4252,13 +4252,13 @@ var StyledInput = styled__default["default"].input(templateObject_3$f || (templa
|
|
|
4252
4252
|
var disabled = _a.disabled;
|
|
4253
4253
|
return disabled ? theme.colors.darkGray.light : theme.colors.darkGray.base;
|
|
4254
4254
|
}, theme.fonts.paragraph, theme.paragraph.medium.fontSize, theme.paragraph.medium.lineHeight, theme.colors.lightGray.darker, theme.colors.blue.dark, "0 0 0 1px ".concat(theme.colors.blue.dark));
|
|
4255
|
-
var HelperContainer = styled__default["default"].div(templateObject_4$
|
|
4255
|
+
var HelperContainer = styled__default["default"].div(templateObject_4$6 || (templateObject_4$6 = __makeTemplateObject$1(["\n margin-top: 5px;\n padding-left: 5px;\n"], ["\n margin-top: 5px;\n padding-left: 5px;\n"])));
|
|
4256
4256
|
var fadeIn = styled.keyframes(templateObject_5$3 || (templateObject_5$3 = __makeTemplateObject$1(["\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n"], ["\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n"])));
|
|
4257
4257
|
var Helper = styled__default["default"](StyledParagraph)(templateObject_6$3 || (templateObject_6$3 = __makeTemplateObject$1(["\n font-weight: 400;\n font-size: 14px;\n color: ", ";\n animation: ", " 0.3s linear;\n"], ["\n font-weight: 400;\n font-size: 14px;\n color: ", ";\n animation: ", " 0.3s linear;\n"])), function (_a) {
|
|
4258
4258
|
var isOk = _a.isOk;
|
|
4259
4259
|
return isOk ? theme.colors.green.base : theme.colors.darkGray.light;
|
|
4260
4260
|
}, fadeIn);
|
|
4261
|
-
var templateObject_1$N, templateObject_2$B, templateObject_3$f, templateObject_4$
|
|
4261
|
+
var templateObject_1$N, templateObject_2$B, templateObject_3$f, templateObject_4$6, templateObject_5$3, templateObject_6$3;
|
|
4262
4262
|
|
|
4263
4263
|
var expressions = {};
|
|
4264
4264
|
|
|
@@ -14713,11 +14713,11 @@ htmlReactParser.Text;
|
|
|
14713
14713
|
var Fieldset$1 = styled__default["default"].fieldset(templateObject_1$A || (templateObject_1$A = __makeTemplateObject$1(["\n border: 0;\n margin: 0;\n padding: 0;\n"], ["\n border: 0;\n margin: 0;\n padding: 0;\n"])));
|
|
14714
14714
|
var CheckboxContainer = styled__default["default"].div(templateObject_2$w || (templateObject_2$w = __makeTemplateObject$1(["\n margin-top: 5px;\n"], ["\n margin-top: 5px;\n"])));
|
|
14715
14715
|
var CheckboxWrapper = styled__default["default"].div(templateObject_3$d || (templateObject_3$d = __makeTemplateObject$1(["\n display: flex;\n align-items: center;\n\n > div:first-child {\n margin-right: 10px;\n }\n\n :not(:last-child) {\n margin-bottom: 20px;\n }\n"], ["\n display: flex;\n align-items: center;\n\n > div:first-child {\n margin-right: 10px;\n }\n\n :not(:last-child) {\n margin-bottom: 20px;\n }\n"])));
|
|
14716
|
-
var Label$b = styled__default["default"](StyledParagraph)(templateObject_4$
|
|
14716
|
+
var Label$b = styled__default["default"](StyledParagraph)(templateObject_4$5 || (templateObject_4$5 = __makeTemplateObject$1(["\n font-weight: ", ";\n color: ", ";\n display: flex;\n flex-wrap: wrap;\n gap: 0 6px;\n align-items: center;\n cursor: pointer;\n\n a {\n color: ", ";\n }\n"], ["\n font-weight: ", ";\n color: ", ";\n display: flex;\n flex-wrap: wrap;\n gap: 0 6px;\n align-items: center;\n cursor: pointer;\n\n a {\n color: ", ";\n }\n"])), function (_a) {
|
|
14717
14717
|
var weight = _a.weight;
|
|
14718
14718
|
return weight || 500;
|
|
14719
14719
|
}, theme.colors.darkGray.base, theme.colors.blue.base);
|
|
14720
|
-
var templateObject_1$A, templateObject_2$w, templateObject_3$d, templateObject_4$
|
|
14720
|
+
var templateObject_1$A, templateObject_2$w, templateObject_3$d, templateObject_4$5;
|
|
14721
14721
|
|
|
14722
14722
|
var Checkboxes = function (props) {
|
|
14723
14723
|
var _a = React$3.useState(props.defaultValue || []), values = _a[0], setValues = _a[1];
|
|
@@ -17717,43 +17717,54 @@ __exportStar(getPricing$1, exports);
|
|
|
17717
17717
|
|
|
17718
17718
|
}(mappers));
|
|
17719
17719
|
|
|
17720
|
-
var Container$d = styled__default["default"].div(templateObject_1$o || (templateObject_1$o = __makeTemplateObject$1(["\n
|
|
17721
|
-
var
|
|
17722
|
-
if (
|
|
17723
|
-
|
|
17724
|
-
|
|
17725
|
-
|
|
17726
|
-
|
|
17727
|
-
|
|
17728
|
-
|
|
17729
|
-
|
|
17730
|
-
|
|
17731
|
-
|
|
17732
|
-
|
|
17733
|
-
|
|
17734
|
-
|
|
17735
|
-
var
|
|
17736
|
-
|
|
17737
|
-
|
|
17738
|
-
|
|
17739
|
-
|
|
17740
|
-
|
|
17741
|
-
|
|
17742
|
-
|
|
17743
|
-
|
|
17744
|
-
var LocaleWrapper = styled__default["default"].div(templateObject_4$5 || (templateObject_4$5 = __makeTemplateObject$1(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 10px 15px;\n\n :not(:last-child) {\n border-bottom: 1px solid ", ";\n }\n\n > div:first-child {\n display: flex;\n align-items: center;\n margin-right: 10px;\n }\n\n p {\n white-space: nowrap;\n }\n\n :hover {\n cursor: pointer;\n background-color: ", ";\n\n p {\n color: ", ";\n }\n svg {\n fill: ", ";\n }\n }\n"], ["\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 10px 15px;\n\n :not(:last-child) {\n border-bottom: 1px solid ", ";\n }\n\n > div:first-child {\n display: flex;\n align-items: center;\n margin-right: 10px;\n }\n\n p {\n white-space: nowrap;\n }\n\n :hover {\n cursor: pointer;\n background-color: ", ";\n\n p {\n color: ", ";\n }\n svg {\n fill: ", ";\n }\n }\n"])), theme.colors.lightGray.darker, theme.colors.lightGray.base, theme.colors.blue.base, theme.colors.blue.base);
|
|
17745
|
-
var templateObject_1$o, templateObject_2$m, templateObject_3$a, templateObject_4$5;
|
|
17720
|
+
var Container$d = styled__default["default"].div(templateObject_1$o || (templateObject_1$o = __makeTemplateObject$1(["\n background-color: ", ";\n border-radius: 6px;\n border: ", ";\n box-shadow: ", ";\n overflow: hidden;\n\n display: flex;\n flex-direction: ", ";\n\n > button:first-child {\n all: unset;\n width: 100%;\n display: flex;\n align-items: center;\n gap: 10px;\n\n padding: 10px 15px;\n\n svg {\n pointer-events: none;\n }\n\n > div:last-child {\n transition: transform 0.3s ease;\n transform: ", ";\n }\n\n :hover {\n cursor: pointer;\n background-color: ", ";\n }\n }\n"], ["\n background-color: ", ";\n border-radius: 6px;\n border: ", ";\n box-shadow: ", ";\n overflow: hidden;\n\n display: flex;\n flex-direction: ", ";\n\n > button:first-child {\n all: unset;\n width: 100%;\n display: flex;\n align-items: center;\n gap: 10px;\n\n padding: 10px 15px;\n\n svg {\n pointer-events: none;\n }\n\n > div:last-child {\n transition: transform 0.3s ease;\n transform: ", ";\n }\n\n :hover {\n cursor: pointer;\n background-color: ", ";\n }\n }\n"])), function (_a) {
|
|
17721
|
+
var borderless = _a.borderless;
|
|
17722
|
+
if (borderless)
|
|
17723
|
+
return "transparent";
|
|
17724
|
+
return theme.colors.lightGray.light;
|
|
17725
|
+
}, function (_a) {
|
|
17726
|
+
var borderless = _a.borderless;
|
|
17727
|
+
return borderless ? "" : "1px solid ".concat(theme.colors.lightGray.dark);
|
|
17728
|
+
}, function (_a) {
|
|
17729
|
+
var borderless = _a.borderless;
|
|
17730
|
+
return borderless ? "" : "0px 2px 0px rgb(0 0 0 / 10%)";
|
|
17731
|
+
}, function (_a) {
|
|
17732
|
+
var reverse = _a.reverse;
|
|
17733
|
+
return reverse ? "column-reverse" : "column";
|
|
17734
|
+
}, function (_a) {
|
|
17735
|
+
var open = _a.open;
|
|
17736
|
+
return (open ? "rotate(180deg)" : "");
|
|
17737
|
+
}, theme.colors.lightGray.base);
|
|
17738
|
+
var LocalesList = styled__default["default"].ul(templateObject_2$m || (templateObject_2$m = __makeTemplateObject$1(["\n list-style: none;\n margin: 0;\n padding: 0;\n\n // background-color: ", ";\n // border: 1px solid ", ";\n // border-radius: 0 0 6px 6px;\n // box-shadow: 0px 2px 0px rgb(0 0 0 / 10%);\n\n // overflow: hidden;\n"], ["\n list-style: none;\n margin: 0;\n padding: 0;\n\n // background-color: ", ";\n // border: 1px solid ", ";\n // border-radius: 0 0 6px 6px;\n // box-shadow: 0px 2px 0px rgb(0 0 0 / 10%);\n\n // overflow: hidden;\n"])), theme.colors.lightGray.light, theme.colors.lightGray.dark);
|
|
17739
|
+
var LocalesListItem = styled__default["default"].li(templateObject_3$a || (templateObject_3$a = __makeTemplateObject$1(["\n // min-width: max-content;\n\n display: ", ";\n align-items: center;\n gap: 10px;\n\n // background-color: ", ";\n\n padding: 13px 15px;\n cursor: pointer;\n\n :hover {\n background-color: ", ";\n }\n"], ["\n // min-width: max-content;\n\n display: ", ";\n align-items: center;\n gap: 10px;\n\n // background-color: ", ";\n\n padding: 13px 15px;\n cursor: pointer;\n\n :hover {\n background-color: ", ";\n }\n"])), function (_a) {
|
|
17740
|
+
var hidden = _a.hidden;
|
|
17741
|
+
return (hidden ? "none" : "flex");
|
|
17742
|
+
}, theme.colors.lightGray.light, theme.colors.lightGray.base);
|
|
17743
|
+
var templateObject_1$o, templateObject_2$m, templateObject_3$a;
|
|
17746
17744
|
|
|
17747
17745
|
var LocaleSelect = function (props) {
|
|
17748
|
-
var
|
|
17749
|
-
var
|
|
17746
|
+
var containerRef = React$3.useRef(null);
|
|
17747
|
+
var _a = React$3.useState(props.defaultValue), selectedLocale = _a[0], setSelectedLocale = _a[1];
|
|
17748
|
+
var _b = React$3.useState(false), open = _b[0], setOpen = _b[1];
|
|
17749
|
+
var handleClickOutside = React$3.useCallback(function (event) {
|
|
17750
|
+
return open &&
|
|
17751
|
+
containerRef.current &&
|
|
17752
|
+
!containerRef.current.contains(event.target)
|
|
17753
|
+
? setOpen(false)
|
|
17754
|
+
: null;
|
|
17755
|
+
}, [open, containerRef]);
|
|
17756
|
+
React$3.useEffect(function () {
|
|
17757
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
17758
|
+
return function () {
|
|
17759
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
17760
|
+
};
|
|
17761
|
+
}, [handleClickOutside]);
|
|
17750
17762
|
var onSelectLocale = function (locale) {
|
|
17751
|
-
|
|
17763
|
+
setSelectedLocale(locale);
|
|
17752
17764
|
props.onChange(locale);
|
|
17765
|
+
setOpen(false);
|
|
17753
17766
|
};
|
|
17754
|
-
return (jsxRuntime.jsxs(Container$d, __assign$2({
|
|
17755
|
-
.filter(function (l) { return l !== locale; })
|
|
17756
|
-
.map(function (locale) { return (jsxRuntime.jsxs(LocaleWrapper, __assign$2({ onClick: function () { return onSelectLocale(locale); } }, { children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Flag, { locale: locale }), jsxRuntime.jsx(Spacer, { horizontal: 10 }), jsxRuntime.jsx(Paragraph, __assign$2({ size: "small", weight: "regular", color: "darkGray" }, { children: mappers.getNativeLanguageByLocale(locale) }))] }), jsxRuntime.jsx(Icon, { type: "chevronRight", size: "small", color: "darkGray" })] }), locale)); }) })))] })));
|
|
17767
|
+
return (jsxRuntime.jsxs(Container$d, __assign$2({ open: open, reverse: props.reverse, ref: containerRef }, { children: [jsxRuntime.jsxs("button", __assign$2({ "aria-haspopup": "listbox", "aria-expanded": open, "aria-controls": "locales", onClick: function () { return setOpen(!open); } }, { children: [jsxRuntime.jsx(Flag, { locale: selectedLocale }), !props.iconOnly && (jsxRuntime.jsx(Heading, __assign$2({ type: "h6", as: "span" }, { children: mappers.getNativeLanguageByLocale(selectedLocale) }))), jsxRuntime.jsx(Icon, { type: props.reverse ? "chevronUp" : "chevronDown", size: "small", color: "lightGray" })] })), jsxRuntime.jsx(LocalesList, __assign$2({ hidden: !open, "aria-label": "submenu", "aria-hidden": !open, role: "listbox", id: "locales" }, { children: props.locales.map(function (locale) { return (jsxRuntime.jsxs(LocalesListItem, __assign$2({ onClick: function () { return onSelectLocale(locale); }, "data-value": locale, "aria-selected": locale === selectedLocale, hidden: locale === selectedLocale, role: "option" }, { children: [jsxRuntime.jsx(Flag, { locale: locale }), !props.iconOnly && (jsxRuntime.jsx(Heading, __assign$2({ type: "h6", as: "span" }, { children: mappers.getNativeLanguageByLocale(locale) })))] }), locale)); }) }))] })));
|
|
17757
17768
|
};
|
|
17758
17769
|
|
|
17759
17770
|
var Wrapper$1 = styled__default["default"].div(templateObject_1$n || (templateObject_1$n = __makeTemplateObject$1(["\n width: 100%;\n min-width: 200px;\n display: flex;\n justify-content: space-between;\n\n > div {\n display: flex;\n align-items: center;\n }\n"], ["\n width: 100%;\n min-width: 200px;\n display: flex;\n justify-content: space-between;\n\n > div {\n display: flex;\n align-items: center;\n }\n"])));
|