@scripso-homepad/ui 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -2,9 +2,264 @@
2
2
 
3
3
  var react = require('react');
4
4
  var reactNative = require('react-native');
5
+ var Svg = require('react-native-svg');
5
6
  var jsxRuntime = require('react/jsx-runtime');
6
7
 
8
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
9
+
10
+ var Svg__default = /*#__PURE__*/_interopDefault(Svg);
11
+
7
12
  // src/components/Button.tsx
13
+
14
+ // src/icons/arrowUpRightPath.ts
15
+ var ARROW_UP_RIGHT_PATH = "M14.1667 14.1668V5.8335H5.83333M14.1667 5.8335L5.83333 14.1668";
16
+ function ArrowUpRightIcon({
17
+ size = 20,
18
+ color = "#08275d",
19
+ strokeWidth = 2
20
+ }) {
21
+ return /* @__PURE__ */ jsxRuntime.jsx(Svg__default.default, { width: size, height: size, viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
22
+ Svg.Path,
23
+ {
24
+ d: ARROW_UP_RIGHT_PATH,
25
+ stroke: color,
26
+ strokeWidth,
27
+ strokeLinecap: "round",
28
+ strokeLinejoin: "round"
29
+ }
30
+ ) });
31
+ }
32
+
33
+ // src/theme/tokens.ts
34
+ var stormGray = {
35
+ "0": "#fbfcfc",
36
+ "0.5": "#eceef0",
37
+ "1": "#dadde0",
38
+ "1.5": "#c7cdd1",
39
+ "2": "#b5bcc1",
40
+ "3": "#8f9aa3",
41
+ "4": "#6a7984",
42
+ "5": "#455765",
43
+ "6": "#374651",
44
+ "7": "#29343d",
45
+ "8": "#1c2328",
46
+ "8.5": "#151a1e"
47
+ };
48
+ var navy = {
49
+ "0": "#f8f9fb",
50
+ "0.5": "#e5e9ef",
51
+ "1": "#cdd3df",
52
+ "1.5": "#b4bece",
53
+ "2": "#9ca8be",
54
+ "3": "#6a7d9e",
55
+ "4": "#39527d",
56
+ "5": "#08275d",
57
+ "6": "#061f4a",
58
+ "7": "#051738",
59
+ "8": "#031025",
60
+ "8.5": "#020c1c"
61
+ };
62
+ var rubyRed = {
63
+ "0": "#fff5f6",
64
+ "0.5": "#f7dddf",
65
+ "1": "#efc4c8",
66
+ "1.5": "#e7acb1",
67
+ "2": "#df939a",
68
+ "3": "#ce626d",
69
+ "4": "#be313f",
70
+ "5": "#ae0011",
71
+ "6": "#8b000e",
72
+ "7": "#68000a",
73
+ "8": "#460007",
74
+ "8.5": "#340005"
75
+ };
76
+ var emeraldGreen = {
77
+ "0": "#f0fbf5",
78
+ "0.5": "#dcf2e5",
79
+ "1": "#c8e8d5",
80
+ "1.5": "#b4dfc5",
81
+ "2": "#a0d5b5",
82
+ "3": "#77c394",
83
+ "4": "#4fb074",
84
+ "5": "#279d54",
85
+ "6": "#1f7e43",
86
+ "7": "#175e32",
87
+ "8": "#103f22",
88
+ "8.5": "#0c2f19"
89
+ };
90
+ var brand = {
91
+ slateBlue: "#182e3c",
92
+ stormGray: stormGray["5"],
93
+ navy: navy["5"],
94
+ rubyRed: rubyRed["5"],
95
+ emeraldGreen: emeraldGreen["5"]
96
+ };
97
+ var colors = {
98
+ // Brand colors
99
+ slateBlue: brand.slateBlue,
100
+ // Emerald Green — Figma scale + brand swatch
101
+ emeraldGreen0: emeraldGreen["0"],
102
+ emeraldGreen50: emeraldGreen["0.5"],
103
+ emeraldGreen100: emeraldGreen["1"],
104
+ emeraldGreen150: emeraldGreen["1.5"],
105
+ emeraldGreen200: emeraldGreen["2"],
106
+ emeraldGreen300: emeraldGreen["3"],
107
+ emeraldGreen400: emeraldGreen["4"],
108
+ emeraldGreen500: emeraldGreen["5"],
109
+ emeraldGreen600: emeraldGreen["6"],
110
+ emeraldGreen700: emeraldGreen["7"],
111
+ emeraldGreen800: emeraldGreen["8"],
112
+ emeraldGreen850: emeraldGreen["8.5"],
113
+ /** Primary brand emerald green — Figma Emerald Green 5 */
114
+ emeraldGreen: brand.emeraldGreen,
115
+ // Ruby Red — Figma scale + brand swatch
116
+ rubyRed0: rubyRed["0"],
117
+ rubyRed50: rubyRed["0.5"],
118
+ rubyRed100: rubyRed["1"],
119
+ rubyRed150: rubyRed["1.5"],
120
+ rubyRed200: rubyRed["2"],
121
+ rubyRed300: rubyRed["3"],
122
+ rubyRed400: rubyRed["4"],
123
+ rubyRed500: rubyRed["5"],
124
+ rubyRed600: rubyRed["6"],
125
+ rubyRed700: rubyRed["7"],
126
+ rubyRed800: rubyRed["8"],
127
+ rubyRed850: rubyRed["8.5"],
128
+ /** Primary brand ruby red — Figma Ruby Red 5 */
129
+ rubyRed: brand.rubyRed,
130
+ // Navy — Figma scale + brand swatch
131
+ navy0: navy["0"],
132
+ navy50: navy["0.5"],
133
+ navy100: navy["1"],
134
+ navy150: navy["1.5"],
135
+ navy200: navy["2"],
136
+ navy300: navy["3"],
137
+ navy400: navy["4"],
138
+ navy500: navy["5"],
139
+ navy600: navy["6"],
140
+ navy700: navy["7"],
141
+ navy800: navy["8"],
142
+ navy850: navy["8.5"],
143
+ /** Primary brand navy — Figma Navy 5 */
144
+ navy: brand.navy,
145
+ // Storm Gray — Figma scale + brand swatch
146
+ stormGray0: stormGray["0"],
147
+ stormGray50: stormGray["0.5"],
148
+ stormGray100: stormGray["1"],
149
+ stormGray150: stormGray["1.5"],
150
+ stormGray200: stormGray["2"],
151
+ stormGray300: stormGray["3"],
152
+ stormGray400: stormGray["4"],
153
+ stormGray500: stormGray["5"],
154
+ /** Figma brand swatch "Storm Gray" — same as `stormGray500` */
155
+ stormGrayBrand: brand.stormGray,
156
+ stormGray600: stormGray["6"],
157
+ stormGray700: stormGray["7"],
158
+ stormGray800: stormGray["8"],
159
+ stormGray850: stormGray["8.5"],
160
+ /** @deprecated Use `stormGray0` */
161
+ storm0: stormGray["0"],
162
+ /** @deprecated Use `stormGray50` */
163
+ storm50: stormGray["0.5"],
164
+ /** @deprecated Use `stormGray200` */
165
+ storm200: stormGray["2"],
166
+ /** @deprecated Use `stormGray300` */
167
+ storm300: stormGray["3"],
168
+ /** @deprecated Use `stormGray500` */
169
+ storm500: stormGray["5"],
170
+ /** @deprecated Use `stormGray700` */
171
+ storm700: stormGray["7"],
172
+ /** @deprecated Use `stormGray850` */
173
+ storm900: stormGray["8.5"],
174
+ countrySelectorSelectedBg: `${stormGray["0.5"]}99`,
175
+ white: "#ffffff",
176
+ error: "#dc2626",
177
+ errorDark: "#b3261e",
178
+ errorLight: "#fee2e2",
179
+ /** @deprecated Use `rubyRed` */
180
+ inputError: brand.rubyRed,
181
+ inputOutlineFocus: navy["0.5"],
182
+ inputOutlineError: rubyRed["0.5"],
183
+ warning: "#92400e",
184
+ warningBg: "#fef3c7",
185
+ success: "#28a745",
186
+ successMuted: "#9fd4a8",
187
+ /** @deprecated Use `emeraldGreen` */
188
+ green: brand.emeraldGreen,
189
+ transparent: "transparent"
190
+ };
191
+ var radii = {
192
+ sm: 8,
193
+ md: 12,
194
+ lg: 16,
195
+ xl: 20,
196
+ full: 9999
197
+ };
198
+ var spacing = {
199
+ xs: 4,
200
+ sm: 8,
201
+ md: 12,
202
+ lg: 16,
203
+ xl: 24,
204
+ xxl: 32
205
+ };
206
+ var fontSize = {
207
+ xs: 11,
208
+ sm: 12,
209
+ md: 14,
210
+ base: 16,
211
+ lg: 18,
212
+ xl: 24,
213
+ xxl: 32
214
+ };
215
+ var fontWeight = {
216
+ regular: "400",
217
+ medium: "500",
218
+ semibold: "600",
219
+ bold: "700"
220
+ };
221
+ var fonts = {
222
+ sans: "Noto Sans Armenian"
223
+ };
224
+ var labelTypography = {
225
+ fontFamily: fonts.sans,
226
+ fontSize: fontSize.sm,
227
+ fontWeight: fontWeight.medium,
228
+ lineHeight: fontSize.sm,
229
+ letterSpacing: 0
230
+ };
231
+ var buttonTypography = {
232
+ lg: {
233
+ fontFamily: fonts.sans,
234
+ fontSize: 14,
235
+ fontWeight: fontWeight.semibold,
236
+ lineHeight: 14,
237
+ letterSpacing: 0
238
+ },
239
+ sm: {
240
+ fontFamily: fonts.sans,
241
+ fontSize: 12,
242
+ fontWeight: fontWeight.semibold,
243
+ lineHeight: 12,
244
+ letterSpacing: 0
245
+ }
246
+ };
247
+ var shadows = {
248
+ card: {
249
+ shadowColor: colors.navy,
250
+ shadowOffset: { width: 0, height: 4 },
251
+ shadowOpacity: 0.05,
252
+ shadowRadius: 20,
253
+ elevation: 2
254
+ },
255
+ cardLg: {
256
+ shadowColor: colors.navy,
257
+ shadowOffset: { width: 0, height: 4 },
258
+ shadowOpacity: 0.1,
259
+ shadowRadius: 20,
260
+ elevation: 4
261
+ }
262
+ };
8
263
  function hasClassList(node) {
9
264
  return typeof node === "object" && node !== null && "classList" in node && typeof node.classList?.add === "function";
10
265
  }
