@apify/ui-library 1.94.3 → 1.95.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apify/ui-library",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.95.0",
|
|
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": "
|
|
69
|
+
"gitHead": "4e6b487ae68936e626d6c4309e646823125e4ad5"
|
|
70
70
|
}
|
package/src/components/link.tsx
CHANGED
|
@@ -21,7 +21,6 @@ export interface RegularLinkProps {
|
|
|
21
21
|
trackingData?: object,
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
// TODO: This function is copied from tools.client.js. We can remove it from there once this is deployed
|
|
25
24
|
/**
|
|
26
25
|
* Checks if passed url is external
|
|
27
26
|
*/
|
|
@@ -31,7 +30,6 @@ export const isUrlExternal = (url: To, windowLocationHost: string) => {
|
|
|
31
30
|
return !!(domainMatch && domainMatch[1] !== windowLocationHost);
|
|
32
31
|
};
|
|
33
32
|
|
|
34
|
-
// TODO: This function is copied from tools.client.js. We can remove it from there once this is deployed
|
|
35
33
|
/**
|
|
36
34
|
* Checks if passed url is email
|
|
37
35
|
*/
|
|
@@ -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
|
+
};
|