+
{preview?.image && (

)}
-
-
{title}
+
+
{title}
{description && (
-
- {description}
-
+
{description}
)}
diff --git a/packages/emcn/src/components/chip/chip.tsx b/packages/emcn/src/components/chip/chip.tsx
index 939e6345594..098604bd2b2 100644
--- a/packages/emcn/src/components/chip/chip.tsx
+++ b/packages/emcn/src/components/chip/chip.tsx
@@ -31,7 +31,7 @@ import {
* - `chipVariants({...})` → any other element (`
`, `` inner, etc.)
*
* @remarks
- * The implicit **default** variant is the bare pill — transparent, `--surface-hover` on hover. Omit `variant`
+ * The implicit **default** variant is the bare pill — transparent, `--surface-hover` on hover and keyboard focus. Omit `variant`
* to get it (shadcn-style); never write `variant='default'`. Named variants:
* `filled` (`--surface-5` light / `--surface-4` dark fill, `--surface-hover` hover) — a borderless surface reserved for
* chip FIELDS/TRIGGERS ({@link ChipInput}/{@link ChipDropdown}/{@link ChipSelect}/{@link ChipDatePicker}), **never `Chip`
@@ -79,7 +79,11 @@ const chipVariants = cva(
fullWidth: { true: 'flex w-full', false: 'inline-flex' },
},
compoundVariants: [
- { variant: ['default', 'filled'], active: false, className: chipHoverSurfaceClass },
+ {
+ variant: ['default', 'filled'],
+ active: false,
+ className: `${chipHoverSurfaceClass} focus-visible:bg-[var(--surface-hover)]`,
+ },
{ variant: ['default', 'filled'], active: true, className: chipActiveSurfaceClass },
],
defaultVariants: { variant: 'default', shape: 'default', active: false, fullWidth: false },
diff --git a/packages/emcn/src/components/chip/segmented-control.ts b/packages/emcn/src/components/chip/segmented-control.ts
index 183a4954d70..40d45dadae9 100644
--- a/packages/emcn/src/components/chip/segmented-control.ts
+++ b/packages/emcn/src/components/chip/segmented-control.ts
@@ -19,12 +19,8 @@ export const segmentedControlVariants = cva(
}
)
-/** The selected segment keeps its raised surface through hover. */
-export const segmentedControlItemVariants = cva(
- cn(
- chipVariants(),
- 'h-full shrink-0 justify-center whitespace-nowrap rounded-[calc(var(--radius-lg)-2px)] outline-hidden focus:outline-hidden focus-visible:outline-hidden'
- ),
+const itemVariants = cva(
+ 'h-full shrink-0 justify-center whitespace-nowrap rounded-[calc(var(--radius-lg)-2px)] outline-hidden focus:outline-hidden focus-visible:outline-hidden',
{
variants: {
size: { default: '', compact: 'px-1.5 text-xs' },
@@ -37,3 +33,10 @@ export const segmentedControlItemVariants = cva(
defaultVariants: { active: false, size: 'default' },
}
)
+
+/** The selected segment keeps its raised surface through hover and keyboard focus. */
+export const segmentedControlItemVariants = ({
+ active = false,
+ ...props
+}: Parameters[0] = {}) =>
+ cn(chipVariants({ active }), itemVariants({ active, ...props }))