@bettercms-ai/kit 4.0.0 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/dist/adapters/lossy.d.ts +4 -0
  2. package/dist/adapters/lossy.js +4 -0
  3. package/dist/adapters/lossy.js.map +1 -1
  4. package/dist/adapters/prod-types.d.ts +4 -0
  5. package/dist/adapters/prod-types.js +4 -1
  6. package/dist/adapters/prod-types.js.map +1 -1
  7. package/dist/adapters/schema.js +7 -0
  8. package/dist/adapters/schema.js.map +1 -1
  9. package/dist/context.d.ts +83 -0
  10. package/dist/context.js +58 -1
  11. package/dist/context.js.map +1 -1
  12. package/dist/controls/choice.d.ts +1 -1
  13. package/dist/controls/choice.js +21 -2
  14. package/dist/controls/choice.js.map +1 -1
  15. package/dist/controls/index.d.ts +1 -0
  16. package/dist/controls/index.js +3 -2
  17. package/dist/controls/index.js.map +1 -1
  18. package/dist/controls/link.d.ts +23 -2
  19. package/dist/controls/link.js +456 -4
  20. package/dist/controls/link.js.map +1 -1
  21. package/dist/controls/media-v16.d.ts +27 -0
  22. package/dist/controls/media-v16.js +261 -0
  23. package/dist/controls/media-v16.js.map +1 -0
  24. package/dist/controls/media.js +63 -1
  25. package/dist/controls/media.js.map +1 -1
  26. package/dist/controls/reference-services.d.ts +8 -0
  27. package/dist/controls/reference.js +78 -2
  28. package/dist/controls/reference.js.map +1 -1
  29. package/dist/controls/rich-text/ai-runs.d.ts +13 -0
  30. package/dist/controls/rich-text/ai-runs.js +71 -0
  31. package/dist/controls/rich-text/ai-runs.js.map +1 -0
  32. package/dist/controls/rich-text/block-tool.d.ts +31 -0
  33. package/dist/controls/rich-text/block-tool.js +62 -0
  34. package/dist/controls/rich-text/block-tool.js.map +1 -0
  35. package/dist/controls/rich-text/blocks.d.ts +6 -1
  36. package/dist/controls/rich-text/blocks.js +404 -24
  37. package/dist/controls/rich-text/blocks.js.map +1 -1
  38. package/dist/controls/rich-text/catalog.d.ts +21 -6
  39. package/dist/controls/rich-text/catalog.js +312 -23
  40. package/dist/controls/rich-text/catalog.js.map +1 -1
  41. package/dist/controls/rich-text/code-head.d.ts +30 -0
  42. package/dist/controls/rich-text/code-head.js +230 -0
  43. package/dist/controls/rich-text/code-head.js.map +1 -0
  44. package/dist/controls/rich-text/codec.d.ts +1 -1
  45. package/dist/controls/rich-text/codec.js +3 -1
  46. package/dist/controls/rich-text/codec.js.map +1 -1
  47. package/dist/controls/rich-text/dom.d.ts +27 -0
  48. package/dist/controls/rich-text/dom.js +69 -4
  49. package/dist/controls/rich-text/dom.js.map +1 -1
  50. package/dist/controls/rich-text/editor.js +212 -50
  51. package/dist/controls/rich-text/editor.js.map +1 -1
  52. package/dist/controls/rich-text/ops.js +1 -0
  53. package/dist/controls/rich-text/ops.js.map +1 -1
  54. package/dist/controls/rich-text/slash-preview.d.ts +8 -0
  55. package/dist/controls/rich-text/slash-preview.js +287 -0
  56. package/dist/controls/rich-text/slash-preview.js.map +1 -0
  57. package/dist/controls/rich-text/table-grid.d.ts +22 -0
  58. package/dist/controls/rich-text/table-grid.js +1052 -0
  59. package/dist/controls/rich-text/table-grid.js.map +1 -0
  60. package/dist/controls/rich-text/toolbar.js +60 -18
  61. package/dist/controls/rich-text/toolbar.js.map +1 -1
  62. package/dist/controls/text.d.ts +6 -0
  63. package/dist/controls/text.js +95 -5
  64. package/dist/controls/text.js.map +1 -1
  65. package/dist/core/facets.d.ts +1 -0
  66. package/dist/core/facets.js +1 -0
  67. package/dist/core/facets.js.map +1 -1
  68. package/dist/engine/array.d.ts +7 -0
  69. package/dist/engine/array.js +164 -45
  70. package/dist/engine/array.js.map +1 -1
  71. package/dist/engine/field-shell.d.ts +12 -0
  72. package/dist/engine/field-shell.js +217 -63
  73. package/dist/engine/field-shell.js.map +1 -1
  74. package/dist/engine/frame.js +39 -2
  75. package/dist/engine/frame.js.map +1 -1
  76. package/dist/engine/grouping.d.ts +71 -10
  77. package/dist/engine/grouping.js +223 -26
  78. package/dist/engine/grouping.js.map +1 -1
  79. package/dist/engine/kit-field.js +38 -4
  80. package/dist/engine/kit-field.js.map +1 -1
  81. package/dist/engine/schema-form.js +7 -2
  82. package/dist/engine/schema-form.js.map +1 -1
  83. package/dist/index.d.ts +1 -1
  84. package/dist/index.js +13 -6
  85. package/dist/index.js.map +1 -1
  86. package/dist/kit.css +85 -0
  87. package/dist/schema/table.d.ts +2 -1
  88. package/dist/schema/table.js +5 -0
  89. package/dist/schema/table.js.map +1 -1
  90. package/dist/schema/types.d.ts +6 -0
  91. package/dist/schema/types.js.map +1 -1
  92. package/dist/styles.css +1 -1
  93. package/dist/theme.css +115 -0
  94. package/dist/tokens.css +268 -0
  95. package/dist/ui/block-icon-picker.d.ts +38 -0
  96. package/dist/ui/block-icon-picker.js +141 -0
  97. package/dist/ui/block-icon-picker.js.map +1 -0
  98. package/dist/ui/button.js +1 -0
  99. package/dist/ui/button.js.map +1 -1
  100. package/dist/ui/code-language-menu.d.ts +24 -0
  101. package/dist/ui/code-language-menu.js +123 -0
  102. package/dist/ui/code-language-menu.js.map +1 -0
  103. package/dist/ui/content-fields.d.ts +47 -0
  104. package/dist/ui/content-fields.js +278 -0
  105. package/dist/ui/content-fields.js.map +1 -0
  106. package/dist/ui/foundations.d.ts +118 -0
  107. package/dist/ui/foundations.js +564 -0
  108. package/dist/ui/foundations.js.map +1 -0
  109. package/dist/ui/index.d.ts +6 -0
  110. package/dist/ui/index.js +7 -1
  111. package/dist/ui/inspector.d.ts +394 -0
  112. package/dist/ui/inspector.js +1173 -0
  113. package/dist/ui/inspector.js.map +1 -0
  114. package/dist/ui/overlay.d.ts +7 -2
  115. package/dist/ui/overlay.js +55 -20
  116. package/dist/ui/overlay.js.map +1 -1
  117. package/dist/ui/shortcut-hint.js +1 -1
  118. package/dist/ui/shortcut-hint.js.map +1 -1
  119. package/dist/ui/toast.d.ts +5 -3
  120. package/dist/ui/toast.js +83 -11
  121. package/dist/ui/toast.js.map +1 -1
  122. package/dist/ui/tooltip-card.d.ts +45 -0
  123. package/dist/ui/tooltip-card.js +135 -0
  124. package/dist/ui/tooltip-card.js.map +1 -0
  125. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","names":[],"sources":["../../src/ui/button.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Tooltip as TooltipPrimitive } from \"@base-ui/react/tooltip\";\nimport { IconPlus } from \"@tabler/icons-react\";\nimport { cn } from \"../lib/cn\";\nimport { SPARKLE_PATH } from \"../brand/logo\";\nimport { Spinner } from \"./spinner\";\nimport { TooltipLayer, TooltipRoot } from \"./tooltip-root\";\nimport { variants, type VariantProps } from \"./variants\";\n\n/**\n * Button: the only button in the kit.\n * Heights: xs 24 · sm 28 · md 32 (default) · lg 36 · xl 40. Radius 6.\n * Variants: primary (ink) · accent (violet, reserved for the ONE create action per screen)\n * secondary (bordered) · ghost · soft · danger · danger-ghost · link · ai (gradient sparkle)\n * The keyboard focus ring is the global :focus-visible outline, suppressed under pointer modality (DESIGN.md 3.7).\n */\nexport const buttonVariants = variants(\n \"relative inline-flex items-center justify-center gap-1.5 whitespace-nowrap font-medium tracking-[-0.01em] select-none transition-[background-color,border-color,color,box-shadow,opacity] duration-150 ease-out disabled:pointer-events-none disabled:opacity-45 [&_svg]:shrink-0 [&_svg]:opacity-90\",\n {\n variants: {\n variant: {\n // .btn-solid: in dark a disabled primary/accent takes the solid --kit-disabled-bg / --kit-disabled-fg pair; light keeps the opacity dim.\n primary: \"bg-kit-inverse text-kit-fg-inverse shadow-kit-button-primary hover:bg-kit-inverse-hover active:bg-kit-inverse btn-solid\",\n accent: \"bg-kit-accent text-kit-accent-on shadow-kit-xs hover:bg-kit-accent-hover btn-solid\",\n secondary: \"border border-kit-line-strong bg-kit-control-bg text-kit-fg shadow-kit-xs hover:bg-kit-subtle active:bg-kit-hover\",\n ghost: \"text-kit-fg-2 hover:bg-kit-hover hover:text-kit-fg active:bg-kit-selected\",\n soft: \"bg-kit-muted text-kit-fg hover:bg-kit-selected\",\n danger: \"bg-kit-danger text-kit-danger-on shadow-kit-xs hover:brightness-95\",\n \"danger-ghost\": \"text-kit-danger-fg hover:bg-kit-danger-soft\",\n link: \"text-kit-accent-fg underline-offset-4 hover:underline px-0 h-auto active:scale-100\",\n ai: \"border border-kit-line-strong bg-kit-control-bg text-kit-fg shadow-kit-xs hover:border-kit-accent-line hover:bg-kit-accent-softer\",\n },\n size: {\n xs: \"h-6 rounded-kit-md px-2 text-kit-xs [&_svg]:size-3.5\",\n sm: \"h-7 rounded-kit-md px-2.5 text-kit-sm [&_svg]:size-3.5\",\n md: \"h-8 rounded-kit-md px-3 text-kit-sm [&_svg]:size-4\",\n lg: \"h-9 rounded-kit-md px-3.5 text-kit-base [&_svg]:size-4\",\n xl: \"h-10 rounded-kit-md px-4 text-kit-base [&_svg]:size-[18px]\",\n },\n },\n compoundVariants: [{ variant: \"link\", className: \"h-auto px-0\" }],\n defaultVariants: { variant: \"secondary\", size: \"md\" },\n },\n);\n\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {\n /** Render the single child element (a link, say) with the button's classes and props. */\n asChild?: boolean;\n loading?: boolean;\n leftIcon?: React.ReactNode;\n rightIcon?: React.ReactNode;\n}\n\ntype ChildProps = { className?: string; ref?: React.Ref<unknown> };\n\nfunction mergeRefs<T>(...refs: (React.Ref<T> | undefined)[]) {\n return (node: T | null) => {\n for (const ref of refs) {\n if (typeof ref === \"function\") ref(node);\n else if (ref) (ref as React.RefObject<T | null>).current = node;\n }\n };\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild, loading, leftIcon, rightIcon, children, disabled, ...props }, ref) => {\n const classes = cn(buttonVariants({ variant, size }), className);\n if (asChild && React.isValidElement<ChildProps>(children)) {\n return React.cloneElement(children, {\n ...props,\n ...children.props,\n className: cn(classes, children.props.className),\n ref: mergeRefs(ref as React.Ref<unknown>, children.props.ref),\n });\n }\n return (\n <button ref={ref} type={props.type ?? \"button\"} disabled={disabled || loading} aria-busy={loading || undefined} className={classes} {...props}>\n {/* the kit Spinner (decorative: the button says it is busy); the size variant's [&_svg] rule sizes its glyph */}\n {loading ? <Spinner /> : leftIcon}\n {variant === \"ai\" && !leftIcon && !loading ? <Sparkle /> : null}\n {children}\n {rightIcon}\n </button>\n );\n },\n);\nButton.displayName = \"Button\";\n\n/** Square icon-only button. Always pass `label` (used for aria-label + tooltip). */\nexport const iconButtonVariants = variants(\n \"relative inline-flex items-center justify-center shrink-0 text-kit-fg-2 transition-colors duration-150 hover:bg-kit-hover hover:text-kit-fg active:scale-[0.96] disabled:opacity-40 disabled:pointer-events-none data-[active=true]:bg-kit-selected data-[active=true]:text-kit-fg\",\n {\n variants: {\n size: {\n xs: \"size-6 rounded-kit-md [&_svg]:size-3.5\",\n sm: \"size-7 rounded-kit-md [&_svg]:size-4\",\n md: \"size-8 rounded-kit-md [&_svg]:size-4\",\n lg: \"size-9 rounded-kit-md [&_svg]:size-[18px]\",\n },\n variant: {\n ghost: \"\",\n outline: \"border border-kit-line-strong bg-kit-control-bg shadow-kit-xs hover:border-[var(--kit-emphasis-line)]\",\n soft: \"bg-kit-muted\",\n },\n },\n defaultVariants: { size: \"md\", variant: \"ghost\" },\n },\n);\n\n/**\n * a11y: true while rendering inside a tooltip (or a surface that manages its own hints), so an IconButton nested\n * there doesn't add a second tooltip. Provided by HintTooltip and overlay.tsx's <Tooltip>.\n */\nexport const TooltipScope = React.createContext(false);\n\n/**\n * The plain ink hint (DESIGN.md 8.23: top, 6px offset, 8px collision padding, portalled, z 90, 350ms). The child\n * element is the trigger and must take a ref and DOM props. input, display and action-tray use it so they never\n * import overlay.tsx; overlay's <Tooltip> adds the shortcut slot on top of the same layer.\n */\nexport function HintTooltip({\n content,\n side = \"top\",\n delay = 350,\n children,\n}: {\n content: React.ReactNode;\n side?: \"top\" | \"bottom\" | \"left\" | \"right\";\n delay?: number;\n children: React.ReactElement;\n}) {\n return (\n <TooltipScope.Provider value>\n <TooltipRoot>\n <TooltipPrimitive.Trigger delay={delay} render={children} />\n <TooltipLayer side={side}>\n <span className=\"line-clamp-[8] min-w-0 whitespace-normal [overflow-wrap:anywhere]\">{content}</span>\n </TooltipLayer>\n </TooltipRoot>\n </TooltipScope.Provider>\n );\n}\n\nexport interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof iconButtonVariants> {\n label: string;\n active?: boolean;\n /** Hover/focus hint. Defaults to `label`; pass `false` to opt out, or a node to customise. */\n tooltip?: React.ReactNode | false;\n tooltipSide?: \"top\" | \"bottom\" | \"left\" | \"right\";\n}\n\nexport const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n ({ className, size, variant, label, active, children, tooltip, tooltipSide = \"top\", ...props }, ref) => {\n const inTooltip = React.useContext(TooltipScope);\n const btn = (\n <button\n ref={ref}\n type=\"button\"\n aria-label={label}\n data-active={active ? \"true\" : undefined}\n className={cn(iconButtonVariants({ size, variant }), className)}\n {...props}\n >\n {children}\n </button>\n );\n // Every icon-only button gets a visible hint on hover AND keyboard focus (brief §11), unless a\n // parent tooltip already provides one or the caller opted out.\n if (inTooltip || tooltip === false || !label) return btn;\n return (\n <HintTooltip content={tooltip ?? label} side={tooltipSide}>\n {btn}\n </HintTooltip>\n );\n },\n);\nIconButton.displayName = \"IconButton\";\n\n/** The AI sparkle in the official brand gradient. Used everywhere AI appears. */\nexport function Sparkle({ className, size = 16 }: { className?: string; size?: number }) {\n const id = React.useId().replace(/:/g, \"\");\n return (\n <svg width={size} height={size} viewBox=\"2 2 16 16\" className={cn(\"shrink-0\", className)} aria-hidden>\n <defs>\n <linearGradient id={`sp${id}`} x1=\"6.89\" y1=\"4.59\" x2=\"18\" y2=\"23.67\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0.0817\" style={{ stopColor: \"var(--kit-brand-violet)\" }} />\n <stop offset=\"0.4667\" style={{ stopColor: \"var(--kit-brand-coral)\" }} />\n <stop offset=\"1\" style={{ stopColor: \"var(--kit-brand-rose)\" }} />\n </linearGradient>\n </defs>\n <path d={SPARKLE_PATH} fill={`url(#sp${id})`} />\n </svg>\n );\n}\n\n/** D15 progressive disclosure: \"+ Add a message\" / \"+ Limit to specific sites\": reveals an optional input. */\nexport function RevealLink({ className, children, ...props }: React.ButtonHTMLAttributes<HTMLButtonElement>) {\n return (\n <button\n type=\"button\"\n className={cn(\n \"inline-flex h-7 items-center gap-1 rounded-kit-md text-kit-sm font-medium text-kit-fg-2 transition-colors hover:text-kit-fg [&_svg]:size-3.5\",\n className,\n )}\n {...props}\n >\n <IconPlus stroke={2} aria-hidden />\n {children}\n </button>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,IAAa,iBAAiB,SAC5B,wSACA;CACE,UAAU;EACR,SAAS;GAEP,SAAS;GACT,QAAQ;GACR,WAAW;GACX,OAAO;GACP,MAAM;GACN,QAAQ;GACR,gBAAgB;GAChB,MAAM;GACN,IAAI;EACN;EACA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;CACF;CACA,kBAAkB,CAAC;EAAE,SAAS;EAAQ,WAAW;CAAc,CAAC;CAChE,iBAAiB;EAAE,SAAS;EAAa,MAAM;CAAK;AACtD,CACF;AAYA,SAAS,UAAa,GAAG,MAAoC;CAC3D,QAAQ,SAAmB;EACzB,KAAK,MAAM,OAAO,MAChB,IAAI,OAAO,QAAQ,YAAY,IAAI,IAAI;OAClC,IAAI,KAAK,IAAmC,UAAU;CAE/D;AACF;AAEA,IAAa,SAAS,MAAM,YACzB,EAAE,WAAW,SAAS,MAAM,SAAS,SAAS,UAAU,WAAW,UAAU,UAAU,GAAG,SAAS,QAAQ;CAC1G,MAAM,UAAU,GAAG,eAAe;EAAE;EAAS;CAAK,CAAC,GAAG,SAAS;CAC/D,IAAI,WAAW,MAAM,eAA2B,QAAQ,GACtD,OAAO,MAAM,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","names":[],"sources":["../../src/ui/button.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Tooltip as TooltipPrimitive } from \"@base-ui/react/tooltip\";\nimport { IconPlus } from \"@tabler/icons-react\";\nimport { cn } from \"../lib/cn\";\nimport { SPARKLE_PATH } from \"../brand/logo\";\nimport { Spinner } from \"./spinner\";\nimport { TooltipLayer, TooltipRoot } from \"./tooltip-root\";\nimport { variants, type VariantProps } from \"./variants\";\n\n/**\n * Button: the only button in the kit.\n * Heights: xs 24 · sm 28 · md 32 (default) · lg 36 · xl 40. Radius 6.\n * Variants: primary (ink) · accent (violet, reserved for the ONE create action per screen)\n * secondary (bordered) · ghost · soft · danger · danger-ghost · link · ai (gradient sparkle)\n * The keyboard focus ring is the global :focus-visible outline, suppressed under pointer modality (DESIGN.md 3.7).\n */\nexport const buttonVariants = variants(\n \"relative inline-flex items-center justify-center gap-1.5 whitespace-nowrap font-medium tracking-[-0.01em] select-none transition-[background-color,border-color,color,box-shadow,opacity] duration-150 ease-out disabled:pointer-events-none disabled:opacity-45 [&_svg]:shrink-0 [&_svg]:opacity-90\",\n {\n variants: {\n variant: {\n // .btn-solid: in dark a disabled primary/accent takes the solid --kit-disabled-bg / --kit-disabled-fg pair; light keeps the opacity dim.\n primary: \"bg-kit-inverse text-kit-fg-inverse shadow-kit-button-primary hover:bg-kit-inverse-hover active:bg-kit-inverse btn-solid\",\n accent: \"bg-kit-accent text-kit-accent-on shadow-kit-xs hover:bg-kit-accent-hover btn-solid\",\n secondary: \"border border-kit-line-strong bg-kit-control-bg text-kit-fg shadow-kit-xs hover:bg-kit-subtle active:bg-kit-hover\",\n ghost: \"text-kit-fg-2 hover:bg-kit-hover hover:text-kit-fg active:bg-kit-selected\",\n soft: \"bg-kit-muted text-kit-fg hover:bg-kit-selected\",\n danger: \"bg-kit-danger text-kit-danger-on shadow-kit-xs hover:brightness-95\",\n \"danger-ghost\": \"text-kit-danger-fg hover:bg-kit-danger-soft\",\n link: \"text-kit-accent-fg underline-offset-4 hover:underline px-0 h-auto active:scale-100\",\n ai: \"border border-kit-line-strong bg-kit-control-bg text-kit-fg shadow-kit-xs hover:border-kit-accent-line hover:bg-kit-accent-softer\",\n },\n size: {\n xs: \"h-6 rounded-kit-md px-2 text-kit-xs [&_svg]:size-3.5\",\n sm: \"h-7 rounded-kit-md px-2.5 text-kit-sm [&_svg]:size-3.5\",\n md: \"h-8 rounded-kit-md px-3 text-kit-sm [&_svg]:size-4\",\n lg: \"h-9 rounded-kit-md px-3.5 text-kit-base [&_svg]:size-4\",\n xl: \"h-10 rounded-kit-md px-4 text-kit-base [&_svg]:size-[18px]\",\n },\n },\n compoundVariants: [{ variant: \"link\", className: \"h-auto px-0\" }],\n defaultVariants: { variant: \"secondary\", size: \"md\" },\n },\n);\n\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {\n /** Render the single child element (a link, say) with the button's classes and props. */\n asChild?: boolean;\n loading?: boolean;\n leftIcon?: React.ReactNode;\n rightIcon?: React.ReactNode;\n}\n\ntype ChildProps = { className?: string; ref?: React.Ref<unknown> };\n\nfunction mergeRefs<T>(...refs: (React.Ref<T> | undefined)[]) {\n return (node: T | null) => {\n for (const ref of refs) {\n if (typeof ref === \"function\") ref(node);\n else if (ref) (ref as React.RefObject<T | null>).current = node;\n }\n };\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild, loading, leftIcon, rightIcon, children, disabled, ...props }, ref) => {\n const classes = cn(buttonVariants({ variant, size }), className);\n if (asChild && React.isValidElement<ChildProps>(children)) {\n return React.cloneElement(children, {\n ...props,\n ...children.props,\n className: cn(classes, children.props.className),\n ref: mergeRefs(ref as React.Ref<unknown>, children.props.ref),\n });\n }\n return (\n <button\n ref={ref}\n type={props.type ?? \"button\"}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n // read by a v16 confirm footer (ModalFooter) to draw Cancel / the action as the prototype\n data-variant={variant ?? \"secondary\"}\n className={classes}\n {...props}\n >\n {/* the kit Spinner (decorative: the button says it is busy); the size variant's [&_svg] rule sizes its glyph */}\n {loading ? <Spinner /> : leftIcon}\n {variant === \"ai\" && !leftIcon && !loading ? <Sparkle /> : null}\n {children}\n {rightIcon}\n </button>\n );\n },\n);\nButton.displayName = \"Button\";\n\n/** Square icon-only button. Always pass `label` (used for aria-label + tooltip). */\nexport const iconButtonVariants = variants(\n \"relative inline-flex items-center justify-center shrink-0 text-kit-fg-2 transition-colors duration-150 hover:bg-kit-hover hover:text-kit-fg active:scale-[0.96] disabled:opacity-40 disabled:pointer-events-none data-[active=true]:bg-kit-selected data-[active=true]:text-kit-fg\",\n {\n variants: {\n size: {\n xs: \"size-6 rounded-kit-md [&_svg]:size-3.5\",\n sm: \"size-7 rounded-kit-md [&_svg]:size-4\",\n md: \"size-8 rounded-kit-md [&_svg]:size-4\",\n lg: \"size-9 rounded-kit-md [&_svg]:size-[18px]\",\n },\n variant: {\n ghost: \"\",\n outline: \"border border-kit-line-strong bg-kit-control-bg shadow-kit-xs hover:border-[var(--kit-emphasis-line)]\",\n soft: \"bg-kit-muted\",\n },\n },\n defaultVariants: { size: \"md\", variant: \"ghost\" },\n },\n);\n\n/**\n * a11y: true while rendering inside a tooltip (or a surface that manages its own hints), so an IconButton nested\n * there doesn't add a second tooltip. Provided by HintTooltip and overlay.tsx's <Tooltip>.\n */\nexport const TooltipScope = React.createContext(false);\n\n/**\n * The plain ink hint (DESIGN.md 8.23: top, 6px offset, 8px collision padding, portalled, z 90, 350ms). The child\n * element is the trigger and must take a ref and DOM props. input, display and action-tray use it so they never\n * import overlay.tsx; overlay's <Tooltip> adds the shortcut slot on top of the same layer.\n */\nexport function HintTooltip({\n content,\n side = \"top\",\n delay = 350,\n children,\n}: {\n content: React.ReactNode;\n side?: \"top\" | \"bottom\" | \"left\" | \"right\";\n delay?: number;\n children: React.ReactElement;\n}) {\n return (\n <TooltipScope.Provider value>\n <TooltipRoot>\n <TooltipPrimitive.Trigger delay={delay} render={children} />\n <TooltipLayer side={side}>\n <span className=\"line-clamp-[8] min-w-0 whitespace-normal [overflow-wrap:anywhere]\">{content}</span>\n </TooltipLayer>\n </TooltipRoot>\n </TooltipScope.Provider>\n );\n}\n\nexport interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof iconButtonVariants> {\n label: string;\n active?: boolean;\n /** Hover/focus hint. Defaults to `label`; pass `false` to opt out, or a node to customise. */\n tooltip?: React.ReactNode | false;\n tooltipSide?: \"top\" | \"bottom\" | \"left\" | \"right\";\n}\n\nexport const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n ({ className, size, variant, label, active, children, tooltip, tooltipSide = \"top\", ...props }, ref) => {\n const inTooltip = React.useContext(TooltipScope);\n const btn = (\n <button\n ref={ref}\n type=\"button\"\n aria-label={label}\n data-active={active ? \"true\" : undefined}\n className={cn(iconButtonVariants({ size, variant }), className)}\n {...props}\n >\n {children}\n </button>\n );\n // Every icon-only button gets a visible hint on hover AND keyboard focus (brief §11), unless a\n // parent tooltip already provides one or the caller opted out.\n if (inTooltip || tooltip === false || !label) return btn;\n return (\n <HintTooltip content={tooltip ?? label} side={tooltipSide}>\n {btn}\n </HintTooltip>\n );\n },\n);\nIconButton.displayName = \"IconButton\";\n\n/** The AI sparkle in the official brand gradient. Used everywhere AI appears. */\nexport function Sparkle({ className, size = 16 }: { className?: string; size?: number }) {\n const id = React.useId().replace(/:/g, \"\");\n return (\n <svg width={size} height={size} viewBox=\"2 2 16 16\" className={cn(\"shrink-0\", className)} aria-hidden>\n <defs>\n <linearGradient id={`sp${id}`} x1=\"6.89\" y1=\"4.59\" x2=\"18\" y2=\"23.67\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\"0.0817\" style={{ stopColor: \"var(--kit-brand-violet)\" }} />\n <stop offset=\"0.4667\" style={{ stopColor: \"var(--kit-brand-coral)\" }} />\n <stop offset=\"1\" style={{ stopColor: \"var(--kit-brand-rose)\" }} />\n </linearGradient>\n </defs>\n <path d={SPARKLE_PATH} fill={`url(#sp${id})`} />\n </svg>\n );\n}\n\n/** D15 progressive disclosure: \"+ Add a message\" / \"+ Limit to specific sites\": reveals an optional input. */\nexport function RevealLink({ className, children, ...props }: React.ButtonHTMLAttributes<HTMLButtonElement>) {\n return (\n <button\n type=\"button\"\n className={cn(\n \"inline-flex h-7 items-center gap-1 rounded-kit-md text-kit-sm font-medium text-kit-fg-2 transition-colors hover:text-kit-fg [&_svg]:size-3.5\",\n className,\n )}\n {...props}\n >\n <IconPlus stroke={2} aria-hidden />\n {children}\n </button>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,IAAa,iBAAiB,SAC5B,wSACA;CACE,UAAU;EACR,SAAS;GAEP,SAAS;GACT,QAAQ;GACR,WAAW;GACX,OAAO;GACP,MAAM;GACN,QAAQ;GACR,gBAAgB;GAChB,MAAM;GACN,IAAI;EACN;EACA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;CACF;CACA,kBAAkB,CAAC;EAAE,SAAS;EAAQ,WAAW;CAAc,CAAC;CAChE,iBAAiB;EAAE,SAAS;EAAa,MAAM;CAAK;AACtD,CACF;AAYA,SAAS,UAAa,GAAG,MAAoC;CAC3D,QAAQ,SAAmB;EACzB,KAAK,MAAM,OAAO,MAChB,IAAI,OAAO,QAAQ,YAAY,IAAI,IAAI;OAClC,IAAI,KAAK,IAAmC,UAAU;CAE/D;AACF;AAEA,IAAa,SAAS,MAAM,YACzB,EAAE,WAAW,SAAS,MAAM,SAAS,SAAS,UAAU,WAAW,UAAU,UAAU,GAAG,SAAS,QAAQ;CAC1G,MAAM,UAAU,GAAG,eAAe;EAAE;EAAS;CAAK,CAAC,GAAG,SAAS;CAC/D,IAAI,WAAW,MAAM,eAA2B,QAAQ,GACtD,OAAO,MAAM,aAAa,UAAU;EAClC,GAAG;EACH,GAAG,SAAS;EACZ,WAAW,GAAG,SAA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1224, content.css:736-742): a dark 200
3
+ * wide panel under the language button, right-aligned: a "Search languages" input, a 248 max list of 32 high rows (the
4
+ * current one checked), ↑ ↓ move, Enter picks, Esc closes, and "No language matches “q”" when the search finds none.
5
+ *
6
+ * <CodeLanguageMenu> the panel alone
7
+ * <CodeLanguagePopover> the panel in a kit popover on a trigger (Esc / outside press close it)
8
+ */
9
+ import * as React from "react";
10
+ /** The prototype's list (content.jsx:1211). A host may pass its own. */
11
+ export declare const CODE_LANGUAGE_NAMES: readonly ["TypeScript", "JavaScript", "JSON", "Python", "Bash", "HTML", "CSS", "SQL", "Go", "Rust", "YAML", "Markdown", "Plain text"];
12
+ export interface CodeLanguageMenuProps {
13
+ languages?: readonly string[];
14
+ /** the current language's name */
15
+ value?: string | null;
16
+ onPick: (language: string) => void;
17
+ onClose?: () => void;
18
+ className?: string;
19
+ }
20
+ export declare function CodeLanguageMenu({ languages, value, onPick, onClose, className }: CodeLanguageMenuProps): import("react/jsx-runtime").JSX.Element;
21
+ /** The menu on a trigger: under it, right-aligned, 6 away. A pick closes it. */
22
+ export declare function CodeLanguagePopover({ trigger, onPick, ...menu }: Omit<CodeLanguageMenuProps, "onClose"> & {
23
+ trigger: React.ReactElement;
24
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,123 @@
1
+ import { cn } from "../lib/cn.js";
2
+ import { Popover, PopoverContent, PopoverTrigger } from "./overlay.js";
3
+ import * as React from "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { IconCheck } from "@tabler/icons-react";
6
+ //#region src/ui/code-language-menu.tsx
7
+ /**
8
+ * The code block's language menu of prototype editor-v16 (src/content.jsx:1211-1224, content.css:736-742): a dark 200
9
+ * wide panel under the language button, right-aligned: a "Search languages" input, a 248 max list of 32 high rows (the
10
+ * current one checked), ↑ ↓ move, Enter picks, Esc closes, and "No language matches “q”" when the search finds none.
11
+ *
12
+ * <CodeLanguageMenu> the panel alone
13
+ * <CodeLanguagePopover> the panel in a kit popover on a trigger (Esc / outside press close it)
14
+ */
15
+ /** The prototype's list (content.jsx:1211). A host may pass its own. */
16
+ var CODE_LANGUAGE_NAMES = [
17
+ "TypeScript",
18
+ "JavaScript",
19
+ "JSON",
20
+ "Python",
21
+ "Bash",
22
+ "HTML",
23
+ "CSS",
24
+ "SQL",
25
+ "Go",
26
+ "Rust",
27
+ "YAML",
28
+ "Markdown",
29
+ "Plain text"
30
+ ];
31
+ function CodeLanguageMenu({ languages = CODE_LANGUAGE_NAMES, value, onPick, onClose, className }) {
32
+ const [q, setQ] = React.useState("");
33
+ const [at, setAt] = React.useState(0);
34
+ const listId = React.useId();
35
+ const list = languages.filter((l) => l.toLowerCase().includes(q.trim().toLowerCase()));
36
+ React.useEffect(() => setAt(0), [q]);
37
+ return /* @__PURE__ */ jsxs("div", {
38
+ "data-slot": "kit-code-language-menu",
39
+ className: cn("w-[200px] rounded-[10px] bg-kit-insp-code-menu p-1.5 text-kit-insp-code-menu-fg shadow-[0_0_0_1px_var(--kit-insp-code-menu-line),0_12px_32px_-4px_rgb(0_0_0/0.45),0_2px_6px_rgb(0_0_0/0.3)]", className),
40
+ children: [/* @__PURE__ */ jsx("input", {
41
+ autoFocus: true,
42
+ value: q,
43
+ placeholder: "Search languages",
44
+ "aria-label": "Search languages",
45
+ role: "combobox",
46
+ "aria-expanded": true,
47
+ "aria-controls": listId,
48
+ "aria-activedescendant": list.length ? `${listId}-${at}` : void 0,
49
+ onChange: (e) => setQ(e.target.value),
50
+ onKeyDown: (e) => {
51
+ if (e.key === "Escape") {
52
+ e.preventDefault();
53
+ onClose?.();
54
+ } else if (e.key === "ArrowDown") {
55
+ e.preventDefault();
56
+ setAt((x) => Math.min(list.length - 1, x + 1));
57
+ } else if (e.key === "ArrowUp") {
58
+ e.preventDefault();
59
+ setAt((x) => Math.max(0, x - 1));
60
+ } else if (e.key === "Enter" && list[at]) {
61
+ e.preventDefault();
62
+ onPick(list[at]);
63
+ }
64
+ },
65
+ className: "mb-1 h-8 w-full border-0 border-b border-kit-insp-code-menu-line bg-transparent px-2.5 text-[13px] text-white outline-none placeholder:text-kit-insp-code-menu-quiet"
66
+ }), /* @__PURE__ */ jsxs("div", {
67
+ id: listId,
68
+ role: "listbox",
69
+ "aria-label": "Language",
70
+ className: "max-h-[248px] overflow-auto [scrollbar-color:rgb(255_255_255/0.18)_transparent] [scrollbar-width:thin]",
71
+ children: [list.map((l, n) => /* @__PURE__ */ jsxs("button", {
72
+ id: `${listId}-${n}`,
73
+ type: "button",
74
+ role: "option",
75
+ "aria-selected": l === value,
76
+ onMouseEnter: () => setAt(n),
77
+ onMouseDown: (e) => e.preventDefault(),
78
+ onClick: () => onPick(l),
79
+ className: cn("flex h-8 w-full items-center justify-between rounded-[6px] px-2.5 text-left text-[13px] text-kit-insp-code-menu-fg", n === at && "bg-kit-insp-code-menu-hover"),
80
+ children: [/* @__PURE__ */ jsx("span", { children: l }), l === value ? /* @__PURE__ */ jsx(IconCheck, {
81
+ "aria-hidden": true,
82
+ className: "size-3.5",
83
+ stroke: 2
84
+ }) : null]
85
+ }, l)), list.length ? null : /* @__PURE__ */ jsxs("p", {
86
+ role: "status",
87
+ className: "m-0 px-2.5 py-2 text-[12px] text-kit-insp-code-menu-quiet",
88
+ children: [
89
+ "No language matches “",
90
+ q,
91
+ "”"
92
+ ]
93
+ })]
94
+ })]
95
+ });
96
+ }
97
+ /** The menu on a trigger: under it, right-aligned, 6 away. A pick closes it. */
98
+ function CodeLanguagePopover({ trigger, onPick, ...menu }) {
99
+ const [open, setOpen] = React.useState(false);
100
+ return /* @__PURE__ */ jsxs(Popover, {
101
+ open,
102
+ onOpenChange: (o) => setOpen(o),
103
+ children: [/* @__PURE__ */ jsx(PopoverTrigger, { render: trigger }), /* @__PURE__ */ jsx(PopoverContent, {
104
+ align: "end",
105
+ side: "bottom",
106
+ sideOffset: 6,
107
+ "aria-label": "Language",
108
+ className: "w-auto !border-0 !bg-transparent p-0 !shadow-none ![backdrop-filter:none]",
109
+ children: /* @__PURE__ */ jsx(CodeLanguageMenu, {
110
+ ...menu,
111
+ onClose: () => setOpen(false),
112
+ onPick: (l) => {
113
+ onPick(l);
114
+ setOpen(false);
115
+ }
116
+ })
117
+ })]
118
+ });
119
+ }
120
+ //#endregion
121
+ export { CODE_LANGUAGE_NAMES, CodeLanguageMenu, CodeLanguagePopover };
122
+
123
+ //# sourceMappingURL=code-language-menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-language-menu.js","names":[],"sources":["../../src/ui/code-language-menu.tsx"],"sourcesContent":["/**\n * The code block's language menu of prototype editor-v16 (src/content.jsx:1211-1224, content.css:736-742): a dark 200\n * wide panel under the language button, right-aligned: a \"Search languages\" input, a 248 max list of 32 high rows (the\n * current one checked), ↑ ↓ move, Enter picks, Esc closes, and \"No language matches “q”\" when the search finds none.\n *\n * <CodeLanguageMenu> the panel alone\n * <CodeLanguagePopover> the panel in a kit popover on a trigger (Esc / outside press close it)\n */\nimport * as React from \"react\";\nimport { IconCheck } from \"@tabler/icons-react\";\nimport { cn } from \"../lib/cn\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./overlay\";\n\n/** The prototype's list (content.jsx:1211). A host may pass its own. */\nexport const CODE_LANGUAGE_NAMES = [\"TypeScript\", \"JavaScript\", \"JSON\", \"Python\", \"Bash\", \"HTML\", \"CSS\", \"SQL\", \"Go\", \"Rust\", \"YAML\", \"Markdown\", \"Plain text\"] as const;\n\nexport interface CodeLanguageMenuProps {\n languages?: readonly string[];\n /** the current language's name */\n value?: string | null;\n onPick: (language: string) => void;\n onClose?: () => void;\n className?: string;\n}\n\nexport function CodeLanguageMenu({ languages = CODE_LANGUAGE_NAMES, value, onPick, onClose, className }: CodeLanguageMenuProps) {\n const [q, setQ] = React.useState(\"\");\n const [at, setAt] = React.useState(0);\n const listId = React.useId();\n const list = languages.filter((l) => l.toLowerCase().includes(q.trim().toLowerCase()));\n React.useEffect(() => setAt(0), [q]);\n return (\n <div data-slot=\"kit-code-language-menu\" className={cn(\"w-[200px] rounded-[10px] bg-kit-insp-code-menu p-1.5 text-kit-insp-code-menu-fg shadow-[0_0_0_1px_var(--kit-insp-code-menu-line),0_12px_32px_-4px_rgb(0_0_0/0.45),0_2px_6px_rgb(0_0_0/0.3)]\", className)}>\n <input\n autoFocus\n value={q}\n placeholder=\"Search languages\"\n aria-label=\"Search languages\"\n role=\"combobox\"\n aria-expanded\n aria-controls={listId}\n aria-activedescendant={list.length ? `${listId}-${at}` : undefined}\n onChange={(e) => setQ(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Escape\") {\n e.preventDefault();\n onClose?.();\n } else if (e.key === \"ArrowDown\") {\n e.preventDefault();\n setAt((x) => Math.min(list.length - 1, x + 1));\n } else if (e.key === \"ArrowUp\") {\n e.preventDefault();\n setAt((x) => Math.max(0, x - 1));\n } else if (e.key === \"Enter\" && list[at]) {\n e.preventDefault();\n onPick(list[at]!);\n }\n }}\n className=\"mb-1 h-8 w-full border-0 border-b border-kit-insp-code-menu-line bg-transparent px-2.5 text-[13px] text-white outline-none placeholder:text-kit-insp-code-menu-quiet\"\n />\n <div id={listId} role=\"listbox\" aria-label=\"Language\" className=\"max-h-[248px] overflow-auto [scrollbar-color:rgb(255_255_255/0.18)_transparent] [scrollbar-width:thin]\">\n {list.map((l, n) => (\n <button\n key={l}\n id={`${listId}-${n}`}\n type=\"button\"\n role=\"option\"\n aria-selected={l === value}\n onMouseEnter={() => setAt(n)}\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => onPick(l)}\n className={cn(\"flex h-8 w-full items-center justify-between rounded-[6px] px-2.5 text-left text-[13px] text-kit-insp-code-menu-fg\", n === at && \"bg-kit-insp-code-menu-hover\")}\n >\n <span>{l}</span>\n {l === value ? <IconCheck aria-hidden className=\"size-3.5\" stroke={2} /> : null}\n </button>\n ))}\n {list.length ? null : <p role=\"status\" className=\"m-0 px-2.5 py-2 text-[12px] text-kit-insp-code-menu-quiet\">No language matches “{q}”</p>}\n </div>\n </div>\n );\n}\n\n/** The menu on a trigger: under it, right-aligned, 6 away. A pick closes it. */\nexport function CodeLanguagePopover({ trigger, onPick, ...menu }: Omit<CodeLanguageMenuProps, \"onClose\"> & { trigger: React.ReactElement }) {\n const [open, setOpen] = React.useState(false);\n return (\n <Popover open={open} onOpenChange={(o) => setOpen(o)}>\n <PopoverTrigger render={trigger} />\n <PopoverContent align=\"end\" side=\"bottom\" sideOffset={6} aria-label=\"Language\" className=\"w-auto !border-0 !bg-transparent p-0 !shadow-none ![backdrop-filter:none]\">\n <CodeLanguageMenu\n {...menu}\n onClose={() => setOpen(false)}\n onPick={(l) => {\n onPick(l);\n setOpen(false);\n }}\n />\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAcA,IAAa,sBAAsB;CAAC;CAAc;CAAc;CAAQ;CAAU;CAAQ;CAAQ;CAAO;CAAO;CAAM;CAAQ;CAAQ;CAAY;AAAY;AAW9J,SAAgB,iBAAiB,EAAE,YAAY,qBAAqB,OAAO,QAAQ,SAAS,aAAoC;CAC9H,MAAM,CAAC,GAAG,QAAQ,MAAM,SAAS,EAAE;CACnC,MAAM,CAAC,IAAI,SAAS,MAAM,SAAS,CAAC;CACpC,MAAM,SAAS,MAAM,MAAM;CAC3B,MAAM,OAAO,UAAU,QAAQ,MAAM,EAAE,YAAY,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC;CACrF,MAAM,gBAAgB,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;CACnC,OACE,qBAAC,OAAD;EAAK,aAAU;EAAyB,WAAW,GAAG,+LAA+L,SAAS;EAA9P,UAAA,CACE,oBAAC,SAAD;GACE,WAAA;GACA,OAAO;GACP,aAAY;GACZ,cAAW;GACX,MAAK;GACL,iBAAA;GACA,iBAAe;GACf,yBAAuB,KAAK,SAAS,GAAG,OAAO,GAAG,OAAO,KAAA;GACzD,WAAW,MAAM,KAAK,EAAE,OAAO,KAAK;GACpC,YAAY,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nD,UAAA,CACE,oBAAC,gBAAD,EAAgB,QAAQ,QAAU,CAAA,GAClC,oBAAC,gBAAD;GAAgB,OAAM;GAAM,MAAK;GAAS,YAAY;GAAG,cAAW;GAAW,WAAU;GACvF,UAAA,oBAAC,kBAAD;IACE,GAAI;IACJ,eAAe,QAAQ,KAAK;IAC5B,SAAS,MAAM;KACb,OAAO,CAAC;KACR,QAAQ,KAAK;IACf;GACD,CAAA;EACa,CAAA,CACT;;AAEb"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Content fields of prototype editor-v16 (src/content.jsx:836-853, content.css:130-136, 171-174, 563-565):
3
+ *
4
+ * <TagsInput> grey box of white tag chips (24 high, 12/500) with "Remove {tag}" ×, an "Add a tag" input; Enter adds,
5
+ * Backspace on the empty input removes the last; chips pop in and out
6
+ * <AuthorField> one author. Empty = the "Select an author" picker (36 high, 20 placeholder circle); picked = an
7
+ * outlined card with the grey profile (36 avatar, name 14/20 medium, "Role · 4 posts") and ⋯ beside it
8
+ *
9
+ * Editor-scoped look (the --kit-insp-* roles). The kit's own tags and reference controls are unchanged.
10
+ */
11
+ import * as React from "react";
12
+ export interface TagsInputProps {
13
+ value: string[];
14
+ onChange: (next: string[]) => void;
15
+ placeholder?: string;
16
+ disabled?: boolean;
17
+ /** refuse a tag (a duplicate is always refused); return the reason to announce, or nothing to accept */
18
+ validate?: (tag: string, tags: string[]) => string | undefined;
19
+ id?: string;
20
+ "aria-labelledby"?: string;
21
+ "aria-label"?: string;
22
+ className?: string;
23
+ }
24
+ export declare function TagsInput({ value, onChange, placeholder, disabled, validate, id, className, ...aria }: TagsInputProps): import("react/jsx-runtime").JSX.Element;
25
+ export interface AuthorOption {
26
+ id: string;
27
+ name: string;
28
+ /** "Editor · 4 posts": role and post count, on the card and in the picker */
29
+ line?: string;
30
+ /** the avatar (the host's own component or an <img>); drawn 24 in the picker and 36 on the card */
31
+ avatar?: (size: number) => React.ReactNode;
32
+ }
33
+ export interface AuthorFieldProps {
34
+ value: string | null | undefined;
35
+ people: AuthorOption[];
36
+ onChange: (id: string | null) => void;
37
+ /** "New author in Authors" at the end of the picker; omitted = no such row */
38
+ onNew?: () => void;
39
+ /** "Open profile" in the card's ⋯ menu; omitted = no such row */
40
+ onOpenProfile?: (id: string) => void;
41
+ /** what one of these is called: "author" (default), "writer"… */
42
+ noun?: string;
43
+ disabled?: boolean;
44
+ "aria-labelledby"?: string;
45
+ className?: string;
46
+ }
47
+ export declare function AuthorField({ value, people, onChange, onNew, onOpenProfile, noun, disabled, className, ...aria }: AuthorFieldProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,278 @@
1
+ import { cn } from "../lib/cn.js";
2
+ import { Menu, MenuContent, MenuItem, MenuLabel, MenuSeparator, MenuSub, MenuSubContent, MenuSubTrigger, MenuTrigger } from "./overlay.js";
3
+ import * as React from "react";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ import { IconArrowsExchange, IconCheck, IconChevronDown, IconDots, IconPlus, IconTrash, IconUser, IconX } from "@tabler/icons-react";
6
+ import { AnimatePresence, motion, useReducedMotion } from "framer-motion";
7
+ //#region src/ui/content-fields.tsx
8
+ /**
9
+ * Content fields of prototype editor-v16 (src/content.jsx:836-853, content.css:130-136, 171-174, 563-565):
10
+ *
11
+ * <TagsInput> grey box of white tag chips (24 high, 12/500) with "Remove {tag}" ×, an "Add a tag" input; Enter adds,
12
+ * Backspace on the empty input removes the last; chips pop in and out
13
+ * <AuthorField> one author. Empty = the "Select an author" picker (36 high, 20 placeholder circle); picked = an
14
+ * outlined card with the grey profile (36 avatar, name 14/20 medium, "Role · 4 posts") and ⋯ beside it
15
+ *
16
+ * Editor-scoped look (the --kit-insp-* roles). The kit's own tags and reference controls are unchanged.
17
+ */
18
+ var HAIR = "shadow-[0_1px_3px_rgb(0_0_0/0.05)]";
19
+ var FIELD = "border border-transparent bg-kit-insp-card transition-colors duration-100 hover:bg-kit-insp-card-hover";
20
+ function TagsInput({ value, onChange, placeholder = "Add a tag", disabled, validate, id, className, ...aria }) {
21
+ const [v, setV] = React.useState("");
22
+ const [said, setSaid] = React.useState("");
23
+ const reduce = useReducedMotion();
24
+ const layout = reduce ? { duration: 0 } : {
25
+ type: "spring",
26
+ stiffness: 500,
27
+ damping: 40
28
+ };
29
+ const add = () => {
30
+ const t = v.trim();
31
+ if (!t) return;
32
+ const why = value.includes(t) ? `${t} is already added` : validate?.(t, value);
33
+ if (why) return setSaid(why);
34
+ onChange([...value, t]);
35
+ setV("");
36
+ setSaid(`${t} added`);
37
+ };
38
+ const remove = (t) => {
39
+ onChange(value.filter((x) => x !== t));
40
+ setSaid(`${t} removed`);
41
+ };
42
+ return /* @__PURE__ */ jsxs("div", {
43
+ "data-slot": "kit-tags-input",
44
+ className: cn("flex min-h-9 flex-wrap items-center gap-1.5 rounded-[6px] p-1.5", FIELD, "focus-within:border-kit-insp-accent focus-within:bg-kit-insp-card-focus", disabled && "pointer-events-none opacity-60", className),
45
+ children: [
46
+ /* @__PURE__ */ jsx(AnimatePresence, {
47
+ initial: false,
48
+ mode: "popLayout",
49
+ children: value.map((t) => /* @__PURE__ */ jsxs(motion.span, {
50
+ layout: true,
51
+ "data-slot": "kit-tag",
52
+ initial: reduce ? false : {
53
+ opacity: 0,
54
+ scale: .8
55
+ },
56
+ animate: {
57
+ opacity: 1,
58
+ scale: 1
59
+ },
60
+ exit: reduce ? {
61
+ opacity: 0,
62
+ transition: { duration: 0 }
63
+ } : {
64
+ opacity: 0,
65
+ scale: .8,
66
+ transition: {
67
+ duration: .14,
68
+ ease: [
69
+ .4,
70
+ 0,
71
+ 1,
72
+ 1
73
+ ]
74
+ }
75
+ },
76
+ transition: reduce ? { duration: 0 } : {
77
+ type: "spring",
78
+ stiffness: 520,
79
+ damping: 20,
80
+ layout
81
+ },
82
+ className: cn("inline-flex h-6 items-center gap-1 rounded-[4px] bg-kit-insp-tip-bg pl-2 pr-1 text-[12px] font-medium leading-[18px] text-kit-insp-tip-title", HAIR),
83
+ children: [t, /* @__PURE__ */ jsx("button", {
84
+ type: "button",
85
+ "aria-label": `Remove ${t}`,
86
+ disabled,
87
+ onClick: () => remove(t),
88
+ className: "grid size-4 place-items-center rounded-[3px] text-kit-group-sub outline-none hover:bg-kit-insp-card focus-visible:bg-kit-insp-card focus-visible:outline-2 focus-visible:outline-kit-insp-accent",
89
+ children: /* @__PURE__ */ jsx(IconX, {
90
+ "aria-hidden": true,
91
+ className: "size-[11px]",
92
+ stroke: 2
93
+ })
94
+ })]
95
+ }, t))
96
+ }),
97
+ /* @__PURE__ */ jsx(motion.input, {
98
+ layout: true,
99
+ transition: { layout },
100
+ id,
101
+ value: v,
102
+ disabled,
103
+ placeholder,
104
+ "aria-label": aria["aria-labelledby"] ? void 0 : aria["aria-label"] ?? placeholder,
105
+ "aria-labelledby": aria["aria-labelledby"],
106
+ onChange: (e) => setV(e.target.value),
107
+ onKeyDown: (e) => {
108
+ if (e.key === "Enter" && v.trim()) {
109
+ e.preventDefault();
110
+ add();
111
+ }
112
+ if (e.key === "Backspace" && !v && value.length) remove(value[value.length - 1]);
113
+ },
114
+ className: "min-w-20 flex-1 border-0 bg-transparent text-[13px] leading-[18px] text-kit-insp-ink outline-none placeholder:text-kit-group-sub"
115
+ }),
116
+ /* @__PURE__ */ jsx("span", {
117
+ role: "status",
118
+ "aria-live": "polite",
119
+ className: "sr-only",
120
+ children: said
121
+ })
122
+ ]
123
+ });
124
+ }
125
+ var initials = (name) => name.split(/\s+/).filter(Boolean).slice(0, 2).map((w) => w[0].toUpperCase()).join("");
126
+ function Face({ p, size }) {
127
+ return /* @__PURE__ */ jsx("span", {
128
+ "aria-hidden": true,
129
+ className: "grid shrink-0 place-items-center overflow-hidden rounded-full bg-kit-insp-chip font-medium text-kit-insp-label [&>img]:size-full [&>img]:object-cover",
130
+ style: {
131
+ width: size,
132
+ height: size,
133
+ fontSize: Math.round(size * .4)
134
+ },
135
+ children: p.avatar ? p.avatar(size) : initials(p.name)
136
+ });
137
+ }
138
+ function PersonItems({ people, value, onPick }) {
139
+ return /* @__PURE__ */ jsx(Fragment, { children: people.map((p) => /* @__PURE__ */ jsx(MenuItem, {
140
+ icon: /* @__PURE__ */ jsx(Face, {
141
+ p,
142
+ size: 24
143
+ }),
144
+ onClick: () => onPick(p.id),
145
+ "aria-current": p.id === value || void 0,
146
+ className: "h-auto py-1.5",
147
+ children: /* @__PURE__ */ jsxs("span", {
148
+ className: "flex items-center gap-2",
149
+ children: [/* @__PURE__ */ jsxs("span", {
150
+ className: "flex min-w-0 flex-1 flex-col",
151
+ children: [/* @__PURE__ */ jsx("span", {
152
+ className: "truncate",
153
+ children: p.name
154
+ }), p.line ? /* @__PURE__ */ jsx("span", {
155
+ className: "truncate text-[12px] leading-4 text-kit-insp-quiet",
156
+ children: p.line
157
+ }) : null]
158
+ }), p.id === value ? /* @__PURE__ */ jsx(IconCheck, {
159
+ "aria-hidden": true,
160
+ className: "size-3.5 shrink-0 text-kit-insp-label",
161
+ stroke: 2
162
+ }) : null]
163
+ })
164
+ }, p.id)) });
165
+ }
166
+ function AuthorField({ value, people, onChange, onNew, onOpenProfile, noun = "author", disabled, className, ...aria }) {
167
+ const p = value ? people.find((x) => x.id === value) : void 0;
168
+ const Noun = `${noun.charAt(0).toUpperCase()}${noun.slice(1)}`;
169
+ if (!p) return /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsxs(MenuTrigger, {
170
+ disabled,
171
+ "aria-labelledby": aria["aria-labelledby"],
172
+ "data-slot": "kit-author-pick",
173
+ className: cn("flex h-9 w-full items-center gap-2 rounded-[6px] px-2.5 text-left text-[13px] leading-[19.5px] text-kit-insp-faint outline-none", FIELD, "focus-visible:border-kit-insp-accent focus-visible:bg-kit-insp-card-focus data-[popup-open]:border-kit-insp-accent data-[popup-open]:bg-kit-insp-card-focus", className),
174
+ children: [
175
+ /* @__PURE__ */ jsx("span", {
176
+ "aria-hidden": true,
177
+ className: "size-5 shrink-0 rounded-full shadow-[inset_0_0_0_1px_var(--kit-insp-line-strong)]"
178
+ }),
179
+ "Select an ",
180
+ noun,
181
+ /* @__PURE__ */ jsx(IconChevronDown, {
182
+ "aria-hidden": true,
183
+ className: "ml-auto size-3.5 shrink-0 text-kit-group-sub",
184
+ stroke: 1.8
185
+ })
186
+ ]
187
+ }), /* @__PURE__ */ jsxs(MenuContent, {
188
+ align: "start",
189
+ className: "w-[300px] min-w-[var(--anchor-width)]",
190
+ children: [
191
+ /* @__PURE__ */ jsxs(MenuLabel, { children: [
192
+ "Search ",
193
+ noun,
194
+ "s"
195
+ ] }),
196
+ /* @__PURE__ */ jsx(PersonItems, {
197
+ people,
198
+ value,
199
+ onPick: onChange
200
+ }),
201
+ onNew ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MenuSeparator, {}), /* @__PURE__ */ jsxs(MenuItem, {
202
+ icon: /* @__PURE__ */ jsx(IconPlus, { stroke: 1.5 }),
203
+ onClick: onNew,
204
+ children: [
205
+ "New ",
206
+ noun,
207
+ " in ",
208
+ Noun,
209
+ "s"
210
+ ]
211
+ })] }) : null
212
+ ]
213
+ })] });
214
+ return /* @__PURE__ */ jsxs("div", {
215
+ "data-slot": "kit-author-card",
216
+ className: cn("flex items-center gap-1.5 rounded-[12px] bg-kit-insp-tip-bg p-1.5 shadow-[inset_0_0_0_1px_var(--kit-insp-divider),0_1px_3px_rgb(0_0_0/0.05)]", className),
217
+ children: [/* @__PURE__ */ jsxs("div", {
218
+ className: "flex min-w-0 flex-1 items-center gap-2.5 rounded-[8px] bg-kit-insp-card px-2.5 py-2",
219
+ children: [/* @__PURE__ */ jsx(Face, {
220
+ p,
221
+ size: 36
222
+ }), /* @__PURE__ */ jsxs("span", {
223
+ className: "flex min-w-0 flex-col",
224
+ children: [/* @__PURE__ */ jsx("b", {
225
+ className: "truncate text-[14px] font-medium leading-5 text-kit-insp-tip-title",
226
+ children: p.name
227
+ }), p.line ? /* @__PURE__ */ jsx("small", {
228
+ className: "truncate text-[12px] leading-4 text-kit-group-sub",
229
+ children: p.line
230
+ }) : null]
231
+ })]
232
+ }), disabled ? null : /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsx(MenuTrigger, {
233
+ "aria-label": `${Noun} options`,
234
+ "data-slot": "kit-author-more",
235
+ className: "grid size-7 shrink-0 place-items-center rounded-[6px] text-kit-insp-label outline-none transition-colors hover:bg-kit-insp-card data-[popup-open]:bg-kit-insp-card focus-visible:outline-2 focus-visible:outline-kit-insp-accent",
236
+ children: /* @__PURE__ */ jsx(IconDots, {
237
+ "aria-hidden": true,
238
+ className: "size-4",
239
+ stroke: 1.6
240
+ })
241
+ }), /* @__PURE__ */ jsxs(MenuContent, {
242
+ align: "end",
243
+ className: "w-[220px]",
244
+ children: [
245
+ /* @__PURE__ */ jsxs(MenuSub, { children: [/* @__PURE__ */ jsxs(MenuSubTrigger, {
246
+ icon: /* @__PURE__ */ jsx(IconArrowsExchange, {
247
+ "aria-hidden": true,
248
+ stroke: 1.5
249
+ }),
250
+ children: ["Change ", noun]
251
+ }), /* @__PURE__ */ jsx(MenuSubContent, {
252
+ className: "w-[280px]",
253
+ children: /* @__PURE__ */ jsx(PersonItems, {
254
+ people,
255
+ value,
256
+ onPick: onChange
257
+ })
258
+ })] }),
259
+ onOpenProfile ? /* @__PURE__ */ jsx(MenuItem, {
260
+ icon: /* @__PURE__ */ jsx(IconUser, { stroke: 1.5 }),
261
+ onClick: () => onOpenProfile(p.id),
262
+ children: "Open profile"
263
+ }) : null,
264
+ /* @__PURE__ */ jsx(MenuSeparator, {}),
265
+ /* @__PURE__ */ jsxs(MenuItem, {
266
+ danger: true,
267
+ icon: /* @__PURE__ */ jsx(IconTrash, { stroke: 1.5 }),
268
+ onClick: () => onChange(null),
269
+ children: ["Remove ", noun]
270
+ })
271
+ ]
272
+ })] })]
273
+ });
274
+ }
275
+ //#endregion
276
+ export { AuthorField, TagsInput };
277
+
278
+ //# sourceMappingURL=content-fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-fields.js","names":[],"sources":["../../src/ui/content-fields.tsx"],"sourcesContent":["/**\n * Content fields of prototype editor-v16 (src/content.jsx:836-853, content.css:130-136, 171-174, 563-565):\n *\n * <TagsInput> grey box of white tag chips (24 high, 12/500) with \"Remove {tag}\" ×, an \"Add a tag\" input; Enter adds,\n * Backspace on the empty input removes the last; chips pop in and out\n * <AuthorField> one author. Empty = the \"Select an author\" picker (36 high, 20 placeholder circle); picked = an\n * outlined card with the grey profile (36 avatar, name 14/20 medium, \"Role · 4 posts\") and ⋯ beside it\n *\n * Editor-scoped look (the --kit-insp-* roles). The kit's own tags and reference controls are unchanged.\n */\nimport * as React from \"react\";\nimport { IconArrowsExchange, IconCheck, IconChevronDown, IconDots, IconPlus, IconTrash, IconUser, IconX } from \"@tabler/icons-react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"framer-motion\";\nimport { cn } from \"../lib/cn\";\nimport { Menu, MenuContent, MenuItem, MenuLabel, MenuSeparator, MenuSub, MenuSubContent, MenuSubTrigger, MenuTrigger } from \"./overlay\";\n\nconst HAIR = \"shadow-[0_1px_3px_rgb(0_0_0/0.05)]\";\nconst FIELD = \"border border-transparent bg-kit-insp-card transition-colors duration-100 hover:bg-kit-insp-card-hover\";\n\nexport interface TagsInputProps {\n value: string[];\n onChange: (next: string[]) => void;\n placeholder?: string;\n disabled?: boolean;\n /** refuse a tag (a duplicate is always refused); return the reason to announce, or nothing to accept */\n validate?: (tag: string, tags: string[]) => string | undefined;\n id?: string;\n \"aria-labelledby\"?: string;\n \"aria-label\"?: string;\n className?: string;\n}\n\nexport function TagsInput({ value, onChange, placeholder = \"Add a tag\", disabled, validate, id, className, ...aria }: TagsInputProps) {\n const [v, setV] = React.useState(\"\");\n const [said, setSaid] = React.useState(\"\");\n const reduce = useReducedMotion();\n const layout = reduce ? { duration: 0 } : ({ type: \"spring\", stiffness: 500, damping: 40 } as const);\n const add = () => {\n const t = v.trim();\n if (!t) return;\n const why = value.includes(t) ? `${t} is already added` : validate?.(t, value);\n if (why) return setSaid(why);\n onChange([...value, t]);\n setV(\"\");\n setSaid(`${t} added`);\n };\n const remove = (t: string) => {\n onChange(value.filter((x) => x !== t));\n setSaid(`${t} removed`);\n };\n return (\n <div data-slot=\"kit-tags-input\" className={cn(\"flex min-h-9 flex-wrap items-center gap-1.5 rounded-[6px] p-1.5\", FIELD, \"focus-within:border-kit-insp-accent focus-within:bg-kit-insp-card-focus\", disabled && \"pointer-events-none opacity-60\", className)}>\n <AnimatePresence initial={false} mode=\"popLayout\">\n {value.map((t) => (\n <motion.span\n layout\n key={t}\n data-slot=\"kit-tag\"\n initial={reduce ? false : { opacity: 0, scale: 0.8 }}\n animate={{ opacity: 1, scale: 1 }}\n exit={reduce ? { opacity: 0, transition: { duration: 0 } } : { opacity: 0, scale: 0.8, transition: { duration: 0.14, ease: [0.4, 0, 1, 1] } }}\n transition={reduce ? { duration: 0 } : { type: \"spring\", stiffness: 520, damping: 20, layout }}\n className={cn(\"inline-flex h-6 items-center gap-1 rounded-[4px] bg-kit-insp-tip-bg pl-2 pr-1 text-[12px] font-medium leading-[18px] text-kit-insp-tip-title\", HAIR)}\n >\n {t}\n <button type=\"button\" aria-label={`Remove ${t}`} disabled={disabled} onClick={() => remove(t)} className=\"grid size-4 place-items-center rounded-[3px] text-kit-group-sub outline-none hover:bg-kit-insp-card focus-visible:bg-kit-insp-card focus-visible:outline-2 focus-visible:outline-kit-insp-accent\">\n <IconX aria-hidden className=\"size-[11px]\" stroke={2} />\n </button>\n </motion.span>\n ))}\n </AnimatePresence>\n <motion.input\n layout\n transition={{ layout }}\n id={id}\n value={v}\n disabled={disabled}\n placeholder={placeholder}\n aria-label={aria[\"aria-labelledby\"] ? undefined : (aria[\"aria-label\"] ?? placeholder)}\n aria-labelledby={aria[\"aria-labelledby\"]}\n onChange={(e) => setV(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" && v.trim()) {\n e.preventDefault();\n add();\n }\n if (e.key === \"Backspace\" && !v && value.length) remove(value[value.length - 1]!);\n }}\n className=\"min-w-20 flex-1 border-0 bg-transparent text-[13px] leading-[18px] text-kit-insp-ink outline-none placeholder:text-kit-group-sub\"\n />\n <span role=\"status\" aria-live=\"polite\" className=\"sr-only\">{said}</span>\n </div>\n );\n}\n\nexport interface AuthorOption {\n id: string;\n name: string;\n /** \"Editor · 4 posts\": role and post count, on the card and in the picker */\n line?: string;\n /** the avatar (the host's own component or an <img>); drawn 24 in the picker and 36 on the card */\n avatar?: (size: number) => React.ReactNode;\n}\n\nexport interface AuthorFieldProps {\n value: string | null | undefined;\n people: AuthorOption[];\n onChange: (id: string | null) => void;\n /** \"New author in Authors\" at the end of the picker; omitted = no such row */\n onNew?: () => void;\n /** \"Open profile\" in the card's ⋯ menu; omitted = no such row */\n onOpenProfile?: (id: string) => void;\n /** what one of these is called: \"author\" (default), \"writer\"… */\n noun?: string;\n disabled?: boolean;\n \"aria-labelledby\"?: string;\n className?: string;\n}\n\nconst initials = (name: string) => name.split(/\\s+/).filter(Boolean).slice(0, 2).map((w) => w[0]!.toUpperCase()).join(\"\");\nfunction Face({ p, size }: { p: AuthorOption; size: number }) {\n return (\n <span aria-hidden className=\"grid shrink-0 place-items-center overflow-hidden rounded-full bg-kit-insp-chip font-medium text-kit-insp-label [&>img]:size-full [&>img]:object-cover\" style={{ width: size, height: size, fontSize: Math.round(size * 0.4) }}>\n {p.avatar ? p.avatar(size) : initials(p.name)}\n </span>\n );\n}\nfunction PersonItems({ people, value, onPick }: { people: AuthorOption[]; value: string | null | undefined; onPick: (id: string) => void }) {\n return (\n <>\n {people.map((p) => (\n <MenuItem key={p.id} icon={<Face p={p} size={24} />} onClick={() => onPick(p.id)} aria-current={p.id === value || undefined} className=\"h-auto py-1.5\">\n <span className=\"flex items-center gap-2\">\n <span className=\"flex min-w-0 flex-1 flex-col\">\n <span className=\"truncate\">{p.name}</span>\n {p.line ? <span className=\"truncate text-[12px] leading-4 text-kit-insp-quiet\">{p.line}</span> : null}\n </span>\n {p.id === value ? <IconCheck aria-hidden className=\"size-3.5 shrink-0 text-kit-insp-label\" stroke={2} /> : null}\n </span>\n </MenuItem>\n ))}\n </>\n );\n}\n\nexport function AuthorField({ value, people, onChange, onNew, onOpenProfile, noun = \"author\", disabled, className, ...aria }: AuthorFieldProps) {\n const p = value ? people.find((x) => x.id === value) : undefined;\n const Noun = `${noun.charAt(0).toUpperCase()}${noun.slice(1)}`;\n if (!p)\n return (\n <Menu>\n <MenuTrigger\n disabled={disabled}\n aria-labelledby={aria[\"aria-labelledby\"]}\n data-slot=\"kit-author-pick\"\n className={cn(\"flex h-9 w-full items-center gap-2 rounded-[6px] px-2.5 text-left text-[13px] leading-[19.5px] text-kit-insp-faint outline-none\", FIELD, \"focus-visible:border-kit-insp-accent focus-visible:bg-kit-insp-card-focus data-[popup-open]:border-kit-insp-accent data-[popup-open]:bg-kit-insp-card-focus\", className)}\n >\n <span aria-hidden className=\"size-5 shrink-0 rounded-full shadow-[inset_0_0_0_1px_var(--kit-insp-line-strong)]\" />\n Select an {noun}\n <IconChevronDown aria-hidden className=\"ml-auto size-3.5 shrink-0 text-kit-group-sub\" stroke={1.8} />\n </MenuTrigger>\n <MenuContent align=\"start\" className=\"w-[300px] min-w-[var(--anchor-width)]\">\n <MenuLabel>Search {noun}s</MenuLabel>\n <PersonItems people={people} value={value} onPick={onChange} />\n {onNew ? (\n <>\n <MenuSeparator />\n <MenuItem icon={<IconPlus stroke={1.5} />} onClick={onNew}>New {noun} in {Noun}s</MenuItem>\n </>\n ) : null}\n </MenuContent>\n </Menu>\n );\n return (\n <div data-slot=\"kit-author-card\" className={cn(\"flex items-center gap-1.5 rounded-[12px] bg-kit-insp-tip-bg p-1.5 shadow-[inset_0_0_0_1px_var(--kit-insp-divider),0_1px_3px_rgb(0_0_0/0.05)]\", className)}>\n <div className=\"flex min-w-0 flex-1 items-center gap-2.5 rounded-[8px] bg-kit-insp-card px-2.5 py-2\">\n <Face p={p} size={36} />\n <span className=\"flex min-w-0 flex-col\">\n <b className=\"truncate text-[14px] font-medium leading-5 text-kit-insp-tip-title\">{p.name}</b>\n {p.line ? <small className=\"truncate text-[12px] leading-4 text-kit-group-sub\">{p.line}</small> : null}\n </span>\n </div>\n {disabled ? null : (\n <Menu>\n <MenuTrigger aria-label={`${Noun} options`} data-slot=\"kit-author-more\" className=\"grid size-7 shrink-0 place-items-center rounded-[6px] text-kit-insp-label outline-none transition-colors hover:bg-kit-insp-card data-[popup-open]:bg-kit-insp-card focus-visible:outline-2 focus-visible:outline-kit-insp-accent\">\n <IconDots aria-hidden className=\"size-4\" stroke={1.6} />\n </MenuTrigger>\n <MenuContent align=\"end\" className=\"w-[220px]\">\n <MenuSub>\n <MenuSubTrigger icon={<IconArrowsExchange aria-hidden stroke={1.5} />}>Change {noun}</MenuSubTrigger>\n <MenuSubContent className=\"w-[280px]\">\n <PersonItems people={people} value={value} onPick={onChange} />\n </MenuSubContent>\n </MenuSub>\n {onOpenProfile ? <MenuItem icon={<IconUser stroke={1.5} />} onClick={() => onOpenProfile(p.id)}>Open profile</MenuItem> : null}\n <MenuSeparator />\n <MenuItem danger icon={<IconTrash stroke={1.5} />} onClick={() => onChange(null)}>Remove {noun}</MenuItem>\n </MenuContent>\n </Menu>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,IAAM,OAAO;AACb,IAAM,QAAQ;AAed,SAAgB,UAAU,EAAE,OAAO,UAAU,cAAc,aAAa,UAAU,UAAU,IAAI,WAAW,GAAG,QAAwB;CACpI,MAAM,CAAC,GAAG,QAAQ,MAAM,SAAS,EAAE;CACnC,MAAM,CAAC,MAAM,WAAW,MAAM,SAAS,EAAE;CACzC,MAAM,SAAS,iBAAiB;CAChC,MAAM,SAAS,SAAS,EAAE,UAAU,EAAE,IAAK;EAAE,MAAM;EAAU,WAAW;EAAK,SAAS;CAAG;CACzF,MAAM,YAAY;EAChB,MAAM,IAAI,EAAE,KAAK;EACjB,IAAI,CAAC,GAAG;EACR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