@apify/ui-library 1.138.2-featpublictasks-2f3d3c.52 → 1.138.3

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 (91) hide show
  1. package/dist/src/components/chip.d.ts.map +1 -1
  2. package/dist/src/components/chip.js +2 -25
  3. package/dist/src/components/chip.js.map +1 -1
  4. package/dist/src/components/collapsible_card/collapsible_card.d.ts +2 -3
  5. package/dist/src/components/collapsible_card/collapsible_card.d.ts.map +1 -1
  6. package/dist/src/components/collapsible_card/collapsible_card.js +2 -2
  7. package/dist/src/components/collapsible_card/collapsible_card.js.map +1 -1
  8. package/dist/src/components/floating/floating_component_base.d.ts +1 -72
  9. package/dist/src/components/floating/floating_component_base.d.ts.map +1 -1
  10. package/dist/src/components/floating/floating_component_base.js +36 -66
  11. package/dist/src/components/floating/floating_component_base.js.map +1 -1
  12. package/dist/src/components/floating/tooltip.d.ts +3 -10
  13. package/dist/src/components/floating/tooltip.d.ts.map +1 -1
  14. package/dist/src/components/floating/tooltip.js +20 -24
  15. package/dist/src/components/floating/tooltip.js.map +1 -1
  16. package/dist/src/components/index.d.ts +0 -2
  17. package/dist/src/components/index.d.ts.map +1 -1
  18. package/dist/src/components/index.js +0 -2
  19. package/dist/src/components/index.js.map +1 -1
  20. package/dist/tsconfig.build.tsbuildinfo +1 -1
  21. package/package.json +4 -4
  22. package/src/components/chip.tsx +1 -27
  23. package/src/components/collapsible_card/collapsible_card.tsx +4 -6
  24. package/src/components/floating/floating_component_base.tsx +47 -89
  25. package/src/components/floating/tooltip.tsx +25 -53
  26. package/src/components/index.ts +0 -2
  27. package/dist/src/components/actor_example/actor_example.utils.d.ts +0 -17
  28. package/dist/src/components/actor_example/actor_example.utils.d.ts.map +0 -1
  29. package/dist/src/components/actor_example/actor_example.utils.js +0 -41
  30. package/dist/src/components/actor_example/actor_example.utils.js.map +0 -1
  31. package/dist/src/components/actor_example/actor_example_avatar.d.ts +0 -13
  32. package/dist/src/components/actor_example/actor_example_avatar.d.ts.map +0 -1
  33. package/dist/src/components/actor_example/actor_example_avatar.js +0 -34
  34. package/dist/src/components/actor_example/actor_example_avatar.js.map +0 -1
  35. package/dist/src/components/actor_example/actor_example_card.d.ts +0 -28
  36. package/dist/src/components/actor_example/actor_example_card.d.ts.map +0 -1
  37. package/dist/src/components/actor_example/actor_example_card.js +0 -79
  38. package/dist/src/components/actor_example/actor_example_card.js.map +0 -1
  39. package/dist/src/components/actor_example/actor_example_preview.d.ts +0 -28
  40. package/dist/src/components/actor_example/actor_example_preview.d.ts.map +0 -1
  41. package/dist/src/components/actor_example/actor_example_preview.js +0 -208
  42. package/dist/src/components/actor_example/actor_example_preview.js.map +0 -1
  43. package/dist/src/components/actor_example/actor_example_run_button.d.ts +0 -33
  44. package/dist/src/components/actor_example/actor_example_run_button.d.ts.map +0 -1
  45. package/dist/src/components/actor_example/actor_example_run_button.js +0 -12
  46. package/dist/src/components/actor_example/actor_example_run_button.js.map +0 -1
  47. package/dist/src/components/actor_example/actor_example_schema.d.ts +0 -20
  48. package/dist/src/components/actor_example/actor_example_schema.d.ts.map +0 -1
  49. package/dist/src/components/actor_example/actor_example_schema.js +0 -27
  50. package/dist/src/components/actor_example/actor_example_schema.js.map +0 -1
  51. package/dist/src/components/actor_example/actor_example_schema_field.d.ts +0 -19
  52. package/dist/src/components/actor_example/actor_example_schema_field.d.ts.map +0 -1
  53. package/dist/src/components/actor_example/actor_example_schema_field.js +0 -33
  54. package/dist/src/components/actor_example/actor_example_schema_field.js.map +0 -1
  55. package/dist/src/components/actor_example/actor_example_schema_field_badge.d.ts +0 -9
  56. package/dist/src/components/actor_example/actor_example_schema_field_badge.d.ts.map +0 -1
  57. package/dist/src/components/actor_example/actor_example_schema_field_badge.js +0 -48
  58. package/dist/src/components/actor_example/actor_example_schema_field_badge.js.map +0 -1
  59. package/dist/src/components/actor_example/actor_example_schema_legend.d.ts +0 -10
  60. package/dist/src/components/actor_example/actor_example_schema_legend.d.ts.map +0 -1
  61. package/dist/src/components/actor_example/actor_example_schema_legend.js +0 -29
  62. package/dist/src/components/actor_example/actor_example_schema_legend.js.map +0 -1
  63. package/dist/src/components/actor_example/actor_example_schema_property.d.ts +0 -24
  64. package/dist/src/components/actor_example/actor_example_schema_property.d.ts.map +0 -1
  65. package/dist/src/components/actor_example/actor_example_schema_property.js +0 -122
  66. package/dist/src/components/actor_example/actor_example_schema_property.js.map +0 -1
  67. package/dist/src/components/actor_example/index.d.ts +0 -11
  68. package/dist/src/components/actor_example/index.d.ts.map +0 -1
  69. package/dist/src/components/actor_example/index.js +0 -11
  70. package/dist/src/components/actor_example/index.js.map +0 -1
  71. package/dist/src/components/browser_window/browser_window.d.ts +0 -20
  72. package/dist/src/components/browser_window/browser_window.d.ts.map +0 -1
  73. package/dist/src/components/browser_window/browser_window.js +0 -72
  74. package/dist/src/components/browser_window/browser_window.js.map +0 -1
  75. package/dist/src/components/browser_window/index.d.ts +0 -2
  76. package/dist/src/components/browser_window/index.d.ts.map +0 -1
  77. package/dist/src/components/browser_window/index.js +0 -2
  78. package/dist/src/components/browser_window/index.js.map +0 -1
  79. package/src/components/actor_example/actor_example.utils.ts +0 -52
  80. package/src/components/actor_example/actor_example_avatar.tsx +0 -69
  81. package/src/components/actor_example/actor_example_card.tsx +0 -149
  82. package/src/components/actor_example/actor_example_preview.tsx +0 -295
  83. package/src/components/actor_example/actor_example_run_button.tsx +0 -61
  84. package/src/components/actor_example/actor_example_schema.tsx +0 -60
  85. package/src/components/actor_example/actor_example_schema_field.tsx +0 -87
  86. package/src/components/actor_example/actor_example_schema_field_badge.tsx +0 -66
  87. package/src/components/actor_example/actor_example_schema_legend.tsx +0 -49
  88. package/src/components/actor_example/actor_example_schema_property.tsx +0 -242
  89. package/src/components/actor_example/index.ts +0 -10
  90. package/src/components/browser_window/browser_window.tsx +0 -106
  91. package/src/components/browser_window/index.ts +0 -1
