@ultraviolet/plus 3.0.0-beta.16 → 3.0.0-beta.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CodeEditor/CodeEditor.d.ts +1 -1
- package/dist/components/CodeEditor/CodeEditor.js +41 -11
- package/dist/components/ContentCard/Skeleton.d.ts +1 -1
- package/dist/components/ContentCard/Skeleton.js +13 -8
- package/dist/components/ContentCard/index.js +131 -51
- package/dist/components/ContentCard/styles.css.js +1 -0
- package/dist/components/ContentCardGroup/Card.js +63 -22
- package/dist/components/ContentCardGroup/SkeletonCard.d.ts +1 -1
- package/dist/components/ContentCardGroup/SkeletonCard.js +1 -1
- package/dist/components/ContentCardGroup/index.js +11 -6
- package/dist/components/Conversation/index.d.ts +9 -9
- package/dist/components/Conversation/index.js +23 -6
- package/dist/components/CustomerSatisfaction/index.d.ts +1 -1
- package/dist/components/CustomerSatisfaction/index.js +68 -39
- package/dist/components/EstimateCost/Components/CustomUnitInput.d.ts +1 -1
- package/dist/components/EstimateCost/Components/CustomUnitInput.js +47 -27
- package/dist/components/EstimateCost/Components/Item.d.ts +1 -1
- package/dist/components/EstimateCost/Components/Item.js +303 -203
- package/dist/components/EstimateCost/Components/LineThrough.d.ts +1 -1
- package/dist/components/EstimateCost/Components/LineThrough.js +8 -2
- package/dist/components/EstimateCost/Components/NumberInput.d.ts +1 -1
- package/dist/components/EstimateCost/Components/NumberInput.js +17 -9
- package/dist/components/EstimateCost/Components/Region.d.ts +1 -1
- package/dist/components/EstimateCost/Components/Region.js +43 -25
- package/dist/components/EstimateCost/Components/Regular.d.ts +1 -1
- package/dist/components/EstimateCost/Components/Regular.js +20 -16
- package/dist/components/EstimateCost/Components/Strong.d.ts +1 -1
- package/dist/components/EstimateCost/Components/Strong.js +11 -10
- package/dist/components/EstimateCost/Components/Unit.d.ts +1 -1
- package/dist/components/EstimateCost/Components/Unit.js +20 -13
- package/dist/components/EstimateCost/Components/Zone.d.ts +1 -1
- package/dist/components/EstimateCost/Components/Zone.js +41 -24
- package/dist/components/EstimateCost/EstimateCost.d.ts +11 -11
- package/dist/components/EstimateCost/EstimateCost.js +61 -10
- package/dist/components/EstimateCost/EstimateCostContent.d.ts +1 -1
- package/dist/components/EstimateCost/EstimateCostContent.js +264 -120
- package/dist/components/EstimateCost/EstimateCostProvider.d.ts +1 -1
- package/dist/components/EstimateCost/EstimateCostProvider.js +24 -21
- package/dist/components/EstimateCost/OverlayComponent.d.ts +1 -1
- package/dist/components/EstimateCost/OverlayComponent.js +53 -41
- package/dist/components/EstimateCost/OverlayContext.d.ts +1 -1
- package/dist/components/EstimateCost/OverlayContext.js +2 -4
- package/dist/components/FAQ/index.d.ts +1 -1
- package/dist/components/FAQ/index.js +1 -1
- package/dist/components/InfoTable/InfoTable.d.ts +3 -3
- package/dist/components/InfoTable/InfoTable.js +10 -4
- package/dist/components/InfoTable/components/Cell.d.ts +1 -1
- package/dist/components/InfoTable/components/Cell.js +23 -3
- package/dist/components/InfoTable/components/Row.d.ts +1 -1
- package/dist/components/InfoTable/components/Row.js +16 -10
- package/dist/components/Navigation/Footer.d.ts +1 -1
- package/dist/components/Navigation/Footer.js +34 -19
- package/dist/components/Navigation/Header.d.ts +1 -1
- package/dist/components/Navigation/Header.js +12 -9
- package/dist/components/Navigation/Navigation.d.ts +5 -5
- package/dist/components/Navigation/Navigation.js +2 -5
- package/dist/components/Navigation/NavigationContent.d.ts +1 -1
- package/dist/components/Navigation/NavigationContent.js +56 -18
- package/dist/components/Navigation/NavigationProvider.d.ts +1 -1
- package/dist/components/Navigation/NavigationProvider.js +108 -70
- package/dist/components/Navigation/components/Group.d.ts +1 -1
- package/dist/components/Navigation/components/Group.js +20 -19
- package/dist/components/Navigation/components/Item.d.ts +1 -1
- package/dist/components/Navigation/components/Item.js +551 -254
- package/dist/components/Navigation/components/ItemProvider.d.ts +1 -1
- package/dist/components/Navigation/components/ItemProvider.js +2 -4
- package/dist/components/Navigation/components/PinnedItems.d.ts +1 -1
- package/dist/components/Navigation/components/PinnedItems.js +91 -37
- package/dist/components/Navigation/components/Separator.d.ts +1 -1
- package/dist/components/Navigation/components/Separator.js +1 -1
- package/dist/components/Navigation/styles.css.js +0 -1
- package/dist/components/Navigation/variables.css.js +1 -0
- package/dist/components/OfferList/OfferList.d.ts +3 -3
- package/dist/components/OfferList/OfferList.js +41 -9
- package/dist/components/OfferList/OfferListProvider.d.ts +1 -1
- package/dist/components/OfferList/OfferListProvider.js +25 -15
- package/dist/components/OfferList/components/Banner.d.ts +1 -1
- package/dist/components/OfferList/components/Banner.js +30 -8
- package/dist/components/OfferList/components/Cell.d.ts +1 -1
- package/dist/components/OfferList/components/Cell.js +12 -5
- package/dist/components/OfferList/components/Row.d.ts +1 -1
- package/dist/components/OfferList/components/Row.js +135 -42
- package/dist/components/OrderSummary/NonScrollableContent.d.ts +1 -1
- package/dist/components/OrderSummary/NonScrollableContent.js +68 -22
- package/dist/components/OrderSummary/Provider.js +1 -4
- package/dist/components/OrderSummary/ScrollableContent.d.ts +1 -1
- package/dist/components/OrderSummary/ScrollableContent.js +174 -33
- package/dist/components/OrderSummary/constants.js +7 -1
- package/dist/components/OrderSummary/helpers.js +36 -18
- package/dist/components/OrderSummary/index.d.ts +1 -1
- package/dist/components/OrderSummary/index.js +135 -48
- package/dist/components/Plans/FeatureHint.d.ts +1 -1
- package/dist/components/Plans/FeatureHint.js +26 -8
- package/dist/components/Plans/PlanHeader.d.ts +1 -1
- package/dist/components/Plans/PlanHeader.js +79 -25
- package/dist/components/Plans/index.d.ts +1 -1
- package/dist/components/Plans/index.js +142 -53
- package/dist/components/Plans/styles.css.js +0 -1
- package/dist/components/SteppedListCard/Step.d.ts +1 -1
- package/dist/components/SteppedListCard/Step.js +42 -2
- package/dist/components/SteppedListCard/SteppedListCard.d.ts +2 -2
- package/dist/components/SteppedListCard/SteppedListCard.js +66 -19
- package/dist/components/SteppedListCard/SteppedListContent.d.ts +1 -1
- package/dist/components/SteppedListCard/SteppedListContent.js +13 -11
- package/dist/components/SteppedListCard/helper.js +3 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs, jsx } from "
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { CloseIcon, CheckCircleIcon } from "@ultraviolet/icons";
|
|
3
3
|
import { Text, Badge, Stack } from "@ultraviolet/ui";
|
|
4
4
|
import { useState } from "react";
|
|
@@ -22,76 +22,165 @@ const Plans = ({
|
|
|
22
22
|
const [hoveredPlan, setHoveredPlan] = useState();
|
|
23
23
|
return /* @__PURE__ */ jsxs("table", { className: plans, style, children: [
|
|
24
24
|
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
25
|
-
/* @__PURE__ */ jsx("td", { className: plansCell({
|
|
26
|
-
hide: hideLabels
|
|
27
|
-
}), children: !hideFeatureText ? /* @__PURE__ */ jsx(Text, { as: "span", variant: "headingSmallStrong", children: locales$1["plans.features"] }) : null }),
|
|
25
|
+
/* @__PURE__ */ jsx("td", { className: plansCell({ hide: hideLabels }), children: !hideFeatureText ? /* @__PURE__ */ jsx(Text, { as: "span", variant: "headingSmallStrong", children: locales$1["plans.features"] }) : null }),
|
|
28
26
|
plans$1.map((plan) => {
|
|
29
27
|
const computedDisabled = !!(plan.outOfStock || plan.disabled);
|
|
30
28
|
const selectable = hasCardBehavior && !computedDisabled;
|
|
31
|
-
return /* @__PURE__ */ jsxs(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
29
|
+
return /* @__PURE__ */ jsxs(
|
|
30
|
+
"td",
|
|
31
|
+
{
|
|
32
|
+
className: plansCell({
|
|
33
|
+
activeColor: value === plan.value || hoveredPlan === plan.value,
|
|
34
|
+
disabled: computedDisabled,
|
|
35
|
+
focus: focusedPlan === plan.value,
|
|
36
|
+
hideLabels,
|
|
37
|
+
selectable
|
|
38
|
+
}),
|
|
39
|
+
onBlur: selectable ? () => setHoveredPlan(void 0) : void 0,
|
|
40
|
+
onClick: selectable ? () => onChange(plan.value) : void 0,
|
|
41
|
+
onFocus: selectable ? () => setHoveredPlan(plan.value) : void 0,
|
|
42
|
+
onKeyDown: (event) => {
|
|
43
|
+
if ([" ", "Enter"].includes(event.key) && selectable) {
|
|
44
|
+
onChange(plan.value);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
onMouseOut: selectable ? () => setHoveredPlan(void 0) : void 0,
|
|
48
|
+
onMouseOver: selectable ? () => setHoveredPlan(plan.value) : void 0,
|
|
49
|
+
children: [
|
|
50
|
+
plan.outOfStock ? /* @__PURE__ */ jsx(Badge, { className: plansOutOfStockBadge, size: "small", children: locales$1["plans.outOfStock"] }) : null,
|
|
51
|
+
plan.header.quotas ? /* @__PURE__ */ jsx(Badge, { className: plansOutOfStockBadge, size: "small", children: plan.header.quotas }) : null,
|
|
52
|
+
/* @__PURE__ */ jsx(
|
|
53
|
+
PlanHeader,
|
|
54
|
+
{
|
|
55
|
+
currentPlanValue: value,
|
|
56
|
+
disabled: computedDisabled,
|
|
57
|
+
fieldName,
|
|
58
|
+
onChange,
|
|
59
|
+
plan,
|
|
60
|
+
setFocusedPlan
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
plan.value
|
|
66
|
+
);
|
|
46
67
|
})
|
|
47
68
|
] }) }),
|
|
48
69
|
/* @__PURE__ */ jsx("tbody", { children: features.map((feature) => {
|
|
49
70
|
if ("group" in feature) {
|
|
50
|
-
return /* @__PURE__ */ jsxs(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
71
|
+
return /* @__PURE__ */ jsxs(
|
|
72
|
+
"tr",
|
|
73
|
+
{
|
|
74
|
+
className: hideLabels ? plansRowHidden : "",
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ jsx("td", { className: plansCell({}), children: /* @__PURE__ */ jsxs(Stack, { alignItems: "center", direction: "row", gap: 1, children: [
|
|
77
|
+
/* @__PURE__ */ jsx(
|
|
78
|
+
Text,
|
|
79
|
+
{
|
|
80
|
+
as: "p",
|
|
81
|
+
className: plansUppercaseText,
|
|
82
|
+
sentiment: "neutral",
|
|
83
|
+
variant: "bodySmallStronger",
|
|
84
|
+
children: feature.group
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
feature.hint ? /* @__PURE__ */ jsx(FeatureHint, { hint: feature.hint }) : null
|
|
88
|
+
] }) }),
|
|
89
|
+
plans$1.map((plan) => /* @__PURE__ */ jsx(
|
|
90
|
+
"td",
|
|
91
|
+
{
|
|
92
|
+
className: plansCell({
|
|
93
|
+
activeColor: value === plan.value || hoveredPlan === plan.value,
|
|
94
|
+
disabled: plan.outOfStock || plan.disabled,
|
|
95
|
+
focus: focusedPlan === plan.value,
|
|
96
|
+
hide: hideLabels
|
|
97
|
+
})
|
|
98
|
+
},
|
|
99
|
+
plan.value
|
|
100
|
+
))
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
feature.group
|
|
104
|
+
);
|
|
62
105
|
}
|
|
63
106
|
const featureKey = feature.key ?? "";
|
|
64
107
|
return /* @__PURE__ */ jsxs("tr", { children: [
|
|
65
|
-
/* @__PURE__ */ jsx("td", { className: plansCell({
|
|
66
|
-
hide: hideLabels
|
|
67
|
-
}), children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
108
|
+
/* @__PURE__ */ jsx("td", { className: plansCell({ hide: hideLabels }), children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
68
109
|
/* @__PURE__ */ jsxs(Stack, { alignItems: "center", direction: "row", gap: 1, children: [
|
|
69
110
|
/* @__PURE__ */ jsx(Text, { as: "p", variant: "bodyStrong", children: feature.text }),
|
|
70
111
|
/* @__PURE__ */ jsx(FeatureHint, { hint: feature.hint })
|
|
71
112
|
] }),
|
|
72
|
-
feature.description ? /* @__PURE__ */ jsx(
|
|
113
|
+
feature.description ? /* @__PURE__ */ jsx(
|
|
114
|
+
Text,
|
|
115
|
+
{
|
|
116
|
+
as: "div",
|
|
117
|
+
placement: "start",
|
|
118
|
+
prominence: "weak",
|
|
119
|
+
sentiment: "neutral",
|
|
120
|
+
variant: "caption",
|
|
121
|
+
children: feature.description
|
|
122
|
+
}
|
|
123
|
+
) : null
|
|
73
124
|
] }) }),
|
|
74
125
|
plans$1.map((plan) => {
|
|
75
126
|
const computedDisabled = plan.outOfStock || plan.disabled;
|
|
76
127
|
const selectable = hasCardBehavior && !computedDisabled;
|
|
77
|
-
return /* @__PURE__ */ jsxs(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
128
|
+
return /* @__PURE__ */ jsxs(
|
|
129
|
+
"td",
|
|
130
|
+
{
|
|
131
|
+
className: plansCell({
|
|
132
|
+
activeColor: value === plan.value || hoveredPlan === plan.value,
|
|
133
|
+
disabled: computedDisabled,
|
|
134
|
+
focus: focusedPlan === plan.value,
|
|
135
|
+
hideLabels,
|
|
136
|
+
selectable
|
|
137
|
+
}),
|
|
138
|
+
"data-testid": `${plan.value}-${feature.key}`,
|
|
139
|
+
onBlur: () => {
|
|
140
|
+
},
|
|
141
|
+
onClick: selectable ? () => onChange(plan.value) : void 0,
|
|
142
|
+
onFocus: () => {
|
|
143
|
+
},
|
|
144
|
+
onKeyDown: () => {
|
|
145
|
+
},
|
|
146
|
+
onMouseOut: selectable ? () => {
|
|
147
|
+
setHoveredPlan(void 0);
|
|
148
|
+
} : void 0,
|
|
149
|
+
onMouseOver: selectable ? () => {
|
|
150
|
+
setHoveredPlan(plan.value);
|
|
151
|
+
} : void 0,
|
|
152
|
+
children: [
|
|
153
|
+
plan.data[featureKey] === false ? /* @__PURE__ */ jsx(
|
|
154
|
+
CloseIcon,
|
|
155
|
+
{
|
|
156
|
+
disabled: computedDisabled,
|
|
157
|
+
prominence: "weak",
|
|
158
|
+
sentiment: "neutral",
|
|
159
|
+
size: "large"
|
|
160
|
+
}
|
|
161
|
+
) : null,
|
|
162
|
+
plan.data[featureKey] === true ? /* @__PURE__ */ jsx(
|
|
163
|
+
CheckCircleIcon,
|
|
164
|
+
{
|
|
165
|
+
disabled: computedDisabled,
|
|
166
|
+
sentiment: "success",
|
|
167
|
+
size: "medium"
|
|
168
|
+
}
|
|
169
|
+
) : null,
|
|
170
|
+
typeof plan.data[featureKey] !== "boolean" ? /* @__PURE__ */ jsx(
|
|
171
|
+
Text,
|
|
172
|
+
{
|
|
173
|
+
as: "span",
|
|
174
|
+
disabled: computedDisabled,
|
|
175
|
+
sentiment: "neutral",
|
|
176
|
+
variant: "body",
|
|
177
|
+
children: plan.data[featureKey]
|
|
178
|
+
}
|
|
179
|
+
) : null
|
|
180
|
+
]
|
|
181
|
+
},
|
|
182
|
+
plan.value
|
|
183
|
+
);
|
|
95
184
|
})
|
|
96
185
|
] }, feature.key);
|
|
97
186
|
}) })
|
|
@@ -18,5 +18,5 @@ type StepProps = {
|
|
|
18
18
|
completed: boolean;
|
|
19
19
|
'data-testid'?: string;
|
|
20
20
|
};
|
|
21
|
-
export declare const SteppedList: ({ stepNumber, stepTitle, completed, stepIcon, "data-testid": dataTestId, }: StepProps) => import("
|
|
21
|
+
export declare const SteppedList: ({ stepNumber, stepTitle, completed, stepIcon, "data-testid": dataTestId, }: StepProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from "
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { CheckIcon } from "@ultraviolet/icons";
|
|
4
4
|
import { StepList, Text } from "@ultraviolet/ui";
|
|
5
5
|
import { useContext } from "react";
|
|
@@ -14,7 +14,47 @@ const SteppedList = ({
|
|
|
14
14
|
}) => {
|
|
15
15
|
const containerData = useContext(Data);
|
|
16
16
|
const active = containerData.currentStep === stepNumber;
|
|
17
|
-
return completed ? /* @__PURE__ */ jsx(
|
|
17
|
+
return completed ? /* @__PURE__ */ jsx(
|
|
18
|
+
StepList.Item,
|
|
19
|
+
{
|
|
20
|
+
bulletContent: /* @__PURE__ */ jsx(CheckIcon, {}),
|
|
21
|
+
className: steppedListCardStep,
|
|
22
|
+
"data-testid": dataTestId,
|
|
23
|
+
onClick: () => containerData.setCurrentStep(stepNumber),
|
|
24
|
+
prominence: active ? "strong" : "default",
|
|
25
|
+
sentiment: "primary",
|
|
26
|
+
size: "small",
|
|
27
|
+
children: /* @__PURE__ */ jsx(
|
|
28
|
+
Text,
|
|
29
|
+
{
|
|
30
|
+
as: "h3",
|
|
31
|
+
className: steppedListCardStepTitle,
|
|
32
|
+
variant: active ? "bodyStrong" : "body",
|
|
33
|
+
children: stepTitle
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
) : /* @__PURE__ */ jsx(
|
|
38
|
+
StepList.Item,
|
|
39
|
+
{
|
|
40
|
+
bulletContent: stepIcon ?? String(stepNumber),
|
|
41
|
+
className: steppedListCardStep,
|
|
42
|
+
"data-testid": dataTestId,
|
|
43
|
+
onClick: () => containerData.setCurrentStep(stepNumber),
|
|
44
|
+
prominence: active ? "strong" : void 0,
|
|
45
|
+
sentiment: active ? "primary" : void 0,
|
|
46
|
+
size: "small",
|
|
47
|
+
children: /* @__PURE__ */ jsx(
|
|
48
|
+
Text,
|
|
49
|
+
{
|
|
50
|
+
as: "h3",
|
|
51
|
+
className: steppedListCardStepTitle,
|
|
52
|
+
variant: active ? "bodyStrong" : "body",
|
|
53
|
+
children: stepTitle
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
);
|
|
18
58
|
};
|
|
19
59
|
export {
|
|
20
60
|
SteppedList
|
|
@@ -55,7 +55,7 @@ type SteppedListContainerProps = {
|
|
|
55
55
|
* It can pass prop "nextStep" to its children.
|
|
56
56
|
*/
|
|
57
57
|
declare const SteppedListCard: {
|
|
58
|
-
({ header, showToggleOption, hideTooltipText, hideText, showText, showTooltipText, children, steps, onClickHide, }: SteppedListContainerProps): import("
|
|
58
|
+
({ header, showToggleOption, hideTooltipText, hideText, showText, showTooltipText, children, steps, onClickHide, }: SteppedListContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
59
59
|
Step: ({ subHeader, children, image, stepNumber, completed, style, }: {
|
|
60
60
|
subHeader?: ReactNode;
|
|
61
61
|
children: ((nextStep: (completed?: boolean) => void) => ReactNode) | ReactNode;
|
|
@@ -63,6 +63,6 @@ declare const SteppedListCard: {
|
|
|
63
63
|
stepNumber: number;
|
|
64
64
|
completed?: boolean;
|
|
65
65
|
style?: import("react").CSSProperties;
|
|
66
|
-
}) => import("
|
|
66
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
67
67
|
};
|
|
68
68
|
export { SteppedListCard };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx, jsxs } from "
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Stack, Text, Button, Card, Row, StepList } from "@ultraviolet/ui";
|
|
4
4
|
import { Children, useState, useMemo } from "react";
|
|
5
5
|
import { Data } from "./helper.js";
|
|
@@ -21,15 +21,26 @@ const SteppedListCard = ({
|
|
|
21
21
|
const [currentStep, setCurrentStep] = useState(1);
|
|
22
22
|
const [hidden, setHidden] = useState(false);
|
|
23
23
|
const [done, setDone] = useState(new Array(steps.length).fill(false));
|
|
24
|
-
const values = useMemo(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
const values = useMemo(
|
|
25
|
+
() => ({
|
|
26
|
+
currentStep,
|
|
27
|
+
done,
|
|
28
|
+
numberOfSteps,
|
|
29
|
+
onClickHide,
|
|
30
|
+
setCurrentStep,
|
|
31
|
+
setDone,
|
|
32
|
+
setHidden
|
|
33
|
+
}),
|
|
34
|
+
[
|
|
35
|
+
currentStep,
|
|
36
|
+
setCurrentStep,
|
|
37
|
+
numberOfSteps,
|
|
38
|
+
done,
|
|
39
|
+
setDone,
|
|
40
|
+
setHidden,
|
|
41
|
+
onClickHide
|
|
42
|
+
]
|
|
43
|
+
);
|
|
33
44
|
const onClickHideButton = () => {
|
|
34
45
|
if (onClickHide) {
|
|
35
46
|
onClickHide();
|
|
@@ -38,16 +49,52 @@ const SteppedListCard = ({
|
|
|
38
49
|
}
|
|
39
50
|
};
|
|
40
51
|
return /* @__PURE__ */ jsx(Data.Provider, { value: values, children: /* @__PURE__ */ jsxs(Stack, { gap: 2, width: "100%", children: [
|
|
41
|
-
/* @__PURE__ */ jsxs(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
52
|
+
/* @__PURE__ */ jsxs(
|
|
53
|
+
Stack,
|
|
54
|
+
{
|
|
55
|
+
alignItems: "center",
|
|
56
|
+
direction: "row",
|
|
57
|
+
justifyContent: "space-between",
|
|
58
|
+
children: [
|
|
59
|
+
typeof header === "string" ? /* @__PURE__ */ jsx(Text, { as: "h3", variant: "heading", children: header }) : header,
|
|
60
|
+
showToggleOption ? /* @__PURE__ */ jsx(
|
|
61
|
+
Button,
|
|
62
|
+
{
|
|
63
|
+
className: hideButton,
|
|
64
|
+
onClick: onClickHideButton,
|
|
65
|
+
sentiment: "neutral",
|
|
66
|
+
size: "small",
|
|
67
|
+
tooltip: hidden ? showTooltipText : hideTooltipText,
|
|
68
|
+
variant: "ghost",
|
|
69
|
+
children: hidden ? showText : hideText
|
|
70
|
+
}
|
|
71
|
+
) : null
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
),
|
|
45
75
|
hidden ? null : /* @__PURE__ */ jsx(Card, { className: steppedListCard, children: /* @__PURE__ */ jsxs(Row, { templateColumns: "1fr 3fr", children: [
|
|
46
|
-
/* @__PURE__ */ jsx(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
76
|
+
/* @__PURE__ */ jsx(
|
|
77
|
+
Stack,
|
|
78
|
+
{
|
|
79
|
+
className: steppedListCardWrapper,
|
|
80
|
+
direction: "column",
|
|
81
|
+
gap: 4,
|
|
82
|
+
children: /* @__PURE__ */ jsx(StepList, { children: steps.map((step, index) => {
|
|
83
|
+
const stepTitle = typeof step === "string" ? step : step.title;
|
|
84
|
+
const stepIcon = typeof step === "string" ? void 0 : step.icon;
|
|
85
|
+
return /* @__PURE__ */ jsx(
|
|
86
|
+
SteppedList,
|
|
87
|
+
{
|
|
88
|
+
completed: done[index],
|
|
89
|
+
stepIcon,
|
|
90
|
+
stepNumber: index + 1,
|
|
91
|
+
stepTitle
|
|
92
|
+
},
|
|
93
|
+
stepTitle
|
|
94
|
+
);
|
|
95
|
+
}) })
|
|
96
|
+
}
|
|
97
|
+
),
|
|
51
98
|
children
|
|
52
99
|
] }) })
|
|
53
100
|
] }) });
|
|
@@ -7,5 +7,5 @@ type SteppedListContentProps = {
|
|
|
7
7
|
completed?: boolean;
|
|
8
8
|
style?: CSSProperties;
|
|
9
9
|
};
|
|
10
|
-
export declare const SteppedListContent: ({ subHeader, children, image, stepNumber, completed, style, }: SteppedListContentProps) => import("
|
|
10
|
+
export declare const SteppedListContent: ({ subHeader, children, image, stepNumber, completed, style, }: SteppedListContentProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
11
11
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs, jsx } from "
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
3
|
import { Stack, Text } from "@ultraviolet/ui";
|
|
4
4
|
import { useContext, useEffect } from "react";
|
|
5
5
|
import { Data, nextStep } from "./helper.js";
|
|
@@ -31,16 +31,18 @@ const SteppedListContent = ({
|
|
|
31
31
|
if (stepNumber === currentStep) {
|
|
32
32
|
return /* @__PURE__ */ jsxs(Stack, { className: steppedListCardContent, style, children: [
|
|
33
33
|
/* @__PURE__ */ jsx("div", { className: steppedListCardSubHeader, children: typeof subHeader === "string" ? /* @__PURE__ */ jsx(Text, { as: "h3", variant: "headingSmallStrong", children: subHeader }) : subHeader }),
|
|
34
|
-
typeof children === "function" ? children(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
typeof children === "function" ? children(
|
|
35
|
+
(completedArg) => nextStep({
|
|
36
|
+
completed: completedArg,
|
|
37
|
+
done,
|
|
38
|
+
numberOfSteps,
|
|
39
|
+
onClickHide,
|
|
40
|
+
setCompleted: setDone,
|
|
41
|
+
setCurrentStep,
|
|
42
|
+
setHidden,
|
|
43
|
+
stepNumber
|
|
44
|
+
})
|
|
45
|
+
) : children,
|
|
44
46
|
/* @__PURE__ */ jsx("div", { className: steppedListCardImage, children: image })
|
|
45
47
|
] });
|
|
46
48
|
}
|
|
@@ -23,7 +23,9 @@ const nextStep = ({
|
|
|
23
23
|
onClickHide
|
|
24
24
|
}) => {
|
|
25
25
|
const newValue = completed === void 0 ? done[stepNumber - 1] : completed;
|
|
26
|
-
const tempDone = done.map(
|
|
26
|
+
const tempDone = done.map(
|
|
27
|
+
(item, index) => index === stepNumber - 1 ? newValue : item
|
|
28
|
+
);
|
|
27
29
|
setCompleted(tempDone);
|
|
28
30
|
if (numberOfSteps > stepNumber) {
|
|
29
31
|
setCurrentStep(stepNumber + 1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultraviolet/plus",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.17",
|
|
4
4
|
"description": "Ultraviolet Plus",
|
|
5
5
|
"homepage": "https://github.com/scaleway/ultraviolet#readme",
|
|
6
6
|
"repository": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"react": "18.x || 19.x",
|
|
56
56
|
"react-dom": "18.x || 19.x",
|
|
57
|
-
"@ultraviolet/ui": "3.0.0-beta.
|
|
57
|
+
"@ultraviolet/ui": "3.0.0-beta.28"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@babel/core": "7.28.5",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"react": "19.2.0",
|
|
64
64
|
"react-dom": "19.2.0",
|
|
65
65
|
"@ultraviolet/illustrations": "6.0.0-beta.6",
|
|
66
|
-
"@ultraviolet/ui": "3.0.0-beta.
|
|
66
|
+
"@ultraviolet/ui": "3.0.0-beta.28",
|
|
67
67
|
"@utils/test": "0.0.1"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"@vanilla-extract/recipes": "0.5.7",
|
|
76
76
|
"csstype": "3.1.3",
|
|
77
77
|
"react-intersection-observer": "9.16.0",
|
|
78
|
-
"@ultraviolet/icons": "5.0.0-beta.
|
|
78
|
+
"@ultraviolet/icons": "5.0.0-beta.12",
|
|
79
79
|
"@ultraviolet/themes": "3.0.0-beta.4"
|
|
80
80
|
},
|
|
81
81
|
"scripts": {
|