@apify/ui-library 1.171.1 → 1.171.2-uilibraryversion2candida-85b55e.45
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/MIGRATION.md +5 -0
- package/README.md +1 -1
- package/dist/components/code/code_block/code_block.d.ts +1 -3
- package/dist/components/code/code_block/code_block.d.ts.map +1 -1
- package/dist/components/code/code_block/code_block.js +1 -7
- package/dist/components/code/code_block/code_block.styled.d.ts +0 -1
- package/dist/components/code/code_block/code_block.styled.d.ts.map +1 -1
- package/dist/components/code/code_block/code_block.styled.js +0 -10
- package/dist/components/code/inline_code/inline_code.d.ts.map +1 -1
- package/dist/components/index.d.ts +0 -3
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/simple_markdown/simple_markdown.d.ts.map +1 -1
- package/dist/components/simple_markdown/simple_markdown.js +1 -1
- package/dist/components/simple_markdown/simple_markdown_components.d.ts +5 -2
- package/dist/components/simple_markdown/simple_markdown_components.d.ts.map +1 -1
- package/dist/components/simple_markdown/simple_markdown_components.js +2 -3
- package/dist/components/tag/tag.d.ts +1 -1
- package/dist/components/tag/tag.d.ts.map +1 -1
- package/dist/components/text/index.d.ts +0 -1
- package/dist/components/text/index.d.ts.map +1 -1
- package/dist/components/text/text_content.d.ts +1 -1
- package/dist/components/text/text_content.js +1 -1
- package/dist/files_hash_at_build.txt +1 -1
- package/dist/index.js +1 -5
- package/dist/src/components/code/code_block/code_block.d.ts +1 -3
- package/dist/src/components/code/code_block/code_block.d.ts.map +1 -1
- package/dist/src/components/code/code_block/code_block.js +2 -3
- package/dist/src/components/code/code_block/code_block.js.map +1 -1
- package/dist/src/components/code/code_block/code_block.styled.d.ts +0 -1
- package/dist/src/components/code/code_block/code_block.styled.d.ts.map +1 -1
- package/dist/src/components/code/code_block/code_block.styled.js +0 -10
- package/dist/src/components/code/code_block/code_block.styled.js.map +1 -1
- package/dist/src/components/code/inline_code/inline_code.d.ts.map +1 -1
- package/dist/src/components/code/inline_code/inline_code.js +0 -1
- package/dist/src/components/code/inline_code/inline_code.js.map +1 -1
- package/dist/src/components/index.d.ts +0 -3
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/components/index.js +0 -3
- package/dist/src/components/index.js.map +1 -1
- package/dist/src/components/simple_markdown/simple_markdown.d.ts.map +1 -1
- package/dist/src/components/simple_markdown/simple_markdown.js +2 -1
- package/dist/src/components/simple_markdown/simple_markdown.js.map +1 -1
- package/dist/src/components/simple_markdown/simple_markdown_components.d.ts +5 -4
- package/dist/src/components/simple_markdown/simple_markdown_components.d.ts.map +1 -1
- package/dist/src/components/simple_markdown/simple_markdown_components.js +4 -4
- package/dist/src/components/simple_markdown/simple_markdown_components.js.map +1 -1
- package/dist/src/components/tag/tag.d.ts +1 -1
- package/dist/src/components/tag/tag.d.ts.map +1 -1
- package/dist/src/components/text/index.d.ts +0 -1
- package/dist/src/components/text/index.d.ts.map +1 -1
- package/dist/src/components/text/index.js +0 -1
- package/dist/src/components/text/index.js.map +1 -1
- package/dist/src/components/text/text_content.d.ts +1 -1
- package/dist/src/components/text/text_content.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/migration-guides/v1-to-v2.md +153 -0
- package/package.json +5 -3
- package/src/components/code/code_block/code_block.stories.jsx +6 -13
- package/src/components/code/code_block/code_block.styled.tsx +0 -11
- package/src/components/code/code_block/code_block.tsx +0 -8
- package/src/components/code/inline_code/inline_code.tsx +0 -1
- package/src/components/index.ts +0 -3
- package/src/components/simple_markdown/simple_markdown.tsx +2 -1
- package/src/components/simple_markdown/simple_markdown_components.tsx +8 -14
- package/src/components/tag/tag.tsx +1 -1
- package/src/components/text/index.ts +0 -1
- package/src/components/text/text_content.tsx +1 -1
- package/src/migration_guides/v1_to_v2.mdx +7 -0
- package/dist/components/banner/banner.d.ts +0 -11
- package/dist/components/banner/banner.d.ts.map +0 -1
- package/dist/components/banner/banner.js +0 -76
- package/dist/components/banner/index.d.ts +0 -2
- package/dist/components/banner/index.d.ts.map +0 -1
- package/dist/components/chip/chip.d.ts +0 -55
- package/dist/components/chip/chip.d.ts.map +0 -1
- package/dist/components/chip/chip.js +0 -144
- package/dist/components/chip/index.d.ts +0 -2
- package/dist/components/chip/index.d.ts.map +0 -1
- package/dist/components/color_wheel_gradient/color_wheel_gradient.d.ts +0 -9
- package/dist/components/color_wheel_gradient/color_wheel_gradient.d.ts.map +0 -1
- package/dist/components/color_wheel_gradient/color_wheel_gradient.js +0 -27
- package/dist/components/color_wheel_gradient/index.d.ts +0 -2
- package/dist/components/color_wheel_gradient/index.d.ts.map +0 -1
- package/dist/src/components/banner/banner.d.ts +0 -11
- package/dist/src/components/banner/banner.d.ts.map +0 -1
- package/dist/src/components/banner/banner.js +0 -70
- package/dist/src/components/banner/banner.js.map +0 -1
- package/dist/src/components/banner/index.d.ts +0 -2
- package/dist/src/components/banner/index.d.ts.map +0 -1
- package/dist/src/components/banner/index.js +0 -2
- package/dist/src/components/banner/index.js.map +0 -1
- package/dist/src/components/chip/chip.d.ts +0 -56
- package/dist/src/components/chip/chip.d.ts.map +0 -1
- package/dist/src/components/chip/chip.js +0 -123
- package/dist/src/components/chip/chip.js.map +0 -1
- package/dist/src/components/chip/index.d.ts +0 -2
- package/dist/src/components/chip/index.d.ts.map +0 -1
- package/dist/src/components/chip/index.js +0 -2
- package/dist/src/components/chip/index.js.map +0 -1
- package/dist/src/components/color_wheel_gradient/color_wheel_gradient.d.ts +0 -9
- package/dist/src/components/color_wheel_gradient/color_wheel_gradient.d.ts.map +0 -1
- package/dist/src/components/color_wheel_gradient/color_wheel_gradient.js +0 -25
- package/dist/src/components/color_wheel_gradient/color_wheel_gradient.js.map +0 -1
- package/dist/src/components/color_wheel_gradient/index.d.ts +0 -2
- package/dist/src/components/color_wheel_gradient/index.d.ts.map +0 -1
- package/dist/src/components/color_wheel_gradient/index.js +0 -2
- package/dist/src/components/color_wheel_gradient/index.js.map +0 -1
- package/src/components/banner/banner.stories.tsx +0 -238
- package/src/components/banner/banner.tsx +0 -91
- package/src/components/banner/index.ts +0 -1
- package/src/components/chip/chip.stories.tsx +0 -311
- package/src/components/chip/chip.tsx +0 -167
- package/src/components/chip/index.ts +0 -1
- package/src/components/color_wheel_gradient/color_wheel_gradient.stories.tsx +0 -152
- package/src/components/color_wheel_gradient/color_wheel_gradient.tsx +0 -33
- package/src/components/color_wheel_gradient/index.ts +0 -1
- package/src/components/text/text_content.stories.tsx +0 -194
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# Migrating `@apify/ui-library` from v1 to v2
|
|
2
|
+
|
|
3
|
+
v2 drops deprecated components and tightens the public API. This guide lists each breaking change and how to migrate.
|
|
4
|
+
|
|
5
|
+
> **Scope:** every breaking change in the v2 candidate, verified against `develop`. The v2 major is the deprecated-component cleanup: it drops public exports that cannot be removed in a minor. The typography and theming rework already shipped in v1, so it is not a v2 change.
|
|
6
|
+
|
|
7
|
+
## At a glance
|
|
8
|
+
|
|
9
|
+
| v1 | v2 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| `Chip` and its variants | `Badge` (static) or `Tag` (clickable) |
|
|
12
|
+
| `Banner` | removed, no replacement |
|
|
13
|
+
| `ColorWheelGradient` | removed, no replacement |
|
|
14
|
+
| `CodeBlock` `showGradient` / `gradientRotation` props | removed |
|
|
15
|
+
| `TextContent` | `Text` |
|
|
16
|
+
| `ActorAvatar`, `UserAvatar`, `StoreActorHeader`, `BlogArticle`, `HorizontalTile`, `VerticalTile` (from `@apify-packages/ui-components`) | import them from `@apify/ui-library` |
|
|
17
|
+
| `StoreSearchActorItem` (from `@apify-packages/ui-components`) | `<StoreActorHeader compact />` |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## `Chip` → `Badge` / `Tag`
|
|
22
|
+
|
|
23
|
+
`Chip` and every helper are removed. Rule of thumb: **`Badge`** for static labels and statuses, **`Tag`** for anything clickable (it renders a `button`, or a `Link` with `as="a"`, and has hover styles built in).
|
|
24
|
+
|
|
25
|
+
### Removed exports
|
|
26
|
+
|
|
27
|
+
| Removed export | Kind | Static → `Badge` | Clickable → `Tag` |
|
|
28
|
+
| --- | --- | --- | --- |
|
|
29
|
+
| `Chip` | component | `<Badge variant="…">` | `<Tag variant="…">` |
|
|
30
|
+
| `NeutralChip` | component | `<Badge variant="neutral_muted">` | `<Tag variant="subtle">` |
|
|
31
|
+
| `PrimaryChip` | component | `<Badge variant="primary_blue">` | `<Tag variant="accent">` |
|
|
32
|
+
| `SuccessChip` | component | `<Badge variant="success">` | `<Tag variant="success">` |
|
|
33
|
+
| `WarningChip` | component | `<Badge variant="warning">` | `<Tag variant="warning">` |
|
|
34
|
+
| `DangerChip` | component | `<Badge variant="danger">` | `<Tag variant="error">` |
|
|
35
|
+
| `CHIP_TYPES` | const | `BADGE_VARIANTS` | `TAG_VARIANTS` |
|
|
36
|
+
| `CHIP_TYPES` | type | `BadgeVariant` | `TagVariant` |
|
|
37
|
+
| `CHIP_SIZES` | const | `BADGE_SIZES` | `TAG_SIZES` |
|
|
38
|
+
| `ChipProps` | type | `BadgeProps` | `TagProps<'button'>` / `TagProps<'a'>` |
|
|
39
|
+
| `classNames` (`{ BODY: 'Chip-body' }`) | const | none, pass your own `className` | none, pass your own `className` |
|
|
40
|
+
|
|
41
|
+
`CHIP_TYPES` and `CHIP_SIZES` were objects; `BADGE_*` / `TAG_*` are arrays of string literals, so `CHIP_TYPES.SUCCESS` becomes the plain string `variant="success"`. `CHIP_SIZES` had no exported type; use `BadgeSize` / `TagSize`.
|
|
42
|
+
|
|
43
|
+
A `clickable` chip, or one with an `onClick`, becomes a `Tag`: `Badge` accepts neither, so keeping it on `Badge` is a type error. The `icon` prop (an element rendered after the text) becomes `TrailingIcon={Icon}` on `Badge` or `Tag`, which takes the icon component, not an element.
|
|
44
|
+
|
|
45
|
+
### Sizes
|
|
46
|
+
|
|
47
|
+
`Chip` defaulted to `M` (14px text), while `Badge` and `Tag` both default to `small` (12px), so a chip without a `size` silently shrinks. Set the size explicitly and check padding and height by eye, since those differ too.
|
|
48
|
+
|
|
49
|
+
| `Chip` size | Text | `Badge` size | `Tag` size |
|
|
50
|
+
| --- | --- | --- | --- |
|
|
51
|
+
| `XS` | 12px | `extra_small` | `small` |
|
|
52
|
+
| `S` | 12px | `small` | `small` |
|
|
53
|
+
| `M` (default) | 14px | `large` | none (`Tag` has no 14px size) |
|
|
54
|
+
| `L` | 16px | none (closest is `large`, 14px) | `big` |
|
|
55
|
+
|
|
56
|
+
### Type → variant
|
|
57
|
+
|
|
58
|
+
| `Chip` type / shorthand | `Badge` variant | `Tag` variant |
|
|
59
|
+
| --- | --- | --- |
|
|
60
|
+
| `DEFAULT` / `NeutralChip` | `neutral_muted` | `subtle` |
|
|
61
|
+
| `PRIMARY` / `PrimaryChip` | `primary_blue` | `accent` |
|
|
62
|
+
| `SUCCESS` / `SuccessChip` | `success` | `success` |
|
|
63
|
+
| `WARNING` / `WarningChip` | `warning` | `warning` |
|
|
64
|
+
| `DANGER` / `DangerChip` | `danger` | `error` |
|
|
65
|
+
|
|
66
|
+
```diff
|
|
67
|
+
- import { Chip, CHIP_TYPES } from '@apify/ui-library';
|
|
68
|
+
- <Chip type={CHIP_TYPES.SUCCESS}>Published</Chip>
|
|
69
|
+
+ import { Badge } from '@apify/ui-library';
|
|
70
|
+
+ <Badge variant="success">Published</Badge>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## `Banner` → removed
|
|
76
|
+
|
|
77
|
+
`Banner` was a decorative container with no remaining usage in apify-core. It is removed with no replacement. To keep the look, wrap the content in a container with a `theme.color.neutral.backgroundSubtle` background, `space40` vertical and `space80` horizontal padding, and `radius16` corners (the optional gradient background is gone).
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## `ColorWheelGradient` → removed
|
|
82
|
+
|
|
83
|
+
The decorative color-wheel gradient is removed with no replacement. `CodeBlock` also drops the related props: remove `showGradient` and `gradientRotation` from any `<CodeBlock>` usage (the `.CodeBlock-Gradient` styling is gone).
|
|
84
|
+
|
|
85
|
+
```diff
|
|
86
|
+
- <CodeBlock showGradient gradientRotation={45} language="js">{code}</CodeBlock>
|
|
87
|
+
+ <CodeBlock language="js">{code}</CodeBlock>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## `TextContent` → `Text`
|
|
93
|
+
|
|
94
|
+
`TextContent` and its types (`ContentTextProps`, `ContentTextType`, `ContentTextWeight`, `TransientContentTextProps`) are no longer exported. Use `Text`. It renders the same zero-margin `p` and takes the same spacing props; only the typography props change.
|
|
95
|
+
|
|
96
|
+
| `TextContent` | `Text` |
|
|
97
|
+
| --- | --- |
|
|
98
|
+
| `type="paragraph"` (default) | `size="big"`. The `Text` default is `regular` (14px); `big` keeps 16px |
|
|
99
|
+
| `type="snippet"` | `type="code"` (14px in both, no `size` needed) |
|
|
100
|
+
| `weight="bold"` | `weight="bold"` (600 instead of 700) |
|
|
101
|
+
| `ContentTextProps` | `SharedTextProps` |
|
|
102
|
+
| `ContentTextType` | `SharedTextType` (`'body' \| 'code'`) |
|
|
103
|
+
| `ContentTextWeight` | `SharedTextProps['weight']` |
|
|
104
|
+
| `TransientContentTextProps` | derive from `SharedTextProps` |
|
|
105
|
+
|
|
106
|
+
```diff
|
|
107
|
+
- <TextContent my="space16">{children}</TextContent>
|
|
108
|
+
+ <Text size="big" my="space16">{children}</Text>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
> If you rendered markdown through `MarkdownParagraphContent`: it now takes only `children` and `node`, and no longer accepts the `ContentTextProps` (`type`, `weight`, spacing, `className`). Render the paragraph with `Text` yourself if you need those. YouTube/Vimeo embed detection is now internal.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Components moved out of `@apify-packages/ui-components`
|
|
116
|
+
|
|
117
|
+
> This section matters only if you consume the internal `@apify-packages/ui-components` package. Public `@apify/ui-library` consumers are not affected.
|
|
118
|
+
|
|
119
|
+
v2 removes the duplicated and deprecated components from `@apify-packages/ui-components`. They all live in `@apify/ui-library` now (same components, same props). Change the import:
|
|
120
|
+
|
|
121
|
+
```diff
|
|
122
|
+
- import { UserAvatar, userAvatarBaseClassNames } from '@apify-packages/ui-components';
|
|
123
|
+
+ import { UserAvatar, userAvatarBaseClassNames } from '@apify/ui-library';
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
The same applies to the rest. Most keep their name; the one exception is the actor avatar class names, renamed from `actorAvatarBaseClassNames` to `actorAvatarClassnames`.
|
|
127
|
+
|
|
128
|
+
| Removed from `@apify-packages/ui-components` | Import from `@apify/ui-library` as |
|
|
129
|
+
| --- | --- |
|
|
130
|
+
| `ActorAvatar` | `ActorAvatar` |
|
|
131
|
+
| `actorAvatarBaseClassNames` | `actorAvatarClassnames` (renamed) |
|
|
132
|
+
| `UserAvatar`, `userAvatarBaseClassNames` | same names |
|
|
133
|
+
| `StoreActorHeader` | `StoreActorHeader` |
|
|
134
|
+
| `BlogArticle` | `BlogArticle` |
|
|
135
|
+
| `HorizontalTile`, `VerticalTile` | same names |
|
|
136
|
+
|
|
137
|
+
`StoreSearchActorItem` was a thin wrapper and is removed without a direct replacement. Render `<StoreActorHeader compact … />` with the same props instead, and use `StoreActorHeaderProps` in place of `StoreSearchActorItemProps`.
|
|
138
|
+
|
|
139
|
+
`Banner` and `ColorWheelGradient` are removed from `@apify-packages/ui-components` too. See the sections above; there is no replacement for either.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Upgrading
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
pnpm add @apify/ui-library@2
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
To try it before the stable release, use the v2 candidate canary tag:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
pnpm add @apify/ui-library@uilibraryversion2candida-85b55e
|
|
153
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apify/ui-library",
|
|
3
|
-
"version": "1.171.
|
|
3
|
+
"version": "1.171.2-uilibraryversion2candida-85b55e.45+922c9253cc5",
|
|
4
4
|
"description": "React UI library used by apify.com",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -92,7 +92,9 @@
|
|
|
92
92
|
"files": [
|
|
93
93
|
"dist",
|
|
94
94
|
"src",
|
|
95
|
-
"style"
|
|
95
|
+
"style",
|
|
96
|
+
"MIGRATION.md",
|
|
97
|
+
"migration-guides"
|
|
96
98
|
],
|
|
97
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "922c9253cc54a575a5101c4b8619c09c7c0e4b06"
|
|
98
100
|
}
|
|
@@ -43,20 +43,13 @@ const Template = ({ content, ...args }) => {
|
|
|
43
43
|
<CodeBlock content={content} {...args} />
|
|
44
44
|
<h2>CodeBlock with title</h2>
|
|
45
45
|
<CodeBlock title="What a code" content={content} {...args} />
|
|
46
|
-
<h2>CodeBlock with
|
|
47
|
-
<CodeBlock
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
showGradient
|
|
51
|
-
showDotsHeader
|
|
52
|
-
showActionButton
|
|
53
|
-
{...args}
|
|
54
|
-
/>
|
|
55
|
-
<h2>CodeBlock with long lines, action and gradient</h2>
|
|
56
|
-
<CodeBlock content={longCode} showGradient showActionButton {...args} />
|
|
46
|
+
<h2>CodeBlock with dots and action</h2>
|
|
47
|
+
<CodeBlock content={content} highlightLines={[2, 3, 7]} showDotsHeader showActionButton {...args} />
|
|
48
|
+
<h2>CodeBlock with long lines and action</h2>
|
|
49
|
+
<CodeBlock content={longCode} showActionButton {...args} />
|
|
57
50
|
|
|
58
|
-
<h2>CodeBlock with multiple long codes, highlighted lines
|
|
59
|
-
<CodeBlock content={multipleLongCodes}
|
|
51
|
+
<h2>CodeBlock with multiple long codes, highlighted lines and action</h2>
|
|
52
|
+
<CodeBlock content={multipleLongCodes} showActionButton {...args} />
|
|
60
53
|
<h2>CodeBlock with multiple codes</h2>
|
|
61
54
|
<CodeBlock content={multipleCodes} {...args} />
|
|
62
55
|
</div>
|
|
@@ -34,7 +34,6 @@ export const SyntaxHighlighterBaseStylesWrapper = styled(Box)<SyntaxHighlighterB
|
|
|
34
34
|
|
|
35
35
|
export const CodeBlockWrapper = styled(SyntaxHighlighterBaseStylesWrapper)<{
|
|
36
36
|
$hasHeader: boolean;
|
|
37
|
-
$gradientRotation?: number;
|
|
38
37
|
$highlightLines?: number[];
|
|
39
38
|
$hasActionButton?: boolean;
|
|
40
39
|
$hasTabs?: boolean;
|
|
@@ -158,16 +157,6 @@ export const CodeBlockWrapper = styled(SyntaxHighlighterBaseStylesWrapper)<{
|
|
|
158
157
|
`}
|
|
159
158
|
}
|
|
160
159
|
|
|
161
|
-
.CodeBlock-Gradient {
|
|
162
|
-
right: 0px;
|
|
163
|
-
bottom: 0px;
|
|
164
|
-
|
|
165
|
-
aspect-ratio: 1/1;
|
|
166
|
-
height: 250%;
|
|
167
|
-
|
|
168
|
-
transform: translate(50%, 70%) rotate(${({ $gradientRotation }) => $gradientRotation ?? 0}deg) scaleX(-1);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
160
|
.CodeBlock-HederDotsWrapper {
|
|
172
161
|
display: flex;
|
|
173
162
|
padding: ${theme.space.space8};
|
|
@@ -3,7 +3,6 @@ import type React from 'react';
|
|
|
3
3
|
import { useMemo, useRef, useState } from 'react';
|
|
4
4
|
|
|
5
5
|
import type { RegularBoxProps } from '../../box';
|
|
6
|
-
import { ColorWheelGradient } from '../../color_wheel_gradient';
|
|
7
6
|
import { Link } from '../../link';
|
|
8
7
|
import { Text } from '../../text';
|
|
9
8
|
import type { SharedTextSize } from '../../text/text_shared';
|
|
@@ -103,8 +102,6 @@ export type CodeBlockProps = RegularBoxProps & {
|
|
|
103
102
|
className?: string;
|
|
104
103
|
hideBashHeader?: boolean;
|
|
105
104
|
onTabChange?: (key: string, e: React.MouseEvent) => Promise<void> | void;
|
|
106
|
-
showGradient?: boolean;
|
|
107
|
-
gradientRotation?: number;
|
|
108
105
|
highlightLines?: number[];
|
|
109
106
|
showActionButton?: boolean;
|
|
110
107
|
actionButtonLabel?: string;
|
|
@@ -126,12 +123,10 @@ export const CodeBlock = ({
|
|
|
126
123
|
highlightLines,
|
|
127
124
|
onTabChange,
|
|
128
125
|
defaultTabKey,
|
|
129
|
-
showGradient,
|
|
130
126
|
hideBashHeader,
|
|
131
127
|
showActionButton,
|
|
132
128
|
fullWidth,
|
|
133
129
|
actionButtonLabel,
|
|
134
|
-
gradientRotation = 340,
|
|
135
130
|
hideLineNumbers,
|
|
136
131
|
fullHeight,
|
|
137
132
|
title,
|
|
@@ -185,7 +180,6 @@ export const CodeBlock = ({
|
|
|
185
180
|
return (
|
|
186
181
|
<CodeBlockWrapper
|
|
187
182
|
$hasHeader={showHeader}
|
|
188
|
-
$gradientRotation={gradientRotation}
|
|
189
183
|
$hasActionButton={showActionButton}
|
|
190
184
|
$hasTabs={isMultiTab}
|
|
191
185
|
$fullWidth={fullWidth}
|
|
@@ -221,8 +215,6 @@ export const CodeBlock = ({
|
|
|
221
215
|
)}
|
|
222
216
|
{!hideCopyButton && <CopyButton code={currentCode} />}
|
|
223
217
|
</div>
|
|
224
|
-
|
|
225
|
-
{showGradient && <ColorWheelGradient className="CodeBlock-Gradient" blurSize={69} />}
|
|
226
218
|
</CodeBlockWrapper>
|
|
227
219
|
);
|
|
228
220
|
};
|
|
@@ -46,7 +46,6 @@ export type InlineCodeProps = RegularBoxProps & {
|
|
|
46
46
|
withCopyButton?: boolean;
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
// This might be just a Chip component
|
|
50
49
|
export const InlineCode: React.FC<InlineCodeProps> = ({ children, size, withCopyButton, ...props }) => (
|
|
51
50
|
<Wrapper {...props}>
|
|
52
51
|
<Text type="code" as="code" size={size}>
|
package/src/components/index.ts
CHANGED
|
@@ -10,7 +10,6 @@ export * from './link';
|
|
|
10
10
|
export * from './action_link';
|
|
11
11
|
export * from './simple_markdown';
|
|
12
12
|
export * from './code';
|
|
13
|
-
export * from './color_wheel_gradient';
|
|
14
13
|
export * from './readme_renderer';
|
|
15
14
|
export * from './card';
|
|
16
15
|
export * from './markdown';
|
|
@@ -18,9 +17,7 @@ export * from './pagination';
|
|
|
18
17
|
export * from './tab_number_chip';
|
|
19
18
|
export * from './tile';
|
|
20
19
|
export * from './blog_article';
|
|
21
|
-
export * from './banner';
|
|
22
20
|
export * from './actor_template_card';
|
|
23
|
-
export * from './chip';
|
|
24
21
|
export * from './image';
|
|
25
22
|
export * from './rating';
|
|
26
23
|
export * from './badge';
|
|
@@ -15,7 +15,8 @@ import { Box } from '../box';
|
|
|
15
15
|
import { Image } from '../image';
|
|
16
16
|
import { isUrlExternal } from '../link';
|
|
17
17
|
import { cleanMarkdown } from '../readme_renderer';
|
|
18
|
-
import { Heading, HeadingContent, Text
|
|
18
|
+
import { Heading, HeadingContent, Text } from '../text';
|
|
19
|
+
import { TextContent } from '../text/text_content';
|
|
19
20
|
import { MarkdownBlockQuote, MarkdownCode, MarkdownLink, MarkdownTable } from './simple_markdown_components';
|
|
20
21
|
|
|
21
22
|
export type SimpleMarkdownComponents = Components;
|
|
@@ -14,10 +14,8 @@ import { CodeBlock, InlineCode, OneLineCode } from '../code';
|
|
|
14
14
|
import type { LinkProps } from '../link';
|
|
15
15
|
import { Link } from '../link';
|
|
16
16
|
import { slugifyHeadingChildren } from '../readme_renderer';
|
|
17
|
-
import type
|
|
18
|
-
import
|
|
19
|
-
import type { SharedTextSize } from '../text';
|
|
20
|
-
import { Heading, TextContent } from '../text';
|
|
17
|
+
import { Heading, type HeadingSharedProps, type SharedTextSize } from '../text';
|
|
18
|
+
import { TextContent } from '../text/text_content';
|
|
21
19
|
|
|
22
20
|
const simpleMarkdownClassNames = {
|
|
23
21
|
HEADING_ICON_LINK: 'headingIconLink',
|
|
@@ -293,20 +291,16 @@ const getMarkdownVideoSrc = (child?: ElementContent): string | undefined => {
|
|
|
293
291
|
};
|
|
294
292
|
|
|
295
293
|
// TODO: This should be used for readmes
|
|
296
|
-
|
|
297
|
-
children
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
}:
|
|
294
|
+
type MarkdownParagraphContentProps = {
|
|
295
|
+
children?: React.ReactNode;
|
|
296
|
+
} & MarkdownComponentExtraProps;
|
|
297
|
+
|
|
298
|
+
export function MarkdownParagraphContent({ children, node }: MarkdownParagraphContentProps): React.ReactNode {
|
|
301
299
|
const child = node?.children[0];
|
|
302
300
|
const videoSrc = getMarkdownVideoSrc(child);
|
|
303
301
|
|
|
304
302
|
if (videoSrc) return <MarkdownVideo src={videoSrc} />;
|
|
305
303
|
|
|
306
304
|
// Render the children as a paragraph
|
|
307
|
-
return
|
|
308
|
-
<TextContent my="space16" {...textProps}>
|
|
309
|
-
{children}
|
|
310
|
-
</TextContent>
|
|
311
|
-
);
|
|
305
|
+
return <TextContent my="space16">{children}</TextContent>;
|
|
312
306
|
}
|
|
@@ -13,7 +13,7 @@ import { Link, type RegularLinkProps } from '../link';
|
|
|
13
13
|
import { Text } from '../text';
|
|
14
14
|
import { type SharedTextSize, type SharedTextType } from '../text';
|
|
15
15
|
|
|
16
|
-
type TagSize = SharedTextSize;
|
|
16
|
+
export type TagSize = SharedTextSize;
|
|
17
17
|
export const TAG_SIZES: TagSize[] = ['big', 'regular', 'small'];
|
|
18
18
|
|
|
19
19
|
const TAG_ICON_SIZES = {
|
|
@@ -3,7 +3,6 @@ import type { SharedTextProps } from './text_shared';
|
|
|
3
3
|
import { SHARED_TEXT_TYPES, TextShared } from './text_shared';
|
|
4
4
|
|
|
5
5
|
export * from './text_base';
|
|
6
|
-
export * from './text_content';
|
|
7
6
|
export * from './text_marketing';
|
|
8
7
|
export * from './heading_content';
|
|
9
8
|
export * from './heading_marketing';
|
|
@@ -80,7 +80,7 @@ const StyledTextContent = styled(TextBaseComponent)<StyledContentTextProps>`
|
|
|
80
80
|
`;
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
|
-
*
|
|
83
|
+
* Internal to SimpleMarkdown, not exported from the package. Use Text elsewhere.
|
|
84
84
|
*/
|
|
85
85
|
export const TextContent = forwardRef<HTMLElement | undefined, ContentTextProps>(
|
|
86
86
|
({ type, weight, as, ...rest }, ref) => {
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
interface BannerProps {
|
|
3
|
-
background?: string;
|
|
4
|
-
useGradientBackground?: boolean;
|
|
5
|
-
width?: string;
|
|
6
|
-
className?: string;
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
}
|
|
9
|
-
export declare const Banner: React.FC<BannerProps>;
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=banner.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../src/components/banner/banner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAoD/B,UAAU,WAAW;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAuBD,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CASxC,CAAC"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { theme } from "../../design_system/theme.js";
|
|
2
|
-
import styled, { css } from "styled-components";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
//#region src/components/banner/banner.tsx
|
|
5
|
-
var BANNER_GRADIENT_BACKGROUND_SVG = `<svg width="1200" height="148" viewBox="0 0 1200 148" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6
|
-
<g clip-path="url(#clip0_2285_34756)">
|
|
7
|
-
<g filter="url(#filter0_f_2285_34756)">
|
|
8
|
-
<path d="M-39.7702 191.085C-55.0622 193.205 -68.8864 201.311 -78.2029 213.621C-87.5194 225.932 -91.5654 241.438 -89.4512 256.731L-55.0077 502.652L89.8852 173L-39.7702 191.085Z" fill="url(#paint0_linear_2285_34756)"/>
|
|
9
|
-
</g>
|
|
10
|
-
<g filter="url(#filter1_f_2285_34756)">
|
|
11
|
-
<path d="M1267.53 398.062L1253.99 209.002C1252.85 193.626 1245.67 179.327 1234.01 169.234C1222.36 159.14 1207.18 154.073 1191.8 155.14C1190.5 155.19 1189.2 155.331 1187.92 155.564L1132 163.289L1254.84 438.685C1264.05 427.236 1268.59 412.721 1267.53 398.062Z" fill="url(#paint1_linear_2285_34756)"/>
|
|
12
|
-
</g>
|
|
13
|
-
<g filter="url(#filter2_f_2285_34756)">
|
|
14
|
-
<path d="M561 29.7691C570.917 30.4746 580.956 29.5571 590.142 27.1057L801.075 -28.7862L700.682 -170L561 29.7691Z" fill="url(#paint2_linear_2285_34756)"/>
|
|
15
|
-
</g>
|
|
16
|
-
</g>
|
|
17
|
-
<defs>
|
|
18
|
-
<filter id="filter0_f_2285_34756" x="-170" y="93" width="339.885" height="489.652" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
19
|
-
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
20
|
-
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
|
21
|
-
<feGaussianBlur stdDeviation="40" result="effect1_foregroundBlur_2285_34756"/>
|
|
22
|
-
</filter>
|
|
23
|
-
<filter id="filter1_f_2285_34756" x="1052" y="75" width="295.683" height="443.686" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
24
|
-
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
25
|
-
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
|
26
|
-
<feGaussianBlur stdDeviation="40" result="effect1_foregroundBlur_2285_34756"/>
|
|
27
|
-
</filter>
|
|
28
|
-
<filter id="filter2_f_2285_34756" x="481" y="-250" width="400.074" height="360" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
29
|
-
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
30
|
-
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
|
|
31
|
-
<feGaussianBlur stdDeviation="40" result="effect1_foregroundBlur_2285_34756"/>
|
|
32
|
-
</filter>
|
|
33
|
-
<linearGradient id="paint0_linear_2285_34756" x1="-0.0574112" y1="173" x2="-0.0574112" y2="502.652" gradientUnits="userSpaceOnUse">
|
|
34
|
-
<stop stop-color="#00FF85"/>
|
|
35
|
-
<stop offset="1" stop-color="#00FF47" stop-opacity="0"/>
|
|
36
|
-
</linearGradient>
|
|
37
|
-
<linearGradient id="paint1_linear_2285_34756" x1="1146.02" y1="174.549" x2="1333.1" y2="293.915" gradientUnits="userSpaceOnUse">
|
|
38
|
-
<stop stop-color="#00FFF0"/>
|
|
39
|
-
<stop offset="1" stop-color="#1672EB"/>
|
|
40
|
-
</linearGradient>
|
|
41
|
-
<linearGradient id="paint2_linear_2285_34756" x1="681.037" y1="-170" x2="681.037" y2="30" gradientUnits="userSpaceOnUse">
|
|
42
|
-
<stop stop-color="#F5B315"/>
|
|
43
|
-
<stop offset="1" stop-color="#FF2CC4"/>
|
|
44
|
-
</linearGradient>
|
|
45
|
-
<clipPath id="clip0_2285_34756">
|
|
46
|
-
<rect width="1200" height="1791.08" rx="16" fill="white"/>
|
|
47
|
-
</clipPath>
|
|
48
|
-
</defs>
|
|
49
|
-
</svg>
|
|
50
|
-
`;
|
|
51
|
-
var getBannerBackground = (background, useGradientBackground) => {
|
|
52
|
-
return css`
|
|
53
|
-
background-color: ${background || theme.color.neutral.backgroundSubtle};
|
|
54
|
-
${useGradientBackground && `
|
|
55
|
-
background-image: url("data:image/svg+xml,${encodeURIComponent(BANNER_GRADIENT_BACKGROUND_SVG)}");
|
|
56
|
-
background-position: center;
|
|
57
|
-
background-repeat: no-repeat;
|
|
58
|
-
background-size: cover;
|
|
59
|
-
`}
|
|
60
|
-
`;
|
|
61
|
-
};
|
|
62
|
-
var StyledBanner = styled.div`
|
|
63
|
-
width: ${(props) => props.width || "100%"};
|
|
64
|
-
padding: ${theme.space.space40} ${theme.space.space80};
|
|
65
|
-
border-radius: ${theme.radius.radius16};
|
|
66
|
-
|
|
67
|
-
${({ $background, $useGradientBackground }) => getBannerBackground($background, $useGradientBackground)};
|
|
68
|
-
`;
|
|
69
|
-
var Banner = ({ useGradientBackground = true, background, children, ...otherProps }) => /* @__PURE__ */ jsx(StyledBanner, {
|
|
70
|
-
$background: background,
|
|
71
|
-
$useGradientBackground: useGradientBackground,
|
|
72
|
-
...otherProps,
|
|
73
|
-
children
|
|
74
|
-
});
|
|
75
|
-
//#endregion
|
|
76
|
-
export { Banner };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/banner/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { FC, default as React } from 'react';
|
|
2
|
-
import { ValueOf } from '../../internal_type_utils';
|
|
3
|
-
import { RegularBoxProps } from '../box';
|
|
4
|
-
export declare const CHIP_SIZES: {
|
|
5
|
-
readonly EXTRA_SMALL: "XS";
|
|
6
|
-
readonly SMALL: "S";
|
|
7
|
-
readonly MEDIUM: "M";
|
|
8
|
-
readonly LARGE: "L";
|
|
9
|
-
};
|
|
10
|
-
type CHIP_SIZES = ValueOf<typeof CHIP_SIZES>;
|
|
11
|
-
export declare const CHIP_TYPES: {
|
|
12
|
-
readonly DEFAULT: "DEFAULT";
|
|
13
|
-
readonly PRIMARY: "PRIMARY";
|
|
14
|
-
readonly SUCCESS: "SUCCESS";
|
|
15
|
-
readonly WARNING: "WARNING";
|
|
16
|
-
readonly DANGER: "DANGER";
|
|
17
|
-
};
|
|
18
|
-
export type CHIP_TYPES = ValueOf<typeof CHIP_TYPES>;
|
|
19
|
-
export declare const classNames: {
|
|
20
|
-
BODY: string;
|
|
21
|
-
};
|
|
22
|
-
export type ChipProps = RegularBoxProps & {
|
|
23
|
-
type?: CHIP_TYPES;
|
|
24
|
-
size?: CHIP_SIZES;
|
|
25
|
-
icon?: React.ReactNode;
|
|
26
|
-
clickable?: boolean;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Component for displaying status and for labelling other components.
|
|
30
|
-
* @deprecated Use Tag or Badge
|
|
31
|
-
*/
|
|
32
|
-
export declare const Chip: React.ForwardRefExoticComponent<{
|
|
33
|
-
children?: React.ReactNode;
|
|
34
|
-
className?: string;
|
|
35
|
-
style?: React.CSSProperties;
|
|
36
|
-
onClick?: (e: React.MouseEvent) => void;
|
|
37
|
-
id?: string;
|
|
38
|
-
title?: string;
|
|
39
|
-
role?: React.AriaRole;
|
|
40
|
-
} & {
|
|
41
|
-
as?: React.ElementType;
|
|
42
|
-
} & {
|
|
43
|
-
type?: CHIP_TYPES;
|
|
44
|
-
size?: CHIP_SIZES;
|
|
45
|
-
icon?: React.ReactNode;
|
|
46
|
-
clickable?: boolean;
|
|
47
|
-
} & React.RefAttributes<unknown>>;
|
|
48
|
-
type SpecificChipProps = Omit<ChipProps, 'type'>;
|
|
49
|
-
export declare const PrimaryChip: FC<SpecificChipProps>;
|
|
50
|
-
export declare const NeutralChip: FC<SpecificChipProps>;
|
|
51
|
-
export declare const SuccessChip: FC<SpecificChipProps>;
|
|
52
|
-
export declare const DangerChip: FC<SpecificChipProps>;
|
|
53
|
-
export declare const WarningChip: FC<SpecificChipProps>;
|
|
54
|
-
export {};
|
|
55
|
-
//# sourceMappingURL=chip.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chip.d.ts","sourceRoot":"","sources":["../../../src/components/chip/chip.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAE9C,eAAO,MAAM,UAAU;;;;;CAKb,CAAC;AACX,KAAK,UAAU,GAAG,OAAO,CAAC,OAAO,UAAU,CAAC,CAAC;AAE7C,eAAO,MAAM,UAAU;;;;;;CAMb,CAAC;AACX,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,eAAO,MAAM,UAAU;;CAEtB,CAAC;AA8FF,MAAM,MAAM,SAAS,GAAG,eAAe,GAAG;IACtC,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;WAVN,UAAU;WACV,UAAU;WACV,KAAK,CAAC,SAAS;gBACV,OAAO;iCA6BtB,CAAC;AAIF,KAAK,iBAAiB,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AAEjD,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,iBAAiB,CAA4D,CAAC;AAC3G,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,iBAAiB,CAA4D,CAAC;AAC3G,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,iBAAiB,CAA4D,CAAC;AAC3G,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,iBAAiB,CAA2D,CAAC;AACzG,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,iBAAiB,CAA4D,CAAC"}
|