Skip to content

feat: Migrate to agnostic showcase #53

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

Merged
merged 38 commits into from
Jul 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
dc7b319
chore(styles): Change `tailwindcss` to peer dependencies
Brayan-724 Jun 28, 2025
fbfea48
chore(prettier): Ignore dist folder
Brayan-724 Jun 29, 2025
2a151c4
wip: make showcase agnostic
Brayan-724 Jun 29, 2025
bf6b906
wip: MiniUI is working, simple cases working
Brayan-724 Jun 30, 2025
2db8fc9
feat(showcase/miniui): Add support for string arrays in class
Brayan-724 Jun 30, 2025
c993936
fix(showcase/miniui): Class definition was colliding
Brayan-724 Jun 30, 2025
e502f20
feat(showcase/miniui): Accept signals as children
Brayan-724 Jul 2, 2025
980ca49
feat(showcase/miniui): Add Show component
Brayan-724 Jul 2, 2025
e828212
refactor(showcase/miniui): Remove SIGNAL symbol
Brayan-724 Jul 2, 2025
5eda447
fix(showcase/miniui): Component type definitions
Brayan-724 Jul 2, 2025
54f3af3
feat(showcase/miniui): Support boolean as children
Brayan-724 Jul 2, 2025
1b8654b
feat(showcase): add Reset Icon
Brayan-724 Jul 2, 2025
06bf23c
feat(showcase/miniui): re-export alien-signals's effect
Brayan-724 Jul 2, 2025
9e79caa
feat(showcase/miniui): add `use` prop like onMount
Brayan-724 Jul 2, 2025
cf36286
chore(showcase): It works on my machine :+1:
Brayan-724 Jul 2, 2025
4050d19
feat(showcase/miniui): Allow booleans on classList
Brayan-724 Jul 4, 2025
a4579b2
fix(showcase): Match styles to previous ones
Brayan-724 Jul 6, 2025
c68af98
fix(showcase/react): Error parsing
Brayan-724 Jul 6, 2025
d708daa
styles: `pnpm fmt`
Brayan-724 Jul 6, 2025
dda2877
fix(showcase): Children were accumulated
Brayan-724 Jul 6, 2025
76ddcfa
feat(showcase/case): Add error case
Brayan-724 Jul 6, 2025
cbfdcd2
feat(styles): Add manual way to dark theme
Brayan-724 Jul 7, 2025
68031ea
feat(showcase): Add theme switch
Brayan-724 Jul 7, 2025
de26cbf
feat(showcase): Add support for callbacks and events
Brayan-724 Jul 7, 2025
47590ea
style(showcase): `pnpm fmt`
Brayan-724 Jul 7, 2025
402a3d6
feat(showcase): add icon kind
Brayan-724 Jul 8, 2025
4b24d03
feat(react): Build showcase for deploy
Brayan-724 Jul 8, 2025
ce70b68
chore(react/button): Remove className from showcase
Brayan-724 Jul 8, 2025
b181eea
refactor(react): Migrate all components to new showcase
Brayan-724 Jul 8, 2025
0ef53d1
feat(showcase): Don't send optional fields
Brayan-724 Jul 8, 2025
9c44a0e
feat(react/showcase): Use background as systems by default
Brayan-724 Jul 8, 2025
ea31b28
merge: main -> agnostic-showcase
Brayan-724 Jul 8, 2025
1ebe1a0
fix(styles): Load preflight styles
Brayan-724 Jul 8, 2025
ea52d62
feat(showcase): Make theme switch sticky
Brayan-724 Jul 8, 2025
2984a65
style: `pnpm fmt`
Brayan-724 Jul 8, 2025
ee51668
feat(showcase): Setup linter
Brayan-724 Jul 8, 2025
ce9e503
fix(react): lints
Brayan-724 Jul 8, 2025
04d75d1
fix(workflows/npm-checks): build showcase lib before lints
Brayan-724 Jul 9, 2025
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
7 changes: 5 additions & 2 deletions .github/workflows/npm-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Build showcase
run: pnpm build:showcase-lib

- name: Run lint on all packages
run: pnpm -r lint
run: pnpm lint

- name: Run format check on all packages
run: pnpm -r fmt:check
run: pnpm fmt:check
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.github/
dist/

