@ultraviolet/plus 3.4.5 → 3.5.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.
Files changed (222) hide show
  1. package/dist/.vite/license.md +3 -0
  2. package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/defineProperty.js +15 -0
  3. package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/objectSpread2.js +28 -0
  4. package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/objectWithoutProperties.js +18 -0
  5. package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/objectWithoutPropertiesLoose.js +15 -0
  6. package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/toPrimitive.js +17 -0
  7. package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/toPropertyKey.js +12 -0
  8. package/dist/_virtual/_@oxc-project_runtime@0.113.0/helpers/typeof.js +14 -0
  9. package/dist/_virtual/_rolldown/runtime.js +9 -0
  10. package/dist/components/CodeEditor/CodeEditor.d.ts +1 -1
  11. package/dist/components/CodeEditor/CodeEditor.d.ts.map +1 -1
  12. package/dist/components/CodeEditor/CodeEditor.js +111 -137
  13. package/dist/components/CodeEditor/styles.css.js +18 -15
  14. package/dist/components/ContentCard/Skeleton.d.ts.map +1 -1
  15. package/dist/components/ContentCard/Skeleton.js +31 -27
  16. package/dist/components/ContentCard/index.js +107 -140
  17. package/dist/components/ContentCard/styles.css.d.ts +1 -1
  18. package/dist/components/ContentCard/styles.css.js +24 -19
  19. package/dist/components/ContentCardGroup/Card.js +55 -69
  20. package/dist/components/ContentCardGroup/SkeletonCard.js +28 -14
  21. package/dist/components/ContentCardGroup/index.d.ts +7 -7
  22. package/dist/components/ContentCardGroup/index.js +20 -25
  23. package/dist/components/ContentCardGroup/styles.css.js +6 -11
  24. package/dist/components/Conversation/index.d.ts +29 -23
  25. package/dist/components/Conversation/index.d.ts.map +1 -1
  26. package/dist/components/Conversation/index.js +46 -48
  27. package/dist/components/Conversation/styles.css.js +18 -13
  28. package/dist/components/CustomerSatisfaction/assets/1-5.js +5 -0
  29. package/dist/components/CustomerSatisfaction/assets/1-5NB.js +5 -0
  30. package/dist/components/CustomerSatisfaction/assets/2-5.js +5 -0
  31. package/dist/components/CustomerSatisfaction/assets/2-5NB.js +5 -0
  32. package/dist/components/CustomerSatisfaction/assets/3-5.js +5 -0
  33. package/dist/components/CustomerSatisfaction/assets/3-5NB.js +5 -0
  34. package/dist/components/CustomerSatisfaction/assets/4-5.js +5 -0
  35. package/dist/components/CustomerSatisfaction/assets/4-5NB.js +5 -0
  36. package/dist/components/CustomerSatisfaction/assets/5-5.js +5 -0
  37. package/dist/components/CustomerSatisfaction/assets/5-5NB.js +5 -0
  38. package/dist/components/CustomerSatisfaction/index.d.ts +1 -1
  39. package/dist/components/CustomerSatisfaction/index.d.ts.map +1 -1
  40. package/dist/components/CustomerSatisfaction/index.js +85 -100
  41. package/dist/components/CustomerSatisfaction/styles.css.js +18 -6
  42. package/dist/components/EstimateCost/Components/CustomUnitInput.d.ts.map +1 -1
  43. package/dist/components/EstimateCost/Components/CustomUnitInput.js +39 -52
  44. package/dist/components/EstimateCost/Components/Item.d.ts.map +1 -1
  45. package/dist/components/EstimateCost/Components/Item.js +223 -323
  46. package/dist/components/EstimateCost/Components/LineThrough.d.ts.map +1 -1
  47. package/dist/components/EstimateCost/Components/LineThrough.js +16 -16
  48. package/dist/components/EstimateCost/Components/NumberInput.d.ts.map +1 -1
  49. package/dist/components/EstimateCost/Components/NumberInput.js +33 -37
  50. package/dist/components/EstimateCost/Components/Region.d.ts.map +1 -1
  51. package/dist/components/EstimateCost/Components/Region.js +34 -57
  52. package/dist/components/EstimateCost/Components/Regular.d.ts.map +1 -1
  53. package/dist/components/EstimateCost/Components/Regular.js +21 -26
  54. package/dist/components/EstimateCost/Components/Strong.d.ts.map +1 -1
  55. package/dist/components/EstimateCost/Components/Strong.js +14 -19
  56. package/dist/components/EstimateCost/Components/Unit.d.ts.map +1 -1
  57. package/dist/components/EstimateCost/Components/Unit.js +47 -40
  58. package/dist/components/EstimateCost/Components/Zone.d.ts.map +1 -1
  59. package/dist/components/EstimateCost/Components/Zone.js +33 -55
  60. package/dist/components/EstimateCost/Components/components.css.js +122 -86
  61. package/dist/components/EstimateCost/EstimateCost.d.ts +138 -121
  62. package/dist/components/EstimateCost/EstimateCost.d.ts.map +1 -1
  63. package/dist/components/EstimateCost/EstimateCost.js +79 -124
  64. package/dist/components/EstimateCost/EstimateCostContent.d.ts.map +1 -1
  65. package/dist/components/EstimateCost/EstimateCostContent.js +284 -394
  66. package/dist/components/EstimateCost/EstimateCostProvider.d.ts +1 -1
  67. package/dist/components/EstimateCost/EstimateCostProvider.d.ts.map +1 -1
  68. package/dist/components/EstimateCost/EstimateCostProvider.js +30 -37
  69. package/dist/components/EstimateCost/OverlayComponent.d.ts.map +1 -1
  70. package/dist/components/EstimateCost/OverlayComponent.js +95 -93
  71. package/dist/components/EstimateCost/OverlayContext.d.ts.map +1 -1
  72. package/dist/components/EstimateCost/OverlayContext.js +12 -10
  73. package/dist/components/EstimateCost/constants.js +19 -21
  74. package/dist/components/EstimateCost/helper.d.ts +2 -2
  75. package/dist/components/EstimateCost/helper.d.ts.map +1 -1
  76. package/dist/components/EstimateCost/helper.js +9 -14
  77. package/dist/components/EstimateCost/locales/en.js +24 -23
  78. package/dist/components/EstimateCost/styles.css.d.ts +2 -2
  79. package/dist/components/EstimateCost/styles.css.js +50 -36
  80. package/dist/components/EstimateCost/types.d.ts +1 -1
  81. package/dist/components/EstimateCost/types.d.ts.map +1 -1
  82. package/dist/components/FAQ/index.d.ts.map +1 -1
  83. package/dist/components/FAQ/index.js +37 -31
  84. package/dist/components/FAQ/styles.css.js +6 -4
  85. package/dist/components/InfoTable/InfoTable.d.ts +10 -13
  86. package/dist/components/InfoTable/InfoTable.d.ts.map +1 -1
  87. package/dist/components/InfoTable/InfoTable.js +24 -15
  88. package/dist/components/InfoTable/components/Cell.d.ts.map +1 -1
  89. package/dist/components/InfoTable/components/Cell.js +37 -45
  90. package/dist/components/InfoTable/components/Row.d.ts.map +1 -1
  91. package/dist/components/InfoTable/components/Row.js +19 -27
  92. package/dist/components/InfoTable/context.d.ts +1 -1
  93. package/dist/components/InfoTable/context.d.ts.map +1 -1
  94. package/dist/components/InfoTable/context.js +5 -3
  95. package/dist/components/InfoTable/styles.css.js +6 -10
  96. package/dist/components/Navigation/Footer.d.ts.map +1 -1
  97. package/dist/components/Navigation/Footer.js +59 -75
  98. package/dist/components/Navigation/Header.d.ts.map +1 -1
  99. package/dist/components/Navigation/Header.js +20 -17
  100. package/dist/components/Navigation/Navigation.d.ts +46 -43
  101. package/dist/components/Navigation/Navigation.d.ts.map +1 -1
  102. package/dist/components/Navigation/Navigation.js +23 -27
  103. package/dist/components/Navigation/NavigationContent.d.ts +1 -1
  104. package/dist/components/Navigation/NavigationContent.d.ts.map +1 -1
  105. package/dist/components/Navigation/NavigationContent.js +100 -138
  106. package/dist/components/Navigation/NavigationProvider.d.ts.map +1 -1
  107. package/dist/components/Navigation/NavigationProvider.js +116 -165
  108. package/dist/components/Navigation/components/Group.d.ts.map +1 -1
  109. package/dist/components/Navigation/components/Group.js +36 -43
  110. package/dist/components/Navigation/components/Item.d.ts +1 -1
  111. package/dist/components/Navigation/components/Item.d.ts.map +1 -1
  112. package/dist/components/Navigation/components/Item.js +440 -607
  113. package/dist/components/Navigation/components/ItemProvider.d.ts.map +1 -1
  114. package/dist/components/Navigation/components/ItemProvider.js +13 -8
  115. package/dist/components/Navigation/components/PinnedItems.d.ts.map +1 -1
  116. package/dist/components/Navigation/components/PinnedItems.js +101 -132
  117. package/dist/components/Navigation/components/Separator.js +10 -7
  118. package/dist/components/Navigation/components/ShowHide.d.ts +1 -1
  119. package/dist/components/Navigation/components/ShowHide.d.ts.map +1 -1
  120. package/dist/components/Navigation/components/ShowHide.js +51 -75
  121. package/dist/components/Navigation/components/items.css.js +72 -30
  122. package/dist/components/Navigation/components/styles.css.js +23 -13
  123. package/dist/components/Navigation/locales/en.js +12 -11
  124. package/dist/components/Navigation/styles.css.js +29 -14
  125. package/dist/components/Navigation/variables.css.js +4 -4
  126. package/dist/components/OfferList/OfferList.d.ts +5 -51
  127. package/dist/components/OfferList/OfferList.d.ts.map +1 -1
  128. package/dist/components/OfferList/OfferList.js +11 -78
  129. package/dist/components/OrderSummary/index.d.ts +5 -2
  130. package/dist/components/OrderSummary/index.d.ts.map +1 -1
  131. package/dist/components/OrderSummary/index.js +11 -204
  132. package/dist/components/Plans/index.d.ts +5 -21
  133. package/dist/components/Plans/index.d.ts.map +1 -1
  134. package/dist/components/Plans/index.js +11 -214
  135. package/dist/components/SteppedListCard/index.d.ts +5 -1
  136. package/dist/components/SteppedListCard/index.d.ts.map +1 -1
  137. package/dist/components/SteppedListCard/index.js +11 -0
  138. package/dist/index.js +5 -21
  139. package/dist/plus.css +2 -1
  140. package/package.json +8 -7
  141. package/LICENSE +0 -189
  142. package/dist/components/CustomerSatisfaction/assets/1-5.svg.js +0 -4
  143. package/dist/components/CustomerSatisfaction/assets/1-5NB.svg.js +0 -4
  144. package/dist/components/CustomerSatisfaction/assets/2-5.svg.js +0 -4
  145. package/dist/components/CustomerSatisfaction/assets/2-5NB.svg.js +0 -4
  146. package/dist/components/CustomerSatisfaction/assets/3-5.svg.js +0 -4
  147. package/dist/components/CustomerSatisfaction/assets/3-5NB.svg.js +0 -4
  148. package/dist/components/CustomerSatisfaction/assets/4-5.svg.js +0 -4
  149. package/dist/components/CustomerSatisfaction/assets/4-5NB.svg.js +0 -4
  150. package/dist/components/CustomerSatisfaction/assets/5-5.svg.js +0 -4
  151. package/dist/components/CustomerSatisfaction/assets/5-5NB.svg.js +0 -4
  152. package/dist/components/Navigation/constants.js +0 -10
  153. package/dist/components/OfferList/OfferListProvider.d.ts +0 -30
  154. package/dist/components/OfferList/OfferListProvider.d.ts.map +0 -1
  155. package/dist/components/OfferList/OfferListProvider.js +0 -48
  156. package/dist/components/OfferList/components/Banner.d.ts +0 -13
  157. package/dist/components/OfferList/components/Banner.d.ts.map +0 -1
  158. package/dist/components/OfferList/components/Banner.js +0 -43
  159. package/dist/components/OfferList/components/Cell.d.ts +0 -4
  160. package/dist/components/OfferList/components/Cell.d.ts.map +0 -1
  161. package/dist/components/OfferList/components/Cell.js +0 -35
  162. package/dist/components/OfferList/components/OfferListRowProvider.d.ts +0 -9
  163. package/dist/components/OfferList/components/OfferListRowProvider.d.ts.map +0 -1
  164. package/dist/components/OfferList/components/OfferListRowProvider.js +0 -10
  165. package/dist/components/OfferList/components/Row.d.ts +0 -18
  166. package/dist/components/OfferList/components/Row.d.ts.map +0 -1
  167. package/dist/components/OfferList/components/Row.js +0 -258
  168. package/dist/components/OfferList/styles.css.d.ts +0 -44
  169. package/dist/components/OfferList/styles.css.d.ts.map +0 -1
  170. package/dist/components/OfferList/styles.css.js +0 -40
  171. package/dist/components/OrderSummary/NonScrollableContent.d.ts +0 -20
  172. package/dist/components/OrderSummary/NonScrollableContent.d.ts.map +0 -1
  173. package/dist/components/OrderSummary/NonScrollableContent.js +0 -136
  174. package/dist/components/OrderSummary/Provider.d.ts +0 -15
  175. package/dist/components/OrderSummary/Provider.d.ts.map +0 -1
  176. package/dist/components/OrderSummary/Provider.js +0 -15
  177. package/dist/components/OrderSummary/ScrollableContent.d.ts +0 -2
  178. package/dist/components/OrderSummary/ScrollableContent.d.ts.map +0 -1
  179. package/dist/components/OrderSummary/ScrollableContent.js +0 -314
  180. package/dist/components/OrderSummary/constants.d.ts +0 -3
  181. package/dist/components/OrderSummary/constants.d.ts.map +0 -1
  182. package/dist/components/OrderSummary/constants.js +0 -18
  183. package/dist/components/OrderSummary/helpers.d.ts +0 -28
  184. package/dist/components/OrderSummary/helpers.d.ts.map +0 -1
  185. package/dist/components/OrderSummary/helpers.js +0 -156
  186. package/dist/components/OrderSummary/locales/en.d.ts +0 -11
  187. package/dist/components/OrderSummary/locales/en.d.ts.map +0 -1
  188. package/dist/components/OrderSummary/locales/en.js +0 -12
  189. package/dist/components/OrderSummary/styles.css.d.ts +0 -21
  190. package/dist/components/OrderSummary/styles.css.d.ts.map +0 -1
  191. package/dist/components/OrderSummary/styles.css.js +0 -26
  192. package/dist/components/OrderSummary/types.d.ts +0 -125
  193. package/dist/components/OrderSummary/types.d.ts.map +0 -1
  194. package/dist/components/Plans/FeatureHint.d.ts +0 -7
  195. package/dist/components/Plans/FeatureHint.d.ts.map +0 -1
  196. package/dist/components/Plans/FeatureHint.js +0 -42
  197. package/dist/components/Plans/PlanHeader.d.ts +0 -14
  198. package/dist/components/Plans/PlanHeader.d.ts.map +0 -1
  199. package/dist/components/Plans/PlanHeader.js +0 -96
  200. package/dist/components/Plans/locales/en.d.ts +0 -7
  201. package/dist/components/Plans/locales/en.d.ts.map +0 -1
  202. package/dist/components/Plans/locales/en.js +0 -8
  203. package/dist/components/Plans/styles.css.d.ts +0 -67
  204. package/dist/components/Plans/styles.css.d.ts.map +0 -1
  205. package/dist/components/Plans/styles.css.js +0 -26
  206. package/dist/components/Plans/types.d.ts +0 -38
  207. package/dist/components/Plans/types.d.ts.map +0 -1
  208. package/dist/components/SteppedListCard/Step.d.ts +0 -23
  209. package/dist/components/SteppedListCard/Step.d.ts.map +0 -1
  210. package/dist/components/SteppedListCard/Step.js +0 -61
  211. package/dist/components/SteppedListCard/SteppedListCard.d.ts +0 -69
  212. package/dist/components/SteppedListCard/SteppedListCard.d.ts.map +0 -1
  213. package/dist/components/SteppedListCard/SteppedListCard.js +0 -105
  214. package/dist/components/SteppedListCard/SteppedListContent.d.ts +0 -12
  215. package/dist/components/SteppedListCard/SteppedListContent.d.ts.map +0 -1
  216. package/dist/components/SteppedListCard/SteppedListContent.js +0 -53
  217. package/dist/components/SteppedListCard/helper.d.ts +0 -27
  218. package/dist/components/SteppedListCard/helper.d.ts.map +0 -1
  219. package/dist/components/SteppedListCard/helper.js +0 -41
  220. package/dist/components/SteppedListCard/styles.css.d.ts +0 -9
  221. package/dist/components/SteppedListCard/styles.css.d.ts.map +0 -1
  222. package/dist/components/SteppedListCard/styles.css.js +0 -19
