@sonic-equipment/ui 0.0.81 → 0.0.82

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.
Files changed (28) hide show
  1. package/dist/index.d.ts +18 -29
  2. package/dist/index.js +760 -657
  3. package/dist/src/buttons/button/button.d.ts +3 -4
  4. package/dist/src/buttons/button/button.stories.d.ts +1 -1
  5. package/dist/src/buttons/icon-button/icon-button.d.ts +2 -2
  6. package/dist/src/buttons/icon-button/icon-button.stories.d.ts +1 -1
  7. package/dist/src/buttons/link/link.d.ts +4 -9
  8. package/dist/src/buttons/link/link.stories.d.ts +1 -1
  9. package/dist/src/cards/product-card/{connected-product-cart.d.ts → connected-product-card.d.ts} +1 -2
  10. package/dist/src/cards/product-card/product-card.d.ts +4 -5
  11. package/dist/src/carousel/carousel-navigation-button.d.ts +5 -2
  12. package/dist/src/carousel/pagination/pagination.d.ts +14 -0
  13. package/dist/src/carousel/pagination/pagination.stories.d.ts +14 -0
  14. package/dist/src/carousel/pagination/transitions.d.ts +34 -0
  15. package/dist/src/carousel/usp-carousel/product-usp-carousel.d.ts +12 -0
  16. package/dist/src/carousel/usp-carousel/product-usp-carousel.stories.d.ts +27 -0
  17. package/dist/src/carousel/usp-carousel/usp-carousel.d.ts +2 -2
  18. package/dist/src/media/image-lightbox/image-lightbox.d.ts +8 -0
  19. package/dist/src/media/image-lightbox/image-lightbox.stories.d.ts +13 -0
  20. package/dist/src/modals/modal/modal.d.ts +3 -1
  21. package/dist/src/modals/modal/modal.stories.d.ts +11 -0
  22. package/dist/src/pages/product-details-page/components/product-details-images/product-detail-images.d.ts +6 -0
  23. package/dist/src/shared/hooks/use-resize-observer.d.ts +1 -1
  24. package/dist/src/shared/routing/route-link.d.ts +4 -2
  25. package/dist/styles.css +390 -154
  26. package/package.json +3 -3
  27. /package/dist/src/{usp/product-usp.d.ts → carousel/usp-carousel/product-usp-carousel-slide.d.ts} +0 -0
  28. /package/dist/src/pages/product-details-page/components/{product-details-panel.d.ts → product-details-panel/product-details-panel.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import { MouseEvent, ReactNode } from 'react';
2
2
  export interface ButtonProps {
3
3
  _pseudo?: 'none' | 'focus' | 'hover' | 'active';
4
4
  children?: ReactNode;
@@ -8,11 +8,10 @@ export interface ButtonProps {
8
8
  icon?: React.ReactNode;
9
9
  iconPosition?: 'left' | 'right';
10
10
  isDisabled?: boolean;
11
- onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
12
- onPress?: VoidFunction | ((...args: unknown[]) => void);
11
+ onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
13
12
  size?: 'sm' | 'md' | 'lg';
14
13
  type?: 'button' | 'submit' | 'reset';
15
14
  variant?: 'solid' | 'outline' | 'ghost';
16
15
  withArrow?: boolean;
17
16
  }
18
- export declare function Button({ _pseudo, children, className, color, condensed, icon, iconPosition, isDisabled, onClick: _onClick, onPress: onPress, size, type, variant, withArrow, }: ButtonProps): import("react/jsx-runtime").JSX.Element;
17
+ export declare function Button({ _pseudo, children, className, color, condensed, icon, iconPosition, isDisabled, onClick: _onClick, size, type, variant, withArrow, }: ButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,7 @@ import type { StoryObj } from '@storybook/react';
2
2
  import { Button } from './button';
3
3
  declare const meta: {
4
4
  args: {
5
- onPress: import("@vitest/spy").Mock<(...args: any[]) => any>;
5
+ onClick: import("@vitest/spy").Mock<(...args: any[]) => any>;
6
6
  size: "lg";
7
7
  };
8
8
  component: typeof Button;
@@ -3,8 +3,8 @@ export interface IconButtonProps {
3
3
  className?: string;
4
4
  color?: 'primary' | 'secondary';
5
5
  isDisabled?: boolean;
6
- onPress?: VoidFunction;
6
+ onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
7
7
  size?: 'md' | 'lg';
8
8
  type?: 'button' | 'submit' | 'reset';
9
9
  }
10
- export declare function IconButton({ children, className, color, isDisabled, onPress, size, type, }: IconButtonProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function IconButton({ children, className, color, isDisabled, onClick, size, type, }: IconButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,7 @@ import type { StoryObj } from '@storybook/react';
2
2
  import { IconButton } from './icon-button';
3
3
  declare const meta: {
4
4
  args: {
5
- onPress: import("@vitest/spy").Mock<(...args: any[]) => any>;
5
+ onClick: import("@vitest/spy").Mock<(...args: any[]) => any>;
6
6
  };
7
7
  component: typeof IconButton;
8
8
  parameters: {
@@ -1,14 +1,9 @@
1
- import { MouseEvent, RefAttributes } from 'react';
2
- import { LinkProps as AriaLinkProps } from 'react-aria-components';
3
- export interface LinkProps extends AriaLinkProps, RefAttributes<HTMLAnchorElement> {
1
+ import { AnchorHTMLAttributes } from 'react';
2
+ export interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
4
3
  areaSelected?: boolean;
5
- className?: string;
6
4
  color?: 'primary' | 'secondary';
7
5
  hasUnderline?: boolean;
8
- id?: string;
9
- onClick?(event: MouseEvent): void;
10
- onMouseDown?(event: MouseEvent): void;
11
- onMouseMove?(event: MouseEvent): void;
6
+ isDisabled?: boolean;
12
7
  role?: 'option';
13
8
  }
14
- export declare function Link({ children, className, color, hasUnderline, onClick: _onClick, onPress, ref, ...props }: LinkProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function Link({ children, className, color, hasUnderline, isDisabled, onClick, ...props }: LinkProps): import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,7 @@ import type { StoryObj } from '@storybook/react';
2
2
  import { Link } from './link';
3
3
  declare const meta: {
4
4
  args: {
5
- onPress: import("@vitest/spy").Mock<(...args: any[]) => any>;
5
+ onClick: import("@vitest/spy").Mock<(...args: any[]) => any>;
6
6
  };
7
7
  component: typeof Link;
8
8
  parameters: {
@@ -3,6 +3,5 @@ export interface ConnectedProductCartProps extends Omit<ProductCardProps, 'addTo
3
3
  onAddToCart?: VoidFunction;
4
4
  onFavorited?: VoidFunction;
5
5
  onFavoriting?: VoidFunction;
6
- productId: string;
7
6
  }
8
- export declare function ConnectedProductCard({ onAddToCart, onFavorited, onFavoriting, productId, ...props }: ConnectedProductCartProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function ConnectedProductCard({ id, onAddToCart, onFavorited, onFavoriting, ...props }: ConnectedProductCartProps): import("react/jsx-runtime").JSX.Element;
@@ -1,17 +1,16 @@
1
1
  import { ReactElement, ReactNode } from 'react';
2
- import { PressEvent } from 'react-aria-components';
3
- import { LinkProps } from 'buttons/link/link';
4
2
  import type { ImageSource } from 'shared/model/image';
5
3
  import type { ProductPrice as ProductPriceType } from 'shared/model/price';
6
- export interface ProductCardProps extends LinkProps {
4
+ export interface ProductCardProps {
7
5
  addToCartButton: ReactElement;
8
6
  favoriteButton?: ReactElement;
9
7
  href: string;
8
+ id: string;
10
9
  image: ImageSource;
11
- onPress?: (e: PressEvent) => void;
10
+ onClick?: VoidFunction;
12
11
  price: ProductPriceType;
13
12
  sku: string;
14
13
  tags?: string[];
15
14
  title: ReactNode;
16
15
  }
17
- export declare function ProductCard({ addToCartButton: AddToCartButton, areaSelected, favoriteButton: FavoriteButton, href, id, image, onClick, onMouseDown, onMouseMove, onPress, price, role, sku, tags, title, }: ProductCardProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function ProductCard({ addToCartButton: AddToCartButton, favoriteButton: FavoriteButton, href, id, image, onClick, price, sku, tags, title, }: ProductCardProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,9 @@
1
+ export type SwipeDirection = 'previous' | 'next';
1
2
  interface CarouselNavigationButtonProps {
2
- direction: 'previous' | 'next';
3
+ className?: string;
4
+ direction: SwipeDirection;
3
5
  isDisabled?: boolean;
6
+ onClick?: (direction: SwipeDirection) => void;
4
7
  }
5
- export declare function CarouselNavigationButton({ direction, isDisabled, }: CarouselNavigationButtonProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare const CarouselNavigationButton: React.ForwardRefExoticComponent<CarouselNavigationButtonProps & React.RefAttributes<HTMLButtonElement>>;
6
9
  export {};
@@ -0,0 +1,14 @@
1
+ interface PaginationButtonProps {
2
+ index: number;
3
+ onChange?: (index: number, target: Element, size: DOMRectReadOnly, position: DOMRectReadOnly | undefined) => void;
4
+ onClick?: () => void;
5
+ }
6
+ export declare function PaginationButton({ index, onChange, onClick, }: PaginationButtonProps): import("react/jsx-runtime").JSX.Element;
7
+ interface PaginationProps {
8
+ contained?: boolean;
9
+ currentPage: number;
10
+ numberOfPages: number;
11
+ onChange?: (page: number) => void;
12
+ }
13
+ export declare function Pagination({ contained, currentPage, numberOfPages, onChange, }: PaginationProps): import("react/jsx-runtime").JSX.Element | undefined;
14
+ export {};
@@ -0,0 +1,14 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ import { Pagination } from './pagination';
3
+ declare const meta: {
4
+ component: typeof Pagination;
5
+ parameters: {
6
+ layout: string;
7
+ };
8
+ tags: string[];
9
+ title: string;
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const Default: Story;
14
+ export declare const Contained: Story;
@@ -0,0 +1,34 @@
1
+ interface TransitionBase {
2
+ type: 'slide' | 'grow' | 'shrink';
3
+ }
4
+ interface SlideTransition extends TransitionBase {
5
+ position: number;
6
+ type: 'slide';
7
+ }
8
+ interface GrowTransition extends TransitionBase {
9
+ size: number;
10
+ type: 'grow';
11
+ }
12
+ interface ShrinkTransition extends TransitionBase {
13
+ size: number;
14
+ type: 'shrink';
15
+ }
16
+ type Transition = SlideTransition | GrowTransition | ShrinkTransition;
17
+ export declare class Animation {
18
+ protected _currentPage: number;
19
+ protected _buttonElement: HTMLElement | null;
20
+ protected _circleElement: HTMLElement | null;
21
+ protected _paginationButtonElements: (HTMLElement | null)[];
22
+ protected _transitionQueue: Transition[];
23
+ protected _currentSize: number;
24
+ protected _currentPosition: number;
25
+ constructor(initialPage?: number);
26
+ refPaginationButton(index: number): (element: HTMLElement | null) => void;
27
+ refButton(element: HTMLElement | null): void;
28
+ refCircle(element: HTMLElement | null): void;
29
+ protected getLeftPositionOfPaginationButtonElement(index: number): number;
30
+ protected onNextTransition(): Animation;
31
+ animate(page: number): Animation;
32
+ dispose(): void;
33
+ }
34
+ export {};
@@ -0,0 +1,12 @@
1
+ import { Image } from 'shared/model/image';
2
+ interface Usp {
3
+ heading: string;
4
+ icon: Image;
5
+ image: Image;
6
+ text: string;
7
+ }
8
+ interface ProductUspItemProps {
9
+ usps: Usp[];
10
+ }
11
+ export declare function ProductUSPCarousel({ usps }: ProductUspItemProps): import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,27 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ import { ProductUSPCarousel } from 'carousel/usp-carousel/product-usp-carousel';
3
+ declare const meta: {
4
+ args: {
5
+ usps: {
6
+ heading: string;
7
+ icon: {
8
+ 1: string;
9
+ 2: string;
10
+ 3: string;
11
+ altText: string;
12
+ };
13
+ image: {
14
+ 1: string;
15
+ 2: string;
16
+ 3: string;
17
+ altText: string;
18
+ };
19
+ text: string;
20
+ }[];
21
+ };
22
+ component: typeof ProductUSPCarousel;
23
+ title: string;
24
+ };
25
+ export default meta;
26
+ type Story = StoryObj<typeof meta>;
27
+ export declare const Default: Story;
@@ -1,8 +1,8 @@
1
1
  import { ReactNode } from 'react';
2
2
  import 'swiper/css';
3
3
  import 'swiper/css/pagination';
4
- interface UspCarousel {
4
+ interface USPCarousel {
5
5
  slides: ReactNode[];
6
6
  }
7
- export declare const UspCarousel: ({ slides }: UspCarousel) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const USPCarousel: ({ slides }: USPCarousel) => import("react/jsx-runtime").JSX.Element;
8
8
  export {};
@@ -0,0 +1,8 @@
1
+ import { Image as ImageType } from 'shared/model/image';
2
+ import 'swiper/css';
3
+ export interface ImageLightboxProps {
4
+ images: ImageType[];
5
+ initialSelectedIndex?: number;
6
+ variant?: 'sm' | 'lg';
7
+ }
8
+ export declare function ImageLightbox({ images, initialSelectedIndex, variant, }: ImageLightboxProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import { ImageLightbox } from './image-lightbox';
3
+ declare const meta: {
4
+ component: typeof ImageLightbox;
5
+ parameters: {
6
+ layout: string;
7
+ };
8
+ title: string;
9
+ };
10
+ export default meta;
11
+ type Story = StoryObj<typeof meta>;
12
+ export declare const Small: Story;
13
+ export declare const Large: Story;
@@ -2,9 +2,11 @@ import { ReactNode } from 'react';
2
2
  export interface ModalProps {
3
3
  children: ReactNode;
4
4
  className?: string;
5
+ hasCloseButton?: boolean;
5
6
  isDismissable?: boolean;
7
+ isFullScreen?: boolean;
6
8
  isKeyboardDismissDisabled?: boolean;
7
9
  isOpen: boolean;
8
10
  onOpenChange: (isOpen: boolean) => void;
9
11
  }
10
- export declare function Modal({ children, className, isDismissable, isKeyboardDismissDisabled, isOpen, onOpenChange, }: ModalProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function Modal({ children, className, hasCloseButton, isDismissable, isFullScreen, isKeyboardDismissDisabled, isOpen, onOpenChange, }: ModalProps): import("react/jsx-runtime").JSX.Element;
@@ -7,11 +7,21 @@ declare const meta: {
7
7
  type: "text";
8
8
  };
9
9
  };
10
+ hasCloseButton: {
11
+ control: {
12
+ type: "boolean";
13
+ };
14
+ };
10
15
  isDismissable: {
11
16
  control: {
12
17
  type: "boolean";
13
18
  };
14
19
  };
20
+ isFullScreen: {
21
+ control: {
22
+ type: "boolean";
23
+ };
24
+ };
15
25
  isKeyboardDismissDisabled: {
16
26
  control: {
17
27
  type: "boolean";
@@ -32,3 +42,4 @@ declare const meta: {
32
42
  export default meta;
33
43
  type Story = StoryObj<typeof meta>;
34
44
  export declare const Default: Story;
45
+ export declare const FullScreen: Story;
@@ -0,0 +1,6 @@
1
+ import { Image as ImageType } from 'shared/model/image';
2
+ interface ProductDetailImagesProps {
3
+ images: ImageType[];
4
+ }
5
+ export declare function ProductDetailImages({ images }: ProductDetailImagesProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -1,4 +1,4 @@
1
- export declare function useResizeObserver(resizeCallback: (size: DOMRectReadOnly) => void): {
1
+ export declare function useResizeObserver(resizeCallback: (target: Element, size: DOMRectReadOnly, position: DOMRectReadOnly | undefined) => void): {
2
2
  ref: <T extends HTMLElement>(el: T | null) => void;
3
3
  size: DOMRectReadOnly | undefined;
4
4
  };
@@ -1,7 +1,9 @@
1
+ import { MouseEvent } from 'react';
1
2
  import { LinkProps } from 'buttons/link/link';
2
3
  import { NavigateOptions } from './route-provider';
3
- interface RouteLinkProps extends LinkProps {
4
+ interface RouteLinkProps extends Omit<LinkProps, 'onPress'> {
5
+ onClick?: (e: MouseEvent<HTMLAnchorElement>) => void;
4
6
  route?: NavigateOptions;
5
7
  }
6
- export declare function RouteLink({ children, onClick: _onClick, ...props }: RouteLinkProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function RouteLink({ children, ...props }: RouteLinkProps): import("react/jsx-runtime").JSX.Element;
7
9
  export {};