@apify/ui-library 1.121.0 → 1.123.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.
Files changed (53) hide show
  1. package/dist/src/components/avatar/actor_avatar.d.ts.map +1 -0
  2. package/dist/src/components/{store → avatar}/actor_avatar.js +4 -1
  3. package/dist/src/components/avatar/actor_avatar.js.map +1 -0
  4. package/dist/src/components/avatar/boring_avatar.d.ts.map +1 -0
  5. package/dist/src/components/avatar/boring_avatar.js.map +1 -0
  6. package/dist/src/components/avatar/index.d.ts +3 -0
  7. package/dist/src/components/avatar/index.d.ts.map +1 -0
  8. package/dist/src/components/avatar/index.js +3 -0
  9. package/dist/src/components/avatar/index.js.map +1 -0
  10. package/dist/src/components/avatar/user_avatar.d.ts +17 -0
  11. package/dist/src/components/avatar/user_avatar.d.ts.map +1 -0
  12. package/dist/src/components/avatar/user_avatar.js +61 -0
  13. package/dist/src/components/avatar/user_avatar.js.map +1 -0
  14. package/dist/src/components/icon_button.d.ts +1 -0
  15. package/dist/src/components/icon_button.d.ts.map +1 -1
  16. package/dist/src/components/icon_button.js +23 -3
  17. package/dist/src/components/icon_button.js.map +1 -1
  18. package/dist/src/components/index.d.ts +1 -1
  19. package/dist/src/components/index.d.ts.map +1 -1
  20. package/dist/src/components/index.js +1 -1
  21. package/dist/src/components/index.js.map +1 -1
  22. package/dist/src/components/simple_markdown/simple_markdown_components.d.ts +3 -2
  23. package/dist/src/components/simple_markdown/simple_markdown_components.d.ts.map +1 -1
  24. package/dist/src/components/simple_markdown/simple_markdown_components.js +4 -4
  25. package/dist/src/components/simple_markdown/simple_markdown_components.js.map +1 -1
  26. package/dist/src/components/store/index.d.ts +0 -1
  27. package/dist/src/components/store/index.d.ts.map +1 -1
  28. package/dist/src/components/store/index.js +0 -1
  29. package/dist/src/components/store/index.js.map +1 -1
  30. package/dist/src/components/store/store_actor_header.js +1 -1
  31. package/dist/src/components/store/store_actor_header.js.map +1 -1
  32. package/dist/tsconfig.build.tsbuildinfo +1 -1
  33. package/package.json +2 -2
  34. package/src/components/{store → avatar}/actor_avatar.stories.tsx +1 -1
  35. package/src/components/{store → avatar}/actor_avatar.tsx +4 -6
  36. package/src/components/avatar/index.ts +2 -0
  37. package/src/components/avatar/user_avatar.stories.tsx +111 -0
  38. package/src/components/avatar/user_avatar.tsx +111 -0
  39. package/src/components/code/code_block/code_block.stories.jsx +3 -9
  40. package/src/components/icon_button.tsx +24 -2
  41. package/src/components/index.ts +1 -1
  42. package/src/components/simple_markdown/simple_markdown_components.tsx +7 -6
  43. package/src/components/store/index.ts +0 -1
  44. package/src/components/store/store_actor_header.tsx +1 -1
  45. package/dist/src/components/boring_avatar.d.ts.map +0 -1
  46. package/dist/src/components/boring_avatar.js.map +0 -1
  47. package/dist/src/components/store/actor_avatar.d.ts.map +0 -1
  48. package/dist/src/components/store/actor_avatar.js.map +0 -1
  49. package/src/components/boring_avatar.stories.tsx +0 -188
  50. /package/dist/src/components/{store → avatar}/actor_avatar.d.ts +0 -0
  51. /package/dist/src/components/{boring_avatar.d.ts → avatar/boring_avatar.d.ts} +0 -0
  52. /package/dist/src/components/{boring_avatar.js → avatar/boring_avatar.js} +0 -0
  53. /package/src/components/{boring_avatar.tsx → avatar/boring_avatar.tsx} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apify/ui-library",
