jfs-components 0.1.8 → 0.1.12
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 +16 -0
- package/lib/commonjs/components/Accordion/Accordion.js +2 -1
- package/lib/commonjs/components/AccordionCheckbox/AccordionCheckbox.js +4 -3
- package/lib/commonjs/components/AccountCard/AccountCard.js +4 -3
- package/lib/commonjs/components/AllocationComparisonChart/AllocationComparisonChart.js +9 -6
- package/lib/commonjs/components/AreaLineChart/AreaLineChart.js +11 -7
- package/lib/commonjs/components/Badge/Badge.js +47 -8
- package/lib/commonjs/components/BrandChip/BrandChip.js +3 -3
- package/lib/commonjs/components/Button/Button.js +2 -1
- package/lib/commonjs/components/CardAdvisory/CardAdvisory.js +2 -1
- package/lib/commonjs/components/CardBankAccount/CardBankAccount.js +3 -2
- package/lib/commonjs/components/CardCTA/CardCTA.js +197 -27
- package/lib/commonjs/components/CardInsight/CardInsight.js +5 -1
- package/lib/commonjs/components/CircularProgressBar/CircularProgressBar.js +7 -3
- package/lib/commonjs/components/CircularProgressBarDoted/CircularProgressBarDoted.js +3 -2
- package/lib/commonjs/components/CircularRating/CircularRating.js +2 -1
- package/lib/commonjs/components/ClusterBubble/ClusterBubble.js +3 -2
- package/lib/commonjs/components/CompareTable/CompareTable.js +72 -43
- package/lib/commonjs/components/CoverageBarComparison/CoverageBarComparison.js +3 -2
- package/lib/commonjs/components/DonutChart/DonutChart.js +4 -3
- package/lib/commonjs/components/Dropdown/Dropdown.js +3 -2
- package/lib/commonjs/components/DropdownInput/DropdownInput.js +3 -2
- package/lib/commonjs/components/ExpandableCheckbox/ExpandableCheckbox.js +2 -1
- package/lib/commonjs/components/FormField/FormField.js +42 -2
- package/lib/commonjs/components/Gauge/Gauge.js +1 -1
- package/lib/commonjs/components/HoldingsCard/HoldingsCard.js +3 -2
- package/lib/commonjs/components/InstitutionBadge/InstitutionBadge.js +2 -1
- package/lib/commonjs/components/ListGroup/ListGroup.js +2 -1
- package/lib/commonjs/components/ListItem/ListItem.js +3 -2
- package/lib/commonjs/components/MediaCard/MediaCard.js +4 -2
- package/lib/commonjs/components/MetricLegendItem/MetricLegendItem.js +3 -2
- package/lib/commonjs/components/MonthlyStatusGrid/MonthlyStatusGrid.js +6 -3
- package/lib/commonjs/components/PoweredByLabel/PoweredByLabel.js +3 -2
- package/lib/commonjs/components/ProductMerchandisingCard/ProductMerchandisingCard.js +107 -33
- package/lib/commonjs/components/ProductOverview/ProductOverview.js +4 -3
- package/lib/commonjs/components/ProgressBadge/ProgressBadge.js +2 -2
- package/lib/commonjs/components/ProjectionMarker/ProjectionMarker.js +3 -2
- package/lib/commonjs/components/Section/Section.js +3 -2
- package/lib/commonjs/components/Slider/Slider.js +3 -2
- package/lib/commonjs/components/Stack/Stack.js +86 -0
- package/lib/commonjs/components/SuggestiveSearch/SuggestiveSearch.js +10 -1
- package/lib/commonjs/components/SummaryTile/SummaryTile.js +3 -2
- package/lib/commonjs/components/Table/Table.js +324 -0
- package/lib/commonjs/components/Text/Text.js +2 -1
- package/lib/commonjs/components/TextInput/TextInput.js +9 -1
- package/lib/commonjs/components/TextSegment/TextSegment.js +2 -1
- package/lib/commonjs/components/ThreadHero/ThreadHero.js +4 -5
- package/lib/commonjs/components/Title/Title.js +2 -1
- package/lib/commonjs/components/Toast/Toast.js +3 -2
- package/lib/commonjs/components/TransactionBubble/TransactionBubble.js +2 -1
- package/lib/commonjs/components/TransactionStatus/TransactionStatus.js +3 -2
- package/lib/commonjs/components/UpiHandle/UpiHandle.js +2 -2
- package/lib/commonjs/components/index.js +44 -0
- package/lib/commonjs/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/commonjs/design-tokens/figma-modes.generated.js +1 -0
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/commonjs/{components/ProductMerchandisingCard → utils/GlassFill}/GlassFill.js +11 -3
- package/lib/commonjs/{components/ProductMerchandisingCard → utils/GlassFill}/GlassFill.web.js +8 -4
- package/lib/commonjs/utils/react-utils.js +56 -0
- package/lib/commonjs/utils/web-platform-utils.js +59 -0
- package/lib/module/components/Accordion/Accordion.js +3 -2
- package/lib/module/components/AccordionCheckbox/AccordionCheckbox.js +5 -4
- package/lib/module/components/AccountCard/AccountCard.js +5 -4
- package/lib/module/components/AllocationComparisonChart/AllocationComparisonChart.js +10 -7
- package/lib/module/components/AreaLineChart/AreaLineChart.js +12 -8
- package/lib/module/components/Badge/Badge.js +49 -10
- package/lib/module/components/BrandChip/BrandChip.js +4 -4
- package/lib/module/components/Button/Button.js +3 -2
- package/lib/module/components/CardAdvisory/CardAdvisory.js +3 -2
- package/lib/module/components/CardBankAccount/CardBankAccount.js +4 -3
- package/lib/module/components/CardCTA/CardCTA.js +198 -28
- package/lib/module/components/CardInsight/CardInsight.js +5 -1
- package/lib/module/components/CircularProgressBar/CircularProgressBar.js +8 -4
- package/lib/module/components/CircularProgressBarDoted/CircularProgressBarDoted.js +4 -3
- package/lib/module/components/CircularRating/CircularRating.js +3 -2
- package/lib/module/components/ClusterBubble/ClusterBubble.js +4 -3
- package/lib/module/components/CompareTable/CompareTable.js +73 -44
- package/lib/module/components/CoverageBarComparison/CoverageBarComparison.js +4 -3
- package/lib/module/components/DonutChart/DonutChart.js +5 -4
- package/lib/module/components/Dropdown/Dropdown.js +4 -3
- package/lib/module/components/DropdownInput/DropdownInput.js +4 -3
- package/lib/module/components/ExpandableCheckbox/ExpandableCheckbox.js +2 -1
- package/lib/module/components/FormField/FormField.js +45 -5
- package/lib/module/components/Gauge/Gauge.js +1 -1
- package/lib/module/components/HoldingsCard/HoldingsCard.js +4 -3
- package/lib/module/components/InstitutionBadge/InstitutionBadge.js +3 -2
- package/lib/module/components/ListGroup/ListGroup.js +3 -2
- package/lib/module/components/ListItem/ListItem.js +4 -3
- package/lib/module/components/MediaCard/MediaCard.js +4 -2
- package/lib/module/components/MetricLegendItem/MetricLegendItem.js +4 -3
- package/lib/module/components/MonthlyStatusGrid/MonthlyStatusGrid.js +7 -4
- package/lib/module/components/PoweredByLabel/PoweredByLabel.js +4 -3
- package/lib/module/components/ProductMerchandisingCard/ProductMerchandisingCard.js +109 -35
- package/lib/module/components/ProductOverview/ProductOverview.js +5 -4
- package/lib/module/components/ProgressBadge/ProgressBadge.js +3 -3
- package/lib/module/components/ProjectionMarker/ProjectionMarker.js +4 -3
- package/lib/module/components/Section/Section.js +4 -3
- package/lib/module/components/Slider/Slider.js +4 -3
- package/lib/module/components/Stack/Stack.js +81 -0
- package/lib/module/components/SuggestiveSearch/SuggestiveSearch.js +10 -1
- package/lib/module/components/SummaryTile/SummaryTile.js +4 -3
- package/lib/module/components/Table/Table.js +315 -0
- package/lib/module/components/Text/Text.js +3 -2
- package/lib/module/components/TextInput/TextInput.js +9 -1
- package/lib/module/components/TextSegment/TextSegment.js +3 -2
- package/lib/module/components/ThreadHero/ThreadHero.js +5 -6
- package/lib/module/components/Title/Title.js +3 -2
- package/lib/module/components/Toast/Toast.js +4 -3
- package/lib/module/components/TransactionBubble/TransactionBubble.js +3 -2
- package/lib/module/components/TransactionStatus/TransactionStatus.js +4 -3
- package/lib/module/components/UpiHandle/UpiHandle.js +3 -3
- package/lib/module/components/index.js +2 -0
- package/lib/module/design-tokens/Coin Variables-variables-full.json +1 -1
- package/lib/module/design-tokens/figma-modes.generated.js +1 -0
- package/lib/module/icons/registry.js +1 -1
- package/lib/module/{components/ProductMerchandisingCard → utils/GlassFill}/GlassFill.js +11 -3
- package/lib/module/{components/ProductMerchandisingCard → utils/GlassFill}/GlassFill.web.js +8 -4
- package/lib/module/utils/react-utils.js +54 -0
- package/lib/module/utils/web-platform-utils.js +58 -0
- package/lib/typescript/src/components/Accordion/Accordion.d.ts +7 -1
- package/lib/typescript/src/components/AccordionCheckbox/AccordionCheckbox.d.ts +7 -1
- package/lib/typescript/src/components/AccountCard/AccountCard.d.ts +7 -1
- package/lib/typescript/src/components/AllocationComparisonChart/AllocationComparisonChart.d.ts +7 -1
- package/lib/typescript/src/components/AreaLineChart/AreaLineChart.d.ts +8 -1
- package/lib/typescript/src/components/Badge/Badge.d.ts +32 -2
- package/lib/typescript/src/components/BrandChip/BrandChip.d.ts +7 -1
- package/lib/typescript/src/components/Button/Button.d.ts +7 -1
- package/lib/typescript/src/components/CardAdvisory/CardAdvisory.d.ts +7 -1
- package/lib/typescript/src/components/CardBankAccount/CardBankAccount.d.ts +7 -1
- package/lib/typescript/src/components/CardCTA/CardCTA.d.ts +27 -5
- package/lib/typescript/src/components/CircularProgressBar/CircularProgressBar.d.ts +7 -1
- package/lib/typescript/src/components/CircularProgressBarDoted/CircularProgressBarDoted.d.ts +7 -1
- package/lib/typescript/src/components/CircularRating/CircularRating.d.ts +7 -1
- package/lib/typescript/src/components/ClusterBubble/ClusterBubble.d.ts +7 -1
- package/lib/typescript/src/components/CompareTable/CompareTable.d.ts +7 -1
- package/lib/typescript/src/components/CoverageBarComparison/CoverageBarComparison.d.ts +7 -1
- package/lib/typescript/src/components/DonutChart/DonutChart.d.ts +7 -1
- package/lib/typescript/src/components/Dropdown/Dropdown.d.ts +7 -1
- package/lib/typescript/src/components/DropdownInput/DropdownInput.d.ts +6 -0
- package/lib/typescript/src/components/ExpandableCheckbox/ExpandableCheckbox.d.ts +7 -1
- package/lib/typescript/src/components/HoldingsCard/HoldingsCard.d.ts +7 -1
- package/lib/typescript/src/components/InstitutionBadge/InstitutionBadge.d.ts +7 -1
- package/lib/typescript/src/components/ListGroup/ListGroup.d.ts +7 -1
- package/lib/typescript/src/components/ListItem/ListItem.d.ts +7 -1
- package/lib/typescript/src/components/MetricLegendItem/MetricLegendItem.d.ts +7 -1
- package/lib/typescript/src/components/MonthlyStatusGrid/MonthlyStatusGrid.d.ts +14 -2
- package/lib/typescript/src/components/PoweredByLabel/PoweredByLabel.d.ts +7 -1
- package/lib/typescript/src/components/ProductMerchandisingCard/ProductMerchandisingCard.d.ts +7 -1
- package/lib/typescript/src/components/ProductOverview/ProductOverview.d.ts +7 -1
- package/lib/typescript/src/components/ProgressBadge/ProgressBadge.d.ts +7 -1
- package/lib/typescript/src/components/ProjectionMarker/ProjectionMarker.d.ts +7 -1
- package/lib/typescript/src/components/Section/Section.d.ts +7 -1
- package/lib/typescript/src/components/Slider/Slider.d.ts +6 -0
- package/lib/typescript/src/components/Stack/Stack.d.ts +81 -0
- package/lib/typescript/src/components/SummaryTile/SummaryTile.d.ts +7 -1
- package/lib/typescript/src/components/Table/Table.d.ts +139 -0
- package/lib/typescript/src/components/Text/Text.d.ts +7 -1
- package/lib/typescript/src/components/TextSegment/TextSegment.d.ts +7 -1
- package/lib/typescript/src/components/ThreadHero/ThreadHero.d.ts +7 -1
- package/lib/typescript/src/components/Title/Title.d.ts +7 -1
- package/lib/typescript/src/components/Toast/Toast.d.ts +7 -1
- package/lib/typescript/src/components/TransactionBubble/TransactionBubble.d.ts +7 -1
- package/lib/typescript/src/components/TransactionStatus/TransactionStatus.d.ts +7 -1
- package/lib/typescript/src/components/UpiHandle/UpiHandle.d.ts +7 -1
- package/lib/typescript/src/components/index.d.ts +4 -2
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/lib/typescript/src/{components/ProductMerchandisingCard → utils/GlassFill}/GlassFill.d.ts +31 -3
- package/lib/typescript/src/{components/ProductMerchandisingCard → utils/GlassFill}/GlassFill.web.d.ts +18 -2
- package/lib/typescript/src/utils/react-utils.d.ts +37 -0
- package/lib/typescript/src/utils/web-platform-utils.d.ts +36 -0
- package/package.json +1 -1
- package/src/components/Accordion/Accordion.tsx +9 -2
- package/src/components/AccordionCheckbox/AccordionCheckbox.tsx +10 -3
- package/src/components/AccountCard/AccountCard.tsx +10 -3
- package/src/components/AllocationComparisonChart/AllocationComparisonChart.tsx +14 -4
- package/src/components/AreaLineChart/AreaLineChart.tsx +15 -5
- package/src/components/Badge/Badge.tsx +78 -8
- package/src/components/BrandChip/BrandChip.tsx +9 -3
- package/src/components/Button/Button.tsx +9 -2
- package/src/components/CardAdvisory/CardAdvisory.tsx +9 -2
- package/src/components/CardBankAccount/CardBankAccount.tsx +9 -2
- package/src/components/CardCTA/CardCTA.tsx +214 -41
- package/src/components/CardInsight/CardInsight.tsx +7 -1
- package/src/components/CircularProgressBar/CircularProgressBar.tsx +14 -4
- package/src/components/CircularProgressBarDoted/CircularProgressBarDoted.tsx +10 -3
- package/src/components/CircularRating/CircularRating.tsx +9 -2
- package/src/components/ClusterBubble/ClusterBubble.tsx +9 -2
- package/src/components/CompareTable/CompareTable.tsx +98 -50
- package/src/components/CoverageBarComparison/CoverageBarComparison.tsx +9 -2
- package/src/components/DonutChart/DonutChart.tsx +10 -3
- package/src/components/Dropdown/Dropdown.tsx +9 -2
- package/src/components/DropdownInput/DropdownInput.tsx +9 -2
- package/src/components/ExpandableCheckbox/ExpandableCheckbox.tsx +8 -1
- package/src/components/FormField/FormField.tsx +49 -4
- package/src/components/Gauge/Gauge.tsx +1 -1
- package/src/components/HoldingsCard/HoldingsCard.tsx +9 -2
- package/src/components/InstitutionBadge/InstitutionBadge.tsx +9 -2
- package/src/components/ListGroup/ListGroup.tsx +9 -2
- package/src/components/ListItem/ListItem.tsx +10 -3
- package/src/components/MediaCard/MediaCard.tsx +2 -2
- package/src/components/MetricLegendItem/MetricLegendItem.tsx +9 -2
- package/src/components/MonthlyStatusGrid/MonthlyStatusGrid.tsx +17 -2
- package/src/components/PoweredByLabel/PoweredByLabel.tsx +9 -2
- package/src/components/ProductMerchandisingCard/ProductMerchandisingCard.tsx +104 -37
- package/src/components/ProductOverview/ProductOverview.tsx +10 -3
- package/src/components/ProgressBadge/ProgressBadge.tsx +9 -3
- package/src/components/ProjectionMarker/ProjectionMarker.tsx +9 -2
- package/src/components/Section/Section.tsx +10 -3
- package/src/components/Slider/Slider.tsx +9 -2
- package/src/components/Stack/Stack.tsx +131 -0
- package/src/components/SuggestiveSearch/SuggestiveSearch.tsx +10 -1
- package/src/components/SummaryTile/SummaryTile.tsx +9 -2
- package/src/components/Table/Table.tsx +449 -0
- package/src/components/Text/Text.tsx +9 -2
- package/src/components/TextInput/TextInput.tsx +7 -1
- package/src/components/TextSegment/TextSegment.tsx +9 -2
- package/src/components/ThreadHero/ThreadHero.tsx +10 -3
- package/src/components/Title/Title.tsx +9 -2
- package/src/components/Toast/Toast.tsx +9 -2
- package/src/components/TransactionBubble/TransactionBubble.tsx +9 -2
- package/src/components/TransactionStatus/TransactionStatus.tsx +9 -2
- package/src/components/UpiHandle/UpiHandle.tsx +9 -3
- package/src/components/index.ts +23 -2
- package/src/design-tokens/Coin Variables-variables-full.json +1 -1
- package/src/design-tokens/figma-modes.generated.ts +1 -0
- package/src/icons/registry.ts +1 -1
- package/src/{components/ProductMerchandisingCard → utils/GlassFill}/GlassFill.tsx +32 -3
- package/src/{components/ProductMerchandisingCard → utils/GlassFill}/GlassFill.web.tsx +25 -4
- package/src/utils/react-utils.ts +61 -0
- package/src/utils/web-platform-utils.ts +68 -0
- package/lib/commonjs/components/MediaCard/GlassFill.js +0 -62
- package/lib/commonjs/components/MediaCard/GlassFill.web.js +0 -48
- package/lib/module/components/MediaCard/GlassFill.js +0 -57
- package/lib/module/components/MediaCard/GlassFill.web.js +0 -43
- package/lib/typescript/src/components/MediaCard/GlassFill.d.ts +0 -47
- package/lib/typescript/src/components/MediaCard/GlassFill.web.d.ts +0 -20
- package/src/components/MediaCard/GlassFill.tsx +0 -89
- package/src/components/MediaCard/GlassFill.web.tsx +0 -53
|
@@ -71,7 +71,8 @@ const Slider = /*#__PURE__*/(0, _react.forwardRef)(function Slider({
|
|
|
71
71
|
width = '100%',
|
|
72
72
|
modes = _reactUtils.EMPTY_MODES,
|
|
73
73
|
style,
|
|
74
|
-
accessibilityLabel
|
|
74
|
+
accessibilityLabel,
|
|
75
|
+
disableTruncation
|
|
75
76
|
}, ref) {
|
|
76
77
|
const tokens = (0, _react.useMemo)(() => resolveTokens(modes), [modes]);
|
|
77
78
|
const isControlled = controlledValue !== undefined;
|
|
@@ -252,7 +253,7 @@ const Slider = /*#__PURE__*/(0, _react.forwardRef)(function Slider({
|
|
|
252
253
|
pointerEvents: "none",
|
|
253
254
|
children: [renderTooltip ? renderTooltip(currentValue) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
254
255
|
style: tokens.tooltipLabel,
|
|
255
|
-
|
|
256
|
+
...(0, _reactUtils.resolveTruncation)(disableTruncation, 1),
|
|
256
257
|
children: valueText
|
|
257
258
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
258
259
|
style: [styles.tip, {
|
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
* Stack — a token-driven layout container for grouped content.
|
|
16
|
+
*
|
|
17
|
+
* Use `Stack` 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
|
+
* <Stack layoutDirection="vertical" modes={modes}>
|
|
26
|
+
* <Button label="Continue" modes={primaryModes} />
|
|
27
|
+
* <Disclaimer disclaimer="Terms apply." modes={modes} />
|
|
28
|
+
* </Stack>
|
|
29
|
+
* </ActionFooter>
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Previously named `Slot`. The `Slot` export is preserved as a deprecated alias
|
|
34
|
+
* for backward compatibility.
|
|
35
|
+
*/
|
|
36
|
+
function Stack({
|
|
37
|
+
children,
|
|
38
|
+
layoutDirection = 'vertical',
|
|
39
|
+
alignCrossAxis,
|
|
40
|
+
justifyMainAxis,
|
|
41
|
+
equalHeight = false,
|
|
42
|
+
fillWidth = false,
|
|
43
|
+
modes: propModes = _reactUtils.EMPTY_MODES,
|
|
44
|
+
style,
|
|
45
|
+
...rest
|
|
46
|
+
}) {
|
|
47
|
+
const {
|
|
48
|
+
modes: globalModes
|
|
49
|
+
} = (0, _JFSThemeProvider.useTokens)();
|
|
50
|
+
const modes = (0, _react.useMemo)(() => ({
|
|
51
|
+
...globalModes,
|
|
52
|
+
...propModes
|
|
53
|
+
}), [globalModes, propModes]);
|
|
54
|
+
const {
|
|
55
|
+
containerStyle,
|
|
56
|
+
processedChildren
|
|
57
|
+
} = (0, _react.useMemo)(() => {
|
|
58
|
+
const gap = (0, _figmaVariablesResolver.getVariableByName)('slot/gap', modes) ?? 8;
|
|
59
|
+
const isHorizontal = layoutDirection === 'horizontal';
|
|
60
|
+
|
|
61
|
+
// Cross-axis stretch maps to "equal height" for a row and "fill width" for a
|
|
62
|
+
// column. Honour whichever flag matches the active direction.
|
|
63
|
+
const stretchCrossAxis = isHorizontal ? equalHeight : fillWidth;
|
|
64
|
+
const container = {
|
|
65
|
+
flexDirection: isHorizontal ? 'row' : 'column',
|
|
66
|
+
alignItems: stretchCrossAxis ? 'stretch' : alignCrossAxis ?? (isHorizontal ? 'flex-start' : 'stretch'),
|
|
67
|
+
justifyContent: justifyMainAxis ?? (isHorizontal ? 'center' : undefined),
|
|
68
|
+
alignSelf: 'stretch',
|
|
69
|
+
gap
|
|
70
|
+
};
|
|
71
|
+
const moded = children ? (0, _reactUtils.cloneChildrenWithModes)(children, modes) : null;
|
|
72
|
+
const processed = stretchCrossAxis && moded ? (0, _reactUtils.injectChildStyle)(moded, {
|
|
73
|
+
alignSelf: 'stretch'
|
|
74
|
+
}) : moded;
|
|
75
|
+
return {
|
|
76
|
+
containerStyle: container,
|
|
77
|
+
processedChildren: processed
|
|
78
|
+
};
|
|
79
|
+
}, [children, modes, layoutDirection, alignCrossAxis, justifyMainAxis, equalHeight, fillWidth]);
|
|
80
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
81
|
+
style: [containerStyle, style],
|
|
82
|
+
...rest,
|
|
83
|
+
children: processedChildren
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
var _default = exports.default = /*#__PURE__*/_react.default.memo(Stack);
|
|
@@ -312,7 +312,16 @@ function SuggestiveSearch({
|
|
|
312
312
|
color: tokens.inputTextColor,
|
|
313
313
|
fontFamily: tokens.inputFontFamily,
|
|
314
314
|
fontSize: tokens.inputFontSize,
|
|
315
|
-
|
|
315
|
+
// iOS-only quirk: a single-line RNTextInput with `lineHeight` (45) far
|
|
316
|
+
// larger than `fontSize` (16) sinks the text to the bottom of the box
|
|
317
|
+
// instead of centering — iOS puts all the extra space ABOVE the glyphs.
|
|
318
|
+
// The row already owns the 45px height via `minHeight` + centering, so
|
|
319
|
+
// omit lineHeight on iOS (UITextField centers natively) and keep the
|
|
320
|
+
// token value on Android/Web where it renders correctly. Same fix as
|
|
321
|
+
// FormField — see facebook/react-native#39145 / #28012.
|
|
322
|
+
...(_reactNative.Platform.OS === 'ios' ? null : {
|
|
323
|
+
lineHeight: tokens.inputLineHeight
|
|
324
|
+
}),
|
|
316
325
|
fontWeight: tokens.inputFontWeight,
|
|
317
326
|
padding: 0,
|
|
318
327
|
margin: 0,
|
|
@@ -34,7 +34,8 @@ function SummaryTile({
|
|
|
34
34
|
style,
|
|
35
35
|
titleStyle,
|
|
36
36
|
descriptionStyle,
|
|
37
|
-
accessibilityLabel
|
|
37
|
+
accessibilityLabel,
|
|
38
|
+
disableTruncation
|
|
38
39
|
}) {
|
|
39
40
|
const containerGap = (0, _figmaVariablesResolver.getVariableByName)('summaryTile/gap', modes) ?? 8;
|
|
40
41
|
const containerPadding = (0, _figmaVariablesResolver.getVariableByName)('summaryTile/padding', modes) ?? 0;
|
|
@@ -100,7 +101,7 @@ function SummaryTile({
|
|
|
100
101
|
},
|
|
101
102
|
children: [title ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
102
103
|
style: [titleTextStyle, titleStyle],
|
|
103
|
-
|
|
104
|
+
...(0, _reactUtils.resolveTruncation)(disableTruncation, 1),
|
|
104
105
|
children: title
|
|
105
106
|
}) : null, showIndicator ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_StrengthIndicator.default, {
|
|
106
107
|
confidence: confidence,
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TableBody = TableBody;
|
|
7
|
+
exports.TableCell = TableCell;
|
|
8
|
+
exports.TableHeader = TableHeader;
|
|
9
|
+
exports.TableHeaderCell = TableHeaderCell;
|
|
10
|
+
exports.TableRow = TableRow;
|
|
11
|
+
exports.default = void 0;
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
var _reactNative = require("react-native");
|
|
14
|
+
var _figmaVariablesResolver = require("../../design-tokens/figma-variables-resolver");
|
|
15
|
+
var _reactUtils = require("../../utils/react-utils");
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
|
+
/* -------------------------------------------------------------------------------------------------
|
|
19
|
+
* Shared types & token resolution
|
|
20
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
21
|
+
|
|
22
|
+
/** Resolved styling for a header cell and a body cell, derived from design tokens. */
|
|
23
|
+
|
|
24
|
+
const toWeight = w => typeof w === 'number' ? `${w}` : w;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Resolve every token the table family needs in one place. Sub-components call
|
|
28
|
+
* this with their cascaded `modes` so they render correctly both inside a
|
|
29
|
+
* `Table` and when used standalone. Fallbacks mirror the Figma node values
|
|
30
|
+
* (`tableCell/*`, `tableHeader/*`) so the component is faithful even before the
|
|
31
|
+
* tokens are published to the local store.
|
|
32
|
+
*/
|
|
33
|
+
function resolveTableTokens(modes) {
|
|
34
|
+
const headerFontFamily = (0, _figmaVariablesResolver.getVariableByName)('tableHeader/label/fontfamily', modes) ?? 'JioType Var';
|
|
35
|
+
const headerFontSize = (0, _figmaVariablesResolver.getVariableByName)('tableHeader/label/fontsize', modes) ?? 14;
|
|
36
|
+
const headerFontWeight = (0, _figmaVariablesResolver.getVariableByName)('tableHeader/label/fontweight', modes) ?? 600;
|
|
37
|
+
const cellFontFamily = (0, _figmaVariablesResolver.getVariableByName)('tableCell/label/fontfamily', modes) ?? 'JioType Var';
|
|
38
|
+
const cellFontSize = (0, _figmaVariablesResolver.getVariableByName)('tableCell/label/fontsize', modes) ?? 14;
|
|
39
|
+
const cellFontWeight = (0, _figmaVariablesResolver.getVariableByName)('tableCell/label/fontweight', modes) ?? 400;
|
|
40
|
+
return {
|
|
41
|
+
headerBg: (0, _figmaVariablesResolver.getVariableByName)('tableHeader/background/color', modes) ?? '#f5f5f5',
|
|
42
|
+
headerPaddingH: (0, _figmaVariablesResolver.getVariableByName)('tableHeader/padding/horizontal', modes) ?? 12,
|
|
43
|
+
headerPaddingV: (0, _figmaVariablesResolver.getVariableByName)('tableHeader/padding/vertical', modes) ?? 12,
|
|
44
|
+
headerText: {
|
|
45
|
+
color: (0, _figmaVariablesResolver.getVariableByName)('tableHeader/label/color', modes) ?? '#000000',
|
|
46
|
+
fontFamily: headerFontFamily,
|
|
47
|
+
fontSize: headerFontSize,
|
|
48
|
+
fontWeight: toWeight(headerFontWeight),
|
|
49
|
+
lineHeight: 20
|
|
50
|
+
},
|
|
51
|
+
cellBg: (0, _figmaVariablesResolver.getVariableByName)('tableCell/background/color', modes) ?? '#ffffff',
|
|
52
|
+
cellPaddingH: (0, _figmaVariablesResolver.getVariableByName)('tableCell/padding/horizontal', modes) ?? 12,
|
|
53
|
+
cellPaddingV: (0, _figmaVariablesResolver.getVariableByName)('tableCell/padding/vertical', modes) ?? 12,
|
|
54
|
+
cellText: {
|
|
55
|
+
color: (0, _figmaVariablesResolver.getVariableByName)('tableCell/label/color', modes) ?? '#000000',
|
|
56
|
+
fontFamily: cellFontFamily,
|
|
57
|
+
fontSize: cellFontSize,
|
|
58
|
+
fontWeight: toWeight(cellFontWeight),
|
|
59
|
+
lineHeight: 20
|
|
60
|
+
},
|
|
61
|
+
borderColor: (0, _figmaVariablesResolver.getVariableByName)('tableCell/border/color', modes) ?? '#eeeeee',
|
|
62
|
+
borderSize: (0, _figmaVariablesResolver.getVariableByName)('tableCell/border/size', modes) ?? 1
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
const alignToJustify = align => align === 'center' ? 'center' : align === 'right' ? 'flex-end' : 'flex-start';
|
|
66
|
+
|
|
67
|
+
/** Renders text children through the resolved label style; passes elements through untouched. */
|
|
68
|
+
function renderCellContent(children, textStyle, align, modes) {
|
|
69
|
+
if (children == null || children === false) return null;
|
|
70
|
+
if (typeof children === 'string' || typeof children === 'number') {
|
|
71
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
72
|
+
style: [textStyle, {
|
|
73
|
+
textAlign: align
|
|
74
|
+
}],
|
|
75
|
+
children: children
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return (0, _reactUtils.cloneChildrenWithModes)(children, modes);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* -------------------------------------------------------------------------------------------------
|
|
82
|
+
* Table.Cell — body cell (Figma `table-cell`, node 603:23)
|
|
83
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* A single body cell. White background with a bottom + right divider, matching
|
|
87
|
+
* the Figma `table-cell` sub-component. String/number children are rendered
|
|
88
|
+
* with the token label style; any element is rendered as-is.
|
|
89
|
+
*/
|
|
90
|
+
function TableCell({
|
|
91
|
+
children,
|
|
92
|
+
align = 'left',
|
|
93
|
+
width,
|
|
94
|
+
flex = 1,
|
|
95
|
+
isLastColumn = false,
|
|
96
|
+
isLastRow = false,
|
|
97
|
+
modes = _reactUtils.EMPTY_MODES,
|
|
98
|
+
style
|
|
99
|
+
}) {
|
|
100
|
+
const t = resolveTableTokens(modes);
|
|
101
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
102
|
+
style: [{
|
|
103
|
+
backgroundColor: t.cellBg,
|
|
104
|
+
flexDirection: 'row',
|
|
105
|
+
alignItems: 'center',
|
|
106
|
+
justifyContent: alignToJustify(align),
|
|
107
|
+
paddingHorizontal: t.cellPaddingH,
|
|
108
|
+
paddingVertical: t.cellPaddingV,
|
|
109
|
+
borderColor: t.borderColor,
|
|
110
|
+
borderBottomWidth: isLastRow ? 0 : t.borderSize,
|
|
111
|
+
borderRightWidth: isLastColumn ? 0 : t.borderSize,
|
|
112
|
+
...(width != null ? {
|
|
113
|
+
width
|
|
114
|
+
} : {
|
|
115
|
+
flex,
|
|
116
|
+
minWidth: 0
|
|
117
|
+
})
|
|
118
|
+
}, style],
|
|
119
|
+
children: renderCellContent(children, t.cellText, align, modes)
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* -------------------------------------------------------------------------------------------------
|
|
124
|
+
* Table.HeaderCell — header cell (Figma `table header wrap`, node 603:21)
|
|
125
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* A single header cell. Muted background with the bold token label style,
|
|
129
|
+
* matching the Figma `table header wrap` sub-component. Header cells carry no
|
|
130
|
+
* dividers; the header row draws a single bottom divider beneath them.
|
|
131
|
+
*/
|
|
132
|
+
function TableHeaderCell({
|
|
133
|
+
children,
|
|
134
|
+
align = 'left',
|
|
135
|
+
width,
|
|
136
|
+
flex = 1,
|
|
137
|
+
modes = _reactUtils.EMPTY_MODES,
|
|
138
|
+
style
|
|
139
|
+
}) {
|
|
140
|
+
const t = resolveTableTokens(modes);
|
|
141
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
142
|
+
style: [{
|
|
143
|
+
backgroundColor: t.headerBg,
|
|
144
|
+
flexDirection: 'row',
|
|
145
|
+
alignItems: 'center',
|
|
146
|
+
justifyContent: alignToJustify(align),
|
|
147
|
+
paddingHorizontal: t.headerPaddingH,
|
|
148
|
+
paddingVertical: t.headerPaddingV,
|
|
149
|
+
...(width != null ? {
|
|
150
|
+
width
|
|
151
|
+
} : {
|
|
152
|
+
flex,
|
|
153
|
+
minWidth: 0
|
|
154
|
+
})
|
|
155
|
+
}, style],
|
|
156
|
+
children: renderCellContent(children, t.headerText, align, modes)
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* -------------------------------------------------------------------------------------------------
|
|
161
|
+
* Table.Header — row of header cells with a bottom divider
|
|
162
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
163
|
+
|
|
164
|
+
function TableHeader({
|
|
165
|
+
children,
|
|
166
|
+
modes = _reactUtils.EMPTY_MODES,
|
|
167
|
+
style
|
|
168
|
+
}) {
|
|
169
|
+
const t = resolveTableTokens(modes);
|
|
170
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
171
|
+
style: [{
|
|
172
|
+
flexDirection: 'row',
|
|
173
|
+
width: '100%',
|
|
174
|
+
borderBottomWidth: t.borderSize,
|
|
175
|
+
borderBottomColor: t.borderColor
|
|
176
|
+
}, style],
|
|
177
|
+
children: (0, _reactUtils.cloneChildrenWithModes)(children, modes)
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/* -------------------------------------------------------------------------------------------------
|
|
182
|
+
* Table.Row — row of body cells
|
|
183
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
184
|
+
|
|
185
|
+
function TableRow({
|
|
186
|
+
children,
|
|
187
|
+
onPress,
|
|
188
|
+
modes = _reactUtils.EMPTY_MODES,
|
|
189
|
+
style
|
|
190
|
+
}) {
|
|
191
|
+
const rowStyle = {
|
|
192
|
+
flexDirection: 'row',
|
|
193
|
+
width: '100%'
|
|
194
|
+
};
|
|
195
|
+
const content = (0, _reactUtils.cloneChildrenWithModes)(children, modes);
|
|
196
|
+
if (onPress) {
|
|
197
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
198
|
+
onPress: onPress,
|
|
199
|
+
accessibilityRole: "button",
|
|
200
|
+
style: ({
|
|
201
|
+
pressed
|
|
202
|
+
}) => [rowStyle, pressed ? {
|
|
203
|
+
opacity: 0.6
|
|
204
|
+
} : null, style],
|
|
205
|
+
children: content
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
209
|
+
style: [rowStyle, style],
|
|
210
|
+
children: content
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/* -------------------------------------------------------------------------------------------------
|
|
215
|
+
* Table.Body — column container for rows
|
|
216
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
217
|
+
|
|
218
|
+
function TableBody({
|
|
219
|
+
children,
|
|
220
|
+
modes = _reactUtils.EMPTY_MODES,
|
|
221
|
+
style
|
|
222
|
+
}) {
|
|
223
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
224
|
+
style: [{
|
|
225
|
+
width: '100%'
|
|
226
|
+
}, style],
|
|
227
|
+
children: (0, _reactUtils.cloneChildrenWithModes)(children, modes)
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/* -------------------------------------------------------------------------------------------------
|
|
232
|
+
* Table — root (Figma `Table`, node 5732:3710)
|
|
233
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Column definition for the data-driven `Table` API. `T` is the shape of one
|
|
237
|
+
* row record.
|
|
238
|
+
*/
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Table renders structured rows and columns. It supports two complementary
|
|
242
|
+
* usage styles that share the same token-driven styling:
|
|
243
|
+
*
|
|
244
|
+
* 1. **Data-driven** (recommended): pass `columns` + `data`. The header and body
|
|
245
|
+
* are built for you, columns stay aligned, and per-column `align`/`width`/
|
|
246
|
+
* `flex`/`render` give full control.
|
|
247
|
+
*
|
|
248
|
+
* 2. **Composition**: pass `Table.Header` / `Table.Body` / `Table.Row` /
|
|
249
|
+
* `Table.Cell` / `Table.HeaderCell` as children for bespoke layouts. These
|
|
250
|
+
* sub-components are also exported standalone.
|
|
251
|
+
*
|
|
252
|
+
* Implementation of Figma node `5732:3710` (`Table`) with sub-components
|
|
253
|
+
* `603:23` (`table-cell`) and `603:21` (`table header wrap`).
|
|
254
|
+
*
|
|
255
|
+
* @component
|
|
256
|
+
*/
|
|
257
|
+
function Table({
|
|
258
|
+
columns,
|
|
259
|
+
data,
|
|
260
|
+
children,
|
|
261
|
+
showHeader = true,
|
|
262
|
+
getRowKey,
|
|
263
|
+
onRowPress,
|
|
264
|
+
scrollable = false,
|
|
265
|
+
accessibilityLabel,
|
|
266
|
+
modes = _reactUtils.EMPTY_MODES,
|
|
267
|
+
style
|
|
268
|
+
}) {
|
|
269
|
+
const isComposition = children != null;
|
|
270
|
+
const body = isComposition ? (0, _reactUtils.cloneChildrenWithModes)(children, modes) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
271
|
+
children: [showHeader && columns && columns.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(TableHeader, {
|
|
272
|
+
modes: modes,
|
|
273
|
+
children: columns.map(col => /*#__PURE__*/(0, _jsxRuntime.jsx)(TableHeaderCell, {
|
|
274
|
+
align: col.headerAlign ?? col.align ?? 'left',
|
|
275
|
+
width: col.width,
|
|
276
|
+
flex: col.flex ?? 1,
|
|
277
|
+
modes: modes,
|
|
278
|
+
children: col.header ?? col.key
|
|
279
|
+
}, col.key))
|
|
280
|
+
}), columns && data && data.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(TableBody, {
|
|
281
|
+
modes: modes,
|
|
282
|
+
children: data.map((row, rowIndex) => {
|
|
283
|
+
const isLastRow = rowIndex === data.length - 1;
|
|
284
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(TableRow, {
|
|
285
|
+
onPress: onRowPress ? () => onRowPress(row, rowIndex) : undefined,
|
|
286
|
+
modes: modes,
|
|
287
|
+
children: columns.map((col, colIndex) => /*#__PURE__*/(0, _jsxRuntime.jsx)(TableCell, {
|
|
288
|
+
align: col.align ?? 'left',
|
|
289
|
+
width: col.width,
|
|
290
|
+
flex: col.flex ?? 1,
|
|
291
|
+
isLastColumn: colIndex === columns.length - 1,
|
|
292
|
+
isLastRow: isLastRow,
|
|
293
|
+
modes: modes,
|
|
294
|
+
children: col.render ? col.render(row, rowIndex) : row[col.key]
|
|
295
|
+
}, col.key))
|
|
296
|
+
}, getRowKey?.(row, rowIndex) ?? rowIndex);
|
|
297
|
+
})
|
|
298
|
+
})]
|
|
299
|
+
});
|
|
300
|
+
const container = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
301
|
+
accessibilityRole: _reactNative.Platform.OS === 'web' ? 'table' : undefined,
|
|
302
|
+
accessibilityLabel: accessibilityLabel,
|
|
303
|
+
style: [{
|
|
304
|
+
overflow: 'hidden'
|
|
305
|
+
}, !scrollable && {
|
|
306
|
+
width: '100%'
|
|
307
|
+
}, style],
|
|
308
|
+
children: body
|
|
309
|
+
});
|
|
310
|
+
if (scrollable) {
|
|
311
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
|
|
312
|
+
horizontal: true,
|
|
313
|
+
showsHorizontalScrollIndicator: false,
|
|
314
|
+
children: container
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
return container;
|
|
318
|
+
}
|
|
319
|
+
Table.Header = TableHeader;
|
|
320
|
+
Table.HeaderCell = TableHeaderCell;
|
|
321
|
+
Table.Body = TableBody;
|
|
322
|
+
Table.Row = TableRow;
|
|
323
|
+
Table.Cell = TableCell;
|
|
324
|
+
var _default = exports.default = Table;
|
|
@@ -23,6 +23,7 @@ function Text({
|
|
|
23
23
|
modes = _reactUtils.EMPTY_MODES,
|
|
24
24
|
style,
|
|
25
25
|
numberOfLines,
|
|
26
|
+
disableTruncation,
|
|
26
27
|
loading,
|
|
27
28
|
skeletonWidth,
|
|
28
29
|
skeletonLines
|
|
@@ -75,7 +76,7 @@ function Text({
|
|
|
75
76
|
const content = children !== undefined && children !== null && children !== false ? children : text !== undefined ? text : 'Korem ipsum ';
|
|
76
77
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
77
78
|
style: [textStyle, style],
|
|
78
|
-
|
|
79
|
+
...(0, _reactUtils.resolveTruncation)(disableTruncation, numberOfLines),
|
|
79
80
|
children: content
|
|
80
81
|
});
|
|
81
82
|
}
|
|
@@ -172,7 +172,15 @@ const TextInputBase = /*#__PURE__*/(0, _react.forwardRef)(function TextInput({
|
|
|
172
172
|
flex: 1,
|
|
173
173
|
color: textColor,
|
|
174
174
|
fontSize,
|
|
175
|
-
lineHeight
|
|
175
|
+
// iOS-only quirk: a single-line RNTextInput with an explicit `lineHeight`
|
|
176
|
+
// larger than `fontSize` puts all the extra space ABOVE the glyphs, so the
|
|
177
|
+
// text/placeholder sits below center (iOS native font-metrics bug — see
|
|
178
|
+
// facebook/react-native#39145 / #28012). The container centers via
|
|
179
|
+
// `alignItems: 'center'` + `minHeight`, so omit lineHeight on iOS
|
|
180
|
+
// (UITextField centers natively) and keep it on Android/Web where it's fine.
|
|
181
|
+
...(_reactNative.Platform.OS === 'ios' ? null : {
|
|
182
|
+
lineHeight
|
|
183
|
+
}),
|
|
176
184
|
fontFamily,
|
|
177
185
|
fontWeight,
|
|
178
186
|
padding: 0,
|
|
@@ -78,6 +78,7 @@ function TextSegment({
|
|
|
78
78
|
children,
|
|
79
79
|
textAlign = 'Left',
|
|
80
80
|
numberOfLines,
|
|
81
|
+
disableTruncation,
|
|
81
82
|
modes = _reactUtils.EMPTY_MODES,
|
|
82
83
|
style
|
|
83
84
|
}) {
|
|
@@ -111,7 +112,7 @@ function TextSegment({
|
|
|
111
112
|
const content = hasChildren ? (0, _reactUtils.cloneChildrenWithModes)(children, modes) : renderedSegments;
|
|
112
113
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
113
114
|
style: [baseStyle, style],
|
|
114
|
-
|
|
115
|
+
...(0, _reactUtils.resolveTruncation)(disableTruncation, numberOfLines),
|
|
115
116
|
children: content
|
|
116
117
|
});
|
|
117
118
|
}
|
|
@@ -19,7 +19,8 @@ function ThreadHero({
|
|
|
19
19
|
caption,
|
|
20
20
|
renderAvatar,
|
|
21
21
|
modes = _reactUtils.EMPTY_MODES,
|
|
22
|
-
style
|
|
22
|
+
style,
|
|
23
|
+
disableTruncation
|
|
23
24
|
}) {
|
|
24
25
|
// Container Gaps
|
|
25
26
|
const containerGap = Number((0, _figmaVariablesResolver.getVariableByName)('threadHero/gap', modes)) || 8;
|
|
@@ -100,14 +101,12 @@ function ThreadHero({
|
|
|
100
101
|
children: title
|
|
101
102
|
}) : null, subtitle ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
102
103
|
style: subtitleStyle,
|
|
103
|
-
|
|
104
|
-
ellipsizeMode: "tail",
|
|
104
|
+
...(0, _reactUtils.resolveTruncation)(disableTruncation, 1, 'tail'),
|
|
105
105
|
children: subtitle
|
|
106
106
|
}) : null]
|
|
107
107
|
}), caption ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
108
108
|
style: captionStyle,
|
|
109
|
-
|
|
110
|
-
ellipsizeMode: "tail",
|
|
109
|
+
...(0, _reactUtils.resolveTruncation)(disableTruncation, 1, 'tail'),
|
|
111
110
|
children: caption
|
|
112
111
|
}) : null]
|
|
113
112
|
});
|
|
@@ -24,6 +24,7 @@ function Title({
|
|
|
24
24
|
textStyle,
|
|
25
25
|
subtitleStyle,
|
|
26
26
|
numberOfLines,
|
|
27
|
+
disableTruncation,
|
|
27
28
|
accessibilityLabel,
|
|
28
29
|
accessibilityHint,
|
|
29
30
|
...rest
|
|
@@ -93,7 +94,7 @@ function Title({
|
|
|
93
94
|
...rest,
|
|
94
95
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
95
96
|
style: [titleTextStyle, textStyle],
|
|
96
|
-
|
|
97
|
+
...(0, _reactUtils.resolveTruncation)(disableTruncation, numberOfLines !== undefined ? numberOfLines : 1),
|
|
97
98
|
accessibilityElementsHidden: true,
|
|
98
99
|
importantForAccessibility: "no",
|
|
99
100
|
children: title
|
|
@@ -20,7 +20,8 @@ function Toast({
|
|
|
20
20
|
onClose,
|
|
21
21
|
modes = _reactUtils.EMPTY_MODES,
|
|
22
22
|
placement = 'bottom',
|
|
23
|
-
style
|
|
23
|
+
style,
|
|
24
|
+
disableTruncation
|
|
24
25
|
}) {
|
|
25
26
|
const timerRef = (0, _react.useRef)(null);
|
|
26
27
|
(0, _react.useEffect)(() => {
|
|
@@ -78,7 +79,7 @@ function Toast({
|
|
|
78
79
|
accessibilityLiveRegion: "assertive",
|
|
79
80
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
80
81
|
style: textStyle,
|
|
81
|
-
|
|
82
|
+
...(0, _reactUtils.resolveTruncation)(disableTruncation, 2),
|
|
82
83
|
children: title
|
|
83
84
|
})
|
|
84
85
|
});
|
|
@@ -45,6 +45,7 @@ function TransactionBubble({
|
|
|
45
45
|
accessibilityLabel,
|
|
46
46
|
accessibilityHint,
|
|
47
47
|
webAccessibilityProps,
|
|
48
|
+
disableTruncation,
|
|
48
49
|
...rest
|
|
49
50
|
}) {
|
|
50
51
|
const resolvedModes = {
|
|
@@ -114,7 +115,7 @@ function TransactionBubble({
|
|
|
114
115
|
},
|
|
115
116
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
116
117
|
style: descriptionStyle,
|
|
117
|
-
|
|
118
|
+
...(0, _reactUtils.resolveTruncation)(disableTruncation, 1),
|
|
118
119
|
children: description
|
|
119
120
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_MoneyValue.default, {
|
|
120
121
|
value: value,
|
|
@@ -42,7 +42,8 @@ function TransactionStatus({
|
|
|
42
42
|
status = 'Expired',
|
|
43
43
|
date = '20 Mar 2025',
|
|
44
44
|
modes = _reactUtils.EMPTY_MODES,
|
|
45
|
-
style
|
|
45
|
+
style,
|
|
46
|
+
disableTruncation
|
|
46
47
|
}) {
|
|
47
48
|
const gap = Number((0, _figmaVariablesResolver.getVariableByName)('transactionBubble/statusWrap/gap', modes)) || 4;
|
|
48
49
|
// Using 'transactionStatus' tokens for text
|
|
@@ -75,7 +76,7 @@ function TransactionStatus({
|
|
|
75
76
|
modes: modes
|
|
76
77
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
77
78
|
style: textStyle,
|
|
78
|
-
|
|
79
|
+
...(0, _reactUtils.resolveTruncation)(disableTruncation, 1),
|
|
79
80
|
children: [status, " \xB7 ", date]
|
|
80
81
|
})]
|
|
81
82
|
});
|
|
@@ -113,6 +113,7 @@ function UpiHandle({
|
|
|
113
113
|
onPress,
|
|
114
114
|
onClick,
|
|
115
115
|
disabled,
|
|
116
|
+
disableTruncation,
|
|
116
117
|
// accessibilityLabel is accepted on the type for API back-compat; the
|
|
117
118
|
// wrapper renders `accessibilityLabel={undefined}` because the inner Text
|
|
118
119
|
// already carries the label.
|
|
@@ -175,8 +176,7 @@ function UpiHandle({
|
|
|
175
176
|
})
|
|
176
177
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
177
178
|
style: tokens.labelStyle,
|
|
178
|
-
|
|
179
|
-
ellipsizeMode: "tail",
|
|
179
|
+
...(0, _reactUtils.resolveTruncation)(disableTruncation, 1, 'tail'),
|
|
180
180
|
accessibilityElementsHidden: true,
|
|
181
181
|
importantForAccessibility: "no",
|
|
182
182
|
children: label
|