@beydesign/storybook 0.5.3 → 0.5.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.
@@ -3,22 +3,11 @@ import { useState } from 'react';
3
3
  import { Box } from '@mui/material';
4
4
  import { keyframes } from '@emotion/react';
5
5
  import { ArrowsClockwise, Warning } from '@phosphor-icons/react';
6
+ import { ASPECT_RATIO_BY_VIEW, WIDTH_BY_VIEW } from './constants';
6
7
  import { AvatarSilhouette } from './AvatarSilhouette';
7
8
  import { Typography, TypographySize, TypographyWeight } from '../Typography';
8
9
  import { Menu, Badge, BadgeColor, BadgeSize } from '../UI';
9
10
  import { MainButton, ButtonHierarchy, ButtonSize, ButtonDisplayMode, } from '../Buttons';
10
- /** Default card width per view variant. */
11
- const WIDTH_BY_VIEW = {
12
- avatar: '208px',
13
- agent: '280px',
14
- video: '340px',
15
- };
16
- /** Default image aspect ratio per view variant. */
17
- const ASPECT_RATIO_BY_VIEW = {
18
- avatar: '203 / 264',
19
- agent: '264 / 268',
20
- video: '16 / 9',
21
- };
22
11
  /** Empty-state label per view variant, shown over the silhouette when there is no image. */
23
12
  const EMPTY_TEXT_BY_VIEW = {
24
13
  avatar: 'Avatar is not available',
@@ -1,18 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box } from '@mui/material';
3
+ import { ASPECT_RATIO_BY_VIEW, WIDTH_BY_VIEW } from './constants';
3
4
  import { SkeletonLoader } from '../UI';
4
- /** Default card width per view variant. */
5
- const WIDTH_BY_VIEW = {
6
- avatar: '208px',
7
- agent: '280px',
8
- video: '340px',
9
- };
10
- /** Default image aspect ratio per view variant. */
11
- const ASPECT_RATIO_BY_VIEW = {
12
- avatar: '203 / 264',
13
- agent: '1 / 1',
14
- video: '16 / 9',
15
- };
16
5
  export const EntityCardSkeleton = ({ view = 'avatar', aspectRatio, width, showDescription = false, style, }) => {
17
6
  const cardWidth = width ?? WIDTH_BY_VIEW[view];
18
7
  const imageAspectRatio = aspectRatio ?? ASPECT_RATIO_BY_VIEW[view];
@@ -0,0 +1,9 @@
1
+ import { EntityCardView } from './types';
2
+ /**
3
+ * Card metrics shared by EntityCard and EntityCardSkeleton — the skeleton
4
+ * stands in for the card while its media loads, so both must measure the same.
5
+ */
6
+ /** Default card width per view variant. */
7
+ export declare const WIDTH_BY_VIEW: Record<EntityCardView, string>;
8
+ /** Default image aspect ratio per view variant. */
9
+ export declare const ASPECT_RATIO_BY_VIEW: Record<EntityCardView, string>;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Card metrics shared by EntityCard and EntityCardSkeleton — the skeleton
3
+ * stands in for the card while its media loads, so both must measure the same.
4
+ */
5
+ /** Default card width per view variant. */
6
+ export const WIDTH_BY_VIEW = {
7
+ avatar: '208px',
8
+ agent: '280px',
9
+ video: '340px',
10
+ };
11
+ /** Default image aspect ratio per view variant. */
12
+ export const ASPECT_RATIO_BY_VIEW = {
13
+ avatar: '203 / 264',
14
+ agent: '264 / 268',
15
+ video: '16 / 9',
16
+ };
@@ -62,7 +62,7 @@ export interface EntityCardProps {
62
62
  export interface EntityCardSkeletonProps {
63
63
  /** View variant — drives default width and image aspect ratio */
64
64
  view?: EntityCardView;
65
- /** Aspect ratio of the placeholder — overrides the per-view default */
65
+ /** Aspect ratio of the placeholder — overrides the per-view default (`203 / 264` avatar, `264 / 268` agent, `16 / 9` video) */
66
66
  aspectRatio?: string;
67
67
  /** Width of the card (overrides the view default) */
68
68
  width?: string | number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@beydesign/storybook",
3
3
  "private": false,
4
- "version": "0.5.3",
4
+ "version": "0.5.4",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",