@plesk/ui-library 3.34.2 → 3.35.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 (76) hide show
  1. package/cjs/components/ContentLoader/IconsLoader.js +1 -2
  2. package/cjs/components/Dropdown/Dropdown.js +0 -2
  3. package/cjs/components/Dropdown/index.js +15 -2
  4. package/cjs/components/Figure/Figure.js +1 -33
  5. package/cjs/components/Figure/index.js +15 -2
  6. package/cjs/components/Form/Form.js +3 -3
  7. package/cjs/components/Form/ScrollableElementFormContext.js +1 -1
  8. package/cjs/components/Form/index.js +19 -3
  9. package/cjs/components/FormFieldPassword/PasswordMeter.js +4 -4
  10. package/cjs/components/Icon/constants.js +2 -2
  11. package/cjs/components/Icon/images/symbols.svg +9 -1
  12. package/cjs/components/Link/Link.js +11 -18
  13. package/cjs/components/Overlay/Overlay.js +3 -4
  14. package/cjs/components/Popper/Popper.js +14 -79
  15. package/cjs/components/Popper/index.js +15 -2
  16. package/cjs/components/Section/Section.js +1 -2
  17. package/cjs/components/Skeleton/SkeletonText.js +1 -1
  18. package/cjs/components/SplitButton/SplitButton.js +10 -49
  19. package/cjs/components/SplitButton/index.js +15 -2
  20. package/cjs/components/utils.js +1 -1
  21. package/cjs/index.js +1 -1
  22. package/dist/images/symbols.svg +9 -1
  23. package/dist/plesk-ui-library-rtl.css.map +1 -1
  24. package/dist/plesk-ui-library.css.map +1 -1
  25. package/dist/plesk-ui-library.js +181 -261
  26. package/dist/plesk-ui-library.js.map +1 -1
  27. package/dist/plesk-ui-library.min.js +5 -5
  28. package/dist/plesk-ui-library.min.js.map +1 -1
  29. package/esm/components/ContentLoader/IconsLoader.js +1 -2
  30. package/esm/components/Dropdown/Dropdown.js +0 -2
  31. package/esm/components/Dropdown/index.js +2 -1
  32. package/esm/components/Figure/Figure.js +1 -33
  33. package/esm/components/Figure/index.js +2 -1
  34. package/esm/components/Form/Form.js +3 -3
  35. package/esm/components/Form/ScrollableElementFormContext.js +1 -1
  36. package/esm/components/Form/index.js +1 -0
  37. package/esm/components/FormFieldPassword/PasswordMeter.js +4 -4
  38. package/esm/components/Icon/constants.js +2 -2
  39. package/esm/components/Icon/images/symbols.svg +9 -1
  40. package/esm/components/Link/Link.js +11 -18
  41. package/esm/components/Overlay/Overlay.js +3 -4
  42. package/esm/components/Popper/Popper.js +14 -79
  43. package/esm/components/Popper/index.js +2 -1
  44. package/esm/components/Section/Section.js +1 -2
  45. package/esm/components/Skeleton/SkeletonText.js +1 -1
  46. package/esm/components/SplitButton/SplitButton.js +10 -47
  47. package/esm/components/SplitButton/index.js +2 -1
  48. package/esm/components/utils.js +1 -1
  49. package/esm/index.js +1 -1
  50. package/package.json +10 -13
  51. package/styleguide/build/bundle.2a886a79.js +2 -0
  52. package/styleguide/images/symbols.svg +9 -1
  53. package/styleguide/index.html +2 -2
  54. package/types/src/components/ButtonGroup/ButtonGroup.d.ts +2 -2
  55. package/types/src/components/Dialog/Dialog.d.ts +29 -9
  56. package/types/src/components/Drawer/Drawer.d.ts +10 -12
  57. package/types/src/components/Dropdown/Dropdown.d.ts +3 -4
  58. package/types/src/components/Dropdown/index.d.ts +2 -0
  59. package/types/src/components/Figure/Figure.d.ts +28 -0
  60. package/types/src/components/Figure/index.d.ts +2 -0
  61. package/types/src/components/Form/Form.d.ts +8 -103
  62. package/types/src/components/Form/ScrollableElementFormContext.d.ts +2 -0
  63. package/types/src/components/Form/index.d.ts +1 -0
  64. package/types/src/components/Form/types.d.ts +5 -3
  65. package/types/src/components/Icon/constants.d.ts +1 -1
  66. package/types/src/components/Link/Link.d.ts +14 -12
  67. package/types/src/components/Link/index.d.ts +1 -0
  68. package/types/src/components/Overlay/Overlay.d.ts +1 -1
  69. package/types/src/components/Popper/Popper.d.ts +96 -0
  70. package/types/src/components/Popper/index.d.ts +2 -0
  71. package/types/src/components/SplitButton/SplitButton.d.ts +53 -0
  72. package/types/src/components/SplitButton/index.d.ts +2 -0
  73. package/types/src/components/index.d.ts +6 -0
  74. package/types/src/components/utils.d.ts +6 -4
  75. package/styleguide/build/bundle.70f167a3.js +0 -2
  76. /package/styleguide/build/{bundle.70f167a3.js.LICENSE.txt → bundle.2a886a79.js.LICENSE.txt} +0 -0
@@ -1,4 +1,4 @@
1
- <svg width="16" height="11712" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
1
+ <svg width="16" height="11760" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
2
2
  <defs>
