@rehagro/ui 0.1.3 → 1.0.0
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 +28 -1
- package/dist/index.d.ts +28 -1
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +47 -1
- package/dist/index.mjs.map +1 -1
- package/dist/native.d.mts +236 -0
- package/dist/native.d.ts +236 -0
- package/dist/native.js +496 -0
- package/dist/native.js.map +1 -0
- package/dist/native.mjs +488 -0
- package/dist/native.mjs.map +1 -0
- package/dist/styles.css +1 -1
- package/package.json +22 -7
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
|
@@ -1685,6 +1685,52 @@ var Tooltip = React8.forwardRef(
|
|
|
1685
1685
|
);
|
|
1686
1686
|
}
|
|
1687
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({ src, alt = "", initials, size = "md", variant = "circle", className = "", ...rest }, ref) {
|
|
1705
|
+
const [imgError, setImgError] = React8.useState(false);
|
|
1706
|
+
const showImage = src && !imgError;
|
|
1707
|
+
const fallbackLabel = initials ? initials.slice(0, 2).toUpperCase() : alt ? alt.split(" ").slice(0, 2).map((w) => w[0]).join("").toUpperCase() : "?";
|
|
1708
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1709
|
+
"div",
|
|
1710
|
+
{
|
|
1711
|
+
ref,
|
|
1712
|
+
role: showImage ? void 0 : "img",
|
|
1713
|
+
"aria-label": showImage ? void 0 : alt || initials,
|
|
1714
|
+
className: [
|
|
1715
|
+
"rh-inline-flex rh-items-center rh-justify-center rh-shrink-0 rh-overflow-hidden",
|
|
1716
|
+
"rh-bg-primary rh-text-surface rh-font-sans rh-font-medium rh-select-none",
|
|
1717
|
+
sizeClasses7[size],
|
|
1718
|
+
variantClasses3[variant],
|
|
1719
|
+
className
|
|
1720
|
+
].filter(Boolean).join(" "),
|
|
1721
|
+
...rest,
|
|
1722
|
+
children: showImage ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1723
|
+
"img",
|
|
1724
|
+
{
|
|
1725
|
+
src,
|
|
1726
|
+
alt,
|
|
1727
|
+
className: [imageSizeClasses[size], variantClasses3[variant], "rh-object-cover"].join(" "),
|
|
1728
|
+
onError: () => setImgError(true)
|
|
1729
|
+
}
|
|
1730
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: fallbackLabel })
|
|
1731
|
+
}
|
|
1732
|
+
);
|
|
1733
|
+
});
|
|
1688
1734
|
var Container = React8.forwardRef(
|
|
1689
1735
|
function Container2({ fluid = false, className = "", children, ...rest }, ref) {
|
|
1690
1736
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1854,6 +1900,7 @@ var GridItem = React8.forwardRef(
|
|
|
1854
1900
|
}
|
|
1855
1901
|
);
|
|
1856
1902
|
|
|
1903
|
+
exports.Avatar = Avatar;
|
|
1857
1904
|
exports.Button = Button;
|
|
1858
1905
|
exports.Checkbox = Checkbox;
|
|
1859
1906
|
exports.CloseIcon = CloseIcon;
|