@swan-io/lake 2.1.4 → 2.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 +9 -9
- package/src/assets/fonts/RobotoMono-Regular.ttf +0 -0
- package/src/assets/fonts/RobotoMono.css +7 -0
- package/src/assets/main.css +1 -0
- package/src/components/Breadcrumbs.js +2 -2
- package/src/components/FixedListViewCells.js +1 -0
- package/src/components/LakeLabel.js +1 -0
- package/src/components/Pressable.d.ts +1 -1
- package/src/components/TabView.js +3 -3
- package/src/components/ToastStack.js +1 -0
- package/src/constants/design.d.ts +1 -0
- package/src/constants/design.js +1 -0
- package/src/utils/file.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swan-io/lake",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=18.0.0",
|
|
6
6
|
"yarn": "^1.22.0"
|
|
@@ -31,25 +31,25 @@
|
|
|
31
31
|
"@swan-io/chicane": "^1.4.0",
|
|
32
32
|
"dayjs": "^1.11.8",
|
|
33
33
|
"polished": "^4.2.2",
|
|
34
|
-
"prism-react-renderer": "^2.0.
|
|
34
|
+
"prism-react-renderer": "^2.0.5",
|
|
35
35
|
"react": "^18.2.0",
|
|
36
36
|
"react-atomic-state": "^1.2.7",
|
|
37
37
|
"react-dom": "^18.2.0",
|
|
38
|
-
"react-native-web": "^0.19.
|
|
38
|
+
"react-native-web": "^0.19.5",
|
|
39
39
|
"react-popper": "^2.3.0",
|
|
40
40
|
"react-ux-form": "^1.3.0",
|
|
41
41
|
"rifm": "^0.12.1",
|
|
42
42
|
"ts-dedent": "^2.2.0",
|
|
43
|
-
"ts-pattern": "^
|
|
44
|
-
"urql": "^4.0.
|
|
43
|
+
"ts-pattern": "^5.0.1",
|
|
44
|
+
"urql": "^4.0.4",
|
|
45
45
|
"uuid": "^9.0.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@types/react": "^18.2.
|
|
49
|
-
"@types/react-dom": "^18.2.
|
|
48
|
+
"@types/react": "^18.2.12",
|
|
49
|
+
"@types/react-dom": "^18.2.5",
|
|
50
50
|
"@types/react-native": "^0.72.2",
|
|
51
|
-
"@types/uuid": "^9.0.
|
|
51
|
+
"@types/uuid": "^9.0.2",
|
|
52
52
|
"jsdom": "^22.1.0",
|
|
53
|
-
"type-fest": "^3.
|
|
53
|
+
"type-fest": "^3.12.0"
|
|
54
54
|
}
|
|
55
55
|
}
|
|
Binary file
|
package/src/assets/main.css
CHANGED
|
@@ -323,6 +323,7 @@ body {
|
|
|
323
323
|
sans-serif;
|
|
324
324
|
--font-family-card-font: "Inter Card", monospace;
|
|
325
325
|
--font-family-code: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
|
|
326
|
+
--font-family-iban: "Roboto Mono", monospace;
|
|
326
327
|
|
|
327
328
|
--heading-color: var(--color-gray-900);
|
|
328
329
|
--heading-line-height: 1.25;
|
|
@@ -209,8 +209,8 @@ const SHOULD_OPEN = new Set(["Open", "ForcedOpen", "OpenFromFocus"]);
|
|
|
209
209
|
const SHOULD_LOCK_FOCUS = new Set(["ForcedOpen"]);
|
|
210
210
|
const BreadcrumbsDropdownItems = ({ crumbs }) => {
|
|
211
211
|
const [openingStatus, dispatch] = useReducer((state, action) => {
|
|
212
|
-
|
|
213
|
-
|
|
212
|
+
return match([action, state])
|
|
213
|
+
.returnType()
|
|
214
214
|
.with(["ForceToggle", "Closed"], ["ForceToggle", "Open"], ["ForceToggle", "ForcedClosed"], () => "ForcedOpen")
|
|
215
215
|
.with(["ForceToggle", "OpenFromFocus"], ["ForceToggle", "ForcedOpen"], () => "ForcedClosed")
|
|
216
216
|
.with(["ForceClose", P._], () => "ForcedClosed")
|
|
@@ -94,6 +94,7 @@ export const SimpleHeaderCell = ({ text, sort, justifyContent = "flex-start", on
|
|
|
94
94
|
const sortActive = isNotNullish(sort) && isNotNullish(onPress);
|
|
95
95
|
return (_jsx(Pressable, { onPress: () => {
|
|
96
96
|
onPress?.(match(sort)
|
|
97
|
+
.returnType()
|
|
97
98
|
.with("Desc", () => "Asc")
|
|
98
99
|
.with("Asc", () => "Desc")
|
|
99
100
|
.otherwise(() => "Desc"));
|
|
@@ -41,6 +41,7 @@ export const LakeLabel = ({ label, optionalLabel, extra, readOnly = false, color
|
|
|
41
41
|
}
|
|
42
42
|
}, [id]);
|
|
43
43
|
return (_jsxs(Box, { style: [styles.container, style], direction: "row", alignItems: "center", justifyContent: "spaceBetween", children: [_jsxs(View, { style: commonStyles.fill, ref: containerRef, children: [_jsxs(Box, { direction: "row", justifyContent: "spaceBetween", alignItems: "center", children: [_jsxs(Box, { direction: "row", style: styles.shrink, children: [type === "form" || type === "formSmall" || type === "radioGroup" ? (_jsxs(Label, { onClick: onClick, htmlFor: id, style: [styles.label, readOnly && { color: readOnlyColor }], children: [label, optionalLabel != null ? (_jsxs(_Fragment, { children: [" - ", _jsx(LakeText, { color: colors.gray[400], style: styles.optionalLabel, children: optionalLabel })] })) : null] })) : (_jsxs(LakeText, { variant: "medium", color: readOnlyColor, id: id, children: [label, optionalLabel != null ? (_jsxs(_Fragment, { children: [" - ", _jsx(LakeText, { color: colors.gray[400], style: styles.optionalLabel, children: optionalLabel })] })) : null] })), isNotNullish(extra) && extra()] }), isNotNullish(help) && (_jsxs(_Fragment, { children: [_jsx(Space, { width: 16 }), help] }))] }), _jsx(Space, { height: match(type)
|
|
44
|
+
.returnType()
|
|
44
45
|
.with("formSmall", "viewSmall", () => 4)
|
|
45
46
|
.with("form", "view", () => 8)
|
|
46
47
|
.with("radioGroup", () => 12)
|
|
@@ -132,7 +132,7 @@ export declare const PressableText: FC<{
|
|
|
132
132
|
"aria-rowspan"?: number | undefined;
|
|
133
133
|
"aria-setsize"?: number | undefined;
|
|
134
134
|
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
135
|
-
children?: string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> |
|
|
135
|
+
children?: string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | import("react").ReactPortal | ((state: PressableStateCallbackType) => ReactNode) | null | undefined;
|
|
136
136
|
delayLongPress?: number | undefined;
|
|
137
137
|
delayPressIn?: number | undefined;
|
|
138
138
|
delayPressOut?: number | undefined;
|
|
@@ -22,7 +22,6 @@ const styles = StyleSheet.create({
|
|
|
22
22
|
container: {
|
|
23
23
|
borderBottomWidth: 1,
|
|
24
24
|
borderBottomColor: colors.gray[100],
|
|
25
|
-
backgroundColor: backgroundColor.default,
|
|
26
25
|
zIndex: 10,
|
|
27
26
|
},
|
|
28
27
|
link: {
|
|
@@ -117,6 +116,7 @@ const styles = StyleSheet.create({
|
|
|
117
116
|
backgroundColor: colors.gray[100],
|
|
118
117
|
},
|
|
119
118
|
sticky: {
|
|
119
|
+
backgroundColor: backgroundColor.default,
|
|
120
120
|
position: "sticky",
|
|
121
121
|
top: -1,
|
|
122
122
|
},
|
|
@@ -140,8 +140,8 @@ const SHOULD_OPEN = new Set(["Open", "ForcedOpen", "OpenFromFocus"]);
|
|
|
140
140
|
const SHOULD_LOCK_FOCUS = new Set(["ForcedOpen"]);
|
|
141
141
|
const DropdownItems = forwardRef(({ tabs, otherLabel, currentUrl }, ref) => {
|
|
142
142
|
const [openingStatus, dispatch] = useReducer((state, action) => {
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
return match([action, state])
|
|
144
|
+
.returnType()
|
|
145
145
|
.with(["ForceToggle", "Closed"], ["ForceToggle", "Open"], ["ForceToggle", "ForcedClosed"], () => "ForcedOpen")
|
|
146
146
|
.with(["ForceToggle", "OpenFromFocus"], ["ForceToggle", "ForcedOpen"], () => "ForcedClosed")
|
|
147
147
|
.with(["ForceClose", P.any], () => "ForcedClosed")
|
|
@@ -56,6 +56,7 @@ const styles = StyleSheet.create({
|
|
|
56
56
|
const Toast = memo(({ variant, uid, title, description, progress, onClose }) => {
|
|
57
57
|
const progressBarRef = useRef(null);
|
|
58
58
|
const colorVariation = match(variant)
|
|
59
|
+
.returnType()
|
|
59
60
|
.with("success", () => "positive")
|
|
60
61
|
.with("error", () => "negative")
|
|
61
62
|
.with("info", () => "shakespear")
|
package/src/constants/design.js
CHANGED
|
@@ -432,6 +432,7 @@ export const fonts = {
|
|
|
432
432
|
primary: "var(--font-family-primary)",
|
|
433
433
|
card: "var( --font-family-card-font)",
|
|
434
434
|
code: "var(--font-family-code)",
|
|
435
|
+
iban: "var(--font-family-iban)",
|
|
435
436
|
};
|
|
436
437
|
const easeInOutQuad = "cubic-bezier(0.45, 0, 0.55, 1)";
|
|
437
438
|
const fadeAndSlideInFromTop = StyleSheet.create({
|
package/src/utils/file.js
CHANGED
|
@@ -2,6 +2,7 @@ import { match } from "ts-pattern";
|
|
|
2
2
|
export const getIconNameFromFilename = (filename) => {
|
|
3
3
|
const ext = filename.split(".").pop()?.toLowerCase();
|
|
4
4
|
return match(ext)
|
|
5
|
+
.returnType()
|
|
5
6
|
.with("png", () => "lake-document-png")
|
|
6
7
|
.with("xls", () => "lake-document-xls")
|
|
7
8
|
.with("pdf", () => "lake-document-pdf")
|