@seed-design/lynx-react 0.6.2 → 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.
Files changed (236) hide show
  1. package/lib/components/Accordion/Accordion.d.ts.map +1 -1
  2. package/lib/components/Accordion/Accordion.jsx +24 -14
  3. package/lib/components/ActionButton/ActionButton.d.ts +1 -1
  4. package/lib/components/ActionButton/ActionButton.d.ts.map +1 -1
  5. package/lib/components/ActionButton/ActionButton.jsx +12 -4
  6. package/lib/components/AppBar/AppBar.d.ts.map +1 -1
  7. package/lib/components/AppBar/AppBar.jsx +9 -8
  8. package/lib/components/Badge/Badge.d.ts.map +1 -1
  9. package/lib/components/Badge/Badge.jsx +2 -1
  10. package/lib/components/BottomSheet/BottomSheet.d.ts.map +1 -1
  11. package/lib/components/BottomSheet/BottomSheet.jsx +9 -9
  12. package/lib/components/Box/Box.d.ts.map +1 -1
  13. package/lib/components/Box/Box.jsx +2 -1
  14. package/lib/components/Callout/Callout.d.ts +2 -2
  15. package/lib/components/Callout/Callout.d.ts.map +1 -1
  16. package/lib/components/Callout/Callout.jsx +20 -10
  17. package/lib/components/Checkbox/Checkbox.d.ts +4 -2
  18. package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
  19. package/lib/components/Checkbox/Checkbox.jsx +33 -17
  20. package/lib/components/Chip/Chip.d.ts +1 -1
  21. package/lib/components/Chip/Chip.d.ts.map +1 -1
  22. package/lib/components/Chip/Chip.jsx +36 -16
  23. package/lib/components/Count/Count.d.ts +7 -0
  24. package/lib/components/Count/Count.d.ts.map +1 -0
  25. package/lib/components/Count/Count.jsx +19 -0
  26. package/lib/components/Count/index.d.ts +2 -0
  27. package/lib/components/Count/index.d.ts.map +1 -0
  28. package/lib/components/Divider/Divider.d.ts.map +1 -1
  29. package/lib/components/Divider/Divider.jsx +2 -1
  30. package/lib/components/Field/Field.d.ts.map +1 -1
  31. package/lib/components/Field/Field.jsx +11 -15
  32. package/lib/components/Icon/Icon.d.ts.map +1 -1
  33. package/lib/components/Icon/Icon.jsx +4 -3
  34. package/lib/components/InputButton/InputButton.d.ts +40 -0
  35. package/lib/components/InputButton/InputButton.d.ts.map +1 -0
  36. package/lib/components/InputButton/InputButton.jsx +118 -0
  37. package/lib/components/InputButton/InputButton.namespace.d.ts +2 -0
  38. package/lib/components/InputButton/InputButton.namespace.d.ts.map +1 -0
  39. package/lib/components/InputButton/InputButton.namespace.js +16 -0
  40. package/lib/components/InputButton/index.d.ts +3 -0
  41. package/lib/components/InputButton/index.d.ts.map +1 -0
  42. package/lib/components/KeyboardAvoidingScrollView/KeyboardAvoidingScrollView.d.ts.map +1 -1
  43. package/lib/components/KeyboardAvoidingScrollView/KeyboardAvoidingScrollView.jsx +12 -8
  44. package/lib/components/List/List.d.ts +51 -0
  45. package/lib/components/List/List.d.ts.map +1 -0
  46. package/lib/components/List/List.jsx +176 -0
  47. package/lib/components/List/List.namespace.d.ts +2 -0
  48. package/lib/components/List/List.namespace.d.ts.map +1 -0
  49. package/lib/components/List/List.namespace.js +18 -0
  50. package/lib/components/List/index.d.ts +3 -0
  51. package/lib/components/List/index.d.ts.map +1 -0
  52. package/lib/components/MannerTemp/MannerTemp.d.ts.map +1 -1
  53. package/lib/components/MannerTemp/MannerTemp.jsx +3 -2
  54. package/lib/components/MannerTempBadge/MannerTempBadge.d.ts.map +1 -1
  55. package/lib/components/MannerTempBadge/MannerTempBadge.jsx +2 -1
  56. package/lib/components/Menu/Menu.d.ts +69 -0
  57. package/lib/components/Menu/Menu.d.ts.map +1 -0
  58. package/lib/components/Menu/Menu.jsx +520 -0
  59. package/lib/components/Menu/Menu.namespace.d.ts +2 -0
  60. package/lib/components/Menu/Menu.namespace.d.ts.map +1 -0
  61. package/lib/components/Menu/Menu.namespace.js +21 -0
  62. package/lib/components/Menu/index.d.ts +3 -0
  63. package/lib/components/Menu/index.d.ts.map +1 -0
  64. package/lib/components/NotificationBadge/NotificationBadge.d.ts.map +1 -1
  65. package/lib/components/NotificationBadge/NotificationBadge.jsx +3 -2
  66. package/lib/components/PageBanner/PageBanner.d.ts +5 -5
  67. package/lib/components/PageBanner/PageBanner.d.ts.map +1 -1
  68. package/lib/components/PageBanner/PageBanner.jsx +25 -14
  69. package/lib/components/ProgressCircle/ProgressCircle.d.ts +2 -2
  70. package/lib/components/ProgressCircle/ProgressCircle.d.ts.map +1 -1
  71. package/lib/components/ProgressCircle/ProgressCircle.jsx +4 -3
  72. package/lib/components/RadioGroup/RadioGroup.d.ts +5 -3
  73. package/lib/components/RadioGroup/RadioGroup.d.ts.map +1 -1
  74. package/lib/components/RadioGroup/RadioGroup.jsx +22 -9
  75. package/lib/components/ReactionButton/ReactionButton.d.ts +20 -0
  76. package/lib/components/ReactionButton/ReactionButton.d.ts.map +1 -0
  77. package/lib/components/ReactionButton/ReactionButton.jsx +88 -0
  78. package/lib/components/ReactionButton/index.d.ts +2 -0
  79. package/lib/components/ReactionButton/index.d.ts.map +1 -0
  80. package/lib/components/ScaleFeedback/ScaleFeedback.d.ts +11 -0
  81. package/lib/components/ScaleFeedback/ScaleFeedback.d.ts.map +1 -0
  82. package/lib/components/ScaleFeedback/ScaleFeedback.jsx +16 -0
  83. package/lib/components/ScaleFeedback/index.d.ts +2 -0
  84. package/lib/components/ScaleFeedback/index.d.ts.map +1 -0
  85. package/lib/components/SegmentedControl/SegmentedControl.d.ts +1 -0
  86. package/lib/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  87. package/lib/components/SegmentedControl/SegmentedControl.jsx +23 -10
  88. package/lib/components/SelectBox/SelectBox.d.ts.map +1 -1
  89. package/lib/components/SelectBox/SelectBox.jsx +23 -13
  90. package/lib/components/Stack/Stack.d.ts.map +1 -1
  91. package/lib/components/Stack/Stack.jsx +2 -1
  92. package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.d.ts +85 -0
  93. package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.d.ts.map +1 -0
  94. package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.jsx +256 -0
  95. package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.namespace.d.ts +2 -0
  96. package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.namespace.d.ts.map +1 -0
  97. package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.namespace.js +24 -0
  98. package/lib/components/SwipeableMenuSheet/index.d.ts +3 -0
  99. package/lib/components/SwipeableMenuSheet/index.d.ts.map +1 -0
  100. package/lib/components/Switch/Switch.d.ts +27 -3
  101. package/lib/components/Switch/Switch.d.ts.map +1 -1
  102. package/lib/components/Switch/Switch.jsx +22 -9
  103. package/lib/components/Tabs/Tabs.d.ts +4 -2
  104. package/lib/components/Tabs/Tabs.d.ts.map +1 -1
  105. package/lib/components/Tabs/Tabs.jsx +37 -22
  106. package/lib/components/TagGroup/TagGroup.d.ts.map +1 -1
  107. package/lib/components/TagGroup/TagGroup.jsx +4 -3
  108. package/lib/components/Text/Text.d.ts.map +1 -1
  109. package/lib/components/Text/Text.jsx +2 -1
  110. package/lib/components/TextField/TextField.d.ts.map +1 -1
  111. package/lib/components/TextField/TextField.jsx +35 -23
  112. package/lib/components/index.d.ts +7 -0
  113. package/lib/components/index.d.ts.map +1 -1
  114. package/lib/components/private/Positioning.d.ts +69 -0
  115. package/lib/components/private/Positioning.d.ts.map +1 -0
  116. package/lib/components/private/Positioning.js +109 -0
  117. package/lib/components/private/TrackPositioning.d.ts +22 -0
  118. package/lib/components/private/TrackPositioning.d.ts.map +1 -0
  119. package/lib/contexts/ScaleFeedbackContentContext.d.ts +4 -0
  120. package/lib/contexts/ScaleFeedbackContentContext.d.ts.map +1 -0
  121. package/lib/contexts/ScaleFeedbackContentContext.js +6 -0
  122. package/lib/contexts/index.d.ts +2 -0
  123. package/lib/contexts/index.d.ts.map +1 -0
  124. package/lib/hooks/index.d.ts +1 -0
  125. package/lib/hooks/index.d.ts.map +1 -1
  126. package/lib/hooks/useIconColor.d.ts.map +1 -1
  127. package/lib/hooks/useIconColor.js +8 -3
  128. package/lib/hooks/usePressTap.d.ts +4 -3
  129. package/lib/hooks/usePressTap.d.ts.map +1 -1
  130. package/lib/hooks/useScaleFeedback.d.ts +48 -0
  131. package/lib/hooks/useScaleFeedback.d.ts.map +1 -0
  132. package/lib/hooks/useScaleFeedback.js +108 -0
  133. package/lib/index.d.ts +1 -0
  134. package/lib/index.d.ts.map +1 -1
  135. package/lib/index.js +17 -3
  136. package/lib/node_modules/.bun/@floating-ui_core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.js +493 -0
  137. package/lib/node_modules/.bun/@floating-ui_utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +114 -0
  138. package/lib/utils/calculate-scale-feedback.d.ts +5 -0
  139. package/lib/utils/calculate-scale-feedback.d.ts.map +1 -0
  140. package/lib/utils/calculate-scale-feedback.js +13 -0
  141. package/lib/utils/compose-event-handlers.d.ts +5 -0
  142. package/lib/utils/compose-event-handlers.d.ts.map +1 -0
  143. package/lib/utils/compose-event-handlers.js +16 -0
  144. package/lib/utils/create-slot-recipe-context.d.ts.map +1 -1
  145. package/lib/utils/create-slot-recipe-context.jsx +6 -16
  146. package/lib/utils/index.d.ts +1 -0
  147. package/lib/utils/index.d.ts.map +1 -1
  148. package/lib/utils/merge-props.d.ts +15 -0
  149. package/lib/utils/merge-props.d.ts.map +1 -0
  150. package/lib/utils/merge-props.js +36 -0
  151. package/lib/utils/merge-refs.d.ts +8 -0
  152. package/lib/utils/merge-refs.d.ts.map +1 -0
  153. package/lib/utils/merge-refs.js +38 -0
  154. package/package.json +6 -5
  155. package/src/components/Accordion/Accordion.tsx +36 -27
  156. package/src/components/ActionButton/ActionButton.tsx +27 -12
  157. package/src/components/AppBar/AppBar.tsx +17 -18
  158. package/src/components/Badge/Badge.tsx +2 -2
  159. package/src/components/BottomSheet/BottomSheet.tsx +9 -17
  160. package/src/components/Box/Box.tsx +2 -2
  161. package/src/components/Callout/Callout.tsx +39 -22
  162. package/src/components/Checkbox/Checkbox.test.tsx +44 -0
  163. package/src/components/Checkbox/Checkbox.tsx +52 -21
  164. package/src/components/Chip/Chip.test.tsx +50 -1
  165. package/src/components/Chip/Chip.tsx +75 -31
  166. package/src/components/Count/Count.tsx +35 -0
  167. package/src/components/Count/index.ts +1 -0
  168. package/src/components/Divider/Divider.tsx +2 -2
  169. package/src/components/Field/Field.tsx +15 -28
  170. package/src/components/Icon/Icon.test.tsx +4 -6
  171. package/src/components/Icon/Icon.tsx +14 -7
  172. package/src/components/InputButton/InputButton.namespace.ts +20 -0
  173. package/src/components/InputButton/InputButton.test.tsx +82 -0
  174. package/src/components/InputButton/InputButton.tsx +295 -0
  175. package/src/components/InputButton/index.ts +2 -0
  176. package/src/components/KeyboardAvoidingScrollView/KeyboardAvoidingScrollView.tsx +16 -21
  177. package/src/components/List/List.namespace.ts +24 -0
  178. package/src/components/List/List.test.tsx +162 -0
  179. package/src/components/List/List.tsx +476 -0
  180. package/src/components/List/index.ts +3 -0
  181. package/src/components/MannerTemp/MannerTemp.tsx +3 -4
  182. package/src/components/MannerTempBadge/MannerTempBadge.tsx +2 -2
  183. package/src/components/Menu/Menu.namespace.ts +26 -0
  184. package/src/components/Menu/Menu.tsx +883 -0
  185. package/src/components/Menu/index.ts +31 -0
  186. package/src/components/NotificationBadge/NotificationBadge.tsx +4 -9
  187. package/src/components/PageBanner/PageBanner.test.tsx +3 -0
  188. package/src/components/PageBanner/PageBanner.tsx +54 -45
  189. package/src/components/ProgressCircle/ProgressCircle.test.tsx +48 -0
  190. package/src/components/ProgressCircle/ProgressCircle.tsx +22 -3
  191. package/src/components/RadioGroup/RadioGroup.test.tsx +87 -0
  192. package/src/components/RadioGroup/RadioGroup.tsx +50 -14
  193. package/src/components/ReactionButton/ReactionButton.test.tsx +122 -0
  194. package/src/components/ReactionButton/ReactionButton.tsx +139 -0
  195. package/src/components/ReactionButton/index.ts +1 -0
  196. package/src/components/ScaleFeedback/ScaleFeedback.test.tsx +41 -0
  197. package/src/components/ScaleFeedback/ScaleFeedback.tsx +32 -0
  198. package/src/components/ScaleFeedback/index.ts +1 -0
  199. package/src/components/SegmentedControl/SegmentedControl.test.tsx +15 -3
  200. package/src/components/SegmentedControl/SegmentedControl.tsx +35 -14
  201. package/src/components/SelectBox/SelectBox.test.tsx +39 -1
  202. package/src/components/SelectBox/SelectBox.tsx +27 -16
  203. package/src/components/Stack/Stack.tsx +2 -2
  204. package/src/components/SwipeableMenuSheet/SwipeableMenuSheet.namespace.ts +37 -0
  205. package/src/components/SwipeableMenuSheet/SwipeableMenuSheet.test.tsx +258 -0
  206. package/src/components/SwipeableMenuSheet/SwipeableMenuSheet.tsx +655 -0
  207. package/src/components/SwipeableMenuSheet/index.ts +43 -0
  208. package/src/components/Switch/Switch.test.tsx +57 -0
  209. package/src/components/Switch/Switch.tsx +60 -16
  210. package/src/components/Tabs/Tabs.test.tsx +19 -0
  211. package/src/components/Tabs/Tabs.tsx +72 -40
  212. package/src/components/TagGroup/TagGroup.tsx +4 -6
  213. package/src/components/Text/Text.tsx +2 -2
  214. package/src/components/TextField/TextField.tsx +60 -54
  215. package/src/components/index.ts +7 -0
  216. package/src/components/private/Positioning.test.ts +235 -0
  217. package/src/components/private/Positioning.ts +223 -0
  218. package/src/components/private/TrackPositioning.test.ts +58 -0
  219. package/src/components/private/TrackPositioning.ts +37 -0
  220. package/src/contexts/ScaleFeedbackContentContext.ts +4 -0
  221. package/src/contexts/index.ts +1 -0
  222. package/src/hooks/index.ts +1 -0
  223. package/src/hooks/useIconColor.test.ts +4 -4
  224. package/src/hooks/useIconColor.ts +13 -6
  225. package/src/hooks/usePressTap.ts +4 -3
  226. package/src/hooks/useScaleFeedback.integration.test.tsx +85 -0
  227. package/src/hooks/useScaleFeedback.test.ts +50 -0
  228. package/src/hooks/useScaleFeedback.ts +199 -0
  229. package/src/index.ts +1 -0
  230. package/src/utils/calculate-scale-feedback.ts +12 -0
  231. package/src/utils/compose-event-handlers.ts +16 -0
  232. package/src/utils/create-slot-recipe-context.tsx +6 -7
  233. package/src/utils/index.ts +1 -0
  234. package/src/utils/merge-props.test.tsx +152 -0
  235. package/src/utils/merge-props.ts +62 -0
  236. package/src/utils/merge-refs.ts +44 -0
