@ultraviolet/plus 3.0.0-beta.16 → 3.0.0-beta.18

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 (109) hide show
  1. package/dist/components/CodeEditor/CodeEditor.d.ts +1 -1
  2. package/dist/components/CodeEditor/CodeEditor.js +41 -11
  3. package/dist/components/ContentCard/Skeleton.d.ts +1 -1
  4. package/dist/components/ContentCard/Skeleton.js +13 -8
  5. package/dist/components/ContentCard/index.js +131 -51
  6. package/dist/components/ContentCardGroup/Card.js +63 -22
  7. package/dist/components/ContentCardGroup/SkeletonCard.d.ts +1 -1
  8. package/dist/components/ContentCardGroup/SkeletonCard.js +1 -1
  9. package/dist/components/ContentCardGroup/index.js +11 -6
  10. package/dist/components/ContentCardGroup/styles.css.js +1 -0
  11. package/dist/components/Conversation/index.d.ts +9 -9
  12. package/dist/components/Conversation/index.js +23 -6
  13. package/dist/components/CustomerSatisfaction/index.d.ts +1 -1
  14. package/dist/components/CustomerSatisfaction/index.js +68 -39
  15. package/dist/components/EstimateCost/Components/CustomUnitInput.d.ts +1 -1
  16. package/dist/components/EstimateCost/Components/CustomUnitInput.js +47 -27
  17. package/dist/components/EstimateCost/Components/Item.d.ts +1 -1
  18. package/dist/components/EstimateCost/Components/Item.js +303 -203
  19. package/dist/components/EstimateCost/Components/LineThrough.d.ts +1 -1
  20. package/dist/components/EstimateCost/Components/LineThrough.js +8 -2
  21. package/dist/components/EstimateCost/Components/NumberInput.d.ts +1 -1
  22. package/dist/components/EstimateCost/Components/NumberInput.js +17 -9
  23. package/dist/components/EstimateCost/Components/Region.d.ts +1 -1
  24. package/dist/components/EstimateCost/Components/Region.js +43 -25
  25. package/dist/components/EstimateCost/Components/Regular.d.ts +1 -1
  26. package/dist/components/EstimateCost/Components/Regular.js +20 -16
  27. package/dist/components/EstimateCost/Components/Strong.d.ts +1 -1
  28. package/dist/components/EstimateCost/Components/Strong.js +11 -10
  29. package/dist/components/EstimateCost/Components/Unit.d.ts +1 -1
  30. package/dist/components/EstimateCost/Components/Unit.js +20 -13
  31. package/dist/components/EstimateCost/Components/Zone.d.ts +1 -1
  32. package/dist/components/EstimateCost/Components/Zone.js +41 -24
  33. package/dist/components/EstimateCost/EstimateCost.d.ts +11 -11
  34. package/dist/components/EstimateCost/EstimateCost.js +61 -10
  35. package/dist/components/EstimateCost/EstimateCostContent.d.ts +1 -1
  36. package/dist/components/EstimateCost/EstimateCostContent.js +264 -120
  37. package/dist/components/EstimateCost/EstimateCostProvider.d.ts +1 -1
  38. package/dist/components/EstimateCost/EstimateCostProvider.js +24 -21
  39. package/dist/components/EstimateCost/OverlayComponent.d.ts +1 -1
  40. package/dist/components/EstimateCost/OverlayComponent.js +53 -41
  41. package/dist/components/EstimateCost/OverlayContext.d.ts +1 -1
  42. package/dist/components/EstimateCost/OverlayContext.js +2 -4
  43. package/dist/components/FAQ/index.d.ts +1 -1
  44. package/dist/components/FAQ/index.js +1 -1
  45. package/dist/components/InfoTable/InfoTable.d.ts +3 -3
  46. package/dist/components/InfoTable/InfoTable.js +10 -4
  47. package/dist/components/InfoTable/components/Cell.d.ts +1 -1
  48. package/dist/components/InfoTable/components/Cell.js +24 -4
  49. package/dist/components/InfoTable/components/Row.d.ts +1 -1
  50. package/dist/components/InfoTable/components/Row.js +16 -10
  51. package/dist/components/InfoTable/styles.css.d.ts +0 -1
  52. package/dist/components/InfoTable/styles.css.js +0 -2
  53. package/dist/components/Navigation/Footer.d.ts +1 -1
  54. package/dist/components/Navigation/Footer.js +34 -19
  55. package/dist/components/Navigation/Header.d.ts +1 -1
  56. package/dist/components/Navigation/Header.js +12 -9
  57. package/dist/components/Navigation/Navigation.d.ts +5 -5
  58. package/dist/components/Navigation/Navigation.js +2 -5
  59. package/dist/components/Navigation/NavigationContent.d.ts +1 -1
  60. package/dist/components/Navigation/NavigationContent.js +56 -18
  61. package/dist/components/Navigation/NavigationProvider.d.ts +1 -1
  62. package/dist/components/Navigation/NavigationProvider.js +108 -70
  63. package/dist/components/Navigation/components/Group.d.ts +1 -1
  64. package/dist/components/Navigation/components/Group.js +20 -19
  65. package/dist/components/Navigation/components/Item.d.ts +1 -1
  66. package/dist/components/Navigation/components/Item.js +551 -254
  67. package/dist/components/Navigation/components/ItemProvider.d.ts +1 -1
  68. package/dist/components/Navigation/components/ItemProvider.js +2 -4
  69. package/dist/components/Navigation/components/PinnedItems.d.ts +1 -1
  70. package/dist/components/Navigation/components/PinnedItems.js +91 -37
  71. package/dist/components/Navigation/components/Separator.d.ts +1 -1
  72. package/dist/components/Navigation/components/Separator.js +1 -1
  73. package/dist/components/Navigation/styles.css.js +0 -1
  74. package/dist/components/Navigation/variables.css.js +1 -0
  75. package/dist/components/OfferList/OfferList.d.ts +3 -3
  76. package/dist/components/OfferList/OfferList.js +41 -9
  77. package/dist/components/OfferList/OfferListProvider.d.ts +1 -1
  78. package/dist/components/OfferList/OfferListProvider.js +25 -15
  79. package/dist/components/OfferList/components/Banner.d.ts +1 -1
  80. package/dist/components/OfferList/components/Banner.js +30 -8
  81. package/dist/components/OfferList/components/Cell.d.ts +1 -1
  82. package/dist/components/OfferList/components/Cell.js +12 -5
  83. package/dist/components/OfferList/components/Row.d.ts +1 -1
  84. package/dist/components/OfferList/components/Row.js +135 -42
  85. package/dist/components/OrderSummary/NonScrollableContent.d.ts +1 -1
  86. package/dist/components/OrderSummary/NonScrollableContent.js +68 -22
  87. package/dist/components/OrderSummary/Provider.js +1 -4
  88. package/dist/components/OrderSummary/ScrollableContent.d.ts +1 -1
  89. package/dist/components/OrderSummary/ScrollableContent.js +174 -33
  90. package/dist/components/OrderSummary/constants.js +7 -1
  91. package/dist/components/OrderSummary/helpers.js +36 -18
  92. package/dist/components/OrderSummary/index.d.ts +1 -1
  93. package/dist/components/OrderSummary/index.js +135 -48
  94. package/dist/components/Plans/FeatureHint.d.ts +1 -1
  95. package/dist/components/Plans/FeatureHint.js +26 -8
  96. package/dist/components/Plans/PlanHeader.d.ts +1 -1
  97. package/dist/components/Plans/PlanHeader.js +79 -25
  98. package/dist/components/Plans/index.d.ts +1 -1
  99. package/dist/components/Plans/index.js +142 -53
  100. package/dist/components/Plans/styles.css.js +0 -1
  101. package/dist/components/SteppedListCard/Step.d.ts +1 -1
  102. package/dist/components/SteppedListCard/Step.js +42 -2
  103. package/dist/components/SteppedListCard/SteppedListCard.d.ts +2 -2
  104. package/dist/components/SteppedListCard/SteppedListCard.js +66 -19
  105. package/dist/components/SteppedListCard/SteppedListContent.d.ts +1 -1
  106. package/dist/components/SteppedListCard/SteppedListContent.js +13 -11
  107. package/dist/components/SteppedListCard/helper.js +3 -1
  108. package/dist/plus.css +1 -1
  109. package/package.json +6 -6
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsx } from "@emotion/react/jsx-runtime";
2
+ import { jsx } from "react/jsx-runtime";
3
3
  import { useContext, useState, useReducer, useRef, useCallback, useMemo, createContext } from "react";
