@plesk/ui-library 3.35.0 → 3.35.2

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 (183) hide show
  1. package/cjs/components/Button/Button.js +1 -2
  2. package/cjs/components/Carousel/Carousel.js +25 -39
  3. package/cjs/components/Drawer/Header.js +71 -108
  4. package/cjs/components/Form/Form.js +5 -7
  5. package/cjs/components/FormFieldCheckbox/FormFieldCheckbox.js +8 -67
  6. package/cjs/components/Grid/Grid.js +9 -71
  7. package/cjs/components/GridCol/GridCol.js +3 -54
  8. package/cjs/components/Icon/constants.js +2 -2
  9. package/cjs/components/Icon/images/symbols.svg +15 -1
  10. package/cjs/components/Link/Link.js +1 -2
  11. package/cjs/components/List/List.js +11 -8
  12. package/cjs/components/Progress/Progress.js +8 -28
  13. package/cjs/components/ProgressDialog/ProgressDialog.js +12 -85
  14. package/cjs/components/ProgressStep/ProgressStep.js +4 -46
  15. package/cjs/components/ProgressStep/index.js +36 -12
  16. package/cjs/components/Rating/Rating.js +5 -36
  17. package/cjs/components/Skeleton/index.js +2 -2
  18. package/cjs/components/SplitButton/SplitButton.js +1 -2
  19. package/cjs/components/Switch/Switch.js +43 -118
  20. package/cjs/components/SwitchesPanel/SwitchesPanel.js +3 -26
  21. package/cjs/components/SwitchesPanelItem/SwitchesPanelItem.js +3 -57
  22. package/cjs/components/Toaster/Toaster.js +3 -3
  23. package/cjs/components/Tooltip/Tooltip.js +35 -64
  24. package/cjs/components/Translate/Translate.js +10 -78
  25. package/cjs/components/Translate/index.js +4 -4
  26. package/cjs/components/Translate/isLikeText.js +27 -0
  27. package/cjs/components/index.js +14 -11
  28. package/cjs/index.js +1 -1
  29. package/cjs/tests/index.js +13 -0
  30. package/cjs/tests/renderer.js +33 -0
  31. package/dist/images/symbols.svg +15 -1
  32. package/dist/plesk-ui-library-rtl.css +1 -1
  33. package/dist/plesk-ui-library-rtl.css.map +1 -1
  34. package/dist/plesk-ui-library.css +1 -1
  35. package/dist/plesk-ui-library.css.map +1 -1
  36. package/dist/plesk-ui-library.js +567 -1139
  37. package/dist/plesk-ui-library.js.map +1 -1
  38. package/dist/plesk-ui-library.min.js +5 -5
  39. package/dist/plesk-ui-library.min.js.map +1 -1
  40. package/esm/components/Button/Button.js +1 -2
  41. package/esm/components/Carousel/Carousel.js +25 -37
  42. package/esm/components/Drawer/Header.js +70 -107
  43. package/esm/components/Form/Form.js +5 -7
  44. package/esm/components/FormFieldCheckbox/FormFieldCheckbox.js +8 -65
  45. package/esm/components/Grid/Grid.js +9 -69
  46. package/esm/components/GridCol/GridCol.js +2 -55
  47. package/esm/components/Icon/constants.js +2 -2
  48. package/esm/components/Icon/images/symbols.svg +15 -1
  49. package/esm/components/Link/Link.js +1 -2
  50. package/esm/components/List/List.js +11 -8
  51. package/esm/components/Progress/Progress.js +8 -26
  52. package/esm/components/ProgressDialog/ProgressDialog.js +12 -83
  53. package/esm/components/ProgressStep/ProgressStep.js +6 -48
  54. package/esm/components/ProgressStep/index.js +1 -2
  55. package/esm/components/Rating/Rating.js +5 -36
  56. package/esm/components/Skeleton/index.js +2 -2
  57. package/esm/components/SplitButton/SplitButton.js +1 -2
  58. package/esm/components/Switch/Switch.js +43 -116
  59. package/esm/components/SwitchesPanel/SwitchesPanel.js +3 -24
  60. package/esm/components/SwitchesPanelItem/SwitchesPanelItem.js +3 -55
  61. package/esm/components/Toaster/Toaster.js +3 -1
  62. package/esm/components/Tooltip/Tooltip.js +36 -62
  63. package/esm/components/Translate/Translate.js +9 -73
  64. package/esm/components/Translate/index.js +2 -1
  65. package/esm/components/Translate/isLikeText.js +19 -0
  66. package/esm/components/index.js +1 -2
  67. package/esm/index.js +1 -1
  68. package/esm/tests/index.js +3 -0
  69. package/esm/tests/renderer.js +25 -0
  70. package/package.json +25 -22
  71. package/styleguide/build/bundle.6318f4a5.js +2 -0
  72. package/styleguide/images/symbols.svg +15 -1
  73. package/styleguide/index.html +2 -2
  74. package/types/src/components/Button/Button.d.ts +2 -3
  75. package/types/src/components/Carousel/Carousel.d.ts +58 -0
  76. package/types/src/components/Carousel/index.d.ts +2 -0
  77. package/types/src/components/Dialog/Dialog.d.ts +1 -1
  78. package/types/src/components/Dialog/index.d.ts +1 -1
  79. package/types/src/components/Drawer/DrawerProgress.d.ts +3 -3
  80. package/types/src/components/Drawer/Header.d.ts +4 -20
  81. package/types/src/components/Form/Form.d.ts +5 -0
  82. package/types/src/components/FormFieldCheckbox/FormFieldCheckbox.d.ts +53 -0
  83. package/types/src/components/FormFieldCheckbox/index.d.ts +2 -0
  84. package/types/src/components/FormFieldPassword/generatePassword.d.ts +2 -0
  85. package/types/src/components/Grid/Grid.d.ts +97 -0
  86. package/types/src/components/Grid/index.d.ts +2 -0
  87. package/types/src/components/GridCol/GridCol.d.ts +53 -0
  88. package/types/src/components/GridCol/index.d.ts +2 -0
  89. package/types/src/components/Icon/constants.d.ts +1 -1
  90. package/types/src/components/ItemList/index.d.ts +1 -0
  91. package/types/src/components/Link/Link.d.ts +1 -2
  92. package/types/src/components/LocaleProvider/LocaleProvider.d.ts +1 -1
  93. package/types/src/components/Pagination/index.d.ts +1 -0
  94. package/types/src/components/Panel/index.d.ts +1 -0
  95. package/types/src/components/Progress/Progress.d.ts +49 -0
  96. package/types/src/components/Progress/index.d.ts +2 -0
  97. package/types/src/components/ProgressDialog/ProgressDialog.d.ts +125 -0
  98. package/types/src/components/ProgressDialog/index.d.ts +2 -0
  99. package/types/src/components/ProgressStep/ProgressStep.d.ts +69 -0
  100. package/types/src/components/ProgressStep/index.d.ts +2 -0
  101. package/types/src/components/Rating/Rating.d.ts +27 -0
  102. package/types/src/components/Rating/index.d.ts +2 -0
  103. package/types/src/components/Skeleton/Skeleton.d.ts +3 -5
  104. package/types/src/components/Skeleton/SkeletonTabs.d.ts +4 -4
  105. package/types/src/components/Skeleton/SkeletonText.d.ts +2 -2
  106. package/types/src/components/Skeleton/index.d.ts +4 -1
  107. package/types/src/components/SplitButton/SplitButton.d.ts +1 -2
  108. package/types/src/components/Switch/Switch.d.ts +58 -0
  109. package/types/src/components/Switch/index.d.ts +2 -0
  110. package/types/src/components/SwitchesPanel/SwitchesPanel.d.ts +24 -0
  111. package/types/src/components/SwitchesPanel/index.d.ts +2 -0
  112. package/types/src/components/SwitchesPanelItem/SwitchesPanelItem.d.ts +78 -0
  113. package/types/src/components/SwitchesPanelItem/index.d.ts +2 -0
  114. package/types/src/components/TextArea/index.d.ts +1 -0
  115. package/types/src/components/Tooltip/Tooltip.d.ts +61 -0
  116. package/types/src/components/Tooltip/index.d.ts +2 -0
  117. package/types/src/components/Translate/Translate.d.ts +56 -0
  118. package/types/src/components/Translate/index.d.ts +3 -0
  119. package/types/src/components/Translate/isLikeText.d.ts +2 -0
  120. package/types/src/components/index.d.ts +15 -2
  121. package/types/src/components/utils.d.ts +1 -1
  122. package/cjs/components/Alert/Alert.stories.js +0 -34
  123. package/cjs/components/Button/Button.stories.js +0 -109
  124. package/cjs/components/Cuttable/Cuttable.stories.js +0 -46
  125. package/cjs/components/Dialog/Dialog.stories.js +0 -49
  126. package/cjs/components/Drawer/Drawer.stories.js +0 -65
  127. package/cjs/components/Form/Form.stories.js +0 -35
  128. package/cjs/components/FormFieldCheckbox/FormFieldCheckbox.stories.js +0 -32
  129. package/cjs/components/Icon/Icon.stories.js +0 -32
  130. package/cjs/components/ItemLink/ItemLink.stories.js +0 -20
  131. package/cjs/components/ItemList/ItemList.stories.js +0 -122
  132. package/cjs/components/List/List.stories.js +0 -152
  133. package/cjs/components/Markdown/Markdown.stories.js +0 -51
  134. package/cjs/components/Menu/Menu.stories.js +0 -77
  135. package/cjs/components/Popover/Popover.stories.js +0 -60
  136. package/cjs/components/Select/Select.stories.js +0 -57
  137. package/cjs/components/Skeleton/Skeleton.stories.js +0 -24
  138. package/cjs/components/Skeleton/SkeletonTabs.stories.js +0 -15
  139. package/cjs/components/Skeleton/SkeletonText.stories.js +0 -33
  140. package/cjs/components/Status/Status.stories.js +0 -19
  141. package/cjs/components/Tabs/Tabs.stories.js +0 -24
  142. package/esm/components/Alert/Alert.stories.js +0 -27
  143. package/esm/components/Button/Button.stories.js +0 -99
  144. package/esm/components/Cuttable/Cuttable.stories.js +0 -39
  145. package/esm/components/Dialog/Dialog.stories.js +0 -42
  146. package/esm/components/Drawer/Drawer.stories.js +0 -56
  147. package/esm/components/Form/Form.stories.js +0 -27
  148. package/esm/components/FormFieldCheckbox/FormFieldCheckbox.stories.js +0 -23
  149. package/esm/components/Icon/Icon.stories.js +0 -23
  150. package/esm/components/ItemLink/ItemLink.stories.js +0 -12
  151. package/esm/components/ItemList/ItemList.stories.js +0 -109
  152. package/esm/components/List/List.stories.js +0 -139
  153. package/esm/components/Markdown/Markdown.stories.js +0 -43
  154. package/esm/components/Menu/Menu.stories.js +0 -65
  155. package/esm/components/Popover/Popover.stories.js +0 -52
  156. package/esm/components/Select/Select.stories.js +0 -48
  157. package/esm/components/Skeleton/Skeleton.stories.js +0 -15
  158. package/esm/components/Skeleton/SkeletonTabs.stories.js +0 -7
  159. package/esm/components/Skeleton/SkeletonText.stories.js +0 -23
  160. package/esm/components/Status/Status.stories.js +0 -11
  161. package/esm/components/Tabs/Tabs.stories.js +0 -16
  162. package/styleguide/build/bundle.2a886a79.js +0 -2
  163. package/types/src/components/Alert/Alert.stories.d.ts +0 -11
  164. package/types/src/components/Button/Button.stories.d.ts +0 -17
  165. package/types/src/components/Cuttable/Cuttable.stories.d.ts +0 -17
  166. package/types/src/components/Dialog/Dialog.stories.d.ts +0 -25
  167. package/types/src/components/Drawer/Drawer.stories.d.ts +0 -43
  168. package/types/src/components/Form/Form.stories.d.ts +0 -13
  169. package/types/src/components/FormFieldCheckbox/FormFieldCheckbox.stories.d.ts +0 -20
  170. package/types/src/components/Icon/Icon.stories.d.ts +0 -7
  171. package/types/src/components/ItemLink/ItemLink.stories.d.ts +0 -12
  172. package/types/src/components/ItemList/ItemList.stories.d.ts +0 -172
  173. package/types/src/components/List/List.stories.d.ts +0 -30
  174. package/types/src/components/Markdown/Markdown.stories.d.ts +0 -10
  175. package/types/src/components/Menu/Menu.stories.d.ts +0 -20
  176. package/types/src/components/Popover/Popover.stories.d.ts +0 -25
  177. package/types/src/components/Select/Select.stories.d.ts +0 -12
  178. package/types/src/components/Skeleton/Skeleton.stories.d.ts +0 -15
  179. package/types/src/components/Skeleton/SkeletonTabs.stories.d.ts +0 -5
  180. package/types/src/components/Skeleton/SkeletonText.stories.d.ts +0 -23
  181. package/types/src/components/Status/Status.stories.d.ts +0 -11
  182. package/types/src/components/Tabs/Tabs.stories.d.ts +0 -10
  183. /package/styleguide/build/{bundle.2a886a79.js.LICENSE.txt → bundle.6318f4a5.js.LICENSE.txt} +0 -0
