@swan-io/lake 11.1.12 → 11.2.1
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/package.json
CHANGED
package/src/components/Cells.js
CHANGED
|
@@ -135,7 +135,7 @@ export const CopyableTextCell = ({ copiedWording, copyWording, text, textToCopy,
|
|
|
135
135
|
return (_jsxs(Cell, { style: styles.fullHeight, children: [_jsx(LakeTooltip, { content: visibleState === "copy" ? copyWording : copiedWording, onHide: () => setVisibleState("copy"), placement: "left", togglableOnFocus: true, containerStyle: styles.fullHeight, children: _jsx(Pressable, { "aria-label": copyWording, role: "button", onPress: onPress, style: styles.button, children: ({ hovered }) => (_jsxs(_Fragment, { children: [_jsx(Icon, { name: hovered ? "copy-filled" : "copy-regular", color: "currentColor", size: 14 }), hovered && _jsx(View, { role: "none", style: styles.buttonUnderline })] })) }) }), _jsx(LakeText, { numberOfLines: 1, color: colors.gray[900], tooltip: tooltip, variant: variant, children: text })] }));
|
|
136
136
|
};
|
|
137
137
|
// TODO: handle `+` sign properly
|
|
138
|
-
export const BalanceCell = ({ textAlign = "
|
|
138
|
+
export const BalanceCell = ({ textAlign = "left", align = textAlign, currency, formatCurrency, originalValue, value, variant = "medium", }) => (_jsxs(Cell, { align: align, direction: "column", children: [_jsx(LakeText, { numberOfLines: 1, align: align, color: colors.gray[900], variant: variant, style: [
|
|
139
139
|
value > 0 && { color: colors.positive.primary },
|
|
140
140
|
value < 0 && { color: colors.negative.primary },
|
|
141
141
|
], children: (value > 0 ? "+" : "") + formatCurrency(value, currency) }), isNotNullish(originalValue) && originalValue.currency !== currency && (_jsx(LakeText, { numberOfLines: 1, align: align, color: colors.gray[500], variant: "smallRegular", children: (originalValue.value > 0 ? "+" : "") +
|
package/src/components/Icon.d.ts
CHANGED
|
@@ -103,6 +103,7 @@ declare const paths: {
|
|
|
103
103
|
"chevron-right-filled": string;
|
|
104
104
|
"chevron-up-down-regular": string;
|
|
105
105
|
"chevron-up-filled": string;
|
|
106
|
+
"city-regular": string;
|
|
106
107
|
"clipboard-search-regular": string;
|
|
107
108
|
"clock-alarm-filled": string;
|
|
108
109
|
"clock-alarm-regular": string;
|
|
@@ -14,6 +14,9 @@ const styles = StyleSheet.create({
|
|
|
14
14
|
height: 1,
|
|
15
15
|
alignSelf: "stretch",
|
|
16
16
|
},
|
|
17
|
+
grow: {
|
|
18
|
+
flexGrow: 1,
|
|
19
|
+
},
|
|
17
20
|
contentContainer: {
|
|
18
21
|
minWidth: "100%",
|
|
19
22
|
},
|
|
@@ -32,6 +35,7 @@ const styles = StyleSheet.create({
|
|
|
32
35
|
zIndex: 2,
|
|
33
36
|
},
|
|
34
37
|
cellsContainer: {
|
|
38
|
+
boxShadow: `0 -1px ${colors.gray[100]}`,
|
|
35
39
|
flexDirection: "row",
|
|
36
40
|
transform: "translateZ(0)",
|
|
37
41
|
},
|
|
@@ -70,15 +74,11 @@ const styles = StyleSheet.create({
|
|
|
70
74
|
},
|
|
71
75
|
headerCell: {
|
|
72
76
|
flexDirection: "row",
|
|
73
|
-
flexGrow: 1,
|
|
74
77
|
alignItems: "center",
|
|
75
|
-
boxShadow: `0 -1px ${colors.gray[100]}`,
|
|
76
78
|
},
|
|
77
79
|
cell: {
|
|
78
80
|
flexDirection: "row",
|
|
79
|
-
flexGrow: 1,
|
|
80
81
|
alignItems: "stretch",
|
|
81
|
-
boxShadow: `0 -1px ${colors.gray[100]}`,
|
|
82
82
|
},
|
|
83
83
|
shadowsLayerContainer: {
|
|
84
84
|
position: "absolute",
|
|
@@ -306,12 +306,13 @@ export const VirtualizedList = ({ variant, data, stickedToStartColumns, columns,
|
|
|
306
306
|
styles.cellsContainer,
|
|
307
307
|
styles.centerColumnGroup,
|
|
308
308
|
{ width: centerColumnsWidth, backgroundColor, height: headerHeight },
|
|
309
|
-
], children: columns.map(({ id, width, title, renderTitle }, index) => {
|
|
309
|
+
], children: columns.map(({ id, grow = false, width, title, renderTitle }, index) => {
|
|
310
310
|
const columnId = `${viewId}_${id}`;
|
|
311
311
|
const paddingLeft = index === 0 ? centerFirstCellLeftPadding : 0;
|
|
312
312
|
const paddingRight = index === columns.length - 1 ? centerLastCellLeftPadding : 0;
|
|
313
313
|
return (_jsx(View, { style: [
|
|
314
314
|
styles.headerCell,
|
|
315
|
+
grow && styles.grow,
|
|
315
316
|
{ width: width + paddingLeft + paddingRight, paddingLeft, paddingRight },
|
|
316
317
|
], id: columnId, children: renderTitle({ title, extraInfo, id }) }, columnId));
|
|
317
318
|
}) }), Option.fromNullable(stickedToEndColumns)
|
|
@@ -454,12 +455,13 @@ const RawVirtualizedRow = ({ viewId, rowHeight, absoluteIndex, variant, stickedT
|
|
|
454
455
|
? backgroundColorVariants[variant === "accented" ? "default" : "accented"]
|
|
455
456
|
: backgroundColorVariants[variant],
|
|
456
457
|
},
|
|
457
|
-
], children: columns.map(({ id, width, renderCell }, index) => {
|
|
458
|
+
], children: columns.map(({ id, grow = false, width, renderCell }, index) => {
|
|
458
459
|
const columnId = `${viewId}_${id}`;
|
|
459
460
|
const paddingLeft = index === 0 ? centerFirstCellLeftPadding : 0;
|
|
460
461
|
const paddingRight = index === columns.length - 1 ? centerLastCellLeftPadding : 0;
|
|
461
462
|
return (_jsx(View, { style: [
|
|
462
463
|
styles.cell,
|
|
464
|
+
grow && styles.grow,
|
|
463
465
|
{ width: width + paddingLeft + paddingRight, paddingLeft, paddingRight },
|
|
464
466
|
], "aria-describedby": columnId, children: renderCell({
|
|
465
467
|
columnId,
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"chevron-right-filled": "M8.3 4.3a1 1 0 0 0 0 1.4l6.29 6.3-6.3 6.3a1 1 0 1 0 1.42 1.4l7-7a1 1 0 0 0 0-1.4l-7-7a1 1 0 0 0-1.42 0Z",
|
|
52
52
|
"chevron-up-down-regular": "M12.54 2.23a.75.75 0 0 0-1.08 0L5.2 8.73a.75.75 0 1 0 1.08 1.04L12 3.83l5.7 5.94a.75.75 0 1 0 1.1-1.04l-6.26-6.5Zm0 19.54a.75.75 0 0 1-1.08 0l-6.25-6.5a.75.75 0 1 1 1.08-1.04L12 20.17l5.7-5.94a.75.75 0 1 1 1.1 1.04l-6.26 6.5Z",
|
|
53
53
|
"chevron-up-filled": "M4.3 15.7a1 1 0 0 0 1.4 0L12 9.42l6.3 6.3a1 1 0 0 0 1.4-1.42l-7-7a1 1 0 0 0-1.4 0l-7 7a1 1 0 0 0 0 1.42Z",
|
|
54
|
+
"city-regular": "M12 2c.41 0 .75.33.75.75V4h2c.97 0 1.75.78 1.75 1.75V11h2.25c.97 0 1.75.78 1.75 1.75v7.5c0 .97-.78 1.75-1.75 1.75H5.25c-.97 0-1.75-.78-1.75-1.75v-8.43c0-.62.33-1.2.86-1.5L7.5 8.45V5.75C7.5 4.78 8.28 4 9.25 4h2V2.75c0-.42.34-.75.75-.75ZM9 8.02c.81.12 1.5.8 1.5 1.73V20.5h3v-7.75c0-.88.65-1.61 1.5-1.73V5.75a.25.25 0 0 0-.25-.25h-5.5a.25.25 0 0 0-.25.25v2.27Zm6.25 4.48a.25.25 0 0 0-.25.25v7.75h3.75c.14 0 .25-.11.25-.25v-7.5a.25.25 0 0 0-.25-.25h-3.5ZM8.62 9.54l-3.5 2.06a.25.25 0 0 0-.12.22v8.43c0 .14.11.25.25.25H9V9.75c0-.2-.21-.31-.38-.21Z",
|
|
54
55
|
"clipboard-search-regular": "M15.99 4a2.25 2.25 0 0 0-2.24-2h-3.5c-1.16 0-2.11.87-2.24 2H6.25C5.01 4 4 5 4 6.25v3.85c.47-.24.97-.41 1.5-.5V6.24c0-.41.34-.75.75-.75h2.13c.4.6 1.09 1 1.87 1h3.5c.78 0 1.47-.4 1.87-1h2.13c.41 0 .75.34.75.75v13.5c0 .41-.34.75-.75.75h-3.92c.23.47.23 1.03 0 1.5h3.92c1.24 0 2.25-1 2.25-2.25V6.25C20 5.01 19 4 17.75 4h-1.76Zm0 .1.01.15V4.1Zm-5.74-.6h3.5a.75.75 0 0 1 0 1.5h-3.5a.75.75 0 0 1 0-1.5Zm-.3 14.39a4.5 4.5 0 1 0-1.15.98l2.92 2.91a.75.75 0 1 0 1.06-1.06l-2.83-2.83ZM6.5 18a3 3 0 1 1 0-6 3 3 0 0 1 0 6Z",
|
|
55
56
|
"clock-alarm-filled": "M9.1 3.48A4 4 0 1 0 3.48 9.1a8.99 8.99 0 0 0 1.65 8.71l-1.91 1.91a.75.75 0 1 0 1.06 1.06l1.9-1.9a8.96 8.96 0 0 0 11.63 0l1.91 1.9a.75.75 0 1 0 1.06-1.06l-1.9-1.9a8.96 8.96 0 0 0 1.64-8.72 4 4 0 1 0-5.62-5.62 8.99 8.99 0 0 0-5.8 0ZM6 3.5c.63 0 1.2.23 1.65.62a9.04 9.04 0 0 0-3.53 3.53A2.5 2.5 0 0 1 6 3.5Zm10.35.62a2.5 2.5 0 0 1 3.53 3.53 9.04 9.04 0 0 0-3.53-3.53ZM11.25 7c.41 0 .75.34.75.75V12h2.75a.75.75 0 0 1 0 1.5h-3.5a.75.75 0 0 1-.75-.75v-5c0-.41.34-.75.75-.75Z",
|
|
56
57
|
"clock-alarm-regular": "M12 7.75a.75.75 0 0 0-1.5 0v5c0 .41.34.75.75.75h3.5a.75.75 0 0 0 0-1.5H12V7.75ZM3.48 9.1A4 4 0 1 1 9.1 3.48a8.99 8.99 0 0 1 5.8 0 4 4 0 1 1 5.62 5.62 8.99 8.99 0 0 1-1.65 8.71l1.91 1.91a.75.75 0 1 1-1.06 1.06l-1.9-1.9a8.96 8.96 0 0 1-11.63 0l-1.91 1.9a.75.75 0 0 1-1.06-1.06l1.9-1.9A8.96 8.96 0 0 1 3.49 9.1ZM3.5 6c0 .63.23 1.2.62 1.65a9.04 9.04 0 0 1 3.53-3.53A2.5 2.5 0 0 0 3.5 6Zm16.38 1.65a2.5 2.5 0 0 0-3.53-3.53 9.04 9.04 0 0 1 3.53 3.53ZM4.5 12a7.5 7.5 0 1 0 15 0 7.5 7.5 0 0 0-15 0Z",
|