@apify/ui-library 1.153.2-featureexposetestids-bd5e63.21 → 1.154.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/dist/components/message/message.d.ts +1 -0
- package/dist/components/message/message.d.ts.map +1 -1
- package/dist/components/message/message.js +24 -2
- package/dist/components/select/select.d.ts +5 -0
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/select/select.js +3 -2
- package/dist/files_hash_at_build.txt +1 -1
- package/dist/src/components/message/message.d.ts +1 -0
- package/dist/src/components/message/message.d.ts.map +1 -1
- package/dist/src/components/message/message.js +22 -1
- package/dist/src/components/message/message.js.map +1 -1
- package/dist/src/components/select/select.d.ts +5 -0
- package/dist/src/components/select/select.d.ts.map +1 -1
- package/dist/src/components/select/select.js +12 -2
- package/dist/src/components/select/select.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/components/message/message.tsx +32 -3
- package/src/components/select/select.tsx +17 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apify/ui-library",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.154.0",
|
|
4
4
|
"description": "React UI library used by apify.com",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"styled-components": "^6.1.19"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@apify-packages/types": "^3.
|
|
78
|
+
"@apify-packages/types": "^3.393.0",
|
|
79
79
|
"@storybook/react-vite": "^10.3.5",
|
|
80
80
|
"@testing-library/react": "^16.3.2",
|
|
81
81
|
"@types/hast": "^3.0.4",
|
|
@@ -95,5 +95,5 @@
|
|
|
95
95
|
"src",
|
|
96
96
|
"style"
|
|
97
97
|
],
|
|
98
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "547111a7e747a305bd93189cc038fef80cf2f56e"
|
|
99
99
|
}
|
|
@@ -20,9 +20,10 @@ export const messageClassNames = {
|
|
|
20
20
|
description: 'description',
|
|
21
21
|
dismiss: 'dismiss',
|
|
22
22
|
actionsWrapper: 'actionsWrapper',
|
|
23
|
+
action: 'action',
|
|
23
24
|
};
|
|
24
25
|
|
|
25
|
-
const StyledMessage = styled(Box)<{ $boxless?: boolean; $hasCaption?: boolean }>`
|
|
26
|
+
const StyledMessage = styled(Box)<{ $boxless?: boolean; $hasCaption?: boolean; $hasActions?: boolean }>`
|
|
26
27
|
display: flex;
|
|
27
28
|
align-items: center;
|
|
28
29
|
gap: ${theme.space.space8};
|
|
@@ -87,6 +88,27 @@ const StyledMessage = styled(Box)<{ $boxless?: boolean; $hasCaption?: boolean }>
|
|
|
87
88
|
gap: ${theme.space.space8};
|
|
88
89
|
}
|
|
89
90
|
|
|
91
|
+
/* With actions on screens below desktop, stack them in a row below the content */
|
|
92
|
+
${({ $hasActions }) =>
|
|
93
|
+
$hasActions &&
|
|
94
|
+
css`
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
align-items: stretch;
|
|
97
|
+
|
|
98
|
+
.${messageClassNames.action} {
|
|
99
|
+
flex: 1;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@media ${theme.device.desktop} {
|
|
103
|
+
flex-direction: row;
|
|
104
|
+
align-items: center;
|
|
105
|
+
|
|
106
|
+
.${messageClassNames.action} {
|
|
107
|
+
flex: initial;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
`}
|
|
111
|
+
|
|
90
112
|
&.borderless {
|
|
91
113
|
border: none !important;
|
|
92
114
|
background-color: transparent !important;
|
|
@@ -184,6 +206,7 @@ export const Message: React.FC<MessageProps> = ({
|
|
|
184
206
|
forwardedAs={as}
|
|
185
207
|
$boxless={boxless}
|
|
186
208
|
$hasCaption={hasCaption}
|
|
209
|
+
$hasActions={actions.length > 0}
|
|
187
210
|
{...rest}
|
|
188
211
|
>
|
|
189
212
|
<div className={messageClassNames.content}>
|
|
@@ -199,8 +222,14 @@ export const Message: React.FC<MessageProps> = ({
|
|
|
199
222
|
<div className={messageClassNames.actionsWrapper}>
|
|
200
223
|
{actions.length > 0 && (
|
|
201
224
|
<>
|
|
202
|
-
{actions.map(({ label, ...action }, index) => (
|
|
203
|
-
<Button
|
|
225
|
+
{actions.map(({ label, className: actionClassName, ...action }, index) => (
|
|
226
|
+
<Button
|
|
227
|
+
key={index}
|
|
228
|
+
size="small"
|
|
229
|
+
variant="primary"
|
|
230
|
+
className={clsx(messageClassNames.action, actionClassName)}
|
|
231
|
+
{...action}
|
|
232
|
+
>
|
|
204
233
|
{label}
|
|
205
234
|
</Button>
|
|
206
235
|
))}
|
|
@@ -26,6 +26,11 @@ export type SelectOption = {
|
|
|
26
26
|
label: ReactNode;
|
|
27
27
|
value: SelectOptionValue;
|
|
28
28
|
description?: string;
|
|
29
|
+
/**
|
|
30
|
+
* When `true`, the option is greyed out and cannot be selected (react-select reads this natively via
|
|
31
|
+
* its default `isOptionDisabled`). Use it to keep unavailable options visible instead of hiding them.
|
|
32
|
+
*/
|
|
33
|
+
isDisabled?: boolean;
|
|
29
34
|
};
|
|
30
35
|
|
|
31
36
|
// There is a prop collision in styled-components@6 and react-select. react-select uses `theme` prop but
|
|
@@ -87,8 +92,14 @@ const selectStyles: StylesConfig<SelectOption> = {
|
|
|
87
92
|
}),
|
|
88
93
|
option: (base, state) => ({
|
|
89
94
|
...base,
|
|
90
|
-
|
|
95
|
+
// Disabled options stay visible but greyed out and non-selectable ("disable, don't hide").
|
|
96
|
+
color: state.isDisabled
|
|
97
|
+
? theme.color.neutral.textDisabled
|
|
98
|
+
: state.isSelected
|
|
99
|
+
? theme.color.neutral.textOnPrimary
|
|
100
|
+
: theme.color.neutral.text,
|
|
91
101
|
backgroundColor: state.isSelected ? theme.color.primary.action : theme.color.neutral.background,
|
|
102
|
+
cursor: state.isDisabled ? 'not-allowed' : 'default',
|
|
92
103
|
'& > p': {
|
|
93
104
|
color: state.isSelected ? theme.color.neutral.textOnPrimary : theme.color.neutral.textSubtle,
|
|
94
105
|
a: {
|
|
@@ -101,7 +112,11 @@ const selectStyles: StylesConfig<SelectOption> = {
|
|
|
101
112
|
},
|
|
102
113
|
|
|
103
114
|
'&:hover': {
|
|
104
|
-
backgroundColor: state.
|
|
115
|
+
backgroundColor: state.isDisabled
|
|
116
|
+
? theme.color.neutral.background
|
|
117
|
+
: state.isSelected
|
|
118
|
+
? undefined
|
|
119
|
+
: theme.color.neutral.hover,
|
|
105
120
|
},
|
|
106
121
|
}),
|
|
107
122
|
noOptionsMessage: (base) => ({
|