@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,27 +1,32 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
import { Color } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { Vertical } from '@pushwoosh/kit-helpers';
|
|
4
|
+
/** Top section of a {@link Modal}; typically wraps a {@link ModalTitle}. */
|
|
4
5
|
export const ModalHeader = styled.div.withConfig({
|
|
5
6
|
displayName: "ModalHeader",
|
|
6
7
|
componentId: "sc-1b5r517-0"
|
|
7
8
|
})(["padding:24px 24px 8px;background-color:", ";"], Color.CLEAR);
|
|
8
9
|
ModalHeader.displayName = 'ModalHeader';
|
|
10
|
+
/** Groups {@link ModalBodyItem}s with hairline dividers between them, inside a {@link ModalBody}. */
|
|
9
11
|
export const ModalBodyGroup = styled(Vertical).withConfig({
|
|
10
12
|
displayName: "ModalBodyGroup",
|
|
11
13
|
componentId: "sc-1b5r517-1"
|
|
12
14
|
})(["background-color:", ";gap:1px;"], Color.DIVIDER);
|
|
13
15
|
ModalBodyGroup.displayName = 'ModalBodyGroup';
|
|
16
|
+
/** A single row within a {@link ModalBodyGroup}; pass `$vPadding` to add vertical padding. */
|
|
14
17
|
export const ModalBodyItem = styled.div.withConfig({
|
|
15
18
|
displayName: "ModalBodyItem",
|
|
16
19
|
componentId: "sc-1b5r517-2"
|
|
17
20
|
})(["padding:", " 24px;background-color:", ";"], ({
|
|
18
21
|
$vPadding
|
|
19
22
|
}) => $vPadding ? '24px' : 0, Color.CLEAR);
|
|
23
|
+
/** Scrollable main content area of a {@link Modal}; self-pads unless it holds a {@link ModalBodyGroup}. */
|
|
20
24
|
export const ModalBody = styled.div.withConfig({
|
|
21
25
|
displayName: "ModalBody",
|
|
22
26
|
componentId: "sc-1b5r517-3"
|
|
23
27
|
})(["background-color:", ";overflow-y:auto;&:not(:has(> ", ")){padding:24px;&:not(:first-child){padding-top:0;}}"], Color.CLEAR, ModalBodyGroup);
|
|
24
28
|
ModalBody.displayName = 'ModalBody';
|
|
29
|
+
/** Bottom action bar of a {@link Modal}, divided from the body; typically holds buttons. */
|
|
25
30
|
export const ModalFooter = styled.div.withConfig({
|
|
26
31
|
displayName: "ModalFooter",
|
|
27
32
|
componentId: "sc-1b5r517-4"
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { ModalTitleProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Modal heading row with an optional close button; place inside {@link ModalHeader}.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* <ModalTitle onClose={close}>Edit settings</ModalTitle>
|
|
8
|
+
*/
|
|
3
9
|
export declare function ModalTitle(props: ModalTitleProps): ReactElement;
|
|
@@ -2,6 +2,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { CloseIcon } from '@pushwoosh/kit-icons';
|
|
3
3
|
import { ModalTitleBox } from './styles';
|
|
4
4
|
import { GhostButton } from '../../../Button';
|
|
5
|
+
/**
|
|
6
|
+
* Modal heading row with an optional close button; place inside {@link ModalHeader}.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* <ModalTitle onClose={close}>Edit settings</ModalTitle>
|
|
10
|
+
*/
|
|
5
11
|
export function ModalTitle(props) {
|
|
6
12
|
const {
|
|
7
13
|
children,
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
/** Props of {@link ModalTitle}. */
|
|
2
3
|
export interface ModalTitleProps {
|
|
4
|
+
/** When set, renders a close (✕) button that calls this. */
|
|
3
5
|
readonly onClose?: () => void;
|
|
6
|
+
/** Title content. */
|
|
4
7
|
readonly children: ReactNode;
|
|
5
8
|
}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { NotificationBarProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Wide notification trigger with an icon, label and count badge — an alternative to
|
|
5
|
+
* {@link NotificationBell} for opening the {@link NotificationInbox}.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <NotificationBar type="important" count={3} onClick={toggleInbox} />
|
|
9
|
+
*/
|
|
3
10
|
export declare function NotificationBar({ type, isOpened, read, count, onClick, }: NotificationBarProps): ReactElement;
|
|
@@ -8,6 +8,13 @@ function getIconView(isOpened, filled, hasNotifications) {
|
|
|
8
8
|
if (filled) return 'filled';
|
|
9
9
|
return 'lined';
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Wide notification trigger with an icon, label and count badge — an alternative to
|
|
13
|
+
* {@link NotificationBell} for opening the {@link NotificationInbox}.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* <NotificationBar type="important" count={3} onClick={toggleInbox} />
|
|
17
|
+
*/
|
|
11
18
|
export function NotificationBar({
|
|
12
19
|
type = 'notifications',
|
|
13
20
|
isOpened = false,
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { NotificationBellProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Bell icon with an unread-count badge (colored by severity) for opening the
|
|
5
|
+
* {@link NotificationInbox}.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <NotificationBell count={5} severity="critical" onClick={toggleInbox} />
|
|
9
|
+
*/
|
|
3
10
|
export declare function NotificationBell({ count, severity, isOpened, onClick, }: NotificationBellProps): ReactElement;
|
|
@@ -3,6 +3,13 @@ import { Color } from '@pushwoosh/kit-constants';
|
|
|
3
3
|
import { NotificationIcon } from '@pushwoosh/kit-icons';
|
|
4
4
|
import { useLang } from './polyglot';
|
|
5
5
|
import { NotificationBellButton, NotificationBellBadge, NotificationBellBadgeDot } from './styles';
|
|
6
|
+
/**
|
|
7
|
+
* Bell icon with an unread-count badge (colored by severity) for opening the
|
|
8
|
+
* {@link NotificationInbox}.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* <NotificationBell count={5} severity="critical" onClick={toggleInbox} />
|
|
12
|
+
*/
|
|
6
13
|
export function NotificationBell({
|
|
7
14
|
count = 0,
|
|
8
15
|
severity,
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { NotificationInboxProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Scrollable notification list with severity indicators, read state, per-item
|
|
5
|
+
* actions, infinite scroll and an empty state.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <NotificationInbox notifications={items} hasMore={hasMore} onLoadMore={loadMore} onNotificationClick={open} />
|
|
9
|
+
*/
|
|
3
10
|
export declare function NotificationInbox({ notifications, isLoading, hasMore, onLoadMore, onNotificationClick, onMarkAsRead, emptyStateTitle, emptyStateDescription, }: NotificationInboxProps): ReactElement;
|
|
@@ -11,6 +11,13 @@ import { Spinner } from '../Spinner';
|
|
|
11
11
|
import emptyNotificationsIcon from './assets/EmptyNotifications.svg?url';
|
|
12
12
|
import { Lang } from './polyglot';
|
|
13
13
|
import { NotificationInboxContainer, NotificationInboxHeader, NotificationInboxTitle, NotificationInboxList, NotificationItem, NotificationIndicator, NotificationHeader, NotificationDescription, NotificationActionLink, NotificationInboxEmptyIcon, NotificationInboxEmptyText } from './styles';
|
|
14
|
+
/**
|
|
15
|
+
* Scrollable notification list with severity indicators, read state, per-item
|
|
16
|
+
* actions, infinite scroll and an empty state.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* <NotificationInbox notifications={items} hasMore={hasMore} onLoadMore={loadMore} onNotificationClick={open} />
|
|
20
|
+
*/
|
|
14
21
|
export function NotificationInbox({
|
|
15
22
|
notifications,
|
|
16
23
|
isLoading = false,
|
|
@@ -1,38 +1,69 @@
|
|
|
1
|
+
/** Severity of a {@link Notification}, driving its indicator color. */
|
|
1
2
|
export type NotificationSeverity = 'critical' | 'warning' | 'info';
|
|
3
|
+
/** A single notification item shown in {@link NotificationInbox}. */
|
|
2
4
|
export interface Notification {
|
|
5
|
+
/** Unique id. */
|
|
3
6
|
readonly id: string;
|
|
7
|
+
/** Notification title. */
|
|
4
8
|
readonly title: string;
|
|
9
|
+
/** Optional body text. */
|
|
5
10
|
readonly description?: string;
|
|
11
|
+
/** Severity level. */
|
|
6
12
|
readonly severity: NotificationSeverity;
|
|
13
|
+
/** Creation time (Date or ISO string). */
|
|
7
14
|
readonly timestamp: string | Date;
|
|
15
|
+
/** Whether the user has read it. */
|
|
8
16
|
readonly isRead?: boolean;
|
|
17
|
+
/** Originating project name, if any. */
|
|
9
18
|
readonly projectName?: string;
|
|
19
|
+
/** Optional inline action. */
|
|
10
20
|
readonly actionButton?: {
|
|
11
21
|
readonly label: string;
|
|
12
22
|
readonly onClick: () => void;
|
|
13
23
|
};
|
|
14
24
|
}
|
|
25
|
+
/** Props of {@link NotificationInbox}. */
|
|
15
26
|
export interface NotificationInboxProps {
|
|
27
|
+
/** Notifications to display (newest first). */
|
|
16
28
|
readonly notifications: Notification[];
|
|
29
|
+
/** Show the loading state (e.g. while fetching more). */
|
|
17
30
|
readonly isLoading?: boolean;
|
|
31
|
+
/** Whether more pages are available for infinite scroll. */
|
|
18
32
|
readonly hasMore?: boolean;
|
|
33
|
+
/** Fires when the list is scrolled near the end. */
|
|
19
34
|
readonly onLoadMore?: () => void;
|
|
35
|
+
/** Fires when a notification is clicked. */
|
|
20
36
|
readonly onNotificationClick?: (notification: Notification) => void;
|
|
37
|
+
/** Fires to mark a notification as read. */
|
|
21
38
|
readonly onMarkAsRead?: (notificationId: string) => void;
|
|
39
|
+
/** Title shown when there are no notifications. */
|
|
22
40
|
readonly emptyStateTitle?: string;
|
|
41
|
+
/** Description shown when there are no notifications. */
|
|
23
42
|
readonly emptyStateDescription?: string;
|
|
24
43
|
}
|
|
44
|
+
/** Visual state of a {@link NotificationBar}. */
|
|
25
45
|
export type NotificationBarType = 'important' | 'warning' | 'notifications' | 'no-notifications';
|
|
46
|
+
/** Props of {@link NotificationBar}. */
|
|
26
47
|
export interface NotificationBarProps {
|
|
48
|
+
/** Visual state (severity/empty). */
|
|
27
49
|
readonly type?: NotificationBarType;
|
|
50
|
+
/** Whether the linked inbox is open. */
|
|
28
51
|
readonly isOpened?: boolean;
|
|
52
|
+
/** Whether all notifications are read. */
|
|
29
53
|
readonly read?: boolean;
|
|
54
|
+
/** Unread count shown in the badge. */
|
|
30
55
|
readonly count?: number;
|
|
56
|
+
/** Fires when the bar is clicked. */
|
|
31
57
|
readonly onClick?: () => void;
|
|
32
58
|
}
|
|
59
|
+
/** Props of {@link NotificationBell}. */
|
|
33
60
|
export interface NotificationBellProps {
|
|
61
|
+
/** Unread count shown in the badge. */
|
|
34
62
|
readonly count?: number;
|
|
63
|
+
/** Highest severity among unread, driving the badge color. */
|
|
35
64
|
readonly severity?: NotificationSeverity;
|
|
65
|
+
/** Whether the linked inbox is open. */
|
|
36
66
|
readonly isOpened?: boolean;
|
|
67
|
+
/** Fires when the bell is clicked. */
|
|
37
68
|
readonly onClick?: () => void;
|
|
38
69
|
}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { NumberPickerProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Integer input with up/down steppers (click or hold to repeat), arrow-key support,
|
|
5
|
+
* min/max clamping and an optional inline hint.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <NumberPicker value={count} minValue={0} maxValue={10} onChange={setCount} />
|
|
9
|
+
*/
|
|
3
10
|
export declare function NumberPicker({ value, hint, step, placeholder, focusOnMount, minValue, maxValue, autoSize, isDisabled, onChange, onSubmit, }: NumberPickerProps): ReactElement;
|
|
@@ -5,6 +5,13 @@ import { ChevronIcon } from '@pushwoosh/kit-icons';
|
|
|
5
5
|
import { AutosizeInput } from './components/AutosizeInput';
|
|
6
6
|
import { intVal, isStringInteger } from './helpers';
|
|
7
7
|
import { Hint, SingleInputFrame, InputStyled } from './styles';
|
|
8
|
+
/**
|
|
9
|
+
* Integer input with up/down steppers (click or hold to repeat), arrow-key support,
|
|
10
|
+
* min/max clamping and an optional inline hint.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <NumberPicker value={count} minValue={0} maxValue={10} onChange={setCount} />
|
|
14
|
+
*/
|
|
8
15
|
export function NumberPicker({
|
|
9
16
|
value,
|
|
10
17
|
hint,
|
package/NumberPicker/types.d.ts
CHANGED
|
@@ -1,13 +1,25 @@
|
|
|
1
|
+
/** Props of {@link NumberPicker}. */
|
|
1
2
|
export interface NumberPickerProps {
|
|
3
|
+
/** Current numeric value (controlled); `undefined` renders an empty field. */
|
|
2
4
|
value: number | undefined;
|
|
5
|
+
/** Trailing hint text shown inside the field (e.g. a unit). */
|
|
3
6
|
hint?: string;
|
|
7
|
+
/** Increment/decrement applied by the chevrons (default `1`). */
|
|
4
8
|
step?: number;
|
|
9
|
+
/** Placeholder shown when the field is empty. */
|
|
5
10
|
placeholder?: string;
|
|
11
|
+
/** Focus the input on mount. */
|
|
6
12
|
focusOnMount?: boolean;
|
|
13
|
+
/** Lower bound; values are clamped to it on blur. */
|
|
7
14
|
minValue?: number;
|
|
15
|
+
/** Upper bound; values are clamped to it on blur. */
|
|
8
16
|
maxValue?: number;
|
|
17
|
+
/** Size the field to its content instead of a fixed width. */
|
|
9
18
|
autoSize?: boolean;
|
|
19
|
+
/** Disable the field and the steppers. */
|
|
10
20
|
isDisabled?: boolean;
|
|
21
|
+
/** Fires with the new number on valid input, stepper use or blur-clamp. */
|
|
11
22
|
onChange: (value: number) => void;
|
|
23
|
+
/** Fires on Enter when the current value is a valid integer. */
|
|
12
24
|
onSubmit?: () => void;
|
|
13
25
|
}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { AutosizeInputProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Inline text input that grows to fit its content, with an edit affordance; commits
|
|
5
|
+
* on blur/Enter and reverts on Escape. Used for editable page titles.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <AutosizeInput value={name} onChange={setName} onComplete={save} />
|
|
9
|
+
*/
|
|
3
10
|
export declare function AutosizeInput(props: AutosizeInputProps): ReactElement;
|
|
@@ -3,6 +3,13 @@ import { useEffect, useRef, useState } from 'react';
|
|
|
3
3
|
import { EditIcon } from '@pushwoosh/kit-icons';
|
|
4
4
|
import { DEFAULT_EMPTY_VALUE, WIDTH_EMPTY_VALUE } from './constants';
|
|
5
5
|
import { RootBox, InputBox, InputStyled, PromptBox } from './styles';
|
|
6
|
+
/**
|
|
7
|
+
* Inline text input that grows to fit its content, with an edit affordance; commits
|
|
8
|
+
* on blur/Enter and reverts on Escape. Used for editable page titles.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* <AutosizeInput value={name} onChange={setName} onComplete={save} />
|
|
12
|
+
*/
|
|
6
13
|
export function AutosizeInput(props) {
|
|
7
14
|
const {
|
|
8
15
|
placeholder,
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
+
/** Props of {@link AutosizeInput}. */
|
|
1
2
|
export interface AutosizeInputProps {
|
|
3
|
+
/** Current value (controlled). */
|
|
2
4
|
value: string;
|
|
5
|
+
/** Placeholder shown when empty. */
|
|
3
6
|
placeholder?: string | undefined;
|
|
7
|
+
/** Maximum number of characters. */
|
|
4
8
|
maxLength?: number | undefined;
|
|
9
|
+
/** Fires on every edit with the new value. */
|
|
5
10
|
onChange?: ((value: string) => void) | undefined;
|
|
11
|
+
/** Fires after editing finishes (blur, or Enter). */
|
|
6
12
|
onComplete?: ((value: string) => void) | undefined;
|
|
7
13
|
}
|
|
14
|
+
/** Internal style prop carrying the computed input width. */
|
|
8
15
|
export interface InputStyledProps {
|
|
9
16
|
width: number;
|
|
10
17
|
}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { PageHeaderProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Page-level header with a title, optional back arrow, description, inline error bar
|
|
5
|
+
* and submit/cancel/extra actions.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <PageHeader title="Campaign" onBack={goBack} onSubmit={save} onCancel={discard} />
|
|
9
|
+
*/
|
|
3
10
|
export declare function PageHeader(props: PageHeaderProps): ReactElement;
|
|
@@ -5,6 +5,13 @@ import { H1 } from '@pushwoosh/kit-typography';
|
|
|
5
5
|
import { Button } from '../../../Button';
|
|
6
6
|
import { PageHeaderError } from '../PageHeaderError';
|
|
7
7
|
import { RootBox, BackButton, TitleBox, DescriptionBox, ActionsBox, MoreActionsBox } from './styles';
|
|
8
|
+
/**
|
|
9
|
+
* Page-level header with a title, optional back arrow, description, inline error bar
|
|
10
|
+
* and submit/cancel/extra actions.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <PageHeader title="Campaign" onBack={goBack} onSubmit={save} onCancel={discard} />
|
|
14
|
+
*/
|
|
8
15
|
export function PageHeader(props) {
|
|
9
16
|
const {
|
|
10
17
|
title,
|
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
/** Props of {@link PageHeader}. */
|
|
2
3
|
export interface PageHeaderProps {
|
|
4
|
+
/** Page title. */
|
|
3
5
|
title: ReactNode;
|
|
6
|
+
/** Subtitle/description under the title. */
|
|
4
7
|
description?: ReactNode | string;
|
|
8
|
+
/** Error message shown in an inline error bar. */
|
|
5
9
|
error?: string;
|
|
10
|
+
/** Caption for the error-resolve action. */
|
|
6
11
|
resolveErrorText?: string;
|
|
12
|
+
/** Submit button caption (default "Create"). */
|
|
7
13
|
submitText?: string;
|
|
14
|
+
/** Cancel button caption (default "Cancel"). */
|
|
8
15
|
cancelText?: string;
|
|
16
|
+
/** Show the loading state on the submit button. */
|
|
9
17
|
isLoadingSubmit?: boolean;
|
|
18
|
+
/** Extra actions rendered before the submit/cancel buttons. */
|
|
10
19
|
moreActions?: ReactElement;
|
|
20
|
+
/** When set, renders a back arrow that calls this. */
|
|
11
21
|
onBack?: () => void;
|
|
22
|
+
/** When set, renders a submit button that calls this. */
|
|
12
23
|
onSubmit?: (params?: any) => void;
|
|
24
|
+
/** When set, renders a cancel button that calls this. */
|
|
13
25
|
onCancel?: () => void;
|
|
26
|
+
/** Fires when the error-resolve action is clicked. */
|
|
14
27
|
onResolveError?: () => void;
|
|
15
28
|
}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { PageHeaderEditableProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* {@link PageHeader} variant whose title is inline-editable via {@link AutosizeInput};
|
|
5
|
+
* shows a skeleton while `isLoading`.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <PageHeaderEditable title="Name:" value={name} onChange={setName} onSubmit={save} />
|
|
9
|
+
*/
|
|
3
10
|
export declare function PageHeaderEditable(props: PageHeaderEditableProps): ReactElement;
|
|
@@ -6,6 +6,13 @@ import { AutosizeInput } from '../AutosizeInput';
|
|
|
6
6
|
import { PageHeaderError } from '../PageHeaderError';
|
|
7
7
|
import { PageHeaderSkeleton } from '../PageHeaderSkeleton';
|
|
8
8
|
import { RootBox, BackButton, TitleBox, DescriptionBox, AutosizeInputBox, ActionsBox, MoreActionsBox } from './styles';
|
|
9
|
+
/**
|
|
10
|
+
* {@link PageHeader} variant whose title is inline-editable via {@link AutosizeInput};
|
|
11
|
+
* shows a skeleton while `isLoading`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <PageHeaderEditable title="Name:" value={name} onChange={setName} onSubmit={save} />
|
|
15
|
+
*/
|
|
9
16
|
export function PageHeaderEditable(props) {
|
|
10
17
|
const {
|
|
11
18
|
title,
|
|
@@ -1,21 +1,40 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
|
+
/** Props of {@link PageHeaderEditable}. */
|
|
2
3
|
export interface PageHeaderEditableProps {
|
|
4
|
+
/** Static text shown before the editable field. */
|
|
3
5
|
title: string;
|
|
6
|
+
/** Subtitle/description under the title. */
|
|
4
7
|
description?: string;
|
|
8
|
+
/** Error message shown in an inline error bar. */
|
|
5
9
|
error?: string;
|
|
10
|
+
/** Caption for the error-resolve action. */
|
|
6
11
|
resolveErrorText?: string;
|
|
12
|
+
/** Editable value; when set, renders the {@link AutosizeInput}. */
|
|
7
13
|
value?: string;
|
|
14
|
+
/** Maximum length of the editable value. */
|
|
8
15
|
maxLength?: number;
|
|
16
|
+
/** Placeholder for the editable field. */
|
|
9
17
|
placeholder?: string;
|
|
18
|
+
/** Submit button caption (default "Create"). */
|
|
10
19
|
submitText?: string;
|
|
20
|
+
/** Cancel button caption (default "Cancel"). */
|
|
11
21
|
cancelText?: string;
|
|
22
|
+
/** Show the whole header as a skeleton. */
|
|
12
23
|
isLoading?: boolean;
|
|
24
|
+
/** Show the loading state on the submit button. */
|
|
13
25
|
isLoadingSubmit?: boolean;
|
|
26
|
+
/** Extra actions rendered before the submit/cancel buttons. */
|
|
14
27
|
moreActions?: ReactElement;
|
|
28
|
+
/** When set, renders a back arrow that calls this. */
|
|
15
29
|
onBack?: () => void;
|
|
30
|
+
/** Fires on every edit of the value. */
|
|
16
31
|
onChange?: (value: string) => void;
|
|
32
|
+
/** Fires after editing finishes (blur/Enter). */
|
|
17
33
|
onComplete?: (value: string) => void;
|
|
34
|
+
/** When set, renders a submit button; called with the current value. */
|
|
18
35
|
onSubmit?: (value: string) => void;
|
|
36
|
+
/** When set, renders a cancel button that calls this. */
|
|
19
37
|
onCancel?: () => void;
|
|
38
|
+
/** Fires when the error-resolve action is clicked. */
|
|
20
39
|
onResolveError?: () => void;
|
|
21
40
|
}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { PaginationProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Page navigation with prev/next arrows, first/last shortcuts and adjacent page
|
|
5
|
+
* buttons around the active page. Renders `null` if `activePage` is out of range.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <Pagination activePage={page} totalPages={20} onChangePage={setPage} />
|
|
9
|
+
*/
|
|
3
10
|
export declare function Pagination({ boxRef, activePage, totalPages, adjacentPagesCount, isLoading, onChangePage, ...rest }: PaginationProps): ReactElement | null;
|
package/Pagination/Pagination.js
CHANGED
|
@@ -3,6 +3,13 @@ import { useCallback } from 'react';
|
|
|
3
3
|
import { ArrowIcon } from '@pushwoosh/kit-icons';
|
|
4
4
|
import { getSafelyNumber } from './helpers';
|
|
5
5
|
import { PaginationBox, PaginationArrow, PaginationDivider, PaginationButton } from './styles';
|
|
6
|
+
/**
|
|
7
|
+
* Page navigation with prev/next arrows, first/last shortcuts and adjacent page
|
|
8
|
+
* buttons around the active page. Renders `null` if `activePage` is out of range.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* <Pagination activePage={page} totalPages={20} onChangePage={setPage} />
|
|
12
|
+
*/
|
|
6
13
|
export function Pagination({
|
|
7
14
|
boxRef,
|
|
8
15
|
activePage,
|
package/Pagination/types.d.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import type { Ref } from 'react';
|
|
2
|
+
/** Props of {@link Pagination} — all `<div>` attributes plus the pagination-specific ones. */
|
|
2
3
|
export type PaginationProps = Omit<JSX.IntrinsicElements['div'], 'ref'> & {
|
|
4
|
+
/** Ref to the container `<div>`. */
|
|
3
5
|
readonly boxRef?: Ref<HTMLDivElement>;
|
|
6
|
+
/** Current page (1-based). */
|
|
4
7
|
readonly activePage: string | number;
|
|
8
|
+
/** Total number of pages. */
|
|
5
9
|
readonly totalPages: string | number;
|
|
10
|
+
/** How many page buttons to show on each side of the active page (default `2`). */
|
|
6
11
|
readonly adjacentPagesCount?: number;
|
|
12
|
+
/** Disable all controls while loading. */
|
|
7
13
|
readonly isLoading?: boolean;
|
|
14
|
+
/** Fires with the target page number when a control is clicked. */
|
|
8
15
|
readonly onChangePage: (page: number) => any;
|
|
9
16
|
};
|
package/Popover/Popover.d.ts
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { PopoverProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Floating window anchored to `anchorEl`, with placement, width, loading state and
|
|
5
|
+
* a controlled `open` flag. Wrap the anchor in `PopoverContainer` for positioning.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <PopoverContainer>
|
|
9
|
+
* <button ref={anchorEl}>Open</button>
|
|
10
|
+
* <Popover open={open} anchorEl={anchorEl}>Content</Popover>
|
|
11
|
+
* </PopoverContainer>
|
|
12
|
+
*/
|
|
3
13
|
export declare function Popover({ open, anchorEl, internalWindowRef, loading, position, zIndex, windowWidth, children, }: PopoverProps): ReactElement;
|
package/Popover/Popover.js
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { PopoverContainerPortal, PopoverContainerWindow } from './styles';
|
|
3
|
+
/**
|
|
4
|
+
* Floating window anchored to `anchorEl`, with placement, width, loading state and
|
|
5
|
+
* a controlled `open` flag. Wrap the anchor in `PopoverContainer` for positioning.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <PopoverContainer>
|
|
9
|
+
* <button ref={anchorEl}>Open</button>
|
|
10
|
+
* <Popover open={open} anchorEl={anchorEl}>Content</Popover>
|
|
11
|
+
* </PopoverContainer>
|
|
12
|
+
*/
|
|
3
13
|
export function Popover({
|
|
4
14
|
open,
|
|
5
15
|
anchorEl,
|
package/Popover/styles.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** Relative-positioned wrapper for a {@link Popover} and its anchor element. */
|
|
1
2
|
export declare const PopoverContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
3
|
export declare const PopoverContainerWindow: import("styled-components").StyledComponent<"div", any, {
|
|
3
4
|
$minWidth?: number | null;
|
package/Popover/styles.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Tippy from '@tippyjs/react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { Color, ShapeRadius } from '@pushwoosh/kit-constants';
|
|
4
|
+
/** Relative-positioned wrapper for a {@link Popover} and its anchor element. */
|
|
4
5
|
export const PopoverContainer = styled.div.withConfig({
|
|
5
6
|
displayName: "PopoverContainer",
|
|
6
7
|
componentId: "sc-qsqk3z-0"
|
package/Popover/types.d.ts
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import type { RefObject, ReactNode } from 'react';
|
|
2
2
|
import type { Placement } from 'tippy.js';
|
|
3
|
+
/** Props of {@link Popover}. */
|
|
3
4
|
export interface PopoverProps {
|
|
5
|
+
/** Ref to the element the popover anchors to. */
|
|
4
6
|
readonly anchorEl: RefObject<HTMLElement>;
|
|
7
|
+
/** Ref to the popover window, e.g. for click-outside detection. */
|
|
5
8
|
readonly internalWindowRef?: RefObject<HTMLDivElement> | null;
|
|
9
|
+
/** Placement relative to the anchor (default `right-start`). */
|
|
6
10
|
readonly position?: Placement;
|
|
11
|
+
/** Whether the popover is open. */
|
|
7
12
|
readonly open: boolean;
|
|
13
|
+
/** Show the loading state inside the window. */
|
|
8
14
|
readonly loading?: boolean;
|
|
15
|
+
/** Stacking z-index (default `1000`). */
|
|
9
16
|
readonly zIndex?: number;
|
|
17
|
+
/** Fixed window width in pixels. */
|
|
10
18
|
readonly windowWidth?: number;
|
|
19
|
+
/** Popover content (rendered only while open). */
|
|
11
20
|
readonly children: ReactNode | undefined;
|
|
12
21
|
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import { type ProgressBarProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Horizontal progress indicator with a title, percentage and optional leading spinner.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* <ProgressBar title="Uploading" percentValue={42} />
|
|
8
|
+
*/
|
|
3
9
|
export declare function ProgressBar({ percentValue, title, rightSlot, color, backgroundColor, showSpinner, }: ProgressBarProps): ReactElement;
|
|
@@ -2,6 +2,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Color } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { Spinner } from '../Spinner';
|
|
4
4
|
import { Container, LoadingHeader, LoadingText, ProgressLine, ProgressBarActive, ProgressBoxContainer, RightSlotContainer, SpinnerContainer, ProgressLineContainer } from './styles';
|
|
5
|
+
/**
|
|
6
|
+
* Horizontal progress indicator with a title, percentage and optional leading spinner.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* <ProgressBar title="Uploading" percentValue={42} />
|
|
10
|
+
*/
|
|
5
11
|
export function ProgressBar({
|
|
6
12
|
percentValue,
|
|
7
13
|
title,
|
package/ProgressBar/types.d.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
+
/** Props of {@link ProgressBar}. */
|
|
2
3
|
export type ProgressBarProps = {
|
|
4
|
+
/** Completion percentage, 0–100. */
|
|
3
5
|
percentValue: number;
|
|
6
|
+
/** Label shown before the percentage. */
|
|
4
7
|
title: string;
|
|
8
|
+
/** Extra content on the right of the header row. */
|
|
5
9
|
rightSlot?: ReactNode;
|
|
10
|
+
/** Fill (and spinner) color. */
|
|
6
11
|
color?: string;
|
|
12
|
+
/** Track/spinner background color. */
|
|
7
13
|
backgroundColor?: string;
|
|
14
|
+
/** Show the leading spinner (default `true`). */
|
|
8
15
|
showSpinner?: boolean;
|
|
9
16
|
};
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
import type { PushBasicData, PushPreviewProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Renders a realistic push-notification preview from a push preset, picking
|
|
5
|
+
* localized strings by `language`, with compact/extended/silent/missed-content modes.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <PushPreview pushPreset={preset} language="en" appTitle="My App" />
|
|
9
|
+
*/
|
|
3
10
|
export declare function PushPreview<T extends PushBasicData>({ pushPreset, language, view, appTitle, appIcon, isLoading, width, }: PushPreviewProps<T>): ReactElement;
|
|
@@ -6,6 +6,13 @@ import { PREVIEW_ICON_URL } from './constants';
|
|
|
6
6
|
import { getLocalizedContent } from './helpers';
|
|
7
7
|
import { PushBox, PushIcon, PushTitle, PushDescription } from './styles';
|
|
8
8
|
import { RichMessageViewer } from '../RichMessageEditor';
|
|
9
|
+
/**
|
|
10
|
+
* Renders a realistic push-notification preview from a push preset, picking
|
|
11
|
+
* localized strings by `language`, with compact/extended/silent/missed-content modes.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <PushPreview pushPreset={preset} language="en" appTitle="My App" />
|
|
15
|
+
*/
|
|
9
16
|
export function PushPreview({
|
|
10
17
|
pushPreset,
|
|
11
18
|
language,
|