@apify/ui-library 1.154.5 → 1.154.7

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.
Files changed (205) hide show
  1. package/dist/components/actor_template_card/actor_template_card.d.ts.map +1 -1
  2. package/dist/components/actor_template_card/actor_template_card.js +2 -1
  3. package/dist/components/actor_template_card/actor_template_card.test_ids.d.ts +2 -0
  4. package/dist/components/actor_template_card/actor_template_card.test_ids.d.ts.map +1 -0
  5. package/dist/components/actor_template_card/actor_template_card.test_ids.js +4 -0
  6. package/dist/components/card/card.d.ts.map +1 -1
  7. package/dist/components/card/card.js +7 -6
  8. package/dist/components/card/card.test_ids.d.ts +9 -0
  9. package/dist/components/card/card.test_ids.d.ts.map +1 -0
  10. package/dist/components/card/card.test_ids.js +11 -0
  11. package/dist/components/code/action_button.d.ts.map +1 -1
  12. package/dist/components/code/action_button.js +2 -1
  13. package/dist/components/code/action_button.test_ids.d.ts +4 -0
  14. package/dist/components/code/action_button.test_ids.d.ts.map +1 -0
  15. package/dist/components/code/action_button.test_ids.js +4 -0
  16. package/dist/components/code/code_block/code_block.d.ts.map +1 -1
  17. package/dist/components/code/code_block/code_block.js +3 -2
  18. package/dist/components/code/code_block/code_block.test_ids.d.ts +5 -0
  19. package/dist/components/code/code_block/code_block.test_ids.d.ts.map +1 -0
  20. package/dist/components/code/code_block/code_block.test_ids.js +5 -0
  21. package/dist/components/code/code_block/code_block_with_tabs.d.ts.map +1 -1
  22. package/dist/components/code/code_block/code_block_with_tabs.js +2 -1
  23. package/dist/components/code/one_line_code/one_line_code.d.ts.map +1 -1
  24. package/dist/components/code/one_line_code/one_line_code.js +2 -1
  25. package/dist/components/code/one_line_code/one_line_code.test_ids.d.ts +4 -0
  26. package/dist/components/code/one_line_code/one_line_code.test_ids.d.ts.map +1 -0
  27. package/dist/components/code/one_line_code/one_line_code.test_ids.js +4 -0
  28. package/dist/components/code/prism_highlighter.d.ts.map +1 -1
  29. package/dist/components/code/prism_highlighter.js +2 -1
  30. package/dist/components/code/prism_highlighter.test_ids.d.ts +4 -0
  31. package/dist/components/code/prism_highlighter.test_ids.d.ts.map +1 -0
  32. package/dist/components/code/prism_highlighter.test_ids.js +4 -0
  33. package/dist/components/collapsible_card/collapsible_card.d.ts.map +1 -1
  34. package/dist/components/collapsible_card/collapsible_card.js +4 -2
  35. package/dist/components/collapsible_card/collapsible_card.test_ids.d.ts +4 -0
  36. package/dist/components/collapsible_card/collapsible_card.test_ids.d.ts.map +1 -0
  37. package/dist/components/collapsible_card/collapsible_card.test_ids.js +4 -0
  38. package/dist/components/dropdown/dropdown.d.ts.map +1 -1
  39. package/dist/components/dropdown/dropdown.js +3 -2
  40. package/dist/components/dropdown/dropdown.styled.d.ts.map +1 -1
  41. package/dist/components/dropdown/dropdown.styled.js +2 -1
  42. package/dist/components/dropdown/dropdown.test_ids.d.ts +6 -0
  43. package/dist/components/dropdown/dropdown.test_ids.d.ts.map +1 -0
  44. package/dist/components/dropdown/dropdown.test_ids.js +8 -0
  45. package/dist/components/pagination/pagination.d.ts.map +1 -1
  46. package/dist/components/pagination/pagination.js +5 -4
  47. package/dist/components/pagination/pagination.test_ids.d.ts +7 -0
  48. package/dist/components/pagination/pagination.test_ids.d.ts.map +1 -0
  49. package/dist/components/pagination/pagination.test_ids.js +9 -0
  50. package/dist/components/select/select.d.ts.map +1 -1
  51. package/dist/components/select/select.js +10 -1
  52. package/dist/components/select/select.test_ids.d.ts +2 -0
  53. package/dist/components/select/select.test_ids.d.ts.map +1 -0
  54. package/dist/components/select/select.test_ids.js +4 -0
  55. package/dist/components/store/store_actor_header.d.ts.map +1 -1
  56. package/dist/components/store/store_actor_header.js +2 -1
  57. package/dist/components/store/store_actor_header.test_ids.d.ts +4 -0
  58. package/dist/components/store/store_actor_header.test_ids.d.ts.map +1 -0
  59. package/dist/components/store/store_actor_header.test_ids.js +4 -0
  60. package/dist/components/tabs/tab.d.ts.map +1 -1
  61. package/dist/components/tabs/tab.js +2 -1
  62. package/dist/components/tabs/tab.test_ids.d.ts +4 -0
  63. package/dist/components/tabs/tab.test_ids.d.ts.map +1 -0
  64. package/dist/components/tabs/tab.test_ids.js +4 -0
  65. package/dist/components/tabs/tabs.d.ts.map +1 -1
  66. package/dist/components/tabs/tabs.js +2 -1
  67. package/dist/components/tabs/tabs.test_ids.d.ts +4 -0
  68. package/dist/components/tabs/tabs.test_ids.d.ts.map +1 -0
  69. package/dist/components/tabs/tabs.test_ids.js +4 -0
  70. package/dist/files_hash_at_build.txt +1 -1
  71. package/dist/src/components/actor_template_card/actor_template_card.d.ts.map +1 -1
  72. package/dist/src/components/actor_template_card/actor_template_card.js +2 -1
  73. package/dist/src/components/actor_template_card/actor_template_card.js.map +1 -1
  74. package/dist/src/components/actor_template_card/actor_template_card.test_ids.d.ts +2 -0
  75. package/dist/src/components/actor_template_card/actor_template_card.test_ids.d.ts.map +1 -0
  76. package/dist/src/components/actor_template_card/actor_template_card.test_ids.js +2 -0
  77. package/dist/src/components/actor_template_card/actor_template_card.test_ids.js.map +1 -0
  78. package/dist/src/components/card/card.d.ts.map +1 -1
  79. package/dist/src/components/card/card.js +2 -1
  80. package/dist/src/components/card/card.js.map +1 -1
  81. package/dist/src/components/card/card.test_ids.d.ts +9 -0
  82. package/dist/src/components/card/card.test_ids.d.ts.map +1 -0
  83. package/dist/src/components/card/card.test_ids.js +9 -0
  84. package/dist/src/components/card/card.test_ids.js.map +1 -0
  85. package/dist/src/components/code/action_button.d.ts.map +1 -1
  86. package/dist/src/components/code/action_button.js +2 -1
  87. package/dist/src/components/code/action_button.js.map +1 -1
  88. package/dist/src/components/code/action_button.test_ids.d.ts +4 -0
  89. package/dist/src/components/code/action_button.test_ids.d.ts.map +1 -0
  90. package/dist/src/components/code/action_button.test_ids.js +4 -0
  91. package/dist/src/components/code/action_button.test_ids.js.map +1 -0
  92. package/dist/src/components/code/code_block/code_block.d.ts.map +1 -1
  93. package/dist/src/components/code/code_block/code_block.js +3 -2
  94. package/dist/src/components/code/code_block/code_block.js.map +1 -1
  95. package/dist/src/components/code/code_block/code_block.test_ids.d.ts +5 -0
  96. package/dist/src/components/code/code_block/code_block.test_ids.d.ts.map +1 -0
  97. package/dist/src/components/code/code_block/code_block.test_ids.js +5 -0
  98. package/dist/src/components/code/code_block/code_block.test_ids.js.map +1 -0
  99. package/dist/src/components/code/code_block/code_block_with_tabs.d.ts.map +1 -1
  100. package/dist/src/components/code/code_block/code_block_with_tabs.js +2 -1
  101. package/dist/src/components/code/code_block/code_block_with_tabs.js.map +1 -1
  102. package/dist/src/components/code/one_line_code/one_line_code.d.ts.map +1 -1
  103. package/dist/src/components/code/one_line_code/one_line_code.js +2 -1
  104. package/dist/src/components/code/one_line_code/one_line_code.js.map +1 -1
  105. package/dist/src/components/code/one_line_code/one_line_code.test_ids.d.ts +4 -0
  106. package/dist/src/components/code/one_line_code/one_line_code.test_ids.d.ts.map +1 -0
  107. package/dist/src/components/code/one_line_code/one_line_code.test_ids.js +4 -0
  108. package/dist/src/components/code/one_line_code/one_line_code.test_ids.js.map +1 -0
  109. package/dist/src/components/code/prism_highlighter.d.ts.map +1 -1
  110. package/dist/src/components/code/prism_highlighter.js +2 -1
  111. package/dist/src/components/code/prism_highlighter.js.map +1 -1
  112. package/dist/src/components/code/prism_highlighter.test_ids.d.ts +4 -0
  113. package/dist/src/components/code/prism_highlighter.test_ids.d.ts.map +1 -0
  114. package/dist/src/components/code/prism_highlighter.test_ids.js +4 -0
  115. package/dist/src/components/code/prism_highlighter.test_ids.js.map +1 -0
  116. package/dist/src/components/collapsible_card/collapsible_card.d.ts.map +1 -1
  117. package/dist/src/components/collapsible_card/collapsible_card.js +3 -1
  118. package/dist/src/components/collapsible_card/collapsible_card.js.map +1 -1
  119. package/dist/src/components/collapsible_card/collapsible_card.test_ids.d.ts +4 -0
  120. package/dist/src/components/collapsible_card/collapsible_card.test_ids.d.ts.map +1 -0
  121. package/dist/src/components/collapsible_card/collapsible_card.test_ids.js +4 -0
  122. package/dist/src/components/collapsible_card/collapsible_card.test_ids.js.map +1 -0
  123. package/dist/src/components/dropdown/dropdown.d.ts.map +1 -1
  124. package/dist/src/components/dropdown/dropdown.js +3 -2
  125. package/dist/src/components/dropdown/dropdown.js.map +1 -1
  126. package/dist/src/components/dropdown/dropdown.styled.d.ts.map +1 -1
  127. package/dist/src/components/dropdown/dropdown.styled.js +2 -1
  128. package/dist/src/components/dropdown/dropdown.styled.js.map +1 -1
  129. package/dist/src/components/dropdown/dropdown.test_ids.d.ts +6 -0
  130. package/dist/src/components/dropdown/dropdown.test_ids.d.ts.map +1 -0
  131. package/dist/src/components/dropdown/dropdown.test_ids.js +6 -0
  132. package/dist/src/components/dropdown/dropdown.test_ids.js.map +1 -0
  133. package/dist/src/components/pagination/pagination.d.ts.map +1 -1
  134. package/dist/src/components/pagination/pagination.js +5 -4
  135. package/dist/src/components/pagination/pagination.js.map +1 -1
  136. package/dist/src/components/pagination/pagination.test_ids.d.ts +7 -0
  137. package/dist/src/components/pagination/pagination.test_ids.d.ts.map +1 -0
  138. package/dist/src/components/pagination/pagination.test_ids.js +7 -0
  139. package/dist/src/components/pagination/pagination.test_ids.js.map +1 -0
  140. package/dist/src/components/select/select.d.ts.map +1 -1
  141. package/dist/src/components/select/select.js +7 -1
  142. package/dist/src/components/select/select.js.map +1 -1
  143. package/dist/src/components/select/select.test_ids.d.ts +2 -0
  144. package/dist/src/components/select/select.test_ids.d.ts.map +1 -0
  145. package/dist/src/components/select/select.test_ids.js +3 -0
  146. package/dist/src/components/select/select.test_ids.js.map +1 -0
  147. package/dist/src/components/store/store_actor_header.d.ts.map +1 -1
  148. package/dist/src/components/store/store_actor_header.js +2 -1
  149. package/dist/src/components/store/store_actor_header.js.map +1 -1
  150. package/dist/src/components/store/store_actor_header.test_ids.d.ts +4 -0
  151. package/dist/src/components/store/store_actor_header.test_ids.d.ts.map +1 -0
  152. package/dist/src/components/store/store_actor_header.test_ids.js +4 -0
  153. package/dist/src/components/store/store_actor_header.test_ids.js.map +1 -0
  154. package/dist/src/components/tabs/tab.d.ts.map +1 -1
  155. package/dist/src/components/tabs/tab.js +2 -1
  156. package/dist/src/components/tabs/tab.js.map +1 -1
  157. package/dist/src/components/tabs/tab.test_ids.d.ts +4 -0
  158. package/dist/src/components/tabs/tab.test_ids.d.ts.map +1 -0
  159. package/dist/src/components/tabs/tab.test_ids.js +4 -0
  160. package/dist/src/components/tabs/tab.test_ids.js.map +1 -0
  161. package/dist/src/components/tabs/tabs.d.ts.map +1 -1
  162. package/dist/src/components/tabs/tabs.js +2 -1
  163. package/dist/src/components/tabs/tabs.js.map +1 -1
  164. package/dist/src/components/tabs/tabs.test_ids.d.ts +4 -0
  165. package/dist/src/components/tabs/tabs.test_ids.d.ts.map +1 -0
  166. package/dist/src/components/tabs/tabs.test_ids.js +4 -0
  167. package/dist/src/components/tabs/tabs.test_ids.js.map +1 -0
  168. package/dist/src/test_ids.d.ts +13 -0
  169. package/dist/src/test_ids.d.ts.map +1 -1
  170. package/dist/src/test_ids.js +15 -1
  171. package/dist/src/test_ids.js.map +1 -1
  172. package/dist/test_ids.d.ts +13 -0
  173. package/dist/test_ids.d.ts.map +1 -1
  174. package/dist/test_ids.js +14 -1
  175. package/dist/tsconfig.build.tsbuildinfo +1 -1
  176. package/package.json +2 -2
  177. package/src/components/actor_template_card/actor_template_card.test_ids.ts +1 -0
  178. package/src/components/actor_template_card/actor_template_card.tsx +2 -1
  179. package/src/components/card/card.test_ids.ts +8 -0
  180. package/src/components/card/card.tsx +7 -6
  181. package/src/components/code/action_button.test_ids.ts +3 -0
  182. package/src/components/code/action_button.tsx +2 -1
  183. package/src/components/code/code_block/code_block.test_ids.ts +5 -0
  184. package/src/components/code/code_block/code_block.tsx +3 -2
  185. package/src/components/code/code_block/code_block_with_tabs.tsx +2 -1
  186. package/src/components/code/one_line_code/one_line_code.test_ids.ts +3 -0
  187. package/src/components/code/one_line_code/one_line_code.tsx +2 -1
  188. package/src/components/code/prism_highlighter.test_ids.ts +3 -0
  189. package/src/components/code/prism_highlighter.tsx +2 -1
  190. package/src/components/collapsible_card/collapsible_card.test_ids.ts +3 -0
  191. package/src/components/collapsible_card/collapsible_card.tsx +4 -2
  192. package/src/components/dropdown/dropdown.styled.ts +2 -1
  193. package/src/components/dropdown/dropdown.test_ids.ts +5 -0
  194. package/src/components/dropdown/dropdown.tsx +3 -2
  195. package/src/components/pagination/pagination.test_ids.ts +6 -0
  196. package/src/components/pagination/pagination.tsx +5 -4
  197. package/src/components/select/select.test_ids.ts +2 -0
  198. package/src/components/select/select.tsx +16 -1
  199. package/src/components/store/store_actor_header.test_ids.ts +3 -0
  200. package/src/components/store/store_actor_header.tsx +2 -1
  201. package/src/components/tabs/tab.test_ids.ts +3 -0
  202. package/src/components/tabs/tab.tsx +2 -1
  203. package/src/components/tabs/tabs.test_ids.ts +3 -0
  204. package/src/components/tabs/tabs.tsx +2 -1
  205. package/src/test_ids.ts +15 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apify/ui-library",
