@apify/ui-library 0.71.1 → 0.72.1-fixa11yaudit-b2e9ed.6
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/CHANGELOG.md +11 -0
- package/dist/src/components/button.d.ts +1 -1
- package/dist/src/components/button.d.ts.map +1 -1
- package/dist/src/components/button.js +9 -7
- package/dist/src/components/button.js.map +1 -1
- package/dist/src/components/code/action_button.js +1 -1
- package/dist/src/components/code/action_button.js.map +1 -1
- package/dist/src/components/code/prism_highlighter.d.ts.map +1 -1
- package/dist/src/components/code/prism_highlighter.js +2 -2
- package/dist/src/components/code/prism_highlighter.js.map +1 -1
- package/dist/src/components/message.js +1 -1
- package/dist/src/components/message.js.map +1 -1
- package/dist/src/components/tabs/tabs.js +2 -2
- package/dist/src/components/tabs/tabs.js.map +1 -1
- package/dist/src/components/to_consolidate/pagination.js +1 -1
- package/dist/src/components/to_consolidate/pagination.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/components/button.tsx +20 -13
- package/src/components/code/action_button.tsx +1 -1
- package/src/components/code/prism_highlighter.tsx +7 -6
- package/src/components/message.tsx +1 -1
- package/src/components/tabs/tabs.tsx +3 -3
- package/src/components/to_consolidate/pagination.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apify/ui-library",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.72.1-fixa11yaudit-b2e9ed.6+f7343ecc27c",
|
|
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": "
|
|
69
|
+
"gitHead": "f7343ecc27c649336f6dac03889401c64c9143bf"
|
|
70
70
|
}
|
|
@@ -11,7 +11,7 @@ import { isUrlExternal, Link, type LinkProps } from './link.js';
|
|
|
11
11
|
|
|
12
12
|
type ButtonSize = 'medium' | 'small';
|
|
13
13
|
type ButtonColor = 'default' | 'success' | 'danger';
|
|
14
|
-
type ButtonVariant = 'primary' | 'secondary' | '
|
|
14
|
+
type ButtonVariant = 'primary' | 'secondary' | 'tertiary';
|
|
15
15
|
|
|
16
16
|
export interface TransientButtonProps {
|
|
17
17
|
size?: ButtonSize;
|
|
@@ -46,13 +46,17 @@ type ButtonColorCombinations = {
|
|
|
46
46
|
borderColor: string
|
|
47
47
|
backgroundColor: string,
|
|
48
48
|
|
|
49
|
-
// hover & active state
|
|
50
|
-
hoverColor?: string,
|
|
51
|
-
activeColor?: string,
|
|
49
|
+
// hover & active state effects
|
|
52
50
|
actionTextColor?: string,
|
|
53
|
-
|
|
54
51
|
// only exception is primary outlined button
|
|
55
52
|
actionBorderColor?: string
|
|
53
|
+
|
|
54
|
+
// hover state effects override
|
|
55
|
+
hoverColor?: string,
|
|
56
|
+
|
|
57
|
+
// active state effects override
|
|
58
|
+
activeColor?: string,
|
|
59
|
+
activeTextColor?: string,
|
|
56
60
|
}
|
|
57
61
|
};
|
|
58
62
|
};
|
|
@@ -110,12 +114,13 @@ const BUTTON_COLOR_VARIANTS_CSS: ButtonColorCombinations = {
|
|
|
110
114
|
textColor: theme.color.danger.text,
|
|
111
115
|
backgroundColor: theme.color.neutral.backgroundMuted,
|
|
112
116
|
borderColor: theme.color.neutral.border,
|
|
113
|
-
hoverColor: theme.color.danger.
|
|
117
|
+
hoverColor: theme.color.danger.backgroundHover,
|
|
118
|
+
actionBorderColor: theme.color.danger.borderSubtle,
|
|
114
119
|
activeColor: theme.color.danger.actionActive,
|
|
115
|
-
|
|
120
|
+
activeTextColor: theme.color.neutral.textOnPrimary,
|
|
116
121
|
},
|
|
117
122
|
},
|
|
118
|
-
|
|
123
|
+
tertiary: {
|
|
119
124
|
default: {
|
|
120
125
|
textColor: theme.color.neutral.text,
|
|
121
126
|
backgroundColor: 'transparent',
|
|
@@ -144,7 +149,7 @@ const BUTTON_COLOR_VARIANTS_CSS: ButtonColorCombinations = {
|
|
|
144
149
|
export const BUTTON_SIZE_VARIANTS_CSS: ButtonSizeCombinations = {
|
|
145
150
|
medium: {
|
|
146
151
|
fontSize: 14,
|
|
147
|
-
height:
|
|
152
|
+
height: 32,
|
|
148
153
|
horizontalPadding: 12,
|
|
149
154
|
},
|
|
150
155
|
small: {
|
|
@@ -159,10 +164,11 @@ export const getButtonColorStyles = (variant: ButtonVariant = 'primary', color:
|
|
|
159
164
|
backgroundColor,
|
|
160
165
|
borderColor,
|
|
161
166
|
textColor,
|
|
167
|
+
actionBorderColor,
|
|
162
168
|
actionTextColor,
|
|
163
|
-
activeColor,
|
|
164
169
|
hoverColor,
|
|
165
|
-
|
|
170
|
+
activeColor,
|
|
171
|
+
activeTextColor,
|
|
166
172
|
} = BUTTON_COLOR_VARIANTS_CSS[variant][color];
|
|
167
173
|
|
|
168
174
|
return css`
|
|
@@ -177,7 +183,7 @@ export const getButtonColorStyles = (variant: ButtonVariant = 'primary', color:
|
|
|
177
183
|
}
|
|
178
184
|
|
|
179
185
|
&:active {
|
|
180
|
-
color: ${actionTextColor || textColor};
|
|
186
|
+
color: ${activeTextColor || actionTextColor || textColor};
|
|
181
187
|
background-color: ${activeColor};
|
|
182
188
|
border-color: ${actionBorderColor || activeColor};
|
|
183
189
|
}
|
|
@@ -185,7 +191,7 @@ export const getButtonColorStyles = (variant: ButtonVariant = 'primary', color:
|
|
|
185
191
|
&:disabled {
|
|
186
192
|
color: ${theme.color.neutral.textDisabled};
|
|
187
193
|
background-color: ${theme.color.neutral.disabled};
|
|
188
|
-
border-color: ${variant === '
|
|
194
|
+
border-color: ${variant === 'tertiary' ? 'transparent' : theme.color.neutral.disabled};
|
|
189
195
|
|
|
190
196
|
cursor: default;
|
|
191
197
|
}
|
|
@@ -260,6 +266,7 @@ export const Button = forwardRef<HTMLElement, ButtonProps | AnchorButtonProps>((
|
|
|
260
266
|
};
|
|
261
267
|
|
|
262
268
|
const iconSize = size === 'medium' ? '16' : '12';
|
|
269
|
+
console.log('variant', variant);
|
|
263
270
|
|
|
264
271
|
if (isAnchorButton(props)) {
|
|
265
272
|
const isExternal = isUrlExternal(props.to, windowLocationHost);
|
|
@@ -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' {...props}>
|
|
92
|
+
<ActionButton onClick={handleClick} data-test='copy_to_clipboard' aria-label="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
|
|
49
|
+
type PreWrapperProps = {
|
|
50
50
|
$hasLinePrefixes: boolean,
|
|
51
51
|
$isSingleLine: boolean
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
const
|
|
54
|
+
const PreWrapper = styled.pre<PreWrapperProps>`
|
|
55
55
|
width: 100%;
|
|
56
56
|
position: relative;
|
|
57
57
|
overflow: auto;
|
|
@@ -93,10 +93,10 @@ const StyledPre = styled.pre<StyledPreProps>`
|
|
|
93
93
|
}
|
|
94
94
|
`}
|
|
95
95
|
|
|
96
|
-
${({ $isSingleLine }) => ($isSingleLine ? css<
|
|
96
|
+
${({ $isSingleLine }) => ($isSingleLine ? css<PreWrapperProps>`
|
|
97
97
|
white-space: nowrap;
|
|
98
98
|
vertical-align: text-top;
|
|
99
|
-
` : css<
|
|
99
|
+
` : css<PreWrapperProps>`
|
|
100
100
|
padding-left: ${({ $hasLinePrefixes }) => ($hasLinePrefixes ? theme.space.space8 : theme.space.space16)};
|
|
101
101
|
padding-right: ${theme.space.space16};
|
|
102
102
|
|
|
@@ -153,7 +153,8 @@ export const PrismSyntaxHighlighter = forwardRef<HTMLPreElement, SyntaxHighlight
|
|
|
153
153
|
{...rest}
|
|
154
154
|
>
|
|
155
155
|
{({ className: prismClassName, tokens, getLineProps, getTokenProps }) => (
|
|
156
|
-
<
|
|
156
|
+
<PreWrapper
|
|
157
|
+
tabIndex={0}
|
|
157
158
|
className={clsx(className, prismClassName)}
|
|
158
159
|
$hasLinePrefixes={hasLinePrefixes}
|
|
159
160
|
$isSingleLine={isSingleLine}
|
|
@@ -173,7 +174,7 @@ export const PrismSyntaxHighlighter = forwardRef<HTMLPreElement, SyntaxHighlight
|
|
|
173
174
|
</div>
|
|
174
175
|
))}
|
|
175
176
|
</Text>
|
|
176
|
-
</
|
|
177
|
+
</PreWrapper>
|
|
177
178
|
)}
|
|
178
179
|
</Highlight>
|
|
179
180
|
);
|
|
@@ -66,7 +66,7 @@ const TabsWrapper = styled(Box)<TabsWrapperProps>`
|
|
|
66
66
|
display: flex;
|
|
67
67
|
position: relative;
|
|
68
68
|
|
|
69
|
-
[role='
|
|
69
|
+
[role='tablist'] {
|
|
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}
|
|
155
|
+
return <TabsWrapper {...props} data-test="tabs-wrapper" $variant={variant}>
|
|
156
156
|
<div role="cell" aria-hidden={!overflowState?.left} />
|
|
157
|
-
<div ref={ref} role="
|
|
157
|
+
<div ref={ref} role="tablist" onScroll={scrollHandler}>
|
|
158
158
|
{tabs.map((tab) => (
|
|
159
159
|
<Tab
|
|
160
160
|
{...tab}
|
|
@@ -11,7 +11,7 @@ import { Button } from '../button.js';
|
|
|
11
11
|
const LEADING_THREE_DOTS_PAGE_KEY = -1;
|
|
12
12
|
const TRAILING_THREE_DOTS_PAGE_KEY = -2;
|
|
13
13
|
|
|
14
|
-
const PaginationButtonBase = styled(Button).attrs({ variant: '
|
|
14
|
+
const PaginationButtonBase = styled(Button).attrs({ variant: 'tertiary' })`
|
|
15
15
|
padding: 0;
|
|
16
16
|
height: 28px;
|
|
17
17
|
min-width: 28px;
|