@neo4j-ndl/react 3.0.34 → 3.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/lib/cjs/_common/ConditionalWrap.js.map +1 -1
- package/lib/cjs/breadcrumbs/Breadcrumbs.js +10 -6
- package/lib/cjs/breadcrumbs/Breadcrumbs.js.map +1 -1
- package/lib/cjs/context-menu/ContextMenu.js +3 -2
- package/lib/cjs/context-menu/ContextMenu.js.map +1 -1
- package/lib/cjs/icons/generated/custom/BoxSelect.js +1 -1
- package/lib/cjs/icons/generated/custom/BoxSelect.js.map +1 -1
- package/lib/cjs/icons/generated/custom/CurlyBrackets.js +1 -1
- package/lib/cjs/icons/generated/custom/CurlyBrackets.js.map +1 -1
- package/lib/cjs/icons/generated/custom/DatabaseCrossed.js +1 -1
- package/lib/cjs/icons/generated/custom/DatabaseCrossed.js.map +1 -1
- package/lib/cjs/icons/generated/custom/DatabaseSignal.js +1 -1
- package/lib/cjs/icons/generated/custom/DatabaseSignal.js.map +1 -1
- package/lib/cjs/icons/generated/custom/Explore.js +1 -1
- package/lib/cjs/icons/generated/custom/Explore.js.map +1 -1
- package/lib/cjs/icons/generated/custom/Github.js +1 -1
- package/lib/cjs/icons/generated/custom/Github.js.map +1 -1
- package/lib/cjs/icons/generated/custom/Lasso.js +1 -1
- package/lib/cjs/icons/generated/custom/Lasso.js.map +1 -1
- package/lib/cjs/icons/generated/custom/Pan.js +1 -1
- package/lib/cjs/icons/generated/custom/Pan.js.map +1 -1
- package/lib/cjs/icons/generated/custom/Query.js +1 -1
- package/lib/cjs/icons/generated/custom/Query.js.map +1 -1
- package/lib/cjs/icons/generated/custom/ResetZoom.js +1 -1
- package/lib/cjs/icons/generated/custom/ResetZoom.js.map +1 -1
- package/lib/cjs/icons/generated/custom/Roles.js +1 -1
- package/lib/cjs/icons/generated/custom/Roles.js.map +1 -1
- package/lib/cjs/icons/generated/custom/Select.js +1 -1
- package/lib/cjs/icons/generated/custom/Select.js.map +1 -1
- package/lib/cjs/index.js +2 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/popover/Popover.js +3 -2
- package/lib/cjs/popover/Popover.js.map +1 -1
- package/lib/cjs/popover/use-popover.js +4 -2
- package/lib/cjs/popover/use-popover.js.map +1 -1
- package/lib/cjs/select/Overrides.js +8 -3
- package/lib/cjs/select/Overrides.js.map +1 -1
- package/lib/cjs/skeleton/Skeleton.js +37 -0
- package/lib/cjs/skeleton/Skeleton.js.map +1 -0
- package/lib/cjs/{toast/sonner-types.js → skeleton/index.js} +16 -18
- package/lib/cjs/skeleton/index.js.map +1 -0
- package/lib/cjs/time-picker/TimePicker.js +229 -0
- package/lib/cjs/time-picker/TimePicker.js.map +1 -0
- package/lib/cjs/time-picker/generate-time-options.js +42 -0
- package/lib/cjs/time-picker/generate-time-options.js.map +1 -0
- package/lib/cjs/time-picker/index.js +38 -0
- package/lib/cjs/time-picker/index.js.map +1 -0
- package/lib/cjs/time-picker/needle-time.js +88 -0
- package/lib/cjs/time-picker/needle-time.js.map +1 -0
- package/lib/cjs/time-picker/time-picker-hooks.js +49 -0
- package/lib/cjs/time-picker/time-picker-hooks.js.map +1 -0
- package/lib/cjs/toast/Toast.js +4 -4
- package/lib/cjs/toast/Toast.js.map +1 -1
- package/lib/esm/_common/ConditionalWrap.js.map +1 -1
- package/lib/esm/breadcrumbs/Breadcrumbs.js +10 -6
- package/lib/esm/breadcrumbs/Breadcrumbs.js.map +1 -1
- package/lib/esm/context-menu/ContextMenu.js +3 -2
- package/lib/esm/context-menu/ContextMenu.js.map +1 -1
- package/lib/esm/icons/generated/custom/BoxSelect.js +1 -1
- package/lib/esm/icons/generated/custom/BoxSelect.js.map +1 -1
- package/lib/esm/icons/generated/custom/CurlyBrackets.js +1 -1
- package/lib/esm/icons/generated/custom/CurlyBrackets.js.map +1 -1
- package/lib/esm/icons/generated/custom/DatabaseCrossed.js +1 -1
- package/lib/esm/icons/generated/custom/DatabaseCrossed.js.map +1 -1
- package/lib/esm/icons/generated/custom/DatabaseSignal.js +1 -1
- package/lib/esm/icons/generated/custom/DatabaseSignal.js.map +1 -1
- package/lib/esm/icons/generated/custom/Explore.js +1 -1
- package/lib/esm/icons/generated/custom/Explore.js.map +1 -1
- package/lib/esm/icons/generated/custom/Github.js +1 -1
- package/lib/esm/icons/generated/custom/Github.js.map +1 -1
- package/lib/esm/icons/generated/custom/Lasso.js +1 -1
- package/lib/esm/icons/generated/custom/Lasso.js.map +1 -1
- package/lib/esm/icons/generated/custom/Pan.js +1 -1
- package/lib/esm/icons/generated/custom/Pan.js.map +1 -1
- package/lib/esm/icons/generated/custom/Query.js +1 -1
- package/lib/esm/icons/generated/custom/Query.js.map +1 -1
- package/lib/esm/icons/generated/custom/ResetZoom.js +1 -1
- package/lib/esm/icons/generated/custom/ResetZoom.js.map +1 -1
- package/lib/esm/icons/generated/custom/Roles.js +1 -1
- package/lib/esm/icons/generated/custom/Roles.js.map +1 -1
- package/lib/esm/icons/generated/custom/Select.js +1 -1
- package/lib/esm/icons/generated/custom/Select.js.map +1 -1
- package/lib/esm/index.js +2 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/popover/Popover.js +3 -2
- package/lib/esm/popover/Popover.js.map +1 -1
- package/lib/esm/popover/use-popover.js +4 -2
- package/lib/esm/popover/use-popover.js.map +1 -1
- package/lib/esm/select/Overrides.js +8 -3
- package/lib/esm/select/Overrides.js.map +1 -1
- package/lib/esm/skeleton/Skeleton.js +31 -0
- package/lib/esm/skeleton/Skeleton.js.map +1 -0
- package/lib/esm/skeleton/index.js +22 -0
- package/lib/esm/skeleton/index.js.map +1 -0
- package/lib/esm/time-picker/TimePicker.js +223 -0
- package/lib/esm/time-picker/TimePicker.js.map +1 -0
- package/lib/esm/time-picker/generate-time-options.js +38 -0
- package/lib/esm/time-picker/generate-time-options.js.map +1 -0
- package/lib/esm/time-picker/index.js +22 -0
- package/lib/esm/time-picker/index.js.map +1 -0
- package/lib/esm/time-picker/needle-time.js +84 -0
- package/lib/esm/time-picker/needle-time.js.map +1 -0
- package/lib/esm/time-picker/time-picker-hooks.js +45 -0
- package/lib/esm/time-picker/time-picker-hooks.js.map +1 -0
- package/lib/esm/toast/Toast.js +5 -5
- package/lib/esm/toast/Toast.js.map +1 -1
- package/lib/types/_common/ConditionalWrap.d.ts +4 -3
- package/lib/types/banner/Banner.d.ts +2 -2
- package/lib/types/breadcrumbs/Breadcrumbs.d.ts +4 -4
- package/lib/types/context-menu/ContextMenu.d.ts +1 -0
- package/lib/types/index.d.ts +2 -0
- package/lib/types/popover/Popover.d.ts +3 -1
- package/lib/types/popover/use-popover.d.ts +3 -1
- package/lib/types/skeleton/Skeleton.d.ts +35 -0
- package/lib/types/skeleton/index.d.ts +21 -0
- package/lib/types/time-picker/TimePicker.d.ts +43 -0
- package/lib/types/time-picker/generate-time-options.d.ts +21 -0
- package/lib/types/time-picker/index.d.ts +22 -0
- package/lib/{esm/toast/sonner-types.js → types/time-picker/needle-time.d.ts} +9 -15
- package/lib/types/time-picker/time-picker-hooks.d.ts +30 -0
- package/lib/types/toast/Toast.d.ts +1 -2
- package/package.json +4 -4
- package/lib/cjs/toast/sonner-types.js.map +0 -1
- package/lib/esm/toast/sonner-types.js.map +0 -1
- package/lib/types/toast/sonner-types.d.ts +0 -179
package/lib/esm/toast/Toast.js
CHANGED
|
@@ -33,7 +33,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
33
33
|
import React from 'react';
|
|
34
34
|
import { CheckCircleIconSolid, ExclamationCircleIconSolid, XMarkIconOutline, } from '../icons';
|
|
35
35
|
import { LoadingSpinner } from '../loading-spinner';
|
|
36
|
-
import { Toaster as SonnerToaster, toast as sonnerToast } from 'sonner';
|
|
36
|
+
import { Toaster as SonnerToaster, toast as sonnerToast, } from 'sonner';
|
|
37
37
|
import { classNames } from '../_common/defaultImports';
|
|
38
38
|
import { Button, IconButton } from '../button';
|
|
39
39
|
import { ProgressBar } from '../progress-bar';
|
|
@@ -77,10 +77,10 @@ const Toast = React.forwardRef(function Toast({ icon, id, text, variant, isClose
|
|
|
77
77
|
};
|
|
78
78
|
return (_jsxs("div", Object.assign({ id: String(id), className: "ndl-toast", tabIndex: -1, ref: ref, "data-variant": variant, "data-testid": "ndl-toast" }, htmlAttributes, { children: [_jsxs("div", { className: "ndl-toast-content", tabIndex: -1, children: [icon && (_jsx("div", { className: `ndl-toast-icon ndl-toast-${variant}`, children: icon })), _jsx("div", { className: "ndl-toast-text", children: text }), actionLabel && (_jsx(Button, { className: "ndl-toast-action", fill: "outlined", size: "small", onClick: handleOnAction, onKeyDown: handleOnAction, children: actionLabel })), (isCloseable || actionLabel || isProgressBar) && (_jsx(IconButton, { isClean: true, className: "ndl-toast-close-button", onKeyDown: handleOnClose, onClick: handleOnClose, ariaLabel: "Close toast", size: "small", children: _jsx(XMarkIconOutline, {}) }))] }), isProgressBar && (_jsx(ProgressBar, { size: "small", value: initialProgressBarValue !== null && initialProgressBarValue !== void 0 ? initialProgressBarValue : 0 }))] })));
|
|
79
79
|
});
|
|
80
|
-
function getProps(onClose, shouldAutoClose, onAutoClose, sonnerToastProps, variant) {
|
|
80
|
+
function getProps(onClose, shouldAutoClose, onAutoClose, onAction, sonnerToastProps, variant) {
|
|
81
81
|
const isProgressBar = variant === 'progress-bar';
|
|
82
82
|
// https://sonner.emilkowal.ski/toast#api-reference
|
|
83
|
-
return Object.assign({ duration: !isProgressBar && shouldAutoClose ? 5000 : Infinity, unstyled: true, onDismiss: (toast) => {
|
|
83
|
+
return Object.assign({ duration: !isProgressBar && shouldAutoClose ? (!onAction ? 5000 : 8000) : Infinity, unstyled: true, onDismiss: (toast) => {
|
|
84
84
|
onCloseCallback(onClose, toast.id);
|
|
85
85
|
}, onAutoClose: (toast) => {
|
|
86
86
|
if (onAutoClose)
|
|
@@ -88,7 +88,7 @@ function getProps(onClose, shouldAutoClose, onAutoClose, sonnerToastProps, varia
|
|
|
88
88
|
} }, sonnerToastProps);
|
|
89
89
|
}
|
|
90
90
|
function createToast(text, props, variant, icon) {
|
|
91
|
-
const { ref, sonnerToastProps = {}, onClose, shouldAutoClose, onAutoClose } = props, restProps = __rest(props, ["ref", "sonnerToastProps", "onClose", "shouldAutoClose", "onAutoClose"]);
|
|
91
|
+
const { ref, sonnerToastProps = {}, onClose, shouldAutoClose, onAutoClose, onAction } = props, restProps = __rest(props, ["ref", "sonnerToastProps", "onClose", "shouldAutoClose", "onAutoClose", "onAction"]);
|
|
92
92
|
const { id: sonnerToastPropsId } = sonnerToastProps;
|
|
93
93
|
sonnerToastProps.id = sonnerToastPropsId !== null && sonnerToastPropsId !== void 0 ? sonnerToastPropsId : `ndl-toast-${Date.now()}`;
|
|
94
94
|
// Unfortunately calling sonnerToast.dismiss does not trigger the onDismiss
|
|
@@ -102,7 +102,7 @@ function createToast(text, props, variant, icon) {
|
|
|
102
102
|
onClose,
|
|
103
103
|
},
|
|
104
104
|
};
|
|
105
|
-
return sonnerToast.custom((id) => (_jsx(Toast, Object.assign({}, restProps, { ref: ref, id: id, text: text, variant: variant, icon: icon, onClose: onClose }))), Object.assign({}, getProps(onClose, shouldAutoClose, onAutoClose, sonnerToastProps, variant)));
|
|
105
|
+
return sonnerToast.custom((id) => (_jsx(Toast, Object.assign({}, restProps, { ref: ref, id: id, text: text, variant: variant, icon: icon, onClose: onClose, onAction: onAction }))), Object.assign({}, getProps(onClose, shouldAutoClose, onAutoClose, onAction, sonnerToastProps, variant)));
|
|
106
106
|
}
|
|
107
107
|
const toast = {
|
|
108
108
|
neutral: (text, props = {}) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.js","sourceRoot":"","sources":["../../../src/toast/Toast.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAyB,MAAM,OAAO,CAAC;AAE9C,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,U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UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;QAEvE,0DAA0D;QAC1D,MAAM,UAAU,GAAG,GAAG,KAAK,GAAG,CAAC;QAC/B,MAAM,YAAY,GAAG,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,CAAmB,CAAC;QAE3E,IAAI,CAAC,YAAY;YAAE,OAAO;QAE1B,MAAM,2BAA2B,GAAG,YAAY,CAAC,aAAa,CAC5D,6BAA6B,CACZ,CAAC;QACpB,2BAA2B,CAAC,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QACzD,MAAM,kBAAkB,GAAG,2BAA2B,CAAC,aAAa,CAClE,mBAAmB,CACF,CAAC;QAEpB,IAAI,CAAC,2BAA2B;YAAE,OAAO;QAEzC,kBAAkB,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAC5D,CAAC;IACD,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE;;QACZ,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACxB,eAAe,CAAC,MAAC,WAAiC,CAAC,MAAM,CAAC,EAAE,CAAC,0CAAE,OAAO,EAAE,EAAE,CAAC,CAAC;IAC9E,CAAC;IACD,WAAW,EAAE,gDAAgD;CAC9D,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -18,13 +18,14 @@
|
|
|
18
18
|
* You should have received a copy of the GNU General Public License
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
|
+
import React from 'react';
|
|
21
22
|
/**
|
|
22
23
|
* Component to enable conditional
|
|
23
24
|
* wrapping of components
|
|
24
25
|
*/
|
|
25
26
|
export declare const ConditionalWrap: ({ shouldWrap, wrap, children, }: {
|
|
26
27
|
shouldWrap: boolean;
|
|
27
|
-
wrap: (
|
|
28
|
-
children:
|
|
29
|
-
}) =>
|
|
28
|
+
wrap: (children: React.ReactNode) => React.ReactNode;
|
|
29
|
+
children: React.ReactNode;
|
|
30
|
+
}) => React.ReactNode;
|
|
30
31
|
export default ConditionalWrap;
|
|
@@ -27,7 +27,7 @@ import { type PolymorphicPropsWithRef, type PolymorphicForwardRefExoticComponent
|
|
|
27
27
|
*
|
|
28
28
|
*
|
|
29
29
|
*/
|
|
30
|
-
type BannerActionsProps = {
|
|
30
|
+
export type BannerActionsProps = {
|
|
31
31
|
/** Label of the action item */
|
|
32
32
|
label: string;
|
|
33
33
|
disabled?: boolean;
|
|
@@ -100,7 +100,7 @@ declare const BannerNamespace: Omit<React.ForwardRefExoticComponent<BannerProps
|
|
|
100
100
|
[key: string]: unknown;
|
|
101
101
|
}>, "$$typeof"> & Omit<React.ExoticComponent<BannerProps & {
|
|
102
102
|
[key: string]: unknown;
|
|
103
|
-
}>, never> & (<InstanceT extends React.ElementType = "div">(props: PolymorphicPropsWithRef<InstanceT, BannerProps>) => React.ReactElement
|
|
103
|
+
}>, never> & (<InstanceT extends React.ElementType = "div">(props: PolymorphicPropsWithRef<InstanceT, BannerProps>) => React.ReactElement | null) & {
|
|
104
104
|
Actions: PolymorphicForwardRefExoticComponent<"a", BannerActionsProps>;
|
|
105
105
|
};
|
|
106
106
|
export { BannerNamespace as Banner };
|
|
@@ -24,9 +24,9 @@ import { type PolymorphicPropsWithRef, type PolymorphicForwardRefExoticComponent
|
|
|
24
24
|
export interface BreadcrumbsBaseItemProps extends Omit<React.HTMLProps<HTMLLIElement>, 'as' | 'onClick'> {
|
|
25
25
|
children?: React.ReactNode;
|
|
26
26
|
className?: string;
|
|
27
|
-
href
|
|
27
|
+
href?: string;
|
|
28
28
|
isCurrentPage?: boolean;
|
|
29
|
-
onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>, href
|
|
29
|
+
onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>, href?: string) => void;
|
|
30
30
|
}
|
|
31
31
|
export interface BreadcrumbsGroupItemProps {
|
|
32
32
|
children?: React.ReactNode;
|
|
@@ -37,9 +37,9 @@ export interface BreadcrumbsItemProps extends Omit<React.HTMLProps<HTMLLIElement
|
|
|
37
37
|
children: React.ReactNode;
|
|
38
38
|
className?: string;
|
|
39
39
|
hasSeparator?: boolean;
|
|
40
|
-
href
|
|
40
|
+
href?: string;
|
|
41
41
|
isCurrentPage?: boolean;
|
|
42
|
-
onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>, href
|
|
42
|
+
onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>, href?: string) => void;
|
|
43
43
|
}
|
|
44
44
|
export interface BreadcrumbsItemMenuProps extends Omit<ContextMenuProps, 'isOpen' | 'onClick' | 'onClose'> {
|
|
45
45
|
children: React.ReactNode;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -44,12 +44,14 @@ export interface PopoverProps {
|
|
|
44
44
|
hasAnchorPortal?: boolean;
|
|
45
45
|
/** If the popover should constrain the focus inside the popover while open */
|
|
46
46
|
shouldCaptureFocus?: boolean;
|
|
47
|
+
/** Which element to initially focus. **/
|
|
48
|
+
initialFocus?: number | React.MutableRefObject<HTMLElement | null>;
|
|
47
49
|
/** The role of the popover */
|
|
48
50
|
role?: 'tooltip' | 'dialog' | 'alertdialog' | 'menu' | 'listbox' | 'grid' | 'tree';
|
|
49
51
|
}
|
|
50
52
|
export declare const usePopoverContext: () => import("./use-popover").UsePopoverReturn;
|
|
51
53
|
export declare const Popover: {
|
|
52
|
-
({ children, anchorElement, placement, isOpen, offset, anchorPosition, hasAnchorPortal, shouldCaptureFocus, onOpenChange, role, }: PopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
({ children, anchorElement, placement, isOpen, offset, anchorPosition, hasAnchorPortal, shouldCaptureFocus, initialFocus, onOpenChange, role, }: PopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
53
55
|
Trigger: React.ForwardRefExoticComponent<PopoverTriggerProps & React.RefAttributes<HTMLElement>>;
|
|
54
56
|
Content: PolymorphicForwardRefExoticComponent<"div", PopoverContentProps>;
|
|
55
57
|
};
|
|
@@ -32,6 +32,7 @@ export interface PopoverOptions {
|
|
|
32
32
|
};
|
|
33
33
|
anchorElementAsPortalAnchor?: boolean;
|
|
34
34
|
shouldCaptureFocus?: boolean;
|
|
35
|
+
initialFocus?: number | React.MutableRefObject<HTMLElement | null>;
|
|
35
36
|
role?: 'tooltip' | 'dialog' | 'alertdialog' | 'menu' | 'listbox' | 'grid' | 'tree';
|
|
36
37
|
}
|
|
37
38
|
export interface UsePopoverReturn extends UseInteractionsReturn, ReturnType<typeof useFloating> {
|
|
@@ -44,5 +45,6 @@ export interface UsePopoverReturn extends UseInteractionsReturn, ReturnType<type
|
|
|
44
45
|
setDescriptionId: (descriptionId: string | undefined) => void;
|
|
45
46
|
anchorElementAsPortalAnchor: boolean | undefined;
|
|
46
47
|
shouldCaptureFocus: boolean | undefined;
|
|
48
|
+
initialFocus: number | React.MutableRefObject<HTMLElement | null> | undefined;
|
|
47
49
|
}
|
|
48
|
-
export declare function usePopover({ isInitialOpen, placement, isOpen: controlledOpen, onOpenChange: setControlledOpen, offsetOption, anchorElement, anchorPosition, anchorElementAsPortalAnchor, shouldCaptureFocus, role: roleProp, }?: PopoverOptions): UsePopoverReturn;
|
|
50
|
+
export declare function usePopover({ isInitialOpen, placement, isOpen: controlledOpen, onOpenChange: setControlledOpen, offsetOption, anchorElement, anchorPosition, anchorElementAsPortalAnchor, shouldCaptureFocus, initialFocus, role: roleProp, }?: PopoverOptions): UsePopoverReturn;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import React from 'react';
|
|
22
|
+
import { type PolymorphicForwardRefExoticComponent } from '../_common/types';
|
|
23
|
+
export type SkeletonProps = {
|
|
24
|
+
variant?: 'circular' | 'rectangular';
|
|
25
|
+
/** height of the skeleton */
|
|
26
|
+
height?: string;
|
|
27
|
+
/** width of the skeleton */
|
|
28
|
+
width?: string;
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
/** What background the skeleton is placed on */
|
|
31
|
+
onBackground?: 'weak' | 'default';
|
|
32
|
+
isLoading?: boolean;
|
|
33
|
+
count?: number;
|
|
34
|
+
};
|
|
35
|
+
export declare const Skeleton: PolymorphicForwardRefExoticComponent<'div', SkeletonProps>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
export * from './Skeleton';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
import React from 'react';
|
|
22
|
+
import { NeedleTime } from './needle-time';
|
|
23
|
+
import { type HtmlAttributes } from '../_common/types';
|
|
24
|
+
export type TimeFormat = 'hh:mm' | 'hh:mm aa';
|
|
25
|
+
export interface TimePickerProps {
|
|
26
|
+
selected?: NeedleTime;
|
|
27
|
+
format?: TimeFormat;
|
|
28
|
+
isFluid?: boolean;
|
|
29
|
+
isReadOnly?: boolean;
|
|
30
|
+
isRequired?: boolean;
|
|
31
|
+
isDisabled?: boolean;
|
|
32
|
+
timeInterval?: number;
|
|
33
|
+
label?: string;
|
|
34
|
+
size?: 'small' | 'medium' | 'large';
|
|
35
|
+
errorText?: string;
|
|
36
|
+
className?: string;
|
|
37
|
+
style?: React.CSSProperties;
|
|
38
|
+
onChange?: (time: NeedleTime) => void;
|
|
39
|
+
onError?: (error: string) => void;
|
|
40
|
+
/** HTML attributes */
|
|
41
|
+
htmlAttributes?: HtmlAttributes<'div'>;
|
|
42
|
+
}
|
|
43
|
+
export declare const TimePicker: React.ForwardRefExoticComponent<TimePickerProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
export declare const generateTimeOptions: (is24Hour: boolean, interval: number) => string[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
export * from './TimePicker';
|
|
22
|
+
export type { NeedleTime } from './needle-time';
|
|
@@ -18,19 +18,13 @@
|
|
|
18
18
|
* You should have received a copy of the GNU General Public License
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
export declare class NeedleTime {
|
|
22
|
+
hour: number;
|
|
23
|
+
minute: number;
|
|
24
|
+
constructor(hour?: number, minute?: number);
|
|
25
|
+
toString(is24Hour?: boolean): string;
|
|
26
|
+
static fromString(timeString: string): NeedleTime;
|
|
27
|
+
hourString(is24Hour?: boolean): string;
|
|
28
|
+
minuteString(): string;
|
|
29
|
+
periodString(): string;
|
|
29
30
|
}
|
|
30
|
-
export var SwipeStateTypes;
|
|
31
|
-
(function (SwipeStateTypes) {
|
|
32
|
-
SwipeStateTypes["SwipedOut"] = "SwipedOut";
|
|
33
|
-
SwipeStateTypes["SwipedBack"] = "SwipedBack";
|
|
34
|
-
SwipeStateTypes["NotSwiped"] = "NotSwiped";
|
|
35
|
-
})(SwipeStateTypes || (SwipeStateTypes = {}));
|
|
36
|
-
//# sourceMappingURL=sonner-types.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright (c) "Neo4j"
|
|
4
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
+
*
|
|
6
|
+
* This file is part of Neo4j.
|
|
7
|
+
*
|
|
8
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU General Public License
|
|
19
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
export declare function useTimePickerPopover(openInitially: boolean): {
|
|
23
|
+
isPopoverOpen: boolean;
|
|
24
|
+
setIsPopoverOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
25
|
+
};
|
|
26
|
+
export declare function useKeyboardNavigation(listRef: React.RefObject<HTMLUListElement>, maxIndex: number): {
|
|
27
|
+
focusedIndex: number;
|
|
28
|
+
setFocusedIndex: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
29
|
+
handleArrowNavigation: (key: string) => void;
|
|
30
|
+
};
|
|
@@ -19,8 +19,7 @@
|
|
|
19
19
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
21
|
import React, { type ReactNode } from 'react';
|
|
22
|
-
import { toast as sonnerToast } from 'sonner';
|
|
23
|
-
import { type ExternalToast as SonnerExternalToast, type ToasterProps as SonnerToasterProps } from './sonner-types';
|
|
22
|
+
import { toast as sonnerToast, type ExternalToast as SonnerExternalToast, type ToasterProps as SonnerToasterProps } from 'sonner';
|
|
24
23
|
import { type HtmlAttributes } from '../_common/types';
|
|
25
24
|
type ToastVariants = 'neutral' | 'success' | 'danger' | 'loading-spinner' | 'progress-bar';
|
|
26
25
|
type ToastCommandVariants = 'neutral' | 'success' | 'danger' | 'loadingSpinner' | 'progressBar';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-ndl/react",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "React implementation of Neo4j Design System",
|
|
6
6
|
"keywords": [
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@tanstack/react-table": "8.20.5",
|
|
65
65
|
"react": ">=16.8.0",
|
|
66
66
|
"react-dom": ">=16.8.0",
|
|
67
|
-
"@neo4j-ndl/base": "^3.0
|
|
67
|
+
"@neo4j-ndl/base": "^3.1.0"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@dnd-kit/core": "6.1.0",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"react-stately": "3.33.0",
|
|
87
87
|
"react-syntax-highlighter": "15.5.0",
|
|
88
88
|
"react-use": "17.5.1",
|
|
89
|
-
"sonner": "1.
|
|
89
|
+
"sonner": "1.7.1",
|
|
90
90
|
"tinycolor2": "1.6.0",
|
|
91
91
|
"usehooks-ts": "3.1.0"
|
|
92
92
|
},
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"format": "prettier --write 'src/**/*.{js,jsx,ts,tsx}'",
|
|
106
106
|
"lint": "eslint src",
|
|
107
107
|
"generate:all": "pnpm generate:custom-icons && pnpm generate:hero-icons",
|
|
108
|
-
"generate:custom-icons": "svgr --template svgr-template.js --index-template svgr-index-template.js --icon --typescript --no-svgo --replace-attr-values '#535B66=currentColor' --svg-props className=ndl-icon-svg --jsx-runtime 'automatic' --out-dir ./src/icons/generated/custom -- ../base/src/icons",
|
|
108
|
+
"generate:custom-icons": "svgr --template svgr-template.js --index-template svgr-index-template.js --icon --typescript --no-svgo --replace-attr-values '#535B66=currentColor' --replace-attr-values '#4D5157=currentColor' --svg-props className=ndl-icon-svg --jsx-runtime 'automatic' --out-dir ./src/icons/generated/custom -- ../base/src/icons",
|
|
109
109
|
"generate:hero-icons": "ts-node ./scripts/generatedHeroIcons.ts",
|
|
110
110
|
"nuke:local": "../../scripts/cc.sh '{yellow ☢️} Nuking react! {yellow ☢️}' && pnpm dlx rimraf@5.0.5 .tsbuildinfo node_modules lib playwright-report test-results playwright/.cache",
|
|
111
111
|
"test:all-package-scripts": "pnpm run build && pnpm run generate-component test-component && pnpm run pretest && pnpm run prepare && pnpm run format && pnpm run lint && pnpm run generate:custom-icons && pnpm run nuke:local"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sonner-types.js","sourceRoot":"","sources":["../../../src/toast/sonner-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,kFAAkF;AAClF,kDAAkD;AAClD,4CAA4C;AAC5C,kDAAkD;AAClD,oBAAoB;;;AA4FpB,4BAKC;AALD,SAAgB,QAAQ,CAAC,MAAgC;IACvD,OAAO,CACJ,MAAiB,CAAC,KAAK,KAAK,SAAS;QACtC,OAAQ,MAAiB,CAAC,OAAO,KAAK,UAAU,CACjD,CAAC;AACJ,CAAC;AA0FD,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,0CAAuB,CAAA;IACvB,4CAAyB,CAAA;IACzB,0CAAuB,CAAA;AACzB,CAAC,EAJW,eAAe,+BAAf,eAAe,QAI1B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sonner-types.js","sourceRoot":"","sources":["../../../src/toast/sonner-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,kFAAkF;AAClF,kDAAkD;AAClD,4CAA4C;AAC5C,kDAAkD;AAClD,oBAAoB;AA4FpB,MAAM,UAAU,QAAQ,CAAC,MAAgC;IACvD,OAAO,CACJ,MAAiB,CAAC,KAAK,KAAK,SAAS;QACtC,OAAQ,MAAiB,CAAC,OAAO,KAAK,UAAU,CACjD,CAAC;AACJ,CAAC;AA0FD,MAAM,CAAN,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,0CAAuB,CAAA;IACvB,4CAAyB,CAAA;IACzB,0CAAuB,CAAA;AACzB,CAAC,EAJW,eAAe,KAAf,eAAe,QAI1B"}
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* Copyright (c) "Neo4j"
|
|
4
|
-
* Neo4j Sweden AB [http://neo4j.com]
|
|
5
|
-
*
|
|
6
|
-
* This file is part of Neo4j.
|
|
7
|
-
*
|
|
8
|
-
* Neo4j is free software: you can redistribute it and/or modify
|
|
9
|
-
* it under the terms of the GNU General Public License as published by
|
|
10
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
-
* (at your option) any later version.
|
|
12
|
-
*
|
|
13
|
-
* This program is distributed in the hope that it will be useful,
|
|
14
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
* GNU General Public License for more details.
|
|
17
|
-
*
|
|
18
|
-
* You should have received a copy of the GNU General Public License
|
|
19
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
*/
|
|
21
|
-
import type React from 'react';
|
|
22
|
-
export type ToastTypes = 'normal' | 'action' | 'success' | 'info' | 'warning' | 'error' | 'loading' | 'default';
|
|
23
|
-
export type PromiseT<Data = any> = Promise<Data> | (() => Promise<Data>);
|
|
24
|
-
export type PromiseExternalToast = Omit<ExternalToast, 'description'>;
|
|
25
|
-
export type PromiseData<ToastData = any> = PromiseExternalToast & {
|
|
26
|
-
loading?: string | React.ReactNode;
|
|
27
|
-
success?: string | React.ReactNode | ((data: ToastData) => React.ReactNode | string);
|
|
28
|
-
error?: string | React.ReactNode | ((error: any) => React.ReactNode | string);
|
|
29
|
-
description?: string | React.ReactNode | ((data: any) => React.ReactNode | string);
|
|
30
|
-
finally?: () => void | Promise<void>;
|
|
31
|
-
};
|
|
32
|
-
export interface ToastClassnames {
|
|
33
|
-
toast?: string;
|
|
34
|
-
title?: string;
|
|
35
|
-
description?: string;
|
|
36
|
-
loader?: string;
|
|
37
|
-
closeButton?: string;
|
|
38
|
-
cancelButton?: string;
|
|
39
|
-
actionButton?: string;
|
|
40
|
-
success?: string;
|
|
41
|
-
error?: string;
|
|
42
|
-
info?: string;
|
|
43
|
-
warning?: string;
|
|
44
|
-
loading?: string;
|
|
45
|
-
default?: string;
|
|
46
|
-
content?: string;
|
|
47
|
-
icon?: string;
|
|
48
|
-
}
|
|
49
|
-
export interface ToastIcons {
|
|
50
|
-
success?: React.ReactNode;
|
|
51
|
-
info?: React.ReactNode;
|
|
52
|
-
warning?: React.ReactNode;
|
|
53
|
-
error?: React.ReactNode;
|
|
54
|
-
loading?: React.ReactNode;
|
|
55
|
-
}
|
|
56
|
-
interface Action {
|
|
57
|
-
label: string;
|
|
58
|
-
onClick: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
59
|
-
actionButtonStyle?: React.CSSProperties;
|
|
60
|
-
}
|
|
61
|
-
export interface ToastT {
|
|
62
|
-
id: number | string;
|
|
63
|
-
title?: string | React.ReactNode;
|
|
64
|
-
type?: ToastTypes;
|
|
65
|
-
icon?: React.ReactNode;
|
|
66
|
-
jsx?: React.ReactNode;
|
|
67
|
-
invert?: boolean;
|
|
68
|
-
closeButton?: boolean;
|
|
69
|
-
dismissible?: boolean;
|
|
70
|
-
description?: React.ReactNode;
|
|
71
|
-
duration?: number;
|
|
72
|
-
delete?: boolean;
|
|
73
|
-
important?: boolean;
|
|
74
|
-
action?: Action | React.ReactNode;
|
|
75
|
-
cancel?: Action | React.ReactNode;
|
|
76
|
-
onDismiss?: (toast: ToastT) => void;
|
|
77
|
-
onAutoClose?: (toast: ToastT) => void;
|
|
78
|
-
promise?: PromiseT;
|
|
79
|
-
cancelButtonStyle?: React.CSSProperties;
|
|
80
|
-
actionButtonStyle?: React.CSSProperties;
|
|
81
|
-
style?: React.CSSProperties;
|
|
82
|
-
unstyled?: boolean;
|
|
83
|
-
className?: string;
|
|
84
|
-
classNames?: ToastClassnames;
|
|
85
|
-
descriptionClassName?: string;
|
|
86
|
-
position?: Position;
|
|
87
|
-
}
|
|
88
|
-
export declare function isAction(action: Action | React.ReactNode): action is Action;
|
|
89
|
-
export type Position = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top-center' | 'bottom-center';
|
|
90
|
-
export interface HeightT {
|
|
91
|
-
height: number;
|
|
92
|
-
toastId: number | string;
|
|
93
|
-
position: Position;
|
|
94
|
-
}
|
|
95
|
-
interface ToastOptions {
|
|
96
|
-
className?: string;
|
|
97
|
-
closeButton?: boolean;
|
|
98
|
-
descriptionClassName?: string;
|
|
99
|
-
style?: React.CSSProperties;
|
|
100
|
-
cancelButtonStyle?: React.CSSProperties;
|
|
101
|
-
actionButtonStyle?: React.CSSProperties;
|
|
102
|
-
duration?: number;
|
|
103
|
-
unstyled?: boolean;
|
|
104
|
-
classNames?: ToastClassnames;
|
|
105
|
-
}
|
|
106
|
-
type CnFunction = (...classes: Array<string | undefined>) => string;
|
|
107
|
-
export interface ToasterProps {
|
|
108
|
-
invert?: boolean;
|
|
109
|
-
theme?: 'light' | 'dark' | 'system';
|
|
110
|
-
position?: Position;
|
|
111
|
-
hotkey?: string[];
|
|
112
|
-
richColors?: boolean;
|
|
113
|
-
expand?: boolean;
|
|
114
|
-
duration?: number;
|
|
115
|
-
gap?: number;
|
|
116
|
-
visibleToasts?: number;
|
|
117
|
-
closeButton?: boolean;
|
|
118
|
-
toastOptions?: ToastOptions;
|
|
119
|
-
className?: string;
|
|
120
|
-
style?: React.CSSProperties;
|
|
121
|
-
offset?: string | number;
|
|
122
|
-
dir?: 'rtl' | 'ltr' | 'auto';
|
|
123
|
-
/**
|
|
124
|
-
* @deprecated Please use the `icons` prop instead:
|
|
125
|
-
* ```jsx
|
|
126
|
-
* <Toaster
|
|
127
|
-
* icons={{ loading: <LoadingIcon /> }}
|
|
128
|
-
* />
|
|
129
|
-
* ```
|
|
130
|
-
*/
|
|
131
|
-
loadingIcon?: React.ReactNode;
|
|
132
|
-
icons?: ToastIcons;
|
|
133
|
-
containerAriaLabel?: string;
|
|
134
|
-
pauseWhenPageIsHidden?: boolean;
|
|
135
|
-
cn?: CnFunction;
|
|
136
|
-
}
|
|
137
|
-
export interface ToastProps {
|
|
138
|
-
toast: ToastT;
|
|
139
|
-
toasts: ToastT[];
|
|
140
|
-
index: number;
|
|
141
|
-
expanded: boolean;
|
|
142
|
-
invert: boolean;
|
|
143
|
-
heights: HeightT[];
|
|
144
|
-
setHeights: React.Dispatch<React.SetStateAction<HeightT[]>>;
|
|
145
|
-
removeToast: (toast: ToastT) => void;
|
|
146
|
-
gap?: number;
|
|
147
|
-
position: Position;
|
|
148
|
-
visibleToasts: number;
|
|
149
|
-
expandByDefault: boolean;
|
|
150
|
-
closeButton: boolean;
|
|
151
|
-
interacting: boolean;
|
|
152
|
-
style?: React.CSSProperties;
|
|
153
|
-
cancelButtonStyle?: React.CSSProperties;
|
|
154
|
-
actionButtonStyle?: React.CSSProperties;
|
|
155
|
-
duration?: number;
|
|
156
|
-
className?: string;
|
|
157
|
-
unstyled?: boolean;
|
|
158
|
-
descriptionClassName?: string;
|
|
159
|
-
loadingIcon?: React.ReactNode;
|
|
160
|
-
classNames?: ToastClassnames;
|
|
161
|
-
icons?: ToastIcons;
|
|
162
|
-
closeButtonAriaLabel?: string;
|
|
163
|
-
pauseWhenPageIsHidden: boolean;
|
|
164
|
-
cn: CnFunction;
|
|
165
|
-
}
|
|
166
|
-
export declare enum SwipeStateTypes {
|
|
167
|
-
SwipedOut = "SwipedOut",
|
|
168
|
-
SwipedBack = "SwipedBack",
|
|
169
|
-
NotSwiped = "NotSwiped"
|
|
170
|
-
}
|
|
171
|
-
export type Theme = 'light' | 'dark';
|
|
172
|
-
export interface ToastToDismiss {
|
|
173
|
-
id: number | string;
|
|
174
|
-
dismiss: boolean;
|
|
175
|
-
}
|
|
176
|
-
export type ExternalToast = Omit<ToastT, 'id' | 'type' | 'title' | 'jsx' | 'delete' | 'promise'> & {
|
|
177
|
-
id?: number | string;
|
|
178
|
-
};
|
|
179
|
-
export {};
|