vpt-sebraeds 0.0.7 → 0.0.9

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 (212) hide show
  1. package/README.md +73 -73
  2. package/components/Accordion/Accordion.stories.jsx +91 -91
  3. package/components/Accordion/index.jsx +145 -145
  4. package/components/AdBanner/AdBanner.stories.jsx +62 -62
  5. package/components/AdBanner/index.jsx +89 -89
  6. package/components/Avatar/Avatar.stories.jsx +59 -59
  7. package/components/Avatar/index.jsx +101 -89
  8. package/components/BottomSheet/BottomSheet.stories.jsx +378 -378
  9. package/components/BottomSheet/Components/ListaDeEstados.jsx +336 -336
  10. package/components/BottomSheet/index.jsx +299 -299
  11. package/components/Breadcrumb/Breadcrumb.stories.jsx +62 -62
  12. package/components/Breadcrumb/index.jsx +88 -88
  13. package/components/Button/ButtonPrimary.stories.jsx +311 -311
  14. package/components/Button/index.jsx +364 -364
  15. package/components/CardNumber/CardNumber.stories.jsx +60 -60
  16. package/components/CardNumber/index.jsx +133 -133
  17. package/components/Checkbox/Checkbox.stories.jsx +70 -70
  18. package/components/Checkbox/index.jsx +120 -120
  19. package/components/ContentBlock/ContentBlock.stories.tsx +48 -48
  20. package/components/ContentBlock/ContentBlock.tsx +50 -50
  21. package/components/ContentCard/ContentCard.stories.jsx +98 -98
  22. package/components/ContentCard/index.jsx +288 -288
  23. package/components/ContentRelatedCard/ContentRelatedCard.stories.jsx +79 -79
  24. package/components/ContentRelatedCard/index.jsx +79 -79
  25. package/components/ContentSlot/ContentSlot.stories.jsx +276 -276
  26. package/components/ContentSlot/index.jsx +195 -195
  27. package/components/Datepicker/Datepicker.stories.jsx +239 -239
  28. package/components/Datepicker/MonthSelector.jsx +322 -322
  29. package/components/Datepicker/TimeSelector.jsx +260 -260
  30. package/components/Datepicker/index.jsx +449 -449
  31. package/components/DonutChart/DonutChart.stories.jsx +220 -220
  32. package/components/DonutChart/index.jsx +190 -190
  33. package/components/Dropdown/Dropdown.stories.jsx +331 -331
  34. package/components/Dropdown/index.jsx +371 -371
  35. package/components/DropdownCommitments/index.js +147 -147
  36. package/components/EmptySlot/EmptySlot.stories.jsx +114 -114
  37. package/components/EmptySlot/index.jsx +151 -151
  38. package/components/FilterTag/FilterTag.stories.jsx +54 -54
  39. package/components/FilterTag/index.jsx +72 -72
  40. package/components/FilterableMultiSelect/FilterableMultiSelect.stories.jsx +63 -63
  41. package/components/FilterableMultiSelect/index.jsx +208 -208
  42. package/components/GettingStarted.jsx +38 -38
  43. package/components/Header/Header.stories.jsx +838 -838
  44. package/components/Header/components/Context.jsx +41 -41
  45. package/components/Header/components/Information.jsx +80 -80
  46. package/components/Header/components/Shortcut.jsx +48 -48
  47. package/components/Header/components/SwitchAccount.jsx +276 -276
  48. package/components/Header/components/Variants.jsx +181 -181
  49. package/components/Header/components/index.jsx +11 -11
  50. package/components/Header/index.jsx +206 -206
  51. package/components/Icon/iconEnums.ts +30 -30
  52. package/components/Icon/index.jsx +13 -13
  53. package/components/Image/Image.stories.jsx +250 -250
  54. package/components/Image/index.jsx +175 -175
  55. package/components/Input/Input.stories.jsx +303 -303
  56. package/components/Input/index.jsx +292 -292
  57. package/components/Legend/Legend.stories.jsx +110 -110
  58. package/components/Legend/index.jsx +86 -86
  59. package/components/Link/Link.stories.jsx +78 -78
  60. package/components/Link/index.jsx +62 -62
  61. package/components/List/List.stories.jsx +57 -57
  62. package/components/List/index.jsx +63 -63
  63. package/components/Modal/Modal.stories.jsx +151 -151
  64. package/components/Modal/index.jsx +247 -247
  65. package/components/Navbar/Navbar.stories.jsx +244 -244
  66. package/components/Navbar/index.jsx +129 -129
  67. package/components/NavigationItem/NavigationItem.stories.tsx +454 -454
  68. package/components/NavigationItem/index.tsx +526 -526
  69. package/components/NotificationBanner/NotificationBanner.stories.jsx +57 -57
  70. package/components/NotificationBanner/index.jsx +153 -153
  71. package/components/NotificationCard/NotificationCard.stories.jsx +93 -93
  72. package/components/NotificationCard/index.jsx +337 -337
  73. package/components/Pagination/Pagination.stories.jsx +170 -170
  74. package/components/Pagination/index.jsx +228 -228
  75. package/components/ProgressBar/ProgressBar.stories.jsx +354 -354
  76. package/components/ProgressBar/index.jsx +90 -90
  77. package/components/ProgressChart/ProgressChart.stories.jsx +312 -312
  78. package/components/ProgressChart/index.jsx +189 -189
  79. package/components/Quote/Quote.stories.tsx +32 -32
  80. package/components/Quote/Quote.tsx +60 -60
  81. package/components/RadioButton/RadioButton.stories.jsx +112 -112
  82. package/components/RadioButton/index.jsx +113 -113
  83. package/components/Rating/Rating.stories.jsx +157 -157
  84. package/components/Rating/index.jsx +145 -145
  85. package/components/SEIcon/index.js +30 -30
  86. package/components/SEText/index.d.ts +58 -58
  87. package/components/SEText/index.js +160 -160
  88. package/components/SEText/styles.js +340 -333
  89. package/components/ScrollBar/ScrollBar.stories.tsx +65 -65
  90. package/components/ScrollBar/index.tsx +118 -118
  91. package/components/Search/Search.jsx +328 -328
  92. package/components/Search/Search.stories.jsx +92 -92
  93. package/components/Select/Select.stories.jsx +415 -415
  94. package/components/Select/index.jsx +307 -307
  95. package/components/SelectItem/SelectItem.stories.jsx +608 -608
  96. package/components/SelectItem/index.jsx +173 -173
  97. package/components/Shortcut/Shortcut.stories.jsx +145 -145
  98. package/components/Shortcut/index.jsx +182 -182
  99. package/components/ShowMore/ShowMore.stories.jsx +70 -70
  100. package/components/ShowMore/index.jsx +67 -67
  101. package/components/ShuffleItem/ShuffleItem.stories.jsx +278 -278
  102. package/components/ShuffleItem/index.jsx +701 -701
  103. package/components/Slider/Slider.stories.jsx +248 -248
  104. package/components/Slider/index.jsx +210 -210
  105. package/components/Tab/Tab.stories.jsx +323 -323
  106. package/components/Tab/index.jsx +482 -482
  107. package/components/Table/Table.stories.jsx +253 -253
  108. package/components/Table/index.jsx +291 -291
  109. package/components/Tag/Tag.stories.jsx +78 -78
  110. package/components/Tag/index.d.ts +10 -10
  111. package/components/Tag/index.jsx +128 -128
  112. package/components/TaskCard/TaskCard.stories.jsx +467 -467
  113. package/components/TaskCard/assets/README.md +22 -22
  114. package/components/TaskCard/assets/example.js +10 -10
  115. package/components/TaskCard/components/EditIcon.jsx +78 -78
  116. package/components/TaskCard/components/SuccessContent.jsx +52 -52
  117. package/components/TaskCard/components/SuccessIcon.jsx +52 -52
  118. package/components/TaskCard/components/SuccessTitle.jsx +48 -48
  119. package/components/TaskCard/components/Tag.jsx +79 -79
  120. package/components/TaskCard/components/TagGroup.jsx +60 -60
  121. package/components/TaskCard/components/TaskDescription.jsx +50 -50
  122. package/components/TaskCard/components/index.js +7 -7
  123. package/components/TaskCard/index.jsx +295 -295
  124. package/components/Toast/Toast.stories.jsx +238 -238
  125. package/components/Toast/index.jsx +307 -307
  126. package/components/Toggle/Toggle.stories.jsx +160 -160
  127. package/components/Toggle/index.jsx +143 -143
  128. package/components/TooltipCard/TooltipCard.stories.jsx +88 -88
  129. package/components/TooltipCard/index.jsx +353 -353
  130. package/components/Typography/Typography.stories.jsx +261 -261
  131. package/components/Typography/index.jsx +136 -136
  132. package/components/styles/colors.js +204 -204
  133. package/components/styles/fonts.js +15 -15
  134. package/components/styles/index,js +6 -6
  135. package/components/styles/metrics.js +13 -13
  136. package/components/styles.ts +79 -79
  137. package/dist/components/Accordion/index.js +16 -16
  138. package/dist/components/AdBanner/index.js +12 -12
  139. package/dist/components/Avatar/index.d.ts.map +1 -1
  140. package/dist/components/Avatar/index.js +18 -6
  141. package/dist/components/BottomSheet/Components/ListaDeEstados.js +10 -10
  142. package/dist/components/BottomSheet/index.js +33 -33
  143. package/dist/components/Breadcrumb/index.js +7 -7
  144. package/dist/components/Button/index.js +10 -10
  145. package/dist/components/CardNumber/index.js +16 -16
  146. package/dist/components/Checkbox/index.js +7 -7
  147. package/dist/components/ContentBlock/ContentBlock.js +7 -7
  148. package/dist/components/ContentCard/index.js +48 -48
  149. package/dist/components/ContentRelatedCard/index.js +10 -10
  150. package/dist/components/ContentSlot/index.js +31 -31
  151. package/dist/components/Datepicker/MonthSelector.js +13 -13
  152. package/dist/components/Datepicker/TimeSelector.js +15 -15
  153. package/dist/components/Datepicker/index.js +60 -60
  154. package/dist/components/DonutChart/index.js +19 -19
  155. package/dist/components/Dropdown/index.js +46 -46
  156. package/dist/components/DropdownCommitments/index.js +24 -24
  157. package/dist/components/EmptySlot/index.js +19 -19
  158. package/dist/components/FilterTag/index.js +7 -7
  159. package/dist/components/FilterableMultiSelect/index.js +22 -22
  160. package/dist/components/GettingStarted.js +8 -8
  161. package/dist/components/Header/components/Context.js +2 -2
  162. package/dist/components/Header/components/Information.js +12 -12
  163. package/dist/components/Header/components/SwitchAccount.js +43 -43
  164. package/dist/components/Header/components/Variants.js +31 -31
  165. package/dist/components/Header/index.js +5 -5
  166. package/dist/components/Image/index.js +22 -22
  167. package/dist/components/Input/index.js +9 -9
  168. package/dist/components/Legend/index.js +8 -8
  169. package/dist/components/Link/index.js +5 -5
  170. package/dist/components/List/index.js +7 -7
  171. package/dist/components/Modal/index.js +38 -38
  172. package/dist/components/Navbar/index.js +9 -9
  173. package/dist/components/NavigationItem/index.js +32 -32
  174. package/dist/components/NotificationBanner/index.js +8 -8
  175. package/dist/components/NotificationCard/index.js +41 -41
  176. package/dist/components/Pagination/index.js +23 -23
  177. package/dist/components/ProgressBar/index.js +14 -14
  178. package/dist/components/ProgressChart/index.js +29 -29
  179. package/dist/components/Quote/Quote.js +9 -9
  180. package/dist/components/RadioButton/index.js +7 -7
  181. package/dist/components/Rating/index.js +9 -9
  182. package/dist/components/SEText/index.js +2 -2
  183. package/dist/components/SEText/styles.d.ts +11 -0
  184. package/dist/components/SEText/styles.js +7 -0
  185. package/dist/components/ScrollBar/index.js +7 -7
  186. package/dist/components/Search/Search.js +45 -45
  187. package/dist/components/Select/index.js +16 -16
  188. package/dist/components/SelectItem/index.js +6 -6
  189. package/dist/components/Shortcut/index.js +6 -6
  190. package/dist/components/ShowMore/index.js +7 -7
  191. package/dist/components/ShuffleItem/index.js +98 -98
  192. package/dist/components/Slider/index.js +20 -20
  193. package/dist/components/Tab/index.js +26 -26
  194. package/dist/components/Table/index.js +36 -36
  195. package/dist/components/Tag/index.js +5 -5
  196. package/dist/components/TaskCard/components/EditIcon.js +2 -2
  197. package/dist/components/TaskCard/components/SuccessContent.js +3 -3
  198. package/dist/components/TaskCard/components/SuccessIcon.js +2 -2
  199. package/dist/components/TaskCard/components/SuccessTitle.js +2 -2
  200. package/dist/components/TaskCard/components/Tag.js +4 -4
  201. package/dist/components/TaskCard/components/TagGroup.js +4 -4
  202. package/dist/components/TaskCard/components/TaskDescription.js +2 -2
  203. package/dist/components/TaskCard/index.js +50 -50
  204. package/dist/components/Toast/index.js +45 -45
  205. package/dist/components/Toggle/index.js +3 -3
  206. package/dist/components/TooltipCard/index.js +46 -46
  207. package/dist/components/Typography/index.js +2 -2
  208. package/dist/src/index.d.ts +1 -0
  209. package/dist/src/index.d.ts.map +1 -1
  210. package/dist/src/index.js +1 -0
  211. package/package.json +125 -125
  212. package/src/index.ts +1 -0