3
- "version": "1.121.0",
3
+ "version": "1.123.0",
4
4
  "description": "React UI library used by apify.com",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -65,5 +65,5 @@
65
65
  "src",
66
66
  "style"
67
67
  ],
68
- "gitHead": "234eb45c25c1f6b5f0943da5fc4cd2c5fecd2afd"
68
+ "gitHead": "3c83585389c9e8c4e8449ae090dad74640cfaf23"
69
69
  }
@@ -4,7 +4,7 @@ import React from 'react';
4
4
  import { ActorAvatar } from './actor_avatar.js';
5
5
 
6
6
  const meta = {
7
- title: 'UI-Library/Store/ActorAvatar',
7
+ title: 'UI-Library/Avatar/ActorAvatar',
8
8
  component: ActorAvatar,
9
9
  parameters: {
10
10
  layout: 'padded',
@@ -3,12 +3,10 @@ import type { FC, RefCallback } from 'react';
3
3
  import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
4
4
  import styled from 'styled-components';
5
5
 
6
- import {
7
- BoringAvatarMarble,
8
- theme,
9
- useImageColor,
10
- useSharedUiDependencies,
11
- } from '../../index.js';
6
+ import { theme } from '../../design_system/theme.js';
7
+ import { useSharedUiDependencies } from '../../ui_dependency_provider.js';
8
+ import { useImageColor } from '../../utils/image_color.js';
9
+ import { BoringAvatarMarble } from './boring_avatar.js';
12
10
 
13
11
  export const actorAvatarClassnames = {
14
12
  BASE: 'ActorAvatar',
@@ -0,0 +1,2 @@
1
+ export * from './actor_avatar.js';
2
+ export * from './user_avatar.js';
@@ -0,0 +1,111 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import React from 'react';
3
+ import styled from 'styled-components';
4
+
5
+ import { UserAvatar } from './user_avatar.js';
6
+
7
+ const meta = {
8
+ title: 'UI-Library/Avatar/UserAvatar',
9
+ component: UserAvatar,
10
+ parameters: {
11
+ layout: 'padded',
12
+ },
13
+ argTypes: {
14
+ name: {
15
+ control: 'text',
16
+ description: 'Name used to generate the avatar when no URL is provided',
17
+ },
18
+ url: {
19
+ control: 'text',
20
+ description: 'URL of the avatar image',
21
+ },
22
+ size: {
23
+ control: 'number',
24
+ description: 'Size of the avatar in pixels',
25
+ },
26
+ alt: {
27
+ control: 'text',
28
+ description: 'Alt text for the avatar image',
29
+ },
30
+ asOrganization: {
31
+ control: 'boolean',
32
+ description: 'Whether to display as organization avatar with organization fallback',
33
+ },
34
+ },
35
+ } satisfies Meta<typeof UserAvatar>;
36
+
37
+ export default meta;
38
+ type Story = StoryObj<typeof meta>;
39
+
40
+ export const Default: Story = {
41
+ args: {
42
+ name: 'John Doe',
43
+ size: 64,
44
+ },
45
+ };
46
+
47
+ export const Sizes: Story = {
48
+ render: () => (
49
+ <div style={{ display: 'flex', gap: '16px', alignItems: 'flex-end' }}>
50
+ {[24, 32, 40, 48, 64, 80, 128].map((size) => (
51
+ <div key={size} style={{ textAlign: 'center' }}>
52
+ <UserAvatar name="John Doe" size={size} />
53
+ <p style={{ marginTop: '8px', fontSize: '12px' }}>{size}px</p>
54
+ </div>
55
+ ))}
56
+ </div>
57
+ ),
58
+ };
59
+
60
+ const WithImageUrlShowcase = styled.div`
61
+ display: flex;
62
+ flex-direction: row;
63
+ gap: 16px;
64
+ margin-top: 16px;
65
+
66
+ div {
67
+ display: flex;
68
+ flex-direction: column;
69
+ align-items: center;
70
+ width: 100px;
71
+ text-align: center;
72
+ }
73
+
74
+ small {
75
+ display: block;
76
+ color: #666;
77
+ font-size: 0.875rem;
78
+ margin-bottom: 0.5rem;
79
+ }
80
+ `;
81
+ export const WithImageUrl: Story = {
82
+ render: () => (
83
+ <WithImageUrlShowcase>
84
+ <div>
85
+ <UserAvatar
86
+ name="John Doe"
87
+ url="https://apify.github.io/apify-web/img/apify-logo/logomark-32x32.svg"
88
+ size={64}
89
+ />
90
+ <small>With image</small>
91
+ </div>
92
+ <div>
93
+ <UserAvatar
94
+ name="John Doe"
95
+ url="https://wrong-url-to-trigger-error.com/avatar.png"
96
+ size={64}
97
+ />
98
+ <small>With broken image URL</small>
99
+ </div>
100
+ <div>
101
+ <UserAvatar
102
+ name="Apify"
103
+ url="https://wrong-url-to-trigger-error.com/avatar.png"
104
+ size={64}
105
+ asOrganization={true}
106
+ />
107
+ <small>With broken image URL as organization</small>
108
+ </div>
109
+ </WithImageUrlShowcase>
110
+ ),
111
+ };
@@ -0,0 +1,111 @@
1
+ import clsx from 'clsx';
2
+ import type { FC } from 'react';
3
+ import React, { useEffect } from 'react';
4
+ import styled from 'styled-components';
5
+
6
+ import { theme } from '../../design_system/theme.js';
7
+ import { useSharedUiDependencies } from '../../ui_dependency_provider.js';
8
+ import { BoringAvatarSolid } from './boring_avatar.js';
9
+
10
+ const DEFAULT_USER_PICTURE_URL = 'https://cdn.apify.com/img/icons/anonymous_user_picture.png';
11
+ const DEFAULT_ORGANIZATION_PICTURE_URL = 'https://cdn.apify.com/img/icons/anonymous_organization_picture.png';
12
+
13
+ export const userAvatarBaseClassNames = {
14
+ BASE: 'UserAvatar',
15
+ IMG: 'UserAvatar-image',
16
+ SVG: 'UserAvatar-svg',
17
+ };
18
+
19
+ const StyledBoringAvatarSolid = styled(BoringAvatarSolid)`
20
+ border-radius: 100%;
21
+
22
+ text {
23
+ ${theme.typography.shared.mobile.bodyMStrong};
24
+
25
+ @media ${theme.device.tablet} {
26
+ ${theme.typography.shared.tablet.bodyMStrong}
27
+ }
28
+ @media ${theme.device.desktop} {
29
+ ${theme.typography.shared.desktop.bodyMStrong}
30
+ }
31
+
32
+ fill: ${theme.color.neutral.background};
33
+ color: ${theme.color.neutral.background};
34
+ text-transform: uppercase;
35
+ white-space: pre;
36
+ }
37
+ `;
38
+
39
+ const StyledImg = styled.img`
40
+ border-radius: 100%;
41
+ `;
42
+
43
+ interface UserAvatarProps extends React.ImgHTMLAttributes<HTMLImageElement> {
44
+ name?: string;
45
+ className?: string;
46
+ url?: string;
47
+ alt?: string;
48
+ size: number;
49
+ asOrganization?: boolean;
50
+ }
51
+
52
+ const UserAvatarInner: FC<UserAvatarProps> = ({
53
+ name,
54
+ className,
55
+ url,
56
+ size,
57
+ alt,
58
+ asOrganization,
59
+ ...rest
60
+ }) => {
61
+ const [imgError, setImgError] = React.useState(false);
62
+ const { generateProxyImageUrl } = useSharedUiDependencies();
63
+
64
+ const fullClassName = clsx(
65
+ userAvatarBaseClassNames.BASE,
66
+ url ? userAvatarBaseClassNames.IMG : userAvatarBaseClassNames.SVG,
67
+ className,
68
+ );
69
+
70
+ // Whenever the url changes, reset the img error state.
71
+ useEffect(() => {
72
+ setImgError(false);
73
+ }, [url]);
74
+
75
+ const onImageError = ({ currentTarget }: { currentTarget: HTMLImageElement }) => {
76
+ if (imgError || !currentTarget) return;
77
+
78
+ // eslint-disable-next-line no-param-reassign
79
+ currentTarget.src = asOrganization ? DEFAULT_ORGANIZATION_PICTURE_URL : DEFAULT_USER_PICTURE_URL;
80
+ setImgError(true);
81
+ };
82
+
83
+ const altText = alt || `${name} avatar`;
84
+
85
+ if (url) {
86
+ return (
87
+ <StyledImg
88
+ className={fullClassName}
89
+ src={generateProxyImageUrl
90
+ ? generateProxyImageUrl(url, { resize: { height: size * 2, width: size * 2 } })
91
+ : url
92
+ }
93
+ width={size}
94
+ height={size}
95
+ alt={altText}
96
+ onError={onImageError}
97
+ {...rest}
98
+ />
99
+ );
100
+ }
101
+ return (
102
+ <StyledBoringAvatarSolid
103
+ alt={altText}
104
+ size={size}
105
+ className={fullClassName}
106
+ name={name}
107
+ />
108
+ );
109
+ };
110
+
111
+ export const UserAvatar = React.memo(UserAvatarInner);
@@ -13,12 +13,6 @@ export default {
13
13
  component: CodeBlock,
14
14
  };
15
15
 
16
- const shuffleLines = (code) => {
17
- const lines = code.split('\n');
18
- const shuffledLines = lines.sort(() => Math.random() - 0.5);
19
- return shuffledLines.join('\n');
20
- };
21
-
22
16
  const Template = ({ content, ...args }) => {
23
17
  const longCode = `${Array.from(
24
18
  { length: 20 },
@@ -27,13 +21,13 @@ const Template = ({ content, ...args }) => {
27
21
  const multipleCodes = Array.from({ length: 5 }, (_, i) => ({
28
22
  key: i,
29
23
  label: `Code ${i}`,
30
- code: shuffleLines(content),
24
+ code: content,
31
25
  }));
32
26
  const multipleLongCodes = Array.from({ length: 5 }, (_, i) => ({
33
27
  key: i,
34
28
  label: `Code ${i}`,
35
- code: shuffleLines(longCode),
36
- highlightLines: Array.from({ length: 3 }, () => Math.floor(Math.random() * 10)),
29
+ code: longCode,
30
+ highlightLines: [1, 3, 5],
37
31
  }));
38
32
  return (
39
33
  <div
@@ -17,6 +17,7 @@ export const ICON_BUTTON_VARIANTS = {
17
17
  BORDERED: 'BORDERED',
18
18
  DANGER: 'DANGER',
19
19
  DANGER_BORDERED: 'DANGER_BORDERED',
20
+ PRIMARY_BLACK: 'PRIMARY_BLACK',
20
21
  } as const;
21
22
  export type ICON_BUTTON_VARIANTS = ValueOf<typeof ICON_BUTTON_VARIANTS>;
22
23
 
@@ -24,39 +25,58 @@ const iconButtonVariantStyle = {
24
25
  [ICON_BUTTON_VARIANTS.DEFAULT]: {
25
26
  backgroundColor: 'transparent',
26
27
  backgroundHoverColor: theme.color.neutral.hover,
28
+ backgroundActiveColor: theme.color.neutral.actionSecondaryActive,
27
29
  backgroundDisabledColor: 'transparent',
28
30
  borderColor: 'transparent',
29
31
  borderHoverColor: 'transparent',
32
+ borderActiveColor: theme.color.neutral.actionSecondaryActive,
30
33
  borderDisabledColor: 'transparent',
31
34
  iconColor: theme.color.neutral.text,
32
35
  },
33
36
  [ICON_BUTTON_VARIANTS.BORDERED]: {
34
37
  backgroundColor: theme.color.neutral.backgroundMuted,
35
38
  backgroundHoverColor: theme.color.neutral.hover,
39
+ backgroundActiveColor: theme.color.neutral.actionSecondaryActive,
36
40
  backgroundDisabledColor: theme.color.neutral.disabled,
37
41
  borderColor: theme.color.neutral.border,
38
42
  borderHoverColor: theme.color.neutral.border,
43
+ borderActiveColor: theme.color.neutral.actionSecondaryActive,
39
44
  borderDisabledColor: theme.color.neutral.border,
40
45
  iconColor: theme.color.neutral.text,
41
46
  },
42
47
  [ICON_BUTTON_VARIANTS.DANGER_BORDERED]: {
43
48
  backgroundColor: theme.color.neutral.backgroundMuted,
44
49
  backgroundHoverColor: theme.color.danger.backgroundHover,
50
+ backgroundActiveColor: theme.color.neutral.actionSecondaryActive,
45
51
  backgroundDisabledColor: theme.color.neutral.backgroundSubtle,
46
52
  borderColor: theme.color.neutral.border,
47
53
  borderHoverColor: theme.color.danger.borderSubtle,
54
+ borderActiveColor: theme.color.neutral.actionSecondaryActive,
48
55
  borderDisabledColor: theme.color.neutral.border,
49
56
  iconColor: theme.color.danger.text,
50
57
  },
51
58
  [ICON_BUTTON_VARIANTS.DANGER]: {
52
59
  backgroundColor: 'transparent',
53
60
  backgroundHoverColor: theme.color.danger.backgroundHover,
61
+ backgroundActiveColor: theme.color.neutral.actionSecondaryActive,
54
62
  backgroundDisabledColor: theme.color.neutral.backgroundSubtle,
55
63
  borderColor: 'transparent',
56
64
  borderHoverColor: 'transparent',
65
+ borderActiveColor: theme.color.neutral.actionSecondaryActive,
57
66
  borderDisabledColor: 'transparent',
58
67
  iconColor: theme.color.danger.text,
59
68
  },
69
+ [ICON_BUTTON_VARIANTS.PRIMARY_BLACK]: {
70
+ backgroundColor: theme.color.primaryBlack.action,
71
+ backgroundHoverColor: theme.color.primaryBlack.actionHover,
72
+ backgroundActiveColor: theme.color.primaryBlack.actionActive,
73
+ backgroundDisabledColor: theme.color.neutral.disabled,
74
+ borderColor: theme.color.primaryBlack.action,
75
+ borderHoverColor: theme.color.primaryBlack.actionHover,
76
+ borderActiveColor: theme.color.primaryBlack.actionActive,
77
+ borderDisabledColor: theme.color.neutral.disabled,
78
+ iconColor: theme.color.neutral.textOnPrimary,
79
+ },
60
80
  } satisfies Record<ICON_BUTTON_VARIANTS, unknown>;
61
81
 
62
82
  type IconButtonSizeConfig = {
@@ -91,10 +111,12 @@ const getIconButtonColorStyles = (variant: ICON_BUTTON_VARIANTS) => {
91
111
  const {
92
112
  backgroundColor,
93
113
  backgroundHoverColor,
114
+ backgroundActiveColor,
94
115
  backgroundDisabledColor,
95
116
  borderDisabledColor,
96
117
  borderColor,
97
118
  borderHoverColor,
119
+ borderActiveColor,
98
120
  iconColor,
99
121
  } = iconButtonVariantStyle[variant];
100
122
 
@@ -114,8 +136,8 @@ const getIconButtonColorStyles = (variant: ICON_BUTTON_VARIANTS) => {
114
136
  }
115
137
 
116
138
  &:active {
117
- background-color: ${theme.color.neutral.actionSecondaryActive};
118
- border-color: ${theme.color.neutral.actionSecondaryActive};
139
+ background-color: ${backgroundActiveColor};
140
+ border-color: ${borderActiveColor || backgroundActiveColor};
119
141
  }
120
142
 
121
143
  &:disabled {
@@ -1,6 +1,6 @@
1
1
  export * from './text/index.js';
2
2
  export * from './box.js';
3
- export * from './boring_avatar.js';
3
+ export * from './avatar/index.js';
4
4
  export * from './card_container.js';
5
5
  export * from './message.js';
6
6
  export * from './floating/index.js';
@@ -15,8 +15,9 @@ import type { LinkProps } from '../link.js';
15
15
  import { Link } from '../link.js';
16
16
  import { slugifyHeadingChildren } from '../readme_renderer/utils.js';
17
17
  import type { HeadingSharedProps } from '../text/heading_shared.js';
18
- import { Heading, Text } from '../text/index.js';
19
- import type { SharedTextProps, SharedTextSize } from '../text/text_shared.js';
18
+ import { Heading, TextContent } from '../text/index.js';
19
+ import type { ContentTextProps } from '../text/text_content.js';
20
+ import type { SharedTextSize } from '../text/text_shared.js';
20
21
 
21
22
  const simpleMarkdownClassNames = {
22
23
  HEADING_ICON_LINK: 'headingIconLink',
@@ -305,16 +306,16 @@ const getMarkdownVideoSrc = (child?: ElementContent): string | undefined => {
305
306
  };
306
307
 
307
308
  // TODO: This should be used for readmes
308
- export const MarkdownParagraphContent: React.FC<SharedTextProps & MarkdownComponentExtraProps> = async ({
309
+ export function MarkdownParagraphContent({
309
310
  children,
310
311
  node,
311
312
  ...textProps
312
- }) => {
313
+ }: ContentTextProps & MarkdownComponentExtraProps): React.ReactNode {
313
314
  const child = node?.children[0];
314
315
  const videoSrc = getMarkdownVideoSrc(child);
315
316
 
316
317
  if (videoSrc) return <MarkdownVideo src={videoSrc} />;
317
318
 
318
319
  // Render the children as a paragraph
319
- return <Text as='p' my='space16' {...textProps}>{children}</Text>;
320
- };
320
+ return <TextContent my='space16' {...textProps}>{children}</TextContent>;
321
+ }
@@ -1,2 +1 @@
1
1
  export * from './store_actor_header.js';
2
- export * from './actor_avatar.js';
@@ -3,7 +3,7 @@ import styled from 'styled-components';
3
3
  import { StarEmptyIcon, WarningTriangleIcon } from '@apify/ui-icons';
4
4
 
5
5
  import { Badge, Box, type BoxProps, Heading, Text, theme } from '../../index.js';
6
- import { ActorAvatar, actorAvatarClassnames } from './actor_avatar.js';
6
+ import { ActorAvatar, actorAvatarClassnames } from '../avatar/actor_avatar.js';
7
7
 
8
8
  const storeActorHeaderClassNames = {
9
9
  title: 'ActorStoreItem-title',
@@ -1 +0,0 @@
1
- {"version":3,"file":"boring_avatar.d.ts","sourceRoot":"","sources":["../../../src/components/boring_avatar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAgGvC,UAAU,iBAAiB;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,kBAAkB,8EAO5B,iBAAiB,6CA+ElB,CAAC;AAEH,eAAO,MAAM,iBAAiB,8EAO3B,iBAAiB,6CA4DlB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"boring_avatar.js","sourceRoot":"","sources":["../../../src/components/boring_avatar.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,iBAAiB,GAAG,UAAU,EAAE,CAAC;AAEvC,4HAA4H;AAE5H,MAAM,QAAQ,GAAG,CAAC,CAAC;AACnB,MAAM,IAAI,GAAG,GAAG,CAAC;AAEjB,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AAEhD,SAAS,QAAQ,CAAC,IAAa;IAC3B,wFAAwF;IACxF,wCAAwC;IACxC,IAAI,CAAC,IAAI;QAAE,OAAO,CAAC,CAAC;IAEpB,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,CAAC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,IACF,CACT,CAAC;AACN,CAAC,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"actor_avatar.d.ts","sourceRoot":"","sources":["../../../../src/components/store/actor_avatar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAe,MAAM,OAAO,CAAC;AAC7C,OAAO,KAA6E,MAAM,OAAO,CAAC;AAUlG,eAAO,MAAM,qBAAqB;;;;CAIjC,CAAC;AA0BF,UAAU,gBAAiB,SAAQ,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC;IACxE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,gBAAgB,CA4EjD,CAAC;AAEF,eAAO,MAAM,WAAW,8CAA+B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"actor_avatar.js","sourceRoot":"","sources":["../../../../src/components/store/actor_avatar.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClG,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EACH,kBAAkB,EAClB,KAAK,EACL,aAAa,EACb,uBAAuB,GAC1B,MAAM,gBAAgB,CAAC;AAExB,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC,IAAI,EAAE,aAAa;IACnB,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,iBAAiB;CACzB,CAAC;AAEF,MAAM,wBAAwB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAA;qBACtC,KAAK,CAAC,MAAM,C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,IAAI,GACV,CACL,CAAC;IACN,CAAC;IACD,OAAO,CACH,KAAC,wBAAwB,IACrB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,aAAa,EACxB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,IAAI,EACZ,GAAG,EAAE,OAAO,GACd,CACL,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC"}
@@ -1,188 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react-vite';
2
- import styled from 'styled-components';
3
-
4
- import { BoringAvatarMarble, BoringAvatarSolid } from './boring_avatar.js';
5
-
6
- const meta = {
7
- title: 'UI-Library/Store/BoringAvatar',
8
- component: BoringAvatarMarble,
9
- argTypes: {
10
- name: {
11
- control: 'text',
12
- description: 'Name used to generate the avatar (determines colors and letters)',
13
- },
14
- size: {
15
- control: { type: 'number', min: 16, max: 200 },
16
- description: 'Size of the avatar in pixels',
17
- },
18
- square: {
19
- control: 'boolean',
20
- description: 'Whether the avatar should be square instead of circular',
21
- },
22
- colors: {
23
- control: 'object',
24
- description: 'Array of colors used for the avatar generation',
25
- },
26
- alt: {
27
- control: 'text',
28
- description: 'Alt text for accessibility',
29
- },
30
- className: {
31
- control: 'text',
32
- description: 'CSS class name for styling',
33
- },
34
- },
35
- } satisfies Meta<typeof BoringAvatarMarble>;
36
-
37
- export default meta;
38
- type Story = StoryObj<typeof meta>;
39
-
40
- const StoryWrapper = styled.div`
41
- display: flex;
42
- flex-wrap: wrap;
43
- gap: 1rem;
44
- padding: 2rem;
45
- align-items: center;
46
- `;
47
-
48
- const AvatarShowcase = styled.div`
49
- display: flex;
50
- flex-direction: column;
51
- align-items: center;
52
- gap: 0.5rem;
53
-
54
- small {
55
- color: #666;
56
- font-size: 0.75rem;
57
- }
58
- `;
59
-
60
- const GridWrapper = styled.div`
61
- display: grid;
62
- grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
63
- gap: 1.5rem;
64
- padding: 2rem;
65
- `;
66
-
67
- /**
68
- * Default marble avatar with standard settings
69
- */
70
- export const MarbleDefault: Story = {
71
- args: {
72
- name: 'John Doe',
73
- size: 64,
74
- },
75
- };
76
-
77
- /**
78
- * Default solid color avatar
79
- */
80
- export const SolidDefault: Story = {
81
- render: (args) => <BoringAvatarSolid {...args} />,
82
- args: {
83
- name: 'John Doe',
84
- size: 64,
85
- },
86
- };
87
-
88
- /**
89
- * Different sizes comparison
90
- */
91
- export const Sizes: Story = {
92
- render: () => (
93
- <StoryWrapper>
94
- <AvatarShowcase>
95
- <BoringAvatarMarble name="Alice" size={24} />
96
- <small>24px</small>
97
- </AvatarShowcase>
98
- <AvatarShowcase>
99
- <BoringAvatarMarble name="Alice" size={32} />
100
- <small>32px</small>
101
- </AvatarShowcase>
102
- <AvatarShowcase>
103
- <BoringAvatarMarble name="Alice" size={48} />
104
- <small>48px</small>
105
- </AvatarShowcase>
106
- <AvatarShowcase>
107
- <BoringAvatarMarble name="Alice" size={64} />
108
- <small>64px</small>
109
- </AvatarShowcase>
110
- <AvatarShowcase>
111
- <BoringAvatarMarble name="Alice" size={96} />
112
- <small>96px</small>
113
- </AvatarShowcase>
114
- <AvatarShowcase>
115
- <BoringAvatarMarble name="Alice" size={128} />
116
- <small>128px</small>
117
- </AvatarShowcase>
118
- </StoryWrapper>
119
- ),
120
- };
121
-
122
- /**
123
- * Circular vs Square shapes
124
- */
125
- export const Shapes: Story = {
126
- render: () => (
127
- <StoryWrapper>
128
- <AvatarShowcase>
129
- <BoringAvatarMarble name="Shape Test" size={80} square={false} />
130
- <small>Circular</small>
131
- </AvatarShowcase>
132
- <AvatarShowcase>
133
- <BoringAvatarMarble name="Shape Test" size={80} square />
134
- <small>Square (broken?)</small>
135
- </AvatarShowcase>
136
- <AvatarShowcase>
137
- <BoringAvatarSolid name="Shape Test" size={80} square={false} />
138
- <small>Circular (Solid)</small>
139
- </AvatarShowcase>
140
- <AvatarShowcase>
141
- <BoringAvatarSolid name="Shape Test" size={80} square />
142
- <small>Square (Solid) (broken?)</small>
143
- </AvatarShowcase>
144
- </StoryWrapper>
145
- ),
146
- };
147
-
148
- /**
149
- * Different names generate different avatars
150
- */
151
- export const DifferentNames: Story = {
152
- render: () => (
153
- <GridWrapper>
154
- <AvatarShowcase>
155
- <BoringAvatarMarble name="John Doe" size={64} />
156
- <small>John Doe</small>
157
- </AvatarShowcase>
158
- <AvatarShowcase>
159
- <BoringAvatarMarble name="Jane Smith" size={64} />
160
- <small>Jane Smith</small>
161
- </AvatarShowcase>
162
- <AvatarShowcase>
163
- <BoringAvatarMarble name="web-scraper" size={64} />
164
- <small>web-scraper</small>
165
- </AvatarShowcase>
166
- <AvatarShowcase>
167
- <BoringAvatarMarble name="my-actor" size={64} />
168
- <small>my-actor</small>
169
- </AvatarShowcase>
170
- <AvatarShowcase>
171
- <BoringAvatarMarble name="apify/store" size={64} />
172
- <small>apify/store</small>
173
- </AvatarShowcase>
174
- <AvatarShowcase>
175
- <BoringAvatarMarble name="data.processor" size={64} />
176
- <small>data.processor</small>
177
- </AvatarShowcase>
178
- <AvatarShowcase>
179
- <BoringAvatarMarble name="APIIntegration" size={64} />
180
- <small>APIIntegration</small>
181
- </AvatarShowcase>
182
- <AvatarShowcase>
183
- <BoringAvatarMarble name="test_user_123" size={64} />
184
- <small>test_user_123</small>
185
- </AvatarShowcase>
186
- </GridWrapper>
187
- ),
188
- };