@swan-io/lake 11.1.8 → 11.1.10
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
|
@@ -125,7 +125,10 @@ export declare const CenteredCell: (props: Except<CellProps, "align">) => import
|
|
|
125
125
|
* @deprecated Use `<Cell align="right" />` instead
|
|
126
126
|
*/
|
|
127
127
|
export declare const EndAlignedCell: (props: Except<CellProps, "align">) => import("react/jsx-runtime").JSX.Element;
|
|
128
|
-
|
|
128
|
+
/**
|
|
129
|
+
* @deprecated Use `<Cell align="right" />` instead
|
|
130
|
+
*/
|
|
131
|
+
export declare const ActionCell: (props: CellProps) => import("react/jsx-runtime").JSX.Element;
|
|
129
132
|
/**
|
|
130
133
|
* @deprecated Use <ActionCell /> instead
|
|
131
134
|
*/
|
package/src/components/Cells.js
CHANGED
|
@@ -29,14 +29,14 @@ const justifyContentStyles = StyleSheet.create({
|
|
|
29
29
|
right: { justifyContent: "flex-end" },
|
|
30
30
|
});
|
|
31
31
|
/* eslint-enable react-native/no-unused-styles */
|
|
32
|
-
const fadeOnLeftMask = `linear-gradient(to right, ${invariantColors.transparent}, ${invariantColors.black} ${spacings[
|
|
33
|
-
const fadeOnRightMask = `linear-gradient(to left, ${invariantColors.transparent}, ${invariantColors.black} ${spacings[
|
|
32
|
+
const fadeOnLeftMask = `linear-gradient(to right, ${invariantColors.transparent}, ${invariantColors.black} ${spacings[8]})`;
|
|
33
|
+
const fadeOnRightMask = `linear-gradient(to left, ${invariantColors.transparent}, ${invariantColors.black} ${spacings[8]})`;
|
|
34
34
|
const styles = StyleSheet.create({
|
|
35
35
|
cell: {
|
|
36
36
|
flexDirection: "row",
|
|
37
37
|
flexGrow: 1,
|
|
38
38
|
flexShrink: 1,
|
|
39
|
-
paddingHorizontal: spacings[
|
|
39
|
+
paddingHorizontal: spacings[8],
|
|
40
40
|
},
|
|
41
41
|
cellContentContainer: {
|
|
42
42
|
flexGrow: 1,
|
|
@@ -98,10 +98,6 @@ const styles = StyleSheet.create({
|
|
|
98
98
|
paddingRight: 0,
|
|
99
99
|
paddingLeft: spacings[8],
|
|
100
100
|
},
|
|
101
|
-
actionCell: {
|
|
102
|
-
paddingVertical: spacings[16],
|
|
103
|
-
paddingHorizontal: spacings[8],
|
|
104
|
-
},
|
|
105
101
|
});
|
|
106
102
|
export const Cell = ({ children, align = "left", direction = "row", fadeOn, style, contentContainerStyle, }) => (_jsx(View, { style: [styles.cell, style], children: _jsx(View, { style: [
|
|
107
103
|
styles.cellContentContainer,
|
|
@@ -146,17 +142,12 @@ export const BalanceCell = ({ textAlign = "right", align = textAlign, currency,
|
|
|
146
142
|
formatCurrency(originalValue.value, originalValue.currency) }))] }));
|
|
147
143
|
export const LinkCell = ({ buttonPosition = "start", children, external = false, fadeOn, onPress, tooltip, variant = "medium", }) => {
|
|
148
144
|
const atEnd = buttonPosition === "end";
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
];
|
|
156
|
-
if (atEnd) {
|
|
157
|
-
elements.reverse();
|
|
158
|
-
}
|
|
159
|
-
return _jsx(Cell, { fadeOn: fadeOn, children: elements });
|
|
145
|
+
const button = (_jsx(Pressable, { style: [styles.button, atEnd && styles.buttonEnd], onPress: event => {
|
|
146
|
+
event.preventDefault();
|
|
147
|
+
onPress();
|
|
148
|
+
}, children: ({ hovered }) => (_jsxs(_Fragment, { children: [_jsx(Icon, { size: 14, name: external ? "open-regular" : "arrow-right-filled" }), hovered && (_jsx(View, { role: "none", style: [styles.buttonUnderline, atEnd && styles.buttonEndUnderline] }))] })) }));
|
|
149
|
+
const text = (_jsx(LakeText, { numberOfLines: 1, color: colors.gray[900], variant: variant, tooltip: tooltip, children: children }));
|
|
150
|
+
return (_jsx(Cell, { fadeOn: fadeOn, children: atEnd ? (_jsxs(_Fragment, { children: [text, button] })) : (_jsxs(_Fragment, { children: [button, text] })) }));
|
|
160
151
|
};
|
|
161
152
|
/**
|
|
162
153
|
* @deprecated Avoid usage
|
|
@@ -196,7 +187,10 @@ export const CenteredCell = (props) => (_jsx(Cell, { align: "center", ...props }
|
|
|
196
187
|
* @deprecated Use `<Cell align="right" />` instead
|
|
197
188
|
*/
|
|
198
189
|
export const EndAlignedCell = (props) => (_jsx(Cell, { align: "right", ...props }));
|
|
199
|
-
|
|
190
|
+
/**
|
|
191
|
+
* @deprecated Use `<Cell align="right" />` instead
|
|
192
|
+
*/
|
|
193
|
+
export const ActionCell = (props) => _jsx(Cell, { align: "right", ...props });
|
|
200
194
|
/**
|
|
201
195
|
* @deprecated Use <ActionCell /> instead
|
|
202
196
|
*/
|
|
@@ -26,10 +26,10 @@ const styles = StyleSheet.create({
|
|
|
26
26
|
flexDirection: "row",
|
|
27
27
|
alignItems: "stretch",
|
|
28
28
|
overflow: "hidden",
|
|
29
|
-
paddingHorizontal: spacings[
|
|
29
|
+
paddingHorizontal: spacings[16],
|
|
30
30
|
},
|
|
31
31
|
segmentLarge: {
|
|
32
|
-
paddingHorizontal: spacings[
|
|
32
|
+
paddingHorizontal: spacings[32],
|
|
33
33
|
},
|
|
34
34
|
row: {
|
|
35
35
|
boxShadow: `inset 0 -1px ${colors.gray[100]}`,
|
|
@@ -7,7 +7,7 @@ import { backgroundColor as backgroundColorVariants, colors, spacings } from "..
|
|
|
7
7
|
import { useHover } from "../hooks/useHover";
|
|
8
8
|
import { ScrollView } from "./ScrollView";
|
|
9
9
|
import { Space } from "./Space";
|
|
10
|
-
const HORIZONTAL_ROW_PADDING =
|
|
10
|
+
const HORIZONTAL_ROW_PADDING = 16;
|
|
11
11
|
const styles = StyleSheet.create({
|
|
12
12
|
container: {
|
|
13
13
|
...commonStyles.fill,
|
|
@@ -441,7 +441,7 @@ const RawVirtualizedRow = ({ viewId, rowHeight, absoluteIndex, variant, stickedT
|
|
|
441
441
|
item,
|
|
442
442
|
index: absoluteIndex,
|
|
443
443
|
extraInfo,
|
|
444
|
-
isHovered
|
|
444
|
+
isHovered,
|
|
445
445
|
}) }, columnId));
|
|
446
446
|
}) })))
|
|
447
447
|
.toNull(), _jsx(View, { style: [
|
|
@@ -466,7 +466,7 @@ const RawVirtualizedRow = ({ viewId, rowHeight, absoluteIndex, variant, stickedT
|
|
|
466
466
|
item,
|
|
467
467
|
index: absoluteIndex,
|
|
468
468
|
extraInfo,
|
|
469
|
-
isHovered
|
|
469
|
+
isHovered,
|
|
470
470
|
}) }, columnId));
|
|
471
471
|
}) }), Option.fromNullable(stickedToEndColumns)
|
|
472
472
|
.map(columns => (_jsx(View, { style: [
|
|
@@ -488,7 +488,7 @@ const RawVirtualizedRow = ({ viewId, rowHeight, absoluteIndex, variant, stickedT
|
|
|
488
488
|
item,
|
|
489
489
|
index: absoluteIndex,
|
|
490
490
|
extraInfo,
|
|
491
|
-
isHovered
|
|
491
|
+
isHovered,
|
|
492
492
|
}) }, columnId));
|
|
493
493
|
}) })))
|
|
494
494
|
.toNull()] })),
|
|
@@ -36,7 +36,7 @@ export const useContextualLayer = ({ placement, visible, matchReferenceWidth = f
|
|
|
36
36
|
top: rect.top + height,
|
|
37
37
|
};
|
|
38
38
|
const horizontalPosition = match(inferedPlacement)
|
|
39
|
-
.with("left", () => ({ left: rect.left
|
|
39
|
+
.with("left", () => ({ left: rect.left }))
|
|
40
40
|
.with("right", () => ({ right: window.innerWidth - rect.right }))
|
|
41
41
|
.with("center", () => ({ left: rect.left + width / 2, transform: "translateX(-50%)" }))
|
|
42
42
|
.exhaustive();
|