@rehagro/ui 1.0.63 → 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.d.mts CHANGED
@@ -237,6 +237,59 @@ declare const TextInput: React__default.ForwardRefExoticComponent<Omit<TextInput
237
237
  borderWidth?: TextInputBorderWidth;
238
238
  } & React__default.RefAttributes<TextInput$1>>;
239
239
 
240
+ type TextAreaStatus = "default" | "error";
241
+ type TextAreaSize = "sm" | "md" | "lg";
242
+ type TextAreaRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
243
+ type TextAreaBorderWidth = "sm" | "md" | "lg";
244
+ type TextAreaProps = Omit<TextInputProps$1, "style" | "multiline"> & {
245
+ /** Label text displayed above the textarea */
246
+ label?: string;
247
+ /** Subtitle displayed next to the label. Use "*" for the required marker. */
248
+ subtitle?: string;
249
+ /** Validation status */
250
+ status?: TextAreaStatus;
251
+ /** Text/padding size */
252
+ size?: TextAreaSize;
253
+ /** Border radius */
254
+ radius?: TextAreaRadius;
255
+ /** Helper/error message displayed below the textarea */
256
+ helperText?: React__default.ReactNode;
257
+ /** Number of visible text rows (default 3) */
258
+ rows?: number;
259
+ /** Custom style for the outermost wrapper */
260
+ wrapperStyle?: StyleProp<ViewStyle>;
261
+ /** Custom style for the textarea container */
262
+ style?: StyleProp<ViewStyle>;
263
+ /** Custom border color. Overrides the resting border color from `status`/`focused`. */
264
+ borderColor?: string;
265
+ /** Border width token (`sm` 1px, `md` 2px, `lg` 3px). */
266
+ borderWidth?: TextAreaBorderWidth;
267
+ };
268
+ declare const TextArea: React__default.ForwardRefExoticComponent<Omit<TextInputProps$1, "style" | "multiline"> & {
269
+ /** Label text displayed above the textarea */
270
+ label?: string;
271
+ /** Subtitle displayed next to the label. Use "*" for the required marker. */
272
+ subtitle?: string;
273
+ /** Validation status */
274
+ status?: TextAreaStatus;
275
+ /** Text/padding size */
276
+ size?: TextAreaSize;
277
+ /** Border radius */
278
+ radius?: TextAreaRadius;
279
+ /** Helper/error message displayed below the textarea */
280
+ helperText?: React__default.ReactNode;
281
+ /** Number of visible text rows (default 3) */
282
+ rows?: number;
283
+ /** Custom style for the outermost wrapper */
284
+ wrapperStyle?: StyleProp<ViewStyle>;
285
+ /** Custom style for the textarea container */
286
+ style?: StyleProp<ViewStyle>;
287
+ /** Custom border color. Overrides the resting border color from `status`/`focused`. */
288
+ borderColor?: string;
289
+ /** Border width token (`sm` 1px, `md` 2px, `lg` 3px). */
290
+ borderWidth?: TextAreaBorderWidth;
291
+ } & React__default.RefAttributes<TextInput$1>>;
292
+
240
293
  type CheckboxSize = "sm" | "md" | "lg";
