@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
@@ -57,30 +57,48 @@ const calculateSubCategoryPrice = (subCategory, hideTimeUnit, timePeriodAmount,
57
57
  return [price, price];
58
58
  };
59
59
  const calculateCategoryPrice = (category, hideTimeUnit, timePeriodAmount, timePeriodUnit) => {
60
- const categoryPrice = category.subCategories?.reduce((acc, subCategory) => {
61
- const computedPrices = calculateSubCategoryPrice(subCategory, hideTimeUnit, timePeriodAmount, timePeriodUnit);
62
- return [acc[0] + computedPrices[0], acc[1] + computedPrices[1]];
63
- }, [0, 0]) || [0, 0];
60
+ const categoryPrice = category.subCategories?.reduce(
61
+ (acc, subCategory) => {
62
+ const computedPrices = calculateSubCategoryPrice(
63
+ subCategory,
64
+ hideTimeUnit,
65
+ timePeriodAmount,
66
+ timePeriodUnit
67
+ );
68
+ return [acc[0] + computedPrices[0], acc[1] + computedPrices[1]];
69
+ },
70
+ [0, 0]
71
+ ) || [0, 0];
64
72
  const discountedPriceMin = category.discount && category.discount <= 1 ? categoryPrice[0] * category.discount : categoryPrice[0] - (category.discount ?? 0);
65
73
  const discountedPriceMax = category.discount && category.discount <= 1 ? categoryPrice[1] * category.discount : categoryPrice[1] - (category.discount ?? 0);
66
74
  const discountedPrice = category.allowNegative ? [discountedPriceMin, discountedPriceMax] : [Math.max(discountedPriceMin, 0), Math.max(discountedPriceMax, 0)];
67
- categoryPrice.map((price) => Math.max(category.discount && category.discount <= 1 ? price * category.discount : price - (category.discount ?? 0), 0));
68
- return {
69
- categoryPrice,
70
- discountedPrice
71
- };
75
+ categoryPrice.map(
76
+ (price) => Math.max(
77
+ category.discount && category.discount <= 1 ? price * category.discount : price - (category.discount ?? 0),
78
+ 0
79
+ )
80
+ );
81
+ return { categoryPrice, discountedPrice };
72
82
  };
