@stokr/components-library 4.2.6 → 5.0.1
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/README.md +147 -118
- package/dist/components/AddressItem/AddressItem.styles.js +12 -14
- package/dist/components/AdminDashboard/Table/Table.styles.d.ts +110 -0
- package/dist/components/AdminDashboard/Table/Table.styles.js +21 -20
- package/dist/components/AgreementItem/AgreementItem.styles.js +1 -1
- package/dist/components/BackButton/BackButton.styles.d.ts +24 -0
- package/dist/components/BackButton/BackButton.styles.js +15 -16
- package/dist/components/Background/Background.styles.d.ts +30 -0
- package/dist/components/Background/Background.styles.js +3 -3
- package/dist/components/BasicTable/BasicTable.d.ts +14 -0
- package/dist/components/BasicTable/BasicTable.js +0 -10
- package/dist/components/BasicTable/BasicTable.styles.d.ts +22 -0
- package/dist/components/BasicTable/BasicTable.styles.js +6 -7
- package/dist/components/BlogPost/BlogPost.js +3 -3
- package/dist/components/BlogPost/BlogPost.styles.d.ts +67 -0
- package/dist/components/BlogPost/BlogPost.styles.js +14 -20
- package/dist/components/Button/Button.styles.d.ts +12 -8
- package/dist/components/Button/Button.styles.js +131 -115
- package/dist/components/Button/GlareButton.d.ts +31 -0
- package/dist/components/Button/GlareButton.js +4 -22
- package/dist/components/Card/Card.styles.d.ts +30 -0
- package/dist/components/Card/Card.styles.js +3 -4
- package/dist/components/CardTabs/CardTabs.styles.js +26 -29
- package/dist/components/ChartLegend/ChartLegend.styles.d.ts +46 -0
- package/dist/components/ChartLegend/ChartLegend.styles.js +4 -5
- package/dist/components/Checkbox/Checkbox.styles.js +10 -12
- package/dist/components/Checklist/ChecklistCard.d.ts +18 -0
- package/dist/components/Checklist/ChecklistCard.js +4 -17
- package/dist/components/Checklist/ChecklistCard.styles.d.ts +17 -0
- package/dist/components/Checklist/ChecklistCard.styles.js +7 -7
- package/dist/components/Chips/Chip.d.ts +18 -0
- package/dist/components/Chips/Chip.js +4 -20
- package/dist/components/Chips/Chip.styles.d.ts +23 -0
- package/dist/components/Chips/Chip.styles.js +3 -6
- package/dist/components/Chips/ChipWrapper.js +2 -2
- package/dist/components/Collapsible/Collapsible.styles.js +20 -20
- package/dist/components/ComponentScroll/ComponentScroll.js +2 -1
- package/dist/components/ComponentScroll/ComponentScroll.styles.d.ts +34 -0
- package/dist/components/ComponentScroll/ComponentScroll.styles.js +15 -12
- package/dist/components/ComponentWrapper/ComponentWrapper.styles.js +11 -13
- package/dist/components/ConfirmModal/ConfirmModal.styles.d.ts +18 -0
- package/dist/components/ConfirmModal/ConfirmModal.styles.js +6 -7
- package/dist/components/Country/CountrySelect.js +6 -6
- package/dist/components/CryptoAddress/ComponentWrap.d.ts +9 -0
- package/dist/components/CryptoAddress/ComponentWrap.js +7 -10
- package/dist/components/CryptoAddress/CryptoAddress.d.ts +45 -0
- package/dist/components/CryptoAddress/CryptoAddress.js +9 -41
- package/dist/components/CryptoAddress/CryptoAddress.styles.d.ts +85 -0
- package/dist/components/CryptoAddress/CryptoAddress.styles.js +21 -22
- package/dist/components/CryptoAddress/RadioWrap.d.ts +21 -0
- package/dist/components/CryptoAddress/RadioWrap.js +1 -16
- package/dist/components/CryptoAddressWrapper/CryptoAddressWrapper.styles.d.ts +30 -0
- package/dist/components/CryptoAddressWrapper/CryptoAddressWrapper.styles.js +19 -11
- package/dist/components/DisplayOnBreakpoint/DisplayOnBreakpoint.d.ts +12 -0
- package/dist/components/DisplayOnBreakpoint/DisplayOnBreakpoint.js +28 -0
- package/dist/components/FAQ/FAQ.styles.d.ts +2 -1
- package/dist/components/FAQ/FAQ.styles.js +15 -19
- package/dist/components/Form/Form.styles.d.ts +22 -0
- package/dist/components/Form/Form.styles.js +7 -8
- package/dist/components/Grid/Grid.styles.d.ts +49 -0
- package/dist/components/Grid/Grid.styles.js +37 -40
- package/dist/components/IdentityInfo/IdentityInfo.styles.d.ts +24 -0
- package/dist/components/IdentityInfo/IdentityInfo.styles.js +5 -6
- package/dist/components/InfoBox/InfoBox.d.ts +22 -0
- package/dist/components/InfoBox/InfoBox.js +26 -65
- package/dist/components/InfoIcon/InfoIcon.styles.js +2 -3
- package/dist/components/Input/DatePickerInput.d.ts +24 -0
- package/dist/components/Input/DatePickerInput.js +2 -13
- package/dist/components/Input/DatePickerInput.styles.d.ts +18 -0
- package/dist/components/Input/DatePickerInput.styles.js +27 -24
- package/dist/components/Input/Input.js +1 -0
- package/dist/components/Input/Input.styles.d.ts +1 -0
- package/dist/components/Input/Input.styles.js +27 -24
- package/dist/components/Input/InputPassword.styles.d.ts +32 -0
- package/dist/components/Input/InputPassword.styles.js +11 -12
- package/dist/components/Input/InputWithButton.styles.d.ts +14 -0
- package/dist/components/Input/InputWithButton.styles.js +5 -6
- package/dist/components/Input/MultiSelect.d.ts +60 -0
- package/dist/components/Input/MultiSelect.js +20 -52
- package/dist/components/Input/OtpInput.d.ts +17 -0
- package/dist/components/Input/OtpInput.js +8 -15
- package/dist/components/Input/RangeInput.d.ts +14 -0
- package/dist/components/Input/RangeInput.js +2 -17
- package/dist/components/Input/SearchInput.styles.d.ts +15 -0
- package/dist/components/Input/SearchInput.styles.js +10 -11
- package/dist/components/Input/Select.js +91 -25
- package/dist/components/Input/Select.styles.d.ts +2 -2
- package/dist/components/Input/Select.styles.js +24 -26
- package/dist/components/Input/TableFilterDropdown.d.ts +33 -0
- package/dist/components/Input/TableFilterDropdown.js +6 -39
- package/dist/components/Input/Textarea.styles.d.ts +9 -0
- package/dist/components/Input/Textarea.styles.js +9 -10
- package/dist/components/MaterialIcon/MaterialIcon.d.ts +17 -7
- package/dist/components/MaterialIcon/MaterialIcon.js +14 -3
- package/dist/components/MenuNav/MenuNav.styles.d.ts +6 -0
- package/dist/components/MenuNav/MenuNav.styles.js +3 -0
- package/dist/components/Modal/Modal.styles.js +35 -36
- package/dist/components/Modal/PaymentModal.d.ts +55 -0
- package/dist/components/Modal/PaymentModal.js +11 -13
- package/dist/components/Modal/SideModal.styles.js +13 -14
- package/dist/components/Modal/SideModalParts.js +18 -20
- package/dist/components/Modal/SuccessModal/SuccessModal.styles.d.ts +15 -0
- package/dist/components/Modal/SuccessModal/SuccessModal.styles.js +3 -4
- package/dist/components/NotificationCounter/NotificationCounter.styles.d.ts +8 -0
- package/dist/components/NotificationCounter/NotificationCounter.styles.js +2 -3
- package/dist/components/Number/Number.js +1 -1
- package/dist/components/Number/Number.styles.d.ts +4 -0
- package/dist/components/Number/Number.styles.js +2 -3
- package/dist/components/Pagination/Pagination.styles.d.ts +15 -0
- package/dist/components/Pagination/Pagination.styles.js +12 -11
- package/dist/components/PanelCard/PanelCard.styles.js +24 -27
- package/dist/components/Payment/DetailRows.d.ts +14 -0
- package/dist/components/Payment/DetailRows.js +1 -2
- package/dist/components/Payment/DetailsToggle.d.ts +23 -0
- package/dist/components/Payment/DetailsToggle.js +12 -4
- package/dist/components/Payment/PaymentDetailsCard.d.ts +95 -0
- package/dist/components/Payment/PaymentDetailsCard.js +32 -23
- package/dist/components/Payment/PaymentDisplay.d.ts +59 -0
- package/dist/components/Payment/PaymentDisplay.js +18 -11
- package/dist/components/Payment/PaymentPendingCard.d.ts +39 -0
- package/dist/components/Payment/PaymentPendingCard.js +13 -13
- package/dist/components/Payment/PaymentSuccessCard.d.ts +41 -0
- package/dist/components/Payment/PaymentSuccessCard.js +27 -11
- package/dist/components/Payment/TimerComponent.d.ts +26 -0
- package/dist/components/Payment/TimerComponent.js +6 -7
- package/dist/components/Process/Process.styles.d.ts +11 -0
- package/dist/components/Process/Process.styles.js +22 -19
- package/dist/components/ProfileBadge/ProfileBadge.d.ts +13 -0
- package/dist/components/ProfileBadge/ProfileBadge.js +14 -15
- package/dist/components/ProfileBadge/ProfileBadge.styles.d.ts +10 -0
- package/dist/components/ProfileBadge/ProfileBadge.styles.js +8 -9
- package/dist/components/ProfileBox/ProfileBox.js +3 -3
- package/dist/components/ProfileBox/ProfileBox.styles.d.ts +22 -0
- package/dist/components/ProfileBox/ProfileBox.styles.js +18 -7
- package/dist/components/Radio/Radio.styles.d.ts +24 -0
- package/dist/components/Radio/Radio.styles.js +19 -11
- package/dist/components/RefreshButton/RefreshButton.styles.d.ts +29 -0
- package/dist/components/RefreshButton/RefreshButton.styles.js +5 -6
- package/dist/components/RequestDataBox/RequestDataBox.styles.d.ts +9 -0
- package/dist/components/RequestDataBox/RequestDataBox.styles.js +4 -5
- package/dist/components/Section/Section.d.ts +1 -1
- package/dist/components/Section/Section.js +4 -3
- package/dist/components/Section/Section.styles.d.ts +5 -0
- package/dist/components/Section/Section.styles.js +31 -36
- package/dist/components/SectionTitle/SectionTitle.styles.js +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts +4 -2
- package/dist/components/Skeleton/Skeleton.js +8 -8
- package/dist/components/SmartLink/SmartLink.js +2 -2
- package/dist/components/Snackbar/Snackbar.styles.d.ts +28 -0
- package/dist/components/Snackbar/Snackbar.styles.js +10 -29
- package/dist/components/SpanButton/SpanButton.styles.js +2 -2
- package/dist/components/StatusDot/StatusDot.d.ts +29 -0
- package/dist/components/StatusDot/StatusDot.js +17 -23
- package/dist/components/StatusDot/StatusDot.styles.d.ts +20 -0
- package/dist/components/StatusTag/StatusTag.d.ts +35 -0
- package/dist/components/StatusTag/StatusTag.js +9 -38
- package/dist/components/StatusTag/StatusTag.styles.d.ts +28 -0
- package/dist/components/StatusTag/StatusTag.styles.js +6 -6
- package/dist/components/StepController/StepController.styles.d.ts +23 -0
- package/dist/components/StepController/StepController.styles.js +12 -14
- package/dist/components/StepSidebar/MobileStepProgress.styles.js +4 -5
- package/dist/components/StepSidebar/StepProgress.styles.js +29 -26
- package/dist/components/StepSidebar/StepSidebar.js +1 -1
- package/dist/components/StepSidebar/StepSidebar.styles.d.ts +1 -0
- package/dist/components/StepSidebar/StepSidebar.styles.js +30 -31
- package/dist/components/StokrLoader/StokrLoader.d.ts +25 -3
- package/dist/components/StokrLoader/StokrLoader.js +171 -26
- package/dist/components/SvgIcons/AdminBadgeSvg.js +1 -0
- package/dist/components/SvgIcons/CapsLockSvg.js +1 -0
- package/dist/components/SvgIcons/LogoSvg.js +1 -11
- package/dist/components/SvgIcons/RefreshSvg.js +1 -0
- package/dist/components/SvgIcons/VerifiedBadge.js +2 -4
- package/dist/components/Switch/Switch.styles.d.ts +20 -0
- package/dist/components/Switch/Switch.styles.js +10 -11
- package/dist/components/Tabs/Tabs.js +2 -2
- package/dist/components/TabsNav/TabsNav.styles.d.ts +25 -0
- package/dist/components/TabsNav/TabsNav.styles.js +8 -9
- package/dist/components/TaxResidenceCard/TaxResidenceCard.js +1 -2
- package/dist/components/TaxResidenceCard/TaxResidenceCard.styles.d.ts +74 -0
- package/dist/components/TaxResidenceCard/TaxResidenceCard.styles.js +31 -35
- package/dist/components/Text/Text.styles.d.ts +17 -1
- package/dist/components/Text/Text.styles.js +50 -25
- package/dist/components/TextLink/TextLink.styles.d.ts +16 -0
- package/dist/components/TextLink/TextLink.styles.js +4 -4
- package/dist/components/Timeline/Timeline.styles.d.ts +41 -0
- package/dist/components/Timeline/Timeline.styles.js +14 -15
- package/dist/components/Timeline/TimelineStep.js +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.js +2 -2
- package/dist/components/Tooltip/Tooltip.styles.js +2 -3
- package/dist/components/breakdown/Breakdown.d.ts +18 -0
- package/dist/components/breakdown/Breakdown.js +7 -7
- package/dist/components/logo/Logo.js +1 -1
- package/dist/design-system/css/base.css +74 -0
- package/dist/design-system/css/index.css +5 -0
- package/dist/design-system/fonts/Inter-LICENSE.txt +93 -0
- package/dist/design-system/fonts/inter-bitcoin-sign.woff2 +0 -0
- package/dist/design-system/fonts/inter-latin-ext.woff2 +0 -0
- package/dist/design-system/fonts/inter-latin.woff2 +0 -0
- package/dist/design-system/fonts/open-sans-latin-ext-italic.woff2 +0 -0
- package/dist/design-system/fonts/open-sans-latin-ext.woff2 +0 -0
- package/dist/design-system/fonts/open-sans-latin-italic.woff2 +0 -0
- package/dist/design-system/fonts/open-sans-latin.woff2 +0 -0
- package/dist/design-system/generated/fonts.css +296 -0
- package/dist/design-system/generated/text-classes.css +198 -0
- package/dist/design-system/generated/text-styles.d.ts +26 -0
- package/dist/design-system/generated/text-styles.js +179 -0
- package/dist/design-system/generated/tokens.css +429 -0
- package/dist/design-system/index.d.ts +9 -0
- package/dist/design-system/stories/foundations.d.ts +31 -0
- package/dist/design-system/stories/foundationsData.d.ts +18 -0
- package/dist/design-system/styled/breakpoint.d.ts +43 -0
- package/dist/design-system/styled/breakpoint.js +27 -0
- package/dist/design-system/styled/build-theme.d.ts +21 -0
- package/dist/design-system/styled/build-theme.js +27 -0
- package/dist/design-system/styled/text.d.ts +3 -0
- package/dist/design-system/styled/text.js +5 -0
- package/dist/design-system/styled/theme.d.ts +6 -0
- package/dist/design-system/tokens/breakpoints.d.ts +17 -0
- package/dist/design-system/tokens/breakpoints.js +16 -0
- package/dist/design-system/tokens/colors.d.ts +92 -0
- package/dist/design-system/tokens/colors.js +98 -0
- package/dist/design-system/tokens/fonts.d.ts +32 -0
- package/dist/design-system/tokens/fonts.js +49 -0
- package/dist/design-system/tokens/index.d.ts +6 -0
- package/dist/design-system/tokens/layout.d.ts +71 -0
- package/dist/design-system/tokens/layout.js +40 -0
- package/dist/design-system/tokens/semantic.d.ts +272 -0
- package/dist/design-system/tokens/semantic.js +76 -0
- package/dist/design-system/tokens/typography.d.ts +38 -0
- package/dist/design-system/tokens/typography.js +120 -0
- package/dist/hooks/useMediaQuery.d.ts +1 -1
- package/dist/index.d.ts +115 -53
- package/dist/index.js +48 -43
- package/dist/static/images/numbers/number_eight.svg +1 -1
- package/dist/static/images/numbers/number_eight.svg.js +1 -1
- package/dist/static/images/numbers/number_five.svg +2 -2
- package/dist/static/images/numbers/number_five.svg.js +1 -1
- package/dist/static/images/numbers/number_four.svg +1 -1
- package/dist/static/images/numbers/number_four.svg.js +1 -1
- package/dist/static/images/numbers/number_nine.svg +2 -2
- package/dist/static/images/numbers/number_nine.svg.js +1 -1
- package/dist/static/images/numbers/number_one.svg +2 -2
- package/dist/static/images/numbers/number_one.svg.js +1 -1
- package/dist/static/images/numbers/number_seven.svg +2 -2
- package/dist/static/images/numbers/number_seven.svg.js +1 -1
- package/dist/static/images/numbers/number_six.svg +2 -2
- package/dist/static/images/numbers/number_six.svg.js +1 -1
- package/dist/static/images/numbers/number_three.svg +1 -1
- package/dist/static/images/numbers/number_three.svg.js +1 -1
- package/dist/static/images/numbers/number_two.svg +2 -2
- package/dist/static/images/numbers/number_two.svg.js +1 -1
- package/dist/static/images/numbers/number_zero.svg +1 -1
- package/dist/static/images/numbers/number_zero.svg.js +1 -1
- package/dist/styles/borderedField.d.ts +1 -1
- package/dist/styles/borderedField.js +15 -18
- package/dist/utils/customHooks.d.ts +4 -4
- package/dist/utils/customHooks.js +6 -6
- package/package.json +16 -11
- package/dist/static/images/address-refreshing.gif.js +0 -4
- package/dist/static/images/process-waiting.gif.js +0 -4
- package/dist/styles/colors.d.ts +0 -68
- package/dist/styles/colors.js +0 -69
- package/dist/styles/elevation.d.ts +0 -13
- package/dist/styles/elevation.js +0 -15
- package/dist/styles/global.js +0 -63
- package/dist/styles/rwd.d.ts +0 -55
- package/dist/styles/rwd.js +0 -79
- package/dist/styles/spacing.d.ts +0 -36
- package/dist/styles/spacing.js +0 -38
- package/dist/styles/theme.d.ts +0 -92
- package/dist/styles/theme.js +0 -36
- package/dist/styles/typography.d.ts +0 -42
- package/dist/styles/typography.js +0 -56
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React__default from "react";
|
|
3
3
|
import styled from "styled-components";
|
|
4
|
-
import { colors } from "../../styles/colors.js";
|
|
5
4
|
import { safeUrl } from "../../utils/safeUrl.js";
|
|
6
5
|
import { InfoIcon } from "../InfoIcon/InfoIcon.js";
|
|
7
6
|
import { ArrowSimple } from "../icons/ArrowSimple.js";
|
|
8
7
|
import { getCurrencyConfig, getCurrencyIcon, formatAmountForDisplay } from "../../utils/formatCurrencyValue.js";
|
|
9
8
|
import externalLinkIcon from "../../static/images/external-link-icon.svg.js";
|
|
10
9
|
const CardContainer = styled.div`
|
|
11
|
-
background:
|
|
10
|
+
background: var(--stokr-background-default);
|
|
12
11
|
border-radius: 8px;
|
|
13
|
-
border: 1px solid
|
|
12
|
+
border: 1px solid var(--stokr-border-subtle);
|
|
14
13
|
padding: 20px 32px;
|
|
15
14
|
`;
|
|
16
15
|
const CardTitle = styled.div`
|
|
17
16
|
font-size: 10px;
|
|
18
17
|
letter-spacing: 1.12px;
|
|
19
18
|
font-weight: 500;
|
|
20
|
-
color:
|
|
21
|
-
background:
|
|
19
|
+
color: var(--stokr-background-default);
|
|
20
|
+
background: var(--stokr-border-strong);
|
|
22
21
|
padding: 12px 24px;
|
|
23
22
|
margin: -20px -32px 20px -32px;
|
|
24
23
|
border-radius: 8px 8px 0 0;
|
|
25
|
-
// border-bottom: 1px solid
|
|
24
|
+
// border-bottom: 1px solid var(--stokr-color-neutral-200);
|
|
26
25
|
text-align: start;
|
|
27
26
|
text-transform: uppercase;
|
|
28
27
|
`;
|
|
@@ -34,7 +33,7 @@ const AmountLabel = styled.div`
|
|
|
34
33
|
text-transform: uppercase;
|
|
35
34
|
letter-spacing: 2px;
|
|
36
35
|
margin-bottom: 8px;
|
|
37
|
-
color:
|
|
36
|
+
color: var(--stokr-text-secondary);
|
|
38
37
|
text-align: start;
|
|
39
38
|
`;
|
|
40
39
|
const AmountSubtitle = styled.div`
|
|
@@ -42,7 +41,7 @@ const AmountSubtitle = styled.div`
|
|
|
42
41
|
font-weight: 400;
|
|
43
42
|
line-height: 18px;
|
|
44
43
|
letter-spacing: 0.6px;
|
|
45
|
-
color:
|
|
44
|
+
color: var(--stokr-text-tertiary);
|
|
46
45
|
margin-top: 8px;
|
|
47
46
|
text-align: start;
|
|
48
47
|
`;
|
|
@@ -63,7 +62,7 @@ const AmountLeft = styled.div`
|
|
|
63
62
|
const CurrencyTicker = styled.div`
|
|
64
63
|
font-size: 22px;
|
|
65
64
|
font-weight: 300;
|
|
66
|
-
color:
|
|
65
|
+
color: var(--stokr-text-tertiary);
|
|
67
66
|
letter-spacing: 0.8px;
|
|
68
67
|
line-height: 28px;
|
|
69
68
|
flex-shrink: 0;
|
|
@@ -76,12 +75,12 @@ const CurrencyLogo = styled.div.withConfig({
|
|
|
76
75
|
width: 24px;
|
|
77
76
|
height: 24px;
|
|
78
77
|
border-radius: 50%;
|
|
79
|
-
background-color: ${(props) => props.color ||
|
|
78
|
+
background-color: ${(props) => props.color || "var(--stokr-color-neutral-900)"};
|
|
80
79
|
display: flex;
|
|
81
80
|
align-items: center;
|
|
82
81
|
justify-content: center;
|
|
83
82
|
flex-shrink: 0;
|
|
84
|
-
color:
|
|
83
|
+
color: var(--stokr-brand-pure-white);
|
|
85
84
|
font-size: 14px;
|
|
86
85
|
font-weight: 600;
|
|
87
86
|
overflow: hidden;
|
|
@@ -100,11 +99,11 @@ const AmountValue = styled.div`
|
|
|
100
99
|
max-width: 100%;
|
|
101
100
|
overflow-wrap: break-word;
|
|
102
101
|
word-break: break-word;
|
|
103
|
-
color:
|
|
102
|
+
color: var(--stokr-text-primary);
|
|
104
103
|
`;
|
|
105
104
|
const Separator = styled.hr`
|
|
106
105
|
border: none;
|
|
107
|
-
border-top: 1px solid
|
|
106
|
+
border-top: 1px solid var(--stokr-border-subtle);
|
|
108
107
|
margin: 20px 0px;
|
|
109
108
|
`;
|
|
110
109
|
const ArrowSeparatorWrapper = styled.div`
|
|
@@ -118,7 +117,7 @@ const ArrowSeparatorWrapper = styled.div`
|
|
|
118
117
|
content: '';
|
|
119
118
|
flex: 1;
|
|
120
119
|
height: 1px;
|
|
121
|
-
background:
|
|
120
|
+
background: var(--stokr-border-subtle);
|
|
122
121
|
}
|
|
123
122
|
`;
|
|
124
123
|
const ArrowCircle = styled.div`
|
|
@@ -127,7 +126,7 @@ const ArrowCircle = styled.div`
|
|
|
127
126
|
justify-content: center;
|
|
128
127
|
margin: 0 16px;
|
|
129
128
|
height: 0;
|
|
130
|
-
color:
|
|
129
|
+
color: var(--stokr-text-tertiary);
|
|
131
130
|
`;
|
|
132
131
|
const SectionHeader = styled.div`
|
|
133
132
|
font-size: 11px;
|
|
@@ -135,7 +134,7 @@ const SectionHeader = styled.div`
|
|
|
135
134
|
line-height: 20px;
|
|
136
135
|
text-transform: uppercase;
|
|
137
136
|
letter-spacing: 2px;
|
|
138
|
-
color:
|
|
137
|
+
color: var(--stokr-text-secondary);
|
|
139
138
|
text-align: start;
|
|
140
139
|
margin-bottom: 4px;
|
|
141
140
|
`;
|
|
@@ -166,7 +165,7 @@ const DetailLabel = styled.div`
|
|
|
166
165
|
font-weight: 400;
|
|
167
166
|
line-height: 20px;
|
|
168
167
|
letter-spacing: 0.5px;
|
|
169
|
-
color:
|
|
168
|
+
color: var(--stokr-text-secondary);
|
|
170
169
|
|
|
171
170
|
i {
|
|
172
171
|
font-size: 14px;
|
|
@@ -184,16 +183,16 @@ const DetailValue = styled.div`
|
|
|
184
183
|
word-wrap: break-word;
|
|
185
184
|
text-align: right;
|
|
186
185
|
max-width: 60%;
|
|
187
|
-
color:
|
|
186
|
+
color: var(--stokr-text-primary);
|
|
188
187
|
`;
|
|
189
188
|
const PlaceholderValue = styled.span`
|
|
190
|
-
color:
|
|
189
|
+
color: var(--stokr-text-secondary);
|
|
191
190
|
font-weight: 300;
|
|
192
191
|
font-size: 14px;
|
|
193
192
|
letter-spacing: 0.5px;
|
|
194
193
|
`;
|
|
195
194
|
const ExternalLink = styled.a`
|
|
196
|
-
color:
|
|
195
|
+
color: var(--stokr-text-primary);
|
|
197
196
|
text-decoration: underline;
|
|
198
197
|
font-size: 14px;
|
|
199
198
|
font-weight: 600;
|
|
@@ -223,7 +222,17 @@ const ExternalLinkIconImg = styled.img`
|
|
|
223
222
|
height: 12px;
|
|
224
223
|
flex-shrink: 0;
|
|
225
224
|
`;
|
|
226
|
-
const DetailItem = ({
|
|
225
|
+
const DetailItem = ({
|
|
226
|
+
label,
|
|
227
|
+
value,
|
|
228
|
+
tooltip,
|
|
229
|
+
placeholder,
|
|
230
|
+
isCustom,
|
|
231
|
+
href,
|
|
232
|
+
target,
|
|
233
|
+
labelIcon,
|
|
234
|
+
valueIcon
|
|
235
|
+
}) => {
|
|
227
236
|
const renderValue = () => {
|
|
228
237
|
if (isCustom && value) {
|
|
229
238
|
return value;
|
|
@@ -272,9 +281,9 @@ const AmountBlock = ({ config }) => {
|
|
|
272
281
|
} = config;
|
|
273
282
|
const { symbol, decimals: resolvedDecimals } = getCurrencyConfig(currency, decimals ?? 2);
|
|
274
283
|
const hasAmount = amount !== void 0 && amount !== null && amount !== "";
|
|
275
|
-
const displayValue = hasAmount ?
|
|
284
|
+
const displayValue = hasAmount ? Math.abs(Number(amount)).toFixed(resolvedDecimals) : null;
|
|
276
285
|
const currencyIcon = getCurrencyIcon(currency, icon);
|
|
277
|
-
const logoColor = currencyColor ||
|
|
286
|
+
const logoColor = currencyColor || "var(--stokr-color-neutral-900)";
|
|
278
287
|
const ticker = showTicker ? symbol : null;
|
|
279
288
|
const renderCurrencyLogo = () => {
|
|
280
289
|
if (currencyIcon) {
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
export declare const CodeWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
3
|
+
style?: CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
4
|
+
}, {
|
|
5
|
+
maxWidth?: string;
|
|
6
|
+
}>> & string;
|
|
7
|
+
export declare const AmountValue: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "style"> & {
|
|
8
|
+
style?: CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
9
|
+
}> & string;
|
|
10
|
+
export declare const AmountCurrency: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "style"> & {
|
|
11
|
+
style?: CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
12
|
+
}> & string;
|
|
13
|
+
export declare const AmountIcon: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "style"> & {
|
|
14
|
+
style?: CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
15
|
+
}> & string;
|
|
16
|
+
export interface PaymentDisplayProps {
|
|
17
|
+
/** Amount to pay (shown grouped; copied as-is). */
|
|
18
|
+
amount: number | string;
|
|
19
|
+
/** Currency id (e.g. `btc-fb`) or ticker; also the label next to the amount. */
|
|
20
|
+
currency?: string;
|
|
21
|
+
/** Address to pay to. */
|
|
22
|
+
address?: string;
|
|
23
|
+
showQRCode?: boolean;
|
|
24
|
+
showCopyIcons?: boolean;
|
|
25
|
+
showAddress?: boolean;
|
|
26
|
+
/** Content of the QR code, e.g. the chain's payment URI. No QR code without it. */
|
|
27
|
+
qrCodeValue?: string;
|
|
28
|
+
amountTitle?: ReactNode;
|
|
29
|
+
addressTitle?: ReactNode;
|
|
30
|
+
addressDescription?: ReactNode;
|
|
31
|
+
qrCodeSize?: number;
|
|
32
|
+
qrCodeStyle?: CSSProperties;
|
|
33
|
+
/** Waiting/status indicator shown with a pulsing dot, e.g. "Waiting to detect your transaction…". */
|
|
34
|
+
statusMessage?: ReactNode;
|
|
35
|
+
statusDotColor?: string;
|
|
36
|
+
containerStyle?: CSSProperties;
|
|
37
|
+
codeWrapperStyle?: CSSProperties;
|
|
38
|
+
amountSectionStyle?: CSSProperties;
|
|
39
|
+
amountTextStyle?: CSSProperties;
|
|
40
|
+
amountIconStyle?: CSSProperties;
|
|
41
|
+
addressTextStyle?: CSSProperties;
|
|
42
|
+
addressDescriptionStyle?: CSSProperties;
|
|
43
|
+
addressSectionStyle?: CSSProperties;
|
|
44
|
+
/** CSS max-width of the card, e.g. `600px`. */
|
|
45
|
+
maxWidth?: string;
|
|
46
|
+
className?: string;
|
|
47
|
+
codeWrapperClassName?: string;
|
|
48
|
+
/** Custom currency icon URL; wins over the currency's own icon. */
|
|
49
|
+
customCurrencyIcon?: string;
|
|
50
|
+
onAmountCopy?: (value: string) => void;
|
|
51
|
+
onAddressCopy?: (value: string) => void;
|
|
52
|
+
copyButtonStyle?: CSSProperties;
|
|
53
|
+
/** Slot at the top of the card, e.g. an expiry countdown pill. */
|
|
54
|
+
chip?: ReactNode;
|
|
55
|
+
/** Extra content (e.g. a "show details" toggle), rendered last inside the card. */
|
|
56
|
+
children?: ReactNode;
|
|
57
|
+
}
|
|
58
|
+
export declare const PaymentDisplay: ({ amount, currency, address, showQRCode, showCopyIcons, showAddress, qrCodeValue, amountTitle, addressTitle, addressDescription, qrCodeSize, qrCodeStyle, statusMessage, statusDotColor, containerStyle, codeWrapperStyle, amountSectionStyle, amountTextStyle, amountIconStyle, addressTextStyle, addressDescriptionStyle, addressSectionStyle, maxWidth, className, codeWrapperClassName, customCurrencyIcon, onAmountCopy, onAddressCopy, copyButtonStyle, chip, children, }: PaymentDisplayProps) => import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
export default PaymentDisplay;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
2
|
import styled from "styled-components";
|
|
4
3
|
import { ComponentWrapper } from "../ComponentWrapper/ComponentWrapper.styles.js";
|
|
5
|
-
import { colors } from "../../styles/colors.js";
|
|
6
4
|
import { CopyToClipboardTooltip } from "../CopyToClipboardTooltip/CopyToClipboardTooltip.js";
|
|
7
5
|
import stdin_default from "../QRCode/QRCode.js";
|
|
8
6
|
import { SectionTitle } from "../SectionTitle/SectionTitle.styles.js";
|
|
@@ -11,8 +9,8 @@ import { getCurrencyIcon, formatAmountForDisplay } from "../../utils/formatCurre
|
|
|
11
9
|
const CodeWrapper = styled.div.withConfig({
|
|
12
10
|
shouldForwardProp: (props) => !["maxWidth"].includes(props)
|
|
13
11
|
})`
|
|
14
|
-
background:
|
|
15
|
-
border: 1px solid
|
|
12
|
+
background: var(--stokr-background-default);
|
|
13
|
+
border: 1px solid var(--stokr-border-subtle);
|
|
16
14
|
border-radius: 8px;
|
|
17
15
|
box-shadow: none;
|
|
18
16
|
padding: 48px 40px;
|
|
@@ -53,7 +51,7 @@ const AmountValue = styled.p`
|
|
|
53
51
|
text-transform: uppercase;
|
|
54
52
|
line-height: 40px;
|
|
55
53
|
letter-spacing: 1.5px;
|
|
56
|
-
color:
|
|
54
|
+
color: var(--stokr-text-primary);
|
|
57
55
|
max-width: 100%;
|
|
58
56
|
overflow-wrap: break-word;
|
|
59
57
|
word-break: break-word;
|
|
@@ -63,7 +61,7 @@ const AmountCurrency = styled.p`
|
|
|
63
61
|
font-size: 34px;
|
|
64
62
|
font-weight: 300;
|
|
65
63
|
line-height: 40px;
|
|
66
|
-
color:
|
|
64
|
+
color: var(--stokr-text-primary);
|
|
67
65
|
`;
|
|
68
66
|
const AmountIcon = styled.img`
|
|
69
67
|
width: 32px;
|
|
@@ -97,7 +95,7 @@ const AddressText = styled.p`
|
|
|
97
95
|
letter-spacing: 0.5px;
|
|
98
96
|
text-align: center;
|
|
99
97
|
word-break: break-all;
|
|
100
|
-
color:
|
|
98
|
+
color: var(--stokr-text-primary);
|
|
101
99
|
`;
|
|
102
100
|
const AddressDescription = styled.p`
|
|
103
101
|
margin: 0;
|
|
@@ -106,7 +104,7 @@ const AddressDescription = styled.p`
|
|
|
106
104
|
line-height: 18px;
|
|
107
105
|
letter-spacing: 0.6px;
|
|
108
106
|
text-align: center;
|
|
109
|
-
color:
|
|
107
|
+
color: var(--stokr-text-tertiary);
|
|
110
108
|
`;
|
|
111
109
|
const PaymentDisplay = ({
|
|
112
110
|
amount,
|
|
@@ -167,7 +165,16 @@ const PaymentDisplay = ({
|
|
|
167
165
|
}
|
|
168
166
|
)
|
|
169
167
|
] }),
|
|
170
|
-
showQRCode && qrCodeValue && /* @__PURE__ */ jsx(
|
|
168
|
+
showQRCode && qrCodeValue && /* @__PURE__ */ jsx(
|
|
169
|
+
stdin_default,
|
|
170
|
+
{
|
|
171
|
+
size: qrCodeSize,
|
|
172
|
+
padding: 0,
|
|
173
|
+
backgroundColor: "transparent",
|
|
174
|
+
style: qrCodeStyle,
|
|
175
|
+
value: qrCodeValue
|
|
176
|
+
}
|
|
177
|
+
)
|
|
171
178
|
] }),
|
|
172
179
|
showAddress && address && /* @__PURE__ */ jsxs(AddressBlock, { style: addressSectionStyle, children: [
|
|
173
180
|
/* @__PURE__ */ jsx(SectionTitle, { children: addressTitle }),
|
|
@@ -189,8 +196,8 @@ const PaymentDisplay = ({
|
|
|
189
196
|
statusMessage && /* @__PURE__ */ jsx(
|
|
190
197
|
StatusDot,
|
|
191
198
|
{
|
|
192
|
-
color: statusDotColor ||
|
|
193
|
-
labelColor:
|
|
199
|
+
color: statusDotColor || "var(--stokr-status-info-icon)",
|
|
200
|
+
labelColor: "var(--stokr-text-secondary)",
|
|
194
201
|
dotSize: 8,
|
|
195
202
|
pulse: true,
|
|
196
203
|
style: { width: "100%", whiteSpace: "normal" },
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { CSSProperties, MouseEventHandler, ReactNode } from 'react';
|
|
2
|
+
import { PaymentDetailRow } from './PaymentDetailsCard';
|
|
3
|
+
/**
|
|
4
|
+
* Pending-confirmation state: spinner + title/description + a row list (e.g.
|
|
5
|
+
* amount/to address/status) + an optional action button + a footer note. Sits
|
|
6
|
+
* alongside PaymentDisplay (the "here's what to pay" state) and PaymentSuccessCard
|
|
7
|
+
* (the confirmed state) for the post-broadcast, waiting-for-network-confirmation
|
|
8
|
+
* moment. No explorer link by default — a link to the tx would imply it's already
|
|
9
|
+
* confirmed, which it isn't yet — but `actionLabel`/`actionHref`/`onActionClick` let a
|
|
10
|
+
* consumer opt back into a button (e.g. "cancel and start over") when one makes sense.
|
|
11
|
+
*
|
|
12
|
+
* `rows` is passed straight through to PaymentDetailsCard's DetailItem, so the same
|
|
13
|
+
* `href`/`tooltip`/`isCustom`/`labelIcon`/`valueIcon` escape hatches apply — e.g. a
|
|
14
|
+
* colored "Pending confirmation" status value: { label: 'Status', value: <span style={{color: 'var(--stokr-action-accent-bg)'}}>Pending confirmation</span>, isCustom: true }
|
|
15
|
+
*/
|
|
16
|
+
export interface PaymentPendingCardProps {
|
|
17
|
+
title: ReactNode;
|
|
18
|
+
description?: ReactNode;
|
|
19
|
+
/** Detail rows, same shape as `DetailRows`. */
|
|
20
|
+
rows?: PaymentDetailRow[];
|
|
21
|
+
/** Label of the optional action button (needs `actionHref` or `onActionClick`). */
|
|
22
|
+
actionLabel?: string;
|
|
23
|
+
/** Makes the action a link opening in a new tab. */
|
|
24
|
+
actionHref?: string;
|
|
25
|
+
onActionClick?: MouseEventHandler<HTMLElement>;
|
|
26
|
+
footerNote?: ReactNode;
|
|
27
|
+
/** Slot at the top of the card, e.g. an expiry countdown pill. */
|
|
28
|
+
chip?: ReactNode;
|
|
29
|
+
/** CSS max-width of the card, e.g. `600px`. */
|
|
30
|
+
maxWidth?: string;
|
|
31
|
+
containerStyle?: CSSProperties;
|
|
32
|
+
codeWrapperStyle?: CSSProperties;
|
|
33
|
+
className?: string;
|
|
34
|
+
codeWrapperClassName?: string;
|
|
35
|
+
/** Extra content, rendered last inside the card. */
|
|
36
|
+
children?: ReactNode;
|
|
37
|
+
}
|
|
38
|
+
export declare const PaymentPendingCard: ({ title, description, rows, actionLabel, actionHref, onActionClick, footerNote, chip, maxWidth, containerStyle, codeWrapperStyle, className, codeWrapperClassName, children, }: PaymentPendingCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export default PaymentPendingCard;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
2
|
import styled, { keyframes } from "styled-components";
|
|
4
3
|
import { ComponentWrapper } from "../ComponentWrapper/ComponentWrapper.styles.js";
|
|
5
|
-
import { colors } from "../../styles/colors.js";
|
|
6
4
|
import { safeUrl } from "../../utils/safeUrl.js";
|
|
7
5
|
import { Button } from "../Button/Button.styles.js";
|
|
8
6
|
import { DetailRows } from "./DetailRows.js";
|
|
@@ -15,8 +13,8 @@ const Spinner = styled.div`
|
|
|
15
13
|
height: 48px;
|
|
16
14
|
flex-shrink: 0;
|
|
17
15
|
border-radius: 50%;
|
|
18
|
-
border: 3px solid
|
|
19
|
-
border-top-color:
|
|
16
|
+
border: 3px solid var(--stokr-border-subtle);
|
|
17
|
+
border-top-color: var(--stokr-action-accent-bg);
|
|
20
18
|
animation: ${spin} 0.9s linear infinite;
|
|
21
19
|
`;
|
|
22
20
|
const TextBlock = styled.div`
|
|
@@ -29,32 +27,32 @@ const TextBlock = styled.div`
|
|
|
29
27
|
`;
|
|
30
28
|
const Title = styled.h2`
|
|
31
29
|
margin: 0;
|
|
32
|
-
font-family:
|
|
30
|
+
font-family: var(--stokr-font-family-base);
|
|
33
31
|
font-size: 22px;
|
|
34
32
|
font-weight: 800;
|
|
35
33
|
line-height: 28px;
|
|
36
34
|
letter-spacing: 0.8px;
|
|
37
35
|
text-transform: uppercase;
|
|
38
|
-
color:
|
|
36
|
+
color: var(--stokr-text-primary);
|
|
39
37
|
`;
|
|
40
38
|
const Description = styled.p`
|
|
41
39
|
margin: 0;
|
|
42
|
-
font-family:
|
|
40
|
+
font-family: var(--stokr-font-family-base);
|
|
43
41
|
font-size: 16px;
|
|
44
42
|
font-weight: 300;
|
|
45
43
|
line-height: 24px;
|
|
46
44
|
letter-spacing: 0.6px;
|
|
47
|
-
color:
|
|
45
|
+
color: var(--stokr-text-primary);
|
|
48
46
|
`;
|
|
49
47
|
const FooterNote = styled.p`
|
|
50
48
|
margin: 0;
|
|
51
|
-
font-family:
|
|
49
|
+
font-family: var(--stokr-font-family-base);
|
|
52
50
|
font-size: 12px;
|
|
53
51
|
font-weight: 400;
|
|
54
52
|
line-height: 18px;
|
|
55
53
|
letter-spacing: 0.6px;
|
|
56
54
|
text-align: center;
|
|
57
|
-
color:
|
|
55
|
+
color: var(--stokr-text-secondary);
|
|
58
56
|
`;
|
|
59
57
|
const PaymentPendingCard = ({
|
|
60
58
|
title,
|
|
@@ -86,9 +84,11 @@ const PaymentPendingCard = ({
|
|
|
86
84
|
Button,
|
|
87
85
|
{
|
|
88
86
|
as: actionHref ? "a" : "button",
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
...{
|
|
88
|
+
href: safeUrl(actionHref),
|
|
89
|
+
target: actionHref ? "_blank" : void 0,
|
|
90
|
+
rel: actionHref ? "noopener noreferrer" : void 0
|
|
91
|
+
},
|
|
92
92
|
onClick: onActionClick,
|
|
93
93
|
outlineBlack: true,
|
|
94
94
|
fluid: true,
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { CSSProperties, MouseEventHandler, ReactNode } from 'react';
|
|
2
|
+
import { PaymentDetailRow } from './PaymentDetailsCard';
|
|
3
|
+
/**
|
|
4
|
+
* Confirmed/success state: checkmark + title/description + optional amount row
|
|
5
|
+
* + an optional collapsible details list + up to two action buttons.
|
|
6
|
+
* Generalizes invest-in-sto's bespoke success.tsx markup so both test-tx
|
|
7
|
+
* success and real-investment success can share one component.
|
|
8
|
+
*/
|
|
9
|
+
export interface PaymentSuccessCardProps {
|
|
10
|
+
title: ReactNode;
|
|
11
|
+
description?: ReactNode;
|
|
12
|
+
/** Amount shown under the description. Hidden when empty. */
|
|
13
|
+
amount?: number | string | null;
|
|
14
|
+
/** Currency id (e.g. `btc-fb`) or ticker, shown next to the amount. */
|
|
15
|
+
currency?: string;
|
|
16
|
+
/** Custom currency icon URL; wins over the currency's own icon. */
|
|
17
|
+
customCurrencyIcon?: string;
|
|
18
|
+
/** Detail rows revealed by the "show details" toggle. No toggle when empty. */
|
|
19
|
+
rows?: PaymentDetailRow[];
|
|
20
|
+
detailsDefaultOpen?: boolean;
|
|
21
|
+
showDetailsLabel?: string;
|
|
22
|
+
hideDetailsLabel?: string;
|
|
23
|
+
primaryActionLabel?: string;
|
|
24
|
+
/** Makes the primary action a link. */
|
|
25
|
+
primaryActionHref?: string;
|
|
26
|
+
onPrimaryActionClick?: MouseEventHandler<HTMLElement>;
|
|
27
|
+
secondaryActionLabel?: string;
|
|
28
|
+
/** Makes the secondary action a link opening in a new tab, with an external-link icon. */
|
|
29
|
+
secondaryActionHref?: string;
|
|
30
|
+
onSecondaryActionClick?: MouseEventHandler<HTMLElement>;
|
|
31
|
+
/** CSS max-width of the card, e.g. `600px`. */
|
|
32
|
+
maxWidth?: string;
|
|
33
|
+
containerStyle?: CSSProperties;
|
|
34
|
+
codeWrapperStyle?: CSSProperties;
|
|
35
|
+
className?: string;
|
|
36
|
+
codeWrapperClassName?: string;
|
|
37
|
+
/** Extra content, rendered last inside the card. */
|
|
38
|
+
children?: ReactNode;
|
|
39
|
+
}
|
|
40
|
+
export declare const PaymentSuccessCard: ({ title, description, amount, currency, customCurrencyIcon, rows, detailsDefaultOpen, showDetailsLabel, hideDetailsLabel, primaryActionLabel, primaryActionHref, onPrimaryActionClick, secondaryActionLabel, secondaryActionHref, onSecondaryActionClick, maxWidth, containerStyle, codeWrapperStyle, className, codeWrapperClassName, children, }: PaymentSuccessCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export default PaymentSuccessCard;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
2
|
import styled from "styled-components";
|
|
4
3
|
import { ComponentWrapper } from "../ComponentWrapper/ComponentWrapper.styles.js";
|
|
5
|
-
import { colors } from "../../styles/colors.js";
|
|
6
4
|
import { safeUrl } from "../../utils/safeUrl.js";
|
|
7
5
|
import { Button } from "../Button/Button.styles.js";
|
|
8
6
|
import { CodeWrapper, AmountIcon, AmountValue, AmountCurrency } from "./PaymentDisplay.js";
|
|
@@ -15,7 +13,7 @@ const IconCircle = styled.div`
|
|
|
15
13
|
width: 100px;
|
|
16
14
|
height: 100px;
|
|
17
15
|
border-radius: 50%;
|
|
18
|
-
background:
|
|
16
|
+
background: var(--stokr-status-success-bg);
|
|
19
17
|
display: flex;
|
|
20
18
|
align-items: center;
|
|
21
19
|
justify-content: center;
|
|
@@ -30,13 +28,13 @@ const TextBlock = styled.div`
|
|
|
30
28
|
`;
|
|
31
29
|
const Title = styled.h2`
|
|
32
30
|
margin: 0;
|
|
33
|
-
font-family:
|
|
31
|
+
font-family: var(--stokr-font-family-base);
|
|
34
32
|
font-size: 22px;
|
|
35
33
|
font-weight: 800;
|
|
36
34
|
line-height: 28px;
|
|
37
35
|
letter-spacing: 0.8px;
|
|
38
36
|
text-transform: uppercase;
|
|
39
|
-
color:
|
|
37
|
+
color: var(--stokr-text-primary);
|
|
40
38
|
`;
|
|
41
39
|
const Description = styled.p`
|
|
42
40
|
margin: 0;
|
|
@@ -44,7 +42,7 @@ const Description = styled.p`
|
|
|
44
42
|
font-weight: 300;
|
|
45
43
|
line-height: 24px;
|
|
46
44
|
letter-spacing: 0.6px;
|
|
47
|
-
color:
|
|
45
|
+
color: var(--stokr-text-primary);
|
|
48
46
|
`;
|
|
49
47
|
const AmountRow = styled.div`
|
|
50
48
|
display: flex;
|
|
@@ -110,15 +108,25 @@ const PaymentSuccessCard = ({
|
|
|
110
108
|
/* @__PURE__ */ jsx(AmountValue, { children: formatAmountForDisplay(amount) }),
|
|
111
109
|
currency && /* @__PURE__ */ jsx(AmountCurrency, { children: currency })
|
|
112
110
|
] }),
|
|
113
|
-
rows.length > 0 && /* @__PURE__ */ jsx(
|
|
111
|
+
rows.length > 0 && /* @__PURE__ */ jsx(
|
|
112
|
+
DetailsToggle,
|
|
113
|
+
{
|
|
114
|
+
rows,
|
|
115
|
+
defaultOpen: detailsDefaultOpen,
|
|
116
|
+
showLabel: showDetailsLabel,
|
|
117
|
+
hideLabel: hideDetailsLabel
|
|
118
|
+
}
|
|
119
|
+
),
|
|
114
120
|
hasActions && /* @__PURE__ */ jsxs(ActionsRow, { children: [
|
|
115
121
|
secondaryActionLabel && /* @__PURE__ */ jsxs(
|
|
116
122
|
ActionButton,
|
|
117
123
|
{
|
|
118
124
|
as: secondaryActionHref ? "a" : "button",
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
125
|
+
...{
|
|
126
|
+
href: safeUrl(secondaryActionHref),
|
|
127
|
+
target: secondaryActionHref ? "_blank" : void 0,
|
|
128
|
+
rel: secondaryActionHref ? "noopener noreferrer" : void 0
|
|
129
|
+
},
|
|
122
130
|
onClick: onSecondaryActionClick,
|
|
123
131
|
black: true,
|
|
124
132
|
children: [
|
|
@@ -127,7 +135,15 @@ const PaymentSuccessCard = ({
|
|
|
127
135
|
]
|
|
128
136
|
}
|
|
129
137
|
),
|
|
130
|
-
primaryActionLabel && /* @__PURE__ */ jsx(
|
|
138
|
+
primaryActionLabel && /* @__PURE__ */ jsx(
|
|
139
|
+
ActionButton,
|
|
140
|
+
{
|
|
141
|
+
as: primaryActionHref ? "a" : "button",
|
|
142
|
+
...{ href: safeUrl(primaryActionHref) },
|
|
143
|
+
onClick: onPrimaryActionClick,
|
|
144
|
+
children: primaryActionLabel
|
|
145
|
+
}
|
|
146
|
+
)
|
|
131
147
|
] }),
|
|
132
148
|
children
|
|
133
149
|
] }) });
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export declare const TimerBlock: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
3
|
+
style?: CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
4
|
+
}, {
|
|
5
|
+
maxWidth?: string;
|
|
6
|
+
red?: boolean;
|
|
7
|
+
}>> & string;
|
|
8
|
+
export interface TimerComponentProps {
|
|
9
|
+
/** Id of the timer (from `useTimer` / TimerService) to display. */
|
|
10
|
+
timerId: string;
|
|
11
|
+
/** Called once when the timer reaches zero. */
|
|
12
|
+
onTimerExpired?: () => void;
|
|
13
|
+
/** Seconds left under which the countdown turns red. */
|
|
14
|
+
warningThreshold?: number;
|
|
15
|
+
title?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
containerStyle?: CSSProperties;
|
|
18
|
+
timerBlockStyle?: CSSProperties;
|
|
19
|
+
className?: string;
|
|
20
|
+
/** CSS max-width of the block, e.g. `600px`. */
|
|
21
|
+
maxWidth?: string;
|
|
22
|
+
iconSize?: number;
|
|
23
|
+
showIcon?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare const TimerComponent: import('react').MemoExoticComponent<({ timerId, onTimerExpired, warningThreshold, title, description, containerStyle, timerBlockStyle, className, maxWidth, iconSize, showIcon, }: TimerComponentProps) => import("react/jsx-runtime").JSX.Element>;
|
|
26
|
+
export default TimerComponent;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { memo, useEffect } from "react";
|
|
3
3
|
import { useTimer } from "../../hooks/useTimer.js";
|
|
4
4
|
import styled from "styled-components";
|
|
5
|
-
import { colors } from "../../styles/colors.js";
|
|
6
5
|
import { Text } from "../Text/Text.styles.js";
|
|
7
6
|
import { MaterialIcon } from "../MaterialIcon/MaterialIcon.js";
|
|
8
7
|
import { FlexContainer } from "../Grid/Grid.styles.js";
|
|
9
|
-
import
|
|
8
|
+
import { breakpoint } from "../../design-system/styled/breakpoint.js";
|
|
10
9
|
const TimerBlock = styled.div.withConfig({
|
|
11
10
|
shouldForwardProp: (props) => !["maxWidth", "red"].includes(props)
|
|
12
11
|
})`
|
|
13
|
-
background-color:
|
|
12
|
+
background-color: var(--stokr-background-surface);
|
|
14
13
|
padding: 24px 27px;
|
|
15
14
|
text-align: start;
|
|
16
15
|
max-width: ${(props) => props.maxWidth || "550px"};
|
|
@@ -25,7 +24,7 @@ const TimerBlock = styled.div.withConfig({
|
|
|
25
24
|
margin: 0 !important;
|
|
26
25
|
}
|
|
27
26
|
|
|
28
|
-
${
|
|
27
|
+
${breakpoint.Medium`
|
|
29
28
|
p {
|
|
30
29
|
font-size: 16px !important;
|
|
31
30
|
}
|
|
@@ -37,7 +36,7 @@ const TimerBlock = styled.div.withConfig({
|
|
|
37
36
|
|
|
38
37
|
${(props) => props.red && `
|
|
39
38
|
#timer-text {
|
|
40
|
-
color:
|
|
39
|
+
color: var(--stokr-status-error-text);
|
|
41
40
|
}
|
|
42
41
|
`}
|
|
43
42
|
`;
|
|
@@ -60,7 +59,7 @@ const TimerComponent = memo(
|
|
|
60
59
|
showIcon = true
|
|
61
60
|
}) => {
|
|
62
61
|
const { secondsRemaining, hasTimerFinished, stopTimer } = useTimer(timerId);
|
|
63
|
-
|
|
62
|
+
useEffect(() => {
|
|
64
63
|
if (hasTimerFinished) {
|
|
65
64
|
stopTimer();
|
|
66
65
|
if (onTimerExpired) {
|