Skip to content

Commit 87c004a

Browse files
committed
docs(badges): refactor badges to use fluffy
1 parent 581d7dc commit 87c004a

29 files changed

+410
-1873
lines changed

apps/website/src/_state/status-tooltips.ts

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

apps/website/src/components/code-example/code-example-container.tsx

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

apps/website/src/components/code-example/code-example.tsx

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,24 @@
11
import { component$ } from '@builder.io/qwik';
22
import { Badge } from '@qwik-ui/fluffy';
33
import { ComponentStatus } from '~/_state/component-status.type';
4-
import { tooltipByStatus } from '~/_state/status-tooltips';
54

65
export interface StatusBadgeProps {
76
status: ComponentStatus;
87
}
98

109
export function getClassByStatus(status: ComponentStatus) {
1110
switch (status) {
12-
case ComponentStatus.Ready:
13-
return 'text-green-900 bg-green-300 tracking-wide';
1411
case ComponentStatus.Beta:
15-
return 'border border-primary-foreground tracking-wide bg-primary text-primary-foreground';
12+
return 'secondary';
1613
case ComponentStatus.Draft:
17-
return 'border tracking-wide bg-muted text-foreground';
14+
return 'primary';
1815
case ComponentStatus.Planned:
19-
return 'text-white bg-slate-600 dark:bg-slate-500 border tracking-wide';
16+
return 'outline';
2017
default:
2118
return null;
2219
}
2320
}
2421

2522
export const StatusBadge = component$<StatusBadgeProps>(({ status }) => {
26-
return (
27-
<Badge
28-
title={tooltipByStatus[status]}
29-
class={`rounded-lg p-3 text-lg font-bold leading-3 shadow lg:px-2 lg:py-1 lg:text-xs
30-
${getClassByStatus(status)}`}
31-
>
32-
{status}
33-
</Badge>
34-
);
23+
return <Badge variant={getClassByStatus(status)}>{status}</Badge>;
3524
});

apps/website/src/components/preview-code-example/preview-code-example-props.type.ts

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

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

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

apps/website/src/components/preview-code-example/preview-code-example-vertical.tsx

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

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

Lines changed: 13 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,39 @@
1-
import {
2-
QwikIntrinsicElements,
3-
component$,
4-
useSignal,
5-
useStylesScoped$,
6-
} from '@builder.io/qwik';
1+
import { component$, useSignal, useStylesScoped$ } from '@builder.io/qwik';
72
import { ComponentStatus } from '~/_state/component-status.type';
83
import { getClassByStatus } from '../component-status-badge/component-status-badge';
4+
import { Badge } from '@qwik-ui/fluffy';
95

106
export interface StatusBannerProps {
117
status?: ComponentStatus;
128
}
139

1410
function getMessageByStatus(status?: ComponentStatus) {
1511
switch (status) {
16-
case ComponentStatus.Ready:
17-
return (
18-
<>
19-
This component is <strong>Production Ready</strong>
20-
</>
21-
);
2212
case ComponentStatus.Beta:
2313
return (
2414
<>
2515
<strong>DISCLAIMER:</strong> This component is in{' '}
26-
<span
27-
class={`rounded-lg px-2 font-bold tracking-wide ${getClassByStatus(status)}`}
28-
>
29-
{status}
30-
</span>{' '}
31-
status. That means that it is ready for production, but the API might change.
16+
<Badge variant={getClassByStatus(status)}>{status}</Badge> status. That means
17+
that it is ready for production, but the API might change.
3218
</>
3319
);
3420
case ComponentStatus.Draft:
3521
return (
3622
<>
3723
<strong>WARNING:</strong> This component is in{' '}
38-
<span
39-
class={`rounded-lg px-2 font-bold tracking-wide ${getClassByStatus(status)}`}
40-
>
41-
{status}
42-
</span>{' '}
43-
status. This means that it is still in development and may have bugs or missing
44-
features. It is not intended to be used in production. You may use it for
45-
testing purposes.
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.
4627
</>
4728
);
4829
case ComponentStatus.Planned:
4930
default:
5031
return (
5132
<>
5233
<strong>WARNING:</strong> This component is in{' '}
53-
<span
54-
class={`rounded-lg px-2 font-bold tracking-wide ${getClassByStatus(
55-
status || ComponentStatus.Planned,
56-
)}`}
57-
>
34+
<Badge variant={getClassByStatus(status || ComponentStatus.Planned)}>
5835
{status}
59-
</span>{' '}
36+
</Badge>{' '}
6037
status. That means that it is in our backlog and we might have started working
6138
on it, but it is not under active development.
6239
</>
@@ -66,15 +43,13 @@ function getMessageByStatus(status?: ComponentStatus) {
6643

6744
function getBackgroundByStatus(status?: ComponentStatus) {
6845
switch (status) {
69-
case ComponentStatus.Ready:
70-
return 'bg-green-300';
7146
case ComponentStatus.Beta:
72-
return 'border border-primary';
47+
return 'border border-secondary';
7348
case ComponentStatus.Draft:
74-
return 'border';
49+
return 'border border-primary';
7550
case ComponentStatus.Planned:
7651
default:
77-
return 'border';
52+
return 'border border-foreground';
7853
}
7954
}
8055

@@ -136,7 +111,7 @@ export const StatusBanner = component$((props: StatusBannerProps) => {
136111
);
137112
});
138113

139-
export function EpCircleCloseFilled(props: QwikIntrinsicElements['svg'], key: string) {
114+
export function EpCircleCloseFilled() {
140115
return (
141116
<svg
142117
xmlns="http://www.w3.org/2000/svg"

apps/website/tailwind.config.cjs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@ module.exports = {
77
join(__dirname, '../../packages/kit-tailwind/src/**/*.{js,ts,jsx,tsx,mdx}'),
88
join(__dirname, '../../packages/kit-fluffy/src/**/*.{js,ts,jsx,tsx,mdx}'),
99
],
10-
plugins: [require('daisyui')],
1110
darkMode: 'class',
12-
daisyui: {
13-
themes: ['light', 'dark'],
14-
base: true,
15-
},
1611
theme: {
1712
screens: {
1813
sm: '640px',

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,11 @@
9393
"clsx": "2.0.0",
9494
"commitizen": "^4.3.0",
9595
"commitlint": "^17.7.1",
96-
"country-list-json": "^1.1.0",
9796
"cypress": "^13.0.0",
9897
"cypress-axe": "1.4.0",
9998
"cypress-ct-qwik": "0.3.0",
10099
"cypress-real-events": "1.10.3",
101100
"cz-conventional-changelog": "^3.3.0",
102-
"daisyui": "^3.6.4",
103101
"danger": "^11.2.8",
104102
"dotenv": "16.3.1",
105103
"eslint": "^8.48.0",
@@ -161,6 +159,15 @@
161159
"qwik ui components",
162160
"components library"
163161
],
162+
"dependencies": {
163+
"@fontsource-variable/inter": "5.0.8",
164+
"@oddbird/popover-polyfill": "0.3.7",
165+
"body-scroll-lock-upgrade": "1.1.0",
166+
"canvas-confetti": "1.9.2",
167+
"class-variance-authority": "0.7.0",
168+
"clsx": "2.0.0",
169+
"tslib": "^2.6.2"
170+
},
164171
"nx": {
165172
"includedScripts": []
166173
}

0 commit comments

Comments
 (0)