@swan-io/lake 2.2.0 → 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 +2 -2
- package/src/components/ToastStack.js +1 -0
- package/src/constants/design.d.ts +1 -3
- package/src/constants/design.js +1 -17
- package/src/utils/file.js +1 -0
- package/src/assets/fonts/Ayuthaya.css +0 -4
- package/src/assets/fonts/Ayuthaya.ttf +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swan-io/lake",
|
|
3
|
-
"version": "2.2.
|
|
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;
|
|
@@ -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")
|
|
@@ -59,9 +59,6 @@ export declare const interFontStyle: {
|
|
|
59
59
|
fontFamily: string;
|
|
60
60
|
letterSpacing: number;
|
|
61
61
|
};
|
|
62
|
-
export declare const ayuthayaFontStyle: {
|
|
63
|
-
fontFamily: string;
|
|
64
|
-
};
|
|
65
62
|
export declare const texts: {
|
|
66
63
|
readonly h1: TextStyle;
|
|
67
64
|
readonly h2: TextStyle;
|
|
@@ -123,6 +120,7 @@ export declare const fonts: {
|
|
|
123
120
|
primary: string;
|
|
124
121
|
card: string;
|
|
125
122
|
code: string;
|
|
123
|
+
iban: string;
|
|
126
124
|
};
|
|
127
125
|
export type Fonts = keyof typeof fonts;
|
|
128
126
|
export type Animation = {
|
package/src/constants/design.js
CHANGED
|
@@ -265,23 +265,6 @@ export const interFontStyle = {
|
|
|
265
265
|
// Computed by Inter dynamic metrics tool
|
|
266
266
|
letterSpacing: "-0.011em",
|
|
267
267
|
};
|
|
268
|
-
export const ayuthayaFontStyle = {
|
|
269
|
-
fontFamily: [
|
|
270
|
-
"Ayuthaya",
|
|
271
|
-
"Inter",
|
|
272
|
-
"-apple-system",
|
|
273
|
-
"system-ui",
|
|
274
|
-
"BlinkMacSystemFont",
|
|
275
|
-
"Segoe UI",
|
|
276
|
-
"Helvetica",
|
|
277
|
-
"Arial",
|
|
278
|
-
"sans-serif",
|
|
279
|
-
"Apple Color Emoji",
|
|
280
|
-
"Segoe UI Emoji",
|
|
281
|
-
"Segoe UI Symbol",
|
|
282
|
-
"Noto Color Emoji",
|
|
283
|
-
].join(","),
|
|
284
|
-
};
|
|
285
268
|
const asTextStyle = (x) => {
|
|
286
269
|
return x;
|
|
287
270
|
};
|
|
@@ -449,6 +432,7 @@ export const fonts = {
|
|
|
449
432
|
primary: "var(--font-family-primary)",
|
|
450
433
|
card: "var( --font-family-card-font)",
|
|
451
434
|
code: "var(--font-family-code)",
|
|
435
|
+
iban: "var(--font-family-iban)",
|
|
452
436
|
};
|
|
453
437
|
const easeInOutQuad = "cubic-bezier(0.45, 0, 0.55, 1)";
|
|
454
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")
|
|
Binary file
|