@@ -0,0 +1,125 @@
1
+ import { Component, ReactNode } from 'react';
2
+ import { ImageType } from '../Dialog';
3
+ import { ProgressProps } from '../Progress';
4
+ import '../../helpers/base.less';
5
+ import './ProgressDialog.less';
6
+ export interface ProgressDialogProps {
7
+ /**
8
+ * Toggles visibility.
9
+ * @since 1.2.0
10
+ */
11
+ isOpen?: boolean;
12
+ /**
13
+ * Banner. Renders in front of content as wide as dialog.
14
+ * @since 1.2.0
15
+ */
16
+ banner?: ImageType;
17
+ /**
18
+ * Image. Renders into content.
19
+ * @since 1.2.0
20
+ */
21
+ image?: ImageType;
22
+ /**
23
+ * Title
24
+ * @since 1.2.0
25
+ */
26
+ title?: ReactNode;
27
+ /**
28
+ * Description of the `ProgressDialog`.
29
+ * @since 1.2.0
30
+ */
31
+ description?: ReactNode;
32
+ /**
33
+ * Actions which will be shown in Dialog header.
34
+ * @since 1.2.0
35
+ */
36
+ actions?: ReactNode;
37
+ /**
38
+ * Whether the dialog should be canceled with the cancel button.
39
+ * @since 1.2.0
40
+ */
41
+ cancelable?: boolean;
42
+ /**
43
+ * The interval of time to auto close dialog when it successfully finished.
44
+ * Set `null` for disable auto close.
45
+ * @since 1.2.0
46
+ */
47
+ autoCloseTimeout?: number | null;
48
+ /**
49
+ * On cancel event handler.
50
+ * @since 1.2.0
51
+ */
52
+ onCancel?: () => void;
53
+ /**
54
+ * On close event handler.
55
+ * @since 1.2.0
56
+ */
57
+ onClose?: () => void;
58
+ /**
59
+ * On finish event handler.
60
+ * @since 1.2.0
61
+ */
62
+ onFinish?: () => void;
63
+ /**
64
+ * On fail event handler.
65
+ * @since 1.2.0
66
+ */
67
+ onFail?: () => void;
68
+ /**
69
+ * Content of the `ProgressDialog`.
70
+ * @since 1.2.0
71
+ */
72
+ children?: ReactNode;
73
+ /**
74
+ * @ignore
75
+ */
76
+ className?: string;
77
+ /**
78
+ * @ignore
79
+ */
80
+ baseClassName?: string;
81
+ }
82
+ declare type ProgressDialogState = {
83
+ isOpen: boolean;
84
+ isFinished: boolean;
85
+ isFailed: boolean;
86
+ };
87
+ /**
88
+ * `ProgressDialog` is a [Dialog](#!/Dialog) combined with of [Progress](#!/Progress) component.
89
+ * @since 1.2.0
90
+ */
91
+ declare class ProgressDialog extends Component<ProgressDialogProps, ProgressDialogState> {
92
+ static defaultProps: {
93
+ isOpen: boolean;
94
+ banner: null;
95
+ image: null;
96
+ title: null;
97
+ description: null;
98
+ actions: null;
99
+ cancelable: boolean;
100
+ autoCloseTimeout: number;
101
+ onCancel: null;
102
+ onClose: null;
103
+ onFinish: null;
104
+ onFail: null;
105
+ children: null;
106
+ className: null;
107
+ baseClassName: string;
108
+ };
109
+ static getDerivedStateFromProps({ isOpen }: ProgressDialogState): {
110
+ isOpen: boolean;
111
+ };
112
+ state: {
113
+ isOpen: boolean;
114
+ isFinished: boolean;
115
+ isFailed: boolean;
116
+ };
117
+ componentDidUpdate(_: ProgressDialogProps, prevState: ProgressDialogState): void;
118
+ componentWillUnmount(): void;
119
+ private closeTimeout;
120
+ clearCloseTimeout(): void;
121
+ handleStatusChange: ProgressProps['onStatusChange'];
122
+ handleClose: () => void;
123
+ render(): JSX.Element;
124
+ }
125
+ export default ProgressDialog;
@@ -0,0 +1,2 @@
1
+ export { default } from './ProgressDialog';
2
+ export type { ProgressDialogProps } from './ProgressDialog';
@@ -0,0 +1,69 @@
1
+ import { ReactNode } from 'react';
2
+ import { IconName, IconProps } from '../Icon';
3
+ import '../../helpers/base.less';
4
+ import './ProgressStep.less';
5
+ export declare const STATUS_NOT_STARTED = "not_started";
6
+ export declare const STATUS_RUNNING = "running";
7
+ export declare const STATUS_DONE = "done";
8
+ export declare const STATUS_WARNING = "warning";
9
+ export declare const STATUS_ERROR = "error";
10
+ export declare const STATUS_CANCELED = "canceled";
11
+ export declare type Status = typeof STATUS_NOT_STARTED | typeof STATUS_RUNNING | typeof STATUS_DONE | typeof STATUS_ERROR | typeof STATUS_CANCELED | typeof STATUS_WARNING;
12
+ export interface ProgressStepProps {
13
+ /**
14
+ * Title of the step
15
+ * @since 1.10.0
16
+ */
17
+ title?: ReactNode;
18
+ /**
19
+ * Status for the step
20
+ * @since 1.10.0
21
+ */
22
+ status?: Status;
23
+ /**
24
+ * Name of icon or [Icon](#!/Icon) component
25
+ * @ignore
26
+ */
27
+ icon?: ReactNode | IconName | IconProps;
28
+ /**
29
+ * Text description for the status of the step
30
+ * @since 1.10.0
31
+ */
32
+ statusText?: ReactNode;
33
+ /**
34
+ * Progress indication in numbers
35
+ * @since 1.10.0
36
+ */
37
+ progress?: number;
38
+ /**
39
+ * Content of the `ProgressStep`.
40
+ * @since 1.10.0
41
+ */
42
+ children?: ReactNode;
43
+ /**
44
+ * @ignore
45
+ */
46
+ className?: string;
47
+ /**
48
+ * @ignore
49
+ */
50
+ baseClassName?: string;
51
+ }
52
+ /**
53
+ * `ProgressStep` is a part of the [Progress](#!/Progress) component.
54
+ * @since 1.10.0
55
+ */
56
+ declare const ProgressStep: {
57
+ ({ className, children, icon, title, statusText, progress, status, baseClassName, ...props }: ProgressStepProps): JSX.Element;
58
+ defaultProps: {
59
+ icon: null;
60
+ title: null;
61
+ status: string;
62
+ statusText: null;
63
+ progress: number;
64
+ children: null;
65
+ className: null;
66
+ baseClassName: string;
67
+ };
68
+ };
69
+ export default ProgressStep;
@@ -0,0 +1,2 @@
1
+ export type { Status, ProgressStepProps } from './ProgressStep';
2
+ export { default, STATUS_RUNNING, STATUS_DONE, STATUS_ERROR, STATUS_WARNING, STATUS_CANCELED, STATUS_NOT_STARTED, } from './ProgressStep';
@@ -0,0 +1,27 @@
1
+ import './Rating.less';
2
+ export interface RatingProps {
3
+ /**
4
+ * Rating value from 0 to 5.
5
+ * @since 0.0.42
6
+ */
7
+ value?: number;
8
+ /**
9
+ * Small variant.
10
+ * @since 0.0.42
11
+ */
12
+ small?: boolean;
13
+ /**
14
+ * @ignore
15
+ */
16
+ className?: string;
17
+ /**
18
+ * @ignore
19
+ */
20
+ baseClassName?: string;
21
+ }
22
+ /**
23
+ * `Rating` component is used for showing and collecting feedback of users' opinion in 0-5 grade scale.
24
+ * @since 0.0.42
25
+ */
26
+ declare const Rating: ({ baseClassName, className, value, small, ...props }: RatingProps) => JSX.Element;
27
+ export default Rating;
@@ -0,0 +1,2 @@
1
+ export { default } from './Rating';
2
+ export type { RatingProps } from './Rating';
@@ -1,4 +1,4 @@
1
- import { ComponentType, FC, JSX } from 'react';
1
+ import { ComponentType, FC, JSX, CSSProperties } from 'react';
2
2
  import './Skeleton.less';
