@ultraviolet/plus 0.15.4 → 0.16.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/dist/components/EstimateCost/EstimateCost.cjs +5 -4
- package/dist/components/EstimateCost/EstimateCost.d.ts +1 -1
- package/dist/components/EstimateCost/EstimateCost.js +5 -4
- package/dist/components/EstimateCost/EstimateCostContent.cjs +20 -13
- package/dist/components/EstimateCost/EstimateCostContent.d.ts +1 -1
- package/dist/components/EstimateCost/EstimateCostContent.js +20 -13
- package/dist/components/EstimateCost/types.d.ts +10 -0
- package/dist/components/Navigation/Navigation.cjs +2 -5
- package/dist/components/Navigation/Navigation.d.ts +7 -28
- package/dist/components/Navigation/Navigation.js +2 -5
- package/dist/components/Navigation/NavigationContent.cjs +17 -12
- package/dist/components/Navigation/NavigationContent.d.ts +2 -10
- package/dist/components/Navigation/NavigationContent.js +17 -12
- package/dist/components/Navigation/NavigationProvider.cjs +3 -3
- package/dist/components/Navigation/NavigationProvider.d.ts +4 -6
- package/dist/components/Navigation/NavigationProvider.js +3 -3
- package/dist/components/Navigation/components/Item.cjs +15 -15
- package/dist/components/Navigation/components/Item.d.ts +1 -1
- package/dist/components/Navigation/components/Item.js +15 -15
- package/dist/components/Navigation/components/PinnedItems.cjs +6 -6
- package/dist/components/Navigation/components/PinnedItems.js +6 -6
- package/dist/components/Navigation/constants.d.ts +0 -18
- package/dist/components/Navigation/index.d.ts +0 -1
- package/dist/components/Navigation/types.d.ts +39 -0
- package/dist/components/index.d.ts +0 -1
- package/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Dispatch, ReactNode, RefObject } from 'react';
|
|
2
|
-
import { type PinUnPinType } from './constants';
|
|
3
2
|
import NavigationLocales from './locales/en';
|
|
3
|
+
import type { PinUnPinType } from './types';
|
|
4
4
|
type Item = {
|
|
5
5
|
label: string;
|
|
6
6
|
active?: boolean;
|
|
@@ -66,11 +66,9 @@ type NavigationProviderProps = {
|
|
|
66
66
|
initialExpanded?: boolean;
|
|
67
67
|
locales?: typeof NavigationLocales;
|
|
68
68
|
/**
|
|
69
|
-
*
|
|
70
|
-
* of the navigation. This is not triggered when the user resize the navigation
|
|
71
|
-
* and it automatically collapse / expand.
|
|
69
|
+
* You can get the expanded state of the navigation with this function
|
|
72
70
|
*/
|
|
73
|
-
|
|
71
|
+
onExpandChange?: (expanded: boolean) => void;
|
|
74
72
|
};
|
|
75
|
-
export declare const NavigationProvider: ({ children, pinnedFeature, initialPinned, initialExpanded, locales, pinLimit,
|
|
73
|
+
export declare const NavigationProvider: ({ children, pinnedFeature, initialPinned, initialExpanded, locales, pinLimit, onExpandChange, initialWidth, }: NavigationProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
76
74
|
export {};
|
|
@@ -37,7 +37,7 @@ const NavigationProvider = ({
|
|
|
37
37
|
initialExpanded = true,
|
|
38
38
|
locales = NavigationLocales,
|
|
39
39
|
pinLimit = 7,
|
|
40
|
-
|
|
40
|
+
onExpandChange,
|
|
41
41
|
initialWidth = NAVIGATION_WIDTH
|
|
42
42
|
}) => {
|
|
43
43
|
const [expanded, setExpanded] = useState(initialExpanded);
|
|
@@ -56,7 +56,7 @@ const NavigationProvider = ({
|
|
|
56
56
|
if (toggle !== void 0 && toggle === expanded) {
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
onExpandChange?.(!expanded);
|
|
60
60
|
if (navigationRef.current) {
|
|
61
61
|
navigationRef.current.style.width = "";
|
|
62
62
|
}
|
|
@@ -65,7 +65,7 @@ const NavigationProvider = ({
|
|
|
65
65
|
setExpanded(toggle !== void 0 ? toggle : !expanded);
|
|
66
66
|
setAnimation(false);
|
|
67
67
|
}, ANIMATION_DURATION);
|
|
68
|
-
}, [expanded,
|
|
68
|
+
}, [expanded, onExpandChange, setAnimation, setExpanded]);
|
|
69
69
|
const pinItem = useCallback((item) => {
|
|
70
70
|
const newValue = [...pinnedItems, item];
|
|
71
71
|
setPinnedItems(newValue);
|