@xenition/ui 0.1.0 → 0.1.2
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/native/commerce/GenerativeCover.d.ts +14 -9
- package/dist/native/commerce/GenerativeCover.d.ts.map +1 -1
- package/dist/native/commerce/GenerativeCover.js +31 -7
- package/dist/native/commerce/GenerativeCover.js.map +1 -1
- package/dist/native/marketing/AnnouncementBar.d.ts +33 -0
- package/dist/native/marketing/AnnouncementBar.d.ts.map +1 -0
- package/dist/native/marketing/AnnouncementBar.js +101 -0
- package/dist/native/marketing/AnnouncementBar.js.map +1 -0
- package/dist/native/marketing/AuroraBackground.d.ts +35 -0
- package/dist/native/marketing/AuroraBackground.d.ts.map +1 -0
- package/dist/native/marketing/AuroraBackground.js +56 -0
- package/dist/native/marketing/AuroraBackground.js.map +1 -0
- package/dist/native/marketing/Bento.d.ts +54 -0
- package/dist/native/marketing/Bento.d.ts.map +1 -0
- package/dist/native/marketing/Bento.js +139 -0
- package/dist/native/marketing/Bento.js.map +1 -0
- package/dist/native/marketing/Carousel.d.ts +26 -0
- package/dist/native/marketing/Carousel.d.ts.map +1 -0
- package/dist/native/marketing/Carousel.js +95 -0
- package/dist/native/marketing/Carousel.js.map +1 -0
- package/dist/native/marketing/ComparisonTable.d.ts +38 -0
- package/dist/native/marketing/ComparisonTable.d.ts.map +1 -0
- package/dist/native/marketing/ComparisonTable.js +84 -0
- package/dist/native/marketing/ComparisonTable.js.map +1 -0
- package/dist/native/marketing/Countdown.d.ts +25 -0
- package/dist/native/marketing/Countdown.d.ts.map +1 -0
- package/dist/native/marketing/Countdown.js +107 -0
- package/dist/native/marketing/Countdown.js.map +1 -0
- package/dist/native/marketing/CoverGallery.d.ts +38 -0
- package/dist/native/marketing/CoverGallery.d.ts.map +1 -0
- package/dist/native/marketing/CoverGallery.js +41 -0
- package/dist/native/marketing/CoverGallery.js.map +1 -0
- package/dist/native/marketing/EditorialGrid.d.ts +73 -0
- package/dist/native/marketing/EditorialGrid.d.ts.map +1 -0
- package/dist/native/marketing/EditorialGrid.js +34 -0
- package/dist/native/marketing/EditorialGrid.js.map +1 -0
- package/dist/native/marketing/FeatureSplit.d.ts +29 -0
- package/dist/native/marketing/FeatureSplit.d.ts.map +1 -0
- package/dist/native/marketing/FeatureSplit.js +37 -0
- package/dist/native/marketing/FeatureSplit.js.map +1 -0
- package/dist/native/marketing/LocationBlock.d.ts +37 -0
- package/dist/native/marketing/LocationBlock.d.ts.map +1 -0
- package/dist/native/marketing/LocationBlock.js +49 -0
- package/dist/native/marketing/LocationBlock.js.map +1 -0
- package/dist/native/marketing/Navbar.d.ts +34 -0
- package/dist/native/marketing/Navbar.d.ts.map +1 -0
- package/dist/native/marketing/Navbar.js +100 -0
- package/dist/native/marketing/Navbar.js.map +1 -0
- package/dist/native/marketing/NewsletterSignup.d.ts +33 -0
- package/dist/native/marketing/NewsletterSignup.d.ts.map +1 -0
- package/dist/native/marketing/NewsletterSignup.js +97 -0
- package/dist/native/marketing/NewsletterSignup.js.map +1 -0
- package/dist/native/marketing/OrnamentRule.d.ts +23 -0
- package/dist/native/marketing/OrnamentRule.d.ts.map +1 -0
- package/dist/native/marketing/OrnamentRule.js +43 -0
- package/dist/native/marketing/OrnamentRule.js.map +1 -0
- package/dist/native/marketing/ParticleField.d.ts +25 -0
- package/dist/native/marketing/ParticleField.d.ts.map +1 -0
- package/dist/native/marketing/ParticleField.js +92 -0
- package/dist/native/marketing/ParticleField.js.map +1 -0
- package/dist/native/marketing/PointerHalo.d.ts +22 -0
- package/dist/native/marketing/PointerHalo.d.ts.map +1 -0
- package/dist/native/marketing/PointerHalo.js +15 -0
- package/dist/native/marketing/PointerHalo.js.map +1 -0
- package/dist/native/marketing/PriceList.d.ts +30 -0
- package/dist/native/marketing/PriceList.d.ts.map +1 -0
- package/dist/native/marketing/PriceList.js +42 -0
- package/dist/native/marketing/PriceList.js.map +1 -0
- package/dist/native/marketing/PricingToggle.d.ts +30 -0
- package/dist/native/marketing/PricingToggle.d.ts.map +1 -0
- package/dist/native/marketing/PricingToggle.js +55 -0
- package/dist/native/marketing/PricingToggle.js.map +1 -0
- package/dist/native/marketing/ProcessSteps.d.ts +24 -0
- package/dist/native/marketing/ProcessSteps.d.ts.map +1 -0
- package/dist/native/marketing/ProcessSteps.js +52 -0
- package/dist/native/marketing/ProcessSteps.js.map +1 -0
- package/dist/native/marketing/ProductMock.d.ts +47 -0
- package/dist/native/marketing/ProductMock.d.ts.map +1 -0
- package/dist/native/marketing/ProductMock.js +270 -0
- package/dist/native/marketing/ProductMock.js.map +1 -0
- package/dist/native/marketing/RichText.d.ts +40 -0
- package/dist/native/marketing/RichText.d.ts.map +1 -0
- package/dist/native/marketing/RichText.js +134 -0
- package/dist/native/marketing/RichText.js.map +1 -0
- package/dist/native/marketing/SectionDivider.d.ts +34 -0
- package/dist/native/marketing/SectionDivider.d.ts.map +1 -0
- package/dist/native/marketing/SectionDivider.js +41 -0
- package/dist/native/marketing/SectionDivider.js.map +1 -0
- package/dist/native/marketing/TeamGrid.d.ts +27 -0
- package/dist/native/marketing/TeamGrid.d.ts.map +1 -0
- package/dist/native/marketing/TeamGrid.js +37 -0
- package/dist/native/marketing/TeamGrid.js.map +1 -0
- package/dist/native/marketing/VideoEmbed.d.ts +23 -0
- package/dist/native/marketing/VideoEmbed.d.ts.map +1 -0
- package/dist/native/marketing/VideoEmbed.js +38 -0
- package/dist/native/marketing/VideoEmbed.js.map +1 -0
- package/dist/native/marketing/index.d.ts +48 -0
- package/dist/native/marketing/index.d.ts.map +1 -1
- package/dist/native/marketing/index.js +55 -1
- package/dist/native/marketing/index.js.map +1 -1
- package/dist/native/motion/AnimatedCounter.d.ts +24 -0
- package/dist/native/motion/AnimatedCounter.d.ts.map +1 -0
- package/dist/native/motion/AnimatedCounter.js +76 -0
- package/dist/native/motion/AnimatedCounter.js.map +1 -0
- package/dist/native/motion/Marquee.d.ts +23 -0
- package/dist/native/motion/Marquee.d.ts.map +1 -0
- package/dist/native/motion/Marquee.js +79 -0
- package/dist/native/motion/Marquee.js.map +1 -0
- package/dist/native/motion/index.d.ts +10 -5
- package/dist/native/motion/index.d.ts.map +1 -1
- package/dist/native/motion/index.js +11 -6
- package/dist/native/motion/index.js.map +1 -1
- package/dist/native/primitives/Wordmark.d.ts +27 -0
- package/dist/native/primitives/Wordmark.d.ts.map +1 -0
- package/dist/native/primitives/Wordmark.js +41 -0
- package/dist/native/primitives/Wordmark.js.map +1 -0
- package/dist/native/primitives/index.d.ts +2 -0
- package/dist/native/primitives/index.d.ts.map +1 -1
- package/dist/native/primitives/index.js +4 -2
- package/dist/native/primitives/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Carousel = Carousel;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const react_native_1 = require("react-native");
|
|
40
|
+
const theme_1 = require("../theme");
|
|
41
|
+
const useReducedMotion_1 = require("../primitives/internal/useReducedMotion");
|
|
42
|
+
/**
|
|
43
|
+
* Horizontal, page-snapping slider — the native mirror of the web `Carousel`.
|
|
44
|
+
* The web version scroll-snaps a flex row; native uses a `pagingEnabled`
|
|
45
|
+
* horizontal `ScrollView` where each slide is one page wide. Swiping drives the
|
|
46
|
+
* active dot, and tapping a dot pages to that slide. The web prev/next arrows
|
|
47
|
+
* and hover/focus pause are dropped (touch has no hover); autoplay still honors
|
|
48
|
+
* reduced motion. Token-only.
|
|
49
|
+
*/
|
|
50
|
+
function Carousel({ items, dots = true, autoplay = 0, label = 'Carousel', style, }) {
|
|
51
|
+
const { colors, tokens } = (0, theme_1.useXenitionTheme)();
|
|
52
|
+
const reduced = (0, useReducedMotion_1.useReducedMotion)();
|
|
53
|
+
const count = items.length;
|
|
54
|
+
const [active, setActive] = React.useState(0);
|
|
55
|
+
const [width, setWidth] = React.useState(0);
|
|
56
|
+
const scrollerRef = React.useRef(null);
|
|
57
|
+
const goTo = React.useCallback((index) => {
|
|
58
|
+
if (count === 0 || width === 0)
|
|
59
|
+
return;
|
|
60
|
+
const nextIndex = ((index % count) + count) % count;
|
|
61
|
+
setActive(nextIndex);
|
|
62
|
+
scrollerRef.current?.scrollTo({
|
|
63
|
+
x: nextIndex * width,
|
|
64
|
+
animated: !reduced,
|
|
65
|
+
});
|
|
66
|
+
}, [count, width, reduced]);
|
|
67
|
+
React.useEffect(() => {
|
|
68
|
+
if (!autoplay || autoplay <= 0 || reduced || count <= 1 || width === 0) {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
const id = setInterval(() => goTo(active + 1), autoplay);
|
|
72
|
+
return () => clearInterval(id);
|
|
73
|
+
}, [autoplay, reduced, count, width, active, goTo]);
|
|
74
|
+
const onLayout = (event) => {
|
|
75
|
+
setWidth(event.nativeEvent.layout.width);
|
|
76
|
+
};
|
|
77
|
+
const onMomentumScrollEnd = (event) => {
|
|
78
|
+
if (width === 0)
|
|
79
|
+
return;
|
|
80
|
+
const next = Math.round(event.nativeEvent.contentOffset.x / width);
|
|
81
|
+
setActive(next);
|
|
82
|
+
};
|
|
83
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { testID: "xen-carousel", accessibilityLabel: label, style: style, children: [(0, jsx_runtime_1.jsx)(react_native_1.ScrollView, { ref: scrollerRef, horizontal: true, pagingEnabled: true, showsHorizontalScrollIndicator: false, onLayout: onLayout, onMomentumScrollEnd: onMomentumScrollEnd, children: items.map((slide, i) => ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: { width: width || undefined }, children: slide }, i))) }), dots && count > 1 ? ((0, jsx_runtime_1.jsx)(react_native_1.View, { testID: "xen-carousel-dots", style: {
|
|
84
|
+
flexDirection: 'row',
|
|
85
|
+
justifyContent: 'center',
|
|
86
|
+
gap: tokens.spacing.xs,
|
|
87
|
+
marginTop: tokens.spacing.md,
|
|
88
|
+
}, children: items.map((_, i) => ((0, jsx_runtime_1.jsx)(react_native_1.View, { accessibilityRole: "button", accessibilityLabel: `Go to slide ${i + 1}`, accessibilityState: { selected: i === active }, onTouchEnd: () => goTo(i), style: {
|
|
89
|
+
height: 8,
|
|
90
|
+
width: i === active ? 20 : 8,
|
|
91
|
+
borderRadius: tokens.radius.full,
|
|
92
|
+
backgroundColor: i === active ? colors.primary : tokens.ramps.neutral[300],
|
|
93
|
+
} }, i))) })) : null] }));
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=Carousel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Carousel.js","sourceRoot":"","sources":["../../../src/native/marketing/Carousel.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,4BA2FC;;AA/HD,6CAA+B;AAC/B,+CAQsB;AACtB,oCAA4C;AAC5C,8EAA2E;AAiB3E;;;;;;;GAOG;AACH,SAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,IAAI,GAAG,IAAI,EACX,QAAQ,GAAG,CAAC,EACZ,KAAK,GAAG,UAAU,EAClB,KAAK,GACS;IACd,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,wBAAgB,GAAE,CAAC;IAC9C,MAAM,OAAO,GAAG,IAAA,mCAAgB,GAAE,CAAC;IACnC,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;IAC3B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC9C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5C,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAa,IAAI,CAAC,CAAC;IAEnD,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,CAC5B,CAAC,KAAa,EAAE,EAAE;QAChB,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC;YAAE,OAAO;QACvC,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,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AAO,CAAC,GAAG,CAAC;qBAC3E,IAVI,CAAC,CAWN,CACH,CAAC,GACG,CACR,CAAC,CAAC,CAAC,IAAI,IACH,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
export interface ComparisonColumn {
|
|
4
|
+
/** Column (plan) name shown in the header. */
|
|
5
|
+
name: string;
|
|
6
|
+
/** Emphasize this column as the recommended choice. */
|
|
7
|
+
highlight?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ComparisonRow {
|
|
10
|
+
/** Feature label for the row (leading cell). */
|
|
11
|
+
label: string;
|
|
12
|
+
/** One value per column: `true` → check, `false` → dash, string → text. */
|
|
13
|
+
values: (boolean | string)[];
|
|
14
|
+
}
|
|
15
|
+
export interface ComparisonTableProps {
|
|
16
|
+
/** Plan columns compared across the top. */
|
|
17
|
+
columns: ComparisonColumn[];
|
|
18
|
+
/** Feature rows; each `values[i]` maps to `columns[i]`. */
|
|
19
|
+
rows: ComparisonRow[];
|
|
20
|
+
/** Label for the empty top-left corner cell. */
|
|
21
|
+
featureLabel?: string;
|
|
22
|
+
/** Badge text on the highlighted column header. */
|
|
23
|
+
highlightLabel?: string;
|
|
24
|
+
style?: StyleProp<ViewStyle>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Feature-comparison matrix — the native mirror of the web `ComparisonTable`.
|
|
28
|
+
* Plan `columns` across the top × feature `rows` down the side, with
|
|
29
|
+
* check/dash/text cells and an optional highlighted recommended column.
|
|
30
|
+
*
|
|
31
|
+
* Native layout choice: rather than the base `Table` primitive, this is a
|
|
32
|
+
* hand-built token-styled matrix wrapped in a horizontal `ScrollView` so the
|
|
33
|
+
* true grid survives on phones — the sticky-ish feature label column keeps a
|
|
34
|
+
* fixed width while the plan columns scroll horizontally when they overflow.
|
|
35
|
+
* Token-only.
|
|
36
|
+
*/
|
|
37
|
+
export declare function ComparisonTable({ columns, rows, featureLabel, highlightLabel, style, }: ComparisonTableProps): React.ReactElement;
|
|
38
|
+
//# sourceMappingURL=ComparisonTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComparisonTable.d.ts","sourceRoot":"","sources":["../../../src/native/marketing/ComparisonTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAA0B,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGtF,MAAM,WAAW,gBAAgB;IAC/B,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,2EAA2E;IAC3E,MAAM,EAAE,CAAC,OAAO,GAAG,MAAM,CAAC,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,oBAAoB;IACnC,4CAA4C;IAC5C,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,2DAA2D;IAC3D,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAKD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,IAAI,EACJ,YAAiB,EACjB,cAA8B,EAC9B,KAAK,GACN,EAAE,oBAAoB,GAAG,KAAK,CAAC,YAAY,CA0I3C"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ComparisonTable = ComparisonTable;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_native_1 = require("react-native");
|
|
6
|
+
const theme_1 = require("../theme");
|
|
7
|
+
const LABEL_WIDTH = 140;
|
|
8
|
+
const CELL_WIDTH = 96;
|
|
9
|
+
/**
|
|
10
|
+
* Feature-comparison matrix — the native mirror of the web `ComparisonTable`.
|
|
11
|
+
* Plan `columns` across the top × feature `rows` down the side, with
|
|
12
|
+
* check/dash/text cells and an optional highlighted recommended column.
|
|
13
|
+
*
|
|
14
|
+
* Native layout choice: rather than the base `Table` primitive, this is a
|
|
15
|
+
* hand-built token-styled matrix wrapped in a horizontal `ScrollView` so the
|
|
16
|
+
* true grid survives on phones — the sticky-ish feature label column keeps a
|
|
17
|
+
* fixed width while the plan columns scroll horizontally when they overflow.
|
|
18
|
+
* Token-only.
|
|
19
|
+
*/
|
|
20
|
+
function ComparisonTable({ columns, rows, featureLabel = '', highlightLabel = 'Recommended', style, }) {
|
|
21
|
+
const { colors, tokens } = (0, theme_1.useXenitionTheme)();
|
|
22
|
+
const renderValue = (value) => {
|
|
23
|
+
if (value === true) {
|
|
24
|
+
return (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: { color: colors.success, fontWeight: '700' }, children: "\u2713" });
|
|
25
|
+
}
|
|
26
|
+
if (value === false) {
|
|
27
|
+
return (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: { color: colors.muted, fontWeight: '700' }, children: "\u2013" });
|
|
28
|
+
}
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: { color: colors.onSurface, fontSize: tokens.typography.scale.sm }, children: value }));
|
|
30
|
+
};
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { testID: "xen-comparison", style: [
|
|
32
|
+
{
|
|
33
|
+
borderWidth: 1,
|
|
34
|
+
borderColor: colors.border,
|
|
35
|
+
borderRadius: tokens.radius.lg,
|
|
36
|
+
overflow: 'hidden',
|
|
37
|
+
},
|
|
38
|
+
style,
|
|
39
|
+
], children: (0, jsx_runtime_1.jsx)(react_native_1.ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, children: (0, jsx_runtime_1.jsxs)(react_native_1.View, { children: [(0, jsx_runtime_1.jsxs)(react_native_1.View, { style: {
|
|
40
|
+
flexDirection: 'row',
|
|
41
|
+
backgroundColor: tokens.ramps.neutral[50],
|
|
42
|
+
borderBottomWidth: 1,
|
|
43
|
+
borderBottomColor: colors.border,
|
|
44
|
+
}, children: [(0, jsx_runtime_1.jsx)(react_native_1.View, { style: { width: LABEL_WIDTH, padding: tokens.spacing.md }, children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: {
|
|
45
|
+
color: colors.onSurface,
|
|
46
|
+
fontSize: tokens.typography.scale.sm,
|
|
47
|
+
fontWeight: '600',
|
|
48
|
+
}, children: featureLabel }) }), columns.map((column, i) => ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: {
|
|
49
|
+
width: CELL_WIDTH,
|
|
50
|
+
padding: tokens.spacing.md,
|
|
51
|
+
alignItems: 'center',
|
|
52
|
+
gap: tokens.spacing.xs,
|
|
53
|
+
backgroundColor: column.highlight ? tokens.ramps.primary[50] : 'transparent',
|
|
54
|
+
}, children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { style: {
|
|
55
|
+
color: column.highlight ? colors.primary : colors.onSurface,
|
|
56
|
+
fontSize: tokens.typography.scale.sm,
|
|
57
|
+
fontWeight: '600',
|
|
58
|
+
textAlign: 'center',
|
|
59
|
+
}, children: column.name }), column.highlight ? ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: {
|
|
60
|
+
backgroundColor: colors.primary,
|
|
61
|
+
borderRadius: tokens.radius.full,
|
|
62
|
+
paddingHorizontal: tokens.spacing.xs,
|
|
63
|
+
paddingVertical: 1,
|
|
64
|
+
}, children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: {
|
|
65
|
+
color: colors.onPrimary,
|
|
66
|
+
fontSize: tokens.typography.scale.xs,
|
|
67
|
+
fontWeight: '500',
|
|
68
|
+
}, children: highlightLabel }) })) : null] }, i)))] }), rows.map((row, r) => ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: {
|
|
69
|
+
flexDirection: 'row',
|
|
70
|
+
borderBottomWidth: r < rows.length - 1 ? 1 : 0,
|
|
71
|
+
borderBottomColor: colors.border,
|
|
72
|
+
}, children: [(0, jsx_runtime_1.jsx)(react_native_1.View, { style: { width: LABEL_WIDTH, padding: tokens.spacing.md }, children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: {
|
|
73
|
+
color: colors.onSurface,
|
|
74
|
+
fontSize: tokens.typography.scale.sm,
|
|
75
|
+
fontWeight: '500',
|
|
76
|
+
}, children: row.label }) }), columns.map((column, c) => ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: {
|
|
77
|
+
width: CELL_WIDTH,
|
|
78
|
+
padding: tokens.spacing.md,
|
|
79
|
+
alignItems: 'center',
|
|
80
|
+
justifyContent: 'center',
|
|
81
|
+
backgroundColor: column.highlight ? tokens.ramps.primary[50] : 'transparent',
|
|
82
|
+
}, children: renderValue(row.values[c] ?? false) }, c)))] }, r)))] }) }) }));
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=ComparisonTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComparisonTable.js","sourceRoot":"","sources":["../../../src/native/marketing/ComparisonTable.tsx"],"names":[],"mappings":";;AA4CA,0CAgJC;;AA3LD,+CAAsF;AACtF,oCAA4C;AA4B5C,MAAM,WAAW,GAAG,GAAG,CAAC;AACxB,MAAM,UAAU,GAAG,EAAE,CAAC;AAEtB;;;;;;;;;;GAUG;AACH,SAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,IAAI,EACJ,YAAY,GAAG,EAAE,EACjB,cAAc,GAAG,aAAa,EAC9B,KAAK,GACgB;IACrB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,wBAAgB,GAAE,CAAC;IAE9C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AAC,CAUD,CACR,CAAC,KA/BG,CAAC,CAgCD,CACR,CAAC,IACG,GACI,GACR,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
export interface CountdownProps {
|
|
4
|
+
/** Target date/time to count down to. */
|
|
5
|
+
to: Date | string;
|
|
6
|
+
/** Fired once when the countdown reaches zero. */
|
|
7
|
+
onComplete?: () => void;
|
|
8
|
+
/** Labels for the four boxes. */
|
|
9
|
+
labels?: {
|
|
10
|
+
days: string;
|
|
11
|
+
hours: string;
|
|
12
|
+
minutes: string;
|
|
13
|
+
seconds: string;
|
|
14
|
+
};
|
|
15
|
+
style?: StyleProp<ViewStyle>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Counts down to a target date/time in days/hours/mins/secs boxes — the native
|
|
19
|
+
* mirror of the web `Countdown`. A 1s `setInterval` ticks the display and is
|
|
20
|
+
* cleaned up on unmount. The time text is information (not motion), so the
|
|
21
|
+
* interval still runs under reduced motion — only decorative animation would be
|
|
22
|
+
* gated. Token-only — box surface/border/text all trace to theme tokens.
|
|
23
|
+
*/
|
|
24
|
+
export declare function Countdown({ to, onComplete, labels, style, }: CountdownProps): React.ReactElement;
|
|
25
|
+
//# sourceMappingURL=Countdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Countdown.d.ts","sourceRoot":"","sources":["../../../src/native/marketing/Countdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAc,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAG1E,MAAM,WAAW,cAAc;IAC7B,yCAAyC;IACzC,EAAE,EAAE,IAAI,GAAG,MAAM,CAAC;IAClB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,iCAAiC;IACjC,MAAM,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3E,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AA2BD;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,EACxB,EAAE,EACF,UAAU,EACV,MAAuB,EACvB,KAAK,GACN,EAAE,cAAc,GAAG,KAAK,CAAC,YAAY,CAyErC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Countdown = Countdown;
|
|
37
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const react_native_1 = require("react-native");
|
|
40
|
+
const theme_1 = require("../theme");
|
|
41
|
+
const DEFAULT_LABELS = { days: 'Days', hours: 'Hours', minutes: 'Mins', seconds: 'Secs' };
|
|
42
|
+
/** Remaining time between now and `target`, clamped at zero. */
|
|
43
|
+
function computeParts(target) {
|
|
44
|
+
const diff = Math.max(0, target - Date.now());
|
|
45
|
+
const totalSeconds = Math.floor(diff / 1000);
|
|
46
|
+
return {
|
|
47
|
+
days: Math.floor(totalSeconds / 86400),
|
|
48
|
+
hours: Math.floor((totalSeconds % 86400) / 3600),
|
|
49
|
+
minutes: Math.floor((totalSeconds % 3600) / 60),
|
|
50
|
+
seconds: totalSeconds % 60,
|
|
51
|
+
done: diff === 0,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
55
|
+
/**
|
|
56
|
+
* Counts down to a target date/time in days/hours/mins/secs boxes — the native
|
|
57
|
+
* mirror of the web `Countdown`. A 1s `setInterval` ticks the display and is
|
|
58
|
+
* cleaned up on unmount. The time text is information (not motion), so the
|
|
59
|
+
* interval still runs under reduced motion — only decorative animation would be
|
|
60
|
+
* gated. Token-only — box surface/border/text all trace to theme tokens.
|
|
61
|
+
*/
|
|
62
|
+
function Countdown({ to, onComplete, labels = DEFAULT_LABELS, style, }) {
|
|
63
|
+
const { colors, tokens } = (0, theme_1.useXenitionTheme)();
|
|
64
|
+
const target = React.useMemo(() => new Date(to).getTime(), [to]);
|
|
65
|
+
const [parts, setParts] = React.useState(() => computeParts(target));
|
|
66
|
+
const firedRef = React.useRef(false);
|
|
67
|
+
React.useEffect(() => {
|
|
68
|
+
firedRef.current = false;
|
|
69
|
+
setParts(computeParts(target));
|
|
70
|
+
const id = setInterval(() => {
|
|
71
|
+
const next = computeParts(target);
|
|
72
|
+
setParts(next);
|
|
73
|
+
if (next.done && !firedRef.current) {
|
|
74
|
+
firedRef.current = true;
|
|
75
|
+
onComplete?.();
|
|
76
|
+
clearInterval(id);
|
|
77
|
+
}
|
|
78
|
+
}, 1000);
|
|
79
|
+
return () => clearInterval(id);
|
|
80
|
+
}, [target, onComplete]);
|
|
81
|
+
const boxes = [
|
|
82
|
+
{ value: parts.days, label: labels.days },
|
|
83
|
+
{ value: parts.hours, label: labels.hours },
|
|
84
|
+
{ value: parts.minutes, label: labels.minutes },
|
|
85
|
+
{ value: parts.seconds, label: labels.seconds },
|
|
86
|
+
];
|
|
87
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { testID: "xen-countdown", accessibilityRole: "text", style: [{ flexDirection: 'row', gap: tokens.spacing.sm }, style], children: boxes.map((box) => ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: {
|
|
88
|
+
minWidth: 56,
|
|
89
|
+
alignItems: 'center',
|
|
90
|
+
gap: tokens.spacing.xs,
|
|
91
|
+
borderRadius: tokens.radius.md,
|
|
92
|
+
borderWidth: 1,
|
|
93
|
+
borderColor: colors.border,
|
|
94
|
+
backgroundColor: colors.surface,
|
|
95
|
+
paddingHorizontal: tokens.spacing.sm,
|
|
96
|
+
paddingVertical: tokens.spacing.md,
|
|
97
|
+
}, children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { style: {
|
|
98
|
+
color: colors.onSurface,
|
|
99
|
+
fontSize: tokens.typography.scale['2xl'],
|
|
100
|
+
fontWeight: '700',
|
|
101
|
+
}, children: pad(box.value) }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: {
|
|
102
|
+
color: colors.muted,
|
|
103
|
+
fontSize: tokens.typography.scale.xs,
|
|
104
|
+
textTransform: 'uppercase',
|
|
105
|
+
}, children: box.label })] }, box.label))) }));
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=Countdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Countdown.js","sourceRoot":"","sources":["../../../src/native/marketing/Countdown.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,8BA8EC;;AA5HD,6CAA+B;AAC/B,+CAA0E;AAC1E,oCAA4C;AAoB5C,MAAM,cAAc,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AAE1F,gEAAgE;AAChE,SAAS,YAAY,CAAC,MAAc;IAClC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC9C,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IAC7C,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC;QACtC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,YAAY,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC;QAChD,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC/C,OAAO,EAAE,YAAY,GAAG,EAAE;QAC1B,IAAI,EAAE,IAAI,KAAK,CAAC;KACjB,CAAC;AACJ,CAAC;AAED,MAAM,GAAG,GAAG,CAAC,CAAS,EAAU,EAA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,CAAC,GAAG,CAAC,KAAK,CAAC,GACV,EACP,uBAAC,mBAAI,IACH,KAAK,EAAE;wBACL,KAAK,EAAE,MAAM,CAAC,KAAK;wBACnB,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;wBACpC,aAAa,EAAE,WAAW;qBAC3B,YAEA,GAAG,CAAC,KAAK,GACL,KA9BF,GAAG,CAAC,KAAK,CA+BT,CACR,CAAC,GACG,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
export interface CoverGalleryItem {
|
|
4
|
+
/** Stable seed for this plate's generative composition. */
|
|
5
|
+
seed: string | number;
|
|
6
|
+
/**
|
|
7
|
+
* Real image URL. When set, an `Image` is drawn instead of the seeded
|
|
8
|
+
* {@link GenerativeCover} plate.
|
|
9
|
+
*/
|
|
10
|
+
imageUrl?: string;
|
|
11
|
+
/** Accessible label for the plate. */
|
|
12
|
+
label?: string;
|
|
13
|
+
/** Caption rendered under the plate (title of the piece / work). */
|
|
14
|
+
caption?: string;
|
|
15
|
+
/** Small secondary line under the caption (medium, year, artist, …). */
|
|
16
|
+
meta?: string;
|
|
17
|
+
/** When set, the whole tile is pressable (native equivalent of the web `href`). */
|
|
18
|
+
onPress?: () => void;
|
|
19
|
+
}
|
|
20
|
+
export interface CoverGalleryProps {
|
|
21
|
+
/** The plates to render. */
|
|
22
|
+
items: CoverGalleryItem[];
|
|
23
|
+
/** Column count (native wraps into rows of this width; default 3). */
|
|
24
|
+
columns?: 2 | 3 | 4;
|
|
25
|
+
/** width / height aspect ratio of every plate (default 1 — square). */
|
|
26
|
+
aspect?: number;
|
|
27
|
+
style?: StyleProp<ViewStyle>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A gallery of seeded {@link GenerativeCover} plates (or real images) with
|
|
31
|
+
* captions — the native mirror of the web `CoverGallery`. The web CSS-grid
|
|
32
|
+
* breakpoints become a flex-wrap row with `flexBasis` columns; each tile
|
|
33
|
+
* optionally becomes a `Pressable` (native's `href`). The native
|
|
34
|
+
* `GenerativeCover` has a simpler seed/label contract, so the web `form`/`ink`/
|
|
35
|
+
* `paper` per-plate role overrides are dropped. Token-only — no literal colors.
|
|
36
|
+
*/
|
|
37
|
+
export declare function CoverGallery({ items, columns, aspect, style, }: CoverGalleryProps): React.ReactElement;
|
|
38
|
+
//# sourceMappingURL=CoverGallery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CoverGallery.d.ts","sourceRoot":"","sources":["../../../src/native/marketing/CoverGallery.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAgC,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAI5F,MAAM,WAAW,gBAAgB;IAC/B,2DAA2D;IAC3D,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mFAAmF;IACnF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,4BAA4B;IAC5B,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,sEAAsE;IACtE,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,OAAW,EACX,MAAU,EACV,KAAK,GACN,EAAE,iBAAiB,GAAG,KAAK,CAAC,YAAY,CAyFxC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CoverGallery = CoverGallery;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_native_1 = require("react-native");
|
|
6
|
+
const theme_1 = require("../theme");
|
|
7
|
+
const GenerativeCover_1 = require("../commerce/GenerativeCover");
|
|
8
|
+
/**
|
|
9
|
+
* A gallery of seeded {@link GenerativeCover} plates (or real images) with
|
|
10
|
+
* captions — the native mirror of the web `CoverGallery`. The web CSS-grid
|
|
11
|
+
* breakpoints become a flex-wrap row with `flexBasis` columns; each tile
|
|
12
|
+
* optionally becomes a `Pressable` (native's `href`). The native
|
|
13
|
+
* `GenerativeCover` has a simpler seed/label contract, so the web `form`/`ink`/
|
|
14
|
+
* `paper` per-plate role overrides are dropped. Token-only — no literal colors.
|
|
15
|
+
*/
|
|
16
|
+
function CoverGallery({ items, columns = 3, aspect = 1, style, }) {
|
|
17
|
+
const { colors, tokens } = (0, theme_1.useXenitionTheme)();
|
|
18
|
+
const basis = `${100 / columns}%`;
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { testID: "xen-cover-gallery", style: [
|
|
20
|
+
{ flexDirection: 'row', flexWrap: 'wrap', gap: tokens.spacing.lg },
|
|
21
|
+
style,
|
|
22
|
+
], children: items.map((item, index) => {
|
|
23
|
+
const seed = String(item.seed);
|
|
24
|
+
const label = item.label ?? (typeof item.caption === 'string' ? item.caption : undefined);
|
|
25
|
+
const plate = ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: {
|
|
26
|
+
aspectRatio: aspect,
|
|
27
|
+
width: '100%',
|
|
28
|
+
overflow: 'hidden',
|
|
29
|
+
borderRadius: tokens.radius.md,
|
|
30
|
+
backgroundColor: tokens.ramps.neutral[100],
|
|
31
|
+
}, children: item.imageUrl ? ((0, jsx_runtime_1.jsx)(react_native_1.Image, { source: { uri: item.imageUrl }, accessible: true, accessibilityLabel: label, resizeMode: "cover", style: { width: '100%', height: '100%' } })) : ((0, jsx_runtime_1.jsx)(GenerativeCover_1.GenerativeCover, { seed: seed, label: label, style: { width: '100%', height: '100%' } })) }));
|
|
32
|
+
const caption = item.caption !== undefined || item.meta !== undefined ? ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: { gap: tokens.spacing.xs }, children: [item.caption !== undefined ? ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: {
|
|
33
|
+
color: colors.onSurface,
|
|
34
|
+
fontSize: tokens.typography.scale.base,
|
|
35
|
+
fontWeight: '600',
|
|
36
|
+
}, children: item.caption })) : null, item.meta !== undefined ? ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: { color: colors.muted, fontSize: tokens.typography.scale.sm }, children: item.meta })) : null] })) : null;
|
|
37
|
+
const tile = ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: { gap: tokens.spacing.sm }, children: [plate, caption] }));
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: { flexGrow: 1, flexBasis: basis, minWidth: 120 }, children: item.onPress ? ((0, jsx_runtime_1.jsx)(react_native_1.Pressable, { accessibilityRole: "button", accessibilityLabel: label ?? 'View', onPress: item.onPress, style: ({ pressed }) => ({ opacity: pressed ? 0.9 : 1 }), children: tile })) : (tile) }, index));
|
|
39
|
+
}) }));
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=CoverGallery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CoverGallery.js","sourceRoot":"","sources":["../../../src/native/marketing/CoverGallery.tsx"],"names":[],"mappings":";;AAyCA,oCA8FC;;AAtID,+CAA4F;AAC5F,oCAA4C;AAC5C,iEAA8D;AA8B9D;;;;;;;GAOG;AACH,SAAgB,YAAY,CAAC,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AQ,EAAE,GAAG,EAAE,YACtE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CACd,uBAAC,wBAAS,IACR,iBAAiB,EAAC,QAAQ,EAC1B,kBAAkB,EAAE,KAAK,IAAI,MAAM,EACnC,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,YAEvD,IAAI,GACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,IAZQ,KAAK,CAaT,CACR,CAAC;QACJ,CAAC,CAAC,GACG,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
export interface EditorialItemData {
|
|
4
|
+
/**
|
|
5
|
+
* Column span at the web `lg` breakpoint. Kept for prop parity with the web
|
|
6
|
+
* `EditorialItem`; **inert on native** (phones are single-column, so there is
|
|
7
|
+
* no multi-column grid to span).
|
|
8
|
+
*/
|
|
9
|
+
span?: number;
|
|
10
|
+
/**
|
|
11
|
+
* 1-based start column at the web `lg` breakpoint. Kept for parity; **inert
|
|
12
|
+
* on native** (no grid to place into).
|
|
13
|
+
*/
|
|
14
|
+
start?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Vertical overlap offset (px) at the web `lg` breakpoint. Kept for parity;
|
|
17
|
+
* **inert on native** — the overlap has no phone analogue, so items always
|
|
18
|
+
* stack cleanly with no negative pull.
|
|
19
|
+
*/
|
|
20
|
+
offset?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Explicit web stacking order. Kept for parity; **inert on native** — a
|
|
23
|
+
* clean vertical stack has no overlap to order.
|
|
24
|
+
*/
|
|
25
|
+
z?: number;
|
|
26
|
+
/** The media / cover content for this cell. */
|
|
27
|
+
media?: React.ReactNode;
|
|
28
|
+
/** Caption slot rendered below the media on a `surface` backing. */
|
|
29
|
+
caption?: React.ReactNode;
|
|
30
|
+
}
|
|
31
|
+
export interface EditorialItemProps extends EditorialItemData {
|
|
32
|
+
style?: StyleProp<ViewStyle>;
|
|
33
|
+
}
|
|
34
|
+
export interface EditorialGridProps {
|
|
35
|
+
/**
|
|
36
|
+
* Column count at the web `lg` breakpoint. Kept for parity with the web
|
|
37
|
+
* `EditorialGrid`; **inert on native** (always a single column).
|
|
38
|
+
*/
|
|
39
|
+
columns?: number;
|
|
40
|
+
/**
|
|
41
|
+
* The editorial cells to render (mirrors the web `EditorialItem` children).
|
|
42
|
+
* Provide either this data array or `EditorialItem` children — the array
|
|
43
|
+
* wins if both are given.
|
|
44
|
+
*/
|
|
45
|
+
items?: EditorialItemData[];
|
|
46
|
+
/**
|
|
47
|
+
* `EditorialItem` children, for callers that prefer composition over the
|
|
48
|
+
* `items` array. Ignored when `items` is provided.
|
|
49
|
+
*/
|
|
50
|
+
children?: React.ReactNode;
|
|
51
|
+
style?: StyleProp<ViewStyle>;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* One editorial cell — the native mirror of the web `EditorialItem`: the media
|
|
55
|
+
* with a `surface`-backed caption below it. The web `span`/`start`/`offset`/`z`
|
|
56
|
+
* geometry props are accepted for parity but are inert on native (see their
|
|
57
|
+
* doc comments). Token-only.
|
|
58
|
+
*/
|
|
59
|
+
export declare function EditorialItem({ media, caption, children, style, }: EditorialItemProps & {
|
|
60
|
+
children?: React.ReactNode;
|
|
61
|
+
}): React.ReactElement;
|
|
62
|
+
/**
|
|
63
|
+
* Editorial layout — the native mirror of the web `EditorialGrid`.
|
|
64
|
+
*
|
|
65
|
+
* The web version is an asymmetric 12-column overlap grid (uneven spans/starts
|
|
66
|
+
* plus negative offsets so covers overlap each other's rows, with z-order
|
|
67
|
+
* keeping captions readable). That overlap has **no phone analogue**, so native
|
|
68
|
+
* renders the items as a clean vertical stack, each item's caption slotted
|
|
69
|
+
* directly below its media/children. The `columns`/`span`/`start`/`offset`/`z`
|
|
70
|
+
* props are preserved for prop parity but are **inert** on native. Token-only.
|
|
71
|
+
*/
|
|
72
|
+
export declare function EditorialGrid({ items, children, style, }: EditorialGridProps): React.ReactElement;
|
|
73
|
+
//# sourceMappingURL=EditorialGrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorialGrid.d.ts","sourceRoot":"","sources":["../../../src/native/marketing/EditorialGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpE,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,+CAA+C;IAC/C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,oEAAoE;IACpE,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IAC3D,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,OAAO,EACP,QAAQ,EACR,KAAK,GACN,EAAE,kBAAkB,GAAG;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,GAAG,KAAK,CAAC,YAAY,CAY1E;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,QAAQ,EACR,KAAK,GACN,EAAE,kBAAkB,GAAG,KAAK,CAAC,YAAY,CAczC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EditorialItem = EditorialItem;
|
|
4
|
+
exports.EditorialGrid = EditorialGrid;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_native_1 = require("react-native");
|
|
7
|
+
const theme_1 = require("../theme");
|
|
8
|
+
/**
|
|
9
|
+
* One editorial cell — the native mirror of the web `EditorialItem`: the media
|
|
10
|
+
* with a `surface`-backed caption below it. The web `span`/`start`/`offset`/`z`
|
|
11
|
+
* geometry props are accepted for parity but are inert on native (see their
|
|
12
|
+
* doc comments). Token-only.
|
|
13
|
+
*/
|
|
14
|
+
function EditorialItem({ media, caption, children, style, }) {
|
|
15
|
+
const { colors, tokens } = (0, theme_1.useXenitionTheme)();
|
|
16
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { testID: "xen-editorial-item", style: [{ minWidth: 0 }, style], children: [media !== undefined ? media : children, caption !== undefined ? ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: { backgroundColor: colors.surface, paddingTop: tokens.spacing.sm }, children: caption })) : null] }));
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Editorial layout — the native mirror of the web `EditorialGrid`.
|
|
20
|
+
*
|
|
21
|
+
* The web version is an asymmetric 12-column overlap grid (uneven spans/starts
|
|
22
|
+
* plus negative offsets so covers overlap each other's rows, with z-order
|
|
23
|
+
* keeping captions readable). That overlap has **no phone analogue**, so native
|
|
24
|
+
* renders the items as a clean vertical stack, each item's caption slotted
|
|
25
|
+
* directly below its media/children. The `columns`/`span`/`start`/`offset`/`z`
|
|
26
|
+
* props are preserved for prop parity but are **inert** on native. Token-only.
|
|
27
|
+
*/
|
|
28
|
+
function EditorialGrid({ items, children, style, }) {
|
|
29
|
+
const { tokens } = (0, theme_1.useXenitionTheme)();
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { testID: "xen-editorial-grid", style: [{ gap: tokens.spacing['2xl'] }, style], children: items !== undefined
|
|
31
|
+
? items.map((it, i) => ((0, jsx_runtime_1.jsx)(EditorialItem, { media: it.media, caption: it.caption }, i)))
|
|
32
|
+
: children }));
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=EditorialGrid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorialGrid.js","sourceRoot":"","sources":["../../../src/native/marketing/EditorialGrid.tsx"],"names":[],"mappings":";;AA+DA,sCAiBC;AAYD,sCAkBC;;AA7GD,+CAAoE;AACpE,oCAA4C;AAuD5C;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,OAAO,EACP,QAAQ,EACR,KAAK,GAC+C;IACpD,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,wBAAgB,GAAE,CAAC;IAC9C,OAAO,CACL,wBAAC,mBAAI,IAAC,MAAM,EAAC,oBAAoB,EAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC,aAC9D,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,EACtC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,CACvB,uBAAC,mBAAI,IAAC,KAAK,EAAE,EAAE,eAAe,EAAE,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,YAC5E,OAAO,GACH,CACR,CAAC,CAAC,CAAC,IAAI,IACH,CACR,CAAC;AACJ,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,QAAQ,EACR,KAAK,GACc;IACnB,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,wBAAgB,GAAE,CAAC;IACtC,OAAO,CACL,uBAAC,mBAAI,IACH,MAAM,EAAC,oBAAoB,EAC3B,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,YAE7C,KAAK,KAAK,SAAS;YAClB,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CACnB,uBAAC,aAAa,IAAS,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,IAAvC,CAAC,CAA0C,CAChE,CAAC;YACJ,CAAC,CAAC,QAAQ,GACP,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
export interface FeatureSplitProps {
|
|
4
|
+
/** Small kicker above the title. */
|
|
5
|
+
eyebrow?: React.ReactNode;
|
|
6
|
+
/** Feature headline. */
|
|
7
|
+
title: React.ReactNode;
|
|
8
|
+
/** Supporting copy under the title. */
|
|
9
|
+
description?: React.ReactNode;
|
|
10
|
+
/** Check-marked selling points. */
|
|
11
|
+
bullets?: string[];
|
|
12
|
+
/** Visual slot; omit for a token-styled placeholder. */
|
|
13
|
+
media?: React.ReactNode;
|
|
14
|
+
/** Flip the stack order — media below the copy instead of above. */
|
|
15
|
+
reverse?: boolean;
|
|
16
|
+
/** Call-to-action slot under the copy — rendered as-is. */
|
|
17
|
+
action?: React.ReactNode;
|
|
18
|
+
style?: StyleProp<ViewStyle>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Media-beside-copy feature row — the native mirror of the web `FeatureSplit`.
|
|
22
|
+
* The web version is a two-column grid on desktop; **native always stacks
|
|
23
|
+
* vertically** (phones are narrow), with media on top by default and `reverse`
|
|
24
|
+
* flipping it below the copy. When no `media` is supplied the web seeds a
|
|
25
|
+
* `GenerativeCover`; native renders a token-styled 16:9 placeholder instead
|
|
26
|
+
* (no generative canvas on native). Token-only.
|
|
27
|
+
*/
|
|
28
|
+
export declare function FeatureSplit({ eyebrow, title, description, bullets, media, reverse, action, style, }: FeatureSplitProps): React.ReactElement;
|
|
29
|
+
//# sourceMappingURL=FeatureSplit.d.ts.map
|