@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
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface RangeInputProps {
|
|
2
|
+
id?: string;
|
|
3
|
+
/** Accessible label for the thumb. */
|
|
4
|
+
name?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
max?: number;
|
|
7
|
+
min?: number;
|
|
8
|
+
step?: number;
|
|
9
|
+
/** Called with the new value (a number). */
|
|
10
|
+
onChange?: (value: number) => void;
|
|
11
|
+
value: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const RangeInput: ({ disabled, max, min, step, onChange, value, id, name, }: RangeInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default RangeInput;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import PropTypes from "prop-types";
|
|
4
2
|
import { Range, getTrackBackground } from "react-range";
|
|
5
|
-
import { colors } from "../../styles/colors.js";
|
|
6
3
|
const RangeInput = ({
|
|
7
4
|
disabled = false,
|
|
8
5
|
max = 100,
|
|
@@ -33,7 +30,7 @@ const RangeInput = ({
|
|
|
33
30
|
borderRadius: "10px",
|
|
34
31
|
background: getTrackBackground({
|
|
35
32
|
values: [value],
|
|
36
|
-
colors: [
|
|
33
|
+
colors: ["var(--stokr-action-accent-bg)", "var(--stokr-border-subtle)"],
|
|
37
34
|
min,
|
|
38
35
|
max
|
|
39
36
|
})
|
|
@@ -50,7 +47,7 @@ const RangeInput = ({
|
|
|
50
47
|
...props.style,
|
|
51
48
|
height: "24px",
|
|
52
49
|
width: "24px",
|
|
53
|
-
backgroundColor:
|
|
50
|
+
backgroundColor: "var(--stokr-action-accent-bg)",
|
|
54
51
|
borderRadius: "50%",
|
|
55
52
|
border: "4px solid white"
|
|
56
53
|
}
|
|
@@ -59,18 +56,6 @@ const RangeInput = ({
|
|
|
59
56
|
)
|
|
60
57
|
}
|
|
61
58
|
) });
|
|
62
|
-
RangeInput.propTypes = {
|
|
63
|
-
id: PropTypes.string,
|
|
64
|
-
/** Accessible label for the thumb. */
|
|
65
|
-
name: PropTypes.string,
|
|
66
|
-
disabled: PropTypes.bool,
|
|
67
|
-
max: PropTypes.number,
|
|
68
|
-
min: PropTypes.number,
|
|
69
|
-
step: PropTypes.number,
|
|
70
|
-
/** Called with the new value (a number). */
|
|
71
|
-
onChange: PropTypes.func,
|
|
72
|
-
value: PropTypes.number.isRequired
|
|
73
|
-
};
|
|
74
59
|
export {
|
|
75
60
|
RangeInput
|
|
76
61
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const SearchInputContainer: 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 SearchInputWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
5
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
6
|
+
}, {
|
|
7
|
+
variant?: "filled" | "outlined";
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}>> & string;
|
|
10
|
+
export declare const SearchIconWrapper: 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 SearchInputField: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "style"> & {
|
|
14
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
15
|
+
}> & string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
|
-
import { colors } from "../../styles/colors.js";
|
|
3
2
|
const SearchInputContainer = styled.div`
|
|
4
3
|
width: 100%;
|
|
5
4
|
display: flex;
|
|
@@ -17,8 +16,8 @@ const SearchInputWrapper = styled.div.withConfig({
|
|
|
17
16
|
transition: all 0.2s ease;
|
|
18
17
|
|
|
19
18
|
/* Default filled variant */
|
|
20
|
-
background-color: ${(props) => props.variant === "outlined" ? "transparent" :
|
|
21
|
-
border: ${(props) => props.variant === "outlined" ? `1px solid
|
|
19
|
+
background-color: ${(props) => props.variant === "outlined" ? "transparent" : "var(--stokr-background-surface)"};
|
|
20
|
+
border: ${(props) => props.variant === "outlined" ? `1px solid var(--stokr-border-subtle)` : "1px solid transparent"};
|
|
22
21
|
|
|
23
22
|
${(props) => props.disabled && `
|
|
24
23
|
opacity: 0.6;
|
|
@@ -26,13 +25,13 @@ const SearchInputWrapper = styled.div.withConfig({
|
|
|
26
25
|
`}
|
|
27
26
|
|
|
28
27
|
&:focus-within {
|
|
29
|
-
background-color: ${(props) => props.variant === "outlined" ? "transparent" :
|
|
30
|
-
border-color: ${(props) => props.variant === "outlined" ?
|
|
31
|
-
box-shadow: ${(props) => props.variant === "outlined" ? "none" : `0 0 0 2px
|
|
28
|
+
background-color: ${(props) => props.variant === "outlined" ? "transparent" : "var(--stokr-background-default)"};
|
|
29
|
+
border-color: ${(props) => props.variant === "outlined" ? "var(--stokr-border-default)" : "transparent"};
|
|
30
|
+
box-shadow: ${(props) => props.variant === "outlined" ? "none" : `0 0 0 2px var(--stokr-border-subtle)`};
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
&:hover {
|
|
35
|
-
border-color: ${(props) => props.variant === "outlined" ?
|
|
34
|
+
border-color: ${(props) => props.variant === "outlined" ? "var(--stokr-border-default)" : "transparent"};
|
|
36
35
|
}
|
|
37
36
|
`;
|
|
38
37
|
const SearchIconWrapper = styled.div`
|
|
@@ -40,7 +39,7 @@ const SearchIconWrapper = styled.div`
|
|
|
40
39
|
align-items: center;
|
|
41
40
|
justify-content: center;
|
|
42
41
|
margin-right: 12px;
|
|
43
|
-
color:
|
|
42
|
+
color: var(--stokr-text-tertiary);
|
|
44
43
|
flex-shrink: 0;
|
|
45
44
|
width: 16px;
|
|
46
45
|
height: 16px;
|
|
@@ -51,7 +50,7 @@ const SearchIconWrapper = styled.div`
|
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
${SearchInputWrapper}:focus-within & {
|
|
54
|
-
color:
|
|
53
|
+
color: var(--stokr-text-primary);
|
|
55
54
|
}
|
|
56
55
|
`;
|
|
57
56
|
const SearchInputField = styled.input`
|
|
@@ -62,13 +61,13 @@ const SearchInputField = styled.input`
|
|
|
62
61
|
font-size: 14px;
|
|
63
62
|
font-weight: 400;
|
|
64
63
|
line-height: 18px;
|
|
65
|
-
color:
|
|
64
|
+
color: var(--stokr-text-primary);
|
|
66
65
|
width: 100%;
|
|
67
66
|
min-width: 0;
|
|
68
67
|
letter-spacing: 0.6px;
|
|
69
68
|
|
|
70
69
|
&::placeholder {
|
|
71
|
-
color:
|
|
70
|
+
color: var(--stokr-text-tertiary);
|
|
72
71
|
opacity: 1;
|
|
73
72
|
}
|
|
74
73
|
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useMemo } from "react";
|
|
2
|
+
import { useState, useMemo, useRef, useEffect } from "react";
|
|
3
3
|
import { Wrapper, Label } from "./Input.styles.js";
|
|
4
4
|
import { MaterialIcon } from "../MaterialIcon/MaterialIcon.js";
|
|
5
5
|
import { OptionCheckbox } from "../Checkbox/OptionCheckbox.js";
|
|
6
6
|
import CreatableSelect from "react-select/creatable";
|
|
7
7
|
import ReactSelect, { components } from "react-select";
|
|
8
|
-
import { colors } from "../../styles/colors.js";
|
|
9
8
|
import { BORDERED_BORDER } from "../../styles/borderedField.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { SelectValueContainer, SelectWrapper } from "./Select.styles.js";
|
|
9
|
+
import { borderedControlCss, SelectedChipsWrapper, SelectedChipsTitle, SelectedChipsList, SelectedChip, SelectedChipLabel, SelectedChipRemove, OptionRow, OptionLabel, SelectMenuList, SelectIcon, SelectContainer, SelectControl, OptionIcon } from "./Select.styles.js";
|
|
10
|
+
import { SelectMenu, SelectOption, SelectValueContainer, SelectWrapper } from "./Select.styles.js";
|
|
13
11
|
const renderIcon = (icon, variant) => {
|
|
14
12
|
if (!icon) return null;
|
|
15
13
|
if (typeof icon === "string") {
|
|
@@ -24,12 +22,12 @@ const buildBorderedOptionStyle = (_base, state) => asStyle({
|
|
|
24
22
|
fontSize: 14,
|
|
25
23
|
lineHeight: "20px",
|
|
26
24
|
border: 0,
|
|
27
|
-
color:
|
|
25
|
+
color: "var(--stokr-text-primary)",
|
|
28
26
|
transition: "background-color 0.12s ease",
|
|
29
27
|
fontWeight: state.isSelected ? 600 : 400,
|
|
30
|
-
backgroundColor: state.isFocused ?
|
|
28
|
+
backgroundColor: state.isFocused ? "var(--stokr-background-surface)" : "transparent"
|
|
31
29
|
});
|
|
32
|
-
const buildOptionStyle = (multiple) => (
|
|
30
|
+
const buildOptionStyle = (multiple) => (base, state) => {
|
|
33
31
|
if (multiple) {
|
|
34
32
|
return asStyle({
|
|
35
33
|
cursor: "pointer",
|
|
@@ -37,16 +35,19 @@ const buildOptionStyle = (multiple) => (_base, state) => {
|
|
|
37
35
|
fontSize: 13,
|
|
38
36
|
lineHeight: "18px",
|
|
39
37
|
border: 0,
|
|
40
|
-
color: "
|
|
38
|
+
color: "var(--stokr-text-primary)",
|
|
41
39
|
transition: "background-color 0.12s ease",
|
|
42
40
|
fontWeight: state.isSelected ? 600 : 400,
|
|
43
|
-
backgroundColor: state.isSelected ? "
|
|
41
|
+
backgroundColor: state.isSelected ? "var(--stokr-action-secondary-bg)" : state.isFocused ? "var(--stokr-background-surface)" : "transparent"
|
|
44
42
|
});
|
|
45
43
|
}
|
|
46
44
|
return asStyle({
|
|
47
|
-
...
|
|
45
|
+
...base,
|
|
48
46
|
cursor: "pointer",
|
|
49
|
-
|
|
47
|
+
color: "var(--stokr-text-primary)",
|
|
48
|
+
backgroundColor: "transparent",
|
|
49
|
+
fontWeight: state.isSelected || state.isFocused ? "bold" : "normal",
|
|
50
|
+
":active": { backgroundColor: "var(--stokr-action-secondary-bg)" }
|
|
50
51
|
});
|
|
51
52
|
};
|
|
52
53
|
const extrasOf = (props) => props.selectProps;
|
|
@@ -61,17 +62,28 @@ const ControlWithDataCy = (props) => {
|
|
|
61
62
|
if (!cy) return /* @__PURE__ */ jsx(components.Control, { ...props });
|
|
62
63
|
return /* @__PURE__ */ jsx(components.Control, { ...props, innerProps: { ...props.innerProps, "data-cy": cy } });
|
|
63
64
|
};
|
|
65
|
+
const useScrollIntoViewWhenFocused = (isFocused) => {
|
|
66
|
+
const ref = useRef(null);
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
if (isFocused) ref.current?.scrollIntoView?.({ block: "nearest" });
|
|
69
|
+
}, [isFocused]);
|
|
70
|
+
return ref;
|
|
71
|
+
};
|
|
64
72
|
const SingleOption = (props) => {
|
|
65
73
|
const variant = extrasOf(props).variant;
|
|
66
|
-
|
|
74
|
+
const ref = useScrollIntoViewWhenFocused(props.isFocused);
|
|
75
|
+
return /* @__PURE__ */ jsx(components.Option, { ...props, children: /* @__PURE__ */ jsxs(OptionRow, { ref, children: [
|
|
67
76
|
renderIcon(props.data?.icon, variant),
|
|
68
77
|
/* @__PURE__ */ jsx(OptionLabel, { children: props.label })
|
|
69
78
|
] }) });
|
|
70
79
|
};
|
|
71
|
-
const MultiOption = (props) =>
|
|
72
|
-
|
|
73
|
-
/* @__PURE__ */ jsx(
|
|
74
|
-
|
|
80
|
+
const MultiOption = (props) => {
|
|
81
|
+
const ref = useScrollIntoViewWhenFocused(props.isFocused);
|
|
82
|
+
return /* @__PURE__ */ jsx(components.Option, { ...props, children: /* @__PURE__ */ jsx(OptionCheckbox, { checked: props.isSelected, children: /* @__PURE__ */ jsxs(OptionRow, { ref, children: [
|
|
83
|
+
renderIcon(props.data?.icon),
|
|
84
|
+
/* @__PURE__ */ jsx(OptionLabel, { children: props.label })
|
|
85
|
+
] }) }) });
|
|
86
|
+
};
|
|
75
87
|
const SingleValueWithIcon = (props) => /* @__PURE__ */ jsx(components.SingleValue, { ...props, children: /* @__PURE__ */ jsxs(OptionRow, { children: [
|
|
76
88
|
renderIcon(props.data?.icon, extrasOf(props).variant),
|
|
77
89
|
/* @__PURE__ */ jsx(OptionLabel, { children: props.data?.label })
|
|
@@ -103,6 +115,8 @@ const Select = (props) => {
|
|
|
103
115
|
...otherProps
|
|
104
116
|
} = props;
|
|
105
117
|
const [hasFocus, setHasFocus] = useState(false);
|
|
118
|
+
const [inputValue, setInputValue] = useState("");
|
|
119
|
+
const [menuIsOpen, setMenuIsOpen] = useState(false);
|
|
106
120
|
const handleFocus = () => {
|
|
107
121
|
onFocus?.({ name, value });
|
|
108
122
|
setHasFocus(true);
|
|
@@ -122,6 +136,10 @@ const Select = (props) => {
|
|
|
122
136
|
}
|
|
123
137
|
onChange?.({ name, value: selected?.value ?? "" });
|
|
124
138
|
};
|
|
139
|
+
const handleInputChange = (text, { action }) => {
|
|
140
|
+
if (multiple && action === "set-value") return;
|
|
141
|
+
setInputValue(text);
|
|
142
|
+
};
|
|
125
143
|
const removeValue = (val) => {
|
|
126
144
|
if (lockedValues.includes(val)) return;
|
|
127
145
|
const arr = Array.isArray(value) ? value.filter((v) => v !== val) : [];
|
|
@@ -139,21 +157,57 @@ const Select = (props) => {
|
|
|
139
157
|
zIndex: 1e3,
|
|
140
158
|
overflow: "hidden",
|
|
141
159
|
border: BORDERED_BORDER,
|
|
142
|
-
borderRadius: radius
|
|
160
|
+
borderRadius: "var(--stokr-radius-lg)",
|
|
143
161
|
boxShadow: "none",
|
|
144
|
-
backgroundColor:
|
|
162
|
+
backgroundColor: "var(--stokr-background-default)"
|
|
145
163
|
}),
|
|
146
164
|
option: buildBorderedOptionStyle,
|
|
147
165
|
valueContainer: (base) => ({ ...base, padding: 0 }),
|
|
148
|
-
singleValue: (base) => ({ ...base, margin: 0, color:
|
|
149
|
-
placeholder: (base) => ({
|
|
150
|
-
|
|
151
|
-
|
|
166
|
+
singleValue: (base) => ({ ...base, margin: 0, color: "var(--stokr-text-primary)" }),
|
|
167
|
+
placeholder: (base, state) => ({
|
|
168
|
+
...base,
|
|
169
|
+
margin: 0,
|
|
170
|
+
color: state.isMulti && state.selectProps.menuIsOpen && state.selectProps.value ? "var(--stokr-text-secondary)" : "var(--stokr-text-tertiary)",
|
|
171
|
+
maxWidth: "100%",
|
|
172
|
+
overflow: "hidden",
|
|
173
|
+
whiteSpace: "nowrap",
|
|
174
|
+
textOverflow: "ellipsis"
|
|
175
|
+
}),
|
|
176
|
+
input: (base) => ({
|
|
177
|
+
...base,
|
|
178
|
+
margin: 0,
|
|
179
|
+
padding: 0,
|
|
180
|
+
color: "var(--stokr-text-primary)"
|
|
181
|
+
}),
|
|
182
|
+
dropdownIndicator: (base) => ({
|
|
183
|
+
...base,
|
|
184
|
+
padding: 0,
|
|
185
|
+
color: "var(--stokr-text-primary)"
|
|
186
|
+
}),
|
|
152
187
|
clearIndicator: (base) => ({ ...base, padding: "0 8px" })
|
|
153
188
|
} : {
|
|
154
189
|
control: () => asStyle(SelectControl),
|
|
155
|
-
menu: (base) =>
|
|
190
|
+
menu: (base) => ({
|
|
191
|
+
...base,
|
|
192
|
+
marginTop: 0,
|
|
193
|
+
zIndex: 1e3,
|
|
194
|
+
backgroundColor: "var(--stokr-background-surface-raised)"
|
|
195
|
+
}),
|
|
156
196
|
option: buildOptionStyle(multiple),
|
|
197
|
+
singleValue: (base, state) => ({
|
|
198
|
+
...base,
|
|
199
|
+
color: state.isDisabled ? "var(--stokr-text-tertiary)" : "var(--stokr-text-primary)"
|
|
200
|
+
}),
|
|
201
|
+
input: (base) => ({ ...base, color: "var(--stokr-text-primary)" }),
|
|
202
|
+
// While open, a multiple select shows who is selected here (see `overview`): readable text, one line.
|
|
203
|
+
placeholder: (base, state) => ({
|
|
204
|
+
...base,
|
|
205
|
+
color: state.isMulti && state.selectProps.menuIsOpen && state.selectProps.value ? "var(--stokr-text-secondary)" : "var(--stokr-text-tertiary)",
|
|
206
|
+
maxWidth: "100%",
|
|
207
|
+
overflow: "hidden",
|
|
208
|
+
whiteSpace: "nowrap",
|
|
209
|
+
textOverflow: "ellipsis"
|
|
210
|
+
}),
|
|
157
211
|
selectContainer: () => asStyle(SelectContainer),
|
|
158
212
|
valueContainer: (base) => ({ ...base, padding: 0 })
|
|
159
213
|
},
|
|
@@ -186,7 +240,9 @@ const Select = (props) => {
|
|
|
186
240
|
return currentValue != null && currentValue.value !== "";
|
|
187
241
|
}, [multiple, currentValue, selectedOptions.length]);
|
|
188
242
|
const isLabelUp = floatingLabel ? hasFocus || hasValue : Boolean(label);
|
|
189
|
-
const
|
|
243
|
+
const ownPlaceholder = label && !bordered ? hasFocus && placeholder ? placeholder : "" : placeholder;
|
|
244
|
+
const overview = multiple && menuIsOpen && selectedOptions.length > 0 ? `${selectedLabel} (${selectedOptions.length}): ${selectedOptions.map((opt) => typeof opt.label === "string" ? opt.label : String(opt.value)).join(", ")}` : null;
|
|
245
|
+
const effectivePlaceholder = overview ?? ownPlaceholder;
|
|
190
246
|
return /* @__PURE__ */ jsxs(Wrapper, { children: [
|
|
191
247
|
label && /* @__PURE__ */ jsx(Label, { isUp: isLabelUp, active: hasFocus, error: error && touched, htmlFor: id, $variant: variant, children: label }),
|
|
192
248
|
/* @__PURE__ */ jsx(
|
|
@@ -199,6 +255,16 @@ const Select = (props) => {
|
|
|
199
255
|
value: currentValue,
|
|
200
256
|
placeholder: effectivePlaceholder,
|
|
201
257
|
isMulti: multiple,
|
|
258
|
+
inputValue,
|
|
259
|
+
onInputChange: handleInputChange,
|
|
260
|
+
onMenuOpen: () => {
|
|
261
|
+
setMenuIsOpen(true);
|
|
262
|
+
otherProps.onMenuOpen?.();
|
|
263
|
+
},
|
|
264
|
+
onMenuClose: () => {
|
|
265
|
+
setMenuIsOpen(false);
|
|
266
|
+
otherProps.onMenuClose?.();
|
|
267
|
+
},
|
|
202
268
|
isDisabled: disabled,
|
|
203
269
|
isSearchable: search,
|
|
204
270
|
isClearable: !multiple,
|
|
@@ -76,11 +76,11 @@ export declare const SelectedChipRemove: import('styled-components/dist/types').
|
|
|
76
76
|
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
77
77
|
}, {
|
|
78
78
|
$variant?: FieldVariant;
|
|
79
|
-
}>, "hidden" | "color" | "content" | "style" | "disabled" | "form" | "slot" | "title" | "ref" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "
|
|
79
|
+
}>, "name" | "hidden" | "color" | "content" | "style" | "disabled" | "form" | "slot" | "title" | "ref" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "value" | "type" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget"> & Partial<Pick<import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style"> & {
|
|
80
80
|
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
81
81
|
}, {
|
|
82
82
|
$variant?: FieldVariant;
|
|
83
|
-
}>, "hidden" | "color" | "content" | "style" | "disabled" | "form" | "slot" | "title" | "ref" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "
|
|
83
|
+
}>, "name" | "hidden" | "color" | "content" | "style" | "disabled" | "form" | "slot" | "title" | "ref" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "value" | "type" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget">>> & string;
|
|
84
84
|
export declare const SelectWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
85
85
|
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
86
86
|
}, {
|
|
@@ -3,9 +3,7 @@ import { TrackV } from "../ComponentScroll/ComponentScroll.styles.js";
|
|
|
3
3
|
import stdin_default from "../ComponentScroll/ComponentScroll.js";
|
|
4
4
|
import { glyph } from "../MaterialIcon/glyph.js";
|
|
5
5
|
import { borderedFieldBox, borderedFieldText, borderedFieldFocus, borderedFieldError, borderedFieldDisabled } from "../../styles/borderedField.js";
|
|
6
|
-
import {
|
|
7
|
-
import { space } from "../../styles/spacing.js";
|
|
8
|
-
import { typography } from "../../styles/typography.js";
|
|
6
|
+
import { text } from "../../design-system/styled/text.js";
|
|
9
7
|
const SelectControl = css`
|
|
10
8
|
&&& {
|
|
11
9
|
z-index: 10 !important;
|
|
@@ -23,8 +21,8 @@ const SelectControl = css`
|
|
|
23
21
|
box-shadow: none;
|
|
24
22
|
border: 0;
|
|
25
23
|
border-top: 1px solid transparent;
|
|
26
|
-
border-bottom: 1px solid
|
|
27
|
-
color:
|
|
24
|
+
border-bottom: 1px solid var(--stokr-border-subtle);
|
|
25
|
+
color: var(--stokr-text-primary);
|
|
28
26
|
background-color: transparent;
|
|
29
27
|
transition: border-color 0.2s;
|
|
30
28
|
cursor: pointer;
|
|
@@ -32,7 +30,7 @@ const SelectControl = css`
|
|
|
32
30
|
&:hover {
|
|
33
31
|
box-shadow: none;
|
|
34
32
|
border-top-color: transparent;
|
|
35
|
-
border-bottom-color:
|
|
33
|
+
border-bottom-color: var(--stokr-border-focus);
|
|
36
34
|
}
|
|
37
35
|
|
|
38
36
|
&.active {
|
|
@@ -101,9 +99,9 @@ const SelectMenu = css`
|
|
|
101
99
|
border-radius: 0;
|
|
102
100
|
box-shadow: none;
|
|
103
101
|
border: 0;
|
|
104
|
-
border-top: 1px solid
|
|
105
|
-
border-bottom: 1px solid
|
|
106
|
-
background-color:
|
|
102
|
+
border-top: 1px solid var(--stokr-border-subtle) !important;
|
|
103
|
+
border-bottom: 1px solid var(--stokr-border-subtle) !important;
|
|
104
|
+
background-color: var(--stokr-background-surface-raised);
|
|
107
105
|
opacity: 999 !important;
|
|
108
106
|
`;
|
|
109
107
|
const SelectMenuList = styled(stdin_default)`
|
|
@@ -123,7 +121,7 @@ const SelectOption = css`
|
|
|
123
121
|
line-height: 18px;
|
|
124
122
|
border: 0;
|
|
125
123
|
background-color: transparent;
|
|
126
|
-
color:
|
|
124
|
+
color: var(--stokr-text-primary);
|
|
127
125
|
|
|
128
126
|
&:hover {
|
|
129
127
|
background-color: transparent;
|
|
@@ -152,7 +150,7 @@ const SelectIcon = styled.span.withConfig({
|
|
|
152
150
|
font-size: 18px;
|
|
153
151
|
transition: 0.3s transform;
|
|
154
152
|
transform: rotate(0);
|
|
155
|
-
color:
|
|
153
|
+
color: var(--stokr-text-primary);
|
|
156
154
|
|
|
157
155
|
${(props) => props.isMenuOpen && `
|
|
158
156
|
transform: rotate(180deg);
|
|
@@ -200,20 +198,20 @@ const OptionLabel = styled.span`
|
|
|
200
198
|
text-overflow: ellipsis;
|
|
201
199
|
`;
|
|
202
200
|
const SelectedChipsWrapper = styled.div`
|
|
203
|
-
margin-top: ${(props) => props.$variant === "bordered" ? space
|
|
201
|
+
margin-top: ${(props) => props.$variant === "bordered" ? "var(--stokr-space-4)" : "18px"};
|
|
204
202
|
`;
|
|
205
203
|
const SelectedChipsTitle = styled.div`
|
|
206
204
|
font-size: 11px;
|
|
207
205
|
letter-spacing: 1.5px;
|
|
208
206
|
text-transform: uppercase;
|
|
209
|
-
color:
|
|
207
|
+
color: var(--stokr-text-secondary);
|
|
210
208
|
margin-bottom: 8px;
|
|
211
209
|
|
|
212
210
|
${(props) => props.$variant === "bordered" && css`
|
|
213
|
-
margin-bottom:
|
|
211
|
+
margin-bottom: var(--stokr-space-1);
|
|
214
212
|
line-height: 16px;
|
|
215
213
|
letter-spacing: 2px;
|
|
216
|
-
color:
|
|
214
|
+
color: var(--stokr-text-secondary);
|
|
217
215
|
`}
|
|
218
216
|
`;
|
|
219
217
|
const SelectedChipsList = styled.div`
|
|
@@ -226,20 +224,20 @@ const SelectedChip = styled.div`
|
|
|
226
224
|
align-items: center;
|
|
227
225
|
gap: 8px;
|
|
228
226
|
padding: 6px 10px;
|
|
229
|
-
border: 1px solid
|
|
227
|
+
border: 1px solid var(--stokr-border-subtle);
|
|
230
228
|
border-radius: 20px;
|
|
231
|
-
background-color:
|
|
229
|
+
background-color: var(--stokr-background-default);
|
|
232
230
|
font-size: 12px;
|
|
233
231
|
line-height: 16px;
|
|
234
|
-
color:
|
|
232
|
+
color: var(--stokr-text-primary);
|
|
235
233
|
|
|
236
234
|
${(props) => props.$variant === "bordered" && css`
|
|
237
235
|
gap: 6px;
|
|
238
|
-
padding:
|
|
239
|
-
border-color:
|
|
236
|
+
padding: var(--stokr-space-1) var(--stokr-space-2) var(--stokr-space-1) var(--stokr-space-3);
|
|
237
|
+
border-color: var(--stokr-border-subtle);
|
|
240
238
|
border-radius: 48px;
|
|
241
|
-
${
|
|
242
|
-
color:
|
|
239
|
+
${text("buttonLabel")}
|
|
240
|
+
color: var(--stokr-text-primary);
|
|
243
241
|
`}
|
|
244
242
|
`;
|
|
245
243
|
const SelectedChipLabel = styled.span`
|
|
@@ -254,24 +252,24 @@ const SelectedChipRemove = styled.button.attrs({ type: "button" })`
|
|
|
254
252
|
padding: 0;
|
|
255
253
|
margin: 0 0 0 2px;
|
|
256
254
|
cursor: pointer;
|
|
257
|
-
color:
|
|
255
|
+
color: var(--stokr-text-tertiary);
|
|
258
256
|
font-size: 14px;
|
|
259
257
|
line-height: 1;
|
|
260
258
|
width: 14px;
|
|
261
259
|
height: 14px;
|
|
262
260
|
|
|
263
261
|
&:hover {
|
|
264
|
-
color:
|
|
262
|
+
color: var(--stokr-text-primary);
|
|
265
263
|
}
|
|
266
264
|
|
|
267
265
|
${(props) => props.$variant === "bordered" && css`
|
|
268
266
|
width: 16px;
|
|
269
267
|
height: 16px;
|
|
270
268
|
margin: 0;
|
|
271
|
-
color:
|
|
269
|
+
color: var(--stokr-text-primary);
|
|
272
270
|
|
|
273
271
|
&:hover {
|
|
274
|
-
color:
|
|
272
|
+
color: var(--stokr-text-primary);
|
|
275
273
|
}
|
|
276
274
|
|
|
277
275
|
&:disabled {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ComponentType, HTMLAttributes, ReactNode, SVGProps } from 'react';
|
|
2
|
+
export interface TableFilterOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export interface TableFilterDropdownProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
7
|
+
/** Label text displayed next to the filter icon */
|
|
8
|
+
label?: string;
|
|
9
|
+
/** Array of options to display */
|
|
10
|
+
options: TableFilterOption[];
|
|
11
|
+
/** Array of selected values */
|
|
12
|
+
value?: string[];
|
|
13
|
+
/** Callback when selection changes: (newValues) => void */
|
|
14
|
+
onChange?: (newValues: string[]) => void;
|
|
15
|
+
/** Custom icon component (defaults to FilterIcon) */
|
|
16
|
+
icon?: ComponentType<SVGProps<SVGSVGElement>>;
|
|
17
|
+
/** Minimum width of the dropdown menu */
|
|
18
|
+
minWidth?: number;
|
|
19
|
+
/** Maximum width of the dropdown menu */
|
|
20
|
+
maxWidth?: number;
|
|
21
|
+
/** Alignment of the dropdown menu */
|
|
22
|
+
menuAlign?: 'left' | 'right';
|
|
23
|
+
/** Top offset for the dropdown menu in pixels (default: 8) */
|
|
24
|
+
menuTop?: number;
|
|
25
|
+
/** Show "Clear all" option at the bottom of the list */
|
|
26
|
+
showClearAll?: boolean;
|
|
27
|
+
/** Custom text for the "Clear all" option */
|
|
28
|
+
clearAllText?: string;
|
|
29
|
+
/** Override default `table-filter-{label}` data-cy on trigger */
|
|
30
|
+
dataCy?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare const TableFilterDropdown: ({ label, options, value, onChange, icon: CustomIcon, minWidth, maxWidth, menuAlign, menuTop, showClearAll, clearAllText, dataCy, ...props }: TableFilterDropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export default TableFilterDropdown;
|