3
- "version": "1.154.5",
3
+ "version": "1.154.7",
4
4
  "description": "React UI library used by apify.com",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -95,5 +95,5 @@
95
95
  "src",
96
96
  "style"
97
97
  ],
98
- "gitHead": "066f7bd37a2bd518e2455a2c312fd0253a9c6348"
98
+ "gitHead": "6d467ed9ed1c4ec3ff91449e9000a9da1d8a5999"
99
99
  }
@@ -0,0 +1 @@
1
+ export const actorTemplateCardTestId = (id: string): string => `actor-template-card-${id}`;
@@ -5,6 +5,7 @@ import { theme } from '../../design_system/theme';
5
5
  import { Badge } from '../badge';
6
6
  import { TextMarketing } from '../text';
7
7
  import { VerticalTile } from '../tile';
8
+ import { actorTemplateCardTestId } from './actor_template_card.test_ids';
8
9
 
9
10
  interface ActorTemplateCardProps {
10
11
  id: string;
@@ -67,7 +68,7 @@ const TemplateCardContentWrapper = styled.div`
67
68
 
68
69
  export const ActorTemplateCard: React.FC<ActorTemplateCardProps> = ({ id, label, description, icons, useCases }) => {
69
70
  const templateCardContent = (
70
- <TemplateCardContentWrapper data-test={`actor-template-card-${id}`}>
71
+ <TemplateCardContentWrapper data-test={actorTemplateCardTestId(id)}>
71
72
  <div className={WrapperClasses.TEMPLATE_CARD_IMAGES}>{icons}</div>
72
73
  <div className={WrapperClasses.TEMPLATE_CARD_TEXT}>
73
74
  <TextMarketing size="regular" weight="bold">
@@ -0,0 +1,8 @@
1
+ export const cardTestIds = {
2
+ CARD: 'card',
3
+ CONTENT: 'card-content',
4
+ HEADER: 'card-header',
5
+ CAPTION: 'card-caption',
6
+ ACTIONS: 'card-actions',
7
+ DESCRIPTION: 'card-description',
8
+ };
@@ -8,6 +8,7 @@ import type { WithTransientProps } from '../../type_utils';
8
8
  import type { BoxProps } from '../box';
9
9
  import { Box } from '../box';
10
10
  import { Text } from '../text';
11
+ import { cardTestIds } from './card.test_ids';
11
12
 
12
13
  export const cardClassNames = {
13
14
  WRAPPER: 'Card',
@@ -114,36 +115,36 @@ export const Card = forwardRef<HTMLElement, CardProps>(
114
115
  $shadowless={shadowless}
115
116
  forwardedAs={as || 'section'}
116
117
  className={clsx(cardClassNames.WRAPPER, className)}
117
- data-test="card"
118
+ data-test={cardTestIds.CARD}
118
119
  {...rest}
119
120
  ref={ref}
120
121
  >
121
122
  {(!!caption || !!actions) && (
122
- <header className={cardClassNames.HEADER} data-test="card-header">
123
+ <header className={cardClassNames.HEADER} data-test={cardTestIds.HEADER}>
123
124
  {caption && (
124
125
  <Text
125
126
  as="div"
126
127
  size="big"
127
128
  weight="bold"
128
129
  className={cardClassNames.CAPTION}
129
- data-test="card-caption"
130
+ data-test={cardTestIds.CAPTION}
130
131
  >
131
132
  {caption}
132
133
  </Text>
133
134
  )}
134
135
  {actions && (
135
- <div className={cardClassNames.ACTIONS} data-test="card-actions">
136
+ <div className={cardClassNames.ACTIONS} data-test={cardTestIds.ACTIONS}>
136
137
  {actions}
137
138
  </div>
138
139
  )}
139
140
  </header>
140
141
  )}
141
142
  {description && (
142
- <div className={cardClassNames.DESCRIPTION} data-test="card-description">
143
+ <div className={cardClassNames.DESCRIPTION} data-test={cardTestIds.DESCRIPTION}>
143
144
  {description}
144
145
  </div>
145
146
  )}
146
- <div className={cardClassNames.CONTENT} data-test="card-content">
147
+ <div className={cardClassNames.CONTENT} data-test={cardTestIds.CONTENT}>
147
148
  {children}
148
149
  </div>
149
150
  </StyledCardWrapper>
@@ -0,0 +1,3 @@
1
+ export const actionButtonTestIds = {
2
+ COPY_TO_CLIPBOARD: 'copy_to_clipboard',
3
+ };
@@ -7,6 +7,7 @@ import { theme } from '../../design_system/theme';
7
7
  import { useSharedUiDependencies } from '../../ui_dependency_provider';
8
8
  import { useCopyToClipboard } from '../../utils';
9
9
  import { Text } from '../text';
10
+ import { actionButtonTestIds } from './action_button.test_ids';
10
11
 
11
12
  interface StyledButtonProps {
12
13
  $successStyle?: boolean;
@@ -105,7 +106,7 @@ export const CopyButton = ({ code, ...props }: CopyButtonProps) => {
105
106
  return (
106
107
  <ActionButton
107
108
  onClick={async () => copyToClipboard(code)}
108
- data-test="copy_to_clipboard"
109
+ data-test={actionButtonTestIds.COPY_TO_CLIPBOARD}
109
110
  aria-label="Copy to clipboard"
110
111
  {...props}
111
112
  >
@@ -0,0 +1,5 @@
1
+ export const codeBlockTestIds = {
2
+ HEADER: 'code-block-header',
3
+ };
4
+
5
+ export const codeBlockTabTestId = (key: string): string => `code-block-tab-${key}`;
@@ -10,6 +10,7 @@ import type { SharedTextSize } from '../../text/text_shared';
10
10
  import { ActionButton, CopyButton } from '../action_button';
11
11
  import { PrismSyntaxHighlighter } from '../prism_highlighter';
12
12
  import { CodeBlockWrapper } from './code_block.styled';
13
+ import { codeBlockTabTestId, codeBlockTestIds } from './code_block.test_ids';
13
14
  import { getBashLinePrefixes, getNumberLinePrefixes } from './utils';
14
15
 
15
16
  type CodeTab = {
@@ -57,7 +58,7 @@ const HeaderDots = () => {
57
58
 
58
59
  const Header = ({ tabs, currentTab, showBashHeader, onTabChange, title }: HeaderProps) => {
59
60
  return (
60
- <div className="CodeBlock-Header" data-test="code-block-header">
61
+ <div className="CodeBlock-Header" data-test={codeBlockTestIds.HEADER}>
61
62
  {showBashHeader && <HeaderDots />}
62
63
  {title && (
63
64
  <Text weight="bold" className="CodeBlock-HeaderTitle">
@@ -69,7 +70,7 @@ const Header = ({ tabs, currentTab, showBashHeader, onTabChange, title }: Header
69
70
  const selected = tab.key === currentTab?.key;
70
71
  const props = {
71
72
  className: clsx('CodeBlock-Tab', { selected }),
72
- 'data-test': `code-block-tab-${tab.key}`,
73
+ 'data-test': codeBlockTabTestId(tab.key),
73
74
  onClick: (e: React.MouseEvent) => onTabChange(tab, e),
74
75
  title: tab.label,
75
76
  id: tab.id ?? tab.key,
@@ -11,6 +11,7 @@ import { Box, type MarginSpacingProps, type RegularBoxProps } from '../../box';
11
11
  import { Link, type RegularLinkProps } from '../../link';
12
12
  import { HeadingShared } from '../../text/heading_shared';
13
13
  import { CodeBlock, type CodeBlockProps } from './code_block';
14
+ import { codeBlockTabTestId } from './code_block.test_ids';
14
15
 
15
16
  export type CodeBlockTabKey = 'cli' | 'http' | 'javascript' | 'mcp' | 'openapi' | 'python' | 'typescript';
16
17
  type CodeBlockTabConfig = {
@@ -224,7 +225,7 @@ export const CodeBlockWithTabs = ({
224
225
 
225
226
  const commonProps = {
226
227
  className: clsx(CODE_BLOCK_WITH_TABS_CLASSNAMES.TAB, { selected }),
227
- 'data-test': `code-block-tab-${tab.key}`,
228
+ 'data-test': codeBlockTabTestId(tab.key),
228
229
  ..._.omit(tab, ['bashCommandsStart', 'content', 'languageOverride']),
229
230
  };
230
231
  const children = (
@@ -0,0 +1,3 @@
1
+ export const oneLineCodeTestIds = {
2
+ TOGGLE_VISIBILITY_BUTTON: 'toggle-visibility-button',
3
+ };
@@ -14,6 +14,7 @@ import type { SyntaxHighlighterBaseStylesWrapperProps } from '../code_block/code
14
14
  import { SyntaxHighlighterBaseStylesWrapper } from '../code_block/code_block.styled';
15
15
  import { getBashLinePrefixes } from '../code_block/utils';
16
16
  import { PrismSyntaxHighlighter } from '../prism_highlighter';
17
+ import { oneLineCodeTestIds } from './one_line_code.test_ids';
17
18
 
18
19
  export const oneLineCodeClassNames = {
19
20
  gradientWrapper: 'OneLineCode-GradientWrapper',
@@ -216,7 +217,7 @@ export function OneLineCode({
216
217
  onClick={() => setShowSecret((prev) => !prev)}
217
218
  trackingId={trackingBundle?.secret?.trackingId}
218
219
  trackingData={trackingBundle?.secret?.trackingData}
219
- data-test="toggle-visibility-button"
220
+ data-test={oneLineCodeTestIds.TOGGLE_VISIBILITY_BUTTON}
220
221
  >
221
222
  {showSecret ? <EyeOffIcon size="16" /> : <EyeIcon size="16" />}
222
223
  </ActionButton>
@@ -0,0 +1,3 @@
1
+ export const prismHighlighterTestIds = {
2
+ CODE: 'code-block-code',
3
+ };
@@ -11,6 +11,7 @@ import { useSharedUiDependencies } from '../../ui_dependency_provider';
11
11
  import type { SharedTextSize } from '../text';
12
12
  import { Text } from '../text';
13
13
  import { oneLightTheme } from './one_light_theme';
14
+ import { prismHighlighterTestIds } from './prism_highlighter.test_ids';
14
15
 
15
16
  (typeof global !== 'undefined' ? global : window).Prism = Prism;
16
17
 
@@ -208,7 +209,7 @@ export const PrismSyntaxHighlighter = forwardRef<HTMLPreElement, SyntaxHighlight
208
209
  className={clsx(className, prismClassName)}
209
210
  $hasLinePrefixes={hasLinePrefixes}
210
211
  $isSingleLine={isSingleLine}
211
- data-test="code-block-code"
212
+ data-test={prismHighlighterTestIds.CODE}
212
213
  ref={ref}
213
214
  >
214
215
  <Text size={size} type="code" as="code">
@@ -0,0 +1,3 @@
1
+ export const collapsibleCardTestIds = {
2
+ TOP_SECTION: 'collapsible-card-top-section',
3
+ };
@@ -8,6 +8,8 @@ import { ChevronDownIcon } from '@apify/ui-icons';
8
8
  import { theme } from '../../design_system/theme';
9
9
  import type { WithTransientProps } from '../../type_utils';
10
10
  import { Box } from '../box';
11
+ import { cardTestIds } from '../card/card.test_ids';
12
+ import { collapsibleCardTestIds } from './collapsible_card.test_ids';
11
13
 
12
14
  interface TransientWrapperProps {
13
15
  hideOuterBorder?: boolean;
@@ -144,7 +146,7 @@ export const CollapsibleCard = ({
144
146
  {topSection && (
145
147
  <StyledTopSection
146
148
  className={collapsibleCardClassNames.TOP_SECTION}
147
- data-test="collapsible-card-top-section"
149
+ data-test={collapsibleCardTestIds.TOP_SECTION}
148
150
  >
149
151
  {topSection}
150
152
  </StyledTopSection>
@@ -168,7 +170,7 @@ export const CollapsibleCard = ({
168
170
  $noDivider={noDivider}
169
171
  className={collapsibleCardClassNames.COLLAPSIBLE_CONTENT_WRAPPER}
170
172
  >
171
- <StyledCardContent className={collapsibleCardClassNames.CONTENT} data-test="card-content">
173
+ <StyledCardContent className={collapsibleCardClassNames.CONTENT} data-test={cardTestIds.CONTENT}>
172
174
  {children}
173
175
  </StyledCardContent>
174
176
  </CollapsibleContent>
@@ -2,6 +2,7 @@ import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
2
2
  import styled from 'styled-components';
3
3
 
4
4
  import { theme } from '../../design_system/theme';
5
+ import { dropdownTestIds } from './dropdown.test_ids';
5
6
 
6
7
  export const DROPDOWN_ELEMENT_CLASSES = {
7
8
  WRAPPER: 'dropdown-wrapper',
@@ -23,7 +24,7 @@ type StyledContentProps = {
23
24
  export const StyledContent = styled(DropdownMenu.Content).attrs<
24
25
  DropdownMenu.DropdownMenuContentProps & { 'data-test'?: string }
25
26
  >((props) => ({
26
- 'data-test': 'dropdown-wrapper',
27
+ 'data-test': dropdownTestIds.WRAPPER,
27
28
  className: [DROPDOWN_ELEMENT_CLASSES.WRAPPER, props.className].filter(Boolean).join(' '),
28
29
  }))<StyledContentProps>`
29
30
  background: ${theme.color.neutral.background};
@@ -0,0 +1,5 @@
1
+ export const dropdownTestIds = {
2
+ WRAPPER: 'dropdown-wrapper',
3
+ ITEM: 'dropdown-item',
4
+ ITEM_DISABLED: 'dropdown-item-disabled',
5
+ };
@@ -26,6 +26,7 @@ import {
26
26
  StyledSeparator,
27
27
  StyledTagWrapper,
28
28
  } from './dropdown.styled';
29
+ import { dropdownTestIds } from './dropdown.test_ids';
29
30
  import type { BaseDropdownItemProps } from './dropdown.types';
30
31
  import { DropdownRoot } from './dropdown_root';
31
32
 
@@ -62,7 +63,7 @@ const DropdownItem = ({
62
63
  disabled={disabled}
63
64
  {...props}
64
65
  className={clsx(DROPDOWN_ELEMENT_CLASSES.ITEM, className, selected && 'dropdown-item-selected')}
65
- data-test={disabled ? 'dropdown-item-disabled' : 'dropdown-item'}
66
+ data-test={disabled ? dropdownTestIds.ITEM_DISABLED : dropdownTestIds.ITEM}
66
67
  >
67
68
  <StyledItemRow>
68
69
  {icon && <StyledIconWrapper>{icon}</StyledIconWrapper>}
@@ -121,7 +122,7 @@ const DropdownCheckboxItem = ({
121
122
  {...props}
122
123
  onCheckedChange={disabled ? undefined : onCheckedChange}
123
124
  className={clsx(className)}
124
- data-test={disabled ? 'dropdown-item-disabled' : 'dropdown-item'}
125
+ data-test={disabled ? dropdownTestIds.ITEM_DISABLED : dropdownTestIds.ITEM}
125
126
  >
126
127
  <StyledItemRow>
127
128
  <StyledCheckboxIconWrapper>
@@ -0,0 +1,6 @@
1
+ export const paginationTestIds = {
2
+ PREV_BUTTON: 'page-prev-button',
3
+ CURRENT_PAGE_BUTTON: 'current-page-button',
4
+ PAGE_NUMBER_BUTTON: 'page-number-button',
5
+ NEXT_BUTTON: 'page-next-button',
6
+ };
@@ -7,6 +7,7 @@ import { ChevronLeftIcon, ChevronRightIcon } from '@apify/ui-icons';
7
7
  import { theme } from '../../design_system/theme';
8
8
  import { Box } from '../box';
9
9
  import { Button } from '../button';
10
+ import { paginationTestIds } from './pagination.test_ids';
10
11
 
11
12
  const LEADING_THREE_DOTS_PAGE_KEY = -1;
12
13
  const TRAILING_THREE_DOTS_PAGE_KEY = -2;
@@ -76,7 +77,7 @@ export const PaginationButtons: FC<PaginationButtonsProps> = ({ page, totalPages
76
77
  return (
77
78
  <StyledPageSelectionButtons>
78
79
  <PaginationButtonBase
79
- data-test="page-prev-button"
80
+ data-test={paginationTestIds.PREV_BUTTON}
80
81
  disabled={page <= 0}
81
82
  onClick={() => onPageChange(page - 1)}
82
83
  trackingId="PaginationPrevPage"
@@ -101,7 +102,7 @@ export const PaginationButtons: FC<PaginationButtonsProps> = ({ page, totalPages
101
102
  return (
102
103
  <PaginationButtonBase
103
104
  key={pageToDisplay}
104
- data-test="current-page-button"
105
+ data-test={paginationTestIds.CURRENT_PAGE_BUTTON}
105
106
  trackingId="PaginationCurrentPage"
106
107
  className="currentPage"
107
108
  onClick={() => undefined}
@@ -113,7 +114,7 @@ export const PaginationButtons: FC<PaginationButtonsProps> = ({ page, totalPages
113
114
  return (
114
115
  <PaginationButtonBase
115
116
  key={pageToDisplay}
116
- data-test="page-number-button"
117
+ data-test={paginationTestIds.PAGE_NUMBER_BUTTON}
117
118
  onClick={() => onPageChange(pageToDisplay)}
118
119
  trackingId="PaginationNumberedPage"
119
120
  >
@@ -122,7 +123,7 @@ export const PaginationButtons: FC<PaginationButtonsProps> = ({ page, totalPages
122
123
  );
123
124
  })}
124
125
  <PaginationButtonBase
125
- data-test="page-next-button"
126
+ data-test={paginationTestIds.NEXT_BUTTON}
126
127
  disabled={page >= totalPages - 1}
127
128
  onClick={() => onPageChange(page + 1)}
128
129
  trackingId="PaginationNextPage"
@@ -0,0 +1,2 @@
1
+ // Clear indicator button, keyed by the select's id (or name as a fallback)
2
+ export const selectClearTestId = (idOrName: string | undefined): string => `${idOrName}--clear`;
@@ -4,6 +4,7 @@ import type {
4
4
  ClearIndicatorProps,
5
5
  DropdownIndicatorProps,
6
6
  IndicatorsContainerProps,
7
+ MultiValueGenericProps,
7
8
  MultiValueRemoveProps,
8
9
  OptionProps,
9
10
  StylesConfig,
@@ -16,6 +17,7 @@ import { CaretDownIcon, CaretUpIcon, CrossIcon, XCircleIcon } from '@apify/ui-ic
16
17
  import { theme } from '../../design_system/theme';
17
18
  import { IconButton } from '../icon_button';
18
19
  import { Text } from '../text';
20
+ import { selectClearTestId } from './select.test_ids';
19
21
 
20
22
  const DEFAULT_Z_INDEX_IN_MODAL = 99;
21
23
  const DEFAULT_Z_INDEX_OUTSIDE_MODAL = 9;
@@ -294,7 +296,7 @@ const ClearIndicator: FC<ClearIndicatorProps<SelectOption>> = ({ innerProps, sel
294
296
  return (
295
297
  <IconButton
296
298
  Icon={CrossIcon}
297
- data-test={`${selectProps?.id ?? selectProps?.name}--clear`}
299
+ data-test={selectClearTestId(selectProps?.id ?? selectProps?.name)}
298
300
  {...(innerProps as React.HTMLAttributes<Element>)}
299
301
  />
300
302
  );
@@ -312,6 +314,18 @@ export const SelectMultiValueRemove: FC<Pick<MultiValueRemoveProps<SelectOption>
312
314
  <MultiValueRemoveButton Icon={CrossIcon} {...(innerProps as React.HTMLAttributes<Element>)} />
313
315
  );
314
316
 
317
+ const SelectMultiValueLabel: FC<MultiValueGenericProps<SelectOption>> = ({ innerProps, ...rest }) => (
318
+ <selectComponents.MultiValueLabel
319
+ {...rest}
320
+ innerProps={
321
+ {
322
+ ...innerProps,
323
+ 'data-test': `${rest.selectProps?.id ?? rest.selectProps?.name}--multi-value-label`,
324
+ } as typeof innerProps
325
+ }
326
+ />
327
+ );
328
+
315
329
  const IndicatorSeparator = () => null; // we don't display anything
316
330
 
317
331
  /**
@@ -384,6 +398,7 @@ export const SelectPrimitive = forwardRef<unknown, SelectPrimitiveProps>(
384
398
  ClearIndicator,
385
399
  IndicatorSeparator,
386
400
  MultiValueRemove: SelectMultiValueRemove, // react-select slot name
401
+ MultiValueLabel: SelectMultiValueLabel,
387
402
  IndicatorsContainer,
388
403
  Option,
389
404
  Control: StyledControl,
@@ -0,0 +1,3 @@
1
+ export const storeActorHeaderTestIds = {
2
+ HEADER: 'actor-store-item-header',
3
+ };
@@ -5,6 +5,7 @@ import { StarEmptyIcon, WarningTriangleIcon } from '@apify/ui-icons';
5
5
  import { Badge, Box, type BoxProps, Text } from '../../components';
6
6
  import { theme } from '../../design_system/theme';
7
7
  import { ActorAvatar, actorAvatarClassnames } from '../avatar';
8
+ import { storeActorHeaderTestIds } from './store_actor_header.test_ids';
8
9
 
9
10
  const storeActorHeaderClassNames = {
10
11
  title: 'ActorStoreItem-title',
@@ -93,7 +94,7 @@ export const StoreActorHeader: React.FC<StoreActorHeaderProps & BoxProps> = ({
93
94
  ...rest
94
95
  }) => {
95
96
  return (
96
- <StyledStoreActorHeader data-test="actor-store-item-header" $compact={compact} {...rest}>
97
+ <StyledStoreActorHeader data-test={storeActorHeaderTestIds.HEADER} $compact={compact} {...rest}>
97
98
  <ActorAvatarWrapper>
98
99
  <ActorAvatar
99
100
  size={compact ? 20 : avatarSize}
@@ -0,0 +1,3 @@
1
+ export const tabTestIds = {
2
+ TAB: 'tab',
3
+ };
@@ -15,6 +15,7 @@ import type { RegularLinkProps } from '../link';
15
15
  import { Link } from '../link';
16
16
  import type { SharedTextSize } from '../text';
17
17
  import { Text } from '../text';
18
+ import { tabTestIds } from './tab.test_ids';
18
19
 
19
20
  type SharedTabProps = Omit<RegularBoxProps, 'as' | 'onClick'> &
20
21
  MarginSpacingProps &
@@ -199,7 +200,7 @@ export const Tab = ({
199
200
  const href = typeof to === 'string' ? to : createPath(to);
200
201
  return (
201
202
  <TabWrapper
202
- data-test="tab"
203
+ data-test={tabTestIds.TAB}
203
204
  {...props}
204
205
  id={id}
205
206
  to={to}
@@ -0,0 +1,3 @@
1
+ export const tabsTestIds = {
2
+ WRAPPER: 'tabs-wrapper',
3
+ };
@@ -10,6 +10,7 @@ import type { MarginSpacingProps, RegularBoxProps } from '../box';
10
10
  import { Box } from '../box';
11
11
  import type { TabData, TabVariant } from './tab';
12
12
  import { Tab } from './tab';
13
+ import { tabsTestIds } from './tabs.test_ids';
13
14
 
14
15
  type SharedTabsProps = Omit<RegularBoxProps, 'as' | 'onClick'> & MarginSpacingProps;
15
16
  export type TabsProps = SharedTabsProps & {
@@ -154,7 +155,7 @@ export const Tabs = ({ variant = 'default', tabs, activeTab, onSelect, ...props
154
155
  }, []);
155
156
 
156
157
  return (
157
- <TabsWrapper {...props} data-test="tabs-wrapper" $variant={variant}>
158
+ <TabsWrapper {...props} data-test={tabsTestIds.WRAPPER} $variant={variant}>
158
159
  <div role="cell" aria-hidden={!overflowState?.left} />
159
160
  <div ref={ref} role="tablist" onScroll={scrollHandler}>
160
161
  {tabs.map((tab) => (
package/src/test_ids.ts CHANGED
@@ -1,3 +1,17 @@
1
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.
2
+ // React/CSS-heavy root barrel (which breaks non-bundler loaders).
3
+ // Do not edit directly, this file is generated by `pnpm run generate:test-id-barrels`.
4
+ export { actorTemplateCardTestId } from './components/actor_template_card/actor_template_card.test_ids.js';
5
+ export { cardTestIds } from './components/card/card.test_ids.js';
6
+ export { actionButtonTestIds } from './components/code/action_button.test_ids.js';
7
+ export { codeBlockTabTestId, codeBlockTestIds } from './components/code/code_block/code_block.test_ids.js';
8
+ export { oneLineCodeTestIds } from './components/code/one_line_code/one_line_code.test_ids.js';
9
+ export { prismHighlighterTestIds } from './components/code/prism_highlighter.test_ids.js';
10
+ export { collapsibleCardTestIds } from './components/collapsible_card/collapsible_card.test_ids.js';
11
+ export { dropdownTestIds } from './components/dropdown/dropdown.test_ids.js';
12
+ export { paginationTestIds } from './components/pagination/pagination.test_ids.js';
13
+ export { selectClearTestId } from './components/select/select.test_ids.js';
14
+ export { storeActorHeaderTestIds } from './components/store/store_actor_header.test_ids.js';
3
15
  export { tableTestIds } from './components/table/table.test_ids.js';
16
+ export { tabTestIds } from './components/tabs/tab.test_ids.js';
17
+ export { tabsTestIds } from './components/tabs/tabs.test_ids.js';