@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,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 { InternalIcon } from "../Icon/Icon.jsx";
|
|
6
|
+
import { ScaleFeedbackContentContext } from "../../contexts/ScaleFeedbackContentContext.js";
|
|
4
7
|
import { splitMultipleVariantsProps } from "../../utils/split-multiple-variants-props.js";
|
|
5
8
|
import * as React from "@lynx-js/react";
|
|
6
9
|
import { isValidElement } from "@lynx-js/react";
|
|
@@ -23,10 +26,11 @@ function useCheckmarkControlContext(consumer) {
|
|
|
23
26
|
}
|
|
24
27
|
var CheckboxRoot = React.forwardRef((props, ref) => {
|
|
25
28
|
const { children, className, checked: checkedProp, defaultChecked = false, indeterminate = false, disabled = false, onCheckedChange, ...restProps } = props;
|
|
26
|
-
const [{ checkbox: checkboxVariantProps, checkmark: checkmarkVariantProps },
|
|
29
|
+
const [{ checkbox: checkboxVariantProps, checkmark: checkmarkVariantProps }, restNativeProps] = splitMultipleVariantsProps(restProps, {
|
|
27
30
|
checkbox,
|
|
28
31
|
checkmark
|
|
29
32
|
});
|
|
33
|
+
const { "accessibility-element": accessibilityElement = true, "accessibility-role-description": accessibilityRoleDescription = "checkbox", "accessibility-traits": accessibilityTraits, "accessibility-value": accessibilityValue, ...nativeProps } = restNativeProps;
|
|
30
34
|
const [checked, setChecked] = useControllableState({
|
|
31
35
|
value: checkedProp,
|
|
32
36
|
defaultValue: defaultChecked,
|
|
@@ -37,21 +41,26 @@ var CheckboxRoot = React.forwardRef((props, ref) => {
|
|
|
37
41
|
checked,
|
|
38
42
|
indeterminate
|
|
39
43
|
});
|
|
40
|
-
const { pressed, bindtouchstart, ...pressHandlers } = usePressTap({
|
|
44
|
+
const { pressed, bindtouchstart, bindtouchend, bindtouchcancel, ...pressHandlers } = usePressTap({
|
|
41
45
|
disabled,
|
|
42
46
|
onTap: toggle
|
|
43
47
|
});
|
|
44
|
-
const
|
|
45
|
-
|
|
48
|
+
const { scaleFeedbackTriggerProps, scaleFeedbackTargetProps } = useScaleFeedback({
|
|
49
|
+
disabled,
|
|
50
|
+
onTouchStart: React.useCallback(() => {
|
|
51
|
+
pressSelectionRef.current = {
|
|
52
|
+
checked,
|
|
53
|
+
indeterminate
|
|
54
|
+
};
|
|
55
|
+
bindtouchstart();
|
|
56
|
+
}, [
|
|
57
|
+
bindtouchstart,
|
|
46
58
|
checked,
|
|
47
59
|
indeterminate
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
checked,
|
|
53
|
-
indeterminate
|
|
54
|
-
]);
|
|
60
|
+
]),
|
|
61
|
+
onTouchEnd: bindtouchend,
|
|
62
|
+
onTouchCancel: bindtouchcancel
|
|
63
|
+
});
|
|
55
64
|
const rootClassName = checkbox({
|
|
56
65
|
...checkboxVariantProps,
|
|
57
66
|
disabled
|
|
@@ -65,7 +74,8 @@ var CheckboxRoot = React.forwardRef((props, ref) => {
|
|
|
65
74
|
pressStartIndeterminate: pressSelectionRef.current.indeterminate,
|
|
66
75
|
checkboxVariantProps,
|
|
67
76
|
checkmarkVariantProps,
|
|
68
|
-
toggle
|
|
77
|
+
toggle,
|
|
78
|
+
scaleFeedbackTargetProps
|
|
69
79
|
}), [
|
|
70
80
|
checked,
|
|
71
81
|
indeterminate,
|
|
@@ -73,10 +83,11 @@ var CheckboxRoot = React.forwardRef((props, ref) => {
|
|
|
73
83
|
pressed,
|
|
74
84
|
checkboxVariantProps,
|
|
75
85
|
checkmarkVariantProps,
|
|
76
|
-
toggle
|
|
86
|
+
toggle,
|
|
87
|
+
scaleFeedbackTargetProps
|
|
77
88
|
]);
|
|
78
89
|
return <CheckboxContext.Provider value={contextValue}>
|
|
79
|
-
<view {...ref ? { ref } : {}} className={clsx(rootClassName, className)}
|
|
90
|
+
<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")}>
|
|
80
91
|
{children}
|
|
81
92
|
</view>
|
|
82
93
|
</CheckboxContext.Provider>;
|
|
@@ -86,6 +97,7 @@ var CheckboxControl = React.forwardRef((props, ref) => {
|
|
|
86
97
|
const [variantProps, restProps] = checkmark.splitVariantProps(props);
|
|
87
98
|
const { children, className, ...nativeProps } = restProps;
|
|
88
99
|
const context = useCheckboxContext("CheckboxControl");
|
|
100
|
+
const hasScaledContent = React.useContext(ScaleFeedbackContentContext);
|
|
89
101
|
const checkmarkVariantProps = {
|
|
90
102
|
...context.checkmarkVariantProps,
|
|
91
103
|
...variantProps,
|
|
@@ -95,6 +107,10 @@ var CheckboxControl = React.forwardRef((props, ref) => {
|
|
|
95
107
|
pressed: context.pressed
|
|
96
108
|
};
|
|
97
109
|
const classes = checkmark(checkmarkVariantProps);
|
|
110
|
+
const checkboxControlClassName = checkbox({
|
|
111
|
+
...context.checkboxVariantProps,
|
|
112
|
+
disabled: context.disabled
|
|
113
|
+
}).control;
|
|
98
114
|
const pressStartClasses = checkmark({
|
|
99
115
|
...checkmarkVariantProps,
|
|
100
116
|
checked: context.pressStartChecked,
|
|
@@ -112,7 +128,7 @@ var CheckboxControl = React.forwardRef((props, ref) => {
|
|
|
112
128
|
iconClassName: classes.icon,
|
|
113
129
|
checkmarkVariantProps
|
|
114
130
|
}}>
|
|
115
|
-
<view {...ref ? { ref } : {}} className={clsx(rootClassName, className)} {
|
|
131
|
+
<view {...mergeProps(ref ? { ref } : {}, !hasScaledContent ? context.scaleFeedbackTargetProps : {}, nativeProps)} className={clsx(checkboxControlClassName, rootClassName, className)} {...!hasScaledContent ? { flatten: false } : {}}>
|
|
116
132
|
{isGhost ? <view className={pressStartClasses.background} /> : null}
|
|
117
133
|
{children}
|
|
118
134
|
</view>
|
|
@@ -144,7 +160,7 @@ var CheckboxLabel = React.forwardRef((props, ref) => {
|
|
|
144
160
|
...context.checkboxVariantProps,
|
|
145
161
|
disabled: context.disabled
|
|
146
162
|
}).label;
|
|
147
|
-
return <text {...ref ? { ref } : {}} className={clsx(labelClassName, className)}
|
|
163
|
+
return <text {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(labelClassName, className)}>
|
|
148
164
|
{children}
|
|
149
165
|
</text>;
|
|
150
166
|
});
|
|
@@ -152,7 +168,7 @@ CheckboxLabel.displayName = "CheckboxLabel";
|
|
|
152
168
|
var CheckboxGroup = React.forwardRef((props, ref) => {
|
|
153
169
|
const { children, className, ...nativeProps } = props;
|
|
154
170
|
const classes = checkboxGroup();
|
|
155
|
-
return <view {...ref ? { ref } : {}} className={clsx(classes.root, className)}
|
|
171
|
+
return <view {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classes.root, className)}>
|
|
156
172
|
{children}
|
|
157
173
|
</view>;
|
|
158
174
|
});
|
|
@@ -11,7 +11,7 @@ type ChipPublicVariantProps = Omit<ChipVariantProps, "selected" | "pressed">;
|
|
|
11
11
|
* - 키보드 focus / focusVisible
|
|
12
12
|
* - `asChild`
|
|
13
13
|
*/
|
|
14
|
-
export interface ChipButtonProps extends ChipPublicVariantProps, LynxStyledElementProps, LynxPressableProps, LynxAccessibilityProps {
|
|
14
|
+
export interface ChipButtonProps extends ChipPublicVariantProps, Omit<LynxStyledElementProps, "flatten">, LynxPressableProps, LynxAccessibilityProps {
|
|
15
15
|
disabled?: boolean;
|
|
16
16
|
}
|
|
17
17
|
export declare const ChipButton: React.ForwardRefExoticComponent<ChipButtonProps & React.RefAttributes<unknown>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAGxC,OAAO,EAAQ,KAAK,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAGxC,OAAO,EAAQ,KAAK,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAKjF,OAAO,KAAK,EACV,sBAAsB,EACtB,kBAAkB,EAClB,sBAAsB,EAGvB,MAAM,aAAa,CAAC;AAErB,OAAO,EAKL,KAAK,eAAe,EACpB,KAAK,eAAe,EACrB,MAAM,cAAc,CAAC;AAKtB,KAAK,sBAAsB,GAAG,IAAI,CAAC,gBAAgB,EAAE,UA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;AAGH,MAAM,WAAW,mBAAoB,SAAQ,eAAe;CAAG;AAE/D,eAAO,MAAM,cAAc,qFAEzB,CAAC"}
|
|
@@ -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 { createSlotRecipeContext } from "../../utils/create-slot-recipe-context.jsx";
|
|
4
6
|
import { IconRequired, IconSlotProvider, PrefixIcon, SuffixIcon } from "../Icon/Icon.jsx";
|
|
5
7
|
import * as React from "@lynx-js/react";
|
|
@@ -39,7 +41,7 @@ var ChipRootView = React.forwardRef((props, ref) => {
|
|
|
39
41
|
return <ClassNamesProvider value={classes}>
|
|
40
42
|
<IconSlotProvider value={iconSlotContextValue}>
|
|
41
43
|
<IconRequired enabled={variantProps.layout === "iconOnly"}>
|
|
42
|
-
<view {...ref ? { ref } : {}} className={clsx(classes.root, className)}
|
|
44
|
+
<view {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classes.root, className)}>
|
|
43
45
|
{children}
|
|
44
46
|
</view>
|
|
45
47
|
</IconRequired>
|
|
@@ -48,25 +50,31 @@ var ChipRootView = React.forwardRef((props, ref) => {
|
|
|
48
50
|
});
|
|
49
51
|
ChipRootView.displayName = "ChipRootView";
|
|
50
52
|
var ChipButton = React.forwardRef((props, ref) => {
|
|
51
|
-
const { bindtap, "main-thread:bindtap": mainThreadBindtap, disabled = false, "accessibility-element": accessibilityElement = true, "accessibility-traits": accessibilityTraits, ...restProps } = props;
|
|
52
|
-
const { pressed, ...pressHandlers } = usePressTap({
|
|
53
|
+
const { bindtap, "main-thread:bindtap": mainThreadBindtap, disabled = false, "accessibility-element": accessibilityElement = true, "accessibility-role-description": accessibilityRoleDescription = "button", "accessibility-traits": accessibilityTraits, ...restProps } = props;
|
|
54
|
+
const { pressed, bindtouchstart, bindtouchend, bindtouchcancel, ...pressHandlers } = usePressTap({
|
|
53
55
|
disabled,
|
|
54
56
|
onTap: bindtap,
|
|
55
57
|
mainThreadOnTap: mainThreadBindtap
|
|
56
58
|
});
|
|
57
|
-
|
|
59
|
+
const { scaleFeedbackTriggerProps, scaleFeedbackTargetProps } = useScaleFeedback({
|
|
60
|
+
disabled,
|
|
61
|
+
onTouchStart: bindtouchstart,
|
|
62
|
+
onTouchEnd: bindtouchend,
|
|
63
|
+
onTouchCancel: bindtouchcancel
|
|
64
|
+
});
|
|
65
|
+
return <ChipRootView {...mergeProps({ ref }, scaleFeedbackTargetProps, scaleFeedbackTriggerProps, pressHandlers, restProps)} disabled={disabled} selected={false} pressed={pressed} accessibility-element={accessibilityElement} accessibility-role-description={accessibilityRoleDescription} accessibility-traits={accessibilityTraits ?? (disabled ? "disabled" : void 0)} flatten={false} />;
|
|
58
66
|
});
|
|
59
67
|
ChipButton.displayName = "ChipButton";
|
|
60
|
-
var ChipRoot = React.forwardRef((props, ref) => <ChipButton
|
|
68
|
+
var ChipRoot = React.forwardRef((props, ref) => <ChipButton {...mergeProps({ ref }, props)} />);
|
|
61
69
|
ChipRoot.displayName = "ChipRoot";
|
|
62
70
|
var ChipToggle = React.forwardRef((props, ref) => {
|
|
63
|
-
const { checked: checkedProp, defaultChecked = false, onCheckedChange, bindtap, "main-thread:bindtap": mainThreadBindtap, disabled = false, "accessibility-element": accessibilityElement = true, "accessibility-traits": accessibilityTraits, ...restProps } = props;
|
|
71
|
+
const { checked: checkedProp, defaultChecked = false, onCheckedChange, bindtap, "main-thread:bindtap": mainThreadBindtap, disabled = false, "accessibility-element": accessibilityElement = true, "accessibility-role-description": accessibilityRoleDescription = "toggle", "accessibility-traits": accessibilityTraits, "accessibility-value": accessibilityValue, ...restProps } = props;
|
|
64
72
|
const [checked, setChecked] = useControllableState({
|
|
65
73
|
value: checkedProp,
|
|
66
74
|
defaultValue: defaultChecked,
|
|
67
75
|
onChange: onCheckedChange
|
|
68
76
|
});
|
|
69
|
-
const { pressed, ...pressHandlers } = usePressTap({
|
|
77
|
+
const { pressed, bindtouchstart, bindtouchend, bindtouchcancel, ...pressHandlers } = usePressTap({
|
|
70
78
|
disabled,
|
|
71
79
|
onTap: React.useCallback((...args) => {
|
|
72
80
|
setChecked(!checked);
|
|
@@ -78,7 +86,13 @@ var ChipToggle = React.forwardRef((props, ref) => {
|
|
|
78
86
|
]),
|
|
79
87
|
mainThreadOnTap: mainThreadBindtap
|
|
80
88
|
});
|
|
81
|
-
|
|
89
|
+
const { scaleFeedbackTriggerProps, scaleFeedbackTargetProps } = useScaleFeedback({
|
|
90
|
+
disabled,
|
|
91
|
+
onTouchStart: bindtouchstart,
|
|
92
|
+
onTouchEnd: bindtouchend,
|
|
93
|
+
onTouchCancel: bindtouchcancel
|
|
94
|
+
});
|
|
95
|
+
return <ChipRootView {...mergeProps({ ref }, scaleFeedbackTargetProps, scaleFeedbackTriggerProps, pressHandlers, restProps)} disabled={disabled} selected={checked} pressed={pressed} accessibility-element={accessibilityElement} accessibility-role-description={accessibilityRoleDescription} accessibility-traits={accessibilityTraits ?? (disabled ? "disabled" : void 0)} accessibility-value={accessibilityValue ?? (checked ? "checked" : "not checked")} flatten={false} />;
|
|
82
96
|
});
|
|
83
97
|
ChipToggle.displayName = "ChipToggle";
|
|
84
98
|
var ChipRadioGroupContext = React.createContext(null);
|
|
@@ -108,18 +122,18 @@ var ChipRadioRoot = React.forwardRef((props, ref) => {
|
|
|
108
122
|
disabled
|
|
109
123
|
]);
|
|
110
124
|
return <ChipRadioGroupContext.Provider value={contextValue}>
|
|
111
|
-
<view {...ref ? { ref } : {}} className={className}
|
|
125
|
+
<view {...mergeProps(ref ? { ref } : {}, nativeProps)} className={className}>
|
|
112
126
|
{children}
|
|
113
127
|
</view>
|
|
114
128
|
</ChipRadioGroupContext.Provider>;
|
|
115
129
|
});
|
|
116
130
|
ChipRadioRoot.displayName = "ChipRadioRoot";
|
|
117
131
|
var ChipRadioItem = React.forwardRef((props, ref) => {
|
|
118
|
-
const { value: itemValue, disabled: itemDisabled = false, bindtap, "main-thread:bindtap": mainThreadBindtap, "accessibility-element": accessibilityElement = true, "accessibility-traits": accessibilityTraits, ...restProps } = props;
|
|
132
|
+
const { value: itemValue, disabled: itemDisabled = false, bindtap, "main-thread:bindtap": mainThreadBindtap, "accessibility-element": accessibilityElement = true, "accessibility-role-description": accessibilityRoleDescription = "radio", "accessibility-traits": accessibilityTraits, "accessibility-value": accessibilityValue, ...restProps } = props;
|
|
119
133
|
const group = useChipRadioGroupContext("ChipRadioItem");
|
|
120
134
|
const disabled = group.disabled || itemDisabled;
|
|
121
135
|
const selected = group.value === itemValue;
|
|
122
|
-
const { pressed, ...pressHandlers } = usePressTap({
|
|
136
|
+
const { pressed, bindtouchstart, bindtouchend, bindtouchcancel, ...pressHandlers } = usePressTap({
|
|
123
137
|
disabled,
|
|
124
138
|
onTap: React.useCallback((...args) => {
|
|
125
139
|
if (!selected) group.setValue(itemValue);
|
|
@@ -132,28 +146,34 @@ var ChipRadioItem = React.forwardRef((props, ref) => {
|
|
|
132
146
|
]),
|
|
133
147
|
mainThreadOnTap: mainThreadBindtap
|
|
134
148
|
});
|
|
135
|
-
|
|
149
|
+
const { scaleFeedbackTriggerProps, scaleFeedbackTargetProps } = useScaleFeedback({
|
|
150
|
+
disabled,
|
|
151
|
+
onTouchStart: bindtouchstart,
|
|
152
|
+
onTouchEnd: bindtouchend,
|
|
153
|
+
onTouchCancel: bindtouchcancel
|
|
154
|
+
});
|
|
155
|
+
return <ChipRootView {...mergeProps({ ref }, scaleFeedbackTargetProps, scaleFeedbackTriggerProps, pressHandlers, restProps)} disabled={disabled} selected={selected} pressed={pressed} accessibility-element={accessibilityElement} accessibility-role-description={accessibilityRoleDescription} accessibility-traits={accessibilityTraits ?? (disabled ? "disabled" : void 0)} accessibility-value={accessibilityValue ?? (selected ? "selected" : "not selected")} flatten={false} />;
|
|
136
156
|
});
|
|
137
157
|
ChipRadioItem.displayName = "ChipRadioItem";
|
|
138
158
|
var ChipLabel = React.forwardRef((props, ref) => {
|
|
139
159
|
const classes = useClassNames();
|
|
140
160
|
const { children, className, ...nativeProps } = props;
|
|
141
|
-
return <text {...ref ? { ref } : {}} className={clsx(classes.label, className)}
|
|
161
|
+
return <text {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classes.label, className)}>
|
|
142
162
|
{children}
|
|
143
163
|
</text>;
|
|
144
164
|
});
|
|
145
165
|
ChipLabel.displayName = "ChipLabel";
|
|
146
|
-
var ChipPrefixIcon = React.forwardRef((props, ref) => <PrefixIcon
|
|
166
|
+
var ChipPrefixIcon = React.forwardRef((props, ref) => <PrefixIcon {...mergeProps({ ref }, props)} />);
|
|
147
167
|
ChipPrefixIcon.displayName = "ChipPrefixIcon";
|
|
148
168
|
var ChipPrefixAvatar = React.forwardRef((props, ref) => {
|
|
149
169
|
const classes = useClassNames();
|
|
150
170
|
const { children, className, ...nativeProps } = props;
|
|
151
|
-
return <view {...ref ? { ref } : {}} className={clsx(classes.prefixAvatar, className)}
|
|
171
|
+
return <view {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classes.prefixAvatar, className)}>
|
|
152
172
|
{children}
|
|
153
173
|
</view>;
|
|
154
174
|
});
|
|
155
175
|
ChipPrefixAvatar.displayName = "ChipPrefixAvatar";
|
|
156
|
-
var ChipSuffixIcon = React.forwardRef((props, ref) => <SuffixIcon
|
|
176
|
+
var ChipSuffixIcon = React.forwardRef((props, ref) => <SuffixIcon {...mergeProps({ ref }, props)} />);
|
|
157
177
|
ChipSuffixIcon.displayName = "ChipSuffixIcon";
|
|
158
178
|
//#endregion
|
|
159
179
|
export { ChipButton, ChipLabel, ChipPrefixAvatar, ChipPrefixIcon, ChipRadioItem, ChipRadioRoot, ChipRoot, ChipSuffixIcon, ChipToggle };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LynxStyledElementProps } from '../../types';
|
|
2
|
+
import * as React from "@lynx-js/react";
|
|
3
|
+
export interface CountProps extends LynxStyledElementProps {
|
|
4
|
+
}
|
|
5
|
+
export declare const Count: React.ForwardRefExoticComponent<CountProps & React.RefAttributes<unknown>>;
|
|
6
|
+
export declare function isCountElement(node: React.ReactNode): node is React.ReactElement<CountProps>;
|
|
7
|
+
//# sourceMappingURL=Count.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Count.d.ts","sourceRoot":"","sources":["../../../src/components/Count/Count.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAGxC,OAAO,KAAK,EAAE,sBAAsB,EAAe,MAAM,aAAa,CAAC;AAQvE,MAAM,WAAW,UAAW,SAAQ,sBAAsB;CAAG;AAE7D,eAAO,MAAM,KAAK,4EAYhB,CAAC;AAIH,wBAAgB,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,IAAI,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,CAI5F"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "@lynx-js/react";
|
|
2
|
+
import { isValidElement } from "@lynx-js/react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
//#region src/components/Count/Count.tsx
|
|
5
|
+
var countMarker = Symbol.for("@seed-design/lynx-react/count");
|
|
6
|
+
var Count = React.forwardRef((props, ref) => {
|
|
7
|
+
const { children, className, ...nativeProps } = props;
|
|
8
|
+
return <text {...ref ? { ref } : {}} {...nativeProps} className={clsx("seed-count", className)}>
|
|
9
|
+
{children}
|
|
10
|
+
</text>;
|
|
11
|
+
});
|
|
12
|
+
Count.displayName = "Count";
|
|
13
|
+
Count[countMarker] = true;
|
|
14
|
+
function isCountElement(node) {
|
|
15
|
+
if (!isValidElement(node)) return false;
|
|
16
|
+
return node.type[countMarker] === true;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Count, isCountElement };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Count/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../../src/components/Divider/Divider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAExC,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../../src/components/Divider/Divider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAExC,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIrD,MAAM,WAAW,YACf,SAAQ,IAAI,CAAC,sBAAsB,EAAE,UAAU,CAAC,EAC9C,sBAAsB;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;IAElC;;OAEG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;IAEtC;;OAEG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IAExC;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,8EAkClB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { mergeProps } from "../../utils/merge-props.js";
|
|
1
2
|
import { Box } from "../Box/Box.jsx";
|
|
2
3
|
import * as React from "@lynx-js/react";
|
|
3
4
|
//#region src/components/Divider/Divider.tsx
|
|
@@ -11,7 +12,7 @@ import * as React from "@lynx-js/react";
|
|
|
11
12
|
var Divider = React.forwardRef((props, ref) => {
|
|
12
13
|
const { color = "stroke.neutralMuted", thickness = 1, orientation = "horizontal", inset = false, style, "accessibility-element": accessibilityElement = true, "accessibility-role-description": accessibilityRoleDescription = "separator", ...nativeProps } = props;
|
|
13
14
|
const isHorizontal = orientation === "horizontal";
|
|
14
|
-
return <Box {...
|
|
15
|
+
return <Box {...mergeProps({ ref }, nativeProps)} borderColor={color} borderWidth={0} borderBottomWidth={isHorizontal ? thickness : 0} borderRightWidth={isHorizontal ? 0 : thickness} accessibility-element={accessibilityElement} accessibility-role-description={accessibilityRoleDescription} style={{
|
|
15
16
|
width: isHorizontal ? inset ? "calc(100% - 32px)" : "100%" : void 0,
|
|
16
17
|
height: isHorizontal ? void 0 : inset ? "calc(100% - 32px)" : "100%",
|
|
17
18
|
marginLeft: inset && isHorizontal ? "16px" : void 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../src/components/Field/Field.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAS,KAAK,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACpF,OAAO,EAAc,KAAK,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AAGpG,OAAO,KAAK,EAAE,sBAAsB,EAA4B,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../src/components/Field/Field.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAS,KAAK,iBAAiB,EA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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 { FieldContext, useFieldContext } from "./context.js";
|
|
3
4
|
import * as React from "@lynx-js/react";
|
|
@@ -14,12 +15,7 @@ var FieldRoot = React.forwardRef((props, forwardedRef) => {
|
|
|
14
15
|
const [focused, setFocused] = React.useState(false);
|
|
15
16
|
const rootRef = React.useRef(null);
|
|
16
17
|
const classes = field({ invalid });
|
|
17
|
-
const mergedRef = React.
|
|
18
|
-
"background only";
|
|
19
|
-
rootRef.current = node;
|
|
20
|
-
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
21
|
-
else if (forwardedRef) forwardedRef.current = node;
|
|
22
|
-
}, [forwardedRef]);
|
|
18
|
+
const mergedRef = React.useMemo(() => mergeProps({ ref: rootRef }, { ref: forwardedRef }).ref, [forwardedRef]);
|
|
23
19
|
const contextValue = React.useMemo(() => ({
|
|
24
20
|
rootRef,
|
|
25
21
|
disabled,
|
|
@@ -37,7 +33,7 @@ var FieldRoot = React.forwardRef((props, forwardedRef) => {
|
|
|
37
33
|
]);
|
|
38
34
|
return <FieldContext.Provider value={contextValue}>
|
|
39
35
|
<FieldClassNamesProvider value={classes}>
|
|
40
|
-
<view ref
|
|
36
|
+
<view {...mergeProps({ ref: mergedRef }, nativeProps)} className={clsx(classes.root, className)}>
|
|
41
37
|
{children}
|
|
42
38
|
</view>
|
|
43
39
|
</FieldClassNamesProvider>
|
|
@@ -47,7 +43,7 @@ FieldRoot.displayName = "FieldRoot";
|
|
|
47
43
|
var FieldHeader = React.forwardRef((props, ref) => {
|
|
48
44
|
const classes = useFieldClassNames();
|
|
49
45
|
const { children, className, ...nativeProps } = props;
|
|
50
|
-
return <view {...ref ? { ref } : {}} className={clsx(classes.header, className)}
|
|
46
|
+
return <view {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classes.header, className)}>
|
|
51
47
|
{children}
|
|
52
48
|
</view>;
|
|
53
49
|
});
|
|
@@ -57,7 +53,7 @@ var FieldLabel = React.forwardRef((props, ref) => {
|
|
|
57
53
|
const { children, className, ...nativeProps } = otherProps;
|
|
58
54
|
const classes = fieldLabel(variantProps);
|
|
59
55
|
return <FieldLabelClassNamesProvider value={classes}>
|
|
60
|
-
<text {...ref ? { ref } : {}} className={clsx(classes.root, className)}
|
|
56
|
+
<text {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classes.root, className)}>
|
|
61
57
|
{children}
|
|
62
58
|
</text>
|
|
63
59
|
</FieldLabelClassNamesProvider>;
|
|
@@ -66,7 +62,7 @@ FieldLabel.displayName = "FieldLabel";
|
|
|
66
62
|
var FieldIndicatorText = React.forwardRef((props, ref) => {
|
|
67
63
|
const classes = useFieldLabelClassNames();
|
|
68
64
|
const { children, className, ...nativeProps } = props;
|
|
69
|
-
return <text {...ref ? { ref } : {}} className={clsx(classes.indicatorText, className)}
|
|
65
|
+
return <text {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classes.indicatorText, className)}>
|
|
70
66
|
{"\xA0"}
|
|
71
67
|
{children}
|
|
72
68
|
</text>;
|
|
@@ -75,7 +71,7 @@ FieldIndicatorText.displayName = "FieldIndicatorText";
|
|
|
75
71
|
var FieldRequiredIndicator = React.forwardRef((props, ref) => {
|
|
76
72
|
const classes = useFieldLabelClassNames();
|
|
77
73
|
const { children = "*", className, ...nativeProps } = props;
|
|
78
|
-
return <text {...ref ? { ref } : {}} accessibility-elements-hidden={true} className={clsx(classes.indicatorIcon, className)}
|
|
74
|
+
return <text {...mergeProps(ref ? { ref } : {}, nativeProps)} accessibility-elements-hidden={true} className={clsx(classes.indicatorIcon, className)}>
|
|
79
75
|
{" "}
|
|
80
76
|
{children}
|
|
81
77
|
</text>;
|
|
@@ -84,7 +80,7 @@ FieldRequiredIndicator.displayName = "FieldRequiredIndicator";
|
|
|
84
80
|
var FieldFooter = React.forwardRef((props, ref) => {
|
|
85
81
|
const classes = useFieldClassNames();
|
|
86
82
|
const { children, className, ...nativeProps } = props;
|
|
87
|
-
return <view {...ref ? { ref } : {}} className={clsx(classes.footer, className)}
|
|
83
|
+
return <view {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classes.footer, className)}>
|
|
88
84
|
{children}
|
|
89
85
|
</view>;
|
|
90
86
|
});
|
|
@@ -92,7 +88,7 @@ FieldFooter.displayName = "FieldFooter";
|
|
|
92
88
|
var FieldDescription = React.forwardRef((props, ref) => {
|
|
93
89
|
const classes = useFieldClassNames();
|
|
94
90
|
const { children, className, ...nativeProps } = props;
|
|
95
|
-
return <text {...ref ? { ref } : {}} className={clsx(classes.description, className)}
|
|
91
|
+
return <text {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classes.description, className)}>
|
|
96
92
|
{children}
|
|
97
93
|
</text>;
|
|
98
94
|
});
|
|
@@ -100,7 +96,7 @@ FieldDescription.displayName = "FieldDescription";
|
|
|
100
96
|
var FieldErrorMessage = React.forwardRef((props, ref) => {
|
|
101
97
|
const classes = useFieldClassNames();
|
|
102
98
|
const { children, className, ...nativeProps } = props;
|
|
103
|
-
return <text {...ref ? { ref } : {}} className={clsx(classes.errorMessage, className)}
|
|
99
|
+
return <text {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classes.errorMessage, className)}>
|
|
104
100
|
{children}
|
|
105
101
|
</text>;
|
|
106
102
|
});
|
|
@@ -111,7 +107,7 @@ var FieldCharacterCount = React.forwardRef((props, ref) => {
|
|
|
111
107
|
invalid: useFieldContext({ strict: true }).invalid,
|
|
112
108
|
empty: current === 0
|
|
113
109
|
});
|
|
114
|
-
return <view {...ref ? { ref } : {}} className={clsx(classes.characterCountArea, className)}
|
|
110
|
+
return <view {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classes.characterCountArea, className)}>
|
|
115
111
|
<text className={classes.characterCount}>{current}</text>
|
|
116
112
|
<text className={classes.maxCharacterCount}>/{max}</text>
|
|
117
113
|
</view>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,sBAAsB,EAAe,MAAM,aAAa,CAAC;AAC7F,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,sBAAsB,EAAe,MAAM,aAAa,CAAC;AAC7F,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGnF,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,YAAY,GAAG,YAAY,CAAC;AAIhE,UAAU,oBAAoB;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;IACnD,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAWD,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,OAAO,GACR,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;CAClB,qBAyCA;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,oBAAoB,CAAC;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,qBAEA;AAeD,wBAAgB,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,GAAG,YAAY,GAAG,IAAI,CAI1E;AAaD,MAAM,WAAW,SAAU,SAAQ,sBAAsB;IACvD,IAAI,EAAE,YAAY,CAAC,oBAAoB,CAAC,CAAC;IACzC,IAAI,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC;IACrC,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAC5B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,eAAgB,SAAQ,SAAS;CAAG;AAErD,MAAM,WAAW,eAAgB,SAAQ,SAAS;CAAG;AA2GrD,eAAO,MAAM,IAAI,2EAA8D,CAAC;AAChF,eAAO,MAAM,UAAU,iFAItB,CAAC;AACF,eAAO,MAAM,UAAU,iFAItB,CAAC;AAIF,MAAM,WAAW,iBAAkB,SAAQ,sBAAsB;IAC/D,IAAI,EAAE,YAAY,CAAC,oBAAoB,CAAC,CAAC;IACzC,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAED,eAAO,MAAM,YAAY,mFA6BvB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { mergeProps } from "../../utils/merge-props.js";
|
|
1
2
|
import { useIconColor } from "../../hooks/useIconColor.js";
|
|
2
3
|
import { handleColor, handleDimension } from "../../utils/styled.js";
|
|
3
4
|
import * as React from "@lynx-js/react";
|
|
@@ -100,7 +101,7 @@ var IconSlotBase = React.forwardRef((props, ref) => {
|
|
|
100
101
|
slot
|
|
101
102
|
]);
|
|
102
103
|
if (!hasValidIcon) return null;
|
|
103
|
-
return <view {...ref ? { ref } : {}
|
|
104
|
+
return <view {...mergeProps({ "main-thread:ref": sourceRef }, ref ? { ref } : {}, nativeProps)} className={clsx(baseClassName, slotClassName, className)} style={mergeWrapperStyle({
|
|
104
105
|
size,
|
|
105
106
|
color,
|
|
106
107
|
style
|
|
@@ -119,7 +120,7 @@ var IconSlotBase = React.forwardRef((props, ref) => {
|
|
|
119
120
|
IconSlotBase.displayName = "IconSlotBase";
|
|
120
121
|
function createIconComponent(displayName, slot, baseClassName) {
|
|
121
122
|
const Component = React.forwardRef((props, ref) => {
|
|
122
|
-
return <IconSlotBase
|
|
123
|
+
return <IconSlotBase {...mergeProps({ ref }, props)} slot={slot} baseClassName={baseClassName} />;
|
|
123
124
|
});
|
|
124
125
|
Component.displayName = displayName;
|
|
125
126
|
Component[iconSlotMarker] = slot;
|
|
@@ -137,7 +138,7 @@ var InternalIcon = React.forwardRef((props, ref) => {
|
|
|
137
138
|
...deps ?? []
|
|
138
139
|
], { sourceRef });
|
|
139
140
|
if (!isValidElement(icon)) return null;
|
|
140
|
-
return <view {...ref ? { ref } : {}
|
|
141
|
+
return <view {...mergeProps({ "main-thread:ref": sourceRef }, ref ? { ref } : {}, nativeProps)} className={className} style={style}>
|
|
141
142
|
{cloneElement(icon, {
|
|
142
143
|
...iconColor,
|
|
143
144
|
className: icon.props.className,
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { NodesRef } from '@lynx-js/types';
|
|
2
|
+
import { InputButtonVariantProps } from '@seed-design/lynx-css/recipes/input-button';
|
|
3
|
+
import { LynxAccessibilityProps, LynxPressableProps, LynxStyledElementProps } from '../../types';
|
|
4
|
+
import { InternalIconProps } from '../Icon/Icon';
|
|
5
|
+
import * as React from "@lynx-js/react";
|
|
6
|
+
/**
|
|
7
|
+
* @platform Lynx
|
|
8
|
+
*
|
|
9
|
+
* 웹 대비 미지원 기능:
|
|
10
|
+
* - `size="responsive"`: Lynx에는 CSS viewport breakpoint가 없음
|
|
11
|
+
* - HTML form 제출과 DOM ARIA id 연결
|
|
12
|
+
*/
|
|
13
|
+
export interface InputButtonRootProps extends Omit<InputButtonVariantProps, "pressed">, LynxStyledElementProps {
|
|
14
|
+
}
|
|
15
|
+
export declare const InputButtonRoot: React.ForwardRefExoticComponent<InputButtonRootProps & React.RefAttributes<NodesRef>>;
|
|
16
|
+
export interface InputButtonButtonProps extends LynxStyledElementProps, LynxPressableProps, LynxAccessibilityProps {
|
|
17
|
+
}
|
|
18
|
+
export declare const InputButtonButton: React.ForwardRefExoticComponent<InputButtonButtonProps & React.RefAttributes<unknown>>;
|
|
19
|
+
export interface InputButtonValueProps extends LynxStyledElementProps {
|
|
20
|
+
}
|
|
21
|
+
export declare const InputButtonValue: React.ForwardRefExoticComponent<InputButtonValueProps & React.RefAttributes<unknown>>;
|
|
22
|
+
export interface InputButtonPlaceholderProps extends LynxStyledElementProps {
|
|
23
|
+
}
|
|
24
|
+
export declare const InputButtonPlaceholder: React.ForwardRefExoticComponent<InputButtonPlaceholderProps & React.RefAttributes<unknown>>;
|
|
25
|
+
export interface InputButtonPrefixTextProps extends LynxStyledElementProps {
|
|
26
|
+
}
|
|
27
|
+
export declare const InputButtonPrefixText: React.ForwardRefExoticComponent<InputButtonPrefixTextProps & React.RefAttributes<unknown>>;
|
|
28
|
+
export interface InputButtonPrefixIconProps extends InternalIconProps {
|
|
29
|
+
}
|
|
30
|
+
export declare const InputButtonPrefixIcon: React.ForwardRefExoticComponent<InputButtonPrefixIconProps & React.RefAttributes<unknown>>;
|
|
31
|
+
export interface InputButtonSuffixTextProps extends LynxStyledElementProps {
|
|
32
|
+
}
|
|
33
|
+
export declare const InputButtonSuffixText: React.ForwardRefExoticComponent<InputButtonSuffixTextProps & React.RefAttributes<unknown>>;
|
|
34
|
+
export interface InputButtonSuffixIconProps extends InternalIconProps {
|
|
35
|
+
}
|
|
36
|
+
export declare const InputButtonSuffixIcon: React.ForwardRefExoticComponent<InputButtonSuffixIconProps & React.RefAttributes<unknown>>;
|
|
37
|
+
export interface InputButtonClearButtonProps extends InternalIconProps, LynxPressableProps, LynxAccessibilityProps {
|
|
38
|
+
}
|
|
39
|
+
export declare const InputButtonClearButton: React.ForwardRefExoticComponent<InputButtonClearButtonProps & React.RefAttributes<unknown>>;
|
|
40
|
+
//# sourceMapp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