Skip to content

Commit 44dca74

Browse files
Merge branch 'add-headless-autocomplete' of https://github.com/thejackshelton/qwik-ui into add-headless-autocomplete
2 parents 5c70983 + 3953d5f commit 44dca74

File tree

29 files changed

+1203
-226
lines changed

29 files changed

+1203
-226
lines changed

CONTRIBUTING.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,21 @@ If you need to update your PR for some reason -
118118

119119
<br/>
120120

121-
### ▶ 9. After your PR is merged - delete your branches
121+
### ▶ 9. Sign the CLA
122+
123+
You will be asked to sign a [CLA (Contributor License Agreement)](/CLA.md) as part of the PR process, if you haven't already signed it.
124+
125+
Simply submit a comment on your PR with the following text:
126+
127+
```
128+
I have read the CLA Document and I hereby sign the CLA
129+
```
130+
131+
The CLA assistant will automatically add your signature [here](/cla-signs/v1/cla.json) and push a commit to the main branch.
132+
133+
<br/>
134+
135+
### ▶ 10. After your PR is merged - delete your branches
122136

123137
After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:
124138

@@ -148,6 +162,6 @@ After your pull request is merged, you can safely delete your branch and pull th
148162

149163
<br/>
150164

151-
### 10. That's it! Thank you for your contribution! 🙏💓
165+
### 11. That's it! Thank you for your contribution! 🙏💓
152166

