@rehagro/ui 0.1.2 → 0.1.4

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.d.mts CHANGED
@@ -336,6 +336,33 @@ type TooltipProps = {
336
336
  };
337
337
  declare const Tooltip: React$1.ForwardRefExoticComponent<TooltipProps & React$1.RefAttributes<HTMLDivElement>>;
338
338
 
339
+ type AvatarSize = "sm" | "md" | "lg" | "xl";
340
+ type AvatarVariant = "circle" | "square";
341
+ type AvatarProps = Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & {
342
+ /** Image source URL */
343
+ src?: string;
344
+ /** Alt text for the image (required for accessibility) */
345
+ alt?: string;
346
+ /** Fallback initials shown when image is unavailable */
347
+ initials?: string;
348
+ /** Avatar size */
349
+ size?: AvatarSize;
350
+ /** Shape variant */
351
+ variant?: AvatarVariant;
352
+ };
353
+ declare const Avatar: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & {
354
+ /** Image source URL */
355
+ src?: string;
356
+ /** Alt text for the image (required for accessibility) */
357
+ alt?: string;
358
+ /** Fallback initials shown when image is unavailable */
359
+ initials?: string;
360
+ /** Avatar size */
361
+ size?: AvatarSize;
362
+ /** Shape variant */
363
+ variant?: AvatarVariant;
364
+ } & React$1.RefAttributes<HTMLDivElement>>;
365
+
339
366
  type ContainerProps = React$1.HTMLAttributes<HTMLDivElement> & {
340
367
  /**
341
368
  * Remove o padding horizontal lateral.
@@ -437,4 +464,4 @@ declare const NeutralIcon: (props: IconProps) => react_jsx_runtime.JSX.Element;
437
464
 
438
465
  declare const CloseIcon: (props: IconProps) => react_jsx_runtime.JSX.Element;
439
466
 
440
- export { Button, type ButtonProps, type ButtonRadius, type ButtonSize, type ButtonVariant, Checkbox, type CheckboxProps, type CheckboxSize, CloseIcon, Container, type ContainerProps, DeleteIcon, EditIcon, ErrorIcon, GridContainer, type GridContainerProps, GridItem, type GridItemProps, type GridSpan, IconButton, type IconButtonColor, type IconButtonProps, type IconButtonRadius, type IconButtonSize, type IconButtonVariant, type IconProps, InfoIcon, type MobileSpan, NeutralIcon, PlusIcon, RehagroProvider, type RehagroProviderProps, type RehagroTheme, SearchIcon, Select, type SelectMultipleProps, type SelectOption, type SelectProps, type SelectRadius, type SelectSingleProps, type SelectSize, type SelectStatus, SuccessIcon, TextInput, type TextInputProps, type TextInputRadius, type TextInputSize, type TextInputStatus, Toast, type ToastAppearance, ToastContainer, type ToastFn, type ToastItem, type ToastLink, type ToastOptions, type ToastPosition, type ToastProps, ToastProvider, type ToastProviderProps, type ToastVariant, Tooltip, type TooltipPlacement, type TooltipProps, type TooltipSize, type TooltipVariant, WarningIcon, useToast };
467
+ export { Avatar, type AvatarProps, type AvatarSize, type AvatarVariant, Button, type ButtonProps, type ButtonRadius, type ButtonSize, type ButtonVariant, Checkbox, type CheckboxProps, type CheckboxSize, CloseIcon, Container, type ContainerProps, DeleteIcon, EditIcon, ErrorIcon, GridContainer, type GridContainerProps, GridItem, type GridItemProps, type GridSpan, IconButton, type IconButtonColor, type IconButtonProps, type IconButtonRadius, type IconButtonSize, type IconButtonVariant, type IconProps, InfoIcon, type MobileSpan, NeutralIcon, PlusIcon, RehagroProvider, type RehagroProviderProps, type RehagroTheme, SearchIcon, Select, type SelectMultipleProps, type SelectOption, type SelectProps, type SelectRadius, type SelectSingleProps, type SelectSize, type SelectStatus, SuccessIcon, TextInput, type TextInputProps, type TextInputRadius, type TextInputSize, type TextInputStatus, Toast, type ToastAppearance, ToastContainer, type ToastFn, type ToastItem, type ToastLink, type ToastOptions, type ToastPosition, type ToastProps, ToastProvider, type ToastProviderProps, type ToastVariant, Tooltip, type TooltipPlacement, type TooltipProps, type TooltipSize, type TooltipVariant, WarningIcon, useToast };
package/dist/index.d.ts CHANGED
@@ -336,6 +336,33 @@ type TooltipProps = {
336
336
  };
337
337
  declare const Tooltip: React$1.ForwardRefExoticComponent<TooltipProps & React$1.RefAttributes<HTMLDivElement>>;
338
338
 
339
+ type AvatarSize = "sm" | "md" | "lg" | "xl";
340
+ type AvatarVariant = "circle" | "square";
341
+ type AvatarProps = Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & {
342
+ /** Image source URL */
343
+ src?: string;
344
+ /** Alt text for the image (required for accessibility) */
345
+ alt?: string;
346
+ /** Fallback initials shown when image is unavailable */
347
+ initials?: string;
348
+ /** Avatar size */
349
+ size?: AvatarSize;
350
+ /** Shape variant */
351
+ variant?: AvatarVariant;
352
+ };
353
+ declare const Avatar: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement>, "children"> & {
354
+ /** Image source URL */
355
+ src?: string;
356
+ /** Alt text for the image (required for accessibility) */
357
+ alt?: string;
358
+ /** Fallback initials shown when image is unavailable */
359
+ initials?: string;
360
+ /** Avatar size */
361
+ size?: AvatarSize;
362
+ /** Shape variant */
363
+ variant?: AvatarVariant;
364
+ } & React$1.RefAttributes<HTMLDivElement>>;
365
+
339
366
  type ContainerProps = React$1.HTMLAttributes<HTMLDivElement> & {
340
367
  /**
341
368
  * Remove o padding horizontal lateral.
@@ -437,4 +464,4 @@ declare const NeutralIcon: (props: IconProps) => react_jsx_runtime.JSX.Element;
437
464
 
438
465
  declare const CloseIcon: (props: IconProps) => react_jsx_runtime.JSX.Element;
439
466
 
440
- export { Button, type ButtonProps, type ButtonRadius, type ButtonSize, type ButtonVariant, Checkbox, type CheckboxProps, type CheckboxSize, CloseIcon, Container, type ContainerProps, DeleteIcon, EditIcon, ErrorIcon, GridContainer, type GridContainerProps, GridItem, type GridItemProps, type GridSpan, IconButton, type IconButtonColor, type IconButtonProps, type IconButtonRadius, type IconButtonSize, type IconButtonVariant, type IconProps, InfoIcon, type MobileSpan, NeutralIcon, PlusIcon, RehagroProvider, type RehagroProviderProps, type RehagroTheme, SearchIcon, Select, type SelectMultipleProps, type SelectOption, type SelectProps, type SelectRadius, type SelectSingleProps, type SelectSize, type SelectStatus, SuccessIcon, TextInput, type TextInputProps, type TextInputRadius, type TextInputSize, type TextInputStatus, Toast, type ToastAppearance, ToastContainer, type ToastFn, type ToastItem, type ToastLink, type ToastOptions, type ToastPosition, type ToastProps, ToastProvider, type ToastProviderProps, type ToastVariant, Tooltip, type TooltipPlacement, type TooltipProps, type TooltipSize, type TooltipVariant, WarningIcon, useToast };
467
+ export { Avatar, type AvatarProps, type AvatarSize, type AvatarVariant, Button, type ButtonProps, type ButtonRadius, type ButtonSize, type ButtonVariant, Checkbox, type CheckboxProps, type CheckboxSize, CloseIcon, Container, type ContainerProps, DeleteIcon, EditIcon, ErrorIcon, GridContainer, type GridContainerProps, GridItem, type GridItemProps, type GridSpan, IconButton, type IconButtonColor, type IconButtonProps, type IconButtonRadius, type IconButtonSize, type IconButtonVariant, type IconProps, InfoIcon, type MobileSpan, NeutralIcon, PlusIcon, RehagroProvider, type RehagroProviderProps, type RehagroTheme, SearchIcon, Select, type SelectMultipleProps, type SelectOption, type SelectProps, type SelectRadius, type SelectSingleProps, type SelectSize, type SelectStatus, SuccessIcon, TextInput, type TextInputProps, type TextInputRadius, type TextInputSize, type TextInputStatus, Toast, type ToastAppearance, ToastContainer, type ToastFn, type ToastItem, type ToastLink, type ToastOptions, type ToastPosition, type ToastProps, ToastProvider, type ToastProviderProps, type ToastVariant, Tooltip, type TooltipPlacement, type TooltipProps, type TooltipSize, type TooltipVariant, WarningIcon, useToast };
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  'use strict';
2
3
 
3
4
  var React8 = require('react');
@@ -1684,6 +1685,60 @@ var Tooltip = React8.forwardRef(
1684
1685
  );
1685
1686
  }
1686
1687
  );
1688
+ var sizeClasses7 = {
1689
+ sm: "rh-w-8 rh-h-8 rh-text-xs",
1690
+ md: "rh-w-10 rh-h-10 rh-text-sm",
1691
+ lg: "rh-w-12 rh-h-12 rh-text-base",
1692
+ xl: "rh-w-16 rh-h-16 rh-text-lg"
1693
+ };
1694
+ var imageSizeClasses = {
1695
+ sm: "rh-w-8 rh-h-8",
1696
+ md: "rh-w-10 rh-h-10",
1697
+ lg: "rh-w-12 rh-h-12",
1698
+ xl: "rh-w-16 rh-h-16"
1699
+ };
1700
+ var variantClasses3 = {
1701
+ circle: "rh-rounded-full",
1702
+ square: "rh-rounded-sm"
1703
+ };
1704
+ var Avatar = React8.forwardRef(function Avatar2({
1705
+ src,
1706
+ alt = "",
1707
+ initials,
1708
+ size = "md",
1709
+ variant = "circle",
1710
+ className = "",
1711
+ ...rest
1712
+ }, ref) {
1713
+ const [imgError, setImgError] = React8.useState(false);
1714
+ const showImage = src && !imgError;
1715
+ const fallbackLabel = initials ? initials.slice(0, 2).toUpperCase() : alt ? alt.split(" ").slice(0, 2).map((w) => w[0]).join("").toUpperCase() : "?";
1716
+ return /* @__PURE__ */ jsxRuntime.jsx(
1717
+ "div",
1718
+ {
1719
+ ref,
1720
+ role: showImage ? void 0 : "img",
1721
+ "aria-label": showImage ? void 0 : alt || initials,
1722
+ className: [
1723
+ "rh-inline-flex rh-items-center rh-justify-center rh-shrink-0 rh-overflow-hidden",
1724
+ "rh-bg-primary rh-text-surface rh-font-sans rh-font-medium rh-select-none",
1725
+ sizeClasses7[size],
1726
+ variantClasses3[variant],
1727
+ className
1728
+ ].filter(Boolean).join(" "),
1729
+ ...rest,
1730
+ children: showImage ? /* @__PURE__ */ jsxRuntime.jsx(
1731
+ "img",
1732
+ {
1733
+ src,
1734
+ alt,
1735
+ className: [imageSizeClasses[size], variantClasses3[variant], "rh-object-cover"].join(" "),
1736
+ onError: () => setImgError(true)
1737
+ }
1738
+ ) : /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: fallbackLabel })
1739
+ }
1740
+ );
1741
+ });
1687
1742
  var Container = React8.forwardRef(
1688
1743
  function Container2({ fluid = false, className = "", children, ...rest }, ref) {
1689
1744
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -1853,6 +1908,7 @@ var GridItem = React8.forwardRef(
1853
1908
  }
1854
1909
  );
1855
1910
 
1911
+ exports.Avatar = Avatar;
1856
1912
  exports.Button = Button;
1857
1913
  exports.Checkbox = Checkbox;
1858
1914
  exports.CloseIcon = CloseIcon;