@pushwoosh/dumb-components 1.1.147 → 1.1.149
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AccessForbidden/AccessForbidden.d.ts +3 -0
- package/AccessForbidden/AccessForbidden.js +3 -0
- package/Alert/Alert.d.ts +7 -0
- package/Alert/Alert.js +7 -0
- package/Alert/types.d.ts +6 -0
- package/ApplicationPreloader/ApplicationPreloader.d.ts +8 -0
- package/ApplicationPreloader/ApplicationPreloader.js +6 -0
- package/Badge/Badge.d.ts +6 -0
- package/Badge/Badge.js +6 -0
- package/Badge/types.d.ts +6 -0
- package/Banner/Banner.d.ts +7 -0
- package/Banner/Banner.js +7 -0
- package/Banner/types.d.ts +16 -0
- package/Button/Button.d.ts +19 -0
- package/Button/GhostButton.d.ts +1 -0
- package/Button/GhostButton.js +1 -0
- package/Button/RemoveButton.d.ts +6 -0
- package/Button/RemoveButton.js +6 -0
- package/Button/types.d.ts +21 -0
- package/Calendar/CalendarDropdown/CalendarDropdown.d.ts +12 -0
- package/Calendar/CalendarDropdown/CalendarDropdown.js +12 -0
- package/Calendar/CalendarDropdown/helpers.d.ts +4 -0
- package/Calendar/CalendarDropdown/helpers.js +4 -0
- package/Calendar/CalendarDropdown/types.d.ts +33 -0
- package/Calendar/CalendarSuperForm/CalendarSuperForm.d.ts +7 -0
- package/Calendar/CalendarSuperForm/CalendarSuperForm.js +10 -1
- package/Calendar/CalendarSuperForm/components/CalendarRangePicker/CalendarRangePicker.d.ts +1 -0
- package/Calendar/CalendarSuperForm/components/CalendarRangePicker/CalendarRangePicker.js +3 -2
- package/Calendar/CalendarSuperForm/types.d.ts +37 -9
- package/Calendar/helpers.d.ts +10 -0
- package/Calendar/helpers.js +10 -0
- package/Calendar/types.d.ts +16 -1
- package/CardMetric/CardMetric.d.ts +7 -0
- package/CardMetric/CardMetric.js +7 -0
- package/CardMetric/types.d.ts +13 -0
- package/Checkbox/Checkbox.d.ts +6 -0
- package/Checkbox/Checkbox.js +6 -0
- package/Checkbox/types.d.ts +13 -0
- package/Chip/Chip.d.ts +7 -0
- package/Chip/Chip.js +7 -0
- package/Chip/Chip.types.d.ts +9 -0
- package/CodeEditor/CodeEditor.d.ts +7 -0
- package/CodeEditor/CodeEditor.js +7 -0
- package/CodeEditor/languages/html.d.ts +1 -0
- package/CodeEditor/languages/html.js +1 -0
- package/CodeEditor/languages/json.d.ts +1 -0
- package/CodeEditor/languages/json.js +1 -0
- package/CodeEditor/languages/liquid.d.ts +1 -0
- package/CodeEditor/languages/liquid.js +1 -0
- package/CodeEditor/types.d.ts +11 -0
- package/CrashScreen/CrashScreen.d.ts +4 -0
- package/CrashScreen/CrashScreen.js +4 -0
- package/DateTimePicker/components/DatePicker/DatePicker.d.ts +5 -0
- package/DateTimePicker/components/DatePicker/DatePicker.js +5 -0
- package/DateTimePicker/components/DatePicker/types.d.ts +9 -0
- package/DateTimePicker/components/DatePickerField/DatePickerField.d.ts +5 -0
- package/DateTimePicker/components/DatePickerField/DatePickerField.js +5 -0
- package/DateTimePicker/components/DatePickerField/types.d.ts +9 -0
- package/DateTimePicker/components/DateTimePicker/DateTimePicker.d.ts +5 -0
- package/DateTimePicker/components/DateTimePicker/DateTimePicker.js +5 -0
- package/DateTimePicker/components/DateTimePicker/types.d.ts +6 -0
- package/DateTimePicker/components/DateTimePickerField/DateTimePickerField.d.ts +5 -0
- package/DateTimePicker/components/DateTimePickerField/DateTimePickerField.js +5 -0
- package/DateTimePicker/components/DateTimePickerField/types.d.ts +9 -0
- package/DateTimePicker/types.d.ts +5 -0
- package/Drawer/components/Drawer/Drawer.d.ts +11 -0
- package/Drawer/components/Drawer/Drawer.js +11 -0
- package/Drawer/components/Drawer/types.d.ts +9 -0
- package/Drawer/components/DrawerContent/styles.d.ts +3 -0
- package/Drawer/components/DrawerContent/styles.js +3 -0
- package/Drawer/components/DrawerDocs/DrawerDocs.d.ts +7 -0
- package/Drawer/components/DrawerDocs/DrawerDocs.js +7 -0
- package/Drawer/components/DrawerDocs/hooks.d.ts +4 -0
- package/Drawer/components/DrawerDocs/hooks.js +4 -0
- package/Drawer/components/DrawerDocs/types.d.ts +4 -0
- package/DropdownMenu/components/DropdownMenu/DropdownMenu.d.ts +12 -0
- package/DropdownMenu/components/DropdownMenu/DropdownMenu.js +12 -0
- package/DropdownMenu/components/DropdownMenu/types.d.ts +15 -0
- package/DropdownMenu/components/DropdownMenuButton/DropdownMenuButton.d.ts +8 -0
- package/DropdownMenu/components/DropdownMenuButton/DropdownMenuButton.js +8 -0
- package/DropdownMenu/components/DropdownMenuButton/types.d.ts +16 -0
- package/DropdownMenu/components/DropdownMenuItem/DropdownMenuItem.d.ts +7 -0
- package/DropdownMenu/components/DropdownMenuItem/DropdownMenuItem.js +7 -0
- package/DropdownMenu/components/DropdownMenuItem/types.d.ts +6 -0
- package/DropdownMenu/components/DropdownMenuSection/DropdownMenuSection.d.ts +8 -0
- package/DropdownMenu/components/DropdownMenuSection/DropdownMenuSection.js +8 -0
- package/DropdownMenu/components/DropdownMenuSection/types.d.ts +3 -0
- package/DropdownMenu/components/DropdownMenuSubmenu/DropdownMenuSubmenu.d.ts +9 -0
- package/DropdownMenu/components/DropdownMenuSubmenu/DropdownMenuSubmenu.js +9 -0
- package/DropdownMenu/components/DropdownMenuSubmenu/types.d.ts +5 -0
- package/EditableField/EditableField.d.ts +9 -0
- package/EditableField/EditableField.js +9 -0
- package/EditableField/types.d.ts +12 -0
- package/EmailTemplatePreview/EmailTemplatePreview.d.ts +7 -0
- package/EmailTemplatePreview/EmailTemplatePreview.js +7 -0
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.d.ts +4 -0
- package/EmailTemplatePreview/components/NoEmailTemplatePreview/NoEmailTemplatePreview.js +4 -0
- package/EmailTemplatePreview/helpers.d.ts +8 -0
- package/EmailTemplatePreview/helpers.js +8 -0
- package/EmailTemplatePreview/types.d.ts +7 -0
- package/EnhancedInput/EnhancedInput.d.ts +7 -0
- package/EnhancedInput/EnhancedInput.js +7 -0
- package/EnhancedInput/SearchInput.d.ts +6 -0
- package/EnhancedInput/SearchInput.js +6 -0
- package/EnhancedInput/types.d.ts +5 -0
- package/ExportResult/ExportResult.d.ts +7 -0
- package/ExportResult/ExportResult.js +7 -0
- package/ExportResult/types.d.ts +7 -0
- package/ExternalImagePreview/ExternalImagePreview.d.ts +7 -0
- package/ExternalImagePreview/ExternalImagePreview.js +7 -0
- package/ExternalImagePreview/types.d.ts +7 -0
- package/FieldBox/FieldBox.d.ts +9 -0
- package/FieldBox/FieldBox.js +9 -0
- package/FieldBox/types.d.ts +10 -0
- package/FrequencyCapping/FrequencyCappingEdit.d.ts +7 -0
- package/FrequencyCapping/FrequencyCappingEdit.js +7 -0
- package/FrequencyCapping/FrequencyCappingInApps.d.ts +7 -0
- package/FrequencyCapping/FrequencyCappingInApps.js +7 -0
- package/FrequencyCapping/FrequencyCappingReadonly.d.ts +3 -0
- package/FrequencyCapping/FrequencyCappingReadonly.js +3 -0
- package/FrequencyCapping/types.d.ts +37 -0
- package/FrequencyCapping/types.js +1 -0
- package/GetStartedPage/GetStartedPage.d.ts +7 -0
- package/GetStartedPage/GetStartedPage.js +7 -0
- package/GetStartedPage/types.d.ts +7 -0
- package/InputFile/InputFile.d.ts +7 -0
- package/InputFile/InputFile.js +7 -0
- package/InputFile/types.d.ts +18 -0
- package/Link/Link.d.ts +18 -0
- package/Link/types.d.ts +17 -0
- package/Modal/components/Modal/Modal.d.ts +11 -0
- package/Modal/components/Modal/Modal.js +11 -0
- package/Modal/components/Modal/types.d.ts +6 -0
- package/Modal/components/ModalConfirm/ModalConfirm.d.ts +8 -0
- package/Modal/components/ModalConfirm/ModalConfirm.js +8 -0
- package/Modal/components/ModalConfirm/ModalConfirmProvider.d.ts +7 -0
- package/Modal/components/ModalConfirm/ModalConfirmProvider.js +7 -0
- package/Modal/components/ModalConfirm/hooks.d.ts +8 -0
- package/Modal/components/ModalConfirm/hooks.js +8 -0
- package/Modal/components/ModalConfirm/types.d.ts +16 -0
- package/Modal/components/ModalContent/styles.d.ts +5 -0
- package/Modal/components/ModalContent/styles.js +5 -0
- package/Modal/components/ModalTitle/ModalTitle.d.ts +6 -0
- package/Modal/components/ModalTitle/ModalTitle.js +6 -0
- package/Modal/components/ModalTitle/types.d.ts +3 -0
- package/NotificationInbox/NotificationBar.d.ts +7 -0
- package/NotificationInbox/NotificationBar.js +7 -0
- package/NotificationInbox/NotificationBell.d.ts +7 -0
- package/NotificationInbox/NotificationBell.js +7 -0
- package/NotificationInbox/NotificationInbox.d.ts +7 -0
- package/NotificationInbox/NotificationInbox.js +7 -0
- package/NotificationInbox/types.d.ts +31 -0
- package/NumberPicker/NumberPicker.d.ts +7 -0
- package/NumberPicker/NumberPicker.js +7 -0
- package/NumberPicker/types.d.ts +12 -0
- package/PageHeader/components/AutosizeInput/AutosizeInput.d.ts +7 -0
- package/PageHeader/components/AutosizeInput/AutosizeInput.js +7 -0
- package/PageHeader/components/AutosizeInput/types.d.ts +7 -0
- package/PageHeader/components/PageHeader/PageHeader.d.ts +7 -0
- package/PageHeader/components/PageHeader/PageHeader.js +7 -0
- package/PageHeader/components/PageHeader/types.d.ts +13 -0
- package/PageHeader/components/PageHeaderEditable/PageHeaderEditable.d.ts +7 -0
- package/PageHeader/components/PageHeaderEditable/PageHeaderEditable.js +7 -0
- package/PageHeader/components/PageHeaderEditable/types.d.ts +19 -0
- package/Pagination/Pagination.d.ts +7 -0
- package/Pagination/Pagination.js +7 -0
- package/Pagination/types.d.ts +7 -0
- package/Popover/Popover.d.ts +10 -0
- package/Popover/Popover.js +10 -0
- package/Popover/styles.d.ts +1 -0
- package/Popover/styles.js +1 -0
- package/Popover/types.d.ts +9 -0
- package/ProgressBar/ProgressBar.d.ts +6 -0
- package/ProgressBar/ProgressBar.js +6 -0
- package/ProgressBar/types.d.ts +7 -0
- package/PushPreview/PushPreview.d.ts +7 -0
- package/PushPreview/PushPreview.js +7 -0
- package/PushPreview/types.d.ts +17 -0
- package/Radio/Radio.d.ts +7 -0
- package/Radio/Radio.js +7 -0
- package/Radio/types.d.ts +14 -0
- package/RadioCard/RadioCard.d.ts +7 -0
- package/RadioCard/RadioCard.js +7 -0
- package/RadioCard/types.d.ts +7 -0
- package/ReCaptcha/ReCaptcha.d.ts +8 -0
- package/ReCaptcha/ReCaptcha.js +8 -0
- package/ReCaptcha/helpers.d.ts +4 -0
- package/ReCaptcha/helpers.js +4 -0
- package/ReCaptcha/hooks.d.ts +4 -0
- package/ReCaptcha/hooks.js +4 -0
- package/ReCaptcha/types.d.ts +5 -0
- package/RichMessageEditor/RichMessageEditor.d.ts +8 -0
- package/RichMessageEditor/RichMessageEditor.js +8 -0
- package/RichMessageEditor/RichMessageEditor.types.d.ts +10 -0
- package/RichMessageEditor/RichMessageViewer.d.ts +10 -0
- package/RichMessageEditor/RichMessageViewer.js +7 -0
- package/RichMessageEditor/slate/types.d.ts +5 -0
- package/RichMessageEditor/types.d.ts +1 -0
- package/RichmediaPreview/RichmediaPreview.d.ts +7 -0
- package/RichmediaPreview/RichmediaPreview.js +7 -0
- package/RichmediaPreview/hooks.d.ts +4 -0
- package/RichmediaPreview/hooks.js +4 -0
- package/RichmediaPreview/types.d.ts +13 -0
- package/Select/Select.d.ts +22 -0
- package/Select/Select.js +22 -0
- package/Select/constants.d.ts +1 -0
- package/Select/constants.js +1 -0
- package/Select/types.d.ts +19 -0
- package/SendRate/SendRateEdit.d.ts +7 -0
- package/SendRate/SendRateEdit.js +7 -0
- package/SendRate/SendRateReadonly.d.ts +3 -0
- package/SendRate/SendRateReadonly.js +3 -0
- package/SendRate/types.d.ts +20 -0
- package/Skeleton/TextSkeleton.d.ts +6 -0
- package/Skeleton/TextSkeleton.js +6 -0
- package/Skeleton/styles.d.ts +2 -0
- package/Skeleton/styles.js +2 -0
- package/Skeleton/types.d.ts +11 -0
- package/SortButton/SortButton.d.ts +6 -0
- package/SortButton/SortButton.js +6 -0
- package/SortButton/types.d.ts +11 -0
- package/Spinner/Spinner.d.ts +6 -0
- package/Spinner/Spinner.js +6 -0
- package/Spinner/types.d.ts +4 -0
- package/StatisticCard/StatisticCard.d.ts +7 -0
- package/StatisticCard/StatisticCard.js +7 -0
- package/StatisticCard/types.d.ts +21 -0
- package/Switch/Switch.d.ts +6 -0
- package/Switch/Switch.js +6 -0
- package/Switch/types.d.ts +8 -0
- package/Tabs/components/Tab/Tab.d.ts +4 -0
- package/Tabs/components/Tab/Tab.js +4 -0
- package/Tabs/components/Tab/types.d.ts +6 -0
- package/Tabs/components/TabBar/TabBar.d.ts +3 -0
- package/Tabs/components/TabBar/TabBar.js +3 -0
- package/Tabs/components/TabBar/types.d.ts +2 -0
- package/Tabs/components/TabPanel/TabPanel.d.ts +4 -0
- package/Tabs/components/TabPanel/TabPanel.js +4 -0
- package/Tabs/components/TabPanel/types.d.ts +3 -0
- package/Tabs/components/Tabs/Tabs.d.ts +11 -0
- package/Tabs/components/Tabs/Tabs.js +11 -0
- package/Tabs/components/Tabs/types.d.ts +4 -0
- package/Tabs/types.d.ts +4 -0
- package/Toast/Toast.d.ts +5 -0
- package/Toast/Toast.js +5 -0
- package/Toast/ToastProvider.d.ts +7 -0
- package/Toast/ToastProvider.js +7 -0
- package/Toast/hooks.d.ts +8 -0
- package/Toast/hooks.js +8 -0
- package/Toast/types.d.ts +24 -0
- package/Tooltip/Tooltip.d.ts +7 -0
- package/Tooltip/Tooltip.js +7 -0
- package/Tooltip/TooltipTrigger.d.ts +13 -0
- package/Tooltip/TooltipTrigger.js +7 -0
- package/Tooltip/types.d.ts +12 -0
- package/hooks/useElementWidth.d.ts +4 -3
- package/hooks/useElementWidth.js +4 -3
- package/hooks/useLayer.d.ts +7 -0
- package/hooks/useLayer.js +7 -0
- package/hooks/useOnClickOutside.d.ts +7 -0
- package/hooks/useOnClickOutside.js +7 -0
- package/native/Input.d.ts +3 -0
- package/native/Input.js +1 -0
- package/native/NativeTimeInput.d.ts +1 -0
- package/native/NativeTimeInput.js +1 -0
- package/native/Select.d.ts +1 -0
- package/native/Select.js +1 -0
- package/native/Textarea.d.ts +1 -0
- package/native/Textarea.js +1 -0
- package/package.json +2 -3
- package/polyglot/react.d.ts +19 -0
- package/polyglot/react.js +19 -0
- package/polyglot/types.d.ts +4 -0
- package/shared/dropdownField/FieldInput.d.ts +1 -0
- package/shared/dropdownField/FieldInput.js +1 -0
- package/shared/dropdownField/FieldShell.d.ts +4 -0
- package/shared/dropdownField/FieldShell.js +4 -0
- package/shared/dropdownField/SuggestionsDropdown.d.ts +4 -0
- package/shared/dropdownField/SuggestionsDropdown.js +4 -0
- package/shared/dropdownField/constants.d.ts +1 -0
- package/shared/dropdownField/constants.js +1 -0
- package/shared/dropdownField/shared.d.ts +7 -0
- package/shared/dropdownField/shared.js +7 -0
- package/shared/dropdownField/types.d.ts +7 -0
- package/shared/dropdownField/useActiveIndex.d.ts +4 -0
- package/shared/dropdownField/useActiveIndex.js +4 -0
- package/shared/dropdownField/useAsyncItems.d.ts +4 -0
- package/shared/dropdownField/useAsyncItems.js +4 -0
- package/shared/dropdownField/useDebouncedValue.d.ts +1 -0
- package/shared/dropdownField/useDebouncedValue.js +1 -0
- package/shared/dropdownField/useDropdownItems.d.ts +4 -0
- package/shared/dropdownField/useDropdownItems.js +4 -0
- package/shared/dropdownField/useDropdownPosition.d.ts +4 -0
- package/shared/dropdownField/useDropdownPosition.js +4 -0
- package/shared/dropdownField/useFieldOpenEffects.d.ts +4 -0
- package/shared/dropdownField/useFieldOpenEffects.js +4 -0
- package/shared/dropdownField/useListNavigation.d.ts +5 -0
- package/shared/dropdownField/useListNavigation.js +5 -0
- package/Alert/ai-documentation.md +0 -132
- package/Badge/ai-documentation.md +0 -155
- package/Banner/ai-documentation.md +0 -285
- package/Button/ai-documentation.md +0 -247
- package/CardMetric/ai-documentation.md +0 -277
- package/Checkbox/ai-documentation.md +0 -231
- package/Chip/ai-documentation.md +0 -281
- package/CodeEditor/ai-documentation.md +0 -350
- package/DateTimePicker/ai-documentation.md +0 -400
- package/Drawer/ai-documentation.md +0 -417
- package/EnhancedInput/ai-documentation.md +0 -352
- package/InputFile/ai-documentation.md +0 -420
- package/Modal/ai-documentation.md +0 -285
- package/PageHeader/ai-documentation.md +0 -511
- package/Pagination/ai-documentation.md +0 -509
- package/Popover/ai-documentation.md +0 -625
- package/ProgressBar/ai-documentation.md +0 -533
- package/Radio/ai-documentation.md +0 -243
- package/Select/ai-documentation.md +0 -374
- package/Skeleton/ai-documentation.md +0 -574
- package/Spinner/ai-documentation.md +0 -607
- package/Switch/ai-documentation.md +0 -312
- package/Tabs/ai-documentation.md +0 -475
- package/Toast/ai-documentation.md +0 -220
- package/Tooltip/ai-documentation.md +0 -340
- package/ai-documentation.md +0 -124
- 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
|
-
---
|