vpt-sebraeds 0.0.6 → 0.0.7

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 (211) hide show
  1. package/README.md +73 -73
  2. package/assets/Vector.png +0 -0
  3. package/assets/edit-icon.png +0 -0
  4. package/components/Accordion/Accordion.stories.jsx +91 -91
  5. package/components/Accordion/index.jsx +145 -145
  6. package/components/AdBanner/AdBanner.stories.jsx +62 -62
  7. package/components/AdBanner/index.jsx +89 -89
  8. package/components/Avatar/Avatar.stories.jsx +59 -59
  9. package/components/Avatar/index.jsx +89 -89
  10. package/components/BottomSheet/BottomSheet.stories.jsx +378 -378
  11. package/components/BottomSheet/Components/ListaDeEstados.jsx +336 -336
  12. package/components/BottomSheet/index.jsx +299 -299
  13. package/components/Breadcrumb/Breadcrumb.stories.jsx +62 -62
  14. package/components/Breadcrumb/index.jsx +88 -88
  15. package/components/Button/ButtonPrimary.stories.jsx +311 -311
  16. package/components/Button/index.jsx +364 -364
  17. package/components/CardNumber/CardNumber.stories.jsx +60 -60
  18. package/components/CardNumber/index.jsx +133 -133
  19. package/components/Checkbox/Checkbox.stories.jsx +70 -70
  20. package/components/Checkbox/index.jsx +120 -120
  21. package/components/ContentBlock/ContentBlock.stories.tsx +48 -48
  22. package/components/ContentBlock/ContentBlock.tsx +50 -50
  23. package/components/ContentCard/ContentCard.stories.jsx +98 -98
  24. package/components/ContentCard/index.jsx +288 -288
  25. package/components/ContentRelatedCard/ContentRelatedCard.stories.jsx +79 -79
  26. package/components/ContentRelatedCard/index.jsx +79 -79
  27. package/components/ContentSlot/ContentSlot.stories.jsx +276 -276
  28. package/components/ContentSlot/index.jsx +195 -195
  29. package/components/Datepicker/Datepicker.stories.jsx +239 -239
  30. package/components/Datepicker/MonthSelector.jsx +322 -322
  31. package/components/Datepicker/TimeSelector.jsx +260 -260
  32. package/components/Datepicker/index.jsx +449 -449
  33. package/components/DonutChart/DonutChart.stories.jsx +220 -220
  34. package/components/DonutChart/index.jsx +190 -190
  35. package/components/Dropdown/Dropdown.stories.jsx +331 -331
  36. package/components/Dropdown/index.jsx +371 -371
  37. package/components/DropdownCommitments/index.js +147 -147
  38. package/components/EmptySlot/EmptySlot.stories.jsx +114 -114
  39. package/components/EmptySlot/index.jsx +151 -151
  40. package/components/FilterTag/FilterTag.stories.jsx +54 -54
  41. package/components/FilterTag/index.jsx +72 -72
  42. package/components/FilterableMultiSelect/FilterableMultiSelect.stories.jsx +63 -63
  43. package/components/FilterableMultiSelect/index.jsx +208 -208
  44. package/components/GettingStarted.jsx +38 -38
  45. package/components/Header/Header.stories.jsx +838 -838
  46. package/components/Header/components/Context.jsx +41 -41
  47. package/components/Header/components/Information.jsx +80 -80
  48. package/components/Header/components/Shortcut.jsx +48 -48
  49. package/components/Header/components/SwitchAccount.jsx +276 -276
  50. package/components/Header/components/Variants.jsx +181 -181
  51. package/components/Header/components/index.jsx +11 -11
  52. package/components/Header/index.jsx +206 -206
  53. package/components/Icon/iconEnums.ts +30 -30
  54. package/components/Icon/index.jsx +13 -13
  55. package/components/Image/Image.stories.jsx +250 -250
  56. package/components/Image/index.jsx +175 -175
  57. package/components/Input/Input.stories.jsx +303 -303
  58. package/components/Input/index.jsx +292 -292
  59. package/components/Legend/Legend.stories.jsx +110 -110
  60. package/components/Legend/index.jsx +86 -86
  61. package/components/Link/Link.stories.jsx +78 -78
  62. package/components/Link/index.jsx +62 -62
  63. package/components/List/List.stories.jsx +57 -57
  64. package/components/List/index.jsx +63 -63
  65. package/components/MenuAccordion/index.jsx +1 -1
  66. package/components/Modal/Modal.stories.jsx +151 -151
  67. package/components/Modal/index.jsx +247 -247
  68. package/components/Navbar/Navbar.stories.jsx +244 -244
  69. package/components/Navbar/index.jsx +129 -129
  70. package/components/NavigationItem/NavigationItem.stories.tsx +454 -454
  71. package/components/NavigationItem/index.tsx +526 -524
  72. package/components/NotificationBanner/NotificationBanner.stories.jsx +57 -57
  73. package/components/NotificationBanner/index.jsx +153 -153
  74. package/components/NotificationCard/NotificationCard.stories.jsx +93 -93
  75. package/components/NotificationCard/index.jsx +337 -337
  76. package/components/Pagination/Pagination.stories.jsx +170 -170
  77. package/components/Pagination/index.jsx +228 -228
  78. package/components/ProgressBar/ProgressBar.stories.jsx +354 -354
  79. package/components/ProgressBar/index.jsx +90 -90
  80. package/components/ProgressChart/ProgressChart.stories.jsx +312 -312
  81. package/components/ProgressChart/index.jsx +189 -189
  82. package/components/Quote/Quote.stories.tsx +32 -32
  83. package/components/Quote/Quote.tsx +60 -60
  84. package/components/RadioButton/RadioButton.stories.jsx +112 -112
  85. package/components/RadioButton/index.jsx +113 -113
  86. package/components/Rating/Rating.stories.jsx +157 -157
  87. package/components/Rating/index.jsx +145 -145
  88. package/components/SEIcon/index.js +30 -30
  89. package/components/SEText/index.d.ts +58 -58
  90. package/components/SEText/index.js +160 -160
  91. package/components/SEText/styles.js +333 -333
  92. package/components/ScrollBar/ScrollBar.stories.tsx +65 -65
  93. package/components/ScrollBar/index.tsx +118 -118
  94. package/components/Search/Search.jsx +328 -328
  95. package/components/Search/Search.stories.jsx +92 -92
  96. package/components/Select/Select.stories.jsx +415 -415
  97. package/components/Select/index.jsx +307 -307
  98. package/components/SelectItem/SelectItem.stories.jsx +608 -608
  99. package/components/SelectItem/index.jsx +173 -173
  100. package/components/Shortcut/Shortcut.stories.jsx +145 -145
  101. package/components/Shortcut/index.jsx +182 -182
  102. package/components/ShowMore/ShowMore.stories.jsx +70 -70
  103. package/components/ShowMore/index.jsx +67 -67
  104. package/components/ShuffleItem/ShuffleItem.stories.jsx +278 -278
  105. package/components/ShuffleItem/index.jsx +701 -701
  106. package/components/Slider/Slider.stories.jsx +248 -248
  107. package/components/Slider/index.jsx +210 -210
  108. package/components/Tab/Tab.stories.jsx +323 -323
  109. package/components/Tab/index.jsx +482 -482
  110. package/components/Table/Table.stories.jsx +253 -253
  111. package/components/Table/index.jsx +291 -291
  112. package/components/Tag/Tag.stories.jsx +78 -78
  113. package/components/Tag/index.d.ts +10 -10
  114. package/components/Tag/index.jsx +128 -128
  115. package/components/TaskCard/TaskCard.stories.jsx +467 -467
  116. package/components/TaskCard/assets/README.md +22 -22
  117. package/components/TaskCard/assets/example.js +10 -10
  118. package/components/TaskCard/components/EditIcon.jsx +78 -81
  119. package/components/TaskCard/components/SuccessContent.jsx +52 -52
  120. package/components/TaskCard/components/SuccessIcon.jsx +52 -52
  121. package/components/TaskCard/components/SuccessTitle.jsx +48 -48
  122. package/components/TaskCard/components/Tag.jsx +79 -79
  123. package/components/TaskCard/components/TagGroup.jsx +60 -60
  124. package/components/TaskCard/components/TaskDescription.jsx +50 -50
  125. package/components/TaskCard/components/index.js +7 -7
  126. package/components/TaskCard/index.jsx +295 -295
  127. package/components/Toast/Toast.stories.jsx +238 -238
  128. package/components/Toast/index.jsx +307 -307
  129. package/components/Toggle/Toggle.stories.jsx +160 -160
  130. package/components/Toggle/index.jsx +143 -143
  131. package/components/TooltipCard/TooltipCard.stories.jsx +88 -88
  132. package/components/TooltipCard/index.jsx +353 -353
  133. package/components/Typography/Typography.stories.jsx +261 -261
  134. package/components/Typography/index.jsx +136 -136
  135. package/components/styles/colors.js +204 -204
  136. package/components/styles/fonts.js +15 -15
  137. package/components/styles/index,js +6 -6
  138. package/components/styles/metrics.js +13 -13
  139. package/components/styles.ts +79 -79
  140. package/dist/components/Accordion/index.js +16 -16
  141. package/dist/components/AdBanner/index.js +12 -12
  142. package/dist/components/Avatar/index.js +6 -6
  143. package/dist/components/BottomSheet/Components/ListaDeEstados.js +10 -10
  144. package/dist/components/BottomSheet/index.js +33 -33
  145. package/dist/components/Breadcrumb/index.js +7 -7
  146. package/dist/components/Button/index.js +12 -12
  147. package/dist/components/CardNumber/index.js +16 -16
  148. package/dist/components/Checkbox/index.js +7 -7
  149. package/dist/components/ContentBlock/ContentBlock.js +7 -7
  150. package/dist/components/ContentCard/index.js +48 -48
  151. package/dist/components/ContentRelatedCard/index.js +10 -10
  152. package/dist/components/ContentSlot/index.js +31 -31
  153. package/dist/components/Datepicker/MonthSelector.js +13 -13
  154. package/dist/components/Datepicker/TimeSelector.js +15 -15
  155. package/dist/components/Datepicker/index.js +60 -60
  156. package/dist/components/DonutChart/index.js +19 -19
  157. package/dist/components/Dropdown/index.js +46 -46
  158. package/dist/components/DropdownCommitments/index.js +24 -24
  159. package/dist/components/EmptySlot/index.js +19 -19
  160. package/dist/components/FilterTag/index.js +7 -7
  161. package/dist/components/FilterableMultiSelect/index.js +22 -22
  162. package/dist/components/GettingStarted.js +8 -8
  163. package/dist/components/Header/components/Context.js +2 -2
  164. package/dist/components/Header/components/Information.js +12 -12
  165. package/dist/components/Header/components/SwitchAccount.js +43 -43
  166. package/dist/components/Header/components/Variants.js +31 -31
  167. package/dist/components/Header/index.js +5 -5
  168. package/dist/components/Image/index.js +22 -22
  169. package/dist/components/Input/index.js +9 -9
  170. package/dist/components/Legend/index.js +8 -8
  171. package/dist/components/Link/index.js +5 -5
  172. package/dist/components/List/index.js +7 -7
  173. package/dist/components/MenuAccordion/index.js +1 -1
  174. package/dist/components/Modal/index.js +38 -38
  175. package/dist/components/Navbar/index.js +9 -9
  176. package/dist/components/NavigationItem/index.d.ts.map +1 -1
  177. package/dist/components/NavigationItem/index.js +32 -32
  178. package/dist/components/NotificationBanner/index.js +8 -8
  179. package/dist/components/NotificationCard/index.js +41 -41
  180. package/dist/components/Pagination/index.js +23 -23
  181. package/dist/components/ProgressBar/index.js +14 -14
  182. package/dist/components/ProgressChart/index.js +29 -29
  183. package/dist/components/Quote/Quote.js +9 -9
  184. package/dist/components/RadioButton/index.js +7 -7
  185. package/dist/components/Rating/index.js +9 -9
  186. package/dist/components/SEText/index.js +2 -2
  187. package/dist/components/ScrollBar/index.js +7 -7
  188. package/dist/components/Search/Search.js +45 -45
  189. package/dist/components/Select/index.js +16 -16
  190. package/dist/components/SelectItem/index.js +6 -6
  191. package/dist/components/Shortcut/index.js +6 -6
  192. package/dist/components/ShowMore/index.js +7 -7
  193. package/dist/components/ShuffleItem/index.js +98 -98
  194. package/dist/components/Slider/index.js +20 -20
  195. package/dist/components/Tab/index.js +26 -26
  196. package/dist/components/Table/index.js +36 -36
  197. package/dist/components/Tag/index.js +5 -5
  198. package/dist/components/TaskCard/components/EditIcon.d.ts.map +1 -1
  199. package/dist/components/TaskCard/components/EditIcon.js +4 -6
  200. package/dist/components/TaskCard/components/SuccessContent.js +3 -3
  201. package/dist/components/TaskCard/components/SuccessIcon.js +2 -2
  202. package/dist/components/TaskCard/components/SuccessTitle.js +2 -2
  203. package/dist/components/TaskCard/components/Tag.js +4 -4
  204. package/dist/components/TaskCard/components/TagGroup.js +4 -4
  205. package/dist/components/TaskCard/components/TaskDescription.js +2 -2
  206. package/dist/components/TaskCard/index.js +50 -50
  207. package/dist/components/Toast/index.js +45 -45
  208. package/dist/components/Toggle/index.js +3 -3
  209. package/dist/components/TooltipCard/index.js +46 -46
  210. package/dist/components/Typography/index.js +2 -2
  211. package/package.json +125 -125
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.
Binary file
Binary file
@@ -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;