@seed-design/lynx-react 0.6.3 → 0.7.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/lib/components/Accordion/Accordion.d.ts.map +1 -1
- package/lib/components/Accordion/Accordion.jsx +24 -14
- package/lib/components/ActionButton/ActionButton.d.ts +1 -1
- package/lib/components/ActionButton/ActionButton.d.ts.map +1 -1
- package/lib/components/ActionButton/ActionButton.jsx +12 -4
- package/lib/components/AppBar/AppBar.d.ts.map +1 -1
- package/lib/components/AppBar/AppBar.jsx +9 -8
- package/lib/components/Badge/Badge.d.ts.map +1 -1
- package/lib/components/Badge/Badge.jsx +2 -1
- package/lib/components/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/lib/components/BottomSheet/BottomSheet.jsx +9 -9
- package/lib/components/Box/Box.d.ts.map +1 -1
- package/lib/components/Box/Box.jsx +2 -1
- package/lib/components/Callout/Callout.d.ts +2 -2
- package/lib/components/Callout/Callout.d.ts.map +1 -1
- package/lib/components/Callout/Callout.jsx +20 -10
- package/lib/components/Checkbox/Checkbox.d.ts +4 -2
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/Checkbox/Checkbox.jsx +33 -17
- package/lib/components/Chip/Chip.d.ts +1 -1
- package/lib/components/Chip/Chip.d.ts.map +1 -1
- package/lib/components/Chip/Chip.jsx +36 -16
- package/lib/components/Count/Count.d.ts +7 -0
- package/lib/components/Count/Count.d.ts.map +1 -0
- package/lib/components/Count/Count.jsx +19 -0
- package/lib/components/Count/index.d.ts +2 -0
- package/lib/components/Count/index.d.ts.map +1 -0
- package/lib/components/Divider/Divider.d.ts.map +1 -1
- package/lib/components/Divider/Divider.jsx +2 -1
- package/lib/components/Field/Field.d.ts.map +1 -1
- package/lib/components/Field/Field.jsx +11 -15
- package/lib/components/Icon/Icon.d.ts.map +1 -1
- package/lib/components/Icon/Icon.jsx +4 -3
- package/lib/components/InputButton/InputButton.d.ts +40 -0
- package/lib/components/InputButton/InputButton.d.ts.map +1 -0
- package/lib/components/InputButton/InputButton.jsx +118 -0
- package/lib/components/InputButton/InputButton.namespace.d.ts +2 -0
- package/lib/components/InputButton/InputButton.namespace.d.ts.map +1 -0
- package/lib/components/InputButton/InputButton.namespace.js +16 -0
- package/lib/components/InputButton/index.d.ts +3 -0
- package/lib/components/InputButton/index.d.ts.map +1 -0
- package/lib/components/KeyboardAvoidingScrollView/KeyboardAvoidingScrollView.d.ts.map +1 -1
- package/lib/components/KeyboardAvoidingScrollView/KeyboardAvoidingScrollView.jsx +12 -8
- package/lib/components/List/List.d.ts +51 -0
- package/lib/components/List/List.d.ts.map +1 -0
- package/lib/components/List/List.jsx +176 -0
- package/lib/components/List/List.namespace.d.ts +2 -0
- package/lib/components/List/List.namespace.d.ts.map +1 -0
- package/lib/components/List/List.namespace.js +18 -0
- package/lib/components/List/index.d.ts +3 -0
- package/lib/components/List/index.d.ts.map +1 -0
- package/lib/components/MannerTemp/MannerTemp.d.ts.map +1 -1
- package/lib/components/MannerTemp/MannerTemp.jsx +3 -2
- package/lib/components/MannerTempBadge/MannerTempBadge.d.ts.map +1 -1
- package/lib/components/MannerTempBadge/MannerTempBadge.jsx +2 -1
- package/lib/components/Menu/Menu.d.ts +69 -0
- package/lib/components/Menu/Menu.d.ts.map +1 -0
- package/lib/components/Menu/Menu.jsx +520 -0
- package/lib/components/Menu/Menu.namespace.d.ts +2 -0
- package/lib/components/Menu/Menu.namespace.d.ts.map +1 -0
- package/lib/components/Menu/Menu.namespace.js +21 -0
- package/lib/components/Menu/index.d.ts +3 -0
- package/lib/components/Menu/index.d.ts.map +1 -0
- package/lib/components/NotificationBadge/NotificationBadge.d.ts.map +1 -1
- package/lib/components/NotificationBadge/NotificationBadge.jsx +3 -2
- package/lib/components/PageBanner/PageBanner.d.ts +5 -5
- package/lib/components/PageBanner/PageBanner.d.ts.map +1 -1
- package/lib/components/PageBanner/PageBanner.jsx +25 -14
- package/lib/components/ProgressCircle/ProgressCircle.d.ts +2 -2
- package/lib/components/ProgressCircle/ProgressCircle.d.ts.map +1 -1
- package/lib/components/ProgressCircle/ProgressCircle.jsx +4 -3
- package/lib/components/RadioGroup/RadioGroup.d.ts +5 -3
- package/lib/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/lib/components/RadioGroup/RadioGroup.jsx +22 -9
- package/lib/components/ReactionButton/ReactionButton.d.ts +20 -0
- package/lib/components/ReactionButton/ReactionButton.d.ts.map +1 -0
- package/lib/components/ReactionButton/ReactionButton.jsx +88 -0
- package/lib/components/ReactionButton/index.d.ts +2 -0
- package/lib/components/ReactionButton/index.d.ts.map +1 -0
- package/lib/components/ScaleFeedback/ScaleFeedback.d.ts +11 -0
- package/lib/components/ScaleFeedback/ScaleFeedback.d.ts.map +1 -0
- package/lib/components/ScaleFeedback/ScaleFeedback.jsx +16 -0
- package/lib/components/ScaleFeedback/index.d.ts +2 -0
- package/lib/components/ScaleFeedback/index.d.ts.map +1 -0
- package/lib/components/SegmentedControl/SegmentedControl.d.ts +1 -0
- package/lib/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/lib/components/SegmentedControl/SegmentedControl.jsx +23 -10
- package/lib/components/SelectBox/SelectBox.d.ts.map +1 -1
- package/lib/components/SelectBox/SelectBox.jsx +23 -13
- package/lib/components/Stack/Stack.d.ts.map +1 -1
- package/lib/components/Stack/Stack.jsx +2 -1
- package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.d.ts +85 -0
- package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.d.ts.map +1 -0
- package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.jsx +256 -0
- package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.namespace.d.ts +2 -0
- package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.namespace.d.ts.map +1 -0
- package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.namespace.js +24 -0
- package/lib/components/SwipeableMenuSheet/index.d.ts +3 -0
- package/lib/components/SwipeableMenuSheet/index.d.ts.map +1 -0
- package/lib/components/Switch/Switch.d.ts +27 -3
- package/lib/components/Switch/Switch.d.ts.map +1 -1
- package/lib/components/Switch/Switch.jsx +22 -9
- package/lib/components/Tabs/Tabs.d.ts +4 -2
- package/lib/components/Tabs/Tabs.d.ts.map +1 -1
- package/lib/components/Tabs/Tabs.jsx +37 -22
- package/lib/components/TagGroup/TagGroup.d.ts.map +1 -1
- package/lib/components/TagGroup/TagGroup.jsx +4 -3
- package/lib/components/Text/Text.d.ts.map +1 -1
- package/lib/components/Text/Text.jsx +2 -1
- package/lib/components/TextField/TextField.d.ts.map +1 -1
- package/lib/components/TextField/TextField.jsx +35 -23
- package/lib/components/index.d.ts +7 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/private/Positioning.d.ts +69 -0
- package/lib/components/private/Positioning.d.ts.map +1 -0
- package/lib/components/private/Positioning.js +109 -0
- package/lib/components/private/TrackPositioning.d.ts +22 -0
- package/lib/components/private/TrackPositioning.d.ts.map +1 -0
- package/lib/contexts/ScaleFeedbackContentContext.d.ts +4 -0
- package/lib/contexts/ScaleFeedbackContentContext.d.ts.map +1 -0
- package/lib/contexts/ScaleFeedbackContentContext.js +6 -0
- package/lib/contexts/index.d.ts +2 -0
- package/lib/contexts/index.d.ts.map +1 -0
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.d.ts.map +1 -1
- package/lib/hooks/useIconColor.d.ts.map +1 -1
- package/lib/hooks/useIconColor.js +1 -1
- package/lib/hooks/usePressTap.d.ts +4 -3
- package/lib/hooks/usePressTap.d.ts.map +1 -1
- package/lib/hooks/useScaleFeedback.d.ts +48 -0
- package/lib/hooks/useScaleFeedback.d.ts.map +1 -0
- package/lib/hooks/useScaleFeedback.js +108 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +17 -3
- package/lib/node_modules/.bun/@floating-ui_core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.js +493 -0
- package/lib/node_modules/.bun/@floating-ui_utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +114 -0
- package/lib/utils/calculate-scale-feedback.d.ts +5 -0
- package/lib/utils/calculate-scale-feedback.d.ts.map +1 -0
- package/lib/utils/calculate-scale-feedback.js +13 -0
- package/lib/utils/compose-event-handlers.d.ts +5 -0
- package/lib/utils/compose-event-handlers.d.ts.map +1 -0
- package/lib/utils/compose-event-handlers.js +16 -0
- package/lib/utils/create-slot-recipe-context.d.ts.map +1 -1
- package/lib/utils/create-slot-recipe-context.jsx +6 -16
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/merge-props.d.ts +15 -0
- package/lib/utils/merge-props.d.ts.map +1 -0
- package/lib/utils/merge-props.js +36 -0
- package/lib/utils/merge-refs.d.ts +8 -0
- package/lib/utils/merge-refs.d.ts.map +1 -0
- package/lib/utils/merge-refs.js +38 -0
- package/package.json +6 -5
- package/src/components/Accordion/Accordion.tsx +36 -27
- package/src/components/ActionButton/ActionButton.tsx +27 -12
- package/src/components/AppBar/AppBar.tsx +17 -18
- package/src/components/Badge/Badge.tsx +2 -2
- package/src/components/BottomSheet/BottomSheet.tsx +9 -17
- package/src/components/Box/Box.tsx +2 -2
- package/src/components/Callout/Callout.tsx +39 -22
- package/src/components/Checkbox/Checkbox.test.tsx +44 -0
- package/src/components/Checkbox/Checkbox.tsx +52 -21
- package/src/components/Chip/Chip.test.tsx +50 -1
- package/src/components/Chip/Chip.tsx +75 -31
- package/src/components/Count/Count.tsx +35 -0
- package/src/components/Count/index.ts +1 -0
- package/src/components/Divider/Divider.tsx +2 -2
- package/src/components/Field/Field.tsx +15 -28
- package/src/components/Icon/Icon.tsx +14 -7
- package/src/components/InputButton/InputButton.namespace.ts +20 -0
- package/src/components/InputButton/InputButton.test.tsx +82 -0
- package/src/components/InputButton/InputButton.tsx +295 -0
- package/src/components/InputButton/index.ts +2 -0
- package/src/components/KeyboardAvoidingScrollView/KeyboardAvoidingScrollView.tsx +16 -21
- package/src/components/List/List.namespace.ts +24 -0
- package/src/components/List/List.test.tsx +162 -0
- package/src/components/List/List.tsx +476 -0
- package/src/components/List/index.ts +3 -0
- package/src/components/MannerTemp/MannerTemp.tsx +3 -4
- package/src/components/MannerTempBadge/MannerTempBadge.tsx +2 -2
- package/src/components/Menu/Menu.namespace.ts +26 -0
- package/src/components/Menu/Menu.tsx +883 -0
- package/src/components/Menu/index.ts +31 -0
- package/src/components/NotificationBadge/NotificationBadge.tsx +4 -9
- package/src/components/PageBanner/PageBanner.test.tsx +3 -0
- package/src/components/PageBanner/PageBanner.tsx +54 -45
- package/src/components/ProgressCircle/ProgressCircle.test.tsx +48 -0
- package/src/components/ProgressCircle/ProgressCircle.tsx +22 -3
- package/src/components/RadioGroup/RadioGroup.test.tsx +87 -0
- package/src/components/RadioGroup/RadioGroup.tsx +50 -14
- package/src/components/ReactionButton/ReactionButton.test.tsx +122 -0
- package/src/components/ReactionButton/ReactionButton.tsx +139 -0
- package/src/components/ReactionButton/index.ts +1 -0
- package/src/components/ScaleFeedback/ScaleFeedback.test.tsx +41 -0
- package/src/components/ScaleFeedback/ScaleFeedback.tsx +32 -0
- package/src/components/ScaleFeedback/index.ts +1 -0
- package/src/components/SegmentedControl/SegmentedControl.test.tsx +15 -3
- package/src/components/SegmentedControl/SegmentedControl.tsx +35 -14
- package/src/components/SelectBox/SelectBox.test.tsx +39 -1
- package/src/components/SelectBox/SelectBox.tsx +27 -16
- package/src/components/Stack/Stack.tsx +2 -2
- package/src/components/SwipeableMenuSheet/SwipeableMenuSheet.namespace.ts +37 -0
- package/src/components/SwipeableMenuSheet/SwipeableMenuSheet.test.tsx +258 -0
- package/src/components/SwipeableMenuSheet/SwipeableMenuSheet.tsx +655 -0
- package/src/components/SwipeableMenuSheet/index.ts +43 -0
- package/src/components/Switch/Switch.test.tsx +57 -0
- package/src/components/Switch/Switch.tsx +60 -16
- package/src/components/Tabs/Tabs.test.tsx +19 -0
- package/src/components/Tabs/Tabs.tsx +72 -40
- package/src/components/TagGroup/TagGroup.tsx +4 -6
- package/src/components/Text/Text.tsx +2 -2
- package/src/components/TextField/TextField.tsx +60 -54
- package/src/components/index.ts +7 -0
- package/src/components/private/Positioning.test.ts +235 -0
- package/src/components/private/Positioning.ts +223 -0
- package/src/components/private/TrackPositioning.test.ts +58 -0
- package/src/components/private/TrackPositioning.ts +37 -0
- package/src/contexts/ScaleFeedbackContentContext.ts +4 -0
- package/src/contexts/index.ts +1 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useIconColor.ts +5 -4
- package/src/hooks/usePressTap.ts +4 -3
- package/src/hooks/useScaleFeedback.integration.test.tsx +85 -0
- package/src/hooks/useScaleFeedback.test.ts +50 -0
- package/src/hooks/useScaleFeedback.ts +199 -0
- package/src/index.ts +1 -0
- package/src/utils/calculate-scale-feedback.ts +12 -0
- package/src/utils/compose-event-handlers.ts +16 -0
- package/src/utils/create-slot-recipe-context.tsx +6 -7
- package/src/utils/index.ts +1 -0
- package/src/utils/merge-props.test.tsx +152 -0
- package/src/utils/merge-props.ts +62 -0
- package/src/utils/merge-refs.ts +44 -0
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { useControllableState } from "../../hooks/useControllableState.js";
|
|
2
2
|
import { usePressTap } from "../../hooks/usePressTap.js";
|
|
3
|
+
import { useScaleFeedback } from "../../hooks/useScaleFeedback.js";
|
|
4
|
+
import { mergeProps } from "../../utils/merge-props.js";
|
|
3
5
|
import { splitMultipleVariantsProps } from "../../utils/split-multiple-variants-props.js";
|
|
4
6
|
import * as React from "@lynx-js/react";
|
|
5
7
|
import clsx from "clsx";
|
|
@@ -20,20 +22,27 @@ function useSwitchmarkControlContext(consumer) {
|
|
|
20
22
|
}
|
|
21
23
|
var SwitchRoot = React.forwardRef((props, ref) => {
|
|
22
24
|
const { children, className, checked: checkedProp, defaultChecked = false, disabled = false, onCheckedChange, ...restProps } = props;
|
|
23
|
-
const [{ switch: switchVariantProps, switchmark: switchmarkVariantProps },
|
|
25
|
+
const [{ switch: switchVariantProps, switchmark: switchmarkVariantProps }, restNativeProps] = splitMultipleVariantsProps(restProps, {
|
|
24
26
|
switch: switchStyle,
|
|
25
27
|
switchmark
|
|
26
28
|
});
|
|
29
|
+
const { "accessibility-element": accessibilityElement = true, "accessibility-role-description": accessibilityRoleDescription = "switch", "accessibility-traits": accessibilityTraits, "accessibility-value": accessibilityValue, ...nativeProps } = restNativeProps;
|
|
27
30
|
const [checked, setChecked] = useControllableState({
|
|
28
31
|
value: checkedProp,
|
|
29
32
|
defaultValue: defaultChecked,
|
|
30
33
|
onChange: onCheckedChange
|
|
31
34
|
});
|
|
32
35
|
const toggle = React.useCallback(() => setChecked(!checked), [checked, setChecked]);
|
|
33
|
-
const { pressed
|
|
36
|
+
const { pressed, bindtouchstart, bindtouchend, bindtouchcancel, ...pressHandlers } = usePressTap({
|
|
34
37
|
disabled,
|
|
35
38
|
onTap: toggle
|
|
36
39
|
});
|
|
40
|
+
const { scaleFeedbackTriggerProps, scaleFeedbackTargetProps } = useScaleFeedback({
|
|
41
|
+
disabled,
|
|
42
|
+
onTouchStart: bindtouchstart,
|
|
43
|
+
onTouchEnd: bindtouchend,
|
|
44
|
+
onTouchCancel: bindtouchcancel
|
|
45
|
+
});
|
|
37
46
|
const rootClassName = switchStyle({
|
|
38
47
|
...switchVariantProps,
|
|
39
48
|
disabled
|
|
@@ -41,18 +50,22 @@ var SwitchRoot = React.forwardRef((props, ref) => {
|
|
|
41
50
|
const contextValue = React.useMemo(() => ({
|
|
42
51
|
checked,
|
|
43
52
|
disabled,
|
|
53
|
+
pressed,
|
|
44
54
|
switchVariantProps,
|
|
45
55
|
switchmarkVariantProps,
|
|
46
|
-
toggle
|
|
56
|
+
toggle,
|
|
57
|
+
scaleFeedbackTargetProps
|
|
47
58
|
}), [
|
|
48
59
|
checked,
|
|
49
60
|
disabled,
|
|
61
|
+
pressed,
|
|
50
62
|
switchVariantProps,
|
|
51
63
|
switchmarkVariantProps,
|
|
52
|
-
toggle
|
|
64
|
+
toggle,
|
|
65
|
+
scaleFeedbackTargetProps
|
|
53
66
|
]);
|
|
54
67
|
return <SwitchContext.Provider value={contextValue}>
|
|
55
|
-
<view {...ref ? { ref } : {}} className={clsx(rootClassName, className)} {
|
|
68
|
+
<view {...mergeProps(ref ? { ref } : {}, scaleFeedbackTriggerProps, pressHandlers, nativeProps)} className={clsx(rootClassName, className)} accessibility-element={accessibilityElement} accessibility-role-description={accessibilityRoleDescription} accessibility-traits={accessibilityTraits ?? (disabled ? "disabled" : void 0)} accessibility-value={accessibilityValue ?? (checked ? "checked" : "not checked")}>
|
|
56
69
|
{children}
|
|
57
70
|
</view>
|
|
58
71
|
</SwitchContext.Provider>;
|
|
@@ -73,7 +86,7 @@ var SwitchControl = React.forwardRef((props, ref) => {
|
|
|
73
86
|
thumbClassName: classes.thumb,
|
|
74
87
|
switchmarkVariantProps
|
|
75
88
|
}}>
|
|
76
|
-
<view {...ref ? { ref } : {}} className={clsx(classes.root, className)} {
|
|
89
|
+
<view {...mergeProps(ref ? { ref } : {}, context.scaleFeedbackTargetProps, nativeProps)} className={clsx(classes.root, className)} flatten={false}>
|
|
77
90
|
{children}
|
|
78
91
|
</view>
|
|
79
92
|
</SwitchmarkControlContext.Provider>;
|
|
@@ -82,7 +95,7 @@ SwitchControl.displayName = "SwitchControl";
|
|
|
82
95
|
var SwitchThumb = React.forwardRef((props, ref) => {
|
|
83
96
|
const { className, ...nativeProps } = props;
|
|
84
97
|
const { thumbClassName } = useSwitchmarkControlContext("SwitchThumb");
|
|
85
|
-
return <view {...ref ? { ref } : {}} className={clsx(thumbClassName, className)}
|
|
98
|
+
return <view {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(thumbClassName, className)} />;
|
|
86
99
|
});
|
|
87
100
|
SwitchThumb.displayName = "SwitchThumb";
|
|
88
101
|
var SwitchLabel = React.forwardRef((props, ref) => {
|
|
@@ -92,10 +105,10 @@ var SwitchLabel = React.forwardRef((props, ref) => {
|
|
|
92
105
|
...context.switchVariantProps,
|
|
93
106
|
disabled: context.disabled
|
|
94
107
|
}).label;
|
|
95
|
-
return <text {...ref ? { ref } : {}} className={clsx(labelClassName, className)}
|
|
108
|
+
return <text {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(labelClassName, className)}>
|
|
96
109
|
{children}
|
|
97
110
|
</text>;
|
|
98
111
|
});
|
|
99
112
|
SwitchLabel.displayName = "SwitchLabel";
|
|
100
113
|
//#endregion
|
|
101
|
-
export { SwitchControl, SwitchLabel, SwitchRoot, SwitchThumb };
|
|
114
|
+
export { SwitchControl, SwitchLabel, SwitchRoot, SwitchThumb, useSwitchContext };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TabsVariantProps } from '@seed-design/lynx-css/recipes/tabs';
|
|
2
2
|
import { IntrinsicElements } from '@lynx-js/types';
|
|
3
|
-
import { LynxAccessibilityProps, LynxStyledElementProps } from '../../types';
|
|
3
|
+
import { LynxAccessibilityProps, LynxPressableProps, LynxStyledElementProps } from '../../types';
|
|
4
4
|
import * as React from "@lynx-js/react";
|
|
5
5
|
type NativeViewPagerProps = IntrinsicElements["viewpager"];
|
|
6
6
|
type TabsPublicVariantProps = Omit<TabsVariantProps, "selected" | "disabled" | "inCarousel" | "transitionEnabled">;
|
|
@@ -21,9 +21,11 @@ export declare const TabsRoot: React.ForwardRefExoticComponent<TabsRootProps & R
|
|
|
21
21
|
export interface TabsListProps extends LynxStyledElementProps {
|
|
22
22
|
}
|
|
23
23
|
export declare const TabsList: React.ForwardRefExoticComponent<TabsListProps & React.RefAttributes<unknown>>;
|
|
24
|
-
export interface TabsTriggerProps extends LynxStyledElementProps {
|
|
24
|
+
export interface TabsTriggerProps extends Omit<LynxStyledElementProps, "children" | "flatten">, Pick<LynxPressableProps, "bindtap"> {
|
|
25
|
+
children: string | number;
|
|
25
26
|
value: string;
|
|
26
27
|
disabled?: boolean;
|
|
28
|
+
notification?: React.ReactNode;
|
|
27
29
|
"accessibility-label"?: LynxAccessibilityProps["accessibility-label"];
|
|
28
30
|
}
|
|
29
31
|
export declare const TabsTrigger: React.ForwardRefExoticComponent<TabsTriggerProps & React.RefAttributes<unknown>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,EACV,iBAAiB,EAMlB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,EACV,iBAAiB,EAMlB,MAAM,gBAAgB,CAAC;AAMxB,OAAO,KAAK,EACV,sBAAsB,EACtB,kBAAkB,EAClB,sBAAsB,EAGvB,MAAM,aAAa,CAAC;AAarB,KAAK,oBAAoB,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAC;AAI3D,KAAK,sBAAsB,GAAG,IAAI,CAChC,gBAAgB,EAChB,UAAU,GAAG,UAAU,GAAG,YAAY,GAAG,mBAAmB,CAC7D,CAAC;AAkFF;;;;;;;GAOG;AACH,MAAM,WAAW,aAAc,SAAQ,sBAAsB,EAAE,sBAAsB;IACnF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAED,eAAO,MAAM,QAAQ,+EAmNnB,CAAC;AAyBH,MAAM,WAAW,aAAc,SAAQ,sBAAsB;C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C"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { useControllableState } from "../../hooks/useControllableState.js";
|
|
2
2
|
import { usePressTap } from "../../hooks/usePressTap.js";
|
|
3
|
+
import { useScaleFeedback } from "../../hooks/useScaleFeedback.js";
|
|
4
|
+
import { mergeProps } from "../../utils/merge-props.js";
|
|
3
5
|
import { createSlotRecipeContext } from "../../utils/create-slot-recipe-context.jsx";
|
|
6
|
+
import { Box } from "../Box/Box.jsx";
|
|
4
7
|
import { areTabsTransitionsEnabled, getTabsLayoutWidth, getTabsOrderedItems, getTabsTriggerRects } from "./Tabs.utils.js";
|
|
5
8
|
import * as React from "@lynx-js/react";
|
|
6
9
|
import clsx from "clsx";
|
|
@@ -192,7 +195,7 @@ var TabsRoot = React.forwardRef((props, ref) => {
|
|
|
192
195
|
]);
|
|
193
196
|
return <TabsContext.Provider value={contextValue}>
|
|
194
197
|
<ClassNamesProvider value={classNames}>
|
|
195
|
-
<view {...ref ? { ref } : {}
|
|
198
|
+
<view {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classNames.root, className)} style={style}>
|
|
196
199
|
{children}
|
|
197
200
|
</view>
|
|
198
201
|
</ClassNamesProvider>
|
|
@@ -229,18 +232,14 @@ var TabsList = React.forwardRef((props, ref) => {
|
|
|
229
232
|
syncTriggerOrder,
|
|
230
233
|
triggerOrder
|
|
231
234
|
]);
|
|
232
|
-
const mergedRef = React.
|
|
233
|
-
|
|
234
|
-
if (typeof ref === "function") ref(node);
|
|
235
|
-
else if (ref) ref.current = node;
|
|
236
|
-
}, [ref, setListRef]);
|
|
237
|
-
return <scroll-view ref={mergedRef} {...nativeProps} scroll-orientation="horizontal" scroll-bar-enable={false} accessibility-element={false} accessibility-traits="tabbar" className={clsx(classNames.list, className)} style={style}>
|
|
235
|
+
const mergedRef = React.useMemo(() => mergeProps({ ref: setListRef }, { ref }).ref, [ref, setListRef]);
|
|
236
|
+
return <scroll-view {...mergeProps({ ref: mergedRef }, nativeProps)} scroll-orientation="horizontal" scroll-bar-enable={false} accessibility-element={false} accessibility-traits="tabbar" className={clsx(classNames.list, className)} style={style}>
|
|
238
237
|
<view className={classNames.listContent}>{children}</view>
|
|
239
238
|
</scroll-view>;
|
|
240
239
|
});
|
|
241
240
|
TabsList.displayName = "TabsList";
|
|
242
241
|
var TabsTrigger = React.forwardRef((props, ref) => {
|
|
243
|
-
const { children, className, style, value: triggerValue, disabled = false, "accessibility-label": accessibilityLabel, ...nativeProps } = props;
|
|
242
|
+
const { children, notification, className, style, value: triggerValue, disabled = false, bindtap, "accessibility-label": accessibilityLabel, ...nativeProps } = props;
|
|
244
243
|
const context = useTabsContext("TabsTrigger");
|
|
245
244
|
const selected = context.value === triggerValue;
|
|
246
245
|
const visuallySelected = context.visualValue === triggerValue;
|
|
@@ -256,12 +255,23 @@ var TabsTrigger = React.forwardRef((props, ref) => {
|
|
|
256
255
|
triggerValue,
|
|
257
256
|
disabled
|
|
258
257
|
]);
|
|
259
|
-
const { pressed: _pressed, ...pressHandlers } = usePressTap({
|
|
258
|
+
const { pressed: _pressed, bindtouchstart, bindtouchend, bindtouchcancel, ...pressHandlers } = usePressTap({
|
|
260
259
|
disabled,
|
|
261
|
-
onTap: React.useCallback(() => {
|
|
260
|
+
onTap: React.useCallback((...args) => {
|
|
262
261
|
"background only";
|
|
262
|
+
bindtap?.(...args);
|
|
263
263
|
context.selectValue(triggerValue);
|
|
264
|
-
}, [
|
|
264
|
+
}, [
|
|
265
|
+
bindtap,
|
|
266
|
+
context.selectValue,
|
|
267
|
+
triggerValue
|
|
268
|
+
])
|
|
269
|
+
});
|
|
270
|
+
const { scaleFeedbackTriggerProps, scaleFeedbackTargetProps } = useScaleFeedback({
|
|
271
|
+
disabled,
|
|
272
|
+
onTouchStart: bindtouchstart,
|
|
273
|
+
onTouchEnd: bindtouchend,
|
|
274
|
+
onTouchCancel: bindtouchcancel
|
|
265
275
|
});
|
|
266
276
|
const handleLayoutChange = React.useCallback((...args) => {
|
|
267
277
|
"background only";
|
|
@@ -275,8 +285,11 @@ var TabsTrigger = React.forwardRef((props, ref) => {
|
|
|
275
285
|
transitionEnabled: context.transitionsEnabled
|
|
276
286
|
});
|
|
277
287
|
const label = typeof children === "string" || typeof children === "number" ? String(children) : void 0;
|
|
278
|
-
return <view {...ref ? { ref } : {}
|
|
279
|
-
<
|
|
288
|
+
return <view {...mergeProps({ bindlayoutchange: handleLayoutChange }, ref ? { ref } : {}, pressHandlers, scaleFeedbackTargetProps, scaleFeedbackTriggerProps, nativeProps)} flatten={false} accessibility-element={true} accessibility-role-description="tab" accessibility-label={accessibilityLabel ?? label} accessibility-value={selected ? "selected" : "not selected"} accessibility-traits={disabled ? "disabled" : selected ? "selected" : "button"} className={clsx(triggerClasses.trigger, className)} style={style}>
|
|
289
|
+
{notification ? <Box position="relative">
|
|
290
|
+
<text className={triggerClasses.triggerLabel}>{children}</text>
|
|
291
|
+
{notification}
|
|
292
|
+
</Box> : <text className={triggerClasses.triggerLabel}>{children}</text>}
|
|
280
293
|
</view>;
|
|
281
294
|
});
|
|
282
295
|
TabsTrigger.displayName = "TabsTrigger";
|
|
@@ -292,7 +305,7 @@ var TabsIndicator = React.forwardRef((props, ref) => {
|
|
|
292
305
|
const upperRect = triggerRects[items[upperIndex]?.value ?? ""] ?? lowerRect;
|
|
293
306
|
const x = lowerRect ? lowerRect.left + ((upperRect?.left ?? lowerRect.left) - lowerRect.left) * progress : 0;
|
|
294
307
|
const width = lowerRect ? lowerRect.width + ((upperRect?.width ?? lowerRect.width) - lowerRect.width) * progress : 0;
|
|
295
|
-
return <view {...ref ? { ref } : {}
|
|
308
|
+
return <view {...mergeProps({ "main-thread:ref": indicatorRef }, ref ? { ref } : {}, nativeProps)} accessibility-elements-hidden={true} className={clsx(classNames.indicator, className)} style={{
|
|
296
309
|
"--tabs-indicator-x": `${x}px`,
|
|
297
310
|
"--tabs-indicator-width": `${width}px`,
|
|
298
311
|
...style
|
|
@@ -318,7 +331,7 @@ var TabsContent = React.forwardRef((props, ref) => {
|
|
|
318
331
|
tabsContext.registerContent,
|
|
319
332
|
contentValue
|
|
320
333
|
]);
|
|
321
|
-
const content = <view {...ref ? { ref } : {}
|
|
334
|
+
const content = <view {...mergeProps(ref ? { ref } : {}, nativeProps)} accessibility-elements-hidden={!selected} accessibility-role-description="tabpanel" accessibility-value={selected ? "selected" : "not selected"} className={clsx(contentClasses.content, className)} style={style}>
|
|
322
335
|
{children}
|
|
323
336
|
</view>;
|
|
324
337
|
if (inCarousel) {
|
|
@@ -345,7 +358,7 @@ var TabsCarousel = React.forwardRef((props, ref) => {
|
|
|
345
358
|
onSwipeEnd
|
|
346
359
|
]);
|
|
347
360
|
return <TabsCarouselContext.Provider value={contextValue}>
|
|
348
|
-
<view {...ref ? { ref } : {}
|
|
361
|
+
<view {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classNames.carousel, className)} style={style}>
|
|
349
362
|
{children}
|
|
350
363
|
</view>
|
|
351
364
|
</TabsCarouselContext.Provider>;
|
|
@@ -359,11 +372,7 @@ var TabsCarouselCamera = React.forwardRef((props, ref) => {
|
|
|
359
372
|
const swipingRef = React.useRef(false);
|
|
360
373
|
const { indicatorRef, pagerValues, triggerRects } = tabsContext;
|
|
361
374
|
const indicatorRects = pagerValues.map((value) => triggerRects[value] ?? null);
|
|
362
|
-
const mergedRef = React.
|
|
363
|
-
tabsContext.setPagerRef(node);
|
|
364
|
-
if (typeof ref === "function") ref(node);
|
|
365
|
-
else if (ref) ref.current = node;
|
|
366
|
-
}, [ref, tabsContext.setPagerRef]);
|
|
375
|
+
const mergedRef = React.useMemo(() => mergeProps({ ref: tabsContext.setPagerRef }, { ref }).ref, [ref, tabsContext.setPagerRef]);
|
|
367
376
|
const handleWillChange = React.useCallback((event) => {
|
|
368
377
|
"background only";
|
|
369
378
|
bindwillchange?.(event);
|
|
@@ -415,7 +424,13 @@ var TabsCarouselCamera = React.forwardRef((props, ref) => {
|
|
|
415
424
|
"--tabs-indicator-width": `${width}px`
|
|
416
425
|
});
|
|
417
426
|
}
|
|
418
|
-
return <viewpager
|
|
427
|
+
return <viewpager {...mergeProps({
|
|
428
|
+
ref: mergedRef,
|
|
429
|
+
bindwillchange: handleWillChange,
|
|
430
|
+
bindchange: handleChange,
|
|
431
|
+
bindoffsetchange: handleOffsetChange,
|
|
432
|
+
"main-thread:bindoffsetchange": handleIndicatorOffsetChange
|
|
433
|
+
}, nativeProps)} initial-select-index={Math.max(0, tabsContext.selectedPagerIndex)} enable-scroll={carouselContext.swipeable} ios-gesture-offset={carouselContext.iosBackGestureEdgeWidth} className={clsx(classNames.carouselCamera, className)} style={style}>
|
|
419
434
|
<TabsCarouselCameraContext.Provider value={true}>
|
|
420
435
|
{children}
|
|
421
436
|
</TabsCarouselCameraContext.Provider>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagGroup.d.ts","sourceRoot":"","sources":["../../../src/components/TagGroup/TagGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAY,KAAK,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC9F,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,8CAA8C,CAAC;AAEtD,OAAO,KAAK,EAAE,sBAAsB,EAA4B,MAAM,aAAa,CAAC;AAIpF,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"TagGroup.d.ts","sourceRoot":"","sources":["../../../src/components/TagGroup/TagGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAY,KAAK,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC9F,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,8CAA8C,CAAC;AAEtD,OAAO,KAAK,EAAE,sBAAsB,EAA4B,MAAM,aAAa,CAAC;AAIpF,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAQpE;;;;;;;;GAQG;AACH,MAAM,WAAW,iBACf,SAAQ,oBAAoB,EAC1B,wBAAwB,EACxB,sBAAsB;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,eAAO,MAAM,YAAY,mFAiCvB,CAAC;AAKH;;;;;GAKG;AACH,MAAM,WAAW,iBACf,SAAQ,wBAAwB,EAC9B,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,EAC9B,sBAAsB;CAAG;AAE7B,eAAO,MAAM,YAAY,mFAkBvB,CAAC;AAKH,MAAM,WAAW,sBAAuB,SAAQ,sBAAsB;CAAG;AAEzE,eAAO,MAAM,iBAAiB,wFAW5B,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { toArray } from "../../utils/children.js";
|
|
2
|
+
import { mergeProps } from "../../utils/merge-props.js";
|
|
2
3
|
import { createSlotRecipeContext } from "../../utils/create-slot-recipe-context.jsx";
|
|
3
4
|
import { useStyleProps } from "../../utils/styled.js";
|
|
4
5
|
import { splitMultipleVariantsProps } from "../../utils/split-multiple-variants-props.js";
|
|
@@ -18,7 +19,7 @@ var TagGroupRoot = React.forwardRef((props, ref) => {
|
|
|
18
19
|
const normalizedSeparator = typeof separator === "string" ? separator.trim() : separator;
|
|
19
20
|
const visibleChildren = toArray(children);
|
|
20
21
|
return <PropsProvider value={tagGroupItemVariantProps}>
|
|
21
|
-
<view {...ref ? { ref } : {}} className={clsx(classes.root, className)}
|
|
22
|
+
<view {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classes.root, className)}>
|
|
22
23
|
{visibleChildren.map((child, index) => {
|
|
23
24
|
if (index === 0) return child;
|
|
24
25
|
return <view key={child.key ?? index} className={classes.separatorWrapper}>
|
|
@@ -40,7 +41,7 @@ var TagGroupItem = React.forwardRef((props, ref) => {
|
|
|
40
41
|
const { style, restProps } = useStyleProps(otherProps);
|
|
41
42
|
const { children, className, ...nativeProps } = restProps;
|
|
42
43
|
return <ClassNamesProvider value={classes}>
|
|
43
|
-
<view {...ref ? { ref } : {}} className={clsx(classes.root, className)} style={style}
|
|
44
|
+
<view {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classes.root, className)} style={style}>
|
|
44
45
|
{children}
|
|
45
46
|
</view>
|
|
46
47
|
</ClassNamesProvider>;
|
|
@@ -49,7 +50,7 @@ TagGroupItem.displayName = "TagGroupItem";
|
|
|
49
50
|
var TagGroupItemLabel = React.forwardRef((props, ref) => {
|
|
50
51
|
const classes = useClassNames();
|
|
51
52
|
const { children, className, ...nativeProps } = props;
|
|
52
|
-
return <text {...ref ? { ref } : {}} className={clsx(classes.label, className)}
|
|
53
|
+
return <text {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classes.label, className)}>
|
|
53
54
|
{children}
|
|
54
55
|
</text>;
|
|
55
56
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,sBAAsB,EAAe,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,sBAAsB,EAAe,MAAM,aAAa,CAAC;AAavE,MAAM,WAAW,SAAU,SAAQ,cAAc,EAAE,sBAAsB;CAAG;AAE5E,eAAO,MAAM,IAAI,2EAiCf,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { mergeProps } from "../../utils/merge-props.js";
|
|
1
2
|
import { handleColor, handleFontSize, handleFontWeight, handleLineHeight } from "../../utils/styled.js";
|
|
2
3
|
import * as React from "@lynx-js/react";
|
|
3
4
|
import clsx from "clsx";
|
|
@@ -12,7 +13,7 @@ function getTypographyStyle(textStyle) {
|
|
|
12
13
|
var Text = React.forwardRef((props, ref) => {
|
|
13
14
|
const { color, textStyle, fontSize, lineHeight, fontWeight, align, children, className, style, ...nativeProps } = props;
|
|
14
15
|
const typographyStyle = getTypographyStyle(textStyle);
|
|
15
|
-
return <text {...ref ? { ref } : {}
|
|
16
|
+
return <text {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(className)} style={{
|
|
16
17
|
color: handleColor(color),
|
|
17
18
|
fontSize: handleFontSize(fontSize) ?? typographyStyle.fontSize,
|
|
18
19
|
lineHeight: handleLineHeight(lineHeight ?? fontSize) ?? typographyStyle.lineHeight,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAa,KAAK,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAIjG,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAe,MAAM,aAAa,CAAC;AAG/F,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAa,KAAK,qBAAqB,EAAE,MAAM,0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C,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACtD;AAED,eAAO,MAAM,iBAAiB,yFA+J7B,CAAC;AAKF,MAAM,WAAW,wBAAyB,SAAQ,iBAAiB;CAAG;AAEtE,eAAO,MAAM,mBAAmB,0FAY/B,CAAC;AAGF,MAAM,WAAW,wBAAyB,SAAQ,sBAAsB;CAAG;AAE3E,eAAO,MAAM,mBAAmB,0FAc/B,CAAC;AAGF,MAAM,WAAW,wBAAyB,SAAQ,iBAAiB;CAAG;AAEtE,eAAO,MAAM,mBAAmB,0FAY/B,CAAC;AAGF,MAAM,WAAW,wBAAyB,SAAQ,sBAAsB;CAAG;AAE3E,eAAO,MAAM,mBAAmB,0FAc/B,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { mergeProps } from "../../utils/merge-props.js";
|
|
1
2
|
import { createSlotRecipeContext } from "../../utils/create-slot-recipe-context.jsx";
|
|
2
3
|
import { InternalIcon } from "../Icon/Icon.jsx";
|
|
3
4
|
import { useFieldContext } from "../Field/context.js";
|
|
@@ -52,12 +53,7 @@ var TextFieldRoot = React.forwardRef((props, forwardedRef) => {
|
|
|
52
53
|
invalid,
|
|
53
54
|
readOnly
|
|
54
55
|
});
|
|
55
|
-
const mergedRef = React.
|
|
56
|
-
"background only";
|
|
57
|
-
rootRef.current = node;
|
|
58
|
-
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
59
|
-
else if (forwardedRef) forwardedRef.current = node;
|
|
60
|
-
}, [forwardedRef]);
|
|
56
|
+
const mergedRef = React.useMemo(() => mergeProps({ ref: rootRef }, { ref: forwardedRef }).ref, [forwardedRef]);
|
|
61
57
|
const setFocused = React.useCallback((nextFocused) => {
|
|
62
58
|
"background only";
|
|
63
59
|
setLocalFocused(nextFocused);
|
|
@@ -96,7 +92,7 @@ var TextFieldRoot = React.forwardRef((props, forwardedRef) => {
|
|
|
96
92
|
]);
|
|
97
93
|
return <TextFieldContext.Provider value={contextValue}>
|
|
98
94
|
<ClassNamesProvider value={classes}>
|
|
99
|
-
<view ref
|
|
95
|
+
<view {...mergeProps({ ref: mergedRef }, nativeProps)} className={clsx(classes.root, className)}>
|
|
100
96
|
<view className={classes.baseStroke} accessibility-elements-hidden={true} />
|
|
101
97
|
<view className={classes.stroke} accessibility-elements-hidden={true} />
|
|
102
98
|
{children}
|
|
@@ -161,12 +157,7 @@ function useNativeTextControl({ forwardedRef, disabled: disabledProp, readOnly:
|
|
|
161
157
|
lastNativeValueRef.current = null;
|
|
162
158
|
}
|
|
163
159
|
}, []);
|
|
164
|
-
const mergedRef = React.
|
|
165
|
-
"background only";
|
|
166
|
-
nativeRef.current = node;
|
|
167
|
-
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
168
|
-
else if (forwardedRef) forwardedRef.current = node;
|
|
169
|
-
}, [forwardedRef]);
|
|
160
|
+
const mergedRef = React.useMemo(() => mergeProps({ ref: nativeRef }, { ref: forwardedRef }).ref, [forwardedRef]);
|
|
170
161
|
const updateEditingState = React.useCallback((selectionStart, selectionEnd, isComposing = isComposingRef.current) => {
|
|
171
162
|
"background only";
|
|
172
163
|
isComposingRef.current = isComposing;
|
|
@@ -341,16 +332,26 @@ var TextFieldInput = React.forwardRef((props, ref) => {
|
|
|
341
332
|
const value = control.context.value;
|
|
342
333
|
const isPlaceholder = value === "";
|
|
343
334
|
const displayValue = isPlaceholder ? props.placeholder : props.type === "password" ? Array.from(value, () => "•").join("") : value;
|
|
344
|
-
return <text
|
|
335
|
+
return <text {...mergeProps({
|
|
336
|
+
ref: control.mergedRef,
|
|
337
|
+
bindlayoutchange: props.bindlayoutchange,
|
|
338
|
+
"main-thread:bindlayoutchange": props["main-thread:bindlayoutchange"]
|
|
339
|
+
}, getAccessibilityProps(props))} id={props.id} hidden={props.hidden} flatten={props.flatten} focusable={props.focusable} className={clsx(classes.value, className)} style={getReadOnlyTextStyle({
|
|
345
340
|
style: props.style,
|
|
346
341
|
disabled: control.disabled,
|
|
347
342
|
placeholder: isPlaceholder,
|
|
348
343
|
multiline: false
|
|
349
|
-
})}
|
|
344
|
+
})}>
|
|
350
345
|
{displayValue}
|
|
351
346
|
</text>;
|
|
352
347
|
}
|
|
353
|
-
return <input {...
|
|
348
|
+
return <input {...mergeProps({
|
|
349
|
+
ref: control.mergedRef,
|
|
350
|
+
bindinput: control.handleInput,
|
|
351
|
+
bindselection: handleSelection,
|
|
352
|
+
bindfocus: control.handleFocus,
|
|
353
|
+
bindblur: control.handleBlur
|
|
354
|
+
}, control.defaultValueProps, resolvedMaxLength === void 0 ? {} : { maxlength: resolvedMaxLength }, nativeProps)} className={clsx(classes.value, className)} disabled={control.disabled} readonly={control.readOnly} show-soft-input-on-focus={showSoftInputOnFocus ?? true} android-set-soft-input-mode={androidSetSoftInputMode ?? "unspecified"} name={name ?? control.context.name} />;
|
|
354
355
|
});
|
|
355
356
|
TextFieldInput.displayName = "TextFieldInput";
|
|
356
357
|
var TextFieldTextarea = React.forwardRef((props, ref) => {
|
|
@@ -390,16 +391,27 @@ var TextFieldTextarea = React.forwardRef((props, ref) => {
|
|
|
390
391
|
if (control.readOnly) {
|
|
391
392
|
const value = control.context.value;
|
|
392
393
|
const isPlaceholder = value === "";
|
|
393
|
-
return <text
|
|
394
|
+
return <text {...mergeProps({
|
|
395
|
+
ref: control.mergedRef,
|
|
396
|
+
bindlayoutchange: props.bindlayoutchange,
|
|
397
|
+
"main-thread:bindlayoutchange": props["main-thread:bindlayoutchange"]
|
|
398
|
+
}, getAccessibilityProps(props))} id={props.id} hidden={props.hidden} flatten={props.flatten} focusable={props.focusable} className={clsx(classes.value, classes.textareaValue, classes.textareaFixed, className)} style={getReadOnlyTextStyle({
|
|
394
399
|
style: props.style,
|
|
395
400
|
disabled: control.disabled,
|
|
396
401
|
placeholder: isPlaceholder,
|
|
397
402
|
multiline: true
|
|
398
|
-
})}
|
|
403
|
+
})}>
|
|
399
404
|
{isPlaceholder ? props.placeholder : value}
|
|
400
405
|
</text>;
|
|
401
406
|
}
|
|
402
|
-
const textarea = <textarea {...
|
|
407
|
+
const textarea = <textarea {...mergeProps({
|
|
408
|
+
ref: control.mergedRef,
|
|
409
|
+
bindinput: control.handleInput,
|
|
410
|
+
bindselection: handleSelection,
|
|
411
|
+
bindfocus: control.handleFocus,
|
|
412
|
+
bindblur: control.handleBlur,
|
|
413
|
+
bindlayoutchange: usesIOSAutoresizeWrapper ? bindlayoutchange : handleLayoutChange
|
|
414
|
+
}, control.defaultValueProps, resolvedMaxLength === void 0 ? {} : { maxlength: resolvedMaxLength }, nativeProps)} className={clsx(classes.value, classes.textareaValue, !autoresize && classes.textareaFixed, usesIOSAutoresizeWrapper && classes.textareaNativeAutoresize, autoresize && !usesIOSAutoresizeWrapper && classes.textareaAndroidAutoresize, className)} disabled={control.disabled} readonly={control.readOnly} show-soft-input-on-focus={showSoftInputOnFocus ?? true} bounces={bounces ?? (autoresize ? false : void 0)} line-spacing={resolvedLineSpacing} android-fullscreen-mode={androidFullscreenMode ?? false} android-set-soft-input-mode={androidSetSoftInputMode ?? "unspecified"} name={name ?? control.context.name} />;
|
|
403
415
|
if (!usesIOSAutoresizeWrapper) return textarea;
|
|
404
416
|
return <view ignore-focus={true} className={clsx(classes.textareaRoot, classes.textareaAutoresizeRoot)} bindtap={handleTextareaRootTap} bindlayoutchange={control.notifyLayoutChanged}>
|
|
405
417
|
{textarea}
|
|
@@ -409,13 +421,13 @@ TextFieldTextarea.displayName = "TextFieldTextarea";
|
|
|
409
421
|
var TextFieldPrefixIcon = React.forwardRef((props, ref) => {
|
|
410
422
|
const classes = useClassNames();
|
|
411
423
|
const { className, ...otherProps } = props;
|
|
412
|
-
return <InternalIcon
|
|
424
|
+
return <InternalIcon {...mergeProps({ ref }, otherProps)} className={clsx(classes.prefixIcon, className)} />;
|
|
413
425
|
});
|
|
414
426
|
TextFieldPrefixIcon.displayName = "TextFieldPrefixIcon";
|
|
415
427
|
var TextFieldPrefixText = React.forwardRef((props, ref) => {
|
|
416
428
|
const classes = useClassNames();
|
|
417
429
|
const { children, className, ...nativeProps } = props;
|
|
418
|
-
return <text {...ref ? { ref } : {}} className={clsx(classes.prefixText, className)}
|
|
430
|
+
return <text {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classes.prefixText, className)}>
|
|
419
431
|
{children}
|
|
420
432
|
</text>;
|
|
421
433
|
});
|
|
@@ -423,13 +435,13 @@ TextFieldPrefixText.displayName = "TextFieldPrefixText";
|
|
|
423
435
|
var TextFieldSuffixIcon = React.forwardRef((props, ref) => {
|
|
424
436
|
const classes = useClassNames();
|
|
425
437
|
const { className, ...otherProps } = props;
|
|
426
|
-
return <InternalIcon
|
|
438
|
+
return <InternalIcon {...mergeProps({ ref }, otherProps)} className={clsx(classes.suffixIcon, className)} />;
|
|
427
439
|
});
|
|
428
440
|
TextFieldSuffixIcon.displayName = "TextFieldSuffixIcon";
|
|
429
441
|
var TextFieldSuffixText = React.forwardRef((props, ref) => {
|
|
430
442
|
const classes = useClassNames();
|
|
431
443
|
const { children, className, ...nativeProps } = props;
|
|
432
|
-
return <text {...ref ? { ref } : {}} className={clsx(classes.suffixText, className)}
|
|
444
|
+
return <text {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classes.suffixText, className)}>
|
|
433
445
|
{children}
|
|
434
446
|
</text>;
|
|
435
447
|
});
|
|
@@ -7,20 +7,27 @@ export * from './BottomSheet';
|
|
|
7
7
|
export * from './Callout';
|
|
8
8
|
export * from './Checkbox';
|
|
9
9
|
export * from './Chip';
|
|
10
|
+
export * from './Count';
|
|
10
11
|
export * from './Divider';
|
|
11
12
|
export * from './Field';
|
|
12
13
|
export * from './Icon';
|
|
14
|
+
export * from './InputButton';
|
|
13
15
|
export * from './KeyboardAvoidingScrollView';
|
|
14
16
|
export * from './MannerTemp';
|
|
17
|
+
export * from './Menu';
|
|
15
18
|
export * from './MannerTempBadge';
|
|
16
19
|
export * from './NotificationBadge';
|
|
17
20
|
export * from './PageBanner';
|
|
21
|
+
export * from './List';
|
|
18
22
|
export * from './ProgressCircle';
|
|
19
23
|
export * from './RadioGroup';
|
|
24
|
+
export * from './ReactionButton';
|
|
25
|
+
export * from './ScaleFeedback';
|
|
20
26
|
export * from './SegmentedControl';
|
|
21
27
|
export * from './SelectBox';
|
|
22
28
|
export * from './Stack';
|
|
23
29
|
export * from './Switch';
|
|
30
|
+
export * from './SwipeableMenuSheet';
|
|
24
31
|
export * from './Tabs';
|
|
25
32
|
export * from './TagGroup';
|
|
26
33
|
export * from './Text';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,8BAA8B,CAAC;AAC7C,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export type Side = "top" | "right" | "bottom" | "left";
|
|
2
|
+
export type Placement = Side | `${Side}-${"start" | "end"}`;
|
|
3
|
+
export interface Rect {
|
|
4
|
+
left: number;
|
|
5
|
+
top: number;
|
|
6
|
+
right: number;
|
|
7
|
+
bottom: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
}
|
|
11
|
+
export interface Position {
|
|
12
|
+
/** 가용 크기는 콘텐츠 크기와 별개이며 0 이상입니다. */
|
|
13
|
+
availableWidth: number;
|
|
14
|
+
availableHeight: number;
|
|
15
|
+
/** 콘텐츠 내부 좌표입니다. 나머지 축은 placement의 반대쪽 가장자리에 붙입니다. */
|
|
16
|
+
arrow?: {
|
|
17
|
+
left?: number;
|
|
18
|
+
top?: number;
|
|
19
|
+
centerOffset: number;
|
|
20
|
+
};
|
|
21
|
+
left: number;
|
|
22
|
+
top: number;
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
placement: Placement;
|
|
26
|
+
transformOrigin: string;
|
|
27
|
+
}
|
|
28
|
+
export interface PositioningOptions {
|
|
29
|
+
placement: Placement;
|
|
30
|
+
gutter: number;
|
|
31
|
+
overflowPadding: number;
|
|
32
|
+
flip?: false | {
|
|
33
|
+
fallbackStrategy?: "bestFit" | "initialPlacement";
|
|
34
|
+
fallbackPlacements?: Placement[];
|
|
35
|
+
};
|
|
36
|
+
shift?: false | {
|
|
37
|
+
mainAxis?: boolean;
|
|
38
|
+
crossAxis?: boolean;
|
|
39
|
+
/** reference에서 완전히 떨어지지 않도록 이동을 제한합니다. */
|
|
40
|
+
limit?: boolean;
|
|
41
|
+
};
|
|
42
|
+
/** 생략하면 원래 높이를 보존합니다. 너비 제한은 호출자가 적용합니다. */
|
|
43
|
+
size?: {
|
|
44
|
+
order: "beforeFlip" | "afterShift";
|
|
45
|
+
minimumHeight?: number;
|
|
46
|
+
};
|
|
47
|
+
arrow?: {
|
|
48
|
+
/** 회전 가능한 정사각형 화살표 컨테이너의 한 변입니다. */
|
|
49
|
+
size: number;
|
|
50
|
+
/** 컨테이너 크기와 별개인 화살표 끝의 돌출 길이입니다. gutter에 더합니다. */
|
|
51
|
+
tipHeight: number;
|
|
52
|
+
padding: number;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export interface ComputePositionOptions extends PositioningOptions {
|
|
56
|
+
reference: Rect;
|
|
57
|
+
boundary: Rect;
|
|
58
|
+
width: number;
|
|
59
|
+
height: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* 모든 좌표와 크기는 동일한 화면 기준 논리 px입니다.
|
|
63
|
+
* boundary의 safe area 보정과 결과의 컨테이너 상대 좌표 변환은 호출자 책임입니다.
|
|
64
|
+
*
|
|
65
|
+
* availableWidth로 너비를 제한했다면 줄바꿈 후 실제 높이를 다시 측정해 호출합니다.
|
|
66
|
+
* native 측정·호출 주기·오래된 비동기 결과 폐기는 이 순수 계산에 포함하지 않습니다.
|
|
67
|
+
*/
|
|
68
|
+
export declare function computePosition({ reference, boundary, width, height, placement, gutter, overflowPadding, flip: flipOptions, shift: shiftOptions, size: sizeOptions, arrow: arrowOptions, }: ComputePositionOptions): Promise<Position>;
|
|
69
|
+
//# sourceMappingURL=Positioning.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Positioning.d.ts","sourceRoot":"","sources":["../../../src/components/private/Positioning.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,IAAI,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AACvD,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,GAAG,IAAI,IAAI,OAAO,GAAG,KAAK,EAAE,CAAC;AAE5D,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,QAAQ;IACvB,mCAAmC;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,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