@stokr/components-library 2.3.65-beta.8 → 2.3.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/2FA/login-with-otp-flow.js +1 -1
- package/dist/components/2FA/main-flow.js +40 -12
- package/dist/components/AdminDashboard/Table/ReactTable.js +123 -7
- package/dist/components/Chips/Chip.js +1 -2
- package/dist/components/Chips/Chip.styles.js +3 -2
- package/dist/components/ConfirmModal/ConfirmModal.js +240 -0
- package/dist/components/ConfirmModal/ConfirmModal.styles.js +26 -0
- package/dist/components/CryptoAddress/CryptoAddress.js +10 -4
- package/dist/components/CryptoAddress/CryptoAddress.styles.js +1 -1
- package/dist/components/Footer/FooterLayout.js +13 -4
- package/dist/components/Footer/FooterMenu.js +19 -3
- package/dist/components/Footer/FooterMenu.styles.js +14 -2
- package/dist/components/Header/Header.styles.js +1 -1
- package/dist/components/Input/DatePickerInput.js +134 -30
- package/dist/components/Input/DatePickerInput.styles.js +16 -3
- package/dist/components/Input/MultiSelect.js +10 -8
- package/dist/components/Input/TableFilterDropdown.js +228 -0
- package/dist/components/Input/Textarea.js +59 -0
- package/dist/components/Input/Textarea.styles.js +18 -0
- package/dist/components/Modal/Modal.js +39 -6
- package/dist/components/Modal/Modal.styles.js +2 -2
- package/dist/components/Modal/SideModal.js +44 -2
- package/dist/components/Modal/SuccessModal/SuccessModal.js +173 -0
- package/dist/components/Modal/SuccessModal/SuccessModal.styles.js +29 -0
- package/dist/components/Modal/SuccessModal/index.js +37 -0
- package/dist/components/Payment/PaymentDetailsCard.js +14 -11
- package/dist/components/Payment/PaymentDisplay.js +2 -12
- package/dist/components/Snackbar/Snackbar.js +3 -0
- package/dist/components/Snackbar/Snackbar.styles.js +18 -9
- package/dist/components/StatusTag/StatusTag.js +38 -71
- package/dist/components/StatusTag/StatusTag.styles.js +4 -16
- package/dist/components/Timeline/Timeline.styles.js +1 -1
- package/dist/components/Timeline/TimelineStep.js +0 -1
- package/dist/favicon.ico +0 -0
- package/dist/index.css +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/index.umd.cjs +10371 -0
- package/dist/index.umd.cjs.map +1 -0
- package/dist/logo192.png +0 -0
- package/dist/logo512.png +0 -0
- package/dist/manifest.json +25 -0
- package/dist/robots.txt +3 -0
- package/dist/static/animations/checked.lottie +0 -0
- package/dist/static/animations/progress.lottie +0 -0
- package/dist/static/images/add-folder-icon.svg +5 -0
- package/dist/static/images/background3.png +0 -0
- package/dist/static/images/bmn2-logo.svg +9 -9
- package/dist/static/images/checkmark-circle-icon.svg +4 -0
- package/dist/static/images/close-circle-icon.svg +3 -0
- package/dist/static/images/doc-icon.svg +4 -0
- package/dist/static/images/filter-icon.svg +6 -0
- package/dist/styles/colors.js +2 -1
- package/dist/styles/global.js +1 -1
- package/dist/utils/customHooks.js +24 -2
- package/dist/utils/formatCurrencyValue.js +9 -2
- package/package.json +4 -2
- package/dist/components/2FA/EnterCode.stories.js +0 -35
- package/dist/components/2FA/disable-2fa-flow.stories.js +0 -31
- package/dist/components/2FA/enable-2fa-flow.stories.js +0 -31
- package/dist/components/2FA/login-with-otp-flow.stories.js +0 -31
- package/dist/components/2FA/main-flow.stories.js +0 -162
- package/dist/components/AccountBalance/AccountBalance.stories.js +0 -83
- package/dist/components/AdminDashboard/Table/ReactTable.stories.js +0 -406
- package/dist/components/AgreementItem/AgreementItem.stories.js +0 -105
- package/dist/components/AnalyticGraphs/Analytic.js +0 -541
- package/dist/components/AnalyticGraphs/Analytic.styles.js +0 -25
- package/dist/components/BackButton/BackButton.stories.js +0 -32
- package/dist/components/Background/Background.stories.js +0 -75
- package/dist/components/BarChart/BarChart.js +0 -263
- package/dist/components/BarChart/BarChart.stories.js +0 -66
- package/dist/components/BarChart/BarChart.styles.js +0 -26
- package/dist/components/BarChartLegend/BarChartLegend.js +0 -79
- package/dist/components/BarChartLegend/BarChartLegend.styles.js +0 -21
- package/dist/components/BasicTable/BasicTable.stories.js +0 -59
- package/dist/components/BlogPost/BlogPost.stories.js +0 -160
- package/dist/components/Button/Button.stories.js +0 -146
- package/dist/components/Button/GlareButton.stories.js +0 -132
- package/dist/components/CapitalRaisedSummary/CapitalRaisedSummery.stories.js +0 -42
- package/dist/components/ChartBox/ChartBox.js +0 -41
- package/dist/components/ChartBox/ChartBox.stories.js +0 -17
- package/dist/components/ChartBox/ChartBox.styles.js +0 -27
- package/dist/components/ChartBox/ChartBoxDistribution.js +0 -27
- package/dist/components/ChartBox/ChartBoxDistribution.stories.js +0 -18
- package/dist/components/ChartLegend/ChartLegend.stories.js +0 -90
- package/dist/components/Checkbox/Checkbox.stories.js +0 -88
- package/dist/components/Checklist/ChecklistCard.stories.js +0 -102
- package/dist/components/Checklist/UserChecklist.js +0 -184
- package/dist/components/Checklist/UserChecklist.stories.js +0 -317
- package/dist/components/Chips/Chip.stories.js +0 -36
- package/dist/components/Chips/ChipsWrapper.stories.js +0 -47
- package/dist/components/ComponentScroll/ComponentScroll.stories.js +0 -111
- package/dist/components/CryptoAddress/CryptoAddress.stories.js +0 -205
- package/dist/components/CryptoAddressDetails/CryptoAddressDetails.stories.js +0 -70
- package/dist/components/DonutChart/DonutChart.stories.js +0 -54
- package/dist/components/FAQ/FAQ.stories.js +0 -76
- package/dist/components/Footer/Footer.stories.js +0 -49
- package/dist/components/Footer/FooterLayout.stories.js +0 -26
- package/dist/components/Footer/FooterMenu.stories.js +0 -113
- package/dist/components/Footer/mangopay.png +0 -0
- package/dist/components/Footer/mangopay.svg +0 -20
- package/dist/components/ForgotPasswordModal/ForgotPasswordModal.stories.js +0 -69
- package/dist/components/Form/Form.stories.js +0 -32
- package/dist/components/FullscreenCard/FullscreenCard.styles.js +0 -27
- package/dist/components/Header/Header.stories.js +0 -192
- package/dist/components/Icon/Icon.stories.js +0 -108
- package/dist/components/InfoIcon/InfoIcon.stories.js +0 -299
- package/dist/components/InfoPanel/InfoPanel.js +0 -124
- package/dist/components/Input/DatePickerInput.stories.js +0 -87
- package/dist/components/Input/Input.stories.js +0 -217
- package/dist/components/Input/InputPassword.stories.js +0 -80
- package/dist/components/Input/InputWithButton.stories.js +0 -75
- package/dist/components/Input/MultiSelect.stories.js +0 -264
- package/dist/components/Input/OtpInput.stories.js +0 -57
- package/dist/components/Input/RangeInput.stories.js +0 -58
- package/dist/components/Input/SearchInput.stories.js +0 -366
- package/dist/components/Input/Select.stories.js +0 -478
- package/dist/components/InvestCalculator/InvestCalculator.stories.js +0 -135
- package/dist/components/InvestmentStat/InvestmentStat.stories.js +0 -52
- package/dist/components/KYCFlow/BasicInfo.js +0 -448
- package/dist/components/KYCFlow/Confirmation.js +0 -46
- package/dist/components/KYCFlow/DocumentFileUpload.js +0 -263
- package/dist/components/KYCFlow/DocumentScan.js +0 -75
- package/dist/components/KYCFlow/DocumentScanUpload.js +0 -251
- package/dist/components/KYCFlow/DocumentSelect.js +0 -118
- package/dist/components/KYCFlow/DocumentSuccess.js +0 -63
- package/dist/components/KYCFlow/DocumentUpload.js +0 -53
- package/dist/components/KYCFlow/DocumentVerificationType.js +0 -131
- package/dist/components/KYCFlow/FaceScan.js +0 -54
- package/dist/components/KYCFlow/FaceScanRecognition.js +0 -61
- package/dist/components/KYCFlow/FaceScanSuccess.js +0 -56
- package/dist/components/KYCFlow/Terms.js +0 -119
- package/dist/components/KYCFlow/_styles.js +0 -111
- package/dist/components/KYCFlow/index.js +0 -97
- package/dist/components/KYCSelectBox/KYCSelectBox.styles.js +0 -29
- package/dist/components/LatestUpdate/LatestUpdate.stories.js +0 -58
- package/dist/components/Layout/Layout.stories.js +0 -60
- package/dist/components/LearnMoreCarousel/LearnMoreCarousel.stories.js +0 -66
- package/dist/components/LearnMorePage/LearnMore.stories.js +0 -48
- package/dist/components/LearnMorePage/LearnMoreItem.stories.js +0 -62
- package/dist/components/LearnMoreSection/LearnMore.stories.js +0 -30
- package/dist/components/LearnMoreSection/LearnMoreItem.stories.js +0 -59
- package/dist/components/LoginModal/LoginModal.stories.js +0 -74
- package/dist/components/MatomoConnect/Matomo.js +0 -228
- package/dist/components/MatomoConnect/Matomo_fuckup.js +0 -387
- package/dist/components/Modal/Modal.stories.js +0 -75
- package/dist/components/Modal/NewVentureModal/NewVentureModal.stories.js +0 -150
- package/dist/components/Modal/PaymentModal.stories.js +0 -57
- package/dist/components/Modal/SideModal.stories.js +0 -342
- package/dist/components/MultiProgressBar/MultiProgressBar.stories.js +0 -67
- package/dist/components/Newsletter/Newsletter.stories.js +0 -16
- package/dist/components/NotificationContext/NotificationContext.js +0 -141
- package/dist/components/Number/Number.stories.js +0 -92
- package/dist/components/Pagination/Pagination.stories.js +0 -83
- package/dist/components/Pagination/PaginationControls.stories.js +0 -112
- package/dist/components/Payment/PaymentDetailsCard.stories.js +0 -198
- package/dist/components/Payment/PaymentDisplay.stories.js +0 -302
- package/dist/components/Payment/TimerComponent.stories.js +0 -236
- package/dist/components/Process/Process.stories.js +0 -42
- package/dist/components/ProfileBadge/ProfileBadge.stories.js +0 -45
- package/dist/components/ProfileBox/ProfileBox.stories.js +0 -35
- package/dist/components/ProfileHeader/ProfileHeader.js +0 -252
- package/dist/components/ProfileHeader/ProfileHeader.styles.js +0 -65
- package/dist/components/ProfileStat/ProfileStat.stories.js +0 -66
- package/dist/components/ProofOfAddress/ProofOfAddress.styles.js +0 -53
- package/dist/components/QRCode/QRCode.stories.js +0 -104
- package/dist/components/Radio/Radio.stories.js +0 -73
- package/dist/components/RefreshButton/RefreshButton.stories.js +0 -38
- package/dist/components/RegisterAlgorand/AlgoAddressName.js +0 -138
- package/dist/components/RegisterAlgorand/AlgoAdressSelect.js +0 -443
- package/dist/components/RegisterAlgorand/AlgoConnectWallet.js +0 -47
- package/dist/components/RegisterAlgorand/AlgoSuccess.js +0 -38
- package/dist/components/RegisterAlgorand/Algorand.stories.js +0 -80
- package/dist/components/RegisterAlgorand/ChooseWallet.js +0 -97
- package/dist/components/RegisterAlgorand/SelectProject.js +0 -89
- package/dist/components/RegisterAlgorand/_styles.js +0 -28
- package/dist/components/RegisterAlgorand/flow.js +0 -409
- package/dist/components/RegisterAlgorand/flowWithMemo.js +0 -410
- package/dist/components/RegisterAlgorand/index.js +0 -48
- package/dist/components/RegisterConfirmModal/RegisterConfirmModal.stories.js +0 -41
- package/dist/components/RegisterEthereum/EthAddressLedger.js +0 -226
- package/dist/components/RegisterEthereum/EthAddressMetamask.js +0 -204
- package/dist/components/RegisterEthereum/EthAddressName.js +0 -135
- package/dist/components/RegisterEthereum/EthConnectLedger.js +0 -194
- package/dist/components/RegisterEthereum/EthConnectMetamask.js +0 -35
- package/dist/components/RegisterEthereum/EthFinish.js +0 -41
- package/dist/components/RegisterEthereum/EthIntro.js +0 -95
- package/dist/components/RegisterEthereum/_styles.js +0 -28
- package/dist/components/RegisterEthereum/index.js +0 -68
- package/dist/components/RegisterModal/RegisterModal.stories.js +0 -49
- package/dist/components/RequestDataBox/RequestDataBox.stories.js +0 -37
- package/dist/components/RiskQuestionnaire/RiskQuestionnaireContext.js +0 -185
- package/dist/components/RiskQuestionnaire/_styles.js +0 -15
- package/dist/components/SEO/SEO.stories.js +0 -60
- package/dist/components/SideLine/SideLine.stories.js +0 -28
- package/dist/components/SigningSubflow/SignSubAddressMetamask.js +0 -137
- package/dist/components/SigningSubflow/SignSubConnectLedger.js +0 -150
- package/dist/components/SigningSubflow/SignSubConnectMetamask.js +0 -137
- package/dist/components/SigningSubflow/SignSubIntro.js +0 -55
- package/dist/components/SigningSubflow/SignSubSendLedger.js +0 -150
- package/dist/components/SigningSubflow/SignSubSendMetamask.js +0 -62
- package/dist/components/SigningSubflow/SignSubTransactionLedger.js +0 -161
- package/dist/components/SigningSubflow/SignSubTransactionMetamask.js +0 -166
- package/dist/components/SigningSubflow/_styles.js +0 -34
- package/dist/components/SigningSubflow/index.js +0 -32
- package/dist/components/Slider/Slider.stories.js +0 -68
- package/dist/components/Snackbar/Snackbar.stories.js +0 -292
- package/dist/components/StatusTag/StatusTag.stories.js +0 -262
- package/dist/components/StepController/StepController.stories.js +0 -60
- package/dist/components/StepController/StepControllerProgress.stories.js +0 -49
- package/dist/components/StepsProgress/StepIndicator.stories.js +0 -153
- package/dist/components/StepsProgress/StepsProgress.stories.js +0 -49
- package/dist/components/Switch/Switch.stories.js +0 -81
- package/dist/components/Tabs/Tabs.stories.js +0 -36
- package/dist/components/TabsNav/TabNav.stories.js +0 -40
- package/dist/components/TabsNav/TabsNav.stories.js +0 -37
- package/dist/components/TeamOverview/TeamOverview.stories.js +0 -76
- package/dist/components/TermsModal/TermsModal.stories.js +0 -31
- package/dist/components/Text/Headline.stories.js +0 -48
- package/dist/components/Text/Text.stories.js +0 -70
- package/dist/components/TextLink/TextLink.stories.js +0 -35
- package/dist/components/Timeline/Timeline.stories.js +0 -393
- package/dist/components/ToDoList/ToDoList.stories.js +0 -133
- package/dist/components/ToDoList/ToDoListTask.stories.js +0 -70
- package/dist/components/TransactionDetails/TransactionDetails.stories.js +0 -55
- package/dist/components/TransactionDetails/TransactionDetailsTable.stories.js +0 -305
- package/dist/components/TransactionInfo/TransactionInfo.stories.js +0 -61
- package/dist/components/TwoFactorModal/TwoFactorModal.js +0 -100
- package/dist/components/VerifyEmailModal/VerifyEmailModal.stories.js +0 -59
- package/dist/components/headerHo/HeaderHo.stories.js +0 -35
- package/dist/components/icons/Arrow.stories.js +0 -42
- package/dist/components/icons/ArrowSimple.stories.js +0 -48
- package/dist/components/icons/Check.stories.js +0 -22
- package/dist/components/icons/Facebook.stories.js +0 -21
- package/dist/components/icons/Facebook_Logo.png +0 -0
- package/dist/components/icons/Info.stories.js +0 -16
- package/dist/components/icons/Instagram.stories.js +0 -21
- package/dist/components/icons/LI-In-Bug.png +0 -0
- package/dist/components/icons/LinkIcon.stories.js +0 -21
- package/dist/components/icons/LinkedIn.stories.js +0 -16
- package/dist/components/icons/Medium.stories.js +0 -16
- package/dist/components/icons/Reddit.stories.js +0 -21
- package/dist/components/icons/Share.stories.js +0 -16
- package/dist/components/icons/Telegram-Logo.png +0 -0
- package/dist/components/icons/Telegram.stories.js +0 -16
- package/dist/components/icons/Twitter.stories.js +0 -21
- package/dist/components/icons/X-logo-black.png +0 -0
- package/dist/components/icons/X.stories.js +0 -16
- package/dist/components/icons/Youtube.stories.js +0 -21
- package/dist/components/icons/youtube_social_circle_red.png +0 -0
- package/dist/components/logo/Logo.stories.js +0 -260
- package/dist/components/taxId/TaxId.stories.js +0 -50
- package/dist/components/video/Video.stories.js +0 -52
- package/dist/static/images/document-icon.svg +0 -3
- package/dist/static/images/sent-icon.svg +0 -10
|
@@ -86,7 +86,7 @@ const LoginWithOTP = _ref => {
|
|
|
86
86
|
message: undefined
|
|
87
87
|
});
|
|
88
88
|
};
|
|
89
|
-
const backgroundProp = "url(".concat(_background.default, ") left
|
|
89
|
+
const backgroundProp = "url(".concat(_background.default, ") left top no-repeat");
|
|
90
90
|
return /*#__PURE__*/_react.default.createElement(_Layout.Layout, {
|
|
91
91
|
noHeader: true,
|
|
92
92
|
noFooter: true
|
|
@@ -17,7 +17,7 @@ var _colors = _interopRequireDefault(require("../../styles/colors"));
|
|
|
17
17
|
var _InfoIcon = _interopRequireDefault(require("../InfoIcon/InfoIcon"));
|
|
18
18
|
var _Modal = require("../Modal/Modal");
|
|
19
19
|
var _Sucess2FA = _interopRequireDefault(require("./Sucess2FA"));
|
|
20
|
-
const _excluded = ["onRequiresRecentLoginError", "open2faflow", "onLoginAgainClick", "openDisable2faflow", "title", "subtitle", "showSwitch", "customComponent"];
|
|
20
|
+
const _excluded = ["onRequiresRecentLoginError", "open2faflow", "onLoginAgainClick", "openDisable2faflow", "title", "subtitle", "showSwitch", "customComponent", "onFlowClose"];
|
|
21
21
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
22
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
23
23
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -36,7 +36,8 @@ const Main2FAFlow = _ref => {
|
|
|
36
36
|
title = 'SET UP YOUR LOG IN TWO FACTOR AUTHENTICATION',
|
|
37
37
|
subtitle = 'Protect your account with an additional layer of security to log in',
|
|
38
38
|
showSwitch = true,
|
|
39
|
-
customComponent
|
|
39
|
+
customComponent,
|
|
40
|
+
onFlowClose
|
|
40
41
|
} = _ref,
|
|
41
42
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
42
43
|
const {
|
|
@@ -79,6 +80,9 @@ const Main2FAFlow = _ref => {
|
|
|
79
80
|
} catch (error) {
|
|
80
81
|
if (error.code === 'auth/requires-recent-login' || error.code === 'auth/unsupported-first-factor') {
|
|
81
82
|
setisLoginRequired(true);
|
|
83
|
+
if (isFlowopen.enable2fa && !isFlowopen.requiresRecentLogin) {
|
|
84
|
+
onRequiresRecentLoginErrorHandler();
|
|
85
|
+
}
|
|
82
86
|
}
|
|
83
87
|
}
|
|
84
88
|
};
|
|
@@ -88,6 +92,14 @@ const Main2FAFlow = _ref => {
|
|
|
88
92
|
[nextFlowId]: true
|
|
89
93
|
}));
|
|
90
94
|
};
|
|
95
|
+
|
|
96
|
+
// Helper to close a flow and call the custom onFlowClose handler
|
|
97
|
+
const handleFlowClose = flowId => {
|
|
98
|
+
setIsFlowOpen(prev => _objectSpread(_objectSpread({}, prev), {}, {
|
|
99
|
+
[flowId]: false
|
|
100
|
+
}));
|
|
101
|
+
onFlowClose && onFlowClose(flowId);
|
|
102
|
+
};
|
|
91
103
|
const onEnable2FASuccess = async () => {
|
|
92
104
|
setis2FAEnabled(true);
|
|
93
105
|
checkMfaEnrollment();
|
|
@@ -112,11 +124,15 @@ const Main2FAFlow = _ref => {
|
|
|
112
124
|
openEnable2FA: () => switchOpenFlow('disable2fa', 'enable2fa'),
|
|
113
125
|
openDisable2FA: () => switchOpenFlow('enable2fa', 'disable2fa'),
|
|
114
126
|
closeFlows: () => {
|
|
127
|
+
const wasOpen = Object.keys(isFlowopen).find(key => isFlowopen[key]);
|
|
115
128
|
setIsFlowOpen({
|
|
116
129
|
enable2fa: false,
|
|
117
130
|
disable2fa: false,
|
|
118
131
|
requiresRecentLogin: false
|
|
119
132
|
});
|
|
133
|
+
if (wasOpen) {
|
|
134
|
+
onFlowClose && onFlowClose(wasOpen);
|
|
135
|
+
}
|
|
120
136
|
},
|
|
121
137
|
is2FAEnabled,
|
|
122
138
|
isFlowOpen: isFlowopen
|
|
@@ -169,24 +185,34 @@ const Main2FAFlow = _ref => {
|
|
|
169
185
|
flowActions
|
|
170
186
|
}) : customComponent), isFlowopen.enable2fa && /*#__PURE__*/_react.default.createElement(_enable2faFlow.default, {
|
|
171
187
|
showFlow: isFlowopen.enable2fa,
|
|
172
|
-
setShowFlow: value =>
|
|
173
|
-
|
|
174
|
-
|
|
188
|
+
setShowFlow: value => {
|
|
189
|
+
if (!value) {
|
|
190
|
+
handleFlowClose('enable2fa');
|
|
191
|
+
} else {
|
|
192
|
+
setIsFlowOpen(_objectSpread(_objectSpread({}, isFlowopen), {}, {
|
|
193
|
+
enable2fa: value
|
|
194
|
+
}));
|
|
195
|
+
}
|
|
196
|
+
},
|
|
175
197
|
totpData: totpData,
|
|
176
198
|
onRequiresRecentLoginError: onRequiresRecentLoginErrorHandler,
|
|
177
199
|
onSuccess: onEnable2FASuccess
|
|
178
200
|
}), isFlowopen.disable2fa && /*#__PURE__*/_react.default.createElement(_disable2faFlow.default, {
|
|
179
201
|
showFlow: isFlowopen.disable2fa,
|
|
180
|
-
setShowFlow: value =>
|
|
181
|
-
|
|
182
|
-
|
|
202
|
+
setShowFlow: value => {
|
|
203
|
+
if (!value) {
|
|
204
|
+
handleFlowClose('disable2fa');
|
|
205
|
+
} else {
|
|
206
|
+
setIsFlowOpen(_objectSpread(_objectSpread({}, isFlowopen), {}, {
|
|
207
|
+
disable2fa: value
|
|
208
|
+
}));
|
|
209
|
+
}
|
|
210
|
+
},
|
|
183
211
|
onRequiresRecentLoginError: onRequiresRecentLoginErrorHandler,
|
|
184
212
|
onSuccess: onDisable2FASuccess
|
|
185
213
|
}), isFlowopen.requiresRecentLogin && /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
|
|
186
214
|
isOpen: isFlowopen.requiresRecentLogin,
|
|
187
|
-
onClose: () =>
|
|
188
|
-
requiresRecentLogin: false
|
|
189
|
-
}))
|
|
215
|
+
onClose: () => handleFlowClose('requiresRecentLogin')
|
|
190
216
|
}, /*#__PURE__*/_react.default.createElement(_Modal.ModalInner, {
|
|
191
217
|
noPadding: true
|
|
192
218
|
}, /*#__PURE__*/_react.default.createElement(_Sucess2FA.default, {
|
|
@@ -200,6 +226,8 @@ const Main2FAFlow = _ref => {
|
|
|
200
226
|
};
|
|
201
227
|
exports.Main2FAFlow = Main2FAFlow;
|
|
202
228
|
Main2FAFlow.propTypes = {
|
|
203
|
-
onRequiresRecentLoginError: _propTypes.default.func
|
|
229
|
+
onRequiresRecentLoginError: _propTypes.default.func,
|
|
230
|
+
/** Called when any flow/modal is closed. Receives the flowId: 'enable2fa' | 'disable2fa' | 'requiresRecentLogin' */
|
|
231
|
+
onFlowClose: _propTypes.default.func
|
|
204
232
|
};
|
|
205
233
|
var _default = exports.default = Main2FAFlow;
|
|
@@ -18,6 +18,31 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
18
18
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
19
19
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
20
20
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
21
|
+
// Interactive elements that should NOT trigger row click
|
|
22
|
+
const INTERACTIVE_ELEMENTS = ['button', 'a', 'input', 'select', 'textarea', 'label'];
|
|
23
|
+
|
|
24
|
+
// Check if an element or its parents are interactive
|
|
25
|
+
const isInteractiveElement = element => {
|
|
26
|
+
let current = element;
|
|
27
|
+
while (current && current.tagName !== 'TR') {
|
|
28
|
+
var _current$tagName, _current$getAttribute, _current, _current$dataset;
|
|
29
|
+
const tagName = (_current$tagName = current.tagName) === null || _current$tagName === void 0 ? void 0 : _current$tagName.toLowerCase();
|
|
30
|
+
if (INTERACTIVE_ELEMENTS.includes(tagName)) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
// Check for role="button" or other interactive roles
|
|
34
|
+
const role = (_current$getAttribute = (_current = current).getAttribute) === null || _current$getAttribute === void 0 ? void 0 : _current$getAttribute.call(_current, 'role');
|
|
35
|
+
if (role === 'button' || role === 'link') {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
// Check for data-clickable attribute (escape hatch for custom interactive elements)
|
|
39
|
+
if (((_current$dataset = current.dataset) === null || _current$dataset === void 0 ? void 0 : _current$dataset.clickable) === 'true') {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
current = current.parentElement;
|
|
43
|
+
}
|
|
44
|
+
return false;
|
|
45
|
+
};
|
|
21
46
|
function ReactTable(props) {
|
|
22
47
|
const {
|
|
23
48
|
columns,
|
|
@@ -37,6 +62,19 @@ function ReactTable(props) {
|
|
|
37
62
|
getRowDataCy,
|
|
38
63
|
// Function to generate data-cy attribute: (rowData, rowIndex) => string
|
|
39
64
|
|
|
65
|
+
// Row click handler: (rowData, rowIndex, event) => void
|
|
66
|
+
// Will NOT trigger if clicking on buttons, links, inputs, etc.
|
|
67
|
+
onRowClick,
|
|
68
|
+
// Custom expanded content renderer: (row, toggleExpanded) => ReactNode
|
|
69
|
+
// If provided, this will be used instead of the sub-table
|
|
70
|
+
renderExpandedContent,
|
|
71
|
+
// Header click handler: (column, event) => void
|
|
72
|
+
// Called when a header cell is clicked (useful for sorting/filtering)
|
|
73
|
+
// Won't trigger if clicking on interactive elements inside header
|
|
74
|
+
onHeaderClick,
|
|
75
|
+
// Render custom header content: (column, defaultContent) => ReactNode
|
|
76
|
+
// Allows wrapping/replacing header content (e.g., add sort icons, dropdowns)
|
|
77
|
+
renderHeaderContent,
|
|
40
78
|
//instead of passing the subData, we pass a function that will calculate the subData
|
|
41
79
|
//subData must be part of the data array (an array or whatever)
|
|
42
80
|
//calculateSubData is a function that receives the row and returns the subData
|
|
@@ -75,6 +113,17 @@ function ReactTable(props) {
|
|
|
75
113
|
setInputPageSize(pageSize);
|
|
76
114
|
}, [pageSize]);
|
|
77
115
|
|
|
116
|
+
// Handle row click with interactive element detection
|
|
117
|
+
const handleRowClick = (0, _react.useCallback)((row, rowIndex, event) => {
|
|
118
|
+
if (!onRowClick) return;
|
|
119
|
+
|
|
120
|
+
// Don't trigger if clicking on interactive elements
|
|
121
|
+
if (isInteractiveElement(event.target)) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
onRowClick(row.original, rowIndex, event);
|
|
125
|
+
}, [onRowClick]);
|
|
126
|
+
|
|
78
127
|
// Function to render cell content with hover support
|
|
79
128
|
const renderCellContent = (cell, rowIndex, rowData) => {
|
|
80
129
|
if (customRowHoverContent && hoveredRowIndex === rowIndex) {
|
|
@@ -85,21 +134,65 @@ function ReactTable(props) {
|
|
|
85
134
|
}
|
|
86
135
|
return cell.render('Cell');
|
|
87
136
|
};
|
|
137
|
+
|
|
138
|
+
// Determine if row should have expand functionality
|
|
139
|
+
const shouldEnableExpand = withSubTable || renderExpandedContent;
|
|
140
|
+
|
|
141
|
+
// Handle header click with interactive element detection
|
|
142
|
+
const handleHeaderClick = (0, _react.useCallback)((column, event) => {
|
|
143
|
+
// Check for column-level click handler first
|
|
144
|
+
if (column.onHeaderClick) {
|
|
145
|
+
// Don't trigger if clicking on interactive elements
|
|
146
|
+
if (!isInteractiveElement(event.target)) {
|
|
147
|
+
column.onHeaderClick(column, event);
|
|
148
|
+
}
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Fall back to global onHeaderClick
|
|
153
|
+
if (!onHeaderClick) return;
|
|
154
|
+
|
|
155
|
+
// Don't trigger if clicking on interactive elements inside header
|
|
156
|
+
if (isInteractiveElement(event.target)) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
onHeaderClick(column, event);
|
|
160
|
+
}, [onHeaderClick]);
|
|
161
|
+
|
|
162
|
+
// Render header content with optional custom rendering
|
|
163
|
+
const renderHeader = column => {
|
|
164
|
+
const defaultContent = column.render('Header');
|
|
165
|
+
|
|
166
|
+
// If renderHeaderContent is provided, use it to wrap/modify the header
|
|
167
|
+
if (renderHeaderContent) {
|
|
168
|
+
return renderHeaderContent(column, defaultContent);
|
|
169
|
+
}
|
|
170
|
+
return defaultContent;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
// Check if header should be clickable
|
|
174
|
+
const isHeaderClickable = column => {
|
|
175
|
+
return column.onHeaderClick || onHeaderClick;
|
|
176
|
+
};
|
|
88
177
|
return /*#__PURE__*/_react.default.createElement(_Table.Styles, null, /*#__PURE__*/_react.default.createElement(_Table.TableWrap, {
|
|
89
178
|
style: tableWrapStyles
|
|
90
179
|
}, /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable, _extends({}, getTableProps(), {
|
|
91
180
|
customTableStyles: customTableStyles
|
|
92
181
|
}), /*#__PURE__*/_react.default.createElement("thead", null, headerGroups.map(headerGroup => /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Tr, headerGroup.getHeaderGroupProps(), headerGroup.headers.map(column => {
|
|
93
182
|
const cellStyles = customThStyles ? customThStyles(column) : {};
|
|
183
|
+
const clickable = isHeaderClickable(column);
|
|
94
184
|
return /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Th, _extends({}, column.getHeaderProps({
|
|
95
185
|
className: column.collapse ? 'collapse' : '',
|
|
96
|
-
style: _objectSpread({}, cellStyles)
|
|
186
|
+
style: _objectSpread(_objectSpread({}, cellStyles), clickable ? {
|
|
187
|
+
cursor: 'pointer'
|
|
188
|
+
} : {})
|
|
97
189
|
}), {
|
|
98
190
|
blue: blue,
|
|
99
191
|
width: column.width,
|
|
100
192
|
minWidth: column.minWidth,
|
|
101
|
-
maxWidth: column.maxWidth
|
|
102
|
-
|
|
193
|
+
maxWidth: column.maxWidth,
|
|
194
|
+
onClick: clickable ? e => handleHeaderClick(column, e) : undefined
|
|
195
|
+
}), renderHeader(column));
|
|
103
196
|
})))), /*#__PURE__*/_react.default.createElement("tbody", getTableBodyProps(), page.map((row, i) => {
|
|
104
197
|
prepareRow(row);
|
|
105
198
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
@@ -112,10 +205,17 @@ function ReactTable(props) {
|
|
|
112
205
|
rowIndex: i,
|
|
113
206
|
rowData: row.original,
|
|
114
207
|
onMouseEnter: () => setHoveredRowIndex(i),
|
|
115
|
-
onMouseLeave: () => setHoveredRowIndex(null)
|
|
208
|
+
onMouseLeave: () => setHoveredRowIndex(null),
|
|
209
|
+
onClick: e => handleRowClick(row, i, e),
|
|
210
|
+
style: onRowClick ? {
|
|
211
|
+
cursor: 'pointer'
|
|
212
|
+
} : undefined
|
|
116
213
|
}), row.cells.map(cell => {
|
|
117
214
|
const cellStyles = customTdStyles ? customTdStyles(i, row.original, cell.column) : {};
|
|
118
|
-
|
|
215
|
+
|
|
216
|
+
// Only apply expand toggle props if expansion is enabled
|
|
217
|
+
const expandProps = shouldEnableExpand ? cell.row.getToggleRowExpandedProps() : {};
|
|
218
|
+
return /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Td, _extends({}, expandProps, {
|
|
119
219
|
title: ""
|
|
120
220
|
}, cell.getCellProps({
|
|
121
221
|
className: cell.column.collapse ? 'collapse' : '',
|
|
@@ -126,7 +226,12 @@ function ReactTable(props) {
|
|
|
126
226
|
minWidth: cell.column.minWidth,
|
|
127
227
|
maxWidth: cell.column.maxWidth
|
|
128
228
|
}), renderCellContent(cell, i, row.original));
|
|
129
|
-
})),
|
|
229
|
+
})), renderExpandedContent && row.isExpanded && /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Tr, {
|
|
230
|
+
key: "".concat(row.id, "-expanded")
|
|
231
|
+
}, /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Td, {
|
|
232
|
+
colSpan: visibleColumns.length,
|
|
233
|
+
subTable: true
|
|
234
|
+
}, renderExpandedContent(row, row.toggleRowExpanded))), withSubTable && !renderExpandedContent && row.isExpanded && /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Tr, {
|
|
130
235
|
key: "".concat(row.id, "-").concat(i)
|
|
131
236
|
}, /*#__PURE__*/_react.default.createElement(_Table.StyledReactTable.Td, {
|
|
132
237
|
colSpan: visibleColumns.length,
|
|
@@ -160,7 +265,18 @@ ReactTable.propTypes = {
|
|
|
160
265
|
customRowHoverContent: _propTypes.default.func,
|
|
161
266
|
customRowStyles: _propTypes.default.func,
|
|
162
267
|
customTableStyles: _propTypes.default.func,
|
|
163
|
-
|
|
268
|
+
tableWrapStyles: _propTypes.default.object,
|
|
269
|
+
customTdStyles: _propTypes.default.func,
|
|
270
|
+
customThStyles: _propTypes.default.func,
|
|
271
|
+
getRowDataCy: _propTypes.default.func,
|
|
272
|
+
// (rowData, rowIndex) => string
|
|
273
|
+
onRowClick: _propTypes.default.func,
|
|
274
|
+
// (rowData, rowIndex, event) => void
|
|
275
|
+
renderExpandedContent: _propTypes.default.func,
|
|
276
|
+
// (row, toggleExpanded) => ReactNode
|
|
277
|
+
onHeaderClick: _propTypes.default.func,
|
|
278
|
+
// (column, event) => void
|
|
279
|
+
renderHeaderContent: _propTypes.default.func // (column, defaultContent) => ReactNode
|
|
164
280
|
};
|
|
165
281
|
ReactTable.defaultProps = {
|
|
166
282
|
blue: false,
|
|
@@ -28,10 +28,9 @@ const Chip = _ref => {
|
|
|
28
28
|
}, props), /*#__PURE__*/_react.default.createElement(_ChipStyles.ChipText, null, children), tooltip && /*#__PURE__*/_react.default.createElement(_InfoIcon.default, _extends({
|
|
29
29
|
title: tooltip,
|
|
30
30
|
position: "top",
|
|
31
|
-
noIcon: true,
|
|
32
31
|
noMarginLeft: true,
|
|
33
32
|
noMarginRight: true
|
|
34
|
-
}, tooltipProps)
|
|
33
|
+
}, tooltipProps)));
|
|
35
34
|
};
|
|
36
35
|
exports.Chip = Chip;
|
|
37
36
|
Chip.propTypes = {
|
|
@@ -6,15 +6,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.Wrapper = exports.TooltipChipIcon = exports.StyledChip = exports.ChipText = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
8
|
var _theme = _interopRequireDefault(require("../../styles/theme"));
|
|
9
|
+
var _InfoIcon = require("../InfoIcon/InfoIcon.styles");
|
|
9
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
11
|
const StyledChip = exports.StyledChip = _styledComponents.default.div.withConfig({
|
|
11
12
|
displayName: "Chipstyles__StyledChip",
|
|
12
13
|
componentId: "sc-pcmyil-0"
|
|
13
|
-
})(["display:inline-flex;gap:4px;align-items:center;padding:8px 16px;border-radius:20px;background-color:transparent;color:black;cursor:pointer;transition:background-color 0.3s;font-size:11px;font-weight:400;line-height:20px;letter-spacing:3px;font-weight:600;min-height:40px;&:hover,&:active{background-color:red;color:white;}", ""], _ref => {
|
|
14
|
+
})(["display:inline-flex;gap:4px;align-items:center;padding:8px 16px;border-radius:20px;background-color:transparent;color:black;cursor:pointer;transition:background-color 0.3s;font-size:11px;font-weight:400;line-height:20px;letter-spacing:3px;font-weight:600;min-height:40px;&:hover,&:active{background-color:red;color:white;", "{color:", ";}}", ""], _InfoIcon.Icon, _theme.default.cWhite, _ref => {
|
|
14
15
|
let {
|
|
15
16
|
isActive
|
|
16
17
|
} = _ref;
|
|
17
|
-
return isActive && "\n background-color: red;\n color: white;\n font-weight: 800;\n\n ".concat(
|
|
18
|
+
return isActive && "\n background-color: red;\n color: white;\n font-weight: 800;\n\n ".concat(_InfoIcon.Icon, " {\n color: ").concat(_theme.default.cWhite, " ;\n }\n ");
|
|
18
19
|
});
|
|
19
20
|
const Wrapper = exports.Wrapper = _styledComponents.default.div.withConfig({
|
|
20
21
|
displayName: "Chipstyles__Wrapper",
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.confirm = exports.ConfirmModal = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _client = require("react-dom/client");
|
|
9
|
+
var _Modal = require("../Modal/Modal");
|
|
10
|
+
var _Grid = require("../Grid/Grid.styles");
|
|
11
|
+
var _ComponentWrapper = require("../ComponentWrapper/ComponentWrapper.styles");
|
|
12
|
+
var _Button = require("../Button/Button.styles");
|
|
13
|
+
var _Text = require("../Text/Text.styles");
|
|
14
|
+
var _ConfirmModal = require("./ConfirmModal.styles");
|
|
15
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
17
|
+
// Container for the modal - created once
|
|
18
|
+
let confirmContainer = null;
|
|
19
|
+
let confirmRoot = null;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Internal ConfirmModal component
|
|
23
|
+
*/
|
|
24
|
+
const ConfirmModalComponent = _ref => {
|
|
25
|
+
let {
|
|
26
|
+
isOpen,
|
|
27
|
+
onClose,
|
|
28
|
+
onConfirm,
|
|
29
|
+
onCancel,
|
|
30
|
+
title,
|
|
31
|
+
message,
|
|
32
|
+
content,
|
|
33
|
+
confirmText,
|
|
34
|
+
cancelText,
|
|
35
|
+
showCancel,
|
|
36
|
+
showRedBar,
|
|
37
|
+
lineColor,
|
|
38
|
+
barColor,
|
|
39
|
+
renderFooter,
|
|
40
|
+
modalProps,
|
|
41
|
+
buttonProps,
|
|
42
|
+
cancelButtonProps,
|
|
43
|
+
contentFullWidth,
|
|
44
|
+
barStyle
|
|
45
|
+
} = _ref;
|
|
46
|
+
const [titleHeight, setTitleHeight] = (0, _react.useState)(0);
|
|
47
|
+
const observerRef = (0, _react.useRef)(null);
|
|
48
|
+
|
|
49
|
+
// Callback ref - guaranteed to run when element is attached to DOM
|
|
50
|
+
const titleRef = (0, _react.useCallback)(node => {
|
|
51
|
+
// Cleanup previous observer
|
|
52
|
+
if (observerRef.current) {
|
|
53
|
+
observerRef.current.disconnect();
|
|
54
|
+
observerRef.current = null;
|
|
55
|
+
}
|
|
56
|
+
if (node) {
|
|
57
|
+
// Set initial height immediately
|
|
58
|
+
setTitleHeight(node.offsetHeight);
|
|
59
|
+
|
|
60
|
+
// Watch for size changes
|
|
61
|
+
observerRef.current = new ResizeObserver(() => {
|
|
62
|
+
setTitleHeight(node.offsetHeight);
|
|
63
|
+
});
|
|
64
|
+
observerRef.current.observe(node);
|
|
65
|
+
}
|
|
66
|
+
}, []);
|
|
67
|
+
const handleConfirm = (0, _react.useCallback)(function () {
|
|
68
|
+
let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
69
|
+
onConfirm === null || onConfirm === void 0 || onConfirm(value);
|
|
70
|
+
onClose === null || onClose === void 0 || onClose();
|
|
71
|
+
}, [onConfirm, onClose]);
|
|
72
|
+
const handleCancel = (0, _react.useCallback)(() => {
|
|
73
|
+
onCancel === null || onCancel === void 0 || onCancel();
|
|
74
|
+
onClose === null || onClose === void 0 || onClose();
|
|
75
|
+
}, [onCancel, onClose]);
|
|
76
|
+
|
|
77
|
+
// Handle Escape key
|
|
78
|
+
(0, _react.useEffect)(() => {
|
|
79
|
+
if (!isOpen) return;
|
|
80
|
+
const handleKeyDown = e => {
|
|
81
|
+
if (e.key === 'Escape') {
|
|
82
|
+
handleCancel();
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
86
|
+
return () => document.removeEventListener('keydown', handleKeyDown);
|
|
87
|
+
}, [isOpen, handleCancel]);
|
|
88
|
+
return /*#__PURE__*/_react.default.createElement(_Modal.Modal, _extends({
|
|
89
|
+
isOpen: isOpen,
|
|
90
|
+
onClose: handleCancel,
|
|
91
|
+
maxHeight: "90vh",
|
|
92
|
+
boxStyles: {
|
|
93
|
+
minHeight: 'unset'
|
|
94
|
+
}
|
|
95
|
+
// maxWidth="1500px"
|
|
96
|
+
}, modalProps), /*#__PURE__*/_react.default.createElement(_Grid.Row, null, /*#__PURE__*/_react.default.createElement(_Grid.Column, {
|
|
97
|
+
relative: true,
|
|
98
|
+
part: contentFullWidth ? null : 14
|
|
99
|
+
}, /*#__PURE__*/_react.default.createElement(_Modal.ModalInner, null, /*#__PURE__*/_react.default.createElement(_ConfirmModal.ContainerWithLine, {
|
|
100
|
+
height: titleHeight,
|
|
101
|
+
lineColor: lineColor
|
|
102
|
+
}, /*#__PURE__*/_react.default.createElement(_Text.Text, null, /*#__PURE__*/_react.default.createElement("div", null, title && /*#__PURE__*/_react.default.createElement("h3", {
|
|
103
|
+
ref: titleRef,
|
|
104
|
+
style: {
|
|
105
|
+
margin: 0
|
|
106
|
+
}
|
|
107
|
+
}, title), message && /*#__PURE__*/_react.default.createElement("p", null, message)), content && /*#__PURE__*/_react.default.createElement("div", {
|
|
108
|
+
style: {
|
|
109
|
+
marginTop: '16px'
|
|
110
|
+
}
|
|
111
|
+
}, content)), renderFooter ? /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, renderFooter({
|
|
112
|
+
onConfirm: handleConfirm,
|
|
113
|
+
onCancel: handleCancel
|
|
114
|
+
})) : /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, {
|
|
115
|
+
noPaddingHorizontal: true,
|
|
116
|
+
flex: true,
|
|
117
|
+
style: {
|
|
118
|
+
gap: 16
|
|
119
|
+
}
|
|
120
|
+
}, showCancel && /*#__PURE__*/_react.default.createElement(_Button.Button, _extends({
|
|
121
|
+
outlineBlack: true,
|
|
122
|
+
minWidth: "120px",
|
|
123
|
+
onClick: handleCancel
|
|
124
|
+
}, cancelButtonProps), cancelText), /*#__PURE__*/_react.default.createElement(_Button.Button, _extends({
|
|
125
|
+
minWidth: "120px",
|
|
126
|
+
onClick: () => handleConfirm(true)
|
|
127
|
+
}, buttonProps), confirmText))))), showRedBar && /*#__PURE__*/_react.default.createElement(_ConfirmModal.RedBar, {
|
|
128
|
+
barColor: barColor,
|
|
129
|
+
style: barStyle
|
|
130
|
+
})));
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Imperative confirm function
|
|
135
|
+
*
|
|
136
|
+
* @param {Object} options - Confirm options
|
|
137
|
+
* @param {string} options.title - Modal title
|
|
138
|
+
* @param {string} options.message - Modal message text
|
|
139
|
+
* @param {React.ReactNode} options.content - Custom content (React components)
|
|
140
|
+
* @param {string} options.confirmText - Confirm button text (default: 'Confirm')
|
|
141
|
+
* @param {string} options.cancelText - Cancel button text (default: 'Cancel')
|
|
142
|
+
* @param {boolean} options.showCancel - Show cancel button (default: true)
|
|
143
|
+
* @param {boolean} options.showRedBar - Show red bar decoration (default: true)
|
|
144
|
+
* @param {string} options.lineColor - Color of the left line (default: blue)
|
|
145
|
+
* @param {string} options.barColor - Color of the bottom bar (default: orangishRed)
|
|
146
|
+
* @param {Function} options.renderFooter - Custom footer renderer: ({ onConfirm, onCancel }) => React.ReactNode
|
|
147
|
+
* @param {Object} options.modalProps - Additional props to pass to Modal component
|
|
148
|
+
* @param {Object} options.buttonProps - Props for the confirm button
|
|
149
|
+
* @param {Object} options.cancelButtonProps - Props for the cancel button
|
|
150
|
+
* @returns {Promise<boolean|any>} - Resolves with true/false or custom value from renderFooter
|
|
151
|
+
*/
|
|
152
|
+
exports.ConfirmModal = ConfirmModalComponent;
|
|
153
|
+
const confirm = function () {
|
|
154
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
155
|
+
const {
|
|
156
|
+
title = 'Confirm',
|
|
157
|
+
message = '',
|
|
158
|
+
content = null,
|
|
159
|
+
confirmText = 'Confirm',
|
|
160
|
+
cancelText = 'Cancel',
|
|
161
|
+
showCancel = true,
|
|
162
|
+
showRedBar = true,
|
|
163
|
+
lineColor,
|
|
164
|
+
barColor,
|
|
165
|
+
renderFooter = null,
|
|
166
|
+
modalProps = {},
|
|
167
|
+
buttonProps = {},
|
|
168
|
+
cancelButtonProps = {}
|
|
169
|
+
} = options;
|
|
170
|
+
return new Promise(resolve => {
|
|
171
|
+
// Create container if it doesn't exist
|
|
172
|
+
if (!confirmContainer) {
|
|
173
|
+
confirmContainer = document.createElement('div');
|
|
174
|
+
confirmContainer.id = 'confirm-modal-root';
|
|
175
|
+
document.body.appendChild(confirmContainer);
|
|
176
|
+
confirmRoot = (0, _client.createRoot)(confirmContainer);
|
|
177
|
+
}
|
|
178
|
+
let isResolved = false;
|
|
179
|
+
const handleConfirm = value => {
|
|
180
|
+
if (!isResolved) {
|
|
181
|
+
isResolved = true;
|
|
182
|
+
resolve(value);
|
|
183
|
+
// Render closed state to trigger animation
|
|
184
|
+
renderModal(false);
|
|
185
|
+
// Cleanup after animation
|
|
186
|
+
setTimeout(() => {
|
|
187
|
+
renderModal(null);
|
|
188
|
+
}, 350);
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
const handleCancel = () => {
|
|
192
|
+
if (!isResolved) {
|
|
193
|
+
isResolved = true;
|
|
194
|
+
resolve(false);
|
|
195
|
+
renderModal(false);
|
|
196
|
+
setTimeout(() => {
|
|
197
|
+
renderModal(null);
|
|
198
|
+
}, 350);
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
const handleClose = () => {
|
|
202
|
+
if (!isResolved) {
|
|
203
|
+
handleCancel();
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
const renderModal = isOpen => {
|
|
207
|
+
if (isOpen === null) {
|
|
208
|
+
// Cleanup
|
|
209
|
+
confirmRoot.render(null);
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
confirmRoot.render(/*#__PURE__*/_react.default.createElement(ConfirmModalComponent, {
|
|
213
|
+
isOpen: isOpen,
|
|
214
|
+
onClose: handleClose,
|
|
215
|
+
onConfirm: handleConfirm,
|
|
216
|
+
onCancel: handleCancel,
|
|
217
|
+
title: title,
|
|
218
|
+
message: message,
|
|
219
|
+
content: content,
|
|
220
|
+
confirmText: confirmText,
|
|
221
|
+
cancelText: cancelText,
|
|
222
|
+
showCancel: showCancel,
|
|
223
|
+
showRedBar: showRedBar,
|
|
224
|
+
lineColor: lineColor,
|
|
225
|
+
barColor: barColor,
|
|
226
|
+
renderFooter: renderFooter,
|
|
227
|
+
modalProps: modalProps,
|
|
228
|
+
buttonProps: buttonProps,
|
|
229
|
+
cancelButtonProps: cancelButtonProps
|
|
230
|
+
}));
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
// Render open modal
|
|
234
|
+
renderModal(true);
|
|
235
|
+
});
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
// Also export the component for controlled usage if needed
|
|
239
|
+
exports.confirm = confirm;
|
|
240
|
+
var _default = exports.default = confirm;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.RedBar = exports.ContainerWithLine = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _colors = _interopRequireDefault(require("../../styles/colors"));
|
|
9
|
+
var _rwd = _interopRequireDefault(require("../../styles/rwd"));
|
|
10
|
+
var _Text = _interopRequireDefault(require("../Text/Text.styles"));
|
|
11
|
+
var _templateObject;
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
14
|
+
const ContainerWithLine = exports.ContainerWithLine = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
15
|
+
displayName: "ConfirmModalstyles__ContainerWithLine",
|
|
16
|
+
componentId: "sc-u85j89-0"
|
|
17
|
+
})(["position:relative;padding-left:48px;&::before{content:'';width:11px;height:", "px;background:", ";position:absolute;left:0;top:6px;}"], _ref => {
|
|
18
|
+
let {
|
|
19
|
+
height
|
|
20
|
+
} = _ref;
|
|
21
|
+
return height ? height - 15 : 50;
|
|
22
|
+
}, props => props.lineColor || _colors.default.blue);
|
|
23
|
+
const RedBar = exports.RedBar = _styledComponents.default.div.withConfig({
|
|
24
|
+
displayName: "ConfirmModalstyles__RedBar",
|
|
25
|
+
componentId: "sc-u85j89-1"
|
|
26
|
+
})(["background:", ";bottom:0;height:20%;position:absolute;right:0;width:50%;max-height:85px;max-width:400px;", " @media (max-width:767px){display:none;}"], props => props.barColor || _colors.default.orangishRed, _rwd.default.Medium(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n "]))));
|
|
@@ -43,7 +43,8 @@ const CryptoAddress = _ref => {
|
|
|
43
43
|
wrapperStyle,
|
|
44
44
|
bodyStyle,
|
|
45
45
|
containerStyle,
|
|
46
|
-
dataValueStyle
|
|
46
|
+
dataValueStyle,
|
|
47
|
+
valueChildMarginLeft
|
|
47
48
|
} = _ref;
|
|
48
49
|
const [copiedAddressToClipboard, setCopiedAddressToClipboard] = (0, _react.useState)(false);
|
|
49
50
|
return /*#__PURE__*/_react.default.createElement(_CryptoAddress.Container, {
|
|
@@ -88,7 +89,8 @@ const CryptoAddress = _ref => {
|
|
|
88
89
|
style: dataBoxStyle
|
|
89
90
|
}, data.value && /*#__PURE__*/_react.default.createElement(_CryptoAddress.Value, {
|
|
90
91
|
fontSize: fontSize,
|
|
91
|
-
style: dataValueStyle
|
|
92
|
+
style: dataValueStyle,
|
|
93
|
+
childMarginLeft: valueChildMarginLeft
|
|
92
94
|
}, data.unit && "".concat(data.unit, " "), data.shortAddress ? /*#__PURE__*/_react.default.createElement(_reactTippy.Tooltip, {
|
|
93
95
|
position: "top",
|
|
94
96
|
title: data.value,
|
|
@@ -105,7 +107,9 @@ const CryptoAddress = _ref => {
|
|
|
105
107
|
}
|
|
106
108
|
}, '= ', data.eqUnit && "".concat(data.eqUnit, " "), data.eqValue)), /*#__PURE__*/_react.default.createElement(_CryptoAddress.InfoBox, {
|
|
107
109
|
style: infoBoxStyle
|
|
108
|
-
}, /*#__PURE__*/_react.default.createElement(_CryptoAddress.Value,
|
|
110
|
+
}, /*#__PURE__*/_react.default.createElement(_CryptoAddress.Value, {
|
|
111
|
+
childMarginLeft: valueChildMarginLeft
|
|
112
|
+
}, info.unit && /*#__PURE__*/_react.default.createElement("strong", null, info.unit), info.value), info.eqValue && /*#__PURE__*/_react.default.createElement(_CryptoAddress.Equal, {
|
|
109
113
|
fontSize: eqValueFontSize,
|
|
110
114
|
style: eqValueStyle
|
|
111
115
|
}, info.noEqualsToSign ? ' ' : '= ', info.eqUnit && /*#__PURE__*/_react.default.createElement("strong", null, info.eqUnit), " ".concat(info.eqValue)))), sideOptions && /*#__PURE__*/_react.default.createElement(_CryptoAddress.OptionsWrapper, null, sideOptions)))));
|
|
@@ -149,7 +153,9 @@ CryptoAddress.propTypes = {
|
|
|
149
153
|
headStyle: _propTypes.default.object,
|
|
150
154
|
infoBoxStyle: _propTypes.default.object,
|
|
151
155
|
wrapperStyle: _propTypes.default.object,
|
|
152
|
-
dataValueStyle: _propTypes.default.object
|
|
156
|
+
dataValueStyle: _propTypes.default.object,
|
|
157
|
+
/** Margin-left for child divs inside Value (default: '30px') */
|
|
158
|
+
valueChildMarginLeft: _propTypes.default.string
|
|
153
159
|
};
|
|
154
160
|
//address not required in IIS, instead wrapping {address &&( .. now doing both which is redundant
|
|
155
161
|
|
|
@@ -89,7 +89,7 @@ const InfoBox = exports.InfoBox = _styledComponents.default.div.withConfig({
|
|
|
89
89
|
const Value = exports.Value = _styledComponents.default.div.withConfig({
|
|
90
90
|
displayName: "CryptoAddressstyles__Value",
|
|
91
91
|
componentId: "sc-1wjvdgu-12"
|
|
92
|
-
})(["position:relative;font-weight:300;font-size:22px;font-size:", "px;line-height:28px;letter-spacing:0.4px;strong{font-weight:normal;&:after{content:' ';}}& > div{display:inline-block;margin-left:
|
|
92
|
+
})(["position:relative;font-weight:300;font-size:22px;font-size:", "px;line-height:28px;letter-spacing:0.4px;strong{font-weight:normal;&:after{content:' ';}}& > div{display:inline-block;margin-left:", ";& svg{max-width:16px;max-height:16px;}}"], props => props.fontSize, props => props.childMarginLeft !== undefined ? props.childMarginLeft : '30px');
|
|
93
93
|
const Equal = exports.Equal = _styledComponents.default.div.withConfig({
|
|
94
94
|
displayName: "CryptoAddressstyles__Equal",
|
|
95
95
|
componentId: "sc-1wjvdgu-13"
|