@wistia/ui 0.6.0 → 0.6.1

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
@@ -1418,7 +1418,7 @@ type InputProps = Omit<InputHTMLAttributes<HTMLInputElement | HTMLTextAreaElemen
1418
1418
  type?: 'email' | 'multiline' | 'number' | 'phone' | 'search' | 'text' | 'url';
1419
1419
  };
1420
1420
  /**
1421
- * Component description goes here
1421
+ * For displaying photos and graphics
1422
1422
  */
1423
1423
  declare const Input: react.ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement | HTMLTextAreaElement>, "type"> & {
1424
1424
  /**
@@ -2450,4 +2450,46 @@ type SelectOptionGroupProps = {
2450
2450
  };
2451
2451
  declare const SelectOptionGroup: ({ children, label, ...props }: SelectOptionGroupProps) => react_jsx_runtime.JSX.Element;
2452
2452
 
2453
- 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, Collapsible, CollapsibleContent, type CollapsibleProps, CollapsibleTrigger, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, DataCard, type DataCardProps, DataCardTrend, type DataCardTrendProps, DataCards, type DataCardsProps, Divider, EditableHeading, type EditableHeadingProps, 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, Popover, type PopoverProps, Radio, RadioGroup, RadioMenuItem, type RadioProps, ScreenReaderOnly, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, Stack, SubMenu, Tab, type TabProps, Tabs, type TabsProps, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, colorSchemeOptions, copyToClipboard, dateTime, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useBoolean, useFormState, useKey, useMq, useToast, useWindowSize };
2453
+ type BorderRadius = 'border-radius-01' | 'border-radius-02' | 'border-radius-03' | 'border-radius-04' | 'border-radius-05' | 'border-radius-rounded';
2454
+
2455
+ type ImageProps = ComponentPropsWithoutRef<'img'> & {
2456
+ /**
2457
+ * Accessible text to apply to the image
2458
+ */
2459
+ alt: string;
2460
+ /**
2461
+ * Border radius to apply to the image
2462
+ */
2463
+ borderRadius?: BorderRadius;
2464
+ /**
2465
+ * Specifies whether the width and/or height should fill the container
2466
+ *
2467
+ * *Note: this will override height/width attributes*
2468
+ */
2469
+ fill?: boolean | 'horizontal' | 'vertical';
2470
+ /**
2471
+ * Specifies how the image's intrinsic size (ie. its natural size) should
2472
+ * be adjusted to fit within its container
2473
+ */
2474
+ fit?: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
2475
+ /**
2476
+ * Indicates how the browser should load the image; `eager`loads the image immediately,
2477
+ * `lazy` defers loading the image until it reaches a calculated distance from the viewport.
2478
+ * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-loading
2479
+ */
2480
+ loading?: 'eager' | 'lazy';
2481
+ /**
2482
+ * Specifies how the image will align itself in its container
2483
+ */
2484
+ position?: string;
2485
+ /**
2486
+ * URL to image file
2487
+ */
2488
+ src: string;
2489
+ };
2490
+ declare const Image: {
2491
+ ({ src, alt, borderRadius, fill: fillContainer, fit: objFit, loading, position: objPosition, ...otherProps }: ImageProps): JSX.Element;
2492
+ displayName: string;
2493
+ };
2494
+
2495
+ 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, Collapsible, CollapsibleContent, type CollapsibleProps, CollapsibleTrigger, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, DataCard, type DataCardProps, DataCardTrend, type DataCardTrendProps, DataCards, type DataCardsProps, Divider, EditableHeading, type EditableHeadingProps, Ellipsis, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Image, type ImageProps, Input, type InputProps, Label, type LabelProps, Link, type LinkProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, type ModalProps, Popover, type PopoverProps, Radio, RadioGroup, RadioMenuItem, type RadioProps, ScreenReaderOnly, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, Stack, SubMenu, Tab, type TabProps, Tabs, type TabsProps, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, colorSchemeOptions, copyToClipboard, dateTime, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useBoolean, useFormState, useKey, useMq, useToast, useWindowSize };
package/dist/index.d.ts CHANGED
@@ -1418,7 +1418,7 @@ type InputProps = Omit<InputHTMLAttributes<HTMLInputElement | HTMLTextAreaElemen
1418
1418
  type?: 'email' | 'multiline' | 'number' | 'phone' | 'search' | 'text' | 'url';
1419
1419
  };
1420
1420
  /**
1421
- * Component description goes here
1421
+ * For displaying photos and graphics
1422
1422
  */