241
294
  type CheckboxProps = Omit<PressableProps, "style" | "onPress"> & {
242
295
  /** Checkbox size */
@@ -617,4 +670,4 @@ type ProgressBarProps = {
617
670
  };
618
671
  declare const ProgressBar: React__default.ForwardRefExoticComponent<ProgressBarProps & React__default.RefAttributes<View>>;
619
672
 
620
- export { ActivityIndicator, type ActivityIndicatorColor, type ActivityIndicatorProps, type ActivityIndicatorSize, Avatar, type AvatarProps, type AvatarSize, type AvatarVariant, Button, ButtonColor, type ButtonProps, type ButtonRadius, type ButtonSize, type ButtonVariant, Card, CardContent, type CardContentProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardPadding, type CardProps, type CardRadius, type CardVariant, Checkbox, type CheckboxProps, type CheckboxSize, IconButton, type IconButtonColor, type IconButtonProps, type IconButtonRadius, type IconButtonSize, type IconButtonVariant, ProgressBar, type ProgressBarColor, type ProgressBarProps, type ProgressBarThickness, type ProgressBarVariant, Radio, type RadioColor, RadioGroup, type RadioGroupProps, RadioOption, type RadioOptionProps, type RadioOrientation, type RadioProps, type RadioSize, RehagroNativeProvider, type RehagroNativeProviderProps, type RehagroNativeTheme, Select, type SelectMultipleProps, type SelectOption, type SelectProps, type SelectRadius, type SelectSingleProps, type SelectSize, type SelectStatus, Tag, type TagColor, type TagProps, type TagSize, Text, type TextColor, TextInput, type TextInputProps, type TextInputRadius, type TextInputSize, type TextInputStatus, type TextProps, type TextSize, useRehagroTheme };
673
+ export { ActivityIndicator, type ActivityIndicatorColor, type ActivityIndicatorProps, type ActivityIndicatorSize, Avatar, type AvatarProps, type AvatarSize, type AvatarVariant, Button, ButtonColor, type ButtonProps, type ButtonRadius, type ButtonSize, type ButtonVariant, Card, CardContent, type CardContentProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardPadding, type CardProps, type CardRadius, type CardVariant, Checkbox, type CheckboxProps, type CheckboxSize, IconButton, type IconButtonColor, type IconButtonProps, type IconButtonRadius, type IconButtonSize, type IconButtonVariant, ProgressBar, type ProgressBarColor, type ProgressBarProps, type ProgressBarThickness, type ProgressBarVariant, Radio, type RadioColor, RadioGroup, type RadioGroupProps, RadioOption, type RadioOptionProps, type RadioOrientation, type RadioProps, type RadioSize, RehagroNativeProvider, type RehagroNativeProviderProps, type RehagroNativeTheme, Select, type SelectMultipleProps, type SelectOption, type SelectProps, type SelectRadius, type SelectSingleProps, type SelectSize, type SelectStatus, Tag, type TagColor, type TagProps, type TagSize, Text, TextArea, type TextAreaBorderWidth, type TextAreaProps, type TextAreaRadius, type TextAreaSize, type TextAreaStatus, type TextColor, TextInput, type TextInputProps, type TextInputRadius, type TextInputSize, type TextInputStatus, type TextProps, type TextSize, useRehagroTheme };
package/dist/native.d.ts CHANGED
@@ -237,6 +237,59 @@ declare const TextInput: React__default.ForwardRefExoticComponent<Omit<TextInput
237
237
  borderWidth?: TextInputBorderWidth;
238
238
  } & React__default.RefAttributes<TextInput$1>>;
239
239
 
240
+ type TextAreaStatus = "default" | "error";
241
+ type TextAreaSize = "sm" | "md" | "lg";
242
+ type TextAreaRadius = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "full";
243
+ type TextAreaBorderWidth = "sm" | "md" | "lg";
244
+ type TextAreaProps = Omit<TextInputProps$1, "style" | "multiline"> & {
245
+ /** Label text displayed above the textarea */
246
+ label?: string;
247
+ /** Subtitle displayed next to the label. Use "*" for the required marker. */
248
+ subtitle?: string;
249
+ /** Validation status */
250
+ status?: TextAreaStatus;
251
+ /** Text/padding size */
252
+ size?: TextAreaSize;
253
+ /** Border radius */
254
+ radius?: TextAreaRadius;
255
+ /** Helper/error message displayed below the textarea */
256
+ helperText?: React__default.ReactNode;
257
+ /** Number of visible text rows (default 3) */
258
+ rows?: number;
259
+ /** Custom style for the outermost wrapper */
260
+ wrapperStyle?: StyleProp<ViewStyle>;
261
+ /** Custom style for the textarea container */
262
+ style?: StyleProp<ViewStyle>;
263
+ /** Custom border color. Overrides the resting border color from `status`/`focused`. */
264
+ borderColor?: string;
265
+ /** Border width token (`sm` 1px, `md` 2px, `lg` 3px). */
266
+ borderWidth?: TextAreaBorderWidth;
267
+ };
268
+ declare const TextArea: React__default.ForwardRefExoticComponent<Omit<TextInputProps$1, "style" | "multiline"> & {
269
+ /** Label text displayed above the textarea */
270
+ label?: string;
271
+ /** Subtitle displayed next to the label. Use "*" for the required marker. */
272
+ subtitle?: string;
273
+ /** Validation status */
274
+ status?: TextAreaStatus;
275
+ /** Text/padding size */
276
+ size?: TextAreaSize;
277
+ /** Border radius */
278
+ radius?: TextAreaRadius;
279
+ /** Helper/error message displayed below the textarea */
280
+ helperText?: React__default.ReactNode;
281
+ /** Number of visible text rows (default 3) */
282
+ rows?: number;
283
+ /** Custom style for the outermost wrapper */
284
+ wrapperStyle?: StyleProp<ViewStyle>;
285
+ /** Custom style for the textarea container */
286
+ style?: StyleProp<ViewStyle>;
287
+ /** Custom border color. Overrides the resting border color from `status`/`focused`. */
288
+ borderColor?: string;
289
+ /** Border width token (`sm` 1px, `md` 2px, `lg` 3px). */
290
+ borderWidth?: TextAreaBorderWidth;
291
+ } & React__default.RefAttributes<TextInput$1>>;
292
+
240
293
  type CheckboxSize = "sm" | "md" | "lg";
