@rehagro/ui 1.0.40 → 1.0.41

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
@@ -563,4 +563,27 @@ declare const RadioOption: React__default.ForwardRefExoticComponent<Omit<Pressab
563
563
  } & React__default.RefAttributes<View>>;
564
564
  declare const RadioGroup: React__default.ForwardRefExoticComponent<RadioGroupProps & React__default.RefAttributes<View>>;
565
565
 
566
- 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, 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 };
566
+ type ProgressBarVariant = "inline" | "stacked";
567
+ type ProgressBarThickness = "xs" | "sm" | "md" | "lg" | "xl";
568
+ type ProgressBarColor = "primary" | "secondary" | "danger" | "warning" | "success" | "info";
569
+ type ProgressBarProps = {
570
+ /** Progress value from 0 to 100 */
571
+ value: number;
572
+ /** Label text (only shown in stacked variant) */
573
+ label?: string;
574
+ /** Layout variant */
575
+ variant?: ProgressBarVariant;
576
+ /** Bar thickness — preset token or custom value in dp */
577
+ thickness?: ProgressBarThickness | number;
578
+ /** Whether to show percentage text */
579
+ showPercentage?: boolean;
580
+ /** Bar color — preset name or custom color string */
581
+ color?: ProgressBarColor | (string & {});
582
+ /** Custom background color */
583
+ bgColor?: string;
584
+ /** Custom style for the wrapper */
585
+ style?: StyleProp<ViewStyle>;
586
+ };
587
+ declare const ProgressBar: React__default.ForwardRefExoticComponent<ProgressBarProps & React__default.RefAttributes<View>>;
588
+
589
+ 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 };
package/dist/native.d.ts CHANGED
@@ -563,4 +563,27 @@ declare const RadioOption: React__default.ForwardRefExoticComponent<Omit<Pressab
563
563
  } & React__default.RefAttributes<View>>;
564
564
  declare const RadioGroup: React__default.ForwardRefExoticComponent<RadioGroupProps & React__default.RefAttributes<View>>;
565
565
 
566
- 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, 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 };
566
+ type ProgressBarVariant = "inline" | "stacked";
567
+ type ProgressBarThickness = "xs" | "sm" | "md" | "lg" | "xl";
568
+ type ProgressBarColor = "primary" | "secondary" | "danger" | "warning" | "success" | "info";
569
+ type ProgressBarProps = {
570
+ /** Progress value from 0 to 100 */
571
+ value: number;
572
+ /** Label text (only shown in stacked variant) */
573
+ label?: string;
574
+ /** Layout variant */
575
+ variant?: ProgressBarVariant;
576
+ /** Bar thickness — preset token or custom value in dp */
577
+ thickness?: ProgressBarThickness | number;
578
+ /** Whether to show percentage text */
579
+ showPercentage?: boolean;
580
+ /** Bar color — preset name or custom color string */
581
+ color?: ProgressBarColor | (string & {});
582
+ /** Custom background color */
583
+ bgColor?: string;
584
+ /** Custom style for the wrapper */
585
+ style?: StyleProp<ViewStyle>;
586
+ };
587
+ declare const ProgressBar: React__default.ForwardRefExoticComponent<ProgressBarProps & React__default.RefAttributes<View>>;
588
+
589
+ 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 };
package/dist/native.js CHANGED
@@ -1500,6 +1500,123 @@ var RadioGroup = react.forwardRef(function RadioGroup2({
1500
1500
  }
1501
1501
  );
1502
1502
  });
