@granto-umbrella/umbrella-components 3.0.36 → 3.0.38

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@granto-umbrella/umbrella-components",
3
- "version": "3.0.36",
3
+ "version": "3.0.38",
4
4
  "description": "Umbrella Components for React",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -30,6 +30,7 @@
30
30
  "preview": "vite preview",
31
31
  "storybook": "storybook dev -p 6006",
32
32
  "build-storybook": "storybook build",
33
+ "build:storybook": "storybook build -o storybook-static",
33
34
  "predeploy": "npm run build-storybook",
34
35
  "deploy": "gh-pages -d storybook-static",
35
36
  "version": "npm run build && git add .",
@@ -2,14 +2,14 @@ import {
2
2
  semanticBorders,
3
3
  semanticColors,
4
4
  typographyTokens,
5
- } from '@/styles/tokens';
5
+ } from '../../../styles/tokens';
6
6
  import styled from 'styled-components';
7
7
 
8
8
  export const Container = styled.div`
9
9
  display: flex;
10
10
  gap: 2rem;
11
11
  justify-content: center;
12
- padding: 2rem;
12
+ padding: 2rem 0;
13
13
  `;
14
14
 
15
15
  export const Column = styled.div`
@@ -0,0 +1,59 @@
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
+
12
+ export const Content = styled(Dialog.Content)`
13
+ position: fixed;
14
+ inset: 0;
15
+ display: grid;
16
+ place-items: center;
17
+ z-index: 1000;
18
+ background: transparent;
19
+ `;
20
+
21
+ export const Panel = styled.div`
22
+ background: white;
23
+ border-radius: 12px;
24
+ padding: 32px;
25
+ width: min(850px, calc(100% - 32px));
26
+ border-top: 6px solid ${semanticColors.branding.surface.enabled};
27
+ `;
28
+
29
+ export const Title = styled.h2`
30
+ font-size: 28px;
31
+ font-weight: 600;
32
+ color: ${semanticColors.base.text};
33
+ margin-bottom: 16px;
34
+ padding-right: 12px;
35
+ display: flex;
36
+ flex-direction: row;
37
+ gap: 8px;
38
+ align-items: center;
39
+ margin-top: -2px;
40
+ `;
41
+
42
+ export const CloseIcon = styled(Dialog.Close)`
43
+ background: transparent;
44
+ border: none;
45
+ cursor: pointer;
46
+ padding: 4px;
47
+
48
+ svg {
49
+ color: #888;
50
+ }
51
+ `;
52
+
53
+ export const Header = styled.div`
54
+ display: flex;
55
+ justify-content: space-between;
56
+ align-items: flex-start;
57
+ width: 100%;
58
+ margin-bottom: 24px;
59
+ `;
@@ -0,0 +1,80 @@
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 {
5
+ CloseIcon,
6
+ Content,
7
+ Header,
8
+ Overlay,
9
+ Panel,
10
+ } from './ExportExcelModal.styles';
11
+ import FieldSelector from '../../molecules/FieldSelector/FieldSelector';
12
+ import ButtonGroup from '../../molecules/ButtonGroup/ButtonGroup';
13
+ export const ExportExcelModal = ({
14
+ open,
15
+ onOpenChange,
16
+ onClose,
17
+ data,
18
+ title,
19
+ description,
20
+ onExport,
21
+ onSave,
22
+ }: {
23
+ open: boolean;
24
+ onOpenChange: (open: boolean) => void;
25
+ onClose: () => void;
26
+ onRetry?: () => void;
27
+ data: any;
28
+ title: string;
29
+ description: string;
30
+ onExport?: (data: any) => void;
31
+ onSave?: (data: any) => void;
32
+ }) => {
33
+ return (
34
+ <Dialog.Root open={open} onOpenChange={onOpenChange}>
35
+ <Overlay />
36
+ <Content>
37
+ <Panel>
38
+ <Header>
39
+ <div>
40
+ <Dialog.Title>{title}</Dialog.Title>
41
+ <Dialog.Description>{description}</Dialog.Description>
42
+ </div>
43
+
44
+ <CloseIcon aria-label="Fechar" onClick={onClose}>
45
+ <X size={28} color="#BDBDBD" />
46
+ </CloseIcon>
47
+ </Header>
48
+
49
+ <FieldSelector
50
+ availableFields={data.available}
51
+ selectedFields={data.selected}
52
+ setAvailableFields={data.setAvailable}
53
+ setSelectedFields={data.setSelected}
54
+ handleSave={(data) => console.log('Nova ordem:', data)}
55
+ />
56
+
57
+ <ButtonGroup
58
+ buttons={[
59
+ {
60
+ label: 'Salvar e exportar planilha',
61
+ variant: 'primary',
62
+ onClick: () => {
63
+ if (onExport) onExport(data.selected);
64
+ },
65
+ },
66
+ {
67
+ label: 'Salvar configurações',
68
+ variant: 'outline',
69
+ onClick: () => {
70
+ if (onSave) onSave(data.selected);
71
+ },
72
+ },
73
+ ]}
74
+ orientation="horizontal"
75
+ />
76
+ </Panel>
77
+ </Content>
78
+ </Dialog.Root>
79
+ );
80
+ };
package/src/index.ts CHANGED
@@ -64,6 +64,7 @@ import {
64
64
  StyledDialogOverlay,
65
65
  } from './components/organisms/Dialog/Dialog.styles';
66
66
  import DonutEmissionsChart from './components/organisms/DonutEmissionsChart';
67
+ import { ExportExcelModal } from './components/organisms/ExportExcelModal/ExportExcelModal';
67
68
  import {
68
69
  FormControl,
69
70
  FormDescription,
@@ -87,6 +88,7 @@ export {
87
88
  FieldSelector,
88
89
  BannerAjuda,
89
90
  Badge,
91
+ ExportExcelModal,
90
92
  Breadcrumb,
91
93
  Button,
92
94
  ButtonGroup,