@bettercms-ai/kit 4.0.0 → 4.2.0-next.0

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 (140) 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 +91 -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 +406 -24
  37. package/dist/controls/rich-text/blocks.js.map +1 -1
  38. package/dist/controls/rich-text/catalog.d.ts +45 -7
  39. package/dist/controls/rich-text/catalog.js +507 -37
  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 +4 -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 +77 -7
  49. package/dist/controls/rich-text/dom.js.map +1 -1
  50. package/dist/controls/rich-text/editor.js +243 -55
  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/rewriteSelection.d.ts +25 -0
  55. package/dist/controls/rich-text/rewriteSelection.js +28 -0
  56. package/dist/controls/rich-text/rewriteSelection.js.map +1 -0
  57. package/dist/controls/rich-text/slash-preview.d.ts +8 -0
  58. package/dist/controls/rich-text/slash-preview.js +300 -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 +1057 -0
  62. package/dist/controls/rich-text/table-grid.js.map +1 -0
  63. package/dist/controls/rich-text/toolbar.js +61 -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/field-shell.d.ts +12 -0
  75. package/dist/engine/field-shell.js +222 -64
  76. package/dist/engine/field-shell.js.map +1 -1
  77. package/dist/engine/frame.js +42 -4
  78. package/dist/engine/frame.js.map +1 -1
  79. package/dist/engine/grouping.d.ts +71 -10
  80. package/dist/engine/grouping.js +227 -29
  81. package/dist/engine/grouping.js.map +1 -1
  82. package/dist/engine/item-list.js +2 -2
  83. package/dist/engine/item-list.js.map +1 -1
  84. package/dist/engine/kit-field.js +38 -4
  85. package/dist/engine/kit-field.js.map +1 -1
  86. package/dist/engine/schema-form.d.ts +2 -0
  87. package/dist/engine/schema-form.js +9 -2
  88. package/dist/engine/schema-form.js.map +1 -1
  89. package/dist/index.d.ts +1 -1
  90. package/dist/index.js +13 -6
  91. package/dist/index.js.map +1 -1
  92. package/dist/kit.css +59 -0
  93. package/dist/lib/reduced-motion.d.ts +1 -0
  94. package/dist/lib/reduced-motion.js +19 -0
  95. package/dist/lib/reduced-motion.js.map +1 -0
  96. package/dist/schema/table.d.ts +2 -1
  97. package/dist/schema/table.js +5 -0
  98. package/dist/schema/table.js.map +1 -1
  99. package/dist/schema/types.d.ts +6 -0
  100. package/dist/schema/types.js.map +1 -1
  101. package/dist/styles.css +1 -1
  102. package/dist/theme.css +215 -0
  103. package/dist/tokens.css +274 -0
  104. package/dist/ui/block-icon-picker.d.ts +38 -0
  105. package/dist/ui/block-icon-picker.js +141 -0
  106. package/dist/ui/block-icon-picker.js.map +1 -0
  107. package/dist/ui/button.js +1 -0
  108. package/dist/ui/button.js.map +1 -1
  109. package/dist/ui/code-language-menu.d.ts +24 -0
  110. package/dist/ui/code-language-menu.js +123 -0
  111. package/dist/ui/code-language-menu.js.map +1 -0
  112. package/dist/ui/content-fields.d.ts +47 -0
  113. package/dist/ui/content-fields.js +279 -0
  114. package/dist/ui/content-fields.js.map +1 -0
  115. package/dist/ui/controls.js +3 -2
  116. package/dist/ui/controls.js.map +1 -1
  117. package/dist/ui/floating-panel.js +3 -2
  118. package/dist/ui/floating-panel.js.map +1 -1
  119. package/dist/ui/foundations.d.ts +118 -0
  120. package/dist/ui/foundations.js +565 -0
  121. package/dist/ui/foundations.js.map +1 -0
  122. package/dist/ui/index.d.ts +6 -0
  123. package/dist/ui/index.js +7 -1
  124. package/dist/ui/inspector.d.ts +412 -0
  125. package/dist/ui/inspector.js +1218 -0
  126. package/dist/ui/inspector.js.map +1 -0
  127. package/dist/ui/overlay.d.ts +7 -2
  128. package/dist/ui/overlay.js +55 -20
  129. package/dist/ui/overlay.js.map +1 -1
  130. package/dist/ui/shortcut-hint.js +1 -1
  131. package/dist/ui/shortcut-hint.js.map +1 -1
  132. package/dist/ui/tab.js +3 -2
  133. package/dist/ui/tab.js.map +1 -1
  134. package/dist/ui/toast.d.ts +5 -3
  135. package/dist/ui/toast.js +83 -11
  136. package/dist/ui/toast.js.map +1 -1
  137. package/dist/ui/tooltip-card.d.ts +45 -0
  138. package/dist/ui/tooltip-card.js +135 -0
  139. package/dist/ui/tooltip-card.js.map +1 -0
  140. package/package.json +1 -1
