@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.
- 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 +7 -0
- package/Calendar/CalendarSuperForm/types.d.ts +36 -10
- 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 +12 -1
- package/Drawer/components/Drawer/types.d.ts +10 -1
- 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,417 +0,0 @@
|
|
|
1
|
-
# Drawer - AI Documentation
|
|
2
|
-
|
|
3
|
-
> Auto-generated AI agent documentation for Drawer component system
|
|
4
|
-
> Part of @pushwoosh/dumb-components library
|
|
5
|
-
|
|
6
|
-
## Overview
|
|
7
|
-
|
|
8
|
-
**Components:** Drawer, DrawerHeader, DrawerTitle, DrawerBody, DrawerDocs
|
|
9
|
-
**Import Path:** `import { Drawer, DrawerHeader, DrawerTitle, DrawerBody, DrawerDocs, useDocs } from '@pushwoosh/dumb-components'`
|
|
10
|
-
**Files:** Complex nested structure with Drawer, DrawerContent, and DrawerDocs components
|
|
11
|
-
**Type:** Layout Component / Overlay Component
|
|
12
|
-
**Description:** Slide-out drawer component system for side panels, documentation, and additional content areas
|
|
13
|
-
|
|
14
|
-
## TypeScript Interfaces
|
|
15
|
-
|
|
16
|
-
```typescript
|
|
17
|
-
// Main Drawer component
|
|
18
|
-
interface DrawerProps {
|
|
19
|
-
readonly size: 'small' | 'medium' | 'large' | 'full';
|
|
20
|
-
readonly isOpen: boolean;
|
|
21
|
-
readonly zIndex?: number;
|
|
22
|
-
readonly onClose?: () => any;
|
|
23
|
-
readonly withoutLockScreen?: boolean;
|
|
24
|
-
readonly closeOnClickOutside?: boolean;
|
|
25
|
-
readonly padding?: ContentPadding;
|
|
26
|
-
readonly children: ReactNode;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Content padding configuration
|
|
30
|
-
interface ContentPadding {
|
|
31
|
-
top?: string;
|
|
32
|
-
right?: string;
|
|
33
|
-
bottom?: string;
|
|
34
|
-
left?: string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Drawer size mapping
|
|
38
|
-
const drawerSizes = {
|
|
39
|
-
small: '380px',
|
|
40
|
-
medium: '640px',
|
|
41
|
-
large: '980px',
|
|
42
|
-
full: '100%',
|
|
43
|
-
};
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Import & Usage
|
|
47
|
-
|
|
48
|
-
**Import:**
|
|
49
|
-
```typescript
|
|
50
|
-
import {
|
|
51
|
-
Drawer,
|
|
52
|
-
DrawerHeader,
|
|
53
|
-
DrawerTitle,
|
|
54
|
-
DrawerBody,
|
|
55
|
-
DrawerDocs,
|
|
56
|
-
useDocs
|
|
57
|
-
} from '@pushwoosh/dumb-components';
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
**Basic Usage:**
|
|
61
|
-
```tsx
|
|
62
|
-
function App() {
|
|
63
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<>
|
|
67
|
-
<Button onClick={() => setIsOpen(true)}>Open Drawer</Button>
|
|
68
|
-
|
|
69
|
-
<Drawer
|
|
70
|
-
size="medium"
|
|
71
|
-
isOpen={isOpen}
|
|
72
|
-
onClose={() => setIsOpen(false)}
|
|
73
|
-
>
|
|
74
|
-
<DrawerHeader>
|
|
75
|
-
<DrawerTitle>Drawer Title</DrawerTitle>
|
|
76
|
-
</DrawerHeader>
|
|
77
|
-
<DrawerBody>
|
|
78
|
-
<p>Drawer content goes here</p>
|
|
79
|
-
</DrawerBody>
|
|
80
|
-
</Drawer>
|
|
81
|
-
</>
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
## Advanced Examples
|
|
87
|
-
|
|
88
|
-
```tsx
|
|
89
|
-
// Settings drawer with form
|
|
90
|
-
function SettingsDrawer() {
|
|
91
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
92
|
-
const [settings, setSettings] = useState({});
|
|
93
|
-
|
|
94
|
-
return (
|
|
95
|
-
<Drawer
|
|
96
|
-
size="large"
|
|
97
|
-
isOpen={isOpen}
|
|
98
|
-
onClose={() => setIsOpen(false)}
|
|
99
|
-
closeOnClickOutside={true}
|
|
100
|
-
>
|
|
101
|
-
<DrawerHeader>
|
|
102
|
-
<DrawerTitle>Application Settings</DrawerTitle>
|
|
103
|
-
<Button
|
|
104
|
-
color="secondary"
|
|
105
|
-
onClick={() => setIsOpen(false)}
|
|
106
|
-
>
|
|
107
|
-
Close
|
|
108
|
-
</Button>
|
|
109
|
-
</DrawerHeader>
|
|
110
|
-
|
|
111
|
-
<DrawerBody>
|
|
112
|
-
<form>
|
|
113
|
-
<div>
|
|
114
|
-
<label>Theme:</label>
|
|
115
|
-
<Select
|
|
116
|
-
value={settings.theme}
|
|
117
|
-
onChange={(theme) => setSettings(prev => ({ ...prev, theme }))}
|
|
118
|
-
options={[
|
|
119
|
-
{ value: 'light', label: 'Light' },
|
|
120
|
-
{ value: 'dark', label: 'Dark' }
|
|
121
|
-
]}
|
|
122
|
-
/>
|
|
123
|
-
</div>
|
|
124
|
-
|
|
125
|
-
<div>
|
|
126
|
-
<Checkbox
|
|
127
|
-
label="Enable notifications"
|
|
128
|
-
isChecked={settings.notifications}
|
|
129
|
-
onChange={(checked) => setSettings(prev => ({ ...prev, notifications: checked }))}
|
|
130
|
-
/>
|
|
131
|
-
</div>
|
|
132
|
-
|
|
133
|
-
<Button type="submit" color="primary">
|
|
134
|
-
Save Settings
|
|
135
|
-
</Button>
|
|
136
|
-
</form>
|
|
137
|
-
</DrawerBody>
|
|
138
|
-
</Drawer>
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// Documentation drawer
|
|
143
|
-
function ComponentDocumentation() {
|
|
144
|
-
const { isOpen, open, close } = useDocs();
|
|
145
|
-
|
|
146
|
-
return (
|
|
147
|
-
<>
|
|
148
|
-
<Button onClick={() => open('button-docs')}>
|
|
149
|
-
View Button Docs
|
|
150
|
-
</Button>
|
|
151
|
-
|
|
152
|
-
<DrawerDocs
|
|
153
|
-
isOpen={isOpen}
|
|
154
|
-
onClose={close}
|
|
155
|
-
size="large"
|
|
156
|
-
>
|
|
157
|
-
<h1>Button Component Documentation</h1>
|
|
158
|
-
<p>Detailed documentation content...</p>
|
|
159
|
-
</DrawerDocs>
|
|
160
|
-
</>
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// Filter drawer for data tables
|
|
165
|
-
function FilterDrawer({ filters, onFiltersChange }) {
|
|
166
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
167
|
-
const [localFilters, setLocalFilters] = useState(filters);
|
|
168
|
-
|
|
169
|
-
const applyFilters = () => {
|
|
170
|
-
onFiltersChange(localFilters);
|
|
171
|
-
setIsOpen(false);
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
return (
|
|
175
|
-
<Drawer
|
|
176
|
-
size="small"
|
|
177
|
-
isOpen={isOpen}
|
|
178
|
-
onClose={() => setIsOpen(false)}
|
|
179
|
-
padding={{ top: '0', right: '0', bottom: '0', left: '0' }}
|
|
180
|
-
>
|
|
181
|
-
<DrawerHeader>
|
|
182
|
-
<DrawerTitle>Filter Results</DrawerTitle>
|
|
183
|
-
</DrawerHeader>
|
|
184
|
-
|
|
185
|
-
<DrawerBody>
|
|
186
|
-
<div style={{ padding: '16px' }}>
|
|
187
|
-
{/* Date range filter */}
|
|
188
|
-
<div>
|
|
189
|
-
<h4>Date Range</h4>
|
|
190
|
-
<DatePickerField
|
|
191
|
-
value={localFilters.startDate}
|
|
192
|
-
onChange={(date) => setLocalFilters(prev => ({ ...prev, startDate: date }))}
|
|
193
|
-
/>
|
|
194
|
-
<DatePickerField
|
|
195
|
-
value={localFilters.endDate}
|
|
196
|
-
onChange={(date) => setLocalFilters(prev => ({ ...prev, endDate: date }))}
|
|
197
|
-
/>
|
|
198
|
-
</div>
|
|
199
|
-
|
|
200
|
-
{/* Status filter */}
|
|
201
|
-
<div>
|
|
202
|
-
<h4>Status</h4>
|
|
203
|
-
{['active', 'inactive', 'pending'].map(status => (
|
|
204
|
-
<Checkbox
|
|
205
|
-
key={status}
|
|
206
|
-
label={status}
|
|
207
|
-
isChecked={localFilters.statuses?.includes(status)}
|
|
208
|
-
onChange={(checked) => {
|
|
209
|
-
const newStatuses = checked
|
|
210
|
-
? [...(localFilters.statuses || []), status]
|
|
211
|
-
: localFilters.statuses?.filter(s => s !== status) || [];
|
|
212
|
-
setLocalFilters(prev => ({ ...prev, statuses: newStatuses }));
|
|
213
|
-
}}
|
|
214
|
-
/>
|
|
215
|
-
))}
|
|
216
|
-
</div>
|
|
217
|
-
|
|
218
|
-
<div style={{ marginTop: '24px', display: 'flex', gap: '8px' }}>
|
|
219
|
-
<Button color="primary" onClick={applyFilters}>
|
|
220
|
-
Apply Filters
|
|
221
|
-
</Button>
|
|
222
|
-
<Button color="secondary" onClick={() => setIsOpen(false)}>
|
|
223
|
-
Cancel
|
|
224
|
-
</Button>
|
|
225
|
-
</div>
|
|
226
|
-
</div>
|
|
227
|
-
</DrawerBody>
|
|
228
|
-
</Drawer>
|
|
229
|
-
);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
// Full-size drawer for detailed views
|
|
233
|
-
<Drawer
|
|
234
|
-
size="full"
|
|
235
|
-
isOpen={showDetails}
|
|
236
|
-
onClose={() => setShowDetails(false)}
|
|
237
|
-
withoutLockScreen={false}
|
|
238
|
-
>
|
|
239
|
-
<DrawerHeader>
|
|
240
|
-
<DrawerTitle>User Profile Details</DrawerTitle>
|
|
241
|
-
</DrawerHeader>
|
|
242
|
-
<DrawerBody>
|
|
243
|
-
{/* Full user profile interface */}
|
|
244
|
-
</DrawerBody>
|
|
245
|
-
</Drawer>
|
|
246
|
-
|
|
247
|
-
// Custom padding drawer
|
|
248
|
-
<Drawer
|
|
249
|
-
size="medium"
|
|
250
|
-
isOpen={isOpen}
|
|
251
|
-
onClose={closeDrawer}
|
|
252
|
-
padding={{
|
|
253
|
-
top: '24px',
|
|
254
|
-
right: '32px',
|
|
255
|
-
bottom: '24px',
|
|
256
|
-
left: '32px'
|
|
257
|
-
}}
|
|
258
|
-
>
|
|
259
|
-
<h2>Custom Padded Content</h2>
|
|
260
|
-
</Drawer>
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
## Props Reference
|
|
264
|
-
|
|
265
|
-
### Drawer
|
|
266
|
-
| Prop | Type | Default | Description |
|
|
267
|
-
|------|------|---------|-------------|
|
|
268
|
-
| size | 'small' \| 'medium' \| 'large' \| 'full' | required | Drawer width size |
|
|
269
|
-
| isOpen | boolean | required | Whether drawer is visible |
|
|
270
|
-
| onClose | () => any | undefined | Close callback function |
|
|
271
|
-
| zIndex | number | 10000 | Z-index for drawer overlay |
|
|
272
|
-
| withoutLockScreen | boolean | false | Whether to prevent body scrolling |
|
|
273
|
-
| closeOnClickOutside | boolean | true | Whether clicking outside closes drawer |
|
|
274
|
-
| padding | ContentPadding | undefined | Custom padding for drawer content |
|
|
275
|
-
| children | ReactNode | required | Drawer content |
|
|
276
|
-
|
|
277
|
-
### Size Reference
|
|
278
|
-
| Size | Width | Best Used For |
|
|
279
|
-
|------|-------|---------------|
|
|
280
|
-
| small | 380px | Filters, simple forms, navigation |
|
|
281
|
-
| medium | 640px | Settings, detailed forms, content |
|
|
282
|
-
| large | 980px | Complex interfaces, documentation |
|
|
283
|
-
| full | 100% | Full-screen experiences, editors |
|
|
284
|
-
|
|
285
|
-
## Drawer Content Components
|
|
286
|
-
|
|
287
|
-
### DrawerHeader
|
|
288
|
-
Container for drawer title and header actions
|
|
289
|
-
```tsx
|
|
290
|
-
<DrawerHeader>
|
|
291
|
-
<DrawerTitle>Title</DrawerTitle>
|
|
292
|
-
<Button onClick={closeDrawer}>Close</Button>
|
|
293
|
-
</DrawerHeader>
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
### DrawerTitle
|
|
297
|
-
Styled title component for drawer headers
|
|
298
|
-
```tsx
|
|
299
|
-
<DrawerTitle>Settings</DrawerTitle>
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
### DrawerBody
|
|
303
|
-
Main content area of the drawer
|
|
304
|
-
```tsx
|
|
305
|
-
<DrawerBody>
|
|
306
|
-
<p>Main content goes here</p>
|
|
307
|
-
</DrawerBody>
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
## AI Agent Guidelines
|
|
311
|
-
|
|
312
|
-
### ✅ Recommended Patterns
|
|
313
|
-
- Use appropriate size for content complexity (small for filters, large for detailed interfaces)
|
|
314
|
-
- Include proper header with title and close action
|
|
315
|
-
- Set `closeOnClickOutside={true}` for better UX
|
|
316
|
-
- Handle keyboard escape for accessibility
|
|
317
|
-
- Use DrawerBody for main content with proper padding
|
|
318
|
-
- Include loading states for async content
|
|
319
|
-
|
|
320
|
-
### ❌ Common Mistakes to Avoid
|
|
321
|
-
- Don't forget onClose handler - drawer won't be closable
|
|
322
|
-
- Don't use full size unless absolutely necessary
|
|
323
|
-
- Avoid nesting drawers within each other
|
|
324
|
-
- Don't put critical actions only in click-outside areas
|
|
325
|
-
- Avoid very complex content in small drawers
|
|
326
|
-
|
|
327
|
-
### Integration Tips
|
|
328
|
-
- Works well for settings panels and configuration UIs
|
|
329
|
-
- Good for detailed views that don't need full modals
|
|
330
|
-
- Effective for documentation and help content
|
|
331
|
-
- Can contain forms, lists, and complex interfaces
|
|
332
|
-
- Use with consistent animation and z-index management
|
|
333
|
-
|
|
334
|
-
## Common Use Cases
|
|
335
|
-
|
|
336
|
-
### 1. User Settings Panel
|
|
337
|
-
```tsx
|
|
338
|
-
function UserSettings() {
|
|
339
|
-
const [settingsOpen, setSettingsOpen] = useState(false);
|
|
340
|
-
|
|
341
|
-
return (
|
|
342
|
-
<Drawer
|
|
343
|
-
size="medium"
|
|
344
|
-
isOpen={settingsOpen}
|
|
345
|
-
onClose={() => setSettingsOpen(false)}
|
|
346
|
-
>
|
|
347
|
-
<DrawerHeader>
|
|
348
|
-
<DrawerTitle>User Settings</DrawerTitle>
|
|
349
|
-
</DrawerHeader>
|
|
350
|
-
<DrawerBody>
|
|
351
|
-
<UserSettingsForm onSave={() => setSettingsOpen(false)} />
|
|
352
|
-
</DrawerBody>
|
|
353
|
-
</Drawer>
|
|
354
|
-
);
|
|
355
|
-
}
|
|
356
|
-
```
|
|
357
|
-
|
|
358
|
-
### 2. Navigation Menu
|
|
359
|
-
```tsx
|
|
360
|
-
function MobileNavigation() {
|
|
361
|
-
const [navOpen, setNavOpen] = useState(false);
|
|
362
|
-
|
|
363
|
-
return (
|
|
364
|
-
<Drawer
|
|
365
|
-
size="small"
|
|
366
|
-
isOpen={navOpen}
|
|
367
|
-
onClose={() => setNavOpen(false)}
|
|
368
|
-
>
|
|
369
|
-
<DrawerBody>
|
|
370
|
-
<nav>
|
|
371
|
-
<Link to="/dashboard" onClick={() => setNavOpen(false)}>Dashboard</Link>
|
|
372
|
-
<Link to="/users" onClick={() => setNavOpen(false)}>Users</Link>
|
|
373
|
-
<Link to="/settings" onClick={() => setNavOpen(false)}>Settings</Link>
|
|
374
|
-
</nav>
|
|
375
|
-
</DrawerBody>
|
|
376
|
-
</Drawer>
|
|
377
|
-
);
|
|
378
|
-
}
|
|
379
|
-
```
|
|
380
|
-
|
|
381
|
-
### 3. Documentation Panel
|
|
382
|
-
```tsx
|
|
383
|
-
function HelpDrawer() {
|
|
384
|
-
const { isOpen, close } = useDocs();
|
|
385
|
-
|
|
386
|
-
return (
|
|
387
|
-
<DrawerDocs
|
|
388
|
-
isOpen={isOpen}
|
|
389
|
-
onClose={close}
|
|
390
|
-
size="large"
|
|
391
|
-
>
|
|
392
|
-
<DrawerHeader>
|
|
393
|
-
<DrawerTitle>Help Documentation</DrawerTitle>
|
|
394
|
-
</DrawerHeader>
|
|
395
|
-
<DrawerBody>
|
|
396
|
-
<div>
|
|
397
|
-
{/* Documentation content */}
|
|
398
|
-
</div>
|
|
399
|
-
</DrawerBody>
|
|
400
|
-
</DrawerDocs>
|
|
401
|
-
);
|
|
402
|
-
}
|
|
403
|
-
```
|
|
404
|
-
|
|
405
|
-
## Accessibility Features
|
|
406
|
-
- **Keyboard Navigation**: Escape key closes drawer
|
|
407
|
-
- **Focus Management**: Traps focus within drawer when open
|
|
408
|
-
- **Screen Reader Support**: Proper ARIA attributes
|
|
409
|
-
- **Body Lock**: Prevents background scrolling when open
|
|
410
|
-
|
|
411
|
-
## Related Components
|
|
412
|
-
- Modal - for blocking interactions requiring immediate attention
|
|
413
|
-
- Popover - for smaller contextual content
|
|
414
|
-
- Tabs - for organizing content within drawers
|
|
415
|
-
- Button - for drawer triggers and actions
|
|
416
|
-
|
|
417
|
-
---
|