@rehagro/ui 1.0.64 → 1.0.65

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/native.mjs CHANGED
@@ -441,6 +441,118 @@ var TextInput = forwardRef(function TextInput2({
441
441
  )
442
442
  ] });
443
443
  });
444
+ var TextArea = forwardRef(function TextArea2({
445
+ label,
446
+ subtitle,
447
+ status = "default",
448
+ size = "md",
449
+ radius = "xs",
450
+ helperText,
451
+ rows = 3,
452
+ editable = true,
453
+ wrapperStyle,
454
+ style,
455
+ borderColor,
456
+ borderWidth = "sm",
457
+ accessibilityLabel,
458
+ ...rest
459
+ }, ref) {
460
+ const theme = useRehagroTheme();
461
+ const [focused, setFocused] = useState(false);
462
+ const isDisabled = editable === false;
463
+ const paddingMap2 = {
464
+ sm: 12,
465
+ md: 14,
466
+ lg: 16
467
+ };
468
+ const fontSizeMap = {
469
+ sm: 14,
470
+ md: 14,
471
+ lg: 16
472
+ };
473
+ const radiusMap2 = {
474
+ none: 0,
475
+ xxs: theme.radiusXxs ?? 4,
476
+ xs: theme.radiusXs ?? 8,
477
+ sm: theme.radiusSm ?? 12,
478
+ md: theme.radiusMd ?? 16,
479
+ lg: theme.radiusLg ?? 24,
480
+ xl: theme.radiusXl ?? 32,
481
+ full: 9999
482
+ };
483
+ const borderWidthMap = {
484
+ sm: theme.borderWidthSm ?? 1,
485
+ md: theme.borderWidthMd ?? 2,
486
+ lg: theme.borderWidthLg ?? 3
487
+ };
488
+ const hasError = status === "error" || !!helperText;
489
+ const effectiveBorderColor = hasError ? theme.danger : focused ? theme.primary : borderColor ?? theme.border;
490
+ const lineHeight = fontSizeMap[size] * 1.4;
491
+ const minHeight = lineHeight * Math.max(rows, 1) + paddingMap2[size] * 2;
492
+ const containerStyle = {
493
+ minHeight,
494
+ paddingHorizontal: paddingMap2[size],
495
+ paddingVertical: paddingMap2[size],
496
+ borderRadius: radiusMap2[radius],
497
+ borderWidth: borderWidthMap[borderWidth],
498
+ borderColor: effectiveBorderColor,
499
+ backgroundColor: isDisabled ? theme.background : theme.surface,
500
+ opacity: isDisabled ? 0.5 : 1
501
+ };
502
+ const inputId = accessibilityLabel ?? label;
503
+ return /* @__PURE__ */ jsxs(View, { style: [{ gap: 4 }, wrapperStyle], children: [
504
+ label && /* @__PURE__ */ jsxs(View, { style: { flexDirection: "row", alignItems: "baseline", gap: 4 }, children: [
505
+ /* @__PURE__ */ jsx(Text, { style: { fontSize: 14, fontWeight: "500", color: theme.text }, children: label }),
506
+ subtitle && /* @__PURE__ */ jsx(
507
+ Text,
508
+ {
509
+ style: {
510
+ fontSize: 14,
511
+ color: subtitle.trim() === "*" ? theme.danger : theme.textMuted
512
+ },
513
+ children: subtitle
514
+ }
515
+ )
516
+ ] }),
517
+ /* @__PURE__ */ jsx(View, { style: [containerStyle, style], children: /* @__PURE__ */ jsx(
518
+ TextInput$1,
519
+ {
520
+ ref,
521
+ editable,
522
+ multiline: true,
523
+ textAlignVertical: "top",
524
+ accessibilityLabel: inputId,
525
+ accessibilityState: { disabled: isDisabled },
526
+ "aria-invalid": status === "error",
527
+ onFocus: (e) => {
528
+ setFocused(true);
529
+ rest.onFocus?.(e);
530
+ },
531
+ onBlur: (e) => {
532
+ setFocused(false);
533
+ rest.onBlur?.(e);
534
+ },
535
+ style: {
536
+ flex: 1,
537
+ fontSize: fontSizeMap[size],
538
+ color: theme.text
539
+ },
540
+ placeholderTextColor: theme.textMuted,
541
+ ...rest
542
+ }
543
+ ) }),
544
+ helperText && /* @__PURE__ */ jsx(
545
+ Text,
546
+ {
547
+ style: {
548
+ fontSize: 12,
549
+ color: hasError ? theme.danger : theme.textMuted
550
+ },
551
+ children: helperText
552
+ }
553
+ )
554
+ ] });
555
+ });
444
556
  var CheckIcon = ({ size, color }) => /* @__PURE__ */ jsx(
445
557
  View,
446
558
  {
@@ -689,7 +801,7 @@ var ActivityIndicator3 = forwardRef(
689
801
  );
690
802
  }
691
803
  );
692
- var Text5 = forwardRef(function Text6({ size = "sm", color = "default", bold = false, style, children, ...rest }, ref) {
804
+ var Text6 = forwardRef(function Text7({ size = "sm", color = "default", bold = false, style, children, ...rest }, ref) {
693
805
  const theme = useRehagroTheme();
694
806
  const colorMap = {
695
807
  default: theme.text ?? "#111827",
@@ -1641,6 +1753,6 @@ var ProgressBar = forwardRef(function ProgressBar2({
1641
1753
  );
1642
1754
  });
1643
1755
 
1644
- export { ActivityIndicator3 as ActivityIndicator, Avatar, Button, Card2 as Card, CardContent, CardFooter, CardHeader, Checkbox, IconButton, ProgressBar, Radio, RadioGroup, RadioOption, RehagroNativeProvider, Select, Tag, Text5 as Text, TextInput, useRehagroTheme };
1756
+ export { ActivityIndicator3 as ActivityIndicator, Avatar, Button, Card2 as Card, CardContent, CardFooter, CardHeader, Checkbox, IconButton, ProgressBar, Radio, RadioGroup, RadioOption, RehagroNativeProvider, Select, Tag, Text6 as Text, TextArea, TextInput, useRehagroTheme };
1645
1757
  //# sourceMappingURL=native.mjs.map
1646
1758
  //# sourceMappingURL=native.mjs.map