@@ -20,9 +275,9 @@ function resolveWebElement(ref) {
20
275
  }
21
276
  return null;
22
277
  }
23
- function useApplyWebClassName(ref, className) {
278
+ function useApplyWebClassName(ref, className, enabled = true) {
24
279
  react.useLayoutEffect(() => {
25
- if (reactNative.Platform.OS !== "web" || !className?.trim()) return;
280
+ if (!enabled || reactNative.Platform.OS !== "web" || !className?.trim()) return;
26
281
  const element = resolveWebElement(ref);
27
282
  if (!element) return;
28
283
  const classes = className.trim().split(/\s+/);
@@ -30,14 +285,73 @@ function useApplyWebClassName(ref, className) {
30
285
  return () => {
31
286
  element.classList.remove(...classes);
32
287
  };
33
- }, [ref, className]);
288
+ }, [ref, className, enabled]);
34
289
  }
290
+ var variantConfig = {
291
+ white: {
292
+ backgroundColor: colors.white,
293
+ textColor: colors.slateBlue,
294
+ iconBadgeBackgroundColor: colors.stormGray150,
295
+ iconColor: colors.navy
296
+ },
297
+ primary: {
298
+ backgroundColor: colors.navy,
299
+ textColor: colors.stormGray0,
300
+ iconBadgeBackgroundColor: colors.white,
301
+ iconColor: colors.navy
302
+ },
303
+ green: {
304
+ backgroundColor: colors.green,
305
+ textColor: colors.stormGray0,
306
+ iconBadgeBackgroundColor: colors.white,
307
+ iconColor: colors.green
308
+ },
309
+ gray: {
310
+ backgroundColor: colors.stormGray50,
311
+ textColor: colors.slateBlue,
312
+ iconBadgeBackgroundColor: colors.stormGray150,
313
+ iconColor: colors.navy
314
+ }
315
+ };
316
+ var sizeConfig = {
317
+ lg: {
318
+ borderRadius: 16,
319
+ paddingTop: 8,
320
+ paddingRight: 8,
321
+ paddingBottom: 8,
322
+ paddingLeft: 24,
323
+ paddingHorizontalCentered: 24,
324
+ minHeight: 52,
325
+ text: buttonTypography.lg,
326
+ iconContainerSize: 36,
327
+ iconContainerRadius: 12,
328
+ iconContainerPadding: 8,
329
+ iconSize: 20
330
+ },
331
+ sm: {
332
+ borderRadius: 12,
333
+ paddingTop: 8,
334
+ paddingRight: 8,
335
+ paddingBottom: 8,
336
+ paddingLeft: 16,
337
+ paddingHorizontalCentered: 16,
338
+ minHeight: 48,
339
+ text: buttonTypography.sm,
340
+ iconContainerSize: 32,
341
+ iconContainerRadius: 8,
342
+ iconContainerPadding: 8,
343
+ iconSize: 16
344
+ }
345
+ };
35
346
  function Button({
36
347
  title,
348
+ children,
37
349
  onPress,
38
350
  disabled = false,
39
351
  variant = "primary",
40
- size = "medium",
352
+ size = "lg",
353
+ showIcon = false,
354
+ icon,
41
355
  style,
42
356
  textStyle,
43
357
  className,
@@ -45,23 +359,38 @@ function Button({
45
359
  }) {
46
360
  const containerRef = react.useRef(null);
47
361
  const textRef = react.useRef(null);
362
+ const preset = variantConfig[variant];
363
+ const metrics = sizeConfig[size];
48
364
  useApplyWebClassName(containerRef, className);
49
365
  useApplyWebClassName(textRef, textClassName);
366
+ const label = typeof children !== "undefined" ? children : title;
367
+ const hasCustomChildren = typeof children !== "undefined";
368
+ const hasIcon = showIcon || icon != null;
369
+ const iconNode = icon ?? /* @__PURE__ */ jsxRuntime.jsx(ArrowUpRightIcon, { size: metrics.iconSize, color: preset.iconColor });
50
370
  const containerStyle = [
51
371
  styles.base,
52
- variantStyles[variant],
53
- sizeStyles[size],
54
- disabled && disabledVariantStyles[variant],
372
+ {
373
+ borderRadius: metrics.borderRadius,
374
+ backgroundColor: preset.backgroundColor,
375
+ minHeight: metrics.minHeight,
376
+ paddingTop: metrics.paddingTop,
377
+ paddingBottom: metrics.paddingBottom,
378
+ paddingLeft: hasIcon ? metrics.paddingLeft : metrics.paddingHorizontalCentered,
379
+ paddingRight: hasIcon ? metrics.paddingRight : metrics.paddingHorizontalCentered
380
+ },
381
+ hasIcon ? styles.withIcon : styles.centered,
382
+ disabled && styles.disabled,
55
383
  style
56
384
  ];
57
385
  const labelStyle = [
58
- textBaseStyles.base,
59
- textVariantStyles[variant],
60
- textSizeStyles[size],
61
- disabled && textDisabledStyles[variant],
386
+ styles.label,
387
+ metrics.text,
388
+ { color: preset.textColor },
389
+ !hasIcon && styles.labelCentered,
390
+ hasIcon && styles.labelWithIcon,
62
391
  textStyle
63
392
  ];
64
- return /* @__PURE__ */ jsxRuntime.jsx(
393
+ return /* @__PURE__ */ jsxRuntime.jsxs(
65
394
  reactNative.TouchableOpacity,
66
395
  {
67
396
  ref: containerRef,
@@ -71,113 +400,827 @@ function Button({
71
400
  activeOpacity: 0.7,
72
401
  accessibilityRole: "button",
73
402
  accessibilityState: { disabled },
74
- children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { ref: textRef, style: labelStyle, children: title })
403
+ children: [
404
+ hasCustomChildren ? children : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { ref: textRef, style: labelStyle, children: label }),
405
+ hasIcon ? /* @__PURE__ */ jsxRuntime.jsx(
406
+ reactNative.View,
407
+ {
408
+ style: [
409
+ styles.iconContainer,
410
+ {
411
+ width: metrics.iconContainerSize,
412
+ height: metrics.iconContainerSize,
413
+ borderRadius: metrics.iconContainerRadius,
414
+ padding: metrics.iconContainerPadding,
415
+ backgroundColor: preset.iconBadgeBackgroundColor
416
+ }
417
+ ],
418
+ children: iconNode
419
+ }
420
+ ) : null
421
+ ]
75
422
  }
76
423
  );
77
424
  }
78
425
  var styles = reactNative.StyleSheet.create({
79
426
  base: {
427
+ flexDirection: "row",
80
428
  alignItems: "center",
81
- justifyContent: "center",
82
- borderRadius: 8,
83
429
  borderWidth: 0
84
- }
85
- });
86
- var variantStyles = reactNative.StyleSheet.create({
87
- primary: {
88
- backgroundColor: "#2563eb"
89
430
  },
90
- secondary: {
91
- backgroundColor: "#4b5563"
431
+ centered: {
432
+ justifyContent: "center"
92
433
  },
93
- outline: {
94
- backgroundColor: "transparent",
95
- borderWidth: 1,
96
- borderColor: "#2563eb"
434
+ withIcon: {
435
+ justifyContent: "space-between"
97
436
  },
98
- ghost: {
99
- backgroundColor: "transparent"
437
+ disabled: {
438
+ opacity: 0.6
439
+ },
440
+ label: {},
441
+ labelCentered: {
442
+ textAlign: "center"
443
+ },
444
+ labelWithIcon: {
445
+ flex: 1,
446
+ flexShrink: 1,
447
+ marginRight: 8
448
+ },
449
+ iconContainer: {
450
+ alignItems: "center",
451
+ justifyContent: "center",
452
+ flexShrink: 0
100
453
  }
101
454
  });
102
- var sizeStyles = reactNative.StyleSheet.create({
103
- small: {
104
- paddingVertical: 8,
105
- paddingHorizontal: 16,
106
- minWidth: 96
107
- },
108
- medium: {
109
- paddingVertical: 12,
110
- paddingHorizontal: 24,
111
- minWidth: 120
112
- },
113
- large: {
114
- paddingVertical: 16,
115
- paddingHorizontal: 32,
116
- minWidth: 160
455
+ var INPUT_HEIGHT = 52;
456
+ var INPUT_ICON_SIZE = 20;
457
+ var INPUT_ICON_GAP = 10;
458
+ var INPUT_OUTLINE_WIDTH = 2;
459
+ function resolveInputVisualState({
460
+ focused = false,
461
+ error = false,
462
+ disabled = false
463
+ }) {
464
+ if (disabled) return "disabled";
465
+ if (error) return "error";
466
+ if (focused) return "focused";
467
+ return "default";
468
+ }
469
+ function getInputFieldStyles(state) {
470
+ const outlineBase = {
471
+ borderRadius: radii.lg + INPUT_OUTLINE_WIDTH,
472
+ padding: INPUT_OUTLINE_WIDTH,
473
+ backgroundColor: colors.transparent
474
+ };
475
+ switch (state) {
476
+ case "disabled":
477
+ return {
478
+ outline: outlineBase,
479
+ container: {
480
+ borderWidth: 1,
481
+ borderColor: colors.stormGray50,
482
+ backgroundColor: colors.stormGray50
483
+ },
484
+ text: { color: colors.stormGray300 },
485
+ placeholder: colors.stormGray300,
486
+ icon: colors.stormGray150
487
+ };
488
+ case "error":
489
+ return {
490
+ outline: {
491
+ ...outlineBase,
492
+ backgroundColor: colors.inputOutlineError
493
+ },
494
+ container: {
495
+ borderWidth: 1,
496
+ borderColor: colors.inputError,
497
+ backgroundColor: colors.white
498
+ },
499
+ text: { color: colors.inputError },
500
+ placeholder: colors.stormGray200,
501
+ icon: colors.inputError
502
+ };
503
+ case "focused":
504
+ return {
505
+ outline: {
506
+ ...outlineBase,
507
+ backgroundColor: colors.inputOutlineFocus
508
+ },
509
+ container: {
510
+ borderWidth: 1,
511
+ borderColor: colors.navy,
512
+ backgroundColor: colors.white
513
+ },
514
+ text: { color: colors.slateBlue },
515
+ placeholder: colors.stormGray200,
516
+ icon: colors.navy
517
+ };
518
+ default:
519
+ return {
520
+ outline: outlineBase,
521
+ container: {
522
+ borderWidth: 1,
523
+ borderColor: colors.stormGray50,
524
+ backgroundColor: colors.white
525
+ },
526
+ text: { color: colors.slateBlue },
527
+ placeholder: colors.stormGray200,
528
+ icon: colors.stormGray150
529
+ };
117
530
  }
118
- });
119
- var disabledVariantStyles = reactNative.StyleSheet.create({
120
- primary: {
121
- backgroundColor: "#93c5fd",
122
- opacity: 0.7
531
+ }
532
+ var inputFieldMetrics = reactNative.StyleSheet.create({
533
+ container: {
534
+ flexDirection: "row",
535
+ alignItems: "center",
536
+ height: INPUT_HEIGHT,
537
+ minHeight: INPUT_HEIGHT,
538
+ maxHeight: INPUT_HEIGHT,
539
+ borderRadius: radii.lg,
540
+ padding: 16,
541
+ gap: INPUT_ICON_GAP,
542
+ ...reactNative.Platform.OS === "web" ? { boxSizing: "border-box" } : null
123
543
  },
124
- secondary: {
125
- backgroundColor: "#9ca3af",
126
- opacity: 0.7
544
+ input: {
545
+ flex: 1,
546
+ alignSelf: "stretch",
547
+ fontFamily: fonts.sans,
548
+ fontSize: fontSize.md,
549
+ fontWeight: fontWeight.medium,
550
+ lineHeight: fontSize.md,
551
+ paddingVertical: 0,
552
+ paddingHorizontal: 0,
553
+ margin: 0,
554
+ borderWidth: 0,
555
+ backgroundColor: colors.transparent,
556
+ ...reactNative.Platform.OS === "web" ? {
557
+ height: "100%",
558
+ minHeight: 0,
559
+ outlineStyle: "none"
560
+ } : null
561
+ }
562
+ });
563
+ function Label({
564
+ children,
565
+ required = false,
566
+ disabled = false,
567
+ style,
568
+ className,
569
+ ...props
570
+ }) {
571
+ const ref = react.useRef(null);
572
+ useApplyWebClassName(ref, className);
573
+ return /* @__PURE__ */ jsxRuntime.jsxs(
574
+ reactNative.Text,
575
+ {
576
+ ref,
577
+ style: [styles2.label, disabled && styles2.labelDisabled, style],
578
+ accessibilityRole: "text",
579
+ ...props,
580
+ children: [
581
+ children,
582
+ required ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles2.required, children: " *" }) : null
583
+ ]
584
+ }
585
+ );
586
+ }
587
+ var styles2 = reactNative.StyleSheet.create({
588
+ label: {
589
+ ...labelTypography,
590
+ color: colors.slateBlue
127
591
  },
128
- outline: {
129
- borderColor: "#93c5fd",
130
- opacity: 0.7
592
+ labelDisabled: {
593
+ color: colors.stormGray400
131
594
  },
132
- ghost: {
133
- opacity: 0.5
595
+ required: {
596
+ color: colors.inputError
134
597
  }
135
598
  });
136
- var textBaseStyles = reactNative.StyleSheet.create({
137
- base: {
138
- fontWeight: "600"
599
+ function renderInputIcon(icon, color) {
600
+ if (!icon) return null;
601
+ if (react.isValidElement(icon)) {
602
+ return react.cloneElement(icon, {
603
+ size: icon.props.size ?? INPUT_ICON_SIZE,
604
+ color: icon.props.color ?? color
605
+ });
139
606
  }
140
- });
141
- var textVariantStyles = reactNative.StyleSheet.create({
142
- primary: {
143
- color: "#ffffff"
607
+ return icon;
608
+ }
609
+ function Input({
610
+ label,
611
+ leftIcon,
612
+ rightIcon,
613
+ error,
614
+ hint,
615
+ containerStyle,
616
+ style,
617
+ className,
618
+ labelClassName,
619
+ inputClassName,
620
+ errorClassName,
621
+ hintClassName,
622
+ editable = true,
623
+ onFocus,
624
+ onBlur,
625
+ ...props
626
+ }) {
627
+ const wrapperRef = react.useRef(null);
628
+ const inputRef = react.useRef(null);
629
+ const helperRef = react.useRef(null);
630
+ const [focused, setFocused] = react.useState(false);
631
+ useApplyWebClassName(wrapperRef, className);
632
+ useApplyWebClassName(inputRef, inputClassName);
633
+ useApplyWebClassName(helperRef, error ? errorClassName : hintClassName);
634
+ const isDisabled = editable === false;
635
+ const visualState = resolveInputVisualState({
636
+ focused,
637
+ error: Boolean(error),
638
+ disabled: isDisabled
639
+ });
640
+ const fieldStyles = getInputFieldStyles(visualState);
641
+ const iconColor = fieldStyles.icon;
642
+ function handleFocus(event) {
643
+ setFocused(true);
644
+ onFocus?.(event);
645
+ }
646
+ function handleBlur(event) {
647
+ setFocused(false);
648
+ onBlur?.(event);
649
+ }
650
+ const helperMessage = error ?? hint;
651
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { ref: wrapperRef, style: [styles3.wrapper, containerStyle], children: [
652
+ label ? /* @__PURE__ */ jsxRuntime.jsx(Label, { disabled: isDisabled, className: labelClassName, children: label }) : null,
653
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: fieldStyles.outline, children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [inputFieldMetrics.container, fieldStyles.container], children: [
654
+ leftIcon ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles3.iconSlot, children: renderInputIcon(leftIcon, iconColor) }) : null,
655
+ /* @__PURE__ */ jsxRuntime.jsx(
656
+ reactNative.TextInput,
657
+ {
658
+ ref: inputRef,
659
+ style: [
660
+ inputFieldMetrics.input,
661
+ fieldStyles.text,
662
+ style
663
+ ],
664
+ placeholderTextColor: fieldStyles.placeholder,
665
+ editable,
666
+ onFocus: handleFocus,
667
+ onBlur: handleBlur,
668
+ accessibilityState: { disabled: isDisabled },
669
+ ...props
670
+ }
671
+ ),
672
+ rightIcon ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles3.iconSlot, children: renderInputIcon(rightIcon, iconColor) }) : null
673
+ ] }) }),
674
+ helperMessage ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { ref: helperRef, style: error ? styles3.error : styles3.hint, children: helperMessage }) : null
675
+ ] });
676
+ }
677
+ var styles3 = reactNative.StyleSheet.create({
678
+ wrapper: {
679
+ width: "100%",
680
+ gap: spacing.sm
144
681
  },
145
- secondary: {
146
- color: "#ffffff"
682
+ iconSlot: {
683
+ width: INPUT_ICON_SIZE,
684
+ height: INPUT_ICON_SIZE,
685
+ alignItems: "center",
686
+ justifyContent: "center",
687
+ flexShrink: 0
147
688
  },
148
- outline: {
149
- color: "#2563eb"
689
+ error: {
690
+ fontSize: 12,
691
+ lineHeight: 12,
692
+ color: colors.inputError
150
693
  },
151
- ghost: {
152
- color: "#2563eb"
694
+ hint: {
695
+ fontSize: 12,
696
+ lineHeight: 12,
697
+ color: colors.stormGray300
153
698
  }
154
699
  });
155
- var textSizeStyles = reactNative.StyleSheet.create({
156
- small: {
157
- fontSize: 14
700
+
701
+ // src/data/countries.ts
702
+ var defaultCountry = {
703
+ code: "AM",
704
+ name: "Armenia",
705
+ dialCode: "+374"
706
+ };
707
+ var countries = [
708
+ defaultCountry,
709
+ { code: "AF", name: "Afghanistan", dialCode: "+93" },
710
+ { code: "AL", name: "Albania", dialCode: "+355" },
711
+ { code: "DZ", name: "Algeria", dialCode: "+213" },
712
+ { code: "AR", name: "Argentina", dialCode: "+54" },
713
+ { code: "AU", name: "Australia", dialCode: "+61" },
714
+ { code: "AT", name: "Austria", dialCode: "+43" },
715
+ { code: "AZ", name: "Azerbaijan", dialCode: "+994" },
716
+ { code: "BH", name: "Bahrain", dialCode: "+973" },
717
+ { code: "BY", name: "Belarus", dialCode: "+375" },
718
+ { code: "BE", name: "Belgium", dialCode: "+32" },
719
+ { code: "BR", name: "Brazil", dialCode: "+55" },
720
+ { code: "BG", name: "Bulgaria", dialCode: "+359" },
721
+ { code: "CA", name: "Canada", dialCode: "+1" },
722
+ { code: "CL", name: "Chile", dialCode: "+56" },
723
+ { code: "CN", name: "China", dialCode: "+86" },
724
+ { code: "CO", name: "Colombia", dialCode: "+57" },
725
+ { code: "HR", name: "Croatia", dialCode: "+385" },
726
+ { code: "CY", name: "Cyprus", dialCode: "+357" },
727
+ { code: "CZ", name: "Czech Republic", dialCode: "+420" },
728
+ { code: "DK", name: "Denmark", dialCode: "+45" },
729
+ { code: "EG", name: "Egypt", dialCode: "+20" },
730
+ { code: "EE", name: "Estonia", dialCode: "+372" },
731
+ { code: "FI", name: "Finland", dialCode: "+358" },
732
+ { code: "FR", name: "France", dialCode: "+33" },
733
+ { code: "GE", name: "Georgia", dialCode: "+995" },
734
+ { code: "DE", name: "Germany", dialCode: "+49" },
735
+ { code: "GR", name: "Greece", dialCode: "+30" },
736
+ { code: "HK", name: "Hong Kong", dialCode: "+852" },
737
+ { code: "HU", name: "Hungary", dialCode: "+36" },
738
+ { code: "IN", name: "India", dialCode: "+91" },
739
+ { code: "ID", name: "Indonesia", dialCode: "+62" },
740
+ { code: "IR", name: "Iran", dialCode: "+98" },
741
+ { code: "IQ", name: "Iraq", dialCode: "+964" },
742
+ { code: "IE", name: "Ireland", dialCode: "+353" },
743
+ { code: "IL", name: "Israel", dialCode: "+972" },
744
+ { code: "IT", name: "Italy", dialCode: "+39" },
745
+ { code: "JP", name: "Japan", dialCode: "+81" },
746
+ { code: "JO", name: "Jordan", dialCode: "+962" },
747
+ { code: "KZ", name: "Kazakhstan", dialCode: "+7" },
748
+ { code: "KW", name: "Kuwait", dialCode: "+965" },
749
+ { code: "LV", name: "Latvia", dialCode: "+371" },
750
+ { code: "LB", name: "Lebanon", dialCode: "+961" },
751
+ { code: "LT", name: "Lithuania", dialCode: "+370" },
752
+ { code: "LU", name: "Luxembourg", dialCode: "+352" },
753
+ { code: "MY", name: "Malaysia", dialCode: "+60" },
754
+ { code: "MX", name: "Mexico", dialCode: "+52" },
755
+ { code: "MD", name: "Moldova", dialCode: "+373" },
756
+ { code: "NL", name: "Netherlands", dialCode: "+31" },
757
+ { code: "NZ", name: "New Zealand", dialCode: "+64" },
758
+ { code: "NG", name: "Nigeria", dialCode: "+234" },
759
+ { code: "NO", name: "Norway", dialCode: "+47" },
760
+ { code: "PK", name: "Pakistan", dialCode: "+92" },
761
+ { code: "PS", name: "Palestine", dialCode: "+970" },
762
+ { code: "PH", name: "Philippines", dialCode: "+63" },
763
+ { code: "PL", name: "Poland", dialCode: "+48" },
764
+ { code: "PT", name: "Portugal", dialCode: "+351" },
765
+ { code: "QA", name: "Qatar", dialCode: "+974" },
766
+ { code: "RO", name: "Romania", dialCode: "+40" },
767
+ { code: "RU", name: "Russia", dialCode: "+7" },
768
+ { code: "SA", name: "Saudi Arabia", dialCode: "+966" },
769
+ { code: "RS", name: "Serbia", dialCode: "+381" },
770
+ { code: "SG", name: "Singapore", dialCode: "+65" },
771
+ { code: "SK", name: "Slovakia", dialCode: "+421" },
772
+ { code: "SI", name: "Slovenia", dialCode: "+386" },
773
+ { code: "ZA", name: "South Africa", dialCode: "+27" },
774
+ { code: "KR", name: "South Korea", dialCode: "+82" },
775
+ { code: "ES", name: "Spain", dialCode: "+34" },
776
+ { code: "SE", name: "Sweden", dialCode: "+46" },
777
+ { code: "CH", name: "Switzerland", dialCode: "+41" },
778
+ { code: "SY", name: "Syria", dialCode: "+963" },
779
+ { code: "TW", name: "Taiwan", dialCode: "+886" },
780
+ { code: "TH", name: "Thailand", dialCode: "+66" },
781
+ { code: "TR", name: "Turkey", dialCode: "+90" },
782
+ { code: "UA", name: "Ukraine", dialCode: "+380" },
783
+ { code: "AE", name: "United Arab Emirates", dialCode: "+971" },
784
+ { code: "GB", name: "United Kingdom", dialCode: "+44" },
785
+ { code: "US", name: "United States", dialCode: "+1" },
786
+ { code: "UZ", name: "Uzbekistan", dialCode: "+998" },
787
+ { code: "VN", name: "Vietnam", dialCode: "+84" }
788
+ ];
789
+ function findCountry(code) {
790
+ return countries.find((country) => country.code === code) ?? defaultCountry;
791
+ }
792
+
793
+ // src/icons/chevronDownPath.ts
794
+ var CHEVRON_DOWN_PATH = "M4 6L8 10L12 6";
795
+ function ChevronDownIcon({
796
+ size = 16,
797
+ color = "#dadde0",
798
+ strokeWidth = 2
799
+ }) {
800
+ return /* @__PURE__ */ jsxRuntime.jsx(Svg__default.default, { width: size, height: size, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
801
+ Svg.Path,
802
+ {
803
+ d: CHEVRON_DOWN_PATH,
804
+ stroke: color,
805
+ strokeWidth,
806
+ strokeLinecap: "round",
807
+ strokeLinejoin: "round"
808
+ }
809
+ ) });
810
+ }
811
+
812
+ // src/utils/countryFlag.ts
813
+ function countryCodeToFlagEmoji(code) {
814
+ const upper = code.trim().toUpperCase();
815
+ if (upper.length !== 2) return "";
816
+ return String.fromCodePoint(
817
+ ...upper.split("").map((char) => 127462 - 65 + char.charCodeAt(0))
818
+ );
819
+ }
820
+ var COUNTRY_DROPDOWN_SCROLL_CLASS = "hp-country-dropdown-scroll";
821
+ var STYLE_ID = "hp-country-dropdown-scroll-styles";
822
+ var countryDropdownScrollCss = `
823
+ .${COUNTRY_DROPDOWN_SCROLL_CLASS} {
824
+ scrollbar-width: thin;
825
+ scrollbar-color: ${colors.stormGray300} transparent;
826
+ overflow-y: auto;
827
+ }
828
+
829
+ .${COUNTRY_DROPDOWN_SCROLL_CLASS}::-webkit-scrollbar {
830
+ width: 4px;
831
+ }
832
+
833
+ .${COUNTRY_DROPDOWN_SCROLL_CLASS}::-webkit-scrollbar-corner {
834
+ background: transparent;
835
+ }
836
+
837
+ .${COUNTRY_DROPDOWN_SCROLL_CLASS}::-webkit-scrollbar-button,
838
+ .${COUNTRY_DROPDOWN_SCROLL_CLASS}::-webkit-scrollbar-button:single-button,
839
+ .${COUNTRY_DROPDOWN_SCROLL_CLASS}::-webkit-scrollbar-button:vertical:start:decrement,
840
+ .${COUNTRY_DROPDOWN_SCROLL_CLASS}::-webkit-scrollbar-button:vertical:end:increment {
841
+ display: none;
842
+ width: 0;
843
+ height: 0;
844
+ -webkit-appearance: none;
845
+ appearance: none;
846
+ }
847
+
848
+ .${COUNTRY_DROPDOWN_SCROLL_CLASS}::-webkit-scrollbar-track {
849
+ background: transparent;
850
+ }
851
+
852
+ .${COUNTRY_DROPDOWN_SCROLL_CLASS}::-webkit-scrollbar-thumb {
853
+ background-color: ${colors.stormGray300};
854
+ border-radius: 9999px;
855
+ }
856
+ `;
857
+ function ensureCountryDropdownScrollStyles() {
858
+ if (reactNative.Platform.OS !== "web" || typeof document === "undefined") return;
859
+ if (document.getElementById(STYLE_ID)) return;
860
+ const style = document.createElement("style");
861
+ style.id = STYLE_ID;
862
+ style.textContent = countryDropdownScrollCss;
863
+ document.head.appendChild(style);
864
+ }
865
+ var DROPDOWN_GAP = 10;
866
+ var DROPDOWN_HEIGHT = 186;
867
+ var DROPDOWN_PADDING = 8;
868
+ var OPTION_GAP = 10;
869
+ var OPTION_HEIGHT = 35;
870
+ var TRIGGER_HEIGHT = 52;
871
+ var CHEVRON_SIZE = 16;
872
+ function resolveDropdownTop(anchor) {
873
+ const windowHeight = reactNative.Dimensions.get("window").height;
874
+ const topBelow = anchor.y + anchor.height + DROPDOWN_GAP;
875
+ const topAbove = anchor.y - DROPDOWN_GAP - DROPDOWN_HEIGHT;
876
+ const fitsBelow = topBelow + DROPDOWN_HEIGHT <= windowHeight;
877
+ if (fitsBelow) return topBelow;
878
+ if (topAbove >= 0) return topAbove;
879
+ return Math.max(0, Math.min(topBelow, windowHeight - DROPDOWN_HEIGHT));
880
+ }
881
+ function CountryCodeSelector({
882
+ value = defaultCountry.code,
883
+ onValueChange,
884
+ options = countries,
885
+ disabled = false,
886
+ style,
887
+ className
888
+ }) {
889
+ const wrapperRef = react.useRef(null);
890
+ const triggerRef = react.useRef(null);
891
+ const scrollRef = react.useRef(null);
892
+ const [open, setOpen] = react.useState(false);
893
+ const [anchor, setAnchor] = react.useState(null);
894
+ useApplyWebClassName(wrapperRef, className);
895
+ useApplyWebClassName(
896
+ scrollRef,
897
+ COUNTRY_DROPDOWN_SCROLL_CLASS,
898
+ open && Boolean(anchor)
899
+ );
900
+ react.useLayoutEffect(() => {
901
+ ensureCountryDropdownScrollStyles();
902
+ }, []);
903
+ const selected = findCountry(value);
904
+ const textColor = disabled ? colors.stormGray200 : colors.slateBlue;
905
+ function closeDropdown() {
906
+ setOpen(false);
907
+ setAnchor(null);
908
+ }
909
+ function handleOpen() {
910
+ if (disabled) return;
911
+ triggerRef.current?.measureInWindow((x, y, width, height) => {
912
+ setAnchor({ x, y, width, height });
913
+ setOpen(true);
914
+ });
915
+ }
916
+ function handleSelect(code) {
917
+ onValueChange?.(code);
918
+ closeDropdown();
919
+ }
920
+ const dropdownTop = anchor ? resolveDropdownTop(anchor) : 0;
921
+ const optionList = options.map((item, index) => {
922
+ const isSelected = item.code === selected.code;
923
+ const isLast = index === options.length - 1;
924
+ return /* @__PURE__ */ jsxRuntime.jsxs(
925
+ reactNative.Pressable,
926
+ {
927
+ accessibilityRole: "button",
928
+ onPress: () => handleSelect(item.code),
929
+ style: [
930
+ styles4.option,
931
+ isSelected && styles4.optionSelected,
932
+ !isLast && styles4.optionSpacing
933
+ ],
934
+ children: [
935
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles4.flag, children: countryCodeToFlagEmoji(item.code) }),
936
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles4.optionDialCode, children: item.dialCode })
937
+ ]
938
+ },
939
+ item.code
940
+ );
941
+ });
942
+ const dropdownList = /* @__PURE__ */ jsxRuntime.jsx(
943
+ reactNative.ScrollView,
944
+ {
945
+ ref: scrollRef,
946
+ style: styles4.dropdownScroll,
947
+ contentContainerStyle: styles4.dropdownContent,
948
+ keyboardShouldPersistTaps: "handled",
949
+ showsVerticalScrollIndicator: true,
950
+ bounces: false,
951
+ nestedScrollEnabled: true,
952
+ children: optionList
953
+ }
954
+ );
955
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { ref: wrapperRef, style: [styles4.root, style], children: [
956
+ /* @__PURE__ */ jsxRuntime.jsxs(
957
+ reactNative.Pressable,
958
+ {
959
+ ref: triggerRef,
960
+ accessibilityRole: "button",
961
+ disabled,
962
+ onPress: handleOpen,
963
+ style: [
964
+ styles4.trigger,
965
+ disabled ? styles4.triggerDisabled : styles4.triggerEnabled,
966
+ reactNative.Platform.OS === "web" ? styles4.triggerWeb : null
967
+ ],
968
+ children: [
969
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles4.flag, children: countryCodeToFlagEmoji(selected.code) }),
970
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles4.dialCode, { color: textColor }], children: selected.dialCode }),
971
+ /* @__PURE__ */ jsxRuntime.jsx(ChevronDownIcon, { size: CHEVRON_SIZE, color: colors.stormGray100 })
972
+ ]
973
+ }
974
+ ),
975
+ /* @__PURE__ */ jsxRuntime.jsx(
976
+ reactNative.Modal,
977
+ {
978
+ visible: open,
979
+ transparent: true,
980
+ animationType: "fade",
981
+ onRequestClose: closeDropdown,
982
+ children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { style: styles4.overlay, onPress: closeDropdown, children: anchor ? /* @__PURE__ */ jsxRuntime.jsx(
983
+ reactNative.View,
984
+ {
985
+ style: [
986
+ styles4.dropdown,
987
+ {
988
+ top: dropdownTop,
989
+ left: anchor.x,
990
+ width: anchor.width
991
+ }
992
+ ],
993
+ children: dropdownList
994
+ }
995
+ ) : null })
996
+ }
997
+ )
998
+ ] });
999
+ }
1000
+ var styles4 = reactNative.StyleSheet.create({
1001
+ root: {
1002
+ alignSelf: "flex-start",
1003
+ flexShrink: 0
1004
+ },
1005
+ trigger: {
1006
+ flexDirection: "row",
1007
+ alignItems: "center",
1008
+ alignSelf: "flex-start",
1009
+ flexGrow: 0,
1010
+ flexShrink: 0,
1011
+ height: TRIGGER_HEIGHT,
1012
+ borderRadius: radii.lg,
1013
+ borderWidth: 1,
1014
+ padding: spacing.lg,
1015
+ gap: spacing.sm
1016
+ },
1017
+ triggerEnabled: {
1018
+ borderColor: colors.stormGray50,
1019
+ backgroundColor: colors.white
1020
+ },
1021
+ triggerDisabled: {
1022
+ borderColor: colors.stormGray50,
1023
+ backgroundColor: colors.stormGray50
1024
+ },
1025
+ triggerWeb: {
1026
+ width: "max-content"
1027
+ },
1028
+ flag: {
1029
+ fontSize: 18,
1030
+ lineHeight: 22
1031
+ },
1032
+ dialCode: {
1033
+ fontSize: fontSize.md,
1034
+ fontWeight: fontWeight.medium
1035
+ },
1036
+ overlay: {
1037
+ flex: 1,
1038
+ backgroundColor: "transparent"
1039
+ },
1040
+ dropdown: {
1041
+ position: "absolute",
1042
+ height: DROPDOWN_HEIGHT,
1043
+ borderRadius: radii.lg,
1044
+ borderWidth: 1,
1045
+ borderColor: colors.stormGray50,
1046
+ backgroundColor: colors.white,
1047
+ padding: DROPDOWN_PADDING,
1048
+ overflow: "hidden"
1049
+ },
1050
+ dropdownScroll: {
1051
+ flex: 1
158
1052
  },
159
- medium: {
160
- fontSize: 16
1053
+ dropdownContent: {
1054
+ flexGrow: 1
161
1055
  },
162
- large: {
163
- fontSize: 18
1056
+ option: {
1057
+ flexDirection: "row",
1058
+ alignItems: "center",
1059
+ height: OPTION_HEIGHT,
1060
+ borderRadius: radii.sm,
1061
+ padding: spacing.sm,
1062
+ gap: spacing.sm
1063
+ },
1064
+ optionSpacing: {
1065
+ marginBottom: OPTION_GAP
1066
+ },
1067
+ optionSelected: {
1068
+ backgroundColor: colors.countrySelectorSelectedBg
1069
+ },
1070
+ optionDialCode: {
1071
+ fontFamily: fonts.sans,
1072
+ fontSize: fontSize.md,
1073
+ fontWeight: fontWeight.regular,
1074
+ lineHeight: fontSize.md,
1075
+ letterSpacing: 0,
1076
+ textAlign: "center",
1077
+ color: colors.slateBlue
164
1078
  }
165
1079
  });
166
- var textDisabledStyles = reactNative.StyleSheet.create({
167
- primary: {
168
- color: "#e5e7eb"
1080
+ function PhoneInput({
1081
+ label,
1082
+ countryCode,
1083
+ onCountryCodeChange,
1084
+ error,
1085
+ hint,
1086
+ containerStyle,
1087
+ style,
1088
+ className,
1089
+ labelClassName,
1090
+ inputClassName,
1091
+ errorClassName,
1092
+ hintClassName,
1093
+ editable = true,
1094
+ onFocus,
1095
+ onBlur,
1096
+ ...props
1097
+ }) {
1098
+ const wrapperRef = react.useRef(null);
1099
+ const inputRef = react.useRef(null);
1100
+ const helperRef = react.useRef(null);
1101
+ const [focused, setFocused] = react.useState(false);
1102
+ useApplyWebClassName(wrapperRef, className);
1103
+ useApplyWebClassName(inputRef, inputClassName);
1104
+ useApplyWebClassName(helperRef, error ? errorClassName : hintClassName);
1105
+ const isDisabled = editable === false;
1106
+ const phoneVisualState = resolveInputVisualState({
1107
+ focused,
1108
+ error: Boolean(error),
1109
+ disabled: isDisabled
1110
+ });
1111
+ const phoneFieldStyles = getInputFieldStyles(phoneVisualState);
1112
+ function handleFocus(event) {
1113
+ setFocused(true);
1114
+ onFocus?.(event);
1115
+ }
1116
+ function handleBlur(event) {
1117
+ setFocused(false);
1118
+ onBlur?.(event);
1119
+ }
1120
+ const helperMessage = error ?? hint;
1121
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { ref: wrapperRef, style: [styles5.wrapper, containerStyle], children: [
1122
+ label ? /* @__PURE__ */ jsxRuntime.jsx(Label, { disabled: isDisabled, className: labelClassName, children: label }) : null,
1123
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles5.row, children: [
1124
+ /* @__PURE__ */ jsxRuntime.jsx(
1125
+ CountryCodeSelector,
1126
+ {
1127
+ value: countryCode,
1128
+ onValueChange: onCountryCodeChange,
1129
+ disabled: isDisabled,
1130
+ style: styles5.countrySelector
1131
+ }
1132
+ ),
1133
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles5.phoneColumn, children: [
1134
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [phoneFieldStyles.outline, styles5.phoneOutline], children: /* @__PURE__ */ jsxRuntime.jsx(
1135
+ reactNative.View,
1136
+ {
1137
+ style: [
1138
+ inputFieldMetrics.container,
1139
+ phoneFieldStyles.container,
1140
+ styles5.phoneField
1141
+ ],
1142
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1143
+ reactNative.TextInput,
1144
+ {
1145
+ ref: inputRef,
1146
+ style: [
1147
+ inputFieldMetrics.input,
1148
+ phoneFieldStyles.text,
1149
+ style
1150
+ ],
1151
+ keyboardType: "phone-pad",
1152
+ placeholderTextColor: phoneFieldStyles.placeholder,
1153
+ editable,
1154
+ onFocus: handleFocus,
1155
+ onBlur: handleBlur,
1156
+ accessibilityState: { disabled: isDisabled },
1157
+ ...props
1158
+ }
1159
+ )
1160
+ }
1161
+ ) }),
1162
+ helperMessage ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { ref: helperRef, style: error ? styles5.error : styles5.hint, children: helperMessage }) : null
1163
+ ] })
1164
+ ] })
1165
+ ] });
1166
+ }
1167
+ var styles5 = reactNative.StyleSheet.create({
1168
+ wrapper: {
1169
+ width: "100%",
1170
+ gap: spacing.sm
1171
+ },
1172
+ row: {
1173
+ flexDirection: "row",
1174
+ alignItems: "flex-start",
1175
+ gap: INPUT_ICON_GAP
1176
+ },
1177
+ countrySelector: {
1178
+ flexShrink: 0,
1179
+ alignSelf: "flex-start"
1180
+ },
1181
+ phoneColumn: {
1182
+ flex: 1,
1183
+ gap: spacing.sm
1184
+ },
1185
+ phoneOutline: {
1186
+ width: "100%"
169
1187
  },
170
- secondary: {
171
- color: "#f3f4f6"
1188
+ phoneField: {
1189
+ flex: 1
172
1190
  },
173
- outline: {
174
- color: "#93c5fd"
1191
+ error: {
1192
+ fontSize: 12,
1193
+ lineHeight: 12,
1194
+ color: colors.inputError
175
1195
  },
176
- ghost: {
177
- color: "#93c5fd"
1196
+ hint: {
1197
+ fontSize: 12,
1198
+ lineHeight: 12,
1199
+ color: colors.stormGray300
178
1200
  }
179
1201
  });
180
1202
 
181
1203
  exports.Button = Button;
1204
+ exports.CountryCodeSelector = CountryCodeSelector;
1205
+ exports.Input = Input;
1206
+ exports.Label = Label;
1207
+ exports.PhoneInput = PhoneInput;
1208
+ exports.brand = brand;
1209
+ exports.buttonTypography = buttonTypography;
1210
+ exports.colors = colors;
1211
+ exports.countries = countries;
1212
+ exports.defaultCountry = defaultCountry;
1213
+ exports.emeraldGreen = emeraldGreen;
1214
+ exports.findCountry = findCountry;
1215
+ exports.fontSize = fontSize;
1216
+ exports.fontWeight = fontWeight;
1217
+ exports.fonts = fonts;
1218
+ exports.labelTypography = labelTypography;
1219
+ exports.navy = navy;
1220
+ exports.radii = radii;
1221
+ exports.rubyRed = rubyRed;
1222
+ exports.shadows = shadows;
1223
+ exports.spacing = spacing;
1224
+ exports.stormGray = stormGray;
182
1225
  //# sourceMappingURL=index.cjs.map
183
1226
  //# sourceMappingURL=index.cjs.map