*.md
pnpm-lock.yaml
7 changes: 7 additions & 0 deletions js/react/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>RustLangES React Components</title>
<style>
@media (prefers-color-scheme: dark) {
html:where(:not(.rustlanges-theme-light)) {
background-color: var(--color-dark, #2e2e2e);
}
}
</style>
</head>
<body>
<div id="root"></div>
Expand Down
18 changes: 18 additions & 0 deletions js/react/lib/components/avatar/avatar.showcase.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { registerCase } from "@rustlanges/showcase";
import { Avatar } from "./avatar.component";

registerCase("Avatar", {
props: {
alt: "string",
size: {
kind: "number",
default: 32,
},
avatarUrl: {
kind: "string",
default:
"https://images.unsplash.com/photo-1575936123452-b67c3203c357?fm=jpg&q=60&w=3000&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Mnx8aW1hZ2V8ZW58MHx8MHx8fDA%3D",
},
},
component: Avatar,
});
23 changes: 23 additions & 0 deletions js/react/lib/components/badge/badge.showcase.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { registerCase } from "@rustlanges/showcase";
import { Badge } from "./badge.component";

registerCase("Badge", {
props: {
variant: {
kind: "string",
default: "completed",
options: ["completed", "pending", "reading", "unread"],
},
type: {
kind: "string",
default: "numeric",
options: ["default", "numeric", "text"],
},
count: {
kind: "number",
default: 1,
optional: false,
},
},
component: Badge,
});
20 changes: 20 additions & 0 deletions js/react/lib/components/button/button.showcase.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { registerCase } from "@rustlanges/showcase";
import { Button } from "./button.component";

registerCase("Button", {
props: {
variant: {
kind: "string",
options: ["primary", "secondary", "text", "icon"],
default: "primary",
},
label: {
kind: "string",
default: "Botón",
},
disabled: "boolean",
icon: "icon",
onClick: "callback",
},
component: Button,
});
18 changes: 18 additions & 0 deletions js/react/lib/components/calendar/calendar.showcase.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { useState } from "react";
import { registerCase } from "@rustlanges/showcase";
import { Calendar } from "./calendar.component";
import { CalendarRangeDate } from "./calendar.types";

registerCase("Calendar", () => {
const [single, setSingle] = useState<Date | null>(new Date());
const [multiple, setMultiple] = useState<Record<string, Date> | null>(null);
const [range, setRange] = useState<CalendarRangeDate | null>(null);

return (
<div className="flex flex-col gap-2">
<Calendar type="single" onChange={setSingle} value={single} />
<Calendar type="multiple" onChange={setMultiple} value={multiple} />
<Calendar type="range" onChange={setRange} value={range} />
</div>
);
});
15 changes: 15 additions & 0 deletions js/react/lib/components/card/card.showcase.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { registerCase } from "@rustlanges/showcase";
import { Card } from "./card.component";

registerCase("Card", {
props: {
clickable: "boolean",
disabled: "boolean",
className: {
kind: "string",
default: "min-w-50 min-h-50",
},
onClick: "callback",
},
component: Card,
});
17 changes: 17 additions & 0 deletions js/react/lib/components/chip/chip.showcase.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { registerCase } from "@rustlanges/showcase";
import { Chip } from "./chip.component";

registerCase("Chip", {
props: {
variant: {
kind: "string",
default: "featured",
options: ["featured", "numeric", "description", "location", "small"],
},
label: {
kind: "string",
default: "Destacado",
},
},
component: Chip,
});
46 changes: 46 additions & 0 deletions js/react/lib/components/collaborators/collaborators.showcase.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { registerCase } from "@rustlanges/showcase";
import { Collaborators } from "./collaborators.component";

const collaborator = {
avatarUrl:
"https://images.unsplash.com/photo-1575936123452-b67c3203c357?fm=jpg&q=60&w=3000&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Mnx8aW1hZ2V8ZW58MHx8MHx8fDA%3D",
nickname: "Colaborador",
};

registerCase("Collaborators", () => {
return (
<div className="grid w-full justify-center gap-4">
<div className="w-60">
<Collaborators
collaborators={[
collaborator,
collaborator,
collaborator,
collaborator,
]}
sourceUrl="https://github.com/RustLangES/design-system-components"
/>
</div>
<div className="w-60">
<Collaborators
collaborators={[collaborator]}
sourceUrl="https://github.com/RustLangES/design-system-components"
/>
</div>
<div className="w-60">
<Collaborators
collaborators={[
collaborator,
collaborator,
collaborator,
collaborator,
collaborator,
collaborator,
collaborator,
]}
sourceUrl="https://github.com/RustLangES/design-system-components"
/>
</div>
</div>
);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { registerCase } from "@rustlanges/showcase";
import { ContactForm } from "./contact-form.component";

registerCase("Contact Form", () => {
return <ContactForm />;
});
Loading