@plesk/ui-library 3.36.0 → 3.37.0

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 (90) hide show
  1. package/cjs/components/Card/helpers.js +0 -1
  2. package/cjs/components/Carousel/Carousel.js +182 -77
  3. package/cjs/components/ComboBox/ComboBoxOption.js +2 -1
  4. package/cjs/components/Drawer/DrawerProgress.js +1 -1
  5. package/cjs/components/List/List.js +102 -314
  6. package/cjs/components/List/ListAction.js +0 -1
  7. package/cjs/components/Panel/Panel.js +61 -98
  8. package/cjs/components/Select/SelectControl.js +4 -0
  9. package/cjs/components/Select/SelectOption.js +2 -1
  10. package/cjs/components/Toaster/Toaster.js +3 -3
  11. package/cjs/components/Toolbar/ToolbarMenu.js +0 -1
  12. package/cjs/components/index.js +42 -22
  13. package/cjs/index.js +1 -1
  14. package/dist/plesk-ui-library-rtl.css +1 -1
  15. package/dist/plesk-ui-library-rtl.css.map +1 -1
  16. package/dist/plesk-ui-library.css +1 -1
  17. package/dist/plesk-ui-library.css.map +1 -1
  18. package/dist/plesk-ui-library.js +574 -678
  19. package/dist/plesk-ui-library.js.map +1 -1
  20. package/dist/plesk-ui-library.min.js +10 -10
  21. package/dist/plesk-ui-library.min.js.map +1 -1
  22. package/esm/components/Card/helpers.js +0 -1
  23. package/esm/components/Carousel/Carousel.js +183 -78
  24. package/esm/components/ComboBox/ComboBoxOption.js +2 -1
  25. package/esm/components/Drawer/DrawerProgress.js +1 -1
  26. package/esm/components/List/List.js +102 -314
  27. package/esm/components/List/ListAction.js +0 -1
  28. package/esm/components/Panel/Panel.js +62 -99
  29. package/esm/components/Select/SelectControl.js +4 -0
  30. package/esm/components/Select/SelectOption.js +2 -1
  31. package/esm/components/Toaster/Toaster.js +3 -3
  32. package/esm/components/Toolbar/ToolbarMenu.js +0 -1
  33. package/esm/components/index.js +2 -4
  34. package/esm/index.js +1 -1
  35. package/package.json +41 -41
  36. package/styleguide/build/bundle.c3d05006.js +2 -0
  37. package/styleguide/index.html +2 -2
  38. package/types/src/components/Action/Action.d.ts +1 -1
  39. package/types/src/components/Action/index.d.ts +1 -0
  40. package/types/src/components/Alert/Alert.d.ts +1 -1
  41. package/types/src/components/Alert/index.d.ts +1 -0
  42. package/types/src/components/AutoClosable/AutoClosable.d.ts +1 -1
  43. package/types/src/components/AutoClosable/index.d.ts +1 -0
  44. package/types/src/components/AuxiliaryActions/AuxiliaryActions.d.ts +1 -1
  45. package/types/src/components/AuxiliaryActions/index.d.ts +1 -0
  46. package/types/src/components/Badge/Badge.d.ts +1 -1
  47. package/types/src/components/Badge/index.d.ts +1 -0
  48. package/types/src/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  49. package/types/src/components/Breadcrumbs/index.d.ts +1 -0
  50. package/types/src/components/Button/ButtonContext.d.ts +1 -0
  51. package/types/src/components/ButtonGroup/ButtonGroup.d.ts +1 -1
  52. package/types/src/components/ButtonGroup/index.d.ts +1 -0
  53. package/types/src/components/Carousel/Carousel.d.ts +43 -8
  54. package/types/src/components/Checkbox/Checkbox.d.ts +1 -1
  55. package/types/src/components/Checkbox/index.d.ts +1 -0
  56. package/types/src/components/ComboBox/ComboBox.d.ts +1 -1
  57. package/types/src/components/ComboBox/ComboBoxOption.d.ts +1 -1
  58. package/types/src/components/ComboBox/index.d.ts +2 -0
  59. package/types/src/components/ConsoleOutput/ConsoleOutput.d.ts +1 -1
  60. package/types/src/components/ConsoleOutput/index.d.ts +1 -0
  61. package/types/src/components/ContentLoader/ContentLoader.d.ts +1 -1
  62. package/types/src/components/ContentLoader/index.d.ts +1 -0
  63. package/types/src/components/Cuttable/Cuttable.d.ts +1 -1
  64. package/types/src/components/Cuttable/index.d.ts +1 -0
  65. package/types/src/components/DistractionFreeModeContext/DistractionFreeModeContext.d.ts +1 -0
  66. package/types/src/components/Drawer/DrawerProgress.d.ts +1 -1
  67. package/types/src/components/Form/DisabledContext.d.ts +1 -0
  68. package/types/src/components/Form/FormContext.d.ts +1 -0
  69. package/types/src/components/Form/ScrollableElementFormContext.d.ts +1 -0
  70. package/types/src/components/List/List.d.ts +637 -0
  71. package/types/src/components/List/ListAction.d.ts +21 -18
  72. package/types/src/components/List/ListActionsDivider.d.ts +1 -1
  73. package/types/src/components/List/ListEmptyView.d.ts +1 -1
  74. package/types/src/components/List/index.d.ts +12 -0
  75. package/types/src/components/OnDarkContext/OnDarkContext.d.ts +1 -0
  76. package/types/src/components/Pagination/Pagination.d.ts +1 -1
  77. package/types/src/components/Pagination/index.d.ts +1 -0
  78. package/types/src/components/Panel/Panel.d.ts +4 -21
  79. package/types/src/components/Panel/index.d.ts +1 -0
  80. package/types/src/components/Radio/Radio.d.ts +4 -6
  81. package/types/src/components/Radio/index.d.ts +1 -0
  82. package/types/src/components/ResponsiveContext/ResponsiveContext.d.ts +1 -0
  83. package/types/src/components/Section/Section.d.ts +1 -1
  84. package/types/src/components/Toolbar/RegistryContext.d.ts +1 -0
  85. package/types/src/components/Translate/Translate.d.ts +4 -3
  86. package/types/src/components/Translate/index.d.ts +1 -1
  87. package/types/src/components/VerticalContext/VerticalContext.d.ts +1 -0
  88. package/types/src/components/index.d.ts +17 -4
  89. package/styleguide/build/bundle.2c956ff2.js +0 -2
  90. /package/styleguide/build/{bundle.2c956ff2.js.LICENSE.txt → bundle.c3d05006.js.LICENSE.txt} +0 -0
