@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,7 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
export interface SectionProps extends Omit<HTMLAttributes<HTMLElement>, 'title' | 'children' | 'onToggle'> {
|
|
3
3
|
title?: ReactNode;
|
|
4
|
-
children
|
|
4
|
+
children: ReactNode;
|
|
5
5
|
/** `plain` sits on the page background instead of in a card. */
|
|
6
6
|
variant?: 'card' | 'plain';
|
|
7
7
|
/** Figma elevation/xs on the card. */
|
|
@@ -5,9 +5,9 @@ import { inertProp } from "../../utils/inertProp.js";
|
|
|
5
5
|
import { Chevron } from "../Collapsible/Collapsible.styles.js";
|
|
6
6
|
import { SkeletonLines } from "../Skeleton/Skeleton.js";
|
|
7
7
|
import { useMediaQuery } from "../../hooks/useMediaQuery.js";
|
|
8
|
-
import { mediaQuery } from "../../styles/rwd.js";
|
|
9
8
|
import { SectionRoot, SectionHeader, SectionHeading, SectionToggle, SectionBody, SectionBodyClip, SectionBodyInner } from "./Section.styles.js";
|
|
10
|
-
|
|
9
|
+
import { breakpoint } from "../../design-system/styled/breakpoint.js";
|
|
10
|
+
const Section = forwardRef(function SectionBase({
|
|
11
11
|
title,
|
|
12
12
|
children,
|
|
13
13
|
variant = "card",
|
|
@@ -28,7 +28,7 @@ const Section = forwardRef(function Section2({
|
|
|
28
28
|
const desktopOpen = collapsibleProp === "desktop-open";
|
|
29
29
|
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
30
30
|
const [touched, setTouched] = useState(false);
|
|
31
|
-
const isDesktop = useMediaQuery(
|
|
31
|
+
const isDesktop = useMediaQuery(breakpoint.query.up.MLarge, true);
|
|
32
32
|
const controlled = openProp !== void 0;
|
|
33
33
|
const followsWidth = desktopOpen && !touched && !controlled;
|
|
34
34
|
const open = controlled ? openProp : uncontrolledOpen;
|
|
@@ -78,6 +78,7 @@ const Section = forwardRef(function Section2({
|
|
|
78
78
|
}
|
|
79
79
|
);
|
|
80
80
|
});
|
|
81
|
+
Section.displayName = "Section";
|
|
81
82
|
export {
|
|
82
83
|
Section
|
|
83
84
|
};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sections are cards: white, 1px border/subtle, radius/lg,
|
|
3
|
+
* padding space/6, children separated by space/8. `plain` opts out for sections that
|
|
4
|
+
* sit directly on the page background (the hero).
|
|
5
|
+
*/
|
|
1
6
|
export declare const SectionRoot: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, "style"> & {
|
|
2
7
|
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
3
8
|
}, {
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
2
|
import { Body, BodyClip } from "../Collapsible/Collapsible.styles.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { elevation } from "../../styles/elevation.js";
|
|
6
|
-
import { space, radius } from "../../styles/spacing.js";
|
|
7
|
-
import { typography } from "../../styles/typography.js";
|
|
8
|
-
const MOBILE = media.belowDesktop;
|
|
9
|
-
const DESKTOP = media.desktopUp;
|
|
3
|
+
import { breakpoint } from "../../design-system/styled/breakpoint.js";
|
|
4
|
+
import { text } from "../../design-system/styled/text.js";
|
|
10
5
|
const SectionRoot = styled.section`
|
|
11
|
-
--section-gap:
|
|
6
|
+
--section-gap: var(--stokr-space-8);
|
|
12
7
|
/* The card's padding, for the toggle to reach over it. */
|
|
13
8
|
--section-pad-y: 0px;
|
|
14
9
|
--section-pad-x: 0px;
|
|
@@ -17,20 +12,20 @@ const SectionRoot = styled.section`
|
|
|
17
12
|
gap: ${({ $collapsible }) => $collapsible ? "0" : "var(--section-gap)"};
|
|
18
13
|
|
|
19
14
|
${({ $variant, $elevated }) => $variant === "card" && css`
|
|
20
|
-
--section-pad-y:
|
|
21
|
-
--section-pad-x:
|
|
15
|
+
--section-pad-y: var(--stokr-space-6);
|
|
16
|
+
--section-pad-x: var(--stokr-space-6);
|
|
22
17
|
padding: var(--section-pad-y) var(--section-pad-x);
|
|
23
|
-
background:
|
|
24
|
-
border: 1px solid
|
|
25
|
-
border-radius:
|
|
26
|
-
box-shadow: ${$elevated ? elevation
|
|
18
|
+
background: var(--stokr-background-default);
|
|
19
|
+
border: 1px solid var(--stokr-border-subtle);
|
|
20
|
+
border-radius: var(--stokr-radius-lg);
|
|
21
|
+
box-shadow: ${$elevated ? "var(--stokr-elevation-xs)" : "none"};
|
|
27
22
|
|
|
28
23
|
/* Figma 3582:128652: mobile cards are 20 / 16 with 16 under the header. */
|
|
29
|
-
${
|
|
30
|
-
--section-gap:
|
|
31
|
-
--section-pad-y:
|
|
32
|
-
--section-pad-x:
|
|
33
|
-
}
|
|
24
|
+
${breakpoint.below.MLarge`
|
|
25
|
+
--section-gap: var(--stokr-space-4);
|
|
26
|
+
--section-pad-y: var(--stokr-space-5);
|
|
27
|
+
--section-pad-x: var(--stokr-space-4);
|
|
28
|
+
`}
|
|
34
29
|
`}
|
|
35
30
|
|
|
36
31
|
/* Collapsed, the whole card opens it, so it lifts under the pointer as an investment card does. */
|
|
@@ -38,19 +33,19 @@ const SectionRoot = styled.section`
|
|
|
38
33
|
if ($variant !== "card" || !$collapsed) return "";
|
|
39
34
|
const lift = css`
|
|
40
35
|
&:hover {
|
|
41
|
-
box-shadow:
|
|
36
|
+
box-shadow: var(--stokr-elevation-sm);
|
|
42
37
|
}
|
|
43
38
|
`;
|
|
44
39
|
return $always ? lift : css`
|
|
45
|
-
${
|
|
40
|
+
${breakpoint.below.MLarge`
|
|
46
41
|
${lift}
|
|
47
|
-
}
|
|
42
|
+
`}
|
|
48
43
|
`;
|
|
49
44
|
}}
|
|
50
45
|
`;
|
|
51
46
|
const SectionHeader = styled.div`
|
|
52
|
-
padding-bottom:
|
|
53
|
-
border-bottom: 1px solid
|
|
47
|
+
padding-bottom: var(--stokr-space-5);
|
|
48
|
+
border-bottom: 1px solid var(--stokr-border-subtle);
|
|
54
49
|
transition:
|
|
55
50
|
padding-bottom 300ms,
|
|
56
51
|
border-color 300ms;
|
|
@@ -59,10 +54,10 @@ const SectionHeader = styled.div`
|
|
|
59
54
|
padding-bottom: 0;
|
|
60
55
|
border-bottom-color: transparent;
|
|
61
56
|
` : css`
|
|
62
|
-
${
|
|
57
|
+
${breakpoint.below.MLarge`
|
|
63
58
|
padding-bottom: 0;
|
|
64
59
|
border-bottom-color: transparent;
|
|
65
|
-
}
|
|
60
|
+
`}
|
|
66
61
|
`)}
|
|
67
62
|
|
|
68
63
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -73,11 +68,11 @@ const SectionToggle = styled.button`
|
|
|
73
68
|
display: flex;
|
|
74
69
|
align-items: center;
|
|
75
70
|
justify-content: space-between;
|
|
76
|
-
gap:
|
|
71
|
+
gap: var(--stokr-space-4);
|
|
77
72
|
width: calc(100% + 2 * var(--section-pad-x));
|
|
78
73
|
margin: calc(-1 * var(--section-pad-y)) calc(-1 * var(--section-pad-x)) 0;
|
|
79
74
|
padding: var(--section-pad-y) var(--section-pad-x) 0;
|
|
80
|
-
border-radius:
|
|
75
|
+
border-radius: var(--stokr-radius-lg);
|
|
81
76
|
|
|
82
77
|
${({ $collapsed, $always }) => {
|
|
83
78
|
const reachBottom = css`
|
|
@@ -86,9 +81,9 @@ const SectionToggle = styled.button`
|
|
|
86
81
|
`;
|
|
87
82
|
if (!$collapsed) return "";
|
|
88
83
|
return $always ? reachBottom : css`
|
|
89
|
-
${
|
|
84
|
+
${breakpoint.below.MLarge`
|
|
90
85
|
${reachBottom}
|
|
91
|
-
}
|
|
86
|
+
`}
|
|
92
87
|
`;
|
|
93
88
|
}}
|
|
94
89
|
|
|
@@ -102,21 +97,21 @@ const SectionToggle = styled.button`
|
|
|
102
97
|
`;
|
|
103
98
|
const SectionBody = styled(Body)`
|
|
104
99
|
${({ $always }) => !$always && css`
|
|
105
|
-
${
|
|
100
|
+
${breakpoint.MLarge`
|
|
106
101
|
&& {
|
|
107
102
|
grid-template-rows: 1fr;
|
|
108
103
|
opacity: 1;
|
|
109
104
|
}
|
|
110
|
-
}
|
|
105
|
+
`}
|
|
111
106
|
`}
|
|
112
107
|
`;
|
|
113
108
|
const SectionBodyClip = styled(BodyClip)`
|
|
114
109
|
${({ $always }) => !$always && css`
|
|
115
|
-
${
|
|
110
|
+
${breakpoint.MLarge`
|
|
116
111
|
&& {
|
|
117
112
|
overflow: visible;
|
|
118
113
|
}
|
|
119
|
-
}
|
|
114
|
+
`}
|
|
120
115
|
`}
|
|
121
116
|
`;
|
|
122
117
|
const SectionBodyInner = styled.div`
|
|
@@ -126,11 +121,11 @@ const SectionBodyInner = styled.div`
|
|
|
126
121
|
padding-top: var(--section-gap);
|
|
127
122
|
`;
|
|
128
123
|
const SectionHeading = styled.h2`
|
|
129
|
-
${
|
|
124
|
+
${text("subtitleM")};
|
|
130
125
|
/* Global h2 rules may uppercase; the design does not. */
|
|
131
126
|
text-transform: none;
|
|
132
127
|
margin: 0;
|
|
133
|
-
color:
|
|
128
|
+
color: var(--stokr-text-primary);
|
|
134
129
|
`;
|
|
135
130
|
export {
|
|
136
131
|
SectionBody,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
/** Names of the `--stokr-radius-*` tokens. */
|
|
3
|
+
type RadiusName = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full';
|
|
3
4
|
export interface SkeletonProps {
|
|
4
5
|
/** px when a number, any CSS length otherwise. */
|
|
5
6
|
width?: number | string;
|
|
@@ -7,7 +8,7 @@ export interface SkeletonProps {
|
|
|
7
8
|
/** Fully rounded: a circle when width = height (avatars, icons), a pill otherwise (buttons, badges). */
|
|
8
9
|
round?: boolean;
|
|
9
10
|
/** Corner radius: a `radius` token name, px, or CSS length. Overrides `round`. Default `sm` (4px). */
|
|
10
|
-
radius?:
|
|
11
|
+
radius?: RadiusName | number | string;
|
|
11
12
|
/** Set false for a still block (e.g. many skeletons at once). Reduced-motion users never see the shimmer. */
|
|
12
13
|
animate?: boolean;
|
|
13
14
|
/** Block colour; change both colours on dark or coloured backgrounds. */
|
|
@@ -42,3 +43,4 @@ export interface SkeletonStatusProps {
|
|
|
42
43
|
}
|
|
43
44
|
/** Marks an area as loading: screen readers read `label`, the skeletons inside stay silent. */
|
|
44
45
|
export declare const SkeletonStatus: ({ children, label, className, dataCy }: SkeletonStatusProps) => import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export {};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { SkeletonBlock, SkeletonLinesRoot, VisuallyHidden } from "./Skeleton.styles.js";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const RADIUS_NAMES = ["none", "xs", "sm", "md", "lg", "xl", "2xl", "3xl", "full"];
|
|
4
|
+
const radiusVar = (name) => `var(--stokr-radius-${name})`;
|
|
5
5
|
const toRadius = (value, round) => {
|
|
6
|
-
if (value === void 0) return round ?
|
|
6
|
+
if (value === void 0) return radiusVar(round ? "full" : "sm");
|
|
7
7
|
if (typeof value === "number") return `${value}px`;
|
|
8
|
-
return value
|
|
8
|
+
return RADIUS_NAMES.includes(value) ? radiusVar(value) : value;
|
|
9
9
|
};
|
|
10
10
|
const Skeleton = ({
|
|
11
11
|
width = "100%",
|
|
12
12
|
height = 14,
|
|
13
13
|
round = false,
|
|
14
|
-
radius
|
|
14
|
+
radius,
|
|
15
15
|
animate = true,
|
|
16
|
-
baseColor =
|
|
17
|
-
highlightColor =
|
|
16
|
+
baseColor = "var(--stokr-background-surface)",
|
|
17
|
+
highlightColor = "var(--stokr-border-subtle)",
|
|
18
18
|
className
|
|
19
19
|
}) => /* @__PURE__ */ jsx(
|
|
20
20
|
SkeletonBlock,
|
|
@@ -23,7 +23,7 @@ const Skeleton = ({
|
|
|
23
23
|
className,
|
|
24
24
|
$width: width,
|
|
25
25
|
$height: height,
|
|
26
|
-
$radius: toRadius(
|
|
26
|
+
$radius: toRadius(radius, round),
|
|
27
27
|
$animate: animate,
|
|
28
28
|
$baseColor: baseColor,
|
|
29
29
|
$highlightColor: highlightColor
|
|
@@ -17,8 +17,8 @@ const SmartLink = ({ to, children, ...rest }) => {
|
|
|
17
17
|
return /* @__PURE__ */ jsx(Link, { to, ...rest, children });
|
|
18
18
|
};
|
|
19
19
|
SmartLink.propTypes = {
|
|
20
|
-
to: PropTypes.string,
|
|
21
|
-
children: PropTypes.node
|
|
20
|
+
to: PropTypes.string.isRequired,
|
|
21
|
+
children: PropTypes.node.isRequired
|
|
22
22
|
};
|
|
23
23
|
export {
|
|
24
24
|
SmartLink,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type SnackbarVariant = 'info' | 'error' | 'success' | 'warning';
|
|
2
|
+
export type SnackbarPosition = 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center';
|
|
3
|
+
export declare const SnackbarContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
4
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
5
|
+
}, {
|
|
6
|
+
$isContained?: boolean;
|
|
7
|
+
$position?: SnackbarPosition;
|
|
8
|
+
}>> & string;
|
|
9
|
+
export declare const SnackbarWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
10
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
11
|
+
}, {
|
|
12
|
+
$variant?: SnackbarVariant;
|
|
13
|
+
$isExiting?: boolean;
|
|
14
|
+
$duration?: number;
|
|
15
|
+
$isPermanent?: boolean;
|
|
16
|
+
$hasClick?: boolean;
|
|
17
|
+
}>> & string;
|
|
18
|
+
export declare const IconWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
19
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
20
|
+
}, {
|
|
21
|
+
$variant?: SnackbarVariant;
|
|
22
|
+
}>> & string;
|
|
23
|
+
export declare const Message: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
24
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
25
|
+
}> & string;
|
|
26
|
+
export declare const CloseButton: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style"> & {
|
|
27
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
28
|
+
}> & string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import styled, { css, keyframes } from "styled-components";
|
|
2
|
-
import { colors } from "../../styles/colors.js";
|
|
3
2
|
const slideIn = keyframes`
|
|
4
3
|
from {
|
|
5
4
|
opacity: 0;
|
|
@@ -58,24 +57,8 @@ const progressExpire = keyframes`
|
|
|
58
57
|
width: 0%;
|
|
59
58
|
}
|
|
60
59
|
`;
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
borderColor: colors.blue,
|
|
64
|
-
iconColor: colors.blue
|
|
65
|
-
},
|
|
66
|
-
error: {
|
|
67
|
-
borderColor: colors.orangishRed,
|
|
68
|
-
iconColor: colors.orangishRed
|
|
69
|
-
},
|
|
70
|
-
success: {
|
|
71
|
-
borderColor: colors.progressAccentStart,
|
|
72
|
-
iconColor: colors.progressAccentStart
|
|
73
|
-
},
|
|
74
|
-
warning: {
|
|
75
|
-
borderColor: colors.warningOrange,
|
|
76
|
-
iconColor: colors.warningOrange
|
|
77
|
-
}
|
|
78
|
-
};
|
|
60
|
+
const SNACKBAR_VARIANTS = ["info", "error", "success", "warning"];
|
|
61
|
+
const statusIcon = (variant) => `var(--stokr-status-${variant && SNACKBAR_VARIANTS.includes(variant) ? variant : "info"}-icon)`;
|
|
79
62
|
const positionStyles = {
|
|
80
63
|
"top-right": css`
|
|
81
64
|
top: 20px;
|
|
@@ -132,11 +115,10 @@ const SnackbarWrapper = styled.div.withConfig({
|
|
|
132
115
|
min-width: 320px;
|
|
133
116
|
max-width: 480px;
|
|
134
117
|
padding: 12px 16px;
|
|
135
|
-
background-color:
|
|
118
|
+
background-color: var(--stokr-background-surface-raised);
|
|
136
119
|
box-shadow: 0 1px 2px -1px rgba(0, 0, 0, 0.12);
|
|
137
120
|
border-radius: 8px;
|
|
138
|
-
border: 1px solid
|
|
139
|
-
//border-bottom: 3px solid ${colors.grey};
|
|
121
|
+
border: 1px solid var(--stokr-border-subtle);
|
|
140
122
|
pointer-events: auto;
|
|
141
123
|
overflow: hidden;
|
|
142
124
|
animation: ${({ $isExiting }) => $isExiting ? slideOut : "none"} 0.3s ease-out forwards;
|
|
@@ -148,7 +130,7 @@ const SnackbarWrapper = styled.div.withConfig({
|
|
|
148
130
|
bottom: 0;
|
|
149
131
|
left: 0;
|
|
150
132
|
height: 3px;
|
|
151
|
-
background-color: ${({ $variant }) =>
|
|
133
|
+
background-color: ${({ $variant }) => statusIcon($variant)};
|
|
152
134
|
border-radius: 0 0 0 8px;
|
|
153
135
|
${({ $duration, $isPermanent }) => $isPermanent ? css`
|
|
154
136
|
width: 100%;
|
|
@@ -174,7 +156,7 @@ const IconWrapper = styled.div.withConfig({
|
|
|
174
156
|
justify-content: center;
|
|
175
157
|
width: 20px;
|
|
176
158
|
height: 20px;
|
|
177
|
-
color: ${({ $variant }) =>
|
|
159
|
+
color: ${({ $variant }) => statusIcon($variant)};
|
|
178
160
|
|
|
179
161
|
svg {
|
|
180
162
|
width: 100%;
|
|
@@ -187,7 +169,7 @@ const Message = styled.div`
|
|
|
187
169
|
font-weight: 600;
|
|
188
170
|
line-height: 24px;
|
|
189
171
|
letter-spacing: 0.6px;
|
|
190
|
-
color:
|
|
172
|
+
color: var(--stokr-text-primary);
|
|
191
173
|
`;
|
|
192
174
|
const CloseButton = styled.button`
|
|
193
175
|
flex-shrink: 0;
|
|
@@ -211,13 +193,13 @@ const CloseButton = styled.button`
|
|
|
211
193
|
height: 12px;
|
|
212
194
|
|
|
213
195
|
path {
|
|
214
|
-
stroke:
|
|
196
|
+
stroke: var(--stokr-text-tertiary);
|
|
215
197
|
stroke-width: 2;
|
|
216
198
|
}
|
|
217
199
|
}
|
|
218
200
|
|
|
219
201
|
&:hover svg path {
|
|
220
|
-
stroke:
|
|
202
|
+
stroke: var(--stokr-text-primary);
|
|
221
203
|
}
|
|
222
204
|
`;
|
|
223
205
|
export {
|
|
@@ -225,6 +207,5 @@ export {
|
|
|
225
207
|
IconWrapper,
|
|
226
208
|
Message,
|
|
227
209
|
SnackbarContainer,
|
|
228
|
-
SnackbarWrapper
|
|
229
|
-
variantStyles
|
|
210
|
+
SnackbarWrapper
|
|
230
211
|
};
|
|
@@ -2,7 +2,7 @@ import styled from "styled-components";
|
|
|
2
2
|
const SpanButton = styled.span.withConfig({
|
|
3
3
|
shouldForwardProp: (props) => !["urlLink"].includes(props)
|
|
4
4
|
})`
|
|
5
|
-
color:
|
|
5
|
+
color: var(--stokr-action-accent-bg);
|
|
6
6
|
cursor: pointer;
|
|
7
7
|
font-weight: 400;
|
|
8
8
|
|
|
@@ -11,7 +11,7 @@ const SpanButton = styled.span.withConfig({
|
|
|
11
11
|
`}
|
|
12
12
|
|
|
13
13
|
&:hover {
|
|
14
|
-
color:
|
|
14
|
+
color: var(--stokr-text-primary);
|
|
15
15
|
}
|
|
16
16
|
`;
|
|
17
17
|
export {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CSSProperties, HTMLAttributes, KeyboardEvent, MouseEvent, ReactNode } from 'react';
|
|
2
|
+
export type StatusDotVariant = 'pending' | 'initiated' | 'paid' | 'declined';
|
|
3
|
+
export interface StatusDotProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onClick' | 'color'> {
|
|
4
|
+
/** The label. */
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/** Kit status colours: pending → warning, initiated → info, paid → success, declined → error. */
|
|
7
|
+
variant?: StatusDotVariant;
|
|
8
|
+
/** Dot (and label) color; overrides the variant. */
|
|
9
|
+
color?: string;
|
|
10
|
+
/** Label color when it differs from the dot. */
|
|
11
|
+
labelColor?: string;
|
|
12
|
+
/** Background color on the `subtle` surface; overrides the variant. */
|
|
13
|
+
backgroundColor?: string;
|
|
14
|
+
/** `subtle` adds a tinted background and padding. */
|
|
15
|
+
surface?: 'transparent' | 'subtle';
|
|
16
|
+
/** Small bold uppercase label. */
|
|
17
|
+
uppercase?: boolean;
|
|
18
|
+
/** Dot diameter in px. */
|
|
19
|
+
dotSize?: number;
|
|
20
|
+
/** Animates the dot. */
|
|
21
|
+
pulse?: boolean;
|
|
22
|
+
className?: string;
|
|
23
|
+
style?: CSSProperties;
|
|
24
|
+
labelStyle?: CSSProperties;
|
|
25
|
+
/** Makes it a button (pointer, Enter/Space). */
|
|
26
|
+
onClick?: (event: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>) => void;
|
|
27
|
+
}
|
|
28
|
+
export declare const StatusDot: ({ children, variant, color, labelColor, backgroundColor, surface, uppercase, dotSize, pulse, className, style, labelStyle, onClick, ...rest }: StatusDotProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export default StatusDot;
|
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import { colors } from "../../styles/colors.js";
|
|
4
2
|
import { Root, Dot, Label } from "./StatusDot.styles.js";
|
|
5
|
-
const
|
|
6
|
-
pending:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
backgroundColor:
|
|
17
|
-
}
|
|
18
|
-
declined: {
|
|
19
|
-
color: colors.darkRed,
|
|
20
|
-
backgroundColor: "rgba(210, 32, 13, 0.08)"
|
|
21
|
-
}
|
|
3
|
+
const VARIANT_STATUS = {
|
|
4
|
+
pending: "warning",
|
|
5
|
+
initiated: "info",
|
|
6
|
+
paid: "success",
|
|
7
|
+
declined: "error"
|
|
8
|
+
};
|
|
9
|
+
const preset = (variant) => {
|
|
10
|
+
const status = VARIANT_STATUS[variant];
|
|
11
|
+
return {
|
|
12
|
+
color: `var(--stokr-status-${status}-icon)`,
|
|
13
|
+
labelColor: `var(--stokr-status-${status}-text)`,
|
|
14
|
+
backgroundColor: `var(--stokr-status-${status}-bg)`
|
|
15
|
+
};
|
|
22
16
|
};
|
|
23
17
|
const StatusDot = ({
|
|
24
18
|
children,
|
|
@@ -36,11 +30,11 @@ const StatusDot = ({
|
|
|
36
30
|
onClick,
|
|
37
31
|
...rest
|
|
38
32
|
}) => {
|
|
39
|
-
const
|
|
40
|
-
const resolvedColor = color ??
|
|
41
|
-
const resolvedLabelColor = labelColor ?? resolvedColor;
|
|
33
|
+
const colors = variant && VARIANT_STATUS[variant] ? preset(variant) : null;
|
|
34
|
+
const resolvedColor = color ?? colors?.color ?? "var(--stokr-text-primary)";
|
|
35
|
+
const resolvedLabelColor = labelColor ?? (color === void 0 ? colors?.labelColor : void 0) ?? resolvedColor;
|
|
42
36
|
const isSubtle = surface === "subtle";
|
|
43
|
-
const resolvedBackground = isSubtle && (backgroundColor !== void 0 ? backgroundColor :
|
|
37
|
+
const resolvedBackground = isSubtle && (backgroundColor !== void 0 ? backgroundColor : colors?.backgroundColor);
|
|
44
38
|
return /* @__PURE__ */ jsxs(
|
|
45
39
|
Root,
|
|
46
40
|
{
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const Root: 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
|
+
$subtle?: boolean;
|
|
5
|
+
$backgroundColor?: string | false;
|
|
6
|
+
$hasClick?: boolean;
|
|
7
|
+
}>> & string;
|
|
8
|
+
export declare const Dot: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
9
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
10
|
+
}, {
|
|
11
|
+
$size: number;
|
|
12
|
+
$color: string;
|
|
13
|
+
$pulse?: boolean;
|
|
14
|
+
}>> & string;
|
|
15
|
+
export declare const Label: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
16
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
17
|
+
}, {
|
|
18
|
+
$color: string;
|
|
19
|
+
$uppercase?: boolean;
|
|
20
|
+
}>> & string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CSSProperties, HTMLAttributes, MouseEventHandler, ReactNode } from 'react';
|
|
2
|
+
import { InfoIconProps } from '../InfoIcon/InfoIcon';
|
|
3
|
+
export type StatusTagVariant = 'pending' | 'initiated' | 'confirmed' | 'declined' | 'paid';
|
|
4
|
+
export interface StatusTagProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onClick'> {
|
|
5
|
+
/** Kit tag: icon plus the `tag-<variant>-bg` background and `tag-<variant>-text` label. */
|
|
6
|
+
variant?: StatusTagVariant;
|
|
7
|
+
/** Custom icon; wins over the variant's. */
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
/** The label. */
|
|
10
|
+
text: ReactNode;
|
|
11
|
+
/** Wraps the tag in an info tooltip with this text. */
|
|
12
|
+
tooltip?: InfoIconProps['title'];
|
|
13
|
+
/** Extra props for the tooltip's underlying `Tooltip`. */
|
|
14
|
+
tooltipProps?: InfoIconProps['tooltipProps'];
|
|
15
|
+
/** Icon color; overrides the label colour the icon follows by default. */
|
|
16
|
+
iconColor?: string;
|
|
17
|
+
/** Icon and label color on hover. */
|
|
18
|
+
hoverColor?: string;
|
|
19
|
+
/** Turns the hover color change off. */
|
|
20
|
+
disableHoverColor?: boolean;
|
|
21
|
+
/** Shows the hover color permanently. */
|
|
22
|
+
colorActive?: boolean;
|
|
23
|
+
/** CSS min-width of the tag, e.g. `120px`. */
|
|
24
|
+
minWidth?: string;
|
|
25
|
+
className?: string;
|
|
26
|
+
containerStyle?: CSSProperties;
|
|
27
|
+
iconStyle?: CSSProperties;
|
|
28
|
+
textStyle?: CSSProperties;
|
|
29
|
+
/** Makes the tag clickable (pointer cursor, hover fade). */
|
|
30
|
+
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
31
|
+
/** Centers the content inside `minWidth`. */
|
|
32
|
+
center?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare const StatusTag: ({ variant, icon, text, tooltip, tooltipProps, iconColor, hoverColor, disableHoverColor, colorActive, minWidth, className, containerStyle, iconStyle, textStyle, onClick, center, ...props }: StatusTagProps) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export default StatusTag;
|
|
@@ -1,46 +1,17 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
2
|
import { InfoIcon } from "../InfoIcon/InfoIcon.js";
|
|
4
3
|
import { MaterialIcon } from "../MaterialIcon/MaterialIcon.js";
|
|
5
4
|
import SvgTransferIcon from "../../static/images/transfer-icon.svg.js";
|
|
6
5
|
import SvgCheckmarkCircleIcon from "../../static/images/checkmark-circle-icon.svg.js";
|
|
7
6
|
import SvgCloseCircleIcon from "../../static/images/close-circle-icon.svg.js";
|
|
8
7
|
import SvgAddFolderIcon from "../../static/images/add-folder-icon.svg.js";
|
|
9
|
-
import { colors } from "../../styles/colors.js";
|
|
10
8
|
import { StatusTagContainer, StatusTagWrapper, IconWrapper, StatusText } from "./StatusTag.styles.js";
|
|
11
9
|
const variantConfig = {
|
|
12
|
-
pending: {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
useStroke: true
|
|
18
|
-
},
|
|
19
|
-
initiated: {
|
|
20
|
-
icon: /* @__PURE__ */ jsx(MaterialIcon, { name: "search_activity", size: 14 }),
|
|
21
|
-
iconColor: "#032F78",
|
|
22
|
-
hoverColor: "#032F78",
|
|
23
|
-
disableHoverColor: false
|
|
24
|
-
},
|
|
25
|
-
confirmed: {
|
|
26
|
-
icon: /* @__PURE__ */ jsx(SvgCheckmarkCircleIcon, { width: 12, height: 12 }),
|
|
27
|
-
iconColor: colors.grey2,
|
|
28
|
-
hoverColor: colors.blue,
|
|
29
|
-
disableHoverColor: false
|
|
30
|
-
},
|
|
31
|
-
declined: {
|
|
32
|
-
icon: /* @__PURE__ */ jsx(SvgCloseCircleIcon, { width: 12, height: 12 }),
|
|
33
|
-
iconColor: colors.darkRed,
|
|
34
|
-
hoverColor: colors.darkRed,
|
|
35
|
-
disableHoverColor: false,
|
|
36
|
-
useStroke: true
|
|
37
|
-
},
|
|
38
|
-
paid: {
|
|
39
|
-
icon: /* @__PURE__ */ jsx(SvgTransferIcon, { width: 14, height: 14 }),
|
|
40
|
-
iconColor: "#3D9626",
|
|
41
|
-
hoverColor: "#3D9626",
|
|
42
|
-
disableHoverColor: false
|
|
43
|
-
}
|
|
10
|
+
pending: { icon: /* @__PURE__ */ jsx(SvgAddFolderIcon, { width: 12, height: 12 }), useStroke: true },
|
|
11
|
+
initiated: { icon: /* @__PURE__ */ jsx(MaterialIcon, { name: "search_activity", size: "xs" }) },
|
|
12
|
+
confirmed: { icon: /* @__PURE__ */ jsx(SvgCheckmarkCircleIcon, { width: 12, height: 12 }) },
|
|
13
|
+
declined: { icon: /* @__PURE__ */ jsx(SvgCloseCircleIcon, { width: 12, height: 12 }), useStroke: true },
|
|
14
|
+
paid: { icon: /* @__PURE__ */ jsx(SvgTransferIcon, { width: 14, height: 14 }) }
|
|
44
15
|
};
|
|
45
16
|
const StatusTag = ({
|
|
46
17
|
variant,
|
|
@@ -62,16 +33,16 @@ const StatusTag = ({
|
|
|
62
33
|
...props
|
|
63
34
|
}) => {
|
|
64
35
|
const variantData = variant ? variantConfig[variant] : null;
|
|
65
|
-
const finalIconColor = iconColor
|
|
66
|
-
const finalHoverColor = hoverColor
|
|
67
|
-
const finalDisableHoverColor = disableHoverColor
|
|
36
|
+
const finalIconColor = iconColor ?? (variantData ? "currentColor" : "var(--stokr-text-tertiary)");
|
|
37
|
+
const finalHoverColor = hoverColor;
|
|
38
|
+
const finalDisableHoverColor = disableHoverColor ?? false;
|
|
68
39
|
let finalIcon = null;
|
|
69
40
|
if (icon) {
|
|
70
41
|
finalIcon = icon;
|
|
71
42
|
} else if (variantData?.icon) {
|
|
72
43
|
finalIcon = variantData.icon;
|
|
73
44
|
}
|
|
74
|
-
const content = /* @__PURE__ */ jsx(StatusTagContainer, { className, style: containerStyle, onClick, hasClick: !!onClick, ...props, children: /* @__PURE__ */ jsxs(StatusTagWrapper, { minWidth, center, children: [
|
|
45
|
+
const content = /* @__PURE__ */ jsx(StatusTagContainer, { className, style: containerStyle, onClick, hasClick: !!onClick, ...props, children: /* @__PURE__ */ jsxs(StatusTagWrapper, { minWidth, center, $variant: variantData ? variant : void 0, children: [
|
|
75
46
|
finalIcon && /* @__PURE__ */ jsx(
|
|
76
47
|
IconWrapper,
|
|
77
48
|
{
|