3
3
  <symbol viewBox="0 0 12 12" id="archive:12">
4
4
  <path d="M2 1h7v.5a.5.5 0 0 0 1 0V1a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1v-.5a.5.5 0 0 0-1 0v.5H2V1z" />
@@ -181,6 +181,14 @@
181
181
  <path d="M4.145 11.855a.496.496 0 0 1 0-.702L13.298 2H9.5a.5.5 0 0 1 0-1h5.002a.495.495 0 0 1 .498.5v5a.5.5 0 0 1-1 0V2.702l-9.153 9.153a.496.496 0 0 1-.702 0z" />
182
182
  <path d="M1.5 15a.5.5 0 0 1-.5-.5v-13a.5.5 0 0 1 1 0V14h12.5a.5.5 0 0 1 0 1h-13z" />
183
183
  </symbol>
184
+ <symbol viewBox="0 0 12 12" id="bar-chart-vertical-lock:12">
185
+ <path d="M4 .5a.5.5 0 0 1 1 0v9a.5.5 0 0 1-1 0v-9zM1.5 5a.5.5 0 0 0-.5.5v4a.5.5 0 0 0 1 0v-4a.5.5 0 0 0-.5-.5zM.5 11a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1h-5zM7.5 3a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 1 0v-1a.5.5 0 0 0-.5-.5zM10 1.5a.5.5 0 0 1 1 0v3a.5.5 0 0 1-1 0v-3z" />
186
+ <path d="M7 9a1 1 0 0 1 1-1V7a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V9zm3-1V7H9v1h1z" />
187
+ </symbol>
188
+ <symbol viewBox="0 0 16 16" id="bar-chart-vertical-lock:16">
189
+ <path d="M13 .5a.5.5 0 0 1 1 0v7a.5.5 0 0 1-1 0v-7zM4.5 2a.5.5 0 0 0-.5.5v11a.5.5 0 0 0 1 0v-11a.5.5 0 0 0-.5-.5zM1 9.5a.5.5 0 0 1 1 0v4a.5.5 0 0 1-1 0v-4zm-1 6a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 0 1h-8a.5.5 0 0 1-.5-.5zm7-9a.5.5 0 0 1 1 0v7a.5.5 0 0 1-1 0v-7zM10.5 4a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 1 0v-3a.5.5 0 0 0-.5-.5z" />
190
+ <path d="M10 12a1 1 0 0 1 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-3a1 1 0 0 1-1-1v-3zm3-1v-1h-1v1h1z" />
191
+ </symbol>
184
192
  <symbol viewBox="0 0 12 12" id="bar-chart-vertical:12">
185
193
  <path d="M0 11.5a.5.5 0 01.5-.5h11a.5.5 0 010 1H.5a.5.5 0 01-.5-.5zM1 5.5a.5.5 0 011 0v4a.5.5 0 01-1 0v-4zM4 .5a.5.5 0 011 0v9a.5.5 0 01-1 0v-9zM7 4.5a.5.5 0 011 0v5a.5.5 0 01-1 0v-5zM10 2.5a.5.5 0 011 0v7a.5.5 0 01-1 0v-7z" />
186
194
  </symbol>
@@ -4,7 +4,7 @@
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
7
- <title>Plesk UI Library 3.34.2</title>
7
+ <title>Plesk UI Library 3.35.0</title>
8
8
  <meta name="msapplication-TileColor" content="#da532c">
9
9
  <meta name="theme-color" content="#ffffff">
10
10
  <link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
@@ -26,6 +26,6 @@
26
26
  <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KWST26V"
27
27
  height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
28
28
  <!-- End Google Tag Manager (noscript) -->
29
- <script src="build/bundle.70f167a3.js"></script>
29
+ <script src="build/bundle.2a886a79.js"></script>
30
30
  </body>
31
31
  </html>
@@ -1,4 +1,4 @@
1
- import { FunctionComponent, ReactNode, Ref } from 'react';
1
+ import { FunctionComponent, ReactNode, Ref, HTMLAttributes } from 'react';
2
2
  import './ButtonGroup.less';
3
3
  declare type ButtonGroupProps = {
4
4
  /**
@@ -18,7 +18,7 @@ declare type ButtonGroupProps = {
18
18
  * @ignore
19
19
  */
20
20
  innerRef?: Ref<HTMLDivElement>;
21
- };
21
+ } & HTMLAttributes<HTMLDivElement>;
22
22
  /**
23
23
  * `ButtonGroup` component is used for visual grouping of several [Buttons](#!/Button) together.
24
24
  * @since 0.0.37
@@ -1,11 +1,11 @@
1
- import { FunctionComponent, ReactNode, HTMLAttributes, ComponentProps, ReactElement, CSSProperties } from 'react';
1
+ import { ReactNode, HTMLAttributes, ReactElement, CSSProperties } from 'react';
2
2
  import { OverlayProps } from '../Overlay';
3
- import Form from '../Form';
3
+ import Form, { FormProps, FormValues } from '../Form';
4
4
  import { ButtonProps } from '../Button';
5
5
  import '../../helpers/base.less';
6
6
  import './Dialog.less';
7
7
  declare type ImageType = string | ReactElement | HTMLAttributes<HTMLImageElement>;
8
- export declare type DialogProps = {
8
+ export declare type DialogProps<FV extends FormValues = FormValues> = {
9
9
  /**
10
10
  * Toggles visibility.
11
11
  * @since 0.0.68
@@ -71,13 +71,9 @@ export declare type DialogProps = {
71
71
  actions?: ReactNode;
72
72
  /**
73
73
  * Wraps children into [Form](#!/Form) if not empty.
74
- * @type ComponentProps<typeof Form> | typeof Form
75
74
  * @since 0.0.68
76
75
  */
