-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(docs): circular-progress dx (#4029)
- Loading branch information
Showing
14 changed files
with
111 additions
and
108 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
apps/docs/content/components/circular-progress/colors.raw.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import {CircularProgress} from "@nextui-org/react"; | ||
|
||
export default function App() { | ||
return ( | ||
<div className="flex gap-4"> | ||
<CircularProgress aria-label="Loading..." color="default" /> | ||
<CircularProgress aria-label="Loading..." color="primary" /> | ||
<CircularProgress aria-label="Loading..." color="secondary" /> | ||
<CircularProgress aria-label="Loading..." color="success" /> | ||
<CircularProgress aria-label="Loading..." color="warning" /> | ||
<CircularProgress aria-label="Loading..." color="danger" /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
apps/docs/content/components/circular-progress/custom-styles.raw.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import {CircularProgress, Card, CardBody, CardFooter, Chip} from "@nextui-org/react"; | ||
|
||
export default function App() { | ||
return ( | ||
<Card className="w-[240px] h-[240px] border-none bg-gradient-to-br from-violet-500 to-fuchsia-500"> | ||
<CardBody className="justify-center items-center pb-0"> | ||
<CircularProgress | ||
classNames={{ | ||
svg: "w-36 h-36 drop-shadow-md", | ||
indicator: "stroke-white", | ||
track: "stroke-white/10", | ||
value: "text-3xl font-semibold text-white", | ||
}} | ||
showValueLabel={true} | ||
strokeWidth={4} | ||
value={70} | ||
/> | ||
</CardBody> | ||
<CardFooter className="justify-center items-center pt-0"> | ||
<Chip | ||
classNames={{ | ||
base: "border-1 border-white/30", | ||
content: "text-white/90 text-small font-semibold", | ||
}} | ||
variant="bordered" | ||
> | ||
2800 Data points | ||
</Chip> | ||
</CardFooter> | ||
</Card> | ||
); | ||
} |
33 changes: 1 addition & 32 deletions
33
apps/docs/content/components/circular-progress/custom-styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import {CircularProgress} from "@nextui-org/react"; | ||
|
||
export default function App() { | ||
return <CircularProgress label="Loading..." />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
apps/docs/content/components/circular-progress/sizes.raw.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import {CircularProgress} from "@nextui-org/react"; | ||
|
||
export default function App() { | ||
return ( | ||
<div className="flex gap-4"> | ||
<CircularProgress aria-label="Loading..." size="sm" /> | ||
<CircularProgress aria-label="Loading..." size="md" /> | ||
<CircularProgress aria-label="Loading..." size="lg" /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import {CircularProgress} from "@nextui-org/react"; | ||
|
||
export default function App() { | ||
return <CircularProgress aria-label="Loading..." />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
apps/docs/content/components/circular-progress/value-formatting.raw.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import {CircularProgress} from "@nextui-org/react"; | ||
|
||
export default function App() { | ||
return ( | ||
<CircularProgress | ||
color="success" | ||
formatOptions={{style: "unit", unit: "kilometer"}} | ||
label="Speed" | ||
showValueLabel={true} | ||
size="lg" | ||
value={70} | ||
/> | ||
); | ||
} |
15 changes: 1 addition & 14 deletions
15
apps/docs/content/components/circular-progress/value-formatting.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
apps/docs/content/components/circular-progress/value.raw.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {CircularProgress} 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 ( | ||
<CircularProgress | ||
aria-label="Loading..." | ||
color="warning" | ||
showValueLabel={true} | ||
size="lg" | ||
value={value} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters