Skip to content

Commit 67ecd14

Browse files
committed
refactor(badges): remove Planned components for better aesthetic
1 parent a2ea492 commit 67ecd14

File tree

11 files changed

+40
-135
lines changed

11 files changed

+40
-135
lines changed
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
export enum ComponentStatus {
2-
Ready = 'Ready',
32
Beta = 'Beta',
43
Draft = 'Draft',
5-
Planned = 'Planned',
64
}

apps/website/src/_state/component-statuses.ts

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,47 +11,20 @@ export type ComponentKitsStatuses = {
1111

1212
export const statusByComponent: ComponentKitsStatuses = {
1313
fluffy: {
14-
Accordion: ComponentStatus.Planned,
15-
Alert: ComponentStatus.Planned,
16-
Badge: ComponentStatus.Planned,
17-
Breadcrumb: ComponentStatus.Planned,
14+
Badge: ComponentStatus.Beta,
1815
Button: ComponentStatus.Beta,
19-
'Button Group': ComponentStatus.Planned,
20-
Card: ComponentStatus.Planned,
21-
Carousel: ComponentStatus.Planned,
22-
Checkbox: ComponentStatus.Planned,
23-
Combobox: ComponentStatus.Planned,
24-
Drawer: ComponentStatus.Planned,
25-
Input: ComponentStatus.Planned,
26-
'Input Phone': ComponentStatus.Planned,
27-
'Navigation Bar': ComponentStatus.Planned,
28-
Modal: ComponentStatus.Planned,
2916
Pagination: ComponentStatus.Draft,
30-
Popover: ComponentStatus.Planned,
31-
Progress: ComponentStatus.Planned,
32-
Radio: ComponentStatus.Planned,
33-
Rating: ComponentStatus.Planned,
34-
Select: ComponentStatus.Planned,
35-
Slider: ComponentStatus.Planned,
36-
Spinner: ComponentStatus.Planned,
37-
Tabs: ComponentStatus.Planned,
38-
Toast: ComponentStatus.Planned,
39-
Toggle: ComponentStatus.Planned,
40-
Tooltip: ComponentStatus.Planned,
4117
},
4218
headless: {
4319
Accordion: ComponentStatus.Beta,
44-
Carousel: ComponentStatus.Planned,
4520
Collapsible: ComponentStatus.Draft,
4621
Combobox: ComponentStatus.Beta,
47-
Dialog: ComponentStatus.Planned,
4822
Modal: ComponentStatus.Beta,
4923
Pagination: ComponentStatus.Draft,
5024
Popover: ComponentStatus.Beta,
5125
Select: ComponentStatus.Draft,
5226
Separator: ComponentStatus.Beta,
5327
Tabs: ComponentStatus.Beta,
54-
Toggle: ComponentStatus.Planned,
5528
Tooltip: ComponentStatus.Draft,
5629
},
5730
};

apps/website/src/components/anatomy-table/anatomy-table.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ export const AnatomyTable = component$(
2828
return (
2929
<tr key={propDescriptor.name}>
3030
<td class="align-center py-3 pl-2 pr-2 sm:pl-0 md:align-baseline">
31-
<code class="border-primary text-accent-foreground mr-6 rounded border border-b-2">
32-
{propDescriptor.name}
33-
</code>
31+
<div class="flex items-center gap-2">
32+
<code class="border-primary text-accent-foreground mr-6 rounded border border-b-2 px-2">
33+
{propDescriptor.name}
34+
</code>
35+
</div>
3436
</td>
3537
<td class="py-3 align-baseline">
3638
<div class="prose-docs-table">

apps/website/src/components/api-table/api-table.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ export const APITable = component$(({ propDescriptors }: APITableProps) => {
2626
{propDescriptors?.map((propDescriptor) => {
2727
return (
2828
<tr key={propDescriptor.name}>
29-
<td class="prose prose-sm py-3 pl-4 sm:pl-0 ">
30-
<code class="border-primary mr-6 rounded-md border border-b-[2px]">
31-
{propDescriptor.name}
32-
</code>
29+
<td class="py-3 pl-4 sm:pl-0">
30+
<div class="flex items-center gap-2">
31+
<code class="border-primary mr-6 rounded-md border border-b-[2px] px-2">
32+
{propDescriptor.name}
33+
</code>
34+
</div>
3335
</td>
3436
<td class="py-3">
3537
<div class="flex items-center gap-2">

apps/website/src/components/component-status-badge/component-status-badge.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,17 @@ export interface StatusBadgeProps {
66
status: ComponentStatus;
77
}
88

9-
export function getClassByStatus(status: ComponentStatus) {
9+
export function getVariantByStatus(status: ComponentStatus) {
1010
switch (status) {
1111
case ComponentStatus.Beta:
12-
return 'secondary';
13-
case ComponentStatus.Draft:
1412
return 'primary';
15-
case ComponentStatus.Planned:
13+
case ComponentStatus.Draft:
1614
return 'outline';
1715
default:
1816
return null;
1917
}
2018
}
2119

2220
export const StatusBadge = component$<StatusBadgeProps>(({ status }) => {
23-
return <Badge variant={getClassByStatus(status)}>{status}</Badge>;
21+
return <Badge variant={getVariantByStatus(status)}>{status}</Badge>;
2422
});

apps/website/src/components/preview-code-example/preview-code-example-tabs-deprecated.tsx

Lines changed: 0 additions & 42 deletions
This file was deleted.

apps/website/src/components/status-banner/status-banner.tsx

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { component$, useSignal, useStylesScoped$ } from '@builder.io/qwik';
22
import { ComponentStatus } from '~/_state/component-status.type';
3-
import { getClassByStatus } from '../component-status-badge/component-status-badge';
3+
import { getVariantByStatus } from '../component-status-badge/component-status-badge';
44
import { Badge } from '@qwik-ui/fluffy';
5+
import { cn } from '@qwik-ui/utils';
56

67
export interface StatusBannerProps {
78
status?: ComponentStatus;
@@ -13,47 +14,39 @@ function getMessageByStatus(status?: ComponentStatus) {
1314
return (
1415
<>
1516
<strong>DISCLAIMER:</strong> This component is in{' '}
16-
<Badge variant={getClassByStatus(status)}>{status}</Badge> status. That means
17-
that it is ready for production, but the API might change.
17+
<Badge variant={getVariantByStatus(status)} class="text-sm">
18+
{status}
19+
</Badge>{' '}
20+
status. That means that it is ready for production, but the API might change.
1821
</>
1922
);
2023
case ComponentStatus.Draft:
2124
return (
2225
<>
2326
<strong>WARNING:</strong> This component is in{' '}
24-
<Badge variant={getClassByStatus(status)}>{status}</Badge> status. This means
25-
that it is still in development and may have bugs or missing features. It is not
26-
intended to be used in production. You may use it for testing purposes.
27-
</>
28-
);
29-
case ComponentStatus.Planned:
30-
default:
31-
return (
32-
<>
33-
<strong>WARNING:</strong> This component is in{' '}
34-
<Badge variant={getClassByStatus(status || ComponentStatus.Planned)}>
27+
<Badge variant={getVariantByStatus(status)} class="text-sm">
3528
{status}
3629
</Badge>{' '}
37-
status. That means that it is in our backlog and we might have started working
38-
on it, but it is not under active development.
30+
status. This means that it is still in development and may have bugs or missing
31+
features. It is not intended to be used in production. You may use it for
32+
testing purposes.
3933
</>
4034
);
35+
default:
36+
return <></>;
4137
}
4238
}
4339

4440
function getBackgroundByStatus(status?: ComponentStatus) {
4541
switch (status) {
4642
case ComponentStatus.Beta:
47-
return 'border border-secondary';
48-
case ComponentStatus.Draft:
4943
return 'border border-primary';
50-
case ComponentStatus.Planned:
51-
default:
52-
return 'border border-foreground';
44+
case ComponentStatus.Draft:
45+
return 'border';
5346
}
5447
}
5548

56-
export const StatusBanner = component$((props: StatusBannerProps) => {
49+
export const StatusBanner = component$(({ status }: StatusBannerProps) => {
5750
const ref = useSignal<HTMLElement | undefined>();
5851
const isBannerClosedSig = useSignal(false);
5952
const marginBottom = 64;
@@ -85,12 +78,13 @@ export const StatusBanner = component$((props: StatusBannerProps) => {
8578
ref={ref}
8679
hidden={isBannerClosedSig.value}
8780
onAnimationEnd$={() => (isBannerClosedSig.value = true)}
88-
class={`${getBackgroundByStatus(
89-
props.status,
90-
)} normal-state shadow-light-medium dark:shadow-dark-medium relative mx-[-24px] rounded-xl border-2 px-8 py-6 md:flex-row md:items-center lg:mx-[-32px]`}
81+
class={cn(
82+
getBackgroundByStatus(status),
83+
'normal-state shadow-light-medium dark:shadow-dark-medium relative mx-[-24px] rounded-xl border-2 px-8 py-6 md:flex-row md:items-center lg:mx-[-32px]',
84+
)}
9185
style={{ marginBottom: `${marginBottom}px` }}
9286
>
93-
<span class="pr-2">{getMessageByStatus(props.status)}</span>
87+
<span class="pr-2">{getMessageByStatus(status)}</span>
9488
<button
9589
aria-label="close status banner"
9690
onClick$={() => {

apps/website/src/global.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
--card-foreground: 210 40% 98%;
3434
--popover: 222 47% 11%;
3535
--popover-foreground: 210 40% 98%;
36-
--primary: 263 50% 55%;
37-
--primary-foreground: 0 0% 100%;
38-
--secondary: 199 100% 41%;
39-
--secondary-foreground: 210 40% 100%;
36+
--primary: 199 90% 35%;
37+
--primary-foreground: 210 40% 100%;
38+
--secondary: 263 50% 55%;
39+
--secondary-foreground: 0 0% 100%;
4040
--muted: 222 22% 23%;
4141
--muted-foreground: 255 5% 80%;
4242
--accent: 222 22% 23%;

apps/website/src/routes/docs/fluffy/menu.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,6 @@
88

99
## Components
1010

11-
- [Accordion](/docs/fluffy/accordion)
12-
- [Alert](/docs/fluffy/alert)
1311
- [Badge](/docs/fluffy/badge)
14-
- [Breadcrumb](/docs/fluffy/breadcrumb)
1512
- [Button](/docs/fluffy/button)
16-
- [Button Group](/docs/fluffy/button-group)
17-
- [Card](/docs/fluffy/card)
18-
- [Carousel](/docs/fluffy/carousel)
19-
- [Checkbox](/docs/fluffy/checkbox)
20-
- [Drawer](/docs/fluffy/drawer)
21-
- [Input](/docs/fluffy/input)
2213
- [Pagination](/docs/fluffy/pagination)
23-
- [Popover](/docs/fluffy/popover)
24-
- [Progress](/docs/fluffy/progress)
25-
- [Radio](/docs/fluffy/radio)
26-
- [Rating](/docs/fluffy/rating)
27-
- [Slider](/docs/fluffy/slider)
28-
- [Select](/docs/fluffy/select)
29-
- [Tabs](/docs/fluffy/tabs)
30-
- [Toast](/docs/fluffy/toast)
31-
- [Toggle](/docs/fluffy/toggle)
32-
- [Tooltip](/docs/fluffy/tooltip)

apps/website/src/routes/docs/headless/collapsible/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { statusByComponent } from '~/_state/component-statuses';
22
import { FeatureList } from '~/components/feature-list/feature-list';
33
import { Note } from '~/components/note/note';
44

5-
<StatusBanner status={statusByComponent.headless.Accordion} />
5+
<StatusBanner status={statusByComponent.headless.Collapsible} />
66

77
# Collapsible
88

0 commit comments

Comments
 (0)