jfs-components 0.1.25 → 0.1.30
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 +53 -0
- package/lib/commonjs/components/AutoplayControl/AutoplayControl.js +66 -0
- package/lib/commonjs/components/Carousel/Carousel.js +112 -19
- package/lib/commonjs/components/CompareTable/CompareTable.js +191 -25
- package/lib/commonjs/components/ContentSheet/ContentSheet.js +104 -10
- package/lib/commonjs/components/FormUpload/Additem.js +168 -0
- package/lib/commonjs/components/FormUpload/FormUpload.js +198 -0
- package/lib/commonjs/components/Grid/Grid.js +206 -0
- package/lib/commonjs/components/MoneyValue/MoneyValue.js +179 -54
- package/lib/commonjs/components/NumberPagination/NumberPagination.js +144 -0
- package/lib/commonjs/components/PdpCcCard/PdpCcCard.js +7 -1
- package/lib/commonjs/components/ProfileCard/ProfileCard.js +208 -0
- package/lib/commonjs/components/Table/Table.js +27 -7
- package/lib/commonjs/components/UpiHandle/UpiHandle.js +23 -11
- package/lib/commonjs/components/index.js +42 -0
- package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/commonjs/design-tokens/figma-modes.generated.js +21 -10
- package/lib/commonjs/icons/components/IconBrokenimage.js +19 -0
- package/lib/commonjs/icons/components/IconImage.js +19 -0
- package/lib/commonjs/icons/components/IconMic.js +19 -0
- package/lib/commonjs/icons/components/IconMicoff.js +19 -0
- package/lib/commonjs/icons/components/IconPause.js +19 -0
- package/lib/commonjs/icons/components/IconPlay.js +19 -0
- package/lib/commonjs/icons/components/index.js +66 -0
- package/lib/commonjs/icons/registry.js +2 -2
- package/lib/module/components/AutoplayControl/AutoplayControl.js +60 -0
- package/lib/module/components/Carousel/Carousel.js +111 -19
- package/lib/module/components/CompareTable/CompareTable.js +191 -26
- package/lib/module/components/ContentSheet/ContentSheet.js +108 -14
- package/lib/module/components/FormUpload/Additem.js +162 -0
- package/lib/module/components/FormUpload/FormUpload.js +192 -0
- package/lib/module/components/Grid/Grid.js +201 -0
- package/lib/module/components/MoneyValue/MoneyValue.js +182 -57
- package/lib/module/components/NumberPagination/NumberPagination.js +138 -0
- package/lib/module/components/PdpCcCard/PdpCcCard.js +7 -1
- package/lib/module/components/ProfileCard/ProfileCard.js +202 -0
- package/lib/module/components/Table/Table.js +27 -7
- package/lib/module/components/UpiHandle/UpiHandle.js +23 -11
- package/lib/module/components/index.js +7 -1
- package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/module/design-tokens/figma-modes.generated.js +21 -10
- package/lib/module/icons/components/IconBrokenimage.js +12 -0
- package/lib/module/icons/components/IconImage.js +12 -0
- package/lib/module/icons/components/IconMic.js +12 -0
- package/lib/module/icons/components/IconMicoff.js +12 -0
- package/lib/module/icons/components/IconPause.js +12 -0
- package/lib/module/icons/components/IconPlay.js +12 -0
- package/lib/module/icons/components/index.js +6 -0
- package/lib/module/icons/registry.js +2 -2
- package/lib/typescript/src/components/AutoplayControl/AutoplayControl.d.ts +15 -0
- package/lib/typescript/src/components/Carousel/Carousel.d.ts +8 -1
- package/lib/typescript/src/components/CompareTable/CompareTable.d.ts +21 -1
- package/lib/typescript/src/components/ContentSheet/ContentSheet.d.ts +20 -1
- package/lib/typescript/src/components/FormUpload/Additem.d.ts +96 -0
- package/lib/typescript/src/components/FormUpload/FormUpload.d.ts +85 -0
- package/lib/typescript/src/components/Grid/Grid.d.ts +87 -0
- package/lib/typescript/src/components/MoneyValue/MoneyValue.d.ts +10 -1
- package/lib/typescript/src/components/NumberPagination/NumberPagination.d.ts +21 -0
- package/lib/typescript/src/components/PdpCcCard/PdpCcCard.d.ts +25 -1
- package/lib/typescript/src/components/ProfileCard/ProfileCard.d.ts +89 -0
- package/lib/typescript/src/components/Table/Table.d.ts +9 -1
- package/lib/typescript/src/components/UpiHandle/UpiHandle.d.ts +7 -1
- package/lib/typescript/src/components/index.d.ts +34 -28
- package/lib/typescript/src/design-tokens/figma-modes.generated.d.ts +10 -4
- package/lib/typescript/src/icons/components/IconBrokenimage.d.ts +3 -0
- package/lib/typescript/src/icons/components/IconImage.d.ts +3 -0
- package/lib/typescript/src/icons/components/IconMic.d.ts +3 -0
- package/lib/typescript/src/icons/components/IconMicoff.d.ts +3 -0
- package/lib/typescript/src/icons/components/IconPause.d.ts +3 -0
- package/lib/typescript/src/icons/components/IconPlay.d.ts +3 -0
- package/lib/typescript/src/icons/components/index.d.ts +6 -0
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/AutoplayControl/AutoplayControl.tsx +77 -0
- package/src/components/Carousel/Carousel.tsx +133 -23
- package/src/components/CompareTable/CompareTable.tsx +224 -30
- package/src/components/ContentSheet/ContentSheet.tsx +138 -8
- package/src/components/FormUpload/Additem.tsx +262 -0
- package/src/components/FormUpload/FormUpload.tsx +313 -0
- package/src/components/Grid/Grid.tsx +368 -0
- package/src/components/MoneyValue/MoneyValue.tsx +216 -65
- package/src/components/NumberPagination/NumberPagination.tsx +170 -0
- package/src/components/PdpCcCard/PdpCcCard.tsx +36 -1
- package/src/components/ProfileCard/ProfileCard.tsx +268 -0
- package/src/components/Table/Table.tsx +29 -4
- package/src/components/UpiHandle/UpiHandle.tsx +35 -24
- package/src/components/index.ts +329 -182
- package/src/design-tokens/Coin Variables-variables-full.json +1 -1
- package/src/design-tokens/figma-modes.generated.ts +21 -10
- package/src/icons/components/IconBrokenimage.tsx +11 -0
- package/src/icons/components/IconImage.tsx +11 -0
- package/src/icons/components/IconMic.tsx +11 -0
- package/src/icons/components/IconMicoff.tsx +11 -0
- package/src/icons/components/IconPause.tsx +11 -0
- package/src/icons/components/IconPlay.tsx +11 -0
- package/src/icons/components/index.ts +6 -0
- package/src/icons/registry.ts +25 -1
|
@@ -0,0 +1,208 @@
|
|
|
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 _Avatar = _interopRequireDefault(require("../Avatar/Avatar"));
|
|
13
|
+
var _Attached = _interopRequireDefault(require("../Attached/Attached"));
|
|
14
|
+
var _IconCapsule = _interopRequireDefault(require("../IconCapsule/IconCapsule"));
|
|
15
|
+
var _ListItem = _interopRequireDefault(require("../ListItem/ListItem"));
|
|
16
|
+
var _UpiHandle = _interopRequireDefault(require("../UpiHandle/UpiHandle"));
|
|
17
|
+
var _Divider = _interopRequireDefault(require("../Divider/Divider"));
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
|
+
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); }
|
|
21
|
+
/**
|
|
22
|
+
* A single UPI handle pill rendered under the profile name.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
// Forced modes for everything rendered inside the card — the profile card is
|
|
26
|
+
// an on-dark (jioPlus) surface, so child components (Avatar, UpiHandle,
|
|
27
|
+
// ListItem, Divider, Text, Button, …) must resolve their tokens through the
|
|
28
|
+
// `context 10: jioPlus` mode. Consumer modes are spread first so appearance
|
|
29
|
+
// modes (e.g. `Profile Card Appearance: Premium`) still cascade through.
|
|
30
|
+
const CARD_CONTEXT = Object.freeze({
|
|
31
|
+
'context 10': 'jioPlus'
|
|
32
|
+
});
|
|
33
|
+
const DEFAULT_UPI_HANDLES = [{
|
|
34
|
+
label: 'username@jio',
|
|
35
|
+
iconName: 'ic_copy'
|
|
36
|
+
}, {
|
|
37
|
+
label: '9999999999',
|
|
38
|
+
iconName: 'ic_confirm'
|
|
39
|
+
}];
|
|
40
|
+
function resolveProfileCardTokens(modes) {
|
|
41
|
+
const backgroundColor = (0, _figmaVariablesResolver.getVariableByName)('profileCard/bg', modes) ?? '#00065a';
|
|
42
|
+
const gap = (0, _figmaVariablesResolver.getVariableByName)('profileCard/gap', modes) ?? 12;
|
|
43
|
+
const borderRadius = (0, _figmaVariablesResolver.getVariableByName)('profileCard/radius', modes) ?? 12;
|
|
44
|
+
const paddingHorizontal = (0, _figmaVariablesResolver.getVariableByName)('profileCard/padding/horizontal', modes) ?? 20;
|
|
45
|
+
const paddingVertical = (0, _figmaVariablesResolver.getVariableByName)('profileCard/padding/vertical', modes) ?? 20;
|
|
46
|
+
const childModes = {
|
|
47
|
+
...modes,
|
|
48
|
+
...CARD_CONTEXT
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// The UPI handle pills sit in the header ListItem's support slot, whose row
|
|
52
|
+
// gap is the `slot/gap` token in the ListItem context.
|
|
53
|
+
const handlesGap = (0, _figmaVariablesResolver.getVariableByName)('slot/gap', {
|
|
54
|
+
...childModes,
|
|
55
|
+
Context: 'ListItem'
|
|
56
|
+
}) ?? 2;
|
|
57
|
+
|
|
58
|
+
// The avatar badge is a white circle: the fill comes from the Attached
|
|
59
|
+
// slot's background token (the IconCapsule itself resolves transparent).
|
|
60
|
+
const badgeBackground = (0, _figmaVariablesResolver.getVariableByName)('attached/slot/background', childModes) ?? '#ffffff';
|
|
61
|
+
return {
|
|
62
|
+
containerStyle: {
|
|
63
|
+
backgroundColor,
|
|
64
|
+
borderRadius,
|
|
65
|
+
paddingHorizontal,
|
|
66
|
+
paddingVertical,
|
|
67
|
+
gap,
|
|
68
|
+
flexDirection: 'column',
|
|
69
|
+
alignItems: 'stretch'
|
|
70
|
+
},
|
|
71
|
+
handlesRowStyle: {
|
|
72
|
+
flexDirection: 'row',
|
|
73
|
+
flexWrap: 'wrap',
|
|
74
|
+
alignItems: 'center',
|
|
75
|
+
alignSelf: 'flex-start',
|
|
76
|
+
gap: handlesGap
|
|
77
|
+
},
|
|
78
|
+
badgeBackground,
|
|
79
|
+
childModes,
|
|
80
|
+
// XS capsule per the Figma spec; consumers can still override the size
|
|
81
|
+
// through their own modes.
|
|
82
|
+
badgeModes: {
|
|
83
|
+
'Icon Capsule Size': 'XS',
|
|
84
|
+
...modes,
|
|
85
|
+
...CARD_CONTEXT
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* ProfileCard — Figma node 6914:38498 ("Profile Card").
|
|
92
|
+
*
|
|
93
|
+
* A dark, rounded profile summary card composed from the shared primitives:
|
|
94
|
+
*
|
|
95
|
+
* - **Header** — a {@link ListItem} whose leading slot is an {@link Attached}
|
|
96
|
+
* monogram {@link Avatar} with a small {@link IconCapsule} badge at its
|
|
97
|
+
* bottom-right, the user's name as the title, and a row of
|
|
98
|
+
* {@link UpiHandle} pills in the support slot.
|
|
99
|
+
* - **Divider** — separates the header from the body.
|
|
100
|
+
* - **Body slot** — arbitrary children (typically `ListItem`s separated by
|
|
101
|
+
* `Divider`s). All profile-card context modes cascade into the slot, so
|
|
102
|
+
* nested components automatically resolve their on-dark token values.
|
|
103
|
+
*
|
|
104
|
+
* The card supports the `Profile Card Appearance` collection
|
|
105
|
+
* (`Default` | `Premium`) via the `modes` prop, which recolors the container,
|
|
106
|
+
* avatar, pills and divider in one go.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```tsx
|
|
110
|
+
* <ProfileCard
|
|
111
|
+
* name="Shruti Chandarshekhar Rai"
|
|
112
|
+
* monogram="SR"
|
|
113
|
+
* upiHandles={[
|
|
114
|
+
* { label: 'shrutirai-1@jio', iconName: 'ic_copy', onPress: copyHandle },
|
|
115
|
+
* { label: '9184844184', iconName: 'ic_confirm' },
|
|
116
|
+
* ]}
|
|
117
|
+
* >
|
|
118
|
+
* <ListItem layout="Horizontal" title="JioFinance+" navArrow={false} />
|
|
119
|
+
* </ProfileCard>
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
function ProfileCard({
|
|
123
|
+
name = 'Name',
|
|
124
|
+
monogram = 'MS',
|
|
125
|
+
avatarSource,
|
|
126
|
+
badgeIcon = 'ic_qr_code',
|
|
127
|
+
upiHandles = DEFAULT_UPI_HANDLES,
|
|
128
|
+
header,
|
|
129
|
+
children,
|
|
130
|
+
showDivider = true,
|
|
131
|
+
width = 344,
|
|
132
|
+
modes: propModes = _reactUtils.EMPTY_MODES,
|
|
133
|
+
style,
|
|
134
|
+
accessibilityLabel
|
|
135
|
+
}) {
|
|
136
|
+
const {
|
|
137
|
+
modes: globalModes
|
|
138
|
+
} = (0, _JFSThemeProvider.useTokens)();
|
|
139
|
+
const modes = (0, _react.useMemo)(() => globalModes === _reactUtils.EMPTY_MODES && propModes === _reactUtils.EMPTY_MODES ? _reactUtils.EMPTY_MODES : {
|
|
140
|
+
...globalModes,
|
|
141
|
+
...propModes
|
|
142
|
+
}, [globalModes, propModes]);
|
|
143
|
+
const tokens = (0, _react.useMemo)(() => resolveProfileCardTokens(modes), [modes]);
|
|
144
|
+
|
|
145
|
+
// ---- Header -------------------------------------------------------------
|
|
146
|
+
const headerNode = (0, _react.useMemo)(() => {
|
|
147
|
+
if (header) return (0, _reactUtils.cloneChildrenWithModes)(header, tokens.childModes);
|
|
148
|
+
const avatar = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Attached.default, {
|
|
149
|
+
position: "bottom-right",
|
|
150
|
+
modes: tokens.childModes,
|
|
151
|
+
badge: badgeIcon != null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconCapsule.default, {
|
|
152
|
+
iconName: badgeIcon,
|
|
153
|
+
modes: tokens.badgeModes,
|
|
154
|
+
style: {
|
|
155
|
+
backgroundColor: tokens.badgeBackground
|
|
156
|
+
}
|
|
157
|
+
}) : null,
|
|
158
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.default, {
|
|
159
|
+
monogram: monogram,
|
|
160
|
+
style: avatarSource ? 'Image' : 'Monogram',
|
|
161
|
+
...(avatarSource != null ? {
|
|
162
|
+
imageSource: avatarSource
|
|
163
|
+
} : {}),
|
|
164
|
+
modes: tokens.childModes
|
|
165
|
+
})
|
|
166
|
+
});
|
|
167
|
+
const handles = upiHandles.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
168
|
+
style: tokens.handlesRowStyle,
|
|
169
|
+
children: upiHandles.map((handle, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_UpiHandle.default, {
|
|
170
|
+
label: handle.label,
|
|
171
|
+
...(handle.iconName != null ? {
|
|
172
|
+
iconName: handle.iconName
|
|
173
|
+
} : {}),
|
|
174
|
+
showIcon: handle.showIcon ?? true,
|
|
175
|
+
...(handle.onPress != null ? {
|
|
176
|
+
onPress: handle.onPress
|
|
177
|
+
} : {}),
|
|
178
|
+
modes: tokens.childModes
|
|
179
|
+
}, `${handle.label}-${index}`))
|
|
180
|
+
}) : null;
|
|
181
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListItem.default, {
|
|
182
|
+
layout: "Horizontal",
|
|
183
|
+
title: name,
|
|
184
|
+
navArrow: false,
|
|
185
|
+
showSupportText: handles != null,
|
|
186
|
+
supportSlot: handles,
|
|
187
|
+
leading: avatar,
|
|
188
|
+
modes: tokens.childModes
|
|
189
|
+
});
|
|
190
|
+
}, [header, name, monogram, avatarSource, badgeIcon, upiHandles, tokens]);
|
|
191
|
+
|
|
192
|
+
// ---- Body slot ----------------------------------------------------------
|
|
193
|
+
const bodyChildren = (0, _react.useMemo)(() => children != null ? (0, _reactUtils.cloneChildrenWithModes)(children, tokens.childModes) : null, [children, tokens.childModes]);
|
|
194
|
+
const hasBody = bodyChildren != null && bodyChildren.length > 0;
|
|
195
|
+
const containerStyle = (0, _react.useMemo)(() => ({
|
|
196
|
+
...tokens.containerStyle,
|
|
197
|
+
width
|
|
198
|
+
}), [tokens.containerStyle, width]);
|
|
199
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
200
|
+
style: [containerStyle, style],
|
|
201
|
+
accessibilityLabel: accessibilityLabel,
|
|
202
|
+
children: [headerNode, hasBody && showDivider ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Divider.default, {
|
|
203
|
+
direction: "horizontal",
|
|
204
|
+
modes: tokens.childModes
|
|
205
|
+
}) : null, bodyChildren]
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
var _default = exports.default = /*#__PURE__*/_react.default.memo(ProfileCard);
|
|
@@ -9,12 +9,22 @@ exports.TableHeader = TableHeader;
|
|
|
9
9
|
exports.TableHeaderCell = TableHeaderCell;
|
|
10
10
|
exports.TableRow = TableRow;
|
|
11
11
|
exports.default = void 0;
|
|
12
|
-
var _react =
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _reactNative = require("react-native");
|
|
14
14
|
var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
|
|
15
15
|
var _reactUtils = require("../../utils/react-utils");
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
function
|
|
17
|
+
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); }
|
|
18
|
+
/**
|
|
19
|
+
* Carries the root `Table`'s `columnWidth` down to every cell so that, when it
|
|
20
|
+
* is set, all columns (header + body, data-driven or composed) share the same
|
|
21
|
+
* fixed width without each cell having to repeat the prop. Cells still honour
|
|
22
|
+
* an explicit `width` prop over this context value. `undefined` (the default,
|
|
23
|
+
* when no `Table` ancestor is present, or `columnWidth` is unset) leaves cells
|
|
24
|
+
* to flex — preserving the original behaviour.
|
|
25
|
+
*/
|
|
26
|
+
const TableContext = /*#__PURE__*/(0, _react.createContext)(undefined);
|
|
27
|
+
|
|
18
28
|
/* -------------------------------------------------------------------------------------------------
|
|
19
29
|
* Shared types & token resolution
|
|
20
30
|
* -----------------------------------------------------------------------------------------------*/
|
|
@@ -98,6 +108,10 @@ function TableCell({
|
|
|
98
108
|
style
|
|
99
109
|
}) {
|
|
100
110
|
const t = resolveTableTokens(modes);
|
|
111
|
+
// A cell's width resolves in priority order: an explicit `width` prop, then
|
|
112
|
+
// the root Table's `columnWidth` (via context), then fall back to flex.
|
|
113
|
+
const ctxColumnWidth = (0, _react.useContext)(TableContext);
|
|
114
|
+
const effectiveWidth = width ?? ctxColumnWidth;
|
|
101
115
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
102
116
|
style: [{
|
|
103
117
|
backgroundColor: t.cellBg,
|
|
@@ -109,8 +123,8 @@ function TableCell({
|
|
|
109
123
|
borderColor: t.borderColor,
|
|
110
124
|
borderBottomWidth: isLastRow ? 0 : t.borderSize,
|
|
111
125
|
borderRightWidth: isLastColumn ? 0 : t.borderSize,
|
|
112
|
-
...(
|
|
113
|
-
width
|
|
126
|
+
...(effectiveWidth != null ? {
|
|
127
|
+
width: effectiveWidth
|
|
114
128
|
} : {
|
|
115
129
|
flex,
|
|
116
130
|
minWidth: 0
|
|
@@ -138,6 +152,8 @@ function TableHeaderCell({
|
|
|
138
152
|
style
|
|
139
153
|
}) {
|
|
140
154
|
const t = resolveTableTokens(modes);
|
|
155
|
+
const ctxColumnWidth = (0, _react.useContext)(TableContext);
|
|
156
|
+
const effectiveWidth = width ?? ctxColumnWidth;
|
|
141
157
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
142
158
|
style: [{
|
|
143
159
|
backgroundColor: t.headerBg,
|
|
@@ -146,8 +162,8 @@ function TableHeaderCell({
|
|
|
146
162
|
justifyContent: alignToJustify(align),
|
|
147
163
|
paddingHorizontal: t.headerPaddingH,
|
|
148
164
|
paddingVertical: t.headerPaddingV,
|
|
149
|
-
...(
|
|
150
|
-
width
|
|
165
|
+
...(effectiveWidth != null ? {
|
|
166
|
+
width: effectiveWidth
|
|
151
167
|
} : {
|
|
152
168
|
flex,
|
|
153
169
|
minWidth: 0
|
|
@@ -262,6 +278,7 @@ function Table({
|
|
|
262
278
|
getRowKey,
|
|
263
279
|
onRowPress,
|
|
264
280
|
scrollable = false,
|
|
281
|
+
columnWidth,
|
|
265
282
|
accessibilityLabel,
|
|
266
283
|
modes = _reactUtils.EMPTY_MODES,
|
|
267
284
|
style
|
|
@@ -305,7 +322,10 @@ function Table({
|
|
|
305
322
|
}, !scrollable && {
|
|
306
323
|
width: '100%'
|
|
307
324
|
}, style],
|
|
308
|
-
children:
|
|
325
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TableContext.Provider, {
|
|
326
|
+
value: columnWidth,
|
|
327
|
+
children: body
|
|
328
|
+
})
|
|
309
329
|
});
|
|
310
330
|
if (scrollable) {
|
|
311
331
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
|
|
@@ -14,9 +14,6 @@ var _Icon = _interopRequireDefault(require("../../icons/Icon"));
|
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
16
|
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); }
|
|
17
|
-
// Default static asset from the component folder.
|
|
18
|
-
// Consumers can override the image via the `source` prop if needed.
|
|
19
|
-
const DEFAULT_AVATAR_IMAGE = require('./Image.png');
|
|
20
17
|
const IS_WEB = _reactNative.Platform.OS === 'web';
|
|
21
18
|
const IS_IOS = _reactNative.Platform.OS === 'ios';
|
|
22
19
|
const PRESS_DELAY = IS_IOS ? 130 : 0;
|
|
@@ -89,7 +86,7 @@ function resolveUpiHandleTokens(modes) {
|
|
|
89
86
|
* @param {Object} [props.modes={}] - Modes object passed directly to `getVariableByName`.
|
|
90
87
|
* @param {boolean} [props.showIcon=true] - Toggles the trailing icon visibility.
|
|
91
88
|
* @param {string} [props.iconName='ic_scan_qr_code'] - Icon name from the actions set.
|
|
92
|
-
* @param {UnifiedSource} [props.source] - Unified avatar source (URI, inline SVG XML, `require()` asset, SVG React component, or React element). Smart-detects raster vs SVG so the same prop works on iOS, Android and web.
|
|
89
|
+
* @param {UnifiedSource} [props.source] - Unified avatar source (URI, inline SVG XML, `require()` asset, SVG React component, or React element). Smart-detects raster vs SVG so the same prop works on iOS, Android and web. Providing a source force-sets `UPI Handle Image: True` (avatar shown); omitting it force-sets `False` (avatar hidden), overriding any `UPI Handle Image` value passed via `modes`.
|
|
93
90
|
* @param {ImageSourcePropType|UnifiedSource} [props.avatarSource] - Deprecated alias for `source`; kept for back-compat.
|
|
94
91
|
* @param {Function} [props.onClick] - Click/tap handler. Works as an alias for `onPress`.
|
|
95
92
|
* @param {string} [props.accessibilityLabel] - Accessibility label for screen readers
|
|
@@ -124,10 +121,24 @@ function UpiHandle({
|
|
|
124
121
|
const {
|
|
125
122
|
modes: globalModes
|
|
126
123
|
} = (0, _JFSThemeProvider.useTokens)();
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
124
|
+
|
|
125
|
+
// The avatar is fully driven by the presence of a `source`. It force-sets the
|
|
126
|
+
// Figma "UPI Handle Image" collection to `True` when a source is provided and
|
|
127
|
+
// `False` otherwise. This is applied last so it overrides any consumer-passed
|
|
128
|
+
// `UPI Handle Image` mode, keeping the avatar visibility and the token layout
|
|
129
|
+
// (symmetric padding in the hidden-image state) in lockstep with the source.
|
|
130
|
+
const hasSource = source != null || avatarSource != null;
|
|
131
|
+
const modes = (0, _react.useMemo)(() => {
|
|
132
|
+
const base = globalModes === _reactUtils.EMPTY_MODES && propModes === _reactUtils.EMPTY_MODES ? _reactUtils.EMPTY_MODES : {
|
|
133
|
+
...globalModes,
|
|
134
|
+
...propModes
|
|
135
|
+
};
|
|
136
|
+
return {
|
|
137
|
+
...base,
|
|
138
|
+
'UPI Handle Image': hasSource ? 'True' : 'False'
|
|
139
|
+
};
|
|
140
|
+
}, [globalModes, propModes, hasSource]);
|
|
141
|
+
const showImageResolved = hasSource;
|
|
131
142
|
const tokens = (0, _react.useMemo)(() => resolveUpiHandleTokens(modes), [modes]);
|
|
132
143
|
|
|
133
144
|
// Focus is a sustained visible state (web-only). Setter is gated so it
|
|
@@ -161,11 +172,12 @@ function UpiHandle({
|
|
|
161
172
|
|
|
162
173
|
// `source` wins; `avatarSource` is the legacy fallback. Both are accepted
|
|
163
174
|
// as a UnifiedSource (string / number / {uri} / component / element), and
|
|
164
|
-
// the legacy `ImageSourcePropType` shapes naturally fit that union too.
|
|
165
|
-
|
|
175
|
+
// the legacy `ImageSourcePropType` shapes naturally fit that union too. This
|
|
176
|
+
// is only read when `showImageResolved` is true, which requires a source.
|
|
177
|
+
const resolvedAvatarSource = source ?? avatarSource;
|
|
166
178
|
const avatarSize = tokens.avatarStyle.width ?? 23;
|
|
167
179
|
const innerContent = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
168
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
180
|
+
children: [showImageResolved && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
169
181
|
style: tokens.avatarStyle,
|
|
170
182
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MediaSource.default, {
|
|
171
183
|
source: resolvedAvatarSource,
|
|
@@ -33,6 +33,12 @@ Object.defineProperty(exports, "ActionTile", {
|
|
|
33
33
|
return _ActionTile.default;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
+
Object.defineProperty(exports, "Additem", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _Additem.default;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
36
42
|
Object.defineProperty(exports, "AllocationComparisonChart", {
|
|
37
43
|
enumerable: true,
|
|
38
44
|
get: function () {
|
|
@@ -63,6 +69,12 @@ Object.defineProperty(exports, "Attached", {
|
|
|
63
69
|
return _Attached.default;
|
|
64
70
|
}
|
|
65
71
|
});
|
|
72
|
+
Object.defineProperty(exports, "AutoplayControl", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _AutoplayControl.default;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
66
78
|
Object.defineProperty(exports, "Avatar", {
|
|
67
79
|
enumerable: true,
|
|
68
80
|
get: function () {
|
|
@@ -375,6 +387,12 @@ Object.defineProperty(exports, "FormField", {
|
|
|
375
387
|
return _FormField.default;
|
|
376
388
|
}
|
|
377
389
|
});
|
|
390
|
+
Object.defineProperty(exports, "FormUpload", {
|
|
391
|
+
enumerable: true,
|
|
392
|
+
get: function () {
|
|
393
|
+
return _FormUpload.default;
|
|
394
|
+
}
|
|
395
|
+
});
|
|
378
396
|
Object.defineProperty(exports, "FullscreenModal", {
|
|
379
397
|
enumerable: true,
|
|
380
398
|
get: function () {
|
|
@@ -387,6 +405,12 @@ Object.defineProperty(exports, "Gauge", {
|
|
|
387
405
|
return _Gauge.default;
|
|
388
406
|
}
|
|
389
407
|
});
|
|
408
|
+
Object.defineProperty(exports, "Grid", {
|
|
409
|
+
enumerable: true,
|
|
410
|
+
get: function () {
|
|
411
|
+
return _Grid.default;
|
|
412
|
+
}
|
|
413
|
+
});
|
|
390
414
|
Object.defineProperty(exports, "HStack", {
|
|
391
415
|
enumerable: true,
|
|
392
416
|
get: function () {
|
|
@@ -543,6 +567,12 @@ Object.defineProperty(exports, "Nudge", {
|
|
|
543
567
|
return _Nudge.default;
|
|
544
568
|
}
|
|
545
569
|
});
|
|
570
|
+
Object.defineProperty(exports, "NumberPagination", {
|
|
571
|
+
enumerable: true,
|
|
572
|
+
get: function () {
|
|
573
|
+
return _NumberPagination.default;
|
|
574
|
+
}
|
|
575
|
+
});
|
|
546
576
|
Object.defineProperty(exports, "Numpad", {
|
|
547
577
|
enumerable: true,
|
|
548
578
|
get: function () {
|
|
@@ -627,6 +657,12 @@ Object.defineProperty(exports, "ProductOverview", {
|
|
|
627
657
|
return _ProductOverview.default;
|
|
628
658
|
}
|
|
629
659
|
});
|
|
660
|
+
Object.defineProperty(exports, "ProfileCard", {
|
|
661
|
+
enumerable: true,
|
|
662
|
+
get: function () {
|
|
663
|
+
return _ProfileCard.default;
|
|
664
|
+
}
|
|
665
|
+
});
|
|
630
666
|
Object.defineProperty(exports, "ProgressBadge", {
|
|
631
667
|
enumerable: true,
|
|
632
668
|
get: function () {
|
|
@@ -1029,6 +1065,9 @@ var _FilterBar = _interopRequireDefault(require("./FilterBar/FilterBar"));
|
|
|
1029
1065
|
var _FullscreenModal = _interopRequireDefault(require("./FullscreenModal/FullscreenModal"));
|
|
1030
1066
|
var _Form = _interopRequireWildcard(require("./Form/Form"));
|
|
1031
1067
|
var _FormField = _interopRequireDefault(require("./FormField/FormField"));
|
|
1068
|
+
var _Grid = _interopRequireDefault(require("./Grid/Grid"));
|
|
1069
|
+
var _FormUpload = _interopRequireDefault(require("./FormUpload/FormUpload"));
|
|
1070
|
+
var _Additem = _interopRequireDefault(require("./FormUpload/Additem"));
|
|
1032
1071
|
var _ContentSheet = _interopRequireDefault(require("./ContentSheet/ContentSheet"));
|
|
1033
1072
|
var _CircularProgressBar = _interopRequireDefault(require("./CircularProgressBar/CircularProgressBar"));
|
|
1034
1073
|
var _CircularProgressBarDoted = _interopRequireDefault(require("./CircularProgressBarDoted/CircularProgressBarDoted"));
|
|
@@ -1124,6 +1163,7 @@ var _CompareTable = _interopRequireDefault(require("./CompareTable/CompareTable"
|
|
|
1124
1163
|
var _Table = _interopRequireWildcard(require("./Table/Table"));
|
|
1125
1164
|
var _PoweredByLabel = _interopRequireDefault(require("./PoweredByLabel/PoweredByLabel"));
|
|
1126
1165
|
var _ProductLabel = _interopRequireDefault(require("./ProductLabel/ProductLabel"));
|
|
1166
|
+
var _ProfileCard = _interopRequireDefault(require("./ProfileCard/ProfileCard"));
|
|
1127
1167
|
var _ProductMerchandisingCard = _interopRequireDefault(require("./ProductMerchandisingCard/ProductMerchandisingCard"));
|
|
1128
1168
|
var _ProductOverview = _interopRequireDefault(require("./ProductOverview/ProductOverview"));
|
|
1129
1169
|
var _ProjectionMarker = _interopRequireDefault(require("./ProjectionMarker/ProjectionMarker"));
|
|
@@ -1140,5 +1180,7 @@ var _Text = _interopRequireDefault(require("./Text/Text"));
|
|
|
1140
1180
|
var _TextSegment = _interopRequireDefault(require("./TextSegment/TextSegment"));
|
|
1141
1181
|
var _SegmentedControl = _interopRequireDefault(require("./SegmentedControl/SegmentedControl"));
|
|
1142
1182
|
var _Toggle = _interopRequireDefault(require("./Toggle/Toggle"));
|
|
1183
|
+
var _AutoplayControl = _interopRequireDefault(require("./AutoplayControl/AutoplayControl"));
|
|
1184
|
+
var _NumberPagination = _interopRequireDefault(require("./NumberPagination/NumberPagination"));
|
|
1143
1185
|
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); }
|
|
1144
1186
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|