@granto-umbrella/umbrella-components 3.0.32 → 3.0.34

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.
Files changed (54) hide show
  1. package/package.json +4 -5
  2. package/src/components/atoms/DatePickerInput/DatePicker.styles.ts +75 -75
  3. package/src/components/atoms/DatePickerInput/DatePickerInput.tsx +154 -154
  4. package/src/components/atoms/DropDownMenu/DropdownMenu.styles.tsx +106 -106
  5. package/src/components/atoms/ErrorMessage/ErrorMessage.styles.tsx +6 -6
  6. package/src/components/atoms/Footer/Footer.styles.tsx +1 -1
  7. package/src/components/atoms/GenericContainer/GenericContainer.styles.tsx +6 -6
  8. package/src/components/atoms/Input/Input.tsx +80 -80
  9. package/src/components/atoms/Input/Input.types.ts +21 -21
  10. package/src/components/atoms/Label/Label.styles.ts +16 -16
  11. package/src/components/atoms/Loading/Loading.styles.tsx +7 -5
  12. package/src/components/atoms/Loading/index.tsx +1 -1
  13. package/src/components/atoms/LogoContainer/LogoContainer.styles.tsx +4 -4
  14. package/src/components/atoms/ModalAviso/ModalAviso.styles.tsx +10 -9
  15. package/src/components/atoms/MultiSelect/index.tsx +1 -1
  16. package/src/components/atoms/RadioButton/RadioButton.types.ts +9 -9
  17. package/src/components/atoms/ResendLink/index.tsx +2 -1
  18. package/src/components/atoms/Select/Select.types.ts +19 -19
  19. package/src/components/atoms/Skeleton/Skeleton.styles.ts +32 -32
  20. package/src/components/atoms/Skeleton/Skeleton.tsx +43 -43
  21. package/src/components/atoms/Skeleton/Skeleton.types.ts +13 -13
  22. package/src/components/atoms/Subtitle/Subtitle.styles.tsx +21 -21
  23. package/src/components/atoms/Switch/Switch.styles.ts +59 -59
  24. package/src/components/atoms/Switch/Switch.types.ts +7 -7
  25. package/src/components/atoms/TabBar/TabBar.tsx +24 -24
  26. package/src/components/atoms/TabBar/TabBar.types.ts +11 -11
  27. package/src/components/atoms/Text/Text.styles.tsx +18 -6
  28. package/src/components/atoms/Text/Text.tsx +9 -4
  29. package/src/components/atoms/Text/Text.types.ts +2 -1
  30. package/src/components/atoms/Textarea/Textarea.types.ts +7 -7
  31. package/src/components/atoms/Title/Title.styles.tsx +17 -17
  32. package/src/components/molecules/BannerAjuda/BannerAjuda.types.ts +5 -5
  33. package/src/components/molecules/ButtonGroup/ButtonGroup.tsx +27 -27
  34. package/src/components/molecules/CodeInputContainer/CodeInputContainer.tsx +32 -32
  35. package/src/components/molecules/HighlightsCard/HighlightsCard.tsx +1 -1
  36. package/src/components/molecules/InsuranceCard/InsuranceCard.styles.tsx +1 -1
  37. package/src/components/molecules/InsuranceCard/InsuranceCard.tsx +455 -455
  38. package/src/components/molecules/InsuranceCard/InsuranceCard.types.ts +41 -41
  39. package/src/components/molecules/ResultsChart/ResultsChart.styles.tsx +26 -26
  40. package/src/components/molecules/TimeLine/TimeLine.mapper.ts +69 -69
  41. package/src/components/molecules/TimeLine/TimeLine.styles.ts +154 -154
  42. package/src/components/molecules/TimeLine/TimeLine.tsx +96 -96
  43. package/src/components/molecules/TimeLine/TimeLine.types.ts +124 -124
  44. package/src/components/organisms/AlertDialog/AlertDialog.types.ts +14 -14
  45. package/src/components/organisms/Navbar/Navbar.styles.tsx +1 -1
  46. package/src/components/organisms/Navbar/Navbar.tsx +118 -118
  47. package/src/components/organisms/Navbar/Navbar.types.ts +34 -34
  48. package/src/components/organisms/TimelineModal/TimelineModal.styles.ts +49 -49
  49. package/src/components/organisms/TimelineModal/TimelineModal.tsx +49 -49
  50. package/src/index.ts +157 -157
  51. package/src/styles/tokens/colors.ts +296 -296
  52. package/src/styles/tokens/typography.ts +161 -161
  53. package/src/types/colors.types.ts +21 -21
  54. package/src/types/sizes.types.ts +4 -4
