@apify/ui-library 0.73.1-fixa11yaudit-b2e9ed.39 → 0.74.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": "0.73.1-fixa11yaudit-b2e9ed.39+8c4235dce5b",
3
+ "version": "0.74.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
  "typescript": "^5.1.6",
67
67
  "typescript-eslint": "^8.24.0"
68
68
  },
69
- "gitHead": "8c4235dce5bb5c60ea2246f86b630bd0ad899167"
69
+ "gitHead": "275202abde49f18ecb5f20ffba07d52dbde6011e"
70
70
  }
@@ -1,4 +1,3 @@
1
- import type { AriaAttributes } from 'react';
2
1
  import React, { forwardRef } from 'react';
3
2
  import styled, { css } from 'styled-components';
4
3
 
@@ -28,10 +27,8 @@ export interface RegularButtonProps {
28
27
  disabled?: boolean;
29
28
  }
30
29
 
31
- type ButtonAriaProps = Pick<AriaAttributes, 'aria-label' | 'aria-labelledby'>;
32
-
33
30
  // Props shared for both types of the button
34
- export type CommonButtonProps = RegularButtonProps & ButtonAriaProps & TransientButtonProps & MarginSpacingProps;
31
+ export type CommonButtonProps = RegularButtonProps & TransientButtonProps & MarginSpacingProps;
35
32
  // Regular button must have onClick defined
36
33
  export type ButtonProps = CommonButtonProps & WithRequired<RegularBoxProps, 'onClick'>;
37
34
  // OR it can pass to to become anchor link - in that case onClick is not needed