package/README.md CHANGED
@@ -1,73 +1,73 @@
1
- <p align="center">
2
- <img alt="Sebrae" src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d9/Sebrae.svg/2560px-Sebrae.svg.png" width="200" />
3
- </p>
4
-
5
- <h1 align="center">
6
- Sebrae Design System - React Native
7
- </h1>
8
-
9
- <p align="center">
10
- Design System em React Native para o projeto Sebrae Na Palma da Mão
11
- </p>
12
-
13
- ## 📋 Sobre o Projeto
14
-
15
- Este é o repositório do Design System em React Native desenvolvido para o projeto Sebrae Na Palma da Mão. O objetivo é fornecer uma biblioteca de componentes reutilizáveis que seguem os padrões visuais e de interação do Sebrae, garantindo consistência e eficiência no desenvolvimento do aplicativo principal.
16
-
17
- ## 🎨 Componentes Disponíveis
18
-
19
- Atualmente, o Design System conta com os seguintes componentes:
20
-
21
- - **Accordeon**: Componente expansível para exibição de conteúdo organizado
22
- - **Button**: Botões primários seguindo o padrão visual do Sebrae
23
- - **Checkbox**: Componente de seleção múltipla
24
- - **FilterTag**: Tags para filtros e categorização
25
- - **Input**: Campos de entrada de texto padronizados
26
-
27
- ## 🚀 Como Usar
28
-
29
- 1. **Instalação das dependências:**
30
-
31
- ```bash
32
- yarn
33
- ```
34
-
35
- 2. **Executando o Storybook:**
36
-
37
- Para iOS:
38
- ```bash
39
- yarn storybook:ios
40
- ```
41
-
42
- Para Android:
43
- ```bash
44
- yarn storybook:android
45
- ```
46
-
47
- ## 📚 Storybook
48
-
49
- Cada componente possui sua própria história no Storybook, permitindo visualizar e testar diferentes estados e propriedades. As histórias estão localizadas junto aos componentes com o padrão de nomenclatura `*.stories.jsx`.
50
-
51
- ## 🔗 Integração com o Projeto Principal
52
-
53
- Este Design System é um artefato do projeto principal [Sebrae Na Palma da Mão], um aplicativo móvel que funciona como uma agência do Sebrae na palma da mão. O aplicativo principal inclui diversas funcionalidades como:
54
-
55
- - Integração com redes sociais
56
- - Recursos de geolocalização e mapas
57
- - Funcionalidades de câmera e scanner QR Code
58
- - Recursos de compartilhamento e calendário
59
- - Suporte a chat e preview de links
60
- - E muito mais
61
-
62
- ## 🤝 Contribuição
63
-
64
- Antes de adicionar novos componentes ou fazer modificações:
65
-
66
- 1. Verifique se o componente segue os padrões visuais do Sebrae
67
- 2. Adicione a documentação apropriada no Storybook
68
- 3. Teste o componente em diferentes dispositivos
69
- 4. Certifique-se de que as alterações não quebram a compatibilidade com o projeto principal
70
-
71
- ## 📝 Licença
72
-
73
- Este projeto está sob a licença MIT.
1
+ <p align="center">
2
+ <img alt="Sebrae" src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d9/Sebrae.svg/2560px-Sebrae.svg.png" width="200" />
3
+ </p>
4
+
5
+ <h1 align="center">
6
+ Sebrae Design System - React Native
7
+ </h1>
8
+
9
+ <p align="center">
10
+ Design System em React Native para o projeto Sebrae Na Palma da Mão
11
+ </p>
12
+
13
+ ## 📋 Sobre o Projeto
14
+
15
+ Este é o repositório do Design System em React Native desenvolvido para o projeto Sebrae Na Palma da Mão. O objetivo é fornecer uma biblioteca de componentes reutilizáveis que seguem os padrões visuais e de interação do Sebrae, garantindo consistência e eficiência no desenvolvimento do aplicativo principal.
16
+
17
+ ## 🎨 Componentes Disponíveis
18
+
19
+ Atualmente, o Design System conta com os seguintes componentes:
20
+
21
+ - **Accordeon**: Componente expansível para exibição de conteúdo organizado
22
+ - **Button**: Botões primários seguindo o padrão visual do Sebrae
23
+ - **Checkbox**: Componente de seleção múltipla
24
+ - **FilterTag**: Tags para filtros e categorização
25
+ - **Input**: Campos de entrada de texto padronizados
26
+
27
+ ## 🚀 Como Usar
28
+
29
+ 1. **Instalação das dependências:**
30
+
31
+ ```bash
32
+ yarn
33
+ ```
34
+
35
+ 2. **Executando o Storybook:**
36
+
37
+ Para iOS:
38
+ ```bash
39
+ yarn storybook:ios
40
+ ```
41
+
42
+ Para Android:
43
+ ```bash
44
+ yarn storybook:android
45
+ ```
46
+
47
+ ## 📚 Storybook
48
+
49
+ Cada componente possui sua própria história no Storybook, permitindo visualizar e testar diferentes estados e propriedades. As histórias estão localizadas junto aos componentes com o padrão de nomenclatura `*.stories.jsx`.
50
+
51
+ ## 🔗 Integração com o Projeto Principal
52
+
53
+ Este Design System é um artefato do projeto principal [Sebrae Na Palma da Mão], um aplicativo móvel que funciona como uma agência do Sebrae na palma da mão. O aplicativo principal inclui diversas funcionalidades como:
54
+
55
+ - Integração com redes sociais
56
+ - Recursos de geolocalização e mapas
57
+ - Funcionalidades de câmera e scanner QR Code
58
+ - Recursos de compartilhamento e calendário
59
+ - Suporte a chat e preview de links
60
+ - E muito mais
61
+
62
+ ## 🤝 Contribuição
63
+
64
+ Antes de adicionar novos componentes ou fazer modificações:
65
+
66
+ 1. Verifique se o componente segue os padrões visuais do Sebrae
67
+ 2. Adicione a documentação apropriada no Storybook
68
+ 3. Teste o componente em diferentes dispositivos
69
+ 4. Certifique-se de que as alterações não quebram a compatibilidade com o projeto principal
70
+
71
+ ## 📝 Licença
72
+
73
+ Este projeto está sob a licença MIT.
@@ -1,92 +1,92 @@
1
- import { Text, View } from "react-native";
2
- import Accordion from ".";
3
-
4
- const meta = {
5
- title: "Atom/Accordion",
6
- component: Accordion,
7
- render: (props) => (
8
- <Accordion
9
- {...props}
10
- content={
11
- <View style={{ flexDirection: 'column' }}>
12
- <Text>{props.content}</Text>
13
- <Accordion
14
- nested
15
- title="Item 01"
16
- content={
17
- <Text>
18
- Sed nulla quam, fermentum tincidunt lacus at, viverra vehicula eros. Etiam neque libero, vulputate sed consectetur nec, imperdiet sed turpis.
19
- </Text>
20
- }
21
- />
22
- </View>
23
- }
24
- />
25
- ),
26
- tags: ["autodocs"],
27
- parameters: {
28
- layout: "centered",
29
- backgrounds: {
30
- default: "light",
31
- values: [
32
- {
33
- name: "light",
34
- value: "#f4f4f4"
35
- }
36
- ]
37
- }
38
- },
39
- argTypes: {
40
- title: {
41
- description: "Título do acordeon",
42
- control: "text",
43
- },
44
- content: {
45
- description: "Conteúdo que será exibido quando o acordeon estiver aberto",
46
- control: "text",
47
- },
48
- initiallyOpen: {
49
- description: "Define se o acordeon deve iniciar aberto",
50
- control: "boolean",
51
- },
52
- },
53
- };
54
-
55
- export default meta;
56
-
57
- // Estado Padrão
58
- export const Default = {
59
- args: {
60
- title: "Item",
61
- content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut finibus malesuada magna vitae dapibus. Etiam bibendum, tortor a mattis mattis, arcu quam imperdiet quam, at aliquam ex risus nec turpis. Suspendisse semper turpis ante, quis iaculis metus varius sed. Donec iaculis tortor nec auctor egestas.",
62
- initiallyOpen: false,
63
- },
64
- };
65
-
66
- // Estado Hover
67
- // export const Hover = {
68
- // args: {
69
- // ...Padrao.args,
70
- // },
71
- // parameters: {
72
- // pseudo: { hover: true },
73
- // },
74
- // };
75
-
76
- // Estado com Foco
77
- // export const Foco = {
78
- // args: {
79
- // ...Padrao.args,
80
- // },
81
- // parameters: {
82
- // pseudo: { focus: true },
83
- // },
84
- // };
85
-
86
- // Estado Ativo (Aberto)
87
- export const Open = {
88
- args: {
89
- ...Default.args,
90
- initiallyOpen: true,
91
- },
1
+ import { Text, View } from "react-native";
2
+ import Accordion from ".";
3
+
4
+ const meta = {
5
+ title: "Atom/Accordion",
6
+ component: Accordion,
7
+ render: (props) => (
8
+ <Accordion
9
+ {...props}
10
+ content={
11
+ <View style={{ flexDirection: 'column' }}>
12
+ <Text>{props.content}</Text>
13
+ <Accordion
14
+ nested
15
+ title="Item 01"
16
+ content={
17
+ <Text>
18
+ Sed nulla quam, fermentum tincidunt lacus at, viverra vehicula eros. Etiam neque libero, vulputate sed consectetur nec, imperdiet sed turpis.
19
+ </Text>
20
+ }
21
+ />
22
+ </View>
23
+ }
24
+ />
25
+ ),
26
+ tags: ["autodocs"],
27
+ parameters: {
28
+ layout: "centered",
29
+ backgrounds: {
30
+ default: "light",
31
+ values: [
32
+ {
33
+ name: "light",
34
+ value: "#f4f4f4"
35
+ }
36
+ ]
37
+ }
38
+ },
39
+ argTypes: {
40
+ title: {
41
+ description: "Título do acordeon",
42
+ control: "text",
43
+ },
44
+ content: {
45
+ description: "Conteúdo que será exibido quando o acordeon estiver aberto",
46
+ control: "text",
47
+ },
48
+ initiallyOpen: {
49
+ description: "Define se o acordeon deve iniciar aberto",
50
+ control: "boolean",
51
+ },
52
+ },
53
+ };
54
+
55
+ export default meta;
56
+
57
+ // Estado Padrão
58
+ export const Default = {
59
+ args: {
60
+ title: "Item",
61
+ content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut finibus malesuada magna vitae dapibus. Etiam bibendum, tortor a mattis mattis, arcu quam imperdiet quam, at aliquam ex risus nec turpis. Suspendisse semper turpis ante, quis iaculis metus varius sed. Donec iaculis tortor nec auctor egestas.",
62
+ initiallyOpen: false,
63
+ },
64
+ };
65
+
66
+ // Estado Hover
67
+ // export const Hover = {
68
+ // args: {
69
+ // ...Padrao.args,
70
+ // },
71
+ // parameters: {
72
+ // pseudo: { hover: true },
73
+ // },
74
+ // };
75
+
76
+ // Estado com Foco
77
+ // export const Foco = {
78
+ // args: {
79
+ // ...Padrao.args,
80
+ // },
81
+ // parameters: {
82
+ // pseudo: { focus: true },
83
+ // },
84
+ // };
85
+
86
+ // Estado Ativo (Aberto)
87
+ export const Open = {
88
+ args: {
89
+ ...Default.args,
90
+ initiallyOpen: true,
91
+ },
92
92
  };
@@ -1,145 +1,145 @@
1
- import React, { useState, useRef, useEffect } from 'react';
2
- import { View, Text, TouchableOpacity, StyleSheet, Animated, LayoutAnimation, Platform, UIManager } from 'react-native';
3
- import Icon from '../Icon';
4
-
5
- if (Platform.OS === 'android' && UIManager.setLayoutAnimationEnabledExperimental) {
6
- UIManager.setLayoutAnimationEnabledExperimental(true);
7
- }
8
-
9
- const Accordion = ({ title, content, nested = false, initiallyOpen = false }) => {
10
- const [isOpen, setIsOpen] = useState(initiallyOpen);
11
- const [isFocused, setIsFocused] = useState(false);
12
- const animation = useRef(new Animated.Value(initiallyOpen ? 1 : 0)).current;
13
-
14
- useEffect(() => {
15
- Animated.timing(animation, {
16
- toValue: isOpen ? 1 : 0,
17
- duration: 300,
18
- useNativeDriver: false,
19
- }).start();
20
- }, [isOpen]);
21
-
22
- const toggleAccordion = () => {
23
- LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
24
- setIsOpen(prev => !prev);
25
- };
26
-
27
- const contentHeight = animation.interpolate({
28
- inputRange: [0, 1],
29
- outputRange: [0, 500],
30
- });
31
-
32
- const contentOpacity = animation.interpolate({
33
- inputRange: [0, 1],
34
- outputRange: [0, 1],
35
- });
36
-
37
- const iconRotation = animation.interpolate({
38
- inputRange: [0, 1],
39
- outputRange: ['0deg', '180deg'],
40
- });
41
-
42
- return (
43
- <View style={[
44
- styles.container,
45
- nested && styles.containerNested,
46
- ]}>
47
- <TouchableOpacity
48
- activeOpacity={0.8}
49
- style={[
50
- styles.header,
51
- isFocused && !isOpen && styles.headerFocused,
52
- isOpen && !nested && styles.headerActive,
53
- ]}
54
- onPress={toggleAccordion}
55
- onPressIn={() => setIsFocused(true)}
56
- onPressOut={() => setIsFocused(false)}
57
- >
58
- <Text style={[styles.headerText, isOpen && !nested && styles.headerTextActive]}>
59
- {title}
60
- </Text>
61
- <Animated.View style={{ transform: [{ rotate: iconRotation }] }}>
62
- <Icon
63
- name="arrow-up-s-line"
64
- size={20}
65
- color={isOpen &&!nested? '#FFFFFF' : '#4F7CFE'}
66
- />
67
- </Animated.View>
68
- </TouchableOpacity>
69
-
70
- <Animated.View style={[
71
- styles.animatedContent,
72
- { maxHeight: contentHeight, opacity: contentOpacity }
73
- ]}>
74
- <View style={[
75
- styles.content,
76
- !nested && {
77
- borderTopColor: '#96ACFF',
78
- borderTopWidth: 2,
79
- },
80
- ]}>
81
- {content}
82
- {/* <Text style={styles.contentText}>{content}</Text> */}
83
- </View>
84
- </Animated.View>
85
- </View>
86
- );
87
- };
88
-
89
- const styles = StyleSheet.create({
90
- container: {
91
- borderRadius: 8,
92
- overflow: 'hidden',
93
- marginVertical: 8,
94
- borderWidth: 2,
95
- borderColor: '#96ACFF',
96
- backgroundColor: '#FFF'
97
- },
98
- containerNested: {
99
- borderColor: '#E2E9FC',
100
- borderWidth: 1,
101
- },
102
- header: {
103
- borderRadius: 8,
104
- borderTop: 8,
105
- flexDirection: 'row',
106
- justifyContent: 'space-between',
107
- alignItems: 'center',
108
- padding: 16,
109
- borderWidth: 2,
110
- borderColor: 'transparent',
111
- margin: -1,
112
- },
113
- headerFocused: {
114
- borderColor: '#4F7CFE',
115
- },
116
- headerActive: {
117
- borderBottomStartRadius: 0,
118
- borderBottomEndRadius: 0,
119
- backgroundColor: '#4F7CFE',
120
- borderColor: '#4F7CFE',
121
- },
122
- headerText: {
123
- fontSize: 16,
124
- fontWeight: '500',
125
- color: '#1B244B',
126
- },
127
- headerTextActive: {
128
- color: '#FFFFFF',
129
- },
130
- animatedContent: {
131
- overflow: 'hidden',
132
- },
133
- content: {
134
- backgroundColor: '#FFFFFF',
135
- padding: 16,
136
- width: '100%',
137
- },
138
- contentText: {
139
- fontSize: 14,
140
- lineHeight: 20,
141
- color: '#1B244B',
142
- },
143
- });
144
-
145
- export default Accordion;
1
+ import React, { useState, useRef, useEffect } from 'react';
2
+ import { View, Text, TouchableOpacity, StyleSheet, Animated, LayoutAnimation, Platform, UIManager } from 'react-native';
3
+ import Icon from '../Icon';
4
+
5
+ if (Platform.OS === 'android' && UIManager.setLayoutAnimationEnabledExperimental) {
6
+ UIManager.setLayoutAnimationEnabledExperimental(true);
7
+ }
8
+
9
+ const Accordion = ({ title, content, nested = false, initiallyOpen = false }) => {
10
+ const [isOpen, setIsOpen] = useState(initiallyOpen);
11
+ const [isFocused, setIsFocused] = useState(false);
12
+ const animation = useRef(new Animated.Value(initiallyOpen ? 1 : 0)).current;
13
+
14
+ useEffect(() => {
15
+ Animated.timing(animation, {
16
+ toValue: isOpen ? 1 : 0,
17
+ duration: 300,
18
+ useNativeDriver: false,
19
+ }).start();
20
+ }, [isOpen]);
21
+
22
+ const toggleAccordion = () => {
23
+ LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
24
+ setIsOpen(prev => !prev);
25
+ };
26
+
27
+ const contentHeight = animation.interpolate({
28
+ inputRange: [0, 1],
29
+ outputRange: [0, 500],
30
+ });
31
+
32
+ const contentOpacity = animation.interpolate({
33
+ inputRange: [0, 1],
34
+ outputRange: [0, 1],
35
+ });
36
+
37
+ const iconRotation = animation.interpolate({
38
+ inputRange: [0, 1],
39
+ outputRange: ['0deg', '180deg'],
40
+ });
41
+
42
+ return (
43
+ <View style={[
44
+ styles.container,
45
+ nested && styles.containerNested,
46
+ ]}>
47
+ <TouchableOpacity
48
+ activeOpacity={0.8}
49
+ style={[
50
+ styles.header,
51
+ isFocused && !isOpen && styles.headerFocused,
52
+ isOpen && !nested && styles.headerActive,
53
+ ]}
54
+ onPress={toggleAccordion}
55
+ onPressIn={() => setIsFocused(true)}
56
+ onPressOut={() => setIsFocused(false)}
57
+ >
58
+ <Text style={[styles.headerText, isOpen && !nested && styles.headerTextActive]}>
59
+ {title}
60
+ </Text>
61
+ <Animated.View style={{ transform: [{ rotate: iconRotation }] }}>
62
+ <Icon
63
+ name="arrow-up-s-line"
64
+ size={20}
65
+ color={isOpen &&!nested? '#FFFFFF' : '#4F7CFE'}
66
+ />
67
+ </Animated.View>
68
+ </TouchableOpacity>
69
+
70
+ <Animated.View style={[
71
+ styles.animatedContent,
72
+ { maxHeight: contentHeight, opacity: contentOpacity }
73
+ ]}>
74
+ <View style={[
75
+ styles.content,
76
+ !nested && {
77
+ borderTopColor: '#96ACFF',
78
+ borderTopWidth: 2,
79
+ },
80
+ ]}>
81
+ {content}
82
+ {/* <Text style={styles.contentText}>{content}</Text> */}
83
+ </View>
84
+ </Animated.View>
85
+ </View>
86
+ );
87
+ };
88
+
89
+ const styles = StyleSheet.create({
90
+ container: {
91
+ borderRadius: 8,
92
+ overflow: 'hidden',
93
+ marginVertical: 8,
94
+ borderWidth: 2,
95
+ borderColor: '#96ACFF',
96
+ backgroundColor: '#FFF'
97
+ },
98
+ containerNested: {
99
+ borderColor: '#E2E9FC',
100
+ borderWidth: 1,
101
+ },
102
+ header: {
103
+ borderRadius: 8,
104
+ borderTop: 8,
105
+ flexDirection: 'row',
106
+ justifyContent: 'space-between',
107
+ alignItems: 'center',
108
+ padding: 16,
109
+ borderWidth: 2,
110
+ borderColor: 'transparent',
111
+ margin: -1,
112
+ },
113
+ headerFocused: {
114
+ borderColor: '#4F7CFE',
115
+ },
116
+ headerActive: {
117
+ borderBottomStartRadius: 0,
118
+ borderBottomEndRadius: 0,
119
+ backgroundColor: '#4F7CFE',
120
+ borderColor: '#4F7CFE',
121
+ },
122
+ headerText: {
123
+ fontSize: 16,
124
+ fontWeight: '500',
125
+ color: '#1B244B',
126
+ },
127
+ headerTextActive: {
128
+ color: '#FFFFFF',
129
+ },
130
+ animatedContent: {
131
+ overflow: 'hidden',
132
+ },
133
+ content: {
134
+ backgroundColor: '#FFFFFF',
135
+ padding: 16,
136
+ width: '100%',
137
+ },
138
+ contentText: {
139
+ fontSize: 14,
140
+ lineHeight: 20,
141
+ color: '#1B244B',
142
+ },
143
+ });
144
+
145
+ export default Accordion;