@coinbase/cds-mobile 8.17.5 → 8.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -1
- package/dts/cells/Cell.d.ts +2 -0
- package/dts/cells/Cell.d.ts.map +1 -1
- package/dts/cells/CellDetail.d.ts +6 -2
- package/dts/cells/CellDetail.d.ts.map +1 -1
- package/dts/cells/ListCell.d.ts +8 -2
- package/dts/cells/ListCell.d.ts.map +1 -1
- package/esm/cells/Cell.js +5 -4
- package/esm/cells/CellDetail.js +5 -3
- package/esm/cells/ListCell.js +20 -12
- package/esm/cells/__stories__/ListCell.stories.js +70 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -8,11 +8,21 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
|
|
9
9
|
<!-- template-start -->
|
|
10
10
|
|
|
11
|
+
## 8.18.0 (10/29/2025 PST)
|
|
12
|
+
|
|
13
|
+
#### 🚀 Updates
|
|
14
|
+
|
|
15
|
+
- Support custom `titleNode` `descriptionNode` `detailNode` `subdetailNode` `accessoryNode` for ListCell. [[#131](https://github.com/coinbase/cds/pull/131)] [DX-5006]
|
|
16
|
+
|
|
17
|
+
## 8.17.6 ((10/28/2025, 02:28 PM PST))
|
|
18
|
+
|
|
19
|
+
This is an artificial version bump with no new change.
|
|
20
|
+
|
|
11
21
|
## 8.17.5 (10/27/2025 PST)
|
|
12
22
|
|
|
13
23
|
#### 🐞 Fixes
|
|
14
24
|
|
|
15
|
-
-
|
|
25
|
+
- Increased ListCell innerSpacing when spacingVariant=“condensed” [[#133](https://github.com/coinbase/cds/pull/133)]
|
|
16
26
|
|
|
17
27
|
## 8.17.4 (10/27/2025 PST)
|
|
18
28
|
|
package/dts/cells/Cell.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ export type CellBaseProps = SharedProps &
|
|
|
26
26
|
LinkableProps & {
|
|
27
27
|
/** Accessory element rendered at the end of the cell (e.g., chevron). */
|
|
28
28
|
accessory?: React.ReactElement<CellAccessoryProps>;
|
|
29
|
+
/** Custom accessory node rendered at the end of the cell. Takes precedence over `accessory`. */
|
|
30
|
+
accessoryNode?: React.ReactNode;
|
|
29
31
|
/** Main content of the cell; typically title/description content. */
|
|
30
32
|
children: React.ReactNode;
|
|
31
33
|
/**
|
package/dts/cells/Cell.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cell.d.ts","sourceRoot":"","sources":["../../src/cells/Cell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,KAAK,SAAS,EAAc,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAK5E,OAAO,EAAO,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,YAAY,EACV,SAAS,GACT,UAAU,GACV,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,eAAe,GACf,cAAc,GACd,QAAQ,GACR,SAAS,GACT,SAAS,GACT,WAAW,GACX,WAAW,GACX,cAAc,GACd,aAAa,CAChB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,WAAW,GACrC,aAAa,GAAG;IACd,yEAAyE;IACzE,SAAS,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;IACnD,qEAAqE;IACrE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,GA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,SAAS,CAAC,SAAS,CAAC,CAAC;KAClC,CAAC;CACH,CAAC;AAEJ,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,aAAa,CAAC;AAEjD,eAAO,MAAM,IAAI,uCAkNf,CAAC"}
|
|
@@ -4,14 +4,18 @@ export type CellDetailVariant = 'foregroundMuted' | 'negative' | 'positive' | 'w
|
|
|
4
4
|
export type CellDetailProps = {
|
|
5
5
|
/**
|
|
6
6
|
* Label and/or extra detail. This prop is only intended to accept a string or Text component;
|
|
7
|
-
* other use cases, while allowed, are not supported and may result in unexpected behavior.
|
|
7
|
+
* other use cases, while allowed, are not supported and may result in unexpected behavior. For arbitrary content, use `detailNode`.
|
|
8
8
|
*/
|
|
9
9
|
detail?: React.ReactNode;
|
|
10
|
+
/** React node to render label and/or extra detail. Takes precedence over `detail`. */
|
|
11
|
+
detailNode?: React.ReactNode;
|
|
10
12
|
/**
|
|
11
13
|
* Subdetail providing more information. This prop is only intended to accept a string or Text component;
|
|
12
|
-
* other use cases, while allowed, are not supported and may result in unexpected behavior.
|
|
14
|
+
* other use cases, while allowed, are not supported and may result in unexpected behavior. For arbitrary content, use `subdetailNode`.
|
|
13
15
|
*/
|
|
14
16
|
subdetail?: React.ReactNode;
|
|
17
|
+
/** React node to render subdetail. Takes precedence over `subdetail`. */
|
|
18
|
+
subdetailNode?: React.ReactNode;
|
|
15
19
|
/** Variant color to apply to the subdetail text. */
|
|
16
20
|
variant?: CellDetailVariant;
|
|
17
21
|
/** Specifies whether font should be scaled down automatically to fit given style constraints. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellDetail.d.ts","sourceRoot":"","sources":["../../src/cells/CellDetail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AAIpC,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;AACxF,MAAM,MAAM,eAAe,GAAG;IAC5B;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,oDAAoD;IACpD,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,iGAAiG;IACjG,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,2CAA2C;IAC3C,aAAa,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;CACnC,CAAC;AASF,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"CellDetail.d.ts","sourceRoot":"","sources":["../../src/cells/CellDetail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AAIpC,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;AACxF,MAAM,MAAM,eAAe,GAAG;IAC5B;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,sFAAsF;IACtF,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,yEAAyE;IACzE,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,oDAAoD;IACpD,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,iGAAiG;IACjG,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,2CAA2C;IAC3C,aAAa,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;CACnC,CAAC;AASF,eAAO,MAAM,UAAU,6CAiCrB,CAAC"}
|
package/dts/cells/ListCell.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ export type ListCellBaseProps = CellDetailProps &
|
|
|
17
17
|
Omit<CellBaseProps, 'accessory' | 'children'> & {
|
|
18
18
|
/** Accessory to display at the end of the cell. */
|
|
19
19
|
accessory?: CellAccessoryType;
|
|
20
|
+
/** Custom accessory node rendered at the end of the cell. Takes precedence over `accessory`. */
|
|
21
|
+
accessoryNode?: React.ReactNode;
|
|
20
22
|
/**
|
|
21
23
|
* End-aligned content (e.g., CTA, form element, metric). Replacement for the deprecated action prop, and takes precedence over it.
|
|
22
24
|
* If the content is a action (like button, link, etc), we recommand avoid using alongside `onPress`.
|
|
@@ -55,8 +57,10 @@ export type ListCellBaseProps = CellDetailProps &
|
|
|
55
57
|
* @default 'normal'
|
|
56
58
|
*/
|
|
57
59
|
spacingVariant?: 'normal' | 'compact' | 'condensed';
|
|
58
|
-
/** Description of content. Max 1 line (with title) or 2 lines (without), otherwise will truncate. */
|
|
60
|
+
/** Description of content. Max 1 line (with title) or 2 lines (without), otherwise will truncate. This prop is only intended to accept a string or Text component; other use cases, while allowed, are not supported and may result in unexpected behavior. For arbitrary content, use `descriptionNode`. */
|
|
59
61
|
description?: React.ReactNode;
|
|
62
|
+
/** React node to render description. Takes precedence over `description`. */
|
|
63
|
+
descriptionNode?: React.ReactNode;
|
|
60
64
|
/**
|
|
61
65
|
* Disable the default accessory that is displayed when the cell is selected.
|
|
62
66
|
* If `accessory` is provided, that will continue to be displayed, otherwise no accessory will be displayed when the cell is selected.
|
|
@@ -76,8 +80,10 @@ export type ListCellBaseProps = CellDetailProps &
|
|
|
76
80
|
media?: React.ReactElement;
|
|
77
81
|
/** Allow the description to span multiple lines. This *will* break fixed height requirements, so should not be used in a `FlatList`. */
|
|
78
82
|
multiline?: boolean;
|
|
79
|
-
/** Title of content. Max 1 line (with description) or 2 lines (without), otherwise will truncate. */
|
|
83
|
+
/** Title of content. Max 1 line (with description) or 2 lines (without), otherwise will truncate. This prop is only intended to accept a string or Text component; other use cases, while allowed, are not supported and may result in unexpected behavior. For arbitrary content, use `titleNode`. */
|
|
80
84
|
title?: React.ReactNode;
|
|
85
|
+
/** React node to render title. Takes precedence over `title`. */
|
|
86
|
+
titleNode?: React.ReactNode;
|
|
81
87
|
/** Styles for the components */
|
|
82
88
|
styles?: {
|
|
83
89
|
root?: StyleProp<ViewStyle>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListCell.d.ts","sourceRoot":"","sources":["../../src/cells/ListCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMpE,OAAO,EAAQ,KAAK,aAAa,EAAE,KAAK,SAAS,EAAoB,MAAM,QAAQ,CAAC;AACpF,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAEhE,eAAO,MAAM,qBAAqB;;;;CAIF,CAAC;AAGjC,eAAO,MAAM,qBAAqB;;;;CAIF,CAAC;AAEjC,MAAM,MAAM,iBAAiB,GAAG,eAAe,GAC7C,IAAI,CAAC,aAAa,EAAE,WAAW,GAAG,UAAU,CAAC,GAAG;IAC9C,mDAAmD;IACnD,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B;;;;OAIG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,cAAc,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;IACpD,
|
|
1
|
+
{"version":3,"file":"ListCell.d.ts","sourceRoot":"","sources":["../../src/cells/ListCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,O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CAAC,YAAY,CAAC;IAC3B,wIAAwI;IACxI,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uSAAuS;IACvS,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,iEAAiE;IACjE,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,gCAAgC;IAChC,MAAM,CAAC,EAAE;QACP,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC5B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC7B,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QACpC,GAAG,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC3B,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QACjC,gBAAgB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QACxC,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QACjC,WAAW,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QACnC,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAClC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC7B,WAAW,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KACpC,CAAC;CACH,CAAC;AAEJ,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,IAAI,CAAC,SAAS,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;AAE1F,eAAO,MAAM,QAAQ,2CAoJnB,CAAC"}
|
package/esm/cells/Cell.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["accessory", "alignItems", "borderRadius", "children", "styles", "end", "detail", "detailWidth", "disabled", "intermediary", "media", "minHeight", "maxHeight", "onLayout", "onPress", "priority", "selected", "testID", "accessibilityLabel", "accessibilityHint", "gap", "columnGap", "rowGap", "innerSpacing", "outerSpacing", "bottomContent", "style"],
|
|
1
|
+
const _excluded = ["accessory", "accessoryNode", "alignItems", "borderRadius", "children", "styles", "end", "detail", "detailWidth", "disabled", "intermediary", "media", "minHeight", "maxHeight", "onLayout", "onPress", "priority", "selected", "testID", "accessibilityLabel", "accessibilityHint", "gap", "columnGap", "rowGap", "innerSpacing", "outerSpacing", "bottomContent", "style"],
|
|
2
2
|
_excluded2 = ["marginX"];
|
|
3
3
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
4
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
@@ -15,6 +15,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
15
15
|
export const Cell = /*#__PURE__*/memo(function Cell(_ref) {
|
|
16
16
|
let {
|
|
17
17
|
accessory,
|
|
18
|
+
accessoryNode,
|
|
18
19
|
alignItems = 'center',
|
|
19
20
|
borderRadius = 200,
|
|
20
21
|
children,
|
|
@@ -100,11 +101,11 @@ export const Cell = /*#__PURE__*/memo(function Cell(_ref) {
|
|
|
100
101
|
style: styles == null ? void 0 : styles.end,
|
|
101
102
|
width: detailWidth,
|
|
102
103
|
children: endContent
|
|
103
|
-
}), !!accessory && /*#__PURE__*/_jsx(Box, {
|
|
104
|
+
}), !!(accessoryNode != null ? accessoryNode : accessory) && /*#__PURE__*/_jsx(Box, {
|
|
104
105
|
flexGrow: 0,
|
|
105
106
|
flexShrink: 0,
|
|
106
107
|
style: styles == null ? void 0 : styles.accessory,
|
|
107
|
-
children: accessory
|
|
108
|
+
children: accessoryNode != null ? accessoryNode : accessory
|
|
108
109
|
})]
|
|
109
110
|
});
|
|
110
111
|
if (!bottomContent) {
|
|
@@ -125,7 +126,7 @@ export const Cell = /*#__PURE__*/memo(function Cell(_ref) {
|
|
|
125
126
|
children: bottomContent
|
|
126
127
|
})]
|
|
127
128
|
}));
|
|
128
|
-
}, [borderRadius, testID, disabled, selected, onPress, innerSpacingWithoutMarginX, innerSpacing, alignItems, columnGap, gap, media, styles == null ? void 0 : styles.media, priority, children, intermediary, styles == null ? void 0 : styles.intermediary, end, detail, detailWidth, styles == null ? void 0 : styles.end, accessory, styles == null ? void 0 : styles.accessory, bottomContent, styles == null ? void 0 : styles.contentContainer, styles == null ? void 0 : styles.topContent, styles == null ? void 0 : styles.bottomContent, rowGap]);
|
|
129
|
+
}, [borderRadius, testID, disabled, selected, onPress, innerSpacingWithoutMarginX, innerSpacing, alignItems, columnGap, gap, media, styles == null ? void 0 : styles.media, priority, children, intermediary, styles == null ? void 0 : styles.intermediary, end, detail, detailWidth, styles == null ? void 0 : styles.end, accessory, accessoryNode, styles == null ? void 0 : styles.accessory, bottomContent, styles == null ? void 0 : styles.contentContainer, styles == null ? void 0 : styles.topContent, styles == null ? void 0 : styles.bottomContent, rowGap]);
|
|
129
130
|
const pressableWrappedContent = useMemo(() => {
|
|
130
131
|
if (onPress) {
|
|
131
132
|
const offsetStyle = {
|
package/esm/cells/CellDetail.js
CHANGED
|
@@ -12,7 +12,9 @@ export const CellDetail = /*#__PURE__*/memo(function CellDetail(_ref) {
|
|
|
12
12
|
let {
|
|
13
13
|
adjustsFontSizeToFit,
|
|
14
14
|
detail,
|
|
15
|
+
detailNode,
|
|
15
16
|
subdetail,
|
|
17
|
+
subdetailNode,
|
|
16
18
|
variant = 'foregroundMuted',
|
|
17
19
|
subdetailFont = 'label2'
|
|
18
20
|
} = _ref;
|
|
@@ -20,17 +22,17 @@ export const CellDetail = /*#__PURE__*/memo(function CellDetail(_ref) {
|
|
|
20
22
|
alignContent: "flex-end",
|
|
21
23
|
alignItems: "flex-end",
|
|
22
24
|
justifyContent: "center",
|
|
23
|
-
children: [
|
|
25
|
+
children: [detailNode ? detailNode : detail ? /*#__PURE__*/_jsx(Text, {
|
|
24
26
|
adjustsFontSizeToFit: adjustsFontSizeToFit,
|
|
25
27
|
font: "body",
|
|
26
28
|
numberOfLines: 1,
|
|
27
29
|
children: detail
|
|
28
|
-
}),
|
|
30
|
+
}) : null, subdetailNode ? subdetailNode : subdetail ? /*#__PURE__*/_jsx(Text, {
|
|
29
31
|
adjustsFontSizeToFit: adjustsFontSizeToFit,
|
|
30
32
|
color: variantColorMap[variant],
|
|
31
33
|
font: subdetailFont,
|
|
32
34
|
numberOfLines: 1,
|
|
33
35
|
children: subdetail
|
|
34
|
-
})]
|
|
36
|
+
}) : null]
|
|
35
37
|
});
|
|
36
38
|
});
|
package/esm/cells/ListCell.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["accessory", "end", "action", "compact", "title", "disableMultilineTitle", "description", "detail", "detailWidth", "intermediary", "priority", "innerSpacing", "outerSpacing", "disabled", "disableSelectionAccessory", "helperText", "media", "multiline", "selected", "subdetail", "variant", "onPress", "spacingVariant", "style", "styles"];
|
|
1
|
+
const _excluded = ["accessory", "accessoryNode", "end", "action", "compact", "title", "titleNode", "disableMultilineTitle", "description", "descriptionNode", "detail", "detailNode", "detailWidth", "intermediary", "priority", "innerSpacing", "outerSpacing", "disabled", "disableSelectionAccessory", "helperText", "media", "multiline", "selected", "subdetail", "subdetailNode", "variant", "onPress", "spacingVariant", "style", "styles"];
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
4
4
|
import React, { memo, useMemo } from 'react';
|
|
@@ -25,13 +25,17 @@ export const ListCell = /*#__PURE__*/memo(function ListCell(_ref) {
|
|
|
25
25
|
var _props$borderRadius;
|
|
26
26
|
let {
|
|
27
27
|
accessory,
|
|
28
|
+
accessoryNode,
|
|
28
29
|
end: endProp,
|
|
29
30
|
action,
|
|
30
31
|
compact,
|
|
31
32
|
title,
|
|
33
|
+
titleNode,
|
|
32
34
|
disableMultilineTitle = false,
|
|
33
35
|
description,
|
|
36
|
+
descriptionNode,
|
|
34
37
|
detail,
|
|
38
|
+
detailNode,
|
|
35
39
|
detailWidth,
|
|
36
40
|
intermediary,
|
|
37
41
|
priority,
|
|
@@ -44,6 +48,7 @@ export const ListCell = /*#__PURE__*/memo(function ListCell(_ref) {
|
|
|
44
48
|
multiline,
|
|
45
49
|
selected,
|
|
46
50
|
subdetail,
|
|
51
|
+
subdetailNode,
|
|
47
52
|
variant,
|
|
48
53
|
onPress,
|
|
49
54
|
spacingVariant = compact ? 'compact' : 'normal',
|
|
@@ -53,18 +58,21 @@ export const ListCell = /*#__PURE__*/memo(function ListCell(_ref) {
|
|
|
53
58
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
54
59
|
const minHeight = spacingVariant === 'compact' ? compactListHeight : spacingVariant === 'normal' ? listHeight : undefined;
|
|
55
60
|
const accessoryType = selected && !disableSelectionAccessory ? 'selected' : accessory;
|
|
56
|
-
const hasDetails = Boolean(detail || subdetail);
|
|
61
|
+
const hasDetails = Boolean(detail || subdetail || detailNode || subdetailNode);
|
|
57
62
|
const end = useMemo(() => endProp || action || hasDetails && /*#__PURE__*/_jsx(CellDetail, {
|
|
58
63
|
adjustsFontSizeToFit: !!detailWidth,
|
|
59
64
|
detail: detail,
|
|
65
|
+
detailNode: detailNode,
|
|
60
66
|
subdetail: subdetail,
|
|
61
67
|
subdetailFont: spacingVariant === 'condensed' ? 'label2' : 'body',
|
|
68
|
+
subdetailNode: subdetailNode,
|
|
62
69
|
variant: variant
|
|
63
|
-
}), [endProp, action, hasDetails, detail, subdetail, detailWidth, spacingVariant, variant]);
|
|
70
|
+
}), [endProp, action, hasDetails, detail, detailNode, subdetail, subdetailNode, detailWidth, spacingVariant, variant]);
|
|
64
71
|
return /*#__PURE__*/_jsx(Cell, _extends({
|
|
65
72
|
accessory: accessoryType ? /*#__PURE__*/_jsx(CellAccessory, {
|
|
66
73
|
type: accessoryType
|
|
67
74
|
}) : undefined,
|
|
75
|
+
accessoryNode: accessoryNode,
|
|
68
76
|
borderRadius: (_props$borderRadius = props.borderRadius) != null ? _props$borderRadius : spacingVariant === 'condensed' ? 0 : undefined,
|
|
69
77
|
bottomContent: helperText,
|
|
70
78
|
detailWidth: detailWidth,
|
|
@@ -80,23 +88,23 @@ export const ListCell = /*#__PURE__*/memo(function ListCell(_ref) {
|
|
|
80
88
|
selected: selected,
|
|
81
89
|
style: [style, styles == null ? void 0 : styles.root],
|
|
82
90
|
styles: {
|
|
83
|
-
media: styles == null ? void 0 : styles.media,
|
|
84
|
-
intermediary: styles == null ? void 0 : styles.intermediary,
|
|
85
|
-
end: styles == null ? void 0 : styles.end,
|
|
86
91
|
accessory: styles == null ? void 0 : styles.accessory,
|
|
87
|
-
topContent: styles == null ? void 0 : styles.mainContent,
|
|
88
92
|
bottomContent: styles == null ? void 0 : styles.helperText,
|
|
89
93
|
contentContainer: styles == null ? void 0 : styles.contentContainer,
|
|
94
|
+
end: styles == null ? void 0 : styles.end,
|
|
95
|
+
intermediary: styles == null ? void 0 : styles.intermediary,
|
|
96
|
+
media: styles == null ? void 0 : styles.media,
|
|
90
97
|
pressable: [
|
|
91
98
|
// for the condensed spacing, we need to offset the margin vertical to remove the strange gap between the pressable area
|
|
92
|
-
spacingVariant === 'condensed' &&
|
|
99
|
+
spacingVariant === 'condensed' && Boolean(onPress) && {
|
|
93
100
|
marginVertical: -1
|
|
94
|
-
}, styles == null ? void 0 : styles.pressable]
|
|
101
|
+
}, styles == null ? void 0 : styles.pressable],
|
|
102
|
+
topContent: styles == null ? void 0 : styles.mainContent
|
|
95
103
|
}
|
|
96
104
|
}, props, {
|
|
97
105
|
children: /*#__PURE__*/_jsxs(VStack, {
|
|
98
106
|
justifyContent: "center",
|
|
99
|
-
children: [
|
|
107
|
+
children: [titleNode ? titleNode : title ? /*#__PURE__*/_jsx(Text, {
|
|
100
108
|
ellipsize: "tail",
|
|
101
109
|
font: "headline",
|
|
102
110
|
numberOfLines: disableMultilineTitle ? 1 :
|
|
@@ -104,14 +112,14 @@ export const ListCell = /*#__PURE__*/memo(function ListCell(_ref) {
|
|
|
104
112
|
spacingVariant === 'condensed' ? 2 : description ? 1 : 2,
|
|
105
113
|
style: styles == null ? void 0 : styles.title,
|
|
106
114
|
children: title
|
|
107
|
-
}),
|
|
115
|
+
}) : null, descriptionNode ? descriptionNode : description ? /*#__PURE__*/_jsx(Text, {
|
|
108
116
|
color: "fgMuted",
|
|
109
117
|
ellipsize: multiline ? undefined : 'tail',
|
|
110
118
|
font: spacingVariant === 'condensed' ? 'label2' : 'body',
|
|
111
119
|
numberOfLines: multiline ? undefined : title ? 1 : 2,
|
|
112
120
|
style: styles == null ? void 0 : styles.description,
|
|
113
121
|
children: description
|
|
114
|
-
})]
|
|
122
|
+
}) : null]
|
|
115
123
|
})
|
|
116
124
|
}));
|
|
117
125
|
});
|
|
@@ -85,6 +85,70 @@ const Content = () => {
|
|
|
85
85
|
})]
|
|
86
86
|
});
|
|
87
87
|
};
|
|
88
|
+
const CustomNodes = () => /*#__PURE__*/_jsxs(_Fragment, {
|
|
89
|
+
children: [/*#__PURE__*/_jsx(ListCell, {
|
|
90
|
+
descriptionNode: /*#__PURE__*/_jsxs(HStack, {
|
|
91
|
+
alignItems: "center",
|
|
92
|
+
gap: 1,
|
|
93
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
94
|
+
color: "fgMuted",
|
|
95
|
+
children: "Composed description with any React nodes"
|
|
96
|
+
}), /*#__PURE__*/_jsx(Icon, {
|
|
97
|
+
name: "info"
|
|
98
|
+
})]
|
|
99
|
+
}),
|
|
100
|
+
media: /*#__PURE__*/_jsx(Avatar, {
|
|
101
|
+
src: assets.eth.imageUrl
|
|
102
|
+
}),
|
|
103
|
+
spacingVariant: "condensed",
|
|
104
|
+
titleNode: /*#__PURE__*/_jsxs(HStack, {
|
|
105
|
+
alignItems: "center",
|
|
106
|
+
gap: 1,
|
|
107
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
108
|
+
name: "checkmark"
|
|
109
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
110
|
+
font: "headline",
|
|
111
|
+
children: "Verified account"
|
|
112
|
+
})]
|
|
113
|
+
})
|
|
114
|
+
}), /*#__PURE__*/_jsx(ListCell, {
|
|
115
|
+
accessoryNode: /*#__PURE__*/_jsx(IconButton, {
|
|
116
|
+
accessibilityLabel: "Help",
|
|
117
|
+
name: "info",
|
|
118
|
+
onPress: () => console.log('Accessory')
|
|
119
|
+
}),
|
|
120
|
+
description: "Using detailNode/subdetailNode and accessoryNode",
|
|
121
|
+
detailNode: /*#__PURE__*/_jsxs(HStack, {
|
|
122
|
+
alignItems: "center",
|
|
123
|
+
gap: 1,
|
|
124
|
+
justifyContent: "flex-end",
|
|
125
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
126
|
+
name: "info"
|
|
127
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
128
|
+
font: "body",
|
|
129
|
+
children: "$12"
|
|
130
|
+
})]
|
|
131
|
+
}),
|
|
132
|
+
media: /*#__PURE__*/_jsx(Avatar, {
|
|
133
|
+
src: assets.eth.imageUrl
|
|
134
|
+
}),
|
|
135
|
+
priority: "end",
|
|
136
|
+
spacingVariant: "condensed",
|
|
137
|
+
subdetailNode: /*#__PURE__*/_jsxs(HStack, {
|
|
138
|
+
alignItems: "center",
|
|
139
|
+
gap: 0.5,
|
|
140
|
+
justifyContent: "flex-end",
|
|
141
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
142
|
+
name: "info"
|
|
143
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
144
|
+
color: "fgPositive",
|
|
145
|
+
font: "label2",
|
|
146
|
+
children: "+5.43%"
|
|
147
|
+
})]
|
|
148
|
+
}),
|
|
149
|
+
title: "Custom nodes"
|
|
150
|
+
})]
|
|
151
|
+
});
|
|
88
152
|
const CompactContent = () => {
|
|
89
153
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
90
154
|
children: [/*#__PURE__*/_jsx(ListCell, {
|
|
@@ -1157,6 +1221,12 @@ const ListCellScreen = () => {
|
|
|
1157
1221
|
title: "Content",
|
|
1158
1222
|
titlePadding: titlePadding,
|
|
1159
1223
|
children: /*#__PURE__*/_jsx(Content, {})
|
|
1224
|
+
}), /*#__PURE__*/_jsx(Example, {
|
|
1225
|
+
inline: true,
|
|
1226
|
+
paddingX: 0,
|
|
1227
|
+
title: "CustomNodes",
|
|
1228
|
+
titlePadding: titlePadding,
|
|
1229
|
+
children: /*#__PURE__*/_jsx(CustomNodes, {})
|
|
1160
1230
|
}), /*#__PURE__*/_jsx(Example, {
|
|
1161
1231
|
inline: true,
|
|
1162
1232
|
paddingX: 0,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cds-mobile",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.18.0",
|
|
4
4
|
"description": "Coinbase Design System - Mobile",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"react-native-svg": "^14.1.0"
|
|
151
151
|
},
|
|
152
152
|
"dependencies": {
|
|
153
|
-
"@coinbase/cds-common": "^8.
|
|
153
|
+
"@coinbase/cds-common": "^8.18.0",
|
|
154
154
|
"@coinbase/cds-icons": "^5.5.0",
|
|
155
155
|
"@coinbase/cds-illustrations": "^4.25.0",
|
|
156
156
|
"@coinbase/cds-lottie-files": "^3.3.2",
|