@stokr/components-library 4.2.5 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +147 -118
- 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.d.ts +0 -1
- 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.d.ts +4 -10
- package/dist/components/Collapsible/Collapsible.js +14 -6
- package/dist/components/Collapsible/Collapsible.styles.d.ts +1 -3
- package/dist/components/Collapsible/Collapsible.styles.js +19 -36
- 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 +20 -15
- 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.js +18 -18
- package/dist/components/FAQ/FAQ.styles.d.ts +5 -12
- package/dist/components/FAQ/FAQ.styles.js +3 -61
- 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.js +1 -2
- package/dist/components/IdentityInfo/IdentityInfo.styles.d.ts +24 -0
- package/dist/components/IdentityInfo/IdentityInfo.styles.js +6 -9
- package/dist/components/InfoBox/InfoBox.d.ts +20 -0
- package/dist/components/InfoBox/InfoBox.js +24 -78
- 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.d.ts +0 -3
- package/dist/components/Input/Input.js +3 -5
- package/dist/components/Input/Input.styles.d.ts +1 -4
- package/dist/components/Input/Input.styles.js +24 -77
- 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 +156 -80
- package/dist/components/Input/Select.styles.js +16 -118
- 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/MaterialIcon/requiredIcons.d.ts +1 -1
- package/dist/components/MaterialIcon/requiredIcons.js +0 -2
- 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/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 +23 -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/StokrLoader/StokrLoader.d.ts +9 -1
- package/dist/components/StokrLoader/StokrLoader.js +50 -19
- 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 +11 -27
- package/dist/components/TaxResidenceCard/TaxResidenceCard.styles.d.ts +57 -0
- package/dist/components/TaxResidenceCard/TaxResidenceCard.styles.js +25 -107
- 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 +117 -120
- package/dist/index.js +50 -60
- package/dist/static/images/globe.svg.js +5 -0
- 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/static/images/trash.svg +17 -0
- package/dist/static/images/trash.svg.js +5 -0
- package/dist/utils/customHooks.d.ts +4 -4
- package/dist/utils/customHooks.js +6 -6
- package/package.json +16 -11
- package/dist/components/AddressItem/AddressItem.d.ts +0 -38
- package/dist/components/AddressItem/AddressItem.js +0 -51
- package/dist/components/AddressItem/AddressItem.styles.d.ts +0 -31
- package/dist/components/AddressItem/AddressItem.styles.js +0 -73
- package/dist/components/Country/FlagFor.d.ts +0 -9
- package/dist/components/Country/FlagFor.js +0 -25
- package/dist/components/Country/flagLoaders.d.ts +0 -5
- package/dist/components/Country/flagLoaders.js +0 -270
- package/dist/components/Country/flagStore.d.ts +0 -6
- package/dist/components/Country/flagStore.js +0 -29
- package/dist/components/FAQ/FAQ.d.ts +0 -29
- package/dist/components/Input/Select.d.ts +0 -57
- package/dist/components/Input/Select.styles.d.ts +0 -89
- package/dist/components/PanelCard/PanelCard.d.ts +0 -51
- package/dist/components/PanelCard/PanelCard.js +0 -35
- package/dist/components/PanelCard/PanelCard.styles.d.ts +0 -29
- package/dist/components/PanelCard/PanelCard.styles.js +0 -87
- package/dist/components/StepSidebar/MobileStepProgress.d.ts +0 -12
- package/dist/components/StepSidebar/MobileStepProgress.js +0 -14
- package/dist/components/StepSidebar/MobileStepProgress.styles.d.ts +0 -15
- package/dist/components/StepSidebar/MobileStepProgress.styles.js +0 -42
- package/dist/components/StepSidebar/StepProgress.d.ts +0 -14
- package/dist/components/StepSidebar/StepProgress.js +0 -14
- package/dist/components/StepSidebar/StepProgress.styles.d.ts +0 -30
- package/dist/components/StepSidebar/StepProgress.styles.js +0 -103
- package/dist/components/StepSidebar/StepSidebar.d.ts +0 -36
- package/dist/components/StepSidebar/StepSidebar.js +0 -58
- package/dist/components/StepSidebar/StepSidebar.styles.d.ts +0 -54
- package/dist/components/StepSidebar/StepSidebar.styles.js +0 -175
- package/dist/static/images/address-refreshing.gif.js +0 -4
- package/dist/static/images/process-waiting.gif.js +0 -4
- package/dist/styles/borderedField.d.ts +0 -11
- package/dist/styles/borderedField.js +0 -56
- 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
|
@@ -2,19 +2,11 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState, useMemo, useCallback } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { Input } from "../Input/Input.js";
|
|
5
|
-
import { colors } from "../../styles/colors.js";
|
|
6
5
|
import { Checkbox } from "../Checkbox/Checkbox.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
6
|
+
import SvgTrash from "../../static/images/trash.svg.js";
|
|
7
|
+
import SvgGlobe from "../../static/images/globe.svg.js";
|
|
8
|
+
import { FlagFor, CountrySelect } from "../Country/CountrySelect.js";
|
|
9
9
|
import { CardWrapper, CardHeader, HeaderIcon, FlagWrapper, HeaderTitle, HeaderActions, DeleteButton, ChevronIcon, CardBodyCollapse, CardBody, CheckboxRow } from "./TaxResidenceCard.styles.js";
|
|
10
|
-
import { FlagFor } from "../Country/FlagFor.js";
|
|
11
|
-
const NO_TIN_TEXT_STYLE = {
|
|
12
|
-
fontSize: 12,
|
|
13
|
-
lineHeight: "18px",
|
|
14
|
-
fontWeight: 400,
|
|
15
|
-
letterSpacing: "0.6px",
|
|
16
|
-
color: colors.black
|
|
17
|
-
};
|
|
18
10
|
const TaxResidenceCard = (props) => {
|
|
19
11
|
const {
|
|
20
12
|
id,
|
|
@@ -33,7 +25,6 @@ const TaxResidenceCard = (props) => {
|
|
|
33
25
|
countryPlaceholder = "Search countries",
|
|
34
26
|
disabled = false,
|
|
35
27
|
hideNoTin = false,
|
|
36
|
-
variant = "default",
|
|
37
28
|
error,
|
|
38
29
|
touched,
|
|
39
30
|
dataCy
|
|
@@ -48,7 +39,6 @@ const TaxResidenceCard = (props) => {
|
|
|
48
39
|
() => country ? countries?.find((c) => c.value === country) : null,
|
|
49
40
|
[countries, country]
|
|
50
41
|
);
|
|
51
|
-
const bordered = variant === "bordered";
|
|
52
42
|
const headerTitle = selectedCountry?.label || emptyTitle;
|
|
53
43
|
const toggle = useCallback(() => {
|
|
54
44
|
const next = !isOpen;
|
|
@@ -78,12 +68,11 @@ const TaxResidenceCard = (props) => {
|
|
|
78
68
|
onDelete?.();
|
|
79
69
|
};
|
|
80
70
|
const cy = dataCy || `tax-residence-card-${id}`;
|
|
81
|
-
return /* @__PURE__ */ jsxs(CardWrapper, { isOpen,
|
|
71
|
+
return /* @__PURE__ */ jsxs(CardWrapper, { isOpen, "data-cy": cy, children: [
|
|
82
72
|
/* @__PURE__ */ jsxs(
|
|
83
73
|
CardHeader,
|
|
84
74
|
{
|
|
85
75
|
isOpen,
|
|
86
|
-
$variant: variant,
|
|
87
76
|
onClick: toggle,
|
|
88
77
|
onKeyDown: handleHeaderKeyDown,
|
|
89
78
|
role: "button",
|
|
@@ -92,9 +81,9 @@ const TaxResidenceCard = (props) => {
|
|
|
92
81
|
"aria-controls": `${id}-body`,
|
|
93
82
|
"data-cy": `${cy}-toggle`,
|
|
94
83
|
children: [
|
|
95
|
-
/* @__PURE__ */ jsx(HeaderIcon, { "aria-hidden": "true", children: selectedCountry ? /* @__PURE__ */ jsx(FlagWrapper, {
|
|
96
|
-
/* @__PURE__ */ jsx(HeaderTitle, {
|
|
97
|
-
/* @__PURE__ */ jsxs(HeaderActions, {
|
|
84
|
+
/* @__PURE__ */ jsx(HeaderIcon, { "aria-hidden": "true", children: selectedCountry ? /* @__PURE__ */ jsx(FlagWrapper, { children: /* @__PURE__ */ jsx(FlagFor, { code: selectedCountry.value }) }) : /* @__PURE__ */ jsx(SvgGlobe, {}) }),
|
|
85
|
+
/* @__PURE__ */ jsx(HeaderTitle, { children: headerTitle }),
|
|
86
|
+
/* @__PURE__ */ jsxs(HeaderActions, { children: [
|
|
98
87
|
onDelete && !disabled && /* @__PURE__ */ jsx(
|
|
99
88
|
DeleteButton,
|
|
100
89
|
{
|
|
@@ -103,15 +92,15 @@ const TaxResidenceCard = (props) => {
|
|
|
103
92
|
"aria-label": `Delete ${headerTitle}`,
|
|
104
93
|
disabled,
|
|
105
94
|
"data-cy": `${cy}-delete`,
|
|
106
|
-
children: /* @__PURE__ */ jsx(
|
|
95
|
+
children: /* @__PURE__ */ jsx(SvgTrash, {})
|
|
107
96
|
}
|
|
108
97
|
),
|
|
109
|
-
/* @__PURE__ */ jsx(ChevronIcon, { isOpen,
|
|
98
|
+
/* @__PURE__ */ jsx(ChevronIcon, { isOpen, "aria-hidden": "true" })
|
|
110
99
|
] })
|
|
111
100
|
]
|
|
112
101
|
}
|
|
113
102
|
),
|
|
114
|
-
/* @__PURE__ */ jsx(CardBodyCollapse, { isOpened: isOpen,
|
|
103
|
+
/* @__PURE__ */ jsx(CardBodyCollapse, { isOpened: isOpen, children: /* @__PURE__ */ jsxs(CardBody, { id: `${id}-body`, children: [
|
|
115
104
|
/* @__PURE__ */ jsx(
|
|
116
105
|
CountrySelect,
|
|
117
106
|
{
|
|
@@ -123,7 +112,6 @@ const TaxResidenceCard = (props) => {
|
|
|
123
112
|
onChange: handleCountryChange,
|
|
124
113
|
placeholder: countryPlaceholder,
|
|
125
114
|
disabled,
|
|
126
|
-
variant,
|
|
127
115
|
error: !!error?.country,
|
|
128
116
|
touched: !!touched?.country,
|
|
129
117
|
dataCy: `${cy}-country`
|
|
@@ -138,13 +126,12 @@ const TaxResidenceCard = (props) => {
|
|
|
138
126
|
value: tin,
|
|
139
127
|
onChange: handleTinChange,
|
|
140
128
|
disabled: disabled || noTinIssued,
|
|
141
|
-
variant,
|
|
142
129
|
error: !!error?.tin,
|
|
143
130
|
touched: !!touched?.tin,
|
|
144
131
|
"data-cy": `${cy}-tin`
|
|
145
132
|
}
|
|
146
133
|
),
|
|
147
|
-
(disabled && (tin === "" || !tin) || !disabled) && !hideNoTin && /* @__PURE__ */ jsx(CheckboxRow, {
|
|
134
|
+
(disabled && (tin === "" || !tin) || !disabled) && !hideNoTin && /* @__PURE__ */ jsx(CheckboxRow, { children: /* @__PURE__ */ jsx(
|
|
148
135
|
Checkbox,
|
|
149
136
|
{
|
|
150
137
|
id: `${id}-no-tin`,
|
|
@@ -153,7 +140,6 @@ const TaxResidenceCard = (props) => {
|
|
|
153
140
|
checked: noTinIssued,
|
|
154
141
|
onChange: handleNoTinChange,
|
|
155
142
|
disabled,
|
|
156
|
-
textStyle: bordered ? NO_TIN_TEXT_STYLE : void 0,
|
|
157
143
|
"data-cy": `${cy}-no-tin`
|
|
158
144
|
}
|
|
159
145
|
) })
|
|
@@ -203,8 +189,6 @@ TaxResidenceCard.propTypes = {
|
|
|
203
189
|
disabled: PropTypes.bool,
|
|
204
190
|
/** Whether to hide the "no TIN issued" checkbox. */
|
|
205
191
|
hideNoTin: PropTypes.bool,
|
|
206
|
-
/** `bordered`: white card with a 20px padding and boxed fields (sign-up redesign). Default keeps the list look. */
|
|
207
|
-
variant: PropTypes.oneOf(["default", "bordered"]),
|
|
208
192
|
/** Per-field error flags: `{ country, tin }`. */
|
|
209
193
|
error: PropTypes.shape({
|
|
210
194
|
country: PropTypes.bool,
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare const CardWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
2
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
3
|
+
}, {
|
|
4
|
+
isOpen?: boolean;
|
|
5
|
+
}>> & string;
|
|
6
|
+
/**
|
|
7
|
+
* Header is a click target, but it CANNOT be a real `<button>` because we
|
|
8
|
+
* render a delete `<button>` inside it (nested interactive elements are
|
|
9
|
+
* invalid HTML). We use a div with role="button" + keyboard handlers in the
|
|
10
|
+
* component so accessibility stays intact.
|
|
11
|
+
*/
|
|
12
|
+
export declare const CardHeader: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
13
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
14
|
+
}, {
|
|
15
|
+
isOpen?: boolean;
|
|
16
|
+
}>> & string;
|
|
17
|
+
/**
|
|
18
|
+
* Slot in front of the title. Has no intrinsic size of its own — children
|
|
19
|
+
* (flag wrapper or globe SVG) define their own dimensions so each icon keeps
|
|
20
|
+
* its natural aspect ratio (3:2 for flags, 1:1 for the globe).
|
|
21
|
+
*/
|
|
22
|
+
export declare const HeaderIcon: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
23
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
24
|
+
}> & string;
|
|
25
|
+
/** 3:2 frame for country flags so they line up across rows. */
|
|
26
|
+
export declare const FlagWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
27
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
28
|
+
}> & string;
|
|
29
|
+
export declare const HeaderTitle: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
30
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
31
|
+
}> & string;
|
|
32
|
+
export declare const HeaderActions: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
33
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
34
|
+
}> & string;
|
|
35
|
+
/**
|
|
36
|
+
* Plain icon button hosting an inline-SVG <TrashIcon>: the screenshot calls for a thin outline
|
|
37
|
+
* trash, which we draw ourselves to keep stroke weight and metrics consistent with the globe icon.
|
|
38
|
+
*/
|
|
39
|
+
export declare const DeleteButton: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style"> & {
|
|
40
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
41
|
+
}> & string;
|
|
42
|
+
export declare const ChevronIcon: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
43
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
44
|
+
}, {
|
|
45
|
+
isOpen?: boolean;
|
|
46
|
+
}>, "children"> & Partial<Pick<import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
47
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
48
|
+
}, {
|
|
49
|
+
isOpen?: boolean;
|
|
50
|
+
}>, "children">>> & string;
|
|
51
|
+
export declare const CardBodyCollapse: any;
|
|
52
|
+
export declare const CardBody: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
53
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
54
|
+
}> & string;
|
|
55
|
+
export declare const CheckboxRow: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
56
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
57
|
+
}> & string;
|
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
2
|
import { Collapse } from "react-collapse";
|
|
3
|
-
import theme from "../../styles/theme.js";
|
|
4
3
|
import { glyph } from "../MaterialIcon/glyph.js";
|
|
5
|
-
import { colors } from "../../styles/colors.js";
|
|
6
|
-
import { elevation } from "../../styles/elevation.js";
|
|
7
|
-
import { space, radius } from "../../styles/spacing.js";
|
|
8
|
-
import { typography } from "../../styles/typography.js";
|
|
9
|
-
import { BORDERED_BORDER } from "../../styles/borderedField.js";
|
|
10
|
-
const bordered = (rules) => (props) => props.$variant === "bordered" && rules;
|
|
11
|
-
const NOT_FORWARDED = ["isOpen", "$variant"];
|
|
12
4
|
const CardWrapper = styled.div.withConfig({
|
|
13
|
-
shouldForwardProp: (prop) => !
|
|
5
|
+
shouldForwardProp: (prop) => !["isOpen"].includes(prop)
|
|
14
6
|
})`
|
|
15
|
-
background:
|
|
16
|
-
border: 1px solid
|
|
7
|
+
background: var(--stokr-background-default);
|
|
8
|
+
border: 1px solid var(--stokr-border-subtle);
|
|
17
9
|
border-radius: 8px;
|
|
18
10
|
overflow: hidden;
|
|
19
11
|
transition:
|
|
@@ -21,25 +13,16 @@ const CardWrapper = styled.div.withConfig({
|
|
|
21
13
|
box-shadow 0.2s;
|
|
22
14
|
|
|
23
15
|
${(props) => props.isOpen && css`
|
|
24
|
-
border-color:
|
|
16
|
+
border-color: var(--stokr-border-subtle);
|
|
25
17
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
|
|
26
18
|
`}
|
|
27
19
|
|
|
28
|
-
${bordered(css`
|
|
29
|
-
padding: ${space[5]};
|
|
30
|
-
border: ${BORDERED_BORDER};
|
|
31
|
-
border-radius: ${radius.lg};
|
|
32
|
-
background: ${colors.white};
|
|
33
|
-
box-shadow: ${elevation.md};
|
|
34
|
-
overflow: visible;
|
|
35
|
-
`)}
|
|
36
|
-
|
|
37
20
|
& + & {
|
|
38
21
|
margin-top: 12px;
|
|
39
22
|
}
|
|
40
23
|
`;
|
|
41
24
|
const CardHeader = styled.div.withConfig({
|
|
42
|
-
shouldForwardProp: (prop) => !
|
|
25
|
+
shouldForwardProp: (prop) => !["isOpen"].includes(prop)
|
|
43
26
|
})`
|
|
44
27
|
display: flex;
|
|
45
28
|
align-items: center;
|
|
@@ -50,33 +33,18 @@ const CardHeader = styled.div.withConfig({
|
|
|
50
33
|
outline: 0;
|
|
51
34
|
cursor: pointer;
|
|
52
35
|
text-align: left;
|
|
53
|
-
font-family:
|
|
54
|
-
color:
|
|
36
|
+
font-family: var(--stokr-font-family-base);
|
|
37
|
+
color: var(--stokr-text-primary);
|
|
55
38
|
transition: background-color 0.15s;
|
|
56
39
|
user-select: none;
|
|
57
40
|
|
|
58
41
|
&:hover {
|
|
59
|
-
background-color:
|
|
42
|
+
background-color: var(--stokr-background-surface);
|
|
60
43
|
}
|
|
61
44
|
|
|
62
45
|
&:focus-visible {
|
|
63
|
-
box-shadow: inset 0 0 0 2px
|
|
46
|
+
box-shadow: inset 0 0 0 2px var(--stokr-color-blue-500);
|
|
64
47
|
}
|
|
65
|
-
|
|
66
|
-
${bordered(css`
|
|
67
|
-
padding: 0;
|
|
68
|
-
|
|
69
|
-
&:hover {
|
|
70
|
-
background-color: transparent;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
&:focus-visible {
|
|
74
|
-
box-shadow: none;
|
|
75
|
-
outline: 2px solid ${theme.cPrimary};
|
|
76
|
-
outline-offset: 4px;
|
|
77
|
-
border-radius: ${radius.sm};
|
|
78
|
-
}
|
|
79
|
-
`)}
|
|
80
48
|
`;
|
|
81
49
|
const HeaderIcon = styled.span`
|
|
82
50
|
display: inline-flex;
|
|
@@ -85,15 +53,9 @@ const HeaderIcon = styled.span`
|
|
|
85
53
|
width: 24px;
|
|
86
54
|
margin-right: 16px;
|
|
87
55
|
flex-shrink: 0;
|
|
88
|
-
color:
|
|
89
|
-
|
|
90
|
-
${bordered(css`
|
|
91
|
-
margin-right: ${space[3]};
|
|
92
|
-
`)}
|
|
56
|
+
color: var(--stokr-text-primary);
|
|
93
57
|
`;
|
|
94
|
-
const FlagWrapper = styled.span
|
|
95
|
-
shouldForwardProp: (prop) => !NOT_FORWARDED.includes(prop)
|
|
96
|
-
})`
|
|
58
|
+
const FlagWrapper = styled.span`
|
|
97
59
|
display: inline-flex;
|
|
98
60
|
width: 24px;
|
|
99
61
|
height: 18px;
|
|
@@ -107,45 +69,27 @@ const FlagWrapper = styled.span.withConfig({
|
|
|
107
69
|
object-fit: cover;
|
|
108
70
|
display: block;
|
|
109
71
|
}
|
|
110
|
-
|
|
111
|
-
${bordered(css`
|
|
112
|
-
height: 20px;
|
|
113
|
-
`)}
|
|
114
72
|
`;
|
|
115
|
-
const HeaderTitle = styled.span
|
|
116
|
-
shouldForwardProp: (prop) => !NOT_FORWARDED.includes(prop)
|
|
117
|
-
})`
|
|
73
|
+
const HeaderTitle = styled.span`
|
|
118
74
|
flex: 1;
|
|
119
75
|
min-width: 0;
|
|
120
|
-
font-family:
|
|
76
|
+
font-family: var(--stokr-font-family-base);
|
|
121
77
|
font-weight: 700;
|
|
122
78
|
font-size: 13px;
|
|
123
79
|
line-height: 18px;
|
|
124
80
|
letter-spacing: 1.5px;
|
|
125
81
|
text-transform: uppercase;
|
|
126
|
-
color:
|
|
82
|
+
color: var(--stokr-text-primary);
|
|
127
83
|
white-space: nowrap;
|
|
128
84
|
overflow: hidden;
|
|
129
85
|
text-overflow: ellipsis;
|
|
130
|
-
|
|
131
|
-
${bordered(css`
|
|
132
|
-
${typography.bodyMdCallout}
|
|
133
|
-
text-transform: none;
|
|
134
|
-
color: ${colors.black};
|
|
135
|
-
`)}
|
|
136
86
|
`;
|
|
137
|
-
const HeaderActions = styled.div
|
|
138
|
-
shouldForwardProp: (prop) => !NOT_FORWARDED.includes(prop)
|
|
139
|
-
})`
|
|
87
|
+
const HeaderActions = styled.div`
|
|
140
88
|
display: flex;
|
|
141
89
|
align-items: center;
|
|
142
90
|
gap: 14px;
|
|
143
91
|
margin-left: 12px;
|
|
144
92
|
flex-shrink: 0;
|
|
145
|
-
|
|
146
|
-
${bordered(css`
|
|
147
|
-
gap: ${space[3]};
|
|
148
|
-
`)}
|
|
149
93
|
`;
|
|
150
94
|
const DeleteButton = styled.button`
|
|
151
95
|
display: inline-flex;
|
|
@@ -156,7 +100,7 @@ const DeleteButton = styled.button`
|
|
|
156
100
|
padding: 0;
|
|
157
101
|
border: 0;
|
|
158
102
|
background: transparent;
|
|
159
|
-
color:
|
|
103
|
+
color: var(--stokr-text-primary);
|
|
160
104
|
cursor: pointer;
|
|
161
105
|
border-radius: 50%;
|
|
162
106
|
transition:
|
|
@@ -164,78 +108,52 @@ const DeleteButton = styled.button`
|
|
|
164
108
|
background-color 0.15s;
|
|
165
109
|
|
|
166
110
|
&:hover {
|
|
167
|
-
color:
|
|
168
|
-
background-color:
|
|
111
|
+
color: var(--stokr-action-negative-text);
|
|
112
|
+
background-color: var(--stokr-action-negative-bg);
|
|
169
113
|
}
|
|
170
114
|
|
|
171
115
|
&:focus-visible {
|
|
172
|
-
outline: 2px solid
|
|
116
|
+
outline: 2px solid var(--stokr-border-focus);
|
|
173
117
|
outline-offset: 2px;
|
|
174
118
|
}
|
|
175
119
|
|
|
176
120
|
&:disabled {
|
|
177
121
|
cursor: not-allowed;
|
|
178
|
-
color:
|
|
122
|
+
color: var(--stokr-text-tertiary);
|
|
179
123
|
|
|
180
124
|
&:hover {
|
|
181
|
-
color:
|
|
125
|
+
color: var(--stokr-text-tertiary);
|
|
182
126
|
background-color: transparent;
|
|
183
127
|
}
|
|
184
128
|
}
|
|
185
129
|
`;
|
|
186
130
|
const ChevronIcon = styled.span.withConfig({
|
|
187
|
-
shouldForwardProp: (prop) => !
|
|
131
|
+
shouldForwardProp: (prop) => !["isOpen"].includes(prop)
|
|
188
132
|
}).attrs({
|
|
189
133
|
children: glyph("keyboard_arrow_down")
|
|
190
134
|
})`
|
|
191
135
|
display: inline-flex;
|
|
192
136
|
font-size: 20px;
|
|
193
137
|
line-height: 1;
|
|
194
|
-
color:
|
|
138
|
+
color: var(--stokr-text-primary);
|
|
195
139
|
transform: rotate(0);
|
|
196
140
|
transition: transform 0.25s ease;
|
|
197
141
|
|
|
198
142
|
${(props) => props.isOpen && css`
|
|
199
143
|
transform: rotate(180deg);
|
|
200
144
|
`}
|
|
201
|
-
|
|
202
|
-
${bordered(css`
|
|
203
|
-
font-size: 16px;
|
|
204
|
-
`)}
|
|
205
145
|
`;
|
|
206
|
-
const CardBodyCollapse = styled(Collapse)
|
|
207
|
-
|
|
208
|
-
})`
|
|
209
|
-
border-top: 1px solid ${theme.cLightGrey};
|
|
210
|
-
|
|
211
|
-
${bordered(css`
|
|
212
|
-
border-top: 0;
|
|
213
|
-
`)}
|
|
146
|
+
const CardBodyCollapse = styled(Collapse)`
|
|
147
|
+
border-top: 1px solid var(--stokr-border-subtle);
|
|
214
148
|
`;
|
|
215
149
|
const CardBody = styled.div`
|
|
216
150
|
display: flex;
|
|
217
151
|
flex-direction: column;
|
|
218
152
|
gap: 26px;
|
|
219
153
|
padding: 24px 22px 20px;
|
|
220
|
-
|
|
221
|
-
${bordered(css`
|
|
222
|
-
gap: ${space[8]};
|
|
223
|
-
padding: ${space[8]} 0 0;
|
|
224
|
-
|
|
225
|
-
/* Figma labels the card's fields 14/20; the shared bordered label is 12/16. */
|
|
226
|
-
& > * > label {
|
|
227
|
-
font-size: 14px;
|
|
228
|
-
line-height: 20px;
|
|
229
|
-
letter-spacing: 0.5px;
|
|
230
|
-
}
|
|
231
|
-
`)}
|
|
232
154
|
`;
|
|
233
155
|
const CheckboxRow = styled.div`
|
|
234
156
|
padding-top: 4px;
|
|
235
|
-
|
|
236
|
-
${bordered(css`
|
|
237
|
-
padding-top: 0;
|
|
238
|
-
`)}
|
|
239
157
|
`;
|
|
240
158
|
export {
|
|
241
159
|
CardBody,
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
+
import { TextName } from '../../design-system';
|
|
2
|
+
/** The kit's text colours (`--stokr-text-*`). */
|
|
3
|
+
export type TextColor = 'primary' | 'body' | 'secondary' | 'tertiary';
|
|
1
4
|
export interface TextProps {
|
|
5
|
+
/**
|
|
6
|
+
* A kit text style applied to the element itself, e.g. `<Text as="h2" variant="titleXl">`. Without it, `Text` styles
|
|
7
|
+
* the `h1`–`h5`, `p` and `ul` inside it (rich content, e.g. from the CMS).
|
|
8
|
+
*/
|
|
9
|
+
variant?: TextName;
|
|
10
|
+
/**
|
|
11
|
+
* Colours the whole block. Unset with a `variant`: display, titles, subtitles and links `primary`, caption and
|
|
12
|
+
* footnote `tertiary`, the rest `body`. Unset without: headings `primary`, the `h4` subtitle `secondary`, running text `body`.
|
|
13
|
+
*/
|
|
14
|
+
color?: TextColor;
|
|
2
15
|
fullWidth?: boolean;
|
|
3
16
|
center?: boolean;
|
|
4
17
|
withMarginBottom?: boolean;
|
|
@@ -13,7 +26,10 @@ export interface TextCaptionProps {
|
|
|
13
26
|
/** Extra space above, for a caption under a link or button. */
|
|
14
27
|
link?: boolean;
|
|
15
28
|
}
|
|
16
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Text in a kit style (`variant`, e.g. `titleXl`, `bodyM`), or a block that styles rich content (headings, paragraphs,
|
|
31
|
+
* lists). `Text.Caption` is the small print style.
|
|
32
|
+
*/
|
|
17
33
|
export declare const Text: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
18
34
|
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
19
35
|
}, TextProps>> & string & {
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import { text } from "../../design-system/styled/text.js";
|
|
3
|
+
import { breakpoint } from "../../design-system/styled/breakpoint.js";
|
|
4
|
+
const variantColor = (variant) => {
|
|
5
|
+
if (/^(display|title|subtitle|link)/.test(variant)) return "primary";
|
|
6
|
+
if (variant === "caption" || variant === "footnote") return "tertiary";
|
|
7
|
+
return "body";
|
|
8
|
+
};
|
|
4
9
|
const TextBase = styled.div.withConfig({
|
|
5
10
|
shouldForwardProp: (props) => ![
|
|
11
|
+
"variant",
|
|
12
|
+
"color",
|
|
6
13
|
"fullWidth",
|
|
7
14
|
"center",
|
|
8
15
|
"withMarginBottom",
|
|
@@ -14,6 +21,24 @@ const TextBase = styled.div.withConfig({
|
|
|
14
21
|
].includes(props)
|
|
15
22
|
})`
|
|
16
23
|
display: block;
|
|
24
|
+
color: var(--stokr-text-${({ color, variant }) => color ?? (variant ? variantColor(variant) : "body")});
|
|
25
|
+
|
|
26
|
+
${({ variant }) => variant && `
|
|
27
|
+
margin: 0;
|
|
28
|
+
font-family: var(--stokr-font-family-base);
|
|
29
|
+
${text(variant)}
|
|
30
|
+
`}
|
|
31
|
+
|
|
32
|
+
h1,
|
|
33
|
+
h2,
|
|
34
|
+
h3,
|
|
35
|
+
h5 {
|
|
36
|
+
color: ${({ color }) => color ? "inherit" : "var(--stokr-text-primary)"};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
h4 {
|
|
40
|
+
color: ${({ color }) => color ? "inherit" : "var(--stokr-text-secondary)"};
|
|
41
|
+
}
|
|
17
42
|
|
|
18
43
|
${({ withMarginBottom }) => withMarginBottom && `
|
|
19
44
|
margin-bottom: 32px;
|
|
@@ -32,7 +57,7 @@ const TextBase = styled.div.withConfig({
|
|
|
32
57
|
|
|
33
58
|
|
|
34
59
|
h1 {
|
|
35
|
-
font-family:
|
|
60
|
+
font-family: var(--stokr-font-family-base);
|
|
36
61
|
font-weight: 800;
|
|
37
62
|
font-size: 22px;
|
|
38
63
|
line-height: 1.18;
|
|
@@ -41,7 +66,7 @@ const TextBase = styled.div.withConfig({
|
|
|
41
66
|
margin-top: 1em;
|
|
42
67
|
margin-bottom: 32px;
|
|
43
68
|
|
|
44
|
-
${
|
|
69
|
+
${breakpoint.Medium`
|
|
45
70
|
font-size: 34px;
|
|
46
71
|
letter-spacing: 1.5px;
|
|
47
72
|
margin-bottom: 45px;
|
|
@@ -49,7 +74,7 @@ const TextBase = styled.div.withConfig({
|
|
|
49
74
|
}
|
|
50
75
|
|
|
51
76
|
h2 {
|
|
52
|
-
font-family:
|
|
77
|
+
font-family: var(--stokr-font-family-base);
|
|
53
78
|
font-weight: 300;
|
|
54
79
|
font-size: 34px;
|
|
55
80
|
line-height: 1.18em;
|
|
@@ -57,26 +82,25 @@ const TextBase = styled.div.withConfig({
|
|
|
57
82
|
margin-top: 1em;
|
|
58
83
|
margin-bottom: 0.18em;
|
|
59
84
|
|
|
60
|
-
${
|
|
85
|
+
${breakpoint.Medium`
|
|
61
86
|
font-size: 42px;
|
|
62
87
|
`}
|
|
63
88
|
|
|
64
|
-
${
|
|
89
|
+
${breakpoint.Large`
|
|
65
90
|
font-size: 50px;
|
|
66
91
|
`}
|
|
67
92
|
}
|
|
68
93
|
|
|
69
94
|
h4 {
|
|
70
|
-
font-family:
|
|
95
|
+
font-family: var(--stokr-font-family-base);
|
|
71
96
|
font-weight: 300;
|
|
72
97
|
font-size: 17px;
|
|
73
98
|
line-height: 1.27em;
|
|
74
99
|
letter-spacing: 0.8px;
|
|
75
100
|
margin-top: 1em;
|
|
76
101
|
margin-bottom: 0.27em;
|
|
77
|
-
opacity: 0.5;
|
|
78
102
|
|
|
79
|
-
${
|
|
103
|
+
${breakpoint.Medium`
|
|
80
104
|
//font-size: 34px;
|
|
81
105
|
`}
|
|
82
106
|
|
|
@@ -86,7 +110,7 @@ const TextBase = styled.div.withConfig({
|
|
|
86
110
|
}
|
|
87
111
|
|
|
88
112
|
h3 {
|
|
89
|
-
font-family:
|
|
113
|
+
font-family: var(--stokr-font-family-base);
|
|
90
114
|
font-weight: 800;
|
|
91
115
|
font-size: 22px;
|
|
92
116
|
line-height: 1.27em;
|
|
@@ -95,19 +119,19 @@ const TextBase = styled.div.withConfig({
|
|
|
95
119
|
margin-bottom: 0.27em;
|
|
96
120
|
text-transform: uppercase;
|
|
97
121
|
|
|
98
|
-
${
|
|
122
|
+
${breakpoint.Medium`
|
|
99
123
|
font-size: 34px;
|
|
100
124
|
`}
|
|
101
125
|
|
|
102
|
-
|
|
126
|
+
${breakpoint.Medium`${breakpoint.below.MLarge`
|
|
103
127
|
${(props) => props.responsiveFont && `
|
|
104
128
|
font-size: 22px;
|
|
105
129
|
`}
|
|
106
|
-
}
|
|
130
|
+
`}`}
|
|
107
131
|
}
|
|
108
132
|
|
|
109
133
|
h5 {
|
|
110
|
-
font-family:
|
|
134
|
+
font-family: var(--stokr-font-family-base);
|
|
111
135
|
font-weight: 800;
|
|
112
136
|
font-size: 22px;
|
|
113
137
|
line-height: 1.27em;
|
|
@@ -116,7 +140,7 @@ const TextBase = styled.div.withConfig({
|
|
|
116
140
|
}
|
|
117
141
|
|
|
118
142
|
p {
|
|
119
|
-
font-family:
|
|
143
|
+
font-family: var(--stokr-font-family-base);
|
|
120
144
|
font-weight: 300;
|
|
121
145
|
font-size: 16px;
|
|
122
146
|
line-height: 1.5em;
|
|
@@ -127,7 +151,7 @@ const TextBase = styled.div.withConfig({
|
|
|
127
151
|
font-size:12px;
|
|
128
152
|
`}
|
|
129
153
|
|
|
130
|
-
${
|
|
154
|
+
${breakpoint.XLarge`
|
|
131
155
|
font-size: 20px;
|
|
132
156
|
|
|
133
157
|
${(props) => props.small && `
|
|
@@ -142,12 +166,12 @@ const TextBase = styled.div.withConfig({
|
|
|
142
166
|
color: inherit;
|
|
143
167
|
|
|
144
168
|
&:hover {
|
|
145
|
-
color:
|
|
169
|
+
color: var(--stokr-text-primary);
|
|
146
170
|
}
|
|
147
171
|
}
|
|
148
172
|
|
|
149
173
|
${(props) => props.success && `
|
|
150
|
-
color:
|
|
174
|
+
color: var(--stokr-status-success-text);
|
|
151
175
|
`}
|
|
152
176
|
}
|
|
153
177
|
|
|
@@ -163,9 +187,9 @@ const TextBase = styled.div.withConfig({
|
|
|
163
187
|
letter-spacing: 0.6px;
|
|
164
188
|
}
|
|
165
189
|
|
|
166
|
-
|
|
190
|
+
${breakpoint.below.Mobile`
|
|
167
191
|
padding-left: 15px;
|
|
168
|
-
}
|
|
192
|
+
`}
|
|
169
193
|
}
|
|
170
194
|
|
|
171
195
|
> *:first-child {
|
|
@@ -180,9 +204,10 @@ const Caption = styled.p.withConfig({
|
|
|
180
204
|
shouldForwardProp: (props) => !["center", "link"].includes(props)
|
|
181
205
|
})`
|
|
182
206
|
&&& {
|
|
183
|
-
font-family:
|
|
207
|
+
font-family: var(--stokr-font-family-base);
|
|
184
208
|
font-weight: 300;
|
|
185
209
|
font-size: 9px;
|
|
210
|
+
color: var(--stokr-text-tertiary);
|
|
186
211
|
line-height: 1.78em;
|
|
187
212
|
letter-spacing: 0.4px;
|
|
188
213
|
|
|
@@ -191,7 +216,7 @@ const Caption = styled.p.withConfig({
|
|
|
191
216
|
font-size: 9px;
|
|
192
217
|
}
|
|
193
218
|
|
|
194
|
-
${
|
|
219
|
+
${breakpoint.Large`
|
|
195
220
|
font-size: 12px;
|
|
196
221
|
|
|
197
222
|
p {
|
|
@@ -205,10 +230,10 @@ const Caption = styled.p.withConfig({
|
|
|
205
230
|
a {
|
|
206
231
|
text-decoration: underline;
|
|
207
232
|
transition: color 0.2s;
|
|
208
|
-
color:
|
|
233
|
+
color: var(--stokr-text-link);
|
|
209
234
|
|
|
210
235
|
&:hover {
|
|
211
|
-
color:
|
|
236
|
+
color: var(--stokr-text-primary);
|
|
212
237
|
}
|
|
213
238
|
}
|
|
214
239
|
}
|