@ftdata/ui 0.0.1

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 (265) hide show
  1. package/README.md +23 -0
  2. package/dist/assets/AddIcon.d.ts +3 -0
  3. package/dist/assets/AddIcon.js +35 -0
  4. package/dist/assets/ArrowLeftIcon.d.ts +2 -0
  5. package/dist/assets/ArrowLeftIcon.js +26 -0
  6. package/dist/assets/BackArrowIcon.d.ts +3 -0
  7. package/dist/assets/BackArrowIcon.js +35 -0
  8. package/dist/assets/BellIcon.d.ts +2 -0
  9. package/dist/assets/BellIcon.js +43 -0
  10. package/dist/assets/BuildingIcon.d.ts +2 -0
  11. package/dist/assets/BuildingIcon.js +15 -0
  12. package/dist/assets/BurgerMenu.d.ts +3 -0
  13. package/dist/assets/BurgerMenu.js +41 -0
  14. package/dist/assets/CancelSquareIcon.d.ts +3 -0
  15. package/dist/assets/CancelSquareIcon.js +36 -0
  16. package/dist/assets/CarretDownIcon.d.ts +3 -0
  17. package/dist/assets/CarretDownIcon.js +32 -0
  18. package/dist/assets/CavetDown.d.ts +2 -0
  19. package/dist/assets/CavetDown.js +18 -0
  20. package/dist/assets/CavetRight.d.ts +2 -0
  21. package/dist/assets/CavetRight.js +18 -0
  22. package/dist/assets/CavetUp.d.ts +2 -0
  23. package/dist/assets/CavetUp.js +18 -0
  24. package/dist/assets/CheckMarkIcon.d.ts +3 -0
  25. package/dist/assets/CheckMarkIcon.js +39 -0
  26. package/dist/assets/CheckmarkDone.d.ts +3 -0
  27. package/dist/assets/CheckmarkDone.js +27 -0
  28. package/dist/assets/CloseIcon.d.ts +2 -0
  29. package/dist/assets/CloseIcon.js +27 -0
  30. package/dist/assets/CommandIcon.d.ts +2 -0
  31. package/dist/assets/CommandIcon.js +77 -0
  32. package/dist/assets/DoneCircleIcon.d.ts +3 -0
  33. package/dist/assets/DoneCircleIcon.js +29 -0
  34. package/dist/assets/EmptyAlertDetail.d.ts +2 -0
  35. package/dist/assets/EmptyAlertDetail.js +451 -0
  36. package/dist/assets/EmptyPage.d.ts +3 -0
  37. package/dist/assets/EmptyPage.js +551 -0
  38. package/dist/assets/EyeIcon.d.ts +2 -0
  39. package/dist/assets/EyeIcon.js +35 -0
  40. package/dist/assets/FenceIcon.d.ts +2 -0
  41. package/dist/assets/FenceIcon.js +70 -0
  42. package/dist/assets/FolderCheckmark.d.ts +3 -0
  43. package/dist/assets/FolderCheckmark.js +44 -0
  44. package/dist/assets/FulltrackLogo.d.ts +3 -0
  45. package/dist/assets/FulltrackLogo.js +37 -0
  46. package/dist/assets/GlobeIcon.d.ts +2 -0
  47. package/dist/assets/GlobeIcon.js +61 -0
  48. package/dist/assets/GoogleIcon.d.ts +2 -0
  49. package/dist/assets/GoogleIcon.js +18 -0
  50. package/dist/assets/Group.js +2 -0
  51. package/dist/assets/MinusMarkIcon.d.ts +3 -0
  52. package/dist/assets/MinusMarkIcon.js +40 -0
  53. package/dist/assets/MosaicIcon.d.ts +3 -0
  54. package/dist/assets/MosaicIcon.js +41 -0
  55. package/dist/assets/NavLogo.d.ts +3 -0
  56. package/dist/assets/NavLogo.js +73 -0
  57. package/dist/assets/PinLocation.d.ts +2 -0
  58. package/dist/assets/PinLocation.js +31 -0
  59. package/dist/assets/PlusAddIcon.d.ts +2 -0
  60. package/dist/assets/PlusAddIcon.js +42 -0
  61. package/dist/assets/RefreshIcon.d.ts +2 -0
  62. package/dist/assets/RefreshIcon.js +16 -0
  63. package/dist/assets/SearchIcon.d.ts +3 -0
  64. package/dist/assets/SearchIcon.js +30 -0
  65. package/dist/assets/SendIcon.d.ts +3 -0
  66. package/dist/assets/SendIcon.js +20 -0
  67. package/dist/assets/StreetView.d.ts +2 -0
  68. package/dist/assets/StreetView.js +52 -0
  69. package/dist/assets/SwitchCheckMarkIcon.d.ts +3 -0
  70. package/dist/assets/SwitchCheckMarkIcon.js +40 -0
  71. package/dist/assets/WarningIcon.d.ts +2 -0
  72. package/dist/assets/WarningIcon.js +34 -0
  73. package/dist/assets/gif/how-to-use.js +2 -0
  74. package/dist/assets/iconMenu/SettingsIcon.d.ts +2 -0
  75. package/dist/assets/iconMenu/SettingsIcon.js +30 -0
  76. package/dist/assets/img/cover.js +2 -0
  77. package/dist/assets/img/map-sample.js +2 -0
  78. package/dist/assets/img/photo-goes-here.js +2 -0
  79. package/dist/assets/svg/chat.js +2 -0
  80. package/dist/assets/svg/colored-item.js +2 -0
  81. package/dist/assets/svg/mailbox-bro.js +2 -0
  82. package/dist/assets/svg/star-favorite.js +2 -0
  83. package/dist/assets/travolta.js +2 -0
  84. package/dist/components/Avatar/Avatar.stories.d.ts +33 -0
  85. package/dist/components/Avatar/Avatar.stories.js +177 -0
  86. package/dist/components/Avatar/index.d.ts +7 -0
  87. package/dist/components/Avatar/index.js +28 -0
  88. package/dist/components/Avatar/styles.d.ts +4 -0
  89. package/dist/components/Avatar/styles.js +37 -0
  90. package/dist/components/Avatar/utils/getAvatarColors.d.ts +6 -0
  91. package/dist/components/Avatar/utils/getAvatarColors.js +48 -0
  92. package/dist/components/Breadcrumb/Breadcrumb.stories.d.ts +17 -0
  93. package/dist/components/Breadcrumb/Breadcrumb.stories.js +51 -0
  94. package/dist/components/Breadcrumb/index.d.ts +10 -0
  95. package/dist/components/Breadcrumb/index.js +34 -0
  96. package/dist/components/Breadcrumb/styles.d.ts +9 -0
  97. package/dist/components/Breadcrumb/styles.js +43 -0
  98. package/dist/components/Button/Button.stories.d.ts +58 -0
  99. package/dist/components/Button/Button.stories.js +284 -0
  100. package/dist/components/Button/index.d.ts +26 -0
  101. package/dist/components/Button/index.js +69 -0
  102. package/dist/components/Button/modifiers.d.ts +8 -0
  103. package/dist/components/Button/modifiers.js +41 -0
  104. package/dist/components/Button/styles.d.ts +25 -0
  105. package/dist/components/Button/styles.js +111 -0
  106. package/dist/components/Checkbox/CheckMarkIcon.d.ts +3 -0
  107. package/dist/components/Checkbox/CheckMarkIcon.js +38 -0
  108. package/dist/components/Checkbox/Checkbox.stories.d.ts +35 -0
  109. package/dist/components/Checkbox/Checkbox.stories.js +101 -0
  110. package/dist/components/Checkbox/MinusMarkIcon.d.ts +3 -0
  111. package/dist/components/Checkbox/MinusMarkIcon.js +39 -0
  112. package/dist/components/Checkbox/index.d.ts +9 -0
  113. package/dist/components/Checkbox/index.js +40 -0
  114. package/dist/components/Checkbox/styles.d.ts +12 -0
  115. package/dist/components/Checkbox/styles.js +41 -0
  116. package/dist/components/Collapse/Colapse.stories.d.ts +10 -0
  117. package/dist/components/Collapse/Colapse.stories.js +108 -0
  118. package/dist/components/Collapse/index.d.ts +15 -0
  119. package/dist/components/Collapse/index.js +61 -0
  120. package/dist/components/Collapse/styles.d.ts +11 -0
  121. package/dist/components/Collapse/styles.js +23 -0
  122. package/dist/components/CustomSelect/CustomSelect.stories.d.ts +73 -0
  123. package/dist/components/CustomSelect/CustomSelect.stories.js +477 -0
  124. package/dist/components/CustomSelect/CustomSelectList/index.d.ts +10 -0
  125. package/dist/components/CustomSelect/CustomSelectList/index.js +66 -0
  126. package/dist/components/CustomSelect/CustomSelectList/style.d.ts +8 -0
  127. package/dist/components/CustomSelect/CustomSelectList/style.js +95 -0
  128. package/dist/components/CustomSelect/index.d.ts +30 -0
  129. package/dist/components/CustomSelect/index.js +193 -0
  130. package/dist/components/CustomSelect/styles.d.ts +22 -0
  131. package/dist/components/CustomSelect/styles.js +93 -0
  132. package/dist/components/DoubleList/DoubleList.stories.d.ts +13 -0
  133. package/dist/components/DoubleList/DoubleList.stories.js +82 -0
  134. package/dist/components/DoubleList/index.d.ts +9 -0
  135. package/dist/components/DoubleList/index.js +70 -0
  136. package/dist/components/DoubleList/style.d.ts +5 -0
  137. package/dist/components/DoubleList/style.js +92 -0
  138. package/dist/components/EmptyState/Empty.stories.d.ts +26 -0
  139. package/dist/components/EmptyState/Empty.stories.js +72 -0
  140. package/dist/components/EmptyState/index.d.ts +10 -0
  141. package/dist/components/EmptyState/index.js +48 -0
  142. package/dist/components/EmptyState/styles.d.ts +3 -0
  143. package/dist/components/EmptyState/styles.js +39 -0
  144. package/dist/components/Grid/Column/Column.stories.d.ts +26 -0
  145. package/dist/components/Grid/Column/Column.stories.js +335 -0
  146. package/dist/components/Grid/Column/index.d.ts +15 -0
  147. package/dist/components/Grid/Column/index.js +10 -0
  148. package/dist/components/Grid/Container/Container.stories.d.ts +11 -0
  149. package/dist/components/Grid/Container/Container.stories.js +114 -0
  150. package/dist/components/Grid/Container/index.d.ts +6 -0
  151. package/dist/components/Grid/Container/index.js +11 -0
  152. package/dist/components/Grid/Row/Row.stories.d.ts +22 -0
  153. package/dist/components/Grid/Row/Row.stories.js +248 -0
  154. package/dist/components/Grid/Row/index.d.ts +20 -0
  155. package/dist/components/Grid/Row/index.js +10 -0
  156. package/dist/components/Grid/index.d.ts +38 -0
  157. package/dist/components/Grid/index.js +121 -0
  158. package/dist/components/Grid/utils.d.ts +1 -0
  159. package/dist/components/Grid/utils.js +18 -0
  160. package/dist/components/Loading/Loading/index.d.ts +7 -0
  161. package/dist/components/Loading/Loading/index.js +9 -0
  162. package/dist/components/Loading/Loading.stories.d.ts +24 -0
  163. package/dist/components/Loading/Loading.stories.js +145 -0
  164. package/dist/components/Loading/index.d.ts +16 -0
  165. package/dist/components/Loading/index.js +98 -0
  166. package/dist/components/Menu/constants/icons.d.ts +17 -0
  167. package/dist/components/Menu/constants/icons.js +61 -0
  168. package/dist/components/Menu/helpers/createMenus.d.ts +2 -0
  169. package/dist/components/Menu/helpers/createMenus.js +20 -0
  170. package/dist/components/Menu/helpers/createSubMenus.d.ts +2 -0
  171. package/dist/components/Menu/helpers/createSubMenus.js +13 -0
  172. package/dist/components/Menu/helpers/generateColorScale.d.ts +1 -0
  173. package/dist/components/Menu/helpers/generateColorScale.js +62 -0
  174. package/dist/components/Menu/helpers/getLuminance.d.ts +1 -0
  175. package/dist/components/Menu/helpers/getLuminance.js +9 -0
  176. package/dist/components/Menu/index.d.ts +12 -0
  177. package/dist/components/Menu/index.js +108 -0
  178. package/dist/components/Menu/styles.d.ts +17 -0
  179. package/dist/components/Menu/styles.js +202 -0
  180. package/dist/components/Menu/types/IconKeysType.d.ts +2 -0
  181. package/dist/components/Menu/types/IconKeysType.js +0 -0
  182. package/dist/components/Menu/types/MenuItem.d.ts +26 -0
  183. package/dist/components/Menu/types/MenuItem.js +0 -0
  184. package/dist/components/MultiSelect/Badge/index.d.ts +6 -0
  185. package/dist/components/MultiSelect/Badge/index.js +31 -0
  186. package/dist/components/MultiSelect/Badge/styles.d.ts +1 -0
  187. package/dist/components/MultiSelect/Badge/styles.js +57 -0
  188. package/dist/components/MultiSelect/MultiSelect.stories.d.ts +61 -0
  189. package/dist/components/MultiSelect/MultiSelect.stories.js +336 -0
  190. package/dist/components/MultiSelect/MultiSelectList/index.d.ts +10 -0
  191. package/dist/components/MultiSelect/MultiSelectList/index.js +59 -0
  192. package/dist/components/MultiSelect/MultiSelectList/style.d.ts +3 -0
  193. package/dist/components/MultiSelect/MultiSelectList/style.js +82 -0
  194. package/dist/components/MultiSelect/calcTextSize.d.ts +1 -0
  195. package/dist/components/MultiSelect/calcTextSize.js +10 -0
  196. package/dist/components/MultiSelect/index.d.ts +24 -0
  197. package/dist/components/MultiSelect/index.js +284 -0
  198. package/dist/components/MultiSelect/styles.d.ts +24 -0
  199. package/dist/components/MultiSelect/styles.js +165 -0
  200. package/dist/components/Radio/Radio.stories.d.ts +18 -0
  201. package/dist/components/Radio/Radio.stories.js +30 -0
  202. package/dist/components/Radio/index.d.ts +7 -0
  203. package/dist/components/Radio/index.js +27 -0
  204. package/dist/components/Radio/story.d.ts +5 -0
  205. package/dist/components/Radio/story.js +47 -0
  206. package/dist/components/Radio/styles.d.ts +8 -0
  207. package/dist/components/Radio/styles.js +43 -0
  208. package/dist/components/StateAlert/StateAlert.stories.d.ts +46 -0
  209. package/dist/components/StateAlert/StateAlert.stories.js +189 -0
  210. package/dist/components/StateAlert/index.d.ts +22 -0
  211. package/dist/components/StateAlert/index.js +56 -0
  212. package/dist/components/StateAlert/styles.d.ts +7 -0
  213. package/dist/components/StateAlert/styles.js +124 -0
  214. package/dist/components/Switch/Switch.stories.d.ts +26 -0
  215. package/dist/components/Switch/Switch.stories.js +81 -0
  216. package/dist/components/Switch/index.d.ts +8 -0
  217. package/dist/components/Switch/index.js +26 -0
  218. package/dist/components/Switch/styles.d.ts +15 -0
  219. package/dist/components/Switch/styles.js +33 -0
  220. package/dist/components/Text/Paragraph/Paragraph.stories.d.ts +29 -0
  221. package/dist/components/Text/Paragraph/Paragraph.stories.js +124 -0
  222. package/dist/components/Text/Title/Title.stories.d.ts +41 -0
  223. package/dist/components/Text/Title/Title.stories.js +106 -0
  224. package/dist/components/Text/index.d.ts +3 -0
  225. package/dist/components/Text/index.js +17 -0
  226. package/dist/components/Text/styles.d.ts +23 -0
  227. package/dist/components/Text/styles.js +70 -0
  228. package/dist/components/TextArea/Textarea.stories.d.ts +33 -0
  229. package/dist/components/TextArea/Textarea.stories.js +65 -0
  230. package/dist/components/TextArea/index.d.ts +10 -0
  231. package/dist/components/TextArea/index.js +39 -0
  232. package/dist/components/TextArea/styles.d.ts +18 -0
  233. package/dist/components/TextArea/styles.js +88 -0
  234. package/dist/components/TooltipWrapper/Tooltip.stories.d.ts +21 -0
  235. package/dist/components/TooltipWrapper/Tooltip.stories.js +54 -0
  236. package/dist/components/TooltipWrapper/index.d.ts +20 -0
  237. package/dist/components/TooltipWrapper/index.js +56 -0
  238. package/dist/components/TooltipWrapper/styles.d.ts +6 -0
  239. package/dist/components/TooltipWrapper/styles.js +20 -0
  240. package/dist/components/Tooltips/Tooltips.stories.d.ts +25 -0
  241. package/dist/components/Tooltips/Tooltips.stories.js +139 -0
  242. package/dist/components/Tooltips/index.d.ts +8 -0
  243. package/dist/components/Tooltips/index.js +28 -0
  244. package/dist/components/Tooltips/styles.d.ts +5 -0
  245. package/dist/components/Tooltips/styles.js +37 -0
  246. package/dist/components/UserMenu/UserMenu.stories.d.ts +26 -0
  247. package/dist/components/UserMenu/UserMenu.stories.js +174 -0
  248. package/dist/components/UserMenu/index.d.ts +19 -0
  249. package/dist/components/UserMenu/index.js +64 -0
  250. package/dist/components/UserMenu/style.d.ts +2 -0
  251. package/dist/components/UserMenu/style.js +44 -0
  252. package/dist/index.d.ts +3 -0
  253. package/dist/index.js +3 -0
  254. package/dist/static/image/cover.png +0 -0
  255. package/dist/static/image/how-to-use.gif +0 -0
  256. package/dist/static/image/map-sample.png +0 -0
  257. package/dist/static/image/photo-goes-here.png +0 -0
  258. package/dist/static/image/travolta.jpg +0 -0
  259. package/dist/static/svg/Group.svg +5 -0
  260. package/dist/static/svg/chat.svg +10 -0
  261. package/dist/static/svg/colored-item.svg +9 -0
  262. package/dist/static/svg/mailbox-bro.svg +102 -0
  263. package/dist/static/svg/star-favorite.svg +3 -0
  264. package/dist/style/_reset.css +205 -0
  265. package/package.json +43 -0
