feat: bump cmdk + use data attributes for styling

This commit is contained in:
kevinmitch14
2024-01-30 18:54:42 -03:00
parent f859d4857e
commit 5155a5336c
7 changed files with 10 additions and 15 deletions

View File

@@ -149,7 +149,7 @@ function ModelItem({ model, isSelected, onSelect, onPeek }: ModelItemProps) {
key={model.id}
onSelect={onSelect}
ref={ref}
className="aria-selected:bg-primary aria-selected:text-primary-foreground"
className="data-[selected]:bg-primary data-[selected]:text-primary-foreground"
>
{model.name}
<CheckIcon

View File

@@ -52,7 +52,7 @@
"@vercel/og": "^0.0.21",
"class-variance-authority": "^0.4.0",
"clsx": "^1.2.1",
"cmdk": "^0.2.0",
"cmdk": "^0.2.1",
"contentlayer": "0.3.4",
"date-fns": "^2.30.0",
"embla-carousel-autoplay": "8.0.0-rc15",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -117,7 +117,7 @@ const CommandItem = React.forwardRef<
<CommandPrimitive.Item
ref={ref}
className={cn(
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[selected]:bg-accent data-[selected]:text-accent-foreground data-[disabled]:opacity-50",
className
)}
{...props}

View File

@@ -117,7 +117,7 @@ const CommandItem = React.forwardRef<
<CommandPrimitive.Item
ref={ref}
className={cn(
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[selected]:bg-accent data-[selected]:text-accent-foreground data-[disabled]:opacity-50",
className
)}
{...props}

13
pnpm-lock.yaml generated
View File

@@ -213,8 +213,8 @@ importers:
specifier: ^1.2.1
version: 1.2.1
cmdk:
specifier: ^0.2.0
version: 0.2.0(@types/react@18.2.7)(react-dom@18.2.0)(react@18.2.0)
specifier: ^0.2.1
version: 0.2.1(@types/react@18.2.7)(react-dom@18.2.0)(react@18.2.0)
contentlayer:
specifier: 0.3.4
version: 0.3.4(esbuild@0.17.19)(markdown-wasm@1.2.0)
@@ -5408,14 +5408,13 @@ packages:
engines: {node: '>=6'}
dev: false
/cmdk@0.2.0(@types/react@18.2.7)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-JQpKvEOb86SnvMZbYaFKYhvzFntWBeSZdyii0rZPhKJj9uwJBxu4DaVYDrRN7r3mPop56oPhRw+JYWTKs66TYw==}
/cmdk@0.2.1(@types/react@18.2.7)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-U6//9lQ6JvT47+6OF6Gi8BvkxYQ8SCRRSKIJkthIMsFsLZRG0cKvTtuTaefyIKMQb8rvvXy0wGdpTNq/jPtm+g==}
peerDependencies:
react: ^18.0.0
react-dom: ^18.0.0
dependencies:
'@radix-ui/react-dialog': 1.0.0(@types/react@18.2.7)(react-dom@18.2.0)(react@18.2.0)
command-score: 0.1.2
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
transitivePeerDependencies:
@@ -5461,10 +5460,6 @@ packages:
/comma-separated-tokens@2.0.3:
resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==}
/command-score@0.1.2:
resolution: {integrity: sha512-VtDvQpIJBvBatnONUsPzXYFVKQQAhuf3XTNOAsdBxCNO/QCtUUd8LSgjn0GVarBkCad6aJCZfXgrjYbl/KRr7w==}
dev: false
/commander@10.0.0:
resolution: {integrity: sha512-zS5PnTI22FIRM6ylNW8G4Ap0IEOyk62fhLSD0+uHRT9McRCLGpkVNvao4bjimpK/GShynyQkFFxHhwMcETmduA==}
engines: {node: '>=14'}