@hazelcast/ui 4.0.8 → 4.0.10
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/components/AppSidebar/AppSidebar.d.ts +10 -1
- package/lib/components/AppSidebar/AppSidebar.js +32 -13
- package/lib/components/AppSidebar/AppSidebar.js.map +1 -1
- package/lib/components/AppSidebar/AppSidebar.module.css +49 -0
- package/lib/components/AppSidebar/AppSidebarFavoriteButton/AppSidebarFavoriteButton.js +2 -2
- package/lib/components/AppSidebar/AppSidebarFavoriteButton/AppSidebarFavoriteButton.js.map +1 -1
- package/lib/components/AppSidebar/AppSidebarItem/AppSidebarItem.d.ts +3 -1
- package/lib/components/AppSidebar/AppSidebarItem/AppSidebarItem.js +7 -6
- package/lib/components/AppSidebar/AppSidebarItem/AppSidebarItem.js.map +1 -1
- package/lib/components/AppSidebar/AppSidebarItem/AppSidebarItem.module.css +54 -0
- package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSection.js +2 -2
- package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSection.js.map +1 -1
- package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSection.module.css +15 -0
- package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSectionExpandable.js +6 -6
- package/lib/components/AppSidebar/AppSidebarSection/AppSidebarSectionExpandable.js.map +1 -1
- package/lib/components/AppSidebar/appSidebarContext.d.ts +4 -0
- package/lib/components/AppSidebar/appSidebarContext.js +7 -0
- package/lib/components/AppSidebar/appSidebarContext.js.map +1 -1
- package/lib/components/Button.js +1 -1
- package/lib/components/Button.js.map +1 -1
- package/lib/components/IconButton.js +1 -1
- package/lib/components/IconButton.js.map +1 -1
- package/lib/components/Select/SelectField.module.css +1 -1
- package/lib/components/SideNavigation/SideNavigation.d.ts +49 -0
- package/lib/components/SideNavigation/SideNavigation.js +68 -0
- package/lib/components/SideNavigation/SideNavigation.js.map +1 -0
- package/lib/components/SideNavigation/SideNavigation.module.css +174 -0
- package/lib/components/SideNavigation/index.d.ts +1 -0
- package/lib/components/SideNavigation/index.js +2 -0
- package/lib/components/SideNavigation/index.js.map +1 -0
- package/lib/components/Slider.js +2 -2
- package/lib/components/Slider.js.map +1 -1
- package/lib/components/Table/tableTypes.d.ts +1 -1
- package/lib/components/Toast/Toast.d.ts +2 -0
- package/lib/components/Toast/Toast.js +4 -4
- package/lib/components/Toast/Toast.js.map +1 -1
- package/lib/components/Tooltip.d.ts +5 -2
- package/lib/components/Tooltip.js +14 -3
- package/lib/components/Tooltip.js.map +1 -1
- package/lib/components/Tooltip.module.css +4 -0
- package/lib/components/TopNavigation/TopNavigation.d.ts +22 -0
- package/lib/components/TopNavigation/TopNavigation.js +16 -0
- package/lib/components/TopNavigation/TopNavigation.js.map +1 -0
- package/lib/components/TopNavigation/TopNavigation.module.css +89 -0
- package/lib/components/TopNavigation/index.d.ts +1 -0
- package/lib/components/TopNavigation/index.js +2 -0
- package/lib/components/TopNavigation/index.js.map +1 -0
- package/lib/hooks/usePersistedState.d.ts +3 -1
- package/lib/hooks/usePersistedState.js +48 -11
- package/lib/hooks/usePersistedState.js.map +1 -1
- package/lib/index.d.ts +11 -0
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -1
- package/lib/services/ToastContainer.module.css +15 -0
- package/lib/services/toast.d.ts +34 -0
- package/lib/services/toast.js +72 -0
- package/lib/services/toast.js.map +1 -0
- package/package.json +44 -34
- package/styles/variables.css +1 -0
|
@@ -1,35 +1,72 @@
|
|
|
1
|
-
import { useCallback, useState } from 'react';
|
|
2
|
-
const
|
|
1
|
+
import { useCallback, useEffect, useRef, useState, useSyncExternalStore } from 'react';
|
|
2
|
+
const subscribe = () => () => undefined;
|
|
3
|
+
const getClientSnapshot = () => true;
|
|
4
|
+
const getServerSnapshot = () => false;
|
|
5
|
+
const readValue = (key, preserveFalsyValues) => {
|
|
3
6
|
try {
|
|
4
|
-
|
|
7
|
+
const storedValue = window.localStorage.getItem(key);
|
|
8
|
+
if (storedValue === null)
|
|
9
|
+
return undefined;
|
|
10
|
+
const value = JSON.parse(storedValue);
|
|
11
|
+
return preserveFalsyValues || value ? value : undefined;
|
|
5
12
|
}
|
|
6
13
|
catch (e) {
|
|
7
14
|
return undefined;
|
|
8
15
|
}
|
|
9
16
|
};
|
|
10
|
-
export const createPersistedState = (key) => {
|
|
17
|
+
export const createPersistedState = (key, options) => {
|
|
11
18
|
return (initialState) => {
|
|
12
|
-
|
|
19
|
+
var _a;
|
|
20
|
+
const preserveFalsyValues = (_a = options === null || options === void 0 ? void 0 : options.preserveFalsyValues) !== null && _a !== void 0 ? _a : false;
|
|
21
|
+
const stateKey = key;
|
|
22
|
+
const isClientRender = useSyncExternalStore(subscribe, getClientSnapshot, getServerSnapshot);
|
|
23
|
+
const updated = useRef(false);
|
|
24
|
+
const hydrating = useRef(!isClientRender);
|
|
25
|
+
const initialStateRef = useRef(initialState);
|
|
26
|
+
initialStateRef.current = initialState;
|
|
27
|
+
const [state, setState] = useState(() => {
|
|
28
|
+
if (!isClientRender)
|
|
29
|
+
return { key: stateKey, value: initialState };
|
|
30
|
+
const storedValue = readValue(stateKey, preserveFalsyValues);
|
|
31
|
+
return { key: stateKey, value: storedValue === undefined ? initialState : storedValue };
|
|
32
|
+
});
|
|
33
|
+
if (state.key !== stateKey) {
|
|
34
|
+
const storedValue = isClientRender ? readValue(stateKey, preserveFalsyValues) : undefined;
|
|
35
|
+
updated.current = false;
|
|
36
|
+
hydrating.current = !isClientRender;
|
|
37
|
+
setState({ key: stateKey, value: storedValue === undefined ? initialState : storedValue });
|
|
38
|
+
}
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (!isClientRender && !updated.current) {
|
|
41
|
+
const storedValue = readValue(stateKey, preserveFalsyValues);
|
|
42
|
+
if (storedValue !== undefined)
|
|
43
|
+
setState({ key: stateKey, value: storedValue });
|
|
44
|
+
}
|
|
45
|
+
hydrating.current = false;
|
|
46
|
+
}, [isClientRender, stateKey, preserveFalsyValues]);
|
|
13
47
|
const updateValue = useCallback((value) => {
|
|
14
|
-
|
|
48
|
+
const storedValue = hydrating.current && !updated.current ? readValue(stateKey, preserveFalsyValues) : undefined;
|
|
49
|
+
updated.current = true;
|
|
50
|
+
setState((currentState) => {
|
|
51
|
+
const currentValue = currentState.key === stateKey ? currentState.value : initialStateRef.current;
|
|
15
52
|
let newValue;
|
|
16
53
|
if (typeof value === 'function') {
|
|
17
|
-
newValue = value(currentValue);
|
|
54
|
+
newValue = value(storedValue === undefined ? currentValue : storedValue);
|
|
18
55
|
}
|
|
19
56
|
else {
|
|
20
57
|
newValue = value;
|
|
21
58
|
}
|
|
22
59
|
try {
|
|
23
60
|
const storageValue = JSON.stringify(newValue);
|
|
24
|
-
window.localStorage.setItem(
|
|
61
|
+
window.localStorage.setItem(stateKey, storageValue);
|
|
25
62
|
}
|
|
26
63
|
catch (e) {
|
|
27
64
|
console.error(e);
|
|
28
65
|
}
|
|
29
|
-
return newValue;
|
|
66
|
+
return { key: stateKey, value: newValue };
|
|
30
67
|
});
|
|
31
|
-
}, []);
|
|
32
|
-
return [value, updateValue];
|
|
68
|
+
}, [stateKey, preserveFalsyValues]);
|
|
69
|
+
return [state.value, updateValue];
|
|
33
70
|
};
|
|
34
71
|
};
|
|
35
72
|
//# sourceMappingURL=usePersistedState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePersistedState.js","sourceRoot":"","sources":["../../src/hooks/usePersistedState.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"usePersistedState.js","sourceRoot":"","sources":["../../src/hooks/usePersistedState.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAA;AAEhH,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,SAA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ge } from './components/Badge';
|
|
3
3
|
export { Button } from './components/Button';
|
|
4
|
+
export type { ButtonProps, ButtonVariant, ButtonColor, ButtonOutlineType, ButtonDisabledProps, ButtonTypeAnchorProps, ButtonTypeButtonProps, ButtonTypeProps, } from './components/Button';
|
|
4
5
|
export { Calendar } from './components/Calendar/Calendar';
|
|
5
6
|
export { CalendarRange } from './components/Calendar/CalendarRange';
|
|
6
7
|
export { Card } from './components/Card';
|
|
@@ -15,6 +16,7 @@ export { Error, errorId } from './components/Error';
|
|
|
15
16
|
export { Help, helpTooltipId } from './components/Help';
|
|
16
17
|
export { Icon } from './components/Icon';
|
|
17
18
|
export { IconButton } from './components/IconButton';
|
|
19
|
+
export type { IconButtonProps, IconButtonDisabledProps, IconButtonNotDisabledProps } from './components/IconButton';
|
|
18
20
|
export { InteractiveListItem } from './components/InteractiveList';
|
|
19
21
|
export { InteractiveListFormik } from './components/InteractiveListFormik';
|
|
20
22
|
export { Label } from './components/Label';
|
|
@@ -37,6 +39,10 @@ export { SegmentedControl } from './components/SegmentedControl';
|
|
|
37
39
|
export { SegmentedControlFormik } from './components/SegmentedControlFormik';
|
|
38
40
|
export { getMenuContainer, getOptionsMap, SelectField, MultiSelectField, SelectFieldFormik, MultiSelectFieldFormik, CheckableSelectField, CheckableSelectFieldFormik, } from './components/Select/index';
|
|
39
41
|
export { SimpleTable } from './components/SimpleTable';
|
|
42
|
+
export { SideNavigation, SideNavigationItem, SideNavigationSection } from './components/SideNavigation';
|
|
43
|
+
export type { SideNavigationProps, SideNavigationItemProps, SideNavigationLinkProps, SideNavigationSectionProps, } from './components/SideNavigation';
|
|
44
|
+
export { AppSidebar, AppSidebarItem, AppSidebarSection, AppSidebarFavorites, AppSidebarMenuItemCounter } from './components/AppSidebar';
|
|
45
|
+
export type { AppSidebarProps, AppSidebarItemProps, AppSidebarSectionProps } from './components/AppSidebar';
|
|
40
46
|
export { Slider } from './components/Slider';
|
|
41
47
|
export { SliderFormik } from './components/SliderFormik';
|
|
42
48
|
export { Table } from './components/Table/Table';
|
|
@@ -48,9 +54,14 @@ export { TextField } from './components/TextField';
|
|
|
48
54
|
export { TextFieldFormik } from './components/TextFieldFormik';
|
|
49
55
|
export { Toast, ToastProvider, ToastViewport } from './components/Toast';
|
|
50
56
|
export type { ToastProps, ToastVariant } from './components/Toast';
|
|
57
|
+
export { TopNavigation } from './components/TopNavigation';
|
|
58
|
+
export type { TopNavigationProps } from './components/TopNavigation';
|
|
59
|
+
export { toast, ToastContainer } from './services/toast';
|
|
60
|
+
export type { ToastContent, ToastOptions, ToastService } from './services/toast';
|
|
51
61
|
export { Toggle } from './components/Toggle';
|
|
52
62
|
export { ToggleFormik } from './components/ToggleFormik';
|
|
53
63
|
export { Tooltip } from './components/Tooltip';
|
|
64
|
+
export type { TooltipProps, TooltipSide, TooltipAlign } from './components/Tooltip';
|
|
54
65
|
export { TruncatedText } from './components/TruncatedText';
|
|
55
66
|
export { ThemeSwitcher } from './components/ThemeSwitcher';
|
|
56
67
|
export type { ThemeSwitcherProps } from './components/ThemeSwitcher';
|
package/lib/index.js
CHANGED
|
@@ -37,6 +37,8 @@ export { SegmentedControl } from './components/SegmentedControl';
|
|
|
37
37
|
export { SegmentedControlFormik } from './components/SegmentedControlFormik';
|
|
38
38
|
export { getMenuContainer, getOptionsMap, SelectField, MultiSelectField, SelectFieldFormik, MultiSelectFieldFormik, CheckableSelectField, CheckableSelectFieldFormik, } from './components/Select/index';
|
|
39
39
|
export { SimpleTable } from './components/SimpleTable';
|
|
40
|
+
export { SideNavigation, SideNavigationItem, SideNavigationSection } from './components/SideNavigation';
|
|
41
|
+
export { AppSidebar, AppSidebarItem, AppSidebarSection, AppSidebarFavorites, AppSidebarMenuItemCounter } from './components/AppSidebar';
|
|
40
42
|
export { Slider } from './components/Slider';
|
|
41
43
|
export { SliderFormik } from './components/SliderFormik';
|
|
42
44
|
export { Table } from './components/Table/Table';
|
|
@@ -47,6 +49,8 @@ export { TextAreaFormik } from './components/TextAreaFormik';
|
|
|
47
49
|
export { TextField } from './components/TextField';
|
|
48
50
|
export { TextFieldFormik } from './components/TextFieldFormik';
|
|
49
51
|
export { Toast, ToastProvider, ToastViewport } from './components/Toast';
|
|
52
|
+
export { TopNavigation } from './components/TopNavigation';
|
|
53
|
+
export { toast, ToastContainer } from './services/toast';
|
|
50
54
|
export { Toggle } from './components/Toggle';
|
|
51
55
|
export { ToggleFormik } from './components/ToggleFormik';
|
|
52
56
|
export { Tooltip } from './components/Tooltip';
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAW5C,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,MAAM,EAAE,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AAwB,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.viewport {
|
|
2
|
+
position: fixed;
|
|
3
|
+
right: calc(var(--hive-grid) * 4);
|
|
4
|
+
bottom: calc(var(--hive-grid) * 4);
|
|
5
|
+
z-index: var(--hive-z-index-2000);
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column-reverse;
|
|
8
|
+
gap: calc(var(--hive-grid) * 2);
|
|
9
|
+
width: 360px;
|
|
10
|
+
max-width: calc(100vw - var(--hive-grid) * 8);
|
|
11
|
+
margin: 0;
|
|
12
|
+
padding: 0;
|
|
13
|
+
list-style: none;
|
|
14
|
+
outline: none;
|
|
15
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { ToastVariant } from '../components/Toast';
|
|
3
|
+
export type ToastContent = ReactNode | ((props: {
|
|
4
|
+
closeToast: () => void;
|
|
5
|
+
}) => ReactNode);
|
|
6
|
+
export type ToastOptions = {
|
|
7
|
+
toastId?: string | number;
|
|
8
|
+
autoClose?: number | false;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
closeButton?: boolean;
|
|
11
|
+
closeOnClick?: boolean;
|
|
12
|
+
variant?: ToastVariant;
|
|
13
|
+
};
|
|
14
|
+
type ToastMethod = (content: ToastContent, options?: ToastOptions) => string;
|
|
15
|
+
export type ToastService = ToastMethod & {
|
|
16
|
+
info: ToastMethod;
|
|
17
|
+
success: ToastMethod;
|
|
18
|
+
warn: ToastMethod;
|
|
19
|
+
error: ToastMethod;
|
|
20
|
+
custom: ToastMethod;
|
|
21
|
+
dismiss: (id?: string | number) => void;
|
|
22
|
+
isActive: (id: string | number) => boolean;
|
|
23
|
+
};
|
|
24
|
+
export declare const toast: ToastMethod & {
|
|
25
|
+
info: (content: ToastContent, options?: ToastOptions) => string;
|
|
26
|
+
success: (content: ToastContent, options?: ToastOptions) => string;
|
|
27
|
+
warn: (content: ToastContent, options?: ToastOptions) => string;
|
|
28
|
+
error: (content: ToastContent, options?: ToastOptions) => string;
|
|
29
|
+
custom: (content: ToastContent, options?: ToastOptions) => string;
|
|
30
|
+
dismiss: (id?: string | number) => void;
|
|
31
|
+
isActive: (id: string | number) => boolean;
|
|
32
|
+
};
|
|
33
|
+
export declare const ToastContainer: FC;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React, { useSyncExternalStore } from 'react';
|
|
2
|
+
import { Toast, ToastProvider, ToastViewport } from '../components/Toast';
|
|
3
|
+
import styles from './ToastContainer.module.css';
|
|
4
|
+
let toastEntries = [];
|
|
5
|
+
let toastCounter = 0;
|
|
6
|
+
const subscribers = new Set();
|
|
7
|
+
const emptyEntries = [];
|
|
8
|
+
const subscribe = (subscriber) => {
|
|
9
|
+
subscribers.add(subscriber);
|
|
10
|
+
return () => subscribers.delete(subscriber);
|
|
11
|
+
};
|
|
12
|
+
const notifySubscribers = () => subscribers.forEach((subscriber) => subscriber());
|
|
13
|
+
const getSnapshot = () => toastEntries;
|
|
14
|
+
const getServerSnapshot = () => emptyEntries;
|
|
15
|
+
const closeToast = (id) => {
|
|
16
|
+
var _a;
|
|
17
|
+
const entry = toastEntries.find((toastEntry) => toastEntry.id === id);
|
|
18
|
+
if (!entry)
|
|
19
|
+
return;
|
|
20
|
+
toastEntries = toastEntries.filter((toastEntry) => toastEntry.id !== id);
|
|
21
|
+
notifySubscribers();
|
|
22
|
+
(_a = entry.onClose) === null || _a === void 0 ? void 0 : _a.call(entry);
|
|
23
|
+
};
|
|
24
|
+
const enqueueToast = (content, variant, options = {}) => {
|
|
25
|
+
var _a, _b, _c, _d, _e;
|
|
26
|
+
const id = String((_a = options.toastId) !== null && _a !== void 0 ? _a : `hive-toast-${++toastCounter}`);
|
|
27
|
+
const close = () => closeToast(id);
|
|
28
|
+
const renderedContent = React.createElement("div", { "data-test": "toast-message" }, typeof content === 'function' ? content({ closeToast: close }) : content);
|
|
29
|
+
toastEntries = [
|
|
30
|
+
...toastEntries.filter((toastEntry) => toastEntry.id !== id),
|
|
31
|
+
{
|
|
32
|
+
id,
|
|
33
|
+
variant: (_b = options.variant) !== null && _b !== void 0 ? _b : variant,
|
|
34
|
+
content: renderedContent,
|
|
35
|
+
duration: options.autoClose === false ? Infinity : ((_c = options.autoClose) !== null && _c !== void 0 ? _c : 5000),
|
|
36
|
+
closeButton: (_d = options.closeButton) !== null && _d !== void 0 ? _d : true,
|
|
37
|
+
closeOnClick: (_e = options.closeOnClick) !== null && _e !== void 0 ? _e : false,
|
|
38
|
+
onClose: options.onClose,
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
notifySubscribers();
|
|
42
|
+
return id;
|
|
43
|
+
};
|
|
44
|
+
const toastBase = (content, options) => enqueueToast(content, 'info', options);
|
|
45
|
+
export const toast = Object.assign(toastBase, {
|
|
46
|
+
info: (content, options) => enqueueToast(content, 'info', options),
|
|
47
|
+
success: (content, options) => enqueueToast(content, 'success', options),
|
|
48
|
+
warn: (content, options) => enqueueToast(content, 'warn', options),
|
|
49
|
+
error: (content, options) => enqueueToast(content, 'error', options),
|
|
50
|
+
custom: (content, options) => { var _a; return enqueueToast(content, (_a = options === null || options === void 0 ? void 0 : options.variant) !== null && _a !== void 0 ? _a : 'info', options); },
|
|
51
|
+
dismiss: (id) => {
|
|
52
|
+
if (id !== undefined) {
|
|
53
|
+
closeToast(String(id));
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const entriesToClose = toastEntries;
|
|
57
|
+
toastEntries = [];
|
|
58
|
+
notifySubscribers();
|
|
59
|
+
entriesToClose.forEach((entry) => { var _a; return (_a = entry.onClose) === null || _a === void 0 ? void 0 : _a.call(entry); });
|
|
60
|
+
},
|
|
61
|
+
isActive: (id) => toastEntries.some((entry) => entry.id === String(id)),
|
|
62
|
+
});
|
|
63
|
+
export const ToastContainer = () => {
|
|
64
|
+
const entries = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
65
|
+
return (React.createElement(ToastProvider, { swipeDirection: "right" },
|
|
66
|
+
entries.map((entry) => (React.createElement(Toast, { key: entry.id, id: entry.id, variant: entry.variant, content: entry.content, duration: entry.duration, closeButton: entry.closeButton, closeOnClick: entry.closeOnClick, onOpenChange: (open) => {
|
|
67
|
+
if (!open)
|
|
68
|
+
closeToast(entry.id);
|
|
69
|
+
} }))),
|
|
70
|
+
React.createElement(ToastViewport, { className: styles.viewport, "aria-label": "Notifications" })));
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=toast.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.js","sourceRoot":"","sources":["../../src/services/toast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,oBAAoB,EAAE,MAAM,OAAO,CAAA;AAElE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,aAAa,EAAgB,MAAM,qBAAqB,CAAA;AACvF,OAAO,MAAM,MAAM,6BAA6B,CAAA;AAmChD,IAAI,YAAY,GAAiB,EAAE,CAAA;AACnC,IAAI,YAAY,GAAG,CAAC,CAAA;AACpB,MAAM,WAAW,GAAG,IAAI,GAAG,EAAc,CAAA;AACzC,MAAM,YAAY,GAAiB,EAAE,CAAA;AAErC,MAAM,SAAS,GAAG,CAAC,UAAsB,EAAE,EAAE;IAC3C,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;IAC3B,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;AAC7C,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,EAAE,CAAC,CAAA;AACjF,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,YAAY,CAAA;AACtC,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,YAAY,CAAA;AAE5C,MAA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|
3
|
+
"version": "4.0.10",
|
|
4
4
|
"description": "Hazelcast design system components and utilities",
|
|
5
5
|
"homepage": "https://github.com/hazelcast/hive#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
},
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "Hazelcast",
|
|
15
|
-
"sideEffects":
|
|
15
|
+
"sideEffects": [
|
|
16
|
+
"**/*.css"
|
|
17
|
+
],
|
|
16
18
|
"main": "lib/index.js",
|
|
17
19
|
"module": "lib/index.js",
|
|
18
20
|
"types": "lib/index.d.ts",
|
|
@@ -27,7 +29,7 @@
|
|
|
27
29
|
"scripts": {
|
|
28
30
|
"build-storybook": "storybook build",
|
|
29
31
|
"chromatic": "chromatic --project-token=CHROMATIC_PROJECT_TOKEN",
|
|
30
|
-
"compile": "shx rm -f *.tsbuildinfo && shx rm -rf lib && shx mkdir lib && shx cp -r src/* lib && shx rm -rf lib/*.{tsx,ts} && shx rm -rf lib/**/*.{tsx,ts} && tsc -p tsconfig.build.json",
|
|
32
|
+
"compile": "shx rm -f *.tsbuildinfo && shx rm -rf lib && shx mkdir lib && shx cp -r src/* lib && shx rm -rf lib/*.{tsx,ts} && shx rm -rf 'lib/**/*.{tsx,ts}' && tsc -p tsconfig.build.json",
|
|
31
33
|
"generate-screenshots": "npm run build-storybook && loki update --reactUri file:./storybook-static --chromeDockerImage 'yukinying/chrome-headless-browser-stable:110.0.5481.77' --chromeFlags='--headless --disable-gpu --hide-scrollbars --no-sandbox --allow-file-access-from-files'",
|
|
32
34
|
"lint": "npm run lint:ts",
|
|
33
35
|
"lint:fix": "npm run lint:ts:fix",
|
|
@@ -48,13 +50,13 @@
|
|
|
48
50
|
"@floating-ui/core": "^1.7.3",
|
|
49
51
|
"@floating-ui/react": "^0.26.28",
|
|
50
52
|
"@headlessui/react": "^2.2.0",
|
|
51
|
-
"@icons-pack/react-simple-icons": "^
|
|
53
|
+
"@icons-pack/react-simple-icons": "^13.13.0",
|
|
52
54
|
"@radix-ui/react-toast": "^1.2.17",
|
|
53
55
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
54
56
|
"@tanstack/react-table": "^8.21.2",
|
|
55
57
|
"@types/react-modal": "3.16.3",
|
|
56
58
|
"classnames": "^2.5.1",
|
|
57
|
-
"date-fns": "^
|
|
59
|
+
"date-fns": "^4.4.0",
|
|
58
60
|
"dequal": "^2.0.3",
|
|
59
61
|
"formik": "^2.4.6",
|
|
60
62
|
"nuka-carousel": "^7.0.0",
|
|
@@ -72,26 +74,20 @@
|
|
|
72
74
|
},
|
|
73
75
|
"devDependencies": {
|
|
74
76
|
"@babel/core": "^7.26.9",
|
|
75
|
-
"@babel/eslint-plugin": "^7.25.9",
|
|
76
77
|
"@babel/preset-env": "^7.26.9",
|
|
77
78
|
"@babel/preset-react": "^7.26.3",
|
|
78
79
|
"@babel/preset-typescript": "^7.26.0",
|
|
79
|
-
"@chromatic-com/storybook": "^
|
|
80
|
-
"@eslint/
|
|
81
|
-
"@
|
|
82
|
-
"@storybook/addon-
|
|
83
|
-
"@storybook/addon-
|
|
84
|
-
"@storybook/addon-onboarding": "^
|
|
85
|
-
"@storybook/addon-webpack5-compiler-swc": "^
|
|
86
|
-
"@storybook/
|
|
87
|
-
"@storybook/
|
|
88
|
-
"@storybook/react": "^8.6.3",
|
|
89
|
-
"@storybook/react-webpack5": "^8.6.3",
|
|
90
|
-
"@storybook/source-loader": "^7.6.20",
|
|
91
|
-
"@storybook/test": "^8.6.3",
|
|
92
|
-
"@storybook/theming": "8.5.8",
|
|
80
|
+
"@chromatic-com/storybook": "^5.6.0",
|
|
81
|
+
"@eslint/compat": "^2.1.1",
|
|
82
|
+
"@eslint/js": "^10.0.1",
|
|
83
|
+
"@storybook/addon-designs": "^12.0.0",
|
|
84
|
+
"@storybook/addon-docs": "^10.6.5",
|
|
85
|
+
"@storybook/addon-onboarding": "^10.6.5",
|
|
86
|
+
"@storybook/addon-webpack5-compiler-swc": "^4.0.3",
|
|
87
|
+
"@storybook/react": "^10.6.5",
|
|
88
|
+
"@storybook/react-webpack5": "^10.6.5",
|
|
93
89
|
"@testing-library/dom": "^10.4.0",
|
|
94
|
-
"@testing-library/jest-dom": "^
|
|
90
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
95
91
|
"@testing-library/react": "^16.2.0",
|
|
96
92
|
"@testing-library/user-event": "^14.6.1",
|
|
97
93
|
"@types/classnames": "^2.3.4",
|
|
@@ -101,30 +97,30 @@
|
|
|
101
97
|
"@types/react": "^19.1.12",
|
|
102
98
|
"@types/react-datepicker": "^4.19.6",
|
|
103
99
|
"@types/react-dom": "^19.1.9",
|
|
104
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
105
|
-
"@typescript-eslint/parser": "^8.
|
|
106
|
-
"babel-jest": "^
|
|
107
|
-
"chromatic": "^
|
|
100
|
+
"@typescript-eslint/eslint-plugin": "^8.72.1",
|
|
101
|
+
"@typescript-eslint/parser": "^8.72.1",
|
|
102
|
+
"babel-jest": "^30.5.2",
|
|
103
|
+
"chromatic": "^18.2.0",
|
|
108
104
|
"css-loader": "^7.1.2",
|
|
109
105
|
"doiuse": "^6.0.5",
|
|
110
|
-
"eslint": "^
|
|
106
|
+
"eslint": "^10.14.0",
|
|
111
107
|
"eslint-config-prettier": "^10.0.1",
|
|
112
108
|
"eslint-plugin-import": "^2.31.0",
|
|
113
109
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
114
110
|
"eslint-plugin-prettier": "^5.2.3",
|
|
115
111
|
"eslint-plugin-react": "^7.37.4",
|
|
116
|
-
"eslint-plugin-react-hooks": "^
|
|
112
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
117
113
|
"glob": "^11.0.3",
|
|
118
114
|
"husky": "^7.0.4",
|
|
119
115
|
"identity-obj-proxy": "^3.0.0",
|
|
120
116
|
"jest": "^29.7.0",
|
|
121
|
-
"jest-axe": "^
|
|
117
|
+
"jest-axe": "^11.0.0",
|
|
122
118
|
"jest-environment-jsdom": "^29.7.0",
|
|
123
|
-
"lint-staged": "^
|
|
119
|
+
"lint-staged": "^17.6.0",
|
|
124
120
|
"loki": "^0.35.1",
|
|
125
121
|
"patch-package": "^6.5.1",
|
|
126
122
|
"postcss": "^8.4.47",
|
|
127
|
-
"postcss-cli": "^
|
|
123
|
+
"postcss-cli": "^12.0.0",
|
|
128
124
|
"postcss-reporter": "^7.1.0",
|
|
129
125
|
"postcss-scss": "^4.0.9",
|
|
130
126
|
"prettier": "^3.5.1",
|
|
@@ -132,12 +128,12 @@
|
|
|
132
128
|
"react-dom": "^19.1.1",
|
|
133
129
|
"regenerator-runtime": "^0.14.1",
|
|
134
130
|
"sass": "^1.85.0",
|
|
135
|
-
"sass-loader": "^
|
|
136
|
-
"shx": "^0.
|
|
137
|
-
"storybook": "^
|
|
131
|
+
"sass-loader": "^17.1.0",
|
|
132
|
+
"shx": "^0.4.0",
|
|
133
|
+
"storybook": "^10.6.5",
|
|
138
134
|
"style-loader": "^4.0.0",
|
|
139
135
|
"typescript": "^5.7.3",
|
|
140
|
-
"typescript-eslint": "^8.
|
|
136
|
+
"typescript-eslint": "^8.72.1"
|
|
141
137
|
},
|
|
142
138
|
"peerDependencies": {
|
|
143
139
|
"@types/lodash": "^4.17.13",
|
|
@@ -147,6 +143,20 @@
|
|
|
147
143
|
"react": "^19",
|
|
148
144
|
"react-dom": "^19"
|
|
149
145
|
},
|
|
146
|
+
"overrides": {
|
|
147
|
+
"loki": {
|
|
148
|
+
"@storybook/react": "$@storybook/react"
|
|
149
|
+
},
|
|
150
|
+
"eslint-plugin-import": {
|
|
151
|
+
"eslint": "$eslint"
|
|
152
|
+
},
|
|
153
|
+
"eslint-plugin-jsx-a11y": {
|
|
154
|
+
"eslint": "$eslint"
|
|
155
|
+
},
|
|
156
|
+
"eslint-plugin-react": {
|
|
157
|
+
"eslint": "$eslint"
|
|
158
|
+
}
|
|
159
|
+
},
|
|
150
160
|
"publishConfig": {
|
|
151
161
|
"access": "public"
|
|
152
162
|
}
|
package/styles/variables.css
CHANGED