@@ -0,0 +1,46 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import StateAlert from ".";
3
+ /**
4
+ * StateAlert é um componente de alerta visual, usado para informar o estado atual de uma ação (sucesso, erro, alerta, etc.).
5
+ * Ele pode ser customizado com estilos próprios e configurado para exibir uma mensagem, ícone e barra de progresso.
6
+ * ##### importante: para a documentação ele está fixo na tela através da prop keep, por padrão essa prop não é atribuida e o componente desaparece da tela assim que acaba a animação.
7
+ */
8
+ declare const meta: Meta<typeof StateAlert>;
9
+ export default meta;
10
+ type Story = StoryObj<typeof meta>;
11
+ /**
12
+ * Exemplo padrão do StateAlert com o tipo "success" e uma mensagem de sucesso.
13
+ */
14
+ export declare const Default: Story;
15
+ /**
16
+ * Alerta do tipo "danger" para indicar um erro crítico.
17
+ */
18
+ export declare const Danger: Story;
19
+ /**
20
+ * Alerta do tipo "warning" para indicar um aviso.
21
+ */
22
+ export declare const Warning: Story;
23
+ /**
24
+ * Alerta do tipo "success" para indicar uma ação bem sucedida.
25
+ */
26
+ export declare const Success: Story;
27
+ /**
28
+ * Alerta personalizado com ícone e estilos próprios.
29
+ */
30
+ export declare const CustomStyle: Story;
31
+ /**
32
+ * Alerta com uma duração personalizada.
33
+ */
34
+ export declare const Duration: Story;
35
+ /**
36
+ * Alerta com ícone de sucesso e uma mensagem informativa.
37
+ */
38
+ export declare const CustomIcon: Story;
39
+ /**
40
+ * Alerta com o ciclo de vida completo.
41
+ */
42
+ export declare const Unkeep: Story;
43
+ /**
44
+ * Exemplo usando on close para colocar o StateAlert em loop.
45
+ */
46
+ export declare const OnClose: Story;
@@ -0,0 +1,189 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import index from "./index.js";
4
+ import { Icon } from "@ftdata/f-icons";
5
+ const meta = {
6
+ title: "DESIGN COMPONENTS/StateAlert",
7
+ component: index,
8
+ tags: [
9
+ "autodocs"
10
+ ],
11
+ parameters: {
12
+ layout: "centered"
13
+ },
14
+ argTypes: {
15
+ type: {
16
+ description: "Define o tipo do alerta",
17
+ control: {
18
+ type: "inline-radio"
19
+ },
20
+ options: [
21
+ "success",
22
+ "danger",
23
+ "warning",
24
+ "custom"
25
+ ],
26
+ table: {
27
+ defaultValue: {
28
+ summary: "success"
29
+ },
30
+ type: {
31
+ summary: '"success" | "danger" | "warning" | "custom"'
32
+ }
33
+ }
34
+ },
35
+ customStyle: {
36
+ description: "Estilos personalizados para o container e progress bar do alerta.",
37
+ table: {
38
+ type: {
39
+ summary: "ICustomStyle"
40
+ }
41
+ },
42
+ control: {
43
+ type: "object"
44
+ }
45
+ },
46
+ duration: {
47
+ description: "Dura\xe7\xe3o do alerta em milissegundos.",
48
+ table: {
49
+ type: {
50
+ summary: "number"
51
+ },
52
+ defaultValue: {
53
+ summary: "5000"
54
+ }
55
+ }
56
+ },
57
+ icon: {
58
+ description: "\xcdcone exibido no alerta.",
59
+ table: {
60
+ type: {
61
+ summary: "JSX.Element"
62
+ }
63
+ }
64
+ },
65
+ message: {
66
+ description: "Mensagem de texto exibida no alerta.",
67
+ table: {
68
+ type: {
69
+ summary: "string"
70
+ }
71
+ }
72
+ },
73
+ onClose: {
74
+ description: "Recebe uma fun\xe7\xe3o que define o que o componente ir\xe1 fazer quando ele fechar."
75
+ }
76
+ }
77
+ };
78
+ const StateAlert_stories = meta;
79
+ const Default = {
80
+ args: {
81
+ type: "success",
82
+ keep: true,
83
+ message: "Opera\xe7\xe3o conclu\xedda com sucesso!"
84
+ }
85
+ };
86
+ const Danger = {
87
+ args: {
88
+ type: "danger",
89
+ keep: true,
90
+ icon: /*#__PURE__*/ jsx(Icon, {
91
+ name: "ui warning-circle",
92
+ color: "currentColor"
93
+ }),
94
+ message: "Alerta de erro!"
95
+ }
96
+ };
97
+ const Warning = {
98
+ args: {
99
+ type: "warning",
100
+ keep: true,
101
+ icon: /*#__PURE__*/ jsx(Icon, {
102
+ name: "ui warning-triangle",
103
+ color: "currentColor"
104
+ }),
105
+ message: "Alerta de aviso"
106
+ }
107
+ };
108
+ const Success = {
109
+ args: {
110
+ type: "success",
111
+ keep: true,
112
+ icon: /*#__PURE__*/ jsx(Icon, {
113
+ name: "ui checkmark-done-check",
114
+ color: "currentColor"
115
+ }),
116
+ message: "Alerta de sucesso!"
117
+ }
118
+ };
119
+ const CustomStyle = {
120
+ args: {
121
+ type: "custom",
122
+ customStyle: {
123
+ container: {
124
+ color: "#ff5656",
125
+ background: "#f5f5f5"
126
+ },
127
+ progressbar: {
128
+ progress: "#e44d4d",
129
+ background: "#ffa3a3"
130
+ }
131
+ },
132
+ icon: /*#__PURE__*/ jsx(Icon, {
133
+ name: "ui stars-light-sparkle-alt",
134
+ color: "currentColor"
135
+ }),
136
+ keep: true,
137
+ message: "Alerta personalizado!"
138
+ }
139
+ };
140
+ const Duration = {
141
+ args: {
142
+ type: "success",
143
+ duration: 2000,
144
+ keep: true,
145
+ message: "Este alerta ser\xe1 dura 2000ms.",
146
+ icon: /*#__PURE__*/ jsx(Icon, {
147
+ name: "ui clock-time-arrow",
148
+ color: "currentColor"
149
+ })
150
+ }
151
+ };
152
+ const CustomIcon = {
153
+ args: {
154
+ type: "success",
155
+ icon: /*#__PURE__*/ jsx(Icon, {
156
+ name: "eml calendar-schedule",
157
+ color: "currentColor"
158
+ }),
159
+ keep: true,
160
+ message: "A\xe7\xe3o realizada com sucesso!"
161
+ }
162
+ };
163
+ const Unkeep = {
164
+ args: {
165
+ type: "success",
166
+ icon: /*#__PURE__*/ jsx(Icon, {
167
+ name: "ui sticker-smile-1",
168
+ color: "currentColor"
169
+ }),
170
+ message: "Saindo da tela em breve"
171
+ }
172
+ };
173
+ const OnClose = {
174
+ render: ()=>{
175
+ const [isAlertVisible, setIsAlertVisible] = useState(true);
176
+ const handleAlertClose = ()=>{
177
+ setIsAlertVisible(false);
178
+ setTimeout(()=>setIsAlertVisible(true), 500);
179
+ };
180
+ return /*#__PURE__*/ jsx("div", {
181
+ children: isAlertVisible && /*#__PURE__*/ jsx(index, {
182
+ type: "success",
183
+ message: "Alert em loop com o onClose",
184
+ onClose: handleAlertClose
185
+ })
186
+ });
187
+ }
188
+ };
189
+ export { CustomIcon, CustomStyle, Danger, Default, Duration, OnClose, Success, Unkeep, Warning, StateAlert_stories as default };
@@ -0,0 +1,22 @@
1
+ import React, { JSX } from "react";
2
+ export type StateAlertTypes = "success" | "danger" | "warning" | "custom";
3
+ export interface ICustomStyle {
4
+ container: {
5
+ color: string;
6
+ background: string;
7
+ };
8
+ progressbar: {
9
+ progress: string;
10
+ background: string;
11
+ };
12
+ }
13
+ export interface StateAlertProps extends React.HTMLAttributes<HTMLDivElement> {
14
+ type: StateAlertTypes;
15
+ customStyle?: ICustomStyle;
16
+ duration?: number;
17
+ icon?: JSX.Element;
18
+ message?: string;
19
+ keep?: boolean;
20
+ onClose?: () => void;
21
+ }
22
+ export default function StateAlert({ type, customStyle, icon, message, duration, keep, onClose, ...rest }: StateAlertProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,56 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { Icon } from "@ftdata/f-icons";
3
+ import { useEffect, useState } from "react";
4
+ import { FastProgress, ProgressContainer, SlowProgress, StateAlertContainer } from "./styles.js";
5
+ function StateAlert({ type, customStyle, icon, message, duration = 5000, keep = false, onClose, ...rest }) {
6
+ const [show, setShow] = useState(true);
7
+ const [isExiting, setIsExiting] = useState(false);
8
+ useEffect(()=>{
9
+ if (keep) return;
10
+ const exitTimeout = setTimeout(()=>setIsExiting(true), duration - 400);
11
+ const OpenTimeOut = setTimeout(()=>{
12
+ if (onClose) onClose();
13
+ setShow(false);
14
+ }, duration);
15
+ return ()=>{
16
+ clearTimeout(exitTimeout);
17
+ clearTimeout(OpenTimeOut);
18
+ };
19
+ }, []);
20
+ if (!show) return /*#__PURE__*/ jsx(Fragment, {});
21
+ return /*#__PURE__*/ jsxs(StateAlertContainer, {
22
+ type: type,
23
+ customStyle: customStyle,
24
+ isExiting: isExiting,
25
+ ...rest,
26
+ children: [
27
+ /*#__PURE__*/ jsxs("div", {
28
+ children: [
29
+ icon ? icon : /*#__PURE__*/ jsx(Icon, {
30
+ color: "currentColor",
31
+ name: "ui warning-triangle",
32
+ size: "1.5rem"
33
+ }),
34
+ /*#__PURE__*/ jsx("span", {
35
+ children: message
36
+ })
37
+ ]
38
+ }),
39
+ /*#__PURE__*/ jsxs(ProgressContainer, {
40
+ children: [
41
+ /*#__PURE__*/ jsx(FastProgress, {
42
+ type: type,
43
+ customStyle: customStyle,
44
+ duration: duration
45
+ }),
46
+ /*#__PURE__*/ jsx(SlowProgress, {
47
+ type: type,
48
+ customStyle: customStyle,
49
+ duration: duration
50
+ })
51
+ ]
52
+ })
53
+ ]
54
+ });
55
+ }
56
+ export { StateAlert as default };
@@ -0,0 +1,7 @@
1
+ import { StateAlertProps } from ".";
2
+ export declare const StateAlertContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StateAlertProps & {
3
+ isExiting?: boolean;
4
+ }>> & string;
5
+ export declare const ProgressContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
6
+ export declare const FastProgress: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StateAlertProps>> & string;
7
+ export declare const SlowProgress: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StateAlertProps>> & string;
@@ -0,0 +1,124 @@
1
+ import styled_components, { css, keyframes } from "styled-components";
2
+ import { COLOR_DANGER_DARK, COLOR_DANGER_LIGHT, COLOR_DANGER_LIGHTER, COLOR_DANGER_MEDIUM, COLOR_SUCCESS_DARK, COLOR_SUCCESS_LIGHT, COLOR_SUCCESS_LIGHTER, COLOR_SUCCESS_MEDIUM, COLOR_WARNING_DARK, COLOR_WARNING_LIGHT, COLOR_WARNING_LIGHTER, COLOR_WARNING_MEDIUM } from "@ftdata/f-tokens";
3
+ const success = {
4
+ container: {
5
+ color: COLOR_SUCCESS_MEDIUM,
6
+ background: COLOR_SUCCESS_LIGHTER
7
+ },
8
+ progressbar: {
9
+ progress: COLOR_SUCCESS_DARK,
10
+ background: COLOR_SUCCESS_LIGHT
11
+ }
12
+ };
13
+ const danger = {
14
+ container: {
15
+ color: COLOR_DANGER_MEDIUM,
16
+ background: COLOR_DANGER_LIGHTER
17
+ },
18
+ progressbar: {
19
+ progress: COLOR_DANGER_DARK,
20
+ background: COLOR_DANGER_LIGHT
21
+ }
22
+ };
23
+ const warning = {
24
+ container: {
25
+ color: COLOR_WARNING_MEDIUM,
26
+ background: COLOR_WARNING_LIGHTER
27
+ },
28
+ progressbar: {
29
+ progress: COLOR_WARNING_DARK,
30
+ background: COLOR_WARNING_LIGHT
31
+ }
32
+ };
33
+ const getStyle = (type, customStyle)=>{
34
+ if ("success" === type) return success;
35
+ if ("danger" === type) return danger;
36
+ if ("warning" === type) return warning;
37
+ if ("custom" === type && customStyle) return customStyle;
38
+ return success;
39
+ };
40
+ const styles_open = keyframes`
41
+ 0% {
42
+ width: 0%;
43
+ opacity: 0;
44
+ }
45
+ 100% {
46
+ width: 100%;
47
+ opacity: 1;
48
+ }
49
+ `;
50
+ const styles_close = keyframes`
51
+ 0% {
52
+ width: 100%;
53
+ }
54
+ 100% {
55
+
56
+ width: 0%;
57
+ }
58
+ `;
59
+ const fast = keyframes`
60
+ 0% {
61
+ width: 100%;
62
+ }
63
+ 100% {
64
+ width: 0%;
65
+ }
66
+ `;
67
+ const StateAlertContainer = styled_components.div`
68
+ background-color: ${({ customStyle, type })=>getStyle(type, customStyle).container.background};
69
+ color: ${({ customStyle, type })=>getStyle(type, customStyle).container.color};
70
+ display: flex;
71
+ flex-direction: column;
72
+ font-family: Inter;
73
+ font-size: 1rem;
74
+ font-style: normal;
75
+ font-weight: 600;
76
+ gap: 1.25rem;
77
+ height: 3.5rem;
78
+ justify-content: space-between;
79
+ line-height: 1.25rem;
80
+ padding: 0.75rem 0.75rem 0 0.75rem;
81
+ position: relative;
82
+ width: 100%;
83
+ animation: ${({ isExiting })=>css`
84
+ ${isExiting ? styles_close : styles_open} ${isExiting ? "0.5s" : "400ms"} forwards
85
+ `};
86
+
87
+ span {
88
+ font-size: 1rem;
89
+ line-height: 1.5rem;
90
+ max-width: 100%;
91
+ white-space: nowrap;
92
+ overflow: hidden;
93
+ text-overflow: ellipsis;
94
+ }
95
+
96
+ & > div:first-child {
97
+ display: flex;
98
+ align-items: center;
99
+ gap: 0.75rem;
100
+ }
101
+ `;
102
+ const ProgressContainer = styled_components.div`
103
+ height: 0.5rem;
104
+ position: absolute;
105
+ width: 100%;
106
+ bottom: 0;
107
+ left: 0;
108
+ animation-timing-function: linear;
109
+ `;
110
+ const FastProgress = styled_components.div`
111
+ background-color: ${({ customStyle, type })=>getStyle(type, customStyle).progressbar.progress};
112
+ height: 100%;
113
+ position: absolute;
114
+ width: 100%;
115
+ animation: ${fast}
116
+ ${({ duration })=>duration ? 1000 === duration ? `${duration - 200}ms` : `${duration - 1000}ms` : "5s"}
117
+ forwards;
118
+ `;
119
+ const SlowProgress = styled_components.div`
120
+ background-color: ${({ customStyle, type })=>getStyle(type, customStyle).progressbar.background};
121
+ height: 100%;
122
+ width: 100%;
123
+ `;
124
+ export { FastProgress, ProgressContainer, SlowProgress, StateAlertContainer };
@@ -0,0 +1,26 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import Switch from ".";
3
+ /**
4
+ * Os usuários podem clicar na chave para ativar ou desativar.
5
+ * Várias caixas de seleção podem ser marcadas simultaneamente.
6
+ * Este componente também recebe propriedades nativas do HTML div.
7
+ */
8
+ declare const meta: Meta<typeof Switch>;
9
+ export default meta;
10
+ type Story = StoryObj<typeof meta>;
11
+ /**
12
+ * Variação padrão do Switch quando apenas as propriedades obrigatórias são fornecidas.
13
+ */
14
+ export declare const Default: Story;
15
+ /**
16
+ * Variação do Switch ativo.
17
+ */
18
+ export declare const Active: Story;
19
+ /**
20
+ * Variação do Switch inativo.
21
+ */
22
+ export declare const Inactive: Story;
23
+ /**
24
+ * Variações de tamanhos padrão do Switch.
25
+ */
26
+ export declare const Sizes: Story;
@@ -0,0 +1,81 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import index from "./index.js";
3
+ const meta = {
4
+ title: "DESIGN COMPONENTS/Switch",
5
+ component: index,
6
+ tags: [
7
+ "autodocs"
8
+ ],
9
+ parameters: {
10
+ layout: "centered"
11
+ },
12
+ argTypes: {
13
+ checked: {
14
+ description: "Define se o valor do Switch \xe9 ativo ou inativo."
15
+ },
16
+ disabled: {
17
+ description: "Define se input est\xe1 desativado. "
18
+ },
19
+ size: {
20
+ control: {
21
+ type: "inline-radio"
22
+ },
23
+ description: "Define o tamanho do Switch.",
24
+ table: {
25
+ type: {
26
+ summary: '"small" | "medium"'
27
+ }
28
+ }
29
+ },
30
+ onChange: {
31
+ control: false,
32
+ description: "Recebe uma fun\xe7\xe3o que \xe9 disparada quando houverem mudan\xe7as no valor do select."
33
+ }
34
+ }
35
+ };
36
+ const Switch_stories = meta;
37
+ const Default = {
38
+ args: {
39
+ checked: false,
40
+ onChange: ()=>console.log("Change - Mudou o valor do switch"),
41
+ size: "medium"
42
+ }
43
+ };
44
+ const Active = {
45
+ args: {
46
+ onChange: ()=>console.log("Change - Mudou o valor do switch"),
47
+ checked: true,
48
+ size: "medium"
49
+ }
50
+ };
51
+ const Inactive = {
52
+ args: {
53
+ onChange: ()=>console.log("Change - Mudou o valor do switch"),
54
+ size: "medium",
55
+ checked: false
56
+ }
57
+ };
58
+ const Sizes = {
59
+ render: ()=>/*#__PURE__*/ jsxs("div", {
60
+ style: {
61
+ display: "flex",
62
+ justifyContent: "center",
63
+ alignItems: "center",
64
+ gap: "2.5rem",
65
+ width: "100%"
66
+ },
67
+ children: [
68
+ /*#__PURE__*/ jsx(index, {
69
+ checked: true,
70
+ size: "small",
71
+ onChange: ()=>console.log("Change - Mudou o valor do switch")
72
+ }),
73
+ /*#__PURE__*/ jsx(index, {
74
+ checked: true,
75
+ size: "medium",
76
+ onChange: ()=>console.log("Change - Mudou o valor do switch")
77
+ })
78
+ ]
79
+ })
80
+ };
81
+ export { Active, Default, Inactive, Sizes, Switch_stories as default };
@@ -0,0 +1,8 @@
1
+ interface Props extends React.HTMLAttributes<HTMLDivElement> {
2
+ checked: boolean;
3
+ disabled?: boolean;
4
+ onChange: React.MouseEventHandler<HTMLDivElement>;
5
+ size: "medium" | "small";
6
+ }
7
+ declare const Switch: React.FC<Props>;
8
+ export default Switch;
@@ -0,0 +1,26 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Circle, Icon, Wrapper } from "./styles.js";
3
+ const Switch_Switch = ({ checked, disabled, onChange, size, ...rest })=>{
4
+ const sizeToPX = "medium" === size ? 16 : 8;
5
+ return /*#__PURE__*/ jsx(Wrapper, {
6
+ checked: checked,
7
+ disabled: disabled,
8
+ size: size,
9
+ onClick: (e)=>{
10
+ if (!disabled) onChange(e);
11
+ },
12
+ ...rest,
13
+ children: /*#__PURE__*/ jsx(Circle, {
14
+ checked: checked,
15
+ disabled: disabled,
16
+ size: size,
17
+ children: checked && /*#__PURE__*/ jsx(Icon, {
18
+ height: sizeToPX,
19
+ width: sizeToPX,
20
+ viewBox: "0 0 16 16"
21
+ })
22
+ })
23
+ });
24
+ };
25
+ const Switch = Switch_Switch;
26
+ export { Switch as default };
@@ -0,0 +1,15 @@
1
+ interface CircleProps {
2
+ checked: boolean;
3
+ disabled?: boolean;
4
+ size: "medium" | "small";
5
+ }
6
+ export declare const Circle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, CircleProps>> & string;
7
+ interface WrapperProps {
8
+ checked: boolean;
9
+ disabled?: boolean;
10
+ onClick: React.MouseEventHandler<HTMLDivElement>;
11
+ size: "medium" | "small";
12
+ }
13
+ export declare const Wrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, WrapperProps>> & string;
14
+ export declare const Icon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").SVGProps<SVGSVGElement>, never>> & string & Omit<import("react").FC<import("react").SVGProps<SVGSVGElement>>, keyof import("react").Component<any, {}, any>>;
15
+ export {};
@@ -0,0 +1,33 @@
1
+ import styled_components from "styled-components";
2
+ import { BORDER_RADIUS_CIRCLE, BORDER_RADIUS_PILL, COLOR_ACCENT_MEDIUM, COLOR_NEUTRAL_DARKER, COLOR_NEUTRAL_DAY, COLOR_NEUTRAL_LIGHT, COLOR_NEUTRAL_MEDIUM, SHADOW_LEVEL_02, SPACING_INLINE_01, SPACING_INLINE_03, SPACING_INLINE_04, SPACING_INLINE_06, SPACING_INLINE_08, SPACING_STACK_01, SPACING_STACK_03, SPACING_STACK_04, SPACING_STACK_05 } from "@ftdata/f-tokens";
3
+ import SwitchCheckMarkIcon from "../../assets/SwitchCheckMarkIcon.js";
4
+ const Circle = styled_components("div")`
5
+ align-items: center;
6
+ background-color: ${COLOR_NEUTRAL_DAY};
7
+ border-radius: ${BORDER_RADIUS_CIRCLE};
8
+ box-shadow: ${SHADOW_LEVEL_02} ${COLOR_NEUTRAL_DARKER};
9
+ display: flex;
10
+ height: ${({ size })=>"medium" === size ? SPACING_STACK_04 : SPACING_STACK_03};
11
+ justify-content: center;
12
+ left: ${({ checked, size })=>checked ? `calc(100% - ${"medium" === size ? SPACING_INLINE_04 : SPACING_INLINE_03} - ${SPACING_INLINE_01})` : SPACING_INLINE_01};
13
+ position: absolute;
14
+ top: ${SPACING_STACK_01};
15
+ transition: 0.2s ease all;
16
+ width: ${({ size })=>"medium" === size ? SPACING_INLINE_04 : SPACING_INLINE_03};
17
+ `;
18
+ const Wrapper = styled_components("div")`
19
+ background: ${({ checked, disabled })=>checked && !disabled && COLOR_ACCENT_MEDIUM || !checked && disabled && COLOR_NEUTRAL_LIGHT || COLOR_NEUTRAL_MEDIUM};
20
+ border-radius: ${BORDER_RADIUS_PILL};
21
+ cursor: pointer;
22
+ position: relative;
23
+ height: ${({ size })=>"medium" === size ? SPACING_STACK_05 : SPACING_STACK_04};
24
+ transition: 0.2s ease all;
25
+ min-width: ${({ size })=>"medium" === size ? SPACING_INLINE_08 : SPACING_INLINE_06};
26
+ width: ${({ size })=>"medium" === size ? SPACING_INLINE_08 : SPACING_INLINE_06};
27
+ `;
28
+ const Icon = styled_components(SwitchCheckMarkIcon)`
29
+ path {
30
+ stroke: ${COLOR_ACCENT_MEDIUM};
31
+ }
32
+ `;
33
+ export { Circle, Icon, Wrapper };
@@ -0,0 +1,29 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { Paragraph } from "../index";
3
+ /**
4
+ * Títulos são usados para mostrar textos regulares em uma página.
5
+ * Este componente também funciona com os atributos nativos de um HTML paragraph element.
6
+ */
7
+ declare const meta: Meta<typeof Paragraph>;
8
+ export default meta;
9
+ type Story = StoryObj<typeof meta>;
10
+ /**
11
+ * Variação padrão do Paragraph quando apenas as propriedades obrigatórias são fornecidas.
12
+ */
13
+ export declare const Default: Story;
14
+ /**
15
+ * Variação de tamanho caption do Paragraph.
16
+ */
17
+ export declare const Caption: Story;
18
+ /**
19
+ * Variação de tamanho sm do Paragraph.
20
+ */
21
+ export declare const Sm: Story;
22
+ /**
23
+ * Variação de tamanho md do Paragraph.
24
+ */
25
+ export declare const Md: Story;
26
+ /**
27
+ * Todas as variações padrão de de tamanho do Paragraph.
28
+ */
29
+ export declare const Sizes: Story;