@swan-io/lake 8.15.13 → 8.15.14

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swan-io/lake",
3
- "version": "8.15.13",
3
+ "version": "8.15.14",
4
4
  "engines": {
5
5
  "node": ">=20.9.0",
6
6
  "yarn": "^1.22.0"
@@ -2,6 +2,7 @@ import { IconName } from "./Icon";
2
2
  export type FlowStep = {
3
3
  label: string;
4
4
  icon: IconName;
5
+ isComplete?: boolean;
5
6
  };
6
7
  type Props = {
7
8
  steps: FlowStep[];
@@ -11,7 +11,7 @@ const desktopIconSize = 100;
11
11
  const borderHeight = 2;
12
12
  const desktopPadding = 40;
13
13
  const mobileNumberSize = 24;
14
- const mobileBorderWidth = 4;
14
+ const mobileBorderWidth = 2;
15
15
  const styles = StyleSheet.create({
16
16
  container: {
17
17
  width: "100%",
@@ -41,9 +41,11 @@ const styles = StyleSheet.create({
41
41
  borderWidth: 1,
42
42
  backgroundColor: colors.current[50],
43
43
  },
44
+ mobileNumberActive: {
45
+ borderColor: colors.current[500],
46
+ },
44
47
  mobileNumberText: {
45
48
  position: "relative",
46
- top: 1,
47
49
  },
48
50
  mobileBarContainer: {
49
51
  width: mobileNumberSize,
@@ -55,6 +57,9 @@ const styles = StyleSheet.create({
55
57
  borderRadius: mobileBorderWidth / 2,
56
58
  backgroundColor: colors.gray[100],
57
59
  },
60
+ completeMobileBar: {
61
+ backgroundColor: colors.current[500],
62
+ },
58
63
  });
59
64
  export const FlowPresentation = ({ steps, mode }) => {
60
65
  return match(mode)
@@ -62,9 +67,14 @@ export const FlowPresentation = ({ steps, mode }) => {
62
67
  const isLast = index === steps.length - 1;
63
68
  return (_jsxs(Fragment, { children: [_jsxs(Box, { children: [_jsx(BorderedIcon, { name: icon, size: 100, padding: 16 }), _jsx(Space, { height: 32 }), _jsx(View, { style: isLast ? styles.lastTextContainer : styles.textContainer, children: _jsxs(LakeText, { color: colors.gray[900], variant: "medium", children: [index + 1, ". ", label] }) })] }), !isLast && (_jsx(Box, { direction: "row", alignItems: "center", style: styles.desktopBarContainer, children: _jsx(View, { style: styles.desktopBar }) }))] }, index));
64
69
  }) })))
65
- .with("mobile", () => (_jsx(Box, { direction: "column", children: steps.map(({ label }, index) => {
66
- const isLast = index === steps.length - 1;
67
- return (_jsxs(Fragment, { children: [_jsxs(Box, { direction: "row", alignItems: "center", children: [_jsx(Box, { alignItems: "center", justifyContent: "center", style: styles.mobileNumber, children: _jsx(LakeText, { color: colors.current.primary, variant: "medium", style: styles.mobileNumberText, children: index + 1 }) }), _jsx(Space, { width: 12 }), _jsx(LakeText, { color: colors.gray[400], variant: "smallRegular", children: label })] }), !isLast && (_jsx(Box, { alignItems: "center", style: styles.mobileBarContainer, children: _jsx(View, { style: styles.mobileBar }) }))] }, index));
70
+ .with("mobile", () => (_jsx(Box, { direction: "column", children: steps.map(({ label, isComplete }, index) => {
71
+ return (_jsxs(Fragment, { children: [index > 0 && (_jsx(Box, { alignItems: "center", style: styles.mobileBarContainer, children: _jsx(View, { style: [
72
+ styles.mobileBar,
73
+ isComplete === true ? styles.completeMobileBar : null,
74
+ ] }) })), _jsxs(Box, { direction: "row", alignItems: "center", children: [_jsx(Box, { alignItems: "center", justifyContent: "center", style: [
75
+ styles.mobileNumber,
76
+ isComplete === true ? styles.mobileNumberActive : null,
77
+ ], children: _jsx(LakeText, { color: colors.current.primary, variant: "smallMedium", style: styles.mobileNumberText, children: index + 1 }) }), _jsx(Space, { width: 12 }), _jsx(LakeText, { color: colors.gray[700], variant: "smallMedium", children: label })] })] }, index));
68
78
  }) })))
69
79
  .exhaustive();
70
80
  };