@pushwoosh/dumb-components 1.0.59 → 1.0.61

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.
Files changed (52) hide show
  1. package/CardMetric/CardMetric.d.ts +1 -1
  2. package/CardMetric/CardMetric.js +15 -16
  3. package/CodeEditor/types.d.ts +0 -1
  4. package/DateTimePicker/components/DatePickerField/DatePickerField.d.ts +1 -1
  5. package/DateTimePicker/components/DatePickerField/DatePickerField.js +7 -8
  6. package/DateTimePicker/components/DateTimePickerField/DateTimePickerField.d.ts +1 -1
  7. package/DateTimePicker/components/DateTimePickerField/DateTimePickerField.js +7 -8
  8. package/DateTimePicker/components/NumberPicker/NumberPicker.d.ts +1 -1
  9. package/DateTimePicker/components/NumberPicker/NumberPicker.js +13 -14
  10. package/Drawer/components/Drawer/Drawer.d.ts +1 -1
  11. package/Drawer/components/Drawer/Drawer.js +9 -10
  12. package/EditableField/EditableField.d.ts +1 -1
  13. package/EditableField/EditableField.js +13 -14
  14. package/InputFile/InputFile.d.ts +1 -1
  15. package/InputFile/InputFile.js +17 -18
  16. package/Link/index.d.ts +1 -0
  17. package/NumberPicker/NumberPicker.d.ts +1 -1
  18. package/NumberPicker/NumberPicker.js +13 -14
  19. package/Pagination/Pagination.d.ts +1 -1
  20. package/Pagination/Pagination.js +9 -10
  21. package/Popover/Popover.d.ts +1 -1
  22. package/Popover/Popover.js +10 -11
  23. package/Popover/index.d.ts +1 -1
  24. package/Popover/index.js +1 -1
  25. package/Popover/types.d.ts +1 -1
  26. package/ProgressBar/ProgressBar.d.ts +2 -2
  27. package/ProgressBar/ProgressBar.js +8 -9
  28. package/ProgressBar/types.d.ts +1 -1
  29. package/PushPreview/PushPreview.d.ts +1 -1
  30. package/PushPreview/PushPreview.js +10 -10
  31. package/RichMessageEditor/RichMessageViewer.d.ts +3 -2
  32. package/Skeleton/styles.js +4 -2
  33. package/Switch/Switch.d.ts +2 -2
  34. package/Switch/Switch.js +7 -8
  35. package/Switch/types.d.ts +1 -1
  36. package/Table/components/TablePagination/TablePagination.d.ts +1 -1
  37. package/Table/components/TablePagination/TablePagination.js +10 -11
  38. package/Table/index.d.ts +0 -2
  39. package/Table/index.js +0 -2
  40. package/Table/styles.d.ts +5 -4
  41. package/Tooltip/Tooltip.d.ts +1 -1
  42. package/Tooltip/Tooltip.js +10 -11
  43. package/Tooltip/maps.d.ts +1 -14
  44. package/index.d.ts +1 -1
  45. package/index.js +1 -1
  46. package/package.json +1 -1
  47. package/Table/components/TableList/TableList.d.ts +0 -3
  48. package/Table/components/TableList/TableList.js +0 -15
  49. package/Table/components/TableList/index.d.ts +0 -1
  50. package/Table/components/TableList/index.js +0 -1
  51. package/Table/components/TableList/types.d.ts +0 -9
  52. package/Table/components/TableList/types.js +0 -1
@@ -1,3 +1,3 @@
1
1
  import { type ReactElement } from 'react';
2
2
  import type { CardMetricProps } from './types';
3
- export declare function CardMetric(props: CardMetricProps): ReactElement;
3
+ export declare function CardMetric({ view, focus, title, tooltip, description, loading, collapse, metric, extraMetric, extraMetricColor, headerExtra, children, ...otherProps }: CardMetricProps): ReactElement;
@@ -5,22 +5,21 @@ import { Spinner } from '../Spinner';
5
5
  import { Tooltip } from '../Tooltip';
6
6
  import { CardChildren } from './CardChildren';
7
7
  import { CardContainer, CardHeader, CardTitle, CardInfo, CardMetricValue, CardExtraMetric, CardDescription, CardHeaderLeft } from './styles';
