@xfers/design-system 5.0.0-dev.faa999c2a9 → 5.1.0-dev.f8f25fc0d8
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/StraitsXDecoVertical-70fd7a91.js +2 -0
- package/cjs/StraitsXDecoVertical-70fd7a91.js.map +1 -0
- package/cjs/StraitsXPersonalAccountLightLogo-44c49e48.js +2 -0
- package/cjs/StraitsXPersonalAccountLightLogo-44c49e48.js.map +1 -0
- package/cjs/icons.js +1 -1
- package/cjs/icons.js.map +1 -1
- package/cjs/index.js +4 -4
- package/cjs/index.js.map +1 -1
- package/cjs/logos.js +1 -1
- package/dist/components/DatePicker/index.js +18 -16
- 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 -55
- 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/RangePicker/index.js +9 -7
- 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 +46 -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/icons/Coins.js +23 -0
- package/dist/icons/Coins.js.map +1 -0
- package/dist/icons/MintSetupWallet.js +86 -0
- package/dist/icons/MintSetupWallet.js.map +1 -0
- package/dist/icons/StraitsXDecoVertical.js +25 -0
- package/dist/icons/StraitsXDecoVertical.js.map +1 -0
- package/dist/icons/SwitchAccount.js +20 -0
- package/dist/icons/SwitchAccount.js.map +1 -0
- package/dist/icons/index.js +10 -2
- 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 +5 -2
- package/dist/logos/Base.js.map +1 -1
- package/dist/shared/TypographyStyles.js +13 -1
- package/dist/shared/TypographyStyles.js.map +1 -1
- package/dist/shared/momentDatePicker.js +9 -0
- package/dist/shared/momentDatePicker.js.map +1 -0
- 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 +5 -2
- 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 +19 -2
- package/dist/types/icons/Coins.d.ts +3 -0
- package/dist/types/icons/MintSetupWallet.d.ts +3 -0
- package/dist/types/icons/StraitsXDecoVertical.d.ts +3 -0
- package/dist/types/icons/SwitchAccount.d.ts +3 -0
- package/dist/types/icons/index.d.ts +4 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/shared/TypographyStyles.d.ts +13 -0
- package/dist/types/shared/momentDatePicker.d.ts +34 -0
- package/es/StraitsXDecoVertical-0243d5ce.js +2 -0
- package/es/StraitsXDecoVertical-0243d5ce.js.map +1 -0
- package/es/{StraitsXPersonalAccountLightLogo-2319d5c0.js → StraitsXPersonalAccountLightLogo-17fc73c1.js} +2 -2
- package/es/{StraitsXPersonalAccountLightLogo-2319d5c0.js.map → StraitsXPersonalAccountLightLogo-17fc73c1.js.map} +1 -1
- package/es/icons.js +1 -1
- package/es/icons.js.map +1 -1
- package/es/index.js +4 -4
- package/es/index.js.map +1 -1
- package/es/logos.js +1 -1
- package/package.json +1 -1
- package/cjs/StraitsXPersonalAccountLightLogo-042665bf.js +0 -2
- package/cjs/StraitsXPersonalAccountLightLogo-042665bf.js.map +0 -1
- package/cjs/Time-7085cdb3.js +0 -2
- package/cjs/Time-7085cdb3.js.map +0 -1
- package/es/Time-740bf76c.js +0 -2
- package/es/Time-740bf76c.js.map +0 -1
package/cjs/logos.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("./StraitsXPersonalAccountLightLogo-
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("./StraitsXPersonalAccountLightLogo-44c49e48.js");require("./_tslib-33b9f00a.js"),require("react"),exports.Alfamart=o.SvgAlfamart,exports.Alfamidi=o.SvgAlfamidi,exports.Anz=o.SvgAnz,exports.Arbitrum=o.Arbitrum,exports.Avalanche=o.Avalanche,exports.Base=o.Base,exports.Bca=o.SvgBca,exports.Bea=o.SvgBea,exports.Binance=o.SvgBinance,exports.Bitgo=o.SvgBitgo,exports.Bnbsmart=o.BnbSmart,exports.Bni=o.SvgBni,exports.Bnp=o.SvgBnp,exports.Boc=o.SvgBoc,exports.Bri=o.SvgBri,exports.Bsi=o.SvgBsi,exports.Bss=o.SvgBss,exports.Cimb=o.SvgCimb,exports.Citi=o.SvgCiti,exports.Coinhako=o.SvgCoinhako,exports.Coinut=o.SvgCoinut,exports.CrossLogo=o.SvgCrossLogo,exports.Crypto=o.SvgCrypto,exports.DanPlusDan=o.SvgDanPlusDan,exports.Dana=o.SvgDana,exports.Danamon=o.SvgDanamon,exports.DarkStraitsXLogo=o.SvgDarkStraitsXLogo,exports.DarkStraitsXUserInfoBarLogo=o.SvgDarkStraitsXUserInfoBarLogo,exports.Dbag=o.SvgDbag,exports.Dbs=o.SvgDbs,exports.Dextf=o.SvgDextf,exports.EarnPiggyBank=o.SvgEarnPiggyBank,exports.EmptyStraitsX=o.EmptyStraitsX,exports.Ethereum=o.SvgEthereum,exports.FaceScan=o.FaceScan,exports.Fazz=o.SvgFazzLogo,exports.Feb=o.SvgFeb,exports.Finblox=o.SvgFinblox,exports.Fireblocks=o.SvgFireblocks,exports.GoPay=o.SvgGoPay,exports.Gpn=o.SvgGpn,exports.Hana=o.SvgHana,exports.Hedera=o.SvgHedera,exports.Hlb=o.SvgHlb,exports.Hodlnaut=o.SvgHodlnaut,exports.Hsbc=o.SvgHsbc,exports.Icbc=o.SvgIcbc,exports.Icici=o.SvgIcici,exports.IdFlag=o.SvgIdFlag,exports.IdrLogo=o.SvgIdrLogo,exports.Indomaret=o.SvgIndomaret,exports.InfoLogo=o.SvgInfoLogo,exports.InterestCompoundedDaily=o.SvgInterestCompoundedDaily,exports.Jcb=o.SvgJcb,exports.Jpmc=o.SvgSmbc,exports.Jumio=o.SvgJumio,exports.Lawson=o.SvgLawson,exports.LedgerVault=o.SvgLedgerVault,exports.LevelDown=o.LevelDown,exports.LightStraitsXLogo=o.SvgLightStraitsXLogo,exports.LinkAja=o.SvgLinkAja,exports.Liquid=o.SvgLiquid,exports.Mandiri=o.SvgMandiri,exports.Mastercard=o.SvgMastercard,exports.Mbb=o.SvgMbb,exports.Miz=o.SvgMiz,exports.Mufg=o.SvgMufg,exports.MyInfoLogo=o.SvgMyInfoLogo,exports.NoFees=o.SvgNoFees,exports.NoLockInPeriod=o.SvgNoLockInPeriod,exports.NotesBell=o.NotesBell,exports.OVO=o.SvgOvo,exports.Ocbc=o.SvgOcbc,exports.OnchainCustodian=o.SvgOnchainCustodian,exports.Permata=o.SvgPermata,exports.Polygon=o.SvgPolygon,exports.Posb=o.SvgPosb,exports.QcpCapital=o.SvgQcpCapital,exports.Qris=o.SvgQris,exports.Rbs=o.SvgRbs,exports.Rhb=o.SvgRhb,exports.Ripple=o.Ripple,exports.Scb=o.SvgScb,exports.SendLogo=o.SvgSendLogo,exports.SgdLogo=o.SvgSgdLogo,exports.ShopeePay=o.SvgShopeePay,exports.Sifl=o.SvgSifl,exports.Smbc=o.SvgSmbc$1,exports.Solana=o.Solana,exports.Sparrow=o.SvgSparrow,exports.StateError=o.StateError,exports.StateSuccess=o.StateSuccess,exports.StraitsXBusinessAccountDarkLogo=o.SvgStraitsXBusinessAccountDarkLogo,exports.StraitsXBusinessAccountLightLogo=o.SvgStraitsXBusinessAccountLightLogo,exports.StraitsXLogo=o.SvgStraitsXLogo,exports.StraitsXMyInfo=o.SvgStraitsXMyInfo,exports.StraitsXPersonalAccountDarkLogo=o.SvgStraitsXPersonalAccountDarkLogo,exports.StraitsXPersonalAccountLightLogo=o.SvgStraitsXPersonalAccountLightLogo,exports.StraitsXSandboxLogo=o.SvgStraitsXSandboxLogo,exports.StraitsxSandboxLogo=o.SvgStraitsxSandboxLogo,exports.Target=o.Target,exports.ThreeDSecure=o.SvgThreedsecure,exports.ThreeDotsLogo=o.SvgThreeDotsLogo,exports.TickLogo=o.SvgTickLogo,exports.TokenizeXchange=o.SvgTokenizeXchange,exports.Tron=o.Tron,exports.Trwi=o.SvgTrwi,exports.Unagii=o.SvgUnagii,exports.Uniswap=o.SvgUniswap,exports.Uob=o.SvgUob,exports.UsFlag=o.SvgUsFlag,exports.UsdLogo=o.SvgUsdLogo,exports.UsdcLogo=o.SvgUsdcLogo,exports.UsdpLogo=o.SvgUsdpLogo,exports.UsdtLogo=o.SvgUsdtLogo,exports.VecDeposits=o.SvgVecDeposits,exports.VecDesktop=o.SvgVecDesktop,exports.VecEmpty=o.SvgVecEmpty,exports.VecEmptyPlain=o.SvgVecEmptyPlain,exports.VecEmptyPlainGreen=o.SvgVecEmptyPlainGreen,exports.VecMobile=o.SvgVecMobile,exports.VecRecipients=o.SvgVecRecipients,exports.VecThumbnailDoc=o.SvgVecThumbnailDoc,exports.Visa=o.SvgVisa,exports.WalletLogo=o.SvgWalletLogo,exports.XfersLogo=o.SvgXfersLogo,exports.XfersSandboxLogo=o.SvgXfersSandboxLogo,exports.XidrLogo=o.SvgXidrLogo,exports.XsgdLogo=o.SvgXsgdLogo,exports.XusdLogo=o.SvgXusdLogo,exports.Zillet=o.SvgZillet,exports.Zilliqa=o.SvgZilliqa,exports.Zilswap=o.SvgZilswap;
|
|
2
2
|
//# sourceMappingURL=logos.js.map
|
|
@@ -26,25 +26,27 @@ exports.default = default_1;
|
|
|
26
26
|
var react_1 = require("react");
|
|
27
27
|
var emotion_1 = require("emotion");
|
|
28
28
|
var antd_1 = require("antd");
|
|
29
|
-
var Typography_1 = require("src/components/Typography");
|
|
30
29
|
var TypographyStyles_1 = require("src/shared/TypographyStyles");
|
|
31
|
-
var
|
|
30
|
+
var MaterialSymbols_1 = require("src/icons/MaterialSymbols/MaterialSymbols");
|
|
32
31
|
var ThemeContext_1 = require("src/theme/ThemeContext");
|
|
33
|
-
var
|
|
32
|
+
var inputStyles_1 = require("../Input/inputStyles");
|
|
33
|
+
var InputLabel_1 = require("../Input/InputLabel");
|
|
34
|
+
var HelperText_1 = require("../Input/HelperText");
|
|
34
35
|
function default_1(_a) {
|
|
35
|
-
var _b = _a.disabled, disabled = _b === void 0 ? false : _b, label = _a.label, _c = _a.required, required = _c === void 0 ? false : _c, rest = __rest(_a, ["disabled", "label", "required"]);
|
|
36
|
-
var
|
|
37
|
-
var
|
|
36
|
+
var _b = _a.disabled, disabled = _b === void 0 ? false : _b, label = _a.label, _c = _a.required, required = _c === void 0 ? false : _c, _d = _a.optional, optional = _d === void 0 ? false : _d, _e = _a.size, size = _e === void 0 ? 'large' : _e, _f = _a.error, error = _f === void 0 ? false : _f, helperText = _a.helperText, showInfoIcon = _a.showInfoIcon, onInfoClick = _a.onInfoClick, rest = __rest(_a, ["disabled", "label", "required", "optional", "size", "error", "helperText", "showInfoIcon", "onInfoClick"]);
|
|
37
|
+
var theme = (0, ThemeContext_1.useTheme)();
|
|
38
|
+
var _g = inputStyles_1.SIZE_CONFIG[size], height = _g.height, borderRadius = _g.borderRadius, padding = _g.padding;
|
|
39
|
+
var borderColor = error
|
|
40
|
+
? theme.color.status.critical
|
|
41
|
+
: theme.color.base.line;
|
|
42
|
+
var style = "\n -webkit-font-smoothing: antialiased;\n height: ".concat(height, " !important;\n width: 100% !important;\n\n ").concat(disabled
|
|
38
43
|
? "\n pointer-events: none !important;\n "
|
|
39
|
-
: '', "\n\n &.ant-picker {\n border-radius:
|
|
40
|
-
var dropdownStyle = "\n .ant-picker-cell-in-view.ant-picker-cell-selected .ant-picker-cell-inner{\n background-color: ".concat(
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
label,
|
|
47
|
-
required && react_1.default.createElement(Asterisk, null))),
|
|
48
|
-
react_1.default.createElement(antd_1.DatePicker, __assign({ className: "".concat((0, emotion_1.css)(style)), popupClassName: (0, emotion_1.css)(dropdownStyle), disabled: disabled }, rest))));
|
|
44
|
+
: '', "\n\n &.ant-picker {\n border-radius: ").concat(borderRadius, " !important;\n border-color: ").concat(borderColor, " !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\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 font-size: 14px !important;\n color: ").concat(theme.color.base.onNeutral, " !important;\n }\n\n & .ant-picker-input > input::placeholder {\n font-size: 14px !important;\n color: ").concat(theme.color.component.placeholderInput, " !important;\n }\n\n &.ant-picker.ant-picker-disabled {\n background: ").concat(theme.color.surface.disabledSurface, " !important;\n border: 1px solid ").concat(theme.color.base.line, " !important;\n }\n\n & .ant-picker-input > input[disabled] {\n color: ").concat(theme.color.base.onNeutral, " !important;\n -webkit-text-fill-color: ").concat(theme.color.base.onNeutral, " !important;\n }\n\n & .ant-picker-cell-in-view {\n &.ant-picker-cell-today .ant-picker-cell-inner {\n &:before {\n border-color: ").concat(theme.color.base.primary2, " !important;\n }\n }\n\n &ant-picker-cell-range-end .ant-picker-cell-inner,\n &ant-picker-cell-range-start .ant-picker-cell-inner,\n &ant-picker-cell-selected .ant-picker-cell-inner {\n background: ").concat(theme.color.base.primary2, " !important;\n }\n }\n ");
|
|
45
|
+
var dropdownStyle = "\n .ant-picker-cell-in-view.ant-picker-cell-selected .ant-picker-cell-inner {\n background-color: ".concat(theme.color.base.primary2, " !important;\n }\n ");
|
|
46
|
+
var calendarIcon = (react_1.default.createElement(MaterialSymbols_1.default, { icon: "date_range", size: "m", color: theme.color.base.onNeutral }));
|
|
47
|
+
return (react_1.default.createElement("div", null,
|
|
48
|
+
react_1.default.createElement(InputLabel_1.InputLabel, { label: label, required: required, optional: optional, showInfoIcon: showInfoIcon, onInfoClick: onInfoClick }),
|
|
49
|
+
react_1.default.createElement(antd_1.DatePicker, __assign({ className: "".concat((0, emotion_1.css)(style)), popupClassName: (0, emotion_1.css)(dropdownStyle), disabled: disabled, suffixIcon: calendarIcon, format: "DD-MM-YYYY" }, rest)),
|
|
50
|
+
react_1.default.createElement(HelperText_1.HelperText, { text: helperText, error: error })));
|
|
49
51
|
}
|
|
50
52
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/DatePicker/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/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extraAction,
|
|
64
|
-
isAddItemBarVisible: isAddItemBarVisible
|
|
64
|
+
isAddItemBarVisible: isAddItemBarVisible,
|
|
65
65
|
}),
|
|
66
66
|
bottomContent));
|
|
67
67
|
};
|
|
68
68
|
var DynamicSelect = function (_a) {
|
|
69
69
|
var _b = _a.className, className = _b === void 0 ? '' : _b, children = _a.children, _c = _a.disabled, disabled = _c === void 0 ? false : _c, mode = _a.mode, label = _a.label, _d = _a.iconSrc, iconSrc = _d === void 0 ? '' : _d, _e = _a.extraText, extraText = _e === void 0 ? '' : _e, _f = _a.extraAction, extraAction = _f === void 0 ? function () { } : _f, _g = _a.isAddItemBarVisible, isAddItemBarVisible = _g === void 0 ? true : _g, _h = _a.topContent, topContent = _h === void 0 ? null : _h, _j = _a.bottomContent, bottomContent = _j === void 0 ? null : _j, _k = _a.actionContent, actionContent = _k === void 0 ? null : _k, rest = __rest(_a, ["className", "children", "disabled", "mode", "label", "iconSrc", "extraText", "extraAction", "isAddItemBarVisible", "topContent", "bottomContent", "actionContent"]);
|
|
70
|
-
return (react_1.default.createElement(Select_1.default, __assign({ className: className,
|
|
70
|
+
return (react_1.default.createElement(Select_1.default, __assign({ className: className, disabled: disabled, mode: mode, label: label, dropdownRender: function (menu) {
|
|
71
71
|
return ExtraElement(menu, {
|
|
72
72
|
iconSrc: iconSrc,
|
|
73
73
|
extraText: extraText,
|
|
@@ -75,7 +75,7 @@ var DynamicSelect = function (_a) {
|
|
|
75
75
|
isAddItemBarVisible: isAddItemBarVisible,
|
|
76
76
|
topContent: topContent,
|
|
77
77
|
bottomContent: bottomContent,
|
|
78
|
-
actionContent: actionContent
|
|
78
|
+
actionContent: actionContent,
|
|
79
79
|
});
|
|
80
80
|
} }, rest), children));
|
|
81
81
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicSelect.js","sourceRoot":"","sources":["../../../src/components/DynamicSelect/DynamicSelect.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;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ACL,8BAAC,gBAAM,aACL,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,UAAC,IAAI;YACnB,OAAA,YAAY,CAAC,IAAI,EAAE;gBACjB,OAAO,SAAA;gBACP,SAAS,WAAA;gBACT,WAAW,aAAA;gBACX,mBAAmB,qBAAA;gBACnB,UAAU,YAAA;gBACV,aAAa,eAAA;gBACb,aAAa,eAAA;aACd,CAAC;QARF,CAQE,IAEA,IAAI,GAEP,QAAQ,CACF,CACV,CAAA;AACH,CAAC,CAAA;AAED,aAAa,CAAC,MAAM,GAAG,gBAAM,CAAC,MAAM,CAAA;AAEpC,IAAM,IAAI,GAAG,gBAAM,CAAC,GAAG,6FAAA,0BAEtB,IAAA,CAAA;AACY,QAAA,OAAO,GAAG,gBAAM,CAAC,GAAG,6FAAA,0BAEhC,KAAA;AAEY,QAAA,SAAS,GAAG,IAAA,gBAAM,EAAC,eAAE,CAAC,mSAAA,gOAYlC,KAAA;AACD,kBAAe,aAAa,CAAA"}
|
|
@@ -31,7 +31,7 @@ var emotion_1 = require("emotion");
|
|
|
31
31
|
var antd_1 = require("antd");
|
|
32
32
|
var ColorStyles_1 = require("src/shared/ColorStyles");
|
|
33
33
|
var TypographyStyles_1 = require("src/shared/TypographyStyles");
|
|
34
|
-
var baseStyle = (0, emotion_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n & .ant-form-item {\n margin-bottom: 0 !important;\n }\n\n & .ant-form-item-has-error {\n font-family: ", " !important;\n font-size: ", " !important;\n line-height: 17px !important;\n\n & .ant-form-item-explain {\n color: ", " !important;\n padding-top: 5px !important;\n padding-bottom: 5px !important;\n }\n\n & .ant-input,\n .ant-picker-input,\n .ant-select-selector {\n color: ", " !important;\n\n &::placeholder,\n input::placeholder,\n .ant-select-selection-placeholder {\n color: ", " !important;\n font-weight: 400 !important;\n }\n }\n\n & .ant-input,\n .ant-picker,\n .ant-select,\n .ant-select-selector {\n border-top-right-radius: 5px !important;\n border-bottom-right-radius: 5px !important;\n border-color: ", " !important;\n background-color: ", " !important;\n\n &:hover {\n border-color: ", " !important;\n background-color: ", " !important;\n }\n\n &:focus {\n border-color: ", " !important;\n -webkit-box-shadow: 0 0 0 3px ", " !important;\n box-shadow: 0 0 0 3px ", " !important;\n background-color: ", " !important;\n }\n }\n\n & .ant-input-group-addon:not(:last-child) {\n color: ", " !important;\n background-color: ", " !important;\n border-top-left-radius: 5px !important;\n border-bottom-left-radius: 5px !important;\n border-color: ", " !important;\n border-right: 0 !important;\n }\n }\n"], ["\n & .ant-form-item {\n margin-bottom: 0 !important;\n }\n\n & .ant-form-item-has-error {\n font-family: ", " !important;\n font-size: ", " !important;\n line-height: 17px !important;\n\n & .ant-form-item-explain {\n color: ", " !important;\n padding-top: 5px !important;\n padding-bottom: 5px !important;\n }\n\n & .ant-input,\n .ant-picker-input,\n .ant-select-selector {\n color: ", " !important;\n\n &::placeholder,\n input::placeholder,\n .ant-select-selection-placeholder {\n color: ", " !important;\n font-weight: 400 !important;\n }\n }\n\n & .ant-input,\n .ant-picker,\n .ant-select,\n .ant-select-selector {\n border-top-right-radius: 5px !important;\n border-bottom-right-radius: 5px !important;\n border-color: ", " !important;\n background-color: ", " !important;\n\n &:hover {\n border-color: ", " !important;\n background-color: ", " !important;\n }\n\n &:focus {\n border-color: ", " !important;\n -webkit-box-shadow: 0 0 0 3px ", " !important;\n box-shadow: 0 0 0 3px ", " !important;\n background-color: ", " !important;\n }\n }\n\n & .ant-input-group-addon:not(:last-child) {\n color: ", " !important;\n background-color: ", " !important;\n border-top-left-radius: 5px !important;\n border-bottom-left-radius: 5px !important;\n border-color: ", " !important;\n border-right: 0 !important;\n }\n }\n"])), TypographyStyles_1.MAIN_FONT, TypographyStyles_1.FONT_SIZE.P1, ColorStyles_1.RED_COLORS.R400, ColorStyles_1.RED_COLORS.R400, ColorStyles_1.RED_COLORS.R400, ColorStyles_1.RED_COLORS.R300, ColorStyles_1.RED_COLORS.R100, ColorStyles_1.RED_COLORS.R300, ColorStyles_1.RED_COLORS.R100, ColorStyles_1.RED_COLORS.R300, ColorStyles_1.RED_COLORS.R200, ColorStyles_1.RED_COLORS.R200, ColorStyles_1.RED_COLORS.R100, ColorStyles_1.RED_COLORS.R400, ColorStyles_1.RED_COLORS.R100, ColorStyles_1.RED_COLORS.R300);
|
|
34
|
+
var baseStyle = (0, emotion_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n & .ant-form-item {\n margin-bottom: 0 !important;\n }\n\n & .ant-form-item-has-error {\n font-family: ", " !important;\n font-size: ", " !important;\n line-height: 17px !important;\n\n & .ant-form-item-explain {\n color: ", " !important;\n padding-top: 5px !important;\n padding-bottom: 5px !important;\n }\n\n & .ant-input,\n .ant-picker-input,\n .ant-select-selector {\n color: ", " !important;\n\n &::placeholder,\n input::placeholder,\n .ant-select-selection-placeholder {\n color: ", " !important;\n font-weight: 400 !important;\n }\n }\n\n & .ant-input,\n .ant-picker,\n .ant-select,\n .ant-select-selector {\n border-top-right-radius: 5px !important;\n border-bottom-right-radius: 5px !important;\n border-color: ", " !important;\n background-color: ", " !important;\n\n &:hover {\n border-color: ", " !important;\n background-color: ", " !important;\n }\n\n &:focus {\n border-color: ", " !important;\n -webkit-box-shadow: 0 0 0 3px ", " !important;\n box-shadow: 0 0 0 3px ", " !important;\n background-color: ", " !important;\n }\n }\n\n & .ant-input-group-addon .ant-select,\n & .ant-input-group-addon .ant-select-selector {\n background-color: transparent !important;\n border-color: transparent !important;\n }\n\n & .ant-input-group-addon:not(:last-child) {\n color: ", " !important;\n background-color: ", " !important;\n border-top-left-radius: 5px !important;\n border-bottom-left-radius: 5px !important;\n border-color: ", " !important;\n border-right: 0 !important;\n }\n }\n"], ["\n & .ant-form-item {\n margin-bottom: 0 !important;\n }\n\n & .ant-form-item-has-error {\n font-family: ", " !important;\n font-size: ", " !important;\n line-height: 17px !important;\n\n & .ant-form-item-explain {\n color: ", " !important;\n padding-top: 5px !important;\n padding-bottom: 5px !important;\n }\n\n & .ant-input,\n .ant-picker-input,\n .ant-select-selector {\n color: ", " !important;\n\n &::placeholder,\n input::placeholder,\n .ant-select-selection-placeholder {\n color: ", " !important;\n font-weight: 400 !important;\n }\n }\n\n & .ant-input,\n .ant-picker,\n .ant-select,\n .ant-select-selector {\n border-top-right-radius: 5px !important;\n border-bottom-right-radius: 5px !important;\n border-color: ", " !important;\n background-color: ", " !important;\n\n &:hover {\n border-color: ", " !important;\n background-color: ", " !important;\n }\n\n &:focus {\n border-color: ", " !important;\n -webkit-box-shadow: 0 0 0 3px ", " !important;\n box-shadow: 0 0 0 3px ", " !important;\n background-color: ", " !important;\n }\n }\n\n & .ant-input-group-addon .ant-select,\n & .ant-input-group-addon .ant-select-selector {\n background-color: transparent !important;\n border-color: transparent !important;\n }\n\n & .ant-input-group-addon:not(:last-child) {\n color: ", " !important;\n background-color: ", " !important;\n border-top-left-radius: 5px !important;\n border-bottom-left-radius: 5px !important;\n border-color: ", " !important;\n border-right: 0 !important;\n }\n }\n"])), TypographyStyles_1.MAIN_FONT, TypographyStyles_1.FONT_SIZE.P1, ColorStyles_1.RED_COLORS.R400, ColorStyles_1.RED_COLORS.R400, ColorStyles_1.RED_COLORS.R400, ColorStyles_1.RED_COLORS.R300, ColorStyles_1.RED_COLORS.R100, ColorStyles_1.RED_COLORS.R300, ColorStyles_1.RED_COLORS.R100, ColorStyles_1.RED_COLORS.R300, ColorStyles_1.RED_COLORS.R200, ColorStyles_1.RED_COLORS.R200, ColorStyles_1.RED_COLORS.R100, ColorStyles_1.RED_COLORS.R400, ColorStyles_1.RED_COLORS.R100, ColorStyles_1.RED_COLORS.R300);
|
|
35
35
|
var MainForm = function (_a) {
|
|
36
36
|
var _b = _a.className, className = _b === void 0 ? '' : _b, children = _a.children, rest = __rest(_a, ["className", "children"]);
|
|
37
37
|
return (react_1.default.createElement(antd_1.Form, __assign({ className: (0, emotion_1.cx)(baseStyle, className) }, rest), children));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Form/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAyB;AACzB,mCAAiC;AACjC,6BAAqD;AACrD,sDAAmD;AACnD,gEAAkE;AAElE,IAAM,SAAS,OAAG,aAAG,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Form/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAyB;AACzB,mCAAiC;AACjC,6BAAqD;AACrD,sDAAmD;AACnD,gEAAkE;AAElE,IAAM,SAAS,OAAG,aAAG,+wDAAA,oHAMF,EAAS,+BACX,EAAY,kGAId,EAAe,wLAQf,EAAe,8HAKb,EAAe,kRAWV,EAAe,wCACX,EAAe,yDAGjB,EAAe,0CACX,EAAe,kEAInB,EAAe,sDACC,EAAe,8CACvB,EAAe,0CACnB,EAAe,uSAW5B,EAAe,wCACJ,EAAe,qIAGnB,EAAe,+DAIpC,KA5DkB,4BAAS,EACX,4BAAS,CAAC,EAAE,EAId,wBAAU,CAAC,IAAI,EAQf,wBAAU,CAAC,IAAI,EAKb,wBAAU,CAAC,IAAI,EAWV,wBAAU,CAAC,IAAI,EACX,wBAAU,CAAC,IAAI,EAGjB,wBAAU,CAAC,IAAI,EACX,wBAAU,CAAC,IAAI,EAInB,wBAAU,CAAC,IAAI,EACC,wBAAU,CAAC,IAAI,EACvB,wBAAU,CAAC,IAAI,EACnB,wBAAU,CAAC,IAAI,EAW5B,wBAAU,CAAC,IAAI,EACJ,wBAAU,CAAC,IAAI,EAGnB,wBAAU,CAAC,IAAI,CAIpC,CAAA;AAOD,IAAM,QAAQ,GAAG,UAAU,EAA4C;IAA1C,IAAA,iBAAc,EAAd,SAAS,mBAAG,EAAE,KAAA,EAAE,QAAQ,cAAA,EAAK,IAAI,cAAnC,yBAAqC,CAAF;IAC5D,OAAO,CACL,8BAAC,WAAI,aAAC,SAAS,EAAE,IAAA,YAAE,EAAC,SAAS,EAAE,SAAS,CAAC,IAAM,IAAI,GAChD,QAAQ,CACJ,CACR,CAAA;AACH,CAAC,CAAA;AAED,QAAQ,CAAC,IAAI,GAAG,UAAU,EAA0C;IAAxC,IAAA,iBAAc,EAAd,SAAS,mBAAG,EAAE,KAAA,EAAK,IAAI,cAAzB,aAA2B,CAAF;IACjD,OAAO,8BAAC,WAAI,CAAC,IAAI,aAAC,SAAS,EAAE,IAAA,YAAE,EAAC,SAAS,EAAE,SAAS,CAAC,IAAM,IAAI,EAAI,CAAA;AACrE,CAAC,CAAA;AAED,QAAQ,CAAC,OAAO,GAAG,WAAI,CAAC,OAAO,CAAA;AAE/B,kBAAe,QAAQ,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HelperText = HelperText;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var Typography_1 = require("src/constants/Typography/Typography");
|
|
6
|
+
var ThemeContext_1 = require("src/theme/ThemeContext");
|
|
7
|
+
function HelperText(_a) {
|
|
8
|
+
var text = _a.text, error = _a.error;
|
|
9
|
+
var theme = (0, ThemeContext_1.useTheme)();
|
|
10
|
+
if (!text)
|
|
11
|
+
return null;
|
|
12
|
+
var color = error
|
|
13
|
+
? theme.color.status.critical
|
|
14
|
+
: theme.color.component.helperInput;
|
|
15
|
+
return (react_1.default.createElement(Typography_1.Typography.Body, { size: "sm", style: { color: color, marginTop: 4 } }, text));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=HelperText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelperText.js","sourceRoot":"","sources":["../../../src/components/Input/HelperText.tsx"],"names":[],"mappings":";;AASA,gCAiBC;AA1BD,+BAAyB;AACzB,kEAAgE;AAChE,uDAAiD;AAOjD,SAAgB,UAAU,CAAC,EAGT;QAFhB,IAAI,UAAA,EACJ,KAAK,WAAA;IAEL,IAAM,KAAK,GAAG,IAAA,uBAAQ,GAAE,CAAA;IAExB,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAA;IAEtB,IAAM,KAAK,GAAG,KAAK;QACjB,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ;QAC7B,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAA;IAErC,OAAO,CACL,8BAAC,uBAAU,CAAC,IAAI,IAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAE,EAAE,KAAK,OAAA,EAAE,SAAS,EAAE,CAAC,EAAE,IACtD,IAAI,CACW,CACnB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
exports.InputLabel = InputLabel;
|
|
8
|
+
var react_1 = require("react");
|
|
9
|
+
var styled_1 = require("@emotion/styled");
|
|
10
|
+
var ThemeContext_1 = require("src/theme/ThemeContext");
|
|
11
|
+
var icons_1 = require("src/icons");
|
|
12
|
+
var Typography_1 = require("src/constants/Typography/Typography");
|
|
13
|
+
var Tooltip_1 = require("src/components/Tooltip");
|
|
14
|
+
function InputLabel(_a) {
|
|
15
|
+
var label = _a.label, required = _a.required, optional = _a.optional, showInfoIcon = _a.showInfoIcon, infoText = _a.infoText, onInfoClick = _a.onInfoClick;
|
|
16
|
+
var theme = (0, ThemeContext_1.useTheme)();
|
|
17
|
+
if (!label)
|
|
18
|
+
return null;
|
|
19
|
+
return (react_1.default.createElement(LabelContainer, null,
|
|
20
|
+
react_1.default.createElement(Typography_1.Typography.Body, { size: "sm", style: { color: theme.color.base.onNeutral } },
|
|
21
|
+
label,
|
|
22
|
+
required && (react_1.default.createElement("span", { style: { color: theme.error.text, marginLeft: 2 } }, "*"))),
|
|
23
|
+
optional && (react_1.default.createElement(Typography_1.Typography.Body, { size: "sm", style: { color: theme.color.base.onNeutralSecondary } }, "Optional")),
|
|
24
|
+
showInfoIcon && infoText && (react_1.default.createElement(Tooltip_1.default, { content: infoText, placement: "top" },
|
|
25
|
+
react_1.default.createElement("span", { role: "button", tabIndex: 0, "aria-label": "More information", onClick: onInfoClick, onKeyDown: function (e) {
|
|
26
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
27
|
+
e.preventDefault();
|
|
28
|
+
onInfoClick === null || onInfoClick === void 0 ? void 0 : onInfoClick();
|
|
29
|
+
}
|
|
30
|
+
}, style: { display: 'inline-flex', cursor: 'pointer' } },
|
|
31
|
+
react_1.default.createElement(icons_1.Info, { style: { width: 16, height: 16 } })))),
|
|
32
|
+
showInfoIcon && !infoText && (react_1.default.createElement("span", { role: "button", tabIndex: 0, "aria-label": "More information", onClick: onInfoClick, onKeyDown: function (e) {
|
|
33
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
34
|
+
e.preventDefault();
|
|
35
|
+
onInfoClick === null || onInfoClick === void 0 ? void 0 : onInfoClick();
|
|
36
|
+
}
|
|
37
|
+
}, style: { display: 'inline-flex', cursor: 'pointer' } },
|
|
38
|
+
react_1.default.createElement(icons_1.Info, { style: { width: 16, height: 16 } })))));
|
|
39
|
+
}
|
|
40
|
+
// ─── Styled Components ───
|
|
41
|
+
var LabelContainer = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 4px;\n margin-bottom: 4px;\n"], ["\n display: flex;\n align-items: center;\n gap: 4px;\n margin-bottom: 4px;\n"])));
|
|
42
|
+
var templateObject_1;
|
|
43
|
+
//# sourceMappingURL=InputLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputLabel.js","sourceRoot":"","sources":["../../../src/components/Input/InputLabel.tsx"],"names":[],"mappings":";;;;;;AAgBA,gCAkEC;AAlFD,+BAAyB;AACzB,0CAAoC;AACpC,uDAAiD;AACjD,mCAAgC;AAChC,kEAAgE;AAChE,kDAA4C;AAW5C,SAAgB,UAAU,CAAC,EAOT;QANhB,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,YAAY,kBAAA,EACZ,QAAQ,cAAA,EACR,WAAW,iBAAA;IAEX,IAAM,KAAK,GAAG,IAAA,uBAAQ,GAAE,CAAA;IAExB,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IAEvB,OAAO,CACL,8BAAC,cAAc;QACb,8BAAC,uBAAU,CAAC,IAAI,IAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE;YACpE,KAAK;YACL,QAAQ,IAAI,CACX,wCAAM,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,QAAU,CAClE,CACe;QACjB,QAAQ,IAAI,CACX,8BAAC,uBAAU,CAAC,IAAI,IACd,IAAI,EAAC,IAAI,EACT,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,kBAAkB,EAAE,eAGrC,CACnB;QACA,YAAY,IAAI,QAAQ,IAAI,CAC3B,8BAAC,iBAAO,IAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAC,KAAK;YACzC,wCACE,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,gBACA,kBAAkB,EAC7B,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,UAAC,CAAC;oBACX,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;wBACvC,CAAC,CAAC,cAAc,EAAE,CAAA;wBAClB,WAAW,aAAX,WAAW,uBAAX,WAAW,EAAI,CAAA;oBACjB,CAAC;gBACH,CAAC,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE;gBAEpD,8BAAC,YAAI,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,GAAI,CACrC,CACC,CACX;QACA,YAAY,IAAI,CAAC,QAAQ,IAAI,CAC5B,wCACE,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,gBACA,kBAAkB,EAC7B,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,UAAC,CAAC;gBACX,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;oBACvC,CAAC,CAAC,cAAc,EAAE,CAAA;oBAClB,WAAW,aAAX,WAAW,uBAAX,WAAW,EAAI,CAAA;gBACjB,CAAC;YACH,CAAC,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE;YAEpD,8BAAC,YAAI,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,GAAI,CACrC,CACR,CACc,CAClB,CAAA;AACH,CAAC;AAED,4BAA4B;AAE5B,IAAM,cAAc,GAAG,gBAAM,CAAC,GAAG,qJAAA,kFAKhC,IAAA,CAAA"}
|
|
@@ -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++) {
|
|
@@ -26,69 +22,57 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
26
22
|
return t;
|
|
27
23
|
};
|
|
28
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
/* eslint-disable max-lines */
|
|
30
25
|
var react_1 = require("react");
|
|
31
26
|
var emotion_1 = require("emotion");
|
|
32
|
-
var styled_1 = require("@emotion/styled");
|
|
33
27
|
var antd_1 = require("antd");
|
|
34
|
-
var Typography_1 = require("src/components/Typography");
|
|
35
|
-
var Link_1 = require("src/components/Link");
|
|
36
28
|
var ThemeContext_1 = require("src/theme/ThemeContext");
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var TypographyStyles_1 = require("src/shared/TypographyStyles");
|
|
42
|
-
var style = "\n -webkit-font-smoothing: antialiased;\n\n & .ant-input, &.ant-input, &.ant-input-password {\n padding: 0 !important;\n font-family: ".concat(TypographyStyles_1.MAIN_FONT, " !important;\n font-size: ").concat(TypographyStyles_1.FONT_SIZE.P1, " !important;\n color: ").concat(ColorStyles_1.NEUTRAL_COLORS.BLACK, " !important;\n line-height: 17px !important;\n padding-left: 15px !important;\n padding-top: 12px !important;\n padding-bottom: 13px !important;\n\n &::placeholder {\n color: ").concat(ColorStyles_1.NEUTRAL_COLORS.G400, " !important;\n font-weight: 400 !important;\n }\n }\n\n &.ant-input, &.ant-input-password {\n border-radius: 5px;\n border-color: ").concat(ColorStyles_1.NEUTRAL_COLORS.G200, " !important;\n\n &:hover {\n border-color: ").concat(theme_1.straitsXTheme.brand.primary.default, " !important;\n }\n\n &:focus {\n border-color: ").concat(theme_1.straitsXTheme.brand.primary.default, " !important;\n -webkit-box-shadow: 0 0 0 3px #F0FFF9 !important;\n box-shadow: 0 0 0 3px #F0FFF9 !important;\n color: ").concat(ColorStyles_1.NEUTRAL_COLORS.BLACK, " !important;\n }\n }\n\n & .ant-input, .ant-input-password {\n border-top-right-radius: 5px;\n border-bottom-right-radius: 5px;\n border-color: ").concat(ColorStyles_1.NEUTRAL_COLORS.G200, " !important;\n\n &:hover {\n border-color: ").concat(theme_1.straitsXTheme.brand.primary.default, " !important;\n }\n\n &:focus {\n border-color: ").concat(theme_1.straitsXTheme.brand.primary.default, " !important;\n -webkit-box-shadow: 0 0 0 3px #F0FFF9 !important;\n box-shadow: 0 0 0 3px #F0FFF9 !important;\n color: ").concat(ColorStyles_1.NEUTRAL_COLORS.BLACK, " !important;\n }\n }\n\n &.ant-input-disabled {\n background-color: ").concat(ColorStyles_1.NEUTRAL_COLORS.G100, " !important;\n border-color: ").concat(ColorStyles_1.NEUTRAL_COLORS.G200, " !important;\n\n &:hover {\n border-color: ").concat(ColorStyles_1.NEUTRAL_COLORS.G200, " !important;\n }\n }\n\n & .ant-input-group-addon:not(:last-child) {\n font-family: ").concat(TypographyStyles_1.MAIN_FONT, ";\n color: ").concat(ColorStyles_1.NEUTRAL_COLORS.BLACK, ";\n background-color: ").concat(ColorStyles_1.NEUTRAL_COLORS.G100, ";\n border-top-left-radius: 5px;\n border-bottom-left-radius: 5px;\n border-color: ").concat(ColorStyles_1.NEUTRAL_COLORS.G200, ";\n border-right: 0;\n padding-left: 15px;\n padding-right: 15px;\n\n + .ant-input-disabled {\n background-color: ").concat(ColorStyles_1.NEUTRAL_COLORS.G100, ";\n border-color: ").concat(ColorStyles_1.NEUTRAL_COLORS.G200, ";\n color: ").concat(ColorStyles_1.NEUTRAL_COLORS.G400, ";\n\n &:hover {\n border-color: ").concat(ColorStyles_1.NEUTRAL_COLORS.G200, ";\n }\n }\n }\n\n & .ant-input-group-addon:last-child {\n border-top-right-radius: 5px;\n border-bottom-right-radius: 5px;\n border-color: ").concat(ColorStyles_1.NEUTRAL_COLORS.G200, ";\n }\n\n &.ant-input-search {\n padding: 0;\n font-family: ").concat(TypographyStyles_1.MAIN_FONT, ";\n font-size: ").concat(TypographyStyles_1.FONT_SIZE.P1, ";\n line-height: 17px;\n padding-left: 15px;\n padding-top: 6px;\n padding-bottom: 6px;\n border-radius: 5px;\n border-color: ").concat(ColorStyles_1.NEUTRAL_COLORS.G200, ";\n width: 132px;\n\n &::placeholder {\n color: ").concat(ColorStyles_1.NEUTRAL_COLORS.G400, ";\n font-weight: 400;\n }\n\n &:hover {\n border-color: ").concat(theme_1.straitsXTheme.brand.primary.default, ";\n }\n\n & > .ant-input-suffix {\n width: 18px;\n margin-right: 14px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n }\n\n &.ant-input-affix-wrapper-focused {\n border-color: ").concat(theme_1.straitsXTheme.brand.primary.default, ";\n -webkit-box-shadow: 0 0 0 3px #F0FFF9;\n box-shadow: 0 0 0 3px #F0FFF9;\n }\n");
|
|
43
|
-
var Asterisk = function () {
|
|
44
|
-
var error = (0, ThemeContext_1.useTheme)().error;
|
|
45
|
-
return react_1.default.createElement("span", { style: { color: error.text, marginLeft: 2 } }, "*");
|
|
46
|
-
};
|
|
47
|
-
var OptionalText = function () {
|
|
48
|
-
return (react_1.default.createElement(Typography_1.SmallP, { style: { color: ColorStyles_1.NEUTRAL_COLORS.G500, marginLeft: 3 } }, "Optional"));
|
|
49
|
-
};
|
|
50
|
-
var Label = styled_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n margin-bottom: 5px;\n"], ["\n display: flex;\n justify-content: space-between;\n margin-bottom: 5px;\n"])));
|
|
29
|
+
var MaterialSymbols_1 = require("src/icons/MaterialSymbols/MaterialSymbols");
|
|
30
|
+
var inputStyles_1 = require("./inputStyles");
|
|
31
|
+
var HelperText_1 = require("./HelperText");
|
|
32
|
+
var InputLabel_1 = require("./InputLabel");
|
|
51
33
|
var MainInput = function (_a) {
|
|
52
|
-
var
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
react_1.default.createElement(antd_1.Input, __assign({ className: "".concat((0, emotion_1.css)(style), " ").concat(className), addonBefore: addonBefore, placeholder: placeholder, disabled: disabled }, rest))));
|
|
34
|
+
var addonBefore = _a.addonBefore, addonAfter = _a.addonAfter, _b = _a.placeholder, placeholder = _b === void 0 ? '' : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.disabledAddon, disabledAddon = _d === void 0 ? false : _d, _e = _a.className, className = _e === void 0 ? '' : _e, label = _a.label, required = _a.required, _f = _a.optional, optional = _f === void 0 ? false : _f, _g = _a.size, size = _g === void 0 ? 'large' : _g, helperText = _a.helperText, error = _a.error, showInfoIcon = _a.showInfoIcon, infoText = _a.infoText, onInfoClick = _a.onInfoClick, rest = __rest(_a, ["addonBefore", "addonAfter", "placeholder", "disabled", "disabledAddon", "className", "label", "required", "optional", "size", "helperText", "error", "showInfoIcon", "infoText", "onInfoClick"]);
|
|
35
|
+
var theme = (0, ThemeContext_1.useTheme)();
|
|
36
|
+
var style = (0, inputStyles_1.getBaseInputStyle)(theme, size, error, disabledAddon);
|
|
37
|
+
return (react_1.default.createElement("div", null,
|
|
38
|
+
react_1.default.createElement(InputLabel_1.InputLabel, { label: label, required: required, optional: optional, showInfoIcon: showInfoIcon, infoText: infoText, onInfoClick: onInfoClick }),
|
|
39
|
+
react_1.default.createElement(antd_1.Input, __assign({ className: "".concat((0, emotion_1.css)(style), " ").concat(className), addonBefore: addonBefore, addonAfter: addonAfter, placeholder: placeholder, disabled: disabled }, rest)),
|
|
40
|
+
react_1.default.createElement(HelperText_1.HelperText, { text: helperText, error: error })));
|
|
60
41
|
};
|
|
61
42
|
MainInput.Password = function (_a) {
|
|
62
|
-
var _b = _a.addonBefore, addonBefore = _b === void 0 ? '' : _b, _c = _a.placeholder, placeholder = _c === void 0 ? '' : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.className, className = _e === void 0 ? '' : _e, label = _a.label, required = _a.required, rest = __rest(_a, ["addonBefore", "placeholder", "disabled", "className", "label", "required"]);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
react_1.default.createElement(
|
|
43
|
+
var _b = _a.addonBefore, addonBefore = _b === void 0 ? '' : _b, _c = _a.placeholder, placeholder = _c === void 0 ? '' : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.className, className = _e === void 0 ? '' : _e, label = _a.label, required = _a.required, _f = _a.optional, optional = _f === void 0 ? false : _f, _g = _a.size, size = _g === void 0 ? 'large' : _g, helperText = _a.helperText, error = _a.error, showInfoIcon = _a.showInfoIcon, infoText = _a.infoText, onInfoClick = _a.onInfoClick, rest = __rest(_a, ["addonBefore", "placeholder", "disabled", "className", "label", "required", "optional", "size", "helperText", "error", "showInfoIcon", "infoText", "onInfoClick"]);
|
|
44
|
+
var theme = (0, ThemeContext_1.useTheme)();
|
|
45
|
+
var style = (0, inputStyles_1.getBaseInputStyle)(theme, size, error);
|
|
46
|
+
return (react_1.default.createElement("div", null,
|
|
47
|
+
react_1.default.createElement(InputLabel_1.InputLabel, { label: label, required: required, optional: optional, showInfoIcon: showInfoIcon, infoText: infoText, onInfoClick: onInfoClick }),
|
|
48
|
+
react_1.default.createElement(antd_1.Input.Password, __assign({ className: "".concat((0, emotion_1.css)(style), " ").concat(className), addonBefore: addonBefore, placeholder: placeholder, disabled: disabled, visibilityToggle: true }, rest)),
|
|
49
|
+
react_1.default.createElement(HelperText_1.HelperText, { text: helperText, error: error })));
|
|
69
50
|
};
|
|
70
51
|
MainInput.Search = function (_a) {
|
|
71
|
-
var _b = _a.addonBefore, addonBefore = _b === void 0 ? '' : _b, _c = _a.placeholder, placeholder = _c === void 0 ? '' : _c, _d = _a.className, className = _d === void 0 ? '' : _d, onChange = _a.onChange, onSearch = _a.onSearch, rest = __rest(_a, ["addonBefore", "placeholder", "className", "onChange", "onSearch"]);
|
|
72
|
-
var
|
|
73
|
-
var searchStyle = "\n & .ant-input-group-addon:not(:last-child) {\n
|
|
74
|
-
return (react_1.default.createElement(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
52
|
+
var _b = _a.addonBefore, addonBefore = _b === void 0 ? '' : _b, _c = _a.placeholder, placeholder = _c === void 0 ? '' : _c, _d = _a.className, className = _d === void 0 ? '' : _d, onChange = _a.onChange, onSearch = _a.onSearch, _e = _a.size, size = _e === void 0 ? 'large' : _e, helperText = _a.helperText, error = _a.error, rest = __rest(_a, ["addonBefore", "placeholder", "className", "onChange", "onSearch", "size", "helperText", "error"]);
|
|
53
|
+
var theme = (0, ThemeContext_1.useTheme)();
|
|
54
|
+
var searchStyle = "".concat((0, inputStyles_1.getBaseInputStyle)(theme, size, error), "\n & .ant-input-group-addon:not(:last-child) {\n background-color: ").concat(theme.color.surface.neutral, ";\n padding: ").concat(typeof addonBefore === 'string' ? '0 15px' : '0', ";\n }\n &.ant-input-affix-wrapper .ant-input-prefix {\n margin-right: 8px;\n display: flex;\n align-items: center;\n }\n ");
|
|
55
|
+
return (react_1.default.createElement("div", null,
|
|
56
|
+
react_1.default.createElement(antd_1.Input, __assign({ placeholder: placeholder, addonBefore: addonBefore, onChange: onChange, onKeyDown: onSearch, className: "".concat((0, emotion_1.css)(searchStyle), " ").concat(className), prefix: react_1.default.createElement("span", { onClick: onSearch, style: {
|
|
57
|
+
display: 'flex',
|
|
58
|
+
cursor: onSearch ? 'pointer' : 'default',
|
|
59
|
+
} },
|
|
60
|
+
react_1.default.createElement(MaterialSymbols_1.default, { icon: "search", size: size === 'small' ? 'xs' : 'm', color: theme.color.base.onNeutral })) }, rest)),
|
|
61
|
+
react_1.default.createElement(HelperText_1.HelperText, { text: helperText, error: error })));
|
|
79
62
|
};
|
|
80
63
|
MainInput.TextArea = function (_a) {
|
|
81
|
-
var _b = _a.className, className = _b === void 0 ? '' : _b, label = _a.label, _c = _a.required, required = _c === void 0 ? false : _c, _d = _a.optional, optional = _d === void 0 ? false : _d, rest = __rest(_a, ["className", "label", "required", "optional"]);
|
|
82
|
-
var
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
react_1.default.createElement(
|
|
64
|
+
var _b = _a.className, className = _b === void 0 ? '' : _b, label = _a.label, _c = _a.required, required = _c === void 0 ? false : _c, _d = _a.optional, optional = _d === void 0 ? false : _d, _e = _a.size, size = _e === void 0 ? 'large' : _e, helperText = _a.helperText, error = _a.error, showInfoIcon = _a.showInfoIcon, infoText = _a.infoText, onInfoClick = _a.onInfoClick, rest = __rest(_a, ["className", "label", "required", "optional", "size", "helperText", "error", "showInfoIcon", "infoText", "onInfoClick"]);
|
|
65
|
+
var theme = (0, ThemeContext_1.useTheme)();
|
|
66
|
+
var borderColor = error
|
|
67
|
+
? theme.color.status.critical
|
|
68
|
+
: theme.color.base.line;
|
|
69
|
+
var _f = inputStyles_1.SIZE_CONFIG[size], borderRadius = _f.borderRadius, padding = _f.padding;
|
|
70
|
+
var textAreaStyle = "".concat((0, inputStyles_1.getBaseInputStyle)(theme, size, error), "\n &.ant-input {\n min-height: 72px;\n height: auto;\n resize: none;\n border-radius: ").concat(borderRadius, " !important;\n border-color: ").concat(borderColor, ";\n padding: ").concat(padding, ";\n &:hover:not(:disabled):not(.ant-input-disabled) { border-color: ").concat(error ? theme.color.status.critical : theme.color.base.primary2, " !important; }\n &:focus {\n border-color: ").concat(theme.color.base.primary2, ";\n box-shadow: none;\n }\n &:disabled {\n color: ").concat(theme.color.base.onNeutral, " !important;\n -webkit-text-fill-color: ").concat(theme.color.base.onNeutral, " !important;\n background-color: ").concat(theme.color.surface.disabledSurface, ";\n border-color: ").concat(theme.color.base.line, ";\n &::placeholder {\n color: ").concat(theme.color.surface.disabledOnSurface, " !important;\n -webkit-text-fill-color: ").concat(theme.color.surface.disabledOnSurface, " !important;\n }\n &:hover { border-color: ").concat(theme.color.base.line, " !important; }\n }\n }\n ");
|
|
71
|
+
return (react_1.default.createElement("div", null,
|
|
72
|
+
react_1.default.createElement(InputLabel_1.InputLabel, { label: label, required: required, optional: optional, showInfoIcon: showInfoIcon, infoText: infoText, onInfoClick: onInfoClick }),
|
|
73
|
+
react_1.default.createElement(antd_1.Input.TextArea, __assign({ className: "".concat((0, emotion_1.css)(textAreaStyle), " ").concat(className) }, rest)),
|
|
74
|
+
react_1.default.createElement(HelperText_1.HelperText, { text: helperText, error: error })));
|
|
90
75
|
};
|
|
91
76
|
MainInput.Group = antd_1.Input.Group;
|
|
92
77
|
exports.default = MainInput;
|
|
93
|
-
var templateObject_1;
|
|
94
78
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Input/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Input/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAyB;AACzB,mCAA6B;AAC7B,6BAAwC;AACxC,uDAAiD;AACjD,6EAAuE;AACvE,6CAAyE;AACzE,2CAAyC;AACzC,2CAAyC;AA+BzC,IAAM,SAAS,GAAG,UAAU,EAiBpB;IAhBN,IAAA,WAAW,iBAAA,EACX,UAAU,gBAAA,EACV,mBAAgB,EAAhB,WAAW,mBAAG,EAAE,KAAA,EAChB,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,qBAAqB,EAArB,aAAa,mBAAG,KAAK,KAAA,EACrB,iBAAc,EAAd,SAAS,mBAAG,EAAE,KAAA,EACd,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,YAAc,EAAd,IAAI,mBAAG,OAAO,KAAA,EACd,UAAU,gBAAA,EACV,KAAK,WAAA,EACL,YAAY,kBAAA,EACZ,QAAQ,cAAA,EACR,WAAW,iBAAA,EACR,IAA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AAK,CAAC,KAAK,CAAA;AAE7B,kBAAe,SAAS,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SIZE_CONFIG = void 0;
|
|
4
|
+
exports.getBaseInputStyle = getBaseInputStyle;
|
|
5
|
+
var TypographyStyles_1 = require("src/shared/TypographyStyles");
|
|
6
|
+
Object.defineProperty(exports, "SIZE_CONFIG", { enumerable: true, get: function () { return TypographyStyles_1.SIZE_CONFIG; } });
|
|
7
|
+
function getBaseInputStyle(theme, size, error, disabledAddon) {
|
|
8
|
+
if (size === void 0) { size = 'large'; }
|
|
9
|
+
var _a = TypographyStyles_1.SIZE_CONFIG[size], height = _a.height, borderRadius = _a.borderRadius, padding = _a.padding;
|
|
10
|
+
var borderColor = error
|
|
11
|
+
? theme.color.status.critical
|
|
12
|
+
: theme.color.base.line;
|
|
13
|
+
return "\n -webkit-font-smoothing: antialiased;\n\n /* Shared font/sizing for all .ant-input elements */\n & .ant-input, &.ant-input, &.ant-input-password {\n padding: ".concat(padding, ";\n font-family: ").concat(TypographyStyles_1.MAIN_FONT, ";\n font-size: ").concat(TypographyStyles_1.FONT_SIZE.P1, ";\n color: ").concat(theme.color.base.onNeutral, ";\n line-height: 17px;\n height: ").concat(height, ";\n box-sizing: border-box;\n &::placeholder {\n color: ").concat(theme.color.component.placeholderInput, ";\n font-weight: 400;\n }\n }\n\n /* Case 1: Standalone input \u2014 class directly on .ant-input */\n &.ant-input, &.ant-input-password {\n border-radius: ").concat(borderRadius, " !important;\n border-color: ").concat(borderColor, ";\n height: ").concat(height, ";\n padding: ").concat(padding, ";\n &:hover:not(:disabled):not(.ant-input-affix-wrapper-disabled) { border-color: ").concat(error ? theme.color.status.critical : theme.color.base.primary2, " !important; }\n &:focus {\n border-color: ").concat(error ? theme.color.status.critical : theme.color.base.primary2, ";\n box-shadow: none;\n color: ").concat(theme.color.base.onNeutral, ";\n }\n }\n\n /* Case 2: Input with addon \u2014 class on .ant-input-group-wrapper */\n /* addonBefore: input is after addon \u2014 flat left, rounded right */\n & .ant-input-group > .ant-input:last-child {\n border-radius: 0 ").concat(borderRadius, " ").concat(borderRadius, " 0 !important;\n border-color: ").concat(borderColor, ";\n height: ").concat(height, ";\n &:hover:not(:disabled):not(.ant-input-affix-wrapper-disabled) { border-color: ").concat(error ? theme.color.status.critical : theme.color.base.primary2, " !important; }\n &:focus {\n border-color: ").concat(error ? theme.color.status.critical : theme.color.base.primary2, ";\n box-shadow: none;\n color: ").concat(theme.color.base.onNeutral, ";\n }\n }\n /* addonAfter: input is before addon \u2014 rounded left, flat right */\n & .ant-input-group > .ant-input:first-child {\n border-radius: ").concat(borderRadius, " 0 0 ").concat(borderRadius, " !important;\n border-color: ").concat(borderColor, ";\n height: ").concat(height, ";\n &:hover:not(:disabled):not(.ant-input-affix-wrapper-disabled) { border-color: ").concat(error ? theme.color.status.critical : theme.color.base.primary2, " !important; }\n &:focus {\n border-color: ").concat(error ? theme.color.status.critical : theme.color.base.primary2, ";\n box-shadow: none;\n color: ").concat(theme.color.base.onNeutral, ";\n }\n }\n\n /* Case 3: Input with prefix (e.g. Search without addon) \u2014 class on .ant-input-affix-wrapper */\n &.ant-input-affix-wrapper {\n border-radius: ").concat(borderRadius, " !important;\n border-color: ").concat(borderColor, ";\n height: ").concat(height, ";\n padding: ").concat(padding, ";\n &:hover:not(:disabled):not(.ant-input-affix-wrapper-disabled) { border-color: ").concat(error ? theme.color.status.critical : theme.color.base.primary2, " !important; }\n & .ant-input {\n height: auto;\n padding: 0;\n border: none;\n border-radius: 0 !important;\n }\n }\n &.ant-input-affix-wrapper-focused {\n border-color: ").concat(error ? theme.color.status.critical : theme.color.base.primary2, " !important;\n box-shadow: none;\n }\n\n /* Case 4: addon + prefix \u2014 class on .ant-input-group-wrapper */\n & .ant-input-group > .ant-input-affix-wrapper:last-child,\n & .ant-input-group > .ant-input-affix-wrapper:first-child {\n border-color: ").concat(borderColor, ";\n height: ").concat(height, ";\n padding: ").concat(padding, ";\n &:hover:not(:disabled):not(.ant-input-affix-wrapper-disabled) { border-color: ").concat(error ? theme.color.status.critical : theme.color.base.primary2, " !important; }\n &.ant-input-affix-wrapper-focused {\n border-color: ").concat(error ? theme.color.status.critical : theme.color.base.primary2, " !important;\n box-shadow: none;\n }\n & .ant-input {\n height: auto;\n padding: 0;\n border: none;\n border-radius: 0 !important;\n box-shadow: none;\n &:hover, &:focus { border: none; box-shadow: none; }\n }\n }\n /* addonBefore + prefix \u2014 rounded right */\n & .ant-input-group > .ant-input-affix-wrapper:last-child {\n border-radius: 0 ").concat(borderRadius, " ").concat(borderRadius, " 0 !important;\n padding-left: 8px;\n }\n /* prefix + addonAfter \u2014 rounded left */\n & .ant-input-group > .ant-input-affix-wrapper:first-child {\n border-radius: ").concat(borderRadius, " 0 0 ").concat(borderRadius, " !important;\n }\n\n /* Disabled states */\n &.ant-input-disabled, & .ant-input-disabled {\n background-color: ").concat(theme.color.surface.disabledSurface, ";\n border-color: ").concat(theme.color.base.line, ";\n color: ").concat(theme.color.base.onNeutral, ";\n -webkit-text-fill-color: ").concat(theme.color.base.onNeutral, ";\n &::placeholder {\n color: ").concat(theme.color.component.placeholderInput, ";\n -webkit-text-fill-color: ").concat(theme.color.component.placeholderInput, ";\n }\n &:hover { border-color: ").concat(theme.color.base.line, " !important; }\n }\n &.ant-input-affix-wrapper-disabled {\n background-color: ").concat(theme.color.surface.disabledSurface, ";\n border-color: ").concat(theme.color.base.line, ";\n &:hover { border-color: ").concat(theme.color.base.line, " !important; }\n & .ant-input-disabled {\n background-color: ").concat(theme.color.surface.disabledSurface, ";\n color: ").concat(theme.color.base.onNeutral, ";\n -webkit-text-fill-color: ").concat(theme.color.base.onNeutral, ";\n &::placeholder {\n color: ").concat(theme.color.component.placeholderInput, ";\n -webkit-text-fill-color: ").concat(theme.color.component.placeholderInput, ";\n }\n }\n }\n\n /* Addon containers */\n &.ant-input-group-wrapper-status-error .ant-input-group-addon,\n &.ant-input-group-wrapper-status-error .ant-input-group-addon:last-child,\n &.ant-input-group-wrapper-status-error .ant-input-group-addon:not(:last-child) {\n background-color: ").concat(theme.color.surface.neutral, " !important;\n }\n &.ant-input-group-wrapper-status-error .ant-input-group-addon .ant-select {\n background-color: ").concat(theme.color.surface.neutral, " !important;\n }\n\n & .ant-input-group-addon:not(:last-child) {\n font-family: ").concat(TypographyStyles_1.MAIN_FONT, ";\n color: ").concat(theme.color.base.onNeutral, ";\n background-color: ").concat(theme.color.surface.neutral, ";\n border-top-left-radius: ").concat(borderRadius, " !important;\n border-bottom-left-radius: ").concat(borderRadius, " !important;\n border-color: ").concat(theme.color.base.line, ";\n border-right: 0;\n padding-left: 12px;\n padding-right: 8px;\n &:has(.ant-select) {\n padding: 4px;\n .ant-select-focused .ant-select-selector {\n border-color: transparent !important;\n box-shadow: none !important;\n }\n .ant-select-selector {\n border: none !important;\n box-shadow: none !important;\n background: transparent !important;\n height: 100%;\n }\n }\n &:has([data-addon-custom]) {\n background-color: ").concat(theme.color.surface.neutral, ";\n padding-left: 12px;\n padding-right: 8px;\n }\n + .ant-input-disabled {\n background-color: ").concat(theme.color.surface.disabledSurface, ";\n border-color: ").concat(theme.color.base.line, ";\n color: ").concat(theme.color.base.onNeutral, ";\n -webkit-text-fill-color: ").concat(theme.color.base.onNeutral, ";\n &::placeholder {\n color: ").concat(theme.color.component.placeholderInput, ";\n -webkit-text-fill-color: ").concat(theme.color.component.placeholderInput, ";\n }\n &:hover { border-color: ").concat(theme.color.base.line, "; }\n }\n }\n & .ant-input-group-addon:last-child {\n font-family: ").concat(TypographyStyles_1.MAIN_FONT, ";\n color: ").concat(theme.color.base.onNeutral, ";\n background-color: ").concat(theme.color.surface.neutral, ";\n border-top-right-radius: ").concat(borderRadius, " !important;\n border-bottom-right-radius: ").concat(borderRadius, " !important;\n border-color: ").concat(theme.color.base.line, ";\n border-left: 0;\n padding-left: 16px;\n padding-right: 16px;\n &:has(.ant-select) {\n padding: 4px;\n .ant-select-focused .ant-select-selector {\n border-color: transparent !important;\n box-shadow: none !important;\n }\n .ant-select-selector {\n border: none !important;\n box-shadow: none !important;\n background: transparent !important;\n height: 100%;\n }\n }\n &:has([data-addon-custom]) {\n background-color: ").concat(theme.color.surface.neutral, ";\n padding-left: 8px;\n padding-right: 12px;\n }\n &:hover {\n background-color: ").concat(theme.color.interactive.hoverSurface, ";\n border-color: ").concat(theme.color.base.line, ";\n border-left: 1px solid ").concat(theme.color.base.line, ";\n }\n &:focus-within {\n background-color: ").concat(theme.color.surface.neutral, ";\n border-color: ").concat(theme.color.base.primary2, " !important;\n border-left: 1px solid ").concat(theme.color.base.primary2, ";\n }\n }\n & .ant-input-group-addon:not(:last-child):hover {\n background-color: ").concat(theme.color.interactive.hoverSurface, ";\n border-color: ").concat(theme.color.base.line, ";\n border-right: 1px solid ").concat(theme.color.base.line, ";\n }\n & .ant-input-group-addon:not(:last-child):focus-within {\n background-color: ").concat(theme.color.surface.neutral, ";\n border-color: ").concat(theme.color.base.primary2, " !important;\n border-right: 1px solid ").concat(theme.color.base.primary2, ";\n }\n & .ant-input-group:has(.ant-input-group-addon:last-child:hover) > .ant-input:first-child,\n & .ant-input-group:has(.ant-input-group-addon:last-child:hover) > .ant-input-affix-wrapper:first-child {\n border-right: 0 !important;\n }\n & .ant-input-group:has(.ant-input-group-addon:last-child:focus-within) > .ant-input:first-child,\n & .ant-input-group:has(.ant-input-group-addon:last-child:focus-within) > .ant-input-affix-wrapper:first-child {\n border-right: 0 !important;\n }\n & .ant-input-group:has(.ant-input-group-addon:not(:last-child):hover) > .ant-input:last-child,\n & .ant-input-group:has(.ant-input-group-addon:not(:last-child):hover) > .ant-input-affix-wrapper:last-child {\n border-left: 0 !important;\n }\n & .ant-input-group:has(.ant-input-group-addon:not(:last-child):focus-within) > .ant-input:last-child,\n & .ant-input-group:has(.ant-input-group-addon:not(:last-child):focus-within) > .ant-input-affix-wrapper:last-child {\n border-left: 0 !important;\n }\n ").concat(disabledAddon
|
|
14
|
+
? "\n & .ant-input-group-addon:last-child {\n background-color: ".concat(theme.color.surface.disabledSurface, ";\n color: ").concat(theme.color.base.onNeutral, ";\n pointer-events: none;\n cursor: not-allowed;\n border-color: ").concat(theme.color.base.line, ";\n border-left: 1px solid ").concat(theme.color.base.line, ";\n &:has([data-addon-custom]) {\n background-color: ").concat(theme.color.surface.disabledSurface, ";\n }\n }\n & .ant-input-group > .ant-input:first-child,\n & .ant-input-group > .ant-input-affix-wrapper:first-child {\n border-right: 0;\n }\n & .ant-input-group-addon:not(:last-child) {\n background-color: ").concat(theme.color.surface.disabledSurface, ";\n color: ").concat(theme.color.base.onNeutral, ";\n pointer-events: none;\n cursor: not-allowed;\n border-color: ").concat(theme.color.base.line, ";\n border-right: 1px solid ").concat(theme.color.base.line, ";\n &:has([data-addon-custom]) {\n background-color: ").concat(theme.color.surface.disabledSurface, ";\n }\n }\n & .ant-input-group > .ant-input:last-child,\n & .ant-input-group > .ant-input-affix-wrapper:last-child {\n border-left: 0;\n }\n ")
|
|
15
|
+
: '', "\n ");
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=inputStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputStyles.js","sourceRoot":"","sources":["../../../src/components/Input/inputStyles.ts"],"names":[],"mappings":";;;AAUA,8CAySC;AAnTD,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,KA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@ -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
|