jfs-components 0.0.78 → 0.0.79
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/CHANGELOG.md +11 -0
- package/lib/commonjs/components/Attached/Attached.js +144 -0
- package/lib/commonjs/components/Card/Card.js +25 -2
- package/lib/commonjs/components/FullscreenModal/FullscreenModal.js +4 -6
- package/lib/commonjs/components/ListItem/ListItem.js +22 -15
- package/lib/commonjs/components/PlanComparisonCard/PlanComparisonCard.js +328 -0
- package/lib/commonjs/components/Slot/Slot.js +73 -0
- package/lib/commonjs/components/index.js +21 -0
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/module/components/Attached/Attached.js +139 -0
- package/lib/module/components/Card/Card.js +25 -2
- package/lib/module/components/FullscreenModal/FullscreenModal.js +4 -6
- package/lib/module/components/ListItem/ListItem.js +22 -15
- package/lib/module/components/PlanComparisonCard/PlanComparisonCard.js +322 -0
- package/lib/module/components/Slot/Slot.js +68 -0
- package/lib/module/components/index.js +3 -0
- package/lib/module/icons/registry.js +1 -1
- package/lib/typescript/src/components/Attached/Attached.d.ts +61 -0
- package/lib/typescript/src/components/Card/Card.d.ts +9 -2
- package/lib/typescript/src/components/ListItem/ListItem.d.ts +15 -5
- package/lib/typescript/src/components/PlanComparisonCard/PlanComparisonCard.d.ts +64 -0
- package/lib/typescript/src/components/Slot/Slot.d.ts +52 -0
- package/lib/typescript/src/components/index.d.ts +3 -0
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/Attached/Attached.tsx +181 -0
- package/src/components/Card/Card.tsx +28 -1
- package/src/components/FullscreenModal/FullscreenModal.tsx +3 -3
- package/src/components/ListItem/ListItem.tsx +35 -16
- package/src/components/PlanComparisonCard/PlanComparisonCard.tsx +426 -0
- package/src/components/Slot/Slot.tsx +91 -0
- package/src/components/index.ts +3 -0
- package/src/icons/registry.ts +1 -1
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
|
|
10
|
+
var _reactUtils = require("../../utils/react-utils");
|
|
11
|
+
var _Icon = _interopRequireDefault(require("../../icons/Icon"));
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
15
|
+
/**
|
|
16
|
+
* A single plan column header (the label column has no header of its own).
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Value rendered inside a plan cell.
|
|
21
|
+
* - `string` / `number` → rendered as value text.
|
|
22
|
+
* - `false` → renders the muted "not available" cross icon.
|
|
23
|
+
* - any React node → rendered as-is (e.g. a `Badge`, `MoneyValue`, icon…).
|
|
24
|
+
* - `null` / `undefined` / `true` → empty cell.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
const DEFAULT_COLUMNS = [{
|
|
28
|
+
label: 'Your plan'
|
|
29
|
+
}, {
|
|
30
|
+
label: 'JioFinance+',
|
|
31
|
+
brand: true
|
|
32
|
+
}];
|
|
33
|
+
const DEFAULT_ROWS = [{
|
|
34
|
+
label: 'JioPoints multiplier',
|
|
35
|
+
values: ['1x', '1.25x']
|
|
36
|
+
}, {
|
|
37
|
+
label: 'Cashback',
|
|
38
|
+
showInfo: true,
|
|
39
|
+
values: [false, 'Upto ₹5000']
|
|
40
|
+
}, {
|
|
41
|
+
label: 'Bonus JioGold',
|
|
42
|
+
showInfo: true,
|
|
43
|
+
values: [false, '1%']
|
|
44
|
+
}];
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* PlanComparisonCard renders a compact comparison table that pits the user's
|
|
48
|
+
* current plan against one or more alternative plans across a set of feature
|
|
49
|
+
* rows. Implementation of Figma node `4498:2968` (`PlanComparisonCard`).
|
|
50
|
+
*
|
|
51
|
+
* The leading column holds feature labels (with an optional info icon); every
|
|
52
|
+
* other column maps to a plan in `columns`. Each cell value can be plain text,
|
|
53
|
+
* a "not available" cross (`false`), or any custom React node.
|
|
54
|
+
*
|
|
55
|
+
* @component
|
|
56
|
+
* @example
|
|
57
|
+
* ```tsx
|
|
58
|
+
* <PlanComparisonCard
|
|
59
|
+
* columns={[{ label: 'Your plan' }, { label: 'JioFinance+', brand: true }]}
|
|
60
|
+
* rows={[
|
|
61
|
+
* { label: 'JioPoints multiplier', values: ['1x', '1.25x'] },
|
|
62
|
+
* { label: 'Cashback', showInfo: true, values: [false, 'Upto ₹5000'] },
|
|
63
|
+
* ]}
|
|
64
|
+
* />
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
/** Keeps every text layer on a single line; columns grow to fit content. */
|
|
68
|
+
const NO_WRAP_TEXT = {
|
|
69
|
+
flexShrink: 0,
|
|
70
|
+
...(_reactNative.Platform.OS === 'web' ? {
|
|
71
|
+
whiteSpace: 'nowrap'
|
|
72
|
+
} : {})
|
|
73
|
+
};
|
|
74
|
+
function PlanComparisonCard({
|
|
75
|
+
columns = DEFAULT_COLUMNS,
|
|
76
|
+
rows = DEFAULT_ROWS,
|
|
77
|
+
labelColumnFlex = 0,
|
|
78
|
+
modes = _reactUtils.EMPTY_MODES,
|
|
79
|
+
style
|
|
80
|
+
}) {
|
|
81
|
+
/** Natural widths from header labels (plan columns only). */
|
|
82
|
+
const [headerWidths, setHeaderWidths] = (0, _react.useState)([]);
|
|
83
|
+
/** Natural widths from table body columns. */
|
|
84
|
+
const [bodyWidths, setBodyWidths] = (0, _react.useState)([]);
|
|
85
|
+
const setMeasuredWidth = (0, _react.useCallback)((setter, index, width) => {
|
|
86
|
+
setter(prev => {
|
|
87
|
+
if (prev[index] === width) return prev;
|
|
88
|
+
const next = [...prev];
|
|
89
|
+
next[index] = width;
|
|
90
|
+
return next;
|
|
91
|
+
});
|
|
92
|
+
}, []);
|
|
93
|
+
const onHeaderColumnLayout = (0, _react.useCallback)((index, event) => {
|
|
94
|
+
setMeasuredWidth(setHeaderWidths, index, event.nativeEvent.layout.width);
|
|
95
|
+
}, [setMeasuredWidth]);
|
|
96
|
+
const onBodyColumnLayout = (0, _react.useCallback)((index, event) => {
|
|
97
|
+
setMeasuredWidth(setBodyWidths, index, event.nativeEvent.layout.width);
|
|
98
|
+
}, [setMeasuredWidth]);
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Shared width for header + body cells in a column (max of natural header
|
|
102
|
+
* label vs body content). No columnGap between columns — gaps would shift
|
|
103
|
+
* headers relative to the flush table grid below.
|
|
104
|
+
*/
|
|
105
|
+
const columnWidthStyle = index => {
|
|
106
|
+
const width = Math.max(headerWidths[index] ?? 0, bodyWidths[index] ?? 0);
|
|
107
|
+
if (width > 0) {
|
|
108
|
+
return {
|
|
109
|
+
width,
|
|
110
|
+
minWidth: width,
|
|
111
|
+
flexShrink: 0,
|
|
112
|
+
flexGrow: 0
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
flexShrink: 0,
|
|
117
|
+
flexGrow: 0
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
// Container
|
|
122
|
+
const gap = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/gap', modes) ?? 16;
|
|
123
|
+
|
|
124
|
+
// Header
|
|
125
|
+
const headerFg = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/header/fg', modes) ?? '#ffffff';
|
|
126
|
+
const headerBrandFg = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/header/brand/fg', modes) ?? '#cea15a';
|
|
127
|
+
const headerFontSize = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/header/fontSize', modes) ?? 14;
|
|
128
|
+
const headerFontFamily = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/header/fontFamily', modes) ?? 'JioType Var';
|
|
129
|
+
const headerLineHeight = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/header/lineHeight', modes) ?? 18;
|
|
130
|
+
const headerFontWeight = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/header/fontWeight', modes) ?? '500';
|
|
131
|
+
|
|
132
|
+
// Table
|
|
133
|
+
const tableBackground = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/tableRow/background', modes) ?? '#141414';
|
|
134
|
+
const tableRadius = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/tableRow/radius', modes) ?? 16;
|
|
135
|
+
const tableBorderSize = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/tableRow/border/size', modes) ?? 1;
|
|
136
|
+
const tableBorderColor = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/tableRow/border/color', modes) ?? '#1e1a14';
|
|
137
|
+
|
|
138
|
+
// Cell
|
|
139
|
+
const cellPadding = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/tableCell/padding', modes) ?? 12;
|
|
140
|
+
const cellGap = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/tableCell/gap', modes) ?? 2;
|
|
141
|
+
const cellMinHeight = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/tableCell/height', modes) ?? 46;
|
|
142
|
+
const cellBorderSize = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/tableCell/border/size', modes) ?? 1;
|
|
143
|
+
const cellBorderColor = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/tableCell/border/color', modes) ?? '#1e1a14';
|
|
144
|
+
|
|
145
|
+
// Cell label
|
|
146
|
+
const labelColor = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/tableCell/label/color', modes) ?? '#ffffff';
|
|
147
|
+
const labelDisabledColor = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/tableCell/label/disabled/color', modes) ?? '#91949c';
|
|
148
|
+
const labelFontSize = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/tableCell/label/fontSize', modes) ?? 12;
|
|
149
|
+
const labelFontFamily = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/tableCell/label/fontFamily', modes) ?? 'JioType Var';
|
|
150
|
+
const labelLineHeight = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/tableCell/label/lineHeight', modes) ?? 16;
|
|
151
|
+
const labelFontWeight = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/tableCell/label/fontWeight', modes) ?? '400';
|
|
152
|
+
|
|
153
|
+
// Cell value
|
|
154
|
+
const valueColor = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/tableCell/value/color', modes) ?? '#ffffff';
|
|
155
|
+
const valueFontSize = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/tableCell/value/fontSize', modes) ?? 12;
|
|
156
|
+
const valueFontFamily = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/tableCell/value/fontFamily', modes) ?? 'JioType Var';
|
|
157
|
+
const valueLineHeight = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/tableCell/value/lineHeight', modes) ?? 16;
|
|
158
|
+
const valueFontWeight = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/tableCell/value/fontWeight', modes) ?? '500';
|
|
159
|
+
|
|
160
|
+
// Icon
|
|
161
|
+
const iconColor = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/icon/color', modes) ?? '#ffffff';
|
|
162
|
+
const iconSize = (0, _figmaVariablesResolver.getVariableByName)('planComparisonCard/icon/size', modes) ?? 16;
|
|
163
|
+
const toWeight = w => typeof w === 'number' ? `${w}` : w;
|
|
164
|
+
const headerTextStyle = {
|
|
165
|
+
...NO_WRAP_TEXT,
|
|
166
|
+
fontFamily: headerFontFamily,
|
|
167
|
+
fontSize: headerFontSize,
|
|
168
|
+
lineHeight: headerLineHeight,
|
|
169
|
+
fontWeight: toWeight(headerFontWeight),
|
|
170
|
+
textAlign: 'center'
|
|
171
|
+
};
|
|
172
|
+
const labelTextStyle = {
|
|
173
|
+
...NO_WRAP_TEXT,
|
|
174
|
+
color: labelColor,
|
|
175
|
+
fontFamily: labelFontFamily,
|
|
176
|
+
fontSize: labelFontSize,
|
|
177
|
+
lineHeight: labelLineHeight,
|
|
178
|
+
fontWeight: toWeight(labelFontWeight)
|
|
179
|
+
};
|
|
180
|
+
const valueTextStyle = {
|
|
181
|
+
...NO_WRAP_TEXT,
|
|
182
|
+
color: valueColor,
|
|
183
|
+
fontFamily: valueFontFamily,
|
|
184
|
+
fontSize: valueFontSize,
|
|
185
|
+
lineHeight: valueLineHeight,
|
|
186
|
+
fontWeight: toWeight(valueFontWeight),
|
|
187
|
+
textAlign: 'center'
|
|
188
|
+
};
|
|
189
|
+
const planHeaderColumnStyle = {
|
|
190
|
+
alignItems: 'center',
|
|
191
|
+
justifyContent: 'center'
|
|
192
|
+
};
|
|
193
|
+
const renderValue = (value, cellKey) => {
|
|
194
|
+
// "Not available" → muted cross icon.
|
|
195
|
+
if (value === false) {
|
|
196
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
197
|
+
name: "ic_close",
|
|
198
|
+
size: iconSize,
|
|
199
|
+
color: labelDisabledColor
|
|
200
|
+
}, cellKey);
|
|
201
|
+
}
|
|
202
|
+
// Empty cell.
|
|
203
|
+
if (value === null || value === undefined || value === true) {
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
// Text content.
|
|
207
|
+
if (typeof value === 'string' || typeof value === 'number') {
|
|
208
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
209
|
+
style: valueTextStyle,
|
|
210
|
+
children: value
|
|
211
|
+
}, cellKey);
|
|
212
|
+
}
|
|
213
|
+
// Custom node — forward modes so themed children stay in sync.
|
|
214
|
+
return (0, _reactUtils.cloneChildrenWithModes)(value, modes);
|
|
215
|
+
};
|
|
216
|
+
const labelCellStyle = {
|
|
217
|
+
flexDirection: 'row',
|
|
218
|
+
alignItems: 'center',
|
|
219
|
+
gap: cellGap,
|
|
220
|
+
padding: cellPadding,
|
|
221
|
+
minHeight: cellMinHeight,
|
|
222
|
+
flexShrink: 0
|
|
223
|
+
};
|
|
224
|
+
const valueCellStyle = {
|
|
225
|
+
flexDirection: 'row',
|
|
226
|
+
alignItems: 'center',
|
|
227
|
+
justifyContent: 'center',
|
|
228
|
+
padding: cellPadding,
|
|
229
|
+
minHeight: cellMinHeight,
|
|
230
|
+
flexShrink: 0
|
|
231
|
+
};
|
|
232
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
233
|
+
style: [{
|
|
234
|
+
gap,
|
|
235
|
+
alignSelf: 'flex-start'
|
|
236
|
+
}, style],
|
|
237
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
238
|
+
style: {
|
|
239
|
+
flexDirection: 'row',
|
|
240
|
+
alignItems: 'flex-end'
|
|
241
|
+
},
|
|
242
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
243
|
+
style: [columnWidthStyle(0), labelColumnFlex > 0 ? {
|
|
244
|
+
flexGrow: labelColumnFlex
|
|
245
|
+
} : undefined]
|
|
246
|
+
}), columns.map((column, index) => {
|
|
247
|
+
const colIndex = index + 1;
|
|
248
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
249
|
+
onLayout: e => onHeaderColumnLayout(colIndex, e),
|
|
250
|
+
style: [columnWidthStyle(colIndex), planHeaderColumnStyle],
|
|
251
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
252
|
+
style: [headerTextStyle, {
|
|
253
|
+
color: column.brand ? headerBrandFg : headerFg,
|
|
254
|
+
alignSelf: 'center'
|
|
255
|
+
}],
|
|
256
|
+
children: column.label
|
|
257
|
+
})
|
|
258
|
+
}, column.label ?? index);
|
|
259
|
+
})]
|
|
260
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
261
|
+
style: {
|
|
262
|
+
flexDirection: 'row',
|
|
263
|
+
alignSelf: 'flex-start',
|
|
264
|
+
backgroundColor: tableBackground,
|
|
265
|
+
borderWidth: tableBorderSize,
|
|
266
|
+
borderColor: tableBorderColor,
|
|
267
|
+
borderRadius: tableRadius,
|
|
268
|
+
overflow: 'hidden'
|
|
269
|
+
},
|
|
270
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
271
|
+
onLayout: e => onBodyColumnLayout(0, e),
|
|
272
|
+
style: [columnWidthStyle(0), labelColumnFlex > 0 ? {
|
|
273
|
+
flexGrow: labelColumnFlex
|
|
274
|
+
} : undefined],
|
|
275
|
+
children: rows.map((row, rowIndex) => {
|
|
276
|
+
const isLast = rowIndex === rows.length - 1;
|
|
277
|
+
const showInfo = row.showInfo || row.onInfoPress != null;
|
|
278
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
279
|
+
style: [labelCellStyle, {
|
|
280
|
+
borderBottomWidth: isLast ? 0 : cellBorderSize,
|
|
281
|
+
borderBottomColor: cellBorderColor
|
|
282
|
+
}],
|
|
283
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
284
|
+
style: labelTextStyle,
|
|
285
|
+
children: row.label
|
|
286
|
+
}), showInfo && (row.onInfoPress ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
287
|
+
onPress: row.onInfoPress,
|
|
288
|
+
accessibilityRole: "button",
|
|
289
|
+
accessibilityLabel: `More information about ${row.label}`,
|
|
290
|
+
hitSlop: 8,
|
|
291
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
292
|
+
name: "ic_info",
|
|
293
|
+
size: iconSize,
|
|
294
|
+
color: iconColor
|
|
295
|
+
})
|
|
296
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
297
|
+
name: "ic_info",
|
|
298
|
+
size: iconSize,
|
|
299
|
+
color: iconColor
|
|
300
|
+
}))]
|
|
301
|
+
}, row.key ?? `${row.label}-${rowIndex}`);
|
|
302
|
+
})
|
|
303
|
+
}), columns.map((column, colIndex) => {
|
|
304
|
+
const colIndexWidth = colIndex + 1;
|
|
305
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
306
|
+
onLayout: e => onBodyColumnLayout(colIndexWidth, e),
|
|
307
|
+
style: [columnWidthStyle(colIndexWidth), planHeaderColumnStyle],
|
|
308
|
+
children: rows.map((row, rowIndex) => {
|
|
309
|
+
const isLast = rowIndex === rows.length - 1;
|
|
310
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
311
|
+
style: [valueCellStyle, {
|
|
312
|
+
borderBottomWidth: isLast ? 0 : cellBorderSize,
|
|
313
|
+
borderBottomColor: cellBorderColor
|
|
314
|
+
}],
|
|
315
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
316
|
+
style: {
|
|
317
|
+
flexShrink: 0
|
|
318
|
+
},
|
|
319
|
+
children: renderValue(row.values?.[colIndex], `${rowIndex}-${colIndex}`)
|
|
320
|
+
})
|
|
321
|
+
}, row.key ?? `${row.label}-${rowIndex}`);
|
|
322
|
+
})
|
|
323
|
+
}, column.label ?? colIndex);
|
|
324
|
+
})]
|
|
325
|
+
})]
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
var _default = exports.default = PlanComparisonCard;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
|
|
10
|
+
var _JFSThemeProvider = require("../../design-tokens/JFSThemeProvider");
|
|
11
|
+
var _reactUtils = require("../../utils/react-utils");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
+
/**
|
|
15
|
+
* Slot — a token-driven layout container for grouped slot content.
|
|
16
|
+
*
|
|
17
|
+
* Use `Slot` instead of a raw `View` when you need a vertical or horizontal
|
|
18
|
+
* stack with design-token gap spacing and automatic `modes` propagation to
|
|
19
|
+
* children. Typical usage is nesting a column of actions inside a
|
|
20
|
+
* direction-locked parent such as `ActionFooter`:
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <ActionFooter modes={modes}>
|
|
25
|
+
* <Slot layoutDirection="vertical" modes={modes}>
|
|
26
|
+
* <Button label="Continue" modes={primaryModes} />
|
|
27
|
+
* <Disclaimer disclaimer="Terms apply." modes={modes} />
|
|
28
|
+
* </Slot>
|
|
29
|
+
* </ActionFooter>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
function Slot({
|
|
33
|
+
children,
|
|
34
|
+
layoutDirection = 'vertical',
|
|
35
|
+
alignCrossAxis,
|
|
36
|
+
justifyMainAxis,
|
|
37
|
+
modes: propModes = _reactUtils.EMPTY_MODES,
|
|
38
|
+
style,
|
|
39
|
+
...rest
|
|
40
|
+
}) {
|
|
41
|
+
const {
|
|
42
|
+
modes: globalModes
|
|
43
|
+
} = (0, _JFSThemeProvider.useTokens)();
|
|
44
|
+
const modes = (0, _react.useMemo)(() => ({
|
|
45
|
+
...globalModes,
|
|
46
|
+
...propModes
|
|
47
|
+
}), [globalModes, propModes]);
|
|
48
|
+
const {
|
|
49
|
+
containerStyle,
|
|
50
|
+
processedChildren
|
|
51
|
+
} = (0, _react.useMemo)(() => {
|
|
52
|
+
const gap = (0, _figmaVariablesResolver.getVariableByName)('slot/gap', modes) ?? 8;
|
|
53
|
+
const isHorizontal = layoutDirection === 'horizontal';
|
|
54
|
+
const container = {
|
|
55
|
+
flexDirection: isHorizontal ? 'row' : 'column',
|
|
56
|
+
alignItems: alignCrossAxis ?? (isHorizontal ? 'flex-start' : 'stretch'),
|
|
57
|
+
justifyContent: justifyMainAxis ?? (isHorizontal ? 'center' : undefined),
|
|
58
|
+
alignSelf: 'stretch',
|
|
59
|
+
gap
|
|
60
|
+
};
|
|
61
|
+
const processed = children ? (0, _reactUtils.cloneChildrenWithModes)(children, modes) : null;
|
|
62
|
+
return {
|
|
63
|
+
containerStyle: container,
|
|
64
|
+
processedChildren: processed
|
|
65
|
+
};
|
|
66
|
+
}, [children, modes, layoutDirection, alignCrossAxis, justifyMainAxis]);
|
|
67
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
68
|
+
style: [containerStyle, style],
|
|
69
|
+
...rest,
|
|
70
|
+
children: processedChildren
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
var _default = exports.default = /*#__PURE__*/_react.default.memo(Slot);
|
|
@@ -45,6 +45,12 @@ Object.defineProperty(exports, "AppBar", {
|
|
|
45
45
|
return _AppBar.default;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
+
Object.defineProperty(exports, "Attached", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _Attached.default;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
48
54
|
Object.defineProperty(exports, "Avatar", {
|
|
49
55
|
enumerable: true,
|
|
50
56
|
get: function () {
|
|
@@ -489,6 +495,12 @@ Object.defineProperty(exports, "PaymentFeedback", {
|
|
|
489
495
|
return _PaymentFeedback.default;
|
|
490
496
|
}
|
|
491
497
|
});
|
|
498
|
+
Object.defineProperty(exports, "PlanComparisonCard", {
|
|
499
|
+
enumerable: true,
|
|
500
|
+
get: function () {
|
|
501
|
+
return _PlanComparisonCard.default;
|
|
502
|
+
}
|
|
503
|
+
});
|
|
492
504
|
Object.defineProperty(exports, "Popup", {
|
|
493
505
|
enumerable: true,
|
|
494
506
|
get: function () {
|
|
@@ -585,6 +597,12 @@ Object.defineProperty(exports, "SegmentedTrackSegment", {
|
|
|
585
597
|
return _SegmentedTrack.SegmentedTrackSegment;
|
|
586
598
|
}
|
|
587
599
|
});
|
|
600
|
+
Object.defineProperty(exports, "Slot", {
|
|
601
|
+
enumerable: true,
|
|
602
|
+
get: function () {
|
|
603
|
+
return _Slot.default;
|
|
604
|
+
}
|
|
605
|
+
});
|
|
588
606
|
Object.defineProperty(exports, "StatGroup", {
|
|
589
607
|
enumerable: true,
|
|
590
608
|
get: function () {
|
|
@@ -797,6 +815,7 @@ Object.defineProperty(exports, "useToast", {
|
|
|
797
815
|
});
|
|
798
816
|
var _AccountCard = _interopRequireDefault(require("./AccountCard/AccountCard"));
|
|
799
817
|
var _ActionFooter = _interopRequireDefault(require("./ActionFooter/ActionFooter"));
|
|
818
|
+
var _Attached = _interopRequireDefault(require("./Attached/Attached"));
|
|
800
819
|
var _AppBar = _interopRequireDefault(require("./AppBar/AppBar"));
|
|
801
820
|
var _Avatar = _interopRequireDefault(require("./Avatar/Avatar"));
|
|
802
821
|
var _AvatarGroup = _interopRequireDefault(require("./AvatarGroup/AvatarGroup"));
|
|
@@ -858,6 +877,7 @@ var _Numpad = _interopRequireDefault(require("./Numpad/Numpad"));
|
|
|
858
877
|
var _Title = _interopRequireDefault(require("./Title/Title"));
|
|
859
878
|
var _Screen = _interopRequireDefault(require("./Screen/Screen"));
|
|
860
879
|
var _Section = _interopRequireDefault(require("./Section/Section"));
|
|
880
|
+
var _Slot = _interopRequireDefault(require("./Slot/Slot"));
|
|
861
881
|
var _Stepper = _interopRequireDefault(require("./Stepper/Stepper"));
|
|
862
882
|
var _Step = require("./Stepper/Step");
|
|
863
883
|
var _StepLabel = require("./Stepper/StepLabel");
|
|
@@ -901,6 +921,7 @@ var _AmountInput = _interopRequireDefault(require("./AmountInput/AmountInput"));
|
|
|
901
921
|
var _PageHero = _interopRequireDefault(require("./PageHero/PageHero"));
|
|
902
922
|
var _Popup = _interopRequireDefault(require("./Popup/Popup"));
|
|
903
923
|
var _PortfolioHero = _interopRequireDefault(require("./PortfolioHero/PortfolioHero"));
|
|
924
|
+
var _PlanComparisonCard = _interopRequireDefault(require("./PlanComparisonCard/PlanComparisonCard"));
|
|
904
925
|
var _PoweredByLabel = _interopRequireDefault(require("./PoweredByLabel/PoweredByLabel"));
|
|
905
926
|
var _ProductLabel = _interopRequireDefault(require("./ProductLabel/ProductLabel"));
|
|
906
927
|
var _ProductOverview = _interopRequireDefault(require("./ProductOverview/ProductOverview"));
|