@transferwise/components 0.0.0-experimental-63cdd4d → 0.0.0-experimental-84d7c27
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/build/index.esm.js +140 -159
- package/build/index.esm.js.map +1 -1
- package/build/index.js +140 -159
- package/build/index.js.map +1 -1
- package/build/main.css +1 -1
- package/build/styles/actionButton/ActionButton.css +1 -1
- package/build/styles/chips/Chip.css +1 -1
- package/build/styles/circularButton/CircularButton.css +1 -1
- package/build/styles/common/Option/Option.css +1 -1
- package/build/styles/common/bottomSheet/BottomSheet.css +1 -1
- package/build/styles/common/closeButton/CloseButton.css +1 -1
- package/build/styles/dateLookup/DateLookup.css +1 -1
- package/build/styles/drawer/Drawer.css +1 -1
- package/build/styles/flowNavigation/FlowNavigation.css +1 -1
- package/build/styles/main.css +1 -1
- package/build/styles/overlayHeader/OverlayHeader.css +1 -1
- package/build/styles/statusIcon/StatusIcon.css +1 -1
- package/build/styles/summary/Summary.css +1 -1
- package/build/styles/typeahead/Typeahead.css +1 -1
- package/build/styles/uploadInput/UploadInput.css +1 -1
- package/build/types/common/bottomSheet/BottomSheet.d.ts.map +1 -1
- package/build/types/common/propsValues/breakpoint.d.ts +0 -1
- package/build/types/common/propsValues/breakpoint.d.ts.map +1 -1
- package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
- package/build/types/dateLookup/dateHeader/DateHeader.d.ts.map +1 -1
- package/build/types/test-utils/story-config.d.ts +1 -11
- package/build/types/test-utils/story-config.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/actionButton/ActionButton.css +1 -1
- package/src/actionButton/ActionButton.less +1 -5
- package/src/chips/Chip.css +1 -1
- package/src/chips/Chip.less +0 -8
- package/src/circularButton/CircularButton.css +1 -1
- package/src/circularButton/CircularButton.less +3 -9
- package/src/common/Option/Option.css +1 -1
- package/src/common/Option/Option.less +0 -6
- package/src/common/bottomSheet/BottomSheet.css +1 -1
- package/src/common/bottomSheet/BottomSheet.less +1 -1
- package/src/common/bottomSheet/BottomSheet.spec.tsx +1 -4
- package/src/common/bottomSheet/BottomSheet.story.tsx +0 -4
- package/src/common/bottomSheet/BottomSheet.tsx +1 -10
- package/src/common/closeButton/CloseButton.css +1 -1
- package/src/common/closeButton/CloseButton.less +0 -12
- package/src/common/hooks/useMedia.spec.ts +17 -3
- package/src/common/propsValues/breakpoint.ts +0 -1
- package/src/dateLookup/DateLookup.css +1 -1
- package/src/dateLookup/DateLookup.js +3 -7
- package/src/dateLookup/DateLookup.keyboardEvents.spec.js +0 -3
- package/src/dateLookup/DateLookup.less +0 -6
- package/src/dateLookup/DateLookup.story.js +1 -6
- package/src/dateLookup/DateLookup.testingLibrary.spec.js +1 -3
- package/src/dateLookup/DateLookup.view.spec.js +0 -4
- package/src/dateLookup/dateHeader/DateHeader.js +2 -4
- package/src/drawer/Drawer.css +1 -1
- package/src/drawer/Drawer.less +0 -6
- package/src/drawer/Drawer.story.js +2 -42
- package/src/flowNavigation/FlowNavigation.css +1 -1
- package/src/inputs/SelectInput.tsx +1 -1
- package/src/main.css +1 -1
- package/src/modal/Modal.tsx +2 -2
- package/src/overlayHeader/OverlayHeader.css +1 -1
- package/src/popover/Popover.spec.js +1 -3
- package/src/select/Select.spec.js +9 -6
- package/src/statusIcon/StatusIcon.css +1 -1
- package/src/statusIcon/StatusIcon.less +0 -10
- package/src/summary/Summary.css +1 -1
- package/src/summary/Summary.less +1 -1
- package/src/test-utils/index.js +0 -1
- package/src/test-utils/story-config.ts +7 -21
- package/src/typeahead/Typeahead.css +1 -1
- package/src/typeahead/Typeahead.less +6 -5
- package/src/uploadInput/UploadInput.css +1 -1
- package/src/uploadInput/UploadInput.less +1 -5
- package/build/types/test-utils/window-mock.d.ts +0 -2
- package/build/types/test-utils/window-mock.d.ts.map +0 -1
- package/src/test-utils/window-mock.ts +0 -19
package/build/index.js
CHANGED
|
@@ -14,11 +14,11 @@ var reactTransitionGroup = require('react-transition-group');
|
|
|
14
14
|
var reactDom = require('react-dom');
|
|
15
15
|
var focus = require('@react-aria/focus');
|
|
16
16
|
var mergeRefs = require('react-merge-refs');
|
|
17
|
-
var shim = require('use-sync-external-store/shim');
|
|
18
17
|
var neptuneValidation = require('@transferwise/neptune-validation');
|
|
19
18
|
var reactPopper = require('react-popper');
|
|
20
19
|
var react$1 = require('@headlessui/react');
|
|
21
20
|
var mergeProps = require('merge-props');
|
|
21
|
+
var shim = require('use-sync-external-store/shim');
|
|
22
22
|
var react = require('@floating-ui/react');
|
|
23
23
|
var overlays = require('@react-aria/overlays');
|
|
24
24
|
var art = require('@wise/art');
|
|
@@ -192,7 +192,6 @@ exports.Priority = void 0;
|
|
|
192
192
|
|
|
193
193
|
exports.Breakpoint = void 0;
|
|
194
194
|
(function (Breakpoint) {
|
|
195
|
-
Breakpoint[Breakpoint["ZOOM_400"] = 385] = "ZOOM_400";
|
|
196
195
|
Breakpoint[Breakpoint["EXTRA_SMALL"] = 480] = "EXTRA_SMALL";
|
|
197
196
|
Breakpoint[Breakpoint["SMALL"] = 576] = "SMALL";
|
|
198
197
|
Breakpoint[Breakpoint["MEDIUM"] = 768] = "MEDIUM";
|
|
@@ -1741,6 +1740,58 @@ const DimmerContentWrapper = ({
|
|
|
1741
1740
|
};
|
|
1742
1741
|
var Dimmer$1 = withNextPortalWrapper(Dimmer);
|
|
1743
1742
|
|
|
1743
|
+
const EXIT_ANIMATION = 350;
|
|
1744
|
+
const SlidingPanel = /*#__PURE__*/React.forwardRef(({
|
|
1745
|
+
children,
|
|
1746
|
+
className,
|
|
1747
|
+
open,
|
|
1748
|
+
position,
|
|
1749
|
+
showSlidingPanelBorder,
|
|
1750
|
+
slidingPanelPositionFixed,
|
|
1751
|
+
...rest
|
|
1752
|
+
}, reference) => {
|
|
1753
|
+
/** @type {RefObject<HTMLDivElement>} */
|
|
1754
|
+
const localReference = React.useRef(null);
|
|
1755
|
+
return /*#__PURE__*/jsxRuntime.jsx(reactTransitionGroup.CSSTransition, {
|
|
1756
|
+
...rest,
|
|
1757
|
+
nodeRef: localReference,
|
|
1758
|
+
in: open
|
|
1759
|
+
// Wait for animation to finish before unmount.
|
|
1760
|
+
,
|
|
1761
|
+
timeout: {
|
|
1762
|
+
enter: 0,
|
|
1763
|
+
exit: EXIT_ANIMATION
|
|
1764
|
+
},
|
|
1765
|
+
classNames: classNames__default.default(`sliding-panel--open-${position}`, showSlidingPanelBorder && `sliding-panel--border-${position}`, {
|
|
1766
|
+
'sliding-panel--fixed': slidingPanelPositionFixed
|
|
1767
|
+
}, 'sliding-panel'),
|
|
1768
|
+
appear: true,
|
|
1769
|
+
unmountOnExit: true,
|
|
1770
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1771
|
+
ref: mergeRefs__default.default([reference, localReference]),
|
|
1772
|
+
className: classNames__default.default('sliding-panel', `sliding-panel--open-${position}`, className),
|
|
1773
|
+
children: children
|
|
1774
|
+
})
|
|
1775
|
+
});
|
|
1776
|
+
});
|
|
1777
|
+
SlidingPanel.propTypes = {
|
|
1778
|
+
children: PropTypes__default.default.node,
|
|
1779
|
+
className: PropTypes__default.default.string,
|
|
1780
|
+
open: PropTypes__default.default.bool,
|
|
1781
|
+
position: PropTypes__default.default.oneOf(['top', 'bottom', 'left', 'right']),
|
|
1782
|
+
showSlidingPanelBorder: PropTypes__default.default.bool,
|
|
1783
|
+
slidingPanelPositionFixed: PropTypes__default.default.bool
|
|
1784
|
+
};
|
|
1785
|
+
SlidingPanel.defaultProps = {
|
|
1786
|
+
children: null,
|
|
1787
|
+
className: undefined,
|
|
1788
|
+
open: false,
|
|
1789
|
+
position: 'left',
|
|
1790
|
+
showSlidingPanelBorder: false,
|
|
1791
|
+
slidingPanelPositionFixed: false
|
|
1792
|
+
};
|
|
1793
|
+
var SlidingPanel$1 = SlidingPanel;
|
|
1794
|
+
|
|
1744
1795
|
const THROTTLE_MS = 100;
|
|
1745
1796
|
const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
1746
1797
|
const useClientWidth = ({
|
|
@@ -1911,137 +1962,6 @@ const useLayout = () => {
|
|
|
1911
1962
|
};
|
|
1912
1963
|
};
|
|
1913
1964
|
|
|
1914
|
-
const EXIT_ANIMATION = 350;
|
|
1915
|
-
const SlidingPanel = /*#__PURE__*/React.forwardRef(({
|
|
1916
|
-
children,
|
|
1917
|
-
className,
|
|
1918
|
-
open,
|
|
1919
|
-
position,
|
|
1920
|
-
showSlidingPanelBorder,
|
|
1921
|
-
slidingPanelPositionFixed,
|
|
1922
|
-
...rest
|
|
1923
|
-
}, reference) => {
|
|
1924
|
-
/** @type {RefObject<HTMLDivElement>} */
|
|
1925
|
-
const localReference = React.useRef(null);
|
|
1926
|
-
return /*#__PURE__*/jsxRuntime.jsx(reactTransitionGroup.CSSTransition, {
|
|
1927
|
-
...rest,
|
|
1928
|
-
nodeRef: localReference,
|
|
1929
|
-
in: open
|
|
1930
|
-
// Wait for animation to finish before unmount.
|
|
1931
|
-
,
|
|
1932
|
-
timeout: {
|
|
1933
|
-
enter: 0,
|
|
1934
|
-
exit: EXIT_ANIMATION
|
|
1935
|
-
},
|
|
1936
|
-
classNames: classNames__default.default(`sliding-panel--open-${position}`, showSlidingPanelBorder && `sliding-panel--border-${position}`, {
|
|
1937
|
-
'sliding-panel--fixed': slidingPanelPositionFixed
|
|
1938
|
-
}, 'sliding-panel'),
|
|
1939
|
-
appear: true,
|
|
1940
|
-
unmountOnExit: true,
|
|
1941
|
-
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1942
|
-
ref: mergeRefs__default.default([reference, localReference]),
|
|
1943
|
-
className: classNames__default.default('sliding-panel', `sliding-panel--open-${position}`, className),
|
|
1944
|
-
children: children
|
|
1945
|
-
})
|
|
1946
|
-
});
|
|
1947
|
-
});
|
|
1948
|
-
SlidingPanel.propTypes = {
|
|
1949
|
-
children: PropTypes__default.default.node,
|
|
1950
|
-
className: PropTypes__default.default.string,
|
|
1951
|
-
open: PropTypes__default.default.bool,
|
|
1952
|
-
position: PropTypes__default.default.oneOf(['top', 'bottom', 'left', 'right']),
|
|
1953
|
-
showSlidingPanelBorder: PropTypes__default.default.bool,
|
|
1954
|
-
slidingPanelPositionFixed: PropTypes__default.default.bool
|
|
1955
|
-
};
|
|
1956
|
-
SlidingPanel.defaultProps = {
|
|
1957
|
-
children: null,
|
|
1958
|
-
className: undefined,
|
|
1959
|
-
open: false,
|
|
1960
|
-
position: 'left',
|
|
1961
|
-
showSlidingPanelBorder: false,
|
|
1962
|
-
slidingPanelPositionFixed: false
|
|
1963
|
-
};
|
|
1964
|
-
var SlidingPanel$1 = SlidingPanel;
|
|
1965
|
-
|
|
1966
|
-
const Drawer = ({
|
|
1967
|
-
children,
|
|
1968
|
-
className,
|
|
1969
|
-
footerContent,
|
|
1970
|
-
headerTitle,
|
|
1971
|
-
onClose,
|
|
1972
|
-
open,
|
|
1973
|
-
position
|
|
1974
|
-
}) => {
|
|
1975
|
-
logActionRequiredIf('Drawer now expects `onClose`, and will soon make this prop required. Please update your usage to provide it.', !onClose);
|
|
1976
|
-
const {
|
|
1977
|
-
isMobile
|
|
1978
|
-
} = useLayout();
|
|
1979
|
-
return /*#__PURE__*/jsxRuntime.jsx(Dimmer$1, {
|
|
1980
|
-
open: open,
|
|
1981
|
-
onClose: onClose,
|
|
1982
|
-
children: /*#__PURE__*/jsxRuntime.jsx(SlidingPanel$1, {
|
|
1983
|
-
open: open,
|
|
1984
|
-
position: isMobile ? exports.Position.BOTTOM : position,
|
|
1985
|
-
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1986
|
-
className: classNames__default.default('np-drawer', className),
|
|
1987
|
-
role: "dialog",
|
|
1988
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1989
|
-
className: classNames__default.default('np-drawer-header', {
|
|
1990
|
-
'np-drawer-header--withborder': headerTitle
|
|
1991
|
-
}),
|
|
1992
|
-
children: [headerTitle && /*#__PURE__*/jsxRuntime.jsx(Title, {
|
|
1993
|
-
type: exports.Typography.TITLE_BODY,
|
|
1994
|
-
children: headerTitle
|
|
1995
|
-
}), /*#__PURE__*/jsxRuntime.jsx(CloseButton, {
|
|
1996
|
-
onClick: onClose
|
|
1997
|
-
})]
|
|
1998
|
-
}), children && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1999
|
-
className: classNames__default.default('np-drawer-content'),
|
|
2000
|
-
children: children
|
|
2001
|
-
}), footerContent && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2002
|
-
className: classNames__default.default('np-drawer-footer'),
|
|
2003
|
-
children: footerContent
|
|
2004
|
-
})]
|
|
2005
|
-
})
|
|
2006
|
-
})
|
|
2007
|
-
});
|
|
2008
|
-
};
|
|
2009
|
-
Drawer.propTypes = {
|
|
2010
|
-
/** The content to appear in the drawer body. */
|
|
2011
|
-
children: PropTypes__default.default.node,
|
|
2012
|
-
className: PropTypes__default.default.string,
|
|
2013
|
-
/** The content to appear in the drawer footer. */
|
|
2014
|
-
footerContent: PropTypes__default.default.node,
|
|
2015
|
-
/** The content to appear in the drawer header. */
|
|
2016
|
-
headerTitle: PropTypes__default.default.node,
|
|
2017
|
-
/** The action to perform on close click. */
|
|
2018
|
-
onClose: PropTypes__default.default.func,
|
|
2019
|
-
/** The status of Drawer either open or not. */
|
|
2020
|
-
open: PropTypes__default.default.bool,
|
|
2021
|
-
/** The placement of Drawer on the screen either left or right. On mobile it will default to bottom. */
|
|
2022
|
-
position: PropTypes__default.default.oneOf(['left', 'right', 'bottom'])
|
|
2023
|
-
};
|
|
2024
|
-
Drawer.defaultProps = {
|
|
2025
|
-
children: null,
|
|
2026
|
-
className: undefined,
|
|
2027
|
-
footerContent: null,
|
|
2028
|
-
headerTitle: null,
|
|
2029
|
-
onClose: null,
|
|
2030
|
-
open: false,
|
|
2031
|
-
position: exports.Position.RIGHT
|
|
2032
|
-
};
|
|
2033
|
-
var Drawer$1 = Drawer;
|
|
2034
|
-
|
|
2035
|
-
function useMedia(query) {
|
|
2036
|
-
return shim.useSyncExternalStore(onStoreChange => {
|
|
2037
|
-
const mediaQueryList = window.matchMedia(query);
|
|
2038
|
-
mediaQueryList.addEventListener('change', onStoreChange);
|
|
2039
|
-
return () => {
|
|
2040
|
-
mediaQueryList.removeEventListener('change', onStoreChange);
|
|
2041
|
-
};
|
|
2042
|
-
}, () => typeof window !== 'undefined' ? window.matchMedia(query).matches : undefined, () => undefined);
|
|
2043
|
-
}
|
|
2044
|
-
|
|
2045
1965
|
const INITIAL_Y_POSITION = 0;
|
|
2046
1966
|
const CONTENT_SCROLL_THRESHOLD = 1;
|
|
2047
1967
|
const MOVE_OFFSET_THRESHOLD = 50;
|
|
@@ -2169,13 +2089,7 @@ const BottomSheet$1 = props => {
|
|
|
2169
2089
|
maxHeight: `calc(${screenHeight} - ${safeZoneHeight} - ${topbarHeight})`
|
|
2170
2090
|
};
|
|
2171
2091
|
}
|
|
2172
|
-
|
|
2173
|
-
return is400Zoom ? /*#__PURE__*/jsxRuntime.jsx(Drawer$1, {
|
|
2174
|
-
open: props.open,
|
|
2175
|
-
className: props.className,
|
|
2176
|
-
onClose: close,
|
|
2177
|
-
children: props.children
|
|
2178
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(Dimmer$1, {
|
|
2092
|
+
return /*#__PURE__*/jsxRuntime.jsx(Dimmer$1, {
|
|
2179
2093
|
open: props.open,
|
|
2180
2094
|
fadeContentOnEnter: true,
|
|
2181
2095
|
fadeContentOnExit: true,
|
|
@@ -3531,11 +3445,8 @@ const DateHeader = ({
|
|
|
3531
3445
|
dateMode
|
|
3532
3446
|
}) => {
|
|
3533
3447
|
const intl = reactIntl.useIntl();
|
|
3534
|
-
const {
|
|
3535
|
-
isMobile
|
|
3536
|
-
} = useLayout();
|
|
3537
3448
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
3538
|
-
className:
|
|
3449
|
+
className: "text-xs-center p-t-1 p-b-2 clearfix",
|
|
3539
3450
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3540
3451
|
className: "pull-left-single-direction",
|
|
3541
3452
|
children: /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
@@ -4131,8 +4042,7 @@ class DateLookup extends React.PureComponent {
|
|
|
4131
4042
|
viewMonth: (props.value || new Date()).getMonth(),
|
|
4132
4043
|
viewYear: (props.value || new Date()).getFullYear(),
|
|
4133
4044
|
open: false,
|
|
4134
|
-
mode: MODE.DAY
|
|
4135
|
-
isMobile: false
|
|
4045
|
+
mode: MODE.DAY
|
|
4136
4046
|
};
|
|
4137
4047
|
}
|
|
4138
4048
|
static getDerivedStateFromProps(props, state) {
|
|
@@ -4167,10 +4077,6 @@ class DateLookup extends React.PureComponent {
|
|
|
4167
4077
|
if (+this.props.value !== +previousProps.value && this.state.open) {
|
|
4168
4078
|
this.focusOn('.active');
|
|
4169
4079
|
}
|
|
4170
|
-
this.mediaQuery = window.matchMedia(`(max-width: ${exports.Breakpoint.SMALL}px)`);
|
|
4171
|
-
this.setState({
|
|
4172
|
-
isMobile: this.mediaQuery.matches
|
|
4173
|
-
});
|
|
4174
4080
|
}
|
|
4175
4081
|
componentWillUnmount() {
|
|
4176
4082
|
// Prevents memory leak by cleaning state.
|
|
@@ -4303,17 +4209,14 @@ class DateLookup extends React.PureComponent {
|
|
|
4303
4209
|
max,
|
|
4304
4210
|
viewMonth,
|
|
4305
4211
|
viewYear,
|
|
4306
|
-
mode
|
|
4307
|
-
isMobile
|
|
4212
|
+
mode
|
|
4308
4213
|
} = this.state;
|
|
4309
4214
|
const {
|
|
4310
4215
|
placeholder,
|
|
4311
4216
|
monthFormat
|
|
4312
4217
|
} = this.props;
|
|
4313
4218
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4314
|
-
className:
|
|
4315
|
-
'p-a-1': !isMobile
|
|
4316
|
-
}),
|
|
4219
|
+
className: "p-a-1",
|
|
4317
4220
|
children: [mode === MODE.DAY && /*#__PURE__*/jsxRuntime.jsx(DayCalendar$1, {
|
|
4318
4221
|
selectedDate,
|
|
4319
4222
|
min,
|
|
@@ -4821,6 +4724,75 @@ function Display({
|
|
|
4821
4724
|
});
|
|
4822
4725
|
}
|
|
4823
4726
|
|
|
4727
|
+
const Drawer = ({
|
|
4728
|
+
children,
|
|
4729
|
+
className,
|
|
4730
|
+
footerContent,
|
|
4731
|
+
headerTitle,
|
|
4732
|
+
onClose,
|
|
4733
|
+
open,
|
|
4734
|
+
position
|
|
4735
|
+
}) => {
|
|
4736
|
+
logActionRequiredIf('Drawer now expects `onClose`, and will soon make this prop required. Please update your usage to provide it.', !onClose);
|
|
4737
|
+
const {
|
|
4738
|
+
isMobile
|
|
4739
|
+
} = useLayout();
|
|
4740
|
+
return /*#__PURE__*/jsxRuntime.jsx(Dimmer$1, {
|
|
4741
|
+
open: open,
|
|
4742
|
+
onClose: onClose,
|
|
4743
|
+
children: /*#__PURE__*/jsxRuntime.jsx(SlidingPanel$1, {
|
|
4744
|
+
open: open,
|
|
4745
|
+
position: isMobile ? exports.Position.BOTTOM : position,
|
|
4746
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4747
|
+
className: classNames__default.default('np-drawer', className),
|
|
4748
|
+
role: "dialog",
|
|
4749
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4750
|
+
className: classNames__default.default('np-drawer-header', {
|
|
4751
|
+
'np-drawer-header--withborder': headerTitle
|
|
4752
|
+
}),
|
|
4753
|
+
children: [headerTitle && /*#__PURE__*/jsxRuntime.jsx(Title, {
|
|
4754
|
+
type: exports.Typography.TITLE_BODY,
|
|
4755
|
+
children: headerTitle
|
|
4756
|
+
}), /*#__PURE__*/jsxRuntime.jsx(CloseButton, {
|
|
4757
|
+
onClick: onClose
|
|
4758
|
+
})]
|
|
4759
|
+
}), children && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4760
|
+
className: classNames__default.default('np-drawer-content'),
|
|
4761
|
+
children: children
|
|
4762
|
+
}), footerContent && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4763
|
+
className: classNames__default.default('np-drawer-footer'),
|
|
4764
|
+
children: footerContent
|
|
4765
|
+
})]
|
|
4766
|
+
})
|
|
4767
|
+
})
|
|
4768
|
+
});
|
|
4769
|
+
};
|
|
4770
|
+
Drawer.propTypes = {
|
|
4771
|
+
/** The content to appear in the drawer body. */
|
|
4772
|
+
children: PropTypes__default.default.node,
|
|
4773
|
+
className: PropTypes__default.default.string,
|
|
4774
|
+
/** The content to appear in the drawer footer. */
|
|
4775
|
+
footerContent: PropTypes__default.default.node,
|
|
4776
|
+
/** The content to appear in the drawer header. */
|
|
4777
|
+
headerTitle: PropTypes__default.default.node,
|
|
4778
|
+
/** The action to perform on close click. */
|
|
4779
|
+
onClose: PropTypes__default.default.func,
|
|
4780
|
+
/** The status of Drawer either open or not. */
|
|
4781
|
+
open: PropTypes__default.default.bool,
|
|
4782
|
+
/** The placement of Drawer on the screen either left or right. On mobile it will default to bottom. */
|
|
4783
|
+
position: PropTypes__default.default.oneOf(['left', 'right', 'bottom'])
|
|
4784
|
+
};
|
|
4785
|
+
Drawer.defaultProps = {
|
|
4786
|
+
children: null,
|
|
4787
|
+
className: undefined,
|
|
4788
|
+
footerContent: null,
|
|
4789
|
+
headerTitle: null,
|
|
4790
|
+
onClose: null,
|
|
4791
|
+
open: false,
|
|
4792
|
+
position: exports.Position.RIGHT
|
|
4793
|
+
};
|
|
4794
|
+
var Drawer$1 = Drawer;
|
|
4795
|
+
|
|
4824
4796
|
const DropFade = ({
|
|
4825
4797
|
children,
|
|
4826
4798
|
show
|
|
@@ -5953,14 +5925,13 @@ const Modal = ({
|
|
|
5953
5925
|
}) => {
|
|
5954
5926
|
const checkSpecialClasses = classToCheck => className?.split(' ').includes(classToCheck);
|
|
5955
5927
|
const {
|
|
5956
|
-
isMobile
|
|
5957
|
-
isMedium: isTablet
|
|
5928
|
+
isMobile
|
|
5958
5929
|
} = useLayout();
|
|
5959
5930
|
// These should be replaced with props in breaking change.
|
|
5960
5931
|
const isCompact = checkSpecialClasses('compact');
|
|
5961
5932
|
const noDivider = checkSpecialClasses('no-divider');
|
|
5962
5933
|
const contentReference = React.useRef(null);
|
|
5963
|
-
return isMobile
|
|
5934
|
+
return isMobile ? /*#__PURE__*/jsxRuntime.jsx(Drawer$1, {
|
|
5964
5935
|
open: open,
|
|
5965
5936
|
headerTitle: title,
|
|
5966
5937
|
footerContent: footer,
|
|
@@ -6383,6 +6354,16 @@ const SearchInput = /*#__PURE__*/React.forwardRef(function SearchInput({
|
|
|
6383
6354
|
});
|
|
6384
6355
|
});
|
|
6385
6356
|
|
|
6357
|
+
function useMedia(query) {
|
|
6358
|
+
return shim.useSyncExternalStore(onStoreChange => {
|
|
6359
|
+
const mediaQueryList = window.matchMedia(query);
|
|
6360
|
+
mediaQueryList.addEventListener('change', onStoreChange);
|
|
6361
|
+
return () => {
|
|
6362
|
+
mediaQueryList.removeEventListener('change', onStoreChange);
|
|
6363
|
+
};
|
|
6364
|
+
}, () => typeof window !== 'undefined' ? window.matchMedia(query).matches : undefined, () => undefined);
|
|
6365
|
+
}
|
|
6366
|
+
|
|
6386
6367
|
function useScreenSize(size) {
|
|
6387
6368
|
return useMedia(`(min-width: ${size}px)`);
|
|
6388
6369
|
}
|
|
@@ -6643,7 +6624,7 @@ function Popover({
|
|
|
6643
6624
|
}
|
|
6644
6625
|
|
|
6645
6626
|
function searchableString(value) {
|
|
6646
|
-
return value.trim().replace(/\s+/gu, ' ').toLowerCase();
|
|
6627
|
+
return value.trim().replace(/\s+/gu, ' ').normalize('NFKC').toLowerCase();
|
|
6647
6628
|
}
|
|
6648
6629
|
function inferSearchableStrings(value) {
|
|
6649
6630
|
if (typeof value === 'string') {
|