@@ -1,39 +1,42 @@
1
- import { ReactElement, ReactNode } from 'react';
2
- import { IconProps } from '../Icon';
1
+ import { ElementType, ReactElement, ReactNode } from 'react';
2
+ import { ButtonProps } from '../Button';
3
+ import { MenuItemProps } from '../Menu';
3
4
  export type ListActionRenderFn = (props: {
4
5
  wrap: (children: ReactNode) => ReactNode;
5
6
  }) => ReactElement | null;
6
- type ListActionProps = {
7
+ type ListActionButtonProps<TComponent extends ElementType> = {
8
+ primary: true;
9
+ icon: ButtonProps['icon'];
10
+ component?: TComponent;
11
+ } & Omit<ButtonProps<TComponent>, keyof ListActionBaseProps | 'icon'>;
12
+ type ListActionMenuItemProps<TComponent extends ElementType> = {
13
+ primary?: false;
14
+ component?: TComponent;
15
+ } & Omit<MenuItemProps<TComponent>, keyof ListActionBaseProps>;
16
+ type ListActionBaseProps = {
7
17
  /**
8
- * Should render as a ghost button in List's default mode. Icon is required for the ListAction with this property.
18
+ * Should render as a ghost button in List's default mode. Icon is required for the ListAction with this property. See
19
+ * @see Use [Button](#!/Button) props when primary is true.
20
+ * @see Use [MenuItem](#!/MenuItem) props when primary is false.
9
21
  * @since 3.3.0
10
22
  */
11
23
  primary?: boolean;
12
24
  /**
13
- * Name of icon.
14
- * @since 3.3.0
25
+ * Renders as a "hole" if it has the primary property and doesn't render in the dropdown.
26
+ * @since 3.5.0
15
27
  */
16
- icon?: string | IconProps | ReactElement<any>;
28
+ hidden?: boolean;
17
29
  /**
18
30
  * Content of the component.
19
31
  * @since 3.3.0
20
32
  */
21
33
  children?: ReactNode | ListActionRenderFn;
22
- /**
23
- * Tooltip for component.
24
- * @since 3.5.0
25
- */
26
- tooltip?: ReactNode;
27
- /**
28
- * Renders as a "hole" if it has the primary property and doesn't render in the dropdown.
29
- * @since 3.5.0
30
- */
31
- hidden?: boolean;
32
34
  };
35
+ export type ListActionProps<TComponent extends ElementType> = ListActionBaseProps & (ListActionButtonProps<TComponent> | ListActionMenuItemProps<TComponent>);
33
36
  /**
34
37
  * `ListAction` component is a part of [ListActions](#!/ListActions) component.
35
38
  * It accepts the props of [Button](#!/Button) and [MenuItem](#!/MenuItem) components.
36
39
  * @since 3.3.0
37
40
  */
38
- declare const ListAction: ({ primary, children, tooltip, ...props }: ListActionProps) => import("react/jsx-runtime").JSX.Element | null;
41
+ declare const ListAction: <TComponent extends ElementType = "div">({ primary, children, tooltip, ...props }: ListActionProps<TComponent>) => import("react/jsx-runtime").JSX.Element | null;
39
42
  export default ListAction;
@@ -1,6 +1,6 @@
1
1
  import { ComponentProps } from 'react';
2
2
  import { MenuDivider } from '../Menu';
3
- type ListActionsDividerProps = ComponentProps<typeof MenuDivider>;
3
+ export type ListActionsDividerProps = ComponentProps<typeof MenuDivider>;
4
4
  /**
5
5
  * `ListActionsDivider` component is a part of [ListActions](#!/ListActions) component.
6
6
  * It accepts the props of [MenuDivider](#!/MenuDivider) component.
@@ -1,6 +1,6 @@
1
1
  import { FunctionComponent, ReactNode } from 'react';
2
2
  import './ListEmptyView.less';
3
- type ListEmptyViewProps = {
3
+ export type ListEmptyViewProps = {
4
4
  /**
5
5
  * A title.
6
6
  * @since 2.5.0
@@ -0,0 +1,12 @@
1
+ export { default } from './List';
2
+ export type { ListProps, ListColumn } from './List';
3
+ export { default as ListOperation } from './ListOperation';
4
+ export type { ListOperationProps } from './ListOperation';
5
+ export { default as ListEmptyView } from './ListEmptyView';
6
+ export type { ListEmptyViewProps } from './ListEmptyView';
7
+ export { default as ListActions } from './ListActions';
8
+ export type { ListActionsProps } from './ListActions';
9
+ export { default as ListAction } from './ListAction';
10
+ export type { ListActionProps } from './ListAction';
11
+ export { default as ListActionsDivider } from './ListActionsDivider';
12
+ export type { ListActionsDividerProps } from './ListActionsDivider';
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const OnDarkContext: import("react").Context<boolean>;
2
3
  export default OnDarkContext;
@@ -4,7 +4,7 @@ type ItemPerPageOption = number | 'all';
4
4
  export declare const ITEMS_PER_PAGE_OPTIONS: ItemPerPageOption[];
5
5
  declare const VIEW_DEFAULT = "default";
6
6
  declare const VIEW_POPOVER = "popover";
7
- type PaginationProps = {
7
+ export type PaginationProps = {
8
8
  /**
9
9
  * Number of pages in pagination.
10
10
  * @since 0.0.54
@@ -1 +1,2 @@
1
1
  export { default, ITEMS_PER_PAGE_OPTIONS } from './Pagination';
2
+ export type { PaginationProps } from './Pagination';
@@ -1,7 +1,7 @@
1
- import { Component, SyntheticEvent, ReactNode } from 'react';
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
2
  import { DataAttributes } from '../../utils/types';
3
3
  import './Panel.less';
4
- type PanelProps = {
4
+ export type PanelProps = {
5
5
  /**
6
6
  * Panel title.
7
7
  * @since 0.0.37
@@ -40,27 +40,10 @@ type PanelProps = {
40
40
  * @ignore
41
41
  */
42
42
  baseClassName?: string;
43
- } & DataAttributes;
44
- type PanelState = {
45
- collapsed: boolean;
46
- prevPropsCollapsed: boolean;
47
- };
43
+ } & DataAttributes & HTMLAttributes<HTMLDivElement>;
48
44
  /**
49
45
  * `Panel` component is used for visually grouping some content.
50
46
  * @since 0.0.35
51
47
  */
