@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.
- package/dist/adapters/lossy.d.ts +4 -0
- package/dist/adapters/lossy.js +4 -0
- package/dist/adapters/lossy.js.map +1 -1
- package/dist/adapters/prod-types.d.ts +4 -0
- package/dist/adapters/prod-types.js +4 -1
- package/dist/adapters/prod-types.js.map +1 -1
- package/dist/adapters/schema.js +7 -0
- package/dist/adapters/schema.js.map +1 -1
- package/dist/context.d.ts +91 -0
- package/dist/context.js +58 -1
- package/dist/context.js.map +1 -1
- package/dist/controls/choice.d.ts +1 -1
- package/dist/controls/choice.js +21 -2
- package/dist/controls/choice.js.map +1 -1
- package/dist/controls/index.d.ts +1 -0
- package/dist/controls/index.js +3 -2
- package/dist/controls/index.js.map +1 -1
- package/dist/controls/link.d.ts +23 -2
- package/dist/controls/link.js +456 -4
- package/dist/controls/link.js.map +1 -1
- package/dist/controls/media-v16.d.ts +27 -0
- package/dist/controls/media-v16.js +261 -0
- package/dist/controls/media-v16.js.map +1 -0
- package/dist/controls/media.js +63 -1
- package/dist/controls/media.js.map +1 -1
- package/dist/controls/reference-services.d.ts +8 -0
- package/dist/controls/reference.js +78 -2
- package/dist/controls/reference.js.map +1 -1
- package/dist/controls/rich-text/ai-runs.d.ts +13 -0
- package/dist/controls/rich-text/ai-runs.js +71 -0
- package/dist/controls/rich-text/ai-runs.js.map +1 -0
- package/dist/controls/rich-text/block-tool.d.ts +31 -0
- package/dist/controls/rich-text/block-tool.js +62 -0
- package/dist/controls/rich-text/block-tool.js.map +1 -0
- package/dist/controls/rich-text/blocks.d.ts +6 -1
- package/dist/controls/rich-text/blocks.js +406 -24
- package/dist/controls/rich-text/blocks.js.map +1 -1
- package/dist/controls/rich-text/catalog.d.ts +45 -7
- package/dist/controls/rich-text/catalog.js +507 -37
- package/dist/controls/rich-text/catalog.js.map +1 -1
- package/dist/controls/rich-text/code-head.d.ts +30 -0
- package/dist/controls/rich-text/code-head.js +230 -0
- package/dist/controls/rich-text/code-head.js.map +1 -0
- package/dist/controls/rich-text/codec.d.ts +1 -1
- package/dist/controls/rich-text/codec.js +4 -1
- package/dist/controls/rich-text/codec.js.map +1 -1
- package/dist/controls/rich-text/dom.d.ts +27 -0
- package/dist/controls/rich-text/dom.js +77 -7
- package/dist/controls/rich-text/dom.js.map +1 -1
- package/dist/controls/rich-text/editor.js +243 -55
- package/dist/controls/rich-text/editor.js.map +1 -1
- package/dist/controls/rich-text/ops.js +1 -0
- package/dist/controls/rich-text/ops.js.map +1 -1
- package/dist/controls/rich-text/rewriteSelection.d.ts +25 -0
- package/dist/controls/rich-text/rewriteSelection.js +28 -0
- package/dist/controls/rich-text/rewriteSelection.js.map +1 -0
- package/dist/controls/rich-text/slash-preview.d.ts +8 -0
- package/dist/controls/rich-text/slash-preview.js +300 -0
- package/dist/controls/rich-text/slash-preview.js.map +1 -0
- package/dist/controls/rich-text/table-grid.d.ts +22 -0
- package/dist/controls/rich-text/table-grid.js +1057 -0
- package/dist/controls/rich-text/table-grid.js.map +1 -0
- package/dist/controls/rich-text/toolbar.js +61 -18
- package/dist/controls/rich-text/toolbar.js.map +1 -1
- package/dist/controls/text.d.ts +6 -0
- package/dist/controls/text.js +95 -5
- package/dist/controls/text.js.map +1 -1
- package/dist/core/facets.d.ts +1 -0
- package/dist/core/facets.js +1 -0
- package/dist/core/facets.js.map +1 -1
- package/dist/engine/array.d.ts +7 -0
- package/dist/engine/array.js +164 -45
- package/dist/engine/array.js.map +1 -1
- package/dist/engine/field-shell.d.ts +12 -0
- package/dist/engine/field-shell.js +222 -64
- package/dist/engine/field-shell.js.map +1 -1
- package/dist/engine/frame.js +42 -4
- package/dist/engine/frame.js.map +1 -1
- package/dist/engine/grouping.d.ts +71 -10
- package/dist/engine/grouping.js +227 -29
- package/dist/engine/grouping.js.map +1 -1
- package/dist/engine/item-list.js +2 -2
- package/dist/engine/item-list.js.map +1 -1
- package/dist/engine/kit-field.js +38 -4
- package/dist/engine/kit-field.js.map +1 -1
- package/dist/engine/schema-form.d.ts +2 -0
- package/dist/engine/schema-form.js +9 -2
- package/dist/engine/schema-form.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +13 -6
- package/dist/index.js.map +1 -1
- package/dist/kit.css +59 -0
- package/dist/lib/reduced-motion.d.ts +1 -0
- package/dist/lib/reduced-motion.js +19 -0
- package/dist/lib/reduced-motion.js.map +1 -0
- package/dist/schema/table.d.ts +2 -1
- package/dist/schema/table.js +5 -0
- package/dist/schema/table.js.map +1 -1
- package/dist/schema/types.d.ts +6 -0
- package/dist/schema/types.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme.css +215 -0
- package/dist/tokens.css +274 -0
- package/dist/ui/block-icon-picker.d.ts +38 -0
- package/dist/ui/block-icon-picker.js +141 -0
- package/dist/ui/block-icon-picker.js.map +1 -0
- package/dist/ui/button.js +1 -0
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/code-language-menu.d.ts +24 -0
- package/dist/ui/code-language-menu.js +123 -0
- package/dist/ui/code-language-menu.js.map +1 -0
- package/dist/ui/content-fields.d.ts +47 -0
- package/dist/ui/content-fields.js +279 -0
- package/dist/ui/content-fields.js.map +1 -0
- package/dist/ui/controls.js +3 -2
- package/dist/ui/controls.js.map +1 -1
- package/dist/ui/floating-panel.js +3 -2
- package/dist/ui/floating-panel.js.map +1 -1
- package/dist/ui/foundations.d.ts +118 -0
- package/dist/ui/foundations.js +565 -0
- package/dist/ui/foundations.js.map +1 -0
- package/dist/ui/index.d.ts +6 -0
- package/dist/ui/index.js +7 -1
- package/dist/ui/inspector.d.ts +412 -0
- package/dist/ui/inspector.js +1218 -0
- package/dist/ui/inspector.js.map +1 -0
- package/dist/ui/overlay.d.ts +7 -2
- package/dist/ui/overlay.js +55 -20
- package/dist/ui/overlay.js.map +1 -1
- package/dist/ui/shortcut-hint.js +1 -1
- package/dist/ui/shortcut-hint.js.map +1 -1
- package/dist/ui/tab.js +3 -2
- package/dist/ui/tab.js.map +1 -1
- package/dist/ui/toast.d.ts +5 -3
- package/dist/ui/toast.js +83 -11
- package/dist/ui/toast.js.map +1 -1
- package/dist/ui/tooltip-card.d.ts +45 -0
- package/dist/ui/tooltip-card.js +135 -0
- package/dist/ui/tooltip-card.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,565 @@
|
|
|
1
|
+
import { cn } from "../lib/cn.js";
|
|
2
|
+
import { useKitReducedMotion } from "../lib/reduced-motion.js";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { motion } from "framer-motion";
|
|
6
|
+
import { createPortal } from "react-dom";
|
|
7
|
+
//#region src/ui/foundations.tsx
|
|
8
|
+
/**
|
|
9
|
+
* FOUNDATIONS · V1.6 (prototype editor-v16 `Btn`, `Checkbox`, `StatusIcon`, `Badge`, `ProBadge`, `TextField`, `Popover`,
|
|
10
|
+
* `ButtonStylePicker`, `SearchClear`, save status; kit.jsx:9-43, 255-296; ui.jsx:332-345, 393-398; foundations.css;
|
|
11
|
+
* kit.css:112-131; shellx.css:2-16, 199-204; faq.css:99-101).
|
|
12
|
+
*
|
|
13
|
+
* New names, so nothing of the stock kit changes: the kit's own `Button`, `Checkbox`, `Badge` and `Input` stay as they
|
|
14
|
+
* are. Colours are `--kit-insp-*` tokens (tokens.css). Every part is presentational: the host owns the state.
|
|
15
|
+
*
|
|
16
|
+
* <FoundationButton variant size icon> primary (ink) or secondary (grey), 28 / 32 / 34 high
|
|
17
|
+
* <FoundationCheckbox on mixed onChange label> 16, radius 4, violet when on, a dash when mixed
|
|
18
|
+
* <StatusIcon kind size> a 10% tint disc with a tick or an exclamation mark
|
|
19
|
+
* <FoundationBadge tone dot size> 20 (24) high tag with a 5 tone dot
|
|
20
|
+
* <ProBadge /> <BcmsMark size /> the white "PRO" pill with the gradient mark
|
|
21
|
+
* <FoundationTextField icon error /> 34 high grey field, violet focus ring, red edge on error
|
|
22
|
+
* <SearchClear show onClear /> the 16 round × that fades in when a search field has text
|
|
23
|
+
* <SaveStatus state onRetry /> Saved · Saving… · Couldn’t save · Retry · Offline
|
|
24
|
+
* <InspectorPopover anchor onClose label> anchored panel: 6 under the anchor, flips above, 8 from the edges
|
|
25
|
+
* <ButtonStylePicker anchor value onPick> "Button style": five radio rows with a live button preview
|
|
26
|
+
*/
|
|
27
|
+
var FOCUS_HALO = "focus-visible:shadow-[0_0_0_3px_color-mix(in_srgb,var(--kit-insp-accent)_30%,transparent)]";
|
|
28
|
+
var FoundationButton = React.forwardRef(function FoundationButton({ variant = "primary", size = "md", icon, className, children, type = "button", ...rest }, ref) {
|
|
29
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
30
|
+
ref,
|
|
31
|
+
type,
|
|
32
|
+
"data-slot": "kit-fbtn",
|
|
33
|
+
className: cn("inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-[6px] font-medium outline-none transition-[background-color,color,opacity] duration-150", size === "sm" ? "h-7 px-2.5 text-[12px]" : size === "lg" ? "h-[34px] px-3.5 text-[13px]" : "h-8 px-3 text-[13px]", variant === "primary" ? "bg-kit-insp-tip-title text-kit-insp-tip-bg enabled:hover:bg-kit-insp-ink disabled:opacity-35" : "bg-kit-insp-card text-kit-insp-tip-title enabled:hover:bg-kit-insp-divider disabled:text-kit-insp-faint", FOCUS_HALO, className),
|
|
34
|
+
...rest,
|
|
35
|
+
children: [icon, children]
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
function FoundationCheckbox({ on, mixed, disabled, onChange, label, className, "aria-labelledby": labelledBy }) {
|
|
39
|
+
const filled = !!on || !!mixed;
|
|
40
|
+
return /* @__PURE__ */ jsx("button", {
|
|
41
|
+
type: "button",
|
|
42
|
+
role: "checkbox",
|
|
43
|
+
"aria-checked": mixed ? "mixed" : !!on,
|
|
44
|
+
"aria-label": label,
|
|
45
|
+
"aria-labelledby": labelledBy,
|
|
46
|
+
disabled,
|
|
47
|
+
"data-slot": "kit-fcb",
|
|
48
|
+
onClick: (e) => {
|
|
49
|
+
e.stopPropagation();
|
|
50
|
+
onChange?.(!on);
|
|
51
|
+
},
|
|
52
|
+
className: cn("grid size-4 shrink-0 place-items-center rounded-[4px] outline-none transition-[background-color,box-shadow] duration-150 disabled:cursor-not-allowed disabled:opacity-40", filled ? "bg-kit-insp-accent-fg focus-visible:shadow-[0_0_0_3px_color-mix(in_srgb,var(--kit-insp-accent-fg)_20%,transparent)]" : "bg-kit-insp-tip-bg shadow-[inset_0_0_0_1.5px_var(--kit-insp-line-strong)] focus-visible:shadow-[0_0_0_3px_color-mix(in_srgb,var(--kit-insp-accent-fg)_20%,transparent),inset_0_0_0_1.5px_var(--kit-insp-line-strong)]", className),
|
|
53
|
+
children: filled ? /* @__PURE__ */ jsx("svg", {
|
|
54
|
+
width: "16",
|
|
55
|
+
height: "16",
|
|
56
|
+
viewBox: "0 0 16 16",
|
|
57
|
+
fill: "none",
|
|
58
|
+
"aria-hidden": true,
|
|
59
|
+
children: mixed ? /* @__PURE__ */ jsx("path", {
|
|
60
|
+
d: "M4.5 8h7",
|
|
61
|
+
stroke: "#fff",
|
|
62
|
+
strokeWidth: "1.8",
|
|
63
|
+
strokeLinecap: "round"
|
|
64
|
+
}) : /* @__PURE__ */ jsx("path", {
|
|
65
|
+
d: "M3.6 8.3l2.7 2.7l6-6.2",
|
|
66
|
+
stroke: "#fff",
|
|
67
|
+
strokeWidth: "1.8",
|
|
68
|
+
strokeLinecap: "round",
|
|
69
|
+
strokeLinejoin: "round"
|
|
70
|
+
})
|
|
71
|
+
}) : null
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function StatusIcon({ kind = "success", size = 14, className }) {
|
|
75
|
+
const tint = kind === "success" ? "var(--kit-insp-ok-tint)" : "var(--kit-insp-err-tint)";
|
|
76
|
+
const ink = kind === "success" ? "var(--kit-insp-ok)" : "var(--kit-insp-err)";
|
|
77
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
78
|
+
width: size,
|
|
79
|
+
height: size,
|
|
80
|
+
viewBox: "0 0 14 14",
|
|
81
|
+
fill: "none",
|
|
82
|
+
"aria-hidden": true,
|
|
83
|
+
className: cn("shrink-0", className),
|
|
84
|
+
children: [/* @__PURE__ */ jsx("circle", {
|
|
85
|
+
cx: "7",
|
|
86
|
+
cy: "7",
|
|
87
|
+
r: "7",
|
|
88
|
+
fill: tint
|
|
89
|
+
}), kind === "success" ? /* @__PURE__ */ jsx("path", {
|
|
90
|
+
d: "M4.4 7.2 6.2 9 9.7 5.3",
|
|
91
|
+
stroke: ink,
|
|
92
|
+
strokeWidth: "1.6",
|
|
93
|
+
strokeLinecap: "round",
|
|
94
|
+
strokeLinejoin: "round"
|
|
95
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", {
|
|
96
|
+
d: "M7 4.2v3.4",
|
|
97
|
+
stroke: ink,
|
|
98
|
+
strokeWidth: "1.6",
|
|
99
|
+
strokeLinecap: "round"
|
|
100
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
101
|
+
d: "M7 9.8h.01",
|
|
102
|
+
stroke: ink,
|
|
103
|
+
strokeWidth: "1.9",
|
|
104
|
+
strokeLinecap: "round"
|
|
105
|
+
})] })]
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
var BADGE_TONE = {
|
|
109
|
+
gray: {
|
|
110
|
+
box: "bg-kit-insp-card text-kit-insp-tip-body",
|
|
111
|
+
dot: "bg-kit-group-sub"
|
|
112
|
+
},
|
|
113
|
+
green: {
|
|
114
|
+
box: "bg-[var(--kit-insp-badge-green)] text-[var(--kit-insp-badge-green-fg)]",
|
|
115
|
+
dot: "bg-[var(--kit-insp-badge-green-dot)]"
|
|
116
|
+
},
|
|
117
|
+
amber: {
|
|
118
|
+
box: "bg-[var(--kit-insp-badge-amber)] text-kit-insp-count-near",
|
|
119
|
+
dot: "bg-[var(--kit-insp-badge-amber-dot)]"
|
|
120
|
+
},
|
|
121
|
+
red: {
|
|
122
|
+
box: "bg-kit-insp-delete-bg text-kit-insp-count-over",
|
|
123
|
+
dot: "bg-kit-insp-ring-over"
|
|
124
|
+
},
|
|
125
|
+
blue: {
|
|
126
|
+
box: "bg-kit-insp-card text-kit-insp-tip-body",
|
|
127
|
+
dot: "bg-[var(--kit-insp-badge-blue-dot)]"
|
|
128
|
+
},
|
|
129
|
+
violet: {
|
|
130
|
+
box: "bg-kit-insp-card text-kit-insp-tip-body",
|
|
131
|
+
dot: "bg-kit-insp-accent"
|
|
132
|
+
},
|
|
133
|
+
outline: {
|
|
134
|
+
box: "bg-kit-insp-tip-bg text-kit-insp-tip-body shadow-[inset_0_0_0_1px_var(--kit-insp-line)]",
|
|
135
|
+
dot: "bg-kit-group-sub"
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
function FoundationBadge({ tone = "gray", dot = true, size = "sm", className, children }) {
|
|
139
|
+
const t = BADGE_TONE[tone];
|
|
140
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
141
|
+
"data-slot": "kit-fbadge",
|
|
142
|
+
className: cn("inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap text-[12px] font-medium leading-4", size === "md" ? "h-6 rounded-[6px] pl-2 pr-2.5" : "h-5 rounded-[4px] pl-1.5 pr-2", t.box, className),
|
|
143
|
+
children: [dot ? /* @__PURE__ */ jsx("i", {
|
|
144
|
+
"aria-hidden": true,
|
|
145
|
+
className: cn("size-[5px] rounded-full", t.dot)
|
|
146
|
+
}) : null, children]
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
function BcmsMark({ size = 10 }) {
|
|
150
|
+
const id = React.useId();
|
|
151
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
152
|
+
width: size,
|
|
153
|
+
height: size * 28 / 24,
|
|
154
|
+
viewBox: "0 0 24 28",
|
|
155
|
+
fill: "none",
|
|
156
|
+
"aria-hidden": true,
|
|
157
|
+
children: [
|
|
158
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", {
|
|
159
|
+
id,
|
|
160
|
+
x1: "8.8",
|
|
161
|
+
y1: "-2.8",
|
|
162
|
+
x2: "18.9",
|
|
163
|
+
y2: "29.1",
|
|
164
|
+
gradientUnits: "userSpaceOnUse",
|
|
165
|
+
children: [
|
|
166
|
+
/* @__PURE__ */ jsx("stop", {
|
|
167
|
+
offset: ".08",
|
|
168
|
+
stopColor: "#A878D2"
|
|
169
|
+
}),
|
|
170
|
+
/* @__PURE__ */ jsx("stop", {
|
|
171
|
+
offset: ".48",
|
|
172
|
+
stopColor: "#ED6262"
|
|
173
|
+
}),
|
|
174
|
+
/* @__PURE__ */ jsx("stop", {
|
|
175
|
+
offset: ".92",
|
|
176
|
+
stopColor: "#D13A3A"
|
|
177
|
+
})
|
|
178
|
+
]
|
|
179
|
+
}) }),
|
|
180
|
+
/* @__PURE__ */ jsx("path", {
|
|
181
|
+
fill: `url(#${id})`,
|
|
182
|
+
d: "M12.76 27L1.51 20.09A3.1 3.1 0 0 1 0 17.4V8.6c0-1.15.62-2.21 1.63-2.77L9.59 1.4a3.2 3.2 0 0 1 2.92-.09l11.32 5.43-9.48 5.42a2.8 2.8 0 0 0-1.6 2.75V27z"
|
|
183
|
+
}),
|
|
184
|
+
/* @__PURE__ */ jsx("path", {
|
|
185
|
+
fill: `url(#${id})`,
|
|
186
|
+
d: "M14.34 16.02v2.85l7.88-5.01c.91-.58 1.47-1.59 1.47-2.67V8.3l-7.89 5.06a3.2 3.2 0 0 0-1.46 2.66zM14.34 22.26v2.85l7.88-5.01c.91-.58 1.47-1.59 1.47-2.67v-2.89l-7.89 5.06a3.2 3.2 0 0 0-1.46 2.66z"
|
|
187
|
+
})
|
|
188
|
+
]
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
function ProBadge({ className }) {
|
|
192
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
193
|
+
"data-slot": "kit-fpro",
|
|
194
|
+
className: cn("inline-flex h-5 shrink-0 items-center gap-1 rounded-full bg-kit-insp-tip-bg pl-[5px] pr-[7px] text-[10px] font-semibold leading-3 text-kit-insp-tip-body shadow-[inset_0_0_0_1px_var(--kit-insp-line)]", className),
|
|
195
|
+
children: [/* @__PURE__ */ jsx(BcmsMark, { size: 10 }), "PRO"]
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
var FoundationTextField = React.forwardRef(function FoundationTextField({ icon, error, trailing, boxClassName, className, ...rest }, ref) {
|
|
199
|
+
return /* @__PURE__ */ jsxs("label", {
|
|
200
|
+
"data-slot": "kit-fin",
|
|
201
|
+
className: cn("flex h-[34px] min-w-0 flex-1 items-center gap-2 rounded-[6px] px-2.5 text-kit-insp-faint transition-[background-color,box-shadow] duration-150 [&>svg]:size-4 [&>svg]:shrink-0", error ? "bg-kit-insp-tip-bg shadow-[inset_0_0_0_1px_var(--kit-insp-error)]" : "bg-kit-insp-card focus-within:bg-kit-insp-tip-bg focus-within:shadow-[inset_0_0_0_1px_var(--kit-insp-accent),0_0_0_3px_color-mix(in_srgb,var(--kit-insp-accent)_15%,transparent)]", boxClassName),
|
|
202
|
+
children: [
|
|
203
|
+
icon,
|
|
204
|
+
/* @__PURE__ */ jsx("input", {
|
|
205
|
+
ref,
|
|
206
|
+
"aria-invalid": error || void 0,
|
|
207
|
+
className: cn("h-full min-w-0 flex-1 border-0 bg-transparent text-[13px] text-kit-insp-tip-title outline-none placeholder:text-kit-group-sub focus-visible:shadow-none", className),
|
|
208
|
+
...rest
|
|
209
|
+
}),
|
|
210
|
+
trailing
|
|
211
|
+
]
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
/** Out of the tab order: Escape clears from the keyboard (the field's owner handles it). */
|
|
215
|
+
function SearchClear({ show, onClear, className }) {
|
|
216
|
+
return /* @__PURE__ */ jsx("button", {
|
|
217
|
+
type: "button",
|
|
218
|
+
tabIndex: -1,
|
|
219
|
+
"aria-label": "Clear search",
|
|
220
|
+
"aria-hidden": !show || void 0,
|
|
221
|
+
"data-slot": "kit-search-clear",
|
|
222
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
223
|
+
onClick: onClear,
|
|
224
|
+
className: cn("grid size-4 shrink-0 place-items-center rounded-full bg-kit-insp-chip text-kit-insp-label transition-[opacity,transform] duration-150 ease-out hover:bg-[var(--kit-insp-chip-hover)]", show ? "opacity-100" : "pointer-events-none scale-50 opacity-0", className),
|
|
225
|
+
children: /* @__PURE__ */ jsx("svg", {
|
|
226
|
+
width: "10",
|
|
227
|
+
height: "10",
|
|
228
|
+
viewBox: "0 0 24 24",
|
|
229
|
+
fill: "none",
|
|
230
|
+
stroke: "currentColor",
|
|
231
|
+
strokeWidth: "2.2",
|
|
232
|
+
strokeLinecap: "round",
|
|
233
|
+
"aria-hidden": true,
|
|
234
|
+
children: /* @__PURE__ */ jsx("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
235
|
+
})
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
var SAVE_COPY = {
|
|
239
|
+
saved: {
|
|
240
|
+
label: "Saved",
|
|
241
|
+
title: "All changes saved"
|
|
242
|
+
},
|
|
243
|
+
saving: { label: "Saving…" },
|
|
244
|
+
error: {
|
|
245
|
+
label: "Couldn’t save · Retry",
|
|
246
|
+
title: "Your latest changes didn’t reach the server. Try again"
|
|
247
|
+
},
|
|
248
|
+
offline: { label: "Offline · changes kept on this device" }
|
|
249
|
+
};
|
|
250
|
+
var SAVE_BOX = "inline-flex h-7 min-w-0 items-center gap-[5px] whitespace-nowrap rounded-[6px] px-1.5 text-[12px] font-medium leading-[18px]";
|
|
251
|
+
/**
|
|
252
|
+
* The save status chip. `error` makes the whole chip the Retry button. `savedTitle` overrides the hover text of Saved
|
|
253
|
+
* (the prototype's reads "All changes saved to main": the branch is the host's to name).
|
|
254
|
+
*/
|
|
255
|
+
function SaveStatus({ state, onRetry, savedTitle, className }) {
|
|
256
|
+
const copy = SAVE_COPY[state];
|
|
257
|
+
const glyph = /* @__PURE__ */ jsx("span", {
|
|
258
|
+
"aria-hidden": true,
|
|
259
|
+
className: cn("relative grid h-3.5 shrink-0 place-items-center transition-[width] duration-150", state === "error" ? "w-[18px]" : "w-3.5"),
|
|
260
|
+
children: state === "saving" ? /* @__PURE__ */ jsxs("svg", {
|
|
261
|
+
width: "14",
|
|
262
|
+
height: "14",
|
|
263
|
+
viewBox: "0 0 14 14",
|
|
264
|
+
fill: "none",
|
|
265
|
+
className: "animate-spin [animation-duration:0.8s] motion-reduce:animate-none",
|
|
266
|
+
children: [/* @__PURE__ */ jsx("circle", {
|
|
267
|
+
cx: "7",
|
|
268
|
+
cy: "7",
|
|
269
|
+
r: "5.25",
|
|
270
|
+
stroke: "currentColor",
|
|
271
|
+
strokeOpacity: "0.25",
|
|
272
|
+
strokeWidth: "1.5"
|
|
273
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
274
|
+
d: "M12.25 7A5.25 5.25 0 0 0 7 1.75",
|
|
275
|
+
stroke: "currentColor",
|
|
276
|
+
strokeWidth: "1.5",
|
|
277
|
+
strokeLinecap: "round"
|
|
278
|
+
})]
|
|
279
|
+
}) : state === "error" ? /* @__PURE__ */ jsx("svg", {
|
|
280
|
+
width: "18",
|
|
281
|
+
height: "16",
|
|
282
|
+
viewBox: "0 0 24 24",
|
|
283
|
+
fill: "none",
|
|
284
|
+
stroke: "currentColor",
|
|
285
|
+
strokeWidth: "1.8",
|
|
286
|
+
strokeLinecap: "round",
|
|
287
|
+
strokeLinejoin: "round",
|
|
288
|
+
children: /* @__PURE__ */ jsx("path", { d: "M7 18a4.6 4.4 0 0 1 0-9 5 4.5 0 0 1 11 2h1a3.5 3.5 0 0 1 0 7H7M12 11v3M12 16.5h.01" })
|
|
289
|
+
}) : state === "offline" ? /* @__PURE__ */ jsx("svg", {
|
|
290
|
+
width: "14",
|
|
291
|
+
height: "14",
|
|
292
|
+
viewBox: "0 0 24 24",
|
|
293
|
+
fill: "none",
|
|
294
|
+
stroke: "currentColor",
|
|
295
|
+
strokeWidth: "1.8",
|
|
296
|
+
strokeLinecap: "round",
|
|
297
|
+
strokeLinejoin: "round",
|
|
298
|
+
children: /* @__PURE__ */ jsx("path", { d: "M3 3l18 18M9.6 5.6A5 4.5 0 0 1 18 11h1a3.5 3.5 0 0 1 2.2 6.2M16 18H7a4.6 4.4 0 0 1-1.3-8.6" })
|
|
299
|
+
}) : /* @__PURE__ */ jsx(StatusIcon, { kind: "success" })
|
|
300
|
+
});
|
|
301
|
+
const text = /* @__PURE__ */ jsx("span", {
|
|
302
|
+
className: "min-w-0 truncate",
|
|
303
|
+
children: copy.label
|
|
304
|
+
});
|
|
305
|
+
if (state === "error") return /* @__PURE__ */ jsxs("button", {
|
|
306
|
+
type: "button",
|
|
307
|
+
"data-slot": "kit-save-status",
|
|
308
|
+
"data-state": state,
|
|
309
|
+
title: copy.title,
|
|
310
|
+
onClick: onRetry,
|
|
311
|
+
className: cn(SAVE_BOX, "text-kit-insp-count-over outline-none transition-[background-color] duration-[120ms] hover:bg-kit-insp-delete-bg focus-visible:shadow-[0_0_0_2px_var(--kit-insp-tip-bg),0_0_0_4px_var(--kit-insp-accent)]", className),
|
|
312
|
+
children: [glyph, text]
|
|
313
|
+
});
|
|
314
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
315
|
+
"data-slot": "kit-save-status",
|
|
316
|
+
"data-state": state,
|
|
317
|
+
role: "status",
|
|
318
|
+
"aria-live": "polite",
|
|
319
|
+
title: state === "saved" ? savedTitle ?? copy.title : copy.title,
|
|
320
|
+
className: cn(SAVE_BOX, "text-kit-insp-desc", className),
|
|
321
|
+
children: [glyph, text]
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* A panel on an anchor element: in a portal, 6 under the anchor (left edges aligned, or right with `align="right"`),
|
|
326
|
+
* above it when it would cross the window's bottom, never closer than 8 to the left or right edge. A press outside
|
|
327
|
+
* the panel and its anchor closes it, and so does Escape (captured, so nothing behind it also reacts).
|
|
328
|
+
*/
|
|
329
|
+
function InspectorPopover({ anchor, onClose, width = 300, align = "left", label, className, children }) {
|
|
330
|
+
const ref = React.useRef(null);
|
|
331
|
+
const reduce = useKitReducedMotion();
|
|
332
|
+
const [pos, setPos] = React.useState({
|
|
333
|
+
left: -9999,
|
|
334
|
+
top: 0,
|
|
335
|
+
origin: "top left"
|
|
336
|
+
});
|
|
337
|
+
React.useLayoutEffect(() => {
|
|
338
|
+
if (!anchor || !ref.current) return;
|
|
339
|
+
const r = anchor.getBoundingClientRect();
|
|
340
|
+
const h = ref.current.offsetHeight;
|
|
341
|
+
const left = align === "right" ? r.right - width : r.left;
|
|
342
|
+
let top = r.bottom + 6;
|
|
343
|
+
let above = false;
|
|
344
|
+
if (top + h > window.innerHeight - 8) {
|
|
345
|
+
top = Math.max(8, r.top - h - 6);
|
|
346
|
+
above = true;
|
|
347
|
+
}
|
|
348
|
+
setPos({
|
|
349
|
+
left: Math.max(8, Math.min(left, window.innerWidth - width - 8)),
|
|
350
|
+
top,
|
|
351
|
+
origin: `${above ? "bottom" : "top"} ${align}`
|
|
352
|
+
});
|
|
353
|
+
}, [
|
|
354
|
+
anchor,
|
|
355
|
+
width,
|
|
356
|
+
align
|
|
357
|
+
]);
|
|
358
|
+
const close = React.useRef(onClose);
|
|
359
|
+
close.current = onClose;
|
|
360
|
+
React.useEffect(() => {
|
|
361
|
+
const down = (e) => {
|
|
362
|
+
const t = e.target;
|
|
363
|
+
if (!ref.current?.contains(t) && !anchor?.contains(t)) close.current();
|
|
364
|
+
};
|
|
365
|
+
const key = (e) => {
|
|
366
|
+
if (e.key !== "Escape") return;
|
|
367
|
+
e.stopPropagation();
|
|
368
|
+
close.current();
|
|
369
|
+
};
|
|
370
|
+
document.addEventListener("mousedown", down);
|
|
371
|
+
document.addEventListener("keydown", key, true);
|
|
372
|
+
return () => {
|
|
373
|
+
document.removeEventListener("mousedown", down);
|
|
374
|
+
document.removeEventListener("keydown", key, true);
|
|
375
|
+
};
|
|
376
|
+
}, [anchor]);
|
|
377
|
+
if (typeof document === "undefined") return null;
|
|
378
|
+
return createPortal(/* @__PURE__ */ jsx(motion.div, {
|
|
379
|
+
ref,
|
|
380
|
+
role: "dialog",
|
|
381
|
+
"aria-label": label,
|
|
382
|
+
"data-kit-scope": "",
|
|
383
|
+
"data-floating-layer": "",
|
|
384
|
+
"data-slot": "kit-insp-popover",
|
|
385
|
+
className: cn("fixed z-[var(--kit-z-popover,84)] overflow-hidden rounded-[10px] border border-kit-insp-line bg-kit-insp-tip-bg shadow-[0_1px_1px_rgb(0_0_0/0.04),0_6px_24px_rgb(0_0_0/0.1),0_9px_48px_rgb(0_0_0/0.08)]", className),
|
|
386
|
+
style: {
|
|
387
|
+
left: pos.left,
|
|
388
|
+
top: pos.top,
|
|
389
|
+
width,
|
|
390
|
+
transformOrigin: pos.origin
|
|
391
|
+
},
|
|
392
|
+
initial: reduce ? false : {
|
|
393
|
+
opacity: 0,
|
|
394
|
+
scale: .95,
|
|
395
|
+
filter: "blur(2px)"
|
|
396
|
+
},
|
|
397
|
+
animate: {
|
|
398
|
+
opacity: 1,
|
|
399
|
+
scale: 1,
|
|
400
|
+
filter: "blur(0px)"
|
|
401
|
+
},
|
|
402
|
+
transition: {
|
|
403
|
+
duration: .15,
|
|
404
|
+
ease: "easeOut"
|
|
405
|
+
},
|
|
406
|
+
children
|
|
407
|
+
}), document.body);
|
|
408
|
+
}
|
|
409
|
+
var BUTTON_STYLES = [
|
|
410
|
+
{
|
|
411
|
+
value: "primary",
|
|
412
|
+
label: "Solid",
|
|
413
|
+
hint: "Main action"
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
value: "brand",
|
|
417
|
+
label: "Color",
|
|
418
|
+
hint: "Brand colour"
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
value: "secondary",
|
|
422
|
+
label: "Soft",
|
|
423
|
+
hint: "Quiet"
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
value: "outline",
|
|
427
|
+
label: "Outline",
|
|
428
|
+
hint: "Low emphasis"
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
value: "ghost",
|
|
432
|
+
label: "Ghost",
|
|
433
|
+
hint: "Text only"
|
|
434
|
+
}
|
|
435
|
+
];
|
|
436
|
+
/** How each style draws the preview button (the site's own button looks; `brand` is the site's brand colour). */
|
|
437
|
+
var previewStyle = (k, brand) => k === "primary" ? {
|
|
438
|
+
background: "#101010",
|
|
439
|
+
color: "#fff"
|
|
440
|
+
} : k === "brand" ? {
|
|
441
|
+
background: brand,
|
|
442
|
+
color: "#fff"
|
|
443
|
+
} : k === "secondary" ? {
|
|
444
|
+
background: "#E8E8E6",
|
|
445
|
+
color: "#101010"
|
|
446
|
+
} : k === "outline" ? {
|
|
447
|
+
background: "#fff",
|
|
448
|
+
color: "#101010",
|
|
449
|
+
borderColor: "#D4D4D2"
|
|
450
|
+
} : {
|
|
451
|
+
background: "transparent",
|
|
452
|
+
color: "#101010"
|
|
453
|
+
};
|
|
454
|
+
/**
|
|
455
|
+
* "Button style": five radio rows, each a live preview of the button in that style, its name and a hint, a check on
|
|
456
|
+
* the current one. `styles` narrows the list to what the site's button stores. The footer's "Edit" is drawn only when
|
|
457
|
+
* the host says where it goes (`onEdit`). ↑ ↓ move between rows.
|
|
458
|
+
*/
|
|
459
|
+
function ButtonStylePicker({ anchor, value, label = "Get Started", brand = "var(--kit-insp-accent-fg)", styles, onPick, onClose, onEdit, align }) {
|
|
460
|
+
const list = styles ? BUTTON_STYLES.filter((s) => styles.includes(s.value)) : BUTTON_STYLES;
|
|
461
|
+
const rows = React.useRef(null);
|
|
462
|
+
const move = (e, i) => {
|
|
463
|
+
if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
464
|
+
e.preventDefault();
|
|
465
|
+
const next = Math.max(0, Math.min(list.length - 1, i + (e.key === "ArrowDown" ? 1 : -1)));
|
|
466
|
+
rows.current?.querySelectorAll("[role=radio]")[next]?.focus();
|
|
467
|
+
};
|
|
468
|
+
return /* @__PURE__ */ jsxs(InspectorPopover, {
|
|
469
|
+
anchor,
|
|
470
|
+
onClose,
|
|
471
|
+
width: 300,
|
|
472
|
+
label: "Button style",
|
|
473
|
+
align,
|
|
474
|
+
children: [
|
|
475
|
+
/* @__PURE__ */ jsxs("div", {
|
|
476
|
+
className: "flex items-center gap-2 border-b border-kit-insp-divider px-3 py-2.5",
|
|
477
|
+
children: [
|
|
478
|
+
/* @__PURE__ */ jsx("svg", {
|
|
479
|
+
width: "14",
|
|
480
|
+
height: "14",
|
|
481
|
+
viewBox: "0 0 24 24",
|
|
482
|
+
fill: "none",
|
|
483
|
+
stroke: "currentColor",
|
|
484
|
+
strokeWidth: "1.8",
|
|
485
|
+
strokeLinecap: "round",
|
|
486
|
+
strokeLinejoin: "round",
|
|
487
|
+
"aria-hidden": true,
|
|
488
|
+
className: "shrink-0 text-kit-insp-label",
|
|
489
|
+
children: /* @__PURE__ */ jsx("path", { d: "m19 11-8-8-8.6 8.6a2 2 0 0 0 0 2.8l5.2 5.2c.8.8 2 .8 2.8 0L19 11ZM5 2l5 5M2 13h15M22 20a2 2 0 1 1-4 0c0-1.6 1.7-2.4 2-4 .3 1.6 2 2.4 2 4Z" })
|
|
490
|
+
}),
|
|
491
|
+
/* @__PURE__ */ jsx("b", {
|
|
492
|
+
className: "flex-1 text-[13px] font-medium text-kit-insp-ink",
|
|
493
|
+
children: "Button style"
|
|
494
|
+
}),
|
|
495
|
+
/* @__PURE__ */ jsx("kbd", {
|
|
496
|
+
className: "rounded-[4px] bg-[var(--kit-insp-kbd)] px-[5px] font-kit-sans text-[11px] font-medium leading-[18px] text-kit-insp-desc",
|
|
497
|
+
children: "Esc"
|
|
498
|
+
})
|
|
499
|
+
]
|
|
500
|
+
}),
|
|
501
|
+
/* @__PURE__ */ jsx("div", {
|
|
502
|
+
ref: rows,
|
|
503
|
+
role: "radiogroup",
|
|
504
|
+
"aria-label": "Button style",
|
|
505
|
+
className: "flex flex-col gap-1.5 p-2",
|
|
506
|
+
children: list.map((o, i) => {
|
|
507
|
+
const on = value === o.value;
|
|
508
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
509
|
+
type: "button",
|
|
510
|
+
role: "radio",
|
|
511
|
+
"aria-checked": on,
|
|
512
|
+
tabIndex: on || !list.some((x) => x.value === value) && i === 0 ? 0 : -1,
|
|
513
|
+
onClick: () => onPick(o.value),
|
|
514
|
+
onKeyDown: (e) => move(e, i),
|
|
515
|
+
className: cn("flex items-center gap-3 rounded-[8px] border p-2 text-left outline-none transition-[background-color,border-color] duration-[120ms] focus-visible:shadow-[0_0_0_2px_var(--kit-focus-ring)]", on ? "border-[var(--kit-insp-opt-on-line)] bg-[var(--kit-insp-opt-on)]" : "border-transparent bg-kit-insp-card-focus hover:bg-[var(--kit-insp-opt-hover)]"),
|
|
516
|
+
children: [
|
|
517
|
+
/* @__PURE__ */ jsx("span", {
|
|
518
|
+
"aria-hidden": true,
|
|
519
|
+
className: "pointer-events-none grid h-8 w-[112px] shrink-0 place-items-center truncate rounded-[6px] border border-transparent px-2 text-[12px] font-semibold leading-[18px]",
|
|
520
|
+
style: previewStyle(o.value, brand),
|
|
521
|
+
children: label
|
|
522
|
+
}),
|
|
523
|
+
/* @__PURE__ */ jsxs("span", {
|
|
524
|
+
className: "flex min-w-0 flex-1 flex-col gap-px",
|
|
525
|
+
children: [/* @__PURE__ */ jsx("b", {
|
|
526
|
+
className: "text-[13px] font-medium text-kit-insp-ink",
|
|
527
|
+
children: o.label
|
|
528
|
+
}), /* @__PURE__ */ jsx("small", {
|
|
529
|
+
className: "text-[12px] text-kit-insp-quiet",
|
|
530
|
+
children: o.hint
|
|
531
|
+
})]
|
|
532
|
+
}),
|
|
533
|
+
on ? /* @__PURE__ */ jsx("svg", {
|
|
534
|
+
width: "14",
|
|
535
|
+
height: "14",
|
|
536
|
+
viewBox: "0 0 24 24",
|
|
537
|
+
fill: "none",
|
|
538
|
+
stroke: "currentColor",
|
|
539
|
+
strokeWidth: "2",
|
|
540
|
+
strokeLinecap: "round",
|
|
541
|
+
strokeLinejoin: "round",
|
|
542
|
+
"aria-hidden": true,
|
|
543
|
+
className: "shrink-0 text-kit-insp-label",
|
|
544
|
+
children: /* @__PURE__ */ jsx("path", { d: "M5 12l5 5L20 7" })
|
|
545
|
+
}) : null
|
|
546
|
+
]
|
|
547
|
+
}, o.value);
|
|
548
|
+
})
|
|
549
|
+
}),
|
|
550
|
+
/* @__PURE__ */ jsxs("div", {
|
|
551
|
+
className: "flex items-center justify-between gap-3 border-t border-kit-insp-divider px-3 py-2.5 text-[12px] leading-[18px] text-kit-insp-quiet",
|
|
552
|
+
children: [/* @__PURE__ */ jsx("span", { children: "Styles come from the site style guide" }), onEdit ? /* @__PURE__ */ jsx("button", {
|
|
553
|
+
type: "button",
|
|
554
|
+
onClick: onEdit,
|
|
555
|
+
className: "whitespace-nowrap rounded-[4px] text-[12px] font-medium text-kit-insp-accent-fg outline-none hover:underline hover:underline-offset-2 focus-visible:shadow-[0_0_0_2px_var(--kit-focus-ring)]",
|
|
556
|
+
children: "Edit"
|
|
557
|
+
}) : null]
|
|
558
|
+
})
|
|
559
|
+
]
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
//#endregion
|
|
563
|
+
export { BUTTON_STYLES, BcmsMark, ButtonStylePicker, FoundationBadge, FoundationButton, FoundationCheckbox, FoundationTextField, InspectorPopover, ProBadge, SaveStatus, SearchClear, StatusIcon };
|
|
564
|
+
|
|
565
|
+
//# sourceMappingURL=foundations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"foundations.js","names":[],"sources":["../../src/ui/foundations.tsx"],"sourcesContent":["/**\n * FOUNDATIONS · V1.6 (prototype editor-v16 `Btn`, `Checkbox`, `StatusIcon`, `Badge`, `ProBadge`, `TextField`, `Popover`,\n * `ButtonStylePicker`, `SearchClear`, save status; kit.jsx:9-43, 255-296; ui.jsx:332-345, 393-398; foundations.css;\n * kit.css:112-131; shellx.css:2-16, 199-204; faq.css:99-101).\n *\n * New names, so nothing of the stock kit changes: the kit's own `Button`, `Checkbox`, `Badge` and `Input` stay as they\n * are. Colours are `--kit-insp-*` tokens (tokens.css). Every part is presentational: the host owns the state.\n *\n * <FoundationButton variant size icon> primary (ink) or secondary (grey), 28 / 32 / 34 high\n * <FoundationCheckbox on mixed onChange label> 16, radius 4, violet when on, a dash when mixed\n * <StatusIcon kind size> a 10% tint disc with a tick or an exclamation mark\n * <FoundationBadge tone dot size> 20 (24) high tag with a 5 tone dot\n * <ProBadge /> <BcmsMark size /> the white \"PRO\" pill with the gradient mark\n * <FoundationTextField icon error /> 34 high grey field, violet focus ring, red edge on error\n * <SearchClear show onClear /> the 16 round × that fades in when a search field has text\n * <SaveStatus state onRetry /> Saved · Saving… · Couldn’t save · Retry · Offline\n * <InspectorPopover anchor onClose label> anchored panel: 6 under the anchor, flips above, 8 from the edges\n * <ButtonStylePicker anchor value onPick> \"Button style\": five radio rows with a live button preview\n */\nimport * as React from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { motion } from \"framer-motion\";\nimport { cn } from \"../lib/cn\";\nimport { useKitReducedMotion } from \"../lib/reduced-motion\";\n\nconst FOCUS_HALO = \"focus-visible:shadow-[0_0_0_3px_color-mix(in_srgb,var(--kit-insp-accent)_30%,transparent)]\";\n\n/* ── Button (F1569) ───────────────────────────────────────────────── */\nexport interface FoundationButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: \"primary\" | \"secondary\";\n /** sm 28 · md 32 (default) · lg 34, beside a 34 high field */\n size?: \"sm\" | \"md\" | \"lg\";\n icon?: React.ReactNode;\n}\nexport const FoundationButton = React.forwardRef<HTMLButtonElement, FoundationButtonProps>(function FoundationButton(\n { variant = \"primary\", size = \"md\", icon, className, children, type = \"button\", ...rest },\n ref,\n) {\n return (\n <button\n ref={ref}\n type={type}\n data-slot=\"kit-fbtn\"\n className={cn(\n \"inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-[6px] font-medium outline-none transition-[background-color,color,opacity] duration-150\",\n size === \"sm\" ? \"h-7 px-2.5 text-[12px]\" : size === \"lg\" ? \"h-[34px] px-3.5 text-[13px]\" : \"h-8 px-3 text-[13px]\",\n variant === \"primary\"\n ? \"bg-kit-insp-tip-title text-kit-insp-tip-bg enabled:hover:bg-kit-insp-ink disabled:opacity-35\"\n : \"bg-kit-insp-card text-kit-insp-tip-title enabled:hover:bg-kit-insp-divider disabled:text-kit-insp-faint\",\n FOCUS_HALO,\n className,\n )}\n {...rest}\n >\n {icon}\n {children}\n </button>\n );\n});\n\n/* ── Checkbox (F1570) ─────────────────────────────────────────────── */\nexport function FoundationCheckbox({\n on, mixed, disabled, onChange, label, className, \"aria-labelledby\": labelledBy,\n}: { on?: boolean; mixed?: boolean; disabled?: boolean; onChange?: (on: boolean) => void; label?: string; className?: string; \"aria-labelledby\"?: string }) {\n const filled = !!on || !!mixed;\n return (\n <button\n type=\"button\"\n role=\"checkbox\"\n aria-checked={mixed ? \"mixed\" : !!on}\n aria-label={label}\n aria-labelledby={labelledBy}\n disabled={disabled}\n data-slot=\"kit-fcb\"\n onClick={(e) => {\n e.stopPropagation();\n onChange?.(!on);\n }}\n className={cn(\n \"grid size-4 shrink-0 place-items-center rounded-[4px] outline-none transition-[background-color,box-shadow] duration-150 disabled:cursor-not-allowed disabled:opacity-40\",\n filled\n ? \"bg-kit-insp-accent-fg focus-visible:shadow-[0_0_0_3px_color-mix(in_srgb,var(--kit-insp-accent-fg)_20%,transparent)]\"\n : \"bg-kit-insp-tip-bg shadow-[inset_0_0_0_1.5px_var(--kit-insp-line-strong)] focus-visible:shadow-[0_0_0_3px_color-mix(in_srgb,var(--kit-insp-accent-fg)_20%,transparent),inset_0_0_0_1.5px_var(--kit-insp-line-strong)]\",\n className,\n )}\n >\n {filled ? (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden>\n {mixed ? <path d=\"M4.5 8h7\" stroke=\"#fff\" strokeWidth=\"1.8\" strokeLinecap=\"round\" /> : <path d=\"M3.6 8.3l2.7 2.7l6-6.2\" stroke=\"#fff\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />}\n </svg>\n ) : null}\n </button>\n );\n}\n\n/* ── Status icon (F1571) ──────────────────────────────────────────── */\nexport function StatusIcon({ kind = \"success\", size = 14, className }: { kind?: \"success\" | \"error\"; size?: number; className?: string }) {\n const tint = kind === \"success\" ? \"var(--kit-insp-ok-tint)\" : \"var(--kit-insp-err-tint)\";\n const ink = kind === \"success\" ? \"var(--kit-insp-ok)\" : \"var(--kit-insp-err)\";\n return (\n <svg width={size} height={size} viewBox=\"0 0 14 14\" fill=\"none\" aria-hidden className={cn(\"shrink-0\", className)}>\n <circle cx=\"7\" cy=\"7\" r=\"7\" fill={tint} />\n {kind === \"success\" ? (\n <path d=\"M4.4 7.2 6.2 9 9.7 5.3\" stroke={ink} strokeWidth=\"1.6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n ) : (\n <>\n <path d=\"M7 4.2v3.4\" stroke={ink} strokeWidth=\"1.6\" strokeLinecap=\"round\" />\n <path d=\"M7 9.8h.01\" stroke={ink} strokeWidth=\"1.9\" strokeLinecap=\"round\" />\n </>\n )}\n </svg>\n );\n}\n\n/* ── Badge (F1572) ────────────────────────────────────────────────── */\nexport type FoundationBadgeTone = \"gray\" | \"green\" | \"amber\" | \"red\" | \"blue\" | \"violet\" | \"outline\";\nconst BADGE_TONE: Record<FoundationBadgeTone, { box: string; dot: string }> = {\n gray: { box: \"bg-kit-insp-card text-kit-insp-tip-body\", dot: \"bg-kit-group-sub\" },\n green: { box: \"bg-[var(--kit-insp-badge-green)] text-[var(--kit-insp-badge-green-fg)]\", dot: \"bg-[var(--kit-insp-badge-green-dot)]\" },\n amber: { box: \"bg-[var(--kit-insp-badge-amber)] text-kit-insp-count-near\", dot: \"bg-[var(--kit-insp-badge-amber-dot)]\" },\n red: { box: \"bg-kit-insp-delete-bg text-kit-insp-count-over\", dot: \"bg-kit-insp-ring-over\" },\n blue: { box: \"bg-kit-insp-card text-kit-insp-tip-body\", dot: \"bg-[var(--kit-insp-badge-blue-dot)]\" },\n violet: { box: \"bg-kit-insp-card text-kit-insp-tip-body\", dot: \"bg-kit-insp-accent\" },\n outline: { box: \"bg-kit-insp-tip-bg text-kit-insp-tip-body shadow-[inset_0_0_0_1px_var(--kit-insp-line)]\", dot: \"bg-kit-group-sub\" },\n};\nexport function FoundationBadge({\n tone = \"gray\", dot = true, size = \"sm\", className, children,\n}: { tone?: FoundationBadgeTone; dot?: boolean; size?: \"sm\" | \"md\"; className?: string; children: React.ReactNode }) {\n const t = BADGE_TONE[tone];\n return (\n <span\n data-slot=\"kit-fbadge\"\n className={cn(\"inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap text-[12px] font-medium leading-4\", size === \"md\" ? \"h-6 rounded-[6px] pl-2 pr-2.5\" : \"h-5 rounded-[4px] pl-1.5 pr-2\", t.box, className)}\n >\n {dot ? <i aria-hidden className={cn(\"size-[5px] rounded-full\", t.dot)} /> : null}\n {children}\n </span>\n );\n}\n\n/* ── PRO badge (F1576) ────────────────────────────────────────────── */\nexport function BcmsMark({ size = 10 }: { size?: number }) {\n const id = React.useId();\n return (\n <svg width={size} height={(size * 28) / 24} viewBox=\"0 0 24 28\" fill=\"none\" aria-hidden>\n <defs>\n <linearGradient id={id} x1=\"8.8\" y1=\"-2.8\" x2=\"18.9\" y2=\"29.1\" gradientUnits=\"userSpaceOnUse\">\n <stop offset=\".08\" stopColor=\"#A878D2\" />\n <stop offset=\".48\" stopColor=\"#ED6262\" />\n <stop offset=\".92\" stopColor=\"#D13A3A\" />\n </linearGradient>\n </defs>\n <path fill={`url(#${id})`} d=\"M12.76 27L1.51 20.09A3.1 3.1 0 0 1 0 17.4V8.6c0-1.15.62-2.21 1.63-2.77L9.59 1.4a3.2 3.2 0 0 1 2.92-.09l11.32 5.43-9.48 5.42a2.8 2.8 0 0 0-1.6 2.75V27z\" />\n <path fill={`url(#${id})`} d=\"M14.34 16.02v2.85l7.88-5.01c.91-.58 1.47-1.59 1.47-2.67V8.3l-7.89 5.06a3.2 3.2 0 0 0-1.46 2.66zM14.34 22.26v2.85l7.88-5.01c.91-.58 1.47-1.59 1.47-2.67v-2.89l-7.89 5.06a3.2 3.2 0 0 0-1.46 2.66z\" />\n </svg>\n );\n}\nexport function ProBadge({ className }: { className?: string }) {\n return (\n <span data-slot=\"kit-fpro\" className={cn(\"inline-flex h-5 shrink-0 items-center gap-1 rounded-full bg-kit-insp-tip-bg pl-[5px] pr-[7px] text-[10px] font-semibold leading-3 text-kit-insp-tip-body shadow-[inset_0_0_0_1px_var(--kit-insp-line)]\", className)}>\n <BcmsMark size={10} />\n PRO\n </span>\n );\n}\n\n/* ── Text field (F1577) ───────────────────────────────────────────── */\nexport interface FoundationTextFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\"> {\n icon?: React.ReactNode;\n error?: boolean;\n /** after the input: a `SearchClear`, a unit */\n trailing?: React.ReactNode;\n boxClassName?: string;\n}\nexport const FoundationTextField = React.forwardRef<HTMLInputElement, FoundationTextFieldProps>(function FoundationTextField(\n { icon, error, trailing, boxClassName, className, ...rest },\n ref,\n) {\n return (\n <label\n data-slot=\"kit-fin\"\n className={cn(\n \"flex h-[34px] min-w-0 flex-1 items-center gap-2 rounded-[6px] px-2.5 text-kit-insp-faint transition-[background-color,box-shadow] duration-150 [&>svg]:size-4 [&>svg]:shrink-0\",\n error\n ? \"bg-kit-insp-tip-bg shadow-[inset_0_0_0_1px_var(--kit-insp-error)]\"\n : \"bg-kit-insp-card focus-within:bg-kit-insp-tip-bg focus-within:shadow-[inset_0_0_0_1px_var(--kit-insp-accent),0_0_0_3px_color-mix(in_srgb,var(--kit-insp-accent)_15%,transparent)]\",\n boxClassName,\n )}\n >\n {icon}\n <input\n ref={ref}\n aria-invalid={error || undefined}\n className={cn(\"h-full min-w-0 flex-1 border-0 bg-transparent text-[13px] text-kit-insp-tip-title outline-none placeholder:text-kit-group-sub focus-visible:shadow-none\", className)}\n {...rest}\n />\n {trailing}\n </label>\n );\n});\n\n/* ── Search clear (F1596) ─────────────────────────────────────────── */\n/** Out of the tab order: Escape clears from the keyboard (the field's owner handles it). */\nexport function SearchClear({ show, onClear, className }: { show: boolean; onClear: () => void; className?: string }) {\n return (\n <button\n type=\"button\"\n tabIndex={-1}\n aria-label=\"Clear search\"\n aria-hidden={!show || undefined}\n data-slot=\"kit-search-clear\"\n onMouseDown={(e) => e.preventDefault()}\n onClick={onClear}\n className={cn(\n \"grid size-4 shrink-0 place-items-center rounded-full bg-kit-insp-chip text-kit-insp-label transition-[opacity,transform] duration-150 ease-out hover:bg-[var(--kit-insp-chip-hover)]\",\n show ? \"opacity-100\" : \"pointer-events-none scale-50 opacity-0\",\n className,\n )}\n >\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" aria-hidden>\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </svg>\n </button>\n );\n}\n\n/* ── Save status (F1597) ──────────────────────────────────────────── */\nexport type SaveState = \"saved\" | \"saving\" | \"error\" | \"offline\";\nconst SAVE_COPY: Record<SaveState, { label: string; title?: string }> = {\n saved: { label: \"Saved\", title: \"All changes saved\" },\n saving: { label: \"Saving…\" },\n error: { label: \"Couldn’t save · Retry\", title: \"Your latest changes didn’t reach the server. Try again\" },\n offline: { label: \"Offline · changes kept on this device\" },\n};\nconst SAVE_BOX = \"inline-flex h-7 min-w-0 items-center gap-[5px] whitespace-nowrap rounded-[6px] px-1.5 text-[12px] font-medium leading-[18px]\";\n/**\n * The save status chip. `error` makes the whole chip the Retry button. `savedTitle` overrides the hover text of Saved\n * (the prototype's reads \"All changes saved to main\": the branch is the host's to name).\n */\nexport function SaveStatus({ state, onRetry, savedTitle, className }: { state: SaveState; onRetry?: () => void; savedTitle?: string; className?: string }) {\n const copy = SAVE_COPY[state];\n const glyph = (\n <span aria-hidden className={cn(\"relative grid h-3.5 shrink-0 place-items-center transition-[width] duration-150\", state === \"error\" ? \"w-[18px]\" : \"w-3.5\")}>\n {state === \"saving\" ? (\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" className=\"animate-spin [animation-duration:0.8s] motion-reduce:animate-none\">\n <circle cx=\"7\" cy=\"7\" r=\"5.25\" stroke=\"currentColor\" strokeOpacity=\"0.25\" strokeWidth=\"1.5\" />\n <path d=\"M12.25 7A5.25 5.25 0 0 0 7 1.75\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" />\n </svg>\n ) : state === \"error\" ? (\n <svg width=\"18\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M7 18a4.6 4.4 0 0 1 0-9 5 4.5 0 0 1 11 2h1a3.5 3.5 0 0 1 0 7H7M12 11v3M12 16.5h.01\" />\n </svg>\n ) : state === \"offline\" ? (\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d=\"M3 3l18 18M9.6 5.6A5 4.5 0 0 1 18 11h1a3.5 3.5 0 0 1 2.2 6.2M16 18H7a4.6 4.4 0 0 1-1.3-8.6\" />\n </svg>\n ) : (\n <StatusIcon kind=\"success\" />\n )}\n </span>\n );\n const text = <span className=\"min-w-0 truncate\">{copy.label}</span>;\n if (state === \"error\")\n return (\n <button\n type=\"button\"\n data-slot=\"kit-save-status\"\n data-state={state}\n title={copy.title}\n onClick={onRetry}\n className={cn(SAVE_BOX, \"text-kit-insp-count-over outline-none transition-[background-color] duration-[120ms] hover:bg-kit-insp-delete-bg focus-visible:shadow-[0_0_0_2px_var(--kit-insp-tip-bg),0_0_0_4px_var(--kit-insp-accent)]\", className)}\n >\n {glyph}\n {text}\n </button>\n );\n return (\n <span data-slot=\"kit-save-status\" data-state={state} role=\"status\" aria-live=\"polite\" title={state === \"saved\" ? savedTitle ?? copy.title : copy.title} className={cn(SAVE_BOX, \"text-kit-insp-desc\", className)}>\n {glyph}\n {text}\n </span>\n );\n}\n\n/* ── Anchored popover (F1565) ─────────────────────────────────────── */\n/**\n * A panel on an anchor element: in a portal, 6 under the anchor (left edges aligned, or right with `align=\"right\"`),\n * above it when it would cross the window's bottom, never closer than 8 to the left or right edge. A press outside\n * the panel and its anchor closes it, and so does Escape (captured, so nothing behind it also reacts).\n */\nexport function InspectorPopover({\n anchor, onClose, width = 300, align = \"left\", label, className, children,\n}: { anchor: HTMLElement | null; onClose: () => void; width?: number; align?: \"left\" | \"right\"; label: string; className?: string; children: React.ReactNode }) {\n const ref = React.useRef<HTMLDivElement>(null);\n const reduce = useKitReducedMotion();\n const [pos, setPos] = React.useState({ left: -9999, top: 0, origin: \"top left\" });\n React.useLayoutEffect(() => {\n if (!anchor || !ref.current) return;\n const r = anchor.getBoundingClientRect();\n const h = ref.current.offsetHeight;\n const left = align === \"right\" ? r.right - width : r.left;\n let top = r.bottom + 6;\n let above = false;\n if (top + h > window.innerHeight - 8) {\n top = Math.max(8, r.top - h - 6);\n above = true;\n }\n setPos({ left: Math.max(8, Math.min(left, window.innerWidth - width - 8)), top, origin: `${above ? \"bottom\" : \"top\"} ${align}` });\n }, [anchor, width, align]);\n const close = React.useRef(onClose);\n close.current = onClose;\n React.useEffect(() => {\n const down = (e: MouseEvent) => {\n const t = e.target as Node;\n if (!ref.current?.contains(t) && !anchor?.contains(t)) close.current();\n };\n const key = (e: KeyboardEvent) => {\n if (e.key !== \"Escape\") return;\n e.stopPropagation();\n close.current();\n };\n document.addEventListener(\"mousedown\", down);\n document.addEventListener(\"keydown\", key, true);\n return () => {\n document.removeEventListener(\"mousedown\", down);\n document.removeEventListener(\"keydown\", key, true);\n };\n }, [anchor]);\n if (typeof document === \"undefined\") return null;\n return createPortal(\n <motion.div\n ref={ref}\n role=\"dialog\"\n aria-label={label}\n data-kit-scope=\"\"\n data-floating-layer=\"\"\n data-slot=\"kit-insp-popover\"\n className={cn(\n \"fixed z-[var(--kit-z-popover,84)] overflow-hidden rounded-[10px] border border-kit-insp-line bg-kit-insp-tip-bg shadow-[0_1px_1px_rgb(0_0_0/0.04),0_6px_24px_rgb(0_0_0/0.1),0_9px_48px_rgb(0_0_0/0.08)]\",\n className,\n )}\n style={{ left: pos.left, top: pos.top, width, transformOrigin: pos.origin }}\n initial={reduce ? false : { opacity: 0, scale: 0.95, filter: \"blur(2px)\" }}\n animate={{ opacity: 1, scale: 1, filter: \"blur(0px)\" }}\n transition={{ duration: 0.15, ease: \"easeOut\" }}\n >\n {children}\n </motion.div>,\n document.body,\n );\n}\n\n/* ── Button style picker (F1566-F1568) ────────────────────────────── */\nexport type ButtonStyleKey = \"primary\" | \"brand\" | \"secondary\" | \"outline\" | \"ghost\";\nexport const BUTTON_STYLES: { value: ButtonStyleKey; label: string; hint: string }[] = [\n { value: \"primary\", label: \"Solid\", hint: \"Main action\" },\n { value: \"brand\", label: \"Color\", hint: \"Brand colour\" },\n { value: \"secondary\", label: \"Soft\", hint: \"Quiet\" },\n { value: \"outline\", label: \"Outline\", hint: \"Low emphasis\" },\n { value: \"ghost\", label: \"Ghost\", hint: \"Text only\" },\n];\n/** How each style draws the preview button (the site's own button looks; `brand` is the site's brand colour). */\nconst previewStyle = (k: ButtonStyleKey, brand: string): React.CSSProperties =>\n k === \"primary\" ? { background: \"#101010\", color: \"#fff\" }\n : k === \"brand\" ? { background: brand, color: \"#fff\" }\n : k === \"secondary\" ? { background: \"#E8E8E6\", color: \"#101010\" }\n : k === \"outline\" ? { background: \"#fff\", color: \"#101010\", borderColor: \"#D4D4D2\" }\n : { background: \"transparent\", color: \"#101010\" };\n\n/**\n * \"Button style\": five radio rows, each a live preview of the button in that style, its name and a hint, a check on\n * the current one. `styles` narrows the list to what the site's button stores. The footer's \"Edit\" is drawn only when\n * the host says where it goes (`onEdit`). ↑ ↓ move between rows.\n */\nexport function ButtonStylePicker({\n anchor, value, label = \"Get Started\", brand = \"var(--kit-insp-accent-fg)\", styles, onPick, onClose, onEdit, align,\n}: {\n anchor: HTMLElement | null;\n value: ButtonStyleKey;\n /** the button's own text, drawn in every preview */\n label?: string;\n /** the site's brand colour (a CSS colour) for the Color row */\n brand?: string;\n styles?: ButtonStyleKey[];\n onPick: (value: ButtonStyleKey) => void;\n onClose: () => void;\n onEdit?: () => void;\n align?: \"left\" | \"right\";\n}) {\n const list = styles ? BUTTON_STYLES.filter((s) => styles.includes(s.value)) : BUTTON_STYLES;\n const rows = React.useRef<HTMLDivElement>(null);\n const move = (e: React.KeyboardEvent, i: number) => {\n if (e.key !== \"ArrowDown\" && e.key !== \"ArrowUp\") return;\n e.preventDefault();\n const next = Math.max(0, Math.min(list.length - 1, i + (e.key === \"ArrowDown\" ? 1 : -1)));\n rows.current?.querySelectorAll<HTMLButtonElement>(\"[role=radio]\")[next]?.focus();\n };\n return (\n <InspectorPopover anchor={anchor} onClose={onClose} width={300} label=\"Button style\" align={align}>\n <div className=\"flex items-center gap-2 border-b border-kit-insp-divider px-3 py-2.5\">\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden className=\"shrink-0 text-kit-insp-label\">\n <path d=\"m19 11-8-8-8.6 8.6a2 2 0 0 0 0 2.8l5.2 5.2c.8.8 2 .8 2.8 0L19 11ZM5 2l5 5M2 13h15M22 20a2 2 0 1 1-4 0c0-1.6 1.7-2.4 2-4 .3 1.6 2 2.4 2 4Z\" />\n </svg>\n <b className=\"flex-1 text-[13px] font-medium text-kit-insp-ink\">Button style</b>\n <kbd className=\"rounded-[4px] bg-[var(--kit-insp-kbd)] px-[5px] font-kit-sans text-[11px] font-medium leading-[18px] text-kit-insp-desc\">Esc</kbd>\n </div>\n <div ref={rows} role=\"radiogroup\" aria-label=\"Button style\" className=\"flex flex-col gap-1.5 p-2\">\n {list.map((o, i) => {\n const on = value === o.value;\n return (\n <button\n key={o.value}\n type=\"button\"\n role=\"radio\"\n aria-checked={on}\n tabIndex={on || (!list.some((x) => x.value === value) && i === 0) ? 0 : -1}\n onClick={() => onPick(o.value)}\n onKeyDown={(e) => move(e, i)}\n className={cn(\n \"flex items-center gap-3 rounded-[8px] border p-2 text-left outline-none transition-[background-color,border-color] duration-[120ms] focus-visible:shadow-[0_0_0_2px_var(--kit-focus-ring)]\",\n on ? \"border-[var(--kit-insp-opt-on-line)] bg-[var(--kit-insp-opt-on)]\" : \"border-transparent bg-kit-insp-card-focus hover:bg-[var(--kit-insp-opt-hover)]\",\n )}\n >\n <span aria-hidden className=\"pointer-events-none grid h-8 w-[112px] shrink-0 place-items-center truncate rounded-[6px] border border-transparent px-2 text-[12px] font-semibold leading-[18px]\" style={previewStyle(o.value, brand)}>\n {label}\n </span>\n <span className=\"flex min-w-0 flex-1 flex-col gap-px\">\n <b className=\"text-[13px] font-medium text-kit-insp-ink\">{o.label}</b>\n <small className=\"text-[12px] text-kit-insp-quiet\">{o.hint}</small>\n </span>\n {on ? (\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden className=\"shrink-0 text-kit-insp-label\">\n <path d=\"M5 12l5 5L20 7\" />\n </svg>\n ) : null}\n </button>\n );\n })}\n </div>\n <div className=\"flex items-center justify-between gap-3 border-t border-kit-insp-divider px-3 py-2.5 text-[12px] leading-[18px] text-kit-insp-quiet\">\n <span>Styles come from the site style guide</span>\n {onEdit ? (\n <button type=\"button\" onClick={onEdit} className=\"whitespace-nowrap rounded-[4px] text-[12px] font-medium text-kit-insp-accent-fg outline-none hover:underline hover:underline-offset-2 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E,KAwBD;IAEZ,CAAC;GACE,CAAA;GACL,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,oBAAC,QAAD,EAAA,UAAM,wCAA2C,CAAA,GAChD,SACC,oBAAC,UAAD;KAAQ,MAAK;KAAS,SAAS;KAAQ,WAAU;KAA+L,UAAA;IAExO,CAAA,IACN,IACD;;EACW;;AAEtB"}
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -14,3 +14,9 @@ export * from "./spinner";
|
|
|
14
14
|
export * from "./tab";
|
|
15
15
|
export * from "./toast";
|
|
16
16
|
export * from "./autocomplete";
|
|
17
|
+
export * from "./inspector";
|
|
18
|
+
export * from "./tooltip-card";
|
|
19
|
+
export * from "./content-fields";
|
|
20
|
+
export * from "./block-icon-picker";
|
|
21
|
+
export * from "./code-language-menu";
|
|
22
|
+
export * from "./foundations";
|