@cdx-ui/components 0.0.1-alpha.35 → 0.0.1-alpha.37

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 (77) hide show
  1. package/lib/commonjs/components/{Form/FormLabelRoot.js → Field/FieldLabel.js} +4 -4
  2. package/lib/commonjs/components/Field/FieldLabel.js.map +1 -0
  3. package/lib/commonjs/components/{Form/FormLabelRoot.web.js → Field/FieldLabel.web.js} +9 -5
  4. package/lib/commonjs/components/Field/FieldLabel.web.js.map +1 -0
  5. package/lib/commonjs/components/Field/index.js +158 -0
  6. package/lib/commonjs/components/Field/index.js.map +1 -0
  7. package/lib/commonjs/components/Field/styles.js +16 -0
  8. package/lib/commonjs/components/Field/styles.js.map +1 -0
  9. package/lib/commonjs/components/Form/FormRoot.js.map +1 -1
  10. package/lib/commonjs/components/Form/index.js +6 -213
  11. package/lib/commonjs/components/Form/index.js.map +1 -1
  12. package/lib/commonjs/components/Form/styles.js +1 -49
  13. package/lib/commonjs/components/Form/styles.js.map +1 -1
  14. package/lib/commonjs/components/OtpInput/index.js +83 -0
  15. package/lib/commonjs/components/OtpInput/index.js.map +1 -0
  16. package/lib/commonjs/components/OtpInput/styles.js +48 -0
  17. package/lib/commonjs/components/OtpInput/styles.js.map +1 -0
  18. package/lib/commonjs/components/index.js +24 -0
  19. package/lib/commonjs/components/index.js.map +1 -1
  20. package/lib/module/components/{Form/FormLabelRoot.js → Field/FieldLabel.js} +3 -3
  21. package/lib/module/components/Field/FieldLabel.js.map +1 -0
  22. package/lib/module/components/Field/FieldLabel.web.js +17 -0
  23. package/lib/module/components/Field/FieldLabel.web.js.map +1 -0
  24. package/lib/module/components/Field/index.js +155 -0
  25. package/lib/module/components/Field/index.js.map +1 -0
  26. package/lib/module/components/Field/styles.js +12 -0
  27. package/lib/module/components/Field/styles.js.map +1 -0
  28. package/lib/module/components/Form/FormRoot.js.map +1 -1
  29. package/lib/module/components/Form/index.js +8 -216
  30. package/lib/module/components/Form/index.js.map +1 -1
  31. package/lib/module/components/Form/styles.js +0 -48
  32. package/lib/module/components/Form/styles.js.map +1 -1
  33. package/lib/module/components/OtpInput/index.js +79 -0
  34. package/lib/module/components/OtpInput/index.js.map +1 -0
  35. package/lib/module/components/OtpInput/styles.js +44 -0
  36. package/lib/module/components/OtpInput/styles.js.map +1 -0
  37. package/lib/module/components/index.js +2 -0
  38. package/lib/module/components/index.js.map +1 -1
  39. package/lib/typescript/components/{Form/FormLabelRoot.d.ts → Field/FieldLabel.d.ts} +5 -5
  40. package/lib/typescript/components/Field/FieldLabel.d.ts.map +1 -0
  41. package/lib/typescript/components/{Form/FormLabelRoot.web.d.ts → Field/FieldLabel.web.d.ts} +3 -7
  42. package/lib/typescript/components/Field/FieldLabel.web.d.ts.map +1 -0
  43. package/lib/typescript/components/Field/index.d.ts +26 -0
  44. package/lib/typescript/components/Field/index.d.ts.map +1 -0
  45. package/lib/typescript/components/Field/styles.d.ts +16 -0
  46. package/lib/typescript/components/Field/styles.d.ts.map +1 -0
  47. package/lib/typescript/components/Form/FormRoot.d.ts +2 -0
  48. package/lib/typescript/components/Form/FormRoot.d.ts.map +1 -1
  49. package/lib/typescript/components/Form/index.d.ts +4 -61
  50. package/lib/typescript/components/Form/index.d.ts.map +1 -1
  51. package/lib/typescript/components/Form/styles.d.ts +0 -20
  52. package/lib/typescript/components/Form/styles.d.ts.map +1 -1
  53. package/lib/typescript/components/OtpInput/index.d.ts +11 -0
  54. package/lib/typescript/components/OtpInput/index.d.ts.map +1 -0
  55. package/lib/typescript/components/OtpInput/styles.d.ts +14 -0
  56. package/lib/typescript/components/OtpInput/styles.d.ts.map +1 -0
  57. package/lib/typescript/components/index.d.ts +2 -0
  58. package/lib/typescript/components/index.d.ts.map +1 -1
  59. package/package.json +4 -4
  60. package/src/components/{Form/FormLabelRoot.tsx → Field/FieldLabel.tsx} +4 -4
  61. package/src/components/Field/FieldLabel.web.tsx +25 -0
  62. package/src/components/Field/index.tsx +171 -0
  63. package/src/components/Field/styles.ts +32 -0
  64. package/src/components/Form/FormRoot.tsx +1 -0
  65. package/src/components/Form/index.tsx +11 -245
  66. package/src/components/Form/styles.ts +1 -73
  67. package/src/components/OtpInput/index.tsx +79 -0
  68. package/src/components/OtpInput/styles.ts +45 -0
  69. package/src/components/index.ts +2 -0
  70. package/lib/commonjs/components/Form/FormLabelRoot.js.map +0 -1
  71. package/lib/commonjs/components/Form/FormLabelRoot.web.js.map +0 -1
  72. package/lib/module/components/Form/FormLabelRoot.js.map +0 -1
  73. package/lib/module/components/Form/FormLabelRoot.web.js +0 -13
  74. package/lib/module/components/Form/FormLabelRoot.web.js.map +0 -1
  75. package/lib/typescript/components/Form/FormLabelRoot.d.ts.map +0 -1
  76. package/lib/typescript/components/Form/FormLabelRoot.web.d.ts.map +0 -1
  77. package/src/components/Form/FormLabelRoot.web.tsx +0 -18
