@swan-io/lake 11.1.9 → 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
package/src/components/Cells.js
CHANGED
|
@@ -142,17 +142,12 @@ export const BalanceCell = ({ textAlign = "right", align = textAlign, currency,
|
|
|
142
142
|
formatCurrency(originalValue.value, originalValue.currency) }))] }));
|
|
143
143
|
export const LinkCell = ({ buttonPosition = "start", children, external = false, fadeOn, onPress, tooltip, variant = "medium", }) => {
|
|
144
144
|
const atEnd = buttonPosition === "end";
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
];
|
|
152
|
-
if (atEnd) {
|
|
153
|
-
elements.reverse();
|
|
154
|
-
}
|
|
155
|
-
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] })) }));
|
|
156
151
|
};
|
|
157
152
|
/**
|
|
158
153
|
* @deprecated Avoid usage
|
|
@@ -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();
|