@apify/ui-library 1.168.0 → 1.168.1
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/components/action_link/action_link.d.ts +2 -2
- package/dist/components/action_link/action_link.d.ts.map +1 -1
- package/dist/components/card_container/card_container.d.ts +1 -1
- package/dist/components/card_container/card_container.d.ts.map +1 -1
- package/dist/components/chip/chip.d.ts +1 -1
- package/dist/components/chip/chip.d.ts.map +1 -1
- package/dist/components/code/one_line_code/one_line_code.d.ts +2 -1
- package/dist/components/code/one_line_code/one_line_code.d.ts.map +1 -1
- package/dist/components/icon_button/icon_button.d.ts +1 -1
- package/dist/components/icon_button/icon_button.d.ts.map +1 -1
- package/dist/components/rating/rating.d.ts +1 -1
- package/dist/components/rating/rating.d.ts.map +1 -1
- package/dist/components/split_button/split_button.d.ts +1 -1
- package/dist/components/split_button/split_button.d.ts.map +1 -1
- package/dist/components/split_button/split_button.js +5 -4
- package/dist/files_hash_at_build.txt +1 -1
- package/dist/internal_type_utils.d.ts +2 -0
- package/dist/internal_type_utils.d.ts.map +1 -0
- package/dist/src/components/action_link/action_link.d.ts +2 -2
- package/dist/src/components/action_link/action_link.d.ts.map +1 -1
- package/dist/src/components/action_link/action_link.js.map +1 -1
- package/dist/src/components/card_container/card_container.d.ts +1 -1
- package/dist/src/components/card_container/card_container.d.ts.map +1 -1
- package/dist/src/components/card_container/card_container.js.map +1 -1
- package/dist/src/components/chip/chip.d.ts +1 -1
- package/dist/src/components/chip/chip.d.ts.map +1 -1
- package/dist/src/components/chip/chip.js.map +1 -1
- package/dist/src/components/code/one_line_code/one_line_code.d.ts +2 -1
- package/dist/src/components/code/one_line_code/one_line_code.d.ts.map +1 -1
- package/dist/src/components/code/one_line_code/one_line_code.js.map +1 -1
- package/dist/src/components/icon_button/icon_button.d.ts +1 -1
- package/dist/src/components/icon_button/icon_button.d.ts.map +1 -1
- package/dist/src/components/icon_button/icon_button.js.map +1 -1
- package/dist/src/components/rating/rating.d.ts +1 -1
- package/dist/src/components/rating/rating.d.ts.map +1 -1
- package/dist/src/components/rating/rating.js.map +1 -1
- package/dist/src/components/split_button/split_button.d.ts +1 -1
- package/dist/src/components/split_button/split_button.d.ts.map +1 -1
- package/dist/src/components/split_button/split_button.js +5 -5
- package/dist/src/components/split_button/split_button.js.map +1 -1
- package/dist/src/internal_type_utils.d.ts +2 -0
- package/dist/src/internal_type_utils.d.ts.map +1 -0
- package/dist/src/internal_type_utils.js +2 -0
- package/dist/src/internal_type_utils.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -3
- package/src/components/action_link/action_link.tsx +2 -3
- package/src/components/card_container/card_container.tsx +1 -2
- package/src/components/chip/chip.tsx +1 -2
- package/src/components/code/one_line_code/one_line_code.tsx +2 -2
- package/src/components/icon_button/icon_button.tsx +1 -2
- package/src/components/rating/rating.tsx +2 -2
- package/src/components/split_button/split_button.tsx +5 -3
- package/src/internal_type_utils.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apify/ui-library",
|
|
3
|
-
"version": "1.168.
|
|
3
|
+
"version": "1.168.1",
|
|
4
4
|
"description": "React UI library used by apify.com",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -75,7 +75,6 @@
|
|
|
75
75
|
"styled-components": "^6.1.19"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@apify-packages/types": "^3.454.0",
|
|
79
78
|
"@storybook/react-vite": "^10.3.5",
|
|
80
79
|
"@testing-library/react": "^16.3.2",
|
|
81
80
|
"@types/hast": "^3.0.4",
|
|
@@ -95,5 +94,5 @@
|
|
|
95
94
|
"src",
|
|
96
95
|
"style"
|
|
97
96
|
],
|
|
98
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "f595cd4e86d51505e5f4f6bb20fab58d386a30a7"
|
|
99
98
|
}
|
|
@@ -3,9 +3,8 @@ 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
|
-
|
|
8
6
|
import { theme } from '../../design_system/theme';
|
|
7
|
+
import type { WithRequired } from '../../type_utils';
|
|
9
8
|
import { Box, type BoxProps } from '../box';
|
|
10
9
|
import { Link, type LinkProps, StyledAsLink } from '../link';
|
|
11
10
|
import { Heading } from '../text';
|
|
@@ -27,7 +26,7 @@ const StyledGuidepost = styled(Box)<{ $isBackLink: boolean }>`
|
|
|
27
26
|
}
|
|
28
27
|
`;
|
|
29
28
|
|
|
30
|
-
export const ActionBox: FC<
|
|
29
|
+
export const ActionBox: FC<WithRequired<BoxProps, 'onClick'> & { contentProps?: object }> = ({
|
|
31
30
|
as = StyledAsLink,
|
|
32
31
|
contentProps,
|
|
33
32
|
children,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import type { ValueOf } from '@apify-packages/types';
|
|
5
|
-
|
|
6
4
|
import { theme } from '../../design_system/theme';
|
|
7
5
|
import type { Size } from '../../design_system/tokens';
|
|
6
|
+
import type { ValueOf } from '../../internal_type_utils';
|
|
8
7
|
import { Box, type BoxProps } from '../box';
|
|
9
8
|
|
|
10
9
|
export const cardContainerClassNames = {
|
|
@@ -4,9 +4,8 @@ import type React from 'react';
|
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
5
|
import styled, { css } from 'styled-components';
|
|
6
6
|
|
|
7
|
-
import type { ValueOf } from '@apify-packages/types';
|
|
8
|
-
|
|
9
7
|
import { theme } from '../../design_system/theme';
|
|
8
|
+
import type { ValueOf } from '../../internal_type_utils';
|
|
10
9
|
import type { RegularBoxProps } from '../box';
|
|
11
10
|
|
|
12
11
|
export const CHIP_SIZES = {
|
|
@@ -3,8 +3,6 @@ import styled, { css } from 'styled-components';
|
|
|
3
3
|
|
|
4
4
|
import { EyeIcon, EyeOffIcon } from '@apify/ui-icons';
|
|
5
5
|
|
|
6
|
-
import type { HttpMethod } from '@apify-packages/types';
|
|
7
|
-
|
|
8
6
|
import { theme } from '../../../design_system/theme';
|
|
9
7
|
import type { BoxProps } from '../../box';
|
|
10
8
|
import { InlineSpinner } from '../../spinner';
|
|
@@ -25,6 +23,8 @@ export const oneLineCodeClassNames = {
|
|
|
25
23
|
buttons: 'OneLineCode-Buttons',
|
|
26
24
|
};
|
|
27
25
|
|
|
26
|
+
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD' | 'PATCH' | 'OPTIONS';
|
|
27
|
+
|
|
28
28
|
type ThemeType = keyof Pick<(typeof theme)['color'], 'primary' | 'success' | 'warning' | 'danger' | 'neutral'>;
|
|
29
29
|
|
|
30
30
|
const HTML_METHOD_CHIP_STYLES: Record<HttpMethod, ThemeType> = {
|
|
@@ -3,9 +3,8 @@ import styled, { css } from 'styled-components';
|
|
|
3
3
|
|
|
4
4
|
import type { IconComponent, IconSize } from '@apify/ui-icons';
|
|
5
5
|
|
|
6
|
-
import type { ValueOf } from '@apify-packages/types';
|
|
7
|
-
|
|
8
6
|
import { theme } from '../../design_system/theme';
|
|
7
|
+
import type { ValueOf } from '../../internal_type_utils';
|
|
9
8
|
import type { RegularBoxProps } from '../box';
|
|
10
9
|
import {
|
|
11
10
|
Button,
|
|
@@ -4,13 +4,13 @@ import styled from 'styled-components';
|
|
|
4
4
|
|
|
5
5
|
import { StarEmptyIcon, StarFullIcon, StarHalfIcon } from '@apify/ui-icons';
|
|
6
6
|
|
|
7
|
-
import type { ReviewRating } from '@apify-packages/types';
|
|
8
|
-
|
|
9
7
|
import { theme } from '../../design_system/theme';
|
|
10
8
|
import type { BoxProps } from '../box';
|
|
11
9
|
import { Box } from '../box';
|
|
12
10
|
import { Text } from '../text';
|
|
13
11
|
|
|
12
|
+
type ReviewRating = 1 | 2 | 3 | 4 | 5;
|
|
13
|
+
|
|
14
14
|
type RatingStatsProps = {
|
|
15
15
|
ratingStats: Record<ReviewRating, number>;
|
|
16
16
|
};
|
|
@@ -60,6 +60,7 @@ export const SplitButton = ({
|
|
|
60
60
|
tooltipProps,
|
|
61
61
|
zIndex,
|
|
62
62
|
triggerAriaLabel = 'More actions',
|
|
63
|
+
disabled,
|
|
63
64
|
...passedProps
|
|
64
65
|
}: SplitButtonProps) => {
|
|
65
66
|
const [actionsVisible, setActionsVisible] = useState(false);
|
|
@@ -73,7 +74,7 @@ export const SplitButton = ({
|
|
|
73
74
|
|
|
74
75
|
const wrapperClassNames = clsx(splitButtonClassNames.ROOT, className);
|
|
75
76
|
const mainActionClassNames = clsx(splitButtonClassNames.MAIN_ACTION, passedProps.variant, passedProps.size);
|
|
76
|
-
const allActionsDisabled =
|
|
77
|
+
const allActionsDisabled = actions.every((action) => action.disabled);
|
|
77
78
|
// When all actions are disabled, we still want to be able to show the dropdown
|
|
78
79
|
const triggerClassNames = clsx(
|
|
79
80
|
splitButtonClassNames.TRIGGER,
|
|
@@ -89,7 +90,7 @@ export const SplitButton = ({
|
|
|
89
90
|
data-test={splitButtonMainActionTestId(mainAction.trackingId)}
|
|
90
91
|
{...passedProps}
|
|
91
92
|
className={mainActionClassNames}
|
|
92
|
-
disabled={mainAction.disabled}
|
|
93
|
+
disabled={disabled || mainAction.disabled}
|
|
93
94
|
mr="none"
|
|
94
95
|
onClick={() => {
|
|
95
96
|
mainAction.onClick();
|
|
@@ -103,6 +104,7 @@ export const SplitButton = ({
|
|
|
103
104
|
<Button
|
|
104
105
|
{...passedProps}
|
|
105
106
|
className={triggerClassNames}
|
|
107
|
+
disabled={disabled}
|
|
106
108
|
ml="none"
|
|
107
109
|
onClick={() => setActionsVisible((prevActionsVisible) => !prevActionsVisible)}
|
|
108
110
|
trackingId={mainAction.trackingId ? `${mainAction.trackingId}-OpenDropdown` : undefined}
|
|
@@ -135,7 +137,7 @@ export const SplitButton = ({
|
|
|
135
137
|
{actions.map((action, index) => (
|
|
136
138
|
<Dropdown.Item
|
|
137
139
|
key={action.trackingId ?? index}
|
|
138
|
-
disabled={action.disabled}
|
|
140
|
+
disabled={disabled || action.disabled}
|
|
139
141
|
icon={action.icon && <action.icon size="16" />}
|
|
140
142
|
description={action.description}
|
|
141
143
|
onClick={() => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ValueOf<T extends unknown[] | object> = T extends unknown[] ? T[number] : T[keyof T];
|