3
3
  export declare type SkeletonProps = {
4
4
  /**
@@ -20,12 +20,10 @@ export declare type SkeletonProps = {
20
20
  */
21
21
  height?: number | string;
22
22
  /**
23
- * custom styles for skeleton
23
+ * Custom styles for skeleton
24
24
  * @since 3.28.0
25
25
  */
26
- style?: {
27
- [key: string]: string;
28
- };
26
+ style?: CSSProperties;
29
27
  /**
30
28
  * Component to render as the root element.
31
29
  * @since 3.28.0
@@ -1,6 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import './SkeletonTabs.less';
3
- declare type SkeletonTabsProps = {
3
+ export interface SkeletonTabsProps {
4
4
  /**
5
5
  * Number of tabs
6
6
  * @since 3.28.0
@@ -9,12 +9,12 @@ declare type SkeletonTabsProps = {
9
9
  /**
10
10
  * @ignore
11
11
  */
12
- className: string;
12
+ className?: string;
13
13
  /**
14
14
  * @ignore
15
15
  */
16
- baseClassName: string;
17
- };
16
+ baseClassName?: string;
17
+ }
18
18
  /**
19
19
  * Skeleton for tabs component
20
20
  * @since `3.28.0
@@ -1,7 +1,7 @@
1
1
  import { FC, ComponentType, JSX } from 'react';
2
2
  import { SkeletonProps } from './Skeleton';
3
3
  import './SkeletonText.less';
4
- declare type SkeletonTextProps = {
4
+ export interface SkeletonTextProps {
5
5
  /**
6
6
  * Number of rows
7
7
  * @since 3.28.0
@@ -25,7 +25,7 @@ declare type SkeletonTextProps = {
25
25
  * @ignore
26
26
  */