@@ -1,5 +1,7 @@
1
+ import { mergeProps } from "../../utils/merge-props.js";
1
2
  import { createSlotRecipeContext } from "../../utils/create-slot-recipe-context.jsx";
2
3
  import { IconSlotProvider, InternalIcon } from "../Icon/Icon.jsx";
4
+ import { ScaleFeedbackContentContext } from "../../contexts/ScaleFeedbackContentContext.js";
3
5
  import { CheckboxRoot, useCheckboxContext } from "../Checkbox/Checkbox.jsx";
4
6
  import { RadioGroupItem, useRadioGroupItemContext } from "../RadioGroup/RadioGroup.jsx";
5
7
  import * as React from "@lynx-js/react";
@@ -36,7 +38,11 @@ function SelectBoxSurface({ children, className, style, accessibilityProps }) {
36
38
  ]
37
39
  }}>
38
40
  <view className={clsx(classes.root, className)} style={style} accessibility-element={true} accessibility-role-description={context.accessibilityRole} accessibility-value={context.selected ? "selected" : "not selected"} accessibility-traits={context.disabled ? "disabled" : void 0} {...accessibilityProps}>
39
- {children}
41
+ <view className={classes.scaleContent} {...context.scaleFeedbackTargetProps}>
42
+ <ScaleFeedbackContentContext.Provider value={true}>
43
+ {children}
44
+ </ScaleFeedbackContentContext.Provider>
45
+ </view>
40
46
  <view className={classes.selectedStroke} accessibility-elements-hidden={true} />
