@apify/ui-library 1.153.2 → 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/package.json CHANGED
@@ -1,12 +1,24 @@
1
1
  {
2
2
  "name": "@apify/ui-library",
3
- "version": "1.153.2",
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",
7
7
  "sideEffects": false,
8
8
  "main": "dist/index.js",
9
9
  "types": "dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "./test-ids": {
16
+ "types": "./dist/test_ids.d.ts",
17
+ "default": "./dist/test_ids.js"
18
+ },
19
+ "./style/*": "./style/*",
20
+ "./package.json": "./package.json"
21
+ },
10
22
  "publishConfig": {
11
23
  "registry": "https://registry.npmjs.org",
12
24
  "access": "public"
@@ -83,5 +95,5 @@
83
95
  "src",
84
96
  "style"
85
97
  ],
86
- "gitHead": "1139bba67611929694e7b130d5ff44b8f48d5746"
98
+ "gitHead": "547111a7e747a305bd93189cc038fef80cf2f56e"
87
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 key={index} size="small" variant="primary" {...action}>
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
  ))}
@@ -0,0 +1,3 @@
1
+ // `./test-ids` subpath barrel. Playwright imports test IDs from here to avoid the
2
+ // React/CSS-heavy root barrel (which breaks non-bundler loaders). Add future modules here.
3
+ export { tableTestIds } from './components/table/table.test_ids.js';