@mw-kit/mw-ui 1.10.6 → 1.10.8
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/dist/components/Popup/hooks/fallbackPlacements/index.d.ts +1 -1
- package/dist/components/Popup/hooks/open/index.d.ts +1 -1
- package/dist/components/Popup/index.d.ts +1 -3
- package/dist/components/Popup/types.d.ts +17 -5
- package/dist/index.d.mts +17 -8
- package/dist/index.js +3 -5
- package/dist/index.mjs +3 -5
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { PopupPosition, PopupProps } from '../../types';
|
|
2
|
-
declare const useFallbackPlacements: (props: PopupProps) => PopupPosition[];
|
|
2
|
+
declare const useFallbackPlacements: (props: Omit<PopupProps, "enabled">) => PopupPosition[];
|
|
3
3
|
export default useFallbackPlacements;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { PopupProps } from '../../types';
|
|
2
|
-
declare const useOpen: (props: PopupProps) => readonly [boolean | undefined, (nextOpen: boolean) => void];
|
|
2
|
+
declare const useOpen: (props: Omit<PopupProps, "enabled">) => readonly [boolean | undefined, (nextOpen: boolean) => void];
|
|
3
3
|
export default useOpen;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PopupProps } from './types';
|
|
3
|
-
declare const Popup: <T extends React.ElementType = "div">(props: PopupProps<T>
|
|
4
|
-
enabled?: boolean;
|
|
5
|
-
}) => JSX.Element;
|
|
3
|
+
declare const Popup: <T extends React.ElementType = "div", P = {}>(props: PopupProps<T, P>) => JSX.Element;
|
|
6
4
|
export default Popup;
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import type { FloatingPortalProps } from '@floating-ui/react';
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { FloatingPortalProps, OffsetOptions } from '@floating-ui/react';
|
|
2
|
+
type RequiredKeys<T> = {
|
|
3
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? never : K;
|
|
4
|
+
}[keyof T];
|
|
5
|
+
export type PopupContentProps<P = {}> = {
|
|
6
|
+
closePopup: () => void;
|
|
7
|
+
} & P;
|
|
8
|
+
export type PopupProps<T extends React.ElementType = 'div', P = {}> = {
|
|
9
|
+
content: React.FunctionComponent<PopupContentProps<P>>;
|
|
4
10
|
position: PopupPosition;
|
|
5
11
|
on?: 'hover' | 'click';
|
|
6
12
|
triggerType?: T;
|
|
7
13
|
triggerProps?: React.ComponentPropsWithRef<T>;
|
|
8
14
|
renderTrigger: (props: React.ComponentPropsWithRef<T>) => React.ReactNode;
|
|
9
|
-
offset?:
|
|
15
|
+
offset?: OffsetOptions;
|
|
10
16
|
shift?: number;
|
|
11
17
|
background?: 'light' | 'dark';
|
|
12
18
|
arrow?: 'flattened' | 'pointed' | 'none';
|
|
@@ -19,5 +25,11 @@ export type PopupProps<T extends React.ElementType = 'div'> = {
|
|
|
19
25
|
style?: React.CSSProperties | undefined;
|
|
20
26
|
dependencies?: React.DependencyList;
|
|
21
27
|
pinned?: boolean;
|
|
22
|
-
|
|
28
|
+
enabled?: boolean;
|
|
29
|
+
} & (RequiredKeys<P> extends never ? {
|
|
30
|
+
contentProps?: P;
|
|
31
|
+
} : {
|
|
32
|
+
contentProps: P;
|
|
33
|
+
});
|
|
23
34
|
export type PopupPosition = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
|
|
35
|
+
export {};
|
package/dist/index.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ import * as react from 'react';
|
|
|
4
4
|
import react__default, { TextareaHTMLAttributes } from 'react';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import * as _fortawesome_fontawesome_common_types from '@fortawesome/fontawesome-common-types';
|
|
7
|
-
import { FloatingPortalProps } from '@floating-ui/react';
|
|
7
|
+
import { OffsetOptions, FloatingPortalProps } from '@floating-ui/react';
|
|
8
8
|
import * as styled_components_dist_types from 'styled-components/dist/types';
|
|
9
9
|
import { ReactVirtualizerOptions } from '@tanstack/react-virtual';
|
|
10
10
|
import { Property } from 'csstype';
|
|
@@ -265,14 +265,20 @@ type AbsoluteContainerProps = CommonProps$4 & {
|
|
|
265
265
|
transition?: Partial<Omit<TransitionArguments, 'active'>>;
|
|
266
266
|
};
|
|
267
267
|
|
|
268
|
-
type
|
|
269
|
-
|
|
268
|
+
type RequiredKeys<T> = {
|
|
269
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? never : K;
|
|
270
|
+
}[keyof T];
|
|
271
|
+
type PopupContentProps<P = {}> = {
|
|
272
|
+
closePopup: () => void;
|
|
273
|
+
} & P;
|
|
274
|
+
type PopupProps<T extends React.ElementType = 'div', P = {}> = {
|
|
275
|
+
content: React.FunctionComponent<PopupContentProps<P>>;
|
|
270
276
|
position: PopupPosition;
|
|
271
277
|
on?: 'hover' | 'click';
|
|
272
278
|
triggerType?: T;
|
|
273
279
|
triggerProps?: React.ComponentPropsWithRef<T>;
|
|
274
280
|
renderTrigger: (props: React.ComponentPropsWithRef<T>) => React.ReactNode;
|
|
275
|
-
offset?:
|
|
281
|
+
offset?: OffsetOptions;
|
|
276
282
|
shift?: number;
|
|
277
283
|
background?: 'light' | 'dark';
|
|
278
284
|
arrow?: 'flattened' | 'pointed' | 'none';
|
|
@@ -285,7 +291,12 @@ type PopupProps<T extends React.ElementType = 'div'> = {
|
|
|
285
291
|
style?: React.CSSProperties | undefined;
|
|
286
292
|
dependencies?: React.DependencyList;
|
|
287
293
|
pinned?: boolean;
|
|
288
|
-
|
|
294
|
+
enabled?: boolean;
|
|
295
|
+
} & (RequiredKeys<P> extends never ? {
|
|
296
|
+
contentProps?: P;
|
|
297
|
+
} : {
|
|
298
|
+
contentProps: P;
|
|
299
|
+
});
|
|
289
300
|
type PopupPosition = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
|
|
290
301
|
|
|
291
302
|
interface LoaderProps extends Omit<react__default.HTMLAttributes<HTMLDivElement>, 'color'> {
|
|
@@ -3993,9 +4004,7 @@ interface PlaceholderProps {
|
|
|
3993
4004
|
|
|
3994
4005
|
declare const Placeholder: (props: PlaceholderProps) => react_jsx_runtime.JSX.Element;
|
|
3995
4006
|
|
|
3996
|
-
declare const Popup: <T extends react__default.ElementType = "div">(props: PopupProps<T>
|
|
3997
|
-
enabled?: boolean;
|
|
3998
|
-
}) => JSX.Element;
|
|
4007
|
+
declare const Popup: <T extends react__default.ElementType = "div", P = {}>(props: PopupProps<T, P>) => JSX.Element;
|
|
3999
4008
|
|
|
4000
4009
|
interface ProgressBarProps {
|
|
4001
4010
|
type: 'default' | 'info' | 'danger' | 'success' | 'warning';
|
package/dist/index.js
CHANGED
|
@@ -10010,6 +10010,7 @@ var defaultDependencies = [];
|
|
|
10010
10010
|
var PopupComponent = (props) => {
|
|
10011
10011
|
const {
|
|
10012
10012
|
content: Content5,
|
|
10013
|
+
contentProps = {},
|
|
10013
10014
|
renderTrigger,
|
|
10014
10015
|
triggerProps,
|
|
10015
10016
|
on = "hover",
|
|
@@ -10095,16 +10096,13 @@ var PopupComponent = (props) => {
|
|
|
10095
10096
|
$placement: floating.placement
|
|
10096
10097
|
}
|
|
10097
10098
|
) : null,
|
|
10098
|
-
/* @__PURE__ */ (0, import_jsx_runtime294.jsx)(Content5, {})
|
|
10099
|
+
/* @__PURE__ */ (0, import_jsx_runtime294.jsx)(Content5, { closePopup: () => setOpen(false), ...contentProps })
|
|
10099
10100
|
]
|
|
10100
10101
|
}
|
|
10101
10102
|
) }) : null
|
|
10102
10103
|
] });
|
|
10103
10104
|
};
|
|
10104
|
-
var Popup = ({
|
|
10105
|
-
enabled,
|
|
10106
|
-
...props
|
|
10107
|
-
}) => {
|
|
10105
|
+
var Popup = ({ enabled, ...props }) => {
|
|
10108
10106
|
return enabled !== false ? /* @__PURE__ */ (0, import_jsx_runtime294.jsx)(PopupComponent, { ...props }) : props.renderTrigger(props.triggerProps || {});
|
|
10109
10107
|
};
|
|
10110
10108
|
var Popup_default = Popup;
|
package/dist/index.mjs
CHANGED
|
@@ -9962,6 +9962,7 @@ var defaultDependencies = [];
|
|
|
9962
9962
|
var PopupComponent = (props) => {
|
|
9963
9963
|
const {
|
|
9964
9964
|
content: Content5,
|
|
9965
|
+
contentProps = {},
|
|
9965
9966
|
renderTrigger,
|
|
9966
9967
|
triggerProps,
|
|
9967
9968
|
on = "hover",
|
|
@@ -10047,16 +10048,13 @@ var PopupComponent = (props) => {
|
|
|
10047
10048
|
$placement: floating.placement
|
|
10048
10049
|
}
|
|
10049
10050
|
) : null,
|
|
10050
|
-
/* @__PURE__ */ jsx294(Content5, {})
|
|
10051
|
+
/* @__PURE__ */ jsx294(Content5, { closePopup: () => setOpen(false), ...contentProps })
|
|
10051
10052
|
]
|
|
10052
10053
|
}
|
|
10053
10054
|
) }) : null
|
|
10054
10055
|
] });
|
|
10055
10056
|
};
|
|
10056
|
-
var Popup = ({
|
|
10057
|
-
enabled,
|
|
10058
|
-
...props
|
|
10059
|
-
}) => {
|
|
10057
|
+
var Popup = ({ enabled, ...props }) => {
|
|
10060
10058
|
return enabled !== false ? /* @__PURE__ */ jsx294(PopupComponent, { ...props }) : props.renderTrigger(props.triggerProps || {});
|
|
10061
10059
|
};
|
|
10062
10060
|
var Popup_default = Popup;
|