@stokr/components-library 5.0.0 → 5.0.2
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 +8 -8
- package/dist/components/AddressItem/AddressItem.d.ts +38 -0
- package/dist/components/AddressItem/AddressItem.js +51 -0
- package/dist/components/AddressItem/AddressItem.styles.d.ts +31 -0
- package/dist/components/AddressItem/AddressItem.styles.js +71 -0
- package/dist/components/AdminDashboard/Table/Table.styles.js +18 -25
- package/dist/components/AgreementItem/AgreementItem.styles.js +1 -1
- package/dist/components/BackButton/BackButton.styles.js +15 -15
- package/dist/components/BasicTable/BasicTable.styles.js +6 -8
- package/dist/components/BlogPost/BlogPost.styles.js +9 -13
- package/dist/components/Button/Button.styles.d.ts +1 -1
- package/dist/components/Button/Button.styles.js +122 -11
- package/dist/components/Button/GlareButton.js +1 -1
- package/dist/components/Card/Card.styles.js +3 -4
- package/dist/components/CardTabs/CardTabs.styles.js +17 -17
- package/dist/components/ChartLegend/ChartLegend.styles.js +6 -7
- package/dist/components/Checkbox/Checkbox.styles.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.styles.js +10 -11
- package/dist/components/Checklist/ChecklistCard.js +3 -3
- package/dist/components/Checklist/ChecklistCard.styles.js +7 -20
- package/dist/components/Chips/Chip.js +2 -2
- package/dist/components/Chips/Chip.styles.js +6 -10
- package/dist/components/Collapsible/Collapsible.d.ts +10 -4
- package/dist/components/Collapsible/Collapsible.js +6 -14
- package/dist/components/Collapsible/Collapsible.styles.d.ts +3 -1
- package/dist/components/Collapsible/Collapsible.styles.js +33 -16
- package/dist/components/ComponentScroll/ComponentScroll.styles.js +5 -5
- package/dist/components/ComponentWrapper/ComponentWrapper.styles.js +5 -5
- package/dist/components/ConfirmModal/ConfirmModal.styles.js +2 -2
- package/dist/components/Country/CountrySelect.js +15 -20
- package/dist/components/Country/FlagFor.d.ts +9 -0
- package/dist/components/Country/FlagFor.js +25 -0
- package/dist/components/Country/flagLoaders.d.ts +5 -0
- package/dist/components/Country/flagLoaders.js +270 -0
- package/dist/components/Country/flagStore.d.ts +6 -0
- package/dist/components/Country/flagStore.js +29 -0
- package/dist/components/CryptoAddress/CryptoAddress.d.ts +6 -2
- package/dist/components/CryptoAddress/CryptoAddress.js +2 -2
- package/dist/components/CryptoAddress/CryptoAddress.styles.d.ts +2 -1
- package/dist/components/CryptoAddress/CryptoAddress.styles.js +20 -27
- package/dist/components/CryptoAddressWrapper/CryptoAddressWrapper.styles.js +2 -2
- package/dist/components/FAQ/FAQ.d.ts +29 -0
- package/dist/components/FAQ/FAQ.js +18 -18
- package/dist/components/FAQ/FAQ.styles.d.ts +11 -3
- package/dist/components/FAQ/FAQ.styles.js +59 -10
- package/dist/components/Form/Form.styles.js +5 -5
- package/dist/components/Grid/Grid.styles.js +7 -7
- package/dist/components/IdentityInfo/IdentityInfo.js +2 -1
- package/dist/components/IdentityInfo/IdentityInfo.styles.js +13 -23
- package/dist/components/InfoBox/InfoBox.d.ts +15 -13
- package/dist/components/InfoBox/InfoBox.js +31 -14
- package/dist/components/InfoIcon/InfoIcon.styles.js +2 -2
- package/dist/components/Input/DatePickerInput.styles.js +23 -24
- package/dist/components/Input/Input.d.ts +3 -0
- package/dist/components/Input/Input.js +5 -2
- package/dist/components/Input/Input.styles.d.ts +4 -0
- package/dist/components/Input/Input.styles.js +77 -27
- package/dist/components/Input/InputPassword.styles.js +11 -11
- package/dist/components/Input/InputWithButton.styles.js +5 -5
- package/dist/components/Input/MultiSelect.js +17 -17
- package/dist/components/Input/OtpInput.js +1 -1
- package/dist/components/Input/RangeInput.js +2 -2
- package/dist/components/Input/SearchInput.styles.js +10 -10
- package/dist/components/Input/Select.d.ts +57 -0
- package/dist/components/Input/Select.js +101 -106
- package/dist/components/Input/Select.styles.d.ts +89 -0
- package/dist/components/Input/Select.styles.js +115 -19
- package/dist/components/Input/TableFilterDropdown.js +5 -5
- package/dist/components/Input/Textarea.styles.js +11 -13
- package/dist/components/MaterialIcon/requiredIcons.d.ts +1 -1
- package/dist/components/MaterialIcon/requiredIcons.js +2 -0
- package/dist/components/MenuNav/MenuNav.styles.js +2 -5
- package/dist/components/Modal/Modal.styles.js +25 -31
- package/dist/components/Modal/PaymentModal.js +7 -7
- package/dist/components/Modal/SideModal.styles.js +8 -8
- package/dist/components/Modal/SideModalParts.js +15 -16
- package/dist/components/Modal/SuccessModal/SuccessModal.styles.js +5 -8
- package/dist/components/NotificationCounter/NotificationCounter.styles.js +2 -2
- package/dist/components/Number/Number.js +1 -1
- package/dist/components/Number/Number.styles.js +2 -2
- package/dist/components/Pagination/Pagination.styles.js +7 -7
- package/dist/components/PanelCard/PanelCard.d.ts +51 -0
- package/dist/components/PanelCard/PanelCard.js +35 -0
- package/dist/components/PanelCard/PanelCard.styles.d.ts +29 -0
- package/dist/components/PanelCard/PanelCard.styles.js +84 -0
- package/dist/components/Payment/DetailRows.js +1 -1
- package/dist/components/Payment/DetailsToggle.js +4 -6
- package/dist/components/Payment/PaymentDetailsCard.js +29 -53
- package/dist/components/Payment/PaymentDisplay.js +12 -20
- package/dist/components/Payment/PaymentPendingCard.d.ts +1 -1
- package/dist/components/Payment/PaymentPendingCard.js +10 -13
- package/dist/components/Payment/PaymentSuccessCard.js +6 -9
- package/dist/components/Payment/TimerComponent.js +5 -4
- package/dist/components/Process/Process.styles.js +7 -13
- package/dist/components/ProfileBadge/ProfileBadge.styles.js +8 -10
- package/dist/components/ProfileBox/ProfileBox.styles.js +5 -7
- package/dist/components/Radio/Radio.styles.d.ts +1 -0
- package/dist/components/Radio/Radio.styles.js +8 -9
- package/dist/components/RefreshButton/RefreshButton.styles.js +5 -5
- package/dist/components/RequestDataBox/RequestDataBox.styles.js +3 -5
- package/dist/components/Section/Section.styles.js +16 -18
- package/dist/components/SectionTitle/SectionTitle.styles.d.ts +4 -0
- package/dist/components/SectionTitle/SectionTitle.styles.js +4 -7
- package/dist/components/Skeleton/Skeleton.d.ts +1 -1
- package/dist/components/Skeleton/Skeleton.js +3 -3
- package/dist/components/Snackbar/Snackbar.styles.js +8 -10
- package/dist/components/SpanButton/SpanButton.styles.js +2 -2
- package/dist/components/StatusDot/StatusDot.d.ts +1 -1
- package/dist/components/StatusDot/StatusDot.js +5 -5
- package/dist/components/StatusDot/StatusDot.styles.js +2 -5
- package/dist/components/StatusTag/StatusTag.js +1 -1
- package/dist/components/StatusTag/StatusTag.styles.js +4 -4
- package/dist/components/StepController/StepController.styles.js +7 -7
- package/dist/components/StepSidebar/MobileStepProgress.d.ts +12 -0
- package/dist/components/StepSidebar/MobileStepProgress.js +14 -0
- package/dist/components/StepSidebar/MobileStepProgress.styles.d.ts +15 -0
- package/dist/components/StepSidebar/MobileStepProgress.styles.js +39 -0
- package/dist/components/StepSidebar/StepProgress.d.ts +14 -0
- package/dist/components/StepSidebar/StepProgress.js +14 -0
- package/dist/components/StepSidebar/StepProgress.styles.d.ts +30 -0
- package/dist/components/StepSidebar/StepProgress.styles.js +97 -0
- package/dist/components/StepSidebar/StepSidebar.d.ts +36 -0
- package/dist/components/StepSidebar/StepSidebar.js +58 -0
- package/dist/components/StepSidebar/StepSidebar.styles.d.ts +55 -0
- package/dist/components/StepSidebar/StepSidebar.styles.js +168 -0
- package/dist/components/StokrLoader/StokrLoader.d.ts +16 -2
- package/dist/components/StokrLoader/StokrLoader.js +170 -28
- package/dist/components/StokrLoader/loaderSession.d.ts +14 -0
- package/dist/components/StokrLoader/loaderSession.js +30 -0
- package/dist/components/Switch/Switch.styles.js +12 -14
- package/dist/components/TabsNav/TabsNav.styles.js +7 -9
- package/dist/components/TaxResidenceCard/TaxResidenceCard.js +26 -11
- package/dist/components/TaxResidenceCard/TaxResidenceCard.styles.d.ts +29 -12
- package/dist/components/TaxResidenceCard/TaxResidenceCard.styles.js +103 -30
- package/dist/components/Text/Text.styles.d.ts +2 -1
- package/dist/components/Text/Text.styles.js +36 -70
- package/dist/components/TextLink/TextLink.styles.js +5 -7
- package/dist/components/Timeline/Timeline.styles.js +17 -23
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -2
- package/dist/components/Tooltip/Tooltip.styles.js +4 -5
- package/dist/components/breakdown/Breakdown.js +3 -5
- package/dist/components/logo/Logo.js +1 -1
- package/dist/constants/chainLogos.d.ts +9 -0
- package/dist/constants/chainLogos.js +17 -0
- package/dist/design-system/css/base.css +14 -14
- package/dist/design-system/css-builders.d.ts +25 -0
- package/dist/design-system/css-builders.js +81 -0
- package/dist/design-system/generated/fonts.css +0 -49
- package/dist/design-system/generated/text-classes.css +123 -123
- package/dist/design-system/generated/text-styles.d.ts +24 -24
- package/dist/design-system/generated/text-styles.js +123 -123
- package/dist/design-system/generated/tokens.css +417 -412
- package/dist/design-system/index.d.ts +2 -1
- package/dist/design-system/styled/build-theme.js +1 -1
- package/dist/design-system/tokens/colors.d.ts +1 -1
- package/dist/design-system/tokens/colors.js +1 -1
- package/dist/design-system/tokens/fonts.d.ts +6 -2
- package/dist/design-system/tokens/fonts.js +1 -1
- package/dist/design-system/tokens/semantic.d.ts +15 -3
- package/dist/design-system/tokens/semantic.js +5 -1
- package/dist/design-system/tokens/typography.d.ts +1 -1
- package/dist/design-system/tokens/typography.js +64 -41
- package/dist/index.d.ts +84 -7
- package/dist/index.js +24 -4
- package/dist/static/images/chains/avalanche.svg +7 -0
- package/dist/static/images/chains/avalanche.svg.js +4 -0
- package/dist/static/images/chains/ethereum.svg +14 -0
- package/dist/static/images/chains/ethereum.svg.js +4 -0
- package/dist/static/images/chains/liquid.svg +7 -0
- package/dist/static/images/chains/liquid.svg.js +4 -0
- package/dist/static/images/chains/solana.svg +29 -0
- package/dist/static/images/chains/solana.svg.js +4 -0
- package/dist/static/images/chains/stellar.svg +17 -0
- package/dist/static/images/chains/stellar.svg.js +4 -0
- package/dist/static/images/chains/tempo.svg +11 -0
- package/dist/static/images/chains/tempo.svg.js +4 -0
- package/dist/styles/borderedField.d.ts +11 -0
- package/dist/styles/borderedField.js +53 -0
- package/package.json +1 -1
- package/dist/static/images/globe.svg.js +0 -5
- package/dist/static/images/trash.svg +0 -17
- package/dist/static/images/trash.svg.js +0 -5
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/** The kit's statuses; each maps to its `--
|
|
3
|
-
export type InfoBoxVariant = 'warning' | 'info' | 'error' | 'success';
|
|
4
|
-
export interface InfoBoxProps {
|
|
5
|
-
/** Kit status: sets the background, left bar, icon and text colours. */
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
/** The kit's statuses; each maps to its `--status-<variant>-*` tokens. `info-blue` is the blue banner (no border). */
|
|
3
|
+
export type InfoBoxVariant = 'warning' | 'info' | 'info-blue' | 'error' | 'success';
|
|
4
|
+
export interface InfoBoxProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
5
|
+
/** Kit status: sets the background, left bar, icon and text colours. `success` is the Figma done state. */
|
|
6
6
|
variant?: InfoBoxVariant;
|
|
7
|
+
/** Optional bold first line above `children`. */
|
|
8
|
+
title?: ReactNode;
|
|
7
9
|
/** Content to display (supports mixed bold/normal text via JSX). */
|
|
8
10
|
children?: ReactNode;
|
|
9
|
-
/** Custom icon node;
|
|
11
|
+
/** Custom icon node; replaces the variant's default icon. */
|
|
10
12
|
icon?: ReactNode;
|
|
11
|
-
/**
|
|
12
|
-
style?: CSSProperties;
|
|
13
|
-
/** Optional className for the container. */
|
|
14
|
-
className?: string;
|
|
15
|
-
/** Hides the coloured bar on the left edge. */
|
|
13
|
+
/** Hides the coloured bar on the left edge (`success` never has one). */
|
|
16
14
|
noLeftBorder?: boolean;
|
|
17
15
|
}
|
|
18
|
-
/**
|
|
19
|
-
|
|
16
|
+
/**
|
|
17
|
+
* InfoBox - A flexible alert/info banner with variant support. Other props (`className`, `style`, `data-*`…) go to the
|
|
18
|
+
* container. CSS custom properties: `--info-box-padding`, `--info-box-gap`, `--info-box-background`,
|
|
19
|
+
* `--info-box-radius`, `--info-box-icon-color` (success icon).
|
|
20
|
+
*/
|
|
21
|
+
export declare const InfoBox: ({ variant, title, children, icon, noLeftBorder, ...rest }: InfoBoxProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
22
|
export default InfoBox;
|
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import { glyph } from "../MaterialIcon/glyph.js";
|
|
4
|
-
|
|
4
|
+
import { MaterialIcon } from "../MaterialIcon/MaterialIcon.js";
|
|
5
|
+
const VARIANTS = ["warning", "info", "info-blue", "error", "success"];
|
|
6
|
+
const status = (variant, part) => `var(--status-${variant}-${part})`;
|
|
7
|
+
const BANNER = { padding: "12px 20px 12px 16px", gap: "12px", align: "center", leftBorder: true };
|
|
8
|
+
const INFO_BLUE = { ...BANNER, leftBorder: false };
|
|
9
|
+
const SUCCESS = { padding: "12px", gap: "8px", align: "flex-start", leftBorder: false };
|
|
5
10
|
const Container = styled.div`
|
|
6
11
|
position: relative;
|
|
7
12
|
display: flex;
|
|
8
13
|
overflow: hidden;
|
|
9
|
-
align-items:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
border-radius: 8px;
|
|
14
|
+
align-items: ${(props) => props.$layout.align};
|
|
15
|
+
gap: var(--info-box-gap, ${(props) => props.$layout.gap});
|
|
16
|
+
padding: var(--info-box-padding, ${(props) => props.$layout.padding});
|
|
17
|
+
background: var(--info-box-background, ${(props) => status(props.$variant, "bg")});
|
|
18
|
+
border-radius: var(--info-box-radius, 8px);
|
|
15
19
|
font-size: 12px;
|
|
16
20
|
line-height: 18px;
|
|
17
21
|
letter-spacing: 0.6px;
|
|
18
22
|
font-weight: 400;
|
|
19
23
|
color: ${(props) => status(props.$variant, "text")};
|
|
20
24
|
|
|
21
|
-
${(props) =>
|
|
25
|
+
${(props) => props.$leftBorder && `
|
|
22
26
|
&:before {
|
|
23
27
|
content: '';
|
|
24
28
|
display: block;
|
|
@@ -40,6 +44,11 @@ const DefaultIcon = styled.span.attrs({
|
|
|
40
44
|
color: ${(props) => status(props.$variant, "icon")};
|
|
41
45
|
margin-top: 1px;
|
|
42
46
|
`;
|
|
47
|
+
const SuccessIcon = styled.span`
|
|
48
|
+
display: inline-flex;
|
|
49
|
+
flex-shrink: 0;
|
|
50
|
+
color: var(--info-box-icon-color, ${status("success", "icon")});
|
|
51
|
+
`;
|
|
43
52
|
const CustomIconWrapper = styled.span`
|
|
44
53
|
flex-shrink: 0;
|
|
45
54
|
display: flex;
|
|
@@ -51,17 +60,25 @@ const Content = styled.div`
|
|
|
51
60
|
flex: 1;
|
|
52
61
|
min-width: 0;
|
|
53
62
|
`;
|
|
54
|
-
const
|
|
55
|
-
|
|
63
|
+
const Title = styled.div`
|
|
64
|
+
font-weight: 600;
|
|
65
|
+
`;
|
|
66
|
+
const InfoBox = ({ variant = "warning", title, children, icon, noLeftBorder, ...rest }) => {
|
|
67
|
+
const resolved = VARIANTS.includes(variant) ? variant : "warning";
|
|
68
|
+
const layout = resolved === "success" ? SUCCESS : resolved === "info-blue" ? INFO_BLUE : BANNER;
|
|
56
69
|
const renderIcon = () => {
|
|
57
|
-
if (icon) {
|
|
58
|
-
|
|
70
|
+
if (icon) return /* @__PURE__ */ jsx(CustomIconWrapper, { children: icon });
|
|
71
|
+
if (resolved === "success") {
|
|
72
|
+
return /* @__PURE__ */ jsx(SuccessIcon, { children: /* @__PURE__ */ jsx(MaterialIcon, { name: "check", weight: 600, size: 20 }) });
|
|
59
73
|
}
|
|
60
74
|
return /* @__PURE__ */ jsx(DefaultIcon, { $variant: resolved });
|
|
61
75
|
};
|
|
62
|
-
return /* @__PURE__ */ jsxs(Container, { $variant: resolved, $
|
|
76
|
+
return /* @__PURE__ */ jsxs(Container, { ...rest, $variant: resolved, $layout: layout, $leftBorder: layout.leftBorder && !noLeftBorder, children: [
|
|
63
77
|
renderIcon(),
|
|
64
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ jsxs(Content, { children: [
|
|
79
|
+
title != null && /* @__PURE__ */ jsx(Title, { children: title }),
|
|
80
|
+
children
|
|
81
|
+
] })
|
|
65
82
|
] });
|
|
66
83
|
};
|
|
67
84
|
export {
|
|
@@ -34,11 +34,11 @@ const Icon = styled.span.withConfig({
|
|
|
34
34
|
vertical-align: middle;
|
|
35
35
|
font-size: 16px;
|
|
36
36
|
line-height: 16px;
|
|
37
|
-
color: var(--
|
|
37
|
+
color: var(--text-tertiary);
|
|
38
38
|
transition: color 0.2s;
|
|
39
39
|
|
|
40
40
|
&:hover {
|
|
41
|
-
color: var(--
|
|
41
|
+
color: var(--action-accent-bg);
|
|
42
42
|
}
|
|
43
43
|
`;
|
|
44
44
|
export {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
|
+
import { text } from "../../design-system/styled/text.js";
|
|
2
3
|
const InputWrapper = styled.div`
|
|
3
4
|
position: relative;
|
|
4
5
|
display: flex;
|
|
@@ -16,14 +17,14 @@ const ClearButton = styled.button.withConfig({
|
|
|
16
17
|
cursor: pointer;
|
|
17
18
|
padding: 4px 8px;
|
|
18
19
|
font-size: 16px;
|
|
19
|
-
color: var(--
|
|
20
|
+
color: var(--text-tertiary);
|
|
20
21
|
line-height: 1;
|
|
21
22
|
display: flex;
|
|
22
23
|
align-items: center;
|
|
23
24
|
justify-content: center;
|
|
24
25
|
|
|
25
26
|
&:hover {
|
|
26
|
-
color: var(--
|
|
27
|
+
color: var(--text-primary);
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
${(props) => props.dashboard && css`
|
|
@@ -35,7 +36,7 @@ const ClearButton = styled.button.withConfig({
|
|
|
35
36
|
const DateInput = styled.input.withConfig({
|
|
36
37
|
shouldForwardProp: (props) => !["dashboard", "hasLabel"].includes(props)
|
|
37
38
|
})`
|
|
38
|
-
font-family: var(--
|
|
39
|
+
font-family: var(--font-family-base);
|
|
39
40
|
display: block;
|
|
40
41
|
width: 100%;
|
|
41
42
|
height: 40px;
|
|
@@ -49,8 +50,8 @@ const DateInput = styled.input.withConfig({
|
|
|
49
50
|
outline: 0;
|
|
50
51
|
border: 0;
|
|
51
52
|
border-top: 1px solid transparent;
|
|
52
|
-
border-bottom: 1px solid var(--
|
|
53
|
-
color: var(--
|
|
53
|
+
border-bottom: 1px solid var(--border-subtle);
|
|
54
|
+
color: var(--text-primary);
|
|
54
55
|
background-color: transparent;
|
|
55
56
|
transition: border-color 0.2s;
|
|
56
57
|
|
|
@@ -58,7 +59,7 @@ const DateInput = styled.input.withConfig({
|
|
|
58
59
|
&:hover {
|
|
59
60
|
box-shadow: none;
|
|
60
61
|
border-top-color: transparent;
|
|
61
|
-
border-bottom-color: var(--
|
|
62
|
+
border-bottom-color: var(--border-focus);
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
&::placeholder {
|
|
@@ -70,16 +71,16 @@ const DateInput = styled.input.withConfig({
|
|
|
70
71
|
border: 0;
|
|
71
72
|
padding: 0;
|
|
72
73
|
height: 22px;
|
|
73
|
-
font-family: var(--
|
|
74
|
+
font-family: var(--font-family-base);
|
|
74
75
|
font-weight: 300;
|
|
75
76
|
font-size: 14px;
|
|
76
77
|
line-height: 22px;
|
|
77
78
|
letter-spacing: 0.53px;
|
|
78
79
|
text-transform: normal;
|
|
79
|
-
color: var(--
|
|
80
|
+
color: var(--text-primary);
|
|
80
81
|
|
|
81
82
|
&::placeholder {
|
|
82
|
-
color: var(--
|
|
83
|
+
color: var(--text-tertiary);
|
|
83
84
|
opacity: 1;
|
|
84
85
|
}
|
|
85
86
|
|
|
@@ -95,7 +96,7 @@ const DatePickerOverlay = styled.div`
|
|
|
95
96
|
.rdp {
|
|
96
97
|
position: absolute;
|
|
97
98
|
z-index: 20;
|
|
98
|
-
background-color: var(--
|
|
99
|
+
background-color: var(--background-surface-raised);
|
|
99
100
|
margin: 0;
|
|
100
101
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
101
102
|
padding: 12px;
|
|
@@ -103,13 +104,13 @@ const DatePickerOverlay = styled.div`
|
|
|
103
104
|
min-width: fit-content;
|
|
104
105
|
|
|
105
106
|
/* v9 CSS Variables */
|
|
106
|
-
--rdp-accent-color: var(--
|
|
107
|
-
--rdp-accent-background-color: var(--
|
|
107
|
+
--rdp-accent-color: var(--action-accent-bg);
|
|
108
|
+
--rdp-accent-background-color: var(--action-accent-bg);
|
|
108
109
|
--rdp-day-height: 32px;
|
|
109
110
|
--rdp-day-width: 32px;
|
|
110
|
-
--rdp-selected-font: 600 13px var(--
|
|
111
|
-
--rdp-weekday-font: 600 11px var(--
|
|
112
|
-
--rdp-font-family: var(--
|
|
111
|
+
--rdp-selected-font: 600 13px var(--font-family-base);
|
|
112
|
+
--rdp-weekday-font: 600 11px var(--font-family-base);
|
|
113
|
+
--rdp-font-family: var(--font-family-base);
|
|
113
114
|
|
|
114
115
|
/* Remove outline on selected */
|
|
115
116
|
--rdp-selected-border: none;
|
|
@@ -125,8 +126,8 @@ const DatePickerOverlay = styled.div`
|
|
|
125
126
|
/* Selected day - filled blue circle */
|
|
126
127
|
.rdp-selected .rdp-day_button,
|
|
127
128
|
.rdp-day_button[aria-selected='true'] {
|
|
128
|
-
background-color: var(--
|
|
129
|
-
color: var(--
|
|
129
|
+
background-color: var(--action-accent-bg) !important;
|
|
130
|
+
color: var(--action-accent-text) !important;
|
|
130
131
|
border: none !important;
|
|
131
132
|
outline: none !important;
|
|
132
133
|
}
|
|
@@ -134,15 +135,13 @@ const DatePickerOverlay = styled.div`
|
|
|
134
135
|
/* Today's date */
|
|
135
136
|
.rdp-today:not(.rdp-selected) .rdp-day_button {
|
|
136
137
|
font-weight: 700;
|
|
137
|
-
color: var(--
|
|
138
|
+
color: var(--action-accent-bg);
|
|
138
139
|
}
|
|
139
140
|
|
|
140
141
|
/* Weekday headers - uppercase */
|
|
141
142
|
.rdp-weekday {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
text-transform: uppercase;
|
|
145
|
-
color: var(--stokr-text-primary);
|
|
143
|
+
${text("label")}
|
|
144
|
+
color: var(--text-primary);
|
|
146
145
|
}
|
|
147
146
|
|
|
148
147
|
/* Month caption */
|
|
@@ -152,10 +151,10 @@ const DatePickerOverlay = styled.div`
|
|
|
152
151
|
|
|
153
152
|
/* Navigation buttons */
|
|
154
153
|
.rdp-chevron {
|
|
155
|
-
fill: var(--
|
|
154
|
+
fill: var(--text-tertiary);
|
|
156
155
|
|
|
157
156
|
&:hover {
|
|
158
|
-
fill: var(--
|
|
157
|
+
fill: var(--text-primary);
|
|
159
158
|
background: transparent;
|
|
160
159
|
}
|
|
161
160
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CSSProperties, InputHTMLAttributes } from 'react';
|
|
2
2
|
import { Wrapper, Label, InputWrap } from './Input.styles';
|
|
3
|
+
import { FieldVariant } from '../../styles/borderedField';
|
|
3
4
|
export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value'> {
|
|
4
5
|
id: string;
|
|
5
6
|
name?: string;
|
|
@@ -17,6 +18,8 @@ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
|
|
|
17
18
|
autoHeightLabel?: boolean;
|
|
18
19
|
inputWrapStyle?: CSSProperties;
|
|
19
20
|
wrapperStyle?: CSSProperties;
|
|
21
|
+
/** `bordered`: boxed field with a static label above (sign-up redesign). Default keeps the floating-label look. */
|
|
22
|
+
variant?: FieldVariant;
|
|
20
23
|
}
|
|
21
24
|
/** Text input with a floating label, built for Formik (`onChange`/`onBlur` receive the event). */
|
|
22
25
|
declare const Input: (props: InputProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -18,6 +18,7 @@ const Input = (props) => {
|
|
|
18
18
|
inputWrapStyle,
|
|
19
19
|
wrapperStyle,
|
|
20
20
|
autoHeightLabel,
|
|
21
|
+
variant = "default",
|
|
21
22
|
// Destructure these so they don't get spread to the input
|
|
22
23
|
onChange: onChangeProp,
|
|
23
24
|
onBlur: onBlurProp,
|
|
@@ -49,7 +50,7 @@ const Input = (props) => {
|
|
|
49
50
|
onFocusProp?.(e);
|
|
50
51
|
checkLabel(true);
|
|
51
52
|
};
|
|
52
|
-
return /* @__PURE__ */ jsxs(Wrapper, { inverted, style: wrapperStyle, children: [
|
|
53
|
+
return /* @__PURE__ */ jsxs(Wrapper, { inverted, style: wrapperStyle, $variant: variant, children: [
|
|
53
54
|
label && /* @__PURE__ */ jsx(
|
|
54
55
|
Label,
|
|
55
56
|
{
|
|
@@ -58,6 +59,7 @@ const Input = (props) => {
|
|
|
58
59
|
error: Boolean(error && touched),
|
|
59
60
|
htmlFor: id,
|
|
60
61
|
autoHeightLabel,
|
|
62
|
+
$variant: variant,
|
|
61
63
|
children: label
|
|
62
64
|
}
|
|
63
65
|
),
|
|
@@ -70,6 +72,7 @@ const Input = (props) => {
|
|
|
70
72
|
disabled,
|
|
71
73
|
style: inputWrapStyle,
|
|
72
74
|
autoHeightLabel,
|
|
75
|
+
$variant: variant,
|
|
73
76
|
children: /* @__PURE__ */ jsx(
|
|
74
77
|
"input",
|
|
75
78
|
{
|
|
@@ -83,7 +86,7 @@ const Input = (props) => {
|
|
|
83
86
|
readOnly,
|
|
84
87
|
placeholder,
|
|
85
88
|
disabled,
|
|
86
|
-
style: { WebkitAppearance: "none", WebkitBorderRadius: 0 },
|
|
89
|
+
style: variant === "bordered" ? { WebkitAppearance: "none" } : { WebkitAppearance: "none", WebkitBorderRadius: 0 },
|
|
87
90
|
...restProps
|
|
88
91
|
}
|
|
89
92
|
)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FieldVariant } from '../../styles/borderedField';
|
|
1
2
|
export declare const Label: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "style"> & {
|
|
2
3
|
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
3
4
|
}, {
|
|
@@ -5,6 +6,7 @@ export declare const Label: import('styled-components/dist/types').IStyledCompon
|
|
|
5
6
|
isUp?: boolean;
|
|
6
7
|
active?: boolean;
|
|
7
8
|
error?: boolean;
|
|
9
|
+
$variant?: FieldVariant;
|
|
8
10
|
}>> & string;
|
|
9
11
|
export declare const InputWrap: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
10
12
|
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
@@ -14,9 +16,11 @@ export declare const InputWrap: import('styled-components/dist/types').IStyledCo
|
|
|
14
16
|
dashboard?: boolean;
|
|
15
17
|
error?: boolean;
|
|
16
18
|
hasLabel?: boolean;
|
|
19
|
+
$variant?: FieldVariant;
|
|
17
20
|
}>> & string;
|
|
18
21
|
export declare const Wrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
19
22
|
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
20
23
|
}, {
|
|
21
24
|
inverted?: boolean;
|
|
25
|
+
$variant?: FieldVariant;
|
|
22
26
|
}>> & string;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
|
+
import { borderedFieldLabel, borderedFieldBox, borderedFieldText, borderedFieldPlaceholder, borderedFieldFocus, borderedFieldError, borderedFieldDisabled, BORDERED_BORDER } from "../../styles/borderedField.js";
|
|
3
|
+
import { text } from "../../design-system/styled/text.js";
|
|
2
4
|
const Label = styled.label.withConfig({
|
|
3
5
|
shouldForwardProp: (props) => !["autoHeightLabel", "isUp", "active", "error"].includes(props)
|
|
4
6
|
})`
|
|
@@ -7,18 +9,12 @@ const Label = styled.label.withConfig({
|
|
|
7
9
|
position: absolute;
|
|
8
10
|
left: 0;
|
|
9
11
|
top: -2px;
|
|
10
|
-
|
|
12
|
+
${text("labelRegular")}
|
|
11
13
|
height: 12px;
|
|
12
|
-
|
|
13
|
-
line-height: 20px;
|
|
14
|
-
letter-spacing: 2px;
|
|
15
|
-
text-transform: uppercase;
|
|
16
|
-
color: var(--stokr-text-primary);
|
|
14
|
+
color: var(--text-primary);
|
|
17
15
|
pointer-events: none;
|
|
18
16
|
transform: translateY(15px);
|
|
19
|
-
transition:
|
|
20
|
-
transform 0.2s,
|
|
21
|
-
font-size 0.2s;
|
|
17
|
+
transition: transform 0.2s;
|
|
22
18
|
|
|
23
19
|
${(props) => props.autoHeightLabel && `
|
|
24
20
|
height:auto;
|
|
@@ -26,17 +22,28 @@ const Label = styled.label.withConfig({
|
|
|
26
22
|
`}
|
|
27
23
|
|
|
28
24
|
${(props) => props.isUp && `
|
|
29
|
-
font-size: 10px;
|
|
30
25
|
transform: translateY(0);
|
|
31
26
|
`}
|
|
32
27
|
|
|
33
28
|
${(props) => props.active && `
|
|
34
|
-
color: var(--
|
|
29
|
+
color: var(--border-focus);
|
|
35
30
|
`}
|
|
36
31
|
|
|
37
32
|
${(props) => props.error && `
|
|
38
|
-
color: var(--
|
|
33
|
+
color: var(--status-error-text);
|
|
39
34
|
`}
|
|
35
|
+
|
|
36
|
+
${(props) => props.$variant === "bordered" && css`
|
|
37
|
+
position: static;
|
|
38
|
+
z-index: auto;
|
|
39
|
+
top: auto;
|
|
40
|
+
left: auto;
|
|
41
|
+
height: auto;
|
|
42
|
+
transform: none;
|
|
43
|
+
pointer-events: auto;
|
|
44
|
+
${borderedFieldLabel}
|
|
45
|
+
color: ${props.error ? "var(--status-error-text)" : "var(--text-primary)"};
|
|
46
|
+
`}
|
|
40
47
|
`;
|
|
41
48
|
const InputWrap = styled.div.withConfig({
|
|
42
49
|
shouldForwardProp: (props) => !["autoHeightLabel", "disabled", "dashboard", "error", "hasLabel"].includes(props)
|
|
@@ -45,7 +52,7 @@ const InputWrap = styled.div.withConfig({
|
|
|
45
52
|
|
|
46
53
|
& > input {
|
|
47
54
|
z-index: 0;
|
|
48
|
-
font-family: var(--
|
|
55
|
+
font-family: var(--font-family-base);
|
|
49
56
|
display: block;
|
|
50
57
|
width: 100%;
|
|
51
58
|
height: 40px;
|
|
@@ -58,8 +65,8 @@ const InputWrap = styled.div.withConfig({
|
|
|
58
65
|
border: 0;
|
|
59
66
|
outline: 0;
|
|
60
67
|
border-top: 1px solid transparent;
|
|
61
|
-
border-bottom: 1px solid var(--
|
|
62
|
-
color: var(--
|
|
68
|
+
border-bottom: 1px solid var(--border-subtle);
|
|
69
|
+
color: var(--text-primary);
|
|
63
70
|
background-color: transparent;
|
|
64
71
|
transition: border-color 0.2s;
|
|
65
72
|
|
|
@@ -71,7 +78,7 @@ const InputWrap = styled.div.withConfig({
|
|
|
71
78
|
&:focus,
|
|
72
79
|
&:hover {
|
|
73
80
|
border-top-color: transparent;
|
|
74
|
-
border-bottom-color: var(--
|
|
81
|
+
border-bottom-color: var(--border-focus);
|
|
75
82
|
}
|
|
76
83
|
|
|
77
84
|
&::placeholder {
|
|
@@ -82,11 +89,11 @@ const InputWrap = styled.div.withConfig({
|
|
|
82
89
|
|
|
83
90
|
${(props) => props.disabled && css`
|
|
84
91
|
& > input {
|
|
85
|
-
color: var(--
|
|
92
|
+
color: var(--text-tertiary);
|
|
86
93
|
&:focus,
|
|
87
94
|
&:hover {
|
|
88
95
|
border-top-color: transparent;
|
|
89
|
-
border-bottom-color: var(--
|
|
96
|
+
border-bottom-color: var(--border-subtle);
|
|
90
97
|
}
|
|
91
98
|
}
|
|
92
99
|
`}
|
|
@@ -96,16 +103,16 @@ const InputWrap = styled.div.withConfig({
|
|
|
96
103
|
border: 0;
|
|
97
104
|
padding: 0;
|
|
98
105
|
height: 22px;
|
|
99
|
-
font-family: var(--
|
|
106
|
+
font-family: var(--font-family-base);
|
|
100
107
|
font-weight: 300;
|
|
101
108
|
font-size: 14px;
|
|
102
109
|
line-height: 22px;
|
|
103
110
|
letter-spacing: 0.53px;
|
|
104
111
|
text-transform: normal;
|
|
105
|
-
color: var(--
|
|
112
|
+
color: var(--text-primary);
|
|
106
113
|
|
|
107
114
|
&::placeholder {
|
|
108
|
-
color: var(--
|
|
115
|
+
color: var(--text-tertiary);
|
|
109
116
|
opacity: 1;
|
|
110
117
|
}
|
|
111
118
|
|
|
@@ -117,8 +124,44 @@ const InputWrap = styled.div.withConfig({
|
|
|
117
124
|
`}
|
|
118
125
|
|
|
119
126
|
${(props) => props.error && `
|
|
120
|
-
color: var(--
|
|
127
|
+
color: var(--status-error-text);
|
|
121
128
|
`}
|
|
129
|
+
|
|
130
|
+
${(props) => props.$variant === "bordered" && css`
|
|
131
|
+
& > input {
|
|
132
|
+
${borderedFieldBox}
|
|
133
|
+
${borderedFieldText}
|
|
134
|
+
height: 44px;
|
|
135
|
+
|
|
136
|
+
&::placeholder {
|
|
137
|
+
${borderedFieldPlaceholder}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&:hover {
|
|
141
|
+
border-color: var(--border-subtle);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&:focus {
|
|
145
|
+
${borderedFieldFocus}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
${props.error && css`
|
|
149
|
+
&,
|
|
150
|
+
&:hover,
|
|
151
|
+
&:focus {
|
|
152
|
+
${borderedFieldError}
|
|
153
|
+
}
|
|
154
|
+
`}
|
|
155
|
+
|
|
156
|
+
${props.disabled && css`
|
|
157
|
+
&,
|
|
158
|
+
&:hover,
|
|
159
|
+
&:focus {
|
|
160
|
+
${borderedFieldDisabled}
|
|
161
|
+
}
|
|
162
|
+
`}
|
|
163
|
+
}
|
|
164
|
+
`}
|
|
122
165
|
`;
|
|
123
166
|
const Wrapper = styled.div.withConfig({
|
|
124
167
|
shouldForwardProp: (props) => !["inverted"].includes(props)
|
|
@@ -128,20 +171,20 @@ const Wrapper = styled.div.withConfig({
|
|
|
128
171
|
|
|
129
172
|
input:-webkit-autofill {
|
|
130
173
|
border: none;
|
|
131
|
-
border-bottom: 1px solid var(--
|
|
132
|
-
box-shadow: 0 0 0px 1000px var(--
|
|
174
|
+
border-bottom: 1px solid var(--border-subtle);
|
|
175
|
+
box-shadow: 0 0 0px 1000px var(--background-default) inset;
|
|
133
176
|
transition: background-color 5000s ease-in-out 0s;
|
|
134
177
|
}
|
|
135
178
|
|
|
136
179
|
${(props) => props.inverted && css`
|
|
137
180
|
${Label} {
|
|
138
|
-
color: var(--
|
|
181
|
+
color: var(--brand-pure-white);
|
|
139
182
|
opacity: 0.4;
|
|
140
183
|
}
|
|
141
184
|
${InputWrap} {
|
|
142
185
|
& > input {
|
|
143
|
-
color: var(--
|
|
144
|
-
border-bottom-color: var(--
|
|
186
|
+
color: var(--brand-pure-white);
|
|
187
|
+
border-bottom-color: var(--brand-pure-white);
|
|
145
188
|
|
|
146
189
|
&:focus,
|
|
147
190
|
&:hover {
|
|
@@ -150,6 +193,13 @@ const Wrapper = styled.div.withConfig({
|
|
|
150
193
|
}
|
|
151
194
|
}
|
|
152
195
|
`}
|
|
196
|
+
|
|
197
|
+
${(props) => props.$variant === "bordered" && css`
|
|
198
|
+
input:-webkit-autofill {
|
|
199
|
+
border: ${BORDERED_BORDER};
|
|
200
|
+
border-radius: var(--radius-lg);
|
|
201
|
+
}
|
|
202
|
+
`}
|
|
153
203
|
`;
|
|
154
204
|
export {
|
|
155
205
|
InputWrap,
|
|
@@ -22,7 +22,7 @@ const ShowPassword = styled.button`
|
|
|
22
22
|
text-align: right;
|
|
23
23
|
|
|
24
24
|
&:hover {
|
|
25
|
-
color: var(--
|
|
25
|
+
color: var(--action-accent-bg);
|
|
26
26
|
}
|
|
27
27
|
`;
|
|
28
28
|
const CapslockIndicator = styled.div`
|
|
@@ -31,7 +31,7 @@ const CapslockIndicator = styled.div`
|
|
|
31
31
|
right: 2px;
|
|
32
32
|
|
|
33
33
|
& > svg {
|
|
34
|
-
fill: var(--
|
|
34
|
+
fill: var(--text-primary);
|
|
35
35
|
}
|
|
36
36
|
`;
|
|
37
37
|
const PasswordStrengthWrap = styled.div`
|
|
@@ -48,7 +48,7 @@ const PasswordStrengthIndicator = styled.div`
|
|
|
48
48
|
height: 6px;
|
|
49
49
|
border-radius: 3px;
|
|
50
50
|
margin: 3px 4px;
|
|
51
|
-
background-color: var(--
|
|
51
|
+
background-color: var(--border-subtle);
|
|
52
52
|
`;
|
|
53
53
|
const PasswordStrengthText = styled.div`
|
|
54
54
|
display: inline-block;
|
|
@@ -58,7 +58,7 @@ const PasswordStrengthText = styled.div`
|
|
|
58
58
|
line-height: 12px;
|
|
59
59
|
letter-spacing: 0.4px;
|
|
60
60
|
font-style: italic;
|
|
61
|
-
color: var(--
|
|
61
|
+
color: var(--text-primary);
|
|
62
62
|
`;
|
|
63
63
|
styled.div`
|
|
64
64
|
&&& > .DayPickerInput {
|
|
@@ -69,7 +69,7 @@ styled.div`
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
&&& > .DayPickerInput > input {
|
|
72
|
-
font-family: var(--
|
|
72
|
+
font-family: var(--font-family-base);
|
|
73
73
|
display: block;
|
|
74
74
|
width: 100%;
|
|
75
75
|
height: 40px;
|
|
@@ -83,8 +83,8 @@ styled.div`
|
|
|
83
83
|
outline: 0;
|
|
84
84
|
border: 0;
|
|
85
85
|
border-top: 1px solid transparent;
|
|
86
|
-
border-bottom: 1px solid var(--
|
|
87
|
-
color: var(--
|
|
86
|
+
border-bottom: 1px solid var(--border-subtle);
|
|
87
|
+
color: var(--text-primary);
|
|
88
88
|
background-color: transparent;
|
|
89
89
|
transition: border-color 0.2s;
|
|
90
90
|
|
|
@@ -92,7 +92,7 @@ styled.div`
|
|
|
92
92
|
&:hover {
|
|
93
93
|
box-shadow: none;
|
|
94
94
|
border-top-color: transparent;
|
|
95
|
-
border-bottom-color: var(--
|
|
95
|
+
border-bottom-color: var(--border-focus);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
&::placeholder {
|
|
@@ -132,7 +132,7 @@ const PasswordStrengthIndicators = styled.div.withConfig({
|
|
|
132
132
|
${(props) => props.passwordStrength === PasswordStrength.WEAK && css`
|
|
133
133
|
${PasswordStrengthIndicator} {
|
|
134
134
|
&:nth-child(1) {
|
|
135
|
-
background-color: var(--
|
|
135
|
+
background-color: var(--status-error-icon);
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
`}
|
|
@@ -141,7 +141,7 @@ const PasswordStrengthIndicators = styled.div.withConfig({
|
|
|
141
141
|
${PasswordStrengthIndicator} {
|
|
142
142
|
&:nth-child(1),
|
|
143
143
|
&:nth-child(2) {
|
|
144
|
-
background-color: var(--
|
|
144
|
+
background-color: var(--status-warning-icon);
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
`}
|
|
@@ -151,7 +151,7 @@ const PasswordStrengthIndicators = styled.div.withConfig({
|
|
|
151
151
|
&:nth-child(1),
|
|
152
152
|
&:nth-child(2),
|
|
153
153
|
&:nth-child(3) {
|
|
154
|
-
background-color: var(--
|
|
154
|
+
background-color: var(--status-success-icon);
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
`}
|