4
4
  import { NAVIGATION_WIDTH, ANIMATION_DURATION } from "./constants.js";
5
5
  import NavigationLocales from "./locales/en.js";
@@ -10,9 +10,7 @@ const NavigationContext = createContext({
10
10
  expanded: true,
11
11
  items: {},
12
12
  locales: NavigationLocales,
13
- navigationRef: {
14
- current: null
15
- },
13
+ navigationRef: { current: null },
16
14
  pinItem: () => [],
17
15
  pinLimit: 7,
18
16
  pinnedItems: [],
@@ -51,75 +49,115 @@ const NavigationProvider = ({
51
49
  }) => {
52
50
  const [expanded, setExpanded] = useState(initialExpanded);
53
51
  const [pinnedItems, setPinnedItems] = useState(initialPinned ?? []);
54
- const [animation, setAnimation] = useState(false);
52
+ const [animation, setAnimation] = useState(
53
+ false
54
+ );
55
55
  const [width, setWidth] = useState(initialWidth);
56
- const [allowNavigationResize, setAllowNavigationResize] = useState(initialAllowNavigationResize);
57
- const [items, registerItem] = useReducer((oldState, newState) => ({
58
- ...oldState,
59
- ...newState
60
- }), {});
56
+ const [allowNavigationResize, setAllowNavigationResize] = useState(
57
+ initialAllowNavigationResize
58
+ );
59
+ const [items, registerItem] = useReducer(
60
+ (oldState, newState) => ({
61
+ ...oldState,
62
+ ...newState
63
+ }),
64
+ {}
65
+ );
61
66
  const navigationRef = useRef(null);
62
- const toggleExpand = useCallback((toggle) => {
63
- if (typeof toggle !== "boolean" && toggle !== void 0) {
64
- throw new Error("toggleExpand only accepts boolean or undefined as parameter. You most likely did <button onClick={toggleExpand}> instead of <button onClick={() => toggleExpand()}>");
65
- }
66
- if (toggle !== void 0 && toggle === expanded) {
67
- return;
68
- }
69
- onExpandChange?.(!expanded);
70
- if (navigationRef.current) {
71
- navigationRef.current.style.width = "";
72
- }
73
- if (shouldAnimate) {
74
- setAnimation(expanded ? "collapse" : "expand");
75
- setTimeout(() => {
67
+ const toggleExpand = useCallback(
68
+ (toggle) => {
69
+ if (typeof toggle !== "boolean" && toggle !== void 0) {
70
+ throw new Error(
71
+ "toggleExpand only accepts boolean or undefined as parameter. You most likely did <button onClick={toggleExpand}> instead of <button onClick={() => toggleExpand()}>"
72
+ );
73
+ }
74
+ if (toggle !== void 0 && toggle === expanded) {
75
+ return;
76
+ }
77
+ onExpandChange?.(!expanded);
78
+ if (navigationRef.current) {
79
+ navigationRef.current.style.width = "";
80
+ }
81
+ if (shouldAnimate) {
82
+ setAnimation(expanded ? "collapse" : "expand");
83
+ setTimeout(() => {
84
+ setExpanded(toggle !== void 0 ? toggle : !expanded);
85
+ setAnimation(false);
86
+ }, ANIMATION_DURATION);
87
+ } else {
76
88
  setExpanded(toggle !== void 0 ? toggle : !expanded);
77
- setAnimation(false);
78
- }, ANIMATION_DURATION);
79
- } else {
80
- setExpanded(toggle !== void 0 ? toggle : !expanded);
81
- }
82
- }, [expanded, onExpandChange, shouldAnimate]);
83
- const pinItem = useCallback((item) => {
84
- const newValue = [...pinnedItems, item];
85
- setPinnedItems(newValue);
86
- return newValue;
87
- }, [pinnedItems]);
88
- const unpinItem = useCallback((item) => {
89
- const newValue = pinnedItems.filter((localItem) => localItem !== item);
90
- setPinnedItems(newValue);
91
- return newValue;
92
- }, [pinnedItems]);
93
- const reorderItems = useCallback((initialIndex, endIndex) => {
94
- const newPinnedItems = [...pinnedItems];
95
- const [removed] = newPinnedItems.splice(initialIndex, 1);
96
- newPinnedItems.splice(endIndex, 0, removed);
97
- setPinnedItems(newPinnedItems);
98
- return newPinnedItems;
99
- }, [pinnedItems]);
100
- const value = useMemo(() => ({
101
- allowNavigationResize,
102
- animation,
103
- animationType,
104
- expanded,
105
- items,
106
- locales,
107
- navigationRef,
108
- pinItem,
109
- pinLimit,
110
- pinnedFeature,
111
- pinnedItems,
112
- registerItem,
113
- reorderItems,
114
- setAllowNavigationResize,
115
- setAnimation,
116
- setPinnedItems,
117
- setWidth,
118
- shouldAnimate,
119
- toggleExpand,
120
- unpinItem,
121
- width
122
- }), [expanded, toggleExpand, pinnedItems, pinItem, unpinItem, pinnedFeature, locales, pinLimit, animation, width, reorderItems, items, allowNavigationResize, shouldAnimate, animationType]);
89
+ }
90
+ },
91
+ [expanded, onExpandChange, shouldAnimate]
92
+ );
93
+ const pinItem = useCallback(
94
+ (item) => {
95
+ const newValue = [...pinnedItems, item];
96
+ setPinnedItems(newValue);
97
+ return newValue;
98
+ },
99
+ [pinnedItems]
100
+ );
101
+ const unpinItem = useCallback(
102
+ (item) => {
103
+ const newValue = pinnedItems.filter((localItem) => localItem !== item);
104
+ setPinnedItems(newValue);
105
+ return newValue;
106
+ },
107
+ [pinnedItems]
108
+ );
109
+ const reorderItems = useCallback(
110
+ (initialIndex, endIndex) => {
111
+ const newPinnedItems = [...pinnedItems];
112
+ const [removed] = newPinnedItems.splice(initialIndex, 1);
113
+ newPinnedItems.splice(endIndex, 0, removed);
114
+ setPinnedItems(newPinnedItems);
115
+ return newPinnedItems;
116
+ },
117
+ [pinnedItems]
118
+ );
119
+ const value = useMemo(
120
+ () => ({
121
+ allowNavigationResize,
122
+ animation,
123
+ animationType,
124
+ expanded,
125
+ items,
126
+ locales,
127
+ navigationRef,
128
+ pinItem,
129
+ pinLimit,
130
+ pinnedFeature,
131
+ pinnedItems,
132
+ registerItem,
133
+ reorderItems,
134
+ setAllowNavigationResize,
135
+ setAnimation,
136
+ setPinnedItems,
137
+ setWidth,
138
+ shouldAnimate,
139
+ toggleExpand,
140
+ unpinItem,
141
+ width
142
+ }),
143
+ [
144
+ expanded,
145
+ toggleExpand,
146
+ pinnedItems,
147
+ pinItem,
148
+ unpinItem,
149
+ pinnedFeature,
150
+ locales,
151
+ pinLimit,
152
+ animation,
153
+ width,
154
+ reorderItems,
155
+ items,
156
+ allowNavigationResize,
157
+ shouldAnimate,
158
+ animationType
159
+ ]
160
+ );
123
161
  return /* @__PURE__ */ jsx(NavigationContext.Provider, { value, children });
124
162
  };
125
163
  export {
@@ -4,5 +4,5 @@ type GroupProps = {
4
4
  label: string;
5
5
  style?: CSSProperties;
6
6
  };
7
- export declare const Group: ({ children, label, style }: GroupProps) => import("@emotion/react/jsx-runtime").JSX.Element | null;
7
+ export declare const Group: ({ children, label, style }: GroupProps) => import("react/jsx-runtime").JSX.Element | null;
8
8
  export {};
@@ -1,32 +1,33 @@
1
1
  "use client";
2
- import { jsx, jsxs } from "@emotion/react/jsx-runtime";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { Stack, Text } from "@ultraviolet/ui";
4
4
  import { Children } from "react";
5
5
  import { useNavigation } from "../NavigationProvider.js";
6
6
  import { navigationGroupStack, navigationGroupText } from "./styles.css.js";
7
- const Group = ({
8
- children,
9
- label,
10
- style
11
- }) => {
7
+ const Group = ({ children, label, style }) => {
12
8
  const context = useNavigation();
13
9
  if (!context) {
14
- throw new Error("Navigation.Group can only be used inside a NavigationProvider.");
10
+ throw new Error(
11
+ "Navigation.Group can only be used inside a NavigationProvider."
12
+ );
15
13
  }
16
- const {
17
- expanded,
18
- animation,
19
- animationType
20
- } = context;
14
+ const { expanded, animation, animationType } = context;
21
15
  const isDiplay = !animation && expanded;
22
16
  if (Children.count(children) > 0) {
23
- return /* @__PURE__ */ jsx("div", { style: {
24
- width: animation ? "100%" : void 0,
25
- ...style
26
- }, children: /* @__PURE__ */ jsxs(Stack, { className: navigationGroupStack, direction: "column", children: [
27
- isDiplay ? /* @__PURE__ */ jsx(Text, { as: "span", className: navigationGroupText({
28
- animation: animationType === "complex" ? animation : false
29
- }), prominence: "weak", sentiment: "neutral", variant: "bodySmallStrong", children: label }) : null,
17
+ return /* @__PURE__ */ jsx("div", { style: { width: animation ? "100%" : void 0, ...style }, children: /* @__PURE__ */ jsxs(Stack, { className: navigationGroupStack, direction: "column", children: [
18
+ isDiplay ? /* @__PURE__ */ jsx(
19
+ Text,
20
+ {
21
+ as: "span",
22
+ className: navigationGroupText({
23
+ animation: animationType === "complex" ? animation : false
24
+ }),
25
+ prominence: "weak",
26
+ sentiment: "neutral",
27
+ variant: "bodySmallStrong",
28
+ children: label
29
+ }
30
+ ) : null,
30
31
  children
31
32
  ] }) });
32
33
  }
@@ -80,5 +80,5 @@ type ItemProps = {
80
80
  'data-testid'?: string;
81
81
  style?: CSSProperties;
82
82
  };
83
- 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, }: ItemProps) => import("@emotion/react/jsx-runtime").JSX.Element | null>;
83
+ 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, }: ItemProps) => import("react/jsx-runtime").JSX.Element | null>;
84
84
  export {};