77
- form?: (Omit<ComponentProps<typeof Form>, 'values' | 'onSubmit'> & {
78
- values?: any;
79
- onSubmit?: any;
80
- }) | typeof Form;
76
+ form?: FormProps<FV> | typeof Form;
81
77
  /**
82
78
  * Dialog width
83
79
  * @since 0.0.68
@@ -122,5 +118,29 @@ export declare type DialogProps = {
122
118
  * `Dialog` is a modal window that asks users to make a decision or enter additional information.
123
119
  * @since 0.0.68
124
120
  */
125
- declare const Dialog: FunctionComponent<DialogProps>;
121
+ declare const Dialog: {
122
+ <FV extends FormValues = FormValues>({ baseClassName, className, children, actions, isOpen, banner, image, title, subtitle, cancelTitle, cancelButton, buttons, form, size, closable, onClose, closingConfirmation, canClose, ...props }: DialogProps<FV>): JSX.Element;
123
+ defaultProps: {
124
+ isOpen: boolean;
125
+ banner: undefined;
126
+ sideBanner: undefined;
127
+ sideBannerContainer: undefined;
128
+ image: undefined;
129
+ title: undefined;
130
+ subtitle: undefined;
131
+ cancelTitle: undefined;
132
+ cancelButton: undefined;
133
+ buttons: undefined;
134
+ actions: undefined;
135
+ form: undefined;
136
+ size: string;
137
+ closable: boolean;
138
+ canClose: boolean;
139
+ onClose: undefined;
140
+ closingConfirmation: undefined;
141
+ children: undefined;
142
+ className: undefined;
143
+ baseClassName: string;
144
+ };
145
+ };
126
146
  export default Dialog;
@@ -1,9 +1,9 @@
1
- import { ReactNode, ReactElement, HTMLAttributes, FunctionComponent, ComponentProps, CSSProperties } from 'react';
2
- import Form from '../Form';
1
+ import { ReactNode, ReactElement, HTMLAttributes, CSSProperties } from 'react';
2
+ import Form, { FormProps, FormValues } from '../Form';
3
3
  import { DrawerProgressProps } from './DrawerProgress';
4
4
  import '../../helpers/base.less';
5
5
  import './Drawer.less';
