@plesk/ui-library 3.33.0 → 3.34.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/Button/Button.js +17 -100
- package/cjs/components/ContentLoader/IconsLoader.js +2 -1
- package/cjs/components/Dialog/Dialog.js +4 -113
- package/cjs/components/Dropdown/Dropdown.js +4 -42
- package/cjs/components/Form/Form.js +2 -1
- package/cjs/components/FormFieldPassword/PasswordMeter.js +4 -4
- package/cjs/components/Overlay/Overlay.js +4 -3
- package/cjs/components/Popover/Popover.js +3 -1
- package/cjs/components/Section/Section.js +2 -1
- package/cjs/components/Skeleton/SkeletonText.js +1 -1
- package/cjs/components/index.js +30 -2
- package/cjs/index.js +1 -1
- package/cjs/utils/types/PolymorphicComponent.js +5 -0
- package/cjs/utils/types/index.js +5 -0
- package/dist/plesk-ui-library-rtl.css +1 -1
- package/dist/plesk-ui-library-rtl.css.map +1 -1
- package/dist/plesk-ui-library.css +1 -1
- package/dist/plesk-ui-library.css.map +1 -1
- package/dist/plesk-ui-library.js +130 -326
- package/dist/plesk-ui-library.js.map +1 -1
- package/dist/plesk-ui-library.min.js +2 -2
- package/dist/plesk-ui-library.min.js.map +1 -1
- package/esm/components/Button/Button.js +17 -98
- package/esm/components/ContentLoader/IconsLoader.js +2 -1
- package/esm/components/Dialog/Dialog.js +4 -113
- package/esm/components/Dropdown/Dropdown.js +4 -40
- package/esm/components/Form/Form.js +2 -1
- package/esm/components/FormFieldPassword/PasswordMeter.js +4 -4
- package/esm/components/Overlay/Overlay.js +4 -3
- package/esm/components/Popover/Popover.js +3 -1
- package/esm/components/Section/Section.js +2 -1
- package/esm/components/Skeleton/SkeletonText.js +1 -1
- package/esm/components/index.js +2 -2
- package/esm/index.js +1 -1
- package/esm/utils/types/PolymorphicComponent.js +1 -0
- package/esm/utils/types/index.js +1 -0
- package/package.json +24 -23
- package/styleguide/build/bundle.c6ebacd7.js +2 -0
- package/styleguide/index.html +2 -2
- package/types/src/components/AutoClosable/AutoClosable.d.ts +2 -2
- package/types/src/components/Button/Button.d.ts +102 -0
- package/types/src/components/Button/index.d.ts +2 -0
- package/types/src/components/Dialog/Dialog.d.ts +123 -0
- package/types/src/components/Dialog/index.d.ts +2 -0
- package/types/src/components/Dropdown/Dropdown.d.ts +54 -0
- package/types/src/components/Form/Form.d.ts +8 -8
- package/types/src/components/Icon/Icon.d.ts +1 -1
- package/types/src/components/Icon/index.d.ts +1 -0
- package/types/src/components/Overlay/Overlay.d.ts +1 -1
- package/types/src/components/Overlay/index.d.ts +1 -0
- package/types/src/components/index.d.ts +2 -2
- package/types/src/utils/types/PolymorphicComponent.d.ts +11 -0
- package/types/src/utils/types/index.d.ts +1 -0
- package/styleguide/build/bundle.1ca1330c.js +0 -2
- /package/styleguide/build/{bundle.1ca1330c.js.LICENSE.txt → bundle.c6ebacd7.js.LICENSE.txt} +0 -0
package/styleguide/index.html
CHANGED
|
@@ -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.
|
|
7
|
+
<title>Plesk UI Library 3.34.1</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.
|
|
29
|
+
<script src="build/bundle.c6ebacd7.js"></script>
|
|
30
30
|
</body>
|
|
31
31
|
</html>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ReactElement, ReactInstance, RefObject } from 'react';
|
|
1
|
+
import { Component, ReactElement, ReactInstance, RefObject, MutableRefObject } from 'react';
|
|
2
2
|
declare type AutoClosableProps = {
|
|
3
3
|
/**
|
|
4
4
|
* onClose handler
|
|
@@ -19,7 +19,7 @@ declare type AutoClosableProps = {
|
|
|
19
19
|
* A React reference to the DOM element that needs tracking outside clicks.
|
|
20
20
|
* @since 3.12.0
|
|
21
21
|
*/
|
|
22
|
-
nodeRef?: RefObject<HTMLElement>;
|
|
22
|
+
nodeRef?: RefObject<HTMLElement> | MutableRefObject<HTMLElement | undefined>;
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
25
|
* This is helper component for handling outside clicks.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { ElementType, ReactNode, ReactElement } from 'react';
|
|
2
|
+
import { PolymorphicComponentPropsWithRef } from '../../utils/types';
|
|
3
|
+
import { IconName, IconProps } from '../Icon';
|
|
4
|
+
import '../../helpers/base.less';
|
|
5
|
+
import './Button.less';
|
|
6
|
+
interface BaseButtonPops {
|
|
7
|
+
/**
|
|
8
|
+
* Button size.
|
|
9
|
+
* @since 2.5.0
|
|
10
|
+
*/
|
|
11
|
+
size?: 'md' | 'lg';
|
|
12
|
+
/**
|
|
13
|
+
* Visual intent color to apply to component.
|
|
14
|
+
* @since 0.0.42
|
|
15
|
+
*/
|
|
16
|
+
intent?: 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info';
|
|
17
|
+
/**
|
|
18
|
+
* Display button with transparent background.
|
|
19
|
+
* @since 2.1.0
|
|
20
|
+
*/
|
|
21
|
+
ghost?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Arrow button.
|
|
24
|
+
* @since 2.6.0
|
|
25
|
+
*/
|
|
26
|
+
arrow?: 'forward' | 'backward';
|
|
27
|
+
/**
|
|
28
|
+
* Selected state of toggle button. Used in controlled component mode.
|
|
29
|
+
* @since 0.0.68
|
|
30
|
+
*/
|
|
31
|
+
selected?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Toggle button callback. Used in uncontrolled component mode.
|
|
34
|
+
* @since 0.0.68
|
|
35
|
+
*/
|
|
36
|
+
onToggle?: (state: boolean) => void;
|
|
37
|
+
/**
|
|
38
|
+
* State of the button
|
|
39
|
+
* @since 0.0.42
|
|
40
|
+
*/
|
|
41
|
+
state?: 'active' | 'loading' | 'hovered' | 'focused';
|
|
42
|
+
/**
|
|
43
|
+
* Is button disabled?
|
|
44
|
+
* @since 0.0.42
|
|
45
|
+
*/
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Tooltip for component
|
|
49
|
+
* @since 0.0.42
|
|
50
|
+
*/
|
|
51
|
+
tooltip?: ReactNode;
|
|
52
|
+
/**
|
|
53
|
+
* Name of icon or [Icon](#!/Icon) component
|
|
54
|
+
* @since 0.0.42
|
|
55
|
+
* @type IconName | IconProps | ReactNode
|
|
56
|
+
*/
|
|
57
|
+
icon?: IconName | IconProps | ReactNode;
|
|
58
|
+
/**
|
|
59
|
+
* Show caret
|
|
60
|
+
* @since 0.0.42
|
|
61
|
+
*/
|
|
62
|
+
caret?: boolean | ReactNode;
|
|
63
|
+
/**
|
|
64
|
+
* Dynamically expand the button to fill out the whole available width of its parent container.
|
|
65
|
+
* @since 1.8.0
|
|
66
|
+
*/
|
|
67
|
+
fill?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Content of the button
|
|
70
|
+
* @since 0.0.37
|
|
71
|
+
*/
|
|
72
|
+
children?: ReactNode;
|
|
73
|
+
/**
|
|
74
|
+
* @ignore
|
|
75
|
+
*/
|
|
76
|
+
className?: string;
|
|
77
|
+
/**
|
|
78
|
+
* @ignore
|
|
79
|
+
*/
|
|
80
|
+
baseClassName?: string;
|
|
81
|
+
}
|
|
82
|
+
export declare type ButtonProps<Component extends ElementType = 'button'> = {
|
|
83
|
+
/**
|
|
84
|
+
* Component to render as the root element. Useful when rendering a `Button` as `<a>` or `<Link>`.
|
|
85
|
+
* @since 0.0.42
|
|
86
|
+
* @type ElementType
|
|
87
|
+
* @default button
|
|
88
|
+
*/
|
|
89
|
+
component?: Component;
|
|
90
|
+
} & PolymorphicComponentPropsWithRef<Component, BaseButtonPops>;
|
|
91
|
+
declare type ButtonComponent<Component extends ElementType = 'button'> = {
|
|
92
|
+
defaultProps?: Partial<ButtonProps<Component>>;
|
|
93
|
+
displayName?: string;
|
|
94
|
+
} & (<C extends ElementType = Component>(props: ButtonProps<C>) => ReactElement | null);
|
|
95
|
+
declare const _default: ButtonComponent<"button">;
|
|
96
|
+
/**
|
|
97
|
+
* `Button` component is used for executing actions, changing the application state, opening forms or dialog windows, and submitting data.
|
|
98
|
+
* As a rule, you should not use buttons for navigation between individual pages (use `Link` instead).
|
|
99
|
+
*
|
|
100
|
+
* Since: 0.0.37
|
|
101
|
+
*/
|
|
102
|
+
export default _default;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { FunctionComponent, ReactNode, HTMLAttributes, ComponentProps, ReactElement, CSSProperties } from 'react';
|
|
2
|
+
import { OverlayProps } from '../Overlay';
|
|
3
|
+
import Form from '../Form';
|
|
4
|
+
import { ButtonProps } from '../Button';
|
|
5
|
+
import '../../helpers/base.less';
|
|
6
|
+
import './Dialog.less';
|
|
7
|
+
declare type ImageType = string | ReactElement | HTMLAttributes<HTMLImageElement>;
|
|
8
|
+
export declare type DialogProps = {
|
|
9
|
+
/**
|
|
10
|
+
* Toggles visibility.
|
|
11
|
+
* @since 0.0.68
|
|
12
|
+
*/
|
|
13
|
+
isOpen?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Banner. Renders in front of content as wide as dialog.
|
|
16
|
+
* @type string | ReactElement | HTMLAttributes<HTMLImageElement>
|
|
17
|
+
* @since 0.0.68
|
|
18
|
+
*/
|
|
19
|
+
banner?: ImageType;
|
|
20
|
+
/**
|
|
21
|
+
* Image. Renders into content.
|
|
22
|
+
* @type string | ReactElement | HTMLAttributes<HTMLImageElement>
|
|
23
|
+
* @since 0.0.68
|
|
24
|
+
*/
|
|
25
|
+
image?: ImageType;
|
|
26
|
+
/**
|
|
27
|
+
* Block with an image, placed at the side of the component
|
|
28
|
+
* @type string | ReactElement | HTMLAttributes<HTMLImageElement>
|
|
29
|
+
* @since 3.25.0
|
|
30
|
+
*/
|
|
31
|
+
sideBanner?: ImageType;
|
|
32
|
+
/**
|
|
33
|
+
* Additional properties for the sideBanner
|
|
34
|
+
*
|
|
35
|
+
* @since 3.25.0
|
|
36
|
+
*/
|
|
37
|
+
sideBannerContainer?: {
|
|
38
|
+
background: string;
|
|
39
|
+
align: CSSProperties['alignItems'];
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Title
|
|
43
|
+
* @since 0.0.68
|
|
44
|
+
*/
|
|
45
|
+
title?: ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* The subtitle of the `Dialog`.
|
|
48
|
+
* @since 4.0.0
|
|
49
|
+
*/
|
|
50
|
+
subtitle?: ReactNode;
|
|
51
|
+
/**
|
|
52
|
+
* Title of "cancel" button
|
|
53
|
+
* @since 0.0.68
|
|
54
|
+
* @deprecated Use `cancelButton` instead.
|
|
55
|
+
*/
|
|
56
|
+
cancelTitle?: ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* Cancel button visibility or custom configuration. It accepts all props of the `Button` component.
|
|
59
|
+
* @since 3.13.0
|
|
60
|
+
*/
|
|
61
|
+
cancelButton?: boolean | Partial<ButtonProps>;
|
|
62
|
+
/**
|
|
63
|
+
* Buttons except "cancel" button
|
|
64
|
+
* @since 0.0.68
|
|
65
|
+
*/
|
|
66
|
+
buttons?: ReactNode;
|
|
67
|
+
/**
|
|
68
|
+
* Actions which will be shown in Dialog header
|
|
69
|
+
* @since 1.2.0
|
|
70
|
+
*/
|
|
71
|
+
actions?: ReactNode;
|
|
72
|
+
/**
|
|
73
|
+
* Wraps children into [Form](#!/Form) if not empty.
|
|
74
|
+
* @type ComponentProps<typeof Form> | typeof Form
|
|
75
|
+
* @since 0.0.68
|
|
76
|
+
*/
|
|
77
|
+
form?: ComponentProps<typeof Form> | typeof Form;
|
|
78
|
+
/**
|
|
79
|
+
* Dialog width
|
|
80
|
+
* @since 0.0.68
|
|
81
|
+
*/
|
|
82
|
+
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
83
|
+
/**
|
|
84
|
+
* If the value is false, the dialog cannot be closed and the Close button is hidden.
|
|
85
|
+
* @since 1.2.0
|
|
86
|
+
*/
|
|
87
|
+
closable?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Disable close dialog button
|
|
90
|
+
* @since 4.0.0
|
|
91
|
+
*/
|
|
92
|
+
canClose?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* On close event handler. Called immediately after dialog closed by "cancel" button or "Esc" key.
|
|
95
|
+
* @type () => void
|
|
96
|
+
* @since 0.0.68
|
|
97
|
+
*/
|
|
98
|
+
onClose?: () => void;
|
|
99
|
+
/**
|
|
100
|
+
* Whether show or not a confirmation dialog on close.
|
|
101
|
+
* @since 3.21.0
|
|
102
|
+
*/
|
|
103
|
+
closingConfirmation?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Content of the `DialogWindow`.
|
|
106
|
+
* @since 0.0.68
|
|
107
|
+
*/
|
|
108
|
+
children?: ReactNode;
|
|
109
|
+
/**
|
|
110
|
+
* @ignore
|
|
111
|
+
*/
|
|
112
|
+
className?: string;
|
|
113
|
+
/**
|
|
114
|
+
* @ignore
|
|
115
|
+
*/
|
|
116
|
+
baseClassName?: string;
|
|
117
|
+
} & Omit<OverlayProps, 'canCloseOnBackdropClick' | 'canCloseOnEscapePress'>;
|
|
118
|
+
/**
|
|
119
|
+
* `Dialog` is a modal window that asks users to make a decision or enter additional information.
|
|
120
|
+
* @since 0.0.68
|
|
121
|
+
*/
|
|
122
|
+
declare const Dialog: FunctionComponent<DialogProps>;
|
|
123
|
+
export default Dialog;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ReactNode, ReactElement, FunctionComponent, ReactChild } from 'react';
|
|
2
|
+
import '../../helpers/base.less';
|
|
3
|
+
import '../Menu/Menu.less';
|
|
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 {
|
|
9
|
+
/**
|
|
10
|
+
* Dropdown [menu](#!/Menu).
|
|
11
|
+
* @type ReactElement
|
|
12
|
+
* @since 0.0.57
|
|
13
|
+
*/
|
|
14
|
+
menu: ReactElement;
|
|
15
|
+
/**
|
|
16
|
+
* Menu placement.
|
|
17
|
+
* @since 0.0.60
|
|
18
|
+
*/
|
|
19
|
+
menuPlacement?: PopoverPlacement;
|
|
20
|
+
/**
|
|
21
|
+
* Content of the `Dropdown`.
|
|
22
|
+
* @type ReactChild
|
|
23
|
+
* @since 0.0.57
|
|
24
|
+
*/
|
|
25
|
+
children: ReactChild;
|
|
26
|
+
/**
|
|
27
|
+
* Custom localization messages.
|
|
28
|
+
* @since 3.6.0
|
|
29
|
+
*/
|
|
30
|
+
locale?: {
|
|
31
|
+
close?: ReactNode;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Display menu as overlay.
|
|
35
|
+
* @ignore
|
|
36
|
+
*/
|
|
37
|
+
overlay?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* @ignore
|
|
40
|
+
*/
|
|
41
|
+
className?: string;
|
|
42
|
+
/**
|
|
43
|
+
* @ignore
|
|
44
|
+
*/
|
|
45
|
+
baseClassName?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* `Dropdown` component is a [Button](#!/Button) that opens a drop-down (nested) [Menu](#!/Menu).
|
|
49
|
+
* Use dropdown for grouping actions that are not used often or are less important than others -- in other words,
|
|
50
|
+
* for stuff that you don't want to show users all the time, especially if you have limited screen space.
|
|
51
|
+
* @since 0.0.57
|
|
52
|
+
*/
|
|
53
|
+
declare const Dropdown: FunctionComponent<DropdownProps>;
|
|
54
|
+
export default Dropdown;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode,
|
|
2
|
-
import
|
|
1
|
+
import { ReactNode, ReactElement, MutableRefObject, HTMLProps } from 'react';
|
|
2
|
+
import { ButtonProps } from '../Button';
|
|
3
3
|
import { FormInstanceHandles, FormValues, FormErrors } from './types';
|
|
4
4
|
import './Form.less';
|
|
5
5
|
export declare type FormProps<FV extends FormValues> = {
|
|
@@ -38,17 +38,17 @@ export declare type FormProps<FV extends FormValues> = {
|
|
|
38
38
|
* Submit button visibility or custom configuration
|
|
39
39
|
* @since 0.0.58
|
|
40
40
|
*/
|
|
41
|
-
submitButton?: boolean | Partial<
|
|
41
|
+
submitButton?: boolean | Partial<ButtonProps>;
|
|
42
42
|
/**
|
|
43
43
|
* Apply button visibility or custom configuration
|
|
44
44
|
* @since 0.0.58
|
|
45
45
|
*/
|
|
46
|
-
applyButton?: boolean | Partial<
|
|
46
|
+
applyButton?: boolean | Partial<ButtonProps>;
|
|
47
47
|
/**
|
|
48
48
|
* Cancel button visibility or custom configuration
|
|
49
49
|
* @since 0.0.58
|
|
50
50
|
*/
|
|
51
|
-
cancelButton?: boolean | Partial<
|
|
51
|
+
cancelButton?: boolean | Partial<ButtonProps>;
|
|
52
52
|
/**
|
|
53
53
|
* Additional buttons
|
|
54
54
|
* @since 0.0.58
|
|
@@ -138,17 +138,17 @@ declare const RefForwardingForm: import("react").ForwardRefExoticComponent<{
|
|
|
138
138
|
* Submit button visibility or custom configuration
|
|
139
139
|
* @since 0.0.58
|
|
140
140
|
*/
|
|
141
|
-
submitButton?: boolean | Partial<
|
|
141
|
+
submitButton?: boolean | Partial<ButtonProps<"button">> | undefined;
|
|
142
142
|
/**
|
|
143
143
|
* Apply button visibility or custom configuration
|
|
144
144
|
* @since 0.0.58
|
|
145
145
|
*/
|
|
146
|
-
applyButton?: boolean | Partial<
|
|
146
|
+
applyButton?: boolean | Partial<ButtonProps<"button">> | undefined;
|
|
147
147
|
/**
|
|
148
148
|
* Cancel button visibility or custom configuration
|
|
149
149
|
* @since 0.0.58
|
|
150
150
|
*/
|
|
151
|
-
cancelButton?: boolean | Partial<
|
|
151
|
+
cancelButton?: boolean | Partial<ButtonProps<"button">> | undefined;
|
|
152
152
|
/**
|
|
153
153
|
* Additional buttons
|
|
154
154
|
* @since 0.0.58
|
|
@@ -3,7 +3,7 @@ import { IconName } from './constants';
|
|
|
3
3
|
import '../../helpers/base.less';
|
|
4
4
|
import './Icon.less';
|
|
5
5
|
export * from './constants';
|
|
6
|
-
declare type IconSize = '12' | '16' | '24' | '32' | '48' | '64' | '96' | '128' | '192';
|
|
6
|
+
export declare type IconSize = '12' | '16' | '24' | '32' | '48' | '64' | '96' | '128' | '192';
|
|
7
7
|
export declare const ICON_SIZE_12: IconSize;
|
|
8
8
|
export declare const ICON_SIZE_16: IconSize;
|
|
9
9
|
export declare const ICON_SIZE_24: IconSize;
|
|
@@ -4,7 +4,7 @@ export { default as AutoClosable } from './AutoClosable';
|
|
|
4
4
|
export { default as AuxiliaryActions } from './AuxiliaryActions';
|
|
5
5
|
export { default as Badge } from './Badge';
|
|
6
6
|
export { default as Breadcrumbs } from './Breadcrumbs';
|
|
7
|
-
export { default as Button } from './Button';
|
|
7
|
+
export { default as Button, ButtonProps } from './Button';
|
|
8
8
|
export { default as ButtonGroup } from './ButtonGroup';
|
|
9
9
|
export { default as Card } from './Card';
|
|
10
10
|
export * from './Card';
|
|
@@ -40,7 +40,7 @@ export { default as Grid } from './Grid';
|
|
|
40
40
|
export { default as GridCol } from './GridCol';
|
|
41
41
|
export { default as Heading } from './Heading';
|
|
42
42
|
export { default as Hint } from './Hint';
|
|
43
|
-
export { default as Icon } from './Icon';
|
|
43
|
+
export { default as Icon, IconProps, IconName, IconSize } from './Icon';
|
|
44
44
|
export { default as Input } from './Input';
|
|
45
45
|
export { default as InputFile } from './InputFile';
|
|
46
46
|
export { default as InputNumber } from './InputNumber';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ElementType, ComponentPropsWithoutRef, ComponentPropsWithRef } from 'react';
|
|
2
|
+
declare type ComponentProp<C extends ElementType> = {
|
|
3
|
+
component?: C;
|
|
4
|
+
};
|
|
5
|
+
declare type PropsToOmit<C extends ElementType, P> = keyof (ComponentProp<C> & P);
|
|
6
|
+
export declare type PolymorphicComponentProps<C extends ElementType, Props = {}> = Props & ComponentProp<C> & Omit<ComponentPropsWithoutRef<C>, PropsToOmit<C, Props>>;
|
|
7
|
+
declare type PolymorphicRef<C extends ElementType> = ComponentPropsWithRef<C>['ref'];
|
|
8
|
+
export declare type PolymorphicComponentPropsWithRef<C extends ElementType, Props = {}> = PolymorphicComponentProps<C, Props> & {
|
|
9
|
+
ref?: PolymorphicRef<C>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { PolymorphicComponentProps, PolymorphicComponentPropsWithRef, } from './PolymorphicComponent';
|