@cloudflare/component-notifications 10.0.18 → 10.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 10.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - dd17161fbd: Convert to TypeScript
8
+
3
9
  ## 10.0.18
4
10
 
5
11
  ## 10.0.17
@@ -0,0 +1,30 @@
1
+ /// <reference types="node" />
2
+ import React from 'react';
3
+ declare type TNotificationProps = {
4
+ type?: TNotificationType;
5
+ message: string;
6
+ closable?: boolean;
7
+ delay?: number;
8
+ persist?: boolean;
9
+ onClose: () => void;
10
+ };
11
+ declare type TNotificationState = {
12
+ persist?: boolean;
13
+ timeoutId: NodeJS.Timeout | null;
14
+ };
15
+ export declare type TNotificationType = 'success' | 'error' | 'info' | 'warning';
16
+ declare class Notification extends React.Component<TNotificationProps, TNotificationState> {
17
+ private _raf;
18
+ static defaultProps: Partial<TNotificationProps>;
19
+ constructor(props: any);
20
+ componentDidMount(): void;
21
+ componentWillUnmount(): void;
22
+ startTimeout(): void;
23
+ stopTimeout(): void;
24
+ handleMouseEnter(): void;
25
+ handleMouseLeave(): void;
26
+ handleClickClose(): void;
27
+ handleClick(): void;
28
+ render(): JSX.Element;
29
+ }
30
+ export default Notification;
@@ -0,0 +1,7 @@
1
+ import { type ReactNode } from 'react';
2
+ declare type TNotificationGlobalContainerProps = {
3
+ className?: string;
4
+ children?: ReactNode;
5
+ };
6
+ declare const NotificationGlobalContainer: ({ className, children }: TNotificationGlobalContainerProps) => JSX.Element;
7
+ export default NotificationGlobalContainer;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { type TNotificationType } from './Notification';
3
+ declare type TNotificationItemProps = {
4
+ children?: string;
5
+ closable?: boolean;
6
+ handleClickClose?: () => void;
7
+ type?: TNotificationType;
8
+ };
9
+ declare const NotificationItem: ({ children, closable, handleClickClose, type }: TNotificationItemProps) => JSX.Element;
10
+ export default NotificationItem;
@@ -0,0 +1,82 @@
1
+ import React from 'react';
2
+ declare const _default: React.ComponentType<{
3
+ className?: string | undefined;
4
+ children?: React.ReactNode;
5
+ p?: import("csstype").PaddingProperty<string | number> | [import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined] | [import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined] | undefined;
6
+ color?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
7
+ borderColor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
8
+ height?: import("csstype").HeightProperty<string | number> | [import("csstype").HeightProperty<string | number> | undefined, import("csstype").HeightProperty<string | number> | undefined] | [import("csstype").HeightProperty<string | number> | undefined, import("csstype").HeightProperty<string | number> | undefined, import("csstype").HeightProperty<string | number> | undefined] | undefined;
9
+ width?: import("csstype").WidthProperty<string | number> | [import("csstype").WidthProperty<string | number> | undefined, import("csstype").WidthProperty<string | number> | undefined] | [import("csstype").WidthProperty<string | number> | undefined, import("csstype").WidthProperty<string | number> | undefined, import("csstype").WidthProperty<string | number> | undefined] | undefined;
10
+ cursor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
11
+ display?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
12
+ fontSize?: import("csstype").FontSizeProperty<string | number> | [import("csstype").FontSizeProperty<string | number> | undefined, import("csstype").FontSizeProperty<string | number> | undefined] | [import("csstype").FontSizeProperty<string | number> | undefined, import("csstype").FontSizeProperty<string | number> | undefined, import("csstype").FontSizeProperty<string | number> | undefined] | undefined;
13
+ fontWeight?: import("csstype").FontWeightProperty | [import("csstype").FontWeightProperty | undefined, import("csstype").FontWeightProperty | undefined] | [import("csstype").FontWeightProperty | undefined, import("csstype").FontWeightProperty | undefined, import("csstype").FontWeightProperty | undefined] | undefined;
14
+ textDecoration?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
15
+ margin?: import("csstype").MarginProperty<string | number> | [import("csstype").MarginProperty<string | number> | undefined, import("csstype").MarginProperty<string | number> | undefined] | [import("csstype").MarginProperty<string | number> | undefined, import("csstype").MarginProperty<string | number> | undefined, import("csstype").MarginProperty<string | number> | undefined] | undefined;
16
+ marginLeft?: import("csstype").MarginLeftProperty<string | number> | [import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined] | [import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined] | undefined;
17
+ marginRight?: import("csstype").MarginRightProperty<string | number> | [import("csstype").MarginRightProperty<string | number> | undefined, import("csstype").MarginRightProperty<string | number> | undefined] | [import("csstype").MarginRightProperty<string | number> | undefined, import("csstype").MarginRightProperty<string | number> | undefined, import("csstype").MarginRightProperty<string | number> | undefined] | undefined;
18
+ marginTop?: import("csstype").MarginTopProperty<string | number> | [import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined] | [import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined] | undefined;
19
+ marginBottom?: import("csstype").MarginBottomProperty<string | number> | [import("csstype").MarginBottomProperty<string | number> | undefined, import("csstype").MarginBottomProperty<string | number> | undefined] | [import("csstype").MarginBottomProperty<string | number> | undefined, import("csstype").MarginBottomProperty<string | number> | undefined, import("csstype").MarginBottomProperty<string | number> | undefined] | undefined;
20
+ padding?: import("csstype").PaddingProperty<string | number> | [import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined] | [import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined, import("csstype").PaddingProperty<string | number> | undefined] | undefined;
21
+ paddingLeft?: import("csstype").PaddingLeftProperty<string | number> | [import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined] | [import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined] | undefined;
22
+ paddingRight?: import("csstype").PaddingRightProperty<string | number> | [import("csstype").PaddingRightProperty<string | number> | undefined, import("csstype").PaddingRightProperty<string | number> | undefined] | [import("csstype").PaddingRightProperty<string | number> | undefined, import("csstype").PaddingRightProperty<string | number> | undefined, import("csstype").PaddingRightProperty<string | number> | undefined] | undefined;
23
+ paddingTop?: import("csstype").PaddingTopProperty<string | number> | [import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined] | [import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined] | undefined;
24
+ paddingBottom?: import("csstype").PaddingBottomProperty<string | number> | [import("csstype").PaddingBottomProperty<string | number> | undefined, import("csstype").PaddingBottomProperty<string | number> | undefined] | [import("csstype").PaddingBottomProperty<string | number> | undefined, import("csstype").PaddingBottomProperty<string | number> | undefined, import("csstype").PaddingBottomProperty<string | number> | undefined] | undefined;
25
+ gap?: import("csstype").GapProperty<string | number> | [import("csstype").GapProperty<string | number> | undefined, import("csstype").GapProperty<string | number> | undefined] | [import("csstype").GapProperty<string | number> | undefined, import("csstype").GapProperty<string | number> | undefined, import("csstype").GapProperty<string | number> | undefined] | undefined;
26
+ m?: import("csstype").MarginProperty<string | number> | [import("csstype").MarginProperty<string | number> | undefined, import("csstype").MarginProperty<string | number> | undefined] | [import("csstype").MarginProperty<string | number> | undefined, import("csstype").MarginProperty<string | number> | undefined, import("csstype").MarginProperty<string | number> | undefined] | undefined;
27
+ ml?: import("csstype").MarginLeftProperty<string | number> | [import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined] | [import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined] | undefined;
28
+ mr?: import("csstype").MarginRightProperty<string | number> | [import("csstype").MarginRightProperty<string | number> | undefined, import("csstype").MarginRightProperty<string | number> | undefined] | [import("csstype").MarginRightProperty<string | number> | undefined, import("csstype").MarginRightProperty<string | number> | undefined, import("csstype").MarginRightProperty<string | number> | undefined] | undefined;
29
+ mt?: import("csstype").MarginTopProperty<string | number> | [import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined] | [import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined] | undefined;
30
+ mb?: import("csstype").MarginBottomProperty<string | number> | [import("csstype").MarginBottomProperty<string | number> | undefined, import("csstype").MarginBottomProperty<string | number> | undefined] | [import("csstype").MarginBottomProperty<string | number> | undefined, import("csstype").MarginBottomProperty<string | number> | undefined, import("csstype").MarginBottomProperty<string | number> | undefined] | undefined;
31
+ mx?: import("csstype").MarginLeftProperty<string | number> | [import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined] | [import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined, import("csstype").MarginLeftProperty<string | number> | undefined] | undefined;
32
+ my?: import("csstype").MarginTopProperty<string | number> | [import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined] | [import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined, import("csstype").MarginTopProperty<string | number> | undefined] | undefined;
33
+ pl?: import("csstype").PaddingLeftProperty<string | number> | [import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined] | [import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined] | undefined;
34
+ pr?: import("csstype").PaddingRightProperty<string | number> | [import("csstype").PaddingRightProperty<string | number> | undefined, import("csstype").PaddingRightProperty<string | number> | undefined] | [import("csstype").PaddingRightProperty<string | number> | undefined, import("csstype").PaddingRightProperty<string | number> | undefined, import("csstype").PaddingRightProperty<string | number> | undefined] | undefined;
35
+ pt?: import("csstype").PaddingTopProperty<string | number> | [import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined] | [import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined] | undefined;
36
+ pb?: import("csstype").PaddingBottomProperty<string | number> | [import("csstype").PaddingBottomProperty<string | number> | undefined, import("csstype").PaddingBottomProperty<string | number> | undefined] | [import("csstype").PaddingBottomProperty<string | number> | undefined, import("csstype").PaddingBottomProperty<string | number> | undefined, import("csstype").PaddingBottomProperty<string | number> | undefined] | undefined;
37
+ px?: import("csstype").PaddingLeftProperty<string | number> | [import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined] | [import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined, import("csstype").PaddingLeftProperty<string | number> | undefined] | undefined;
38
+ py?: import("csstype").PaddingTopProperty<string | number> | [import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined] | [import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined, import("csstype").PaddingTopProperty<string | number> | undefined] | undefined;
39
+ minWidth?: import("csstype").MinWidthProperty<string | number> | [import("csstype").MinWidthProperty<string | number> | undefined, import("csstype").MinWidthProperty<string | number> | undefined] | [import("csstype").MinWidthProperty<string | number> | undefined, import("csstype").MinWidthProperty<string | number> | undefined, import("csstype").MinWidthProperty<string | number> | undefined] | undefined;
40
+ minHeight?: import("csstype").MinHeightProperty<string | number> | [import("csstype").MinHeightProperty<string | number> | undefined, import("csstype").MinHeightProperty<string | number> | undefined] | [import("csstype").MinHeightProperty<string | number> | undefined, import("csstype").MinHeightProperty<string | number> | undefined, import("csstype").MinHeightProperty<string | number> | undefined] | undefined;
41
+ maxWidth?: import("csstype").MaxWidthProperty<string | number> | [import("csstype").MaxWidthProperty<string | number> | undefined, import("csstype").MaxWidthProperty<string | number> | undefined] | [import("csstype").MaxWidthProperty<string | number> | undefined, import("csstype").MaxWidthProperty<string | number> | undefined, import("csstype").MaxWidthProperty<string | number> | undefined] | undefined;
42
+ maxHeight?: import("csstype").MaxHeightProperty<string | number> | [import("csstype").MaxHeightProperty<string | number> | undefined, import("csstype").MaxHeightProperty<string | number> | undefined] | [import("csstype").MaxHeightProperty<string | number> | undefined, import("csstype").MaxHeightProperty<string | number> | undefined, import("csstype").MaxHeightProperty<string | number> | undefined] | undefined;
43
+ backgroundColor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
44
+ borderLeftColor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
45
+ borderRightColor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
46
+ borderTopColor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
47
+ borderBottomColor?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
48
+ borderStyle?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
49
+ borderTopStyle?: import("csstype").BorderTopStyleProperty | [import("csstype").BorderTopStyleProperty | undefined, import("csstype").BorderTopStyleProperty | undefined] | [import("csstype").BorderTopStyleProperty | undefined, import("csstype").BorderTopStyleProperty | undefined, import("csstype").BorderTopStyleProperty | undefined] | undefined;
50
+ borderBottomStyle?: import("csstype").BorderBottomStyleProperty | [import("csstype").BorderBottomStyleProperty | undefined, import("csstype").BorderBottomStyleProperty | undefined] | [import("csstype").BorderBottomStyleProperty | undefined, import("csstype").BorderBottomStyleProperty | undefined, import("csstype").BorderBottomStyleProperty | undefined] | undefined;
51
+ borderLeftStyle?: import("csstype").BorderLeftStyleProperty | [import("csstype").BorderLeftStyleProperty | undefined, import("csstype").BorderLeftStyleProperty | undefined] | [import("csstype").BorderLeftStyleProperty | undefined, import("csstype").BorderLeftStyleProperty | undefined, import("csstype").BorderLeftStyleProperty | undefined] | undefined;
52
+ borderRightStyle?: import("csstype").BorderRightStyleProperty | [import("csstype").BorderRightStyleProperty | undefined, import("csstype").BorderRightStyleProperty | undefined] | [import("csstype").BorderRightStyleProperty | undefined, import("csstype").BorderRightStyleProperty | undefined, import("csstype").BorderRightStyleProperty | undefined] | undefined;
53
+ borderWidth?: import("csstype").BorderWidthProperty<string | number> | [import("csstype").BorderWidthProperty<string | number> | undefined, import("csstype").BorderWidthProperty<string | number> | undefined] | [import("csstype").BorderWidthProperty<string | number> | undefined, import("csstype").BorderWidthProperty<string | number> | undefined, import("csstype").BorderWidthProperty<string | number> | undefined] | undefined;
54
+ borderTopWidth?: import("csstype").BorderTopWidthProperty<string | number> | [import("csstype").BorderTopWidthProperty<string | number> | undefined, import("csstype").BorderTopWidthProperty<string | number> | undefined] | [import("csstype").BorderTopWidthProperty<string | number> | undefined, import("csstype").BorderTopWidthProperty<string | number> | undefined, import("csstype").BorderTopWidthProperty<string | number> | undefined] | undefined;
55
+ borderBottomWidth?: import("csstype").BorderBottomWidthProperty<string | number> | [import("csstype").BorderBottomWidthProperty<string | number> | undefined, import("csstype").BorderBottomWidthProperty<string | number> | undefined] | [import("csstype").BorderBottomWidthProperty<string | number> | undefined, import("csstype").BorderBottomWidthProperty<string | number> | undefined, import("csstype").BorderBottomWidthProperty<string | number> | undefined] | undefined;
56
+ borderLeftWidth?: import("csstype").BorderLeftWidthProperty<string | number> | [import("csstype").BorderLeftWidthProperty<string | number> | undefined, import("csstype").BorderLeftWidthProperty<string | number> | undefined] | [import("csstype").BorderLeftWidthProperty<string | number> | undefined, import("csstype").BorderLeftWidthProperty<string | number> | undefined, import("csstype").BorderLeftWidthProperty<string | number> | undefined] | undefined;
57
+ borderRightWidth?: import("csstype").BorderRightWidthProperty<string | number> | [import("csstype").BorderRightWidthProperty<string | number> | undefined, import("csstype").BorderRightWidthProperty<string | number> | undefined] | [import("csstype").BorderRightWidthProperty<string | number> | undefined, import("csstype").BorderRightWidthProperty<string | number> | undefined, import("csstype").BorderRightWidthProperty<string | number> | undefined] | undefined;
58
+ borderRadius?: import("csstype").BorderRadiusProperty<string | number> | [import("csstype").BorderRadiusProperty<string | number> | undefined, import("csstype").BorderRadiusProperty<string | number> | undefined] | [import("csstype").BorderRadiusProperty<string | number> | undefined, import("csstype").BorderRadiusProperty<string | number> | undefined, import("csstype").BorderRadiusProperty<string | number> | undefined] | undefined;
59
+ borderTopLeftRadius?: import("csstype").BorderTopLeftRadiusProperty<string | number> | [import("csstype").BorderTopLeftRadiusProperty<string | number> | undefined, import("csstype").BorderTopLeftRadiusProperty<string | number> | undefined] | [import("csstype").BorderTopLeftRadiusProperty<string | number> | undefined, import("csstype").BorderTopLeftRadiusProperty<string | number> | undefined, import("csstype").BorderTopLeftRadiusProperty<string | number> | undefined] | undefined;
60
+ borderTopRightRadius?: import("csstype").BorderTopRightRadiusProperty<string | number> | [import("csstype").BorderTopRightRadiusProperty<string | number> | undefined, import("csstype").BorderTopRightRadiusProperty<string | number> | undefined] | [import("csstype").BorderTopRightRadiusProperty<string | number> | undefined, import("csstype").BorderTopRightRadiusProperty<string | number> | undefined, import("csstype").BorderTopRightRadiusProperty<string | number> | undefined] | undefined;
61
+ borderBottomLeftRadius?: import("csstype").BorderBottomLeftRadiusProperty<string | number> | [import("csstype").BorderBottomLeftRadiusProperty<string | number> | undefined, import("csstype").BorderBottomLeftRadiusProperty<string | number> | undefined] | [import("csstype").BorderBottomLeftRadiusProperty<string | number> | undefined, import("csstype").BorderBottomLeftRadiusProperty<string | number> | undefined, import("csstype").BorderBottomLeftRadiusProperty<string | number> | undefined] | undefined;
62
+ borderBottomRightRadius?: import("csstype").BorderBottomRightRadiusProperty<string | number> | [import("csstype").BorderBottomRightRadiusProperty<string | number> | undefined, import("csstype").BorderBottomRightRadiusProperty<string | number> | undefined] | [import("csstype").BorderBottomRightRadiusProperty<string | number> | undefined, import("csstype").BorderBottomRightRadiusProperty<string | number> | undefined, import("csstype").BorderBottomRightRadiusProperty<string | number> | undefined] | undefined;
63
+ textAlign?: import("csstype").TextAlignProperty | [import("csstype").TextAlignProperty | undefined, import("csstype").TextAlignProperty | undefined] | [import("csstype").TextAlignProperty | undefined, import("csstype").TextAlignProperty | undefined, import("csstype").TextAlignProperty | undefined] | undefined;
64
+ verticalAlign?: import("csstype").VerticalAlignProperty<string | number> | [import("csstype").VerticalAlignProperty<string | number> | undefined, import("csstype").VerticalAlignProperty<string | number> | undefined] | [import("csstype").VerticalAlignProperty<string | number> | undefined, import("csstype").VerticalAlignProperty<string | number> | undefined, import("csstype").VerticalAlignProperty<string | number> | undefined] | undefined;
65
+ alignItems?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
66
+ alignSelf?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
67
+ justifyContent?: string | [string | undefined, string | undefined] | [string | undefined, string | undefined, string | undefined] | undefined;
68
+ textTransform?: import("csstype").TextTransformProperty | [import("csstype").TextTransformProperty | undefined, import("csstype").TextTransformProperty | undefined] | [import("csstype").TextTransformProperty | undefined, import("csstype").TextTransformProperty | undefined, import("csstype").TextTransformProperty | undefined] | undefined;
69
+ boxSizing?: import("csstype").BoxSizingProperty | [import("csstype").BoxSizingProperty | undefined, import("csstype").BoxSizingProperty | undefined] | [import("csstype").BoxSizingProperty | undefined, import("csstype").BoxSizingProperty | undefined, import("csstype").BoxSizingProperty | undefined] | undefined;
70
+ flexDirection?: import("csstype").FlexDirectionProperty | [import("csstype").FlexDirectionProperty | undefined, import("csstype").FlexDirectionProperty | undefined] | [import("csstype").FlexDirectionProperty | undefined, import("csstype").FlexDirectionProperty | undefined, import("csstype").FlexDirectionProperty | undefined] | undefined;
71
+ flexBasis?: import("csstype").FlexBasisProperty<string | number> | [import("csstype").FlexBasisProperty<string | number> | undefined, import("csstype").FlexBasisProperty<string | number> | undefined] | [import("csstype").FlexBasisProperty<string | number> | undefined, import("csstype").FlexBasisProperty<string | number> | undefined, import("csstype").FlexBasisProperty<string | number> | undefined] | undefined;
72
+ flexGrow?: import("csstype").GlobalsNumber | [import("csstype").GlobalsNumber | undefined, import("csstype").GlobalsNumber | undefined] | [import("csstype").GlobalsNumber | undefined, import("csstype").GlobalsNumber | undefined, import("csstype").GlobalsNumber | undefined] | undefined;
73
+ gridTemplateColumns?: import("csstype").GridTemplateColumnsProperty<string | number> | [import("csstype").GridTemplateColumnsProperty<string | number> | undefined, import("csstype").GridTemplateColumnsProperty<string | number> | undefined] | [import("csstype").GridTemplateColumnsProperty<string | number> | undefined, import("csstype").GridTemplateColumnsProperty<string | number> | undefined, import("csstype").GridTemplateColumnsProperty<string | number> | undefined] | undefined;
74
+ innerRef?: React.Ref<never> | undefined;
75
+ gridColumnSpan?: number | number[] | "all" | "end" | undefined;
76
+ gridColumnPad?: number | number[] | undefined;
77
+ gridRowSpan?: number | number[] | undefined;
78
+ gridRowPad?: number | number[] | undefined;
79
+ gridAlign?: ("start" | "end" | "center" | "stretch") | undefined;
80
+ gridJustify?: ("start" | "end" | "center" | "stretch") | undefined;
81
+ }>;
82
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import Notification from './Notification';
2
+ import NotificationList from './NotificationList';
3
+ import NotificationGlobalContainer from './NotificationGlobalContainer';
4
+ export { Notification, NotificationList, NotificationGlobalContainer };
@@ -0,0 +1,4 @@
1
+ import { type TNotificationType } from './Notification';
2
+ import { type ThemeProp } from '@cloudflare/style-container';
3
+ export declare const getBorderColor: (theme: ThemeProp['theme'], type?: TNotificationType | undefined) => string;
4
+ export declare const getBackgroundColor: (theme: ThemeProp['theme'], type?: TNotificationType | undefined) => string;
@@ -1,85 +1,15 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
1
3
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { isDarkMode } from '@cloudflare/style-const';
4
4
  import raf from 'raf';