@@ -1,242 +0,0 @@
1
- import clsx from 'clsx';
2
- import type { ReactNode } from 'react';
3
- import styled, { css } from 'styled-components';
4
-
5
- import { ChevronDownIcon, QuestionMarkIcon } from '@apify/ui-icons';
6
-
7
- import type { ActorExampleSchemaFieldSerialized, ActorExampleSchemaFieldType } from '@apify-packages/types';
8
-
9
- import { theme } from '../../design_system/theme.js';
10
- import { Tooltip } from '../floating/tooltip.js';
11
- import { Text } from '../text/index.js';
12
- import { actorExampleSchemaPropertyMap } from './actor_example.utils.js';
13
- import { ActorExampleSchemaFieldBadge } from './actor_example_schema_field_badge.js';
14
-
15
- type NormalizedPropertyValue = {
16
- value: string;
17
- remainingValues: number;
18
- };
19
-
20
- const normalizePropertyValue = (
21
- type: ActorExampleSchemaFieldType | undefined,
22
- value: unknown,
23
- ): NormalizedPropertyValue | undefined => {
24
- if (type === 'object' || value == null) return undefined;
25
-
26
- if (Array.isArray(value)) {
27
- const first = value[0];
28
- if (first == null || typeof first === 'object') return undefined;
29
- const normalizedFirst = String(first).trim();
30
- if (normalizedFirst.length === 0) return undefined;
31
- return { value: normalizedFirst, remainingValues: value.length - 1 };
32
- }
33
-
34
- const normalizedValue = String(value).trim();
35
- if (normalizedValue.length === 0) return undefined;
36
- return { value: normalizedValue, remainingValues: 0 };
37
- };
38
-
39
- export const actorExampleSchemaPropertyClassNames = {
40
- ROOT: 'actor-example-schema-property',
41
- LEADING: 'actor-example-schema-property__leading',
42
- TYPE: 'actor-example-schema-property__type',
43
- NAME: 'actor-example-schema-property__name',
44
- DELIMITER: 'actor-example-schema-property__delimiter',
45
- VALUE: 'actor-example-schema-property__value',
46
- TOGGLE: 'actor-example-schema-property__toggle',
47
- PRESERVED: 'actor-example-schema-property__preserved',
48
- INFO: 'actor-example-schema-property__info',
49
- };
50
-
51
- const ActorExampleSchemaPropertyWrapper = styled.div<{ $type?: ActorExampleSchemaFieldType; $isCollapsed: boolean }>`
52
- width: 100%;
53
- min-width: 0;
54
- display: flex;
55
- align-items: center;
56
- gap: ${theme.space.space4};
57
-
58
- .${actorExampleSchemaPropertyClassNames.LEADING} {
59
- flex-shrink: 0;
60
- display: inline-flex;
61
- align-items: center;
62
- }
63
-
64
- .${actorExampleSchemaPropertyClassNames.TOGGLE} {
65
- all: unset;
66
- width: 2rem;
67
- height: 2rem;
68
- cursor: pointer;
69
- display: flex;
70
- align-items: center;
71
- justify-content: center;
72
- transition: transform 0.2s ease-in-out;
73
-
74
- ${({ $isCollapsed }) =>
75
- $isCollapsed &&
76
- css`
77
- transform: rotate(-90deg);
78
- `}
79
- }
80
-
81
- .${actorExampleSchemaPropertyClassNames.TYPE} {
82
- margin-right: ${theme.space.space4};
83
- flex-shrink: 0;
84
- }
85
-
86
- .${actorExampleSchemaPropertyClassNames.NAME} {
87
- min-width: 1ch;
88
- ${({ $type }) =>
89
- ($type === 'object' || $type === 'array') &&
90
- css`
91
- font-weight: 600;
92
- `}
93
- text-overflow: ellipsis;
94
- white-space: nowrap;
95
- overflow: hidden;
96
- }
97
-
98
- .${actorExampleSchemaPropertyClassNames.DELIMITER} {
99
- display: inline-flex;
100
- flex-shrink: 0;
101
- }
102
-
103
- .${actorExampleSchemaPropertyClassNames.VALUE} {
104
- min-width: 0;
105
- margin-left: ${theme.space.space4};
106
- padding: 1px ${theme.space.space6};
107
- border: 1px solid ${theme.color.neutral.border};
108
- border-radius: ${theme.radius.radius4};
109
- text-overflow: ellipsis;
110
- white-space: nowrap;
111
- overflow: hidden;
112
- }
113
-
114
- .${actorExampleSchemaPropertyClassNames.PRESERVED} {
115
- margin-left: 0;
116
- flex-shrink: 0;
117
- }
118
-
119
- .${actorExampleSchemaPropertyClassNames.INFO} {
120
- flex-shrink: 0;
121
- color: ${theme.color.neutral.textSubtle};
122
- display: inline-flex;
123
- align-items: center;
124
- }
125
- `;
126
-
127
- const MIN_PROPERTY_NAME_LENGTH_PRESERVATION = 3;
128
-
129
- type Props = ActorExampleSchemaFieldSerialized & {
130
- className?: string;
131
- isCollapsable?: boolean;
132
- isCollapsed?: boolean;
133
- onToggleCollapsed?: (id: string) => void;
134
- /** Optional slot rendered before the type badge (e.g. a checkbox in a configurator). */
135
- leadingSlot?: ReactNode;
136
- };
137
-
138
- export const ActorExampleSchemaProperty = ({
139
- type,
140
- _id,
141
- name,
142
- title,
143
- description,
144
- value,
145
- required = false,
146
- isCollapsable = false,
147
- isCollapsed = false,
148
- onToggleCollapsed,
149
- leadingSlot,
150
- className,
151
- }: Props) => {
152
- const tooltip = type ? actorExampleSchemaPropertyMap[type]?.title : undefined;
153
-
154
- const normalizedName = title ?? name;
155
- const normalizedValue = normalizePropertyValue(type, value);
156
-
157
- return (
158
- <ActorExampleSchemaPropertyWrapper
159
- $type={type}
160
- $isCollapsed={isCollapsed}
161
- className={clsx(actorExampleSchemaPropertyClassNames.ROOT, className)}
162
- >
163
- {leadingSlot && <span className={actorExampleSchemaPropertyClassNames.LEADING}>{leadingSlot}</span>}
164
- {isCollapsable && (
165
- <button
166
- type="button"
167
- className={actorExampleSchemaPropertyClassNames.TOGGLE}
168
- onClick={() => onToggleCollapsed?.(_id)}
169
- >
170
- <ChevronDownIcon size="16" />
171
- </button>
172
- )}
173
- <Tooltip content={tooltip} className={actorExampleSchemaPropertyClassNames.TYPE}>
174
- <ActorExampleSchemaFieldBadge
175
- type={type}
176
- title={normalizedName}
177
- className={tooltip == null ? actorExampleSchemaPropertyClassNames.TYPE : undefined}
178
- />
179
- </Tooltip>
180
- <Text
181
- as="span"
182
- weight="medium"
183
- className={clsx(actorExampleSchemaPropertyClassNames.NAME, {
184
- [actorExampleSchemaPropertyClassNames.PRESERVED]:
185
- normalizedName.length <= MIN_PROPERTY_NAME_LENGTH_PRESERVATION,
186
- })}
187
- >
188
- {normalizedName}
189
- </Text>
190
-
191
- {required && (
192
- <Text
193
- as="span"
194
- size="small"
195
- weight="medium"
196
- color={theme.color.neutral.textSubtle}
197
- className={actorExampleSchemaPropertyClassNames.PRESERVED}
198
- >
199
- (required)
200
- </Text>
201
- )}
202
-
203
- {description && (
204
- <Tooltip content={description} className={actorExampleSchemaPropertyClassNames.INFO}>
205
- <QuestionMarkIcon size="16" />
206
- </Tooltip>
207
- )}
208
-
209
- {normalizedValue && (
210
- <>
211
- <Text as="span" weight="medium" className={actorExampleSchemaPropertyClassNames.DELIMITER}>
212
- :
213
- </Text>
214
- <Text
215
- as="span"
216
- size="small"
217
- weight="medium"
218
- className={clsx(actorExampleSchemaPropertyClassNames.VALUE, {
219
- [actorExampleSchemaPropertyClassNames.PRESERVED]:
220
- normalizedValue.value.length <= MIN_PROPERTY_NAME_LENGTH_PRESERVATION,
221
- })}
222
- >
223
- {normalizedValue.value}
224
- </Text>
225
- {normalizedValue.remainingValues > 0 && (
226
- <Text
227
- as="span"
228
- size="small"
229
- weight="medium"
230
- className={clsx(
231
- actorExampleSchemaPropertyClassNames.VALUE,
232
- actorExampleSchemaPropertyClassNames.PRESERVED,
233
- )}
234
- >
235
- +{normalizedValue.remainingValues}
236
- </Text>
237
- )}
238
- </>
239
- )}
240
- </ActorExampleSchemaPropertyWrapper>
241
- );
242
- };
@@ -1,10 +0,0 @@
1
- export * from './actor_example_avatar.js';
2
- export * from './actor_example_card.js';
3
- export * from './actor_example_preview.js';
4
- export * from './actor_example_run_button.js';
5
- export * from './actor_example_schema.js';
6
- export * from './actor_example_schema_field.js';
7
- export * from './actor_example_schema_field_badge.js';
8
- export * from './actor_example_schema_legend.js';
9
- export * from './actor_example_schema_property.js';
10
- export * from './actor_example.utils.js';
@@ -1,106 +0,0 @@
1
- import clsx from 'clsx';
2
- import type { ReactNode } from 'react';
3
- import styled from 'styled-components';
4
-
5
- import { theme } from '../../design_system/theme.js';
6
- import { Badge } from '../badge.js';
7
-
8
- const classNames = {
9
- ROOT: 'browser-window',
10
- HEADER: 'browser-window__header',
11
- DOTS: 'browser-window__dots',
12
- DOT: 'browser-window__dot',
13
- URL: 'browser-window__url',
14
- TITLE: 'browser-window__title',
15
- CONTAINER: 'browser-window__container',
16
- CONTENT: 'browser-window__content',
17
- } as const;
18
-
19
- export { classNames as browserWindowClassNames };
20
-
21
- const BrowserWindowWrapper = styled.div`
22
- border: 1px solid ${theme.color.neutral.separatorSubtle};
23
- border-radius: ${theme.radius.radius12};
24
- background-color: ${theme.color.neutral.background};
25
- overflow: hidden;
26
-
27
- .${classNames.HEADER} {
28
- display: flex;
29
- align-items: center;
30
- gap: ${theme.space.space8};
31
- padding: ${theme.space.space6} ${theme.space.space8};
32
- border-bottom: 1px solid ${theme.color.neutral.separatorSubtle};
33
- background-color: ${theme.color.neutral.backgroundMuted};
34
- }
35
-
36
- .${classNames.DOTS} {
37
- display: flex;
38
- gap: 0.3rem;
39
- flex-shrink: 0;
40
- }
41
-
42
- .${classNames.DOT} {
43
- width: 0.6rem;
44
- height: 0.6rem;
45
- border-radius: 50%;
46
- background-color: ${theme.color.neutral.separatorSubtle};
47
- }
48
-
49
- .${classNames.URL} {
50
- width: 100%;
51
- min-width: 0;
52
- justify-content: flex-start;
53
- color: ${theme.color.neutral.textSubtle};
54
-
55
- span {
56
- min-width: 0;
57
- text-overflow: ellipsis;
58
- white-space: nowrap;
59
- overflow: hidden;
60
- }
61
- }
62
-
63
- .${classNames.TITLE} {
64
- margin-left: auto;
65
- flex-shrink: 0;
66
- }
67
-
68
- .${classNames.CONTAINER} {
69
- min-width: 0;
70
- overflow-x: auto;
71
- }
72
- `;
73
-
74
- type Props = {
75
- title: string;
76
- url?: ReactNode;
77
- children: ReactNode;
78
- className?: string;
79
- };
80
-
81
- export const BrowserWindow = ({ title, url, children, className }: Props) => {
82
- return (
83
- <BrowserWindowWrapper className={clsx(classNames.ROOT, className)}>
84
- <div className={classNames.HEADER}>
85
- {url && (
86
- <>
87
- <div className={classNames.DOTS}>
88
- <span className={classNames.DOT} />
89
- <span className={classNames.DOT} />
90
- <span className={classNames.DOT} />
91
- </div>
92
- <Badge size="extra_small" variant="neutral_subtle" className={classNames.URL}>
93
- {url}
94
- </Badge>
95
- </>
96
- )}
97
- <Badge size="extra_small" className={classNames.TITLE}>
98
- {title}
99
- </Badge>
100
- </div>
101
- <div className={classNames.CONTAINER}>
102
- <div className={classNames.CONTENT}>{children}</div>
103
- </div>
104
- </BrowserWindowWrapper>
105
- );
106
- };
@@ -1 +0,0 @@
1
- export * from './browser_window.js';