@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,511 +0,0 @@
|
|
|
1
|
-
# PageHeader Component System - @pushwoosh/dumb-components
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
- **Component Name**: PageHeader (System)
|
|
6
|
-
- **Import Path**: `@pushwoosh/dumb-components`
|
|
7
|
-
- **Files**:
|
|
8
|
-
- `/src/PageHeader/index.ts` - Main exports
|
|
9
|
-
- `/src/PageHeader/components/PageHeader/` - Main page header component
|
|
10
|
-
- `/src/PageHeader/components/PageHeaderEditable/` - Editable page header variant
|
|
11
|
-
- `/src/PageHeader/components/PageHeaderError/` - Error display component
|
|
12
|
-
- `/src/PageHeader/components/PageHeaderSkeleton/` - Loading skeleton
|
|
13
|
-
- `/src/PageHeader/components/AutosizeInput/` - Auto-sizing input field
|
|
14
|
-
- **Type**: Layout/Navigation
|
|
15
|
-
- **Description**: A comprehensive page header system with title, description, actions, error handling, and editable variants. Provides consistent page-level navigation and action patterns.
|
|
16
|
-
|
|
17
|
-
## TypeScript Interfaces
|
|
18
|
-
|
|
19
|
-
```typescript
|
|
20
|
-
// Main PageHeader component
|
|
21
|
-
export interface PageHeaderProps {
|
|
22
|
-
title: ReactNode;
|
|
23
|
-
description?: ReactNode | string;
|
|
24
|
-
error?: string;
|
|
25
|
-
resolveErrorText?: string;
|
|
26
|
-
submitText?: string;
|
|
27
|
-
cancelText?: string;
|
|
28
|
-
isLoadingSubmit?: boolean;
|
|
29
|
-
moreActions?: ReactElement;
|
|
30
|
-
onBack?: () => void;
|
|
31
|
-
onSubmit?: (params?: any) => void;
|
|
32
|
-
onCancel?: () => void;
|
|
33
|
-
onResolveError?: () => void;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Editable PageHeader variant
|
|
37
|
-
export interface PageHeaderEditableProps {
|
|
38
|
-
title: string;
|
|
39
|
-
description?: string;
|
|
40
|
-
error?: string;
|
|
41
|
-
resolveErrorText?: string;
|
|
42
|
-
value?: string;
|
|
43
|
-
maxLength?: number;
|
|
44
|
-
placeholder?: string;
|
|
45
|
-
submitText?: string;
|
|
46
|
-
cancelText?: string;
|
|
47
|
-
isLoading?: boolean;
|
|
48
|
-
isLoadingSubmit?: boolean;
|
|
49
|
-
moreActions?: ReactElement;
|
|
50
|
-
onBack?: () => void;
|
|
51
|
-
onChange?: (value: string) => void;
|
|
52
|
-
onComplete?: (value: string) => void;
|
|
53
|
-
onSubmit?: (value: string) => void;
|
|
54
|
-
onCancel?: () => void;
|
|
55
|
-
onResolveError?: () => void;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// Error component
|
|
59
|
-
export interface PageHeaderErrorProps {
|
|
60
|
-
error: string;
|
|
61
|
-
resolveErrorText?: string | undefined;
|
|
62
|
-
onResolveError?: (() => void) | undefined;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// AutosizeInput component
|
|
66
|
-
export interface AutosizeInputProps {
|
|
67
|
-
value: string;
|
|
68
|
-
placeholder?: string | undefined;
|
|
69
|
-
maxLength?: number | undefined;
|
|
70
|
-
onChange?: ((value: string) => void) | undefined;
|
|
71
|
-
onComplete?: ((value: string) => void) | undefined;
|
|
72
|
-
}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Import & Usage
|
|
76
|
-
|
|
77
|
-
```typescript
|
|
78
|
-
import { PageHeader, PageHeaderEditable, AutosizeInput } from '@pushwoosh/dumb-components';
|
|
79
|
-
|
|
80
|
-
// Basic page header
|
|
81
|
-
function BasicPage() {
|
|
82
|
-
return (
|
|
83
|
-
<div>
|
|
84
|
-
<PageHeader
|
|
85
|
-
title="Dashboard"
|
|
86
|
-
description="Overview of your application metrics and performance"
|
|
87
|
-
/>
|
|
88
|
-
<main>
|
|
89
|
-
{/* Page content */}
|
|
90
|
-
</main>
|
|
91
|
-
</div>
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// Page header with back navigation
|
|
96
|
-
function DetailPage() {
|
|
97
|
-
const navigate = useNavigate();
|
|
98
|
-
|
|
99
|
-
return (
|
|
100
|
-
<div>
|
|
101
|
-
<PageHeader
|
|
102
|
-
title="User Details"
|
|
103
|
-
description="Manage user profile and settings"
|
|
104
|
-
onBack={() => navigate(-1)}
|
|
105
|
-
/>
|
|
106
|
-
<main>
|
|
107
|
-
{/* User details content */}
|
|
108
|
-
</main>
|
|
109
|
-
</div>
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// Page header with actions
|
|
114
|
-
function EditablePage() {
|
|
115
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
116
|
-
|
|
117
|
-
const handleSubmit = async () => {
|
|
118
|
-
setIsLoading(true);
|
|
119
|
-
try {
|
|
120
|
-
await saveChanges();
|
|
121
|
-
// Handle success
|
|
122
|
-
} catch (error) {
|
|
123
|
-
// Handle error
|
|
124
|
-
} finally {
|
|
125
|
-
setIsLoading(false);
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
return (
|
|
130
|
-
<div>
|
|
131
|
-
<PageHeader
|
|
132
|
-
title="Edit Profile"
|
|
133
|
-
description="Update your personal information"
|
|
134
|
-
submitText="Save Changes"
|
|
135
|
-
cancelText="Cancel"
|
|
136
|
-
isLoadingSubmit={isLoading}
|
|
137
|
-
onBack={() => navigate('/profile')}
|
|
138
|
-
onSubmit={handleSubmit}
|
|
139
|
-
onCancel={() => navigate('/profile')}
|
|
140
|
-
/>
|
|
141
|
-
<main>
|
|
142
|
-
{/* Edit form */}
|
|
143
|
-
</main>
|
|
144
|
-
</div>
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
## Advanced Examples
|
|
150
|
-
|
|
151
|
-
```typescript
|
|
152
|
-
// Page header with error handling
|
|
153
|
-
function PageWithError() {
|
|
154
|
-
const [error, setError] = useState('');
|
|
155
|
-
|
|
156
|
-
const handleResolveError = () => {
|
|
157
|
-
setError('');
|
|
158
|
-
// Retry failed operation
|
|
159
|
-
retryOperation();
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
return (
|
|
163
|
-
<div>
|
|
164
|
-
<PageHeader
|
|
165
|
-
title="Data Import"
|
|
166
|
-
description="Import data from external sources"
|
|
167
|
-
error={error}
|
|
168
|
-
resolveErrorText="Retry Import"
|
|
169
|
-
onResolveError={handleResolveError}
|
|
170
|
-
onSubmit={handleImport}
|
|
171
|
-
/>
|
|
172
|
-
<main>
|
|
173
|
-
{/* Import interface */}
|
|
174
|
-
</main>
|
|
175
|
-
</div>
|
|
176
|
-
);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
// Editable page header
|
|
180
|
-
function EditablePageTitle() {
|
|
181
|
-
const [title, setTitle] = useState('Untitled Document');
|
|
182
|
-
const [isEditing, setIsEditing] = useState(false);
|
|
183
|
-
const [isSaving, setIsSaving] = useState(false);
|
|
184
|
-
|
|
185
|
-
const handleSubmit = async (newTitle: string) => {
|
|
186
|
-
setIsSaving(true);
|
|
187
|
-
try {
|
|
188
|
-
await updateDocumentTitle(newTitle);
|
|
189
|
-
setTitle(newTitle);
|
|
190
|
-
setIsEditing(false);
|
|
191
|
-
} catch (error) {
|
|
192
|
-
// Handle error
|
|
193
|
-
} finally {
|
|
194
|
-
setIsSaving(false);
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
if (isEditing) {
|
|
199
|
-
return (
|
|
200
|
-
<PageHeaderEditable
|
|
201
|
-
title="Edit Document Title"
|
|
202
|
-
description="Enter a descriptive title for your document"
|
|
203
|
-
value={title}
|
|
204
|
-
placeholder="Enter document title..."
|
|
205
|
-
maxLength={100}
|
|
206
|
-
submitText="Save"
|
|
207
|
-
cancelText="Cancel"
|
|
208
|
-
isLoadingSubmit={isSaving}
|
|
209
|
-
onSubmit={handleSubmit}
|
|
210
|
-
onCancel={() => setIsEditing(false)}
|
|
211
|
-
/>
|
|
212
|
-
);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
return (
|
|
216
|
-
<PageHeader
|
|
217
|
-
title={title}
|
|
218
|
-
description="Your document content goes here"
|
|
219
|
-
moreActions={
|
|
220
|
-
<Button
|
|
221
|
-
color="secondary"
|
|
222
|
-
view="ghost"
|
|
223
|
-
onClick={() => setIsEditing(true)}
|
|
224
|
-
>
|
|
225
|
-
Edit Title
|
|
226
|
-
</Button>
|
|
227
|
-
}
|
|
228
|
-
/>
|
|
229
|
-
);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
// Complex page header with multiple actions
|
|
233
|
-
function ProjectPage() {
|
|
234
|
-
const [project, setProject] = useState(null);
|
|
235
|
-
const [isPublishing, setIsPublishing] = useState(false);
|
|
236
|
-
const [error, setError] = useState('');
|
|
237
|
-
|
|
238
|
-
const moreActions = (
|
|
239
|
-
<>
|
|
240
|
-
<Button
|
|
241
|
-
color="secondary"
|
|
242
|
-
view="ghost"
|
|
243
|
-
icon={<ShareIcon />}
|
|
244
|
-
onClick={handleShare}
|
|
245
|
-
>
|
|
246
|
-
Share
|
|
247
|
-
</Button>
|
|
248
|
-
<Button
|
|
249
|
-
color="secondary"
|
|
250
|
-
view="ghost"
|
|
251
|
-
icon={<DuplicateIcon />}
|
|
252
|
-
onClick={handleDuplicate}
|
|
253
|
-
>
|
|
254
|
-
Duplicate
|
|
255
|
-
</Button>
|
|
256
|
-
<Button
|
|
257
|
-
color="danger"
|
|
258
|
-
view="ghost"
|
|
259
|
-
icon={<DeleteIcon />}
|
|
260
|
-
onClick={handleDelete}
|
|
261
|
-
>
|
|
262
|
-
Delete
|
|
263
|
-
</Button>
|
|
264
|
-
</>
|
|
265
|
-
);
|
|
266
|
-
|
|
267
|
-
return (
|
|
268
|
-
<div>
|
|
269
|
-
<PageHeader
|
|
270
|
-
title={project?.name || 'Untitled Project'}
|
|
271
|
-
description={`Created ${formatDate(project?.createdAt)} • Last modified ${formatDate(project?.updatedAt)}`}
|
|
272
|
-
error={error}
|
|
273
|
-
resolveErrorText="Retry"
|
|
274
|
-
submitText="Publish"
|
|
275
|
-
cancelText="Save Draft"
|
|
276
|
-
isLoadingSubmit={isPublishing}
|
|
277
|
-
moreActions={moreActions}
|
|
278
|
-
onBack={() => navigate('/projects')}
|
|
279
|
-
onSubmit={() => handlePublish()}
|
|
280
|
-
onCancel={() => handleSaveDraft()}
|
|
281
|
-
onResolveError={() => setError('')}
|
|
282
|
-
/>
|
|
283
|
-
<main>
|
|
284
|
-
{/* Project editor */}
|
|
285
|
-
</main>
|
|
286
|
-
</div>
|
|
287
|
-
);
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
// Form page with validation
|
|
291
|
-
function FormPage() {
|
|
292
|
-
const { register, handleSubmit, formState: { errors, isSubmitting } } = useForm();
|
|
293
|
-
const [submitError, setSubmitError] = useState('');
|
|
294
|
-
|
|
295
|
-
const onSubmit = async (data: any) => {
|
|
296
|
-
setSubmitError('');
|
|
297
|
-
try {
|
|
298
|
-
await submitForm(data);
|
|
299
|
-
navigate('/success');
|
|
300
|
-
} catch (error) {
|
|
301
|
-
setSubmitError('Failed to submit form. Please try again.');
|
|
302
|
-
}
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
const hasFormErrors = Object.keys(errors).length > 0;
|
|
306
|
-
|
|
307
|
-
return (
|
|
308
|
-
<div>
|
|
309
|
-
<PageHeader
|
|
310
|
-
title="Create Account"
|
|
311
|
-
description="Fill out the form below to create your new account"
|
|
312
|
-
error={submitError || (hasFormErrors ? 'Please fix the errors below' : '')}
|
|
313
|
-
resolveErrorText="Try Again"
|
|
314
|
-
submitText="Create Account"
|
|
315
|
-
cancelText="Cancel"
|
|
316
|
-
isLoadingSubmit={isSubmitting}
|
|
317
|
-
onBack={() => navigate('/login')}
|
|
318
|
-
onSubmit={handleSubmit(onSubmit)}
|
|
319
|
-
onCancel={() => navigate('/login')}
|
|
320
|
-
onResolveError={() => setSubmitError('')}
|
|
321
|
-
/>
|
|
322
|
-
|
|
323
|
-
<form>
|
|
324
|
-
<input
|
|
325
|
-
{...register('email', { required: 'Email is required' })}
|
|
326
|
-
placeholder="Email address"
|
|
327
|
-
/>
|
|
328
|
-
{errors.email && <span>{errors.email.message}</span>}
|
|
329
|
-
|
|
330
|
-
<input
|
|
331
|
-
{...register('password', { required: 'Password is required' })}
|
|
332
|
-
type="password"
|
|
333
|
-
placeholder="Password"
|
|
334
|
-
/>
|
|
335
|
-
{errors.password && <span>{errors.password.message}</span>}
|
|
336
|
-
</form>
|
|
337
|
-
</div>
|
|
338
|
-
);
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
// Wizard-style navigation
|
|
342
|
-
function WizardPage() {
|
|
343
|
-
const [currentStep, setCurrentStep] = useState(1);
|
|
344
|
-
const totalSteps = 4;
|
|
345
|
-
|
|
346
|
-
const stepTitles = {
|
|
347
|
-
1: 'Basic Information',
|
|
348
|
-
2: 'Contact Details',
|
|
349
|
-
3: 'Preferences',
|
|
350
|
-
4: 'Review & Submit'
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
const handleNext = () => {
|
|
354
|
-
if (currentStep < totalSteps) {
|
|
355
|
-
setCurrentStep(prev => prev + 1);
|
|
356
|
-
} else {
|
|
357
|
-
handleSubmit();
|
|
358
|
-
}
|
|
359
|
-
};
|
|
360
|
-
|
|
361
|
-
const handleBack = () => {
|
|
362
|
-
if (currentStep > 1) {
|
|
363
|
-
setCurrentStep(prev => prev - 1);
|
|
364
|
-
} else {
|
|
365
|
-
navigate('/dashboard');
|
|
366
|
-
}
|
|
367
|
-
};
|
|
368
|
-
|
|
369
|
-
return (
|
|
370
|
-
<div>
|
|
371
|
-
<PageHeader
|
|
372
|
-
title={stepTitles[currentStep]}
|
|
373
|
-
description={`Step ${currentStep} of ${totalSteps}`}
|
|
374
|
-
submitText={currentStep === totalSteps ? 'Submit' : 'Next'}
|
|
375
|
-
cancelText={currentStep === 1 ? 'Cancel' : 'Back'}
|
|
376
|
-
onBack={currentStep === 1 ? () => navigate('/dashboard') : undefined}
|
|
377
|
-
onSubmit={handleNext}
|
|
378
|
-
onCancel={handleBack}
|
|
379
|
-
/>
|
|
380
|
-
|
|
381
|
-
<main>
|
|
382
|
-
{/* Step content */}
|
|
383
|
-
<div>Step {currentStep} content here</div>
|
|
384
|
-
</main>
|
|
385
|
-
</div>
|
|
386
|
-
);
|
|
387
|
-
}
|
|
388
|
-
```
|
|
389
|
-
|
|
390
|
-
## Props Reference
|
|
391
|
-
|
|
392
|
-
### PageHeader
|
|
393
|
-
|
|
394
|
-
| Prop | Type | Default | Required | Description |
|
|
395
|
-
|------|------|---------|----------|-------------|
|
|
396
|
-
| `title` | `ReactNode` | - | Yes | Main page title |
|
|
397
|
-
| `description` | `ReactNode \| string` | `undefined` | No | Optional description below title |
|
|
398
|
-
| `error` | `string` | `undefined` | No | Error message to display |
|
|
399
|
-
| `resolveErrorText` | `string` | `undefined` | No | Text for error resolution button |
|
|
400
|
-
| `submitText` | `string` | `'Create'` | No | Text for submit button |
|
|
401
|
-
| `cancelText` | `string` | `'Cancel'` | No | Text for cancel button |
|
|
402
|
-
| `isLoadingSubmit` | `boolean` | `false` | No | Whether submit button shows loading state |
|
|
403
|
-
| `moreActions` | `ReactElement` | `undefined` | No | Additional action buttons |
|
|
404
|
-
| `onBack` | `() => void` | `undefined` | No | Callback for back navigation |
|
|
405
|
-
| `onSubmit` | `(params?: any) => void` | `undefined` | No | Callback for submit action |
|
|
406
|
-
| `onCancel` | `() => void` | `undefined` | No | Callback for cancel action |
|
|
407
|
-
| `onResolveError` | `() => void` | `undefined` | No | Callback for error resolution |
|
|
408
|
-
|
|
409
|
-
### PageHeaderEditable
|
|
410
|
-
|
|
411
|
-
| Prop | Type | Default | Required | Description |
|
|
412
|
-
|------|------|---------|----------|-------------|
|
|
413
|
-
| `title` | `string` | - | Yes | Page title (non-editable) |
|
|
414
|
-
| `description` | `string` | `undefined` | No | Optional description |
|
|
415
|
-
| `error` | `string` | `undefined` | No | Error message |
|
|
416
|
-
| `resolveErrorText` | `string` | `undefined` | No | Error resolution button text |
|
|
417
|
-
| `value` | `string` | `undefined` | No | Current input value |
|
|
418
|
-
| `maxLength` | `number` | `undefined` | No | Maximum input length |
|
|
419
|
-
| `placeholder` | `string` | `undefined` | No | Input placeholder text |
|
|
420
|
-
| `submitText` | `string` | `'Create'` | No | Submit button text |
|
|
421
|
-
| `cancelText` | `string` | `'Cancel'` | No | Cancel button text |
|
|
422
|
-
| `isLoading` | `boolean` | `false` | No | General loading state |
|
|
423
|
-
| `isLoadingSubmit` | `boolean` | `false` | No | Submit button loading state |
|
|
424
|
-
| `moreActions` | `ReactElement` | `undefined` | No | Additional actions |
|
|
425
|
-
| `onBack` | `() => void` | `undefined` | No | Back navigation callback |
|
|
426
|
-
| `onChange` | `(value: string) => void` | `undefined` | No | Input change callback |
|
|
427
|
-
| `onComplete` | `(value: string) => void` | `undefined` | No | Input completion callback |
|
|
428
|
-
| `onSubmit` | `(value: string) => void` | `undefined` | No | Form submit callback |
|
|
429
|
-
| `onCancel` | `() => void` | `undefined` | No | Cancel callback |
|
|
430
|
-
| `onResolveError` | `() => void` | `undefined` | No | Error resolution callback |
|
|
431
|
-
|
|
432
|
-
### AutosizeInput
|
|
433
|
-
|
|
434
|
-
| Prop | Type | Default | Required | Description |
|
|
435
|
-
|------|------|---------|----------|-------------|
|
|
436
|
-
| `value` | `string` | - | Yes | Input value |
|
|
437
|
-
| `placeholder` | `string` | `undefined` | No | Placeholder text |
|
|
438
|
-
| `maxLength` | `number` | `undefined` | No | Maximum character length |
|
|
439
|
-
| `onChange` | `(value: string) => void` | `undefined` | No | Change callback |
|
|
440
|
-
| `onComplete` | `(value: string) => void` | `undefined` | No | Completion callback (Enter key) |
|
|
441
|
-
|
|
442
|
-
## AI Agent Guidelines
|
|
443
|
-
|
|
444
|
-
### Recommended Patterns
|
|
445
|
-
|
|
446
|
-
1. **Consistent Navigation**: Use back buttons for hierarchical navigation
|
|
447
|
-
```typescript
|
|
448
|
-
<PageHeader
|
|
449
|
-
title="User Details"
|
|
450
|
-
onBack={() => navigate('/users')}
|
|
451
|
-
/>
|
|
452
|
-
```
|
|
453
|
-
|
|
454
|
-
2. **Action Placement**: Place primary actions on the right, secondary actions in moreActions
|
|
455
|
-
```typescript
|
|
456
|
-
<PageHeader
|
|
457
|
-
title="Edit Profile"
|
|
458
|
-
submitText="Save Changes"
|
|
459
|
-
cancelText="Cancel"
|
|
460
|
-
moreActions={<Button view="ghost">Preview</Button>}
|
|
461
|
-
onSubmit={handleSave}
|
|
462
|
-
onCancel={handleCancel}
|
|
463
|
-
/>
|
|
464
|
-
```
|
|
465
|
-
|
|
466
|
-
3. **Error Handling**: Provide clear error messages with resolution actions
|
|
467
|
-
```typescript
|
|
468
|
-
<PageHeader
|
|
469
|
-
title="Import Data"
|
|
470
|
-
error="Connection failed"
|
|
471
|
-
resolveErrorText="Retry Connection"
|
|
472
|
-
onResolveError={handleRetry}
|
|
473
|
-
/>
|
|
474
|
-
```
|
|
475
|
-
|
|
476
|
-
### Common Mistakes to Avoid
|
|
477
|
-
|
|
478
|
-
1. **Missing Hierarchy**: Don't use back buttons on top-level pages
|
|
479
|
-
2. **Inconsistent Actions**: Keep submit/cancel patterns consistent across the app
|
|
480
|
-
3. **Unclear Titles**: Use descriptive, action-oriented titles
|
|
481
|
-
4. **Missing Loading States**: Always handle loading states for async actions
|
|
482
|
-
5. **Too Many Actions**: Limit primary actions to 2-3, move others to moreActions
|
|
483
|
-
|
|
484
|
-
### Integration Tips
|
|
485
|
-
|
|
486
|
-
1. **Routing Integration**: Works well with React Router for navigation
|
|
487
|
-
```typescript
|
|
488
|
-
const navigate = useNavigate();
|
|
489
|
-
<PageHeader onBack={() => navigate(-1)} />
|
|
490
|
-
```
|
|
491
|
-
|
|
492
|
-
2. **Form Integration**: Coordinates well with form libraries
|
|
493
|
-
```typescript
|
|
494
|
-
const { handleSubmit, formState: { isSubmitting } } = useForm();
|
|
495
|
-
|
|
496
|
-
<PageHeader
|
|
497
|
-
onSubmit={handleSubmit(onSubmit)}
|
|
498
|
-
isLoadingSubmit={isSubmitting}
|
|
499
|
-
/>
|
|
500
|
-
```
|
|
501
|
-
|
|
502
|
-
3. **State Management**: Integrates with global state for error handling
|
|
503
|
-
4. **Accessibility**: Components include proper ARIA labels and keyboard navigation
|
|
504
|
-
5. **Responsive**: Layout adapts to different screen sizes automatically
|
|
505
|
-
|
|
506
|
-
## Related Components
|
|
507
|
-
|
|
508
|
-
- **Button**: Used internally for actions
|
|
509
|
-
- **Modal**: For modal dialogs with similar header patterns
|
|
510
|
-
- **Breadcrumb**: For more complex navigation hierarchies
|
|
511
|
-
- **Tabs**: For sub-page navigation within the same level
|