shapes-ui 0.1.1
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/.changeset/README.md +8 -0
- package/.changeset/config.json +11 -0
- package/.cta.json +12 -0
- package/.github/workflows/release.yml +44 -0
- package/.oxfmtrc.json +21 -0
- package/.oxlintrc.json +40 -0
- package/.vscode/settings.json +11 -0
- package/CHANGELOG.md +22 -0
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/content/components/accordion.mdx +41 -0
- package/content/components/alert-dialog.mdx +25 -0
- package/content/components/alert.mdx +53 -0
- package/content/components/badge.mdx +27 -0
- package/content/components/button.mdx +55 -0
- package/content-collections.ts +67 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +15255 -0
- package/dist/client/.assetsignore +2 -0
- package/dist/server/.vite/manifest.json +2435 -0
- package/examples/__index.tsx +201 -0
- package/examples/accordion-demo.tsx +30 -0
- package/examples/accordion-icon.tsx +40 -0
- package/examples/accordion-multiple.tsx +27 -0
- package/examples/accordion-small.tsx +30 -0
- package/examples/accordion-surface.tsx +30 -0
- package/examples/alert-action.tsx +18 -0
- package/examples/alert-demo.tsx +10 -0
- package/examples/alert-description.tsx +16 -0
- package/examples/alert-destructive.tsx +13 -0
- package/examples/alert-dialog-demo.tsx +33 -0
- package/examples/alert-dialog-destructive.tsx +33 -0
- package/examples/alert-dialog-icon.tsx +38 -0
- package/examples/alert-info.tsx +13 -0
- package/examples/alert-link.tsx +21 -0
- package/examples/alert-success.tsx +13 -0
- package/examples/alert-title.tsx +12 -0
- package/examples/alert-warning.tsx +13 -0
- package/examples/badge-demo.tsx +5 -0
- package/examples/badge-status-icon.tsx +26 -0
- package/examples/badge-status.tsx +12 -0
- package/examples/badge-variants.tsx +12 -0
- package/examples/button-default.tsx +15 -0
- package/examples/button-demo.tsx +14 -0
- package/examples/button-destructive.tsx +15 -0
- package/examples/button-ghost.tsx +15 -0
- package/examples/button-info.tsx +15 -0
- package/examples/button-link.tsx +15 -0
- package/examples/button-loading.tsx +14 -0
- package/examples/button-outline.tsx +15 -0
- package/examples/button-sizes.tsx +34 -0
- package/examples/button-success.tsx +15 -0
- package/examples/button-warning.tsx +15 -0
- package/package.json +81 -0
- package/public/apple-touch-icon.png +0 -0
- package/public/circuit-board.svg +1 -0
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/favicon.svg +3 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/r/accordion.json +16 -0
- package/public/r/alert-dialog.json +17 -0
- package/public/r/alert.json +15 -0
- package/public/r/badge.json +15 -0
- package/public/r/button.json +16 -0
- package/public/r/index.json +7 -0
- package/public/robots.txt +3 -0
- package/public/shps_black.png +0 -0
- package/public/shps_black.svg +3 -0
- package/public/shps_white.png +0 -0
- package/public/shps_white.svg +3 -0
- package/scripts/generate-examples.mts +118 -0
- package/scripts/generate-registry.mts +129 -0
- package/src/commands/add.ts +125 -0
- package/src/commands/cli.ts +27 -0
- package/src/commands/init.ts +128 -0
- package/src/components/docs/docs-button.tsx +60 -0
- package/src/components/docs/layout/circuit-board.tsx +22 -0
- package/src/components/docs/layout/footer.tsx +11 -0
- package/src/components/docs/layout/header.tsx +49 -0
- package/src/components/docs/layout/mobile-menu.tsx +86 -0
- package/src/components/docs/layout/nav-list.tsx +43 -0
- package/src/components/docs/layout/page-header.tsx +33 -0
- package/src/components/docs/layout/split-layout.tsx +21 -0
- package/src/components/docs/layout/suspense-fallback.tsx +12 -0
- package/src/components/docs/markdown/components.tsx +324 -0
- package/src/components/docs/markdown/installation-block.tsx +146 -0
- package/src/components/docs/markdown/render-preview.tsx +152 -0
- package/src/components/docs/theme-provider.tsx +48 -0
- package/src/components/ui/accordion.tsx +83 -0
- package/src/components/ui/alert-dialog.tsx +162 -0
- package/src/components/ui/alert.tsx +72 -0
- package/src/components/ui/badge.tsx +34 -0
- package/src/components/ui/button.tsx +64 -0
- package/src/lib/utils.ts +6 -0
- package/src/routeTree.gen.ts +131 -0
- package/src/router.tsx +17 -0
- package/src/routes/__root.tsx +72 -0
- package/src/routes/components.$slug.tsx +62 -0
- package/src/routes/components.index.tsx +55 -0
- package/src/routes/components.tsx +15 -0
- package/src/routes/index.tsx +16 -0
- package/src/styles/globals.css +66 -0
- package/src/styles/styles.css +113 -0
- package/src/types/registry-item.ts +13 -0
- package/src/utils/cli-utils.ts +46 -0
- package/src/utils/package-manager.ts +27 -0
- package/src/utils/schema.ts +25 -0
- package/tests/generate-registry.test.ts +60 -0
- package/tsconfig.json +29 -0
- package/tsup.config.ts +11 -0
- package/vite.config.ts +31 -0
- package/vitest.config.ts +8 -0
- package/wrangler.jsonc +7 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Changesets
|
|
2
|
+
|
|
3
|
+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
|
|
4
|
+
with multi-package repos, or single-package repos to help you version and publish your code. You can
|
|
5
|
+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
|
|
6
|
+
|
|
7
|
+
We have a quick list of common questions to get you started engaging with this project in
|
|
8
|
+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
|
|
3
|
+
"changelog": "@changesets/cli/changelog",
|
|
4
|
+
"commit": false,
|
|
5
|
+
"fixed": [],
|
|
6
|
+
"linked": [],
|
|
7
|
+
"access": "restricted",
|
|
8
|
+
"baseBranch": "main",
|
|
9
|
+
"updateInternalDependencies": "patch",
|
|
10
|
+
"ignore": []
|
|
11
|
+
}
|
package/.cta.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
release:
|
|
12
|
+
name: Release
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
permissions:
|
|
15
|
+
contents: write
|
|
16
|
+
pull-requests: write
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout Repo
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Setup Node.js 20
|
|
22
|
+
uses: actions/setup-node@v4
|
|
23
|
+
with:
|
|
24
|
+
node-version: 20
|
|
25
|
+
|
|
26
|
+
- uses: pnpm/action-setup@v3
|
|
27
|
+
with:
|
|
28
|
+
version: 9
|
|
29
|
+
|
|
30
|
+
- name: Install Dependencies
|
|
31
|
+
run: pnpm install
|
|
32
|
+
|
|
33
|
+
- name: Create Release Pull Request or Publish to npm
|
|
34
|
+
id: changesets
|
|
35
|
+
uses: changesets/action@v1
|
|
36
|
+
with:
|
|
37
|
+
# This runs when changesets are detected to create a PR,
|
|
38
|
+
# OR when the version PR is merged to publish.
|
|
39
|
+
publish: pnpm release
|
|
40
|
+
commit: "chore: version packages"
|
|
41
|
+
title: "chore: version packages"
|
|
42
|
+
env:
|
|
43
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
44
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/.oxfmtrc.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
|
|
3
|
+
"ignorePatterns": [],
|
|
4
|
+
"experimentalTailwindcss": {
|
|
5
|
+
"stylesheet": "./src/styles/styles.css",
|
|
6
|
+
"attributes": ["class", "className"],
|
|
7
|
+
"functions": ["clsx", "cn", "cva"],
|
|
8
|
+
"preserveWhitespace": true
|
|
9
|
+
},
|
|
10
|
+
"experimentalSortImports": {
|
|
11
|
+
"groups": [
|
|
12
|
+
["side-effect"],
|
|
13
|
+
["builtin"],
|
|
14
|
+
["external", "type-external"],
|
|
15
|
+
["internal", "type-internal"],
|
|
16
|
+
["parent", "type-parent"],
|
|
17
|
+
["sibling", "type-sibling"],
|
|
18
|
+
["index", "type-index"]
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
}
|
package/.oxlintrc.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
3
|
+
"plugins": null,
|
|
4
|
+
"categories": {},
|
|
5
|
+
"rules": {},
|
|
6
|
+
"settings": {
|
|
7
|
+
"jsx-a11y": {
|
|
8
|
+
"polymorphicPropName": null,
|
|
9
|
+
"components": {},
|
|
10
|
+
"attributes": {}
|
|
11
|
+
},
|
|
12
|
+
"next": {
|
|
13
|
+
"rootDir": []
|
|
14
|
+
},
|
|
15
|
+
"react": {
|
|
16
|
+
"formComponents": [],
|
|
17
|
+
"linkComponents": [],
|
|
18
|
+
"version": null,
|
|
19
|
+
"componentWrapperFunctions": []
|
|
20
|
+
},
|
|
21
|
+
"jsdoc": {
|
|
22
|
+
"ignorePrivate": false,
|
|
23
|
+
"ignoreInternal": false,
|
|
24
|
+
"ignoreReplacesDocs": true,
|
|
25
|
+
"overrideReplacesDocs": true,
|
|
26
|
+
"augmentsExtendsReplacesDocs": false,
|
|
27
|
+
"implementsReplacesDocs": false,
|
|
28
|
+
"exemptDestructuredRootsFromChecks": false,
|
|
29
|
+
"tagNamePreference": {}
|
|
30
|
+
},
|
|
31
|
+
"vitest": {
|
|
32
|
+
"typecheck": false
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"env": {
|
|
36
|
+
"builtin": true
|
|
37
|
+
},
|
|
38
|
+
"globals": {},
|
|
39
|
+
"ignorePatterns": []
|
|
40
|
+
}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# shapes-ui
|
|
2
|
+
|
|
3
|
+
## 0.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 42852ef: added mising dep
|
|
8
|
+
|
|
9
|
+
## 0.1.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 0fbf911: Added badge component
|
|
14
|
+
- 73c6324: Added button component
|
|
15
|
+
- 8574db7: added accordion component
|
|
16
|
+
- 20e8386: added alert dialog component
|
|
17
|
+
- 5de8809: Setup docs, styles, scripts and everything else.
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- a938a75: Setup cloudflare hosting
|
|
22
|
+
- 668e868: Setup registry build, and examples for the docs
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Abdullah Khan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Shapes UI
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Accordion
|
|
3
|
+
slug: accordion
|
|
4
|
+
description: Expandable sections that reveal content one at a time, or multiple sections can be expanded simultaneously.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<RenderPreview name="accordion-demo" />
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
<InstallationBlock name="accordion" />
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
### Default
|
|
16
|
+
|
|
17
|
+
<RenderPreview name="accordion-demo" />
|
|
18
|
+
|
|
19
|
+
### Surface
|
|
20
|
+
|
|
21
|
+
An accordion with background, useful for when you want to visually separate the accordion from the rest of the content.
|
|
22
|
+
|
|
23
|
+
<RenderPreview name="accordion-surface" />
|
|
24
|
+
|
|
25
|
+
### Multiple
|
|
26
|
+
|
|
27
|
+
Pass the `multiple` prop to allow multiple sections to be expanded at the same time.
|
|
28
|
+
|
|
29
|
+
<RenderPreview name="accordion-multiple" />
|
|
30
|
+
|
|
31
|
+
### Small
|
|
32
|
+
|
|
33
|
+
Pass the `size="small"` prop to reduce the padding and font size of the accordion items. This is useful for when you want a more compact accordion.
|
|
34
|
+
|
|
35
|
+
<RenderPreview name="accordion-small" />
|
|
36
|
+
|
|
37
|
+
### With icon
|
|
38
|
+
|
|
39
|
+
Add icons to accordion triggers to provide visual context for each section.
|
|
40
|
+
|
|
41
|
+
<RenderPreview name="accordion-icon" />
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Alert dialog
|
|
3
|
+
slug: alert-dialog
|
|
4
|
+
description: A modal dialog that interrupts the user with important content and expects a response.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<RenderPreview name="alert-dialog-demo" />
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
<InstallationBlock name="alert-dialog" />
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
### Default
|
|
16
|
+
|
|
17
|
+
<RenderPreview name="alert-dialog-demo" />
|
|
18
|
+
|
|
19
|
+
### Destructive action
|
|
20
|
+
|
|
21
|
+
<RenderPreview name="alert-dialog-destructive" />
|
|
22
|
+
|
|
23
|
+
### With icon
|
|
24
|
+
|
|
25
|
+
<RenderPreview name="alert-dialog-icon" />
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Alert
|
|
3
|
+
slug: alert
|
|
4
|
+
description: Contextual messages for user feedback.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<RenderPreview name="alert-demo" />
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
<InstallationBlock name="alert" />
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
### Default
|
|
16
|
+
|
|
17
|
+
<RenderPreview name="alert-demo" />
|
|
18
|
+
|
|
19
|
+
### Success
|
|
20
|
+
|
|
21
|
+
<RenderPreview name="alert-success" />
|
|
22
|
+
|
|
23
|
+
### Warning
|
|
24
|
+
|
|
25
|
+
<RenderPreview name="alert-warning" />
|
|
26
|
+
|
|
27
|
+
### Info
|
|
28
|
+
|
|
29
|
+
<RenderPreview name="alert-info" />
|
|
30
|
+
|
|
31
|
+
### Destructive
|
|
32
|
+
|
|
33
|
+
<RenderPreview name="alert-destructive" />
|
|
34
|
+
|
|
35
|
+
### With action
|
|
36
|
+
|
|
37
|
+
Add buttons to alerts for user actions like retry, dismiss, or learn more.
|
|
38
|
+
|
|
39
|
+
<RenderPreview name="alert-action" />
|
|
40
|
+
|
|
41
|
+
### With link
|
|
42
|
+
|
|
43
|
+
Include inline links within alert descriptions.
|
|
44
|
+
|
|
45
|
+
<RenderPreview name="alert-link" />
|
|
46
|
+
|
|
47
|
+
### Title only
|
|
48
|
+
|
|
49
|
+
<RenderPreview name="alert-title" />
|
|
50
|
+
|
|
51
|
+
### Description only
|
|
52
|
+
|
|
53
|
+
<RenderPreview name="alert-description" />
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Badge
|
|
3
|
+
slug: badge
|
|
4
|
+
description: Displays a badge or a component that looks like a badge.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<RenderPreview name="badge-demo" />
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
<InstallationBlock name="badge" />
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
### Variants
|
|
16
|
+
|
|
17
|
+
<RenderPreview name="badge-variants" />
|
|
18
|
+
|
|
19
|
+
### Status variants
|
|
20
|
+
|
|
21
|
+
<RenderPreview name="badge-status" />
|
|
22
|
+
|
|
23
|
+
### With icon
|
|
24
|
+
|
|
25
|
+
Use <code>data-icon="start"</code> or <code>data-icon="end"</code> to position icons.
|
|
26
|
+
|
|
27
|
+
<RenderPreview name="badge-status-icon" />
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Button
|
|
3
|
+
slug: button
|
|
4
|
+
description: Composable buttons with predefined sizes and variants. Triggers events and actions.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<RenderPreview name="button-demo" />
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
<InstallationBlock name="button" />
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
### Sizes
|
|
16
|
+
|
|
17
|
+
Sizes are controlled by the `size` prop. Variants are controlled by the `variant` prop.
|
|
18
|
+
|
|
19
|
+
<RenderPreview name="button-sizes" />
|
|
20
|
+
|
|
21
|
+
### Default
|
|
22
|
+
|
|
23
|
+
<RenderPreview name="button-default" />
|
|
24
|
+
|
|
25
|
+
### Outlined
|
|
26
|
+
|
|
27
|
+
<RenderPreview name="button-outline" />
|
|
28
|
+
|
|
29
|
+
### Ghost
|
|
30
|
+
|
|
31
|
+
<RenderPreview name="button-ghost" />
|
|
32
|
+
|
|
33
|
+
### Destructive
|
|
34
|
+
|
|
35
|
+
<RenderPreview name="button-destructive" />
|
|
36
|
+
|
|
37
|
+
### Success
|
|
38
|
+
|
|
39
|
+
<RenderPreview name="button-success" />
|
|
40
|
+
|
|
41
|
+
### Warning
|
|
42
|
+
|
|
43
|
+
<RenderPreview name="button-warning" />
|
|
44
|
+
|
|
45
|
+
### Info
|
|
46
|
+
|
|
47
|
+
<RenderPreview name="button-info" />
|
|
48
|
+
|
|
49
|
+
### Link
|
|
50
|
+
|
|
51
|
+
<RenderPreview name="button-link" />
|
|
52
|
+
|
|
53
|
+
### Loading
|
|
54
|
+
|
|
55
|
+
<RenderPreview name="button-loading" />
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { defineCollection, defineConfig } from "@content-collections/core";
|
|
2
|
+
import { compileMDX } from "@content-collections/mdx";
|
|
3
|
+
import rehypePrettyCode from "rehype-pretty-code";
|
|
4
|
+
import remarkGfm from "remark-gfm";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
|
|
7
|
+
const components = defineCollection({
|
|
8
|
+
name: "components",
|
|
9
|
+
directory: "content/components",
|
|
10
|
+
include: "*.mdx",
|
|
11
|
+
schema: z.object({
|
|
12
|
+
title: z.string(),
|
|
13
|
+
slug: z.string(),
|
|
14
|
+
description: z.string().optional(),
|
|
15
|
+
content: z.string(),
|
|
16
|
+
}),
|
|
17
|
+
transform: async (document, context) => {
|
|
18
|
+
const mdx = await compileMDX(context, document, {
|
|
19
|
+
files: (appender) => {
|
|
20
|
+
appender.file(
|
|
21
|
+
"@/components/docs/markdown/render-preview",
|
|
22
|
+
"./src/components/docs/markdown/render-preview.tsx",
|
|
23
|
+
);
|
|
24
|
+
},
|
|
25
|
+
remarkPlugins: [remarkGfm],
|
|
26
|
+
rehypePlugins: [
|
|
27
|
+
[
|
|
28
|
+
rehypePrettyCode,
|
|
29
|
+
{
|
|
30
|
+
theme: {
|
|
31
|
+
light: "github-light",
|
|
32
|
+
dark: "github-dark",
|
|
33
|
+
},
|
|
34
|
+
keepBackground: false,
|
|
35
|
+
transformers: [
|
|
36
|
+
{
|
|
37
|
+
name: "line-numbers",
|
|
38
|
+
pre(node: any) {
|
|
39
|
+
node.properties["data-line-numbers"] = "";
|
|
40
|
+
},
|
|
41
|
+
line(node: any, line: number) {
|
|
42
|
+
node.properties.className = ["line"];
|
|
43
|
+
node.children.unshift({
|
|
44
|
+
type: "element",
|
|
45
|
+
tagName: "span",
|
|
46
|
+
properties: {
|
|
47
|
+
className: ["line-number"],
|
|
48
|
+
},
|
|
49
|
+
children: [{ type: "text", value: String(line) }],
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
],
|
|
57
|
+
});
|
|
58
|
+
return {
|
|
59
|
+
...document,
|
|
60
|
+
mdx,
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
export default defineConfig({
|
|
66
|
+
collections: [components],
|
|
67
|
+
});
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|