@@ -0,0 +1,1218 @@
1
+ import { cn } from "../lib/cn.js";
2
+ import { useKitReducedMotion } from "../lib/reduced-motion.js";
3
+ import { InfoTooltip } from "./tooltip-card.js";
4
+ import { Menu, MenuContent, MenuItem, MenuLabel, MenuSeparator, MenuTrigger } from "./overlay.js";
5
+ import * as React from "react";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ import { IconCheck, IconChevronDown, IconDots, IconGripVertical, IconInfoCircle, IconLock } from "@tabler/icons-react";
8
+ import { AnimatePresence, motion } from "framer-motion";
9
+ //#region src/ui/inspector.tsx
10
+ /**
11
+ * Inspector foundation · V1.6: the Visual Editor inspector's own building blocks, as prototype editor-v16 draws them
12
+ * (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).
13
+ *
14
+ * <InspectorBody> groups stacked 32 apart, 24/16/32 padding, a 1px divider 20 under every group but the last
15
+ * <InspectorGroup> one group: header, then its fields 16 below
16
+ * <GroupHeader> Content tab group: 14/20 medium title + 13/18 supporting line
17
+ * <SectionHeader> Design / Settings group: 16 icon + 14/20 medium, trailing Reset · Locked · collapse chevron
18
+ * <InspectorFields> stacked fields 20 apart (`rows`: inline rows 12 apart)
19
+ * <InlineRow> label left, control right in a fixed 194 column
20
+ * <InspectorSeg> segmented control with the sliding pill
21
+ * <SelectCompact> / <SelectField> / <ColourSelect> grey field selects (32 compact, 34 full width)
22
+ * <StepSlider> / <StepRow> / <ValueSlider> the stop slider and the value-inside slider
23
+ * <ToggleRow> / <ToggleCard> / <InspectorSwitch> label-left switch rows, related ones in one grey card
24
+ * <ItemListCard> + <ItemRow> + <ItemListAdd> + <ItemListNote> the grey item list card
25
+ * <ItemDeleteButton> the red "Delete <noun>" that ends an item screen
26
+ * <InspectorField> + <FieldCounter> label row with the focus dot, the sweep, and the n / max counter
27
+ *
28
+ * Editor-scoped: these read the --kit-insp-* roles (tokens.css) and nothing else in the kit draws them unless a host
29
+ * asks (`KitLookProvider look="v16"` for the engine). Every other kit consumer keeps the V2 look.
30
+ */
31
+ /** The prototype's accordion curve (kit.jsx:60 ACC) and its sliding-pill spring (kit.jsx:59 PILL). */
32
+ var INSPECTOR_EASE = [
33
+ .22,
34
+ 1,
35
+ .36,
36
+ 1
37
+ ];
38
+ var PILL = {
39
+ type: "spring",
40
+ stiffness: 520,
41
+ damping: 40,
42
+ mass: .8
43
+ };
44
+ var FOCUS = "outline-none focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-kit-insp-accent";
45
+ /** Panel body (kit.css:6-8). `sub` = a drill-in screen (16 on top instead of 24). */
46
+ function InspectorBody({ sub, className, children, ...rest }) {
47
+ return /* @__PURE__ */ jsx("div", {
48
+ "data-slot": "kit-insp-body",
49
+ className: cn("flex min-w-0 flex-col gap-8 px-4 pb-8", sub ? "pt-4" : "pt-6", "[&>[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", className),
50
+ ...rest,
51
+ children
52
+ });
53
+ }
54
+ /** One group in the body (kit.css:9, 13, 36). `locked` greys its fields and makes them read-only; `flash` runs the
55
+ * 1.2s violet flash a jump-to-group ends with. */
56
+ function InspectorGroup({ locked, flash, className, children, ...rest }) {
57
+ return /* @__PURE__ */ jsx("section", {
58
+ "data-slot": "kit-insp-group",
59
+ "data-locked": locked || void 0,
60
+ className: cn("flex min-w-0 flex-col gap-4", flash && "animate-[kit-insp-group-flash_1.2s_ease] motion-reduce:animate-none", className),
61
+ ...rest,
62
+ children
63
+ });
64
+ }
65
+ /** The fields of a group (kit.css:10-11): 20 apart, or 12 for a run of inline rows. */
66
+ function InspectorFields({ rows, className, children, ...rest }) {
67
+ return /* @__PURE__ */ jsx("div", {
68
+ "data-slot": "kit-insp-fields",
69
+ className: cn("flex min-w-0 flex-col", rows ? "gap-3" : "gap-5", className),
70
+ ...rest,
71
+ children
72
+ });
73
+ }
74
+ /** The 1px rule between groups, for a host that stacks groups outside <InspectorBody> (kit.css:8). */
75
+ function InspectorDivider({ className }) {
76
+ return /* @__PURE__ */ jsx("div", {
77
+ role: "separator",
78
+ "data-slot": "kit-insp-divider",
79
+ className: cn("h-px w-full shrink-0 bg-kit-insp-divider", className)
80
+ });
81
+ }
82
+ /** Fields a role cannot edit (kit.css:36-37): one disabled fieldset at .45. */
83
+ function InspectorLocked({ on, children }) {
84
+ if (!on) return /* @__PURE__ */ jsx(Fragment, { children });
85
+ return /* @__PURE__ */ jsx("fieldset", {
86
+ disabled: true,
87
+ "aria-disabled": "true",
88
+ "data-slot": "kit-insp-locked",
89
+ className: "m-0 flex min-w-0 flex-col gap-[inherit] border-0 p-0 opacity-45 [&_*]:!cursor-default",
90
+ children
91
+ });
92
+ }
93
+ /** Level-1 content group header (kit.jsx:66-68, kit.css:16-19; the inspector's ink is insp.css:19-20). */
94
+ function GroupHeader({ title, sub, actions, titleId, className }) {
95
+ return /* @__PURE__ */ jsxs("div", {
96
+ "data-slot": "kit-group-header",
97
+ className: cn("flex items-start gap-2", className),
98
+ children: [/* @__PURE__ */ jsxs("div", {
99
+ className: "flex min-w-0 flex-1 flex-col gap-0.5",
100
+ children: [/* @__PURE__ */ jsx("h3", {
101
+ id: titleId,
102
+ className: "text-[14px] font-medium leading-5 tracking-[-0.2px] text-kit-group-title",
103
+ children: title
104
+ }), sub ? /* @__PURE__ */ jsx("p", {
105
+ className: "text-[13px] leading-[18px] tracking-[-0.16px] text-kit-group-sub",
106
+ children: sub
107
+ }) : null]
108
+ }), actions]
109
+ });
110
+ }
111
+ /** Design / Settings group header (kit.jsx:72-91, kit.css:22-33). Static unless trailing="collapse". */
112
+ function SectionHeader({ icon, title, trailing, onReset, resetDisabled, open, onToggle, desc, actions, titleId, controls, className }) {
113
+ const row = /* @__PURE__ */ jsxs(Fragment, { children: [
114
+ /* @__PURE__ */ jsxs("span", {
115
+ id: titleId,
116
+ 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",
117
+ children: [icon, /* @__PURE__ */ jsx("span", {
118
+ className: "truncate",
119
+ children: title
120
+ })]
121
+ }),
122
+ /* @__PURE__ */ jsx("span", { className: "flex-1" }),
123
+ trailing === "locked" ? /* @__PURE__ */ jsxs("span", {
124
+ className: "inline-flex items-center gap-1 text-[13px] text-kit-insp-faint",
125
+ children: [/* @__PURE__ */ jsx(IconLock, {
126
+ "aria-hidden": true,
127
+ className: "size-3.5",
128
+ stroke: 1.8
129
+ }), "Locked"]
130
+ }) : null,
131
+ trailing === "collapse" ? /* @__PURE__ */ jsx("span", {
132
+ "aria-hidden": true,
133
+ 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"),
134
+ children: /* @__PURE__ */ jsx(IconChevronDown, {
135
+ className: "size-4",
136
+ stroke: 1.6
137
+ })
138
+ }) : null
139
+ ] });
140
+ return /* @__PURE__ */ jsxs("div", {
141
+ "data-slot": "kit-section-header",
142
+ className: cn("flex flex-col gap-1", className),
143
+ children: [trailing === "collapse" ? /* @__PURE__ */ jsxs("div", {
144
+ className: "flex min-h-6 w-full items-center gap-1.5",
145
+ children: [/* @__PURE__ */ jsx("button", {
146
+ type: "button",
147
+ "aria-expanded": !!open,
148
+ "aria-controls": controls,
149
+ onClick: onToggle,
150
+ className: cn("flex min-h-6 min-w-0 flex-1 items-center gap-1.5 rounded-[4px] text-left", FOCUS),
151
+ children: row
152
+ }), actions]
153
+ }) : /* @__PURE__ */ jsxs("div", {
154
+ className: "flex min-h-6 w-full items-center gap-1.5",
155
+ children: [
156
+ row,
157
+ actions,
158
+ trailing === "reset" ? /* @__PURE__ */ jsx("button", {
159
+ type: "button",
160
+ onClick: onReset,
161
+ disabled: resetDisabled,
162
+ "aria-label": typeof title === "string" ? `Reset ${title}` : void 0,
163
+ 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),
164
+ children: "Reset"
165
+ }) : null
166
+ ]
167
+ }), desc ? /* @__PURE__ */ jsx("p", {
168
+ className: "m-0 text-[13px] leading-[18px] tracking-[-0.16px] text-kit-insp-desc",
169
+ children: desc
170
+ }) : null]
171
+ });
172
+ }
173
+ /** The quiet note under a group's fields (insp.css:32 `.adv-note`): 12/16 in the sub colour. */
174
+ function InspectorNote({ id, className, children }) {
175
+ return /* @__PURE__ */ jsx("p", {
176
+ id,
177
+ "data-slot": "kit-insp-note",
178
+ className: cn("m-0 text-[12px] leading-4 text-kit-group-sub", className),
179
+ children
180
+ });
181
+ }
182
+ var LAYOUT_GLYPHS = {
183
+ centred: /* @__PURE__ */ jsx("path", { d: "M4 6h16M8 12h8M6 18h12" }),
184
+ left: /* @__PURE__ */ jsx("path", { d: "M4 6h16M4 12h10M4 18h14" }),
185
+ stacked: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("rect", {
186
+ x: "4",
187
+ y: "4",
188
+ width: "16",
189
+ height: "16",
190
+ rx: "2"
191
+ }), /* @__PURE__ */ jsx("path", { d: "M4 12h16" })] }),
192
+ two: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("rect", {
193
+ x: "4",
194
+ y: "4",
195
+ width: "16",
196
+ height: "16",
197
+ rx: "2"
198
+ }), /* @__PURE__ */ jsx("path", { d: "M12 4v16" })] }),
199
+ three: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("rect", {
200
+ x: "3",
201
+ y: "3",
202
+ width: "18",
203
+ height: "18",
204
+ rx: "1"
205
+ }), /* @__PURE__ */ jsx("path", { d: "M9 3v18M15 3v18" })] }),
206
+ split: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("rect", {
207
+ x: "4",
208
+ y: "4",
209
+ width: "16",
210
+ height: "16",
211
+ rx: "2"
212
+ }), /* @__PURE__ */ jsx("path", { d: "M15 4v16" })] }),
213
+ formLeft: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("rect", {
214
+ x: "4",
215
+ y: "4",
216
+ width: "16",
217
+ height: "16",
218
+ rx: "2"
219
+ }), /* @__PURE__ */ jsx("path", { d: "M9 4v16" })] }),
220
+ row: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", { d: "M4 4v16M20 4v16" }), /* @__PURE__ */ jsx("rect", {
221
+ x: "9",
222
+ y: "6",
223
+ width: "6",
224
+ height: "12",
225
+ rx: "2"
226
+ })] }),
227
+ grid: /* @__PURE__ */ jsxs(Fragment, { children: [
228
+ /* @__PURE__ */ jsx("rect", {
229
+ x: "4",
230
+ y: "4",
231
+ width: "6",
232
+ height: "6",
233
+ rx: "1"
234
+ }),
235
+ /* @__PURE__ */ jsx("rect", {
236
+ x: "14",
237
+ y: "4",
238
+ width: "6",
239
+ height: "6",
240
+ rx: "1"
241
+ }),
242
+ /* @__PURE__ */ jsx("rect", {
243
+ x: "4",
244
+ y: "14",
245
+ width: "6",
246
+ height: "6",
247
+ rx: "1"
248
+ }),
249
+ /* @__PURE__ */ jsx("rect", {
250
+ x: "14",
251
+ y: "14",
252
+ width: "6",
253
+ height: "6",
254
+ rx: "1"
255
+ })
256
+ ] }),
257
+ scroll: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("rect", {
258
+ x: "7",
259
+ y: "5",
260
+ width: "10",
261
+ height: "14",
262
+ rx: "1"
263
+ }), /* @__PURE__ */ jsx("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" })] })
264
+ };
265
+ /** A layout glyph, then the option's label: `<LayoutOpt i="two">Two columns</LayoutOpt>`. */
266
+ function LayoutOpt({ i, children }) {
267
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("svg", {
268
+ width: "14",
269
+ height: "14",
270
+ viewBox: "0 0 24 24",
271
+ fill: "none",
272
+ stroke: "currentColor",
273
+ strokeWidth: "1.75",
274
+ strokeLinecap: "round",
275
+ strokeLinejoin: "round",
276
+ "aria-hidden": true,
277
+ className: "shrink-0",
278
+ children: LAYOUT_GLYPHS[i]
279
+ }), children] });
280
+ }
281
+ /** Collapsible body for a SectionHeader with trailing="collapse" (kit.jsx:248-252): height, then a 4px rise out of a
282
+ * 4px blur, both on the accordion curve. Instant with reduced motion. */
283
+ function InspectorCollapse({ open, id, rows, className, children }) {
284
+ const reduce = useKitReducedMotion();
285
+ const t = {
286
+ duration: reduce ? 0 : .3,
287
+ ease: INSPECTOR_EASE
288
+ };
289
+ return /* @__PURE__ */ jsx(AnimatePresence, {
290
+ initial: false,
291
+ children: open ? /* @__PURE__ */ jsx(motion.div, {
292
+ id,
293
+ "data-slot": "kit-insp-collapse",
294
+ initial: { height: 0 },
295
+ animate: { height: "auto" },
296
+ exit: { height: 0 },
297
+ transition: t,
298
+ className: "min-w-0 overflow-hidden",
299
+ children: /* @__PURE__ */ jsx(motion.div, {
300
+ initial: reduce ? false : {
301
+ opacity: 0,
302
+ y: -4,
303
+ filter: "blur(4px)"
304
+ },
305
+ animate: {
306
+ opacity: 1,
307
+ y: 0,
308
+ filter: "blur(0px)"
309
+ },
310
+ exit: reduce ? void 0 : {
311
+ opacity: 0,
312
+ y: -4,
313
+ filter: "blur(4px)"
314
+ },
315
+ transition: t,
316
+ className: cn("flex min-w-0 flex-col", rows ? "gap-3" : "gap-5", className),
317
+ children
318
+ })
319
+ }, "c") : null
320
+ });
321
+ }
322
+ /**
323
+ * The inspector field shell (editor.css:411-431, kit.css:506-515): label row 13/16 medium, min 20 high, the control 8
324
+ * under it, then an optional 12/16 footer. `current` puts the focus dot after the label (order: label · dot · spacer ·
325
+ * meta); `flash` runs the left-to-right violet sweep behind the whole field (a plain fade with reduced motion).
326
+ */
327
+ function InspectorField({ label, labelId, htmlFor, info, meta, current, flash, state, hint, counter, className, children, ...rest }) {
328
+ const labelCls = "flex min-h-5 items-center gap-1.5 text-[13px] font-medium leading-4 text-kit-insp-label";
329
+ const labelInner = /* @__PURE__ */ jsxs(Fragment, { children: [
330
+ label,
331
+ info ? /* @__PURE__ */ jsx(InfoTooltip, {
332
+ title: label,
333
+ children: info
334
+ }) : null,
335
+ current ? /* @__PURE__ */ jsx(FocusDot, {}) : null,
336
+ /* @__PURE__ */ jsx("span", { className: "flex-1" }),
337
+ meta
338
+ ] });
339
+ return /* @__PURE__ */ jsxs("div", {
340
+ "data-slot": "kit-insp-field",
341
+ "data-cur": current || void 0,
342
+ "data-state": state,
343
+ className: cn("relative flex min-w-0 flex-col gap-2 rounded-[4px]", flash ? "isolate" : null, className),
344
+ ...rest,
345
+ children: [
346
+ flash ? /* @__PURE__ */ jsx(FieldSweep, {}, String(flash)) : null,
347
+ htmlFor ? /* @__PURE__ */ jsx("label", {
348
+ id: labelId,
349
+ htmlFor,
350
+ "data-slot": "kit-insp-label",
351
+ className: labelCls,
352
+ children: labelInner
353
+ }) : /* @__PURE__ */ jsx("div", {
354
+ id: labelId,
355
+ "data-slot": "kit-insp-label",
356
+ className: labelCls,
357
+ children: labelInner
358
+ }),
359
+ children,
360
+ hint || counter ? /* @__PURE__ */ jsxs("div", {
361
+ "data-slot": "kit-insp-field-foot",
362
+ className: cn("flex justify-between gap-3 text-[12px] leading-4", state === "over" ? "text-kit-insp-error" : "text-kit-insp-faint"),
363
+ children: [/* @__PURE__ */ jsx("span", {
364
+ className: "min-w-0",
365
+ children: hint
366
+ }), counter]
367
+ }) : null
368
+ ]
369
+ });
370
+ }
371
+ /** The 6px violet dot after a field's label while it is the one a canvas click opened (kit.css:513-515). */
372
+ function FocusDot({ className }) {
373
+ return /* @__PURE__ */ jsx("span", {
374
+ "aria-hidden": true,
375
+ "data-slot": "kit-focus-dot",
376
+ 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)
377
+ });
378
+ }
379
+ /** The soft violet fill that sweeps across a field a canvas click opened (kit.css:506-511). Sits behind the field, 6/8
380
+ * outside it; the parent must be `relative isolate`. */
381
+ function FieldSweep({ className }) {
382
+ return /* @__PURE__ */ jsx("span", {
383
+ "aria-hidden": true,
384
+ "data-slot": "kit-field-sweep",
385
+ className: cn("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", "[clip-path:inset(0_100%_0_0_round_6px)] animate-[kit-insp-sweep_1.4s_cubic-bezier(0.4,0,0.2,1)_forwards]", "motion-reduce:[clip-path:none] motion-reduce:animate-[kit-insp-fade_1.6s_ease_forwards]", className)
386
+ });
387
+ }
388
+ /** How close a count is to its limit, by the prototype's rule (state.js:93 countLevel): "near" above 91% of the
389
+ * limit, "over" past it. */
390
+ function counterState(n, max) {
391
+ if (!max) return "ok";
392
+ return n > max ? "over" : n > Math.floor(max * .91) ? "near" : "ok";
393
+ }
394
+ /** The 12px progress ring beside a counter that is near or over its limit (content.jsx:307-309, content.css:617): a
395
+ * grey track, an amber arc that fills with the count, red when over. Springs in and out (wrap it in AnimatePresence). */
396
+ function CountRing({ value, max, className }) {
397
+ const reduce = useKitReducedMotion();
398
+ const r = 4.5;
399
+ const c = 2 * Math.PI * r;
400
+ const over = value > max;
401
+ return /* @__PURE__ */ jsxs(motion.svg, {
402
+ "aria-hidden": true,
403
+ "data-slot": "kit-count-ring",
404
+ width: "12",
405
+ height: "12",
406
+ viewBox: "0 0 12 12",
407
+ initial: reduce ? false : {
408
+ scale: .5,
409
+ opacity: 0
410
+ },
411
+ animate: {
412
+ scale: 1,
413
+ opacity: 1
414
+ },
415
+ exit: reduce ? { opacity: 0 } : {
416
+ scale: .5,
417
+ opacity: 0
418
+ },
419
+ transition: reduce ? { duration: 0 } : {
420
+ type: "spring",
421
+ stiffness: 520,
422
+ damping: 22
423
+ },
424
+ className: cn("shrink-0", className),
425
+ children: [/* @__PURE__ */ jsx("circle", {
426
+ cx: "6",
427
+ cy: "6",
428
+ r,
429
+ fill: "none",
430
+ strokeWidth: "2",
431
+ className: "stroke-kit-insp-track"
432
+ }), /* @__PURE__ */ jsx("circle", {
433
+ cx: "6",
434
+ cy: "6",
435
+ r,
436
+ fill: "none",
437
+ strokeWidth: "2",
438
+ strokeLinecap: "round",
439
+ strokeDasharray: `${Math.min(value / max, 1) * c} ${c}`,
440
+ transform: "rotate(-90 6 6)",
441
+ className: cn("transition-[stroke-dasharray,stroke] duration-200 motion-reduce:transition-none", over ? "stroke-kit-insp-ring-over" : "stroke-kit-insp-ring-near")
442
+ })]
443
+ });
444
+ }
445
+ /** The field counter "42 / 60" (content.jsx:310-320; content.css:614-616; insp.css:163-164): 12/16 tabular, amber and
446
+ * medium when near the limit, red over it, with the ring beside it in both states. Without `max` it is the bare count. */
447
+ function FieldCounter({ value, max, ring = true, size = 11, className }) {
448
+ const s = counterState(value, max);
449
+ return /* @__PURE__ */ jsxs("span", {
450
+ "data-slot": "kit-field-counter",
451
+ "data-state": s,
452
+ role: "img",
453
+ "aria-label": max == null ? `${value} characters` : `${value} of ${max} characters`,
454
+ 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),
455
+ children: [/* @__PURE__ */ jsx(AnimatePresence, {
456
+ initial: false,
457
+ children: ring && max && s !== "ok" ? /* @__PURE__ */ jsx(CountRing, {
458
+ value,
459
+ max
460
+ }, "r") : null
461
+ }), max == null ? value : /* @__PURE__ */ jsxs("span", {
462
+ "aria-hidden": true,
463
+ className: "inline-flex items-center whitespace-pre",
464
+ children: [/* @__PURE__ */ jsx(RollNumber, { value }), ` / ${max}`]
465
+ })]
466
+ });
467
+ }
468
+ /** A number that rolls (ui.jsx:371-378 `Roll`, faq.css:90-91), digit by digit (M20): each digit sits in its own 1ch
469
+ * tabular cell, keyed by its place from the right, so only a digit that changed moves: the new one rises in from below
470
+ * while the old one lifts out (transform + opacity, 160ms in, 120ms out, no blur). The number itself never remounts,
471
+ * and fast typing never queues: the latest value is always the one entering. Reduced motion: an instant swap. */
472
+ function RollNumber({ value, className }) {
473
+ const reduce = !!useKitReducedMotion();
474
+ const chars = Array.from(String(value));
475
+ return /* @__PURE__ */ jsx("span", {
476
+ "data-slot": "kit-roll",
477
+ className: cn("inline-flex tabular-nums", className),
478
+ children: chars.map((ch, i) => /* @__PURE__ */ jsx(RollDigit, {
479
+ ch,
480
+ reduce
481
+ }, chars.length - i))
482
+ });
483
+ }
484
+ var ROLL_EASE = [
485
+ .22,
486
+ 1,
487
+ .36,
488
+ 1
489
+ ];
490
+ function RollDigit({ ch, reduce }) {
491
+ return /* @__PURE__ */ jsx("span", {
492
+ "data-slot": "kit-roll-digit",
493
+ className: "relative inline-block w-[1ch] text-center",
494
+ children: reduce ? ch : /* @__PURE__ */ jsx(AnimatePresence, {
495
+ mode: "popLayout",
496
+ initial: false,
497
+ children: /* @__PURE__ */ jsx(motion.span, {
498
+ className: "inline-block",
499
+ initial: {
500
+ opacity: 0,
501
+ y: "0.5em"
502
+ },
503
+ animate: {
504
+ opacity: 1,
505
+ y: 0,
506
+ transition: {
507
+ duration: .16,
508
+ ease: ROLL_EASE
509
+ }
510
+ },
511
+ exit: {
512
+ opacity: 0,
513
+ y: "-0.5em",
514
+ transition: {
515
+ duration: .12,
516
+ ease: ROLL_EASE
517
+ }
518
+ },
519
+ children: ch
520
+ }, ch)
521
+ })
522
+ });
523
+ }
524
+ /** The line under a field that is over its limit, in the prototype's words (content.jsx:318). */
525
+ var overLimitText = (max) => `Over the ${max}-character limit`;
526
+ /** The red inset edge over a field's control box while its count is over the limit (content.css:618). Drawn on the
527
+ * box's ::after, so the input's own focus border cannot hide it. The box must be `relative`. */
528
+ var OVER_LIMIT_EDGE_CLASS = "after:pointer-events-none after:absolute after:inset-0 after:rounded-[6px] after:shadow-[inset_0_0_0_1px_var(--kit-insp-ring-over)]";
529
+ /** One 0.32s shake as the count goes over (content.css:618-619); none under reduced motion. */
530
+ var OVER_LIMIT_SHAKE_CLASS = "motion-safe:animate-[kit-insp-shake_0.32s_ease] motion-reduce:animate-none";
531
+ /** The edge and the shake together, for a box that is known to have just gone over. Prefer `useOverLimit`. */
532
+ var OVER_LIMIT_CLASS = `${OVER_LIMIT_EDGE_CLASS} ${OVER_LIMIT_SHAKE_CLASS}`;
533
+ /**
534
+ * M20: the props for a field's control box (spread them on it). The edge shows while `over`; the shake class is added
535
+ * only when the count CROSSES the limit after mount, and leaves when its animation ends, so the shake plays once per
536
+ * crossing: never per keystroke, and never again when the box is hidden and shown while still over. A field that
537
+ * mounts already over shows the edge with no shake (nothing animates on first paint). Reduced motion (the OS, or a
538
+ * host <MotionConfig reducedMotion="always">): the edge only.
539
+ */
540
+ function useOverLimit(over) {
541
+ const reduce = !!useKitReducedMotion();
542
+ const [prev, setPrev] = React.useState(over);
543
+ const [crossed, setCrossed] = React.useState(false);
544
+ if (prev !== over) {
545
+ setPrev(over);
546
+ setCrossed(over);
547
+ }
548
+ return {
549
+ className: over ? cn(OVER_LIMIT_EDGE_CLASS, crossed && !reduce && "motion-safe:animate-[kit-insp-shake_0.32s_ease] motion-reduce:animate-none") : void 0,
550
+ onAnimationEnd: (e) => {
551
+ if (e.target === e.currentTarget && e.animationName === "kit-insp-shake") setCrossed(false);
552
+ }
553
+ };
554
+ }
555
+ /** Label left, control right in a fixed 194 column (kit.jsx:137, kit.css:50-55, 501-502). `meta` is the quiet current
556
+ * value after the label ("M · 8 px"); `info` adds the info tooltip. */
557
+ function InlineRow({ label, meta, info, labelId, className, children }) {
558
+ return /* @__PURE__ */ jsxs("div", {
559
+ "data-slot": "kit-inline-row",
560
+ className: cn("flex min-h-8 items-center gap-4", className),
561
+ children: [/* @__PURE__ */ jsxs("span", {
562
+ id: labelId,
563
+ className: "inline-flex min-w-0 flex-1 items-center gap-1 whitespace-nowrap text-[13px] leading-4 text-kit-insp-label",
564
+ children: [
565
+ label,
566
+ info ? /* @__PURE__ */ jsx(InfoTooltip, {
567
+ title: label,
568
+ children: info
569
+ }) : null,
570
+ meta ? /* @__PURE__ */ jsx("em", {
571
+ className: "truncate text-[12px] not-italic tabular-nums text-kit-insp-faint",
572
+ children: meta
573
+ }) : null
574
+ ]
575
+ }), /* @__PURE__ */ jsx("div", {
576
+ className: "w-[194px] flex-none",
577
+ children
578
+ })]
579
+ });
580
+ }
581
+ /**
582
+ * Segmented control, 2–5 options, with the sliding pill (kit.jsx:114-120; styles.css:188-191, editor.css:287 + 458-461,
583
+ * insp.css:61). 36 high (32 with `small` or inside an InlineRow), 2 padding, grey track, white pill on the spring.
584
+ * A radiogroup: arrows move the choice.
585
+ */
586
+ function InspectorSeg({ options, value, onChange, small, disabled, className, "aria-label": ariaLabel, "aria-labelledby": labelledBy }) {
587
+ const id = React.useId();
588
+ const reduce = useKitReducedMotion();
589
+ const move = (e) => {
590
+ const d = e.key === "ArrowRight" || e.key === "ArrowDown" ? 1 : e.key === "ArrowLeft" || e.key === "ArrowUp" ? -1 : 0;
591
+ if (!d || disabled) return;
592
+ e.preventDefault();
593
+ const at = options.findIndex((o) => o.value === value);
594
+ const next = at < 0 ? options[d > 0 ? 0 : options.length - 1] : options[(at + d + options.length) % options.length];
595
+ if (!next) return;
596
+ onChange(next.value);
597
+ e.currentTarget.querySelector(`[data-seg="${CSS.escape(next.value)}"]`)?.focus();
598
+ };
599
+ return /* @__PURE__ */ jsx("div", {
600
+ role: "radiogroup",
601
+ "aria-label": ariaLabel,
602
+ "aria-labelledby": labelledBy,
603
+ "data-slot": "kit-insp-seg",
604
+ onKeyDown: move,
605
+ className: cn("flex w-full gap-0.5 rounded-[6px] bg-kit-insp-track p-0.5", small ? "h-8" : "h-9", className),
606
+ children: options.map((o, i) => {
607
+ const on = o.value === value;
608
+ const stop = on || i === 0 && !options.some((x) => x.value === value);
609
+ return /* @__PURE__ */ jsxs("button", {
610
+ type: "button",
611
+ role: "radio",
612
+ "data-seg": o.value,
613
+ disabled,
614
+ "aria-checked": on,
615
+ "aria-label": o.title,
616
+ title: o.title,
617
+ tabIndex: stop ? 0 : -1,
618
+ onClick: () => onChange(o.value),
619
+ className: cn("relative min-w-0 flex-1 whitespace-nowrap rounded-[4px] tracking-[-0.16px] transition-colors disabled:cursor-default", small ? "text-[12.5px]" : "text-[13px]", on ? "font-medium text-kit-insp-ink" : "text-kit-insp-desc hover:text-kit-insp-ink", FOCUS),
620
+ children: [on ? /* @__PURE__ */ jsx(motion.span, {
621
+ layoutId: `kit-seg-${id}`,
622
+ transition: reduce ? { duration: 0 } : PILL,
623
+ 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)]"
624
+ }) : null, /* @__PURE__ */ jsx("span", {
625
+ className: "relative inline-flex items-center justify-center gap-1.5 [&>svg]:size-3.5 [&>svg]:shrink-0",
626
+ children: o.label
627
+ })]
628
+ }, o.value);
629
+ })
630
+ });
631
+ }
632
+ var SELECT_BASE = "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";
633
+ function OptionItems({ options, value, onPick }) {
634
+ return /* @__PURE__ */ jsx(Fragment, { children: options.map((o) => /* @__PURE__ */ jsx(MenuItem, {
635
+ disabled: o.disabled,
636
+ onClick: () => onPick(o.value),
637
+ className: o.desc ? "h-auto py-1.5" : void 0,
638
+ "aria-current": o.value === value || void 0,
639
+ children: /* @__PURE__ */ jsxs("span", {
640
+ className: "flex items-center gap-2",
641
+ children: [/* @__PURE__ */ jsxs("span", {
642
+ className: "flex min-w-0 flex-1 flex-col",
643
+ children: [/* @__PURE__ */ jsx("span", {
644
+ className: "truncate",
645
+ children: o.label
646
+ }), o.desc ? /* @__PURE__ */ jsx("span", {
647
+ className: "whitespace-normal text-[12px] leading-4 text-kit-insp-quiet",
648
+ children: o.desc
649
+ }) : null]
650
+ }), o.value === value ? /* @__PURE__ */ jsx(IconCheck, {
651
+ "aria-hidden": true,
652
+ className: "size-3.5 shrink-0 text-kit-insp-label",
653
+ stroke: 2
654
+ }) : null]
655
+ })
656
+ }, o.value)) });
657
+ }
658
+ /** Compact dropdown for an Inline row (kit.jsx:140-150, kit.css:58-62): 32 high, grey, violet edge while open. The menu
659
+ * is at least as wide as the control. */
660
+ function SelectCompact({ value, options, onPick, icon, label, disabled, className }) {
661
+ const cur = options.find((o) => o.value === value);
662
+ return /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsxs(MenuTrigger, {
663
+ "aria-label": label,
664
+ disabled,
665
+ "data-slot": "kit-select-compact",
666
+ className: cn(SELECT_BASE, "h-8 gap-1.5 pl-2.5 pr-2", FOCUS, className),
667
+ children: [
668
+ icon ? /* @__PURE__ */ jsx("span", {
669
+ "aria-hidden": true,
670
+ className: "flex shrink-0 text-kit-insp-label [&>svg]:size-3.5",
671
+ children: icon
672
+ }) : null,
673
+ /* @__PURE__ */ jsx("span", {
674
+ className: "min-w-0 flex-1 truncate",
675
+ children: cur ? cur.label : "Select…"
676
+ }),
677
+ /* @__PURE__ */ jsx(IconChevronDown, {
678
+ "aria-hidden": true,
679
+ className: "size-3.5 shrink-0 text-kit-insp-desc",
680
+ stroke: 1.6
681
+ })
682
+ ]
683
+ }), /* @__PURE__ */ jsx(MenuContent, {
684
+ align: "start",
685
+ className: "min-w-[var(--anchor-width)]",
686
+ children: /* @__PURE__ */ jsx(OptionItems, {
687
+ options,
688
+ value,
689
+ onPick
690
+ })
691
+ })] });
692
+ }
693
+ /** Full-width select with its label above (kit.jsx:153-164; editor.css:416-417, 433; faq.css:59): 34 high. */
694
+ function SelectField({ label, value, options, onPick, placeholder = "Select…", icon, info, disabled, current, flash, className }) {
695
+ const id = React.useId();
696
+ const cur = options.find((o) => o.value === value);
697
+ return /* @__PURE__ */ jsx(InspectorField, {
698
+ label,
699
+ labelId: `${id}-l`,
700
+ info,
701
+ current,
702
+ flash,
703
+ className,
704
+ children: /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsxs(MenuTrigger, {
705
+ "aria-labelledby": `${id}-l ${id}-v`,
706
+ disabled,
707
+ "data-slot": "kit-select-field",
708
+ className: cn(SELECT_BASE, "h-[34px] gap-2 px-2.5 tracking-[-0.1625px]", FOCUS),
709
+ children: [
710
+ icon ? /* @__PURE__ */ jsx("span", {
711
+ "aria-hidden": true,
712
+ className: "flex shrink-0 text-kit-insp-label [&>svg]:size-3.5",
713
+ children: icon
714
+ }) : null,
715
+ /* @__PURE__ */ jsx("span", {
716
+ id: `${id}-v`,
717
+ className: cn("min-w-0 truncate", !cur && "text-kit-insp-faint"),
718
+ children: cur ? cur.label : placeholder
719
+ }),
720
+ /* @__PURE__ */ jsx("span", { className: "flex-1" }),
721
+ /* @__PURE__ */ jsx(IconChevronDown, {
722
+ "aria-hidden": true,
723
+ className: "size-3.5 shrink-0 text-kit-insp-desc",
724
+ stroke: 1.6
725
+ })
726
+ ]
727
+ }), /* @__PURE__ */ jsx(MenuContent, {
728
+ align: "start",
729
+ className: "min-w-[var(--anchor-width)]",
730
+ children: /* @__PURE__ */ jsx(OptionItems, {
731
+ options,
732
+ value,
733
+ onPick
734
+ })
735
+ })] })
736
+ });
737
+ }
738
+ /** Colour select (kit.jsx:219-232, kit.css:77-79): value left, swatch + token pill right; the menu lists the theme
739
+ * colours with their tokens under a header, then an optional readability note. */
740
+ function ColourSelect({ 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 }) {
741
+ const id = React.useId();
742
+ const cur = options.find((o) => o.value === value) ?? options[0];
743
+ const swatch = (c) => /* @__PURE__ */ jsx("span", {
744
+ "aria-hidden": true,
745
+ className: "size-3.5 shrink-0 rounded-[3px] shadow-[inset_0_0_0_1px_rgb(0_0_0/0.12)]",
746
+ style: { background: c }
747
+ });
748
+ return /* @__PURE__ */ jsx(InspectorField, {
749
+ label,
750
+ labelId: `${id}-l`,
751
+ className,
752
+ children: /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsxs(MenuTrigger, {
753
+ "aria-labelledby": `${id}-l ${id}-v`,
754
+ disabled,
755
+ "data-slot": "kit-colour-select",
756
+ className: cn(SELECT_BASE, "h-[34px] gap-2 px-2.5 tracking-[-0.1625px]", FOCUS),
757
+ children: [
758
+ /* @__PURE__ */ jsx("span", {
759
+ id: `${id}-v`,
760
+ className: "shrink-0",
761
+ children: cur?.label ?? "Select…"
762
+ }),
763
+ /* @__PURE__ */ jsx("span", { className: "flex-1" }),
764
+ cur ? /* @__PURE__ */ jsxs("span", {
765
+ 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",
766
+ children: [swatch(cur.colour), cur.token]
767
+ }) : null,
768
+ /* @__PURE__ */ jsx(IconChevronDown, {
769
+ "aria-hidden": true,
770
+ className: "size-3.5 shrink-0 text-kit-insp-desc",
771
+ stroke: 1.6
772
+ })
773
+ ]
774
+ }), /* @__PURE__ */ jsxs(MenuContent, {
775
+ align: "start",
776
+ className: "w-[300px] min-w-[var(--anchor-width)]",
777
+ children: [
778
+ header ? /* @__PURE__ */ jsx(MenuLabel, { children: header }) : null,
779
+ options.map((o) => /* @__PURE__ */ jsx(MenuItem, {
780
+ icon: swatch(o.colour),
781
+ onClick: () => onPick(o.value),
782
+ "aria-current": o.value === value || void 0,
783
+ children: /* @__PURE__ */ jsxs("span", {
784
+ className: "flex items-center gap-2",
785
+ children: [
786
+ /* @__PURE__ */ jsx("span", {
787
+ className: "min-w-0 flex-1 truncate",
788
+ children: o.label
789
+ }),
790
+ /* @__PURE__ */ jsx("span", {
791
+ className: "shrink-0 text-[12px] text-kit-insp-quiet",
792
+ children: o.token
793
+ }),
794
+ o.value === value ? /* @__PURE__ */ jsx(IconCheck, {
795
+ "aria-hidden": true,
796
+ className: "size-3.5 shrink-0 text-kit-insp-label",
797
+ stroke: 2
798
+ }) : null
799
+ ]
800
+ })
801
+ }, o.value)),
802
+ note ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MenuSeparator, {}), /* @__PURE__ */ jsx("p", {
803
+ className: "px-2 py-1.5 text-[12px] leading-[17px] text-kit-insp-quiet",
804
+ children: note
805
+ })] }) : null
806
+ ]
807
+ })] })
808
+ });
809
+ }
810
+ var 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)]";
811
+ var HANDLE = "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";
812
+ function trackDrag(e, onMove, onEnd) {
813
+ e.preventDefault();
814
+ e.currentTarget.focus();
815
+ const body = e.currentTarget.ownerDocument.body;
816
+ const prev = body.style.cursor;
817
+ body.style.cursor = "ew-resize";
818
+ const mv = (ev) => onMove(ev.clientX);
819
+ const up = () => {
820
+ window.removeEventListener("pointermove", mv);
821
+ window.removeEventListener("pointerup", up);
822
+ window.removeEventListener("pointercancel", up);
823
+ body.style.cursor = prev;
824
+ onEnd?.();
825
+ };
826
+ window.addEventListener("pointermove", mv);
827
+ window.addEventListener("pointerup", up);
828
+ window.addEventListener("pointercancel", up);
829
+ onMove(e.clientX);
830
+ }
831
+ /** Step slider (kit.jsx:168-187, kit.css:65-73): filler + handle on the current stop, dots on the others. Click a stop,
832
+ * drag the handle, or use the arrow keys. `value` is the stop's index. */
833
+ function StepSlider({ label, stops, value, onChange, disabled, className, "aria-labelledby": labelledBy }) {
834
+ const ref = React.useRef(null);
835
+ const n = stops.length;
836
+ const last = Math.max(1, n - 1);
837
+ const i = Math.max(0, Math.min(n - 1, value));
838
+ const cur = React.useRef(i);
839
+ cur.current = i;
840
+ const pick = (clientX) => {
841
+ const r = ref.current.getBoundingClientRect();
842
+ const x = Math.min(Math.max(clientX - r.left - 8, 0), r.width - 16);
843
+ return Math.round(x / ((r.width - 16) / last));
844
+ };
845
+ const pct = i / last;
846
+ return /* @__PURE__ */ jsxs("div", {
847
+ ref,
848
+ role: "slider",
849
+ tabIndex: disabled ? -1 : 0,
850
+ "aria-label": labelledBy ? void 0 : label,
851
+ "aria-labelledby": labelledBy,
852
+ "aria-valuemin": 0,
853
+ "aria-valuemax": n - 1,
854
+ "aria-valuenow": i,
855
+ "aria-valuetext": stops[i],
856
+ "aria-disabled": disabled || void 0,
857
+ "data-slot": "kit-step-slider",
858
+ onPointerDown: (e) => {
859
+ if (disabled) return;
860
+ trackDrag(e, (x) => {
861
+ const j = pick(x);
862
+ if (j !== cur.current) {
863
+ cur.current = j;
864
+ onChange(j);
865
+ }
866
+ });
867
+ },
868
+ onKeyDown: (e) => {
869
+ if (disabled) return;
870
+ if (e.key === "ArrowRight" || e.key === "ArrowUp") {
871
+ e.preventDefault();
872
+ onChange(Math.min(n - 1, i + 1));
873
+ }
874
+ if (e.key === "ArrowLeft" || e.key === "ArrowDown") {
875
+ e.preventDefault();
876
+ onChange(Math.max(0, i - 1));
877
+ }
878
+ },
879
+ className: cn(TRACK, "group/step", disabled ? "cursor-default opacity-45" : "cursor-pointer", FOCUS, className),
880
+ children: [
881
+ /* @__PURE__ */ jsx("span", {
882
+ "aria-hidden": true,
883
+ 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",
884
+ style: { width: `calc(${pct} * (100% - 16px) + 13px)` }
885
+ }),
886
+ stops.map((s, j) => /* @__PURE__ */ jsx("span", {
887
+ "aria-hidden": true,
888
+ title: s,
889
+ 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"),
890
+ style: { left: `calc(${j / last} * (100% - 16px) + 8px)` }
891
+ }, j)),
892
+ /* @__PURE__ */ jsx("span", {
893
+ "aria-hidden": true,
894
+ 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]"),
895
+ style: { left: `calc(${pct} * (100% - 16px) + 8px)` }
896
+ })
897
+ ]
898
+ });
899
+ }
900
+ /** Step slider in an Inline row: label + the current stop's name on the left (kit.jsx:211-213). */
901
+ function StepRow({ label, stops, names, value, onChange, disabled, info }) {
902
+ return /* @__PURE__ */ jsx(InlineRow, {
903
+ label,
904
+ meta: (names ?? stops)[value],
905
+ info,
906
+ children: /* @__PURE__ */ jsx(StepSlider, {
907
+ label,
908
+ stops,
909
+ value,
910
+ onChange,
911
+ disabled
912
+ })
913
+ });
914
+ }
915
+ /**
916
+ * Value slider (kit.jsx:191-209, kit.css:555-564): the step slider's track, filler and handle with the label left and
917
+ * the number right inside the track. origin "start" fills from the left; "center" fills out from a zero mark. Drag,
918
+ * click, arrow keys (Shift = ×10); double-click resets. `onStart` fires once before a gesture's first change (one undo step).
919
+ */
920
+ function ValueSlider({ label, value, min = 0, max = 100, origin = "start", reset, format = String, onChange, onStart, disabled, className }) {
921
+ const ref = React.useRef(null);
922
+ const [drag, setDrag] = React.useState(false);
923
+ const span = max - min || 1;
924
+ const clamp = (v) => Math.max(min, Math.min(max, Math.round(v)));
925
+ const pct = (value - min) / span;
926
+ const at = (clientX) => {
927
+ const r = ref.current.getBoundingClientRect();
928
+ return clamp(min + Math.min(Math.max((clientX - r.left - 6) / (r.width - 12), 0), 1) * span);
929
+ };
930
+ const z = origin === "center" ? .5 : 0;
931
+ const a = Math.min(z, pct);
932
+ const b = Math.max(z, pct);
933
+ const move = drag ? "" : "transition-[left,width,transform] duration-[120ms] motion-reduce:transition-none";
934
+ return /* @__PURE__ */ jsxs("div", {
935
+ ref,
936
+ role: "slider",
937
+ tabIndex: disabled ? -1 : 0,
938
+ "aria-label": label,
939
+ "aria-valuemin": min,
940
+ "aria-valuemax": max,
941
+ "aria-valuenow": value,
942
+ "aria-valuetext": format(value),
943
+ "aria-disabled": disabled || void 0,
944
+ "data-slot": "kit-value-slider",
945
+ onPointerDown: (e) => {
946
+ if (disabled) return;
947
+ onStart?.();
948
+ setDrag(true);
949
+ trackDrag(e, (x) => onChange(at(x)), () => setDrag(false));
950
+ },
951
+ onKeyDown: (e) => {
952
+ if (disabled) return;
953
+ const d = {
954
+ ArrowRight: 1,
955
+ ArrowUp: 1,
956
+ ArrowLeft: -1,
957
+ ArrowDown: -1
958
+ }[e.key];
959
+ if (!d) return;
960
+ e.preventDefault();
961
+ onStart?.();
962
+ onChange(clamp(value + d * (e.shiftKey ? 10 : 1)));
963
+ },
964
+ onDoubleClick: () => {
965
+ if (disabled) return;
966
+ onStart?.();
967
+ onChange(reset ?? (origin === "center" ? clamp((min + max) / 2) : min));
968
+ },
969
+ className: cn(TRACK, "flex items-center justify-between px-2.5", disabled ? "cursor-default opacity-45" : "cursor-ew-resize", FOCUS, className),
970
+ children: [
971
+ /* @__PURE__ */ jsx("span", {
972
+ "aria-hidden": true,
973
+ className: cn("absolute inset-y-0 bg-kit-insp-track-fill", origin === "start" && "rounded-l-[6px]", move),
974
+ style: {
975
+ left: `calc(${a} * (100% - 12px) + ${a ? 6 : 0}px)`,
976
+ width: `calc(${b - a} * (100% - 12px) + ${a ? 0 : 6}px)`
977
+ }
978
+ }),
979
+ origin === "center" ? /* @__PURE__ */ jsx("span", {
980
+ "aria-hidden": true,
981
+ className: "absolute inset-y-0 left-1/2 w-px bg-kit-insp-line-strong"
982
+ }) : null,
983
+ /* @__PURE__ */ jsx("span", {
984
+ className: "pointer-events-none relative z-[1] text-[12px] font-medium leading-4 text-kit-insp-tip-body",
985
+ children: label
986
+ }),
987
+ /* @__PURE__ */ jsx("span", {
988
+ className: "pointer-events-none relative z-[1] text-[12px] font-medium leading-4 tabular-nums text-kit-insp-tip-title",
989
+ children: format(value)
990
+ }),
991
+ /* @__PURE__ */ jsx("span", {
992
+ "aria-hidden": true,
993
+ className: cn(HANDLE, "z-[2]", move, drag && "scale-[1.08]"),
994
+ style: { left: `calc(${pct} * (100% - 12px) + 6px)` }
995
+ })
996
+ ]
997
+ });
998
+ }
999
+ /** The prototype switch (ui.jsx:132-141, editor.css:242-251): 34×20 (sm 28×16), inset-shadow track, grey knob with a
1000
+ * 1px grip line. `deco` draws it inside another control (a menu row): no button, hidden from assistive tech. */
1001
+ function InspectorSwitch({ on, onChange, size = "md", label, disabled, deco, className, "aria-labelledby": labelledBy }) {
1002
+ const sm = size === "sm";
1003
+ const track = cn("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", sm ? "h-4 w-7" : "h-5 w-[34px]", on ? "bg-kit-insp-switch-on" : "bg-kit-insp-switch-off", className);
1004
+ const knob = /* @__PURE__ */ jsx("span", {
1005
+ className: cn("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", sm ? "size-3" : "size-4", on && (sm ? "translate-x-3" : "translate-x-3.5")),
1006
+ children: /* @__PURE__ */ jsx("i", { className: cn("block w-px rounded-[0.5px] bg-kit-insp-switch-knob-mark", sm ? "h-1.5" : "h-2") })
1007
+ });
1008
+ if (deco) return /* @__PURE__ */ jsx("span", {
1009
+ "aria-hidden": true,
1010
+ "data-slot": "kit-insp-switch",
1011
+ className: track,
1012
+ children: knob
1013
+ });
1014
+ return /* @__PURE__ */ jsx("button", {
1015
+ type: "button",
1016
+ role: "switch",
1017
+ "aria-checked": on,
1018
+ "aria-label": labelledBy ? void 0 : label,
1019
+ "aria-labelledby": labelledBy,
1020
+ disabled,
1021
+ "data-slot": "kit-insp-switch",
1022
+ onClick: (e) => {
1023
+ e.stopPropagation();
1024
+ onChange?.(!on);
1025
+ },
1026
+ className: cn(track, "cursor-pointer disabled:cursor-default disabled:opacity-40", FOCUS, "focus-visible:outline-offset-2"),
1027
+ children: knob
1028
+ });
1029
+ }
1030
+ /** Toggle row (kit.jsx:241-243; styles.css:286-289, editor.css:445-447): label + supporting text left, switch right,
1031
+ * top-aligned. */
1032
+ function ToggleRow({ label, desc, on, onChange, disabled, className }) {
1033
+ const id = React.useId();
1034
+ return /* @__PURE__ */ jsxs("div", {
1035
+ "data-slot": "kit-toggle-row",
1036
+ className: cn("flex items-start justify-between gap-4", className),
1037
+ children: [/* @__PURE__ */ jsxs("div", {
1038
+ className: "flex min-w-0 flex-1 flex-col gap-1 leading-[18px]",
1039
+ children: [/* @__PURE__ */ jsx("b", {
1040
+ id,
1041
+ className: "text-[13px] font-medium tracking-[-0.1625px] text-kit-insp-ink",
1042
+ children: label
1043
+ }), desc ? /* @__PURE__ */ jsx("small", {
1044
+ className: "text-[12px] leading-[18px] tracking-[-0.12px] text-kit-insp-quiet",
1045
+ children: desc
1046
+ }) : null]
1047
+ }), /* @__PURE__ */ jsx(InspectorSwitch, {
1048
+ on,
1049
+ onChange,
1050
+ disabled,
1051
+ "aria-labelledby": id
1052
+ })]
1053
+ });
1054
+ }
1055
+ /** Related toggles share ONE grey card (kit.jsx:245, kit.css:84-85): #F5F5F5, radius 8, 12 padding, rows 14 apart. */
1056
+ function ToggleCard({ className, children, ...rest }) {
1057
+ return /* @__PURE__ */ jsx("div", {
1058
+ "data-slot": "kit-toggle-card",
1059
+ className: cn("flex flex-col gap-3.5 rounded-[8px] bg-kit-insp-card p-3", className),
1060
+ ...rest,
1061
+ children
1062
+ });
1063
+ }
1064
+ /** 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
1065
+ * Add button and the note, 4 apart. Pass <ItemRow>s as children, `add` and `note` below them. */
1066
+ function ItemListCard({ add, note, listRef, className, children, ...rest }) {
1067
+ return /* @__PURE__ */ jsxs("div", {
1068
+ "data-slot": "kit-item-card",
1069
+ 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),
1070
+ ...rest,
1071
+ children: [
1072
+ /* @__PURE__ */ jsx("div", {
1073
+ ref: listRef,
1074
+ role: "list",
1075
+ "data-slot": "kit-item-list",
1076
+ className: "flex min-w-0 flex-col",
1077
+ children
1078
+ }),
1079
+ add,
1080
+ note
1081
+ ]
1082
+ });
1083
+ }
1084
+ var 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";
1085
+ var 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";
1086
+ var 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";
1087
+ var ITEM_ROW_TITLE_CLASS = "truncate text-[13px] font-medium leading-[18px] tracking-[-0.1625px] text-kit-insp-ink";
1088
+ var ITEM_ROW_SUB_CLASS = "truncate text-[11.5px] leading-[14px] text-kit-insp-sub";
1089
+ /** 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
1090
+ * sub-line, ⋯ 28. Hover greys the row; `over` draws the drop line; `dragging` fades it. */
1091
+ function ItemRow({ title, sub, empty, onOpen, openLabel, grip, leading, tag, meta, more, compact, dragging, over, error, selected, className, ...rest }) {
1092
+ const text = /* @__PURE__ */ jsxs("span", {
1093
+ className: cn("flex min-w-0 flex-col px-1.5 py-1", compact ? "flex-initial" : "flex-1"),
1094
+ children: [/* @__PURE__ */ jsx("b", {
1095
+ className: cn(ITEM_ROW_TITLE_CLASS, error && "text-kit-insp-delete-fg"),
1096
+ children: title
1097
+ }), sub || empty ? /* @__PURE__ */ jsx("small", {
1098
+ className: cn(ITEM_ROW_SUB_CLASS, !sub && "text-kit-insp-faint"),
1099
+ children: sub || empty
1100
+ }) : null]
1101
+ });
1102
+ return /* @__PURE__ */ jsxs("div", {
1103
+ role: "listitem",
1104
+ "data-slot": "kit-item-row",
1105
+ "data-selected": selected || void 0,
1106
+ 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),
1107
+ ...rest,
1108
+ children: [
1109
+ grip === false || grip === void 0 ? null : /* @__PURE__ */ jsx("button", {
1110
+ type: "button",
1111
+ "aria-label": "Drag to reorder",
1112
+ title: "Drag to reorder",
1113
+ ...grip,
1114
+ className: cn(ITEM_ROW_GRIP_CLASS, FOCUS, grip.className),
1115
+ children: /* @__PURE__ */ jsx(IconGripVertical, {
1116
+ "aria-hidden": true,
1117
+ className: "size-4",
1118
+ stroke: 1.6
1119
+ })
1120
+ }),
1121
+ onOpen ? /* @__PURE__ */ jsxs("button", {
1122
+ type: "button",
1123
+ onClick: onOpen,
1124
+ "aria-label": openLabel,
1125
+ className: cn("flex h-[38px] min-w-0 flex-1 items-center gap-2 rounded-[6px] text-left", FOCUS),
1126
+ children: [leading, text]
1127
+ }) : /* @__PURE__ */ jsxs("span", {
1128
+ className: "flex h-[38px] min-w-0 flex-1 items-center gap-2",
1129
+ children: [leading, text]
1130
+ }),
1131
+ tag ? /* @__PURE__ */ jsx("span", {
1132
+ 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",
1133
+ children: tag
1134
+ }) : null,
1135
+ meta ? /* @__PURE__ */ jsx("span", {
1136
+ className: "shrink-0 whitespace-nowrap pr-1.5 text-[11.5px] text-kit-insp-sub",
1137
+ children: meta
1138
+ }) : null,
1139
+ more
1140
+ ]
1141
+ });
1142
+ }
1143
+ /** A plain ⋯ button for an ItemRow whose menu the host opens itself. */
1144
+ function ItemRowMore({ label, className, ...rest }) {
1145
+ return /* @__PURE__ */ jsx("button", {
1146
+ type: "button",
1147
+ "aria-label": label,
1148
+ "aria-haspopup": "menu",
1149
+ ...rest,
1150
+ className: cn(ITEM_ROW_MORE_CLASS, FOCUS, className),
1151
+ children: /* @__PURE__ */ jsx(IconDots, {
1152
+ "aria-hidden": true,
1153
+ className: "size-4",
1154
+ stroke: 1.6
1155
+ })
1156
+ });
1157
+ }
1158
+ var ITEM_LIST_ADD_CLASS = "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";
1159
+ /** The Add button inside the card (styles.css:215-217, faq.css:96-97, page.css:11): full width, 40 high. */
1160
+ function ItemListAdd({ className, children, ...rest }) {
1161
+ return /* @__PURE__ */ jsx("button", {
1162
+ type: "button",
1163
+ "data-slot": "kit-item-add",
1164
+ ...rest,
1165
+ className: cn(ITEM_LIST_ADD_CLASS, FOCUS, className),
1166
+ children
1167
+ });
1168
+ }
1169
+ /** The card's note line, in the prototype's words (inspector.jsx:254): "3 of 6 questions. Drag to reorder." ·
1170
+ * "6 of 6 questions. Remove one to add another." · "3 questions. Drag to reorder." */
1171
+ function itemListNote(count, noun, max, opts) {
1172
+ const tail = opts?.sortable === false ? "" : " Drag to reorder.";
1173
+ if (max != null) return `${count} of ${max} ${noun}s.${count >= max ? " Remove one to add another." : tail}`;
1174
+ return `${count} ${noun}${count === 1 ? "" : "s"}.${tail}`;
1175
+ }
1176
+ /** The note under the Add button (styles.css:218): 12/18, 4 padding. */
1177
+ function ItemListNote({ className, children, ...rest }) {
1178
+ return /* @__PURE__ */ jsx("p", {
1179
+ "data-slot": "kit-item-note",
1180
+ className: cn("m-0 p-1 text-[12px] leading-[18px] tracking-[-0.15px] text-kit-insp-note", className),
1181
+ ...rest,
1182
+ children
1183
+ });
1184
+ }
1185
+ var ITEM_DELETE_CLASS = "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";
1186
+ /**
1187
+ * The red "Delete <noun>" that ends an item screen (inspector.jsx:663, faq.css:48-49, kit.css:183). When it cannot run
1188
+ * (the list is at its minimum) pass `reason`: the button is disabled and the reason is its title and description.
1189
+ */
1190
+ function ItemDeleteButton({ noun, reason, icon, className, children, ...rest }) {
1191
+ const id = React.useId();
1192
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("button", {
1193
+ type: "button",
1194
+ "data-slot": "kit-item-delete",
1195
+ disabled: !!reason || rest.disabled,
1196
+ title: reason,
1197
+ "aria-describedby": reason ? id : void 0,
1198
+ ...rest,
1199
+ className: cn(ITEM_DELETE_CLASS, FOCUS, className),
1200
+ children: [icon, children ?? `Delete ${noun ?? "item"}`]
1201
+ }), reason ? /* @__PURE__ */ jsx("span", {
1202
+ id,
1203
+ className: "sr-only",
1204
+ children: reason
1205
+ }) : null] });
1206
+ }
1207
+ /** The quiet ⓘ after a label, 16 box with a 14 glyph (kit.css:445-446), for hosts that draw their own label row. */
1208
+ function InfoGlyph({ className }) {
1209
+ return /* @__PURE__ */ jsx(IconInfoCircle, {
1210
+ "aria-hidden": true,
1211
+ className: cn("size-3.5", className),
1212
+ stroke: 1.6
1213
+ });
1214
+ }
1215
+ //#endregion
1216
+ export { ColourSelect, CountRing, FieldCounter, FieldSweep, FocusDot, GroupHeader, INSPECTOR_EASE, ITEM_DELETE_CLASS, ITEM_LIST_ADD_CLASS, ITEM_ROW_CLASS, ITEM_ROW_GRIP_CLASS, ITEM_ROW_MORE_CLASS, ITEM_ROW_SUB_CLASS, ITEM_ROW_TITLE_CLASS, InfoGlyph, InlineRow, InspectorBody, InspectorCollapse, InspectorDivider, InspectorField, InspectorFields, InspectorGroup, InspectorLocked, InspectorNote, InspectorSeg, InspectorSwitch, ItemDeleteButton, ItemListAdd, ItemListCard, ItemListNote, ItemRow, ItemRowMore, LAYOUT_GLYPHS, LayoutOpt, OVER_LIMIT_CLASS, OVER_LIMIT_EDGE_CLASS, OVER_LIMIT_SHAKE_CLASS, RollNumber, SectionHeader, SelectCompact, SelectField, StepRow, StepSlider, ToggleCard, ToggleRow, ValueSlider, counterState, itemListNote, overLimitText, useOverLimit };
1217
+
1218
+ //# sourceMappingURL=inspector.js.map