Skip to content

Commit

Permalink
Merge branch 'main' into deprecate-headless-tabs-short-api
Browse files Browse the repository at this point in the history
  • Loading branch information
maiieul committed Oct 12, 2024
2 parents c177c11 + 88ed151 commit 121aa73
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 159 deletions.
73 changes: 0 additions & 73 deletions README.md

Large diffs are not rendered by default.

30 changes: 0 additions & 30 deletions apps/website/src/_state/component-statuses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,43 +11,13 @@ export type ComponentKitsStatuses = {

export const statusByComponent: ComponentKitsStatuses = {
styled: {
Accordion: ComponentStatus.Beta,
Avatar: ComponentStatus.Draft,
Alert: ComponentStatus.Beta,
Badge: ComponentStatus.Beta,
Breadcrumb: ComponentStatus.Draft,
Button: ComponentStatus.Beta,
Card: ComponentStatus.Beta,
Checkbox: ComponentStatus.Draft,
Combobox: ComponentStatus.Draft,
Dropdown: ComponentStatus.Draft,
Input: ComponentStatus.Draft,
Label: ComponentStatus.Beta,
Modal: ComponentStatus.Draft,
Pagination: ComponentStatus.Draft,
Popover: ComponentStatus.Draft,
Progress: ComponentStatus.Draft,
RadioGroup: ComponentStatus.Draft,
Select: ComponentStatus.Draft,
Separator: ComponentStatus.Beta,
Skeleton: ComponentStatus.Beta,
Tabs: ComponentStatus.Beta,
Toggle: ComponentStatus.Draft,
ToggleGroup: ComponentStatus.Draft,
Textarea: ComponentStatus.Draft,
},
headless: {
Carousel: ComponentStatus.Beta,
Combobox: ComponentStatus.Beta,
Checkbox: ComponentStatus.Draft,
Dropdown: ComponentStatus.Draft,
Label: ComponentStatus.Beta,
Pagination: ComponentStatus.Draft,
Progress: ComponentStatus.Beta,
Select: ComponentStatus.Beta,
Tabs: ComponentStatus.Beta,
Toggle: ComponentStatus.Beta,
'Toggle Group': ComponentStatus.Beta,
Tooltip: ComponentStatus.Beta,
},
};
6 changes: 6 additions & 0 deletions apps/website/src/components/contributor/contributor.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
interface Contributor {
login: string;
avatar_url: string;
html_url: string;
contributions: number;
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ const defaultLinksGroups: LinkGroup[] = [
name: 'Contributing',
href: '/docs/contributing/',
},
{
name: 'Contributors',
href: '/docs/contributors/',
},
{
name: 'Headless',
href: '/docs/headless/introduction/',
Expand Down
93 changes: 93 additions & 0 deletions apps/website/src/routes/docs/contributors/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import { component$ } from '@builder.io/qwik';
import { RequestHandler, routeLoader$ } from '@builder.io/qwik-city';
import { Badge } from '@qwik-ui/styled';

export const onGet: RequestHandler = async ({ cacheControl }) => {
cacheControl({
staleWhileRevalidate: 60 * 60 * 24 * 7,
// Don't hit the Github API more than once every 10 minutes
maxAge: 10 * 60,
});
};

export const useContributors = routeLoader$<Contributor[]>(async () => {
const response = await fetch(
'https://api.github.com/repos/qwikifiers/qwik-ui/contributors',
);

if (!response.ok) {
console.error('Failed to fetch contributors', response);
return [];
}

const contributors: Contributor[] = await response.json();

// @ts-expect-error m.type actually is valid
return contributors.filter((m) => m.type === 'User');
});

export default component$(() => {
const contributors = useContributors();

return (
<>
<section class="py-16 text-accent-foreground">
<div class="mx-auto text-center">
<h1 class="mb-6 scroll-mt-24 pt-6 text-3xl font-extrabold md:text-5xl">
Contributors
</h1>
<p class="text-xl">
Our project's success is driven by these incredible contributors.
</p>
</div>
</section>

<section class="py-12">
<div class="mx-auto max-w-6xl px-4">
<div class="grid gap-12 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3">
{contributors.value.map((contributor) => (
<a
href={contributor.html_url}
target="_blank"
key={contributor.login}
class="transform rounded-lg bg-accent shadow-lg transition-all duration-200 hover:-translate-y-1 hover:shadow-xl"
>
<div class="p-6 text-center">
<img
width={88}
height={88}
class="mx-auto -mt-12 h-24 w-24 rounded-full border-2 border-foreground/20"
src={`${contributor.avatar_url}&s=256`}
alt={contributor.login}
/>
<h3 class="mt-2 text-xl font-semibold text-foreground">
{contributor.login}
</h3>
<div class="mt-2 mt-4 flex flex-col items-center gap-2 text-foreground">
Contributions <Badge> {contributor.contributions}</Badge>
</div>
</div>
</a>
))}
</div>
</div>
</section>

{/* Call to Action */}
<section class="bg-primary py-12 text-white">
<div class="mx-auto max-w-3xl text-center">
<h2 class="mb-4 text-3xl font-bold">Join Our Community</h2>
<p class="mb-6">
Ready to make an impact? Contribute to Qwik UI and be part of something great.
</p>
<a
href="https://github.com/qwikifiers/qwik-ui/blob/main/CONTRIBUTING.md"
class="rounded-full bg-white px-6 py-3 font-semibold text-primary shadow-lg hover:bg-gray-100"
>
Get Involved
</a>
</div>
</section>
</>
);
});
1 change: 1 addition & 0 deletions apps/website/src/routes/docs/headless/menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Qwik UI

- [Contributing](/docs/contributing)
- [Contributors](/docs/contributors)
- [Headless](/docs/headless/introduction)
- [Styled](/docs/styled/introduction)

Expand Down
1 change: 1 addition & 0 deletions apps/website/src/routes/docs/styled/menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Qwik UI

- [Contributing](/docs/contributing)
- [Contributors](/docs/contributors)
- [Headless](/docs/headless/introduction)
- [Styled](/docs/styled/introduction)

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"@typescript-eslint/parser": "7.9.0",
"@vitest/coverage-v8": "^1.6.0",
"@vitest/ui": "^1.6.0",
"all-contributors-cli": "^6.26.1",
"ansis": "3.2.0",
"autoprefixer": "^10.4.19",
"axe-core": "^4.9.1",
Expand Down
56 changes: 1 addition & 55 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 121aa73

Please sign in to comment.