@astral/ui 0.24.0 → 0.27.0
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/Button/Button.d.ts +1 -1
- package/Button/Button.js +13 -1
- package/Button/types.d.ts +2 -0
- package/IconButton/styled.d.ts +2 -0
- package/ListItemIcon/styled.js +1 -1
- package/Menu/Menu.d.ts +2 -2
- package/Menu/Menu.js +5 -14
- package/Menu/index.d.ts +1 -0
- package/Menu/index.js +1 -0
- package/Menu/types.d.ts +1 -0
- package/Menu/types.js +2 -0
- package/MenuGroup/MenuGroup.d.ts +3 -0
- package/MenuGroup/MenuGroup.js +23 -0
- package/MenuGroup/index.d.ts +1 -0
- package/MenuGroup/index.js +13 -0
- package/MenuGroup/stories/Icons.d.ts +8 -0
- package/MenuGroup/stories/Icons.js +29 -0
- package/MenuGroup/stories/styled.d.ts +50 -0
- package/MenuGroup/stories/styled.js +20 -0
- package/MenuGroup/styled.d.ts +20 -0
- package/MenuGroup/styled.js +24 -0
- package/MenuGroup/types.d.ts +8 -0
- package/MenuGroup/types.js +2 -0
- package/MenuItem/MenuItem.d.ts +1 -1
- package/MenuItem/MenuItem.js +2 -2
- package/MenuItem/styled.d.ts +31 -0
- package/MenuItem/styled.js +14 -0
- package/MenuItem/types.d.ts +1 -0
- package/MenuItem/types.js +2 -0
- package/Notification/Notification.d.ts +6 -0
- package/Notification/Notification.js +42 -0
- package/Notification/NotificationContainer/NotificationContainer.d.ts +5 -0
- package/Notification/NotificationContainer/NotificationContainer.js +24 -0
- package/Notification/NotificationContainer/index.d.ts +1 -0
- package/Notification/NotificationContainer/index.js +13 -0
- package/Notification/NotificationContainer/styled.d.ts +5 -0
- package/Notification/NotificationContainer/styled.js +10 -0
- package/Notification/NotificationTemplate/NotificationTemplate.d.ts +13 -0
- package/Notification/NotificationTemplate/NotificationTemplate.js +34 -0
- package/Notification/NotificationTemplate/index.d.ts +1 -0
- package/Notification/NotificationTemplate/index.js +13 -0
- package/Notification/NotificationTemplate/styled.d.ts +83 -0
- package/Notification/NotificationTemplate/styled.js +56 -0
- package/Notification/NotificationTemplate/utils/getActionsDirection/getActionsDirection.d.ts +2 -0
- package/Notification/NotificationTemplate/utils/getActionsDirection/getActionsDirection.js +11 -0
- package/Notification/NotificationTemplate/utils/getActionsDirection/index.d.ts +1 -0
- package/Notification/NotificationTemplate/utils/getActionsDirection/index.js +13 -0
- package/Notification/NotificationTemplate/utils/getNotificationTemplateStyles/getNotificationTemplateStyles.d.ts +6 -0
- package/Notification/NotificationTemplate/utils/getNotificationTemplateStyles/getNotificationTemplateStyles.js +31 -0
- package/Notification/NotificationTemplate/utils/getNotificationTemplateStyles/index.d.ts +1 -0
- package/Notification/NotificationTemplate/utils/getNotificationTemplateStyles/index.js +13 -0
- package/Notification/NotificationTemplate/utils/index.d.ts +2 -0
- package/Notification/NotificationTemplate/utils/index.js +14 -0
- package/Notification/constants/defaultNotificationProps.d.ts +3 -0
- package/Notification/constants/defaultNotificationProps.js +6 -0
- package/Notification/constants/index.d.ts +3 -0
- package/Notification/constants/index.js +15 -0
- package/Notification/constants/notificationVariant.d.ts +6 -0
- package/Notification/constants/notificationVariant.js +23 -0
- package/Notification/constants/positions.d.ts +8 -0
- package/Notification/constants/positions.js +5 -0
- package/Notification/index.d.ts +5 -0
- package/Notification/index.js +17 -0
- package/Notification/styled.d.ts +77 -0
- package/Notification/styled.js +34 -0
- package/Notification/types.d.ts +27 -0
- package/Notification/types.js +2 -0
- package/Notification/utils/getNotificationIconByVariant/getNotificationIconByVariant.d.ts +2 -0
- package/Notification/utils/getNotificationIconByVariant/getNotificationIconByVariant.js +17 -0
- package/Notification/utils/getNotificationIconByVariant/index.d.ts +1 -0
- package/Notification/utils/getNotificationIconByVariant/index.js +13 -0
- package/Notification/utils/index.d.ts +2 -0
- package/Notification/utils/index.js +14 -0
- package/Notification/utils/notificationTemplatePropsCreator/index.d.ts +1 -0
- package/Notification/utils/notificationTemplatePropsCreator/index.js +13 -0
- package/Notification/utils/notificationTemplatePropsCreator/notificationTemplatePropsCreator.d.ts +4 -0
- package/Notification/utils/notificationTemplatePropsCreator/notificationTemplatePropsCreator.js +18 -0
- package/Placeholder/styled.js +2 -2
- package/Product/Product.d.ts +4 -0
- package/Product/Product.js +33 -0
- package/Product/index.d.ts +2 -0
- package/Product/index.js +14 -0
- package/Product/types.d.ts +6 -0
- package/Product/types.js +2 -0
- package/Profile/Profile.d.ts +4 -0
- package/Profile/Profile.js +36 -0
- package/Profile/index.d.ts +2 -0
- package/Profile/index.js +14 -0
- package/Profile/styled.d.ts +40 -0
- package/Profile/styled.js +50 -0
- package/Profile/types.d.ts +20 -0
- package/Profile/types.js +2 -0
- package/Typography/index.d.ts +1 -0
- package/Typography/index.js +1 -0
- package/esm/Button/Button.d.ts +1 -1
- package/esm/Button/Button.js +13 -1
- package/esm/Button/types.d.ts +2 -0
- package/esm/IconButton/styled.d.ts +2 -0
- package/esm/ListItemIcon/styled.js +1 -1
- package/esm/Menu/Menu.d.ts +2 -2
- package/esm/Menu/Menu.js +3 -15
- package/esm/Menu/index.d.ts +1 -0
- package/esm/Menu/index.js +1 -0
- package/esm/Menu/types.d.ts +1 -0
- package/esm/Menu/types.js +1 -0
- package/esm/MenuGroup/MenuGroup.d.ts +3 -0
- package/esm/MenuGroup/MenuGroup.js +19 -0
- package/esm/MenuGroup/index.d.ts +1 -0
- package/esm/MenuGroup/index.js +1 -0
- package/esm/MenuGroup/stories/Icons.d.ts +8 -0
- package/esm/MenuGroup/stories/Icons.js +19 -0
- package/esm/MenuGroup/stories/styled.d.ts +50 -0
- package/esm/MenuGroup/stories/styled.js +17 -0
- package/esm/MenuGroup/styled.d.ts +20 -0
- package/esm/MenuGroup/styled.js +21 -0
- package/esm/MenuGroup/types.d.ts +8 -0
- package/esm/MenuGroup/types.js +1 -0
- package/esm/MenuItem/MenuItem.d.ts +1 -1
- package/esm/MenuItem/MenuItem.js +2 -2
- package/esm/MenuItem/styled.d.ts +31 -0
- package/esm/MenuItem/styled.js +11 -0
- package/esm/MenuItem/types.d.ts +1 -0
- package/esm/MenuItem/types.js +1 -0
- package/esm/Notification/Notification.d.ts +6 -0
- package/esm/Notification/Notification.js +39 -0
- package/esm/Notification/NotificationContainer/NotificationContainer.d.ts +5 -0
- package/esm/Notification/NotificationContainer/NotificationContainer.js +20 -0
- package/esm/Notification/NotificationContainer/index.d.ts +1 -0
- package/esm/Notification/NotificationContainer/index.js +1 -0
- package/esm/Notification/NotificationContainer/styled.d.ts +5 -0
- package/esm/Notification/NotificationContainer/styled.js +7 -0
- package/esm/Notification/NotificationTemplate/NotificationTemplate.d.ts +13 -0
- package/esm/Notification/NotificationTemplate/NotificationTemplate.js +30 -0
- package/esm/Notification/NotificationTemplate/index.d.ts +1 -0
- package/esm/Notification/NotificationTemplate/index.js +1 -0
- package/esm/Notification/NotificationTemplate/styled.d.ts +83 -0
- package/esm/Notification/NotificationTemplate/styled.js +53 -0
- package/esm/Notification/NotificationTemplate/utils/getActionsDirection/getActionsDirection.d.ts +2 -0
- package/esm/Notification/NotificationTemplate/utils/getActionsDirection/getActionsDirection.js +7 -0
- package/esm/Notification/NotificationTemplate/utils/getActionsDirection/index.d.ts +1 -0
- package/esm/Notification/NotificationTemplate/utils/getActionsDirection/index.js +1 -0
- package/esm/Notification/NotificationTemplate/utils/getNotificationTemplateStyles/getNotificationTemplateStyles.d.ts +6 -0
- package/esm/Notification/NotificationTemplate/utils/getNotificationTemplateStyles/getNotificationTemplateStyles.js +27 -0
- package/esm/Notification/NotificationTemplate/utils/getNotificationTemplateStyles/index.d.ts +1 -0
- package/esm/Notification/NotificationTemplate/utils/getNotificationTemplateStyles/index.js +1 -0
- package/esm/Notification/NotificationTemplate/utils/index.d.ts +2 -0
- package/esm/Notification/NotificationTemplate/utils/index.js +2 -0
- package/esm/Notification/constants/defaultNotificationProps.d.ts +3 -0
- package/esm/Notification/constants/defaultNotificationProps.js +3 -0
- package/esm/Notification/constants/index.d.ts +3 -0
- package/esm/Notification/constants/index.js +3 -0
- package/esm/Notification/constants/notificationVariant.d.ts +6 -0
- package/esm/Notification/constants/notificationVariant.js +20 -0
- package/esm/Notification/constants/positions.d.ts +8 -0
- package/esm/Notification/constants/positions.js +2 -0
- package/esm/Notification/index.d.ts +5 -0
- package/esm/Notification/index.js +5 -0
- package/esm/Notification/styled.d.ts +77 -0
- package/esm/Notification/styled.js +31 -0
- package/esm/Notification/types.d.ts +27 -0
- package/esm/Notification/types.js +1 -0
- package/esm/Notification/utils/getNotificationIconByVariant/getNotificationIconByVariant.d.ts +2 -0
- package/esm/Notification/utils/getNotificationIconByVariant/getNotificationIconByVariant.js +13 -0
- package/esm/Notification/utils/getNotificationIconByVariant/index.d.ts +1 -0
- package/esm/Notification/utils/getNotificationIconByVariant/index.js +1 -0
- package/esm/Notification/utils/index.d.ts +2 -0
- package/esm/Notification/utils/index.js +2 -0
- package/esm/Notification/utils/notificationTemplatePropsCreator/index.d.ts +1 -0
- package/esm/Notification/utils/notificationTemplatePropsCreator/index.js +1 -0
- package/esm/Notification/utils/notificationTemplatePropsCreator/notificationTemplatePropsCreator.d.ts +4 -0
- package/esm/Notification/utils/notificationTemplatePropsCreator/notificationTemplatePropsCreator.js +14 -0
- package/esm/Placeholder/styled.js +2 -2
- package/esm/Product/Product.d.ts +4 -0
- package/esm/Product/Product.js +30 -0
- package/esm/Product/index.d.ts +2 -0
- package/esm/Product/index.js +2 -0
- package/esm/Product/types.d.ts +6 -0
- package/esm/Product/types.js +1 -0
- package/esm/Profile/Profile.d.ts +4 -0
- package/esm/Profile/Profile.js +33 -0
- package/esm/Profile/index.d.ts +2 -0
- package/esm/Profile/index.js +2 -0
- package/esm/Profile/styled.d.ts +40 -0
- package/esm/Profile/styled.js +47 -0
- package/esm/Profile/types.d.ts +20 -0
- package/esm/Profile/types.js +1 -0
- package/esm/Typography/index.d.ts +1 -0
- package/esm/Typography/index.js +1 -0
- package/esm/index.d.ts +3 -0
- package/esm/index.js +3 -0
- package/esm/theme/components/MuiMenu.d.ts +4 -0
- package/esm/theme/components/MuiMenu.js +24 -0
- package/esm/theme/components/MuiMenuItem.d.ts +4 -0
- package/esm/theme/components/MuiMenuItem.js +13 -0
- package/esm/theme/components/components.js +2 -35
- package/index.d.ts +3 -0
- package/index.js +3 -0
- package/package.json +4 -3
- package/theme/components/MuiMenu.d.ts +4 -0
- package/theme/components/MuiMenu.js +27 -0
- package/theme/components/MuiMenuItem.d.ts +4 -0
- package/theme/components/MuiMenuItem.js +16 -0
- package/theme/components/components.js +4 -37
package/esm/MenuItem/MenuItem.js
CHANGED
|
@@ -21,8 +21,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import {
|
|
24
|
+
import { StyledMenuItem } from './styled';
|
|
25
25
|
export var MenuItem = function (_a) {
|
|
26
26
|
var children = _a.children, props = __rest(_a, ["children"]);
|
|
27
|
-
return _jsx(
|
|
27
|
+
return _jsx(StyledMenuItem, __assign({}, props, { children: children }), void 0);
|
|
28
28
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledMenuItem: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
autoFocus?: boolean | undefined;
|
|
4
|
+
classes?: Partial<import("@mui/material").MenuItemClasses> | undefined;
|
|
5
|
+
dense?: boolean | undefined;
|
|
6
|
+
disabled?: boolean | undefined;
|
|
7
|
+
disableGutters?: boolean | undefined;
|
|
8
|
+
divider?: boolean | undefined;
|
|
9
|
+
selected?: boolean | undefined;
|
|
10
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
11
|
+
} & Omit<{
|
|
12
|
+
action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
|
|
13
|
+
centerRipple?: boolean | undefined;
|
|
14
|
+
children?: import("react").ReactNode;
|
|
15
|
+
classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
|
|
16
|
+
disabled?: boolean | undefined;
|
|
17
|
+
disableRipple?: boolean | undefined;
|
|
18
|
+
disableTouchRipple?: boolean | undefined;
|
|
19
|
+
focusRipple?: boolean | undefined;
|
|
20
|
+
focusVisibleClassName?: string | undefined;
|
|
21
|
+
LinkComponent?: import("react").ElementType<any> | undefined;
|
|
22
|
+
onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
|
|
23
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
24
|
+
tabIndex?: number | undefined;
|
|
25
|
+
TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
|
|
26
|
+
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
27
|
+
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "tabIndex" | "children" | "className" | "slot" | "style" | "title" | "key" | "css" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & {
|
|
28
|
+
ref?: ((instance: HTMLLIElement | null) => void) | import("react").RefObject<HTMLLIElement> | null | undefined;
|
|
29
|
+
}, "disabled" | "onFocusVisible" | "tabIndex" | "action" | "children" | "autoFocus" | "dense" | "divider" | keyof import("@mui/material/OverridableComponent").CommonProps | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "sx" | "TouchRippleProps" | "touchRippleRef" | "selected" | "disableGutters"> & {
|
|
30
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
31
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
import { MenuItem as MuiMenuItem } from '@mui/material';
|
|
6
|
+
import { styled } from '../styles';
|
|
7
|
+
export var StyledMenuItem = styled(MuiMenuItem)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", ";\n"], ["\n padding: ", ";\n"])), function (_a) {
|
|
8
|
+
var theme = _a.theme;
|
|
9
|
+
return theme.spacing(1.5, 10, 1.5, 3);
|
|
10
|
+
});
|
|
11
|
+
var templateObject_1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { MenuItemProps } from '@mui/material/MenuItem';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { NotificationProps, Variant } from './types';
|
|
2
|
+
interface NotificationOptions extends Omit<NotificationProps, 'title'> {
|
|
3
|
+
}
|
|
4
|
+
export declare type Notify = (title: string, options?: NotificationOptions) => number | string;
|
|
5
|
+
export declare const notify: Record<Variant, Notify>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { toast } from 'react-toastify';
|
|
13
|
+
import { NOTIFICATION_VARIANT } from './constants';
|
|
14
|
+
export var notify = {
|
|
15
|
+
info: function (title, options) {
|
|
16
|
+
return toast(function (_a) {
|
|
17
|
+
var toastProps = _a.toastProps;
|
|
18
|
+
return NOTIFICATION_VARIANT.info(__assign(__assign({}, options), { title: title }), toastProps);
|
|
19
|
+
}, options);
|
|
20
|
+
},
|
|
21
|
+
success: function (title, options) {
|
|
22
|
+
return toast(function (_a) {
|
|
23
|
+
var toastProps = _a.toastProps;
|
|
24
|
+
return NOTIFICATION_VARIANT.success(__assign(__assign({}, options), { title: title }), toastProps);
|
|
25
|
+
}, options);
|
|
26
|
+
},
|
|
27
|
+
warning: function (title, options) {
|
|
28
|
+
return toast(function (_a) {
|
|
29
|
+
var toastProps = _a.toastProps;
|
|
30
|
+
return NOTIFICATION_VARIANT.warning(__assign(__assign({}, options), { title: title }), toastProps);
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
error: function (title, options) {
|
|
34
|
+
return toast(function (_a) {
|
|
35
|
+
var toastProps = _a.toastProps;
|
|
36
|
+
return NOTIFICATION_VARIANT.error(__assign(__assign({}, options), { title: title }), toastProps);
|
|
37
|
+
}, options);
|
|
38
|
+
},
|
|
39
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { ToastContainer } from 'react-toastify';
|
|
14
|
+
import { injectStyle } from 'react-toastify/dist/inject-style';
|
|
15
|
+
import { NOTIFY_POSITIONS } from '../constants';
|
|
16
|
+
import { ToastContainerStyled } from './styled';
|
|
17
|
+
injectStyle();
|
|
18
|
+
export var NotificationContainer = function (props) {
|
|
19
|
+
return (_jsx(ToastContainerStyled, { children: _jsx(ToastContainer, __assign({ hideProgressBar: true, pauseOnFocusLoss: true, position: NOTIFY_POSITIONS.BOTTOM_RIGHT, newestOnTop: false, closeOnClick: false, draggable: false, rtl: false }, props, { closeButton: false, bodyClassName: "notify__body", toastClassName: "notify", progressClassName: "notify__progress", className: "notify__container" }), void 0) }, void 0));
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NotificationContainer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NotificationContainer';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const ToastContainerStyled: import("@emotion/styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
import { styled } from '../../styles';
|
|
6
|
+
export var ToastContainerStyled = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .notify {\n min-height: 56px;\n padding: 0;\n\n &__container {\n width: 400px;\n }\n\n &__body {\n margin: 0;\n padding: 0;\n }\n }\n"], ["\n .notify {\n min-height: 56px;\n padding: 0;\n\n &__container {\n width: 400px;\n }\n\n &__body {\n margin: 0;\n padding: 0;\n }\n }\n"])));
|
|
7
|
+
var templateObject_1;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { ToastProps } from 'react-toastify/dist/types';
|
|
3
|
+
import { ActionsDirection, Variant } from '../types';
|
|
4
|
+
export interface NotificationTemplateProps extends ToastProps {
|
|
5
|
+
icon: JSX.Element;
|
|
6
|
+
title: string;
|
|
7
|
+
filled?: boolean;
|
|
8
|
+
variant: Variant;
|
|
9
|
+
content?: ReactNode;
|
|
10
|
+
actions?: JSX.Element;
|
|
11
|
+
actionsDirection?: ActionsDirection;
|
|
12
|
+
}
|
|
13
|
+
export declare const NotificationTemplate: FC<NotificationTemplateProps>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useMemo } from 'react';
|
|
14
|
+
import { DEFAULT_NOTIFICATION_PROPS } from '../constants';
|
|
15
|
+
import { NotificationActions, NotificationCloseButton, NotificationCloseIcon, NotificationContent, NotificationHeader, NotificationIcon, NotificationTitle, NotificationWrapper, NotificationTemplate as StyledNotificationTemplate, } from './styled';
|
|
16
|
+
export var NotificationTemplate = function (_a) {
|
|
17
|
+
var icon = _a.icon, title = _a.title, closeToast = _a.closeToast, content = _a.content, actions = _a.actions, variant = _a.variant, _b = _a.filled, filled = _b === void 0 ? DEFAULT_NOTIFICATION_PROPS.filled : _b, _c = _a.actionsDirection, actionsDirection = _c === void 0 ? 'right' : _c;
|
|
18
|
+
var handleCloseToast = function () {
|
|
19
|
+
if (closeToast) {
|
|
20
|
+
closeToast();
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var Content = useMemo(function () {
|
|
24
|
+
return _jsx(NotificationContent, { children: content }, void 0);
|
|
25
|
+
}, [content]);
|
|
26
|
+
var Actions = useMemo(function () {
|
|
27
|
+
return (_jsx(NotificationActions, __assign({ actionsDirection: actionsDirection }, { children: actions }), void 0));
|
|
28
|
+
}, [actions, actionsDirection]);
|
|
29
|
+
return (_jsxs(StyledNotificationTemplate, __assign({ variant: variant, filled: filled }, { children: [_jsxs(NotificationWrapper, { children: [_jsx(NotificationIcon, __assign({ filled: filled }, { children: icon }), void 0), _jsxs(NotificationHeader, { children: [_jsx(NotificationTitle, { children: title }, void 0), _jsx(NotificationCloseButton, __assign({ filled: filled, onClick: handleCloseToast, color: "primary", variant: "text" }, { children: _jsx(NotificationCloseIcon, { filled: filled }, void 0) }), void 0)] }, void 0)] }, void 0), content && Content, actions && Actions] }), void 0));
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NotificationTemplate';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './NotificationTemplate';
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ActionsDirection, Variant } from '../types';
|
|
3
|
+
interface NotificationCloseButtonProps {
|
|
4
|
+
filled: boolean;
|
|
5
|
+
}
|
|
6
|
+
interface NotificationIconProps {
|
|
7
|
+
filled: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface NotificationTemplateProps {
|
|
10
|
+
variant: Variant;
|
|
11
|
+
filled: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface NotificationActionsProps {
|
|
14
|
+
actionsDirection: ActionsDirection;
|
|
15
|
+
}
|
|
16
|
+
interface NotificationCloseIconProps {
|
|
17
|
+
filled: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const NotificationTemplate: import("@emotion/styled").StyledComponent<{
|
|
20
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
21
|
+
as?: import("react").ElementType<any> | undefined;
|
|
22
|
+
} & NotificationTemplateProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
|
|
23
|
+
export declare const NotificationWrapper: import("@emotion/styled").StyledComponent<{
|
|
24
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
25
|
+
as?: import("react").ElementType<any> | undefined;
|
|
26
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
27
|
+
export declare const NotificationContent: import("@emotion/styled").StyledComponent<{
|
|
28
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
29
|
+
as?: import("react").ElementType<any> | undefined;
|
|
30
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
31
|
+
export declare const NotificationActions: import("@emotion/styled").StyledComponent<{
|
|
32
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
33
|
+
as?: import("react").ElementType<any> | undefined;
|
|
34
|
+
} & NotificationActionsProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
|
|
35
|
+
export declare const NotificationIcon: import("@emotion/styled").StyledComponent<{
|
|
36
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
37
|
+
as?: import("react").ElementType<any> | undefined;
|
|
38
|
+
} & NotificationIconProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
39
|
+
export declare const NotificationHeader: import("@emotion/styled").StyledComponent<{
|
|
40
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
41
|
+
as?: import("react").ElementType<any> | undefined;
|
|
42
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
|
|
43
|
+
export declare const NotificationCloseIcon: import("@emotion/styled").StyledComponent<{
|
|
44
|
+
children?: import("react").ReactNode;
|
|
45
|
+
classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
|
|
46
|
+
color?: "inherit" | "primary" | "secondary" | "disabled" | "error" | "success" | "warning" | "action" | "info" | undefined;
|
|
47
|
+
fontSize?: "inherit" | "large" | "medium" | "small" | undefined;
|
|
48
|
+
htmlColor?: string | undefined;
|
|
49
|
+
inheritViewBox?: boolean | undefined;
|
|
50
|
+
shapeRendering?: string | undefined;
|
|
51
|
+
sx?: import("@mui/system").SxProps<import("@mui/material").Theme> | undefined;
|
|
52
|
+
titleAccess?: string | undefined;
|
|
53
|
+
viewBox?: string | undefined;
|
|
54
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").SVGProps<SVGSVGElement>, "string" | "fontSize" | "fontWeight" | "fontFamily" | "href" | "tabIndex" | "to" | "type" | "children" | "className" | "style" | "clipPath" | "filter" | "mask" | "path" | "key" | "css" | "name" | "id" | "lang" | "role" | "color" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "cursor" | "direction" | "display" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "height" | "imageRendering" | "letterSpacing" | "opacity" | "order" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "visibility" | "width" | "wordSpacing" | "writingMode" | "offset" | "overflow" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "end" | "local" | "x" | "y" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "elevation" | "spacing" | "values" | "mode" | "in" | "max" | "orientation" | "media" | "target" | "origin" | "min" | "viewBox" | "method" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "fr" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "numOctaves" | "operator" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & {
|
|
55
|
+
ref?: ((instance: SVGSVGElement | null) => void) | import("react").RefObject<SVGSVGElement> | null | undefined;
|
|
56
|
+
}, "fontSize" | "children" | "color" | "shapeRendering" | keyof import("@mui/material/OverridableComponent").CommonProps | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & {
|
|
57
|
+
children?: import("react").ReactNode;
|
|
58
|
+
} & {
|
|
59
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
60
|
+
} & NotificationCloseIconProps, {}, {}>;
|
|
61
|
+
export declare const NotificationCloseButton: import("@emotion/styled").StyledComponent<Omit<import("@mui/base/ButtonUnstyled/ButtonUnstyledProps").default<"button", {}>, "color" | "size" | "variant"> & {
|
|
62
|
+
color?: "primary" | "error" | "success" | "warning" | undefined;
|
|
63
|
+
variant?: "link" | "light" | "contained" | "text" | undefined;
|
|
64
|
+
size?: "large" | "medium" | undefined;
|
|
65
|
+
} & {
|
|
66
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
67
|
+
} & NotificationCloseButtonProps, {}, {}>;
|
|
68
|
+
export declare const NotificationTitle: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
69
|
+
align?: "inherit" | "left" | "right" | "center" | "justify" | undefined;
|
|
70
|
+
children?: import("react").ReactNode;
|
|
71
|
+
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
72
|
+
gutterBottom?: boolean | undefined;
|
|
73
|
+
noWrap?: boolean | undefined;
|
|
74
|
+
paragraph?: boolean | undefined;
|
|
75
|
+
sx?: import("@mui/system").SxProps<import("@mui/material").Theme> | undefined;
|
|
76
|
+
variant?: "inherit" | "small" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitle1" | "subtitle2" | "body1" | "body2" | "caption" | "button" | "overline" | "h7" | "h8" | "h9" | "ui" | "link" | "pointer" | "code" | "div" | undefined;
|
|
77
|
+
variantMapping?: Partial<Record<"inherit" | "small" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitle1" | "subtitle2" | "body1" | "body2" | "caption" | "button" | "overline" | "h7" | "h8" | "h9" | "ui" | "link" | "pointer" | "code" | "div", string>> | undefined;
|
|
78
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "tabIndex" | "children" | "className" | "slot" | "style" | "title" | "key" | "css" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & {
|
|
79
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
80
|
+
}, "children" | "variant" | keyof import("@mui/material/OverridableComponent").CommonProps | "sx" | ("fontSize" | "fontWeight" | "lineHeight" | "fontFamily" | "p" | "color" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "typography" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint") | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & {
|
|
81
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
82
|
+
}, {}, {}>;
|
|
83
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
import { CrossOutlineSm } from '@astral/icons';
|
|
6
|
+
import { IconButton } from '../../IconButton';
|
|
7
|
+
import { styled } from '../../styles';
|
|
8
|
+
import { Typography } from '../../Typography';
|
|
9
|
+
import { getActionsDirection, getNotificationTemplateStyles } from './utils';
|
|
10
|
+
export var NotificationTemplate = styled.section(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: ", ";\n\n ", "\n"], ["\n padding: ", ";\n\n ", "\n"])), function (_a) {
|
|
11
|
+
var theme = _a.theme;
|
|
12
|
+
return theme.spacing(4);
|
|
13
|
+
}, function (_a) {
|
|
14
|
+
var theme = _a.theme, variant = _a.variant, filled = _a.filled;
|
|
15
|
+
return getNotificationTemplateStyles(theme, variant, filled);
|
|
16
|
+
});
|
|
17
|
+
export var NotificationWrapper = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
|
|
18
|
+
export var NotificationContent = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin-top: ", ";\n"], ["\n margin-top: ", ";\n"])), function (_a) {
|
|
19
|
+
var theme = _a.theme;
|
|
20
|
+
return theme.spacing(2);
|
|
21
|
+
});
|
|
22
|
+
export var NotificationActions = styled.footer(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: ", ";\n margin-top: ", ";\n"], ["\n display: flex;\n align-items: center;\n justify-content: ", ";\n margin-top: ", ";\n"])), function (_a) {
|
|
23
|
+
var actionsDirection = _a.actionsDirection;
|
|
24
|
+
return getActionsDirection(actionsDirection);
|
|
25
|
+
}, function (_a) {
|
|
26
|
+
var theme = _a.theme;
|
|
27
|
+
return theme.spacing(2);
|
|
28
|
+
});
|
|
29
|
+
export var NotificationIcon = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-right: ", ";\n"], ["\n display: flex;\n align-items: center;\n margin-right: ", ";\n"])), function (_a) {
|
|
30
|
+
var theme = _a.theme;
|
|
31
|
+
return theme.spacing(3);
|
|
32
|
+
});
|
|
33
|
+
export var NotificationHeader = styled.header(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n width: 100%;\n"], ["\n display: flex;\n align-items: center;\n width: 100%;\n"])));
|
|
34
|
+
export var NotificationCloseIcon = styled(CrossOutlineSm, {
|
|
35
|
+
shouldForwardProp: function (prop) { return prop !== 'filled'; },
|
|
36
|
+
})(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), function (_a) {
|
|
37
|
+
var theme = _a.theme, filled = _a.filled;
|
|
38
|
+
return filled && theme.palette.background.default;
|
|
39
|
+
});
|
|
40
|
+
export var NotificationCloseButton = styled(IconButton, {
|
|
41
|
+
shouldForwardProp: function (prop) { return prop !== 'filled'; },
|
|
42
|
+
})(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n padding: 0;\n\n &:hover {\n background-color: ", ";\n }\n"], ["\n padding: 0;\n\n &:hover {\n background-color: ", ";\n }\n"])), function (_a) {
|
|
43
|
+
var filled = _a.filled;
|
|
44
|
+
return filled && 'inherit';
|
|
45
|
+
});
|
|
46
|
+
export var NotificationTitle = styled(Typography)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n flex: 1;\n margin-right: ", ";\n\n font-weight: ", ";\n"], ["\n flex: 1;\n margin-right: ", ";\n\n font-weight: ", ";\n"])), function (_a) {
|
|
47
|
+
var theme = _a.theme;
|
|
48
|
+
return theme.spacing(1);
|
|
49
|
+
}, function (_a) {
|
|
50
|
+
var theme = _a.theme;
|
|
51
|
+
return theme.typography.fontWeightMedium;
|
|
52
|
+
});
|
|
53
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './getActionsDirection';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './getActionsDirection';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export var getNotificationTemplateStyles = function (theme, variant, filled) {
|
|
2
|
+
var defaultColors = {
|
|
3
|
+
color: theme.palette.grey[900],
|
|
4
|
+
background: theme.palette.background.default,
|
|
5
|
+
};
|
|
6
|
+
if (!filled)
|
|
7
|
+
return defaultColors;
|
|
8
|
+
var mapOfStyles = {
|
|
9
|
+
info: {
|
|
10
|
+
color: theme.palette.primary.contrastText,
|
|
11
|
+
background: theme.palette.grey[600],
|
|
12
|
+
},
|
|
13
|
+
success: {
|
|
14
|
+
color: theme.palette.primary.contrastText,
|
|
15
|
+
background: theme.palette.green[600],
|
|
16
|
+
},
|
|
17
|
+
warning: {
|
|
18
|
+
color: theme.palette.primary.contrastText,
|
|
19
|
+
background: theme.palette.yellow[600],
|
|
20
|
+
},
|
|
21
|
+
error: {
|
|
22
|
+
color: theme.palette.primary.contrastText,
|
|
23
|
+
background: theme.palette.red[600],
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
return mapOfStyles[variant];
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './getNotificationTemplateStyles';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './getNotificationTemplateStyles';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ToastProps } from 'react-toastify/dist/types';
|
|
3
|
+
import { NotificationProps, Variant } from '../types';
|
|
4
|
+
declare type NotifyAction = (options: NotificationProps, notifyProps: ToastProps) => JSX.Element;
|
|
5
|
+
export declare const NOTIFICATION_VARIANT: Record<Variant, NotifyAction>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { NotificationTemplate } from '../NotificationTemplate';
|
|
14
|
+
import { getNotificationIconByVariant, notificationTemplatePropsCreator, } from '../utils';
|
|
15
|
+
export var NOTIFICATION_VARIANT = {
|
|
16
|
+
info: function (options, notifyContent) { return (_jsx(NotificationTemplate, __assign({}, notificationTemplatePropsCreator(options, notifyContent, 'info'), { icon: getNotificationIconByVariant('info', options.filled) }), void 0)); },
|
|
17
|
+
success: function (options, notifyContent) { return (_jsx(NotificationTemplate, __assign({}, notificationTemplatePropsCreator(options, notifyContent, 'success'), { icon: getNotificationIconByVariant('success', options.filled) }), void 0)); },
|
|
18
|
+
warning: function (options, notifyContent) { return (_jsx(NotificationTemplate, __assign({}, notificationTemplatePropsCreator(options, notifyContent, 'warning'), { icon: getNotificationIconByVariant('warning', options.filled) }), void 0)); },
|
|
19
|
+
error: function (options, notifyContent) { return (_jsx(NotificationTemplate, __assign({}, notificationTemplatePropsCreator(options, notifyContent, 'error'), { icon: getNotificationIconByVariant('error', options.filled) }), void 0)); },
|
|
20
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const NOTIFY_POSITIONS: {
|
|
2
|
+
TOP_LEFT: import("react-toastify").ToastPosition;
|
|
3
|
+
TOP_RIGHT: import("react-toastify").ToastPosition;
|
|
4
|
+
TOP_CENTER: import("react-toastify").ToastPosition;
|
|
5
|
+
BOTTOM_LEFT: import("react-toastify").ToastPosition;
|
|
6
|
+
BOTTOM_RIGHT: import("react-toastify").ToastPosition;
|
|
7
|
+
BOTTOM_CENTER: import("react-toastify").ToastPosition;
|
|
8
|
+
};
|