@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,340 +0,0 @@
|
|
|
1
|
-
# Tooltip - AI Documentation
|
|
2
|
-
|
|
3
|
-
> Auto-generated AI agent documentation for Tooltip component
|
|
4
|
-
> Part of @pushwoosh/dumb-components library
|
|
5
|
-
|
|
6
|
-
## Overview
|
|
7
|
-
**Component:** Tooltip, TooltipTrigger
|
|
8
|
-
**Import Path:** `import { Tooltip, TooltipTrigger } from '@pushwoosh/dumb-components'`
|
|
9
|
-
**Files:**
|
|
10
|
-
- `Tooltip/Tooltip.tsx` - Main tooltip component
|
|
11
|
-
- `Tooltip/TooltipTrigger.tsx` - Icon trigger variant
|
|
12
|
-
- `Tooltip/types.ts` - TypeScript interfaces
|
|
13
|
-
- `Tooltip/maps.ts` - Position and style mappings
|
|
14
|
-
- `Tooltip/styles.ts` - Styled components
|
|
15
|
-
**Type:** UI Component / Overlay
|
|
16
|
-
**Description:** Flexible tooltip component built on Tippy.js for displaying contextual information on hover. Supports 12 position variants, custom content, and pre-styled icon triggers with different semantic views.
|
|
17
|
-
|
|
18
|
-
## TypeScript Interfaces
|
|
19
|
-
|
|
20
|
-
### TooltipProps
|
|
21
|
-
```typescript
|
|
22
|
-
interface TooltipProps {
|
|
23
|
-
content: ReactNode; // Tooltip content
|
|
24
|
-
position?: TooltipPosition; // Placement position
|
|
25
|
-
offset?: [number, number]; // X, Y offset from trigger
|
|
26
|
-
arrowOffset?: string; // Arrow position offset
|
|
27
|
-
maxWidth?: number | 'none'; // Maximum width (default: 240)
|
|
28
|
-
zIndex?: number; // Stack order (default: 999999)
|
|
29
|
-
isDisabled?: boolean; // Disable tooltip
|
|
30
|
-
isVisible?: boolean; // Controlled visibility
|
|
31
|
-
reference?: RefObject<Element>; // Custom reference element
|
|
32
|
-
children?: ReactElement; // Trigger element
|
|
33
|
-
}
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### TooltipPosition
|
|
37
|
-
```typescript
|
|
38
|
-
type TooltipPosition =
|
|
39
|
-
| 'top-start' | 'top-middle' | 'top-end'
|
|
40
|
-
| 'right-start' | 'right-middle' | 'right-end'
|
|
41
|
-
| 'bottom-start' | 'bottom-middle' | 'bottom-end'
|
|
42
|
-
| 'left-start' | 'left-middle' | 'left-end';
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### TooltipTriggerProps
|
|
46
|
-
```typescript
|
|
47
|
-
interface TooltipTriggerProps extends TooltipProps {
|
|
48
|
-
padding?: string | number; // Icon padding
|
|
49
|
-
size?: 'small' | 'medium'; // Icon size
|
|
50
|
-
hover?: boolean; // Enable hover effect
|
|
51
|
-
view: 'question' | 'info' | 'warning' | 'error'; // Icon type
|
|
52
|
-
}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Import & Usage
|
|
56
|
-
|
|
57
|
-
### Basic Tooltip
|
|
58
|
-
```tsx
|
|
59
|
-
import { Tooltip } from '@pushwoosh/dumb-components';
|
|
60
|
-
import { Button } from '@pushwoosh/dumb-components';
|
|
61
|
-
|
|
62
|
-
function BasicExample() {
|
|
63
|
-
return (
|
|
64
|
-
<Tooltip content="This is a helpful tooltip">
|
|
65
|
-
<Button>Hover me</Button>
|
|
66
|
-
</Tooltip>
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### Tooltip with Position
|
|
72
|
-
```tsx
|
|
73
|
-
import { Tooltip } from '@pushwoosh/dumb-components';
|
|
74
|
-
|
|
75
|
-
function PositionedTooltip() {
|
|
76
|
-
return (
|
|
77
|
-
<Tooltip
|
|
78
|
-
content="Appears on the right"
|
|
79
|
-
position="right-middle"
|
|
80
|
-
>
|
|
81
|
-
<span>Hover for right tooltip</span>
|
|
82
|
-
</Tooltip>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### TooltipTrigger with Icon
|
|
88
|
-
```tsx
|
|
89
|
-
import { TooltipTrigger } from '@pushwoosh/dumb-components';
|
|
90
|
-
|
|
91
|
-
function HelpTooltip() {
|
|
92
|
-
return (
|
|
93
|
-
<TooltipTrigger
|
|
94
|
-
view="question"
|
|
95
|
-
content="Click the button to save your changes"
|
|
96
|
-
position="top-middle"
|
|
97
|
-
/>
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### Rich Content Tooltip
|
|
103
|
-
```tsx
|
|
104
|
-
import { Tooltip } from '@pushwoosh/dumb-components';
|
|
105
|
-
|
|
106
|
-
function RichTooltip() {
|
|
107
|
-
const content = (
|
|
108
|
-
<div>
|
|
109
|
-
<strong>Keyboard Shortcuts</strong>
|
|
110
|
-
<ul style={{ margin: '8px 0', paddingLeft: '20px' }}>
|
|
111
|
-
<li>Ctrl+S - Save</li>
|
|
112
|
-
<li>Ctrl+Z - Undo</li>
|
|
113
|
-
<li>Ctrl+Y - Redo</li>
|
|
114
|
-
</ul>
|
|
115
|
-
</div>
|
|
116
|
-
);
|
|
117
|
-
|
|
118
|
-
return (
|
|
119
|
-
<Tooltip content={content} maxWidth={300}>
|
|
120
|
-
<Button>Shortcuts</Button>
|
|
121
|
-
</Tooltip>
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
## Advanced Examples
|
|
127
|
-
|
|
128
|
-
### Controlled Tooltip
|
|
129
|
-
```tsx
|
|
130
|
-
import { Tooltip } from '@pushwoosh/dumb-components';
|
|
131
|
-
|
|
132
|
-
function ControlledTooltip() {
|
|
133
|
-
const [isVisible, setIsVisible] = useState(false);
|
|
134
|
-
|
|
135
|
-
return (
|
|
136
|
-
<div>
|
|
137
|
-
<Button onClick={() => setIsVisible(!isVisible)}>
|
|
138
|
-
Toggle Tooltip
|
|
139
|
-
</Button>
|
|
140
|
-
|
|
141
|
-
<Tooltip
|
|
142
|
-
content="Controlled tooltip content"
|
|
143
|
-
isVisible={isVisible}
|
|
144
|
-
>
|
|
145
|
-
<span>Target element</span>
|
|
146
|
-
</Tooltip>
|
|
147
|
-
</div>
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### Form Field with Help Icon
|
|
153
|
-
```tsx
|
|
154
|
-
import { TooltipTrigger, EnhancedInput } from '@pushwoosh/dumb-components';
|
|
155
|
-
|
|
156
|
-
function FormFieldWithHelp() {
|
|
157
|
-
return (
|
|
158
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
|
|
159
|
-
<EnhancedInput
|
|
160
|
-
placeholder="Enter email"
|
|
161
|
-
type="email"
|
|
162
|
-
/>
|
|
163
|
-
<TooltipTrigger
|
|
164
|
-
view="info"
|
|
165
|
-
content="We'll never share your email with anyone else."
|
|
166
|
-
position="right-middle"
|
|
167
|
-
size="small"
|
|
168
|
-
/>
|
|
169
|
-
</div>
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
### Warning and Error Tooltips
|
|
175
|
-
```tsx
|
|
176
|
-
import { TooltipTrigger } from '@pushwoosh/dumb-components';
|
|
177
|
-
|
|
178
|
-
function StatusTooltips() {
|
|
179
|
-
return (
|
|
180
|
-
<div style={{ display: 'flex', gap: '16px' }}>
|
|
181
|
-
<TooltipTrigger
|
|
182
|
-
view="warning"
|
|
183
|
-
content="This action may affect other users"
|
|
184
|
-
position="top-middle"
|
|
185
|
-
/>
|
|
186
|
-
|
|
187
|
-
<TooltipTrigger
|
|
188
|
-
view="error"
|
|
189
|
-
content="Invalid configuration detected"
|
|
190
|
-
position="top-middle"
|
|
191
|
-
/>
|
|
192
|
-
</div>
|
|
193
|
-
);
|
|
194
|
-
}
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
### Tooltip with Custom Trigger
|
|
198
|
-
```tsx
|
|
199
|
-
import { Tooltip } from '@pushwoosh/dumb-components';
|
|
200
|
-
import { useRef } from 'react';
|
|
201
|
-
|
|
202
|
-
function CustomTriggerTooltip() {
|
|
203
|
-
const buttonRef = useRef<HTMLButtonElement>(null);
|
|
204
|
-
const spanRef = useRef<HTMLSpanElement>(null);
|
|
205
|
-
|
|
206
|
-
return (
|
|
207
|
-
<>
|
|
208
|
-
<button ref={buttonRef}>Custom Button</button>
|
|
209
|
-
<span ref={spanRef}>Another element</span>
|
|
210
|
-
|
|
211
|
-
<Tooltip
|
|
212
|
-
content="This tooltip is attached to the button"
|
|
213
|
-
reference={buttonRef}
|
|
214
|
-
/>
|
|
215
|
-
|
|
216
|
-
<Tooltip
|
|
217
|
-
content="This one is attached to the span"
|
|
218
|
-
reference={spanRef}
|
|
219
|
-
position="bottom-middle"
|
|
220
|
-
/>
|
|
221
|
-
</>
|
|
222
|
-
);
|
|
223
|
-
}
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
### Disabled Tooltip
|
|
227
|
-
```tsx
|
|
228
|
-
import { Tooltip, Button } from '@pushwoosh/dumb-components';
|
|
229
|
-
|
|
230
|
-
function ConditionalTooltip({ isFeatureEnabled }) {
|
|
231
|
-
return (
|
|
232
|
-
<Tooltip
|
|
233
|
-
content="Premium feature - upgrade to access"
|
|
234
|
-
isDisabled={isFeatureEnabled}
|
|
235
|
-
>
|
|
236
|
-
<Button disabled={!isFeatureEnabled}>
|
|
237
|
-
Premium Feature
|
|
238
|
-
</Button>
|
|
239
|
-
</Tooltip>
|
|
240
|
-
);
|
|
241
|
-
}
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
### Long Content with Max Width
|
|
245
|
-
```tsx
|
|
246
|
-
import { Tooltip } from '@pushwoosh/dumb-components';
|
|
247
|
-
|
|
248
|
-
function LongContentTooltip() {
|
|
249
|
-
const longText = `
|
|
250
|
-
This is a very long tooltip content that demonstrates how the maxWidth
|
|
251
|
-
property works. By default, tooltips have a maxWidth of 240px, but you
|
|
252
|
-
can customize this to accommodate longer content or set it to 'none'
|
|
253
|
-
for unlimited width.
|
|
254
|
-
`;
|
|
255
|
-
|
|
256
|
-
return (
|
|
257
|
-
<div style={{ display: 'flex', gap: '20px' }}>
|
|
258
|
-
<Tooltip content={longText}>
|
|
259
|
-
<Button>Default width (240px)</Button>
|
|
260
|
-
</Tooltip>
|
|
261
|
-
|
|
262
|
-
<Tooltip content={longText} maxWidth={400}>
|
|
263
|
-
<Button>Custom width (400px)</Button>
|
|
264
|
-
</Tooltip>
|
|
265
|
-
|
|
266
|
-
<Tooltip content={longText} maxWidth="none">
|
|
267
|
-
<Button>No max width</Button>
|
|
268
|
-
</Tooltip>
|
|
269
|
-
</div>
|
|
270
|
-
);
|
|
271
|
-
}
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
## Props Reference
|
|
275
|
-
|
|
276
|
-
### Tooltip Props
|
|
277
|
-
| Prop | Type | Required | Default | Description |
|
|
278
|
-
|------|------|----------|---------|-------------|
|
|
279
|
-
| `content` | `ReactNode` | ✓ | - | Tooltip content to display |
|
|
280
|
-
| `position` | `TooltipPosition` | - | `'top-start'` | Placement relative to trigger |
|
|
281
|
-
| `offset` | `[number, number]` | - | Position-based | X, Y offset from trigger |
|
|
282
|
-
| `arrowOffset` | `string` | - | Position-based | Arrow position along edge |
|
|
283
|
-
| `maxWidth` | `number \| 'none'` | - | `240` | Maximum tooltip width in pixels |
|
|
284
|
-
| `zIndex` | `number` | - | `999999` | Stack order for overlapping elements |
|
|
285
|
-
| `isDisabled` | `boolean` | - | `false` | Disable tooltip functionality |
|
|
286
|
-
| `isVisible` | `boolean` | - | - | Control visibility programmatically |
|
|
287
|
-
| `reference` | `RefObject<Element>` | - | - | Custom reference element |
|
|
288
|
-
| `children` | `ReactElement` | - | - | Trigger element |
|
|
289
|
-
|
|
290
|
-
### TooltipTrigger Props
|
|
291
|
-
| Prop | Type | Required | Default | Description |
|
|
292
|
-
|------|------|----------|---------|-------------|
|
|
293
|
-
| `view` | `'question' \| 'info' \| 'warning' \| 'error'` | ✓ | - | Icon type and color scheme |
|
|
294
|
-
| `padding` | `string \| number` | - | `0` | Icon wrapper padding |
|
|
295
|
-
| `size` | `'small' \| 'medium'` | - | `'small'` | Icon size |
|
|
296
|
-
| `hover` | `boolean` | - | `true` | Enable hover color change |
|
|
297
|
-
| All Tooltip props | - | - | - | Inherits all Tooltip props |
|
|
298
|
-
|
|
299
|
-
### Position Values
|
|
300
|
-
- **Top:** `top-start`, `top-middle`, `top-end`
|
|
301
|
-
- **Right:** `right-start`, `right-middle`, `right-end`
|
|
302
|
-
- **Bottom:** `bottom-start`, `bottom-middle`, `bottom-end`
|
|
303
|
-
- **Left:** `left-start`, `left-middle`, `left-end`
|
|
304
|
-
|
|
305
|
-
## AI Agent Guidelines
|
|
306
|
-
|
|
307
|
-
### ✅ Recommended Patterns
|
|
308
|
-
- Use `TooltipTrigger` for form help icons with appropriate `view` type
|
|
309
|
-
- Keep tooltip content concise - use modals for lengthy information
|
|
310
|
-
- Use `position` to avoid content being cut off by viewport edges
|
|
311
|
-
- Apply `maxWidth` for longer content to improve readability
|
|
312
|
-
- Use semantic `view` types: `info` for help, `warning` for cautions, `error` for problems
|
|
313
|
-
- Disable tooltips on disabled elements to avoid confusion
|
|
314
|
-
- Use controlled mode (`isVisible`) for programmatic show/hide
|
|
315
|
-
|
|
316
|
-
### ❌ Common Mistakes to Avoid
|
|
317
|
-
- Don't nest interactive elements inside tooltip content
|
|
318
|
-
- Avoid tooltips on mobile touch devices - consider alternatives
|
|
319
|
-
- Don't use tooltips for critical information - should be supplementary
|
|
320
|
-
- Avoid very long delays or animations (component uses instant show/hide)
|
|
321
|
-
- Don't put tooltips on elements that are frequently clicked
|
|
322
|
-
- Avoid multiple tooltips visible simultaneously
|
|
323
|
-
- Don't forget accessibility - tooltip content should also be available elsewhere
|
|
324
|
-
|
|
325
|
-
### Integration Tips
|
|
326
|
-
- Built on Tippy.js with Popper.js for positioning
|
|
327
|
-
- Uses fixed positioning strategy for better performance
|
|
328
|
-
- Arrow automatically adjusts based on position
|
|
329
|
-
- Flip behavior is disabled to maintain predictable positioning
|
|
330
|
-
- TooltipTrigger uses icons from @pushwoosh/kit-icons
|
|
331
|
-
- Colors for TooltipTrigger views use Pushwoosh design tokens
|
|
332
|
-
- Works with any React element as trigger via children or reference
|
|
333
|
-
|
|
334
|
-
## Related Components
|
|
335
|
-
- **Popover** - For interactive content and forms
|
|
336
|
-
- **Modal** - For detailed information and actions
|
|
337
|
-
- **Toast** - For temporary notifications
|
|
338
|
-
- **Button** - Common tooltip trigger
|
|
339
|
-
- **EnhancedInput** - Often paired with help tooltips
|
|
340
|
-
- **Badge** - Alternative for persistent indicators
|
package/ai-documentation.md
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
# @pushwoosh/dumb-components - AI Agent Documentation Index
|
|
2
|
-
|
|
3
|
-
> Comprehensive AI documentation for @pushwoosh/dumb-components React TypeScript component library
|
|
4
|
-
> Auto-generated on December 13, 2024
|
|
5
|
-
|
|
6
|
-
## Quick Start
|
|
7
|
-
|
|
8
|
-
```typescript
|
|
9
|
-
// Install
|
|
10
|
-
npm install @pushwoosh/dumb-components
|
|
11
|
-
|
|
12
|
-
// Main imports
|
|
13
|
-
import {
|
|
14
|
-
Alert, Badge, Button, Checkbox, Chip
|
|
15
|
-
} from '@pushwoosh/dumb-components';
|
|
16
|
-
|
|
17
|
-
// Hook imports (when available)
|
|
18
|
-
import { useElementWidth, useOnClickOutside } from '@pushwoosh/dumb-components/hooks';
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## 📦 Components
|
|
22
|
-
|
|
23
|
-
### Form Components
|
|
24
|
-
| Component | Description | Documentation |
|
|
25
|
-
|-----------|-------------|---------------|
|
|
26
|
-
| [Button](./Button/ai-documentation.md) | Interactive buttons with loading states and variants | 📖 |
|
|
27
|
-
| [Checkbox](./Checkbox/ai-documentation.md) | Checkbox input with label and tooltip support | 📖 |
|
|
28
|
-
| [EnhancedInput](./EnhancedInput/ai-documentation.md) | Enhanced text input with icons and clear functionality | 📖 |
|
|
29
|
-
| [InputFile](./InputFile/ai-documentation.md) | File upload component with validation and drag-drop | 📖 |
|
|
30
|
-
| [Radio](./Radio/ai-documentation.md) | Radio button component for single choice selection | 📖 |
|
|
31
|
-
| [Select](./Select/ai-documentation.md) | Advanced select with async and creatable variants | 📖 |
|
|
32
|
-
| [Switch](./Switch/ai-documentation.md) | Toggle switch for boolean state changes | 📖 |
|
|
33
|
-
|
|
34
|
-
### UI Components
|
|
35
|
-
| Component | Description | Documentation |
|
|
36
|
-
|-----------|-------------|---------------|
|
|
37
|
-
| [Alert](./Alert/ai-documentation.md) | Alert messages with optional collapsible content | 📖 |
|
|
38
|
-
| [Badge](./Badge/ai-documentation.md) | Status badges and indicators with color variants | 📖 |
|
|
39
|
-
| [Chip](./Chip/ai-documentation.md) | Interactive tags and filters with remove functionality | 📖 |
|
|
40
|
-
| [Popover](./Popover/ai-documentation.md) | Floating overlay component with positioning | 📖 |
|
|
41
|
-
| [ProgressBar](./ProgressBar/ai-documentation.md) | Progress indicator with customizable styling | 📖 |
|
|
42
|
-
| [Skeleton](./Skeleton/ai-documentation.md) | Loading placeholder components | 📖 |
|
|
43
|
-
| [Spinner](./Spinner/ai-documentation.md) | Loading indicator in multiple sizes | 📖 |
|
|
44
|
-
| [Toast](./Toast/ai-documentation.md) | Notification system with provider pattern | 📖 |
|
|
45
|
-
| [Tooltip](./Tooltip/ai-documentation.md) | Contextual tooltips with multiple positions | 📖 |
|
|
46
|
-
|
|
47
|
-
### Layout Components
|
|
48
|
-
| Component | Description | Documentation |
|
|
49
|
-
|-----------|-------------|---------------|
|
|
50
|
-
| [Modal](./Modal/ai-documentation.md) | Modal dialogs with size variants and confirmations | 📖 |
|
|
51
|
-
| [PageHeader](./PageHeader/ai-documentation.md) | Page-level header with navigation and actions | 📖 |
|
|
52
|
-
| [Pagination](./Pagination/ai-documentation.md) | Navigation component for multi-page content | 📖 |
|
|
53
|
-
| [Tabs](./Tabs/ai-documentation.md) | Tabbed interface with multiple tab variants | 📖 |
|
|
54
|
-
|
|
55
|
-
### Base Components
|
|
56
|
-
| Component | Description | Documentation |
|
|
57
|
-
|-----------|-------------|---------------|
|
|
58
|
-
| [Native](./native/ai-documentation.md) | Styled native HTML elements (Input, Select, Textarea, NativeTimeInput) | 📖 |
|
|
59
|
-
|
|
60
|
-
## 🤖 AI Agent Quick Reference
|
|
61
|
-
|
|
62
|
-
### Common Patterns
|
|
63
|
-
|
|
64
|
-
```tsx
|
|
65
|
-
// Alert for user feedback
|
|
66
|
-
<Alert
|
|
67
|
-
title="Success!"
|
|
68
|
-
type="info"
|
|
69
|
-
>
|
|
70
|
-
Your changes have been saved.
|
|
71
|
-
</Alert>
|
|
72
|
-
|
|
73
|
-
// Form with validation
|
|
74
|
-
<form onSubmit={handleSubmit}>
|
|
75
|
-
<Checkbox
|
|
76
|
-
label="I agree to the terms"
|
|
77
|
-
isChecked={agreed}
|
|
78
|
-
type={showErrors && !agreed ? 'error' : 'normal'}
|
|
79
|
-
onChange={setAgreed}
|
|
80
|
-
/>
|
|
81
|
-
<Button
|
|
82
|
-
type="submit"
|
|
83
|
-
color="primary"
|
|
84
|
-
isLoading={isSubmitting}
|
|
85
|
-
isDisabled={!agreed}
|
|
86
|
-
>
|
|
87
|
-
{isSubmitting ? 'Submitting...' : 'Submit'}
|
|
88
|
-
</Button>
|
|
89
|
-
</form>
|
|
90
|
-
|
|
91
|
-
// Status indicators
|
|
92
|
-
<div>
|
|
93
|
-
<Badge color="green">Active</Badge>
|
|
94
|
-
<Badge color="orange">Pending</Badge>
|
|
95
|
-
<Badge color="red">Error</Badge>
|
|
96
|
-
</div>
|
|
97
|
-
|
|
98
|
-
// Tag management
|
|
99
|
-
{tags.map(tag => (
|
|
100
|
-
<Chip
|
|
101
|
-
key={tag}
|
|
102
|
-
$onClose={() => removeTag(tag)}
|
|
103
|
-
>
|
|
104
|
-
{tag}
|
|
105
|
-
</Chip>
|
|
106
|
-
))}
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### Global Guidelines for AI Agents
|
|
110
|
-
|
|
111
|
-
1. **Always handle loading and error states** - use Button loading states, Alert for errors
|
|
112
|
-
2. **Use semantic colors** - green for success, red for errors/danger, orange for warnings
|
|
113
|
-
3. **Include proper TypeScript types** - all components have full TypeScript definitions
|
|
114
|
-
4. **Handle form validation** - use error states and clear feedback
|
|
115
|
-
5. **Follow accessibility best practices** - components include proper ARIA and keyboard support
|
|
116
|
-
|
|
117
|
-
### Color Consistency Guide
|
|
118
|
-
|
|
119
|
-
| Color | Button | Badge | Alert | Usage |
|
|
120
|
-
|-------|--------|-------|-------|--------|
|
|
121
|
-
| Primary/Green | `color="primary"` | `color="green"` | `type="info"` | Success, main actions |
|
|
122
|
-
| Secondary/Gray | `color="secondary"` | `color="gray"` | - | Secondary actions, neutral |
|
|
123
|
-
| Danger/Red | `color="danger"` | `color="red"` | `type="error"` | Errors, destructive actions |
|
|
124
|
-
| Warning/Orange | - | `color="orange"` | `type="warning"` | Warnings, cautions |
|