8
- export function CardMetric(props) {
9
- const {
10
- view = 'rounded',
11
- focus = false,
12
- title = '',
13
- tooltip = '',
14
- description = '',
15
- loading = false,
16
- collapse = undefined,
17
- metric = undefined,
18
- extraMetric = undefined,
19
- extraMetricColor = Color.MAIN,
20
- headerExtra = undefined,
21
- children,
22
- ...otherProps
23
- } = props;
8
+ export function CardMetric({
9
+ view = 'rounded',
10
+ focus = false,
11
+ title = '',
12
+ tooltip = '',
13
+ description = '',
14
+ loading = false,
15
+ collapse = undefined,
16
+ metric = undefined,
17
+ extraMetric = undefined,
18
+ extraMetricColor = Color.MAIN,
19
+ headerExtra = undefined,
20
+ children,
21
+ ...otherProps
22
+ }) {
24
23
  const [visibleInfo, setVisibleInfo] = useState(false);
25
24
  const [isCollapsed, setIsCollapsed] = useState(!!(collapse !== null && collapse !== void 0 && collapse.isCollapsed));
26
25
  const onMouseOver = () => setVisibleInfo(true);
@@ -1,6 +1,5 @@
1
1
  import { type CreateThemeOptions } from '@uiw/codemirror-themes';
2
2
  import { type ViewUpdate, type Extension } from '@uiw/react-codemirror';
3
- export type Language = 'json' | 'html' | 'liquid';
4
3
  export type CodeEditorProps = {
5
4
  value: string;
6
5
  readOnly?: boolean;
@@ -1,3 +1,3 @@
1
1
  import { type ReactElement } from 'react';
2
2
  import type { DatePickerFieldProps } from './types';
3
- export declare function DatePickerField(props: DatePickerFieldProps): ReactElement;
3
+ export declare function DatePickerField({ value, error, allowedPlacements, zIndex, onChange, }: DatePickerFieldProps): ReactElement;
@@ -4,14 +4,13 @@ import { CalendarIcon } from '@pushwoosh/kit-icons';
4
4
  import { format, monthName, get } from '../../helpers';
5
5
  import { InputFrame } from '../../styles';
6
6
  import { DatePicker } from '../DatePicker';
7
- export function DatePickerField(props) {
8
- const {
9
- value,
10
- error,
11
- allowedPlacements = ['bottom-start', 'bottom-end', 'top-start', 'top-end'],
12
- zIndex = 1000,
13
- onChange
14
- } = props;
7
+ export function DatePickerField({
8
+ value,
9
+ error,
10
+ allowedPlacements = ['bottom-start', 'bottom-end', 'top-start', 'top-end'],
11
+ zIndex = 1000,
12
+ onChange
13
+ }) {
15
14
  const [showPicker, setShowPicker] = useState(false);
16
15
  const {
17
16
  refs,
@@ -1,3 +1,3 @@
1
1
  import { type ReactElement } from 'react';
2
2
  import type { DateTimePickerFieldProps } from './types';
3
- export declare function DateTimePickerField(props: DateTimePickerFieldProps): ReactElement;
3
+ export declare function DateTimePickerField({ value, error, allowedPlacements, zIndex, onChange, }: DateTimePickerFieldProps): ReactElement;
@@ -5,14 +5,13 @@ import { CalendarIcon } from '@pushwoosh/kit-icons';
5
5
  import { useUTCDate } from './helpers';
6
6
  import { InputFrame } from '../../styles';
7
7
  import { DateTimePicker } from '../DateTimePicker';
8
- export function DateTimePickerField(props) {
9
- const {
10
- value,
11
- error,
12
- allowedPlacements = ['bottom-start', 'bottom-end', 'top-start', 'top-end'],
13
- zIndex = 1000,
14
- onChange
15
- } = props;
8
+ export function DateTimePickerField({
9
+ value,
10
+ error,
11
+ allowedPlacements = ['bottom-start', 'bottom-end', 'top-start', 'top-end'],
12
+ zIndex = 1000,
13
+ onChange
14
+ }) {
16
15
  const [showPicker, setShowPicker] = useState(false);
17
16
  const {
18
17
  refs,
@@ -1,3 +1,3 @@
1
1
  import { type ReactElement } from 'react';
2
2
  import type { NumberPickerProps } from './types';
3
- export declare function NumberPicker(props: NumberPickerProps): ReactElement;
3
+ export declare function NumberPicker({ value, hint, step, placeholder, focusOnMount, minValue, maxValue, autoSize, isDisabled, onChange, onSubmit, }: NumberPickerProps): ReactElement;
@@ -6,20 +6,19 @@ import { SingleInputFrame } from '../../styles';
6
6
  import { AutosizeInput } from '../AutosizeInput';
7
7
  import { Input } from '../Input';
8
8
  import { Hint } from './styles';
9
- export function NumberPicker(props) {
10
- const {
11
- value,
12
- hint,
13
- step = 1,
14
- placeholder,
15
- focusOnMount,
16
- minValue,
17
- maxValue,
18
- autoSize,
19
- isDisabled,
20
- onChange,
21
- onSubmit
22
- } = props;
9
+ export function NumberPicker({
10
+ value,
11
+ hint,
12
+ step = 1,
13
+ placeholder,
14
+ focusOnMount,
15
+ minValue,
16
+ maxValue,
17
+ autoSize,
18
+ isDisabled,
19
+ onChange,
20
+ onSubmit
21
+ }) {
23
22
  const ref = useRef(null);
24
23
  const [autoDiff, setAutoDiff] = useState(0);
25
24
  const [localValue, setLocalValue] = useState(value.toString() || '');
@@ -1,3 +1,3 @@
1
1
  import { type ReactElement } from 'react';
2
2
  import type { DrawerProps } from './types';
3
- export declare function Drawer(props: DrawerProps): ReactElement;
3
+ export declare function Drawer({ size, isOpen, zIndex, onClose, children, withoutLockScreen, closeOnClickOutside, }: DrawerProps): ReactElement;
@@ -5,16 +5,15 @@ import { DrawerBoxTrans, DrawerBox, LockBody, DrawerInner, DrawerContainer } fro
5
5
  function createDivElement() {
6
6
  return document.createElement('div');
7
7
  }
8
- export function Drawer(props) {
9
- const {
10
- size,
11
- isOpen,
12
- zIndex = 10000,
13
- onClose,
14
- children,
15
- withoutLockScreen = false,
16
- closeOnClickOutside = true
17
- } = props;
8
+ export function Drawer({
9
+ size,
10
+ isOpen,
11
+ zIndex = 10000,
12
+ onClose,
13
+ children,
14
+ withoutLockScreen = false,
15
+ closeOnClickOutside = true
16
+ }) {
18
17
  const ref = useRef();
19
18
  const [element] = useState(createDivElement);
20
19
  useEffect(() => {
@@ -1,3 +1,3 @@
1
1
  import { type ReactElement } from 'react';
2
2
  import type { EditableFieldProps } from './types';
3
- export declare function EditableField(props: EditableFieldProps): ReactElement;
3
+ export declare function EditableField({ value, title, open, loading, width, position, zIndex, onToggleOpen, onSubmit, onCancel, children, }: EditableFieldProps): ReactElement;
@@ -5,20 +5,19 @@ import { Button } from '../Button';
5
5
  import { useOnClickOutside } from '../hooks';
6
6
  import { Popover, PopoverContainer } from '../Popover';
7
7
  import { FieldBox, TitleBox, ButtonsGroup } from './styles';
8
- export function EditableField(props) {
9
- const {
10
- value,
11
- title = '',
12
- open = false,
13
- loading = false,
14
- width = 332,
15
- position = 'right-start',
16
- zIndex = 1000,
17
- onToggleOpen,
18
- onSubmit,
19
- onCancel,
20
- children
21
- } = props;
8
+ export function EditableField({
9
+ value,
10
+ title = '',
11
+ open = false,
12
+ loading = false,
13
+ width = 332,
14
+ position = 'right-start',
15
+ zIndex = 1000,
16
+ onToggleOpen,
17
+ onSubmit,
18
+ onCancel,
19
+ children
20
+ }) {
22
21
  const rootRef = useRef(null);
23
22
  const buttonRef = useRef(null);
24
23
  useOnClickOutside(rootRef, onCancel);
@@ -1,3 +1,3 @@
1
1
  import { type ReactElement } from 'react';
2
2
  import type { InputFileProps } from './types';
3
- export declare function InputFile(props: InputFileProps): ReactElement;
3
+ export declare function InputFile({ fileId, textId, buttonId, label, buttonText, accept, placeholder, disabled, fileName, errorText, name, maxSize, onError, onChange, isIgnoreFileSize, }: InputFileProps): ReactElement;
@@ -4,24 +4,23 @@ import { AttachmentIcon } from '@pushwoosh/kit-icons';
4
4
  import { Button } from '../Button';
5
5
  import { FieldBox } from '../FieldBox';
6
6
  import { InputFileFieldsStyled, InputFileButtonStyled, InputFileInputStyled, InputFileInputHiddenStyled, InputFileErrorStyled } from './styles';
7
- export function InputFile(props) {
8
- const {
9
- fileId,
10
- textId,
11
- buttonId,
12
- label,
13
- buttonText,
14
- accept,
15
- placeholder,
16
- disabled,
17
- fileName,
18
- errorText,
19
- name,
20
- maxSize,
21
- onError = () => {},
22
- onChange,
23
- isIgnoreFileSize = false
24
- } = props;
7
+ export function InputFile({
8
+ fileId,
9
+ textId,
10
+ buttonId,
11
+ label,
12
+ buttonText,
13
+ accept,
14
+ placeholder,
15
+ disabled,
16
+ fileName,
17
+ errorText,
18
+ name,
19
+ maxSize,
20
+ onError = () => {},
21
+ onChange,
22
+ isIgnoreFileSize = false
23
+ }) {
25
24
  const fieldRef = useRef(null);
26
25
  const uploadFile = event => {
27
26
  var _event$target$files;
package/Link/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export { Link } from './Link';
2
+ export type { LinkPropsWithoutAs, LinkPropsWithAsTag, LinkPropsWithAsComponent } from './types';
@@ -1,3 +1,3 @@
1
1
  import { type ReactElement } from 'react';
2
2
  import type { NumberPickerProps } from './types';
3
- export declare function NumberPicker(props: NumberPickerProps): ReactElement;
3
+ export declare function NumberPicker({ value, hint, step, placeholder, focusOnMount, minValue, maxValue, autoSize, isDisabled, onChange, onSubmit, }: NumberPickerProps): ReactElement;
@@ -4,20 +4,19 @@ import { ChevronIcon } from '@pushwoosh/kit-icons';
4
4
  import { AutosizeInput } from './components/AutosizeInput';
5
5
  import { intVal, isStringInteger } from './helpers';
6
6
  import { Hint, SingleInputFrame, InputStyled } from './styles';
7
- export function NumberPicker(props) {
8
- const {
9
- value,
10
- hint,
11
- step = 1,
12
- placeholder,
13
- focusOnMount,
14
- minValue,
15
- maxValue,
16
- autoSize,
17
- isDisabled,
18
- onChange,
19
- onSubmit
20
- } = props;
7
+ export function NumberPicker({
8
+ value,
9
+ hint,
10
+ step = 1,
11
+ placeholder,
12
+ focusOnMount,
13
+ minValue,
14
+ maxValue,
15
+ autoSize,
16
+ isDisabled,
17
+ onChange,
18
+ onSubmit
19
+ }) {
21
20
  const ref = useRef(null);
22
21
  const [autoDiff, setAutoDiff] = useState(0);
23
22
  const [localValue, setLocalValue] = useState('');
@@ -1,3 +1,3 @@
1
1
  import { type ReactElement } from 'react';
2
2
  import type { PaginationProps } from './types';
3
- export declare function Pagination(props: PaginationProps): ReactElement | null;
3
+ export declare function Pagination({ boxRef, activePage, totalPages, adjacentPagesCount, isLoading, onChangePage, ...rest }: PaginationProps): ReactElement | null;
@@ -2,16 +2,15 @@ import React, { useCallback } from 'react';
2
2
  import { ArrowIcon } from '@pushwoosh/kit-icons';
3
3
  import { getSafelyNumber } from './helpers';
4
4
  import { PaginationBox, PaginationArrow, PaginationDivider, PaginationButton } from './styles';
5
- export function Pagination(props) {
6
- const {
7
- boxRef,
8
- activePage,
9
- totalPages,
10
- adjacentPagesCount = 2,
11
- isLoading = false,
12
- onChangePage,
13
- ...rest
14
- } = props;
5
+ export function Pagination({
6
+ boxRef,
7
+ activePage,
8
+ totalPages,
9
+ adjacentPagesCount = 2,
10
+ isLoading = false,
11
+ onChangePage,
12
+ ...rest
13
+ }) {
15
14
  const safelyActivePageNumber = getSafelyNumber(activePage);
16
15
  const safelyTotalPagesNumber = getSafelyNumber(totalPages);
17
16
  const handleChangePage = useCallback(event => {
@@ -1,3 +1,3 @@
1
1
  import { type ReactElement } from 'react';
2
2
  import type { PopoverProps } from './types';
3
- export declare function Popover(props: PopoverProps): ReactElement;
3
+ export declare function Popover({ open, anchorEl, internalWindowRef, loading, position, zIndex, windowWidth, children, }: PopoverProps): ReactElement;
@@ -1,16 +1,15 @@
1
1
  import React from 'react';
2
2
  import { PopoverContainerPortal, PopoverContainerWindow } from './styles';
3
- export function Popover(props) {
4
- const {
5
- open,
6
- anchorEl,
7
- internalWindowRef = null,
8
- loading = false,
9
- position = 'right-start',
10
- zIndex = 1000,
11
- windowWidth,
12
- children
13
- } = props;
3
+ export function Popover({
4
+ open,
5
+ anchorEl,
6
+ internalWindowRef = null,
7
+ loading = false,
8
+ position = 'right-start',
9
+ zIndex = 1000,
10
+ windowWidth,
11
+ children
12
+ }) {
14
13
  return React.createElement(PopoverContainerPortal, {
15
14
  animation: false,
16
15
  delay: 0,
@@ -1,4 +1,4 @@
1
1
  export type { Placement } from 'tippy.js';
2
2
  export { Popover } from './Popover';
3
- export { PopoverContainer, PopoverContainerPortal, PopoverContainerWindow } from './styles';
3
+ export { PopoverContainer } from './styles';
4
4
  export type { PopoverProps } from './types';
package/Popover/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export { Popover } from './Popover';
2
- export { PopoverContainer, PopoverContainerPortal, PopoverContainerWindow } from './styles';
2
+ export { PopoverContainer } from './styles';
@@ -2,7 +2,7 @@ import type { RefObject, ReactNode } from 'react';
2
2
  import type { Placement } from 'tippy.js';
3
3
  export interface PopoverProps {
4
4
  readonly anchorEl: RefObject<HTMLElement>;
5
- readonly internalWindowRef?: RefObject<HTMLDivElement>;
5
+ readonly internalWindowRef?: RefObject<HTMLDivElement> | null;
6
6
  readonly position?: Placement;
7
7
  readonly open: boolean;
8
8
  readonly loading?: boolean;
@@ -1,3 +1,3 @@
1
1
  import { type ReactElement } from 'react';
2
- import { type ProgressBoxProps } from './types';
3
- export declare function ProgressBar(props: ProgressBoxProps): ReactElement;
2
+ import { type ProgressBarProps } from './types';
3
+ export declare function ProgressBar({ percentValue, title, rightSlot, color, backgroundColor, }: ProgressBarProps): ReactElement;
@@ -2,20 +2,19 @@ import React from 'react';
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
- export function ProgressBar(props) {
6
- const {
7
- percentValue,
8
- title,
9
- rightSlot,
10
- color = Color.BRIGHT,
11
- backgroundColor = Color.BRIGHT_LIGHT
12
- } = props;
5
+ export function ProgressBar({
6
+ percentValue,
7
+ title,
8
+ rightSlot,
9
+ color = Color.BRIGHT,
10
+ backgroundColor = Color.BRIGHT_LIGHT
11
+ }) {
13
12
  return React.createElement(Container, null, React.createElement(SpinnerContainer, {
14
13
  "$backgroundColor": backgroundColor
15
14
  }, React.createElement(Spinner, {
16
15
  color: color,
17
16
  size: "medium"
18
- })), React.createElement(ProgressBoxContainer, null, React.createElement(LoadingHeader, null, React.createElement(LoadingText, null, title, ' ', `${percentValue}%`), rightSlot && React.createElement(RightSlotContainer, null, rightSlot)), React.createElement(ProgressLineContainer, null, React.createElement(ProgressLine, null, React.createElement(ProgressBarActive, {
17
+ })), React.createElement(ProgressBoxContainer, null, React.createElement(LoadingHeader, null, React.createElement(LoadingText, null, `${title} ${percentValue}%`), rightSlot && React.createElement(RightSlotContainer, null, rightSlot)), React.createElement(ProgressLineContainer, null, React.createElement(ProgressLine, null, React.createElement(ProgressBarActive, {
19
18
  "$width": percentValue,
20
19
  "$color": color
21
20
  })))));
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
- export type ProgressBoxProps = {
2
+ export type ProgressBarProps = {
3
3
  percentValue: number;
4
4
  title: string;
5
5
  rightSlot?: ReactNode;
@@ -1,3 +1,3 @@
1
1
  import { type ReactElement } from 'react';
2
2
  import type { PushBasicData, PushPreviewProps } from './types';
3
- export declare function PushPreview<T extends PushBasicData>(props: PushPreviewProps<T>): ReactElement;
3
+ export declare function PushPreview<T extends PushBasicData>({ pushPreset, language, view, appTitle, appIcon, isLoading, width, }: PushPreviewProps<T>): ReactElement;
@@ -6,16 +6,15 @@ 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
- export function PushPreview(props) {
10
- const {
11
- pushPreset,
12
- language,
13
- view = 'compact',
14
- appTitle = '',
15
- appIcon = PREVIEW_ICON_URL,
16
- isLoading = false,
17
- width
18
- } = props;
9
+ export function PushPreview({
10
+ pushPreset,
11
+ language,
12
+ view = 'compact',
13
+ appTitle = '',
14
+ appIcon = PREVIEW_ICON_URL,
15
+ isLoading = false,
16
+ width
17
+ }) {
19
18
  const title = getLocalizedContent((pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.title) || (pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.localizedTitle), language) || appTitle;
20
19
  const content = getLocalizedContent((pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.content) || (pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.localizedContent), language);
21
20
  const icon = (pushPreset === null || pushPreset === void 0 ? void 0 : pushPreset.icon) || appIcon || PREVIEW_ICON_URL;
@@ -48,6 +47,7 @@ export function PushPreview(props) {
48
47
  view: view,
49
48
  locked: !content
50
49
  }, !content ? 'Message is empty…' : React.createElement(RichMessageViewer, {
50
+ flat: view === 'compact',
51
51
  value: content
52
52
  }))));
53
53
  }
@@ -1,6 +1,7 @@
1
1
  import { type FC } from 'react';
2
2
  import { type RichMessageEditorContent } from './types';
3
- export declare const RichMessageViewer: FC<{
3
+ export type RichMessageViewerProps = {
4
4
  value: RichMessageEditorContent | string;
5
5
  flat?: boolean;
6
- }>;
6
+ };
7
+ export declare const RichMessageViewer: FC<RichMessageViewerProps>;
@@ -26,8 +26,10 @@ export const CircularSkeleton = styled.div.withConfig({
26
26
  export const TextSkeletonTag = styled.div.withConfig({
27
27
  displayName: "TextSkeletonTag",
28
28
  componentId: "sc-mdyfd6-2"
29
- })(["", " color:", ";border-radius:4px;", ""], ({
29
+ })(["", " color:", ";border-radius:", ";", ""], ({
30
30
  width
31
31
  }) => width ? `width: ${toCssValue(width)};` : '', ({
32
32
  color
33
- }) => color || '#ddd', skeletonCommonCss);
33
+ }) => color || '#ddd', ({
34
+ borderRadius
35
+ }) => borderRadius || '4px', skeletonCommonCss);
@@ -1,3 +1,3 @@
1
1
  import { type ReactElement } from 'react';
2
- import type { TProps } from './types';
3
- export declare function Switch(props: TProps): ReactElement;
2
+ import type { SwitchProps } from './types';
3
+ export declare function Switch({ labelPosition, enabled, isDisabled, children, onChange, }: SwitchProps): ReactElement;
package/Switch/Switch.js CHANGED
@@ -1,13 +1,12 @@
1
1
  import React from 'react';
2
2
  import { Container, Box, Circle, Label } from './styles';
3
- export function Switch(props) {
4
- const {
5
- labelPosition = 'right',
6
- enabled = false,
7
- isDisabled = false,
8
- children,
9
- onChange
10
- } = props;
3
+ export function Switch({
4
+ labelPosition = 'right',
5
+ enabled = false,
6
+ isDisabled = false,
7
+ children,
8
+ onChange
9
+ }) {
11
10
  return React.createElement(Container, {
12
11
  labelPosition: labelPosition
13
12
  }, React.createElement(Box, {
package/Switch/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from 'react';
2
- export interface TProps {
2
+ export interface SwitchProps {
3
3
  labelPosition?: 'left' | 'right';
4
4
  enabled?: boolean;
5
5
  isDisabled?: boolean;
@@ -1,3 +1,3 @@
1
1
  import { type ReactElement } from 'react';
2
2
  import type { TablePaginationProps } from './types';
3
- export declare function TablePagination(props: TablePaginationProps): ReactElement;
3
+ export declare function TablePagination({ activePage, totalPages, limit, allLimits, padding, onChangePage, onChangeLimit, children, }: TablePaginationProps): ReactElement;
@@ -2,17 +2,16 @@ import React from 'react';
2
2
  import { Horizontal } from '@pushwoosh/kit-helpers';
3
3
  import { NativeSelect } from '../../../native';
4
4
  import { Pagination } from '../../../Pagination';
5
- export function TablePagination(props) {
6
- const {
7
- activePage,
8
- totalPages,
9
- limit,
10
- allLimits,
11
- padding = 24,
12
- onChangePage,
13
- onChangeLimit,
14
- children
15
- } = props;
5
+ export function TablePagination({
6
+ activePage,
7
+ totalPages,
8
+ limit,
9
+ allLimits,
10
+ padding = 24,
11
+ onChangePage,
12
+ onChangeLimit,
13
+ children
14
+ }) {
16
15
  return React.createElement(Horizontal, {
17
16
  "$alignItems": "center",
18
17
  "$justifyContent": "space-between",
package/Table/index.d.ts CHANGED
@@ -1,11 +1,9 @@
1
1
  export { DataTable } from './components/DataTable';
2
- export { DataTableList } from './components/DataTableList';
3
2
  export { DataTableGetContext } from './components/DataTableGetContext';
4
3
  export { DataTablePagination } from './components/DataTablePagination';
5
4
  export { DataTableSearchInput } from './components/DataTableSearchInput';
6
5
  export { DataTableSortableCell } from './components/DataTableSortableCell';
7
6
  export { Loading } from './components/Loading';
8
- export { TableList } from './components/TableList';
9
7
  export { TablePagination } from './components/TablePagination';
10
8
  export { useDataTableContext, useDataTableGetParams } from './hooks';
11
9
  export { Table, Td, Tr, Th, ElementHover, ItemDetailLink, ItemName, LockedText, Description, } from './styles';
package/Table/index.js CHANGED
@@ -1,11 +1,9 @@
1
1
  export { DataTable } from './components/DataTable';
2
- export { DataTableList } from './components/DataTableList';
3
2
  export { DataTableGetContext } from './components/DataTableGetContext';
4
3
  export { DataTablePagination } from './components/DataTablePagination';
5
4
  export { DataTableSearchInput } from './components/DataTableSearchInput';
6
5
  export { DataTableSortableCell } from './components/DataTableSortableCell';
7
6
  export { Loading } from './components/Loading';
8
- export { TableList } from './components/TableList';
9
7
  export { TablePagination } from './components/TablePagination';
10
8
  export { useDataTableContext, useDataTableGetParams } from './hooks';
11
9
  export { Table, Td, Tr, Th, ElementHover, ItemDetailLink, ItemName, LockedText, Description } from './styles';
package/Table/styles.d.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  import { FontSize, FontWeight } from '@pushwoosh/kit-constants';
2
+ export type TableProps = {
3
+ columns: string;
4
+ width?: string | number;
5
+ };
2
6
  export declare const Table: import("styled-components").StyledComponent<"div", any, {
3
7
  $alignContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
4
8
  $alignItems?: "end" | "start" | "center" | "stretch" | "baseline" | undefined;
@@ -54,10 +58,7 @@ export declare const Table: import("styled-components").StyledComponent<"div", a
54
58
  $placeItems?: "end" | "start" | "center" | "stretch" | undefined;
55
59
  } & {
56
60
  $gridAutoFlow: string;
57
- } & {
58
- columns: string;
59
- width?: string | number;
60
- }, "$gridAutoFlow">;
61
+ } & TableProps, "$gridAutoFlow">;
61
62
  export declare const Td: import("styled-components").StyledComponent<"div", any, {
62
63
  $alignContent?: "end" | "start" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | undefined;
63
64
  $alignItems?: "end" | "start" | "center" | "stretch" | "baseline" | undefined;
@@ -1,3 +1,3 @@
1
1
  import { type ReactElement } from 'react';
2
2
  import type { TooltipProps } from './types';
3
- export declare function Tooltip(props: TooltipProps): ReactElement;
3
+ export declare function Tooltip({ position, arrowOffset, offset, maxWidth, zIndex, isDisabled, isVisible, ...rest }: TooltipProps): ReactElement;
@@ -1,17 +1,16 @@
1
1
  import React from 'react';
2
2
  import { TooltipPositionToArrowOffsetMap, TooltipPositionToTippyOffsetMap, TooltipPositionToTippyPlacementMap } from './maps';
3
3
  import { TooltipBox } from './styles';
4
- export function Tooltip(props) {
5
- const {
6
- position = 'top-start',
7
- arrowOffset = TooltipPositionToArrowOffsetMap[position],
8
- offset = TooltipPositionToTippyOffsetMap[position],
9
- maxWidth = 240,
10
- zIndex = 999999,
11
- isDisabled,
12
- isVisible,
13
- ...rest
14
- } = props;
4
+ export function Tooltip({
5
+ position = 'top-start',
6
+ arrowOffset = TooltipPositionToArrowOffsetMap[position],
7
+ offset = TooltipPositionToTippyOffsetMap[position],
8
+ maxWidth = 240,
9
+ zIndex = 999999,
10
+ isDisabled,
11
+ isVisible,
12
+ ...rest
13
+ }) {
15
14
  return React.createElement(TooltipBox, {
16
15
  animation: false,
17
16
  delay: 0,
package/Tooltip/maps.d.ts CHANGED
@@ -13,20 +13,7 @@ export declare const TooltipPositionToTippyPlacementMap: {
13
13
  'left-middle': "left";
14
14
  'left-end': "left-end";
15
15
  };
16
- export declare const TooltipPositionToTippyOffsetMap: {
17
- 'top-start': number[];
18
- 'top-middle': number[];
19
- 'top-end': number[];
20
- 'right-start': number[];
21
- 'right-middle': number[];
22
- 'right-end': number[];
23
- 'bottom-start': number[];
24
- 'bottom-middle': number[];
25
- 'bottom-end': number[];
26
- 'left-start': number[];
27
- 'left-middle': number[];
28
- 'left-end': number[];
29
- };
16
+ export declare const TooltipPositionToTippyOffsetMap: Record<TooltipPosition, [number, number]>;
30
17
  export declare const TooltipPositionToArrowOffsetMap: {
31
18
  'top-start': string;
32
19
  'top-middle': string;
package/index.d.ts CHANGED
@@ -26,7 +26,7 @@ export { StatisticCard } from './StatisticCard';
26
26
  export { EmailTemplatePreview, NoEmailTemplatePreview } from './EmailTemplatePreview';
27
27
  export { PushPreview } from './PushPreview';
28
28
  export { Toast, ToastProvider, useToast } from './Toast';
29
- export { DataTable, DataTableList, DataTableGetContext, DataTablePagination, DataTableSearchInput, DataTableSortableCell, Loading, TableList, TablePagination, useDataTableContext, useDataTableGetParams, Table, Td, Tr, Th, ElementHover, ItemDetailLink, ItemName, LockedText, Description, type DataTableParams, type DataTableData, type DataTableContextType, } from './Table';
29
+ export { DataTable, DataTableGetContext, DataTablePagination, DataTableSearchInput, DataTableSortableCell, Loading, TablePagination, useDataTableContext, useDataTableGetParams, Table, Td, Tr, Th, ElementHover, ItemDetailLink, ItemName, LockedText, Description, type DataTableParams, type DataTableData, type DataTableContextType, } from './Table';
30
30
  export { AutosizeInput, PageHeader, PageHeaderEditable } from './PageHeader';
31
31
  export { ExportResult } from './ExportResult';
32
32
  export { NativeInput, NativeTextarea, NativeSelect } from './native';
package/index.js CHANGED
@@ -26,7 +26,7 @@ export { StatisticCard } from './StatisticCard';
26
26
  export { EmailTemplatePreview, NoEmailTemplatePreview } from './EmailTemplatePreview';
27
27
  export { PushPreview } from './PushPreview';
28
28
  export { Toast, ToastProvider, useToast } from './Toast';
29
- export { DataTable, DataTableList, DataTableGetContext, DataTablePagination, DataTableSearchInput, DataTableSortableCell, Loading, TableList, TablePagination, useDataTableContext, useDataTableGetParams, Table, Td, Tr, Th, ElementHover, ItemDetailLink, ItemName, LockedText, Description } from './Table';
29
+ export { DataTable, DataTableGetContext, DataTablePagination, DataTableSearchInput, DataTableSortableCell, Loading, TablePagination, useDataTableContext, useDataTableGetParams, Table, Td, Tr, Th, ElementHover, ItemDetailLink, ItemName, LockedText, Description } from './Table';
30
30
  export { AutosizeInput, PageHeader, PageHeaderEditable } from './PageHeader';
31
31
  export { ExportResult } from './ExportResult';
32
32
  export { NativeInput, NativeTextarea, NativeSelect } from './native';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.0.59",
3
+ "version": "1.0.61",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { TableListProps } from './types';
3
- export declare function TableList<I>(props: TableListProps<I>): React.JSX.Element;
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { Table } from '../../styles';
3
- export function TableList(props) {
4
- const {
5
- columns,
6
- items,
7
- renderHead,
8
- renderItem,
9
- renderTableTop,
10
- renderTableBottom
11
- } = props;
12
- return React.createElement(Table, {
13
- columns: columns
14
- }, renderTableTop === null || renderTableTop === void 0 ? void 0 : renderTableTop(), renderHead(), items.map(renderItem), renderTableBottom === null || renderTableBottom === void 0 ? void 0 : renderTableBottom());
15
- }
@@ -1 +0,0 @@
1
- export { TableList } from './TableList';
@@ -1 +0,0 @@
1
- export { TableList } from './TableList';
@@ -1,9 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- export type TableListProps<I> = {
3
- columns: string;
4
- items: I[];
5
- renderTableTop?: () => ReactNode;
6
- renderHead: () => ReactNode;
7
- renderItem: (item: I) => ReactNode;
8
- renderTableBottom?: () => ReactNode;
9
- };
@@ -1 +0,0 @@
1
- export {};