@pushwoosh/dumb-components 1.1.148 → 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 +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 +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,485 +0,0 @@
|
|
|
1
|
-
# Native Components - AI Documentation
|
|
2
|
-
|
|
3
|
-
> Auto-generated AI agent documentation for Native HTML components
|
|
4
|
-
> Part of @pushwoosh/dumb-components library
|
|
5
|
-
|
|
6
|
-
## Overview
|
|
7
|
-
**Components:** NativeInput, NativeSelect, NativeTextarea, NativeTimeInput
|
|
8
|
-
**Import Path:** `import { NativeInput, NativeSelect, NativeTextarea, NativeTimeInput } from '@pushwoosh/dumb-components'`
|
|
9
|
-
**Files:**
|
|
10
|
-
- `native/Input.tsx` - Styled native input component
|
|
11
|
-
- `native/Select.tsx` - Styled native select component
|
|
12
|
-
- `native/Textarea.tsx` - Styled native textarea component
|
|
13
|
-
- `native/TimeInput.tsx` - Styled native time input component
|
|
14
|
-
- `native/index.ts` - Main exports
|
|
15
|
-
**Type:** Base Form Components / Styled HTML Elements
|
|
16
|
-
**Description:** Styled-components wrappers around native HTML form elements. These provide consistent Pushwoosh Design System styling while maintaining native HTML behavior. Used internally by enhanced components like EnhancedInput.
|
|
17
|
-
|
|
18
|
-
## TypeScript Interfaces
|
|
19
|
-
|
|
20
|
-
### NativeInputProps
|
|
21
|
-
```typescript
|
|
22
|
-
interface NativeInputProps {
|
|
23
|
-
$isErrored?: boolean; // Error state styling (red border)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Extends all standard HTMLInputElement attributes:
|
|
27
|
-
// value, onChange, placeholder, type, disabled, readOnly, etc.
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
### NativeSelectProps
|
|
31
|
-
```typescript
|
|
32
|
-
interface NativeSelectProps {
|
|
33
|
-
$isErrored?: boolean; // Error state styling (red border)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Extends all standard HTMLSelectElement attributes:
|
|
37
|
-
// value, onChange, disabled, multiple, etc.
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### NativeTextareaProps
|
|
41
|
-
```typescript
|
|
42
|
-
interface NativeTextareaProps {
|
|
43
|
-
$width?: string; // Custom width (default: 100%)
|
|
44
|
-
$isErrored?: boolean; // Error state styling (red border)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Extends all standard HTMLTextAreaElement attributes:
|
|
48
|
-
// value, onChange, placeholder, rows, cols, disabled, etc.
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### NativeTimeInputProps
|
|
52
|
-
```typescript
|
|
53
|
-
// NativeTimeInput is a styled input[type="time"] element
|
|
54
|
-
// Extends all standard HTMLInputElement attributes:
|
|
55
|
-
// value, onChange, disabled, readOnly, min, max, step, etc.
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
## Import & Usage
|
|
59
|
-
|
|
60
|
-
### NativeInput
|
|
61
|
-
```tsx
|
|
62
|
-
import { NativeInput } from '@pushwoosh/dumb-components';
|
|
63
|
-
|
|
64
|
-
function BasicInput() {
|
|
65
|
-
const [value, setValue] = useState('');
|
|
66
|
-
|
|
67
|
-
return (
|
|
68
|
-
<NativeInput
|
|
69
|
-
type="text"
|
|
70
|
-
value={value}
|
|
71
|
-
onChange={(e) => setValue(e.target.value)}
|
|
72
|
-
placeholder="Enter text..."
|
|
73
|
-
/>
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### NativeSelect
|
|
79
|
-
```tsx
|
|
80
|
-
import { NativeSelect } from '@pushwoosh/dumb-components';
|
|
81
|
-
|
|
82
|
-
function BasicSelect() {
|
|
83
|
-
const [value, setValue] = useState('');
|
|
84
|
-
|
|
85
|
-
return (
|
|
86
|
-
<NativeSelect
|
|
87
|
-
value={value}
|
|
88
|
-
onChange={(e) => setValue(e.target.value)}
|
|
89
|
-
>
|
|
90
|
-
<option value="">Select an option</option>
|
|
91
|
-
<option value="option1">Option 1</option>
|
|
92
|
-
<option value="option2">Option 2</option>
|
|
93
|
-
<option value="option3">Option 3</option>
|
|
94
|
-
</NativeSelect>
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### NativeTextarea
|
|
100
|
-
```tsx
|
|
101
|
-
import { NativeTextarea } from '@pushwoosh/dumb-components';
|
|
102
|
-
|
|
103
|
-
function BasicTextarea() {
|
|
104
|
-
const [value, setValue] = useState('');
|
|
105
|
-
|
|
106
|
-
return (
|
|
107
|
-
<NativeTextarea
|
|
108
|
-
value={value}
|
|
109
|
-
onChange={(e) => setValue(e.target.value)}
|
|
110
|
-
placeholder="Enter your message..."
|
|
111
|
-
rows={4}
|
|
112
|
-
/>
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
### NativeTimeInput
|
|
118
|
-
```tsx
|
|
119
|
-
import { NativeTimeInput } from '@pushwoosh/dumb-components';
|
|
120
|
-
|
|
121
|
-
function BasicTimeInput() {
|
|
122
|
-
const [time, setTime] = useState('09:00');
|
|
123
|
-
|
|
124
|
-
return (
|
|
125
|
-
<NativeTimeInput
|
|
126
|
-
value={time}
|
|
127
|
-
onChange={(e) => setTime(e.target.value)}
|
|
128
|
-
/>
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
## Advanced Examples
|
|
134
|
-
|
|
135
|
-
### Form with Validation
|
|
136
|
-
```tsx
|
|
137
|
-
import { NativeInput, NativeSelect, NativeTextarea } from '@pushwoosh/dumb-components';
|
|
138
|
-
|
|
139
|
-
function ValidationForm() {
|
|
140
|
-
const [formData, setFormData] = useState({
|
|
141
|
-
name: '',
|
|
142
|
-
category: '',
|
|
143
|
-
message: ''
|
|
144
|
-
});
|
|
145
|
-
const [errors, setErrors] = useState({});
|
|
146
|
-
|
|
147
|
-
const validate = () => {
|
|
148
|
-
const newErrors = {};
|
|
149
|
-
if (!formData.name) newErrors.name = 'Name is required';
|
|
150
|
-
if (!formData.category) newErrors.category = 'Category is required';
|
|
151
|
-
if (!formData.message) newErrors.message = 'Message is required';
|
|
152
|
-
|
|
153
|
-
setErrors(newErrors);
|
|
154
|
-
return Object.keys(newErrors).length === 0;
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
const handleSubmit = (e) => {
|
|
158
|
-
e.preventDefault();
|
|
159
|
-
if (validate()) {
|
|
160
|
-
console.log('Form submitted:', formData);
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
return (
|
|
165
|
-
<form onSubmit={handleSubmit}>
|
|
166
|
-
<div>
|
|
167
|
-
<label>Name:</label>
|
|
168
|
-
<NativeInput
|
|
169
|
-
type="text"
|
|
170
|
-
value={formData.name}
|
|
171
|
-
onChange={(e) => setFormData({ ...formData, name: e.target.value })}
|
|
172
|
-
$isErrored={!!errors.name}
|
|
173
|
-
placeholder="Your name"
|
|
174
|
-
/>
|
|
175
|
-
{errors.name && <span style={{ color: 'red' }}>{errors.name}</span>}
|
|
176
|
-
</div>
|
|
177
|
-
|
|
178
|
-
<div>
|
|
179
|
-
<label>Category:</label>
|
|
180
|
-
<NativeSelect
|
|
181
|
-
value={formData.category}
|
|
182
|
-
onChange={(e) => setFormData({ ...formData, category: e.target.value })}
|
|
183
|
-
$isErrored={!!errors.category}
|
|
184
|
-
>
|
|
185
|
-
<option value="">Select category</option>
|
|
186
|
-
<option value="bug">Bug Report</option>
|
|
187
|
-
<option value="feature">Feature Request</option>
|
|
188
|
-
<option value="question">Question</option>
|
|
189
|
-
</NativeSelect>
|
|
190
|
-
{errors.category && <span style={{ color: 'red' }}>{errors.category}</span>}
|
|
191
|
-
</div>
|
|
192
|
-
|
|
193
|
-
<div>
|
|
194
|
-
<label>Message:</label>
|
|
195
|
-
<NativeTextarea
|
|
196
|
-
value={formData.message}
|
|
197
|
-
onChange={(e) => setFormData({ ...formData, message: e.target.value })}
|
|
198
|
-
$isErrored={!!errors.message}
|
|
199
|
-
placeholder="Describe your issue..."
|
|
200
|
-
rows={5}
|
|
201
|
-
/>
|
|
202
|
-
{errors.message && <span style={{ color: 'red' }}>{errors.message}</span>}
|
|
203
|
-
</div>
|
|
204
|
-
|
|
205
|
-
<button type="submit">Submit</button>
|
|
206
|
-
</form>
|
|
207
|
-
);
|
|
208
|
-
}
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
### Different Input Types
|
|
212
|
-
```tsx
|
|
213
|
-
import { NativeInput, NativeTimeInput } from '@pushwoosh/dumb-components';
|
|
214
|
-
|
|
215
|
-
function InputTypes() {
|
|
216
|
-
const [formData, setFormData] = useState({
|
|
217
|
-
email: '',
|
|
218
|
-
password: '',
|
|
219
|
-
number: '',
|
|
220
|
-
date: '',
|
|
221
|
-
time: '09:00',
|
|
222
|
-
url: ''
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
return (
|
|
226
|
-
<div>
|
|
227
|
-
<NativeInput
|
|
228
|
-
type="email"
|
|
229
|
-
value={formData.email}
|
|
230
|
-
onChange={(e) => setFormData({ ...formData, email: e.target.value })}
|
|
231
|
-
placeholder="email@example.com"
|
|
232
|
-
/>
|
|
233
|
-
|
|
234
|
-
<NativeInput
|
|
235
|
-
type="password"
|
|
236
|
-
value={formData.password}
|
|
237
|
-
onChange={(e) => setFormData({ ...formData, password: e.target.value })}
|
|
238
|
-
placeholder="Password"
|
|
239
|
-
/>
|
|
240
|
-
|
|
241
|
-
<NativeInput
|
|
242
|
-
type="number"
|
|
243
|
-
value={formData.number}
|
|
244
|
-
onChange={(e) => setFormData({ ...formData, number: e.target.value })}
|
|
245
|
-
placeholder="Enter number"
|
|
246
|
-
min="0"
|
|
247
|
-
max="100"
|
|
248
|
-
/>
|
|
249
|
-
|
|
250
|
-
<NativeInput
|
|
251
|
-
type="date"
|
|
252
|
-
value={formData.date}
|
|
253
|
-
onChange={(e) => setFormData({ ...formData, date: e.target.value })}
|
|
254
|
-
/>
|
|
255
|
-
|
|
256
|
-
<NativeTimeInput
|
|
257
|
-
value={formData.time}
|
|
258
|
-
onChange={(e) => setFormData({ ...formData, time: e.target.value })}
|
|
259
|
-
/>
|
|
260
|
-
|
|
261
|
-
<NativeInput
|
|
262
|
-
type="url"
|
|
263
|
-
value={formData.url}
|
|
264
|
-
onChange={(e) => setFormData({ ...formData, url: e.target.value })}
|
|
265
|
-
placeholder="https://example.com"
|
|
266
|
-
/>
|
|
267
|
-
</div>
|
|
268
|
-
);
|
|
269
|
-
}
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
### Custom Textarea Sizes
|
|
273
|
-
```tsx
|
|
274
|
-
import { NativeTextarea } from '@pushwoosh/dumb-components';
|
|
275
|
-
|
|
276
|
-
function TextareaSizes() {
|
|
277
|
-
return (
|
|
278
|
-
<div style={{ display: 'flex', gap: '20px' }}>
|
|
279
|
-
<NativeTextarea
|
|
280
|
-
placeholder="Small textarea"
|
|
281
|
-
$width="200px"
|
|
282
|
-
rows={3}
|
|
283
|
-
/>
|
|
284
|
-
|
|
285
|
-
<NativeTextarea
|
|
286
|
-
placeholder="Medium textarea"
|
|
287
|
-
$width="300px"
|
|
288
|
-
rows={5}
|
|
289
|
-
/>
|
|
290
|
-
|
|
291
|
-
<NativeTextarea
|
|
292
|
-
placeholder="Large textarea"
|
|
293
|
-
$width="400px"
|
|
294
|
-
rows={8}
|
|
295
|
-
/>
|
|
296
|
-
</div>
|
|
297
|
-
);
|
|
298
|
-
}
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
### Select with Grouped Options
|
|
302
|
-
```tsx
|
|
303
|
-
import { NativeSelect } from '@pushwoosh/dumb-components';
|
|
304
|
-
|
|
305
|
-
function GroupedSelect() {
|
|
306
|
-
const [value, setValue] = useState('');
|
|
307
|
-
|
|
308
|
-
return (
|
|
309
|
-
<NativeSelect
|
|
310
|
-
value={value}
|
|
311
|
-
onChange={(e) => setValue(e.target.value)}
|
|
312
|
-
>
|
|
313
|
-
<option value="">Choose a programming language</option>
|
|
314
|
-
|
|
315
|
-
<optgroup label="Frontend">
|
|
316
|
-
<option value="javascript">JavaScript</option>
|
|
317
|
-
<option value="typescript">TypeScript</option>
|
|
318
|
-
<option value="html">HTML</option>
|
|
319
|
-
<option value="css">CSS</option>
|
|
320
|
-
</optgroup>
|
|
321
|
-
|
|
322
|
-
<optgroup label="Backend">
|
|
323
|
-
<option value="node">Node.js</option>
|
|
324
|
-
<option value="python">Python</option>
|
|
325
|
-
<option value="java">Java</option>
|
|
326
|
-
<option value="csharp">C#</option>
|
|
327
|
-
</optgroup>
|
|
328
|
-
|
|
329
|
-
<optgroup label="Database">
|
|
330
|
-
<option value="mysql">MySQL</option>
|
|
331
|
-
<option value="postgresql">PostgreSQL</option>
|
|
332
|
-
<option value="mongodb">MongoDB</option>
|
|
333
|
-
</optgroup>
|
|
334
|
-
</NativeSelect>
|
|
335
|
-
);
|
|
336
|
-
}
|
|
337
|
-
```
|
|
338
|
-
|
|
339
|
-
### Disabled and ReadOnly States
|
|
340
|
-
```tsx
|
|
341
|
-
import { NativeInput, NativeSelect, NativeTextarea, NativeTimeInput } from '@pushwoosh/dumb-components';
|
|
342
|
-
|
|
343
|
-
function DisabledStates() {
|
|
344
|
-
return (
|
|
345
|
-
<div>
|
|
346
|
-
{/* Disabled inputs */}
|
|
347
|
-
<NativeInput
|
|
348
|
-
value="Disabled input"
|
|
349
|
-
disabled
|
|
350
|
-
placeholder="This is disabled"
|
|
351
|
-
/>
|
|
352
|
-
|
|
353
|
-
<NativeSelect disabled>
|
|
354
|
-
<option>Disabled select</option>
|
|
355
|
-
</NativeSelect>
|
|
356
|
-
|
|
357
|
-
<NativeTextarea
|
|
358
|
-
value="Disabled textarea"
|
|
359
|
-
disabled
|
|
360
|
-
rows={3}
|
|
361
|
-
/>
|
|
362
|
-
|
|
363
|
-
<NativeTimeInput
|
|
364
|
-
value="09:00"
|
|
365
|
-
disabled
|
|
366
|
-
/>
|
|
367
|
-
|
|
368
|
-
{/* Read-only inputs */}
|
|
369
|
-
<NativeInput
|
|
370
|
-
value="Read-only input"
|
|
371
|
-
readOnly
|
|
372
|
-
/>
|
|
373
|
-
|
|
374
|
-
<NativeTimeInput
|
|
375
|
-
value="09:00"
|
|
376
|
-
readOnly
|
|
377
|
-
/>
|
|
378
|
-
|
|
379
|
-
<NativeTextarea
|
|
380
|
-
value="Read-only textarea content"
|
|
381
|
-
readOnly
|
|
382
|
-
rows={3}
|
|
383
|
-
/>
|
|
384
|
-
</div>
|
|
385
|
-
);
|
|
386
|
-
}
|
|
387
|
-
```
|
|
388
|
-
|
|
389
|
-
## Props Reference
|
|
390
|
-
|
|
391
|
-
### Common Props (All Components)
|
|
392
|
-
| Prop | Type | Required | Default | Description |
|
|
393
|
-
|------|------|----------|---------|-------------|
|
|
394
|
-
| `$isErrored` | `boolean` | - | `false` | Show error state (red border) |
|
|
395
|
-
| `value` | `string` | - | - | Input value |
|
|
396
|
-
| `onChange` | `(e: ChangeEvent) => void` | - | - | Change handler |
|
|
397
|
-
| `disabled` | `boolean` | - | `false` | Disable the input |
|
|
398
|
-
| `readOnly` | `boolean` | - | `false` | Make input read-only |
|
|
399
|
-
| `placeholder` | `string` | - | - | Placeholder text |
|
|
400
|
-
|
|
401
|
-
### NativeInput Specific Props
|
|
402
|
-
| Prop | Type | Required | Default | Description |
|
|
403
|
-
|------|------|----------|---------|-------------|
|
|
404
|
-
| `type` | `string` | - | `'text'` | Input type (text, email, password, number, etc.) |
|
|
405
|
-
| `autoComplete` | `string` | - | - | Browser autocomplete hint |
|
|
406
|
-
| `maxLength` | `number` | - | - | Maximum character length |
|
|
407
|
-
| `pattern` | `string` | - | - | Validation pattern (regex) |
|
|
408
|
-
| `min` | `string \| number` | - | - | Minimum value (for number/date inputs) |
|
|
409
|
-
| `max` | `string \| number` | - | - | Maximum value (for number/date inputs) |
|
|
410
|
-
| `step` | `string \| number` | - | - | Step value (for number inputs) |
|
|
411
|
-
|
|
412
|
-
### NativeSelect Specific Props
|
|
413
|
-
| Prop | Type | Required | Default | Description |
|
|
414
|
-
|------|------|----------|---------|-------------|
|
|
415
|
-
| `multiple` | `boolean` | - | `false` | Allow multiple selections |
|
|
416
|
-
| `size` | `number` | - | - | Number of visible options |
|
|
417
|
-
| `children` | `ReactNode` | - | - | option and optgroup elements |
|
|
418
|
-
|
|
419
|
-
### NativeTextarea Specific Props
|
|
420
|
-
| Prop | Type | Required | Default | Description |
|
|
421
|
-
|------|------|----------|---------|-------------|
|
|
422
|
-
| `$width` | `string` | - | `'100%'` | Custom width |
|
|
423
|
-
| `rows` | `number` | - | - | Number of visible rows |
|
|
424
|
-
| `cols` | `number` | - | - | Number of visible columns |
|
|
425
|
-
| `wrap` | `'soft' \| 'hard'` | - | `'soft'` | Text wrapping behavior |
|
|
426
|
-
| `resize` | `string` | - | - | CSS resize property |
|
|
427
|
-
|
|
428
|
-
### NativeTimeInput Specific Props
|
|
429
|
-
| Prop | Type | Required | Default | Description |
|
|
430
|
-
|------|------|----------|---------|-------------|
|
|
431
|
-
| `value` | `string` | - | - | Time value in HH:MM format |
|
|
432
|
-
| `onChange` | `(e: ChangeEvent) => void` | - | - | Change handler |
|
|
433
|
-
| `min` | `string` | - | - | Minimum time value |
|
|
434
|
-
| `max` | `string` | - | - | Maximum time value |
|
|
435
|
-
| `step` | `number` | - | - | Step value in seconds |
|
|
436
|
-
| `disabled` | `boolean` | - | `false` | Disable the input |
|
|
437
|
-
| `readOnly` | `boolean` | - | `false` | Make input read-only |
|
|
438
|
-
|
|
439
|
-
## AI Agent Guidelines
|
|
440
|
-
|
|
441
|
-
### ✅ Recommended Patterns
|
|
442
|
-
- Use native components as building blocks for custom form components
|
|
443
|
-
- Always handle both `value` and `onChange` for controlled components
|
|
444
|
-
- Use `$isErrored` prop consistently for validation feedback
|
|
445
|
-
- Leverage HTML5 input types for better UX (email, number, date, etc.)
|
|
446
|
-
- Provide meaningful placeholder text and labels
|
|
447
|
-
- Use proper form structure with labels and validation messages
|
|
448
|
-
- Consider accessibility with proper ARIA attributes when needed
|
|
449
|
-
|
|
450
|
-
### ❌ Common Mistakes to Avoid
|
|
451
|
-
- Don't forget the `$` prefix for styled-component props (`$isErrored`, `$width`)
|
|
452
|
-
- Don't mix controlled and uncontrolled patterns
|
|
453
|
-
- Avoid inline styles - use styled-components or CSS classes
|
|
454
|
-
- Don't skip validation feedback when using `$isErrored`
|
|
455
|
-
- Avoid putting complex logic in onChange handlers
|
|
456
|
-
- Don't forget to handle disabled states properly
|
|
457
|
-
- Avoid using these components directly in UI - prefer enhanced versions
|
|
458
|
-
|
|
459
|
-
### Integration Tips
|
|
460
|
-
- These are **base components** - typically used internally by other components
|
|
461
|
-
- All components use Pushwoosh Design System tokens for consistent styling
|
|
462
|
-
- Error states automatically change border color to red
|
|
463
|
-
- Focus states are styled with bright blue border
|
|
464
|
-
- Disabled states use frozen background color
|
|
465
|
-
- NativeSelect includes custom dropdown arrow styling
|
|
466
|
-
- Components automatically inherit font family from design system
|
|
467
|
-
- Use EnhancedInput, Select, etc. for user-facing forms instead
|
|
468
|
-
|
|
469
|
-
### Styling Notes
|
|
470
|
-
- Components use `styled-components` with design system constants
|
|
471
|
-
- Border radius uses `ShapeRadius.CONTROL` (4px for TimeInput)
|
|
472
|
-
- Colors are from Pushwoosh color palette
|
|
473
|
-
- Font sizes and line heights are from typography scale
|
|
474
|
-
- Input height is standardized using `UnitSize.FIELD_HEIGHT` (36px for NativeTimeInput)
|
|
475
|
-
- Focus outline is removed in favor of border styling
|
|
476
|
-
- NativeTimeInput hides the native calendar picker indicator for consistent styling
|
|
477
|
-
|
|
478
|
-
## Related Components
|
|
479
|
-
- **EnhancedInput** - Uses NativeInput internally with icons and clear functionality
|
|
480
|
-
- **Select** - Advanced select component built on react-select
|
|
481
|
-
- **Radio** - For single choice selections
|
|
482
|
-
- **Checkbox** - For boolean/multiple choice inputs
|
|
483
|
-
- **Switch** - For boolean toggle inputs
|
|
484
|
-
- **DateTimePicker** - For date/time selections
|
|
485
|
-
- **InputFile** - For file uploads
|