41
47
  </view>
42
48
  </IconSlotProvider>
@@ -47,10 +53,10 @@ var SelectBoxGroup = React.forwardRef((props, ref) => {
47
53
  const classes = selectBoxGroup({ multiColumn: columns > 1 });
48
54
  const layout = columns > 1 ? "vertical" : "horizontal";
49
55
  return <SelectBoxLayoutContext.Provider value={{ layout }}>
50
- <view {...ref ? { ref } : {}} className={clsx(classes, className)} style={{
56
+ <view {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classes, className)} style={{
51
57
  ...style,
52
58
  gridTemplateColumns: `repeat(${columns}, 1fr)`
53
- }} {...nativeProps}>
59
+ }}>
54
60
  {children}
55
61
  </view>
56
62
  </SelectBoxLayoutContext.Provider>;
@@ -66,11 +72,13 @@ function CheckSelectBoxSurface(props) {
66
72
  disabled: checkbox.disabled,
67
73
  footerVisibility: props.footerVisibility,
68
74
  variantProps: props.variantProps,
69
- accessibilityRole: "checkbox"
75
+ accessibilityRole: "checkbox",
76
+ scaleFeedbackTargetProps: checkbox.scaleFeedbackTargetProps
70
77
  }), [
71
78
  checkbox.checked,
72
79
  checkbox.disabled,
73
80
  checkbox.pressed,
81
+ checkbox.scaleFeedbackTargetProps,
74
82
  props.footerVisibility,
75
83
  props.variantProps
76
84
  ]);
@@ -102,11 +110,13 @@ function RadioSelectBoxSurface(props) {
102
110
  disabled: item.disabled,
103
111
  footerVisibility: props.footerVisibility,
104
112
  variantProps: props.variantProps,
105
- accessibilityRole: "radio"
113
+ accessibilityRole: "radio",
114
+ scaleFeedbackTargetProps: item.scaleFeedbackTargetProps
106
115
  }), [
107
116
  item.checked,
108
117
  item.disabled,
109
118
  item.pressed,
119
+ item.scaleFeedbackTargetProps,
110
120
  props.footerVisibility,
111
121
  props.variantProps
112
122
  ]);
@@ -134,7 +144,7 @@ function createViewSlot(displayName, slot) {
134
144
  const Component = React.forwardRef((props, ref) => {
135
145
  const { children, className, ...nativeProps } = props;
136
146
  const classes = useClassNames();
137
- return <view {...ref ? { ref } : {}} className={clsx(classes[slot], className)} {...nativeProps}>
147
+ return <view {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classes[slot], className)}>
138
148
  {children}
139
149
  </view>;
140
150
  });
@@ -145,7 +155,7 @@ function createTextSlot(displayName, slot) {
145
155
  const Component = React.forwardRef((props, ref) => {
146
156
  const { children, className, ...nativeProps } = props;
147
157
  const classes = useClassNames();
148
- return <text {...ref ? { ref } : {}} className={clsx(classes[slot], className)} {...nativeProps}>
158
+ return <text {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classes[slot], className)}>
149
159
  {children}
150
160
  </text>;
151
161
  });
@@ -157,7 +167,7 @@ function createLabelSlot(displayName) {
157
167
  const { children, className, ...nativeProps } = props;
158
168
  const classes = useClassNames();
159
169
  const labelChildren = typeof children === "string" || typeof children === "number" ? <text>{children}</text> : children;
160
- return <view {...ref ? { ref } : {}} className={clsx(classes.label, className)} {...nativeProps}>
170
+ return <view {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classes.label, className)}>
161
171
  {labelChildren}
162
172
  </view>;
163
173
  });
@@ -190,10 +200,10 @@ var SelectBoxFooter = React.forwardRef((props, ref) => {
190
200
  const height = getFooterLayoutHeight(event);
191
201
  if (height !== null) setContentHeight((current) => current === height ? current : height);
192
202
  }, []);
193
- return <view {...ref ? { ref } : {}} className={clsx(classes.footer, className)} style={{
203
+ return <view {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classes.footer, className)} style={{
194
204
  ...style,
195
205
  height: context.footerVisibility === "always" || open && contentHeight === 0 ? "auto" : open ? `${contentHeight}px` : "0px"
196
- }} accessibility-elements-hidden={!open || accessibilityElementsHidden} {...nativeProps}>
206
+ }} accessibility-elements-hidden={!open || accessibilityElementsHidden}>
197
207
  <view className={classes.footerInner} bindlayoutchange={handleLayoutChange}>
198
208
  {children}
199
209
  </view>
@@ -216,7 +226,7 @@ var CheckSelectBoxCheckmarkControl = React.forwardRef((props, ref) => {
216
226
  iconClassName: classes.icon,
217
227
  variantProps
218
228
  }}>
219
- <view {...ref ? { ref } : {}} className={clsx(classes.root, className)} accessibility-elements-hidden={true} {...nativeProps}>
229
+ <view {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classes.root, className)} accessibility-elements-hidden={true}>
220
230
  {children}
221
231
  </view>
222
232
  </SelectBoxCheckmarkContext.Provider>;
@@ -226,11 +236,11 @@ var CheckSelectBoxCheckmarkIcon = React.forwardRef((props, ref) => {
226
236
  const { className, ...otherProps } = props;
227
237
  const context = React.useContext(SelectBoxCheckmarkContext);
228
238
  if (!context) throw new Error("<CheckSelectBoxCheckmarkIcon/> must be rendered inside <CheckSelectBoxCheckmarkControl/>.");
229
- return <InternalIcon ref={ref} className={clsx(context.iconClassName, className)} deps={[
239
+ return <InternalIcon {...mergeProps({ ref }, otherProps)} className={clsx(context.iconClassName, className)} deps={[
230
240
  context.variantProps.selected,
231
241
  context.variantProps.pressed,
232
242
  context.variantProps.disabled
233
- ]} {...otherProps} />;
243
+ ]} />;
234
244
  });
235
245
  CheckSelectBoxCheckmarkIcon.displayName = "CheckSelectBoxCheckmarkIcon";