27
27
  className?: string;
28
- };
28
+ }
29
29
  /**
30
30
  * Skeleton for text-containing components. Is can be used inside Paragraph, as title, or single text
31
31
  * @since 3.28.0
@@ -1,3 +1,6 @@
1
1
  export { default } from './Skeleton';
2
- export { default as SkeletonText } from './SkeletonText';
2
+ export type { SkeletonProps } from './Skeleton';
3
3
  export { default as SkeletonTabs } from './SkeletonTabs';
4
+ export type { SkeletonTabsProps } from './SkeletonTabs';
5
+ export { default as SkeletonText } from './SkeletonText';
6
+ export type { SkeletonTextProps } from './SkeletonText';
@@ -46,8 +46,7 @@ export interface SplitButtonProps {
46
46
  * `Split Button` is a combination of a standard [Button](#!/Button) with a [Dropdown](#!/Dropdown) menu.
47
47
  * It is used for grouping several related actions when one of the actions should be accessible immediately
48
48
  * because it is used more often than others.
49
- *
50
- * Since: 0.0.40
49
+ * @since 0.0.40
51
50
  */
52
51
  declare const SplitButton: ({ baseClassName, className, menu, children, onClick, onKeyDown, icon, size, ...props }: SplitButtonProps) => JSX.Element;
