@pushwoosh/dumb-components 1.1.148 → 1.1.150

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 (323) hide show
  1. package/AccessForbidden/AccessForbidden.d.ts +3 -0
  2. package/AccessForbidden/AccessForbidden.js +3 -0
  3. package/Alert/Alert.d.ts +7 -0
  4. package/Alert/Alert.js +7 -0
  5. package/Alert/types.d.ts +6 -0
  6. package/ApplicationPreloader/ApplicationPreloader.d.ts +8 -0
  7. package/ApplicationPreloader/ApplicationPreloader.js +6 -0
  8. package/Badge/Badge.d.ts +6 -0
  9. package/Badge/Badge.js +6 -0
  10. package/Badge/types.d.ts +6 -0
  11. package/Banner/Banner.d.ts +7 -0
  12. package/Banner/Banner.js +7 -0
  13. package/Banner/types.d.ts +16 -0
  14. package/Button/Button.d.ts +19 -0
  15. package/Button/GhostButton.d.ts +1 -0
  16. package/Button/GhostButton.js +1 -0
  17. package/Button/RemoveButton.d.ts +6 -0
  18. package/Button/RemoveButton.js +6 -0
  19. package/Button/types.d.ts +21 -0
  20. package/Calendar/CalendarDropdown/CalendarDropdown.d.ts +12 -0
  21. package/Calendar/CalendarDropdown/CalendarDropdown.js +12 -0
  22. package/Calendar/CalendarDropdown/helpers.d.ts +4 -0
  23. package/Calendar/CalendarDropdown/helpers.js +4 -0
  24. package/Calendar/CalendarDropdown/types.d.ts +33 -0
  25. package/Calendar/CalendarSuperForm/CalendarSuperForm.d.ts +7 -0
  26. package/Calendar/CalendarSuperForm/CalendarSuperForm.js +7 -0
  27. package/Calendar/CalendarSuperForm/types.d.ts +36 -10
  28. package/Calendar/helpers.d.ts +10 -0
  29. package/Calendar/helpers.js +10 -0
  30. package/Calendar/types.d.ts +16 -1
  31. package/CardMetric/CardMetric.d.ts +7 -0
  32. package/CardMetric/CardMetric.js +7 -0
  33. package/CardMetric/types.d.ts +13 -0
  34. package/Checkbox/Checkbox.d.ts +6 -0
  35. package/Checkbox/Checkbox.js +6 -0
  36. package/Checkbox/types.d.ts +13 -0
  37. package/Chip/Chip.d.ts +7 -0
  38. package/Chip/Chip.js +7 -0
  39. package/Chip/Chip.types.d.ts +9 -0
  40. package/CodeEditor/CodeEditor.d.ts +7 -0
  41. package/CodeEditor/CodeEditor.js +7 -0
  42. package/CodeEditor/languages/html.d.ts +1 -0
  43. package/CodeEditor/languages/html.js +1 -0
  44. package/CodeEditor/languages/json.d.ts +1 -0
  45. package/CodeEditor/languages/json.js +1 -0
  46. package/CodeEditor/languages/liquid.d.ts +1 -0
  47. package/CodeEditor/languages/liquid.js +1 -0
  48. package/CodeEditor/types.d.ts +11 -0
  49. package/CrashScreen/CrashScreen.d.ts +4 -0
  50. package/CrashScreen/CrashScreen.js +4 -0
  51. package/DateTimePicker/components/DatePicker/DatePicker.d.ts +5 -0
  52. package/DateTimePicker/components/DatePicker/DatePicker.js +5 -0
  53. package/DateTimePicker/components/DatePicker/types.d.ts +9 -0
  54. package/DateTimePicker/components/DatePickerField/DatePickerField.d.ts +5 -0
  55. package/DateTimePicker/components/DatePickerField/DatePickerField.js +5 -0
  56. package/DateTimePicker/components/DatePickerField/types.d.ts +9 -0
  57. package/DateTimePicker/components/DateTimePicker/DateTimePicker.d.ts +5 -0
  58. package/DateTimePicker/components/DateTimePicker/DateTimePicker.js +5 -0
  59. package/DateTimePicker/components/DateTimePicker/types.d.ts +6 -0
  60. package/DateTimePicker/components/DateTimePickerField/DateTimePickerField.d.ts +5 -0
  61. package/DateTimePicker/components/DateTimePickerField/DateTimePickerField.js +5 -0
  62. package/DateTimePicker/components/DateTimePickerField/types.d.ts +9 -0
  63. package/DateTimePicker/types.d.ts +5 -0
  64. package/Drawer/components/Drawer/Drawer.d.ts +11 -0
  65. package/Drawer/components/Drawer/Drawer.js +12 -1
  66. package/Drawer/components/Drawer/types.d.ts +10 -1
  67. package/Drawer/components/DrawerContent/styles.d.ts +3 -0
  68. package/Drawer/components/DrawerContent/styles.js +3 -0
  69. package/Drawer/components/DrawerDocs/DrawerDocs.d.ts +7 -0
  70. package/Drawer/components/DrawerDocs/DrawerDocs.js +7 -0
  71. package/Drawer/components/DrawerDocs/hooks.d.ts +4 -0
  72. package/Drawer/components/DrawerDocs/hooks.js +4 -0
  73. package/Drawer/components/DrawerDocs/types.d.ts +4 -0
  74. package/DropdownMenu/components/DropdownMenu/DropdownMenu.d.ts +12 -0
  75. package/DropdownMenu/components/DropdownMenu/DropdownMenu.js +12 -0
  76. package/DropdownMenu/components/DropdownMenu/types.d.ts +15 -0
  77. package/DropdownMenu/components/DropdownMenuButton/DropdownMenuButton.d.ts +8 -0
  78. package/DropdownMenu/components/DropdownMenuButton/DropdownMenuButton.js +8 -0
  79. package/DropdownMenu/components/DropdownMenuButton/types.d.ts +16 -0
  80. package/DropdownMenu/components/DropdownMenuItem/DropdownMenuItem.d.ts +7 -0
  81. package/DropdownMenu/components/DropdownMenuItem/DropdownMenuItem.js +7 -0
  82. package/DropdownMenu/components/DropdownMenuItem/types.d.ts +6 -0
  83. package/DropdownMenu/components/DropdownMenuSection/DropdownMenuSection.d.ts +8 -0
  84. package/DropdownMenu/components/DropdownMenuSection/DropdownMenuSection.js +8 -0
  85. package/DropdownMenu/components/DropdownMenuSection/types.d.ts +3 -0
  86. package/DropdownMenu/components/DropdownMenuSubmenu/DropdownMenuSubmenu.d.ts +9 -0
  87. package/DropdownMenu/components/DropdownMenuSubmenu/DropdownMenuSubmenu.js +9 -0
  88. package/DropdownMenu/components/DropdownMenuSubmenu/types.d.ts +5 -0
  89. package/EditableField/EditableField.d.ts +9 -0
  90. package/EditableField/EditableField.js +9 -0
  91. package/EditableField/types.d.ts +12 -0
  92. package/EmailTemplatePreview/EmailTemplatePreview.d.ts +7 -0
  93. package/EmailTemplatePreview/EmailTemplatePreview.js +7 -0
  94. package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.d.ts +4 -0
  95. package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.js +4 -0
  96. package/EmailTemplatePreview/helpers.d.ts +8 -0
  97. package/EmailTemplatePreview/helpers.js +8 -0
  98. package/EmailTemplatePreview/types.d.ts +7 -0
  99. package/EnhancedInput/EnhancedInput.d.ts +7 -0
  100. package/EnhancedInput/EnhancedInput.js +7 -0
  101. package/EnhancedInput/SearchInput.d.ts +6 -0
  102. package/EnhancedInput/SearchInput.js +6 -0
  103. package/EnhancedInput/types.d.ts +5 -0
  104. package/ExportResult/ExportResult.d.ts +7 -0
  105. package/ExportResult/ExportResult.js +7 -0
  106. package/ExportResult/types.d.ts +7 -0
  107. package/ExternalImagePreview/ExternalImagePreview.d.ts +7 -0
  108. package/ExternalImagePreview/ExternalImagePreview.js +7 -0
  109. package/ExternalImagePreview/types.d.ts +7 -0
  110. package/FieldBox/FieldBox.d.ts +9 -0
  111. package/FieldBox/FieldBox.js +9 -0
  112. package/FieldBox/types.d.ts +10 -0
  113. package/FrequencyCapping/FrequencyCappingEdit.d.ts +7 -0
  114. package/FrequencyCapping/FrequencyCappingEdit.js +7 -0
  115. package/FrequencyCapping/FrequencyCappingInApps.d.ts +7 -0
  116. package/FrequencyCapping/FrequencyCappingInApps.js +7 -0
  117. package/FrequencyCapping/FrequencyCappingReadonly.d.ts +3 -0
  118. package/FrequencyCapping/FrequencyCappingReadonly.js +3 -0
  119. package/FrequencyCapping/types.d.ts +37 -0
  120. package/FrequencyCapping/types.js +1 -0
  121. package/GetStartedPage/GetStartedPage.d.ts +7 -0
  122. package/GetStartedPage/GetStartedPage.js +7 -0
  123. package/GetStartedPage/types.d.ts +7 -0
  124. package/InputFile/InputFile.d.ts +7 -0
  125. package/InputFile/InputFile.js +7 -0
  126. package/InputFile/types.d.ts +18 -0
  127. package/Link/Link.d.ts +18 -0
  128. package/Link/types.d.ts +17 -0
  129. package/Modal/components/Modal/Modal.d.ts +11 -0
  130. package/Modal/components/Modal/Modal.js +11 -0
  131. package/Modal/components/Modal/types.d.ts +6 -0
  132. package/Modal/components/ModalConfirm/ModalConfirm.d.ts +8 -0
  133. package/Modal/components/ModalConfirm/ModalConfirm.js +8 -0
  134. package/Modal/components/ModalConfirm/ModalConfirmProvider.d.ts +7 -0
  135. package/Modal/components/ModalConfirm/ModalConfirmProvider.js +7 -0
  136. package/Modal/components/ModalConfirm/hooks.d.ts +8 -0
  137. package/Modal/components/ModalConfirm/hooks.js +8 -0
  138. package/Modal/components/ModalConfirm/types.d.ts +16 -0
  139. package/Modal/components/ModalContent/styles.d.ts +5 -0
  140. package/Modal/components/ModalContent/styles.js +5 -0
  141. package/Modal/components/ModalTitle/ModalTitle.d.ts +6 -0
  142. package/Modal/components/ModalTitle/ModalTitle.js +6 -0
  143. package/Modal/components/ModalTitle/types.d.ts +3 -0
  144. package/NotificationInbox/NotificationBar.d.ts +7 -0
  145. package/NotificationInbox/NotificationBar.js +7 -0
  146. package/NotificationInbox/NotificationBell.d.ts +7 -0
  147. package/NotificationInbox/NotificationBell.js +7 -0
  148. package/NotificationInbox/NotificationInbox.d.ts +7 -0
  149. package/NotificationInbox/NotificationInbox.js +7 -0
  150. package/NotificationInbox/types.d.ts +31 -0
  151. package/NumberPicker/NumberPicker.d.ts +7 -0
  152. package/NumberPicker/NumberPicker.js +7 -0
  153. package/NumberPicker/types.d.ts +12 -0
  154. package/PageHeader/components/AutosizeInput/AutosizeInput.d.ts +7 -0
  155. package/PageHeader/components/AutosizeInput/AutosizeInput.js +7 -0
  156. package/PageHeader/components/AutosizeInput/types.d.ts +7 -0
  157. package/PageHeader/components/PageHeader/PageHeader.d.ts +7 -0
  158. package/PageHeader/components/PageHeader/PageHeader.js +7 -0
  159. package/PageHeader/components/PageHeader/types.d.ts +13 -0
  160. package/PageHeader/components/PageHeaderEditable/PageHeaderEditable.d.ts +7 -0
  161. package/PageHeader/components/PageHeaderEditable/PageHeaderEditable.js +7 -0
  162. package/PageHeader/components/PageHeaderEditable/types.d.ts +19 -0
  163. package/Pagination/Pagination.d.ts +7 -0
  164. package/Pagination/Pagination.js +7 -0
  165. package/Pagination/types.d.ts +7 -0
  166. package/Popover/Popover.d.ts +10 -0
  167. package/Popover/Popover.js +10 -0
  168. package/Popover/styles.d.ts +1 -0
  169. package/Popover/styles.js +1 -0
  170. package/Popover/types.d.ts +9 -0
  171. package/ProgressBar/ProgressBar.d.ts +6 -0
  172. package/ProgressBar/ProgressBar.js +6 -0
  173. package/ProgressBar/types.d.ts +7 -0
  174. package/PushPreview/PushPreview.d.ts +7 -0
  175. package/PushPreview/PushPreview.js +7 -0
  176. package/PushPreview/types.d.ts +17 -0
  177. package/Radio/Radio.d.ts +7 -0
  178. package/Radio/Radio.js +7 -0
  179. package/Radio/types.d.ts +14 -0
  180. package/RadioCard/RadioCard.d.ts +7 -0
  181. package/RadioCard/RadioCard.js +7 -0
  182. package/RadioCard/types.d.ts +7 -0
  183. package/ReCaptcha/ReCaptcha.d.ts +8 -0
  184. package/ReCaptcha/ReCaptcha.js +8 -0
  185. package/ReCaptcha/helpers.d.ts +4 -0
  186. package/ReCaptcha/helpers.js +4 -0
  187. package/ReCaptcha/hooks.d.ts +4 -0
  188. package/ReCaptcha/hooks.js +4 -0
  189. package/ReCaptcha/types.d.ts +5 -0
  190. package/RichMessageEditor/RichMessageEditor.d.ts +8 -0
  191. package/RichMessageEditor/RichMessageEditor.js +8 -0
  192. package/RichMessageEditor/RichMessageEditor.types.d.ts +10 -0
  193. package/RichMessageEditor/RichMessageViewer.d.ts +10 -0
  194. package/RichMessageEditor/RichMessageViewer.js +7 -0
  195. package/RichMessageEditor/slate/types.d.ts +5 -0
  196. package/RichMessageEditor/types.d.ts +1 -0
  197. package/RichmediaPreview/RichmediaPreview.d.ts +7 -0
  198. package/RichmediaPreview/RichmediaPreview.js +7 -0
  199. package/RichmediaPreview/hooks.d.ts +4 -0
  200. package/RichmediaPreview/hooks.js +4 -0
  201. package/RichmediaPreview/types.d.ts +13 -0
  202. package/Select/Select.d.ts +22 -0
  203. package/Select/Select.js +22 -0
  204. package/Select/constants.d.ts +1 -0
  205. package/Select/constants.js +1 -0
  206. package/Select/types.d.ts +19 -0
  207. package/SendRate/SendRateEdit.d.ts +7 -0
  208. package/SendRate/SendRateEdit.js +7 -0
  209. package/SendRate/SendRateReadonly.d.ts +3 -0
  210. package/SendRate/SendRateReadonly.js +3 -0
  211. package/SendRate/types.d.ts +20 -0
  212. package/Skeleton/TextSkeleton.d.ts +6 -0
  213. package/Skeleton/TextSkeleton.js +6 -0
  214. package/Skeleton/styles.d.ts +2 -0
  215. package/Skeleton/styles.js +2 -0
  216. package/Skeleton/types.d.ts +11 -0
  217. package/SortButton/SortButton.d.ts +6 -0
  218. package/SortButton/SortButton.js +6 -0
  219. package/SortButton/types.d.ts +11 -0
  220. package/Spinner/Spinner.d.ts +6 -0
  221. package/Spinner/Spinner.js +6 -0
  222. package/Spinner/types.d.ts +4 -0
  223. package/StatisticCard/StatisticCard.d.ts +7 -0
  224. package/StatisticCard/StatisticCard.js +7 -0
  225. package/StatisticCard/types.d.ts +21 -0
  226. package/Switch/Switch.d.ts +6 -0
  227. package/Switch/Switch.js +6 -0
  228. package/Switch/types.d.ts +8 -0
  229. package/Tabs/components/Tab/Tab.d.ts +4 -0
  230. package/Tabs/components/Tab/Tab.js +4 -0
  231. package/Tabs/components/Tab/types.d.ts +6 -0
  232. package/Tabs/components/TabBar/TabBar.d.ts +3 -0
  233. package/Tabs/components/TabBar/TabBar.js +3 -0
  234. package/Tabs/components/TabBar/types.d.ts +2 -0
  235. package/Tabs/components/TabPanel/TabPanel.d.ts +4 -0
  236. package/Tabs/components/TabPanel/TabPanel.js +4 -0
  237. package/Tabs/components/TabPanel/types.d.ts +3 -0
  238. package/Tabs/components/Tabs/Tabs.d.ts +11 -0
  239. package/Tabs/components/Tabs/Tabs.js +11 -0
  240. package/Tabs/components/Tabs/types.d.ts +4 -0
  241. package/Tabs/types.d.ts +4 -0
  242. package/Toast/Toast.d.ts +5 -0
  243. package/Toast/Toast.js +5 -0
  244. package/Toast/ToastProvider.d.ts +7 -0
  245. package/Toast/ToastProvider.js +7 -0
  246. package/Toast/hooks.d.ts +8 -0
  247. package/Toast/hooks.js +8 -0
  248. package/Toast/types.d.ts +24 -0
  249. package/Tooltip/Tooltip.d.ts +7 -0
  250. package/Tooltip/Tooltip.js +7 -0
  251. package/Tooltip/TooltipTrigger.d.ts +13 -0
  252. package/Tooltip/TooltipTrigger.js +7 -0
  253. package/Tooltip/types.d.ts +12 -0
  254. package/hooks/useElementWidth.d.ts +4 -3
  255. package/hooks/useElementWidth.js +4 -3
  256. package/hooks/useLayer.d.ts +7 -0
  257. package/hooks/useLayer.js +7 -0
  258. package/hooks/useOnClickOutside.d.ts +7 -0
  259. package/hooks/useOnClickOutside.js +7 -0
  260. package/native/Input.d.ts +3 -0
  261. package/native/Input.js +1 -0
  262. package/native/NativeTimeInput.d.ts +1 -0
  263. package/native/NativeTimeInput.js +1 -0
  264. package/native/Select.d.ts +1 -0
  265. package/native/Select.js +1 -0
  266. package/native/Textarea.d.ts +1 -0
  267. package/native/Textarea.js +1 -0
  268. package/package.json +2 -3
  269. package/polyglot/react.d.ts +19 -0
  270. package/polyglot/react.js +19 -0
  271. package/polyglot/types.d.ts +4 -0
  272. package/shared/dropdownField/FieldInput.d.ts +1 -0
  273. package/shared/dropdownField/FieldInput.js +1 -0
  274. package/shared/dropdownField/FieldShell.d.ts +4 -0
  275. package/shared/dropdownField/FieldShell.js +4 -0
  276. package/shared/dropdownField/SuggestionsDropdown.d.ts +4 -0
  277. package/shared/dropdownField/SuggestionsDropdown.js +4 -0
  278. package/shared/dropdownField/constants.d.ts +1 -0
  279. package/shared/dropdownField/constants.js +1 -0
  280. package/shared/dropdownField/shared.d.ts +7 -0
  281. package/shared/dropdownField/shared.js +7 -0
  282. package/shared/dropdownField/types.d.ts +7 -0
  283. package/shared/dropdownField/useActiveIndex.d.ts +4 -0
  284. package/shared/dropdownField/useActiveIndex.js +4 -0
  285. package/shared/dropdownField/useAsyncItems.d.ts +4 -0
  286. package/shared/dropdownField/useAsyncItems.js +4 -0
  287. package/shared/dropdownField/useDebouncedValue.d.ts +1 -0
  288. package/shared/dropdownField/useDebouncedValue.js +1 -0
  289. package/shared/dropdownField/useDropdownItems.d.ts +4 -0
  290. package/shared/dropdownField/useDropdownItems.js +4 -0
  291. package/shared/dropdownField/useDropdownPosition.d.ts +4 -0
  292. package/shared/dropdownField/useDropdownPosition.js +4 -0
  293. package/shared/dropdownField/useFieldOpenEffects.d.ts +4 -0
  294. package/shared/dropdownField/useFieldOpenEffects.js +4 -0
  295. package/shared/dropdownField/useListNavigation.d.ts +5 -0
  296. package/shared/dropdownField/useListNavigation.js +5 -0
  297. package/Alert/ai-documentation.md +0 -132
  298. package/Badge/ai-documentation.md +0 -155
  299. package/Banner/ai-documentation.md +0 -285
  300. package/Button/ai-documentation.md +0 -247
  301. package/CardMetric/ai-documentation.md +0 -277
  302. package/Checkbox/ai-documentation.md +0 -231
  303. package/Chip/ai-documentation.md +0 -281
  304. package/CodeEditor/ai-documentation.md +0 -350
  305. package/DateTimePicker/ai-documentation.md +0 -400
  306. package/Drawer/ai-documentation.md +0 -417
  307. package/EnhancedInput/ai-documentation.md +0 -352
  308. package/InputFile/ai-documentation.md +0 -420
  309. package/Modal/ai-documentation.md +0 -285
  310. package/PageHeader/ai-documentation.md +0 -511
  311. package/Pagination/ai-documentation.md +0 -509
  312. package/Popover/ai-documentation.md +0 -625
  313. package/ProgressBar/ai-documentation.md +0 -533
  314. package/Radio/ai-documentation.md +0 -243
  315. package/Select/ai-documentation.md +0 -374
  316. package/Skeleton/ai-documentation.md +0 -574
  317. package/Spinner/ai-documentation.md +0 -607
  318. package/Switch/ai-documentation.md +0 -312
  319. package/Tabs/ai-documentation.md +0 -475
  320. package/Toast/ai-documentation.md +0 -220
  321. package/Tooltip/ai-documentation.md +0 -340
  322. package/ai-documentation.md +0 -124
  323. package/native/ai-documentation.md +0 -485
