Skip to content

Commit a6cdc31

Browse files
committed
refactor: simplified props passing fix
1 parent 3275522 commit a6cdc31

File tree

10 files changed

+2479
-65923
lines changed

10 files changed

+2479
-65923
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const MainExample = component$(() => {
1010
<PopoverContent>
1111
<div class="p-4 bg-gray-500">Hi, I'm the content</div>
1212
</PopoverContent>
13-
<PopoverTrigger aria-label="Freund">Click on me</PopoverTrigger>
13+
<PopoverTrigger>Click on me</PopoverTrigger>
1414
</Popover>
1515
</div>
1616
<div q:slot="codeExample">
@@ -28,7 +28,7 @@ export const Example1 = component$(() => {
2828
<PopoverContent>
2929
<div class="p-4 bg-gray-500">Hi, I'm the content, but now on top</div>
3030
</PopoverContent>
31-
<PopoverTrigger aria-label="no-click-friend">Click on me</PopoverTrigger>
31+
<PopoverTrigger>Click on me</PopoverTrigger>
3232
</Popover>
3333
</div>
3434
<div q:slot="codeExample">

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

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default component$(() => {
1616
<Box />
1717
</PopoverContent>
1818

19-
<PopoverTrigger ariaAttributes={{ ariaLabel: 'click-friend' }}>
19+
<PopoverTrigger>
2020
<Button onClick$={() => console.log('here')}> CLICK ME </Button>
2121
</PopoverTrigger>
2222
</Popover>
@@ -26,9 +26,7 @@ export default component$(() => {
2626
<Box />
2727
</PopoverContent>
2828
<PopoverTrigger>
29-
<Button onClick$={() => console.log('here')}>
30-
Offset and position
31-
</Button>
29+
<Button onClick$={() => console.log('here')}>Offset and position</Button>
3230
</PopoverTrigger>
3331
</Popover>
3432

@@ -88,8 +86,8 @@ export default component$(() => {
8886

8987
<h1 class="mt-8">DISABLE CLICK OUTSIDE</h1>
9088
<p>
91-
Popovers are not closed when click outside but they can be closed
92-
clicking their own trigger button only
89+
Popovers are not closed when click outside but they can be closed clicking their
90+
own trigger button only
9391
</p>
9492

9593
<div class="flex flex-col gap-2">
@@ -140,8 +138,8 @@ export default component$(() => {
140138
<code>Current state: {JSON.stringify(controlledPopover.value)}</code>
141139
</div>
142140
<p>
143-
The popover can be closed clicking outside or clicking the CLOSE button
144-
inside the popover
141+
The popover can be closed clicking outside or clicking the CLOSE button inside the
142+
popover
145143
</p>
146144
<p>the onUpdate$ callback allows you to sync local and popover states</p>
147145

@@ -156,16 +154,12 @@ export default component$(() => {
156154
<Card>
157155
<CardBody>
158156
<CardTitle>title</CardTitle>
159-
<Button onClick$={() => (controlledPopover.value = false)}>
160-
CLOSE ME
161-
</Button>
157+
<Button onClick$={() => (controlledPopover.value = false)}>CLOSE ME</Button>
162158
</CardBody>
163159
</Card>
164160
</PopoverContent>
165161
<PopoverTrigger>
166-
<Button onClick$={() => console.log('clicked')}>
167-
TOGGLE POPOVER
168-
</Button>
162+
<Button onClick$={() => console.log('clicked')}>TOGGLE POPOVER</Button>
169163
</PopoverTrigger>
170164
</Popover>
171165

0 commit comments

Comments
 (0)