@mezzanine-ui/react 1.0.0-beta.2 → 1.0.0-beta.4
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/Anchor/Anchor.d.ts +51 -18
- package/Anchor/Anchor.js +15 -15
- package/Anchor/AnchorGroup.d.ts +34 -0
- package/Anchor/AnchorGroup.js +37 -0
- package/Anchor/AnchorItem.d.ts +30 -0
- package/Anchor/AnchorItem.js +65 -0
- package/Anchor/index.d.ts +2 -0
- package/Anchor/index.js +1 -0
- package/Anchor/utils.d.ts +13 -0
- package/Anchor/utils.js +95 -0
- package/AutoComplete/AutoComplete.d.ts +217 -0
- package/AutoComplete/AutoComplete.js +433 -0
- package/AutoComplete/index.d.ts +2 -0
- package/AutoComplete/index.js +1 -0
- package/AutoComplete/useAutoCompleteCreation.d.ts +33 -0
- package/AutoComplete/useAutoCompleteCreation.js +201 -0
- package/AutoComplete/useAutoCompleteKeyboard.d.ts +31 -0
- package/AutoComplete/useAutoCompleteKeyboard.js +149 -0
- package/AutoComplete/useAutoCompleteSearch.d.ts +16 -0
- package/AutoComplete/useAutoCompleteSearch.js +69 -0
- package/AutoComplete/useCreationTracker.d.ts +17 -0
- package/AutoComplete/useCreationTracker.js +47 -0
- package/Breadcrumb/Breadcrumb.js +16 -21
- package/Breadcrumb/BreadcrumbDropdown.d.ts +11 -0
- package/Breadcrumb/BreadcrumbDropdown.js +22 -0
- package/Breadcrumb/BreadcrumbItem.d.ts +2 -3
- package/Breadcrumb/BreadcrumbItem.js +13 -31
- package/Breadcrumb/BreadcrumbOverflowMenu.d.ts +7 -0
- package/Breadcrumb/BreadcrumbOverflowMenu.js +77 -0
- package/Breadcrumb/BreadcrumbOverflowMenuDropdown.d.ts +11 -0
- package/Breadcrumb/BreadcrumbOverflowMenuDropdown.js +21 -0
- package/Breadcrumb/BreadcrumbOverflowMenuItem.d.ts +3 -0
- package/Breadcrumb/BreadcrumbOverflowMenuItem.js +27 -0
- package/Breadcrumb/typings.d.ts +21 -39
- package/Button/Button.js +13 -11
- package/Button/index.d.ts +1 -1
- package/Button/typings.d.ts +27 -4
- package/Checkbox/index.d.ts +4 -5
- package/Checkbox/index.js +1 -5
- package/ContentHeader/ContentHeader.d.ts +160 -0
- package/ContentHeader/ContentHeader.js +54 -0
- package/ContentHeader/index.d.ts +2 -0
- package/ContentHeader/index.js +1 -0
- package/ContentHeader/utils.d.ts +23 -0
- package/ContentHeader/utils.js +215 -0
- package/Description/Description.d.ts +12 -22
- package/Description/Description.js +4 -24
- package/Dropdown/Dropdown.d.ts +46 -1
- package/Dropdown/Dropdown.js +99 -14
- package/Dropdown/DropdownAction.d.ts +1 -1
- package/Dropdown/DropdownAction.js +1 -4
- package/Dropdown/DropdownItem.d.ts +28 -1
- package/Dropdown/DropdownItem.js +56 -14
- package/Dropdown/DropdownItemCard.d.ts +2 -2
- package/Dropdown/DropdownItemCard.js +20 -16
- package/Dropdown/DropdownStatus.js +29 -0
- package/Dropdown/dropdownKeydownHandler.d.ts +2 -1
- package/Dropdown/dropdownKeydownHandler.js +73 -0
- package/Dropdown/highlightText.js +5 -1
- package/Dropdown/shortcutTextHandler.d.ts +24 -0
- package/Dropdown/shortcutTextHandler.js +171 -0
- package/Empty/Empty.js +2 -1
- package/Empty/icons/EmptyMainNotificationIcon.d.ts +4 -0
- package/Empty/icons/EmptyMainNotificationIcon.js +9 -0
- package/Empty/typings.d.ts +2 -2
- package/FilterArea/Filter.d.ts +32 -0
- package/FilterArea/Filter.js +23 -0
- package/FilterArea/FilterArea.d.ts +58 -0
- package/FilterArea/FilterArea.js +31 -0
- package/FilterArea/FilterLine.d.ts +11 -0
- package/FilterArea/FilterLine.js +13 -0
- package/FilterArea/index.d.ts +6 -0
- package/FilterArea/index.js +3 -0
- package/Form/FormField.js +3 -1
- package/Input/Input.d.ts +35 -7
- package/Input/Input.js +48 -14
- package/Input/index.d.ts +1 -1
- package/Modal/MediaPreviewModal.d.ts +54 -0
- package/Modal/MediaPreviewModal.js +158 -0
- package/Modal/Modal.d.ts +103 -11
- package/Modal/Modal.js +14 -9
- package/Modal/ModalBodyForVerification.d.ts +59 -0
- package/Modal/ModalBodyForVerification.js +99 -0
- package/Modal/ModalControl.d.ts +2 -2
- package/Modal/ModalControl.js +1 -1
- package/Modal/ModalFooter.d.ts +119 -1
- package/Modal/ModalFooter.js +15 -3
- package/Modal/ModalHeader.d.ts +26 -7
- package/Modal/ModalHeader.js +33 -7
- package/Modal/index.d.ts +6 -5
- package/Modal/index.js +2 -2
- package/Modal/useModalContainer.d.ts +12 -3
- package/Modal/useModalContainer.js +28 -6
- package/Navigation/Navigation.d.ts +7 -2
- package/Navigation/Navigation.js +36 -35
- package/Navigation/NavigationHeader.d.ts +4 -0
- package/Navigation/NavigationHeader.js +3 -2
- package/Navigation/NavigationOption.d.ts +8 -3
- package/Navigation/NavigationOption.js +46 -11
- package/Navigation/NavigationOptionCategory.js +1 -0
- package/Navigation/NavigationOverflowMenu.d.ts +6 -0
- package/Navigation/NavigationOverflowMenu.js +90 -0
- package/Navigation/NavigationOverflowMenuOption.d.ts +7 -0
- package/Navigation/NavigationOverflowMenuOption.js +68 -0
- package/Navigation/NavigationUserMenu.d.ts +4 -2
- package/Navigation/NavigationUserMenu.js +13 -5
- package/Navigation/context.d.ts +3 -2
- package/Navigation/useVisibleItems.d.ts +5 -0
- package/Navigation/useVisibleItems.js +54 -0
- package/NotificationCenter/NotificationCenter.d.ts +124 -0
- package/NotificationCenter/NotificationCenter.js +279 -0
- package/NotificationCenter/NotificationCenterDrawer.d.ts +109 -0
- package/NotificationCenter/index.d.ts +3 -0
- package/NotificationCenter/index.js +1 -0
- package/PageFooter/PageFooter.d.ts +19 -9
- package/PageFooter/PageFooter.js +10 -10
- package/PageHeader/PageHeader.d.ts +32 -25
- package/PageHeader/PageHeader.js +49 -43
- package/ResultState/ResultState.d.ts +9 -0
- package/ResultState/ResultState.js +36 -4
- package/Scrollbar/Scrollbar.d.ts +9 -0
- package/Scrollbar/Scrollbar.js +78 -0
- package/Scrollbar/index.d.ts +2 -0
- package/Scrollbar/index.js +1 -0
- package/Scrollbar/typings.d.ts +47 -0
- package/Select/SelectTrigger.js +5 -4
- package/Select/index.d.ts +0 -2
- package/Select/index.js +0 -1
- package/Select/typings.d.ts +6 -1
- package/Selection/Selection.js +1 -1
- package/Selection/SelectionGroup.d.ts +28 -0
- package/Slider/useSlider.js +1 -1
- package/Table/Table.d.ts +2 -120
- package/Table/Table.js +148 -53
- package/Table/TableContext.d.ts +11 -12
- package/Table/components/TableActionsCell.js +12 -4
- package/Table/components/TableBody.js +2 -1
- package/Table/components/TableBulkActions.js +1 -19
- package/Table/components/TableColGroup.d.ts +1 -4
- package/Table/components/TableColGroup.js +15 -16
- package/Table/components/TableCollectableCell.d.ts +17 -0
- package/Table/components/TableCollectableCell.js +54 -0
- package/Table/components/TableDragOrPinHandleCell.d.ts +20 -0
- package/Table/components/TableDragOrPinHandleCell.js +58 -0
- package/Table/components/TableExpandedRow.js +11 -2
- package/Table/components/TableHeader.js +12 -10
- package/Table/components/TableRow.js +38 -13
- package/Table/components/TableSelectionCell.js +1 -1
- package/Table/components/TableToggleableCell.d.ts +16 -0
- package/Table/components/TableToggleableCell.js +51 -0
- package/Table/components/index.d.ts +4 -1
- package/Table/components/index.js +3 -0
- package/Table/hooks/typings.d.ts +18 -4
- package/Table/hooks/useTableExpansion.d.ts +2 -2
- package/Table/hooks/useTableExpansion.js +5 -5
- package/Table/hooks/useTableFixedOffsets.d.ts +6 -2
- package/Table/hooks/useTableFixedOffsets.js +60 -26
- package/Table/hooks/useTableScroll.d.ts +9 -3
- package/Table/hooks/useTableScroll.js +34 -7
- package/Table/hooks/useTableVirtualization.d.ts +2 -1
- package/Table/hooks/useTableVirtualization.js +2 -8
- package/Table/index.d.ts +4 -3
- package/Table/index.js +3 -0
- package/Table/typings.d.ts +172 -0
- package/Table/utils/useTableRowSelection.js +13 -5
- package/Tag/TagGroup.d.ts +3 -0
- package/Tag/index.d.ts +2 -0
- package/Tag/index.js +1 -0
- package/Transition/Slide.d.ts +9 -2
- package/Transition/Slide.js +7 -4
- package/Tree/TreeNode.js +1 -1
- package/Upload/UploadPictureCard.js +1 -1
- package/index.d.ts +37 -21
- package/index.js +25 -11
- package/package.json +6 -4
- package/Modal/ModalActions.d.ts +0 -9
- package/Modal/ModalActions.js +0 -20
- package/Modal/ModalBody.d.ts +0 -7
- package/Modal/ModalBody.js +0 -14
- package/Notification/Notification.d.ts +0 -54
- package/Notification/Notification.js +0 -76
- package/Notification/index.d.ts +0 -3
- package/Notification/index.js +0 -1
- package/PageToolbar/PageToolbar.d.ts +0 -114
- package/PageToolbar/PageToolbar.js +0 -23
- package/PageToolbar/index.d.ts +0 -2
- package/PageToolbar/index.js +0 -1
- package/PageToolbar/utils.d.ts +0 -23
- package/PageToolbar/utils.js +0 -165
- package/Select/AutoComplete.d.ts +0 -107
- package/Select/AutoComplete.js +0 -114
- package/Table/components/TableDragHandleCell.d.ts +0 -11
- package/Table/components/TableDragHandleCell.js +0 -44
package/Transition/Slide.js
CHANGED
|
@@ -6,14 +6,17 @@ import Transition from './Transition.js';
|
|
|
6
6
|
import { reflow } from './reflow.js';
|
|
7
7
|
import { useSetNodeTransition } from './useSetNodeTransition.js';
|
|
8
8
|
|
|
9
|
-
function getStyle(state, inProp) {
|
|
9
|
+
function getStyle(state, inProp, from) {
|
|
10
10
|
if (state === 'entering' || state === 'entered') {
|
|
11
11
|
return {
|
|
12
12
|
transform: 'translate3d(0, 0, 0)',
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
const style = {
|
|
16
|
-
transform:
|
|
16
|
+
transform: {
|
|
17
|
+
top: 'translate3d(0, -100%, 0)',
|
|
18
|
+
right: 'translate3d(100%, 0, 0)',
|
|
19
|
+
}[from],
|
|
17
20
|
};
|
|
18
21
|
if (state === 'exited' && !inProp) {
|
|
19
22
|
style.visibility = 'hidden';
|
|
@@ -32,7 +35,7 @@ const defaultEasing = {
|
|
|
32
35
|
* The react component for `mezzanine` transition slide in/out.
|
|
33
36
|
*/
|
|
34
37
|
const Slide = forwardRef(function Slide(props, ref) {
|
|
35
|
-
const { children, delay = 0, duration: durationProp = defaultDuration, easing = defaultEasing, in: inProp = false, onEnter, onEntered, onExit, onExited, ...rest } = props;
|
|
38
|
+
const { children, delay = 0, duration: durationProp = defaultDuration, easing = defaultEasing, from = 'right', in: inProp = false, onEnter, onEntered, onExit, onExited, ...rest } = props;
|
|
36
39
|
const duration = durationProp === 'auto' ? defaultDuration : durationProp;
|
|
37
40
|
const nodeRef = useRef(null);
|
|
38
41
|
const composedNodeRef = useComposeRefs([ref, nodeRef]);
|
|
@@ -78,7 +81,7 @@ const Slide = forwardRef(function Slide(props, ref) {
|
|
|
78
81
|
...children.props,
|
|
79
82
|
ref: composedNodeRef,
|
|
80
83
|
style: {
|
|
81
|
-
...getStyle(state, inProp),
|
|
84
|
+
...getStyle(state, inProp, from),
|
|
82
85
|
...children.props.style,
|
|
83
86
|
},
|
|
84
87
|
})) }));
|
package/Tree/TreeNode.js
CHANGED
|
@@ -3,11 +3,11 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { treeClasses } from '@mezzanine-ui/core/tree';
|
|
4
4
|
import { CaretRightIcon } from '@mezzanine-ui/icons';
|
|
5
5
|
import { forwardRef, useContext, useMemo } from 'react';
|
|
6
|
-
import Checkbox from '../Checkbox/Checkbox.js';
|
|
7
6
|
import Typography from '../Typography/Typography.js';
|
|
8
7
|
import { MezzanineConfig } from '../Provider/context.js';
|
|
9
8
|
import Spin from '../Spin/Spin.js';
|
|
10
9
|
import Icon from '../Icon/Icon.js';
|
|
10
|
+
import Checkbox from '../Checkbox/Checkbox.js';
|
|
11
11
|
import Collapse from '../Transition/Collapse.js';
|
|
12
12
|
import cx from 'clsx';
|
|
13
13
|
|
|
@@ -95,7 +95,7 @@ const UploadPictureCard = forwardRef(function UploadPictureCard(props, ref) {
|
|
|
95
95
|
return (jsx("div", { className: cx(uploadPictureCardClasses.host, uploadPictureCardClasses.size(size), disabled && uploadPictureCardClasses.disabled, className), "aria-disabled": disabled, ref: ref, role: "group", tabIndex: disabled ? -1 : 0, ...rest, children: jsxs("div", { className: uploadPictureCardClasses.container, children: [isImage && imageUrl && status !== 'error' && (jsx("img", { alt: fileName, src: imageUrl, style: {
|
|
96
96
|
objectFit: imageFit,
|
|
97
97
|
objectPosition: 'center',
|
|
98
|
-
} })), status === 'done' && size !== 'minor' && !isImage && (jsxs("div", { className: uploadPictureCardClasses.content, children: [jsx(Icon, { icon: FileIcon, color: "brand", size: 16 }), jsx(Typography, { className: uploadPictureCardClasses.name, ellipsis: true, children: fileName })] })), status === 'error' && size !== 'minor' && (jsxs("div", { className: uploadPictureCardClasses.errorMessage, role: "alert", "aria-live": "polite", children: [jsx(Icon, { icon: errorIconContent, color: "error", size: 16 }), jsx(Typography, { className: uploadPictureCardClasses.errorMessageText, children: errorMessageContent })] })), jsxs("div", { className: cx(uploadPictureCardClasses.actions, uploadPictureCardClasses.actionsStatus(status)), children: [status === 'loading' && size !== 'minor' && (jsxs(Fragment, { children: [jsx(ClearActions, { type: "embedded", variant: "contrast", onClick: onDelete, className: uploadPictureCardClasses.clearActionsIcon, "aria-label": labels.cancelUpload }), jsx("div", { className: uploadPictureCardClasses.loadingIcon, "aria-label": labels.uploading, children: jsx(Icon, { icon: SpinnerIcon, color: "fixed-light", spin: true, size: 32 }) })] })), status === 'done' && size !== 'minor' && (jsx(Fragment, { children: jsx("div", { className: uploadPictureCardClasses.tools, children: jsxs("div", { className: uploadPictureCardClasses.toolsContent, children: [jsx(Button, { variant: "base-secondary", size: "minor", icon:
|
|
98
|
+
} })), status === 'done' && size !== 'minor' && !isImage && (jsxs("div", { className: uploadPictureCardClasses.content, children: [jsx(Icon, { icon: FileIcon, color: "brand", size: 16 }), jsx(Typography, { className: uploadPictureCardClasses.name, ellipsis: true, children: fileName })] })), status === 'error' && size !== 'minor' && (jsxs("div", { className: uploadPictureCardClasses.errorMessage, role: "alert", "aria-live": "polite", children: [jsx(Icon, { icon: errorIconContent, color: "error", size: 16 }), jsx(Typography, { className: uploadPictureCardClasses.errorMessageText, children: errorMessageContent })] })), jsxs("div", { className: cx(uploadPictureCardClasses.actions, uploadPictureCardClasses.actionsStatus(status)), children: [status === 'loading' && size !== 'minor' && (jsxs(Fragment, { children: [jsx(ClearActions, { type: "embedded", variant: "contrast", onClick: onDelete, className: uploadPictureCardClasses.clearActionsIcon, "aria-label": labels.cancelUpload }), jsx("div", { className: uploadPictureCardClasses.loadingIcon, "aria-label": labels.uploading, children: jsx(Icon, { icon: SpinnerIcon, color: "fixed-light", spin: true, size: 32 }) })] })), status === 'done' && size !== 'minor' && (jsx(Fragment, { children: jsx("div", { className: uploadPictureCardClasses.tools, children: jsxs("div", { className: uploadPictureCardClasses.toolsContent, children: [jsx(Button, { variant: "base-secondary", size: "minor", icon: ZoomInIcon, iconType: "icon-only", onClick: onZoomIn, "aria-label": labels.zoomIn }), jsx(Button, { variant: "base-secondary", size: "minor", iconType: "icon-only", icon: DownloadIcon, onClick: onDownload, "aria-label": labels.download }), jsx(Button, { variant: "base-secondary", size: "minor", iconType: "icon-only", icon: TrashIcon, onClick: onDelete, "aria-label": labels.delete })] }) }) })), status === 'error' && size !== 'minor' && (jsx(Fragment, { children: jsx("div", { className: uploadPictureCardClasses.tools, children: jsxs("div", { className: uploadPictureCardClasses.toolsContent, children: [jsx(Button, { variant: "base-secondary", size: "minor", iconType: "icon-only", icon: ResetIcon, onClick: onReload, "aria-label": labels.reload }), jsx(Button, { variant: "base-secondary", size: "minor", iconType: "icon-only", icon: TrashIcon, onClick: onDelete, "aria-label": labels.delete })] }) }) })), size === 'minor' && (jsx(Icon, { icon: ZoomInIcon, color: "fixed-light", size: 24 }))] })] }) }));
|
|
99
99
|
});
|
|
100
100
|
|
|
101
101
|
export { UploadPictureCard as default };
|
package/index.d.ts
CHANGED
|
@@ -50,20 +50,18 @@ export { default as Breadcrumb } from './Breadcrumb';
|
|
|
50
50
|
export type { BreadcrumbItemProps, BreadcrumbProps } from './Breadcrumb';
|
|
51
51
|
export { default as Drawer } from './Drawer';
|
|
52
52
|
export type { DrawerPlacement, DrawerProps } from './Drawer';
|
|
53
|
-
export { default as Dropdown } from './Dropdown';
|
|
54
|
-
export type { DropdownProps } from './Dropdown';
|
|
55
53
|
export { default as Menu, MenuDivider, MenuItem, MenuItemGroup } from './Menu';
|
|
56
54
|
export type { MenuDividerProps, MenuItemGroupProps, MenuItemProps, MenuProps, MenuSize, } from './Menu';
|
|
57
|
-
export { default as Navigation } from './Navigation';
|
|
58
|
-
export type { NavigationChild, NavigationChildren,
|
|
55
|
+
export { default as Navigation, NavigationFooter, NavigationHeader, NavigationIconButton, NavigationOption, NavigationOptionCategory, NavigationUserMenu, } from './Navigation';
|
|
56
|
+
export type { NavigationChild, NavigationChildren, NavigationFooterProps, NavigationHeaderProps, NavigationIconButtonProps, NavigationOptionCategoryProps, NavigationOptionProps, NavigationProps, NavigationUserMenuProps, } from './Navigation';
|
|
59
57
|
export { default as PageFooter } from './PageFooter';
|
|
60
58
|
export type { PageFooterProps } from './PageFooter';
|
|
61
59
|
export { default as PageHeader } from './PageHeader';
|
|
62
60
|
export type { PageHeaderProps } from './PageHeader';
|
|
63
61
|
export { Step, default as Stepper, useStepper } from './Stepper';
|
|
64
62
|
export type { StepperProps, StepProps } from './Stepper';
|
|
65
|
-
export {
|
|
66
|
-
export type { TabItemProps,
|
|
63
|
+
export { default as Tab, TabItem } from './Tab';
|
|
64
|
+
export type { TabItemProps, TabProps, TabsChild } from './Tab';
|
|
67
65
|
/**
|
|
68
66
|
* Data Display
|
|
69
67
|
*/
|
|
@@ -73,18 +71,17 @@ export { default as Badge, BadgeContainer } from './Badge';
|
|
|
73
71
|
export type { BadgeProps } from './Badge';
|
|
74
72
|
export { default as Card, CardActions } from './Card';
|
|
75
73
|
export type { CardActionsProps, CardProps } from './Card';
|
|
76
|
-
export { Description,
|
|
77
|
-
export type {
|
|
74
|
+
export { Description, DescriptionContent, DescriptionGroup, DescriptionTitle, } from './Description';
|
|
75
|
+
export type { DescriptionContentProps, DescriptionGroupProps, DescriptionProps, DescriptionTitleProps, } from './Description';
|
|
78
76
|
export { default as Empty } from './Empty';
|
|
79
77
|
export type { EmptyProps } from './Empty';
|
|
80
78
|
export { OverflowCounterTag } from './OverflowTooltip';
|
|
81
79
|
export type { OverflowCounterTagProps } from './OverflowTooltip';
|
|
82
80
|
export { default as Pagination, PaginationItem, PaginationJumper, PaginationPageSize, usePagination, } from './Pagination';
|
|
83
81
|
export type { PaginationItemProps, PaginationItemType, PaginationJumperProps, PaginationPageSizeProps, PaginationProps, } from './Pagination';
|
|
84
|
-
export { default as Table,
|
|
85
|
-
export {
|
|
86
|
-
export {
|
|
87
|
-
export type { TagProps, TagSize } from './Tag';
|
|
82
|
+
export { getCellAlignClass, getRowKey, default as Table, TableContext, TableDataContext, TableSuperContext, useTableContext, useTableDataContext, useTableDataSource, useTableRowSelection, useTableSuperContext, type ColumnAlign, type FixedType, type HighlightMode, type SortOrder, type TableActionItem, type TableActions, type TableActionsBase, type TableActionsWithMinWidth, type TableBaseProps, type TableBulkActions, type TableBulkGeneralAction, type TableBulkOverflowAction, type TableCollectable, type TableColumn, type TableColumnBase, type TableColumnBaseWithMinWidthRequired, type TableColumnTitleMenu, type TableColumnWithDataIndex, type TableColumnWithDataIndexAndMinWidth, type TableColumnWithMinWidth, type TableColumnWithRender, type TableColumnWithRenderAndMinWidth, type TableContextValue, type TableDataContextValue, type TableDataSource, type TableDataSourceWithId, type TableDataSourceWithKey, type TableDraggable, type TableExpandable, type TableExpansionState, type TableNonVirtualizedProps, type TableProps, type TableRecord, type TableResizedColumnState, type TableRowSelection, type TableRowSelectionBase, type TableRowSelectionCheckbox, type TableRowSelectionRadio, type TableScroll, type TableSelectionMode, type TableSelectionState, type TableSize, type TableSortingState, type TableToggleable, type TableTransitionState, type TableVirtualizedProps, type UpdateDataSourceOptions, type UseTableDataSourceOptions, type TableDraggableOnlyProps, type TableNoDragOrPinProps, type TableNonResizableProps, type TablePinnableOnlyProps, type TableResizableProps, } from './Table';
|
|
83
|
+
export { default as Tag, TagGroup } from './Tag';
|
|
84
|
+
export type { TagGroupProps, TagProps, TagSize } from './Tag';
|
|
88
85
|
export { default as Tooltip } from './Tooltip';
|
|
89
86
|
export type { TooltipProps } from './Tooltip';
|
|
90
87
|
export { getTreeNodeEntities, toggleValue, toggleValueWithStatusControl, traverseTree, default as Tree, TreeNode, TreeNodeList, uniqueArray, useTreeExpandedValue, } from './Tree';
|
|
@@ -92,6 +89,8 @@ export type { GetTreeNodeEntitiesProps, TreeExpandControl, TreeNodeData, TreeNod
|
|
|
92
89
|
/**
|
|
93
90
|
* Data Entry
|
|
94
91
|
*/
|
|
92
|
+
export { default as AutoComplete } from './AutoComplete';
|
|
93
|
+
export type { AutoCompleteBaseProps, AutoCompleteMultipleProps, AutoCompleteProps, AutoCompleteSingleProps, } from './AutoComplete';
|
|
95
94
|
export { CheckAll, default as Checkbox, CheckboxGroup } from './Checkbox';
|
|
96
95
|
export type { CheckAllProps, CheckboxGroupChangeEvent, CheckboxGroupChangeEventTarget, CheckboxGroupLayout, CheckboxGroupOption, CheckboxGroupProps, CheckboxProps, } from './Checkbox';
|
|
97
96
|
export { default as DatePicker, DatePickerCalendar } from './DatePicker';
|
|
@@ -101,15 +100,17 @@ export type { DateRangePickerCalendarProps, DateRangePickerProps, UseDateRangePi
|
|
|
101
100
|
export { default as DateTimePicker } from './DateTimePicker';
|
|
102
101
|
export type { DateTimePickerProps } from './DateTimePicker';
|
|
103
102
|
export { FormControlContext, FormField, FormHintText, FormLabel } from './Form';
|
|
103
|
+
export { FilterArea, FilterLine, Filter } from './FilterArea';
|
|
104
|
+
export type { FilterAreaProps, FilterLineProps, FilterProps, } from './FilterArea';
|
|
104
105
|
export type { FormControl, FormFieldProps, FormHintTextProps, FormLabelProps, } from './Form';
|
|
105
106
|
export { default as Input } from './Input';
|
|
106
|
-
export type { ActionInputProps, BaseInputProps, ClearableInput, InputBaseProps, InputProps, InputSize, InputStrength, NumberInput, NumberInputProps, PasswordInputProps, SearchInputProps, SelectInputProps,
|
|
107
|
+
export type { ActionInputProps, BaseInputProps, ClearableInput, InputBaseProps, InputProps, InputSize, InputStrength, NumberInput, NumberInputProps, PasswordInputProps, SearchInputProps, SelectInputProps, CurrencyInputProps, WithAffixInputProps, WithPasswordStrengthIndicator, } from './Input';
|
|
107
108
|
export { PickerTrigger, RangePickerTrigger, usePickerDocumentEventClose, usePickerValue, useTabKeyClose, } from './Picker';
|
|
108
109
|
export type { PickerTriggerProps, RangePickerTriggerProps, UsePickerDocumentEventCloseProps, UsePickerValueProps, } from './Picker';
|
|
109
110
|
export { default as Radio, RadioGroup } from './Radio';
|
|
110
111
|
export type { RadioGroupOrientation, RadioGroupProps, RadioProps, RadioSize, } from './Radio';
|
|
111
|
-
export {
|
|
112
|
-
export type {
|
|
112
|
+
export { Option, OptionGroup, default as Select, SelectControlContext, SelectTrigger, SelectTriggerTags, TreeSelect, } from './Select';
|
|
113
|
+
export type { OptionGroupProps, OptionProps, SelectControl, SelectProps, SelectTriggerInputProps, SelectTriggerProps, SelectTriggerTagsProps, SelectValue, TreeSelectOption, TreeSelectProps, } from './Select';
|
|
113
114
|
export { default as Selection } from './Selection';
|
|
114
115
|
export type { SelectionProps, SelectionPropsBase } from './Selection';
|
|
115
116
|
export { default as Slider, useSlider } from './Slider';
|
|
@@ -133,10 +134,10 @@ export { default as ConfirmActions } from './ConfirmActions';
|
|
|
133
134
|
export type { ConfirmActionsProps } from './ConfirmActions';
|
|
134
135
|
export { default as Message } from './Message';
|
|
135
136
|
export type { MessageData, MessageSeverity, MessageType } from './Message';
|
|
136
|
-
export { default as Modal,
|
|
137
|
-
export type {
|
|
138
|
-
export { default as
|
|
139
|
-
export type { NotificationData, NotificationSeverity } from './
|
|
137
|
+
export { default as Modal, ModalBodyForVerification, ModalFooter, ModalHeader, useModalContainer, } from './Modal';
|
|
138
|
+
export type { ModalBodyForVerificationProps, ModalFooterProps, ModalHeaderProps, ModalProps, ModalSize, ModalStatusType, } from './Modal';
|
|
139
|
+
export { default as NotificationCenter } from './NotificationCenter';
|
|
140
|
+
export type { NotificationData, NotificationSeverity, } from './NotificationCenter';
|
|
140
141
|
export { default as Popconfirm } from './Popconfirm';
|
|
141
142
|
export type { PopconfirmProps } from './Popconfirm';
|
|
142
143
|
export { default as Progress } from './Progress';
|
|
@@ -152,8 +153,8 @@ export type { ResultStateActions, ResultStateProps } from './ResultState';
|
|
|
152
153
|
/**
|
|
153
154
|
* Others
|
|
154
155
|
*/
|
|
155
|
-
export { default as Anchor } from './Anchor';
|
|
156
|
-
export type { AnchorProps } from './Anchor';
|
|
156
|
+
export { default as Anchor, AnchorGroup } from './Anchor';
|
|
157
|
+
export type { AnchorGroupProps, AnchorProps } from './Anchor';
|
|
157
158
|
export { default as Backdrop } from './Backdrop';
|
|
158
159
|
export type { BackdropProps } from './Backdrop';
|
|
159
160
|
export { default as AlertBanner } from './AlertBanner';
|
|
@@ -177,3 +178,18 @@ export type { CollapseProps, FadeProps, RotateProps, ScaleProps, SlideFadeDirect
|
|
|
177
178
|
/** Context */
|
|
178
179
|
export { default as ConfigProvider, MezzanineConfig } from './Provider';
|
|
179
180
|
export type { ConfigProviderProps, MezzanineConfigContext } from './Provider';
|
|
181
|
+
/**
|
|
182
|
+
* internal
|
|
183
|
+
* only export dropdown related components
|
|
184
|
+
*/
|
|
185
|
+
export { default as Dropdown } from './Dropdown';
|
|
186
|
+
export type { DropdownProps } from './Dropdown';
|
|
187
|
+
export { default as DropdownAction } from './Dropdown/DropdownAction';
|
|
188
|
+
export type { DropdownActionProps } from './Dropdown/DropdownAction';
|
|
189
|
+
export { default as DropdownItem } from './Dropdown/DropdownItem';
|
|
190
|
+
export type { DropdownItemProps } from './Dropdown/DropdownItem';
|
|
191
|
+
export { default as DropdownItemCard } from './Dropdown/DropdownItemCard';
|
|
192
|
+
export type { DropdownItemCardProps } from './Dropdown/DropdownItemCard';
|
|
193
|
+
export { default as DropdownStatus } from './Dropdown/DropdownStatus';
|
|
194
|
+
export type { DropdownStatusProps } from './Dropdown/DropdownStatus';
|
|
195
|
+
export type { DropdownCheckPosition, DropdownInputPosition, DropdownItemLevel, DropdownItemSharedProps, DropdownItemValidate, DropdownMode, DropdownOption, DropdownOptionFlat, DropdownOptionGrouped, DropdownOptionsByType, DropdownOptionTree, DropdownStatus as DropdownStatusType, DropdownType, } from '@mezzanine-ui/core/dropdown';
|
package/index.js
CHANGED
|
@@ -29,10 +29,11 @@ export { useSwitchControlValue } from './Form/useSwitchControlValue.js';
|
|
|
29
29
|
export { default as Button } from './Button/Button.js';
|
|
30
30
|
export { default as ButtonGroup } from './Button/ButtonGroup.js';
|
|
31
31
|
export { default as Typography } from './Typography/Typography.js';
|
|
32
|
-
export { default as Checkbox } from './Checkbox/Checkbox.js';
|
|
33
|
-
export { default as CheckAll } from './Checkbox/CheckAll.js';
|
|
34
|
-
export { default as CheckboxGroup } from './Checkbox/CheckboxGroup.js';
|
|
35
32
|
export { default as Selection } from './Selection/Selection.js';
|
|
33
|
+
export { default as DropdownAction } from './Dropdown/DropdownAction.js';
|
|
34
|
+
export { default as DropdownItem } from './Dropdown/DropdownItem.js';
|
|
35
|
+
export { default as DropdownItemCard } from './Dropdown/DropdownItemCard.js';
|
|
36
|
+
export { default as DropdownStatus } from './Dropdown/DropdownStatus.js';
|
|
36
37
|
export { default as Icon } from './Icon/Icon.js';
|
|
37
38
|
export { default as AppBar } from './AppBar/AppBar.js';
|
|
38
39
|
export { default as AppBarBrand } from './AppBar/AppBarBrand.js';
|
|
@@ -40,18 +41,23 @@ export { default as AppBarMain } from './AppBar/AppBarMain.js';
|
|
|
40
41
|
export { default as AppBarSupport } from './AppBar/AppBarSupport.js';
|
|
41
42
|
export { default as Breadcrumb } from './Breadcrumb/Breadcrumb.js';
|
|
42
43
|
export { default as Drawer } from './Drawer/Drawer.js';
|
|
43
|
-
export { default as Dropdown } from './Dropdown/Dropdown.js';
|
|
44
44
|
export { default as Menu } from './Menu/Menu.js';
|
|
45
45
|
export { default as MenuDivider } from './Menu/MenuDivider.js';
|
|
46
46
|
export { default as MenuItem } from './Menu/MenuItem.js';
|
|
47
47
|
export { default as MenuItemGroup, default as OptionGroup } from './Menu/MenuItemGroup.js';
|
|
48
48
|
export { default as Navigation } from './Navigation/Navigation.js';
|
|
49
|
+
export { default as NavigationFooter } from './Navigation/NavigationFooter.js';
|
|
50
|
+
export { default as NavigationHeader } from './Navigation/NavigationHeader.js';
|
|
51
|
+
export { default as NavigationIconButton } from './Navigation/NavigationIconButton.js';
|
|
52
|
+
export { default as NavigationOption } from './Navigation/NavigationOption.js';
|
|
53
|
+
export { default as NavigationOptionCategory } from './Navigation/NavigationOptionCategory.js';
|
|
54
|
+
export { default as NavigationUserMenu } from './Navigation/NavigationUserMenu.js';
|
|
49
55
|
export { default as PageFooter } from './PageFooter/PageFooter.js';
|
|
50
56
|
export { default as PageHeader } from './PageHeader/PageHeader.js';
|
|
51
57
|
export { default as Step } from './Stepper/Step.js';
|
|
52
58
|
export { default as Stepper } from './Stepper/Stepper.js';
|
|
53
|
-
export { default as TabItem } from './Tab/TabItem.js';
|
|
54
59
|
export { default as Tab } from './Tab/Tab.js';
|
|
60
|
+
export { default as TabItem } from './Tab/TabItem.js';
|
|
55
61
|
export { default as Accordion } from './Accordion/Accordion.js';
|
|
56
62
|
export { default as AccordionDetails } from './Accordion/AccordionDetails.js';
|
|
57
63
|
export { default as AccordionSummary } from './Accordion/AccordionSummary.js';
|
|
@@ -60,9 +66,9 @@ export { default as BadgeContainer } from './Badge/BadgeContainer.js';
|
|
|
60
66
|
export { default as Card } from './Card/Card.js';
|
|
61
67
|
export { default as CardActions } from './Card/CardActions.js';
|
|
62
68
|
export { default as Description } from './Description/Description.js';
|
|
63
|
-
export { default as DescriptionTitle } from './Description/DescriptionTitle.js';
|
|
64
69
|
export { default as DescriptionContent } from './Description/DescriptionContent.js';
|
|
65
70
|
export { default as DescriptionGroup } from './Description/DescriptionGroup.js';
|
|
71
|
+
export { default as DescriptionTitle } from './Description/DescriptionTitle.js';
|
|
66
72
|
export { default as Empty } from './Empty/Empty.js';
|
|
67
73
|
export { default as OverflowCounterTag } from './OverflowTooltip/OverflowCounterTag.js';
|
|
68
74
|
export { default as Pagination } from './Pagination/Pagination.js';
|
|
@@ -71,10 +77,15 @@ export { default as PaginationJumper } from './Pagination/PaginationJumper.js';
|
|
|
71
77
|
export { default as PaginationPageSize } from './Pagination/PaginationPageSize.js';
|
|
72
78
|
export { Table } from './Table/Table.js';
|
|
73
79
|
export { default as Tag } from './Tag/Tag.js';
|
|
80
|
+
export { default as TagGroup } from './Tag/TagGroup.js';
|
|
74
81
|
export { default as Tooltip } from './Tooltip/Tooltip.js';
|
|
75
82
|
export { default as Tree } from './Tree/Tree.js';
|
|
76
83
|
export { default as TreeNode } from './Tree/TreeNode.js';
|
|
77
84
|
export { default as TreeNodeList } from './Tree/TreeNodeList.js';
|
|
85
|
+
export { default as AutoComplete } from './AutoComplete/AutoComplete.js';
|
|
86
|
+
export { default as CheckAll } from './Checkbox/CheckAll.js';
|
|
87
|
+
export { default as Checkbox } from './Checkbox/Checkbox.js';
|
|
88
|
+
export { default as CheckboxGroup } from './Checkbox/CheckboxGroup.js';
|
|
78
89
|
export { default as DatePicker } from './DatePicker/DatePicker.js';
|
|
79
90
|
export { default as DatePickerCalendar } from './DatePicker/DatePickerCalendar.js';
|
|
80
91
|
export { default as DateRangePicker } from './DateRangePicker/DateRangePicker.js';
|
|
@@ -83,12 +94,14 @@ export { default as DateTimePicker } from './DateTimePicker/DateTimePicker.js';
|
|
|
83
94
|
export { default as FormField } from './Form/FormField.js';
|
|
84
95
|
export { default as FormHintText } from './Form/FormHintText.js';
|
|
85
96
|
export { default as FormLabel } from './Form/FormLabel.js';
|
|
97
|
+
export { default as FilterArea } from './FilterArea/FilterArea.js';
|
|
98
|
+
export { default as FilterLine } from './FilterArea/FilterLine.js';
|
|
99
|
+
export { default as Filter } from './FilterArea/Filter.js';
|
|
86
100
|
export { default as Input } from './Input/Input.js';
|
|
87
101
|
export { default as PickerTrigger } from './Picker/PickerTrigger.js';
|
|
88
102
|
export { default as RangePickerTrigger } from './Picker/RangePickerTrigger.js';
|
|
89
103
|
export { default as Radio } from './Radio/Radio.js';
|
|
90
104
|
export { default as RadioGroup } from './Radio/RadioGroup.js';
|
|
91
|
-
export { default as AutoComplete } from './Select/AutoComplete.js';
|
|
92
105
|
export { default as Option } from './Select/Option.js';
|
|
93
106
|
export { default as Select } from './Select/Select.js';
|
|
94
107
|
export { default as SelectTrigger } from './Select/SelectTrigger.js';
|
|
@@ -108,12 +121,11 @@ export { default as Alert } from './Alert/Alert.js';
|
|
|
108
121
|
export { default as ConfirmActions } from './ConfirmActions/ConfirmActions.js';
|
|
109
122
|
export { default as Message } from './Message/Message.js';
|
|
110
123
|
export { default as Modal } from './Modal/Modal.js';
|
|
111
|
-
export { default as
|
|
112
|
-
export { default as ModalBody } from './Modal/ModalBody.js';
|
|
124
|
+
export { default as ModalBodyForVerification } from './Modal/ModalBodyForVerification.js';
|
|
113
125
|
export { default as ModalFooter } from './Modal/ModalFooter.js';
|
|
114
126
|
export { default as ModalHeader } from './Modal/ModalHeader.js';
|
|
115
127
|
export { default as useModalContainer } from './Modal/useModalContainer.js';
|
|
116
|
-
export { default as
|
|
128
|
+
export { default as NotificationCenter } from './NotificationCenter/NotificationCenter.js';
|
|
117
129
|
export { default as Popconfirm } from './Popconfirm/Popconfirm.js';
|
|
118
130
|
export { default as Progress } from './Progress/Progress.js';
|
|
119
131
|
export { default as Skeleton } from './Skeleton/Skeleton.js';
|
|
@@ -122,6 +134,7 @@ export { default as InlineMessage } from './InlineMessage/InlineMessage.js';
|
|
|
122
134
|
export { default as InlineMessageGroup } from './InlineMessage/InlineMessageGroup.js';
|
|
123
135
|
export { default as ResultState } from './ResultState/ResultState.js';
|
|
124
136
|
export { default as Anchor } from './Anchor/Anchor.js';
|
|
137
|
+
export { default as AnchorGroup } from './Anchor/AnchorGroup.js';
|
|
125
138
|
export { default as Backdrop } from './Backdrop/Backdrop.js';
|
|
126
139
|
export { default as AlertBanner } from './AlertBanner/AlertBanner.js';
|
|
127
140
|
export { default as Calendar } from './Calendar/Calendar.js';
|
|
@@ -151,12 +164,13 @@ export { default as SlideFade } from './Transition/SlideFade.js';
|
|
|
151
164
|
export { default as Transition } from './Transition/Transition.js';
|
|
152
165
|
export { default as Translate } from './Transition/Translate.js';
|
|
153
166
|
export { default as ConfigProvider } from './Provider/ConfigProvider.js';
|
|
167
|
+
export { default as Dropdown } from './Dropdown/Dropdown.js';
|
|
154
168
|
export { useStepper } from './Stepper/useStepper.js';
|
|
155
169
|
export { usePagination } from './Pagination/usePagination.js';
|
|
156
170
|
export { getCellAlignClass, getRowKey } from '@mezzanine-ui/core/table';
|
|
157
171
|
export { TableContext, TableDataContext, TableSuperContext, useTableContext, useTableDataContext, useTableSuperContext } from './Table/TableContext.js';
|
|
158
|
-
export { useTableRowSelection } from './Table/utils/useTableRowSelection.js';
|
|
159
172
|
export { useTableDataSource } from './Table/hooks/useTableDataSource.js';
|
|
173
|
+
export { useTableRowSelection } from './Table/utils/useTableRowSelection.js';
|
|
160
174
|
export { getTreeNodeEntities } from './Tree/getTreeNodeEntities.js';
|
|
161
175
|
export { toggleValue, toggleValueWithStatusControl, uniqueArray } from './Tree/toggleValue.js';
|
|
162
176
|
export { traverseTree } from './Tree/traverseTree.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mezzanine-ui/react",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.4",
|
|
4
4
|
"description": "React components for mezzanine-ui",
|
|
5
5
|
"author": "Mezzanine",
|
|
6
6
|
"repository": {
|
|
@@ -31,14 +31,16 @@
|
|
|
31
31
|
"@floating-ui/dom": "^1.7.4",
|
|
32
32
|
"@floating-ui/react-dom": "^2.1.6",
|
|
33
33
|
"@hello-pangea/dnd": "^18.0.1",
|
|
34
|
-
"@mezzanine-ui/core": "
|
|
35
|
-
"@mezzanine-ui/icons": "
|
|
36
|
-
"@mezzanine-ui/system": "
|
|
34
|
+
"@mezzanine-ui/core": "1.0.0-beta.4",
|
|
35
|
+
"@mezzanine-ui/icons": "1.0.0-beta.4",
|
|
36
|
+
"@mezzanine-ui/system": "1.0.0-beta.4",
|
|
37
37
|
"@tanstack/react-virtual": "^3.13.13",
|
|
38
38
|
"@types/react-transition-group": "^4.4.12",
|
|
39
39
|
"clsx": "^2.1.1",
|
|
40
40
|
"keycode": "^2.2.1",
|
|
41
41
|
"lodash": "^4.17.21",
|
|
42
|
+
"overlayscrollbars": "^2.13.0",
|
|
43
|
+
"overlayscrollbars-react": "^0.5.6",
|
|
42
44
|
"react-transition-group": "^4.4.5",
|
|
43
45
|
"tslib": "^2.8.1"
|
|
44
46
|
},
|
package/Modal/ModalActions.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ConfirmActionsProps } from '../ConfirmActions';
|
|
2
|
-
import { ModalFooterProps } from './ModalFooter';
|
|
3
|
-
export interface ModalActionsProps extends ModalFooterProps, Pick<ConfirmActionsProps, 'cancelButtonProps' | 'cancelText' | 'confirmButtonProps' | 'confirmText' | 'hideCancelButton' | 'hideConfirmButton' | 'onCancel' | 'onConfirm'> {
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* The react component for `mezzanine` modal actions.
|
|
7
|
-
*/
|
|
8
|
-
declare const ModalActions: import("react").ForwardRefExoticComponent<ModalActionsProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
|
-
export default ModalActions;
|
package/Modal/ModalActions.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { modalClasses } from '@mezzanine-ui/core/modal';
|
|
4
|
-
import { forwardRef, useContext } from 'react';
|
|
5
|
-
import ModalFooter from './ModalFooter.js';
|
|
6
|
-
import { ModalControlContext } from './ModalControl.js';
|
|
7
|
-
import ConfirmActions from '../ConfirmActions/ConfirmActions.js';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* The react component for `mezzanine` modal actions.
|
|
11
|
-
*/
|
|
12
|
-
const ModalActions = forwardRef(function ModalActions(props, ref) {
|
|
13
|
-
const { cancelButtonProps, cancelText, children, confirmButtonProps, confirmText, hideCancelButton, hideConfirmButton, onCancel, onConfirm, ...rest } = props;
|
|
14
|
-
const { loading: confirmButtonLoading, ...restConfirmButtonProps } = confirmButtonProps || {};
|
|
15
|
-
const { loading, severity } = useContext(ModalControlContext);
|
|
16
|
-
const danger = severity === 'error';
|
|
17
|
-
return (jsxs(ModalFooter, { ...rest, ref: ref, children: [children, jsx(ConfirmActions, { cancelButtonProps: cancelButtonProps, cancelText: cancelText, className: modalClasses.actions, confirmButtonProps: restConfirmButtonProps, confirmText: confirmText, danger: danger, hideCancelButton: hideCancelButton, hideConfirmButton: hideConfirmButton, loading: confirmButtonLoading !== null && confirmButtonLoading !== void 0 ? confirmButtonLoading : loading, onCancel: onCancel, onConfirm: onConfirm })] }));
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
export { ModalActions as default };
|
package/Modal/ModalBody.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
2
|
-
export type ModalBodyProps = NativeElementPropsWithoutKeyAndRef<'div'>;
|
|
3
|
-
/**
|
|
4
|
-
* The react component for `mezzanine` modal body.
|
|
5
|
-
*/
|
|
6
|
-
declare const ModalBody: import("react").ForwardRefExoticComponent<ModalBodyProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
|
-
export default ModalBody;
|
package/Modal/ModalBody.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { modalClasses } from '@mezzanine-ui/core/modal';
|
|
4
|
-
import cx from 'clsx';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* The react component for `mezzanine` modal body.
|
|
8
|
-
*/
|
|
9
|
-
const ModalBody = forwardRef(function ModalBody(props, ref) {
|
|
10
|
-
const { children, className, ...rest } = props;
|
|
11
|
-
return (jsx("div", { ...rest, ref: ref, className: cx(modalClasses.body, className), children: children }));
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export { ModalBody as default };
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { NotificationSeverity } from '@mezzanine-ui/core/notification';
|
|
2
|
-
import { FC, Key, ReactNode } from 'react';
|
|
3
|
-
import { NotifierData, Notifier, NotifierConfig } from '../Notifier';
|
|
4
|
-
import { SlideFadeProps } from '../Transition';
|
|
5
|
-
export interface NotificationConfigProps extends Pick<NotifierConfig, 'duration'>, Pick<SlideFadeProps, 'onEnter' | 'onEntering' | 'onEntered' | 'onExit' | 'onExiting' | 'onExited' | 'easing' | 'direction'> {
|
|
6
|
-
}
|
|
7
|
-
export interface NotificationData extends NotifierData, NotificationConfigProps {
|
|
8
|
-
/**
|
|
9
|
-
* Cancel button text;
|
|
10
|
-
*/
|
|
11
|
-
cancelText?: ReactNode;
|
|
12
|
-
/**
|
|
13
|
-
* Confirm button text;
|
|
14
|
-
*/
|
|
15
|
-
confirmText?: ReactNode;
|
|
16
|
-
/**
|
|
17
|
-
* Cancel button click event handler. <br />
|
|
18
|
-
* If not provided, the event handler will fallback to a close function using `Notification.remove`.
|
|
19
|
-
*/
|
|
20
|
-
onCancel?: VoidFunction;
|
|
21
|
-
/**
|
|
22
|
-
* Confirm button click event handler. <br />
|
|
23
|
-
* If given, will render action button group.
|
|
24
|
-
*/
|
|
25
|
-
onConfirm?: VoidFunction;
|
|
26
|
-
/**
|
|
27
|
-
* If given, the message will be closed after the amount of time.
|
|
28
|
-
* You can use `Message.config` to overwrite.
|
|
29
|
-
* @default false
|
|
30
|
-
*/
|
|
31
|
-
/**
|
|
32
|
-
* The identifier of the notification.
|
|
33
|
-
*/
|
|
34
|
-
reference?: Key;
|
|
35
|
-
/**
|
|
36
|
-
* The severity of the message.
|
|
37
|
-
* @default info
|
|
38
|
-
*/
|
|
39
|
-
severity?: NotificationSeverity;
|
|
40
|
-
/**
|
|
41
|
-
* The title of notification.
|
|
42
|
-
*/
|
|
43
|
-
title?: ReactNode;
|
|
44
|
-
}
|
|
45
|
-
export interface Notification extends FC<NotificationData>, Notifier<NotificationData, NotificationConfigProps>, Record<NotificationSeverity, (props?: Omit<NotificationData, 'severity'>) => Key> {
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* The react component for `mezzanine` notification.
|
|
49
|
-
*
|
|
50
|
-
* Use the API from the Notification instance such as `Notification.success` and `Notification.error`
|
|
51
|
-
* to display a notification globally.
|
|
52
|
-
*/
|
|
53
|
-
declare const NotificationElement: Notification;
|
|
54
|
-
export default NotificationElement;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { notificationIcons, notificationClasses } from '@mezzanine-ui/core/notification';
|
|
3
|
-
import { TimesIcon } from '@mezzanine-ui/icons';
|
|
4
|
-
import { useState, useEffect } from 'react';
|
|
5
|
-
import Button from '../Button/Button.js';
|
|
6
|
-
import ButtonGroup from '../Button/ButtonGroup.js';
|
|
7
|
-
import SlideFade from '../Transition/SlideFade.js';
|
|
8
|
-
import Icon from '../Icon/Icon.js';
|
|
9
|
-
import cx from 'clsx';
|
|
10
|
-
import { createNotifier } from '../Notifier/createNotifier.js';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* The react component for `mezzanine` notification.
|
|
14
|
-
*
|
|
15
|
-
* Use the API from the Notification instance such as `Notification.success` and `Notification.error`
|
|
16
|
-
* to display a notification globally.
|
|
17
|
-
*/
|
|
18
|
-
const NotificationElement = ((props) => {
|
|
19
|
-
const { cancelText, children, confirmText, direction = 'left', duration, onCancel: onCancelProp, onClose: onCloseProp, onConfirm: onConfirmProp, onExited: onExitedProp, reference, severity, title, ...restTransitionProps } = props;
|
|
20
|
-
const targetIcon = severity ? notificationIcons[severity] : undefined;
|
|
21
|
-
const [open, setOpen] = useState(true);
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
if (open && duration) {
|
|
24
|
-
const timer = window.setTimeout(() => {
|
|
25
|
-
setOpen(false);
|
|
26
|
-
}, duration);
|
|
27
|
-
return () => {
|
|
28
|
-
window.clearTimeout(timer);
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
}, [open, duration]);
|
|
32
|
-
const onClose = () => {
|
|
33
|
-
setOpen(false);
|
|
34
|
-
if (onCloseProp) {
|
|
35
|
-
onCloseProp(reference);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
const onConfirm = onConfirmProp
|
|
39
|
-
? () => {
|
|
40
|
-
setOpen(false);
|
|
41
|
-
onConfirmProp();
|
|
42
|
-
}
|
|
43
|
-
: undefined;
|
|
44
|
-
const onCancel = onCancelProp
|
|
45
|
-
? () => {
|
|
46
|
-
setOpen(false);
|
|
47
|
-
onCancelProp();
|
|
48
|
-
}
|
|
49
|
-
: undefined;
|
|
50
|
-
const onExited = (node) => {
|
|
51
|
-
if (onExitedProp) {
|
|
52
|
-
onExitedProp(node);
|
|
53
|
-
}
|
|
54
|
-
NotificationElement.remove(reference);
|
|
55
|
-
};
|
|
56
|
-
return (jsx(SlideFade, { in: open, appear: true, onExited: onExited, direction: direction, ...restTransitionProps, children: jsxs("div", { className: cx(notificationClasses.host, severity ? notificationClasses.severity(severity) : undefined), children: [targetIcon ? (jsx("div", { className: notificationClasses.iconContainer, children: jsx(Icon, { icon: targetIcon, className: notificationClasses.severityIcon }) })) : null, jsxs("div", { className: notificationClasses.body, children: [jsx("h4", { className: notificationClasses.title, children: title }), jsx("div", { className: notificationClasses.content, children: children }), onConfirm && !severity ? (jsxs(ButtonGroup, { className: notificationClasses.action, children: [jsx(Button, { variant: "contained", onClick: onConfirm, children: confirmText }), jsx(Button, { variant: "outlined", onClick: onCancel || onClose, children: cancelText })] })) : null] }), jsx(Icon, { icon: TimesIcon, className: notificationClasses.closeIcon, onClick: onClose })] }) }));
|
|
57
|
-
});
|
|
58
|
-
const { add, config, destroy, remove } = createNotifier({
|
|
59
|
-
duration: false,
|
|
60
|
-
render: (notif) => jsx(NotificationElement, { ...notif }),
|
|
61
|
-
setRoot: (root) => {
|
|
62
|
-
root === null || root === void 0 ? void 0 : root.setAttribute('class', notificationClasses.root);
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
NotificationElement.add = add;
|
|
66
|
-
NotificationElement.config = config;
|
|
67
|
-
NotificationElement.destroy = destroy;
|
|
68
|
-
NotificationElement.remove = remove;
|
|
69
|
-
['success', 'warning', 'error', 'info'].forEach((severity) => {
|
|
70
|
-
NotificationElement[severity] = (props) => NotificationElement.add({
|
|
71
|
-
...props,
|
|
72
|
-
severity,
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
export { NotificationElement as default };
|
package/Notification/index.d.ts
DELETED
package/Notification/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './Notification.js';
|