@swan-io/shared-business 15.5.2 → 15.5.3
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/shared-business",
|
|
3
|
-
"version": "15.5.
|
|
3
|
+
"version": "15.5.3",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">22.12.0"
|
|
6
6
|
},
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"react": ">=19.0.0",
|
|
29
29
|
"react-dom": ">=19.0.0",
|
|
30
30
|
"react-native-web": ">=0.21.2",
|
|
31
|
-
"@swan-io/lake": "15.5.
|
|
31
|
+
"@swan-io/lake": "15.5.3"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@formatjs/intl": "^4.1.16",
|
|
@@ -53,6 +53,6 @@
|
|
|
53
53
|
"react-dom": "^19.2.7",
|
|
54
54
|
"react-native-web": "^0.21.2",
|
|
55
55
|
"type-fest": "^5.8.0",
|
|
56
|
-
"@swan-io/lake": "15.5.
|
|
56
|
+
"@swan-io/lake": "15.5.3"
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -14,7 +14,7 @@ import { Pressable } from "@swan-io/lake/src/components/Pressable";
|
|
|
14
14
|
import { Separator } from "@swan-io/lake/src/components/Separator";
|
|
15
15
|
import { Space } from "@swan-io/lake/src/components/Space";
|
|
16
16
|
import { colors, spacings } from "@swan-io/lake/src/constants/design";
|
|
17
|
-
import {
|
|
17
|
+
import { useBoolean } from "@swan-io/lake/src/hooks/useBoolean";
|
|
18
18
|
import { useFirstMountState } from "@swan-io/lake/src/hooks/useFirstMountState";
|
|
19
19
|
import { useResponsive } from "@swan-io/lake/src/hooks/useResponsive";
|
|
20
20
|
import { noop } from "@swan-io/lake/src/utils/function";
|
|
@@ -477,7 +477,7 @@ const DatePickerPopoverContent = ({ value, format, firstWeekDay, desktop, isSele
|
|
|
477
477
|
export const DatePicker = ({ label, value, error, format, firstWeekDay, isSelectable, onChange, }) => {
|
|
478
478
|
const { desktop } = useResponsive(DATE_PICKER_MOBILE_THRESHOLD);
|
|
479
479
|
const ref = useRef(null);
|
|
480
|
-
const [isOpened, { open, close }] =
|
|
480
|
+
const [isOpened, { on: open, off: close }] = useBoolean(false);
|
|
481
481
|
const popoverId = useId();
|
|
482
482
|
return (_jsxs(_Fragment, { children: [_jsx(Box, { direction: "row", alignItems: "end", children: _jsx(LakeLabel, { label: label, style: styles.label, actions: _jsx(LakeButton, { mode: "secondary", icon: "calendar-ltr-regular", size: "small", onPress: open, ariaLabel: t("common.open"), ariaExpanded: isOpened }), render: id => (_jsx(Rifm, { value: value !== null && value !== void 0 ? value : "", onChange: onChange, ...rifmDateProps, children: ({ value, onChange }) => (_jsx(LakeTextInput, { ref: ref, id: id, placeholder: format, value: value, error: error, onChange: onChange })) })) }) }), _jsx(Popover, { id: popoverId, role: "dialog", onDismiss: close, referenceRef: ref, visible: isOpened, children: _jsx(View, { style: desktop ? styles.popoverDesktop : styles.popover, children: _jsx(DatePickerPopoverContent, { value: value, format: format, firstWeekDay: firstWeekDay, desktop: desktop, isSelectable: isSelectable, onChange: onChange }) }) })] }));
|
|
483
483
|
};
|
|
@@ -614,7 +614,7 @@ export const DateRangePicker = ({ value, error, format, startLabel, endLabel, fi
|
|
|
614
614
|
const { desktop } = useResponsive(DATE_PICKER_MOBILE_THRESHOLD);
|
|
615
615
|
const { desktop: displayTwoCalendar } = useResponsive(DATE_RANGE_PICKER_THRESHOLD);
|
|
616
616
|
const ref = useRef(null);
|
|
617
|
-
const [isOpened, { open, close }] =
|
|
617
|
+
const [isOpened, { on: open, off: close }] = useBoolean(false);
|
|
618
618
|
const handleStartChange = useCallback((start) => {
|
|
619
619
|
onChange({ start, end: value.end });
|
|
620
620
|
}, [value, onChange]);
|
|
@@ -8,8 +8,8 @@ import { Pressable } from "@swan-io/lake/src/components/Pressable";
|
|
|
8
8
|
import { Separator } from "@swan-io/lake/src/components/Separator";
|
|
9
9
|
import { Space } from "@swan-io/lake/src/components/Space";
|
|
10
10
|
import { colors, radii, spacings, texts } from "@swan-io/lake/src/constants/design";
|
|
11
|
+
import { useBoolean } from "@swan-io/lake/src/hooks/useBoolean";
|
|
11
12
|
import { useDebounce } from "@swan-io/lake/src/hooks/useDebounce";
|
|
12
|
-
import { useDisclosure } from "@swan-io/lake/src/hooks/useDisclosure";
|
|
13
13
|
import { isNotNullish, isNotNullishOrEmpty } from "@swan-io/lake/src/utils/nullish";
|
|
14
14
|
import { deburr } from "@swan-io/lake/src/utils/string";
|
|
15
15
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -65,7 +65,7 @@ const styles = StyleSheet.create({
|
|
|
65
65
|
export const PhoneCountryPicker = ({ value, onValueChange, countries, style, disabled = false, readOnly = false, error, ariaLabel = "Select country", }) => {
|
|
66
66
|
const referenceRef = useRef(null);
|
|
67
67
|
const inputRef = useRef(null);
|
|
68
|
-
const [visible, { open, close }] =
|
|
68
|
+
const [visible, { on: open, off: close }] = useBoolean(false);
|
|
69
69
|
const allowedCountries = useMemo(() => countries
|
|
70
70
|
.filter((cca3, index, array) => array.indexOf(cca3) === index)
|
|
71
71
|
.map(cca3 => getCountryByCCA3(cca3)), [countries]);
|