Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Fixing examples / themes #699

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import { Input } from "@/registry/default/ui/input";
import { Label } from "@/registry/default/ui/label";
import { Textarea } from "@/registry/default/ui/textarea";
import { nanoid } from "nanoid";

const areas = [
{
Expand Down Expand Up @@ -47,6 +48,8 @@
label: "Severity 4 (Lowest)"
}
];

const id = nanoid(5);
</script>

<Card.Root>
Expand All @@ -57,9 +60,9 @@
<Card.Content class="grid gap-6">
<div class="grid grid-cols-2 gap-4">
<div class="grid gap-2">
<Label for="area">Area</Label>
<Label for={`area-${id}`}>Area</Label>
<Select.Root selected={areas[1]}>
<Select.Trigger id="area">
<Select.Trigger id={`area-${id}`}>
<Select.Value placeholder="Select" />
</Select.Trigger>
<Select.Content>
Expand All @@ -72,9 +75,9 @@
</Select.Root>
</div>
<div class="grid gap-2">
<Label for="security-level">Security Level</Label>
<Label for={`security-level-${id}`}>Security Level</Label>
<Select.Root selected={securityLevels[1]}>
<Select.Trigger id="security-level">
<Select.Trigger id={`security-level-${id}`}>
<Select.Value placeholder="Select level" />
</Select.Trigger>
<Select.Content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
</div>
</div>
<Popover.Root>
<Popover.Trigger asChild>
<Button variant="outline" size="sm" class="ml-auto">
<Popover.Trigger asChild let:builder>
<Button builders={[builder]} variant="outline" size="sm" class="ml-auto">
Owner{" "}
<ChevronDownIcon class="ml-2 h-4 w-4 text-muted-foreground" />
</Button>
Expand Down Expand Up @@ -88,8 +88,8 @@
</div>
</div>
<Popover.Root>
<Popover.Trigger asChild>
<Button variant="outline" size="sm" class="ml-auto">
<Popover.Trigger asChild let:builder>
<Button builders={[builder]} variant="outline" size="sm" class="ml-auto">
Member{" "}
<ChevronDownIcon class="ml-2 h-4 w-4 text-muted-foreground" />
</Button>
Expand Down Expand Up @@ -150,8 +150,8 @@
</div>
</div>
<Popover.Root>
<Popover.Trigger asChild>
<Button variant="outline" size="sm" class="ml-auto">
<Popover.Trigger asChild let:builder>
<Button builders={[builder]} variant="outline" size="sm" class="ml-auto">
Member{" "}
<ChevronDownIcon class="ml-2 h-4 w-4 text-muted-foreground" />
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import { Input } from "@/registry/new-york/ui/input";
import { Label } from "@/registry/new-york/ui/label";
import { Textarea } from "@/registry/new-york/ui/textarea";
import { nanoid } from "nanoid";
const areas = [
{
value: "team",
Expand Down Expand Up @@ -46,6 +47,8 @@
label: "Severity 4 (Lowest)"
}
];

const id = nanoid(5);
</script>

<Card.Root>
Expand All @@ -56,9 +59,9 @@
<Card.Content class="grid gap-6">
<div class="grid grid-cols-2 gap-4">
<div class="grid gap-2">
<Label for="area">Area</Label>
<Label for={`area-${id}`}>Area</Label>
<Select.Root selected={areas[1]}>
<Select.Trigger id="area">
<Select.Trigger id={`area-${id}`}>
<Select.Value placeholder="Select" />
</Select.Trigger>
<Select.Content>
Expand All @@ -71,9 +74,9 @@
</Select.Root>
</div>
<div class="grid gap-2">
<Label for="security-level">Security Level</Label>
<Label for={`security-level-${id}`}>Security Level</Label>
<Select.Root selected={securityLevels[1]}>
<Select.Trigger id="security-level">
<Select.Trigger id={`security-level-${id}`}>
<Select.Value placeholder="Select level" />
</Select.Trigger>
<Select.Content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
</div>
</div>
<Popover.Root>
<Popover.Trigger asChild>
<Button variant="outline" size="sm" class="ml-auto">
<Popover.Trigger asChild let:builder>
<Button builders={[builder]} variant="outline" size="sm" class="ml-auto">
Owner{" "}
<ChevronDown class="ml-2 h-4 w-4 text-muted-foreground" />
</Button>
Expand Down Expand Up @@ -88,8 +88,8 @@
</div>
</div>
<Popover.Root>
<Popover.Trigger asChild>
<Button variant="outline" size="sm" class="ml-auto">
<Popover.Trigger asChild let:builder>
<Button builders={[builder]} variant="outline" size="sm" class="ml-auto">
Member{" "}
<ChevronDown class="ml-2 h-4 w-4 text-muted-foreground" />
</Button>
Expand Down Expand Up @@ -150,8 +150,8 @@
</div>
</div>
<Popover.Root>
<Popover.Trigger asChild>
<Button variant="outline" size="sm" class="ml-auto">
<Popover.Trigger asChild let:builder>
<Button builders={[builder]} variant="outline" size="sm" class="ml-auto">
Member{" "}
<ChevronDown class="ml-2 h-4 w-4 text-muted-foreground" />
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
</Menubar.RadioGroup>
</Menubar.Group>
<Menubar.Separator />
<Menubar.Item inset>Manage Famliy...</Menubar.Item>
<Menubar.Item inset>Manage Family...</Menubar.Item>
<Menubar.Separator />
<Menubar.Item inset>Add Account...</Menubar.Item>
</Menubar.Content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
<Command.Item
value={model.name}
class="aria-selected:bg-primary aria-selected:text-primary-foreground"
onSelect={(currentValue) => {
value = currentValue;
onSelect={() => {
value = model.id;
closeAndFocusTrigger(ids.trigger);
}}
>
Expand Down
Loading