Skip to content

Commit ebf5509

Browse files
committed
feat(api table-popover): added the info popover to the API table
added the info popover to the API table- to check
1 parent b225360 commit ebf5509

File tree

8 files changed

+58
-13
lines changed

8 files changed

+58
-13
lines changed

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

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import { component$ } from '@builder.io/qwik';
2-
2+
import { Tooltip } from '@qwik-ui/headless';
3+
import { Popover, PopoverContent, PopoverTrigger } from '@qwik-ui/headless';
4+
import {} from '@qwik-ui/headless';
5+
import { Button } from '@qwik-ui/tailwind';
36
type APITableProps = {
47
propDescriptors: {
58
name: string;
9+
info: string;
610
type: string;
711
description: string;
812
}[];
@@ -28,8 +32,37 @@ export const APITable = component$(({ propDescriptors }: APITableProps) => {
2832
<code>{propDescriptor.name}</code>
2933
</td>
3034
<td class="prose prose-sm py-3 align-baseline">
31-
<span class="">
35+
<span class="flex items-center">
3236
<code>{propDescriptor.type}</code>
37+
{propDescriptor.info && (
38+
<Popover placement="top">
39+
<PopoverContent>
40+
<div class="bg-[#202425] text-[#7881fa] max-w-xs mb-2 text-md px-4 py-2 rounded-md">
41+
{propDescriptor?.info}
42+
</div>
43+
</PopoverContent>
44+
<PopoverTrigger>
45+
<div class="hover:bg-slate-500 hover:bg-opacity-50 h-[31px] mt-2 p-2 rounded-md">
46+
<svg
47+
width="15"
48+
height="15"
49+
viewBox="0 0 15 15"
50+
fill="none"
51+
xmlns="http://www.w3.org/2000/svg"
52+
aria-hidden="true"
53+
focusable="false"
54+
>
55+
<path
56+
d="M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z"
57+
fill="currentColor"
58+
fill-rule="evenodd"
59+
clip-rule="evenodd"
60+
></path>
61+
</svg>
62+
</div>{' '}
63+
</PopoverTrigger>
64+
</Popover>
65+
)}
3366
</span>
3467
</td>
3568
<td class="py-3 align-baseline">

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ import { APITable } from '../../../../../components/api-table/api-table';
164164
},
165165
{
166166
name: 'onClick$',
167-
type: 'PropFunction<() => void>',
167+
type: 'function',
168+
info: 'PropFunction<() => void>',
168169
description: 'A custom click handler',
169170
},
170171
]}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ By default, the API holds available attributes of both native DOM elements and c
164164
},
165165
{
166166
name: 'onClick$',
167-
type: 'PropFunction<() => void>',
167+
type: 'function',
168+
info: 'PropFunction<() => void>',
168169
description: 'A custom click handler',
169170
},
170171
]}

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,14 @@ import { APITable } from '../../../../../components/api-table/api-table';
6565
propDescriptors={[
6666
{
6767
name: 'placement',
68-
type: '"top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end"',
68+
type:"enum",
69+
info: '"top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end"',
6970
description: 'The side where to show the popover.',
7071
},
7172
{
7273
name: 'triggerEvent',
73-
type: '"click" | "mouseOver"',
74+
type: 'enum',
75+
info: '"click" | "mouseOver"',
7476
description: 'Popover is opened when trigger is clicked or mouse overed.',
7577
},
7678
{
@@ -91,8 +93,11 @@ import { APITable } from '../../../../../components/api-table/api-table';
9193
},
9294
{
9395
name: 'onUpdate$',
94-
type: 'PropFunction<(isOpen: boolean) => void>',
96+
type: 'function',
97+
info: 'PropFunction<(isOpen: boolean) => void>',
98+
9599
description: 'Notify a state update to the parent.',
96100
},
97-
]}
101+
102+
]}
98103
/>

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ by default, the tabs are horizontal, but you can adjust the underlying behavior
182182
},
183183
{
184184
name: 'onSelectedIndexChange$',
185-
type: '(index: number) => void',
185+
type: 'function',
186+
info: '(index: number) => void',
186187
description:
187188
'An event hook that getting notified whenever the selected index changes',
188189
},
@@ -200,7 +201,8 @@ by default, the tabs are horizontal, but you can adjust the underlying behavior
200201
},
201202
{
202203
name: 'onClick',
203-
type: '(event: QwikMouseEvent) => void',
204+
info: '(event: QwikMouseEvent) => void',
205+
type: 'function',
204206
description: 'A custom click handler to wire to tab click event',
205207
},
206208
{

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ import { APITable } from '../../../../../components/api-table/api-table';
8383
},
8484
{
8585
name: 'onClick$',
86-
type: 'PropFunction<() => void>',
86+
info: 'PropFunction<() => void>',
87+
type: 'function',
8788
description: 'A custom click handler to wire to the toggle click event',
8889
},
8990
{

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ import { APITable } from '../../../../../components/api-table/api-table';
9999
},
100100
{
101101
name: 'position',
102-
type: '"bottom" | "bottom-end" | "bottom-start" | "left" | "left-end" | "left-start" | "right" | "right-end" | "right-start" | "top" | "top-end" | "top-start"',
102+
type: 'enum',
103+
info: '"bottom" | "bottom-end" | "bottom-start" | "left" | "left-end" | "left-start" | "right" | "right-end" | "right-start" | "top" | "top-end" | "top-start"',
103104
description: 'Determines the position the Tooltip is rendered.',
104105
},
105106
]}

apps/website/src/routes/docs/tailwind/(components)/accordion/index.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ import { APITable } from '../../../../../components/api-table/api-table';
137137
},
138138
{
139139
name: 'onClick$',
140-
type: 'PropFunction<() => void>',
140+
info: 'PropFunction<() => void>',
141+
type: 'function',
141142
description: 'A custom click handler',
142143
},
143144
]}

0 commit comments

Comments
 (0)