@granto-umbrella/umbrella-components 3.0.33 → 3.0.36
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 +165 -27
- package/dist/umbrella-components.css +1 -1
- package/dist/umbrella-components.es.js +28129 -29249
- package/dist/umbrella-components.umd.js +1234 -2181
- package/package.json +135 -106
- package/src/assets.d.ts +19 -19
- package/src/components/atoms/Badge/Badge.styles.ts +88 -86
- package/src/components/atoms/Badge/Badge.tsx +42 -44
- package/src/components/atoms/Badge/Badge.types.ts +15 -15
- package/src/components/atoms/Breadcrumb/Breadcrumb.styles.ts +43 -43
- package/src/components/atoms/Breadcrumb/Breadcrumb.tsx +46 -48
- package/src/components/atoms/Breadcrumb/Breadcrumb.types.ts +12 -12
- package/src/components/atoms/Button/Button.styles.ts +279 -280
- package/src/components/atoms/Button/Button.tsx +76 -76
- package/src/components/atoms/Button/Button.types.ts +28 -28
- package/src/components/atoms/Button/index.ts +1 -1
- package/src/components/atoms/Checkbox/Checkbox.styles.ts +72 -72
- package/src/components/atoms/Checkbox/Checkbox.tsx +36 -36
- package/src/components/atoms/Checkbox/Checkbox.types.ts +14 -14
- package/src/components/atoms/Checkbox/CheckboxGroup.tsx +30 -30
- package/src/components/atoms/Checkbox/CheckboxSelectAll.tsx +32 -32
- package/src/components/atoms/CodeInput/CodeInput.styles.tsx +38 -39
- package/src/components/atoms/CodeInput/CodeInput.tsx +13 -19
- package/src/components/atoms/CodeInput/CodeInput.types.ts +3 -3
- package/src/components/atoms/CodeInput/index.tsx +1 -1
- package/src/components/atoms/DropDownMenu/DropdownMenu.tsx +48 -48
- package/src/components/atoms/DropDownMenu/DropdownMenu.types.ts +15 -15
- package/src/components/atoms/DropDownMenu/index.tsx +5 -2
- package/src/components/atoms/ErrorMessage/ErrorMessage.styles.tsx +28 -28
- package/src/components/atoms/ErrorMessage/ErrorMessage.tsx +12 -12
- package/src/components/atoms/ErrorMessage/ErrorMessage.types.ts +6 -6
- package/src/components/atoms/ErrorMessage/index.tsx +1 -1
- package/src/components/atoms/Footer/Footer.styles.tsx +22 -22
- package/src/components/atoms/Footer/Footer.tsx +9 -9
- package/src/components/atoms/Footer/Footer.types.tsx +5 -5
- package/src/components/atoms/Footer/index.tsx +1 -1
- package/src/components/atoms/GenericContainer/GenericContainer.styles.tsx +21 -21
- package/src/components/atoms/GenericContainer/GenericContainer.tsx +9 -9
- package/src/components/atoms/GenericContainer/GenericContainer.types.ts +5 -5
- package/src/components/atoms/GenericContainer/index.tsx +1 -1
- package/src/components/atoms/Icon/Icon.styles.ts +11 -11
- package/src/components/atoms/Icon/Icon.tsx +22 -22
- package/src/components/atoms/Icon/Icon.types.ts +6 -6
- package/src/components/atoms/Icon/index.ts +1 -1
- package/src/components/atoms/Input/Input.styles.ts +106 -101
- package/src/components/atoms/Input/index.ts +1 -1
- package/src/components/atoms/Label/Label.tsx +16 -16
- package/src/components/atoms/Loading/Loading.styles.tsx +25 -23
- package/src/components/atoms/Loading/Loading.tsx +8 -8
- package/src/components/atoms/LogoContainer/LogoContainer.Types.tsx +5 -5
- package/src/components/atoms/LogoContainer/LogoContainer.styles.tsx +11 -11
- package/src/components/atoms/LogoContainer/LogoContainer.tsx +11 -11
- package/src/components/atoms/LogoContainer/index.tsx +1 -1
- package/src/components/atoms/ModalAviso/ModalAviso.styles.tsx +56 -55
- package/src/components/atoms/ModalAviso/ModalAviso.tsx +43 -37
- package/src/components/atoms/ModalAviso/ModalAviso.types.ts +5 -5
- package/src/components/atoms/ModalAviso/index.tsx +1 -1
- package/src/components/atoms/MultiSelect/MultiSelect.styles.tsx +100 -92
- package/src/components/atoms/MultiSelect/MultiSelect.tsx +346 -346
- package/src/components/atoms/MultiSelect/MultiSelect.types.ts +38 -38
- package/src/components/atoms/Pill/Pill.styles.ts +46 -46
- package/src/components/atoms/Pill/Pill.tsx +35 -36
- package/src/components/atoms/Pill/Pill.types.ts +14 -18
- package/src/components/atoms/RadioButton/RadioButton.styles.ts +44 -43
- package/src/components/atoms/RadioButton/RadioButton.tsx +31 -31
- package/src/components/atoms/ResendLink/ResendLink.styles.tsx +19 -20
- package/src/components/atoms/ResendLink/ResendLink.tsx +21 -21
- package/src/components/atoms/ResendLink/ResendLink.types.ts +8 -9
- package/src/components/atoms/ResendLink/index.tsx +1 -2
- package/src/components/atoms/Select/Select.styles.ts +153 -149
- package/src/components/atoms/Select/Select.tsx +52 -43
- package/src/components/atoms/Select/index.tsx +1 -1
- package/src/components/atoms/Subtitle/Subtitle.tsx +7 -7
- package/src/components/atoms/Subtitle/Subtitle.types.ts +5 -5
- package/src/components/atoms/Subtitle/index.tsx +1 -1
- package/src/components/atoms/Switch/Switch.tsx +25 -25
- package/src/components/atoms/TabBar/TabBar.styles.tsx +64 -57
- package/src/components/atoms/TabBar/index.tsx +2 -2
- package/src/components/atoms/Text/Text.styles.tsx +35 -35
- package/src/components/atoms/Text/Text.tsx +32 -31
- package/src/components/atoms/Text/Text.types.ts +8 -8
- package/src/components/atoms/Text/index.ts +1 -1
- package/src/components/atoms/Textarea/Textarea.styles.ts +52 -52
- package/src/components/atoms/Textarea/Textarea.tsx +31 -31
- package/src/components/atoms/Title/Title.tsx +7 -7
- package/src/components/atoms/Title/Title.types.ts +5 -5
- package/src/components/atoms/Title/index.tsx +1 -1
- package/src/components/molecules/BannerAjuda/BannerAjuda.styles.tsx +9 -9
- package/src/components/molecules/BannerAjuda/BannerAjuda.tsx +18 -19
- package/src/components/molecules/BannerAjuda/index.tsx +1 -1
- package/src/components/molecules/ButtonGroup/ButtonGroup.styles.ts +10 -10
- package/src/components/molecules/ButtonGroup/ButtonGroup.types.ts +22 -22
- package/src/components/molecules/Calendar/Calendar.styles.ts +143 -143
- package/src/components/molecules/Calendar/Calendar.tsx +31 -31
- package/src/components/molecules/CodeInputContainer/CodeInputContainer.styles.tsx +7 -7
- package/src/components/molecules/CodeInputContainer/CodeInputContainer.types.ts +13 -13
- package/src/components/molecules/CodeInputContainer/index.tsx +1 -3
- package/src/components/molecules/ExcludeModal/ExcludeModal.styles.tsx +123 -118
- package/src/components/molecules/ExcludeModal/ExcludeModal.tsx +48 -48
- package/src/components/molecules/ExcludeModal/ExcludeModal.types.ts +10 -10
- package/src/components/molecules/ExcludeModal/index.tsx +1 -1
- package/src/components/molecules/FieldSelector/FieldSelector.styles.ts +59 -0
- package/src/components/molecules/FieldSelector/FieldSelector.tsx +167 -0
- package/src/components/molecules/HighlightsCard/HighlightsCard.styles.tsx +67 -68
- package/src/components/molecules/HighlightsCard/HighlightsCard.tsx +35 -26
- package/src/components/molecules/HighlightsCard/HighlightsCard.types.ts +10 -10
- package/src/components/molecules/HighlightsCard/index.tsx +1 -1
- package/src/components/molecules/InsuranceCard/InsuranceCard.styles.tsx +237 -237
- package/src/components/molecules/InsuranceCard/index.tsx +1 -1
- package/src/components/molecules/PieChartComponent/PieChartComponent.styles.tsx +7 -8
- package/src/components/molecules/PieChartComponent/PieChartComponent.tsx +70 -73
- package/src/components/molecules/PieChartComponent/PieChartComponent.types.ts +11 -11
- package/src/components/molecules/PieChartComponent/index.tsx +1 -1
- package/src/components/molecules/Popover/Popover.styles.ts +66 -65
- package/src/components/molecules/Popover/Popover.tsx +23 -23
- package/src/components/molecules/RadioBoxGroup/RadioBoxGroup.styles.ts +11 -11
- package/src/components/molecules/RadioBoxGroup/RadioBoxGroup.tsx +43 -43
- package/src/components/molecules/RadioGroupField/RadioGroupField.styles.tsx +65 -64
- package/src/components/molecules/RadioGroupField/RadioGroupField.tsx +69 -69
- package/src/components/molecules/RadioGroupField/RadioGroupField.types.ts +17 -17
- package/src/components/molecules/RadioGroupField/index.tsx +1 -1
- package/src/components/molecules/RefuseModal/RefuseModal.styles.tsx +139 -139
- package/src/components/molecules/RefuseModal/RefuseModal.tsx +92 -76
- package/src/components/molecules/RefuseModal/RefuseModal.types.ts +15 -15
- package/src/components/molecules/RefuseModal/index.tsx +2 -2
- package/src/components/molecules/ResultsChart/ResultsChart.tsx +23 -19
- package/src/components/molecules/ResultsChart/ResultsChart.types.ts +3 -3
- package/src/components/molecules/ResultsChart/index.tsx +2 -2
- package/src/components/molecules/TabToggle/TabToggle.styles.ts +54 -54
- package/src/components/molecules/TabToggle/TabToggle.tsx +35 -35
- package/src/components/organisms/AlertDialog/AlertDialog.styles.tsx +61 -61
- package/src/components/organisms/AlertDialog/AlertDialog.tsx +70 -70
- package/src/components/organisms/Dialog/Dialog.styles.ts +107 -106
- package/src/components/organisms/Dialog/Dialog.tsx +69 -69
- package/src/components/organisms/DonutEmissionsChart/DonutEmissionsChart.styles.tsx +113 -113
- package/src/components/organisms/DonutEmissionsChart/DonutEmissionsChart.tsx +75 -71
- package/src/components/organisms/DonutEmissionsChart/DonutEmissionsChart.types.ts +9 -9
- package/src/components/organisms/DonutEmissionsChart/index.tsx +5 -2
- package/src/components/organisms/Form/Form.styles.ts +35 -35
- package/src/components/organisms/Form/Form.tsx +160 -160
- package/src/components/organisms/ListagemUltimasEmissoes/ListagemUltimasEmissoes.styles.tsx +115 -114
- package/src/components/organisms/ListagemUltimasEmissoes/ListagemUltimasEmissoes.tsx +89 -89
- package/src/components/organisms/ListagemUltimasEmissoes/ListagemUltimasEmissoes.types.ts +16 -16
- package/src/components/organisms/ListagemUltimasEmissoes/index.tsx +1 -1
- package/src/components/organisms/Navbar/Navbar.styles.tsx +243 -243
- package/src/global.d.ts +9 -9
- package/src/index.ts +2 -0
- package/src/lib/utils.ts +6 -6
- package/src/styles/tokens/borders.ts +17 -17
- package/src/styles/tokens/index.tsx +6 -6
- package/src/styles/tokens/radius.ts +22 -22
- package/src/styles/tokens/shadows.ts +22 -22
- package/src/styles/tokens/sizes.ts +60 -64
- package/src/types/radius.types.ts +1 -1
- package/src/types/shadows.types.ts +1 -1
- package/src/utils/renderHighlightsCard.tsx +21 -0
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import type { ReactNode } from
|
|
2
|
-
import type { MultiValue, SingleValue, ActionMeta } from
|
|
3
|
-
|
|
4
|
-
export interface SelectOption {
|
|
5
|
-
label: string
|
|
6
|
-
value: string | number
|
|
7
|
-
picture?: string
|
|
8
|
-
name?: string
|
|
9
|
-
isFixed?: boolean
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface IStyledBaseProps {
|
|
13
|
-
children: ReactNode
|
|
14
|
-
label?: string
|
|
15
|
-
error?: boolean
|
|
16
|
-
errorMessage?: string
|
|
17
|
-
labelSize?: string
|
|
18
|
-
labelWeight?: string
|
|
19
|
-
icon?: ReactNode
|
|
20
|
-
sizeDisplay?: '100' | '75' | '66' | '50' | '33' | '25'
|
|
21
|
-
height?: string
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface SelectProps extends Omit<IStyledBaseProps,
|
|
25
|
-
options: SelectOption[]
|
|
26
|
-
placeholder?: string
|
|
27
|
-
height?: string
|
|
28
|
-
enabledClear?: boolean
|
|
29
|
-
multiple?: boolean
|
|
30
|
-
value?: MultiValue<SelectOption> | SingleValue<SelectOption
|
|
31
|
-
disabled?: boolean
|
|
32
|
-
menuPlacement?:
|
|
33
|
-
defaultValue?: MultiValue<SelectOption> | SingleValue<SelectOption
|
|
34
|
-
setValue?: (
|
|
35
|
-
newValue: MultiValue<SelectOption> | SingleValue<SelectOption>,
|
|
36
|
-
actionMeta: ActionMeta<SelectOption
|
|
37
|
-
) => void
|
|
38
|
-
}
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { MultiValue, SingleValue, ActionMeta } from 'react-select';
|
|
3
|
+
|
|
4
|
+
export interface SelectOption {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string | number;
|
|
7
|
+
picture?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
isFixed?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface IStyledBaseProps {
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
label?: string;
|
|
15
|
+
error?: boolean;
|
|
16
|
+
errorMessage?: string;
|
|
17
|
+
labelSize?: string;
|
|
18
|
+
labelWeight?: string;
|
|
19
|
+
icon?: ReactNode;
|
|
20
|
+
sizeDisplay?: '100' | '75' | '66' | '50' | '33' | '25';
|
|
21
|
+
height?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface SelectProps extends Omit<IStyledBaseProps, 'children'> {
|
|
25
|
+
options: SelectOption[];
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
height?: string;
|
|
28
|
+
enabledClear?: boolean;
|
|
29
|
+
multiple?: boolean;
|
|
30
|
+
value?: MultiValue<SelectOption> | SingleValue<SelectOption>;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
menuPlacement?: 'auto' | 'bottom' | 'top';
|
|
33
|
+
defaultValue?: MultiValue<SelectOption> | SingleValue<SelectOption>;
|
|
34
|
+
setValue?: (
|
|
35
|
+
newValue: MultiValue<SelectOption> | SingleValue<SelectOption>,
|
|
36
|
+
actionMeta: ActionMeta<SelectOption>
|
|
37
|
+
) => void;
|
|
38
|
+
}
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import styled, { css } from
|
|
2
|
-
import {
|
|
3
|
-
semanticColors,
|
|
4
|
-
semanticSizes,
|
|
5
|
-
semanticRadius,
|
|
6
|
-
typographyTokens,
|
|
7
|
-
} from
|
|
8
|
-
|
|
9
|
-
const pillVariants = {
|
|
10
|
-
tradicional: css`
|
|
11
|
-
background: ${semanticColors.info.surface.pills.tradicional};
|
|
12
|
-
color: ${semanticColors.info.text.pills.tradicional};
|
|
13
|
-
`,
|
|
14
|
-
supply: css`
|
|
15
|
-
background: ${semanticColors.warning.surface.pills.supply};
|
|
16
|
-
color: ${semanticColors.warning.text.pills.supply};
|
|
17
|
-
`,
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const pillSizes = {
|
|
21
|
-
sm: css`
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
font-size: ${typographyTokens.fontSizes.captionM};
|
|
25
|
-
`,
|
|
26
|
-
md: css`
|
|
27
|
-
padding: ${semanticSizes.global.padding.sm}
|
|
28
|
-
|
|
29
|
-
font-size: ${typographyTokens.fontSizes.labelM};
|
|
30
|
-
`,
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const StyledPill = styled.span<{
|
|
34
|
-
$size?: keyof typeof pillSizes;
|
|
35
|
-
$variant?: keyof typeof pillVariants;
|
|
36
|
-
$radius: keyof typeof semanticRadius.global.radius;
|
|
37
|
-
}>`
|
|
38
|
-
display: inline-flex;
|
|
39
|
-
align-items: center;
|
|
40
|
-
gap: ${semanticSizes.global.gap.xs};
|
|
41
|
-
font-weight: 500;
|
|
42
|
-
border-radius: ${semanticRadius.global.radius.full};
|
|
43
|
-
|
|
44
|
-
${({ $size =
|
|
45
|
-
${({ $variant =
|
|
46
|
-
`;
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import {
|
|
3
|
+
semanticColors,
|
|
4
|
+
semanticSizes,
|
|
5
|
+
semanticRadius,
|
|
6
|
+
typographyTokens,
|
|
7
|
+
} from '../../../styles/tokens';
|
|
8
|
+
|
|
9
|
+
const pillVariants = {
|
|
10
|
+
tradicional: css`
|
|
11
|
+
background: ${semanticColors.info.surface.pills.tradicional};
|
|
12
|
+
color: ${semanticColors.info.text.pills.tradicional};
|
|
13
|
+
`,
|
|
14
|
+
supply: css`
|
|
15
|
+
background: ${semanticColors.warning.surface.pills.supply};
|
|
16
|
+
color: ${semanticColors.warning.text.pills.supply};
|
|
17
|
+
`,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const pillSizes = {
|
|
21
|
+
sm: css`
|
|
22
|
+
padding: ${semanticSizes.global.padding.xs}
|
|
23
|
+
${semanticSizes.global.padding.sm};
|
|
24
|
+
font-size: ${typographyTokens.fontSizes.captionM};
|
|
25
|
+
`,
|
|
26
|
+
md: css`
|
|
27
|
+
padding: ${semanticSizes.global.padding.sm}
|
|
28
|
+
${semanticSizes.global.padding.md};
|
|
29
|
+
font-size: ${typographyTokens.fontSizes.labelM};
|
|
30
|
+
`,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const StyledPill = styled.span<{
|
|
34
|
+
$size?: keyof typeof pillSizes;
|
|
35
|
+
$variant?: keyof typeof pillVariants;
|
|
36
|
+
$radius: keyof typeof semanticRadius.global.radius;
|
|
37
|
+
}>`
|
|
38
|
+
display: inline-flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
gap: ${semanticSizes.global.gap.xs};
|
|
41
|
+
font-weight: 500;
|
|
42
|
+
border-radius: ${semanticRadius.global.radius.full};
|
|
43
|
+
|
|
44
|
+
${({ $size = 'md' }) => pillSizes[$size]}
|
|
45
|
+
${({ $variant = 'tradicional' }) => pillVariants[$variant]}
|
|
46
|
+
`;
|
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
// Pill.tsx
|
|
2
|
-
|
|
3
|
-
import React from
|
|
4
|
-
import { StyledPill } from
|
|
5
|
-
import { PillProps } from
|
|
6
|
-
import * as Icons from
|
|
7
|
-
|
|
8
|
-
const Pill: React.FC<PillProps> = ({
|
|
9
|
-
children,
|
|
10
|
-
size,
|
|
11
|
-
variant =
|
|
12
|
-
icon,
|
|
13
|
-
onClose,
|
|
14
|
-
}) => {
|
|
15
|
-
// CORREÇÃO: Removemos o 'as keyof typeof Icons' pois o tipo já está correto.
|
|
16
|
-
const IconComponent =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export default Pill;
|
|
1
|
+
// Pill.tsx
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { StyledPill } from './Pill.styles';
|
|
5
|
+
import { PillProps } from './Pill.types';
|
|
6
|
+
import * as Icons from '@phosphor-icons/react';
|
|
7
|
+
|
|
8
|
+
const Pill: React.FC<PillProps> = ({
|
|
9
|
+
children,
|
|
10
|
+
size,
|
|
11
|
+
variant = 'supply',
|
|
12
|
+
icon,
|
|
13
|
+
onClose,
|
|
14
|
+
}) => {
|
|
15
|
+
// CORREÇÃO: Removemos o 'as keyof typeof Icons' pois o tipo já está correto.
|
|
16
|
+
const IconComponent = icon && (Icons[icon] as React.ElementType);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<StyledPill $size={size} $variant={variant} $radius="full">
|
|
20
|
+
{IconComponent && (
|
|
21
|
+
<span className="icon">
|
|
22
|
+
<IconComponent size={16} />
|
|
23
|
+
</span>
|
|
24
|
+
)}
|
|
25
|
+
{children}
|
|
26
|
+
{onClose && (
|
|
27
|
+
<span className="close-icon" onClick={onClose}>
|
|
28
|
+
<Icons.X size={16} />
|
|
29
|
+
</span>
|
|
30
|
+
)}
|
|
31
|
+
</StyledPill>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default Pill;
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
size?: "sm" | "md";
|
|
16
|
-
variant?: "tradicional" | "supply";
|
|
17
|
-
onClose?: () => void;
|
|
18
|
-
}
|
|
1
|
+
import * as Icons from '@phosphor-icons/react';
|
|
2
|
+
|
|
3
|
+
export type IconName = keyof typeof Icons;
|
|
4
|
+
|
|
5
|
+
export interface PillProps {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
|
|
8
|
+
icon?: IconName;
|
|
9
|
+
|
|
10
|
+
hasIcon?: boolean;
|
|
11
|
+
size?: 'sm' | 'md';
|
|
12
|
+
variant?: 'tradicional' | 'supply';
|
|
13
|
+
onClose?: () => void;
|
|
14
|
+
}
|
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import {
|
|
3
|
-
primitiveSizes,
|
|
4
|
-
semanticBorders,
|
|
5
|
-
semanticColors,
|
|
6
|
-
semanticSizes,
|
|
7
|
-
typographyTokens,
|
|
8
|
-
} from
|
|
9
|
-
|
|
10
|
-
export const RadioContainer = styled.label`
|
|
11
|
-
display: flex;
|
|
12
|
-
align-items: center;
|
|
13
|
-
gap: ${semanticSizes.global.gap.sm};
|
|
14
|
-
cursor: pointer;
|
|
15
|
-
`;
|
|
16
|
-
|
|
17
|
-
export const StyledRadio = styled.input`
|
|
18
|
-
appearance: none;
|
|
19
|
-
width: ${semanticSizes.global.padding.xl};
|
|
20
|
-
height: ${semanticSizes.global.padding.xl};
|
|
21
|
-
border-radius: 50%;
|
|
22
|
-
border: ${semanticBorders.global.md} solid
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import {
|
|
3
|
+
primitiveSizes,
|
|
4
|
+
semanticBorders,
|
|
5
|
+
semanticColors,
|
|
6
|
+
semanticSizes,
|
|
7
|
+
typographyTokens,
|
|
8
|
+
} from '../../../styles/tokens';
|
|
9
|
+
|
|
10
|
+
export const RadioContainer = styled.label`
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: ${semanticSizes.global.gap.sm};
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
export const StyledRadio = styled.input`
|
|
18
|
+
appearance: none;
|
|
19
|
+
width: ${semanticSizes.global.padding.xl};
|
|
20
|
+
height: ${semanticSizes.global.padding.xl};
|
|
21
|
+
border-radius: 50%;
|
|
22
|
+
border: ${semanticBorders.global.md} solid
|
|
23
|
+
${semanticColors.global.border.medium};
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
transition: all 0.2s ease-in-out;
|
|
28
|
+
|
|
29
|
+
&:checked {
|
|
30
|
+
background-color: ${semanticColors.branding.surface.enabled};
|
|
31
|
+
border-color: ${semanticColors.branding.surface.enabled};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&:disabled {
|
|
35
|
+
border-color: ${semanticColors.global.border.disabled};
|
|
36
|
+
cursor: not-allowed;
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
export const Label = styled.span`
|
|
41
|
+
margin-top: ${primitiveSizes.size.x1};
|
|
42
|
+
font-size: ${typographyTokens.fontSizes.labelM};
|
|
43
|
+
color: ${semanticColors.base.text};
|
|
44
|
+
`;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { RadioButtonProps } from
|
|
3
|
-
import { RadioContainer, StyledRadio, Label } from
|
|
4
|
-
|
|
5
|
-
const RadioButton: React.FC<RadioButtonProps> = ({
|
|
6
|
-
label,
|
|
7
|
-
name,
|
|
8
|
-
value,
|
|
9
|
-
checked,
|
|
10
|
-
onChange,
|
|
11
|
-
disabled = false,
|
|
12
|
-
testId,
|
|
13
|
-
}) => {
|
|
14
|
-
return (
|
|
15
|
-
<RadioContainer>
|
|
16
|
-
<StyledRadio
|
|
17
|
-
data-testid={testId}
|
|
18
|
-
id={testId}
|
|
19
|
-
type="radio"
|
|
20
|
-
name={name}
|
|
21
|
-
value={value}
|
|
22
|
-
checked={checked}
|
|
23
|
-
onChange={onChange}
|
|
24
|
-
disabled={disabled}
|
|
25
|
-
/>
|
|
26
|
-
<Label>{label}</Label>
|
|
27
|
-
</RadioContainer>
|
|
28
|
-
);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export default RadioButton;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RadioButtonProps } from './RadioButton.types';
|
|
3
|
+
import { RadioContainer, StyledRadio, Label } from './RadioButton.styles';
|
|
4
|
+
|
|
5
|
+
const RadioButton: React.FC<RadioButtonProps> = ({
|
|
6
|
+
label,
|
|
7
|
+
name,
|
|
8
|
+
value,
|
|
9
|
+
checked,
|
|
10
|
+
onChange,
|
|
11
|
+
disabled = false,
|
|
12
|
+
testId,
|
|
13
|
+
}) => {
|
|
14
|
+
return (
|
|
15
|
+
<RadioContainer>
|
|
16
|
+
<StyledRadio
|
|
17
|
+
data-testid={testId}
|
|
18
|
+
id={testId}
|
|
19
|
+
type="radio"
|
|
20
|
+
name={name}
|
|
21
|
+
value={value}
|
|
22
|
+
checked={checked}
|
|
23
|
+
onChange={onChange}
|
|
24
|
+
disabled={disabled}
|
|
25
|
+
/>
|
|
26
|
+
<Label>{label}</Label>
|
|
27
|
+
</RadioContainer>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default RadioButton;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import {
|
|
3
|
-
primitiveSizes,
|
|
4
|
-
semanticColors,
|
|
5
|
-
typographyTokens,
|
|
6
|
-
} from
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
`;
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import {
|
|
3
|
+
primitiveSizes,
|
|
4
|
+
semanticColors,
|
|
5
|
+
typographyTokens,
|
|
6
|
+
} from '../../../styles/tokens';
|
|
7
|
+
|
|
8
|
+
export const Container = styled.div<{ disabled?: boolean }>`
|
|
9
|
+
font-size: ${typographyTokens.fontSizes.labelS};
|
|
10
|
+
color: ${({ disabled }) =>
|
|
11
|
+
disabled
|
|
12
|
+
? semanticColors.branding.text.accent.disabled
|
|
13
|
+
: semanticColors.branding.text.accent.enabled};
|
|
14
|
+
text-decoration: none;
|
|
15
|
+
margin-top: ${primitiveSizes.size.x12};
|
|
16
|
+
cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')};
|
|
17
|
+
opacity: ${({ disabled }) => (disabled ? 0.5 : 1)};
|
|
18
|
+
pointer-events: ${({ disabled }) => (disabled ? 'none' : 'auto')};
|
|
19
|
+
`;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Container } from
|
|
3
|
-
import { ResendLinkProps } from
|
|
4
|
-
|
|
5
|
-
export const ResendLink: React.FC<ResendLinkProps> = ({
|
|
6
|
-
children,
|
|
7
|
-
onClick,
|
|
8
|
-
disabled,
|
|
9
|
-
testId
|
|
10
|
-
}) => {
|
|
11
|
-
return (
|
|
12
|
-
<Container
|
|
13
|
-
data-testid={testId}
|
|
14
|
-
id={testId}
|
|
15
|
-
onClick={!disabled ? onClick : undefined}
|
|
16
|
-
disabled={disabled}
|
|
17
|
-
>
|
|
18
|
-
{children}
|
|
19
|
-
</Container>
|
|
20
|
-
);
|
|
21
|
-
};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Container } from './ResendLink.styles';
|
|
3
|
+
import { ResendLinkProps } from './ResendLink.types';
|
|
4
|
+
|
|
5
|
+
export const ResendLink: React.FC<ResendLinkProps> = ({
|
|
6
|
+
children,
|
|
7
|
+
onClick,
|
|
8
|
+
disabled,
|
|
9
|
+
testId,
|
|
10
|
+
}) => {
|
|
11
|
+
return (
|
|
12
|
+
<Container
|
|
13
|
+
data-testid={testId}
|
|
14
|
+
id={testId}
|
|
15
|
+
onClick={!disabled ? onClick : undefined}
|
|
16
|
+
disabled={disabled}
|
|
17
|
+
>
|
|
18
|
+
{children}
|
|
19
|
+
</Container>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
|
|
3
|
-
export interface ResendLinkProps {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
onClick: () => void;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
testId?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
export interface ResendLinkProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
onClick: () => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
testId?: string;
|
|
8
|
+
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { ResendLink } from
|
|
2
|
-
export type { ResendLinkProps } from "./ResendLink.types";
|
|
1
|
+
export { ResendLink } from './ResendLink';
|