@xfers/design-system 5.0.0-dev.528a2fe19f → 5.0.0-dev.6d501f8a49
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/cjs/MintSetupWallet-000e4d82.js +2 -0
- package/cjs/MintSetupWallet-000e4d82.js.map +1 -0
- package/cjs/StraitsXPersonalAccountLightLogo-042665bf.js +2 -0
- package/cjs/StraitsXPersonalAccountLightLogo-042665bf.js.map +1 -0
- package/cjs/icons.js +1 -1
- package/cjs/icons.js.map +1 -1
- package/cjs/index.js +20 -4
- package/cjs/index.js.map +1 -1
- package/cjs/logos.js +1 -1
- package/dist/components/Button/Button.js +6 -6
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/DatePicker/index.js +19 -17
- package/dist/components/DatePicker/index.js.map +1 -1
- package/dist/components/DynamicSelect/DynamicSelect.js +3 -3
- package/dist/components/DynamicSelect/DynamicSelect.js.map +1 -1
- package/dist/components/Form/index.js +1 -1
- package/dist/components/Form/index.js.map +1 -1
- package/dist/components/Input/HelperText.js +17 -0
- package/dist/components/Input/HelperText.js.map +1 -0
- package/dist/components/Input/InputLabel.js +43 -0
- package/dist/components/Input/InputLabel.js.map +1 -0
- package/dist/components/Input/index.js +39 -54
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/Input/inputStyles.js +17 -0
- package/dist/components/Input/inputStyles.js.map +1 -0
- package/dist/components/InputWithButton/index.js +60 -0
- package/dist/components/InputWithButton/index.js.map +1 -0
- package/dist/components/Radio/index.js +3 -3
- package/dist/components/Radio/index.js.map +1 -1
- package/dist/components/RangePicker/index.js +7 -5
- package/dist/components/RangePicker/index.js.map +1 -1
- package/dist/components/Select/const.js +12 -0
- package/dist/components/Select/const.js.map +1 -0
- package/dist/components/Select/helpers.js +52 -0
- package/dist/components/Select/helpers.js.map +1 -0
- package/dist/components/Select/index.js +10 -25
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Select/style.js +42 -69
- package/dist/components/Select/style.js.map +1 -1
- package/dist/components/Tag/index.js +10 -3
- package/dist/components/Tag/index.js.map +1 -1
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/components/Tooltip/index.js.map +1 -1
- package/dist/icons/MintSetupWallet.js +86 -0
- package/dist/icons/MintSetupWallet.js.map +1 -0
- package/dist/icons/index.js +3 -1
- package/dist/icons/index.js.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/logos/Base.js +19 -0
- package/dist/logos/Base.js.map +1 -0
- package/dist/logos/index.js +3 -1
- package/dist/logos/index.js.map +1 -1
- package/dist/shared/TypographyStyles.js +13 -1
- package/dist/shared/TypographyStyles.js.map +1 -1
- package/dist/types/components/DatePicker/index.d.ts +8 -1
- package/dist/types/components/Input/HelperText.d.ts +7 -0
- package/dist/types/components/Input/InputLabel.d.ts +11 -0
- package/dist/types/components/Input/index.d.ts +29 -15
- package/dist/types/components/Input/inputStyles.d.ts +4 -0
- package/dist/types/components/InputWithButton/index.d.ts +18 -0
- package/dist/types/components/RangePicker/index.d.ts +3 -1
- package/dist/types/components/Select/const.d.ts +8 -0
- package/dist/types/components/Select/helpers.d.ts +17 -0
- package/dist/types/components/Select/index.d.ts +19 -16
- package/dist/types/components/Select/style.d.ts +18 -2
- package/dist/types/icons/MintSetupWallet.d.ts +3 -0
- package/dist/types/icons/index.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/logos/Base.d.ts +3 -0
- package/dist/types/logos/index.d.ts +1 -0
- package/dist/types/shared/TypographyStyles.d.ts +13 -0
- package/es/{Time-740bf76c.js → MintSetupWallet-16164339.js} +2 -2
- package/es/MintSetupWallet-16164339.js.map +1 -0
- package/es/{StraitsXPersonalAccountLightLogo-88865b98.js → StraitsXPersonalAccountLightLogo-2319d5c0.js} +2 -2
- package/es/StraitsXPersonalAccountLightLogo-2319d5c0.js.map +1 -0
- package/es/icons.js +1 -1
- package/es/icons.js.map +1 -1
- package/es/index.js +20 -4
- package/es/index.js.map +1 -1
- package/es/logos.js +1 -1
- package/package.json +3 -2
- package/cjs/StraitsXPersonalAccountLightLogo-b6f06da0.js +0 -2
- package/cjs/StraitsXPersonalAccountLightLogo-b6f06da0.js.map +0 -1
- package/cjs/Time-7085cdb3.js +0 -2
- package/cjs/Time-7085cdb3.js.map +0 -1
- package/es/StraitsXPersonalAccountLightLogo-88865b98.js.map +0 -1
- package/es/Time-740bf76c.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputStyles.js","sourceRoot":"","sources":["../../../src/components/Input/inputStyles.ts"],"names":[],"mappings":";;;AAUA,8CAoSC;AA9SD,gEAKoC;AAG3B,4FALP,8BAAW,OAKO;AAEpB,SAAgB,iBAAiB,CAC/B,KAA2B,EAC3B,IAAyB,EACzB,KAAe,EACf,aAAuB;IAFvB,qBAAA,EAAA,cAAyB;IAInB,IAAA,KAAoC,8BAAW,CAAC,IAAI,CAAC,EAAnD,MAAM,YAAA,EAAE,YAAY,kBAAA,EAAE,OAAO,aAAsB,CAAA;IAC3D,IAAM,WAAW,GAAG,KAAK;QACvB,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ;QAC7B,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAA;IAEzB,OAAO,wLAKQ,OAAO,mCACH,4BAAS,iCACX,4BAAS,CAAC,EAAE,6BAChB,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,wDAEzB,MAAM,sFAGL,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,gBAAgB,mMAOhC,YAAY,+CACb,WAAW,8BACjB,MAAM,+BACL,OAAO,oGAC8D,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,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AAI,CAAC,QAAQ,yDACf,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,qiCAmBnD,aAAa;QACX,CAAC,CAAC,+EAEgB,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,6BAC9C,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,6FAGnB,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,6CACZ,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,8EAExB,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,2RAUrC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,6BAC9C,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,6FAGnB,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,8CACX,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,8EAEzB,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,0MAS1D;QACG,CAAC,CAAC,EAAE,SAET,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
var react_1 = require("react");
|
|
8
|
+
var styled_1 = require("@emotion/styled");
|
|
9
|
+
var ThemeContext_1 = require("src/theme/ThemeContext");
|
|
10
|
+
var TypographyStyles_1 = require("src/shared/TypographyStyles");
|
|
11
|
+
var InputWithButton = function (_a) {
|
|
12
|
+
var buttonText = _a.buttonText, onButtonClick = _a.onButtonClick, prefix = _a.prefix, placeholder = _a.placeholder, value = _a.value, defaultValue = _a.defaultValue, onChange = _a.onChange, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.disabledInput, disabledInput = _c === void 0 ? false : _c, _d = _a.disabledPrefix, disabledPrefix = _d === void 0 ? false : _d, _e = _a.staticPrefix, staticPrefix = _e === void 0 ? false : _e, _f = _a.error, error = _f === void 0 ? false : _f, className = _a.className;
|
|
13
|
+
var theme = (0, ThemeContext_1.useTheme)();
|
|
14
|
+
var inputDisabled = disabled || disabledInput;
|
|
15
|
+
var prefixDisabled = disabled || disabledPrefix;
|
|
16
|
+
var borderColor = error
|
|
17
|
+
? theme.color.status.critical
|
|
18
|
+
: theme.color.base.line;
|
|
19
|
+
var prefixBorderColor = theme.color.base.line;
|
|
20
|
+
var getPrefixBgColor = function () {
|
|
21
|
+
if (prefixDisabled)
|
|
22
|
+
return theme.color.surface.disabledSurface;
|
|
23
|
+
if (staticPrefix)
|
|
24
|
+
return theme.color.surface.secondaryNeutral;
|
|
25
|
+
return theme.color.surface.neutral;
|
|
26
|
+
};
|
|
27
|
+
return (react_1.default.createElement(Container, { className: className },
|
|
28
|
+
prefix && (react_1.default.createElement(PrefixContainer, { borderColor: prefixBorderColor, bgColor: getPrefixBgColor(), hoverBgColor: prefixDisabled
|
|
29
|
+
? theme.color.surface.disabledSurface
|
|
30
|
+
: theme.color.interactive.hoverSurface, textColor: prefixDisabled
|
|
31
|
+
? theme.color.surface.disabledOnSurface
|
|
32
|
+
: theme.color.base.onNeutral, isDisabled: prefixDisabled }, prefix)),
|
|
33
|
+
react_1.default.createElement(StyledInput, { type: "text", placeholder: placeholder, value: value, defaultValue: defaultValue, onChange: onChange, disabled: inputDisabled, borderColor: borderColor, focusBorderColor: theme.color.base.primary2, textColor: theme.color.base.onNeutral, placeholderColor: theme.color.component.placeholderInput, disabledBgColor: theme.color.surface.disabledSurface, disabledTextColor: theme.color.surface.disabledOnSurface, hasPrefix: !!prefix, isDisabled: inputDisabled }),
|
|
34
|
+
react_1.default.createElement(StyledButton, { type: "button", onClick: onButtonClick, disabled: disabled || error, bgColor: theme.color.base.primary, disabledBgColor: theme.color.surface.disabledSurface, textColor: theme.color.base.onNeutral, disabledTextColor: theme.color.surface.disabledOnSurface, isDisabled: disabled || error }, buttonText)));
|
|
35
|
+
};
|
|
36
|
+
exports.default = InputWithButton;
|
|
37
|
+
// ─── Styled Components ───
|
|
38
|
+
var _a = TypographyStyles_1.SIZE_CONFIG.large, height = _a.height, borderRadius = _a.borderRadius, padding = _a.padding;
|
|
39
|
+
var Container = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n height: ", ";\n width: 100%;\n position: relative;\n"], ["\n display: flex;\n height: ", ";\n width: 100%;\n position: relative;\n"])), height);
|
|
40
|
+
var PrefixContainer = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n padding: 0 16px;\n border: 1px solid ", ";\n border-right: none;\n border-radius: ", " 0 0 ", ";\n background-color: ", ";\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n white-space: nowrap;\n cursor: ", ";\n box-sizing: border-box;\n overflow: visible;\n\n & > * {\n pointer-events: ", ";\n }\n\n &:hover {\n background-color: ", ";\n }\n"], ["\n display: flex;\n align-items: center;\n padding: 0 16px;\n border: 1px solid ", ";\n border-right: none;\n border-radius: ", " 0 0 ", ";\n background-color: ", ";\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n white-space: nowrap;\n cursor: ", ";\n box-sizing: border-box;\n overflow: visible;\n\n & > * {\n pointer-events: ", ";\n }\n\n &:hover {\n background-color: ", ";\n }\n"])), function (props) { return props.borderColor; }, borderRadius, borderRadius, function (props) { return props.bgColor; }, function (props) { return props.textColor; }, TypographyStyles_1.MAIN_FONT, TypographyStyles_1.FONT_SIZE.P1, function (props) { return (props.isDisabled ? 'not-allowed' : 'default'); }, function (props) { return (props.isDisabled ? 'none' : 'auto'); }, function (props) {
|
|
41
|
+
return props.isDisabled ? props.bgColor : props.hoverBgColor;
|
|
42
|
+
});
|
|
43
|
+
var StyledInput = styled_1.default.input(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex: 1;\n min-width: 0;\n height: 100%;\n padding: ", ";\n border: 1px solid ", ";\n border-radius: ", ";\n font-family: ", ";\n font-size: ", ";\n color: ", ";\n background-color: ", ";\n outline: none;\n box-sizing: border-box;\n cursor: ", ";\n\n &::placeholder {\n color: ", ";\n font-weight: 400;\n }\n\n &:focus {\n border-color: ", ";\n }\n\n &:hover {\n border-color: ", ";\n }\n"], ["\n flex: 1;\n min-width: 0;\n height: 100%;\n padding: ", ";\n border: 1px solid ", ";\n border-radius: ", ";\n font-family: ", ";\n font-size: ", ";\n color: ", ";\n background-color: ", ";\n outline: none;\n box-sizing: border-box;\n cursor: ", ";\n\n &::placeholder {\n color: ", ";\n font-weight: 400;\n }\n\n &:focus {\n border-color: ", ";\n }\n\n &:hover {\n border-color: ", ";\n }\n"])), padding, function (props) { return props.borderColor; }, function (props) {
|
|
44
|
+
return props.hasPrefix ? '0' : "".concat(borderRadius, " 0 0 ").concat(borderRadius);
|
|
45
|
+
}, TypographyStyles_1.MAIN_FONT, TypographyStyles_1.FONT_SIZE.P1, function (props) {
|
|
46
|
+
return props.isDisabled ? props.disabledTextColor : props.textColor;
|
|
47
|
+
}, function (props) {
|
|
48
|
+
return props.isDisabled ? props.disabledBgColor : 'transparent';
|
|
49
|
+
}, function (props) { return (props.isDisabled ? 'not-allowed' : 'text'); }, function (props) { return props.placeholderColor; }, function (props) {
|
|
50
|
+
return props.isDisabled ? props.borderColor : props.focusBorderColor;
|
|
51
|
+
}, function (props) {
|
|
52
|
+
return props.isDisabled ? props.borderColor : props.focusBorderColor;
|
|
53
|
+
});
|
|
54
|
+
var StyledButton = styled_1.default.button(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0 24px;\n border: none;\n border-radius: 0 ", " ", " 0;\n background-color: ", ";\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: 700;\n white-space: nowrap;\n cursor: ", ";\n box-sizing: border-box;\n\n &:hover {\n opacity: ", ";\n }\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0 24px;\n border: none;\n border-radius: 0 ", " ", " 0;\n background-color: ", ";\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: 700;\n white-space: nowrap;\n cursor: ", ";\n box-sizing: border-box;\n\n &:hover {\n opacity: ", ";\n }\n"])), borderRadius, borderRadius, function (props) {
|
|
55
|
+
return props.isDisabled ? props.disabledBgColor : props.bgColor;
|
|
56
|
+
}, function (props) {
|
|
57
|
+
return props.isDisabled ? props.disabledTextColor : props.textColor;
|
|
58
|
+
}, TypographyStyles_1.MAIN_FONT, TypographyStyles_1.FONT_SIZE.P1, function (props) { return (props.isDisabled ? 'not-allowed' : 'pointer'); }, function (props) { return (props.isDisabled ? 1 : 0.9); });
|
|
59
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/InputWithButton/index.tsx"],"names":[],"mappings":";;;;;;AAAA,+BAAyB;AACzB,0CAAoC;AACpC,uDAAiD;AACjD,gEAA+E;AAkB/E,IAAM,eAAe,GAAoB,UAAC,EAczC;QAbC,UAAU,gBAAA,EACV,aAAa,mBAAA,EACb,MAAM,YAAA,EACN,WAAW,iBAAA,EACX,KAAK,WAAA,EACL,YAAY,kBAAA,EACZ,QAAQ,cAAA,EACR,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,qBAAqB,EAArB,aAAa,mBAAG,KAAK,KAAA,EACrB,sBAAsB,EAAtB,cAAc,mBAAG,KAAK,KAAA,EACtB,oBAAoB,EAApB,YAAY,mBAAG,KAAK,KAAA,EACpB,aAAa,EAAb,KAAK,mBAAG,KAAK,KAAA,EACb,SAAS,eAAA;IAET,IAAM,KAAK,GAAG,IAAA,uBAAQ,GAAE,CAAA;IA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C,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,EAA9C,CAA8C,EAItD,UAAC,KAAK,IAAK,OAAA,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAA5B,CAA4B,CAErD,CAAA"}
|
|
@@ -32,9 +32,9 @@ var colors_1 = require("src/constants/Colors/colors");
|
|
|
32
32
|
function RadioButton(_a) {
|
|
33
33
|
var children = _a.children, disabled = _a.disabled, rest = __rest(_a, ["children", "disabled"]);
|
|
34
34
|
var brand = (0, ThemeContext_1.useTheme)().brand;
|
|
35
|
-
var style = "\n &.ant-radio-button-wrapper {\n ".concat(!disabled ? "color: ".concat(ColorStyles_1.NEUTRAL_COLORS.BLACK, ";") : '', "\n -webkit-font-smoothing: antialiased;\n display: block;\n width: 100
|
|
36
|
-
? "\n border-color: ".concat(brand.primary.default, ";\n color: ").concat(ColorStyles_1.NEUTRAL_COLORS.BLACK, ";\n ")
|
|
37
|
-
: '', "\n }\n\n &.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled),\n &.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover,\n &.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):first-child {\n border: 2px solid ").concat(brand.primary.default, ";\n color: ").concat(brand.primary.default, ";\n\n circle {\n transition: all 0.3s;\n }\n\n circle.center {\n fill: ").concat(colors_1.GREEN.S500, ";\n }\n\n circle.border {\n stroke: ").concat(brand.primary.default, ";\n }\n }\n\n &.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active {\n border-color: ").concat(brand.primary.default, ";\n color: ").concat(brand.primary.default, ";\n }\n\n &.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled).ant-radio-button-wrapper:first-child{\n border-right-color: ").concat(ColorStyles_1.NEUTRAL_COLORS.BLACK, ";\n }\n ");
|
|
35
|
+
var style = "\n &.ant-radio-button-wrapper {\n ".concat(!disabled ? "color: ".concat(ColorStyles_1.NEUTRAL_COLORS.BLACK, " !important;") : '', "\n -webkit-font-smoothing: antialiased !important;\n display: block !important;\n width: 100% !important;\n font-family: ").concat(TypographyStyles_1.MAIN_FONT, " !important;\n font-weight: 400 !important;\n border-radius: 5px !important;\n border: 1px solid ").concat(ColorStyles_1.NEUTRAL_COLORS.G200, " !important;\n user-select: none !important;\n }\n\n .ant-radio-group-large &.ant-radio-button-wrapper {\n height: 44px !important;\n }\n\n &.ant-radio-button-wrapper:first-child, &.ant-radio-button-wrapper:last-child {\n border-radius: 5px !important;\n }\n\n &.ant-radio-button-wrapper:first-child:last-child {\n border-radius: 5px !important;\n }\n\n .ant-radio-group &.ant-radio-button-wrapper {\n font-size: 14px !important;\n }\n\n &.ant-radio-button-wrapper:not(:first-child)::before {\n display: none !important;\n }\n\n &.ant-radio-button-wrapper:hover {\n ").concat(!disabled
|
|
36
|
+
? "\n border-color: ".concat(brand.primary.default, " !important;\n color: ").concat(ColorStyles_1.NEUTRAL_COLORS.BLACK, " !important;\n ")
|
|
37
|
+
: '', "\n }\n\n &.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled),\n &.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover,\n &.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):first-child {\n border: 2px solid ").concat(brand.primary.default, " !important;\n color: ").concat(brand.primary.default, " !important;\n\n circle {\n transition: all 0.3s !important;\n }\n\n circle.center {\n fill: ").concat(colors_1.GREEN.S500, " !important;\n }\n\n circle.border {\n stroke: ").concat(brand.primary.default, " !important;\n }\n }\n\n &.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active {\n border-color: ").concat(brand.primary.default, " !important;\n color: ").concat(brand.primary.default, " !important;\n }\n\n &.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled).ant-radio-button-wrapper:first-child{\n border-right-color: ").concat(ColorStyles_1.NEUTRAL_COLORS.BLACK, " !important;\n }\n ");
|
|
38
38
|
return (react_1.default.createElement(antd_1.Radio.Button, __assign({ className: (0, emotion_1.css)(style), disabled: disabled }, rest),
|
|
39
39
|
react_1.default.createElement("div", { style: {
|
|
40
40
|
display: 'flex',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Radio/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAyB;AACzB,mCAA6B;AAC7B,6BAA4B;AAC5B,sDAAuD;AACvD,gEAAuD;AACvD,uDAAiD;AACjD,sDAAmD;AASnD,SAAS,WAAW,CAAC,EAAsC;IAApC,IAAA,QAAQ,cAAA,EAAE,QAAQ,cAAA,EAAK,IAAI,cAA7B,wBAA+B,CAAF;IACxC,IAAA,KAAK,GAAK,IAAA,uBAAQ,GAAE,MAAf,CAAe;IAE5B,IAAM,KAAK,GAAG,oDAER,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAU,4BAAc,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Radio/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAyB;AACzB,mCAA6B;AAC7B,6BAA4B;AAC5B,sDAAuD;AACvD,gEAAuD;AACvD,uDAAiD;AACjD,sDAAmD;AASnD,SAAS,WAAW,CAAC,EAAsC;IAApC,IAAA,QAAQ,cAAA,EAAE,QAAQ,cAAA,EAAK,IAAI,cAA7B,wBAA+B,CAAF;IACxC,IAAA,KAAK,GAAK,IAAA,uBAAQ,GAAE,MAAf,CAAe;IAE5B,IAAM,KAAK,GAAG,oDAER,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAU,4BAAc,CAAC,KAAK,iBAAc,CAAC,CAAC,CAAC,EAAE,0JAIhD,4BAAS,6HAGJ,4BAAc,CAAC,IAAI,0oBA0BrC,CA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AA,CAC1D,8BAAC,YAAK,CAAC,KAAK,aAAC,IAAI,EAAC,OAAO,EAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAM,KAAK,EAAI,CAClE,EAF2D,CAE3D;IACD,MAAM,EAAE,WAAW;CACpB,CAAA"}
|
|
@@ -27,12 +27,14 @@ var react_1 = require("react");
|
|
|
27
27
|
var emotion_1 = require("emotion");
|
|
28
28
|
var antd_1 = require("antd");
|
|
29
29
|
var TypographyStyles_1 = require("src/shared/TypographyStyles");
|
|
30
|
-
var
|
|
31
|
-
var
|
|
30
|
+
var ThemeContext_1 = require("src/theme/ThemeContext");
|
|
31
|
+
var inputStyles_1 = require("../Input/inputStyles");
|
|
32
32
|
function default_1(_a) {
|
|
33
|
-
var _b = _a.format, format = _b === void 0 ? 'DD
|
|
34
|
-
var
|
|
35
|
-
var
|
|
33
|
+
var _b = _a.format, format = _b === void 0 ? 'DD-MM-YYYY' : _b, _c = _a.size, size = _c === void 0 ? 'large' : _c, rest = __rest(_a, ["format", "size"]);
|
|
34
|
+
var theme = (0, ThemeContext_1.useTheme)();
|
|
35
|
+
var _d = inputStyles_1.SIZE_CONFIG[size], height = _d.height, borderRadius = _d.borderRadius, padding = _d.padding;
|
|
36
|
+
var style = "\n -webkit-font-smoothing: antialiased;\n height: ".concat(height, " !important;\n\n &.ant-picker {\n border-radius: ").concat(borderRadius, " !important;\n border-color: ").concat(theme.color.base.line, " !important;\n padding: ").concat(padding, " !important;\n transition: 0.3s all ease !important;\n\n &:hover {\n border-color: ").concat(theme.color.base.primary2, " !important;\n }\n\n &.ant-picker-focused {\n border-color: ").concat(theme.color.base.primary2, " !important;\n box-shadow: none !important;\n -webkit-box-shadow: none !important;\n }\n\n .ant-picker-active-bar {\n background: ").concat(theme.color.base.primary2, " !important;\n }\n }\n\n\n &.ant-picker > .ant-picker-input {\n font-family: ").concat(TypographyStyles_1.MAIN_FONT, " !important;\n font-style: normal !important;\n font-weight: normal !important;\n font-size: 14px !important;\n line-height: 22px !important;\n color: ").concat(theme.color.base.onNeutral, " !important;\n }\n\n & .ant-picker-input > input {\n color: ").concat(theme.color.base.onNeutral, " !important;\n }\n\n & .ant-picker-input > input::placeholder {\n color: ").concat(theme.color.component.placeholderInput, " !important;\n }\n ");
|
|
37
|
+
var dropdownStyle = "\n .ant-picker-cell.ant-picker-cell-in-view.ant-picker-cell-range-end > .ant-picker-cell-inner {\n background-color: ".concat(theme.color.base.primary2, " !important;\n }\n\n .ant-picker-cell.ant-picker-cell-in-view.ant-picker-cell-range-start > .ant-picker-cell-inner {\n background-color: ").concat(theme.color.base.primary2, " !important;\n }\n\n .ant-picker-cell.ant-picker-cell-in-view {\n &.ant-picker-cell-in-range::before {\n background-color: ").concat(theme.color.interactive.selected, " !important;\n }\n\n &.ant-picker-cell-range-end::before {\n background-color: ").concat(theme.color.interactive.selected, " !important;\n }\n\n &.ant-picker-cell-range-start::before {\n background-color: ").concat(theme.color.interactive.selected, " !important;\n }\n }\n ");
|
|
36
38
|
return (react_1.default.createElement(antd_1.DatePicker.RangePicker, __assign({ className: "".concat((0, emotion_1.css)(style)), format: format, popupClassName: (0, emotion_1.css)(dropdownStyle) }, rest)));
|
|
37
39
|
}
|
|
38
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/RangePicker/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/RangePicker/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAwBA,4BAoFC;AA5GD,+BAAyB;AACzB,mCAA6B;AAC7B,6BAAiC;AACjC,gEAAuD;AACvD,uDAAiD;AACjD,oDAA6D;AAmB7D,mBAAyB,EAIjB;IAHN,IAAA,cAAqB,EAArB,MAAM,mBAAG,YAAY,KAAA,EACrB,YAAc,EAAd,IAAI,mBAAG,OAA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, "__esModule", { value: true });
|
|
3
|
+
exports.OPTIONS_TEXT_SIZE = exports.PLACEHOLDER_TEXT_SIZE = void 0;
|
|
4
|
+
exports.PLACEHOLDER_TEXT_SIZE = {
|
|
5
|
+
sm: 'md',
|
|
6
|
+
lg: 'lg',
|
|
7
|
+
};
|
|
8
|
+
exports.OPTIONS_TEXT_SIZE = {
|
|
9
|
+
sm: 'md',
|
|
10
|
+
lg: 'lg',
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=const.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../src/components/Select/const.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAAG;IACnC,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;CACA,CAAA;AAEG,QAAA,iBAAiB,GAAG;IAC/B,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;CACA,CAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCustomSelectTag = exports.renderHelperText = exports.renderOptions = exports.getPlaceholder = exports.renderLabel = exports.getSuffixIcon = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var theme_1 = require("src/theme/theme");
|
|
6
|
+
var select_1 = require("antd/es/select");
|
|
7
|
+
var index_1 = require("src/components/Tooltip/index");
|
|
8
|
+
var Tag_1 = require("src/components/Tag");
|
|
9
|
+
var Typography_1 = require("src/constants/Typography/Typography");
|
|
10
|
+
var MaterialSymbols_1 = require("src/icons/MaterialSymbols");
|
|
11
|
+
var style_1 = require("./style");
|
|
12
|
+
var const_1 = require("./const");
|
|
13
|
+
var getSuffixIcon = function (secondaryText) { return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
14
|
+
secondaryText && (react_1.default.createElement(Typography_1.Typography.Body, { color: theme_1.straitsXTheme.color.base.onNeutralSecondary, size: "sm" }, secondaryText)),
|
|
15
|
+
react_1.default.createElement(MaterialSymbols_1.MaterialSymbols, { icon: "keyboard_arrow_down" }))); };
|
|
16
|
+
exports.getSuffixIcon = getSuffixIcon;
|
|
17
|
+
var renderLabel = function (label, tooltip) {
|
|
18
|
+
return label ? (react_1.default.createElement(style_1.LabelContainer, null,
|
|
19
|
+
react_1.default.createElement(Typography_1.Typography.Body, { size: "md" }, label),
|
|
20
|
+
tooltip ? (react_1.default.createElement(index_1.default, { placement: "top", title: "I'm Tooltip Component", content: tooltip },
|
|
21
|
+
react_1.default.createElement("span", null,
|
|
22
|
+
react_1.default.createElement(MaterialSymbols_1.MaterialSymbols, { icon: "info", size: "xs" })))) : null)) : null;
|
|
23
|
+
};
|
|
24
|
+
exports.renderLabel = renderLabel;
|
|
25
|
+
var getPlaceholder = function (size, placeholder) {
|
|
26
|
+
return placeholder ? (react_1.default.createElement(Typography_1.Typography.Body, { size: const_1.PLACEHOLDER_TEXT_SIZE[size] }, placeholder)) : null;
|
|
27
|
+
};
|
|
28
|
+
exports.getPlaceholder = getPlaceholder;
|
|
29
|
+
var renderOptions = function (options, size) {
|
|
30
|
+
return options.map(function (_a) {
|
|
31
|
+
var value = _a.value, label = _a.label, Icon = _a.icon, disabled = _a.disabled;
|
|
32
|
+
return (react_1.default.createElement(select_1.default.Option, { key: value, value: value, disabled: disabled },
|
|
33
|
+
react_1.default.createElement(style_1.OptionContainer, null,
|
|
34
|
+
Icon && react_1.default.createElement(Icon, { style: { width: '16px', height: '16px' } }),
|
|
35
|
+
react_1.default.createElement(Typography_1.Typography.Body, { size: const_1.OPTIONS_TEXT_SIZE[size] }, label))));
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
exports.renderOptions = renderOptions;
|
|
39
|
+
var renderHelperText = function (helperText) {
|
|
40
|
+
return helperText ? (react_1.default.createElement(Typography_1.Typography.Body, { color: theme_1.straitsXTheme.color.base.onNeutralSecondary, size: "sm" }, helperText)) : null;
|
|
41
|
+
};
|
|
42
|
+
exports.renderHelperText = renderHelperText;
|
|
43
|
+
var getCustomSelectTag = function (mode, disabled, size) {
|
|
44
|
+
return mode === 'multiple'
|
|
45
|
+
? function (_a) {
|
|
46
|
+
var label = _a.label, onClose = _a.onClose;
|
|
47
|
+
return (react_1.default.createElement(Tag_1.default, { type: disabled ? 'disabled' : 'positive', variant: "removable", size: size, onClick: disabled ? undefined : onClose }, label));
|
|
48
|
+
}
|
|
49
|
+
: undefined;
|
|
50
|
+
};
|
|
51
|
+
exports.getCustomSelectTag = getCustomSelectTag;
|
|
52
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/components/Select/helpers.tsx"],"names":[],"mappings":";;;AAAA,+BAAyB;AACzB,yCAA+C;AAC/C,yCAAsC;AACtC,sDAAkD;AAClD,0CAAoC;AACpC,kEAAgE;AAChE,6DAA2D;AAC3D,iCAAyD;AACzD,iCAAkE;AAE3D,IAAM,aAAa,GAAG,UAAC,aAAsB,IAAK,OAAA,CACvD;IACG,aAAa,IAAI,CAChB,8BAAC,uBAAU,CAAC,IAAI,IACd,KAAK,EAAE,qBAAa,CAAC,KAAK,CAAC,IAAI,CAAC,kBAAkB,EAClD,IAAI,EAAC,IAAI,IAER,aAAa,CACE,CACnB;IACD,8BAAC,iCAAe,IAAC,IAAI,EAAC,qBAAqB,GAAG,CAC7C,CACJ,EAZwD,CAYxD,CAAA;AAZY,QAAA,aAAa,iBAYzB;AAEM,IAAM,WAAW,GAAG,UAAC,KAAa,EAAE,OAA4B;IACrE,OAAA,KAAK,CAAC,CAAC,CAAC,CACN,8BAAC,sBAAc;QACb,8BAAC,uBAAU,CAAC,IAAI,IAAC,IAAI,EAAC,IAAI,IAAE,KAAK,CAAmB;QACnD,OAAO,CAAC,CAAC,CAAC,CACT,8BAAC,eAAO,IACN,SAAS,EAAC,KAAK,EACf,KAAK,EAAC,uBAAuB,EAC7B,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CAAC,kBAAkB,EAClD,IAAI,EAAC,IAAI,IAER,UAAU,CACK,CACnB,CAAC,CAAC,CAAC,IAAI;AAPR,CAOQ,CAAA;AARG,QAAA,gBAAgB,oBAQnB;AACH,IAAM,kBAAkB,GAAG,UAChC,IAAwB,EACxB,QAAiB,EACjB,IAAiB;IAEjB,OAAA,IAAI,KAAK,UAAU;QACjB,CAAC,CAAC,UAAC,EAAmE;gBAAjE,KAAK,WAAA,EAAE,OAAO,aAAA;YAAwD,OAAA,CACvE,8BAAC,aAAG,IACF,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,EACxC,OAAO,EAAC,WAAW,EACnB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,IAEtC,KAAK,CACF,CACP;QATwE,CASxE;QACH,CAAC,CAAC,SAAS;AAXb,CAWa,CAAA;AAhBF,QAAA,kBAAkB,sBAgBhB"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
2
|
var __assign = (this && this.__assign) || function () {
|
|
7
3
|
__assign = Object.assign || function(t) {
|
|
8
4
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -27,31 +23,20 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
27
23
|
};
|
|
28
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
25
|
var react_1 = require("react");
|
|
30
|
-
var emotion_1 = require("emotion");
|
|
31
26
|
var antd_1 = require("antd");
|
|
32
|
-
var Typography_1 = require("src/
|
|
33
|
-
var
|
|
34
|
-
var ColorStyles_1 = require("src/shared/ColorStyles");
|
|
35
|
-
var TypographyStyles_1 = require("src/shared/TypographyStyles");
|
|
27
|
+
var Typography_1 = require("src/constants/Typography/Typography");
|
|
28
|
+
var helpers_1 = require("./helpers");
|
|
36
29
|
var style_1 = require("./style");
|
|
37
|
-
(0, emotion_1.injectGlobal)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .ant-select-dropdown .ant-select-item-option {\n -webkit-font-smoothing: antialiased;\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n padding-top: 10px;\n padding-bottom: 10px;\n }\n\n .ant-select-dropdown .ant-select-item-option-selected:not(.ant-select-item-option-disabled) {\n font-weight: 500;\n }\n\n div.ant-select-dropdown {\n border-radius: 5px;\n max-height: 100vh;\n overflow-y: scroll;\n }\n"], ["\n .ant-select-dropdown .ant-select-item-option {\n -webkit-font-smoothing: antialiased;\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n padding-top: 10px;\n padding-bottom: 10px;\n }\n\n .ant-select-dropdown .ant-select-item-option-selected:not(.ant-select-item-option-disabled) {\n font-weight: 500;\n }\n\n div.ant-select-dropdown {\n border-radius: 5px;\n max-height: 100vh;\n overflow-y: scroll;\n }\n"])), ColorStyles_1.MAIN_COLORS.PRIMARY_BLACK, TypographyStyles_1.MAIN_FONT, TypographyStyles_1.FONT_SIZE.P1);
|
|
38
30
|
var Select = function (_a) {
|
|
39
|
-
var _b = _a.
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Select.Tag = function (_a) {
|
|
48
|
-
var _b = _a.className, className = _b === void 0 ? '' : _b, props = __rest(_a, ["className"]);
|
|
49
|
-
var primary = (0, ThemeContext_1.useTheme)().brand.primary;
|
|
50
|
-
var tagStyle = "\n height: 28px;\n color: #FFFFFF;\n background: ".concat(primary.default, ";\n border-radius: 23px;\n border: 0;\n display: inline-flex;\n align-items: center;\n font-style: normal;\n font-weight: normal;\n font-size: 14px;\n line-height: 20px;\n padding-left: 10px;\n cursor: pointer;\n font-family: ").concat(TypographyStyles_1.MAIN_FONT, ";\n padding-right: 10px;\n margin-right: 4px;\n\n &:hover {\n opacity: 1;\n }\n\n &.ant-tag .anticon-close {\n color: white;\n margin-left: 5px;\n margin-top: 0px;\n }\n ");
|
|
51
|
-
return react_1.default.createElement(antd_1.Tag, __assign({ className: "".concat((0, emotion_1.css)(tagStyle), " ").concat(className) }, props));
|
|
31
|
+
var children = _a.children, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? 'sm' : _c, mode = _a.mode, label = _a.label, labelTooltip = _a.labelTooltip, selectRef = _a.selectRef, placeholder = _a.placeholder, _d = _a.error, error = _d === void 0 ? false : _d, secondaryText = _a.secondaryText, helperText = _a.helperText, options = _a.options, rest = __rest(_a, ["children", "disabled", "size", "mode", "label", "labelTooltip", "selectRef", "placeholder", "error", "secondaryText", "helperText", "options"]);
|
|
32
|
+
var internalRef = (0, react_1.useRef)(null);
|
|
33
|
+
var ref = selectRef || internalRef;
|
|
34
|
+
return (react_1.default.createElement(style_1.SelectContainer, null,
|
|
35
|
+
label && (0, helpers_1.renderLabel)(label, labelTooltip),
|
|
36
|
+
react_1.default.createElement(style_1.StyledAntSelect, __assign({ disabled: disabled, mode: mode, ref: ref, "$size": size, "$mode": mode }, rest, { error: error, dropdownRender: function (menu) { return (react_1.default.createElement(style_1.StyledDropdown, { "$size": size },
|
|
37
|
+
react_1.default.createElement(Typography_1.Typography.Body, { size: size === 'sm' ? 'md' : 'lg' }, menu))); }, dropdownStyle: style_1.dropdownStyle, suffixIcon: (0, helpers_1.getSuffixIcon)(secondaryText), placeholder: (0, helpers_1.getPlaceholder)(size, placeholder), showArrow: true, tagRender: (0, helpers_1.getCustomSelectTag)(mode, disabled, size), maxTagCount: 999 }), options ? (0, helpers_1.renderOptions)(options, size) : children),
|
|
38
|
+
(0, helpers_1.renderHelperText)(helperText)));
|
|
52
39
|
};
|
|
53
|
-
Select.OptGroup = antd_1.Select.OptGroup;
|
|
54
40
|
Select.Option = antd_1.Select.Option;
|
|
55
41
|
exports.default = Select;
|
|
56
|
-
var templateObject_1, templateObject_2;
|
|
57
42
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Select/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Select/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAgD;AAChD,6BAAuD;AAGvD,kEAAgE;AAChE,qCAOkB;AAClB,iCAKgB;AAyBhB,IAAM,MAAM,GAAG,UAAU,EAcjB;IAbN,IAAA,QAAQ,cAAA,EACR,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,YAAW,EAAX,IAAI,mBAAG,IAAI,KAAA,EACX,IAAI,UAAA,EACJ,KAAK,WAAA,EACL,YAAY,kBAAA,EACZ,SAAS,eAAA,EACT,WAAW,iBAAA,EACX,aAAa,EAAb,KAAK,mBAAG,KAAK,KAAA,EACb,aAAa,mBAAA,EACb,UAAU,gBAAA,EACV,OAAO,aAAA,EACJ,IAAI,cAbgB,gJAcxB,CADQ;IAEP,IAAM,WAAW,GAAG,IAAA,cAAM,EAAgB,IAAI,CAAC,CAAA;IAC/C,IAAM,GAAG,GAAG,SAAS,IAAI,WAAW,CAAA;IAEpC,OAAO,CACL,8BAAC,uBAAe;QACb,KAAK,IAAI,IAAA,qBAAW,EAAC,KAAK,EAAE,YAAY,CAAC;QAC1C,8BAAC,uBAAe,aACd,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,GAAG,WACD,IAAI,WACJ,IAAI,IACP,IAAI,IACR,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,UAAC,IAAI,IAAK,OAAA,CACxB,8BAAC,sBAAc,aAAQ,IAAI;gBACzB,8BAAC,uBAAU,CAAC,IAAI,IAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAC/C,IAAI,CACW,CACH,CAClB,EANyB,CAMzB,EACD,aAAa,EAAE,qBAAa,EAC5B,UAAU,EAAE,IAAA,uBAAa,EAAC,aAAa,CAAC,EACxC,WAAW,EAAE,IAAA,wBAAc,EAAC,IAAI,EAAE,WAAW,CAAC,EAC9C,SAAS,QACT,SAAS,EAAE,IAAA,4BAAkB,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,EACnD,WAAW,EAAE,GAAG,KAEf,OAAO,CAAC,CAAC,CAAC,IAAA,uBAAa,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAClC;QACjB,IAAA,0BAAgB,EAAC,UAAU,CAAC,CACb,CACnB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,GAAG,aAAS,CAAC,MAAM,CAAA;AAChC,kBAAe,MAAM,CAAA"}
|
|
@@ -1,74 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
2
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var fontStyles_1 = require("src/constants/fontStyles");
|
|
7
|
+
exports.dropdownStyle = exports.StyledDropdown = exports.StyledAntSelect = exports.SelectContainer = exports.OptionContainer = exports.LabelContainer = void 0;
|
|
8
|
+
var styled_1 = require("@emotion/styled");
|
|
9
|
+
var antd_1 = require("antd");
|
|
7
10
|
var theme_1 = require("src/theme/theme");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return "height: 36px;";
|
|
11
|
+
exports.LabelContainer = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 4px;\n span {\n display: inline-flex;\n cursor: pointer;\n }\n"], ["\n display: flex;\n align-items: center;\n gap: 4px;\n span {\n display: inline-flex;\n cursor: pointer;\n }\n"])));
|
|
12
|
+
exports.OptionContainer = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 8px;\n"], ["\n display: flex;\n align-items: center;\n gap: 8px;\n"])));
|
|
13
|
+
exports.SelectContainer = styled_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 4px;\n min-width: 100px;\n width: 100%;\n"], ["\n display: flex;\n flex-direction: column;\n gap: 4px;\n min-width: 100px;\n width: 100%;\n"])));
|
|
14
|
+
var selectSelectorStyles = function (props) {
|
|
15
|
+
// For multiple select, calculate padding to fit tags within min-height
|
|
16
|
+
// Small: 36px min-height - 24px tag = 12px total padding (6px top + 6px bottom)
|
|
17
|
+
// Large: 48px min-height - 32px tag = 16px total padding (8px top + 8px bottom)
|
|
18
|
+
var getVerticalPadding = function () {
|
|
19
|
+
if (props.$mode === 'multiple') {
|
|
20
|
+
return props.$size === 'sm' ? '6px' : '8px';
|
|
19
21
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return "padding: 0 13px;";
|
|
46
|
-
default:
|
|
47
|
-
return '';
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
function getBaseColor(_a) {
|
|
51
|
-
var type = _a.type;
|
|
52
|
-
switch (type) {
|
|
53
|
-
case 'dropdown':
|
|
54
|
-
return "color: ".concat(ColorStyles_1.NEUTRAL_COLORS.BLACK, ";");
|
|
55
|
-
case 'filter':
|
|
56
|
-
return "color: ".concat(ColorStyles_1.NEUTRAL_COLORS.G400, ";");
|
|
57
|
-
default:
|
|
58
|
-
return '';
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
function default_1(_a) {
|
|
62
|
-
var mode = _a.mode, disabled = _a.disabled, type = _a.type;
|
|
63
|
-
var style = "\n width: 100%;\n ".concat(fontStyles_1.pStyle, "\n ").concat(getBaseColor({ type: type }), "\n cursor: pointer;\n\n &.ant-select-single:not(.ant-select-customize-input) .ant-select-selector, &.ant-select-multiple:not(.ant-select-customize-input) .ant-select-selector {\n ").concat(getBaseHeight({ mode: mode, type: type }), "\n\n\n border-radius: 5px;\n border-color: ").concat(ColorStyles_1.NEUTRAL_COLORS.G200, ";\n ").concat(getSelectorPadding({ mode: mode, type: type }), "\n\n &:hover {\n ").concat(!disabled
|
|
64
|
-
? "border-color: ".concat(theme_1.straitsXTheme.brand.primary.default, ";")
|
|
65
|
-
: '', "\n }\n\n &:active .ant-select-selection-placeholder {\n ").concat(type === 'filter'
|
|
66
|
-
? "\n color: ".concat(theme_1.straitsXTheme.brand.primary.default, ";\n ")
|
|
67
|
-
: '', "\n }\n }\n\n &.ant-select-single.ant-select-focused:not(.ant-select-customize-input) .ant-select-selector, &.ant-select-multiple.ant-select-focused:not(.ant-select-customize-input) .ant-select-selector {\n border-color: ").concat(theme_1.straitsXTheme.brand.primary.default, ";\n -webkit-box-shadow: 0 0 0 2px ").concat(theme_1.straitsXTheme.brand.primary.background, ";\n box-shadow: 0 0 0 2px ").concat(theme_1.straitsXTheme.brand.primary.background, ";\n }\n\n &.ant-select-single .ant-select-selector .ant-select-selection-placeholder {\n display: flex;\n align-items: center;\n line-height: 34px;\n ").concat(getPlaceholderColor({ type: type, disabled: disabled }), "\n }\n\n &.ant-select-multiple .ant-select-selection-placeholder {\n display: flex;\n align-items: center;\n line-height: 34px;\n ").concat(getPlaceholderColor({ type: type, disabled: disabled }), "\n }\n\n &.ant-select-single:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-search-input {\n height: 100%;\n }\n\n & .ant-select-selection-search > input {\n color: ").concat(ColorStyles_1.NEUTRAL_COLORS.BLACK, ";\n padding-bottom: 2px;\n }\n\n &.ant-select-single .ant-select-selector .ant-select-selection-item {\n display: flex;\n align-items: center;\n line-height: 34px;\n color: ").concat(ColorStyles_1.MAIN_COLORS.PRIMARY_BLACK, ";\n\n ").concat(type === 'filter' && !disabled
|
|
68
|
-
? "\n color: ".concat(ColorStyles_1.MAIN_COLORS.PRIMARY_BLACK, ";\n ")
|
|
69
|
-
: '', "\n }\n\n &.ant-select-single.ant-select-show-arrow .ant-select-selection-item {\n padding-right: 15px;\n }\n\n &.ant-select-multiple .ant-select-selection-item {\n height: 28px;\n color: #FFFFFF;\n background: ").concat(theme_1.straitsXTheme.brand.primary.default, ";\n border-radius: 23px;\n border: 0;\n display: inline-flex;\n align-items: center;\n font-family: \"Hanken Grotesk\", Inter;\n font-style: normal;\n font-weight: normal;\n font-size: 14px;\n line-height: 20px;\n padding-left: 10px;\n cursor: pointer;\n font-family: ").concat(TypographyStyles_1.MAIN_FONT, ";\n }\n\n &.ant-select-multiple .ant-select-selection-item-remove {\n font-size: 10px;\n color: #FFFFFF;\n padding-right: 5px;\n margin-top: 2px;\n }\n\n &.ant-select-multiple .ant-select-selection-item-content {\n margin-right: 3px;\n }\n\n &.ant-select-multiple .zoom-leave {\n display: none;\n }\n\n &.ant-select-multiple .ant-select-selection-placeholder {\n left: 16px;\n ").concat(type === 'filter' && !disabled
|
|
70
|
-
? "\n color: ".concat(ColorStyles_1.MAIN_COLORS.PRIMARY_BLACK, ";\n opacity: 1;\n ")
|
|
71
|
-
: '', "\n }\n\n & .ant-select-selection-placeholder {\n opacity: 1;\n }\n\n &.ant-select-disabled.ant-select-single:not(.ant-select-customize-input) .ant-select-selector {\n color: ").concat(ColorStyles_1.NEUTRAL_COLORS.BLACK, ";\n }\n\n &.ant-select-disabled.ant-select-single:not(.ant-select-customize-input) .ant-select-selector {\n background: #F6F7F9;\n }\n\n & .ant-select-arrow .anticon.anticon-search {\n transform: scale(1.3);\n margin-left: -10px;\n }\n\n &.ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector {\n border-color: ").concat(theme_1.straitsXTheme.brand.primary.default, ";\n -webkit-box-shadow: 0 0 0 2px ").concat(theme_1.straitsXTheme.brand.primary.default, "33;\n box-shadow: 0 0 0 2px ").concat(theme_1.straitsXTheme.brand.primary.default, "33;\n }\n ");
|
|
72
|
-
return style;
|
|
73
|
-
}
|
|
22
|
+
return '12px';
|
|
23
|
+
};
|
|
24
|
+
var verticalPadding = getVerticalPadding();
|
|
25
|
+
return "\n .ant-select-selector {\n border-radius: ".concat(props.$size === 'sm' ? '8px' : '12px', " !important;\n position: relative !important;\n display: flex;\n align-items: ").concat(props.$mode === 'multiple' ? 'flex-start' : 'center', " !important;\n padding: ").concat(verticalPadding, " 16px !important;\n\n min-height: ").concat(props.$size === 'sm' ? '36px' : '48px', " !important;\n ").concat(props.$mode !== 'multiple' ? "height: ".concat(props.$size === 'sm' ? '36px' : '48px', " !important;") : 'height: auto !important;', "\n\n background: ").concat(props.disabled
|
|
26
|
+
? theme_1.straitsXTheme.color.surface.disabledSurface
|
|
27
|
+
: theme_1.straitsXTheme.color.surface.neutral, " !important;\n\n border: 1px solid ").concat(props.error
|
|
28
|
+
? theme_1.straitsXTheme.color.status.critical
|
|
29
|
+
: theme_1.straitsXTheme.color.base.line, " !important;\n }\n");
|
|
30
|
+
};
|
|
31
|
+
var selectHoverFocusStyles = function (props) { return "\n &:hover .ant-select-selector,\n &.ant-select-focused .ant-select-selector {\n ".concat(!props.disabled &&
|
|
32
|
+
"\n box-shadow: 0 0 0 1px ".concat(theme_1.straitsXTheme.color.base.onNeutral, "20 !important;\n border: 1px solid ").concat(props.error
|
|
33
|
+
? theme_1.straitsXTheme.color.status.critical
|
|
34
|
+
: theme_1.straitsXTheme.color.base.primary2, " !important;\n "), "\n }\n"); };
|
|
35
|
+
var selectPlaceholderStyles = "\n .ant-select-selection-placeholder {\n height: 100% !important;\n display: flex;\n align-items: center;\n \n span {\n color: ".concat(theme_1.straitsXTheme.color.component.placeholderInput, " !important;\n }\n }\n");
|
|
36
|
+
var selectOverflowStyles = function (props) { return "\n .ant-select-selection-overflow {\n gap: 8px;\n ".concat(props.$mode === 'multiple' ? 'flex-wrap: wrap !important;' : '', "\n ").concat(props.$mode === 'multiple' ? 'align-content: center !important;' : '', "\n }\n"); };
|
|
37
|
+
var selectSelectedItemStyles = "\n .ant-select-selection-item {\n display: flex !important;\n align-items: center !important;\n color: ".concat(theme_1.straitsXTheme.color.base.onNeutral, " !important;\n }\n");
|
|
38
|
+
var selectArrowStyles = "\n .ant-select-arrow {\n display: flex !important;\n align-items: center !important;\n gap: 8px !important;\n width: auto !important;\n align-self: center !important;\n \n span {\n color: ".concat(theme_1.straitsXTheme.color.base.onNeutral, " !important;\n }\n }\n");
|
|
39
|
+
exports.StyledAntSelect = (0, styled_1.default)(antd_1.Select)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n"], ["\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n"])), function (props) { return selectSelectorStyles(props); }, function (props) { return selectHoverFocusStyles(props); }, selectPlaceholderStyles, function (props) { return selectOverflowStyles(props); }, selectSelectedItemStyles, selectArrowStyles);
|
|
40
|
+
var dropdownBaseItemStyles = "\n .rc-virtual-list-holder-inner {\n gap: 4px;\n }\n .ant-select-item {\n color: ".concat(theme_1.straitsXTheme.color.base.onNeutral, " !important;\n padding: 12px !important;\n }\n");
|
|
41
|
+
var dropdownSelectedOptionStyles = "\n .ant-select-item-option-selected {\n background: #d7efe2 !important;\n position: relative !important;\n \n .anticon {\n display: none !important;\n }\n \n &::after {\n content: 'check' !important;\n font-family: 'Material Symbols Rounded' !important;\n color: ".concat(theme_1.straitsXTheme.color.status.positive, " !important;\n position: absolute !important;\n right: 12px !important;\n top: 50% !important;\n transform: translateY(-50%) !important;\n font-size: 16px !important;\n }\n }\n");
|
|
42
|
+
var dropdownInteractiveStyles = "\n .ant-select-item:hover {\n background: ".concat(theme_1.straitsXTheme.color.interactive.hoverSurface, " !important;\n }\n \n .ant-select-item:active {\n background: ").concat(theme_1.straitsXTheme.color.interactive.pressedSurface, " !important;\n }\n");
|
|
43
|
+
var dropdownDisabledOptionStyles = "\n .ant-select-item-option-disabled,\n .ant-select-item-option-disabled:hover {\n background: ".concat(theme_1.straitsXTheme.color.surface.disabledSurface, " !important;\n span { \n color: ").concat(theme_1.straitsXTheme.color.surface.disabledOnSurface, " !important;\n }\n }\n");
|
|
44
|
+
exports.StyledDropdown = styled_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n ", "\n"], ["\n ", "\n ", "\n ", "\n ", "\n"])), dropdownBaseItemStyles, dropdownSelectedOptionStyles, dropdownInteractiveStyles, dropdownDisabledOptionStyles);
|
|
45
|
+
exports.dropdownStyle = { padding: 0, borderRadius: '12px' };
|
|
46
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
74
47
|
//# sourceMappingURL=style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../../src/components/Select/style.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","sources":["../../../src/components/Select/style.ts"],"names":[],"mappings":";;;;;;;AAA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KAAK,IAAK,OAAA,sBAAsB,CAAC,KAAK,CAAC,EAA7B,CAA6B,EACxC,uBAAuB,EACvB,UAAC,KAAK,IAAK,OAAA,oBAAoB,CAAC,KAAK,CAAC,EAA3B,CAA2B,EACtC,wBAAwB,EACxB,iBAAiB,EACpB;AAED,IAAM,sBAAsB,GAAG,oGAKlB,qBAAa,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,uDAG9C,CAAA;AAED,IAAM,4BAA4B,GAAG,yTAYtB,qBAAa,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,kNAQjD,CAAA;AAED,IAAM,yBAAyB,GAAG,wDAEhB,qBAAa,CAAC,KAAK,CAAC,WAAW,CAAC,YAAY,iFAI5C,qBAAa,CAAC,KAAK,CAAC,WAAW,CAAC,cAAc,wBAE/D,CAAA;AAED,IAAM,4BAA4B,GAAG,6GAGnB,qBAAa,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,mDAEhD,qBAAa,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,+BAGzD,CAAA;AAEY,QAAA,cAAc,GAAG,gBAAM,CAAC,GAAG,uGAAwB,MAC5D,EAAsB,MACtB,EAA4B,MAC5B,EAAyB,MACzB,EAA4B,IAC/B,KAJG,sBAAsB,EACtB,4BAA4B,EAC5B,yBAAyB,EACzB,4BAA4B,EAC/B;AAEY,QAAA,aAAa,GAAG,EAAE,OAAO,EAAE,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -9,7 +9,7 @@ var react_1 = require("react");
|
|
|
9
9
|
var styled_1 = require("@emotion/styled");
|
|
10
10
|
var MaterialSymbols_1 = require("src/icons/MaterialSymbols");
|
|
11
11
|
var Typography_1 = require("src/constants/Typography/Typography");
|
|
12
|
-
var
|
|
12
|
+
var index_1 = require("src/components/Button/index");
|
|
13
13
|
var const_1 = require("src/components/Tag/const");
|
|
14
14
|
function getColorByProperty(type, variant, property) {
|
|
15
15
|
switch (variant) {
|
|
@@ -28,13 +28,20 @@ function default_1(_a) {
|
|
|
28
28
|
return (react_1.default.createElement(Base, { type: type, size: size, variant: variant, onClick: variant !== 'removable' ? onClick : undefined },
|
|
29
29
|
showIcon && type !== 'disabled' && (react_1.default.createElement(MaterialSymbols_1.MaterialSymbols, { icon: const_1.ICON_MAP[type], size: const_1.ICON_SIZE_MAP[size], color: getColorByProperty(type, variant, 'icon') })),
|
|
30
30
|
react_1.default.createElement(Typography_1.Typography.Body, { size: size, color: getColorByProperty(type, variant, 'text') }, children),
|
|
31
|
-
variant === 'removable' && (react_1.default.createElement(CloseButton, {
|
|
31
|
+
variant === 'removable' && (react_1.default.createElement(CloseButton, { onMouseDown: function (e) {
|
|
32
|
+
e.preventDefault();
|
|
33
|
+
e.stopPropagation();
|
|
34
|
+
}, onClick: function (e) {
|
|
35
|
+
e.preventDefault();
|
|
36
|
+
e.stopPropagation();
|
|
37
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
38
|
+
}, type: "tertiary", icon: react_1.default.createElement(MaterialSymbols_1.MaterialSymbols, { icon: "close", size: const_1.ICON_SIZE_MAP[size], color: getColorByProperty(type, variant, 'icon') }) }))));
|
|
32
39
|
}
|
|
33
40
|
var getAdditionalStyles = function (_a) {
|
|
34
41
|
var type = _a.type, _b = _a.variant, variant = _b === void 0 ? 'outlined' : _b, _c = _a.size, size = _c === void 0 ? 'sm' : _c, onClick = _a.onClick;
|
|
35
42
|
return "\n border-radius: ".concat(variant === 'removable' ? '999px' : '4px', ";\n min-height: ").concat(size === 'sm' ? '24px' : '32px', ";\n background-color: ").concat(type && variant ? getColorByProperty(type, variant, 'base') : 'transparent', ";\n border: 1px solid ").concat(type && variant ? getColorByProperty(type, variant, 'border') : 'transparent', ";\n padding-inline: ").concat(variant === 'removable' ? '12px' : '8px', ";\n cursor: ").concat(onClick ? 'pointer' : 'default', ";\n\n");
|
|
36
43
|
};
|
|
37
|
-
var CloseButton = (0, styled_1.default)(
|
|
44
|
+
var CloseButton = (0, styled_1.default)(index_1.default)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n && {\n padding: 0 !important;\n width: auto !important;\n height: auto !important;\n }\n\n &&:hover {\n background: transparent !important;\n }\n\n &&:focus {\n background: transparent !important;\n }\n\n &&:active {\n background: transparent !important;\n }\n"], ["\n && {\n padding: 0 !important;\n width: auto !important;\n height: auto !important;\n }\n\n &&:hover {\n background: transparent !important;\n }\n\n &&:focus {\n background: transparent !important;\n }\n\n &&:active {\n background: transparent !important;\n }\n"])));
|
|
38
45
|
var Base = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n gap: 4px;\n align-items: center;\n justify-content: center;\n width: fit-content;\n height: fit-content;\n text-transform: capitalize;\n\n ", ";\n"], ["\n display: flex;\n flex-direction: row;\n gap: 4px;\n align-items: center;\n justify-content: center;\n width: fit-content;\n height: fit-content;\n text-transform: capitalize;\n\n ", ";\n"])), function (props) { return getAdditionalStyles(props); });
|
|
39
46
|
var templateObject_1, templateObject_2;
|
|
40
47
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Tag/index.tsx"],"names":[],"mappings":";;;;;;AA+CA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Tag/index.tsx"],"names":[],"mappings":";;;;;;AA+CA,4BAmDC;AAlGD,+BAAyB;AACzB,0CAAoC;AACpC,6DAA2D;AAC3D,kEAAgE;AAChE,qDAAgD;AAChD,kDAMiC;AAmBjC,SAAS,kBAAkB,CACzB,IAAwD,EACxD,OAAmB,EACnB,QAAuB;IAEvB,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,UAAU;YACb,OAAO,2BAAmB,CAAC,IAAuB,CAAC,CAAC,QAAQ,CAAC,CAAA;QAC/D,KAAK,QAAQ;YACX,OAAO,yBAAiB,CAAC,IAAqB,CAAC,CAAC,QAAQ,CAAC,C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|
@@ -43,7 +43,7 @@ function default_1(_a) {
|
|
|
43
43
|
react_1.default.createElement(DismissButton, { onClick: onDismissButtonClick }, dismissTitle),
|
|
44
44
|
react_1.default.createElement(ActionButton, { onClick: onActionButtonClick }, actionTitle)))), mouseEnterDelay: mouseEnterDelay, mouseLeaveDelay: mouseLeaveDelay }, children));
|
|
45
45
|
}
|
|
46
|
-
var defaultOverlayStyle = (0, emotion_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n max-width: 200px;\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n color: ", ";\n box-shadow: none;\n\n .ant-tooltip-inner {\n padding: 12px;\n border-radius: 8px;\n box-shadow: none;\n background-color: ", ";\n }\n\n ", " {\n max-width: 250px;\n }\n\n .ant-tooltip-arrow {\n width: 16px;\n height: 16px;\n\n .ant-tooltip-arrow-content {\n background-color: ", ";\n box-shadow: none;\n width: 16px;\n height: 16px;\n }\n }\n
|
|
46
|
+
var defaultOverlayStyle = (0, emotion_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n max-width: 200px;\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n color: ", ";\n box-shadow: none;\n\n .ant-tooltip-inner {\n padding: 12px;\n border-radius: 8px;\n box-shadow: none;\n background-color: ", ";\n }\n\n ", " {\n max-width: 250px;\n }\n\n .ant-tooltip-arrow {\n width: 16px;\n height: 16px;\n\n .ant-tooltip-arrow-content {\n background-color: ", ";\n box-shadow: none;\n width: 16px;\n height: 16px;\n }\n }\n"], ["\n max-width: 200px;\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n color: ", ";\n box-shadow: none;\n\n .ant-tooltip-inner {\n padding: 12px;\n border-radius: 8px;\n box-shadow: none;\n background-color: ", ";\n }\n\n ", " {\n max-width: 250px;\n }\n\n .ant-tooltip-arrow {\n width: 16px;\n height: 16px;\n\n .ant-tooltip-arrow-content {\n background-color: ", ";\n box-shadow: none;\n width: 16px;\n height: 16px;\n }\n }\n"])), fontStyles_1.MAIN_FONT, TypographyStyles_1.FONT_SIZE.P1, TypographyStyles_1.FONT_WEIGHT.REGULAR, theme_1.straitsXTheme.text.white, theme_1.straitsXTheme.brand.primary.contrast, breakPoints_1.DESKTOP_BREAKPOINT, theme_1.straitsXTheme.brand.primary.contrast);
|
|
47
47
|
var Container = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n line-height: 22px;\n"], ["\n line-height: 22px;\n"])));
|
|
48
48
|
var FooterContainer = styled_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin: 24px 0 0 0;\n display: flex;\n justify-content: flex-end;\n\n a {\n margin: 0 0 0 20px;\n }\n"], ["\n margin: 24px 0 0 0;\n display: flex;\n justify-content: flex-end;\n\n a {\n margin: 0 0 0 20px;\n }\n"])));
|
|
49
49
|
var Badge = styled_1.default.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: inline-block;\n margin: 0 0 0 8px;\n padding: 2px 6px;\n background-color: ", ";\n color: ", ";\n font-size: ", ";\n font-weight: ", ";\n border-radius: 4px;\n"], ["\n display: inline-block;\n margin: 0 0 0 8px;\n padding: 2px 6px;\n background-color: ", ";\n color: ", ";\n font-size: ", ";\n font-weight: ", ";\n border-radius: 4px;\n"])), ColorStyles_1.GREEN_COLORS.G400, theme_1.straitsXTheme.text.white, TypographyStyles_1.FONT_SIZE.SMALL, TypographyStyles_1.FONT_WEIGHT.BOLD);
|