work-in-progress atproto PDS
typescript atproto pds atcute

feat: invoker command type

mary.my.id 2b86afc1 a3423f79

verified
Changed files
+19 -2
packages
danaus
src
web
primitives
+3 -1
packages/danaus/src/web/primitives/button.tsx
··· 1 1 import { cva, type VariantProps } from 'cva'; 2 2 import type { Child } from 'hono/jsx'; 3 3 4 + import type { InvokerCommand } from './utils/types.ts'; 5 + 4 6 const root = cva({ 5 7 base: [ 6 8 'inline-flex appearance-none items-center justify-center gap-2 overflow-hidden align-middle select-none', ··· 53 55 /** invoker command target element id */ 54 56 commandfor?: string; 55 57 /** invoker command action */ 56 - command?: string; 58 + command?: InvokerCommand; 57 59 class?: string; 58 60 children?: Child; 59 61 }
+3 -1
packages/danaus/src/web/primitives/menu-item.tsx
··· 1 1 import { cva } from 'cva'; 2 2 import type { Child } from 'hono/jsx'; 3 3 4 + import type { InvokerCommand } from './utils/types.ts'; 5 + 4 6 const root = cva({ 5 7 base: [ 6 8 'flex items-center gap-1 rounded-md px-2 py-1.5 text-left select-none', ··· 20 22 /** invoker command target element id */ 21 23 commandfor?: string; 22 24 /** invoker command action */ 23 - command?: string; 25 + command?: InvokerCommand; 24 26 class?: string; 25 27 children?: Child; 26 28 }
+13
packages/danaus/src/web/primitives/utils/types.ts
··· 1 + /** 2 + * invoker command actions 3 + */ 4 + export type InvokerCommand = 5 + // dialog commands 6 + | 'show-modal' 7 + | 'close' 8 + // popover commands 9 + | 'toggle-popover' 10 + | 'show-popover' 11 + | 'hide-popover' 12 + // custom commands (must start with --) 13 + | `--${string}`;