@ultraviolet/plus 0.15.2 → 0.15.3
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/CodeEditor/CodeEditor.cjs +39 -0
- package/dist/components/ContentCard/Skeleton.cjs +43 -0
- package/dist/components/ContentCard/index.cjs +154 -0
- package/dist/components/ContentCardGroup/Card.cjs +93 -0
- package/dist/components/ContentCardGroup/SkeletonCard.cjs +34 -0
- package/dist/components/ContentCardGroup/index.cjs +33 -0
- package/dist/components/Conversation/index.cjs +128 -0
- package/dist/components/CustomerSatisfaction/assets/1-5.svg.cjs +3 -0
- package/dist/components/CustomerSatisfaction/assets/1-5NB.svg.cjs +3 -0
- package/dist/components/CustomerSatisfaction/assets/2-5.svg.cjs +3 -0
- package/dist/components/CustomerSatisfaction/assets/2-5NB.svg.cjs +3 -0
- package/dist/components/CustomerSatisfaction/assets/3-5.svg.cjs +3 -0
- package/dist/components/CustomerSatisfaction/assets/3-5NB.svg.cjs +3 -0
- package/dist/components/CustomerSatisfaction/assets/4-5.svg.cjs +3 -0
- package/dist/components/CustomerSatisfaction/assets/4-5NB.svg.cjs +3 -0
- package/dist/components/CustomerSatisfaction/assets/5-5.svg.cjs +3 -0
- package/dist/components/CustomerSatisfaction/assets/5-5NB.svg.cjs +3 -0
- package/dist/components/CustomerSatisfaction/index.cjs +123 -0
- package/dist/components/EstimateCost/Components/CustomUnitInput.cjs +33 -0
- package/dist/components/EstimateCost/Components/Item.cjs +303 -0
- package/dist/components/EstimateCost/Components/LineThrough.cjs +18 -0
- package/dist/components/EstimateCost/Components/NumberInput.cjs +29 -0
- package/dist/components/EstimateCost/Components/Region.cjs +41 -0
- package/dist/components/EstimateCost/Components/Regular.cjs +35 -0
- package/dist/components/EstimateCost/Components/Strong.cjs +28 -0
- package/dist/components/EstimateCost/Components/Unit.cjs +50 -0
- package/dist/components/EstimateCost/Components/UnitInput.cjs +90 -0
- package/dist/components/EstimateCost/Components/Zone.cjs +40 -0
- package/dist/components/EstimateCost/EstimateCost.cjs +88 -0
- package/dist/components/EstimateCost/EstimateCostContent.cjs +245 -0
- package/dist/components/EstimateCost/EstimateCostProvider.cjs +36 -0
- package/dist/components/EstimateCost/OverlayComponent.cjs +122 -0
- package/dist/components/EstimateCost/OverlayContext.cjs +14 -0
- package/dist/components/EstimateCost/componentStyle.cjs +230 -0
- package/dist/components/EstimateCost/constants.cjs +30 -0
- package/dist/components/EstimateCost/helper.cjs +19 -0
- package/dist/components/EstimateCost/locales/en.cjs +23 -0
- package/dist/components/FAQ/index.cjs +36 -0
- package/dist/components/Navigation/Navigation.cjs +20 -0
- package/dist/components/Navigation/Navigation.d.ts +4 -3
- package/dist/components/Navigation/NavigationContent.cjs +216 -0
- package/dist/components/Navigation/NavigationProvider.cjs +111 -0
- package/dist/components/Navigation/NavigationProvider.d.ts +7 -18
- package/dist/components/Navigation/NavigationProvider.js +18 -16
- package/dist/components/Navigation/components/Group.cjs +57 -0
- package/dist/components/Navigation/components/Item.cjs +438 -0
- package/dist/components/Navigation/components/Item.d.ts +4 -3
- package/dist/components/Navigation/components/Item.js +34 -23
- package/dist/components/Navigation/components/PinnedItems.cjs +108 -0
- package/dist/components/Navigation/components/PinnedItems.d.ts +5 -1
- package/dist/components/Navigation/components/PinnedItems.js +11 -8
- package/dist/components/Navigation/components/Separator.cjs +17 -0
- package/dist/components/Navigation/constants.cjs +37 -0
- package/dist/components/Navigation/constants.d.ts +14 -0
- package/dist/components/Navigation/index.d.ts +1 -0
- package/dist/components/Navigation/locales/en.cjs +11 -0
- package/dist/components/SteppedListCard/Step.cjs +37 -0
- package/dist/components/SteppedListCard/SteppedListContainer.cjs +80 -0
- package/dist/components/SteppedListCard/SteppedListContent.cjs +67 -0
- package/dist/components/SteppedListCard/helper.cjs +37 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.cjs +25 -0
- package/package.json +23 -7
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
4
|
+
const react = require("react");
|
|
5
|
+
const constants = require("./constants.cjs");
|
|
6
|
+
const en = require("./locales/en.cjs");
|
|
7
|
+
const NavigationContext = react.createContext({
|
|
8
|
+
expanded: true,
|
|
9
|
+
/**
|
|
10
|
+
* This function will trigger the expand/collapse of the navigation and
|
|
11
|
+
* will also trigger the animation
|
|
12
|
+
*/
|
|
13
|
+
toggleExpand: () => {
|
|
14
|
+
},
|
|
15
|
+
animation: false,
|
|
16
|
+
locales: en,
|
|
17
|
+
pinItem: () => [],
|
|
18
|
+
unpinItem: () => [],
|
|
19
|
+
pinnedItems: [],
|
|
20
|
+
pinLimit: 7,
|
|
21
|
+
navigationRef: {
|
|
22
|
+
current: null
|
|
23
|
+
},
|
|
24
|
+
width: constants.NAVIGATION_WIDTH,
|
|
25
|
+
setWidth: () => {
|
|
26
|
+
},
|
|
27
|
+
reorderItems: () => [],
|
|
28
|
+
items: {},
|
|
29
|
+
registerItem: () => {
|
|
30
|
+
},
|
|
31
|
+
setPinnedItems: () => {
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const useNavigation = () => react.useContext(NavigationContext);
|
|
35
|
+
const NavigationProvider = ({
|
|
36
|
+
children,
|
|
37
|
+
pinnedFeature = false,
|
|
38
|
+
initialPinned,
|
|
39
|
+
initialExpanded = true,
|
|
40
|
+
locales = en,
|
|
41
|
+
pinLimit = 7,
|
|
42
|
+
onClickExpand,
|
|
43
|
+
initialWidth = constants.NAVIGATION_WIDTH
|
|
44
|
+
}) => {
|
|
45
|
+
const [expanded, setExpanded] = react.useState(initialExpanded);
|
|
46
|
+
const [pinnedItems, setPinnedItems] = react.useState(initialPinned ?? []);
|
|
47
|
+
const [animation, setAnimation] = react.useState(false);
|
|
48
|
+
const [width, setWidth] = react.useState(initialWidth);
|
|
49
|
+
const [items, registerItem] = react.useReducer((oldState, newState) => ({
|
|
50
|
+
...oldState,
|
|
51
|
+
...newState
|
|
52
|
+
}), {});
|
|
53
|
+
const navigationRef = react.useRef(null);
|
|
54
|
+
const toggleExpand = react.useCallback((toggle) => {
|
|
55
|
+
if (typeof toggle !== "boolean" && toggle !== void 0) {
|
|
56
|
+
throw new Error(`toggleExpand only accepts boolean or undefined as parameter. You most likely did <button onClick={toggleExpand}> instead of <button onClick={() => toggleExpand()}>`);
|
|
57
|
+
}
|
|
58
|
+
if (toggle !== void 0 && toggle === expanded) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
onClickExpand?.(!expanded);
|
|
62
|
+
if (navigationRef.current) {
|
|
63
|
+
navigationRef.current.style.width = "";
|
|
64
|
+
}
|
|
65
|
+
setAnimation(expanded ? "collapse" : "expand");
|
|
66
|
+
setTimeout(() => {
|
|
67
|
+
setExpanded(toggle !== void 0 ? toggle : !expanded);
|
|
68
|
+
setAnimation(false);
|
|
69
|
+
}, constants.ANIMATION_DURATION);
|
|
70
|
+
}, [expanded, onClickExpand, setAnimation, setExpanded]);
|
|
71
|
+
const pinItem = react.useCallback((item) => {
|
|
72
|
+
const newValue = [...pinnedItems, item];
|
|
73
|
+
setPinnedItems(newValue);
|
|
74
|
+
return newValue;
|
|
75
|
+
}, [pinnedItems]);
|
|
76
|
+
const unpinItem = react.useCallback((item) => {
|
|
77
|
+
const newValue = pinnedItems.filter((localItem) => localItem !== item);
|
|
78
|
+
setPinnedItems(newValue);
|
|
79
|
+
return newValue;
|
|
80
|
+
}, [pinnedItems]);
|
|
81
|
+
const reorderItems = react.useCallback((initialIndex, endIndex) => {
|
|
82
|
+
const newPinnedItems = [...pinnedItems];
|
|
83
|
+
const [removed] = newPinnedItems.splice(initialIndex, 1);
|
|
84
|
+
newPinnedItems.splice(endIndex, 0, removed);
|
|
85
|
+
setPinnedItems(newPinnedItems);
|
|
86
|
+
return newPinnedItems;
|
|
87
|
+
}, [pinnedItems]);
|
|
88
|
+
const value = react.useMemo(() => ({
|
|
89
|
+
expanded,
|
|
90
|
+
toggleExpand,
|
|
91
|
+
pinnedItems,
|
|
92
|
+
pinItem,
|
|
93
|
+
unpinItem,
|
|
94
|
+
pinnedFeature,
|
|
95
|
+
locales,
|
|
96
|
+
pinLimit,
|
|
97
|
+
animation,
|
|
98
|
+
setAnimation,
|
|
99
|
+
navigationRef,
|
|
100
|
+
width,
|
|
101
|
+
setWidth,
|
|
102
|
+
reorderItems,
|
|
103
|
+
registerItem,
|
|
104
|
+
items,
|
|
105
|
+
setPinnedItems
|
|
106
|
+
}), [expanded, toggleExpand, pinnedItems, pinItem, unpinItem, pinnedFeature, locales, pinLimit, animation, width, reorderItems, items, setPinnedItems]);
|
|
107
|
+
return /* @__PURE__ */ jsxRuntime.jsx(NavigationContext.Provider, { value, children });
|
|
108
|
+
};
|
|
109
|
+
exports.NavigationContext = NavigationContext;
|
|
110
|
+
exports.NavigationProvider = NavigationProvider;
|
|
111
|
+
exports.useNavigation = useNavigation;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { Dispatch, ReactNode, RefObject } from 'react';
|
|
2
|
+
import { type PinUnPinType } from './constants';
|
|
2
3
|
import NavigationLocales from './locales/en';
|
|
3
4
|
type Item = {
|
|
4
5
|
label: string;
|
|
5
6
|
active?: boolean;
|
|
6
7
|
onClick?: (toggle?: true | false) => void;
|
|
8
|
+
onClickPinUnpin?: (parameters: PinUnPinType) => void;
|
|
7
9
|
};
|
|
8
10
|
type Items = Record<string, Item>;
|
|
9
11
|
type ContextProps = {
|
|
@@ -12,8 +14,8 @@ type ContextProps = {
|
|
|
12
14
|
animation: boolean | 'expand' | 'collapse';
|
|
13
15
|
pinnedFeature?: boolean;
|
|
14
16
|
onClickPinUnpin?: (pinned: string[]) => void;
|
|
15
|
-
pinItem: (item: string) =>
|
|
16
|
-
unpinItem: (item: string) =>
|
|
17
|
+
pinItem: (item: string) => string[];
|
|
18
|
+
unpinItem: (item: string) => string[];
|
|
17
19
|
pinnedItems: string[];
|
|
18
20
|
pinLimit: number;
|
|
19
21
|
navigationRef: RefObject<HTMLDivElement>;
|
|
@@ -32,9 +34,10 @@ type ContextProps = {
|
|
|
32
34
|
/**
|
|
33
35
|
* The end index of the item
|
|
34
36
|
*/
|
|
35
|
-
endIndex: number) =>
|
|
37
|
+
endIndex: number) => string[];
|
|
36
38
|
items: Items;
|
|
37
39
|
registerItem: Dispatch<Items>;
|
|
40
|
+
setPinnedItems: (value: string[]) => void;
|
|
38
41
|
};
|
|
39
42
|
export declare const NavigationContext: import("react").Context<ContextProps>;
|
|
40
43
|
export declare const useNavigation: () => ContextProps;
|
|
@@ -68,20 +71,6 @@ type NavigationProviderProps = {
|
|
|
68
71
|
* and it automatically collapse / expand.
|
|
69
72
|
*/
|
|
70
73
|
onClickExpand?: (expanded: boolean) => void;
|
|
71
|
-
/**
|
|
72
|
-
* This function is triggered when the user click on the pin/unpin button
|
|
73
|
-
* of an item. To access all pinned item you can use the `useNavigation` hook
|
|
74
|
-
* and access the `pinnedItems` property.
|
|
75
|
-
*/
|
|
76
|
-
onClickPinUnpin?: (
|
|
77
|
-
/**
|
|
78
|
-
* The state of the item after the click
|
|
79
|
-
*/
|
|
80
|
-
state: 'pin' | 'unpin',
|
|
81
|
-
/**
|
|
82
|
-
* The current items that has been pinned on click
|
|
83
|
-
*/
|
|
84
|
-
pinned: string) => void;
|
|
85
74
|
};
|
|
86
|
-
export declare const NavigationProvider: ({ children, pinnedFeature, initialPinned, initialExpanded, locales, pinLimit, onClickExpand, initialWidth,
|
|
75
|
+
export declare const NavigationProvider: ({ children, pinnedFeature, initialPinned, initialExpanded, locales, pinLimit, onClickExpand, initialWidth, }: NavigationProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
87
76
|
export {};
|
|
@@ -12,10 +12,8 @@ const NavigationContext = createContext({
|
|
|
12
12
|
},
|
|
13
13
|
animation: false,
|
|
14
14
|
locales: NavigationLocales,
|
|
15
|
-
pinItem: () =>
|
|
16
|
-
|
|
17
|
-
unpinItem: () => {
|
|
18
|
-
},
|
|
15
|
+
pinItem: () => [],
|
|
16
|
+
unpinItem: () => [],
|
|
19
17
|
pinnedItems: [],
|
|
20
18
|
pinLimit: 7,
|
|
21
19
|
navigationRef: {
|
|
@@ -24,10 +22,11 @@ const NavigationContext = createContext({
|
|
|
24
22
|
width: NAVIGATION_WIDTH,
|
|
25
23
|
setWidth: () => {
|
|
26
24
|
},
|
|
27
|
-
reorderItems: () =>
|
|
28
|
-
},
|
|
25
|
+
reorderItems: () => [],
|
|
29
26
|
items: {},
|
|
30
27
|
registerItem: () => {
|
|
28
|
+
},
|
|
29
|
+
setPinnedItems: () => {
|
|
31
30
|
}
|
|
32
31
|
});
|
|
33
32
|
const useNavigation = () => useContext(NavigationContext);
|
|
@@ -39,8 +38,7 @@ const NavigationProvider = ({
|
|
|
39
38
|
locales = NavigationLocales,
|
|
40
39
|
pinLimit = 7,
|
|
41
40
|
onClickExpand,
|
|
42
|
-
initialWidth = NAVIGATION_WIDTH
|
|
43
|
-
onClickPinUnpin
|
|
41
|
+
initialWidth = NAVIGATION_WIDTH
|
|
44
42
|
}) => {
|
|
45
43
|
const [expanded, setExpanded] = useState(initialExpanded);
|
|
46
44
|
const [pinnedItems, setPinnedItems] = useState(initialPinned ?? []);
|
|
@@ -69,18 +67,21 @@ const NavigationProvider = ({
|
|
|
69
67
|
}, ANIMATION_DURATION);
|
|
70
68
|
}, [expanded, onClickExpand, setAnimation, setExpanded]);
|
|
71
69
|
const pinItem = useCallback((item) => {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
const newValue = [...pinnedItems, item];
|
|
71
|
+
setPinnedItems(newValue);
|
|
72
|
+
return newValue;
|
|
73
|
+
}, [pinnedItems]);
|
|
75
74
|
const unpinItem = useCallback((item) => {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
const newValue = pinnedItems.filter((localItem) => localItem !== item);
|
|
76
|
+
setPinnedItems(newValue);
|
|
77
|
+
return newValue;
|
|
78
|
+
}, [pinnedItems]);
|
|
79
79
|
const reorderItems = useCallback((initialIndex, endIndex) => {
|
|
80
80
|
const newPinnedItems = [...pinnedItems];
|
|
81
81
|
const [removed] = newPinnedItems.splice(initialIndex, 1);
|
|
82
82
|
newPinnedItems.splice(endIndex, 0, removed);
|
|
83
83
|
setPinnedItems(newPinnedItems);
|
|
84
|
+
return newPinnedItems;
|
|
84
85
|
}, [pinnedItems]);
|
|
85
86
|
const value = useMemo(() => ({
|
|
86
87
|
expanded,
|
|
@@ -98,8 +99,9 @@ const NavigationProvider = ({
|
|
|
98
99
|
setWidth,
|
|
99
100
|
reorderItems,
|
|
100
101
|
registerItem,
|
|
101
|
-
items
|
|
102
|
-
|
|
102
|
+
items,
|
|
103
|
+
setPinnedItems
|
|
104
|
+
}), [expanded, toggleExpand, pinnedItems, pinItem, unpinItem, pinnedFeature, locales, pinLimit, animation, width, reorderItems, items, setPinnedItems]);
|
|
103
105
|
return /* @__PURE__ */ jsx(NavigationContext.Provider, { value, children });
|
|
104
106
|
};
|
|
105
107
|
export {
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
4
|
+
const _styled = require("@emotion/styled/base");
|
|
5
|
+
const ui = require("@ultraviolet/ui");
|
|
6
|
+
const react = require("react");
|
|
7
|
+
const NavigationProvider = require("../NavigationProvider.cjs");
|
|
8
|
+
const constants = require("../constants.cjs");
|
|
9
|
+
const _interopDefaultCompat = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
|
|
10
|
+
const _styled__default = /* @__PURE__ */ _interopDefaultCompat(_styled);
|
|
11
|
+
const StyledText = /* @__PURE__ */ _styled__default.default(ui.Text, process.env.NODE_ENV === "production" ? {
|
|
12
|
+
target: "eh4zgrv2"
|
|
13
|
+
} : {
|
|
14
|
+
target: "eh4zgrv2",
|
|
15
|
+
label: "StyledText"
|
|
16
|
+
})("padding-bottom:", ({
|
|
17
|
+
theme
|
|
18
|
+
}) => theme.space["1"], ";padding-left:", ({
|
|
19
|
+
theme
|
|
20
|
+
}) => theme.space["1"], ";transition:opacity ", constants.ANIMATION_DURATION, "ms ease-in-out,height ", constants.ANIMATION_DURATION, "ms ease-in-out;height:", ({
|
|
21
|
+
theme
|
|
22
|
+
}) => `calc(${theme.typography.bodySmallStrong.lineHeight} + ${theme.space["1"]})`, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL3VsdHJhdmlvbGV0L3VsdHJhdmlvbGV0L3BhY2thZ2VzL3BsdXMvc3JjL2NvbXBvbmVudHMvTmF2aWdhdGlvbi9jb21wb25lbnRzL0dyb3VwLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFZK0IiLCJmaWxlIjoiL2hvbWUvcnVubmVyL3dvcmsvdWx0cmF2aW9sZXQvdWx0cmF2aW9sZXQvcGFja2FnZXMvcGx1cy9zcmMvY29tcG9uZW50cy9OYXZpZ2F0aW9uL2NvbXBvbmVudHMvR3JvdXAudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnXG5pbXBvcnQgeyBTdGFjaywgVGV4dCB9IGZyb20gJ0B1bHRyYXZpb2xldC91aSdcbmltcG9ydCB0eXBlIHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnXG5pbXBvcnQgeyBDaGlsZHJlbiB9IGZyb20gJ3JlYWN0J1xuaW1wb3J0IHsgdXNlTmF2aWdhdGlvbiB9IGZyb20gJy4uL05hdmlnYXRpb25Qcm92aWRlcidcbmltcG9ydCB7IEFOSU1BVElPTl9EVVJBVElPTiwgZ3JvdXBBbmltYXR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cmVufVxuICAgICAgICA8L1N0eWxlZFN0YWNrPlxuICAgICAgPC9Db250YWluZXI+XG4gICAgKVxuICB9XG5cbiAgcmV0dXJuIG51bGxcbn1cbiJdfQ== */"));
|
|
23
|
+
const StyledStack = /* @__PURE__ */ _styled__default.default(ui.Stack, process.env.NODE_ENV === "production" ? {
|
|
24
|
+
target: "eh4zgrv1"
|
|
25
|
+
} : {
|
|
26
|
+
target: "eh4zgrv1",
|
|
27
|
+
label: "StyledStack"
|
|
28
|
+
})("padding-top:", ({
|
|
29
|
+
theme
|
|
30
|
+
}) => theme.space["1"], ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL3VsdHJhdmlvbGV0L3VsdHJhdmlvbGV0L3BhY2thZ2VzL3BsdXMvc3JjL2NvbXBvbmVudHMvTmF2aWdhdGlvbi9jb21wb25lbnRzL0dyb3VwLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1QmlDIiwiZmlsZSI6Ii9ob21lL3J1bm5lci93b3JrL3VsdHJhdmlvbGV0L3VsdHJhdmlvbGV0L3BhY2thZ2VzL3BsdXMvc3JjL2NvbXBvbmVudHMvTmF2aWdhdGlvbi9jb21wb25lbnRzL0dyb3VwLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJ1xuaW1wb3J0IHsgU3RhY2ssIFRleHQgfSBmcm9tICdAdWx0cmF2aW9sZXQvdWknXG5pbXBvcnQgdHlwZSB7IFJlYWN0Tm9kZSB9IGZyb20gJ3JlYWN0J1xuaW1wb3J0IHsgQ2hpbGRyZW4gfSBmcm9tICdyZWFjdCdcbmltcG9ydCB7IHVzZU5hdmlnYXRpb24gfSBmcm9tICcuLi9OYXZpZ2F0aW9uUHJvdmlkZXInXG5pbXBvcnQg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iBudWxsfVxuICAgICAgICAgIHtjaGlsZHJlbn1cbiAgICAgICAgPC9TdHlsZWRTdGFjaz5cbiAgICAgIDwvQ29udGFpbmVyPlxuICAgIClcbiAgfVxuXG4gIHJldHVybiBudWxsXG59XG4iXX0= */"));
|
|
31
|
+
const Container = /* @__PURE__ */ _styled__default.default("div", process.env.NODE_ENV === "production" ? {
|
|
32
|
+
target: "eh4zgrv0"
|
|
33
|
+
} : {
|
|
34
|
+
target: "eh4zgrv0",
|
|
35
|
+
label: "Container"
|
|
36
|
+
})("&[data-animation='expand']{", StyledText, "{animation:", constants.groupAnimation, " ", constants.ANIMATION_DURATION, "ms ease-in-out;}}&[data-animation='collapse']{", StyledText, "{animation:", constants.groupAnimation, " ", constants.ANIMATION_DURATION, "ms ease-in-out reverse;}}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL3VsdHJhdmlvbGV0L3VsdHJhdmlvbGV0L3BhY2thZ2VzL3BsdXMvc3JjL2NvbXBvbmVudHMvTmF2aWdhdGlvbi9jb21wb25lbnRzL0dyb3VwLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUEyQjRCIiwiZmlsZSI6Ii9ob21lL3J1bm5lci93b3JrL3VsdHJhdmlvbGV0L3VsdHJhdmlvbGV0L3BhY2thZ2VzL3BsdXMvc3JjL2NvbXBvbmVudHMvTmF2aWdhdGlvbi9jb21wb25lbnRzL0dyb3VwLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJ1xuaW1wb3J0IHsgU3RhY2ssIFRleHQgfSBmcm9tICdAdWx0cmF2aW9sZXQvdWknXG5pbXBvcnQgdHlwZSB7IFJlYWN0Tm9kZSB9IGZyb20gJ3JlYWN0J1xuaW1wb3J0IHsgQ2hpbGRyZ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9XCJ3ZWFrXCJcbiAgICAgICAgICAgID5cbiAgICAgICAgICAgICAge2xhYmVsfVxuICAgICAgICAgICAgPC9TdHlsZWRUZXh0PlxuICAgICAgICAgICkgOiBudWxsfVxuICAgICAgICAgIHtjaGlsZHJlbn1cbiAgICAgICAgPC9TdHlsZWRTdGFjaz5cbiAgICAgIDwvQ29udGFpbmVyPlxuICAgIClcbiAgfVxuXG4gIHJldHVybiBudWxsXG59XG4iXX0= */"));
|
|
37
|
+
const Group = ({
|
|
38
|
+
children,
|
|
39
|
+
label
|
|
40
|
+
}) => {
|
|
41
|
+
const context = NavigationProvider.useNavigation();
|
|
42
|
+
if (!context) {
|
|
43
|
+
throw new Error("Navigation.Group can only be used inside a NavigationProvider.");
|
|
44
|
+
}
|
|
45
|
+
const {
|
|
46
|
+
expanded,
|
|
47
|
+
animation
|
|
48
|
+
} = context;
|
|
49
|
+
if (react.Children.count(children) > 0) {
|
|
50
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Container, { "data-animation": animation, children: /* @__PURE__ */ jsxRuntime.jsxs(StyledStack, { direction: "column", children: [
|
|
51
|
+
expanded || animation === "expand" ? /* @__PURE__ */ jsxRuntime.jsx(StyledText, { as: "span", variant: "bodySmallStrong", sentiment: "neutral", prominence: "weak", children: label }) : null,
|
|
52
|
+
children
|
|
53
|
+
] }) });
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
};
|
|
57
|
+
exports.Group = Group;
|