Skip to content

Commit

Permalink
feat: add sample 12
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexGarrixen committed Dec 26, 2023
1 parent b87f13c commit 25579cf
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/components/samples-preview/sample-12.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { css } from "@root/styled-system/css";
import { stack } from "@root/styled-system/patterns";
import { slider } from "@root/styled-system/recipes";

import { applyStyle, cssFgVar } from "./utils";

const classes = {
root: stack({ gap: "4", p: "6", rounded: "xl" }),
progress: slider(),
heading: css({ textStyle: "body-lg", fontWeight: "500" }),
percentage: css({ textStyle: "body-sm" }),
content: css({ display: "flex", alignItems: "center", justifyContent: "space-between" }),
};

export function Sample12() {
return (
<article className={classes.root} style={{ ...applyStyle("bg"), ...applyStyle("color") }}>
<div className={classes.content}>
<p className={classes.heading}>Project Progress</p>
<span className={classes.percentage}>80%</span>
</div>
<div className={classes.progress.root}>
<div
className={`${classes.progress.track} ${css({ height: "2!" })}`}
style={applyStyle("bg", { fromVar: cssFgVar, alpha: "0.16" })}
>
<div
className={classes.progress.range}
style={{ width: "80%", ...applyStyle("bg", { fromVar: cssFgVar, alpha: "1" }) }}
/>
</div>
</div>
</article>
);
}
6 changes: 6 additions & 0 deletions src/components/samples-preview/sample-preview.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { Sample8 } from "./sample-8";
import { Sample9 } from "./sample-9";
import { Sample10 } from "./sample-10";
import { Sample11 } from "./sample-11";
import { Sample12 } from "./sample-12";
import { bgVar, fgVar } from "./utils";

export default {
Expand Down Expand Up @@ -89,3 +90,8 @@ export const Sample_11: Story = {
name: "Sample 11",
render: () => <Sample11 />,
};

export const Sample_12: Story = {
name: "Sample 12",
render: () => <Sample12 />,
};

0 comments on commit 25579cf

Please sign in to comment.