153167
[commit-message-format]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export const componentsStatuses: ComponentKitsStatuses = {
4141
headless: {
4242
Accordion: 'Planned',
4343
Carousel: 'Planned',
44+
Popover: 'Planned',
4445
Select: 'Draft',
4546
Tabs: 'Planned',
4647
Toggle: 'Planned',

apps/website/src/components/keyboard-interaction-table/keyboard-interaction-table.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export const KeyboardInteractionTable = component$(
2323
</thead>
2424
<tbody>
2525
{props.keyDescriptors.map((descriptor) => {
26-
console.log('descriptor', descriptor);
2726
return (
2827
<KBInteractionTableRow
2928
key={descriptor.keyTitle}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { Slot, component$ } from '@builder.io/qwik';
2+
import { Popover, PopoverContent, PopoverTrigger } from '@qwik-ui/headless';
3+
import { GitHubIcon } from 'apps/website/src/components/icons/GitHubIcon';
4+
import { PreviewCodeExample } from 'apps/website/src/components/preview-code-example/preview-code-example';
5+
6+
export const MainExample = component$(() => {
7+
return (
8+
<PreviewCodeExample>
9+
<div q:slot="actualComponent">
10+
<Popover>
11+
<PopoverContent>
12+
<div class="p-4 bg-gray-500">Hi, I'm the content</div>
13+
</PopoverContent>
14+
<PopoverTrigger> Click on me </PopoverTrigger>
15+
</Popover>
16+
</div>
17+
<div q:slot="codeExample">
18+
<Slot />
19+
</div>
20+
</PreviewCodeExample>
21+
);
22+
});
23+
24+
export const Example1 = component$(() => {
25+
return (
26+
<PreviewCodeExample>
27+
<div q:slot="actualComponent">
28+
<Popover placement="top">
29+
<PopoverContent>
30+
<div class="p-4 bg-gray-500">
31+
Hi, I'm the content, but now on top
32+
</div>
33+
</PopoverContent>
34+
<PopoverTrigger> Click on me </PopoverTrigger>
35+
</Popover>
36+
</div>
37+
<div q:slot="codeExample">
38+
<Slot />
39+
</div>
40+
</PreviewCodeExample>
41+
);
42+
});
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
title: Qwik UI | Popover
3+
---
4+
5+
import { Popover } from '@qwik-ui/headless';
6+
import { MainExample, Example1 } from './examples';
7+
import { CodeExample } from '../../../../../components/code-example/code-example';
8+
import { KeyboardInteractionTable } from '../../../../../components/keyboard-interaction-table/keyboard-interaction-table';
9+
import { APITable } from '../../../../../components/api-table/api-table';
10+
11+
# Popover
12+
13+
#### A popover is an element that displays a modal with content when the user clicks or hovers on a trigger element.
14+
15+
<MainExample>
16+
```tsx
17+
<Popover>
18+
<PopoverContent>
19+
<div class="p-4 bg-gray-500">Hi, I'm the content</div>
20+
</PopoverContent>
21+
<PopoverTrigger> Click on me </PopoverTrigger>
22+
</Popover>
23+
```
24+
</MainExample>
25+
26+
## Building blocks
27+
28+
<CodeExample>
29+
```tsx
30+
import { component$ } from '@builder.io/qwik';
31+
import { Popover } from '@qwik-ui/headless';
32+
33+
export default component$(() => (
34+
<Popover>
35+
<PopoverContent>
36+
<div class="p-4 bg-gray-500">Hi, I'm the content</div>
37+
</PopoverContent>
38+
<PopoverTrigger> Click on me </PopoverTrigger>
39+
</Popover>
40+
));
41+
```
42+
43+
</CodeExample>
44+
45+
## Examples
46+
47+
### EXAMPLE: Positioning the popover's content (on top)
48+
49+
<Example1>
50+
```tsx
51+
<Popover placement="top">
52+
<PopoverContent>
53+
<div class="p-4 bg-gray-500">Hi, I'm the content, but now on top</div>
54+
</PopoverContent>
55+
<PopoverTrigger> Click on me </PopoverTrigger>
56+
</Popover>
57+
```
58+
</Example1>
59+
60+
## API
61+
62+
### Popover
63+
64+
<APITable
65+
propDescriptors={[
66+
{
67+
name: 'placement',
68+
type: '"top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end"',
69+
description: 'The side where to show the popover.',
70+
},
71+
{
72+
name: 'triggerEvent',
73+
type: '"click" | "mouseOver"',
74+
description: 'Popover is opened when trigger is clicked or mouse overed.',
75+
},
76+
{
77+
name: 'offset',
78+
type: 'number',
79+
description: 'Offset between trigger and content.',
80+
},
81+
{
82+
name: 'isOpen',
83+
type: 'boolean',
84+
description:
85+
'Open or close the popover when popover is controlled by the parent.',
86+
},
87+
{
88+
name: 'disableClickOutSide',
89+
type: 'boolean',
90+
description: 'When true the popover is not closed when click outside.',
91+
},
92+
{
93+
name: 'onUpdate$',
94+
type: 'PropFunction<(isOpen: boolean) => void>',
95+
description: 'Notify a state update to the parent.',
96+
},
97+
]}
98+
/>

apps/website/src/routes/docs/headless/(components)/popover/index.tsx

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

apps/website/src/routes/docs/headless/(components)/tabs/index.mdx

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,46 @@ import { APITable } from '../../../../../components/api-table/api-table';
8888
keyDescriptors={[
8989
{
9090
keyTitle: 'Tab',
91-
description: 'Moves focus to next tab.',
91+
description: 'Moves focus to the selected panel.',
9292
},
9393
{
9494
keyTitle: 'Shift + Tab',
95+
description: 'Moves focus to the selected tab.',
96+
},
97+
{
98+
keyTitle: 'ArrowRight',
99+
description: 'Moves focus to the next tab.',
100+
},
101+
{
102+
keyTitle: 'ArrowLeft',
95103
description: 'Moves focus to the previous tab.',
96104
},
105+
{
106+
keyTitle: 'ArrowDown',
107+
description: 'In "vertical mode", moves focus to the next tab.',
108+
},
109+
{
110+
keyTitle: 'ArrowUp',
111+
description: 'In "vertical mode", moves focus to the previous tab.',
112+
},
113+
{
114+
/* {
115+
keyTitle: 'Home',
116+
description: 'Moves focus to the first tab.',
117+
},
118+
{
119+
keyTitle: 'PageUp',
120+
description: 'Moves focus to the first tab.',
121+
},
122+
{
123+
keyTitle: 'End',
124+
description: 'Moves focus to the last tab.',
125+
},
126+
{
127+
keyTitle: 'PageDown',
128+
description: 'Moves focus to the first tab.',
129+
}, */
130+
},
97131
]}
98132
/>
99133

@@ -109,6 +143,12 @@ import { APITable } from '../../../../../components/api-table/api-table';
109143
description:
110144
'Toggle between automatic or manual. The automatic behavior moves between tabs when hover. The manual behavior moves between tabs on click.',
111145
},
146+
{
147+
name: 'vertical',
148+
type: 'boolean',
149+
description:
150+
'If set to true, the behavior of UpArrow and DownArrow will navigate between tabs vertically instead of horizontally.',
151+
},
112152
]}
113153
/>
114154

apps/website/src/routes/docs/headless/(components)/tooltip/index.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { APITable } from '../../../../../components/api-table/api-table';
1010

1111
# Tooltip
1212

13-
#### A popup that displays information realted to an element when the element receives keyboard focus or the mouse hovers over it.
13+
#### A tooltip that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
1414

1515
<MainExample>
1616
```tsx
@@ -41,7 +41,7 @@ import { APITable } from '../../../../../components/api-table/api-table';
4141

4242
## Examples
4343

44-
### EXAMPLE: Describing Unlabelled Icon Link
44+
### EXAMPLE: Describing Icon with Tooltip
4545

4646
<Example1>
4747
```tsx
@@ -72,7 +72,7 @@ import { APITable } from '../../../../../components/api-table/api-table';
7272

7373
## API
7474

75-
### AccordionItem
75+
### Tooltip
7676

7777
<APITable
7878
propDescriptors={[
@@ -88,7 +88,7 @@ import { APITable } from '../../../../../components/api-table/api-table';
8888
},
8989
{
9090
name: 'durationMs',
91-
type: 'nummber',
91+
type: 'number',
9292
description:
9393
'Sets a delay duration in milliseconds before the Tooltip is displayed.',
9494
},

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
- [Accordion](/docs/headless/accordion)
1212
- [Carousel](/docs/headless/carousel)
13+
- [Popover](/docs/headless/popover)
1314
- [Select](/docs/headless/select)
1415
- [Tabs](/docs/headless/tabs)
1516
- [Toggle](/docs/headless/toggle)

cla-signs/v1/cla.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,14 @@
271271
"created_at": "2023-05-23T18:42:55Z",
272272
"repoId": 545159943,
273273
"pullRequestNo": 324
274+
},
275+
{
276+
"name": "igalklebanov",
277+
"id": 14938291,
278+
"comment_id": 1584384229,
279+
"created_at": "2023-06-09T10:54:23Z",
280+
"repoId": 545159943,
281+
"pullRequestNo": 332
274282
}
275283
]
276284
}

0 commit comments

Comments
 (0)