@apify/ui-library 1.168.0 → 1.168.2

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 (59) hide show
  1. package/dist/components/action_link/action_link.d.ts +2 -2
  2. package/dist/components/action_link/action_link.d.ts.map +1 -1
  3. package/dist/components/card_container/card_container.d.ts +1 -1
  4. package/dist/components/card_container/card_container.d.ts.map +1 -1
  5. package/dist/components/chip/chip.d.ts +1 -1
  6. package/dist/components/chip/chip.d.ts.map +1 -1
  7. package/dist/components/code/one_line_code/one_line_code.d.ts +2 -1
  8. package/dist/components/code/one_line_code/one_line_code.d.ts.map +1 -1
  9. package/dist/components/dropdown/dropdown.types.d.ts +2 -2
  10. package/dist/components/dropdown/dropdown.types.d.ts.map +1 -1
  11. package/dist/components/icon_button/icon_button.d.ts +1 -1
  12. package/dist/components/icon_button/icon_button.d.ts.map +1 -1
  13. package/dist/components/rating/rating.d.ts +1 -1
  14. package/dist/components/rating/rating.d.ts.map +1 -1
  15. package/dist/components/split_button/split_button.d.ts +4 -4
  16. package/dist/components/split_button/split_button.d.ts.map +1 -1
  17. package/dist/components/split_button/split_button.js +5 -4
  18. package/dist/files_hash_at_build.txt +1 -1
  19. package/dist/internal_type_utils.d.ts +2 -0
  20. package/dist/internal_type_utils.d.ts.map +1 -0
  21. package/dist/src/components/action_link/action_link.d.ts +2 -2
  22. package/dist/src/components/action_link/action_link.d.ts.map +1 -1
  23. package/dist/src/components/action_link/action_link.js.map +1 -1
  24. package/dist/src/components/card_container/card_container.d.ts +1 -1
  25. package/dist/src/components/card_container/card_container.d.ts.map +1 -1
  26. package/dist/src/components/card_container/card_container.js.map +1 -1
  27. package/dist/src/components/chip/chip.d.ts +1 -1
  28. package/dist/src/components/chip/chip.d.ts.map +1 -1
  29. package/dist/src/components/chip/chip.js.map +1 -1
  30. package/dist/src/components/code/one_line_code/one_line_code.d.ts +2 -1
  31. package/dist/src/components/code/one_line_code/one_line_code.d.ts.map +1 -1
  32. package/dist/src/components/code/one_line_code/one_line_code.js.map +1 -1
  33. package/dist/src/components/dropdown/dropdown.types.d.ts +2 -2
  34. package/dist/src/components/dropdown/dropdown.types.d.ts.map +1 -1
  35. package/dist/src/components/icon_button/icon_button.d.ts +1 -1
  36. package/dist/src/components/icon_button/icon_button.d.ts.map +1 -1
  37. package/dist/src/components/icon_button/icon_button.js.map +1 -1
  38. package/dist/src/components/rating/rating.d.ts +1 -1
  39. package/dist/src/components/rating/rating.d.ts.map +1 -1
  40. package/dist/src/components/rating/rating.js.map +1 -1
  41. package/dist/src/components/split_button/split_button.d.ts +4 -4
  42. package/dist/src/components/split_button/split_button.d.ts.map +1 -1
  43. package/dist/src/components/split_button/split_button.js +5 -5
  44. package/dist/src/components/split_button/split_button.js.map +1 -1
  45. package/dist/src/internal_type_utils.d.ts +2 -0
  46. package/dist/src/internal_type_utils.d.ts.map +1 -0
  47. package/dist/src/internal_type_utils.js +2 -0
  48. package/dist/src/internal_type_utils.js.map +1 -0
  49. package/dist/tsconfig.build.tsbuildinfo +1 -1
  50. package/package.json +2 -3
  51. package/src/components/action_link/action_link.tsx +2 -3
  52. package/src/components/card_container/card_container.tsx +1 -2
  53. package/src/components/chip/chip.tsx +1 -2
  54. package/src/components/code/one_line_code/one_line_code.tsx +2 -2
  55. package/src/components/dropdown/dropdown.types.ts +2 -2
  56. package/src/components/icon_button/icon_button.tsx +1 -2
  57. package/src/components/rating/rating.tsx +2 -2
  58. package/src/components/split_button/split_button.tsx +8 -6
  59. 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.0",
3
+ "version": "1.168.2",
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": "6a2d3eedb716e9e766ea4328f4ef3c5554fc6426"
97
+ "gitHead": "9b5709c7d03526fdda3f4ad091c5890b4e745891"
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<RequiredBy<BoxProps, 'onClick'> & { contentProps?: object }> = ({
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> = {
@@ -1,4 +1,4 @@
1
- import type { PopperContentProps } from '@radix-ui/react-popper';
1
+ import type { DropdownMenuContentProps } from '@radix-ui/react-dropdown-menu';
2
2
  import type * as React from 'react';
3
3
 
4
4
  export type BaseDropdownItemProps = {
@@ -14,5 +14,5 @@ export type BaseDropdownContentProps = {
14
14
  height?: string;
15
15
  closeOnSelect?: boolean;
16
16
  zIndex?: number;
17
- contentProps?: PopperContentProps;
17
+ contentProps?: DropdownMenuContentProps;
18
18
  };
@@ -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
  };
@@ -1,4 +1,4 @@
1
- import type { PopperContentProps } from '@radix-ui/react-popper';
1
+ import type { DropdownMenuContentProps } from '@radix-ui/react-dropdown-menu';
2
2
  import clsx from 'clsx';
3
3
  import type { ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';
4
4
  import { useRef, useState } from 'react';
@@ -32,8 +32,8 @@ export interface SplitButtonProps
32
32
  /** Must contain at least two actions - a single action should just be a regular Button. */
33
33
  actions: SplitButtonAction[];
34
34
  label?: ReactNode;
35
- side?: PopperContentProps['side'];
36
- align?: PopperContentProps['align'];
35
+ side?: DropdownMenuContentProps['side'];
36
+ align?: DropdownMenuContentProps['align'];
37
37
  width?: string;
38
38
  showMainIcon?: boolean;
39
39
  /** @deprecated Wrap `SplitButton` in `Tooltip` instead. */
@@ -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 = !actions.some(({ disabled }) => !disabled);
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];