Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(docs): code dx #4046

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions apps/docs/content/components/code/colors.raw.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {Code} from "@nextui-org/react";

export default function App() {
return (
<div className="flex flex-wrap gap-4">
<Code color="default">npm install @nextui-org/react</Code>
<Code color="primary">npm install @nextui-org/react</Code>
<Code color="secondary">npm install @nextui-org/react</Code>
<Code color="success">npm install @nextui-org/react</Code>
<Code color="warning">npm install @nextui-org/react</Code>
<Code color="danger">npm install @nextui-org/react</Code>
</div>
);
}
15 changes: 1 addition & 14 deletions apps/docs/content/components/code/colors.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
const App = `import {Code} from "@nextui-org/react";

export default function App() {
return (
<div className="flex flex-wrap gap-4">
<Code color="default">npm install @nextui-org/react</Code>
<Code color="primary">npm install @nextui-org/react</Code>
<Code color="secondary">npm install @nextui-org/react</Code>
<Code color="success">npm install @nextui-org/react</Code>
<Code color="warning">npm install @nextui-org/react</Code>
<Code color="danger">npm install @nextui-org/react</Code>
</div>
);
}`;
import App from "./colors.raw.jsx?raw";

const react = {
"/App.jsx": App,
Expand Down
11 changes: 11 additions & 0 deletions apps/docs/content/components/code/sizes.raw.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {Code} from "@nextui-org/react";

export default function App() {
return (
<div className="flex flex-col gap-4">
<Code size="sm">npm install @nextui-org/react</Code>
<Code size="md">npm install @nextui-org/react</Code>
<Code size="lg">npm install @nextui-org/react</Code>
</div>
);
}
12 changes: 1 addition & 11 deletions apps/docs/content/components/code/sizes.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
const App = `import {Code} from "@nextui-org/react";

export default function App() {
return (
<div className="flex flex-col gap-4">
<Code size="sm">npm install @nextui-org/react</Code>
<Code size="md">npm install @nextui-org/react</Code>
<Code size="lg">npm install @nextui-org/react</Code>
</div>
);
}`;
import App from "./sizes.raw.jsx?raw";

const react = {
"/App.jsx": App,
Expand Down
5 changes: 5 additions & 0 deletions apps/docs/content/components/code/usage.raw.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {Code} from "@nextui-org/react";

export default function App() {
return <Code>npm install @nextui-org/react</Code>;
}
8 changes: 1 addition & 7 deletions apps/docs/content/components/code/usage.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
const App = `import {Code} from "@nextui-org/react";

export default function App() {
return (
<Code>npm install @nextui-org/react</Code>
);
}`;
import App from "./usage.raw.jsx?raw";

const react = {
"/App.jsx": App,
Expand Down