@apify/ui-library 1.94.3 → 1.94.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apify/ui-library",
3
- "version": "1.94.3",
3
+ "version": "1.94.4",
4
4
  "description": "React UI library used by apify.com",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -66,5 +66,5 @@
66
66
  "src",
67
67
  "style"
68
68
  ],
69
- "gitHead": "9c9e17c7ddfe245dda9fdc38af9f5f7ee9880e8d"
69
+ "gitHead": "1d10eded2b75a1ea0799483c0f4ad7c677397134"
70
70
  }
@@ -0,0 +1,122 @@
1
+ import { Fragment } from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ import {
5
+ PeopleIcon, PlusIcon,
6
+ } from '@apify/ui-icons';
7
+
8
+ import {
9
+ Tag,
10
+ TAG_SIZES,
11
+ TAG_VARIANTS,
12
+ } from './tag.tsx';
13
+ import { SHARED_TEXT_TYPES } from './text/text_shared.tsx';
14
+
15
+ export default {
16
+ title: 'UI-Library/Tag',
17
+ component: Tag,
18
+ parameters: {
19
+ design: {
20
+ type: 'figma',
21
+ url: 'https://www.figma.com/design/duSsGnk84UMYav8mg8QNgR/Shared-library?node-id=4194-4796&t=yVoVkZOSDn1ruKAB-4',
22
+ },
23
+ },
24
+ };
25
+
26
+ const Table = styled.table`
27
+ td {
28
+ padding: 8px
29
+ }
30
+ `;
31
+
32
+ export const Default = () => {
33
+ return (
34
+ <Table>
35
+ <tbody>
36
+ {TAG_VARIANTS.map((variant) => <tr key={variant}>
37
+ {TAG_SIZES.map((size) => {
38
+ return (
39
+ <Fragment key={size}>
40
+ <td>
41
+ <Tag
42
+ size={size}
43
+ variant={variant}
44
+ LeadingIcon={PeopleIcon}
45
+ TrailingIcon={PlusIcon}
46
+ >
47
+ Tag
48
+ </Tag>
49
+ </td>
50
+ <td>
51
+ <Tag
52
+ size={size}
53
+ type="code"
54
+ variant={variant}
55
+ LeadingIcon={PeopleIcon}
56
+ TrailingIcon={PlusIcon}
57
+ >
58
+ Tag
59
+ </Tag>
60
+ </td>
61
+ <td>
62
+ <Tag
63
+ size={size}
64
+ variant={variant}
65
+ LeadingIcon={PeopleIcon}
66
+ >
67
+ </Tag>
68
+ </td>
69
+ </Fragment>
70
+ );
71
+ })}
72
+ </tr>,
73
+ )}
74
+ </tbody>
75
+ </Table>
76
+ );
77
+ };
78
+
79
+ // eslint-disable-next-line react/prop-types
80
+ export const Playground = ({ size, LeadingIcon, TrailingIcon, ...props }) => {
81
+ return (
82
+ <Tag
83
+ size={size}
84
+ LeadingIcon={LeadingIcon ? PeopleIcon : undefined}
85
+ TrailingIcon={TrailingIcon ? PlusIcon : undefined}
86
+ {...props}
87
+ />
88
+ );
89
+ };
90
+
91
+ Playground.args = {
92
+ size: 'small',
93
+ type: 'body',
94
+ variant: 'primary',
95
+ children: 'Tag',
96
+ LeadingIcon: false,
97
+ TrailingIcon: false,
98
+ };
99
+
100
+ Playground.argTypes = {
101
+ size: {
102
+ options: TAG_SIZES,
103
+ control: 'select',
104
+ },
105
+ type: {
106
+ options: SHARED_TEXT_TYPES,
107
+ control: 'select',
108
+ },
109
+ variant: {
110
+ options: TAG_VARIANTS,
111
+ control: 'select',
112
+ },
113
+ children: {
114
+ control: 'text',
115
+ },
116
+ LeadingIcon: {
117
+ control: 'boolean',
118
+ },
119
+ TrailingIcon: {
120
+ control: 'boolean',
121
+ },
122
+ };