@swan-io/lake 1.4.4 → 1.5.0
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 +4 -5
- package/src/components/AppOpeningAnimation.js +13 -13
- package/src/components/AutoWidthImage.d.ts +1 -0
- package/src/components/AutoWidthImage.js +3 -4
- package/src/components/Avatar.js +3 -2
- package/src/components/BorderedButton.d.ts +1 -1
- package/src/components/BorderedButton.js +6 -4
- package/src/components/BottomPanel.js +2 -2
- package/src/components/Box.js +1 -1
- package/src/components/Breadcrumbs.js +7 -7
- package/src/components/ChoicePicker.js +6 -6
- package/src/components/Fill.js +2 -1
- package/src/components/FilterChooser.js +2 -2
- package/src/components/Filters.js +9 -9
- package/src/components/FixedListView.js +15 -12
- package/src/components/FixedListViewCells.js +2 -2
- package/src/components/Form.d.ts +1 -1
- package/src/components/FullViewportLayer.js +10 -7
- package/src/components/Heading.d.ts +1 -1
- package/src/components/Heading.js +1 -1
- package/src/components/Icon.d.ts +2 -4
- package/src/components/Icon.js +7 -1
- package/src/components/Input.d.ts +6 -6
- package/src/components/Input.js +5 -10
- package/src/components/Label.d.ts +1 -1
- package/src/components/Label.js +1 -1
- package/src/components/LakeButton.d.ts +3 -3
- package/src/components/LakeButton.js +4 -4
- package/src/components/LakeCheckbox.js +2 -2
- package/src/components/LakeCombobox.d.ts +2 -2
- package/src/components/LakeCombobox.js +6 -10
- package/src/components/LakeDownloadButton.js +1 -1
- package/src/components/LakeHeading.d.ts +3 -2
- package/src/components/LakeHeading.js +7 -1
- package/src/components/LakeLabel.d.ts +0 -1
- package/src/components/LakeLabel.js +3 -3
- package/src/components/LakeModal.js +6 -3
- package/src/components/LakeRadio.js +3 -3
- package/src/components/LakeScrollView.js +2 -1
- package/src/components/LakeSearchField.js +3 -3
- package/src/components/LakeSelect.d.ts +2 -2
- package/src/components/LakeSelect.js +14 -23
- package/src/components/LakeSlider.js +1 -1
- package/src/components/LakeStepper.js +4 -4
- package/src/components/LakeText.d.ts +9 -8
- package/src/components/LakeText.js +7 -1
- package/src/components/LakeTextInput.d.ts +10 -5
- package/src/components/LakeTextInput.js +4 -4
- package/src/components/LakeTooltip.js +7 -12
- package/src/components/Link.d.ts +52 -49
- package/src/components/Link.js +2 -2
- package/src/components/ListRightPanel.js +2 -2
- package/src/components/Modal.js +15 -5
- package/src/components/MultiSelect.d.ts +1 -1
- package/src/components/MultiSelect.js +9 -6
- package/src/components/PlainListView.js +4 -3
- package/src/components/Popover.js +9 -5
- package/src/components/Portal.js +2 -2
- package/src/components/Pressable.d.ts +112 -101
- package/src/components/Pressable.js +16 -6
- package/src/components/RightPanel.js +10 -7
- package/src/components/Separator.js +1 -1
- package/src/components/SidebarNavigationTracker.js +4 -3
- package/src/components/Slider.js +28 -12
- package/src/components/SmsOpeningAnimation.js +15 -15
- package/src/components/Stack.d.ts +4 -4
- package/src/components/Stack.js +1 -1
- package/src/components/Stepper.js +1 -1
- package/src/components/Svg.d.ts +6 -7
- package/src/components/Switch.js +18 -6
- package/src/components/TabView.js +8 -7
- package/src/components/Tag.d.ts +2 -2
- package/src/components/Tag.js +6 -3
- package/src/components/Tile.js +2 -2
- package/src/components/ToastStack.js +16 -7
- package/src/components/Tooltip.js +3 -6
- package/src/components/TransitionGroupView.d.ts +2 -3
- package/src/components/TransitionGroupView.js +2 -2
- package/src/components/TransitionView.d.ts +2 -3
- package/src/components/TransitionView.js +2 -2
- package/src/components/WithCurrentColor.d.ts +1 -1
- package/src/constants/design.d.ts +4 -12
- package/src/constants/design.js +12 -12
- package/src/hooks/useAnimatedValue.js +9 -2
- package/src/hooks/useForceableState.js +1 -1
- package/src/hooks/useHover.js +1 -1
- package/src/hooks/useMergeRefs.js +1 -1
- package/src/hooks/usePressEvents.js +1 -1
- package/src/components/Alert.d.ts +0 -10
- package/src/components/Alert.js +0 -36
- package/src/components/Button.d.ts +0 -15
- package/src/components/Button.js +0 -83
- package/src/components/Checkbox.d.ts +0 -12
- package/src/components/Checkbox.js +0 -83
- package/src/components/Combobox.d.ts +0 -29
- package/src/components/Combobox.js +0 -182
- package/src/components/MultilineInput.d.ts +0 -15
- package/src/components/MultilineInput.js +0 -55
- package/src/components/Picker.d.ts +0 -26
- package/src/components/Picker.js +0 -116
- package/src/components/ProgressBar.d.ts +0 -11
- package/src/components/ProgressBar.js +0 -46
- package/src/components/SegmentedControl.d.ts +0 -19
- package/src/components/SegmentedControl.js +0 -74
- package/src/components/Table.d.ts +0 -34
- package/src/components/Table.js +0 -79
- package/src/hooks/useLazyRef.d.ts +0 -2
- package/src/hooks/useLazyRef.js +0 -9
|
@@ -75,6 +75,7 @@ const styles = StyleSheet.create({
|
|
|
75
75
|
backgroundColor: backgroundColor.default,
|
|
76
76
|
},
|
|
77
77
|
scrollTracker: {
|
|
78
|
+
pointerEvents: "none",
|
|
78
79
|
position: "absolute",
|
|
79
80
|
left: 0,
|
|
80
81
|
bottom: 0,
|
|
@@ -102,7 +103,7 @@ const Row = ({ id, item, index, rowHeight, columns, extraInfo, isActive, isHover
|
|
|
102
103
|
width: typeof width === "number" ? width : ONE,
|
|
103
104
|
flexGrow: width === "grow" ? ONE : ZERO,
|
|
104
105
|
},
|
|
105
|
-
],
|
|
106
|
+
], id: columnId, children: renderCell({ columnId, item, index, extraInfo, isHovered }) }, columnId))) }));
|
|
106
107
|
};
|
|
107
108
|
export const PlainListView = ({ data: originalData, keyExtractor, rowHeight, groupHeaderHeight, headerHeight, columns, smallColumns = columns, extraInfo, onEndReached, onEndReachedThresholdPx = 200, getRowLink, activeRowId, renderEmptyList, onActiveRowChange, groupBy, loading, breakpoint = breakpoints.large, withoutScroll = false, stickyOffset = 0, }) => {
|
|
108
109
|
const viewId = useId();
|
|
@@ -172,7 +173,7 @@ export const PlainListView = ({ data: originalData, keyExtractor, rowHeight, gro
|
|
|
172
173
|
flexGrow: width === "grow" ? ONE : ZERO,
|
|
173
174
|
height: headerHeight,
|
|
174
175
|
},
|
|
175
|
-
],
|
|
176
|
+
], id: columnId, children: renderTitle({ title, extraInfo, id }) }, columnId));
|
|
176
177
|
}) })) : null, cloneElement(listWrapper, {
|
|
177
178
|
children: (_jsxs(_Fragment, { children: [Array.from(groups.entries()).map(([groupName, items]) => {
|
|
178
179
|
return (_jsxs(Fragment, { children: [groupName != null ? (_jsx(View, { style: [
|
|
@@ -195,7 +196,7 @@ export const PlainListView = ({ data: originalData, keyExtractor, rowHeight, gro
|
|
|
195
196
|
children: (_jsx(Row, { id: key, rowHeight: rowHeight, columns: displayColumns, item: item, index: index, extraInfo: extraInfo, isActive: isActive, isHovered: isHovered, large: large, onMouseEnter: setHoveredRow, onMouseLeave: removeHoveredRow })),
|
|
196
197
|
});
|
|
197
198
|
})] }, groupName));
|
|
198
|
-
}), _jsx(View, { children: _jsx(View, {
|
|
199
|
+
}), _jsx(View, { children: _jsx(View, { "aria-busy": isLoading, style: styles.loadingPlaceholder, children: isLoading ? (_jsx(PlainListViewPlaceholder, { count: loading.count, rowHeight: rowHeight, rowVerticalSpacing: 0, paddingHorizontal: 0 })) : null }) }), isEmpty && isNotNullish(renderEmptyList) && !isLoading ? (_jsx(View, { style: styles.emptyListContainer, children: renderEmptyList() })) : null, _jsx(View, { style: [styles.scrollTracker, { height: onEndReachedThresholdPx }], ref: scrollTrackerRef })] })),
|
|
199
200
|
})] }));
|
|
200
201
|
} }));
|
|
201
202
|
};
|
|
@@ -11,6 +11,7 @@ import { TransitionView } from "./TransitionView";
|
|
|
11
11
|
const styles = StyleSheet.create({
|
|
12
12
|
container: {
|
|
13
13
|
...StyleSheet.absoluteFillObject,
|
|
14
|
+
pointerEvents: "none",
|
|
14
15
|
},
|
|
15
16
|
contents: {
|
|
16
17
|
...StyleSheet.absoluteFillObject,
|
|
@@ -19,6 +20,7 @@ const styles = StyleSheet.create({
|
|
|
19
20
|
cursor: "default",
|
|
20
21
|
},
|
|
21
22
|
underlay: {
|
|
23
|
+
pointerEvents: "auto",
|
|
22
24
|
cursor: "default",
|
|
23
25
|
position: "fixed",
|
|
24
26
|
left: 0,
|
|
@@ -27,6 +29,7 @@ const styles = StyleSheet.create({
|
|
|
27
29
|
right: 0,
|
|
28
30
|
},
|
|
29
31
|
popover: {
|
|
32
|
+
pointerEvents: "auto",
|
|
30
33
|
position: "absolute",
|
|
31
34
|
display: "flex",
|
|
32
35
|
flexDirection: "column",
|
|
@@ -56,9 +59,10 @@ const FLEX_END = "flex-end";
|
|
|
56
59
|
const FLEX_START = "flex-start";
|
|
57
60
|
const animation = {
|
|
58
61
|
...animations.fadeAndSlideInFromBottom,
|
|
59
|
-
leave:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
leave: [
|
|
63
|
+
animations.fadeAndSlideInFromBottom.leave,
|
|
64
|
+
{ animationDuration: "100ms" },
|
|
65
|
+
],
|
|
62
66
|
};
|
|
63
67
|
export const VIEWPORT_WIDTH_THRESHOLD = 600;
|
|
64
68
|
export const Popover = memo(({ children, id, label, role = "dialog", describedBy, matchReferenceWidth = false, matchReferenceMinWidth = false, onDismiss, referenceRef, returnFocus = true, autoFocus = true, visible, underlay = true, safetyMargin = 8, forcedMode, }) => {
|
|
@@ -129,7 +133,7 @@ export const Popover = memo(({ children, id, label, role = "dialog", describedBy
|
|
|
129
133
|
if (mode === "BottomPanel") {
|
|
130
134
|
return (_jsx(BottomPanel, { visible: visible, onPressClose: onDismiss, returnFocus: false, children: typeof children == "function" ? children({ mode: "panel" }) : children }));
|
|
131
135
|
}
|
|
132
|
-
return (_jsx(Portal, { container: rootElement, children: _jsx(TransitionView, {
|
|
136
|
+
return (_jsx(Portal, { container: rootElement, children: _jsx(TransitionView, { style: styles.container, ...animation, children: visible ? (_jsxs(View, { style: styles.contents, children: [underlay ? (_jsx(Pressable, { ref: underlayRef, style: styles.underlay, onPress: onPressUnderlay, role: "button", "aria-label": "Close" })) : null, availableHeight > 0 ? (_jsx(ScrollView, { style: [
|
|
133
137
|
styles.popover,
|
|
134
138
|
availableSpaceAbove <= availableSpaceBelow && { top },
|
|
135
139
|
availableSpaceAbove > availableSpaceBelow && { bottom },
|
|
@@ -143,5 +147,5 @@ export const Popover = memo(({ children, id, label, role = "dialog", describedBy
|
|
|
143
147
|
{
|
|
144
148
|
justifyContent: availableSpaceAbove > availableSpaceBelow ? FLEX_END : FLEX_START,
|
|
145
149
|
},
|
|
146
|
-
],
|
|
150
|
+
], id: id, role: role, "aria-describedby": describedBy, "aria-label": label, children: _jsx(FocusTrap, { focusLock: true, returnFocus: returnFocus, autoFocus: autoFocus, onEscapeKey: onDismiss, onClickOutside: underlay ? undefined : onClickOutside, children: _jsx(Pressable, { tabIndex: -1, onPress: onPress, style: styles.defaultCursor, children: typeof children == "function" ? children({ mode: "dropdown" }) : children }) }) })) : null] })) : null }) }));
|
|
147
151
|
});
|
package/src/components/Portal.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useContext, useRef } from "react";
|
|
2
|
-
import
|
|
2
|
+
import { createPortal } from "react-dom";
|
|
3
3
|
import { CurrentColorContext, useCurrentColor } from "./WithCurrentColor";
|
|
4
4
|
export const Portal = ({ children, container }) => {
|
|
5
5
|
const currentColor = useContext(CurrentColorContext);
|
|
6
6
|
const containerRef = useRef(container);
|
|
7
7
|
useCurrentColor(containerRef, currentColor);
|
|
8
|
-
return
|
|
8
|
+
return createPortal(children, container);
|
|
9
9
|
};
|
|
@@ -8,7 +8,6 @@ type Props<BaseProps extends TextProps | TextInputProps> = Merge<BaseProps, {
|
|
|
8
8
|
delayPressIn?: number;
|
|
9
9
|
delayPressOut?: number;
|
|
10
10
|
disabled?: boolean;
|
|
11
|
-
focusable?: boolean;
|
|
12
11
|
onBlur?: (event: NativeSyntheticEvent<React.FocusEvent>) => void;
|
|
13
12
|
onContextMenu?: (event: NativeSyntheticEvent<React.SyntheticEvent>) => void;
|
|
14
13
|
onFocus?: (event: NativeSyntheticEvent<React.FocusEvent>) => void;
|
|
@@ -38,84 +37,87 @@ type ExtraProps = {
|
|
|
38
37
|
};
|
|
39
38
|
export type PressableViewProps = Except<Props<ViewProps>, "children">;
|
|
40
39
|
export type PressableTextProps = Props<TextProps>;
|
|
41
|
-
export type PressableTextInputProps = Except<Props<TextInputProps>, "children">;
|
|
40
|
+
export type PressableTextInputProps = Except<Props<TextInputProps>, "children" | "editable" | "keyboardType" | "numberOfLines">;
|
|
42
41
|
export declare const Pressable: FC<PressableProps & ExtraProps & {
|
|
43
42
|
ref?: Ref<View> | undefined;
|
|
44
43
|
}>;
|
|
45
44
|
export declare const PressableText: FC<{
|
|
46
45
|
testID?: string | undefined;
|
|
46
|
+
id?: string | undefined;
|
|
47
|
+
role?: import("react-native").WebRole | undefined;
|
|
47
48
|
style?: false | import("react-native").TextStyle | import("react-native").RegisteredStyle<import("react-native").TextStyle> | import("react-native").RecursiveArray<import("react-native").TextStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<import("react-native").TextStyle>> | ((state: PressableStateCallbackType) => import("react-native").StyleProp<import("react-native").TextStyle>) | null | undefined;
|
|
49
|
+
tabIndex?: 0 | -1 | undefined;
|
|
48
50
|
children?: string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactFragment | import("react").ReactPortal | ((state: PressableStateCallbackType) => ReactNode) | null | undefined;
|
|
49
51
|
onLayout?: ((event: import("react-native").LayoutChangeEvent) => void) | undefined;
|
|
50
52
|
nativeID?: string | undefined;
|
|
51
|
-
accessibilityRole?: import("react-native").WebAccessibilityRole | undefined;
|
|
52
53
|
onKeyDown?: ((event: NativeSyntheticEvent<React.KeyboardEvent>) => void) | undefined;
|
|
53
|
-
focusable?: boolean | undefined;
|
|
54
54
|
accessible?: boolean | undefined;
|
|
55
55
|
accessibilityActions?: readonly Readonly<{
|
|
56
56
|
name: string;
|
|
57
57
|
label?: string | undefined;
|
|
58
58
|
}>[] | undefined;
|
|
59
59
|
accessibilityLabel?: string | undefined;
|
|
60
|
+
"aria-label"?: string | undefined;
|
|
61
|
+
accessibilityRole?: import("react-native").AccessibilityRole | undefined;
|
|
60
62
|
accessibilityState?: import("react-native").AccessibilityState | undefined;
|
|
63
|
+
"aria-busy"?: boolean | undefined;
|
|
64
|
+
"aria-checked"?: boolean | "mixed" | undefined;
|
|
65
|
+
"aria-disabled"?: boolean | undefined;
|
|
66
|
+
"aria-expanded"?: boolean | undefined;
|
|
67
|
+
"aria-selected"?: boolean | undefined;
|
|
68
|
+
"aria-labelledby"?: string | undefined;
|
|
61
69
|
accessibilityHint?: string | undefined;
|
|
62
70
|
accessibilityValue?: import("react-native").AccessibilityValue | undefined;
|
|
71
|
+
"aria-valuemax"?: number | undefined;
|
|
72
|
+
"aria-valuemin"?: number | undefined;
|
|
73
|
+
"aria-valuenow"?: number | undefined;
|
|
74
|
+
"aria-valuetext"?: string | undefined;
|
|
63
75
|
onAccessibilityAction?: ((event: import("react-native").AccessibilityActionEvent) => void) | undefined;
|
|
64
|
-
accessibilityLabelledBy?: string | string[] | undefined;
|
|
65
|
-
accessibilityLiveRegion?: "none" | "polite" | "assertive" | undefined;
|
|
66
76
|
importantForAccessibility?: "auto" | "yes" | "no" | "no-hide-descendants" | undefined;
|
|
77
|
+
"aria-hidden"?: boolean | undefined;
|
|
78
|
+
"aria-live"?: "polite" | "assertive" | "off" | undefined;
|
|
79
|
+
"aria-modal"?: boolean | undefined;
|
|
80
|
+
accessibilityLiveRegion?: "none" | "polite" | "assertive" | undefined;
|
|
67
81
|
accessibilityElementsHidden?: boolean | undefined;
|
|
68
|
-
accessibilityLanguage?: string | undefined;
|
|
69
82
|
accessibilityViewIsModal?: boolean | undefined;
|
|
70
83
|
onAccessibilityEscape?: (() => void) | undefined;
|
|
71
84
|
onAccessibilityTap?: (() => void) | undefined;
|
|
72
85
|
onMagicTap?: (() => void) | undefined;
|
|
73
86
|
accessibilityIgnoresInvertColors?: boolean | undefined;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
accessibilityRoleDescription?: string | undefined;
|
|
106
|
-
accessibilityRowCount?: number | undefined;
|
|
107
|
-
accessibilityRowIndex?: number | undefined;
|
|
108
|
-
accessibilityRowSpan?: number | undefined;
|
|
109
|
-
accessibilitySelected?: boolean | undefined;
|
|
110
|
-
accessibilitySetSize?: number | undefined;
|
|
111
|
-
accessibilitySort?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
112
|
-
accessibilityValueMax?: number | undefined;
|
|
113
|
-
accessibilityValueMin?: number | undefined;
|
|
114
|
-
accessibilityValueNow?: number | undefined;
|
|
115
|
-
accessibilityValueText?: string | undefined;
|
|
87
|
+
"aria-activedescendant"?: string | undefined;
|
|
88
|
+
"aria-atomic"?: boolean | undefined;
|
|
89
|
+
"aria-autocomplete"?: string | undefined;
|
|
90
|
+
"aria-colcount"?: number | undefined;
|
|
91
|
+
"aria-colindex"?: number | undefined;
|
|
92
|
+
"aria-colspan"?: number | undefined;
|
|
93
|
+
"aria-controls"?: string | undefined;
|
|
94
|
+
"aria-current"?: boolean | "time" | "page" | "step" | "location" | "date" | undefined;
|
|
95
|
+
"aria-describedby"?: string | undefined;
|
|
96
|
+
"aria-details"?: string | undefined;
|
|
97
|
+
"aria-errormessage"?: string | undefined;
|
|
98
|
+
"aria-flowto"?: string | undefined;
|
|
99
|
+
"aria-haspopup"?: string | undefined;
|
|
100
|
+
"aria-invalid"?: boolean | undefined;
|
|
101
|
+
"aria-keyshortcuts"?: string | undefined;
|
|
102
|
+
"aria-level"?: number | undefined;
|
|
103
|
+
"aria-multiline"?: boolean | undefined;
|
|
104
|
+
"aria-multiselectable"?: boolean | undefined;
|
|
105
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
106
|
+
"aria-owns"?: string | undefined;
|
|
107
|
+
"aria-placeholder"?: string | undefined;
|
|
108
|
+
"aria-posinset"?: number | undefined;
|
|
109
|
+
"aria-pressed"?: boolean | undefined;
|
|
110
|
+
"aria-readonly"?: boolean | undefined;
|
|
111
|
+
"aria-required"?: boolean | undefined;
|
|
112
|
+
"aria-roledescription"?: string | undefined;
|
|
113
|
+
"aria-rowcount"?: number | undefined;
|
|
114
|
+
"aria-rowindex"?: number | undefined;
|
|
115
|
+
"aria-rowspan"?: number | undefined;
|
|
116
|
+
"aria-setsize"?: number | undefined;
|
|
117
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
116
118
|
allowFontScaling?: boolean | undefined;
|
|
117
|
-
ellipsizeMode?: "clip" | "
|
|
118
|
-
lineBreakMode?: "clip" | "
|
|
119
|
+
ellipsizeMode?: "clip" | "middle" | "head" | "tail" | undefined;
|
|
120
|
+
lineBreakMode?: "clip" | "middle" | "head" | "tail" | undefined;
|
|
119
121
|
numberOfLines?: number | undefined;
|
|
120
122
|
onTextLayout?: ((event: NativeSyntheticEvent<import("react-native").TextLayoutEventData>) => void) | undefined;
|
|
121
123
|
onPress?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
|
|
@@ -152,15 +154,18 @@ export declare const PressableText: FC<{
|
|
|
152
154
|
export declare const PressableTextInput: FC<Except<{
|
|
153
155
|
textAlign?: "left" | "right" | "center" | undefined;
|
|
154
156
|
testID?: string | undefined;
|
|
155
|
-
|
|
157
|
+
pointerEvents?: "auto" | "none" | "box-none" | "box-only" | undefined;
|
|
158
|
+
textAlignVertical?: "bottom" | "top" | "auto" | "center" | undefined;
|
|
159
|
+
verticalAlign?: "bottom" | "top" | "auto" | "middle" | undefined;
|
|
160
|
+
id?: string | undefined;
|
|
161
|
+
role?: import("react-native").WebRole | undefined;
|
|
156
162
|
style?: false | import("react-native").TextStyle | import("react-native").RegisteredStyle<import("react-native").TextStyle> | import("react-native").RecursiveArray<import("react-native").TextStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<import("react-native").TextStyle>> | ((state: PressableStateCallbackType) => import("react-native").StyleProp<import("react-native").TextStyle>) | null | undefined;
|
|
163
|
+
tabIndex?: 0 | -1 | undefined;
|
|
157
164
|
children?: string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactFragment | import("react").ReactPortal | ((state: PressableStateCallbackType) => ReactNode) | null | undefined;
|
|
158
165
|
hitSlop?: import("react-native").Insets | undefined;
|
|
159
166
|
onLayout?: ((event: import("react-native").LayoutChangeEvent) => void) | undefined;
|
|
160
|
-
pointerEvents?: "none" | "auto" | "box-none" | "box-only" | undefined;
|
|
161
167
|
removeClippedSubviews?: boolean | undefined;
|
|
162
168
|
nativeID?: string | undefined;
|
|
163
|
-
accessibilityRole?: import("react-native").WebAccessibilityRole | undefined;
|
|
164
169
|
onKeyDown?: ((event: NativeSyntheticEvent<React.KeyboardEvent>) => void) | undefined;
|
|
165
170
|
onKeyDownCapture?: ((event: NativeSyntheticEvent<import("react").KeyboardEvent<Element>>) => void) | undefined;
|
|
166
171
|
onKeyUp?: ((event: NativeSyntheticEvent<import("react").KeyboardEvent<Element>>) => void) | undefined;
|
|
@@ -212,62 +217,64 @@ export declare const PressableTextInput: FC<Except<{
|
|
|
212
217
|
label?: string | undefined;
|
|
213
218
|
}>[] | undefined;
|
|
214
219
|
accessibilityLabel?: string | undefined;
|
|
220
|
+
"aria-label"?: string | undefined;
|
|
221
|
+
accessibilityRole?: import("react-native").AccessibilityRole | undefined;
|
|
215
222
|
accessibilityState?: import("react-native").AccessibilityState | undefined;
|
|
223
|
+
"aria-busy"?: boolean | undefined;
|
|
224
|
+
"aria-checked"?: boolean | "mixed" | undefined;
|
|
225
|
+
"aria-disabled"?: boolean | undefined;
|
|
226
|
+
"aria-expanded"?: boolean | undefined;
|
|
227
|
+
"aria-selected"?: boolean | undefined;
|
|
228
|
+
"aria-labelledby"?: string | undefined;
|
|
216
229
|
accessibilityHint?: string | undefined;
|
|
217
230
|
accessibilityValue?: import("react-native").AccessibilityValue | undefined;
|
|
231
|
+
"aria-valuemax"?: number | undefined;
|
|
232
|
+
"aria-valuemin"?: number | undefined;
|
|
233
|
+
"aria-valuenow"?: number | undefined;
|
|
234
|
+
"aria-valuetext"?: string | undefined;
|
|
218
235
|
onAccessibilityAction?: ((event: import("react-native").AccessibilityActionEvent) => void) | undefined;
|
|
219
|
-
accessibilityLabelledBy?: string | string[] | undefined;
|
|
220
|
-
accessibilityLiveRegion?: "none" | "polite" | "assertive" | undefined;
|
|
221
236
|
importantForAccessibility?: "auto" | "yes" | "no" | "no-hide-descendants" | undefined;
|
|
237
|
+
"aria-hidden"?: boolean | undefined;
|
|
238
|
+
"aria-live"?: "polite" | "assertive" | "off" | undefined;
|
|
239
|
+
"aria-modal"?: boolean | undefined;
|
|
240
|
+
accessibilityLiveRegion?: "none" | "polite" | "assertive" | undefined;
|
|
222
241
|
accessibilityElementsHidden?: boolean | undefined;
|
|
223
|
-
accessibilityLanguage?: string | undefined;
|
|
224
242
|
accessibilityViewIsModal?: boolean | undefined;
|
|
225
243
|
onAccessibilityEscape?: (() => void) | undefined;
|
|
226
244
|
onAccessibilityTap?: (() => void) | undefined;
|
|
227
245
|
onMagicTap?: (() => void) | undefined;
|
|
228
246
|
accessibilityIgnoresInvertColors?: boolean | undefined;
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
accessibilityRoleDescription?: string | undefined;
|
|
261
|
-
accessibilityRowCount?: number | undefined;
|
|
262
|
-
accessibilityRowIndex?: number | undefined;
|
|
263
|
-
accessibilityRowSpan?: number | undefined;
|
|
264
|
-
accessibilitySelected?: boolean | undefined;
|
|
265
|
-
accessibilitySetSize?: number | undefined;
|
|
266
|
-
accessibilitySort?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
267
|
-
accessibilityValueMax?: number | undefined;
|
|
268
|
-
accessibilityValueMin?: number | undefined;
|
|
269
|
-
accessibilityValueNow?: number | undefined;
|
|
270
|
-
accessibilityValueText?: string | undefined;
|
|
247
|
+
"aria-activedescendant"?: string | undefined;
|
|
248
|
+
"aria-atomic"?: boolean | undefined;
|
|
249
|
+
"aria-autocomplete"?: string | undefined;
|
|
250
|
+
"aria-colcount"?: number | undefined;
|
|
251
|
+
"aria-colindex"?: number | undefined;
|
|
252
|
+
"aria-colspan"?: number | undefined;
|
|
253
|
+
"aria-controls"?: string | undefined;
|
|
254
|
+
"aria-current"?: boolean | "time" | "page" | "step" | "location" | "date" | undefined;
|
|
255
|
+
"aria-describedby"?: string | undefined;
|
|
256
|
+
"aria-details"?: string | undefined;
|
|
257
|
+
"aria-errormessage"?: string | undefined;
|
|
258
|
+
"aria-flowto"?: string | undefined;
|
|
259
|
+
"aria-haspopup"?: string | undefined;
|
|
260
|
+
"aria-invalid"?: boolean | undefined;
|
|
261
|
+
"aria-keyshortcuts"?: string | undefined;
|
|
262
|
+
"aria-level"?: number | undefined;
|
|
263
|
+
"aria-multiline"?: boolean | undefined;
|
|
264
|
+
"aria-multiselectable"?: boolean | undefined;
|
|
265
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
266
|
+
"aria-owns"?: string | undefined;
|
|
267
|
+
"aria-placeholder"?: string | undefined;
|
|
268
|
+
"aria-posinset"?: number | undefined;
|
|
269
|
+
"aria-pressed"?: boolean | undefined;
|
|
270
|
+
"aria-readonly"?: boolean | undefined;
|
|
271
|
+
"aria-required"?: boolean | undefined;
|
|
272
|
+
"aria-roledescription"?: string | undefined;
|
|
273
|
+
"aria-rowcount"?: number | undefined;
|
|
274
|
+
"aria-rowindex"?: number | undefined;
|
|
275
|
+
"aria-rowspan"?: number | undefined;
|
|
276
|
+
"aria-setsize"?: number | undefined;
|
|
277
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
271
278
|
allowFontScaling?: boolean | undefined;
|
|
272
279
|
numberOfLines?: number | undefined;
|
|
273
280
|
onPress?: ((event: import("react-native").GestureResponderEvent) => void) | undefined;
|
|
@@ -292,6 +299,7 @@ export declare const PressableTextInput: FC<Except<{
|
|
|
292
299
|
defaultValue?: string | undefined;
|
|
293
300
|
editable?: boolean | undefined;
|
|
294
301
|
keyboardType?: import("react-native").KeyboardTypeOptions | undefined;
|
|
302
|
+
inputMode?: import("react-native").InputModeOptions | undefined;
|
|
295
303
|
maxLength?: number | undefined;
|
|
296
304
|
multiline?: boolean | undefined;
|
|
297
305
|
onBlur?: ((event: NativeSyntheticEvent<React.FocusEvent>) => void) | undefined;
|
|
@@ -314,7 +322,10 @@ export declare const PressableTextInput: FC<Except<{
|
|
|
314
322
|
} | undefined;
|
|
315
323
|
inputAccessoryViewID?: string | undefined;
|
|
316
324
|
initialValue?: string | undefined;
|
|
317
|
-
autoComplete?: "name" | "email" | "url" | "additional-name" | "address-level1" | "address-level2" | "address-level3" | "address-level4" | "address-line1" | "address-line2" | "address-line3" | "bday" | "bday-day" | "bday-month" | "bday-year" | "cc-additional-name" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-family-name" | "cc-given-name" | "cc-name" | "cc-number" | "cc-type" | "country" | "country-name" | "current-password" | "family-name" | "given-name" | "honorific-prefix" | "honorific-suffix" | "impp" | "language" | "new-password" | "nickname" | "
|
|
325
|
+
autoComplete?: "off" | "name" | "email" | "url" | "tel" | "additional-name" | "address-level1" | "address-level2" | "address-level3" | "address-level4" | "address-line1" | "address-line2" | "address-line3" | "bday" | "bday-day" | "bday-month" | "bday-year" | "cc-additional-name" | "cc-csc" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-family-name" | "cc-given-name" | "cc-name" | "cc-number" | "cc-type" | "country" | "country-name" | "current-password" | "family-name" | "given-name" | "honorific-prefix" | "honorific-suffix" | "impp" | "language" | "new-password" | "nickname" | "on" | "one-time-code" | "organization" | "organization-title" | "postal-code" | "sex" | "street-address" | "tel-area-code" | "tel-country-code" | "tel-extension" | "tel-local" | "tel-national" | "transaction-amount" | "transaction-currency" | "username" | undefined;
|
|
326
|
+
enterKeyHint?: "enter" | "search" | "done" | "go" | "next" | "send" | "previous" | undefined;
|
|
327
|
+
rows?: number | undefined;
|
|
328
|
+
readOnly?: boolean | undefined;
|
|
318
329
|
clearButtonMode?: "never" | "while-editing" | "unless-editing" | "always" | undefined;
|
|
319
330
|
clearTextOnFocus?: boolean | undefined;
|
|
320
331
|
dataDetectorTypes?: import("react-native").DataDetectorTypes | import("react-native").DataDetectorTypes[] | undefined;
|
|
@@ -342,7 +353,7 @@ export declare const PressableTextInput: FC<Except<{
|
|
|
342
353
|
onHoverOut?: ((event: unknown) => void) | undefined;
|
|
343
354
|
testOnly_hovered?: boolean | undefined;
|
|
344
355
|
testOnly_pressed?: boolean | undefined;
|
|
345
|
-
}, "children"> & {
|
|
356
|
+
}, "children" | "numberOfLines" | "editable" | "keyboardType"> & {
|
|
346
357
|
ref?: Ref<TextInput> | undefined;
|
|
347
358
|
}>;
|
|
348
359
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// https://github.com/necolas/react-native-web/blob/0.
|
|
2
|
+
// https://github.com/necolas/react-native-web/blob/0.19.1/packages/react-native-web/src/exports/Pressable/index.js
|
|
3
3
|
import { forwardRef, memo, useCallback, useMemo, useRef, } from "react";
|
|
4
4
|
import { StyleSheet, Text, TextInput, View, } from "react-native";
|
|
5
5
|
import { useForceableState } from "../hooks/useForceableState";
|
|
@@ -7,17 +7,20 @@ import { useHover } from "../hooks/useHover";
|
|
|
7
7
|
import { useMergeRefs } from "../hooks/useMergeRefs";
|
|
8
8
|
import { usePressEvents } from "../hooks/usePressEvents";
|
|
9
9
|
const styles = StyleSheet.create({
|
|
10
|
-
|
|
10
|
+
active: {
|
|
11
11
|
cursor: "pointer",
|
|
12
12
|
touchAction: "manipulation",
|
|
13
13
|
},
|
|
14
|
+
disabled: {
|
|
15
|
+
pointerEvents: "none",
|
|
16
|
+
},
|
|
14
17
|
});
|
|
15
18
|
const getPressable = (
|
|
16
19
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
20
|
Component, config = {}) => {
|
|
18
21
|
const { applyPressStyle = true } = config;
|
|
19
22
|
return forwardRef((props, forwardedRef) => {
|
|
20
|
-
const { children, delayLongPress, delayPressIn, delayPressOut, disabled = false,
|
|
23
|
+
const { children, delayLongPress, delayPressIn, delayPressOut, disabled = false, onBlur, onContextMenu, onFocus, onHoverIn, onHoverOut, onKeyDown, onLongPress, onPress, onPressIn, onPressMove, onPressOut, style, tabIndex, testOnly_hovered, testOnly_pressed, ...rest } = props;
|
|
21
24
|
const [hovered, setHovered] = useForceableState(testOnly_hovered === true);
|
|
22
25
|
const [focused, setFocused] = useForceableState(false);
|
|
23
26
|
const [pressed, setPressed] = useForceableState(testOnly_pressed === true);
|
|
@@ -78,10 +81,17 @@ Component, config = {}) => {
|
|
|
78
81
|
onKeyDownPress?.(e);
|
|
79
82
|
onKeyDown?.(e);
|
|
80
83
|
}, [onKeyDown, onKeyDownPress]);
|
|
81
|
-
|
|
82
|
-
|
|
84
|
+
let _tabIndex;
|
|
85
|
+
if (tabIndex !== undefined) {
|
|
86
|
+
_tabIndex = tabIndex;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
_tabIndex = disabled ? -1 : 0;
|
|
90
|
+
}
|
|
91
|
+
return (_jsx(Component, { ...rest, ...pressEventHandlers, "aria-disabled": disabled, onBlur: blurHandler, onContextmenu: contextMenuHandler, onFocus: focusHandler, onKeyDown: keyDownHandler, ref: setRef, style: [
|
|
92
|
+
!disabled && applyPressStyle ? styles.active : styles.disabled,
|
|
83
93
|
typeof style === "function" ? style(interactionState) : style,
|
|
84
|
-
], children: typeof children === "function" ? children(interactionState) : children }));
|
|
94
|
+
], tabIndex: _tabIndex, children: typeof children === "function" ? children(interactionState) : children }));
|
|
85
95
|
});
|
|
86
96
|
};
|
|
87
97
|
export const Pressable = memo(getPressable(View, { applyPressStyle: true }));
|
|
@@ -14,6 +14,9 @@ const styles = StyleSheet.create({
|
|
|
14
14
|
root: {
|
|
15
15
|
...StyleSheet.absoluteFillObject,
|
|
16
16
|
},
|
|
17
|
+
inert: {
|
|
18
|
+
pointerEvents: "none",
|
|
19
|
+
},
|
|
17
20
|
fill: {
|
|
18
21
|
...StyleSheet.absoluteFillObject,
|
|
19
22
|
},
|
|
@@ -33,14 +36,14 @@ const styles = StyleSheet.create({
|
|
|
33
36
|
},
|
|
34
37
|
containerEnter: {
|
|
35
38
|
animationKeyframes: {
|
|
36
|
-
"0%": { opacity: 0, transform:
|
|
39
|
+
"0%": { opacity: 0, transform: "translateZ(0px) translateX(100px)" },
|
|
37
40
|
},
|
|
38
41
|
animationDuration: "500ms",
|
|
39
42
|
animationTimingFunction: "ease-in-out",
|
|
40
43
|
},
|
|
41
44
|
containerLeave: {
|
|
42
45
|
animationKeyframes: {
|
|
43
|
-
"100%": { opacity: 0, transform:
|
|
46
|
+
"100%": { opacity: 0, transform: "translateZ(0px) translateX(100px)" },
|
|
44
47
|
},
|
|
45
48
|
animationDuration: "500ms",
|
|
46
49
|
animationTimingFunction: "ease-in-out",
|
|
@@ -51,7 +54,7 @@ const styles = StyleSheet.create({
|
|
|
51
54
|
},
|
|
52
55
|
container: {
|
|
53
56
|
...StyleSheet.absoluteFillObject,
|
|
54
|
-
transform:
|
|
57
|
+
transform: "translateZ(0px)",
|
|
55
58
|
flexDirection: "row",
|
|
56
59
|
alignItems: "stretch",
|
|
57
60
|
backgroundColor: backgroundColor.default,
|
|
@@ -66,14 +69,14 @@ const styles = StyleSheet.create({
|
|
|
66
69
|
fillMaxLarge: { maxWidth: 700 },
|
|
67
70
|
contentsEnter: {
|
|
68
71
|
animationKeyframes: {
|
|
69
|
-
"0%": { transform:
|
|
72
|
+
"0%": { transform: "translateZ(0px) translateX(25px)" },
|
|
70
73
|
},
|
|
71
74
|
animationDuration: "500ms",
|
|
72
75
|
animationTimingFunction: "ease-in-out",
|
|
73
76
|
},
|
|
74
77
|
contentsLeave: {
|
|
75
78
|
animationKeyframes: {
|
|
76
|
-
"100%": { transform:
|
|
79
|
+
"100%": { transform: "translateZ(0px) translateX(25px)" },
|
|
77
80
|
},
|
|
78
81
|
animationDuration: "500ms",
|
|
79
82
|
animationTimingFunction: "ease-in-out",
|
|
@@ -81,7 +84,7 @@ const styles = StyleSheet.create({
|
|
|
81
84
|
contentsContainer: {
|
|
82
85
|
...StyleSheet.absoluteFillObject,
|
|
83
86
|
zIndex: 2,
|
|
84
|
-
transform:
|
|
87
|
+
transform: "translateZ(0px)",
|
|
85
88
|
maxWidth: "100%",
|
|
86
89
|
flexGrow: 1,
|
|
87
90
|
},
|
|
@@ -98,5 +101,5 @@ export const RightPanel = forwardRef(({ visible, children, onPressClose }, ref)
|
|
|
98
101
|
setDelayedVisible(visible);
|
|
99
102
|
}, [visible]);
|
|
100
103
|
useBodyClassName("RightPanelOpen", { enabled: visible });
|
|
101
|
-
return (_jsx(Portal, { container: rootNode, children: _jsx(View, { style: styles.root,
|
|
104
|
+
return (_jsx(Portal, { container: rootNode, children: _jsx(View, { style: [styles.root, !visible && styles.inert], children: _jsx(ResponsiveContainer, { style: styles.root, breakpoint: breakpoints.small, children: ({ large }) => (_jsxs(_Fragment, { children: [_jsx(TransitionView, { style: styles.fill, enter: styles.overlayEnter, leave: styles.overlayLeave, children: visible ? (onPressClose != null ? (_jsx(Pressable, { style: styles.overlay, onPress: onPressClose })) : (_jsx(View, { style: styles.overlay }))) : null }), _jsx(Suspense, { fallback: _jsx(LoadingView, { color: backgroundColor.accented, delay: 0 }), children: _jsx(TransitionView, { style: [styles.fillMax, large && styles.fillMaxLarge], enter: styles.containerEnter, leave: styles.containerLeave, children: delayedVisible ? (_jsx(FocusTrap, { onEscapeKey: onPressClose, focusLock: true, autoFocus: true, returnFocus: true, ref: ref, style: styles.container, children: _jsx(TransitionView, { style: styles.contentsContainer, enter: styles.contentsEnter, leave: styles.contentsLeave, children: _jsx(View, { style: styles.contents, children: _jsx(View, { style: styles.contentsContainer, children: typeof children == "function" ? (_jsx(ResponsiveContainer, { style: styles.root, breakpoint: breakpoints.small, children: children })) : (children) }) }) }) })) : null }) })] })) }) }) }));
|
|
102
105
|
});
|
|
@@ -14,6 +14,6 @@ const styles = StyleSheet.create({
|
|
|
14
14
|
alignSelf: "stretch",
|
|
15
15
|
},
|
|
16
16
|
});
|
|
17
|
-
export const Separator = ({ horizontal = false, space, style }) => (_jsx(View, {
|
|
17
|
+
export const Separator = ({ horizontal = false, space, style }) => (_jsx(View, { role: "none", style: horizontal
|
|
18
18
|
? [styles.horizontal, isNotNullish(space) && { marginHorizontal: space }, style]
|
|
19
19
|
: [styles.vertical, isNotNullish(space) && { marginVertical: space }, style] }));
|
|
@@ -10,6 +10,7 @@ const styles = StyleSheet.create({
|
|
|
10
10
|
width: 3,
|
|
11
11
|
},
|
|
12
12
|
marker: {
|
|
13
|
+
pointerEvents: "none",
|
|
13
14
|
position: "absolute",
|
|
14
15
|
top: 0,
|
|
15
16
|
right: 0,
|
|
@@ -68,10 +69,10 @@ export const SidebarNavigationTracker = ({ style, contentContainerStyle, childre
|
|
|
68
69
|
});
|
|
69
70
|
}
|
|
70
71
|
}, [track]);
|
|
71
|
-
return (_jsx(Context.Provider, { value: setTrack, children: _jsxs(ScrollView, { scrollEventThrottle: 30, onLayout: onLayout, style: style, contentContainerStyle: contentContainerStyle,
|
|
72
|
+
return (_jsx(Context.Provider, { value: setTrack, children: _jsxs(ScrollView, { scrollEventThrottle: 30, onLayout: onLayout, style: style, contentContainerStyle: contentContainerStyle, role: "banner", children: [children, _jsx(View, { style: styles.track, ref: trackRef, children: track != null ? (_jsx(View, { style: [
|
|
72
73
|
styles.trackIndicator,
|
|
73
74
|
{
|
|
74
|
-
transform:
|
|
75
|
+
transform: `translateY(${track.top}px) scaleY(${track.height})`,
|
|
75
76
|
backgroundColor: track.color,
|
|
76
77
|
},
|
|
77
78
|
] })) : null })] }) }));
|
|
@@ -89,5 +90,5 @@ export const SidebarNavigationTrackerActiveMarker = ({ color }) => {
|
|
|
89
90
|
setLayoutReference({ color, element: elementRef.current });
|
|
90
91
|
}
|
|
91
92
|
}, [setLayoutReference, color]);
|
|
92
|
-
return _jsx(View, { ref: elementRef, onLayout: onLayout, style: styles.marker
|
|
93
|
+
return _jsx(View, { ref: elementRef, onLayout: onLayout, style: styles.marker });
|
|
93
94
|
};
|