@mezzanine-ui/react 1.0.0-canary.2 → 1.0.0-canary.3
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/AlertBanner/AlertBanner.d.ts +93 -0
- package/AlertBanner/AlertBanner.js +135 -0
- package/AlertBanner/index.d.ts +2 -0
- package/AlertBanner/index.js +1 -0
- package/{Overlay/Overlay.d.ts → Backdrop/Backdrop.d.ts} +12 -16
- package/Backdrop/Backdrop.js +33 -0
- package/Backdrop/index.d.ts +2 -0
- package/Backdrop/index.js +1 -0
- package/Badge/Badge.d.ts +20 -14
- package/Badge/Badge.js +14 -16
- package/Badge/BadgeContainer.d.ts +1 -1
- package/Badge/BadgeContainer.js +1 -1
- package/Badge/index.d.ts +1 -2
- package/Badge/typings.d.ts +42 -0
- package/Button/Button.js +2 -2
- package/Calendar/CalendarContext.js +1 -1
- package/DismissButton/DismissButton.d.ts +34 -0
- package/DismissButton/DismissButton.js +19 -0
- package/DismissButton/index.d.ts +3 -0
- package/DismissButton/index.js +5 -0
- package/Drawer/Drawer.js +2 -2
- package/Dropdown/Dropdown.js +12 -22
- package/InlineMessage/InlineMessage.d.ts +33 -0
- package/InlineMessage/InlineMessage.js +37 -0
- package/InlineMessage/InlineMessageGroup.d.ts +24 -0
- package/InlineMessage/InlineMessageGroup.js +21 -0
- package/InlineMessage/index.d.ts +4 -0
- package/InlineMessage/index.js +2 -0
- package/Message/Message.d.ts +4 -2
- package/Message/Message.js +85 -8
- package/Message/MessageTimerController.d.ts +14 -0
- package/Message/MessageTimerController.js +27 -0
- package/Modal/Modal.js +2 -2
- package/Modal/useModalContainer.d.ts +1 -1
- package/Modal/useModalContainer.js +2 -4
- package/Navigation/NavigationSubMenu.js +15 -26
- package/Notifier/NotifierManager.d.ts +15 -2
- package/Notifier/NotifierManager.js +60 -18
- package/Notifier/createNotifier.d.ts +9 -0
- package/Notifier/createNotifier.js +3 -2
- package/Notifier/typings.d.ts +3 -1
- package/PageFooter/PageFooter.d.ts +58 -8
- package/PageFooter/PageFooter.js +34 -3
- package/Popover/Popover.js +4 -8
- package/Popper/Popper.d.ts +15 -10
- package/Popper/Popper.js +88 -17
- package/Popper/index.d.ts +1 -1
- package/Portal/Portal.d.ts +13 -5
- package/Portal/Portal.js +25 -10
- package/Portal/index.d.ts +2 -0
- package/Portal/index.js +1 -0
- package/Portal/portalRegistry.d.ts +17 -0
- package/Portal/portalRegistry.js +99 -0
- package/Provider/ConfigProvider.d.ts +1 -0
- package/Provider/ConfigProvider.js +1 -0
- package/ResultState/ResultState.d.ts +36 -0
- package/ResultState/ResultState.js +24 -0
- package/ResultState/index.d.ts +2 -0
- package/ResultState/index.js +1 -0
- package/Skeleton/Skeleton.d.ts +10 -3
- package/Skeleton/Skeleton.js +12 -4
- package/Spin/Spin.d.ts +39 -0
- package/{Loading/Loading.js → Spin/Spin.js} +8 -8
- package/Spin/index.d.ts +2 -0
- package/Spin/index.js +1 -0
- package/Stepper/Step.d.ts +1 -35
- package/Stepper/Step.js +43 -10
- package/Stepper/Stepper.d.ts +1 -14
- package/Stepper/Stepper.js +49 -15
- package/Stepper/index.d.ts +3 -2
- package/Stepper/index.js +1 -0
- package/Stepper/typings.d.ts +77 -0
- package/Stepper/useStepDistance.d.ts +10 -0
- package/Stepper/useStepDistance.js +81 -0
- package/Stepper/useStepper.d.ts +21 -0
- package/Stepper/useStepper.js +26 -0
- package/Table/Table.js +2 -2
- package/Table/TableBody.js +2 -2
- package/Tag/Tag.d.ts +2 -25
- package/Tag/Tag.js +14 -13
- package/Tag/index.d.ts +1 -1
- package/Tag/typings.d.ts +79 -0
- package/Toggle/Toggle.d.ts +46 -0
- package/Toggle/Toggle.js +29 -0
- package/Toggle/index.d.ts +3 -0
- package/Toggle/index.js +1 -0
- package/Tooltip/Tooltip.d.ts +13 -2
- package/Tooltip/Tooltip.js +48 -10
- package/Tooltip/useDelayMouseEnterLeave.d.ts +1 -2
- package/Tooltip/useDelayMouseEnterLeave.js +0 -4
- package/Tree/TreeNode.js +5 -5
- package/_internal/InputTriggerPopper/InputTriggerPopper.js +14 -24
- package/_internal/SlideFadeOverlay/SlideFadeOverlay.d.ts +2 -2
- package/_internal/SlideFadeOverlay/SlideFadeOverlay.js +4 -27
- package/hooks/useScrollLock.d.ts +28 -0
- package/hooks/useScrollLock.js +134 -0
- package/index.d.ts +87 -80
- package/index.js +74 -69
- package/package.json +7 -7
- package/utils/get-css-variable-value.d.ts +1 -0
- package/utils/get-css-variable-value.js +9 -0
- package/Loading/Loading.d.ts +0 -33
- package/Loading/index.d.ts +0 -2
- package/Loading/index.js +0 -1
- package/Overlay/Overlay.js +0 -31
- package/Overlay/index.d.ts +0 -2
- package/Overlay/index.js +0 -1
- package/Switch/Switch.d.ts +0 -43
- package/Switch/Switch.js +0 -29
- package/Switch/index.d.ts +0 -3
- package/Switch/index.js +0 -1
- package/utils/scroll-lock.d.ts +0 -2
- package/utils/scroll-lock.js +0 -24
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mezzanine-ui/react",
|
|
3
|
-
"version": "1.0.0-canary.
|
|
3
|
+
"version": "1.0.0-canary.3",
|
|
4
4
|
"description": "React components for mezzanine-ui",
|
|
5
5
|
"author": "Mezzanine",
|
|
6
6
|
"repository": {
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
"react-dom": ">=18"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
+
"@floating-ui/dom": "^1.7.4",
|
|
32
|
+
"@floating-ui/react-dom": "^2.1.6",
|
|
31
33
|
"@hello-pangea/dnd": "^18.0.1",
|
|
32
|
-
"@mezzanine-ui/core": "^1.0.0-canary.
|
|
33
|
-
"@mezzanine-ui/icons": "^1.0.0-canary.
|
|
34
|
-
"@mezzanine-ui/system": "^1.0.0-canary.
|
|
35
|
-
"@popperjs/core": "^2.11.8",
|
|
34
|
+
"@mezzanine-ui/core": "^1.0.0-canary.3",
|
|
35
|
+
"@mezzanine-ui/icons": "^1.0.0-canary.2",
|
|
36
|
+
"@mezzanine-ui/system": "^1.0.0-canary.2",
|
|
36
37
|
"@types/react-transition-group": "^4.4.12",
|
|
37
38
|
"clsx": "^2.1.1",
|
|
38
39
|
"lodash": "^4.17.21",
|
|
39
|
-
"react-popper": "^2.3.0",
|
|
40
40
|
"react-transition-group": "^4.4.5",
|
|
41
41
|
"tslib": "^2.8.1"
|
|
42
42
|
},
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@types/moment": "^2.13.0",
|
|
46
46
|
"@types/react": "^19.2.2",
|
|
47
47
|
"@types/react-dom": "^19.2.2",
|
|
48
|
-
"dayjs": "^1.11.
|
|
48
|
+
"dayjs": "^1.11.19",
|
|
49
49
|
"lodash": "^4.17.21",
|
|
50
50
|
"luxon": "^3.7.2",
|
|
51
51
|
"moment": "^2.30.1",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getCSSVariableValue(variableName: string): string;
|
package/Loading/Loading.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { IconProps } from '../Icon';
|
|
2
|
-
import { OverlayProps } from '../Overlay';
|
|
3
|
-
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
4
|
-
export interface LoadingProps extends NativeElementPropsWithoutKeyAndRef<'div'> {
|
|
5
|
-
/**
|
|
6
|
-
* When set stretch=true, host container will stretch to width & height 100%
|
|
7
|
-
* @default false
|
|
8
|
-
*/
|
|
9
|
-
stretch?: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Custom icon props
|
|
12
|
-
*/
|
|
13
|
-
iconProps?: Omit<IconProps, 'icon' | 'spin'>;
|
|
14
|
-
/**
|
|
15
|
-
* Whether Loading is loading.
|
|
16
|
-
* @default false
|
|
17
|
-
*/
|
|
18
|
-
loading?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Custom overlay props (only display when nested children)
|
|
21
|
-
*/
|
|
22
|
-
overlayProps?: Omit<OverlayProps, 'container' | 'open'>;
|
|
23
|
-
/**
|
|
24
|
-
* Customize description content
|
|
25
|
-
*/
|
|
26
|
-
tip?: string;
|
|
27
|
-
/**
|
|
28
|
-
* Customize description content className
|
|
29
|
-
*/
|
|
30
|
-
tipClassName?: string;
|
|
31
|
-
}
|
|
32
|
-
declare const Loading: import("react").ForwardRefExoticComponent<LoadingProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
33
|
-
export default Loading;
|
package/Loading/index.d.ts
DELETED
package/Loading/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './Loading.js';
|
package/Overlay/Overlay.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { overlayClasses } from '@mezzanine-ui/core/overlay';
|
|
4
|
-
import Portal from '../Portal/Portal.js';
|
|
5
|
-
import Fade from '../Transition/Fade.js';
|
|
6
|
-
import cx from 'clsx';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* The react component for `mezzanine` overlay.
|
|
10
|
-
*/
|
|
11
|
-
const Overlay = forwardRef(function Overlay(props, ref) {
|
|
12
|
-
const { children, className, container, disableCloseOnBackdropClick = false, disablePortal, hideBackdrop = false, invisibleBackdrop = false, onBackdropClick, onClose, onSurface, open = false, ...rest } = props;
|
|
13
|
-
const fixedAtBody = Boolean(!container);
|
|
14
|
-
return (jsx(Portal, { container: container, disablePortal: disablePortal, children: jsxs("div", { ...rest, ref: ref, className: cx(overlayClasses.host, {
|
|
15
|
-
[overlayClasses.hostFixed]: fixedAtBody,
|
|
16
|
-
[overlayClasses.hostOpen]: open,
|
|
17
|
-
}, className), children: [hideBackdrop ? null : (jsx(Fade, { in: open, children: jsx("div", { "aria-hidden": true, className: cx(overlayClasses.backdrop, {
|
|
18
|
-
[overlayClasses.backdropFixed]: fixedAtBody,
|
|
19
|
-
[overlayClasses.invisible]: invisibleBackdrop,
|
|
20
|
-
[overlayClasses.backdropOnSurface]: onSurface,
|
|
21
|
-
}), onClick: (event) => {
|
|
22
|
-
if (!disableCloseOnBackdropClick && onClose) {
|
|
23
|
-
onClose();
|
|
24
|
-
}
|
|
25
|
-
if (onBackdropClick) {
|
|
26
|
-
onBackdropClick(event);
|
|
27
|
-
}
|
|
28
|
-
} }) })), children] }) }));
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
export { Overlay as default };
|
package/Overlay/index.d.ts
DELETED
package/Overlay/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './Overlay.js';
|
package/Switch/Switch.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { ChangeEventHandler } from 'react';
|
|
2
|
-
import { SwitchSize } from '@mezzanine-ui/core/switch';
|
|
3
|
-
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
4
|
-
export interface SwitchProps extends Omit<NativeElementPropsWithoutKeyAndRef<'span'>, 'onChange'> {
|
|
5
|
-
/**
|
|
6
|
-
* Whether the switch is checked.
|
|
7
|
-
*/
|
|
8
|
-
checked?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Whether the switch is checked by default.
|
|
11
|
-
* Only used for uncontrolled.
|
|
12
|
-
*/
|
|
13
|
-
defaultChecked?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Whether the switch is disabled.
|
|
16
|
-
* @default false
|
|
17
|
-
*/
|
|
18
|
-
disabled?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Since at Mezzanine we use a host element to wrap our input, most derived props will be passed to the host element.
|
|
21
|
-
* If you need direct control to the input element, use this prop to provide to it.
|
|
22
|
-
*/
|
|
23
|
-
inputProps?: Omit<NativeElementPropsWithoutKeyAndRef<'input'>, 'checked' | 'defaultChecked' | 'disabled' | 'onChange' | 'placeholder' | 'type' | 'value' | `aria-${'disabled' | 'checked'}`>;
|
|
24
|
-
/**
|
|
25
|
-
* Whether the switch is loading.
|
|
26
|
-
* @default false
|
|
27
|
-
*/
|
|
28
|
-
loading?: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Invoked by input change event.
|
|
31
|
-
*/
|
|
32
|
-
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
33
|
-
/**
|
|
34
|
-
* The size of switch.
|
|
35
|
-
* @default 'medium'
|
|
36
|
-
*/
|
|
37
|
-
size?: SwitchSize;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* The react component for `mezzanine` switch.
|
|
41
|
-
*/
|
|
42
|
-
declare const Switch: import("react").ForwardRefExoticComponent<SwitchProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
43
|
-
export default Switch;
|
package/Switch/Switch.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { forwardRef, useContext } from 'react';
|
|
4
|
-
import { switchClasses, SwitchSpinnerIcon } from '@mezzanine-ui/core/switch';
|
|
5
|
-
import { useSwitchControlValue } from '../Form/useSwitchControlValue.js';
|
|
6
|
-
import { FormControlContext } from '../Form/FormControlContext.js';
|
|
7
|
-
import Icon from '../Icon/Icon.js';
|
|
8
|
-
import cx from 'clsx';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* The react component for `mezzanine` switch.
|
|
12
|
-
*/
|
|
13
|
-
const Switch = forwardRef(function Switch(props, ref) {
|
|
14
|
-
const { disabled: disabledFromFormControl } = useContext(FormControlContext) || {};
|
|
15
|
-
const { checked: checkedProp, className, defaultChecked, disabled: disabledProp = disabledFromFormControl, inputProps, loading = false, onChange: onChangeProp, size = 'medium', ...rest } = props;
|
|
16
|
-
const [checked, onChange] = useSwitchControlValue({
|
|
17
|
-
checked: checkedProp,
|
|
18
|
-
defaultChecked,
|
|
19
|
-
onChange: onChangeProp,
|
|
20
|
-
});
|
|
21
|
-
const disabled = loading || disabledProp;
|
|
22
|
-
return (jsxs("span", { ref: ref, ...rest, className: cx(switchClasses.host, {
|
|
23
|
-
[switchClasses.checked]: checked,
|
|
24
|
-
[switchClasses.disabled]: disabled,
|
|
25
|
-
[switchClasses.large]: size === 'large',
|
|
26
|
-
}, className), children: [jsx("span", { className: switchClasses.control, children: loading && jsx(Icon, { icon: SwitchSpinnerIcon, spin: true }) }), jsx("input", { ...inputProps, "aria-checked": checked, "aria-disabled": disabled, checked: checked, className: switchClasses.input, disabled: disabled, onChange: onChange, type: "checkbox" })] }));
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
export { Switch as default };
|
package/Switch/index.d.ts
DELETED
package/Switch/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './Switch.js';
|
package/utils/scroll-lock.d.ts
DELETED
package/utils/scroll-lock.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { getScrollbarWidth } from './get-scrollbar-width.js';
|
|
2
|
-
|
|
3
|
-
function lockBodyScroll() {
|
|
4
|
-
const { scrollY } = window;
|
|
5
|
-
// Calculate scroll bar width and use padding-right to remain layout width.
|
|
6
|
-
const scrollbarWidth = getScrollbarWidth();
|
|
7
|
-
document.body.style.position = 'fixed';
|
|
8
|
-
document.body.style.top = `-${scrollY}px`;
|
|
9
|
-
document.body.style.paddingRight = `${scrollbarWidth}px`;
|
|
10
|
-
document.body.style.overflow = 'hidden';
|
|
11
|
-
}
|
|
12
|
-
function allowBodyScroll() {
|
|
13
|
-
var _a, _b;
|
|
14
|
-
const scrollY = Number(((_b = (_a = document.body.style) === null || _a === void 0 ? void 0 : _a.top) !== null && _b !== void 0 ? _b : '0').replace(/px/gi, ''));
|
|
15
|
-
if (document.body.style.position === 'fixed') {
|
|
16
|
-
document.body.style.position = '';
|
|
17
|
-
document.body.style.top = '';
|
|
18
|
-
document.body.style.paddingRight = '';
|
|
19
|
-
document.body.style.overflow = '';
|
|
20
|
-
window.scrollTo(0, (scrollY || 0) * -1);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { allowBodyScroll, lockBodyScroll };
|