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): progress dx #4049

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/progress/colors.raw.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {Progress} from "@nextui-org/react";

export default function App() {
return (
<div className="flex flex-col gap-6 w-full max-w-md">
<Progress aria-label="Loading..." color="default" value={70} />
<Progress aria-label="Loading..." color="primary" value={70} />
<Progress aria-label="Loading..." color="secondary" value={70} />
<Progress aria-label="Loading..." color="success" value={70} />
<Progress aria-label="Loading..." color="warning" value={70} />
<Progress aria-label="Loading..." color="danger" value={70} />
</div>
);
}
15 changes: 1 addition & 14 deletions apps/docs/content/components/progress/colors.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
const App = `import {Progress} from "@nextui-org/react";

export default function App() {
return (
<div className="flex flex-col gap-6 w-full max-w-md">
<Progress color="default" aria-label="Loading..." value={70} />
<Progress color="primary" aria-label="Loading..." value={70} />
<Progress color="secondary" aria-label="Loading..." value={70} />
<Progress color="success" aria-label="Loading..." value={70} />
<Progress color="warning" aria-label="Loading..." value={70} />
<Progress color="danger" aria-label="Loading..." value={70} />
</div>
);
}`;
import App from "./colors.raw.jsx?raw";

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

export default function App() {
return (
<Progress
classNames={{
base: "max-w-md",
track: "drop-shadow-md border border-default",
indicator: "bg-gradient-to-r from-pink-500 to-yellow-500",
label: "tracking-wider font-medium text-default-600",
value: "text-foreground/60",
}}
label="Lose weight"
radius="sm"
showValueLabel={true}
size="sm"
value={65}
/>
);
}
21 changes: 1 addition & 20 deletions apps/docs/content/components/progress/custom-styles.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
const App = `import { Progress } from "@nextui-org/react";

export default function App() {
return (
<Progress
size="sm"
radius="sm"
classNames={{
base: "max-w-md",
track: "drop-shadow-md border border-default",
indicator: "bg-gradient-to-r from-pink-500 to-yellow-500",
label: "tracking-wider font-medium text-default-600",
value: "text-foreground/60",
}}
label="Lose weight"
value={65}
showValueLabel={true}
/>
);
}`;
import App from "./custom-styles.raw.jsx?raw";

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

export default function App() {
return <Progress isIndeterminate aria-label="Loading..." className="max-w-md" size="sm" />;
}
13 changes: 1 addition & 12 deletions apps/docs/content/components/progress/indeterminate.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
const App = `import { Progress } from "@nextui-org/react";

export default function App() {
return (
<Progress
size="sm"
isIndeterminate
aria-label="Loading..."
className="max-w-md"
/>
);
}`;
import App from "./indeterminate.raw.jsx?raw";

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

export default function App() {
return <Progress className="max-w-md" label="Loading..." value={55} />;
}
8 changes: 1 addition & 7 deletions apps/docs/content/components/progress/label.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
const App = `import {Progress} from "@nextui-org/react";

export default function App() {
return (
<Progress label="Loading..." value={55} className="max-w-md" />
);
}`;
import App from "./label.raw.jsx?raw";

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

export default function App() {
return (
<div className="flex flex-col gap-6 w-full max-w-md">
<Progress aria-label="Loading..." size="sm" value={30} />
<Progress aria-label="Loading..." size="md" value={40} />
<Progress aria-label="Loading..." size="lg" value={50} />
</div>
);
}
12 changes: 1 addition & 11 deletions apps/docs/content/components/progress/sizes.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
const App = `import {Progress} from "@nextui-org/react";

export default function App() {
return (
<div className="flex flex-col gap-6 w-full max-w-md">
<Progress size="sm" aria-label="Loading..." value={30} />
<Progress size="md" aria-label="Loading..." value={40} />
<Progress size="lg" aria-label="Loading..." value={50} />
</div>
);
}`;
import App from "./sizes.raw.jsx?raw";

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

export default function App() {
return (
<Progress isStriped aria-label="Loading..." className="max-w-md" color="secondary" value={60} />
);
}
15 changes: 1 addition & 14 deletions apps/docs/content/components/progress/striped.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
const App = `import { Progress } from "@nextui-org/react";

export default function App() {
return (
<Progress
isStriped
aria-label="Loading..."
color="secondary"
value={60}
className="max-w-md"
/>
);
}
`;
import App from "./striped.raw.jsx?raw";

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

export default function App() {
return <Progress aria-label="Loading..." className="max-w-md" value={60} />;
}
8 changes: 1 addition & 7 deletions apps/docs/content/components/progress/usage.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
const App = `import {Progress} from "@nextui-org/react";

export default function App() {
return (
<Progress aria-label="Loading..." value={60} className="max-w-md"/>
);
}`;
import App from "./usage.raw.jsx?raw";

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

export default function App() {
return (
<Progress
className="max-w-md"
color="warning"
formatOptions={{style: "currency", currency: "ARS"}}
label="Monthly expenses"
maxValue={10000}
showValueLabel={true}
size="sm"
value={4000}
/>
);
}
17 changes: 1 addition & 16 deletions apps/docs/content/components/progress/value-formatting.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
const App = `import {Progress} from "@nextui-org/react";

export default function App() {
return (
<Progress
label="Monthly expenses"
size="sm"
value={4000}
maxValue={10000}
color="warning"
formatOptions={{style: "currency", currency: "ARS"}}
showValueLabel={true}
className="max-w-md"
/>
);
}`;
import App from "./value-formatting.raw.jsx?raw";

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

export default function App() {
const [value, setValue] = React.useState(0);

React.useEffect(() => {
const interval = setInterval(() => {
setValue((v) => (v >= 100 ? 0 : v + 10));
}, 500);

return () => clearInterval(interval);
}, []);

return (
<Progress
aria-label="Downloading..."
className="max-w-md"
color="success"
showValueLabel={true}
size="md"
value={value}
/>
);
}
25 changes: 1 addition & 24 deletions apps/docs/content/components/progress/value.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,4 @@
const App = `import {Progress} from "@nextui-org/react";

export default function App() {
const [value, setValue] = React.useState(0);

React.useEffect(() => {
const interval = setInterval(() => {
setValue((v) => (v >= 100 ? 0 : v + 10));
}, 500);

return () => clearInterval(interval);
}, []);

return (
<Progress
aria-label="Downloading..."
size="md"
value={value}
color="success"
showValueLabel={true}
className="max-w-md"
/>
);
}`;
import App from "./value.raw.jsx?raw";

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