6
- export interface DrawerProps {
6
+ export interface DrawerProps<FV extends FormValues = FormValues> {
7
7
  /**
8
8
  * Toggles visibility.
9
9
  * @since 0.0.65
@@ -58,14 +58,9 @@ export interface DrawerProps {
58
58
  /**
59
59
  * Wraps children into [Form](#!/Form) if not empty.<br>
60
60
  * **Note:** in case of *element* you should take care of providing additional form props from [Drawer](#!/Drawer) through your custom component. See example below for more details
61
- *
62
- * @type ComponentProps<typeof Form> | typeof Form
63
61
  * @since 0.0.66
64
62
  */
65
- form?: (Omit<ComponentProps<typeof Form>, 'values' | 'onSubmit'> & {
66
- values?: any;
67
- onSubmit?: any;
68
- }) | typeof Form;
63
+ form?: FormProps<FV> | typeof Form;
69
64
  /**
70
65
  * Block with an image, placed at the side of the component
71
66
  * @type string | ReactElement | HTMLAttributes<HTMLImageElement>
@@ -78,7 +73,7 @@ export interface DrawerProps {
78
73
  */
79
74
  sideBannerContainer?: {
80
75
  background: string;
81
- align: CSSProperties['alignItems'];
76
+ align?: CSSProperties['alignItems'];
82
77
  };
83
78
  /**
84
79
  * Content of the `Drawer`.
@@ -89,7 +84,7 @@ export interface DrawerProps {
89
84
  * Adds [Progress](#!/Progress) into footer.
90
85
  * @since 1.11.0
91
86
  */
92
- progress?: DrawerProgressProps;
87
+ progress?: DrawerProgressProps | null;
93
88
  /**
94
89
  * @ignore
95
90
  */
@@ -104,5 +99,8 @@ export interface DrawerProps {
104
99
  * [Read more when to use Drawer](#!/Drawers%2C%20pages%2C%20popovers).
105
100
  * @since 0.0.65
106
101
  */
107
- declare const Drawer: FunctionComponent<DrawerProps>;
102
+ declare const Drawer: {
103
+ <FV extends FormValues = FormValues>({ baseClassName, className, children, title, subtitle, backButton, hideButton, tabs, onClose, form, progress, closingConfirmation, ...props }: DrawerProps<FV>): JSX.Element;
104
+ defaultProps: Partial<DrawerProps<FormValues>>;
105
+ };
108
106
  export default Drawer;
@@ -2,10 +2,9 @@ import { ReactNode, ReactElement, FunctionComponent, ReactChild } from 'react';
2
2
  import '../../helpers/base.less';
3
3
  import '../Menu/Menu.less';
4
4
  import './Dropdown.less';
5
- declare type PlacementSide = 'top' | 'right' | 'bottom' | 'left';
6
- declare type PlacementAlign = 'start' | 'end';
7
- export declare type PopoverPlacement = `${PlacementSide}-${PlacementAlign}` | PlacementSide | 'auto';
8
- interface DropdownProps {
5
+ import { Placement } from 'popper.js';
6
+ export declare type PopoverPlacement = Placement;
7
+ export interface DropdownProps {
9
8
  /**
10
9
  * Dropdown [menu](#!/Menu).
11
10
  * @type ReactElement
@@ -0,0 +1,2 @@
1
+ export { default } from './Dropdown';
2
+ export * from './Dropdown';
@@ -0,0 +1,28 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import './Figure.less';
3
+ export interface FigureProps extends HTMLAttributes<HTMLElement> {
4
+ /**
5
+ * External link
6
+ * @since 0.0.42
7
+ */
8
+ href?: string;
9
+ /**
10
+ * Bottom content
11
+ * @since 0.0.42
12
+ */
13
+ caption?: ReactNode;
14
+ /**
15
+ * @ignore
16
+ */
17
+ baseClassName?: string;
18
+ /**
19
+ * @ignore
20
+ */
21
+ className?: string;
22
+ }
23
+ /**
24
+ * Figure component.
25
+ * @since 0.0.42
26
+ */
27
+ declare const Figure: ({ baseClassName, className, href, caption, children, ...props }: FigureProps) => JSX.Element;
28
+ export default Figure;
@@ -0,0 +1,2 @@
1
+ export { default } from './Figure';
2
+ export * from './Figure';
@@ -1,4 +1,4 @@
1
- import { ReactNode, ReactElement, MutableRefObject, HTMLProps } from 'react';
1
+ import { ReactNode, ReactElement, MutableRefObject, HTMLProps, ForwardedRef } from 'react';
2
2
  import { ButtonProps } from '../Button';
3
3
  import { FormInstanceHandles, FormValues, FormErrors } from './types';
4
4
  import './Form.less';
@@ -58,7 +58,7 @@ export declare type FormProps<FV extends FormValues> = {
58
58
  * A callback function, can be executed when some field value is changing.
59
59
  * @since 3.1.0
60
60
  */
61
- onFieldChange?: (name: string, value: any) => void;
61
+ onFieldChange?: <Key extends keyof FV>(name: Key, value: FV[Key]) => void;
62
62
  /**
63
63
  * Submit handler
64
64
  * @since 0.0.54
@@ -97,104 +97,9 @@ export declare type FormProps<FV extends FormValues> = {
97
97
  */
98
98
  innerRef?: MutableRefObject<null | HTMLFormElement>;
99
99
  } & Omit<HTMLProps<HTMLFormElement>, 'onSubmit' | 'ref'>;
100
- /**
101
- * `Form` component is used for entering and submitting of user data.
102
- * [More details about designing of forms.](#!/Good%20Forms)
103
- * @since 0.0.54
104
- */
105
- declare const RefForwardingForm: import("react").ForwardRefExoticComponent<{
106
- /**
107
- * Required mark.
108
- * @since 0.0.54
109
- */
110
- requiredMark?: ReactNode;
111
- /**
112
- * Hide required legend.
113
- * @ignore
114
- * @deprecated
115
- */
116
- hideRequiredLegend?: boolean | undefined;
117
- /**
118
- * Form values.
119
- * @since 0.0.57
120
- */
121
- values?: FormValues | undefined;
122
- /**
123
- * Form errors.
124
- * @since 0.0.57
125
- */
126
- errors?: FormErrors | undefined;
127
- /**
128
- * Current active state
129
- * @since 0.0.59
130
- */
131
- state?: "cancel" | "submit" | "apply" | undefined;
132
- /**
133
- * Content of the `Form`.
134
- * @since 0.0.54
135
- */
136
- children?: ReactNode;
137
- /**
138
- * Submit button visibility or custom configuration
139
- * @since 0.0.58
140
- */
141
- submitButton?: boolean | Partial<ButtonProps<"button">> | undefined;
142
- /**
143
- * Apply button visibility or custom configuration
144
- * @since 0.0.58
145
- */
146
- applyButton?: boolean | Partial<ButtonProps<"button">> | undefined;
147
- /**
148
- * Cancel button visibility or custom configuration
149
- * @since 0.0.58
150
- */
151
- cancelButton?: boolean | Partial<ButtonProps<"button">> | undefined;
152
- /**
153
- * Additional buttons
154
- * @since 0.0.58
155
- */
156
- additionalButtons?: ReactNode[] | undefined;
157
- /**
158
- * A callback function, can be executed when some field value is changing.
159
- * @since 3.1.0
160
- */
161
- onFieldChange?: ((name: string, value: any) => void) | undefined;
162
- /**
163
- * Submit handler
164
- * @since 0.0.54
165
- */
166
- onSubmit?: ((values: FormValues, isApply?: boolean | undefined) => void) | undefined;
167
- /**
168
- * Additional class name for the buttons container.
169
- * @since 0.0.66
170
- */
171
- footerClassName?: string | undefined;
172
- /**
173
- * Form responsive view will be switched automatically.
174
- * Specify this parameter explicitly if you want disable this behaviour and choice vertical or horizontal form view.
175
- * @since 0.4.1
176
- */
177
- vertical?: boolean | undefined;
178
- /**
179
- * @ignore
180
- */
181
- className?: string | undefined;
182
- /**
183
- * @ignore
184
- */
185
- baseClassName?: string | undefined;
186
- /**
187
- * @ignore
188
- */
189
- render?: ((params: {
190
- renderForm: (params?: {
191
- actionButtons?: ReactNode;
192
- } | undefined) => ReactElement;
193
- renderActionButtons: () => ReactElement;
194
- }) => ReactNode) | undefined;
195
- /**
196
- * @ignore
197
- */
198
- innerRef?: MutableRefObject<HTMLFormElement | null> | undefined;
199
- } & Omit<HTMLProps<HTMLFormElement>, "ref" | "onSubmit"> & import("react").RefAttributes<FormInstanceHandles>>;
200
- export default RefForwardingForm;
100
+ export type { FormValues, FormInstanceHandles };
101
+ declare type FormComponent = <FV extends FormValues>(props: FormProps<FV> & {
102
+ ref?: ForwardedRef<FormInstanceHandles>;
103
+ }) => ReactElement;
104
+ declare const _default: FormComponent;
105
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const ScrollableElementFormContext: import("react").Context<HTMLElement | null>;
2
+ export default ScrollableElementFormContext;
@@ -1,2 +1,3 @@
1
1
  export { default } from './Form';
2
+ export * from './Form';
2
3
  export { getIn, setIn } from './utils';
@@ -3,6 +3,7 @@ export declare type FormInstanceHandles = {
3
3
  submit: () => void;
4
4
  };
5
5
  export declare type FormValues = Record<string, any>;
6
+ export declare type FormFieldErrors = Record<string, any>;
6
7
  export declare type FormErrors = Record<string, any>;
7
8
  export declare type FormState<FV> = {
8
9
  values?: FV;
@@ -13,6 +14,9 @@ export declare type FormState<FV> = {
13
14
  prevErrors?: FormErrors;
14
15
  prevRequiredMark?: ReactNode;
15
16
  };
17
+ export declare type Field = {
18
+ focus: (errors: FormFieldErrors) => void;
19
+ };
16
20
  export declare type FormContextProps = {
17
21
  getValues: () => Readonly<FormValues> | undefined;
18
22
  getValue: (name: string, def?: any) => any;
@@ -21,9 +25,7 @@ export declare type FormContextProps = {
21
25
  [key: string]: any;
22
26
  };
23
27
  setRequiredField: (name: string, required: boolean) => void;
24
- registerField: (name: string, field: {
25
- focus: () => void;
26
- }) => void;
28
+ registerField: (name: string, field: Field) => void;
27
29
  unregisterField: (name: string) => void;
28
30
  getRequiredMark: () => ReactNode;
29
31
  };
@@ -1,3 +1,3 @@
1
1
  export declare const NAMES_12: IconName[];
2
- export declare type IconName = 'archive' | 'arrow-back' | 'arrow-diagonal-out' | 'arrow-down' | 'arrow-down-in' | 'arrow-down-out' | 'arrow-down-tray' | 'arrow-left' | 'arrow-right' | 'arrow-right-in' | 'arrow-right-out' | 'arrow-up' | 'arrow-up-circle' | 'arrow-up-in' | 'arrow-up-in-cloud' | 'arrow-up-out' | 'arrow-up-tray' | 'arrows-four-directions' | 'arrows-inward' | 'arrows-loop' | 'arrows-opposite' | 'arrows-outward' | 'backup' | 'backup2' | 'bar-chart-vertical' | 'bar-chart-vertical-arrow-up' | 'bell' | 'book-email' | 'boundary' | 'box-diagonal-bottom-in' | 'box-diagonal-top-in' | 'brush' | 'bug' | 'calendar' | 'calendar-clock' | 'camera' | 'card' | 'card-ribbon' | 'card-row' | 'card-tile' | 'cd' | 'cd-up-in-cloud' | 'chain' | 'chain-broken' | 'chat' | 'check-list' | 'check-mark' | 'check-mark-circle' | 'check-mark-circle-filled' | 'chevron-double-down' | 'chevron-double-up' | 'chevron-down' | 'chevron-left' | 'chevron-right' | 'chevron-up' | 'circle-diagonal' | 'clean' | 'clip' | 'clock' | 'clone' | 'cloud' | 'cloud-checkmark' | 'cloud-crossed' | 'cloud-graph' | 'code' | 'connection' | 'console' | 'console-filled' | 'copy' | 'copy-indicator' | 'cpu' | 'crane' | 'credit-cards' | 'cross-mark' | 'cross-mark-circle' | 'cross-mark-circle-filled' | 'crown-transfer' | 'dashboard' | 'database' | 'database-box' | 'database-filled' | 'database-plus' | 'deploy' | 'docker-filled' | 'dollar' | 'dollar-filled' | 'dot' | 'emoticon-confused' | 'emoticon-dead' | 'emoticon-excited' | 'emoticon-happy' | 'emoticon-neutral' | 'emoticon-sad' | 'emoticon-smile' | 'enter' | 'exclamation-mark-circle' | 'exclamation-mark-circle-filled' | 'eye' | 'eye-closed' | 'facebook' | 'facebook-filled' | 'feedback' | 'filter' | 'filter-check-mark' | 'fire' | 'flag' | 'flag-filled' | 'flag-globe' | 'floppy-disk' | 'folder-closed' | 'folder-key' | 'folder-network' | 'folder-open' | 'folders-tree' | 'forward-circle-filled' | 'four-squares' | 'gear' | 'git' | 'github' | 'globe' | 'hard-drive' | 'hard-drive-key' | 'hat' | 'hexagons' | 'home' | 'info-circle' | 'info-circle-filled' | 'ip-addresses' | 'joomla' | 'kebab' | 'key' | 'laravel' | 'lifebuoy' | 'lightbulb' | 'limit' | 'linux' | 'list' | 'list-check-mark' | 'location' | 'lock-closed' | 'lock-closed-check' | 'lock-closed-filled' | 'lock-open' | 'lock-open-cross' | 'lock-open-filled' | 'mail' | 'mail-circle-filled' | 'mail-settings' | 'megaphone' | 'menu' | 'menu-thin' | 'microsoft' | 'minimize' | 'minus' | 'minus-circle' | 'minus-circle-filled' | 'monitoring' | 'monitoring-off' | 'my-little-admin' | 'net' | 'nine-dots' | 'node-js' | 'package' | 'panel' | 'panel-check' | 'panel-eye' | 'panel-key' | 'panel-settings' | 'panels' | 'pause-circle' | 'pencil' | 'pencil-dialog' | 'php' | 'phpmyadmin' | 'pin' | 'pipette' | 'plans' | 'plugins' | 'plus' | 'power' | 'projects' | 'puzzle' | 'question-mark-circle' | 'question-mark-circle-filled' | 'ram' | 'react-js' | 'recycle' | 'redirect-circle-filled' | 'refresh' | 'reload' | 'remove' | 'reset' | 'resource' | 'ribbon' | 'rocket' | 'ruby' | 'sand-clock' | 'scan' | 'screen' | 'search' | 'security-check' | 'send' | 'server' | 'servers' | 'share' | 'shield' | 'shield-attention-filled' | 'shield-chain' | 'shield-filled' | 'shopping-cart' | 'sidebar-right-hide' | 'sidebar-right-show' | 'signal-light' | 'site-page' | 'sleep' | 'sliders' | 'square-with-circles' | 'star' | 'star-circle-filled' | 'star-filled' | 'star-half-filled' | 'start' | 'start-circle' | 'start-filled' | 'stop' | 'stop-circle' | 'storage' | 'themes' | 'three-dots-horizontal' | 'three-dots-vertical' | 'tools' | 'transfer' | 'triangle-exclamation-mark' | 'triangle-exclamation-mark-filled' | 'unarchive' | 'user' | 'volume' | 'web' | 'web-plus' | 'web-settings' | 'windows' | 'woocommerce' | 'wordpress' | 'zero-circle-filled';
2
+ export declare type IconName = 'archive' | 'arrow-back' | 'arrow-diagonal-out' | 'arrow-down' | 'arrow-down-in' | 'arrow-down-out' | 'arrow-down-tray' | 'arrow-left' | 'arrow-right' | 'arrow-right-in' | 'arrow-right-out' | 'arrow-up' | 'arrow-up-circle' | 'arrow-up-in' | 'arrow-up-in-cloud' | 'arrow-up-out' | 'arrow-up-tray' | 'arrows-four-directions' | 'arrows-inward' | 'arrows-loop' | 'arrows-opposite' | 'arrows-outward' | 'backup' | 'backup2' | 'bar-chart-vertical' | 'bar-chart-vertical-arrow-up' | 'bar-chart-vertical-lock' | 'bell' | 'book-email' | 'boundary' | 'box-diagonal-bottom-in' | 'box-diagonal-top-in' | 'brush' | 'bug' | 'calendar' | 'calendar-clock' | 'camera' | 'card' | 'card-ribbon' | 'card-row' | 'card-tile' | 'cd' | 'cd-up-in-cloud' | 'chain' | 'chain-broken' | 'chat' | 'check-list' | 'check-mark' | 'check-mark-circle' | 'check-mark-circle-filled' | 'chevron-double-down' | 'chevron-double-up' | 'chevron-down' | 'chevron-left' | 'chevron-right' | 'chevron-up' | 'circle-diagonal' | 'clean' | 'clip' | 'clock' | 'clone' | 'cloud' | 'cloud-checkmark' | 'cloud-crossed' | 'cloud-graph' | 'code' | 'connection' | 'console' | 'console-filled' | 'copy' | 'copy-indicator' | 'cpu' | 'crane' | 'credit-cards' | 'cross-mark' | 'cross-mark-circle' | 'cross-mark-circle-filled' | 'crown-transfer' | 'dashboard' | 'database' | 'database-box' | 'database-filled' | 'database-plus' | 'deploy' | 'docker-filled' | 'dollar' | 'dollar-filled' | 'dot' | 'emoticon-confused' | 'emoticon-dead' | 'emoticon-excited' | 'emoticon-happy' | 'emoticon-neutral' | 'emoticon-sad' | 'emoticon-smile' | 'enter' | 'exclamation-mark-circle' | 'exclamation-mark-circle-filled' | 'eye' | 'eye-closed' | 'facebook' | 'facebook-filled' | 'feedback' | 'filter' | 'filter-check-mark' | 'fire' | 'flag' | 'flag-filled' | 'flag-globe' | 'floppy-disk' | 'folder-closed' | 'folder-key' | 'folder-network' | 'folder-open' | 'folders-tree' | 'forward-circle-filled' | 'four-squares' | 'gear' | 'git' | 'github' | 'globe' | 'hard-drive' | 'hard-drive-key' | 'hat' | 'hexagons' | 'home' | 'info-circle' | 'info-circle-filled' | 'ip-addresses' | 'joomla' | 'kebab' | 'key' | 'laravel' | 'lifebuoy' | 'lightbulb' | 'limit' | 'linux' | 'list' | 'list-check-mark' | 'location' | 'lock-closed' | 'lock-closed-check' | 'lock-closed-filled' | 'lock-open' | 'lock-open-cross' | 'lock-open-filled' | 'mail' | 'mail-circle-filled' | 'mail-settings' | 'megaphone' | 'menu' | 'menu-thin' | 'microsoft' | 'minimize' | 'minus' | 'minus-circle' | 'minus-circle-filled' | 'monitoring' | 'monitoring-off' | 'my-little-admin' | 'net' | 'nine-dots' | 'node-js' | 'package' | 'panel' | 'panel-check' | 'panel-eye' | 'panel-key' | 'panel-settings' | 'panels' | 'pause-circle' | 'pencil' | 'pencil-dialog' | 'php' | 'phpmyadmin' | 'pin' | 'pipette' | 'plans' | 'plugins' | 'plus' | 'power' | 'projects' | 'puzzle' | 'question-mark-circle' | 'question-mark-circle-filled' | 'ram' | 'react-js' | 'recycle' | 'redirect-circle-filled' | 'refresh' | 'reload' | 'remove' | 'reset' | 'resource' | 'ribbon' | 'rocket' | 'ruby' | 'sand-clock' | 'scan' | 'screen' | 'search' | 'security-check' | 'send' | 'server' | 'servers' | 'share' | 'shield' | 'shield-attention-filled' | 'shield-chain' | 'shield-filled' | 'shopping-cart' | 'sidebar-right-hide' | 'sidebar-right-show' | 'signal-light' | 'site-page' | 'sleep' | 'sliders' | 'square-with-circles' | 'star' | 'star-circle-filled' | 'star-filled' | 'star-half-filled' | 'start' | 'start-circle' | 'start-filled' | 'stop' | 'stop-circle' | 'storage' | 'themes' | 'three-dots-horizontal' | 'three-dots-vertical' | 'tools' | 'transfer' | 'triangle-exclamation-mark' | 'triangle-exclamation-mark-filled' | 'unarchive' | 'user' | 'volume' | 'web' | 'web-plus' | 'web-settings' | 'windows' | 'woocommerce' | 'wordpress' | 'zero-circle-filled';
3
3
  export declare const NAMES: IconName[];
@@ -1,6 +1,7 @@
1
- import { ReactNode, SyntheticEvent, ComponentType, HTMLProps } from 'react';
1
+ import { ElementType, SyntheticEvent, ReactNode } from 'react';
2
+ import { PolymorphicComponentProps } from '../../utils/types';
2
3
  import './Link.less';
3
- export declare type LinkProps<P> = {
4
+ export declare type BaseLinkProps = {
4
5
  /**
5
6
  * @ignore
6
7
  */
@@ -13,7 +14,7 @@ export declare type LinkProps<P> = {
13
14
  * Content of the link.
14
15
  * @since 1.9.0
15
16
  */
16
- children: ReactNode;
17
+ children?: ReactNode;
17
18
  /**
18
19
  * @ignore
19
20
  */
@@ -29,19 +30,20 @@ export declare type LinkProps<P> = {
29
30
  * @since 1.9.0
30
31
  */
31
32
  pseudo?: boolean;
33
+ };
34
+ export declare type LinkProps<Component extends ElementType = 'a'> = {
32
35
  /**
33
36
  * Component to render as the root element. Useful when rendering a `Link` as other component or tag.
34
- * @since 1.9.0
37
+ * @since 0.0.42
38
+ * @type ElementType
39
+ * @default a
35
40
  */
36
- component?: 'a' | ComponentType<P>;
37
- } & HTMLProps<HTMLElement> & P;
38
- /**
39
- * FIXME: With the following code all @ts-ignore comments can be removed, but react-docgen cannot parse it.
40
- * const Link = <P extends any>({ ... }: LinkProps<P>) => {
41
- */
41
+ component?: Component;
42
+ } & PolymorphicComponentProps<Component, BaseLinkProps>;
42
43
  /**
43
44
  * `Link` is used for navigation purposes.
44
- * @since 1.9.0
45
+ *
46
+ * Since: 1.9.0
45
47
  */
46
- declare const Link: <P>({ baseClassName, className, onClick, disabled, pseudo, component, children, ...other }: LinkProps<P>) => JSX.Element;
48
+ declare const Link: <Component extends ElementType<any> = "a">({ baseClassName, className, onClick, disabled, pseudo, component, children, ...other }: LinkProps<Component>) => JSX.Element;
47
49
  export default Link;
@@ -1 +1,2 @@
1
1
  export { default } from './Link';
2
+ export type { LinkProps } from './Link';
@@ -43,7 +43,7 @@ export declare type OverlayProps = {
43
43
  /**
44
44
  * One of css align-items property value: center, start, end, etc.
45
45
  */
46
- align: CSSProperties['alignItems'];
46
+ align?: CSSProperties['alignItems'];
47
47
  };
48
48
  /**
49
49
  * @ignore
@@ -0,0 +1,96 @@
1
+ import PopperJs, { Behavior, ModifierFn, Placement, Position } from 'popper.js';
2
+ import { Component, CSSProperties, PropsWithChildren, ReactElement, RefObject } from 'react';
3
+ export interface PopperState {
4
+ popperStyle: CSSStyleDeclaration | null;
5
+ arrowStyle: CSSStyleDeclaration | null;
6
+ actualPlacement: Placement | undefined;
7
+ }
8
+ export declare type PopperProps = PropsWithChildren<{
9
+ /**
10
+ * Target for popper.
11
+ */
12
+ target: ReactElement;
13
+ /**
14
+ * A React reference to the DOM element that needs for calculating the position of the popup.
15
+ */
16
+ targetRef?: RefObject<HTMLElement | undefined>;
17
+ /**
18
+ * Arrow element of popper
19
+ */
20
+ arrow?: ReactElement;
21
+ /**
22
+ * Whether show popper content.
23
+ */
24
+ show?: boolean;
25
+ /**
26
+ * Boundaries element for preventOverflow property.
27
+ */
28
+ boundariesElement?: 'scrollParent' | 'window' | 'viewport' | HTMLElement;
29
+ /**
30
+ * The behavior used to change the popper's placement.
31
+ */
32
+ behavior?: Behavior | Position[];
33
+ /**
34
+ * Placement for popper.
35
+ */
36
+ placement?: Placement;
37
+ /**
38
+ * zIndex value.
39
+ */
40
+ zIndex?: number;
41
+ /**
42
+ * Shift your popper on both axis.
43
+ */
44
+ offset?: number | string;
45
+ /**
46
+ * Update callback function
47
+ */
48
+ onUpdate?: (state: PopperState) => void;
49
+ /**
50
+ * @ignore
51
+ */
52
+ style?: CSSProperties;
53
+ /**
54
+ * @ignore
55
+ */
56
+ className?: string;
57
+ /**
58
+ * @ignore
59
+ */
60
+ baseClassName?: string;
61
+ }>;
62
+ /**
63
+ * `Popper` component.
64
+ */
65
+ declare class Popper extends Component<PopperProps, PopperState> {
66
+ static defaultProps: {
67
+ show: boolean;
68
+ children: null;
69
+ arrow: null;
70
+ placement: string;
71
+ behavior: string;
72
+ offset: string;
73
+ onUpdate: null;
74
+ className: null;
75
+ baseClassName: string;
76
+ zIndex: null;
77
+ boundariesElement: string;
78
+ style: undefined;
79
+ targetRef: undefined;
80
+ };
81
+ state: {
82
+ popperStyle: null;
83
+ arrowStyle: null;
84
+ actualPlacement: PopperJs.Placement | undefined;
85
+ };
86
+ componentDidMount(): void;
87
+ componentDidUpdate(prevProps: PopperProps): void;
88
+ componentWillUnmount(): void;
89
+ popper: PopperJs | null;
90
+ contentRef: RefObject<HTMLDivElement>;
91
+ arrowRef: Element | null;
92
+ updatePopper({ show, boundariesElement, placement, offset, behavior, arrow, targetRef, }: PopperProps): void;
93
+ extractStyles: ModifierFn;
94
+ render(): JSX.Element;
95
+ }
96
+ export default Popper;
@@ -0,0 +1,2 @@
1
+ export { default } from './Popper';
2
+ export * from './Popper';
@@ -0,0 +1,53 @@
1
+ import { ReactNode, KeyboardEventHandler } from 'react';
2
+ import { ButtonProps } from '../Button';
3
+ import { DropdownProps } from '../Dropdown';
4
+ import './SplitButton.less';
5
+ export interface SplitButtonProps {
6
+ /**
7
+ * Dropdown [menu](#!/Menu)
8
+ * @type ReactElement
9
+ * @since 0.0.47
10
+ */
11
+ menu: DropdownProps['menu'];
12
+ /**
13
+ * Name of icon or [Icon](#!/Icon) component
14
+ * @type IconName | IconProps | ReactNode
15
+ * @since 3.35.0
16
+ */
17
+ icon?: ButtonProps['icon'];
18
+ /**
19
+ * Button size
20
+ * @since 3.35.0
21
+ */
22
+ size?: ButtonProps['size'];
23
+ /**
24
+ * Content of the button
25
+ * @since 0.0.40
26
+ */
27
+ children?: ReactNode;
28
+ /**
29
+ * @ignore
30
+ */
31
+ className?: string;
32
+ /**
33
+ * @ignore
34
+ */
35
+ baseClassName?: string;
36
+ /**
37
+ * @ignore
38
+ */
39
+ onKeyDown?: KeyboardEventHandler<HTMLDivElement>;
40
+ /**
41
+ * @ignore
42
+ */
43
+ onClick?: ButtonProps['onClick'];
44
+ }
45
+ /**
46
+ * `Split Button` is a combination of a standard [Button](#!/Button) with a [Dropdown](#!/Dropdown) menu.
47
+ * It is used for grouping several related actions when one of the actions should be accessible immediately
48
+ * because it is used more often than others.
49
+ *
50
+ * Since: 0.0.40
51
+ */
52
+ declare const SplitButton: ({ baseClassName, className, menu, children, onClick, onKeyDown, icon, size, ...props }: SplitButtonProps) => JSX.Element;
53
+ export default SplitButton;
@@ -0,0 +1,2 @@
1
+ export { default } from './SplitButton';
2
+ export * from './SplitButton';