@apify/ui-library 1.97.2 → 1.98.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 (105) hide show
  1. package/dist/src/components/action_link.stories.d.ts +50 -0
  2. package/dist/src/components/action_link.stories.d.ts.map +1 -0
  3. package/dist/src/components/action_link.stories.js +129 -0
  4. package/dist/src/components/action_link.stories.js.map +1 -0
  5. package/dist/src/components/actor_template_card.stories.d.ts +49 -0
  6. package/dist/src/components/actor_template_card.stories.d.ts.map +1 -0
  7. package/dist/src/components/actor_template_card.stories.js +154 -0
  8. package/dist/src/components/actor_template_card.stories.js.map +1 -0
  9. package/dist/src/components/banner.stories.d.ts +53 -0
  10. package/dist/src/components/banner.stories.d.ts.map +1 -0
  11. package/dist/src/components/banner.stories.js +132 -0
  12. package/dist/src/components/banner.stories.js.map +1 -0
  13. package/dist/src/components/blog_article.stories.d.ts +33 -0
  14. package/dist/src/components/blog_article.stories.d.ts.map +1 -0
  15. package/dist/src/components/blog_article.stories.js +92 -0
  16. package/dist/src/components/blog_article.stories.js.map +1 -0
  17. package/dist/src/components/chip.stories.d.ts +98 -0
  18. package/dist/src/components/chip.stories.d.ts.map +1 -0
  19. package/dist/src/components/chip.stories.js +251 -0
  20. package/dist/src/components/chip.stories.js.map +1 -0
  21. package/dist/src/components/code/code_block/code_block_with_tabs.d.ts +1 -1
  22. package/dist/src/components/code/code_block/code_block_with_tabs.d.ts.map +1 -1
  23. package/dist/src/components/code/code_block/code_block_with_tabs.stories.d.ts +23 -0
  24. package/dist/src/components/code/code_block/code_block_with_tabs.stories.d.ts.map +1 -0
  25. package/dist/src/components/code/code_block/code_block_with_tabs.stories.js +63 -0
  26. package/dist/src/components/code/code_block/code_block_with_tabs.stories.js.map +1 -0
  27. package/dist/src/components/code/inline_code/inline_code.stories.d.ts +16 -0
  28. package/dist/src/components/code/inline_code/inline_code.stories.d.ts.map +1 -0
  29. package/dist/src/components/code/inline_code/inline_code.stories.js +47 -0
  30. package/dist/src/components/code/inline_code/inline_code.stories.js.map +1 -0
  31. package/dist/src/components/code/one_line_code/one_line_code.stories.d.ts +16 -0
  32. package/dist/src/components/code/one_line_code/one_line_code.stories.d.ts.map +1 -0
  33. package/dist/src/components/code/one_line_code/one_line_code.stories.js +81 -0
  34. package/dist/src/components/code/one_line_code/one_line_code.stories.js.map +1 -0
  35. package/dist/src/components/color_wheel_gradient.stories.d.ts +38 -0
  36. package/dist/src/components/color_wheel_gradient.stories.d.ts.map +1 -0
  37. package/dist/src/components/color_wheel_gradient.stories.js +126 -0
  38. package/dist/src/components/color_wheel_gradient.stories.js.map +1 -0
  39. package/dist/src/components/link.stories.d.ts +22 -0
  40. package/dist/src/components/link.stories.d.ts.map +1 -0
  41. package/dist/src/components/link.stories.js +112 -0
  42. package/dist/src/components/link.stories.js.map +1 -0
  43. package/dist/src/components/rating.stories.d.ts +32 -0
  44. package/dist/src/components/rating.stories.d.ts.map +1 -0
  45. package/dist/src/components/rating.stories.js +95 -0
  46. package/dist/src/components/rating.stories.js.map +1 -0
  47. package/dist/src/components/simple_markdown/simple_markdown.d.ts +2 -2
  48. package/dist/src/components/simple_markdown/simple_markdown.d.ts.map +1 -1
  49. package/dist/src/components/simple_markdown/simple_markdown.stories.d.ts +8 -0
  50. package/dist/src/components/simple_markdown/simple_markdown.stories.d.ts.map +1 -0
  51. package/dist/src/components/simple_markdown/simple_markdown.stories.js +60 -0
  52. package/dist/src/components/simple_markdown/simple_markdown.stories.js.map +1 -0
  53. package/dist/src/components/tabs/tab.stories.d.ts.map +1 -1
  54. package/dist/src/components/tabs/tab.stories.js +1 -0
  55. package/dist/src/components/tabs/tab.stories.js.map +1 -1
  56. package/dist/src/components/text/text.stories.d.ts +13 -0
  57. package/dist/src/components/text/text.stories.d.ts.map +1 -0
  58. package/dist/src/components/text/text.stories.js +14 -0
  59. package/dist/src/components/text/text.stories.js.map +1 -0
  60. package/dist/src/design_system/tokens/radiuses.d.ts +2 -0
  61. package/dist/src/design_system/tokens/radiuses.d.ts.map +1 -1
  62. package/dist/src/design_system/tokens/radiuses.js +2 -0
  63. package/dist/src/design_system/tokens/radiuses.js.map +1 -1
  64. package/dist/src/design_system/tokens/radiuses.stories.d.ts +6 -0
  65. package/dist/src/design_system/tokens/radiuses.stories.d.ts.map +1 -0
  66. package/dist/src/design_system/tokens/radiuses.stories.js +30 -0
  67. package/dist/src/design_system/tokens/radiuses.stories.js.map +1 -0
  68. package/dist/src/design_system/tokens/shadows.stories.d.ts +6 -0
  69. package/dist/src/design_system/tokens/shadows.stories.d.ts.map +1 -0
  70. package/dist/src/design_system/tokens/shadows.stories.js +37 -0
  71. package/dist/src/design_system/tokens/shadows.stories.js.map +1 -0
  72. package/dist/src/design_system/tokens/spaces.stories.d.ts +10 -0
  73. package/dist/src/design_system/tokens/spaces.stories.d.ts.map +1 -0
  74. package/dist/src/design_system/tokens/spaces.stories.js +92 -0
  75. package/dist/src/design_system/tokens/spaces.stories.js.map +1 -0
  76. package/dist/tsconfig.build.tsbuildinfo +1 -1
  77. package/package.json +2 -2
  78. package/src/components/action_link.stories.tsx +145 -0
  79. package/src/components/actor_template_card.stories.tsx +179 -0
  80. package/src/components/badge.doc.mdx +35 -0
  81. package/src/components/banner.stories.tsx +256 -0
  82. package/src/components/blog_article.stories.tsx +133 -0
  83. package/src/components/chip.stories.tsx +301 -0
  84. package/src/components/code/code_block/code_block.stories.jsx +133 -0
  85. package/src/components/code/code_block/code_block_with_tabs.stories.tsx +81 -0
  86. package/src/components/code/code_block/code_block_with_tabs.tsx +1 -1
  87. package/src/components/code/inline_code/inline_code.stories.tsx +88 -0
  88. package/src/components/code/one_line_code/one_line_code.stories.tsx +173 -0
  89. package/src/components/color_wheel_gradient.stories.tsx +157 -0
  90. package/src/components/floating/tooltip.stories.jsx +0 -1
  91. package/src/components/link.stories.tsx +127 -0
  92. package/src/components/message.stories.jsx +116 -0
  93. package/src/components/rating.stories.tsx +166 -0
  94. package/src/components/simple_markdown/simple_markdown.stories.tsx +71 -0
  95. package/src/components/simple_markdown/simple_markdown.tsx +1 -1
  96. package/src/components/tabs/tab.stories.tsx +1 -0
  97. package/src/components/tag.doc.mdx +38 -0
  98. package/src/components/text/text.stories.tsx +61 -0
  99. package/src/design_system/tokens/radiuses.doc.mdx +12 -0
  100. package/src/design_system/tokens/radiuses.stories.tsx +49 -0
  101. package/src/design_system/tokens/radiuses.ts +2 -0
  102. package/src/design_system/tokens/shadows.doc.mdx +16 -0
  103. package/src/design_system/tokens/shadows.stories.tsx +58 -0
  104. package/src/design_system/tokens/spaces.doc.mdx +18 -0
  105. package/src/design_system/tokens/spaces.stories.tsx +131 -0
