@seed-design/lynx-react 0.3.0 → 0.4.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 (84) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +20 -0
  3. package/lib/components/Field/Field.d.ts +47 -0
  4. package/lib/components/Field/Field.d.ts.map +1 -0
  5. package/lib/components/Field/Field.jsx +121 -0
  6. package/lib/components/Field/Field.namespace.d.ts +2 -0
  7. package/lib/components/Field/Field.namespace.d.ts.map +1 -0
  8. package/lib/components/Field/Field.namespace.js +16 -0
  9. package/lib/components/Field/context.d.ts +19 -0
  10. package/lib/components/Field/context.d.ts.map +1 -0
  11. package/lib/components/Field/context.js +10 -0
  12. package/lib/components/Field/index.d.ts +3 -0
  13. package/lib/components/Field/index.d.ts.map +1 -0
  14. package/lib/components/KeyboardAvoidingScrollView/KeyboardAvoidingScrollView.d.ts +42 -0
  15. package/lib/components/KeyboardAvoidingScrollView/KeyboardAvoidingScrollView.d.ts.map +1 -0
  16. package/lib/components/KeyboardAvoidingScrollView/KeyboardAvoidingScrollView.jsx +140 -0
  17. package/lib/components/KeyboardAvoidingScrollView/context.d.ts +17 -0
  18. package/lib/components/KeyboardAvoidingScrollView/context.d.ts.map +1 -0
  19. package/lib/components/KeyboardAvoidingScrollView/context.js +12 -0
  20. package/lib/components/KeyboardAvoidingScrollView/engine.d.ts +50 -0
  21. package/lib/components/KeyboardAvoidingScrollView/engine.d.ts.map +1 -0
  22. package/lib/components/KeyboardAvoidingScrollView/engine.js +259 -0
  23. package/lib/components/KeyboardAvoidingScrollView/geometry.d.ts +50 -0
  24. package/lib/components/KeyboardAvoidingScrollView/geometry.d.ts.map +1 -0
  25. package/lib/components/KeyboardAvoidingScrollView/geometry.js +90 -0
  26. package/lib/components/KeyboardAvoidingScrollView/index.d.ts +2 -0
  27. package/lib/components/KeyboardAvoidingScrollView/index.d.ts.map +1 -0
  28. package/lib/components/KeyboardAvoidingScrollView/keyboard-event-source.d.ts +11 -0
  29. package/lib/components/KeyboardAvoidingScrollView/keyboard-event-source.d.ts.map +1 -0
  30. package/lib/components/KeyboardAvoidingScrollView/keyboard-event-source.js +43 -0
  31. package/lib/components/KeyboardAvoidingScrollView/native-driver.d.ts +34 -0
  32. package/lib/components/KeyboardAvoidingScrollView/native-driver.d.ts.map +1 -0
  33. package/lib/components/KeyboardAvoidingScrollView/native-driver.js +133 -0
  34. package/lib/components/TextField/TextField.d.ts +113 -0
  35. package/lib/components/TextField/TextField.d.ts.map +1 -0
  36. package/lib/components/TextField/TextField.jsx +418 -0
  37. package/lib/components/TextField/TextField.namespace.d.ts +2 -0
  38. package/lib/components/TextField/TextField.namespace.d.ts.map +1 -0
  39. package/lib/components/TextField/TextField.namespace.js +14 -0
  40. package/lib/components/TextField/context.d.ts +22 -0
  41. package/lib/components/TextField/context.d.ts.map +1 -0
  42. package/lib/components/TextField/context.js +7 -0
  43. package/lib/components/TextField/index.d.ts +4 -0
  44. package/lib/components/TextField/index.d.ts.map +1 -0
  45. package/lib/components/TextField/useTextFieldWithGraphemes.d.ts +24 -0
  46. package/lib/components/TextField/useTextFieldWithGraphemes.d.ts.map +1 -0
  47. package/lib/components/TextField/useTextFieldWithGraphemes.js +47 -0
  48. package/lib/components/index.d.ts +3 -0
  49. package/lib/components/index.d.ts.map +1 -1
  50. package/lib/index.js +7 -1
  51. package/lib/node_modules/.bun/unicode-segmenter@0.14.5/node_modules/unicode-segmenter/_grapheme_data.js +8 -0
  52. package/lib/node_modules/.bun/unicode-segmenter@0.14.5/node_modules/unicode-segmenter/_incb_data.js +14 -0
  53. package/lib/node_modules/.bun/unicode-segmenter@0.14.5/node_modules/unicode-segmenter/core.js +68 -0
  54. package/lib/node_modules/.bun/unicode-segmenter@0.14.5/node_modules/unicode-segmenter/grapheme.js +175 -0
  55. package/lib/utils/create-slot-recipe-context.d.ts.map +1 -1
  56. package/lib/utils/create-slot-recipe-context.jsx +7 -0
  57. package/package.json +10 -5
  58. package/src/components/Field/Field.namespace.ts +19 -0
  59. package/src/components/Field/Field.test.tsx +81 -0
  60. package/src/components/Field/Field.tsx +252 -0
  61. package/src/components/Field/context.ts +26 -0
  62. package/src/components/Field/index.ts +21 -0
  63. package/src/components/KeyboardAvoidingScrollView/KeyboardAvoidingScrollView.test.tsx +267 -0
  64. package/src/components/KeyboardAvoidingScrollView/KeyboardAvoidingScrollView.tsx +299 -0
  65. package/src/components/KeyboardAvoidingScrollView/context.ts +24 -0
  66. package/src/components/KeyboardAvoidingScrollView/engine.test.ts +451 -0
  67. package/src/components/KeyboardAvoidingScrollView/engine.ts +417 -0
  68. package/src/components/KeyboardAvoidingScrollView/geometry.test.ts +315 -0
  69. package/src/components/KeyboardAvoidingScrollView/geometry.ts +194 -0
  70. package/src/components/KeyboardAvoidingScrollView/index.ts +5 -0
  71. package/src/components/KeyboardAvoidingScrollView/keyboard-event-source.test.ts +122 -0
  72. package/src/components/KeyboardAvoidingScrollView/keyboard-event-source.ts +75 -0
  73. package/src/components/KeyboardAvoidingScrollView/native-driver.test.ts +223 -0
  74. package/src/components/KeyboardAvoidingScrollView/native-driver.ts +248 -0
  75. package/src/components/TextField/TextField.namespace.ts +16 -0
  76. package/src/components/TextField/TextField.test.tsx +924 -0
  77. package/src/components/TextField/TextField.tsx +912 -0
  78. package/src/components/TextField/context.ts +33 -0
  79. package/src/components/TextField/index.ts +23 -0
  80. package/src/components/TextField/useTextFieldWithGraphemes.test.tsx +80 -0
  81. package/src/components/TextField/useTextFieldWithGraphemes.ts +78 -0
  82. package/src/components/index.ts +3 -0
  83. package/src/utils/create-slot-recipe-context.test.tsx +51 -0
  84. package/src/utils/create-slot-recipe-context.tsx +23 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2021 Danggeun Market Inc.
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,20 @@
1
+ SEED Design
2
+ Copyright 2025 주식회사 당근마켓
3
+
4
+ 이 소프트웨어는 Apache License 2.0에 따라 배포되며, 상업적 목적을 포함하여 자유롭게 사용, 수정, 재배포할 수 있습니다.
5
+ 재배포할 때에는 Apache License 2.0 제4조에 따라 라이선스 사본을 제공하고 이 파일에 담긴 귀속 고지를 전달해야 합니다.
6
+
7
+ 아래 "브랜드 리소스"에 관한 내용은 상표에 관한 안내이며, Apache License 2.0이 정하는 조건을 변경하지 않습니다.
8
+
9
+ 이 저장소에서 제공하는 "브랜드 리소스"는 주식회사 당근마켓(이하 "당근마켓")의 자산으로 대한민국 상표법의 보호를 받습니다.
10
+ 브랜드 리소스란 로고, 상호명, 캐릭터 등 당근마켓이나 당근마켓의 제품으로 식별될 수 있는 모든 요소를 의미합니다.
11
+
12
+ 당근마켓과 사전 협의가 없는 경우 비상업적 목적으로만 사용이 허가되며 [당근마켓 브랜드 리소스 가이드라인]을 준수해야 합니다.
13
+ 상표 사용 허가는 당근마켓의 요청에 따라 언제든지 철회될 수 있습니다.
14
+
15
+ 또한 브랜드 리소스를 다음과 같은 방식으로 사용할 수 없습니다.
16
+
17
+ - 당근마켓을 사칭하거나, 당근마켓이 제공하는 제품 또는 서비스인 것처럼 오인하게 하는 사용
18
+ - 당근마켓의 제품 또는 서비스와 제휴, 후원, 보증, 그 밖의 관련이 있는 것처럼 오인하게 하는 사용
19
+
20
+ [당근마켓 브랜드 리소스 가이드라인]: https://app.notion.com/p/daangn/6fdd92981e4a42d8b29c89cbbba7a8b7
@@ -0,0 +1,47 @@
1
+ import { NodesRef } from '@lynx-js/types';
2
+ import { FieldVariantProps } from '@seed-design/lynx-css/recipes/field';
3
+ import { FieldLabelVariantProps } from '@seed-design/lynx-css/recipes/field-label';
4
+ import { LynxStyledElementProps } from '../../types';
5
+ import * as React from "@lynx-js/react";
6
+ /**
7
+ * @platform Lynx
8
+ *
9
+ * 웹 대비 미지원 기능:
10
+ * - HTML label의 `for` 연결과 native form의 `name` 제출 모델
11
+ * - DOM ARIA id 연결. 입력 컴포넌트에서 `accessibility-label`을 사용해야 함
12
+ */
13
+ export interface FieldRootProps extends Omit<FieldVariantProps, "empty">, LynxStyledElementProps {
14
+ required?: boolean;
15
+ disabled?: boolean;
16
+ readOnly?: boolean;
17
+ }
18
+ export declare const FieldRoot: React.ForwardRefExoticComponent<FieldRootProps & React.RefAttributes<NodesRef>>;
19
+ export interface FieldHeaderProps extends LynxStyledElementProps {
20
+ }
21
+ export declare const FieldHeader: React.ForwardRefExoticComponent<FieldHeaderProps & React.RefAttributes<unknown>>;
22
+ export interface FieldLabelProps extends FieldLabelVariantProps, LynxStyledElementProps {
23
+ }
24
+ export declare const FieldLabel: React.ForwardRefExoticComponent<FieldLabelProps & React.RefAttributes<unknown>>;
25
+ export interface FieldIndicatorTextProps extends LynxStyledElementProps {
26
+ }
27
+ export declare const FieldIndicatorText: React.ForwardRefExoticComponent<FieldIndicatorTextProps & React.RefAttributes<unknown>>;
28
+ export interface FieldRequiredIndicatorProps extends LynxStyledElementProps {
29
+ }
30
+ export declare const FieldRequiredIndicator: React.ForwardRefExoticComponent<FieldRequiredIndicatorProps & React.RefAttributes<unknown>>;
31
+ export interface FieldFooterProps extends LynxStyledElementProps {
32
+ }
33
+ export declare const FieldFooter: React.ForwardRefExoticComponent<FieldFooterProps & React.RefAttributes<unknown>>;
34
+ export interface FieldDescriptionProps extends LynxStyledElementProps {
35
+ }
36
+ export declare const FieldDescription: React.ForwardRefExoticComponent<FieldDescriptionProps & React.RefAttributes<unknown>>;
37
+ export interface FieldErrorMessageProps extends LynxStyledElementProps {
38
+ }
39
+ export declare const FieldErrorMessage: React.ForwardRefExoticComponent<FieldErrorMessageProps & React.RefAttributes<unknown>>;
40
+ export interface FieldCharacterCountProps extends LynxStyledElementProps {
41
+ /** 현재 문자 또는 grapheme 수 */
42
+ current: number;
43
+ /** 허용하는 최대 문자 또는 grapheme 수 */
44
+ max: number;
45
+ }
46
+ export declare const FieldCharacterCount: React.ForwardRefExoticComponent<FieldCharacterCountProps & React.RefAttributes<unknown>>;
47
+ //# sourceMappingURL=Field.d.ts.map
@@ -0,0 +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;AAWpF;;;;;;GAMG;AACH,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,EAAE,sBAAsB;IAC9F,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,iFAmDpB,CAAC;AAKH,MAAM,WAAW,gBAAiB,SAAQ,sBAAsB;CAAG;AAEnE,eAAO,MAAM,WAAW,kFAatB,CAAC;AAGH,MAAM,WAAW,eAAgB,SAAQ,sBAAsB,EAAE,sBAAsB;CAAG;AAE1F,eAAO,MAAM,UAAU,iFAgBrB,CAAC;AAGH,MAAM,WAAW,uBAAwB,SAAQ,sBAAsB;CAAG;AAE1E,eAAO,MAAM,kBAAkB,yFAgB9B,CAAC;AAGF,MAAM,WAAW,2BAA4B,SAAQ,sBAAsB;CAAG;AAE9E,eAAO,MAAM,sBAAsB,6FAiBlC,CAAC;AAKF,MAAM,WAAW,gBAAiB,SAAQ,sBAAsB;CAAG;AAEnE,eAAO,MAAM,WAAW,kFAatB,CAAC;AAGH,MAAM,WAAW,qBAAsB,SAAQ,sBAAsB;CAAG;AAExE,eAAO,MAAM,gBAAgB,uFAa3B,CAAC;AAGH,MAAM,WAAW,sBAAuB,SAAQ,sBAAsB;CAAG;AAEzE,eAAO,MAAM,iBAAiB,wFAa5B,CAAC;AAKH,MAAM,WAAW,wBAAyB,SAAQ,sBAAsB;IACtE,0BAA0B;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,mBAAmB,0FAiB/B,CAAC"}
@@ -0,0 +1,121 @@
1
+ import { createSlotRecipeContext } from "../../utils/create-slot-recipe-context.jsx";
2
+ import { FieldContext, useFieldContext } from "./context.js";
3
+ import clsx from "clsx";
4
+ import * as React from "@lynx-js/react";
5
+ import { field } from "@seed-design/lynx-css/recipes/field";
6
+ import { fieldLabel } from "@seed-design/lynx-css/recipes/field-label";
7
+ //#region src/components/Field/Field.tsx
8
+ var { ClassNamesProvider: FieldClassNamesProvider, useClassNames: useFieldClassNames } = createSlotRecipeContext(field);
9
+ var { ClassNamesProvider: FieldLabelClassNamesProvider, useClassNames: useFieldLabelClassNames } = createSlotRecipeContext(fieldLabel);
10
+ var FieldRoot = React.forwardRef((props, forwardedRef) => {
11
+ const [variantProps, otherProps] = field.splitVariantProps(props);
12
+ const { children, className, required = false, disabled = false, readOnly = false, ...nativeProps } = otherProps;
13
+ const invalid = variantProps.invalid ?? false;
14
+ const [focused, setFocused] = React.useState(false);
15
+ const rootRef = React.useRef(null);
16
+ const classes = field({ invalid });
17
+ const mergedRef = React.useCallback((node) => {
18
+ "background only";
19
+ rootRef.current = node;
20
+ if (typeof forwardedRef === "function") forwardedRef(node);
21
+ else if (forwardedRef) forwardedRef.current = node;
22
+ }, [forwardedRef]);
23
+ const contextValue = React.useMemo(() => ({
24
+ rootRef,
25
+ disabled,
26
+ invalid,
27
+ readOnly,
28
+ required,
29
+ focused,
30
+ setFocused
31
+ }), [
32
+ disabled,
33
+ focused,
34
+ invalid,
35
+ readOnly,
36
+ required
37
+ ]);
38
+ return <FieldContext.Provider value={contextValue}>
39
+ <FieldClassNamesProvider value={classes}>
40
+ <view ref={mergedRef} className={clsx(classes.root, className)} {...nativeProps}>
41
+ {children}
42
+ </view>
43
+ </FieldClassNamesProvider>
44
+ </FieldContext.Provider>;
45
+ });
46
+ FieldRoot.displayName = "FieldRoot";
47
+ var FieldHeader = React.forwardRef((props, ref) => {
48
+ const classes = useFieldClassNames();
49
+ const { children, className, ...nativeProps } = props;
50
+ return <view {...ref ? { ref } : {}} className={clsx(classes.header, className)} {...nativeProps}>
51
+ {children}
52
+ </view>;
53
+ });
54
+ FieldHeader.displayName = "FieldHeader";
55
+ var FieldLabel = React.forwardRef((props, ref) => {
56
+ const [variantProps, otherProps] = fieldLabel.splitVariantProps(props);
57
+ const { children, className, ...nativeProps } = otherProps;
58
+ const classes = fieldLabel(variantProps);
59
+ return <FieldLabelClassNamesProvider value={classes}>
60
+ <text {...ref ? { ref } : {}} className={clsx(classes.root, className)} {...nativeProps}>
61
+ {children}
62
+ </text>
63
+ </FieldLabelClassNamesProvider>;
64
+ });
65
+ FieldLabel.displayName = "FieldLabel";
66
+ var FieldIndicatorText = React.forwardRef((props, ref) => {
67
+ const classes = useFieldLabelClassNames();
68
+ const { children, className, ...nativeProps } = props;
69
+ return <text {...ref ? { ref } : {}} className={clsx(classes.indicatorText, className)} {...nativeProps}>
70
+ {"\xA0"}
71
+ {children}
72
+ </text>;
73
+ });
74
+ FieldIndicatorText.displayName = "FieldIndicatorText";
75
+ var FieldRequiredIndicator = React.forwardRef((props, ref) => {
76
+ const classes = useFieldLabelClassNames();
77
+ const { children = "*", className, ...nativeProps } = props;
78
+ return <text {...ref ? { ref } : {}} accessibility-elements-hidden={true} className={clsx(classes.indicatorIcon, className)} {...nativeProps}>
79
+ {" "}
80
+ {children}
81
+ </text>;
82
+ });
83
+ FieldRequiredIndicator.displayName = "FieldRequiredIndicator";
84
+ var FieldFooter = React.forwardRef((props, ref) => {
85
+ const classes = useFieldClassNames();
86
+ const { children, className, ...nativeProps } = props;
87
+ return <view {...ref ? { ref } : {}} className={clsx(classes.footer, className)} {...nativeProps}>
88
+ {children}
89
+ </view>;
90
+ });
91
+ FieldFooter.displayName = "FieldFooter";
92
+ var FieldDescription = React.forwardRef((props, ref) => {
93
+ const classes = useFieldClassNames();
94
+ const { children, className, ...nativeProps } = props;
95
+ return <text {...ref ? { ref } : {}} className={clsx(classes.description, className)} {...nativeProps}>
96
+ {children}
97
+ </text>;
98
+ });
99
+ FieldDescription.displayName = "FieldDescription";
100
+ var FieldErrorMessage = React.forwardRef((props, ref) => {
101
+ const classes = useFieldClassNames();
102
+ const { children, className, ...nativeProps } = props;
103
+ return <text {...ref ? { ref } : {}} className={clsx(classes.errorMessage, className)} {...nativeProps}>
104
+ {children}
105
+ </text>;
106
+ });
107
+ FieldErrorMessage.displayName = "FieldErrorMessage";
108
+ var FieldCharacterCount = React.forwardRef((props, ref) => {
109
+ const { current, max, children: _children, className, ...nativeProps } = props;
110
+ const classes = field({
111
+ invalid: useFieldContext({ strict: true }).invalid,
112
+ empty: current === 0
113
+ });
114
+ return <view {...ref ? { ref } : {}} className={clsx(classes.characterCountArea, className)} {...nativeProps}>
115
+ <text className={classes.characterCount}>{current}</text>
116
+ <text className={classes.maxCharacterCount}>/{max}</text>
117
+ </view>;
118
+ });
119
+ FieldCharacterCount.displayName = "FieldCharacterCount";
120
+ //#endregion
121
+ export { FieldCharacterCount, FieldDescription, FieldErrorMessage, FieldFooter, FieldHeader, FieldIndicatorText, FieldLabel, FieldRequiredIndicator, FieldRoot };
@@ -0,0 +1,2 @@
1
+ export { FieldCharacterCount as CharacterCount, FieldDescription as Description, FieldErrorMessage as ErrorMessage, FieldFooter as Footer, FieldHeader as Header, FieldIndicatorText as IndicatorText, FieldLabel as Label, FieldRequiredIndicator as RequiredIndicator, FieldRoot as Root, type FieldCharacterCountProps as CharacterCountProps, type FieldDescriptionProps as DescriptionProps, type FieldErrorMessageProps as ErrorMessageProps, type FieldFooterProps as FooterProps, type FieldHeaderProps as HeaderProps, type FieldIndicatorTextProps as IndicatorTextProps, type FieldLabelProps as LabelProps, type FieldRootProps as RootProps, } from './Field';
2
+ //# sourceMappingURL=Field.namespace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Field.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/Field/Field.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,IAAI,cAAc,EACrC,gBAAgB,IAAI,WAAW,EAC/B,iBAAiB,IAAI,YAAY,EACjC,WAAW,IAAI,MAAM,EACrB,WAAW,IAAI,MAAM,EACrB,kBAAkB,IAAI,aAAa,EACnC,UAAU,IAAI,KAAK,EACnB,sBAAsB,IAAI,iBAAiB,EAC3C,SAAS,IAAI,IAAI,EACjB,KAAK,wBAAwB,IAAI,mBAAmB,EACpD,KAAK,qBAAqB,IAAI,gBAAgB,EAC9C,KAAK,sBAAsB,IAAI,iBAAiB,EAChD,KAAK,gBAAgB,IAAI,WAAW,EACpC,KAAK,gBAAgB,IAAI,WAAW,EACpC,KAAK,uBAAuB,IAAI,kBAAkB,EAClD,KAAK,eAAe,IAAI,UAAU,EAClC,KAAK,cAAc,IAAI,SAAS,GACjC,MAAM,SAAS,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+ import { FieldCharacterCount, FieldDescription, FieldErrorMessage, FieldFooter, FieldHeader, FieldIndicatorText, FieldLabel, FieldRequiredIndicator, FieldRoot } from "./Field.jsx";
3
+ //#region src/components/Field/Field.namespace.ts
4
+ var Field_namespace_exports = /* @__PURE__ */ __exportAll({
5
+ CharacterCount: () => FieldCharacterCount,
6
+ Description: () => FieldDescription,
7
+ ErrorMessage: () => FieldErrorMessage,
8
+ Footer: () => FieldFooter,
9
+ Header: () => FieldHeader,
10
+ IndicatorText: () => FieldIndicatorText,
11
+ Label: () => FieldLabel,
12
+ RequiredIndicator: () => FieldRequiredIndicator,
13
+ Root: () => FieldRoot
14
+ });
15
+ //#endregion
16
+ export { Field_namespace_exports };
@@ -0,0 +1,19 @@
1
+ import { NodesRef } from '@lynx-js/types';
2
+ import * as React from "@lynx-js/react";
3
+ export interface FieldContextValue {
4
+ rootRef: React.RefObject<NodesRef | null>;
5
+ disabled: boolean;
6
+ invalid: boolean;
7
+ readOnly: boolean;
8
+ required: boolean;
9
+ focused: boolean;
10
+ setFocused: (focused: boolean) => void;
11
+ }
12
+ export declare const FieldContext: React.Context<FieldContextValue | null>;
13
+ export declare function useFieldContext(options: {
14
+ strict: true;
15
+ }): FieldContextValue;
16
+ export declare function useFieldContext(options?: {
17
+ strict?: false;
18
+ }): FieldContextValue | null;
19
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/components/Field/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IAC1C,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,YAAY,yCAAsD,CAAC;AAEhF,wBAAgB,eAAe,CAAC,OAAO,EAAE;IAAE,MAAM,EAAE,IAAI,CAAA;CAAE,GAAG,iBAAiB,CAAC;AAC9E,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,KAAK,CAAA;CAAE,GAAG,iBAAiB,GAAG,IAAI,CAAC"}
@@ -0,0 +1,10 @@
1
+ import * as React from "@lynx-js/react";
2
+ //#region src/components/Field/context.ts
3
+ var FieldContext = React.createContext(null);
4
+ function useFieldContext(options = {}) {
5
+ const context = React.useContext(FieldContext);
6
+ if (options.strict && !context) throw new Error("Field compound components must be rendered inside <Field.Root>.");
7
+ return context;
8
+ }
9
+ //#endregion
10
+ export { FieldContext, useFieldContext };
@@ -0,0 +1,3 @@
1
+ export { FieldCharacterCount, FieldDescription, FieldErrorMessage, FieldFooter, FieldHeader, FieldIndicatorText, FieldLabel, FieldRequiredIndicator, FieldRoot, type FieldCharacterCountProps, type FieldDescriptionProps, type FieldErrorMessageProps, type FieldFooterProps, type FieldHeaderProps, type FieldIndicatorTextProps, type FieldLabelProps, type FieldRootProps, } from './Field';
2
+ export * as Field from './Field.namespace';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Field/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,UAAU,EACV,sBAAsB,EACtB,SAAS,EACT,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,cAAc,GACpB,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes } from '@lynx-js/react';
2
+ import { IntrinsicElements, NodesRef } from '@lynx-js/types';
3
+ import { LynxAccessibilityProps, LynxStyledElementProps, LynxTouchProps } from '../../types';
4
+ type NativeScrollViewProps = IntrinsicElements["scroll-view"];
5
+ type LynxForwardRefComponent<T, P> = ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<T>>;
6
+ export type KeyboardAvoidingScrollBehavior = "smooth" | "instant";
7
+ /**
8
+ * @platform Lynx
9
+ *
10
+ * 세로 `<scroll-view>` 안의 활성 입력 요소가 키보드에 가려지지 않도록 한다.
11
+ * `TextField.Input`과 `TextField.Textarea`는 focus 시 자동으로 이 컴포넌트에 등록된다.
12
+ *
13
+ * 현재 미지원 기능:
14
+ * - 가로 스크롤과 중첩 스크롤
15
+ * - 키보드 툴바 높이 반영
16
+ * - 큰 Textarea의 caret 단위 회피
17
+ */
18
+ export interface KeyboardAvoidingScrollViewProps extends LynxStyledElementProps, LynxAccessibilityProps, LynxTouchProps {
19
+ id?: NativeScrollViewProps["id"];
20
+ hidden?: NativeScrollViewProps["hidden"];
21
+ focusable?: NativeScrollViewProps["focusable"];
22
+ bounces?: NativeScrollViewProps["bounces"];
23
+ "enable-scroll"?: NativeScrollViewProps["enable-scroll"];
24
+ "scroll-bar-enable"?: NativeScrollViewProps["scroll-bar-enable"];
25
+ "upper-threshold"?: NativeScrollViewProps["upper-threshold"];
26
+ "lower-threshold"?: NativeScrollViewProps["lower-threshold"];
27
+ "initial-scroll-offset"?: NativeScrollViewProps["initial-scroll-offset"];
28
+ "initial-scroll-to-index"?: NativeScrollViewProps["initial-scroll-to-index"];
29
+ bindlayoutchange?: NativeScrollViewProps["bindlayoutchange"];
30
+ bindscrolltoupper?: NativeScrollViewProps["bindscrolltoupper"];
31
+ bindscrolltolower?: NativeScrollViewProps["bindscrolltolower"];
32
+ bindscroll?: NativeScrollViewProps["bindscroll"];
33
+ bindscrollend?: NativeScrollViewProps["bindscrollend"];
34
+ bindcontentsizechanged?: NativeScrollViewProps["bindcontentsizechanged"];
35
+ /** 키보드와 활성 입력 요소 사이에 확보할 간격(px). @defaultValue 24 */
36
+ keyboardGap?: number;
37
+ /** 회피 위치로 이동할 때 사용할 스크롤 방식. @defaultValue "smooth" */
38
+ scrollBehavior?: KeyboardAvoidingScrollBehavior;
39
+ }
40
+ export declare const KeyboardAvoidingScrollView: LynxForwardRefComponent<NodesRef, KeyboardAvoidingScrollViewProps>;
41
+ export {};
42
+ //# sourceMappingURL=KeyboardAvoidingScrollView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeyboardAvoidingScrollView.d.ts","sourceRoot":"","sources":["../../../src/components/KeyboardAvoidingScrollView/KeyboardAvoidingScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,yBAAyB,EAC9B,KAAK,eAAe,EACpB,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,KAAK,EACV,sBAAsB,EACtB,sBAAsB,EACtB,cAAc,EAGf,MAAM,aAAa,CAAC;AAMrB,KAAK,qBAAqB,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAC;AAO9D,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,yBAAyB,CAC5D,eAAe,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CACtC,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,QAAQ,GAAG,SAAS,CAAC;AAoClE;;;;;;;;;;GAUG;AACH,MAAM,WAAW,+BACf,SAAQ,sBAAsB,EAC5B,sBAAsB,EACtB,cAAc;IAChB,EAAE,CAAC,EAAE,qBAAqB,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IACzC,SAAS,CAAC,EAAE,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAC3C,eAAe,CAAC,EAAE,qBAAqB,CAAC,eAAe,CAAC,CAAC;IACzD,mBAAmB,CAAC,EAAE,qBAAqB,CAAC,mBAAmB,CAAC,CAAC;IACjE,iBAAiB,CAAC,EAAE,qBAAqB,CAAC,iBAAiB,CAAC,CAAC;IAC7D,iBAAiB,CAAC,EAAE,qBAAqB,CAAC,iBAAiB,CAAC,CAAC;IAC7D,uBAAuB,CAAC,EAAE,qBAAqB,CAAC,uBAAuB,CAAC,CAAC;IACzE,yBAAyB,CAAC,EAAE,qBAAqB,CAAC,yBAAyB,CAAC,CAAC;IAC7E,gBAAgB,CAAC,EAAE,qBAAqB,CAAC,kBAAkB,CAAC,CAAC;IAC7D,iBAAiB,CAAC,EAAE,qBAAqB,CAAC,mBAAmB,CAAC,CAAC;IAC/D,iBAAiB,CAAC,EAAE,qBAAqB,CAAC,mBAAmB,CAAC,CAAC;IAC/D,UAAU,CAAC,EAAE,qBAAqB,CAAC,YAAY,CAAC,CAAC;IACjD,aAAa,CAAC,EAAE,qBAAqB,CAAC,eAAe,CAAC,CAAC;IACvD,sBAAsB,CAAC,EAAE,qBAAqB,CAAC,wBAAwB,CAAC,CAAC;IACzE,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sDAAsD;IACtD,cAAc,CAAC,EAAE,8BAA8B,CAAC;CACjD;AAED,eAAO,MAAM,0BAA0B,EAAE,uBAAuB,CAC9D,QAAQ,EACR,+BAA+B,CA2L/B,CAAC"}
@@ -0,0 +1,140 @@
1
+ import { KeyboardAvoidanceActionsContext } from "./context.js";
2
+ import { createKeyboardAvoidingEngine } from "./engine.js";
3
+ import { lynxKeyboardEventSource } from "./keyboard-event-source.js";
4
+ import { lynxKeyboardAvoidingNativeDriver } from "./native-driver.js";
5
+ import { forwardRef, useCallback, useEffect, useMemo, useRef } from "@lynx-js/react";
6
+ //#region src/components/KeyboardAvoidingScrollView/KeyboardAvoidingScrollView.tsx
7
+ var lynxKeyboardAvoidingScheduler = {
8
+ scheduleFrame(callback) {
9
+ "background only";
10
+ const frame = requestAnimationFrame(() => {
11
+ "background only";
12
+ callback();
13
+ });
14
+ return () => {
15
+ "background only";
16
+ cancelAnimationFrame(frame);
17
+ };
18
+ },
19
+ scheduleTimer(callback, delayMs) {
20
+ "background only";
21
+ const timer = setTimeout(() => {
22
+ "background only";
23
+ callback();
24
+ }, delayMs);
25
+ return () => {
26
+ "background only";
27
+ clearTimeout(timer);
28
+ };
29
+ }
30
+ };
31
+ var spacerProps = {
32
+ "accessibility-elements-hidden": true,
33
+ flatten: false
34
+ };
35
+ var KeyboardAvoidingScrollView = forwardRef((props, forwardedRef) => {
36
+ const { children, keyboardGap = 24, scrollBehavior = "smooth", bindlayoutchange: userBindLayoutChange, bindscroll: userBindScroll, bindscrollend: userBindScrollEnd, bindtouchstart: userBindTouchStart, bindtouchend: userBindTouchEnd, bindtouchcancel: userBindTouchCancel, ...nativeProps } = props;
37
+ const scrollRef = useRef(null);
38
+ const spacerRef = useRef(null);
39
+ const keyboardGapRef = useRef(keyboardGap);
40
+ const committedKeyboardGapRef = useRef(keyboardGap);
41
+ const scrollBehaviorRef = useRef(scrollBehavior);
42
+ const touchActiveRef = useRef(false);
43
+ const didScrollDuringTouchRef = useRef(false);
44
+ keyboardGapRef.current = keyboardGap;
45
+ scrollBehaviorRef.current = scrollBehavior;
46
+ const engine = useMemo(() => createKeyboardAvoidingEngine({
47
+ driver: lynxKeyboardAvoidingNativeDriver,
48
+ scheduler: lynxKeyboardAvoidingScheduler,
49
+ getScrollNode: () => scrollRef.current,
50
+ getSpacerNode: () => spacerRef.current,
51
+ getKeyboardGap: () => keyboardGapRef.current,
52
+ getToolbarHeight: () => 0,
53
+ getSmooth: () => scrollBehaviorRef.current === "smooth"
54
+ }), []);
55
+ const mergedRef = useCallback((node) => {
56
+ "background only";
57
+ scrollRef.current = node;
58
+ if (typeof forwardedRef === "function") forwardedRef(node);
59
+ else if (forwardedRef) forwardedRef.current = node;
60
+ }, [forwardedRef]);
61
+ const actions = useMemo(() => ({
62
+ focus(registration) {
63
+ "background only";
64
+ engine.focus(registration);
65
+ },
66
+ blur(owner) {
67
+ "background only";
68
+ engine.blur(owner);
69
+ },
70
+ layoutChanged(owner) {
71
+ "background only";
72
+ engine.layoutChanged(owner);
73
+ },
74
+ unregister(owner) {
75
+ "background only";
76
+ engine.unregister(owner);
77
+ }
78
+ }), [engine]);
79
+ useEffect(() => {
80
+ const unsubscribe = lynxKeyboardEventSource.subscribe((state) => {
81
+ "background only";
82
+ engine.keyboardChanged(state);
83
+ });
84
+ return () => {
85
+ unsubscribe();
86
+ engine.dispose();
87
+ };
88
+ }, [engine]);
89
+ useEffect(() => {
90
+ if (Object.is(committedKeyboardGapRef.current, keyboardGap)) return;
91
+ committedKeyboardGapRef.current = keyboardGap;
92
+ engine.viewportChanged();
93
+ }, [engine, keyboardGap]);
94
+ const handleLayoutChange = useCallback((...args) => {
95
+ "background only";
96
+ engine.viewportChanged();
97
+ userBindLayoutChange?.(...args);
98
+ }, [engine, userBindLayoutChange]);
99
+ const handleTouchStart = useCallback((...args) => {
100
+ "background only";
101
+ touchActiveRef.current = true;
102
+ didScrollDuringTouchRef.current = false;
103
+ engine.userScrollStarted();
104
+ userBindTouchStart?.(...args);
105
+ }, [engine, userBindTouchStart]);
106
+ const handleScroll = useCallback((...args) => {
107
+ "background only";
108
+ if (touchActiveRef.current) didScrollDuringTouchRef.current = true;
109
+ userBindScroll?.(...args);
110
+ }, [userBindScroll]);
111
+ const handleTouchEnd = useCallback((...args) => {
112
+ "background only";
113
+ touchActiveRef.current = false;
114
+ if (!didScrollDuringTouchRef.current) engine.userScrollEnded();
115
+ userBindTouchEnd?.(...args);
116
+ }, [engine, userBindTouchEnd]);
117
+ const handleTouchCancel = useCallback((...args) => {
118
+ "background only";
119
+ touchActiveRef.current = false;
120
+ didScrollDuringTouchRef.current = false;
121
+ engine.userScrollEnded();
122
+ userBindTouchCancel?.(...args);
123
+ }, [engine, userBindTouchCancel]);
124
+ const handleScrollEnd = useCallback((...args) => {
125
+ "background only";
126
+ touchActiveRef.current = false;
127
+ didScrollDuringTouchRef.current = false;
128
+ engine.userScrollEnded();
129
+ userBindScrollEnd?.(...args);
130
+ }, [engine, userBindScrollEnd]);
131
+ return <KeyboardAvoidanceActionsContext.Provider value={actions}>
132
+ <scroll-view {...nativeProps} ref={mergedRef} scroll-orientation="vertical" flatten={false} bindlayoutchange={handleLayoutChange} bindtouchstart={handleTouchStart} bindtouchend={handleTouchEnd} bindtouchcancel={handleTouchCancel} bindscroll={handleScroll} bindscrollend={handleScrollEnd}>
133
+ {children}
134
+ <view {...{ ref: spacerRef }} {...spacerProps} />
135
+ </scroll-view>
136
+ </KeyboardAvoidanceActionsContext.Provider>;
137
+ });
138
+ KeyboardAvoidingScrollView.displayName = "KeyboardAvoidingScrollView";
139
+ //#endregion
140
+ export { KeyboardAvoidingScrollView };