@@ -1,36 +1,19 @@
1
1
  "use strict";
2
2
 
3
- import { forwardRef } from 'react';
4
- import { Text, View } from 'react-native';
3
+ import React, { forwardRef } from 'react';
5
4
  import { createForm } from '@cdx-ui/primitives';
6
- import { cn, withStyleContext, useStyleContext } from '@cdx-ui/utils';
7
- import { Icon } from '../Icon';
5
+ import { cn } from '@cdx-ui/utils';
8
6
  import { BaseFormRoot } from './FormRoot';
9
- import { FormLabelRoot } from './FormLabelRoot';
10
- import { formRootVariants, formFieldVariants, formLabelVariants, formHelperVariants, formHelperTextVariants, formErrorVariants, formErrorTextVariants, formErrorIconVariants } from './styles';
11
-
12
- // =============================================================================
13
- // SCOPE + CONTEXT
14
- // =============================================================================
15
- import { jsx as _jsx } from "react/jsx-runtime";
16
- const SCOPE = 'FORM';
17
- const FieldRoot = withStyleContext(View, SCOPE);
18
- const useFormStyleContext = () => useStyleContext(SCOPE);
7
+ import { formRootVariants } from './styles';
19
8
 
20
9
  // =============================================================================
21
10
  // PRIMITIVE
22
11
  // =============================================================================
23
-
12
+ import { jsx as _jsx } from "react/jsx-runtime";
24
13
  const FormPrimitive = createForm({
25
- Root: BaseFormRoot,
26
- Field: FieldRoot,
27
- Error: View,
28
- ErrorText: Text,
29
- ErrorIcon: View,
30
- Label: FormLabelRoot,
31
- Helper: View,
32
- HelperText: Text
14
+ Root: BaseFormRoot
33
15
  });
16
+ FormPrimitive.displayName = 'FormPrimitive';
34
17
 
35
18
  // =============================================================================
36
19
  // FORM ROOT (container — <form> on web, <View> on RN)