241
294
  type CheckboxProps = Omit<PressableProps, "style" | "onPress"> & {
242
295
  /** Checkbox size */
@@ -617,4 +670,4 @@ type ProgressBarProps = {
617
670
  };
618
671
  declare const ProgressBar: React__default.ForwardRefExoticComponent<ProgressBarProps & React__default.RefAttributes<View>>;
619
672
 
620
- export { ActivityIndicator, type ActivityIndicatorColor, type ActivityIndicatorProps, type ActivityIndicatorSize, Avatar, type AvatarProps, type AvatarSize, type AvatarVariant, Button, ButtonColor, type ButtonProps, type ButtonRadius, type ButtonSize, type ButtonVariant, Card, CardContent, type CardContentProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardPadding, type CardProps, type CardRadius, type CardVariant, Checkbox, type CheckboxProps, type CheckboxSize, IconButton, type IconButtonColor, type IconButtonProps, type IconButtonRadius, type IconButtonSize, type IconButtonVariant, ProgressBar, type ProgressBarColor, type ProgressBarProps, type ProgressBarThickness, type ProgressBarVariant, Radio, type RadioColor, RadioGroup, type RadioGroupProps, RadioOption, type RadioOptionProps, type RadioOrientation, type RadioProps, type RadioSize, RehagroNativeProvider, type RehagroNativeProviderProps, type RehagroNativeTheme, Select, type SelectMultipleProps, type SelectOption, type SelectProps, type SelectRadius, type SelectSingleProps, type SelectSize, type SelectStatus, Tag, type TagColor, type TagProps, type TagSize, Text, type TextColor, TextInput, type TextInputProps, type TextInputRadius, type TextInputSize, type TextInputStatus, type TextProps, type TextSize, useRehagroTheme };
673
+ export { ActivityIndicator, type ActivityIndicatorColor, type ActivityIndicatorProps, type ActivityIndicatorSize, Avatar, type AvatarProps, type AvatarSize, type AvatarVariant, Button, ButtonColor, type ButtonProps, type ButtonRadius, type ButtonSize, type ButtonVariant, Card, CardContent, type CardContentProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardPadding, type CardProps, type CardRadius, type CardVariant, Checkbox, type CheckboxProps, type CheckboxSize, IconButton, type IconButtonColor, type IconButtonProps, type IconButtonRadius, type IconButtonSize, type IconButtonVariant, ProgressBar, type ProgressBarColor, type ProgressBarProps, type ProgressBarThickness, type ProgressBarVariant, Radio, type RadioColor, RadioGroup, type RadioGroupProps, RadioOption, type RadioOptionProps, type RadioOrientation, type RadioProps, type RadioSize, RehagroNativeProvider, type RehagroNativeProviderProps, type RehagroNativeTheme, Select, type SelectMultipleProps, type SelectOption, type SelectProps, type SelectRadius, type SelectSingleProps, type SelectSize, type SelectStatus, Tag, type TagColor, type TagProps, type TagSize, Text, TextArea, type TextAreaBorderWidth, type TextAreaProps, type TextAreaRadius, type TextAreaSize, type TextAreaStatus, type TextColor, TextInput, type TextInputProps, type TextInputRadius, type TextInputSize, type TextInputStatus, type TextProps, type TextSize, useRehagroTheme };
package/dist/native.js CHANGED
@@ -443,6 +443,118 @@ var TextInput = react.forwardRef(function TextInput2({
443
443
  )
444
444
  ] });
445
445
  });
