@apify/ui-library 1.110.1-chorerewritepublishworkflowo-80feae.22 → 1.111.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/dist/src/components/action_link.d.ts +7 -2
- package/dist/src/components/action_link.d.ts.map +1 -1
- package/dist/src/components/action_link.js +6 -1
- package/dist/src/components/action_link.js.map +1 -1
- package/dist/src/components/link.d.ts +1 -0
- package/dist/src/components/link.d.ts.map +1 -1
- package/dist/src/components/link.js +2 -2
- package/dist/src/components/link.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/components/action_link.tsx +25 -4
- package/src/components/link.tsx +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apify/ui-library",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.111.0",
|
|
4
4
|
"description": "React UI library used by apify.com",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"It's not nice, but helps us to get around the problem of multiple react instances."
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@apify/ui-icons": "^1.24.
|
|
29
|
+
"@apify/ui-icons": "^1.24.0",
|
|
30
30
|
"@floating-ui/react": "^0.26.2",
|
|
31
31
|
"@react-hook/resize-observer": "^2.0.2",
|
|
32
32
|
"clsx": "^2.0.0",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"src",
|
|
65
65
|
"style"
|
|
66
66
|
],
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "83de7de30cc06e9d618eea1fca3c594e9ee8d545"
|
|
68
68
|
}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import React, { type FC } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
4
|
import { ArrowLeftIcon, ArrowRightIcon } from '@apify/ui-icons';
|
|
5
5
|
|
|
6
|
+
import type { RequiredBy } from '@apify-packages/types';
|
|
7
|
+
|
|
6
8
|
import { theme } from '../design_system/theme.js';
|
|
7
|
-
import { Box } from './box.js';
|
|
8
|
-
import { Link, type LinkProps } from './link.js';
|
|
9
|
+
import { Box, type BoxProps } from './box.js';
|
|
10
|
+
import { Link, type LinkProps, StyledAsLink } from './link.js';
|
|
9
11
|
import { Heading } from './text/index.js';
|
|
10
12
|
|
|
11
13
|
const StyledGuidepost = styled(Box)<{ $isBackLink: boolean }>`
|
|
12
14
|
display: inline-flex;
|
|
13
15
|
align-items: center;
|
|
14
16
|
color: ${theme.color.neutral.text};
|
|
17
|
+
cursor: pointer;
|
|
15
18
|
|
|
16
19
|
svg {
|
|
17
20
|
transition: transform 0.2s ease-in-out;
|
|
@@ -24,7 +27,25 @@ const StyledGuidepost = styled(Box)<{ $isBackLink: boolean }>`
|
|
|
24
27
|
}
|
|
25
28
|
`;
|
|
26
29
|
|
|
27
|
-
export const
|
|
30
|
+
export const ActionBox: FC<RequiredBy<BoxProps, 'onClick'> & { contentProps?: object }> = ({
|
|
31
|
+
as = StyledAsLink,
|
|
32
|
+
contentProps,
|
|
33
|
+
children,
|
|
34
|
+
...rest
|
|
35
|
+
}) => {
|
|
36
|
+
return (
|
|
37
|
+
<StyledGuidepost
|
|
38
|
+
forwardedAs={as}
|
|
39
|
+
$isBackLink={false}
|
|
40
|
+
{...rest}
|
|
41
|
+
>
|
|
42
|
+
<Heading as='span' type='titleM' {...contentProps}>{children}</Heading>
|
|
43
|
+
<ArrowRightIcon size="16" />
|
|
44
|
+
</StyledGuidepost>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const ActionLink: FC<LinkProps & { contentProps?: object }> = ({
|
|
28
49
|
children,
|
|
29
50
|
as = Link,
|
|
30
51
|
contentProps,
|
package/src/components/link.tsx
CHANGED
|
@@ -72,7 +72,7 @@ function getHref(to: To, isExternal?: boolean): string {
|
|
|
72
72
|
return createPath(to);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
const
|
|
75
|
+
export const StyledAsLink = styled(Box)`
|
|
76
76
|
/* Basic positioning */
|
|
77
77
|
display: inline-flex;
|
|
78
78
|
align-items: center;
|
|
@@ -131,7 +131,7 @@ export const Link = forwardRef<HTMLElement, LinkProps>(({
|
|
|
131
131
|
const effectiveRel = clsx(Array.from(uniqRel));
|
|
132
132
|
|
|
133
133
|
return (
|
|
134
|
-
<
|
|
134
|
+
<StyledAsLink
|
|
135
135
|
// We use the InternalLink only for internal navigation
|
|
136
136
|
forwardedAs={(isEmail || isExternal) ? 'a' : InternalLink}
|
|
137
137
|
href={href}
|
|
@@ -143,6 +143,6 @@ export const Link = forwardRef<HTMLElement, LinkProps>(({
|
|
|
143
143
|
>
|
|
144
144
|
{children}
|
|
145
145
|
{((isExternal && !hideExternalIcon) || showExternalIcon) && <ExternalLinkIcon size="16" />}
|
|
146
|
-
</
|
|
146
|
+
</StyledAsLink>
|
|
147
147
|
);
|
|
148
148
|
});
|