Skip to content

Commit

Permalink
chore: merge upstream updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jingsam committed Aug 29, 2024
2 parents 2507609 + 12fab77 commit 729b986
Show file tree
Hide file tree
Showing 64 changed files with 1,824 additions and 1,121 deletions.
44 changes: 23 additions & 21 deletions apps/design-system/content/docs/components/combobox.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,27 +78,29 @@ export function ComboboxDemo() {
<PopoverContent className="w-[200px] p-0">
<Command>
<CommandInput placeholder="Search framework..." />
<CommandEmpty>No framework found.</CommandEmpty>
<CommandGroup>
{frameworks.map((framework) => (
<CommandItem
key={framework.value}
value={framework.value}
onSelect={(currentValue) => {
setValue(currentValue === value ? '' : currentValue)
setOpen(false)
}}
>
<Check
className={cn(
'mr-2 h-4 w-4',
value === framework.value ? 'opacity-100' : 'opacity-0'
)}
/>
{framework.label}
</CommandItem>
))}
</CommandGroup>
<CommandList>
<CommandEmpty>No framework found.</CommandEmpty>
<CommandGroup>
{frameworks.map((framework) => (
<CommandItem
key={framework.value}
value={framework.value}
onSelect={(currentValue) => {
setValue(currentValue === value ? '' : currentValue)
setOpen(false)
}}
>
<Check
className={cn(
'mr-2 h-4 w-4',
value === framework.value ? 'opacity-100' : 'opacity-0'
)}
/>
{framework.label}
</CommandItem>
))}
</CommandGroup>
</CommandList>
</Command>
</PopoverContent>
</Popover>
Expand Down
53 changes: 29 additions & 24 deletions apps/design-system/registry/default/example/combobox-demo.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
'use client'

import * as React from 'react'
import { Check, ChevronsUpDown } from 'lucide-react'
import * as React from 'react'

import { cn } from '@/lib/utils'
import { Button } from 'ui'
import {
Button,
Command_Shadcn_,
CommandEmpty_Shadcn_,
CommandGroup_Shadcn_,
CommandInput_Shadcn_,
CommandItem_Shadcn_,
CommandList_Shadcn_,
Popover_Shadcn_,
PopoverContent_Shadcn_,
PopoverTrigger_Shadcn_,
} from 'ui'
import { Popover_Shadcn_, PopoverContent_Shadcn_, PopoverTrigger_Shadcn_ } from 'ui'

const frameworks = [
{
Expand Down Expand Up @@ -60,27 +63,29 @@ export default function ComboboxDemo() {
<PopoverContent_Shadcn_ className="w-[200px] p-0">
<Command_Shadcn_>
<CommandInput_Shadcn_ placeholder="Search framework..." />
<CommandEmpty_Shadcn_>No framework found.</CommandEmpty_Shadcn_>
<CommandGroup_Shadcn_>
{frameworks.map((framework) => (
<CommandItem_Shadcn_
key={framework.value}
value={framework.value}
onSelect={(currentValue) => {
setValue(currentValue === value ? '' : currentValue)
setOpen(false)
}}
>
<Check
className={cn(
'mr-2 h-4 w-4',
value === framework.value ? 'opacity-100' : 'opacity-0'
)}
/>
{framework.label}
</CommandItem_Shadcn_>
))}
</CommandGroup_Shadcn_>
<CommandList_Shadcn_>
<CommandEmpty_Shadcn_>No framework found.</CommandEmpty_Shadcn_>
<CommandGroup_Shadcn_>
{frameworks.map((framework) => (
<CommandItem_Shadcn_
key={framework.value}
value={framework.value}
onSelect={(currentValue) => {
setValue(currentValue === value ? '' : currentValue)
setOpen(false)
}}
>
<Check
className={cn(
'mr-2 h-4 w-4',
value === framework.value ? 'opacity-100' : 'opacity-0'
)}
/>
{framework.label}
</CommandItem_Shadcn_>
))}
</CommandGroup_Shadcn_>
</CommandList_Shadcn_>
</Command_Shadcn_>
</PopoverContent_Shadcn_>
</Popover_Shadcn_>
Expand Down
43 changes: 23 additions & 20 deletions apps/design-system/registry/default/example/combobox-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
CommandGroup_Shadcn_,
CommandInput_Shadcn_,
CommandItem_Shadcn_,
CommandList_Shadcn_,
} from 'ui'
import {
Form_Shadcn_,
Expand Down Expand Up @@ -96,26 +97,28 @@ export default function ComboboxForm() {
<PopoverContent_Shadcn_ className="w-[200px] p-0">
<Command_Shadcn_>
<CommandInput_Shadcn_ placeholder="Search language..." />
<CommandEmpty_Shadcn_>No language found.</CommandEmpty_Shadcn_>
<CommandGroup_Shadcn_>
{languages.map((language) => (
<CommandItem_Shadcn_
value={language.label}
key={language.value}
onSelect={() => {
form.setValue('language', language.value)
}}
>
<Check
className={cn(
'mr-2 h-4 w-4',
language.value === field.value ? 'opacity-100' : 'opacity-0'
)}
/>
{language.label}
</CommandItem_Shadcn_>
))}
</CommandGroup_Shadcn_>
<CommandList_Shadcn_>
<CommandEmpty_Shadcn_>No language found.</CommandEmpty_Shadcn_>
<CommandGroup_Shadcn_>
{languages.map((language) => (
<CommandItem_Shadcn_
value={language.label}
key={language.value}
onSelect={() => {
form.setValue('language', language.value)
}}
>
<Check
className={cn(
'mr-2 h-4 w-4',
language.value === field.value ? 'opacity-100' : 'opacity-0'
)}
/>
{language.label}
</CommandItem_Shadcn_>
))}
</CommandGroup_Shadcn_>
</CommandList_Shadcn_>
</Command_Shadcn_>
</PopoverContent_Shadcn_>
</Popover_Shadcn_>
Expand Down
Loading

0 comments on commit 729b986

Please sign in to comment.