446
+ var TextArea = react.forwardRef(function TextArea2({
447
+ label,
448
+ subtitle,
449
+ status = "default",
450
+ size = "md",
451
+ radius = "xs",
452
+ helperText,
453
+ rows = 3,
454
+ editable = true,
455
+ wrapperStyle,
456
+ style,
457
+ borderColor,
458
+ borderWidth = "sm",
459
+ accessibilityLabel,
460
+ ...rest
461
+ }, ref) {
462
+ const theme = useRehagroTheme();
463
+ const [focused, setFocused] = react.useState(false);
464
+ const isDisabled = editable === false;
465
+ const paddingMap2 = {
466
+ sm: 12,
467
+ md: 14,
468
+ lg: 16
469
+ };
470
+ const fontSizeMap = {
471
+ sm: 14,
472
+ md: 14,
473
+ lg: 16
474
+ };
475
+ const radiusMap2 = {
476
+ none: 0,
477
+ xxs: theme.radiusXxs ?? 4,
478
+ xs: theme.radiusXs ?? 8,
479
+ sm: theme.radiusSm ?? 12,
480
+ md: theme.radiusMd ?? 16,
481
+ lg: theme.radiusLg ?? 24,
482
+ xl: theme.radiusXl ?? 32,
483
+ full: 9999
484
+ };
485
+ const borderWidthMap = {
486
+ sm: theme.borderWidthSm ?? 1,
487
+ md: theme.borderWidthMd ?? 2,
488
+ lg: theme.borderWidthLg ?? 3
489
+ };
490
+ const hasError = status === "error" || !!helperText;
491
+ const effectiveBorderColor = hasError ? theme.danger : focused ? theme.primary : borderColor ?? theme.border;
492
+ const lineHeight = fontSizeMap[size] * 1.4;
493
+ const minHeight = lineHeight * Math.max(rows, 1) + paddingMap2[size] * 2;
494
+ const containerStyle = {
495
+ minHeight,
496
+ paddingHorizontal: paddingMap2[size],
497
+ paddingVertical: paddingMap2[size],
498
+ borderRadius: radiusMap2[radius],
499
+ borderWidth: borderWidthMap[borderWidth],
500
+ borderColor: effectiveBorderColor,
501
+ backgroundColor: isDisabled ? theme.background : theme.surface,
502
+ opacity: isDisabled ? 0.5 : 1
503
+ };
504
+ const inputId = accessibilityLabel ?? label;
505
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [{ gap: 4 }, wrapperStyle], children: [
506
+ label && /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: { flexDirection: "row", alignItems: "baseline", gap: 4 }, children: [
507
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: { fontSize: 14, fontWeight: "500", color: theme.text }, children: label }),
508
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx(
509
+ reactNative.Text,
510
+ {
511
+ style: {
512
+ fontSize: 14,
513
+ color: subtitle.trim() === "*" ? theme.danger : theme.textMuted
514
+ },
515
+ children: subtitle
516
+ }
517
+ )
518
+ ] }),
519
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [containerStyle, style], children: /* @__PURE__ */ jsxRuntime.jsx(
520
+ reactNative.TextInput,
521
+ {
522
+ ref,
523
+ editable,
524
+ multiline: true,
525
+ textAlignVertical: "top",
526
+ accessibilityLabel: inputId,
527
+ accessibilityState: { disabled: isDisabled },
528
+ "aria-invalid": status === "error",
529
+ onFocus: (e) => {
530
+ setFocused(true);
531
+ rest.onFocus?.(e);
532
+ },
533
+ onBlur: (e) => {
534
+ setFocused(false);
535
+ rest.onBlur?.(e);
536
+ },
537
+ style: {
538
+ flex: 1,
539
+ fontSize: fontSizeMap[size],
540
+ color: theme.text
541
+ },
542
+ placeholderTextColor: theme.textMuted,
543
+ ...rest
544
+ }
545
+ ) }),
546
+ helperText && /* @__PURE__ */ jsxRuntime.jsx(
547
+ reactNative.Text,
548
+ {
549
+ style: {
550
+ fontSize: 12,
551
+ color: hasError ? theme.danger : theme.textMuted
552
+ },
553
+ children: helperText
554
+ }
555
+ )
556
+ ] });
557
+ });
446
558
  var CheckIcon = ({ size, color }) => /* @__PURE__ */ jsxRuntime.jsx(
447
559
  reactNative.View,
448
560
  {
@@ -691,7 +803,7 @@ var ActivityIndicator3 = react.forwardRef(
691
803
  );
692
804
  }
693
805
  );
694
- var Text5 = react.forwardRef(function Text6({ size = "sm", color = "default", bold = false, style, children, ...rest }, ref) {
806
+ var Text6 = react.forwardRef(function Text7({ size = "sm", color = "default", bold = false, style, children, ...rest }, ref) {
695
807
  const theme = useRehagroTheme();
696
808
  const colorMap = {
697
809
  default: theme.text ?? "#111827",
@@ -1659,7 +1771,8 @@ exports.RadioOption = RadioOption;
1659
1771
  exports.RehagroNativeProvider = RehagroNativeProvider;
1660
1772
  exports.Select = Select;
1661
1773
  exports.Tag = Tag;
1662
- exports.Text = Text5;
1774
+ exports.Text = Text6;
1775
+ exports.TextArea = TextArea;
1663
1776
  exports.TextInput = TextInput;
1664
1777
  exports.useRehagroTheme = useRehagroTheme;
1665
1778
  //# sourceMappingURL=native.js.map