@granto-umbrella/umbrella-components 3.0.34 → 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 -25
- 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 -56
- 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
package/package.json
CHANGED
|
@@ -1,106 +1,135 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@granto-umbrella/umbrella-components",
|
|
3
|
-
"version": "3.0.
|
|
4
|
-
"description": "Umbrella Components for React",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "src/index.js",
|
|
7
|
-
"module": "src/index.js",
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "https://github.com/grantoseguros/granto-umbrella-components.git"
|
|
11
|
-
},
|
|
12
|
-
"scripts": {
|
|
13
|
-
"dev": "vite",
|
|
14
|
-
"build": "tsc -b && vite build",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"test": "jest",
|
|
22
|
-
"test:
|
|
23
|
-
"test:coverage": "jest --coverage",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
"react
|
|
51
|
-
"react-
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
|
|
106
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@granto-umbrella/umbrella-components",
|
|
3
|
+
"version": "3.0.36",
|
|
4
|
+
"description": "Umbrella Components for React",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.js",
|
|
7
|
+
"module": "src/index.js",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/grantoseguros/granto-umbrella-components.git"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"dev": "vite",
|
|
14
|
+
"build": "tsc -b && vite build",
|
|
15
|
+
"commit": "cz",
|
|
16
|
+
"pr": "node scripts/open-pr.cjs",
|
|
17
|
+
"typecheck": "npm run typecheck:app && npm run typecheck:test",
|
|
18
|
+
"typecheck:app": "tsc -p tsconfig.app.json --noEmit",
|
|
19
|
+
"typecheck:test": "tsc -p tsconfig.test.json --noEmit",
|
|
20
|
+
"test": "jest --config=jest.config.mjs",
|
|
21
|
+
"test:ci": "jest --config=jest.config.mjs --coverage",
|
|
22
|
+
"test:related": "jest --config=jest.config.mjs -o",
|
|
23
|
+
"test:coverage": "jest --config jest.config.mjs --coverage --coverageReporters",
|
|
24
|
+
"lint": "eslint .",
|
|
25
|
+
"lint:staged": "eslint --max-warnings=0 --ignore-pattern 'storybook-static/**' --ignore-pattern 'coverage/**' --ignore-pattern 'dist/**'",
|
|
26
|
+
"format": "prettier -c .",
|
|
27
|
+
"format:check": "prettier --check .",
|
|
28
|
+
"format:write": "prettier -w .",
|
|
29
|
+
"prepare": "lefthook install",
|
|
30
|
+
"preview": "vite preview",
|
|
31
|
+
"storybook": "storybook dev -p 6006",
|
|
32
|
+
"build-storybook": "storybook build",
|
|
33
|
+
"predeploy": "npm run build-storybook",
|
|
34
|
+
"deploy": "gh-pages -d storybook-static",
|
|
35
|
+
"version": "npm run build && git add .",
|
|
36
|
+
"release:patch": "npm version patch && git push && git push --tags",
|
|
37
|
+
"release:minor": "npm version minor && git push && git push --tags",
|
|
38
|
+
"release:major": "npm version major && git push && git push --tags",
|
|
39
|
+
"bump:patch": "npm version patch",
|
|
40
|
+
"bump:minor": "npm version minor",
|
|
41
|
+
"bump:major": "npm version major"
|
|
42
|
+
},
|
|
43
|
+
"config": {
|
|
44
|
+
"commitizen": {
|
|
45
|
+
"path": "cz-git"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@hello-pangea/dnd": "^18.0.1",
|
|
50
|
+
"@phosphor-icons/react": "^2.1.10",
|
|
51
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
52
|
+
"@radix-ui/react-label": "^2.1.3",
|
|
53
|
+
"@radix-ui/react-popover": "^1.1.11",
|
|
54
|
+
"@radix-ui/react-radio-group": "^1.2.4",
|
|
55
|
+
"cpf-cnpj-validator": "^1.0.3",
|
|
56
|
+
"date-fns": "^4.1.0",
|
|
57
|
+
"lucide-react": "^0.488.0",
|
|
58
|
+
"make-mask": "^1.0.3",
|
|
59
|
+
"phosphor-react": "^1.4.1",
|
|
60
|
+
"radix": "^0.0.0",
|
|
61
|
+
"react": "^18.3.1",
|
|
62
|
+
"react-datepicker": "^8.3.0",
|
|
63
|
+
"react-day-picker": "^9.6.7",
|
|
64
|
+
"react-dom": "^18.3.1",
|
|
65
|
+
"react-hook-form": "^7.63.0",
|
|
66
|
+
"react-router": "^6.30.1",
|
|
67
|
+
"react-router-dom": "^6.30.1",
|
|
68
|
+
"react-select": "^5.10.0",
|
|
69
|
+
"recharts": "^3.2.1",
|
|
70
|
+
"tailwind-merge": "^3.2.0"
|
|
71
|
+
},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@chromatic-com/storybook": "3.2.3",
|
|
74
|
+
"@commitlint/cli": "^20.1.0",
|
|
75
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
76
|
+
"@eslint/js": "^9.17.0",
|
|
77
|
+
"@storybook/addon-actions": "8.4.7",
|
|
78
|
+
"@storybook/addon-essentials": "8.4.7",
|
|
79
|
+
"@storybook/addon-interactions": "8.4.7",
|
|
80
|
+
"@storybook/addon-onboarding": "8.4.7",
|
|
81
|
+
"@storybook/react-vite": "8.4.7",
|
|
82
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
83
|
+
"@testing-library/react": "^16.3.0",
|
|
84
|
+
"@testing-library/user-event": "^14.6.1",
|
|
85
|
+
"@types/jest": "^30.0.0",
|
|
86
|
+
"@types/mocha": "^10.0.10",
|
|
87
|
+
"@types/node": "^24.9.2",
|
|
88
|
+
"@types/react": "^18.3.17",
|
|
89
|
+
"@types/react-dom": "^18.3.5",
|
|
90
|
+
"@types/styled-components": "^5.1.34",
|
|
91
|
+
"@vitejs/plugin-react": "^4.7.0",
|
|
92
|
+
"babel-plugin-styled-components": "^2.1.4",
|
|
93
|
+
"commitizen": "^4.3.1",
|
|
94
|
+
"commitlint": "^20.1.0",
|
|
95
|
+
"cz-git": "^1.12.0",
|
|
96
|
+
"eslint": "^9.17.0",
|
|
97
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
98
|
+
"eslint-plugin-react-refresh": "^0.4.16",
|
|
99
|
+
"gh-pages": "^6.3.0",
|
|
100
|
+
"globals": "^15.13.0",
|
|
101
|
+
"identity-obj-proxy": "^3.0.0",
|
|
102
|
+
"jest": "^29.7.0",
|
|
103
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
104
|
+
"jest-styled-components": "^7.2.0",
|
|
105
|
+
"lefthook": "^2.0.1",
|
|
106
|
+
"prettier": "^3.6.2",
|
|
107
|
+
"react-icons": "^5.4.0",
|
|
108
|
+
"styled-components": "^6.1.19",
|
|
109
|
+
"ts-jest": "^29.4.5",
|
|
110
|
+
"ts-node": "^10.9.2",
|
|
111
|
+
"typescript": "~5.6.2",
|
|
112
|
+
"typescript-eslint": "^8.18.1",
|
|
113
|
+
"vite": "^6.0.3"
|
|
114
|
+
},
|
|
115
|
+
"keywords": [
|
|
116
|
+
"cli",
|
|
117
|
+
"vite",
|
|
118
|
+
"components"
|
|
119
|
+
],
|
|
120
|
+
"eslintConfig": {
|
|
121
|
+
"extends": [
|
|
122
|
+
"plugin:storybook/recommended"
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
"engines": {
|
|
126
|
+
"node": "20.17.0",
|
|
127
|
+
"yarn": ">=1.22.18"
|
|
128
|
+
},
|
|
129
|
+
"files": [
|
|
130
|
+
"dist",
|
|
131
|
+
"src/**/*",
|
|
132
|
+
"!src/**/*.test.*",
|
|
133
|
+
"!src/**/*.stories.*"
|
|
134
|
+
]
|
|
135
|
+
}
|
package/src/assets.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
declare module
|
|
2
|
-
const content: string;
|
|
3
|
-
export default content;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
declare module
|
|
7
|
-
const content: string;
|
|
8
|
-
export default content;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
declare module
|
|
12
|
-
const content: string;
|
|
13
|
-
export default content;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare module
|
|
17
|
-
const content: string;
|
|
18
|
-
export default content;
|
|
19
|
-
}
|
|
1
|
+
declare module '*.png' {
|
|
2
|
+
const content: string;
|
|
3
|
+
export default content;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
declare module '*.jpg' {
|
|
7
|
+
const content: string;
|
|
8
|
+
export default content;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare module '*.jpeg' {
|
|
12
|
+
const content: string;
|
|
13
|
+
export default content;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare module '*.svg' {
|
|
17
|
+
const content: string;
|
|
18
|
+
export default content;
|
|
19
|
+
}
|
|
@@ -1,86 +1,88 @@
|
|
|
1
|
-
import styled, { css } from
|
|
2
|
-
import {
|
|
3
|
-
semanticColors,
|
|
4
|
-
semanticSizes,
|
|
5
|
-
semanticRadius,
|
|
6
|
-
typographyTokens,
|
|
7
|
-
} from
|
|
8
|
-
|
|
9
|
-
const badgeVariants = {
|
|
10
|
-
primary: css`
|
|
11
|
-
background: ${semanticColors.branding.surface.enabled};
|
|
12
|
-
color: ${semanticColors.base.background};
|
|
13
|
-
`,
|
|
14
|
-
outline: css`
|
|
15
|
-
background: transparent;
|
|
16
|
-
border: 1px solid ${semanticColors.branding.border.enabled};
|
|
17
|
-
color: ${semanticColors.branding.text.accent.enabled};
|
|
18
|
-
`,
|
|
19
|
-
danger: css`
|
|
20
|
-
background: ${semanticColors.global.surface.danger.disabled};
|
|
21
|
-
color: ${semanticColors.global.text.feedback.strong.error};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
font-size: ${typographyTokens.fontSizes.labelS};
|
|
46
|
-
font-weight: ${typographyTokens.fontWeights.medium};
|
|
47
|
-
line-height: ${typographyTokens.lineHeights.labelS};
|
|
48
|
-
font-family: ${typographyTokens.fontFamily.base};
|
|
49
|
-
`,
|
|
50
|
-
md: css`
|
|
51
|
-
padding: ${semanticSizes.global.padding.sm}
|
|
52
|
-
|
|
53
|
-
font-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
font-
|
|
63
|
-
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
$
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
${
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import {
|
|
3
|
+
semanticColors,
|
|
4
|
+
semanticSizes,
|
|
5
|
+
semanticRadius,
|
|
6
|
+
typographyTokens,
|
|
7
|
+
} from '../../../styles/tokens';
|
|
8
|
+
|
|
9
|
+
const badgeVariants = {
|
|
10
|
+
primary: css`
|
|
11
|
+
background: ${semanticColors.branding.surface.enabled};
|
|
12
|
+
color: ${semanticColors.base.background};
|
|
13
|
+
`,
|
|
14
|
+
outline: css`
|
|
15
|
+
background: transparent;
|
|
16
|
+
border: 1px solid ${semanticColors.branding.border.enabled};
|
|
17
|
+
color: ${semanticColors.branding.text.accent.enabled};
|
|
18
|
+
`,
|
|
19
|
+
danger: css`
|
|
20
|
+
background: ${semanticColors.global.surface.danger.disabled};
|
|
21
|
+
color: ${semanticColors.global.text.feedback.strong.error};
|
|
22
|
+
`,
|
|
23
|
+
success: css`
|
|
24
|
+
background: ${semanticColors.success.surface.feedback};
|
|
25
|
+
color: ${semanticColors.success.text.feedback};
|
|
26
|
+
`,
|
|
27
|
+
warning: css`
|
|
28
|
+
background: ${semanticColors.warning.surface.feedback};
|
|
29
|
+
color: ${semanticColors.warning.text.feedback};
|
|
30
|
+
`,
|
|
31
|
+
neutral: css`
|
|
32
|
+
background: ${semanticColors.neutral[200]};
|
|
33
|
+
color: ${semanticColors.neutral[700]};
|
|
34
|
+
`,
|
|
35
|
+
info: css`
|
|
36
|
+
background: ${semanticColors.info.surface.feedback};
|
|
37
|
+
color: ${semanticColors.info.text.feedback.strong};
|
|
38
|
+
`,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const badgeSizes = {
|
|
42
|
+
sm: css`
|
|
43
|
+
padding: ${semanticSizes.global.padding.xs}
|
|
44
|
+
${semanticSizes.global.padding.sm};
|
|
45
|
+
font-size: ${typographyTokens.fontSizes.labelS};
|
|
46
|
+
font-weight: ${typographyTokens.fontWeights.medium};
|
|
47
|
+
line-height: ${typographyTokens.lineHeights.labelS};
|
|
48
|
+
font-family: ${typographyTokens.fontFamily.base};
|
|
49
|
+
`,
|
|
50
|
+
md: css`
|
|
51
|
+
padding: ${semanticSizes.global.padding.sm}
|
|
52
|
+
${semanticSizes.global.padding.md};
|
|
53
|
+
font-size: ${typographyTokens.fontSizes.labelM};
|
|
54
|
+
font-weight: ${typographyTokens.fontWeights.medium};
|
|
55
|
+
line-height: ${typographyTokens.lineHeights.labelM};
|
|
56
|
+
font-family: ${typographyTokens.fontFamily.base};
|
|
57
|
+
`,
|
|
58
|
+
lg: css`
|
|
59
|
+
padding: ${semanticSizes.global.padding.md}
|
|
60
|
+
${semanticSizes.global.padding.lg};
|
|
61
|
+
font-size: ${typographyTokens.fontSizes.labelL};
|
|
62
|
+
font-weight: ${typographyTokens.fontWeights.medium};
|
|
63
|
+
line-height: ${typographyTokens.lineHeights.labelL};
|
|
64
|
+
font-family: ${typographyTokens.fontFamily.base};
|
|
65
|
+
`,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const StyledBadge = styled.span<{
|
|
69
|
+
$size: keyof typeof badgeSizes;
|
|
70
|
+
$variant: keyof typeof badgeVariants;
|
|
71
|
+
$radius: keyof typeof semanticRadius.global.radius;
|
|
72
|
+
}>`
|
|
73
|
+
display: inline-flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
border-radius: ${({ $radius }) => semanticRadius.global.radius[$radius]};
|
|
77
|
+
gap: ${semanticSizes.global.gap.xs};
|
|
78
|
+
|
|
79
|
+
${({ $size }) => badgeSizes[$size]}
|
|
80
|
+
${({ $variant }) => badgeVariants[$variant]}
|
|
81
|
+
|
|
82
|
+
.icon-left,
|
|
83
|
+
.icon-right {
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
line-height: 1;
|
|
87
|
+
}
|
|
88
|
+
`;
|
|
@@ -1,44 +1,42 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { StyledBadge } from
|
|
3
|
-
import { BadgeProps } from
|
|
4
|
-
import * as Icons from
|
|
5
|
-
import { semanticSizes } from
|
|
6
|
-
|
|
7
|
-
const getIconSize = (size: BadgeProps[
|
|
8
|
-
switch (size) {
|
|
9
|
-
case
|
|
10
|
-
return semanticSizes.global.padding.lg;
|
|
11
|
-
case
|
|
12
|
-
return semanticSizes.global.padding['2xl'];
|
|
13
|
-
default: // Caso 'md'
|
|
14
|
-
return semanticSizes.global.padding.xl;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const Badge: React.FC<BadgeProps> = ({
|
|
19
|
-
children,
|
|
20
|
-
size =
|
|
21
|
-
variant =
|
|
22
|
-
radius =
|
|
23
|
-
leftIcon,
|
|
24
|
-
rightIcon,
|
|
25
|
-
}) => {
|
|
26
|
-
const IconComponentLeft =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
)}
|
|
36
|
-
{children}
|
|
37
|
-
{IconComponentRight && (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
export default Badge;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyledBadge } from './Badge.styles';
|
|
3
|
+
import { BadgeProps } from './Badge.types';
|
|
4
|
+
import * as Icons from '@phosphor-icons/react';
|
|
5
|
+
import { semanticSizes } from '../../../styles/tokens/sizes';
|
|
6
|
+
|
|
7
|
+
const getIconSize = (size: BadgeProps['size']) => {
|
|
8
|
+
switch (size) {
|
|
9
|
+
case 'sm':
|
|
10
|
+
return semanticSizes.global.padding.lg;
|
|
11
|
+
case 'lg':
|
|
12
|
+
return semanticSizes.global.padding['2xl'];
|
|
13
|
+
default: // Caso 'md'
|
|
14
|
+
return semanticSizes.global.padding.xl;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const Badge: React.FC<BadgeProps> = ({
|
|
19
|
+
children,
|
|
20
|
+
size = 'md',
|
|
21
|
+
variant = 'primary',
|
|
22
|
+
radius = 'full',
|
|
23
|
+
leftIcon,
|
|
24
|
+
rightIcon,
|
|
25
|
+
}) => {
|
|
26
|
+
const IconComponentLeft =
|
|
27
|
+
leftIcon && (Icons[leftIcon as keyof typeof Icons] as React.ElementType);
|
|
28
|
+
const IconComponentRight =
|
|
29
|
+
rightIcon && (Icons[rightIcon as keyof typeof Icons] as React.ElementType);
|
|
30
|
+
|
|
31
|
+
const iconSize = getIconSize(size);
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<StyledBadge $size={size} $variant={variant} $radius={radius}>
|
|
35
|
+
{IconComponentLeft && <IconComponentLeft size={parseInt(iconSize)} />}
|
|
36
|
+
{children}
|
|
37
|
+
{IconComponentRight && <IconComponentRight size={parseInt(iconSize)} />}
|
|
38
|
+
</StyledBadge>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default Badge;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export interface BadgeProps {
|
|
2
|
-
children: React.ReactNode;
|
|
3
|
-
size?:
|
|
4
|
-
variant?:
|
|
5
|
-
|
|
|
6
|
-
|
|
|
7
|
-
|
|
|
8
|
-
|
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
|
|
|
12
|
-
radius?:
|
|
13
|
-
leftIcon?: string;
|
|
14
|
-
rightIcon?: string;
|
|
15
|
-
}
|
|
1
|
+
export interface BadgeProps {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
size?: 'sm' | 'md' | 'lg';
|
|
4
|
+
variant?:
|
|
5
|
+
| 'primary'
|
|
6
|
+
| 'outline'
|
|
7
|
+
| 'danger'
|
|
8
|
+
| 'success'
|
|
9
|
+
| 'warning'
|
|
10
|
+
| 'neutral'
|
|
11
|
+
| 'info';
|
|
12
|
+
radius?: 'sm' | 'md' | 'lg' | 'full';
|
|
13
|
+
leftIcon?: string;
|
|
14
|
+
rightIcon?: string;
|
|
15
|
+
}
|