@@ -1,132 +0,0 @@
1
- # Alert - AI Documentation
2
-
3
- > Auto-generated AI agent documentation for Alert component
4
- > Part of @pushwoosh/dumb-components library
5
-
6
- ## Overview
7
-
8
- **Component:** Alert
9
- **Import Path:** `import { Alert } from '@pushwoosh/dumb-components'`
10
- **Files:** Alert.tsx, types.ts, styles.ts, maps.ts, index.ts
11
- **Type:** UI Component / Notification Component
12
- **Description:** Alert component for displaying informational, warning, and error messages with optional collapsible content
13
-
14
- ## TypeScript Interface
15
-
16
- ```typescript
17
- type AlertType = 'info' | 'warning' | 'error';
18
-
19
- interface AlertProps {
20
- title: ReactNode;
21
- type: AlertType;
22
- isExpandedDefault?: boolean;
23
- readonly children?: ReactNode;
24
- }
25
- ```
26
-
27
- ## Import & Usage
28
-
29
- **Import:**
30
- ```typescript
31
- import { Alert } from '@pushwoosh/dumb-components';
32
- import type { AlertProps } from '@pushwoosh/dumb-components';
33
- ```
34
-
35
- **Basic Usage:**
36
- ```tsx
37
- function App() {
38
- return (
39
- <Alert
40
- title="Information Alert"
41
- type="info"
42
- />
43
- );
44
- }
45
- ```
46
-
47
- **Advanced Examples:**
48
- ```tsx
49
- // Warning alert with collapsible content
50
- <Alert
51
- title="Warning: Check your settings"
52
- type="warning"
53
- isExpandedDefault={true}
54
- >
55
- <p>Please review your configuration before proceeding.</p>
56
- <ul>
57
- <li>Check database connection</li>
58
- <li>Verify API endpoints</li>
59
- </ul>
60
- </Alert>
61
-
62
- // Error alert
63
- <Alert
64
- title="Error: Failed to save"
65
- type="error"
66
- >
67
- <p>There was an error saving your data. Please try again.</p>
68
- </Alert>
69
-
70
- // Simple info alert without children (non-collapsible)
71
- <Alert
72
- title="Your changes have been saved successfully"
73
- type="info"
74
- />
75
-
76
- // Dynamic content
77
- {errors.map(error => (
78
- <Alert
79
- key={error.id}
80
- title={error.title}
81
- type="error"
82
- isExpandedDefault={false}
83
- >
84
- {error.details}
85
- </Alert>
86
- ))}
87
- ```
88
-
89
- ## Props Reference
90
-
91
- | Prop | Type | Default | Description |
92
- |------|------|---------|-------------|
93
- | title | ReactNode | required | The main title/message of the alert |
94
- | type | 'info' \| 'warning' \| 'error' | required | Alert type that determines styling and icon |
95
- | isExpandedDefault | boolean | undefined | Whether collapsible content is expanded by default |
96
- | children | ReactNode | undefined | Optional content that makes the alert collapsible |
97
-
98
- ## AI Agent Guidelines
99
-
100
- ### ✅ Recommended Patterns
101
- - Use `type="info"` for general information and success messages
102
- - Use `type="warning"` for cautions and non-critical issues
103
- - Use `type="error"` for errors and critical problems
104
- - Include `children` only when you need expandable details
105
- - Set `isExpandedDefault={true}` for important details that should be visible immediately
106
- - Use meaningful, action-oriented titles
107
-
108
- ### ❌ Common Mistakes to Avoid
109
- - Don't use Alert for loading states (use Spinner instead)
110
- - Don't nest Alerts inside each other
111
- - Don't use Alert for permanent UI elements (use Banner instead)
112
- - Avoid very long titles - use children for detailed content
113
-
114
- ### Integration Tips
115
- - Works well at the top of forms to show validation errors
116
- - Can be used in modals for confirmation messages
117
- - Effective in dashboards for system status updates
118
- - Combines well with Toast for temporary notifications vs persistent alerts
119
- - Use multiple alerts in a stack for different message types
120
-
121
- ## Behavior Notes
122
- - **Collapsible**: Alert becomes collapsible when `children` prop is provided
123
- - **Icon Display**: Each alert type has its own icon and color scheme
124
- - **Click Interaction**: Header is clickable only when content is collapsible
125
- - **Responsive**: Adapts to container width with proper padding and spacing
126
-
127
- ## Related Components
128
- - Toast - for temporary notifications
129
- - Banner - for persistent promotional messages
130
- - Modal - for critical alerts requiring user action
131
-
132
- ---
@@ -1,155 +0,0 @@
1
- # Badge - AI Documentation
2
-
3
- > Auto-generated AI agent documentation for Badge component
4
- > Part of @pushwoosh/dumb-components library
5
-
6
- ## Overview
7
-
8
- **Component:** Badge
9
- **Import Path:** `import { Badge } from '@pushwoosh/dumb-components'`
10
- **Files:** Badge.tsx, types.ts, styles.ts, maps.ts, index.ts
11
- **Type:** UI Component / Status Indicator
12
- **Description:** Badge component for displaying status, categories, or labels with various color options and saturation levels
13
-
14
- ## TypeScript Interface
15
-
16
- ```typescript
17
- type BadgeColor = 'gray' | 'green' | 'orange' | 'red' | 'purple' | 'sky' | 'locked';
18
-
19
- interface BadgeProps extends Omit<JSX.IntrinsicElements['div'], 'ref'> {
20
- readonly boxRef?: Ref<HTMLDivElement>;
21
- readonly color: BadgeColor;
22
- readonly isSaturated?: boolean;
23
- readonly children: ReactNode;
24
- }
25
- ```
26
-
27
- ## Import & Usage
28
-
29
- **Import:**
30
- ```typescript
31
- import { Badge } from '@pushwoosh/dumb-components';
32
- import type { BadgeProps, BadgeColor } from '@pushwoosh/dumb-components';
33
- ```
34
-
35
- **Basic Usage:**
36
- ```tsx
37
- function App() {
38
- return (
39
- <Badge color="green">
40
- Active
41
- </Badge>
42
- );
43
- }
44
- ```
45
-
46
- **Advanced Examples:**
47
- ```tsx
48
- // Status indicators with semantic colors
49
- <Badge color="green">Active</Badge>
50
- <Badge color="red">Inactive</Badge>
51
- <Badge color="orange">Pending</Badge>
52
- <Badge color="gray">Draft</Badge>
53
-
54
- // Saturated vs normal badges
55
- <Badge color="purple" isSaturated={true}>
56
- Premium
57
- </Badge>
58
- <Badge color="purple" isSaturated={false}>
59
- Basic
60
- </Badge>
61
-
62
- // With ref for DOM access
63
- const badgeRef = useRef<HTMLDivElement>(null);
64
-
65
- <Badge
66
- color="sky"
67
- boxRef={badgeRef}
68
- onClick={() => console.log('Badge clicked')}
69
- >
70
- Clickable
71
- </Badge>
72
-
73
- // In lists and tables
74
- {users.map(user => (
75
- <div key={user.id}>
76
- <span>{user.name}</span>
77
- <Badge color={getStatusColor(user.status)}>
78
- {user.status}
79
- </Badge>
80
- </div>
81
- ))}
82
-
83
- // Dynamic color based on data
84
- function getStatusBadge(status: string) {
85
- const colorMap = {
86
- active: 'green',
87
- inactive: 'red',
88
- pending: 'orange',
89
- locked: 'locked'
90
- } as const;
91
-
92
- return (
93
- <Badge color={colorMap[status] || 'gray'}>
94
- {status.toUpperCase()}
95
- </Badge>
96
- );
97
- }
98
- ```
99
-
100
- ## Props Reference
101
-
102
- | Prop | Type | Default | Description |
103
- |------|------|---------|-------------|
104
- | color | BadgeColor | required | Badge color theme: 'gray', 'green', 'orange', 'red', 'purple', 'sky', 'locked' |
105
- | isSaturated | boolean | false | Whether to use saturated/bold version of the color |
106
- | children | ReactNode | required | Content to display inside the badge |
107
- | boxRef | Ref<HTMLDivElement> | undefined | Ref to access the badge DOM element |
108
- | ...rest | HTMLDivElement props | | All standard div props (onClick, className, etc.) |
109
-
110
- ## Color Guide
111
-
112
- | Color | Best Used For | Example Use Cases |
113
- |-------|---------------|-------------------|
114
- | green | Success, Active, Positive | "Active", "Published", "Success" |
115
- | red | Error, Danger, Negative | "Inactive", "Error", "Failed" |
116
- | orange | Warning, Pending, Caution | "Pending", "Warning", "In Review" |
117
- | gray | Neutral, Default, Disabled | "Draft", "Disabled", "Unknown" |
118
- | purple | Premium, Special, Priority | "Premium", "VIP", "Priority" |
119
- | sky | Info, Neutral Positive | "Info", "New", "Updated" |
120
- | locked | Restricted, Locked | "Locked", "Private", "Restricted" |
121
-
122
- ## AI Agent Guidelines
123
-
124
- ### ✅ Recommended Patterns
125
- - Use semantic colors that match the meaning (green for success, red for errors)
126
- - Keep badge text short and concise (1-2 words ideal)
127
- - Use `isSaturated={true}` for high-importance badges
128
- - Combine with tooltips for badges that need explanation
129
- - Use consistent color meanings across your application
130
-
131
- ### ❌ Common Mistakes to Avoid
132
- - Don't use badges for long text content (use chips or tags instead)
133
- - Avoid mixing saturated and non-saturated badges in the same context
134
- - Don't use too many different colors in one interface
135
- - Don't use badges for interactive elements without proper accessibility
136
-
137
- ### Integration Tips
138
- - Works well in tables for status columns
139
- - Effective in user lists, dashboards, and card components
140
- - Can be combined with icons for richer status indicators
141
- - Good for filtering interfaces when combined with interactive elements
142
- - Use with consistent spacing in badge groups
143
-
144
- ## Behavior Notes
145
- - **Interactive**: Accepts all standard div props including onClick for interactivity
146
- - **Accessible**: Maintains proper contrast ratios for readability
147
- - **Flexible**: Can contain any ReactNode content
148
- - **Responsive**: Adapts to content size while maintaining consistent styling
149
-
150
- ## Related Components
151
- - Chip - for removable tags and filters
152
- - Alert - for larger status messages
153
- - Tooltip - for additional badge explanations
154
-
155
- ---
@@ -1,285 +0,0 @@
1
- # Banner - AI Documentation
2
-
3
- > Auto-generated AI agent documentation for Banner component
4
- > Part of @pushwoosh/dumb-components library
5
-
6
- ## Overview
7
-
8
- **Component:** Banner
9
- **Import Path:** `import { Banner } from '@pushwoosh/dumb-components'`
10
- **Files:** Banner.tsx, types.ts, styles.ts, maps.ts, colors.ts, index.ts
11
- **Type:** UI Component / Notification Component
12
- **Description:** Banner component for displaying prominent notifications with optional actions, loading states, and close functionality
13
-
14
- ## TypeScript Interface
15
-
16
- ```typescript
17
- type BannerType = 'error' | 'warning' | 'info' | 'success';
18
-
19
- interface RequiredBannerProps {
20
- readonly boxRef?: any;
21
- readonly type: BannerType;
22
- readonly title: string;
23
- readonly view?: 'shape' | 'ghost';
24
- readonly icon?: ReactElement;
25
- readonly className?: string;
26
- readonly isLoading?: boolean;
27
- readonly canBeClosed?: boolean;
28
- readonly onClose?: () => void;
29
- readonly children?: ReactNode;
30
- }
31
-
32
- interface BannerPropsWithButton extends RequiredBannerProps {
33
- readonly action?: {
34
- readonly onClick: () => void;
35
- readonly buttonText: string;
36
- };
37
- }
38
- ```
39
-
40
- ## Import & Usage
41
-
42
- **Import:**
43
- ```typescript
44
- import { Banner } from '@pushwoosh/dumb-components';
45
- import type {
46
- BannerType,
47
- RequiredBannerProps,
48
- BannerPropsWithButton
49
- } from '@pushwoosh/dumb-components';
50
- ```
51
-
52
- **Basic Usage:**
53
- ```tsx
54
- function App() {
55
- return (
56
- <Banner
57
- type="info"
58
- title="Welcome to the new dashboard!"
59
- />
60
- );
61
- }
62
- ```
63
-
64
- **Advanced Examples:**
65
- ```tsx
66
- // Success banner with action
67
- <Banner
68
- type="success"
69
- title="Account verified successfully"
70
- action={{
71
- buttonText: "Get Started",
72
- onClick: () => navigate('/dashboard')
73
- }}
74
- />
75
-
76
- // Error banner with close functionality
77
- <Banner
78
- type="error"
79
- title="Connection failed"
80
- canBeClosed
81
- onClose={() => console.log('Banner closed')}
82
- >
83
- <p>Unable to connect to server. Please check your internet connection.</p>
84
- </Banner>
85
-
86
- // Warning banner with loading action
87
- <Banner
88
- type="warning"
89
- title="Unsaved changes detected"
90
- isLoading={isSaving}
91
- action={{
92
- buttonText: isSaving ? "Saving..." : "Save Changes",
93
- onClick: handleSave
94
- }}
95
- >
96
- <p>You have unsaved changes that will be lost if you navigate away.</p>
97
- </Banner>
98
-
99
- // Info banner with custom icon
100
- <Banner
101
- type="info"
102
- title="New features available"
103
- icon={<StarIcon />}
104
- canBeClosed
105
- onClose={() => setShowBanner(false)}
106
- >
107
- <p>Check out our latest updates and improvements.</p>
108
- </Banner>
109
-
110
- // Ghost view banner
111
- <Banner
112
- type="success"
113
- title="Operation completed"
114
- view="ghost"
115
- action={{
116
- buttonText: "View Details",
117
- onClick: () => showDetails()
118
- }}
119
- />
120
-
121
- // Conditional banner display
122
- {showErrorBanner && (
123
- <Banner
124
- type="error"
125
- title="Validation failed"
126
- canBeClosed
127
- onClose={() => setShowErrorBanner(false)}
128
- >
129
- <ul>
130
- {errors.map(error => (
131
- <li key={error.field}>{error.message}</li>
132
- ))}
133
- </ul>
134
- </Banner>
135
- )}
136
-
137
- // Banner with async action
138
- <Banner
139
- type="info"
140
- title="Update available"
141
- isLoading={isUpdating}
142
- action={{
143
- buttonText: "Update Now",
144
- onClick: async () => {
145
- setIsUpdating(true);
146
- await performUpdate();
147
- setIsUpdating(false);
148
- }
149
- }}
150
- />
151
- ```
152
-
153
- ## Props Reference
154
-
155
- | Prop | Type | Default | Description |
156
- |------|------|---------|-------------|
157
- | type | 'error' \| 'warning' \| 'info' \| 'success' | required | Banner semantic type |
158
- | title | string | required | Main banner title text |
159
- | view | 'shape' \| 'ghost' | 'shape' | Visual style variant |
160
- | children | ReactNode | undefined | Additional content below title |
161
- | icon | ReactElement | auto by type | Custom icon (defaults based on type) |
162
- | canBeClosed | boolean | false | Whether banner can be dismissed |
163
- | isLoading | boolean | false | Whether banner shows loading state |
164
- | onClose | () => void | undefined | Callback when banner is closed |
165
- | action | BannerAction | undefined | Action button configuration |
166
- | className | string | undefined | Additional CSS classes |
167
- | boxRef | Ref | undefined | Ref to banner element |
168
-
169
- ### Action Object
170
- ```typescript
171
- action?: {
172
- onClick: () => void; // Action callback
173
- buttonText: string; // Button label text
174
- }
175
- ```
176
-
177
- ## Type Guide
178
-
179
- | Type | Usage | Default Icon | Example Use Cases |
180
- |------|-------|--------------|-------------------|
181
- | success | Positive feedback, completion | ✓ CheckIcon | "Successfully saved", "Account created" |
182
- | info | Neutral information | ℹ️ InfoIcon | "New features", "System maintenance" |
183
- | warning | Cautions, non-critical issues | ⚠️ WarningIcon | "Unsaved changes", "Session expiring" |
184
- | error | Critical issues, failures | ❌ ErrorIcon | "Network error", "Validation failed" |
185
-
186
- ## AI Agent Guidelines
187
-
188
- ### ✅ Recommended Patterns
189
- - Use semantic types that match the message content
190
- - Include `canBeClosed` for dismissible notifications
191
- - Add action buttons for banners that need user response
192
- - Use `isLoading` when actions trigger async operations
193
- - Place banners at top of content areas for visibility
194
- - Include helpful details in children for complex issues
195
-
196
- ### ❌ Common Mistakes to Avoid
197
- - Don't stack multiple banners without clear hierarchy
198
- - Avoid very long titles - use children for details
199
- - Don't use banners for temporary notifications (use Toast instead)
200
- - Don't forget to handle loading states for async actions
201
- - Avoid banners that can't be dismissed for non-critical content
202
-
203
- ### Integration Tips
204
- - Position banners prominently at page/section tops
205
- - Use with form validation to show error summaries
206
- - Combine with async operations for status feedback
207
- - Good for onboarding flows and feature announcements
208
- - Can replace multiple alerts with single comprehensive banner
209
-
210
- ## Banner vs Other Components
211
-
212
- | Component | Usage | Duration | Dismissible |
213
- |-----------|--------|----------|-------------|
214
- | Banner | Prominent notifications | Persistent | Optional |
215
- | Alert | Contextual messages | Persistent | By content |
216
- | Toast | Temporary feedback | Auto-dismiss | Usually |
217
- | Modal | Critical interruptions | User action | Required |
218
-
219
- ## Common Patterns
220
-
221
- ### Error Handling
222
- ```tsx
223
- function FormWithBanner() {
224
- const [errors, setErrors] = useState([]);
225
-
226
- return (
227
- <>
228
- {errors.length > 0 && (
229
- <Banner
230
- type="error"
231
- title={`Found ${errors.length} validation error(s)`}
232
- canBeClosed
233
- onClose={() => setErrors([])}
234
- >
235
- <ul>
236
- {errors.map(error => (
237
- <li key={error.field}>{error.message}</li>
238
- ))}
239
- </ul>
240
- </Banner>
241
- )}
242
- {/* Form content */}
243
- </>
244
- );
245
- }
246
- ```
247
-
248
- ### Feature Announcements
249
- ```tsx
250
- <Banner
251
- type="info"
252
- title="New Dashboard Available!"
253
- action={{
254
- buttonText: "Try It Now",
255
- onClick: () => enableNewDashboard()
256
- }}
257
- canBeClosed
258
- onClose={() => markAnnouncementSeen()}
259
- >
260
- Experience our redesigned interface with improved performance and new features.
261
- </Banner>
262
- ```
263
-
264
- ### Save Prompt
265
- ```tsx
266
- <Banner
267
- type="warning"
268
- title="You have unsaved changes"
269
- isLoading={isSaving}
270
- action={{
271
- buttonText: isSaving ? "Saving..." : "Save Now",
272
- onClick: handleSave
273
- }}
274
- >
275
- Your changes will be lost if you navigate away from this page.
276
- </Banner>
277
- ```
278
-
279
- ## Related Components
280
- - Alert - for contextual messages within content
281
- - Toast - for temporary notifications
282
- - Modal - for blocking user interactions
283
- - Button - action buttons used within banners
284
-
285
- ---