@@ -1,170 +1,121 @@
1
- "use client";
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
- import { useContext, useState, useReducer, useRef, useCallback, useMemo, createContext } from "react";
4
- import { NAVIGATION_WIDTH, ANIMATION_DURATION } from "./constants.js";
5
- import NavigationLocales from "./locales/en.js";
7
+
8
+ //#region src/components/Navigation/NavigationProvider.tsx
6
9
  const NavigationContext = createContext({
7
- allowNavigationResize: true,
8
- animation: false,
9
- animationType: "simple",
10
- expanded: true,
11
- items: {},
12
- locales: NavigationLocales,
13
- navigationRef: { current: null },
14
- pinItem: () => [],
15
- pinLimit: 7,
16
- pinnedItems: [],
17
- registerItem: () => {
18
- },
19
- reorderItems: () => [],
20
- setAllowNavigationResize: () => {
21
- },
22
- setPinnedItems: () => {
23
- },
24
- setWidth: () => {
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
- children,
39
- pinnedFeature = false,
40
- initialPinned,
41
- initialExpanded = true,
42
- locales = NavigationLocales,
43
- pinLimit = 7,
44
- onExpandChange,
45
- initialWidth = NAVIGATION_WIDTH,
46
- initialAllowNavigationResize = true,
47
- animation: shouldAnimate = true,
48
- animationType,
49
- showHide
50
- }) => {
51
- const [expanded, setExpanded] = useState(initialExpanded);
52
- const [pinnedItems, setPinnedItems] = useState(initialPinned ?? []);
53
- const [animation, setAnimation] = useState(
54
- false
55
- );
56
- const [width, setWidth] = useState(initialWidth);
57
- const [allowNavigationResize, setAllowNavigationResize] = useState(
58
- initialAllowNavigationResize
59
- );
60
- const [items, registerItem] = useReducer(
61
- (oldState, newState) => ({
62
- ...oldState,
63
- ...newState
64
- }),
65
- {}
66
- );
67
- const navigationRef = useRef(null);
68
- const toggleExpand = useCallback(
69
- (toggle) => {
70
- if (typeof toggle !== "boolean" && toggle !== void 0) {
71
- throw new Error(
72
- "toggleExpand only accepts boolean or undefined as parameter. You most likely did <button onClick={toggleExpand}> instead of <button onClick={() => toggleExpand()}>"
73
- );
74
- }
75
- if (toggle !== void 0 && toggle === expanded) {
76
- return;
77
- }
78
- onExpandChange?.(!expanded);
79
- if (navigationRef.current) {
80
- navigationRef.current.style.width = "";
81
- }
82
- if (shouldAnimate) {
83
- setAnimation(expanded ? "collapse" : "expand");
84
- setTimeout(() => {
85
- setExpanded(toggle ?? !expanded);
86
- setAnimation(false);
87
- }, ANIMATION_DURATION);
88
- } else {
89
- setExpanded(toggle ?? !expanded);
90
- }
91
- },
92
- [expanded, onExpandChange, shouldAnimate]
93
- );
94
- const pinItem = useCallback(
95
- (item) => {
96
- const newValue = [...pinnedItems, item];
97
- setPinnedItems(newValue);
98
- return newValue;
99
- },
100
- [pinnedItems]
101
- );
102
- const unpinItem = useCallback(
103
- (item) => {
104
- const newValue = pinnedItems.filter((localItem) => localItem !== item);
105
- setPinnedItems(newValue);
106
- return newValue;
107
- },
108
- [pinnedItems]
109
- );
110
- const reorderItems = useCallback(
111
- (initialIndex, endIndex) => {
112
- const newPinnedItems = [...pinnedItems];
113
- const [removed] = newPinnedItems.splice(initialIndex, 1);
114
- newPinnedItems.splice(endIndex, 0, removed);
115
- setPinnedItems(newPinnedItems);
116
- return newPinnedItems;
117
- },
118
- [pinnedItems]
119
- );
120
- const value = useMemo(
121
- () => ({
122
- allowNavigationResize,
123
- animation,
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,GAAI,6CAKnB,UAAU,mDA4CZ,CAAA"}
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
- "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
- import { Stack, Text } from "@ultraviolet/ui";
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
- const Group = ({
8
- children,
9
- label,
10
- style,
11
- additionalData
12
- }) => {
13
- const context = useNavigation();
14
- if (!context) {
15
- throw new Error(
16
- "Navigation.Group can only be used inside a NavigationProvider."
17
- );
18
- }
19
- const { expanded, animation, animationType } = context;
20
- const isDiplay = !animation && expanded;
21
- if (Children.count(children) > 0) {
22
- return /* @__PURE__ */ jsx("div", { style: { width: animation ? "100%" : void 0, ...style }, children: /* @__PURE__ */ jsxs(Stack, { className: navigationGroupStack, direction: "column", children: [
23
- isDiplay ? /* @__PURE__ */ jsx(
24
- Text,
25
- {
26
- as: "span",
27
- className: navigationGroupText({
28
- animation: animationType === "complex" ? animation : false
29
- }),
30
- prominence: "weak",
31
- sentiment: "neutral",
32
- variant: "bodySmallStrong",
33
- children: additionalData ? /* @__PURE__ */ jsxs(Stack, { direction: "row", justifyContent: "space-between", children: [
34
- label,
35
- additionalData
36
- ] }) : label
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, "data-testid": dataTestId, style, alwaysVisible, }: ItemProps) => import("react/jsx-runtime").JSX.Element | null>;
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,uSA0BZ,SAAS,oDA0pBb,CAAA"}
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"}