@apify/ui-library 0.71.1 → 0.72.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.71.1",
3
+ "version": "0.72.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": "31b6f4014875de1716a17d92770ed58ac1a9da1f"
69
+ "gitHead": "f8569562bb250e8d86523ad05e5c54e662b6636b"
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' | 'text';
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 affects both border & background.
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.actionHover,
117
+ hoverColor: theme.color.danger.backgroundHover,
118
+ actionBorderColor: theme.color.danger.borderSubtle,
114
119
  activeColor: theme.color.danger.actionActive,
115
- actionTextColor: theme.color.neutral.background,
120
+ activeTextColor: theme.color.neutral.textOnPrimary,
116
121
  },
117
122
  },
118
- text: {
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: 36,
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
- actionBorderColor,
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 === 'text' ? 'transparent' : theme.color.neutral.disabled};
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);
@@ -133,7 +133,7 @@ export const Message: React.FC<MessageProps> = ({
133
133
  {onDismissClick && (
134
134
  <Button
135
135
  size='small'
136
- variant='text'
136
+ variant='tertiary'
137
137
  trackingId={dismissTrackingId}
138
138
  onClick={onDismissClick}
139
139
  className={messageClassNames.dismiss}
@@ -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: 'text' })`
14
+ const PaginationButtonBase = styled(Button).attrs({ variant: 'tertiary' })`
15
15
  padding: 0;
16
16
  height: 28px;
17
17
  min-width: 28px;