52
- declare class Panel extends Component<PanelProps, PanelState> {
53
- static defaultProps: {
54
- collapsible: boolean;
55
- collapsed: boolean;
56
- baseClassName: string;
57
- };
58
- constructor(props: PanelProps);
59
- static getDerivedStateFromProps(props: PanelProps, state: PanelState): {
60
- collapsed: boolean | undefined;
61
- prevPropsCollapsed: boolean | undefined;
62
- } | null;
63
- handleToggle: (e: SyntheticEvent<HTMLElement, MouseEvent>) => void;
64
- render(): import("react/jsx-runtime").JSX.Element;
65
- }
48
+ declare const Panel: ({ baseClassName, className, title, collapsible, collapsed: externalCollapsed, onToggle, children, extra, ...props }: PanelProps) => import("react/jsx-runtime").JSX.Element;
66
49
  export default Panel;
@@ -1 +1,2 @@
1
1
  export { default } from './Panel';
2
+ export type { PanelProps } from './Panel';
@@ -1,6 +1,7 @@
1
- import { ReactNode, HTMLProps, FunctionComponent } from 'react';
1
+ import { ReactNode, HTMLProps, FunctionComponent, HTMLAttributes } from 'react';
2
+ import { DataAttributes } from '../../utils/types';
2
3
  import './Radio.less';