236
246
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"Stack.d.ts","sourceRoot":"","sources":["../../../src/components/Stack/Stack.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAExC,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAe,MAAM,aAAa,CAAC;AAC3F,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEpE,KAAK,eAAe,GAChB,SAAS,GACT,eAAe,GACf,YAAY,GACZ,gBAAgB,GAChB,UAAU,GACV,UAAU,GACV,YAAY,CAAC;AAEjB,UAAU,cAAe,SAAQ,UAAU,EAAE,sBAAsB,EAAE,kBAAkB;IACrF,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC;IACvE,KAAK,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;IAC3C,IAAI,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IAClC,IAAI,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IAClC,MAAM,CAAC,EAAE,cAAc,CA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EAIjB,CAAC;AAIH,eAAO,MAAM,MAAM,6EAIjB,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { mergeProps } from "../../utils/merge-props.js";
1
2
  import { useStyleProps } from "../../utils/styled.js";
2
3
  import * as React from "@lynx-js/react";
3
4
  import clsx from "clsx";
@@ -32,7 +33,7 @@ function useStackStyleProps(props, flexDirection) {
32
33
  function renderStackView(stackStyleProps, ref) {
33
34
  const { style, restProps } = stackStyleProps;
34
35
  const { children, className, ...nativeProps } = restProps;
35
- return <view {...ref ? { ref } : {}} {...nativeProps} className={clsx(className)} style={style}>
36
+ return <view {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(className)} style={style}>
36
37
  {children}
37
38
  </view>;
38
39
  }
@@ -0,0 +1,85 @@
1
+ import { MenuSheetVariantProps } from '@seed-design/lynx-css/recipes/menu-sheet';
2
+ import { MenuSheetItemVariantProps } from '@seed-design/lynx-css/recipes/menu-sheet-item';
3
+ import { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes } from '@lynx-js/react';
4
+ import { LynxAccessibilityProps, LynxPressableProps, LynxStyledElementProps } from '../../types';
5
+ import { BottomSheetBackdropProps, BottomSheetContentProps, BottomSheetHandleProps, BottomSheetPositionerProps, BottomSheetRootProps, BottomSheetRootRef } from '../BottomSheet/BottomSheet';
6
+ import * as React from "@lynx-js/react";
7
+ type LynxForwardRefComponent<T, P> = ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<T>>;
8
+ export type SwipeableMenuSheetCloseReason = "trigger" | "closeButton" | "interactOutside" | "drag";
9
+ export interface SwipeableMenuSheetOpenChangeDetails {
10
+ reason: SwipeableMenuSheetCloseReason;
11
+ }
12
+ export type SwipeableMenuSheetRootRef = BottomSheetRootRef;
13
+ export interface SwipeableMenuSheetRootProps extends Omit<BottomSheetRootProps, "open" | "defaultOpen" | "onOpenChange" | "side" | "snapPoints" | "headerAlign" | "skipAnimation">, Omit<MenuSheetVariantProps, "closeButtonPressed"> {
14
+ open?: boolean;
15
+ defaultOpen?: boolean;
16
+ onOpenChange?: (open: boolean, details: SwipeableMenuSheetOpenChangeDetails) => void;
17
+ }
18
+ /**
19
+ * A bottom-only, fit-height menu sheet backed by the Lynx BottomSheet engine.
20
+ */
21
+ export declare const SwipeableMenuSheetRoot: LynxForwardRefComponent<BottomSheetRootRef, SwipeableMenuSheetRootProps>;
22
+ export interface SwipeableMenuSheetTriggerProps extends LynxStyledElementProps, LynxAccessibilityProps, Pick<LynxPressableProps, "bindtap"> {
23
+ }
24
+ export declare const SwipeableMenuSheetTrigger: LynxForwardRefComponent<unknown, SwipeableMenuSheetTriggerProps>;
25
+ export interface SwipeableMenuSheetPositionerProps extends BottomSheetPositionerProps {
26
+ }
27
+ export declare const SwipeableMenuSheetPositioner: LynxForwardRefComponent<unknown, SwipeableMenuSheetPositionerProps>;
28
+ export interface SwipeableMenuSheetBackdropProps extends BottomSheetBackdropProps {
29
+ }
30
+ export declare function SwipeableMenuSheetBackdrop(props: SwipeableMenuSheetBackdropProps): React.JSX.Element;
31
+ export declare namespace SwipeableMenuSheetBackdrop {
32
+ var displayName: string;
33
+ }
34
+ export interface SwipeableMenuSheetContentProps extends BottomSheetContentProps, LynxAccessibilityProps {
35
+ labelAlign?: SwipeableMenuSheetLabelAlign;
36
+ }
37
+ export declare const SwipeableMenuSheetContent: LynxForwardRefComponent<unknown, SwipeableMenuSheetContentProps>;
38
+ export interface SwipeableMenuSheetHandleProps extends BottomSheetHandleProps {
39
+ }
40
+ export declare function SwipeableMenuSheetHandle(props: SwipeableMenuSheetHandleProps): React.JSX.Element;
41
+ export declare namespace SwipeableMenuSheetHandle {
42
+ var displayName: string;
43
+ }
44
+ export interface SwipeableMenuSheetSlotProps extends LynxStyledElementProps {
45
+ }
46
+ export interface SwipeableMenuSheetHeaderProps extends SwipeableMenuSheetSlotProps {
47
+ }
48
+ export declare const SwipeableMenuSheetHeader: LynxForwardRefComponent<unknown, SwipeableMenuSheetSlotProps>;
49
+ export interface SwipeableMenuSheetTitleProps extends SwipeableMenuSheetSlotProps {
50
+ }
51
+ export declare const SwipeableMenuSheetTitle: LynxForwardRefComponent<unknown, SwipeableMenuSheetSlotProps>;
52
+ export interface SwipeableMenuSheetDescriptionProps extends SwipeableMenuSheetSlotProps {
53
+ }
54
+ export declare const SwipeableMenuSheetDescription: LynxForwardRefComponent<unknown, SwipeableMenuSheetSlotProps>;
55
+ export interface SwipeableMenuSheetListProps extends SwipeableMenuSheetSlotProps {
56
+ }
57
+ export declare const SwipeableMenuSheetList: LynxForwardRefComponent<unknown, SwipeableMenuSheetSlotProps>;
58
+ export type SwipeableMenuSheetLabelAlign = "left" | "center";
59
+ export interface SwipeableMenuSheetGroupProps extends SwipeableMenuSheetSlotProps {
60
+ labelAlign?: SwipeableMenuSheetLabelAlign;
61
+ }
62
+ export declare const SwipeableMenuSheetGroup: LynxForwardRefComponent<unknown, SwipeableMenuSheetGroupProps>;
63
+ export interface SwipeableMenuSheetFooterProps extends SwipeableMenuSheetSlotProps {
64
+ }
65
+ export declare const SwipeableMenuSheetFooter: LynxForwardRefComponent<unknown, SwipeableMenuSheetSlotProps>;
66
+ export interface SwipeableMenuSheetCloseButtonProps extends LynxStyledElementProps, LynxAccessibilityProps, LynxPressableProps {
67
+ }
68
+ export declare const SwipeableMenuSheetCloseButton: LynxForwardRefComponent<unknown, SwipeableMenuSheetCloseButtonProps>;
69
+ export type SwipeableMenuSheetItemTone = NonNullable<MenuSheetItemVariantProps["tone"]>;
70
+ export interface SwipeableMenuSheetItemProps extends LynxStyledElementProps, LynxAccessibilityProps, LynxPressableProps {
71
+ tone?: SwipeableMenuSheetItemTone;
72
+ labelAlign?: SwipeableMenuSheetLabelAlign;
73
+ }
74
+ export declare const SwipeableMenuSheetItem: LynxForwardRefComponent<unknown, SwipeableMenuSheetItemProps>;
75
+ export interface SwipeableMenuSheetItemContentProps extends LynxStyledElementProps {
76
+ }
77
+ export declare const SwipeableMenuSheetItemContent: LynxForwardRefComponent<unknown, SwipeableMenuSheetItemContentProps>;
78
+ export interface SwipeableMenuSheetItemLabelProps extends LynxStyledElementProps {
79
+ }
80
+ export declare const SwipeableMenuSheetItemLabel: LynxForwardRefComponent<unknown, SwipeableMenuSheetItemLabelProps>;
81
+ export interface SwipeableMenuSheetItemDescriptionProps extends LynxStyledElementProps {
82
+ }
83
+ export declare const SwipeableMenuSheetItemDescription: LynxForwardRefComponent<unknown, SwipeableMenuSheetItemDescriptionProps>;
84
+ export {};
85
+ //# sourceMappingURL=SwipeableMenuSheet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SwipeableMenuSheet.d.ts","sourceRoot":"","sources":["../../../src/components/SwipeableMenuSheet/SwipeableMenuSheet.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAEtF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC/F,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAExC,OAAO,KAAK,EAAE,yBAAyB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAKhG,OAAO,KAAK,EACV,sBAAsB,EACtB,kBAAkB,EAClB,sBAAsB,EAGvB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAML,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACxB,MAAM,4BAA4B,CAAC;AAGpC,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,yBAAyB,CAC5D,eAAe,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CACtC,CAAC;AA8BF,MAAM,MAAM,6BAA6B,GAAG,SAAS,GAAG,aAAa,GAAG,iBAAiB,GAAG,MAAM,CAAC;AAEnG,MAAM,WAAW,mCAAmC;IAClD,MAAM,EAAE,6BAA6B,CAA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AC;AAGL,MAAM,WAAW,kCAAmC,SAAQ,sBAAsB;CAAG;AAErF,eAAO,MAAM,6BAA6B,EAAE,uBAAuB,CACjE,OAAO,EACP,kCAAkC,CAclC,CAAC;AAGH,MAAM,WAAW,gCAAiC,SAAQ,sBAAsB;CAAG;AAEnF,eAAO,MAAM,2BAA2B,EAAE,uBAAuB,CAC/D,OAAO,EACP,gCAAgC,CAchC,CAAC;AAGH,MAAM,WAAW,sCAAuC,SAAQ,sBAAsB;CAAG;AAEzF,eAAO,MAAM,iCAAiC,EAAE,uBAAuB,CACrE,OAAO,EACP,sCAAsC,CActC,CAAC"}
@@ -0,0 +1,256 @@
1
+ import { usePressTap } from "../../hooks/usePressTap.js";
2
+ import { toArray } from "../../utils/children.js";
3
+ import { createSlotRecipeContext } from "../../utils/create-slot-recipe-context.jsx";
4
+ import { useSafeArea } from "../../hooks/useSafeArea.js";
5
+ import { IconSlotProvider } from "../Icon/Icon.jsx";
6
+ import { BottomSheetBackdrop, BottomSheetContent, BottomSheetHandle, BottomSheetPositioner, BottomSheetRoot } from "../BottomSheet/BottomSheet.jsx";
7
+ import * as React from "@lynx-js/react";
8
+ import { forwardRef, isValidElement } from "@lynx-js/react";
9
+ import clsx from "clsx";
10
+ import { menuSheet } from "@seed-design/lynx-css/recipes/menu-sheet";
11
+ import { menuSheetItem } from "@seed-design/lynx-css/recipes/menu-sheet-item";
12
+ //#region src/components/SwipeableMenuSheet/SwipeableMenuSheet.tsx
13
+ var { ClassNamesProvider, useClassNames } = createSlotRecipeContext(menuSheet);
14
+ var CONTENT_PADDING_BOTTOM = "16px";
15
+ var SwipeableMenuSheetContext = React.createContext(null);
16
+ var ContentLabelAlignContext = React.createContext(void 0);
17
+ var GroupLabelAlignContext = React.createContext(void 0);
18
+ var SwipeableMenuSheetItemPositionContext = React.createContext({ isLast: true });
19
+ function useSwipeableMenuSheetContext() {
20
+ const context = React.useContext(SwipeableMenuSheetContext);
21
+ if (!context) throw new Error("SwipeableMenuSheet compound components must be used within SwipeableMenuSheetRoot.");
22
+ return context;
23
+ }
24
+ function closeSheet(rootRef, skipAnimation) {
25
+ if (skipAnimation) rootRef.current?.close({ animate: false });
26
+ else rootRef.current?.close();
27
+ }
28
+ /**
29
+ * A bottom-only, fit-height menu sheet backed by the Lynx BottomSheet engine.
30
+ */
31
+ var SwipeableMenuSheetRoot = forwardRef((props, forwardedRef) => {
32
+ const [variantProps, restProps] = menuSheet.splitVariantProps(props);
33
+ const { open, defaultOpen, onOpenChange, children, ...nativeProps } = restProps;
34
+ const skipAnimation = variantProps.skipAnimation === true;
35
+ const internalRef = React.useRef(null);
36
+ const pendingReasonRef = React.useRef(null);
37
+ const mergedRef = React.useCallback((value) => {
38
+ internalRef.current = value;
39
+ if (typeof forwardedRef === "function") forwardedRef(value);
40
+ else if (forwardedRef) forwardedRef.current = value;
41
+ }, [forwardedRef]);
42
+ const setPendingReason = React.useCallback((reason) => {
43
+ pendingReasonRef.current = reason;
44
+ }, []);
45
+ const handleShowChange = React.useCallback((nextOpen) => {
46
+ const reason = pendingReasonRef.current ?? "drag";
47
+ pendingReasonRef.current = null;
48
+ onOpenChange?.(nextOpen, { reason });
49
+ }, [onOpenChange]);
50
+ const classNames = React.useMemo(() => menuSheet({ skipAnimation }), [skipAnimation]);
51
+ const context = React.useMemo(() => ({
52
+ rootRef: internalRef,
53
+ skipAnimation,
54
+ setPendingReason
55
+ }), [setPendingReason, skipAnimation]);
56
+ return <SwipeableMenuSheetContext.Provider value={context}>
57
+ <ClassNamesProvider value={classNames}>
58
+ <BottomSheetRoot {...nativeProps} ref={mergedRef} open={open} defaultOpen={defaultOpen} side="bottom" snapPoints={["fit"]} skipAnimation={skipAnimation} onOpenChange={handleShowChange}>
59
+ {children}
60
+ </BottomSheetRoot>
61
+ </ClassNamesProvider>
62
+ </SwipeableMenuSheetContext.Provider>;
63
+ });
64
+ SwipeableMenuSheetRoot.displayName = "SwipeableMenuSheetRoot";
65
+ var SwipeableMenuSheetTrigger = forwardRef((props, ref) => {
66
+ const { children, className, style, bindtap: userBindtap, "accessibility-element": accessibilityElement = true, "accessibility-label": accessibilityLabel, "accessibility-role-description": accessibilityRoleDescription = "button", "accessibility-traits": accessibilityTraits, "accessibility-value": accessibilityValue, "accessibility-elements-hidden": accessibilityElementsHidden, "accessibility-heading": accessibilityHeading, "accessibility-actions": accessibilityActions, "accessibility-exclusive-focus": accessibilityExclusiveFocus, "ios-platform-accessibility-id": iosPlatformAccessibilityId } = props;
67
+ const { rootRef, setPendingReason, skipAnimation } = useSwipeableMenuSheetContext();
68
+ const handleTap = (event, instance) => {
69
+ setPendingReason("trigger");
70
+ if (skipAnimation) rootRef.current?.open({ animate: false });
71
+ else rootRef.current?.open();
72
+ userBindtap?.(event, instance);
73
+ };
74
+ return <view {...ref ? { ref } : {}} bindtap={handleTap} className={className} style={style} accessibility-element={accessibilityElement} accessibility-label={accessibilityLabel} accessibility-role-description={accessibilityRoleDescription} accessibility-traits={accessibilityTraits} accessibility-value={accessibilityValue} accessibility-elements-hidden={accessibilityElementsHidden} accessibility-heading={accessibilityHeading} accessibility-actions={accessibilityActions} accessibility-exclusive-focus={accessibilityExclusiveFocus} ios-platform-accessibility-id={iosPlatformAccessibilityId}>
75
+ {children}
76
+ </view>;
77
+ });
78
+ SwipeableMenuSheetTrigger.displayName = "SwipeableMenuSheetTrigger";
79
+ var SwipeableMenuSheetPositioner = forwardRef((props, ref) => {
80
+ const classNames = useClassNames();
81
+ return <BottomSheetPositioner {...ref ? { ref } : {}} {...props} className={clsx(classNames.positioner, props.className)} />;
82
+ });
83
+ SwipeableMenuSheetPositioner.displayName = "SwipeableMenuSheetPositioner";
84
+ function SwipeableMenuSheetBackdrop(props) {
85
+ const { children, className, clickToClose = true, onClick: userOnClick, ...nativeProps } = props;
86
+ const classNames = useClassNames();
87
+ const { rootRef, setPendingReason, skipAnimation } = useSwipeableMenuSheetContext();
88
+ const handleClick = React.useCallback(() => {
89
+ if (clickToClose) {
90
+ setPendingReason("interactOutside");
91
+ closeSheet(rootRef, skipAnimation);
92
+ }
93
+ userOnClick?.();
94
+ }, [
95
+ clickToClose,
96
+ rootRef,
97
+ setPendingReason,
98
+ skipAnimation,
99
+ userOnClick
100
+ ]);
101
+ return <BottomSheetBackdrop {...nativeProps} className={clsx(classNames.backdrop, className)} clickToClose={false} onClick={handleClick}>
102
+ {children}
103
+ </BottomSheetBackdrop>;
104
+ }
105
+ SwipeableMenuSheetBackdrop.displayName = "SwipeableMenuSheetBackdrop";
106
+ var SwipeableMenuSheetContent = forwardRef((props, ref) => {
107
+ const { children, className, innerClassName, innerStyle, labelAlign, ...contentProps } = props;
108
+ const classNames = useClassNames();
109
+ const { safeAreaInsetBottom } = useSafeArea();
110
+ return <ContentLabelAlignContext.Provider value={labelAlign}>
111
+ <BottomSheetContent {...ref ? { ref } : {}} {...contentProps} className={clsx(classNames.content, className)} innerClassName={clsx(classNames.contentInner, innerClassName)} innerStyle={{
112
+ paddingBottom: `calc(${CONTENT_PADDING_BOTTOM} + ${safeAreaInsetBottom})`,
113
+ ...innerStyle
114
+ }}>
115
+ {children}
116
+ </BottomSheetContent>
117
+ </ContentLabelAlignContext.Provider>;
118
+ });
119
+ SwipeableMenuSheetContent.displayName = "SwipeableMenuSheetContent";
120
+ function SwipeableMenuSheetHandle(props) {
121
+ return <BottomSheetHandle {...props} />;
122
+ }
123
+ SwipeableMenuSheetHandle.displayName = "SwipeableMenuSheetHandle";
124
+ function createViewSlot(slotName) {
125
+ return forwardRef((props, ref) => {
126
+ const { children, className, style } = props;
127
+ const classNames = useClassNames();
128
+ return <view {...ref ? { ref } : {}} className={clsx(classNames[slotName], className)} style={style}>
129
+ {children}
130
+ </view>;
131
+ });
132
+ }
133
+ function createTextSlot(slotName) {
134
+ return forwardRef((props, ref) => {
135
+ const { children, className, style } = props;
136
+ const classNames = useClassNames();
137
+ return <text {...ref ? { ref } : {}} className={clsx(classNames[slotName], className)} style={style}>
138
+ {children}
139
+ </text>;
140
+ });
141
+ }
142
+ var SwipeableMenuSheetHeader = createViewSlot("header");
143
+ SwipeableMenuSheetHeader.displayName = "SwipeableMenuSheetHeader";
144
+ var SwipeableMenuSheetTitle = createTextSlot("title");
145
+ SwipeableMenuSheetTitle.displayName = "SwipeableMenuSheetTitle";
146
+ var SwipeableMenuSheetDescription = createTextSlot("description");
147
+ SwipeableMenuSheetDescription.displayName = "SwipeableMenuSheetDescription";
148
+ var SwipeableMenuSheetList = createViewSlot("list");
149
+ SwipeableMenuSheetList.displayName = "SwipeableMenuSheetList";
150
+ var SwipeableMenuSheetGroup = forwardRef((props, ref) => {
151
+ const { children, className, style, labelAlign } = props;
152
+ const classNames = useClassNames();
153
+ const contentLabelAlign = React.useContext(ContentLabelAlignContext);
154
+ const resolvedLabelAlign = labelAlign ?? contentLabelAlign;
155
+ const items = toArray(children);
156
+ return <GroupLabelAlignContext.Provider value={resolvedLabelAlign}>
157
+ <view {...ref ? { ref } : {}} className={clsx(classNames.group, className)} style={style}>
158
+ {items.map((item, index) => <SwipeableMenuSheetItemPositionContext.Provider key={isValidElement(item) ? item.key ?? index : index} value={{ isLast: index === items.length - 1 }}>
159
+ {item}
160
+ </SwipeableMenuSheetItemPositionContext.Provider>)}
161
+ </view>
162
+ </GroupLabelAlignContext.Provider>;
163
+ });
164
+ SwipeableMenuSheetGroup.displayName = "SwipeableMenuSheetGroup";
165
+ var SwipeableMenuSheetFooter = createViewSlot("footer");
166
+ SwipeableMenuSheetFooter.displayName = "SwipeableMenuSheetFooter";
167
+ var SwipeableMenuSheetCloseButton = forwardRef((props, ref) => {
168
+ const { children, className, style, bindtap: userBindtap, "main-thread:bindtap": userMainThreadBindtap, "accessibility-element": accessibilityElement = true, "accessibility-label": accessibilityLabel = "Close", "accessibility-role-description": accessibilityRoleDescription = "button", "accessibility-traits": accessibilityTraits, "accessibility-value": accessibilityValue, "accessibility-elements-hidden": accessibilityElementsHidden, "accessibility-heading": accessibilityHeading, "accessibility-actions": accessibilityActions, "accessibility-exclusive-focus": accessibilityExclusiveFocus, "ios-platform-accessibility-id": iosPlatformAccessibilityId } = props;
169
+ const { rootRef, setPendingReason, skipAnimation } = useSwipeableMenuSheetContext();
170
+ const { pressed, ...pressHandlers } = usePressTap({
171
+ onTap: React.useCallback((event, instance) => {
172
+ setPendingReason("closeButton");
173
+ closeSheet(rootRef, skipAnimation);
174
+ userBindtap?.(event, instance);
175
+ }, [
176
+ rootRef,
177
+ setPendingReason,
178
+ skipAnimation,
179
+ userBindtap
180
+ ]),
181
+ mainThreadOnTap: userMainThreadBindtap
182
+ });
183
+ const classNames = menuSheet({
184
+ skipAnimation,
185
+ closeButtonPressed: pressed
186
+ });
187
+ return <view {...ref ? { ref } : {}} {...pressHandlers} className={clsx(classNames.closeButton, className)} style={style} accessibility-element={accessibilityElement} accessibility-label={accessibilityLabel} accessibility-role-description={accessibilityRoleDescription} accessibility-traits={accessibilityTraits} accessibility-value={accessibilityValue} accessibility-elements-hidden={accessibilityElementsHidden} accessibility-heading={accessibilityHeading} accessibility-actions={accessibilityActions} accessibility-exclusive-focus={accessibilityExclusiveFocus} ios-platform-accessibility-id={iosPlatformAccessibilityId}>
188
+ <text className={classNames.closeButtonLabel}>{children}</text>
189
+ </view>;
190
+ });
191
+ SwipeableMenuSheetCloseButton.displayName = "SwipeableMenuSheetCloseButton";
192
+ var SwipeableMenuSheetItemContext = React.createContext(null);
193
+ function useSwipeableMenuSheetItemContext() {
194
+ const context = React.useContext(SwipeableMenuSheetItemContext);
195
+ if (!context) throw new Error("SwipeableMenuSheet item slots must be used within SwipeableMenuSheetItem.");
196
+ return context;
197
+ }
198
+ var SwipeableMenuSheetItem = forwardRef((props, ref) => {
199
+ const { children, className, style, tone = "neutral", labelAlign, bindtap: userBindtap, "main-thread:bindtap": userMainThreadBindtap, "accessibility-element": accessibilityElement = true, "accessibility-role-description": accessibilityRoleDescription = "button", "accessibility-label": accessibilityLabel, "accessibility-traits": accessibilityTraits, "accessibility-value": accessibilityValue, "accessibility-elements-hidden": accessibilityElementsHidden, "accessibility-heading": accessibilityHeading, "accessibility-actions": accessibilityActions, "accessibility-exclusive-focus": accessibilityExclusiveFocus, "ios-platform-accessibility-id": iosPlatformAccessibilityId } = props;
200
+ const groupLabelAlign = React.useContext(GroupLabelAlignContext);
201
+ const contentLabelAlign = React.useContext(ContentLabelAlignContext);
202
+ const { isLast } = React.useContext(SwipeableMenuSheetItemPositionContext);
203
+ const resolvedLabelAlign = labelAlign ?? groupLabelAlign ?? contentLabelAlign ?? "left";
204
+ const { pressed, ...pressHandlers } = usePressTap({
205
+ onTap: userBindtap,
206
+ mainThreadOnTap: userMainThreadBindtap
207
+ });
208
+ const classNames = menuSheetItem({
209
+ tone,
210
+ labelAlign: resolvedLabelAlign,
211
+ pressed
212
+ });
213
+ const itemContext = React.useMemo(() => ({ classNames }), [classNames]);
214
+ return <SwipeableMenuSheetItemContext.Provider value={itemContext}>
215
+ <IconSlotProvider value={{
216
+ classNames: { prefixIcon: classNames.prefixIcon },
217
+ deps: [
218
+ tone,
219
+ resolvedLabelAlign,
220
+ pressed
221
+ ]
222
+ }}>
223
+ <view {...ref ? { ref } : {}} {...pressHandlers} className={clsx(classNames.root, className)} style={style} accessibility-element={accessibilityElement} accessibility-label={accessibilityLabel} accessibility-role-description={accessibilityRoleDescription} accessibility-traits={accessibilityTraits} accessibility-value={accessibilityValue} accessibility-elements-hidden={accessibilityElementsHidden} accessibility-heading={accessibilityHeading} accessibility-actions={accessibilityActions} accessibility-exclusive-focus={accessibilityExclusiveFocus} ios-platform-accessibility-id={iosPlatformAccessibilityId}>
224
+ {children}
225
+ </view>
226
+ {!isLast ? <view className={classNames.divider} accessibility-elements-hidden={true} /> : null}
227
+ </IconSlotProvider>
228
+ </SwipeableMenuSheetItemContext.Provider>;
229
+ });
230
+ SwipeableMenuSheetItem.displayName = "SwipeableMenuSheetItem";
231
+ var SwipeableMenuSheetItemContent = forwardRef((props, ref) => {
232
+ const { children, className, style } = props;
233
+ const { classNames } = useSwipeableMenuSheetItemContext();
234
+ return <view {...ref ? { ref } : {}} className={clsx(classNames.content, className)} style={style}>
235
+ {children}
236
+ </view>;
237
+ });
238
+ SwipeableMenuSheetItemContent.displayName = "SwipeableMenuSheetItemContent";
239
+ var SwipeableMenuSheetItemLabel = forwardRef((props, ref) => {
240
+ const { children, className, style } = props;
241
+ const { classNames } = useSwipeableMenuSheetItemContext();
242
+ return <text {...ref ? { ref } : {}} className={clsx(classNames.label, className)} style={style}>
243
+ {children}
244
+ </text>;
245
+ });
246
+ SwipeableMenuSheetItemLabel.displayName = "SwipeableMenuSheetItemLabel";
247
+ var SwipeableMenuSheetItemDescription = forwardRef((props, ref) => {
248
+ const { children, className, style } = props;
249
+ const { classNames } = useSwipeableMenuSheetItemContext();
250
+ return <text {...ref ? { ref } : {}} className={clsx(classNames.description, className)} style={style}>
251
+ {children}
252
+ </text>;
253
+ });
254
+ SwipeableMenuSheetItemDescription.displayName = "SwipeableMenuSheetItemDescription";
255
+ //#endregion
256
+ export { SwipeableMenuSheetBackdrop, SwipeableMenuSheetCloseButton, SwipeableMenuSheetContent, SwipeableMenuSheetDescription, SwipeableMenuSheetFooter, SwipeableMenuSheetGroup, SwipeableMenuSheetHandle, SwipeableMenuSheetHeader, SwipeableMenuSheetItem, SwipeableMenuSheetItemContent, SwipeableMenuSheetItemDescription, SwipeableMenuSheetItemLabel, SwipeableMenuSheetList, SwipeableMenuSheetPositioner, SwipeableMenuSheetRoot, SwipeableMenuSheetTitle, SwipeableMenuSheetTrigger };
@@ -0,0 +1,2 @@
1
+ export { SwipeableMenuSheetBackdrop as Backdrop, SwipeableMenuSheetCloseButton as CloseButton, SwipeableMenuSheetContent as Content, SwipeableMenuSheetDescription as Description, SwipeableMenuSheetFooter as Footer, SwipeableMenuSheetGroup as Group, SwipeableMenuSheetHandle as Handle, SwipeableMenuSheetHeader as Header, SwipeableMenuSheetItem as Item, SwipeableMenuSheetItemContent as ItemContent, SwipeableMenuSheetItemDescription as ItemDescription, SwipeableMenuSheetItemLabel as ItemLabel, SwipeableMenuSheetList as List, SwipeableMenuSheetPositioner as Positioner, SwipeableMenuSheetRoot as Root, SwipeableMenuSheetTitle as Title, SwipeableMenuSheetTrigger as Trigger, type SwipeableMenuSheetBackdropProps as BackdropProps, type SwipeableMenuSheetCloseButtonProps as CloseButtonProps, type SwipeableMenuSheetContentProps as ContentProps, type SwipeableMenuSheetDescriptionProps as DescriptionProps, type SwipeableMenuSheetFooterProps as FooterProps, type SwipeableMenuSheetGroupProps as GroupProps, type SwipeableMenuSheetHandleProps as HandleProps, type SwipeableMenuSheetHeaderProps as HeaderProps, type SwipeableMenuSheetItemContentProps as ItemContentProps, type SwipeableMenuSheetItemDescriptionProps as ItemDescriptionProps, type SwipeableMenuSheetItemLabelProps as ItemLabelProps, type SwipeableMenuSheetItemProps as ItemProps, type SwipeableMenuSheetListProps as ListProps, type SwipeableMenuSheetPositionerProps as PositionerProps, type SwipeableMenuSheetRootProps as RootProps, type SwipeableMenuSheetRootRef as RootRef, type SwipeableMenuSheetTitleProps as TitleProps, type SwipeableMenuSheetTriggerProps as TriggerProps, } from './SwipeableMenuSheet';
2
+ //# sourceMappingURL=SwipeableMenuSheet.namespace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SwipeableMenuSheet.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/SwipeableMenuSheet/SwipeableMenuSheet.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,IAAI,QAAQ,EACtC,6BAA6B,IAAI,WAAW,EAC5C,yBAAyB,IAAI,OAAO,EACpC,6BAA6B,IAAI,WAAW,EAC5C,wBAAwB,IAAI,MAAM,EAClC,uBAAuB,IAAI,KAAK,EAChC,wBAAwB,IAAI,MAAM,EAClC,wBAAwB,IAAI,MAAM,EAClC,sBAAsB,IAAI,IAAI,EAC9B,6BAA6B,IAAI,WAAW,EAC5C,iCAAiC,IAAI,eAAe,EACpD,2BAA2B,IAAI,SAAS,EACxC,sBAAsB,IAAI,IAAI,EAC9B,4BAA4B,IAAI,UAAU,EAC1C,sBAAsB,IAAI,IAAI,EAC9B,uBAAuB,IAAI,KAAK,EAChC,yBAAyB,IAAI,OAAO,EACpC,KAAK,+BAA+B,IAAI,aAAa,EACrD,KAAK,kCAAkC,IAAI,gBAAgB,EAC3D,KAAK,8BAA8B,IAAI,YAAY,EACnD,KAAK,kCAAkC,IAAI,gBAAgB,EAC3D,KAAK,6BAA6B,IAAI,WAAW,EACjD,KAAK,4BAA4B,IAAI,UAAU,EAC/C,KAAK,6BAA6B,IAAI,WAAW,EACjD,KAAK,6BAA6B,IAAI,WAAW,EACjD,KAAK,kCAAkC,IAAI,gBAAgB,EAC3D,KAAK,sCAAsC,IAAI,oBAAoB,EACnE,KAAK,gCAAgC,IAAI,cAAc,EACvD,KAAK,2BAA2B,IAAI,SAAS,EAC7C,KAAK,2BAA2B,IAAI,SAAS,EAC7C,KAAK,iCAAiC,IAAI,eAAe,EACzD,KAAK,2BAA2B,IAAI,SAAS,EAC7C,KAAK,yBAAyB,IAAI,OAAO,EACzC,KAAK,4BAA4B,IAAI,UAAU,EAC/C,KAAK,8BAA8B,IAAI,YAAY,GACpD,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+ import { SwipeableMenuSheetBackdrop, SwipeableMenuSheetCloseButton, SwipeableMenuSheetContent, SwipeableMenuSheetDescription, SwipeableMenuSheetFooter, SwipeableMenuSheetGroup, SwipeableMenuSheetHandle, SwipeableMenuSheetHeader, SwipeableMenuSheetItem, SwipeableMenuSheetItemContent, SwipeableMenuSheetItemDescription, SwipeableMenuSheetItemLabel, SwipeableMenuSheetList, SwipeableMenuSheetPositioner, SwipeableMenuSheetRoot, SwipeableMenuSheetTitle, SwipeableMenuSheetTrigger } from "./SwipeableMenuSheet.jsx";
3
+ //#region src/components/SwipeableMenuSheet/SwipeableMenuSheet.namespace.ts
4
+ var SwipeableMenuSheet_namespace_exports = /* @__PURE__ */ __exportAll({
5
+ Backdrop: () => SwipeableMenuSheetBackdrop,
6
+ CloseButton: () => SwipeableMenuSheetCloseButton,
7
+ Content: () => SwipeableMenuSheetContent,
8
+ Description: () => SwipeableMenuSheetDescription,
9
+ Footer: () => SwipeableMenuSheetFooter,
10
+ Group: () => SwipeableMenuSheetGroup,
11
+ Handle: () => SwipeableMenuSheetHandle,
12
+ Header: () => SwipeableMenuSheetHeader,
13
+ Item: () => SwipeableMenuSheetItem,
14
+ ItemContent: () => SwipeableMenuSheetItemContent,
15
+ ItemDescription: () => SwipeableMenuSheetItemDescription,
16
+ ItemLabel: () => SwipeableMenuSheetItemLabel,
17
+ List: () => SwipeableMenuSheetList,
18
+ Positioner: () => SwipeableMenuSheetPositioner,
19
+ Root: () => SwipeableMenuSheetRoot,
20
+ Title: () => SwipeableMenuSheetTitle,
21
+ Trigger: () => SwipeableMenuSheetTrigger
22
+ });
23
+ //#endregion
24
+ export { SwipeableMenuSheet_namespace_exports };
@@ -0,0 +1,3 @@
1
+ export { SwipeableMenuSheetBackdrop, type SwipeableMenuSheetBackdropProps, SwipeableMenuSheetCloseButton, type SwipeableMenuSheetCloseButtonProps, SwipeableMenuSheetContent, type SwipeableMenuSheetContentProps, SwipeableMenuSheetDescription, type SwipeableMenuSheetDescriptionProps, SwipeableMenuSheetFooter, type SwipeableMenuSheetFooterProps, SwipeableMenuSheetGroup, type SwipeableMenuSheetGroupProps, SwipeableMenuSheetHandle, type SwipeableMenuSheetHandleProps, SwipeableMenuSheetHeader, type SwipeableMenuSheetHeaderProps, SwipeableMenuSheetItem, SwipeableMenuSheetItemContent, type SwipeableMenuSheetItemContentProps, SwipeableMenuSheetItemDescription, type SwipeableMenuSheetItemDescriptionProps, SwipeableMenuSheetItemLabel, type SwipeableMenuSheetItemLabelProps, type SwipeableMenuSheetItemProps, type SwipeableMenuSheetItemTone, SwipeableMenuSheetList, type SwipeableMenuSheetListProps, type SwipeableMenuSheetLabelAlign, type SwipeableMenuSheetCloseReason, type SwipeableMenuSheetOpenChangeDetails, SwipeableMenuSheetPositioner, type SwipeableMenuSheetPositionerProps, SwipeableMenuSheetRoot, type SwipeableMenuSheetRootProps, type SwipeableMenuSheetRootRef, SwipeableMenuSheetTitle, type SwipeableMenuSheetTitleProps, SwipeableMenuSheetTrigger, type SwipeableMenuSheetTriggerProps, } from './SwipeableMenuSheet';
2
+ export * as SwipeableMenuSheet from './SwipeableMenuSheet.namespace';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SwipeableMenuSheet/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,KAAK,+BAA+B,EACpC,6BAA6B,EAC7B,KAAK,kCAAkC,EACvC,yBAAyB,EACzB,KAAK,8BAA8B,EACnC,6BAA6B,EAC7B,KAAK,kCAAkC,EACvC,wBAAwB,EACxB,KAAK,6BAA6B,EAClC,uBAAuB,EACvB,KAAK,4BAA4B,EACjC,wBAAwB,EACxB,KAAK,6BAA6B,EAClC,wBAAwB,EACxB,KAAK,6BAA6B,EAClC,sBAAsB,EACtB,6BAA6B,EAC7B,KAAK,kCAAkC,EACvC,iCAAiC,EACjC,KAAK,sCAAsC,EAC3C,2BAA2B,EAC3B,KAAK,gCAAgC,EACrC,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAC/B,sBAAsB,EACtB,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAClC,KAAK,mCAAmC,EACxC,4BAA4B,EAC5B,KAAK,iCAAiC,EACtC,sBAAsB,EACtB,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,uBAAuB,EACvB,KAAK,4BAA4B,EACjC,yBAAyB,EACzB,KAAK,8BAA8B,GACpC,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,kBAAkB,MAAM,gCAAgC,CAAC"}
@@ -1,15 +1,38 @@
1
1
  import { SwitchVariantProps } from '@seed-design/lynx-css/recipes/switch';
2
2
  import { SwitchmarkVariantProps } from '@seed-design/lynx-css/recipes/switchmark';
3
- import { LynxStyledElementProps } from '../../types';
3
+ import { LynxAccessibilityProps, LynxStyledElementProps } from '../../types';
4
+ import { ScaleFeedbackTargetProps } from '../../hooks/useScaleFeedback';
4
5
  import * as React from "@lynx-js/react";
5
- export interface SwitchRootProps extends SwitchVariantProps, Omit<SwitchmarkVariantProps, "size">, LynxStyledElementProps {
6
+ /**
7
+ * @platform Lynx
8
+ *
9
+ * 웹 대비 미지원 기능:
10
+ * - HiddenInput / name / value / required / invalid: Lynx에 native form 제출 모델이 없음
11
+ * - focus / focusVisible: Lynx에 키보드 포커스 개념이 없음
12
+ * - onChange (raw DOM event): 의미 없음. 토글 이벤트는 onCheckedChange로만 노출
13
+ *
14
+ * 추후 rootage 토큰 확장 시 추가 예정:
15
+ * - pressed boolean variant: switchmark rootage spec 에 pressed 상태가 추가되면
16
+ * switchmark recipe 와 Switch 컴포넌트에 boolean variant 로 노출.
17
+ */
18
+ interface SwitchContextValue {
19
+ checked: boolean;
20
+ disabled: boolean;
21
+ pressed: boolean;
22
+ switchVariantProps: SwitchVariantProps;
23
+ switchmarkVariantProps: SwitchmarkVariantProps;
24
+ toggle: () => void;
25
+ scaleFeedbackTargetProps: ScaleFeedbackTargetProps;
26
+ }
27
+ export declare function useSwitchContext(consumer: string): SwitchContextValue;
28
+ export interface SwitchRootProps extends SwitchVariantProps, Omit<SwitchmarkVariantProps, "size">, LynxStyledElementProps, LynxAccessibilityProps {
6
29
  checked?: boolean;
7
30
  defaultChecked?: boolean;
8
31
  disabled?: boolean;
9
32
  onCheckedChange?: (checked: boolean) => void;
10
33
  }
11
34
  export declare const SwitchRoot: React.ForwardRefExoticComponent<SwitchRootProps & React.RefAttributes<unknown>>;
12
- export interface SwitchControlProps extends Pick<SwitchmarkVariantProps, "tone" | "size">, LynxStyledElementProps {
35
+ export interface SwitchControlProps extends Pick<SwitchmarkVariantProps, "tone" | "size">, Omit<LynxStyledElementProps, "flatten"> {
13
36
  }
14
37
  export declare const SwitchControl: React.ForwardRefExoticComponent<SwitchControlProps & React.RefAttributes<unknown>>;
15
38
  export interface SwitchThumbProps extends Pick<LynxStyledElementProps, "className" | "style"> {
@@ -18,4 +41,5 @@ export declare const SwitchThumb: React.ForwardRefExoticComponent<SwitchThumbPro
18
41
  export interface SwitchLabelProps extends LynxStyledElementProps {
19
42
  }
20
43
  export declare const SwitchLabel: React.ForwardRefExoticComponent<SwitchLabelProps & React.RefAttributes<unknown>>;
44
+ export {};
21
45
  //# sourceMappingURL=Switch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAIxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAKvF,OAAO,KAAK,EAAE,sBAAsB,EAA4B,MAAM,aAAa,CAAC;AAkDpF,MAAM,WAAW,eACf,SAAQ,kBAAkB,EACxB,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC,EACpC,sBAAsB;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C;AAED,eAAO,MAAM,UAAU,iFAmDrB,CAAC;AAKH,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,sBAAsB,EAAE,MAAM,GAAG,MAAM,CAAC,EACnD,sBAAsB;CAAG;AAE7B,eAAO,MAAM,aAAa,oFAyBxB,CAAC;AAKH,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,sB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