@ultraviolet/plus 3.4.5 → 3.5.1
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/.vite/license.md +3 -0
- package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/defineProperty.js +15 -0
- package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/objectSpread2.js +28 -0
- package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/objectWithoutProperties.js +18 -0
- package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/objectWithoutPropertiesLoose.js +15 -0
- package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/toPrimitive.js +17 -0
- package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/toPropertyKey.js +12 -0
- package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/typeof.js +14 -0
- package/dist/_virtual/_rolldown/runtime.js +9 -0
- package/dist/components/CodeEditor/CodeEditor.d.ts +1 -1
- package/dist/components/CodeEditor/CodeEditor.d.ts.map +1 -1
- package/dist/components/CodeEditor/CodeEditor.js +111 -137
- package/dist/components/CodeEditor/styles.css.js +18 -15
- package/dist/components/ContentCard/Skeleton.d.ts.map +1 -1
- package/dist/components/ContentCard/Skeleton.js +31 -27
- package/dist/components/ContentCard/index.js +107 -140
- package/dist/components/ContentCard/styles.css.d.ts +1 -1
- package/dist/components/ContentCard/styles.css.js +23 -19
- package/dist/components/ContentCardGroup/Card.js +55 -69
- package/dist/components/ContentCardGroup/SkeletonCard.js +28 -14
- package/dist/components/ContentCardGroup/index.d.ts +7 -7
- package/dist/components/ContentCardGroup/index.js +20 -25
- package/dist/components/ContentCardGroup/styles.css.js +6 -11
- package/dist/components/Conversation/index.d.ts +29 -23
- package/dist/components/Conversation/index.d.ts.map +1 -1
- package/dist/components/Conversation/index.js +46 -48
- package/dist/components/Conversation/styles.css.js +19 -13
- package/dist/components/CustomerSatisfaction/assets/1-5.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/1-5NB.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/2-5.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/2-5NB.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/3-5.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/3-5NB.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/4-5.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/4-5NB.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/5-5.js +5 -0
- package/dist/components/CustomerSatisfaction/assets/5-5NB.js +5 -0
- package/dist/components/CustomerSatisfaction/index.d.ts +1 -1
- package/dist/components/CustomerSatisfaction/index.d.ts.map +1 -1
- package/dist/components/CustomerSatisfaction/index.js +85 -100
- package/dist/components/CustomerSatisfaction/styles.css.js +18 -6
- package/dist/components/EstimateCost/Components/CustomUnitInput.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/CustomUnitInput.js +39 -52
- package/dist/components/EstimateCost/Components/Item.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/Item.js +223 -323
- package/dist/components/EstimateCost/Components/LineThrough.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/LineThrough.js +16 -16
- package/dist/components/EstimateCost/Components/NumberInput.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/NumberInput.js +33 -37
- package/dist/components/EstimateCost/Components/Region.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/Region.js +34 -57
- package/dist/components/EstimateCost/Components/Regular.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/Regular.js +21 -26
- package/dist/components/EstimateCost/Components/Strong.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/Strong.js +14 -19
- package/dist/components/EstimateCost/Components/Unit.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/Unit.js +47 -40
- package/dist/components/EstimateCost/Components/Zone.d.ts.map +1 -1
- package/dist/components/EstimateCost/Components/Zone.js +33 -55
- package/dist/components/EstimateCost/Components/components.css.js +122 -86
- package/dist/components/EstimateCost/EstimateCost.d.ts +138 -121
- package/dist/components/EstimateCost/EstimateCost.d.ts.map +1 -1
- package/dist/components/EstimateCost/EstimateCost.js +79 -124
- package/dist/components/EstimateCost/EstimateCostContent.d.ts.map +1 -1
- package/dist/components/EstimateCost/EstimateCostContent.js +284 -394
- package/dist/components/EstimateCost/EstimateCostProvider.d.ts +1 -1
- package/dist/components/EstimateCost/EstimateCostProvider.d.ts.map +1 -1
- package/dist/components/EstimateCost/EstimateCostProvider.js +30 -37
- package/dist/components/EstimateCost/OverlayComponent.d.ts.map +1 -1
- package/dist/components/EstimateCost/OverlayComponent.js +95 -93
- package/dist/components/EstimateCost/OverlayContext.d.ts.map +1 -1
- package/dist/components/EstimateCost/OverlayContext.js +12 -10
- package/dist/components/EstimateCost/constants.js +19 -21
- package/dist/components/EstimateCost/helper.d.ts +2 -2
- package/dist/components/EstimateCost/helper.d.ts.map +1 -1
- package/dist/components/EstimateCost/helper.js +9 -14
- package/dist/components/EstimateCost/locales/en.js +24 -23
- package/dist/components/EstimateCost/styles.css.d.ts +2 -2
- package/dist/components/EstimateCost/styles.css.js +50 -36
- package/dist/components/EstimateCost/types.d.ts +1 -1
- package/dist/components/EstimateCost/types.d.ts.map +1 -1
- package/dist/components/FAQ/index.d.ts.map +1 -1
- package/dist/components/FAQ/index.js +37 -31
- package/dist/components/FAQ/styles.css.js +6 -4
- package/dist/components/InfoTable/InfoTable.d.ts +10 -13
- package/dist/components/InfoTable/InfoTable.d.ts.map +1 -1
- package/dist/components/InfoTable/InfoTable.js +24 -15
- package/dist/components/InfoTable/components/Cell.d.ts.map +1 -1
- package/dist/components/InfoTable/components/Cell.js +37 -45
- package/dist/components/InfoTable/components/Row.d.ts.map +1 -1
- package/dist/components/InfoTable/components/Row.js +19 -27
- package/dist/components/InfoTable/context.d.ts +1 -1
- package/dist/components/InfoTable/context.d.ts.map +1 -1
- package/dist/components/InfoTable/context.js +5 -3
- package/dist/components/InfoTable/styles.css.js +6 -10
- package/dist/components/Navigation/Footer.d.ts.map +1 -1
- package/dist/components/Navigation/Footer.js +59 -75
- package/dist/components/Navigation/Header.d.ts.map +1 -1
- package/dist/components/Navigation/Header.js +20 -17
- package/dist/components/Navigation/Navigation.d.ts +46 -43
- package/dist/components/Navigation/Navigation.d.ts.map +1 -1
- package/dist/components/Navigation/Navigation.js +23 -27
- package/dist/components/Navigation/NavigationContent.d.ts +1 -1
- package/dist/components/Navigation/NavigationContent.d.ts.map +1 -1
- package/dist/components/Navigation/NavigationContent.js +100 -138
- package/dist/components/Navigation/NavigationProvider.d.ts.map +1 -1
- package/dist/components/Navigation/NavigationProvider.js +116 -165
- package/dist/components/Navigation/components/Group.d.ts.map +1 -1
- package/dist/components/Navigation/components/Group.js +36 -43
- package/dist/components/Navigation/components/Item.d.ts +1 -1
- package/dist/components/Navigation/components/Item.d.ts.map +1 -1
- package/dist/components/Navigation/components/Item.js +440 -607
- package/dist/components/Navigation/components/ItemProvider.d.ts.map +1 -1
- package/dist/components/Navigation/components/ItemProvider.js +13 -8
- package/dist/components/Navigation/components/PinnedItems.d.ts.map +1 -1
- package/dist/components/Navigation/components/PinnedItems.js +101 -132
- package/dist/components/Navigation/components/Separator.js +10 -7
- package/dist/components/Navigation/components/ShowHide.d.ts +1 -1
- package/dist/components/Navigation/components/ShowHide.d.ts.map +1 -1
- package/dist/components/Navigation/components/ShowHide.js +51 -75
- package/dist/components/Navigation/components/items.css.js +72 -30
- package/dist/components/Navigation/components/styles.css.js +23 -13
- package/dist/components/Navigation/locales/en.js +12 -11
- package/dist/components/Navigation/styles.css.js +28 -14
- package/dist/components/Navigation/variables.css.js +6 -4
- package/dist/components/OfferList/OfferList.d.ts +5 -51
- package/dist/components/OfferList/OfferList.d.ts.map +1 -1
- package/dist/components/OfferList/OfferList.js +11 -78
- package/dist/components/OrderSummary/index.d.ts +5 -2
- package/dist/components/OrderSummary/index.d.ts.map +1 -1
- package/dist/components/OrderSummary/index.js +11 -204
- package/dist/components/Plans/index.d.ts +5 -21
- package/dist/components/Plans/index.d.ts.map +1 -1
- package/dist/components/Plans/index.js +11 -214
- package/dist/components/SteppedListCard/index.d.ts +5 -1
- package/dist/components/SteppedListCard/index.d.ts.map +1 -1
- package/dist/components/SteppedListCard/index.js +11 -0
- package/dist/index.js +5 -21
- package/dist/plus.css +2 -1
- package/package.json +9 -8
- package/LICENSE +0 -189
- package/dist/components/CustomerSatisfaction/assets/1-5.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/1-5NB.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/2-5.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/2-5NB.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/3-5.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/3-5NB.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/4-5.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/4-5NB.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/5-5.svg.js +0 -4
- package/dist/components/CustomerSatisfaction/assets/5-5NB.svg.js +0 -4
- package/dist/components/Navigation/constants.js +0 -10
- package/dist/components/OfferList/OfferListProvider.d.ts +0 -30
- package/dist/components/OfferList/OfferListProvider.d.ts.map +0 -1
- package/dist/components/OfferList/OfferListProvider.js +0 -48
- package/dist/components/OfferList/components/Banner.d.ts +0 -13
- package/dist/components/OfferList/components/Banner.d.ts.map +0 -1
- package/dist/components/OfferList/components/Banner.js +0 -43
- package/dist/components/OfferList/components/Cell.d.ts +0 -4
- package/dist/components/OfferList/components/Cell.d.ts.map +0 -1
- package/dist/components/OfferList/components/Cell.js +0 -35
- package/dist/components/OfferList/components/OfferListRowProvider.d.ts +0 -9
- package/dist/components/OfferList/components/OfferListRowProvider.d.ts.map +0 -1
- package/dist/components/OfferList/components/OfferListRowProvider.js +0 -10
- package/dist/components/OfferList/components/Row.d.ts +0 -18
- package/dist/components/OfferList/components/Row.d.ts.map +0 -1
- package/dist/components/OfferList/components/Row.js +0 -258
- package/dist/components/OfferList/styles.css.d.ts +0 -44
- package/dist/components/OfferList/styles.css.d.ts.map +0 -1
- package/dist/components/OfferList/styles.css.js +0 -40
- package/dist/components/OrderSummary/NonScrollableContent.d.ts +0 -20
- package/dist/components/OrderSummary/NonScrollableContent.d.ts.map +0 -1
- package/dist/components/OrderSummary/NonScrollableContent.js +0 -136
- package/dist/components/OrderSummary/Provider.d.ts +0 -15
- package/dist/components/OrderSummary/Provider.d.ts.map +0 -1
- package/dist/components/OrderSummary/Provider.js +0 -15
- package/dist/components/OrderSummary/ScrollableContent.d.ts +0 -2
- package/dist/components/OrderSummary/ScrollableContent.d.ts.map +0 -1
- package/dist/components/OrderSummary/ScrollableContent.js +0 -314
- package/dist/components/OrderSummary/constants.d.ts +0 -3
- package/dist/components/OrderSummary/constants.d.ts.map +0 -1
- package/dist/components/OrderSummary/constants.js +0 -18
- package/dist/components/OrderSummary/helpers.d.ts +0 -28
- package/dist/components/OrderSummary/helpers.d.ts.map +0 -1
- package/dist/components/OrderSummary/helpers.js +0 -156
- package/dist/components/OrderSummary/locales/en.d.ts +0 -11
- package/dist/components/OrderSummary/locales/en.d.ts.map +0 -1
- package/dist/components/OrderSummary/locales/en.js +0 -12
- package/dist/components/OrderSummary/styles.css.d.ts +0 -21
- package/dist/components/OrderSummary/styles.css.d.ts.map +0 -1
- package/dist/components/OrderSummary/styles.css.js +0 -26
- package/dist/components/OrderSummary/types.d.ts +0 -125
- package/dist/components/OrderSummary/types.d.ts.map +0 -1
- package/dist/components/Plans/FeatureHint.d.ts +0 -7
- package/dist/components/Plans/FeatureHint.d.ts.map +0 -1
- package/dist/components/Plans/FeatureHint.js +0 -42
- package/dist/components/Plans/PlanHeader.d.ts +0 -14
- package/dist/components/Plans/PlanHeader.d.ts.map +0 -1
- package/dist/components/Plans/PlanHeader.js +0 -96
- package/dist/components/Plans/locales/en.d.ts +0 -7
- package/dist/components/Plans/locales/en.d.ts.map +0 -1
- package/dist/components/Plans/locales/en.js +0 -8
- package/dist/components/Plans/styles.css.d.ts +0 -67
- package/dist/components/Plans/styles.css.d.ts.map +0 -1
- package/dist/components/Plans/styles.css.js +0 -26
- package/dist/components/Plans/types.d.ts +0 -38
- package/dist/components/Plans/types.d.ts.map +0 -1
- package/dist/components/SteppedListCard/Step.d.ts +0 -23
- package/dist/components/SteppedListCard/Step.d.ts.map +0 -1
- package/dist/components/SteppedListCard/Step.js +0 -61
- package/dist/components/SteppedListCard/SteppedListCard.d.ts +0 -69
- package/dist/components/SteppedListCard/SteppedListCard.d.ts.map +0 -1
- package/dist/components/SteppedListCard/SteppedListCard.js +0 -105
- package/dist/components/SteppedListCard/SteppedListContent.d.ts +0 -12
- package/dist/components/SteppedListCard/SteppedListContent.d.ts.map +0 -1
- package/dist/components/SteppedListCard/SteppedListContent.js +0 -53
- package/dist/components/SteppedListCard/helper.d.ts +0 -27
- package/dist/components/SteppedListCard/helper.d.ts.map +0 -1
- package/dist/components/SteppedListCard/helper.js +0 -41
- package/dist/components/SteppedListCard/styles.css.d.ts +0 -9
- package/dist/components/SteppedListCard/styles.css.d.ts.map +0 -1
- package/dist/components/SteppedListCard/styles.css.js +0 -19
|
@@ -1,170 +1,121 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import { __name } from "../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { _objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.113.0/helpers/objectSpread2.js";
|
|
4
|
+
import en_default from "./locales/en.js";
|
|
5
|
+
import { createContext, useCallback, useContext, useMemo, useReducer, useRef, useState } from "react";
|
|
2
6
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import NavigationLocales from "./locales/en.js";
|
|
7
|
+
|
|
8
|
+
//#region src/components/Navigation/NavigationProvider.tsx
|
|
6
9
|
const NavigationContext = createContext({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
shouldAnimate: true,
|
|
27
|
-
/**
|
|
28
|
-
* This function will trigger the expand/collapse of the navigation and
|
|
29
|
-
* will also trigger the animation
|
|
30
|
-
*/
|
|
31
|
-
toggleExpand: () => {
|
|
32
|
-
},
|
|
33
|
-
unpinItem: () => [],
|
|
34
|
-
width: NAVIGATION_WIDTH
|
|
10
|
+
allowNavigationResize: true,
|
|
11
|
+
animation: false,
|
|
12
|
+
animationType: "simple",
|
|
13
|
+
expanded: true,
|
|
14
|
+
items: {},
|
|
15
|
+
locales: en_default,
|
|
16
|
+
navigationRef: { current: null },
|
|
17
|
+
pinItem: () => [],
|
|
18
|
+
pinLimit: 7,
|
|
19
|
+
pinnedItems: [],
|
|
20
|
+
registerItem: () => {},
|
|
21
|
+
reorderItems: () => [],
|
|
22
|
+
setAllowNavigationResize: () => {},
|
|
23
|
+
setPinnedItems: () => {},
|
|
24
|
+
setWidth: () => {},
|
|
25
|
+
shouldAnimate: true,
|
|
26
|
+
toggleExpand: () => {},
|
|
27
|
+
unpinItem: () => [],
|
|
28
|
+
width: 280
|
|
35
29
|
});
|
|
36
30
|
const useNavigation = () => useContext(NavigationContext);
|
|
37
|
-
const NavigationProvider = ({
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
animationType,
|
|
125
|
-
expanded,
|
|
126
|
-
items,
|
|
127
|
-
locales,
|
|
128
|
-
navigationRef,
|
|
129
|
-
pinItem,
|
|
130
|
-
pinLimit,
|
|
131
|
-
pinnedFeature,
|
|
132
|
-
pinnedItems,
|
|
133
|
-
registerItem,
|
|
134
|
-
reorderItems,
|
|
135
|
-
setAllowNavigationResize,
|
|
136
|
-
setAnimation,
|
|
137
|
-
setPinnedItems,
|
|
138
|
-
setWidth,
|
|
139
|
-
shouldAnimate,
|
|
140
|
-
toggleExpand,
|
|
141
|
-
unpinItem,
|
|
142
|
-
width,
|
|
143
|
-
showHide
|
|
144
|
-
}),
|
|
145
|
-
[
|
|
146
|
-
expanded,
|
|
147
|
-
toggleExpand,
|
|
148
|
-
pinnedItems,
|
|
149
|
-
pinItem,
|
|
150
|
-
unpinItem,
|
|
151
|
-
pinnedFeature,
|
|
152
|
-
locales,
|
|
153
|
-
pinLimit,
|
|
154
|
-
animation,
|
|
155
|
-
width,
|
|
156
|
-
reorderItems,
|
|
157
|
-
items,
|
|
158
|
-
allowNavigationResize,
|
|
159
|
-
shouldAnimate,
|
|
160
|
-
animationType,
|
|
161
|
-
showHide
|
|
162
|
-
]
|
|
163
|
-
);
|
|
164
|
-
return /* @__PURE__ */ jsx(NavigationContext.Provider, { value, children });
|
|
165
|
-
};
|
|
166
|
-
export {
|
|
167
|
-
NavigationContext,
|
|
168
|
-
NavigationProvider,
|
|
169
|
-
useNavigation
|
|
31
|
+
const NavigationProvider = ({ children, pinnedFeature = false, initialPinned, initialExpanded = true, locales = en_default, pinLimit = 7, onExpandChange, initialWidth = 280, initialAllowNavigationResize = true, animation: shouldAnimate = true, animationType, showHide }) => {
|
|
32
|
+
const [expanded, setExpanded] = useState(initialExpanded);
|
|
33
|
+
const [pinnedItems, setPinnedItems] = useState(initialPinned !== null && initialPinned !== void 0 ? initialPinned : []);
|
|
34
|
+
const [animation, setAnimation] = useState(false);
|
|
35
|
+
const [width, setWidth] = useState(initialWidth);
|
|
36
|
+
const [allowNavigationResize, setAllowNavigationResize] = useState(initialAllowNavigationResize);
|
|
37
|
+
const [items, registerItem] = useReducer((oldState, newState) => _objectSpread2(_objectSpread2({}, oldState), newState), {});
|
|
38
|
+
const navigationRef = useRef(null);
|
|
39
|
+
const toggleExpand = useCallback((toggle) => {
|
|
40
|
+
if (typeof toggle !== "boolean" && toggle !== void 0) throw new Error("toggleExpand only accepts boolean or undefined as parameter. You most likely did <button onClick={toggleExpand}> instead of <button onClick={() => toggleExpand()}>");
|
|
41
|
+
if (toggle !== void 0 && toggle === expanded) return;
|
|
42
|
+
onExpandChange === null || onExpandChange === void 0 || onExpandChange(!expanded);
|
|
43
|
+
if (navigationRef.current) navigationRef.current.style.width = "";
|
|
44
|
+
if (shouldAnimate) {
|
|
45
|
+
setAnimation(expanded ? "collapse" : "expand");
|
|
46
|
+
setTimeout(() => {
|
|
47
|
+
setExpanded(toggle !== null && toggle !== void 0 ? toggle : !expanded);
|
|
48
|
+
setAnimation(false);
|
|
49
|
+
}, 250);
|
|
50
|
+
} else setExpanded(toggle !== null && toggle !== void 0 ? toggle : !expanded);
|
|
51
|
+
}, [
|
|
52
|
+
expanded,
|
|
53
|
+
onExpandChange,
|
|
54
|
+
shouldAnimate
|
|
55
|
+
]);
|
|
56
|
+
const pinItem = useCallback((item) => {
|
|
57
|
+
const newValue = [...pinnedItems, item];
|
|
58
|
+
setPinnedItems(newValue);
|
|
59
|
+
return newValue;
|
|
60
|
+
}, [pinnedItems]);
|
|
61
|
+
const unpinItem = useCallback((item) => {
|
|
62
|
+
const newValue = pinnedItems.filter((localItem) => localItem !== item);
|
|
63
|
+
setPinnedItems(newValue);
|
|
64
|
+
return newValue;
|
|
65
|
+
}, [pinnedItems]);
|
|
66
|
+
const reorderItems = useCallback((initialIndex, endIndex) => {
|
|
67
|
+
const newPinnedItems = [...pinnedItems];
|
|
68
|
+
const [removed] = newPinnedItems.splice(initialIndex, 1);
|
|
69
|
+
newPinnedItems.splice(endIndex, 0, removed);
|
|
70
|
+
setPinnedItems(newPinnedItems);
|
|
71
|
+
return newPinnedItems;
|
|
72
|
+
}, [pinnedItems]);
|
|
73
|
+
const value = useMemo(() => ({
|
|
74
|
+
allowNavigationResize,
|
|
75
|
+
animation,
|
|
76
|
+
animationType,
|
|
77
|
+
expanded,
|
|
78
|
+
items,
|
|
79
|
+
locales,
|
|
80
|
+
navigationRef,
|
|
81
|
+
pinItem,
|
|
82
|
+
pinLimit,
|
|
83
|
+
pinnedFeature,
|
|
84
|
+
pinnedItems,
|
|
85
|
+
registerItem,
|
|
86
|
+
reorderItems,
|
|
87
|
+
setAllowNavigationResize,
|
|
88
|
+
setAnimation,
|
|
89
|
+
setPinnedItems,
|
|
90
|
+
setWidth,
|
|
91
|
+
shouldAnimate,
|
|
92
|
+
toggleExpand,
|
|
93
|
+
unpinItem,
|
|
94
|
+
width,
|
|
95
|
+
showHide
|
|
96
|
+
}), [
|
|
97
|
+
expanded,
|
|
98
|
+
toggleExpand,
|
|
99
|
+
pinnedItems,
|
|
100
|
+
pinItem,
|
|
101
|
+
unpinItem,
|
|
102
|
+
pinnedFeature,
|
|
103
|
+
locales,
|
|
104
|
+
pinLimit,
|
|
105
|
+
animation,
|
|
106
|
+
width,
|
|
107
|
+
reorderItems,
|
|
108
|
+
items,
|
|
109
|
+
allowNavigationResize,
|
|
110
|
+
shouldAnimate,
|
|
111
|
+
animationType,
|
|
112
|
+
showHide
|
|
113
|
+
]);
|
|
114
|
+
return /* @__PURE__ */ jsx(NavigationContext.Provider, {
|
|
115
|
+
value,
|
|
116
|
+
children
|
|
117
|
+
});
|
|
170
118
|
};
|
|
119
|
+
|
|
120
|
+
//#endregion
|
|
121
|
+
export { NavigationProvider, useNavigation };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../../src/components/Navigation/components/Group.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKrD,KAAK,UAAU,GAAG;IAChB,QAAQ,EAAE,SAAS,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB,cAAc,CAAC,EAAE,SAAS,CAAA;CAC3B,CAAA;AAED,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../../src/components/Navigation/components/Group.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKrD,KAAK,UAAU,GAAG;IAChB,QAAQ,EAAE,SAAS,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB,cAAc,CAAC,EAAE,SAAS,CAAA;CAC3B,CAAA;AAED,eAAO,MAAM,KAAK,6GAiDjB,CAAA"}
|
|
@@ -1,46 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Children } from "react";
|
|
1
|
+
'use client';
|
|
2
|
+
import { __name } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.113.0/helpers/objectSpread2.js";
|
|
5
4
|
import { useNavigation } from "../NavigationProvider.js";
|
|
6
5
|
import { navigationGroupStack, navigationGroupText } from "./styles.css.js";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
) : null,
|
|
39
|
-
children
|
|
40
|
-
] }) });
|
|
41
|
-
}
|
|
42
|
-
return null;
|
|
43
|
-
};
|
|
44
|
-
export {
|
|
45
|
-
Group
|
|
6
|
+
import { Stack, Text } from "@ultraviolet/ui";
|
|
7
|
+
import { Children } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
|
|
10
|
+
//#region src/components/Navigation/components/Group.tsx
|
|
11
|
+
const Group = ({ children, label, style, additionalData }) => {
|
|
12
|
+
const context = useNavigation();
|
|
13
|
+
if (!context) throw new Error("Navigation.Group can only be used inside a NavigationProvider.");
|
|
14
|
+
const { expanded, animation, animationType } = context;
|
|
15
|
+
const isDiplay = !animation && expanded;
|
|
16
|
+
if (Children.count(children) > 0) return /* @__PURE__ */ jsx("div", {
|
|
17
|
+
style: _objectSpread2({ width: animation ? "100%" : void 0 }, style),
|
|
18
|
+
children: /* @__PURE__ */ jsxs(Stack, {
|
|
19
|
+
className: navigationGroupStack,
|
|
20
|
+
direction: "column",
|
|
21
|
+
children: [isDiplay ? /* @__PURE__ */ jsx(Text, {
|
|
22
|
+
as: "span",
|
|
23
|
+
className: navigationGroupText({ animation: animationType === "complex" ? animation : false }),
|
|
24
|
+
prominence: "weak",
|
|
25
|
+
sentiment: "neutral",
|
|
26
|
+
variant: "bodySmallStrong",
|
|
27
|
+
children: additionalData ? /* @__PURE__ */ jsxs(Stack, {
|
|
28
|
+
direction: "row",
|
|
29
|
+
justifyContent: "space-between",
|
|
30
|
+
children: [label, additionalData]
|
|
31
|
+
}) : label
|
|
32
|
+
}) : null, children]
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
return null;
|
|
46
36
|
};
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { Group };
|
|
@@ -84,6 +84,6 @@ type ItemProps = {
|
|
|
84
84
|
'data-testid'?: string;
|
|
85
85
|
style?: CSSProperties;
|
|
86
86
|
};
|
|
87
|
-
export declare const Item: import("react").MemoExoticComponent<({ children, categoryIcon, label, labelDescription, subLabel, badgeText, badgeSentiment, href, target, rel, onToggle, onClickPinUnpin, toggle, active, noPinButton, type, as, disabled, noExpand, index, id,
|
|
87
|
+
export declare const Item: import("react").MemoExoticComponent<({ children, categoryIcon, label, labelDescription, subLabel, badgeText, badgeSentiment, href, target, rel, onToggle, onClickPinUnpin, toggle, active, noPinButton, type, as, disabled, noExpand, index, id, 'data-testid': dataTestId, style, alwaysVisible, }: ItemProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
88
88
|
export {};
|
|
89
89
|
//# sourceMappingURL=Item.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../../src/components/Navigation/components/Item.tsx"],"names":[],"mappings":"AAaA,OAAO,EACL,KAAK,EAON,MAAM,iBAAiB,CAAA;AAExB,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EAEb,WAAW,EAEX,SAAS,EACV,MAAM,OAAO,CAAA;AAad,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAyB5C,KAAK,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,aAAa,CAAA;AAMpD,KAAK,SAAS,GAAG;IACf,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,gBAAgB,CAAC,EAAE,SAAS,CAAA;IAC5B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC,OAAO,KAAK,CAAC,CAAC,WAAW,CAAC,CAAA;IAC1D,IAAI,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAA;IAChC,MAAM,CAAC,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAA;IACpC,GAAG,CAAC,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAA;IAC9B;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA;IACpC,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,YAAY,KAAK,IAAI,CAAA;IACpD;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;;OAKG;IACH,EAAE,CAAC,EAAE,WAAW,CAAA;IAChB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB,CAAA;AAOD,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../../src/components/Navigation/components/Item.tsx"],"names":[],"mappings":"AAaA,OAAO,EACL,KAAK,EAON,MAAM,iBAAiB,CAAA;AAExB,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EAEb,WAAW,EAEX,SAAS,EACV,MAAM,OAAO,CAAA;AAad,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAyB5C,KAAK,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,aAAa,CAAA;AAMpD,KAAK,SAAS,GAAG;IACf,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,gBAAgB,CAAC,EAAE,SAAS,CAAA;IAC5B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC,OAAO,KAAK,CAAC,CAAC,WAAW,CAAC,CAAA;IAC1D,IAAI,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAA;IAChC,MAAM,CAAC,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAA;IACpC,GAAG,CAAC,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAA;IAC9B;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA;IACpC,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,YAAY,KAAK,IAAI,CAAA;IACpD;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;;OAKG;IACH,EAAE,CAAC,EAAE,WAAW,CAAA;IAChB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB,CAAA;AAOD,eAAO,MAAM,IAAI,oWAorBhB,CAAA"}
|