73
- const DisplayPrice = ({
74
- price,
75
- beforeOrAfter
76
- }) => {
77
- const {
83
+ const DisplayPrice = ({ price, beforeOrAfter }) => {
84
+ const { localeFormat, currency, fractionDigits } = useContext(OrderSummaryContext);
85
+ const withDiscount = beforeOrAfter === "after" ? "WithDiscount" : "";
86
+ return price.totalPrice === price.maxPrice ? formatNumber(
87
+ price[`totalPrice${withDiscount}`],
78
88
  localeFormat,
79
89
  currency,
80
- fractionDigits
81
- } = useContext(OrderSummaryContext);
82
- const withDiscount = beforeOrAfter === "after" ? "WithDiscount" : "";
83
- return price.totalPrice === price.maxPrice ? formatNumber(price[`totalPrice${withDiscount}`], localeFormat, currency, fractionDigits ?? 2) : `${formatNumber(price[`totalPrice${withDiscount}`], localeFormat, currency, fractionDigits ?? 2)} - ${formatNumber(price[`maxPrice${withDiscount}`], localeFormat, currency, fractionDigits ?? 2)}`;
90
+ fractionDigits ?? 2
91
+ ) : `${formatNumber(
92
+ price[`totalPrice${withDiscount}`],
93
+ localeFormat,
94
+ currency,
95
+ fractionDigits ?? 2
96
+ )} - ${formatNumber(
97
+ price[`maxPrice${withDiscount}`],
98
+ localeFormat,
99
+ currency,
100
+ fractionDigits ?? 2
101
+ )}`;
84
102
  };
85
103
  export {
86
104
  DisplayPrice,
@@ -1,2 +1,2 @@
1
1
  import type { OrderSummaryProps } from './types';
2
- export declare const OrderSummary: ({ header, hideTimeUnit, periodOptions, valueUnitInput, unitUnitInput, items, locales, currency, localeFormat, footer, children, discount, totalPriceInfo, fractionDigits, hideDetails, onChange, onChangeUnitInput, totalPriceDescription, additionalInfo, className, "data-testid": dataTestId, style, }: OrderSummaryProps) => import("@emotion/react/jsx-runtime").JSX.Element;
2
+ export declare const OrderSummary: ({ header, hideTimeUnit, periodOptions, valueUnitInput, unitUnitInput, items, locales, currency, localeFormat, footer, children, discount, totalPriceInfo, fractionDigits, hideDetails, onChange, onChangeUnitInput, totalPriceDescription, additionalInfo, className, "data-testid": dataTestId, style, }: OrderSummaryProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { jsx, jsxs } from "@emotion/react/jsx-runtime";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Stack, Text, UnitInput } from "@ultraviolet/ui";
3
3
  import { useState, useMemo, useEffect } from "react";
4
4
  import { Units } from "./constants.js";
@@ -34,68 +34,155 @@ const OrderSummary = ({
34
34
  }) => {
35
35
  const [timePeriodUnit, setTimePeriodUnit] = useState(unitUnitInput);
36
36
  const [timePeriodAmount, setTimePeriodAmount] = useState(valueUnitInput);
37
- const categoriesPrice = useMemo(() => items.reduce((acc, category) => {
38
- const {
39
- categoryPrice,
40
- discountedPrice
41
- } = calculateCategoryPrice(category, hideTimeUnit, timePeriodAmount, timePeriodUnit);
42
- return {
43
- ...acc,
44
- [category.category]: {
45
- maxPrice: categoryPrice[1],
46
- maxPriceWithDiscount: discountedPrice[1],
47
- timeUnit: unitUnitInput,
48
- totalPrice: categoryPrice[0],
49
- totalPriceWithDiscount: discountedPrice[0]
50
- }
51
- };
52
- }, {}), [hideTimeUnit, items, timePeriodAmount, timePeriodUnit, unitUnitInput]);
37
+ const categoriesPrice = useMemo(
38
+ () => items.reduce((acc, category) => {
39
+ const { categoryPrice, discountedPrice } = calculateCategoryPrice(
40
+ category,
41
+ hideTimeUnit,
42
+ timePeriodAmount,
43
+ timePeriodUnit
44
+ );
45
+ return {
46
+ ...acc,
47
+ [category.category]: {
48
+ maxPrice: categoryPrice[1],
49
+ maxPriceWithDiscount: discountedPrice[1],
50
+ timeUnit: unitUnitInput,
51
+ totalPrice: categoryPrice[0],
52
+ totalPriceWithDiscount: discountedPrice[0]
53
+ }
54
+ };
55
+ }, {}),
56
+ [hideTimeUnit, items, timePeriodAmount, timePeriodUnit, unitUnitInput]
57
+ );
53
58
  const totalPrice = useMemo(() => {
54
- const price = Object.values(categoriesPrice).reduce((acc, categoryPrice) => [acc[0] + categoryPrice.totalPriceWithDiscount, acc[1] + categoryPrice.maxPriceWithDiscount], [0, 0]);
59
+ const price = Object.values(categoriesPrice).reduce(
60
+ (acc, categoryPrice) => [
61
+ acc[0] + categoryPrice.totalPriceWithDiscount,
62
+ acc[1] + categoryPrice.maxPriceWithDiscount
63
+ ],
64
+ [0, 0]
65
+ );
55
66
  const computedPrice = {
56
67
  maxPrice: Math.max(price[1], 0),
57
- maxPriceWithDiscount: Math.max(price[1] * (discount < 1 ? 1 - discount : 1) - (discount >= 1 ? Math.abs(discount) : 0), 0),
68
+ maxPriceWithDiscount: Math.max(
69
+ price[1] * (discount < 1 ? 1 - discount : 1) - (discount >= 1 ? Math.abs(discount) : 0),
70
+ 0
71
+ ),
58
72
  timeUnit: unitUnitInput,
59
73
  totalPrice: Math.max(price[0], 0),
60
- totalPriceWithDiscount: Math.max(price[0] * (discount < 1 ? 1 - discount : 1) - (discount >= 1 ? Math.abs(discount) : 0), 0)
74
+ totalPriceWithDiscount: Math.max(
75
+ price[0] * (discount < 1 ? 1 - discount : 1) - (discount >= 1 ? Math.abs(discount) : 0),
76
+ 0
77
+ )
61
78
  };
62
79
  return computedPrice;
63
80
  }, [categoriesPrice, discount, unitUnitInput]);
64
- const valueContext = useMemo(() => ({
65
- categoriesPrice,
66
- currency,
67
- fractionDigits,
68
- hideTimeUnit,
69
- items,
70
- localeFormat,
71
- locales,
72
- timePeriodAmount,
73
- timePeriodUnit
74
- }), [currency, localeFormat, items, categoriesPrice, hideTimeUnit, timePeriodUnit, timePeriodAmount, locales, fractionDigits]);
81
+ const valueContext = useMemo(
82
+ () => ({
83
+ categoriesPrice,
84
+ currency,
85
+ fractionDigits,
86
+ hideTimeUnit,
87
+ items,
88
+ localeFormat,
89
+ locales,
90
+ timePeriodAmount,
91
+ timePeriodUnit
92
+ }),
93
+ [
94
+ currency,
95
+ localeFormat,
96
+ items,
97
+ categoriesPrice,
98
+ hideTimeUnit,
99
+ timePeriodUnit,
100
+ timePeriodAmount,
101
+ locales,
102
+ fractionDigits
103
+ ]
104
+ );
75
105
  const computePeriodOptions = useMemo(() => {
76
106
  const computedPeriodOptions = [];
77
- periodOptions.forEach((option) => computedPeriodOptions.push({
78
- label: locales[`order.summary.units.${option}.label`],
79
- value: option
80
- }));
107
+ periodOptions.forEach(
108
+ (option) => computedPeriodOptions.push({
109
+ label: locales[`order.summary.units.${option}.label`],
110
+ value: option
111
+ })
112
+ );
81
113
  return computedPeriodOptions;
82
114
  }, [periodOptions, locales]);
83
115
  useEffect(() => {
84
116
  onChange?.(categoriesPrice, totalPrice);
85
117
  }, [categoriesPrice, totalPrice, onChange]);
86
- return /* @__PURE__ */ jsx(OrderSummaryContext.Provider, { value: valueContext, children: /* @__PURE__ */ jsxs(Stack, { className: `${className ? `${className} ` : ""}${orderSummaryContainer}`, "data-testId": dataTestId, justifyContent: hideDetails ? "flex-start" : "space-between", style, children: [
87
- header ? /* @__PURE__ */ jsxs(Stack, { alignItems: "center", className: orderSummaryHeaderContainer[hideDetails ? "hideDetails" : "showDetails"], direction: "row", gap: 2, justifyContent: "space-between", children: [
88
- /* @__PURE__ */ jsx(Text, { as: "h3", prominence: "strong", sentiment: "neutral", variant: "headingSmallStrong", children: header }),
89
- !hideTimeUnit && !hideDetails ? /* @__PURE__ */ jsx(Stack, { className: orderSummaryStackBackground, children: /* @__PURE__ */ jsx(UnitInput, { dropdownAlign: "center", maxWidth: "200px", onChange: (value) => {
90
- setTimePeriodAmount(value);
91
- }, onChangeUnitValue: (val) => {
92
- setTimePeriodUnit(val);
93
- onChangeUnitInput?.(val);
94
- }, options: computePeriodOptions, selectInputWidth: "100%", size: "small", templateColumns: "2fr 3fr", unitValue: unitUnitInput, value: valueUnitInput }) }) : null
95
- ] }) : null,
96
- !hideDetails ? /* @__PURE__ */ jsx(ScrollableContent, {}) : null,
97
- /* @__PURE__ */ jsx(NonScrollableContent, { additionalInfo, discount, footer, hideDetails, totalPrice, totalPriceDescription, totalPriceInfo, unit: unitUnitInput, children })
98
- ] }) });
118
+ return /* @__PURE__ */ jsx(OrderSummaryContext.Provider, { value: valueContext, children: /* @__PURE__ */ jsxs(
119
+ Stack,
120
+ {
121
+ className: `${className ? `${className} ` : ""}${orderSummaryContainer}`,
122
+ "data-testId": dataTestId,
123
+ justifyContent: hideDetails ? "flex-start" : "space-between",
124
+ style,
125
+ children: [
126
+ header ? /* @__PURE__ */ jsxs(
127
+ Stack,
128
+ {
129
+ alignItems: "center",
130
+ className: orderSummaryHeaderContainer[hideDetails ? "hideDetails" : "showDetails"],
131
+ direction: "row",
132
+ gap: 2,
133
+ justifyContent: "space-between",
134
+ children: [
135
+ /* @__PURE__ */ jsx(
136
+ Text,
137
+ {
138
+ as: "h3",
139
+ prominence: "strong",
140
+ sentiment: "neutral",
141
+ variant: "headingSmallStrong",
142
+ children: header
143
+ }
144
+ ),
145
+ !hideTimeUnit && !hideDetails ? /* @__PURE__ */ jsx(Stack, { className: orderSummaryStackBackground, children: /* @__PURE__ */ jsx(
146
+ UnitInput,
147
+ {
148
+ dropdownAlign: "center",
149
+ maxWidth: "200px",
150
+ onChange: (value) => {
151
+ setTimePeriodAmount(value);
152
+ },
153
+ onChangeUnitValue: (val) => {
154
+ setTimePeriodUnit(val);
155
+ onChangeUnitInput?.(val);
156
+ },
157
+ options: computePeriodOptions,
158
+ selectInputWidth: "100%",
159
+ size: "small",
160
+ templateColumns: "2fr 3fr",
161
+ unitValue: unitUnitInput,
162
+ value: valueUnitInput
163
+ }
164
+ ) }) : null
165
+ ]
166
+ }
167
+ ) : null,
168
+ !hideDetails ? /* @__PURE__ */ jsx(ScrollableContent, {}) : null,
169
+ /* @__PURE__ */ jsx(
170
+ NonScrollableContent,
171
+ {
172
+ additionalInfo,
173
+ discount,
174
+ footer,
175
+ hideDetails,
176
+ totalPrice,
177
+ totalPriceDescription,
178
+ totalPriceInfo,
179
+ unit: unitUnitInput,
180
+ children
181
+ }
182
+ )
183
+ ]
184
+ }
185
+ ) });
99
186
  };
100
187
  export {
101
188
  OrderSummary
@@ -2,5 +2,5 @@ import type { Hint } from './types';
2
2
  type FeatureHintProps = {
3
3
  hint?: Hint;
4
4
  };
5
- export declare const FeatureHint: ({ hint }: FeatureHintProps) => import("@emotion/react/jsx-runtime").JSX.Element;
5
+ export declare const FeatureHint: ({ hint }: FeatureHintProps) => import("react/jsx-runtime").JSX.Element;
6
6
  export {};
@@ -1,11 +1,9 @@
1
- import { jsx } from "@emotion/react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { InformationOutlineIcon } from "@ultraviolet/icons";
3
3
  import { Tooltip, Popover } from "@ultraviolet/ui";
4
4
  import { useState } from "react";
5
5
  import { plansIconWrapper } from "./styles.css.js";
6
- const FeatureHint = ({
7
- hint
8
- }) => {
6
+ const FeatureHint = ({ hint }) => {
9
7
  const [visible, setVisible] = useState(false);
10
8
  if (!hint) {
11
9
  return /* @__PURE__ */ jsx("div", {});
@@ -13,11 +11,31 @@ const FeatureHint = ({
13
11
  if (hint.type === "tooltip") {
14
12
  return /* @__PURE__ */ jsx(Tooltip, { text: hint.text, children: /* @__PURE__ */ jsx(InformationOutlineIcon, { prominence: "weak", sentiment: "neutral" }) });
15
13
  }
16
- return /* @__PURE__ */ jsx(Popover, { content: hint.content, onClose: () => setVisible(false), title: hint.title, visible, children: /* @__PURE__ */ jsx("div", { className: plansIconWrapper, "data-testid": "hint-popover", onClick: () => setVisible(true), onKeyDown: (event) => {
17
- if (event.key === "Space" || event.key === "Enter") {
18
- setVisible(true);
14
+ return /* @__PURE__ */ jsx(
15
+ Popover,
16
+ {
17
+ content: hint.content,
18
+ onClose: () => setVisible(false),
19
+ title: hint.title,
20
+ visible,
21
+ children: /* @__PURE__ */ jsx(
22
+ "div",
23
+ {
24
+ className: plansIconWrapper,
25
+ "data-testid": "hint-popover",
26
+ onClick: () => setVisible(true),
27
+ onKeyDown: (event) => {
28
+ if (event.key === "Space" || event.key === "Enter") {
29
+ setVisible(true);
30
+ }
31
+ },
32
+ role: "button",
33
+ tabIndex: 0,
34
+ children: /* @__PURE__ */ jsx(InformationOutlineIcon, { prominence: "weak", sentiment: "neutral" })
35
+ }
36
+ )
19
37
  }
20
- }, role: "button", tabIndex: 0, children: /* @__PURE__ */ jsx(InformationOutlineIcon, { prominence: "weak", sentiment: "neutral" }) }) });
38
+ );
21
39
  };
22
40
  export {
23
41
  FeatureHint
@@ -9,5 +9,5 @@ type PlanHeaderProps = {
9
9
  disabled: boolean;
10
10
  locales?: Record<keyof typeof PlansLocales, string>;
11
11
  };
12
- export declare const PlanHeader: ({ fieldName, setFocusedPlan, onChange, currentPlanValue, plan, disabled, locales, }: PlanHeaderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
12
+ export declare const PlanHeader: ({ fieldName, setFocusedPlan, onChange, currentPlanValue, plan, disabled, locales, }: PlanHeaderProps) => import("react/jsx-runtime").JSX.Element;
13
13
  export {};
@@ -1,4 +1,4 @@
1
- import { jsxs, Fragment, jsx } from "@emotion/react/jsx-runtime";
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import { Stack, Badge, Text, Separator } from "@ultraviolet/ui";
3
3
  import locales from "./locales/en.js";
4
4
  import { plansHeaderInput, plansHeaderFullHeight, plansDescription, plansCurrentWrapper, plansFullSizeSeparator } from "./styles.css.js";
@@ -11,31 +11,85 @@ const PlanHeader = ({
11
11
  disabled,
12
12
  locales: locales$1 = locales
13
13
  }) => /* @__PURE__ */ jsxs(Fragment, { children: [
14
- fieldName && onChange && !disabled ? /* @__PURE__ */ jsx("input", { className: plansHeaderInput, "data-testid": plan.value, id: plan.value, name: fieldName, onBlur: () => {
15
- setFocusedPlan(void 0);
16
- }, onChange: () => onChange(plan.value), onFocus: () => {
17
- setFocusedPlan(plan.value);
18
- }, type: "radio", value: plan.value }) : null,
19
- /* @__PURE__ */ jsxs(Stack, { alignItems: "center", className: plansHeaderFullHeight, gap: 2, justifyContent: "space-between", children: [
20
- /* @__PURE__ */ jsxs(Stack, { alignItems: "center", gap: 3, width: "100%", children: [
21
- /* @__PURE__ */ jsxs(Stack, { alignItems: "center", gap: 1, children: [
22
- /* @__PURE__ */ jsx(Badge, { disabled, sentiment: plan.sentiment && plan.sentiment !== "black" && plan.sentiment !== "white" ? plan.sentiment : "primary", children: /* @__PURE__ */ jsx("label", { htmlFor: plan.value, children: plan.title }) }),
23
- plan.titleHeader,
24
- /* @__PURE__ */ jsxs(Stack, { alignItems: "center", children: [
25
- /* @__PURE__ */ jsx(Text, { as: "span", disabled, sentiment: plan.sentiment ?? "primary", variant: "headingSmallStrong", children: plan.header.price }),
26
- /* @__PURE__ */ jsx(Stack, { style: {
27
- minHeight: "16px"
28
- }, children: plan.header.priceDescription ? /* @__PURE__ */ jsx(Text, { as: "span", disabled, sentiment: plan.sentiment ?? "primary", variant: "caption", children: plan.header.priceDescription }) : null })
14
+ fieldName && onChange && !disabled ? /* @__PURE__ */ jsx(
15
+ "input",
16
+ {
17
+ className: plansHeaderInput,
18
+ "data-testid": plan.value,
19
+ id: plan.value,
20
+ name: fieldName,
21
+ onBlur: () => {
22
+ setFocusedPlan(void 0);
23
+ },
24
+ onChange: () => onChange(plan.value),
25
+ onFocus: () => {
26
+ setFocusedPlan(plan.value);
27
+ },
28
+ type: "radio",
29
+ value: plan.value
30
+ }
31
+ ) : null,
32
+ /* @__PURE__ */ jsxs(
33
+ Stack,
34
+ {
35
+ alignItems: "center",
36
+ className: plansHeaderFullHeight,
37
+ gap: 2,
38
+ justifyContent: "space-between",
39
+ children: [
40
+ /* @__PURE__ */ jsxs(Stack, { alignItems: "center", gap: 3, width: "100%", children: [
41
+ /* @__PURE__ */ jsxs(Stack, { alignItems: "center", gap: 1, children: [
42
+ /* @__PURE__ */ jsx(
43
+ Badge,
44
+ {
45
+ disabled,
46
+ sentiment: plan.sentiment && plan.sentiment !== "black" && plan.sentiment !== "white" ? plan.sentiment : "primary",
47
+ children: /* @__PURE__ */ jsx("label", { htmlFor: plan.value, children: plan.title })
48
+ }
49
+ ),
50
+ plan.titleHeader,
51
+ /* @__PURE__ */ jsxs(Stack, { alignItems: "center", children: [
52
+ /* @__PURE__ */ jsx(
53
+ Text,
54
+ {
55
+ as: "span",
56
+ disabled,
57
+ sentiment: plan.sentiment ?? "primary",
58
+ variant: "headingSmallStrong",
59
+ children: plan.header.price
60
+ }
61
+ ),
62
+ /* @__PURE__ */ jsx(Stack, { style: { minHeight: "16px" }, children: plan.header.priceDescription ? /* @__PURE__ */ jsx(
63
+ Text,
64
+ {
65
+ as: "span",
66
+ disabled,
67
+ sentiment: plan.sentiment ?? "primary",
68
+ variant: "caption",
69
+ children: plan.header.priceDescription
70
+ }
71
+ ) : null })
72
+ ] })
73
+ ] }),
74
+ plan.header.description ? /* @__PURE__ */ jsx("div", { className: plansDescription, children: /* @__PURE__ */ jsx(Text, { as: "div", disabled, variant: "caption", children: plan.header.description }) }) : null
75
+ ] }),
76
+ /* @__PURE__ */ jsxs(Stack, { alignItems: "center", gap: 3, width: "100%", children: [
77
+ plan.header.cta && currentPlanValue !== plan.value ? plan.header.cta : null,
78
+ plan.header.cta && currentPlanValue === plan.value ? /* @__PURE__ */ jsx("div", { className: plansCurrentWrapper, children: /* @__PURE__ */ jsx(
79
+ Text,
80
+ {
81
+ as: "span",
82
+ disabled,
83
+ sentiment: plan.sentiment ?? "primary",
84
+ variant: "bodySmallStrong",
85
+ children: locales$1["plans.currentPlan"]
86
+ }
87
+ ) }) : null,
88
+ plan.header.separator ? /* @__PURE__ */ jsx(Separator, { className: plansFullSizeSeparator }) : null
29
89
  ] })
30
- ] }),
31
- plan.header.description ? /* @__PURE__ */ jsx("div", { className: plansDescription, children: /* @__PURE__ */ jsx(Text, { as: "div", disabled, variant: "caption", children: plan.header.description }) }) : null
32
- ] }),
33
- /* @__PURE__ */ jsxs(Stack, { alignItems: "center", gap: 3, width: "100%", children: [
34
- plan.header.cta && currentPlanValue !== plan.value ? plan.header.cta : null,
35
- plan.header.cta && currentPlanValue === plan.value ? /* @__PURE__ */ jsx("div", { className: plansCurrentWrapper, children: /* @__PURE__ */ jsx(Text, { as: "span", disabled, sentiment: plan.sentiment ?? "primary", variant: "bodySmallStrong", children: locales$1["plans.currentPlan"] }) }) : null,
36
- plan.header.separator ? /* @__PURE__ */ jsx(Separator, { className: plansFullSizeSeparator }) : null
37
- ] })
38
- ] })
90
+ ]
91
+ }
92
+ )
39
93
  ] });
40
94
  export {
41
95
  PlanHeader
@@ -12,5 +12,5 @@ type PlansProps<T extends string> = {
12
12
  locales?: Record<keyof typeof PlansLocales, string>;
13
13
  style?: CSSProperties;
14
14
  };
15
- export declare const Plans: <T extends string>({ fieldName, onChange, value, features, plans, hideFeatureText, hideLabels, locales, style, }: PlansProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
15
+ export declare const Plans: <T extends string>({ fieldName, onChange, value, features, plans, hideFeatureText, hideLabels, locales, style, }: PlansProps<T>) => import("react/jsx-runtime").JSX.Element;
16
16
  export {};