Skip to content

Commit 1b3df22

Browse files
authored
Merge pull request #53 from RustLangES/agnostic-showcase
feat: Migrate to agnostic showcase
2 parents fd15e87 + 04d75d1 commit 1b3df22

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2175
-1094
lines changed

.github/workflows/npm-checks.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ jobs:
3434
- name: Install dependencies
3535
run: pnpm install
3636

37+
- name: Build showcase
38+
run: pnpm build:showcase-lib
39+
3740
- name: Run lint on all packages
38-
run: pnpm -r lint
41+
run: pnpm lint
3942

4043
- name: Run format check on all packages
41-
run: pnpm -r fmt:check
44+
run: pnpm fmt:check

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.github/
2+
dist/
23

34
*.md
45
pnpm-lock.yaml

js/react/index.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>RustLangES React Components</title>
8+
<style>
9+
@media (prefers-color-scheme: dark) {
10+
html:where(:not(.rustlanges-theme-light)) {
11+
background-color: var(--color-dark, #2e2e2e);
12+
}
13+
}
14+
</style>
815
</head>
916
<body>
1017
<div id="root"></div>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { registerCase } from "@rustlanges/showcase";
2+
import { Avatar } from "./avatar.component";
3+
4+
registerCase("Avatar", {
5+
props: {
6+
alt: "string",
7+
size: {
8+
kind: "number",
9+
default: 32,
10+
},
11+
avatarUrl: {
12+
kind: "string",
13+
default:
14+
"https://images.unsplash.com/photo-1575936123452-b67c3203c357?fm=jpg&q=60&w=3000&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Mnx8aW1hZ2V8ZW58MHx8MHx8fDA%3D",
15+
},
16+
},
17+
component: Avatar,
18+
});
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { registerCase } from "@rustlanges/showcase";
2+
import { Badge } from "./badge.component";
3+
4+
registerCase("Badge", {
5+
props: {
6+
variant: {
7+
kind: "string",
8+
default: "completed",
9+
options: ["completed", "pending", "reading", "unread"],
10+
},
11+
type: {
12+
kind: "string",
13+
default: "numeric",
14+
options: ["default", "numeric", "text"],
15+
},
16+
count: {
17+
kind: "number",
18+
default: 1,
19+
optional: false,
20+
},
21+
},
22+
component: Badge,
23+
});
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { registerCase } from "@rustlanges/showcase";
2+
import { Button } from "./button.component";
3+
4+
registerCase("Button", {
5+
props: {
6+
variant: {
7+
kind: "string",
8+
options: ["primary", "secondary", "text", "icon"],
9+
default: "primary",
10+
},
11+
label: {
12+
kind: "string",
13+
default: "Botón",
14+
},
15+
disabled: "boolean",
16+
icon: "icon",
17+
onClick: "callback",
18+
},
19+
component: Button,
20+
});
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { useState } from "react";
2+
import { registerCase } from "@rustlanges/showcase";
3+
import { Calendar } from "./calendar.component";
4+
import { CalendarRangeDate } from "./calendar.types";
5+
6+
registerCase("Calendar", () => {
7+
const [single, setSingle] = useState<Date | null>(new Date());
8+
const [multiple, setMultiple] = useState<Record<string, Date> | null>(null);
9+
const [range, setRange] = useState<CalendarRangeDate | null>(null);
10+
11+
return (
12+
<div className="flex flex-col gap-2">
13+
<Calendar type="single" onChange={setSingle} value={single} />
14+
<Calendar type="multiple" onChange={setMultiple} value={multiple} />
15+
<Calendar type="range" onChange={setRange} value={range} />
16+
</div>
17+
);
18+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { registerCase } from "@rustlanges/showcase";
2+
import { Card } from "./card.component";
3+
4+
registerCase("Card", {
5+
props: {
6+
clickable: "boolean",
7+
disabled: "boolean",
8+
className: {
9+
kind: "string",
10+
default: "min-w-50 min-h-50",
11+
},
12+
onClick: "callback",
13+
},
14+
component: Card,
15+
});
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { registerCase } from "@rustlanges/showcase";
2+
import { Chip } from "./chip.component";
3+
4+
registerCase("Chip", {
5+
props: {
6+
variant: {
7+
kind: "string",
8+
default: "featured",
9+
options: ["featured", "numeric", "description", "location", "small"],
10+
},
11+
label: {
12+
kind: "string",
13+
default: "Destacado",
14+
},
15+
},
16+
component: Chip,
17+
});
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { registerCase } from "@rustlanges/showcase";
2+
import { Collaborators } from "./collaborators.component";
3+
4+
const collaborator = {
5+
avatarUrl:
6+
"https://images.unsplash.com/photo-1575936123452-b67c3203c357?fm=jpg&q=60&w=3000&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Mnx8aW1hZ2V8ZW58MHx8MHx8fDA%3D",
7+
nickname: "Colaborador",
8+
};
9+
10+
registerCase("Collaborators", () => {
11+
return (
12+
<div className="grid w-full justify-center gap-4">
13+
<div className="w-60">
14+
<Collaborators
15+
collaborators={[
16+
collaborator,
17+
collaborator,
18+
collaborator,
19+
collaborator,
20+
]}
21+
sourceUrl="https://github.com/RustLangES/design-system-components"
22+
/>
23+
</div>
24+
<div className="w-60">
25+
<Collaborators
26+
collaborators={[collaborator]}
27+
sourceUrl="https://github.com/RustLangES/design-system-components"
28+
/>
29+
</div>
30+
<div className="w-60">
31+
<Collaborators
32+
collaborators={[
33+
collaborator,
34+
collaborator,
35+
collaborator,
36+
collaborator,
37+
collaborator,
38+
collaborator,
39+
collaborator,
40+
]}
41+
sourceUrl="https://github.com/RustLangES/design-system-components"
42+
/>
43+
</div>
44+
</div>
45+
);
46+
});

0 commit comments

Comments
 (0)