1423
1423
  declare const Input: react.ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement | HTMLTextAreaElement>, "type"> & {
1424
1424
  /**
@@ -2450,4 +2450,46 @@ type SelectOptionGroupProps = {
2450
2450
  };
2451
2451
  declare const SelectOptionGroup: ({ children, label, ...props }: SelectOptionGroupProps) => react_jsx_runtime.JSX.Element;
2452
2452
 
2453
- 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, Collapsible, CollapsibleContent, type CollapsibleProps, CollapsibleTrigger, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, DataCard, type DataCardProps, DataCardTrend, type DataCardTrendProps, DataCards, type DataCardsProps, Divider, EditableHeading, type EditableHeadingProps, 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, Popover, type PopoverProps, Radio, RadioGroup, RadioMenuItem, type RadioProps, ScreenReaderOnly, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, Stack, SubMenu, Tab, type TabProps, Tabs, type TabsProps, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, colorSchemeOptions, copyToClipboard, dateTime, ellipsisFlexParentStyle, ellipsisStyle, iconSizeMap, mq, useActiveMq, useAriaLive, useBoolean, useFormState, useKey, useMq, useToast, useWindowSize };
2453
+ type BorderRadius = 'border-radius-01' | 'border-radius-02' | 'border-radius-03' | 'border-radius-04' | 'border-radius-05' | 'border-radius-rounded';
2454
+
2455
+ type ImageProps = ComponentPropsWithoutRef<'img'> & {
2456
+ /**
2457
+ * Accessible text to apply to the image
2458
+ */
2459
+ alt: string;
2460
+ /**
2461
+ * Border radius to apply to the image
2462
+ */
2463
+ borderRadius?: BorderRadius;
2464
+ /**
2465
+ * Specifies whether the width and/or height should fill the container
2466
+ *
2467
+ * *Note: this will override height/width attributes*
2468
+ */
2469
+ fill?: boolean | 'horizontal' | 'vertical';
2470
+ /**
2471
+ * Specifies how the image's intrinsic size (ie. its natural size) should
2472
+ * be adjusted to fit within its container
2473
+ */
2474
+ fit?: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
2475
+ /**
2476
+ * Indicates how the browser should load the image; `eager`loads the image immediately,
2477
+ * `lazy` defers loading the image until it reaches a calculated distance from the viewport.
2478
+ * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-loading
2479
+ */
2480
+ loading?: 'eager' | 'lazy';
2481
+ /**
2482
+ * Specifies how the image will align itself in its container
2483
+ */
2484
+ position?: string;
2485
+ /**
2486
+ * URL to image file
2487
+ */
2488
+ src: string;
2489
+ };
2490
+ declare const Image: {
2491
+ ({ src, alt, borderRadius, fill: fillContainer, fit: objFit, loading, position: objPosition, ...otherProps }: ImageProps): JSX.Element;
2492
+ displayName: string;
2493
+ };
2494
+
2495
+ 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, Collapsible, CollapsibleContent, type CollapsibleProps, CollapsibleTrigger, type ColorSchemeTypes, ColorSchemeWrapper, type ColorSchemeWrapperProps, DataCard, type DataCardProps, DataCardTrend, type DataCardTrendProps, DataCards, type DataCardsProps, Divider, EditableHeading, type EditableHeadingProps, Ellipsis, Form, FormErrorSummary, FormField, type FormFieldProps, FormGroup, type FormGroupProps, type FormProps, Heading, type HeadingProps, Icon, IconButton, type IconButtonProps, type IconNameType, Image, type ImageProps, Input, type InputProps, Label, type LabelProps, Link, type LinkProps, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Modal, type ModalProps, Popover, type PopoverProps, Radio, RadioGroup, RadioMenuItem, type RadioProps, ScreenReaderOnly, SegmentedControl, SegmentedControlItem, type SegmentedControlItemProps, type SegmentedControlProps, Select, SelectOption, SelectOptionGroup, type SelectOptionGroupProps, type SelectOptionProps, type SelectProps, Stack, SubMenu, Tab, type TabProps, Tabs, type TabsProps, Tag, type TagProps, Text, type TextProps, Tooltip, type TooltipProps, UIProvider, WistiaLogo, colorSchemeOptions, copyToClipboard, dateTime, 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.6.0
3
+ * @license @wistia/ui v0.6.1
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -10452,6 +10452,55 @@ var SelectOptionGroup = ({ children, label, ...props }) => {
10452
10452
  children
10453
10453
  ] });
10454
10454
  };
10455
+
10456
+ // src/components/Image/Image.tsx
10457
+ import styled59 from "styled-components";
10458
+ import { isNotNil as isNotNil24 } from "@wistia/type-guards";
10459
+ import { jsx as jsx225 } from "react/jsx-runtime";
10460
+ var getFillStyle2 = (fillContainer) => {
10461
+ if (fillContainer === "horizontal") {
10462
+ return "width: 100%;";
10463
+ }
10464
+ if (fillContainer === "vertical") {
10465
+ return "height: 100%;";
10466
+ }
10467
+ if (fillContainer === true) {
10468
+ return `
10469
+ width: 100%;
10470
+ height: 100%;
10471
+ `;
10472
+ }
10473
+ return void 0;
10474
+ };
10475
+ var StyledImage = styled59.img`
10476
+ border-radius: ${({ $borderRadius }) => isNotNil24($borderRadius) ? `var(--wui-${$borderRadius})` : void 0};
10477
+ ${({ $fillContainer }) => getFillStyle2($fillContainer)};
10478
+ object-fit: ${({ $objFit }) => $objFit};
10479
+ object-position: ${({ $objPosition }) => $objPosition};
10480
+ `;
10481
+ var Image = ({
10482
+ src,
10483
+ alt,
10484
+ borderRadius,
10485
+ fill: fillContainer = false,
10486
+ fit: objFit,
10487
+ loading = "lazy",
10488
+ position: objPosition,
10489
+ ...otherProps
10490
+ }) => /* @__PURE__ */ jsx225(
10491
+ StyledImage,
10492
+ {
10493
+ $borderRadius: borderRadius,
10494
+ $fillContainer: fillContainer,
10495
+ $objFit: objFit,
10496
+ $objPosition: objPosition,
10497
+ alt,
10498
+ loading,
10499
+ src,
10500
+ ...otherProps
10501
+ }
10502
+ );
10503
+ Image.displayName = "Image";
10455
10504
  export {
10456
10505
  ActionButton,
10457
10506
  Avatar,
@@ -10482,6 +10531,7 @@ export {
10482
10531
  Heading,
10483
10532
  Icon,
10484
10533
  IconButton,
10534
+ Image,
10485
10535
  Input,
10486
10536
  Label,
10487
10537
  Link,