@mw-kit/mw-ui 1.10.3 → 1.10.5

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.
@@ -1,3 +1,4 @@
1
+ import type { FloatingPortalProps } from '@floating-ui/react';
1
2
  export type PopupProps<T extends React.ElementType = 'div'> = {
2
3
  content: React.FunctionComponent;
3
4
  position: PopupPosition;
@@ -14,5 +15,7 @@ export type PopupProps<T extends React.ElementType = 'div'> = {
14
15
  setOpen?: (open: boolean) => void;
15
16
  fallbackPlacements?: PopupPosition[];
16
17
  zIndex?: number;
18
+ portalRoot?: FloatingPortalProps['root'];
19
+ style?: React.CSSProperties | undefined;
17
20
  };
18
21
  export type PopupPosition = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
@@ -1,4 +1,5 @@
1
1
  import type React from 'react';
2
+ import type { FloatingPortalProps } from '@floating-ui/react';
2
3
  import type { ReactVirtualizerOptions } from '@tanstack/react-virtual';
3
4
  import type { Property } from 'csstype';
4
5
  export type SelectOptionsLoader<Option> = (search: string, page: number, cursor: Option | null) => Promise<{
@@ -48,6 +49,7 @@ export type CommonSelectProps<Option> = SelectButtonProps & {
48
49
  borderless?: boolean;
49
50
  paddingless?: boolean;
50
51
  zIndex?: Property.ZIndex;
52
+ portalRoot?: FloatingPortalProps['root'];
51
53
  placement?: SelectPlacement;
52
54
  /**
53
55
  * Defines the element used as the visual boundary when resolving the automatic placement.
@@ -15,6 +15,7 @@ export { default as MwLoader } from './Loader';
15
15
  export { default as MwMenu } from './Menu';
16
16
  export { default as MwModal } from './Modal';
17
17
  export { default as MwPlaceholder } from './Placeholder';
18
+ export { default as MwPopup } from './Popup';
18
19
  export { default as MwProgressBar } from './ProgressBar';
19
20
  export { default as MwScrollContainer } from './ScrollContainer';
20
21
  export { default as MwSelect } from './Select';
package/dist/index.d.mts CHANGED
@@ -4,6 +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
8
  import * as styled_components_dist_types from 'styled-components/dist/types';
8
9
  import { ReactVirtualizerOptions } from '@tanstack/react-virtual';
9
10
  import { Property } from 'csstype';
@@ -280,6 +281,8 @@ type PopupProps<T extends React.ElementType = 'div'> = {
280
281
  setOpen?: (open: boolean) => void;
281
282
  fallbackPlacements?: PopupPosition[];
282
283
  zIndex?: number;
284
+ portalRoot?: FloatingPortalProps['root'];
285
+ style?: React.CSSProperties | undefined;
283
286
  };
284
287
  type PopupPosition = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
285
288
 
@@ -3198,6 +3201,7 @@ type CommonSelectProps<Option> = SelectButtonProps & {
3198
3201
  borderless?: boolean;
3199
3202
  paddingless?: boolean;
3200
3203
  zIndex?: Property.ZIndex;
3204
+ portalRoot?: FloatingPortalProps['root'];
3201
3205
  placement?: SelectPlacement;
3202
3206
  /**
3203
3207
  * Defines the element used as the visual boundary when resolving the automatic placement.
@@ -3987,6 +3991,10 @@ interface PlaceholderProps {
3987
3991
 
3988
3992
  declare const Placeholder: (props: PlaceholderProps) => react_jsx_runtime.JSX.Element;
3989
3993
 
3994
+ declare const Popup: <T extends react__default.ElementType = "div">(props: PopupProps<T> & {
3995
+ enabled?: boolean;
3996
+ }) => JSX.Element;
3997
+
3990
3998
  interface ProgressBarProps {
3991
3999
  type: 'default' | 'info' | 'danger' | 'success' | 'warning';
3992
4000
  value: number | null;
@@ -4064,4 +4072,4 @@ declare const ThemeProvider: (props: React.PropsWithChildren<{
4064
4072
  assetBaseUrl: string;
4065
4073
  }>) => react_jsx_runtime.JSX.Element;
4066
4074
 
4067
- export { Inflector, AbsoluteContainer as MwAbsoluteContainer, AppliedFilters as MwAppliedFilters, Button as MwButton, Calendar as MwCalendar, Card as MwCard, EllipsisContainer as MwEllipsisContainer, Filters as MwFilters, Form as MwForm, Grid as MwGrid, Icon as MwIcon, Indicator as MwIndicator, Input as MwInput, Link as MwLink, Loader as MwLoader, Menu as MwMenu, Modal as MwModal, Placeholder as MwPlaceholder, ProgressBar as MwProgressBar, ScrollContainer as MwScrollContainer, _default as MwSelect, SignatureInput as MwSignature, Tabs as MwTabs, TextArea as MwTextArea, Toast as MwToast, Transition as MwTransition, Zoom as MwZoom, ThemeProvider, theme, useTransition as useMwTransition };
4075
+ export { Inflector, AbsoluteContainer as MwAbsoluteContainer, AppliedFilters as MwAppliedFilters, Button as MwButton, Calendar as MwCalendar, Card as MwCard, EllipsisContainer as MwEllipsisContainer, Filters as MwFilters, Form as MwForm, Grid as MwGrid, Icon as MwIcon, Indicator as MwIndicator, Input as MwInput, Link as MwLink, Loader as MwLoader, Menu as MwMenu, Modal as MwModal, Placeholder as MwPlaceholder, Popup as MwPopup, ProgressBar as MwProgressBar, ScrollContainer as MwScrollContainer, _default as MwSelect, SignatureInput as MwSignature, Tabs as MwTabs, TextArea as MwTextArea, Toast as MwToast, Transition as MwTransition, Zoom as MwZoom, ThemeProvider, theme, useTransition as useMwTransition };
package/dist/index.js CHANGED
@@ -48,6 +48,7 @@ __export(index_exports, {
48
48
  MwMenu: () => Menu_default2,
49
49
  MwModal: () => Modal_default,
50
50
  MwPlaceholder: () => Placeholder_default,
51
+ MwPopup: () => Popup_default,
51
52
  MwProgressBar: () => ProgressBar_default,
52
53
  MwScrollContainer: () => ScrollContainer_default,
53
54
  MwSelect: () => Select_default3,
@@ -10069,11 +10070,15 @@ var PopupComponent = (props) => {
10069
10070
  }, [floating.refs.setReference, interactions, triggerProps]);
10070
10071
  return /* @__PURE__ */ (0, import_jsx_runtime294.jsxs)(import_react11.default.Fragment, { children: [
10071
10072
  renderTrigger(referenceProps),
10072
- open ? /* @__PURE__ */ (0, import_jsx_runtime294.jsx)(import_react12.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime294.jsxs)(
10073
+ open ? /* @__PURE__ */ (0, import_jsx_runtime294.jsx)(import_react12.FloatingPortal, { root: props.portalRoot, children: /* @__PURE__ */ (0, import_jsx_runtime294.jsxs)(
10073
10074
  TooltipSurface,
10074
10075
  {
10075
10076
  ref: floating.refs.setFloating,
10076
- style: { ...floating.floatingStyles, zIndex },
10077
+ style: {
10078
+ ...floating.floatingStyles,
10079
+ ...props.style || {},
10080
+ zIndex
10081
+ },
10077
10082
  $placement: floating.placement,
10078
10083
  $background: background,
10079
10084
  ...interactions.getFloatingProps(),
@@ -20041,6 +20046,7 @@ var useMultiSelect = ({
20041
20046
  borderless,
20042
20047
  paddingless,
20043
20048
  zIndex,
20049
+ portalRoot,
20044
20050
  placement,
20045
20051
  boundRef,
20046
20052
  overscan,
@@ -20183,6 +20189,7 @@ var useSingleSelect = ({
20183
20189
  borderless,
20184
20190
  paddingless,
20185
20191
  zIndex,
20192
+ portalRoot,
20186
20193
  placement,
20187
20194
  boundRef,
20188
20195
  overscan,
@@ -20495,7 +20502,7 @@ var Select2 = import_react81.default.forwardRef(
20495
20502
  ]
20496
20503
  }
20497
20504
  ),
20498
- transition.isMounted ? /* @__PURE__ */ (0, import_jsx_runtime366.jsx)(import_react82.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime366.jsx)(
20505
+ transition.isMounted ? /* @__PURE__ */ (0, import_jsx_runtime366.jsx)(import_react82.FloatingPortal, { root: props.portalRoot, children: /* @__PURE__ */ (0, import_jsx_runtime366.jsx)(
20499
20506
  FloatingWrapper,
20500
20507
  {
20501
20508
  ref: floating.refs.setFloating,
@@ -21621,6 +21628,7 @@ var Zoom_default = Zoom;
21621
21628
  MwMenu,
21622
21629
  MwModal,
21623
21630
  MwPlaceholder,
21631
+ MwPopup,
21624
21632
  MwProgressBar,
21625
21633
  MwScrollContainer,
21626
21634
  MwSelect,
package/dist/index.mjs CHANGED
@@ -10022,11 +10022,15 @@ var PopupComponent = (props) => {
10022
10022
  }, [floating.refs.setReference, interactions, triggerProps]);
10023
10023
  return /* @__PURE__ */ jsxs143(React291.Fragment, { children: [
10024
10024
  renderTrigger(referenceProps),
10025
- open ? /* @__PURE__ */ jsx294(FloatingPortal, { children: /* @__PURE__ */ jsxs143(
10025
+ open ? /* @__PURE__ */ jsx294(FloatingPortal, { root: props.portalRoot, children: /* @__PURE__ */ jsxs143(
10026
10026
  TooltipSurface,
10027
10027
  {
10028
10028
  ref: floating.refs.setFloating,
10029
- style: { ...floating.floatingStyles, zIndex },
10029
+ style: {
10030
+ ...floating.floatingStyles,
10031
+ ...props.style || {},
10032
+ zIndex
10033
+ },
10030
10034
  $placement: floating.placement,
10031
10035
  $background: background,
10032
10036
  ...interactions.getFloatingProps(),
@@ -20002,6 +20006,7 @@ var useMultiSelect = ({
20002
20006
  borderless,
20003
20007
  paddingless,
20004
20008
  zIndex,
20009
+ portalRoot,
20005
20010
  placement,
20006
20011
  boundRef,
20007
20012
  overscan,
@@ -20144,6 +20149,7 @@ var useSingleSelect = ({
20144
20149
  borderless,
20145
20150
  paddingless,
20146
20151
  zIndex,
20152
+ portalRoot,
20147
20153
  placement,
20148
20154
  boundRef,
20149
20155
  overscan,
@@ -20456,7 +20462,7 @@ var Select2 = React348.forwardRef(
20456
20462
  ]
20457
20463
  }
20458
20464
  ),
20459
- transition.isMounted ? /* @__PURE__ */ jsx366(FloatingPortal2, { children: /* @__PURE__ */ jsx366(
20465
+ transition.isMounted ? /* @__PURE__ */ jsx366(FloatingPortal2, { root: props.portalRoot, children: /* @__PURE__ */ jsx366(
20460
20466
  FloatingWrapper,
20461
20467
  {
20462
20468
  ref: floating.refs.setFloating,
@@ -21581,6 +21587,7 @@ export {
21581
21587
  Menu_default2 as MwMenu,
21582
21588
  Modal_default as MwModal,
21583
21589
  Placeholder_default as MwPlaceholder,
21590
+ Popup_default as MwPopup,
21584
21591
  ProgressBar_default as MwProgressBar,
21585
21592
  ScrollContainer_default as MwScrollContainer,
21586
21593
  Select_default3 as MwSelect,
@@ -26,4 +26,5 @@ export type { AppliedFilter } from './components/Filters/interfaces';
26
26
  export type { Transition } from './components/Transition/interfaces';
27
27
  export type { TabComponent, TabComponents, TabProps, TabProvider, } from './components/Tabs/interfaces';
28
28
  export type * from './components/Select/types';
29
+ export type * from './components/Popup/types';
29
30
  export type * from './functions/inflections';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mw-kit/mw-ui",
3
- "version": "1.10.3",
3
+ "version": "1.10.5",
4
4
  "description": "Made with create-react-library",
5
5
  "author": "fmgusmao",
6
6
  "license": "MIT",