@@ -0,0 +1,166 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+
3
+ import { Rating, RatingStats, SingleStarRating } from './rating.js';
4
+
5
+ interface RatingProps {
6
+ rating: number | undefined;
7
+ color?: string;
8
+ }
9
+
10
+ interface SingleStarRatingProps {
11
+ color?: string;
12
+ }
13
+
14
+ interface RatingStatsProps {
15
+ ratingStats: Record<1 | 2 | 3 | 4 | 5, number>;
16
+ }
17
+
18
+ export default {
19
+ title: 'UI-Library/Rating',
20
+ component: Rating,
21
+ argTypes: {
22
+ rating: {
23
+ control: 'number',
24
+ },
25
+ color: {
26
+ control: 'text',
27
+ },
28
+ },
29
+ parameters: {
30
+ design: {
31
+ type: 'figma',
32
+ url: 'TODO: Add Figma URL',
33
+ },
34
+ },
35
+ } as Meta<RatingProps>;
36
+
37
+ type Story = StoryObj<RatingProps>;
38
+ type SingleStarStory = StoryObj<SingleStarRatingProps>;
39
+ type RatingStatsStory = StoryObj<RatingStatsProps>;
40
+
41
+ /**
42
+ * Default rating showing 4.2 stars out of 5
43
+ */
44
+ export const Default: Story = {
45
+ args: {
46
+ rating: 4.2,
47
+ },
48
+ };
49
+
50
+ /**
51
+ * Rating with custom orange color
52
+ */
53
+ export const CustomColor: Story = {
54
+ args: {
55
+ rating: 4.2,
56
+ color: '#FF8C00',
57
+ },
58
+ };
59
+
60
+ /**
61
+ * All rating variations from 0.5 to 5 stars
62
+ */
63
+ export const AllRatings: Story = {
64
+ render: () => (
65
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>
66
+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
67
+ <span style={{ minWidth: '40px', fontSize: '14px' }}>0:</span>
68
+ <Rating rating={0} />
69
+ </div>
70
+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
71
+ <span style={{ minWidth: '40px', fontSize: '14px' }}>0.5:</span>
72
+ <Rating rating={0.5} />
73
+ </div>
74
+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
75
+ <span style={{ minWidth: '40px', fontSize: '14px' }}>1.0:</span>
76
+ <Rating rating={1} />
77
+ </div>
78
+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
79
+ <span style={{ minWidth: '40px', fontSize: '14px' }}>1.5:</span>
80
+ <Rating rating={1.5} />
81
+ </div>
82
+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
83
+ <span style={{ minWidth: '40px', fontSize: '14px' }}>2.0:</span>
84
+ <Rating rating={2} />
85
+ </div>
86
+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
87
+ <span style={{ minWidth: '40px', fontSize: '14px' }}>2.5:</span>
88
+ <Rating rating={2.5} />
89
+ </div>
90
+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
91
+ <span style={{ minWidth: '40px', fontSize: '14px' }}>3.0:</span>
92
+ <Rating rating={3} />
93
+ </div>
94
+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
95
+ <span style={{ minWidth: '40px', fontSize: '14px' }}>3.5:</span>
96
+ <Rating rating={3.5} />
97
+ </div>
98
+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
99
+ <span style={{ minWidth: '40px', fontSize: '14px' }}>4.0:</span>
100
+ <Rating rating={4} />
101
+ </div>
102
+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
103
+ <span style={{ minWidth: '40px', fontSize: '14px' }}>4.5:</span>
104
+ <Rating rating={4.5} />
105
+ </div>
106
+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
107
+ <span style={{ minWidth: '40px', fontSize: '14px' }}>5.0:</span>
108
+ <Rating rating={5} />
109
+ </div>
110
+ </div>
111
+ ),
112
+ };
113
+
114
+ // Single Star Rating Stories
115
+ export const SingleStarDefault: SingleStarStory = {
116
+ render: (args) => <SingleStarRating {...args} />,
117
+ args: {},
118
+ parameters: {
119
+ docs: {
120
+ description: {
121
+ story: 'A single star rating component for simple positive indicators.',
122
+ },
123
+ },
124
+ },
125
+ };
126
+
127
+ // Rating Stats Stories
128
+ export const RatingStatsDefault: RatingStatsStory = {
129
+ render: (args) => <RatingStats {...args} />,
130
+ args: {
131
+ ratingStats: {
132
+ 1: 5,
133
+ 2: 10,
134
+ 3: 15,
135
+ 4: 30,
136
+ 5: 40,
137
+ },
138
+ },
139
+ parameters: {
140
+ docs: {
141
+ description: {
142
+ story: 'Rating statistics showing distribution of ratings from 1 to 5 stars.',
143
+ },
144
+ },
145
+ },
146
+ };
147
+
148
+ export const RatingStatsEmpty: RatingStatsStory = {
149
+ render: (args) => <RatingStats {...args} />,
150
+ args: {
151
+ ratingStats: {
152
+ 1: 0,
153
+ 2: 0,
154
+ 3: 0,
155
+ 4: 0,
156
+ 5: 0,
157
+ },
158
+ },
159
+ parameters: {
160
+ docs: {
161
+ description: {
162
+ story: 'Rating statistics with no ratings yet.',
163
+ },
164
+ },
165
+ },
166
+ };
@@ -0,0 +1,71 @@
1
+ import {
2
+ Box,
3
+ } from '../box.js';
4
+ import {
5
+ SimpleMarkdown,
6
+ type SimpleMarkdownProps,
7
+ } from './simple_markdown.js';
8
+
9
+ const testMarkdown = `
10
+ Lorem ipsum **with bold** text and some *italic text*.
11
+
12
+ Now a paragraph with an [internal link](/admin-internal)
13
+ and with an [external link](https://www.google.com) (we hade the external icon in Markdown).
14
+
15
+ * List item
16
+ * **List item bold**
17
+ * *List item italic*
18
+
19
+ Some \`inline code\` and **\`bold inline code\`**
20
+
21
+ \`\`\`javascript
22
+ http://www.example.com/search?do[load]=1
23
+ \`\`\`
24
+
25
+ \`\`\`javascript
26
+ async function pageFunction(context) {
27
+ // jQuery is handy for finding DOM elements and extracting data from them.
28
+ // To use it, make sure to enable the "Inject jQuery" option.
29
+ const $ = context.jQuery;
30
+ const pageTitle = $('title').first().text();
31
+ }
32
+ \`\`\`
33
+
34
+ # Title 1
35
+ ## Title 2
36
+ ### Title 3
37
+ #### Title 4
38
+ ##### Title 5
39
+ ###### Title 6
40
+
41
+ ## Title [with link](/admin-internal)
42
+ ## Title \`with code\`
43
+
44
+ > Blockquote lorem ipsum **with bold** text and some *italic text*.
45
+ > Some \`inline code\` inside quote
46
+ > > And some nested quote as well
47
+
48
+ Video as link
49
+ [![Watch Web Scraper video](https://img.youtube.com/vi/K76Hib0cY0k/0.jpg)](https://youtu.be/K76Hib0cY0k)
50
+
51
+ Video as plain text
52
+ https://youtu.be/K76Hib0cY0k
53
+
54
+ `;
55
+
56
+ const Template = (props: SimpleMarkdownProps) => {
57
+ return (
58
+ <Box px='space32' py='space40' style={{ maxWidth: '850px' }}>
59
+ <SimpleMarkdown {...props} />
60
+ </Box>
61
+ );
62
+ };
63
+
64
+ export default {
65
+ title: 'UI-Library/Markdown',
66
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
67
+ component: SimpleMarkdown as any,
68
+ };
69
+
70
+ export const MarkdownRegular = () => <Template size='regular'>{testMarkdown}</Template>;
71
+ export const MarkdownSmall = () => <Template size='small'>{testMarkdown}</Template>;
@@ -177,7 +177,7 @@ const smallMarkdownSizeComponents: Components = {
177
177
 
178
178
  type MarkdownSize = 'regular' | 'small';
179
179
 
180
- interface SimpleMarkdownProps extends ReactMarkdownOptions {
180
+ export type SimpleMarkdownProps = ReactMarkdownOptions & {
181
181
  size?: MarkdownSize,
182
182
  }
183
183
 
@@ -10,6 +10,7 @@ import { Tabs as TabsComponent } from './tabs.js';
10
10
  const meta: Meta<typeof TabComponent> = {
11
11
  title: 'UI-Library/Tab',
12
12
  component: TabComponent,
13
+ tags: ['new'],
13
14
  parameters: {
14
15
  design: {
15
16
  type: 'figma',
@@ -0,0 +1,38 @@
1
+ import { Canvas, Controls, Meta } from '@storybook/addon-docs/blocks';
2
+ import { theme } from '@apify/ui-library';
3
+ import { DoDonts } from '@apify-packages/storybook-utils';
4
+
5
+ import * as TagStories from './tag.stories';
6
+
7
+ <Meta of={TagStories} />
8
+
9
+
10
+ # Tag
11
+
12
+ <br/>
13
+
14
+ ## Overview
15
+
16
+ Tags represent a set of interactive, merchant-supplied keywords that help label, organize, and categorize objects.
17
+ Tags can be added or removed from an object by merchants.
18
+
19
+ <Canvas of={TagStories.Default} />
20
+
21
+ ## Tag vs Badge
22
+
23
+ Tags can often be confused with badges. Although the two components are similar, the main difference is that tags are actionable and badges are not.
24
+
25
+ ## Inputs
26
+
27
+ The component accepts the following inputs (props):
28
+
29
+ <Controls of={TagStories.Default} />
30
+
31
+ ---
32
+
33
+ ## Usage
34
+
35
+ ➡️ To add metadata to an element such as category, attribute, or property
36
+
37
+ ➡️ To represent parameters of a filter
38
+
@@ -0,0 +1,61 @@
1
+ import {
2
+ Heading,
3
+ Text,
4
+ } from './index.js';
5
+
6
+ export default {
7
+ title: 'UI-Library/Text',
8
+ component: Text,
9
+ args: {
10
+ },
11
+ parameters: {
12
+ layout: 'centered',
13
+ },
14
+ };
15
+
16
+ export const Default = () => (<div>
17
+ <Heading type="title3xl" mb='space24'>Title 3XL</Heading>
18
+ <Heading type="title2xl">Title 2XL</Heading>
19
+ <Heading type="titleXl">Title XL</Heading>
20
+ <Heading type="titleL">Title L</Heading>
21
+ <Heading type="titleM">Title M</Heading>
22
+ <Heading type="titleS">Title S</Heading>
23
+ <Heading type="titleXs">Title XS</Heading>
24
+ <br />
25
+ <Text type="body">Body default</Text>
26
+ <Text type="body" size='small'>Body size=small</Text>
27
+ <Text type="body" size='big'>Body size=big</Text>
28
+ <br />
29
+ <Text type="code">Code default</Text>
30
+ <Text type="code" size='small'>Code size=small</Text>
31
+ <Text type="code" size='big'>Code size=big</Text>
32
+ <br />
33
+ <Text type="body" weight='bold'>Body weight=bold</Text>
34
+ <Text type="body" weight='bold' size='small'>Body size=small weight=bold</Text>
35
+ <Text type="body" weight='bold' size='big'>Body size=big weight=bold</Text>
36
+ <br />
37
+ <Text type="code" weight='bold'>Code default weight=bold</Text>
38
+ <Text type="code" weight='bold' size='small'>Code size=small weight=bold</Text>
39
+ <Text type="code" weight='bold' size='big'>Code size=big weight=bold</Text>
40
+ </div>);
41
+
42
+ export const HeadingExtras = () => (<div style={{ minWidth: '20rem' }}>
43
+ <Heading align='left'>Heading align=left</Heading>
44
+ <Heading align='center'>Heading align=center</Heading>
45
+ <Heading align='right'>Heading align=right</Heading>
46
+ <br />
47
+ <Heading color="deeppink">Heading color=deeppink</Heading>
48
+ <br />
49
+ <Heading type='titleL' as="h2">Heading type=titleL as=h2</Heading>
50
+ </div>);
51
+
52
+ export const TextExtras = () => (<div style={{ minWidth: '20rem' }}>
53
+ <Text align='left'>Text align=left</Text>
54
+ <Text align='center'>Text align=center</Text>
55
+ <Text align='right'>Text align=right</Text>
56
+ <br />
57
+ <Text color='deeppink'>Text color=deeppink</Text>
58
+ <br />
59
+ <Text italic>Text italic=true</Text>
60
+ <Text uppercase={true}>Text uppercase=true</Text>
61
+ </div>);
@@ -0,0 +1,12 @@
1
+ import { Canvas, Meta } from '@storybook/addon-docs/blocks';
2
+ import { theme } from '@apify/ui-library';
3
+
4
+ import * as RadiusesStories from './radiuses.stories';
5
+
6
+ <Meta of={RadiusesStories} />
7
+
8
+ # Radiuses
9
+
10
+ Border radius tokens define consistent corner rounding values used throughout the design system. These tokens ensure visual harmony by providing standardized border radius options from subtle (4px) to fully rounded (100px) for various UI elements like buttons, cards, inputs, and containers.
11
+
12
+ <Canvas of={RadiusesStories.Default} />
@@ -0,0 +1,49 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+
3
+ import { theme } from '../theme.js';
4
+ import { radiuses } from './radiuses.js';
5
+
6
+ const RadiusesShowcase = () => (
7
+ <div style={{ display: 'grid', gridTemplateColumns: 'repeat(7, 1fr)', gap: '16px', padding: '20px', backgroundColor: theme.color.neutral.background }}>
8
+ {Object.entries(radiuses).map(([key, value]) => (
9
+ <div key={key} style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '6px' }}>
10
+ <div
11
+ style={{
12
+ width: '60px',
13
+ height: '60px',
14
+ backgroundColor: theme.color.neutral.cardBackground,
15
+ border: `1px solid ${theme.color.neutral.border}`,
16
+ borderRadius: value,
17
+ display: 'flex',
18
+ alignItems: 'center',
19
+ justifyContent: 'center',
20
+ color: theme.color.neutral.text,
21
+ fontSize: '11px',
22
+ fontWeight: 'bold',
23
+ }}
24
+ >
25
+ {key.replace('radius', '')}
26
+ </div>
27
+ <span style={{ fontSize: '12px', color: theme.color.neutral.text, fontWeight: '500' }}>{value}</span>
28
+ <span style={{ fontSize: '11px', color: theme.color.neutral.textMuted }}>{key}</span>
29
+ </div>
30
+ ))}
31
+ </div>
32
+ );
33
+
34
+ export default {
35
+ title: 'Design Tokens/Radiuses',
36
+ component: RadiusesShowcase,
37
+ parameters: {
38
+ design: {
39
+ type: 'figma',
40
+ url: 'https://www.figma.com/design/duSsGnk84UMYav8mg8QNgR/%F0%9F%93%96-Shared-library?node-id=1425-8220&t=qBdt7hpVWImfc9T3-1',
41
+ },
42
+ },
43
+ } as Meta;
44
+
45
+ type Story = StoryObj;
46
+
47
+ export const Default: Story = {
48
+ render: () => <RadiusesShowcase />,
49
+ };
@@ -7,6 +7,8 @@
7
7
  * @property {'8px'} radius8
8
8
  * @property {'12px'} radius12
9
9
  * @property {'16px'} radius16
10
+ * @property {'20px'} radius20
11
+ * @property {'100px'} radiusFull
10
12
  */
11
13
  /**
12
14
  * @type {Radius}
@@ -0,0 +1,16 @@
1
+ import { Canvas, Meta } from '@storybook/addon-docs/blocks';
2
+ import { theme } from '@apify/ui-library';
3
+
4
+ import * as ShadowsStories from './shadows.stories';
5
+
6
+ <Meta of={ShadowsStories} />
7
+
8
+ # Shadows
9
+
10
+ Shadow tokens define consistent drop shadow effects used throughout the design system. These tokens provide standardized shadow depths from subtle (shadow1) to prominent (shadow5) for creating visual hierarchy and depth in UI elements like cards, buttons, modals, and tooltips.
11
+
12
+ <Canvas of={ShadowsStories.Default} />
13
+
14
+ ## Do's and Don'ts
15
+
16
+ Use shadow tokens progressively to create clear visual hierarchy. Elements with higher importance should have deeper shadows, while subtle elements should use lighter shadows or none at all.
@@ -0,0 +1,58 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+
3
+ import { theme } from '../theme.js';
4
+ import { shadows } from './shadows.js';
5
+
6
+ const ShadowsShowcase = () => (
7
+ <div
8
+ style={{
9
+ display: 'grid',
10
+ gridTemplateColumns: 'repeat(6, 1fr)',
11
+ gap: '16px',
12
+ padding: '20px',
13
+ backgroundColor: theme.color.neutral.background,
14
+ }}
15
+ >
16
+ {Object.entries(shadows).map(([key, value]) => (
17
+ <div key={key} style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '6px' }}>
18
+ <div
19
+ style={{
20
+ width: '60px',
21
+ height: '60px',
22
+ backgroundColor: theme.color.neutral.cardBackground,
23
+ border: `1px solid ${theme.color.neutral.border}`,
24
+ borderRadius: theme.radius.radius8,
25
+ boxShadow: value,
26
+ display: 'flex',
27
+ alignItems: 'center',
28
+ justifyContent: 'center',
29
+ color: theme.color.neutral.text,
30
+ fontSize: '11px',
31
+ fontWeight: 'bold',
32
+ }}
33
+ />
34
+ <div style={{ textAlign: 'center' }}>
35
+ <div style={{ fontSize: '12px', color: theme.color.neutral.text, fontWeight: '500' }}>{key}</div>
36
+ <div style={{ fontSize: '10px', color: theme.color.neutral.textMuted, fontFamily: 'monospace' }}>{value}</div>
37
+ </div>
38
+ </div>
39
+ ))}
40
+ </div>
41
+ );
42
+
43
+ export default {
44
+ title: 'Design Tokens/Shadows',
45
+ component: ShadowsShowcase,
46
+ parameters: {
47
+ design: {
48
+ type: 'figma',
49
+ url: 'https://www.figma.com/design/duSsGnk84UMYav8mg8QNgR/%F0%9F%93%96-Shared-library?node-id=3295-4467&t=qBdt7hpVWImfc9T3-1',
50
+ },
51
+ },
52
+ } as Meta;
53
+
54
+ type Story = StoryObj;
55
+
56
+ export const Default: Story = {
57
+ render: () => <ShadowsShowcase />,
58
+ };
@@ -0,0 +1,18 @@
1
+ import { Canvas, Meta } from '@storybook/addon-docs/blocks';
2
+ import { theme } from '@apify/ui-library';
3
+
4
+ import * as SpacesStories from './spaces.stories';
5
+
6
+ <Meta of={SpacesStories} />
7
+
8
+ # Spaces
9
+
10
+ Spacing tokens define consistent spacing values used throughout the design system. These tokens provide standardized spacing options from tight (0.2rem) to generous (8rem) for margins, padding, and gaps between UI elements.
11
+
12
+ Use the controls below to explore different spacing values and see how they affect the visual separation between elements.
13
+
14
+ <Canvas of={SpacesStories.Default} style={{ height: '300px' }} />
15
+
16
+ ## Do's and Don'ts
17
+
18
+ Use spacing tokens progressively to create clear visual rhythm. Smaller spaces should be used for related elements, while larger spaces separate distinct sections and create breathing room.
@@ -0,0 +1,131 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+
3
+ import { theme } from '../theme.js';
4
+ import { spaces } from './spaces.js';
5
+
6
+ const SpacesShowcase = ({ space }: { space: keyof typeof spaces }) => {
7
+ const value = spaces[space];
8
+
9
+ return (
10
+ <div
11
+ style={{
12
+ display: 'flex',
13
+ flexDirection: 'column',
14
+ gap: '16px',
15
+ padding: '20px',
16
+ backgroundColor: theme.color.neutral.background,
17
+ minHeight: '80vh',
18
+ justifyContent: 'center',
19
+ alignItems: 'center',
20
+ }}
21
+ >
22
+ <div style={{ fontSize: '18px', color: theme.color.neutral.text, fontWeight: '600' }}>
23
+ {space}: {value}
24
+ </div>
25
+ <div
26
+ style={{
27
+ display: 'flex',
28
+ alignItems: 'center',
29
+ padding: '12px',
30
+ backgroundColor: theme.color.neutral.cardBackground,
31
+ border: `1px solid ${theme.color.neutral.border}`,
32
+ borderRadius: theme.radius.radius8,
33
+ }}
34
+ >
35
+ <div
36
+ style={{
37
+ width: '50px',
38
+ height: '50px',
39
+ backgroundColor: theme.color.neutral.background,
40
+ border: `1px solid ${theme.color.neutral.border}`,
41
+ borderRadius: theme.radius.radius4,
42
+ display: 'flex',
43
+ alignItems: 'center',
44
+ justifyContent: 'center',
45
+ fontSize: '12px',
46
+ fontWeight: '500',
47
+ color: theme.color.neutral.text,
48
+ }}
49
+ >
50
+ Card 1
51
+ </div>
52
+ <div
53
+ style={{
54
+ width: value,
55
+ height: '50px',
56
+ backgroundColor: 'rgba(239, 68, 68, 0.1)',
57
+ borderRadius: '0',
58
+ }}
59
+ />
60
+ <div
61
+ style={{
62
+ width: '50px',
63
+ height: '50px',
64
+ backgroundColor: theme.color.neutral.background,
65
+ border: `1px solid ${theme.color.neutral.border}`,
66
+ borderRadius: theme.radius.radius4,
67
+ display: 'flex',
68
+ alignItems: 'center',
69
+ justifyContent: 'center',
70
+ fontSize: '12px',
71
+ fontWeight: '500',
72
+ color: theme.color.neutral.text,
73
+ }}
74
+ >
75
+ Card 2
76
+ </div>
77
+ <div
78
+ style={{
79
+ width: value,
80
+ height: '50px',
81
+ backgroundColor: 'rgba(239, 68, 68, 0.1)',
82
+ borderRadius: '0',
83
+ }}
84
+ />
85
+ <div
86
+ style={{
87
+ width: '50px',
88
+ height: '50px',
89
+ backgroundColor: theme.color.neutral.background,
90
+ border: `1px solid ${theme.color.neutral.border}`,
91
+ borderRadius: theme.radius.radius4,
92
+ display: 'flex',
93
+ alignItems: 'center',
94
+ justifyContent: 'center',
95
+ fontSize: '12px',
96
+ fontWeight: '500',
97
+ color: theme.color.neutral.text,
98
+ }}
99
+ >
100
+ Card 3
101
+ </div>
102
+ </div>
103
+ </div>
104
+ );
105
+ };
106
+
107
+ export default {
108
+ title: 'Design Tokens/Spaces',
109
+ component: SpacesShowcase,
110
+ argTypes: {
111
+ space: {
112
+ control: 'select',
113
+ options: Object.keys(spaces),
114
+ defaultValue: 'space8',
115
+ },
116
+ },
117
+ parameters: {
118
+ design: {
119
+ type: 'figma',
120
+ url: 'https://www.figma.com/design/duSsGnk84UMYav8mg8QNgR/%F0%9F%93%96-Shared-library?node-id=1425-7789&t=qBdt7hpVWImfc9T3-1',
121
+ },
122
+ },
123
+ } as Meta<typeof SpacesShowcase>;
124
+
125
+ type Story = StoryObj<typeof SpacesShowcase>;
126
+
127
+ export const Default: Story = {
128
+ args: {
129
+ space: 'space32',
130
+ },
131
+ };