@arc-ui/community-components 3.15.0 → 3.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +14 -14
- package/CHANGELOG.md +27 -0
- package/lib/ArticleCarousel/ArticleCarousel.cjs +1 -1
- package/lib/ArticleCarousel/ArticleCarousel.mjs +1 -1
- package/lib/ComparisonTable/ComparisonTable.cjs +317 -0
- package/lib/ComparisonTable/ComparisonTable.mjs +310 -0
- package/lib/ComparisonTable/styles.css +1 -0
- package/lib/CopyLead/CopyLead.cjs +1 -1
- package/lib/CopyLead/CopyLead.mjs +1 -1
- package/lib/FeaturePost/FeaturePost.cjs +13 -12
- package/lib/FeaturePost/FeaturePost.mjs +13 -12
- package/lib/FeaturePost/styles.css +1 -1
- package/lib/Highlights/Highlights.cjs +7 -7
- package/lib/Highlights/Highlights.mjs +7 -7
- package/lib/ProductCard/ProductCard.cjs +13 -35
- package/lib/ProductCard/ProductCard.mjs +12 -34
- package/lib/ProductNavigation/ProductNavigation.cjs +1 -1
- package/lib/ProductNavigation/ProductNavigation.mjs +1 -1
- package/lib/PromoListing/PromoListing.cjs +1 -1
- package/lib/PromoListing/PromoListing.mjs +1 -1
- package/lib/Summary/Summary.cjs +1 -1
- package/lib/Summary/Summary.mjs +1 -1
- package/lib/_shared/cjs/ProductCardPriceIncrease-BP39clav.cjs +38 -0
- package/lib/_shared/cjs/{index.es-C-y6aRIY.cjs → index.es-oEhoU2Bd.cjs} +1 -1
- package/lib/_shared/esm/ProductCardPriceIncrease-CJyG2wv-.mjs +35 -0
- package/lib/_shared/esm/{index.es-YxZ1vAot.mjs → index.es-DujqqZXe.mjs} +1 -1
- package/lib/index.cjs +508 -200
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +213 -22
- package/lib/index.d.mts +213 -22
- package/lib/index.mjs +503 -201
- package/lib/index.mjs.map +1 -1
- package/lib/styles.css +1 -1
- package/package.json +16 -16
- package/src/components/ComparisonTable/ComparisonTable.module.css +503 -0
- package/src/components/ComparisonTable/ComparisonTable.tsx +104 -0
- package/src/components/ComparisonTable/components/Cell/Cell.tsx +44 -0
- package/src/components/ComparisonTable/components/ControlCell/ControlCell.tsx +21 -0
- package/src/components/ComparisonTable/components/DesktopRow/DesktopRow.tsx +59 -0
- package/src/components/ComparisonTable/components/DesktopTable/DesktopTable.tsx +150 -0
- package/src/components/ComparisonTable/components/FeatureCell/FeatureCell.module.css +56 -0
- package/src/components/ComparisonTable/components/FeatureCell/FeatureCell.tsx +96 -0
- package/src/components/ComparisonTable/components/HeaderCell/HeaderCell.tsx +59 -0
- package/src/components/ComparisonTable/components/MobileRow/MobileRow.tsx +77 -0
- package/src/components/ComparisonTable/components/MobileTable/MobileTable.tsx +103 -0
- package/src/components/ComparisonTable/components/Section/Section.tsx +75 -0
- package/src/components/ComparisonTable/components/SectionToggle/SectionToggle.tsx +63 -0
- package/src/components/ComparisonTable/components/SubHeaderCell/SubHeaderCell.tsx +62 -0
- package/src/components/ComparisonTable/index.ts +22 -0
- package/src/components/ComparisonTable/types/comparison-column.ts +22 -0
- package/src/components/ComparisonTable/types/comparison-row.ts +23 -0
- package/src/components/ComparisonTable/types/comparison-section.ts +39 -0
- package/src/components/ComparisonTable/types/comparison-sub-row.ts +8 -0
- package/src/components/ComparisonTable/utils/group-rows.ts +69 -0
- package/src/components/ComparisonTable/utils/use-section-state.ts +45 -0
- package/src/components/FeaturePost/FeaturePost.module.css +24 -2
- package/src/components/FeaturePost/FeaturePost.tsx +26 -25
- package/src/components/FeaturePost/types/feature-post-cta-footer.ts +4 -3
- package/src/components/Highlights/Highlights.tsx +5 -32
- package/src/components/ProductCard/ProductCard.tsx +14 -14
- package/src/components/ProductCard/ProductCardPrice/ProductCardPrice.tsx +11 -3
- package/src/components/ProductCard/ProductCardPriceIncrease/ProductCardPriceIncrease.module.css +1 -2
- package/src/components/ProductCard/ProductCardPriceIncrease/ProductCardPriceIncrease.tsx +14 -3
- package/src/components/ProductCardGrid/ProductCardGrid.tsx +8 -8
- package/src/components/ProductCardGrid/components/CardGrid/CardGrid.tsx +6 -6
- package/src/components/index.ts +1 -0
- package/versions.json +1 -1
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import { _ as __rest, a as __assign } from '../_shared/esm/tslib.es6-BVXMhEem.mjs';
|
|
2
|
+
import React__default, { useState, useCallback, useId } from 'react';
|
|
3
|
+
import { c as classNames } from '../_shared/esm/index-BSO2EFem.mjs';
|
|
4
|
+
import { f as filterAttrs } from '../_shared/esm/filter-attrs-DZ7RCEZm.mjs';
|
|
5
|
+
import { Heading } from '@arc-ui/components/Heading';
|
|
6
|
+
import { Surface } from '@arc-ui/components/Surface';
|
|
7
|
+
import { Text } from '@arc-ui/components/Text';
|
|
8
|
+
import { VisuallyHidden } from '@arc-ui/components/VisuallyHidden';
|
|
9
|
+
import { Icon } from '@arc-ui/components/Icon';
|
|
10
|
+
import { Popover } from '@arc-ui/components/Popover';
|
|
11
|
+
import { ButtonV2 } from '@arc-ui/components/ButtonV2';
|
|
12
|
+
import { VerticalSpace } from '@arc-ui/components/VerticalSpace';
|
|
13
|
+
import { a as ProductCardPrice, P as ProductCardPriceIncrease } from '../_shared/esm/ProductCardPriceIncrease-CJyG2wv-.mjs';
|
|
14
|
+
|
|
15
|
+
var styles$1 = {"wrapper":"ComparisonTable-module_wrapper__SSvrL","wrapperBordered":"ComparisonTable-module_wrapperBordered__kQeRo","shadowOverlay":"ComparisonTable-module_shadowOverlay__unZ3Q","table":"ComparisonTable-module_table__iU0Zl","desktopTable":"ComparisonTable-module_desktopTable__IwkOh","headerRow":"ComparisonTable-module_headerRow__BCw20","subHeaderRow":"ComparisonTable-module_subHeaderRow__h-S8Y","row":"ComparisonTable-module_row__VMAyW","headerCell":"ComparisonTable-module_headerCell__4bhwd","headerCellPromoted":"ComparisonTable-module_headerCellPromoted__4oIRU","highlightedTop":"ComparisonTable-module_highlightedTop__pKNy8","stickyHeader":"ComparisonTable-module_stickyHeader__MJLxP","subHeaderCell":"ComparisonTable-module_subHeaderCell__12J6c","rowGroup":"ComparisonTable-module_rowGroup__YuAHE","featureRow":"ComparisonTable-module_featureRow__hSa-p","featureRowHeader":"ComparisonTable-module_featureRowHeader__YB-eY","cell":"ComparisonTable-module_cell__lWOm3","featureRowHeaderContent":"ComparisonTable-module_featureRowHeaderContent__XmzGi","controlRow":"ComparisonTable-module_controlRow__Lf01P","controlCell":"ComparisonTable-module_controlCell__uauzO","controlCellContent":"ComparisonTable-module_controlCellContent__welDu","highlighted":"ComparisonTable-module_highlighted__WLAu4","highlightedBottom":"ComparisonTable-module_highlightedBottom__7PPJO","mobileLayout":"ComparisonTable-module_mobileLayout__GkFfO","desktopLayout":"ComparisonTable-module_desktopLayout__k3qMZ","desktopTableSticky":"ComparisonTable-module_desktopTableSticky__GflmR","desktopHeaderRow":"ComparisonTable-module_desktopHeaderRow__BmfJz","desktopSubHeaderRow":"ComparisonTable-module_desktopSubHeaderRow__4KeVU","desktopRow":"ComparisonTable-module_desktopRow__XrYwQ","desktopFeatureHeader":"ComparisonTable-module_desktopFeatureHeader__M5Aa-","desktopHeaderCell":"ComparisonTable-module_desktopHeaderCell__fEYWe","desktopControlsCell":"ComparisonTable-module_desktopControlsCell__5fjOI","desktopFeatureCell":"ComparisonTable-module_desktopFeatureCell__i5MiH","sectionToggleRow":"ComparisonTable-module_sectionToggleRow__XDwt4","sectionToggle":"ComparisonTable-module_sectionToggle__GR-Xz","sectionContent":"ComparisonTable-module_sectionContent__GuogA","sectionToggleContent":"ComparisonTable-module_sectionToggleContent__p0ouX","sectionToggleOpen":"ComparisonTable-module_sectionToggleOpen__ZFdLO","sectionChevron":"ComparisonTable-module_sectionChevron__0kmLs","sectionChevronOpen":"ComparisonTable-module_sectionChevronOpen__m7jv0","isLastRow":"ComparisonTable-module_isLastRow__coPlk"};
|
|
16
|
+
|
|
17
|
+
var HeaderCell = function (_a) {
|
|
18
|
+
var _b;
|
|
19
|
+
var children = _a.children, _c = _a.columnIndex, columnIndex = _c === void 0 ? 0 : _c, promoted = _a.promoted, props = __rest(_a, ["children", "columnIndex", "promoted"]);
|
|
20
|
+
return (React__default.createElement("div", __assign({ role: "columnheader", className: classNames(styles$1.headerCell, (_b = {},
|
|
21
|
+
_b[styles$1.highlighted] = columnIndex % 2 === 0,
|
|
22
|
+
_b[styles$1.highlightedTop] = columnIndex % 2 === 0,
|
|
23
|
+
_b)) }, filterAttrs(props)),
|
|
24
|
+
promoted && (React__default.createElement("div", { className: styles$1.headerCellPromoted },
|
|
25
|
+
React__default.createElement(Surface, { background: "dark-brand-01", paddingVertical: "16", paddingHorizontal: "24" },
|
|
26
|
+
React__default.createElement(VisuallyHidden, null, "Promotional offer. "),
|
|
27
|
+
React__default.createElement(Text, { size: "s" }, promoted)))),
|
|
28
|
+
children != null && (React__default.createElement(Heading, { size: "m", isWordWrap: true }, children))));
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var ControlCell = function (_a) {
|
|
32
|
+
var children = _a.children, props = __rest(_a, ["children"]);
|
|
33
|
+
return (React__default.createElement("div", __assign({ role: "cell", className: styles$1.controlCell }, filterAttrs(props)),
|
|
34
|
+
React__default.createElement("div", { className: styles$1.controlCellContent }, children)));
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
var Cell = function (_a) {
|
|
38
|
+
var _b;
|
|
39
|
+
var children = _a.children, _c = _a.columnIndex, columnIndex = _c === void 0 ? 0 : _c, _d = _a.isLastRow, isLastRow = _d === void 0 ? false : _d, props = __rest(_a, ["children", "columnIndex", "isLastRow"]);
|
|
40
|
+
var isHighlighted = columnIndex % 2 === 0;
|
|
41
|
+
return (React__default.createElement("div", __assign({ role: "cell", className: classNames(styles$1.cell, (_b = {},
|
|
42
|
+
_b[styles$1.highlighted] = isHighlighted,
|
|
43
|
+
_b[styles$1.highlightedBottom] = isHighlighted && isLastRow,
|
|
44
|
+
_b)) }, filterAttrs(props)),
|
|
45
|
+
React__default.createElement(Text, null, children)));
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Do not edit directly
|
|
50
|
+
* Generated file
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
const BtIconInfo =
|
|
54
|
+
"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3e%3cpath d='M16 2a14 14 0 1 0 14 14A14 14 0 0 0 16 2m0 27a13 13 0 1 1 13-13 13.015 13.015 0 0 1-13 13'/%3e%3cpath d='M16 8.993a1 1 0 1 0 0 2 1 1 0 1 0 0-2M15.995 12.977a.5.5 0 0 0-.5.5l-.002 9.01a.5.5 0 0 0 1 0l.002-9.01a.5.5 0 0 0-.5-.5'/%3e%3c/svg%3e";
|
|
55
|
+
|
|
56
|
+
var styles = {"packageCell":"FeatureCell-module_packageCell__H7UPQ","packageCellPopoverDesktop":"FeatureCell-module_packageCellPopoverDesktop__AHGzm","packageCellTitle":"FeatureCell-module_packageCellTitle__747D6","packageCellHeading":"FeatureCell-module_packageCellHeading__YxXWC","packageCellPopoverMobile":"FeatureCell-module_packageCellPopoverMobile__JEZXA"};
|
|
57
|
+
|
|
58
|
+
var FeatureCell = function (_a) {
|
|
59
|
+
var icon = _a.icon, title = _a.title, description = _a.description, popoverContent = _a.popoverContent;
|
|
60
|
+
return (React__default.createElement("div", { className: styles.packageCell },
|
|
61
|
+
React__default.createElement("div", { className: styles.packageCellTitle },
|
|
62
|
+
React__default.createElement("div", { style: { width: 32 } },
|
|
63
|
+
React__default.createElement(Icon, { icon: icon, size: 32, color: "brand" })),
|
|
64
|
+
React__default.createElement("div", { className: styles.packageCellText },
|
|
65
|
+
React__default.createElement("div", { className: styles.packageCellHeading },
|
|
66
|
+
React__default.createElement(Heading, { size: "xs", isWordWrap: true }, title),
|
|
67
|
+
popoverContent && (React__default.createElement("div", { className: styles.packageCellPopoverMobile },
|
|
68
|
+
React__default.createElement(Popover, { arrow: true, background: "white", constrainToViewport: true, content: React__default.createElement(Text, null, popoverContent), maxWidth: 300, side: "top" },
|
|
69
|
+
React__default.createElement(Icon, { icon: BtIconInfo, size: 16, color: "brand", label: "More information about ".concat(title) })))),
|
|
70
|
+
" "),
|
|
71
|
+
description && (React__default.createElement(Text, { size: "xs", tone: "muted" }, description)))),
|
|
72
|
+
popoverContent && (React__default.createElement("div", { className: styles.packageCellPopoverDesktop },
|
|
73
|
+
React__default.createElement(Popover, { arrow: true, background: "white", constrainToViewport: true, content: React__default.createElement(Text, null, popoverContent), side: "bottom", align: "start" },
|
|
74
|
+
React__default.createElement(Icon, { icon: BtIconInfo, size: 16, color: "brand", label: "More information about ".concat(title) }))))));
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Renders a single content row of cells for the mobile layout.
|
|
79
|
+
*/
|
|
80
|
+
var renderRow = function (cells, key, isLastRow) { return (React__default.createElement("div", { key: key, className: styles$1.row }, cells.map(function (cell, index) { return (React__default.createElement(Cell, { key: "cell-".concat(index), columnIndex: index, isLastRow: isLastRow }, cell)); }))); };
|
|
81
|
+
var MobileRow = function (_a) {
|
|
82
|
+
var _b;
|
|
83
|
+
var _c;
|
|
84
|
+
var row = _a.row, _d = _a.isLastGroup, isLastGroup = _d === void 0 ? false : _d, props = __rest(_a, ["row", "isLastGroup"]);
|
|
85
|
+
var subRows = (_c = row.subRows) !== null && _c !== void 0 ? _c : [];
|
|
86
|
+
var hasSubRows = subRows.length > 0;
|
|
87
|
+
return (React__default.createElement("div", __assign({ role: "row", className: classNames(styles$1.rowGroup, (_b = {},
|
|
88
|
+
_b[styles$1.isLastRow] = isLastGroup,
|
|
89
|
+
_b)) }, filterAttrs(props)),
|
|
90
|
+
React__default.createElement("div", { className: styles$1.featureRow },
|
|
91
|
+
React__default.createElement("div", { role: "rowheader", className: styles$1.featureRowHeader },
|
|
92
|
+
React__default.createElement("div", { className: styles$1.featureRowHeaderContent },
|
|
93
|
+
React__default.createElement(FeatureCell, { icon: row.feature.icon, title: row.feature.title, description: row.feature.description, popoverContent: row.feature.popoverContent })))),
|
|
94
|
+
renderRow(row.cells, "primary-row", isLastGroup && !hasSubRows),
|
|
95
|
+
subRows.map(function (subRow, index) {
|
|
96
|
+
return renderRow(subRow.cells, "row-".concat(index), isLastGroup && index === subRows.length - 1);
|
|
97
|
+
})));
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Do not edit directly
|
|
102
|
+
* Generated file
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
const BtIconChevronDownMid =
|
|
106
|
+
"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3e%3cpath fill='currentColor' d='m16 18.09 5.704-5.696a1.347 1.347 0 0 1 2.296.949 1.34 1.34 0 0 1-.393.95L16.95 20.94a1.347 1.347 0 0 1-1.902 0l-6.656-6.648A1.342 1.342 0 0 1 9.345 12c.356 0 .699.142.951.393z'/%3e%3c/svg%3e";
|
|
107
|
+
|
|
108
|
+
var SectionToggle = function (_a) {
|
|
109
|
+
var _b, _c;
|
|
110
|
+
var heading = _a.heading, _d = _a.headingLevel, headingLevel = _d === void 0 ? "3" : _d, isOpen = _a.isOpen, onToggle = _a.onToggle, controlsId = _a.controlsId;
|
|
111
|
+
return (React__default.createElement("button", { type: "button", className: classNames(styles$1.sectionToggle, (_b = {},
|
|
112
|
+
_b[styles$1.sectionToggleOpen] = isOpen,
|
|
113
|
+
_b)), "aria-expanded": isOpen, "aria-controls": controlsId, onClick: onToggle },
|
|
114
|
+
React__default.createElement("span", { className: styles$1.sectionToggleContent },
|
|
115
|
+
React__default.createElement(Heading, { level: headingLevel, size: "s" }, heading),
|
|
116
|
+
React__default.createElement("span", { className: classNames(styles$1.sectionChevron, (_c = {},
|
|
117
|
+
_c[styles$1.sectionChevronOpen] = isOpen,
|
|
118
|
+
_c)), "aria-hidden": "true" },
|
|
119
|
+
React__default.createElement(Icon, { icon: BtIconChevronDownMid, size: 24 })))));
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Optional-controlled open state for a section. When `open` is provided the
|
|
124
|
+
* section is controlled and the internal state is ignored; otherwise the hook
|
|
125
|
+
* manages its own state seeded by `defaultOpen`. `onOpenChange` is always
|
|
126
|
+
* called with the next value when `toggle` runs.
|
|
127
|
+
*/
|
|
128
|
+
var useSectionState = function (_a) {
|
|
129
|
+
var _b = _a.defaultOpen, defaultOpen = _b === void 0 ? false : _b, open = _a.open, onOpenChange = _a.onOpenChange;
|
|
130
|
+
var _c = useState(defaultOpen), internalOpen = _c[0], setInternalOpen = _c[1];
|
|
131
|
+
var isControlled = open !== undefined;
|
|
132
|
+
var isOpen = isControlled ? open : internalOpen;
|
|
133
|
+
var toggle = useCallback(function () {
|
|
134
|
+
var next = !isOpen;
|
|
135
|
+
if (!isControlled) {
|
|
136
|
+
setInternalOpen(next);
|
|
137
|
+
}
|
|
138
|
+
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(next);
|
|
139
|
+
}, [isControlled, isOpen, onOpenChange]);
|
|
140
|
+
return { isOpen: isOpen, toggle: toggle };
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
var Section = function (_a) {
|
|
144
|
+
var _b;
|
|
145
|
+
var section = _a.section, isLastSection = _a.isLastSection, renderRow = _a.renderRow;
|
|
146
|
+
var regionId = useId();
|
|
147
|
+
var _c = useSectionState({
|
|
148
|
+
defaultOpen: section.defaultOpen,
|
|
149
|
+
open: section.open,
|
|
150
|
+
onOpenChange: section.onOpenChange,
|
|
151
|
+
}), isOpen = _c.isOpen, toggle = _c.toggle;
|
|
152
|
+
var lastRowIndex = section.rows.length - 1;
|
|
153
|
+
return (React__default.createElement("div", { role: "rowgroup" },
|
|
154
|
+
React__default.createElement("div", { role: "row", className: classNames(styles$1.sectionToggleRow, (_b = {},
|
|
155
|
+
_b[styles$1.isLastRow] = isLastSection === true && !isOpen,
|
|
156
|
+
_b)) },
|
|
157
|
+
React__default.createElement(SectionToggle, { heading: section.heading, headingLevel: section.headingLevel, isOpen: isOpen, onToggle: toggle, controlsId: regionId })),
|
|
158
|
+
isOpen && (React__default.createElement("div", { id: regionId, className: styles$1.sectionContent }, section.rows.map(function (row, index) {
|
|
159
|
+
return renderRow(row, index, isLastSection === true && index === lastRowIndex);
|
|
160
|
+
})))));
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
var SubHeaderCell = function (_a) {
|
|
164
|
+
var _b;
|
|
165
|
+
var price = _a.price, priceIncrease = _a.priceIncrease, button = _a.button, _c = _a.columnIndex, columnIndex = _c === void 0 ? 0 : _c, props = __rest(_a, ["price", "priceIncrease", "button", "columnIndex"]);
|
|
166
|
+
return (React__default.createElement("div", __assign({ role: "cell", className: classNames(styles$1.subHeaderCell, (_b = {},
|
|
167
|
+
_b[styles$1.highlighted] = columnIndex % 2 === 0,
|
|
168
|
+
_b)) }, filterAttrs(props)),
|
|
169
|
+
React__default.createElement(ProductCardPrice, __assign({}, price)),
|
|
170
|
+
priceIncrease && (React__default.createElement(ProductCardPriceIncrease, __assign({ heading: "Increasing to:", hideBorder: true }, priceIncrease))),
|
|
171
|
+
React__default.createElement(VerticalSpace, null),
|
|
172
|
+
button && React__default.createElement(ButtonV2, __assign({ isFullWidth: true }, button))));
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
var MobileTable = function (_a) {
|
|
176
|
+
var columns = _a.columns, rows = _a.rows, sections = _a.sections, controls = _a.controls, className = _a.className;
|
|
177
|
+
return (React__default.createElement("div", { role: "table", className: classNames(styles$1.table, className), style: { "--comparison-columns": columns.length } },
|
|
178
|
+
React__default.createElement("div", { role: "row", className: styles$1.headerRow }, columns.map(function (column, index) { return (React__default.createElement(HeaderCell, { key: column.id, columnIndex: index, promoted: column.promoted }, column.label)); })),
|
|
179
|
+
controls && (React__default.createElement("div", { role: "row", className: styles$1.controlRow, "aria-label": "comparison table controls" },
|
|
180
|
+
React__default.createElement(ControlCell, null, controls))),
|
|
181
|
+
columns.some(function (column) { return column.subheader; }) && (React__default.createElement("div", { role: "row", className: styles$1.subHeaderRow }, columns.map(function (column, index) {
|
|
182
|
+
var _a;
|
|
183
|
+
return (React__default.createElement(SubHeaderCell, __assign({ key: column.id, columnIndex: index }, ((_a = column.subheader) !== null && _a !== void 0 ? _a : { price: { value: "" } }))));
|
|
184
|
+
}))),
|
|
185
|
+
rows.map(function (row, index) { return (React__default.createElement(MobileRow, { key: "row-group-".concat(index), row: row, isLastGroup: sections.length === 0 && index === rows.length - 1 })); }),
|
|
186
|
+
sections.map(function (section, index) { return (React__default.createElement(Section, { key: section.id, section: section, isLastSection: index === sections.length - 1, renderRow: function (row, rowIndex, isLast) { return (React__default.createElement(MobileRow, { key: "section-group-".concat(rowIndex), row: row, isLastGroup: isLast })); } })); })));
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* The same plans are highlighted in both layouts: plan index 0, 2, 4, ... (the
|
|
191
|
+
* 1st, 3rd, 5th plan). On desktop the leading feature column shifts these into
|
|
192
|
+
* the 2nd, 4th, ... visual grid columns, but it's the same plan as on mobile.
|
|
193
|
+
*/
|
|
194
|
+
var isPlanHighlighted$1 = function (planIndex) { return planIndex % 2 === 0; };
|
|
195
|
+
var DesktopRow = function (_a) {
|
|
196
|
+
var _b;
|
|
197
|
+
var row = _a.row, _c = _a.isLastRow, isLastRow = _c === void 0 ? false : _c;
|
|
198
|
+
return (React__default.createElement("div", { role: "row", className: classNames(styles$1.desktopRow, (_b = {},
|
|
199
|
+
_b[styles$1.isLastRow] = isLastRow,
|
|
200
|
+
_b)) },
|
|
201
|
+
React__default.createElement("div", { role: "rowheader", className: styles$1.desktopFeatureCell },
|
|
202
|
+
React__default.createElement(FeatureCell, { icon: row.feature.icon, title: row.feature.title, description: row.feature.description, popoverContent: row.feature.popoverContent })),
|
|
203
|
+
row.cells.map(function (cell, cellIndex) {
|
|
204
|
+
var _a;
|
|
205
|
+
return (React__default.createElement("div", { key: "desktop-cell-".concat(cellIndex), role: "cell", className: classNames(styles$1.cell, (_a = {},
|
|
206
|
+
_a[styles$1.highlighted] = isPlanHighlighted$1(cellIndex),
|
|
207
|
+
_a[styles$1.highlightedBottom] = isPlanHighlighted$1(cellIndex) && isLastRow,
|
|
208
|
+
_a)) },
|
|
209
|
+
React__default.createElement(Text, null, cell)));
|
|
210
|
+
})));
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* The same plans are highlighted in both layouts: plan index 0, 2, 4, ... (the
|
|
215
|
+
* 1st, 3rd, 5th plan). On desktop the leading feature column shifts these into
|
|
216
|
+
* the 2nd, 4th, ... visual grid columns, but it's the same plan as on mobile.
|
|
217
|
+
*/
|
|
218
|
+
var isPlanHighlighted = function (planIndex) { return planIndex % 2 === 0; };
|
|
219
|
+
var DesktopTable = function (_a) {
|
|
220
|
+
var _b, _c;
|
|
221
|
+
var columns = _a.columns, rows = _a.rows, sections = _a.sections, controls = _a.controls, hasStickyHeader = _a.hasStickyHeader, className = _a.className;
|
|
222
|
+
var hasSubheader = columns.some(function (column) { return column.subheader; });
|
|
223
|
+
return (React__default.createElement("div", { role: "table", className: classNames(styles$1.desktopTable, className, (_b = {},
|
|
224
|
+
_b[styles$1.desktopTableSticky] = hasStickyHeader,
|
|
225
|
+
_b)), style: { "--comparison-columns": columns.length } },
|
|
226
|
+
React__default.createElement("div", { role: "row", className: classNames(styles$1.desktopHeaderRow, (_c = {},
|
|
227
|
+
_c[styles$1.stickyHeader] = hasStickyHeader,
|
|
228
|
+
_c)) },
|
|
229
|
+
React__default.createElement("div", { role: "columnheader", className: styles$1.desktopFeatureHeader },
|
|
230
|
+
React__default.createElement(VisuallyHidden, null, "Features")),
|
|
231
|
+
columns.map(function (column, index) {
|
|
232
|
+
var _a;
|
|
233
|
+
return (React__default.createElement("div", { key: column.id, role: "columnheader", className: classNames(styles$1.desktopHeaderCell, (_a = {},
|
|
234
|
+
_a[styles$1.highlighted] = isPlanHighlighted(index),
|
|
235
|
+
_a[styles$1.highlightedTop] = isPlanHighlighted(index),
|
|
236
|
+
_a)) },
|
|
237
|
+
column.promoted && (React__default.createElement("div", { className: styles$1.headerCellPromoted },
|
|
238
|
+
React__default.createElement(Surface, { background: "dark-brand-01", paddingVertical: "16", paddingHorizontal: "24" },
|
|
239
|
+
React__default.createElement(VisuallyHidden, null, "Promotional offer. "),
|
|
240
|
+
React__default.createElement(Text, { size: "s" }, column.promoted)))),
|
|
241
|
+
React__default.createElement(Heading, { size: "m" }, column.label)));
|
|
242
|
+
})),
|
|
243
|
+
(controls || hasSubheader) && (React__default.createElement("div", { role: "row", className: styles$1.desktopSubHeaderRow },
|
|
244
|
+
React__default.createElement("div", { className: styles$1.desktopControlsCell, "aria-label": "comparison table controls" }, controls),
|
|
245
|
+
columns.map(function (column, index) {
|
|
246
|
+
var _a;
|
|
247
|
+
return (React__default.createElement(SubHeaderCell, __assign({ key: column.id, columnIndex: isPlanHighlighted(index) ? 0 : 1 }, ((_a = column.subheader) !== null && _a !== void 0 ? _a : { price: { value: "" } }))));
|
|
248
|
+
}))),
|
|
249
|
+
rows.map(function (row, rowIndex) { return (React__default.createElement(DesktopRow, { key: "desktop-row-".concat(rowIndex), row: row, isLastRow: sections.length === 0 && rowIndex === rows.length - 1 })); }),
|
|
250
|
+
sections.map(function (section, index) { return (React__default.createElement(Section, { key: section.id, section: section, isLastSection: index === sections.length - 1, renderRow: function (row, rowIndex, isLast) { return (React__default.createElement(DesktopRow, { key: "desktop-section-row-".concat(rowIndex), row: row, isLastRow: isLast })); } })); })));
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Splits a flat list of rows into unsectioned rows and resolved sections.
|
|
255
|
+
* Rows are bucketed by `sectionId` in one pass, then sections are built by
|
|
256
|
+
* iterating `sections` (not the bucket keys) so section order follows the
|
|
257
|
+
* `sections` array. A `sectionId` with no matching section logs a dev-only
|
|
258
|
+
* warning and the row renders unsectioned, so rows are never lost.
|
|
259
|
+
*/
|
|
260
|
+
var groupRows = function (rows, sections) {
|
|
261
|
+
if (rows === void 0) { rows = []; }
|
|
262
|
+
if (sections === void 0) { sections = []; }
|
|
263
|
+
var knownIds = new Set(sections.map(function (section) { return section.id; }));
|
|
264
|
+
var rowsBySection = new Map();
|
|
265
|
+
var unsectioned = [];
|
|
266
|
+
rows.forEach(function (row) {
|
|
267
|
+
var sectionId = row.sectionId;
|
|
268
|
+
if (sectionId === undefined) {
|
|
269
|
+
unsectioned.push(row);
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
if (!knownIds.has(sectionId)) {
|
|
273
|
+
if (process.env.NODE_ENV !== "production") {
|
|
274
|
+
// eslint-disable-next-line no-console
|
|
275
|
+
console.warn("ComparisonTable: row sectionId \"".concat(sectionId, "\" does not match any section; rendering it unsectioned."));
|
|
276
|
+
}
|
|
277
|
+
unsectioned.push(row);
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
var bucket = rowsBySection.get(sectionId);
|
|
281
|
+
if (bucket) {
|
|
282
|
+
bucket.push(row);
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
rowsBySection.set(sectionId, [row]);
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
var resolvedSections = [];
|
|
289
|
+
sections.forEach(function (section) {
|
|
290
|
+
var sectionRows = rowsBySection.get(section.id);
|
|
291
|
+
if (sectionRows === null || sectionRows === void 0 ? void 0 : sectionRows.length) {
|
|
292
|
+
resolvedSections.push(__assign(__assign({}, section), { rows: sectionRows }));
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
return { unsectioned: unsectioned, sections: resolvedSections };
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
var ComparisonTable = function (_a) {
|
|
299
|
+
var _b;
|
|
300
|
+
var columns = _a.columns, rows = _a.rows, sections = _a.sections, controls = _a.controls, _c = _a.hasBorder, hasBorder = _c === void 0 ? true : _c, _d = _a.hasStickyHeader, hasStickyHeader = _d === void 0 ? false : _d, props = __rest(_a, ["columns", "rows", "sections", "controls", "hasBorder", "hasStickyHeader"]);
|
|
301
|
+
var _e = React__default.useMemo(function () { return groupRows(rows, sections); }, [rows, sections]), unsectioned = _e.unsectioned, resolvedSections = _e.sections;
|
|
302
|
+
return (React__default.createElement("div", __assign({ className: classNames(styles$1.wrapper, (_b = {},
|
|
303
|
+
_b[styles$1.wrapperBordered] = hasBorder,
|
|
304
|
+
_b)) }, filterAttrs(props)),
|
|
305
|
+
hasBorder && React__default.createElement("div", { className: styles$1.shadowOverlay, "aria-hidden": "true" }),
|
|
306
|
+
React__default.createElement(MobileTable, { className: styles$1.mobileLayout, columns: columns, rows: unsectioned, sections: resolvedSections, controls: controls }),
|
|
307
|
+
React__default.createElement(DesktopTable, { className: styles$1.desktopLayout, columns: columns, rows: unsectioned, sections: resolvedSections, controls: controls, hasStickyHeader: hasStickyHeader })));
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
export { Cell, ComparisonTable, ControlCell, FeatureCell, HeaderCell, SubHeaderCell };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ComparisonTable-module_wrapper__SSvrL{position:relative}.ComparisonTable-module_wrapperBordered__kQeRo{border-radius:64px;padding:32px 0 0;overflow:clip}.ComparisonTable-module_shadowOverlay__unZ3Q{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;border-radius:inherit;box-shadow:inset 0 0 16px 0 rgba(0,0,0,0.25);pointer-events:none}.ComparisonTable-module_wrapperBordered__kQeRo .ComparisonTable-module_table__iU0Zl{padding:0 32px 32px}.ComparisonTable-module_wrapperBordered__kQeRo .ComparisonTable-module_desktopTable__IwkOh{padding:0 32px 32px}.ComparisonTable-module_table__iU0Zl{--comparison-right-edge-gap:32px;--cols:repeat(var(--comparison-columns),calc((1024px - 256px) / var(--comparison-columns))) var(--comparison-right-edge-gap);display:flex;flex-direction:column;width:100%;overflow-x:auto}.ComparisonTable-module_headerRow__BCw20,.ComparisonTable-module_subHeaderRow__h-S8Y,.ComparisonTable-module_row__VMAyW{display:grid;grid-template-columns:var(--cols);min-width:100%}.ComparisonTable-module_headerRow__BCw20::after,.ComparisonTable-module_subHeaderRow__h-S8Y::after,.ComparisonTable-module_row__VMAyW::after{content:"";grid-column:-2/-1}.ComparisonTable-module_headerCell__4bhwd{--header-cell-pad-top:var(--sem-space-padding-110);--header-cell-pad-right:var(--sem-space-padding-110);--header-cell-pad-left:var(--sem-space-padding-110);display:flex;flex-direction:column;justify-content:flex-end;padding:var(--sem-space-padding-110);background-color:var(--sem-color-bg-secondary-light-default);border-bottom:var(--sem-border-width-xxs) solid var(--sem-color-border-secondary-light-minimal)}.ComparisonTable-module_headerCellPromoted__4oIRU{margin-top:calc(-1 * var(--header-cell-pad-top,var(--sem-space-padding-110)));margin-right:calc(-1 * var(--header-cell-pad-right,var(--sem-space-padding-110)));margin-bottom:var(--sem-space-gap-40);margin-left:calc(-1 * var(--header-cell-pad-left,var(--sem-space-padding-110)));border-radius:0;overflow:hidden;text-align:center}.ComparisonTable-module_highlightedTop__pKNy8 .ComparisonTable-module_headerCellPromoted__4oIRU{border-top-left-radius:32px;border-top-right-radius:32px}.ComparisonTable-module_stickyHeader__MJLxP{position:sticky;top:0;z-index:1;background:var(--sem-color-bg-secondary-light-default);box-shadow:0 1px 0 0 rgba(0,0,0,0.12)}.ComparisonTable-module_subHeaderCell__12J6c{display:flex;flex-direction:column;justify-content:space-between;height:100%;padding:24px 32px 32px;border-top:var(--sem-border-width-xxs) solid var(--sem-color-border-secondary-light-minimal);border-bottom:var(--sem-border-width-xxs) solid var(--sem-color-border-secondary-light-minimal)}@media (min-width:636px){.ComparisonTable-module_subHeaderCell__12J6c{border-top:none}}.ComparisonTable-module_rowGroup__YuAHE{display:flex;flex-direction:column}.ComparisonTable-module_featureRow__hSa-p{display:grid;grid-template-columns:var(--cols);min-width:100%}.ComparisonTable-module_featureRowHeader__YB-eY{grid-column:1/-2;background-color:var(--sem-color-bg-secondary-light-default)}.ComparisonTable-module_row__VMAyW .ComparisonTable-module_cell__lWOm3{border-bottom:var(--sem-border-width-xxs) solid var(--sem-color-border-secondary-light-minimal)}.ComparisonTable-module_featureRowHeaderContent__XmzGi{position:sticky;left:0;width:calc((1024px - 256px) / var(--comparison-columns))}@media (min-width:636px){.ComparisonTable-module_featureRowHeaderContent__XmzGi{position:static;width:auto}}.ComparisonTable-module_controlRow__Lf01P{display:grid;grid-template-columns:var(--cols);min-width:100%}.ComparisonTable-module_controlCell__uauzO{grid-column:1/-2;display:flex;padding:16px}.ComparisonTable-module_controlCellContent__welDu{display:flex;position:sticky;left:0;width:calc((1024px - 256px) / var(--comparison-columns));flex-wrap:wrap;gap:var(--sem-space-gap-60);align-items:center}@media (min-width:636px){.ComparisonTable-module_controlCell__uauzO{padding:16px 16px 48px 0}.ComparisonTable-module_controlCellContent__welDu{position:static;width:auto}}.ComparisonTable-module_cell__lWOm3{display:flex;align-items:center;justify-content:center;padding:16px 32px;text-align:center}.ComparisonTable-module_highlighted__WLAu4{background:var(--surface-colors-bg-light-brand-02)}.ComparisonTable-module_highlightedTop__pKNy8{border-top-left-radius:32px;border-top-right-radius:32px}.ComparisonTable-module_highlightedBottom__7PPJO{border-bottom-left-radius:32px;border-bottom-right-radius:32px}.ComparisonTable-module_mobileLayout__GkFfO{display:flex}.ComparisonTable-module_desktopLayout__k3qMZ{display:none}@media (min-width:636px){.ComparisonTable-module_mobileLayout__GkFfO{display:none}.ComparisonTable-module_desktopLayout__k3qMZ{display:flex}}.ComparisonTable-module_desktopTable__IwkOh{--comparison-right-edge-gap:32px;--desktop-cols:minmax(144px,256px) repeat(var(--comparison-columns),calc((1024px - 256px) / var(--comparison-columns))) var(--comparison-right-edge-gap);flex-direction:column;width:100%;overflow-x:auto}.ComparisonTable-module_desktopTableSticky__GflmR{max-height:100dvh;overflow-y:auto}@media (min-width:1024px){.ComparisonTable-module_desktopTable__IwkOh{--comparison-right-edge-gap:0px;--desktop-cols:minmax(144px,256px) repeat(var(--comparison-columns),minmax(0,1fr)) var(--comparison-right-edge-gap)}}.ComparisonTable-module_desktopHeaderRow__BmfJz,.ComparisonTable-module_desktopSubHeaderRow__4KeVU,.ComparisonTable-module_desktopRow__XrYwQ{display:grid;grid-template-columns:var(--desktop-cols);min-width:100%}.ComparisonTable-module_desktopHeaderRow__BmfJz::after,.ComparisonTable-module_desktopSubHeaderRow__4KeVU::after,.ComparisonTable-module_desktopRow__XrYwQ::after{content:"";grid-column:-2/-1}.ComparisonTable-module_desktopFeatureHeader__M5Aa-,.ComparisonTable-module_desktopHeaderCell__fEYWe{--header-cell-pad-top:var(--sem-space-padding-110);--header-cell-pad-right:0;--header-cell-pad-left:var(--sem-space-padding-110);display:flex;flex-direction:column;justify-content:flex-end;padding:var(--sem-space-padding-110) 0 var(--sem-space-padding-110) var(--sem-space-padding-110);background-color:var(--sem-color-bg-secondary-light-default);border-bottom:var(--sem-border-width-xxs) solid var(--sem-color-border-secondary-light-minimal)}.ComparisonTable-module_desktopControlsCell__5fjOI{display:flex;flex-direction:column;gap:var(--sem-space-gap-60);justify-content:flex-end;padding:16px 16px 48px 0;border-bottom:var(--sem-border-width-xxs) solid var(--sem-color-border-secondary-light-minimal)}.ComparisonTable-module_desktopFeatureCell__i5MiH{border-bottom:var(--sem-border-width-xxs) solid var(--sem-color-border-secondary-light-minimal)}.ComparisonTable-module_desktopRow__XrYwQ .ComparisonTable-module_cell__lWOm3{border-bottom:var(--sem-border-width-xxs) solid var(--sem-color-border-secondary-light-minimal)}.ComparisonTable-module_desktopHeaderCell__fEYWe.ComparisonTable-module_highlighted__WLAu4{background:var(--surface-colors-bg-light-brand-02)}.ComparisonTable-module_sectionToggleRow__XDwt4{display:grid;min-width:100%}.ComparisonTable-module_table__iU0Zl .ComparisonTable-module_sectionToggleRow__XDwt4{grid-template-columns:var(--cols)}.ComparisonTable-module_desktopTable__IwkOh .ComparisonTable-module_sectionToggleRow__XDwt4{grid-template-columns:var(--desktop-cols)}.ComparisonTable-module_sectionToggleRow__XDwt4 .ComparisonTable-module_sectionToggle__GR-Xz{grid-column:1/-2}.ComparisonTable-module_sectionContent__GuogA{display:flex;flex-direction:column}.ComparisonTable-module_sectionToggle__GR-Xz{display:flex;width:100%;align-items:center;justify-content:flex-start;padding:var(--sem-space-padding-110);padding-left:0;background:var(--sem-color-bg-secondary-light-default);border:none;border-bottom:var(--sem-border-width-xxs) solid var(--sem-color-border-secondary-light-minimal);text-align:left;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}.ComparisonTable-module_sectionToggleContent__p0ouX{display:flex;position:sticky;left:0;width:-moz-fit-content;width:fit-content;align-items:center;gap:var(--sem-space-gap-40)}.ComparisonTable-module_sectionToggleOpen__ZFdLO{border-bottom:none}.ComparisonTable-module_sectionChevron__0kmLs{display:inline-flex;transition:transform 0.2s ease}.ComparisonTable-module_sectionChevronOpen__m7jv0{transform:rotate(180deg)}@media (prefers-reduced-motion:reduce){.ComparisonTable-module_sectionChevron__0kmLs{transition:none}}.ComparisonTable-module_rowGroup__YuAHE.ComparisonTable-module_isLastRow__coPlk:last-child .ComparisonTable-module_row__VMAyW .ComparisonTable-module_cell__lWOm3{border-bottom:none}.ComparisonTable-module_desktopRow__XrYwQ.ComparisonTable-module_isLastRow__coPlk .ComparisonTable-module_desktopFeatureCell__i5MiH,.ComparisonTable-module_desktopRow__XrYwQ.ComparisonTable-module_isLastRow__coPlk .ComparisonTable-module_cell__lWOm3{border-bottom:none}.ComparisonTable-module_sectionToggleRow__XDwt4.ComparisonTable-module_isLastRow__coPlk .ComparisonTable-module_sectionToggle__GR-Xz{border-bottom:none}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var tslib_es6 = require('../_shared/cjs/tslib.es6-BxB9I209.cjs');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var filterAttrs = require('../_shared/cjs/filter-attrs-BizjMsy0.cjs');
|
|
6
|
-
var index_es = require('../_shared/cjs/index.es-
|
|
6
|
+
var index_es = require('../_shared/cjs/index.es-oEhoU2Bd.cjs');
|
|
7
7
|
var Columns = require('@arc-ui/components/Columns');
|
|
8
8
|
var useMediaQuery = require('@arc-ui/components/use-media-query');
|
|
9
9
|
var Heading = require('@arc-ui/components/Heading');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as __rest, a as __assign } from '../_shared/esm/tslib.es6-BVXMhEem.mjs';
|
|
2
2
|
import React__default, { useState, useEffect, Suspense } from 'react';
|
|
3
3
|
import { f as filterAttrs } from '../_shared/esm/filter-attrs-DZ7RCEZm.mjs';
|
|
4
|
-
import { a as ArcSizeBreakpointsL, c as ArcSizeBreakpointsXl, b as ArcSizeBreakpointsM } from '../_shared/esm/index.es-
|
|
4
|
+
import { a as ArcSizeBreakpointsL, c as ArcSizeBreakpointsXl, b as ArcSizeBreakpointsM } from '../_shared/esm/index.es-DujqqZXe.mjs';
|
|
5
5
|
import { Columns, ColumnsCol } from '@arc-ui/components/Columns';
|
|
6
6
|
import { useMediaQuery } from '@arc-ui/components/use-media-query';
|
|
7
7
|
import { Heading } from '@arc-ui/components/Heading';
|
|
@@ -4,7 +4,7 @@ var tslib_es6 = require('../_shared/cjs/tslib.es6-BxB9I209.cjs');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var index = require('../_shared/cjs/index-B7Z7sgRq.cjs');
|
|
6
6
|
var filterAttrs = require('../_shared/cjs/filter-attrs-BizjMsy0.cjs');
|
|
7
|
-
var index_es = require('../_shared/cjs/index.es-
|
|
7
|
+
var index_es = require('../_shared/cjs/index.es-oEhoU2Bd.cjs');
|
|
8
8
|
var AppButton = require('@arc-ui/components/AppButton');
|
|
9
9
|
var Grid = require('@arc-ui/components/Grid');
|
|
10
10
|
var ButtonV2 = require('@arc-ui/components/ButtonV2');
|
|
@@ -2201,7 +2201,7 @@ function cleanEscapedString(input) {
|
|
|
2201
2201
|
return matched[1].replace(doubleQuoteRegExp, "'");
|
|
2202
2202
|
}
|
|
2203
2203
|
|
|
2204
|
-
var styles = {"labelDate":"FeaturePost-module_labelDate__NXOgY","googlePlayButtonWrapper":"FeaturePost-module_googlePlayButtonWrapper__GI-ag","imgWrapper":"FeaturePost-module_imgWrapper__r6omd","featurePost":"FeaturePost-module_featurePost__9jY21","featurePostReversed":"FeaturePost-module_featurePostReversed__WQRXm","contentContainer":"FeaturePost-module_contentContainer__kdus7","col":"FeaturePost-module_col__eW8gY"};
|
|
2204
|
+
var styles = {"labelContainer":"FeaturePost-module_labelContainer__j-yf2","labelText":"FeaturePost-module_labelText__DqBB3","labelWordWrap":"FeaturePost-module_labelWordWrap__vKD6M","labelDate":"FeaturePost-module_labelDate__NXOgY","googlePlayButtonWrapper":"FeaturePost-module_googlePlayButtonWrapper__GI-ag","imgWrapper":"FeaturePost-module_imgWrapper__r6omd","featurePost":"FeaturePost-module_featurePost__9jY21","featurePostReversed":"FeaturePost-module_featurePostReversed__WQRXm","contentContainer":"FeaturePost-module_contentContainer__kdus7","col":"FeaturePost-module_col__eW8gY"};
|
|
2205
2205
|
|
|
2206
2206
|
var Image = function (_a) {
|
|
2207
2207
|
var sources = _a.sources, title = _a.title, description = _a.description, props = tslib_es6.__rest(_a, ["sources", "title", "description"]);
|
|
@@ -2241,21 +2241,22 @@ var MediaContent = function (_a) {
|
|
|
2241
2241
|
* Use `FeaturePost` to direct traffic towards an article, case study, or product information page, or to a 3rd part App Store provider. Where the component links to an article page, the author attribution can be given here. The `FeaturePost` must be supported by an image, and in future, the component will support embedded video as well.
|
|
2242
2242
|
* */
|
|
2243
2243
|
var FeaturePost = function (_a) {
|
|
2244
|
-
var _b;
|
|
2245
|
-
var
|
|
2244
|
+
var _b, _c;
|
|
2245
|
+
var _d;
|
|
2246
|
+
var heading = _a.heading, id = _a.id, _e = _a.headingLevel, headingLevel = _e === void 0 ? "2" : _e, label = _a.label, image = _a.image, content = _a.content, footer = _a.footer, video = _a.video, isHeadingWordWrap = _a.isHeadingWordWrap, _f = _a.isReverseOrder, isReverseOrder = _f === void 0 ? false : _f, props = tslib_es6.__rest(_a, ["heading", "id", "headingLevel", "label", "image", "content", "footer", "video", "isHeadingWordWrap", "isReverseOrder"]);
|
|
2246
2247
|
var isMinWidthArcBreakpointM = useMediaQuery.useMediaQuery("(min-width: ".concat(index_es.ArcSizeBreakpointsM, ")"));
|
|
2247
2248
|
return (React.createElement("div", tslib_es6.__assign({ "data-testid": "feature-post", className: index.classNames(styles.featurePost, (_b = {},
|
|
2248
2249
|
_b[styles.featurePostReversed] = isReverseOrder,
|
|
2249
2250
|
_b)) }, filterAttrs.filterAttrs(props)),
|
|
2250
2251
|
React.createElement("div", { className: styles.col },
|
|
2251
2252
|
React.createElement("div", { className: styles.contentContainer },
|
|
2252
|
-
label && (React.createElement(
|
|
2253
|
-
React.createElement(
|
|
2254
|
-
React.createElement(
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2253
|
+
label && (React.createElement(React.Fragment, null,
|
|
2254
|
+
React.createElement("div", { className: styles.labelContainer },
|
|
2255
|
+
React.createElement("span", { className: index.classNames(styles.labelText, (_c = {},
|
|
2256
|
+
_c[styles.labelWordWrap] = isHeadingWordWrap,
|
|
2257
|
+
_c)) }, label.text),
|
|
2258
|
+
React.createElement("div", { className: styles.labelDate },
|
|
2259
|
+
React.createElement(Text.Text, { size: "xs", tone: "muted" }, isDate(label.date) ? (React.createElement("time", { dateTime: format(label.date, "yyyy-MM-dd") }, format(label.date, "d MMMM yyyy"))) : (React.createElement("span", null, label.date))))),
|
|
2259
2260
|
React.createElement(VerticalSpace.VerticalSpace, { size: "24" }))),
|
|
2260
2261
|
React.createElement(Heading.Heading, { id: id, level: headingLevel, isWordWrap: isHeadingWordWrap, size: "xl" }, heading),
|
|
2261
2262
|
!isMinWidthArcBreakpointM && (React.createElement("div", { "data-testid": "mobile-img" },
|
|
@@ -2268,7 +2269,7 @@ var FeaturePost = function (_a) {
|
|
|
2268
2269
|
React.createElement(VerticalSpace.VerticalSpace, { size: "40" }),
|
|
2269
2270
|
React.createElement(Author.Author, tslib_es6.__assign({}, footer.author)))),
|
|
2270
2271
|
React.createElement(VerticalSpace.VerticalSpace, { size: "40" }),
|
|
2271
|
-
React.createElement(ButtonV2.ButtonV2, tslib_es6.__assign({ buttonStyle:
|
|
2272
|
+
React.createElement(ButtonV2.ButtonV2, tslib_es6.__assign({}, footer.button, { buttonStyle: (_d = footer.button.buttonStyle) !== null && _d !== void 0 ? _d : "secondary" })))),
|
|
2272
2273
|
(footer === null || footer === void 0 ? void 0 : footer.type) === "appButton" && (React.createElement(React.Fragment, null,
|
|
2273
2274
|
React.createElement(VerticalSpace.VerticalSpace, { size: "40" }),
|
|
2274
2275
|
React.createElement(Grid.Grid, { isGutterless: true, isFluid: true },
|
|
@@ -2,7 +2,7 @@ import { _ as __rest, a as __assign } from '../_shared/esm/tslib.es6-BVXMhEem.mj
|
|
|
2
2
|
import React__default, { useState, useEffect, Suspense } from 'react';
|
|
3
3
|
import { c as classNames } from '../_shared/esm/index-BSO2EFem.mjs';
|
|
4
4
|
import { f as filterAttrs } from '../_shared/esm/filter-attrs-DZ7RCEZm.mjs';
|
|
5
|
-
import { b as ArcSizeBreakpointsM } from '../_shared/esm/index.es-
|
|
5
|
+
import { b as ArcSizeBreakpointsM } from '../_shared/esm/index.es-DujqqZXe.mjs';
|
|
6
6
|
import { AppButton } from '@arc-ui/components/AppButton';
|
|
7
7
|
import { Grid, GridRow, GridCol } from '@arc-ui/components/Grid';
|
|
8
8
|
import { ButtonV2 } from '@arc-ui/components/ButtonV2';
|
|
@@ -2199,7 +2199,7 @@ function cleanEscapedString(input) {
|
|
|
2199
2199
|
return matched[1].replace(doubleQuoteRegExp, "'");
|
|
2200
2200
|
}
|
|
2201
2201
|
|
|
2202
|
-
var styles = {"labelDate":"FeaturePost-module_labelDate__NXOgY","googlePlayButtonWrapper":"FeaturePost-module_googlePlayButtonWrapper__GI-ag","imgWrapper":"FeaturePost-module_imgWrapper__r6omd","featurePost":"FeaturePost-module_featurePost__9jY21","featurePostReversed":"FeaturePost-module_featurePostReversed__WQRXm","contentContainer":"FeaturePost-module_contentContainer__kdus7","col":"FeaturePost-module_col__eW8gY"};
|
|
2202
|
+
var styles = {"labelContainer":"FeaturePost-module_labelContainer__j-yf2","labelText":"FeaturePost-module_labelText__DqBB3","labelWordWrap":"FeaturePost-module_labelWordWrap__vKD6M","labelDate":"FeaturePost-module_labelDate__NXOgY","googlePlayButtonWrapper":"FeaturePost-module_googlePlayButtonWrapper__GI-ag","imgWrapper":"FeaturePost-module_imgWrapper__r6omd","featurePost":"FeaturePost-module_featurePost__9jY21","featurePostReversed":"FeaturePost-module_featurePostReversed__WQRXm","contentContainer":"FeaturePost-module_contentContainer__kdus7","col":"FeaturePost-module_col__eW8gY"};
|
|
2203
2203
|
|
|
2204
2204
|
var Image = function (_a) {
|
|
2205
2205
|
var sources = _a.sources, title = _a.title, description = _a.description, props = __rest(_a, ["sources", "title", "description"]);
|
|
@@ -2239,21 +2239,22 @@ var MediaContent = function (_a) {
|
|
|
2239
2239
|
* Use `FeaturePost` to direct traffic towards an article, case study, or product information page, or to a 3rd part App Store provider. Where the component links to an article page, the author attribution can be given here. The `FeaturePost` must be supported by an image, and in future, the component will support embedded video as well.
|
|
2240
2240
|
* */
|
|
2241
2241
|
var FeaturePost = function (_a) {
|
|
2242
|
-
var _b;
|
|
2243
|
-
var
|
|
2242
|
+
var _b, _c;
|
|
2243
|
+
var _d;
|
|
2244
|
+
var heading = _a.heading, id = _a.id, _e = _a.headingLevel, headingLevel = _e === void 0 ? "2" : _e, label = _a.label, image = _a.image, content = _a.content, footer = _a.footer, video = _a.video, isHeadingWordWrap = _a.isHeadingWordWrap, _f = _a.isReverseOrder, isReverseOrder = _f === void 0 ? false : _f, props = __rest(_a, ["heading", "id", "headingLevel", "label", "image", "content", "footer", "video", "isHeadingWordWrap", "isReverseOrder"]);
|
|
2244
2245
|
var isMinWidthArcBreakpointM = useMediaQuery("(min-width: ".concat(ArcSizeBreakpointsM, ")"));
|
|
2245
2246
|
return (React__default.createElement("div", __assign({ "data-testid": "feature-post", className: classNames(styles.featurePost, (_b = {},
|
|
2246
2247
|
_b[styles.featurePostReversed] = isReverseOrder,
|
|
2247
2248
|
_b)) }, filterAttrs(props)),
|
|
2248
2249
|
React__default.createElement("div", { className: styles.col },
|
|
2249
2250
|
React__default.createElement("div", { className: styles.contentContainer },
|
|
2250
|
-
label && (React__default.createElement(
|
|
2251
|
-
React__default.createElement(
|
|
2252
|
-
React__default.createElement(
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2251
|
+
label && (React__default.createElement(React__default.Fragment, null,
|
|
2252
|
+
React__default.createElement("div", { className: styles.labelContainer },
|
|
2253
|
+
React__default.createElement("span", { className: classNames(styles.labelText, (_c = {},
|
|
2254
|
+
_c[styles.labelWordWrap] = isHeadingWordWrap,
|
|
2255
|
+
_c)) }, label.text),
|
|
2256
|
+
React__default.createElement("div", { className: styles.labelDate },
|
|
2257
|
+
React__default.createElement(Text, { size: "xs", tone: "muted" }, isDate(label.date) ? (React__default.createElement("time", { dateTime: format(label.date, "yyyy-MM-dd") }, format(label.date, "d MMMM yyyy"))) : (React__default.createElement("span", null, label.date))))),
|
|
2257
2258
|
React__default.createElement(VerticalSpace, { size: "24" }))),
|
|
2258
2259
|
React__default.createElement(Heading, { id: id, level: headingLevel, isWordWrap: isHeadingWordWrap, size: "xl" }, heading),
|
|
2259
2260
|
!isMinWidthArcBreakpointM && (React__default.createElement("div", { "data-testid": "mobile-img" },
|
|
@@ -2266,7 +2267,7 @@ var FeaturePost = function (_a) {
|
|
|
2266
2267
|
React__default.createElement(VerticalSpace, { size: "40" }),
|
|
2267
2268
|
React__default.createElement(Author, __assign({}, footer.author)))),
|
|
2268
2269
|
React__default.createElement(VerticalSpace, { size: "40" }),
|
|
2269
|
-
React__default.createElement(ButtonV2, __assign({ buttonStyle:
|
|
2270
|
+
React__default.createElement(ButtonV2, __assign({}, footer.button, { buttonStyle: (_d = footer.button.buttonStyle) !== null && _d !== void 0 ? _d : "secondary" })))),
|
|
2270
2271
|
(footer === null || footer === void 0 ? void 0 : footer.type) === "appButton" && (React__default.createElement(React__default.Fragment, null,
|
|
2271
2272
|
React__default.createElement(VerticalSpace, { size: "40" }),
|
|
2272
2273
|
React__default.createElement(Grid, { isGutterless: true, isFluid: true },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.FeaturePost-module_labelDate__NXOgY{padding-top:var(--sem-space-padding-20);text-transform:uppercase}.FeaturePost-module_authorContent__FEuRO{padding-left:var(--sem-space-padding-70)}.FeaturePost-module_googlePlayButtonWrapper__GI-ag{padding:var(--sem-space-padding-70) 0 0}.FeaturePost-module_imgWrapper__r6omd{border-radius:var(--sem-border-radius-s);overflow:hidden}@media (min-width:636px){.FeaturePost-module_googlePlayButtonWrapper__GI-ag{padding:0 0 0 var(--sem-space-padding-70)}}@media (min-width:768px){.FeaturePost-module_featurePost__9jY21{display:flex;gap:24px}.FeaturePost-module_featurePostReversed__WQRXm{flex-direction:row-reverse}.FeaturePost-module_contentContainer__kdus7{padding:0 var(--sem-space-padding-110) 0 0}.FeaturePost-module_col__eW8gY{flex:0 1 auto;width:50%}.FeaturePost-
|
|
1
|
+
.FeaturePost-module_labelContainer__j-yf2{display:flex;flex-direction:column;align-items:baseline}.FeaturePost-module_labelText__DqBB3{max-width:100%;min-width:0;font:var(--sem-type-label-overline);letter-spacing:0.1em;text-transform:uppercase}.FeaturePost-module_labelWordWrap__vKD6M{-webkit-hyphens:auto;hyphens:auto;word-wrap:break-word}.FeaturePost-module_labelDate__NXOgY{padding-top:var(--sem-space-padding-20);text-transform:uppercase}.FeaturePost-module_authorContent__FEuRO{padding-left:var(--sem-space-padding-70)}.FeaturePost-module_googlePlayButtonWrapper__GI-ag{padding:var(--sem-space-padding-70) 0 0}.FeaturePost-module_imgWrapper__r6omd{border-radius:var(--sem-border-radius-s);overflow:hidden}@media (min-width:636px){.FeaturePost-module_googlePlayButtonWrapper__GI-ag{padding:0 0 0 var(--sem-space-padding-70)}}@media (min-width:768px){.FeaturePost-module_featurePost__9jY21{display:flex;gap:24px}.FeaturePost-module_featurePostReversed__WQRXm{flex-direction:row-reverse}.FeaturePost-module_contentContainer__kdus7{padding:0 var(--sem-space-padding-110) 0 0}.FeaturePost-module_col__eW8gY{flex:0 1 auto;width:50%}.FeaturePost-module_labelContainer__j-yf2{flex-direction:row;flex-wrap:wrap;-moz-column-gap:var(--sem-space-padding-70);column-gap:var(--sem-space-padding-70)}}@media (min-width:1280px){.FeaturePost-module_featurePost__9jY21{gap:32px}.FeaturePost-module_contentContainer__kdus7{padding:0 var(--sem-space-padding-130) 0 0}}
|
|
@@ -52,19 +52,19 @@ var HighlightList = function (_a) {
|
|
|
52
52
|
* Both two and three column options are available.
|
|
53
53
|
*/
|
|
54
54
|
var Highlights = function (_a) {
|
|
55
|
-
var _b, _c, _d;
|
|
56
|
-
var heading = _a.heading, headingLevel = _a.headingLevel, id = _a.id, isHeadingWordWrap = _a.isHeadingWordWrap, content = _a.content, listItems = _a.listItems,
|
|
55
|
+
var _b, _c, _d, _e;
|
|
56
|
+
var heading = _a.heading, headingLevel = _a.headingLevel, id = _a.id, isHeadingWordWrap = _a.isHeadingWordWrap, content = _a.content, listItems = _a.listItems, _f = _a.columns, columns = _f === void 0 ? "2" : _f, cta = _a.cta, props = tslib_es6.__rest(_a, ["heading", "headingLevel", "id", "isHeadingWordWrap", "content", "listItems", "columns", "cta"]);
|
|
57
57
|
var isMaxWidthArcBreakpointXs = useMediaQuery.useMediaQuery("(max-width: 767px)");
|
|
58
58
|
return (React.createElement("div", tslib_es6.__assign({}, filterAttrs.filterAttrs(props)),
|
|
59
59
|
React.createElement(SectionHeading.SectionHeading, { isPadded: true, id: id, "data-testid": "highlights-header", heading: heading, headingLevel: headingLevel, isHeadingWordWrap: isHeadingWordWrap, content: content }),
|
|
60
60
|
React.createElement(HighlightList, { listItems: listItems, columns: columns, isSmallIcon: isMaxWidthArcBreakpointXs, headingLevel: headingLevel }),
|
|
61
61
|
cta && (React.createElement(React.Fragment, null,
|
|
62
62
|
React.createElement(VerticalSpace.VerticalSpace, { size: "24" }),
|
|
63
|
-
React.createElement(ButtonV2.ButtonV2, {
|
|
64
|
-
? ((
|
|
65
|
-
:
|
|
66
|
-
? ((
|
|
67
|
-
:
|
|
63
|
+
React.createElement(ButtonV2.ButtonV2, tslib_es6.__assign({}, cta, { size: "m", buttonStyle: (_b = cta.buttonStyle) !== null && _b !== void 0 ? _b : "secondary", icon: cta.buttonStyle === "compact"
|
|
64
|
+
? ((_c = cta.icon) !== null && _c !== void 0 ? _c : BtIconArrowRightFill.BtIconArrowRightFill)
|
|
65
|
+
: cta.icon, iconActive: cta.buttonStyle === "compact"
|
|
66
|
+
? ((_d = cta.iconActive) !== null && _d !== void 0 ? _d : BtIconArrowRightFill.BtIconArrowRightFill)
|
|
67
|
+
: cta.iconActive, iconPosition: (_e = cta.iconPosition) !== null && _e !== void 0 ? _e : "beforeText" }))))));
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
exports.Highlights = Highlights;
|
|
@@ -50,19 +50,19 @@ var HighlightList = function (_a) {
|
|
|
50
50
|
* Both two and three column options are available.
|
|
51
51
|
*/
|
|
52
52
|
var Highlights = function (_a) {
|
|
53
|
-
var _b, _c, _d;
|
|
54
|
-
var heading = _a.heading, headingLevel = _a.headingLevel, id = _a.id, isHeadingWordWrap = _a.isHeadingWordWrap, content = _a.content, listItems = _a.listItems,
|
|
53
|
+
var _b, _c, _d, _e;
|
|
54
|
+
var heading = _a.heading, headingLevel = _a.headingLevel, id = _a.id, isHeadingWordWrap = _a.isHeadingWordWrap, content = _a.content, listItems = _a.listItems, _f = _a.columns, columns = _f === void 0 ? "2" : _f, cta = _a.cta, props = __rest(_a, ["heading", "headingLevel", "id", "isHeadingWordWrap", "content", "listItems", "columns", "cta"]);
|
|
55
55
|
var isMaxWidthArcBreakpointXs = useMediaQuery("(max-width: 767px)");
|
|
56
56
|
return (React__default.createElement("div", __assign({}, filterAttrs(props)),
|
|
57
57
|
React__default.createElement(SectionHeading, { isPadded: true, id: id, "data-testid": "highlights-header", heading: heading, headingLevel: headingLevel, isHeadingWordWrap: isHeadingWordWrap, content: content }),
|
|
58
58
|
React__default.createElement(HighlightList, { listItems: listItems, columns: columns, isSmallIcon: isMaxWidthArcBreakpointXs, headingLevel: headingLevel }),
|
|
59
59
|
cta && (React__default.createElement(React__default.Fragment, null,
|
|
60
60
|
React__default.createElement(VerticalSpace, { size: "24" }),
|
|
61
|
-
React__default.createElement(ButtonV2, {
|
|
62
|
-
? ((
|
|
63
|
-
:
|
|
64
|
-
? ((
|
|
65
|
-
:
|
|
61
|
+
React__default.createElement(ButtonV2, __assign({}, cta, { size: "m", buttonStyle: (_b = cta.buttonStyle) !== null && _b !== void 0 ? _b : "secondary", icon: cta.buttonStyle === "compact"
|
|
62
|
+
? ((_c = cta.icon) !== null && _c !== void 0 ? _c : BtIconArrowRightFill)
|
|
63
|
+
: cta.icon, iconActive: cta.buttonStyle === "compact"
|
|
64
|
+
? ((_d = cta.iconActive) !== null && _d !== void 0 ? _d : BtIconArrowRightFill)
|
|
65
|
+
: cta.iconActive, iconPosition: (_e = cta.iconPosition) !== null && _e !== void 0 ? _e : "beforeText" }))))));
|
|
66
66
|
};
|
|
67
67
|
|
|
68
68
|
export { Highlights };
|