@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,5 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
|
-
import theme from "../../styles/theme.js";
|
|
3
2
|
import { borderedFieldLabel, borderedFieldBox, borderedFieldText, borderedFieldPlaceholder, borderedFieldFocus, borderedFieldError, borderedFieldDisabled, BORDERED_BORDER } from "../../styles/borderedField.js";
|
|
4
|
-
import { radius } from "../../styles/spacing.js";
|
|
5
3
|
const Label = styled.label.withConfig({
|
|
6
4
|
shouldForwardProp: (props) => !["autoHeightLabel", "isUp", "active", "error"].includes(props)
|
|
7
5
|
})`
|
|
@@ -16,7 +14,7 @@ const Label = styled.label.withConfig({
|
|
|
16
14
|
line-height: 20px;
|
|
17
15
|
letter-spacing: 2px;
|
|
18
16
|
text-transform: uppercase;
|
|
19
|
-
color:
|
|
17
|
+
color: var(--stokr-text-primary);
|
|
20
18
|
pointer-events: none;
|
|
21
19
|
transform: translateY(15px);
|
|
22
20
|
transition:
|
|
@@ -34,11 +32,11 @@ const Label = styled.label.withConfig({
|
|
|
34
32
|
`}
|
|
35
33
|
|
|
36
34
|
${(props) => props.active && `
|
|
37
|
-
color:
|
|
35
|
+
color: var(--stokr-border-focus);
|
|
38
36
|
`}
|
|
39
37
|
|
|
40
38
|
${(props) => props.error && `
|
|
41
|
-
color:
|
|
39
|
+
color: var(--stokr-status-error-text);
|
|
42
40
|
`}
|
|
43
41
|
|
|
44
42
|
${(props) => props.$variant === "bordered" && css`
|
|
@@ -50,17 +48,17 @@ const Label = styled.label.withConfig({
|
|
|
50
48
|
transform: none;
|
|
51
49
|
pointer-events: auto;
|
|
52
50
|
${borderedFieldLabel}
|
|
53
|
-
color: ${props.error ?
|
|
51
|
+
color: ${props.error ? "var(--stokr-status-error-text)" : "var(--stokr-text-primary)"};
|
|
54
52
|
`}
|
|
55
53
|
`;
|
|
56
54
|
const InputWrap = styled.div.withConfig({
|
|
57
|
-
shouldForwardProp: (props) => !["autoHeightLabel", "disabled", "dashboard", "error"].includes(props)
|
|
55
|
+
shouldForwardProp: (props) => !["autoHeightLabel", "disabled", "dashboard", "error", "hasLabel"].includes(props)
|
|
58
56
|
})`
|
|
59
57
|
position: relative;
|
|
60
58
|
|
|
61
59
|
& > input {
|
|
62
60
|
z-index: 0;
|
|
63
|
-
font-family:
|
|
61
|
+
font-family: var(--stokr-font-family-base);
|
|
64
62
|
display: block;
|
|
65
63
|
width: 100%;
|
|
66
64
|
height: 40px;
|
|
@@ -73,8 +71,8 @@ const InputWrap = styled.div.withConfig({
|
|
|
73
71
|
border: 0;
|
|
74
72
|
outline: 0;
|
|
75
73
|
border-top: 1px solid transparent;
|
|
76
|
-
border-bottom: 1px solid
|
|
77
|
-
color:
|
|
74
|
+
border-bottom: 1px solid var(--stokr-border-subtle);
|
|
75
|
+
color: var(--stokr-text-primary);
|
|
78
76
|
background-color: transparent;
|
|
79
77
|
transition: border-color 0.2s;
|
|
80
78
|
|
|
@@ -86,7 +84,7 @@ const InputWrap = styled.div.withConfig({
|
|
|
86
84
|
&:focus,
|
|
87
85
|
&:hover {
|
|
88
86
|
border-top-color: transparent;
|
|
89
|
-
border-bottom-color:
|
|
87
|
+
border-bottom-color: var(--stokr-border-focus);
|
|
90
88
|
}
|
|
91
89
|
|
|
92
90
|
&::placeholder {
|
|
@@ -97,11 +95,11 @@ const InputWrap = styled.div.withConfig({
|
|
|
97
95
|
|
|
98
96
|
${(props) => props.disabled && css`
|
|
99
97
|
& > input {
|
|
100
|
-
color:
|
|
98
|
+
color: var(--stokr-text-tertiary);
|
|
101
99
|
&:focus,
|
|
102
100
|
&:hover {
|
|
103
101
|
border-top-color: transparent;
|
|
104
|
-
border-bottom-color:
|
|
102
|
+
border-bottom-color: var(--stokr-border-subtle);
|
|
105
103
|
}
|
|
106
104
|
}
|
|
107
105
|
`}
|
|
@@ -111,23 +109,28 @@ const InputWrap = styled.div.withConfig({
|
|
|
111
109
|
border: 0;
|
|
112
110
|
padding: 0;
|
|
113
111
|
height: 22px;
|
|
114
|
-
font-family:
|
|
112
|
+
font-family: var(--stokr-font-family-base);
|
|
115
113
|
font-weight: 300;
|
|
116
114
|
font-size: 14px;
|
|
117
115
|
line-height: 22px;
|
|
118
116
|
letter-spacing: 0.53px;
|
|
119
117
|
text-transform: normal;
|
|
120
|
-
color:
|
|
118
|
+
color: var(--stokr-text-primary);
|
|
121
119
|
|
|
122
120
|
&::placeholder {
|
|
123
|
-
color:
|
|
121
|
+
color: var(--stokr-text-tertiary);
|
|
124
122
|
opacity: 1;
|
|
125
123
|
}
|
|
124
|
+
|
|
125
|
+
/* The floating label sits above the value once it is up: leave it its own row. */
|
|
126
|
+
${props.hasLabel && css`
|
|
127
|
+
padding-top: 14px;
|
|
128
|
+
`}
|
|
126
129
|
}
|
|
127
130
|
`}
|
|
128
131
|
|
|
129
132
|
${(props) => props.error && `
|
|
130
|
-
color:
|
|
133
|
+
color: var(--stokr-status-error-text);
|
|
131
134
|
`}
|
|
132
135
|
|
|
133
136
|
${(props) => props.$variant === "bordered" && css`
|
|
@@ -141,7 +144,7 @@ const InputWrap = styled.div.withConfig({
|
|
|
141
144
|
}
|
|
142
145
|
|
|
143
146
|
&:hover {
|
|
144
|
-
border-color:
|
|
147
|
+
border-color: var(--stokr-border-subtle);
|
|
145
148
|
}
|
|
146
149
|
|
|
147
150
|
&:focus {
|
|
@@ -174,20 +177,20 @@ const Wrapper = styled.div.withConfig({
|
|
|
174
177
|
|
|
175
178
|
input:-webkit-autofill {
|
|
176
179
|
border: none;
|
|
177
|
-
border-bottom: 1px solid
|
|
178
|
-
box-shadow: 0 0 0px 1000px
|
|
180
|
+
border-bottom: 1px solid var(--stokr-border-subtle);
|
|
181
|
+
box-shadow: 0 0 0px 1000px var(--stokr-background-default) inset;
|
|
179
182
|
transition: background-color 5000s ease-in-out 0s;
|
|
180
183
|
}
|
|
181
184
|
|
|
182
185
|
${(props) => props.inverted && css`
|
|
183
186
|
${Label} {
|
|
184
|
-
color:
|
|
187
|
+
color: var(--stokr-brand-pure-white);
|
|
185
188
|
opacity: 0.4;
|
|
186
189
|
}
|
|
187
190
|
${InputWrap} {
|
|
188
191
|
& > input {
|
|
189
|
-
color:
|
|
190
|
-
border-bottom-color:
|
|
192
|
+
color: var(--stokr-brand-pure-white);
|
|
193
|
+
border-bottom-color: var(--stokr-brand-pure-white);
|
|
191
194
|
|
|
192
195
|
&:focus,
|
|
193
196
|
&:hover {
|
|
@@ -200,7 +203,7 @@ const Wrapper = styled.div.withConfig({
|
|
|
200
203
|
${(props) => props.$variant === "bordered" && css`
|
|
201
204
|
input:-webkit-autofill {
|
|
202
205
|
border: ${BORDERED_BORDER};
|
|
203
|
-
border-radius:
|
|
206
|
+
border-radius: var(--stokr-radius-lg);
|
|
204
207
|
}
|
|
205
208
|
`}
|
|
206
209
|
`;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const BottomWrap: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
2
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
3
|
+
}> & string;
|
|
4
|
+
export declare const ShowPassword: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style"> & {
|
|
5
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
6
|
+
}> & string;
|
|
7
|
+
export declare const CapslockIndicator: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
8
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
9
|
+
}> & string;
|
|
10
|
+
export declare const PasswordStrengthWrap: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
11
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
12
|
+
}> & string;
|
|
13
|
+
export declare const PasswordStrengthIndicator: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
14
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
15
|
+
}> & string;
|
|
16
|
+
export declare const PasswordStrengthText: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
17
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
18
|
+
}> & string;
|
|
19
|
+
export declare const DatePickerOverlay: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
20
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
21
|
+
}> & string;
|
|
22
|
+
export declare const InfoIconWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
23
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
24
|
+
}, {
|
|
25
|
+
isPassword?: boolean;
|
|
26
|
+
labelUp?: boolean;
|
|
27
|
+
}>> & string;
|
|
28
|
+
export declare const PasswordStrengthIndicators: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
29
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
30
|
+
}, {
|
|
31
|
+
passwordStrength?: string;
|
|
32
|
+
}>> & string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
2
|
import { PasswordStrength } from "./InputPassword.js";
|
|
3
|
-
import theme from "../../styles/theme.js";
|
|
4
3
|
const BottomWrap = styled.div`
|
|
5
4
|
position: relative;
|
|
6
5
|
margin-top: 6px;
|
|
@@ -23,7 +22,7 @@ const ShowPassword = styled.button`
|
|
|
23
22
|
text-align: right;
|
|
24
23
|
|
|
25
24
|
&:hover {
|
|
26
|
-
color:
|
|
25
|
+
color: var(--stokr-action-accent-bg);
|
|
27
26
|
}
|
|
28
27
|
`;
|
|
29
28
|
const CapslockIndicator = styled.div`
|
|
@@ -32,7 +31,7 @@ const CapslockIndicator = styled.div`
|
|
|
32
31
|
right: 2px;
|
|
33
32
|
|
|
34
33
|
& > svg {
|
|
35
|
-
fill:
|
|
34
|
+
fill: var(--stokr-text-primary);
|
|
36
35
|
}
|
|
37
36
|
`;
|
|
38
37
|
const PasswordStrengthWrap = styled.div`
|
|
@@ -49,7 +48,7 @@ const PasswordStrengthIndicator = styled.div`
|
|
|
49
48
|
height: 6px;
|
|
50
49
|
border-radius: 3px;
|
|
51
50
|
margin: 3px 4px;
|
|
52
|
-
background-color:
|
|
51
|
+
background-color: var(--stokr-border-subtle);
|
|
53
52
|
`;
|
|
54
53
|
const PasswordStrengthText = styled.div`
|
|
55
54
|
display: inline-block;
|
|
@@ -59,7 +58,7 @@ const PasswordStrengthText = styled.div`
|
|
|
59
58
|
line-height: 12px;
|
|
60
59
|
letter-spacing: 0.4px;
|
|
61
60
|
font-style: italic;
|
|
62
|
-
color:
|
|
61
|
+
color: var(--stokr-text-primary);
|
|
63
62
|
`;
|
|
64
63
|
styled.div`
|
|
65
64
|
&&& > .DayPickerInput {
|
|
@@ -70,7 +69,7 @@ styled.div`
|
|
|
70
69
|
}
|
|
71
70
|
|
|
72
71
|
&&& > .DayPickerInput > input {
|
|
73
|
-
font-family:
|
|
72
|
+
font-family: var(--stokr-font-family-base);
|
|
74
73
|
display: block;
|
|
75
74
|
width: 100%;
|
|
76
75
|
height: 40px;
|
|
@@ -84,8 +83,8 @@ styled.div`
|
|
|
84
83
|
outline: 0;
|
|
85
84
|
border: 0;
|
|
86
85
|
border-top: 1px solid transparent;
|
|
87
|
-
border-bottom: 1px solid
|
|
88
|
-
color:
|
|
86
|
+
border-bottom: 1px solid var(--stokr-border-subtle);
|
|
87
|
+
color: var(--stokr-text-primary);
|
|
89
88
|
background-color: transparent;
|
|
90
89
|
transition: border-color 0.2s;
|
|
91
90
|
|
|
@@ -93,7 +92,7 @@ styled.div`
|
|
|
93
92
|
&:hover {
|
|
94
93
|
box-shadow: none;
|
|
95
94
|
border-top-color: transparent;
|
|
96
|
-
border-bottom-color:
|
|
95
|
+
border-bottom-color: var(--stokr-border-focus);
|
|
97
96
|
}
|
|
98
97
|
|
|
99
98
|
&::placeholder {
|
|
@@ -133,7 +132,7 @@ const PasswordStrengthIndicators = styled.div.withConfig({
|
|
|
133
132
|
${(props) => props.passwordStrength === PasswordStrength.WEAK && css`
|
|
134
133
|
${PasswordStrengthIndicator} {
|
|
135
134
|
&:nth-child(1) {
|
|
136
|
-
background-color:
|
|
135
|
+
background-color: var(--stokr-status-error-icon);
|
|
137
136
|
}
|
|
138
137
|
}
|
|
139
138
|
`}
|
|
@@ -142,7 +141,7 @@ const PasswordStrengthIndicators = styled.div.withConfig({
|
|
|
142
141
|
${PasswordStrengthIndicator} {
|
|
143
142
|
&:nth-child(1),
|
|
144
143
|
&:nth-child(2) {
|
|
145
|
-
background-color:
|
|
144
|
+
background-color: var(--stokr-status-warning-icon);
|
|
146
145
|
}
|
|
147
146
|
}
|
|
148
147
|
`}
|
|
@@ -152,7 +151,7 @@ const PasswordStrengthIndicators = styled.div.withConfig({
|
|
|
152
151
|
&:nth-child(1),
|
|
153
152
|
&:nth-child(2),
|
|
154
153
|
&:nth-child(3) {
|
|
155
|
-
background-color:
|
|
154
|
+
background-color: var(--stokr-status-success-icon);
|
|
156
155
|
}
|
|
157
156
|
}
|
|
158
157
|
`}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const Container: 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
|
+
separatorTop?: boolean;
|
|
5
|
+
}>> & string;
|
|
6
|
+
export declare const InputWrap: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
7
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
8
|
+
}> & string;
|
|
9
|
+
export declare const ButtonWrap: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
10
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
11
|
+
}> & string;
|
|
12
|
+
export declare const Input: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "style"> & {
|
|
13
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
14
|
+
}> & string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
|
-
import theme from "../../styles/theme.js";
|
|
3
2
|
const Container = styled.div.withConfig({
|
|
4
3
|
shouldForwardProp: (props) => !["separatorTop"].includes(props)
|
|
5
4
|
})`
|
|
@@ -11,7 +10,7 @@ const Container = styled.div.withConfig({
|
|
|
11
10
|
${(props) => props.separatorTop && `
|
|
12
11
|
padding-top: 20px;
|
|
13
12
|
margin-top: 20px;
|
|
14
|
-
border-top: 1px solid
|
|
13
|
+
border-top: 1px solid var(--stokr-border-subtle);
|
|
15
14
|
`}
|
|
16
15
|
`;
|
|
17
16
|
const InputWrap = styled.div`
|
|
@@ -31,21 +30,21 @@ const Input = styled.input`
|
|
|
31
30
|
width: 100%;
|
|
32
31
|
padding: 9px 23px;
|
|
33
32
|
padding-right: 63px;
|
|
34
|
-
font-family:
|
|
33
|
+
font-family: var(--stokr-font-family-base);
|
|
35
34
|
font-size: 14px;
|
|
36
35
|
line-height: 20px;
|
|
37
|
-
border: 1px solid
|
|
36
|
+
border: 1px solid var(--stokr-border-subtle);
|
|
38
37
|
border-radius: 20px;
|
|
39
38
|
outline: 0;
|
|
40
39
|
transition: border-color 0.2s;
|
|
41
40
|
|
|
42
41
|
&:focus,
|
|
43
42
|
&:hover {
|
|
44
|
-
border: 1px solid
|
|
43
|
+
border: 1px solid var(--stokr-border-focus);
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
&::placeholder {
|
|
48
|
-
color:
|
|
47
|
+
color: var(--stokr-text-tertiary);
|
|
49
48
|
opacity: 1;
|
|
50
49
|
}
|
|
51
50
|
`;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Props as ReactSelectProps } from 'react-select';
|
|
3
|
+
export declare const CheckboxWrapperDiv: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
4
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
5
|
+
}> & string;
|
|
6
|
+
export declare const CheckboxDiv: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
7
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
8
|
+
}, {
|
|
9
|
+
isSelected?: boolean;
|
|
10
|
+
}>> & string;
|
|
11
|
+
export declare const OptionLabel: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
12
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
13
|
+
}> & string;
|
|
14
|
+
export interface MultiSelectOption {
|
|
15
|
+
key?: string;
|
|
16
|
+
value: string;
|
|
17
|
+
label: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
type PassedThrough = Omit<ReactSelectProps<MultiSelectOption, true>, 'id' | 'name' | 'options' | 'value' | 'placeholder' | 'onChange' | 'onBlur' | 'onFocus'>;
|
|
20
|
+
export interface MultiSelectProps extends PassedThrough {
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
/** Floating label above the field. */
|
|
24
|
+
label?: string;
|
|
25
|
+
/** Shown as an error state once `touched` is true. */
|
|
26
|
+
error?: boolean;
|
|
27
|
+
touched?: boolean;
|
|
28
|
+
/** Selected option values. */
|
|
29
|
+
value?: string[];
|
|
30
|
+
options: MultiSelectOption[];
|
|
31
|
+
/** Allow typing to filter the options. */
|
|
32
|
+
search?: boolean;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/** Max height of the open menu in px. */
|
|
35
|
+
menuHeight?: number;
|
|
36
|
+
placeholder?: string;
|
|
37
|
+
onChange?: (event: {
|
|
38
|
+
name: string;
|
|
39
|
+
value: string[];
|
|
40
|
+
}) => void;
|
|
41
|
+
onBlur?: (event: {
|
|
42
|
+
name: string;
|
|
43
|
+
value: string[];
|
|
44
|
+
}) => void;
|
|
45
|
+
onFocus?: (event: {
|
|
46
|
+
name: string;
|
|
47
|
+
value: string[];
|
|
48
|
+
}) => void;
|
|
49
|
+
/** Checkbox next to each option. */
|
|
50
|
+
showCheckboxes?: boolean;
|
|
51
|
+
/** Show the number of selected options instead of the selected tags. */
|
|
52
|
+
showCountBadge?: boolean;
|
|
53
|
+
closeMenuOnSelect?: boolean;
|
|
54
|
+
hideSelectedOptions?: boolean;
|
|
55
|
+
width?: string | number;
|
|
56
|
+
minMenuWidth?: number;
|
|
57
|
+
maxMenuWidth?: number;
|
|
58
|
+
}
|
|
59
|
+
export declare const MultiSelect: (props: MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
export default MultiSelect;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
|
-
import PropTypes from "prop-types";
|
|
4
3
|
import ReactSelect, { components } from "react-select";
|
|
5
4
|
import styled from "styled-components";
|
|
6
5
|
import { Wrapper, Label } from "./Input.styles.js";
|
|
7
|
-
import { colors } from "../../styles/colors.js";
|
|
8
6
|
import { OptionCheckbox } from "../Checkbox/OptionCheckbox.js";
|
|
9
|
-
import { SelectMenuList, SelectIcon } from "./Select.styles.js";
|
|
7
|
+
import { SelectMenuList, SelectIcon as SelectIcon$1 } from "./Select.styles.js";
|
|
8
|
+
const SelectIcon = SelectIcon$1;
|
|
10
9
|
const CountBadge = styled.span`
|
|
11
10
|
display: inline-flex;
|
|
12
11
|
align-items: center;
|
|
@@ -14,8 +13,8 @@ const CountBadge = styled.span`
|
|
|
14
13
|
min-width: 18px;
|
|
15
14
|
height: 18px;
|
|
16
15
|
padding: 0 6px;
|
|
17
|
-
background-color:
|
|
18
|
-
color:
|
|
16
|
+
background-color: var(--stokr-action-primary-bg);
|
|
17
|
+
color: var(--stokr-action-primary-text);
|
|
19
18
|
border-radius: 10px;
|
|
20
19
|
font-size: 12px;
|
|
21
20
|
font-weight: 600;
|
|
@@ -29,7 +28,7 @@ const CheckboxWrapperDiv = styled.div`
|
|
|
29
28
|
transition: background-color 0.15s ease;
|
|
30
29
|
|
|
31
30
|
&:hover {
|
|
32
|
-
background-color:
|
|
31
|
+
background-color: var(--stokr-action-outline-bg-hover);
|
|
33
32
|
}
|
|
34
33
|
`;
|
|
35
34
|
const CheckboxDiv = styled.div.withConfig({
|
|
@@ -37,13 +36,13 @@ const CheckboxDiv = styled.div.withConfig({
|
|
|
37
36
|
})`
|
|
38
37
|
width: 14px;
|
|
39
38
|
height: 14px;
|
|
40
|
-
border: 1px solid ${(props) => props.isSelected ?
|
|
39
|
+
border: 1px solid ${(props) => props.isSelected ? "var(--stokr-text-primary)" : "var(--stokr-text-tertiary)"};
|
|
41
40
|
border-radius: 3px;
|
|
42
41
|
margin-right: 12px;
|
|
43
42
|
display: flex;
|
|
44
43
|
align-items: center;
|
|
45
44
|
justify-content: center;
|
|
46
|
-
background-color: ${(props) => props.isSelected ?
|
|
45
|
+
background-color: ${(props) => props.isSelected ? "var(--stokr-brand-pure-white)" : "var(--stokr-brand-pure-white)"};
|
|
47
46
|
transition: all 0.15s ease;
|
|
48
47
|
flex-shrink: 0;
|
|
49
48
|
|
|
@@ -55,12 +54,12 @@ const CheckboxDiv = styled.div.withConfig({
|
|
|
55
54
|
}
|
|
56
55
|
|
|
57
56
|
svg path {
|
|
58
|
-
stroke:
|
|
57
|
+
stroke: var(--stokr-action-accent-bg);
|
|
59
58
|
}
|
|
60
59
|
`;
|
|
61
60
|
const OptionLabel = styled.span`
|
|
62
61
|
font-size: 14px;
|
|
63
|
-
color:
|
|
62
|
+
color: var(--stokr-text-primary);
|
|
64
63
|
font-weight: 400;
|
|
65
64
|
letter-spacing: 0.6px;
|
|
66
65
|
line-height: 1.5;
|
|
@@ -72,7 +71,7 @@ const OptionLabel = styled.span`
|
|
|
72
71
|
`;
|
|
73
72
|
const PlaceholderText = styled.span`
|
|
74
73
|
font-size: 14px;
|
|
75
|
-
color:
|
|
74
|
+
color: var(--stokr-text-primary);
|
|
76
75
|
font-weight: 400;
|
|
77
76
|
`;
|
|
78
77
|
const CheckboxOption = (props) => {
|
|
@@ -94,17 +93,11 @@ const DropdownIndicator = (props) => {
|
|
|
94
93
|
const { selectProps } = props;
|
|
95
94
|
return /* @__PURE__ */ jsx(components.DropdownIndicator, { ...props, children: /* @__PURE__ */ jsx(SelectIcon, { isMenuOpen: selectProps.menuIsOpen }) });
|
|
96
95
|
};
|
|
97
|
-
DropdownIndicator.propTypes = {
|
|
98
|
-
selectProps: PropTypes.instanceOf(Object).isRequired
|
|
99
|
-
};
|
|
100
96
|
const SelectMenuListWithScroll = (props) => {
|
|
101
97
|
const { children, selectProps } = props;
|
|
102
98
|
const { maxMenuHeight = 300 } = selectProps;
|
|
103
99
|
return /* @__PURE__ */ jsx(SelectMenuList, { autoHeight: true, autoHeightMax: maxMenuHeight, fullHeight: true, children });
|
|
104
100
|
};
|
|
105
|
-
SelectMenuListWithScroll.propTypes = {
|
|
106
|
-
children: PropTypes.node.isRequired
|
|
107
|
-
};
|
|
108
101
|
const MultiSelect = (props) => {
|
|
109
102
|
const {
|
|
110
103
|
id,
|
|
@@ -183,22 +176,23 @@ const MultiSelect = (props) => {
|
|
|
183
176
|
alignItems: "center",
|
|
184
177
|
// minHeight: '44px',
|
|
185
178
|
padding: "0 10px",
|
|
186
|
-
backgroundColor:
|
|
187
|
-
border: `1px solid ${state.isFocused ?
|
|
179
|
+
backgroundColor: "var(--stokr-background-default)",
|
|
180
|
+
border: `1px solid ${state.isFocused ? "var(--stokr-border-default)" : "var(--stokr-border-subtle)"}`,
|
|
188
181
|
borderRadius: "10px",
|
|
189
182
|
boxShadow: "none",
|
|
190
183
|
cursor: "pointer",
|
|
191
184
|
"&:hover": {
|
|
192
|
-
borderColor:
|
|
185
|
+
borderColor: "var(--stokr-border-default)"
|
|
193
186
|
}
|
|
194
187
|
}),
|
|
195
188
|
menu: (baseStyle) => ({
|
|
196
189
|
...baseStyle,
|
|
197
190
|
marginTop: "4px",
|
|
198
191
|
zIndex: 1e3,
|
|
192
|
+
backgroundColor: "var(--stokr-background-surface-raised)",
|
|
199
193
|
borderRadius: "8px",
|
|
200
194
|
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
|
|
201
|
-
border: `1px solid
|
|
195
|
+
border: `1px solid var(--stokr-border-subtle)`,
|
|
202
196
|
overflow: "hidden",
|
|
203
197
|
minWidth: minMenuWidth,
|
|
204
198
|
maxWidth: maxMenuWidth,
|
|
@@ -213,15 +207,15 @@ const MultiSelect = (props) => {
|
|
|
213
207
|
// When using checkboxes, padding is handled by CheckboxOption
|
|
214
208
|
// Otherwise, add padding for the default option
|
|
215
209
|
padding: showCheckboxes ? 0 : "12px 16px",
|
|
216
|
-
backgroundColor: state.isFocused ?
|
|
217
|
-
color:
|
|
210
|
+
backgroundColor: state.isFocused ? "var(--stokr-action-outline-bg-hover)" : "transparent",
|
|
211
|
+
color: "var(--stokr-text-primary)",
|
|
218
212
|
cursor: "pointer",
|
|
219
213
|
fontWeight: state.isSelected ? 600 : 400,
|
|
220
214
|
whiteSpace: "nowrap",
|
|
221
215
|
overflow: "hidden",
|
|
222
216
|
textOverflow: "ellipsis",
|
|
223
217
|
"&:active": {
|
|
224
|
-
backgroundColor:
|
|
218
|
+
backgroundColor: "var(--stokr-action-outline-bg-hover)"
|
|
225
219
|
}
|
|
226
220
|
}),
|
|
227
221
|
valueContainer: (baseStyle) => ({
|
|
@@ -241,7 +235,8 @@ const MultiSelect = (props) => {
|
|
|
241
235
|
input: (baseStyle) => ({
|
|
242
236
|
...baseStyle,
|
|
243
237
|
margin: 0,
|
|
244
|
-
padding: 0
|
|
238
|
+
padding: 0,
|
|
239
|
+
color: "var(--stokr-text-primary)"
|
|
245
240
|
}),
|
|
246
241
|
indicatorsContainer: (baseStyle) => ({
|
|
247
242
|
...baseStyle,
|
|
@@ -269,33 +264,6 @@ const MultiSelect = (props) => {
|
|
|
269
264
|
)
|
|
270
265
|
] });
|
|
271
266
|
};
|
|
272
|
-
MultiSelect.propTypes = {
|
|
273
|
-
id: PropTypes.string.isRequired,
|
|
274
|
-
name: PropTypes.string.isRequired,
|
|
275
|
-
label: PropTypes.string,
|
|
276
|
-
error: PropTypes.bool,
|
|
277
|
-
touched: PropTypes.bool,
|
|
278
|
-
value: PropTypes.arrayOf(PropTypes.string),
|
|
279
|
-
options: PropTypes.arrayOf(
|
|
280
|
-
PropTypes.shape({
|
|
281
|
-
key: PropTypes.string.isRequired,
|
|
282
|
-
value: PropTypes.string.isRequired,
|
|
283
|
-
label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired
|
|
284
|
-
})
|
|
285
|
-
).isRequired,
|
|
286
|
-
search: PropTypes.bool,
|
|
287
|
-
placeholder: PropTypes.string,
|
|
288
|
-
onChange: PropTypes.func,
|
|
289
|
-
onBlur: PropTypes.func,
|
|
290
|
-
onFocus: PropTypes.func,
|
|
291
|
-
showCheckboxes: PropTypes.bool,
|
|
292
|
-
showCountBadge: PropTypes.bool,
|
|
293
|
-
closeMenuOnSelect: PropTypes.bool,
|
|
294
|
-
hideSelectedOptions: PropTypes.bool,
|
|
295
|
-
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
296
|
-
minMenuWidth: PropTypes.number,
|
|
297
|
-
maxMenuWidth: PropTypes.number
|
|
298
|
-
};
|
|
299
267
|
export {
|
|
300
268
|
CheckboxDiv,
|
|
301
269
|
CheckboxWrapperDiv,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { OTPInputProps } from 'react-otp-input';
|
|
3
|
+
export interface OtpInputProps extends Omit<OTPInputProps, 'renderInput' | 'renderSeparator' | 'onChange'> {
|
|
4
|
+
/** Accepted for API compatibility; not forwarded to the digit inputs. */
|
|
5
|
+
id?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
/** Floating label above the digits. */
|
|
8
|
+
label?: string;
|
|
9
|
+
/** Component rendered between two digits. */
|
|
10
|
+
RenderSeparator?: ComponentType;
|
|
11
|
+
/** Prefix for `data-cy`: `{prefix}-wrapper` and `{prefix}-digit-0`, … */
|
|
12
|
+
dataCyPrefix?: string;
|
|
13
|
+
/** Called with the full code each time a digit changes. */
|
|
14
|
+
onChange?: (otp: string) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const OtpInput: (props: OtpInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default OtpInput;
|
|
@@ -3,12 +3,11 @@ import { useState, useEffect } from "react";
|
|
|
3
3
|
import Input from "react-otp-input";
|
|
4
4
|
import { styled } from "styled-components";
|
|
5
5
|
import { Wrapper, Label, InputWrap } from "./Input.styles.js";
|
|
6
|
-
import
|
|
7
|
-
import rwd from "../../styles/rwd.js";
|
|
6
|
+
import { breakpoint } from "../../design-system/styled/breakpoint.js";
|
|
8
7
|
const inputStyle = {
|
|
9
8
|
outline: "none",
|
|
10
9
|
border: "none",
|
|
11
|
-
borderBottom: `1.5px solid
|
|
10
|
+
borderBottom: `1.5px solid var(--stokr-border-strong)`,
|
|
12
11
|
padding: "10px",
|
|
13
12
|
paddingBottom: "2px",
|
|
14
13
|
minWidth: 30,
|
|
@@ -18,7 +17,7 @@ const inputStyle = {
|
|
|
18
17
|
};
|
|
19
18
|
const Separator = styled.span`
|
|
20
19
|
padding: 5px;
|
|
21
|
-
${
|
|
20
|
+
${breakpoint.Mobile`
|
|
22
21
|
padding: 10px;
|
|
23
22
|
`}
|
|
24
23
|
`;
|
|
@@ -50,12 +49,12 @@ const OtpInput = (props) => {
|
|
|
50
49
|
useEffect(() => {
|
|
51
50
|
if (value && !labelUp) setLabelUp(true);
|
|
52
51
|
}, [value, labelUp]);
|
|
53
|
-
const handleChange = (
|
|
54
|
-
onChange?.(
|
|
52
|
+
const handleChange = (otp) => {
|
|
53
|
+
onChange?.(otp);
|
|
55
54
|
};
|
|
56
55
|
return /* @__PURE__ */ jsxs(Wrapper, { ...dataCyPrefix ? { "data-cy": `${dataCyPrefix}-wrapper` } : {}, children: [
|
|
57
|
-
label && /* @__PURE__ */ jsx(Label, { isUp: true, style: { lineHeight: "
|
|
58
|
-
/* @__PURE__ */ jsx(InputWrap, { children: /* @__PURE__ */ jsx(
|
|
56
|
+
label && /* @__PURE__ */ jsx(Label, { isUp: true, style: { lineHeight: "12px", top: 0 }, children: label }),
|
|
57
|
+
/* @__PURE__ */ jsx(InputWrap, { style: label ? { paddingTop: 12 } : void 0, children: /* @__PURE__ */ jsx(
|
|
59
58
|
Input,
|
|
60
59
|
{
|
|
61
60
|
value,
|
|
@@ -65,13 +64,7 @@ const OtpInput = (props) => {
|
|
|
65
64
|
shouldAutoFocus,
|
|
66
65
|
inputStyle,
|
|
67
66
|
renderSeparator: /* @__PURE__ */ jsx(RenderSeparator, {}),
|
|
68
|
-
renderInput: (inputProps, index) => /* @__PURE__ */ jsx(
|
|
69
|
-
"input",
|
|
70
|
-
{
|
|
71
|
-
...inputProps,
|
|
72
|
-
...dataCyPrefix ? { "data-cy": `${dataCyPrefix}-digit-${index}` } : {}
|
|
73
|
-
}
|
|
74
|
-
),
|
|
67
|
+
renderInput: (inputProps, index) => /* @__PURE__ */ jsx("input", { ...inputProps, ...dataCyPrefix ? { "data-cy": `${dataCyPrefix}-digit-${index}` } : {} }),
|
|
75
68
|
...otpProps
|
|
76
69
|
}
|
|
77
70
|
) })
|