Skip to content

Commit 9c64daf

Browse files
authored
[docs-app] Move examples to individual modules (#7538)
1 parent a4bf4a0 commit 9c64daf

File tree

192 files changed

+3049
-1242
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+3049
-1242
lines changed

.prettierrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
"tabWidth": 2,
1717
"printWidth": 100
1818
}
19+
},
20+
{
21+
"files": ["packages/docs-app/src/examples/**/*.tsx"],
22+
"options": {
23+
"printWidth": 100
24+
}
1925
}
2026
]
2127
}

packages/docs-app/eslint.config.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
const config = require("../../eslint.config.js");
1+
/* !
2+
* (c) Copyright 2025 Palantir Technologies Inc. All rights reserved.
3+
*/
4+
25
const tseslint = require("typescript-eslint");
36

7+
const config = require("../../eslint.config.js");
8+
49
module.exports = tseslint.config([
510
config,
611
{
@@ -9,4 +14,13 @@ module.exports = tseslint.config([
914
"react/jsx-no-bind": "off",
1015
},
1116
},
17+
{
18+
files: ["**/examples/**/*.{ts,tsx}"],
19+
rules: {
20+
"@typescript-eslint/no-deprecated": "off",
21+
"header/header": "off",
22+
"import/no-default-export": "off",
23+
"no-console": "off",
24+
},
25+
},
1226
]);

packages/docs-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"copy-webpack-plugin": "^12.0.2",
5252
"monaco-editor-webpack-plugin": "^7.1.0",
5353
"npm-run-all": "^4.1.5",
54+
"raw-loader": "^4.0.2",
5455
"webpack-cli": "^5.1.4",
5556
"webpack-dev-server": "^4.15.1"
5657
},

packages/docs-app/src/examples/core-examples/alertExample.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ const FileErrorAlert: React.FC<AlertExampleProps> = ({
110110
onClose={handleClose}
111111
>
112112
<p>
113-
Couldn't create the file because the containing folder doesn't exist anymore. You will be redirected
114-
to your user folder.
113+
Couldn't create the file because the containing folder doesn't exist anymore.
114+
You will be redirected to your user folder.
115115
</p>
116116
</Alert>
117117
</>
@@ -164,8 +164,8 @@ const FileDeletionAlert: React.FC<AlertExampleProps> = ({
164164
onConfirm={handleConfirm}
165165
>
166166
<p>
167-
Are you sure you want to move <b>filename</b> to Trash? You will be able to restore it later, but it
168-
will become private to you.
167+
Are you sure you want to move <b>filename</b> to Trash? You will be able to
168+
restore it later, but it will become private to you.
169169
</p>
170170
</Alert>
171171
</>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Breadcrumbs } from "@blueprintjs/core";
2+
3+
export default function BreadcrumbsBasic() {
4+
return (
5+
<div>
6+
<Breadcrumbs
7+
items={[
8+
{ text: "Blueprint" },
9+
{ text: "Docs" },
10+
{ text: "Components" },
11+
{ text: "Breadcrumbs" },
12+
]}
13+
/>
14+
</div>
15+
);
16+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Breadcrumbs
2+
items={[
3+
{ text: "Blueprint" },
4+
{ text: "Docs" },
5+
{ text: "Components" },
6+
{ text: "Breadcrumbs" },
7+
]}
8+
/>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Breadcrumbs } from "@blueprintjs/core";
2+
3+
export default function BreadcrumbsOverflow() {
4+
return (
5+
<div>
6+
<Breadcrumbs
7+
items={[
8+
{ text: "All files" },
9+
{ text: "Users" },
10+
{ text: "Janet" },
11+
{ text: "Photos" },
12+
{ text: "Wednesday" },
13+
{ current: true, text: "image.jpg" },
14+
]}
15+
minVisibleItems={3}
16+
/>
17+
</div>
18+
);
19+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Breadcrumbs
2+
items={[
3+
{ text: "All files" },
4+
{ text: "Users" },
5+
{ text: "Janet" },
6+
{ text: "Photos" },
7+
{ text: "Wednesday" },
8+
{ current: true, text: "image.jpg" },
9+
]}
10+
minVisibleItems={3}
11+
/>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Breadcrumb, Breadcrumbs, Icon } from "@blueprintjs/core";
2+
3+
export default function BreadcrumbsRenderer() {
4+
return (
5+
<Breadcrumbs
6+
currentBreadcrumbRenderer={({ text, ...rest }) => (
7+
<Breadcrumb {...rest}>
8+
{text}&nbsp;
9+
<Icon icon="star" />
10+
</Breadcrumb>
11+
)}
12+
items={[
13+
{ href: "/users", icon: "folder-close", text: "Users" },
14+
{ href: "/users/janet", icon: "folder-close", text: "Janet" },
15+
{ icon: "document", text: "image.jpg" },
16+
]}
17+
/>
18+
);
19+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Breadcrumbs
2+
currentBreadcrumbRenderer={({ text, ...rest }) => (
3+
<Breadcrumb {...rest}>
4+
{text}&nbsp;
5+
<Icon icon="star" />
6+
</Breadcrumb>
7+
)}
8+
items={[
9+
{ href: "/users", icon: "folder-close", text: "Users" },
10+
{ href: "/users/janet", icon: "folder-close", text: "Janet" },
11+
{ icon: "document", text: "image.jpg" },
12+
]}
13+
/>

0 commit comments

Comments
 (0)