3
- type RadioProps = {
4
+ type BaseRadioProps = {
4
5
  /**
5
6
  * Determine whether the `Radio` is checked.
6
7
  * @since 3.2.0
@@ -35,15 +36,12 @@ type RadioProps = {
35
36
  * @since 3.2.0
36
37
  */
37
38
  inputProps?: HTMLProps<HTMLInputElement>;
38
- /**
39
- * @ignore
40
- */
41
- className?: string;
42
39
  /**
43
40
  * @ignore
44
41
  */
45
42
  baseClassName?: string;
46
43
  };
44
+ export type RadioProps = BaseRadioProps & DataAttributes & Omit<HTMLAttributes<HTMLLabelElement>, keyof BaseRadioProps>;
47
45
  /**
48
46
  * `Radio` component is used for making a choice among a set of mutually exclusive, related options.
49
47
  * @since 3.2.0
@@ -1 +1,2 @@
1
1
  export { default } from './Radio';
2
+ export type { RadioProps } from './Radio';
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const ResponsiveContext: import("react").Context<boolean | undefined>;
2
3
  export default ResponsiveContext;
@@ -49,7 +49,7 @@ export interface SectionProps {
49
49
  * Section view will be automatically switched if this parameter is not specified explicitly.
50
50
  * @since 0.3.0
51
51
  */
52
- vertical: boolean;
52
+ vertical?: boolean;
53
53
  /**
54
54
  * Content of the `Section`.
55
55
  * @since 0.0.54
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export type RegistryItem = {
2
3
  setCompact: (compact: boolean) => void;
3
4
  isCompact: (one: boolean) => boolean;
@@ -1,5 +1,8 @@
1
1
  import { ElementType, ReactNode } from 'react';
2
2
  import { PolymorphicComponentProps } from '../../utils/types';
3
+ export type Translator = ReactNode | ((params?: {
4
+ [key: string]: ReactNode;
5
+ }) => ReactNode);
3
6
  interface BaseTranslateProps {
4
7
  /**
5
8
  * A some prefix for the message key.
@@ -28,9 +31,7 @@ interface BaseTranslateProps {
28
31
  * @ignore
29
32
  */
30
33
  translators?: {
31
- [key: string]: ReactNode | ((params?: {
32
- [key: string]: ReactNode;
33
- }) => ReactNode);
34
+ [key: string]: Translator;
34
35
  };
35
36
  /**
36
37
  * @ignore
@@ -1,3 +1,3 @@
1
1
  export { default } from './Translate';
2
2
  export { isLikeText } from './isLikeText';
3
- export type { TranslateProps } from './Translate';
3
+ export type { TranslateProps, Translator } from './Translate';
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const VERTICAL_BREAKPOINT = 450;
2
3
  declare const VerticalContext: import("react").Context<boolean | undefined>;
3
4
  export default VerticalContext;
@@ -1,28 +1,40 @@
1
1
  export { default as Action } from './Action';
2
+ export type { ActionProps } from './Action';
2
3
  export { default as Alert } from './Alert';
4
+ export type { AlertProps } from './Alert';
3
5
  export { default as AutoClosable } from './AutoClosable';
6
+ export type { AutoClosableProps } from './AutoClosable';
4
7
  export { default as AuxiliaryActions } from './AuxiliaryActions';
8
+ export type { AuxiliaryActionsProps } from './AuxiliaryActions';
5
9
  export { default as Badge } from './Badge';
10
+ export type { BadgeProps } from './Badge';
6
11
  export { default as Breadcrumbs } from './Breadcrumbs';
12
+ export type { BreadcrumbsProps } from './Breadcrumbs';
7
13
  export { default as Button } from './Button';
8
14
  export type { ButtonProps } from './Button';
9
15
  export { default as ButtonGroup } from './ButtonGroup';
16
+ export type { ButtonGroupProps } from './ButtonGroup';
10
17
  export { default as Card } from './Card';
11
18
  export * from './Card';
12
19
  export { default as CardList } from './CardList';
13
20
  export { default as Carousel } from './Carousel';
14
21
  export type { CarouselProps } from './Carousel';
15
22
  export { default as Checkbox } from './Checkbox';
23
+ export type { CheckboxProps } from './Checkbox';
16
24
  export { default as Radio } from './Radio';
25
+ export type { RadioProps } from './Radio';
17
26
  export { default as CodeEditor } from './CodeEditor';
18
27
  export type { CodeEditorProps } from './CodeEditor';
19
28
  export { default as Columns, Column } from './Columns';
20
29
  export type { ColumnsProps, ColumnProps } from './Columns';
21
- export { default as ComboBox } from './ComboBox';
22
- export * from './ComboBox';
30
+ export { default as ComboBox, ComboBoxOption } from './ComboBox';
31
+ export type { ComboBoxProps, ComboBoxOptionProps } from './ComboBox';
23
32
  export { default as ConsoleOutput } from './ConsoleOutput';
33
+ export type { ConsoleOutputProps } from './ConsoleOutput';
24
34
  export { default as ContentLoader } from './ContentLoader';
35
+ export type { ContentLoaderProps } from './ContentLoader';
25
36
  export { default as Cuttable } from './Cuttable';
37
+ export type { CuttableProps } from './Cuttable';
26
38
  export { default as Dialog } from './Dialog';
27
39
  export type { DialogProps } from './Dialog';
28
40
  export { default as Drawer } from './Drawer';
@@ -74,8 +86,8 @@ export { default as ItemList } from './ItemList';
74
86
  export { default as Label } from './Label';
75
87
  export { default as Layout } from './Layout';
76
88
  export type { LayoutProps } from './Layout';
77
- export { default as List } from './List';
78
- export * from './List';
89
+ export { default as List, ListActions, ListAction, ListOperation, ListEmptyView, ListActionsDivider, } from './List';
90
+ export type { ListActionsProps, ListActionProps, ListOperationProps, ListEmptyViewProps, ListActionsDividerProps, } from './List';
79
91
  export { default as LocaleProvider } from './LocaleProvider';
80
92
  export * from './LocaleProvider';
81
93
  export { default as Markdown } from './Markdown';
@@ -87,6 +99,7 @@ export { default as Overlay } from './Overlay';
87
99
  export { default as PageHeader } from './PageHeader';
88
100
  export { default as Pagination } from './Pagination';
89
101
  export { default as Panel } from './Panel';
102
+ export type { PanelProps } from './Panel';
90
103
  export { default as Paragraph } from './Paragraph';
91
104
  export { default as Plaintext } from './Plaintext';
92
105
  export type { PlainTextProps } from './Plaintext';