@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.
- 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/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/ContentCardGroup/styles.css.js +1 -0
- 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 +24 -4
- package/dist/components/InfoTable/components/Row.d.ts +1 -1
- package/dist/components/InfoTable/components/Row.js +16 -10
- package/dist/components/InfoTable/styles.css.d.ts +0 -1
- package/dist/components/InfoTable/styles.css.js +0 -2
- 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/dist/plus.css +1 -1
- package/package.json +6 -6
|
@@ -3,5 +3,5 @@ export declare const ItemContext: import("react").Context<boolean>;
|
|
|
3
3
|
type ItemProviderProps = {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
};
|
|
6
|
-
export declare const ItemProvider: ({ children }: ItemProviderProps) => import("
|
|
6
|
+
export declare const ItemProvider: ({ children }: ItemProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from "
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useMemo } from "react";
|
|
4
4
|
const ItemContext = createContext(false);
|
|
5
|
-
const ItemProvider = ({
|
|
6
|
-
children
|
|
7
|
-
}) => {
|
|
5
|
+
const ItemProvider = ({ children }) => {
|
|
8
6
|
const value = useMemo(() => true, []);
|
|
9
7
|
return /* @__PURE__ */ jsx(ItemContext.Provider, { value, children });
|
|
10
8
|
};
|
|
@@ -19,5 +19,5 @@ type PinnedItemsProps = {
|
|
|
19
19
|
itemWrapper?: (item: ReactElement, itemId: string) => ReactElement;
|
|
20
20
|
style?: CSSProperties;
|
|
21
21
|
};
|
|
22
|
-
export declare const PinnedItems: ({ toggle, onReorder, onToggle, itemWrapper, style, }: PinnedItemsProps) => import("
|
|
22
|
+
export declare const PinnedItems: ({ toggle, onReorder, onToggle, itemWrapper, style, }: PinnedItemsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
23
23
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx, jsxs } from "
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { PinCategoryIcon } from "@ultraviolet/icons/category";
|
|
4
4
|
import { useTheme } from "@ultraviolet/themes";
|
|
5
5
|
import { Text } from "@ultraviolet/ui";
|
|
@@ -16,7 +16,9 @@ const PinnedItems = ({
|
|
|
16
16
|
}) => {
|
|
17
17
|
const context = useNavigation();
|
|
18
18
|
if (!context) {
|
|
19
|
-
throw new Error(
|
|
19
|
+
throw new Error(
|
|
20
|
+
"Navigation.PinnedItems can only be used inside a NavigationProvider."
|
|
21
|
+
);
|
|
20
22
|
}
|
|
21
23
|
const {
|
|
22
24
|
locales,
|
|
@@ -28,24 +30,32 @@ const PinnedItems = ({
|
|
|
28
30
|
animation
|
|
29
31
|
} = context;
|
|
30
32
|
const theme = useTheme();
|
|
31
|
-
const onDrop = useCallback(
|
|
32
|
-
event
|
|
33
|
-
|
|
34
|
-
event
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
const onDrop = useCallback(
|
|
34
|
+
(event, index) => {
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
if (event?.dataTransfer) {
|
|
37
|
+
event.currentTarget.style.borderColor = "transparent";
|
|
38
|
+
const data = JSON.parse(
|
|
39
|
+
event.dataTransfer.getData("text")
|
|
40
|
+
);
|
|
41
|
+
if (data.index === index - 1 || index > data.index) {
|
|
42
|
+
const newItems2 = reorderItems(data.index, index - 1);
|
|
43
|
+
onReorder?.(newItems2);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const newItems = reorderItems(data.index, index);
|
|
47
|
+
onReorder?.(newItems);
|
|
40
48
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
},
|
|
50
|
+
[onReorder, reorderItems]
|
|
51
|
+
);
|
|
52
|
+
const onDragOver = useCallback(
|
|
53
|
+
(event) => {
|
|
54
|
+
event.preventDefault();
|
|
55
|
+
event.currentTarget.style.borderColor = theme.colors.primary.border;
|
|
56
|
+
},
|
|
57
|
+
[theme.colors.primary.border]
|
|
58
|
+
);
|
|
49
59
|
const onDragLeave = useCallback((event) => {
|
|
50
60
|
event.preventDefault();
|
|
51
61
|
event.currentTarget.style.borderColor = "transparent";
|
|
@@ -54,24 +64,68 @@ const PinnedItems = ({
|
|
|
54
64
|
return null;
|
|
55
65
|
}
|
|
56
66
|
if (pinnedFeature) {
|
|
57
|
-
return /* @__PURE__ */ jsx("div", { style: {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
67
|
+
return /* @__PURE__ */ jsx("div", { style: { width: animation ? "100%" : void 0, ...style }, children: /* @__PURE__ */ jsxs(
|
|
68
|
+
Item,
|
|
69
|
+
{
|
|
70
|
+
categoryIcon: /* @__PURE__ */ jsx(PinCategoryIcon, { variant: "neutral" }),
|
|
71
|
+
"data-testid": "pinned-group",
|
|
72
|
+
id: "pinned-group",
|
|
73
|
+
label: locales["navigation.pinned.item.group.label"],
|
|
74
|
+
onToggle,
|
|
75
|
+
toggle,
|
|
76
|
+
type: "pinnedGroup",
|
|
77
|
+
children: [
|
|
78
|
+
pinnedItems.length > 0 ? pinnedItems.map((itemId, index) => {
|
|
79
|
+
if (items[itemId]?.label) {
|
|
80
|
+
const itemElement = /* @__PURE__ */ jsx(
|
|
81
|
+
Item,
|
|
82
|
+
{
|
|
83
|
+
active: items[itemId]?.active ?? false,
|
|
84
|
+
id: itemId,
|
|
85
|
+
index,
|
|
86
|
+
label: items[itemId].label,
|
|
87
|
+
onClickPinUnpin: items[itemId]?.onClickPinUnpin ?? void 0,
|
|
88
|
+
onToggle: items[itemId]?.onToggle,
|
|
89
|
+
toggle,
|
|
90
|
+
type: "pinned"
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
return /* @__PURE__ */ jsxs("div", { className: navigationPinnedItemRelativeDiv, children: [
|
|
94
|
+
/* @__PURE__ */ jsx(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
className: navigationPinnedItemDropableArea,
|
|
98
|
+
onDragLeave,
|
|
99
|
+
onDragOver,
|
|
100
|
+
onDrop: (event) => onDrop(event, index)
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
itemWrapper ? itemWrapper(itemElement, itemId) : itemElement
|
|
104
|
+
] }, itemId);
|
|
105
|
+
}
|
|
106
|
+
return null;
|
|
107
|
+
}) : /* @__PURE__ */ jsx("div", { className: navigationPinnedItemContainer({ expanded }), children: /* @__PURE__ */ jsx(
|
|
108
|
+
Text,
|
|
109
|
+
{
|
|
110
|
+
as: "p",
|
|
111
|
+
prominence: "weak",
|
|
112
|
+
sentiment: "neutral",
|
|
113
|
+
variant: "caption",
|
|
114
|
+
children: locales["navigation.pinned.item.group.empty"]
|
|
115
|
+
}
|
|
116
|
+
) }),
|
|
117
|
+
/* @__PURE__ */ jsx("div", { className: navigationPinnedItemRelativeDiv, children: /* @__PURE__ */ jsx(
|
|
118
|
+
"div",
|
|
119
|
+
{
|
|
120
|
+
className: navigationPinnedItemDropableArea,
|
|
121
|
+
onDragLeave,
|
|
122
|
+
onDragOver,
|
|
123
|
+
onDrop: (event) => onDrop(event, pinnedItems.length)
|
|
124
|
+
}
|
|
125
|
+
) })
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
) });
|
|
75
129
|
}
|
|
76
130
|
return null;
|
|
77
131
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const Separator: () => import("
|
|
1
|
+
export declare const Separator: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from "
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { Separator as Separator$1 } from "@ultraviolet/ui";
|
|
4
4
|
import { navigationSeparator } from "./styles.css.js";
|
|
5
5
|
const Separator = () => /* @__PURE__ */ jsx(Separator$1, { className: navigationSeparator });
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* empty css */
|
|
2
1
|
/* empty css */
|
|
3
2
|
import { createRuntimeFn } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
4
3
|
var navigationStickyFooter = createRuntimeFn({ defaultClassName: "uv_plus_19x50fv0", variantClassNames: { overflow: { false: "uv_plus_19x50fv1" } }, defaultVariants: { overflow: false }, compoundVariants: [] });
|
|
@@ -15,7 +15,7 @@ type OfferListProps = Omit<ComponentProps<typeof List>, 'selectable' | 'onSelect
|
|
|
15
15
|
style?: CSSProperties;
|
|
16
16
|
};
|
|
17
17
|
export declare const OfferList: {
|
|
18
|
-
({ expandable, type, columns, children, loading, autoCollapse, selected, onChangeSelect, className, style, "data-testid": dataTestId, }: OfferListProps): import("
|
|
18
|
+
({ expandable, type, columns, children, loading, autoCollapse, selected, onChangeSelect, className, style, "data-testid": dataTestId, }: OfferListProps): import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
Row: ({ children, disabled, id, banner, expandablePadding, offerName, expandable: expandableContent, selectDisabled, highlightAnimation, expanded, className, "data-dragging": dataDragging, "data-testid": dataTestId, style, badge, }: {
|
|
20
20
|
children: import("react").ReactNode;
|
|
21
21
|
id: string;
|
|
@@ -44,7 +44,7 @@ export declare const OfferList: {
|
|
|
44
44
|
prominence?: ComponentProps<typeof import("@ultraviolet/ui").Badge>["prominence"];
|
|
45
45
|
};
|
|
46
46
|
style?: CSSProperties;
|
|
47
|
-
}) => import("
|
|
48
|
-
Cell: ({ children, className, "data-testid": dataTestId, colSpan, style, }: ComponentProps<typeof List.Cell>) => import("
|
|
47
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
Cell: ({ children, className, "data-testid": dataTestId, colSpan, style, }: ComponentProps<typeof List.Cell>) => import("react/jsx-runtime").JSX.Element;
|
|
49
49
|
};
|
|
50
50
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from "
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { List } from "@ultraviolet/ui";
|
|
4
4
|
import { useState, useEffect } from "react";
|
|
5
5
|
import { Cell } from "./components/Cell.js";
|
|
@@ -19,13 +19,19 @@ const OfferList = ({
|
|
|
19
19
|
style,
|
|
20
20
|
"data-testid": dataTestId
|
|
21
21
|
}) => {
|
|
22
|
-
const [radioSelectedRow, setRadioSelectedRow] = useState(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
const [radioSelectedRow, setRadioSelectedRow] = useState(
|
|
23
|
+
typeof selected === "string" ? selected : void 0
|
|
24
|
+
);
|
|
25
|
+
const [checkboxSelectedRows, setCheckboxSelectedRows] = useState(
|
|
26
|
+
Array.isArray(selected) ? selected : []
|
|
27
|
+
);
|
|
28
|
+
const computedColumns = [
|
|
29
|
+
{
|
|
30
|
+
label: ""
|
|
31
|
+
},
|
|
32
|
+
expandable ? { label: "" } : null,
|
|
33
|
+
...columns
|
|
34
|
+
].filter((element) => !!element);
|
|
29
35
|
useEffect(() => {
|
|
30
36
|
if (selected) {
|
|
31
37
|
if (typeof selected === "string" && type === "radio") {
|
|
@@ -36,7 +42,33 @@ const OfferList = ({
|
|
|
36
42
|
}
|
|
37
43
|
}
|
|
38
44
|
}, [type, selected]);
|
|
39
|
-
return /* @__PURE__ */ jsx(
|
|
45
|
+
return /* @__PURE__ */ jsx(
|
|
46
|
+
OfferListProvider,
|
|
47
|
+
{
|
|
48
|
+
autoCollapse,
|
|
49
|
+
checkboxSelectedRows,
|
|
50
|
+
expandable,
|
|
51
|
+
loading,
|
|
52
|
+
onChangeSelect,
|
|
53
|
+
radioSelectedRow,
|
|
54
|
+
selectable: type,
|
|
55
|
+
setCheckboxSelectedRows,
|
|
56
|
+
setRadioSelectedRow,
|
|
57
|
+
children: /* @__PURE__ */ jsx(
|
|
58
|
+
List,
|
|
59
|
+
{
|
|
60
|
+
autoCollapse,
|
|
61
|
+
className: `${className ? `${className} ` : ""}${offerList}`,
|
|
62
|
+
columns: computedColumns,
|
|
63
|
+
"data-testid": dataTestId,
|
|
64
|
+
expandable: false,
|
|
65
|
+
selectable: false,
|
|
66
|
+
style,
|
|
67
|
+
children
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
);
|
|
40
72
|
};
|
|
41
73
|
OfferList.Row = Row;
|
|
42
74
|
OfferList.Cell = Cell;
|
|
@@ -24,6 +24,6 @@ type OfferListProviderProps = {
|
|
|
24
24
|
checkboxSelectedRows: string[];
|
|
25
25
|
setCheckboxSelectedRows: Dispatch<SetStateAction<string[]>>;
|
|
26
26
|
};
|
|
27
|
-
export declare const OfferListProvider: ({ selectable, children, expandable, disabled, loading, onChangeSelect, autoCollapse, radioSelectedRow, setRadioSelectedRow, checkboxSelectedRows, setCheckboxSelectedRows, }: OfferListProviderProps) => import("
|
|
27
|
+
export declare const OfferListProvider: ({ selectable, children, expandable, disabled, loading, onChangeSelect, autoCollapse, radioSelectedRow, setRadioSelectedRow, checkboxSelectedRows, setCheckboxSelectedRows, }: OfferListProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
28
|
export declare const useOfferListContext: () => OfferListContextValue;
|
|
29
29
|
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { jsx } from "
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, useContext } from "react";
|
|
3
|
-
const OfferListContext = createContext(
|
|
3
|
+
const OfferListContext = createContext(
|
|
4
|
+
void 0
|
|
5
|
+
);
|
|
4
6
|
const OfferListProvider = ({
|
|
5
7
|
selectable,
|
|
6
8
|
children,
|
|
@@ -13,22 +15,30 @@ const OfferListProvider = ({
|
|
|
13
15
|
setRadioSelectedRow,
|
|
14
16
|
checkboxSelectedRows,
|
|
15
17
|
setCheckboxSelectedRows
|
|
16
|
-
}) => /* @__PURE__ */ jsx(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
}) => /* @__PURE__ */ jsx(
|
|
19
|
+
OfferListContext.Provider,
|
|
20
|
+
{
|
|
21
|
+
value: {
|
|
22
|
+
autoCollapse,
|
|
23
|
+
checkboxSelectedRows,
|
|
24
|
+
disabled,
|
|
25
|
+
expandable,
|
|
26
|
+
loading,
|
|
27
|
+
onChangeSelect,
|
|
28
|
+
radioSelectedRow,
|
|
29
|
+
selectable,
|
|
30
|
+
setCheckboxSelectedRows,
|
|
31
|
+
setRadioSelectedRow
|
|
32
|
+
},
|
|
33
|
+
children
|
|
34
|
+
}
|
|
35
|
+
);
|
|
28
36
|
const useOfferListContext = () => {
|
|
29
37
|
const context = useContext(OfferListContext);
|
|
30
38
|
if (!context) {
|
|
31
|
-
throw new Error(
|
|
39
|
+
throw new Error(
|
|
40
|
+
"useOfferListContext should be used inside a OfferList component"
|
|
41
|
+
);
|
|
32
42
|
}
|
|
33
43
|
return context;
|
|
34
44
|
};
|
|
@@ -8,5 +8,5 @@ type BannerProps = {
|
|
|
8
8
|
type?: 'cell' | 'div';
|
|
9
9
|
shouldHavePrimaryBorder?: boolean;
|
|
10
10
|
};
|
|
11
|
-
export declare const Banner: ({ children, sentiment, disabled, colSpan, type, shouldHavePrimaryBorder, }: BannerProps) => import("
|
|
11
|
+
export declare const Banner: ({ children, sentiment, disabled, colSpan, type, shouldHavePrimaryBorder, }: BannerProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from "
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { Stack, Text, List } from "@ultraviolet/ui";
|
|
4
4
|
import { offerListBannerStack, offerListBanner, offerListBannerCell, offerListBannerText } from "../styles.css.js";
|
|
5
5
|
const Banner = ({
|
|
@@ -9,13 +9,35 @@ const Banner = ({
|
|
|
9
9
|
colSpan = 1e3,
|
|
10
10
|
type = "div",
|
|
11
11
|
shouldHavePrimaryBorder
|
|
12
|
-
}) => type === "div" ? /* @__PURE__ */ jsx(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
12
|
+
}) => type === "div" ? /* @__PURE__ */ jsx(
|
|
13
|
+
Stack,
|
|
14
|
+
{
|
|
15
|
+
"aria-disabled": disabled,
|
|
16
|
+
className: offerListBannerStack({ sentiment }),
|
|
17
|
+
children: /* @__PURE__ */ jsx(Text, { as: "p", disabled, sentiment, variant: "caption", children })
|
|
18
|
+
}
|
|
19
|
+
) : /* @__PURE__ */ jsx("tr", { className: offerListBanner, children: /* @__PURE__ */ jsx(
|
|
20
|
+
List.Cell,
|
|
21
|
+
{
|
|
22
|
+
"aria-disabled": disabled,
|
|
23
|
+
className: offerListBannerCell,
|
|
24
|
+
colSpan,
|
|
25
|
+
children: /* @__PURE__ */ jsx(
|
|
26
|
+
Text,
|
|
27
|
+
{
|
|
28
|
+
as: "p",
|
|
29
|
+
className: offerListBannerText({
|
|
30
|
+
disabled,
|
|
31
|
+
primaryBorder: shouldHavePrimaryBorder,
|
|
32
|
+
sentiment
|
|
33
|
+
}),
|
|
34
|
+
disabled,
|
|
35
|
+
variant: "caption",
|
|
36
|
+
children
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
) });
|
|
19
41
|
export {
|
|
20
42
|
Banner
|
|
21
43
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { List } from '@ultraviolet/ui';
|
|
2
2
|
import type { ComponentProps } from 'react';
|
|
3
|
-
export declare const Cell: ({ children, className, "data-testid": dataTestId, colSpan, style, }: ComponentProps<typeof List.Cell>) => import("
|
|
3
|
+
export declare const Cell: ({ children, className, "data-testid": dataTestId, colSpan, style, }: ComponentProps<typeof List.Cell>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from "
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { List, Skeleton } from "@ultraviolet/ui";
|
|
4
4
|
import { useOfferListContext } from "../OfferListProvider.js";
|
|
5
5
|
import { offerListLoadingCell, offerListCell } from "../styles.css.js";
|
|
@@ -10,10 +10,17 @@ const Cell = ({
|
|
|
10
10
|
colSpan,
|
|
11
11
|
style
|
|
12
12
|
}) => {
|
|
13
|
-
const {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
const { loading } = useOfferListContext();
|
|
14
|
+
return loading ? /* @__PURE__ */ jsx(List.Cell, { className: offerListLoadingCell, style, children: /* @__PURE__ */ jsx(Skeleton, { "data-state": loading, variant: "line" }) }) : /* @__PURE__ */ jsx(
|
|
15
|
+
List.Cell,
|
|
16
|
+
{
|
|
17
|
+
className: `${className ? `${className} ` : ""}${offerListCell}`,
|
|
18
|
+
colSpan,
|
|
19
|
+
"data-testid": dataTestId,
|
|
20
|
+
style,
|
|
21
|
+
children
|
|
22
|
+
}
|
|
23
|
+
);
|
|
17
24
|
};
|
|
18
25
|
export {
|
|
19
26
|
Cell
|
|
@@ -13,5 +13,5 @@ type RowProps = ComponentProps<typeof List.Row> & {
|
|
|
13
13
|
};
|
|
14
14
|
style?: CSSProperties;
|
|
15
15
|
};
|
|
16
|
-
export declare const Row: ({ children, disabled, id, banner, expandablePadding, offerName, expandable: expandableContent, selectDisabled, highlightAnimation, expanded, className, "data-dragging": dataDragging, "data-testid": dataTestId, style, badge, }: RowProps) => import("
|
|
16
|
+
export declare const Row: ({ children, disabled, id, banner, expandablePadding, offerName, expandable: expandableContent, selectDisabled, highlightAnimation, expanded, className, "data-dragging": dataDragging, "data-testid": dataTestId, style, badge, }: RowProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
export {};
|