@@ -54,199 +37,8 @@ const FormRoot = /*#__PURE__*/forwardRef(({
54
37
  FormRoot.displayName = 'Form';
55
38
 
56
39
  // =============================================================================
57
- // FORM FIELD (per-field wrapper — provides context for label/error/helper/input)
58
- // =============================================================================
59
-
60
- /**
61
- * Field wrapper + context. For **initial focus**, pass `autoFocus` on `Input.Field` (not here).
62
- */
63
-
64
- const FormField = /*#__PURE__*/forwardRef(({
65
- size = 'default',
66
- className,
67
- children,
68
- style,
69
- ...props
70
- }, ref) => {
71
- const computedClassName = cn(formFieldVariants(), className);
72
- return /*#__PURE__*/_jsx(FormPrimitive.Field, {
73
- ref: ref,
74
- className: computedClassName,
75
- style: style,
76
- context: {
77
- size
78
- },
79
- ...props,
80
- children: children
81
- });
82
- });
83
- FormField.displayName = 'Form.Field';
84
-
85
- // =============================================================================
86
- // FORM LABEL
87
- // =============================================================================
88
-
89
- // TODO: Accept accessibility labels for required indicator as props to support i18n
90
-
91
- const FormLabel = /*#__PURE__*/forwardRef(({
92
- className,
93
- children,
94
- style,
95
- htmlFor,
96
- ...props
97
- }, ref) => {
98
- const {
99
- size
100
- } = useFormStyleContext();
101
- const labelClassName = cn(formLabelVariants({
102
- size
103
- }), className);
104
- return /*#__PURE__*/_jsx(FormPrimitive.Label, {
105
- ref: ref,
106
- className: labelClassName,
107
- style: style,
108
- htmlFor: htmlFor,
109
- requiredIndicator: /*#__PURE__*/_jsx(Text, {
110
- className: "text-red-500",
111
- "aria-hidden": true,
112
- children: ' *'
113
- }),
114
- ...props,
115
- children: children
116
- });
117
- });
118
- FormLabel.displayName = 'Form.Label';
119
-
120
- // =============================================================================
121
- // FORM HELPER
122
- // =============================================================================
123
-
124
- const FormHelper = /*#__PURE__*/forwardRef(({
125
- className,
126
- children,
127
- style,
128
- ...props
129
- }, ref) => {
130
- const computedClassName = cn(formHelperVariants(), className);
131
- return /*#__PURE__*/_jsx(FormPrimitive.Helper, {
132
- ref: ref,
133
- className: computedClassName,
134
- style: style,
135
- ...props,
136
- children: children
137
- });
138
- });
139
- FormHelper.displayName = 'Form.Helper';
140
-
141
- // =============================================================================
142
- // FORM HELPER TEXT
143
- // =============================================================================
144
-
145
- const FormHelperText = /*#__PURE__*/forwardRef(({
146
- className,
147
- children,
148
- style,
149
- ...props
150
- }, ref) => {
151
- const {
152
- size
153
- } = useFormStyleContext();
154
- const computedClassName = cn(formHelperTextVariants({
155
- size
156
- }), className);
157
- return /*#__PURE__*/_jsx(FormPrimitive.HelperText, {
158
- ref: ref,
159
- className: computedClassName,
160
- style: style,
161
- ...props,
162
- children: children
163
- });
164
- });
165
- FormHelperText.displayName = 'Form.HelperText';
166
-
167
- // =============================================================================
168
- // FORM ERROR
40
+ // EXPORT
169
41
  // =============================================================================
170
42
 
171
- const FormError = /*#__PURE__*/forwardRef(({
172
- className,
173
- children,
174
- style,
175
- ...props
176
- }, ref) => {
177
- const computedClassName = cn(formErrorVariants(), className);
178
- return /*#__PURE__*/_jsx(FormPrimitive.Error, {
179
- ref: ref,
180
- className: computedClassName,
181
- style: style,
182
- ...props,
183
- children: children
184
- });
185
- });
186
- FormError.displayName = 'Form.Error';
187
-
188
- // =============================================================================
189
- // FORM ERROR TEXT
190
- // =============================================================================
191
-
192
- const FormErrorText = /*#__PURE__*/forwardRef(({
193
- className,
194
- children,
195
- style,
196
- ...props
197
- }, ref) => {
198
- const {
199
- size
200
- } = useFormStyleContext();
201
- const computedClassName = cn(formErrorTextVariants({
202
- size
203
- }), className);
204
- return /*#__PURE__*/_jsx(FormPrimitive.ErrorText, {
205
- ref: ref,
206
- className: computedClassName,
207
- style: style,
208
- ...props,
209
- children: children
210
- });
211
- });
212
- FormErrorText.displayName = 'Form.ErrorText';
213
-
214
- // =============================================================================
215
- // FORM ERROR ICON
216
- // =============================================================================
217
-
218
- const FormErrorIcon = ({
219
- className,
220
- style,
221
- as,
222
- ...props
223
- }) => {
224
- const {
225
- size
226
- } = useFormStyleContext();
227
- const computedClassName = cn(formErrorIconVariants({
228
- size
229
- }), className);
230
- return /*#__PURE__*/_jsx(Icon, {
231
- as: as,
232
- className: computedClassName,
233
- style: style,
234
- ...props
235
- });
236
- };
237
- FormErrorIcon.displayName = 'Form.ErrorIcon';
238
-
239
- // =============================================================================
240
- // COMPOUND EXPORT
241
- // =============================================================================
242
-
243
- export const Form = Object.assign(FormRoot, {
244
- Field: FormField,
245
- Label: FormLabel,
246
- Helper: FormHelper,
247
- HelperText: FormHelperText,
248
- Error: FormError,
249
- ErrorText: FormErrorText,
250
- ErrorIcon: FormErrorIcon
251
- });
43
+ export const Form = FormRoot;
252
44
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["forwardRef","Text","View","createForm","cn","withStyleContext","useStyleContext","Icon","BaseFormRoot","FormLabelRoot","formRootVariants","formFieldVariants","formLabelVariants","formHelperVariants","formHelperTextVariants","formErrorVariants","formErrorTextVariants","formErrorIconVariants","jsx","_jsx","SCOPE","FieldRoot","useFormStyleContext","FormPrimitive","Root","Field","Error","ErrorText","ErrorIcon","Label","Helper","HelperText","FormRoot","className","children","style","props","ref","computedClassName","displayName","FormField","size","context","FormLabel","htmlFor","labelClassName","requiredIndicator","FormHelper","FormHelperText","FormError","FormErrorText","FormErrorIcon","as","Form","Object","assign"],"sourceRoot":"../../../../src","sources":["components/Form/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,QAAwB,OAAO;AAClD,SAASC,IAAI,EAAEC,IAAI,QAAwC,cAAc;AACzE,SAASC,UAAU,QAA+C,oBAAoB;AACtF,SAASC,EAAE,EAAEC,gBAAgB,EAAEC,eAAe,Q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,EAAEK,iBAAkB;IAACH,KAAK,EAAEA,KAAM;IAAA,GAAKC;EAAK,CAAG,CAAC;AAChF,CAAC;AAEDe,aAAa,CAACZ,WAAW,GAAG,gBAAgB;;AAE5C;AACA;AACA;;AAYA,OAAO,MAAMc,IAAI,GAAGC,MAAM,CAACC,MAAM,CAACvB,QAAQ,EAAE;EAC1CP,KAAK,EAAEe,SAAS;EAChBX,KAAK,EAAEc,SAAS;EAChBb,MAAM,EAAEiB,UAAU;EAClBhB,UAAU,EAAEiB,cAAc;EAC1BtB,KAAK,EAAEuB,SAAS;EAChBtB,SAAS,EAAEuB,aAAa;EACxBtB,SAAS,EAAEuB;AACb,CAAC,CAA0B","ignoreList":[]}
1
+ {"version":3,"names":["React","forwardRef","createForm","cn","BaseFormRoot","formRootVariants","jsx","_jsx","FormPrimitive","Root","displayName","FormRoot","className","children","style","props","ref","computedClassName","Form"],"sourceRoot":"../../../../src","sources":["components/Form/index.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AAEzC,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,QAAQ,eAAe;AAClC,SAASC,YAAY,QAAgC,YAAY;AACjE,SAASC,gBAAgB,QAAQ,UAAU;;AAE3C;AACA;AACA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAEA,MAAMC,aAAa,GAAGN,UAAU,CAAC;EAAEO,IAAI,EAAEL;AAAa,CAAC,CAAC;AAExDI,aAAa,CAACE,WAAW,GAAG,eAAe;;AAE3C;AACA;AACA;;AAIA,MAAMC,QAAQ,gBAAGV,UAAU,CAAkB,CAAC;EAAEW,SAAS;EAAEC,QAAQ;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EAC9F,MAAMC,iBAAiB,GAAGd,EAAE,CAACE,gBAAgB,CAAC,CAAC,EAAEO,SAAS,CAAC;EAE3D,oBACEL,IAAA,CAACC,aAAa;IAACQ,GAAG,EAAEA,GAAI;IAACJ,SAAS,EAAEK,iBAAkB;IAACH,KAAK,EAAEA,KAAM;IAAA,GAAKC,KAAK;IAAAF,QAAA,EAC3EA;EAAQ,CACI,CAAC;AAEpB,CAAC,CAAC;AAEFF,QAAQ,CAACD,WAAW,GAAG,MAAM;;AAE7B;AACA;AACA;;AAEA,OAAO,MAAMQ,IAAI,GAAGP,QAAQ","ignoreList":[]}
@@ -1,53 +1,5 @@
1
1
  "use strict";
2
2
 
3
3
  import { cva } from 'class-variance-authority';
4
- import { COLOR_TEXT_INVALID, COLOR_TEXT_SECONDARY, DISABLED_OPACITY } from '../../styles/primitives';
5
4
  export const formRootVariants = cva(['flex-col gap-4']);
6
- export const formFieldVariants = cva(['flex-col gap-1.5 mb-4', 'web:last:mb-0', DISABLED_OPACITY]);
7
- export const formLabelVariants = cva(['flex-row items-center', DISABLED_OPACITY, 'web:cursor-pointer', 'font-medium data-[invalid=true]:text-red-600'], {
8
- variants: {
9
- size: {
10
- default: 'text-sm',
11
- small: 'text-xs'
12
- }
13
- },
14
- defaultVariants: {
15
- size: 'default'
16
- }
17
- });
18
- export const formHelperVariants = cva(['flex-row items-center']);
19
- export const formHelperTextVariants = cva([COLOR_TEXT_SECONDARY], {
20
- variants: {
21
- size: {
22
- default: 'text-xs',
23
- small: 'text-[11px]'
24
- }
25
- },
26
- defaultVariants: {
27
- size: 'default'
28
- }
29
- });
30
- export const formErrorVariants = cva(['flex-row items-center gap-1']);
31
- export const formErrorTextVariants = cva([COLOR_TEXT_INVALID, 'font-medium'], {
32
- variants: {
33
- size: {
34
- default: 'text-xs',
35
- small: 'text-[11px]'
36
- }
37
- },
38
- defaultVariants: {
39
- size: 'default'
40
- }
41
- });
42
- export const formErrorIconVariants = cva([COLOR_TEXT_INVALID], {
43
- variants: {
44
- size: {
45
- default: 'size-3.5',
46
- small: 'size-3'
47
- }
48
- },
49
- defaultVariants: {
50
- size: 'default'
51
- }
52
- });
53
5
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["cva","COLOR_TEXT_INVALID","COLOR_TEXT_SECONDARY","DISABLED_OPACITY","formRootVariants","formFieldVariants","formLabelVariants","variants","size","default","small","defaultVariants","formHelperVariants","formHelperTextVariants","formErrorVariants","formErrorTextVariants","formErrorIconVariants"],"sourceRoot":"../../../../src","sources":["components/Form/styles.ts"],"mappings":";;AAAA,SAASA,GAAG,QAA2B,0BAA0B;AACjE,SACEC,kBAAkB,EAClBC,oBAAoB,EACpBC,gBAAgB,QACX,yBAAyB;AAEhC,OAAO,MAAMC,gBAAgB,GAAGJ,GAAG,CAAC,CAAC,gBAAgB,CAAC,CAAC;AAEvD,OAAO,MAAMK,iBAAiB,GAAGL,GAAG,CAAC,CAAC,uBAAuB,EAAE,eAAe,EAAEG,gBAAgB,CAAC,CAAC;AAElG,OAAO,MAAMG,iBAAiB,GAAGN,GAAG,CAClC,CACE,uBAAuB,EACvBG,gBAAgB,EAChB,oBAAoB,EACpB,8CAA8C,CAC/C,EACD;EACEI,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,OAAO,EAAE,SAAS;MAClBC,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfH,IAAI,EAAE;EACR;AACF,CACF,CAAC;AAED,OAAO,MAAMI,kBAAkB,GAAGZ,GAAG,CAAC,CAAC,uBAAuB,CAAC,CAAC;AAEhE,OAAO,MAAMa,sBAAsB,GAAGb,GAAG,CAAC,CAACE,oBAAoB,CAAC,EAAE;EAChEK,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,OAAO,EAAE,SAAS;MAClBC,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfH,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAEF,OAAO,MAAMM,iBAAiB,GAAGd,GAAG,CAAC,CAAC,6BAA6B,CAAC,CAAC;AAErE,OAAO,MAAMe,qBAAqB,GAAGf,GAAG,CAAC,CAACC,kBAAkB,EAAE,aAAa,CAAC,EAAE;EAC5EM,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,OAAO,EAAE,SAAS;MAClBC,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfH,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAEF,OAAO,MAAMQ,qBAAqB,GAAGhB,GAAG,CAAC,CAACC,kBAAkB,CAAC,EAAE;EAC7DM,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,OAAO,EAAE,UAAU;MACnBC,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfH,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["cva","formRootVariants"],"sourceRoot":"../../../../src","sources":["components/Form/styles.ts"],"mappings":";;AAAA,SAASA,GAAG,QAAQ,0BAA0B;AAE9C,OAAO,MAAMC,gBAAgB,GAAGD,GAAG,CAAC,CAAC,gBAAgB,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+
3
+ import { forwardRef } from 'react';
4
+ import { createOtpInput } from '@cdx-ui/primitives';
5
+ import { cn, useStyleContext, withStyleContext } from '@cdx-ui/utils';
6
+ import { HStack } from '../Stack/HStack';
7
+ import { Input } from '../Input';
8
+ import { otpCellVariants, otpFieldVariants, otpRootVariants } from './styles';
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ const SCOPE = 'OTP_INPUT';
11
+ const OtpRoot = withStyleContext(HStack, SCOPE);
12
+ const useOtpInputStyleContext = () => useStyleContext(SCOPE);
13
+ const OtpStyledCell = /*#__PURE__*/forwardRef(({
14
+ className,
15
+ children,
16
+ ...props
17
+ }, ref) => {
18
+ const {
19
+ size,
20
+ variant
21
+ } = useOtpInputStyleContext();
22
+ return /*#__PURE__*/_jsx(Input, {
23
+ ref: ref,
24
+ variant: variant,
25
+ size: size,
26
+ className: cn(otpCellVariants({
27
+ size
28
+ }), className),
29
+ ...props,
30
+ children: children
31
+ });
32
+ });
33
+ OtpStyledCell.displayName = 'OtpInput.Cell';
34
+ const OtpStyledField = /*#__PURE__*/forwardRef(({
35
+ className,
36
+ ...props
37
+ }, ref) => {
38
+ const {
39
+ size
40
+ } = useOtpInputStyleContext();
41
+ return /*#__PURE__*/_jsx(Input.Field, {
42
+ ref: ref,
43
+ className: cn(otpFieldVariants({
44
+ size
45
+ }), className),
46
+ ...props
47
+ });
48
+ });
49
+ OtpStyledField.displayName = 'OtpInput.Field';
50
+ const OtpPrimitive = createOtpInput({
51
+ Root: OtpRoot,
52
+ Cell: OtpStyledCell,
53
+ Field: OtpStyledField
54
+ });
55
+ export const OtpInput = /*#__PURE__*/forwardRef(({
56
+ variant = 'outline',
57
+ size = 'default',
58
+ fullWidth = true,
59
+ className,
60
+ style,
61
+ ...rest
62
+ }, ref) => {
63
+ const rootClassName = cn(otpRootVariants({
64
+ size,
65
+ fullWidth
66
+ }), className);
67
+ return /*#__PURE__*/_jsx(OtpPrimitive, {
68
+ ref: ref,
69
+ className: rootClassName,
70
+ style: style,
71
+ context: {
72
+ variant,
73
+ size
74
+ },
75
+ ...rest
76
+ });
77
+ });
78
+ OtpInput.displayName = 'OtpInput';
79
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["forwardRef","createOtpInput","cn","useStyleContext","withStyleContext","HStack","Input","otpCellVariants","otpFieldVariants","otpRootVariants","jsx","_jsx","SCOPE","OtpRoot","useOtpInputStyleContext","OtpStyledCell","className","children","props","ref","size","variant","displayName","OtpStyledField","Field","OtpPrimitive","Root","Cell","OtpInput","fullWidth","style","rest","rootClassName","context"],"sourceRoot":"../../../../src","sources":["components/OtpInput/index.tsx"],"mappings":";;AACA,SAASA,UAAU,QAAQ,OAAO;AAElC,SAASC,cAAc,QAAiC,oBAAoB;AAC5E,SAASC,EAAE,EAAEC,eAAe,EAAEC,gBAAgB,QAAQ,eAAe;AACrE,SAASC,MAAM,QAAQ,iBAAiB;AACxC,SAASC,KAAK,QAAyB,UA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EAClCyB,IAAI,EAAEb,OAAO;EACbc,IAAI,EAAEZ,aAAa;EACnBS,KAAK,EAAED;AACT,CAAC,CAAC;AAQF,OAAO,MAAMK,QAAQ,gBAAG5B,UAAU,CAChC,CAAC;EAAEqB,OAAO,GAAG,SAAS;EAAED,IAAI,GAAG,SAAS;EAAES,SAAS,GAAG,IAAI;EAAEb,SAAS;EAAEc,KAAK;EAAE,GAAGC;AAAK,CAAC,EAAEZ,GAAG,KAAK;EAC/F,MAAMa,aAAa,GAAG9B,EAAE,CAACO,eAAe,CAAC;IAAEW,IAAI;IAAES;EAAU,CAAC,CAAC,EAAEb,SAAS,CAAC;EAEzE,oBACEL,IAAA,CAACc,YAAY;IACXN,GAAG,EAAEA,GAAI;IACTH,SAAS,EAAEgB,aAAc;IACzBF,KAAK,EAAEA,KAAM;IACbG,OAAO,EAAE;MAAEZ,OAAO;MAAED;IAAK,CAAE;IAAA,GACvBW;EAAI,CACT,CAAC;AAEN,CACF,CAAC;AAEDH,QAAQ,CAACN,WAAW,GAAG,UAAU","ignoreList":[]}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ import { cva } from 'class-variance-authority';
4
+ export const otpRootVariants = cva('flex-row items-stretch gap-2.5', {
5
+ variants: {
6
+ size: {
7
+ default: '',
8
+ small: ''
9
+ },
10
+ fullWidth: {
11
+ true: 'w-full self-stretch justify-center',
12
+ false: 'self-start'
13
+ }
14
+ },
15
+ defaultVariants: {
16
+ size: 'default',
17
+ fullWidth: true
18
+ }
19
+ });
20
+
21
+ /** Narrow cell chrome: overrides Input root `w-full` / wide horizontal padding for one digit. */
22
+ export const otpCellVariants = cva('shrink-0 justify-center', {
23
+ variants: {
24
+ size: {
25
+ default: 'w-12 min-w-12 max-w-12 px-1',
26
+ small: 'w-10 min-w-10 max-w-10 px-0.5'
27
+ }
28
+ },
29
+ defaultVariants: {
30
+ size: 'default'
31
+ }
32
+ });
33
+ export const otpFieldVariants = cva('min-w-0 w-full text-center tabular-nums', {
34
+ variants: {
35
+ size: {
36
+ default: 'text-xl leading-6',
37
+ small: 'text-base leading-5'
38
+ }
39
+ },
40
+ defaultVariants: {
41
+ size: 'default'
42
+ }
43
+ });
44
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["cva","otpRootVariants","variants","size","default","small","fullWidth","true","false","defaultVariants","otpCellVariants","otpFieldVariants"],"sourceRoot":"../../../../src","sources":["components/OtpInput/styles.ts"],"mappings":";;AAAA,SAASA,GAAG,QAA2B,0BAA0B;AAEjE,OAAO,MAAMC,eAAe,GAAGD,GAAG,CAAC,gCAAgC,EAAE;EACnEE,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,OAAO,EAAE,EAAE;MACXC,KAAK,EAAE;IACT,CAAC;IACDC,SAAS,EAAE;MACTC,IAAI,EAAE,oCAAoC;MAC1CC,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfN,IAAI,EAAE,SAAS;IACfG,SAAS,EAAE;EACb;AACF,CAAC,CAAC;;AAEF;AACA,OAAO,MAAMI,eAAe,GAAGV,GAAG,CAAC,yBAAyB,EAAE;EAC5DE,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,OAAO,EAAE,6BAA6B;MACtCC,KAAK,EAAE;IACT;EACF,CAAC;EACDI,eAAe,EAAE;IACfN,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAEF,OAAO,MAAMQ,gBAAgB,GAAGX,GAAG,CAAC,yCAAyC,EAAE;EAC7EE,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,OAAO,EAAE,mBAAmB;MAC5BC,KAAK,EAAE;IACT;EACF,CAAC;EACDI,eAAe,EAAE;IACfN,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
@@ -9,9 +9,11 @@ export * from './Card';
9
9
  export * from './Checkbox';
10
10
  export * from './Chip';
11
11
  export * from './Dialog';
12
+ export * from './Field';
12
13
  export * from './Form';
13
14
  export * from './Image';
14
15
  export * from './Input';
16
+ export * from './OtpInput';
15
17
  export * from './Link';
16
18
  export * from './ProgressBar';
17
19
  export * from './ProgressSegmented';
@@ -1 +1 @@
1
- {"version":3,"names":["HStack","VStack"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,eAAe;AAC7B,cAAc,OAAO;AACrB,cAAc,UAAU;AACxB,cAAc,QAAQ;AACtB,cAAc,YAAY;AAC1B,cAAc,QAAQ;AACtB,cAAc,UAAU;AACxB,cAAc,QAAQ;AACtB,cAAc,SAAS;AACvB,cAAc,SAAS;AACvB,cAAc,QAAQ;AACtB,cAAc,eAAe;AAC7B,cAAc,qBAAqB;AACnC,cAAc,UAAU;AACxB,cAAc,mBAAmB;AACjC,cAAc,UAAU;AACxB,SAASA,MAAM,EAAEC,MAAM,QAAQ,SAAS;AACxC,cAAc,WAAW;AACzB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["HStack","VStack"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,eAAe;AAC7B,cAAc,OAAO;AACrB,cAAc,UAAU;AACxB,cAAc,QAAQ;AACtB,cAAc,YAAY;AAC1B,cAAc,QAAQ;AACtB,cAAc,UAAU;AACxB,cAAc,SAAS;AACvB,cAAc,QAAQ;AACtB,cAAc,SAAS;AACvB,cAAc,SAAS;AACvB,cAAc,YAAY;AAC1B,cAAc,QAAQ;AACtB,cAAc,eAAe;AAC7B,cAAc,qBAAqB;AACnC,cAAc,UAAU;AACxB,cAAc,mBAAmB;AACjC,cAAc,UAAU;AACxB,SAASA,MAAM,EAAEC,MAAM,QAAQ,SAAS;AACxC,cAAc,WAAW;AACzB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,cAAc","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import { Text, TextProps, type GestureResponderEvent } from 'react-native';
2
- export type FormLabelRootProps = TextProps & {
3
- /** @platform web — forwarded on web; ignored here (see `FormLabelRoot.web`). */
2
+ export type BaseFieldLabelProps = TextProps & {
3
+ /** @platform web — forwarded on web; ignored here (see `FieldLabelRoot.web`). */
4
4
  htmlFor?: string;
5
5
  /** Optional; composed with label tap-to-focus on native. */
6
6
  onPress?: ((event: GestureResponderEvent) => void) | null;
@@ -9,10 +9,10 @@ export type FormLabelRootProps = TextProps & {
9
9
  * Native: `Text` label row — tap focuses the field input via form context
10
10
  * (parity with `<label htmlFor>` on web).
11
11
  */
12
- export declare const FormLabelRoot: import("react").ForwardRefExoticComponent<TextProps & {
13
- /** @platform web — forwarded on web; ignored here (see `FormLabelRoot.web`). */
12
+ export declare const BaseFieldLabel: import("react").ForwardRefExoticComponent<TextProps & {
13
+ /** @platform web — forwarded on web; ignored here (see `FieldLabelRoot.web`). */
14
14
  htmlFor?: string;
15
15
  /** Optional; composed with label tap-to-focus on native. */
16
16
  onPress?: ((event: GestureResponderEvent) => void) | null;
17
17
  } & import("react").RefAttributes<Text>>;
18
- //# sourceMappingURL=FormLabelRoot.d.ts.map
18
+ //# sourceMappingURL=FieldLabel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldLabel.d.ts","sourceRoot":"","sources":["../../../../src/components/Field/FieldLabel.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAG3E,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG;IAC5C,iFAAiF;IACjF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;CAC3D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc;IAVzB,iFAAiF;cACvE,MAAM;IAChB,4DAA4D;cAClD,CAAC,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC,GAAG,IAAI;wCAsB1D,CAAC"}
@@ -1,20 +1,16 @@
1
1
  import React, { type ReactNode } from 'react';
2
2
  import type { ViewProps } from 'react-native';
3
- export type FormLabelRootProps = ViewProps & {
3
+ export type BaseFieldLabelProps = ViewProps & {
4
4
  htmlFor?: string;
5
5
  children?: ReactNode;
6
- /** Mirrors field invalid state from form context (`data-[invalid=true]` styling). */
7
- 'data-invalid'?: string;
8
6
  /** @platform native — ignored on DOM `<label>`; set by form primitive for Uniwind. */
9
7
  dataSet?: Record<string, string>;
10
8
  };
11
9
  /** Real `<label>` so clicking the label focuses the associated control (`htmlFor` → input `id`). */
12
- export declare const FormLabelRoot: React.ForwardRefExoticComponent<ViewProps & {
10
+ export declare const BaseFieldLabel: React.ForwardRefExoticComponent<ViewProps & {
13
11
  htmlFor?: string;
14
12
  children?: ReactNode;
15
- /** Mirrors field invalid state from form context (`data-[invalid=true]` styling). */
16
- 'data-invalid'?: string;
17
13
  /** @platform native — ignored on DOM `<label>`; set by form primitive for Uniwind. */
18
14
  dataSet?: Record<string, string>;
19
15
  } & React.RefAttributes<HTMLLabelElement>>;
20
- //# sourceMappingURL=FormLabelRoot.web.d.ts.map
16
+ //# sourceMappingURL=FieldLabel.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldLabel.web.d.ts","sourceRoot":"","sources":["../../../../src/components/Field/FieldLabel.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,sFAAsF;IACtF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,CAAC;AAEF,oGAAoG;AACpG,eAAO,MAAM,cAAc;cAPf,MAAM;eACL,SAAS;IACpB,sFAAsF;cAC5E,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;0CAahC,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { View } from 'react-native';
2
+ import { IFieldErrorProps, IFieldHelperProps, IFieldLabelProps, type IFieldRootProps } from '@cdx-ui/primitives';
3
+ import { type FieldRootVariantProps, type FieldLabelVariantProps, type FieldHelperVariantProps, type FieldErrorVariantProps } from './styles';
4
+ /**
5
+ * Field wrapper + context. For **initial focus**, pass `autoFocus` on `Input.Field` (not here).
6
+ */
7
+ export interface FieldRootProps extends IFieldRootProps, FieldRootVariantProps {
8
+ }
9
+ declare const FieldRoot: import("react").ForwardRefExoticComponent<FieldRootProps & import("react").RefAttributes<View>>;
10
+ export interface FieldLabelProps extends IFieldLabelProps, FieldLabelVariantProps {
11
+ }
12
+ declare const FieldLabel: import("react").ForwardRefExoticComponent<FieldLabelProps & import("react").RefAttributes<View>>;
13
+ export interface FieldHelperProps extends IFieldHelperProps, FieldHelperVariantProps {
14
+ }
15
+ declare const FieldHelper: import("react").ForwardRefExoticComponent<FieldHelperProps & import("react").RefAttributes<View>>;
16
+ export interface FieldErrorProps extends IFieldErrorProps, FieldErrorVariantProps {
17
+ }
18
+ declare const FieldError: import("react").ForwardRefExoticComponent<FieldErrorProps & import("react").RefAttributes<View>>;
19
+ type FieldCompoundComponent = typeof FieldRoot & {
20
+ Label: typeof FieldLabel;
21
+ Helper: typeof FieldHelper;
22
+ Error: typeof FieldError;
23
+ };
24
+ export declare const Field: FieldCompoundComponent;
25
+ export {};
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Field/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,IAAI,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAEL,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,eAAe,EACrB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAQL,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC5B,MAAM,UAAU,CAAC;AAoBlB;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,eAAe,EAAE,qBAAqB;CAAG;AAEjF,QAAA,MAAM,SAAS,iGAUd,CAAC;AAQF,MAAM,WAAW,eAAgB,SAAQ,gBAAgB,EAAE,sBAAsB;CAAG;AAEpF,QAAA,MAAM,UAAU,kGAqBf,CAAC;AAQF,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB,EAAE,uBAAuB;CAAG;AAEvF,QAAA,MAAM,WAAW,mGAWhB,CAAC;AAwBF,MAAM,WAAW,eAAgB,SAAQ,gBAAgB,EAAE,sBAAsB;CAAG;AAEpF,QAAA,MAAM,UAAU,kGAcf,CAAC;AAQF,KAAK,sBAAsB,GAAG,OAAO,SAAS,GAAG;IAC/C,KAAK,EAAE,OAAO,UAAU,CAAC;IACzB,MAAM,EAAE,OAAO,WAAW,CAAC;IAC3B,KAAK,EAAE,OAAO,UAAU,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,KAAK,EAIZ,sBAAsB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ export declare const fieldRootVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
3
+ export declare const fieldLabelVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
4
+ export declare const fieldHelperVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
5
+ export declare const fieldHelperTextVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
6
+ export declare const fieldErrorVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
7
+ export declare const fieldErrorTextVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
8
+ export declare const fieldErrorIconVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
9
+ export type FieldRootVariantProps = VariantProps<typeof fieldRootVariants>;
10
+ export type FieldLabelVariantProps = VariantProps<typeof fieldLabelVariants>;
11
+ export type FieldHelperVariantProps = VariantProps<typeof fieldHelperVariants>;
12
+ export type FieldHelperTextVariantProps = VariantProps<typeof fieldHelperTextVariants>;
13
+ export type FieldErrorVariantProps = VariantProps<typeof fieldErrorVariants>;
14
+ export type FieldErrorTextVariantProps = VariantProps<typeof fieldErrorTextVariants>;
15
+ export type FieldErrorIconVariantProps = VariantProps<typeof fieldErrorIconVariants>;
16
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Field/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,eAAO,MAAM,iBAAiB,oFAA6D,CAAC;AAE5F,eAAO,MAAM,kBAAkB,oFAQ7B,CAAC;AAEH,eAAO,MAAM,mBAAmB,oFAAiC,CAAC;AAElE,eAAO,MAAM,uBAAuB,oFAA4C,CAAC;AAEjF,eAAO,MAAM,kBAAkB,oFAAuC,CAAC;AAEvE,eAAO,MAAM,sBAAsB,oFAA0C,CAAC;AAE9E,eAAO,MAAM,sBAAsB,oFAA2C,CAAC;AAE/E,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC3E,MAAM,MAAM,sBAAsB,GAAG,YAAY,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC7E,MAAM,MAAM,uBAAuB,GAAG,YAAY,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAC/E,MAAM,MAAM,2BAA2B,GAAG,YAAY,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACvF,MAAM,MAAM,sBAAsB,GAAG,YAAY,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC7E,MAAM,MAAM,0BAA0B,GAAG,YAAY,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACrF,MAAM,MAAM,0BAA0B,GAAG,YAAY,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -3,10 +3,12 @@ export type BaseFormRootProps = ViewProps & {
3
3
  onSubmit?: (e: React.SyntheticEvent) => void;
4
4
  action?: string | ((formData: FormData) => void | Promise<void>);
5
5
  method?: string;
6
+ className?: string;
6
7
  };
7
8
  export declare const BaseFormRoot: import("react").ForwardRefExoticComponent<ViewProps & {
8
9
  onSubmit?: (e: React.SyntheticEvent) => void;
9
10
  action?: string | ((formData: FormData) => void | Promise<void>);
10
11
  method?: string;
12
+ className?: string;
11
13
  } & import("react").RefAttributes<View>>;
12
14
  //# sourceMappingURL=FormRoot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormRoot.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/FormRoot.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG;IAC1C,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,cAAc,KAAK,IAAI,CAAC;IAC7C,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,YAAY;eALZ,CAAC,CAAC,EAAE,KAAK,CAAC,cAAc,KAAK,IAAI;aACnC,MAAM,GAAG,CAAC,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;aACvD,MAAM;wCAUhB,CAAC"}
1
+ {"version":3,"file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