53
52
  export default SplitButton;
@@ -0,0 +1,58 @@
1
+ import { ReactNode } from 'react';
2
+ import './Switch.less';
3
+ export interface SwitchProps {
4
+ /**
5
+ * Determine whether the `Switch` is checked.
6
+ * @since 0.0.42
7
+ */
8
+ checked?: boolean;
9
+ /**
10
+ * A callback function, can be executed when the checked state is changing.
11
+ * @since 0.0.42
12
+ */
13
+ onChange?: (checked: boolean) => void;
14
+ /**
15
+ * Tooltip for component
16
+ * @since 0.0.42
17
+ */
18
+ tooltip?: ReactNode;
19
+ /**
20
+ * Visual intent color to apply to component.
21
+ * @since 0.3.0
22
+ */
23
+ intent?: 'warning' | 'danger';
24
+ /**
25
+ * Is `Switch` disabled?
26
+ * @since 0.0.42
27
+ */
28
+ disabled?: boolean;
29
+ /**
30
+ * Loading indication
31
+ * @since 0.3.0
32
+ */
33
+ loading?: boolean;
34
+ /**
35
+ * Label of the `Switch`
36
+ * @since 0.0.42
37
+ */
38
+ children?: ReactNode;
39
+ /**
40
+ * @ignore
41
+ */
42
+ defaultChecked?: boolean;
43
+ /**
44
+ * @ignore
45
+ */
46
+ className?: string;
47
+ /**
48
+ * @ignore
49
+ */
50
+ baseClassName?: string;
51
+ }
52
+ /**
53
+ * `Switch` component is used for changing the state of an object or system preferences.
54
+ * It provides immediate results that is why it should not be used in Form.
55
+ * @since 0.0.42
56
+ */
57
+ declare const Switch: ({ className, children, onChange, tooltip, intent, checked, defaultChecked, baseClassName, disabled, loading, ...props }: SwitchProps) => JSX.Element;
58
+ export default Switch;
@@ -0,0 +1,2 @@
1
+ export { default } from './Switch';
2
+ export type { SwitchProps } from './Switch';
@@ -0,0 +1,24 @@
1
+ import { ReactElement } from 'react';
2
+ import '../../helpers/base.less';
3
+ import './SwitchesPanel.less';
4
+ export interface SwitchesPanelProps {
5
+ /**
6
+ * Content of the `SwitchesPanel`. Recommended to use [SwitchesPanelItem](#!/SwitchesPanelItem) components.
7
+ * @since 0.3.0
8
+ */
9
+ children?: ReactElement[] | ReactElement;
10
+ /**
11
+ * @ignore
12
+ */
13
+ className?: string;
14
+ /**
15
+ * @ignore
16
+ */
17
+ baseClassName?: string;
18
+ }
19
+ /**
20
+ * `SwitchesPanel` component is used for grouping several [SwitchesPanelItems](#!/SwitchesPanelItem) into one set.
21
+ * @since 0.3.0
22
+ */
23
+ declare const SwitchesPanel: ({ baseClassName, className, children, ...props }: SwitchesPanelProps) => JSX.Element;
24
+ export default SwitchesPanel;
@@ -0,0 +1,2 @@
1
+ export { default } from './SwitchesPanel';
2
+ export type { SwitchesPanelProps } from './SwitchesPanel';
@@ -0,0 +1,78 @@
1
+ import { Component, ReactNode } from 'react';
2
+ import { SwitchProps } from '../Switch';
3
+ import '../../helpers/base.less';
4
+ import './SwitchesPanelItem.less';
5
+ export interface SwitchesPanelItemProps {
6
+ /**
7
+ * A callback function, can be executed when the checked state is changing.
8
+ * @since 0.3.0
9
+ */
10
+ onChange: (checked: boolean) => void;
11
+ /**
12
+ * Title of the `SwitchesPanelItem`. Must be no longer than two lines.
13
+ * @since 0.3.0
14
+ */
15
+ title: ReactNode;
16
+ /**
17
+ * @ignore
18
+ */
19
+ defaultChecked?: boolean;
20
+ /**
21
+ * Visual intent color to apply to component.
22
+ * @since 0.3.0
23
+ */
24
+ intent?: 'warning' | 'danger';
25
+ /**
26
+ * `SwitchesPanelItem` description. Must be no longer than three lines.
27
+ * @since 0.3.0
28
+ */
29
+ description?: ReactNode;
30
+ /**
31
+ * Rich full description of the `SwitchesPanelItem`.
32
+ * Adds control button with question mark that shows `Popover` on click.
33
+ * @since 0.3.0
34
+ */
35
+ fullDescription?: ReactNode;
36
+ /**
37
+ * Props of underlying [Switch](#!/Switch) component.
38
+ * @since 0.5.0
39
+ */
40
+ switchProps?: SwitchProps;
41
+ /**
42
+ * Content of the control actions.
43
+ * Don't place here more than three buttons (with the one from 'fullDescription' property) or one link and one button.
44
+ * @since 0.3.0
45
+ */
46
+ children: ReactNode;
47
+ /**
48
+ * @ignore
49
+ */
50
+ className?: string;
51
+ /**
52
+ * @ignore
53
+ */
54
+ baseClassName?: string;
55
+ }
56
+ /**
57
+ * `SwitchesPanelItem` component is used for combining [Switch](#!/Switch) component with text title and description.
58
+ * Used in [SwitchesPanel](#!/SwitchesPanel).
59
+ * @since 0.3.0
60
+ */
61
+ declare class SwitchesPanelItem extends Component<SwitchesPanelItemProps> {
62
+ static defaultProps: {
63
+ defaultChecked: boolean;
64
+ intent: null;
65
+ description: null;
66
+ fullDescription: null;
67
+ switchProps: {};
68
+ children: null;
69
+ className: null;
70
+ baseClassName: string;
71
+ };
72
+ state: {
73
+ checked: boolean | undefined;
74
+ };
75
+ handleChange: (checked: boolean) => void;
76
+ render(): JSX.Element;
77
+ }
78
+ export default SwitchesPanelItem;
@@ -0,0 +1,2 @@
1
+ export { default } from './SwitchesPanelItem';
2
+ export type { SwitchesPanelItemProps } from './SwitchesPanelItem';
@@ -0,0 +1 @@
1
+ export { default } from './TextArea';
@@ -0,0 +1,61 @@
1
+ import { Component, CSSProperties, MouseEvent, ReactElement, ReactNode } from 'react';
2
+ import './Tooltip.less';
3
+ export interface TooltipProps {
4
+ /**
5
+ * Content of the tooltip
6
+ * @since 0.0.42
7
+ */
8
+ title: ReactNode;
9
+ /**
10
+ * Element with tooltip
11
+ * @since 0.0.42
12
+ */
13
+ children: ReactElement;
14
+ /**
15
+ * Show delay (ms)
16
+ * @since 0.0.50
17
+ */
18
+ delay?: number;
19
+ /**
20
+ * @ignore
21
+ */
22
+ style?: CSSProperties;
23
+ /**
24
+ * @ignore
25
+ */
26
+ className?: string;
27
+ /**
28
+ * @ignore
29
+ */
30
+ baseClassName?: string;
31
+ }
32
+ /**
33
+ * `Tooltip` component is used for providing information about an interface element
34
+ * while user hovers the pointer over the element.
35
+ * @since 0.0.35
36
+ */
37
+ declare class Tooltip extends Component<TooltipProps> {
38
+ static defaultProps: {
39
+ delay: number;
40
+ style: undefined;
41
+ className: undefined;
42
+ baseClassName: string;
43
+ };
44
+ state: {
45
+ left: number;
46
+ top: number;
47
+ ready: boolean;
48
+ visible: boolean;
49
+ };
50
+ componentWillUnmount(): void;
51
+ private timer;
52
+ private tooltipRef;
53
+ clearTimer: () => void;
54
+ handleShow: () => void;
55
+ handleHide: () => void;
56
+ handleMouseEnter: () => void;
57
+ handleMouseMove: (e: MouseEvent) => void;
58
+ renderTooltip(): JSX.Element;
59
+ render(): JSX.Element;
60
+ }
61
+ export default Tooltip;
@@ -0,0 +1,2 @@
1
+ export { default } from './Tooltip';
2
+ export type { TooltipProps } from './Tooltip';
@@ -0,0 +1,56 @@
1
+ import { ElementType, ReactNode } from 'react';
2
+ import { PolymorphicComponentProps } from '../../utils/types';
3
+ interface BaseTranslateProps {
4
+ /**
5
+ * A some prefix for the message key.
6
+ * @since 2.6.0
7
+ */
8
+ namespace?: string;
9
+ /**
10
+ * Translatable content or message key.
11
+ * @since 0.0.42
12
+ */
13
+ content?: string;
14
+ /**
15
+ * Message params
16
+ * @since 0.0.42
17
+ */
18
+ params?: {
19
+ [key: string]: ReactNode;
20
+ };
21
+ /**
22
+ * Fallback translation value.
23
+ * @since 0.0.47
24
+ */
25
+ fallback?: string;
26
+ /**
27
+ * A set of translation messages. If the set contains a message key, the component uses an item from the set for rendering.
28
+ * @ignore
29
+ */
30
+ translators?: {
31
+ [key: string]: ReactNode;
32
+ };
33
+ /**
34
+ * @ignore
35
+ */
36
+ unsafe?: boolean;
37
+ /**
38
+ * @ignore
39
+ */
40
+ children?: string;
41
+ }
42
+ export declare type TranslateProps<Component extends ElementType = 'span'> = {
43
+ /**
44
+ * Component to render as the root element. Useful when rendering a `Translate` as `<option>`.
45
+ * @since 0.0.42
46
+ * @type ElementType
47
+ * @default span
48
+ */
49
+ component?: Component;
50
+ } & PolymorphicComponentProps<Component, BaseTranslateProps>;
51
+ /**
52
+ * `Translate` component.
53
+ * @since 0.0.42
54
+ */
55
+ declare const Translate: <Component extends ElementType<any> = "span">({ component, content, children, params, unsafe, fallback, namespace, translators, ...props }: TranslateProps<Component>) => any;
56
+ export default Translate;
@@ -0,0 +1,3 @@
1
+ export { default } from './Translate';
2
+ export { isLikeText } from './isLikeText';
3
+ export type { TranslateProps } from './Translate';
@@ -0,0 +1,2 @@
1
+ import { ReactNode } from 'react';
2
+ export declare const isLikeText: (node: ReactNode) => boolean;