Skip to content

Commit 8a4b4da

Browse files
authored
Merge pull request #387 from qwikifiers/pr-statuses
2 parents 3d61c68 + 42b3681 commit 8a4b4da

File tree

17 files changed

+291
-190
lines changed

17 files changed

+291
-190
lines changed

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,34 +35,34 @@
3535

3636
</details>
3737

38-
## ⚠ This is not ready for production!
39-
40-
This library is still in early stages and once we'll collect enough feedback from the community we'll release the first beta version.
41-
42-
### ROADMAP
43-
44-
- [ ] Deploy the documentation site
45-
- [ ] Add "Readiness" statuses to the components
46-
- [ ] Add a getting started video tutorial
47-
- [ ] Make a public storybook url
48-
- [ ] Deploy the tailwind-kit package
49-
- [ ] Cover all of the components with storybook tests
50-
- [ ] Add testing coverage reports
51-
- [ ] Add a contribution tutorial video
52-
5338
<br/>
5439

5540
## Installation of the headless components
5641

57-
> Please create issue if you encounter bugs.
58-
5942
```console
6043

6144
npm install -D @qwik-ui/headless
6245
```
6346

6447
<br/>
6548

49+
## Components Status
50+
51+
### Headless Kit
52+
53+
| Component | Planned | Draft (Alpha) | Beta | Stable |
54+
| :------------------------------------------------------------ | :-----: | ------------- | ---- | ------ |
55+
| [Accordion](https://qwikui.com/docs/headless/accordion) | | || |
56+
| [Autocomplete](https://qwikui.com/docs/headless/autocomplete) | || | |
57+
| Carousel || | | |
58+
| Dialog || | | |
59+
| Pagination || | | |
60+
| [Popover](https://qwikui.com/docs/headless/popover) | || | |
61+
| [Select](https://qwikui.com/docs/headless/select) | || | |
62+
| [Tabs](https://qwikui.com/docs/headless/tabs) | | || |
63+
| [Toggle](https://qwikui.com/docs/headless/toggle) || | | |
64+
| [Tooltip](https://qwikui.com/docs/headless/tooltip) | || | |
65+
6666
## Contributing
6767

6868
Want to contribute? Yayy! 🎉
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export enum ComponentStatus {
2+
Ready = 'Ready',
3+
Beta = 'Beta',
4+
Draft = 'Draft',
5+
Planned = 'Planned'
6+
}
Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
1-
export type BadgeStatus = 'Ready' | 'Draft' | 'Planned';
1+
import { ComponentStatus } from './component-status.type';
22

33
export interface ComponentsStatusesMap {
4-
[key: string]: BadgeStatus;
4+
[key: string]: ComponentStatus;
55
}
66

77
export type ComponentKitsStatuses = {
88
tailwind: ComponentsStatusesMap;
99
headless: ComponentsStatusesMap;
1010
};
1111

12-
export const componentsStatuses: ComponentKitsStatuses = {
12+
export const statusByComponent: ComponentKitsStatuses = {
1313
tailwind: {
14-
Accordion: 'Planned',
15-
Alert: 'Planned',
16-
Badge: 'Planned',
17-
Breadcrumb: 'Planned',
18-
Button: 'Planned',
19-
'Button Group': 'Planned',
20-
Card: 'Planned',
21-
Carousel: 'Planned',
22-
Checkbox: 'Planned',
23-
Collapse: 'Planned',
24-
Drawer: 'Planned',
25-
Input: 'Planned',
26-
'Input Phone': 'Planned',
27-
'Navigation Bar': 'Planned',
28-
Pagination: 'Planned',
29-
Popover: 'Planned',
30-
Progress: 'Planned',
31-
Radio: 'Planned',
32-
Rating: 'Planned',
33-
Select: 'Planned',
34-
Slider: 'Planned',
35-
Spinner: 'Planned',
36-
Tabs: 'Planned',
37-
Toast: 'Planned',
38-
Toggle: 'Planned',
39-
Tooltip: 'Planned'
14+
Accordion: ComponentStatus.Planned,
15+
Alert: ComponentStatus.Planned,
16+
Badge: ComponentStatus.Planned,
17+
Breadcrumb: ComponentStatus.Planned,
18+
Button: ComponentStatus.Planned,
19+
'Button Group': ComponentStatus.Planned,
20+
Card: ComponentStatus.Planned,
21+
Carousel: ComponentStatus.Planned,
22+
Checkbox: ComponentStatus.Planned,
23+
Collapse: ComponentStatus.Planned,
24+
Drawer: ComponentStatus.Planned,
25+
Input: ComponentStatus.Planned,
26+
'Input Phone': ComponentStatus.Planned,
27+
'Navigation Bar': ComponentStatus.Planned,
28+
Pagination: ComponentStatus.Planned,
29+
Popover: ComponentStatus.Planned,
30+
Progress: ComponentStatus.Planned,
31+
Radio: ComponentStatus.Planned,
32+
Rating: ComponentStatus.Planned,
33+
Select: ComponentStatus.Planned,
34+
Slider: ComponentStatus.Planned,
35+
Spinner: ComponentStatus.Planned,
36+
Tabs: ComponentStatus.Planned,
37+
Toast: ComponentStatus.Planned,
38+
Toggle: ComponentStatus.Planned,
39+
Tooltip: ComponentStatus.Planned
4040
},
4141
headless: {
42-
Accordion: 'Ready',
43-
Autocomplete: 'Draft',
44-
Carousel: 'Planned',
45-
Popover: 'Planned',
46-
Select: 'Draft',
47-
Tabs: 'Ready',
48-
Toggle: 'Planned',
49-
Tooltip: 'Planned'
42+
Accordion: ComponentStatus.Beta,
43+
Autocomplete: ComponentStatus.Draft,
44+
Carousel: ComponentStatus.Planned,
45+
Popover: ComponentStatus.Draft,
46+
Select: ComponentStatus.Draft,
47+
Tabs: ComponentStatus.Beta,
48+
Toggle: ComponentStatus.Planned,
49+
Tooltip: ComponentStatus.Draft
5050
}
5151
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { ComponentStatus } from './component-status.type';
2+
3+
export const tooltipByStatus = {
4+
[ComponentStatus.Ready]: 'This component is ready production.',
5+
[ComponentStatus.Beta]:
6+
'This component is ready for production, but the API might change.',
7+
[ComponentStatus.Draft]:
8+
'This component is still in development and may have bugs or missing features.',
9+
[ComponentStatus.Planned]: 'This component is planned for development.'
10+
};

apps/website/src/routes/docs/_components/alpha-banner/alpha-banner.tsx

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

apps/website/src/routes/docs/_components/component-status-badge/component-status-badge.tsx

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,33 @@
11
import { component$ } from '@builder.io/qwik';
22
import { Badge } from '@qwik-ui/tailwind';
3-
import { BadgeStatus } from '../../../../_state/component-statuses';
3+
import { ComponentStatus } from '../../../../_state/component-status.type';
4+
import { tooltipByStatus } from '../../../../_state/status-tooltips';
45

56
export interface StatusBadgeProps {
6-
status: BadgeStatus;
7+
status: ComponentStatus;
8+
}
9+
10+
export function getClassByStatus(status: ComponentStatus) {
11+
switch (status) {
12+
case ComponentStatus.Ready:
13+
return 'text-green-900 bg-green-300';
14+
case ComponentStatus.Beta:
15+
return 'dark:text-blue-900 dark:bg-blue-300 bg-purple-300 text-purple-900';
16+
case ComponentStatus.Draft:
17+
return 'text-amber-900 bg-amber-300';
18+
case ComponentStatus.Planned:
19+
return 'text-slate-900 bg-slate-300';
20+
default:
21+
return null;
22+
}
723
}
824

925
export const StatusBadge = component$<StatusBadgeProps>(({ status }) => {
1026
return (
1127
<Badge
12-
class={`text-lg lg:text-xs leading-3 font-medium rounded-full p-3 lg:py-1 lg:px-2 ${
13-
status === 'Ready'
14-
? 'text-green-900 bg-green-300'
15-
: status === 'Draft'
16-
? 'text-amber-900 bg-amber-300'
17-
: status === 'Planned'
18-
? 'text-slate-900 bg-slate-300'
19-
: null
20-
}`}
28+
title={tooltipByStatus[status]}
29+
class={`text-lg lg:text-xs leading-3 font-medium rounded-full p-3 lg:py-1 lg:px-2
30+
${getClassByStatus(status)}`}
2131
>
2232
{status}
2333
</Badge>

apps/website/src/routes/docs/_components/navigation-docs/navigation-docs.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { component$ } from '@builder.io/qwik';
2+
import { ComponentStatus } from 'apps/website/src/_state/component-status.type';
23
import { KitName } from 'apps/website/src/_state/kit-name.type';
34
import { useRootStore } from 'apps/website/src/_state/use-root-store';
4-
import { BadgeStatus } from '../../../../_state/component-statuses';
55
import { useSelectedKit } from '../../use-selected-kit';
66
import { StatusBadge } from '../component-status-badge/component-status-badge';
77

@@ -13,7 +13,7 @@ export interface LinkGroup {
1313
export interface LinkProps {
1414
name: string;
1515
href?: string;
16-
status?: BadgeStatus;
16+
status?: ComponentStatus;
1717
}
1818

1919
export interface DocsNavigationProps {
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
.normal-state {
2+
transition: margin-top 0.5s ease;
3+
}
4+
5+
/*
6+
if you see these media queries I'm sorry xd. Normally, you would use a transform here, since it reflects the elements size, but margin-top affects the siblig elements, and is the only way I can animate the upwards slide (without JS) in this component.
7+
8+
I could do it with JS using RequestAnimationFrame
9+
-Jack
10+
*/
11+
12+
.fade {
13+
animation: fadeOut 0.5s ease forwards;
14+
margin-top: -256px;
15+
}
16+
17+
@media (min-width: 336px) {
18+
.fade {
19+
margin-top: -232px;
20+
}
21+
}
22+
23+
@media (min-width: 365px) {
24+
.fade {
25+
margin-top: -208px;
26+
}
27+
}
28+
29+
@media (min-width: 405px) {
30+
.fade {
31+
margin-top: -184px;
32+
}
33+
}
34+
35+
@media (min-width: 479px) {
36+
.fade {
37+
margin-top: -160px;
38+
}
39+
}
40+
41+
@media (min-width: 812px) {
42+
.fade {
43+
margin-top: -112px;
44+
}
45+
}
46+
47+
@keyframes fadeOut {
48+
from {
49+
opacity: 1;
50+
}
51+
to {
52+
opacity: 0;
53+
}
54+
}

0 commit comments

Comments
 (0)