Skip to content

Commit c3e732e

Browse files
authored
Merge pull request #301 from shiroinegai/refactor-select-naming-convention
2 parents ba8ae7f + 6f273d5 commit c3e732e

File tree

5 files changed

+320
-308
lines changed

5 files changed

+320
-308
lines changed

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

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
import { Slot, component$, useId } from '@builder.io/qwik';
22
import {
3-
Root,
4-
Label,
5-
Trigger,
6-
Value,
7-
Marker,
8-
ListBox,
9-
Option,
10-
Group,
3+
SelectRoot,
4+
SelectLabel,
5+
SelectTrigger,
6+
SelectValue,
7+
SelectMarker,
8+
SelectListBox,
9+
SelectOption,
10+
SelectGroup,
1111
} from '@qwik-ui/headless';
1212
import { PreviewCodeExample } from 'apps/website/src/components/preview-code-example/preview-code-example';
1313

1414
export const Example01 = component$(() => {
1515
return (
1616
<PreviewCodeExample>
1717
<div q:slot="actualComponent">
18-
<Root>
19-
<Label class="text-black dark:text-white">
18+
<SelectRoot>
19+
<SelectLabel class="text-black dark:text-white">
2020
Lorem ipsum dolor sit amet
21-
</Label>
22-
<Trigger class="flex justify-between items-center border-slate-200 dark:border-gray-600 border-[1px] p-4">
23-
<Value placeholder="Select an option! ⚡" />
24-
<Marker class="w-6 h-6">
21+
</SelectLabel>
22+
<SelectTrigger class="flex justify-between items-center border-slate-200 dark:border-gray-600 border-[1px] p-4">
23+
<SelectValue placeholder="Select an option! ⚡" />
24+
<SelectMarker class="w-6 h-6">
2525
<svg
2626
xmlns="http://www.w3.org/2000/svg"
2727
viewBox="0 0 24 24"
@@ -33,30 +33,30 @@ export const Example01 = component$(() => {
3333
>
3434
<polyline points="6 9 12 15 18 9"></polyline>
3535
</svg>
36-
</Marker>
37-
</Trigger>
38-
<ListBox class="bg-slate-100 dark:bg-gray-700 border-slate-200 dark:border-gray-600 border-[1px]">
39-
<Option value="🚀 Qwik" class="p-4" />
40-
<Group class="p-4">
41-
<Label class="p-4">Fruits</Label>
36+
</SelectMarker>
37+
</SelectTrigger>
38+
<SelectListBox class="bg-slate-100 dark:bg-gray-700 border-slate-200 dark:border-gray-600 border-[1px]">
39+
<SelectOption value="🚀 Qwik" class="p-4" />
40+
<SelectGroup class="p-4">
41+
<SelectLabel class="p-4">Fruits</SelectLabel>
4242
{[
4343
{ value: '🍎 Apple', disabled: false },
4444
{ value: '🍌 Banana', disabled: false },
4545
{ value: '🍒 Cherry', disabled: false },
4646
{ value: '🐲 Dragonfruit', disabled: true },
4747
].map((option) => {
4848
return (
49-
<Option
49+
<SelectOption
5050
key={useId()}
5151
value={option.value}
5252
disabled={option.disabled}
5353
class="aria-disabled:text-red-500 aria-disabled:cursor-not-allowed hover:bg-slate-300 dark:hover:bg-gray-600 p-4"
5454
/>
5555
);
5656
})}
57-
</Group>
58-
</ListBox>
59-
</Root>
57+
</SelectGroup>
58+
</SelectListBox>
59+
</SelectRoot>
6060
</div>
6161

6262
<div q:slot="codeExample">
@@ -70,10 +70,10 @@ export const Example02 = component$(() => {
7070
return (
7171
<PreviewCodeExample>
7272
<div q:slot="actualComponent">
73-
<Root>
74-
<Trigger class="flex justify-between items-center border-slate-200 dark:border-gray-600 border-[1px] p-4">
75-
<Value placeholder="Home" />
76-
<Marker class="w-6 h-6">
73+
<SelectRoot>
74+
<SelectTrigger class="flex justify-between items-center border-slate-200 dark:border-gray-600 border-[1px] p-4">
75+
<SelectValue placeholder="Home" />
76+
<SelectMarker class="w-6 h-6">
7777
<svg
7878
xmlns="http://www.w3.org/2000/svg"
7979
viewBox="0 0 24 24"
@@ -85,14 +85,14 @@ export const Example02 = component$(() => {
8585
>
8686
<polyline points="6 9 12 15 18 9"></polyline>
8787
</svg>
88-
</Marker>
89-
</Trigger>
90-
<ListBox class="bg-slate-100 dark:bg-gray-700 border-slate-200 dark:border-gray-600 border-[1px]">
91-
<Option value="Orders" class="p-4" />
92-
<Option value="Settings" class="p-4" />
93-
<Option value="Contact us" class="p-4" />
94-
</ListBox>
95-
</Root>
88+
</SelectMarker>
89+
</SelectTrigger>
90+
<SelectListBox class="bg-slate-100 dark:bg-gray-700 border-slate-200 dark:border-gray-600 border-[1px]">
91+
<SelectOption value="Orders" class="p-4" />
92+
<SelectOption value="Settings" class="p-4" />
93+
<SelectOption value="Contact us" class="p-4" />
94+
</SelectListBox>
95+
</SelectRoot>
9696
</div>
9797

9898
<div q:slot="codeExample">

0 commit comments

Comments
 (0)