@bettercms-ai/kit 3.2.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 (135) 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 +81 -4
  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 +3 -3
  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/control.d.ts +1 -1
  48. package/dist/controls/rich-text/control.js +11 -29
  49. package/dist/controls/rich-text/control.js.map +1 -1
  50. package/dist/controls/rich-text/dom.d.ts +27 -0
  51. package/dist/controls/rich-text/dom.js +69 -4
  52. package/dist/controls/rich-text/dom.js.map +1 -1
  53. package/dist/controls/rich-text/editor.js +212 -50
  54. package/dist/controls/rich-text/editor.js.map +1 -1
  55. package/dist/controls/rich-text/ops.js +1 -0
  56. package/dist/controls/rich-text/ops.js.map +1 -1
  57. package/dist/controls/rich-text/slash-preview.d.ts +8 -0
  58. package/dist/controls/rich-text/slash-preview.js +287 -0
  59. package/dist/controls/rich-text/slash-preview.js.map +1 -0
  60. package/dist/controls/rich-text/table-grid.d.ts +22 -0
  61. package/dist/controls/rich-text/table-grid.js +1052 -0
  62. package/dist/controls/rich-text/table-grid.js.map +1 -0
  63. package/dist/controls/rich-text/toolbar.js +60 -18
  64. package/dist/controls/rich-text/toolbar.js.map +1 -1
  65. package/dist/controls/text.d.ts +6 -0
  66. package/dist/controls/text.js +95 -5
  67. package/dist/controls/text.js.map +1 -1
  68. package/dist/core/facets.d.ts +1 -0
  69. package/dist/core/facets.js +1 -0
  70. package/dist/core/facets.js.map +1 -1
  71. package/dist/engine/array.d.ts +7 -0
  72. package/dist/engine/array.js +164 -45
  73. package/dist/engine/array.js.map +1 -1
  74. package/dist/engine/expand.d.ts +1 -1
  75. package/dist/engine/expand.js +1 -1
  76. package/dist/engine/expand.js.map +1 -1
  77. package/dist/engine/field-shell.d.ts +12 -0
  78. package/dist/engine/field-shell.js +217 -63
  79. package/dist/engine/field-shell.js.map +1 -1
  80. package/dist/engine/frame.js +39 -2
  81. package/dist/engine/frame.js.map +1 -1
  82. package/dist/engine/grouping.d.ts +71 -10
  83. package/dist/engine/grouping.js +223 -26
  84. package/dist/engine/grouping.js.map +1 -1
  85. package/dist/engine/held.d.ts +2 -2
  86. package/dist/engine/held.js +2 -2
  87. package/dist/engine/held.js.map +1 -1
  88. package/dist/engine/kit-field.d.ts +0 -10
  89. package/dist/engine/kit-field.js +40 -72
  90. package/dist/engine/kit-field.js.map +1 -1
  91. package/dist/engine/schema-form.js +7 -2
  92. package/dist/engine/schema-form.js.map +1 -1
  93. package/dist/index.d.ts +1 -1
  94. package/dist/index.js +14 -7
  95. package/dist/index.js.map +1 -1
  96. package/dist/kit.css +85 -0
  97. package/dist/schema/table.d.ts +2 -1
  98. package/dist/schema/table.js +5 -0
  99. package/dist/schema/table.js.map +1 -1
  100. package/dist/schema/types.d.ts +6 -0
  101. package/dist/schema/types.js.map +1 -1
  102. package/dist/styles.css +1 -1
  103. package/dist/theme.css +115 -0
  104. package/dist/tokens.css +268 -0
  105. package/dist/ui/block-icon-picker.d.ts +38 -0
  106. package/dist/ui/block-icon-picker.js +141 -0
  107. package/dist/ui/block-icon-picker.js.map +1 -0
  108. package/dist/ui/button.js +1 -0
  109. package/dist/ui/button.js.map +1 -1
  110. package/dist/ui/code-language-menu.d.ts +24 -0
  111. package/dist/ui/code-language-menu.js +123 -0
  112. package/dist/ui/code-language-menu.js.map +1 -0
  113. package/dist/ui/content-fields.d.ts +47 -0
  114. package/dist/ui/content-fields.js +278 -0
  115. package/dist/ui/content-fields.js.map +1 -0
  116. package/dist/ui/foundations.d.ts +118 -0
  117. package/dist/ui/foundations.js +564 -0
  118. package/dist/ui/foundations.js.map +1 -0
  119. package/dist/ui/index.d.ts +6 -0
  120. package/dist/ui/index.js +7 -1
  121. package/dist/ui/inspector.d.ts +394 -0
  122. package/dist/ui/inspector.js +1173 -0
  123. package/dist/ui/inspector.js.map +1 -0
  124. package/dist/ui/overlay.d.ts +7 -2
  125. package/dist/ui/overlay.js +55 -20
  126. package/dist/ui/overlay.js.map +1 -1
  127. package/dist/ui/shortcut-hint.js +1 -1
  128. package/dist/ui/shortcut-hint.js.map +1 -1
  129. package/dist/ui/toast.d.ts +5 -3
  130. package/dist/ui/toast.js +83 -11
  131. package/dist/ui/toast.js.map +1 -1
  132. package/dist/ui/tooltip-card.d.ts +45 -0
  133. package/dist/ui/tooltip-card.js +135 -0
  134. package/dist/ui/tooltip-card.js.map +1 -0
  135. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspector.js","names":[],"sources":["../../src/ui/inspector.tsx"],"sourcesContent":["/**\n * Inspector foundation · V1.6: the Visual Editor inspector's own building blocks, as prototype editor-v16 draws them\n * (src/kit.jsx:59-250, kit.css:1-100, styles.css:153-218 + 286-289, editor.css:242-251 + 411-461, faq.css:48-49).\n *\n * <InspectorBody> groups stacked 32 apart, 24/16/32 padding, a 1px divider 20 under every group but the last\n * <InspectorGroup> one group: header, then its fields 16 below\n * <GroupHeader> Content tab group: 14/20 medium title + 13/18 supporting line\n * <SectionHeader> Design / Settings group: 16 icon + 14/20 medium, trailing Reset · Locked · collapse chevron\n * <InspectorFields> stacked fields 20 apart (`rows`: inline rows 12 apart)\n * <InlineRow> label left, control right in a fixed 194 column\n * <InspectorSeg> segmented control with the sliding pill\n * <SelectCompact> / <SelectField> / <ColourSelect> grey field selects (32 compact, 34 full width)\n * <StepSlider> / <StepRow> / <ValueSlider> the stop slider and the value-inside slider\n * <ToggleRow> / <ToggleCard> / <InspectorSwitch> label-left switch rows, related ones in one grey card\n * <ItemListCard> + <ItemRow> + <ItemListAdd> + <ItemListNote> the grey item list card\n * <ItemDeleteButton> the red \"Delete <noun>\" that ends an item screen\n * <InspectorField> + <FieldCounter> label row with the focus dot, the sweep, and the n / max counter\n *\n * Editor-scoped: these read the --kit-insp-* roles (tokens.css) and nothing else in the kit draws them unless a host\n * asks (`KitLookProvider look=\"v16\"` for the engine). Every other kit consumer keeps the V2 look.\n */\nimport * as React from \"react\";\nimport { IconCheck, IconChevronDown, IconDots, IconGripVertical, IconInfoCircle, IconLock } from \"@tabler/icons-react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"framer-motion\";\nimport { cn } from \"../lib/cn\";\nimport { Menu, MenuContent, MenuItem, MenuLabel, MenuSeparator, MenuTrigger } from \"./overlay\";\nimport { InfoTooltip } from \"./tooltip-card\";\n\n/** The prototype's accordion curve (kit.jsx:60 ACC) and its sliding-pill spring (kit.jsx:59 PILL). */\nexport const INSPECTOR_EASE = [0.22, 1, 0.36, 1] as const;\nconst PILL = { type: \"spring\", stiffness: 520, damping: 40, mass: 0.8 } as const;\nconst FOCUS = \"outline-none focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-kit-insp-accent\";\n\n/* ── Body, group, fields, divider ───────────────────────────────────── */\n\n/** Panel body (kit.css:6-8). `sub` = a drill-in screen (16 on top instead of 24). */\nexport function InspectorBody({ sub, className, children, ...rest }: React.HTMLAttributes<HTMLDivElement> & { sub?: boolean }) {\n return (\n <div\n data-slot=\"kit-insp-body\"\n className={cn(\n \"flex min-w-0 flex-col gap-8 px-4 pb-8\",\n sub ? \"pt-4\" : \"pt-6\",\n \"[&>[data-slot=kit-insp-group]:not(:last-child)]:border-b [&>[data-slot=kit-insp-group]:not(:last-child)]:border-kit-insp-divider [&>[data-slot=kit-insp-group]:not(:last-child)]:pb-5\",\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n );\n}\n\n/** One group in the body (kit.css:9, 13, 36). `locked` greys its fields and makes them read-only; `flash` runs the\n * 1.2s violet flash a jump-to-group ends with. */\nexport function InspectorGroup({\n locked, flash, className, children, ...rest\n}: React.HTMLAttributes<HTMLElement> & { locked?: boolean; flash?: boolean }) {\n return (\n <section\n data-slot=\"kit-insp-group\"\n data-locked={locked || undefined}\n className={cn(\"flex min-w-0 flex-col gap-4\", flash && \"animate-[kit-insp-group-flash_1.2s_ease] motion-reduce:animate-none\", className)}\n {...rest}\n >\n {children}\n </section>\n );\n}\n\n/** The fields of a group (kit.css:10-11): 20 apart, or 12 for a run of inline rows. */\nexport function InspectorFields({ rows, className, children, ...rest }: React.HTMLAttributes<HTMLDivElement> & { rows?: boolean }) {\n return (\n <div data-slot=\"kit-insp-fields\" className={cn(\"flex min-w-0 flex-col\", rows ? \"gap-3\" : \"gap-5\", className)} {...rest}>\n {children}\n </div>\n );\n}\n\n/** The 1px rule between groups, for a host that stacks groups outside <InspectorBody> (kit.css:8). */\nexport function InspectorDivider({ className }: { className?: string }) {\n return <div role=\"separator\" data-slot=\"kit-insp-divider\" className={cn(\"h-px w-full shrink-0 bg-kit-insp-divider\", className)} />;\n}\n\n/** Fields a role cannot edit (kit.css:36-37): one disabled fieldset at .45. */\nexport function InspectorLocked({ on, children }: { on?: boolean; children: React.ReactNode }) {\n if (!on) return <>{children}</>;\n return (\n <fieldset disabled aria-disabled=\"true\" data-slot=\"kit-insp-locked\" className=\"m-0 flex min-w-0 flex-col gap-[inherit] border-0 p-0 opacity-45 [&_*]:!cursor-default\">\n {children}\n </fieldset>\n );\n}\n\n/* ── Headers ────────────────────────────────────────────────────────── */\n\nexport interface GroupHeaderProps {\n title: React.ReactNode;\n /** supporting line under the title */\n sub?: React.ReactNode;\n /** trailing controls (link, comment, ⋯) */\n actions?: React.ReactNode;\n /** id of the title element, for aria-labelledby on the group */\n titleId?: string;\n className?: string;\n}\n\n/** Level-1 content group header (kit.jsx:66-68, kit.css:16-19; the inspector's ink is insp.css:19-20). */\nexport function GroupHeader({ title, sub, actions, titleId, className }: GroupHeaderProps) {\n return (\n <div data-slot=\"kit-group-header\" className={cn(\"flex items-start gap-2\", className)}>\n <div className=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <h3 id={titleId} className=\"text-[14px] font-medium leading-5 tracking-[-0.2px] text-kit-group-title\">{title}</h3>\n {sub ? <p className=\"text-[13px] leading-[18px] tracking-[-0.16px] text-kit-group-sub\">{sub}</p> : null}\n </div>\n {actions}\n </div>\n );\n}\n\nexport interface SectionHeaderProps {\n /** 16px leading glyph */\n icon?: React.ReactNode;\n title: React.ReactNode;\n /** what sits at the end of the row */\n trailing?: \"reset\" | \"locked\" | \"collapse\";\n onReset?: () => void;\n /** the Reset is shown but inert (a read-only panel, a locked section, a save in flight) */\n resetDisabled?: boolean;\n /** with trailing=\"collapse\" */\n open?: boolean;\n onToggle?: () => void;\n /** description, always 4 under the title row */\n desc?: React.ReactNode;\n /** extra trailing content, before the Reset / chevron */\n actions?: React.ReactNode;\n titleId?: string;\n /** aria-controls for the collapse button */\n controls?: string;\n className?: string;\n}\n\n/** Design / Settings group header (kit.jsx:72-91, kit.css:22-33). Static unless trailing=\"collapse\". */\nexport function SectionHeader({ icon, title, trailing, onReset, resetDisabled, open, onToggle, desc, actions, titleId, controls, className }: SectionHeaderProps) {\n const row = (\n <>\n <span id={titleId} className=\"flex min-w-0 items-center gap-1.5 text-[14px] font-medium leading-5 text-kit-insp-title [&>svg]:size-4 [&>svg]:shrink-0 [&>img]:size-4 [&>img]:shrink-0\">\n {icon}\n <span className=\"truncate\">{title}</span>\n </span>\n <span className=\"flex-1\" />\n {trailing === \"locked\" ? (\n <span className=\"inline-flex items-center gap-1 text-[13px] text-kit-insp-faint\">\n <IconLock aria-hidden className=\"size-3.5\" stroke={1.8} />\n Locked\n </span>\n ) : null}\n {trailing === \"collapse\" ? (\n <span aria-hidden className={cn(\"grid text-kit-insp-desc transition-transform duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none\", open && \"rotate-180\")}>\n <IconChevronDown className=\"size-4\" stroke={1.6} />\n </span>\n ) : null}\n </>\n );\n return (\n <div data-slot=\"kit-section-header\" className={cn(\"flex flex-col gap-1\", className)}>\n {trailing === \"collapse\" ? (\n <div className=\"flex min-h-6 w-full items-center gap-1.5\">\n <button type=\"button\" aria-expanded={!!open} aria-controls={controls} onClick={onToggle} className={cn(\"flex min-h-6 min-w-0 flex-1 items-center gap-1.5 rounded-[4px] text-left\", FOCUS)}>\n {row}\n </button>\n {actions}\n </div>\n ) : (\n <div className=\"flex min-h-6 w-full items-center gap-1.5\">\n {row}\n {actions}\n {trailing === \"reset\" ? (\n <button\n type=\"button\"\n onClick={onReset}\n disabled={resetDisabled}\n aria-label={typeof title === \"string\" ? `Reset ${title}` : undefined}\n className={cn(\"rounded-[4px] px-0.5 text-[13px] text-kit-insp-quiet transition-colors enabled:hover:text-kit-insp-ink disabled:cursor-default disabled:opacity-50\", FOCUS)}\n >\n Reset\n </button>\n ) : null}\n </div>\n )}\n {desc ? <p className=\"m-0 text-[13px] leading-[18px] tracking-[-0.16px] text-kit-insp-desc\">{desc}</p> : null}\n </div>\n );\n}\n\n/** The quiet note under a group's fields (insp.css:32 `.adv-note`): 12/16 in the sub colour. */\nexport function InspectorNote({ id, className, children }: { id?: string; className?: string; children: React.ReactNode }) {\n return (\n <p id={id} data-slot=\"kit-insp-note\" className={cn(\"m-0 text-[12px] leading-4 text-kit-group-sub\", className)}>\n {children}\n </p>\n );\n}\n\n/* Layout option glyphs (kit.jsx:121-135 `LAYOUT_SVG`, `LayoutOpt`): every layout choice shows a 14 glyph before its label. */\nexport const LAYOUT_GLYPHS = {\n centred: <path d=\"M4 6h16M8 12h8M6 18h12\" />,\n left: <path d=\"M4 6h16M4 12h10M4 18h14\" />,\n stacked: (\n <>\n <rect x=\"4\" y=\"4\" width=\"16\" height=\"16\" rx=\"2\" />\n <path d=\"M4 12h16\" />\n </>\n ),\n two: (\n <>\n <rect x=\"4\" y=\"4\" width=\"16\" height=\"16\" rx=\"2\" />\n <path d=\"M12 4v16\" />\n </>\n ),\n three: (\n <>\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"1\" />\n <path d=\"M9 3v18M15 3v18\" />\n </>\n ),\n split: (\n <>\n <rect x=\"4\" y=\"4\" width=\"16\" height=\"16\" rx=\"2\" />\n <path d=\"M15 4v16\" />\n </>\n ),\n formLeft: (\n <>\n <rect x=\"4\" y=\"4\" width=\"16\" height=\"16\" rx=\"2\" />\n <path d=\"M9 4v16\" />\n </>\n ),\n row: (\n <>\n <path d=\"M4 4v16M20 4v16\" />\n <rect x=\"9\" y=\"6\" width=\"6\" height=\"12\" rx=\"2\" />\n </>\n ),\n grid: (\n <>\n <rect x=\"4\" y=\"4\" width=\"6\" height=\"6\" rx=\"1\" />\n <rect x=\"14\" y=\"4\" width=\"6\" height=\"6\" rx=\"1\" />\n <rect x=\"4\" y=\"14\" width=\"6\" height=\"6\" rx=\"1\" />\n <rect x=\"14\" y=\"14\" width=\"6\" height=\"6\" rx=\"1\" />\n </>\n ),\n scroll: (\n <>\n <rect x=\"7\" y=\"5\" width=\"10\" height=\"14\" rx=\"1\" />\n <path d=\"M22 17h-1a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h1M2 17h1a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1H2\" />\n </>\n ),\n} as const;\nexport type LayoutGlyphName = keyof typeof LAYOUT_GLYPHS;\n/** A layout glyph, then the option's label: `<LayoutOpt i=\"two\">Two columns</LayoutOpt>`. */\nexport function LayoutOpt({ i, children }: { i: LayoutGlyphName; children?: React.ReactNode }) {\n return (\n <>\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden className=\"shrink-0\">\n {LAYOUT_GLYPHS[i]}\n </svg>\n {children}\n </>\n );\n}\n\n/** Collapsible body for a SectionHeader with trailing=\"collapse\" (kit.jsx:248-252): height, then a 4px rise out of a\n * 4px blur, both on the accordion curve. Instant with reduced motion. */\nexport function InspectorCollapse({ open, id, rows, className, children }: { open: boolean; id?: string; rows?: boolean; className?: string; children: React.ReactNode }) {\n const reduce = useReducedMotion();\n const t = { duration: reduce ? 0 : 0.3, ease: INSPECTOR_EASE };\n return (\n <AnimatePresence initial={false}>\n {open ? (\n <motion.div key=\"c\" id={id} data-slot=\"kit-insp-collapse\" initial={{ height: 0 }} animate={{ height: \"auto\" }} exit={{ height: 0 }} transition={t} className=\"min-w-0 overflow-hidden\">\n <motion.div\n initial={reduce ? false : { opacity: 0, y: -4, filter: \"blur(4px)\" }}\n animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n exit={reduce ? undefined : { opacity: 0, y: -4, filter: \"blur(4px)\" }}\n transition={t}\n className={cn(\"flex min-w-0 flex-col\", rows ? \"gap-3\" : \"gap-5\", className)}\n >\n {children}\n </motion.div>\n </motion.div>\n ) : null}\n </AnimatePresence>\n );\n}\n\n/* ── Field label, focus dot, sweep, counter ─────────────────────────── */\n\nexport interface InspectorFieldProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> {\n label: React.ReactNode;\n /** id for the label element (aria-labelledby on the control) */\n labelId?: string;\n htmlFor?: string;\n /** the info tooltip after the label: its body text */\n info?: React.ReactNode;\n /** right side of the label row (counter, actions) */\n meta?: React.ReactNode;\n /** P-FDOT: this is the field a canvas click opened. Draws the 6px violet dot after the label. */\n current?: boolean;\n /** P-FDOT: run the violet sweep once (change the value to run it again, e.g. a click counter) */\n flash?: boolean | number | string;\n /** over its limit / invalid: the footer turns red */\n state?: \"over\" | \"bad\";\n /** under the control: hint left, counter right */\n hint?: React.ReactNode;\n counter?: React.ReactNode;\n}\n\n/**\n * The inspector field shell (editor.css:411-431, kit.css:506-515): label row 13/16 medium, min 20 high, the control 8\n * under it, then an optional 12/16 footer. `current` puts the focus dot after the label (order: label · dot · spacer ·\n * meta); `flash` runs the left-to-right violet sweep behind the whole field (a plain fade with reduced motion).\n */\nexport function InspectorField({ label, labelId, htmlFor, info, meta, current, flash, state, hint, counter, className, children, ...rest }: InspectorFieldProps) {\n const labelCls = \"flex min-h-5 items-center gap-1.5 text-[13px] font-medium leading-4 text-kit-insp-label\";\n const labelInner = (\n <>\n {label}\n {info ? <InfoTooltip title={label}>{info}</InfoTooltip> : null}\n {current ? <FocusDot /> : null}\n <span className=\"flex-1\" />\n {meta}\n </>\n );\n return (\n <div\n data-slot=\"kit-insp-field\"\n data-cur={current || undefined}\n data-state={state}\n className={cn(\"relative flex min-w-0 flex-col gap-2 rounded-[4px]\", flash ? \"isolate\" : null, className)}\n {...rest}\n >\n {flash ? <FieldSweep key={String(flash)} /> : null}\n {htmlFor ? (\n <label id={labelId} htmlFor={htmlFor} data-slot=\"kit-insp-label\" className={labelCls}>{labelInner}</label>\n ) : (\n <div id={labelId} data-slot=\"kit-insp-label\" className={labelCls}>{labelInner}</div>\n )}\n {children}\n {hint || counter ? (\n <div data-slot=\"kit-insp-field-foot\" className={cn(\"flex justify-between gap-3 text-[12px] leading-4\", state === \"over\" ? \"text-kit-insp-error\" : \"text-kit-insp-faint\")}>\n <span className=\"min-w-0\">{hint}</span>\n {counter}\n </div>\n ) : null}\n </div>\n );\n}\n\n/** The 6px violet dot after a field's label while it is the one a canvas click opened (kit.css:513-515). */\nexport function FocusDot({ className }: { className?: string }) {\n return <span aria-hidden data-slot=\"kit-focus-dot\" className={cn(\"size-1.5 shrink-0 rounded-full bg-kit-insp-accent animate-[kit-insp-dot_0.24s_cubic-bezier(0.2,0.8,0.2,1)_both] motion-reduce:animate-none\", className)} />;\n}\n\n/** The soft violet fill that sweeps across a field a canvas click opened (kit.css:506-511). Sits behind the field, 6/8\n * outside it; the parent must be `relative isolate`. */\nexport function FieldSweep({ className }: { className?: string }) {\n return (\n <span\n aria-hidden\n data-slot=\"kit-field-sweep\"\n className={cn(\n \"pointer-events-none absolute -inset-x-2 -inset-y-1.5 -z-10 rounded-[6px] bg-linear-to-r/srgb from-kit-insp-flash-a via-kit-insp-flash-b via-55% to-kit-insp-flash-c\",\n \"[clip-path:inset(0_100%_0_0_round_6px)] animate-[kit-insp-sweep_1.4s_cubic-bezier(0.4,0,0.2,1)_forwards]\",\n \"motion-reduce:[clip-path:none] motion-reduce:animate-[kit-insp-fade_1.6s_ease_forwards]\",\n className,\n )}\n />\n );\n}\n\n/** How close a count is to its limit, by the prototype's rule (state.js:93 countLevel): \"near\" above 91% of the\n * limit, \"over\" past it. */\nexport function counterState(n: number, max?: number): \"ok\" | \"near\" | \"over\" {\n if (!max) return \"ok\";\n return n > max ? \"over\" : n > Math.floor(max * 0.91) ? \"near\" : \"ok\";\n}\n\n/** The 12px progress ring beside a counter that is near or over its limit (content.jsx:307-309, content.css:617): a\n * grey track, an amber arc that fills with the count, red when over. Springs in and out (wrap it in AnimatePresence). */\nexport function CountRing({ value, max, className }: { value: number; max: number; className?: string }) {\n const reduce = useReducedMotion();\n const r = 4.5;\n const c = 2 * Math.PI * r;\n const over = value > max;\n return (\n <motion.svg\n aria-hidden\n data-slot=\"kit-count-ring\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n initial={reduce ? false : { scale: 0.5, opacity: 0 }}\n animate={{ scale: 1, opacity: 1 }}\n exit={reduce ? { opacity: 0 } : { scale: 0.5, opacity: 0 }}\n transition={reduce ? { duration: 0 } : { type: \"spring\", stiffness: 520, damping: 22 }}\n className={cn(\"shrink-0\", className)}\n >\n <circle cx=\"6\" cy=\"6\" r={r} fill=\"none\" strokeWidth=\"2\" className=\"stroke-kit-insp-track\" />\n <circle\n cx=\"6\"\n cy=\"6\"\n r={r}\n fill=\"none\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeDasharray={`${Math.min(value / max, 1) * c} ${c}`}\n transform=\"rotate(-90 6 6)\"\n className={cn(\"transition-[stroke-dasharray,stroke] duration-200 motion-reduce:transition-none\", over ? \"stroke-kit-insp-ring-over\" : \"stroke-kit-insp-ring-near\")}\n />\n </motion.svg>\n );\n}\n\n/** The field counter \"42 / 60\" (content.jsx:310-320; content.css:614-616; insp.css:163-164): 12/16 tabular, amber and\n * medium when near the limit, red over it, with the ring beside it in both states. Without `max` it is the bare count. */\nexport function FieldCounter({ value, max, ring = true, size = 11, className }: { value: number; max?: number; ring?: boolean; /** 11/14 in the inspector (insp.css:30), 12/16 in the content editor (editor.css:425) */ size?: 11 | 12; className?: string }) {\n const s = counterState(value, max);\n return (\n <span\n data-slot=\"kit-field-counter\"\n data-state={s}\n aria-label={max == null ? `${value} characters` : `${value} of ${max} characters`}\n className={cn(\"inline-flex shrink-0 items-center gap-1.5 tabular-nums transition-colors duration-200\", size === 11 ? \"text-[11px] leading-[14px]\" : \"text-[12px] leading-4\", s === \"near\" ? \"font-medium text-kit-insp-count-near\" : s === \"over\" ? \"font-medium text-kit-insp-count-over\" : \"text-kit-insp-faint\", className)}\n >\n <AnimatePresence initial={false}>{ring && max && s !== \"ok\" ? <CountRing key=\"r\" value={value} max={max} /> : null}</AnimatePresence>\n {max == null ? (\n value\n ) : (\n <span aria-hidden className=\"inline-flex items-center whitespace-pre\">\n <RollNumber value={value} />\n {` / ${max}`}\n </span>\n )}\n </span>\n );\n}\n\n/** A number that rolls (ui.jsx:371-378 `Roll`, faq.css:90-91): the new figure rises in from 6 below while the old one\n * lifts out, both blurred 2, in 0.16s. Tabular, so the text beside it does not move. */\nexport function RollNumber({ value, className }: { value: number | string; className?: string }) {\n return (\n <span data-slot=\"kit-roll\" className={cn(\"relative inline-block tabular-nums\", className)}>\n <AnimatePresence mode=\"popLayout\" initial={false}>\n <motion.span\n key={value}\n className=\"inline-block\"\n initial={{ opacity: 0, y: 6, filter: \"blur(2px)\" }}\n animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n exit={{ opacity: 0, y: -6, filter: \"blur(2px)\" }}\n transition={{ duration: 0.16, ease: [0.22, 1, 0.36, 1] }}\n >\n {value}\n </motion.span>\n </AnimatePresence>\n </span>\n );\n}\n\n/** The line under a field that is over its limit, in the prototype's words (content.jsx:318). */\nexport const overLimitText = (max: number) => `Over the ${max}-character limit`;\n/** Put on the input of a field that just went over its limit: the red inset edge and one 0.32s shake (content.css:618). */\nexport const OVER_LIMIT_CLASS = \"shadow-[inset_0_0_0_1px_var(--kit-insp-ring-over)] animate-[kit-insp-shake_0.32s_ease] motion-reduce:animate-none\";\n\n/* ── Inline row ─────────────────────────────────────────────────────── */\n\n/** Label left, control right in a fixed 194 column (kit.jsx:137, kit.css:50-55, 501-502). `meta` is the quiet current\n * value after the label (\"M · 8 px\"); `info` adds the info tooltip. */\nexport function InlineRow({\n label, meta, info, labelId, className, children,\n}: { label: React.ReactNode; meta?: React.ReactNode; info?: React.ReactNode; labelId?: string; className?: string; children: React.ReactNode }) {\n return (\n <div data-slot=\"kit-inline-row\" className={cn(\"flex min-h-8 items-center gap-4\", className)}>\n <span id={labelId} className=\"inline-flex min-w-0 flex-1 items-center gap-1 whitespace-nowrap text-[13px] leading-4 text-kit-insp-label\">\n {label}\n {info ? <InfoTooltip title={label}>{info}</InfoTooltip> : null}\n {meta ? <em className=\"truncate text-[12px] not-italic tabular-nums text-kit-insp-faint\">{meta}</em> : null}\n </span>\n <div className=\"w-[194px] flex-none\">{children}</div>\n </div>\n );\n}\n\n/* ── Segmented ──────────────────────────────────────────────────────── */\n\nexport interface InspectorSegOption<T extends string> {\n value: T;\n label: React.ReactNode;\n /** tooltip + accessible name (icon-only options need it) */\n title?: string;\n}\n\n/**\n * Segmented control, 2–5 options, with the sliding pill (kit.jsx:114-120; styles.css:188-191, editor.css:287 + 458-461,\n * insp.css:61). 36 high (32 with `small` or inside an InlineRow), 2 padding, grey track, white pill on the spring.\n * A radiogroup: arrows move the choice.\n */\nexport function InspectorSeg<T extends string>({\n options, value, onChange, small, disabled, className, \"aria-label\": ariaLabel, \"aria-labelledby\": labelledBy,\n}: {\n options: InspectorSegOption<T>[]; value: T; onChange: (v: T) => void; small?: boolean; disabled?: boolean; className?: string;\n \"aria-label\"?: string; \"aria-labelledby\"?: string;\n}) {\n const id = React.useId();\n const reduce = useReducedMotion();\n const move = (e: React.KeyboardEvent<HTMLDivElement>) => {\n const d = e.key === \"ArrowRight\" || e.key === \"ArrowDown\" ? 1 : e.key === \"ArrowLeft\" || e.key === \"ArrowUp\" ? -1 : 0;\n if (!d || disabled) return;\n e.preventDefault();\n const at = options.findIndex((o) => o.value === value);\n // nothing selected (a value no option carries): → takes the first, ← the last\n const next = at < 0 ? options[d > 0 ? 0 : options.length - 1] : options[(at + d + options.length) % options.length];\n if (!next) return;\n onChange(next.value);\n e.currentTarget.querySelector<HTMLElement>(`[data-seg=\"${CSS.escape(next.value)}\"]`)?.focus();\n };\n return (\n <div\n role=\"radiogroup\"\n aria-label={ariaLabel}\n aria-labelledby={labelledBy}\n data-slot=\"kit-insp-seg\"\n onKeyDown={move}\n className={cn(\"flex w-full gap-0.5 rounded-[6px] bg-kit-insp-track p-0.5\", small ? \"h-8\" : \"h-9\", className)}\n >\n {options.map((o, i) => {\n const on = o.value === value;\n // with nothing selected no pill is drawn and the first radio is the tab stop\n const stop = on || (i === 0 && !options.some((x) => x.value === value));\n return (\n <button\n key={o.value}\n type=\"button\"\n role=\"radio\"\n data-seg={o.value}\n disabled={disabled}\n aria-checked={on}\n aria-label={o.title}\n title={o.title}\n tabIndex={stop ? 0 : -1}\n onClick={() => onChange(o.value)}\n className={cn(\n \"relative min-w-0 flex-1 whitespace-nowrap rounded-[4px] tracking-[-0.16px] transition-colors disabled:cursor-default\",\n small ? \"text-[12.5px]\" : \"text-[13px]\",\n on ? \"font-medium text-kit-insp-ink\" : \"text-kit-insp-desc hover:text-kit-insp-ink\",\n FOCUS,\n )}\n >\n {on ? (\n <motion.span\n layoutId={`kit-seg-${id}`}\n transition={reduce ? { duration: 0 } : PILL}\n className=\"absolute inset-0 rounded-[5px] bg-kit-insp-seg-pill shadow-[0_0_0_0.5px_var(--kit-insp-line),0_1px_1px_rgb(0_0_0/0.1),0_3px_3px_rgb(0_0_0/0.09),0_6px_4px_rgb(0_0_0/0.05),0_11px_4px_rgb(0_0_0/0.01)]\"\n />\n ) : null}\n <span className=\"relative inline-flex items-center justify-center gap-1.5 [&>svg]:size-3.5 [&>svg]:shrink-0\">{o.label}</span>\n </button>\n );\n })}\n </div>\n );\n}\n\n/* ── Selects ────────────────────────────────────────────────────────── */\n\nexport interface InspectorOption<T extends string> {\n value: T;\n label: string;\n /** second line in the menu */\n desc?: string;\n /** shown but not pickable (a choice this site cannot take) */\n disabled?: boolean;\n}\n\nconst SELECT_BASE =\n \"flex w-full items-center rounded-[6px] border border-transparent bg-kit-insp-card text-left text-[13px] leading-[18px] text-kit-insp-ink transition-colors hover:bg-kit-insp-card-hover data-[popup-open]:border-kit-insp-accent data-[popup-open]:bg-kit-insp-card-focus disabled:cursor-default\";\n\nfunction OptionItems<T extends string>({ options, value, onPick }: { options: InspectorOption<T>[]; value: T | undefined; onPick: (v: T) => void }) {\n return (\n <>\n {options.map((o) => (\n <MenuItem key={o.value} disabled={o.disabled} onClick={() => onPick(o.value)} className={o.desc ? \"h-auto py-1.5\" : undefined} aria-current={o.value === value || undefined}>\n <span className=\"flex items-center gap-2\">\n <span className=\"flex min-w-0 flex-1 flex-col\">\n <span className=\"truncate\">{o.label}</span>\n {o.desc ? <span className=\"whitespace-normal text-[12px] leading-4 text-kit-insp-quiet\">{o.desc}</span> : null}\n </span>\n {o.value === 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\n/** Compact dropdown for an Inline row (kit.jsx:140-150, kit.css:58-62): 32 high, grey, violet edge while open. The menu\n * is at least as wide as the control. */\nexport function SelectCompact<T extends string>({\n value, options, onPick, icon, label, disabled, className,\n}: { value: T | undefined; options: InspectorOption<T>[]; onPick: (v: T) => void; icon?: React.ReactNode; label: string; disabled?: boolean; className?: string }) {\n const cur = options.find((o) => o.value === value);\n return (\n <Menu>\n <MenuTrigger aria-label={label} disabled={disabled} data-slot=\"kit-select-compact\" className={cn(SELECT_BASE, \"h-8 gap-1.5 pl-2.5 pr-2\", FOCUS, className)}>\n {icon ? <span aria-hidden className=\"flex shrink-0 text-kit-insp-label [&>svg]:size-3.5\">{icon}</span> : null}\n <span className=\"min-w-0 flex-1 truncate\">{cur ? cur.label : \"Select…\"}</span>\n <IconChevronDown aria-hidden className=\"size-3.5 shrink-0 text-kit-insp-desc\" stroke={1.6} />\n </MenuTrigger>\n <MenuContent align=\"start\" className=\"min-w-[var(--anchor-width)]\">\n <OptionItems options={options} value={value} onPick={onPick} />\n </MenuContent>\n </Menu>\n );\n}\n\n/** Full-width select with its label above (kit.jsx:153-164; editor.css:416-417, 433; faq.css:59): 34 high. */\nexport function SelectField<T extends string>({\n label, value, options, onPick, placeholder = \"Select…\", icon, info, disabled, current, flash, className,\n}: {\n label: React.ReactNode; value: T | undefined; options: InspectorOption<T>[]; onPick: (v: T) => void; placeholder?: string; icon?: React.ReactNode;\n info?: React.ReactNode; disabled?: boolean; current?: boolean; flash?: InspectorFieldProps[\"flash\"]; className?: string;\n}) {\n const id = React.useId();\n const cur = options.find((o) => o.value === value);\n return (\n <InspectorField label={label} labelId={`${id}-l`} info={info} current={current} flash={flash} className={className}>\n <Menu>\n <MenuTrigger aria-labelledby={`${id}-l ${id}-v`} disabled={disabled} data-slot=\"kit-select-field\" className={cn(SELECT_BASE, \"h-[34px] gap-2 px-2.5 tracking-[-0.1625px]\", FOCUS)}>\n {icon ? <span aria-hidden className=\"flex shrink-0 text-kit-insp-label [&>svg]:size-3.5\">{icon}</span> : null}\n <span id={`${id}-v`} className={cn(\"min-w-0 truncate\", !cur && \"text-kit-insp-faint\")}>{cur ? cur.label : placeholder}</span>\n <span className=\"flex-1\" />\n <IconChevronDown aria-hidden className=\"size-3.5 shrink-0 text-kit-insp-desc\" stroke={1.6} />\n </MenuTrigger>\n <MenuContent align=\"start\" className=\"min-w-[var(--anchor-width)]\">\n <OptionItems options={options} value={value} onPick={onPick} />\n </MenuContent>\n </Menu>\n </InspectorField>\n );\n}\n\nexport interface ColourOption<T extends string> {\n value: T;\n label: string;\n /** the design token's name, shown in the pill (\"surface/base\") */\n token: string;\n /** any CSS colour: the swatch */\n colour: string;\n}\n\n/** Colour select (kit.jsx:219-232, kit.css:77-79): value left, swatch + token pill right; the menu lists the theme\n * colours with their tokens under a header, then an optional readability note. */\nexport function ColourSelect<T extends string>({\n label, value, options, onPick, header = \"Section background\", note = \"Text switches to light on Inverse so it stays readable (4.5:1). Colours come from your site theme.\", disabled, className,\n}: { label: React.ReactNode; value: T | undefined; options: ColourOption<T>[]; onPick: (v: T) => void; /** the menu's heading; \"\" for none */ header?: string; /** the readability note under the options; null for none */ note?: React.ReactNode; disabled?: boolean; className?: string }) {\n const id = React.useId();\n const cur = options.find((o) => o.value === value) ?? options[0];\n const swatch = (c: string) => <span aria-hidden className=\"size-3.5 shrink-0 rounded-[3px] shadow-[inset_0_0_0_1px_rgb(0_0_0/0.12)]\" style={{ background: c }} />;\n return (\n <InspectorField label={label} labelId={`${id}-l`} className={className}>\n <Menu>\n <MenuTrigger aria-labelledby={`${id}-l ${id}-v`} disabled={disabled} data-slot=\"kit-colour-select\" className={cn(SELECT_BASE, \"h-[34px] gap-2 px-2.5 tracking-[-0.1625px]\", FOCUS)}>\n <span id={`${id}-v`} className=\"shrink-0\">{cur?.label ?? \"Select…\"}</span>\n <span className=\"flex-1\" />\n {cur ? (\n <span className=\"inline-flex h-[22px] items-center gap-1.5 whitespace-nowrap rounded-[4px] bg-kit-insp-token-chip pl-1 pr-1.5 text-[12px] text-kit-insp-desc\">\n {swatch(cur.colour)}\n {cur.token}\n </span>\n ) : null}\n <IconChevronDown aria-hidden className=\"size-3.5 shrink-0 text-kit-insp-desc\" stroke={1.6} />\n </MenuTrigger>\n <MenuContent align=\"start\" className=\"w-[300px] min-w-[var(--anchor-width)]\">\n {header ? <MenuLabel>{header}</MenuLabel> : null}\n {options.map((o) => (\n <MenuItem key={o.value} icon={swatch(o.colour)} onClick={() => onPick(o.value)} aria-current={o.value === value || undefined}>\n <span className=\"flex items-center gap-2\">\n <span className=\"min-w-0 flex-1 truncate\">{o.label}</span>\n <span className=\"shrink-0 text-[12px] text-kit-insp-quiet\">{o.token}</span>\n {o.value === value ? <IconCheck aria-hidden className=\"size-3.5 shrink-0 text-kit-insp-label\" stroke={2} /> : null}\n </span>\n </MenuItem>\n ))}\n {note ? (\n <>\n <MenuSeparator />\n <p className=\"px-2 py-1.5 text-[12px] leading-[17px] text-kit-insp-quiet\">{note}</p>\n </>\n ) : null}\n </MenuContent>\n </Menu>\n </InspectorField>\n );\n}\n\n/* ── Sliders ────────────────────────────────────────────────────────── */\n\nconst TRACK = \"relative h-7 touch-none select-none rounded-[6px] bg-kit-insp-track shadow-[inset_0_1px_2px_rgb(0_0_0/0.06)]\";\nconst HANDLE =\n \"absolute top-1/2 -ml-[5px] -mt-[10.5px] h-[21px] w-2.5 rounded-[4px] bg-kit-insp-handle shadow-[0_0_0_0.5px_rgb(0_0_0/0.18),0_1px_2px_rgb(0_0_0/0.16),0_2px_4px_rgb(0_0_0/0.08)] after:absolute after:left-[4.5px] after:top-1.5 after:h-[9px] after:w-px after:rounded-[1px] after:bg-kit-insp-handle-mark\";\n\nfunction trackDrag(e: React.PointerEvent<HTMLElement>, onMove: (clientX: number) => void, onEnd?: () => void) {\n e.preventDefault();\n e.currentTarget.focus();\n const body = e.currentTarget.ownerDocument.body;\n const prev = body.style.cursor;\n body.style.cursor = \"ew-resize\";\n const mv = (ev: PointerEvent) => onMove(ev.clientX);\n const up = () => {\n window.removeEventListener(\"pointermove\", mv);\n window.removeEventListener(\"pointerup\", up);\n window.removeEventListener(\"pointercancel\", up);\n body.style.cursor = prev;\n onEnd?.();\n };\n window.addEventListener(\"pointermove\", mv);\n window.addEventListener(\"pointerup\", up);\n window.addEventListener(\"pointercancel\", up);\n onMove(e.clientX);\n}\n\n/** Step slider (kit.jsx:168-187, kit.css:65-73): filler + handle on the current stop, dots on the others. Click a stop,\n * drag the handle, or use the arrow keys. `value` is the stop's index. */\nexport function StepSlider({\n label, stops, value, onChange, disabled, className, \"aria-labelledby\": labelledBy,\n}: { label?: string; stops: string[]; value: number; onChange: (index: number) => void; disabled?: boolean; className?: string; \"aria-labelledby\"?: string }) {\n const ref = React.useRef<HTMLDivElement | null>(null);\n const n = stops.length;\n const last = Math.max(1, n - 1);\n const i = Math.max(0, Math.min(n - 1, value));\n const cur = React.useRef(i);\n cur.current = i;\n const pick = (clientX: number) => {\n const r = ref.current!.getBoundingClientRect();\n const x = Math.min(Math.max(clientX - r.left - 8, 0), r.width - 16);\n return Math.round(x / ((r.width - 16) / last));\n };\n const pct = i / last;\n return (\n <div\n ref={ref}\n role=\"slider\"\n tabIndex={disabled ? -1 : 0}\n aria-label={labelledBy ? undefined : label}\n aria-labelledby={labelledBy}\n aria-valuemin={0}\n aria-valuemax={n - 1}\n aria-valuenow={i}\n aria-valuetext={stops[i]}\n aria-disabled={disabled || undefined}\n data-slot=\"kit-step-slider\"\n onPointerDown={(e) => {\n if (disabled) return;\n trackDrag(e, (x) => {\n const j = pick(x);\n if (j !== cur.current) {\n cur.current = j;\n onChange(j);\n }\n });\n }}\n onKeyDown={(e) => {\n if (disabled) return;\n if (e.key === \"ArrowRight\" || e.key === \"ArrowUp\") {\n e.preventDefault();\n onChange(Math.min(n - 1, i + 1));\n }\n if (e.key === \"ArrowLeft\" || e.key === \"ArrowDown\") {\n e.preventDefault();\n onChange(Math.max(0, i - 1));\n }\n }}\n className={cn(TRACK, \"group/step\", disabled ? \"cursor-default opacity-45\" : \"cursor-pointer\", FOCUS, className)}\n >\n <span aria-hidden className=\"absolute inset-y-0 left-0 rounded-[6px] bg-kit-insp-track-fill transition-[width] duration-[180ms] ease-[cubic-bezier(0.2,0.8,0.2,1)] motion-reduce:transition-none\" style={{ width: `calc(${pct} * (100% - 16px) + 13px)` }} />\n {stops.map((s, j) => (\n <span key={j} aria-hidden title={s} className={cn(\"absolute top-1/2 -ml-[1.5px] -mt-[1.5px] size-[3px] rounded-full bg-kit-insp-track-dot transition-opacity duration-100\", j === i && \"opacity-0\")} style={{ left: `calc(${j / last} * (100% - 16px) + 8px)` }} />\n ))}\n <span aria-hidden className={cn(HANDLE, \"transition-[left,transform] duration-[180ms] ease-[cubic-bezier(0.2,0.8,0.2,1)] motion-reduce:transition-none\", !disabled && \"group-active/step:scale-[1.08]\")} style={{ left: `calc(${pct} * (100% - 16px) + 8px)` }} />\n </div>\n );\n}\n\n/** Step slider in an Inline row: label + the current stop's name on the left (kit.jsx:211-213). */\nexport function StepRow({\n label, stops, names, value, onChange, disabled, info,\n}: { label: string; stops: string[]; names?: string[]; value: number; onChange: (index: number) => void; disabled?: boolean; info?: React.ReactNode }) {\n return (\n <InlineRow label={label} meta={(names ?? stops)[value]} info={info}>\n <StepSlider label={label} stops={stops} value={value} onChange={onChange} disabled={disabled} />\n </InlineRow>\n );\n}\n\n/**\n * Value slider (kit.jsx:191-209, kit.css:555-564): the step slider's track, filler and handle with the label left and\n * the number right inside the track. origin \"start\" fills from the left; \"center\" fills out from a zero mark. Drag,\n * click, arrow keys (Shift = ×10); double-click resets. `onStart` fires once before a gesture's first change (one undo step).\n */\nexport function ValueSlider({\n label, value, min = 0, max = 100, origin = \"start\", reset, format = String, onChange, onStart, disabled, className,\n}: {\n label: string; value: number; min?: number; max?: number; origin?: \"start\" | \"center\"; reset?: number; format?: (v: number) => string;\n onChange: (v: number) => void; onStart?: () => void; disabled?: boolean; className?: string;\n}) {\n const ref = React.useRef<HTMLDivElement | null>(null);\n const [drag, setDrag] = React.useState(false);\n const span = max - min || 1;\n const clamp = (v: number) => Math.max(min, Math.min(max, Math.round(v)));\n const pct = (value - min) / span;\n const at = (clientX: number) => {\n const r = ref.current!.getBoundingClientRect();\n return clamp(min + Math.min(Math.max((clientX - r.left - 6) / (r.width - 12), 0), 1) * span);\n };\n const z = origin === \"center\" ? 0.5 : 0;\n const a = Math.min(z, pct);\n const b = Math.max(z, pct);\n const move = drag ? \"\" : \"transition-[left,width,transform] duration-[120ms] motion-reduce:transition-none\";\n return (\n <div\n ref={ref}\n role=\"slider\"\n tabIndex={disabled ? -1 : 0}\n aria-label={label}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={value}\n aria-valuetext={format(value)}\n aria-disabled={disabled || undefined}\n data-slot=\"kit-value-slider\"\n onPointerDown={(e) => {\n if (disabled) return;\n onStart?.();\n setDrag(true);\n trackDrag(e, (x) => onChange(at(x)), () => setDrag(false));\n }}\n onKeyDown={(e) => {\n if (disabled) return;\n const d = ({ ArrowRight: 1, ArrowUp: 1, ArrowLeft: -1, ArrowDown: -1 } as Record<string, number>)[e.key];\n if (!d) return;\n e.preventDefault();\n onStart?.();\n onChange(clamp(value + d * (e.shiftKey ? 10 : 1)));\n }}\n onDoubleClick={() => {\n if (disabled) return;\n onStart?.();\n onChange(reset ?? (origin === \"center\" ? clamp((min + max) / 2) : min));\n }}\n className={cn(TRACK, \"flex items-center justify-between px-2.5\", disabled ? \"cursor-default opacity-45\" : \"cursor-ew-resize\", FOCUS, className)}\n >\n <span aria-hidden className={cn(\"absolute inset-y-0 bg-kit-insp-track-fill\", origin === \"start\" && \"rounded-l-[6px]\", move)} style={{ left: `calc(${a} * (100% - 12px) + ${a ? 6 : 0}px)`, width: `calc(${b - a} * (100% - 12px) + ${a ? 0 : 6}px)` }} />\n {origin === \"center\" ? <span aria-hidden className=\"absolute inset-y-0 left-1/2 w-px bg-kit-insp-line-strong\" /> : null}\n <span className=\"pointer-events-none relative z-[1] text-[12px] font-medium leading-4 text-kit-insp-tip-body\">{label}</span>\n <span className=\"pointer-events-none relative z-[1] text-[12px] font-medium leading-4 tabular-nums text-kit-insp-tip-title\">{format(value)}</span>\n <span aria-hidden className={cn(HANDLE, \"z-[2]\", move, drag && \"scale-[1.08]\")} style={{ left: `calc(${pct} * (100% - 12px) + 6px)` }} />\n </div>\n );\n}\n\n/* ── Toggles ────────────────────────────────────────────────────────── */\n\n/** The prototype switch (ui.jsx:132-141, editor.css:242-251): 34×20 (sm 28×16), inset-shadow track, grey knob with a\n * 1px grip line. `deco` draws it inside another control (a menu row): no button, hidden from assistive tech. */\nexport function InspectorSwitch({\n on, onChange, size = \"md\", label, disabled, deco, className, \"aria-labelledby\": labelledBy,\n}: { on: boolean; onChange?: (on: boolean) => void; size?: \"sm\" | \"md\"; label?: string; disabled?: boolean; deco?: boolean; className?: string; \"aria-labelledby\"?: string }) {\n const sm = size === \"sm\";\n const track = cn(\n \"relative block shrink-0 rounded-full p-0 shadow-[inset_0_1px_2px_rgb(0_0_0/0.25),inset_0_-1px_0.5px_rgb(255_255_255/0.2)] transition-colors duration-150\",\n sm ? \"h-4 w-7\" : \"h-5 w-[34px]\",\n on ? \"bg-kit-insp-switch-on\" : \"bg-kit-insp-switch-off\",\n className,\n );\n const knob = (\n <span\n className={cn(\n \"absolute left-0.5 top-0.5 grid place-items-center rounded-full bg-kit-insp-switch-knob shadow-[0_1px_2px_rgb(0_0_0/0.25)] transition-transform duration-150 ease-[cubic-bezier(0.3,0.7,0.2,1)] motion-reduce:transition-none\",\n sm ? \"size-3\" : \"size-4\",\n on && (sm ? \"translate-x-3\" : \"translate-x-3.5\"),\n )}\n >\n <i className={cn(\"block w-px rounded-[0.5px] bg-kit-insp-switch-knob-mark\", sm ? \"h-1.5\" : \"h-2\")} />\n </span>\n );\n if (deco) return <span aria-hidden data-slot=\"kit-insp-switch\" className={track}>{knob}</span>;\n return (\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={on}\n aria-label={labelledBy ? undefined : label}\n aria-labelledby={labelledBy}\n disabled={disabled}\n data-slot=\"kit-insp-switch\"\n onClick={(e) => {\n e.stopPropagation();\n onChange?.(!on);\n }}\n className={cn(track, \"cursor-pointer disabled:cursor-default disabled:opacity-40\", FOCUS, \"focus-visible:outline-offset-2\")}\n >\n {knob}\n </button>\n );\n}\n\n/** Toggle row (kit.jsx:241-243; styles.css:286-289, editor.css:445-447): label + supporting text left, switch right,\n * top-aligned. */\nexport function ToggleRow({\n label, desc, on, onChange, disabled, className,\n}: { label: string; desc?: React.ReactNode; on: boolean; onChange: (on: boolean) => void; disabled?: boolean; className?: string }) {\n const id = React.useId();\n return (\n <div data-slot=\"kit-toggle-row\" className={cn(\"flex items-start justify-between gap-4\", className)}>\n <div className=\"flex min-w-0 flex-1 flex-col gap-1 leading-[18px]\">\n <b id={id} className=\"text-[13px] font-medium tracking-[-0.1625px] text-kit-insp-ink\">{label}</b>\n {desc ? <small className=\"text-[12px] leading-[18px] tracking-[-0.12px] text-kit-insp-quiet\">{desc}</small> : null}\n </div>\n <InspectorSwitch on={on} onChange={onChange} disabled={disabled} aria-labelledby={id} />\n </div>\n );\n}\n\n/** Related toggles share ONE grey card (kit.jsx:245, kit.css:84-85): #F5F5F5, radius 8, 12 padding, rows 14 apart. */\nexport function ToggleCard({ className, children, ...rest }: React.HTMLAttributes<HTMLDivElement>) {\n return (\n <div data-slot=\"kit-toggle-card\" className={cn(\"flex flex-col gap-3.5 rounded-[8px] bg-kit-insp-card p-3\", className)} {...rest}>\n {children}\n </div>\n );\n}\n\n/* ── Item list card ─────────────────────────────────────────────────── */\n\n/** The grey item list card (styles.css:200-201; faq.css:86): radius 12, 12/8/8 padding, rows in a 0-gap list, then the\n * Add button and the note, 4 apart. Pass <ItemRow>s as children, `add` and `note` below them. */\nexport function ItemListCard({\n add, note, listRef, className, children, ...rest\n}: React.HTMLAttributes<HTMLDivElement> & { add?: React.ReactNode; note?: React.ReactNode; listRef?: React.Ref<HTMLDivElement> }) {\n return (\n <div data-slot=\"kit-item-card\" className={cn(\"flex min-w-0 flex-col gap-1 overflow-hidden rounded-[12px] bg-kit-insp-card px-2 pb-2 pt-3\", className)} {...rest}>\n <div ref={listRef} role=\"list\" data-slot=\"kit-item-list\" className=\"flex min-w-0 flex-col\">\n {children}\n </div>\n {add}\n {note}\n </div>\n );\n}\n\nexport const ITEM_ROW_CLASS = \"group/li flex h-[46px] w-full min-w-0 cursor-pointer items-center gap-1 rounded-[6px] py-1 pl-0.5 pr-1 text-left transition-colors hover:bg-kit-insp-row-hover\";\nexport const ITEM_ROW_GRIP_CLASS = \"grid size-7 shrink-0 cursor-grab touch-none place-items-center rounded-[6px] text-kit-insp-quiet active:cursor-grabbing\";\nexport const ITEM_ROW_MORE_CLASS = \"grid size-7 shrink-0 place-items-center rounded-[6px] text-kit-insp-label transition-colors hover:bg-kit-insp-row-press aria-expanded:bg-kit-insp-row-press data-[popup-open]:bg-kit-insp-row-press\";\nexport const ITEM_ROW_TITLE_CLASS = \"truncate text-[13px] font-medium leading-[18px] tracking-[-0.1625px] text-kit-insp-ink\";\nexport const ITEM_ROW_SUB_CLASS = \"truncate text-[11.5px] leading-[14px] text-kit-insp-sub\";\n\nexport interface ItemRowProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> {\n title: React.ReactNode;\n /** second line; `empty` is shown, quieter, when there is none */\n sub?: React.ReactNode;\n empty?: React.ReactNode;\n /** opens the item (the title area is the button) */\n onOpen?: () => void;\n /** aria-label of the open button */\n openLabel?: string;\n /** props for the drag grip (a host's sortable handle); omit to hide the grip */\n grip?: React.ButtonHTMLAttributes<HTMLButtonElement> | false;\n /** before the title: a thumbnail or a section icon */\n leading?: React.ReactNode;\n /** after the title: a tag or a quiet meta */\n tag?: React.ReactNode;\n meta?: React.ReactNode;\n /** the ⋯ control (a MenuTrigger using ITEM_ROW_MORE_CLASS), or props for a plain button */\n more?: React.ReactNode;\n /** 44 high (page outline rows) */\n compact?: boolean;\n dragging?: boolean;\n /** a row is being dragged over this one: the 2px violet line on its top edge */\n over?: boolean;\n error?: boolean;\n selected?: boolean;\n}\n\n/** One row of the item list card (styles.css:202-214, 258-261): 46 high, grip 28, title 13/18 medium over an 11.5/14\n * sub-line, ⋯ 28. Hover greys the row; `over` draws the drop line; `dragging` fades it. */\nexport function ItemRow({\n title, sub, empty, onOpen, openLabel, grip, leading, tag, meta, more, compact, dragging, over, error, selected, className, ...rest\n}: ItemRowProps) {\n const text = (\n <span className={cn(\"flex min-w-0 flex-col px-1.5 py-1\", compact ? \"flex-initial\" : \"flex-1\")}>\n <b className={cn(ITEM_ROW_TITLE_CLASS, error && \"text-kit-insp-delete-fg\")}>{title}</b>\n {sub || empty ? <small className={cn(ITEM_ROW_SUB_CLASS, !sub && \"text-kit-insp-faint\")}>{sub || empty}</small> : null}\n </span>\n );\n return (\n <div\n role=\"listitem\"\n data-slot=\"kit-item-row\"\n data-selected={selected || undefined}\n className={cn(ITEM_ROW_CLASS, compact && \"h-11\", dragging && \"opacity-40\", over && \"shadow-[inset_0_2px_0_var(--kit-insp-accent)]\", selected && \"bg-kit-insp-token-chip\", className)}\n {...rest}\n >\n {grip === false || grip === undefined ? null : (\n <button type=\"button\" aria-label=\"Drag to reorder\" title=\"Drag to reorder\" {...grip} className={cn(ITEM_ROW_GRIP_CLASS, FOCUS, grip.className)}>\n <IconGripVertical aria-hidden className=\"size-4\" stroke={1.6} />\n </button>\n )}\n {onOpen ? (\n <button type=\"button\" onClick={onOpen} aria-label={openLabel} className={cn(\"flex h-[38px] min-w-0 flex-1 items-center gap-2 rounded-[6px] text-left\", FOCUS)}>\n {leading}\n {text}\n </button>\n ) : (\n <span className=\"flex h-[38px] min-w-0 flex-1 items-center gap-2\">\n {leading}\n {text}\n </span>\n )}\n {tag ? <span className=\"flex min-h-5 shrink-0 items-center whitespace-nowrap rounded-[4px] bg-kit-insp-chip px-1.5 text-[10.5px] font-medium leading-4 text-kit-insp-note\">{tag}</span> : null}\n {meta ? <span className=\"shrink-0 whitespace-nowrap pr-1.5 text-[11.5px] text-kit-insp-sub\">{meta}</span> : null}\n {more}\n </div>\n );\n}\n\n/** A plain ⋯ button for an ItemRow whose menu the host opens itself. */\nexport function ItemRowMore({ label, className, ...rest }: React.ButtonHTMLAttributes<HTMLButtonElement> & { label: string }) {\n return (\n <button type=\"button\" aria-label={label} aria-haspopup=\"menu\" {...rest} className={cn(ITEM_ROW_MORE_CLASS, FOCUS, className)}>\n <IconDots aria-hidden className=\"size-4\" stroke={1.6} />\n </button>\n );\n}\n\nexport const ITEM_LIST_ADD_CLASS =\n \"h-10 w-full shrink-0 rounded-[6px] bg-kit-insp-btn text-[13px] font-medium leading-[18px] tracking-[-0.1625px] text-kit-insp-ink transition-[background-color,transform] duration-150 hover:bg-kit-insp-btn-hover active:scale-[0.98] disabled:cursor-not-allowed disabled:bg-kit-insp-btn-off disabled:text-kit-insp-faint disabled:active:scale-100 aria-disabled:cursor-not-allowed aria-disabled:bg-kit-insp-btn-off aria-disabled:text-kit-insp-faint data-[popup-open]:bg-kit-insp-btn-on motion-reduce:transition-none motion-reduce:active:scale-100\";\n\n/** The Add button inside the card (styles.css:215-217, faq.css:96-97, page.css:11): full width, 40 high. */\nexport function ItemListAdd({ className, children, ...rest }: React.ButtonHTMLAttributes<HTMLButtonElement>) {\n return (\n <button type=\"button\" data-slot=\"kit-item-add\" {...rest} className={cn(ITEM_LIST_ADD_CLASS, FOCUS, className)}>\n {children}\n </button>\n );\n}\n\n/** The card's note line, in the prototype's words (inspector.jsx:254): \"3 of 6 questions. Drag to reorder.\" ·\n * \"6 of 6 questions. Remove one to add another.\" · \"3 questions. Drag to reorder.\" */\nexport function itemListNote(count: number, noun: string, max?: number | null, opts?: { sortable?: boolean }): string {\n const tail = opts?.sortable === false ? \"\" : \" Drag to reorder.\";\n if (max != null) return `${count} of ${max} ${noun}s.${count >= max ? \" Remove one to add another.\" : tail}`;\n return `${count} ${noun}${count === 1 ? \"\" : \"s\"}.${tail}`;\n}\n\n/** The note under the Add button (styles.css:218): 12/18, 4 padding. */\nexport function ItemListNote({ className, children, ...rest }: React.HTMLAttributes<HTMLParagraphElement>) {\n return (\n <p data-slot=\"kit-item-note\" className={cn(\"m-0 p-1 text-[12px] leading-[18px] tracking-[-0.15px] text-kit-insp-note\", className)} {...rest}>\n {children}\n </p>\n );\n}\n\n/* ── Item delete ────────────────────────────────────────────────────── */\n\nexport const ITEM_DELETE_CLASS =\n \"inline-flex h-8 items-center gap-1.5 self-start rounded-[6px] bg-kit-insp-delete-bg px-3 text-[13px] font-medium text-kit-insp-delete-fg transition-[background-color,transform] duration-150 hover:bg-kit-insp-delete-bg-hover active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-kit-insp-delete-bg disabled:active:scale-100 motion-reduce:transition-none motion-reduce:active:scale-100\";\n\n/**\n * The red \"Delete <noun>\" that ends an item screen (inspector.jsx:663, faq.css:48-49, kit.css:183). When it cannot run\n * (the list is at its minimum) pass `reason`: the button is disabled and the reason is its title and description.\n */\nexport function ItemDeleteButton({\n noun, reason, icon, className, children, ...rest\n}: React.ButtonHTMLAttributes<HTMLButtonElement> & { noun?: string; reason?: string; icon?: React.ReactNode }) {\n const id = React.useId();\n return (\n <>\n <button type=\"button\" data-slot=\"kit-item-delete\" disabled={!!reason || rest.disabled} title={reason} aria-describedby={reason ? id : undefined} {...rest} className={cn(ITEM_DELETE_CLASS, FOCUS, className)}>\n {icon}\n {children ?? `Delete ${noun ?? \"item\"}`}\n </button>\n {reason ? <span id={id} className=\"sr-only\">{reason}</span> : null}\n </>\n );\n}\n\n/** The quiet ⓘ after a label, 16 box with a 14 glyph (kit.css:445-446), for hosts that draw their own label row. */\nexport function InfoGlyph({ className }: { className?: string }) {\n return <IconInfoCircle aria-hidden className={cn(\"size-3.5\", className)} stroke={1.6} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,IAAa,iBAAiB;CAAC;CAAM;CAAG;CAAM;AAAC;AAC/C,IAAM,OAAO;CAAE,MAAM;CAAU,WAAW;CAAK,SAAS;CAAI,MAAM;AAAI;AACtE,IAAM,QAAQ;;AAKd,SAAgB,cAAc,EAAE,KAAK,WAAW,UAAU,GAAG,QAAkE;CAC7H,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,yCACA,MAAM,SAAS,QACf,yLACA,SACF;EACA,GAAI;EAEH;CACE,CAAA;AAET;;;AAIA,SAAgB,eAAe,EAC7B,QAAQ,OAAO,WAAW,UAAU,GAAG,QACqC;CAC5E,OACE,oBAAC,WAAD;EACE,aAAU;EACV,eAAa,UAAU,KAAA;EACvB,WAAW,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SAAS;EAAG,QAAQ;CAAM,CAAA;AACzF"}
