@wistia/ui 0.4.6 → 0.4.7
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.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -336,6 +336,11 @@ declare const ActionButton: react.ForwardRefExoticComponent<(Omit<{
|
|
|
336
336
|
} & Omit<ButtonAsLinkProps, "size" | "isLoading" | "leftIcon" | "fullWidth" | "unstyled" | "rightIcon" | "variant">, "ref">) & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
337
337
|
|
|
338
338
|
type AvatarInstanceType = 'image' | 'initials';
|
|
339
|
+
type AvatarImageLoadStateType = 'error' | 'loaded' | 'loading';
|
|
340
|
+
type AvatarStatus = {
|
|
341
|
+
type: AvatarInstanceType;
|
|
342
|
+
state: AvatarImageLoadStateType;
|
|
343
|
+
};
|
|
339
344
|
type AvatarProps = ComponentPropsWithoutRef<'div'> & {
|
|
340
345
|
/**
|
|
341
346
|
* The height and width of the avatar (overrides size prop)
|
|
@@ -358,7 +363,7 @@ type AvatarProps = ComponentPropsWithoutRef<'div'> & {
|
|
|
358
363
|
/**
|
|
359
364
|
* A callback that is invoked after the image has loaded or failed to load
|
|
360
365
|
*/
|
|
361
|
-
onImageLoad?: (
|
|
366
|
+
onImageLoad?: (avatarStatus: AvatarStatus) => void;
|
|
362
367
|
};
|
|
363
368
|
/**
|
|
364
369
|
* An avatar uses a photo, initials or icon to represent an entity
|
|
@@ -2163,4 +2168,4 @@ declare const WistiaLogo: {
|
|
|
2163
2168
|
displayName: string;
|
|
2164
2169
|
};
|
|
2165
2170
|
|
|
2166
|
-
export { ActionButton, type ActionButtonProps, Avatar, type
|
|
2171
|
+
export { ActionButton, type ActionButtonProps, Avatar, type AvatarProps, type AvatarStatus, Badge, type BadgeProps, Box, type BoxProps, Breadcrumb, type BreadcrumbProps, Breadcrumbs, type BreadcrumbsProps, Button, ButtonGroup, type ButtonProps, Card, type CardProps, Checkbox, CheckboxGroup, CheckboxMenuItem, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, Divider, Ellipsis, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Input, type InputProps, Label, type LabelProps, Link, type LinkProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, type ModalProps, Radio, RadioGroup, RadioMenuItem, type RadioProps, ScreenReaderOnly, Stack, SubMenu, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, colorSchemeOptions, copyToClipboard, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useBoolean, useFormState, useKey, useMq, useToast, useWindowSize };
|
package/dist/index.d.ts
CHANGED
|
@@ -336,6 +336,11 @@ declare const ActionButton: react.ForwardRefExoticComponent<(Omit<{
|
|
|
336
336
|
} & Omit<ButtonAsLinkProps, "size" | "isLoading" | "leftIcon" | "fullWidth" | "unstyled" | "rightIcon" | "variant">, "ref">) & react.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
337
337
|
|
|
338
338
|
type AvatarInstanceType = 'image' | 'initials';
|
|
339
|
+
type AvatarImageLoadStateType = 'error' | 'loaded' | 'loading';
|
|
340
|
+
type AvatarStatus = {
|
|
341
|
+
type: AvatarInstanceType;
|
|
342
|
+
state: AvatarImageLoadStateType;
|
|
343
|
+
};
|
|
339
344
|
type AvatarProps = ComponentPropsWithoutRef<'div'> & {
|
|
340
345
|
/**
|
|
341
346
|
* The height and width of the avatar (overrides size prop)
|
|
@@ -358,7 +363,7 @@ type AvatarProps = ComponentPropsWithoutRef<'div'> & {
|
|
|
358
363
|
/**
|
|
359
364
|
* A callback that is invoked after the image has loaded or failed to load
|
|
360
365
|
*/
|
|
361
|
-
onImageLoad?: (
|
|
366
|
+
onImageLoad?: (avatarStatus: AvatarStatus) => void;
|
|
362
367
|
};
|
|
363
368
|
/**
|
|
364
369
|
* An avatar uses a photo, initials or icon to represent an entity
|
|
@@ -2163,4 +2168,4 @@ declare const WistiaLogo: {
|
|
|
2163
2168
|
displayName: string;
|
|
2164
2169
|
};
|
|
2165
2170
|
|
|
2166
|
-
export { ActionButton, type ActionButtonProps, Avatar, type
|
|
2171
|
+
export { ActionButton, type ActionButtonProps, Avatar, type AvatarProps, type AvatarStatus, Badge, type BadgeProps, Box, type BoxProps, Breadcrumb, type BreadcrumbProps, Breadcrumbs, type BreadcrumbsProps, Button, ButtonGroup, type ButtonProps, Card, type CardProps, Checkbox, CheckboxGroup, CheckboxMenuItem, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, Divider, Ellipsis, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Input, type InputProps, Label, type LabelProps, Link, type LinkProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, type ModalProps, Radio, RadioGroup, RadioMenuItem, type RadioProps, ScreenReaderOnly, Stack, SubMenu, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, colorSchemeOptions, copyToClipboard, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useBoolean, useFormState, useKey, useMq, useToast, useWindowSize };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.4.
|
|
3
|
+
* @license @wistia/ui v0.4.7
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -5868,17 +5868,17 @@ var Avatar = ({
|
|
|
5868
5868
|
onImageLoad,
|
|
5869
5869
|
...otherProps
|
|
5870
5870
|
}) => {
|
|
5871
|
-
const [imageLoadState, setImageLoadState] = useState4(
|
|
5871
|
+
const [imageLoadState, setImageLoadState] = useState4("loading");
|
|
5872
5872
|
useEffect3(() => {
|
|
5873
|
-
setImageLoadState(
|
|
5873
|
+
setImageLoadState("loading");
|
|
5874
5874
|
}, [imageUrl]);
|
|
5875
5875
|
const handleImageLoad = () => {
|
|
5876
5876
|
setImageLoadState("loaded");
|
|
5877
|
-
onImageLoad?.("image");
|
|
5877
|
+
onImageLoad?.({ state: "loaded", type: "image" });
|
|
5878
5878
|
};
|
|
5879
5879
|
const handleImageLoadError = () => {
|
|
5880
5880
|
setImageLoadState("error");
|
|
5881
|
-
onImageLoad?.("initials");
|
|
5881
|
+
onImageLoad?.({ state: "error", type: "initials" });
|
|
5882
5882
|
};
|
|
5883
5883
|
const avatarSize = heightAndWidth ?? avatarSizeMap[size];
|
|
5884
5884
|
const avatarColor = useMemo3(() => chooseColorScheme(name), [name]);
|