5
- import { createComponent } from '@cloudflare/style-container';
6
- import { Icon } from '@cloudflare/component-icon';
7
-
8
- var getBorderColor = (type, theme) => {
9
- switch (type) {
10
- case 'success':
11
- return theme.colors.green[5];
12
-
13
- case 'warning':
14
- return theme.colors.orange[5];
15
-
16
- case 'error':
17
- return theme.colors.red[2];
18
-
19
- case 'info':
20
- default:
21
- return theme.colors.blue[3];
22
- }
23
- };
24
-
25
- var getBackgroundColor = (type, theme) => {
26
- switch (type) {
27
- case 'success':
28
- return theme.colors.green[isDarkMode() ? 3 : 6];
29
-
30
- case 'warning':
31
- return theme.colors.orange[isDarkMode() ? 3 : 6];
32
-
33
- case 'error':
34
- return theme.colors.red[3];
35
-
36
- case 'info':
37
- default:
38
- return theme.colors.blue[isDarkMode() ? 3 : 6];
39
- }
40
- };
41
-
42
- var NotificationMessage = createComponent(_ref => {
43
- var {
44
- theme
45
- } = _ref;
46
- return {
47
- position: 'relative',
48
- zIndex: 2,
49
- color: theme.colors.white,
50
- display: 'flex',
51
- alignItems: 'center'
52
- };
53
- }, 'span');
54
- var NotificationClose = createComponent(_ref2 => {
5
+ import { createStyledComponent } from '@cloudflare/style-container';
6
+ import NotificationItem from './NotificationItem';
7
+ import { getBackgroundColor, getBorderColor } from './utils';
8
+ var NotificationContainer = createStyledComponent(_ref => {
55
9
  var {
56
10
  theme,
57
11
  type
58
- } = _ref2;
59
- return {
60
- position: 'absolute',
61
- zIndex: 3,
62
- top: 0,
63
- right: 0,
64
- bottom: 0,
65
- width: '2.5em',
66
- cursor: 'pointer',
67
- '&:hover': {
68
- backgroundColor: getBorderColor(type, theme)
69
- },
70
- '&::before': {
71
- position: 'absolute',
72
- top: '50%',
73
- left: '50%',
74
- transform: 'translate(-50%, -50%)'
75
- }
76
- };
77
- }, 'span');
78
- var NotificationContainer = createComponent(_ref3 => {
79
- var {
80
- theme,
81
- type
82
- } = _ref3;
12
+ } = _ref;
83
13
  return {
84
14
  position: 'relative',
85
15
  padding: theme.space[2],
@@ -88,16 +18,16 @@ var NotificationContainer = createComponent(_ref3 => {
88
18
  '-webkit-font-smoothing': 'antialiased',
89
19
  cursor: 'pointer',
90
20
  transformOrigin: 'bottom left',
91
- borderTopColor: getBorderColor(type, theme),
92
- borderBottomColor: getBorderColor(type, theme),
93
- borderLeftColor: getBorderColor(type, theme),
94
- borderRightColor: getBorderColor(type, theme),
21
+ borderTopColor: getBorderColor(theme, type),
22
+ borderBottomColor: getBorderColor(theme, type),
23
+ borderLeftColor: getBorderColor(theme, type),
24
+ borderRightColor: getBorderColor(theme, type),
95
25
  borderTopWidth: 1,
96
26
  borderRightWidth: 1,
97
27
  borderBottomWidth: 0,
98
28
  borderLeftWidth: 1,
99
29
  borderStyle: 'solid',
100
- backgroundColor: getBackgroundColor(type, theme),
30
+ backgroundColor: getBackgroundColor(theme, type),
101
31
  animationName: {
102
32
  '0%': {
103
33
  transform: 'scaleY(0)'
@@ -121,76 +51,13 @@ var NotificationContainer = createComponent(_ref3 => {
121
51
  }
122
52
  };
123
53
  }, 'div');
124
- var IconWrapper = createComponent(() => ({
125
- paddingRight: 6,
126
- display: 'flex'
127
- }));
128
- var NotificationWrapper = createComponent(() => ({
129
- display: 'flex'
130
- }));
131
- var CloseWrapper = createComponent(() => ({
132
- position: 'absolute',
133
- top: '50%',
134
- left: '50%',
135
- transform: 'translate(-50%,-50%)'
136
- }));
137
- var NotificationItem = createComponent(() => ({}), _ref4 => {
138
- var {
139
- children,
140
- closable,
141
- handleClickClose,
142
- type
143
- } = _ref4;
144
- var iconType;
145
-
146
- switch (type) {
147
- case 'success':
148
- iconType = 'ok-sign';
149
- break;
150
-
151
- case 'info':
152
- iconType = 'info-sign';
153
- break;
154
-
155
- case 'warning':
156
- iconType = 'exclamation-sign';
157
- break;
158
-
159
- case 'error':
160
- iconType = 'exclamation-sign';
161
- break;
162
-
163
- default:
164
- iconType = 'info-sign';
165
- break;
166
- }
167
-
168
- return /*#__PURE__*/React.createElement(NotificationWrapper, null, /*#__PURE__*/React.createElement(NotificationMessage, null, /*#__PURE__*/React.createElement(IconWrapper, null, /*#__PURE__*/React.createElement(Icon, {
169
- type: iconType,
170
- label: type ? type : 'info-sign',
171
- color: "white",
172
- size: 24
173
- })), children), closable && /*#__PURE__*/React.createElement(NotificationClose, {
174
- onClick: handleClickClose,
175
- type: type
176
- }, /*#__PURE__*/React.createElement(CloseWrapper, null, /*#__PURE__*/React.createElement(Icon, {
177
- type: "remove",
178
- label: "close",
179
- color: "white"
180
- }))));
181
- });
182
- NotificationItem.propTypes = {
183
- children: PropTypes.string,
184
- closable: PropTypes.bool,
185
- persist: PropTypes.bool,
186
- duration: PropTypes.number,
187
- active: PropTypes.bool,
188
- handleClickClose: PropTypes.func
189
- };
190
54
 
191
55
  class Notification extends React.Component {
192
56
  constructor(props) {
193
57
  super(props);
58
+
59
+ _defineProperty(this, "_raf", null);
60
+
194
61
  this.state = {
195
62
  persist: this.props.persist,
196
63
  timeoutId: null
@@ -268,27 +135,17 @@ class Notification extends React.Component {
268
135
  }, /*#__PURE__*/React.createElement(NotificationItem, {
269
136
  closable: this.props.closable,
270
137
  handleClickClose: this.handleClickClose.bind(this),
271
- duration: this.props.delay,
272
- persist: this.state.persist,
273
- active: !!this.state.timeoutId,
274
138
  type: this.props.type
275
139
  }, this.props.message));
276
140
  }
277
141
 
278
142
  }
279
143
 
280
- Notification.propTypes = {
281
- type: PropTypes.oneOf(['success', 'error', 'info', 'warning']),
282
- message: PropTypes.string.isRequired,
283
- closable: PropTypes.bool,
284
- delay: PropTypes.number,
285
- persist: PropTypes.bool,
286
- onClose: PropTypes.func.isRequired
287
- };
288
- Notification.defaultProps = {
144
+ _defineProperty(Notification, "defaultProps", {
289
145
  closable: true,
290
146
  delay: 4000,
291
147
  persist: false,
292
148
  type: 'info'
293
- };
149
+ });
150
+
294
151
  export default Notification;
@@ -1,8 +1,6 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { createComponent } from '@cloudflare/style-container';
4
-
5
- var styles = _ref => {
2
+ import { createStyledComponent } from '@cloudflare/style-container';
3
+ var StyledContainer = createStyledComponent(_ref => {
6
4
  var {
7
5
  theme
8
6
  } = _ref;
@@ -16,21 +14,16 @@ var styles = _ref => {
16
14
  zIndex: 1600,
17
15
  fontSize: theme.fontSizes[3]
18
16
  };
19
- };
17
+ }, 'div');
20
18
 
21
19
  var NotificationGlobalContainer = _ref2 => {
22
20
  var {
23
21
  className,
24
22
  children
25
23
  } = _ref2;
26
- return /*#__PURE__*/React.createElement("div", {
24
+ return /*#__PURE__*/React.createElement(StyledContainer, {
27
25
  className: className
28
26
  }, children);
29
27
  };
30
28
 
31
- NotificationGlobalContainer.propTypes = {
32
- children: PropTypes.node,
33
- className: PropTypes.string
34
- };
35
- NotificationGlobalContainer.displayName = 'NotificationGlobalContainer';
36
- export default createComponent(styles, NotificationGlobalContainer);
29
+ export default NotificationGlobalContainer;
@@ -0,0 +1,101 @@
1
+ import React from 'react';
2
+ import { Icon } from '@cloudflare/component-icon';
3
+ import { createStyledComponent } from '@cloudflare/style-container';
4
+ import { getBorderColor } from './utils';
5
+ var IconWrapper = createStyledComponent(() => ({
6
+ paddingRight: '6px',
7
+ display: 'flex'
8
+ }));
9
+ var NotificationWrapper = createStyledComponent(() => ({
10
+ display: 'flex'
11
+ }));
12
+ var CloseWrapper = createStyledComponent(() => ({
13
+ position: 'absolute',
14
+ top: '50%',
15
+ left: '50%',
16
+ transform: 'translate(-50%,-50%)'
17
+ }));
18
+ var NotificationMessage = createStyledComponent(_ref => {
19
+ var {
20
+ theme
21
+ } = _ref;
22
+ return {
23
+ position: 'relative',
24
+ zIndex: 2,
25
+ color: theme.colors.white,
26
+ display: 'flex',
27
+ alignItems: 'center'
28
+ };
29
+ }, 'span');
30
+ var NotificationClose = createStyledComponent(_ref2 => {
31
+ var {
32
+ theme,
33
+ type
34
+ } = _ref2;
35
+ return {
36
+ position: 'absolute',
37
+ zIndex: 3,
38
+ top: 0,
39
+ right: 0,
40
+ bottom: 0,
41
+ width: '2.5em',
42
+ cursor: 'pointer',
43
+ '&:hover': {
44
+ backgroundColor: getBorderColor(theme, type)
45
+ },
46
+ '&::before': {
47
+ position: 'absolute',
48
+ top: '50%',
49
+ left: '50%',
50
+ transform: 'translate(-50%, -50%)'
51
+ }
52
+ };
53
+ }, 'span');
54
+
55
+ var NotificationItem = _ref3 => {
56
+ var {
57
+ children,
58
+ closable,
59
+ handleClickClose,
60
+ type
61
+ } = _ref3;
62
+ var iconType;
63
+
64
+ switch (type) {
65
+ case 'success':
66
+ iconType = 'ok-sign';
67
+ break;
68
+
69
+ case 'info':
70
+ iconType = 'info-sign';
71
+ break;
72
+
73
+ case 'warning':
74
+ iconType = 'exclamation-sign';
75
+ break;
76
+
77
+ case 'error':
78
+ iconType = 'exclamation-sign';
79
+ break;
80
+
81
+ default:
82
+ iconType = 'info-sign';
83
+ break;
84
+ }
85
+
86
+ return /*#__PURE__*/React.createElement(NotificationWrapper, null, /*#__PURE__*/React.createElement(NotificationMessage, null, /*#__PURE__*/React.createElement(IconWrapper, null, /*#__PURE__*/React.createElement(Icon, {
87
+ type: iconType,
88
+ label: type ? type : 'info-sign',
89
+ color: "white",
90
+ size: 24
91
+ })), children), closable && /*#__PURE__*/React.createElement(NotificationClose, {
92
+ onClick: handleClickClose,
93
+ type: type
94
+ }, /*#__PURE__*/React.createElement(CloseWrapper, null, /*#__PURE__*/React.createElement(Icon, {
95
+ type: "remove",
96
+ label: "close",
97
+ color: "white"
98
+ }))));
99
+ };
100
+
101
+ export default NotificationItem;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { createComponent } from '@cloudflare/style-container';
2
+ import { createStyledComponent } from '@cloudflare/style-container';
4
3
 
5
4
  var styles = () => ({
6
5
  marginTop: 0,
@@ -17,9 +16,4 @@ var NotificationList = _ref => {
17
16
  }, children);
18
17
  };
19
18
 
20
- NotificationList.propTypes = {
21
- children: PropTypes.node,
22
- className: PropTypes.string
23
- };
24
- NotificationList.displayName = 'NotificationList';
25
- export default createComponent(styles, NotificationList);
19
+ export default createStyledComponent(styles, NotificationList);
package/es/utils.js ADDED
@@ -0,0 +1,33 @@
1
+ import { isDarkMode } from '@cloudflare/style-const';
2
+ export var getBorderColor = (theme, type) => {
3
+ switch (type) {
4
+ case 'success':
5
+ return theme.colors.green[5];
6
+
7
+ case 'warning':
8
+ return theme.colors.orange[5];
9
+
10
+ case 'error':
11
+ return theme.colors.red[2];
12
+
13
+ case 'info':
14
+ default:
15
+ return theme.colors.blue[3];
16
+ }
17
+ };
18
+ export var getBackgroundColor = (theme, type) => {
19
+ switch (type) {
20
+ case 'success':
21
+ return theme.colors.green[isDarkMode() ? 3 : 6];
22
+
23
+ case 'warning':
24
+ return theme.colors.orange[isDarkMode() ? 3 : 6];
25
+
26
+ case 'error':
27
+ return theme.colors.red[3];
28
+
29
+ case 'info':
30
+ default:
31
+ return theme.colors.blue[isDarkMode() ? 3 : 6];
32
+ }
33
+ };