@@ -10,7 +10,10 @@ type Cls<P> = Omit<P, "className"> & {
10
10
  };
11
11
  export declare const FLOATING_LAYER = "[data-floating-layer]";
12
12
  export declare const TooltipProvider: React.FC<import("@base-ui/react").TooltipProviderProps>;
13
- export declare function Tooltip({ content, children, side, shortcut, delay, disabled, }: {
13
+ export declare function Tooltip({ content, children, side, shortcut, delay, disabled, variant, }: {
14
+ /** "ink" (default): the kit's dark tooltip. "card": the Visual Editor's white card (prototype editor-v16 ui.jsx:160):
15
+ * white, 1px edge, radius 8, caret, opens after 400ms, the shortcut always shown after a middle dot. */
16
+ variant?: "ink" | "card";
14
17
  content: React.ReactNode;
15
18
  /** the trigger: one element that forwards its ref and spreads props */
16
19
  children: React.ReactElement;
@@ -25,13 +28,15 @@ export declare const PopoverTrigger: PopoverPrimitive.Trigger;
25
28
  export declare const PopoverClose: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").PopoverCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
26
29
  /** Positions the popover against this element instead of the trigger; presses on it count as inside. */
27
30
  export declare function PopoverAnchor({ render, ...props }: useRender.ComponentProps<"div">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
28
- export declare function PopoverContent({ className, align, side, sideOffset, keepFocus, onMouseDown, collisionBoundary, collisionPadding, collisionAvoidance, arrowPadding, ...props }: Cls<PopoverPrimitive.Popup.Props> & {
31
+ export declare function PopoverContent({ className, align, side, sideOffset, alignOffset, keepFocus, onMouseDown, collisionBoundary, collisionPadding, collisionAvoidance, arrowPadding, ...props }: Cls<PopoverPrimitive.Popup.Props> & {
29
32
  /** Base UI keeps a (here, missing) arrow this far from the popup's corner, sliding the popup off a tiny anchor at its
30
33
  * edge; 0 puts the popup's edge on the anchor, as V2's Radix popover (no arrow) does */
31
34
  arrowPadding?: number;
32
35
  align?: "start" | "center" | "end";
33
36
  side?: "top" | "bottom" | "left" | "right";
34
37
  sideOffset?: number;
38
+ /** shift along the aligned edge (e.g. -4 to hang 4 outside the anchor's start) */
39
+ alignOffset?: number;
35
40
  /** keep the popup inside this area (e.g. the scrolling panel under a sticky header) instead of the viewport */
36
41
  collisionBoundary?: PopoverPrimitive.Positioner.Props["collisionBoundary"];
37
42
  collisionPadding?: PopoverPrimitive.Positioner.Props["collisionPadding"];
@@ -1,8 +1,10 @@
1
1
  import { cn } from "../lib/cn.js";
2
+ import { useKitLook } from "../context.js";
2
3
  import { KIT_SCOPE } from "./surfaces.js";
3
4
  import { MODAL_LAYER, TooltipLayer, TooltipRoot } from "./tooltip-root.js";
4
5
  import { IconButton, TooltipScope } from "./button.js";
5
6
  import { platformKeys, useShortcutHints } from "./shortcut-hint.js";
7
+ import { CardTooltip } from "./tooltip-card.js";
6
8
  import * as React from "react";
7
9
  import { jsx, jsxs } from "react/jsx-runtime";
8
10
  import { IconCheck, IconChevronRight, IconX } from "@tabler/icons-react";
@@ -30,16 +32,26 @@ function guard(onOpenChange, anchor) {
30
32
  };
31
33
  }
32
34
  var TooltipProvider = Tooltip$1.Provider;
33
- function Tooltip({ content, children, side = "top", shortcut, delay = 350, disabled }) {
35
+ function Tooltip({ content, children, side = "top", shortcut, delay, disabled, variant = "ink" }) {
34
36
  const hints = useShortcutHints();
35
37
  if (disabled || !content) return /* @__PURE__ */ jsx(TooltipScope.Provider, {
36
38
  value: true,
37
39
  children
38
40
  });
41
+ if (variant === "card") return /* @__PURE__ */ jsx(TooltipScope.Provider, {
42
+ value: true,
43
+ children: /* @__PURE__ */ jsx(CardTooltip, {
44
+ content,
45
+ side,
46
+ shortcut,
47
+ delay: delay ?? 400,
48
+ children
49
+ })
50
+ });
39
51
  return /* @__PURE__ */ jsx(TooltipScope.Provider, {
40
52
  value: true,
41
53
  children: /* @__PURE__ */ jsxs(TooltipRoot, { children: [/* @__PURE__ */ jsx(Tooltip$1.Trigger, {
42
- delay,
54
+ delay: delay ?? 350,
43
55
  render: children
44
56
  }), /* @__PURE__ */ jsxs(TooltipLayer, {
45
57
  side,
@@ -76,12 +88,13 @@ function PopoverAnchor({ render, ...props }) {
76
88
  props
77
89
  });
78
90
  }
79
- function PopoverContent({ className, align = "start", side, sideOffset = 6, keepFocus, onMouseDown, collisionBoundary, collisionPadding = 12, collisionAvoidance, arrowPadding, ...props }) {
91
+ function PopoverContent({ className, align = "start", side, sideOffset = 6, alignOffset, keepFocus, onMouseDown, collisionBoundary, collisionPadding = 12, collisionAvoidance, arrowPadding, ...props }) {
80
92
  const anchor = React.useContext(AnchorContext);
81
93
  return /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(Popover$1.Positioner, {
82
94
  align,
83
95
  side,
84
96
  sideOffset,
97
+ alignOffset,
85
98
  collisionBoundary,
86
99
  collisionPadding,
87
100
  collisionAvoidance,
@@ -128,6 +141,7 @@ var MenuGroup = Menu$1.Group;
128
141
  var MenuSub = Menu$1.SubmenuRoot;
129
142
  var MenuRadioGroup = Menu$1.RadioGroup;
130
143
  function MenuContent({ className, align = "start", side, sideOffset = 6, positionerClassName, ...props }) {
144
+ const v16 = useKitLook() === "v16";
131
145
  return /* @__PURE__ */ jsx(Menu$1.Portal, { children: /* @__PURE__ */ jsx(Menu$1.Positioner, {
132
146
  align,
133
147
  side,
@@ -137,15 +151,18 @@ function MenuContent({ className, align = "start", side, sideOffset = 6, positio
137
151
  ...KIT_SCOPE,
138
152
  children: /* @__PURE__ */ jsx(Menu$1.Popup, {
139
153
  ...layer,
140
- className: cn("glass max-h-[var(--available-height)] min-w-48 overflow-y-auto overflow-x-hidden rounded-kit-lg border p-1 text-kit-fg outline-none data-[open]:animate-kit-pop-in", className),
154
+ className: cn("glass max-h-[var(--available-height)] min-w-48 overflow-y-auto overflow-x-hidden rounded-kit-lg border p-1 text-kit-fg outline-none data-[open]:animate-kit-pop-in", v16 && "max-h-[min(420px,70vh,var(--available-height))] rounded-[10px]", className),
141
155
  ...props
142
156
  })
143
157
  }) });
144
158
  }
145
159
  var itemCls = "relative flex h-8 cursor-pointer select-none items-center gap-2 rounded-kit-md px-2 text-kit-sm text-kit-fg outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-40 data-[highlighted]:bg-kit-hover [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-kit-fg-2";
160
+ var V16_ITEM = "rounded-[5px] text-[13px] leading-4 tracking-[-0.13px] data-[highlighted]:bg-kit-insp-card [&>svg]:size-3.5 [&>svg]:text-kit-insp-tip-body";
161
+ var V16_SHORTCUT = "ml-4 text-[12px] leading-4 tracking-[0.02em] text-kit-insp-faint";
146
162
  function MenuItem({ className, icon, shortcut, danger, children, ...props }) {
163
+ const v16 = useKitLook() === "v16";
147
164
  return /* @__PURE__ */ jsxs(Menu$1.Item, {
148
- className: cn(itemCls, danger && "text-kit-danger-fg data-[highlighted]:bg-kit-danger-soft [&>svg]:text-kit-danger-fg", className),
165
+ className: cn(itemCls, v16 && V16_ITEM, danger && "text-kit-danger-fg data-[highlighted]:bg-kit-danger-soft [&>svg]:text-kit-danger-fg", className),
149
166
  ...props,
150
167
  children: [
151
168
  icon,
@@ -154,7 +171,7 @@ function MenuItem({ className, icon, shortcut, danger, children, ...props }) {
154
171
  children
155
172
  }),
156
173
  shortcut ? /* @__PURE__ */ jsx("span", {
157
- className: "text-kit-xs text-kit-fg-3",
174
+ className: cn("text-kit-xs text-kit-fg-3", v16 && V16_SHORTCUT),
158
175
  children: platformKeys(shortcut)
159
176
  }) : null
160
177
  ]
@@ -162,30 +179,33 @@ function MenuItem({ className, icon, shortcut, danger, children, ...props }) {
162
179
  }
163
180
  /** Checking an item closes the menu, like V2's Radix items (pass closeOnClick={false} to keep it open). */
164
181
  function MenuCheckItem({ className, children, closeOnClick = true, ...props }) {
182
+ const v16 = useKitLook() === "v16";
165
183
  return /* @__PURE__ */ jsxs(Menu$1.CheckboxItem, {
166
- className: cn(itemCls, "pr-8", className),
184
+ className: cn(itemCls, "pr-8", v16 && V16_ITEM, className),
167
185
  closeOnClick,
168
186
  ...props,
169
187
  children: [children, /* @__PURE__ */ jsx(Menu$1.CheckboxItemIndicator, {
170
188
  className: "absolute right-2",
171
- children: /* @__PURE__ */ jsx(IconCheck, { className: "size-4" })
189
+ children: /* @__PURE__ */ jsx(IconCheck, { className: v16 ? "size-3.5" : "size-4" })
172
190
  })]
173
191
  });
174
192
  }
175
193
  function MenuRadioItem({ className, children, closeOnClick = true, ...props }) {
194
+ const v16 = useKitLook() === "v16";
176
195
  return /* @__PURE__ */ jsxs(Menu$1.RadioItem, {
177
- className: cn(itemCls, "pr-8", className),
196
+ className: cn(itemCls, "pr-8", v16 && V16_ITEM, className),
178
197
  closeOnClick,
179
198
  ...props,
180
199
  children: [children, /* @__PURE__ */ jsx(Menu$1.RadioItemIndicator, {
181
200
  className: "absolute right-2",
182
- children: /* @__PURE__ */ jsx(IconCheck, { className: "size-4" })
201
+ children: /* @__PURE__ */ jsx(IconCheck, { className: v16 ? "size-3.5" : "size-4" })
183
202
  })]
184
203
  });
185
204
  }
186
205
  function MenuSubTrigger({ className, icon, children, ...props }) {
206
+ const v16 = useKitLook() === "v16";
187
207
  return /* @__PURE__ */ jsxs(Menu$1.SubmenuTrigger, {
188
- className: cn(itemCls, "data-[popup-open]:bg-kit-hover [&>svg:last-child]:size-3.5 [&>svg:last-child]:text-kit-fg-3", className),
208
+ className: cn(itemCls, "data-[popup-open]:bg-kit-hover [&>svg:last-child]:size-3.5 [&>svg:last-child]:text-kit-fg-3", v16 && cn(V16_ITEM, "data-[popup-open]:bg-kit-insp-card [&>svg:last-child]:text-kit-insp-faint"), className),
189
209
  ...props,
190
210
  children: [
191
211
  icon,
@@ -216,7 +236,8 @@ function MenuLabel({ className, ...props }) {
216
236
  });
217
237
  }
218
238
  function MenuSeparator({ className }) {
219
- return /* @__PURE__ */ jsx(Separator, { className: cn("-mx-1 my-1 h-px bg-kit-line", className) });
239
+ const v16 = useKitLook() === "v16";
240
+ return /* @__PURE__ */ jsx(Separator, { className: cn("-mx-1 my-1 h-px bg-kit-line", v16 && "mx-0 my-0.5 bg-kit-insp-divider", className) });
220
241
  }
221
242
  var recent = [];
222
243
  if (typeof document !== "undefined") document.addEventListener("focusin", (e) => {
@@ -263,22 +284,33 @@ var sizes = {
263
284
  xl: "max-w-[800px]",
264
285
  full: "max-w-[min(1280px,calc(100vw-48px))] h-[min(860px,calc(100vh-48px))]"
265
286
  };
287
+ var V16_SCRIM = "bg-kit-insp-scrim backdrop-blur-none data-[open]:animate-[kit-insp-scrim-in_180ms_ease-out] data-[ending-style]:pointer-events-none data-[ending-style]:animate-[kit-insp-scrim-out_170ms_ease-in_forwards]";
288
+ var V16_DIALOG = "rounded-[14px] border border-kit-insp-line bg-kit-insp-tip-bg text-kit-insp-tip-title shadow-[0_2px_6px_rgba(0,0,0,0.05),0_24px_48px_-12px_rgba(0,0,0,0.16)] data-[open]:animate-[kit-insp-modal-in_240ms_cubic-bezier(.2,.8,.2,1)] data-[ending-style]:pointer-events-none data-[ending-style]:animate-[kit-insp-modal-out_170ms_ease-in_forwards]";
289
+ var V16_CONFIRM = "w-[380px] max-w-[calc(100vw-32px)] gap-2.5 rounded-[12px] border-0 px-[18px] pb-3.5 pt-[18px] shadow-[0_1px_2px_rgba(0,0,0,0.06),0_24px_64px_rgba(0,0,0,0.18)]";
290
+ var V16_CONFIRM_FOOTER = cn("mt-1.5 gap-2 border-0 bg-transparent p-0", "[&>button]:rounded-[7px] [&>button]:border-0 [&>button]:px-3.5 [&>button]:text-[13px] [&>button]:font-medium [&>button]:tracking-normal [&>button]:shadow-none", "[&>button:not([data-variant=primary]):not([data-variant=danger])]:h-[34px] [&>button:not([data-variant=primary]):not([data-variant=danger])]:bg-kit-insp-cancel [&>button:not([data-variant=primary]):not([data-variant=danger])]:text-kit-insp-tip-title [&>button:not([data-variant=primary]):not([data-variant=danger]):hover]:bg-kit-insp-cancel-hover", "[&>button[data-variant=primary]]:h-8 [&>button[data-variant=primary]]:bg-kit-insp-tip-title [&>button[data-variant=primary]]:text-kit-insp-tip-bg [&>button[data-variant=primary]:hover]:bg-kit-insp-ink", "[&>button[data-variant=danger]]:h-8 [&>button[data-variant=danger]]:bg-kit-insp-delete-fg [&>button[data-variant=danger]]:text-white");
291
+ /** Inside a v16 confirm (role="alertdialog"): header, body and footer drop their own padding for the dialog's. */
292
+ var ConfirmCtx = React.createContext(false);
266
293
  function ModalContent({ className, size = "md", children, hideClose, finalFocus, ref, ...props }) {
267
294
  const focusReturn = useFocusReturn(finalFocus);
268
295
  const merged = useMergedRef(ref, focusReturn.ref);
296
+ const v16 = useKitLook() === "v16";
297
+ const confirm = v16 && props.role === "alertdialog";
269
298
  return /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, {
270
299
  ...KIT_SCOPE,
271
- className: "fixed inset-0 z-[var(--kit-z-modal,60)] bg-kit-overlay backdrop-blur-[2px] data-[open]:animate-kit-fade-in"
300
+ className: cn("fixed inset-0 z-[var(--kit-z-modal,60)] bg-kit-overlay backdrop-blur-[2px] data-[open]:animate-kit-fade-in", v16 && V16_SCRIM)
272
301
  }), /* @__PURE__ */ jsx("div", {
273
302
  ...KIT_SCOPE,
274
303
  className: "pointer-events-none fixed inset-0 z-[calc(var(--kit-z-modal,60)_+_1)] flex items-center justify-center p-4 sm:p-6",
275
304
  children: /* @__PURE__ */ jsxs(Dialog.Popup, {
276
305
  ...layer,
277
- className: cn("pointer-events-auto relative flex max-h-[calc(100vh-32px)] w-full flex-col overflow-hidden rounded-kit-xl border border-kit-floating-line bg-kit-surface-raised text-kit-fg shadow-kit-xl outline-none data-[open]:animate-kit-pop-in", sizes[size], className),
306
+ className: cn("pointer-events-auto relative flex max-h-[calc(100vh-32px)] w-full flex-col overflow-hidden rounded-kit-xl border border-kit-floating-line bg-kit-surface-raised text-kit-fg shadow-kit-xl outline-none data-[open]:animate-kit-pop-in", sizes[size], v16 && V16_DIALOG, confirm && V16_CONFIRM, className),
278
307
  ...props,
279
308
  ref: merged,
280
309
  finalFocus: focusReturn.finalFocus,
281
- children: [children, hideClose ? null : /* @__PURE__ */ jsx(Dialog.Close, {
310
+ children: [/* @__PURE__ */ jsx(ConfirmCtx.Provider, {
311
+ value: confirm,
312
+ children
313
+ }), hideClose || confirm ? null : /* @__PURE__ */ jsx(Dialog.Close, {
282
314
  render: /* @__PURE__ */ jsx(IconButton, {
283
315
  label: "Close",
284
316
  size: "sm",
@@ -290,17 +322,18 @@ function ModalContent({ className, size = "md", children, hideClose, finalFocus,
290
322
  })] });
291
323
  }
292
324
  function ModalHeader({ title, description, className, children }) {
325
+ const confirm = React.useContext(ConfirmCtx);
293
326
  return /* @__PURE__ */ jsx("div", {
294
- className: cn("flex shrink-0 items-start gap-2.5 px-5 pb-1 pt-5 pr-12", className),
327
+ className: cn("flex shrink-0 items-start gap-2.5 px-5 pb-1 pt-5 pr-12", confirm && "p-0", className),
295
328
  children: /* @__PURE__ */ jsxs("div", {
296
329
  className: "min-w-0 flex-1",
297
330
  children: [
298
331
  /* @__PURE__ */ jsx(Dialog.Title, {
299
- className: "text-kit-md font-semibold tracking-[-0.01em] text-kit-fg",
332
+ className: cn("text-kit-md font-semibold tracking-[-0.01em] text-kit-fg", confirm && "text-[15px] tracking-normal text-kit-insp-tip-title"),
300
333
  children: title
301
334
  }),
302
335
  description ? /* @__PURE__ */ jsx(Dialog.Description, {
303
- className: "mt-1 text-kit-sm text-kit-fg-2",
336
+ className: cn("mt-1 text-kit-sm text-kit-fg-2", confirm && "mt-2.5 text-[13px] leading-[19px] text-kit-insp-label"),
304
337
  children: description
305
338
  }) : /* @__PURE__ */ jsx(Dialog.Description, {
306
339
  className: "sr-only",
@@ -312,14 +345,16 @@ function ModalHeader({ title, description, className, children }) {
312
345
  });
313
346
  }
314
347
  function ModalBody({ className, ...props }) {
348
+ const confirm = React.useContext(ConfirmCtx);
315
349
  return /* @__PURE__ */ jsx("div", {
316
- className: cn("min-h-0 flex-1 overflow-y-auto px-5 pb-5 pt-4", className),
350
+ className: cn("min-h-0 flex-1 overflow-y-auto px-5 pb-5 pt-4", confirm && "p-0 text-[13px] leading-[19px] text-kit-insp-label", className),
317
351
  ...props
318
352
  });
319
353
  }
320
354
  function ModalFooter({ className, ...props }) {
355
+ const confirm = React.useContext(ConfirmCtx);
321
356
  return /* @__PURE__ */ jsx("div", {
322
- className: cn("flex shrink-0 items-center justify-end gap-2 border-t border-kit-tray-line bg-tray px-5 py-3", className),
357
+ className: cn("flex shrink-0 items-center justify-end gap-2 border-t border-kit-tray-line bg-tray px-5 py-3", confirm && V16_CONFIRM_FOOTER, className),
323
358
  ...props
324
359
  });
325
360
  }