@@ -1,118 +1,118 @@
1
- import { CaretDown } from 'phosphor-react';
2
- import { Link } from 'react-router-dom';
3
- import {
4
- NavbarContainer,
5
- LogoContainer,
6
- Menu,
7
- UserProfile,
8
- Dropdown,
9
- DropdownItem,
10
- SearchContainer,
11
- SearchWrapper,
12
- SearchIconStyled,
13
- } from './Navbar.styles';
14
-
15
- import { primitiveColors } from '../../../styles/tokens';
16
- import _logoCorp from '../../../assets/_granto_corp_navbar.svg';
17
- import _effecti from '../../../assets/_effecti.svg';
18
- import _barra from '../../../assets/_barra.svg';
19
- import { NavbarComponentProps } from './Navbar.types';
20
-
21
- const NavbarComponent: React.FC<NavbarComponentProps> = ({
22
- user,
23
- isDropdownOpen,
24
- handleDropdownToggle,
25
- handleSearchChange,
26
- showSearch,
27
- menuLinks,
28
- dropdownOptions,
29
- }) => {
30
- const isSDK = user?.isPartner;
31
- const emailInitials = user?.username
32
- ? user.username.slice(0, 2).toUpperCase()
33
- : '';
34
-
35
- return (
36
- <NavbarContainer>
37
- <LogoContainer>
38
- <img src={_logoCorp} alt="umbrella logo" />
39
-
40
- {isSDK && (
41
- <>
42
- <img src={_barra} alt="barra separadora" />
43
- <img style={{ marginTop: 10 }} src={_effecti} alt="effecti logo" />
44
- </>
45
- )}
46
-
47
- <Menu>
48
- {menuLinks.map((link) => (
49
- <Link
50
- key={link.path}
51
- to={link.path}
52
- id={link.id}
53
- data-testid={link.testId}
54
- >
55
- {link.icon && <span style={{ marginRight: 6 }}>{link.icon}</span>}
56
- {link.label}
57
- </Link>
58
- ))}
59
- </Menu>
60
- </LogoContainer>
61
-
62
- {showSearch && (
63
- <SearchWrapper>
64
- <SearchContainer>
65
- <SearchIconStyled className="icon_search" />
66
- <input
67
- className="input_search"
68
- type="text"
69
- placeholder="Pesquise sua apólice"
70
- onInput={handleSearchChange}
71
- />
72
- </SearchContainer>
73
- </SearchWrapper>
74
- )}
75
-
76
- <UserProfile onClick={handleDropdownToggle}>
77
- <div className="avatar">
78
- {user?.img ? (
79
- <img src={user.img} alt={`Logo ${user?.username}`} />
80
- ) : (
81
- <div className="initials">{emailInitials}</div>
82
- )}
83
- </div>
84
- <div className="details">
85
- <span>{user?.username}</span>
86
- <small>{user?.roles ? user.roles[0] : ''}</small>
87
- </div>
88
-
89
- <CaretDown
90
- data-testid="btn_home_usuario"
91
- id="btn_home_usuario"
92
- color={primitiveColors.gray[300]}
93
- />
94
-
95
- {isDropdownOpen && (
96
- <Dropdown>
97
- {dropdownOptions.map((option) => (
98
- <DropdownItem
99
- key={option.label}
100
- onClick={option.onClick}
101
- data-testid={option.testId}
102
- id={option.id}
103
- $type={option?.type || 'default'}
104
- >
105
- {option.icon && (
106
- <span style={{ marginRight: 8 }}>{option.icon}</span>
107
- )}
108
- {option.label}
109
- </DropdownItem>
110
- ))}
111
- </Dropdown>
112
- )}
113
- </UserProfile>
114
- </NavbarContainer>
115
- );
116
- };
117
-
118
- export default NavbarComponent;
1
+ import { CaretDown } from 'phosphor-react';
2
+ import { Link } from 'react-router-dom';
3
+ import {
4
+ NavbarContainer,
5
+ LogoContainer,
6
+ Menu,
7
+ UserProfile,
8
+ Dropdown,
9
+ DropdownItem,
10
+ SearchContainer,
11
+ SearchWrapper,
12
+ SearchIconStyled,
13
+ } from './Navbar.styles';
14
+
15
+ import { primitiveColors } from '../../../styles/tokens';
16
+ import _logoCorp from '../../../assets/_granto_corp_navbar.svg';
17
+ import _effecti from '../../../assets/_effecti.svg';
18
+ import _barra from '../../../assets/_barra.svg';
19
+ import { NavbarComponentProps } from './Navbar.types';
20
+
21
+ const NavbarComponent: React.FC<NavbarComponentProps> = ({
22
+ user,
23
+ isDropdownOpen,
24
+ handleDropdownToggle,
25
+ handleSearchChange,
26
+ showSearch,
27
+ menuLinks,
28
+ dropdownOptions,
29
+ }) => {
30
+ const isSDK = user?.isPartner;
31
+ const emailInitials = user?.username
32
+ ? user.username.slice(0, 2).toUpperCase()
33
+ : '';
34
+
35
+ return (
36
+ <NavbarContainer>
37
+ <LogoContainer>
38
+ <img src={_logoCorp} alt="umbrella logo" />
39
+
40
+ {isSDK && (
41
+ <>
42
+ <img src={_barra} alt="barra separadora" />
43
+ <img style={{ marginTop: 10 }} src={_effecti} alt="effecti logo" />
44
+ </>
45
+ )}
46
+
47
+ <Menu>
48
+ {menuLinks.map((link) => (
49
+ <Link
50
+ key={link.path}
51
+ to={link.path}
52
+ id={link.id}
53
+ data-testid={link.testId}
54
+ >
55
+ {link.icon && <span style={{ marginRight: 6 }}>{link.icon}</span>}
56
+ {link.label}
57
+ </Link>
58
+ ))}
59
+ </Menu>
60
+ </LogoContainer>
61
+
62
+ {showSearch && (
63
+ <SearchWrapper>
64
+ <SearchContainer>
65
+ <SearchIconStyled className="icon_search" />
66
+ <input
67
+ className="input_search"
68
+ type="text"
69
+ placeholder="Pesquise sua apólice"
70
+ onInput={handleSearchChange}
71
+ />
72
+ </SearchContainer>
73
+ </SearchWrapper>
74
+ )}
75
+
76
+ <UserProfile onClick={handleDropdownToggle}>
77
+ <div className="avatar">
78
+ {user?.img ? (
79
+ <img src={user.img} alt={`Logo ${user?.username}`} />
80
+ ) : (
81
+ <div className="initials">{emailInitials}</div>
82
+ )}
83
+ </div>
84
+ <div className="details">
85
+ <span>{user?.username}</span>
86
+ <small>{user?.roles ? user.roles[0] : ''}</small>
87
+ </div>
88
+
89
+ <CaretDown
90
+ data-testid="btn_home_usuario"
91
+ id="btn_home_usuario"
92
+ color={primitiveColors.gray[300]}
93
+ />
94
+
95
+ {isDropdownOpen && (
96
+ <Dropdown>
97
+ {dropdownOptions.map((option) => (
98
+ <DropdownItem
99
+ key={option.label}
100
+ onClick={option.onClick}
101
+ data-testid={option.testId}
102
+ id={option.id}
103
+ $type={option?.type || 'default'}
104
+ >
105
+ {option.icon && (
106
+ <span style={{ marginRight: 8 }}>{option.icon}</span>
107
+ )}
108
+ {option.label}
109
+ </DropdownItem>
110
+ ))}
111
+ </Dropdown>
112
+ )}
113
+ </UserProfile>
114
+ </NavbarContainer>
115
+ );
116
+ };
117
+
118
+ export default NavbarComponent;
@@ -1,34 +1,34 @@
1
- export interface MenuLink {
2
- label: string;
3
- path: string;
4
- icon?: React.ReactNode;
5
- testId?: string;
6
- id?: string;
7
- }
8
-
9
- export interface DropdownOption {
10
- label: string;
11
- onClick: () => void;
12
- icon?: React.ReactNode;
13
- testId?: string;
14
- type?: 'default' | 'logout';
15
- id?: string;
16
- }
17
-
18
- export interface NavbarComponentProps {
19
- user: {
20
- isSupply?: boolean;
21
- isPartner?: boolean;
22
- username?: string;
23
- img?: string;
24
- roles?: string[];
25
- };
26
- isDropdownOpen: boolean;
27
- handleDropdownToggle: () => void;
28
- handleSearchChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
29
- showSearch: boolean;
30
- /** Menu dinâmico */
31
- menuLinks: MenuLink[];
32
- /** Dropdown dinâmico */
33
- dropdownOptions: DropdownOption[];
34
- }
1
+ export interface MenuLink {
2
+ label: string;
3
+ path: string;
4
+ icon?: React.ReactNode;
5
+ testId?: string;
6
+ id?: string;
7
+ }
8
+
9
+ export interface DropdownOption {
10
+ label: string;
11
+ onClick: () => void;
12
+ icon?: React.ReactNode;
13
+ testId?: string;
14
+ type?: 'default' | 'logout';
15
+ id?: string;
16
+ }
17
+
18
+ export interface NavbarComponentProps {
19
+ user: {
20
+ isSupply?: boolean;
21
+ isPartner?: boolean;
22
+ username?: string;
23
+ img?: string;
24
+ roles?: string[];
25
+ };
26
+ isDropdownOpen: boolean;
27
+ handleDropdownToggle: () => void;
28
+ handleSearchChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
29
+ showSearch: boolean;
30
+ /** Menu dinâmico */
31
+ menuLinks: MenuLink[];
32
+ /** Dropdown dinâmico */
33
+ dropdownOptions: DropdownOption[];
34
+ }
@@ -1,49 +1,49 @@
1
- import styled from 'styled-components';
2
- import * as Dialog from '@radix-ui/react-dialog';
3
- import { semanticColors } from '../../../styles/tokens';
4
-
5
- export const Overlay = styled(Dialog.Overlay)`
6
- position: fixed;
7
- inset: 0;
8
- background-color: rgba(0, 0, 0, 0.6);
9
- z-index: 50;
10
- `;
11
- export const Content = styled(Dialog.Content)`
12
- position: fixed;
13
- top: 50%;
14
- left: 50%;
15
- transform: translate(-50%, -50%);
16
- background: white;
17
- border-radius: 12px;
18
- padding: 32px;
19
- width: 100%;
20
- max-width: 520px;
21
- z-index: 1000;
22
- border-top: 6px solid ${semanticColors.branding.surface.enabled};
23
- `;
24
-
25
- export const Title = styled.h2`
26
- font-size: 28px;
27
- font-weight: 600;
28
- color: ${semanticColors.base.text};
29
- margin-bottom: 16px;
30
- padding-right: 12px;
31
- display: flex;
32
- flex-direction: row;
33
- gap: 8px;
34
- align-items: center;
35
- margin-top: -2px;
36
- `;
37
-
38
- export const CloseIcon = styled(Dialog.Close)`
39
- position: absolute;
40
- top: 32px;
41
- right: 32px;
42
- background: transparent;
43
- border: none;
44
- cursor: pointer;
45
-
46
- svg {
47
- color: #888;
48
- }
49
- `;
1
+ import styled from 'styled-components';
2
+ import * as Dialog from '@radix-ui/react-dialog';
3
+ import { semanticColors } from '../../../styles/tokens';
4
+
5
+ export const Overlay = styled(Dialog.Overlay)`
6
+ position: fixed;
7
+ inset: 0;
8
+ background-color: rgba(0, 0, 0, 0.6);
9
+ z-index: 50;
10
+ `;
11
+ export const Content = styled(Dialog.Content)`
12
+ position: fixed;
13
+ top: 50%;
14
+ left: 50%;
15
+ transform: translate(-50%, -50%);
16
+ background: white;
17
+ border-radius: 12px;
18
+ padding: 32px;
19
+ width: 100%;
20
+ max-width: 520px;
21
+ z-index: 1000;
22
+ border-top: 6px solid ${semanticColors.branding.surface.enabled};
23
+ `;
24
+
25
+ export const Title = styled.h2`
26
+ font-size: 28px;
27
+ font-weight: 600;
28
+ color: ${semanticColors.base.text};
29
+ margin-bottom: 16px;
30
+ padding-right: 12px;
31
+ display: flex;
32
+ flex-direction: row;
33
+ gap: 8px;
34
+ align-items: center;
35
+ margin-top: -2px;
36
+ `;
37
+
38
+ export const CloseIcon = styled(Dialog.Close)`
39
+ position: absolute;
40
+ top: 32px;
41
+ right: 32px;
42
+ background: transparent;
43
+ border: none;
44
+ cursor: pointer;
45
+
46
+ svg {
47
+ color: #888;
48
+ }
49
+ `;
@@ -1,49 +1,49 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import * as Dialog from '@radix-ui/react-dialog';
3
- import { X } from 'lucide-react';
4
- import { CloseIcon, Content, Overlay, Title } from './TimelineModal.styles';
5
- import { FlowArrow } from 'phosphor-react';
6
- import { Timeline } from '../../molecules/TimeLine/TimeLine';
7
- export const TimelineModal = ({
8
- open,
9
- onOpenChange,
10
- onClose,
11
- data,
12
- onRetry,
13
- emptyLabel,
14
- loading,
15
- }: {
16
- open: boolean;
17
- onOpenChange: (open: boolean) => void;
18
- onClose: () => void;
19
- onRetry?: () => void;
20
- emptyLabel?: string;
21
- data: any;
22
- loading?: boolean;
23
- }) => {
24
- return (
25
- <Dialog.Root open={open} onOpenChange={onOpenChange}>
26
- <Overlay />
27
- <Content>
28
- <CloseIcon aria-label="Fechar" onClick={onClose}>
29
- <X size={28} color="#BDBDBD" />
30
- </CloseIcon>
31
-
32
- <Dialog.Title>
33
- <Title>
34
- <FlowArrow />
35
- Linha do tempo
36
- </Title>
37
- </Dialog.Title>
38
-
39
- <Timeline
40
- items={data}
41
- onRetry={onRetry}
42
- emptyLabel={emptyLabel}
43
- skeletonItems={4}
44
- loading={loading}
45
- />
46
- </Content>
47
- </Dialog.Root>
48
- );
49
- };
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import * as Dialog from '@radix-ui/react-dialog';
3
+ import { X } from 'lucide-react';
4
+ import { CloseIcon, Content, Overlay, Title } from './TimelineModal.styles';
5
+ import { FlowArrow } from 'phosphor-react';
6
+ import { Timeline } from '../../molecules/TimeLine/TimeLine';
7
+ export const TimelineModal = ({
8
+ open,
9
+ onOpenChange,
10
+ onClose,
11
+ data,
12
+ onRetry,
13
+ emptyLabel,
14
+ loading,
15
+ }: {
16
+ open: boolean;
17
+ onOpenChange: (open: boolean) => void;
18
+ onClose: () => void;
19
+ onRetry?: () => void;
20
+ emptyLabel?: string;
21
+ data: any;
22
+ loading?: boolean;
23
+ }) => {
24
+ return (
25
+ <Dialog.Root open={open} onOpenChange={onOpenChange}>
26
+ <Overlay />
27
+ <Content>
28
+ <CloseIcon aria-label="Fechar" onClick={onClose}>
29
+ <X size={28} color="#BDBDBD" />
30
+ </CloseIcon>
31
+
32
+ <Dialog.Title>
33
+ <Title>
34
+ <FlowArrow />
35
+ Linha do tempo
36
+ </Title>
37
+ </Dialog.Title>
38
+
39
+ <Timeline
40
+ items={data}
41
+ onRetry={onRetry}
42
+ emptyLabel={emptyLabel}
43
+ skeletonItems={4}
44
+ loading={loading}
45
+ />
46
+ </Content>
47
+ </Dialog.Root>
48
+ );
49
+ };