@@ -75,21 +72,21 @@ type ButtonSizeCombinations = {
75
72
  const BUTTON_COLOR_VARIANTS_CSS: ButtonColorCombinations = {
76
73
  primary: {
77
74
  default: {
78
- textColor: theme.color.neutral.textOnPrimary,
75
+ textColor: theme.color.neutral.backgroundSubtle,
79
76
  backgroundColor: theme.color.primary.action,
80
77
  borderColor: theme.color.primary.action,
81
78
  hoverColor: theme.color.primary.actionHover,
82
79
  activeColor: theme.color.primary.actionActive,
83
80
  },
84
81
  success: {
85
- textColor: theme.color.neutral.textOnPrimary,
82
+ textColor: theme.color.neutral.backgroundSubtle,
86
83
  backgroundColor: theme.color.success.action,
87
84
  borderColor: theme.color.success.action,
88
85
  hoverColor: theme.color.success.actionHover,
89
86
  activeColor: theme.color.success.actionActive,
90
87
  },
91
88
  danger: {
92
- textColor: theme.color.neutral.textOnPrimary,
89
+ textColor: theme.color.neutral.backgroundSubtle,
93
90
  backgroundColor: theme.color.danger.action,
94
91
  borderColor: theme.color.danger.action,
95
92
  hoverColor: theme.color.danger.actionHover,
@@ -89,7 +89,7 @@ interface CopyButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>
89
89
  export const CopyButton = ({ code, ...props }: CopyButtonProps) => {
90
90
  const [isCopied, handleClick] = useCopyToClipboard({ text: code });
91
91
  return (
92
- <ActionButton onClick={handleClick} data-test='copy_to_clipboard' aria-label="Copy to clipboard" {...props}>
92
+ <ActionButton onClick={handleClick} data-test='copy_to_clipboard' {...props}>
93
93
  {isCopied ? <CheckIcon size="16" /> : <CopyIcon size="16" />}
94
94
  </ActionButton>
95
95
  );
@@ -46,12 +46,12 @@ const loadLanguages = async () => {
46
46
 
47
47
  void loadLanguages();
48
48
 
49
- type PreWrapperProps = {
49
+ type StyledPreProps = {
50
50
  $hasLinePrefixes: boolean,
51
51
  $isSingleLine: boolean
52
52
  };
53
53
 
54
- const PreWrapper = styled.pre<PreWrapperProps>`
54
+ const StyledPre = styled.pre<StyledPreProps>`
55
55
  width: 100%;
56
56
  position: relative;
57
57
  z-index: 2;
@@ -102,10 +102,10 @@ const PreWrapper = styled.pre<PreWrapperProps>`
102
102
  }
103
103
  `}
104
104
 
105
- ${({ $isSingleLine }) => ($isSingleLine ? css<PreWrapperProps>`
105
+ ${({ $isSingleLine }) => ($isSingleLine ? css<StyledPreProps>`
106
106
  white-space: nowrap;
107
107
  vertical-align: text-top;
108
- ` : css<PreWrapperProps>`
108
+ ` : css<StyledPreProps>`
109
109
  padding-left: ${({ $hasLinePrefixes }) => ($hasLinePrefixes ? theme.space.space8 : theme.space.space16)};
110
110
  padding-right: ${theme.space.space16};
111
111
 
@@ -162,8 +162,7 @@ export const PrismSyntaxHighlighter = forwardRef<HTMLPreElement, SyntaxHighlight
162
162
  {...rest}
163
163
  >
164
164
  {({ className: prismClassName, tokens, getLineProps, getTokenProps }) => (
165
- <PreWrapper
166
- tabIndex={0}
165
+ <StyledPre
167
166
  className={clsx(className, prismClassName)}
168
167
  $hasLinePrefixes={hasLinePrefixes}
169
168
  $isSingleLine={isSingleLine}
@@ -183,7 +182,7 @@ export const PrismSyntaxHighlighter = forwardRef<HTMLPreElement, SyntaxHighlight
183
182
  </div>
184
183
  ))}
185
184
  </Text>
186
- </PreWrapper>
185
+ </StyledPre>
187
186
  )}
188
187
  </Highlight>
189
188
  );
@@ -44,7 +44,6 @@ export interface MenuOption {
44
44
  }
45
45
 
46
46
  export interface MenuProps<T = MenuOption> {
47
- ariaLabel?: string,
48
47
  options: T[],
49
48
  value?: string,
50
49
  onSelect: (newValue: string, selectedBy: SelectActionType) => void,
@@ -65,7 +64,6 @@ const defaultRenderOption = ({ label }: MenuOption) => (<Text as='span'>{label}<
65
64
  * It tries to mimic API of react-select as closely as possible
66
65
  */
67
66
  export const Menu = <T extends MenuOption>({
68
- ariaLabel,
69
67
  options,
70
68
  value,
71
69
  onSelect,
@@ -131,8 +129,7 @@ export const Menu = <T extends MenuOption>({
131
129
  {...rest}
132
130
  >
133
131
  <MenuBaseComponent
134
- aria-label={ariaLabel}
135
- aria-labelledby={ariaLabel ? undefined : 'select-label'}
132
+ aria-labelledby="select-label"
136
133
  aria-autocomplete="none"
137
134
  ref={refs.setReference}
138
135
  {...getReferenceProps()}
@@ -66,7 +66,7 @@ const TabsWrapper = styled(Box)<TabsWrapperProps>`
66
66
  display: flex;
67
67
  position: relative;
68
68
 
69
- [role='tablist'] {
69
+ [role='tabpanel'] {
70
70
  min-width: 0;
71
71
  display: flex;
72
72
  flex-grow: 1;
@@ -152,9 +152,9 @@ export const Tabs = ({ variant = 'default', tabs, activeTab, onSelect, ...props
152
152
  setOveflowState(isTabsOverflowing(event.currentTarget as HTMLDivElement));
153
153
  }, []);
154
154
 
155
- return <TabsWrapper {...props} data-test="tabs-wrapper" $variant={variant}>
155
+ return <TabsWrapper {...props} role="tablist" data-test="tabs-wrapper" $variant={variant}>
156
156
  <div role="cell" aria-hidden={!overflowState?.left} />
157
- <div ref={ref} role="tablist" onScroll={scrollHandler}>
157
+ <div ref={ref} role="tabpanel" onScroll={scrollHandler}>
158
158
  {tabs.map((tab) => (
159
159
  <Tab
160
160
  {...tab}
@@ -83,7 +83,6 @@ export const PaginationButtons: FC<PaginationButtonsProps> = ({
83
83
  disabled={page <= 0}
84
84
  onClick={() => onPageChange(page - 1)}
85
85
  trackingId='PaginationPrevPage'
86
- aria-label="Previous page"
87
86
  >
88
87
  <ChevronLeftIcon size="16" />
89
88
  </PaginationButtonBase>
@@ -129,7 +128,6 @@ export const PaginationButtons: FC<PaginationButtonsProps> = ({
129
128
  disabled={page >= totalPages - 1}
130
129
  onClick={() => onPageChange(page + 1)}
131
130
  trackingId='PaginationNextPage'
132
- aria-label="Next page"
133
131
  >
134
132
  <ChevronRightIcon size="16" />
135
133
  </PaginationButtonBase>