1503
+ var THICKNESS_MAP = {
1504
+ xs: 2,
1505
+ sm: 4,
1506
+ md: 8,
1507
+ lg: 12,
1508
+ xl: 16
1509
+ };
1510
+ var PRESET_COLORS5 = /* @__PURE__ */ new Set([
1511
+ "primary",
1512
+ "secondary",
1513
+ "danger",
1514
+ "warning",
1515
+ "success",
1516
+ "info"
1517
+ ]);
1518
+ var isPresetColor5 = (color) => PRESET_COLORS5.has(color);
1519
+ var resolveColor2 = (color, theme) => {
1520
+ if (isPresetColor5(color)) {
1521
+ return theme[color] ?? "#538CC6";
1522
+ }
1523
+ return color;
1524
+ };
1525
+ var resolveThickness = (thickness) => typeof thickness === "number" ? thickness : THICKNESS_MAP[thickness];
1526
+ var ProgressBar = react.forwardRef(function ProgressBar2({
1527
+ value,
1528
+ label,
1529
+ variant = "inline",
1530
+ thickness = "sm",
1531
+ showPercentage = true,
1532
+ color = "primary",
1533
+ bgColor,
1534
+ style
1535
+ }, ref) {
1536
+ const theme = useRehagroTheme();
1537
+ const clampedValue = Math.min(100, Math.max(0, value));
1538
+ const heightPx = resolveThickness(thickness);
1539
+ const resolvedBarColor = resolveColor2(color, theme);
1540
+ const resolvedBgColor = bgColor ?? theme.border ?? "#E5E7EB";
1541
+ const trackStyle = {
1542
+ width: "100%",
1543
+ height: heightPx,
1544
+ borderRadius: 40,
1545
+ overflow: "hidden",
1546
+ backgroundColor: resolvedBgColor
1547
+ };
1548
+ const fillStyle = {
1549
+ width: `${clampedValue}%`,
1550
+ height: "100%",
1551
+ borderRadius: 40,
1552
+ backgroundColor: resolvedBarColor
1553
+ };
1554
+ const percentageTextStyle = {
1555
+ fontSize: theme.fontSizeSm ?? 14,
1556
+ color: theme.textMuted ?? "#9CA3AF",
1557
+ ...theme.fontFamilyBody ? { fontFamily: theme.fontFamilyBody } : {}
1558
+ };
1559
+ if (variant === "stacked") {
1560
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1561
+ reactNative.View,
1562
+ {
1563
+ ref,
1564
+ accessibilityRole: "progressbar",
1565
+ accessibilityValue: { now: clampedValue, min: 0, max: 100 },
1566
+ style: [{ flexDirection: "column", alignItems: "stretch", gap: 8 }, style],
1567
+ children: [
1568
+ (label || showPercentage) && /* @__PURE__ */ jsxRuntime.jsxs(
1569
+ reactNative.View,
1570
+ {
1571
+ style: {
1572
+ flexDirection: "row",
1573
+ justifyContent: "space-between",
1574
+ alignItems: "flex-start",
1575
+ width: "100%"
1576
+ },
1577
+ children: [
1578
+ label ? /* @__PURE__ */ jsxRuntime.jsx(
1579
+ reactNative.Text,
1580
+ {
1581
+ style: {
1582
+ flex: 1,
1583
+ fontSize: theme.fontSizeMd ?? 16,
1584
+ fontWeight: "700",
1585
+ color: theme.text ?? "#374151",
1586
+ ...theme.fontFamilyDisplay ? { fontFamily: theme.fontFamilyDisplay } : {}
1587
+ },
1588
+ children: label
1589
+ }
1590
+ ) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: { flex: 1 } }),
1591
+ showPercentage && /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: [percentageTextStyle, { textAlign: "right" }], children: [
1592
+ clampedValue,
1593
+ "%"
1594
+ ] })
1595
+ ]
1596
+ }
1597
+ ),
1598
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: trackStyle, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: fillStyle }) })
1599
+ ]
1600
+ }
1601
+ );
1602
+ }
1603
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1604
+ reactNative.View,
1605
+ {
1606
+ ref,
1607
+ accessibilityRole: "progressbar",
1608
+ accessibilityValue: { now: clampedValue, min: 0, max: 100 },
1609
+ style: [{ flexDirection: "row", alignItems: "center", gap: 8 }, style],
1610
+ children: [
1611
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [trackStyle, { flex: 1, width: void 0 }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: fillStyle }) }),
1612
+ showPercentage && /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: [percentageTextStyle, { minWidth: 40, textAlign: "right" }], children: [
1613
+ clampedValue,
1614
+ "%"
1615
+ ] })
1616
+ ]
1617
+ }
1618
+ );
1619
+ });
1503
1620
 
1504
1621
  exports.ActivityIndicator = ActivityIndicator3;
1505
1622
  exports.Avatar = Avatar;
@@ -1510,6 +1627,7 @@ exports.CardFooter = CardFooter;
1510
1627
  exports.CardHeader = CardHeader;
1511
1628
  exports.Checkbox = Checkbox;
1512
1629
  exports.IconButton = IconButton;
1630
+ exports.ProgressBar = ProgressBar;
1513
1631
  exports.Radio = Radio;
1514
1632
  exports.RadioGroup = RadioGroup;
1515
1633
  exports.RadioOption = RadioOption;