41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import { cva } from 'class-variance-authority';
|
|
|
|
/** A card that hangs off its trigger: centred over it, or under it at the inline end. */
|
|
export const actionMenuVariants = cva(
|
|
'absolute z-menu min-w-55 rounded-lg border border-border-subtle bg-surface-raised p-1.5 shadow-2',
|
|
{
|
|
variants: {
|
|
placement: {
|
|
above: 'bottom-full left-1/2 mb-3 -translate-x-1/2',
|
|
below: 'end-0 top-full mt-2',
|
|
},
|
|
},
|
|
defaultVariants: { placement: 'below' },
|
|
},
|
|
);
|
|
|
|
/** A 48px row, 16/600; a link row and a button row look the same. */
|
|
export const actionMenuItemVariants = cva(
|
|
'min-h-12 w-full rounded-md px-3 text-start no-underline outline-none hover:bg-surface-sunken focus-visible:bg-surface-sunken focus-visible:focus-ring',
|
|
{
|
|
variants: {
|
|
tone: {
|
|
default: 'text-text-primary',
|
|
danger: 'text-danger-text',
|
|
},
|
|
},
|
|
defaultVariants: { tone: 'default' },
|
|
},
|
|
);
|
|
|
|
/** The item's icon: the brand colour, or red on a danger item. */
|
|
export const actionMenuIconVariants = cva('flex-none', {
|
|
variants: {
|
|
tone: {
|
|
default: 'text-action-primary-text',
|
|
danger: 'text-danger-text',
|
|
},
|
|
},
|
|
defaultVariants: { tone: 'default' },
|
|
});
|